lg_frontend/static/libs/mars3d-cesium/Cesium.js

15119 lines
4.8 MiB
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* @license
* Cesium - https://github.com/CesiumGS/cesium
* Version 1.114
*
* Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
var Cesium=(()=>{var qTe=Object.create;var JA=Object.defineProperty;var $Te=Object.getOwnPropertyDescriptor;var eSe=Object.getOwnPropertyNames;var tSe=Object.getPrototypeOf,nSe=Object.prototype.hasOwnProperty;var QA=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Gc=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),iSe=(e,t)=>{for(var n in t)JA(e,n,{get:t[n],enumerable:!0})},o6=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of eSe(t))!nSe.call(e,o)&&o!==n&&JA(e,o,{get:()=>t[o],enumerable:!(i=$Te(t,o))||i.enumerable});return e};var T=(e,t,n)=>(n=e!=null?qTe(tSe(e)):{},o6(t||!e||!e.__esModule?JA(n,"default",{value:e,enumerable:!0}):n,e)),oSe=e=>o6(JA({},"__esModule",{value:!0}),e);var S=Gc(()=>{globalThis.CESIUM_WORKER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zEzXT14KGYsMCksdGhpc1sxNF09eChwLDApLHRoaXNbMTVdPXgoZywwKX12YXIgamMsSGMsb2YsT0MsRUMsd20sd2csUkMsU0MsQ0MseEMsUEMsTUMsTkMsc3Qsa249WigoKT0+e1V0KCk7ZHIoKTtZdCgpO0l0KCk7Y3QoKTtIdCgpO1d0KCk7Rm4oKTtKcigpO0F0LnBhY2tlZExlbmd0aD0xNjtBdC5wYWNrPWZ1bmN0aW9uKHQsZSxuKXtyZXR1cm4geS50eXBlT2Yub2JqZWN0KCJ2YWx1ZSIsdCkseS5kZWZpbmVkKCJhcnJheSIsZSksbj14KG4sMCksZVtuKytdPXRbMF0sZVtuKytdPXRbMV0sZVtuKytdPXRbMl0sZVtuKytdPXRbM10sZVtuKytdPXRbNF0sZVtuKytdPXRbNV0sZVtuKytdPXRbNl0sZVtuKytdPXRbN10sZVtuKytdPXRbOF0sZVtuKytdPXRbOV0sZVtuKytdPXRbMTBdLGVbbisrXT10WzExXSxlW24rK109dFsxMl0sZVtuKytdPXRbMTNdLGVbbisrXT10WzE0XSxlW25dPXRbMTVdLGV9O0F0LnVucGFjaz1mdW5jdGlvbih0LGUsbil7cmV0dXJuIHkuZGVmaW5lZCgiYXJyYXkiLHQpLGU9eChlLDApLGgobil8fChuPW5ldyBBdCksblswXT10W2UrK10sblsxXT10W2UrK10sblsyXT10W2UrK10sblszXT10W2UrK10sbls0XT10W2UrK10sbls1XT10W2UrK10sbls2XT10W2UrK10sbls3XT10W2UrK10sbls4XT10W2UrK10sbls5XT10W2UrK10sblsxMF09dFtlKytdLG5bMTFdPXRbZSsrXSxuWzEyXT10W2UrK10sblsxM109dFtlKytdLG5bMTRdPXRbZSsrXSxuWzE1XT10W2VdLG59O0F0LnBhY2tBcnJheT1mdW5jdGlvbih0LGUpe3kuZGVmaW5lZCgiYXJyYXkiLHQpO2xldCBuPXQubGVuZ3RoLG89bioxNjtpZighaChlKSllPW5ldyBBcnJheShvKTtlbHNle2lmKCFBcnJheS5pc0Fyc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FQubmV4dFBvc2l0aW9uLnZhbHVlcy5wdXNoKEQueCxELnksRC56KSxULm5leHRQb3NpdGlvbi52YWx1ZXMucHVzaChELngsRC55LEQueiksVC5uZXh0UG9zaXRpb24udmFsdWVzLnB1c2goRC54LEQueSxELnopLGEubmVnYXRlKHYsdiksYS5hZGQoTCx2LEQpLE4ucG9zaXRpb24udmFsdWVzLnB1c2goRC54LEQueSxELnopLE4ucG9zaXRpb24udmFsdWVzLnB1c2goRC54LEQueSxELnopLE4ucG9zaXRpb24udmFsdWVzLnB1c2goRS54LEUueSxFLnosRS54LEUueSxFLnopLE4ucHJldlBvc2l0aW9uLnZhbHVlcy5wdXNoKEQueCxELnksRC56KSxOLnByZXZQb3NpdGlvbi52YWx1ZXMucHVzaChELngsRC55LEQueiksTi5wcmV2UG9zaXRpb24udmFsdWVzLnB1c2goRC54LEQueSxELnopLE4ucHJldlBvc2l0aW9uLnZhbHVlcy5wdXNoKEQueCxELnksRC56KSxOLm5leHRQb3NpdGlvbi52YWx1ZXMucHVzaChFLngsRS55LEUueixFLngsRS55LEUueiksTi5uZXh0UG9zaXRpb24udmFsdWVzLnB1c2goaVt3KjNdLGlbdyozKzFdLGlbdyozKzJdKSxOLm5leHRQb3NpdGlvbi52YWx1ZXMucHVzaChpW3cqMyszXSxpW3cqMys0XSxpW3cqMys1XSk7bGV0IFU9ZXQuZnJvbUFycmF5KHMsYioyLGtiKSxBPU1hdGguYWJzKFUueSk7VC5leHBhbmRBbmRXaWR0aC52YWx1ZXMucHVzaCgtMSxBLDEsQSksVC5leHBhbmRBbmRXaWR0aC52YWx1ZXMucHVzaCgtMSwtQSwxLC1BKSxOLmV4cGFuZEFuZFdpZHRoLnZhbHVlcy5wdXNoKC0xLEEsMSxBKSxOLmV4cGFuZEFuZFdpZHRoLnZhbHVlcy5wdXNoKC0xLC1BLDEsLUEpO2xldCBTPWEubWFnbml0dWRlU3F1YXJlZChhLnN1YnRyYWN0KEwsTyx6aCkpO2lmKFMvPWEubWF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xOysrZillW24rK109aSxlW24rK109bysrLGVbbisrXT1vLGVbbisrXT1pKyssZVtuKytdPW8sZVtuKytdPWk7ZVtuKytdPWkrKyxlW24rK109byxlW24rK109aX1mb3Iocj10KjIsKytpLCsrbyxzPTA7czxyLTE7KytzKWVbbisrXT1pLGVbbisrXT1vKyssZVtuKytdPW8sZVtuKytdPWkrKyxlW24rK109byxlW24rK109aTtmb3IoZVtuKytdPWksZVtuKytdPW8rKyxlW24rK109byxlW24rK109aSsrLGVbbisrXT1vKyssZVtuKytdPW8sKytvLHM9dC0xO3M+MTstLXMpe2ZvcihlW24rK109bysrLGVbbisrXT1vLGVbbisrXT1pLHI9MipzLGY9MDtmPHItMTsrK2YpZVtuKytdPWksZVtuKytdPW8rKyxlW24rK109byxlW24rK109aSsrLGVbbisrXT1vLGVbbisrXT1pO2VbbisrXT1vKyssZVtuKytdPW8rKyxlW24rK109aSsrfWZvcihzPTA7czwzO3MrKyllW24rK109bysrLGVbbisrXT1vLGVbbisrXT1pO3JldHVybiBlfWZ1bmN0aW9uIENNKHQpe2xldCBlPXQuY2VudGVyO3NjPWEubXVsdGlwbHlCeVNjYWxhcih0LmVsbGlwc29pZC5nZW9kZXRpY1N1cmZhY2VOb3JtYWwoZSxzYyksdC5oZWlnaHQsc2MpLHNjPWEuYWRkKGUsc2Msc2MpO2xldCBuPW5ldyB5dChzYyx0LnNlbWlNYWpvckF4aXMpLG89a3IuY29tcHV0ZUVsbGlwc2VQb3NpdGlvbnModCwhMCwhMSkscj1vLnBvc2l0aW9ucyxpPW8ubnVtUHRzLHM9Yncocix0LCExKSxmPXd3KGkpO3JldHVybiBmPUR0LmNyZWF0ZVR5cGVkQXJyYXkoci5sZW5ndGgvMyxmKSx7Ym91bmRpbmdTcGhlcmU6bixhdHRyaWJ1dGVzOnMsaW5kaWNlczpmfX1mdW5jdGlvbiB4TSh0LGUpe2xldCBuPWUudmVydGV4Rm9ybWF0LG89ZS5jZW50ZXIscj1lLnNlbWlNYWpvckF4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0xZS01O2ZvcihsZXQgWmU9YmU7WmU8bG47KytaZSl7bGV0IGNuPVplO2NuPDAmJihjbj0wKSxjbj49bCYmKGNuPWwtMSk7bGV0IEtlPWIubm9ydGgtZnQqY247bT9LZT1mKEtlKTpLZT1zLTIqcihpKC1LZSpnKSk7bGV0IGhuPShLZS1FKS8oQy1FKTtobj1NLmNsYW1wKGhuLDAsMSk7bGV0IHVvPVplPT09YmUscW49WmU9PT1sbi0xO3A+MCYmKHVvP0tlKz1vZSpSOnFuJiYoS2UtPW9lKlIpKTtsZXQgS249ZShLZSksbG89bihLZSksemU9TnQqbG8sTmU7TCYmKE5lPShlby5nZW9kZXRpY0xhdGl0dWRlVG9NZXJjYXRvckFuZ2xlKEtlKS1WdCkqenQpO2ZvcihsZXQgRG49cG47RG48VG47KytEbil7bGV0IFduPURuO1duPDAmJihXbj0wKSxXbj49YyYmKFduPWMtMSk7bGV0IGpvPWNuKihjKkgpK1duKkgscm47aWYoaj09PTEpcm49dVtqb107ZWxzZXtybj0wO2xldCBwbztpZihLKWZvcihwbz0wO3BvPGo7Kytwbylybj1ybiprK3Vbam8rcG9dO2Vsc2UgZm9yKHBvPWotMTtwbz49MDstLXBvKXJuPXJuKmsrdVtqbytwb119cm49cm4qUCtGLHh0PU1hdGgubWF4KHh0LHJuKSxPdD1NYXRoLm1pbihPdCxybik7bGV0IE9uPWIud2VzdCtRKlduO20/T249ZihPbik6T249T24qZztsZXQgYXI9KE9uLU8pLyhULU8pO2FyPU0uY2xhbXAoYXIsMCwxKTtsZXQgWm49Y24qYytXbjtpZihwPjApe2xldCBwbz1Ebj09PXBuLElyPURuPT09VG4tMSxQYz11b3x8cW58fHBvfHxJcjtpZigodW98fHFuKSYmKHBvfHxJcikpY29udGludWU7UGMmJihybi09cCxwbz8oWm49ZmUrKGwtY24tMSksT24tPW9lKlgpOnFuP1puPWZlK2wrKGMtV24tMSk6SXI/KFpuPWZlK2wrYytjbixPbis9b2UqWCk6dW8mJihabj1mZStsK2Mr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LyhwLWwtMSk7Zm9yKFU9MDtVPHA7KytVKXtsZXQgaz1VKjMsSz1hLmZyb21BcnJheShjLGssZjEpLFg9YS5mcm9tQXJyYXkodSxrLEpkKTtpZihyLnBvc2l0aW9uJiYobVtPKytdPVgueCxtW08rK109WC55LG1bTysrXT1YLnosbVtPKytdPUsueCxtW08rK109Sy55LG1bTysrXT1LLnopLHIuc3QmJih3W04rK109QSx3W04rK109MCx3W04rK109QSx3W04rK109MSksci5ub3JtYWx8fHIudGFuZ2VudHx8ci5iaXRhbmdlbnQpe2xldCBSPWEuY2xvbmUoYS5aRVJPLEpSKSxRPWEuc3VidHJhY3QoSyxzLmdlb2RldGljU3VyZmFjZU5vcm1hbChLLEpkKSxKZCk7aWYoVSsxPHAmJihSPWEuZnJvbUFycmF5KGMsayszLEpSKSksRCl7bGV0IGZ0PWEuc3VidHJhY3QoUixLLGRVKSxwdD1hLnN1YnRyYWN0KFEsSyxmMSk7ST1hLm5vcm1hbGl6ZShhLmNyb3NzKHB0LGZ0LEkpLEkpLEQ9ITF9YS5lcXVhbHNFcHNpbG9uKEssUixNLkVQU0lMT04xMCk/RD0hMDooQSs9UyxyLnRhbmdlbnQmJihMPWEubm9ybWFsaXplKGEuc3VidHJhY3QoUixLLEwpLEwpKSxyLmJpdGFuZ2VudCYmKHY9YS5ub3JtYWxpemUoYS5jcm9zcyhJLEwsdiksdikpKSxyLm5vcm1hbCYmKF9bRSsrXT1JLngsX1tFKytdPUkueSxfW0UrK109SS56LF9bRSsrXT1JLngsX1tFKytdPUkueSxfW0UrK109SS56KSxyLnRhbmdlbnQmJihnW0MrK109TC54LGdbQysrXT1MLnksZ1tDKytdPUwueixnW0MrK109TC54LGdbQysrXT1MLnksZ1tDKytdPUwueiksci5iaXRhbmdlbnQmJihiW1QrK109di54LGJbVCsrXT12LnksYltUKytdPXYueixiW1QrK109di54LGJbVCsrXT12LnksYltUKytdPXYueil9fWxldCBQPW5ldyByZTtyLnBvc2l0aW9uJiYoUC5wb3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T5yMSgpKX0sZVY9KCk9PntQcm9taXNlLnJlc29sdmUoKS50aGVuKCgpPT5jMSgpKX0sblY9KCk9PntQcm9taXNlLnJlc29sdmUoKS50aGVuKCgpPT5wMSgpKX0sb1Y9KCk9PntQcm9taXNlLnJlc29sdmUoKS50aGVuKCgpPT5oMSgpKX0sclY9KCk9PntQcm9taXNlLnJlc29sdmUoKS50aGVuKCgpPT53MSgpKX0saVY9KCk9PntQcm9taXNlLnJlc29sdmUoKS50aGVuKCgpPT5VMSgpKX0sc1Y9KCk9PntQcm9taXNlLnJlc29sdmUoKS50aGVuKCgpPT56MSgpKX0sY1Y9KCk9PntQcm9taXNlLnJlc29sdmUoKS50aGVuKCgpPT5YMSgpKX0sYVY9KCk9PntQcm9taXNlLnJlc29sdmUoKS50aGVuKCgpPT5ZMSgpKX0sZlY9KCk9PntQcm9taXNlLnJlc29sdmUoKS50aGVuKCgpPT5aMSgpKX07cmV0dXJuIEdTKHVWKTt9KSgpOwo=")});var jA=Gc((PTt,s6)=>{var vTt=T(S()),op=function(e){e==null&&(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,e.constructor==Array?this.init_by_array(e,e.length):this.init_seed(e)};op.prototype.init_seed=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]=(((e&4294901760)>>>16)*1812433253<<16)+(e&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};op.prototype.init_by_array=function(e,t){var n,i,o;for(this.init_seed(19650218),n=1,i=0,o=this.N>t?this.N:t;o;o--){var r=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((r&4294901760)>>>16)*1664525<<16)+(r&65535)*1664525)+e[i]+i,this.mt[n]>>>=0,n++,i++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),i>=t&&(i=0)}for(o=this.N-1;o;o--){var r=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((r&4294901760)>>>16)*1566083941<<16)+(r&65535)*1566083941)-n,this.mt[n]>>>=0,n++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1)}this.mt[0]=2147483648};op.prototype.random_int=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[e&1];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>1^t[e&1];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[e&1],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0};op.prototype.random_int31=function(){return this.random_int()>>>1};op.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};op.prototype.random=function(){return this.random_int()*(1/4294967296)};op.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};op.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};s6.exports=op});var k6=Gc((RS,ZS)=>{var LVt=T(S());/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof RS=="object"&&RS&&!RS.nodeType&&RS,n=typeof ZS=="object"&&ZS&&!ZS.nodeType&&ZS,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var o,r=2147483647,s=36,a=1,c=26,d=38,u=700,m=72,p=128,y="-",f=/^xn--/,x=/[^\x20-\x7E]/,_=/[\x2E\u3002\uFF0E\uFF61]/g,C={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},V=s-a,L=Math.floor,Z=String.fromCharCode,G;function I(k){throw new RangeError(C[k])}function P(k,Y){for(var U=k.length,J=[];U--;)J[U]=Y(k[U]);return J}function v(k,Y){var U=k.split("@"),J="";U.length>1&&(J=U[0]+"@",k=U[1]),k=k.replace(_,".");var K=k.split("."),ee=P(K,Y).join(".");return J+ee}function F(k){for(var Y=[],U=0,J=k.length,K,ee;U<J;)K=k.charCodeAt(U++),K>=55296&&K<=56319&&U<J?(ee=k.charCodeAt(U++),(ee&64512)==56320?Y.push(((K&1023)<<10)+(ee&1023)+65536):(Y.push(K),U--)):Y.push(K);return Y}function M(k){return P(k,function(Y){var U="";return Y>65535&&(Y-=65536,U+=Z(Y>>>10&1023|55296),Y=56320|Y&1023),U+=Z(Y),U}).join("")}function b(k){return k-48<10?k-22:k-65<26?k-65:k-97<26?k-97:s}function R(k,Y){return k+22+75*(k<26)-((Y!=0)<<5)}function E(k,Y,U){var J=0;for(k=U?L(k/u):k>>1,k+=L(k/Y);k>V*c>>1;J+=s)k=L(k/V);return L(J+(V+1)*k/(k+d))}function X(k){var Y=[],U=k.length,J,K=0,ee=p,H=m,j,$,pe,ge,ae,be,_e,Ze,Le;for(j=k.lastIndexOf(y),j<0&&(j=0),$=0;$<j;++$)k.charCodeAt($)>=128&&I("not-basic"),Y.push(k.charCodeAt($));for(pe=j>0?j+1:0;pe<U;){for(ge=K,ae=1,be=s;pe>=U&&I("invalid-input"),_e=b(k.charCodeAt(pe++)),(_e>=s||_e>L((r-K)/ae))&&I("overflow"),K+=_e*ae,Ze=be<=H?a:be>=H+c?c:be-H,!(_e<Ze);be+=s)Le=s-Ze,ae>L(r/Le)&&I("overflow"),ae*=Le;J=Y.length+1,H=E(K-ge,J,ge==0),L(K/J)>r-ee&&I("overflow"),ee+=L(K/J),K%=J,Y.splice(K++,0,ee)}return M(Y)}function w(k){var Y,U,J,K,ee,H,j,$,pe,ge,ae,be=[],_e,Ze,Le,Ee;for(k=F(k),_e=k.length,Y=p,U=0,ee=m,H=0;H<_e;++H)ae=k[H],ae<128&&be.push(Z(ae));for(J=K=be.length,K&&be.push(y);J<_e;){for(j=r,H=0;H<_e;++H)ae=k[H],ae>=Y&&ae<j&&(j=ae);for(Ze=J+1,j-Y>L((r-U)/Ze)&&I("overflow"),U+=(j-Y)*Ze,Y=j,H=0;H<_e;++H)if(ae=k[H],ae<Y&&++U>r&&I("overflow"),ae==Y){for($=U,pe=s;ge=pe<=ee?a:pe>=ee+c?c:pe-ee,!($<ge);pe+=s)Ee=$-ge,Le=s-ge,be.push(Z(R(ge+Ee%Le,0))),$=L(Ee/Le);be.push(Z(R($,0))),ee=E(U,Ze,J==K),U=0,++J}++U,++Y}return be.join("")}function N(k){return v(k,function(Y){return f.test(Y)?X(Y.slice(4).toLowerCase()):Y})}function D(k){return v(k,function(Y){return x.test(Y)?"xn--"+w(Y):Y})}if(o={version:"1.3.2",ucs2:{decode:F,encode:M},decode:X,encode:w,toASCII:D,toUnicode:N},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return o});else if(t&&n)if(ZS.exports==t)n.exports=o;else for(G in o)o.hasOwnProperty(G)&&(t[G]=o[G]);else e.punycode=o})(RS)});var B6=Gc((D6,xM)=>{var RVt=T(S());/*!
* URI.js - Mutating URLs
* IPv6 Support
*
* Version: 1.19.11
*
* Author: Rodney Rehm
* Web: http://medialize.github.io/URI.js/
*
* Licensed under
* MIT License http://www.opensource.org/licenses/mit-license
*
*/(function(e,t){"use strict";typeof xM=="object"&&xM.exports?xM.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(D6,function(e){"use strict";var t=e&&e.IPv6;function n(o){var r=o.toLowerCase(),s=r.split(":"),a=s.length,c=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[a-1]===""&&s[a-2]===""&&s.pop(),a=s.length,s[a-1].indexOf(".")!==-1&&(c=7);var d;for(d=0;d<a&&s[d]!=="";d++);if(d<c)for(s.splice(d,1,"0000");s.length<c;)s.splice(d,0,"0000");for(var u,m=0;m<c;m++){u=s[m].split("");for(var p=0;p<3&&(u[0]==="0"&&u.length>1);p++)u.splice(0,1);s[m]=u.join("")}var y=-1,f=0,x=0,_=-1,C=!1;for(m=0;m<c;m++)C?s[m]==="0"?x+=1:(C=!1,x>f&&(y=_,f=x)):s[m]==="0"&&(C=!0,_=m,x=1);x>f&&(y=_,f=x),f>1&&s.splice(y,f,""),a=s.length;var V="";for(s[0]===""&&(V=":"),m=0;m<a&&(V+=s[m],m!==a-1);m++)V+=":";return s[a-1]===""&&(V+=":"),V}function i(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:i}})});var Y6=Gc((O6,_M)=>{var ZVt=T(S());/*!
* URI.js - Mutating URLs
* Second Level Domain (SLD) Support
*
* Version: 1.19.11
*
* Author: Rodney Rehm
* Web: http://medialize.github.io/URI.js/
*
* Licensed under
* MIT License http://www.opensource.org/licenses/mit-license
*
*/(function(e,t){"use strict";typeof _M=="object"&&_M.exports?_M.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(O6,function(e){"use strict";var t=e&&e.SecondLevelDomains,n={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return!1;var r=i.lastIndexOf(".",o-1);if(r<=0||r>=o-1)return!1;var s=n.list[i.slice(o+1)];return s?s.indexOf(" "+i.slice(r+1,o)+" ")>=0:!1},is:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return!1;var r=i.lastIndexOf(".",o-1);if(r>=0)return!1;var s=n.list[i.slice(o+1)];return s?s.indexOf(" "+i.slice(0,o)+" ")>=0:!1},get:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return null;var r=i.lastIndexOf(".",o-1);if(r<=0||r>=o-1)return null;var s=n.list[i.slice(o+1)];return!s||s.indexOf(" "+i.slice(r+1,o)+" ")<0?null:i.slice(r+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n})});var $l=Gc((H6,TM)=>{var GVt=T(S());/*!
* URI.js - Mutating URLs
*
* Version: 1.19.11
*
* Author: Rodney Rehm
* Web: http://medialize.github.io/URI.js/
*
* Licensed under
* MIT License http://www.opensource.org/licenses/mit-license
*
*/(function(e,t){"use strict";typeof TM=="object"&&TM.exports?TM.exports=t(k6(),B6(),Y6()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(H6,function(e,t,n,i){"use strict";var o=i&&i.URI;function r(R,E){var X=arguments.length>=1,w=arguments.length>=2;if(!(this instanceof r))return X?w?new r(R,E):new r(R):new r;if(R===void 0){if(X)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?R=location.href+"":R=""}if(R===null&&X)throw new TypeError("null is not a valid argument for URI");return this.href(R),E!==void 0?this.absoluteTo(E):this}function s(R){return/^[0-9]+$/.test(R)}r.version="1.19.11";var a=r.prototype,c=Object.prototype.hasOwnProperty;function d(R){return R.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function u(R){return R===void 0?"Undefined":String(Object.prototype.toString.call(R)).slice(8,-1)}function m(R){return u(R)==="Array"}function p(R,E){var X={},w,N;if(u(E)==="RegExp")X=null;else if(m(E))for(w=0,N=E.length;w<N;w++)X[E[w]]=!0;else X[E]=!0;for(w=0,N=R.length;w<N;w++){var D=X&&X[R[w]]!==void 0||!X&&E.test(R[w]);D&&(R.splice(w,1),N--,w--)}return R}function y(R,E){var X,w;if(m(E)){for(X=0,w=E.length;X<w;X++)if(!y(R,E[X]))return!1;return!0}var N=u(E);for(X=0,w=R.length;X<w;X++)if(N==="RegExp"){if(typeof R[X]=="string"&&R[X].match(E))return!0}else if(R[X]===E)return!0;return!1}function f(R,E){if(!m(R)||!m(E)||R.length!==E.length)return!1;R.sort(),E.sort();for(var X=0,w=R.length;X<w;X++)if(R[X]!==E[X])return!1;return!0}function x(R){var E=/^\/+|\/+$/g;return R.replace(E,"")}r._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:r.preventInvalidHostname,duplicateQueryParameters:r.duplicateQueryParameters,escapeQuerySpace:r.escapeQuerySpace}},r.preventInvalidHostname=!1,r.duplicateQueryParameters=!1,r.escapeQuerySpace=!0,r.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,r.idn_expression=/[^a-z0-9\._-]/i,r.punycode_expression=/(xn--)/i,r.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,r.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1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<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,r.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},r.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,r.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,r.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},r.hostProtocols=["http","https"],r.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,r.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},r.getDomAttribute=function(R){if(!(!R||!R.nodeName)){var E=R.nodeName.toLowerCase();if(!(E==="input"&&R.type!=="image"))return r.domAttributes[E]}};function _(R){return escape(R)}function C(R){return encodeURIComponent(R).replace(/[!'()*]/g,_).replace(/\*/g,"%2A")}r.encode=C,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=C,r.decode=decodeURIComponent},r.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},r.encodeQuery=function(R,E){var X=r.encode(R+"");return E===void 0&&(E=r.escapeQuerySpace),E?X.replace(/%20/g,"+"):X},r.decodeQuery=function(R,E){R+="",E===void 0&&(E=r.escapeQuerySpace);try{return r.decode(E?R.replace(/\+/g,"%20"):R)}catch{return R}};var V={encode:"encode",decode:"decode"},L,Z=function(R,E){return function(X){try{return r[E](X+"").replace(r.characters[R][E].expression,function(w){return r.characters[R][E].map[w]})}catch{return X}}};for(L in V)r[L+"PathSegment"]=Z("pathname",V[L]),r[L+"UrnPathSegment"]=Z("urnpath",V[L]);var G=function(R,E,X){return function(w){var N;X?N=function(U){return r[E](r[X](U))}:N=r[E];for(var D=(w+"").split(R),k=0,Y=D.length;k<Y;k++)D[k]=N(D[k]);return D.join(R)}};r.decodePath=G("/","decodePathSegment"),r.decodeUrnPath=G(":","decodeUrnPathSegment"),r.recodePath=G("/","encodePathSegment","decode"),r.recodeUrnPath=G(":","encodeUrnPathSegment","decode"),r.encodeReserved=Z("reserved","encode"),r.parse=function(R,E){var X;return E||(E={preventInvalidHostname:r.preventInvalidHostname}),R=R.replace(r.leading_whitespace_expression,""),R=R.replace(r.ascii_tab_whitespace,""),X=R.indexOf("#"),X>-1&&(E.fragment=R.substring(X+1)||null,R=R.substring(0,X)),X=R.indexOf("?"),X>-1&&(E.query=R.substring(X+1)||null,R=R.substring(0,X)),R=R.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),R=R.replace(/^[/\\]{2,}/i,"//"),R.substring(0,2)==="//"?(E.protocol=null,R=R.substring(2),R=r.parseAuthority(R,E)):(X=R.indexOf(":"),X>-1&&(E.protocol=R.substring(0,X)||null,E.protocol&&!E.protocol.match(r.protocol_expression)?E.protocol=void 0:R.substring(X+1,X+3).replace(/\\/g,"/")==="//"?(R=R.substring(X+3),R=r.parseAuthority(R,E)):(R=R.substring(X+1),E.urn=!0))),E.path=R,E},r.parseHost=function(R,E){R||(R=""),R=R.replace(/\\/g,"/");var X=R.indexOf("/"),w,N;if(X===-1&&(X=R.length),R.charAt(0)==="[")w=R.indexOf("]"),E.hostname=R.substring(1,w)||null,E.port=R.substring(w+2,X)||null,E.port==="/"&&(E.port=null);else{var D=R.indexOf(":"),k=R.indexOf("/"),Y=R.indexOf(":",D+1);Y!==-1&&(k===-1||Y<k)?(E.hostname=R.substring(0,X)||null,E.port=null):(N=R.substring(0,X).split(":"),E.hostname=N[0]||null,E.port=N[1]||null)}return E.hostname&&R.substring(X).charAt(0)!=="/"&&(X++,R="/"+R),E.preventInvalidHostname&&r.ensureValidHostname(E.hostname,E.protocol),E.port&&r.ensureValidPort(E.port),R.substring(X)||"/"},r.parseAuthority=function(R,E){return R=r.parseUserinfo(R,E),r.parseHost(R,E)},r.parseUserinfo=function(R,E){var X=R,w=R.indexOf("\\");w!==-1&&(R=R.replace(/\\/g,"/"));var N=R.indexOf("/"),D=R.lastIndexOf("@",N>-1?N:R.length-1),k;return D>-1&&(N===-1||D<N)?(k=R.substring(0,D).split(":"),E.username=k[0]?r.decode(k[0]):null,k.shift(),E.password=k[0]?r.decode(k.join(":")):null,R=X.substring(D+1)):(E.username=null,E.password=null),R},r.parseQuery=function(R,E){if(!R)return{};if(R=R.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!R)return{};for(var X={},w=R.split("&"),N=w.length,D,k,Y,U=0;U<N;U++)D=w[U].split("="),k=r.decodeQuery(D.shift(),E),Y=D.length?r.decodeQuery(D.join("="),E):null,k!=="__proto__"&&(c.call(X,k)?((typeof X[k]=="string"||X[k]===null)&&(X[k]=[X[k]]),X[k].push(Y)):X[k]=Y);return X},r.build=function(R){var E="",X=!1;return R.protocol&&(E+=R.protocol+":"),!R.urn&&(E||R.hostname)&&(E+="//",X=!0),E+=r.buildAuthority(R)||"",typeof R.path=="string"&&(R.path.charAt(0)!=="/"&&X&&(E+="/"),E+=R.path),typeof R.query=="string"&&R.query&&(E+="?"+R.query),typeof R.fragment=="string"&&R.fragment&&(E+="#"+R.fragment),E},r.buildHost=function(R){var E="";if(R.hostname)r.ip6_expression.test(R.hostname)?E+="["+R.hostname+"]":E+=R.hostname;else return"";return R.port&&(E+=":"+R.port),E},r.buildAuthority=function(R){return r.buildUserinfo(R)+r.buildHost(R)},r.buildUserinfo=function(R){var E="";return R.username&&(E+=r.encode(R.username)),R.password&&(E+=":"+r.encode(R.password)),E&&(E+="@"),E},r.buildQuery=function(R,E,X){var w="",N,D,k,Y;for(D in R)if(D!=="__proto__"&&c.call(R,D))if(m(R[D]))for(N={},k=0,Y=R[D].length;k<Y;k++)R[D][k]!==void 0&&N[R[D][k]+""]===void 0&&(w+="&"+r.buildQueryParameter(D,R[D][k],X),E!==!0&&(N[R[D][k]+""]=!0));else R[D]!==void 0&&(w+="&"+r.buildQueryParameter(D,R[D],X));return w.substring(1)},r.buildQueryParameter=function(R,E,X){return r.encodeQuery(R,X)+(E!==null?"="+r.encodeQuery(E,X):"")},r.addQuery=function(R,E,X){if(typeof E=="object")for(var w in E)c.call(E,w)&&r.addQuery(R,w,E[w]);else if(typeof E=="string"){if(R[E]===void 0){R[E]=X;return}else typeof R[E]=="string"&&(R[E]=[R[E]]);m(X)||(X=[X]),R[E]=(R[E]||[]).concat(X)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(R,E,X){if(typeof E=="object")for(var w in E)c.call(E,w)&&r.setQuery(R,w,E[w]);else if(typeof E=="string")R[E]=X===void 0?null:X;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(R,E,X){var w,N,D;if(m(E))for(w=0,N=E.length;w<N;w++)R[E[w]]=void 0;else if(u(E)==="RegExp")for(D in R)E.test(D)&&(R[D]=void 0);else if(typeof E=="object")for(D in E)c.call(E,D)&&r.removeQuery(R,D,E[D]);else if(typeof E=="string")X!==void 0?u(X)==="RegExp"?!m(R[E])&&X.test(R[E])?R[E]=void 0:R[E]=p(R[E],X):R[E]===String(X)&&(!m(X)||X.length===1)?R[E]=void 0:m(R[E])&&(R[E]=p(R[E],X)):R[E]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(R,E,X,w){switch(u(E)){case"String":break;case"RegExp":for(var N in R)if(c.call(R,N)&&E.test(N)&&(X===void 0||r.hasQuery(R,N,X)))return!0;return!1;case"Object":for(var D in E)if(c.call(E,D)&&!r.hasQuery(R,D,E[D]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(u(X)){case"Undefined":return E in R;case"Boolean":var k=!!(m(R[E])?R[E].length:R[E]);return X===k;case"Function":return!!X(R[E],E,R);case"Array":if(!m(R[E]))return!1;var Y=w?y:f;return Y(R[E],X);case"RegExp":return m(R[E])?w?y(R[E],X):!1:!!(R[E]&&R[E].match(X));case"Number":X=String(X);case"String":return m(R[E])?w?y(R[E],X):!1:R[E]===X;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var R=[],E=[],X=0,w=0;w<arguments.length;w++){var N=new r(arguments[w]);R.push(N);for(var D=N.segment(),k=0;k<D.length;k++)typeof D[k]=="string"&&E.push(D[k]),D[k]&&X++}if(!E.length||!X)return new r("");var Y=new r("").segment(E);return(R[0].path()===""||R[0].path().slice(0,1)==="/")&&Y.path("/"+Y.path()),Y.normalize()},r.commonPath=function(R,E){var X=Math.min(R.length,E.length),w;for(w=0;w<X;w++)if(R.charAt(w)!==E.charAt(w)){w--;break}return w<1?R.charAt(0)===E.charAt(0)&&R.charAt(0)==="/"?"/":"":((R.charAt(w)!=="/"||E.charAt(w)!=="/")&&(w=R.substring(0,w).lastIndexOf("/")),R.substring(0,w+1))},r.withinString=function(R,E,X){X||(X={});var w=X.start||r.findUri.start,N=X.end||r.findUri.end,D=X.trim||r.findUri.trim,k=X.parens||r.findUri.parens,Y=/[a-z0-9-]=["']?$/i;for(w.lastIndex=0;;){var U=w.exec(R);if(!U)break;var J=U.index;if(X.ignoreHtml){var K=R.slice(Math.max(J-3,0),J);if(K&&Y.test(K))continue}for(var ee=J+R.slice(J).search(N),H=R.slice(J,ee),j=-1;;){var $=k.exec(H);if(!$)break;var pe=$.index+$[0].length;j=Math.max(j,pe)}if(j>-1?H=H.slice(0,j)+H.slice(j).replace(D,""):H=H.replace(D,""),!(H.length<=U[0].length)&&!(X.ignore&&X.ignore.test(H))){ee=J+H.length;var ge=E(H,J,ee,R);if(ge===void 0){w.lastIndex=ee;continue}ge=String(ge),R=R.slice(0,J)+ge+R.slice(ee),w.lastIndex=J+ge.length}}return w.lastIndex=0,R},r.ensureValidHostname=function(R,E){var X=!!R,w=!!E,N=!1;if(w&&(N=y(r.hostProtocols,E)),N&&!X)throw new TypeError("Hostname cannot be empty, if protocol is "+E);if(R&&R.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+R+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(R).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+R+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(R){if(R){var E=Number(R);if(!(s(E)&&E>0&&E<65536))throw new TypeError('Port "'+R+'" is not a valid port')}},r.noConflict=function(R){if(R){var E={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(E.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(E.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(E.SecondLevelDomains=i.SecondLevelDomains.noConflict()),E}else i.URI===this&&(i.URI=o);return this},a.build=function(R){return R===!0?this._deferred_build=!0:(R===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},a.clone=function(){return new r(this)},a.valueOf=a.toString=function(){return this.build(!1)._string};function I(R){return function(E,X){return E===void 0?this._parts[R]||"":(this._parts[R]=E||null,this.build(!X),this)}}function P(R,E){return function(X,w){return X===void 0?this._parts[R]||"":(X!==null&&(X=X+"",X.charAt(0)===E&&(X=X.substring(1))),this._parts[R]=X,this.build(!w),this)}}a.protocol=I("protocol"),a.username=I("username"),a.password=I("password"),a.hostname=I("hostname"),a.port=I("port"),a.query=P("query","?"),a.fragment=P("fragment","#"),a.search=function(R,E){var X=this.query(R,E);return typeof X=="string"&&X.length?"?"+X:X},a.hash=function(R,E){var X=this.fragment(R,E);return typeof X=="string"&&X.length?"#"+X:X},a.pathname=function(R,E){if(R===void 0||R===!0){var X=this._parts.path||(this._parts.hostname?"/":"");return R?(this._parts.urn?r.decodeUrnPath:r.decodePath)(X):X}else return this._parts.urn?this._parts.path=R?r.recodeUrnPath(R):"":this._parts.path=R?r.recodePath(R):"/",this.build(!E),this},a.path=a.pathname,a.href=function(R,E){var X;if(R===void 0)return this.toString();this._string="",this._parts=r._parts();var w=R instanceof r,N=typeof R=="object"&&(R.hostname||R.path||R.pathname);if(R.nodeName){var D=r.getDomAttribute(R);R=R[D]||"",N=!1}if(!w&&N&&R.pathname!==void 0&&(R=R.toString()),typeof R=="string"||R instanceof String)this._parts=r.parse(String(R),this._parts);else if(w||N){var k=w?R._parts:R;for(X in k)X!=="query"&&c.call(this._parts,X)&&(this._parts[X]=k[X]);k.query&&this.query(k.query,!1)}else throw new TypeError("invalid input");return this.build(!E),this},a.is=function(R){var E=!1,X=!1,w=!1,N=!1,D=!1,k=!1,Y=!1,U=!this._parts.urn;switch(this._parts.hostname&&(U=!1,X=r.ip4_expression.test(this._parts.hostname),w=r.ip6_expression.test(this._parts.hostname),E=X||w,N=!E,D=N&&n&&n.has(this._parts.hostname),k=N&&r.idn_expression.test(this._parts.hostname),Y=N&&r.punycode_expression.test(this._parts.hostname)),R.toLowerCase()){case"relative":return U;case"absolute":return!U;case"domain":case"name":return N;case"sld":return D;case"ip":return E;case"ip4":case"ipv4":case"inet4":return X;case"ip6":case"ipv6":case"inet6":return w;case"idn":return k;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return Y}return null};var v=a.protocol,F=a.port,M=a.hostname;a.protocol=function(R,E){if(R&&(R=R.replace(/:(\/\/)?$/,""),!R.match(r.protocol_expression)))throw new TypeError('Protocol "'+R+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return v.call(this,R,E)},a.scheme=a.protocol,a.port=function(R,E){return this._parts.urn?R===void 0?"":this:(R!==void 0&&(R===0&&(R=null),R&&(R+="",R.charAt(0)===":"&&(R=R.substring(1)),r.ensureValidPort(R))),F.call(this,R,E))},a.hostname=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R!==void 0){var X={preventInvalidHostname:this._parts.preventInvalidHostname},w=r.parseHost(R,X);if(w!=="/")throw new TypeError('Hostname "'+R+'" contains characters other than [A-Z0-9.-]');R=X.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(R,this._parts.protocol)}return M.call(this,R,E)},a.origin=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R===void 0){var X=this.protocol(),w=this.authority();return w?(X?X+"://":"")+this.authority():""}else{var N=r(R);return this.protocol(N.protocol()).authority(N.authority()).build(!E),this}},a.host=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var X=r.parseHost(R,this._parts);if(X!=="/")throw new TypeError('Hostname "'+R+'" contains characters other than [A-Z0-9.-]');return this.build(!E),this},a.authority=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var X=r.parseAuthority(R,this._parts);if(X!=="/")throw new TypeError('Hostname "'+R+'" contains characters other than [A-Z0-9.-]');return this.build(!E),this},a.userinfo=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R===void 0){var X=r.buildUserinfo(this._parts);return X&&X.substring(0,X.length-1)}else return R[R.length-1]!=="@"&&(R+="@"),r.parseUserinfo(R,this._parts),this.build(!E),this},a.resource=function(R,E){var X;return R===void 0?this.path()+this.search()+this.hash():(X=r.parse(R),this._parts.path=X.path,this._parts.query=X.query,this._parts.fragment=X.fragment,this.build(!E),this)},a.subdomain=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R===void 0){if(!this._parts.hostname||this.is("IP"))return"";var X=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,X)||""}else{var w=this._parts.hostname.length-this.domain().length,N=this._parts.hostname.substring(0,w),D=new RegExp("^"+d(N));if(R&&R.charAt(R.length-1)!=="."&&(R+="."),R.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return R&&r.ensureValidHostname(R,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(D,R),this.build(!E),this}},a.domain=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(typeof R=="boolean"&&(E=R,R=void 0),R===void 0){if(!this._parts.hostname||this.is("IP"))return"";var X=this._parts.hostname.match(/\./g);if(X&&X.length<2)return this._parts.hostname;var w=this._parts.hostname.length-this.tld(E).length-1;return w=this._parts.hostname.lastIndexOf(".",w-1)+1,this._parts.hostname.substring(w)||""}else{if(!R)throw new TypeError("cannot set domain empty");if(R.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(R,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=R;else{var N=new RegExp(d(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(N,R)}return this.build(!E),this}},a.tld=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(typeof R=="boolean"&&(E=R,R=void 0),R===void 0){if(!this._parts.hostname||this.is("IP"))return"";var X=this._parts.hostname.lastIndexOf("."),w=this._parts.hostname.substring(X+1);return E!==!0&&n&&n.list[w.toLowerCase()]&&n.get(this._parts.hostname)||w}else{var N;if(R)if(R.match(/[^a-zA-Z0-9-]/))if(n&&n.is(R))N=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(N,R);else throw new TypeError('TLD "'+R+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");N=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(N,R)}else throw new TypeError("cannot set TLD empty");return this.build(!E),this}},a.directory=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R===void 0||R===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var X=this._parts.path.length-this.filename().length-1,w=this._parts.path.substring(0,X)||(this._parts.hostname?"/":"");return R?r.decodePath(w):w}else{var N=this._parts.path.length-this.filename().length,D=this._parts.path.substring(0,N),k=new RegExp("^"+d(D));return this.is("relative")||(R||(R="/"),R.charAt(0)!=="/"&&(R="/"+R)),R&&R.charAt(R.length-1)!=="/"&&(R+="/"),R=r.recodePath(R),this._parts.path=this._parts.path.replace(k,R),this.build(!E),this}},a.filename=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(typeof R!="string"){if(!this._parts.path||this._parts.path==="/")return"";var X=this._parts.path.lastIndexOf("/"),w=this._parts.path.substring(X+1);return R?r.decodePathSegment(w):w}else{var N=!1;R.charAt(0)==="/"&&(R=R.substring(1)),R.match(/\.?\//)&&(N=!0);var D=new RegExp(d(this.filename())+"$");return R=r.recodePath(R),this._parts.path=this._parts.path.replace(D,R),N?this.normalizePath(E):this.build(!E),this}},a.suffix=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R===void 0||R===!0){if(!this._parts.path||this._parts.path==="/")return"";var X=this.filename(),w=X.lastIndexOf("."),N,D;return w===-1?"":(N=X.substring(w+1),D=/^[a-z0-9%]+$/i.test(N)?N:"",R?r.decodePathSegment(D):D)}else{R.charAt(0)==="."&&(R=R.substring(1));var k=this.suffix(),Y;if(k)R?Y=new RegExp(d(k)+"$"):Y=new RegExp(d("."+k)+"$");else{if(!R)return this;this._parts.path+="."+r.recodePath(R)}return Y&&(R=r.recodePath(R),this._parts.path=this._parts.path.replace(Y,R)),this.build(!E),this}},a.segment=function(R,E,X){var w=this._parts.urn?":":"/",N=this.path(),D=N.substring(0,1)==="/",k=N.split(w);if(R!==void 0&&typeof R!="number"&&(X=E,E=R,R=void 0),R!==void 0&&typeof R!="number")throw new Error('Bad segment "'+R+'", must be 0-based integer');if(D&&k.shift(),R<0&&(R=Math.max(k.length+R,0)),E===void 0)return R===void 0?k:k[R];if(R===null||k[R]===void 0)if(m(E)){k=[];for(var Y=0,U=E.length;Y<U;Y++)!E[Y].length&&(!k.length||!k[k.length-1].length)||(k.length&&!k[k.length-1].length&&k.pop(),k.push(x(E[Y])))}else(E||typeof E=="string")&&(E=x(E),k[k.length-1]===""?k[k.length-1]=E:k.push(E));else E?k[R]=x(E):k.splice(R,1);return D&&k.unshift(""),this.path(k.join(w),X)},a.segmentCoded=function(R,E,X){var w,N,D;if(typeof R!="number"&&(X=E,E=R,R=void 0),E===void 0){if(w=this.segment(R,E,X),!m(w))w=w!==void 0?r.decode(w):void 0;else for(N=0,D=w.length;N<D;N++)w[N]=r.decode(w[N]);return w}if(!m(E))E=typeof E=="string"||E instanceof String?r.encode(E):E;else for(N=0,D=E.length;N<D;N++)E[N]=r.encode(E[N]);return this.segment(R,E,X)};var b=a.query;return a.query=function(R,E){if(R===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof R=="function"){var X=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),w=R.call(this,X);return this._parts.query=r.buildQuery(w||X,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!E),this}else return R!==void 0&&typeof R!="string"?(this._parts.query=r.buildQuery(R,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!E),this):b.call(this,R,E)},a.setQuery=function(R,E,X){var w=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof R=="string"||R instanceof String)w[R]=E!==void 0?E:null;else if(typeof R=="object")for(var N in R)c.call(R,N)&&(w[N]=R[N]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(w,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof R!="string"&&(X=E),this.build(!X),this},a.addQuery=function(R,E,X){var w=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(w,R,E===void 0?null:E),this._parts.query=r.buildQuery(w,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof R!="string"&&(X=E),this.build(!X),this},a.removeQuery=function(R,E,X){var w=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(w,R,E),this._parts.query=r.buildQuery(w,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof R!="string"&&(X=E),this.build(!X),this},a.hasQuery=function(R,E,X){var w=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(w,R,E,X)},a.setSearch=a.setQuery,a.addSearch=a.addQuery,a.removeSearch=a.removeQuery,a.hasSearch=a.hasQuery,a.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},a.normalizeProtocol=function(R){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!R)),this},a.normalizeHostname=function(R){return this._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!R)),this},a.normalizePort=function(R){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!R)),this},a.normalizePath=function(R){var E=this._parts.path;if(!E)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!R),this;if(this._parts.path==="/")return this;E=r.recodePath(E);var X,w="",N,D;for(E.charAt(0)!=="/"&&(X=!0,E="/"+E),(E.slice(-3)==="/.."||E.slice(-2)==="/.")&&(E+="/"),E=E.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),X&&(w=E.substring(1).match(/^(\.\.\/)+/)||"",w&&(w=w[0]));N=E.search(/\/\.\.(\/|$)/),N!==-1;){if(N===0){E=E.substring(3);continue}D=E.substring(0,N).lastIndexOf("/"),D===-1&&(D=N),E=E.substring(0,D)+E.substring(N+3)}return X&&this.is("relative")&&(E=w+E.substring(1)),this._parts.path=E,this.build(!R),this},a.normalizePathname=a.normalizePath,a.normalizeQuery=function(R){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(r.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!R)),this},a.normalizeFragment=function(R){return this._parts.fragment||(this._parts.fragment=null,this.build(!R)),this},a.normalizeSearch=a.normalizeQuery,a.normalizeHash=a.normalizeFragment,a.iso8859=function(){var R=r.encode,E=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=R,r.decode=E}return this},a.unicode=function(){var R=r.encode,E=r.decode;r.encode=C,r.decode=unescape;try{this.normalize()}finally{r.encode=R,r.decode=E}return this},a.readable=function(){var R=this.clone();R.username("").password("").normalize();var E="";if(R._parts.protocol&&(E+=R._parts.protocol+"://"),R._parts.hostname&&(R.is("punycode")&&e?(E+=e.toUnicode(R._parts.hostname),R._parts.port&&(E+=":"+R._parts.port)):E+=R.host()),R._parts.hostname&&R._parts.path&&R._parts.path.charAt(0)!=="/"&&(E+="/"),E+=R.path(!0),R._parts.query){for(var X="",w=0,N=R._parts.query.split("&"),D=N.length;w<D;w++){var k=(N[w]||"").split("=");X+="&"+r.decodeQuery(k[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),k[1]!==void 0&&(X+="="+r.decodeQuery(k[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}E+="?"+X.substring(1)}return E+=r.decodeQuery(R.hash(),!0),E},a.absoluteTo=function(R){var E=this.clone(),X=["protocol","username","password","hostname","port"],w,N,D;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(R instanceof r||(R=new r(R)),E._parts.protocol||(E._parts.protocol=R._parts.protocol,this._parts.hostname))return E;for(N=0;D=X[N];N++)E._parts[D]=R._parts[D];return E._parts.path?(E._parts.path.substring(-2)===".."&&(E._parts.path+="/"),E.path().charAt(0)!=="/"&&(w=R.directory(),w=w||(R.path().indexOf("/")===0?"/":""),E._parts.path=(w?w+"/":"")+E._parts.path,E.normalizePath())):(E._parts.path=R._parts.path,E._parts.query||(E._parts.query=R._parts.query)),E.build(),E},a.relativeTo=function(R){var E=this.clone().normalize(),X,w,N,D,k;if(E._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(R=new r(R).normalize(),X=E._parts,w=R._parts,D=E.path(),k=R.path(),D.charAt(0)!=="/")throw new Error("URI is already relative");if(k.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(X.protocol===w.protocol&&(X.protocol=null),X.username!==w.username||X.password!==w.password||X.protocol!==null||X.username!==null||X.password!==null)return E.build();if(X.hostname===w.hostname&&X.port===w.port)X.hostname=null,X.port=null;else return E.build();if(D===k)return X.path="",E.build();if(N=r.commonPath(D,k),!N)return E.build();var Y=w.path.substring(N.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return X.path=Y+X.path.substring(N.length)||"./",E.build()},a.equals=function(R){var E=this.clone(),X=new r(R),w={},N={},D={},k,Y,U;if(E.normalize(),X.normalize(),E.toString()===X.toString())return!0;if(k=E.query(),Y=X.query(),E.query(""),X.query(""),E.toString()!==X.toString()||k.length!==Y.length)return!1;w=r.parseQuery(k,this._parts.escapeQuerySpace),N=r.parseQuery(Y,this._parts.escapeQuerySpace);for(U in w)if(c.call(w,U)){if(m(w[U])){if(!f(w[U],N[U]))return!1}else if(w[U]!==N[U])return!1;D[U]=!0}for(U in N)if(c.call(N,U)&&!D[U])return!1;return!0},a.preventInvalidHostname=function(R){return this._parts.preventInvalidHostname=!!R,this},a.duplicateQueryParameters=function(R){return this._parts.duplicateQueryParameters=!!R,this},a.escapeQuerySpace=function(R){return this._parts.escapeQuerySpace=!!R,this},r})});var zte=Gc((KO,zO)=>{var djt=T(S());/*! @license DOMPurify 3.0.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.6/LICENSE */(function(e,t){typeof KO=="object"&&typeof zO<"u"?zO.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.DOMPurify=t())})(KO,function(){"use strict";let{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:i,getOwnPropertyDescriptor:o}=Object,{freeze:r,seal:s,create:a}=Object,{apply:c,construct:d}=typeof Reflect<"u"&&Reflect;r||(r=function(we){return we}),s||(s=function(we){return we}),c||(c=function(we,dt,bt){return we.apply(dt,bt)}),d||(d=function(we,dt){return new we(...dt)});let u=G(Array.prototype.forEach),m=G(Array.prototype.pop),p=G(Array.prototype.push),y=G(String.prototype.toLowerCase),f=G(String.prototype.toString),x=G(String.prototype.match),_=G(String.prototype.replace),C=G(String.prototype.indexOf),V=G(String.prototype.trim),L=G(RegExp.prototype.test),Z=I(TypeError);function G(He){return function(we){for(var dt=arguments.length,bt=new Array(dt>1?dt-1:0),it=1;it<dt;it++)bt[it-1]=arguments[it];return c(He,we,bt)}}function I(He){return function(){for(var we=arguments.length,dt=new Array(we),bt=0;bt<we;bt++)dt[bt]=arguments[bt];return d(He,dt)}}function P(He,we){let dt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:y;t&&t(He,null);let bt=we.length;for(;bt--;){let it=we[bt];if(typeof it=="string"){let en=dt(it);en!==it&&(n(we)||(we[bt]=en),it=en)}He[it]=!0}return He}function v(He){let we=a(null);for(let[dt,bt]of e(He))o(He,dt)!==void 0&&(we[dt]=bt);return we}function F(He,we){for(;He!==null;){let bt=o(He,we);if(bt){if(bt.get)return G(bt.get);if(typeof bt.value=="function")return G(bt.value)}He=i(He)}function dt(bt){return console.warn("fallback value for",bt),null}return dt}let M=r(["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","dialog","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","picture","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"]),b=r(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","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","view","vkern"]),R=r(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),E=r(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),X=r(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),w=r(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),N=r(["#text"]),D=r(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","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","translate","type","usemap","valign","value","width","xmlns","slot"]),k=r(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","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","filterunits","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","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","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"]),Y=r(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","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"]),U=r(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),J=s(/\{\{[\w\W]*|[\w\W]*\}\}/gm),K=s(/<%[\w\W]*|[\w\W]*%>/gm),ee=s(/\${[\w\W]*}/gm),H=s(/^data-[\-\w.\u00B7-\uFFFF]/),j=s(/^aria-[\-\w]+$/),$=s(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),pe=s(/^(?:\w+script|data):/i),ge=s(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ae=s(/^html$/i);var be=Object.freeze({__proto__:null,MUSTACHE_EXPR:J,ERB_EXPR:K,TMPLIT_EXPR:ee,DATA_ATTR:H,ARIA_ATTR:j,IS_ALLOWED_URI:$,IS_SCRIPT_OR_DATA:pe,ATTR_WHITESPACE:ge,DOCTYPE_NAME:ae});let _e=function(){return typeof window>"u"?null:window},Ze=function(we,dt){if(typeof we!="object"||typeof we.createPolicy!="function")return null;let bt=null,it="data-tt-policy-suffix";dt&&dt.hasAttribute(it)&&(bt=dt.getAttribute(it));let en="dompurify"+(bt?"#"+bt:"");try{return we.createPolicy(en,{createHTML(_n){return _n},createScriptURL(_n){return _n}})}catch{return console.warn("TrustedTypes policy "+en+" could not be created."),null}};function Le(){let He=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_e(),we=Zn=>Le(Zn);if(we.version="3.0.6",we.removed=[],!He||!He.document||He.document.nodeType!==9)return we.isSupported=!1,we;let{document:dt}=He,bt=dt,it=bt.currentScript,{DocumentFragment:en,HTMLTemplateElement:_n,Node:kt,Element:At,NodeFilter:Te,NamedNodeMap:Re=He.NamedNodeMap||He.MozNamedAttrMap,HTMLFormElement:ct,DOMParser:Jt,trustedTypes:mi}=He,Ke=At.prototype,$r=F(Ke,"cloneNode"),es=F(Ke,"nextSibling"),ga=F(Ke,"childNodes"),ms=F(Ke,"parentNode");if(typeof _n=="function"){let Zn=dt.createElement("template");Zn.content&&Zn.content.ownerDocument&&(dt=Zn.content.ownerDocument)}let Fe,rt="",{implementation:qe,createNodeIterator:Ye,createDocumentFragment:ht,getElementsByTagName:Dt}=dt,{importNode:fn}=bt,jn={};we.isSupported=typeof e=="function"&&typeof ms=="function"&&qe&&qe.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:ki,ERB_EXPR:Lo,TMPLIT_EXPR:Is,DATA_ATTR:fr,ARIA_ATTR:Ji,IS_SCRIPT_OR_DATA:hs,ATTR_WHITESPACE:Jn}=be,{IS_ALLOWED_URI:Un}=be,un=null,fi=P({},[...M,...b,...R,...X,...N]),Qi=null,fs=P({},[...D,...k,...Y,...U]),po=Object.seal(a(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Rc=null,jd=null,Ql=!0,Wg=!0,wh=!1,cl=!0,Fh=!1,ts=!1,ns=!1,zs=!1,ji=!1,ll=!1,jl=!1,gL=!0,Zc=!1,Pg="user-content-",xL=!0,_L=!1,hS={},fS=null,D7=P({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),B7=null,O7=P({},["audio","video","img","source","image","track"]),NB=null,Y7=P({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),HA="http://www.w3.org/1998/Math/MathML",KA="http://www.w3.org/2000/svg",tp="http://www.w3.org/1999/xhtml",pS=tp,UB=!1,kB=null,OTe=P({},[HA,KA,tp],f),vg=null,YTe=["application/xhtml+xml","text/html"],HTe="text/html",Js=null,bS=null,KTe=dt.createElement("form"),H7=function(Ie){return Ie instanceof RegExp||Ie instanceof Function},DB=function(){let Ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(bS&&bS===Ie)){if((!Ie||typeof Ie!="object")&&(Ie={}),Ie=v(Ie),vg=YTe.indexOf(Ie.PARSER_MEDIA_TYPE)===-1?vg=HTe:vg=Ie.PARSER_MEDIA_TYPE,Js=vg==="application/xhtml+xml"?f:y,un="ALLOWED_TAGS"in Ie?P({},Ie.ALLOWED_TAGS,Js):fi,Qi="ALLOWED_ATTR"in Ie?P({},Ie.ALLOWED_ATTR,Js):fs,kB="ALLOWED_NAMESPACES"in Ie?P({},Ie.ALLOWED_NAMESPACES,f):OTe,NB="ADD_URI_SAFE_ATTR"in Ie?P(v(Y7),Ie.ADD_URI_SAFE_ATTR,Js):Y7,B7="ADD_DATA_URI_TAGS"in Ie?P(v(O7),Ie.ADD_DATA_URI_TAGS,Js):O7,fS="FORBID_CONTENTS"in Ie?P({},Ie.FORBID_CONTENTS,Js):D7,Rc="FORBID_TAGS"in Ie?P({},Ie.FORBID_TAGS,Js):{},jd="FORBID_ATTR"in Ie?P({},Ie.FORBID_ATTR,Js):{},hS="USE_PROFILES"in Ie?Ie.USE_PROFILES:!1,Ql=Ie.ALLOW_ARIA_ATTR!==!1,Wg=Ie.ALLOW_DATA_ATTR!==!1,wh=Ie.ALLOW_UNKNOWN_PROTOCOLS||!1,cl=Ie.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Fh=Ie.SAFE_FOR_TEMPLATES||!1,ts=Ie.WHOLE_DOCUMENT||!1,ji=Ie.RETURN_DOM||!1,ll=Ie.RETURN_DOM_FRAGMENT||!1,jl=Ie.RETURN_TRUSTED_TYPE||!1,zs=Ie.FORCE_BODY||!1,gL=Ie.SANITIZE_DOM!==!1,Zc=Ie.SANITIZE_NAMED_PROPS||!1,xL=Ie.KEEP_CONTENT!==!1,_L=Ie.IN_PLACE||!1,Un=Ie.ALLOWED_URI_REGEXP||$,pS=Ie.NAMESPACE||tp,po=Ie.CUSTOM_ELEMENT_HANDLING||{},Ie.CUSTOM_ELEMENT_HANDLING&&H7(Ie.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(po.tagNameCheck=Ie.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Ie.CUSTOM_ELEMENT_HANDLING&&H7(Ie.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(po.attributeNameCheck=Ie.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Ie.CUSTOM_ELEMENT_HANDLING&&typeof Ie.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(po.allowCustomizedBuiltInElements=Ie.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Fh&&(Wg=!1),ll&&(ji=!0),hS&&(un=P({},[...N]),Qi=[],hS.html===!0&&(P(un,M),P(Qi,D)),hS.svg===!0&&(P(un,b),P(Qi,k),P(Qi,U)),hS.svgFilters===!0&&(P(un,R),P(Qi,k),P(Qi,U)),hS.mathMl===!0&&(P(un,X),P(Qi,Y),P(Qi,U))),Ie.ADD_TAGS&&(un===fi&&(un=v(un)),P(un,Ie.ADD_TAGS,Js)),Ie.ADD_ATTR&&(Qi===fs&&(Qi=v(Qi)),P(Qi,Ie.ADD_ATTR,Js)),Ie.ADD_URI_SAFE_ATTR&&P(NB,Ie.ADD_URI_SAFE_ATTR,Js),Ie.FORBID_CONTENTS&&(fS===D7&&(fS=v(fS)),P(fS,Ie.FORBID_CONTENTS,Js)),xL&&(un["#text"]=!0),ts&&P(un,["html","head","body"]),un.table&&(P(un,["tbody"]),delete Rc.tbody),Ie.TRUSTED_TYPES_POLICY){if(typeof Ie.TRUSTED_TYPES_POLICY.createHTML!="function")throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Ie.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Z('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');Fe=Ie.TRUSTED_TYPES_POLICY,rt=Fe.createHTML("")}else Fe===void 0&&(Fe=Ze(mi,it)),Fe!==null&&typeof rt=="string"&&(rt=Fe.createHTML(""));r&&r(Ie),bS=Ie}},K7=P({},["mi","mo","mn","ms","mtext"]),z7=P({},["foreignobject","desc","title","annotation-xml"]),zTe=P({},["title","style","font","a","script"]),zA=P({},b);P(zA,R),P(zA,E);let BB=P({},X);P(BB,w);let JTe=function(Ie){let Et=ms(Ie);(!Et||!Et.tagName)&&(Et={namespaceURI:pS,tagName:"template"});let xn=y(Ie.tagName),Oo=y(Et.tagName);return kB[Ie.namespaceURI]?Ie.namespaceURI===KA?Et.namespaceURI===tp?xn==="svg":Et.namespaceURI===HA?xn==="svg"&&(Oo==="annotation-xml"||K7[Oo]):!!zA[xn]:Ie.namespaceURI===HA?Et.namespaceURI===tp?xn==="math":Et.namespaceURI===KA?xn==="math"&&z7[Oo]:!!BB[xn]:Ie.namespaceURI===tp?Et.namespaceURI===KA&&!z7[Oo]||Et.namespaceURI===HA&&!K7[Oo]?!1:!BB[xn]&&(zTe[xn]||!zA[xn]):!!(vg==="application/xhtml+xml"&&kB[Ie.namespaceURI]):!1},wg=function(Ie){p(we.removed,{element:Ie});try{Ie.parentNode.removeChild(Ie)}catch{Ie.remove()}},OB=function(Ie,Et){try{p(we.removed,{attribute:Et.getAttributeNode(Ie),from:Et})}catch{p(we.removed,{attribute:null,from:Et})}if(Et.removeAttribute(Ie),Ie==="is"&&!Qi[Ie])if(ji||ll)try{wg(Et)}catch{}else try{Et.setAttribute(Ie,"")}catch{}},J7=function(Ie){let Et=null,xn=null;if(zs)Ie="<remove></remove>"+Ie;else{let ka=x(Ie,/^[\r\n\t ]+/);xn=ka&&ka[0]}vg==="application/xhtml+xml"&&pS===tp&&(Ie='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Ie+"</body></html>");let Oo=Fe?Fe.createHTML(Ie):Ie;if(pS===tp)try{Et=new Jt().parseFromString(Oo,vg)}catch{}if(!Et||!Et.documentElement){Et=qe.createDocument(pS,"template",null);try{Et.documentElement.innerHTML=UB?rt:Oo}catch{}}let Ua=Et.body||Et.documentElement;return Ie&&xn&&Ua.insertBefore(dt.createTextNode(xn),Ua.childNodes[0]||null),pS===tp?Dt.call(Et,ts?"html":"body")[0]:ts?Et.documentElement:Ua},Q7=function(Ie){return Ye.call(Ie.ownerDocument||Ie,Ie,Te.SHOW_ELEMENT|Te.SHOW_COMMENT|Te.SHOW_TEXT,null)},QTe=function(Ie){return Ie instanceof ct&&(typeof Ie.nodeName!="string"||typeof Ie.textContent!="string"||typeof Ie.removeChild!="function"||!(Ie.attributes instanceof Re)||typeof Ie.removeAttribute!="function"||typeof Ie.setAttribute!="function"||typeof Ie.namespaceURI!="string"||typeof Ie.insertBefore!="function"||typeof Ie.hasChildNodes!="function")},j7=function(Ie){return typeof kt=="function"&&Ie instanceof kt},np=function(Ie,Et,xn){jn[Ie]&&u(jn[Ie],Oo=>{Oo.call(we,Et,xn,bS)})},q7=function(Ie){let Et=null;if(np("beforeSanitizeElements",Ie,null),QTe(Ie))return wg(Ie),!0;let xn=Js(Ie.nodeName);if(np("uponSanitizeElement",Ie,{tagName:xn,allowedTags:un}),Ie.hasChildNodes()&&!j7(Ie.firstElementChild)&&L(/<[/\w]/g,Ie.innerHTML)&&L(/<[/\w]/g,Ie.textContent))return wg(Ie),!0;if(!un[xn]||Rc[xn]){if(!Rc[xn]&&e6(xn)&&(po.tagNameCheck instanceof RegExp&&L(po.tagNameCheck,xn)||po.tagNameCheck instanceof Function&&po.tagNameCheck(xn)))return!1;if(xL&&!fS[xn]){let Oo=ms(Ie)||Ie.parentNode,Ua=ga(Ie)||Ie.childNodes;if(Ua&&Oo){let ka=Ua.length;for(let dl=ka-1;dl>=0;--dl)Oo.insertBefore($r(Ua[dl],!0),es(Ie))}}return wg(Ie),!0}return Ie instanceof At&&!JTe(Ie)||(xn==="noscript"||xn==="noembed"||xn==="noframes")&&L(/<\/no(script|embed|frames)/i,Ie.innerHTML)?(wg(Ie),!0):(Fh&&Ie.nodeType===3&&(Et=Ie.textContent,u([ki,Lo,Is],Oo=>{Et=_(Et,Oo," ")}),Ie.textContent!==Et&&(p(we.removed,{element:Ie.cloneNode()}),Ie.textContent=Et)),np("afterSanitizeElements",Ie,null),!1)},$7=function(Ie,Et,xn){if(gL&&(Et==="id"||Et==="name")&&(xn in dt||xn in KTe))return!1;if(!(Wg&&!jd[Et]&&L(fr,Et))){if(!(Ql&&L(Ji,Et))){if(!Qi[Et]||jd[Et]){if(!(e6(Ie)&&(po.tagNameCheck instanceof RegExp&&L(po.tagNameCheck,Ie)||po.tagNameCheck instanceof Function&&po.tagNameCheck(Ie))&&(po.attributeNameCheck instanceof RegExp&&L(po.attributeNameCheck,Et)||po.attributeNameCheck instanceof Function&&po.attributeNameCheck(Et))||Et==="is"&&po.allowCustomizedBuiltInElements&&(po.tagNameCheck instanceof RegExp&&L(po.tagNameCheck,xn)||po.tagNameCheck instanceof Function&&po.tagNameCheck(xn))))return!1}else if(!NB[Et]){if(!L(Un,_(xn,Jn,""))){if(!((Et==="src"||Et==="xlink:href"||Et==="href")&&Ie!=="script"&&C(xn,"data:")===0&&B7[Ie])){if(!(wh&&!L(hs,_(xn,Jn,"")))){if(xn)return!1}}}}}}return!0},e6=function(Ie){return Ie.indexOf("-")>0},t6=function(Ie){np("beforeSanitizeAttributes",Ie,null);let{attributes:Et}=Ie;if(!Et)return;let xn={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Qi},Oo=Et.length;for(;Oo--;){let Ua=Et[Oo],{name:ka,namespaceURI:dl,value:Fg}=Ua,TL=Js(ka),ul=ka==="value"?Fg:V(Fg);if(xn.attrName=TL,xn.attrValue=ul,xn.keepAttr=!0,xn.forceKeepAttr=void 0,np("uponSanitizeAttribute",Ie,xn),ul=xn.attrValue,xn.forceKeepAttr||(OB(ka,Ie),!xn.keepAttr))continue;if(!cl&&L(/\/>/i,ul)){OB(ka,Ie);continue}Fh&&u([ki,Lo,Is],i6=>{ul=_(ul,i6," ")});let n6=Js(Ie.nodeName);if($7(n6,TL,ul)){if(Zc&&(TL==="id"||TL==="name")&&(OB(ka,Ie),ul=Pg+ul),Fe&&typeof mi=="object"&&typeof mi.getAttributeType=="function"&&!dl)switch(mi.getAttributeType(n6,TL)){case"TrustedHTML":{ul=Fe.createHTML(ul);break}case"TrustedScriptURL":{ul=Fe.createScriptURL(ul);break}}try{dl?Ie.setAttributeNS(dl,ka,ul):Ie.setAttribute(ka,ul),m(we.removed)}catch{}}}np("afterSanitizeAttributes",Ie,null)},jTe=function Zn(Ie){let Et=null,xn=Q7(Ie);for(np("beforeSanitizeShadowDOM",Ie,null);Et=xn.nextNode();)np("uponSanitizeShadowNode",Et,null),!q7(Et)&&(Et.content instanceof en&&Zn(Et.content),t6(Et));np("afterSanitizeShadowDOM",Ie,null)};return we.sanitize=function(Zn){let Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Et=null,xn=null,Oo=null,Ua=null;if(UB=!Zn,UB&&(Zn="<!-->"),typeof Zn!="string"&&!j7(Zn))if(typeof Zn.toString=="function"){if(Zn=Zn.toString(),typeof Zn!="string")throw Z("dirty is not a string, aborting")}else throw Z("toString is not a function");if(!we.isSupported)return Zn;if(ns||DB(Ie),we.removed=[],typeof Zn=="string"&&(_L=!1),_L){if(Zn.nodeName){let Fg=Js(Zn.nodeName);if(!un[Fg]||Rc[Fg])throw Z("root node is forbidden and cannot be sanitized in-place")}}else if(Zn instanceof kt)Et=J7("<!---->"),xn=Et.ownerDocument.importNode(Zn,!0),xn.nodeType===1&&xn.nodeName==="BODY"||xn.nodeName==="HTML"?Et=xn:Et.appendChild(xn);else{if(!ji&&!Fh&&!ts&&Zn.indexOf("<")===-1)return Fe&&jl?Fe.createHTML(Zn):Zn;if(Et=J7(Zn),!Et)return ji?null:jl?rt:""}Et&&zs&&wg(Et.firstChild);let ka=Q7(_L?Zn:Et);for(;Oo=ka.nextNode();)q7(Oo)||(Oo.content instanceof en&&jTe(Oo.content),t6(Oo));if(_L)return Zn;if(ji){if(ll)for(Ua=ht.call(Et.ownerDocument);Et.firstChild;)Ua.appendChild(Et.firstChild);else Ua=Et;return(Qi.shadowroot||Qi.shadowrootmode)&&(Ua=fn.call(bt,Ua,!0)),Ua}let dl=ts?Et.outerHTML:Et.innerHTML;return ts&&un["!doctype"]&&Et.ownerDocument&&Et.ownerDocument.doctype&&Et.ownerDocument.doctype.name&&L(ae,Et.ownerDocument.doctype.name)&&(dl="<!DOCTYPE "+Et.ownerDocument.doctype.name+`>
`+dl),Fh&&u([ki,Lo,Is],Fg=>{dl=_(dl,Fg," ")}),Fe&&jl?Fe.createHTML(dl):dl},we.setConfig=function(){let Zn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};DB(Zn),ns=!0},we.clearConfig=function(){bS=null,ns=!1},we.isValidAttribute=function(Zn,Ie,Et){bS||DB({});let xn=Js(Zn),Oo=Js(Ie);return $7(xn,Oo,Et)},we.addHook=function(Zn,Ie){typeof Ie=="function"&&(jn[Zn]=jn[Zn]||[],p(jn[Zn],Ie))},we.removeHook=function(Zn){if(jn[Zn])return m(jn[Zn])},we.removeHooks=function(Zn){jn[Zn]&&(jn[Zn]=[])},we.removeAllHooks=function(){jn={}},we}var Ee=Le();return Ee})});var ase=Gc((TZn,sse)=>{"use strict";var SZn=T(S());sse.exports=SDe;var EW=1e20;function SDe(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,o=t.channel||0,r,s,a,c,d,u,m,p,y,f,x;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error("For raw data width and height should be provided by options");r=t.width,s=t.height,c=e,t.stride?u=t.stride:u=Math.floor(e.length/r/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(p=e,m=p.getContext("2d"),r=p.width,s=p.height,y=m.getImageData(0,0,r,s),c=y.data,u=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,m=e,r=p.width,s=p.height,y=m.getImageData(0,0,r,s),c=y.data,u=4):window.ImageData&&e instanceof window.ImageData&&(y=e,r=e.width,s=e.height,c=y.data,u=4);if(a=Math.max(r,s),window.Uint8ClampedArray&&c instanceof window.Uint8ClampedArray||window.Uint8Array&&c instanceof window.Uint8Array)for(d=c,c=Array(r*s),f=0,x=Math.floor(d.length/u);f<x;f++)c[f]=d[f*u+o]/255;else if(u!==1)throw Error("Raw data can have only 1 value per pixel");var _=Array(r*s),C=Array(r*s),V=Array(a),L=Array(a),Z=Array(a+1),G=Array(a);for(f=0,x=r*s;f<x;f++){var I=c[f];_[f]=I===1?0:I===0?EW:Math.pow(Math.max(0,.5-I),2),C[f]=I===1?EW:I===0?0:Math.pow(Math.max(0,I-.5),2)}ose(_,r,s,V,L,G,Z),ose(C,r,s,V,L,G,Z);var P=window.Float32Array?new Float32Array(r*s):new Array(r*s);for(f=0,x=r*s;f<x;f++)P[f]=Math.min(Math.max(1-((_[f]-C[f])/i+n),0),1);return P}function ose(e,t,n,i,o,r,s){for(var a=0;a<t;a++){for(var c=0;c<n;c++)i[c]=e[c*t+a];for(rse(i,o,r,s,n),c=0;c<n;c++)e[c*t+a]=o[c]}for(c=0;c<n;c++){for(a=0;a<t;a++)i[a]=e[c*t+a];for(rse(i,o,r,s,t),a=0;a<t;a++)e[c*t+a]=Math.sqrt(o[a])}}function rse(e,t,n,i,o){n[0]=0,i[0]=-EW,i[1]=+EW;for(var r=1,s=0;r<o;r++){for(var a=(e[r]+r*r-(e[n[s]]+n[s]*n[s]))/(2*r-2*n[s]);a<=i[s];)s--,a=(e[r]+r*r-(e[n[s]]+n[s]*n[s]))/(2*r-2*n[s]);s++,n[s]=r,i[s]=a,i[s+1]=+EW}for(r=0,s=0;r<o;r++){for(;i[s+1]<r;)s++;t[r]=(r-n[s])*(r-n[s])+e[n[s]]}}});var mse=Gc((kZn,t5)=>{var DZn=T(S());function PDe(){var e=0,t=1,n=2,i=3,o=4,r=5,s=6,a=7,c=8,d=9,u=10,m=11,p=12,y=13,f=14,x=15,_=16,C=17,V=0,L=1,Z=2,G=3,I=4;function P(b,R){return 55296<=b.charCodeAt(R)&&b.charCodeAt(R)<=56319&&56320<=b.charCodeAt(R+1)&&b.charCodeAt(R+1)<=57343}function v(b,R){R===void 0&&(R=0);var E=b.charCodeAt(R);if(55296<=E&&E<=56319&&R<b.length-1){var X=E,w=b.charCodeAt(R+1);return 56320<=w&&w<=57343?(X-55296)*1024+(w-56320)+65536:X}if(56320<=E&&E<=57343&&R>=1){var X=b.charCodeAt(R-1),w=E;return 55296<=X&&X<=56319?(X-55296)*1024+(w-56320)+65536:w}return E}function F(b,R,E){var X=[b].concat(R).concat([E]),w=X[X.length-2],N=E,D=X.lastIndexOf(f);if(D>1&&X.slice(1,D).every(function(U){return U==i})&&[i,y,C].indexOf(b)==-1)return Z;var k=X.lastIndexOf(o);if(k>0&&X.slice(1,k).every(function(U){return U==o})&&[p,o].indexOf(w)==-1)return X.filter(function(U){return U==o}).length%2==1?G:I;if(w==e&&N==t)return V;if(w==n||w==e||w==t)return N==f&&R.every(function(U){return U==i})?Z:L;if(N==n||N==e||N==t)return L;if(w==s&&(N==s||N==a||N==d||N==u))return V;if((w==d||w==a)&&(N==a||N==c))return V;if((w==u||w==c)&&N==c)return V;if(N==i||N==x)return V;if(N==r)return V;if(w==p)return V;var Y=X.indexOf(i)!=-1?X.lastIndexOf(i)-1:X.length-2;return[y,C].indexOf(X[Y])!=-1&&X.slice(Y+1,-1).every(function(U){return U==i})&&N==f||w==x&&[_,C].indexOf(N)!=-1?V:R.indexOf(o)!=-1?Z:w==o&&N==o?V:L}this.nextBreak=function(b,R){if(R===void 0&&(R=0),R<0)return 0;if(R>=b.length-1)return b.length;for(var E=M(v(b,R)),X=[],w=R+1;w<b.length;w++)if(!P(b,w-1)){var N=M(v(b,w));if(F(E,X,N))return w;X.push(N)}return b.length},this.splitGraphemes=function(b){for(var R=[],E=0,X;(X=this.nextBreak(b,E))<b.length;)R.push(b.slice(E,X)),E=X;return E<b.length&&R.push(b.slice(E)),R},this.iterateGraphemes=function(b){var R=0,E={next:function(){var X,w;return(w=this.nextBreak(b,R))<b.length?(X=b.slice(R,w),R=w,{value:X,done:!1}):R<b.length?(X=b.slice(R),R=b.length,{value:X,done:!1}):{value:void 0,done:!0}}.bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(E[Symbol.iterator]=function(){return E}),E},this.countGraphemes=function(b){for(var R=0,E=0,X;(X=this.nextBreak(b,E))<b.length;)E=X,R++;return E<b.length&&R++,R};function M(b){return 1536<=b&&b<=1541||b==1757||b==1807||b==2274||b==3406||b==69821||70082<=b&&b<=70083||b==72250||72326<=b&&b<=72329||b==73030?p:b==13?e:b==10?t:0<=b&&b<=9||11<=b&&b<=12||14<=b&&b<=31||127<=b&&b<=159||b==173||b==1564||b==6158||b==8203||8206<=b&&b<=8207||b==8232||b==8233||8234<=b&&b<=8238||8288<=b&&b<=8292||b==8293||8294<=b&&b<=8303||55296<=b&&b<=57343||b==65279||65520<=b&&b<=65528||65529<=b&&b<=65531||113824<=b&&b<=113827||119155<=b&&b<=119162||b==917504||b==917505||917506<=b&&b<=917535||917632<=b&&b<=917759||918e3<=b&&b<=921599?n:768<=b&&b<=879||1155<=b&&b<=1159||1160<=b&&b<=1161||1425<=b&&b<=1469||b==1471||1473<=b&&b<=1474||1476<=b&&b<=1477||b==1479||1552<=b&&b<=1562||1611<=b&&b<=1631||b==1648||1750<=b&&b<=1756||1759<=b&&b<=1764||1767<=b&&b<=1768||1770<=b&&b<=1773||b==1809||1840<=b&&b<=1866||1958<=b&&b<=1968||2027<=b&&b<=2035||2070<=b&&b<=2073||2075<=b&&b<=2083||2085<=b&&b<=2087||2089<=b&&b<=2093||2137<=b&&b<=2139||2260<=b&&b<=2273||2275<=b&&b<=2306||b==2362||b==2364||2369<=b&&b<=2376||b==2381||2385<=b&&b<=2391||2402<=b&&b<=2403||b==2433||b==2492||b==2494||2497<=b&&b<=2500||b==2509||b==2519||2530<=b&&b<=2531||2561<=b&&b<=2562||b==2620||2625<=b&&b<=2626||2631<=b&&b<=2632||2635<=b&&b<=2637||b==2641||2672<=b&&b<=2673||b==2677||2689<=b&&b<=2690||b==2748||2753<=b&&b<=2757||2759<=b&&b<=2760||b==2765||2786<=b&&b<=2787||2810<=b&&b<=2815||b==2817||b==2876||b==2878||b==2879||2881<=b&&b<=2884||b==2893||b==2902||b==2903||2914<=b&&b<=2915||b==2946||b==3006||b==3008||b==3021||b==3031||b==3072||3134<=b&&b<=3136||3142<=b&&b<=3144||3146<=b&&b<=3149||3157<=b&&b<=3158||3170<=b&&b<=3171||b==3201||b==3260||b==3263||b==3266||b==3270||3276<=b&&b<=3277||3285<=b&&b<=3286||3298<=b&&b<=3299||3328<=b&&b<=3329||3387<=b&&b<=3388||b==3390||3393<=b&&b<=3396||b==3405||b==3415||3426<=b&&b<=3427||b==3530||b==3535||3538<=b&&b<=3540||b==3542||b==3551||b==3633||3636<=b&&b<=3642||3655<=b&&b<=3662||b==3761||3764<=b&&b<=3769||3771<=b&&b<=3772||3784<=b&&b<=3789||3864<=b&&b<=3865||b==3893||b==3895||b==3897||3953<=b&&b<=3966||3968<=b&&b<=3972||3974<=b&&b<=3975||3981<=b&&b<=3991||3993<=b&&b<=4028||b==4038||4141<=b&&b<=4144||4146<=b&&b<=4151||4153<=b&&b<=4154||4157<=b&&b<=4158||4184<=b&&b<=4185||4190<=b&&b<=4192||4209<=b&&b<=4212||b==4226||4229<=b&&b<=4230||b==4237||b==4253||4957<=b&&b<=4959||5906<=b&&b<=5908||5938<=b&&b<=5940||5970<=b&&b<=5971||6002<=b&&b<=6003||6068<=b&&b<=6069||6071<=b&&b<=6077||b==6086||6089<=b&&b<=6099||b==6109||6155<=b&&b<=6157||6277<=b&&b<=6278||b==6313||6432<=b&&b<=6434||6439<=b&&b<=6440||b==6450||6457<=b&&b<=6459||6679<=b&&b<=6680||b==6683||b==6742||6744<=b&&b<=6750||b==6752||b==6754||6757<=b&&b<=6764||6771<=b&&b<=6780||b==6783||6832<=b&&b<=6845||b==6846||6912<=b&&b<=6915||b==6964||6966<=b&&b<=6970||b==6972||b==6978||7019<=b&&b<=7027||7040<=b&&b<=7041||7074<=b&&b<=7077||7080<=b&&b<=7081||7083<=b&&b<=7085||b==7142||7144<=b&&b<=7145||b==7149||7151<=b&&b<=7153||7212<=b&&b<=7219||7222<=b&&b<=7223||7376<=b&&b<=7378||7380<=b&&b<=7392||7394<=b&&b<=7400||b==7405||b==7412||7416<=b&&b<=7417||7616<=b&&b<=7673||7675<=b&&b<=7679||b==8204||8400<=b&&b<=8412||8413<=b&&b<=8416||b==8417||8418<=b&&b<=8420||8421<=b&&b<=8432||11503<=b&&b<=11505||b==11647||11744<=b&&b<=11775||12330<=b&&b<=12333||12334<=b&&b<=12335||12441<=b&&b<=12442||b==42607||42608<=b&&b<=42610||42612<=b&&b<=42621||42654<=b&&b<=42655||42736<=b&&b<=42737||b==43010||b==43014||b==43019||43045<=b&&b<=43046||43204<=b&&b<=43205||43232<=b&&b<=43249||43302<=b&&b<=43309||43335<=b&&b<=43345||43392<=b&&b<=43394||b==43443||43446<=b&&b<=43449||b==43452||b==43493||43561<=b&&b<=43566||43569<=b&&b<=43570||43573<=b&&b<=43574||b==43587||b==43596||b==43644||b==43696||43698<=b&&b<=43700||43703<=b&&b<=43704||43710<=b&&b<=43711||b==43713||43756<=b&&b<=43757||b==43766||b==44005||b==44008||b==44013||b==64286||65024<=b&&b<=65039||65056<=b&&b<=65071||65438<=b&&b<=65439||b==66045||b==66272||66422<=b&&b<=66426||68097<=b&&b<=68099||68101<=b&&b<=68102||68108<=b&&b<=68111||68152<=b&&b<=68154||b==68159||68325<=b&&b<=68326||b==69633||69688<=b&&b<=69702||69759<=b&&b<=69761||69811<=b&&b<=69814||69817<=b&&b<=69818||69888<=b&&b<=69890||69927<=b&&b<=69931||69933<=b&&b<=69940||b==70003||70016<=b&&b<=70017||70070<=b&&b<=70078||70090<=b&&b<=70092||70191<=b&&b<=70193||b==70196||70198<=b&&b<=70199||b==70206||b==70367||70371<=b&&b<=70378||70400<=b&&b<=70401||b==70460||b==70462||b==70464||b==70487||70502<=b&&b<=70508||70512<=b&&b<=70516||70712<=b&&b<=70719||70722<=b&&b<=70724||b==70726||b==70832||70835<=b&&b<=70840||b==70842||b==70845||70847<=b&&b<=70848||70850<=b&&b<=70851||b==71087||71090<=b&&b<=71093||71100<=b&&b<=71101||71103<=b&&b<=71104||71132<=b&&b<=71133||71219<=b&&b<=71226||b==71229||71231<=b&&b<=71232||b==71339||b==71341||71344<=b&&b<=71349||b==71351||71453<=b&&b<=71455||71458<=b&&b<=71461||71463<=b&&b<=71467||72193<=b&&b<=72198||72201<=b&&b<=72202||72243<=b&&b<=72248||72251<=b&&b<=72254||b==72263||72273<=b&&b<=72278||72281<=b&&b<=72283||72330<=b&&b<=72342||72344<=b&&b<=72345||72752<=b&&b<=72758||72760<=b&&b<=72765||b==72767||72850<=b&&b<=72871||72874<=b&&b<=72880||72882<=b&&b<=72883||72885<=b&&b<=72886||73009<=b&&b<=73014||b==73018||73020<=b&&b<=73021||73023<=b&&b<=73029||b==73031||92912<=b&&b<=92916||92976<=b&&b<=92982||94095<=b&&b<=94098||113821<=b&&b<=113822||b==119141||119143<=b&&b<=119145||119150<=b&&b<=119154||119163<=b&&b<=119170||119173<=b&&b<=119179||119210<=b&&b<=119213||119362<=b&&b<=119364||121344<=b&&b<=121398||121403<=b&&b<=121452||b==121461||b==121476||121499<=b&&b<=121503||121505<=b&&b<=121519||122880<=b&&b<=122886||122888<=b&&b<=122904||122907<=b&&b<=122913||122915<=b&&b<=122916||122918<=b&&b<=122922||125136<=b&&b<=125142||125252<=b&&b<=125258||917536<=b&&b<=917631||917760<=b&&b<=917999?i:127462<=b&&b<=127487?o:b==2307||b==2363||2366<=b&&b<=2368||2377<=b&&b<=2380||2382<=b&&b<=2383||2434<=b&&b<=2435||2495<=b&&b<=2496||2503<=b&&b<=2504||2507<=b&&b<=2508||b==2563||2622<=b&&b<=2624||b==2691||2750<=b&&b<=2752||b==2761||2763<=b&&b<=2764||2818<=b&&b<=2819||b==2880||2887<=b&&b<=2888||2891<=b&&b<=2892||b==3007||3009<=b&&b<=3010||3014<=b&&b<=3016||3018<=b&&b<=3020||3073<=b&&b<=3075||3137<=b&&b<=3140||3202<=b&&b<=3203||b==3262||3264<=b&&b<=3265||3267<=b&&b<=3268||3271<=b&&b<=3272||3274<=b&&b<=3275||3330<=b&&b<=3331||3391<=b&&b<=3392||3398<=b&&b<=3400||3402<=b&&b<=3404||3458<=b&&b<=3459||3536<=b&&b<=3537||3544<=b&&b<=3550||3570<=b&&b<=3571||b==3635||b==3763||3902<=b&&b<=3903||b==3967||b==4145||4155<=b&&b<=4156||4182<=b&&b<=4183||b==4228||b==6070||6078<=b&&b<=6085||6087<=b&&b<=6088||6435<=b&&b<=6438||6441<=b&&b<=6443||6448<=b&&b<=6449||6451<=b&&b<=6456||6681<=b&&b<=6682||b==6741||b==6743||6765<=b&&b<=6770||b==6916||b==6965||b==6971||6973<=b&&b<=6977||6979<=b&&b<=6980||b==7042||b==7073||7078<=b&&b<=7079||b==7082||b==7143||7146<=b&&b<=7148||b==7150||7154<=b&&b<=7155||7204<=b&&b<=7211||7220<=b&&b<=7221||b==7393||7410<=b&&b<=7411||b==7415||43043<=b&&b<=43044||b==43047||43136<=b&&b<=43137||43188<=b&&b<=43203||43346<=b&&b<=43347||b==43395||43444<=b&&b<=43445||43450<=b&&b<=43451||43453<=b&&b<=43456||43567<=b&&b<=43568||43571<=b&&b<=43572||b==43597||b==43755||43758<=b&&b<=43759||b==43765||44003<=b&&b<=44004||44006<=b&&b<=44007||44009<=b&&b<=44010||b==44012||b==69632||b==69634||b==69762||69808<=b&&b<=69810||69815<=b&&b<=69816||b==69932||b==70018||70067<=b&&b<=70069||70079<=b&&b<=70080||70188<=b&&b<=70190||70194<=b&&b<=70195||b==70197||70368<=b&&b<=70370||70402<=b&&b<=70403||b==70463||70465<=b&&b<=70468||70471<=b&&b<=70472||70475<=b&&b<=70477||70498<=b&&b<=70499||70709<=b&&b<=70711||70720<=b&&b<=70721||b==70725||70833<=b&&b<=70834||b==70841||70843<=b&&b<=70844||b==70846||b==70849||71088<=b&&b<=71089||71096<=b&&b<=71099||b==71102||71216<=b&&b<=71218||71227<=b&&b<=71228||b==71230||b==71340||71342<=b&&b<=71343||b==71350||71456<=b&&b<=71457||b==71462||72199<=b&&b<=72200||b==72249||72279<=b&&b<=72280||b==72343||b==72751||b==72766||b==72873||b==72881||b==72884||94033<=b&&b<=94078||b==119142||b==119149?r:4352<=b&&b<=4447||43360<=b&&b<=43388?s:4448<=b&&b<=4519||55216<=b&&b<=55238?a:4520<=b&&b<=4607||55243<=b&&b<=55291?c:b==44032||b==44060||b==44088||b==44116||b==44144||b==44172||b==44200||b==44228||b==44256||b==44284||b==44312||b==44340||b==44368||b==44396||b==44424||b==44452||b==44480||b==44508||b==44536||b==44564||b==44592||b==44620||b==44648||b==44676||b==44704||b==44732||b==44760||b==44788||b==44816||b==44844||b==44872||b==44900||b==44928||b==44956||b==44984||b==45012||b==45040||b==45068||b==45096||b==45124||b==45152||b==45180||b==45208||b==45236||b==45264||b==45292||b==45320||b==45348||b==45376||b==45404||b==45432||b==45460||b==45488||b==45516||b==45544||b==45572||b==45600||b==45628||b==45656||b==45684||b==45712||b==45740||b==45768||b==45796||b==45824||b==45852||b==45880||b==45908||b==45936||b==45964||b==45992||b==46020||b==46048||b==46076||b==46104||b==46132||b==46160||b==46188||b==46216||b==46244||b==46272||b==46300||b==46328||b==46356||b==46384||b==46412||b==46440||b==46468||b==46496||b==46524||b==46552||b==46580||b==46608||b==46636||b==46664||b==46692||b==46720||b==46748||b==46776||b==46804||b==46832||b==46860||b==46888||b==46916||b==46944||b==46972||b==47e3||b==47028||b==47056||b==47084||b==47112||b==47140||b==47168||b==47196||b==47224||b==47252||b==47280||b==47308||b==47336||b==47364||b==47392||b==47420||b==47448||b==47476||b==47504||b==47532||b==47560||b==47588||b==47616||b==47644||b==47672||b==47700||b==47728||b==47756||b==47784||b==47812||b==47840||b==47868||b==47896||b==47924||b==47952||b==47980||b==48008||b==48036||b==48064||b==48092||b==48120||b==48148||b==48176||b==48204||b==48232||b==48260||b==48288||b==48316||b==48344||b==48372||b==48400||b==48428||b==48456||b==48484||b==48512||b==48540||b==48568||b==48596||b==48624||b==48652||b==48680||b==48708||b==48736||b==48764||b==48792||b==48820||b==48848||b==48876||b==48904||b==48932||b==48960||b==48988||b==49016||b==49044||b==49072||b==49100||b==49128||b==49156||b==49184||b==49212||b==49240||b==49268||b==49296||b==49324||b==49352||b==49380||b==49408||b==49436||b==49464||b==49492||b==49520||b==49548||b==49576||b==49604||b==49632||b==49660||b==49688||b==49716||b==49744||b==49772||b==49800||b==49828||b==49856||b==49884||b==49912||b==49940||b==49968||b==49996||b==50024||b==50052||b==50080||b==50108||b==50136||b==50164||b==50192||b==50220||b==50248||b==50276||b==50304||b==50332||b==50360||b==50388||b==50416||b==50444||b==50472||b==50500||b==50528||b==50556||b==50584||b==50612||b==50640||b==50668||b==50696||b==50724||b==50752||b==50780||b==50808||b==50836||b==50864||b==50892||b==50920||b==50948||b==50976||b==51004||b==51032||b==51060||b==51088||b==51116||b==51144||b==51172||b==51200||b==51228||b==51256||b==51284||b==51312||b==51340||b==51368||b==51396||b==51424||b==51452||b==51480||b==51508||b==51536||b==51564||b==51592||b==51620||b==51648||b==51676||b==51704||b==51732||b==51760||b==51788||b==51816||b==51844||b==51872||b==51900||b==51928||b==51956||b==51984||b==52012||b==52040||b==52068||b==52096||b==52124||b==52152||b==52180||b==52208||b==52236||b==52264||b==52292||b==52320||b==52348||b==52376||b==52404||b==52432||b==52460||b==52488||b==52516||b==52544||b==52572||b==52600||b==52628||b==52656||b==52684||b==52712||b==52740||b==52768||b==52796||b==52824||b==52852||b==52880||b==52908||b==52936||b==52964||b==52992||b==53020||b==53048||b==53076||b==53104||b==53132||b==53160||b==53188||b==53216||b==53244||b==53272||b==53300||b==53328||b==53356||b==53384||b==53412||b==53440||b==53468||b==53496||b==53524||b==53552||b==53580||b==53608||b==53636||b==53664||b==53692||b==53720||b==53748||b==53776||b==53804||b==53832||b==53860||b==53888||b==53916||b==53944||b==53972||b==54e3||b==54028||b==54056||b==54084||b==54112||b==54140||b==54168||b==54196||b==54224||b==54252||b==54280||b==54308||b==54336||b==54364||b==54392||b==54420||b==54448||b==54476||b==54504||b==54532||b==54560||b==54588||b==54616||b==54644||b==54672||b==54700||b==54728||b==54756||b==54784||b==54812||b==54840||b==54868||b==54896||b==54924||b==54952||b==54980||b==55008||b==55036||b==55064||b==55092||b==55120||b==55148||b==55176?d:44033<=b&&b<=44059||44061<=b&&b<=44087||44089<=b&&b<=44115||44117<=b&&b<=44143||44145<=b&&b<=44171||44173<=b&&b<=44199||44201<=b&&b<=44227||44229<=b&&b<=44255||44257<=b&&b<=44283||44285<=b&&b<=44311||44313<=b&&b<=44339||44341<=b&&b<=44367||44369<=b&&b<=44395||44397<=b&&b<=44423||44425<=b&&b<=44451||44453<=b&&b<=44479||44481<=b&&b<=44507||44509<=b&&b<=44535||44537<=b&&b<=44563||44565<=b&&b<=44591||44593<=b&&b<=44619||44621<=b&&b<=44647||44649<=b&&b<=44675||44677<=b&&b<=44703||44705<=b&&b<=44731||44733<=b&&b<=44759||44761<=b&&b<=44787||44789<=b&&b<=44815||44817<=b&&b<=44843||44845<=b&&b<=44871||44873<=b&&b<=44899||44901<=b&&b<=44927||44929<=b&&b<=44955||44957<=b&&b<=44983||44985<=b&&b<=45011||45013<=b&&b<=45039||45041<=b&&b<=45067||45069<=b&&b<=45095||45097<=b&&b<=45123||45125<=b&&b<=45151||45153<=b&&b<=45179||45181<=b&&b<=45207||45209<=b&&b<=45235||45237<=b&&b<=45263||45265<=b&&b<=45291||45293<=b&&b<=45319||45321<=b&&b<=45347||45349<=b&&b<=45375||45377<=b&&b<=45403||45405<=b&&b<=45431||45433<=b&&b<=45459||45461<=b&&b<=45487||45489<=b&&b<=45515||45517<=b&&b<=45543||45545<=b&&b<=45571||45573<=b&&b<=45599||45601<=b&&b<=45627||45629<=b&&b<=45655||45657<=b&&b<=45683||45685<=b&&b<=45711||45713<=b&&b<=45739||45741<=b&&b<=45767||45769<=b&&b<=45795||45797<=b&&b<=45823||45825<=b&&b<=45851||45853<=b&&b<=45879||45881<=b&&b<=45907||45909<=b&&b<=45935||45937<=b&&b<=45963||45965<=b&&b<=45991||45993<=b&&b<=46019||46021<=b&&b<=46047||46049<=b&&b<=46075||46077<=b&&b<=46103||46105<=b&&b<=46131||46133<=b&&b<=46159||46161<=b&&b<=46187||46189<=b&&b<=46215||46217<=b&&b<=46243||46245<=b&&b<=46271||46273<=b&&b<=46299||46301<=b&&b<=46327||46329<=b&&b<=46355||46357<=b&&b<=46383||46385<=b&&b<=46411||46413<=b&&b<=46439||46441<=b&&b<=46467||46469<=b&&b<=46495||46497<=b&&b<=46523||46525<=b&&b<=46551||46553<=b&&b<=46579||46581<=b&&b<=46607||46609<=b&&b<=46635||46637<=b&&b<=46663||46665<=b&&b<=46691||46693<=b&&b<=46719||46721<=b&&b<=46747||46749<=b&&b<=46775||46777<=b&&b<=46803||46805<=b&&b<=46831||46833<=b&&b<=46859||46861<=b&&b<=46887||46889<=b&&b<=46915||46917<=b&&b<=46943||46945<=b&&b<=46971||46973<=b&&b<=46999||47001<=b&&b<=47027||47029<=b&&b<=47055||47057<=b&&b<=47083||47085<=b&&b<=47111||47113<=b&&b<=47139||47141<=b&&b<=47167||47169<=b&&b<=47195||47197<=b&&b<=47223||47225<=b&&b<=47251||47253<=b&&b<=47279||47281<=b&&b<=47307||47309<=b&&b<=47335||47337<=b&&b<=47363||47365<=b&&b<=47391||47393<=b&&b<=47419||47421<=b&&b<=47447||47449<=b&&b<=47475||47477<=b&&b<=47503||47505<=b&&b<=47531||47533<=b&&b<=47559||47561<=b&&b<=47587||47589<=b&&b<=47615||47617<=b&&b<=47643||47645<=b&&b<=47671||47673<=b&&b<=47699||47701<=b&&b<=47727||47729<=b&&b<=47755||47757<=b&&b<=47783||47785<=b&&b<=47811||47813<=b&&b<=47839||47841<=b&&b<=47867||47869<=b&&b<=47895||47897<=b&&b<=47923||47925<=b&&b<=47951||47953<=b&&b<=47979||47981<=b&&b<=48007||48009<=b&&b<=48035||48037<=b&&b<=48063||48065<=b&&b<=48091||48093<=b&&b<=48119||48121<=b&&b<=48147||48149<=b&&b<=48175||48177<=b&&b<=48203||48205<=b&&b<=48231||48233<=b&&b<=48259||48261<=b&&b<=48287||48289<=b&&b<=48315||48317<=b&&b<=48343||48345<=b&&b<=48371||48373<=b&&b<=48399||48401<=b&&b<=48427||48429<=b&&b<=48455||48457<=b&&b<=48483||48485<=b&&b<=48511||48513<=b&&b<=48539||48541<=b&&b<=48567||48569<=b&&b<=48595||48597<=b&&b<=48623||48625<=b&&b<=48651||48653<=b&&b<=48679||48681<=b&&b<=48707||48709<=b&&b<=48735||48737<=b&&b<=48763||48765<=b&&b<=48791||48793<=b&&b<=48819||48821<=b&&b<=48847||48849<=b&&b<=48875||48877<=b&&b<=48903||48905<=b&&b<=48931||48933<=b&&b<=48959||48961<=b&&b<=48987||48989<=b&&b<=49015||49017<=b&&b<=49043||49045<=b&&b<=49071||49073<=b&&b<=49099||49101<=b&&b<=49127||49129<=b&&b<=49155||49157<=b&&b<=49183||49185<=b&&b<=49211||49213<=b&&b<=49239||49241<=b&&b<=49267||49269<=b&&b<=49295||49297<=b&&b<=49323||49325<=b&&b<=49351||49353<=b&&b<=49379||49381<=b&&b<=49407||49409<=b&&b<=49435||49437<=b&&b<=49463||49465<=b&&b<=49491||49493<=b&&b<=49519||49521<=b&&b<=49547||49549<=b&&b<=49575||49577<=b&&b<=49603||49605<=b&&b<=49631||49633<=b&&b<=49659||49661<=b&&b<=49687||49689<=b&&b<=49715||49717<=b&&b<=49743||49745<=b&&b<=49771||49773<=b&&b<=49799||49801<=b&&b<=49827||49829<=b&&b<=49855||49857<=b&&b<=49883||49885<=b&&b<=49911||49913<=b&&b<=49939||49941<=b&&b<=49967||49969<=b&&b<=49995||49997<=b&&b<=50023||50025<=b&&b<=50051||50053<=b&&b<=50079||50081<=b&&b<=50107||50109<=b&&b<=50135||50137<=b&&b<=50163||50165<=b&&b<=50191||50193<=b&&b<=50219||50221<=b&&b<=50247||50249<=b&&b<=50275||50277<=b&&b<=50303||50305<=b&&b<=50331||50333<=b&&b<=50359||50361<=b&&b<=50387||50389<=b&&b<=50415||50417<=b&&b<=50443||50445<=b&&b<=50471||50473<=b&&b<=50499||50501<=b&&b<=50527||50529<=b&&b<=50555||50557<=b&&b<=50583||50585<=b&&b<=50611||50613<=b&&b<=50639||50641<=b&&b<=50667||50669<=b&&b<=50695||50697<=b&&b<=50723||50725<=b&&b<=50751||50753<=b&&b<=50779||50781<=b&&b<=50807||50809<=b&&b<=50835||50837<=b&&b<=50863||50865<=b&&b<=50891||50893<=b&&b<=50919||50921<=b&&b<=50947||50949<=b&&b<=50975||50977<=b&&b<=51003||51005<=b&&b<=51031||51033<=b&&b<=51059||51061<=b&&b<=51087||51089<=b&&b<=51115||51117<=b&&b<=51143||51145<=b&&b<=51171||51173<=b&&b<=51199||51201<=b&&b<=51227||51229<=b&&b<=51255||51257<=b&&b<=51283||51285<=b&&b<=51311||51313<=b&&b<=51339||51341<=b&&b<=51367||51369<=b&&b<=51395||51397<=b&&b<=51423||51425<=b&&b<=51451||51453<=b&&b<=51479||51481<=b&&b<=51507||51509<=b&&b<=51535||51537<=b&&b<=51563||51565<=b&&b<=51591||51593<=b&&b<=51619||51621<=b&&b<=51647||51649<=b&&b<=51675||51677<=b&&b<=51703||51705<=b&&b<=51731||51733<=b&&b<=51759||51761<=b&&b<=51787||51789<=b&&b<=51815||51817<=b&&b<=51843||51845<=b&&b<=51871||51873<=b&&b<=51899||51901<=b&&b<=51927||51929<=b&&b<=51955||51957<=b&&b<=51983||51985<=b&&b<=52011||52013<=b&&b<=52039||52041<=b&&b<=52067||52069<=b&&b<=52095||52097<=b&&b<=52123||52125<=b&&b<=52151||52153<=b&&b<=52179||52181<=b&&b<=52207||52209<=b&&b<=52235||52237<=b&&b<=52263||52265<=b&&b<=52291||52293<=b&&b<=52319||52321<=b&&b<=52347||52349<=b&&b<=52375||52377<=b&&b<=52403||52405<=b&&b<=52431||52433<=b&&b<=52459||52461<=b&&b<=52487||52489<=b&&b<=52515||52517<=b&&b<=52543||52545<=b&&b<=52571||52573<=b&&b<=52599||52601<=b&&b<=52627||52629<=b&&b<=52655||52657<=b&&b<=52683||52685<=b&&b<=52711||52713<=b&&b<=52739||52741<=b&&b<=52767||52769<=b&&b<=52795||52797<=b&&b<=52823||52825<=b&&b<=52851||52853<=b&&b<=52879||52881<=b&&b<=52907||52909<=b&&b<=52935||52937<=b&&b<=52963||52965<=b&&b<=52991||52993<=b&&b<=53019||53021<=b&&b<=53047||53049<=b&&b<=53075||53077<=b&&b<=53103||53105<=b&&b<=53131||53133<=b&&b<=53159||53161<=b&&b<=53187||53189<=b&&b<=53215||53217<=b&&b<=53243||53245<=b&&b<=53271||53273<=b&&b<=53299||53301<=b&&b<=53327||53329<=b&&b<=53355||53357<=b&&b<=53383||53385<=b&&b<=53411||53413<=b&&b<=53439||53441<=b&&b<=53467||53469<=b&&b<=53495||53497<=b&&b<=53523||53525<=b&&b<=53551||53553<=b&&b<=53579||53581<=b&&b<=53607||53609<=b&&b<=53635||53637<=b&&b<=53663||53665<=b&&b<=53691||53693<=b&&b<=53719||53721<=b&&b<=53747||53749<=b&&b<=53775||53777<=b&&b<=53803||53805<=b&&b<=53831||53833<=b&&b<=53859||53861<=b&&b<=53887||53889<=b&&b<=53915||53917<=b&&b<=53943||53945<=b&&b<=53971||53973<=b&&b<=53999||54001<=b&&b<=54027||54029<=b&&b<=54055||54057<=b&&b<=54083||54085<=b&&b<=54111||54113<=b&&b<=54139||54141<=b&&b<=54167||54169<=b&&b<=54195||54197<=b&&b<=54223||54225<=b&&b<=54251||54253<=b&&b<=54279||54281<=b&&b<=54307||54309<=b&&b<=54335||54337<=b&&b<=54363||54365<=b&&b<=54391||54393<=b&&b<=54419||54421<=b&&b<=54447||54449<=b&&b<=54475||54477<=b&&b<=54503||54505<=b&&b<=54531||54533<=b&&b<=54559||54561<=b&&b<=54587||54589<=b&&b<=54615||54617<=b&&b<=54643||54645<=b&&b<=54671||54673<=b&&b<=54699||54701<=b&&b<=54727||54729<=b&&b<=54755||54757<=b&&b<=54783||54785<=b&&b<=54811||54813<=b&&b<=54839||54841<=b&&b<=54867||54869<=b&&b<=54895||54897<=b&&b<=54923||54925<=b&&b<=54951||54953<=b&&b<=54979||54981<=b&&b<=55007||55009<=b&&b<=55035||55037<=b&&b<=55063||55065<=b&&b<=55091||55093<=b&&b<=55119||55121<=b&&b<=55147||55149<=b&&b<=55175||55177<=b&&b<=55203?u:b==9757||b==9977||9994<=b&&b<=9997||b==127877||127938<=b&&b<=127940||b==127943||127946<=b&&b<=127948||128066<=b&&b<=128067||128070<=b&&b<=128080||b==128110||128112<=b&&b<=128120||b==128124||128129<=b&&b<=128131||128133<=b&&b<=128135||b==128170||128372<=b&&b<=128373||b==128378||b==128400||128405<=b&&b<=128406||128581<=b&&b<=128583||128587<=b&&b<=128591||b==128675||128692<=b&&b<=128694||b==128704||b==128716||129304<=b&&b<=129308||129310<=b&&b<=129311||b==129318||129328<=b&&b<=129337||129341<=b&&b<=129342||129489<=b&&b<=129501?y:127995<=b&&b<=127999?f:b==8205?x:b==9792||b==9794||9877<=b&&b<=9878||b==9992||b==10084||b==127752||b==127806||b==127859||b==127891||b==127908||b==127912||b==127979||b==127981||b==128139||128187<=b&&b<=128188||b==128295||b==128300||b==128488||b==128640||b==128658?_:128102<=b&&b<=128105?C:m}return this}typeof t5<"u"&&t5.exports&&(t5.exports=PDe)});var zse=Gc((t2n,NH)=>{"use strict";var n2n=T(S());NH.exports=c5;NH.exports.default=c5;function c5(e,t,n){n=n||2;var i=t&&t.length,o=i?t[0]*n:e.length,r=Yse(e,0,o,n,!0),s=[];if(!r||r.next===r.prev)return s;var a,c,d,u,m,p,y;if(i&&(r=A3e(e,t,r,n)),e.length>80*n){a=d=e[0],c=u=e[1];for(var f=n;f<o;f+=n)m=e[f],p=e[f+1],m<a&&(a=m),p<c&&(c=p),m>d&&(d=m),p>u&&(u=p);y=Math.max(d-a,u-c),y=y!==0?32767/y:0}return $W(r,s,n,a,c,y,0),s}function Yse(e,t,n,i,o){var r,s;if(o===MH(e,t,n,i)>0)for(r=t;r<n;r+=i)s=Ose(r,e[r],e[r+1],s);else for(r=n-i;r>=t;r-=i)s=Ose(r,e[r],e[r+1],s);return s&&l5(s,s.next)&&(t2(s),s=s.next),s}function p_(e,t){if(!e)return e;t||(t=e);var n=e,i;do if(i=!1,!n.steiner&&(l5(n,n.next)||Zr(n.prev,n,n.next)===0)){if(t2(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function $W(e,t,n,i,o,r,s){if(e){!s&&r&&D3e(e,i,o,r);for(var a=e,c,d;e.prev!==e.next;){if(c=e.prev,d=e.next,r?v3e(e,i,o,r):P3e(e)){t.push(c.i/n|0),t.push(e.i/n|0),t.push(d.i/n|0),t2(e),e=d.next,a=d.next;continue}if(e=d,e===a){s?s===1?(e=w3e(p_(e),t,n),$W(e,t,n,i,o,r,2)):s===2&&F3e(e,t,n,i,o,r):$W(p_(e),t,n,i,o,r,1);break}}}}function P3e(e){var t=e.prev,n=e,i=e.next;if(Zr(t,n,i)>=0)return!1;for(var o=t.x,r=n.x,s=i.x,a=t.y,c=n.y,d=i.y,u=o<r?o<s?o:s:r<s?r:s,m=a<c?a<d?a:d:c<d?c:d,p=o>r?o>s?o:s:r>s?r:s,y=a>c?a>d?a:d:c>d?c:d,f=i.next;f!==t;){if(f.x>=u&&f.x<=p&&f.y>=m&&f.y<=y&&NC(o,a,r,c,s,d,f.x,f.y)&&Zr(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function v3e(e,t,n,i){var o=e.prev,r=e,s=e.next;if(Zr(o,r,s)>=0)return!1;for(var a=o.x,c=r.x,d=s.x,u=o.y,m=r.y,p=s.y,y=a<c?a<d?a:d:c<d?c:d,f=u<m?u<p?u:p:m<p?m:p,x=a>c?a>d?a:d:c>d?c:d,_=u>m?u>p?u:p:m>p?m:p,C=FH(y,f,t,n,i),V=FH(x,_,t,n,i),L=e.prevZ,Z=e.nextZ;L&&L.z>=C&&Z&&Z.z<=V;){if(L.x>=y&&L.x<=x&&L.y>=f&&L.y<=_&&L!==o&&L!==s&&NC(a,u,c,m,d,p,L.x,L.y)&&Zr(L.prev,L,L.next)>=0||(L=L.prevZ,Z.x>=y&&Z.x<=x&&Z.y>=f&&Z.y<=_&&Z!==o&&Z!==s&&NC(a,u,c,m,d,p,Z.x,Z.y)&&Zr(Z.prev,Z,Z.next)>=0))return!1;Z=Z.nextZ}for(;L&&L.z>=C;){if(L.x>=y&&L.x<=x&&L.y>=f&&L.y<=_&&L!==o&&L!==s&&NC(a,u,c,m,d,p,L.x,L.y)&&Zr(L.prev,L,L.next)>=0)return!1;L=L.prevZ}for(;Z&&Z.z<=V;){if(Z.x>=y&&Z.x<=x&&Z.y>=f&&Z.y<=_&&Z!==o&&Z!==s&&NC(a,u,c,m,d,p,Z.x,Z.y)&&Zr(Z.prev,Z,Z.next)>=0)return!1;Z=Z.nextZ}return!0}function w3e(e,t,n){var i=e;do{var o=i.prev,r=i.next.next;!l5(o,r)&&Hse(o,i,i.next,r)&&e2(o,r)&&e2(r,o)&&(t.push(o.i/n|0),t.push(i.i/n|0),t.push(r.i/n|0),t2(i),t2(i.next),i=e=r),i=i.next}while(i!==e);return p_(i)}function F3e(e,t,n,i,o,r){var s=e;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&Y3e(s,a)){var c=Kse(s,a);s=p_(s,s.next),c=p_(c,c.next),$W(s,t,n,i,o,r,0),$W(c,t,n,i,o,r,0);return}a=a.next}s=s.next}while(s!==e)}function A3e(e,t,n,i){var o=[],r,s,a,c,d;for(r=0,s=t.length;r<s;r++)a=t[r]*i,c=r<s-1?t[r+1]*i:e.length,d=Yse(e,a,c,i,!1),d===d.next&&(d.steiner=!0),o.push(O3e(d));for(o.sort(M3e),r=0;r<o.length;r++)n=N3e(o[r],n);return n}function M3e(e,t){return e.x-t.x}function N3e(e,t){var n=U3e(e,t);if(!n)return t;var i=Kse(n,e);return p_(i,i.next),p_(n,n.next)}function U3e(e,t){var n=t,i=e.x,o=e.y,r=-1/0,s;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var a=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=i&&a>r&&(r=a,s=n.x<n.next.x?n:n.next,a===i))return s}n=n.next}while(n!==t);if(!s)return null;var c=s,d=s.x,u=s.y,m=1/0,p;n=s;do i>=n.x&&n.x>=d&&i!==n.x&&NC(o<u?i:r,o,d,u,o<u?r:i,o,n.x,n.y)&&(p=Math.abs(o-n.y)/(i-n.x),e2(n,e)&&(p<m||p===m&&(n.x>s.x||n.x===s.x&&k3e(s,n)))&&(s=n,m=p)),n=n.next;while(n!==c);return s}function k3e(e,t){return Zr(e.prev,e,t.prev)<0&&Zr(t.next,e,e.next)<0}function D3e(e,t,n,i){var o=e;do o.z===0&&(o.z=FH(o.x,o.y,t,n,i)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==e);o.prevZ.nextZ=null,o.prevZ=null,B3e(o)}function B3e(e){var t,n,i,o,r,s,a,c,d=1;do{for(n=e,e=null,r=null,s=0;n;){for(s++,i=n,a=0,t=0;t<d&&(a++,i=i.nextZ,!!i);t++);for(c=d;a>0||c>0&&i;)a!==0&&(c===0||!i||n.z<=i.z)?(o=n,n=n.nextZ,a--):(o=i,i=i.nextZ,c--),r?r.nextZ=o:e=o,o.prevZ=r,r=o;n=i}r.nextZ=null,d*=2}while(s>1);return e}function FH(e,t,n,i,o){return e=(e-n)*o|0,t=(t-i)*o|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function O3e(e){var t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function NC(e,t,n,i,o,r,s,a){return(o-s)*(t-a)>=(e-s)*(r-a)&&(e-s)*(i-a)>=(n-s)*(t-a)&&(n-s)*(r-a)>=(o-s)*(i-a)}function Y3e(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!H3e(e,t)&&(e2(e,t)&&e2(t,e)&&K3e(e,t)&&(Zr(e.prev,e,t.prev)||Zr(e,t.prev,t))||l5(e,t)&&Zr(e.prev,e,e.next)>0&&Zr(t.prev,t,t.next)>0)}function Zr(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function l5(e,t){return e.x===t.x&&e.y===t.y}function Hse(e,t,n,i){var o=a5(Zr(e,t,n)),r=a5(Zr(e,t,i)),s=a5(Zr(n,i,e)),a=a5(Zr(n,i,t));return!!(o!==r&&s!==a||o===0&&s5(e,n,t)||r===0&&s5(e,i,t)||s===0&&s5(n,e,i)||a===0&&s5(n,t,i))}function s5(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function a5(e){return e>0?1:e<0?-1:0}function H3e(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Hse(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function e2(e,t){return Zr(e.prev,e,e.next)<0?Zr(e,t,e.next)>=0&&Zr(e,e.prev,t)>=0:Zr(e,t,e.prev)<0||Zr(e,e.next,t)<0}function K3e(e,t){var n=e,i=!1,o=(e.x+t.x)/2,r=(e.y+t.y)/2;do n.y>r!=n.next.y>r&&n.next.y!==n.y&&o<(n.next.x-n.x)*(r-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==e);return i}function Kse(e,t){var n=new AH(e.i,e.x,e.y),i=new AH(t.i,t.x,t.y),o=e.next,r=t.prev;return e.next=t,t.prev=e,n.next=o,o.prev=n,i.next=n,n.prev=i,r.next=i,i.prev=r,i}function Ose(e,t,n,i){var o=new AH(e,t,n);return i?(o.next=i.next,o.prev=i,i.next.prev=o,i.next=o):(o.prev=o,o.next=o),o}function t2(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 AH(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}c5.deviation=function(e,t,n,i){var o=t&&t.length,r=o?t[0]*n:e.length,s=Math.abs(MH(e,0,r,n));if(o)for(var a=0,c=t.length;a<c;a++){var d=t[a]*n,u=a<c-1?t[a+1]*n:e.length;s-=Math.abs(MH(e,d,u,n))}var m=0;for(a=0;a<i.length;a+=3){var p=i[a]*n,y=i[a+1]*n,f=i[a+2]*n;m+=Math.abs((e[p]-e[f])*(e[y+1]-e[p+1])-(e[p]-e[y])*(e[f+1]-e[p+1]))}return s===0&&m===0?0:Math.abs((m-s)/s)};function MH(e,t,n,i){for(var o=0,r=t,s=n-i;r<n;r+=i)o+=(e[s]-e[r])*(e[r+1]+e[s+1]),s=r;return o}c5.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},i=0,o=0;o<e.length;o++){for(var r=0;r<e[o].length;r++)for(var s=0;s<t;s++)n.vertices.push(e[o][r][s]);o>0&&(i+=e[o-1].length,n.holes.push(i))}return n}});var yue=Gc((fz,pz)=>{var O7n=T(S());(function(e,t){typeof fz=="object"&&typeof pz<"u"?pz.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self).RBush=t()})(fz,function(){"use strict";function e(_,C,V,L,Z){(function G(I,P,v,F,M){for(;F>v;){if(F-v>600){var b=F-v+1,R=P-v+1,E=Math.log(b),X=.5*Math.exp(2*E/3),w=.5*Math.sqrt(E*X*(b-X)/b)*(R-b/2<0?-1:1),N=Math.max(v,Math.floor(P-R*X/b+w)),D=Math.min(F,Math.floor(P+(b-R)*X/b+w));G(I,P,N,D,M)}var k=I[P],Y=v,U=F;for(t(I,v,P),M(I[F],k)>0&&t(I,v,F);Y<U;){for(t(I,Y,U),Y++,U--;M(I[Y],k)<0;)Y++;for(;M(I[U],k)>0;)U--}M(I[v],k)===0?t(I,v,U):t(I,++U,F),U<=P&&(v=U+1),P<=U&&(F=U-1)}})(_,C,V||0,L||_.length-1,Z||n)}function t(_,C,V){var L=_[C];_[C]=_[V],_[V]=L}function n(_,C){return _<C?-1:_>C?1:0}var i=function(_){_===void 0&&(_=9),this._maxEntries=Math.max(4,_),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(_,C,V){if(!V)return C.indexOf(_);for(var L=0;L<C.length;L++)if(V(_,C[L]))return L;return-1}function r(_,C){s(_,0,_.children.length,C,_)}function s(_,C,V,L,Z){Z||(Z=f(null)),Z.minX=1/0,Z.minY=1/0,Z.maxX=-1/0,Z.maxY=-1/0;for(var G=C;G<V;G++){var I=_.children[G];a(Z,_.leaf?L(I):I)}return Z}function a(_,C){return _.minX=Math.min(_.minX,C.minX),_.minY=Math.min(_.minY,C.minY),_.maxX=Math.max(_.maxX,C.maxX),_.maxY=Math.max(_.maxY,C.maxY),_}function c(_,C){return _.minX-C.minX}function d(_,C){return _.minY-C.minY}function u(_){return(_.maxX-_.minX)*(_.maxY-_.minY)}function m(_){return _.maxX-_.minX+(_.maxY-_.minY)}function p(_,C){return _.minX<=C.minX&&_.minY<=C.minY&&C.maxX<=_.maxX&&C.maxY<=_.maxY}function y(_,C){return C.minX<=_.maxX&&C.minY<=_.maxY&&C.maxX>=_.minX&&C.maxY>=_.minY}function f(_){return{children:_,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function x(_,C,V,L,Z){for(var G=[C,V];G.length;)if(!((V=G.pop())-(C=G.pop())<=L)){var I=C+Math.ceil((V-C)/L/2)*L;e(_,I,C,V,Z),G.push(C,I,I,V)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(_){var C=this.data,V=[];if(!y(_,C))return V;for(var L=this.toBBox,Z=[];C;){for(var G=0;G<C.children.length;G++){var I=C.children[G],P=C.leaf?L(I):I;y(_,P)&&(C.leaf?V.push(I):p(_,P)?this._all(I,V):Z.push(I))}C=Z.pop()}return V},i.prototype.collides=function(_){var C=this.data;if(!y(_,C))return!1;for(var V=[];C;){for(var L=0;L<C.children.length;L++){var Z=C.children[L],G=C.leaf?this.toBBox(Z):Z;if(y(_,G)){if(C.leaf||p(_,G))return!0;V.push(Z)}}C=V.pop()}return!1},i.prototype.load=function(_){if(!_||!_.length)return this;if(_.length<this._minEntries){for(var C=0;C<_.length;C++)this.insert(_[C]);return this}var V=this._build(_.slice(),0,_.length-1,0);if(this.data.children.length)if(this.data.height===V.height)this._splitRoot(this.data,V);else{if(this.data.height<V.height){var L=this.data;this.data=V,V=L}this._insert(V,this.data.height-V.height-1,!0)}else this.data=V;return this},i.prototype.insert=function(_){return _&&this._insert(_,this.data.height-1),this},i.prototype.clear=function(){return this.data=f([]),this},i.prototype.remove=function(_,C){if(!_)return this;for(var V,L,Z,G=this.data,I=this.toBBox(_),P=[],v=[];G||P.length;){if(G||(G=P.pop(),L=P[P.length-1],V=v.pop(),Z=!0),G.leaf){var F=o(_,G.children,C);if(F!==-1)return G.children.splice(F,1),P.push(G),this._condense(P),this}Z||G.leaf||!p(G,I)?L?(V++,G=L.children[V],Z=!1):G=null:(P.push(G),v.push(V),V=0,L=G,G=G.children[0])}return this},i.prototype.toBBox=function(_){return _},i.prototype.compareMinX=function(_,C){return _.minX-C.minX},i.prototype.compareMinY=function(_,C){return _.minY-C.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(_){return this.data=_,this},i.prototype._all=function(_,C){for(var V=[];_;)_.leaf?C.push.apply(C,_.children):V.push.apply(V,_.children),_=V.pop();return C},i.prototype._build=function(_,C,V,L){var Z,G=V-C+1,I=this._maxEntries;if(G<=I)return r(Z=f(_.slice(C,V+1)),this.toBBox),Z;L||(L=Math.ceil(Math.log(G)/Math.log(I)),I=Math.ceil(G/Math.pow(I,L-1))),(Z=f([])).leaf=!1,Z.height=L;var P=Math.ceil(G/I),v=P*Math.ceil(Math.sqrt(I));x(_,C,V,v,this.compareMinX);for(var F=C;F<=V;F+=v){var M=Math.min(F+v-1,V);x(_,F,M,P,this.compareMinY);for(var b=F;b<=M;b+=P){var R=Math.min(b+P-1,M);Z.children.push(this._build(_,b,R,L-1))}}return r(Z,this.toBBox),Z},i.prototype._chooseSubtree=function(_,C,V,L){for(;L.push(C),!C.leaf&&L.length-1!==V;){for(var Z=1/0,G=1/0,I=void 0,P=0;P<C.children.length;P++){var v=C.children[P],F=u(v),M=(b=_,R=v,(Math.max(R.maxX,b.maxX)-Math.min(R.minX,b.minX))*(Math.max(R.maxY,b.maxY)-Math.min(R.minY,b.minY))-F);M<G?(G=M,Z=F<Z?F:Z,I=v):M===G&&F<Z&&(Z=F,I=v)}C=I||C.children[0]}var b,R;return C},i.prototype._insert=function(_,C,V){var L=V?_:this.toBBox(_),Z=[],G=this._chooseSubtree(L,this.data,C,Z);for(G.children.push(_),a(G,L);C>=0&&Z[C].children.length>this._maxEntries;)this._split(Z,C),C--;this._adjustParentBBoxes(L,Z,C)},i.prototype._split=function(_,C){var V=_[C],L=V.children.length,Z=this._minEntries;this._chooseSplitAxis(V,Z,L);var G=this._chooseSplitIndex(V,Z,L),I=f(V.children.splice(G,V.children.length-G));I.height=V.height,I.leaf=V.leaf,r(V,this.toBBox),r(I,this.toBBox),C?_[C-1].children.push(I):this._splitRoot(V,I)},i.prototype._splitRoot=function(_,C){this.data=f([_,C]),this.data.height=_.height+1,this.data.leaf=!1,r(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(_,C,V){for(var L,Z,G,I,P,v,F,M=1/0,b=1/0,R=C;R<=V-C;R++){var E=s(_,0,R,this.toBBox),X=s(_,R,V,this.toBBox),w=(Z=E,G=X,I=void 0,P=void 0,v=void 0,F=void 0,I=Math.max(Z.minX,G.minX),P=Math.max(Z.minY,G.minY),v=Math.min(Z.maxX,G.maxX),F=Math.min(Z.maxY,G.maxY),Math.max(0,v-I)*Math.max(0,F-P)),N=u(E)+u(X);w<M?(M=w,L=R,b=N<b?N:b):w===M&&N<b&&(b=N,L=R)}return L||V-C},i.prototype._chooseSplitAxis=function(_,C,V){var L=_.leaf?this.compareMinX:c,Z=_.leaf?this.compareMinY:d;this._allDistMargin(_,C,V,L)<this._allDistMargin(_,C,V,Z)&&_.children.sort(L)},i.prototype._allDistMargin=function(_,C,V,L){_.children.sort(L);for(var Z=this.toBBox,G=s(_,0,C,Z),I=s(_,V-C,V,Z),P=m(G)+m(I),v=C;v<V-C;v++){var F=_.children[v];a(G,_.leaf?Z(F):F),P+=m(G)}for(var M=V-C-1;M>=C;M--){var b=_.children[M];a(I,_.leaf?Z(b):b),P+=m(I)}return P},i.prototype._adjustParentBBoxes=function(_,C,V){for(var L=V;L>=0;L--)a(C[L],_)},i.prototype._condense=function(_){for(var C=_.length-1,V=void 0;C>=0;C--)_[C].children.length===0?C>0?(V=_[C-1].children).splice(V.indexOf(_[C]),1):this.clear():r(_[C],this.toBBox)},i})});var wj=Gc((exports,module)=>{var L5i=T(S());/*!
* protobuf.js v7.2.5 (c) 2016, daniel wirtz
* compiled tue, 22 aug 2023 00:04:28 utc
* licensed under the bsd-3-clause license
* see: https://github.com/dcodeio/protobuf.js for details
*/(function(undefined){"use strict";(function(t,n,i){function o(s){var a=n[s];return a||t[s][0].call(a=n[s]={exports:{}},o,a,a.exports),a.exports}var r=o(i[0]);r.util.global.protobuf=r,typeof define=="function"&&define.amd&&define(["long"],function(s){return s&&s.isLong&&(r.util.Long=s,r.configure()),r}),typeof module=="object"&&module&&module.exports&&(module.exports=r)})({1:[function(e,t,n){"use strict";t.exports=i;function i(o,r){for(var s=new Array(arguments.length-1),a=0,c=2,d=!0;c<arguments.length;)s[a++]=arguments[c++];return new Promise(function(m,p){s[a]=function(f){if(d)if(d=!1,f)p(f);else{for(var x=new Array(arguments.length-1),_=0;_<x.length;)x[_++]=arguments[_];m.apply(null,x)}};try{o.apply(r||null,s)}catch(y){d&&(d=!1,p(y))}})}},{}],2:[function(e,t,n){"use strict";var i=n;i.length=function(d){var u=d.length;if(!u)return 0;for(var m=0;--u%4>1&&d.charAt(u)==="=";)++m;return Math.ceil(d.length*3)/4-m};for(var o=new Array(64),r=new Array(123),s=0;s<64;)r[o[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;i.encode=function(d,u,m){for(var p=null,y=[],f=0,x=0,_;u<m;){var C=d[u++];switch(x){case 0:y[f++]=o[C>>2],_=(C&3)<<4,x=1;break;case 1:y[f++]=o[_|C>>4],_=(C&15)<<2,x=2;break;case 2:y[f++]=o[_|C>>6],y[f++]=o[C&63],x=0;break}f>8191&&((p||(p=[])).push(String.fromCharCode.apply(String,y)),f=0)}return x&&(y[f++]=o[_],y[f++]=61,x===1&&(y[f++]=61)),p?(f&&p.push(String.fromCharCode.apply(String,y.slice(0,f))),p.join("")):String.fromCharCode.apply(String,y.slice(0,f))};var a="invalid encoding";i.decode=function(d,u,m){for(var p=m,y=0,f,x=0;x<d.length;){var _=d.charCodeAt(x++);if(_===61&&y>1)break;if((_=r[_])===undefined)throw Error(a);switch(y){case 0:f=_,y=1;break;case 1:u[m++]=f<<2|(_&48)>>4,f=_,y=2;break;case 2:u[m++]=(f&15)<<4|(_&60)>>2,f=_,y=3;break;case 3:u[m++]=(f&3)<<6|_,y=0;break}}if(y===1)throw Error(a);return m-p},i.test=function(d){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(d)}},{}],3:[function(e,t,n){"use strict";t.exports=i;function i(){this._listeners={}}i.prototype.on=function(r,s,a){return(this._listeners[r]||(this._listeners[r]=[])).push({fn:s,ctx:a||this}),this},i.prototype.off=function(r,s){if(r===undefined)this._listeners={};else if(s===undefined)this._listeners[r]=[];else for(var a=this._listeners[r],c=0;c<a.length;)a[c].fn===s?a.splice(c,1):++c;return this},i.prototype.emit=function(r){var s=this._listeners[r];if(s){for(var a=[],c=1;c<arguments.length;)a.push(arguments[c++]);for(c=0;c<s.length;)s[c].fn.apply(s[c++].ctx,a)}return this}},{}],4:[function(e,t,n){"use strict";t.exports=i(i);function i(c){return typeof Float32Array<"u"?function(){var d=new Float32Array([-0]),u=new Uint8Array(d.buffer),m=u[3]===128;function p(_,C,V){d[0]=_,C[V]=u[0],C[V+1]=u[1],C[V+2]=u[2],C[V+3]=u[3]}function y(_,C,V){d[0]=_,C[V]=u[3],C[V+1]=u[2],C[V+2]=u[1],C[V+3]=u[0]}c.writeFloatLE=m?p:y,c.writeFloatBE=m?y:p;function f(_,C){return u[0]=_[C],u[1]=_[C+1],u[2]=_[C+2],u[3]=_[C+3],d[0]}function x(_,C){return u[3]=_[C],u[2]=_[C+1],u[1]=_[C+2],u[0]=_[C+3],d[0]}c.readFloatLE=m?f:x,c.readFloatBE=m?x:f}():function(){function d(m,p,y,f){var x=p<0?1:0;if(x&&(p=-p),p===0)m(1/p>0?0:2147483648,y,f);else if(isNaN(p))m(2143289344,y,f);else if(p>34028234663852886e22)m((x<<31|2139095040)>>>0,y,f);else if(p<11754943508222875e-54)m((x<<31|Math.round(p/1401298464324817e-60))>>>0,y,f);else{var _=Math.floor(Math.log(p)/Math.LN2),C=Math.round(p*Math.pow(2,-_)*8388608)&8388607;m((x<<31|_+127<<23|C)>>>0,y,f)}}c.writeFloatLE=d.bind(null,o),c.writeFloatBE=d.bind(null,r);function u(m,p,y){var f=m(p,y),x=(f>>31)*2+1,_=f>>>23&255,C=f&8388607;return _===255?C?NaN:x*(1/0):_===0?x*1401298464324817e-60*C:x*Math.pow(2,_-150)*(C+8388608)}c.readFloatLE=u.bind(null,s),c.readFloatBE=u.bind(null,a)}(),typeof Float64Array<"u"?function(){var d=new Float64Array([-0]),u=new Uint8Array(d.buffer),m=u[7]===128;function p(_,C,V){d[0]=_,C[V]=u[0],C[V+1]=u[1],C[V+2]=u[2],C[V+3]=u[3],C[V+4]=u[4],C[V+5]=u[5],C[V+6]=u[6],C[V+7]=u[7]}function y(_,C,V){d[0]=_,C[V]=u[7],C[V+1]=u[6],C[V+2]=u[5],C[V+3]=u[4],C[V+4]=u[3],C[V+5]=u[2],C[V+6]=u[1],C[V+7]=u[0]}c.writeDoubleLE=m?p:y,c.writeDoubleBE=m?y:p;function f(_,C){return u[0]=_[C],u[1]=_[C+1],u[2]=_[C+2],u[3]=_[C+3],u[4]=_[C+4],u[5]=_[C+5],u[6]=_[C+6],u[7]=_[C+7],d[0]}function x(_,C){return u[7]=_[C],u[6]=_[C+1],u[5]=_[C+2],u[4]=_[C+3],u[3]=_[C+4],u[2]=_[C+5],u[1]=_[C+6],u[0]=_[C+7],d[0]}c.readDoubleLE=m?f:x,c.readDoubleBE=m?x:f}():function(){function d(m,p,y,f,x,_){var C=f<0?1:0;if(C&&(f=-f),f===0)m(0,x,_+p),m(1/f>0?0:2147483648,x,_+y);else if(isNaN(f))m(0,x,_+p),m(2146959360,x,_+y);else if(f>17976931348623157e292)m(0,x,_+p),m((C<<31|2146435072)>>>0,x,_+y);else{var V;if(f<22250738585072014e-324)V=f/5e-324,m(V>>>0,x,_+p),m((C<<31|V/4294967296)>>>0,x,_+y);else{var L=Math.floor(Math.log(f)/Math.LN2);L===1024&&(L=1023),V=f*Math.pow(2,-L),m(V*4503599627370496>>>0,x,_+p),m((C<<31|L+1023<<20|V*1048576&1048575)>>>0,x,_+y)}}}c.writeDoubleLE=d.bind(null,o,0,4),c.writeDoubleBE=d.bind(null,r,4,0);function u(m,p,y,f,x){var _=m(f,x+p),C=m(f,x+y),V=(C>>31)*2+1,L=C>>>20&2047,Z=4294967296*(C&1048575)+_;return L===2047?Z?NaN:V*(1/0):L===0?V*5e-324*Z:V*Math.pow(2,L-1075)*(Z+4503599627370496)}c.readDoubleLE=u.bind(null,s,0,4),c.readDoubleBE=u.bind(null,a,4,0)}(),c}function o(c,d,u){d[u]=c&255,d[u+1]=c>>>8&255,d[u+2]=c>>>16&255,d[u+3]=c>>>24}function r(c,d,u){d[u]=c>>>24,d[u+1]=c>>>16&255,d[u+2]=c>>>8&255,d[u+3]=c&255}function s(c,d){return(c[d]|c[d+1]<<8|c[d+2]<<16|c[d+3]<<24)>>>0}function a(c,d){return(c[d]<<24|c[d+1]<<16|c[d+2]<<8|c[d+3])>>>0}},{}],5:[function(require,module,exports){"use strict";module.exports=inquire;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}},{}],6:[function(e,t,n){"use strict";t.exports=i;function i(o,r,s){var a=s||8192,c=a>>>1,d=null,u=a;return function(p){if(p<1||p>c)return o(p);u+p>a&&(d=o(a),u=0);var y=r.call(d,u,u+=p);return u&7&&(u=(u|7)+1),y}}},{}],7:[function(e,t,n){"use strict";var i=n;i.length=function(r){for(var s=0,a=0,c=0;c<r.length;++c)a=r.charCodeAt(c),a<128?s+=1:a<2048?s+=2:(a&64512)===55296&&(r.charCodeAt(c+1)&64512)===56320?(++c,s+=4):s+=3;return s},i.read=function(r,s,a){var c=a-s;if(c<1)return"";for(var d=null,u=[],m=0,p;s<a;)p=r[s++],p<128?u[m++]=p:p>191&&p<224?u[m++]=(p&31)<<6|r[s++]&63:p>239&&p<365?(p=((p&7)<<18|(r[s++]&63)<<12|(r[s++]&63)<<6|r[s++]&63)-65536,u[m++]=55296+(p>>10),u[m++]=56320+(p&1023)):u[m++]=(p&15)<<12|(r[s++]&63)<<6|r[s++]&63,m>8191&&((d||(d=[])).push(String.fromCharCode.apply(String,u)),m=0);return d?(m&&d.push(String.fromCharCode.apply(String,u.slice(0,m))),d.join("")):String.fromCharCode.apply(String,u.slice(0,m))},i.write=function(r,s,a){for(var c=a,d,u,m=0;m<r.length;++m)d=r.charCodeAt(m),d<128?s[a++]=d:d<2048?(s[a++]=d>>6|192,s[a++]=d&63|128):(d&64512)===55296&&((u=r.charCodeAt(m+1))&64512)===56320?(d=65536+((d&1023)<<10)+(u&1023),++m,s[a++]=d>>18|240,s[a++]=d>>12&63|128,s[a++]=d>>6&63|128,s[a++]=d&63|128):(s[a++]=d>>12|224,s[a++]=d>>6&63|128,s[a++]=d&63|128);return a-c}},{}],8:[function(e,t,n){"use strict";var i=n;i.build="minimal",i.Writer=e(16),i.BufferWriter=e(17),i.Reader=e(9),i.BufferReader=e(10),i.util=e(15),i.rpc=e(12),i.roots=e(11),i.configure=o;function o(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}o()},{10:10,11:11,12:12,15:15,16:16,17:17,9:9}],9:[function(e,t,n){"use strict";t.exports=c;var i=e(15),o,r=i.LongBits,s=i.utf8;function a(f,x){return RangeError("index out of range: "+f.pos+" + "+(x||1)+" > "+f.len)}function c(f){this.buf=f,this.pos=0,this.len=f.length}var d=typeof Uint8Array<"u"?function(x){if(x instanceof Uint8Array||Array.isArray(x))return new c(x);throw Error("illegal buffer")}:function(x){if(Array.isArray(x))return new c(x);throw Error("illegal buffer")},u=function(){return i.Buffer?function(_){return(c.create=function(V){return i.Buffer.isBuffer(V)?new o(V):d(V)})(_)}:d};c.create=u(),c.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,c.prototype.uint32=function(){var x=4294967295;return function(){if(x=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(x=(x|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return x;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return x}}(),c.prototype.int32=function(){return this.uint32()|0},c.prototype.sint32=function(){var x=this.uint32();return x>>>1^-(x&1)|0};function m(){var f=new r(0,0),x=0;if(this.len-this.pos>4){for(;x<4;++x)if(f.lo=(f.lo|(this.buf[this.pos]&127)<<x*7)>>>0,this.buf[this.pos++]<128)return f;if(f.lo=(f.lo|(this.buf[this.pos]&127)<<28)>>>0,f.hi=(f.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return f;x=0}else{for(;x<3;++x){if(this.pos>=this.len)throw a(this);if(f.lo=(f.lo|(this.buf[this.pos]&127)<<x*7)>>>0,this.buf[this.pos++]<128)return f}return f.lo=(f.lo|(this.buf[this.pos++]&127)<<x*7)>>>0,f}if(this.len-this.pos>4){for(;x<5;++x)if(f.hi=(f.hi|(this.buf[this.pos]&127)<<x*7+3)>>>0,this.buf[this.pos++]<128)return f}else for(;x<5;++x){if(this.pos>=this.len)throw a(this);if(f.hi=(f.hi|(this.buf[this.pos]&127)<<x*7+3)>>>0,this.buf[this.pos++]<128)return f}throw Error("invalid varint encoding")}c.prototype.bool=function(){return this.uint32()!==0};function p(f,x){return(f[x-4]|f[x-3]<<8|f[x-2]<<16|f[x-1]<<24)>>>0}c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)|0};function y(){if(this.pos+8>this.len)throw a(this,8);return new r(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var x=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,x},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var x=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,x},c.prototype.bytes=function(){var x=this.uint32(),_=this.pos,C=this.pos+x;if(C>this.len)throw a(this,x);if(this.pos+=x,Array.isArray(this.buf))return this.buf.slice(_,C);if(_===C){var V=i.Buffer;return V?V.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,_,C)},c.prototype.string=function(){var x=this.bytes();return s.read(x,0,x.length)},c.prototype.skip=function(x){if(typeof x=="number"){if(this.pos+x>this.len)throw a(this,x);this.pos+=x}else do if(this.pos>=this.len)throw a(this);while(this.buf[this.pos++]&128);return this},c.prototype.skipType=function(f){switch(f){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(f=this.uint32()&7)!==4;)this.skipType(f);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+f+" at offset "+this.pos)}return this},c._configure=function(f){o=f,c.create=u(),o._configure();var x=i.Long?"toLong":"toNumber";i.merge(c.prototype,{int64:function(){return m.call(this)[x](!1)},uint64:function(){return m.call(this)[x](!0)},sint64:function(){return m.call(this).zzDecode()[x](!1)},fixed64:function(){return y.call(this)[x](!0)},sfixed64:function(){return y.call(this)[x](!1)}})}},{15:15}],10:[function(e,t,n){"use strict";t.exports=r;var i=e(9);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(s){i.call(this,s)}r._configure=function(){o.Buffer&&(r.prototype._slice=o.Buffer.prototype.slice)},r.prototype.string=function(){var a=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+a,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+a,this.len))},r._configure()},{15:15,9:9}],11:[function(e,t,n){"use strict";t.exports={}},{}],12:[function(e,t,n){"use strict";var i=n;i.Service=e(13)},{13:13}],13:[function(e,t,n){"use strict";t.exports=o;var i=e(15);(o.prototype=Object.create(i.EventEmitter.prototype)).constructor=o;function o(r,s,a){if(typeof r!="function")throw TypeError("rpcImpl must be a function");i.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=!!s,this.responseDelimited=!!a}o.prototype.rpcCall=function r(s,a,c,d,u){if(!d)throw TypeError("request must be specified");var m=this;if(!u)return i.asPromise(r,m,s,a,c,d);if(!m.rpcImpl)return setTimeout(function(){u(Error("already ended"))},0),undefined;try{return m.rpcImpl(s,a[m.requestDelimited?"encodeDelimited":"encode"](d).finish(),function(y,f){if(y)return m.emit("error",y,s),u(y);if(f===null)return m.end(!0),undefined;if(!(f instanceof c))try{f=c[m.responseDelimited?"decodeDelimited":"decode"](f)}catch(x){return m.emit("error",x,s),u(x)}return m.emit("data",f,s),u(null,f)})}catch(p){return m.emit("error",p,s),setTimeout(function(){u(p)},0),undefined}},o.prototype.end=function(s){return this.rpcImpl&&(s||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{15:15}],14:[function(e,t,n){"use strict";t.exports=o;var i=e(15);function o(c,d){this.lo=c>>>0,this.hi=d>>>0}var r=o.zero=new o(0,0);r.toNumber=function(){return 0},r.zzEncode=r.zzDecode=function(){return this},r.length=function(){return 1};var s=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(d){if(d===0)return r;var u=d<0;u&&(d=-d);var m=d>>>0,p=(d-m)/4294967296>>>0;return u&&(p=~p>>>0,m=~m>>>0,++m>4294967295&&(m=0,++p>4294967295&&(p=0))),new o(m,p)},o.from=function(d){if(typeof d=="number")return o.fromNumber(d);if(i.isString(d))if(i.Long)d=i.Long.fromString(d);else return o.fromNumber(parseInt(d,10));return d.low||d.high?new o(d.low>>>0,d.high>>>0):r},o.prototype.toNumber=function(d){if(!d&&this.hi>>>31){var u=~this.lo+1>>>0,m=~this.hi>>>0;return u||(m=m+1>>>0),-(u+m*4294967296)}return this.lo+this.hi*4294967296},o.prototype.toLong=function(d){return i.Long?new i.Long(this.lo|0,this.hi|0,!!d):{low:this.lo|0,high:this.hi|0,unsigned:!!d}};var a=String.prototype.charCodeAt;o.fromHash=function(d){return d===s?r:new o((a.call(d,0)|a.call(d,1)<<8|a.call(d,2)<<16|a.call(d,3)<<24)>>>0,(a.call(d,4)|a.call(d,5)<<8|a.call(d,6)<<16|a.call(d,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var d=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^d)>>>0,this.lo=(this.lo<<1^d)>>>0,this},o.prototype.zzDecode=function(){var d=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^d)>>>0,this.hi=(this.hi>>>1^d)>>>0,this},o.prototype.length=function(){var d=this.lo,u=(this.lo>>>28|this.hi<<4)>>>0,m=this.hi>>>24;return m===0?u===0?d<16384?d<128?1:2:d<2097152?3:4:u<16384?u<128?5:6:u<2097152?7:8:m<128?9:10}},{15:15}],15:[function(e,t,n){"use strict";var i=n;i.asPromise=e(1),i.base64=e(2),i.EventEmitter=e(3),i.float=e(4),i.inquire=e(5),i.utf8=e(7),i.pool=e(6),i.LongBits=e(14),i.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),i.global=i.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||this,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a},i.isString=function(a){return typeof a=="string"||a instanceof String},i.isObject=function(a){return a&&typeof a=="object"},i.isset=i.isSet=function(a,c){var d=a[c];return d!=null&&a.hasOwnProperty(c)?typeof d!="object"||(Array.isArray(d)?d.length:Object.keys(d).length)>0:!1},i.Buffer=function(){try{var s=i.inquire("buffer").Buffer;return s.prototype.utf8Write?s:null}catch{return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(a){return typeof a=="number"?i.Buffer?i._Buffer_allocUnsafe(a):new i.Array(a):i.Buffer?i._Buffer_from(a):typeof Uint8Array>"u"?a:new Uint8Array(a)},i.Array=typeof Uint8Array<"u"?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(a){return a?i.LongBits.from(a).toHash():i.LongBits.zeroHash},i.longFromHash=function(a,c){var d=i.LongBits.fromHash(a);return i.Long?i.Long.fromBits(d.lo,d.hi,c):d.toNumber(!!c)};function o(s,a,c){for(var d=Object.keys(a),u=0;u<d.length;++u)(s[d[u]]===undefined||!c)&&(s[d[u]]=a[d[u]]);return s}i.merge=o,i.lcFirst=function(a){return a.charAt(0).toLowerCase()+a.substring(1)};function r(s){function a(c,d){if(!(this instanceof a))return new a(c,d);Object.defineProperty(this,"message",{get:function(){return c}}),Error.captureStackTrace?Error.captureStackTrace(this,a):Object.defineProperty(this,"stack",{value:new Error().stack||""}),d&&o(this,d)}return a.prototype=Object.create(Error.prototype,{constructor:{value:a,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return s},set:undefined,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),a}i.newError=r,i.ProtocolError=r("ProtocolError"),i.oneOfGetter=function(a){for(var c={},d=0;d<a.length;++d)c[a[d]]=1;return function(){for(var u=Object.keys(this),m=u.length-1;m>-1;--m)if(c[u[m]]===1&&this[u[m]]!==undefined&&this[u[m]]!==null)return u[m]}},i.oneOfSetter=function(a){return function(c){for(var d=0;d<a.length;++d)a[d]!==c&&delete this[a[d]]}},i.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},i._configure=function(){var s=i.Buffer;if(!s){i._Buffer_from=i._Buffer_allocUnsafe=null;return}i._Buffer_from=s.from!==Uint8Array.from&&s.from||function(c,d){return new s(c,d)},i._Buffer_allocUnsafe=s.allocUnsafe||function(c){return new s(c)}}},{1:1,14:14,2:2,3:3,4:4,5:5,6:6,7:7}],16:[function(e,t,n){"use strict";t.exports=m;var i=e(15),o,r=i.LongBits,s=i.base64,a=i.utf8;function c(L,Z,G){this.fn=L,this.len=Z,this.next=undefined,this.val=G}function d(){}function u(L){this.head=L.head,this.tail=L.tail,this.len=L.len,this.next=L.states}function m(){this.len=0,this.head=new c(d,0,0),this.tail=this.head,this.states=null}var p=function(){return i.Buffer?function(){return(m.create=function(){return new o})()}:function(){return new m}};m.create=p(),m.alloc=function(Z){return new i.Array(Z)},i.Array!==Array&&(m.alloc=i.pool(m.alloc,i.Array.prototype.subarray)),m.prototype._push=function(Z,G,I){return this.tail=this.tail.next=new c(Z,G,I),this.len+=G,this};function y(L,Z,G){Z[G]=L&255}function f(L,Z,G){for(;L>127;)Z[G++]=L&127|128,L>>>=7;Z[G]=L}function x(L,Z){this.len=L,this.next=undefined,this.val=Z}x.prototype=Object.create(c.prototype),x.prototype.fn=f,m.prototype.uint32=function(Z){return this.len+=(this.tail=this.tail.next=new x((Z=Z>>>0)<128?1:Z<16384?2:Z<2097152?3:Z<268435456?4:5,Z)).len,this},m.prototype.int32=function(Z){return Z<0?this._push(_,10,r.fromNumber(Z)):this.uint32(Z)},m.prototype.sint32=function(Z){return this.uint32((Z<<1^Z>>31)>>>0)};function _(L,Z,G){for(;L.hi;)Z[G++]=L.lo&127|128,L.lo=(L.lo>>>7|L.hi<<25)>>>0,L.hi>>>=7;for(;L.lo>127;)Z[G++]=L.lo&127|128,L.lo=L.lo>>>7;Z[G++]=L.lo}m.prototype.uint64=function(Z){var G=r.from(Z);return this._push(_,G.length(),G)},m.prototype.int64=m.prototype.uint64,m.prototype.sint64=function(Z){var G=r.from(Z).zzEncode();return this._push(_,G.length(),G)},m.prototype.bool=function(Z){return this._push(y,1,Z?1:0)};function C(L,Z,G){Z[G]=L&255,Z[G+1]=L>>>8&255,Z[G+2]=L>>>16&255,Z[G+3]=L>>>24}m.prototype.fixed32=function(Z){return this._push(C,4,Z>>>0)},m.prototype.sfixed32=m.prototype.fixed32,m.prototype.fixed64=function(Z){var G=r.from(Z);return this._push(C,4,G.lo)._push(C,4,G.hi)},m.prototype.sfixed64=m.prototype.fixed64,m.prototype.float=function(Z){return this._push(i.float.writeFloatLE,4,Z)},m.prototype.double=function(Z){return this._push(i.float.writeDoubleLE,8,Z)};var V=i.Array.prototype.set?function(Z,G,I){G.set(Z,I)}:function(Z,G,I){for(var P=0;P<Z.length;++P)G[I+P]=Z[P]};m.prototype.bytes=function(Z){var G=Z.length>>>0;if(!G)return this._push(y,1,0);if(i.isString(Z)){var I=m.alloc(G=s.length(Z));s.decode(Z,I,0),Z=I}return this.uint32(G)._push(V,G,Z)},m.prototype.string=function(Z){var G=a.length(Z);return G?this.uint32(G)._push(a.write,G,Z):this._push(y,1,0)},m.prototype.fork=function(){return this.states=new u(this),this.head=this.tail=new c(d,0,0),this.len=0,this},m.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 c(d,0,0),this.len=0),this},m.prototype.ldelim=function(){var Z=this.head,G=this.tail,I=this.len;return this.reset().uint32(I),I&&(this.tail.next=Z.next,this.tail=G,this.len+=I),this},m.prototype.finish=function(){for(var Z=this.head.next,G=this.constructor.alloc(this.len),I=0;Z;)Z.fn(Z.val,G,I),I+=Z.len,Z=Z.next;return G},m._configure=function(L){o=L,m.create=p(),o._configure()}},{15:15}],17:[function(e,t,n){"use strict";t.exports=r;var i=e(16);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(){i.call(this)}r._configure=function(){r.alloc=o._Buffer_allocUnsafe,r.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&o.Buffer.prototype.set.name==="set"?function(c,d,u){d.set(c,u)}:function(c,d,u){if(c.copy)c.copy(d,u,0,c.length);else for(var m=0;m<c.length;)d[u++]=c[m++]}},r.prototype.bytes=function(c){o.isString(c)&&(c=o._Buffer_from(c,"base64"));var d=c.length>>>0;return this.uint32(d),d&&this._push(r.writeBytesBuffer,d,c),this};function s(a,c,d){a.length<40?o.utf8.write(a,c,d):c.utf8Write?c.utf8Write(a,d):c.write(a,d)}r.prototype.string=function(c){var d=o.Buffer.byteLength(c);return this.uint32(d),d&&this._push(s,d,c),this},r._configure()},{15:15,16:16}]},{},[8])})()});var X_e=Gc((Pzi,sB)=>{var vzi=T(S());/* 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 */(function(){var e=function(){var o={};o.defaultNoDataValue=-34027999387901484e22,o.decode=function(u,m){m=m||{};var p=m.encodedMaskData||m.encodedMaskData===null,y=c(u,m.inputOffset||0,p),f=m.noDataValue!==null?m.noDataValue:o.defaultNoDataValue,x=r(y,m.pixelType||Float32Array,m.encodedMaskData,f,m.returnMask),_={width:y.width,height:y.height,pixelData:x.resultPixels,minValue:x.minValue,maxValue:y.pixels.maxValue,noDataValue:f};return x.resultMask&&(_.maskData=x.resultMask),m.returnEncodedMask&&y.mask&&(_.encodedMaskData=y.mask.bitset?y.mask.bitset:null),m.returnFileInfo&&(_.fileInfo=s(y),m.computeUsedBitDepths&&(_.fileInfo.bitDepths=a(y))),_};var r=function(u,m,p,y,f){var x=0,_=u.pixels.numBlocksX,C=u.pixels.numBlocksY,V=Math.floor(u.width/_),L=Math.floor(u.height/C),Z=2*u.maxZError,G=Number.MAX_VALUE,I;p=p||(u.mask?u.mask.bitset:null);var P,v;P=new m(u.width*u.height),f&&p&&(v=new Uint8Array(u.width*u.height));for(var F=new Float32Array(V*L),M,b,R=0;R<=C;R++){var E=R!==C?L:u.height%C;if(E!==0)for(var X=0;X<=_;X++){var w=X!==_?V:u.width%_;if(w!==0){var N=R*u.width*L+X*V,D=u.width-w,k=u.pixels.blocks[x],Y,U,J;k.encoding<2?(k.encoding===0?Y=k.rawData:(d(k.stuffedData,k.bitsPerPixel,k.numValidPixels,k.offset,Z,F,u.pixels.maxValue),Y=F),U=0):k.encoding===2?J=0:J=k.offset;var K;if(p)for(b=0;b<E;b++){for(N&7&&(K=p[N>>3],K<<=N&7),M=0;M<w;M++)N&7||(K=p[N>>3]),K&128?(v&&(v[N]=1),I=k.encoding<2?Y[U++]:J,G=G>I?I:G,P[N++]=I):(v&&(v[N]=0),P[N++]=y),K<<=1;N+=D}else if(k.encoding<2)for(b=0;b<E;b++){for(M=0;M<w;M++)I=Y[U++],G=G>I?I:G,P[N++]=I;N+=D}else for(G=G>J?J:G,b=0;b<E;b++){for(M=0;M<w;M++)P[N++]=J;N+=D}if(k.encoding===1&&U!==k.numValidPixels)throw"Block and Mask do not match";x++}}}return{resultPixels:P,resultMask:v,minValue:G}},s=function(u){return{fileIdentifierString:u.fileIdentifierString,fileVersion:u.fileVersion,imageType:u.imageType,height:u.height,width:u.width,maxZError:u.maxZError,eofOffset:u.eofOffset,mask:u.mask?{numBlocksX:u.mask.numBlocksX,numBlocksY:u.mask.numBlocksY,numBytes:u.mask.numBytes,maxValue:u.mask.maxValue}:null,pixels:{numBlocksX:u.pixels.numBlocksX,numBlocksY:u.pixels.numBlocksY,numBytes:u.pixels.numBytes,maxValue:u.pixels.maxValue,noDataValue:u.noDataValue}}},a=function(u){for(var m=u.pixels.numBlocksX*u.pixels.numBlocksY,p={},y=0;y<m;y++){var f=u.pixels.blocks[y];f.encoding===0?p.float32=!0:f.encoding===1?p[f.bitsPerPixel]=!0:p[0]=!0}return Object.keys(p)},c=function(u,m,p){var y={},f=new Uint8Array(u,m,10);if(y.fileIdentifierString=String.fromCharCode.apply(null,f),y.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+y.fileIdentifierString;m+=10;var x=new DataView(u,m,24);if(y.fileVersion=x.getInt32(0,!0),y.imageType=x.getInt32(4,!0),y.height=x.getUint32(8,!0),y.width=x.getUint32(12,!0),y.maxZError=x.getFloat64(16,!0),m+=24,!p)if(x=new DataView(u,m,16),y.mask={},y.mask.numBlocksY=x.getUint32(0,!0),y.mask.numBlocksX=x.getUint32(4,!0),y.mask.numBytes=x.getUint32(8,!0),y.mask.maxValue=x.getFloat32(12,!0),m+=16,y.mask.numBytes>0){var _=new Uint8Array(Math.ceil(y.width*y.height/8));x=new DataView(u,m,y.mask.numBytes);var C=x.getInt16(0,!0),V=2,L=0;do{if(C>0)for(;C--;)_[L++]=x.getUint8(V++);else{var Z=x.getUint8(V++);for(C=-C;C--;)_[L++]=Z}C=x.getInt16(V,!0),V+=2}while(V<y.mask.numBytes);if(C!==-32768||L<_.length)throw"Unexpected end of mask RLE encoding";y.mask.bitset=_,m+=y.mask.numBytes}else y.mask.numBytes|y.mask.numBlocksY|y.mask.maxValue||(y.mask.bitset=new Uint8Array(Math.ceil(y.width*y.height/8)));x=new DataView(u,m,16),y.pixels={},y.pixels.numBlocksY=x.getUint32(0,!0),y.pixels.numBlocksX=x.getUint32(4,!0),y.pixels.numBytes=x.getUint32(8,!0),y.pixels.maxValue=x.getFloat32(12,!0),m+=16;var G=y.pixels.numBlocksX,I=y.pixels.numBlocksY,P=G+(y.width%G>0?1:0),v=I+(y.height%I>0?1:0);y.pixels.blocks=new Array(P*v);for(var F=0,M=0;M<v;M++)for(var b=0;b<P;b++){var R=0,E=u.byteLength-m;x=new DataView(u,m,Math.min(10,E));var X={};y.pixels.blocks[F++]=X;var w=x.getUint8(0);if(R++,X.encoding=w&63,X.encoding>3)throw"Invalid block encoding ("+X.encoding+")";if(X.encoding===2){m++;continue}if(w!==0&&w!==2){if(w>>=6,X.offsetType=w,w===2)X.offset=x.getInt8(1),R++;else if(w===1)X.offset=x.getInt16(1,!0),R+=2;else if(w===0)X.offset=x.getFloat32(1,!0),R+=4;else throw"Invalid block offset type";if(X.encoding===1)if(w=x.getUint8(R),R++,X.bitsPerPixel=w&63,w>>=6,X.numValidPixelsType=w,w===2)X.numValidPixels=x.getUint8(R),R++;else if(w===1)X.numValidPixels=x.getUint16(R,!0),R+=2;else if(w===0)X.numValidPixels=x.getUint32(R,!0),R+=4;else throw"Invalid valid pixel count type"}if(m+=R,X.encoding!==3){var N,D;if(X.encoding===0){var k=(y.pixels.numBytes-1)/4;if(k!==Math.floor(k))throw"uncompressed block has invalid length";N=new ArrayBuffer(k*4),D=new Uint8Array(N),D.set(new Uint8Array(u,m,k*4));var Y=new Float32Array(N);X.rawData=Y,m+=k*4}else if(X.encoding===1){var U=Math.ceil(X.numValidPixels*X.bitsPerPixel/8),J=Math.ceil(U/4);N=new ArrayBuffer(J*4),D=new Uint8Array(N),D.set(new Uint8Array(u,m,U)),X.stuffedData=new Uint32Array(N),m+=U}}}return y.eofOffset=m,y},d=function(u,m,p,y,f,x,_){var C=(1<<m)-1,V=0,L,Z=0,G,I,P=Math.ceil((_-y)/f),v=u.length*4-Math.ceil(m*p/8);for(u[u.length-1]<<=8*v,L=0;L<p;L++){if(Z===0&&(I=u[V++],Z=32),Z>=m)G=I>>>Z-m&C,Z-=m;else{var F=m-Z;G=(I&C)<<F&C,I=u[V++],Z=32-F,G+=I>>>Z}x[L]=G<P?y+G*f:_}return x};return o}(),t=function(){"use strict";var o={unstuff:function(c,d,u,m,p,y,f,x){var _=(1<<u)-1,C=0,V,L=0,Z,G,I,P,v=c.length*4-Math.ceil(u*m/8);if(c[c.length-1]<<=8*v,p)for(V=0;V<m;V++)L===0&&(G=c[C++],L=32),L>=u?(Z=G>>>L-u&_,L-=u):(I=u-L,Z=(G&_)<<I&_,G=c[C++],L=32-I,Z+=G>>>L),d[V]=p[Z];else for(P=Math.ceil((x-y)/f),V=0;V<m;V++)L===0&&(G=c[C++],L=32),L>=u?(Z=G>>>L-u&_,L-=u):(I=u-L,Z=(G&_)<<I&_,G=c[C++],L=32-I,Z+=G>>>L),d[V]=Z<P?y+Z*f:x},unstuffLUT:function(c,d,u,m,p,y){var f=(1<<d)-1,x=0,_=0,C=0,V=0,L=0,Z,G=[],I=c.length*4-Math.ceil(d*u/8);c[c.length-1]<<=8*I;var P=Math.ceil((y-m)/p);for(_=0;_<u;_++)V===0&&(Z=c[x++],V=32),V>=d?(L=Z>>>V-d&f,V-=d):(C=d-V,L=(Z&f)<<C&f,Z=c[x++],V=32-C,L+=Z>>>V),G[_]=L<P?m+L*p:y;return G.unshift(m),G},unstuff2:function(c,d,u,m,p,y,f,x){var _=(1<<u)-1,C=0,V,L=0,Z=0,G,I,P;if(p)for(V=0;V<m;V++)L===0&&(I=c[C++],L=32,Z=0),L>=u?(G=I>>>Z&_,L-=u,Z+=u):(P=u-L,G=I>>>Z&_,I=c[C++],L=32-P,G|=(I&(1<<P)-1)<<u-P,Z=P),d[V]=p[G];else{var v=Math.ceil((x-y)/f);for(V=0;V<m;V++)L===0&&(I=c[C++],L=32,Z=0),L>=u?(G=I>>>Z&_,L-=u,Z+=u):(P=u-L,G=I>>>Z&_,I=c[C++],L=32-P,G|=(I&(1<<P)-1)<<u-P,Z=P),d[V]=G<v?y+G*f:x}return d},unstuffLUT2:function(c,d,u,m,p,y){var f=(1<<d)-1,x=0,_=0,C=0,V=0,L=0,Z=0,G,I=[],P=Math.ceil((y-m)/p);for(_=0;_<u;_++)V===0&&(G=c[x++],V=32,Z=0),V>=d?(L=G>>>Z&f,V-=d,Z+=d):(C=d-V,L=G>>>Z&f,G=c[x++],V=32-C,L|=(G&(1<<C)-1)<<d-C,Z=C),I[_]=L<P?m+L*p:y;return I.unshift(m),I},originalUnstuff:function(c,d,u,m){var p=(1<<u)-1,y=0,f,x=0,_,C,V,L=c.length*4-Math.ceil(u*m/8);for(c[c.length-1]<<=8*L,f=0;f<m;f++)x===0&&(C=c[y++],x=32),x>=u?(_=C>>>x-u&p,x-=u):(V=u-x,_=(C&p)<<V&p,C=c[y++],x=32-V,_+=C>>>x),d[f]=_;return d},originalUnstuff2:function(c,d,u,m){var p=(1<<u)-1,y=0,f,x=0,_=0,C,V,L;for(f=0;f<m;f++)x===0&&(V=c[y++],x=32,_=0),x>=u?(C=V>>>_&p,x-=u,_+=u):(L=u-x,C=V>>>_&p,V=c[y++],x=32-L,C|=(V&(1<<L)-1)<<u-L,_=L),d[f]=C;return d}},r={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(c){for(var d=65535,u=65535,m=c.length,p=Math.floor(m/2),y=0;p;){var f=p>=359?359:p;p-=f;do d+=c[y++]<<8,u+=d+=c[y++];while(--f);d=(d&65535)+(d>>>16),u=(u&65535)+(u>>>16)}return m&1&&(u+=d+=c[y]<<8),d=(d&65535)+(d>>>16),u=(u&65535)+(u>>>16),(u<<16|d)>>>0},readHeaderInfo:function(c,d){var u=d.ptr,m=new Uint8Array(c,u,6),p={};if(p.fileIdentifierString=String.fromCharCode.apply(null,m),p.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+p.fileIdentifierString;u+=6;var y=new DataView(c,u,8),f=y.getInt32(0,!0);p.fileVersion=f,u+=4,f>=3&&(p.checksum=y.getUint32(4,!0),u+=4),y=new DataView(c,u,12),p.height=y.getUint32(0,!0),p.width=y.getUint32(4,!0),u+=8,f>=4?(p.numDims=y.getUint32(8,!0),u+=4):p.numDims=1,y=new DataView(c,u,40),p.numValidPixel=y.getUint32(0,!0),p.microBlockSize=y.getInt32(4,!0),p.blobSize=y.getInt32(8,!0),p.imageType=y.getInt32(12,!0),p.maxZError=y.getFloat64(16,!0),p.zMin=y.getFloat64(24,!0),p.zMax=y.getFloat64(32,!0),u+=40,d.headerInfo=p,d.ptr=u;var x,_;if(f>=3&&(_=f>=4?52:48,x=this.computeChecksumFletcher32(new Uint8Array(c,u-_,p.blobSize-14)),x!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(c,d){var u=d.headerInfo,m=this.getDataTypeArray(u.imageType),p=u.numDims*this.getDataTypeSize(u.imageType),y=this.readSubArray(c,d.ptr,m,p),f=this.readSubArray(c,d.ptr+p,m,p);d.ptr+=2*p;var x,_=!0;for(x=0;x<u.numDims;x++)if(y[x]!==f[x]){_=!1;break}return u.minValues=y,u.maxValues=f,_},readSubArray:function(c,d,u,m){var p;if(u===Uint8Array)p=new Uint8Array(c,d,m);else{var y=new ArrayBuffer(m),f=new Uint8Array(y);f.set(new Uint8Array(c,d,m)),p=new u(y)}return p},readMask:function(c,d){var u=d.ptr,m=d.headerInfo,p=m.width*m.height,y=m.numValidPixel,f=new DataView(c,u,4),x={};if(x.numBytes=f.getUint32(0,!0),u+=4,(y===0||p===y)&&x.numBytes!==0)throw"invalid mask";var _,C;if(y===0)_=new Uint8Array(Math.ceil(p/8)),x.bitset=_,C=new Uint8Array(p),d.pixels.resultMask=C,u+=x.numBytes;else if(x.numBytes>0){_=new Uint8Array(Math.ceil(p/8)),f=new DataView(c,u,x.numBytes);var V=f.getInt16(0,!0),L=2,Z=0,G=0;do{if(V>0)for(;V--;)_[Z++]=f.getUint8(L++);else for(G=f.getUint8(L++),V=-V;V--;)_[Z++]=G;V=f.getInt16(L,!0),L+=2}while(L<x.numBytes);if(V!==-32768||Z<_.length)throw"Unexpected end of mask RLE encoding";C=new Uint8Array(p);var I=0,P=0;for(P=0;P<p;P++)P&7?(I=_[P>>3],I<<=P&7):I=_[P>>3],I&128&&(C[P]=1);d.pixels.resultMask=C,x.bitset=_,u+=x.numBytes}return d.ptr=u,d.mask=x,!0},readDataOneSweep:function(c,d,u){var m=d.ptr,p=d.headerInfo,y=p.numDims,f=p.width*p.height,x=p.imageType,_=p.numValidPixel*r.getDataTypeSize(x)*y,C,V=d.pixels.resultMask;if(u===Uint8Array)C=new Uint8Array(c,m,_);else{var L=new ArrayBuffer(_),Z=new Uint8Array(L);Z.set(new Uint8Array(c,m,_)),C=new u(L)}if(C.length===f*y)d.pixels.resultPixels=C;else{d.pixels.resultPixels=new u(f*y);var G=0,I=0,P=0,v=0;if(y>1)for(P=0;P<y;P++)for(v=P*f,I=0;I<f;I++)V[I]&&(d.pixels.resultPixels[v+I]=C[G++]);else for(I=0;I<f;I++)V[I]&&(d.pixels.resultPixels[I]=C[G++])}return m+=_,d.ptr=m,!0},readHuffmanTree:function(c,d){var u=this.HUFFMAN_LUT_BITS_MAX,m=new DataView(c,d.ptr,16);d.ptr+=16;var p=m.getInt32(0,!0);if(p<2)throw"unsupported Huffman version";var y=m.getInt32(4,!0),f=m.getInt32(8,!0),x=m.getInt32(12,!0);if(f>=x)return!1;var _=new Uint32Array(x-f);r.decodeBits(c,d,_);var C=[],V,L,Z,G;for(V=f;V<x;V++)L=V-(V<y?0:y),C[L]={first:_[V-f],second:null};var I=c.byteLength-d.ptr,P=Math.ceil(I/4),v=new ArrayBuffer(P*4),F=new Uint8Array(v);F.set(new Uint8Array(c,d.ptr,I));var M=new Uint32Array(v),b=0,R,E=0;for(R=M[0],V=f;V<x;V++)L=V-(V<y?0:y),G=C[L].first,G>0&&(C[L].second=R<<b>>>32-G,32-b>=G?(b+=G,b===32&&(b=0,E++,R=M[E])):(b+=G-32,E++,R=M[E],C[L].second|=R>>>32-b));var X=0,w=0,N=new s;for(V=0;V<C.length;V++)C[V]!==void 0&&(X=Math.max(X,C[V].first));X>=u?w=u:w=X,X>=30&&console.log("WARning, large NUM LUT BITS IS "+X);var D=[],k,Y,U,J,K,ee;for(V=f;V<x;V++)if(L=V-(V<y?0:y),G=C[L].first,G>0)if(k=[G,L],G<=w)for(Y=C[L].second<<w-G,U=1<<w-G,Z=0;Z<U;Z++)D[Y|Z]=k;else for(Y=C[L].second,ee=N,J=G-1;J>=0;J--)K=Y>>>J&1,K?(ee.right||(ee.right=new s),ee=ee.right):(ee.left||(ee.left=new s),ee=ee.left),J===0&&!ee.val&&(ee.val=k[1]);return{decodeLut:D,numBitsLUTQick:w,numBitsLUT:X,tree:N,stuffedData:M,srcPtr:E,bitPos:b}},readHuffman:function(c,d,u){var m=d.headerInfo,p=m.numDims,y=d.headerInfo.height,f=d.headerInfo.width,x=f*y,_=this.readHuffmanTree(c,d),C=_.decodeLut,V=_.tree,L=_.stuffedData,Z=_.srcPtr,G=_.bitPos,I=_.numBitsLUTQick,P=_.numBitsLUT,v=d.headerInfo.imageType===0?128:0,F,M,b,R=d.pixels.resultMask,E,X,w,N,D,k,Y,U=0;G>0&&(Z++,G=0);var J=L[Z],K=d.encodeMode===1,ee=new u(x*p),H=ee,j;for(j=0;j<m.numDims;j++){if(p>1&&(H=new u(ee.buffer,x*j,x),U=0),d.headerInfo.numValidPixel===f*y)for(k=0,N=0;N<y;N++)for(D=0;D<f;D++,k++){if(M=0,E=J<<G>>>32-I,X=E,32-G<I&&(E|=L[Z+1]>>>64-G-I,X=E),C[X])M=C[X][1],G+=C[X][0];else for(E=J<<G>>>32-P,X=E,32-G<P&&(E|=L[Z+1]>>>64-G-P,X=E),F=V,Y=0;Y<P;Y++)if(w=E>>>P-Y-1&1,F=w?F.right:F.left,!(F.left||F.right)){M=F.val,G=G+Y+1;break}G>=32&&(G-=32,Z++,J=L[Z]),b=M-v,K?(D>0?b+=U:N>0?b+=H[k-f]:b+=U,b&=255,H[k]=b,U=b):H[k]=b}else for(k=0,N=0;N<y;N++)for(D=0;D<f;D++,k++)if(R[k]){if(M=0,E=J<<G>>>32-I,X=E,32-G<I&&(E|=L[Z+1]>>>64-G-I,X=E),C[X])M=C[X][1],G+=C[X][0];else for(E=J<<G>>>32-P,X=E,32-G<P&&(E|=L[Z+1]>>>64-G-P,X=E),F=V,Y=0;Y<P;Y++)if(w=E>>>P-Y-1&1,F=w?F.right:F.left,!(F.left||F.right)){M=F.val,G=G+Y+1;break}G>=32&&(G-=32,Z++,J=L[Z]),b=M-v,K?(D>0&&R[k-1]?b+=U:N>0&&R[k-f]?b+=H[k-f]:b+=U,b&=255,H[k]=b,U=b):H[k]=b}d.ptr=d.ptr+(Z+1)*4+(G>0?4:0)}d.pixels.resultPixels=ee},decodeBits:function(c,d,u,m,p){{var y=d.headerInfo,f=y.fileVersion,x=0,_=new DataView(c,d.ptr,5),C=_.getUint8(0);x++;var V=C>>6,L=V===0?4:3-V,Z=(C&32)>0,G=C&31,I=0;if(L===1)I=_.getUint8(x),x++;else if(L===2)I=_.getUint16(x,!0),x+=2;else if(L===4)I=_.getUint32(x,!0),x+=4;else throw"Invalid valid pixel count type";var P=2*y.maxZError,v,F,M,b,R,E,X,w,N,D,k=y.numDims>1?y.maxValues[p]:y.zMax;if(Z){for(d.counter.lut++,w=_.getUint8(x),N=G,x++,b=Math.ceil((w-1)*G/8),R=Math.ceil(b/4),F=new ArrayBuffer(R*4),M=new Uint8Array(F),d.ptr+=x,M.set(new Uint8Array(c,d.ptr,b)),X=new Uint32Array(F),d.ptr+=b,D=0;w-1>>>D;)D++;b=Math.ceil(I*D/8),R=Math.ceil(b/4),F=new ArrayBuffer(R*4),M=new Uint8Array(F),M.set(new Uint8Array(c,d.ptr,b)),v=new Uint32Array(F),d.ptr+=b,f>=3?E=o.unstuffLUT2(X,G,w-1,m,P,k):E=o.unstuffLUT(X,G,w-1,m,P,k),f>=3?o.unstuff2(v,u,D,I,E):o.unstuff(v,u,D,I,E)}else d.counter.bitstuffer++,D=G,d.ptr+=x,D>0&&(b=Math.ceil(I*D/8),R=Math.ceil(b/4),F=new ArrayBuffer(R*4),M=new Uint8Array(F),M.set(new Uint8Array(c,d.ptr,b)),v=new Uint32Array(F),d.ptr+=b,f>=3?m==null?o.originalUnstuff2(v,u,D,I):o.unstuff2(v,u,D,I,!1,m,P,k):m==null?o.originalUnstuff(v,u,D,I):o.unstuff(v,u,D,I,!1,m,P,k))}},readTiles:function(c,d,u){var m=d.headerInfo,p=m.width,y=m.height,f=m.microBlockSize,x=m.imageType,_=r.getDataTypeSize(x),C=Math.ceil(p/f),V=Math.ceil(y/f);d.pixels.numBlocksY=V,d.pixels.numBlocksX=C,d.pixels.ptr=0;var L=0,Z=0,G=0,I=0,P=0,v=0,F=0,M=0,b=0,R=0,E=0,X=0,w=0,N=0,D=0,k=0,Y,U,J,K,ee,H,j=new u(f*f),$=y%f||f,pe=p%f||f,ge,ae,be=m.numDims,_e,Ze=d.pixels.resultMask,Le=d.pixels.resultPixels;for(G=0;G<V;G++)for(P=G!==V-1?f:$,I=0;I<C;I++)for(v=I!==C-1?f:pe,E=G*p*f+I*f,X=p-v,_e=0;_e<be;_e++){if(be>1&&(Le=new u(d.pixels.resultPixels.buffer,p*y*_e*_,p*y)),F=c.byteLength-d.ptr,Y=new DataView(c,d.ptr,Math.min(10,F)),U={},k=0,M=Y.getUint8(0),k++,b=M>>6&255,R=M>>2&15,R!==(I*f>>3&15))throw"integrity issue";if(H=M&3,H>3)throw d.ptr+=k,"Invalid block encoding ("+H+")";if(H===2){d.counter.constant++,d.ptr+=k;continue}else if(H===0){if(d.counter.uncompressed++,d.ptr+=k,w=P*v*_,N=c.byteLength-d.ptr,w=w<N?w:N,J=new ArrayBuffer(w%_===0?w:w+_-w%_),K=new Uint8Array(J),K.set(new Uint8Array(c,d.ptr,w)),ee=new u(J),D=0,Ze)for(L=0;L<P;L++){for(Z=0;Z<v;Z++)Ze[E]&&(Le[E]=ee[D++]),E++;E+=X}else for(L=0;L<P;L++){for(Z=0;Z<v;Z++)Le[E++]=ee[D++];E+=X}d.ptr+=D*_}else if(ge=r.getDataTypeUsed(x,b),ae=r.getOnePixel(U,k,ge,Y),k+=r.getDataTypeSize(ge),H===3)if(d.ptr+=k,d.counter.constantoffset++,Ze)for(L=0;L<P;L++){for(Z=0;Z<v;Z++)Ze[E]&&(Le[E]=ae),E++;E+=X}else for(L=0;L<P;L++){for(Z=0;Z<v;Z++)Le[E++]=ae;E+=X}else if(d.ptr+=k,r.decodeBits(c,d,j,ae,_e),k=0,Ze)for(L=0;L<P;L++){for(Z=0;Z<v;Z++)Ze[E]&&(Le[E]=j[k++]),E++;E+=X}else for(L=0;L<P;L++){for(Z=0;Z<v;Z++)Le[E++]=j[k++];E+=X}}},formatFileInfo:function(c){return{fileIdentifierString:c.headerInfo.fileIdentifierString,fileVersion:c.headerInfo.fileVersion,imageType:c.headerInfo.imageType,height:c.headerInfo.height,width:c.headerInfo.width,numValidPixel:c.headerInfo.numValidPixel,microBlockSize:c.headerInfo.microBlockSize,blobSize:c.headerInfo.blobSize,maxZError:c.headerInfo.maxZError,pixelType:r.getPixelType(c.headerInfo.imageType),eofOffset:c.eofOffset,mask:c.mask?{numBytes:c.mask.numBytes}:null,pixels:{numBlocksX:c.pixels.numBlocksX,numBlocksY:c.pixels.numBlocksY,maxValue:c.headerInfo.zMax,minValue:c.headerInfo.zMin,noDataValue:c.noDataValue}}},constructConstantSurface:function(c){var d=c.headerInfo.zMax,u=c.headerInfo.numDims,m=c.headerInfo.height*c.headerInfo.width,p=m*u,y=0,f=0,x=0,_=c.pixels.resultMask;if(_)if(u>1)for(y=0;y<u;y++)for(x=y*m,f=0;f<m;f++)_[f]&&(c.pixels.resultPixels[x+f]=d);else for(f=0;f<m;f++)_[f]&&(c.pixels.resultPixels[f]=d);else if(c.pixels.resultPixels.fill)c.pixels.resultPixels.fill(d);else for(f=0;f<p;f++)c.pixels.resultPixels[f]=d},getDataTypeArray:function(c){var d;switch(c){case 0:d=Int8Array;break;case 1:d=Uint8Array;break;case 2:d=Int16Array;break;case 3:d=Uint16Array;break;case 4:d=Int32Array;break;case 5:d=Uint32Array;break;case 6:d=Float32Array;break;case 7:d=Float64Array;break;default:d=Float32Array}return d},getPixelType:function(c){var d;switch(c){case 0:d="S8";break;case 1:d="U8";break;case 2:d="S16";break;case 3:d="U16";break;case 4:d="S32";break;case 5:d="U32";break;case 6:d="F32";break;case 7:d="F64";break;default:d="F32"}return d},isValidPixelValue:function(c,d){if(d==null)return!1;var u;switch(c){case 0:u=d>=-128&&d<=127;break;case 1:u=d>=0&&d<=255;break;case 2:u=d>=-32768&&d<=32767;break;case 3:u=d>=0&&d<=65536;break;case 4:u=d>=-2147483648&&d<=2147483647;break;case 5:u=d>=0&&d<=4294967296;break;case 6:u=d>=-34027999387901484e22&&d<=34027999387901484e22;break;case 7:u=d>=5e-324&&d<=17976931348623157e292;break;default:u=!1}return u},getDataTypeSize:function(c){var d=0;switch(c){case 0:case 1:d=1;break;case 2:case 3:d=2;break;case 4:case 5:case 6:d=4;break;case 7:d=8;break;default:d=c}return d},getDataTypeUsed:function(c,d){var u=c;switch(c){case 2:case 4:u=c-d;break;case 3:case 5:u=c-2*d;break;case 6:d===0?u=c:d===1?u=2:u=1;break;case 7:d===0?u=c:u=c-2*d+1;break;default:u=c;break}return u},getOnePixel:function(c,d,u,m){var p=0;switch(u){case 0:p=m.getInt8(d);break;case 1:p=m.getUint8(d);break;case 2:p=m.getInt16(d,!0);break;case 3:p=m.getUint16(d,!0);break;case 4:p=m.getInt32(d,!0);break;case 5:p=m.getUInt32(d,!0);break;case 6:p=m.getFloat32(d,!0);break;case 7:p=m.getFloat64(d,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},s=function(c,d,u){this.val=c,this.left=d,this.right=u},a={decode:function(c,d){d=d||{};var u=d.noDataValue,m=0,p={};if(p.ptr=d.inputOffset||0,p.pixels={},!!r.readHeaderInfo(c,p)){var y=p.headerInfo,f=y.fileVersion,x=r.getDataTypeArray(y.imageType);r.readMask(c,p),y.numValidPixel!==y.width*y.height&&!p.pixels.resultMask&&(p.pixels.resultMask=d.maskData);var _=y.width*y.height;if(p.pixels.resultPixels=new x(_*y.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},y.numValidPixel!==0)if(y.zMax===y.zMin)r.constructConstantSurface(p);else if(f>=4&&r.checkMinMaxRanges(c,p))r.constructConstantSurface(p);else{var C=new DataView(c,p.ptr,2),V=C.getUint8(0);if(p.ptr++,V)r.readDataOneSweep(c,p,x);else if(f>1&&y.imageType<=1&&Math.abs(y.maxZError-.5)<1e-5){var L=C.getUint8(1);if(p.ptr++,p.encodeMode=L,L>2||f<4&&L>1)throw"Invalid Huffman flag "+L;L?r.readHuffman(c,p,x):r.readTiles(c,p,x)}else r.readTiles(c,p,x)}p.eofOffset=p.ptr;var Z;d.inputOffset?(Z=p.headerInfo.blobSize+d.inputOffset-p.ptr,Math.abs(Z)>=1&&(p.eofOffset=d.inputOffset+p.headerInfo.blobSize)):(Z=p.headerInfo.blobSize-p.ptr,Math.abs(Z)>=1&&(p.eofOffset=p.headerInfo.blobSize));var G={width:y.width,height:y.height,pixelData:p.pixels.resultPixels,minValue:y.zMin,maxValue:y.zMax,validPixelCount:y.numValidPixel,dimCount:y.numDims,dimStats:{minValues:y.minValues,maxValues:y.maxValues},maskData:p.pixels.resultMask};if(p.pixels.resultMask&&r.isValidPixelValue(y.imageType,u)){var I=p.pixels.resultMask;for(m=0;m<_;m++)I[m]||(G.pixelData[m]=u);G.noDataValue=u}return p.noDataValue=u,d.returnFileInfo&&(G.fileInfo=r.formatFileInfo(p)),G}},getBandCount:function(c){var d=0,u=0,m={};for(m.ptr=0,m.pixels={};u<c.byteLength-58;)r.readHeaderInfo(c,m),u+=m.headerInfo.blobSize,d++,m.ptr=u;return d}};return a}(),n=function(){var o=new ArrayBuffer(4),r=new Uint8Array(o),s=new Uint32Array(o);return s[0]=1,r[0]===1}(),i={decode:function(o,r){if(!n)throw"Big endian system is not supported.";r=r||{};var s=r.inputOffset||0,a=new Uint8Array(o,s,10),c=String.fromCharCode.apply(null,a),d,u;if(c.trim()==="CntZImage")d=e,u=1;else if(c.substring(0,5)==="Lerc2")d=t,u=2;else throw"Unexpected file identifier string: "+c;for(var m=0,p=o.byteLength-10,y,f=[],x,_,C={width:0,height:0,pixels:[],pixelType:r.pixelType,mask:null,statistics:[]};s<p;){var V=d.decode(o,{inputOffset:s,encodedMaskData:y,maskData:_,returnMask:m===0,returnEncodedMask:m===0,returnFileInfo:!0,pixelType:r.pixelType||null,noDataValue:r.noDataValue||null});s=V.fileInfo.eofOffset,m===0&&(y=V.encodedMaskData,_=V.maskData,C.width=V.width,C.height=V.height,C.dimCount=V.dimCount||1,C.pixelType=V.pixelType||V.fileInfo.pixelType,C.mask=V.maskData),u>1&&V.fileInfo.mask&&V.fileInfo.mask.numBytes>0&&f.push(V.maskData),m++,C.pixels.push(V.pixelData),C.statistics.push({minValue:V.minValue,maxValue:V.maxValue,noDataValue:V.noDataValue,dimStats:V.dimStats})}var L,Z,G;if(u>1&&f.length>1){for(G=C.width*C.height,C.bandMasks=f,_=new Uint8Array(G),_.set(f[0]),L=1;L<f.length;L++)for(x=f[L],Z=0;Z<G;Z++)_[Z]=_[Z]&x[Z];C.maskData=_}return C}};typeof define=="function"&&define.amd?define([],function(){return i}):typeof sB<"u"&&sB.exports?sB.exports=i:this.Lerc=i})()});var PTe=Gc((R_o,WTe)=>{var Z_o=T(S());WTe.exports={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAA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CAAAOHAAAAoygk4wqi7DRhAsPQKEhKwKAKAAAwBimFFPKMCYhpBAaxiSEFEImJaXSUqogpFJSKRWEVEoqJaOUUmopVRBSKamUCkIqJZVSAADYgQMA2IGFUGjISgAgDwCAMEYpxhhzTiKkFGPOOScRUoox55yTSjHmnHPOSSkZc8w556SUzjnnnHNSSuacc845KaVzzjnnnJRSSuecc05KKSWEzkEnpZTSOeecEwAAVOAAABBgo8jmBCNBhYasBABSAQAMjmNZmuZ5omialiRpmud5niiapiZJmuZ5nieKqsnzPE8URdE0VZXneZ4oiqJpqirXFUXTNE1VVV2yLIqmaZqq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCiDHnJKTUWmzFc85BKCGV1mIsnnMOQikpxVZjUSmEUlJKLbZYi0qho5JSSq3VWIwxqaTWWoutxmKMSSm01FqLMRYjbE2ptdhqq7EYY2sqLbQYY4zFCF9kbC2m2moNxggjWywt1VprMMYY3VuLpbaaizE++NpSLDHWXAAAd4MDAESCjTOsJJ0VjgYXGrISAAgJACAQUooxxhhzzjnnpFKMOeaccw5CCKFUijHGnHMOQgghlIwx5pxzEEIIIYRSSsaccxBCCCGEkFLqnHMQQgghhBBKKZ1zDkIIIYQQQimlgxBCCCGEEEoopaQUQgghhBBCCKmklEIIIYRSQighlZRSCCGEEEIpJaSUUgohhFJCCKGElFJKKYUQQgillJJSSimlEkoJJYQSUikppRRKCCGUUkpKKaVUSgmhhBJKKSWllFJKIYQQSikFAAAcOAAABBh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QAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}});var wTe=Gc((G_o,vTe)=>{var E_o=T(S()),{webm:Z_t,mp4:G_t}=PTe(),X7=()=>typeof navigator<"u"&&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,W7=()=>"wakeLock"in navigator,P7=class{constructor(){if(this.enabled=!1,W7()){this._wakeLock=null;let t=()=>{this._wakeLock!==null&&document.visibilityState==="visible"&&this.enable()};document.addEventListener("visibilitychange",t),document.addEventListener("fullscreenchange",t)}else X7()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",Z_t),this._addSourceToVideo(this.noSleepVideo,"mp4",G_t),this.noSleepVideo.addEventListener("loadedmetadata",()=>{this.noSleepVideo.duration<=1?this.noSleepVideo.setAttribute("loop",""):this.noSleepVideo.addEventListener("timeupdate",()=>{this.noSleepVideo.currentTime>.5&&(this.noSleepVideo.currentTime=Math.random())})}))}_addSourceToVideo(t,n,i){var o=document.createElement("source");o.src=i,o.type=`video/${n}`,t.appendChild(o)}get isEnabled(){return this.enabled}enable(){return W7()?navigator.wakeLock.request("screen").then(t=>{this._wakeLock=t,this.enabled=!0,console.log("Wake Lock active."),this._wakeLock.addEventListener("release",()=>{console.log("Wake Lock released.")})}).catch(t=>{throw this.enabled=!1,console.error(`${t.name}, ${t.message}`),t}):X7()?(this.disable(),console.warn(`
NoSleep enabled for older iOS devices. This can interrupt
active or long-running network requests from completing successfully.
See https://github.com/richtr/NoSleep.js/issues/15 for more details.
`),this.noSleepTimer=window.setInterval(()=>{document.hidden||(window.location.href=window.location.href.split("#")[0],window.setTimeout(window.stop,0))},15e3),this.enabled=!0,Promise.resolve()):this.noSleepVideo.play().then(n=>(this.enabled=!0,n)).catch(n=>{throw this.enabled=!1,n})}disable(){W7()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):X7()?this.noSleepTimer&&(console.warn(`
NoSleep now disabled for older iOS devices.
`),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}};vTe.exports=P7});var J_t={};iSe(J_t,{AlphaMode:()=>sf,AlphaPipelineStage:()=>_X,Animation:()=>sA,AnimationViewModel:()=>aA,Appearance:()=>ro,ApproximateTerrainHeights:()=>hi,ArcGISTiledElevationTerrainProvider:()=>yj,ArcGisBaseMapType:()=>Th,ArcGisMapServerImageryProvider:()=>H0,ArcGisMapService:()=>Fd,ArcType:()=>jt,ArticulationStageType:()=>oc,AssociativeArray:()=>Ct,Atmosphere:()=>Gw,AtmospherePipelineStage:()=>iX,AttributeCompression:()=>Fn,AttributeType:()=>tn,AutoExposure:()=>LF,AutomaticUniforms:()=>hp,Axis:()=>Wo,AxisAlignedBoundingBox:()=>Tb,B3dmLoader:()=>wI,B3dmParser:()=>WI,BaseLayerPicker:()=>hA,BaseLayerPickerViewModel:()=>mA,BatchTable:()=>ox,BatchTableHierarchy:()=>Xx,BatchTexture:()=>Nc,BatchTexturePipelineStage:()=>TX,Billboard:()=>Hi,BillboardCollection:()=>ac,BillboardGraphics:()=>Da,BillboardVisualizer:()=>LL,BingMapsGeocoderService:()=>xj,BingMapsImageryProvider:()=>qv,BingMapsStyle:()=>gV,BlendEquation:()=>Ta,BlendFunction:()=>Ro,BlendOption:()=>Zo,BlendingState:()=>mn,BoundingRectangle:()=>De,BoundingSphere:()=>ce,BoundingSphereState:()=>ut,BoundingVolumeSemantics:()=>zx,BoxEmitter:()=>d8,BoxGeometry:()=>pl,BoxGeometryUpdater:()=>NE,BoxGraphics:()=>yx,BoxOutlineGeometry:()=>bm,BrdfLutGenerator:()=>Iw,Buffer:()=>ft,BufferLoader:()=>Ax,BufferUsage:()=>Ue,CPUStylingPipelineStage:()=>LX,CallbackProperty:()=>Lm,Camera:()=>fo,CameraEventAggregator:()=>PF,CameraEventType:()=>Pi,CameraFlightPath:()=>Ww,Cartesian2:()=>B,Cartesian3:()=>h,Cartesian4:()=>se,Cartographic:()=>he,CartographicGeocoderService:()=>Tj,CatmullRomSpline:()=>Sj,Cesium3DContentGroup:()=>Ix,Cesium3DTile:()=>Eu,Cesium3DTileBatchTable:()=>Xp,Cesium3DTileColorBlendMode:()=>Cl,Cesium3DTileContent:()=>u8,Cesium3DTileContentFactory:()=>m_,Cesium3DTileContentState:()=>Uo,Cesium3DTileContentType:()=>Ts,Cesium3DTileFeature:()=>vs,Cesium3DTileFeatureTable:()=>Mm,Cesium3DTileOptimizationHint:()=>Cu,Cesium3DTileOptimizations:()=>s2,Cesium3DTilePass:()=>wo,Cesium3DTilePassState:()=>em,Cesium3DTilePointFeature:()=>t0,Cesium3DTileRefine:()=>Ao,Cesium3DTileStyle:()=>zT,Cesium3DTileStyleEngine:()=>m2,Cesium3DTilesInspector:()=>uA,Cesium3DTilesInspectorViewModel:()=>dA,Cesium3DTilesVoxelProvider:()=>p8,Cesium3DTileset:()=>oa,Cesium3DTilesetBaseTraversal:()=>g2,Cesium3DTilesetCache:()=>l2,Cesium3DTilesetGraphics:()=>Vx,Cesium3DTilesetHeatmap:()=>d2,Cesium3DTilesetMetadata:()=>V_,Cesium3DTilesetMostDetailedTraversal:()=>p2,Cesium3DTilesetSkipTraversal:()=>T2,Cesium3DTilesetStatistics:()=>b0,Cesium3DTilesetTraversal:()=>Us,Cesium3DTilesetVisualizer:()=>S2,CesiumInspector:()=>gA,CesiumInspectorViewModel:()=>yA,CesiumTerrainProvider:()=>UT,CesiumWidget:()=>JF,Check:()=>_o,CheckerboardMaterialProperty:()=>$C,CircleEmitter:()=>E9,CircleGeometry:()=>Gj,CircleOutlineGeometry:()=>Ej,ClassificationModelDrawCommand:()=>jI,ClassificationPipelineStage:()=>SX,ClassificationPrimitive:()=>OS,ClassificationType:()=>Bn,ClearCommand:()=>ai,ClippingPlane:()=>Jx,ClippingPlaneCollection:()=>ys,Clock:()=>eh,ClockRange:()=>vr,ClockStep:()=>yo,ClockViewModel:()=>nA,CloudCollection:()=>T8,CloudType:()=>qV,Color:()=>O,ColorBlendMode:()=>ic,ColorGeometryInstanceAttribute:()=>Ot,ColorMaterialProperty:()=>Ut,Command:()=>g7,ComponentDatatype:()=>Q,Composite3DTileContent:()=>KE,CompositeEntityCollection:()=>mK,CompositeMaterialProperty:()=>t1,CompositePositionProperty:()=>ra,CompositeProperty:()=>dc,CompressedTextureBuffer:()=>KL,ComputeCommand:()=>au,ComputeEngine:()=>xv,ConditionsExpression:()=>L9,ConeEmitter:()=>V8,ConstantPositionProperty:()=>wc,ConstantProperty:()=>ei,ConstantSpline:()=>NI,ContentMetadata:()=>JW,Context:()=>Lv,ContextLimits:()=>Yt,CoplanarPolygonGeometry:()=>rP,CoplanarPolygonGeometryLibrary:()=>d0,CoplanarPolygonOutlineGeometry:()=>Gu,CornerType:()=>Ii,CorridorGeometry:()=>I_,CorridorGeometryLibrary:()=>Mi,CorridorGeometryUpdater:()=>X2,CorridorGraphics:()=>xx,CorridorOutlineGeometry:()=>I2,Credit:()=>Vt,CreditDisplay:()=>Fw,CubeMap:()=>Ja,CubeMapFace:()=>Bh,CubicRealPolynomial:()=>ex,CullFace:()=>yi,CullingVolume:()=>as,CumulusCloud:()=>Kd,CustomDataSource:()=>F2,CustomHeightmapTerrainProvider:()=>Ij,CustomShader:()=>sS,CustomShaderMode:()=>qp,CustomShaderPipelineStage:()=>WX,CustomShaderTranslucencyMode:()=>iy,CylinderGeometry:()=>A2,CylinderGeometryLibrary:()=>W_,CylinderGeometryUpdater:()=>N2,CylinderGraphics:()=>_x,CylinderOutlineGeometry:()=>M2,CzmlDataSource:()=>J2,DataSource:()=>Wr,DataSourceClock:()=>th,DataSourceCollection:()=>Q2,DataSourceDisplay:()=>wP,DebugAppearance:()=>E8,DebugCameraPrimitive:()=>Uf,DebugInspector:()=>kF,DebugModelMatrixPrimitive:()=>W9,DefaultProxy:()=>Wj,DepthFunction:()=>ja,DepthPlane:()=>Dw,DequantizationPipelineStage:()=>vX,DerivedCommand:()=>q0,DeveloperError:()=>fe,DeviceOrientationCameraController:()=>Ow,DirectionalLight:()=>I8,DiscardEmptyTileImagePolicy:()=>xV,DiscardMissingTileImagePolicy:()=>Qv,DistanceDisplayCondition:()=>It,DistanceDisplayConditionGeometryInstanceAttribute:()=>Dn,DoubleEndedPriorityQueue:()=>DT,DoublyLinkedList:()=>c2,DracoLoader:()=>Mp,DrawCommand:()=>nt,DynamicAtmosphereLightingType:()=>bT,DynamicGeometryBatch:()=>U_,DynamicGeometryUpdater:()=>ri,EarthOrientationParameters:()=>AL,EarthOrientationParametersSample:()=>fb,EasingFunction:()=>Ar,EllipseGeometry:()=>Qc,EllipseGeometryLibrary:()=>Al,EllipseGeometryUpdater:()=>q2,EllipseGraphics:()=>Tx,EllipseOutlineGeometry:()=>Sd,Ellipsoid:()=>oe,EllipsoidGeodesic:()=>xp,EllipsoidGeometry:()=>Ds,EllipsoidGeometryUpdater:()=>eP,EllipsoidGraphics:()=>Sx,EllipsoidOutlineGeometry:()=>fd,EllipsoidPrimitive:()=>Cw,EllipsoidRhumbLine:()=>Ca,EllipsoidSurfaceAppearance:()=>X8,EllipsoidTangentPlane:()=>kr,EllipsoidTerrainProvider:()=>uT,EllipsoidalOccluder:()=>qm,Empty3DTileContent:()=>MC,EncodedCartesian3:()=>Kn,Entity:()=>Jo,EntityCluster:()=>bd,EntityCollection:()=>ks,EntityView:()=>AP,Event:()=>ye,EventHelper:()=>Er,Expression:()=>uu,ExpressionNodeType:()=>yt,ExtrapolationType:()=>gd,FeatureDetection:()=>Bt,FeatureIdPipelineStage:()=>ny,Fog:()=>Yw,ForEach:()=>We,FrameRateMonitor:()=>w9,FrameState:()=>Hw,Framebuffer:()=>na,FramebufferManager:()=>pi,FrustumCommands:()=>Qw,FrustumGeometry:()=>gT,FrustumOutlineGeometry:()=>Nw,Fullscreen:()=>pr,FullscreenButton:()=>_A,FullscreenButtonViewModel:()=>xA,GeoJsonDataSource:()=>iv,GeoJsonLoader:()=>FI,GeocodeType:()=>xg,Geocoder:()=>SA,GeocoderService:()=>KV,GeocoderViewModel:()=>TA,GeographicProjection:()=>Ri,GeographicTilingScheme:()=>Oi,Geometry:()=>mt,Geometry3DTileContent:()=>JE,GeometryAttribute:()=>Ge,GeometryAttributes:()=>pn,GeometryFactory:()=>vj,GeometryInstance:()=>St,GeometryInstanceAttribute:()=>qa,GeometryOffsetAttribute:()=>an,GeometryPipeline:()=>Mn,GeometryPipelineStage:()=>MX,GeometryType:()=>nu,GeometryUpdater:()=>si,GeometryVisualizer:()=>CP,GetFeatureInfoFormat:()=>hT,Globe:()=>xw,GlobeDepth:()=>jw,GlobeSurfaceShaderSet:()=>Jv,GlobeSurfaceTile:()=>ju,GlobeSurfaceTileProvider:()=>lw,GlobeTranslucency:()=>dw,GlobeTranslucencyFramebuffer:()=>qw,GlobeTranslucencyState:()=>Kw,GltfBufferViewLoader:()=>iC,GltfDracoLoader:()=>oC,GltfImageLoader:()=>rC,GltfIndexBufferLoader:()=>sC,GltfJsonLoader:()=>cC,GltfLoader:()=>Bp,GltfLoaderUtil:()=>Zl,GltfStructuralMetadataLoader:()=>RI,GltfTextureLoader:()=>lC,GltfVertexBufferLoader:()=>dC,GoogleEarthEnterpriseImageryProvider:()=>P8,GoogleEarthEnterpriseMapsProvider:()=>tw,GoogleEarthEnterpriseMetadata:()=>cb,GoogleEarthEnterpriseTerrainData:()=>zV,GoogleEarthEnterpriseTerrainProvider:()=>Dj,GoogleEarthEnterpriseTileInformation:()=>n9,GoogleMaps:()=>OT,GpxDataSource:()=>av,GregorianDate:()=>cp,GridImageryProvider:()=>v8,GridMaterialProperty:()=>d1,GroundGeometryUpdater:()=>zn,GroundPolylineGeometry:()=>hx,GroundPolylinePrimitive:()=>Tm,GroundPrimitive:()=>Pc,GroupMetadata:()=>QC,HeadingPitchRange:()=>Ou,HeadingPitchRoll:()=>za,Heap:()=>PL,HeightReference:()=>Qe,HeightmapEncoding:()=>zu,HeightmapTerrainData:()=>va,HeightmapTessellator:()=>fV,HermitePolynomialApproximation:()=>U2,HermiteSpline:()=>$b,HilbertOrder:()=>$S,HomeButton:()=>VA,HomeButtonViewModel:()=>CA,HorizontalOrigin:()=>bi,I3SDataProvider:()=>tS,I3SDecoder:()=>A9,I3SFeature:()=>M9,I3SField:()=>N9,I3SGeometry:()=>eL,I3SLayer:()=>nL,I3SNode:()=>tL,I3dmLoader:()=>MI,I3dmParser:()=>AI,Iau2000Orientation:()=>Tw,Iau2006XysData:()=>ML,Iau2006XysSample:()=>jg,IauOrientationAxes:()=>Sw,IauOrientationParameters:()=>_w,ImageBasedLighting:()=>Ex,ImageBasedLightingPipelineStage:()=>rX,ImageMaterialProperty:()=>Zb,Imagery:()=>LV,ImageryLayer:()=>ua,ImageryLayerCollection:()=>uw,ImageryLayerFeatureInfo:()=>_h,ImageryProvider:()=>el,ImageryState:()=>ui,Implicit3DTileContent:()=>mC,ImplicitAvailabilityBitstream:()=>tC,ImplicitMetadataView:()=>nC,ImplicitSubdivisionScheme:()=>Yr,ImplicitSubtree:()=>Hx,ImplicitSubtreeCache:()=>Z9,ImplicitSubtreeMetadata:()=>QE,ImplicitTileCoordinates:()=>Z_,ImplicitTileset:()=>R_,IndexDatatype:()=>Ne,InfoBox:()=>RA,InfoBoxViewModel:()=>LA,InspectorShared:()=>Na,InstanceAttributeSemantic:()=>Hr,InstancingPipelineStage:()=>bX,InterpolationAlgorithm:()=>Bj,InterpolationType:()=>wm,Intersect:()=>nn,IntersectionTests:()=>ni,Intersections2D:()=>sb,Interval:()=>xa,InvertClassification:()=>vV,Ion:()=>Zm,IonGeocoderService:()=>r9,IonImageryProvider:()=>K0,IonResource:()=>sd,IonWorldImageryStyle:()=>z0,Iso8601:()=>Be,JobScheduler:()=>zw,JobType:()=>Ra,JsonMetadataTable:()=>kp,JulianDate:()=>te,KTX2Transcoder:()=>zL,KeyboardEventModifier:()=>fa,KeyframeNode:()=>no,KmlCamera:()=>cv,KmlDataSource:()=>bv,KmlLookAt:()=>lv,KmlTour:()=>dv,KmlTourFlyTo:()=>mv,KmlTourWait:()=>hv,Label:()=>Dm,LabelCollection:()=>md,LabelGraphics:()=>Sm,LabelStyle:()=>No,LabelVisualizer:()=>VP,LagrangePolynomialApproximation:()=>k2,LeapSecond:()=>Di,Light:()=>A8,LightingModel:()=>cf,LightingPipelineStage:()=>UX,LinearApproximation:()=>v_,LinearSpline:()=>qb,ManagedArray:()=>Mc,MapMode2D:()=>Ol,MapProjection:()=>Hj,MapboxImageryProvider:()=>nw,MapboxStyleImageryProvider:()=>M8,Mars3DEx:()=>ip,Material:()=>Bi,MaterialAppearance:()=>mo,MaterialPipelineStage:()=>DX,MaterialProperty:()=>zo,Math:()=>W,Matrix2:()=>io,Matrix3:()=>q,Matrix4:()=>A,Megatexture:()=>oL,MetadataClass:()=>Xm,MetadataClassProperty:()=>Mb,MetadataComponentType:()=>sn,MetadataEntity:()=>Nn,MetadataEnum:()=>hI,MetadataEnumValue:()=>mI,MetadataPipelineStage:()=>fu,MetadataSchema:()=>Wm,MetadataSchemaLoader:()=>uC,MetadataSemantic:()=>Kx,MetadataTable:()=>Ll,MetadataTableProperty:()=>qE,MetadataType:()=>Ht,MipmapHint:()=>Oh,Model:()=>km,Model3DTileContent:()=>lf,ModelAlphaOptions:()=>sW,ModelAnimation:()=>BI,ModelAnimationChannel:()=>DI,ModelAnimationCollection:()=>OI,ModelAnimationLoop:()=>El,ModelAnimationState:()=>Nm,ModelArticulation:()=>aX,ModelArticulationStage:()=>sX,ModelClippingPlanesPipelineStage:()=>dX,ModelColorPipelineStage:()=>ty,ModelComponents:()=>Mt,ModelDrawCommand:()=>qI,ModelFeature:()=>YI,ModelFeatureTable:()=>KI,ModelGraphics:()=>Lp,ModelLightingOptions:()=>bW,ModelMatrixUpdateStage:()=>yX,ModelNode:()=>uX,ModelRenderResources:()=>lW,ModelRuntimeNode:()=>xX,ModelRuntimePrimitive:()=>oW,ModelSceneGraph:()=>gW,ModelSilhouettePipelineStage:()=>mW,ModelSkin:()=>rW,ModelSplitterPipelineStage:()=>fW,ModelStatistics:()=>xW,ModelType:()=>cr,ModelUtility:()=>qt,ModelVisualizer:()=>LP,Moon:()=>Lw,MorphTargetsPipelineStage:()=>OX,MorphWeightSpline:()=>Kj,MortonOrder:()=>xy,Multiple3DTileContent:()=>qW,MultisampleFramebuffer:()=>GI,NavigationHelpButton:()=>GA,NavigationHelpButtonViewModel:()=>ZA,NearFarScalar:()=>vt,NeverTileDiscardPolicy:()=>U8,NodeRenderResources:()=>pW,NodeStatisticsPipelineStage:()=>gX,NodeTransformationProperty:()=>Cx,OIT:()=>$w,Occluder:()=>Rw,OctahedralProjectedCubeMap:()=>Rm,OffsetGeometryInstanceAttribute:()=>eo,OpenCageGeocoderService:()=>Jj,OpenStreetMapImageryProvider:()=>lb,OrderedGroundPrimitiveCollection:()=>j2,OrientedBoundingBox:()=>Xn,OrthographicFrustum:()=>rn,OrthographicOffCenterFrustum:()=>Vr,Packable:()=>Qj,PackableForInterpolation:()=>jj,Particle:()=>rL,ParticleBurst:()=>D8,ParticleEmitter:()=>B8,ParticleSystem:()=>O8,Pass:()=>Ve,PassState:()=>pc,PathGraphics:()=>Rp,PathVisualizer:()=>ZP,PeliasGeocoderService:()=>o9,PerInstanceColorAppearance:()=>cn,PerformanceDisplay:()=>$0,PerformanceWatchdog:()=>IA,PerformanceWatchdogViewModel:()=>EA,PerspectiveFrustum:()=>Li,PerspectiveOffCenterFrustum:()=>nl,PickDepth:()=>Jw,PickDepthFramebuffer:()=>tF,PickFramebuffer:()=>oF,Picking:()=>aF,PickingPipelineStage:()=>YX,PinBuilder:()=>U0,PixelDatatype:()=>je,PixelFormat:()=>at,Plane:()=>ln,PlaneGeometry:()=>tP,PlaneGeometryUpdater:()=>iP,PlaneGraphics:()=>WE,PlaneOutlineGeometry:()=>nP,PntsLoader:()=>TW,PntsParser:()=>s_,PointCloud:()=>B9,PointCloudEyeDomeLighting:()=>Op,PointCloudShading:()=>af,PointCloudStylingPipelineStage:()=>KX,PointGraphics:()=>Lx,PointPrimitive:()=>ds,PointPrimitiveCollection:()=>S0,PointVisualizer:()=>EP,PolygonGeometry:()=>O_,PolygonGeometryLibrary:()=>Yn,PolygonGeometryUpdater:()=>aP,PolygonGraphics:()=>Cm,PolygonHierarchy:()=>Va,PolygonOutlineGeometry:()=>sP,PolygonPipeline:()=>di,Polyline:()=>_u,PolylineArrowMaterialProperty:()=>m1,PolylineCollection:()=>Om,PolylineColorAppearance:()=>Br,PolylineDashMaterialProperty:()=>f1,PolylineGeometry:()=>v0,PolylineGeometryUpdater:()=>WP,PolylineGlowMaterialProperty:()=>b1,PolylineGraphics:()=>$a,PolylineMaterialAppearance:()=>qs,PolylineOutlineMaterialProperty:()=>Zy,PolylinePipeline:()=>Ei,PolylineVisualizer:()=>vP,PolylineVolumeGeometry:()=>dP,PolylineVolumeGeometryLibrary:()=>Jm,PolylineVolumeGeometryUpdater:()=>fP,PolylineVolumeGraphics:()=>Rx,PolylineVolumeOutlineGeometry:()=>hP,PositionProperty:()=>Cp,PositionPropertyArray:()=>R0,PostProcessStage:()=>xo,PostProcessStageCollection:()=>EF,PostProcessStageComposite:()=>il,PostProcessStageLibrary:()=>nm,PostProcessStageSampleMode:()=>Nd,PostProcessStageTextureCache:()=>IT,Primitive:()=>En,PrimitiveCluster:()=>_Q,PrimitiveCollection:()=>Fl,PrimitiveLoadPlan:()=>$x,PrimitiveOutlineGenerator:()=>qx,PrimitiveOutlinePipelineStage:()=>QX,PrimitivePipeline:()=>dx,PrimitiveRenderResources:()=>yW,PrimitiveState:()=>gr,PrimitiveStatisticsPipelineStage:()=>jX,PrimitiveType:()=>Ae,ProjectionPicker:()=>WA,ProjectionPickerViewModel:()=>XA,Property:()=>z,PropertyArray:()=>g1,PropertyAttribute:()=>jx,PropertyAttributeProperty:()=>SI,PropertyBag:()=>_l,PropertyTable:()=>kc,PropertyTexture:()=>Qx,PropertyTextureProperty:()=>TI,ProviderViewModel:()=>qr,Proxy:()=>$j,QuadraticRealPolynomial:()=>Xc,QuadtreeOccluders:()=>mw,QuadtreePrimitive:()=>gw,QuadtreeTile:()=>hw,QuadtreeTileLoadState:()=>Hs,QuadtreeTileProvider:()=>Q8,QuantizedMeshTerrainData:()=>NT,QuarticRealPolynomial:()=>SR,Quaternion:()=>Me,QuaternionSpline:()=>kI,Queue:()=>py,Ray:()=>gn,Rectangle:()=>de,RectangleCollisionChecker:()=>z_,RectangleGeometry:()=>H_,RectangleGeometryLibrary:()=>Ss,RectangleGeometryUpdater:()=>pP,RectangleGraphics:()=>Vm,RectangleOutlineGeometry:()=>b_,ReferenceFrame:()=>ao,ReferenceProperty:()=>Z0,RenderState:()=>ke,Renderbuffer:()=>dd,RenderbufferFormat:()=>Dc,Request:()=>Yo,RequestErrorEvent:()=>Nh,RequestScheduler:()=>Ha,RequestState:()=>ti,RequestType:()=>os,Resource:()=>Xe,ResourceCache:()=>Yi,ResourceCacheKey:()=>Gl,ResourceCacheStatistics:()=>yI,ResourceLoader:()=>co,ResourceLoaderState:()=>Gt,Rotation:()=>vu,RuntimeError:()=>me,S2Cell:()=>vp,SDFSettings:()=>Ms,SampledPositionProperty:()=>aa,SampledProperty:()=>_d,Sampler:()=>hn,ScaledPositionProperty:()=>Cf,Scene:()=>BF,SceneFramebuffer:()=>CT,SceneMode:()=>ie,SceneMode2DPipelineStage:()=>qX,SceneModePicker:()=>vA,SceneModePickerViewModel:()=>PA,SceneTransforms:()=>to,SceneTransitioner:()=>WF,ScreenSpaceCameraController:()=>FF,ScreenSpaceEventHandler:()=>kd,ScreenSpaceEventType:()=>Vn,SelectedFeatureIdPipelineStage:()=>oy,SelectionIndicator:()=>AA,SelectionIndicatorViewModel:()=>FA,ShaderBuilder:()=>o_,ShaderCache:()=>_v,ShaderDestination:()=>Se,ShaderFunction:()=>cW,ShaderProgram:()=>Qt,ShaderSource:()=>Oe,ShaderStruct:()=>aW,ShadowMap:()=>nb,ShadowMapShader:()=>Of,ShadowMode:()=>Cn,ShadowVolumeAppearance:()=>id,ShowGeometryInstanceAttribute:()=>Sn,Simon1994PlanetaryPositions:()=>tg,SimplePolylineGeometry:()=>n8,SingleTileImageryProvider:()=>iw,SkinningPipelineStage:()=>eW,SkyAtmosphere:()=>OF,SkyBox:()=>YF,SpatialNode:()=>Y9,SphereEmitter:()=>q8,SphereGeometry:()=>i8,SphereOutlineGeometry:()=>m0,Spherical:()=>D2,Spline:()=>lo,SplitDirection:()=>Bc,Splitter:()=>sL,StaticGeometryColorBatch:()=>Nu,StaticGeometryPerMaterialBatch:()=>Uu,StaticGroundGeometryColorBatch:()=>U1,StaticGroundGeometryPerMaterialBatch:()=>bP,StaticGroundPolylinePerMaterialBatch:()=>PP,StaticOutlineGeometryBatch:()=>B1,StencilConstants:()=>Nt,StencilFunction:()=>On,StencilOperation:()=>pt,SteppedSpline:()=>UI,Stereographic:()=>fc,StripeMaterialProperty:()=>_1,StripeOrientation:()=>ih,StructuralMetadata:()=>Za,StyleCommandsNeeded:()=>Um,StyleExpression:()=>$8,Sun:()=>zF,SunLight:()=>D0,SunPostProcess:()=>NF,SupportedImageFormats:()=>ZI,SvgPathBindingHandler:()=>eA,TaskProcessor:()=>gi,Terrain:()=>K9,TerrainData:()=>xh,TerrainEncoding:()=>yc,TerrainFillMesh:()=>EV,TerrainMesh:()=>Qu,TerrainOffsetProperty:()=>Zx,TerrainProvider:()=>zr,TerrainQuantization:()=>Ys,TerrainState:()=>ho,Texture:()=>wt,TextureAtlas:()=>ly,TextureCache:()=>Tv,TextureMagnificationFilter:()=>Ti,TextureManager:()=>Q9,TextureMinificationFilter:()=>dn,TextureUniform:()=>h7,TextureWrap:()=>In,TileAvailability:()=>Gh,TileBoundingRegion:()=>Zu,TileBoundingS2Cell:()=>o2,TileBoundingSphere:()=>h0,TileBoundingVolume:()=>e7,TileCoordinatesImageryProvider:()=>J9,TileDiscardPolicy:()=>n7,TileEdge:()=>Tn,TileImagery:()=>RV,TileMapServiceImageryProvider:()=>og,TileMetadata:()=>QW,TileOrientedBoundingBox:()=>pd,TileProviderError:()=>Eo,TileReplacementQueue:()=>fw,TileSelectionResult:()=>$n,TileState:()=>i7,Tileset3DTileContent:()=>VW,TilesetMetadata:()=>r2,TilesetPipelineStage:()=>eX,TilingScheme:()=>o8,TimeConstants:()=>qn,TimeDynamicImagery:()=>fT,TimeDynamicPointCloud:()=>dL,TimeInterval:()=>Ln,TimeIntervalCollection:()=>Xr,TimeIntervalCollectionPositionProperty:()=>G0,TimeIntervalCollectionProperty:()=>E0,TimeStandard:()=>Qn,Timeline:()=>UA,TimelineHighlightRange:()=>MA,TimelineTrack:()=>NA,Tipsify:()=>sE,ToggleButtonViewModel:()=>Zg,Tonemapper:()=>hg,Transforms:()=>Xt,TranslationRotationScale:()=>Gb,TranslucentTileClassification:()=>rF,TridiagonalSystemSolver:()=>TC,TrustedServers:()=>IS,TweenCollection:()=>vT,UniformState:()=>Vv,UniformType:()=>mL,UrlTemplateImageryProvider:()=>wa,VERSION:()=>z_t,VRButton:()=>OA,VRButtonViewModel:()=>BA,VRTheWorldTerrainProvider:()=>s8,VaryingType:()=>f7,Vector3DTileBatch:()=>tf,Vector3DTileClampedPolylines:()=>HW,Vector3DTileContent:()=>zW,Vector3DTileGeometry:()=>Pp,Vector3DTilePoints:()=>NW,Vector3DTilePolygons:()=>UW,Vector3DTilePolylines:()=>u_,Vector3DTilePrimitive:()=>vx,VelocityOrientationProperty:()=>O2,VelocityVectorProperty:()=>M_,VertexArray:()=>oi,VertexArrayFacade:()=>$p,VertexAttributeSemantic:()=>_t,VertexFormat:()=>Pe,VerticalExaggeration:()=>Dr,VerticalExaggerationPipelineStage:()=>nW,VerticalOrigin:()=>vn,VideoSynchronizer:()=>r8,View:()=>RT,Viewer:()=>w7,ViewportQuad:()=>s7,Visibility:()=>mr,Visualizer:()=>TQ,VoxelBoxShape:()=>jf,VoxelContent:()=>G9,VoxelCylinderShape:()=>qf,VoxelEllipsoidShape:()=>JT,VoxelInspector:()=>DA,VoxelInspectorViewModel:()=>kA,VoxelPrimitive:()=>fL,VoxelProvider:()=>d7,VoxelRenderResources:()=>S9,VoxelShape:()=>u7,VoxelShapeType:()=>Ui,VoxelTraversal:()=>uL,VulkanConstants:()=>a8,WallGeometry:()=>gP,WallGeometryLibrary:()=>J_,WallGeometryUpdater:()=>TP,WallGraphics:()=>Zp,WallOutlineGeometry:()=>_P,WebGLConstants:()=>ne,WebMapServiceImageryProvider:()=>rw,WebMapTileServiceImageryProvider:()=>aw,WebMercatorProjection:()=>Gi,WebMercatorTilingScheme:()=>Jr,WindingOrder:()=>ss,WireframeIndexGenerator:()=>XC,WireframePipelineStage:()=>iW,_shadersAcesTonemappingStage:()=>cF,_shadersAdditiveBlend:()=>AF,_shadersAdjustTranslucentFS:()=>lV,_shadersAllMaterialAppearanceFS:()=>kL,_shadersAllMaterialAppearanceVS:()=>DL,_shadersAmbientOcclusionGenerate:()=>lF,_shadersAmbientOcclusionModulate:()=>dF,_shadersAspectRampMaterial:()=>jL,_shadersAtmosphereCommon:()=>B0,_shadersAtmosphereStageFS:()=>tX,_shadersAtmosphereStageVS:()=>nX,_shadersBasicMaterialAppearanceFS:()=>BL,_shadersBasicMaterialAppearanceVS:()=>OL,_shadersBillboardCollectionFS:()=>LW,_shadersBillboardCollectionVS:()=>RW,_shadersBlackAndWhite:()=>uF,_shadersBloomComposite:()=>mF,_shadersBrdfLutGeneratorFS:()=>Zv,_shadersBrightPass:()=>MF,_shadersBrightness:()=>hF,_shadersBumpMapMaterial:()=>qL,_shadersCPUStylingStageFS:()=>VX,_shadersCPUStylingStageVS:()=>CX,_shadersCheckerboardMaterial:()=>$L,_shadersCloudCollectionFS:()=>Gv,_shadersCloudCollectionVS:()=>Ev,_shadersCloudNoiseFS:()=>Iv,_shadersCloudNoiseVS:()=>Xv,_shadersCompareAndPackTranslucentDepth:()=>Wv,_shadersCompositeOITFS:()=>Pv,_shadersCompositeTranslucentClassification:()=>LT,_shadersContrastBias:()=>fF,_shadersCustomShaderStageFS:()=>ZX,_shadersCustomShaderStageVS:()=>RX,_shadersCzmBuiltins:()=>ix,_shadersDepthOfField:()=>pF,_shadersDepthPlaneFS:()=>vv,_shadersDepthPlaneVS:()=>wv,_shadersDepthView:()=>bF,_shadersDepthViewPacked:()=>m7,_shadersDotMaterial:()=>eR,_shadersEdgeDetection:()=>yF,_shadersElevationBandMaterial:()=>tR,_shadersElevationContourMaterial:()=>nR,_shadersElevationRampMaterial:()=>iR,_shadersEllipsoidFS:()=>dV,_shadersEllipsoidSurfaceAppearanceFS:()=>P9,_shadersEllipsoidSurfaceAppearanceVS:()=>v9,_shadersEllipsoidVS:()=>uV,_shadersFXAA:()=>xF,_shadersFXAA3_11:()=>Fv,_shadersFadeMaterial:()=>oR,_shadersFeatureIdStageFS:()=>GX,_shadersFeatureIdStageVS:()=>EX,_shadersFilmicTonemapping:()=>gF,_shadersGaussianBlur1D:()=>mg,_shadersGeometryStageFS:()=>wX,_shadersGeometryStageVS:()=>FX,_shadersGlobeFS:()=>Av,_shadersGlobeVS:()=>Mv,_shadersGridMaterial:()=>rR,_shadersGroundAtmosphere:()=>mV,_shadersHSBToRGB:()=>tG,_shadersHSLToRGB:()=>nG,_shadersImageBasedLightingStageFS:()=>oX,_shadersInstancingStageCommon:()=>mX,_shadersInstancingStageVS:()=>hX,_shadersIntersectBox:()=>f9,_shadersIntersectClippingPlanes:()=>h9,_shadersIntersectCylinder:()=>p9,_shadersIntersectDepth:()=>m9,_shadersIntersectEllipsoid:()=>b9,_shadersIntersection:()=>KT,_shadersIntersectionUtils:()=>u9,_shadersLegacyInstancingStageVS:()=>fX,_shadersLensFlare:()=>_F,_shadersLightingStageFS:()=>NX,_shadersMaterialStageFS:()=>kX,_shadersMegatexture:()=>T9,_shadersMetadataStageFS:()=>IX,_shadersMetadataStageVS:()=>XX,_shadersModelClippingPlanesStageFS:()=>lX,_shadersModelColorStageFS:()=>cX,_shadersModelFS:()=>zI,_shadersModelSilhouetteStageFS:()=>dW,_shadersModelSilhouetteStageVS:()=>uW,_shadersModelSplitterStageFS:()=>hW,_shadersModelVS:()=>JI,_shadersModifiedReinhardTonemapping:()=>TF,_shadersMorphTargetsStageVS:()=>BX,_shadersNightVision:()=>SF,_shadersNormalMapMaterial:()=>sR,_shadersOctahedralProjectionAtlasFS:()=>UE,_shadersOctahedralProjectionFS:()=>kE,_shadersOctahedralProjectionVS:()=>DE,_shadersOctree:()=>_9,_shadersPassThrough:()=>Yl,_shadersPassThroughDepth:()=>lg,_shadersPerInstanceColorAppearanceFS:()=>bR,_shadersPerInstanceColorAppearanceVS:()=>yR,_shadersPerInstanceFlatColorAppearanceFS:()=>$g,_shadersPerInstanceFlatColorAppearanceVS:()=>gR,_shadersPointCloudEyeDomeLighting:()=>II,_shadersPointCloudStylingStageVS:()=>HX,_shadersPointPrimitiveCollectionFS:()=>Ry,_shadersPointPrimitiveCollectionVS:()=>W2,_shadersPolylineArrowMaterial:()=>aR,_shadersPolylineColorAppearanceVS:()=>xE,_shadersPolylineCommon:()=>od,_shadersPolylineDashMaterial:()=>cR,_shadersPolylineFS:()=>px,_shadersPolylineGlowMaterial:()=>lR,_shadersPolylineMaterialAppearanceVS:()=>_E,_shadersPolylineOutlineMaterial:()=>dR,_shadersPolylineShadowVolumeFS:()=>pE,_shadersPolylineShadowVolumeMorphFS:()=>bE,_shadersPolylineShadowVolumeMorphVS:()=>yE,_shadersPolylineShadowVolumeVS:()=>gE,_shadersPolylineVS:()=>PW,_shadersPrimitiveOutlineStageFS:()=>JX,_shadersPrimitiveOutlineStageVS:()=>zX,_shadersRGBToHSB:()=>GG,_shadersRGBToHSL:()=>EG,_shadersRGBToXYZ:()=>IG,_shadersReinhardTonemapping:()=>CF,_shadersReprojectWebMercatorFS:()=>Nv,_shadersReprojectWebMercatorVS:()=>Uv,_shadersRimLightingMaterial:()=>uR,_shadersSelectedFeatureIdStageCommon:()=>IC,_shadersShadowVolumeAppearanceFS:()=>DS,_shadersShadowVolumeAppearanceVS:()=>nE,_shadersShadowVolumeFS:()=>Cb,_shadersSilhouette:()=>VF,_shadersSkinningStageVS:()=>$X,_shadersSkyAtmosphereCommon:()=>hV,_shadersSkyAtmosphereFS:()=>kv,_shadersSkyAtmosphereVS:()=>Dv,_shadersSkyBoxFS:()=>Bv,_shadersSkyBoxVS:()=>Ov,_shadersSlopeRampMaterial:()=>mR,_shadersStripeMaterial:()=>hR,_shadersSunFS:()=>Yv,_shadersSunTextureFS:()=>Hv,_shadersSunVS:()=>Kv,_shadersTexturedMaterialAppearanceFS:()=>YL,_shadersTexturedMaterialAppearanceVS:()=>HL,_shadersVector3DTileClampedPolylinesFS:()=>OW,_shadersVector3DTileClampedPolylinesVS:()=>BW,_shadersVector3DTilePolylinesVS:()=>kW,_shadersVectorTileVS:()=>qS,_shadersVerticalExaggerationStageVS:()=>tW,_shadersViewportQuadFS:()=>zv,_shadersViewportQuadVS:()=>cT,_shadersVoxelFS:()=>l9,_shadersVoxelVS:()=>d9,_shadersWater:()=>fR,_shadersXYZToRGB:()=>eE,_shadersacesTonemapping:()=>xZ,_shadersalphaWeight:()=>_Z,_shadersantialias:()=>TZ,_shadersapplyHSBShift:()=>SZ,_shadersapproximateSphericalCoordinates:()=>CZ,_shadersapproximateTanh:()=>VZ,_shadersbackFacing:()=>LZ,_shadersbranchFreeTernary:()=>RZ,_shaderscascadeColor:()=>ZZ,_shaderscascadeDistance:()=>GZ,_shaderscascadeMatrix:()=>EZ,_shaderscascadeWeights:()=>IZ,_shaderscolumbusViewMorph:()=>XZ,_shaderscomputeAtmosphereColor:()=>WZ,_shaderscomputeGroundAtmosphereScattering:()=>PZ,_shaderscomputePosition:()=>vZ,_shaderscomputeScattering:()=>wZ,_shadersconvertUvToBox:()=>y9,_shadersconvertUvToCylinder:()=>g9,_shadersconvertUvToEllipsoid:()=>x9,_shaderscosineAndSine:()=>FZ,_shadersdecompressTextureCoordinates:()=>AZ,_shadersdefaultPbrMaterial:()=>MZ,_shadersdegreesPerRadian:()=>RR,_shadersdepthClamp:()=>NZ,_shadersdepthRange:()=>ZR,_shadersdepthRangeStruct:()=>dZ,_shaderseastNorthUpToEyeCoordinates:()=>UZ,_shadersellipsoidContainsPoint:()=>kZ,_shadersellipsoidWgs84TextureCoordinates:()=>DZ,_shadersepsilon1:()=>GR,_shadersepsilon2:()=>ER,_shadersepsilon3:()=>IR,_shadersepsilon4:()=>XR,_shadersepsilon5:()=>WR,_shadersepsilon6:()=>PR,_shadersepsilon7:()=>vR,_shadersequalsEpsilon:()=>BZ,_shaderseyeOffset:()=>OZ,_shaderseyeToWindowCoordinates:()=>YZ,_shadersfastApproximateAtan:()=>HZ,_shadersfog:()=>KZ,_shadersgammaCorrect:()=>zZ,_shadersgeodeticSurfaceNormal:()=>JZ,_shadersgetDefaultMaterial:()=>QZ,_shadersgetDynamicAtmosphereLightDirection:()=>jZ,_shadersgetLambertDiffuse:()=>qZ,_shadersgetSpecular:()=>$Z,_shadersgetWaterNoise:()=>eG,_shadershue:()=>iG,_shadersinfinity:()=>wR,_shadersinverseGamma:()=>oG,_shadersisEmpty:()=>rG,_shadersisFull:()=>sG,_shaderslatitudeToWebMercatorFraction:()=>aG,_shaderslineDistance:()=>lG,_shaderslinearToSrgb:()=>cG,_shadersluminance:()=>dG,_shadersmaterial:()=>uZ,_shadersmaterialInput:()=>mZ,_shadersmetersPerPixel:()=>uG,_shadersmodelMaterial:()=>hZ,_shadersmodelToWindowCoordinates:()=>mG,_shadersmodelVertexOutput:()=>fZ,_shadersmultiplyWithColorBalance:()=>hG,_shadersnearFarScalar:()=>fG,_shadersoctDecode:()=>pG,_shadersoneOverPi:()=>FR,_shadersoneOverTwoPi:()=>AR,_shaderspackDepth:()=>bG,_shaderspassCesium3DTile:()=>MR,_shaderspassCesium3DTileClassification:()=>NR,_shaderspassCesium3DTileClassificationIgnoreShow:()=>UR,_shaderspassClassification:()=>kR,_shaderspassCompute:()=>DR,_shaderspassEnvironment:()=>BR,_shaderspassGlobe:()=>OR,_shaderspassOpaque:()=>YR,_shaderspassOverlay:()=>HR,_shaderspassTerrainClassification:()=>KR,_shaderspassTranslucent:()=>zR,_shaderspassVoxels:()=>JR,_shaderspbrLighting:()=>yG,_shaderspbrMetallicRoughnessMaterial:()=>gG,_shaderspbrParameters:()=>pZ,_shaderspbrSpecularGlossinessMaterial:()=>xG,_shadersphong:()=>_G,_shaderspi:()=>QR,_shaderspiOverFour:()=>jR,_shaderspiOverSix:()=>qR,_shaderspiOverThree:()=>$R,_shaderspiOverTwo:()=>eZ,_shadersplaneDistance:()=>TG,_shaderspointAlongRay:()=>SG,_shadersradiansPerDegree:()=>tZ,_shadersray:()=>bZ,_shadersrayEllipsoidIntersectionInterval:()=>CG,_shadersraySegment:()=>yZ,_shadersraySphereIntersectionInterval:()=>VG,_shadersreadDepth:()=>LG,_shadersreadNonPerspective:()=>RG,_shadersreverseLogDepth:()=>ZG,_shadersround:()=>XG,_shaderssampleOctahedralProjection:()=>WG,_shaderssaturation:()=>PG,_shaderssceneMode2D:()=>nZ,_shaderssceneMode3D:()=>iZ,_shaderssceneModeColumbusView:()=>oZ,_shaderssceneModeMorphing:()=>rZ,_shadersshadowDepthCompare:()=>vG,_shadersshadowParameters:()=>gZ,_shadersshadowVisibility:()=>wG,_shaderssignNotZero:()=>FG,_shaderssolarRadius:()=>sZ,_shaderssphericalHarmonics:()=>AG,_shaderssrgbToLinear:()=>MG,_shaderstangentToEyeSpaceMatrix:()=>NG,_shaderstextureCube:()=>UG,_shadersthreePiOver2:()=>aZ,_shaderstransformPlane:()=>kG,_shaderstranslateRelativeToEye:()=>DG,_shaderstranslucentPhong:()=>BG,_shaderstranspose:()=>OG,_shaderstwoPi:()=>cZ,_shadersunpackDepth:()=>YG,_shadersunpackFloat:()=>HG,_shadersunpackUint:()=>KG,_shadersvalueTransform:()=>zG,_shadersvertexLogDepth:()=>JG,_shaderswebMercatorMaxLatitude:()=>lZ,_shaderswindowToEyeCoordinates:()=>QG,_shaderswriteDepthClamp:()=>jG,_shaderswriteLogDepth:()=>qG,_shaderswriteNonPerspective:()=>$G,addBuffer:()=>aI,addDefaults:()=>$E,addExtensionsRequired:()=>oI,addExtensionsUsed:()=>mu,addPipelineExtras:()=>Db,addToArray:()=>bs,appendForwardSlash:()=>IL,arrayRemoveDuplicates:()=>So,barycentricCoordinates:()=>rx,binarySearch:()=>Io,buildDrawCommand:()=>$I,buildModuleUrl:()=>on,buildVoxelDrawCommands:()=>V9,clone:()=>ze,combine:()=>Tt,computeFlyToLocationForRectangle:()=>jT,createBillboardPointCallback:()=>a_,createCommand:()=>Rn,createDefaultImageryProviderViewModels:()=>fA,createDefaultTerrainProviderViewModels:()=>pA,createElevationBandMaterial:()=>L8,createGooglePhotorealistic3DTileset:()=>R8,createGuid:()=>Hn,createMaterialPropertyDescriptor:()=>Xo,createOsmBuildingsAsync:()=>Z8,createPropertyDescriptor:()=>le,createRawPropertyDescriptor:()=>xl,createTangentSpaceDebugPrimitive:()=>G8,createTaskProcessorWorker:()=>p7,createUniform:()=>VR,createUniformArray:()=>LR,createWorldBathymetryAsync:()=>qF,createWorldImageryAsync:()=>J0,createWorldTerrainAsync:()=>kT,decodeGoogleEarthEnterpriseData:()=>$F,decodeVectorPolylinePositions:()=>KW,defaultValue:()=>g,defer:()=>hl,defined:()=>l,demodernizeShader:()=>tE,deprecationWarning:()=>_r,destroyObject:()=>ue,exportKml:()=>VJ,findAccessorMinMax:()=>Dx,findContentMetadata:()=>h_,findGroupMetadata:()=>f_,findTileMetadata:()=>jW,forEachTextureInMaterial:()=>aC,formatError:()=>wf,freezeRenderState:()=>rO,getAbsoluteUri:()=>Ah,getAccessorByteStride:()=>Rl,getBaseUri:()=>XL,getBinaryAccessor:()=>ad,getClipAndStyleCode:()=>F9,getClippingFunction:()=>Y0,getComponentReader:()=>Up,getElement:()=>Wn,getExtensionFromUri:()=>Dg,getFilenameFromUri:()=>V0,getImageFromTypedArray:()=>t9,getImagePixels:()=>pm,getJsonFromTypedArray:()=>Po,getMagic:()=>Gm,getStringFromTypedArray:()=>Sl,getTimestamp:()=>xi,hasExtension:()=>ci,heightReferenceOnEntityPropertyChanged:()=>Gp,isBitSet:()=>Vc,isBlobUri:()=>Bg,isCrossOriginUrl:()=>Og,isDataUri:()=>lp,isLeapYear:()=>fm,knockout:()=>Ce,knockout_3_5_1:()=>lS,knockout_es5:()=>$9,loadAndExecuteScript:()=>Yg,loadCubeMap:()=>Rv,loadImageFromTypedArray:()=>Nx,loadKTX2:()=>bl,mergeSort:()=>j0,moveTechniqueRenderStates:()=>iI,moveTechniquesToExtension:()=>rI,numberOfComponentsForType:()=>ld,objectToQuery:()=>Hg,oneTimeWarning:()=>Ft,parseBatchTable:()=>Kp,parseFeatureMetadataLegacy:()=>LI,parseGlb:()=>tI,parseResponseHeaders:()=>WL,parseStructuralMetadata:()=>VI,pickModel:()=>PC,pointInsideTriangle:()=>qj,preprocess3DTileContent:()=>ff,processVoxelProperties:()=>C9,queryToObject:()=>ed,readAccessorPacked:()=>cI,removeExtension:()=>Bx,removeExtensionsRequired:()=>eI,removeExtensionsUsed:()=>kx,removePipelineExtras:()=>nI,removeUnusedElements:()=>sI,resizeImageToNextPowerOfTwo:()=>Yb,sampleTerrain:()=>s9,sampleTerrainMostDetailed:()=>YT,scaleToGeodeticSurface:()=>Ng,subdivideArray:()=>iE,subscribeAndEvaluate:()=>ba,updateAccessorComponentTypes:()=>lI,updateVersion:()=>dI,usesExtension:()=>ar,viewerCesium3DTilesInspectorMixin:()=>F7,viewerCesiumInspectorMixin:()=>A7,viewerDragDropMixin:()=>N7,viewerPerformanceWatchdogMixin:()=>U7,viewerVoxelInspectorMixin:()=>k7,webGLConstantToGlslType:()=>c8,wrapFunction:()=>c9,writeTextToCanvas:()=>l_});var ISo=T(S(),1);var z8i=T(S(),1);var eTt=T(S(),1),yS={},rSe={addCache:function(e,t){return yS[e]=t,t},removeCache:function(e){delete yS[e]},getCache:function(e){return yS[e]},getCacheOrAdd:function(e){return yS[e]||(yS[e]={}),yS[e]}},ip=rSe;var ETt=T(S(),1);var nTt=T(S(),1);function r6(e,t){return e??t}r6.EMPTY_OBJECT=Object.freeze({});var g=r6;var oTt=T(S(),1);function sSe(e){return e!=null}var l=sSe;var aTt=T(S(),1);function Ag(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(Ag.prototype=Object.create(Error.prototype),Ag.prototype.constructor=Ag);Ag.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=`
${this.stack.toString()}`),e};Ag.throwInstantiationError=function(){throw new Ag("This function defines an interface and should not be called directly.")};var fe=Ag;var fTt=T(S(),1);var uTt=T(S(),1);var ps={};ps.typeOf={};function aSe(e){return`${e} is required, actual value was undefined`}function gS(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}ps.defined=function(e,t){if(!l(t))throw new fe(aSe(e))};ps.typeOf.func=function(e,t){if(typeof t!="function")throw new fe(gS(typeof t,"function",e))};ps.typeOf.string=function(e,t){if(typeof t!="string")throw new fe(gS(typeof t,"string",e))};ps.typeOf.number=function(e,t){if(typeof t!="number")throw new fe(gS(typeof t,"number",e))};ps.typeOf.number.lessThan=function(e,t,n){if(ps.typeOf.number(e,t),t>=n)throw new fe(`Expected ${e} to be less than ${n}, actual value was ${t}`)};ps.typeOf.number.lessThanOrEquals=function(e,t,n){if(ps.typeOf.number(e,t),t>n)throw new fe(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};ps.typeOf.number.greaterThan=function(e,t,n){if(ps.typeOf.number(e,t),t<=n)throw new fe(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};ps.typeOf.number.greaterThanOrEquals=function(e,t,n){if(ps.typeOf.number(e,t),t<n)throw new fe(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)};ps.typeOf.object=function(e,t){if(typeof t!="object")throw new fe(gS(typeof t,"object",e))};ps.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new fe(gS(typeof t,"boolean",e))};ps.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new fe(gS(typeof t,"bigint",e))};ps.typeOf.number.equals=function(e,t,n,i){if(ps.typeOf.number(e,n),ps.typeOf.number(t,i),n!==i)throw new fe(`${e} must be equal to ${t}, the actual values are ${n} and ${i}`)};var _o=ps;function SL(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(SL.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});SL.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};SL.prototype.removeEventListener=function(e,t){let n=this._listeners,i=this._scopes,o=-1;for(let r=0;r<n.length;r++)if(n[r]===e&&i[r]===t){o=r;break}return o!==-1?(this._insideRaiseEvent?(this._toRemove.push(o),n[o]=void 0,i[o]=void 0):(n.splice(o,1),i.splice(o,1)),!0):!1};function cSe(e,t){return t-e}SL.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e,t=this._listeners,n=this._scopes,i=t.length;for(e=0;e<i;e++){let r=t[e];l(r)&&t[e].apply(n[e],arguments)}let o=this._toRemove;if(i=o.length,i>0){for(o.sort(cSe),e=0;e<i;e++){let r=o[e];t.splice(r,1),n.splice(r,1)}o.length=0}this._insideRaiseEvent=!1};var ye=SL;var CTt=T(S(),1);var gTt=T(S(),1);function ub(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new ye,this.setValue(e)}Object.defineProperties(ub.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});ub.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};ub.prototype.setValue=function(e){let t=this._value;if(t!==e){let n=l(e),i=n&&typeof e.clone=="function",o=n&&typeof e.equals=="function";(!o||!e.equals(t))&&(this._hasClone=i,this._hasEquals=o,this._value=i?e.clone(this._value):e,this._definitionChanged.raiseEvent(this))}};ub.prototype.equals=function(e){return this===e||e instanceof ub&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};ub.prototype.valueOf=function(){return this._value};ub.prototype.toString=function(){return String(this._value)};var ei=ub;function lSe(e,t,n,i,o){return{configurable:i,get:function(){return this[t]},set:function(r){let s=this[t],a=this[n];l(a)&&(a(),this[n]=void 0),r!==void 0&&(!l(r)||!l(r.getValue))&&l(o)&&(r=o(r)),s!==r&&(this[t]=r,this._definitionChanged.raiseEvent(this,e,r,s)),l(r)&&l(r.definitionChanged)&&(this[n]=r.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,r,r)},this))}}}function dSe(e){return new ei(e)}function uSe(e,t,n){return lSe(e,`_${e.toString()}`,`_${e.toString()}Subscription`,g(t,!1),g(n,dSe))}var le=uSe;function CL(e){this._definitionChanged=new ye,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(g(e,g.EMPTY_OBJECT))}Object.defineProperties(CL.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),image:le("image"),scale:le("scale"),pixelOffset:le("pixelOffset"),eyeOffset:le("eyeOffset"),horizontalOrigin:le("horizontalOrigin"),verticalOrigin:le("verticalOrigin"),heightReference:le("heightReference"),color:le("color"),rotation:le("rotation"),alignedAxis:le("alignedAxis"),sizeInMeters:le("sizeInMeters"),width:le("width"),height:le("height"),scaleByDistance:le("scaleByDistance"),translucencyByDistance:le("translucencyByDistance"),pixelOffsetScaleByDistance:le("pixelOffsetScaleByDistance"),imageSubRegion:le("imageSubRegion"),distanceDisplayCondition:le("distanceDisplayCondition"),disableDepthTestDistance:le("disableDepthTestDistance")});CL.prototype.clone=function(e){return l(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 CL(this)};CL.prototype.merge=function(e){this.show=g(this._show,e.show),this.image=g(this._image,e.image),this.scale=g(this._scale,e.scale),this.pixelOffset=g(this._pixelOffset,e.pixelOffset),this.eyeOffset=g(this._eyeOffset,e.eyeOffset),this.horizontalOrigin=g(this._horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=g(this._verticalOrigin,e.verticalOrigin),this.heightReference=g(this._heightReference,e.heightReference),this.color=g(this._color,e.color),this.rotation=g(this._rotation,e.rotation),this.alignedAxis=g(this._alignedAxis,e.alignedAxis),this.sizeInMeters=g(this._sizeInMeters,e.sizeInMeters),this.width=g(this._width,e.width),this.height=g(this._height,e.height),this.scaleByDistance=g(this._scaleByDistance,e.scaleByDistance),this.translucencyByDistance=g(this._translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=g(this._pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.imageSubRegion=g(this._imageSubRegion,e.imageSubRegion),this.distanceDisplayCondition=g(this._distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=g(this._disableDepthTestDistance,e.disableDepthTestDistance)};var Da=CL;var NCt=T(S(),1);var WTt=T(S(),1);function Mg(){this._array=[],this._hash={}}Object.defineProperties(Mg.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}});Mg.prototype.contains=function(e){return l(this._hash[e])};Mg.prototype.set=function(e,t){let n=this._hash[e];t!==n&&(this.remove(e),this._hash[e]=t,this._array.push(t))};Mg.prototype.get=function(e){return this._hash[e]};Mg.prototype.remove=function(e){let t=this._hash[e],n=l(t);if(n){let i=this._array;i.splice(i.indexOf(t),1),delete this._hash[e]}return n};Mg.prototype.removeAll=function(){let e=this._array;e.length>0&&(this._hash={},e.length=0)};var Ct=Mg;var NSt=T(S(),1);var DTt=T(S(),1);var ATt=T(S(),1),YB=T(jA(),1);var lt={};lt.EPSILON1=.1;lt.EPSILON2=.01;lt.EPSILON3=.001;lt.EPSILON4=1e-4;lt.EPSILON5=1e-5;lt.EPSILON6=1e-6;lt.EPSILON7=1e-7;lt.EPSILON8=1e-8;lt.EPSILON9=1e-9;lt.EPSILON10=1e-10;lt.EPSILON11=1e-11;lt.EPSILON12=1e-12;lt.EPSILON13=1e-13;lt.EPSILON14=1e-14;lt.EPSILON15=1e-15;lt.EPSILON16=1e-16;lt.EPSILON17=1e-17;lt.EPSILON18=1e-18;lt.EPSILON19=1e-19;lt.EPSILON20=1e-20;lt.EPSILON21=1e-21;lt.GRAVITATIONALPARAMETER=3986004418e5;lt.SOLAR_RADIUS=6955e5;lt.LUNAR_RADIUS=1737400;lt.SIXTY_FOUR_KILOBYTES=64*1024;lt.FOUR_GIGABYTES=4*1024*1024*1024;lt.sign=g(Math.sign,function(t){return t=+t,t===0||t!==t?t:t>0?1:-1});lt.signNotZero=function(e){return e<0?-1:1};lt.toSNorm=function(e,t){return t=g(t,255),Math.round((lt.clamp(e,-1,1)*.5+.5)*t)};lt.fromSNorm=function(e,t){return t=g(t,255),lt.clamp(e,0,t)/t*2-1};lt.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:lt.clamp((e-t)/n,0,1)};lt.sinh=g(Math.sinh,function(t){return(Math.exp(t)-Math.exp(-t))/2});lt.cosh=g(Math.cosh,function(t){return(Math.exp(t)+Math.exp(-t))/2});lt.lerp=function(e,t,n){return(1-n)*e+n*t};lt.PI=Math.PI;lt.ONE_OVER_PI=1/Math.PI;lt.PI_OVER_TWO=Math.PI/2;lt.PI_OVER_THREE=Math.PI/3;lt.PI_OVER_FOUR=Math.PI/4;lt.PI_OVER_SIX=Math.PI/6;lt.THREE_PI_OVER_TWO=3*Math.PI/2;lt.TWO_PI=2*Math.PI;lt.ONE_OVER_TWO_PI=1/(2*Math.PI);lt.RADIANS_PER_DEGREE=Math.PI/180;lt.DEGREES_PER_RADIAN=180/Math.PI;lt.RADIANS_PER_ARCSECOND=lt.RADIANS_PER_DEGREE/3600;lt.toRadians=function(e){return e*lt.RADIANS_PER_DEGREE};lt.toDegrees=function(e){return e*lt.DEGREES_PER_RADIAN};lt.convertLongitudeRange=function(e){let t=lt.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};lt.clampToLatitudeRange=function(e){return lt.clamp(e,-1*lt.PI_OVER_TWO,lt.PI_OVER_TWO)};lt.negativePiToPi=function(e){return e>=-lt.PI&&e<=lt.PI?e:lt.zeroToTwoPi(e+lt.PI)-lt.PI};lt.zeroToTwoPi=function(e){if(e>=0&&e<=lt.TWO_PI)return e;let t=lt.mod(e,lt.TWO_PI);return Math.abs(t)<lt.EPSILON14&&Math.abs(e)>lt.EPSILON14?lt.TWO_PI:t};lt.mod=function(e,t){return lt.sign(e)===lt.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t};lt.equalsEpsilon=function(e,t,n,i){n=g(n,0),i=g(i,n);let o=Math.abs(e-t);return o<=i||o<=n*Math.max(Math.abs(e),Math.abs(t))};lt.lessThan=function(e,t,n){return e-t<-n};lt.lessThanOrEquals=function(e,t,n){return e-t<n};lt.greaterThan=function(e,t,n){return e-t>n};lt.greaterThanOrEquals=function(e,t,n){return e-t>-n};var qA=[1];lt.factorial=function(e){let t=qA.length;if(e>=t){let n=qA[t-1];for(let i=t;i<=e;i++){let o=n*i;qA.push(o),n=o}}return qA[e]};lt.incrementWrap=function(e,t,n){return n=g(n,0),++e,e>t&&(e=n),e};lt.isPowerOfTwo=function(e){return e!==0&&(e&e-1)===0};lt.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};lt.previousPowerOfTwo=function(e){return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e|=e>>32,e=(e>>>0)-(e>>>1),e};lt.clamp=function(e,t,n){return e<t?t:e>n?n:e};var a6=new YB.default;lt.setRandomNumberSeed=function(e){a6=new YB.default(e)};lt.nextRandomNumber=function(){return a6.random()};lt.randomBetween=function(e,t){return lt.nextRandomNumber()*(t-e)+e};lt.acosClamped=function(e){return Math.acos(lt.clamp(e,-1,1))};lt.asinClamped=function(e){return Math.asin(lt.clamp(e,-1,1))};lt.chordLength=function(e,t){return 2*t*Math.sin(e*.5)};lt.logBase=function(e,t){return Math.log(e)/Math.log(t)};lt.cbrt=g(Math.cbrt,function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n});lt.log2=g(Math.log2,function(t){return Math.log(t)*Math.LOG2E});lt.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};lt.fastApproximateAtan=function(e){return e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};lt.fastApproximateAtan2=function(e,t){let n,i=Math.abs(e);n=Math.abs(t);let o=Math.max(i,n);n=Math.min(i,n);let r=n/o;return i=lt.fastApproximateAtan(r),i=Math.abs(t)>Math.abs(e)?lt.PI_OVER_TWO-i:i,i=e<0?lt.PI-i:i,i=t<0?-i:i,i};var W=lt;function Pt(e,t){this.x=g(e,0),this.y=g(t,0)}Pt.fromElements=function(e,t,n){return l(n)?(n.x=e,n.y=t,n):new Pt(e,t)};Pt.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t):new Pt(e.x,e.y)};Pt.fromCartesian3=Pt.clone;Pt.fromCartesian4=Pt.clone;Pt.packedLength=2;Pt.pack=function(e,t,n){return n=g(n,0),t[n++]=e.x,t[n]=e.y,t};Pt.unpack=function(e,t,n){return t=g(t,0),l(n)||(n=new Pt),n.x=e[t++],n.y=e[t],n};Pt.packArray=function(e,t){let n=e.length,i=n*2;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)Pt.pack(e[o],t,o*2);return t};Pt.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/2:t=new Array(n/2);for(let i=0;i<n;i+=2){let o=i/2;t[o]=Pt.unpack(e,i,t[o])}return t};Pt.fromArray=Pt.unpack;Pt.maximumComponent=function(e){return Math.max(e.x,e.y)};Pt.minimumComponent=function(e){return Math.min(e.x,e.y)};Pt.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n};Pt.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n};Pt.clamp=function(e,t,n,i){let o=W.clamp(e.x,t.x,n.x),r=W.clamp(e.y,t.y,n.y);return i.x=o,i.y=r,i};Pt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y};Pt.magnitude=function(e){return Math.sqrt(Pt.magnitudeSquared(e))};var $A=new Pt;Pt.distance=function(e,t){return Pt.subtract(e,t,$A),Pt.magnitude($A)};Pt.distanceSquared=function(e,t){return Pt.subtract(e,t,$A),Pt.magnitudeSquared($A)};Pt.normalize=function(e,t){let n=Pt.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t};Pt.dot=function(e,t){return e.x*t.x+e.y*t.y};Pt.cross=function(e,t){return e.x*t.y-e.y*t.x};Pt.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n};Pt.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n};Pt.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n};Pt.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n};Pt.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n};Pt.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n};Pt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t};Pt.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var c6=new Pt;Pt.lerp=function(e,t,n,i){return Pt.multiplyByScalar(t,n,c6),i=Pt.multiplyByScalar(e,1-n,i),Pt.add(c6,i,i)};var l6=new Pt,d6=new Pt;Pt.angleBetween=function(e,t){return Pt.normalize(e,l6),Pt.normalize(t,d6),W.acosClamped(Pt.dot(l6,d6))};var mSe=new Pt;Pt.mostOrthogonalAxis=function(e,t){let n=Pt.normalize(e,mSe);return Pt.abs(n,n),n.x<=n.y?t=Pt.clone(Pt.UNIT_X,t):t=Pt.clone(Pt.UNIT_Y,t),t};Pt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y};Pt.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]};Pt.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&W.equalsEpsilon(e.x,t.x,n,i)&&W.equalsEpsilon(e.y,t.y,n,i)};Pt.ZERO=Object.freeze(new Pt(0,0));Pt.ONE=Object.freeze(new Pt(1,1));Pt.UNIT_X=Object.freeze(new Pt(1,0));Pt.UNIT_Y=Object.freeze(new Pt(0,1));Pt.prototype.clone=function(e){return Pt.clone(this,e)};Pt.prototype.equals=function(e){return Pt.equals(this,e)};Pt.prototype.equalsEpsilon=function(e,t,n){return Pt.equalsEpsilon(this,e,t,n)};Pt.prototype.toString=function(){return`(${this.x}, ${this.y})`};var B=Pt;var rSt=T(S(),1);var KTt=T(S(),1);function et(e,t,n){this.x=g(e,0),this.y=g(t,0),this.z=g(n,0)}et.fromSpherical=function(e,t){l(t)||(t=new et);let n=e.clock,i=e.cone,o=g(e.magnitude,1),r=o*Math.sin(i);return t.x=r*Math.cos(n),t.y=r*Math.sin(n),t.z=o*Math.cos(i),t};et.fromElements=function(e,t,n,i){return l(i)?(i.x=e,i.y=t,i.z=n,i):new et(e,t,n)};et.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new et(e.x,e.y,e.z)};et.fromCartesian4=et.clone;et.packedLength=3;et.pack=function(e,t,n){return n=g(n,0),t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t};et.unpack=function(e,t,n){return t=g(t,0),l(n)||(n=new et),n.x=e[t++],n.y=e[t++],n.z=e[t],n};et.packArray=function(e,t){let n=e.length,i=n*3;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)et.pack(e[o],t,o*3);return t};et.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/3:t=new Array(n/3);for(let i=0;i<n;i+=3){let o=i/3;t[o]=et.unpack(e,i,t[o])}return t};et.fromArray=et.unpack;et.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)};et.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)};et.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n};et.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n};et.clamp=function(e,t,n,i){let o=W.clamp(e.x,t.x,n.x),r=W.clamp(e.y,t.y,n.y),s=W.clamp(e.z,t.z,n.z);return i.x=o,i.y=r,i.z=s,i};et.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z};et.magnitude=function(e){return Math.sqrt(et.magnitudeSquared(e))};var tM=new et;et.distance=function(e,t){return et.subtract(e,t,tM),et.magnitude(tM)};et.distanceSquared=function(e,t){return et.subtract(e,t,tM),et.magnitudeSquared(tM)};et.normalize=function(e,t){let n=et.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t};et.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z};et.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n};et.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n};et.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n};et.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n};et.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n};et.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n};et.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t};et.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 u6=new et;et.lerp=function(e,t,n,i){return et.multiplyByScalar(t,n,u6),i=et.multiplyByScalar(e,1-n,i),et.add(u6,i,i)};var eM=new et,HB=new et;et.angleBetween=function(e,t){et.normalize(e,eM),et.normalize(t,HB);let n=et.dot(eM,HB),i=et.magnitude(et.cross(eM,HB,eM));return Math.atan2(i,n)};var hSe=new et;et.mostOrthogonalAxis=function(e,t){let n=et.normalize(e,hSe);return et.abs(n,n),n.x<=n.y?n.x<=n.z?t=et.clone(et.UNIT_X,t):t=et.clone(et.UNIT_Z,t):n.y<=n.z?t=et.clone(et.UNIT_Y,t):t=et.clone(et.UNIT_Z,t),t};et.projectVector=function(e,t,n){let i=et.dot(e,t)/et.dot(t,t);return et.multiplyByScalar(t,i,n)};et.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z};et.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]};et.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&W.equalsEpsilon(e.x,t.x,n,i)&&W.equalsEpsilon(e.y,t.y,n,i)&&W.equalsEpsilon(e.z,t.z,n,i)};et.cross=function(e,t,n){let i=e.x,o=e.y,r=e.z,s=t.x,a=t.y,c=t.z,d=o*c-r*a,u=r*s-i*c,m=i*a-o*s;return n.x=d,n.y=u,n.z=m,n};et.midpoint=function(e,t,n){return n.x=(e.x+t.x)*.5,n.y=(e.y+t.y)*.5,n.z=(e.z+t.z)*.5,n};et.fromDegrees=function(e,t,n,i,o){return e=W.toRadians(e),t=W.toRadians(t),et.fromRadians(e,t,n,i,o)};var qd=new et,xS=new et,fSe=new et(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);et.fromRadians=function(e,t,n,i,o){n=g(n,0);let r=l(i)?i.radiiSquared:fSe,s=Math.cos(t);qd.x=s*Math.cos(e),qd.y=s*Math.sin(e),qd.z=Math.sin(t),qd=et.normalize(qd,qd),et.multiplyComponents(r,qd,xS);let a=Math.sqrt(et.dot(qd,xS));return xS=et.divideByScalar(xS,a,xS),qd=et.multiplyByScalar(qd,n,qd),l(o)||(o=new et),et.add(xS,qd,o)};et.fromDegreesArray=function(e,t,n){let i=e.length;l(n)?n.length=i/2:n=new Array(i/2);for(let o=0;o<i;o+=2){let r=e[o],s=e[o+1],a=o/2;n[a]=et.fromDegrees(r,s,0,t,n[a])}return n};et.fromRadiansArray=function(e,t,n){let i=e.length;l(n)?n.length=i/2:n=new Array(i/2);for(let o=0;o<i;o+=2){let r=e[o],s=e[o+1],a=o/2;n[a]=et.fromRadians(r,s,0,t,n[a])}return n};et.fromDegreesArrayHeights=function(e,t,n){let i=e.length;l(n)?n.length=i/3:n=new Array(i/3);for(let o=0;o<i;o+=3){let r=e[o],s=e[o+1],a=e[o+2],c=o/3;n[c]=et.fromDegrees(r,s,a,t,n[c])}return n};et.fromRadiansArrayHeights=function(e,t,n){let i=e.length;l(n)?n.length=i/3:n=new Array(i/3);for(let o=0;o<i;o+=3){let r=e[o],s=e[o+1],a=e[o+2],c=o/3;n[c]=et.fromRadians(r,s,a,t,n[c])}return n};et.ZERO=Object.freeze(new et(0,0,0));et.ONE=Object.freeze(new et(1,1,1));et.UNIT_X=Object.freeze(new et(1,0,0));et.UNIT_Y=Object.freeze(new et(0,1,0));et.UNIT_Z=Object.freeze(new et(0,0,1));et.prototype.clone=function(e){return et.clone(this,e)};et.prototype.equals=function(e){return et.equals(this,e)};et.prototype.equalsEpsilon=function(e,t,n){return et.equalsEpsilon(this,e,t,n)};et.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};var h=et;var qTt=T(S(),1);var pSe=new h,bSe=new h;function ySe(e,t,n,i,o){let r=e.x,s=e.y,a=e.z,c=t.x,d=t.y,u=t.z,m=r*r*c*c,p=s*s*d*d,y=a*a*u*u,f=m+p+y,x=Math.sqrt(1/f),_=h.multiplyByScalar(e,x,pSe);if(f<i)return isFinite(x)?h.clone(_,o):void 0;let C=n.x,V=n.y,L=n.z,Z=bSe;Z.x=_.x*C*2,Z.y=_.y*V*2,Z.z=_.z*L*2;let G=(1-x)*h.magnitude(e)/(.5*h.magnitude(Z)),I=0,P,v,F,M,b,R,E,X,w,N,D;do{G-=I,F=1/(1+G*C),M=1/(1+G*V),b=1/(1+G*L),R=F*F,E=M*M,X=b*b,w=R*F,N=E*M,D=X*b,P=m*R+p*E+y*X-1,v=m*w*C+p*N*V+y*D*L;let k=-2*v;I=P/k}while(Math.abs(P)>W.EPSILON12);return l(o)?(o.x=r*F,o.y=s*M,o.z=a*b,o):new h(r*F,s*M,a*b)}var Ng=ySe;function is(e,t,n){this.longitude=g(e,0),this.latitude=g(t,0),this.height=g(n,0)}is.fromRadians=function(e,t,n,i){return n=g(n,0),l(i)?(i.longitude=e,i.latitude=t,i.height=n,i):new is(e,t,n)};is.fromDegrees=function(e,t,n,i){return e=W.toRadians(e),t=W.toRadians(t),is.fromRadians(e,t,n,i)};var gSe=new h,xSe=new h,_Se=new h,TSe=new h(1/6378137,1/6378137,1/6356752314245179e-9),SSe=new h(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9)),CSe=W.EPSILON1;is.fromCartesian=function(e,t,n){let i=l(t)?t.oneOverRadii:TSe,o=l(t)?t.oneOverRadiiSquared:SSe,r=l(t)?t._centerToleranceSquared:CSe,s=Ng(e,i,o,r,xSe);if(!l(s))return;let a=h.multiplyComponents(s,o,gSe);a=h.normalize(a,a);let c=h.subtract(e,s,_Se),d=Math.atan2(a.y,a.x),u=Math.asin(a.z),m=W.sign(h.dot(c,e))*h.magnitude(c);return l(n)?(n.longitude=d,n.latitude=u,n.height=m,n):new is(d,u,m)};is.toCartesian=function(e,t,n){return h.fromRadians(e.longitude,e.latitude,e.height,t,n)};is.clone=function(e,t){if(l(e))return l(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new is(e.longitude,e.latitude,e.height)};is.equals=function(e,t){return e===t||l(e)&&l(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height};is.equalsEpsilon=function(e,t,n){return n=g(n,0),e===t||l(e)&&l(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n};is.ZERO=Object.freeze(new is(0,0,0));is.prototype.clone=function(e){return is.clone(this,e)};is.prototype.equals=function(e){return is.equals(this,e)};is.prototype.equalsEpsilon=function(e,t){return is.equalsEpsilon(this,e,t)};is.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var he=is;var TSt=T(S(),1);var fSt=T(S(),1);function h6(e,t,n,i){t=g(t,0),n=g(n,0),i=g(i,0),e._radii=new h(t,n,i),e._radiiSquared=new h(t*t,n*n,i*i),e._radiiToTheFourth=new h(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new h(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new h(t===0?0:1/(t*t),n===0?0:1/(n*n),i===0?0:1/(i*i)),e._minimumRadius=Math.min(t,n,i),e._maximumRadius=Math.max(t,n,i),e._centerToleranceSquared=W.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function qi(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,h6(this,e,t,n)}Object.defineProperties(qi.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}}});qi.clone=function(e,t){if(!l(e))return;let n=e._radii;return l(t)?(h.clone(n,t._radii),h.clone(e._radiiSquared,t._radiiSquared),h.clone(e._radiiToTheFourth,t._radiiToTheFourth),h.clone(e._oneOverRadii,t._oneOverRadii),h.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new qi(n.x,n.y,n.z)};qi.fromCartesian3=function(e,t){return l(t)||(t=new qi),l(e)&&h6(t,e.x,e.y,e.z),t};qi.WGS84=Object.freeze(new qi(6378137,6378137,6356752314245179e-9));qi.UNIT_SPHERE=Object.freeze(new qi(1,1,1));qi.MOON=Object.freeze(new qi(W.LUNAR_RADIUS,W.LUNAR_RADIUS,W.LUNAR_RADIUS));qi.prototype.clone=function(e){return qi.clone(this,e)};qi.packedLength=h.packedLength;qi.pack=function(e,t,n){return n=g(n,0),h.pack(e._radii,t,n),t};qi.unpack=function(e,t,n){t=g(t,0);let i=h.unpack(e,t);return qi.fromCartesian3(i,n)};qi.prototype.geocentricSurfaceNormal=h.normalize;qi.prototype.geodeticSurfaceNormalCartographic=function(e,t){let n=e.longitude,i=e.latitude,o=Math.cos(i),r=o*Math.cos(n),s=o*Math.sin(n),a=Math.sin(i);return l(t)||(t=new h),t.x=r,t.y=s,t.z=a,h.normalize(t,t)};qi.prototype.geodeticSurfaceNormal=function(e,t){if(!h.equalsEpsilon(e,h.ZERO,W.EPSILON14))return l(t)||(t=new h),t=h.multiplyComponents(e,this._oneOverRadiiSquared,t),h.normalize(t,t)};var VSe=new h,LSe=new h;qi.prototype.cartographicToCartesian=function(e,t){let n=VSe,i=LSe;this.geodeticSurfaceNormalCartographic(e,n),h.multiplyComponents(this._radiiSquared,n,i);let o=Math.sqrt(h.dot(n,i));return h.divideByScalar(i,o,i),h.multiplyByScalar(n,e.height,n),l(t)||(t=new h),h.add(i,n,t)};qi.prototype.cartographicArrayToCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var RSe=new h,ZSe=new h,GSe=new h;qi.prototype.cartesianToCartographic=function(e,t){let n=this.scaleToGeodeticSurface(e,ZSe);if(!l(n))return;let i=this.geodeticSurfaceNormal(n,RSe),o=h.subtract(e,n,GSe),r=Math.atan2(i.y,i.x),s=Math.asin(i.z),a=W.sign(h.dot(o,e))*h.magnitude(o);return l(t)?(t.longitude=r,t.latitude=s,t.height=a,t):new he(r,s,a)};qi.prototype.cartesianArrayToCartographicArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t};qi.prototype.scaleToGeodeticSurface=function(e,t){return Ng(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)};qi.prototype.scaleToGeocentricSurface=function(e,t){l(t)||(t=new h);let n=e.x,i=e.y,o=e.z,r=this._oneOverRadiiSquared,s=1/Math.sqrt(n*n*r.x+i*i*r.y+o*o*r.z);return h.multiplyByScalar(e,s,t)};qi.prototype.transformPositionToScaledSpace=function(e,t){return l(t)||(t=new h),h.multiplyComponents(e,this._oneOverRadii,t)};qi.prototype.transformPositionFromScaledSpace=function(e,t){return l(t)||(t=new h),h.multiplyComponents(e,this._radii,t)};qi.prototype.equals=function(e){return this===e||l(e)&&h.equals(this._radii,e._radii)};qi.prototype.toString=function(){return this._radii.toString()};qi.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,n){t=g(t,0);let i=this._squaredXOverSquaredZ;if(l(n)||(n=new h),n.x=0,n.y=0,n.z=e.z*(1-i),!(Math.abs(n.z)>=this._radii.z-t))return n};var ESe=new h;qi.prototype.getLocalCurvature=function(e,t){l(t)||(t=new B);let n=this.getSurfaceNormalIntersectionWithZAxis(e,0,ESe),i=h.distance(e,n),o=this.minimumRadius*i/this.maximumRadius**2,r=i*o**2;return B.fromElements(1/i,1/r,t)};var ISe=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],XSe=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function m6(e,t,n){let i=.5*(t+e),o=.5*(t-e),r=0;for(let s=0;s<5;s++){let a=o*ISe[s];r+=XSe[s]*(n(i+a)+n(i-a))}return r*=o,r}qi.prototype.surfaceArea=function(e){let t=e.west,n=e.east,i=e.south,o=e.north;for(;n<t;)n+=W.TWO_PI;let r=this._radiiSquared,s=r.x,a=r.y,c=r.z,d=s*a;return m6(i,o,function(u){let m=Math.cos(u),p=Math.sin(u);return Math.cos(u)*m6(t,n,function(y){let f=Math.cos(y),x=Math.sin(y);return Math.sqrt(d*p*p+c*(a*f*f+s*x*x)*m*m)})})};var oe=qi;function nM(e){this._ellipsoid=g(e,oe.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(nM.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});nM.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=e.latitude*n,r=e.height;return l(t)?(t.x=i,t.y=o,t.z=r,t):new h(i,o,r)};nM.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,o=e.y*n,r=e.z;return l(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new he(i,o,r)};var Ri=nM;var CSt=T(S(),1),WSe={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},nn=Object.freeze(WSe);var ISt=T(S(),1);function kn(e,t,n,i){this.west=g(e,0),this.south=g(t,0),this.east=g(n,0),this.north=g(i,0)}Object.defineProperties(kn.prototype,{width:{get:function(){return kn.computeWidth(this)}},height:{get:function(){return kn.computeHeight(this)}}});kn.packedLength=4;kn.pack=function(e,t,n){return n=g(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t};kn.unpack=function(e,t,n){return t=g(t,0),l(n)||(n=new kn),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};kn.computeWidth=function(e){let t=e.east,n=e.west;return t<n&&(t+=W.TWO_PI),t-n};kn.computeHeight=function(e){return e.north-e.south};kn.fromDegrees=function(e,t,n,i,o){return e=W.toRadians(g(e,0)),t=W.toRadians(g(t,0)),n=W.toRadians(g(n,0)),i=W.toRadians(g(i,0)),l(o)?(o.west=e,o.south=t,o.east=n,o.north=i,o):new kn(e,t,n,i)};kn.fromRadians=function(e,t,n,i,o){return l(o)?(o.west=g(e,0),o.south=g(t,0),o.east=g(n,0),o.north=g(i,0),o):new kn(e,t,n,i)};kn.fromCartographicArray=function(e,t){let n=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,r=-Number.MAX_VALUE,s=Number.MAX_VALUE,a=-Number.MAX_VALUE;for(let c=0,d=e.length;c<d;c++){let u=e[c];n=Math.min(n,u.longitude),i=Math.max(i,u.longitude),s=Math.min(s,u.latitude),a=Math.max(a,u.latitude);let m=u.longitude>=0?u.longitude:u.longitude+W.TWO_PI;o=Math.min(o,m),r=Math.max(r,m)}return i-n>r-o&&(n=o,i=r,i>W.PI&&(i=i-W.TWO_PI),n>W.PI&&(n=n-W.TWO_PI)),l(t)?(t.west=n,t.south=s,t.east=i,t.north=a,t):new kn(n,s,i,a)};kn.fromCartesianArray=function(e,t,n){t=g(t,oe.WGS84);let i=Number.MAX_VALUE,o=-Number.MAX_VALUE,r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let d=0,u=e.length;d<u;d++){let m=t.cartesianToCartographic(e[d]);i=Math.min(i,m.longitude),o=Math.max(o,m.longitude),a=Math.min(a,m.latitude),c=Math.max(c,m.latitude);let p=m.longitude>=0?m.longitude:m.longitude+W.TWO_PI;r=Math.min(r,p),s=Math.max(s,p)}return o-i>s-r&&(i=r,o=s,o>W.PI&&(o=o-W.TWO_PI),i>W.PI&&(i=i-W.TWO_PI)),l(n)?(n.west=i,n.south=a,n.east=o,n.north=c,n):new kn(i,a,o,c)};kn.clone=function(e,t){if(l(e))return l(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new kn(e.west,e.south,e.east,e.north)};kn.equalsEpsilon=function(e,t,n){return n=g(n,0),e===t||l(e)&&l(t)&&Math.abs(e.west-t.west)<=n&&Math.abs(e.south-t.south)<=n&&Math.abs(e.east-t.east)<=n&&Math.abs(e.north-t.north)<=n};kn.prototype.clone=function(e){return kn.clone(this,e)};kn.prototype.equals=function(e){return kn.equals(this,e)};kn.equals=function(e,t){return e===t||l(e)&&l(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north};kn.prototype.equalsEpsilon=function(e,t){return kn.equalsEpsilon(this,e,t)};kn.validate=function(e){};kn.southwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new he(e.west,e.south)};kn.northwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new he(e.west,e.north)};kn.northeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new he(e.east,e.north)};kn.southeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new he(e.east,e.south)};kn.center=function(e,t){let n=e.east,i=e.west;n<i&&(n+=W.TWO_PI);let o=W.negativePiToPi((i+n)*.5),r=(e.south+e.north)*.5;return l(t)?(t.longitude=o,t.latitude=r,t.height=0,t):new he(o,r)};kn.intersection=function(e,t,n){let i=e.east,o=e.west,r=t.east,s=t.west;i<o&&r>0?i+=W.TWO_PI:r<s&&i>0&&(r+=W.TWO_PI),i<o&&s<0?s+=W.TWO_PI:r<s&&o<0&&(o+=W.TWO_PI);let a=W.negativePiToPi(Math.max(o,s)),c=W.negativePiToPi(Math.min(i,r));if((e.west<e.east||t.west<t.east)&&c<=a)return;let d=Math.max(e.south,t.south),u=Math.min(e.north,t.north);if(!(d>=u))return l(n)?(n.west=a,n.south=d,n.east=c,n.north=u,n):new kn(a,d,c,u)};kn.simpleIntersection=function(e,t,n){let i=Math.max(e.west,t.west),o=Math.max(e.south,t.south),r=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(o>=s||i>=r))return l(n)?(n.west=i,n.south=o,n.east=r,n.north=s,n):new kn(i,o,r,s)};kn.union=function(e,t,n){l(n)||(n=new kn);let i=e.east,o=e.west,r=t.east,s=t.west;i<o&&r>0?i+=W.TWO_PI:r<s&&i>0&&(r+=W.TWO_PI),i<o&&s<0?s+=W.TWO_PI:r<s&&o<0&&(o+=W.TWO_PI);let a=W.negativePiToPi(Math.min(o,s)),c=W.negativePiToPi(Math.max(i,r));return n.west=a,n.south=Math.min(e.south,t.south),n.east=c,n.north=Math.max(e.north,t.north),n};kn.expand=function(e,t,n){return l(n)||(n=new kn),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n};kn.contains=function(e,t){let n=t.longitude,i=t.latitude,o=e.west,r=e.east;return r<o&&(r+=W.TWO_PI,n<0&&(n+=W.TWO_PI)),(n>o||W.equalsEpsilon(n,o,W.EPSILON14))&&(n<r||W.equalsEpsilon(n,r,W.EPSILON14))&&i>=e.south&&i<=e.north};var PSe=new he;kn.subsample=function(e,t,n,i){t=g(t,oe.WGS84),n=g(n,0),l(i)||(i=[]);let o=0,r=e.north,s=e.south,a=e.east,c=e.west,d=PSe;d.height=n,d.longitude=c,d.latitude=r,i[o]=t.cartographicToCartesian(d,i[o]),o++,d.longitude=a,i[o]=t.cartographicToCartesian(d,i[o]),o++,d.latitude=s,i[o]=t.cartographicToCartesian(d,i[o]),o++,d.longitude=c,i[o]=t.cartographicToCartesian(d,i[o]),o++,r<0?d.latitude=r:s>0?d.latitude=s:d.latitude=0;for(let u=1;u<8;++u)d.longitude=-Math.PI+u*W.PI_OVER_TWO,kn.contains(e,d)&&(i[o]=t.cartographicToCartesian(d,i[o]),o++);return d.latitude===0&&(d.longitude=c,i[o]=t.cartographicToCartesian(d,i[o]),o++,d.longitude=a,i[o]=t.cartographicToCartesian(d,i[o]),o++),i.length=o,i};kn.subsection=function(e,t,n,i,o,r){if(l(r)||(r=new kn),e.west<=e.east){let a=e.east-e.west;r.west=e.west+t*a,r.east=e.west+i*a}else{let a=W.TWO_PI+e.east-e.west;r.west=W.negativePiToPi(e.west+t*a),r.east=W.negativePiToPi(e.west+i*a)}let s=e.north-e.south;return r.south=e.south+n*s,r.north=e.south+o*s,t===1&&(r.west=e.east),i===1&&(r.east=e.east),n===1&&(r.south=e.north),o===1&&(r.north=e.north),r};kn.MAX_VALUE=Object.freeze(new kn(-Math.PI,-W.PI_OVER_TWO,Math.PI,W.PI_OVER_TWO));var de=kn;function Sr(e,t,n,i){this.x=g(e,0),this.y=g(t,0),this.width=g(n,0),this.height=g(i,0)}Sr.packedLength=4;Sr.pack=function(e,t,n){return n=g(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t};Sr.unpack=function(e,t,n){return t=g(t,0),l(n)||(n=new Sr),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};Sr.fromPoints=function(e,t){if(l(t)||(t=new Sr),!l(e)||e.length===0)return t.x=0,t.y=0,t.width=0,t.height=0,t;let n=e.length,i=e[0].x,o=e[0].y,r=e[0].x,s=e[0].y;for(let a=1;a<n;a++){let c=e[a],d=c.x,u=c.y;i=Math.min(d,i),r=Math.max(d,r),o=Math.min(u,o),s=Math.max(u,s)}return t.x=i,t.y=o,t.width=r-i,t.height=s-o,t};var vSe=new Ri,wSe=new he,FSe=new he;Sr.fromRectangle=function(e,t,n){if(l(n)||(n=new Sr),!l(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;t=g(t,vSe);let i=t.project(de.southwest(e,wSe)),o=t.project(de.northeast(e,FSe));return B.subtract(o,i,o),n.x=i.x,n.y=i.y,n.width=o.x,n.height=o.y,n};Sr.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new Sr(e.x,e.y,e.width,e.height)};Sr.union=function(e,t,n){l(n)||(n=new Sr);let i=Math.min(e.x,t.x),o=Math.min(e.y,t.y),r=Math.max(e.x+e.width,t.x+t.width),s=Math.max(e.y+e.height,t.y+t.height);return n.x=i,n.y=o,n.width=r-i,n.height=s-o,n};Sr.expand=function(e,t,n){n=Sr.clone(e,n);let i=t.x-n.x,o=t.y-n.y;return i>n.width?n.width=i:i<0&&(n.width-=i,n.x=t.x),o>n.height?n.height=o:o<0&&(n.height-=o,n.y=t.y),n};Sr.intersect=function(e,t){let n=e.x,i=e.y,o=t.x,r=t.y;return n>o+t.width||n+e.width<o||i+e.height<r||i>r+t.height?nn.OUTSIDE:nn.INTERSECTING};Sr.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height};Sr.prototype.clone=function(e){return Sr.clone(this,e)};Sr.prototype.intersect=function(e){return Sr.intersect(this,e)};Sr.prototype.equals=function(e){return Sr.equals(this,e)};var De=Sr;var $St=T(S(),1);var KSt=T(S(),1);var DSt=T(S(),1);var mb,Cr={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},ml={};Object.defineProperties(ml,{element:{get:function(){if(ml.supportsFullscreen())return document[Cr.fullscreenElement]}},changeEventName:{get:function(){if(ml.supportsFullscreen())return Cr.fullscreenchange}},errorEventName:{get:function(){if(ml.supportsFullscreen())return Cr.fullscreenerror}},enabled:{get:function(){if(ml.supportsFullscreen())return document[Cr.fullscreenEnabled]}},fullscreen:{get:function(){if(ml.supportsFullscreen())return ml.element!==null}}});ml.supportsFullscreen=function(){if(l(mb))return mb;mb=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return Cr.requestFullscreen="requestFullscreen",Cr.exitFullscreen="exitFullscreen",Cr.fullscreenEnabled="fullscreenEnabled",Cr.fullscreenElement="fullscreenElement",Cr.fullscreenchange="fullscreenchange",Cr.fullscreenerror="fullscreenerror",mb=!0,mb;let t=["webkit","moz","o","ms","khtml"],n;for(let i=0,o=t.length;i<o;++i){let r=t[i];n=`${r}RequestFullscreen`,typeof e[n]=="function"?(Cr.requestFullscreen=n,mb=!0):(n=`${r}RequestFullScreen`,typeof e[n]=="function"&&(Cr.requestFullscreen=n,mb=!0)),n=`${r}ExitFullscreen`,typeof document[n]=="function"?Cr.exitFullscreen=n:(n=`${r}CancelFullScreen`,typeof document[n]=="function"&&(Cr.exitFullscreen=n)),n=`${r}FullscreenEnabled`,document[n]!==void 0?Cr.fullscreenEnabled=n:(n=`${r}FullScreenEnabled`,document[n]!==void 0&&(Cr.fullscreenEnabled=n)),n=`${r}FullscreenElement`,document[n]!==void 0?Cr.fullscreenElement=n:(n=`${r}FullScreenElement`,document[n]!==void 0&&(Cr.fullscreenElement=n)),n=`${r}fullscreenchange`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenChange"),Cr.fullscreenchange=n),n=`${r}fullscreenerror`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenError"),Cr.fullscreenerror=n)}return mb};ml.requestFullscreen=function(e,t){ml.supportsFullscreen()&&e[Cr.requestFullscreen]({vrDisplay:t})};ml.exitFullscreen=function(){ml.supportsFullscreen()&&document[Cr.exitFullscreen]()};ml._names=Cr;var pr=ml;var Ba;typeof navigator<"u"?Ba=navigator:Ba={};function Ug(e){let t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}var iM,f6;function qB(){if(!l(iM)&&(iM=!1,!lM())){let e=/ Chrome\/([\.0-9]+)/.exec(Ba.userAgent);e!==null&&(iM=!0,f6=Ug(e[1]))}return iM}function ASe(){return qB()&&f6}var oM,p6;function b6(){if(!l(oM)&&(oM=!1,!qB()&&!lM()&&/ Safari\/[\.0-9]+/.test(Ba.userAgent))){let e=/ Version\/([\.0-9]+)/.exec(Ba.userAgent);e!==null&&(oM=!0,p6=Ug(e[1]))}return oM}function MSe(){return b6()&&p6}var rM,QB;function y6(){if(!l(rM)){rM=!1;let e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(Ba.userAgent);e!==null&&(rM=!0,QB=Ug(e[1]),QB.isNightly=!!e[2])}return rM}function NSe(){return y6()&&QB}var VL,jB;function g6(){if(!l(VL)){VL=!1;let e;Ba.appName==="Microsoft Internet Explorer"?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(Ba.userAgent),e!==null&&(VL=!0,jB=Ug(e[1]))):Ba.appName==="Netscape"&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(Ba.userAgent),e!==null&&(VL=!0,jB=Ug(e[1])))}return VL}function USe(){return g6()&&jB}var sM,x6;function lM(){if(!l(sM)){sM=!1;let e=/ Edg\/([\.0-9]+)/.exec(Ba.userAgent);e!==null&&(sM=!0,x6=Ug(e[1]))}return sM}function kSe(){return lM()&&x6}var aM,$B;function dM(){if(!l(aM)){aM=!1;let e=/Firefox\/([\.0-9]+)/.exec(Ba.userAgent);e!==null&&(aM=!0,$B=Ug(e[1]))}return aM}var KB;function DSe(){return l(KB)||(KB=/Windows/i.test(Ba.appVersion)),KB}var zB;function BSe(){return l(zB)||(zB=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),zB}function OSe(){return dM()&&$B}var JB;function YSe(){return l(JB)||(JB=!dM()&&typeof PointerEvent<"u"&&(!l(Ba.pointerEnabled)||Ba.pointerEnabled)),JB}var _6,cM;function T6(){if(!l(cM)){let e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let t=e.style.imageRendering;cM=l(t)&&t!=="",cM&&(_6=t)}return cM}function HSe(){return T6()?_6:void 0}function Ec(){return Ec._result}Ec._promise=void 0;Ec._result=void 0;Ec.initialize=function(){return l(Ec._promise)||(Ec._promise=new Promise(e=>{let t=new Image;t.onload=function(){Ec._result=t.width>0&&t.height>0,e(Ec._result)},t.onerror=function(){Ec._result=!1,e(Ec._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),Ec._promise};Object.defineProperties(Ec,{initialized:{get:function(){return l(Ec._result)}}});var _S=[];typeof ArrayBuffer<"u"&&(_S.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&_S.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&_S.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&_S.push(BigInt64Array),typeof BigUint64Array<"u"&&_S.push(BigUint64Array));var $d={isChrome:qB,chromeVersion:ASe,isSafari:b6,safariVersion:MSe,isWebkit:y6,webkitVersion:NSe,isInternetExplorer:g6,internetExplorerVersion:USe,isEdge:lM,edgeVersion:kSe,isFirefox:dM,firefoxVersion:OSe,isWindows:DSe,isIPadOrIOS:BSe,hardwareConcurrency:g(Ba.hardwareConcurrency,3),supportsPointerEvents:YSe,supportsImageRenderingPixelated:T6,supportsWebP:Ec,imageRenderingValue:HSe,typedArrayTypes:_S};$d.supportsBasis=function(e){return $d.supportsWebAssembly()&&e.context.supportsBasis};$d.supportsFullscreen=function(){return pr.supportsFullscreen()};$d.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};$d.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};$d.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};$d.supportsBigInt=function(){return typeof BigInt<"u"};$d.supportsWebWorkers=function(){return typeof Worker<"u"};$d.supportsWebAssembly=function(){return typeof WebAssembly<"u"};$d.supportsWebgl2=function(e){return e.context.webgl2};$d.supportsEsmWebWorkers=function(){return!dM()||parseInt($B)>=114};var Bt=$d;function e3(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n*6<1?e+(t-e)*6*n:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}function re(e,t,n,i){this.red=g(e,1),this.green=g(t,1),this.blue=g(n,1),this.alpha=g(i,1)}re.fromCartesian4=function(e,t){return l(t)?(t.red=e.x,t.green=e.y,t.blue=e.z,t.alpha=e.w,t):new re(e.x,e.y,e.z,e.w)};re.fromBytes=function(e,t,n,i,o){return e=re.byteToFloat(g(e,255)),t=re.byteToFloat(g(t,255)),n=re.byteToFloat(g(n,255)),i=re.byteToFloat(g(i,255)),l(o)?(o.red=e,o.green=t,o.blue=n,o.alpha=i,o):new re(e,t,n,i)};re.fromAlpha=function(e,t,n){return l(n)?(n.red=e.red,n.green=e.green,n.blue=e.blue,n.alpha=t,n):new re(e.red,e.green,e.blue,t)};var t3,n3,rp;Bt.supportsTypedArrays()&&(t3=new ArrayBuffer(4),n3=new Uint32Array(t3),rp=new Uint8Array(t3));re.fromRgba=function(e,t){return n3[0]=e,re.fromBytes(rp[0],rp[1],rp[2],rp[3],t)};re.fromHsl=function(e,t,n,i,o){e=g(e,0)%1,t=g(t,0),n=g(n,0),i=g(i,1);let r=n,s=n,a=n;if(t!==0){let c;n<.5?c=n*(1+t):c=n+t-n*t;let d=2*n-c;r=e3(d,c,e+1/3),s=e3(d,c,e),a=e3(d,c,e-1/3)}return l(o)?(o.red=r,o.green=s,o.blue=a,o.alpha=i,o):new re(r,s,a,i)};re.fromRandom=function(e,t){e=g(e,g.EMPTY_OBJECT);let n=e.red;if(!l(n)){let s=g(e.minimumRed,0),a=g(e.maximumRed,1);n=s+W.nextRandomNumber()*(a-s)}let i=e.green;if(!l(i)){let s=g(e.minimumGreen,0),a=g(e.maximumGreen,1);i=s+W.nextRandomNumber()*(a-s)}let o=e.blue;if(!l(o)){let s=g(e.minimumBlue,0),a=g(e.maximumBlue,1);o=s+W.nextRandomNumber()*(a-s)}let r=e.alpha;if(!l(r)){let s=g(e.minimumAlpha,0),a=g(e.maximumAlpha,1);r=s+W.nextRandomNumber()*(a-s)}return l(t)?(t.red=n,t.green=i,t.blue=o,t.alpha=r,t):new re(n,i,o,r)};var KSe=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,zSe=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,JSe=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,QSe=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;re.fromCssColorString=function(e,t){l(t)||(t=new re),e=e.trim();let n=re[e.toUpperCase()];if(l(n))return re.clone(n,t),t;let i=KSe.exec(e);return i!==null?(t.red=parseInt(i[1],16)/15,t.green=parseInt(i[2],16)/15,t.blue=parseInt(i[3],16)/15,t.alpha=parseInt(g(i[4],"f"),16)/15,t):(i=zSe.exec(e),i!==null?(t.red=parseInt(i[1],16)/255,t.green=parseInt(i[2],16)/255,t.blue=parseInt(i[3],16)/255,t.alpha=parseInt(g(i[4],"ff"),16)/255,t):(i=JSe.exec(e),i!==null?(t.red=parseFloat(i[1])/(i[1].substr(-1)==="%"?100:255),t.green=parseFloat(i[2])/(i[2].substr(-1)==="%"?100:255),t.blue=parseFloat(i[3])/(i[3].substr(-1)==="%"?100:255),t.alpha=parseFloat(g(i[4],"1.0")),t):(i=QSe.exec(e),i!==null?re.fromHsl(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(g(i[4],"1.0")),t):(t=void 0,t))))};re.packedLength=4;re.pack=function(e,t,n){return n=g(n,0),t[n++]=e.red,t[n++]=e.green,t[n++]=e.blue,t[n]=e.alpha,t};re.unpack=function(e,t,n){return t=g(t,0),l(n)||(n=new re),n.red=e[t++],n.green=e[t++],n.blue=e[t++],n.alpha=e[t],n};re.byteToFloat=function(e){return e/255};re.floatToByte=function(e){return e===1?255:e*256|0};re.clone=function(e,t){if(l(e))return l(t)?(t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha,t):new re(e.red,e.green,e.blue,e.alpha)};re.equals=function(e,t){return e===t||l(e)&&l(t)&&e.red===t.red&&e.green===t.green&&e.blue===t.blue&&e.alpha===t.alpha};re.equalsArray=function(e,t,n){return e.red===t[n]&&e.green===t[n+1]&&e.blue===t[n+2]&&e.alpha===t[n+3]};re.prototype.clone=function(e){return re.clone(this,e)};re.prototype.equals=function(e){return re.equals(this,e)};re.prototype.equalsEpsilon=function(e,t){return this===e||l(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};re.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`};re.prototype.toCssColorString=function(){let e=re.floatToByte(this.red),t=re.floatToByte(this.green),n=re.floatToByte(this.blue);return this.alpha===1?`rgb(${e},${t},${n})`:`rgba(${e},${t},${n},${this.alpha})`};re.prototype.toCssHexString=function(){let e=re.floatToByte(this.red).toString(16);e.length<2&&(e=`0${e}`);let t=re.floatToByte(this.green).toString(16);t.length<2&&(t=`0${t}`);let n=re.floatToByte(this.blue).toString(16);if(n.length<2&&(n=`0${n}`),this.alpha<1){let i=re.floatToByte(this.alpha).toString(16);return i.length<2&&(i=`0${i}`),`#${e}${t}${n}${i}`}return`#${e}${t}${n}`};re.prototype.toBytes=function(e){let t=re.floatToByte(this.red),n=re.floatToByte(this.green),i=re.floatToByte(this.blue),o=re.floatToByte(this.alpha);return l(e)?(e[0]=t,e[1]=n,e[2]=i,e[3]=o,e):[t,n,i,o]};re.prototype.toRgba=function(){return rp[0]=re.floatToByte(this.red),rp[1]=re.floatToByte(this.green),rp[2]=re.floatToByte(this.blue),rp[3]=re.floatToByte(this.alpha),n3[0]};re.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};re.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};re.prototype.withAlpha=function(e,t){return re.fromAlpha(this,e,t)};re.add=function(e,t,n){return n.red=e.red+t.red,n.green=e.green+t.green,n.blue=e.blue+t.blue,n.alpha=e.alpha+t.alpha,n};re.subtract=function(e,t,n){return n.red=e.red-t.red,n.green=e.green-t.green,n.blue=e.blue-t.blue,n.alpha=e.alpha-t.alpha,n};re.multiply=function(e,t,n){return n.red=e.red*t.red,n.green=e.green*t.green,n.blue=e.blue*t.blue,n.alpha=e.alpha*t.alpha,n};re.divide=function(e,t,n){return n.red=e.red/t.red,n.green=e.green/t.green,n.blue=e.blue/t.blue,n.alpha=e.alpha/t.alpha,n};re.mod=function(e,t,n){return n.red=e.red%t.red,n.green=e.green%t.green,n.blue=e.blue%t.blue,n.alpha=e.alpha%t.alpha,n};re.lerp=function(e,t,n,i){return i.red=W.lerp(e.red,t.red,n),i.green=W.lerp(e.green,t.green,n),i.blue=W.lerp(e.blue,t.blue,n),i.alpha=W.lerp(e.alpha,t.alpha,n),i};re.multiplyByScalar=function(e,t,n){return n.red=e.red*t,n.green=e.green*t,n.blue=e.blue*t,n.alpha=e.alpha*t,n};re.divideByScalar=function(e,t,n){return n.red=e.red/t,n.green=e.green/t,n.blue=e.blue/t,n.alpha=e.alpha/t,n};re.ALICEBLUE=Object.freeze(re.fromCssColorString("#F0F8FF"));re.ANTIQUEWHITE=Object.freeze(re.fromCssColorString("#FAEBD7"));re.AQUA=Object.freeze(re.fromCssColorString("#00FFFF"));re.AQUAMARINE=Object.freeze(re.fromCssColorString("#7FFFD4"));re.AZURE=Object.freeze(re.fromCssColorString("#F0FFFF"));re.BEIGE=Object.freeze(re.fromCssColorString("#F5F5DC"));re.BISQUE=Object.freeze(re.fromCssColorString("#FFE4C4"));re.BLACK=Object.freeze(re.fromCssColorString("#000000"));re.BLANCHEDALMOND=Object.freeze(re.fromCssColorString("#FFEBCD"));re.BLUE=Object.freeze(re.fromCssColorString("#0000FF"));re.BLUEVIOLET=Object.freeze(re.fromCssColorString("#8A2BE2"));re.BROWN=Object.freeze(re.fromCssColorString("#A52A2A"));re.BURLYWOOD=Object.freeze(re.fromCssColorString("#DEB887"));re.CADETBLUE=Object.freeze(re.fromCssColorString("#5F9EA0"));re.CHARTREUSE=Object.freeze(re.fromCssColorString("#7FFF00"));re.CHOCOLATE=Object.freeze(re.fromCssColorString("#D2691E"));re.CORAL=Object.freeze(re.fromCssColorString("#FF7F50"));re.CORNFLOWERBLUE=Object.freeze(re.fromCssColorString("#6495ED"));re.CORNSILK=Object.freeze(re.fromCssColorString("#FFF8DC"));re.CRIMSON=Object.freeze(re.fromCssColorString("#DC143C"));re.CYAN=Object.freeze(re.fromCssColorString("#00FFFF"));re.DARKBLUE=Object.freeze(re.fromCssColorString("#00008B"));re.DARKCYAN=Object.freeze(re.fromCssColorString("#008B8B"));re.DARKGOLDENROD=Object.freeze(re.fromCssColorString("#B8860B"));re.DARKGRAY=Object.freeze(re.fromCssColorString("#A9A9A9"));re.DARKGREEN=Object.freeze(re.fromCssColorString("#006400"));re.DARKGREY=re.DARKGRAY;re.DARKKHAKI=Object.freeze(re.fromCssColorString("#BDB76B"));re.DARKMAGENTA=Object.freeze(re.fromCssColorString("#8B008B"));re.DARKOLIVEGREEN=Object.freeze(re.fromCssColorString("#556B2F"));re.DARKORANGE=Object.freeze(re.fromCssColorString("#FF8C00"));re.DARKORCHID=Object.freeze(re.fromCssColorString("#9932CC"));re.DARKRED=Object.freeze(re.fromCssColorString("#8B0000"));re.DARKSALMON=Object.freeze(re.fromCssColorString("#E9967A"));re.DARKSEAGREEN=Object.freeze(re.fromCssColorString("#8FBC8F"));re.DARKSLATEBLUE=Object.freeze(re.fromCssColorString("#483D8B"));re.DARKSLATEGRAY=Object.freeze(re.fromCssColorString("#2F4F4F"));re.DARKSLATEGREY=re.DARKSLATEGRAY;re.DARKTURQUOISE=Object.freeze(re.fromCssColorString("#00CED1"));re.DARKVIOLET=Object.freeze(re.fromCssColorString("#9400D3"));re.DEEPPINK=Object.freeze(re.fromCssColorString("#FF1493"));re.DEEPSKYBLUE=Object.freeze(re.fromCssColorString("#00BFFF"));re.DIMGRAY=Object.freeze(re.fromCssColorString("#696969"));re.DIMGREY=re.DIMGRAY;re.DODGERBLUE=Object.freeze(re.fromCssColorString("#1E90FF"));re.FIREBRICK=Object.freeze(re.fromCssColorString("#B22222"));re.FLORALWHITE=Object.freeze(re.fromCssColorString("#FFFAF0"));re.FORESTGREEN=Object.freeze(re.fromCssColorString("#228B22"));re.FUCHSIA=Object.freeze(re.fromCssColorString("#FF00FF"));re.GAINSBORO=Object.freeze(re.fromCssColorString("#DCDCDC"));re.GHOSTWHITE=Object.freeze(re.fromCssColorString("#F8F8FF"));re.GOLD=Object.freeze(re.fromCssColorString("#FFD700"));re.GOLDENROD=Object.freeze(re.fromCssColorString("#DAA520"));re.GRAY=Object.freeze(re.fromCssColorString("#808080"));re.GREEN=Object.freeze(re.fromCssColorString("#008000"));re.GREENYELLOW=Object.freeze(re.fromCssColorString("#ADFF2F"));re.GREY=re.GRAY;re.HONEYDEW=Object.freeze(re.fromCssColorString("#F0FFF0"));re.HOTPINK=Object.freeze(re.fromCssColorString("#FF69B4"));re.INDIANRED=Object.freeze(re.fromCssColorString("#CD5C5C"));re.INDIGO=Object.freeze(re.fromCssColorString("#4B0082"));re.IVORY=Object.freeze(re.fromCssColorString("#FFFFF0"));re.KHAKI=Object.freeze(re.fromCssColorString("#F0E68C"));re.LAVENDER=Object.freeze(re.fromCssColorString("#E6E6FA"));re.LAVENDAR_BLUSH=Object.freeze(re.fromCssColorString("#FFF0F5"));re.LAWNGREEN=Object.freeze(re.fromCssColorString("#7CFC00"));re.LEMONCHIFFON=Object.freeze(re.fromCssColorString("#FFFACD"));re.LIGHTBLUE=Object.freeze(re.fromCssColorString("#ADD8E6"));re.LIGHTCORAL=Object.freeze(re.fromCssColorString("#F08080"));re.LIGHTCYAN=Object.freeze(re.fromCssColorString("#E0FFFF"));re.LIGHTGOLDENRODYELLOW=Object.freeze(re.fromCssColorString("#FAFAD2"));re.LIGHTGRAY=Object.freeze(re.fromCssColorString("#D3D3D3"));re.LIGHTGREEN=Object.freeze(re.fromCssColorString("#90EE90"));re.LIGHTGREY=re.LIGHTGRAY;re.LIGHTPINK=Object.freeze(re.fromCssColorString("#FFB6C1"));re.LIGHTSEAGREEN=Object.freeze(re.fromCssColorString("#20B2AA"));re.LIGHTSKYBLUE=Object.freeze(re.fromCssColorString("#87CEFA"));re.LIGHTSLATEGRAY=Object.freeze(re.fromCssColorString("#778899"));re.LIGHTSLATEGREY=re.LIGHTSLATEGRAY;re.LIGHTSTEELBLUE=Object.freeze(re.fromCssColorString("#B0C4DE"));re.LIGHTYELLOW=Object.freeze(re.fromCssColorString("#FFFFE0"));re.LIME=Object.freeze(re.fromCssColorString("#00FF00"));re.LIMEGREEN=Object.freeze(re.fromCssColorString("#32CD32"));re.LINEN=Object.freeze(re.fromCssColorString("#FAF0E6"));re.MAGENTA=Object.freeze(re.fromCssColorString("#FF00FF"));re.MAROON=Object.freeze(re.fromCssColorString("#800000"));re.MEDIUMAQUAMARINE=Object.freeze(re.fromCssColorString("#66CDAA"));re.MEDIUMBLUE=Object.freeze(re.fromCssColorString("#0000CD"));re.MEDIUMORCHID=Object.freeze(re.fromCssColorString("#BA55D3"));re.MEDIUMPURPLE=Object.freeze(re.fromCssColorString("#9370DB"));re.MEDIUMSEAGREEN=Object.freeze(re.fromCssColorString("#3CB371"));re.MEDIUMSLATEBLUE=Object.freeze(re.fromCssColorString("#7B68EE"));re.MEDIUMSPRINGGREEN=Object.freeze(re.fromCssColorString("#00FA9A"));re.MEDIUMTURQUOISE=Object.freeze(re.fromCssColorString("#48D1CC"));re.MEDIUMVIOLETRED=Object.freeze(re.fromCssColorString("#C71585"));re.MIDNIGHTBLUE=Object.freeze(re.fromCssColorString("#191970"));re.MINTCREAM=Object.freeze(re.fromCssColorString("#F5FFFA"));re.MISTYROSE=Object.freeze(re.fromCssColorString("#FFE4E1"));re.MOCCASIN=Object.freeze(re.fromCssColorString("#FFE4B5"));re.NAVAJOWHITE=Object.freeze(re.fromCssColorString("#FFDEAD"));re.NAVY=Object.freeze(re.fromCssColorString("#000080"));re.OLDLACE=Object.freeze(re.fromCssColorString("#FDF5E6"));re.OLIVE=Object.freeze(re.fromCssColorString("#808000"));re.OLIVEDRAB=Object.freeze(re.fromCssColorString("#6B8E23"));re.ORANGE=Object.freeze(re.fromCssColorString("#FFA500"));re.ORANGERED=Object.freeze(re.fromCssColorString("#FF4500"));re.ORCHID=Object.freeze(re.fromCssColorString("#DA70D6"));re.PALEGOLDENROD=Object.freeze(re.fromCssColorString("#EEE8AA"));re.PALEGREEN=Object.freeze(re.fromCssColorString("#98FB98"));re.PALETURQUOISE=Object.freeze(re.fromCssColorString("#AFEEEE"));re.PALEVIOLETRED=Object.freeze(re.fromCssColorString("#DB7093"));re.PAPAYAWHIP=Object.freeze(re.fromCssColorString("#FFEFD5"));re.PEACHPUFF=Object.freeze(re.fromCssColorString("#FFDAB9"));re.PERU=Object.freeze(re.fromCssColorString("#CD853F"));re.PINK=Object.freeze(re.fromCssColorString("#FFC0CB"));re.PLUM=Object.freeze(re.fromCssColorString("#DDA0DD"));re.POWDERBLUE=Object.freeze(re.fromCssColorString("#B0E0E6"));re.PURPLE=Object.freeze(re.fromCssColorString("#800080"));re.RED=Object.freeze(re.fromCssColorString("#FF0000"));re.ROSYBROWN=Object.freeze(re.fromCssColorString("#BC8F8F"));re.ROYALBLUE=Object.freeze(re.fromCssColorString("#4169E1"));re.SADDLEBROWN=Object.freeze(re.fromCssColorString("#8B4513"));re.SALMON=Object.freeze(re.fromCssColorString("#FA8072"));re.SANDYBROWN=Object.freeze(re.fromCssColorString("#F4A460"));re.SEAGREEN=Object.freeze(re.fromCssColorString("#2E8B57"));re.SEASHELL=Object.freeze(re.fromCssColorString("#FFF5EE"));re.SIENNA=Object.freeze(re.fromCssColorString("#A0522D"));re.SILVER=Object.freeze(re.fromCssColorString("#C0C0C0"));re.SKYBLUE=Object.freeze(re.fromCssColorString("#87CEEB"));re.SLATEBLUE=Object.freeze(re.fromCssColorString("#6A5ACD"));re.SLATEGRAY=Object.freeze(re.fromCssColorString("#708090"));re.SLATEGREY=re.SLATEGRAY;re.SNOW=Object.freeze(re.fromCssColorString("#FFFAFA"));re.SPRINGGREEN=Object.freeze(re.fromCssColorString("#00FF7F"));re.STEELBLUE=Object.freeze(re.fromCssColorString("#4682B4"));re.TAN=Object.freeze(re.fromCssColorString("#D2B48C"));re.TEAL=Object.freeze(re.fromCssColorString("#008080"));re.THISTLE=Object.freeze(re.fromCssColorString("#D8BFD8"));re.TOMATO=Object.freeze(re.fromCssColorString("#FF6347"));re.TURQUOISE=Object.freeze(re.fromCssColorString("#40E0D0"));re.VIOLET=Object.freeze(re.fromCssColorString("#EE82EE"));re.WHEAT=Object.freeze(re.fromCssColorString("#F5DEB3"));re.WHITE=Object.freeze(re.fromCssColorString("#FFFFFF"));re.WHITESMOKE=Object.freeze(re.fromCssColorString("#F5F5F5"));re.YELLOW=Object.freeze(re.fromCssColorString("#FFFF00"));re.YELLOWGREEN=Object.freeze(re.fromCssColorString("#9ACD32"));re.TRANSPARENT=Object.freeze(new re(0,0,0,0));var O=re;var nCt=T(S(),1);function jSe(){return!0}function qSe(e,t){t=g(t,"This object was destroyed, i.e., destroy() was called.");function n(){}for(let i in e)typeof e[i]=="function"&&(e[i]=n);e.isDestroyed=jSe}var ue=qSe;var sCt=T(S(),1);function ql(e,t){e=g(e,0),this._near=e,t=g(t,Number.MAX_VALUE),this._far=t}Object.defineProperties(ql.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}}});ql.packedLength=2;ql.pack=function(e,t,n){return n=g(n,0),t[n++]=e.near,t[n]=e.far,t};ql.unpack=function(e,t,n){return t=g(t,0),l(n)||(n=new ql),n.near=e[t++],n.far=e[t],n};ql.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};ql.clone=function(e,t){if(l(e))return l(t)||(t=new ql),t.near=e.near,t.far=e.far,t};ql.prototype.clone=function(e){return ql.clone(this,e)};ql.prototype.equals=function(e){return ql.equals(this,e)};var It=ql;var dCt=T(S(),1);function eu(e,t,n,i){this.near=g(e,0),this.nearValue=g(t,0),this.far=g(n,1),this.farValue=g(i,0)}eu.clone=function(e,t){if(l(e))return l(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new eu(e.near,e.nearValue,e.far,e.farValue)};eu.packedLength=4;eu.pack=function(e,t,n){return n=g(n,0),t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t};eu.unpack=function(e,t,n){return t=g(t,0),l(n)||(n=new eu),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};eu.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue};eu.prototype.clone=function(e){return eu.clone(this,e)};eu.prototype.equals=function(e){return eu.equals(this,e)};var vt=eu;var mCt=T(S(),1),kg={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2,CLAMP_TO_TERRAIN:3,RELATIVE_TO_TERRAIN:4,CLAMP_TO_3D_TILE:5,RELATIVE_TO_3D_TILE:6},Qe=Object.freeze(kg);function tu(e){return e===kg.CLAMP_TO_GROUND||e===kg.CLAMP_TO_3D_TILE||e===kg.CLAMP_TO_TERRAIN}function TS(e){return e===kg.RELATIVE_TO_GROUND||e===kg.RELATIVE_TO_3D_TILE||e===kg.RELATIVE_TO_TERRAIN}var fCt=T(S(),1),$Se={CENTER:0,LEFT:1,RIGHT:-1},bi=Object.freeze($Se);var bCt=T(S(),1),eCe={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1},vn=Object.freeze(eCe);var gCt=T(S(),1),tCe={DONE:0,PENDING:1,FAILED:2},ut=Object.freeze(tCe);var CCt=T(S(),1);function mm(){fe.throwInstantiationError()}Object.defineProperties(mm.prototype,{isConstant:{get:fe.throwInstantiationError},definitionChanged:{get:fe.throwInstantiationError}});mm.prototype.getValue=fe.throwInstantiationError;mm.prototype.equals=fe.throwInstantiationError;mm.equals=function(e,t){return e===t||l(e)&&e.equals(t)};mm.arrayEquals=function(e,t){if(e===t)return!0;if(!l(e)||!l(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;i<n;i++)if(!mm.equals(e[i],t[i]))return!1;return!0};mm.isConstant=function(e){return!l(e)||e.isConstant};mm.getValueOrUndefined=function(e,t,n){return l(e)?e.getValue(t,n):void 0};mm.getValueOrDefault=function(e,t,n,i){return l(e)?g(e.getValue(t,i),n):n};mm.getValueOrClonedDefault=function(e,t,n,i){let o;return l(e)&&(o=e.getValue(t,i)),l(o)||(o=n.clone(o)),o};var z=mm;var nCe=O.WHITE,iCe=h.ZERO,oCe=Qe.NONE,rCe=B.ZERO,sCe=1,aCe=0,cCe=h.ZERO,lCe=bi.CENTER,dCe=vn.CENTER,uCe=!1,mCe=new h,hCe=new O,fCe=new h,pCe=new B,bCe=new vt,yCe=new vt,gCe=new vt,xCe=new De,_Ce=new It;function S6(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function hb(e,t){t.collectionChanged.addEventListener(hb.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Ct,this._onCollectionChanged(t,t.values,[],[])}hb.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._billboard,c,d=r.billboard,u=s.isShowing&&s.isAvailable(e)&&z.getValueOrDefault(a._show,e,!0),m;if(u&&(m=z.getValueOrUndefined(s._position,e,mCe),c=z.getValueOrUndefined(a._image,e),u=l(m)&&l(c)),!u){i3(r,s,n);continue}z.isConstant(s._position)||(n._clusterDirty=!0),l(d)||(d=n.getBillboard(s),d.id=s,d.image=void 0,r.billboard=d),d.show=u,(!l(d.image)||r.textureValue!==c)&&(d.image=c,r.textureValue=c),d.position=m,d.color=z.getValueOrDefault(a._color,e,nCe,hCe),d.eyeOffset=z.getValueOrDefault(a._eyeOffset,e,iCe,fCe),d.heightReference=z.getValueOrDefault(a._heightReference,e,oCe),d.pixelOffset=z.getValueOrDefault(a._pixelOffset,e,rCe,pCe),d.scale=z.getValueOrDefault(a._scale,e,sCe),d.rotation=z.getValueOrDefault(a._rotation,e,aCe),d.alignedAxis=z.getValueOrDefault(a._alignedAxis,e,cCe),d.horizontalOrigin=z.getValueOrDefault(a._horizontalOrigin,e,lCe),d.verticalOrigin=z.getValueOrDefault(a._verticalOrigin,e,dCe),d.width=z.getValueOrUndefined(a._width,e),d.height=z.getValueOrUndefined(a._height,e),d.scaleByDistance=z.getValueOrUndefined(a._scaleByDistance,e,bCe),d.translucencyByDistance=z.getValueOrUndefined(a._translucencyByDistance,e,yCe),d.pixelOffsetScaleByDistance=z.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,gCe),d.sizeInMeters=z.getValueOrDefault(a._sizeInMeters,e,uCe),d.distanceDisplayCondition=z.getValueOrUndefined(a._distanceDisplayCondition,e,_Ce),d.disableDepthTestDistance=z.getValueOrUndefined(a._disableDepthTestDistance,e);let p=z.getValueOrUndefined(a._imageSubRegion,e,xCe);l(p)&&d.setImageSubRegion(d._imageId,p)}return!0};hb.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.billboard))return ut.FAILED;let i=n.billboard;if(i.heightReference===Qe.NONE)t.center=h.clone(i.position,t.center);else{if(!l(i._clampedPosition))return ut.PENDING;t.center=h.clone(i._clampedPosition,t.center)}return t.radius=0,ut.DONE};hb.prototype.isDestroyed=function(){return!1};hb.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(hb.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return ue(this)};hb.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._billboard)&&l(r._position)&&s.set(r.id,new S6(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._billboard)&&l(r._position)?s.contains(r.id)||s.set(r.id,new S6(r)):(i3(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],i3(s.get(r.id),r,a),s.remove(r.id)};function i3(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var LL=hb;var ljt=T(S(),1);var nGt=T(S(),1);var L1t=T(S(),1);var DCt=T(S(),1);function TCe(e,t){this.start=g(e,0),this.stop=g(t,0)}var xa=TCe;var zCt=T(S(),1);function tt(e,t,n,i,o,r,s,a,c){this[0]=g(e,0),this[1]=g(i,0),this[2]=g(s,0),this[3]=g(t,0),this[4]=g(o,0),this[5]=g(a,0),this[6]=g(n,0),this[7]=g(r,0),this[8]=g(c,0)}tt.packedLength=9;tt.pack=function(e,t,n){return n=g(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t};tt.unpack=function(e,t,n){return t=g(t,0),l(n)||(n=new tt),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};tt.packArray=function(e,t){let n=e.length,i=n*9;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)tt.pack(e[o],t,o*9);return t};tt.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/9:t=new Array(n/9);for(let i=0;i<n;i+=9){let o=i/9;t[o]=tt.unpack(e,i,t[o])}return t};tt.clone=function(e,t){if(l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[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 tt(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])};tt.fromArray=tt.unpack;tt.fromColumnMajorArray=function(e,t){return tt.clone(e,t)};tt.fromRowMajorArray=function(e,t){return l(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 tt(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])};tt.fromQuaternion=function(e,t){let n=e.x*e.x,i=e.x*e.y,o=e.x*e.z,r=e.x*e.w,s=e.y*e.y,a=e.y*e.z,c=e.y*e.w,d=e.z*e.z,u=e.z*e.w,m=e.w*e.w,p=n-s-d+m,y=2*(i-u),f=2*(o+c),x=2*(i+u),_=-n+s-d+m,C=2*(a-r),V=2*(o-c),L=2*(a+r),Z=-n-s+d+m;return l(t)?(t[0]=p,t[1]=x,t[2]=V,t[3]=y,t[4]=_,t[5]=L,t[6]=f,t[7]=C,t[8]=Z,t):new tt(p,y,f,x,_,C,V,L,Z)};tt.fromHeadingPitchRoll=function(e,t){let n=Math.cos(-e.pitch),i=Math.cos(-e.heading),o=Math.cos(e.roll),r=Math.sin(-e.pitch),s=Math.sin(-e.heading),a=Math.sin(e.roll),c=n*i,d=-o*s+a*r*i,u=a*s+o*r*i,m=n*s,p=o*i+a*r*s,y=-a*i+o*r*s,f=-r,x=a*n,_=o*n;return l(t)?(t[0]=c,t[1]=m,t[2]=f,t[3]=d,t[4]=p,t[5]=x,t[6]=u,t[7]=y,t[8]=_,t):new tt(c,d,u,m,p,y,f,x,_)};tt.fromScale=function(e,t){return l(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 tt(e.x,0,0,0,e.y,0,0,0,e.z)};tt.fromUniformScale=function(e,t){return l(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 tt(e,0,0,0,e,0,0,0,e)};tt.fromCrossProduct=function(e,t){return l(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 tt(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)};tt.fromRotationX=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new tt(1,0,0,0,n,-i,0,i,n)};tt.fromRotationY=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new tt(n,0,i,0,1,0,-i,0,n)};tt.fromRotationZ=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new tt(n,-i,0,i,n,0,0,0,1)};tt.toArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[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]]};tt.getElementIndex=function(e,t){return e*3+t};tt.getColumn=function(e,t,n){let i=t*3,o=e[i],r=e[i+1],s=e[i+2];return n.x=o,n.y=r,n.z=s,n};tt.setColumn=function(e,t,n,i){i=tt.clone(e,i);let o=t*3;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i};tt.getRow=function(e,t,n){let i=e[t],o=e[t+3],r=e[t+6];return n.x=i,n.y=o,n.z=r,n};tt.setRow=function(e,t,n,i){return i=tt.clone(e,i),i[t]=n.x,i[t+3]=n.y,i[t+6]=n.z,i};var SCe=new h;tt.setScale=function(e,t,n){let i=tt.getScale(e,SCe),o=t.x/i.x,r=t.y/i.y,s=t.z/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3]*r,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*s,n[7]=e[7]*s,n[8]=e[8]*s,n};var CCe=new h;tt.setUniformScale=function(e,t,n){let i=tt.getScale(e,CCe),o=t/i.x,r=t/i.y,s=t/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3]*r,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*s,n[7]=e[7]*s,n[8]=e[8]*s,n};var o3=new h;tt.getScale=function(e,t){return t.x=h.magnitude(h.fromElements(e[0],e[1],e[2],o3)),t.y=h.magnitude(h.fromElements(e[3],e[4],e[5],o3)),t.z=h.magnitude(h.fromElements(e[6],e[7],e[8],o3)),t};var C6=new h;tt.getMaximumScale=function(e){return tt.getScale(e,C6),h.maximumComponent(C6)};var VCe=new h;tt.setRotation=function(e,t,n){let i=tt.getScale(e,VCe);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.x,n[3]=t[3]*i.y,n[4]=t[4]*i.y,n[5]=t[5]*i.y,n[6]=t[6]*i.z,n[7]=t[7]*i.z,n[8]=t[8]*i.z,n};var LCe=new h;tt.getRotation=function(e,t){let n=tt.getScale(e,LCe);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[3]/n.y,t[4]=e[4]/n.y,t[5]=e[5]/n.y,t[6]=e[6]/n.z,t[7]=e[7]/n.z,t[8]=e[8]/n.z,t};tt.multiply=function(e,t,n){let i=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],o=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],r=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],s=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],a=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],c=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],d=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],u=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],m=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=i,n[1]=o,n[2]=r,n[3]=s,n[4]=a,n[5]=c,n[6]=d,n[7]=u,n[8]=m,n};tt.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n};tt.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n};tt.multiplyByVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=e[0]*i+e[3]*o+e[6]*r,a=e[1]*i+e[4]*o+e[7]*r,c=e[2]*i+e[5]*o+e[8]*r;return n.x=s,n.y=a,n.z=c,n};tt.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n};tt.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n};tt.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n};tt.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};tt.transpose=function(e,t){let n=e[0],i=e[3],o=e[6],r=e[1],s=e[4],a=e[7],c=e[2],d=e[5],u=e[8];return t[0]=n,t[1]=i,t[2]=o,t[3]=r,t[4]=s,t[5]=a,t[6]=c,t[7]=d,t[8]=u,t};function RCe(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var r3=[1,0,0],s3=[2,2,1];function ZCe(e){let t=0;for(let n=0;n<3;++n){let i=e[tt.getElementIndex(s3[n],r3[n])];t+=2*i*i}return Math.sqrt(t)}function GCe(e,t){let n=W.EPSILON15,i=0,o=1;for(let d=0;d<3;++d){let u=Math.abs(e[tt.getElementIndex(s3[d],r3[d])]);u>i&&(o=d,i=u)}let r=1,s=0,a=r3[o],c=s3[o];if(Math.abs(e[tt.getElementIndex(c,a)])>n){let d=e[tt.getElementIndex(c,c)],u=e[tt.getElementIndex(a,a)],m=e[tt.getElementIndex(c,a)],p=(d-u)/2/m,y;p<0?y=-1/(-p+Math.sqrt(1+p*p)):y=1/(p+Math.sqrt(1+p*p)),r=1/Math.sqrt(1+y*y),s=y*r}return t=tt.clone(tt.IDENTITY,t),t[tt.getElementIndex(a,a)]=t[tt.getElementIndex(c,c)]=r,t[tt.getElementIndex(c,a)]=s,t[tt.getElementIndex(a,c)]=-s,t}var uM=new tt,V6=new tt;tt.computeEigenDecomposition=function(e,t){let n=W.EPSILON20,i=10,o=0,r=0;l(t)||(t={});let s=t.unitary=tt.clone(tt.IDENTITY,t.unitary),a=t.diagonal=tt.clone(e,t.diagonal),c=n*RCe(a);for(;r<i&&ZCe(a)>c;)GCe(a,uM),tt.transpose(uM,V6),tt.multiply(a,uM,a),tt.multiply(V6,a,a),tt.multiply(s,uM,s),++o>2&&(++r,o=0);return t};tt.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};tt.determinant=function(e){let t=e[0],n=e[3],i=e[6],o=e[1],r=e[4],s=e[7],a=e[2],c=e[5],d=e[8];return t*(r*d-c*s)+o*(c*i-n*d)+a*(n*s-r*i)};tt.inverse=function(e,t){let n=e[0],i=e[1],o=e[2],r=e[3],s=e[4],a=e[5],c=e[6],d=e[7],u=e[8],m=tt.determinant(e);t[0]=s*u-d*a,t[1]=d*o-i*u,t[2]=i*a-s*o,t[3]=c*a-r*u,t[4]=n*u-c*o,t[5]=r*o-n*a,t[6]=r*d-c*s,t[7]=c*i-n*d,t[8]=n*s-r*i;let p=1/m;return tt.multiplyByScalar(t,p,t)};var ECe=new tt;tt.inverseTranspose=function(e,t){return tt.inverse(tt.transpose(e,ECe),t)};tt.equals=function(e,t){return e===t||l(e)&&l(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]};tt.equalsEpsilon=function(e,t,n){return n=g(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n};tt.IDENTITY=Object.freeze(new tt(1,0,0,0,1,0,0,0,1));tt.ZERO=Object.freeze(new tt(0,0,0,0,0,0,0,0,0));tt.COLUMN0ROW0=0;tt.COLUMN0ROW1=1;tt.COLUMN0ROW2=2;tt.COLUMN1ROW0=3;tt.COLUMN1ROW1=4;tt.COLUMN1ROW2=5;tt.COLUMN2ROW0=6;tt.COLUMN2ROW1=7;tt.COLUMN2ROW2=8;Object.defineProperties(tt.prototype,{length:{get:function(){return tt.packedLength}}});tt.prototype.clone=function(e){return tt.clone(this,e)};tt.prototype.equals=function(e){return tt.equals(this,e)};tt.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]};tt.prototype.equalsEpsilon=function(e,t){return tt.equalsEpsilon(this,e,t)};tt.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]})
(${this[1]}, ${this[4]}, ${this[7]})
(${this[2]}, ${this[5]}, ${this[8]})`};var q=tt;var u1t=T(S(),1);var $Ct=T(S(),1);function gt(e,t,n,i){this.x=g(e,0),this.y=g(t,0),this.z=g(n,0),this.w=g(i,0)}gt.fromElements=function(e,t,n,i,o){return l(o)?(o.x=e,o.y=t,o.z=n,o.w=i,o):new gt(e,t,n,i)};gt.fromColor=function(e,t){return l(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new gt(e.red,e.green,e.blue,e.alpha)};gt.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new gt(e.x,e.y,e.z,e.w)};gt.packedLength=4;gt.pack=function(e,t,n){return n=g(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};gt.unpack=function(e,t,n){return t=g(t,0),l(n)||(n=new gt),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n};gt.packArray=function(e,t){let n=e.length,i=n*4;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)gt.pack(e[o],t,o*4);return t};gt.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){let o=i/4;t[o]=gt.unpack(e,i,t[o])}return t};gt.fromArray=gt.unpack;gt.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)};gt.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)};gt.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n};gt.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n};gt.clamp=function(e,t,n,i){let o=W.clamp(e.x,t.x,n.x),r=W.clamp(e.y,t.y,n.y),s=W.clamp(e.z,t.z,n.z),a=W.clamp(e.w,t.w,n.w);return i.x=o,i.y=r,i.z=s,i.w=a,i};gt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};gt.magnitude=function(e){return Math.sqrt(gt.magnitudeSquared(e))};var mM=new gt;gt.distance=function(e,t){return gt.subtract(e,t,mM),gt.magnitude(mM)};gt.distanceSquared=function(e,t){return gt.subtract(e,t,mM),gt.magnitudeSquared(mM)};gt.normalize=function(e,t){let n=gt.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t};gt.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};gt.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n};gt.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n};gt.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};gt.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};gt.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};gt.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};gt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};gt.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 L6=new gt;gt.lerp=function(e,t,n,i){return gt.multiplyByScalar(t,n,L6),i=gt.multiplyByScalar(e,1-n,i),gt.add(L6,i,i)};var ICe=new gt;gt.mostOrthogonalAxis=function(e,t){let n=gt.normalize(e,ICe);return gt.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=gt.clone(gt.UNIT_X,t):t=gt.clone(gt.UNIT_W,t):n.z<=n.w?t=gt.clone(gt.UNIT_Z,t):t=gt.clone(gt.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=gt.clone(gt.UNIT_Y,t):t=gt.clone(gt.UNIT_W,t):n.z<=n.w?t=gt.clone(gt.UNIT_Z,t):t=gt.clone(gt.UNIT_W,t),t};gt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};gt.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]};gt.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&W.equalsEpsilon(e.x,t.x,n,i)&&W.equalsEpsilon(e.y,t.y,n,i)&&W.equalsEpsilon(e.z,t.z,n,i)&&W.equalsEpsilon(e.w,t.w,n,i)};gt.ZERO=Object.freeze(new gt(0,0,0,0));gt.ONE=Object.freeze(new gt(1,1,1,1));gt.UNIT_X=Object.freeze(new gt(1,0,0,0));gt.UNIT_Y=Object.freeze(new gt(0,1,0,0));gt.UNIT_Z=Object.freeze(new gt(0,0,1,0));gt.UNIT_W=Object.freeze(new gt(0,0,0,1));gt.prototype.clone=function(e){return gt.clone(this,e)};gt.prototype.equals=function(e){return gt.equals(this,e)};gt.prototype.equalsEpsilon=function(e,t,n){return gt.equalsEpsilon(this,e,t,n)};gt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var a3=new Float32Array(1),Oa=new Uint8Array(a3.buffer),XCe=new Uint32Array([287454020]),WCe=new Uint8Array(XCe.buffer),R6=WCe[0]===68;gt.packFloat=function(e,t){return l(t)||(t=new gt),a3[0]=e,R6?(t.x=Oa[0],t.y=Oa[1],t.z=Oa[2],t.w=Oa[3]):(t.x=Oa[3],t.y=Oa[2],t.z=Oa[1],t.w=Oa[0]),t};gt.unpackFloat=function(e){return R6?(Oa[0]=e.x,Oa[1]=e.y,Oa[2]=e.z,Oa[3]=e.w):(Oa[0]=e.w,Oa[1]=e.z,Oa[2]=e.y,Oa[3]=e.x),a3[0]};var se=gt;var n1t=T(S(),1);function RL(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(RL.prototype=Object.create(Error.prototype),RL.prototype.constructor=RL);RL.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=`
${this.stack.toString()}`),e};var me=RL;function $e(e,t,n,i,o,r,s,a,c,d,u,m,p,y,f,x){this[0]=g(e,0),this[1]=g(o,0),this[2]=g(c,0),this[3]=g(p,0),this[4]=g(t,0),this[5]=g(r,0),this[6]=g(d,0),this[7]=g(y,0),this[8]=g(n,0),this[9]=g(s,0),this[10]=g(u,0),this[11]=g(f,0),this[12]=g(i,0),this[13]=g(a,0),this[14]=g(m,0),this[15]=g(x,0)}$e.packedLength=16;$e.pack=function(e,t,n){return n=g(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t};$e.unpack=function(e,t,n){return t=g(t,0),l(n)||(n=new $e),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n};$e.packArray=function(e,t){let n=e.length,i=n*16;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)$e.pack(e[o],t,o*16);return t};$e.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/16:t=new Array(n/16);for(let i=0;i<n;i+=16){let o=i/16;t[o]=$e.unpack(e,i,t[o])}return t};$e.clone=function(e,t){if(l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new $e(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])};$e.fromArray=$e.unpack;$e.fromColumnMajorArray=function(e,t){return $e.clone(e,t)};$e.fromRowMajorArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new $e(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])};$e.fromRotationTranslation=function(e,t,n){return t=g(t,h.ZERO),l(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=0,n[4]=e[3],n[5]=e[4],n[6]=e[5],n[7]=0,n[8]=e[6],n[9]=e[7],n[10]=e[8],n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,n):new $e(e[0],e[3],e[6],t.x,e[1],e[4],e[7],t.y,e[2],e[5],e[8],t.z,0,0,0,1)};$e.fromTranslationQuaternionRotationScale=function(e,t,n,i){l(i)||(i=new $e);let o=n.x,r=n.y,s=n.z,a=t.x*t.x,c=t.x*t.y,d=t.x*t.z,u=t.x*t.w,m=t.y*t.y,p=t.y*t.z,y=t.y*t.w,f=t.z*t.z,x=t.z*t.w,_=t.w*t.w,C=a-m-f+_,V=2*(c-x),L=2*(d+y),Z=2*(c+x),G=-a+m-f+_,I=2*(p-u),P=2*(d-y),v=2*(p+u),F=-a-m+f+_;return i[0]=C*o,i[1]=Z*o,i[2]=P*o,i[3]=0,i[4]=V*r,i[5]=G*r,i[6]=v*r,i[7]=0,i[8]=L*s,i[9]=I*s,i[10]=F*s,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i};$e.fromTranslationRotationScale=function(e,t){return $e.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};$e.fromTranslation=function(e,t){return $e.fromRotationTranslation(q.IDENTITY,e,t)};$e.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new $e(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};$e.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new $e(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};$e.fromRotation=function(e,t){return l(t)||(t=new $e),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=0,t[4]=e[3],t[5]=e[4],t[6]=e[5],t[7]=0,t[8]=e[6],t[9]=e[7],t[10]=e[8],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t};var SS=new h,CS=new h,ZL=new h;$e.fromCamera=function(e,t){let n=e.position,i=e.direction,o=e.up;h.normalize(i,SS),h.normalize(h.cross(SS,o,CS),CS),h.normalize(h.cross(CS,SS,ZL),ZL);let r=CS.x,s=CS.y,a=CS.z,c=SS.x,d=SS.y,u=SS.z,m=ZL.x,p=ZL.y,y=ZL.z,f=n.x,x=n.y,_=n.z,C=r*-f+s*-x+a*-_,V=m*-f+p*-x+y*-_,L=c*f+d*x+u*_;return l(t)?(t[0]=r,t[1]=m,t[2]=-c,t[3]=0,t[4]=s,t[5]=p,t[6]=-d,t[7]=0,t[8]=a,t[9]=y,t[10]=-u,t[11]=0,t[12]=C,t[13]=V,t[14]=L,t[15]=1,t):new $e(r,s,a,C,m,p,y,V,-c,-d,-u,L,0,0,0,1)};$e.computePerspectiveFieldOfView=function(e,t,n,i,o){let s=1/Math.tan(e*.5),a=s/t,c=(i+n)/(n-i),d=2*i*n/(n-i);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]=0,o[9]=0,o[10]=c,o[11]=-1,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o};$e.computeOrthographicOffCenter=function(e,t,n,i,o,r,s){let a=1/(t-e),c=1/(i-n),d=1/(r-o),u=-(t+e)*a,m=-(i+n)*c,p=-(r+o)*d;return a*=2,c*=2,d*=-2,s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=d,s[11]=0,s[12]=u,s[13]=m,s[14]=p,s[15]=1,s};$e.computePerspectiveOffCenter=function(e,t,n,i,o,r,s){let a=2*o/(t-e),c=2*o/(i-n),d=(t+e)/(t-e),u=(i+n)/(i-n),m=-(r+o)/(r-o),p=-1,y=-2*r*o/(r-o);return s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=d,s[9]=u,s[10]=m,s[11]=p,s[12]=0,s[13]=0,s[14]=y,s[15]=0,s};$e.computeInfinitePerspectiveOffCenter=function(e,t,n,i,o,r){let s=2*o/(t-e),a=2*o/(i-n),c=(t+e)/(t-e),d=(i+n)/(i-n),u=-1,m=-1,p=-2*o;return r[0]=s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=c,r[9]=d,r[10]=u,r[11]=m,r[12]=0,r[13]=0,r[14]=p,r[15]=0,r};$e.computeViewportTransformation=function(e,t,n,i){l(i)||(i=new $e),e=g(e,g.EMPTY_OBJECT);let o=g(e.x,0),r=g(e.y,0),s=g(e.width,0),a=g(e.height,0);t=g(t,0),n=g(n,1);let c=s*.5,d=a*.5,u=(n-t)*.5,m=c,p=d,y=u,f=o+c,x=r+d,_=t+u,C=1;return i[0]=m,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=p,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=y,i[11]=0,i[12]=f,i[13]=x,i[14]=_,i[15]=C,i};$e.computeView=function(e,t,n,i,o){return o[0]=i.x,o[1]=n.x,o[2]=-t.x,o[3]=0,o[4]=i.y,o[5]=n.y,o[6]=-t.y,o[7]=0,o[8]=i.z,o[9]=n.z,o[10]=-t.z,o[11]=0,o[12]=-h.dot(i,e),o[13]=-h.dot(n,e),o[14]=h.dot(t,e),o[15]=1,o};$e.toArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]};$e.getElementIndex=function(e,t){return e*4+t};$e.getColumn=function(e,t,n){let i=t*4,o=e[i],r=e[i+1],s=e[i+2],a=e[i+3];return n.x=o,n.y=r,n.z=s,n.w=a,n};$e.setColumn=function(e,t,n,i){i=$e.clone(e,i);let o=t*4;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i[o+3]=n.w,i};$e.getRow=function(e,t,n){let i=e[t],o=e[t+4],r=e[t+8],s=e[t+12];return n.x=i,n.y=o,n.z=r,n.w=s,n};$e.setRow=function(e,t,n,i){return i=$e.clone(e,i),i[t]=n.x,i[t+4]=n.y,i[t+8]=n.z,i[t+12]=n.w,i};$e.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n};var PCe=new h;$e.setScale=function(e,t,n){let i=$e.getScale(e,PCe),o=t.x/i.x,r=t.y/i.y,s=t.z/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3],n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7],n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var vCe=new h;$e.setUniformScale=function(e,t,n){let i=$e.getScale(e,vCe),o=t/i.x,r=t/i.y,s=t/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3],n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7],n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var c3=new h;$e.getScale=function(e,t){return t.x=h.magnitude(h.fromElements(e[0],e[1],e[2],c3)),t.y=h.magnitude(h.fromElements(e[4],e[5],e[6],c3)),t.z=h.magnitude(h.fromElements(e[8],e[9],e[10],c3)),t};var Z6=new h;$e.getMaximumScale=function(e){return $e.getScale(e,Z6),h.maximumComponent(Z6)};var wCe=new h;$e.setRotation=function(e,t,n){let i=$e.getScale(e,wCe);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.x,n[3]=e[3],n[4]=t[3]*i.y,n[5]=t[4]*i.y,n[6]=t[5]*i.y,n[7]=e[7],n[8]=t[6]*i.z,n[9]=t[7]*i.z,n[10]=t[8]*i.z,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var FCe=new h;$e.getRotation=function(e,t){let n=$e.getScale(e,FCe);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[4]/n.y,t[4]=e[5]/n.y,t[5]=e[6]/n.y,t[6]=e[8]/n.z,t[7]=e[9]/n.z,t[8]=e[10]/n.z,t};$e.multiply=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[3],a=e[4],c=e[5],d=e[6],u=e[7],m=e[8],p=e[9],y=e[10],f=e[11],x=e[12],_=e[13],C=e[14],V=e[15],L=t[0],Z=t[1],G=t[2],I=t[3],P=t[4],v=t[5],F=t[6],M=t[7],b=t[8],R=t[9],E=t[10],X=t[11],w=t[12],N=t[13],D=t[14],k=t[15],Y=i*L+a*Z+m*G+x*I,U=o*L+c*Z+p*G+_*I,J=r*L+d*Z+y*G+C*I,K=s*L+u*Z+f*G+V*I,ee=i*P+a*v+m*F+x*M,H=o*P+c*v+p*F+_*M,j=r*P+d*v+y*F+C*M,$=s*P+u*v+f*F+V*M,pe=i*b+a*R+m*E+x*X,ge=o*b+c*R+p*E+_*X,ae=r*b+d*R+y*E+C*X,be=s*b+u*R+f*E+V*X,_e=i*w+a*N+m*D+x*k,Ze=o*w+c*N+p*D+_*k,Le=r*w+d*N+y*D+C*k,Ee=s*w+u*N+f*D+V*k;return n[0]=Y,n[1]=U,n[2]=J,n[3]=K,n[4]=ee,n[5]=H,n[6]=j,n[7]=$,n[8]=pe,n[9]=ge,n[10]=ae,n[11]=be,n[12]=_e,n[13]=Ze,n[14]=Le,n[15]=Ee,n};$e.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n};$e.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n};$e.multiplyTransformation=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[4],a=e[5],c=e[6],d=e[8],u=e[9],m=e[10],p=e[12],y=e[13],f=e[14],x=t[0],_=t[1],C=t[2],V=t[4],L=t[5],Z=t[6],G=t[8],I=t[9],P=t[10],v=t[12],F=t[13],M=t[14],b=i*x+s*_+d*C,R=o*x+a*_+u*C,E=r*x+c*_+m*C,X=i*V+s*L+d*Z,w=o*V+a*L+u*Z,N=r*V+c*L+m*Z,D=i*G+s*I+d*P,k=o*G+a*I+u*P,Y=r*G+c*I+m*P,U=i*v+s*F+d*M+p,J=o*v+a*F+u*M+y,K=r*v+c*F+m*M+f;return n[0]=b,n[1]=R,n[2]=E,n[3]=0,n[4]=X,n[5]=w,n[6]=N,n[7]=0,n[8]=D,n[9]=k,n[10]=Y,n[11]=0,n[12]=U,n[13]=J,n[14]=K,n[15]=1,n};$e.multiplyByMatrix3=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[4],a=e[5],c=e[6],d=e[8],u=e[9],m=e[10],p=t[0],y=t[1],f=t[2],x=t[3],_=t[4],C=t[5],V=t[6],L=t[7],Z=t[8],G=i*p+s*y+d*f,I=o*p+a*y+u*f,P=r*p+c*y+m*f,v=i*x+s*_+d*C,F=o*x+a*_+u*C,M=r*x+c*_+m*C,b=i*V+s*L+d*Z,R=o*V+a*L+u*Z,E=r*V+c*L+m*Z;return n[0]=G,n[1]=I,n[2]=P,n[3]=0,n[4]=v,n[5]=F,n[6]=M,n[7]=0,n[8]=b,n[9]=R,n[10]=E,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};$e.multiplyByTranslation=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=i*e[0]+o*e[4]+r*e[8]+e[12],a=i*e[1]+o*e[5]+r*e[9]+e[13],c=i*e[2]+o*e[6]+r*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=s,n[13]=a,n[14]=c,n[15]=e[15],n};$e.multiplyByScale=function(e,t,n){let i=t.x,o=t.y,r=t.z;return i===1&&o===1&&r===1?$e.clone(e,n):(n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=e[3],n[4]=o*e[4],n[5]=o*e[5],n[6]=o*e[6],n[7]=e[7],n[8]=r*e[8],n[9]=r*e[9],n[10]=r*e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n)};$e.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3],n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7],n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};$e.multiplyByVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=t.w,a=e[0]*i+e[4]*o+e[8]*r+e[12]*s,c=e[1]*i+e[5]*o+e[9]*r+e[13]*s,d=e[2]*i+e[6]*o+e[10]*r+e[14]*s,u=e[3]*i+e[7]*o+e[11]*r+e[15]*s;return n.x=a,n.y=c,n.z=d,n.w=u,n};$e.multiplyByPointAsVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=e[0]*i+e[4]*o+e[8]*r,a=e[1]*i+e[5]*o+e[9]*r,c=e[2]*i+e[6]*o+e[10]*r;return n.x=s,n.y=a,n.z=c,n};$e.multiplyByPoint=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=e[0]*i+e[4]*o+e[8]*r+e[12],a=e[1]*i+e[5]*o+e[9]*r+e[13],c=e[2]*i+e[6]*o+e[10]*r+e[14];return n.x=s,n.y=a,n.z=c,n};$e.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n};$e.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t};$e.transpose=function(e,t){let n=e[1],i=e[2],o=e[3],r=e[6],s=e[7],a=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=r,t[10]=e[10],t[11]=e[14],t[12]=o,t[13]=s,t[14]=a,t[15]=e[15],t};$e.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t};$e.equals=function(e,t){return e===t||l(e)&&l(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]};$e.equalsEpsilon=function(e,t,n){return n=g(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n};$e.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t};$e.getMatrix3=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 ACe=new q,MCe=new q,NCe=new se,UCe=new se(0,0,0,1);$e.inverse=function(e,t){let n=e[0],i=e[4],o=e[8],r=e[12],s=e[1],a=e[5],c=e[9],d=e[13],u=e[2],m=e[6],p=e[10],y=e[14],f=e[3],x=e[7],_=e[11],C=e[15],V=p*C,L=y*_,Z=m*C,G=y*x,I=m*_,P=p*x,v=u*C,F=y*f,M=u*_,b=p*f,R=u*x,E=m*f,X=V*a+G*c+I*d-(L*a+Z*c+P*d),w=L*s+v*c+b*d-(V*s+F*c+M*d),N=Z*s+F*a+R*d-(G*s+v*a+E*d),D=P*s+M*a+E*c-(I*s+b*a+R*c),k=L*i+Z*o+P*r-(V*i+G*o+I*r),Y=V*n+F*o+M*r-(L*n+v*o+b*r),U=G*n+v*i+E*r-(Z*n+F*i+R*r),J=I*n+b*i+R*o-(P*n+M*i+E*o);V=o*d,L=r*c,Z=i*d,G=r*a,I=i*c,P=o*a,v=n*d,F=r*s,M=n*c,b=o*s,R=n*a,E=i*s;let K=V*x+G*_+I*C-(L*x+Z*_+P*C),ee=L*f+v*_+b*C-(V*f+F*_+M*C),H=Z*f+F*x+R*C-(G*f+v*x+E*C),j=P*f+M*x+E*_-(I*f+b*x+R*_),$=Z*p+P*y+L*m-(I*y+V*m+G*p),pe=M*y+V*u+F*p-(v*p+b*y+L*u),ge=v*m+E*y+G*u-(R*y+Z*u+F*m),ae=R*p+I*u+b*m-(M*m+E*p+P*u),be=n*X+i*w+o*N+r*D;if(Math.abs(be)<W.EPSILON21){if(q.equalsEpsilon($e.getMatrix3(e,ACe),MCe,W.EPSILON7)&&se.equals($e.getRow(e,3,NCe),UCe))return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=1,t;throw new me("matrix is not invertible because its determinate is zero.")}return be=1/be,t[0]=X*be,t[1]=w*be,t[2]=N*be,t[3]=D*be,t[4]=k*be,t[5]=Y*be,t[6]=U*be,t[7]=J*be,t[8]=K*be,t[9]=ee*be,t[10]=H*be,t[11]=j*be,t[12]=$*be,t[13]=pe*be,t[14]=ge*be,t[15]=ae*be,t};$e.inverseTransformation=function(e,t){let n=e[0],i=e[1],o=e[2],r=e[4],s=e[5],a=e[6],c=e[8],d=e[9],u=e[10],m=e[12],p=e[13],y=e[14],f=-n*m-i*p-o*y,x=-r*m-s*p-a*y,_=-c*m-d*p-u*y;return t[0]=n,t[1]=r,t[2]=c,t[3]=0,t[4]=i,t[5]=s,t[6]=d,t[7]=0,t[8]=o,t[9]=a,t[10]=u,t[11]=0,t[12]=f,t[13]=x,t[14]=_,t[15]=1,t};var kCe=new $e;$e.inverseTranspose=function(e,t){return $e.inverse($e.transpose(e,kCe),t)};$e.IDENTITY=Object.freeze(new $e(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));$e.ZERO=Object.freeze(new $e(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));$e.COLUMN0ROW0=0;$e.COLUMN0ROW1=1;$e.COLUMN0ROW2=2;$e.COLUMN0ROW3=3;$e.COLUMN1ROW0=4;$e.COLUMN1ROW1=5;$e.COLUMN1ROW2=6;$e.COLUMN1ROW3=7;$e.COLUMN2ROW0=8;$e.COLUMN2ROW1=9;$e.COLUMN2ROW2=10;$e.COLUMN2ROW3=11;$e.COLUMN3ROW0=12;$e.COLUMN3ROW1=13;$e.COLUMN3ROW2=14;$e.COLUMN3ROW3=15;Object.defineProperties($e.prototype,{length:{get:function(){return $e.packedLength}}});$e.prototype.clone=function(e){return $e.clone(this,e)};$e.prototype.equals=function(e){return $e.equals(this,e)};$e.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]};$e.prototype.equalsEpsilon=function(e,t){return $e.equalsEpsilon(this,e,t)};$e.prototype.toString=function(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]})
(${this[1]}, ${this[5]}, ${this[9]}, ${this[13]})
(${this[2]}, ${this[6]}, ${this[10]}, ${this[14]})
(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`};var A=$e;function yn(e,t){this.center=h.clone(g(e,h.ZERO)),this.radius=g(t,0)}var u3=new h,m3=new h,h3=new h,f3=new h,p3=new h,b3=new h,y3=new h,Qs=new h,g3=new h,x3=new h,_3=new h,T3=new h,DCe=4/3*W.PI;yn.fromPoints=function(e,t){if(l(t)||(t=new yn),!l(e)||e.length===0)return t.center=h.clone(h.ZERO,t.center),t.radius=0,t;let n=h.clone(e[0],y3),i=h.clone(n,u3),o=h.clone(n,m3),r=h.clone(n,h3),s=h.clone(n,f3),a=h.clone(n,p3),c=h.clone(n,b3),d=e.length,u;for(u=1;u<d;u++){h.clone(e[u],n);let v=n.x,F=n.y,M=n.z;v<i.x&&h.clone(n,i),v>s.x&&h.clone(n,s),F<o.y&&h.clone(n,o),F>a.y&&h.clone(n,a),M<r.z&&h.clone(n,r),M>c.z&&h.clone(n,c)}let m=h.magnitudeSquared(h.subtract(s,i,Qs)),p=h.magnitudeSquared(h.subtract(a,o,Qs)),y=h.magnitudeSquared(h.subtract(c,r,Qs)),f=i,x=s,_=m;p>_&&(_=p,f=o,x=a),y>_&&(_=y,f=r,x=c);let C=g3;C.x=(f.x+x.x)*.5,C.y=(f.y+x.y)*.5,C.z=(f.z+x.z)*.5;let V=h.magnitudeSquared(h.subtract(x,C,Qs)),L=Math.sqrt(V),Z=x3;Z.x=i.x,Z.y=o.y,Z.z=r.z;let G=_3;G.x=s.x,G.y=a.y,G.z=c.z;let I=h.midpoint(Z,G,T3),P=0;for(u=0;u<d;u++){h.clone(e[u],n);let v=h.magnitude(h.subtract(n,I,Qs));v>P&&(P=v);let F=h.magnitudeSquared(h.subtract(n,C,Qs));if(F>V){let M=Math.sqrt(F);L=(L+M)*.5,V=L*L;let b=M-L;C.x=(L*C.x+b*n.x)/M,C.y=(L*C.y+b*n.y)/M,C.z=(L*C.z+b*n.z)/M}}return L<P?(h.clone(C,t.center),t.radius=L):(h.clone(I,t.center),t.radius=P),t};var BCe=new Ri,OCe=new h,YCe=new h,l3=new he,d3=new he;yn.fromRectangle2D=function(e,t,n){return yn.fromRectangleWithHeights2D(e,t,0,0,n)};yn.fromRectangleWithHeights2D=function(e,t,n,i,o){if(l(o)||(o=new yn),!l(e))return o.center=h.clone(h.ZERO,o.center),o.radius=0,o;t=g(t,BCe),de.southwest(e,l3),l3.height=n,de.northeast(e,d3),d3.height=i;let r=t.project(l3,OCe),s=t.project(d3,YCe),a=s.x-r.x,c=s.y-r.y,d=s.z-r.z;o.radius=Math.sqrt(a*a+c*c+d*d)*.5;let u=o.center;return u.x=r.x+a*.5,u.y=r.y+c*.5,u.z=r.z+d*.5,o};var HCe=[];yn.fromRectangle3D=function(e,t,n,i){if(t=g(t,oe.WGS84),n=g(n,0),l(i)||(i=new yn),!l(e))return i.center=h.clone(h.ZERO,i.center),i.radius=0,i;let o=de.subsample(e,t,n,HCe);return yn.fromPoints(o,i)};yn.fromVertices=function(e,t,n,i){if(l(i)||(i=new yn),!l(e)||e.length===0)return i.center=h.clone(h.ZERO,i.center),i.radius=0,i;t=g(t,h.ZERO),n=g(n,3);let o=y3;o.x=e[0]+t.x,o.y=e[1]+t.y,o.z=e[2]+t.z;let r=h.clone(o,u3),s=h.clone(o,m3),a=h.clone(o,h3),c=h.clone(o,f3),d=h.clone(o,p3),u=h.clone(o,b3),m=e.length,p;for(p=0;p<m;p+=n){let M=e[p]+t.x,b=e[p+1]+t.y,R=e[p+2]+t.z;o.x=M,o.y=b,o.z=R,M<r.x&&h.clone(o,r),M>c.x&&h.clone(o,c),b<s.y&&h.clone(o,s),b>d.y&&h.clone(o,d),R<a.z&&h.clone(o,a),R>u.z&&h.clone(o,u)}let y=h.magnitudeSquared(h.subtract(c,r,Qs)),f=h.magnitudeSquared(h.subtract(d,s,Qs)),x=h.magnitudeSquared(h.subtract(u,a,Qs)),_=r,C=c,V=y;f>V&&(V=f,_=s,C=d),x>V&&(V=x,_=a,C=u);let L=g3;L.x=(_.x+C.x)*.5,L.y=(_.y+C.y)*.5,L.z=(_.z+C.z)*.5;let Z=h.magnitudeSquared(h.subtract(C,L,Qs)),G=Math.sqrt(Z),I=x3;I.x=r.x,I.y=s.y,I.z=a.z;let P=_3;P.x=c.x,P.y=d.y,P.z=u.z;let v=h.midpoint(I,P,T3),F=0;for(p=0;p<m;p+=n){o.x=e[p]+t.x,o.y=e[p+1]+t.y,o.z=e[p+2]+t.z;let M=h.magnitude(h.subtract(o,v,Qs));M>F&&(F=M);let b=h.magnitudeSquared(h.subtract(o,L,Qs));if(b>Z){let R=Math.sqrt(b);G=(G+R)*.5,Z=G*G;let E=R-G;L.x=(G*L.x+E*o.x)/R,L.y=(G*L.y+E*o.y)/R,L.z=(G*L.z+E*o.z)/R}}return G<F?(h.clone(L,i.center),i.radius=G):(h.clone(v,i.center),i.radius=F),i};yn.fromEncodedCartesianVertices=function(e,t,n){if(l(n)||(n=new yn),!l(e)||!l(t)||e.length!==t.length||e.length===0)return n.center=h.clone(h.ZERO,n.center),n.radius=0,n;let i=y3;i.x=e[0]+t[0],i.y=e[1]+t[1],i.z=e[2]+t[2];let o=h.clone(i,u3),r=h.clone(i,m3),s=h.clone(i,h3),a=h.clone(i,f3),c=h.clone(i,p3),d=h.clone(i,b3),u=e.length,m;for(m=0;m<u;m+=3){let F=e[m]+t[m],M=e[m+1]+t[m+1],b=e[m+2]+t[m+2];i.x=F,i.y=M,i.z=b,F<o.x&&h.clone(i,o),F>a.x&&h.clone(i,a),M<r.y&&h.clone(i,r),M>c.y&&h.clone(i,c),b<s.z&&h.clone(i,s),b>d.z&&h.clone(i,d)}let p=h.magnitudeSquared(h.subtract(a,o,Qs)),y=h.magnitudeSquared(h.subtract(c,r,Qs)),f=h.magnitudeSquared(h.subtract(d,s,Qs)),x=o,_=a,C=p;y>C&&(C=y,x=r,_=c),f>C&&(C=f,x=s,_=d);let V=g3;V.x=(x.x+_.x)*.5,V.y=(x.y+_.y)*.5,V.z=(x.z+_.z)*.5;let L=h.magnitudeSquared(h.subtract(_,V,Qs)),Z=Math.sqrt(L),G=x3;G.x=o.x,G.y=r.y,G.z=s.z;let I=_3;I.x=a.x,I.y=c.y,I.z=d.z;let P=h.midpoint(G,I,T3),v=0;for(m=0;m<u;m+=3){i.x=e[m]+t[m],i.y=e[m+1]+t[m+1],i.z=e[m+2]+t[m+2];let F=h.magnitude(h.subtract(i,P,Qs));F>v&&(v=F);let M=h.magnitudeSquared(h.subtract(i,V,Qs));if(M>L){let b=Math.sqrt(M);Z=(Z+b)*.5,L=Z*Z;let R=b-Z;V.x=(Z*V.x+R*i.x)/b,V.y=(Z*V.y+R*i.y)/b,V.z=(Z*V.z+R*i.z)/b}}return Z<v?(h.clone(V,n.center),n.radius=Z):(h.clone(P,n.center),n.radius=v),n};yn.fromCornerPoints=function(e,t,n){l(n)||(n=new yn);let i=h.midpoint(e,t,n.center);return n.radius=h.distance(i,t),n};yn.fromEllipsoid=function(e,t){return l(t)||(t=new yn),h.clone(h.ZERO,t.center),t.radius=e.maximumRadius,t};var KCe=new h;yn.fromBoundingSpheres=function(e,t){if(l(t)||(t=new yn),!l(e)||e.length===0)return t.center=h.clone(h.ZERO,t.center),t.radius=0,t;let n=e.length;if(n===1)return yn.clone(e[0],t);if(n===2)return yn.union(e[0],e[1],t);let i=[],o;for(o=0;o<n;o++)i.push(e[o].center);t=yn.fromPoints(i,t);let r=t.center,s=t.radius;for(o=0;o<n;o++){let a=e[o];s=Math.max(s,h.distance(r,a.center,KCe)+a.radius)}return t.radius=s,t};var zCe=new h,JCe=new h,QCe=new h;yn.fromOrientedBoundingBox=function(e,t){l(t)||(t=new yn);let n=e.halfAxes,i=q.getColumn(n,0,zCe),o=q.getColumn(n,1,JCe),r=q.getColumn(n,2,QCe);return h.add(i,o,i),h.add(i,r,i),t.center=h.clone(e.center,t.center),t.radius=h.magnitude(i),t};var jCe=new h,qCe=new h;yn.fromTransformation=function(e,t){l(t)||(t=new yn);let n=A.getTranslation(e,jCe),i=A.getScale(e,qCe),o=.5*h.magnitude(i);return t.center=h.clone(n,t.center),t.radius=o,t};yn.clone=function(e,t){if(l(e))return l(t)?(t.center=h.clone(e.center,t.center),t.radius=e.radius,t):new yn(e.center,e.radius)};yn.packedLength=4;yn.pack=function(e,t,n){n=g(n,0);let i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t};yn.unpack=function(e,t,n){t=g(t,0),l(n)||(n=new yn);let i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var $Ce=new h,e1e=new h;yn.union=function(e,t,n){l(n)||(n=new yn);let i=e.center,o=e.radius,r=t.center,s=t.radius,a=h.subtract(r,i,$Ce),c=h.magnitude(a);if(o>=c+s)return e.clone(n),n;if(s>=c+o)return t.clone(n),n;let d=(o+c+s)*.5,u=h.multiplyByScalar(a,(-o+d)/c,e1e);return h.add(u,i,u),h.clone(u,n.center),n.radius=d,n};var t1e=new h;yn.expand=function(e,t,n){n=yn.clone(e,n);let i=h.magnitude(h.subtract(t,n.center,t1e));return i>n.radius&&(n.radius=i),n};yn.intersectPlane=function(e,t){let n=e.center,i=e.radius,o=t.normal,r=h.dot(o,n)+t.distance;return r<-i?nn.OUTSIDE:r<i?nn.INTERSECTING:nn.INSIDE};yn.transform=function(e,t,n){return l(n)||(n=new yn),n.center=A.multiplyByPoint(t,e.center,n.center),n.radius=A.getMaximumScale(t)*e.radius,n};var n1e=new h;yn.distanceSquaredTo=function(e,t){let n=h.subtract(e.center,t,n1e),i=h.magnitude(n)-e.radius;return i<=0?0:i*i};yn.transformWithoutScale=function(e,t,n){return l(n)||(n=new yn),n.center=A.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var i1e=new h;yn.computePlaneDistances=function(e,t,n,i){l(i)||(i=new xa);let o=h.subtract(e.center,t,i1e),r=h.dot(n,o);return i.start=r-e.radius,i.stop=r+e.radius,i};var G6=new h,o1e=new h,r1e=new h,s1e=new h,a1e=new h,c1e=new he,E6=new Array(8);for(let e=0;e<8;++e)E6[e]=new h;var l1e=new Ri;yn.projectTo2D=function(e,t,n){t=g(t,l1e);let i=t.ellipsoid,o=e.center,r=e.radius,s;h.equals(o,h.ZERO)?s=h.clone(h.UNIT_X,G6):s=i.geodeticSurfaceNormal(o,G6);let a=h.cross(h.UNIT_Z,s,o1e);h.normalize(a,a);let c=h.cross(s,a,r1e);h.normalize(c,c),h.multiplyByScalar(s,r,s),h.multiplyByScalar(c,r,c),h.multiplyByScalar(a,r,a);let d=h.negate(c,a1e),u=h.negate(a,s1e),m=E6,p=m[0];h.add(s,c,p),h.add(p,a,p),p=m[1],h.add(s,c,p),h.add(p,u,p),p=m[2],h.add(s,d,p),h.add(p,u,p),p=m[3],h.add(s,d,p),h.add(p,a,p),h.negate(s,s),p=m[4],h.add(s,c,p),h.add(p,a,p),p=m[5],h.add(s,c,p),h.add(p,u,p),p=m[6],h.add(s,d,p),h.add(p,u,p),p=m[7],h.add(s,d,p),h.add(p,a,p);let y=m.length;for(let C=0;C<y;++C){let V=m[C];h.add(o,V,V);let L=i.cartesianToCartographic(V,c1e);t.project(L,V)}n=yn.fromPoints(m,n),o=n.center;let f=o.x,x=o.y,_=o.z;return o.x=_,o.y=f,o.z=x,n};yn.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)};yn.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&e.radius===t.radius};yn.prototype.intersectPlane=function(e){return yn.intersectPlane(this,e)};yn.prototype.distanceSquaredTo=function(e){return yn.distanceSquaredTo(this,e)};yn.prototype.computePlaneDistances=function(e,t,n){return yn.computePlaneDistances(this,e,t,n)};yn.prototype.isOccluded=function(e){return yn.isOccluded(this,e)};yn.prototype.equals=function(e){return yn.equals(this,e)};yn.prototype.clone=function(e){return yn.clone(this,e)};yn.prototype.volume=function(){let e=this.radius;return DCe*e*e*e};var ce=yn;var W1t=T(S(),1);var Z1t=T(S(),1),d1e={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_RGBA_ASTC_4x4_WEBGL:37808,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGBA_BPTC_UNORM:36492,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},ne=Object.freeze(d1e);var Gn={BYTE:ne.BYTE,UNSIGNED_BYTE:ne.UNSIGNED_BYTE,SHORT:ne.SHORT,UNSIGNED_SHORT:ne.UNSIGNED_SHORT,INT:ne.INT,UNSIGNED_INT:ne.UNSIGNED_INT,FLOAT:ne.FLOAT,DOUBLE:ne.DOUBLE};Gn.getSizeInBytes=function(e){switch(e){case Gn.BYTE:return Int8Array.BYTES_PER_ELEMENT;case Gn.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Gn.SHORT:return Int16Array.BYTES_PER_ELEMENT;case Gn.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Gn.INT:return Int32Array.BYTES_PER_ELEMENT;case Gn.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case Gn.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case Gn.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}};Gn.fromTypedArray=function(e){if(e instanceof Int8Array)return Gn.BYTE;if(e instanceof Uint8Array)return Gn.UNSIGNED_BYTE;if(e instanceof Int16Array)return Gn.SHORT;if(e instanceof Uint16Array)return Gn.UNSIGNED_SHORT;if(e instanceof Int32Array)return Gn.INT;if(e instanceof Uint32Array)return Gn.UNSIGNED_INT;if(e instanceof Float32Array)return Gn.FLOAT;if(e instanceof Float64Array)return Gn.DOUBLE};Gn.validate=function(e){return l(e)&&(e===Gn.BYTE||e===Gn.UNSIGNED_BYTE||e===Gn.SHORT||e===Gn.UNSIGNED_SHORT||e===Gn.INT||e===Gn.UNSIGNED_INT||e===Gn.FLOAT||e===Gn.DOUBLE)};Gn.createTypedArray=function(e,t){switch(e){case Gn.BYTE:return new Int8Array(t);case Gn.UNSIGNED_BYTE:return new Uint8Array(t);case Gn.SHORT:return new Int16Array(t);case Gn.UNSIGNED_SHORT:return new Uint16Array(t);case Gn.INT:return new Int32Array(t);case Gn.UNSIGNED_INT:return new Uint32Array(t);case Gn.FLOAT:return new Float32Array(t);case Gn.DOUBLE:return new Float64Array(t)}};Gn.createArrayBufferView=function(e,t,n,i){switch(n=g(n,0),i=g(i,(t.byteLength-n)/Gn.getSizeInBytes(e)),e){case Gn.BYTE:return new Int8Array(t,n,i);case Gn.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case Gn.SHORT:return new Int16Array(t,n,i);case Gn.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case Gn.INT:return new Int32Array(t,n,i);case Gn.UNSIGNED_INT:return new Uint32Array(t,n,i);case Gn.FLOAT:return new Float32Array(t,n,i);case Gn.DOUBLE:return new Float64Array(t,n,i)}};Gn.fromName=function(e){switch(e){case"BYTE":return Gn.BYTE;case"UNSIGNED_BYTE":return Gn.UNSIGNED_BYTE;case"SHORT":return Gn.SHORT;case"UNSIGNED_SHORT":return Gn.UNSIGNED_SHORT;case"INT":return Gn.INT;case"UNSIGNED_INT":return Gn.UNSIGNED_INT;case"FLOAT":return Gn.FLOAT;case"DOUBLE":return Gn.DOUBLE}};var Q=Object.freeze(Gn);var XZt=T(S(),1);var v1t=T(S(),1),u1e={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},nu=Object.freeze(u1e);var N1t=T(S(),1);function zt(e,t,n,i){this[0]=g(e,0),this[1]=g(n,0),this[2]=g(t,0),this[3]=g(i,0)}zt.packedLength=4;zt.pack=function(e,t,n){return n=g(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t};zt.unpack=function(e,t,n){return t=g(t,0),l(n)||(n=new zt),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n};zt.packArray=function(e,t){let n=e.length,i=n*4;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)zt.pack(e[o],t,o*4);return t};zt.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){let o=i/4;t[o]=zt.unpack(e,i,t[o])}return t};zt.clone=function(e,t){if(l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new zt(e[0],e[2],e[1],e[3])};zt.fromArray=zt.unpack;zt.fromColumnMajorArray=function(e,t){return zt.clone(e,t)};zt.fromRowMajorArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new zt(e[0],e[1],e[2],e[3])};zt.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new zt(e.x,0,0,e.y)};zt.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new zt(e,0,0,e)};zt.fromRotation=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=i,t[2]=-i,t[3]=n,t):new zt(n,-i,i,n)};zt.toArray=function(e,t){return l(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]]};zt.getElementIndex=function(e,t){return e*2+t};zt.getColumn=function(e,t,n){let i=t*2,o=e[i],r=e[i+1];return n.x=o,n.y=r,n};zt.setColumn=function(e,t,n,i){i=zt.clone(e,i);let o=t*2;return i[o]=n.x,i[o+1]=n.y,i};zt.getRow=function(e,t,n){let i=e[t],o=e[t+2];return n.x=i,n.y=o,n};zt.setRow=function(e,t,n,i){return i=zt.clone(e,i),i[t]=n.x,i[t+2]=n.y,i};var m1e=new B;zt.setScale=function(e,t,n){let i=zt.getScale(e,m1e),o=t.x/i.x,r=t.y/i.y;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*r,n[3]=e[3]*r,n};var h1e=new B;zt.setUniformScale=function(e,t,n){let i=zt.getScale(e,h1e),o=t/i.x,r=t/i.y;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*r,n[3]=e[3]*r,n};var I6=new B;zt.getScale=function(e,t){return t.x=B.magnitude(B.fromElements(e[0],e[1],I6)),t.y=B.magnitude(B.fromElements(e[2],e[3],I6)),t};var X6=new B;zt.getMaximumScale=function(e){return zt.getScale(e,X6),B.maximumComponent(X6)};var f1e=new B;zt.setRotation=function(e,t,n){let i=zt.getScale(e,f1e);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.y,n[3]=t[3]*i.y,n};var p1e=new B;zt.getRotation=function(e,t){let n=zt.getScale(e,p1e);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.y,t[3]=e[3]/n.y,t};zt.multiply=function(e,t,n){let i=e[0]*t[0]+e[2]*t[1],o=e[0]*t[2]+e[2]*t[3],r=e[1]*t[0]+e[3]*t[1],s=e[1]*t[2]+e[3]*t[3];return n[0]=i,n[1]=r,n[2]=o,n[3]=s,n};zt.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n};zt.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n};zt.multiplyByVector=function(e,t,n){let i=e[0]*t.x+e[2]*t.y,o=e[1]*t.x+e[3]*t.y;return n.x=i,n.y=o,n};zt.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};zt.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n};zt.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};zt.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};zt.transpose=function(e,t){let n=e[0],i=e[2],o=e[1],r=e[3];return t[0]=n,t[1]=i,t[2]=o,t[3]=r,t};zt.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};zt.equals=function(e,t){return e===t||l(e)&&l(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]};zt.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]};zt.equalsEpsilon=function(e,t,n){return n=g(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n};zt.IDENTITY=Object.freeze(new zt(1,0,0,1));zt.ZERO=Object.freeze(new zt(0,0,0,0));zt.COLUMN0ROW0=0;zt.COLUMN0ROW1=1;zt.COLUMN1ROW0=2;zt.COLUMN1ROW1=3;Object.defineProperties(zt.prototype,{length:{get:function(){return zt.packedLength}}});zt.prototype.clone=function(e){return zt.clone(this,e)};zt.prototype.equals=function(e){return zt.equals(this,e)};zt.prototype.equalsEpsilon=function(e,t){return zt.equalsEpsilon(this,e,t)};zt.prototype.toString=function(){return`(${this[0]}, ${this[2]})
(${this[1]}, ${this[3]})`};var io=zt;var D1t=T(S(),1);var _a={POINTS:ne.POINTS,LINES:ne.LINES,LINE_LOOP:ne.LINE_LOOP,LINE_STRIP:ne.LINE_STRIP,TRIANGLES:ne.TRIANGLES,TRIANGLE_STRIP:ne.TRIANGLE_STRIP,TRIANGLE_FAN:ne.TRIANGLE_FAN};_a.isLines=function(e){return e===_a.LINES||e===_a.LINE_LOOP||e===_a.LINE_STRIP};_a.isTriangles=function(e){return e===_a.TRIANGLES||e===_a.TRIANGLE_STRIP||e===_a.TRIANGLE_FAN};_a.validate=function(e){return e===_a.POINTS||e===_a.LINES||e===_a.LINE_LOOP||e===_a.LINE_STRIP||e===_a.TRIANGLES||e===_a.TRIANGLE_STRIP||e===_a.TRIANGLE_FAN};var Ae=Object.freeze(_a);var Q1t=T(S(),1);function ot(e,t,n,i){this.x=g(e,0),this.y=g(t,0),this.z=g(n,0),this.w=g(i,0)}var GL=new h;ot.fromAxisAngle=function(e,t,n){let i=t/2,o=Math.sin(i);GL=h.normalize(e,GL);let r=GL.x*o,s=GL.y*o,a=GL.z*o,c=Math.cos(i);return l(n)?(n.x=r,n.y=s,n.z=a,n.w=c,n):new ot(r,s,a,c)};var b1e=[1,2,0],y1e=new Array(3);ot.fromRotationMatrix=function(e,t){let n,i,o,r,s,a=e[q.COLUMN0ROW0],c=e[q.COLUMN1ROW1],d=e[q.COLUMN2ROW2],u=a+c+d;if(u>0)n=Math.sqrt(u+1),s=.5*n,n=.5/n,i=(e[q.COLUMN1ROW2]-e[q.COLUMN2ROW1])*n,o=(e[q.COLUMN2ROW0]-e[q.COLUMN0ROW2])*n,r=(e[q.COLUMN0ROW1]-e[q.COLUMN1ROW0])*n;else{let m=b1e,p=0;c>a&&(p=1),d>a&&d>c&&(p=2);let y=m[p],f=m[y];n=Math.sqrt(e[q.getElementIndex(p,p)]-e[q.getElementIndex(y,y)]-e[q.getElementIndex(f,f)]+1);let x=y1e;x[p]=.5*n,n=.5/n,s=(e[q.getElementIndex(f,y)]-e[q.getElementIndex(y,f)])*n,x[y]=(e[q.getElementIndex(y,p)]+e[q.getElementIndex(p,y)])*n,x[f]=(e[q.getElementIndex(f,p)]+e[q.getElementIndex(p,f)])*n,i=-x[0],o=-x[1],r=-x[2]}return l(t)?(t.x=i,t.y=o,t.z=r,t.w=s,t):new ot(i,o,r,s)};var W6=new ot,P6=new ot,S3=new ot,v6=new ot;ot.fromHeadingPitchRoll=function(e,t){return v6=ot.fromAxisAngle(h.UNIT_X,e.roll,W6),S3=ot.fromAxisAngle(h.UNIT_Y,-e.pitch,t),t=ot.multiply(S3,v6,S3),P6=ot.fromAxisAngle(h.UNIT_Z,-e.heading,W6),ot.multiply(P6,t,t)};var hM=new h,C3=new h,hm=new ot,w6=new ot,fM=new ot;ot.packedLength=4;ot.pack=function(e,t,n){return n=g(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};ot.unpack=function(e,t,n){return t=g(t,0),l(n)||(n=new ot),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};ot.packedInterpolationLength=3;ot.convertPackedArrayForInterpolation=function(e,t,n,i){ot.unpack(e,n*4,fM),ot.conjugate(fM,fM);for(let o=0,r=n-t+1;o<r;o++){let s=o*3;ot.unpack(e,(t+o)*4,hm),ot.multiply(hm,fM,hm),hm.w<0&&ot.negate(hm,hm),ot.computeAxis(hm,hM);let a=ot.computeAngle(hm);l(i)||(i=[]),i[s]=hM.x*a,i[s+1]=hM.y*a,i[s+2]=hM.z*a}};ot.unpackInterpolationResult=function(e,t,n,i,o){l(o)||(o=new ot),h.fromArray(e,0,C3);let r=h.magnitude(C3);return ot.unpack(t,i*4,w6),r===0?ot.clone(ot.IDENTITY,hm):ot.fromAxisAngle(C3,r,hm),ot.multiply(hm,w6,o)};ot.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new ot(e.x,e.y,e.z,e.w)};ot.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};ot.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};ot.magnitude=function(e){return Math.sqrt(ot.magnitudeSquared(e))};ot.normalize=function(e,t){let n=1/ot.magnitude(e),i=e.x*n,o=e.y*n,r=e.z*n,s=e.w*n;return t.x=i,t.y=o,t.z=r,t.w=s,t};ot.inverse=function(e,t){let n=ot.magnitudeSquared(e);return t=ot.conjugate(e,t),ot.multiplyByScalar(t,1/n,t)};ot.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};ot.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};ot.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};ot.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};ot.multiply=function(e,t,n){let i=e.x,o=e.y,r=e.z,s=e.w,a=t.x,c=t.y,d=t.z,u=t.w,m=s*a+i*u+o*d-r*c,p=s*c-i*d+o*u+r*a,y=s*d+i*c-o*a+r*u,f=s*u-i*a-o*c-r*d;return n.x=m,n.y=p,n.z=y,n.w=f,n};ot.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};ot.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};ot.computeAxis=function(e,t){let n=e.w;if(Math.abs(n-1)<W.EPSILON6||Math.abs(n+1)<W.EPSILON6)return t.x=1,t.y=t.z=0,t;let i=1/Math.sqrt(1-n*n);return t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t};ot.computeAngle=function(e){return Math.abs(e.w-1)<W.EPSILON6?0:2*Math.acos(e.w)};var V3=new ot;ot.lerp=function(e,t,n,i){return V3=ot.multiplyByScalar(t,n,V3),i=ot.multiplyByScalar(e,1-n,i),ot.add(V3,i,i)};var F6=new ot,L3=new ot,R3=new ot;ot.slerp=function(e,t,n,i){let o=ot.dot(e,t),r=t;if(o<0&&(o=-o,r=F6=ot.negate(t,F6)),1-o<W.EPSILON6)return ot.lerp(e,r,n,i);let s=Math.acos(o);return L3=ot.multiplyByScalar(e,Math.sin((1-n)*s),L3),R3=ot.multiplyByScalar(r,Math.sin(n*s),R3),i=ot.add(L3,R3,i),ot.multiplyByScalar(i,1/Math.sin(s),i)};ot.log=function(e,t){let n=W.acosClamped(e.w),i=0;return n!==0&&(i=n/Math.sin(n)),h.multiplyByScalar(e,i,t)};ot.exp=function(e,t){let n=h.magnitude(e),i=0;return n!==0&&(i=Math.sin(n)/n),t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t.w=Math.cos(n),t};var g1e=new h,x1e=new h,EL=new ot,VS=new ot;ot.computeInnerQuadrangle=function(e,t,n,i){let o=ot.conjugate(t,EL);ot.multiply(o,n,VS);let r=ot.log(VS,g1e);ot.multiply(o,e,VS);let s=ot.log(VS,x1e);return h.add(r,s,r),h.multiplyByScalar(r,.25,r),h.negate(r,r),ot.exp(r,EL),ot.multiply(t,EL,i)};ot.squad=function(e,t,n,i,o,r){let s=ot.slerp(e,t,o,EL),a=ot.slerp(n,i,o,VS);return ot.slerp(s,a,2*o*(1-o),r)};var _1e=new ot,A6=1.9011074535173003,pM=Bt.supportsTypedArrays()?new Float32Array(8):[],bM=Bt.supportsTypedArrays()?new Float32Array(8):[],sp=Bt.supportsTypedArrays()?new Float32Array(8):[],ap=Bt.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;pM[e]=1/(t*n),bM[e]=t/n}pM[7]=A6/(8*17);bM[7]=A6*8/17;ot.fastSlerp=function(e,t,n,i){let o=ot.dot(e,t),r;o>=0?r=1:(r=-1,o=-o);let s=o-1,a=1-n,c=n*n,d=a*a;for(let y=7;y>=0;--y)sp[y]=(pM[y]*c-bM[y])*s,ap[y]=(pM[y]*d-bM[y])*s;let u=r*n*(1+sp[0]*(1+sp[1]*(1+sp[2]*(1+sp[3]*(1+sp[4]*(1+sp[5]*(1+sp[6]*(1+sp[7])))))))),m=a*(1+ap[0]*(1+ap[1]*(1+ap[2]*(1+ap[3]*(1+ap[4]*(1+ap[5]*(1+ap[6]*(1+ap[7])))))))),p=ot.multiplyByScalar(e,m,_1e);return ot.multiplyByScalar(t,u,i),ot.add(p,i,i)};ot.fastSquad=function(e,t,n,i,o,r){let s=ot.fastSlerp(e,t,o,EL),a=ot.fastSlerp(n,i,o,VS);return ot.fastSlerp(s,a,2*o*(1-o),r)};ot.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};ot.equalsEpsilon=function(e,t,n){return n=g(n,0),e===t||l(e)&&l(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n};ot.ZERO=Object.freeze(new ot(0,0,0,0));ot.IDENTITY=Object.freeze(new ot(0,0,0,1));ot.prototype.clone=function(e){return ot.clone(this,e)};ot.prototype.equals=function(e){return ot.equals(this,e)};ot.prototype.equalsEpsilon=function(e,t){return ot.equalsEpsilon(this,e,t)};ot.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Me=ot;var bZt=T(S(),1);var ZRt=T(S(),1);var q1t=T(S(),1);function T1e(e,t,n){let i=0,o=e.length-1,r,s;for(;i<=o;){if(r=~~((i+o)/2),s=n(e[r],t),s<0){i=r+1;continue}if(s>0){o=r-1;continue}return r}return~(o+1)}var Io=T1e;var eVt=T(S(),1);function S1e(e,t,n,i,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=o}var fb=S1e;var VVt=T(S(),1);var cVt=T(S(),1);var nVt=T(S(),1);function C1e(e){return e%4===0&&e%100!==0||e%400===0}var fm=C1e;var M6=[31,28,31,30,31,30,31,31,30,31,30,31];function V1e(e,t,n,i,o,r,s,a){e=g(e,1),t=g(t,1),n=g(n,1),i=g(i,0),o=g(o,0),r=g(r,0),s=g(s,0),a=g(a,!1),this.year=e,this.month=t,this.day=n,this.hour=i,this.minute=o,this.second=r,this.millisecond=s,this.isLeapSecond=a;function x(){_o.typeOf.number.greaterThanOrEquals("Year",e,1),_o.typeOf.number.lessThanOrEquals("Year",e,9999),_o.typeOf.number.greaterThanOrEquals("Month",t,1),_o.typeOf.number.lessThanOrEquals("Month",t,12),_o.typeOf.number.greaterThanOrEquals("Day",n,1),_o.typeOf.number.lessThanOrEquals("Day",n,31),_o.typeOf.number.greaterThanOrEquals("Hour",i,0),_o.typeOf.number.lessThanOrEquals("Hour",i,23),_o.typeOf.number.greaterThanOrEquals("Minute",o,0),_o.typeOf.number.lessThanOrEquals("Minute",o,59),_o.typeOf.bool("IsLeapSecond",a),_o.typeOf.number.greaterThanOrEquals("Second",r,0),_o.typeOf.number.lessThanOrEquals("Second",r,a?60:59),_o.typeOf.number.greaterThanOrEquals("Millisecond",s,0),_o.typeOf.number.lessThan("Millisecond",s,1e3)}function _(){let C=t===2&&fm(e)?M6[t-1]+1:M6[t-1];if(n>C)throw new fe("Month and Day represents invalid date")}}var cp=V1e;var dVt=T(S(),1);function L1e(e,t){this.julianDate=e,this.offset=t}var Di=L1e;var mVt=T(S(),1),R1e={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:24000005e-1},qn=Object.freeze(R1e);var fVt=T(S(),1),Z1e={UTC:0,TAI:1},Qn=Object.freeze(Z1e);var U6=new cp,Z3=[31,28,31,30,31,30,31,31,30,31,30,31],G3=29;function E3(e,t){return Zt.compare(e.julianDate,t.julianDate)}var LS=new Di;function gM(e){LS.julianDate=e;let t=Zt.leapSeconds,n=Io(t,LS,E3);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&Zt.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),Zt.addSeconds(e,i,e)}function N6(e,t){LS.julianDate=e;let n=Zt.leapSeconds,i=Io(n,LS,E3);if(i<0&&(i=~i),i===0)return Zt.addSeconds(e,-n[0].offset,t);if(i>=n.length)return Zt.addSeconds(e,-n[i-1].offset,t);let o=Zt.secondsDifference(n[i].julianDate,e);if(o===0)return Zt.addSeconds(e,-n[i].offset,t);if(!(o<=1))return Zt.addSeconds(e,-n[--i].offset,t)}function pb(e,t,n){let i=t/qn.SECONDS_PER_DAY|0;return e+=i,t-=qn.SECONDS_PER_DAY*i,t<0&&(e--,t+=qn.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function I3(e,t,n,i,o,r,s){let a=(t-14)/12|0,c=e+4800+a,d=(1461*c/4|0)+(367*(t-2-12*a)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);let u=r+(i*qn.SECONDS_PER_HOUR+o*qn.SECONDS_PER_MINUTE+s*qn.SECONDS_PER_MILLISECOND);return u>=43200&&(d-=1),[d,u]}var G1e=/^(\d{4})$/,E1e=/^(\d{4})-(\d{2})$/,I1e=/^(\d{4})-?(\d{3})$/,X1e=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,W1e=/^(\d{4})-?(\d{2})-?(\d{2})$/,X3=/([Z+\-])?(\d{2})?:?(\d{2})?$/,P1e=/^(\d{2})(\.\d+)?/.source+X3.source,v1e=/^(\d{2}):?(\d{2})(\.\d+)?/.source+X3.source,w1e=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+X3.source;function Zt(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=g(e,0),t=g(t,0),n=g(n,Qn.UTC);let i=e|0;t=t+(e-i)*qn.SECONDS_PER_DAY,pb(i,t,this),n===Qn.UTC&&gM(this)}Zt.fromGregorianDate=function(e,t){let n=I3(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return l(t)?(pb(n[0],n[1],t),gM(t),t):new Zt(n[0],n[1],Qn.UTC)};Zt.fromDate=function(e,t){let n=I3(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return l(t)?(pb(n[0],n[1],t),gM(t),t):new Zt(n[0],n[1],Qn.UTC)};Zt.fromIso8601=function(e,t){e=e.replace(",",".");let n=e.split("T"),i,o=1,r=1,s=0,a=0,c=0,d=0,u=n[0],m=n[1],p,y;if(n=u.match(W1e),n!==null)i=+n[1],o=+n[2],r=+n[3];else if(n=u.match(E1e),n!==null)i=+n[1],o=+n[2];else if(n=u.match(G1e),n!==null)i=+n[1];else{let C;if(n=u.match(I1e),n!==null)i=+n[1],C=+n[2],y=fm(i);else if(n=u.match(X1e),n!==null){i=+n[1];let V=+n[2],L=+n[3]||0,Z=new Date(Date.UTC(i,0,4));C=V*7+L-Z.getUTCDay()-3}p=new Date(Date.UTC(i,0,1)),p.setUTCDate(C),o=p.getUTCMonth()+1,r=p.getUTCDate()}y=fm(i);let f;if(l(m)){n=m.match(w1e),n!==null?(s=+n[1],a=+n[2],c=+n[3],d=+(n[4]||0)*1e3,f=5):(n=m.match(v1e),n!==null?(s=+n[1],a=+n[2],c=+(n[3]||0)*60,f=4):(n=m.match(P1e),n!==null&&(s=+n[1],a=+(n[2]||0)*60,f=3)));let C=n[f],V=+n[f+1],L=+(n[f+2]||0);switch(C){case"+":s=s-V,a=a-L;break;case"-":s=s+V,a=a+L;break;case"Z":break;default:a=a+new Date(Date.UTC(i,o-1,r,s,a)).getTimezoneOffset();break}}let x=c===60;for(x&&c--;a>=60;)a-=60,s++;for(;s>=24;)s-=24,r++;for(p=y&&o===2?G3:Z3[o-1];r>p;)r-=p,o++,o>12&&(o-=12,i++),p=y&&o===2?G3:Z3[o-1];for(;a<0;)a+=60,s--;for(;s<0;)s+=24,r--;for(;r<1;)o--,o<1&&(o+=12,i--),p=y&&o===2?G3:Z3[o-1],r+=p;let _=I3(i,o,r,s,a,c,d);return l(t)?(pb(_[0],_[1],t),gM(t)):t=new Zt(_[0],_[1],Qn.UTC),x&&Zt.addSeconds(t,1,t),t};Zt.now=function(e){return Zt.fromDate(new Date,e)};var yM=new Zt(0,0,Qn.TAI);Zt.toGregorianDate=function(e,t){let n=!1,i=N6(e,yM);l(i)||(Zt.addSeconds(e,-1,yM),i=N6(yM,yM),n=!0);let o=i.dayNumber,r=i.secondsOfDay;r>=43200&&(o+=1);let s=o+68569|0,a=4*s/146097|0;s=s-((146097*a+3)/4|0)|0;let c=4e3*(s+1)/1461001|0;s=s-(1461*c/4|0)+31|0;let d=80*s/2447|0,u=s-(2447*d/80|0)|0;s=d/11|0;let m=d+2-12*s|0,p=100*(a-49)+c+s|0,y=r/qn.SECONDS_PER_HOUR|0,f=r-y*qn.SECONDS_PER_HOUR,x=f/qn.SECONDS_PER_MINUTE|0;f=f-x*qn.SECONDS_PER_MINUTE;let _=f|0,C=(f-_)/qn.SECONDS_PER_MILLISECOND;return y+=12,y>23&&(y-=24),n&&(_+=1),l(t)?(t.year=p,t.month=m,t.day=u,t.hour=y,t.minute=x,t.second=_,t.millisecond=C,t.isLeapSecond=n,t):new cp(p,m,u,y,x,_,C,n)};Zt.toDate=function(e){let t=Zt.toGregorianDate(e,U6),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))};Zt.toIso8601=function(e,t){let n=Zt.toGregorianDate(e,U6),i=n.year,o=n.month,r=n.day,s=n.hour,a=n.minute,c=n.second,d=n.millisecond;i===1e4&&o===1&&r===1&&s===0&&a===0&&c===0&&d===0&&(i=9999,o=12,r=31,s=24);let u;return!l(t)&&d!==0?(u=(d*.01).toString().replace(".",""),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${u}Z`):!l(t)||t===0?`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}Z`:(u=(d*.01).toFixed(t).replace(".","").slice(0,t),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${u}Z`)};Zt.clone=function(e,t){if(l(e))return l(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new Zt(e.dayNumber,e.secondsOfDay,Qn.TAI)};Zt.compare=function(e,t){let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};Zt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};Zt.equalsEpsilon=function(e,t,n){return n=g(n,0),e===t||l(e)&&l(t)&&Math.abs(Zt.secondsDifference(e,t))<=n};Zt.totalDays=function(e){return e.dayNumber+e.secondsOfDay/qn.SECONDS_PER_DAY};Zt.secondsDifference=function(e,t){return(e.dayNumber-t.dayNumber)*qn.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};Zt.daysDifference=function(e,t){let n=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/qn.SECONDS_PER_DAY;return n+i};Zt.computeTaiMinusUtc=function(e){LS.julianDate=e;let t=Zt.leapSeconds,n=Io(t,LS,E3);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};Zt.addSeconds=function(e,t,n){return pb(e.dayNumber,e.secondsOfDay+t,n)};Zt.addMinutes=function(e,t,n){let i=e.secondsOfDay+t*qn.SECONDS_PER_MINUTE;return pb(e.dayNumber,i,n)};Zt.addHours=function(e,t,n){let i=e.secondsOfDay+t*qn.SECONDS_PER_HOUR;return pb(e.dayNumber,i,n)};Zt.addDays=function(e,t,n){let i=e.dayNumber+t;return pb(i,e.secondsOfDay,n)};Zt.lessThan=function(e,t){return Zt.compare(e,t)<0};Zt.lessThanOrEquals=function(e,t){return Zt.compare(e,t)<=0};Zt.greaterThan=function(e,t){return Zt.compare(e,t)>0};Zt.greaterThanOrEquals=function(e,t){return Zt.compare(e,t)>=0};Zt.prototype.clone=function(e){return Zt.clone(this,e)};Zt.prototype.equals=function(e){return Zt.equals(this,e)};Zt.prototype.equalsEpsilon=function(e,t){return Zt.equalsEpsilon(this,e,t)};Zt.prototype.toString=function(){return Zt.toIso8601(this)};Zt.leapSeconds=[new Di(new Zt(2441317,43210,Qn.TAI),10),new Di(new Zt(2441499,43211,Qn.TAI),11),new Di(new Zt(2441683,43212,Qn.TAI),12),new Di(new Zt(2442048,43213,Qn.TAI),13),new Di(new Zt(2442413,43214,Qn.TAI),14),new Di(new Zt(2442778,43215,Qn.TAI),15),new Di(new Zt(2443144,43216,Qn.TAI),16),new Di(new Zt(2443509,43217,Qn.TAI),17),new Di(new Zt(2443874,43218,Qn.TAI),18),new Di(new Zt(2444239,43219,Qn.TAI),19),new Di(new Zt(2444786,43220,Qn.TAI),20),new Di(new Zt(2445151,43221,Qn.TAI),21),new Di(new Zt(2445516,43222,Qn.TAI),22),new Di(new Zt(2446247,43223,Qn.TAI),23),new Di(new Zt(2447161,43224,Qn.TAI),24),new Di(new Zt(2447892,43225,Qn.TAI),25),new Di(new Zt(2448257,43226,Qn.TAI),26),new Di(new Zt(2448804,43227,Qn.TAI),27),new Di(new Zt(2449169,43228,Qn.TAI),28),new Di(new Zt(2449534,43229,Qn.TAI),29),new Di(new Zt(2450083,43230,Qn.TAI),30),new Di(new Zt(2450630,43231,Qn.TAI),31),new Di(new Zt(2451179,43232,Qn.TAI),32),new Di(new Zt(2453736,43233,Qn.TAI),33),new Di(new Zt(2454832,43234,Qn.TAI),34),new Di(new Zt(2456109,43235,Qn.TAI),35),new Di(new Zt(2457204,43236,Qn.TAI),36),new Di(new Zt(2457754,43237,Qn.TAI),37)];var te=Zt;var pRt=T(S(),1),rq=T($l(),1);var IVt=T(S(),1);function F1e(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var IL=F1e;var PVt=T(S(),1);function K6(e,t){if(e===null||typeof e!="object")return e;t=g(t,!1);let n=new e.constructor;for(let i in e)if(e.hasOwnProperty(i)){let o=e[i];t&&(o=K6(o,t)),n[i]=o}return n}var ze=K6;var AVt=T(S(),1);function z6(e,t,n){n=g(n,!1);let i={},o=l(e),r=l(t),s,a,c;if(o)for(s in e)e.hasOwnProperty(s)&&(a=e[s],r&&n&&typeof a=="object"&&t.hasOwnProperty(s)?(c=t[s],typeof c=="object"?i[s]=z6(a,c,n):i[s]=a):i[s]=a);if(r)for(s in t)t.hasOwnProperty(s)&&!i.hasOwnProperty(s)&&(c=t[s],i[s]=c);return i}var Tt=z6;var NVt=T(S(),1);function A1e(){let e,t,n=new Promise(function(i,o){e=i,t=o});return{resolve:e,reject:t,promise:n}}var hl=A1e;var BVt=T(S(),1),J6=T($l(),1);function W3(e,t){let n;return typeof document<"u"&&(n=document),W3._implementation(e,t,n)}W3._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=g(n.baseURI,n.location.href)}let i=new J6.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var Ah=W3;var YVt=T(S(),1),Q6=T($l(),1);function M1e(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new Q6.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var XL=M1e;var KVt=T(S(),1),j6=T($l(),1);function N1e(e){let t=new j6.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),i=n.lastIndexOf("."),i===-1?n="":n=n.substr(i+1),n}var Dg=N1e;var QVt=T(S(),1);var q6={};function U1e(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=q6[t];l(i)||(i={},q6[t]=i);let o=i[n];if(!l(o)){let r=document.createElement("canvas");r.width=t,r.height=n,o=r.getContext("2d",{willReadFrequently:!0}),o.globalCompositeOperation="copy",i[n]=o}return o.drawImage(e,0,0,t,n),o.getImageData(0,0,t,n).data}var pm=U1e;var qVt=T(S(),1);var k1e=/^blob:/i;function D1e(e){return k1e.test(e)}var Bg=D1e;var tLt=T(S(),1);var Mh;function B1e(e){l(Mh)||(Mh=document.createElement("a")),Mh.href=window.location.href;let t=Mh.host,n=Mh.protocol;return Mh.href=e,Mh.href=Mh.href,n!==Mh.protocol||t!==Mh.host}var Og=B1e;var iLt=T(S(),1);var O1e=/^data:/i;function Y1e(e){return O1e.test(e)}var lp=Y1e;var rLt=T(S(),1);function H1e(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,i)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let o=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,o.removeChild(t),n()},t.onerror=function(r){i(r)},o.appendChild(t)})}var Yg=H1e;var aLt=T(S(),1);function K1e(e){let t="";for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=`${encodeURIComponent(n)}=`;if(Array.isArray(i))for(let r=0,s=i.length;r<s;++r)t+=`${o+encodeURIComponent(i[r])}&`;else t+=`${o+encodeURIComponent(i)}&`}return t=t.slice(0,-1),t}var Hg=K1e;var dLt=T(S(),1);function z1e(e){let t={};if(e==="")return t;let n=e.replace(/\+/g,"%20").split(/[&;]/);for(let i=0,o=n.length;i<o;++i){let r=n[i].split("="),s=decodeURIComponent(r[0]),a=r[1];l(a)?a=decodeURIComponent(a):a="";let c=t[s];typeof c=="string"?t[s]=[c,a]:Array.isArray(c)?c.push(a):t[s]=a}return t}var ed=z1e;var _Lt=T(S(),1);var mLt=T(S(),1),J1e={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},ti=Object.freeze(J1e);var fLt=T(S(),1),Q1e={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},os=Object.freeze(Q1e);function SM(e){e=g(e,g.EMPTY_OBJECT);let t=g(e.throttleByServer,!1),n=g(e.throttle,!1);this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=g(e.priority,0),this.throttle=n,this.throttleByServer=t,this.type=g(e.type,os.OTHER),this.serverKey=e.serverKey,this.state=ti.UNISSUED,this.deferred=void 0,this.cancelled=!1}SM.prototype.cancel=function(){this.cancelled=!0};SM.prototype.clone=function(e){return l(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=ti.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new SM(this)};var Yo=SM;var RLt=T(S(),1);var SLt=T(S(),1);function j1e(e){let t={};if(!e)return t;let n=e.split(`\r
`);for(let i=0;i<n.length;++i){let o=n[i],r=o.indexOf(": ");if(r>0){let s=o.substring(0,r),a=o.substring(r+2);t[s]=a}}return t}var WL=j1e;function $6(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=WL(this.responseHeaders))}$6.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var Nh=$6;var ULt=T(S(),1),CM=T($l(),1);var ILt=T(S(),1);function Kg(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(Kg.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){let t=this._length;if(e<t){let n=this._array;for(let i=e;i<t;++i)n[i]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function P3(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}Kg.prototype.reserve=function(e){e=g(e,this._length),this._array.length=e};Kg.prototype.heapify=function(e){e=g(e,0);let t=this._length,n=this._comparator,i=this._array,o=-1,r=!0;for(;r;){let s=2*(e+1),a=s-1;a<t&&n(i[a],i[e])<0?o=a:o=e,s<t&&n(i[s],i[o])<0&&(o=s),o!==e?(P3(i,o,e),e=o):r=!1}};Kg.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};Kg.prototype.insert=function(e){let t=this._array,n=this._comparator,i=this._maximumLength,o=this._length++;for(o<t.length?t[o]=e:t.push(e);o!==0;){let s=Math.floor((o-1)/2);if(n(t[o],t[s])<0)P3(t,o,s),o=s;else break}let r;return l(i)&&this._length>i&&(r=t[i],this._length=i),r};Kg.prototype.pop=function(e){if(e=g(e,0),this._length===0)return;let t=this._array,n=t[e];return P3(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var PL=Kg;function q1e(e,t){return e.priority-t.priority}var oo={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},GS=20,Ya=new PL({comparator:q1e});Ya.maximumLength=GS;Ya.reserve(GS);var Uh=[],dp={},$1e=typeof document<"u"?new CM.default(document.location.href):new CM.default,VM=new ye;function Ho(){}Ho.maximumRequests=50;Ho.maximumRequestsPerServer=18;Ho.requestsByServer={};Ho.throttleRequests=!0;Ho.debugShowStatistics=!1;Ho.requestCompletedEvent=VM;Object.defineProperties(Ho,{statistics:{get:function(){return oo}},priorityHeapLength:{get:function(){return GS},set:function(e){if(e<GS)for(;Ya.length>e;){let t=Ya.pop();zg(t)}GS=e,Ya.maximumLength=e,Ya.reserve(e)}}});function eq(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}Ho.serverHasOpenSlots=function(e,t){t=g(t,1);let n=g(Ho.requestsByServer[e],Ho.maximumRequestsPerServer);return dp[e]+t<=n};Ho.heapHasOpenSlots=function(e){return Ya.length+e<=GS};function tq(e){return e.state===ti.UNISSUED&&(e.state=ti.ISSUED,e.deferred=hl()),e.deferred.promise}function eVe(e){return function(t){if(e.state===ti.CANCELLED)return;let n=e.deferred;--oo.numberOfActiveRequests,--dp[e.serverKey],VM.raiseEvent(),e.state=ti.RECEIVED,e.deferred=void 0,n.resolve(t)}}function tVe(e){return function(t){e.state!==ti.CANCELLED&&(++oo.numberOfFailedRequests,--oo.numberOfActiveRequests,--dp[e.serverKey],VM.raiseEvent(t),e.state=ti.FAILED,e.deferred.reject(t))}}function nq(e){let t=tq(e);return e.state=ti.ACTIVE,Uh.push(e),++oo.numberOfActiveRequests,++oo.numberOfActiveRequestsEver,++dp[e.serverKey],e.requestFunction().then(eVe(e)).catch(tVe(e)),t}function zg(e){let t=e.state===ti.ACTIVE;if(e.state=ti.CANCELLED,++oo.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--oo.numberOfActiveRequests,--dp[e.serverKey],++oo.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}Ho.update=function(){let e,t,n=0,i=Uh.length;for(e=0;e<i;++e){if(t=Uh[e],t.cancelled&&zg(t),t.state!==ti.ACTIVE){++n;continue}n>0&&(Uh[e-n]=t)}Uh.length-=n;let o=Ya.internalArray,r=Ya.length;for(e=0;e<r;++e)eq(o[e]);Ya.resort();let s=Math.max(Ho.maximumRequests-Uh.length,0),a=0;for(;a<s&&Ya.length>0;){if(t=Ya.pop(),t.cancelled){zg(t);continue}if(t.throttleByServer&&!Ho.serverHasOpenSlots(t.serverKey)){zg(t);continue}nq(t),++a}nVe()};Ho.getServerKey=function(e){let t=new CM.default(e);t.scheme()===""&&(t=t.absoluteTo($1e),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=dp[n];return l(i)||(dp[n]=0),n};Ho.request=function(e){if(lp(e.url)||Bg(e.url))return VM.raiseEvent(),e.state=ti.RECEIVED,e.requestFunction();if(++oo.numberOfAttemptedRequests,l(e.serverKey)||(e.serverKey=Ho.getServerKey(e.url)),Ho.throttleRequests&&e.throttleByServer&&!Ho.serverHasOpenSlots(e.serverKey))return;if(!Ho.throttleRequests||!e.throttle)return nq(e);if(Uh.length>=Ho.maximumRequests)return;eq(e);let t=Ya.insert(e);if(l(t)){if(t===e)return;zg(t)}return tq(e)};function nVe(){Ho.debugShowStatistics&&(oo.numberOfActiveRequests===0&&oo.lastNumberOfActiveRequests>0&&(oo.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${oo.numberOfAttemptedRequests}`),oo.numberOfAttemptedRequests=0),oo.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${oo.numberOfCancelledRequests}`),oo.numberOfCancelledRequests=0),oo.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${oo.numberOfCancelledActiveRequests}`),oo.numberOfCancelledActiveRequests=0),oo.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${oo.numberOfFailedRequests}`),oo.numberOfFailedRequests=0)),oo.lastNumberOfActiveRequests=oo.numberOfActiveRequests)}Ho.clearForSpecs=function(){for(;Ya.length>0;){let t=Ya.pop();zg(t)}let e=Uh.length;for(let t=0;t<e;++t)zg(Uh[t]);Uh.length=0,dp={},oo.numberOfAttemptedRequests=0,oo.numberOfActiveRequests=0,oo.numberOfCancelledRequests=0,oo.numberOfCancelledActiveRequests=0,oo.numberOfFailedRequests=0,oo.numberOfActiveRequestsEver=0,oo.lastNumberOfActiveRequests=0};Ho.numberOfActiveRequestsByServer=function(e){return dp[e]};Ho.requestHeap=Ya;var Ha=Ho;var BLt=T(S(),1),iq=T($l(),1);var vL={},ES={};vL.add=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(ES[n])||(ES[n]=!0)};vL.remove=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(ES[n])&&delete ES[n]};function iVe(e){let t=new iq.default(e);t.normalize();let n=t.authority();if(n.length!==0){if(t.authority(n),n.indexOf("@")!==-1&&(n=n.split("@")[1]),n.indexOf(":")===-1){let i=t.scheme();if(i.length===0&&(i=window.location.protocol,i=i.substring(0,i.length-1)),i==="http")n+=":80";else if(i==="https")n+=":443";else return}return n}}vL.contains=function(e){let t=iVe(e);return!!(l(t)&&l(ES[t]))};vL.clear=function(){ES={}};var IS=vL;var sq=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function Lt(e){e=g(e,g.EMPTY_OBJECT),typeof e=="string"&&(e={url:e}),this._url=void 0,this._templateValues=kh(e.templateValues,{}),this._queryParameters=kh(e.queryParameters,{}),this.headers=kh(e.headers,{}),this.request=g(e.request,new Yo),this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=g(e.retryAttempts,0),this._retryCount=0,g(e.parseUrl,!0)?this.parseUrl(e.url,!0,!0):this._url=e.url,this._credits=e.credits}function kh(e,t){return l(e)?ze(e):t}Lt.createIfNeeded=function(e){return e instanceof Lt?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new Lt({url:e})};var XS;Lt.supportsImageBitmapOptions=function(){return l(XS)?XS:typeof createImageBitmap!="function"?(XS=Promise.resolve(!1),XS):(XS=Lt.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then(function(t){let n={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(t,n),createImageBitmap(t)])}).then(function(t){let n=pm(t[0]),i=pm(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),XS)};Object.defineProperties(Lt,{isBlobSupported:{get:function(){return sq}}});Object.defineProperties(Lt.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){this.parseUrl(e,!1,!1)}},extension:{get:function(){return Dg(this._url)}},isDataUri:{get:function(){return lp(this._url)}},isBlobUri:{get:function(){return Bg(this._url)}},isCrossOriginUrl:{get:function(){return Og(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});Lt.prototype.toString=function(){return this.getUrlComponent(!0,!0)};Lt.prototype.parseUrl=function(e,t,n,i){let o=new rq.default(e),r=oVe(o.query());this._queryParameters=t?RM(r,this.queryParameters,n):r,o.search(""),o.fragment(""),l(i)&&o.scheme()===""&&(o=o.absoluteTo(Ah(i))),this._url=o.toString()};function oVe(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:ed(e)}function RM(e,t,n){if(!n)return Tt(e,t);let i=ze(e,!0);for(let o in t)if(t.hasOwnProperty(o)){let r=i[o],s=t[o];l(r)?(Array.isArray(r)||(r=i[o]=[r]),i[o]=r.concat(s)):i[o]=Array.isArray(s)?s.slice():s}return i}Lt.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${rVe(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let i=this._templateValues;return Object.keys(i).length>0&&(n=n.replace(/{(.*?)}/g,function(o,r){let s=i[r];return l(s)?encodeURIComponent(s):o})),t&&l(this.proxy)&&(n=this.proxy.getURL(n)),n};function rVe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${Hg(e)}`}Lt.prototype.setQueryParameters=function(e,t){t?this._queryParameters=RM(this._queryParameters,e,!1):this._queryParameters=RM(e,this._queryParameters,!1)};Lt.prototype.appendQueryParameters=function(e){this._queryParameters=RM(e,this._queryParameters,!0)};Lt.prototype.setTemplateValues=function(e,t){t?this._templateValues=Tt(this._templateValues,e):this._templateValues=Tt(e,this._templateValues)};Lt.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,l(e.url)){let n=g(e.preserveQueryParameters,!1);t.parseUrl(e.url,!0,n,this._url)}return l(e.queryParameters)&&(t._queryParameters=Tt(e.queryParameters,t.queryParameters)),l(e.templateValues)&&(t._templateValues=Tt(e.templateValues,t.templateValues)),l(e.headers)&&(t.headers=Tt(e.headers,t.headers)),l(e.proxy)&&(t.proxy=e.proxy),l(e.request)&&(t.request=e.request),l(e.retryCallback)&&(t.retryCallback=e.retryCallback),l(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};Lt.prototype.retryOnError=function(e){let t=this.retryCallback;if(typeof t!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);let n=this;return Promise.resolve(t(this,e)).then(function(i){return++n._retryCount,i})};Lt.prototype.clone=function(e){return l(e)?(e._url=this._url,e._queryParameters=ze(this._queryParameters),e._templateValues=ze(this._templateValues),e.headers=ze(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new Lt({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1,credits:l(this.credits)?this.credits.slice():void 0})};Lt.prototype.getBaseUri=function(e){return XL(this.getUrlComponent(e),e)};Lt.prototype.appendForwardSlash=function(){this._url=IL(this._url)};Lt.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};Lt.fetchArrayBuffer=function(e){return new Lt(e).fetchArrayBuffer()};Lt.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};Lt.fetchBlob=function(e){return new Lt(e).fetchBlob()};Lt.prototype.fetchImage=function(e){e=g(e,g.EMPTY_OBJECT);let t=g(e.preferImageBitmap,!1),n=g(e.preferBlob,!1),i=g(e.flipY,!1),o=g(e.skipColorSpaceConversion,!1);if(w3(this.request),!sq||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return v3({resource:this,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:t});let r=this.fetchBlob();if(!l(r))return;let s,a,c,d;return Lt.supportsImageBitmapOptions().then(function(u){return s=u,a=s&&t,r}).then(function(u){if(!l(u))return;if(d=u,a)return Lt.createImageBitmapFromBlob(u,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o});let m=window.URL.createObjectURL(u);return c=new Lt({url:m}),v3({resource:c,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(u){if(l(u))return u.blob=d,a||window.URL.revokeObjectURL(c.url),u}).catch(function(u){return l(c)&&window.URL.revokeObjectURL(c.url),u.blob=d,Promise.reject(u)})};function v3(e){let t=e.resource,n=e.flipY,i=e.skipColorSpaceConversion,o=e.preferImageBitmap,r=t.request;r.url=t.url,r.requestFunction=function(){let a=!1;!t.isDataUri&&!t.isBlobUri&&(a=t.isCrossOriginUrl);let c=hl();return Lt._Implementations.createImage(r,a,c,n,i,o),c.promise};let s=Ha.request(r);if(l(s))return s.catch(function(a){return r.state!==ti.FAILED?Promise.reject(a):t.retryOnError(a).then(function(c){return c?(r.state=ti.UNISSUED,r.deferred=void 0,v3({resource:t,flipY:n,skipColorSpaceConversion:i,preferImageBitmap:o})):Promise.reject(a)})})}Lt.fetchImage=function(e){return new Lt(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};Lt.prototype.fetchText=function(){return this.fetch({responseType:"text"})};Lt.fetchText=function(e){return new Lt(e).fetchText()};Lt.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(l(e))return e.then(function(t){if(l(t))return JSON.parse(t)})};Lt.fetchJson=function(e){return new Lt(e).fetchJson()};Lt.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};Lt.fetchXML=function(e){return new Lt(e).fetchXML()};Lt.prototype.fetchJsonp=function(e){e=g(e,"callback"),w3(this.request);let t;do t=`loadJsonp${W.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return aq(this,e,t)};function aq(e,t,n){let i={};i[t]=n,e.setQueryParameters(i);let o=e.request,r=e.url;o.url=r,o.requestFunction=function(){let a=hl();return window[n]=function(c){a.resolve(c);try{delete window[n]}catch{window[n]=void 0}},Lt._Implementations.loadAndExecuteScript(r,n,a),a.promise};let s=Ha.request(o);if(l(s))return s.catch(function(a){return o.state!==ti.FAILED?Promise.reject(a):e.retryOnError(a).then(function(c){return c?(o.state=ti.UNISSUED,o.deferred=void 0,aq(e,t,n)):Promise.reject(a)})})}Lt.fetchJsonp=function(e){return new Lt(e).fetchJsonp(e.callbackParameterName)};Lt.prototype._makeRequest=function(e){let t=this;w3(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let r=e.responseType,s=Tt(e.headers,t.headers),a=e.overrideMimeType,c=e.method,d=e.data,u=hl(),m=Lt._Implementations.loadWithXhr(i,r,c,d,s,u,a);return l(m)&&l(m.abort)&&(n.cancelFunction=function(){m.abort()}),u.promise};let o=Ha.request(n);if(l(o))return o.then(function(r){return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==ti.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=ti.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};function w3(e){if(e.state===ti.ISSUED||e.state===ti.ACTIVE)throw new me("The Resource is already being fetched.");e.state=ti.UNISSUED,e.deferred=void 0}var sVe=/^data:(.*?)(;base64)?,(.*)$/;function LM(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function oq(e,t){let n=LM(e,t),i=new ArrayBuffer(n.length),o=new Uint8Array(i);for(let r=0;r<n.length;r++)o[r]=n.charCodeAt(r);return i}function aVe(e,t){t=g(t,"");let n=e[1],i=!!e[2],o=e[3],r,s;switch(t){case"":case"text":return LM(i,o);case"arraybuffer":return oq(i,o);case"blob":return r=oq(i,o),new Blob([r],{type:n});case"document":return s=new DOMParser,s.parseFromString(LM(i,o),n);case"json":return JSON.parse(LM(i,o));default:}}Lt.prototype.fetch=function(e){return e=kh(e,{}),e.method="GET",this._makeRequest(e)};Lt.fetch=function(e){return new Lt(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Lt.prototype.delete=function(e){return e=kh(e,{}),e.method="DELETE",this._makeRequest(e)};Lt.delete=function(e){return new Lt(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};Lt.prototype.head=function(e){return e=kh(e,{}),e.method="HEAD",this._makeRequest(e)};Lt.head=function(e){return new Lt(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Lt.prototype.options=function(e){return e=kh(e,{}),e.method="OPTIONS",this._makeRequest(e)};Lt.options=function(e){return new Lt(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Lt.prototype.post=function(e,t){return _o.defined("data",e),t=kh(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};Lt.post=function(e){return new Lt(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Lt.prototype.put=function(e,t){return _o.defined("data",e),t=kh(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};Lt.put=function(e){return new Lt(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Lt.prototype.patch=function(e,t){return _o.defined("data",e),t=kh(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};Lt.patch=function(e){return new Lt(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Lt._Implementations={};Lt._Implementations.loadImageElement=function(e,t,n){let i=new Image;i.onload=function(){i.naturalWidth===0&&i.naturalHeight===0&&i.width===0&&i.height===0&&(i.width=300,i.height=150),n.resolve(i)},i.onerror=function(o){n.reject(o)},t&&(IS.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e};Lt._Implementations.createImage=function(e,t,n,i,o,r){let s=e.url;Lt.supportsImageBitmapOptions().then(function(a){if(!(a&&r)){Lt._Implementations.loadImageElement(s,t,n);return}let c="blob",d="GET",u=hl(),m=Lt._Implementations.loadWithXhr(s,c,d,void 0,void 0,u,void 0,void 0,void 0);return l(m)&&l(m.abort)&&(e.cancelFunction=function(){m.abort()}),u.promise.then(function(p){if(!l(p)){n.reject(new me(`Successfully retrieved ${s} but it contained no content.`));return}return Lt.createImageBitmapFromBlob(p,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o})}).then(function(p){n.resolve(p)})}).catch(function(a){n.reject(a)})};Lt.createImageBitmapFromBlob=function(e,t){return _o.defined("options",t),_o.typeOf.bool("options.flipY",t.flipY),_o.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),_o.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function cVe(e,t,n,i,o,r,s){fetch(e,{method:n,headers:o}).then(async a=>{if(!a.ok){let c={};a.headers.forEach((d,u)=>{c[u]=d}),r.reject(new Nh(a.status,a,c));return}switch(t){case"text":r.resolve(a.text());break;case"json":r.resolve(a.json());break;default:r.resolve(new Uint8Array(await a.arrayBuffer()).buffer);break}}).catch(()=>{r.reject(new Nh)})}var lVe=typeof XMLHttpRequest>"u";Lt._Implementations.loadWithXhr=function(e,t,n,i,o,r,s){let a=sVe.exec(e);if(a!==null){r.resolve(aVe(a,t));return}if(lVe){cVe(e,t,n,i,o,r,s);return}let c=new XMLHttpRequest;if(IS.contains(e)&&(c.withCredentials=!0),c.open(n,e,!0),l(s)&&l(c.overrideMimeType)&&c.overrideMimeType(s),l(o))for(let u in o)o.hasOwnProperty(u)&&c.setRequestHeader(u,o[u]);l(t)&&(c.responseType=t);let d=!1;return typeof e=="string"&&(d=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(d&&c.status===0)){r.reject(new Nh(c.status,c.response,c.getAllResponseHeaders()));return}let u=c.response,m=c.responseType;if(n==="HEAD"||n==="OPTIONS"){let y=c.getAllResponseHeaders().trim().split(/[\r\n]+/),f={};y.forEach(function(x){let _=x.split(": "),C=_.shift();f[C]=_.join(": ")}),r.resolve(f);return}if(c.status===204)r.resolve(void 0);else if(l(u)&&(!l(t)||m===t))r.resolve(u);else if(t==="json"&&typeof u=="string")try{r.resolve(JSON.parse(u))}catch(p){r.reject(p)}else(m===""||m==="document")&&l(c.responseXML)&&c.responseXML.hasChildNodes()?r.resolve(c.responseXML):(m===""||m==="text")&&l(c.responseText)?r.resolve(c.responseText):r.reject(new me("Invalid XMLHttpRequest response type."))},c.onerror=function(u){r.reject(new Nh)},c.send(i),c};Lt._Implementations.loadAndExecuteScript=function(e,t,n){return Yg(e,t).catch(function(i){n.reject(i)})};Lt._DefaultImplementations={};Lt._DefaultImplementations.createImage=Lt._Implementations.createImage;Lt._DefaultImplementations.loadWithXhr=Lt._Implementations.loadWithXhr;Lt._DefaultImplementations.loadAndExecuteScript=Lt._Implementations.loadAndExecuteScript;Lt.DEFAULT=Object.freeze(new Lt({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var Xe=Lt;function FL(e){e=g(e,g.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._addNewLeapSeconds=g(e.addNewLeapSeconds,!0),l(e.data)?cq(this,e.data):cq(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}FL.fromUrl=async function(e,t){t=g(t,g.EMPTY_OBJECT);let n=Xe.createIfNeeded(e),i;try{i=await n.fetchJson()}catch{throw new me(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new FL({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};FL.NONE=Object.freeze({compute:function(e,t){return l(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new fb(0,0,0,0,0),t}});FL.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new fb(0,0,0,0,0)),this._samples.length===0)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;let n=this._dates,i=this._lastIndex,o=0,r=0;if(l(i)){let a=n[i],c=n[i+1],d=te.lessThanOrEquals(a,e),u=!l(c),m=u||te.greaterThanOrEquals(c,e);if(d&&m)return o=i,!u&&c.equals(e)&&++o,r=o+1,dq(this,n,this._samples,e,o,r,t),t}let s=Io(n,e,te.compare,this._dateColumn);return s>=0?(s<n.length-1&&n[s+1].equals(e)&&++s,o=s,r=s):(r=~s,o=r-1,o<0&&(o=0)),this._lastIndex=o,dq(this,n,this._samples,e,o,r,t),t};function dVe(e,t){return te.compare(e.julianDate,t)}function cq(e,t){if(!l(t.columnNames))throw new me("Error in loaded EOP data: The columnNames property is required.");if(!l(t.samples))throw new me("Error in loaded EOP data: The samples property is required.");let n=t.columnNames.indexOf("modifiedJulianDateUtc"),i=t.columnNames.indexOf("xPoleWanderRadians"),o=t.columnNames.indexOf("yPoleWanderRadians"),r=t.columnNames.indexOf("ut1MinusUtcSeconds"),s=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),a=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),c=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||i<0||o<0||r<0||s<0||a<0||c<0)throw new me("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let d=e._samples=t.samples,u=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=o,e._ut1MinusUtcSecondsColumn=r,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=a,e._taiMinusUtcSecondsColumn=c,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let m,p=e._addNewLeapSeconds;for(let y=0,f=d.length;y<f;y+=e._columnCount){let x=d[y+n],_=d[y+c],C=x+qn.MODIFIED_JULIAN_DATE_DIFFERENCE,V=new te(C,_,Qn.TAI);if(u.push(V),p){if(_!==m&&l(m)){let L=te.leapSeconds,Z=Io(L,V,dVe);if(Z<0){let G=new Di(V,_);L.splice(~Z,0,G)}}m=_}}}function lq(e,t,n,i,o){let r=n*i;o.xPoleWander=t[r+e._xPoleWanderRadiansColumn],o.yPoleWander=t[r+e._yPoleWanderRadiansColumn],o.xPoleOffset=t[r+e._xCelestialPoleOffsetRadiansColumn],o.yPoleOffset=t[r+e._yCelestialPoleOffsetRadiansColumn],o.ut1MinusUtc=t[r+e._ut1MinusUtcSecondsColumn]}function wL(e,t,n){return t+e*(n-t)}function dq(e,t,n,i,o,r,s){let a=e._columnCount;if(r>t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;let c=t[o],d=t[r];if(c.equals(d)||i.equals(c))return lq(e,n,o,a,s),s;if(i.equals(d))return lq(e,n,r,a,s),s;let u=te.secondsDifference(i,c)/te.secondsDifference(d,c),m=o*a,p=r*a,y=n[m+e._ut1MinusUtcSecondsColumn],f=n[p+e._ut1MinusUtcSecondsColumn],x=f-y;if(x>.5||x<-.5){let _=n[m+e._taiMinusUtcSecondsColumn],C=n[p+e._taiMinusUtcSecondsColumn];_!==C&&(d.equals(i)?y=f:f-=C-_)}return s.xPoleWander=wL(u,n[m+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=wL(u,n[m+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=wL(u,n[m+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=wL(u,n[m+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=wL(u,y,f),s}var AL=FL;var WRt=T(S(),1);function Ka(e,t,n){this.heading=g(e,0),this.pitch=g(t,0),this.roll=g(n,0)}Ka.fromQuaternion=function(e,t){l(t)||(t=new Ka);let n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),r=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(s,r),t.roll=Math.atan2(o,i),t.pitch=-W.asinClamped(n),t};Ka.fromDegrees=function(e,t,n,i){return l(i)||(i=new Ka),i.heading=e*W.RADIANS_PER_DEGREE,i.pitch=t*W.RADIANS_PER_DEGREE,i.roll=n*W.RADIANS_PER_DEGREE,i};Ka.clone=function(e,t){if(l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new Ka(e.heading,e.pitch,e.roll)};Ka.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};Ka.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&W.equalsEpsilon(e.heading,t.heading,n,i)&&W.equalsEpsilon(e.pitch,t.pitch,n,i)&&W.equalsEpsilon(e.roll,t.roll,n,i)};Ka.prototype.clone=function(e){return Ka.clone(this,e)};Ka.prototype.equals=function(e){return Ka.equals(this,e)};Ka.prototype.equalsEpsilon=function(e,t,n){return Ka.equalsEpsilon(this,e,t,n)};Ka.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var za=Ka;var JRt=T(S(),1);var ARt=T(S(),1);var uq={};var mq=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function uVe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let i=e[t].getAttribute("src"),o=mq.exec(i);if(o!==null)return o[1]}}var ZM;function hq(e){return typeof document>"u"?e:(l(ZM)||(ZM=document.createElement("a")),ZM.href=e,ZM.href)}var Jg;function fq(){if(l(Jg))return Jg;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:l(uq?.url)?e=Ah(".",uq.url):typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(QA.toUrl)?e=Ah("..",Qg("Core/buildModuleUrl.js")):e=uVe(),Jg=new Xe({url:hq(e)}),Jg.appendForwardSlash(),Jg}function mVe(e){return hq(QA.toUrl(`../${e}`))}function pq(e){return fq().getDerivedResource({url:e}).url}var GM;function Qg(e){return l(GM)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(QA.toUrl)?GM=mVe:GM=pq),GM(e)}Qg._cesiumScriptRegex=mq;Qg._buildModuleUrlFromBaseUrl=pq;Qg._clearBaseResource=function(){Jg=void 0};Qg.setBaseUrl=function(e){Jg=Xe.DEFAULT.getDerivedResource({url:e})};Qg.getCesiumBaseUrl=fq;var on=Qg;var URt=T(S(),1);function hVe(e,t,n){this.x=e,this.y=t,this.s=n}var jg=hVe;function M3(e){e=g(e,g.EMPTY_OBJECT),this._xysFileUrlTemplate=Xe.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=g(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=g(e.sampleZeroJulianEphemerisDate,24423965e-1),this._sampleZeroDateTT=new te(this._sampleZeroJulianEphemerisDate,0,Qn.TAI),this._stepSizeDays=g(e.stepSizeDays,1),this._samplesPerXysFile=g(e.samplesPerXysFile,1e3),this._totalSamples=g(e.totalSamples,27426),this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];let t=this._interpolationOrder,n=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t);for(let r=0;r<=t;++r){n[r]=o,i[r]=r*this._stepSizeDays;for(let s=0;s<=t;++s)s!==r&&(n[r]*=r-s);n[r]=1/n[r]}this._work=new Array(t+1),this._coef=new Array(t+1)}var fVe=new te(0,0,Qn.TAI);function F3(e,t,n){let i=fVe;return i.dayNumber=t,i.secondsOfDay=n,te.daysDifference(i,e._sampleZeroDateTT)}M3.prototype.preload=function(e,t,n,i){let o=F3(this,e,t),r=F3(this,n,i),s=o/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let a=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);let c=s/this._samplesPerXysFile|0,d=a/this._samplesPerXysFile|0,u=[];for(let m=c;m<=d;++m)u.push(A3(this,m));return Promise.all(u)};M3.prototype.computeXysRadians=function(e,t,n){let i=F3(this,e,t);if(i<0)return;let o=i/this._stepSizeDays|0;if(o>=this._totalSamples)return;let r=this._interpolationOrder,s=o-(r/2|0);s<0&&(s=0);let a=s+r;a>=this._totalSamples&&(a=this._totalSamples-1,s=a-r,s<0&&(s=0));let c=!1,d=this._samples;if(l(d[s*3])||(A3(this,s/this._samplesPerXysFile|0),c=!0),l(d[a*3])||(A3(this,a/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new jg(0,0,0);let u=i-s*this._stepSizeDays,m=this._work,p=this._denominators,y=this._coef,f=this._xTable,x,_;for(x=0;x<=r;++x)m[x]=u-f[x];for(x=0;x<=r;++x){for(y[x]=1,_=0;_<=r;++_)_!==x&&(y[x]*=m[_]);y[x]*=p[x];let C=(s+x)*3;n.x+=y[x]*d[C++],n.y+=y[x]*d[C++],n.s+=y[x]*d[C]}return n};function A3(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,i=e._xysFileUrlTemplate;l(i)?n=i.getDerivedResource({templateValues:{0:t}}):n=new Xe({url:on(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let o=n.fetchJson().then(function(r){e._chunkDownloadsInProgress[t]=!1;let s=e._samples,a=r.samples,c=t*e._samplesPerXysFile*3;for(let d=0,u=a.length;d<u;++d)s[c+d]=a[d]});return e._chunkDownloadsInProgress[t]=o,o}var ML=M3;var $i={},N3={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"}},WS={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},U3={},fl={east:new h,north:new h,up:new h,west:new h,south:new h,down:new h},bb=new h,yb=new h,gb=new h;$i.localFrameToFixedFrameGenerator=function(e,t){if(!N3.hasOwnProperty(e)||!N3[e].hasOwnProperty(t))throw new fe("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=N3[e][t],i,o=e+t;return l(U3[o])?i=U3[o]:(i=function(r,s,a){if(l(a)||(a=new A),h.equalsEpsilon(r,h.ZERO,W.EPSILON14))h.unpack(WS[e],0,bb),h.unpack(WS[t],0,yb),h.unpack(WS[n],0,gb);else if(W.equalsEpsilon(r.x,0,W.EPSILON14)&&W.equalsEpsilon(r.y,0,W.EPSILON14)){let c=W.sign(r.z);h.unpack(WS[e],0,bb),e!=="east"&&e!=="west"&&h.multiplyByScalar(bb,c,bb),h.unpack(WS[t],0,yb),t!=="east"&&t!=="west"&&h.multiplyByScalar(yb,c,yb),h.unpack(WS[n],0,gb),n!=="east"&&n!=="west"&&h.multiplyByScalar(gb,c,gb)}else{s=g(s,oe.WGS84),s.geodeticSurfaceNormal(r,fl.up);let c=fl.up,d=fl.east;d.x=-r.y,d.y=r.x,d.z=0,h.normalize(d,fl.east),h.cross(c,d,fl.north),h.multiplyByScalar(fl.up,-1,fl.down),h.multiplyByScalar(fl.east,-1,fl.west),h.multiplyByScalar(fl.north,-1,fl.south),bb=fl[e],yb=fl[t],gb=fl[n]}return a[0]=bb.x,a[1]=bb.y,a[2]=bb.z,a[3]=0,a[4]=yb.x,a[5]=yb.y,a[6]=yb.z,a[7]=0,a[8]=gb.x,a[9]=gb.y,a[10]=gb.z,a[11]=0,a[12]=r.x,a[13]=r.y,a[14]=r.z,a[15]=1,a},U3[o]=i),i};$i.eastNorthUpToFixedFrame=$i.localFrameToFixedFrameGenerator("east","north");$i.northEastDownToFixedFrame=$i.localFrameToFixedFrameGenerator("north","east");$i.northUpEastToFixedFrame=$i.localFrameToFixedFrameGenerator("north","up");$i.northWestUpToFixedFrame=$i.localFrameToFixedFrameGenerator("north","west");var pVe=new Me,bVe=new h(1,1,1),yVe=new A;$i.headingPitchRollToFixedFrame=function(e,t,n,i,o){i=g(i,$i.eastNorthUpToFixedFrame);let r=Me.fromHeadingPitchRoll(t,pVe),s=A.fromTranslationQuaternionRotationScale(h.ZERO,r,bVe,yVe);return o=i(e,n,o),A.multiply(o,s,o)};var gVe=new A,xVe=new q;$i.headingPitchRollQuaternion=function(e,t,n,i,o){let r=$i.headingPitchRollToFixedFrame(e,t,n,i,gVe),s=A.getMatrix3(r,xVe);return Me.fromRotationMatrix(s,o)};var _Ve=new h(1,1,1),TVe=new h,bq=new A,SVe=new A,CVe=new q,VVe=new Me;$i.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=g(t,oe.WGS84),n=g(n,$i.eastNorthUpToFixedFrame),l(i)||(i=new za);let o=A.getTranslation(e,TVe);if(h.equals(o,h.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let r=A.inverseTransformation(n(o,t,bq),bq),s=A.setScale(e,_Ve,SVe);s=A.setTranslation(s,h.ZERO,s),r=A.multiply(r,s,r);let a=Me.fromRotationMatrix(A.getMatrix3(r,CVe),VVe);return a=Me.normalize(a,a),za.fromQuaternion(a,i)};var LVe=6*3600+41*60+50.54841,RVe=8640184812866e-6,ZVe=.093104,GVe=-62e-7,EVe=11772758384668e-32,IVe=72921158553e-15,XVe=W.TWO_PI/86400,EM=new te;$i.computeTemeToPseudoFixedMatrix=function(e,t){EM=te.addSeconds(e,-te.computeTaiMinusUtc(e),EM);let n=EM.dayNumber,i=EM.secondsOfDay,o,r=n-2451545;i>=43200?o=(r+.5)/qn.DAYS_PER_JULIAN_CENTURY:o=(r-.5)/qn.DAYS_PER_JULIAN_CENTURY;let a=(LVe+o*(RVe+o*(ZVe+o*GVe)))*XVe%W.TWO_PI,c=IVe+EVe*(n-24515455e-1),d=(i+qn.SECONDS_PER_DAY*.5)%qn.SECONDS_PER_DAY,u=a+c*d,m=Math.cos(u),p=Math.sin(u);return l(t)?(t[0]=m,t[1]=-p,t[2]=0,t[3]=p,t[4]=m,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new q(m,p,0,-p,m,0,0,0,1)};$i.iau2006XysData=new ML;$i.earthOrientationParameters=AL.NONE;var B3=32.184,WVe=2451545;$i.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+B3,i=e.stop.dayNumber,o=e.stop.secondsOfDay+B3;return $i.iau2006XysData.preload(t,n,i,o)};$i.computeIcrfToFixedMatrix=function(e,t){l(t)||(t=new q);let n=$i.computeFixedToIcrfMatrix(e,t);if(l(n))return q.transpose(n,t)};var PVe=new jg(0,0,0),vVe=new fb(0,0,0,0,0,0),k3=new q,D3=new q;$i.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new q);let n=$i.earthOrientationParameters.compute(e,vVe);if(!l(n))return;let i=e.dayNumber,o=e.secondsOfDay+B3,r=$i.iau2006XysData.computeXysRadians(i,o,PVe);if(!l(r))return;let s=r.x+n.xPoleOffset,a=r.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-s*s-a*a)),d=k3;d[0]=1-c*s*s,d[3]=-c*s*a,d[6]=s,d[1]=-c*s*a,d[4]=1-c*a*a,d[7]=a,d[2]=-s,d[5]=-a,d[8]=1-c*(s*s+a*a);let u=q.fromRotationZ(-r.s,D3),m=q.multiply(d,u,k3),p=e.dayNumber,y=e.secondsOfDay-te.computeTaiMinusUtc(e)+n.ut1MinusUtc,f=p-2451545,x=y/qn.SECONDS_PER_DAY,_=.779057273264+x+.00273781191135448*(f+x);_=_%1*W.TWO_PI;let C=q.fromRotationZ(_,D3),V=q.multiply(m,C,k3),L=Math.cos(n.xPoleWander),Z=Math.cos(n.yPoleWander),G=Math.sin(n.xPoleWander),I=Math.sin(n.yPoleWander),P=i-WVe+o/qn.SECONDS_PER_DAY;P/=36525;let v=-47e-6*P*W.RADIANS_PER_DEGREE/3600,F=Math.cos(v),M=Math.sin(v),b=D3;return b[0]=L*F,b[1]=L*M,b[2]=G,b[3]=-Z*M+I*G*F,b[4]=Z*F+I*G*M,b[5]=-I*L,b[6]=-I*M-Z*G*F,b[7]=I*F-Z*G*M,b[8]=Z*L,q.multiply(V,b,t)};var wVe=new se;$i.pointToWindowCoordinates=function(e,t,n,i){return i=$i.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};$i.pointToGLWindowCoordinates=function(e,t,n,i){l(i)||(i=new B);let o=wVe;return A.multiplyByVector(e,se.fromElements(n.x,n.y,n.z,1,o),o),se.multiplyByScalar(o,1/o.w,o),A.multiplyByVector(t,o,o),B.fromCartesian4(o,i)};var FVe=new h,AVe=new h,MVe=new h;$i.rotationMatrixFromPositionVelocity=function(e,t,n,i){let o=g(n,oe.WGS84).geodeticSurfaceNormal(e,FVe),r=h.cross(t,o,AVe);h.equalsEpsilon(r,h.ZERO,W.EPSILON6)&&(r=h.clone(h.UNIT_X,r));let s=h.cross(r,t,MVe);return h.normalize(s,s),h.cross(t,s,r),h.negate(r,r),h.normalize(r,r),l(i)||(i=new q),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=r.x,i[4]=r.y,i[5]=r.z,i[6]=s.x,i[7]=s.y,i[8]=s.z,i};var yq=new A(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),gq=new he,O3=new h,NVe=new h,UVe=new q,Y3=new A,xq=new A;$i.basisTo2D=function(e,t,n){let i=A.getTranslation(t,NVe),o=e.ellipsoid,r;if(h.equals(i,h.ZERO))r=h.clone(h.ZERO,O3);else{let u=o.cartesianToCartographic(i,gq);r=e.project(u,O3),h.fromElements(r.z,r.x,r.y,r)}let s=$i.eastNorthUpToFixedFrame(i,o,Y3),a=A.inverseTransformation(s,xq),c=A.getMatrix3(t,UVe),d=A.multiplyByMatrix3(a,c,n);return A.multiply(yq,d,n),A.setTranslation(n,r,n),n};$i.wgs84To2DModelMatrix=function(e,t,n){let i=e.ellipsoid,o=$i.eastNorthUpToFixedFrame(t,i,Y3),r=A.inverseTransformation(o,xq),s=i.cartesianToCartographic(t,gq),a=e.project(s,O3);h.fromElements(a.z,a.x,a.y,a);let c=A.fromTranslation(a,Y3);return A.multiply(yq,r,n),A.multiply(c,n,n),n};var Xt=$i;function H3(e){e=g(e,g.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=g(e.primitiveType,Ae.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=g(e.geometryType,nu.NONE),this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}H3.computeNumberOfVertices=function(e){let t=-1;for(let n in e.attributes)if(e.attributes.hasOwnProperty(n)&&l(e.attributes[n])&&l(e.attributes[n].values)){let i=e.attributes[n];t=i.values.length/i.componentsPerAttribute}return t};var kVe=new he,DVe=new h,_q=new A,BVe=[new he,new he,new he],OVe=[new B,new B,new B],YVe=[new B,new B,new B],HVe=new h,KVe=new Me,zVe=new A,JVe=new io;H3._textureCoordinateRotationPoints=function(e,t,n,i){let o,r=de.center(i,kVe),s=he.toCartesian(r,n,DVe),a=Xt.eastNorthUpToFixedFrame(s,n,_q),c=A.inverse(a,_q),d=OVe,u=BVe;u[0].longitude=i.west,u[0].latitude=i.south,u[1].longitude=i.west,u[1].latitude=i.north,u[2].longitude=i.east,u[2].latitude=i.south;let m=HVe;for(o=0;o<3;o++)he.toCartesian(u[o],n,m),m=A.multiplyByPointAsVector(c,m,m),d[o].x=m.x,d[o].y=m.y;let p=Me.fromAxisAngle(h.UNIT_Z,-t,KVe),y=q.fromQuaternion(p,zVe),f=e.length,x=Number.POSITIVE_INFINITY,_=Number.POSITIVE_INFINITY,C=Number.NEGATIVE_INFINITY,V=Number.NEGATIVE_INFINITY;for(o=0;o<f;o++)m=A.multiplyByPointAsVector(c,e[o],m),m=q.multiplyByVector(y,m,m),x=Math.min(x,m.x),_=Math.min(_,m.y),C=Math.max(C,m.x),V=Math.max(V,m.y);let L=io.fromRotation(t,JVe),Z=YVe;Z[0].x=x,Z[0].y=_,Z[1].x=x,Z[1].y=V,Z[2].x=C,Z[2].y=_;let G=d[0],I=d[2].x-G.x,P=d[1].y-G.y;for(o=0;o<3;o++){let R=Z[o];io.multiplyByVector(L,R,R),R.x=(R.x-G.x)/I,R.y=(R.y-G.y)/P}let v=Z[0],F=Z[1],M=Z[2],b=new Array(6);return B.pack(v,b),B.pack(F,b,2),B.pack(M,b,4),b};var mt=H3;var vZt=T(S(),1);function QVe(e){e=g(e,g.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=g(e.normalize,!1),this.values=e.values}var Ge=QVe;var AZt=T(S(),1);function jVe(e){e=g(e,g.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}var pn=jVe;var NZt=T(S(),1),qVe={NONE:0,TOP:1,ALL:2},an=Object.freeze(qVe);var BZt=T(S(),1);function rs(e){e=g(e,g.EMPTY_OBJECT),this.position=g(e.position,!1),this.normal=g(e.normal,!1),this.st=g(e.st,!1),this.bitangent=g(e.bitangent,!1),this.tangent=g(e.tangent,!1),this.color=g(e.color,!1)}rs.POSITION_ONLY=Object.freeze(new rs({position:!0}));rs.POSITION_AND_NORMAL=Object.freeze(new rs({position:!0,normal:!0}));rs.POSITION_NORMAL_AND_ST=Object.freeze(new rs({position:!0,normal:!0,st:!0}));rs.POSITION_AND_ST=Object.freeze(new rs({position:!0,st:!0}));rs.POSITION_AND_COLOR=Object.freeze(new rs({position:!0,color:!0}));rs.ALL=Object.freeze(new rs({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));rs.DEFAULT=rs.POSITION_NORMAL_AND_ST;rs.packedLength=6;rs.pack=function(e,t,n){return n=g(n,0),t[n++]=e.position?1:0,t[n++]=e.normal?1:0,t[n++]=e.st?1:0,t[n++]=e.tangent?1:0,t[n++]=e.bitangent?1:0,t[n]=e.color?1:0,t};rs.unpack=function(e,t,n){return t=g(t,0),l(n)||(n=new rs),n.position=e[t++]===1,n.normal=e[t++]===1,n.st=e[t++]===1,n.tangent=e[t++]===1,n.bitangent=e[t++]===1,n.color=e[t]===1,n};rs.clone=function(e,t){if(l(e))return l(t)||(t=new rs),t.position=e.position,t.normal=e.normal,t.st=e.st,t.tangent=e.tangent,t.bitangent=e.bitangent,t.color=e.color,t};var Pe=rs;var $Ve=new h;function td(e){e=g(e,g.EMPTY_OBJECT);let t=e.minimum,n=e.maximum,i=g(e.vertexFormat,Pe.DEFAULT);this._minimum=h.clone(t),this._maximum=h.clone(n),this._vertexFormat=i,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}td.fromDimensions=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new td({minimum:h.negate(n,new h),maximum:n,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})};td.fromAxisAlignedBoundingBox=function(e){return new td({minimum:e.minimum,maximum:e.maximum})};td.packedLength=2*h.packedLength+Pe.packedLength+1;td.pack=function(e,t,n){return n=g(n,0),h.pack(e._minimum,t,n),h.pack(e._maximum,t,n+h.packedLength),Pe.pack(e._vertexFormat,t,n+2*h.packedLength),t[n+2*h.packedLength+Pe.packedLength]=g(e._offsetAttribute,-1),t};var Sq=new h,Cq=new h,Vq=new Pe,Tq={minimum:Sq,maximum:Cq,vertexFormat:Vq,offsetAttribute:void 0};td.unpack=function(e,t,n){t=g(t,0);let i=h.unpack(e,t,Sq),o=h.unpack(e,t+h.packedLength,Cq),r=Pe.unpack(e,t+2*h.packedLength,Vq),s=e[t+2*h.packedLength+Pe.packedLength];return l(n)?(n._minimum=h.clone(i,n._minimum),n._maximum=h.clone(o,n._maximum),n._vertexFormat=Pe.clone(r,n._vertexFormat),n._offsetAttribute=s===-1?void 0:s,n):(Tq.offsetAttribute=s===-1?void 0:s,new td(Tq))};td.createGeometry=function(e){let t=e._minimum,n=e._maximum,i=e._vertexFormat;if(h.equals(t,n))return;let o=new pn,r,s;if(i.position&&(i.st||i.normal||i.tangent||i.bitangent)){if(i.position&&(s=new Float64Array(6*4*3),s[0]=t.x,s[1]=t.y,s[2]=n.z,s[3]=n.x,s[4]=t.y,s[5]=n.z,s[6]=n.x,s[7]=n.y,s[8]=n.z,s[9]=t.x,s[10]=n.y,s[11]=n.z,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=n.x,s[16]=t.y,s[17]=t.z,s[18]=n.x,s[19]=n.y,s[20]=t.z,s[21]=t.x,s[22]=n.y,s[23]=t.z,s[24]=n.x,s[25]=t.y,s[26]=t.z,s[27]=n.x,s[28]=n.y,s[29]=t.z,s[30]=n.x,s[31]=n.y,s[32]=n.z,s[33]=n.x,s[34]=t.y,s[35]=n.z,s[36]=t.x,s[37]=t.y,s[38]=t.z,s[39]=t.x,s[40]=n.y,s[41]=t.z,s[42]=t.x,s[43]=n.y,s[44]=n.z,s[45]=t.x,s[46]=t.y,s[47]=n.z,s[48]=t.x,s[49]=n.y,s[50]=t.z,s[51]=n.x,s[52]=n.y,s[53]=t.z,s[54]=n.x,s[55]=n.y,s[56]=n.z,s[57]=t.x,s[58]=n.y,s[59]=n.z,s[60]=t.x,s[61]=t.y,s[62]=t.z,s[63]=n.x,s[64]=t.y,s[65]=t.z,s[66]=n.x,s[67]=t.y,s[68]=n.z,s[69]=t.x,s[70]=t.y,s[71]=n.z,o.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:s})),i.normal){let d=new Float32Array(72);d[0]=0,d[1]=0,d[2]=1,d[3]=0,d[4]=0,d[5]=1,d[6]=0,d[7]=0,d[8]=1,d[9]=0,d[10]=0,d[11]=1,d[12]=0,d[13]=0,d[14]=-1,d[15]=0,d[16]=0,d[17]=-1,d[18]=0,d[19]=0,d[20]=-1,d[21]=0,d[22]=0,d[23]=-1,d[24]=1,d[25]=0,d[26]=0,d[27]=1,d[28]=0,d[29]=0,d[30]=1,d[31]=0,d[32]=0,d[33]=1,d[34]=0,d[35]=0,d[36]=-1,d[37]=0,d[38]=0,d[39]=-1,d[40]=0,d[41]=0,d[42]=-1,d[43]=0,d[44]=0,d[45]=-1,d[46]=0,d[47]=0,d[48]=0,d[49]=1,d[50]=0,d[51]=0,d[52]=1,d[53]=0,d[54]=0,d[55]=1,d[56]=0,d[57]=0,d[58]=1,d[59]=0,d[60]=0,d[61]=-1,d[62]=0,d[63]=0,d[64]=-1,d[65]=0,d[66]=0,d[67]=-1,d[68]=0,d[69]=0,d[70]=-1,d[71]=0,o.normal=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:d})}if(i.st){let d=new Float32Array(48);d[0]=0,d[1]=0,d[2]=1,d[3]=0,d[4]=1,d[5]=1,d[6]=0,d[7]=1,d[8]=1,d[9]=0,d[10]=0,d[11]=0,d[12]=0,d[13]=1,d[14]=1,d[15]=1,d[16]=0,d[17]=0,d[18]=1,d[19]=0,d[20]=1,d[21]=1,d[22]=0,d[23]=1,d[24]=1,d[25]=0,d[26]=0,d[27]=0,d[28]=0,d[29]=1,d[30]=1,d[31]=1,d[32]=1,d[33]=0,d[34]=0,d[35]=0,d[36]=0,d[37]=1,d[38]=1,d[39]=1,d[40]=0,d[41]=0,d[42]=1,d[43]=0,d[44]=1,d[45]=1,d[46]=0,d[47]=1,o.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:d})}if(i.tangent){let d=new Float32Array(72);d[0]=1,d[1]=0,d[2]=0,d[3]=1,d[4]=0,d[5]=0,d[6]=1,d[7]=0,d[8]=0,d[9]=1,d[10]=0,d[11]=0,d[12]=-1,d[13]=0,d[14]=0,d[15]=-1,d[16]=0,d[17]=0,d[18]=-1,d[19]=0,d[20]=0,d[21]=-1,d[22]=0,d[23]=0,d[24]=0,d[25]=1,d[26]=0,d[27]=0,d[28]=1,d[29]=0,d[30]=0,d[31]=1,d[32]=0,d[33]=0,d[34]=1,d[35]=0,d[36]=0,d[37]=-1,d[38]=0,d[39]=0,d[40]=-1,d[41]=0,d[42]=0,d[43]=-1,d[44]=0,d[45]=0,d[46]=-1,d[47]=0,d[48]=-1,d[49]=0,d[50]=0,d[51]=-1,d[52]=0,d[53]=0,d[54]=-1,d[55]=0,d[56]=0,d[57]=-1,d[58]=0,d[59]=0,d[60]=1,d[61]=0,d[62]=0,d[63]=1,d[64]=0,d[65]=0,d[66]=1,d[67]=0,d[68]=0,d[69]=1,d[70]=0,d[71]=0,o.tangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:d})}if(i.bitangent){let d=new Float32Array(72);d[0]=0,d[1]=1,d[2]=0,d[3]=0,d[4]=1,d[5]=0,d[6]=0,d[7]=1,d[8]=0,d[9]=0,d[10]=1,d[11]=0,d[12]=0,d[13]=1,d[14]=0,d[15]=0,d[16]=1,d[17]=0,d[18]=0,d[19]=1,d[20]=0,d[21]=0,d[22]=1,d[23]=0,d[24]=0,d[25]=0,d[26]=1,d[27]=0,d[28]=0,d[29]=1,d[30]=0,d[31]=0,d[32]=1,d[33]=0,d[34]=0,d[35]=1,d[36]=0,d[37]=0,d[38]=1,d[39]=0,d[40]=0,d[41]=1,d[42]=0,d[43]=0,d[44]=1,d[45]=0,d[46]=0,d[47]=1,d[48]=0,d[49]=0,d[50]=1,d[51]=0,d[52]=0,d[53]=1,d[54]=0,d[55]=0,d[56]=1,d[57]=0,d[58]=0,d[59]=1,d[60]=0,d[61]=0,d[62]=1,d[63]=0,d[64]=0,d[65]=1,d[66]=0,d[67]=0,d[68]=1,d[69]=0,d[70]=0,d[71]=1,o.bitangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:d})}r=new Uint16Array(6*2*3),r[0]=0,r[1]=1,r[2]=2,r[3]=0,r[4]=2,r[5]=3,r[6]=6,r[7]=5,r[8]=4,r[9]=7,r[10]=6,r[11]=4,r[12]=8,r[13]=9,r[14]=10,r[15]=8,r[16]=10,r[17]=11,r[18]=14,r[19]=13,r[20]=12,r[21]=15,r[22]=14,r[23]=12,r[24]=18,r[25]=17,r[26]=16,r[27]=19,r[28]=18,r[29]=16,r[30]=20,r[31]=21,r[32]=22,r[33]=20,r[34]=22,r[35]=23}else s=new Float64Array(8*3),s[0]=t.x,s[1]=t.y,s[2]=t.z,s[3]=n.x,s[4]=t.y,s[5]=t.z,s[6]=n.x,s[7]=n.y,s[8]=t.z,s[9]=t.x,s[10]=n.y,s[11]=t.z,s[12]=t.x,s[13]=t.y,s[14]=n.z,s[15]=n.x,s[16]=t.y,s[17]=n.z,s[18]=n.x,s[19]=n.y,s[20]=n.z,s[21]=t.x,s[22]=n.y,s[23]=n.z,o.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:s}),r=new Uint16Array(6*2*3),r[0]=4,r[1]=5,r[2]=6,r[3]=4,r[4]=6,r[5]=7,r[6]=1,r[7]=0,r[8]=3,r[9]=1,r[10]=3,r[11]=2,r[12]=1,r[13]=6,r[14]=5,r[15]=1,r[16]=2,r[17]=6,r[18]=2,r[19]=3,r[20]=7,r[21]=2,r[22]=7,r[23]=6,r[24]=3,r[25]=0,r[26]=4,r[27]=3,r[28]=4,r[29]=7,r[30]=0,r[31]=1,r[32]=5,r[33]=0,r[34]=5,r[35]=4;let a=h.subtract(n,t,$Ve),c=h.magnitude(a)*.5;if(l(e._offsetAttribute)){let d=s.length,u=e._offsetAttribute===an.NONE?0:1,m=new Uint8Array(d/3).fill(u);o.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}return new mt({attributes:o,indices:r,primitiveType:Ae.TRIANGLES,boundingSphere:new ce(h.ZERO,c),offsetAttribute:e._offsetAttribute})};var K3;td.getUnitBox=function(){return l(K3)||(K3=td.createGeometry(td.fromDimensions({dimensions:new h(1,1,1),vertexFormat:Pe.POSITION_ONLY}))),K3};var pl=td;var fGt=T(S(),1);var eLe=new h;function Dh(e){e=g(e,g.EMPTY_OBJECT);let t=e.minimum,n=e.maximum;this._min=h.clone(t),this._max=h.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}Dh.fromDimensions=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new Dh({minimum:h.negate(n,new h),maximum:n,offsetAttribute:e.offsetAttribute})};Dh.fromAxisAlignedBoundingBox=function(e){return new Dh({minimum:e.minimum,maximum:e.maximum})};Dh.packedLength=2*h.packedLength+1;Dh.pack=function(e,t,n){return n=g(n,0),h.pack(e._min,t,n),h.pack(e._max,t,n+h.packedLength),t[n+h.packedLength*2]=g(e._offsetAttribute,-1),t};var Rq=new h,Zq=new h,Lq={minimum:Rq,maximum:Zq,offsetAttribute:void 0};Dh.unpack=function(e,t,n){t=g(t,0);let i=h.unpack(e,t,Rq),o=h.unpack(e,t+h.packedLength,Zq),r=e[t+h.packedLength*2];return l(n)?(n._min=h.clone(i,n._min),n._max=h.clone(o,n._max),n._offsetAttribute=r===-1?void 0:r,n):(Lq.offsetAttribute=r===-1?void 0:r,new Dh(Lq))};Dh.createGeometry=function(e){let t=e._min,n=e._max;if(h.equals(t,n))return;let i=new pn,o=new Uint16Array(12*2),r=new Float64Array(8*3);r[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=n.x,r[4]=t.y,r[5]=t.z,r[6]=n.x,r[7]=n.y,r[8]=t.z,r[9]=t.x,r[10]=n.y,r[11]=t.z,r[12]=t.x,r[13]=t.y,r[14]=n.z,r[15]=n.x,r[16]=t.y,r[17]=n.z,r[18]=n.x,r[19]=n.y,r[20]=n.z,r[21]=t.x,r[22]=n.y,r[23]=n.z,i.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:r}),o[0]=4,o[1]=5,o[2]=5,o[3]=6,o[4]=6,o[5]=7,o[6]=7,o[7]=4,o[8]=0,o[9]=1,o[10]=1,o[11]=2,o[12]=2,o[13]=3,o[14]=3,o[15]=0,o[16]=0,o[17]=4,o[18]=1,o[19]=5,o[20]=2,o[21]=6,o[22]=3,o[23]=7;let s=h.subtract(n,t,eLe),a=h.magnitude(s)*.5;if(l(e._offsetAttribute)){let c=r.length,d=e._offsetAttribute===an.NONE?0:1,u=new Uint8Array(c/3).fill(d);i.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})}return new mt({attributes:i,indices:o,primitiveType:Ae.LINES,boundingSphere:new ce(h.ZERO,a),offsetAttribute:e._offsetAttribute})};var bm=Dh;var _Gt=T(S(),1);function PS(e,t,n,i){e=g(e,1),t=g(t,1),n=g(n,1),i=g(i,1),this.value=new Uint8Array([O.floatToByte(e),O.floatToByte(t),O.floatToByte(n),O.floatToByte(i)])}Object.defineProperties(PS.prototype,{componentDatatype:{get:function(){return Q.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});PS.fromColor=function(e){return new PS(e.red,e.green,e.blue,e.alpha)};PS.toValue=function(e,t){return l(t)?e.toBytes(t):new Uint8Array(e.toBytes())};PS.equals=function(e,t){return e===t||l(e)&&l(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]};var Ot=PS;var LGt=T(S(),1);function NL(e,t){e=g(e,0),t=g(t,Number.MAX_VALUE),this.value=new Float32Array([e,t])}Object.defineProperties(NL.prototype,{componentDatatype:{get:function(){return Q.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});NL.fromDistanceDisplayCondition=function(e){return new NL(e.near,e.far)};NL.toValue=function(e,t){return l(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var Dn=NL;var EGt=T(S(),1);function tLe(e){e=g(e,g.EMPTY_OBJECT),this.geometry=e.geometry,this.modelMatrix=A.clone(g(e.modelMatrix,A.IDENTITY)),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=g(e.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var St=tLe;var NGt=T(S(),1);var wGt=T(S(),1);function Ko(e){e=g(e,g.EMPTY_OBJECT),this.start=l(e.start)?te.clone(e.start):new te,this.stop=l(e.stop)?te.clone(e.stop):new te,this.data=e.data,this.isStartIncluded=g(e.isStartIncluded,!0),this.isStopIncluded=g(e.isStopIncluded,!0)}Object.defineProperties(Ko.prototype,{isEmpty:{get:function(){let e=te.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var vS={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};Ko.fromIso8601=function(e,t){let n=e.iso8601.split("/");if(n.length!==2)throw new fe("options.iso8601 is an invalid ISO 8601 interval.");let i=te.fromIso8601(n[0]),o=te.fromIso8601(n[1]),r=g(e.isStartIncluded,!0),s=g(e.isStopIncluded,!0),a=e.data;return l(t)?(t.start=i,t.stop=o,t.isStartIncluded=r,t.isStopIncluded=s,t.data=a,t):(vS.start=i,vS.stop=o,vS.isStartIncluded=r,vS.isStopIncluded=s,vS.data=a,new Ko(vS))};Ko.toIso8601=function(e,t){return`${te.toIso8601(e.start,t)}/${te.toIso8601(e.stop,t)}`};Ko.clone=function(e,t){if(l(e))return l(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new Ko(e)};Ko.equals=function(e,t,n){return e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&te.equals(e.start,t.start)&&te.equals(e.stop,t.stop)&&(e.data===t.data||l(n)&&n(e.data,t.data)))};Ko.equalsEpsilon=function(e,t,n,i){return n=g(n,0),e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&te.equalsEpsilon(e.start,t.start,n)&&te.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||l(i)&&i(e.data,t.data)))};Ko.intersect=function(e,t,n,i){if(!l(t))return Ko.clone(Ko.EMPTY,n);let o=e.start,r=e.stop,s=t.start,a=t.stop,c=te.greaterThanOrEquals(s,o)&&te.greaterThanOrEquals(r,s),d=!c&&te.lessThanOrEquals(s,o)&&te.lessThanOrEquals(o,a);if(!c&&!d)return Ko.clone(Ko.EMPTY,n);let u=e.isStartIncluded,m=e.isStopIncluded,p=t.isStartIncluded,y=t.isStopIncluded,f=te.lessThan(r,a);return l(n)||(n=new Ko),n.start=c?s:o,n.isStartIncluded=u&&p||!te.equals(s,o)&&(c&&p||d&&u),n.stop=f?r:a,n.isStopIncluded=f?m:m&&y||!te.equals(a,r)&&y,n.data=l(i)?i(e.data,t.data):e.data,n};Ko.contains=function(e,t){if(e.isEmpty)return!1;let n=te.compare(e.start,t);if(n===0)return e.isStartIncluded;let i=te.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0};Ko.prototype.clone=function(e){return Ko.clone(this,e)};Ko.prototype.equals=function(e,t){return Ko.equals(this,e,t)};Ko.prototype.equalsEpsilon=function(e,t,n){return Ko.equalsEpsilon(this,e,t,n)};Ko.prototype.toString=function(){return Ko.toIso8601(this)};Ko.EMPTY=Object.freeze(new Ko({start:new te,stop:new te,isStartIncluded:!1,isStopIncluded:!1}));var Ln=Ko;var Gq=Object.freeze(te.fromIso8601("0000-01-01T00:00:00Z")),Eq=Object.freeze(te.fromIso8601("9999-12-31T24:00:00Z")),nLe=Object.freeze(new Ln({start:Gq,stop:Eq})),iLe={MINIMUM_VALUE:Gq,MAXIMUM_VALUE:Eq,MAXIMUM_INTERVAL:nLe},Be=iLe;var OGt=T(S(),1);function UL(e,t,n){e=g(e,0),t=g(t,0),n=g(n,0),this.value=new Float32Array([e,t,n])}Object.defineProperties(UL.prototype,{componentDatatype:{get:function(){return Q.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});UL.fromCartesian3=function(e){return new UL(e.x,e.y,e.z)};UL.toValue=function(e,t){return l(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};var eo=UL;var JGt=T(S(),1);function IM(e){e=g(e,!0),this.value=IM.toValue(e)}Object.defineProperties(IM.prototype,{componentDatatype:{get:function(){return Q.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});IM.toValue=function(e,t){return l(t)?(t[0]=e,t):new Uint8Array([e])};var Sn=IM;var NWt=T(S(),1);var jGt=T(S(),1),kL=`in vec3 v_positionEC;
in vec3 v_normalEC;
in vec3 v_tangentEC;
in vec3 v_bitangentEC;
in vec2 v_st;
void main()
{
vec3 positionToEyeEC = -v_positionEC;
mat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC);
vec3 normalEC = normalize(v_normalEC);
#ifdef FACE_FORWARD
normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
#endif
czm_materialInput materialInput;
materialInput.normalEC = normalEC;
materialInput.tangentToEyeMatrix = tangentToEyeMatrix;
materialInput.positionToEyeEC = positionToEyeEC;
materialInput.st = v_st;
czm_material material = czm_getMaterial(materialInput);
#ifdef FLAT
out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#else
out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
#endif
}
`;var $Gt=T(S(),1),DL=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec3 normal;
in vec3 tangent;
in vec3 bitangent;
in vec2 st;
in float batchId;
out vec3 v_positionEC;
out vec3 v_normalEC;
out vec3 v_tangentEC;
out vec3 v_bitangentEC;
out vec2 v_st;
void main()
{
vec4 p = czm_computePosition();
v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates
v_normalEC = czm_normal * normal; // normal in eye coordinates
v_tangentEC = czm_normal * tangent; // tangent in eye coordinates
v_bitangentEC = czm_normal * bitangent; // bitangent in eye coordinates
v_st = st;
gl_Position = czm_modelViewProjectionRelativeToEye * p;
}
`;var tEt=T(S(),1),BL=`in vec3 v_positionEC;
in vec3 v_normalEC;
void main()
{
vec3 positionToEyeEC = -v_positionEC;
vec3 normalEC = normalize(v_normalEC);
#ifdef FACE_FORWARD
normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
#endif
czm_materialInput materialInput;
materialInput.normalEC = normalEC;
materialInput.positionToEyeEC = positionToEyeEC;
czm_material material = czm_getMaterial(materialInput);
#ifdef FLAT
out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#else
out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
#endif
}
`;var iEt=T(S(),1),OL=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec3 normal;
in float batchId;
out vec3 v_positionEC;
out vec3 v_normalEC;
void main()
{
vec4 p = czm_computePosition();
v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates
v_normalEC = czm_normal * normal; // normal in eye coordinates
gl_Position = czm_modelViewProjectionRelativeToEye * p;
}
`;var rEt=T(S(),1),YL=`in vec3 v_positionEC;
in vec3 v_normalEC;
in vec2 v_st;
void main()
{
vec3 positionToEyeEC = -v_positionEC;
vec3 normalEC = normalize(v_normalEC);
#ifdef FACE_FORWARD
normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
#endif
czm_materialInput materialInput;
materialInput.normalEC = normalEC;
materialInput.positionToEyeEC = positionToEyeEC;
materialInput.st = v_st;
czm_material material = czm_getMaterial(materialInput);
#ifdef FLAT
out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#else
out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
#endif
}
`;var aEt=T(S(),1),HL=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec3 normal;
in vec2 st;
in float batchId;
out vec3 v_positionEC;
out vec3 v_normalEC;
out vec2 v_st;
void main()
{
vec4 p = czm_computePosition();
v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates
v_normalEC = czm_normal * normal; // normal in eye coordinates
v_st = st;
gl_Position = czm_modelViewProjectionRelativeToEye * p;
}
`;var GEt=T(S(),1);var yEt=T(S(),1);var dEt=T(S(),1);var oLe={ADD:ne.FUNC_ADD,SUBTRACT:ne.FUNC_SUBTRACT,REVERSE_SUBTRACT:ne.FUNC_REVERSE_SUBTRACT,MIN:ne.MIN,MAX:ne.MAX},Ta=Object.freeze(oLe);var hEt=T(S(),1);var rLe={ZERO:ne.ZERO,ONE:ne.ONE,SOURCE_COLOR:ne.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:ne.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:ne.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:ne.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:ne.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:ne.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:ne.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:ne.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:ne.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:ne.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:ne.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:ne.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:ne.SRC_ALPHA_SATURATE},Ro=Object.freeze(rLe);var sLe={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Ta.ADD,equationAlpha:Ta.ADD,functionSourceRgb:Ro.SOURCE_ALPHA,functionSourceAlpha:Ro.ONE,functionDestinationRgb:Ro.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Ro.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Ta.ADD,equationAlpha:Ta.ADD,functionSourceRgb:Ro.ONE,functionSourceAlpha:Ro.ONE,functionDestinationRgb:Ro.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Ro.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:Ta.ADD,equationAlpha:Ta.ADD,functionSourceRgb:Ro.SOURCE_ALPHA,functionSourceAlpha:Ro.ONE,functionDestinationRgb:Ro.ONE,functionDestinationAlpha:Ro.ONE})},mn=Object.freeze(sLe);var _Et=T(S(),1);var aLe={FRONT:ne.FRONT,BACK:ne.BACK,FRONT_AND_BACK:ne.FRONT_AND_BACK},yi=Object.freeze(aLe);function wS(e){e=g(e,g.EMPTY_OBJECT),this.material=e.material,this.translucent=g(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=g(e.closed,!1)}Object.defineProperties(wS.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}}});wS.prototype.getFragmentShaderSource=function(){let e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),l(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join(`
`)};wS.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent};wS.prototype.getRenderState=function(){let e=this.isTranslucent(),t=ze(this.renderState,!1);return e?(t.depthMask=!1,t.blending=mn.ALPHA_BLEND):t.depthMask=!0,t};wS.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=mn.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:yi.BACK}),l(n)&&(i=Tt(n,i,!0)),i};var ro=wS;var RWt=T(S(),1);var IEt=T(S(),1);function cLe(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var Hn=cLe;var tIt=T(S(),1);var jEt=T(S(),1);var PEt=T(S(),1);function FS(e,t,n,i,o){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=o}Object.defineProperties(FS.prototype,{internalFormat:{get:function(){return this._format}},pixelDatatype:{get:function(){return this._datatype}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}}});FS.clone=function(e){if(l(e))return new FS(e._format,e._datatype,e._width,e._height,e._buffer)};FS.prototype.clone=function(){return FS.clone(this)};var KL=FS;var YEt=T(S(),1),Iq=T($l(),1);function Xq(){if(!l(Sa._canTransferArrayBuffer)){let e=Q3("transferTypedArrayTest");e.postMessage=g(e.webkitPostMessage,e.postMessage);let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return Sa._canTransferArrayBuffer=!1,Sa._canTransferArrayBuffer}Sa._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(o){let r=o.data.array,s=l(r)&&r[0]===t;i(s),e.terminate(),Sa._canTransferArrayBuffer=s}})}return Sa._canTransferArrayBuffer}var J3=new ye;function z3(e){let t;try{t=new Blob([e],{type:"application/javascript"})}catch{let o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,r=new o;r.append(e),t=r.getBlob("application/javascript")}return(window.URL||window.webkitURL).createObjectURL(t)}function Q3(e){let t=new Iq.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i={},o;if(Og(e)){let s=`importScripts("${e}");`;return o=z3(s),new Worker(o,i)}let r=e.replace(/\.js$/,"");if(!n&&typeof CESIUM_WORKERS<"u"){let s=`
importScripts("${z3(CESIUM_WORKERS)}");
CesiumWorkers["${r}"]();
`;return o=z3(s),new Worker(o,i)}if(o=e,n||(o=on(`${Sa._workerModulePrefix+r}.js`)),!Bt.supportsEsmWebWorkers())throw new me("This browser is not supported. Please update your browser to continue.");return i.type="module",new Worker(o,i)}async function lLe(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!Bt.supportsWebAssembly()){if(!l(t.fallbackModulePath))throw new me(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=on(t.fallbackModulePath),n}n.wasmBinaryFile=on(t.wasmBinaryFile);let i=await Xe.fetchArrayBuffer({url:n.wasmBinaryFile});return n.wasmBinary=i,n}function Sa(e,t){this._workerPath=e,this._maximumActiveTasks=g(t,Number.POSITIVE_INFINITY),this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var dLe=(e,t,n,i)=>{let o=({data:r})=>{if(r.id===t){if(l(r.error)){let s=r.error;s.name==="RuntimeError"?(s=new me(r.error.message),s.stack=r.error.stack):s.name==="DeveloperError"?(s=new fe(r.error.message),s.stack=r.error.stack):s.name==="Error"&&(s=new Error(r.error.message),s.stack=r.error.stack),J3.raiseEvent(s),i(s)}else J3.raiseEvent(),n(r.result);e.removeEventListener("message",o)}};return o},uLe=[];async function mLe(e,t,n){let i=await Promise.resolve(Xq());l(n)?i||(n.length=0):n=uLe;let o=e._nextID++,r=new Promise((s,a)=>{e._worker.addEventListener("message",dLe(e._worker,o,s,a))});return e._worker.postMessage({id:o,baseUrl:on.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),r}async function hLe(e,t,n){++e._activeTasks;try{let i=await mLe(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}Sa.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=Q3(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return hLe(this,e,t)};Sa.prototype.initWebAssemblyModule=async function(e){if(l(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=Q3(this._workerPath),i=await lLe(this,e),o=await Promise.resolve(Xq()),r,s=i.wasmBinary;l(s)&&o&&(r=[s]);let a=new Promise((c,d)=>{n.onmessage=function({data:u}){l(u)?c(u.result):d(new me("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:i}},r),a};return this._webAssemblyPromise=t(),this._webAssemblyPromise};Sa.prototype.isDestroyed=function(){return!1};Sa.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),ue(this)};Sa.taskCompletedEvent=J3;Sa._defaultWorkerModulePrefix="Workers/";Sa._workerModulePrefix=Sa._defaultWorkerModulePrefix;Sa._canTransferArrayBuffer=void 0;var gi=Sa;function up(){}up._transcodeTaskProcessor=new gi("transcodeKTX2",Number.POSITIVE_INFINITY);up._readyPromise=void 0;function fLe(){let e=up._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return up._transcodeTaskProcessor;throw new me("KTX2 transcoder could not be initialized.")});up._readyPromise=e}up.transcode=function(e,t){return l(up._readyPromise)||fLe(),up._readyPromise.then(function(n){let i;if(e instanceof ArrayBuffer){let o=new Uint8Array(e);return i={supportedTargetFormats:t,ktx2Buffer:o},n.scheduleTask(i,[e])}return i={supportedTargetFormats:t,ktx2Buffer:e},n.scheduleTask(i,[e.buffer])}).then(function(n){let i=n.length,o=Object.keys(n[0]),r=o.length,s;for(s=0;s<i;s++){let a=n[s];for(let c=0;c<r;c++){let d=a[o[c]];a[o[c]]=new KL(d.internalFormat,d.datatype,d.width,d.height,d.levelBuffer)}}if(r===1){for(s=0;s<i;++s)n[s]=n[s][o[0]];i===1&&(n=n[0])}return n}).catch(function(n){throw n})};var zL=up;var Wq;Pq.setKTX2SupportedFormats=function(e,t,n,i,o,r){Wq={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:o,bc7:r}};function Pq(e){let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=Xe.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return zL.transcode(n,Wq)})}var bl=Pq;var KIt=T(S(),1);var cIt=T(S(),1);var oIt=T(S(),1);var Zi={UNSIGNED_BYTE:ne.UNSIGNED_BYTE,UNSIGNED_SHORT:ne.UNSIGNED_SHORT,UNSIGNED_INT:ne.UNSIGNED_INT,FLOAT:ne.FLOAT,HALF_FLOAT:ne.HALF_FLOAT_OES,UNSIGNED_INT_24_8:ne.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:ne.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:ne.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:ne.UNSIGNED_SHORT_5_6_5};Zi.toWebGLConstant=function(e,t){switch(e){case Zi.UNSIGNED_BYTE:return ne.UNSIGNED_BYTE;case Zi.UNSIGNED_SHORT:return ne.UNSIGNED_SHORT;case Zi.UNSIGNED_INT:return ne.UNSIGNED_INT;case Zi.FLOAT:return ne.FLOAT;case Zi.HALF_FLOAT:return t.webgl2?ne.HALF_FLOAT:ne.HALF_FLOAT_OES;case Zi.UNSIGNED_INT_24_8:return ne.UNSIGNED_INT_24_8;case Zi.UNSIGNED_SHORT_4_4_4_4:return ne.UNSIGNED_SHORT_4_4_4_4;case Zi.UNSIGNED_SHORT_5_5_5_1:return ne.UNSIGNED_SHORT_5_5_5_1;case Zi.UNSIGNED_SHORT_5_6_5:return Zi.UNSIGNED_SHORT_5_6_5}};Zi.isPacked=function(e){return e===Zi.UNSIGNED_INT_24_8||e===Zi.UNSIGNED_SHORT_4_4_4_4||e===Zi.UNSIGNED_SHORT_5_5_5_1||e===Zi.UNSIGNED_SHORT_5_6_5};Zi.sizeInBytes=function(e){switch(e){case Zi.UNSIGNED_BYTE:return 1;case Zi.UNSIGNED_SHORT:case Zi.UNSIGNED_SHORT_4_4_4_4:case Zi.UNSIGNED_SHORT_5_5_5_1:case Zi.UNSIGNED_SHORT_5_6_5:case Zi.HALF_FLOAT:return 2;case Zi.UNSIGNED_INT:case Zi.FLOAT:case Zi.UNSIGNED_INT_24_8:return 4}};Zi.validate=function(e){return e===Zi.UNSIGNED_BYTE||e===Zi.UNSIGNED_SHORT||e===Zi.UNSIGNED_INT||e===Zi.FLOAT||e===Zi.HALF_FLOAT||e===Zi.UNSIGNED_INT_24_8||e===Zi.UNSIGNED_SHORT_4_4_4_4||e===Zi.UNSIGNED_SHORT_5_5_5_1||e===Zi.UNSIGNED_SHORT_5_6_5};var je=Object.freeze(Zi);var st={DEPTH_COMPONENT:ne.DEPTH_COMPONENT,DEPTH_STENCIL:ne.DEPTH_STENCIL,ALPHA:ne.ALPHA,RED:ne.RED,RG:ne.RG,RGB:ne.RGB,RGBA:ne.RGBA,LUMINANCE:ne.LUMINANCE,LUMINANCE_ALPHA:ne.LUMINANCE_ALPHA,RGB_DXT1:ne.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:ne.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:ne.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:ne.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:ne.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:ne.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:ne.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:ne.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:ne.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:ne.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:ne.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:ne.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:ne.COMPRESSED_RGBA_BPTC_UNORM};st.componentsLength=function(e){switch(e){case st.RGB:return 3;case st.RGBA:return 4;case st.LUMINANCE_ALPHA:case st.RG:return 2;case st.ALPHA:case st.RED:case st.LUMINANCE:return 1;default:return 1}};st.validate=function(e){return e===st.DEPTH_COMPONENT||e===st.DEPTH_STENCIL||e===st.ALPHA||e===st.RED||e===st.RG||e===st.RGB||e===st.RGBA||e===st.LUMINANCE||e===st.LUMINANCE_ALPHA||e===st.RGB_DXT1||e===st.RGBA_DXT1||e===st.RGBA_DXT3||e===st.RGBA_DXT5||e===st.RGB_PVRTC_4BPPV1||e===st.RGB_PVRTC_2BPPV1||e===st.RGBA_PVRTC_4BPPV1||e===st.RGBA_PVRTC_2BPPV1||e===st.RGBA_ASTC||e===st.RGB_ETC1||e===st.RGB8_ETC2||e===st.RGBA8_ETC2_EAC||e===st.RGBA_BC7};st.isColorFormat=function(e){return e===st.ALPHA||e===st.RGB||e===st.RGBA||e===st.LUMINANCE||e===st.LUMINANCE_ALPHA};st.isDepthFormat=function(e){return e===st.DEPTH_COMPONENT||e===st.DEPTH_STENCIL};st.isCompressedFormat=function(e){return e===st.RGB_DXT1||e===st.RGBA_DXT1||e===st.RGBA_DXT3||e===st.RGBA_DXT5||e===st.RGB_PVRTC_4BPPV1||e===st.RGB_PVRTC_2BPPV1||e===st.RGBA_PVRTC_4BPPV1||e===st.RGBA_PVRTC_2BPPV1||e===st.RGBA_ASTC||e===st.RGB_ETC1||e===st.RGB8_ETC2||e===st.RGBA8_ETC2_EAC||e===st.RGBA_BC7};st.isDXTFormat=function(e){return e===st.RGB_DXT1||e===st.RGBA_DXT1||e===st.RGBA_DXT3||e===st.RGBA_DXT5};st.isPVRTCFormat=function(e){return e===st.RGB_PVRTC_4BPPV1||e===st.RGB_PVRTC_2BPPV1||e===st.RGBA_PVRTC_4BPPV1||e===st.RGBA_PVRTC_2BPPV1};st.isASTCFormat=function(e){return e===st.RGBA_ASTC};st.isETC1Format=function(e){return e===st.RGB_ETC1};st.isETC2Format=function(e){return e===st.RGB8_ETC2||e===st.RGBA8_ETC2_EAC};st.isBC7Format=function(e){return e===st.RGBA_BC7};st.compressedTextureSizeInBytes=function(e,t,n){switch(e){case st.RGB_DXT1:case st.RGBA_DXT1:case st.RGB_ETC1:case st.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case st.RGBA_DXT3:case st.RGBA_DXT5:case st.RGBA_ASTC:case st.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case st.RGB_PVRTC_4BPPV1:case st.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case st.RGB_PVRTC_2BPPV1:case st.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case st.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};st.textureSizeInBytes=function(e,t,n,i){let o=st.componentsLength(e);return je.isPacked(t)&&(o=1),o*je.sizeInBytes(t)*n*i};st.alignmentInBytes=function(e,t,n){let i=st.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};st.createTypedArray=function(e,t,n,i){let o,r=je.sizeInBytes(t);r===Uint8Array.BYTES_PER_ELEMENT?o=Uint8Array:r===Uint16Array.BYTES_PER_ELEMENT?o=Uint16Array:r===Float32Array.BYTES_PER_ELEMENT&&t===je.FLOAT?o=Float32Array:o=Uint32Array;let s=st.componentsLength(e)*n*i;return new o(s)};st.flipY=function(e,t,n,i,o){if(o===1)return e;let r=st.createTypedArray(t,n,i,o),s=st.componentsLength(t),a=i*s;for(let c=0;c<o;++c){let d=c*i*s,u=(o-c-1)*i*s;for(let m=0;m<a;++m)r[u+m]=e[d+m]}return r};st.toInternalFormat=function(e,t,n){if(!n.webgl2)return e;if(e===st.DEPTH_STENCIL)return ne.DEPTH24_STENCIL8;if(e===st.DEPTH_COMPONENT){if(t===je.UNSIGNED_SHORT)return ne.DEPTH_COMPONENT16;if(t===je.UNSIGNED_INT)return ne.DEPTH_COMPONENT24}if(t===je.FLOAT)switch(e){case st.RGBA:return ne.RGBA32F;case st.RGB:return ne.RGB32F;case st.RG:return ne.RG32F;case st.RED:return ne.R32F}if(t===je.HALF_FLOAT)switch(e){case st.RGBA:return ne.RGBA16F;case st.RGB:return ne.RGB16F;case st.RG:return ne.RG16F;case st.RED:return ne.R16F}return e};var at=Object.freeze(st);var dIt=T(S(),1),br={_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,_maximumSamples:0,_highpFloatSupported:!1,_highpIntSupported:!1};Object.defineProperties(br,{maximumCombinedTextureImageUnits:{get:function(){return br._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return br._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return br._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return br._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return br._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return br._maximumTextureSize}},maximumVaryingVectors:{get:function(){return br._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return br._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return br._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return br._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return br._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return br._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return br._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return br._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return br._maximumViewportWidth}},maximumViewportHeight:{get:function(){return br._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return br._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return br._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return br._maximumColorAttachments}},maximumSamples:{get:function(){return br._maximumSamples}},highpFloatSupported:{get:function(){return br._highpFloatSupported}},highpIntSupported:{get:function(){return br._highpIntSupported}}});var Yt=br;var bIt=T(S(),1);function XM(e,t,n,i,o,r,s,a,c,d,u){this._context=e,this._texture=t,this._textureTarget=n,this._targetFace=i,this._pixelDatatype=s,this._internalFormat=o,this._pixelFormat=r,this._size=a,this._preMultiplyAlpha=c,this._flipY=d,this._initialized=u}Object.defineProperties(XM.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});XM.prototype.copyFrom=function(e){let t=g(e.xOffset,0),n=g(e.yOffset,0),i=e.source,o=this._context._gl,r=this._textureTarget,s=this._targetFace;o.activeTexture(o.TEXTURE0),o.bindTexture(r,this._texture);let a=i.width,c=i.height,d=i.arrayBufferView,u=this._size,m=this._pixelFormat,p=this._internalFormat,y=this._pixelDatatype,f=this._preMultiplyAlpha,x=this._flipY,_=g(e.skipColorSpaceConversion,!1),C=4;l(d)&&(C=at.alignmentInBytes(m,y,a)),o.pixelStorei(o.UNPACK_ALIGNMENT,C),_?o.pixelStorei(o.UNPACK_COLORSPACE_CONVERSION_WEBGL,o.NONE):o.pixelStorei(o.UNPACK_COLORSPACE_CONVERSION_WEBGL,o.BROWSER_DEFAULT_WEBGL);let V=!1;if(!this._initialized){if(t===0&&n===0&&a===u&&c===u)l(d)?(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!1),x&&(d=at.flipY(d,m,y,u,u)),o.texImage2D(s,0,p,u,u,0,m,je.toWebGLConstant(y,this._context),d)):(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,f),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,x),o.texImage2D(s,0,p,m,je.toWebGLConstant(y,this._context),i)),V=!0;else{o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!1);let L=at.createTypedArray(m,y,u,u);o.texImage2D(s,0,p,u,u,0,m,je.toWebGLConstant(y,this._context),L)}this._initialized=!0}V||(l(d)?(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!1),x&&(d=at.flipY(d,m,y,a,c)),o.texSubImage2D(s,0,t,n,a,c,m,je.toWebGLConstant(y,this._context),d)):(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,f),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,x),o.texSubImage2D(s,0,t,n,m,je.toWebGLConstant(y,this._context),i))),o.bindTexture(r,null)};XM.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){e=g(e,0),t=g(t,0),n=g(n,0),i=g(i,0),o=g(o,this._size),r=g(r,this._size);let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(this._targetFace,0,e,t,n,i,o,r),s.bindTexture(a,null),this._initialized=!0};var Bh=XM;var xIt=T(S(),1);var WM={DONT_CARE:ne.DONT_CARE,FASTEST:ne.FASTEST,NICEST:ne.NICEST,validate:function(e){return e===WM.DONT_CARE||e===WM.FASTEST||e===WM.NICEST}},Oh=Object.freeze(WM);var wIt=T(S(),1);var SIt=T(S(),1);var PM={NEAREST:ne.NEAREST,LINEAR:ne.LINEAR};PM.validate=function(e){return e===PM.NEAREST||e===PM.LINEAR};var Ti=Object.freeze(PM);var LIt=T(S(),1);var xb={NEAREST:ne.NEAREST,LINEAR:ne.LINEAR,NEAREST_MIPMAP_NEAREST:ne.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:ne.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:ne.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:ne.LINEAR_MIPMAP_LINEAR};xb.validate=function(e){return e===xb.NEAREST||e===xb.LINEAR||e===xb.NEAREST_MIPMAP_NEAREST||e===xb.LINEAR_MIPMAP_NEAREST||e===xb.NEAREST_MIPMAP_LINEAR||e===xb.LINEAR_MIPMAP_LINEAR};var dn=Object.freeze(xb);var GIt=T(S(),1);var vM={CLAMP_TO_EDGE:ne.CLAMP_TO_EDGE,REPEAT:ne.REPEAT,MIRRORED_REPEAT:ne.MIRRORED_REPEAT,validate:function(e){return e===vM.CLAMP_TO_EDGE||e===vM.REPEAT||e===vM.MIRRORED_REPEAT}},In=Object.freeze(vM);function JL(e){e=g(e,g.EMPTY_OBJECT);let t=g(e.wrapS,In.CLAMP_TO_EDGE),n=g(e.wrapT,In.CLAMP_TO_EDGE),i=g(e.minificationFilter,dn.LINEAR),o=g(e.magnificationFilter,Ti.LINEAR),r=l(e.maximumAnisotropy)?e.maximumAnisotropy:1;this._wrapS=t,this._wrapT=n,this._minificationFilter=i,this._magnificationFilter=o,this._maximumAnisotropy=r}Object.defineProperties(JL.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}}});JL.equals=function(e,t){return e===t||l(e)&&l(t)&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy};JL.NEAREST=Object.freeze(new JL({wrapS:In.CLAMP_TO_EDGE,wrapT:In.CLAMP_TO_EDGE,minificationFilter:dn.NEAREST,magnificationFilter:Ti.NEAREST}));var hn=JL;function QL(e){e=g(e,g.EMPTY_OBJECT);let t=e.context,n=e.source,i,o;if(l(n)){let V=[n.positiveX,n.negativeX,n.positiveY,n.negativeY,n.positiveZ,n.negativeZ];i=V[0].width,o=V[0].height}else i=e.width,o=e.height;let r=i,s=g(e.pixelDatatype,je.UNSIGNED_BYTE),a=g(e.pixelFormat,at.RGBA),c=at.toInternalFormat(a,s,t),d=at.textureSizeInBytes(a,s,r,r)*6,u=e.preMultiplyAlpha||a===at.RGB||a===at.LUMINANCE,m=g(e.flipY,!0),p=g(e.skipColorSpaceConversion,!1),y=t._gl,f=y.TEXTURE_CUBE_MAP,x=y.createTexture();y.activeTexture(y.TEXTURE0),y.bindTexture(f,x);function _(V,L,Z,G,I){let P=L.arrayBufferView;l(P)||(P=L.bufferView);let v=4;l(P)&&(v=at.alignmentInBytes(a,s,i)),y.pixelStorei(y.UNPACK_ALIGNMENT,v),I?y.pixelStorei(y.UNPACK_COLORSPACE_CONVERSION_WEBGL,y.NONE):y.pixelStorei(y.UNPACK_COLORSPACE_CONVERSION_WEBGL,y.BROWSER_DEFAULT_WEBGL),l(P)?(y.pixelStorei(y.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),y.pixelStorei(y.UNPACK_FLIP_Y_WEBGL,!1),G&&(P=at.flipY(P,a,s,r,r)),y.texImage2D(V,0,c,r,r,0,a,je.toWebGLConstant(s,t),P)):(y.pixelStorei(y.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Z),y.pixelStorei(y.UNPACK_FLIP_Y_WEBGL,G),y.texImage2D(V,0,c,a,je.toWebGLConstant(s,t),L))}l(n)?(_(y.TEXTURE_CUBE_MAP_POSITIVE_X,n.positiveX,u,m,p),_(y.TEXTURE_CUBE_MAP_NEGATIVE_X,n.negativeX,u,m,p),_(y.TEXTURE_CUBE_MAP_POSITIVE_Y,n.positiveY,u,m,p),_(y.TEXTURE_CUBE_MAP_NEGATIVE_Y,n.negativeY,u,m,p),_(y.TEXTURE_CUBE_MAP_POSITIVE_Z,n.positiveZ,u,m,p),_(y.TEXTURE_CUBE_MAP_NEGATIVE_Z,n.negativeZ,u,m,p)):(y.texImage2D(y.TEXTURE_CUBE_MAP_POSITIVE_X,0,c,r,r,0,a,je.toWebGLConstant(s,t),null),y.texImage2D(y.TEXTURE_CUBE_MAP_NEGATIVE_X,0,c,r,r,0,a,je.toWebGLConstant(s,t),null),y.texImage2D(y.TEXTURE_CUBE_MAP_POSITIVE_Y,0,c,r,r,0,a,je.toWebGLConstant(s,t),null),y.texImage2D(y.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,c,r,r,0,a,je.toWebGLConstant(s,t),null),y.texImage2D(y.TEXTURE_CUBE_MAP_POSITIVE_Z,0,c,r,r,0,a,je.toWebGLConstant(s,t),null),y.texImage2D(y.TEXTURE_CUBE_MAP_NEGATIVE_Z,0,c,r,r,0,a,je.toWebGLConstant(s,t),null)),y.bindTexture(f,null),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=f,this._texture=x,this._pixelFormat=a,this._pixelDatatype=s,this._size=r,this._hasMipmap=!1,this._sizeInBytes=d,this._preMultiplyAlpha=u,this._flipY=m,this._sampler=void 0;let C=l(n);this._positiveX=new Bh(t,x,f,y.TEXTURE_CUBE_MAP_POSITIVE_X,c,a,s,r,u,m,C),this._negativeX=new Bh(t,x,f,y.TEXTURE_CUBE_MAP_NEGATIVE_X,c,a,s,r,u,m,C),this._positiveY=new Bh(t,x,f,y.TEXTURE_CUBE_MAP_POSITIVE_Y,c,a,s,r,u,m,C),this._negativeY=new Bh(t,x,f,y.TEXTURE_CUBE_MAP_NEGATIVE_Y,c,a,s,r,u,m,C),this._positiveZ=new Bh(t,x,f,y.TEXTURE_CUBE_MAP_POSITIVE_Z,c,a,s,r,u,m,C),this._negativeZ=new Bh(t,x,f,y.TEXTURE_CUBE_MAP_NEGATIVE_Z,c,a,s,r,u,m,C),this.sampler=l(e.sampler)?e.sampler:new hn}Object.defineProperties(QL.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){let t=e.minificationFilter,n=e.magnificationFilter,i=t===dn.NEAREST_MIPMAP_NEAREST||t===dn.NEAREST_MIPMAP_LINEAR||t===dn.LINEAR_MIPMAP_NEAREST||t===dn.LINEAR_MIPMAP_LINEAR,o=this._context,r=this._pixelDatatype;(r===je.FLOAT&&!o.textureFloatLinear||r===je.HALF_FLOAT&&!o.textureHalfFloatLinear)&&(t=i?dn.NEAREST_MIPMAP_NEAREST:dn.NEAREST,n=Ti.NEAREST);let s=o._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.texParameteri(a,s.TEXTURE_MIN_FILTER,t),s.texParameteri(a,s.TEXTURE_MAG_FILTER,n),s.texParameteri(a,s.TEXTURE_WRAP_S,e.wrapS),s.texParameteri(a,s.TEXTURE_WRAP_T,e.wrapT),l(this._textureFilterAnisotropic)&&s.texParameteri(a,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),s.bindTexture(a,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},width:{get:function(){return this._size}},height:{get:function(){return this._size}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}});QL.prototype.generateMipmap=function(e){e=g(e,Oh.DONT_CARE),this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};QL.prototype.isDestroyed=function(){return!1};QL.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=ue(this._positiveX),this._negativeX=ue(this._negativeX),this._positiveY=ue(this._positiveY),this._negativeY=ue(this._negativeY),this._positiveZ=ue(this._positiveZ),this._negativeZ=ue(this._negativeZ),ue(this)};var Ja=QL;var sXt=T(S(),1);function ym(e){e=g(e,g.EMPTY_OBJECT);let t=e.context,n=e.width,i=e.height,o=e.source;l(o)&&(l(n)||(n=g(o.videoWidth,o.width)),l(i)||(i=g(o.videoHeight,o.height)));let r=g(e.pixelFormat,at.RGBA),s=g(e.pixelDatatype,je.UNSIGNED_BYTE),a=at.toInternalFormat(r,s,t),c=at.isCompressedFormat(a),d=e.preMultiplyAlpha||r===at.RGB||r===at.LUMINANCE,u=g(e.flipY,!0),m=g(e.skipColorSpaceConversion,!1),p=!0,y=t._gl,f=y.TEXTURE_2D,x=y.createTexture();y.activeTexture(y.TEXTURE0),y.bindTexture(f,x);let _=4;if(l(o)&&l(o.arrayBufferView)&&!c&&(_=at.alignmentInBytes(r,s,n)),y.pixelStorei(y.UNPACK_ALIGNMENT,_),m?y.pixelStorei(y.UNPACK_COLORSPACE_CONVERSION_WEBGL,y.NONE):y.pixelStorei(y.UNPACK_COLORSPACE_CONVERSION_WEBGL,y.BROWSER_DEFAULT_WEBGL),l(o))if(l(o.arrayBufferView)){y.pixelStorei(y.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),y.pixelStorei(y.UNPACK_FLIP_Y_WEBGL,!1);let V=o.arrayBufferView,L,Z,G;if(c){if(y.compressedTexImage2D(f,0,a,n,i,0,V),l(o.mipLevels))for(Z=n,G=i,L=0;L<o.mipLevels.length;++L)Z=Math.floor(Z/2)|0,Z<1&&(Z=1),G=Math.floor(G/2)|0,G<1&&(G=1),y.compressedTexImage2D(f,L+1,a,Z,G,0,o.mipLevels[L])}else if(u&&(V=at.flipY(V,r,s,n,i)),y.texImage2D(f,0,a,n,i,0,r,je.toWebGLConstant(s,t),V),l(o.mipLevels))for(Z=n,G=i,L=0;L<o.mipLevels.length;++L)Z=Math.floor(Z/2)|0,Z<1&&(Z=1),G=Math.floor(G/2)|0,G<1&&(G=1),y.texImage2D(f,L+1,a,Z,G,0,r,je.toWebGLConstant(s,t),o.mipLevels[L])}else l(o.framebuffer)?(y.pixelStorei(y.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),y.pixelStorei(y.UNPACK_FLIP_Y_WEBGL,!1),o.framebuffer!==t.defaultFramebuffer&&o.framebuffer._bind(),y.copyTexImage2D(f,0,a,o.xOffset,o.yOffset,n,i,0),o.framebuffer!==t.defaultFramebuffer&&o.framebuffer._unBind()):(y.pixelStorei(y.UNPACK_PREMULTIPLY_ALPHA_WEBGL,d),y.pixelStorei(y.UNPACK_FLIP_Y_WEBGL,u),y.texImage2D(f,0,a,r,je.toWebGLConstant(s,t),o));else y.texImage2D(f,0,a,n,i,0,r,je.toWebGLConstant(s,t),null),p=!1;y.bindTexture(f,null);let C;c?C=at.compressedTextureSizeInBytes(r,n,i):C=at.textureSizeInBytes(r,s,n,i),this._id=Hn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=f,this._texture=x,this._internalFormat=a,this._pixelFormat=r,this._pixelDatatype=s,this._width=n,this._height=i,this._dimensions=new B(n,i),this._hasMipmap=!1,this._sizeInBytes=C,this._preMultiplyAlpha=d,this._flipY=u,this._initialized=p,this._sampler=void 0,this.sampler=l(e.sampler)?e.sampler:new hn}ym.create=function(e){return new ym(e)};ym.fromFramebuffer=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.context,n=t._gl,i=g(e.pixelFormat,at.RGB),o=g(e.framebufferXOffset,0),r=g(e.framebufferYOffset,0),s=g(e.width,n.drawingBufferWidth),a=g(e.height,n.drawingBufferHeight),c=e.framebuffer;return new ym({context:t,width:s,height:a,pixelFormat:i,source:{framebuffer:l(c)?c:t.defaultFramebuffer,xOffset:o,yOffset:r,width:s,height:a}})};Object.defineProperties(ym.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){let t=e.minificationFilter,n=e.magnificationFilter,i=this._context,o=this._pixelFormat,r=this._pixelDatatype,s=t===dn.NEAREST_MIPMAP_NEAREST||t===dn.NEAREST_MIPMAP_LINEAR||t===dn.LINEAR_MIPMAP_NEAREST||t===dn.LINEAR_MIPMAP_LINEAR;(r===je.FLOAT&&!i.textureFloatLinear||r===je.HALF_FLOAT&&!i.textureHalfFloatLinear)&&(t=s?dn.NEAREST_MIPMAP_NEAREST:dn.NEAREST,n=Ti.NEAREST),i.webgl2&&at.isDepthFormat(o)&&(t=dn.NEAREST,n=Ti.NEAREST);let a=i._gl,c=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(c,this._texture),a.texParameteri(c,a.TEXTURE_MIN_FILTER,t),a.texParameteri(c,a.TEXTURE_MAG_FILTER,n),a.texParameteri(c,a.TEXTURE_WRAP_S,e.wrapS),a.texParameteri(c,a.TEXTURE_WRAP_T,e.wrapT),l(this._textureFilterAnisotropic)&&a.texParameteri(c,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),a.bindTexture(c,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(this._sizeInBytes*4/3):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}});ym.prototype.copyFrom=function(e){let t=g(e.xOffset,0),n=g(e.yOffset,0),i=e.source,o=this._context,r=o._gl,s=this._textureTarget;r.activeTexture(r.TEXTURE0),r.bindTexture(s,this._texture);let a=i.width,c=i.height,d=i.arrayBufferView,u=this._width,m=this._height,p=this._internalFormat,y=this._pixelFormat,f=this._pixelDatatype,x=this._preMultiplyAlpha,_=this._flipY,C=g(e.skipColorSpaceConversion,!1),V=4;l(d)&&(V=at.alignmentInBytes(y,f,a)),r.pixelStorei(r.UNPACK_ALIGNMENT,V),C?r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,r.NONE):r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,r.BROWSER_DEFAULT_WEBGL);let L=!1;if(!this._initialized){if(t===0&&n===0&&a===u&&c===m)l(d)?(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),_&&(d=at.flipY(d,y,f,u,m)),r.texImage2D(s,0,p,u,m,0,y,je.toWebGLConstant(f,o),d)):(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,_),r.texImage2D(s,0,p,y,je.toWebGLConstant(f,o),i)),L=!0;else{r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1);let Z=at.createTypedArray(y,f,u,m);r.texImage2D(s,0,p,u,m,0,y,je.toWebGLConstant(f,o),Z)}this._initialized=!0}L||(l(d)?(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),_&&(d=at.flipY(d,y,f,a,c)),r.texSubImage2D(s,0,t,n,a,c,y,je.toWebGLConstant(f,o),d)):(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,_),r.texSubImage2D(s,0,t,n,y,je.toWebGLConstant(f,o),i))),r.bindTexture(s,null)};ym.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){e=g(e,0),t=g(t,0),n=g(n,0),i=g(i,0),o=g(o,this._width),r=g(r,this._height);let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(a,0,e,t,n,i,o,r),s.bindTexture(a,null),this._initialized=!0};ym.prototype.generateMipmap=function(e){e=g(e,Oh.DONT_CARE),this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};ym.prototype.isDestroyed=function(){return!1};ym.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),ue(this)};var wt=ym;var cXt=T(S(),1),jL=`uniform sampler2D image;
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
vec4 rampColor = texture(image, vec2(materialInput.aspect / (2.0 * czm_pi), 0.5));
rampColor = czm_gammaCorrect(rampColor);
material.diffuse = rampColor.rgb;
material.alpha = rampColor.a;
return material;
}
`;var dXt=T(S(),1),qL=`uniform sampler2D image;
uniform float strength;
uniform vec2 repeat;
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
vec2 st = materialInput.st;
vec2 centerPixel = fract(repeat * st);
float centerBump = texture(image, centerPixel).channel;
float imageWidth = float(imageDimensions.x);
vec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0)));
float rightBump = texture(image, rightPixel).channel;
float imageHeight = float(imageDimensions.y);
vec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight)));
float topBump = texture(image, leftPixel).channel;
vec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0)));
vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;
material.normal = normalEC;
material.diffuse = vec3(0.01);
return material;
}
`;var mXt=T(S(),1),$L=`uniform vec4 lightColor;
uniform vec4 darkColor;
uniform vec2 repeat;
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
vec2 st = materialInput.st;
// From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights
float b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0); // 0.0 or 1.0
// Find the distance from the closest separator (region between two colors)
float scaledWidth = fract(repeat.s * st.s);
scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));
float scaledHeight = fract(repeat.t * st.t);
scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));
float value = min(scaledWidth, scaledHeight);
vec4 currentColor = mix(lightColor, darkColor, b);
vec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03);
color = czm_gammaCorrect(color);
material.diffuse = color.rgb;
material.alpha = color.a;
return material;
}
`;var fXt=T(S(),1),eR=`uniform vec4 lightColor;
uniform vec4 darkColor;
uniform vec2 repeat;
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
// From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights
float b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5)); // 0.0 or 1.0
vec4 color = mix(lightColor, darkColor, b);
color = czm_gammaCorrect(color);
material.diffuse = color.rgb;
material.alpha = color.a;
return material;
}
`;var bXt=T(S(),1),tR=`uniform sampler2D heights;
uniform sampler2D colors;
// This material expects heights to be sorted from lowest to highest.
float getHeight(int idx, float invTexSize)
{
vec2 uv = vec2((float(idx) + 0.5) * invTexSize, 0.5);
#ifdef OES_texture_float
return texture(heights, uv).x;
#else
return czm_unpackFloat(texture(heights, uv));
#endif
}
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
float height = materialInput.height;
float invTexSize = 1.0 / float(heightsDimensions.x);
float minHeight = getHeight(0, invTexSize);
float maxHeight = getHeight(heightsDimensions.x - 1, invTexSize);
// early-out when outside the height range
if (height < minHeight || height > maxHeight) {
material.diffuse = vec3(0.0);
material.alpha = 0.0;
return material;
}
// Binary search to find heights above and below.
int idxBelow = 0;
int idxAbove = heightsDimensions.x;
float heightBelow = minHeight;
float heightAbove = maxHeight;
// while loop not allowed, so use for loop with max iterations.
// maxIterations of 16 supports a texture size up to 65536 (2^16).
const int maxIterations = 16;
for (int i = 0; i < maxIterations; i++) {
if (idxBelow >= idxAbove - 1) {
break;
}
int idxMid = (idxBelow + idxAbove) / 2;
float heightTex = getHeight(idxMid, invTexSize);
if (height > heightTex) {
idxBelow = idxMid;
heightBelow = heightTex;
} else {
idxAbove = idxMid;
heightAbove = heightTex;
}
}
float lerper = heightBelow == heightAbove ? 1.0 : (height - heightBelow) / (heightAbove - heightBelow);
vec2 colorUv = vec2(invTexSize * (float(idxBelow) + 0.5 + lerper), 0.5);
vec4 color = texture(colors, colorUv);
// undo preumultiplied alpha
if (color.a > 0.0)
{
color.rgb /= color.a;
}
color.rgb = czm_gammaCorrect(color.rgb);
material.diffuse = color.rgb;
material.alpha = color.a;
return material;
}
`;var gXt=T(S(),1),nR=`uniform vec4 color;
uniform float spacing;
uniform float width;
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
float distanceToContour = mod(materialInput.height, spacing);
#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
float dxc = abs(dFdx(materialInput.height));
float dyc = abs(dFdy(materialInput.height));
float dF = max(dxc, dyc) * czm_pixelRatio * width;
float alpha = (distanceToContour < dF) ? 1.0 : 0.0;
#else
// If no derivatives available (IE 10?), use pixel ratio
float alpha = (distanceToContour < (czm_pixelRatio * width)) ? 1.0 : 0.0;
#endif
vec4 outColor = czm_gammaCorrect(vec4(color.rgb, alpha * color.a));
material.diffuse = outColor.rgb;
material.alpha = outColor.a;
return material;
}
`;var _Xt=T(S(),1),iR=`uniform sampler2D image;
uniform float minimumHeight;
uniform float maximumHeight;
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
float scaledHeight = clamp((materialInput.height - minimumHeight) / (maximumHeight - minimumHeight), 0.0, 1.0);
vec4 rampColor = texture(image, vec2(scaledHeight, 0.5));
rampColor = czm_gammaCorrect(rampColor);
material.diffuse = rampColor.rgb;
material.alpha = rampColor.a;
return material;
}
`;var SXt=T(S(),1),oR=`uniform vec4 fadeInColor;
uniform vec4 fadeOutColor;
uniform float maximumDistance;
uniform bool repeat;
uniform vec2 fadeDirection;
uniform vec2 time;
float getTime(float t, float coord)
{
float scalar = 1.0 / maximumDistance;
float q = distance(t, coord) * scalar;
if (repeat)
{
float r = distance(t, coord + 1.0) * scalar;
float s = distance(t, coord - 1.0) * scalar;
q = min(min(r, s), q);
}
return clamp(q, 0.0, 1.0);
}
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
vec2 st = materialInput.st;
float s = getTime(time.x, st.s) * fadeDirection.s;
float t = getTime(time.y, st.t) * fadeDirection.t;
float u = length(vec2(s, t));
vec4 color = mix(fadeInColor, fadeOutColor, u);
color = czm_gammaCorrect(color);
material.emission = color.rgb;
material.alpha = color.a;
return material;
}
`;var VXt=T(S(),1),rR=`uniform vec4 color;
uniform float cellAlpha;
uniform vec2 lineCount;
uniform vec2 lineThickness;
uniform vec2 lineOffset;
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
vec2 st = materialInput.st;
float scaledWidth = fract(lineCount.s * st.s - lineOffset.s);
scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));
float scaledHeight = fract(lineCount.t * st.t - lineOffset.t);
scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));
float value;
// Fuzz Factor - Controls blurriness of lines
#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
const float fuzz = 1.2;
vec2 thickness = (lineThickness * czm_pixelRatio) - 1.0;
// From "3D Engine Design for Virtual Globes" by Cozzi and Ring, Listing 4.13.
vec2 dx = abs(dFdx(st));
vec2 dy = abs(dFdy(st));
vec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount;
value = min(
smoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth),
smoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight));
#else
// If no derivatives available (IE 10?), revert to view-dependent fuzz
const float fuzz = 0.05;
vec2 range = 0.5 - (lineThickness * 0.05);
value = min(
1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth),
1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight));
#endif
// Edges taken from RimLightingMaterial.glsl
// See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html
float dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)));
float sRim = smoothstep(0.8, 1.0, dRim);
value *= (1.0 - sRim);
vec4 halfColor;
halfColor.rgb = color.rgb * 0.5;
halfColor.a = color.a * (1.0 - ((1.0 - cellAlpha) * value));
halfColor = czm_gammaCorrect(halfColor);
material.diffuse = halfColor.rgb;
material.emission = halfColor.rgb;
material.alpha = halfColor.a;
return material;
}
`;var RXt=T(S(),1),sR=`uniform sampler2D image;
uniform float strength;
uniform vec2 repeat;
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
vec4 textureValue = texture(image, fract(repeat * materialInput.st));
vec3 normalTangentSpace = textureValue.channels;
normalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0;
normalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0);
normalTangentSpace = normalize(normalTangentSpace);
vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;
material.normal = normalEC;
return material;
}
`;var GXt=T(S(),1),aR=`uniform vec4 color;
float getPointOnLine(vec2 p0, vec2 p1, float x)
{
float slope = (p0.y - p1.y) / (p0.x - p1.x);
return slope * (x - p0.x) + p0.y;
}
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
vec2 st = materialInput.st;
#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
float base = 1.0 - abs(fwidth(st.s)) * 10.0 * czm_pixelRatio;
#else
// If no derivatives available (IE 10?), 2.5% of the line will be the arrow head
float base = 0.975;
#endif
vec2 center = vec2(1.0, 0.5);
float ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s);
float ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s);
float halfWidth = 0.15;
float s = step(0.5 - halfWidth, st.t);
s *= 1.0 - step(0.5 + halfWidth, st.t);
s *= 1.0 - step(base, st.s);
float t = step(base, materialInput.st.s);
t *= 1.0 - step(ptOnUpperLine, st.t);
t *= step(ptOnLowerLine, st.t);
// Find the distance from the closest separator (region between two colors)
float dist;
if (st.s < base)
{
float d1 = abs(st.t - (0.5 - halfWidth));
float d2 = abs(st.t - (0.5 + halfWidth));
dist = min(d1, d2);
}
else
{
float d1 = czm_infinity;
if (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth)
{
d1 = abs(st.s - base);
}
float d2 = abs(st.t - ptOnUpperLine);
float d3 = abs(st.t - ptOnLowerLine);
dist = min(min(d1, d2), d3);
}
vec4 outsideColor = vec4(0.0);
vec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0));
vec4 outColor = czm_antialias(outsideColor, color, currentColor, dist);
outColor = czm_gammaCorrect(outColor);
material.diffuse = outColor.rgb;
material.alpha = outColor.a;
return material;
}
`;var IXt=T(S(),1),cR=`uniform vec4 color;
uniform vec4 gapColor;
uniform float dashLength;
uniform float dashPattern;
in float v_polylineAngle;
const float maskLength = 16.0;
mat2 rotate(float rad) {
float c = cos(rad);
float s = sin(rad);
return mat2(
c, s,
-s, c
);
}
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
vec2 pos = rotate(v_polylineAngle) * gl_FragCoord.xy;
// Get the relative position within the dash from 0 to 1
float dashPosition = fract(pos.x / (dashLength * czm_pixelRatio));
// Figure out the mask index.
float maskIndex = floor(dashPosition * maskLength);
// Test the bit mask.
float maskTest = floor(dashPattern / pow(2.0, maskIndex));
vec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color;
if (fragColor.a < 0.005) { // matches 0/255 and 1/255
discard;
}
fragColor = czm_gammaCorrect(fragColor);
material.emission = fragColor.rgb;
material.alpha = fragColor.a;
return material;
}
`;var WXt=T(S(),1),lR=`uniform vec4 color;
uniform float glowPower;
uniform float taperPower;
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
vec2 st = materialInput.st;
float glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5);
if (taperPower <= 0.99999) {
glow *= min(1.0, taperPower / (0.5 - st.s * 0.5) - (taperPower / 0.5));
}
vec4 fragColor;
fragColor.rgb = max(vec3(glow - 1.0 + color.rgb), color.rgb);
fragColor.a = clamp(0.0, 1.0, glow) * color.a;
fragColor = czm_gammaCorrect(fragColor);
material.emission = fragColor.rgb;
material.alpha = fragColor.a;
return material;
}
`;var vXt=T(S(),1),dR=`uniform vec4 color;
uniform vec4 outlineColor;
uniform float outlineWidth;
in float v_width;
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
vec2 st = materialInput.st;
float halfInteriorWidth = 0.5 * (v_width - outlineWidth) / v_width;
float b = step(0.5 - halfInteriorWidth, st.t);
b *= 1.0 - step(0.5 + halfInteriorWidth, st.t);
// Find the distance from the closest separator (region between two colors)
float d1 = abs(st.t - (0.5 - halfInteriorWidth));
float d2 = abs(st.t - (0.5 + halfInteriorWidth));
float dist = min(d1, d2);
vec4 currentColor = mix(outlineColor, color, b);
vec4 outColor = czm_antialias(outlineColor, color, currentColor, dist);
outColor = czm_gammaCorrect(outColor);
material.diffuse = outColor.rgb;
material.alpha = outColor.a;
return material;
}
`;var FXt=T(S(),1),uR=`uniform vec4 color;
uniform vec4 rimColor;
uniform float width;
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
// See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html
float d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC));
float s = smoothstep(1.0 - width, 1.0, d);
vec4 outColor = czm_gammaCorrect(color);
vec4 outRimColor = czm_gammaCorrect(rimColor);
material.diffuse = outColor.rgb;
material.emission = outRimColor.rgb * s;
material.alpha = mix(outColor.a, outRimColor.a, s);
return material;
}
`;var MXt=T(S(),1),mR=`uniform sampler2D image;
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
vec4 rampColor = texture(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5));
rampColor = czm_gammaCorrect(rampColor);
material.diffuse = rampColor.rgb;
material.alpha = rampColor.a;
return material;
}
`;var UXt=T(S(),1),hR=`uniform vec4 evenColor;
uniform vec4 oddColor;
uniform float offset;
uniform float repeat;
uniform bool horizontal;
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
// Based on the Stripes Fragment Shader in the Orange Book (11.1.2)
float coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal));
float value = fract((coord - offset) * (repeat * 0.5));
float dist = min(value, min(abs(value - 0.5), 1.0 - value));
vec4 currentColor = mix(evenColor, oddColor, step(0.5, value));
vec4 color = czm_antialias(evenColor, oddColor, currentColor, dist);
color = czm_gammaCorrect(color);
material.diffuse = color.rgb;
material.alpha = color.a;
return material;
}
`;var DXt=T(S(),1),fR=`// Thanks for the contribution Jonas
// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog
uniform sampler2D specularMap;
uniform sampler2D normalMap;
uniform vec4 baseWaterColor;
uniform vec4 blendColor;
uniform float frequency;
uniform float animationSpeed;
uniform float amplitude;
uniform float specularIntensity;
uniform float fadeFactor;
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
float time = czm_frameNumber * animationSpeed;
// fade is a function of the distance from the fragment and the frequency of the waves
float fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor);
float specularMapValue = texture(specularMap, materialInput.st).r;
// note: not using directional motion at this time, just set the angle to 0.0;
vec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0);
vec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude));
// fade out the normal perturbation as we move further from the water surface
normalTangentSpace.xy /= fade;
// attempt to fade out the normal perturbation as we approach non water areas (low specular map value)
normalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue);
normalTangentSpace = normalize(normalTangentSpace);
// get ratios for alignment of the new normal vector with a vector perpendicular to the tangent plane
float tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0);
// fade out water effect as specular map value decreases
material.alpha = mix(blendColor.a, baseWaterColor.a, specularMapValue) * specularMapValue;
// base color is a blend of the water and non-water color based on the value from the specular map
// may need a uniform blend factor to better control this
material.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue);
// diffuse highlights are based on how perturbed the normal is
material.diffuse += (0.1 * tsPerturbationRatio);
material.diffuse = material.diffuse;
material.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace);
material.specular = specularIntensity;
material.shininess = 10.0;
return material;
}
`;function Je(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._minificationFilter=g(e.minificationFilter,dn.LINEAR),this._magnificationFilter=g(e.magnificationFilter,Ti.LINEAR),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,pLe(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1}}),l(Je._uniformList[this.type])||(Je._uniformList[this.type]=Object.keys(this._uniforms))}Je._uniformList={};Je.fromType=function(e,t){let n=new Je({fabric:{type:e}});if(l(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};Je.prototype.isTranslucent=function(){if(l(this.translucent))return typeof this.translucent=="function"?this.translucent():this.translucent;let e=!0,t=this._translucentFunctions,n=t.length;for(let i=0;i<n;++i){let o=t[i];if(typeof o=="function"?e=e&&o():e=e&&o,!e)break}return e};Je.prototype.update=function(e){this._defaultTexture=e.defaultTexture;let t,n,i=this._loadedImages,o=i.length;for(t=0;t<o;++t){let c=i[t];n=c.id;let d=c.image,u;Array.isArray(d)&&(u=d.slice(1,d.length).map(function(x){return x.bufferView}),d=d[0]);let m=new hn({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter}),p;l(d.internalFormat)?p=new wt({context:e,pixelFormat:d.internalFormat,width:d.width,height:d.height,source:{arrayBufferView:d.bufferView,mipLevels:u},sampler:m}):p=new wt({context:e,source:d,sampler:m});let y=this._textures[n];l(y)&&y!==this._defaultTexture&&y.destroy(),this._textures[n]=p;let f=`${n}Dimensions`;if(this.uniforms.hasOwnProperty(f)){let x=this.uniforms[f];x.x=p._width,x.y=p._height}}i.length=0;let r=this._loadedCubeMaps;for(o=r.length,t=0;t<o;++t){let c=r[t];n=c.id;let d=c.images,u=new Ja({context:e,source:{positiveX:d[0],negativeX:d[1],positiveY:d[2],negativeY:d[3],positiveZ:d[4],negativeZ:d[5]},sampler:new hn({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[n]=u}r.length=0;let s=this._updateFunctions;for(o=s.length,t=0;t<o;++t)s[t](this,e);let a=this.materials;for(let c in a)a.hasOwnProperty(c)&&a[c].update(e)};Je.prototype.isDestroyed=function(){return!1};Je.prototype.destroy=function(){let e=this._textures;for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];i!==this._defaultTexture&&i.destroy()}let t=this.materials;for(let n in t)t.hasOwnProperty(n)&&t[n].destroy();return ue(this)};function pLe(e,t){e=g(e,g.EMPTY_OBJECT),t._strict=g(e.strict,!1),t._count=g(e.count,0),t._template=ze(g(e.fabric,g.EMPTY_OBJECT)),t._template.uniforms=ze(g(t._template.uniforms,g.EMPTY_OBJECT)),t._template.materials=ze(g(t._template.materials,g.EMPTY_OBJECT)),t.type=l(t._template.type)?t._template.type:Hn(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n,i=Je._materialCache.getMaterial(t.type);if(l(i)){let r=ze(i.fabric,!0);t._template=Tt(t._template,r,!0),n=i.translucent}xLe(t),l(i)||Je._materialCache.addMaterial(t.type,t),TLe(t),LLe(t),ZLe(t);let o=t._translucentFunctions.length===0?!0:void 0;if(n=g(n,o),n=g(e.translucent,n),l(n))if(typeof n=="function"){let r=function(){return n(t)};t._translucentFunctions.push(r)}else t._translucentFunctions.push(n)}function j3(e,t,n,i){if(l(e)){for(let o in e)if(e.hasOwnProperty(o)){let r=t.indexOf(o)!==-1;(i&&!r||!i&&r)&&n(o,t)}}}function vq(e,t){}function bLe(e,t){}var yLe=["type","materials","uniforms","components","source"],gLe=["diffuse","specular","shininess","normal","emission","alpha"];function xLe(e){let t=e._template,n=t.uniforms,i=t.materials,o=t.components;j3(t,yLe,vq,!0),j3(o,gLe,vq,!0);let r=[];for(let s in i)i.hasOwnProperty(s)&&r.push(s);j3(n,r,bLe,!1)}function _Le(e,t){let n=t._template.materials;for(let i in n)if(n.hasOwnProperty(i)&&e.indexOf(i)>-1)return!0;return!1}function TLe(e){let t=e._template.components,n=e._template.source;if(l(n))e.shaderSource+=`${n}
`;else{if(e.shaderSource+=`czm_material czm_getMaterial(czm_materialInput materialInput)
{
`,e.shaderSource+=`czm_material material = czm_getDefaultMaterial(materialInput);
`,l(t)){let i=Object.keys(e._template.materials).length>0;for(let o in t)if(t.hasOwnProperty(o))if(o==="diffuse"||o==="emission"){let s=i&&_Le(t[o],e)?t[o]:`czm_gammaCorrect(${t[o]})`;e.shaderSource+=`material.${o} = ${s};
`}else o==="alpha"?e.shaderSource+=`material.alpha = ${t.alpha};
`:e.shaderSource+=`material.${o} = ${t[o]};
`}e.shaderSource+=`return material;
}
`}}var wq={mat2:io,mat3:q,mat4:A},SLe=/\.ktx2$/i;function CLe(e){let t;return function(n,i){let o=n.uniforms,r=o[e],s=t!==r,a=!l(r)||r===Je.DefaultImageId;t=r;let c=n._textures[e],d,u;if(r instanceof HTMLVideoElement){if(r.readyState>=2){if(s&&l(c)&&(c!==i.defaultTexture&&c.destroy(),c=void 0),!l(c)||c===i.defaultTexture){let p=new hn({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new wt({context:i,source:r,sampler:p}),n._textures[e]=c;return}c.copyFrom({source:r})}else l(c)||(n._textures[e]=i.defaultTexture);return}if(r instanceof wt&&r!==c){n._texturePaths[e]=void 0;let p=n._textures[e];l(p)&&p!==n._defaultTexture&&p.destroy(),n._textures[e]=r,d=`${e}Dimensions`,o.hasOwnProperty(d)&&(u=o[d],u.x=r._width,u.y=r._height);return}if(s&&l(c)&&a&&(c!==n._defaultTexture&&c.destroy(),c=void 0),l(c)||(n._texturePaths[e]=void 0,c=n._textures[e]=n._defaultTexture,d=`${e}Dimensions`,o.hasOwnProperty(d)&&(u=o[d],u.x=c._width,u.y=c._height)),a)return;let m=r instanceof Xe;if(!l(n._texturePaths[e])||m&&r.url!==n._texturePaths[e].url||!m&&r!==n._texturePaths[e]){if(typeof r=="string"||m){let p=m?r:Xe.createIfNeeded(r),y;SLe.test(p.url)?y=bl(p.url):y=p.fetchImage(),Promise.resolve(y).then(function(f){n._loadedImages.push({id:e,image:f})}).catch(function(){l(c)&&c!==n._defaultTexture&&c.destroy(),n._textures[e]=n._defaultTexture})}else(r instanceof HTMLCanvasElement||r instanceof HTMLImageElement)&&n._loadedImages.push({id:e,image:r});n._texturePaths[e]=r}}}function VLe(e){return function(t,n){let i=t.uniforms[e];if(i instanceof Ja){let r=t._textures[e];r!==t._defaultTexture&&r.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}if(l(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=n.defaultCubeMap),i===Je.DefaultCubeMapId)return;let o=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(o!==t._texturePaths[e]){let r=[Xe.createIfNeeded(i.positiveX).fetchImage(),Xe.createIfNeeded(i.negativeX).fetchImage(),Xe.createIfNeeded(i.positiveY).fetchImage(),Xe.createIfNeeded(i.negativeY).fetchImage(),Xe.createIfNeeded(i.positiveZ).fetchImage(),Xe.createIfNeeded(i.negativeZ).fetchImage()];Promise.all(r).then(function(s){t._loadedCubeMaps.push({id:e,images:s})}),t._texturePaths[e]=o}}}function LLe(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&Fq(e,n)}function Fq(e,t){let n=e._strict,i=e._template.uniforms,o=i[t],r=RLe(o),s;if(r==="channels")s=pR(e,t,o,!1);else{if(r==="sampler2D"){let d=`${t}Dimensions`;GLe(e,d)>0&&(i[d]={type:"ivec3",x:1,y:1},Fq(e,d))}if(!new RegExp(`uniform\\s+${r}\\s+${t}\\s*;`).test(e.shaderSource)){let d=`uniform ${r} ${t};`;e.shaderSource=d+e.shaderSource}let c=`${t}_${e._count++}`;if(s=pR(e,t,c),e.uniforms[t]=o,r==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(CLe(t));else if(r==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(VLe(t));else if(r.indexOf("mat")!==-1){let d=new wq[r];e._uniforms[c]=function(){return wq[r].fromColumnMajorArray(e.uniforms[t],d)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function RLe(e){let t=e.type;if(!l(t)){let n=typeof e;if(n==="number")t="float";else if(n==="boolean")t="bool";else if(n==="string"||e instanceof Xe||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)/^([rgba]){1,4}$/i.test(e)?t="channels":e===Je.DefaultCubeMapId?t="samplerCube":t="sampler2D";else if(n==="object")if(Array.isArray(e))(e.length===4||e.length===9||e.length===16)&&(t=`mat${Math.sqrt(e.length)}`);else{let i=0;for(let o in e)e.hasOwnProperty(o)&&(i+=1);i>=2&&i<=4?t=`vec${i}`:i===6&&(t="samplerCube")}}return t}function ZLe(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=new Je({strict:t,fabric:n[i],count:e._count});e._count=o._count,e._uniforms=Tt(e._uniforms,o._uniforms,!0),e.materials[i]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);let r="czm_getMaterial",s=`${r}_${e._count++}`;pR(o,r,s),e.shaderSource=o.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=pR(e,i,a)}}function pR(e,t,n,i){i=g(i,!0);let o=0,r="([\\w])?",s=`([\\w${i?".":""}])?`,a=new RegExp(s+t+r,"g");return e.shaderSource=e.shaderSource.replace(a,function(c,d,u){return d||u?c:(o+=1,n)}),o}function GLe(e,t,n){return pR(e,t,t,n)}Je._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};Je.DefaultImageId="czm_defaultImage";Je.DefaultCubeMapId="czm_defaultCubeMap";Je.ColorType="Color";Je._materialCache.addMaterial(Je.ColorType,{fabric:{type:Je.ColorType,uniforms:{color:new O(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});Je.ImageType="Image";Je._materialCache.addMaterial(Je.ImageType,{fabric:{type:Je.ImageType,uniforms:{image:Je.DefaultImageId,repeat:new B(1,1),color:new O(1,1,1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});Je.DiffuseMapType="DiffuseMap";Je._materialCache.addMaterial(Je.DiffuseMapType,{fabric:{type:Je.DiffuseMapType,uniforms:{image:Je.DefaultImageId,channels:"rgb",repeat:new B(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});Je.AlphaMapType="AlphaMap";Je._materialCache.addMaterial(Je.AlphaMapType,{fabric:{type:Je.AlphaMapType,uniforms:{image:Je.DefaultImageId,channel:"a",repeat:new B(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});Je.SpecularMapType="SpecularMap";Je._materialCache.addMaterial(Je.SpecularMapType,{fabric:{type:Je.SpecularMapType,uniforms:{image:Je.DefaultImageId,channel:"r",repeat:new B(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});Je.EmissionMapType="EmissionMap";Je._materialCache.addMaterial(Je.EmissionMapType,{fabric:{type:Je.EmissionMapType,uniforms:{image:Je.DefaultImageId,channels:"rgb",repeat:new B(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});Je.BumpMapType="BumpMap";Je._materialCache.addMaterial(Je.BumpMapType,{fabric:{type:Je.BumpMapType,uniforms:{image:Je.DefaultImageId,channel:"r",strength:.8,repeat:new B(1,1)},source:qL},translucent:!1});Je.NormalMapType="NormalMap";Je._materialCache.addMaterial(Je.NormalMapType,{fabric:{type:Je.NormalMapType,uniforms:{image:Je.DefaultImageId,channels:"rgb",strength:.8,repeat:new B(1,1)},source:sR},translucent:!1});Je.GridType="Grid";Je._materialCache.addMaterial(Je.GridType,{fabric:{type:Je.GridType,uniforms:{color:new O(0,1,0,1),cellAlpha:.1,lineCount:new B(8,8),lineThickness:new B(1,1),lineOffset:new B(0,0)},source:rR},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});Je.StripeType="Stripe";Je._materialCache.addMaterial(Je.StripeType,{fabric:{type:Je.StripeType,uniforms:{horizontal:!0,evenColor:new O(1,1,1,.5),oddColor:new O(0,0,1,.5),offset:0,repeat:5},source:hR},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});Je.CheckerboardType="Checkerboard";Je._materialCache.addMaterial(Je.CheckerboardType,{fabric:{type:Je.CheckerboardType,uniforms:{lightColor:new O(1,1,1,.5),darkColor:new O(0,0,0,.5),repeat:new B(5,5)},source:$L},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});Je.DotType="Dot";Je._materialCache.addMaterial(Je.DotType,{fabric:{type:Je.DotType,uniforms:{lightColor:new O(1,1,0,.75),darkColor:new O(0,1,1,.75),repeat:new B(5,5)},source:eR},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});Je.WaterType="Water";Je._materialCache.addMaterial(Je.WaterType,{fabric:{type:Je.WaterType,uniforms:{baseWaterColor:new O(.2,.3,.6,1),blendColor:new O(0,1,.699,1),specularMap:Je.DefaultImageId,normalMap:Je.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:fR},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});Je.RimLightingType="RimLighting";Je._materialCache.addMaterial(Je.RimLightingType,{fabric:{type:Je.RimLightingType,uniforms:{color:new O(1,0,0,.7),rimColor:new O(1,1,1,.4),width:.3},source:uR},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});Je.FadeType="Fade";Je._materialCache.addMaterial(Je.FadeType,{fabric:{type:Je.FadeType,uniforms:{fadeInColor:new O(1,0,0,1),fadeOutColor:new O(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new B(.5,.5)},source:oR},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});Je.PolylineArrowType="PolylineArrow";Je._materialCache.addMaterial(Je.PolylineArrowType,{fabric:{type:Je.PolylineArrowType,uniforms:{color:new O(1,1,1,1)},source:aR},translucent:!0});Je.PolylineDashType="PolylineDash";Je._materialCache.addMaterial(Je.PolylineDashType,{fabric:{type:Je.PolylineDashType,uniforms:{color:new O(1,0,1,1),gapColor:new O(0,0,0,0),dashLength:16,dashPattern:255},source:cR},translucent:!0});Je.PolylineGlowType="PolylineGlow";Je._materialCache.addMaterial(Je.PolylineGlowType,{fabric:{type:Je.PolylineGlowType,uniforms:{color:new O(0,.5,1,1),glowPower:.25,taperPower:1},source:lR},translucent:!0});Je.PolylineOutlineType="PolylineOutline";Je._materialCache.addMaterial(Je.PolylineOutlineType,{fabric:{type:Je.PolylineOutlineType,uniforms:{color:new O(1,1,1,1),outlineColor:new O(1,0,0,1),outlineWidth:1},source:dR},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});Je.ElevationContourType="ElevationContour";Je._materialCache.addMaterial(Je.ElevationContourType,{fabric:{type:Je.ElevationContourType,uniforms:{spacing:100,color:new O(1,0,0,1),width:1},source:nR},translucent:!1});Je.ElevationRampType="ElevationRamp";Je._materialCache.addMaterial(Je.ElevationRampType,{fabric:{type:Je.ElevationRampType,uniforms:{image:Je.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:iR},translucent:!1});Je.SlopeRampMaterialType="SlopeRamp";Je._materialCache.addMaterial(Je.SlopeRampMaterialType,{fabric:{type:Je.SlopeRampMaterialType,uniforms:{image:Je.DefaultImageId},source:mR},translucent:!1});Je.AspectRampMaterialType="AspectRamp";Je._materialCache.addMaterial(Je.AspectRampMaterialType,{fabric:{type:Je.AspectRampMaterialType,uniforms:{image:Je.DefaultImageId},source:jL},translucent:!1});Je.ElevationBandType="ElevationBand";Je._materialCache.addMaterial(Je.ElevationBandType,{fabric:{type:Je.ElevationBandType,uniforms:{heights:Je.DefaultImageId,colors:Je.DefaultImageId},source:tR},translucent:!0});var Bi=Je;function qg(e){e=g(e,g.EMPTY_OBJECT);let t=g(e.translucent,!0),n=g(e.closed,!1),i=g(e.materialSupport,qg.MaterialSupport.TEXTURED);this.material=l(e.material)?e.material:Bi.fromType(Bi.ColorType),this.translucent=t,this._vertexShaderSource=g(e.vertexShaderSource,i.vertexShaderSource),this._fragmentShaderSource=g(e.fragmentShaderSource,i.fragmentShaderSource),this._renderState=ro.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._materialSupport=i,this._vertexFormat=i.vertexFormat,this._flat=g(e.flat,!1),this._faceForward=g(e.faceForward,!n)}Object.defineProperties(qg.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}}});qg.prototype.getFragmentShaderSource=ro.prototype.getFragmentShaderSource;qg.prototype.isTranslucent=ro.prototype.isTranslucent;qg.prototype.getRenderState=ro.prototype.getRenderState;qg.MaterialSupport={BASIC:Object.freeze({vertexFormat:Pe.POSITION_AND_NORMAL,vertexShaderSource:OL,fragmentShaderSource:BL}),TEXTURED:Object.freeze({vertexFormat:Pe.POSITION_NORMAL_AND_ST,vertexShaderSource:HL,fragmentShaderSource:YL}),ALL:Object.freeze({vertexFormat:Pe.ALL,vertexShaderSource:DL,fragmentShaderSource:kL})};var mo=qg;var n2t=T(S(),1);var kWt=T(S(),1),bR=`in vec3 v_positionEC;
in vec3 v_normalEC;
in vec4 v_color;
void main()
{
vec3 positionToEyeEC = -v_positionEC;
vec3 normalEC = normalize(v_normalEC);
#ifdef FACE_FORWARD
normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
#endif
vec4 color = czm_gammaCorrect(v_color);
czm_materialInput materialInput;
materialInput.normalEC = normalEC;
materialInput.positionToEyeEC = positionToEyeEC;
czm_material material = czm_getDefaultMaterial(materialInput);
material.diffuse = color.rgb;
material.alpha = color.a;
out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
}
`;var BWt=T(S(),1),yR=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec3 normal;
in vec4 color;
in float batchId;
out vec3 v_positionEC;
out vec3 v_normalEC;
out vec4 v_color;
void main()
{
vec4 p = czm_computePosition();
v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates
v_normalEC = czm_normal * normal; // normal in eye coordinates
v_color = color;
gl_Position = czm_modelViewProjectionRelativeToEye * p;
}
`;var YWt=T(S(),1),$g=`in vec4 v_color;
void main()
{
out_FragColor = czm_gammaCorrect(v_color);
}
`;var KWt=T(S(),1),gR=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec4 color;
in float batchId;
out vec4 v_color;
void main()
{
vec4 p = czm_computePosition();
v_color = color;
gl_Position = czm_modelViewProjectionRelativeToEye * p;
}
`;function mp(e){e=g(e,g.EMPTY_OBJECT);let t=g(e.translucent,!0),n=g(e.closed,!1),i=g(e.flat,!1),o=i?gR:yR,r=i?$g:bR,s=i?mp.FLAT_VERTEX_FORMAT:mp.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=g(e.vertexShaderSource,o),this._fragmentShaderSource=g(e.fragmentShaderSource,r),this._renderState=ro.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=g(e.faceForward,!n)}Object.defineProperties(mp.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}}});mp.VERTEX_FORMAT=Pe.POSITION_AND_NORMAL;mp.FLAT_VERTEX_FORMAT=Pe.POSITION_ONLY;mp.prototype.getFragmentShaderSource=ro.prototype.getFragmentShaderSource;mp.prototype.isTranslucent=ro.prototype.isTranslucent;mp.prototype.getRenderState=ro.prototype.getRenderState;var cn=mp;var l2t=T(S(),1);function AS(e){this._definitionChanged=new ye,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(AS.prototype,{isConstant:{get:function(){return z.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color")});AS.prototype.getType=function(e){return"Color"};AS.prototype.getValue=function(e,t){return l(t)||(t={}),t.color=z.getValueOrClonedDefault(this._color,e,O.WHITE,t.color),t};AS.prototype.equals=function(e){return this===e||e instanceof AS&&z.equals(this._color,e._color)};var Ut=AS;var qOt=T(S(),1);var WOt=T(S(),1);var X2t=T(S(),1);var g2t=T(S(),1);function _b(e){e=g(e,g.EMPTY_OBJECT),this._ellipsoid=g(e.ellipsoid,oe.WGS84),this._rectangle=g(e.rectangle,de.MAX_VALUE),this._projection=new Ri(this._ellipsoid),this._numberOfLevelZeroTilesX=g(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=g(e.numberOfLevelZeroTilesY,1)}Object.defineProperties(_b.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});_b.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};_b.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};_b.prototype.rectangleToNativeRectangle=function(e,t){let n=W.toDegrees(e.west),i=W.toDegrees(e.south),o=W.toDegrees(e.east),r=W.toDegrees(e.north);return l(t)?(t.west=n,t.south=i,t.east=o,t.north=r,t):new de(n,i,o,r)};_b.prototype.tileXYToNativeRectangle=function(e,t,n,i){let o=this.tileXYToRectangle(e,t,n,i);return o.west=W.toDegrees(o.west),o.south=W.toDegrees(o.south),o.east=W.toDegrees(o.east),o.north=W.toDegrees(o.north),o};_b.prototype.tileXYToRectangle=function(e,t,n,i){let o=this._rectangle,r=this.getNumberOfXTilesAtLevel(n),s=this.getNumberOfYTilesAtLevel(n),a=o.width/r,c=e*a+o.west,d=(e+1)*a+o.west,u=o.height/s,m=o.north-t*u,p=o.north-(t+1)*u;return l(i)||(i=new de(c,p,d,m)),i.west=c,i.south=p,i.east=d,i.north=m,i};_b.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!de.contains(i,e))return;let o=this.getNumberOfXTilesAtLevel(t),r=this.getNumberOfYTilesAtLevel(t),s=i.width/o,a=i.height/r,c=e.longitude;i.east<i.west&&(c+=W.TWO_PI);let d=(c-i.west)/s|0;d>=o&&(d=o-1);let u=(i.north-e.latitude)/a|0;return u>=r&&(u=r-1),l(n)?(n.x=d,n.y=u,n):new B(d,u)};var Oi=_b;var Aq=new h,Mq=new h,Nq=new he,q3=new h,ELe=new h,Uq=new ce,ILe=new Oi,xR=[new he,new he,new he,new he],_R=new B,Ur={};Ur.initialize=function(){let e=Ur._initPromise;return l(e)||(e=Xe.fetchJson(on("Assets/approximateTerrainHeights.json")).then(function(t){Ur._terrainHeights=t}),Ur._initPromise=e),e};Ur.getMinimumMaximumHeights=function(e,t){t=g(t,oe.WGS84);let n=kq(e),i=Ur._defaultMinTerrainHeight,o=Ur._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=Ur._terrainHeights[r];l(s)&&(i=s[0],o=s[1]),t.cartographicToCartesian(de.northeast(e,Nq),Aq),t.cartographicToCartesian(de.southwest(e,Nq),Mq),h.midpoint(Mq,Aq,q3);let a=t.scaleToGeodeticSurface(q3,ELe);if(l(a)){let c=h.distance(q3,a);i=Math.min(i,-c)}else i=Ur._defaultMinTerrainHeight}return i=Math.max(Ur._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:o}};Ur.getBoundingSphere=function(e,t){t=g(t,oe.WGS84);let n=kq(e),i=Ur._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=Ur._terrainHeights[r];l(s)&&(i=s[1])}let o=ce.fromRectangle3D(e,t,0);return ce.fromRectangle3D(e,t,i,Uq),ce.union(o,Uq,o)};function kq(e){he.fromRadians(e.east,e.north,0,xR[0]),he.fromRadians(e.west,e.north,0,xR[1]),he.fromRadians(e.east,e.south,0,xR[2]),he.fromRadians(e.west,e.south,0,xR[3]);let t=0,n=0,i=0,o=0,r=Ur._terrainHeightsMaxLevel,s;for(s=0;s<=r;++s){let a=!1;for(let c=0;c<4;++c){let d=xR[c];if(ILe.positionToTileXY(d,s,_R),c===0)i=_R.x,o=_R.y;else if(i!==_R.x||o!==_R.y){a=!0;break}}if(a)break;t=i,n=o}if(s!==0)return{x:t,y:n,level:s>r?r:s-1}}Ur._terrainHeightsMaxLevel=6;Ur._defaultMaxTerrainHeight=9e3;Ur._defaultMinTerrainHeight=-1e5;Ur._terrainHeights=void 0;Ur._initPromise=void 0;Object.defineProperties(Ur,{initialized:{get:function(){return l(Ur._terrainHeights)}}});var hi=Ur;var zPt=T(S(),1);var XPt=T(S(),1);var A2t=T(S(),1);function Ic(e,t,n){this.minimum=h.clone(g(e,h.ZERO)),this.maximum=h.clone(g(t,h.ZERO)),l(n)?n=h.clone(n):n=h.midpoint(this.minimum,this.maximum,new h),this.center=n}Ic.fromCorners=function(e,t,n){return l(n)||(n=new Ic),n.minimum=h.clone(e,n.minimum),n.maximum=h.clone(t,n.maximum),n.center=h.midpoint(e,t,n.center),n};Ic.fromPoints=function(e,t){if(l(t)||(t=new Ic),!l(e)||e.length===0)return t.minimum=h.clone(h.ZERO,t.minimum),t.maximum=h.clone(h.ZERO,t.maximum),t.center=h.clone(h.ZERO,t.center),t;let n=e[0].x,i=e[0].y,o=e[0].z,r=e[0].x,s=e[0].y,a=e[0].z,c=e.length;for(let m=1;m<c;m++){let p=e[m],y=p.x,f=p.y,x=p.z;n=Math.min(y,n),r=Math.max(y,r),i=Math.min(f,i),s=Math.max(f,s),o=Math.min(x,o),a=Math.max(x,a)}let d=t.minimum;d.x=n,d.y=i,d.z=o;let u=t.maximum;return u.x=r,u.y=s,u.z=a,t.center=h.midpoint(d,u,t.center),t};Ic.clone=function(e,t){if(l(e))return l(t)?(t.minimum=h.clone(e.minimum,t.minimum),t.maximum=h.clone(e.maximum,t.maximum),t.center=h.clone(e.center,t.center),t):new Ic(e.minimum,e.maximum,e.center)};Ic.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&h.equals(e.minimum,t.minimum)&&h.equals(e.maximum,t.maximum)};var wM=new h;Ic.intersectPlane=function(e,t){wM=h.subtract(e.maximum,e.minimum,wM);let n=h.multiplyByScalar(wM,.5,wM),i=t.normal,o=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),r=h.dot(e.center,i)+t.distance;return r-o>0?nn.INSIDE:r+o<0?nn.OUTSIDE:nn.INTERSECTING};Ic.prototype.clone=function(e){return Ic.clone(this,e)};Ic.prototype.intersectPlane=function(e){return Ic.intersectPlane(this,e)};Ic.prototype.equals=function(e){return Ic.equals(this,e)};var Tb=Ic;var uPt=T(S(),1);var U2t=T(S(),1);var $3={};$3.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function Dq(e,t,n){let i=e+t;return W.sign(e)!==W.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}$3.computeRealRoots=function(e,t,n){let i;if(e===0)return t===0?[]:[-n/t];if(t===0){if(n===0)return[0,0];let c=Math.abs(n),d=Math.abs(e);if(c<d&&c/d<W.EPSILON14)return[0,0];if(c>d&&d/c<W.EPSILON14)return[];if(i=-n/e,i<0)return[];let u=Math.sqrt(i);return[-u,u]}else if(n===0)return i=-t/e,i<0?[i,0]:[0,i];let o=t*t,r=4*e*n,s=Dq(o,-r,W.EPSILON14);if(s<0)return[];let a=-.5*Dq(t,W.sign(t)*Math.sqrt(s),W.EPSILON14);return t>0?[a/e,n/a]:[n/a,a/e]};var Xc=$3;var z2t=T(S(),1);var B2t=T(S(),1);var tO={};tO.computeDiscriminant=function(e,t,n,i){let o=e*e,r=t*t,s=n*n,a=i*i;return 18*e*t*n*i+r*s-27*o*a-4*(e*s*n+r*t*i)};function eO(e,t,n,i){let o=e,r=t/3,s=n/3,a=i,c=o*s,d=r*a,u=r*r,m=s*s,p=o*s-u,y=o*a-r*s,f=r*a-m,x=4*p*f-y*y,_,C;if(x<0){let J,K,ee;u*d>=c*m?(J=o,K=p,ee=-2*r*p+o*y):(J=a,K=f,ee=-a*y+2*s*f);let j=-(ee<0?-1:1)*Math.abs(J)*Math.sqrt(-x);C=-ee+j;let $=C/2,pe=$<0?-Math.pow(-$,1/3):Math.pow($,1/3),ge=C===j?-pe:-K/pe;return _=K<=0?pe+ge:-ee/(pe*pe+ge*ge+K),u*d>=c*m?[(_-r)/o]:[-a/(_+s)]}let V=p,L=-2*r*p+o*y,Z=f,G=-a*y+2*s*f,I=Math.sqrt(x),P=Math.sqrt(3)/2,v=Math.abs(Math.atan2(o*I,-L)/3);_=2*Math.sqrt(-V);let F=Math.cos(v);C=_*F;let M=_*(-F/2-P*Math.sin(v)),b=C+M>2*r?C-r:M-r,R=o,E=b/R;v=Math.abs(Math.atan2(a*I,-G)/3),_=2*Math.sqrt(-Z),F=Math.cos(v),C=_*F,M=_*(-F/2-P*Math.sin(v));let X=-a,w=C+M<2*s?C+s:M+s,N=X/w,D=R*w,k=-b*w-R*X,Y=b*X,U=(s*k-r*Y)/(-r*k+s*D);return E<=U?E<=N?U<=N?[E,U,N]:[E,N,U]:[N,E,U]:E<=N?[U,E,N]:U<=N?[U,N,E]:[N,U,E]}tO.computeRealRoots=function(e,t,n,i){let o,r;if(e===0)return Xc.computeRealRoots(t,n,i);if(t===0){if(n===0){if(i===0)return[0,0,0];r=-i/e;let s=r<0?-Math.pow(-r,1/3):Math.pow(r,1/3);return[s,s,s]}else if(i===0)return o=Xc.computeRealRoots(e,0,n),o.Length===0?[0]:[o[0],0,o[1]];return eO(e,0,n,i)}else{if(n===0)return i===0?(r=-t/e,r<0?[r,0,0]:[0,0,r]):eO(e,t,0,i);if(i===0)return o=Xc.computeRealRoots(e,t,n),o.length===0?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]}return eO(e,t,n,i)};var ex=tO;var nO={};nO.computeDiscriminant=function(e,t,n,i,o){let r=e*e,s=r*e,a=t*t,c=a*t,d=n*n,u=d*n,m=i*i,p=m*i,y=o*o,f=y*o;return a*d*m-4*c*p-4*e*u*m+18*e*t*n*p-27*r*m*m+256*s*f+o*(18*c*n*i-4*a*u+16*e*d*d-80*e*t*d*i-6*e*a*m+144*r*n*m)+y*(144*e*a*n-27*a*a-128*r*d-192*r*t*i)};function gm(e,t,n,i){let o=e*e,r=t-3*o/8,s=n-t*e/2+o*e/8,a=i-n*e/4+t*o/16-3*o*o/256,c=ex.computeRealRoots(1,2*r,r*r-4*a,-s*s);if(c.length>0){let d=-e/4,u=c[c.length-1];if(Math.abs(u)<W.EPSILON14){let m=Xc.computeRealRoots(1,r,a);if(m.length===2){let p=m[0],y=m[1],f;if(p>=0&&y>=0){let x=Math.sqrt(p),_=Math.sqrt(y);return[d-_,d-x,d+x,d+_]}else{if(p>=0&&y<0)return f=Math.sqrt(p),[d-f,d+f];if(p<0&&y>=0)return f=Math.sqrt(y),[d-f,d+f]}}return[]}else if(u>0){let m=Math.sqrt(u),p=(r+u-s/m)/2,y=(r+u+s/m)/2,f=Xc.computeRealRoots(1,m,p),x=Xc.computeRealRoots(1,-m,y);return f.length!==0?(f[0]+=d,f[1]+=d,x.length!==0?(x[0]+=d,x[1]+=d,f[1]<=x[0]?[f[0],f[1],x[0],x[1]]:x[1]<=f[0]?[x[0],x[1],f[0],f[1]]:f[0]>=x[0]&&f[1]<=x[1]?[x[0],f[0],f[1],x[1]]:x[0]>=f[0]&&x[1]<=f[1]?[f[0],x[0],x[1],f[1]]:f[0]>x[0]&&f[0]<x[1]?[x[0],f[0],x[1],f[1]]:[f[0],x[0],f[1],x[1]]):f):x.length!==0?(x[0]+=d,x[1]+=d,x):[]}}return[]}function TR(e,t,n,i){let o=n*n,r=t*t,s=e*e,a=-2*t,c=n*e+r-4*i,d=s*i-n*t*e+o,u=ex.computeRealRoots(1,a,c,d);if(u.length>0){let m=u[0],p=t-m,y=p*p,f=e/2,x=p/2,_=y-4*i,C=y+4*Math.abs(i),V=s-4*m,L=s+4*Math.abs(m),Z,G;if(m<0||_*L<V*C){let R=Math.sqrt(V);Z=R/2,G=R===0?0:(e*x-n)/R}else{let R=Math.sqrt(_);Z=R===0?0:(e*x-n)/R,G=R/2}let I,P;f===0&&Z===0?(I=0,P=0):W.sign(f)===W.sign(Z)?(I=f+Z,P=m/I):(P=f-Z,I=m/P);let v,F;x===0&&G===0?(v=0,F=0):W.sign(x)===W.sign(G)?(v=x+G,F=i/v):(F=x-G,v=i/F);let M=Xc.computeRealRoots(1,I,v),b=Xc.computeRealRoots(1,P,F);if(M.length!==0)return b.length!==0?M[1]<=b[0]?[M[0],M[1],b[0],b[1]]:b[1]<=M[0]?[b[0],b[1],M[0],M[1]]:M[0]>=b[0]&&M[1]<=b[1]?[b[0],M[0],M[1],b[1]]:b[0]>=M[0]&&b[1]<=M[1]?[M[0],b[0],b[1],M[1]]:M[0]>b[0]&&M[0]<b[1]?[b[0],M[0],b[1],M[1]]:[M[0],b[0],M[1],b[1]]:M;if(b.length!==0)return b}return[]}nO.computeRealRoots=function(e,t,n,i,o){if(Math.abs(e)<W.EPSILON15)return ex.computeRealRoots(t,n,i,o);let r=t/e,s=n/e,a=i/e,c=o/e,d=r<0?1:0;switch(d+=s<0?d+1:d,d+=a<0?d+1:d,d+=c<0?d+1:d,d){case 0:return gm(r,s,a,c);case 1:return TR(r,s,a,c);case 2:return TR(r,s,a,c);case 3:return gm(r,s,a,c);case 4:return gm(r,s,a,c);case 5:return TR(r,s,a,c);case 6:return gm(r,s,a,c);case 7:return gm(r,s,a,c);case 8:return TR(r,s,a,c);case 9:return gm(r,s,a,c);case 10:return gm(r,s,a,c);case 11:return TR(r,s,a,c);case 12:return gm(r,s,a,c);case 13:return gm(r,s,a,c);case 14:return gm(r,s,a,c);case 15:return gm(r,s,a,c);default:return}};var SR=nO;var $2t=T(S(),1);function FM(e,t){t=h.clone(g(t,h.ZERO)),h.equals(t,h.ZERO)||h.normalize(t,t),this.origin=h.clone(g(e,h.ZERO)),this.direction=t}FM.clone=function(e,t){if(l(e))return l(t)?(t.origin=h.clone(e.origin),t.direction=h.clone(e.direction),t):new FM(e.origin,e.direction)};FM.getPoint=function(e,t,n){return l(n)||(n=new h),n=h.multiplyByScalar(e.direction,t,n),h.add(e.origin,n,n)};var gn=FM;var sr={};sr.rayPlane=function(e,t,n){l(n)||(n=new h);let i=e.origin,o=e.direction,r=t.normal,s=h.dot(r,o);if(Math.abs(s)<W.EPSILON15)return;let a=(-t.distance-h.dot(r,i))/s;if(!(a<0))return n=h.multiplyByScalar(o,a,n),h.add(i,n,n)};var XLe=new h,WLe=new h,Qq=new h,Bq=new h,Oq=new h;sr.rayTriangleParametric=function(e,t,n,i,o){o=g(o,!1);let r=e.origin,s=e.direction,a=h.subtract(n,t,XLe),c=h.subtract(i,t,WLe),d=h.cross(s,c,Qq),u=h.dot(a,d),m,p,y,f,x;if(o){if(u<W.EPSILON6||(m=h.subtract(r,t,Bq),y=h.dot(m,d),y<0||y>u)||(p=h.cross(m,a,Oq),f=h.dot(s,p),f<0||y+f>u))return;x=h.dot(c,p)/u}else{if(Math.abs(u)<W.EPSILON6)return;let _=1/u;if(m=h.subtract(r,t,Bq),y=h.dot(m,d)*_,y<0||y>1||(p=h.cross(m,a,Oq),f=h.dot(s,p)*_,f<0||y+f>1))return;x=h.dot(c,p)*_}return x};sr.rayTriangle=function(e,t,n,i,o,r){let s=sr.rayTriangleParametric(e,t,n,i,o);if(!(!l(s)||s<0))return l(r)||(r=new h),h.multiplyByScalar(e.direction,s,r),h.add(e.origin,r,r)};var PLe=new gn;sr.lineSegmentTriangle=function(e,t,n,i,o,r,s){let a=PLe;h.clone(e,a.origin),h.subtract(t,e,a.direction),h.normalize(a.direction,a.direction);let c=sr.rayTriangleParametric(a,n,i,o,r);if(!(!l(c)||c<0||c>h.distance(e,t)))return l(s)||(s=new h),h.multiplyByScalar(a.direction,c,s),h.add(a.origin,s,s)};function vLe(e,t,n,i){let o=t*t-4*e*n;if(o<0)return;if(o>0){let s=1/(2*e),a=Math.sqrt(o),c=(-t+a)*s,d=(-t-a)*s;return c<d?(i.root0=c,i.root1=d):(i.root0=d,i.root1=c),i}let r=-t/(2*e);if(r!==0)return i.root0=i.root1=r,i}var wLe={root0:0,root1:0};function jq(e,t,n){l(n)||(n=new xa);let i=e.origin,o=e.direction,r=t.center,s=t.radius*t.radius,a=h.subtract(i,r,Qq),c=h.dot(o,o),d=2*h.dot(o,a),u=h.magnitudeSquared(a)-s,m=vLe(c,d,u,wLe);if(l(m))return n.start=m.root0,n.stop=m.root1,n}sr.raySphere=function(e,t,n){if(n=jq(e,t,n),!(!l(n)||n.stop<0))return n.start=Math.max(n.start,0),n};var FLe=new gn;sr.lineSegmentSphere=function(e,t,n,i){let o=FLe;h.clone(e,o.origin);let r=h.subtract(t,e,o.direction),s=h.magnitude(r);if(h.normalize(r,r),i=jq(o,n,i),!(!l(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var ALe=new h,MLe=new h;sr.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=h.multiplyComponents(n,e.origin,ALe),o=h.multiplyComponents(n,e.direction,MLe),r=h.magnitudeSquared(i),s=h.dot(i,o),a,c,d,u,m;if(r>1){if(s>=0)return;let p=s*s;if(a=r-1,c=h.magnitudeSquared(o),d=c*a,p<d)return;if(p>d){u=s*s-d,m=-s+Math.sqrt(u);let f=m/c,x=a/m;return f<x?new xa(f,x):{start:x,stop:f}}let y=Math.sqrt(a/c);return new xa(y,y)}else if(r<1)return a=r-1,c=h.magnitudeSquared(o),d=c*a,u=s*s-d,m=-s+Math.sqrt(u),new xa(0,m/c);if(s<0)return c=h.magnitudeSquared(o),new xa(0,-s/c)};function tx(e,t,n){let i=e+t;return W.sign(e)!==W.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}function NLe(e,t,n,i,o){let r=i*i,s=o*o,a=(e[q.COLUMN1ROW1]-e[q.COLUMN2ROW2])*s,c=o*(i*tx(e[q.COLUMN1ROW0],e[q.COLUMN0ROW1],W.EPSILON15)+t.y),d=e[q.COLUMN0ROW0]*r+e[q.COLUMN2ROW2]*s+i*t.x+n,u=s*tx(e[q.COLUMN2ROW1],e[q.COLUMN1ROW2],W.EPSILON15),m=o*(i*tx(e[q.COLUMN2ROW0],e[q.COLUMN0ROW2])+t.z),p,y=[];if(m===0&&u===0){if(p=Xc.computeRealRoots(a,c,d),p.length===0)return y;let v=p[0],F=Math.sqrt(Math.max(1-v*v,0));if(y.push(new h(i,o*v,o*-F)),y.push(new h(i,o*v,o*F)),p.length===2){let M=p[1],b=Math.sqrt(Math.max(1-M*M,0));y.push(new h(i,o*M,o*-b)),y.push(new h(i,o*M,o*b))}return y}let f=m*m,x=u*u,_=a*a,C=m*u,V=_+x,L=2*(c*a+C),Z=2*d*a+c*c-x+f,G=2*(d*c-C),I=d*d-f;if(V===0&&L===0&&Z===0&&G===0)return y;p=SR.computeRealRoots(V,L,Z,G,I);let P=p.length;if(P===0)return y;for(let v=0;v<P;++v){let F=p[v],M=F*F,b=Math.max(1-M,0),R=Math.sqrt(b),E;W.sign(a)===W.sign(d)?E=tx(a*M+d,c*F,W.EPSILON12):W.sign(d)===W.sign(c*F)?E=tx(a*M,c*F+d,W.EPSILON12):E=tx(a*M+c*F,d,W.EPSILON12);let X=tx(u*F,m,W.EPSILON15),w=E*X;w<0?y.push(new h(i,o*F,o*R)):w>0?y.push(new h(i,o*F,o*-R)):R!==0?(y.push(new h(i,o*F,o*-R)),y.push(new h(i,o*F,o*R)),++v):y.push(new h(i,o*F,o*R))}return y}var iO=new h,Yq=new h,Hq=new h,AM=new h,ULe=new h,kLe=new q,DLe=new q,BLe=new q,OLe=new q,YLe=new q,Kq=new q,zq=new q,Jq=new h,HLe=new h,KLe=new he;sr.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!h.equals(n,h.ZERO)){let I=t.geodeticSurfaceNormal(n,iO);if(h.dot(i,I)>=0)return n}let o=l(this.rayEllipsoid(e,t)),r=t.transformPositionToScaledSpace(i,iO),s=h.normalize(r,r),a=h.mostOrthogonalAxis(r,AM),c=h.normalize(h.cross(a,s,Yq),Yq),d=h.normalize(h.cross(s,c,Hq),Hq),u=kLe;u[0]=s.x,u[1]=s.y,u[2]=s.z,u[3]=c.x,u[4]=c.y,u[5]=c.z,u[6]=d.x,u[7]=d.y,u[8]=d.z;let m=q.transpose(u,DLe),p=q.fromScale(t.radii,BLe),y=q.fromScale(t.oneOverRadii,OLe),f=YLe;f[0]=0,f[1]=-i.z,f[2]=i.y,f[3]=i.z,f[4]=0,f[5]=-i.x,f[6]=-i.y,f[7]=i.x,f[8]=0;let x=q.multiply(q.multiply(m,y,Kq),f,Kq),_=q.multiply(q.multiply(x,p,zq),u,zq),C=q.multiplyByVector(x,n,ULe),V=NLe(_,h.negate(C,iO),0,0,1),L,Z,G=V.length;if(G>0){let I=h.clone(h.ZERO,HLe),P=Number.NEGATIVE_INFINITY;for(let F=0;F<G;++F){L=q.multiplyByVector(p,q.multiplyByVector(u,V[F],Jq),Jq);let M=h.normalize(h.subtract(L,n,AM),AM),b=h.dot(M,i);b>P&&(P=b,I=h.clone(L,I))}let v=t.cartesianToCartographic(I,KLe);return P=W.clamp(P,0,1),Z=h.magnitude(h.subtract(I,n,AM))*Math.sqrt(1-P*P),Z=o?-Z:Z,v.height=Z,t.cartographicToCartesian(v,new h)}};var zLe=new h;sr.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new h);let o=h.subtract(t,e,zLe),r=n.normal,s=h.dot(r,o);if(Math.abs(s)<W.EPSILON6)return;let a=h.dot(r,e),c=-(n.distance+a)/s;if(!(c<0||c>1))return h.multiplyByScalar(o,c,i),h.add(e,i,i),i};sr.trianglePlaneIntersection=function(e,t,n,i){let o=i.normal,r=i.distance,s=h.dot(o,e)+r<0,a=h.dot(o,t)+r<0,c=h.dot(o,n)+r<0,d=0;d+=s?1:0,d+=a?1:0,d+=c?1:0;let u,m;if((d===1||d===2)&&(u=new h,m=new h),d===1){if(s)return sr.lineSegmentPlane(e,t,i,u),sr.lineSegmentPlane(e,n,i,m),{positions:[e,t,n,u,m],indices:[0,3,4,1,2,4,1,4,3]};if(a)return sr.lineSegmentPlane(t,n,i,u),sr.lineSegmentPlane(t,e,i,m),{positions:[e,t,n,u,m],indices:[1,3,4,2,0,4,2,4,3]};if(c)return sr.lineSegmentPlane(n,e,i,u),sr.lineSegmentPlane(n,t,i,m),{positions:[e,t,n,u,m],indices:[2,3,4,0,1,4,0,4,3]}}else if(d===2)if(s)if(a){if(!c)return sr.lineSegmentPlane(e,n,i,u),sr.lineSegmentPlane(t,n,i,m),{positions:[e,t,n,u,m],indices:[0,1,4,0,4,3,2,3,4]}}else return sr.lineSegmentPlane(n,t,i,u),sr.lineSegmentPlane(e,t,i,m),{positions:[e,t,n,u,m],indices:[2,0,4,2,4,3,1,3,4]};else return sr.lineSegmentPlane(t,e,i,u),sr.lineSegmentPlane(n,e,i,m),{positions:[e,t,n,u,m],indices:[1,2,4,1,4,3,0,3,4]}};var ni=sr;var yPt=T(S(),1);function Xs(e,t){this.normal=h.clone(e),this.distance=t}Xs.fromPointNormal=function(e,t,n){let i=-h.dot(t,e);return l(n)?(h.clone(t,n.normal),n.distance=i,n):new Xs(t,i)};var JLe=new h;Xs.fromCartesian4=function(e,t){let n=h.fromCartesian4(e,JLe),i=e.w;return l(t)?(h.clone(n,t.normal),t.distance=i,t):new Xs(n,i)};Xs.getPointDistance=function(e,t){return h.dot(e.normal,t)+e.distance};var QLe=new h;Xs.projectPointOntoPlane=function(e,t,n){l(n)||(n=new h);let i=Xs.getPointDistance(e,t),o=h.multiplyByScalar(e.normal,i,QLe);return h.subtract(t,o,n)};var jLe=new A,qLe=new se,$Le=new h;Xs.transform=function(e,t,n){let i=e.normal,o=e.distance,r=A.inverseTranspose(t,jLe),s=se.fromElements(i.x,i.y,i.z,o,qLe);s=A.multiplyByVector(r,s,s);let a=h.fromCartesian4(s,$Le);return s=se.divideByScalar(s,h.magnitude(a),s),Xs.fromCartesian4(s,n)};Xs.clone=function(e,t){return l(t)?(h.clone(e.normal,t.normal),t.distance=e.distance,t):new Xs(e.normal,e.distance)};Xs.equals=function(e,t){return e.distance===t.distance&&h.equals(e.normal,t.normal)};Xs.ORIGIN_XY_PLANE=Object.freeze(new Xs(h.UNIT_Z,0));Xs.ORIGIN_YZ_PLANE=Object.freeze(new Xs(h.UNIT_X,0));Xs.ORIGIN_ZX_PLANE=Object.freeze(new Xs(h.UNIT_Y,0));var ln=Xs;var oO=new se;function Yh(e,t){t=g(t,oe.WGS84),e=t.scaleToGeodeticSurface(e);let n=Xt.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=h.fromCartesian4(A.getColumn(n,0,oO)),this._yAxis=h.fromCartesian4(A.getColumn(n,1,oO));let i=h.fromCartesian4(A.getColumn(n,2,oO));this._plane=ln.fromPointNormal(e,i)}Object.defineProperties(Yh.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 eRe=new Tb;Yh.fromPoints=function(e,t){let n=Tb.fromPoints(e,eRe);return new Yh(n.center,t)};var qq=new gn,MM=new h;Yh.prototype.projectPointOntoPlane=function(e,t){let n=qq;n.origin=e,h.normalize(e,n.direction);let i=ni.rayPlane(n,this._plane,MM);if(l(i)||(h.negate(n.direction,n.direction),i=ni.rayPlane(n,this._plane,MM)),l(i)){let o=h.subtract(i,this._origin,i),r=h.dot(this._xAxis,o),s=h.dot(this._yAxis,o);return l(t)?(t.x=r,t.y=s,t):new B(r,s)}};Yh.prototype.projectPointsOntoPlane=function(e,t){l(t)||(t=[]);let n=0,i=e.length;for(let o=0;o<i;o++){let r=this.projectPointOntoPlane(e[o],t[n]);l(r)&&(t[n]=r,n++)}return t.length=n,t};Yh.prototype.projectPointToNearestOnPlane=function(e,t){l(t)||(t=new B);let n=qq;n.origin=e,h.clone(this._plane.normal,n.direction);let i=ni.rayPlane(n,this._plane,MM);l(i)||(h.negate(n.direction,n.direction),i=ni.rayPlane(n,this._plane,MM));let o=h.subtract(i,this._origin,i),r=h.dot(this._xAxis,o),s=h.dot(this._yAxis,o);return t.x=r,t.y=s,t};Yh.prototype.projectPointsToNearestOnPlane=function(e,t){l(t)||(t=[]);let n=e.length;t.length=n;for(let i=0;i<n;i++)t[i]=this.projectPointToNearestOnPlane(e[i],t[i]);return t};var tRe=new h;Yh.prototype.projectPointOntoEllipsoid=function(e,t){l(t)||(t=new h);let n=this._ellipsoid,i=this._origin,o=this._xAxis,r=this._yAxis,s=tRe;return h.multiplyByScalar(o,e.x,s),t=h.add(i,s,t),h.multiplyByScalar(r,e.y,s),h.add(t,s,t),n.scaleToGeocentricSurface(t,t),t};Yh.prototype.projectPointsOntoEllipsoid=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.projectPointOntoEllipsoid(e[i],t[i]);return t};var kr=Yh;function Fi(e,t){this.center=h.clone(g(e,h.ZERO)),this.halfAxes=q.clone(g(t,q.ZERO))}Fi.packedLength=h.packedLength+q.packedLength;Fi.pack=function(e,t,n){return n=g(n,0),h.pack(e.center,t,n),q.pack(e.halfAxes,t,n+h.packedLength),t};Fi.unpack=function(e,t,n){return t=g(t,0),l(n)||(n=new Fi),h.unpack(e,t,n.center),q.unpack(e,t+h.packedLength,n.halfAxes),n};var nRe=new h,iRe=new h,oRe=new h,rRe=new h,sRe=new h,aRe=new h,cRe=new q,lRe={unitary:new q,diagonal:new q};Fi.fromPoints=function(e,t){if(l(t)||(t=new Fi),!l(e)||e.length===0)return t.halfAxes=q.ZERO,t.center=h.ZERO,t;let n,i=e.length,o=h.clone(e[0],nRe);for(n=1;n<i;n++)h.add(o,e[n],o);let r=1/i;h.multiplyByScalar(o,r,o);let s=0,a=0,c=0,d=0,u=0,m=0,p;for(n=0;n<i;n++)p=h.subtract(e[n],o,iRe),s+=p.x*p.x,a+=p.x*p.y,c+=p.x*p.z,d+=p.y*p.y,u+=p.y*p.z,m+=p.z*p.z;s*=r,a*=r,c*=r,d*=r,u*=r,m*=r;let y=cRe;y[0]=s,y[1]=a,y[2]=c,y[3]=a,y[4]=d,y[5]=u,y[6]=c,y[7]=u,y[8]=m;let f=q.computeEigenDecomposition(y,lRe),x=q.clone(f.unitary,t.halfAxes),_=q.getColumn(x,0,rRe),C=q.getColumn(x,1,sRe),V=q.getColumn(x,2,aRe),L=-Number.MAX_VALUE,Z=-Number.MAX_VALUE,G=-Number.MAX_VALUE,I=Number.MAX_VALUE,P=Number.MAX_VALUE,v=Number.MAX_VALUE;for(n=0;n<i;n++)p=e[n],L=Math.max(h.dot(_,p),L),Z=Math.max(h.dot(C,p),Z),G=Math.max(h.dot(V,p),G),I=Math.min(h.dot(_,p),I),P=Math.min(h.dot(C,p),P),v=Math.min(h.dot(V,p),v);_=h.multiplyByScalar(_,.5*(I+L),_),C=h.multiplyByScalar(C,.5*(P+Z),C),V=h.multiplyByScalar(V,.5*(v+G),V);let F=h.add(_,C,t.center);h.add(F,V,F);let M=oRe;return M.x=L-I,M.y=Z-P,M.z=G-v,h.multiplyByScalar(M,.5,M),q.multiplyByScale(t.halfAxes,M,t.halfAxes),t};var o$=new h,dRe=new h;function $q(e,t,n,i,o,r,s,a,c,d,u){l(u)||(u=new Fi);let m=u.halfAxes;q.setColumn(m,0,t,m),q.setColumn(m,1,n,m),q.setColumn(m,2,i,m);let p=o$;p.x=(o+r)/2,p.y=(s+a)/2,p.z=(c+d)/2;let y=dRe;y.x=(r-o)/2,y.y=(a-s)/2,y.z=(d-c)/2;let f=u.center;return p=q.multiplyByVector(m,p,p),h.add(e,p,f),q.multiplyByScale(m,y,m),u}var e$=new he,uRe=new h,mRe=new he,hRe=new he,fRe=new he,pRe=new he,bRe=new he,yRe=new h,t$=new h,gRe=new h,n$=new h,xRe=new h,_Re=new B,TRe=new B,SRe=new B,CRe=new B,VRe=new B,LRe=new h,RRe=new h,ZRe=new h,GRe=new h,ERe=new B,IRe=new h,XRe=new h,WRe=new h,PRe=new ln(h.UNIT_X,0);Fi.fromRectangle=function(e,t,n,i,o){t=g(t,0),n=g(n,0),i=g(i,oe.WGS84);let r,s,a,c,d,u,m;if(e.width<=W.PI){let P=de.center(e,e$),v=i.cartographicToCartesian(P,uRe),F=new kr(v,i);m=F.plane;let M=P.longitude,b=e.south<0&&e.north>0?0:P.latitude,R=he.fromRadians(M,e.north,n,mRe),E=he.fromRadians(e.west,e.north,n,hRe),X=he.fromRadians(e.west,b,n,fRe),w=he.fromRadians(e.west,e.south,n,pRe),N=he.fromRadians(M,e.south,n,bRe),D=i.cartographicToCartesian(R,yRe),k=i.cartographicToCartesian(E,t$),Y=i.cartographicToCartesian(X,gRe),U=i.cartographicToCartesian(w,n$),J=i.cartographicToCartesian(N,xRe),K=F.projectPointToNearestOnPlane(D,_Re),ee=F.projectPointToNearestOnPlane(k,TRe),H=F.projectPointToNearestOnPlane(Y,SRe),j=F.projectPointToNearestOnPlane(U,CRe),$=F.projectPointToNearestOnPlane(J,VRe);return r=Math.min(ee.x,H.x,j.x),s=-r,c=Math.max(ee.y,K.y),a=Math.min(j.y,$.y),E.height=w.height=t,k=i.cartographicToCartesian(E,t$),U=i.cartographicToCartesian(w,n$),d=Math.min(ln.getPointDistance(m,k),ln.getPointDistance(m,U)),u=n,$q(F.origin,F.xAxis,F.yAxis,F.zAxis,r,s,a,c,d,u,o)}let p=e.south>0,y=e.north<0,f=p?e.south:y?e.north:0,x=de.center(e,e$).longitude,_=h.fromRadians(x,f,n,i,LRe);_.z=0;let V=Math.abs(_.x)<W.EPSILON10&&Math.abs(_.y)<W.EPSILON10?h.UNIT_X:h.normalize(_,RRe),L=h.UNIT_Z,Z=h.cross(V,L,ZRe);m=ln.fromPointNormal(_,V,PRe);let G=h.fromRadians(x+W.PI_OVER_TWO,f,n,i,GRe);s=h.dot(ln.projectPointOntoPlane(m,G,ERe),Z),r=-s,c=h.fromRadians(0,e.north,y?t:n,i,IRe).z,a=h.fromRadians(0,e.south,p?t:n,i,XRe).z;let I=h.fromRadians(e.east,f,n,i,WRe);return d=ln.getPointDistance(m,I),u=0,$q(_,Z,L,V,r,s,a,c,d,u,o)};Fi.fromTransformation=function(e,t){return l(t)||(t=new Fi),t.center=A.getTranslation(e,t.center),t.halfAxes=A.getMatrix3(e,t.halfAxes),t.halfAxes=q.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t};Fi.clone=function(e,t){if(l(e))return l(t)?(h.clone(e.center,t.center),q.clone(e.halfAxes,t.halfAxes),t):new Fi(e.center,e.halfAxes)};Fi.intersectPlane=function(e,t){let n=e.center,i=t.normal,o=e.halfAxes,r=i.x,s=i.y,a=i.z,c=Math.abs(r*o[q.COLUMN0ROW0]+s*o[q.COLUMN0ROW1]+a*o[q.COLUMN0ROW2])+Math.abs(r*o[q.COLUMN1ROW0]+s*o[q.COLUMN1ROW1]+a*o[q.COLUMN1ROW2])+Math.abs(r*o[q.COLUMN2ROW0]+s*o[q.COLUMN2ROW1]+a*o[q.COLUMN2ROW2]),d=h.dot(i,n)+t.distance;return d<=-c?nn.OUTSIDE:d>=c?nn.INSIDE:nn.INTERSECTING};var r$=new h,s$=new h,a$=new h,vRe=new h,i$=new h,wRe=new h;Fi.distanceSquaredTo=function(e,t){let n=h.subtract(t,e.center,o$),i=e.halfAxes,o=q.getColumn(i,0,r$),r=q.getColumn(i,1,s$),s=q.getColumn(i,2,a$),a=h.magnitude(o),c=h.magnitude(r),d=h.magnitude(s),u=!0,m=!0,p=!0;a>0?h.divideByScalar(o,a,o):u=!1,c>0?h.divideByScalar(r,c,r):m=!1,d>0?h.divideByScalar(s,d,s):p=!1;let y=!u+!m+!p,f,x,_;if(y===1){let Z=o;f=r,x=s,m?p||(Z=s,x=o):(Z=r,f=o),_=h.cross(f,x,i$),Z===o?o=_:Z===r?r=_:Z===s&&(s=_)}else if(y===2){f=o,m?f=r:p&&(f=s);let Z=h.UNIT_Y;Z.equalsEpsilon(f,W.EPSILON3)&&(Z=h.UNIT_X),x=h.cross(f,Z,vRe),h.normalize(x,x),_=h.cross(f,x,i$),h.normalize(_,_),f===o?(r=x,s=_):f===r?(s=x,o=_):f===s&&(o=x,r=_)}else y===3&&(o=h.UNIT_X,r=h.UNIT_Y,s=h.UNIT_Z);let C=wRe;C.x=h.dot(n,o),C.y=h.dot(n,r),C.z=h.dot(n,s);let V=0,L;return C.x<-a?(L=C.x+a,V+=L*L):C.x>a&&(L=C.x-a,V+=L*L),C.y<-c?(L=C.y+c,V+=L*L):C.y>c&&(L=C.y-c,V+=L*L),C.z<-d?(L=C.z+d,V+=L*L):C.z>d&&(L=C.z-d,V+=L*L),V};var FRe=new h,ARe=new h;Fi.computePlaneDistances=function(e,t,n,i){l(i)||(i=new xa);let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,c=q.getColumn(a,0,r$),d=q.getColumn(a,1,s$),u=q.getColumn(a,2,a$),m=h.add(c,d,FRe);h.add(m,u,m),h.add(m,s,m);let p=h.subtract(m,t,ARe),y=h.dot(n,p);return o=Math.min(y,o),r=Math.max(y,r),h.add(s,c,m),h.add(m,d,m),h.subtract(m,u,m),h.subtract(m,t,p),y=h.dot(n,p),o=Math.min(y,o),r=Math.max(y,r),h.add(s,c,m),h.subtract(m,d,m),h.add(m,u,m),h.subtract(m,t,p),y=h.dot(n,p),o=Math.min(y,o),r=Math.max(y,r),h.add(s,c,m),h.subtract(m,d,m),h.subtract(m,u,m),h.subtract(m,t,p),y=h.dot(n,p),o=Math.min(y,o),r=Math.max(y,r),h.subtract(s,c,m),h.add(m,d,m),h.add(m,u,m),h.subtract(m,t,p),y=h.dot(n,p),o=Math.min(y,o),r=Math.max(y,r),h.subtract(s,c,m),h.add(m,d,m),h.subtract(m,u,m),h.subtract(m,t,p),y=h.dot(n,p),o=Math.min(y,o),r=Math.max(y,r),h.subtract(s,c,m),h.subtract(m,d,m),h.add(m,u,m),h.subtract(m,t,p),y=h.dot(n,p),o=Math.min(y,o),r=Math.max(y,r),h.subtract(s,c,m),h.subtract(m,d,m),h.subtract(m,u,m),h.subtract(m,t,p),y=h.dot(n,p),o=Math.min(y,o),r=Math.max(y,r),i.start=o,i.stop=r,i};var MRe=new h,NRe=new h,URe=new h;Fi.computeCorners=function(e,t){l(t)||(t=[new h,new h,new h,new h,new h,new h,new h,new h]);let n=e.center,i=e.halfAxes,o=q.getColumn(i,0,MRe),r=q.getColumn(i,1,NRe),s=q.getColumn(i,2,URe);return h.clone(n,t[0]),h.subtract(t[0],o,t[0]),h.subtract(t[0],r,t[0]),h.subtract(t[0],s,t[0]),h.clone(n,t[1]),h.subtract(t[1],o,t[1]),h.subtract(t[1],r,t[1]),h.add(t[1],s,t[1]),h.clone(n,t[2]),h.subtract(t[2],o,t[2]),h.add(t[2],r,t[2]),h.subtract(t[2],s,t[2]),h.clone(n,t[3]),h.subtract(t[3],o,t[3]),h.add(t[3],r,t[3]),h.add(t[3],s,t[3]),h.clone(n,t[4]),h.add(t[4],o,t[4]),h.subtract(t[4],r,t[4]),h.subtract(t[4],s,t[4]),h.clone(n,t[5]),h.add(t[5],o,t[5]),h.subtract(t[5],r,t[5]),h.add(t[5],s,t[5]),h.clone(n,t[6]),h.add(t[6],o,t[6]),h.add(t[6],r,t[6]),h.subtract(t[6],s,t[6]),h.clone(n,t[7]),h.add(t[7],o,t[7]),h.add(t[7],r,t[7]),h.add(t[7],s,t[7]),t};var kRe=new q;Fi.computeTransformation=function(e,t){l(t)||(t=new A);let n=e.center,i=q.multiplyByUniformScale(e.halfAxes,2,kRe);return A.fromRotationTranslation(i,n,t)};var DRe=new ce;Fi.isOccluded=function(e,t){let n=ce.fromOrientedBoundingBox(e,DRe);return!t.isBoundingSphereVisible(n)};Fi.prototype.intersectPlane=function(e){return Fi.intersectPlane(this,e)};Fi.prototype.distanceSquaredTo=function(e){return Fi.distanceSquaredTo(this,e)};Fi.prototype.computePlaneDistances=function(e,t,n){return Fi.computePlaneDistances(this,e,t,n)};Fi.prototype.computeCorners=function(e){return Fi.computeCorners(this,e)};Fi.prototype.computeTransformation=function(e){return Fi.computeTransformation(this,e)};Fi.prototype.isOccluded=function(e){return Fi.isOccluded(this,e)};Fi.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&q.equals(e.halfAxes,t.halfAxes)};Fi.prototype.clone=function(e){return Fi.clone(this,e)};Fi.prototype.equals=function(e){return Fi.equals(this,e)};var Xn=Fi;var qPt=T(S(),1);var NM={};NM.getHeight=function(e,t,n){return(e-n)*t+n};var BRe=new h;NM.getPosition=function(e,t,n,i,o){let r=t.cartesianToCartographic(e,BRe);if(!l(r))return h.clone(e,o);let s=NM.getHeight(r.height,n,i);return h.fromRadians(r.longitude,r.latitude,s,t,o)};var Dr=NM;var fOt=T(S(),1);var ivt=T(S(),1);var yr={CULL:1,OCCLUDE:2,EXECUTE_IN_CLOSEST_FRUSTUM:4,DEBUG_SHOW_BOUNDING_VOLUME:8,CAST_SHADOWS:16,RECEIVE_SHADOWS:32,PICK_ONLY:64,DEPTH_FOR_TRANSLUCENT_CLASSIFICATION:128};function CR(e){e=g(e,g.EMPTY_OBJECT),this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._modelMatrix=e.modelMatrix,this._primitiveType=g(e.primitiveType,Ae.TRIANGLES),this._vertexArray=e.vertexArray,this._count=e.count,this._offset=g(e.offset,0),this._instanceCount=g(e.instanceCount,0),this._shaderProgram=e.shaderProgram,this._uniformMap=e.uniformMap,this._renderState=e.renderState,this._framebuffer=e.framebuffer,this._pass=e.pass,this._owner=e.owner,this._debugOverlappingFrustums=0,this._pickId=e.pickId,this._flags=0,this.cull=g(e.cull,!0),this.occlude=g(e.occlude,!0),this.executeInClosestFrustum=g(e.executeInClosestFrustum,!1),this.debugShowBoundingVolume=g(e.debugShowBoundingVolume,!1),this.castShadows=g(e.castShadows,!1),this.receiveShadows=g(e.receiveShadows,!1),this.pickOnly=g(e.pickOnly,!1),this.depthForTranslucentClassification=g(e.depthForTranslucentClassification,!1),this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}function Qa(e,t){return(e._flags&t)===t}function Sb(e,t,n){n?e._flags|=t:e._flags&=~t}Object.defineProperties(CR.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 Qa(this,yr.CULL)},set:function(e){Qa(this,yr.CULL)!==e&&(Sb(this,yr.CULL,e),this.dirty=!0)}},occlude:{get:function(){return Qa(this,yr.OCCLUDE)},set:function(e){Qa(this,yr.OCCLUDE)!==e&&(Sb(this,yr.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 Qa(this,yr.CAST_SHADOWS)},set:function(e){Qa(this,yr.CAST_SHADOWS)!==e&&(Sb(this,yr.CAST_SHADOWS,e),this.dirty=!0)}},receiveShadows:{get:function(){return Qa(this,yr.RECEIVE_SHADOWS)},set:function(e){Qa(this,yr.RECEIVE_SHADOWS)!==e&&(Sb(this,yr.RECEIVE_SHADOWS,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 Qa(this,yr.EXECUTE_IN_CLOSEST_FRUSTUM)},set:function(e){Qa(this,yr.EXECUTE_IN_CLOSEST_FRUSTUM)!==e&&(Sb(this,yr.EXECUTE_IN_CLOSEST_FRUSTUM,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 Qa(this,yr.DEBUG_SHOW_BOUNDING_VOLUME)},set:function(e){Qa(this,yr.DEBUG_SHOW_BOUNDING_VOLUME)!==e&&(Sb(this,yr.DEBUG_SHOW_BOUNDING_VOLUME,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 Qa(this,yr.PICK_ONLY)},set:function(e){Qa(this,yr.PICK_ONLY)!==e&&(Sb(this,yr.PICK_ONLY,e),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return Qa(this,yr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)},set:function(e){Qa(this,yr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==e&&(Sb(this,yr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,e),this.dirty=!0)}}});CR.shallowClone=function(e,t){if(l(e))return l(t)||(t=new CR),t._boundingVolume=e._boundingVolume,t._orientedBoundingBox=e._orientedBoundingBox,t._modelMatrix=e._modelMatrix,t._primitiveType=e._primitiveType,t._vertexArray=e._vertexArray,t._count=e._count,t._offset=e._offset,t._instanceCount=e._instanceCount,t._shaderProgram=e._shaderProgram,t._uniformMap=e._uniformMap,t._renderState=e._renderState,t._framebuffer=e._framebuffer,t._pass=e._pass,t._owner=e._owner,t._debugOverlappingFrustums=e._debugOverlappingFrustums,t._pickId=e._pickId,t._flags=e._flags,t.dirty=!0,t.lastDirtyTime=0,t};CR.prototype.execute=function(e,t){e.draw(this,t)};var nt=CR;var rvt=T(S(),1),ORe={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,VOXELS:9,OVERLAY:10,NUMBER_OF_PASSES:11},Ve=Object.freeze(ORe);var gvt=T(S(),1);var cvt=T(S(),1);var UM={CLOCKWISE:ne.CW,COUNTER_CLOCKWISE:ne.CCW};UM.validate=function(e){return e===UM.CLOCKWISE||e===UM.COUNTER_CLOCKWISE};var ss=Object.freeze(UM);var dvt=T(S(),1);function c$(e){if(typeof e!="object"||e===null)return e;let t,n=Object.keys(e);for(let i=0;i<n.length;i++)t=n[i],e.hasOwnProperty(t)&&t!=="_applyFunctions"&&(e[t]=c$(e[t]));return Object.freeze(e)}var rO=c$;function Kh(e){let t=g(e,g.EMPTY_OBJECT),n=g(t.cull,g.EMPTY_OBJECT),i=g(t.polygonOffset,g.EMPTY_OBJECT),o=g(t.scissorTest,g.EMPTY_OBJECT),r=g(o.rectangle,g.EMPTY_OBJECT),s=g(t.depthRange,g.EMPTY_OBJECT),a=g(t.depthTest,g.EMPTY_OBJECT),c=g(t.colorMask,g.EMPTY_OBJECT),d=g(t.blending,g.EMPTY_OBJECT),u=g(d.color,g.EMPTY_OBJECT),m=g(t.stencilTest,g.EMPTY_OBJECT),p=g(m.frontOperation,g.EMPTY_OBJECT),y=g(m.backOperation,g.EMPTY_OBJECT),f=g(t.sampleCoverage,g.EMPTY_OBJECT),x=t.viewport;this.frontFace=g(t.frontFace,ss.COUNTER_CLOCKWISE),this.cull={enabled:g(n.enabled,!1),face:g(n.face,ne.BACK)},this.lineWidth=g(t.lineWidth,1),this.polygonOffset={enabled:g(i.enabled,!1),factor:g(i.factor,0),units:g(i.units,0)},this.scissorTest={enabled:g(o.enabled,!1),rectangle:De.clone(r)},this.depthRange={near:g(s.near,0),far:g(s.far,1)},this.depthTest={enabled:g(a.enabled,!1),func:g(a.func,ne.LESS)},this.colorMask={red:g(c.red,!0),green:g(c.green,!0),blue:g(c.blue,!0),alpha:g(c.alpha,!0)},this.depthMask=g(t.depthMask,!0),this.stencilMask=g(t.stencilMask,-1),this.blending={enabled:g(d.enabled,!1),color:new O(g(u.red,0),g(u.green,0),g(u.blue,0),g(u.alpha,0)),equationRgb:g(d.equationRgb,ne.FUNC_ADD),equationAlpha:g(d.equationAlpha,ne.FUNC_ADD),functionSourceRgb:g(d.functionSourceRgb,ne.ONE),functionSourceAlpha:g(d.functionSourceAlpha,ne.ONE),functionDestinationRgb:g(d.functionDestinationRgb,ne.ZERO),functionDestinationAlpha:g(d.functionDestinationAlpha,ne.ZERO)},this.stencilTest={enabled:g(m.enabled,!1),frontFunction:g(m.frontFunction,ne.ALWAYS),backFunction:g(m.backFunction,ne.ALWAYS),reference:g(m.reference,0),mask:g(m.mask,-1),frontOperation:{fail:g(p.fail,ne.KEEP),zFail:g(p.zFail,ne.KEEP),zPass:g(p.zPass,ne.KEEP)},backOperation:{fail:g(y.fail,ne.KEEP),zFail:g(y.zFail,ne.KEEP),zPass:g(y.zPass,ne.KEEP)}},this.sampleCoverage={enabled:g(f.enabled,!1),value:g(f.value,1),invert:g(f.invert,!1)},this.viewport=l(x)?new De(x.x,x.y,x.width,x.height):void 0,this.id=0,this._applyFunctions=[]}var YRe=0,Hh={};Kh.fromCache=function(e){let t=JSON.stringify(e),n=Hh[t];if(l(n))return++n.referenceCount,n.state;let i=new Kh(e),o=JSON.stringify(i);return n=Hh[o],l(n)||(i.id=YRe++,n={referenceCount:0,state:i},Hh[o]=n),++n.referenceCount,Hh[t]={referenceCount:1,state:n.state},n.state};Kh.removeFromCache=function(e){let t=new Kh(e),n=JSON.stringify(t),i=Hh[n],o=JSON.stringify(e),r=Hh[o];l(r)&&(--r.referenceCount,r.referenceCount===0&&(delete Hh[o],l(i)&&--i.referenceCount)),l(i)&&i.referenceCount===0&&delete Hh[n]};Kh.getCache=function(){return Hh};Kh.clearCache=function(){Hh={}};function nx(e,t,n){n?e.enable(t):e.disable(t)}function l$(e,t){e.frontFace(t.frontFace)}function d$(e,t){let n=t.cull,i=n.enabled;nx(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function u$(e,t){e.lineWidth(t.lineWidth)}function m$(e,t){let n=t.polygonOffset,i=n.enabled;nx(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function h$(e,t,n){let i=t.scissorTest,o=l(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(nx(e,e.SCISSOR_TEST,o),o){let r=l(n.scissorTest)?n.scissorTest.rectangle:i.rectangle;e.scissor(r.x,r.y,r.width,r.height)}}function f$(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function p$(e,t){let n=t.depthTest,i=n.enabled;nx(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function b$(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function y$(e,t){e.depthMask(t.depthMask)}function g$(e,t){e.stencilMask(t.stencilMask)}function HRe(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function x$(e,t,n){let i=t.blending,o=l(n.blendingEnabled)?n.blendingEnabled:i.enabled;nx(e,e.BLEND,o),o&&(HRe(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function _$(e,t){let n=t.stencilTest,i=n.enabled;if(nx(e,e.STENCIL_TEST,i),i){let o=n.frontFunction,r=n.backFunction,s=n.reference,a=n.mask;e.stencilFunc(o,s,a),e.stencilFuncSeparate(e.BACK,r,s,a),e.stencilFuncSeparate(e.FRONT,o,s,a);let c=n.frontOperation,d=c.fail,u=c.zFail,m=c.zPass;e.stencilOpSeparate(e.FRONT,d,u,m);let p=n.backOperation,y=p.fail,f=p.zFail,x=p.zPass;e.stencilOpSeparate(e.BACK,y,f,x)}}function T$(e,t){let n=t.sampleCoverage,i=n.enabled;nx(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}var KRe=new De;function S$(e,t,n){let i=g(t.viewport,n.viewport);l(i)||(i=KRe,i.width=n.context.drawingBufferWidth,i.height=n.context.drawingBufferHeight),n.context.uniformState.viewport=i,e.viewport(i.x,i.y,i.width,i.height)}Kh.apply=function(e,t,n){l$(e,t),d$(e,t),u$(e,t),m$(e,t),f$(e,t),p$(e,t),b$(e,t),y$(e,t),g$(e,t),_$(e,t),T$(e,t),h$(e,t,n),x$(e,t,n),S$(e,t,n)};function zRe(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(l$),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(d$),e.lineWidth!==t.lineWidth&&n.push(u$),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(m$),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(f$),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(p$),(e.colorMask.red!==t.colorMask.red||e.colorMask.green!==t.colorMask.green||e.colorMask.blue!==t.colorMask.blue||e.colorMask.alpha!==t.colorMask.alpha)&&n.push(b$),e.depthMask!==t.depthMask&&n.push(y$),e.stencilMask!==t.stencilMask&&n.push(g$),(e.stencilTest.enabled!==t.stencilTest.enabled||e.stencilTest.frontFunction!==t.stencilTest.frontFunction||e.stencilTest.backFunction!==t.stencilTest.backFunction||e.stencilTest.reference!==t.stencilTest.reference||e.stencilTest.mask!==t.stencilTest.mask||e.stencilTest.frontOperation.fail!==t.stencilTest.frontOperation.fail||e.stencilTest.frontOperation.zFail!==t.stencilTest.frontOperation.zFail||e.stencilTest.backOperation.fail!==t.stencilTest.backOperation.fail||e.stencilTest.backOperation.zFail!==t.stencilTest.backOperation.zFail||e.stencilTest.backOperation.zPass!==t.stencilTest.backOperation.zPass)&&n.push(_$),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(T$),n}Kh.partialApply=function(e,t,n,i,o,r){if(t!==n){let u=n._applyFunctions[t.id];l(u)||(u=zRe(t,n),n._applyFunctions[t.id]=u);let m=u.length;for(let p=0;p<m;++p)u[p](e,n)}let s=l(i.scissorTest)?i.scissorTest:t.scissorTest,a=l(o.scissorTest)?o.scissorTest:n.scissorTest;(s!==a||r)&&h$(e,n,o);let c=l(i.blendingEnabled)?i.blendingEnabled:t.blending.enabled,d=l(o.blendingEnabled)?o.blendingEnabled:n.blending.enabled;(c!==d||d&&t.blending!==n.blending)&&x$(e,n,o),(t!==n||i!==o||i.context!==o.context)&&S$(e,n,o)};Kh.getState=function(e){return{frontFace:e.frontFace,cull:{enabled:e.cull.enabled,face:e.cull.face},lineWidth:e.lineWidth,polygonOffset:{enabled:e.polygonOffset.enabled,factor:e.polygonOffset.factor,units:e.polygonOffset.units},scissorTest:{enabled:e.scissorTest.enabled,rectangle:De.clone(e.scissorTest.rectangle)},depthRange:{near:e.depthRange.near,far:e.depthRange.far},depthTest:{enabled:e.depthTest.enabled,func:e.depthTest.func},colorMask:{red:e.colorMask.red,green:e.colorMask.green,blue:e.colorMask.blue,alpha:e.colorMask.alpha},depthMask:e.depthMask,stencilMask:e.stencilMask,blending:{enabled:e.blending.enabled,color:O.clone(e.blending.color),equationRgb:e.blending.equationRgb,equationAlpha:e.blending.equationAlpha,functionSourceRgb:e.blending.functionSourceRgb,functionSourceAlpha:e.blending.functionSourceAlpha,functionDestinationRgb:e.blending.functionDestinationRgb,functionDestinationAlpha:e.blending.functionDestinationAlpha},stencilTest:{enabled:e.stencilTest.enabled,frontFunction:e.stencilTest.frontFunction,backFunction:e.stencilTest.backFunction,reference:e.stencilTest.reference,mask:e.stencilTest.mask,frontOperation:{fail:e.stencilTest.frontOperation.fail,zFail:e.stencilTest.frontOperation.zFail,zPass:e.stencilTest.frontOperation.zPass},backOperation:{fail:e.stencilTest.backOperation.fail,zFail:e.stencilTest.backOperation.zFail,zPass:e.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:e.sampleCoverage.enabled,value:e.sampleCoverage.value,invert:e.sampleCoverage.invert},viewport:l(e.viewport)?De.clone(e.viewport):void 0}};var ke=Kh;var twt=T(S(),1);var Cvt=T(S(),1);var JRe=new h;function Rt(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var js={};js[ne.FLOAT]="float";js[ne.FLOAT_VEC2]="vec2";js[ne.FLOAT_VEC3]="vec3";js[ne.FLOAT_VEC4]="vec4";js[ne.INT]="int";js[ne.INT_VEC2]="ivec2";js[ne.INT_VEC3]="ivec3";js[ne.INT_VEC4]="ivec4";js[ne.BOOL]="bool";js[ne.BOOL_VEC2]="bvec2";js[ne.BOOL_VEC3]="bvec3";js[ne.BOOL_VEC4]="bvec4";js[ne.FLOAT_MAT2]="mat2";js[ne.FLOAT_MAT3]="mat3";js[ne.FLOAT_MAT4]="mat4";js[ne.SAMPLER_2D]="sampler2D";js[ne.SAMPLER_CUBE]="samplerCube";Rt.prototype.getDeclaration=function(e){let t=`uniform ${js[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var QRe={czm_viewport:new Rt({size:1,datatype:ne.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new Rt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new Rt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new Rt({size:1,datatype:ne.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_model:new Rt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new Rt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new Rt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new Rt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new Rt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new Rt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new Rt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new Rt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new Rt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new Rt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new Rt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new Rt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new Rt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new Rt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new Rt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new Rt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new Rt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new Rt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new Rt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new Rt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new Rt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new Rt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new Rt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new Rt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new Rt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new Rt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new Rt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new Rt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new Rt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new Rt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeHeight2D:new Rt({size:1,datatype:ne.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_eyeEllipsoidNormalEC:new Rt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.eyeEllipsoidNormalEC}}),czm_eyeEllipsoidCurvature:new Rt({size:1,datatype:ne.FLOAT_VEC2,getValue:function(e){return e.eyeEllipsoidCurvature}}),czm_modelToEnu:new Rt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelToEnu}}),czm_enuToModel:new Rt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.enuToModel}}),czm_entireFrustum:new Rt({size:1,datatype:ne.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new Rt({size:1,datatype:ne.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new Rt({size:1,datatype:ne.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new Rt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new Rt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new Rt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new Rt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new Rt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new Rt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new Rt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new Rt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new Rt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new Rt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new Rt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new Rt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new Rt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new Rt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new Rt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return A.getTranslation(e.inverseView,JRe)}}),czm_frameNumber:new Rt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new Rt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new Rt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new Rt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new Rt({size:1,datatype:ne.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new Rt({size:1,datatype:ne.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new Rt({size:1,datatype:ne.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new Rt({size:1,datatype:ne.SAMPLER_2D,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapSize:new Rt({size:1,datatype:ne.FLOAT_VEC2,getValue:function(e){return e.specularEnvironmentMapsDimensions}}),czm_specularEnvironmentMapsMaximumLOD:new Rt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new Rt({size:9,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new Rt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new Rt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new Rt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.fogDensity}}),czm_fogMinimumBrightness:new Rt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.fogMinimumBrightness}}),czm_atmosphereHsbShift:new Rt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.atmosphereHsbShift}}),czm_atmosphereLightIntensity:new Rt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.atmosphereLightIntensity}}),czm_atmosphereRayleighCoefficient:new Rt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.atmosphereRayleighCoefficient}}),czm_atmosphereRayleighScaleHeight:new Rt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.atmosphereRayleighScaleHeight}}),czm_atmosphereMieCoefficient:new Rt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.atmosphereMieCoefficient}}),czm_atmosphereMieScaleHeight:new Rt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.atmosphereMieScaleHeight}}),czm_atmosphereMieAnisotropy:new Rt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.atmosphereMieAnisotropy}}),czm_atmosphereDynamicLighting:new Rt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.atmosphereDynamicLighting}}),czm_splitPosition:new Rt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new Rt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new Rt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new Rt({size:1,datatype:ne.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new Rt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new Rt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new Rt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})},hp=QRe;var vvt=T(S(),1);function jRe(e,t,n,i){switch(t.type){case e.FLOAT:return new C$(e,t,n,i);case e.FLOAT_VEC2:return new V$(e,t,n,i);case e.FLOAT_VEC3:return new L$(e,t,n,i);case e.FLOAT_VEC4:return new R$(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:case e.SAMPLER_3D:case e.SAMPLER_2D_ARRAY:return new sO(e,t,n,i);case e.INT:case e.BOOL:return new Z$(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new G$(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new E$(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new I$(e,t,n,i);case e.FLOAT_MAT2:return new X$(e,t,n,i);case e.FLOAT_MAT3:return new W$(e,t,n,i);case e.FLOAT_MAT4:return new P$(e,t,n,i);default:throw new me(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function C$(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}C$.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))};function V$(e,t,n,i){this.name=n,this.value=void 0,this._value=new B,this._gl=e,this._location=i}V$.prototype.set=function(){let e=this.value;B.equals(e,this._value)||(B.clone(e,this._value),this._gl.uniform2f(this._location,e.x,e.y))};function L$(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}L$.prototype.set=function(){let e=this.value;e&&(l(e.red)?O.equals(e,this._value)||(this._value=O.clone(e,this._value),this._gl.uniform3f(this._location,e.red,e.green,e.blue)):l(e.x)&&(h.equals(e,this._value)||(this._value=h.clone(e,this._value),this._gl.uniform3f(this._location,e.x,e.y,e.z))))};function R$(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}R$.prototype.set=function(){let e=this.value;l(e.red)?O.equals(e,this._value)||(this._value=O.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha)):l(e.x)&&(se.equals(e,this._value)||(this._value=se.clone(e,this._value),this._gl.uniform4f(this._location,e.x,e.y,e.z,e.w)))};function sO(e,t,n,i){this.name=n,this.value=void 0,this._gl=e,this._location=i,this.textureUnitIndex=void 0}sO.prototype.set=function(){let e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);let t=this.value;t&&e.bindTexture(t._target,t._texture)};sO.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1};function Z$(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}Z$.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))};function G$(e,t,n,i){this.name=n,this.value=void 0,this._value=new B,this._gl=e,this._location=i}G$.prototype.set=function(){let e=this.value;B.equals(e,this._value)||(B.clone(e,this._value),this._gl.uniform2i(this._location,e.x,e.y))};function E$(e,t,n,i){this.name=n,this.value=void 0,this._value=new h,this._gl=e,this._location=i}E$.prototype.set=function(){let e=this.value;h.equals(e,this._value)||(h.clone(e,this._value),this._gl.uniform3i(this._location,e.x,e.y,e.z))};function I$(e,t,n,i){this.name=n,this.value=void 0,this._value=new se,this._gl=e,this._location=i}I$.prototype.set=function(){let e=this.value;se.equals(e,this._value)||(se.clone(e,this._value),this._gl.uniform4i(this._location,e.x,e.y,e.z,e.w))};var qRe=new Float32Array(4);function X$(e,t,n,i){this.name=n,this.value=void 0,this._value=new io,this._gl=e,this._location=i}X$.prototype.set=function(){if(!io.equalsArray(this.value,this._value,0)){io.clone(this.value,this._value);let e=io.toArray(this.value,qRe);this._gl.uniformMatrix2fv(this._location,!1,e)}};var $Re=new Float32Array(9);function W$(e,t,n,i){this.name=n,this.value=void 0,this._value=new q,this._gl=e,this._location=i}W$.prototype.set=function(){if(!q.equalsArray(this.value,this._value,0)){q.clone(this.value,this._value);let e=q.toArray(this.value,$Re);this._gl.uniformMatrix3fv(this._location,!1,e)}};var eZe=new Float32Array(16);function P$(e,t,n,i){this.name=n,this.value=void 0,this._value=new A,this._gl=e,this._location=i}P$.prototype.set=function(){if(!A.equalsArray(this.value,this._value,0)){A.clone(this.value,this._value);let e=A.toArray(this.value,eZe);this._gl.uniformMatrix4fv(this._location,!1,e)}};var VR=jRe;var Yvt=T(S(),1);function tZe(e,t,n,i){switch(t.type){case e.FLOAT:return new v$(e,t,n,i);case e.FLOAT_VEC2:return new w$(e,t,n,i);case e.FLOAT_VEC3:return new F$(e,t,n,i);case e.FLOAT_VEC4:return new A$(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new aO(e,t,n,i);case e.INT:case e.BOOL:return new M$(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new N$(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new U$(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new k$(e,t,n,i);case e.FLOAT_MAT2:return new D$(e,t,n,i);case e.FLOAT_MAT3:return new B$(e,t,n,i);case e.FLOAT_MAT4:return new O$(e,t,n,i);default:throw new me(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function v$(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o),this._gl=e,this._location=i[0]}v$.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1;for(let o=0;o<t;++o){let r=e[o];r!==n[o]&&(n[o]=r,i=!0)}i&&this._gl.uniform1fv(this._location,n)};function w$(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*2),this._gl=e,this._location=i[0]}w$.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];B.equalsArray(s,n,o)||(B.pack(s,n,o),i=!0),o+=2}i&&this._gl.uniform2fv(this._location,n)};function F$(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*3),this._gl=e,this._location=i[0]}F$.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];l(s.red)?(s.red!==n[o]||s.green!==n[o+1]||s.blue!==n[o+2])&&(n[o]=s.red,n[o+1]=s.green,n[o+2]=s.blue,i=!0):l(s.x)&&(h.equalsArray(s,n,o)||(h.pack(s,n,o),i=!0)),o+=3}i&&this._gl.uniform3fv(this._location,n)};function A$(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=e,this._location=i[0]}A$.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];l(s.red)?O.equalsArray(s,n,o)||(O.pack(s,n,o),i=!0):l(s.x)&&(se.equalsArray(s,n,o)||(se.pack(s,n,o),i=!0)),o+=4}i&&this._gl.uniform4fv(this._location,n)};function aO(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o),this._gl=e,this._locations=i,this.textureUnitIndex=void 0}aO.prototype.set=function(){let e=this._gl,t=e.TEXTURE0+this.textureUnitIndex,n=this.value,i=n.length;for(let o=0;o<i;++o){let r=n[o];r&&(e.activeTexture(t+o),e.bindTexture(r._target,r._texture))}};aO.prototype._setSampler=function(e){this.textureUnitIndex=e;let t=this._locations,n=t.length;for(let i=0;i<n;++i){let o=e+i;this._gl.uniform1i(t[i],o)}return e+n};function M$(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o),this._gl=e,this._location=i[0]}M$.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1;for(let o=0;o<t;++o){let r=e[o];r!==n[o]&&(n[o]=r,i=!0)}i&&this._gl.uniform1iv(this._location,n)};function N$(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*2),this._gl=e,this._location=i[0]}N$.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];B.equalsArray(s,n,o)||(B.pack(s,n,o),i=!0),o+=2}i&&this._gl.uniform2iv(this._location,n)};function U$(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*3),this._gl=e,this._location=i[0]}U$.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];h.equalsArray(s,n,o)||(h.pack(s,n,o),i=!0),o+=3}i&&this._gl.uniform3iv(this._location,n)};function k$(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*4),this._gl=e,this._location=i[0]}k$.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];se.equalsArray(s,n,o)||(se.pack(s,n,o),i=!0),o+=4}i&&this._gl.uniform4iv(this._location,n)};function D$(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=e,this._location=i[0]}D$.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];io.equalsArray(s,n,o)||(io.pack(s,n,o),i=!0),o+=4}i&&this._gl.uniformMatrix2fv(this._location,!1,n)};function B$(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*9),this._gl=e,this._location=i[0]}B$.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];q.equalsArray(s,n,o)||(q.pack(s,n,o),i=!0),o+=9}i&&this._gl.uniformMatrix3fv(this._location,!1,n)};function O$(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*16),this._gl=e,this._location=i[0]}O$.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];A.equalsArray(s,n,o)||(A.pack(s,n,o),i=!0),o+=16}i&&this._gl.uniformMatrix4fv(this._location,!1,n)};var LR=tZe;var nZe=0;function fp(e){let t=e.vertexShaderText,n=e.fragmentShaderText;typeof spector<"u"&&(t=t.replace(/^#line/gm,"//#line"),n=n.replace(/^#line/gm,"//#line"));let i=iZe(t,n);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=i.duplicateUniformNames,this._cachedShader=void 0,this.maximumTextureUnitIndex=void 0,this._vertexShaderSource=e.vertexShaderSource,this._vertexShaderText=e.vertexShaderText,this._fragmentShaderSource=e.fragmentShaderSource,this._fragmentShaderText=i.fragmentShaderText,this.id=nZe++}fp.fromCache=function(e){return e=g(e,g.EMPTY_OBJECT),e.context.shaderCache.getShaderProgram(e)};fp.replaceCache=function(e){return e=g(e,g.EMPTY_OBJECT),e.context.shaderCache.replaceShaderProgram(e)};Object.defineProperties(fp.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return kM(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return kM(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return kM(this),this._uniformsByName}}});function Y$(e){let t=[],n=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(l(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o].trim(),s=r.slice(r.lastIndexOf(" ")+1);t.push(s)}}return t}function iZe(e,t){let n={};if(!Yt.highpFloatSupported||!Yt.highpIntSupported){let i,o,r,s,a=Y$(e),c=Y$(t),d=a.length,u=c.length;for(i=0;i<d;i++)for(o=0;o<u;o++)if(a[i]===c[o]){r=a[i],s=`czm_mediump_${r}`;let m=new RegExp(`${r}\\b`,"g");t=t.replace(m,s),n[s]=r}}return{fragmentShaderText:t,duplicateUniformNames:n}}var zh="[Cesium WebGL] ";function oZe(e,t){let n=t._vertexShaderText,i=t._fragmentShaderText,o=e.createShader(e.VERTEX_SHADER);e.shaderSource(o,n),e.compileShader(o);let r=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(r,i),e.compileShader(r);let s=e.createProgram();e.attachShader(s,o),e.attachShader(s,r);let a=t._attributeLocations;if(l(a))for(let p in a)a.hasOwnProperty(p)&&e.bindAttribLocation(s,a[p],p);e.linkProgram(s);let c;if(e.getProgramParameter(s,e.LINK_STATUS))return t._logShaderCompilation&&(c=e.getShaderInfoLog(o),l(c)&&c.length>0&&console.log(`${zh}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(r),l(c)&&c.length>0&&console.log(`${zh}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(s),l(c)&&c.length>0&&console.log(`${zh}Shader program link log: ${c}`)),e.deleteShader(o),e.deleteShader(r),s;let d,u=t._debugShaders;throw e.getShaderParameter(r,e.COMPILE_STATUS)?e.getShaderParameter(o,e.COMPILE_STATUS)?(c=e.getProgramInfoLog(s),console.error(`${zh}Shader program link log: ${c}`),m(o,"vertex"),m(r,"fragment"),d=`Program failed to link. Link log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${zh}Vertex shader compile log: ${c}`),console.error(`${zh} Vertex shader source:
${n}`),d=`Vertex shader failed to compile. Compile log: ${c}`):(c=e.getShaderInfoLog(r),console.error(`${zh}Fragment shader compile log: ${c}`),console.error(`${zh} Fragment shader source:
${i}`),d=`Fragment shader failed to compile. Compile log: ${c}`),e.deleteShader(o),e.deleteShader(r),e.deleteProgram(s),new me(d);function m(p,y){if(!l(u))return;let f=u.getTranslatedShaderSource(p);if(f===""){console.error(`${zh}${y} shader translation failed.`);return}console.error(`${zh}Translated ${y} shaderSource:
${f}`)}}function rZe(e,t,n){let i={};for(let o=0;o<n;++o){let r=e.getActiveAttrib(t,o),s=e.getAttribLocation(t,r.name);i[r.name]={name:r.name,type:r.type,index:s}}return i}function sZe(e,t){let n={},i=[],o=[],r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let s=0;s<r;++s){let a=e.getActiveUniform(t,s),c="[0]",d=a.name.indexOf(c,a.name.length-c.length)!==-1?a.name.slice(0,a.name.length-3):a.name;if(d.indexOf("gl_")!==0)if(a.name.indexOf("[")<0){let u=e.getUniformLocation(t,d);if(u!==null){let m=VR(e,a,d,u);n[d]=m,i.push(m),m._setSampler&&o.push(m)}}else{let u,m,p,y,f=d.indexOf("[");if(f>=0){if(u=n[d.slice(0,f)],!l(u))continue;m=u._locations,m.length<=1&&(p=u.value,y=e.getUniformLocation(t,d),y!==null&&(m.push(y),p.push(e.getUniform(t,y))))}else{m=[];for(let x=0;x<a.size;++x)y=e.getUniformLocation(t,`${d}[${x}]`),y!==null&&m.push(y);u=LR(e,a,d,m),n[d]=u,i.push(u),u._setSampler&&o.push(u)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:o}}function aZe(e,t){let n=[],i=[];for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=o,a=e._duplicateUniformNames[s];l(a)&&(r.name=a,s=a);let c=hp[s];l(c)?n.push({uniform:r,automaticUniform:c}):i.push(r)}return{automaticUniforms:n,manualUniforms:i}}function cZe(e,t,n){e.useProgram(t);let i=0,o=n.length;for(let r=0;r<o;++r)i=n[r]._setSampler(i);return e.useProgram(null),i}function kM(e){l(e._program)||H$(e)}function H$(e){let t=e._program,n=e._gl,i=oZe(n,e,e._debugShaders),o=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),r=sZe(n,i),s=aZe(e,r.uniformsByName);e._program=i,e._numberOfVertexAttributes=o,e._vertexAttributes=rZe(n,i,o),e._uniformsByName=r.uniformsByName,e._uniforms=r.uniforms,e._automaticUniforms=s.automaticUniforms,e._manualUniforms=s.manualUniforms,e.maximumTextureUnitIndex=cZe(n,i,r.samplerUniforms),t&&e._gl.deleteProgram(t),typeof spector<"u"&&(e._program.__SPECTOR_rebuildProgram=function(a,c,d,u){let m=e._vertexShaderText,p=e._fragmentShaderText,y=/ ! = /g;e._vertexShaderText=a.replace(y," != "),e._fragmentShaderText=c.replace(y," != ");try{H$(e),d(e._program)}catch(f){e._vertexShaderText=m,e._fragmentShaderText=p;let _=/(?:Compile|Link) error: ([^]*)/.exec(f.message);u(_?_[1]:f.message)}})}fp.prototype._bind=function(){kM(this),this._gl.useProgram(this._program)};fp.prototype._setUniforms=function(e,t,n){let i,o;if(l(e)){let a=this._manualUniforms;for(i=a.length,o=0;o<i;++o){let c=a[o];c.value=e[c.name]()}}let r=this._automaticUniforms;for(i=r.length,o=0;o<i;++o){let a=r[o];a.uniform.value=a.automaticUniform.getValue(t)}let s=this._uniforms;for(i=s.length,o=0;o<i;++o)s[o].set();if(n){let a=this._gl,c=this._program;a.validateProgram(c)}};fp.prototype.isDestroyed=function(){return!1};fp.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)};fp.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),ue(this)};var Qt=fp;var YUt=T(S(),1);var FUt=T(S(),1);var iwt=T(S(),1),RR=`/**
* A built-in GLSL floating-point constant for converting radians to degrees.
*
* @alias czm_degreesPerRadian
* @glslConstant
*
* @see CesiumMath.DEGREES_PER_RADIAN
*
* @example
* // GLSL declaration
* const float czm_degreesPerRadian = ...;
*
* // Example
* float deg = czm_degreesPerRadian * rad;
*/
const float czm_degreesPerRadian = 57.29577951308232;
`;var rwt=T(S(),1),ZR=`/**
* A built-in GLSL vec2 constant for defining the depth range.
* This is a workaround to a bug where IE11 does not implement gl_DepthRange.
*
* @alias czm_depthRange
* @glslConstant
*
* @example
* // GLSL declaration
* float depthRangeNear = czm_depthRange.near;
* float depthRangeFar = czm_depthRange.far;
*
*/
const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0);
`;var awt=T(S(),1),GR=`/**
* 0.1
*
* @name czm_epsilon1
* @glslConstant
*/
const float czm_epsilon1 = 0.1;
`;var lwt=T(S(),1),ER=`/**
* 0.01
*
* @name czm_epsilon2
* @glslConstant
*/
const float czm_epsilon2 = 0.01;
`;var uwt=T(S(),1),IR=`/**
* 0.001
*
* @name czm_epsilon3
* @glslConstant
*/
const float czm_epsilon3 = 0.001;
`;var hwt=T(S(),1),XR=`/**
* 0.0001
*
* @name czm_epsilon4
* @glslConstant
*/
const float czm_epsilon4 = 0.0001;
`;var pwt=T(S(),1),WR=`/**
* 0.00001
*
* @name czm_epsilon5
* @glslConstant
*/
const float czm_epsilon5 = 0.00001;
`;var ywt=T(S(),1),PR=`/**
* 0.000001
*
* @name czm_epsilon6
* @glslConstant
*/
const float czm_epsilon6 = 0.000001;
`;var xwt=T(S(),1),vR=`/**
* 0.0000001
*
* @name czm_epsilon7
* @glslConstant
*/
const float czm_epsilon7 = 0.0000001;
`;var Twt=T(S(),1),wR=`/**
* DOC_TBA
*
* @name czm_infinity
* @glslConstant
*/
const float czm_infinity = 5906376272000.0; // Distance from the Sun to Pluto in meters. TODO: What is best given lowp, mediump, and highp?
`;var Cwt=T(S(),1),FR=`/**
* A built-in GLSL floating-point constant for <code>1/pi</code>.
*
* @alias czm_oneOverPi
* @glslConstant
*
* @see CesiumMath.ONE_OVER_PI
*
* @example
* // GLSL declaration
* const float czm_oneOverPi = ...;
*
* // Example
* float pi = 1.0 / czm_oneOverPi;
*/
const float czm_oneOverPi = 0.3183098861837907;
`;var Lwt=T(S(),1),AR=`/**
* A built-in GLSL floating-point constant for <code>1/2pi</code>.
*
* @alias czm_oneOverTwoPi
* @glslConstant
*
* @see CesiumMath.ONE_OVER_TWO_PI
*
* @example
* // GLSL declaration
* const float czm_oneOverTwoPi = ...;
*
* // Example
* float pi = 2.0 * czm_oneOverTwoPi;
*/
const float czm_oneOverTwoPi = 0.15915494309189535;
`;var Zwt=T(S(),1),MR=`/**
* The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE}
*
* @name czm_passCesium3DTile
* @glslConstant
*
* @see czm_pass
*/
const float czm_passCesium3DTile = 4.0;
`;var Ewt=T(S(),1),NR=`/**
* The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION}
*
* @name czm_passCesium3DTileClassification
* @glslConstant
*
* @see czm_pass
*/
const float czm_passCesium3DTileClassification = 5.0;
`;var Xwt=T(S(),1),UR=`/**
* The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW}
*
* @name czm_passCesium3DTileClassificationIgnoreShow
* @glslConstant
*
* @see czm_pass
*/
const float czm_passCesium3DTileClassificationIgnoreShow = 6.0;
`;var Pwt=T(S(),1),kR=`/**
* The automatic GLSL constant for {@link Pass#CLASSIFICATION}
*
* @name czm_passClassification
* @glslConstant
*
* @see czm_pass
*/
const float czm_passClassification = 7.0;
`;var wwt=T(S(),1),DR=`/**
* The automatic GLSL constant for {@link Pass#COMPUTE}
*
* @name czm_passCompute
* @glslConstant
*
* @see czm_pass
*/
const float czm_passCompute = 1.0;
`;var Awt=T(S(),1),BR=`/**
* The automatic GLSL constant for {@link Pass#ENVIRONMENT}
*
* @name czm_passEnvironment
* @glslConstant
*
* @see czm_pass
*/
const float czm_passEnvironment = 0.0;
`;var Nwt=T(S(),1),OR=`/**
* The automatic GLSL constant for {@link Pass#GLOBE}
*
* @name czm_passGlobe
* @glslConstant
*
* @see czm_pass
*/
const float czm_passGlobe = 2.0;
`;var kwt=T(S(),1),YR=`/**
* The automatic GLSL constant for {@link Pass#OPAQUE}
*
* @name czm_passOpaque
* @glslConstant
*
* @see czm_pass
*/
const float czm_passOpaque = 7.0;
`;var Bwt=T(S(),1),HR=`/**
* The automatic GLSL constant for {@link Pass#OVERLAY}
*
* @name czm_passOverlay
* @glslConstant
*
* @see czm_pass
*/
const float czm_passOverlay = 10.0;
`;var Ywt=T(S(),1),KR=`/**
* The automatic GLSL constant for {@link Pass#TERRAIN_CLASSIFICATION}
*
* @name czm_passTerrainClassification
* @glslConstant
*
* @see czm_pass
*/
const float czm_passTerrainClassification = 3.0;
`;var Kwt=T(S(),1),zR=`/**
* The automatic GLSL constant for {@link Pass#TRANSLUCENT}
*
* @name czm_passTranslucent
* @glslConstant
*
* @see czm_pass
*/
const float czm_passTranslucent = 8.0;
`;var Jwt=T(S(),1),JR=`/**
* The automatic GLSL constant for {@link Pass#VOXELS}
*
* @name czm_passVoxels
* @glslConstant
*
* @see czm_pass
*/
const float czm_passVoxels = 9.0;
`;var jwt=T(S(),1),QR=`/**
* A built-in GLSL floating-point constant for <code>Math.PI</code>.
*
* @alias czm_pi
* @glslConstant
*
* @see CesiumMath.PI
*
* @example
* // GLSL declaration
* const float czm_pi = ...;
*
* // Example
* float twoPi = 2.0 * czm_pi;
*/
const float czm_pi = 3.141592653589793;
`;var $wt=T(S(),1),jR=`/**
* A built-in GLSL floating-point constant for <code>pi/4</code>.
*
* @alias czm_piOverFour
* @glslConstant
*
* @see CesiumMath.PI_OVER_FOUR
*
* @example
* // GLSL declaration
* const float czm_piOverFour = ...;
*
* // Example
* float pi = 4.0 * czm_piOverFour;
*/
const float czm_piOverFour = 0.7853981633974483;
`;var tFt=T(S(),1),qR=`/**
* A built-in GLSL floating-point constant for <code>pi/6</code>.
*
* @alias czm_piOverSix
* @glslConstant
*
* @see CesiumMath.PI_OVER_SIX
*
* @example
* // GLSL declaration
* const float czm_piOverSix = ...;
*
* // Example
* float pi = 6.0 * czm_piOverSix;
*/
const float czm_piOverSix = 0.5235987755982988;
`;var iFt=T(S(),1),$R=`/**
* A built-in GLSL floating-point constant for <code>pi/3</code>.
*
* @alias czm_piOverThree
* @glslConstant
*
* @see CesiumMath.PI_OVER_THREE
*
* @example
* // GLSL declaration
* const float czm_piOverThree = ...;
*
* // Example
* float pi = 3.0 * czm_piOverThree;
*/
const float czm_piOverThree = 1.0471975511965976;
`;var rFt=T(S(),1),eZ=`/**
* A built-in GLSL floating-point constant for <code>pi/2</code>.
*
* @alias czm_piOverTwo
* @glslConstant
*
* @see CesiumMath.PI_OVER_TWO
*
* @example
* // GLSL declaration
* const float czm_piOverTwo = ...;
*
* // Example
* float pi = 2.0 * czm_piOverTwo;
*/
const float czm_piOverTwo = 1.5707963267948966;
`;var aFt=T(S(),1),tZ=`/**
* A built-in GLSL floating-point constant for converting degrees to radians.
*
* @alias czm_radiansPerDegree
* @glslConstant
*
* @see CesiumMath.RADIANS_PER_DEGREE
*
* @example
* // GLSL declaration
* const float czm_radiansPerDegree = ...;
*
* // Example
* float rad = czm_radiansPerDegree * deg;
*/
const float czm_radiansPerDegree = 0.017453292519943295;
`;var lFt=T(S(),1),nZ=`/**
* The constant identifier for the 2D {@link SceneMode}
*
* @name czm_sceneMode2D
* @glslConstant
* @see czm_sceneMode
* @see czm_sceneModeColumbusView
* @see czm_sceneMode3D
* @see czm_sceneModeMorphing
*/
const float czm_sceneMode2D = 2.0;
`;var uFt=T(S(),1),iZ=`/**
* The constant identifier for the 3D {@link SceneMode}
*
* @name czm_sceneMode3D
* @glslConstant
* @see czm_sceneMode
* @see czm_sceneMode2D
* @see czm_sceneModeColumbusView
* @see czm_sceneModeMorphing
*/
const float czm_sceneMode3D = 3.0;
`;var hFt=T(S(),1),oZ=`/**
* The constant identifier for the Columbus View {@link SceneMode}
*
* @name czm_sceneModeColumbusView
* @glslConstant
* @see czm_sceneMode
* @see czm_sceneMode2D
* @see czm_sceneMode3D
* @see czm_sceneModeMorphing
*/
const float czm_sceneModeColumbusView = 1.0;
`;var pFt=T(S(),1),rZ=`/**
* The constant identifier for the Morphing {@link SceneMode}
*
* @name czm_sceneModeMorphing
* @glslConstant
* @see czm_sceneMode
* @see czm_sceneMode2D
* @see czm_sceneModeColumbusView
* @see czm_sceneMode3D
*/
const float czm_sceneModeMorphing = 0.0;
`;var yFt=T(S(),1),sZ=`/**
* A built-in GLSL floating-point constant for one solar radius.
*
* @alias czm_solarRadius
* @glslConstant
*
* @see CesiumMath.SOLAR_RADIUS
*
* @example
* // GLSL declaration
* const float czm_solarRadius = ...;
*/
const float czm_solarRadius = 695500000.0;
`;var xFt=T(S(),1),aZ=`/**
* A built-in GLSL floating-point constant for <code>3pi/2</code>.
*
* @alias czm_threePiOver2
* @glslConstant
*
* @see CesiumMath.THREE_PI_OVER_TWO
*
* @example
* // GLSL declaration
* const float czm_threePiOver2 = ...;
*
* // Example
* float pi = (2.0 / 3.0) * czm_threePiOver2;
*/
const float czm_threePiOver2 = 4.71238898038469;
`;var TFt=T(S(),1),cZ=`/**
* A built-in GLSL floating-point constant for <code>2pi</code>.
*
* @alias czm_twoPi
* @glslConstant
*
* @see CesiumMath.TWO_PI
*
* @example
* // GLSL declaration
* const float czm_twoPi = ...;
*
* // Example
* float pi = czm_twoPi / 2.0;
*/
const float czm_twoPi = 6.283185307179586;
`;var CFt=T(S(),1),lZ=`/**
* The maximum latitude, in radians, both North and South, supported by a Web Mercator
* (EPSG:3857) projection. Technically, the Mercator projection is defined
* for any latitude up to (but not including) 90 degrees, but it makes sense
* to cut it off sooner because it grows exponentially with increasing latitude.
* The logic behind this particular cutoff value, which is the one used by
* Google Maps, Bing Maps, and Esri, is that it makes the projection
* square. That is, the rectangle is equal in the X and Y directions.
*
* The constant value is computed as follows:
* czm_pi * 0.5 - (2.0 * atan(exp(-czm_pi)))
*
* @name czm_webMercatorMaxLatitude
* @glslConstant
*/
const float czm_webMercatorMaxLatitude = 1.4844222297453324;
`;var LFt=T(S(),1),dZ=`/**
* @name czm_depthRangeStruct
* @glslStruct
*/
struct czm_depthRangeStruct
{
float near;
float far;
};
`;var ZFt=T(S(),1),uZ=`/**
* Holds material information that can be used for lighting. Returned by all czm_getMaterial functions.
*
* @name czm_material
* @glslStruct
*
* @property {vec3} diffuse Incoming light that scatters evenly in all directions.
* @property {float} specular Intensity of incoming light reflecting in a single direction.
* @property {float} shininess The sharpness of the specular reflection. Higher values create a smaller, more focused specular highlight.
* @property {vec3} normal Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal.
* @property {vec3} emission Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light.
* @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque.
*/
struct czm_material
{
vec3 diffuse;
float specular;
float shininess;
vec3 normal;
vec3 emission;
float alpha;
};
`;var EFt=T(S(),1),mZ=`/**
* Used as input to every material's czm_getMaterial function.
*
* @name czm_materialInput
* @glslStruct
*
* @property {float} s 1D texture coordinates.
* @property {vec2} st 2D texture coordinates.
* @property {vec3} str 3D texture coordinates.
* @property {vec3} normalEC Unperturbed surface normal in eye coordinates.
* @property {mat3} tangentToEyeMatrix Matrix for converting a tangent space normal to eye space.
* @property {vec3} positionToEyeEC Vector from the fragment to the eye in eye coordinates. The magnitude is the distance in meters from the fragment to the eye.
* @property {float} height The height of the terrain in meters above or below the WGS84 ellipsoid. Only available for globe materials.
* @property {float} slope The slope of the terrain in radians. 0 is flat; pi/2 is vertical. Only available for globe materials.
* @property {float} aspect The aspect of the terrain in radians. 0 is East, pi/2 is North, pi is West, 3pi/2 is South. Only available for globe materials.
*/
struct czm_materialInput
{
float s;
vec2 st;
vec3 str;
vec3 normalEC;
mat3 tangentToEyeMatrix;
vec3 positionToEyeEC;
float height;
float slope;
float aspect;
};
`;var XFt=T(S(),1),hZ=`/**
* Struct for representing a material for a {@link Model}. The model
* rendering pipeline will pass this struct between material, custom shaders,
* and lighting stages. This is not to be confused with {@link czm_material}
* which is used by the older Fabric materials system, although they are similar.
* <p>
* All color values (diffuse, specular, emissive) are in linear color space.
* </p>
*
* @name czm_modelMaterial
* @glslStruct
*
* @property {vec3} diffuse Incoming light that scatters evenly in all directions.
* @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque.
* @property {vec3} specular Color of reflected light at normal incidence in PBR materials. This is sometimes referred to as f0 in the literature.
* @property {float} roughness A number from 0.0 to 1.0 representing how rough the surface is. Values near 0.0 produce glossy surfaces, while values near 1.0 produce rough surfaces.
* @property {vec3} normalEC Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal.
* @property {float} occlusion Ambient occlusion recieved at this point on the material. 1.0 means fully lit, 0.0 means fully occluded.
* @property {vec3} emissive Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light.
*/
struct czm_modelMaterial {
vec3 diffuse;
float alpha;
vec3 specular;
float roughness;
vec3 normalEC;
float occlusion;
vec3 emissive;
};
`;var PFt=T(S(),1),fZ=`/**
* Struct for representing the output of a custom vertex shader.
*
* @name czm_modelVertexOutput
* @glslStruct
*
* @see {@link CustomShader}
* @see {@link Model}
*
* @property {vec3} positionMC The position of the vertex in model coordinates
* @property {float} pointSize A custom value for gl_PointSize. This is only used for point primitives.
*/
struct czm_modelVertexOutput {
vec3 positionMC;
float pointSize;
};
`;var wFt=T(S(),1),pZ=`/**
* Parameters for {@link czm_pbrLighting}
*
* @name czm_material
* @glslStruct
*
* @property {vec3} diffuseColor the diffuse color of the material for the lambert term of the rendering equation
* @property {float} roughness a value from 0.0 to 1.0 that indicates how rough the surface of the material is.
* @property {vec3} f0 The reflectance of the material at normal incidence
*/
struct czm_pbrParameters
{
vec3 diffuseColor;
float roughness;
vec3 f0;
};
`;var AFt=T(S(),1),bZ=`/**
* DOC_TBA
*
* @name czm_ray
* @glslStruct
*/
struct czm_ray
{
vec3 origin;
vec3 direction;
};
`;var NFt=T(S(),1),yZ=`/**
* DOC_TBA
*
* @name czm_raySegment
* @glslStruct
*/
struct czm_raySegment
{
float start;
float stop;
};
/**
* DOC_TBA
*
* @name czm_emptyRaySegment
* @glslConstant
*/
const czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity);
/**
* DOC_TBA
*
* @name czm_fullRaySegment
* @glslConstant
*/
const czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity);
`;var kFt=T(S(),1),gZ=`struct czm_shadowParameters
{
#ifdef USE_CUBE_MAP_SHADOW
vec3 texCoords;
#else
vec2 texCoords;
#endif
float depthBias;
float depth;
float nDotL;
vec2 texelStepSize;
float normalShadingSmooth;
float darkness;
};
`;var BFt=T(S(),1),xZ=`// See:
// https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/
vec3 czm_acesTonemapping(vec3 color) {
float g = 0.985;
float a = 0.065;
float b = 0.0001;
float c = 0.433;
float d = 0.238;
color = (color * (color + a) - b) / (color * (g * color + c) + d);
color = clamp(color, 0.0, 1.0);
return color;
}
`;var YFt=T(S(),1),_Z=`/**
* @private
*/
float czm_alphaWeight(float a)
{
float z = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];
// See Weighted Blended Order-Independent Transparency for examples of different weighting functions:
// http://jcgt.org/published/0002/02/09/
return pow(a + 0.01, 4.0) + max(1e-2, min(3.0 * 1e3, 0.003 / (1e-5 + pow(abs(z) / 200.0, 4.0))));
}
`;var KFt=T(S(),1),TZ=`/**
* Procedural anti-aliasing by blurring two colors that meet at a sharp edge.
*
* @name czm_antialias
* @glslFunction
*
* @param {vec4} color1 The color on one side of the edge.
* @param {vec4} color2 The color on the other side of the edge.
* @param {vec4} currentcolor The current color, either <code>color1</code> or <code>color2</code>.
* @param {float} dist The distance to the edge in texture coordinates.
* @param {float} [fuzzFactor=0.1] Controls the blurriness between the two colors.
* @returns {vec4} The anti-aliased color.
*
* @example
* // GLSL declarations
* vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor);
* vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist);
*
* // get the color for a material that has a sharp edge at the line y = 0.5 in texture space
* float dist = abs(textureCoordinates.t - 0.5);
* vec4 currentColor = mix(bottomColor, topColor, step(0.5, textureCoordinates.t));
* vec4 color = czm_antialias(bottomColor, topColor, currentColor, dist, 0.1);
*/
vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor)
{
float val1 = clamp(dist / fuzzFactor, 0.0, 1.0);
float val2 = clamp((dist - 0.5) / fuzzFactor, 0.0, 1.0);
val1 = val1 * (1.0 - val2);
val1 = val1 * val1 * (3.0 - (2.0 * val1));
val1 = pow(val1, 0.5); //makes the transition nicer
vec4 midColor = (color1 + color2) * 0.5;
return mix(midColor, currentColor, val1);
}
vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist)
{
return czm_antialias(color1, color2, currentColor, dist, 0.1);
}
`;var JFt=T(S(),1),SZ=`/**
* Apply a HSB color shift to an RGB color.
*
* @param {vec3} rgb The color in RGB space.
* @param {vec3} hsbShift The amount to shift each component. The xyz components correspond to hue, saturation, and brightness. Shifting the hue by +/- 1.0 corresponds to shifting the hue by a full cycle. Saturation and brightness are clamped between 0 and 1 after the adjustment
* @param {bool} ignoreBlackPixels If true, black pixels will be unchanged. This is necessary in some shaders such as atmosphere-related effects.
*
* @return {vec3} The RGB color after shifting in HSB space and clamping saturation and brightness to a valid range.
*/
vec3 czm_applyHSBShift(vec3 rgb, vec3 hsbShift, bool ignoreBlackPixels) {
// Convert rgb color to hsb
vec3 hsb = czm_RGBToHSB(rgb);
// Perform hsb shift
// Hue cycles around so no clamp is needed.
hsb.x += hsbShift.x; // hue
hsb.y = clamp(hsb.y + hsbShift.y, 0.0, 1.0); // saturation
// brightness
//
// Some shaders such as atmosphere-related effects need to leave black
// pixels unchanged
if (ignoreBlackPixels) {
hsb.z = hsb.z > czm_epsilon7 ? hsb.z + hsbShift.z : 0.0;
} else {
hsb.z = hsb.z + hsbShift.z;
}
hsb.z = clamp(hsb.z, 0.0, 1.0);
// Convert shifted hsb back to rgb
return czm_HSBToRGB(hsb);
}
`;var jFt=T(S(),1),CZ=`/**
* Approximately computes spherical coordinates given a normal.
* Uses approximate inverse trigonometry for speed and consistency,
* since inverse trigonometry can differ from vendor-to-vendor and when compared with the CPU.
*
* @name czm_approximateSphericalCoordinates
* @glslFunction
*
* @param {vec3} normal arbitrary-length normal.
*
* @returns {vec2} Approximate latitude and longitude spherical coordinates.
*/
vec2 czm_approximateSphericalCoordinates(vec3 normal) {
// Project into plane with vertical for latitude
float latitudeApproximation = czm_fastApproximateAtan(sqrt(normal.x * normal.x + normal.y * normal.y), normal.z);
float longitudeApproximation = czm_fastApproximateAtan(normal.x, normal.y);
return vec2(latitudeApproximation, longitudeApproximation);
}
`;var $Ft=T(S(),1),VZ=`/**
* Compute a rational approximation to tanh(x)
*
* @param {float} x A real number input
* @returns {float} An approximation for tanh(x)
*/
float czm_approximateTanh(float x) {
float x2 = x * x;
return max(-1.0, min(1.0, x * (27.0 + x2) / (27.0 + 9.0 * x2)));
}
`;var t9t=T(S(),1),LZ=`/**
* Determines if the fragment is back facing
*
* @name czm_backFacing
* @glslFunction
*
* @returns {bool} <code>true</code> if the fragment is back facing; otherwise, <code>false</code>.
*/
bool czm_backFacing()
{
// !gl_FrontFacing doesn't work as expected on Mac/Intel so use the more verbose form instead. See https://github.com/CesiumGS/cesium/pull/8494.
return gl_FrontFacing == false;
}
`;var i9t=T(S(),1),RZ=`/**
* Branchless ternary operator to be used when it's inexpensive to explicitly
* evaluate both possibilities for a float expression.
*
* @name czm_branchFreeTernary
* @glslFunction
*
* @param {bool} comparison A comparison statement
* @param {float} a Value to return if the comparison is true.
* @param {float} b Value to return if the comparison is false.
*
* @returns {float} equivalent of comparison ? a : b
*/
float czm_branchFreeTernary(bool comparison, float a, float b) {
float useA = float(comparison);
return a * useA + b * (1.0 - useA);
}
/**
* Branchless ternary operator to be used when it's inexpensive to explicitly
* evaluate both possibilities for a vec2 expression.
*
* @name czm_branchFreeTernary
* @glslFunction
*
* @param {bool} comparison A comparison statement
* @param {vec2} a Value to return if the comparison is true.
* @param {vec2} b Value to return if the comparison is false.
*
* @returns {vec2} equivalent of comparison ? a : b
*/
vec2 czm_branchFreeTernary(bool comparison, vec2 a, vec2 b) {
float useA = float(comparison);
return a * useA + b * (1.0 - useA);
}
/**
* Branchless ternary operator to be used when it's inexpensive to explicitly
* evaluate both possibilities for a vec3 expression.
*
* @name czm_branchFreeTernary
* @glslFunction
*
* @param {bool} comparison A comparison statement
* @param {vec3} a Value to return if the comparison is true.
* @param {vec3} b Value to return if the comparison is false.
*
* @returns {vec3} equivalent of comparison ? a : b
*/
vec3 czm_branchFreeTernary(bool comparison, vec3 a, vec3 b) {
float useA = float(comparison);
return a * useA + b * (1.0 - useA);
}
/**
* Branchless ternary operator to be used when it's inexpensive to explicitly
* evaluate both possibilities for a vec4 expression.
*
* @name czm_branchFreeTernary
* @glslFunction
*
* @param {bool} comparison A comparison statement
* @param {vec3} a Value to return if the comparison is true.
* @param {vec3} b Value to return if the comparison is false.
*
* @returns {vec3} equivalent of comparison ? a : b
*/
vec4 czm_branchFreeTernary(bool comparison, vec4 a, vec4 b) {
float useA = float(comparison);
return a * useA + b * (1.0 - useA);
}
`;var r9t=T(S(),1),ZZ=`
vec4 czm_cascadeColor(vec4 weights)
{
return vec4(1.0, 0.0, 0.0, 1.0) * weights.x +
vec4(0.0, 1.0, 0.0, 1.0) * weights.y +
vec4(0.0, 0.0, 1.0, 1.0) * weights.z +
vec4(1.0, 0.0, 1.0, 1.0) * weights.w;
}
`;var a9t=T(S(),1),GZ=`
uniform vec4 shadowMap_cascadeDistances;
float czm_cascadeDistance(vec4 weights)
{
return dot(shadowMap_cascadeDistances, weights);
}
`;var l9t=T(S(),1),EZ=`
uniform mat4 shadowMap_cascadeMatrices[4];
mat4 czm_cascadeMatrix(vec4 weights)
{
return shadowMap_cascadeMatrices[0] * weights.x +
shadowMap_cascadeMatrices[1] * weights.y +
shadowMap_cascadeMatrices[2] * weights.z +
shadowMap_cascadeMatrices[3] * weights.w;
}
`;var u9t=T(S(),1),IZ=`
uniform vec4 shadowMap_cascadeSplits[2];
vec4 czm_cascadeWeights(float depthEye)
{
// One component is set to 1.0 and all others set to 0.0.
vec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye));
vec4 far = step(depthEye, shadowMap_cascadeSplits[1]);
return near * far;
}
`;var h9t=T(S(),1),XZ=`/**
* DOC_TBA
*
* @name czm_columbusViewMorph
* @glslFunction
*/
vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time)
{
// Just linear for now.
vec3 p = mix(position2D.xyz, position3D.xyz, time);
return vec4(p, 1.0);
}
`;var p9t=T(S(),1),WZ=`/**
* Compute the atmosphere color, applying Rayleigh and Mie scattering. This
* builtin uses automatic uniforms so the atmophere settings are synced with the
* state of the Scene, even in other contexts like Model.
*
* @name czm_computeAtmosphereColor
* @glslFunction
*
* @param {vec3} positionWC Position of the fragment in world coords (low precision)
* @param {vec3} lightDirection Light direction from the sun or other light source.
* @param {vec3} rayleighColor The Rayleigh scattering color computed by a scattering function
* @param {vec3} mieColor The Mie scattering color computed by a scattering function
* @param {float} opacity The opacity computed by a scattering function.
*/
vec4 czm_computeAtmosphereColor(
vec3 positionWC,
vec3 lightDirection,
vec3 rayleighColor,
vec3 mieColor,
float opacity
) {
// Setup the primary ray: from the camera position to the vertex position.
vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);
float cosAngle = dot(cameraToPositionWCDirection, lightDirection);
float cosAngleSq = cosAngle * cosAngle;
float G = czm_atmosphereMieAnisotropy;
float GSq = G * G;
// The Rayleigh phase function.
float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq);
// The Mie phase function.
float miePhase = 3.0 / (25.1327412287) * ((1.0 - GSq) * (cosAngleSq + 1.0)) / (pow(1.0 + GSq - 2.0 * cosAngle * G, 1.5) * (2.0 + GSq));
// The final color is generated by combining the effects of the Rayleigh and Mie scattering.
vec3 rayleigh = rayleighPhase * rayleighColor;
vec3 mie = miePhase * mieColor;
vec3 color = (rayleigh + mie) * czm_atmosphereLightIntensity;
return vec4(color, opacity);
}
`;var y9t=T(S(),1),PZ=`/**
* Compute atmosphere scattering for the ground atmosphere and fog. This method
* uses automatic uniforms so it is always synced with the scene settings.
*
* @name czm_computeGroundAtmosphereScattering
* @glslfunction
*
* @param {vec3} positionWC The position of the fragment in world coordinates.
* @param {vec3} lightDirection The direction of the light to calculate the scattering from.
* @param {vec3} rayleighColor The variable the Rayleigh scattering will be written to.
* @param {vec3} mieColor The variable the Mie scattering will be written to.
* @param {float} opacity The variable the transmittance will be written to.
*/
void czm_computeGroundAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) {
vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);
czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection);
float atmosphereInnerRadius = length(positionWC);
czm_computeScattering(
primaryRay,
length(cameraToPositionWC),
lightDirection,
atmosphereInnerRadius,
rayleighColor,
mieColor,
opacity
);
}
`;var x9t=T(S(),1),vZ=`/**
* Returns a position in model coordinates relative to eye taking into
* account the current scene mode: 3D, 2D, or Columbus view.
* <p>
* This uses standard position attributes, <code>position3DHigh</code>,
* <code>position3DLow</code>, <code>position2DHigh</code>, and <code>position2DLow</code>,
* and should be used when writing a vertex shader for an {@link Appearance}.
* </p>
*
* @name czm_computePosition
* @glslFunction
*
* @returns {vec4} The position relative to eye.
*
* @example
* vec4 p = czm_computePosition();
* v_positionEC = (czm_modelViewRelativeToEye * p).xyz;
* gl_Position = czm_modelViewProjectionRelativeToEye * p;
*
* @see czm_translateRelativeToEye
*/
vec4 czm_computePosition();
`;var T9t=T(S(),1),wZ=`/**
* This function computes the colors contributed by Rayliegh and Mie scattering on a given ray, as well as
* the transmittance value for the ray. This function uses automatic uniforms
* so the atmosphere settings are always synced with the current scene.
*
* @name czm_computeScattering
* @glslfunction
*
* @param {czm_ray} primaryRay The ray from the camera to the position.
* @param {float} primaryRayLength The length of the primary ray.
* @param {vec3} lightDirection The direction of the light to calculate the scattering from.
* @param {vec3} rayleighColor The variable the Rayleigh scattering will be written to.
* @param {vec3} mieColor The variable the Mie scattering will be written to.
* @param {float} opacity The variable the transmittance will be written to.
*/
void czm_computeScattering(
czm_ray primaryRay,
float primaryRayLength,
vec3 lightDirection,
float atmosphereInnerRadius,
out vec3 rayleighColor,
out vec3 mieColor,
out float opacity
) {
const float ATMOSPHERE_THICKNESS = 111e3; // The thickness of the atmosphere in meters.
const int PRIMARY_STEPS_MAX = 16; // Maximum number of times the ray from the camera to the world position (primary ray) is sampled.
const int LIGHT_STEPS_MAX = 4; // Maximum number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray.
// Initialize the default scattering amounts to 0.
rayleighColor = vec3(0.0);
mieColor = vec3(0.0);
opacity = 0.0;
float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;
vec3 origin = vec3(0.0);
// Calculate intersection from the camera to the outer ring of the atmosphere.
czm_raySegment primaryRayAtmosphereIntersect = czm_raySphereIntersectionInterval(primaryRay, origin, atmosphereOuterRadius);
// Return empty colors if no intersection with the atmosphere geometry.
if (primaryRayAtmosphereIntersect == czm_emptyRaySegment) {
rayleighColor = vec3(1.0, 0.0, 1.0);
return;
}
// To deal with smaller values of PRIMARY_STEPS (e.g. 4)
// we implement a split strategy: sky or horizon.
// For performance reasons, instead of a if/else branch
// a soft choice is implemented through a weight 0.0 <= w_stop_gt_lprl <= 1.0
float x = 1e-7 * primaryRayAtmosphereIntersect.stop / length(primaryRayLength);
// Value close to 0.0: close to the horizon
// Value close to 1.0: above in the sky
float w_stop_gt_lprl = 0.5 * (1.0 + czm_approximateTanh(x));
// The ray should start from the first intersection with the outer atmopshere, or from the camera position, if it is inside the atmosphere.
float start_0 = primaryRayAtmosphereIntersect.start;
primaryRayAtmosphereIntersect.start = max(primaryRayAtmosphereIntersect.start, 0.0);
// The ray should end at the exit from the atmosphere or at the distance to the vertex, whichever is smaller.
primaryRayAtmosphereIntersect.stop = min(primaryRayAtmosphereIntersect.stop, length(primaryRayLength));
// For the number of ray steps, distinguish inside or outside atmosphere (outer space)
// (1) from outer space we have to use more ray steps to get a realistic rendering
// (2) within atmosphere we need fewer steps for faster rendering
float x_o_a = start_0 - ATMOSPHERE_THICKNESS; // ATMOSPHERE_THICKNESS used as an ad-hoc constant, no precise meaning here, only the order of magnitude matters
float w_inside_atmosphere = 1.0 - 0.5 * (1.0 + czm_approximateTanh(x_o_a));
int PRIMARY_STEPS = PRIMARY_STEPS_MAX - int(w_inside_atmosphere * 12.0); // Number of times the ray from the camera to the world position (primary ray) is sampled.
int LIGHT_STEPS = LIGHT_STEPS_MAX - int(w_inside_atmosphere * 2.0); // Number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray.
// Setup for sampling positions along the ray - starting from the intersection with the outer ring of the atmosphere.
float rayPositionLength = primaryRayAtmosphereIntersect.start;
// (1) Outside the atmosphere: constant rayStepLength
// (2) Inside atmosphere: variable rayStepLength to compensate the rough rendering of the smaller number of ray steps
float totalRayLength = primaryRayAtmosphereIntersect.stop - rayPositionLength;
float rayStepLengthIncrease = w_inside_atmosphere * ((1.0 - w_stop_gt_lprl) * totalRayLength / (float(PRIMARY_STEPS * (PRIMARY_STEPS + 1)) / 2.0));
float rayStepLength = max(1.0 - w_inside_atmosphere, w_stop_gt_lprl) * totalRayLength / max(7.0 * w_inside_atmosphere, float(PRIMARY_STEPS));
vec3 rayleighAccumulation = vec3(0.0);
vec3 mieAccumulation = vec3(0.0);
vec2 opticalDepth = vec2(0.0);
vec2 heightScale = vec2(czm_atmosphereRayleighScaleHeight, czm_atmosphereMieScaleHeight);
// Sample positions on the primary ray.
for (int i = 0; i < PRIMARY_STEPS_MAX; ++i) {
// The loop should be: for (int i = 0; i < PRIMARY_STEPS; ++i) {...} but WebGL1 cannot
// loop with non-constant condition, so it has to break early instead
if (i >= PRIMARY_STEPS) {
break;
}
// Calculate sample position along viewpoint ray.
vec3 samplePosition = primaryRay.origin + primaryRay.direction * (rayPositionLength + rayStepLength);
// Calculate height of sample position above ellipsoid.
float sampleHeight = length(samplePosition) - atmosphereInnerRadius;
// Calculate and accumulate density of particles at the sample position.
vec2 sampleDensity = exp(-sampleHeight / heightScale) * rayStepLength;
opticalDepth += sampleDensity;
// Generate ray from the sample position segment to the light source, up to the outer ring of the atmosphere.
czm_ray lightRay = czm_ray(samplePosition, lightDirection);
czm_raySegment lightRayAtmosphereIntersect = czm_raySphereIntersectionInterval(lightRay, origin, atmosphereOuterRadius);
float lightStepLength = lightRayAtmosphereIntersect.stop / float(LIGHT_STEPS);
float lightPositionLength = 0.0;
vec2 lightOpticalDepth = vec2(0.0);
// Sample positions along the light ray, to accumulate incidence of light on the latest sample segment.
for (int j = 0; j < LIGHT_STEPS_MAX; ++j) {
// The loop should be: for (int j = 0; i < LIGHT_STEPS; ++j) {...} but WebGL1 cannot
// loop with non-constant condition, so it has to break early instead
if (j >= LIGHT_STEPS) {
break;
}
// Calculate sample position along light ray.
vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5);
// Calculate height of the light sample position above ellipsoid.
float lightHeight = length(lightPosition) - atmosphereInnerRadius;
// Calculate density of photons at the light sample position.
lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength;
// Increment distance on light ray.
lightPositionLength += lightStepLength;
}
// Compute attenuation via the primary ray and the light ray.
vec3 attenuation = exp(-((czm_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (czm_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x))));
// Accumulate the scattering.
rayleighAccumulation += sampleDensity.x * attenuation;
mieAccumulation += sampleDensity.y * attenuation;
// Increment distance on primary ray.
rayPositionLength += (rayStepLength += rayStepLengthIncrease);
}
// Compute the scattering amount.
rayleighColor = czm_atmosphereRayleighCoefficient * rayleighAccumulation;
mieColor = czm_atmosphereMieCoefficient * mieAccumulation;
// Compute the transmittance i.e. how much light is passing through the atmosphere.
opacity = length(exp(-((czm_atmosphereMieCoefficient * opticalDepth.y) + (czm_atmosphereRayleighCoefficient * opticalDepth.x))));
}
`;var C9t=T(S(),1),FZ=`/**
* @private
*/
vec2 cordic(float angle)
{
// Scale the vector by the appropriate factor for the 24 iterations to follow.
vec2 vector = vec2(6.0725293500888267e-1, 0.0);
// Iteration 1
float sense = (angle < 0.0) ? -1.0 : 1.0;
// float factor = sense * 1.0; // 2^-0
mat2 rotation = mat2(1.0, sense, -sense, 1.0);
vector = rotation * vector;
angle -= sense * 7.8539816339744828e-1; // atan(2^-0)
// Iteration 2
sense = (angle < 0.0) ? -1.0 : 1.0;
float factor = sense * 5.0e-1; // 2^-1
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 4.6364760900080609e-1; // atan(2^-1)
// Iteration 3
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 2.5e-1; // 2^-2
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 2.4497866312686414e-1; // atan(2^-2)
// Iteration 4
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 1.25e-1; // 2^-3
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 1.2435499454676144e-1; // atan(2^-3)
// Iteration 5
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 6.25e-2; // 2^-4
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 6.2418809995957350e-2; // atan(2^-4)
// Iteration 6
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 3.125e-2; // 2^-5
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 3.1239833430268277e-2; // atan(2^-5)
// Iteration 7
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 1.5625e-2; // 2^-6
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 1.5623728620476831e-2; // atan(2^-6)
// Iteration 8
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 7.8125e-3; // 2^-7
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 7.8123410601011111e-3; // atan(2^-7)
// Iteration 9
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 3.90625e-3; // 2^-8
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 3.9062301319669718e-3; // atan(2^-8)
// Iteration 10
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 1.953125e-3; // 2^-9
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 1.9531225164788188e-3; // atan(2^-9)
// Iteration 11
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 9.765625e-4; // 2^-10
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 9.7656218955931946e-4; // atan(2^-10)
// Iteration 12
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 4.8828125e-4; // 2^-11
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 4.8828121119489829e-4; // atan(2^-11)
// Iteration 13
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 2.44140625e-4; // 2^-12
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 2.4414062014936177e-4; // atan(2^-12)
// Iteration 14
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 1.220703125e-4; // 2^-13
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 1.2207031189367021e-4; // atan(2^-13)
// Iteration 15
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 6.103515625e-5; // 2^-14
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 6.1035156174208773e-5; // atan(2^-14)
// Iteration 16
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 3.0517578125e-5; // 2^-15
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 3.0517578115526096e-5; // atan(2^-15)
// Iteration 17
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 1.52587890625e-5; // 2^-16
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 1.5258789061315762e-5; // atan(2^-16)
// Iteration 18
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 7.62939453125e-6; // 2^-17
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 7.6293945311019700e-6; // atan(2^-17)
// Iteration 19
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 3.814697265625e-6; // 2^-18
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 3.8146972656064961e-6; // atan(2^-18)
// Iteration 20
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 1.9073486328125e-6; // 2^-19
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 1.9073486328101870e-6; // atan(2^-19)
// Iteration 21
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 9.5367431640625e-7; // 2^-20
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 9.5367431640596084e-7; // atan(2^-20)
// Iteration 22
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 4.76837158203125e-7; // 2^-21
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 4.7683715820308884e-7; // atan(2^-21)
// Iteration 23
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 2.384185791015625e-7; // 2^-22
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 2.3841857910155797e-7; // atan(2^-22)
// Iteration 24
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 1.1920928955078125e-7; // 2^-23
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
// angle -= sense * 1.1920928955078068e-7; // atan(2^-23)
return vector;
}
/**
* Computes the cosine and sine of the provided angle using the CORDIC algorithm.
*
* @name czm_cosineAndSine
* @glslFunction
*
* @param {float} angle The angle in radians.
*
* @returns {vec2} The resulting cosine of the angle (as the x coordinate) and sine of the angle (as the y coordinate).
*
* @example
* vec2 v = czm_cosineAndSine(czm_piOverSix);
* float cosine = v.x;
* float sine = v.y;
*/
vec2 czm_cosineAndSine(float angle)
{
if (angle < -czm_piOverTwo || angle > czm_piOverTwo)
{
if (angle < 0.0)
{
return -cordic(angle + czm_pi);
}
else
{
return -cordic(angle - czm_pi);
}
}
else
{
return cordic(angle);
}
}
`;var L9t=T(S(),1),AZ=`/**
* Decompresses texture coordinates that were packed into a single float.
*
* @name czm_decompressTextureCoordinates
* @glslFunction
*
* @param {float} encoded The compressed texture coordinates.
* @returns {vec2} The decompressed texture coordinates.
*/
vec2 czm_decompressTextureCoordinates(float encoded)
{
float temp = encoded / 4096.0;
float xZeroTo4095 = floor(temp);
float stx = xZeroTo4095 / 4095.0;
float sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0;
return vec2(stx, sty);
}
`;var Z9t=T(S(),1),MZ=`/**
* Get default parameters for physically based rendering. These defaults
* describe a rough dielectric (non-metal) surface (e.g. rough plastic).
*
* @return {czm_pbrParameters} Default parameters for {@link czm_pbrLighting}
*/
czm_pbrParameters czm_defaultPbrMaterial()
{
czm_pbrParameters results;
results.diffuseColor = vec3(1.0);
results.roughness = 1.0;
const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04);
results.f0 = REFLECTANCE_DIELECTRIC;
return results;
}
`;var E9t=T(S(),1),NZ=`// emulated noperspective
#if (__VERSION__ == 300 || defined(GL_EXT_frag_depth)) && !defined(LOG_DEPTH)
out float v_WindowZ;
#endif
/**
* Emulates GL_DEPTH_CLAMP, which is not available in WebGL 1 or 2.
* GL_DEPTH_CLAMP clamps geometry that is outside the near and far planes,
* capping the shadow volume. More information here:
* https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_depth_clamp.txt.
*
* When GL_EXT_frag_depth is available we emulate GL_DEPTH_CLAMP by ensuring
* no geometry gets clipped by setting the clip space z value to 0.0 and then
* sending the unaltered screen space z value (using emulated noperspective
* interpolation) to the frag shader where it is clamped to [0,1] and then
* written with gl_FragDepth (see czm_writeDepthClamp). This technique is based on:
* https://stackoverflow.com/questions/5960757/how-to-emulate-gl-depth-clamp-nv.
*
* When GL_EXT_frag_depth is not available, which is the case on some mobile
* devices, we must attempt to fix this only in the vertex shader.
* The approach is to clamp the z value to the far plane, which closes the
* shadow volume but also distorts the geometry, so there can still be artifacts
* on frustum seams.
*
* @name czm_depthClamp
* @glslFunction
*
* @param {vec4} coords The vertex in clip coordinates.
* @returns {vec4} The modified vertex.
*
* @example
* gl_Position = czm_depthClamp(czm_modelViewProjection * vec4(position, 1.0));
*
* @see czm_writeDepthClamp
*/
vec4 czm_depthClamp(vec4 coords)
{
#ifndef LOG_DEPTH
#if __VERSION__ == 300 || defined(GL_EXT_frag_depth)
v_WindowZ = (0.5 * (coords.z / coords.w) + 0.5) * coords.w;
coords.z = 0.0;
#else
coords.z = min(coords.z, coords.w);
#endif
#endif
return coords;
}
`;var X9t=T(S(),1),UZ=`/**
* Computes a 3x3 rotation matrix that transforms vectors from an ellipsoid's east-north-up coordinate system
* to eye coordinates. In east-north-up coordinates, x points east, y points north, and z points along the
* surface normal. East-north-up can be used as an ellipsoid's tangent space for operations such as bump mapping.
* <br /><br />
* The ellipsoid is assumed to be centered at the model coordinate's origin.
*
* @name czm_eastNorthUpToEyeCoordinates
* @glslFunction
*
* @param {vec3} positionMC The position on the ellipsoid in model coordinates.
* @param {vec3} normalEC The normalized ellipsoid surface normal, at <code>positionMC</code>, in eye coordinates.
*
* @returns {mat3} A 3x3 rotation matrix that transforms vectors from the east-north-up coordinate system to eye coordinates.
*
* @example
* // Transform a vector defined in the east-north-up coordinate
* // system, (0, 0, 1) which is the surface normal, to eye
* // coordinates.
* mat3 m = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC);
* vec3 normalEC = m * vec3(0.0, 0.0, 1.0);
*/
mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC)
{
vec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0)); // normalized surface tangent in model coordinates
vec3 tangentEC = normalize(czm_normal3D * tangentMC); // normalized surface tangent in eye coordinates
vec3 bitangentEC = normalize(cross(normalEC, tangentEC)); // normalized surface bitangent in eye coordinates
return mat3(
tangentEC.x, tangentEC.y, tangentEC.z,
bitangentEC.x, bitangentEC.y, bitangentEC.z,
normalEC.x, normalEC.y, normalEC.z);
}
`;var P9t=T(S(),1),kZ=`/**
* DOC_TBA
*
* @name czm_ellipsoidContainsPoint
* @glslFunction
*
*/
bool czm_ellipsoidContainsPoint(vec3 ellipsoid_inverseRadii, vec3 point)
{
vec3 scaled = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz;
return (dot(scaled, scaled) <= 1.0);
}
`;var w9t=T(S(),1),DZ=`/**
* DOC_TBA
*
* @name czm_ellipsoidWgs84TextureCoordinates
* @glslFunction
*/
vec2 czm_ellipsoidWgs84TextureCoordinates(vec3 normal)
{
return vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5);
}
`;var A9t=T(S(),1),BZ=`/**
* Compares <code>left</code> and <code>right</code> componentwise. Returns <code>true</code>
* if they are within <code>epsilon</code> and <code>false</code> otherwise. The inputs
* <code>left</code> and <code>right</code> can be <code>float</code>s, <code>vec2</code>s,
* <code>vec3</code>s, or <code>vec4</code>s.
*
* @name czm_equalsEpsilon
* @glslFunction
*
* @param {} left The first vector.
* @param {} right The second vector.
* @param {float} epsilon The epsilon to use for equality testing.
* @returns {bool} <code>true</code> if the components are within <code>epsilon</code> and <code>false</code> otherwise.
*
* @example
* // GLSL declarations
* bool czm_equalsEpsilon(float left, float right, float epsilon);
* bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon);
* bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon);
* bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon);
*/
bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) {
return all(lessThanEqual(abs(left - right), vec4(epsilon)));
}
bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon) {
return all(lessThanEqual(abs(left - right), vec3(epsilon)));
}
bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) {
return all(lessThanEqual(abs(left - right), vec2(epsilon)));
}
bool czm_equalsEpsilon(float left, float right, float epsilon) {
return (abs(left - right) <= epsilon);
}
`;var N9t=T(S(),1),OZ=`/**
* DOC_TBA
*
* @name czm_eyeOffset
* @glslFunction
*
* @param {vec4} positionEC DOC_TBA.
* @param {vec3} eyeOffset DOC_TBA.
*
* @returns {vec4} DOC_TBA.
*/
vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset)
{
// This equation is approximate in x and y.
vec4 p = positionEC;
vec4 zEyeOffset = normalize(p) * eyeOffset.z;
p.xy += eyeOffset.xy + zEyeOffset.xy;
p.z += zEyeOffset.z;
return p;
}
`;var k9t=T(S(),1),YZ=`/**
* Transforms a position from eye to window coordinates. The transformation
* from eye to clip coordinates is done using {@link czm_projection}.
* The transform from normalized device coordinates to window coordinates is
* done using {@link czm_viewportTransformation}, which assumes a depth range
* of <code>near = 0</code> and <code>far = 1</code>.
* <br /><br />
* This transform is useful when there is a need to manipulate window coordinates
* in a vertex shader as done by {@link BillboardCollection}.
*
* @name czm_eyeToWindowCoordinates
* @glslFunction
*
* @param {vec4} position The position in eye coordinates to transform.
*
* @returns {vec4} The transformed position in window coordinates.
*
* @see czm_modelToWindowCoordinates
* @see czm_projection
* @see czm_viewportTransformation
* @see BillboardCollection
*
* @example
* vec4 positionWC = czm_eyeToWindowCoordinates(positionEC);
*/
vec4 czm_eyeToWindowCoordinates(vec4 positionEC)
{
vec4 q = czm_projection * positionEC; // clip coordinates
q.xyz /= q.w; // normalized device coordinates
q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates
return q;
}
`;var B9t=T(S(),1),HZ=`/**
* Approxiamtes atan over the range [0, 1]. Safe to flip output for negative input.
*
* Based on Michal Drobot's approximation from ShaderFastLibs, which in turn is based on
* "Efficient approximations for the arctangent function," Rajan, S. Sichun Wang Inkol, R. Joyal, A., May 2006.
* Adapted from ShaderFastLibs under MIT License.
*
* Chosen for the following characteristics over range [0, 1]:
* - basically no error at 0 and 1, important for getting around range limit (naive atan2 via atan requires infinite range atan)
* - no visible artifacts from first-derivative discontinuities, unlike latitude via range-reduced sqrt asin approximations (at equator)
*
* The original code is x * (-0.1784 * abs(x) - 0.0663 * x * x + 1.0301);
* Removed the abs() in here because it isn't needed, the input range is guaranteed as [0, 1] by how we're approximating atan2.
*
* @name czm_fastApproximateAtan
* @glslFunction
*
* @param {float} x Value between 0 and 1 inclusive.
*
* @returns {float} Approximation of atan(x)
*/
float czm_fastApproximateAtan(float x) {
return x * (-0.1784 * x - 0.0663 * x * x + 1.0301);
}
/**
* Approximation of atan2.
*
* Range reduction math based on nvidia's cg reference implementation for atan2: http://developer.download.nvidia.com/cg/atan2.html
* However, we replaced their atan curve with Michael Drobot's (see above).
*
* @name czm_fastApproximateAtan
* @glslFunction
*
* @param {float} x Value between -1 and 1 inclusive.
* @param {float} y Value between -1 and 1 inclusive.
*
* @returns {float} Approximation of atan2(x, y)
*/
float czm_fastApproximateAtan(float x, float y) {
// atan approximations are usually only reliable over [-1, 1], or, in our case, [0, 1] due to modifications.
// So range-reduce using abs and by flipping whether x or y is on top.
float t = abs(x); // t used as swap and atan result.
float opposite = abs(y);
float adjacent = max(t, opposite);
opposite = min(t, opposite);
t = czm_fastApproximateAtan(opposite / adjacent);
// Undo range reduction
t = czm_branchFreeTernary(abs(y) > abs(x), czm_piOverTwo - t, t);
t = czm_branchFreeTernary(x < 0.0, czm_pi - t, t);
t = czm_branchFreeTernary(y < 0.0, -t, t);
return t;
}
`;var Y9t=T(S(),1),KZ=`/**
* Gets the color with fog at a distance from the camera.
*
* @name czm_fog
* @glslFunction
*
* @param {float} distanceToCamera The distance to the camera in meters.
* @param {vec3} color The original color.
* @param {vec3} fogColor The color of the fog.
*
* @returns {vec3} The color adjusted for fog at the distance from the camera.
*/
vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor)
{
float scalar = distanceToCamera * czm_fogDensity;
float fog = 1.0 - exp(-(scalar * scalar));
return mix(color, fogColor, fog);
}
/**
* Gets the color with fog at a distance from the camera.
*
* @name czm_fog
* @glslFunction
*
* @param {float} distanceToCamera The distance to the camera in meters.
* @param {vec3} color The original color.
* @param {vec3} fogColor The color of the fog.
* @param {float} fogModifierConstant A constant to modify the appearance of fog.
*
* @returns {vec3} The color adjusted for fog at the distance from the camera.
*/
vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor, float fogModifierConstant)
{
float scalar = distanceToCamera * czm_fogDensity;
float fog = 1.0 - exp(-((fogModifierConstant * scalar + fogModifierConstant) * (scalar * (1.0 + fogModifierConstant))));
return mix(color, fogColor, fog);
}
`;var K9t=T(S(),1),zZ=`/**
* Converts a color from RGB space to linear space.
*
* @name czm_gammaCorrect
* @glslFunction
*
* @param {vec3} color The color in RGB space.
* @returns {vec3} The color in linear space.
*/
vec3 czm_gammaCorrect(vec3 color) {
#ifdef HDR
color = pow(color, vec3(czm_gamma));
#endif
return color;
}
vec4 czm_gammaCorrect(vec4 color) {
#ifdef HDR
color.rgb = pow(color.rgb, vec3(czm_gamma));
#endif
return color;
}
`;var J9t=T(S(),1),JZ=`/**
* DOC_TBA
*
* @name czm_geodeticSurfaceNormal
* @glslFunction
*
* @param {vec3} positionOnEllipsoid DOC_TBA
* @param {vec3} ellipsoidCenter DOC_TBA
* @param {vec3} oneOverEllipsoidRadiiSquared DOC_TBA
*
* @returns {vec3} DOC_TBA.
*/
vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared)
{
return normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared);
}
`;var j9t=T(S(),1),QZ=`/**
* An czm_material with default values. Every material's czm_getMaterial
* should use this default material as a base for the material it returns.
* The default normal value is given by materialInput.normalEC.
*
* @name czm_getDefaultMaterial
* @glslFunction
*
* @param {czm_materialInput} input The input used to construct the default material.
*
* @returns {czm_material} The default material.
*
* @see czm_materialInput
* @see czm_material
* @see czm_getMaterial
*/
czm_material czm_getDefaultMaterial(czm_materialInput materialInput)
{
czm_material material;
material.diffuse = vec3(0.0);
material.specular = 0.0;
material.shininess = 1.0;
material.normal = materialInput.normalEC;
material.emission = vec3(0.0);
material.alpha = 1.0;
return material;
}
`;var $9t=T(S(),1),jZ=`/**
* Select which direction vector to use for dynamic atmosphere lighting based on an enum value
*
* @name czm_getDynamicAtmosphereLightDirection
* @glslfunction
* @see DynamicAtmosphereLightingType.js
*
* @param {vec3} positionWC the position of the vertex/fragment in world coordinates. This is normalized and returned when dynamic lighting is turned off.
* @param {float} lightEnum The enum value for selecting between light sources.
* @return {vec3} The normalized light direction vector. Depending on the enum value, it is either positionWC, czm_lightDirectionWC or czm_sunDirectionWC
*/
vec3 czm_getDynamicAtmosphereLightDirection(vec3 positionWC, float lightEnum) {
const float NONE = 0.0;
const float SCENE_LIGHT = 1.0;
const float SUNLIGHT = 2.0;
vec3 lightDirection =
positionWC * float(lightEnum == NONE) +
czm_lightDirectionWC * float(lightEnum == SCENE_LIGHT) +
czm_sunDirectionWC * float(lightEnum == SUNLIGHT);
return normalize(lightDirection);
}
`;var tAt=T(S(),1),qZ=`/**
* Calculates the intensity of diffusely reflected light.
*
* @name czm_getLambertDiffuse
* @glslFunction
*
* @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.
* @param {vec3} normalEC The surface normal in eye coordinates.
*
* @returns {float} The intensity of the diffuse reflection.
*
* @see czm_phong
*
* @example
* float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC);
* float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200);
* vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity);
*/
float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC)
{
return max(dot(lightDirectionEC, normalEC), 0.0);
}
`;var iAt=T(S(),1),$Z=`/**
* Calculates the specular intensity of reflected light.
*
* @name czm_getSpecular
* @glslFunction
*
* @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.
* @param {vec3} toEyeEC Unit vector pointing to the eye position in eye coordinates.
* @param {vec3} normalEC The surface normal in eye coordinates.
* @param {float} shininess The sharpness of the specular reflection. Higher values create a smaller, more focused specular highlight.
*
* @returns {float} The intensity of the specular highlight.
*
* @see czm_phong
*
* @example
* float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC);
* float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200);
* vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity);
*/
float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess)
{
vec3 toReflectedLight = reflect(-lightDirectionEC, normalEC);
float specular = max(dot(toReflectedLight, toEyeEC), 0.0);
// pow has undefined behavior if both parameters <= 0.
// Prevent this by making sure shininess is at least czm_epsilon2.
return pow(specular, max(shininess, czm_epsilon2));
}
`;var rAt=T(S(),1),eG=`/**
* @private
*/
vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians)
{
float cosAngle = cos(angleInRadians);
float sinAngle = sin(angleInRadians);
// time dependent sampling directions
vec2 s0 = vec2(1.0/17.0, 0.0);
vec2 s1 = vec2(-1.0/29.0, 0.0);
vec2 s2 = vec2(1.0/101.0, 1.0/59.0);
vec2 s3 = vec2(-1.0/109.0, -1.0/57.0);
// rotate sampling direction by specified angle
s0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y));
s1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y));
s2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y));
s3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y));
vec2 uv0 = (uv/103.0) + (time * s0);
vec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23);
vec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51);
vec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71);
uv0 = fract(uv0);
uv1 = fract(uv1);
uv2 = fract(uv2);
uv3 = fract(uv3);
vec4 noise = (texture(normalMap, uv0)) +
(texture(normalMap, uv1)) +
(texture(normalMap, uv2)) +
(texture(normalMap, uv3));
// average and scale to between -1 and 1
return ((noise / 4.0) - 0.5) * 2.0;
}
`;var aAt=T(S(),1),tG=`/**
* Converts an HSB color (hue, saturation, brightness) to RGB
* HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl}
*
* @name czm_HSBToRGB
* @glslFunction
*
* @param {vec3} hsb The color in HSB.
*
* @returns {vec3} The color in RGB.
*
* @example
* vec3 hsb = czm_RGBToHSB(rgb);
* hsb.z *= 0.1;
* rgb = czm_HSBToRGB(hsb);
*/
const vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
vec3 czm_HSBToRGB(vec3 hsb)
{
vec3 p = abs(fract(hsb.xxx + K_HSB2RGB.xyz) * 6.0 - K_HSB2RGB.www);
return hsb.z * mix(K_HSB2RGB.xxx, clamp(p - K_HSB2RGB.xxx, 0.0, 1.0), hsb.y);
}
`;var lAt=T(S(),1),nG=`/**
* Converts an HSL color (hue, saturation, lightness) to RGB
* HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html}
*
* @name czm_HSLToRGB
* @glslFunction
*
* @param {vec3} rgb The color in HSL.
*
* @returns {vec3} The color in RGB.
*
* @example
* vec3 hsl = czm_RGBToHSL(rgb);
* hsl.z *= 0.1;
* rgb = czm_HSLToRGB(hsl);
*/
vec3 hueToRGB(float hue)
{
float r = abs(hue * 6.0 - 3.0) - 1.0;
float g = 2.0 - abs(hue * 6.0 - 2.0);
float b = 2.0 - abs(hue * 6.0 - 4.0);
return clamp(vec3(r, g, b), 0.0, 1.0);
}
vec3 czm_HSLToRGB(vec3 hsl)
{
vec3 rgb = hueToRGB(hsl.x);
float c = (1.0 - abs(2.0 * hsl.z - 1.0)) * hsl.y;
return (rgb - 0.5) * c + hsl.z;
}
`;var uAt=T(S(),1),iG=`/**
* Adjusts the hue of a color.
*
* @name czm_hue
* @glslFunction
*
* @param {vec3} rgb The color.
* @param {float} adjustment The amount to adjust the hue of the color in radians.
*
* @returns {float} The color with the hue adjusted.
*
* @example
* vec3 adjustHue = czm_hue(color, czm_pi); // The same as czm_hue(color, -czm_pi)
*/
vec3 czm_hue(vec3 rgb, float adjustment)
{
const mat3 toYIQ = mat3(0.299, 0.587, 0.114,
0.595716, -0.274453, -0.321263,
0.211456, -0.522591, 0.311135);
const mat3 toRGB = mat3(1.0, 0.9563, 0.6210,
1.0, -0.2721, -0.6474,
1.0, -1.107, 1.7046);
vec3 yiq = toYIQ * rgb;
float hue = atan(yiq.z, yiq.y) + adjustment;
float chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y);
vec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue));
return toRGB * color;
}
`;var hAt=T(S(),1),oG=`/**
* Converts a color in linear space to RGB space.
*
* @name czm_inverseGamma
* @glslFunction
*
* @param {vec3} color The color in linear space.
* @returns {vec3} The color in RGB space.
*/
vec3 czm_inverseGamma(vec3 color) {
return pow(color, vec3(1.0 / czm_gamma));
}
`;var pAt=T(S(),1),rG=`/**
* Determines if a time interval is empty.
*
* @name czm_isEmpty
* @glslFunction
*
* @param {czm_raySegment} interval The interval to test.
*
* @returns {bool} <code>true</code> if the time interval is empty; otherwise, <code>false</code>.
*
* @example
* bool b0 = czm_isEmpty(czm_emptyRaySegment); // true
* bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false
* bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0.
*/
bool czm_isEmpty(czm_raySegment interval)
{
return (interval.stop < 0.0);
}
`;var yAt=T(S(),1),sG=`/**
* Determines if a time interval is empty.
*
* @name czm_isFull
* @glslFunction
*
* @param {czm_raySegment} interval The interval to test.
*
* @returns {bool} <code>true</code> if the time interval is empty; otherwise, <code>false</code>.
*
* @example
* bool b0 = czm_isEmpty(czm_emptyRaySegment); // true
* bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false
* bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0.
*/
bool czm_isFull(czm_raySegment interval)
{
return (interval.start == 0.0 && interval.stop == czm_infinity);
}
`;var xAt=T(S(),1),aG=`/**
* Computes the fraction of a Web Wercator rectangle at which a given geodetic latitude is located.
*
* @name czm_latitudeToWebMercatorFraction
* @glslFunction
*
* @param {float} latitude The geodetic latitude, in radians.
* @param {float} southMercatorY The Web Mercator coordinate of the southern boundary of the rectangle.
* @param {float} oneOverMercatorHeight The total height of the rectangle in Web Mercator coordinates.
*
* @returns {float} The fraction of the rectangle at which the latitude occurs. If the latitude is the southern
* boundary of the rectangle, the return value will be zero. If it is the northern boundary, the return
* value will be 1.0. Latitudes in between are mapped according to the Web Mercator projection.
*/
float czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, float oneOverMercatorHeight)
{
float sinLatitude = sin(latitude);
float mercatorY = 0.5 * log((1.0 + sinLatitude) / (1.0 - sinLatitude));
return (mercatorY - southMercatorY) * oneOverMercatorHeight;
}
`;var TAt=T(S(),1),cG=`/**
* Converts a linear RGB color to an sRGB color.
*
* @param {vec3|vec4} linearIn The color in linear color space.
* @returns {vec3|vec4} The color in sRGB color space. The vector type matches the input.
*/
vec3 czm_linearToSrgb(vec3 linearIn)
{
return pow(linearIn, vec3(1.0/2.2));
}
vec4 czm_linearToSrgb(vec4 linearIn)
{
vec3 srgbOut = pow(linearIn.rgb, vec3(1.0/2.2));
return vec4(srgbOut, linearIn.a);
}
`;var CAt=T(S(),1),lG=`/**
* Computes distance from an point in 2D to a line in 2D.
*
* @name czm_lineDistance
* @glslFunction
*
* param {vec2} point1 A point along the line.
* param {vec2} point2 A point along the line.
* param {vec2} point A point that may or may not be on the line.
* returns {float} The distance from the point to the line.
*/
float czm_lineDistance(vec2 point1, vec2 point2, vec2 point) {
return abs((point2.y - point1.y) * point.x - (point2.x - point1.x) * point.y + point2.x * point1.y - point2.y * point1.x) / distance(point2, point1);
}
`;var LAt=T(S(),1),dG=`/**
* Computes the luminance of a color.
*
* @name czm_luminance
* @glslFunction
*
* @param {vec3} rgb The color.
*
* @returns {float} The luminance.
*
* @example
* float light = czm_luminance(vec3(0.0)); // 0.0
* float dark = czm_luminance(vec3(1.0)); // ~1.0
*/
float czm_luminance(vec3 rgb)
{
// Algorithm from Chapter 10 of Graphics Shaders.
const vec3 W = vec3(0.2125, 0.7154, 0.0721);
return dot(rgb, W);
}
`;var ZAt=T(S(),1),uG=`/**
* Computes the size of a pixel in meters at a distance from the eye.
* <p>
* Use this version when passing in a custom pixel ratio. For example, passing in 1.0 will return meters per native device pixel.
* </p>
* @name czm_metersPerPixel
* @glslFunction
*
* @param {vec3} positionEC The position to get the meters per pixel in eye coordinates.
* @param {float} pixelRatio The scaling factor from pixel space to coordinate space
*
* @returns {float} The meters per pixel at positionEC.
*/
float czm_metersPerPixel(vec4 positionEC, float pixelRatio)
{
float width = czm_viewport.z;
float height = czm_viewport.w;
float pixelWidth;
float pixelHeight;
float top = czm_frustumPlanes.x;
float bottom = czm_frustumPlanes.y;
float left = czm_frustumPlanes.z;
float right = czm_frustumPlanes.w;
if (czm_sceneMode == czm_sceneMode2D || czm_orthographicIn3D == 1.0)
{
float frustumWidth = right - left;
float frustumHeight = top - bottom;
pixelWidth = frustumWidth / width;
pixelHeight = frustumHeight / height;
}
else
{
float distanceToPixel = -positionEC.z;
float inverseNear = 1.0 / czm_currentFrustum.x;
float tanTheta = top * inverseNear;
pixelHeight = 2.0 * distanceToPixel * tanTheta / height;
tanTheta = right * inverseNear;
pixelWidth = 2.0 * distanceToPixel * tanTheta / width;
}
return max(pixelWidth, pixelHeight) * pixelRatio;
}
/**
* Computes the size of a pixel in meters at a distance from the eye.
* <p>
* Use this version when scaling by pixel ratio.
* </p>
* @name czm_metersPerPixel
* @glslFunction
*
* @param {vec3} positionEC The position to get the meters per pixel in eye coordinates.
*
* @returns {float} The meters per pixel at positionEC.
*/
float czm_metersPerPixel(vec4 positionEC)
{
return czm_metersPerPixel(positionEC, czm_pixelRatio);
}
`;var EAt=T(S(),1),mG=`/**
* Transforms a position from model to window coordinates. The transformation
* from model to clip coordinates is done using {@link czm_modelViewProjection}.
* The transform from normalized device coordinates to window coordinates is
* done using {@link czm_viewportTransformation}, which assumes a depth range
* of <code>near = 0</code> and <code>far = 1</code>.
* <br /><br />
* This transform is useful when there is a need to manipulate window coordinates
* in a vertex shader as done by {@link BillboardCollection}.
* <br /><br />
* This function should not be confused with {@link czm_viewportOrthographic},
* which is an orthographic projection matrix that transforms from window
* coordinates to clip coordinates.
*
* @name czm_modelToWindowCoordinates
* @glslFunction
*
* @param {vec4} position The position in model coordinates to transform.
*
* @returns {vec4} The transformed position in window coordinates.
*
* @see czm_eyeToWindowCoordinates
* @see czm_modelViewProjection
* @see czm_viewportTransformation
* @see czm_viewportOrthographic
* @see BillboardCollection
*
* @example
* vec4 positionWC = czm_modelToWindowCoordinates(positionMC);
*/
vec4 czm_modelToWindowCoordinates(vec4 position)
{
vec4 q = czm_modelViewProjection * position; // clip coordinates
q.xyz /= q.w; // normalized device coordinates
q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates
return q;
}
`;var XAt=T(S(),1),hG=`/**
* DOC_TBA
*
* @name czm_multiplyWithColorBalance
* @glslFunction
*/
vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right)
{
// Algorithm from Chapter 10 of Graphics Shaders.
const vec3 W = vec3(0.2125, 0.7154, 0.0721);
vec3 target = left * right;
float leftLuminance = dot(left, W);
float rightLuminance = dot(right, W);
float targetLuminance = dot(target, W);
return ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target;
}
`;var PAt=T(S(),1),fG=`/**
* Computes a value that scales with distance. The scaling is clamped at the near and
* far distances, and does not extrapolate. This function works with the
* {@link NearFarScalar} JavaScript class.
*
* @name czm_nearFarScalar
* @glslFunction
*
* @param {vec4} nearFarScalar A vector with 4 components: Near distance (x), Near value (y), Far distance (z), Far value (w).
* @param {float} cameraDistSq The square of the current distance from the camera.
*
* @returns {float} The value at this distance.
*/
float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq)
{
float valueAtMin = nearFarScalar.y;
float valueAtMax = nearFarScalar.w;
float nearDistanceSq = nearFarScalar.x * nearFarScalar.x;
float farDistanceSq = nearFarScalar.z * nearFarScalar.z;
float t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq);
t = pow(clamp(t, 0.0, 1.0), 0.2);
return mix(valueAtMin, valueAtMax, t);
}
`;var wAt=T(S(),1),pG=` /**
* Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector.
* The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors",
* Cigolle et al 2014: http://jcgt.org/published/0003/02/01/
*
* @name czm_octDecode
* @param {vec2} encoded The oct-encoded, unit-length vector
* @param {float} range The maximum value of the SNORM range. The encoded vector is stored in log2(rangeMax+1) bits.
* @returns {vec3} The decoded and normalized vector
*/
vec3 czm_octDecode(vec2 encoded, float range)
{
if (encoded.x == 0.0 && encoded.y == 0.0) {
return vec3(0.0, 0.0, 0.0);
}
encoded = encoded / range * 2.0 - 1.0;
vec3 v = vec3(encoded.x, encoded.y, 1.0 - abs(encoded.x) - abs(encoded.y));
if (v.z < 0.0)
{
v.xy = (1.0 - abs(v.yx)) * czm_signNotZero(v.xy);
}
return normalize(v);
}
/**
* Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector.
* The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors",
* Cigolle et al 2014: http://jcgt.org/published/0003/02/01/
*
* @name czm_octDecode
* @param {vec2} encoded The oct-encoded, unit-length vector
* @returns {vec3} The decoded and normalized vector
*/
vec3 czm_octDecode(vec2 encoded)
{
return czm_octDecode(encoded, 255.0);
}
/**
* Decodes a unit-length vector in 'oct' encoding packed into a floating-point number to a normalized 3-component Cartesian vector.
* The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors",
* Cigolle et al 2014: http://jcgt.org/published/0003/02/01/
*
* @name czm_octDecode
* @param {float} encoded The oct-encoded, unit-length vector
* @returns {vec3} The decoded and normalized vector
*/
vec3 czm_octDecode(float encoded)
{
float temp = encoded / 256.0;
float x = floor(temp);
float y = (temp - x) * 256.0;
return czm_octDecode(vec2(x, y));
}
/**
* Decodes three unit-length vectors in 'oct' encoding packed into two floating-point numbers to normalized 3-component Cartesian vectors.
* The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors",
* Cigolle et al 2014: http://jcgt.org/published/0003/02/01/
*
* @name czm_octDecode
* @param {vec2} encoded The packed oct-encoded, unit-length vectors.
* @param {vec3} vector1 One decoded and normalized vector.
* @param {vec3} vector2 One decoded and normalized vector.
* @param {vec3} vector3 One decoded and normalized vector.
*/
void czm_octDecode(vec2 encoded, out vec3 vector1, out vec3 vector2, out vec3 vector3)
{
float temp = encoded.x / 65536.0;
float x = floor(temp);
float encodedFloat1 = (temp - x) * 65536.0;
temp = encoded.y / 65536.0;
float y = floor(temp);
float encodedFloat2 = (temp - y) * 65536.0;
vector1 = czm_octDecode(encodedFloat1);
vector2 = czm_octDecode(encodedFloat2);
vector3 = czm_octDecode(vec2(x, y));
}
`;var AAt=T(S(),1),bG=`/**
* Packs a depth value into a vec3 that can be represented by unsigned bytes.
*
* @name czm_packDepth
* @glslFunction
*
* @param {float} depth The floating-point depth.
* @returns {vec3} The packed depth.
*/
vec4 czm_packDepth(float depth)
{
// See Aras Pranckevi\u010Dius' post Encoding Floats to RGBA
// http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/
vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * depth;
enc = fract(enc);
enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);
return enc;
}
`;var NAt=T(S(),1),yG=`vec3 lambertianDiffuse(vec3 diffuseColor)
{
return diffuseColor / czm_pi;
}
vec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH)
{
return f0 + (f90 - f0) * pow(clamp(1.0 - VdotH, 0.0, 1.0), 5.0);
}
float smithVisibilityG1(float NdotV, float roughness)
{
// this is the k value for direct lighting.
// for image based lighting it will be roughness^2 / 2
float k = (roughness + 1.0) * (roughness + 1.0) / 8.0;
return NdotV / (NdotV * (1.0 - k) + k);
}
float smithVisibilityGGX(float roughness, float NdotL, float NdotV)
{
return (
smithVisibilityG1(NdotL, roughness) *
smithVisibilityG1(NdotV, roughness)
);
}
float GGX(float roughness, float NdotH)
{
float roughnessSquared = roughness * roughness;
float f = (NdotH * roughnessSquared - NdotH) * NdotH + 1.0;
return roughnessSquared / (czm_pi * f * f);
}
/**
* Compute the diffuse and specular contributions using physically based
* rendering. This function only handles direct lighting.
* <p>
* This function only handles the lighting calculations. Metallic/roughness
* and specular/glossy must be handled separately. See {@czm_pbrMetallicRoughnessMaterial}, {@czm_pbrSpecularGlossinessMaterial} and {@czm_defaultPbrMaterial}
* </p>
*
* @name czm_pbrlighting
* @glslFunction
*
* @param {vec3} positionEC The position of the fragment in eye coordinates
* @param {vec3} normalEC The surface normal in eye coordinates
* @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.
* @param {vec3} lightColorHdr radiance of the light source. This is a HDR value.
* @param {czm_pbrParameters} The computed PBR parameters.
* @return {vec3} The computed HDR color
*
* @example
* czm_pbrParameters pbrParameters = czm_pbrMetallicRoughnessMaterial(
* baseColor,
* metallic,
* roughness
* );
* vec3 color = czm_pbrlighting(
* positionEC,
* normalEC,
* lightDirectionEC,
* lightColorHdr,
* pbrParameters);
*/
vec3 czm_pbrLighting(
vec3 positionEC,
vec3 normalEC,
vec3 lightDirectionEC,
vec3 lightColorHdr,
czm_pbrParameters pbrParameters
)
{
vec3 v = -normalize(positionEC);
vec3 l = normalize(lightDirectionEC);
vec3 h = normalize(v + l);
vec3 n = normalEC;
float NdotL = clamp(dot(n, l), 0.001, 1.0);
float NdotV = abs(dot(n, v)) + 0.001;
float NdotH = clamp(dot(n, h), 0.0, 1.0);
float LdotH = clamp(dot(l, h), 0.0, 1.0);
float VdotH = clamp(dot(v, h), 0.0, 1.0);
vec3 f0 = pbrParameters.f0;
float reflectance = max(max(f0.r, f0.g), f0.b);
vec3 f90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0));
vec3 F = fresnelSchlick2(f0, f90, VdotH);
float alpha = pbrParameters.roughness;
float G = smithVisibilityGGX(alpha, NdotL, NdotV);
float D = GGX(alpha, NdotH);
vec3 specularContribution = F * G * D / (4.0 * NdotL * NdotV);
vec3 diffuseColor = pbrParameters.diffuseColor;
// F here represents the specular contribution
vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor);
// Lo = (diffuse + specular) * Li * NdotL
return (diffuseContribution + specularContribution) * NdotL * lightColorHdr;
}
`;var kAt=T(S(),1),gG=`/**
* Compute parameters for physically based rendering using the
* metallic/roughness workflow. All inputs are linear; sRGB texture values must
* be decoded beforehand
*
* @name czm_pbrMetallicRoughnessMaterial
* @glslFunction
*
* @param {vec3} baseColor For dielectrics, this is the base color. For metals, this is the f0 value (reflectance at normal incidence)
* @param {float} metallic 0.0 indicates dielectric. 1.0 indicates metal. Values in between are allowed (e.g. to model rust or dirt);
* @param {float} roughness A value between 0.0 and 1.0
* @return {czm_pbrParameters} parameters to pass into {@link czm_pbrLighting}
*/
czm_pbrParameters czm_pbrMetallicRoughnessMaterial(
vec3 baseColor,
float metallic,
float roughness
)
{
czm_pbrParameters results;
// roughness is authored as perceptual roughness
// square it to get material roughness
roughness = clamp(roughness, 0.0, 1.0);
results.roughness = roughness * roughness;
// dielectrics use f0 = 0.04, metals use albedo as f0
metallic = clamp(metallic, 0.0, 1.0);
const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04);
vec3 f0 = mix(REFLECTANCE_DIELECTRIC, baseColor, metallic);
results.f0 = f0;
// diffuse only applies to dielectrics.
results.diffuseColor = baseColor * (1.0 - f0) * (1.0 - metallic);
return results;
}
`;var BAt=T(S(),1),xG=`/**
* Compute parameters for physically based rendering using the
* specular/glossy workflow. All inputs are linear; sRGB texture values must
* be decoded beforehand
*
* @name czm_pbrSpecularGlossinessMaterial
* @glslFunction
*
* @param {vec3} diffuse The diffuse color for dielectrics (non-metals)
* @param {vec3} specular The reflectance at normal incidence (f0)
* @param {float} glossiness A number from 0.0 to 1.0 indicating how smooth the surface is.
* @return {czm_pbrParameters} parameters to pass into {@link czm_pbrLighting}
*/
czm_pbrParameters czm_pbrSpecularGlossinessMaterial(
vec3 diffuse,
vec3 specular,
float glossiness
)
{
czm_pbrParameters results;
// glossiness is the opposite of roughness, but easier for artists to use.
float roughness = 1.0 - glossiness;
results.roughness = roughness * roughness;
results.diffuseColor = diffuse * (1.0 - max(max(specular.r, specular.g), specular.b));
results.f0 = specular;
return results;
}
`;var YAt=T(S(),1),_G=`float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material)
{
return czm_getLambertDiffuse(lightDirectionEC, material.normal);
}
float czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material)
{
return czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess);
}
/**
* Computes a color using the Phong lighting model.
*
* @name czm_phong
* @glslFunction
*
* @param {vec3} toEye A normalized vector from the fragment to the eye in eye coordinates.
* @param {czm_material} material The fragment's material.
*
* @returns {vec4} The computed color.
*
* @example
* vec3 positionToEyeEC = // ...
* czm_material material = // ...
* vec3 lightDirectionEC = // ...
* out_FragColor = czm_phong(normalize(positionToEyeEC), material, lightDirectionEC);
*
* @see czm_getMaterial
*/
vec4 czm_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC)
{
// Diffuse from directional light sources at eye (for top-down)
float diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material);
if (czm_sceneMode == czm_sceneMode3D) {
// (and horizon views in 3D)
diffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);
}
float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material);
// Temporary workaround for adding ambient.
vec3 materialDiffuse = material.diffuse * 0.5;
vec3 ambient = materialDiffuse;
vec3 color = ambient + material.emission;
color += materialDiffuse * diffuse * czm_lightColor;
color += material.specular * specular * czm_lightColor;
return vec4(color, material.alpha);
}
vec4 czm_private_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC)
{
float diffuse = czm_private_getLambertDiffuseOfMaterial(lightDirectionEC, material);
float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material);
vec3 ambient = vec3(0.0);
vec3 color = ambient + material.emission;
color += material.diffuse * diffuse * czm_lightColor;
color += material.specular * specular * czm_lightColor;
return vec4(color, material.alpha);
}
`;var KAt=T(S(),1),TG=`/**
* Computes distance from a point to a plane.
*
* @name czm_planeDistance
* @glslFunction
*
* param {vec4} plane A Plane in Hessian Normal Form. See Plane.js
* param {vec3} point A point in the same space as the plane.
* returns {float} The distance from the point to the plane.
*/
float czm_planeDistance(vec4 plane, vec3 point) {
return (dot(plane.xyz, point) + plane.w);
}
/**
* Computes distance from a point to a plane.
*
* @name czm_planeDistance
* @glslFunction
*
* param {vec3} planeNormal Normal for a plane in Hessian Normal Form. See Plane.js
* param {float} planeDistance Distance for a plane in Hessian Normal form. See Plane.js
* param {vec3} point A point in the same space as the plane.
* returns {float} The distance from the point to the plane.
*/
float czm_planeDistance(vec3 planeNormal, float planeDistance, vec3 point) {
return (dot(planeNormal, point) + planeDistance);
}
`;var JAt=T(S(),1),SG=`/**
* Computes the point along a ray at the given time. <code>time</code> can be positive, negative, or zero.
*
* @name czm_pointAlongRay
* @glslFunction
*
* @param {czm_ray} ray The ray to compute the point along.
* @param {float} time The time along the ray.
*
* @returns {vec3} The point along the ray at the given time.
*
* @example
* czm_ray ray = czm_ray(vec3(0.0), vec3(1.0, 0.0, 0.0)); // origin, direction
* vec3 v = czm_pointAlongRay(ray, 2.0); // (2.0, 0.0, 0.0)
*/
vec3 czm_pointAlongRay(czm_ray ray, float time)
{
return ray.origin + (time * ray.direction);
}
`;var jAt=T(S(),1),CG=`/**
* DOC_TBA
*
* @name czm_rayEllipsoidIntersectionInterval
* @glslFunction
*/
czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, vec3 ellipsoid_center, vec3 ellipsoid_inverseRadii)
{
// ray and ellipsoid center in eye coordinates. radii in model coordinates.
vec3 q = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz;
vec3 w = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz;
q = q - ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ellipsoid_center, 1.0)).xyz;
float q2 = dot(q, q);
float qw = dot(q, w);
if (q2 > 1.0) // Outside ellipsoid.
{
if (qw >= 0.0) // Looking outward or tangent (0 intersections).
{
return czm_emptyRaySegment;
}
else // qw < 0.0.
{
float qw2 = qw * qw;
float difference = q2 - 1.0; // Positively valued.
float w2 = dot(w, w);
float product = w2 * difference;
if (qw2 < product) // Imaginary roots (0 intersections).
{
return czm_emptyRaySegment;
}
else if (qw2 > product) // Distinct roots (2 intersections).
{
float discriminant = qw * qw - product;
float temp = -qw + sqrt(discriminant); // Avoid cancellation.
float root0 = temp / w2;
float root1 = difference / temp;
if (root0 < root1)
{
czm_raySegment i = czm_raySegment(root0, root1);
return i;
}
else
{
czm_raySegment i = czm_raySegment(root1, root0);
return i;
}
}
else // qw2 == product. Repeated roots (2 intersections).
{
float root = sqrt(difference / w2);
czm_raySegment i = czm_raySegment(root, root);
return i;
}
}
}
else if (q2 < 1.0) // Inside ellipsoid (2 intersections).
{
float difference = q2 - 1.0; // Negatively valued.
float w2 = dot(w, w);
float product = w2 * difference; // Negatively valued.
float discriminant = qw * qw - product;
float temp = -qw + sqrt(discriminant); // Positively valued.
czm_raySegment i = czm_raySegment(0.0, temp / w2);
return i;
}
else // q2 == 1.0. On ellipsoid.
{
if (qw < 0.0) // Looking inward.
{
float w2 = dot(w, w);
czm_raySegment i = czm_raySegment(0.0, -qw / w2);
return i;
}
else // qw >= 0.0. Looking outward or tangent.
{
return czm_emptyRaySegment;
}
}
}
`;var $At=T(S(),1),VG=`/**
* Compute the intersection interval of a ray with a sphere.
*
* @name czm_raySphereIntersectionInterval
* @glslFunction
*
* @param {czm_ray} ray The ray.
* @param {vec3} center The center of the sphere.
* @param {float} radius The radius of the sphere.
* @return {czm_raySegment} The intersection interval of the ray with the sphere.
*/
czm_raySegment czm_raySphereIntersectionInterval(czm_ray ray, vec3 center, float radius)
{
vec3 o = ray.origin;
vec3 d = ray.direction;
vec3 oc = o - center;
float a = dot(d, d);
float b = 2.0 * dot(d, oc);
float c = dot(oc, oc) - (radius * radius);
float det = (b * b) - (4.0 * a * c);
if (det < 0.0) {
return czm_emptyRaySegment;
}
float sqrtDet = sqrt(det);
float t0 = (-b - sqrtDet) / (2.0 * a);
float t1 = (-b + sqrtDet) / (2.0 * a);
czm_raySegment result = czm_raySegment(t0, t1);
return result;
}
`;var tMt=T(S(),1),LG=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords)
{
return czm_reverseLogDepth(texture(depthTexture, texCoords).r);
}
`;var iMt=T(S(),1),RG=`/**
* Reads a value previously transformed with {@link czm_writeNonPerspective}
* by dividing it by \`w\`, the value used in the perspective divide.
* This function is intended to be called in a fragment shader to access a
* \`varying\` that should not be subject to perspective interpolation.
* For example, screen-space texture coordinates. The value should have been
* previously written in the vertex shader with a call to
* {@link czm_writeNonPerspective}.
*
* @name czm_readNonPerspective
* @glslFunction
*
* @param {float|vec2|vec3|vec4} value The non-perspective value to be read.
* @param {float} oneOverW One over the perspective divide value, \`w\`. Usually this is simply \`gl_FragCoord.w\`.
* @returns {float|vec2|vec3|vec4} The usable value.
*/
float czm_readNonPerspective(float value, float oneOverW) {
return value * oneOverW;
}
vec2 czm_readNonPerspective(vec2 value, float oneOverW) {
return value * oneOverW;
}
vec3 czm_readNonPerspective(vec3 value, float oneOverW) {
return value * oneOverW;
}
vec4 czm_readNonPerspective(vec4 value, float oneOverW) {
return value * oneOverW;
}
`;var rMt=T(S(),1),ZG=`float czm_reverseLogDepth(float logZ)
{
#ifdef LOG_DEPTH
float near = czm_currentFrustum.x;
float far = czm_currentFrustum.y;
float log2Depth = logZ * czm_log2FarDepthFromNearPlusOne;
float depthFromNear = pow(2.0, log2Depth) - 1.0;
return far * (1.0 - near / (depthFromNear + near)) / (far - near);
#endif
return logZ;
}
`;var aMt=T(S(),1),GG=`/**
* Converts an RGB color to HSB (hue, saturation, brightness)
* HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl}
*
* @name czm_RGBToHSB
* @glslFunction
*
* @param {vec3} rgb The color in RGB.
*
* @returns {vec3} The color in HSB.
*
* @example
* vec3 hsb = czm_RGBToHSB(rgb);
* hsb.z *= 0.1;
* rgb = czm_HSBToRGB(hsb);
*/
const vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
vec3 czm_RGBToHSB(vec3 rgb)
{
vec4 p = mix(vec4(rgb.bg, K_RGB2HSB.wz), vec4(rgb.gb, K_RGB2HSB.xy), step(rgb.b, rgb.g));
vec4 q = mix(vec4(p.xyw, rgb.r), vec4(rgb.r, p.yzx), step(p.x, rgb.r));
float d = q.x - min(q.w, q.y);
return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + czm_epsilon7)), d / (q.x + czm_epsilon7), q.x);
}
`;var lMt=T(S(),1),EG=`/**
* Converts an RGB color to HSL (hue, saturation, lightness)
* HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html}
*
* @name czm_RGBToHSL
* @glslFunction
*
* @param {vec3} rgb The color in RGB.
*
* @returns {vec3} The color in HSL.
*
* @example
* vec3 hsl = czm_RGBToHSL(rgb);
* hsl.z *= 0.1;
* rgb = czm_HSLToRGB(hsl);
*/
vec3 RGBtoHCV(vec3 rgb)
{
// Based on work by Sam Hocevar and Emil Persson
vec4 p = (rgb.g < rgb.b) ? vec4(rgb.bg, -1.0, 2.0 / 3.0) : vec4(rgb.gb, 0.0, -1.0 / 3.0);
vec4 q = (rgb.r < p.x) ? vec4(p.xyw, rgb.r) : vec4(rgb.r, p.yzx);
float c = q.x - min(q.w, q.y);
float h = abs((q.w - q.y) / (6.0 * c + czm_epsilon7) + q.z);
return vec3(h, c, q.x);
}
vec3 czm_RGBToHSL(vec3 rgb)
{
vec3 hcv = RGBtoHCV(rgb);
float l = hcv.z - hcv.y * 0.5;
float s = hcv.y / (1.0 - abs(l * 2.0 - 1.0) + czm_epsilon7);
return vec3(hcv.x, s, l);
}
`;var uMt=T(S(),1),IG=`/**
* Converts an RGB color to CIE Yxy.
* <p>The conversion is described in
* {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform}
* </p>
*
* @name czm_RGBToXYZ
* @glslFunction
*
* @param {vec3} rgb The color in RGB.
*
* @returns {vec3} The color in CIE Yxy.
*
* @example
* vec3 xyz = czm_RGBToXYZ(rgb);
* xyz.x = max(xyz.x - luminanceThreshold, 0.0);
* rgb = czm_XYZToRGB(xyz);
*/
vec3 czm_RGBToXYZ(vec3 rgb)
{
const mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193,
0.3576, 0.7152, 0.1192,
0.1805, 0.0722, 0.9505);
vec3 xyz = RGB2XYZ * rgb;
vec3 Yxy;
Yxy.r = xyz.g;
float temp = dot(vec3(1.0), xyz);
Yxy.gb = xyz.rg / temp;
return Yxy;
}
`;var hMt=T(S(),1),XG=`/**
* Round a floating point value. This function exists because round() doesn't
* exist in GLSL 1.00.
*
* @param {float|vec2|vec3|vec4} value The value to round
* @param {float|vec2|vec3|vec3} The rounded value. The type matches the input.
*/
float czm_round(float value) {
return floor(value + 0.5);
}
vec2 czm_round(vec2 value) {
return floor(value + 0.5);
}
vec3 czm_round(vec3 value) {
return floor(value + 0.5);
}
vec4 czm_round(vec4 value) {
return floor(value + 0.5);
}
`;var pMt=T(S(),1),WG=`/**
* Samples the 4 neighboring pixels and return the weighted average.
*
* @private
*/
vec3 czm_sampleOctahedralProjectionWithFiltering(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod)
{
direction /= dot(vec3(1.0), abs(direction));
vec2 rev = abs(direction.zx) - vec2(1.0);
vec2 neg = vec2(direction.x < 0.0 ? rev.x : -rev.x,
direction.z < 0.0 ? rev.y : -rev.y);
vec2 uv = direction.y < 0.0 ? neg : direction.xz;
vec2 coord = 0.5 * uv + vec2(0.5);
vec2 pixel = 1.0 / textureSize;
if (lod > 0.0)
{
// Each subseqeuent mip level is half the size
float scale = 1.0 / pow(2.0, lod);
float offset = ((textureSize.y + 1.0) / textureSize.x);
coord.x *= offset;
coord *= scale;
coord.x += offset + pixel.x;
coord.y += (1.0 - (1.0 / pow(2.0, lod - 1.0))) + pixel.y * (lod - 1.0) * 2.0;
}
else
{
coord.x *= (textureSize.y / textureSize.x);
}
// Do bilinear filtering
#ifndef OES_texture_float_linear
vec3 color1 = texture(projectedMap, coord + vec2(0.0, pixel.y)).rgb;
vec3 color2 = texture(projectedMap, coord + vec2(pixel.x, 0.0)).rgb;
vec3 color3 = texture(projectedMap, coord + pixel).rgb;
vec3 color4 = texture(projectedMap, coord).rgb;
vec2 texturePosition = coord * textureSize;
float fu = fract(texturePosition.x);
float fv = fract(texturePosition.y);
vec3 average1 = mix(color4, color2, fu);
vec3 average2 = mix(color1, color3, fu);
vec3 color = mix(average1, average2, fv);
#else
vec3 color = texture(projectedMap, coord).rgb;
#endif
return color;
}
/**
* Samples from a cube map that has been projected using an octahedral projection from the given direction.
*
* @name czm_sampleOctahedralProjection
* @glslFunction
*
* @param {sampler2D} projectedMap The texture with the octahedral projected cube map.
* @param {vec2} textureSize The width and height dimensions in pixels of the projected map.
* @param {vec3} direction The normalized direction used to sample the cube map.
* @param {float} lod The level of detail to sample.
* @param {float} maxLod The maximum level of detail.
* @returns {vec3} The color of the cube map at the direction.
*/
vec3 czm_sampleOctahedralProjection(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod, float maxLod) {
float currentLod = floor(lod + 0.5);
float nextLod = min(currentLod + 1.0, maxLod);
vec3 colorCurrentLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, currentLod);
vec3 colorNextLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, nextLod);
return mix(colorNextLod, colorCurrentLod, nextLod - lod);
}
`;var yMt=T(S(),1),PG=`/**
* Adjusts the saturation of a color.
*
* @name czm_saturation
* @glslFunction
*
* @param {vec3} rgb The color.
* @param {float} adjustment The amount to adjust the saturation of the color.
*
* @returns {float} The color with the saturation adjusted.
*
* @example
* vec3 greyScale = czm_saturation(color, 0.0);
* vec3 doubleSaturation = czm_saturation(color, 2.0);
*/
vec3 czm_saturation(vec3 rgb, float adjustment)
{
// Algorithm from Chapter 16 of OpenGL Shading Language
const vec3 W = vec3(0.2125, 0.7154, 0.0721);
vec3 intensity = vec3(dot(rgb, W));
return mix(intensity, rgb, adjustment);
}
`;var xMt=T(S(),1),vG=`
float czm_sampleShadowMap(highp samplerCube shadowMap, vec3 d)
{
return czm_unpackDepth(czm_textureCube(shadowMap, d));
}
float czm_sampleShadowMap(highp sampler2D shadowMap, vec2 uv)
{
#ifdef USE_SHADOW_DEPTH_TEXTURE
return texture(shadowMap, uv).r;
#else
return czm_unpackDepth(texture(shadowMap, uv));
#endif
}
float czm_shadowDepthCompare(samplerCube shadowMap, vec3 uv, float depth)
{
return step(depth, czm_sampleShadowMap(shadowMap, uv));
}
float czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth)
{
return step(depth, czm_sampleShadowMap(shadowMap, uv));
}
`;var TMt=T(S(),1),wG=`
float czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness)
{
#ifdef USE_NORMAL_SHADING
#ifdef USE_NORMAL_SHADING_SMOOTH
float strength = clamp(nDotL / normalShadingSmooth, 0.0, 1.0);
#else
float strength = step(0.0, nDotL);
#endif
visibility *= strength;
#endif
visibility = max(visibility, darkness);
return visibility;
}
#ifdef USE_CUBE_MAP_SHADOW
float czm_shadowVisibility(samplerCube shadowMap, czm_shadowParameters shadowParameters)
{
float depthBias = shadowParameters.depthBias;
float depth = shadowParameters.depth;
float nDotL = shadowParameters.nDotL;
float normalShadingSmooth = shadowParameters.normalShadingSmooth;
float darkness = shadowParameters.darkness;
vec3 uvw = shadowParameters.texCoords;
depth -= depthBias;
float visibility = czm_shadowDepthCompare(shadowMap, uvw, depth);
return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);
}
#else
float czm_shadowVisibility(sampler2D shadowMap, czm_shadowParameters shadowParameters)
{
float depthBias = shadowParameters.depthBias;
float depth = shadowParameters.depth;
float nDotL = shadowParameters.nDotL;
float normalShadingSmooth = shadowParameters.normalShadingSmooth;
float darkness = shadowParameters.darkness;
vec2 uv = shadowParameters.texCoords;
depth -= depthBias;
#ifdef USE_SOFT_SHADOWS
vec2 texelStepSize = shadowParameters.texelStepSize;
float radius = 1.0;
float dx0 = -texelStepSize.x * radius;
float dy0 = -texelStepSize.y * radius;
float dx1 = texelStepSize.x * radius;
float dy1 = texelStepSize.y * radius;
float visibility = (
czm_shadowDepthCompare(shadowMap, uv, depth) +
czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy0), depth) +
czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy0), depth) +
czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy0), depth) +
czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, 0.0), depth) +
czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, 0.0), depth) +
czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy1), depth) +
czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy1), depth) +
czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy1), depth)
) * (1.0 / 9.0);
#else
float visibility = czm_shadowDepthCompare(shadowMap, uv, depth);
#endif
return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);
}
#endif
`;var CMt=T(S(),1),FG=`/**
* Returns 1.0 if the given value is positive or zero, and -1.0 if it is negative. This is similar to the GLSL
* built-in function <code>sign</code> except that returns 1.0 instead of 0.0 when the input value is 0.0.
*
* @name czm_signNotZero
* @glslFunction
*
* @param {} value The value for which to determine the sign.
* @returns {} 1.0 if the value is positive or zero, -1.0 if the value is negative.
*/
float czm_signNotZero(float value)
{
return value >= 0.0 ? 1.0 : -1.0;
}
vec2 czm_signNotZero(vec2 value)
{
return vec2(czm_signNotZero(value.x), czm_signNotZero(value.y));
}
vec3 czm_signNotZero(vec3 value)
{
return vec3(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z));
}
vec4 czm_signNotZero(vec4 value)
{
return vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w));
}
`;var LMt=T(S(),1),AG=`/**
* Computes a color from the third order spherical harmonic coefficients and a normalized direction vector.
* <p>
* The order of the coefficients is [L00, L1_1, L10, L11, L2_2, L2_1, L20, L21, L22].
* </p>
*
* @name czm_sphericalHarmonics
* @glslFunction
*
* @param {vec3} normal The normalized direction.
* @param {vec3[9]} coefficients The third order spherical harmonic coefficients.
* @returns {vec3} The color at the direction.
*
* @see https://graphics.stanford.edu/papers/envmap/envmap.pdf
*/
vec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9])
{
vec3 L00 = coefficients[0];
vec3 L1_1 = coefficients[1];
vec3 L10 = coefficients[2];
vec3 L11 = coefficients[3];
vec3 L2_2 = coefficients[4];
vec3 L2_1 = coefficients[5];
vec3 L20 = coefficients[6];
vec3 L21 = coefficients[7];
vec3 L22 = coefficients[8];
float x = normal.x;
float y = normal.y;
float z = normal.z;
return
L00
+ L1_1 * y
+ L10 * z
+ L11 * x
+ L2_2 * (y * x)
+ L2_1 * (y * z)
+ L20 * (3.0 * z * z - 1.0)
+ L21 * (z * x)
+ L22 * (x * x - y * y);
}
`;var ZMt=T(S(),1),MG=`/**
* Converts an sRGB color to a linear RGB color.
*
* @param {vec3|vec4} srgbIn The color in sRGB space
* @returns {vec3|vec4} The color in linear color space. The vector type matches the input.
*/
vec3 czm_srgbToLinear(vec3 srgbIn)
{
return pow(srgbIn, vec3(2.2));
}
vec4 czm_srgbToLinear(vec4 srgbIn)
{
vec3 linearOut = pow(srgbIn.rgb, vec3(2.2));
return vec4(linearOut, srgbIn.a);
}
`;var EMt=T(S(),1),NG=`/**
* Creates a matrix that transforms vectors from tangent space to eye space.
*
* @name czm_tangentToEyeSpaceMatrix
* @glslFunction
*
* @param {vec3} normalEC The normal vector in eye coordinates.
* @param {vec3} tangentEC The tangent vector in eye coordinates.
* @param {vec3} bitangentEC The bitangent vector in eye coordinates.
*
* @returns {mat3} The matrix that transforms from tangent space to eye space.
*
* @example
* mat3 tangentToEye = czm_tangentToEyeSpaceMatrix(normalEC, tangentEC, bitangentEC);
* vec3 normal = tangentToEye * texture(normalMap, st).xyz;
*/
mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC)
{
vec3 normal = normalize(normalEC);
vec3 tangent = normalize(tangentEC);
vec3 bitangent = normalize(bitangentEC);
return mat3(tangent.x , tangent.y , tangent.z,
bitangent.x, bitangent.y, bitangent.z,
normal.x , normal.y , normal.z);
}
`;var XMt=T(S(),1),UG=`/**
* A wrapper around the texture (WebGL2) / textureCube (WebGL1)
* function to allow for WebGL 1 support.
*
* @name czm_textureCube
* @glslFunction
*
* @param {samplerCube} sampler The sampler.
* @param {vec3} p The coordinates to sample the texture at.
*/
vec4 czm_textureCube(samplerCube sampler, vec3 p) {
#if __VERSION__ == 300
return texture(sampler, p);
#else
return textureCube(sampler, p);
#endif
}`;var PMt=T(S(),1),kG=`/**
* Transforms a plane.
*
* @name czm_transformPlane
* @glslFunction
*
* @param {vec4} plane The plane in Hessian Normal Form.
* @param {mat4} transform The inverse-transpose of a transformation matrix.
*/
vec4 czm_transformPlane(vec4 plane, mat4 transform) {
vec4 transformedPlane = transform * plane;
// Convert the transformed plane to Hessian Normal Form
float normalMagnitude = length(transformedPlane.xyz);
return transformedPlane / normalMagnitude;
}
`;var wMt=T(S(),1),DG=`/**
* Translates a position (or any <code>vec3</code>) that was encoded with {@link EncodedCartesian3},
* and then provided to the shader as separate <code>high</code> and <code>low</code> bits to
* be relative to the eye. As shown in the example, the position can then be transformed in eye
* or clip coordinates using {@link czm_modelViewRelativeToEye} or {@link czm_modelViewProjectionRelativeToEye},
* respectively.
* <p>
* This technique, called GPU RTE, eliminates jittering artifacts when using large coordinates as
* described in {@link http://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}.
* </p>
*
* @name czm_translateRelativeToEye
* @glslFunction
*
* @param {vec3} high The position's high bits.
* @param {vec3} low The position's low bits.
* @returns {vec3} The position translated to be relative to the camera's position.
*
* @example
* in vec3 positionHigh;
* in vec3 positionLow;
*
* void main()
* {
* vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
* gl_Position = czm_modelViewProjectionRelativeToEye * p;
* }
*
* @see czm_modelViewRelativeToEye
* @see czm_modelViewProjectionRelativeToEye
* @see czm_computePosition
* @see EncodedCartesian3
*/
vec4 czm_translateRelativeToEye(vec3 high, vec3 low)
{
vec3 highDifference = high - czm_encodedCameraPositionMCHigh;
// This check handles the case when NaN values have gotten into \`highDifference\`.
// Such a thing could happen on devices running iOS.
if (length(highDifference) == 0.0) {
highDifference = vec3(0);
}
vec3 lowDifference = low - czm_encodedCameraPositionMCLow;
return vec4(highDifference + lowDifference, 1.0);
}
`;var AMt=T(S(),1),BG=`/**
* @private
*/
vec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC)
{
// Diffuse from directional light sources at eye (for top-down and horizon views)
float diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal);
if (czm_sceneMode == czm_sceneMode3D) {
// (and horizon views in 3D)
diffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal);
}
diffuse = clamp(diffuse, 0.0, 1.0);
float specular = czm_getSpecular(lightDirectionEC, toEye, material.normal, material.shininess);
// Temporary workaround for adding ambient.
vec3 materialDiffuse = material.diffuse * 0.5;
vec3 ambient = materialDiffuse;
vec3 color = ambient + material.emission;
color += materialDiffuse * diffuse * czm_lightColor;
color += material.specular * specular * czm_lightColor;
return vec4(color, material.alpha);
}
`;var NMt=T(S(),1),OG=`/**
* Returns the transpose of the matrix. The input <code>matrix</code> can be
* a <code>mat2</code>, <code>mat3</code>, or <code>mat4</code>.
*
* @name czm_transpose
* @glslFunction
*
* @param {} matrix The matrix to transpose.
*
* @returns {} The transposed matrix.
*
* @example
* // GLSL declarations
* mat2 czm_transpose(mat2 matrix);
* mat3 czm_transpose(mat3 matrix);
* mat4 czm_transpose(mat4 matrix);
*
* // Transpose a 3x3 rotation matrix to find its inverse.
* mat3 eastNorthUpToEye = czm_eastNorthUpToEyeCoordinates(
* positionMC, normalEC);
* mat3 eyeToEastNorthUp = czm_transpose(eastNorthUpToEye);
*/
mat2 czm_transpose(mat2 matrix)
{
return mat2(
matrix[0][0], matrix[1][0],
matrix[0][1], matrix[1][1]);
}
mat3 czm_transpose(mat3 matrix)
{
return mat3(
matrix[0][0], matrix[1][0], matrix[2][0],
matrix[0][1], matrix[1][1], matrix[2][1],
matrix[0][2], matrix[1][2], matrix[2][2]);
}
mat4 czm_transpose(mat4 matrix)
{
return mat4(
matrix[0][0], matrix[1][0], matrix[2][0], matrix[3][0],
matrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1],
matrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2],
matrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]);
}
`;var kMt=T(S(),1),YG=`/**
* Unpacks a vec4 depth value to a float in [0, 1) range.
*
* @name czm_unpackDepth
* @glslFunction
*
* @param {vec4} packedDepth The packed depth.
*
* @returns {float} The floating-point depth in [0, 1) range.
*/
float czm_unpackDepth(vec4 packedDepth)
{
// See Aras Pranckevi\u010Dius' post Encoding Floats to RGBA
// http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/
return dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0));
}
`;var BMt=T(S(),1),HG=`/**
* Unpack an IEEE 754 single-precision float that is packed as a little-endian unsigned normalized vec4.
*
* @name czm_unpackFloat
* @glslFunction
*
* @param {vec4} packedFloat The packed float.
*
* @returns {float} The floating-point depth in arbitrary range.
*/
float czm_unpackFloat(vec4 packedFloat)
{
// Convert to [0.0, 255.0] and round to integer
packedFloat = floor(packedFloat * 255.0 + 0.5);
float sign = 1.0 - step(128.0, packedFloat[3]) * 2.0;
float exponent = 2.0 * mod(packedFloat[3], 128.0) + step(128.0, packedFloat[2]) - 127.0;
if (exponent == -127.0)
{
return 0.0;
}
float mantissa = mod(packedFloat[2], 128.0) * 65536.0 + packedFloat[1] * 256.0 + packedFloat[0] + float(0x800000);
float result = sign * exp2(exponent - 23.0) * mantissa;
return result;
}
`;var YMt=T(S(),1),KG=`/**
* Unpack unsigned integers of 1-4 bytes. in WebGL 1, there is no uint type,
* so the return value is an int.
* <p>
* There are also precision limitations in WebGL 1. highp int is still limited
* to 24 bits. Above the value of 2^24 = 16777216, precision loss may occur.
* </p>
*
* @param {float|vec2|vec3|vec4} packed The packed value. For vectors, the components are listed in little-endian order.
*
* @return {int} The unpacked value.
*/
int czm_unpackUint(float packedValue) {
float rounded = czm_round(packedValue * 255.0);
return int(rounded);
}
int czm_unpackUint(vec2 packedValue) {
vec2 rounded = czm_round(packedValue * 255.0);
return int(dot(rounded, vec2(1.0, 256.0)));
}
int czm_unpackUint(vec3 packedValue) {
vec3 rounded = czm_round(packedValue * 255.0);
return int(dot(rounded, vec3(1.0, 256.0, 65536.0)));
}
int czm_unpackUint(vec4 packedValue) {
vec4 rounded = czm_round(packedValue * 255.0);
return int(dot(rounded, vec4(1.0, 256.0, 65536.0, 16777216.0)));
}
`;var KMt=T(S(),1),zG=`/**
* Transform metadata values following the EXT_structural_metadata spec
* by multiplying by scale and adding the offset. Operations are always
* performed component-wise, even for matrices.
*
* @param {float|vec2|vec3|vec4|mat2|mat3|mat4} offset The offset to add
* @param {float|vec2|vec3|vec4|mat2|mat3|mat4} scale The scale factor to multiply
* @param {float|vec2|vec3|vec4|mat2|mat3|mat4} value The original value.
*
* @return {float|vec2|vec3|vec4|mat2|mat3|mat4} The transformed value of the same scalar/vector/matrix type as the input.
*/
float czm_valueTransform(float offset, float scale, float value) {
return scale * value + offset;
}
vec2 czm_valueTransform(vec2 offset, vec2 scale, vec2 value) {
return scale * value + offset;
}
vec3 czm_valueTransform(vec3 offset, vec3 scale, vec3 value) {
return scale * value + offset;
}
vec4 czm_valueTransform(vec4 offset, vec4 scale, vec4 value) {
return scale * value + offset;
}
mat2 czm_valueTransform(mat2 offset, mat2 scale, mat2 value) {
return matrixCompMult(scale, value) + offset;
}
mat3 czm_valueTransform(mat3 offset, mat3 scale, mat3 value) {
return matrixCompMult(scale, value) + offset;
}
mat4 czm_valueTransform(mat4 offset, mat4 scale, mat4 value) {
return matrixCompMult(scale, value) + offset;
}
`;var JMt=T(S(),1),JG=`#ifdef LOG_DEPTH
// 1.0 at the near plane, increasing linearly from there.
out float v_depthFromNearPlusOne;
#ifdef SHADOW_MAP
out vec3 v_logPositionEC;
#endif
#endif
vec4 czm_updatePositionDepth(vec4 coords) {
#if defined(LOG_DEPTH)
#ifdef SHADOW_MAP
vec3 logPositionEC = (czm_inverseProjection * coords).xyz;
v_logPositionEC = logPositionEC;
#endif
// With the very high far/near ratios used with the logarithmic depth
// buffer, floating point rounding errors can cause linear depth values
// to end up on the wrong side of the far plane, even for vertices that
// are really nowhere near it. Since we always write a correct logarithmic
// depth value in the fragment shader anyway, we just need to make sure
// such errors don't cause the primitive to be clipped entirely before
// we even get to the fragment shader.
coords.z = clamp(coords.z / coords.w, -1.0, 1.0) * coords.w;
#endif
return coords;
}
/**
* Writes the logarithmic depth to gl_Position using the already computed gl_Position.
*
* @name czm_vertexLogDepth
* @glslFunction
*/
void czm_vertexLogDepth()
{
#ifdef LOG_DEPTH
v_depthFromNearPlusOne = (gl_Position.w - czm_currentFrustum.x) + 1.0;
gl_Position = czm_updatePositionDepth(gl_Position);
#endif
}
/**
* Writes the logarithmic depth to gl_Position using the provided clip coordinates.
* <p>
* An example use case for this function would be moving the vertex in window coordinates
* before converting back to clip coordinates. Use the original vertex clip coordinates.
* </p>
* @name czm_vertexLogDepth
* @glslFunction
*
* @param {vec4} clipCoords The vertex in clip coordinates.
*
* @example
* czm_vertexLogDepth(czm_projection * vec4(positionEyeCoordinates, 1.0));
*/
void czm_vertexLogDepth(vec4 clipCoords)
{
#ifdef LOG_DEPTH
v_depthFromNearPlusOne = (clipCoords.w - czm_currentFrustum.x) + 1.0;
czm_updatePositionDepth(clipCoords);
#endif
}
`;var jMt=T(S(),1),QG=`vec4 czm_screenToEyeCoordinates(vec4 screenCoordinate)
{
// Reconstruct NDC coordinates
float x = 2.0 * screenCoordinate.x - 1.0;
float y = 2.0 * screenCoordinate.y - 1.0;
float z = (screenCoordinate.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];
vec4 q = vec4(x, y, z, 1.0);
// Reverse the perspective division to obtain clip coordinates.
q /= screenCoordinate.w;
// Reverse the projection transformation to obtain eye coordinates.
if (!(czm_inverseProjection == mat4(0.0))) // IE and Edge sometimes do something weird with != between mat4s
{
q = czm_inverseProjection * q;
}
else
{
float top = czm_frustumPlanes.x;
float bottom = czm_frustumPlanes.y;
float left = czm_frustumPlanes.z;
float right = czm_frustumPlanes.w;
float near = czm_currentFrustum.x;
float far = czm_currentFrustum.y;
q.x = (q.x * (right - left) + left + right) * 0.5;
q.y = (q.y * (top - bottom) + bottom + top) * 0.5;
q.z = (q.z * (near - far) - near - far) * 0.5;
q.w = 1.0;
}
return q;
}
/**
* Transforms a position from window to eye coordinates.
* The transform from window to normalized device coordinates is done using components
* of (@link czm_viewport} and {@link czm_viewportTransformation} instead of calculating
* the inverse of <code>czm_viewportTransformation</code>. The transformation from
* normalized device coordinates to clip coordinates is done using <code>fragmentCoordinate.w</code>,
* which is expected to be the scalar used in the perspective divide. The transformation
* from clip to eye coordinates is done using {@link czm_inverseProjection}.
*
* @name czm_windowToEyeCoordinates
* @glslFunction
*
* @param {vec4} fragmentCoordinate The position in window coordinates to transform.
*
* @returns {vec4} The transformed position in eye coordinates.
*
* @see czm_modelToWindowCoordinates
* @see czm_eyeToWindowCoordinates
* @see czm_inverseProjection
* @see czm_viewport
* @see czm_viewportTransformation
*
* @example
* vec4 positionEC = czm_windowToEyeCoordinates(gl_FragCoord);
*/
vec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate)
{
vec2 screenCoordXY = (fragmentCoordinate.xy - czm_viewport.xy) / czm_viewport.zw;
return czm_screenToEyeCoordinates(vec4(screenCoordXY, fragmentCoordinate.zw));
}
vec4 czm_screenToEyeCoordinates(vec2 screenCoordinateXY, float depthOrLogDepth)
{
// See reverseLogDepth.glsl. This is separate to re-use the pow.
#if defined(LOG_DEPTH) || defined(LOG_DEPTH_READ_ONLY)
float near = czm_currentFrustum.x;
float far = czm_currentFrustum.y;
float log2Depth = depthOrLogDepth * czm_log2FarDepthFromNearPlusOne;
float depthFromNear = pow(2.0, log2Depth) - 1.0;
float depthFromCamera = depthFromNear + near;
vec4 screenCoord = vec4(screenCoordinateXY, far * (1.0 - near / depthFromCamera) / (far - near), 1.0);
vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord);
eyeCoordinate.w = 1.0 / depthFromCamera; // Better precision
return eyeCoordinate;
#else
vec4 screenCoord = vec4(screenCoordinateXY, depthOrLogDepth, 1.0);
vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord);
#endif
return eyeCoordinate;
}
/**
* Transforms a position given as window x/y and a depth or a log depth from window to eye coordinates.
* This function produces more accurate results for window positions with log depth than
* conventionally unpacking the log depth using czm_reverseLogDepth and using the standard version
* of czm_windowToEyeCoordinates.
*
* @name czm_windowToEyeCoordinates
* @glslFunction
*
* @param {vec2} fragmentCoordinateXY The XY position in window coordinates to transform.
* @param {float} depthOrLogDepth A depth or log depth for the fragment.
*
* @see czm_modelToWindowCoordinates
* @see czm_eyeToWindowCoordinates
* @see czm_inverseProjection
* @see czm_viewport
* @see czm_viewportTransformation
*
* @returns {vec4} The transformed position in eye coordinates.
*/
vec4 czm_windowToEyeCoordinates(vec2 fragmentCoordinateXY, float depthOrLogDepth)
{
vec2 screenCoordXY = (fragmentCoordinateXY.xy - czm_viewport.xy) / czm_viewport.zw;
return czm_screenToEyeCoordinates(screenCoordXY, depthOrLogDepth);
}
`;var $Mt=T(S(),1),jG=`// emulated noperspective
#if !defined(LOG_DEPTH)
in float v_WindowZ;
#endif
/**
* Emulates GL_DEPTH_CLAMP. Clamps a fragment to the near and far plane
* by writing the fragment's depth. See czm_depthClamp for more details.
*
* @name czm_writeDepthClamp
* @glslFunction
*
* @example
* out_FragColor = color;
* czm_writeDepthClamp();
*
* @see czm_depthClamp
*/
void czm_writeDepthClamp()
{
#if (!defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth)))
gl_FragDepth = clamp(v_WindowZ * gl_FragCoord.w, 0.0, 1.0);
#endif
}
`;var tNt=T(S(),1),qG=`#ifdef LOG_DEPTH
in float v_depthFromNearPlusOne;
#ifdef POLYGON_OFFSET
uniform vec2 u_polygonOffset;
#endif
#endif
/**
* Writes the fragment depth to the logarithmic depth buffer.
* <p>
* Use this when the vertex shader does not call {@link czm_vertexlogDepth}, for example, when
* ray-casting geometry using a full screen quad.
* </p>
* @name czm_writeLogDepth
* @glslFunction
*
* @param {float} depth The depth coordinate, where 1.0 is on the near plane and
* depth increases in eye-space units from there
*
* @example
* czm_writeLogDepth((czm_projection * v_positionEyeCoordinates).w + 1.0);
*/
void czm_writeLogDepth(float depth)
{
#if (defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth)))
// Discard the vertex if it's not between the near and far planes.
// We allow a bit of epsilon on the near plane comparison because a 1.0
// from the vertex shader (indicating the vertex should be _on_ the near
// plane) will not necessarily come here as exactly 1.0.
if (depth <= 0.9999999 || depth > czm_farDepthFromNearPlusOne) {
discard;
}
#ifdef POLYGON_OFFSET
// Polygon offset: m * factor + r * units
float factor = u_polygonOffset[0];
float units = u_polygonOffset[1];
#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
// This factor doesn't work in IE 10
if (factor != 0.0) {
// m = sqrt(dZdX^2 + dZdY^2);
float x = dFdx(depth);
float y = dFdy(depth);
float m = sqrt(x * x + y * y);
// Apply the factor before computing the log depth.
depth += m * factor;
}
#endif
#endif
gl_FragDepth = log2(depth) * czm_oneOverLog2FarDepthFromNearPlusOne;
#ifdef POLYGON_OFFSET
// Apply the units after the log depth.
gl_FragDepth += czm_epsilon7 * units;
#endif
#endif
}
/**
* Writes the fragment depth to the logarithmic depth buffer.
* <p>
* Use this when the vertex shader calls {@link czm_vertexlogDepth}.
* </p>
*
* @name czm_writeLogDepth
* @glslFunction
*/
void czm_writeLogDepth() {
#ifdef LOG_DEPTH
czm_writeLogDepth(v_depthFromNearPlusOne);
#endif
}
`;var iNt=T(S(),1),$G=`/**
* Transforms a value for non-perspective interpolation by multiplying
* it by w, the value used in the perspective divide. This function is
* intended to be called in a vertex shader to compute the value of a
* \`varying\` that should not be subject to perspective interpolation.
* For example, screen-space texture coordinates. The fragment shader
* must call {@link czm_readNonPerspective} to retrieve the final
* non-perspective value.
*
* @name czm_writeNonPerspective
* @glslFunction
*
* @param {float|vec2|vec3|vec4} value The value to be interpolated without accounting for perspective.
* @param {float} w The perspective divide value. Usually this is the computed \`gl_Position.w\`.
* @returns {float|vec2|vec3|vec4} The transformed value, intended to be stored in a \`varying\` and read in the
* fragment shader with {@link czm_readNonPerspective}.
*/
float czm_writeNonPerspective(float value, float w) {
return value * w;
}
vec2 czm_writeNonPerspective(vec2 value, float w) {
return value * w;
}
vec3 czm_writeNonPerspective(vec3 value, float w) {
return value * w;
}
vec4 czm_writeNonPerspective(vec4 value, float w) {
return value * w;
}
`;var rNt=T(S(),1),eE=`/**
* Converts a CIE Yxy color to RGB.
* <p>The conversion is described in
* {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform}
* </p>
*
* @name czm_XYZToRGB
* @glslFunction
*
* @param {vec3} Yxy The color in CIE Yxy.
*
* @returns {vec3} The color in RGB.
*
* @example
* vec3 xyz = czm_RGBToXYZ(rgb);
* xyz.x = max(xyz.x - luminanceThreshold, 0.0);
* rgb = czm_XYZToRGB(xyz);
*/
vec3 czm_XYZToRGB(vec3 Yxy)
{
const mat3 XYZ2RGB = mat3( 3.2405, -0.9693, 0.0556,
-1.5371, 1.8760, -0.2040,
-0.4985, 0.0416, 1.0572);
vec3 xyz;
xyz.r = Yxy.r * Yxy.g / Yxy.b;
xyz.g = Yxy.r;
xyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b;
return XYZ2RGB * xyz;
}
`;var ix={czm_degreesPerRadian:RR,czm_depthRange:ZR,czm_epsilon1:GR,czm_epsilon2:ER,czm_epsilon3:IR,czm_epsilon4:XR,czm_epsilon5:WR,czm_epsilon6:PR,czm_epsilon7:vR,czm_infinity:wR,czm_oneOverPi:FR,czm_oneOverTwoPi:AR,czm_passCesium3DTile:MR,czm_passCesium3DTileClassification:NR,czm_passCesium3DTileClassificationIgnoreShow:UR,czm_passClassification:kR,czm_passCompute:DR,czm_passEnvironment:BR,czm_passGlobe:OR,czm_passOpaque:YR,czm_passOverlay:HR,czm_passTerrainClassification:KR,czm_passTranslucent:zR,czm_passVoxels:JR,czm_pi:QR,czm_piOverFour:jR,czm_piOverSix:qR,czm_piOverThree:$R,czm_piOverTwo:eZ,czm_radiansPerDegree:tZ,czm_sceneMode2D:nZ,czm_sceneMode3D:iZ,czm_sceneModeColumbusView:oZ,czm_sceneModeMorphing:rZ,czm_solarRadius:sZ,czm_threePiOver2:aZ,czm_twoPi:cZ,czm_webMercatorMaxLatitude:lZ,czm_depthRangeStruct:dZ,czm_material:uZ,czm_materialInput:mZ,czm_modelMaterial:hZ,czm_modelVertexOutput:fZ,czm_pbrParameters:pZ,czm_ray:bZ,czm_raySegment:yZ,czm_shadowParameters:gZ,czm_acesTonemapping:xZ,czm_alphaWeight:_Z,czm_antialias:TZ,czm_applyHSBShift:SZ,czm_approximateSphericalCoordinates:CZ,czm_approximateTanh:VZ,czm_backFacing:LZ,czm_branchFreeTernary:RZ,czm_cascadeColor:ZZ,czm_cascadeDistance:GZ,czm_cascadeMatrix:EZ,czm_cascadeWeights:IZ,czm_columbusViewMorph:XZ,czm_computeAtmosphereColor:WZ,czm_computeGroundAtmosphereScattering:PZ,czm_computePosition:vZ,czm_computeScattering:wZ,czm_cosineAndSine:FZ,czm_decompressTextureCoordinates:AZ,czm_defaultPbrMaterial:MZ,czm_depthClamp:NZ,czm_eastNorthUpToEyeCoordinates:UZ,czm_ellipsoidContainsPoint:kZ,czm_ellipsoidWgs84TextureCoordinates:DZ,czm_equalsEpsilon:BZ,czm_eyeOffset:OZ,czm_eyeToWindowCoordinates:YZ,czm_fastApproximateAtan:HZ,czm_fog:KZ,czm_gammaCorrect:zZ,czm_geodeticSurfaceNormal:JZ,czm_getDefaultMaterial:QZ,czm_getDynamicAtmosphereLightDirection:jZ,czm_getLambertDiffuse:qZ,czm_getSpecular:$Z,czm_getWaterNoise:eG,czm_HSBToRGB:tG,czm_HSLToRGB:nG,czm_hue:iG,czm_inverseGamma:oG,czm_isEmpty:rG,czm_isFull:sG,czm_latitudeToWebMercatorFraction:aG,czm_linearToSrgb:cG,czm_lineDistance:lG,czm_luminance:dG,czm_metersPerPixel:uG,czm_modelToWindowCoordinates:mG,czm_multiplyWithColorBalance:hG,czm_nearFarScalar:fG,czm_octDecode:pG,czm_packDepth:bG,czm_pbrLighting:yG,czm_pbrMetallicRoughnessMaterial:gG,czm_pbrSpecularGlossinessMaterial:xG,czm_phong:_G,czm_planeDistance:TG,czm_pointAlongRay:SG,czm_rayEllipsoidIntersectionInterval:CG,czm_raySphereIntersectionInterval:VG,czm_readDepth:LG,czm_readNonPerspective:RG,czm_reverseLogDepth:ZG,czm_RGBToHSB:GG,czm_RGBToHSL:EG,czm_RGBToXYZ:IG,czm_round:XG,czm_sampleOctahedralProjection:WG,czm_saturation:PG,czm_shadowDepthCompare:vG,czm_shadowVisibility:wG,czm_signNotZero:FG,czm_sphericalHarmonics:AG,czm_srgbToLinear:MG,czm_tangentToEyeSpaceMatrix:NG,czm_textureCube:UG,czm_transformPlane:kG,czm_translateRelativeToEye:DG,czm_translucentPhong:BG,czm_transpose:OG,czm_unpackDepth:YG,czm_unpackFloat:HG,czm_unpackUint:KG,czm_valueTransform:zG,czm_vertexLogDepth:JG,czm_windowToEyeCoordinates:QG,czm_writeDepthClamp:jG,czm_writeLogDepth:qG,czm_writeNonPerspective:$G,czm_XYZToRGB:eE};var MUt=T(S(),1);function lZe(e,t){let n=e;return n=n.replaceAll("version 300 es",""),n=n.replaceAll(/(texture\()/g,"texture2D("),t?(n=n.replaceAll(/(in)\s+(vec\d|mat\d|float)/g,"varying $2"),/out_FragData_(\d+)/.test(n)&&(n=`#extension GL_EXT_draw_buffers : enable
${n}`,n=n.replaceAll(/layout\s+\(location\s*=\s*\d+\)\s*out\s+vec4\s+out_FragData_\d+;/g,""),n=n.replaceAll(/out_FragData_(\d+)/g,"gl_FragData[$1]")),n=n.replaceAll(/layout\s+\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,""),n=n.replaceAll(/out_FragColor/g,"gl_FragColor"),n=n.replaceAll(/out_FragColor\[(\d+)\]/g,"gl_FragColor[$1]"),/gl_FragDepth/.test(n)&&(n=`#extension GL_EXT_frag_depth : enable
${n}`,n=n.replaceAll(/gl_FragDepth/g,"gl_FragDepthEXT")),n=`#ifdef GL_OES_standard_derivatives
#extension GL_OES_standard_derivatives : enable
#endif
${n}`):(n=n.replaceAll(/(in)\s+(vec\d|mat\d|float)/g,"attribute $2"),n=n.replaceAll(/(out)\s+(vec\d|mat\d|float)\s+([\w]+);/g,"varying $2 $3;")),n=`#version 100
${n}`,n}var tE=lZe;function K$(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(t){let n=t.match(/\n/gm).length,i="";for(let o=0;o<n;++o)i+=`
`;return i})}function z$(e,t,n){let i;for(let o=0;o<n.length;++o)n[o].name===e&&(i=n[o]);return l(i)||(t=K$(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function J$(e,t){if(e.evaluated)return;e.evaluated=!0;let n=e.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);l(n)&&n!==null&&(n=n.filter(function(i,o){return n.indexOf(i)===o}),n.forEach(function(i){if(i!==e.name&&Ws._czmBuiltinsAndUniforms.hasOwnProperty(i)){let o=z$(i,Ws._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(o),o.requiredBy.push(e),J$(o,t)}}))}function dZe(e){let t=[],n=[];for(;e.length>0;){let o=e.pop();n.push(o),o.requiredBy.length===0&&t.push(o)}for(;t.length>0;){let o=t.shift();e.push(o);for(let r=0;r<o.dependsOn.length;++r){let s=o.dependsOn[r],a=s.requiredBy.indexOf(o);s.requiredBy.splice(a,1),s.requiredBy.length===0&&t.push(s)}}let i=[];for(let o=0;o<n.length;++o)n[o].requiredBy.length!==0&&i.push(n[o])}function uZe(e){let t=[],n=z$("main",e,t);J$(n,t),dZe(t);let i="";for(let o=t.length-1;o>=0;--o)i=`${i+t[o].glslSource}
`;return i.replace(n.glslSource,"")}function Q$(e,t,n){let i,o,r="",s=e.sources;if(l(s))for(i=0,o=s.length;i<o;++i)r+=`
#line 0
${s[i]}`;r=K$(r);let a;r=r.replace(/#version\s+(.*?)\n/gm,function(x,_){return a=_,`
`});let c=[];r=r.replace(/#extension.*\n/gm,function(x){return c.push(x),`
`}),r=r.replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");let d=e.pickColorQualifier;l(d)&&(r=Ws.createPickFragmentShaderSource(r,d));let u="",m=c.length;for(i=0;i<m;i++)u+=c[i];t&&(u+=`#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
precision highp int;
#else
precision mediump float;
precision mediump int;
#define highp mediump
#endif
`);let p=e.defines;if(l(p))for(i=0,o=p.length;i<o;++i){let x=p[i];x.length!==0&&(u+=`#define ${x}
`)}n.textureFloatLinear&&(u+=`#define OES_texture_float_linear
`),n.floatingPointTexture&&(u+=`#define OES_texture_float
`);let y="";e.includeBuiltIns&&(y=uZe(r)),u+=`
#line 0
`;let f=y+r;return n.webgl2&&t&&!/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g.test(f)&&!/czm_out_FragColor/g.test(f)&&/out_FragColor/g.test(f)&&(u+=`layout(location = 0) out vec4 out_FragColor;
`),u+=y,u+=r,n.webgl2?u=`#version 300 es
${u}`:u=tE(u,t),u}function Ws(e){e=g(e,g.EMPTY_OBJECT);let t=e.pickColorQualifier;this.defines=l(e.defines)?e.defines.slice(0):[],this.sources=l(e.sources)?e.sources.slice(0):[],this.pickColorQualifier=t,this.includeBuiltIns=g(e.includeBuiltIns,!0)}Ws.prototype.clone=function(){return new Ws({sources:this.sources,defines:this.defines,pickColorQualifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})};Ws.replaceMain=function(e,t){return t=`void ${t}()`,e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)};Ws.prototype.getCacheKey=function(){let t=this.defines.slice().sort().join(","),n=this.pickColorQualifier,i=this.includeBuiltIns,o=this.sources.join(`
`);return`${t}:${n}:${i}:${o}`};Ws.prototype.createCombinedVertexShader=function(e){return Q$(this,!1,e)};Ws.prototype.createCombinedFragmentShader=function(e){return Q$(this,!0,e)};Ws._czmBuiltinsAndUniforms={};for(let e in ix)ix.hasOwnProperty(e)&&(Ws._czmBuiltinsAndUniforms[e]=ix[e]);for(let e in hp)if(hp.hasOwnProperty(e)){let t=hp[e];typeof t.getDeclaration=="function"&&(Ws._czmBuiltinsAndUniforms[e]=t.getDeclaration(e))}Ws.createPickVertexShaderSource=function(e){return`${Ws.replaceMain(e,"czm_old_main")}
in vec4 pickColor;
out vec4 czm_pickColor;
void main()
{
czm_old_main();
czm_pickColor = pickColor;
}`};Ws.createPickFragmentShaderSource=function(e,t){let n=Ws.replaceMain(e,"czm_old_main"),i=`${t} vec4 czm_pickColor;
void main()
{
czm_old_main();
if (out_FragColor.a == 0.0) {
discard;
}
out_FragColor = czm_pickColor;
}`;return`${n}
${i}`};function mZe(e,t){let n=e.defines,i=n.length;for(let o=0;o<i;++o)if(n[o]===t)return!0;return!1}function j$(e,t){let n=e.sources,i=n.length;for(let o=0;o<i;++o)if(n[o].indexOf(t)!==-1)return!0;return!1}function q$(e,t){let n=t.length;for(let i=0;i<n;++i){let o=t[i];if(j$(e,o))return o}}var hZe=["v_normalEC","v_normal"];Ws.findNormalVarying=function(e){return j$(e,"#ifdef HAS_NORMALS")?mZe(e,"HAS_NORMALS")?"v_normalEC":void 0:q$(e,hZe)};var fZe=["v_positionEC"];Ws.findPositionVarying=function(e){return q$(e,fZe)};var Oe=Ws;var KUt=T(S(),1),nE=`in vec3 position3DHigh;
in vec3 position3DLow;
in float batchId;
#ifdef EXTRUDED_GEOMETRY
in vec3 extrudeDirection;
uniform float u_globeMinimumAltitude;
#endif // EXTRUDED_GEOMETRY
#ifdef PER_INSTANCE_COLOR
out vec4 v_color;
#endif // PER_INSTANCE_COLOR
#ifdef TEXTURE_COORDINATES
#ifdef SPHERICAL
out vec4 v_sphericalExtents;
#else // SPHERICAL
out vec2 v_inversePlaneExtents;
out vec4 v_westPlane;
out vec4 v_southPlane;
#endif // SPHERICAL
out vec3 v_uvMinAndSphericalLongitudeRotation;
out vec3 v_uMaxAndInverseDistance;
out vec3 v_vMaxAndInverseDistance;
#endif // TEXTURE_COORDINATES
void main()
{
vec4 position = czm_computePosition();
#ifdef EXTRUDED_GEOMETRY
float delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz));
delta *= czm_sceneMode == czm_sceneMode3D ? 1.0 : 0.0;
//extrudeDirection is zero for the top layer
position = position + vec4(extrudeDirection * delta, 0.0);
#endif
#ifdef TEXTURE_COORDINATES
#ifdef SPHERICAL
v_sphericalExtents = czm_batchTable_sphericalExtents(batchId);
v_uvMinAndSphericalLongitudeRotation.z = czm_batchTable_longitudeRotation(batchId);
#else // SPHERICAL
#ifdef COLUMBUS_VIEW_2D
vec4 planes2D_high = czm_batchTable_planes2D_HIGH(batchId);
vec4 planes2D_low = czm_batchTable_planes2D_LOW(batchId);
// If the primitive is split across the IDL (planes2D_high.x > planes2D_high.w):
// - If this vertex is on the east side of the IDL (position3DLow.y > 0.0, comparison with position3DHigh may produce artifacts)
// - existing "east" is on the wrong side of the world, far away (planes2D_high/low.w)
// - so set "east" as beyond the eastmost extent of the projection (idlSplitNewPlaneHiLow)
vec2 idlSplitNewPlaneHiLow = vec2(EAST_MOST_X_HIGH - (WEST_MOST_X_HIGH - planes2D_high.w), EAST_MOST_X_LOW - (WEST_MOST_X_LOW - planes2D_low.w));
bool idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y > 0.0;
planes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w);
planes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w);
// - else, if this vertex is on the west side of the IDL (position3DLow.y < 0.0)
// - existing "west" is on the wrong side of the world, far away (planes2D_high/low.x)
// - so set "west" as beyond the westmost extent of the projection (idlSplitNewPlaneHiLow)
idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0;
idlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x));
planes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x);
planes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x);
vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz;
vec3 northWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.x, planes2D_high.z), vec3(0.0, planes2D_low.x, planes2D_low.z))).xyz;
vec3 southEastCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.w, planes2D_high.y), vec3(0.0, planes2D_low.w, planes2D_low.y))).xyz;
#else // COLUMBUS_VIEW_2D
// 3D case has smaller "plane extents," so planes encoded as a 64 bit position and 2 vec3s for distances/direction
vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz;
vec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner;
vec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner;
#endif // COLUMBUS_VIEW_2D
vec3 eastWard = southEastCorner - southWestCorner;
float eastExtent = length(eastWard);
eastWard /= eastExtent;
vec3 northWard = northWestCorner - southWestCorner;
float northExtent = length(northWard);
northWard /= northExtent;
v_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner));
v_southPlane = vec4(northWard, -dot(northWard, southWestCorner));
v_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent);
#endif // SPHERICAL
vec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId);
vec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId);
v_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z);
v_vMaxAndInverseDistance = vec3(uMaxVmax.zw, uvMinAndExtents.w);
v_uvMinAndSphericalLongitudeRotation.xy = uvMinAndExtents.xy;
#endif // TEXTURE_COORDINATES
#ifdef PER_INSTANCE_COLOR
v_color = czm_batchTable_color(batchId);
#endif
gl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position);
}
`;var JUt=T(S(),1),Cb=`#ifdef VECTOR_TILE
uniform vec4 u_highlightColor;
#endif
void main(void)
{
#ifdef VECTOR_TILE
out_FragColor = czm_gammaCorrect(u_highlightColor);
#else
out_FragColor = vec4(1.0);
#endif
czm_writeDepthClamp();
}
`;var jUt=T(S(),1),$$={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};$$.NUMBER_OF_CLASSIFICATION_TYPES=3;var Bn=Object.freeze($$);var ekt=T(S(),1);var pZe={NEVER:ne.NEVER,LESS:ne.LESS,EQUAL:ne.EQUAL,LESS_OR_EQUAL:ne.LEQUAL,GREATER:ne.GREATER,NOT_EQUAL:ne.NOTEQUAL,GREATER_OR_EQUAL:ne.GEQUAL,ALWAYS:ne.ALWAYS},ja=Object.freeze(pZe);var d3t=T(S(),1);var okt=T(S(),1);function Jh(){this.high=h.clone(h.ZERO),this.low=h.clone(h.ZERO)}Jh.encode=function(e,t){l(t)||(t={high:0,low:0});let n;return e>=0?(n=Math.floor(e/65536)*65536,t.high=n,t.low=e-n):(n=Math.floor(-e/65536)*65536,t.high=-n,t.low=e+n),t};var pp={high:0,low:0};Jh.fromCartesian=function(e,t){l(t)||(t=new Jh);let n=t.high,i=t.low;return Jh.encode(e.x,pp),n.x=pp.high,i.x=pp.low,Jh.encode(e.y,pp),n.y=pp.high,i.y=pp.low,Jh.encode(e.z,pp),n.z=pp.high,i.z=pp.low,t};var cO=new Jh;Jh.writeElements=function(e,t,n){Jh.fromCartesian(e,cO);let i=cO.high,o=cO.low;t[n]=i.x,t[n+1]=i.y,t[n+2]=i.z,t[n+3]=o.x,t[n+4]=o.y,t[n+5]=o.z};var Kn=Jh;var skt=T(S(),1);function bZe(e,t){let n=[],i=e.length,o=0;for(;o<i;){let r=Math.ceil((i-o)/t--);n.push(e.slice(o,o+r)),o+=r}return n}var iE=bZe;var lkt=T(S(),1);var DM={STREAM_DRAW:ne.STREAM_DRAW,STATIC_DRAW:ne.STATIC_DRAW,DYNAMIC_DRAW:ne.DYNAMIC_DRAW,validate:function(e){return e===DM.STREAM_DRAW||e===DM.STATIC_DRAW||e===DM.DYNAMIC_DRAW}},Ue=Object.freeze(DM);var wkt=T(S(),1);var fkt=T(S(),1);var Ps={UNSIGNED_BYTE:ne.UNSIGNED_BYTE,UNSIGNED_SHORT:ne.UNSIGNED_SHORT,UNSIGNED_INT:ne.UNSIGNED_INT};Ps.getSizeInBytes=function(e){switch(e){case Ps.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Ps.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Ps.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}};Ps.fromSizeInBytes=function(e){switch(e){case 2:return Ps.UNSIGNED_SHORT;case 4:return Ps.UNSIGNED_INT;case 1:return Ps.UNSIGNED_BYTE}};Ps.validate=function(e){return l(e)&&(e===Ps.UNSIGNED_BYTE||e===Ps.UNSIGNED_SHORT||e===Ps.UNSIGNED_INT)};Ps.createTypedArray=function(e,t){return e>=W.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};Ps.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=W.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};Ps.fromTypedArray=function(e){if(e instanceof Uint8Array)return Ps.UNSIGNED_BYTE;if(e instanceof Uint16Array)return Ps.UNSIGNED_SHORT;if(e instanceof Uint32Array)return Ps.UNSIGNED_INT};var Ne=Object.freeze(Ps);var Skt=T(S(),1);function iu(e){e=g(e,g.EMPTY_OBJECT);let t=e.context._gl,n=e.bufferTarget,i=e.typedArray,o=e.sizeInBytes,r=e.usage,s=l(i);s&&(o=i.byteLength);let a=t.createBuffer();t.bindBuffer(n,a),t.bufferData(n,s?i:o,r),t.bindBuffer(n,null),this._id=Hn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=o,this._usage=r,this._buffer=a,this.vertexArrayDestroyable=!0}iu.createVertexBuffer=function(e){return new iu({context:e.context,bufferTarget:ne.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};iu.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=Ne.getSizeInBytes(n),o=new iu({context:t,bufferTarget:ne.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),r=o.sizeInBytes/i;return Object.defineProperties(o,{indexDatatype:{get:function(){return n}},bytesPerIndex:{get:function(){return i}},numberOfIndices:{get:function(){return r}}}),o};Object.defineProperties(iu.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});iu.prototype._getBuffer=function(){return this._buffer};iu.prototype.copyFromArrayView=function(e,t){t=g(t,0);let n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)};iu.prototype.copyFromBuffer=function(e,t,n,i){let o=ne.COPY_READ_BUFFER,r=ne.COPY_WRITE_BUFFER,s=this._gl;s.bindBuffer(r,this._buffer),s.bindBuffer(o,e._buffer),s.copyBufferSubData(o,r,t,n,i),s.bindBuffer(r,null),s.bindBuffer(o,null)};iu.prototype.getBufferData=function(e,t,n,i){t=g(t,0),n=g(n,0);let o=this._gl,r=ne.COPY_READ_BUFFER;o.bindBuffer(r,this._buffer),o.getBufferSubData(r,t,e,n,i),o.bindBuffer(r,null)};iu.prototype.isDestroyed=function(){return!1};iu.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),ue(this)};var ft=iu;function yZe(e,t,n,i){let o=l(t.vertexBuffer),r=l(t.value),s=t.value?t.value.length:t.componentsPerAttribute,a={index:g(t.index,n),enabled:g(t.enabled,!0),vertexBuffer:t.vertexBuffer,value:r?t.value.slice(0):void 0,componentsPerAttribute:s,componentDatatype:g(t.componentDatatype,Q.FLOAT),normalize:g(t.normalize,!1),offsetInBytes:g(t.offsetInBytes,0),strideInBytes:g(t.strideInBytes,0),instanceDivisor:g(t.instanceDivisor,0)};if(o)a.vertexAttrib=function(c){let d=this.index;c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),c.vertexAttribPointer(d,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),c.enableVertexAttribArray(d),this.instanceDivisor>0&&(i.glVertexAttribDivisor(d,this.instanceDivisor),i._vertexAttribDivisors[d]=this.instanceDivisor,i._previousDrawInstanced=!0)},a.disableVertexAttribArray=function(c){c.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(a.componentsPerAttribute){case 1:a.vertexAttrib=function(c){c.vertexAttrib1fv(this.index,this.value)};break;case 2:a.vertexAttrib=function(c){c.vertexAttrib2fv(this.index,this.value)};break;case 3:a.vertexAttrib=function(c){c.vertexAttrib3fv(this.index,this.value)};break;case 4:a.vertexAttrib=function(c){c.vertexAttrib4fv(this.index,this.value)};break}a.disableVertexAttribArray=function(c){}}e.push(a)}function tee(e,t,n){for(let i=0;i<t.length;++i){let o=t[i];o.enabled&&o.vertexAttrib(e)}l(n)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n._getBuffer())}function bp(e){e=g(e,g.EMPTY_OBJECT);let t=e.context,n=t._gl,i=e.attributes,o=e.indexBuffer,r,s=[],a=1,c=!1,d=!1,u=i.length;for(r=0;r<u;++r)yZe(s,i[r],r,t);for(u=s.length,r=0;r<u;++r){let p=s[r];if(l(p.vertexBuffer)&&p.instanceDivisor===0){let y=p.strideInBytes||p.componentsPerAttribute*Q.getSizeInBytes(p.componentDatatype);a=p.vertexBuffer.sizeInBytes/y;break}}for(r=0;r<u;++r)s[r].instanceDivisor>0&&(c=!0),l(s[r].value)&&(d=!0);let m;t.vertexArrayObject&&(m=t.glCreateVertexArray(),t.glBindVertexArray(m),tee(n,s,o),t.glBindVertexArray(null)),this._numberOfVertices=a,this._hasInstancedAttributes=c,this._hasConstantAttributes=d,this._context=t,this._gl=n,this._vao=m,this._attributes=s,this._indexBuffer=o}function eee(e){return e.values.length/e.componentsPerAttribute}function gZe(e){return Q.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function xZe(e){let t,n,i,o=[];for(n in e)e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)&&(o.push(n),e[n].componentDatatype===Q.DOUBLE&&(e[n].componentDatatype=Q.FLOAT,e[n].values=Q.createTypedArray(Q.FLOAT,e[n].values)));let r,s=o.length;if(s>0)for(r=eee(e[o[0]]),t=1;t<s;++t){let d=eee(e[o[t]]);if(d!==r)throw new me(`Each attribute list must have the same number of vertices. Attribute ${o[t]} has a different number of vertices (${d.toString()}) than attribute ${o[0]} (${r.toString()}).`)}o.sort(function(d,u){return Q.getSizeInBytes(e[u].componentDatatype)-Q.getSizeInBytes(e[d].componentDatatype)});let a=0,c={};for(t=0;t<s;++t)n=o[t],i=e[n],c[n]=a,a+=gZe(i);if(a>0){let d=Q.getSizeInBytes(e[o[0]].componentDatatype),u=a%d;u!==0&&(a+=d-u);let m=r*a,p=new ArrayBuffer(m),y={};for(t=0;t<s;++t){n=o[t];let f=Q.getSizeInBytes(e[n].componentDatatype);y[n]={pointer:Q.createTypedArray(e[n].componentDatatype,p),index:c[n]/f,strideInComponentType:a/f}}for(t=0;t<r;++t)for(let f=0;f<s;++f){n=o[f],i=e[n];let x=i.values,_=y[n],C=_.pointer,V=i.componentsPerAttribute;for(let L=0;L<V;++L)C[_.index+L]=x[t*V+L];_.index+=_.strideInComponentType}return{buffer:p,offsetsInBytes:c,vertexSizeInBytes:a}}}bp.fromGeometry=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.context,n=g(e.geometry,g.EMPTY_OBJECT),i=g(e.bufferUsage,Ue.DYNAMIC_DRAW),o=g(e.attributeLocations,g.EMPTY_OBJECT),r=g(e.interleave,!1),s=e.vertexArrayAttributes,a,c,d,u=l(s)?s:[],m=n.attributes;if(r){let f=xZe(m);if(l(f)){d=ft.createVertexBuffer({context:t,typedArray:f.buffer,usage:i});let x=f.offsetsInBytes,_=f.vertexSizeInBytes;for(a in m)m.hasOwnProperty(a)&&l(m[a])&&(c=m[a],l(c.values)?u.push({index:o[a],vertexBuffer:d,componentDatatype:c.componentDatatype,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,offsetInBytes:x[a],strideInBytes:_}):u.push({index:o[a],value:c.value,componentDatatype:c.componentDatatype,normalize:c.normalize}))}}else for(a in m)if(m.hasOwnProperty(a)&&l(m[a])){c=m[a];let f=c.componentDatatype;f===Q.DOUBLE&&(f=Q.FLOAT),d=void 0,l(c.values)&&(d=ft.createVertexBuffer({context:t,typedArray:Q.createTypedArray(f,c.values),usage:i})),u.push({index:o[a],vertexBuffer:d,value:c.value,componentDatatype:f,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize})}let p,y=n.indices;return l(y)&&(mt.computeNumberOfVertices(n)>=W.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=ft.createIndexBuffer({context:t,typedArray:new Uint32Array(y),usage:i,indexDatatype:Ne.UNSIGNED_INT}):p=ft.createIndexBuffer({context:t,typedArray:new Uint16Array(y),usage:i,indexDatatype:Ne.UNSIGNED_SHORT})),new bp({context:t,attributes:u,indexBuffer:p})};Object.defineProperties(bp.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});bp.prototype.getAttribute=function(e){return this._attributes[e]};function _Ze(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,o=e._attributes,r=Yt.maximumVertexAttributes,s;if(n){let a=o.length;for(s=0;s<a;++s){let c=o[s];if(c.enabled){let d=c.instanceDivisor,u=c.index;d!==i[u]&&(t.glVertexAttribDivisor(u,d),i[u]=d)}}}else for(s=0;s<r;++s)i[s]>0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function TZe(e,t){let n=e._attributes,i=n.length;for(let o=0;o<i;++o){let r=n[o];r.enabled&&l(r.value)&&r.vertexAttrib(t)}}bp.prototype._bind=function(){l(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&_Ze(this),this._hasConstantAttributes&&TZe(this,this._gl)):tee(this._gl,this._attributes,this._indexBuffer)};bp.prototype._unBind=function(){if(l(this._vao))this._context.glBindVertexArray(null);else{let e=this._attributes,t=this._gl;for(let n=0;n<e.length;++n){let i=e[n];i.enabled&&i.disableVertexAttribArray(t)}this._indexBuffer&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}};bp.prototype.isDestroyed=function(){return!1};bp.prototype.destroy=function(){let e=this._attributes;for(let n=0;n<e.length;++n){let i=e[n].vertexBuffer;l(i)&&!i.isDestroyed()&&i.vertexArrayDestroyable&&i.destroy()}let t=this._indexBuffer;return l(t)&&!t.isDestroyed()&&t.vertexArrayDestroyable&&t.destroy(),l(this._vao)&&this._context.glDeleteVertexArray(this._vao),ue(this)};var oi=bp;var Jkt=T(S(),1);function yp(e,t,n){if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;let i=SZe(t),o=e.floatingPointTexture,r=i===je.FLOAT&&!o,s=CZe(t,r),a=VZe(s,t,r),c=Math.floor(Yt.maximumTextureSize/a),d=Math.min(n,c),u=a*d,m=Math.ceil(n/d),p=1/u,y=p*.5,f=1/m,x=f*.5;this._textureDimensions=new B(u,m),this._textureStep=new se(p,y,f,x),this._pixelDatatype=r?je.UNSIGNED_BYTE:i,this._packFloats=r,this._offsets=s,this._stride=a,this._texture=void 0;let _=4*u*m;this._batchValues=i===je.FLOAT&&!r?new Float32Array(_):new Uint8Array(_),this._batchValuesDirty=!1}Object.defineProperties(yp.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function SZe(e){let t=!1,n=e.length;for(let i=0;i<n;++i)if(e[i].componentDatatype!==Q.UNSIGNED_BYTE){t=!0;break}return t?je.FLOAT:je.UNSIGNED_BYTE}function iee(e,t){let n=e[t].componentsPerAttribute;return n===2?B:n===3?h:n===4?se:Number}function CZe(e,t){let n=new Array(e.length),i=0,o=e.length;for(let r=0;r<o;++r){let a=e[r].componentDatatype;n[r]=i,a!==Q.UNSIGNED_BYTE&&t?i+=4:++i}return n}function VZe(e,t,n){let i=e.length,o=e[i-1];return t[i-1].componentDatatype!==Q.UNSIGNED_BYTE&&n?o+4:o+1}var oE=new se;function LZe(e,t,n){let i=se.unpack(e,t,oE),o=se.unpackFloat(i);i=se.unpack(e,t+4,oE);let r=se.unpackFloat(i);i=se.unpack(e,t+8,oE);let s=se.unpackFloat(i);i=se.unpack(e,t+12,oE);let a=se.unpackFloat(i);return se.fromElements(o,r,s,a,n)}function RZe(e,t,n){let i=se.packFloat(e.x,oE);se.pack(i,t,n),i=se.packFloat(e.y,i),se.pack(i,t,n+4),i=se.packFloat(e.z,i),se.pack(i,t,n+8),i=se.packFloat(e.w,i),se.pack(i,t,n+12)}var nee=new se;yp.prototype.getBatchedAttribute=function(e,t,n){let i=this._attributes,o=this._offsets[t],s=4*this._stride*e+4*o,a;this._packFloats&&i[t].componentDatatype!==je.UNSIGNED_BYTE?a=LZe(this._batchValues,s,nee):a=se.unpack(this._batchValues,s,nee);let c=iee(i,t);return l(c.fromCartesian4)?c.fromCartesian4(a,n):l(c.clone)?c.clone(a,n):a.x};var ZZe=[void 0,void 0,new B,new h,new se],GZe=new se;yp.prototype.setBatchedAttribute=function(e,t,n){let i=this._attributes,o=ZZe[i[t].componentsPerAttribute],r=this.getBatchedAttribute(e,t,o),s=iee(this._attributes,t);if(l(s.equals)?s.equals(r,n):r===n)return;let c=GZe;c.x=l(n.x)?n.x:n,c.y=l(n.y)?n.y:0,c.z=l(n.z)?n.z:0,c.w=l(n.w)?n.w:0;let d=this._offsets[t],m=4*this._stride*e+4*d;this._packFloats&&i[t].componentDatatype!==je.UNSIGNED_BYTE?RZe(c,this._batchValues,m):se.pack(c,this._batchValues,m),this._batchValuesDirty=!0};function EZe(e,t){let n=e._textureDimensions;e._texture=new wt({context:t,pixelFormat:at.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:hn.NEAREST,flipY:!1})}function IZe(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}yp.prototype.update=function(e){l(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,l(this._texture)||EZe(this,e.context),IZe(this))};yp.prototype.getUniformMapCallback=function(){let e=this;return function(t){return e._attributes.length===0?t:Tt(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}};function XZe(e){let t=e._stride;return e._textureDimensions.y===1?`uniform vec4 batchTextureStep;
vec2 computeSt(float batchId)
{
float stepX = batchTextureStep.x;
float centerX = batchTextureStep.y;
float numberOfAttributes = float(${t});
return vec2(centerX + (batchId * numberOfAttributes * stepX), 0.5);
}
`:`uniform vec4 batchTextureStep;
uniform vec2 batchTextureDimensions;
vec2 computeSt(float batchId)
{
float stepX = batchTextureStep.x;
float centerX = batchTextureStep.y;
float stepY = batchTextureStep.z;
float centerY = batchTextureStep.w;
float numberOfAttributes = float(${t});
float xId = mod(batchId * numberOfAttributes, batchTextureDimensions.x);
float yId = floor(batchId * numberOfAttributes / batchTextureDimensions.x);
return vec2(centerX + (xId * stepX), centerY + (yId * stepY));
}
`}function WZe(e){return e===1?"float":`vec${e}`}function PZe(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function vZe(e,t){let i=e._attributes[t],o=i.componentsPerAttribute,r=i.functionName,s=WZe(o),a=PZe(o),c=e._offsets[t],d=`${s} ${r}(float batchId)
{
vec2 st = computeSt(batchId);
st.x += batchTextureStep.x * float(${c});
`;return e._packFloats&&i.componentDatatype!==je.UNSIGNED_BYTE?d+=`vec4 textureValue;
textureValue.x = czm_unpackFloat(texture(batchTexture, st));
textureValue.y = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x, 0.0)));
textureValue.z = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0)));
textureValue.w = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0)));
`:d+=` vec4 textureValue = texture(batchTexture, st);
`,d+=` ${s} value = textureValue${a};
`,e._pixelDatatype===je.UNSIGNED_BYTE&&i.componentDatatype===Q.UNSIGNED_BYTE&&!i.normalize?d+=`value *= 255.0;
`:e._pixelDatatype===je.FLOAT&&i.componentDatatype===Q.UNSIGNED_BYTE&&i.normalize&&(d+=`value /= 255.0;
`),d+=` return value;
}
`,d}yp.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture;
`;t+=`${XZe(this)}
`;let n=e.length;for(let i=0;i<n;++i)t+=vZe(this,i);return function(i){let o=i.indexOf("void main"),r=i.substring(0,o),s=i.substring(o);return`${r}
${t}
${s}`}};yp.prototype.isDestroyed=function(){return!1};yp.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),ue(this)};var ox=yp;var yBt=T(S(),1);var KDt=T(S(),1);var uDt=T(S(),1);var iDt=T(S(),1);var so={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};so.getMathType=function(e){switch(e){case so.SCALAR:return Number;case so.VEC2:return B;case so.VEC3:return h;case so.VEC4:return se;case so.MAT2:return io;case so.MAT3:return q;case so.MAT4:return A}};so.getNumberOfComponents=function(e){switch(e){case so.SCALAR:return 1;case so.VEC2:return 2;case so.VEC3:return 3;case so.VEC4:case so.MAT2:return 4;case so.MAT3:return 9;case so.MAT4:return 16}};so.getAttributeLocationCount=function(e){switch(e){case so.SCALAR:case so.VEC2:case so.VEC3:case so.VEC4:return 1;case so.MAT2:return 2;case so.MAT3:return 3;case so.MAT4:return 4}};so.getGlslType=function(e){switch(e){case so.SCALAR:return"float";case so.VEC2:return"vec2";case so.VEC3:return"vec3";case so.VEC4:return"vec4";case so.MAT2:return"mat2";case so.MAT3:return"mat3";case so.MAT4:return"mat4"}};var tn=Object.freeze(so);var oee=1/256,ree=256,To={};To.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let i=n.x,o=n.y;n.x=(1-Math.abs(o))*W.signNotZero(i),n.y=(1-Math.abs(i))*W.signNotZero(o)}return n.x=W.toSNorm(n.x,t),n.y=W.toSNorm(n.y,t),n};To.octEncode=function(e,t){return To.octEncodeInRange(e,255,t)};var rE=new B,see=new Uint8Array(1);function BM(e){return see[0]=e,see[0]}To.octEncodeToCartesian4=function(e,t){return To.octEncodeInRange(e,65535,rE),t.x=BM(rE.x*oee),t.y=BM(rE.x),t.z=BM(rE.y*oee),t.w=BM(rE.y),t};To.octDecodeInRange=function(e,t,n,i){if(i.x=W.fromSNorm(e,n),i.y=W.fromSNorm(t,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){let o=i.x;i.x=(1-Math.abs(i.y))*W.signNotZero(o),i.y=(1-Math.abs(o))*W.signNotZero(i.y)}return h.normalize(i,i)};To.octDecode=function(e,t,n){return To.octDecodeInRange(e,t,255,n)};To.octDecodeFromCartesian4=function(e,t){let n=e.x,i=e.y,o=e.z,r=e.w,s=n*ree+i,a=o*ree+r;return To.octDecodeInRange(s,a,65535,t)};To.octPackFloat=function(e){return 256*e.x+e.y};var dO=new B;To.octEncodeFloat=function(e){return To.octEncode(e,dO),To.octPackFloat(dO)};To.octDecodeFloat=function(e,t){let n=e/256,i=Math.floor(n),o=(n-i)*256;return To.octDecode(i,o,t)};To.octPack=function(e,t,n,i){let o=To.octEncodeFloat(e),r=To.octEncodeFloat(t),s=To.octEncode(n,dO);return i.x=65536*s.x+o,i.y=65536*s.y+r,i};To.octUnpack=function(e,t,n,i){let o=e.x/65536,r=Math.floor(o),s=(o-r)*65536;o=e.y/65536;let a=Math.floor(o),c=(o-a)*65536;To.octDecodeFloat(s,t),To.octDecodeFloat(c,n),To.octDecode(r,a,i)};To.compressTextureCoordinates=function(e){let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};To.decompressTextureCoordinates=function(e,t){let n=e/4096,i=Math.floor(n);return t.x=i/4095,t.y=(e-i*4096)/4095,t};function lO(e){return e>>1^-(e&1)}To.zigZagDeltaDecode=function(e,t,n){let i=e.length,o=0,r=0,s=0;for(let a=0;a<i;++a)o+=lO(e[a]),r+=lO(t[a]),e[a]=o,t[a]=r,l(n)&&(s+=lO(n[a]),n[a]=s)};To.dequantize=function(e,t,n,i){let o=tn.getNumberOfComponents(n),r;switch(t){case Q.BYTE:r=127;break;case Q.UNSIGNED_BYTE:r=255;break;case Q.SHORT:r=32767;break;case Q.UNSIGNED_SHORT:r=65535;break;case Q.INT:r=2147483647;break;case Q.UNSIGNED_INT:r=4294967295;break}let s=new Float32Array(i*o);for(let a=0;a<i;a++)for(let c=0;c<o;c++){let d=a*o+c;s[d]=Math.max(e[d]/r,-1)}return s};To.decodeRGB565=function(e,t){let n=e.length;l(t)||(t=new Float32Array(n*3));let i=31,o=63,r=1/31,s=1/63;for(let a=0;a<n;a++){let c=e[a],d=c>>11,u=c>>5&o,m=c&i,p=3*a;t[p]=d*r,t[p+1]=u*s,t[p+2]=m*r}return t};var Fn=To;var yDt=T(S(),1);var aee=new h,cee=new h,lee=new h;function wZe(e,t,n,i,o){l(o)||(o=new h);let r,s,a,c,d,u,m,p;if(l(t.z)){if(h.equalsEpsilon(e,t,W.EPSILON14))return h.clone(h.UNIT_X,o);if(h.equalsEpsilon(e,n,W.EPSILON14))return h.clone(h.UNIT_Y,o);if(h.equalsEpsilon(e,i,W.EPSILON14))return h.clone(h.UNIT_Z,o);r=h.subtract(n,t,aee),s=h.subtract(i,t,cee),a=h.subtract(e,t,lee),c=h.dot(r,r),d=h.dot(r,s),u=h.dot(r,a),m=h.dot(s,s),p=h.dot(s,a)}else{if(B.equalsEpsilon(e,t,W.EPSILON14))return h.clone(h.UNIT_X,o);if(B.equalsEpsilon(e,n,W.EPSILON14))return h.clone(h.UNIT_Y,o);if(B.equalsEpsilon(e,i,W.EPSILON14))return h.clone(h.UNIT_Z,o);r=B.subtract(n,t,aee),s=B.subtract(i,t,cee),a=B.subtract(e,t,lee),c=B.dot(r,r),d=B.dot(r,s),u=B.dot(r,a),m=B.dot(s,s),p=B.dot(s,a)}o.y=m*u-d*p,o.z=c*p-d*u;let y=c*m-d*d;if(y!==0)return o.y/=y,o.z/=y,o.x=1-o.y-o.z,o}var rx=wZe;var TDt=T(S(),1);var uO={};uO.calculateACMR=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=g(e.cacheSize,24),o=t.length;if(!l(n)){n=0;let a=0,c=t[a];for(;a<o;)c>n&&(n=c),++a,c=t[a]}let r=[];for(let a=0;a<n+1;a++)r[a]=0;let s=i+1;for(let a=0;a<o;++a)s-r[t[a]]>i&&(r[t[a]]=s,++s);return(s-i+1)/(o/3)};uO.tipsify=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=g(e.cacheSize,24),o;function r(b,R,E,X){for(;R.length>=1;){let w=R[R.length-1];if(R.splice(R.length-1,1),b[w].numLiveTriangles>0)return w}for(;o<X;){if(b[o].numLiveTriangles>0)return++o,o-1;++o}return-1}function s(b,R,E,X,w,N,D){let k=-1,Y,U=-1,J=0;for(;J<E.length;){let K=E[J];X[K].numLiveTriangles&&(Y=0,w-X[K].timeStamp+2*X[K].numLiveTriangles<=R&&(Y=w-X[K].timeStamp),(Y>U||U===-1)&&(U=Y,k=K)),++J}return k===-1?r(X,N,b,D):k}let a=t.length,c=0,d=0,u=t[d],m=a;if(l(n))c=n+1;else{for(;d<m;)u>c&&(c=u),++d,u=t[d];if(c===-1)return 0;++c}let p=[],y;for(y=0;y<c;y++)p[y]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};d=0;let f=0;for(;d<m;)p[t[d]].vertexTriangles.push(f),++p[t[d]].numLiveTriangles,p[t[d+1]].vertexTriangles.push(f),++p[t[d+1]].numLiveTriangles,p[t[d+2]].vertexTriangles.push(f),++p[t[d+2]].numLiveTriangles,++f,d+=3;let x=0,_=i+1;o=1;let C=[],V=[],L,Z,G=0,I=[],P=a/3,v=[];for(y=0;y<P;y++)v[y]=!1;let F,M;for(;x!==-1;){C=[],Z=p[x],M=Z.vertexTriangles.length;for(let b=0;b<M;++b)if(f=Z.vertexTriangles[b],!v[f]){v[f]=!0,d=f+f+f;for(let R=0;R<3;++R)F=t[d],C.push(F),V.push(F),I[G]=F,++G,L=p[F],--L.numLiveTriangles,_-L.timeStamp>i&&(L.timeStamp=_,++_),++d}x=s(t,i,C,p,_,V,c)}return I};var sE=uO;var Wc={};function QM(e,t,n,i,o){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=o,e[t++]=o,e[t]=n}function FZe(e){let t=e.length,n=t/3*6,i=Ne.createTypedArray(t,n),o=0;for(let r=0;r<t;r+=3,o+=6)QM(i,o,e[r],e[r+1],e[r+2]);return i}function AZe(e){let t=e.length;if(t>=3){let n=(t-2)*6,i=Ne.createTypedArray(t,n);QM(i,0,e[0],e[1],e[2]);let o=6;for(let r=3;r<t;++r,o+=6)QM(i,o,e[r-1],e[r],e[r-2]);return i}return new Uint16Array}function MZe(e){if(e.length>0){let t=e.length-1,n=(t-1)*6,i=Ne.createTypedArray(t,n),o=e[0],r=0;for(let s=1;s<t;++s,r+=6)QM(i,r,o,e[s],e[s+1]);return i}return new Uint16Array}Wc.toWireframe=function(e){let t=e.indices;if(l(t)){switch(e.primitiveType){case Ae.TRIANGLES:e.indices=FZe(t);break;case Ae.TRIANGLE_STRIP:e.indices=AZe(t);break;case Ae.TRIANGLE_FAN:e.indices=MZe(t);break}e.primitiveType=Ae.LINES}return e};Wc.createLineSegmentsForVectors=function(e,t,n){t=g(t,"normal"),n=g(n,1e4);let i=e.attributes.position.values,o=e.attributes[t].values,r=i.length,s=new Float64Array(2*r),a=0;for(let u=0;u<r;u+=3)s[a++]=i[u],s[a++]=i[u+1],s[a++]=i[u+2],s[a++]=i[u]+o[u]*n,s[a++]=i[u+1]+o[u+1]*n,s[a++]=i[u+2]+o[u+2]*n;let c,d=e.boundingSphere;return l(d)&&(c=new ce(d.center,d.radius+n)),new mt({attributes:{position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:s})},primitiveType:Ae.LINES,boundingSphere:c})};Wc.createAttributeLocations=function(e){let t=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,i={},o=0,r,s=t.length;for(r=0;r<s;++r){let a=t[r];l(n[a])&&(i[a]=o++)}for(let a in n)n.hasOwnProperty(a)&&!l(i[a])&&(i[a]=o++);return i};Wc.reorderForPreVertexCache=function(e){let t=mt.computeNumberOfVertices(e),n=e.indices;if(l(n)){let i=new Int32Array(t);for(let p=0;p<t;p++)i[p]=-1;let o=n,r=o.length,s=Ne.createTypedArray(t,r),a=0,c=0,d=0,u;for(;a<r;)u=i[o[a]],u!==-1?s[c]=u:(u=o[a],i[u]=d,s[c]=d,++d),++a,++c;e.indices=s;let m=e.attributes;for(let p in m)if(m.hasOwnProperty(p)&&l(m[p])&&l(m[p].values)){let y=m[p],f=y.values,x=0,_=y.componentsPerAttribute,C=Q.createTypedArray(y.componentDatatype,d*_);for(;x<t;){let V=i[x];if(V!==-1)for(let L=0;L<_;L++)C[_*V+L]=f[_*x+L];++x}y.values=C}}return e};Wc.reorderForPostVertexCache=function(e,t){let n=e.indices;if(e.primitiveType===Ae.TRIANGLES&&l(n)){let i=n.length,o=0;for(let r=0;r<i;r++)n[r]>o&&(o=n[r]);e.indices=sE.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function dee(e){let t={};for(let n in e)if(e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)){let i=e[n];t[n]=new Ge({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function NZe(e,t,n){for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let o=t[i];for(let r=0;r<o.componentsPerAttribute;++r)e[i].values.push(o.values[n*o.componentsPerAttribute+r])}}Wc.fitToUnsignedShortIndices=function(e){let t=[],n=mt.computeNumberOfVertices(e);if(l(e.indices)&&n>=W.SIXTY_FOUR_KILOBYTES){let i=[],o=[],r=0,s=dee(e.attributes),a=e.indices,c=a.length,d;e.primitiveType===Ae.TRIANGLES?d=3:e.primitiveType===Ae.LINES?d=2:e.primitiveType===Ae.POINTS&&(d=1);for(let u=0;u<c;u+=d){for(let m=0;m<d;++m){let p=a[u+m],y=i[p];l(y)||(y=r++,i[p]=y,NZe(s,e.attributes,p)),o.push(y)}r+d>=W.SIXTY_FOUR_KILOBYTES&&(t.push(new mt({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],o=[],r=0,s=dee(e.attributes))}o.length!==0&&t.push(new mt({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var uee=new h,UZe=new he;Wc.projectTo2D=function(e,t,n,i,o){let r=e.attributes[t];o=l(o)?o:new Ri;let s=o.ellipsoid,a=r.values,c=new Float64Array(a.length),d=0;for(let u=0;u<a.length;u+=3){let m=h.fromArray(a,u,uee),p=s.cartesianToCartographic(m,UZe),y=o.project(p,uee);c[d++]=y.x,c[d++]=y.y,c[d++]=y.z}return e.attributes[n]=r,e.attributes[i]=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:c}),delete e.attributes[t],e};var mO={high:0,low:0};Wc.encodeAttribute=function(e,t,n,i){let o=e.attributes[t],r=o.values,s=r.length,a=new Float32Array(s),c=new Float32Array(s);for(let u=0;u<s;++u)Kn.encode(r[u],mO),a[u]=mO.high,c[u]=mO.low;let d=o.componentsPerAttribute;return e.attributes[n]=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:d,values:a}),e.attributes[i]=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:d,values:c}),delete e.attributes[t],e};var _m=new h;function hO(e,t){if(l(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)h.unpack(n,o,_m),A.multiplyByPoint(e,_m,_m),h.pack(_m,n,o)}}function fO(e,t){if(l(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)h.unpack(n,o,_m),q.multiplyByVector(e,_m,_m),_m=h.normalize(_m,_m),h.pack(_m,n,o)}}var OM=new A,YM=new q;Wc.transformToWorldCoordinates=function(e){let t=e.modelMatrix;if(A.equals(t,A.IDENTITY))return e;let n=e.geometry.attributes;hO(t,n.position),hO(t,n.prevPosition),hO(t,n.nextPosition),(l(n.normal)||l(n.tangent)||l(n.bitangent))&&(A.inverse(t,OM),A.transpose(OM,OM),A.getMatrix3(OM,YM),fO(YM,n.normal),fO(YM,n.tangent),fO(YM,n.bitangent));let i=e.geometry.boundingSphere;return l(i)&&(e.geometry.boundingSphere=ce.transform(i,t,i)),e.modelMatrix=A.clone(A.IDENTITY),e};function kZe(e,t){let n=e.length,i={},o=e[0][t].attributes,r;for(r in o)if(o.hasOwnProperty(r)&&l(o[r])&&l(o[r].values)){let s=o[r],a=s.values.length,c=!0;for(let d=1;d<n;++d){let u=e[d][t].attributes[r];if(!l(u)||s.componentDatatype!==u.componentDatatype||s.componentsPerAttribute!==u.componentsPerAttribute||s.normalize!==u.normalize){c=!1;break}a+=u.values.length}c&&(i[r]=new Ge({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:Q.createTypedArray(s.componentDatatype,a)}))}return i}var DZe=new h;function pO(e,t){let n=e.length,i,o,r,s,a=e[0].modelMatrix,c=l(e[0][t].indices),d=e[0][t].primitiveType,u=kZe(e,t),m,p,y;for(i in u)if(u.hasOwnProperty(i))for(m=u[i].values,s=0,o=0;o<n;++o)for(p=e[o][t].attributes[i].values,y=p.length,r=0;r<y;++r)m[s++]=p[r];let f;if(c){let V=0;for(o=0;o<n;++o)V+=e[o][t].indices.length;let L=mt.computeNumberOfVertices(new mt({attributes:u,primitiveType:Ae.POINTS})),Z=Ne.createTypedArray(L,V),G=0,I=0;for(o=0;o<n;++o){let P=e[o][t].indices,v=P.length;for(s=0;s<v;++s)Z[G++]=I+P[s];I+=mt.computeNumberOfVertices(e[o][t])}f=Z}let x=new h,_=0,C;for(o=0;o<n;++o){if(C=e[o][t].boundingSphere,!l(C)){x=void 0;break}h.add(C.center,x,x)}if(l(x))for(h.divideByScalar(x,n,x),o=0;o<n;++o){C=e[o][t].boundingSphere;let V=h.magnitude(h.subtract(C.center,x,DZe))+C.radius;V>_&&(_=V)}return new mt({attributes:u,indices:f,primitiveType:d,boundingSphere:l(x)?new ce(x,_):void 0})}Wc.combineInstances=function(e){let t=[],n=[],i=e.length;for(let r=0;r<i;++r){let s=e[r];l(s.geometry)?t.push(s):l(s.westHemisphereGeometry)&&l(s.eastHemisphereGeometry)&&n.push(s)}let o=[];return t.length>0&&o.push(pO(t,"geometry")),n.length>0&&(o.push(pO(n,"westHemisphereGeometry")),o.push(pO(n,"eastHemisphereGeometry"))),o};var ou=new h,aE=new h,MS=new h,NS=new h;Wc.computeNormal=function(e){let t=e.indices,n=e.attributes,i=n.position.values,o=n.position.values.length/3,r=t.length,s=new Array(o),a=new Array(r/3),c=new Array(r),d;for(d=0;d<o;d++)s[d]={indexOffset:0,count:0,currentCount:0};let u=0;for(d=0;d<r;d+=3){let f=t[d],x=t[d+1],_=t[d+2],C=f*3,V=x*3,L=_*3;aE.x=i[C],aE.y=i[C+1],aE.z=i[C+2],MS.x=i[V],MS.y=i[V+1],MS.z=i[V+2],NS.x=i[L],NS.y=i[L+1],NS.z=i[L+2],s[f].count++,s[x].count++,s[_].count++,h.subtract(MS,aE,MS),h.subtract(NS,aE,NS),a[u]=h.cross(MS,NS,new h),u++}let m=0;for(d=0;d<o;d++)s[d].indexOffset+=m,m+=s[d].count;u=0;let p;for(d=0;d<r;d+=3){p=s[t[d]];let f=p.indexOffset+p.currentCount;c[f]=u,p.currentCount++,p=s[t[d+1]],f=p.indexOffset+p.currentCount,c[f]=u,p.currentCount++,p=s[t[d+2]],f=p.indexOffset+p.currentCount,c[f]=u,p.currentCount++,u++}let y=new Float32Array(o*3);for(d=0;d<o;d++){let f=d*3;if(p=s[d],h.clone(h.ZERO,ou),p.count>0){for(u=0;u<p.count;u++)h.add(ou,a[c[p.indexOffset+u]],ou);h.equalsEpsilon(h.ZERO,ou,W.EPSILON10)&&h.clone(a[c[p.indexOffset]],ou)}h.equalsEpsilon(h.ZERO,ou,W.EPSILON10)&&(ou.z=1),h.normalize(ou,ou),y[f]=ou.x,y[f+1]=ou.y,y[f+2]=ou.z}return e.attributes.normal=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:y}),e};var BZe=new h,mee=new h,OZe=new h;Wc.computeTangentAndBitangent=function(e){let t=e.attributes,n=e.indices,i=e.attributes.position.values,o=e.attributes.normal.values,r=e.attributes.st.values,s=e.attributes.position.values.length/3,a=n.length,c=new Array(s*3),d;for(d=0;d<c.length;d++)c[d]=0;let u,m,p;for(d=0;d<a;d+=3){let x=n[d],_=n[d+1],C=n[d+2];u=x*3,m=_*3,p=C*3;let V=x*2,L=_*2,Z=C*2,G=i[u],I=i[u+1],P=i[u+2],v=r[V],F=r[V+1],M=r[L+1]-F,b=r[Z+1]-F,R=1/((r[L]-v)*b-(r[Z]-v)*M),E=(b*(i[m]-G)-M*(i[p]-G))*R,X=(b*(i[m+1]-I)-M*(i[p+1]-I))*R,w=(b*(i[m+2]-P)-M*(i[p+2]-P))*R;c[u]+=E,c[u+1]+=X,c[u+2]+=w,c[m]+=E,c[m+1]+=X,c[m+2]+=w,c[p]+=E,c[p+1]+=X,c[p+2]+=w}let y=new Float32Array(s*3),f=new Float32Array(s*3);for(d=0;d<s;d++){u=d*3,m=u+1,p=u+2;let x=h.fromArray(o,u,BZe),_=h.fromArray(c,u,OZe),C=h.dot(x,_);h.multiplyByScalar(x,C,mee),h.normalize(h.subtract(_,mee,_),_),y[u]=_.x,y[m]=_.y,y[p]=_.z,h.normalize(h.cross(x,_,_),_),f[u]=_.x,f[m]=_.y,f[p]=_.z}return e.attributes.tangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:y}),e.attributes.bitangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:f}),e};var cE=new B,xm=new h,hee=new h,fee=new h,HM=new B;Wc.compressVertices=function(e){let t=e.attributes.extrudeDirection,n,i;if(l(t)){let I=t.values;i=I.length/3;let P=new Float32Array(i*2),v=0;for(n=0;n<i;++n){if(h.fromArray(I,n*3,xm),h.equals(xm,h.ZERO)){v+=2;continue}HM=Fn.octEncodeInRange(xm,65535,HM),P[v++]=HM.x,P[v++]=HM.y}return e.attributes.compressedAttributes=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:P}),delete e.attributes.extrudeDirection,e}let o=e.attributes.normal,r=e.attributes.st,s=l(o),a=l(r);if(!s&&!a)return e;let c=e.attributes.tangent,d=e.attributes.bitangent,u=l(c),m=l(d),p,y,f,x;s&&(p=o.values),a&&(y=r.values),u&&(f=c.values),m&&(x=d.values),i=(s?p.length:y.length)/(s?3:2);let V=i,L=a&&s?2:1;L+=u||m?1:0,V*=L;let Z=new Float32Array(V),G=0;for(n=0;n<i;++n){a&&(B.fromArray(y,n*2,cE),Z[G++]=Fn.compressTextureCoordinates(cE));let I=n*3;s&&l(f)&&l(x)?(h.fromArray(p,I,xm),h.fromArray(f,I,hee),h.fromArray(x,I,fee),Fn.octPack(xm,hee,fee,cE),Z[G++]=cE.x,Z[G++]=cE.y):(s&&(h.fromArray(p,I,xm),Z[G++]=Fn.octEncodeFloat(xm)),u&&(h.fromArray(f,I,xm),Z[G++]=Fn.octEncodeFloat(xm)),m&&(h.fromArray(x,I,xm),Z[G++]=Fn.octEncodeFloat(xm)))}return e.attributes.compressedAttributes=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:L,values:Z}),s&&delete e.attributes.normal,a&&delete e.attributes.st,m&&delete e.attributes.bitangent,u&&delete e.attributes.tangent,e};function YZe(e){if(l(e.indices))return e;let t=mt.computeNumberOfVertices(e),n=Ne.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function HZe(e){let t=mt.computeNumberOfVertices(e),n=Ne.createTypedArray(t,(t-2)*3);n[0]=1,n[1]=0,n[2]=2;let i=3;for(let o=3;o<t;++o)n[i++]=o-1,n[i++]=0,n[i++]=o;return e.indices=n,e.primitiveType=Ae.TRIANGLES,e}function KZe(e){let t=mt.computeNumberOfVertices(e),n=Ne.createTypedArray(t,(t-2)*3);n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let o=3;o<t-1;o+=2)n[i++]=o,n[i++]=o-1,n[i++]=o+1,o+2<t&&(n[i++]=o,n[i++]=o+1,n[i++]=o+2);return e.indices=n,e.primitiveType=Ae.TRIANGLES,e}function zZe(e){if(l(e.indices))return e;let t=mt.computeNumberOfVertices(e),n=Ne.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function JZe(e){let t=mt.computeNumberOfVertices(e),n=Ne.createTypedArray(t,(t-1)*2);n[0]=0,n[1]=1;let i=2;for(let o=2;o<t;++o)n[i++]=o-1,n[i++]=o;return e.indices=n,e.primitiveType=Ae.LINES,e}function QZe(e){let t=mt.computeNumberOfVertices(e),n=Ne.createTypedArray(t,t*2);n[0]=0,n[1]=1;let i=2;for(let o=2;o<t;++o)n[i++]=o-1,n[i++]=o;return n[i++]=t-1,n[i]=0,e.indices=n,e.primitiveType=Ae.LINES,e}function jZe(e){switch(e.primitiveType){case Ae.TRIANGLE_FAN:return HZe(e);case Ae.TRIANGLE_STRIP:return KZe(e);case Ae.TRIANGLES:return YZe(e);case Ae.LINE_STRIP:return JZe(e);case Ae.LINE_LOOP:return QZe(e);case Ae.LINES:return zZe(e)}return e}function Vb(e,t){Math.abs(e.y)<W.EPSILON6&&(t?e.y=-W.EPSILON6:e.y=W.EPSILON6)}function qZe(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){Vb(e,e.y<0),Vb(t,t.y<0),Vb(n,n.y<0);return}let i=Math.abs(e.y),o=Math.abs(t.y),r=Math.abs(n.y),s;i>o?i>r?s=W.sign(e.y):s=W.sign(n.y):o>r?s=W.sign(t.y):s=W.sign(n.y);let a=s<0;Vb(e,a),Vb(t,a),Vb(n,a)}var pee=new h;function ru(e,t,n,i){h.add(e,h.multiplyByScalar(h.subtract(t,e,pee),e.y/(e.y-t.y),pee),n),h.clone(n,i),Vb(n,!0),Vb(i,!1)}var sx=new h,ax=new h,cx=new h,lx=new h,bO={positions:new Array(7),indices:new Array(3*3)};function $Ze(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;qZe(e,t,n);let i=e.y<0,o=t.y<0,r=n.y<0,s=0;s+=i?1:0,s+=o?1:0,s+=r?1:0;let a=bO.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(ru(e,t,sx,cx),ru(e,n,ax,lx),a[0]=0,a[3]=1,a[4]=2,a[6]=1):o?(ru(t,n,sx,cx),ru(t,e,ax,lx),a[0]=1,a[3]=2,a[4]=0,a[6]=2):r&&(ru(n,e,sx,cx),ru(n,t,ax,lx),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):s===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,i?o?r||(ru(n,e,sx,cx),ru(n,t,ax,lx),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(ru(t,n,sx,cx),ru(t,e,ax,lx),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(ru(e,t,sx,cx),ru(e,n,ax,lx),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=bO.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(s===1||s===2)&&(c[3]=sx,c[4]=ax,c[5]=cx,c[6]=lx,c.length=7),bO}function bee(e,t){let n=e.attributes;if(n.position.values.length===0)return;for(let o in n)if(n.hasOwnProperty(o)&&l(n[o])&&l(n[o].values)){let r=n[o];r.values=Q.createTypedArray(r.componentDatatype,r.values)}let i=mt.computeNumberOfVertices(e);return e.indices=Ne.createTypedArray(i,e.indices),t&&(e.boundingSphere=ce.fromVertices(n.position.values)),e}function kS(e){let t=e.attributes,n={};for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let o=t[i];n[i]=new Ge({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new mt({attributes:n,indices:[],primitiveType:e.primitiveType})}function _O(e,t,n){let i=l(e.geometry.boundingSphere);t=bee(t,i),n=bee(n,i),l(n)&&!l(t)?e.geometry=n:!l(n)&&l(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function TO(e,t){let n=new e,i=new e,o=new e;return function(r,s,a,c,d,u,m,p){let y=e.fromArray(d,r*t,n),f=e.fromArray(d,s*t,i),x=e.fromArray(d,a*t,o);e.multiplyByScalar(y,c.x,y),e.multiplyByScalar(f,c.y,f),e.multiplyByScalar(x,c.z,x);let _=e.add(y,f,y);e.add(_,x,_),p&&e.normalize(_,_),e.pack(_,u,m*t)}}var eGe=TO(se,4),JM=TO(h,3),See=TO(B,2),tGe=function(e,t,n,i,o,r,s){let a=o[e]*i.x,c=o[t]*i.y,d=o[n]*i.z;r[s]=a+c+d>W.EPSILON6?1:0},lE=new h,yO=new h,gO=new h,nGe=new h;function KM(e,t,n,i,o,r,s,a,c,d,u,m,p,y,f,x){if(!l(r)&&!l(s)&&!l(a)&&!l(c)&&!l(d)&&y===0)return;let _=h.fromArray(o,e*3,lE),C=h.fromArray(o,t*3,yO),V=h.fromArray(o,n*3,gO),L=rx(i,_,C,V,nGe);if(l(L)){if(l(r)&&JM(e,t,n,L,r,m.normal.values,x,!0),l(d)){let Z=h.fromArray(d,e*3,lE),G=h.fromArray(d,t*3,yO),I=h.fromArray(d,n*3,gO);h.multiplyByScalar(Z,L.x,Z),h.multiplyByScalar(G,L.y,G),h.multiplyByScalar(I,L.z,I);let P;!h.equals(Z,h.ZERO)||!h.equals(G,h.ZERO)||!h.equals(I,h.ZERO)?(P=h.add(Z,G,Z),h.add(P,I,P),h.normalize(P,P)):(P=lE,P.x=0,P.y=0,P.z=0),h.pack(P,m.extrudeDirection.values,x*3)}if(l(u)&&tGe(e,t,n,L,u,m.applyOffset.values,x),l(s)&&JM(e,t,n,L,s,m.tangent.values,x,!0),l(a)&&JM(e,t,n,L,a,m.bitangent.values,x,!0),l(c)&&See(e,t,n,L,c,m.st.values,x),y>0)for(let Z=0;Z<y;Z++){let G=p[Z];iGe(e,t,n,L,x,f[G],m[G])}}}function iGe(e,t,n,i,o,r,s){let a=r.componentsPerAttribute,c=r.values,d=s.values;switch(a){case 4:eGe(e,t,n,i,c,d,o,!1);break;case 3:JM(e,t,n,i,c,d,o,!1);break;case 2:See(e,t,n,i,c,d,o,!1);break;default:d[o]=c[e]*i.x+c[t]*i.y+c[n]*i.z}}function Qh(e,t,n,i,o,r){let s=e.position.values.length/3;if(o!==-1){let a=i[o],c=n[a];return c===-1?(n[a]=s,e.position.values.push(r.x,r.y,r.z),t.push(s),s):(t.push(c),c)}return e.position.values.push(r.x,r.y,r.z),t.push(s),s}var oGe={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function yee(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=l(n.normal)?n.normal.values:void 0,r=l(n.bitangent)?n.bitangent.values:void 0,s=l(n.tangent)?n.tangent.values:void 0,a=l(n.st)?n.st.values:void 0,c=l(n.extrudeDirection)?n.extrudeDirection.values:void 0,d=l(n.applyOffset)?n.applyOffset.values:void 0,u=t.indices,m=[];for(let P in n)n.hasOwnProperty(P)&&!oGe[P]&&l(n[P])&&m.push(P);let p=m.length,y=kS(t),f=kS(t),x,_,C,V,L,Z=[];Z.length=i.length/3;let G=[];for(G.length=i.length/3,L=0;L<Z.length;++L)Z[L]=-1,G[L]=-1;let I=u.length;for(L=0;L<I;L+=3){let P=u[L],v=u[L+1],F=u[L+2],M=h.fromArray(i,P*3),b=h.fromArray(i,v*3),R=h.fromArray(i,F*3),E=$Ze(M,b,R);if(l(E)&&E.positions.length>3){let X=E.positions,w=E.indices,N=w.length;for(let D=0;D<N;++D){let k=w[D],Y=X[k];Y.y<0?(x=f.attributes,_=f.indices,C=Z):(x=y.attributes,_=y.indices,C=G),V=Qh(x,_,C,u,k<3?L+k:-1,Y),KM(P,v,F,Y,i,o,s,r,a,c,d,x,m,p,n,V)}}else l(E)&&(M=E.positions[0],b=E.positions[1],R=E.positions[2]),M.y<0?(x=f.attributes,_=f.indices,C=Z):(x=y.attributes,_=y.indices,C=G),V=Qh(x,_,C,u,L,M),KM(P,v,F,M,i,o,s,r,a,c,d,x,m,p,n,V),V=Qh(x,_,C,u,L+1,b),KM(P,v,F,b,i,o,s,r,a,c,d,x,m,p,n,V),V=Qh(x,_,C,u,L+2,R),KM(P,v,F,R,i,o,s,r,a,c,d,x,m,p,n,V)}_O(e,f,y)}var Cee=ln.fromPointNormal(h.ZERO,h.UNIT_Y),rGe=new h,sGe=new h;function US(e,t,n,i,o,r,s){if(!l(s))return;let a=h.fromArray(i,e*3,lE);h.equalsEpsilon(a,n,W.EPSILON10)?r.applyOffset.values[o]=s[e]:r.applyOffset.values[o]=s[t]}function gee(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=l(n.applyOffset)?n.applyOffset.values:void 0,r=t.indices,s=kS(t),a=kS(t),c,d=r.length,u=[];u.length=i.length/3;let m=[];for(m.length=i.length/3,c=0;c<u.length;++c)u[c]=-1,m[c]=-1;for(c=0;c<d;c+=2){let p=r[c],y=r[c+1],f=h.fromArray(i,p*3,lE),x=h.fromArray(i,y*3,yO),_;Math.abs(f.y)<W.EPSILON6&&(f.y<0?f.y=-W.EPSILON6:f.y=W.EPSILON6),Math.abs(x.y)<W.EPSILON6&&(x.y<0?x.y=-W.EPSILON6:x.y=W.EPSILON6);let C=s.attributes,V=s.indices,L=m,Z=a.attributes,G=a.indices,I=u,P=ni.lineSegmentPlane(f,x,Cee,gO);if(l(P)){let v=h.multiplyByScalar(h.UNIT_Y,5*W.EPSILON9,rGe);f.y<0&&(h.negate(v,v),C=a.attributes,V=a.indices,L=u,Z=s.attributes,G=s.indices,I=m);let F=h.add(P,v,sGe);_=Qh(C,V,L,r,c,f),US(p,y,f,i,_,C,o),_=Qh(C,V,L,r,-1,F),US(p,y,F,i,_,C,o),h.negate(v,v),h.add(P,v,F),_=Qh(Z,G,I,r,-1,F),US(p,y,F,i,_,Z,o),_=Qh(Z,G,I,r,c+1,x),US(p,y,x,i,_,Z,o)}else{let v,F,M;f.y<0?(v=a.attributes,F=a.indices,M=u):(v=s.attributes,F=s.indices,M=m),_=Qh(v,F,M,r,c,f),US(p,y,f,i,_,v,o),_=Qh(v,F,M,r,c+1,x),US(p,y,x,i,_,v,o)}}_O(e,a,s)}var xee=new B,aGe=new B,Vee=new h,Lee=new h,xO=new h,cGe=new h,lGe=new h,dGe=new h,_ee=new se;function Tee(e){let t=e.attributes,n=t.position.values,i=t.prevPosition.values,o=t.nextPosition.values,r=n.length;for(let s=0;s<r;s+=3){let a=h.unpack(n,s,Vee);if(a.x>0)continue;let c=h.unpack(i,s,Lee);(a.y<0&&c.y>0||a.y>0&&c.y<0)&&(s-3>0?(i[s]=n[s-3],i[s+1]=n[s-2],i[s+2]=n[s-1]):h.pack(a,i,s));let d=h.unpack(o,s,xO);(a.y<0&&d.y>0||a.y>0&&d.y<0)&&(s+3<r?(o[s]=n[s+3],o[s+1]=n[s+4],o[s+2]=n[s+5]):h.pack(a,o,s))}}var uGe=5*W.EPSILON9,zM=W.EPSILON6;function mGe(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=n.prevPosition.values,r=n.nextPosition.values,s=n.expandAndWidth.values,a=l(n.st)?n.st.values:void 0,c=l(n.color)?n.color.values:void 0,d=kS(t),u=kS(t),m,p,y,f=!1,x=i.length/3;for(m=0;m<x;m+=4){let _=m,C=m+2,V=h.fromArray(i,_*3,Vee),L=h.fromArray(i,C*3,Lee);if(Math.abs(V.y)<zM)for(V.y=zM*(L.y<0?-1:1),i[m*3+1]=V.y,i[(m+1)*3+1]=V.y,p=_*3;p<_*3+4*3;p+=3)o[p]=i[m*3],o[p+1]=i[m*3+1],o[p+2]=i[m*3+2];if(Math.abs(L.y)<zM)for(L.y=zM*(V.y<0?-1:1),i[(m+2)*3+1]=L.y,i[(m+3)*3+1]=L.y,p=_*3;p<_*3+4*3;p+=3)r[p]=i[(m+2)*3],r[p+1]=i[(m+2)*3+1],r[p+2]=i[(m+2)*3+2];let Z=d.attributes,G=d.indices,I=u.attributes,P=u.indices,v=ni.lineSegmentPlane(V,L,Cee,cGe);if(l(v)){f=!0;let F=h.multiplyByScalar(h.UNIT_Y,uGe,lGe);V.y<0&&(h.negate(F,F),Z=u.attributes,G=u.indices,I=d.attributes,P=d.indices);let M=h.add(v,F,dGe);Z.position.values.push(V.x,V.y,V.z,V.x,V.y,V.z),Z.position.values.push(M.x,M.y,M.z),Z.position.values.push(M.x,M.y,M.z),Z.prevPosition.values.push(o[_*3],o[_*3+1],o[_*3+2]),Z.prevPosition.values.push(o[_*3+3],o[_*3+4],o[_*3+5]),Z.prevPosition.values.push(V.x,V.y,V.z,V.x,V.y,V.z),Z.nextPosition.values.push(M.x,M.y,M.z),Z.nextPosition.values.push(M.x,M.y,M.z),Z.nextPosition.values.push(M.x,M.y,M.z),Z.nextPosition.values.push(M.x,M.y,M.z),h.negate(F,F),h.add(v,F,M),I.position.values.push(M.x,M.y,M.z),I.position.values.push(M.x,M.y,M.z),I.position.values.push(L.x,L.y,L.z,L.x,L.y,L.z),I.prevPosition.values.push(M.x,M.y,M.z),I.prevPosition.values.push(M.x,M.y,M.z),I.prevPosition.values.push(M.x,M.y,M.z),I.prevPosition.values.push(M.x,M.y,M.z),I.nextPosition.values.push(L.x,L.y,L.z,L.x,L.y,L.z),I.nextPosition.values.push(r[C*3],r[C*3+1],r[C*3+2]),I.nextPosition.values.push(r[C*3+3],r[C*3+4],r[C*3+5]);let b=B.fromArray(s,_*2,xee),R=Math.abs(b.y);Z.expandAndWidth.values.push(-1,R,1,R),Z.expandAndWidth.values.push(-1,-R,1,-R),I.expandAndWidth.values.push(-1,R,1,R),I.expandAndWidth.values.push(-1,-R,1,-R);let E=h.magnitudeSquared(h.subtract(v,V,xO));if(E/=h.magnitudeSquared(h.subtract(L,V,xO)),l(c)){let X=se.fromArray(c,_*4,_ee),w=se.fromArray(c,C*4,_ee),N=W.lerp(X.x,w.x,E),D=W.lerp(X.y,w.y,E),k=W.lerp(X.z,w.z,E),Y=W.lerp(X.w,w.w,E);for(p=_*4;p<_*4+2*4;++p)Z.color.values.push(c[p]);for(Z.color.values.push(N,D,k,Y),Z.color.values.push(N,D,k,Y),I.color.values.push(N,D,k,Y),I.color.values.push(N,D,k,Y),p=C*4;p<C*4+2*4;++p)I.color.values.push(c[p])}if(l(a)){let X=B.fromArray(a,_*2,xee),w=B.fromArray(a,(m+3)*2,aGe),N=W.lerp(X.x,w.x,E);for(p=_*2;p<_*2+2*2;++p)Z.st.values.push(a[p]);for(Z.st.values.push(N,X.y),Z.st.values.push(N,w.y),I.st.values.push(N,X.y),I.st.values.push(N,w.y),p=C*2;p<C*2+2*2;++p)I.st.values.push(a[p])}y=Z.position.values.length/3-4,G.push(y,y+2,y+1),G.push(y+1,y+2,y+3),y=I.position.values.length/3-4,P.push(y,y+2,y+1),P.push(y+1,y+2,y+3)}else{let F,M;for(V.y<0?(F=u.attributes,M=u.indices):(F=d.attributes,M=d.indices),F.position.values.push(V.x,V.y,V.z),F.position.values.push(V.x,V.y,V.z),F.position.values.push(L.x,L.y,L.z),F.position.values.push(L.x,L.y,L.z),p=m*3;p<m*3+4*3;++p)F.prevPosition.values.push(o[p]),F.nextPosition.values.push(r[p]);for(p=m*2;p<m*2+4*2;++p)F.expandAndWidth.values.push(s[p]),l(a)&&F.st.values.push(a[p]);if(l(c))for(p=m*4;p<m*4+4*4;++p)F.color.values.push(c[p]);y=F.position.values.length/3-4,M.push(y,y+2,y+1),M.push(y+1,y+2,y+3)}}f&&(Tee(u),Tee(d)),_O(e,u,d)}Wc.splitLongitude=function(e){let t=e.geometry,n=t.boundingSphere;if(l(n)&&(n.center.x-n.radius>0||ce.intersectPlane(n,ln.ORIGIN_ZX_PLANE)!==nn.INTERSECTING))return e;if(t.geometryType!==nu.NONE)switch(t.geometryType){case nu.POLYLINES:mGe(e);break;case nu.TRIANGLES:yee(e);break;case nu.LINES:gee(e);break}else jZe(t),t.primitiveType===Ae.TRIANGLES?yee(e):t.primitiveType===Ae.LINES&&gee(e);return e};var Mn=Wc;var tBt=T(S(),1);function yl(e){this._ellipsoid=g(e,oe.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(yl.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});yl.mercatorAngleToGeodeticLatitude=function(e){return W.PI_OVER_TWO-2*Math.atan(Math.exp(-e))};yl.geodeticLatitudeToMercatorAngle=function(e){e>yl.MaximumLatitude?e=yl.MaximumLatitude:e<-yl.MaximumLatitude&&(e=-yl.MaximumLatitude);let t=Math.sin(e);return .5*Math.log((1+t)/(1-t))};yl.MaximumLatitude=yl.mercatorAngleToGeodeticLatitude(Math.PI);yl.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=yl.geodeticLatitudeToMercatorAngle(e.latitude)*n,r=e.height;return l(t)?(t.x=i,t.y=o,t.z=r,t):new h(i,o,r)};yl.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,o=yl.mercatorAngleToGeodeticLatitude(e.y*n),r=e.z;return l(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new he(i,o,r)};var Gi=yl;function hGe(e,t,n){let i=!n,o=e.length,r;if(!i&&o>1){let s=e[0].modelMatrix;for(r=1;r<o;++r)if(!A.equals(s,e[r].modelMatrix)){i=!0;break}}if(i)for(r=0;r<o;++r)l(e[r].geometry)&&Mn.transformToWorldCoordinates(e[r]);else A.multiplyTransformation(t,e[0].modelMatrix,t)}function SO(e,t){let n=e.attributes,i=n.position,o=i.values.length/i.componentsPerAttribute;n.batchId=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:1,values:new Float32Array(o)});let r=n.batchId.values;for(let s=0;s<o;++s)r[s]=t}function fGe(e){let t=e.length;for(let n=0;n<t;++n){let i=e[n];l(i.geometry)?SO(i.geometry,n):l(i.westHemisphereGeometry)&&l(i.eastHemisphereGeometry)&&(SO(i.westHemisphereGeometry,n),SO(i.eastHemisphereGeometry,n))}}function pGe(e){let t=e.instances,n=e.projection,i=e.elementIndexUintSupported,o=e.scene3DOnly,r=e.vertexCacheOptimize,s=e.compressVertices,a=e.modelMatrix,c,d,u,m=t.length;for(c=0;c<m;++c)if(l(t[c].geometry)){u=t[c].geometry.primitiveType;break}if(hGe(t,a,o),!o)for(c=0;c<m;++c)l(t[c].geometry)&&Mn.splitLongitude(t[c]);if(fGe(t),r)for(c=0;c<m;++c){let y=t[c];l(y.geometry)?(Mn.reorderForPostVertexCache(y.geometry),Mn.reorderForPreVertexCache(y.geometry)):l(y.westHemisphereGeometry)&&l(y.eastHemisphereGeometry)&&(Mn.reorderForPostVertexCache(y.westHemisphereGeometry),Mn.reorderForPreVertexCache(y.westHemisphereGeometry),Mn.reorderForPostVertexCache(y.eastHemisphereGeometry),Mn.reorderForPreVertexCache(y.eastHemisphereGeometry))}let p=Mn.combineInstances(t);for(m=p.length,c=0;c<m;++c){d=p[c];let y=d.attributes;if(o)for(let f in y)y.hasOwnProperty(f)&&y[f].componentDatatype===Q.DOUBLE&&Mn.encodeAttribute(d,f,`${f}3DHigh`,`${f}3DLow`);else for(let f in y)if(y.hasOwnProperty(f)&&y[f].componentDatatype===Q.DOUBLE){let x=`${f}3D`,_=`${f}2D`;Mn.projectTo2D(d,f,x,_,n),l(d.boundingSphere)&&f==="position"&&(d.boundingSphereCV=ce.fromVertices(d.attributes.position2D.values)),Mn.encodeAttribute(d,x,`${x}High`,`${x}Low`),Mn.encodeAttribute(d,_,`${_}High`,`${_}Low`)}s&&Mn.compressVertices(d)}if(!i){let y=[];for(m=p.length,c=0;c<m;++c)d=p[c],y=y.concat(Mn.fitToUnsignedShortIndices(d));p=y}return p}function CO(e,t,n,i){let o,r,s,a=i.length-1;if(a>=0){let d=i[a];o=d.offset+d.count,s=d.index,r=n[s].indices.length}else o=0,s=0,r=n[s].indices.length;let c=e.length;for(let d=0;d<c;++d){let m=e[d][t];if(!l(m))continue;let p=m.indices.length;o+p>r&&(o=0,r=n[++s].indices.length),i.push({index:s,offset:o,count:p}),o+=p}}function bGe(e,t){let n=[];return CO(e,"geometry",t,n),CO(e,"westHemisphereGeometry",t,n),CO(e,"eastHemisphereGeometry",t,n),n}var gp={};gp.combineGeometry=function(e){let t,n,i=e.instances,o=i.length,r,s,a=!1;o>0&&(t=pGe(e),t.length>0&&(n=Mn.createAttributeLocations(t[0]),e.createPickOffsets&&(r=bGe(i,t))),l(i[0].attributes)&&l(i[0].attributes.offset)&&(s=new Array(o),a=!0));let c=new Array(o),d=new Array(o);for(let u=0;u<o;++u){let m=i[u],p=m.geometry;l(p)&&(c[u]=p.boundingSphere,d[u]=p.boundingSphereCV,a&&(s[u]=m.geometry.offsetAttribute));let y=m.eastHemisphereGeometry,f=m.westHemisphereGeometry;l(y)&&l(f)&&(l(y.boundingSphere)&&l(f.boundingSphere)&&(c[u]=ce.union(y.boundingSphere,f.boundingSphere)),l(y.boundingSphereCV)&&l(f.boundingSphereCV)&&(d[u]=ce.union(y.boundingSphereCV,f.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:r,offsetInstanceExtend:s,boundingSpheres:c,boundingSpheresCV:d}};function yGe(e,t){let n=e.attributes;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];l(o)&&l(o.values)&&t.push(o.values.buffer)}l(e.indices)&&t.push(e.indices.buffer)}function gGe(e,t){let n=e.length;for(let i=0;i<n;++i)yGe(e[i],t)}function xGe(e){let t=1,n=e.length;for(let i=0;i<n;i++){let o=e[i];if(++t,!l(o))continue;let r=o.attributes;t+=7+2*ce.packedLength+(l(o.indices)?o.indices.length:0);for(let s in r)if(r.hasOwnProperty(s)&&l(r[s])){let a=r[s];t+=5+a.values.length}}return t}gp.packCreateGeometryResults=function(e,t){let n=new Float64Array(xGe(e)),i=[],o={},r=e.length,s=0;n[s++]=r;for(let a=0;a<r;a++){let c=e[a],d=l(c);if(n[s++]=d?1:0,!d)continue;n[s++]=c.primitiveType,n[s++]=c.geometryType,n[s++]=g(c.offsetAttribute,-1);let u=l(c.boundingSphere)?1:0;n[s++]=u,u&&ce.pack(c.boundingSphere,n,s),s+=ce.packedLength;let m=l(c.boundingSphereCV)?1:0;n[s++]=m,m&&ce.pack(c.boundingSphereCV,n,s),s+=ce.packedLength;let p=c.attributes,y=[];for(let x in p)p.hasOwnProperty(x)&&l(p[x])&&(y.push(x),l(o[x])||(o[x]=i.length,i.push(x)));n[s++]=y.length;for(let x=0;x<y.length;x++){let _=y[x],C=p[_];n[s++]=o[_],n[s++]=C.componentDatatype,n[s++]=C.componentsPerAttribute,n[s++]=C.normalize?1:0,n[s++]=C.values.length,n.set(C.values,s),s+=C.values.length}let f=l(c.indices)?c.indices.length:0;n[s++]=f,f>0&&(n.set(c.indices,s),s+=f)}return t.push(n.buffer),{stringTable:i,packedData:n}};gp.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,o=new Array(n[0]),r=0,s=1;for(;s<n.length;){if(!(n[s++]===1)){o[r++]=void 0;continue}let c=n[s++],d=n[s++],u=n[s++];u===-1&&(u=void 0);let m,p;n[s++]===1&&(m=ce.unpack(n,s)),s+=ce.packedLength,n[s++]===1&&(p=ce.unpack(n,s)),s+=ce.packedLength;let x,_,C,V=new pn,L=n[s++];for(i=0;i<L;i++){let G=t[n[s++]],I=n[s++];C=n[s++];let P=n[s++]!==0;x=n[s++],_=Q.createTypedArray(I,x);for(let v=0;v<x;v++)_[v]=n[s++];V[G]=new Ge({componentDatatype:I,componentsPerAttribute:C,normalize:P,values:_})}let Z;if(x=n[s++],x>0){let G=_.length/C;for(Z=Ne.createTypedArray(G,x),i=0;i<x;i++)Z[i]=n[s++]}o[r++]=new mt({primitiveType:c,geometryType:d,boundingSphere:m,boundingSphereCV:p,indices:Z,attributes:V,offsetAttribute:u})}return o};function _Ge(e,t){let n=e.length,i=new Float64Array(1+n*19),o=0;i[o++]=n;for(let r=0;r<n;r++){let s=e[r];if(A.pack(s.modelMatrix,i,o),o+=A.packedLength,l(s.attributes)&&l(s.attributes.offset)){let a=s.attributes.offset.value;i[o]=a[0],i[o+1]=a[1],i[o+2]=a[2]}o+=3}return t.push(i.buffer),i}function TGe(e){let t=e,n=new Array(t[0]),i=0,o=1;for(;o<t.length;){let r=A.unpack(t,o),s;o+=A.packedLength,l(t[o])&&(s={offset:new eo(t[o],t[o+1],t[o+2])}),o+=3,n[i++]={modelMatrix:r,attributes:s}}return n}gp.packCombineGeometryParameters=function(e,t){let n=e.createGeometryResults,i=n.length;for(let o=0;o<i;o++)t.push(n[o].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:_Ge(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof Ri,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};gp.unpackCombineGeometryParameters=function(e){let t=TGe(e.packedInstances),n=e.createGeometryResults,i=n.length,o=0;for(let a=0;a<i;a++){let c=gp.unpackCreateGeometryResults(n[a]),d=c.length;for(let u=0;u<d;u++){let m=c[u],p=t[o];p.geometry=m,++o}}let r=oe.clone(e.ellipsoid),s=e.isGeographic?new Ri(r):new Gi(r);return{instances:t,ellipsoid:r,projection:s,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:A.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function Ree(e){let t=e.length,n=1+(ce.packedLength+1)*t,i=new Float32Array(n),o=0;i[o++]=t;for(let r=0;r<t;++r){let s=e[r];l(s)?(i[o++]=1,ce.pack(e[r],i,o)):i[o++]=0,o+=ce.packedLength}return i}function Zee(e){let t=new Array(e[0]),n=0,i=1;for(;i<e.length;)e[i++]===1&&(t[n]=ce.unpack(e,i)),++n,i+=ce.packedLength;return t}gp.packCombineGeometryResults=function(e,t){l(e.geometries)&&gGe(e.geometries,t);let n=Ree(e.boundingSpheres),i=Ree(e.boundingSpheresCV);return t.push(n.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:n,boundingSpheresCV:i}};gp.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:Zee(e.boundingSpheres),boundingSpheresCV:Zee(e.boundingSpheresCV)}};var dx=gp;var xBt=T(S(),1),SGe={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6},gr=Object.freeze(SGe);var TBt=T(S(),1),jM={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};jM.getMorphTime=function(e){return e===jM.SCENE3D?1:e===jM.MORPHING?void 0:0};var ie=Object.freeze(jM);var CBt=T(S(),1),nd={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};nd.NUMBER_OF_SHADOW_MODES=4;nd.castShadows=function(e){return e===nd.ENABLED||e===nd.CAST_ONLY};nd.receiveShadows=function(e){return e===nd.ENABLED||e===nd.RECEIVE_ONLY};nd.fromCastReceive=function(e,t){return e&&t?nd.ENABLED:e?nd.CAST_ONLY:t?nd.RECEIVE_ONLY:nd.DISABLED};var Cn=Object.freeze(nd);function xr(e){e=g(e,g.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=A.clone(g(e.modelMatrix,A.IDENTITY)),this._modelMatrix=new A,this.show=g(e.show,!0),this._vertexCacheOptimize=g(e.vertexCacheOptimize,!1),this._interleave=g(e.interleave,!1),this._releaseGeometryInstances=g(e.releaseGeometryInstances,!0),this._allowPicking=g(e.allowPicking,!0),this._asynchronous=g(e.asynchronous,!0),this._compressVertices=g(e.compressVertices,!0),this.cull=g(e.cull,!0),this.debugShowBoundingVolume=g(e.debugShowBoundingVolume,!1),this.rtcCenter=e.rtcCenter,this.shadows=g(e.shadows,Cn.DISABLED),this._translucent=void 0,this._state=gr.READY,this._geometries=[],this._error=void 0,this._numberOfInstances=0,this._boundingSpheres=[],this._boundingSphereWC=[],this._boundingSphereCV=[],this._boundingSphere2D=[],this._boundingSphereMorph=[],this._perInstanceAttributeCache=new Map,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._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._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}Object.defineProperties(xr.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}}});function CGe(e){let t=e.length,n=[],i=e[0].attributes,o;for(o in i)if(i.hasOwnProperty(o)&&l(i[o])){let r=i[o],s=!0;for(let a=1;a<t;++a){let c=e[a].attributes[o];if(!l(c)||r.componentDatatype!==c.componentDatatype||r.componentsPerAttribute!==c.componentsPerAttribute||r.normalize!==c.normalize){s=!1;break}}s&&n.push(o)}return n}var VGe=new B,LGe=new h,Fee=new se;function Aee(e){let t=e.length;if(t===1)return e[0];if(t===2)return B.unpack(e,0,VGe);if(t===3)return h.unpack(e,0,LGe);if(t===4)return se.unpack(e,0,Fee)}function RGe(e,t){let n=e.geometryInstances,i=Array.isArray(n)?n:[n],o=i.length;if(o===0)return;let r=CGe(i),s=r.length,a=[],c={},d={},u,p=i[0].attributes,y,f,x;for(y=0;y<s;++y)f=r[y],x=p[f],c[f]=y,a.push({functionName:`czm_batchTable_${f}`,componentDatatype:x.componentDatatype,componentsPerAttribute:x.componentsPerAttribute,normalize:x.normalize});r.indexOf("distanceDisplayCondition")!==-1&&(a.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:Q.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:Q.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:Q.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:Q.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:Q.FLOAT,componentsPerAttribute:1}),d.center3DHigh=a.length-5,d.center3DLow=a.length-4,d.center2DHigh=a.length-3,d.center2DLow=a.length-2,d.radius=a.length-1),r.indexOf("offset")!==-1&&(a.push({functionName:"czm_batchTable_offset2D",componentDatatype:Q.FLOAT,componentsPerAttribute:3}),u=a.length-1),a.push({functionName:"czm_batchTable_pickColor",componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});let _=a.length,C=new ox(t,a,o);for(y=0;y<o;++y){let V=i[y];p=V.attributes;for(let P=0;P<s;++P){f=r[P],x=p[f];let v=Aee(x.value),F=c[f];C.setBatchedAttribute(y,F,v)}let L={primitive:g(V.pickPrimitive,e)};l(V.id)&&(L.id=V.id);let Z=t.createPickId(L);e._pickIds.push(Z);let G=Z.color,I=Fee;I.x=O.floatToByte(G.red),I.y=O.floatToByte(G.green),I.z=O.floatToByte(G.blue),I.w=O.floatToByte(G.alpha),C.setBatchedAttribute(y,_-1,I)}e._batchTable=C,e._batchTableAttributeIndices=c,e._batchTableBoundingSphereAttributeIndices=d,e._batchTableOffsetAttribute2DIndex=u}function ZGe(e){let t;return Array.isArray(e.values)?t=e.values.slice(0):t=new e.values.constructor(e.values),new Ge({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function GGe(e){let t=e.attributes,n=new pn;for(let o in t)t.hasOwnProperty(o)&&l(t[o])&&(n[o]=ZGe(t[o]));let i;if(l(e.indices)){let o=e.indices;Array.isArray(o)?i=o.slice(0):i=new o.constructor(o)}return new mt({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:ce.clone(e.boundingSphere)})}function EGe(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:A.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var IGe=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;xr._modifyShaderPosition=function(e,t,n){let i,o="",r="",s="";for(;(i=IGe.exec(t))!==null;){let a=i[1],c=`vec4 czm_compute${a[0].toUpperCase()}${a.substr(1)}()`;c!=="vec4 czm_computePosition()"&&(o+=`${c};
`),l(e.rtcCenter)?(t=t.replace(/in\s+vec(?:3|4)\s+position3DHigh;/g,""),t=t.replace(/in\s+vec(?:3|4)\s+position3DLow;/g,""),o+=`uniform mat4 u_modifiedModelView;
`,r+=`in vec4 position;
`,s+=`${c}
{
return u_modifiedModelView * position;
}
`,t=t.replace(/czm_modelViewRelativeToEye\s+\*\s+/g,""),t=t.replace(/czm_modelViewProjectionRelativeToEye/g,"czm_projection")):n?s+=`${c}
{
return czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow);
}
`:(r+=`in vec3 ${a}2DHigh;
in vec3 ${a}2DLow;
`,s+=`${c}
{
vec4 p;
if (czm_morphTime == 1.0)
{
p = czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow);
}
else if (czm_morphTime == 0.0)
{
p = czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy);
}
else
{
p = czm_columbusViewMorph(
czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy),
czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow),
czm_morphTime);
}
return p;
}
`)}return[o,r,t,s].join(`
`)};xr._appendShowToShader=function(e,t){return l(e._batchTableAttributeIndices.show)?`${Oe.replaceMain(t,"czm_non_show_main")}
void main()
{
czm_non_show_main();
gl_Position *= czm_batchTable_show(batchId);
}`:t};xr._updateColorAttribute=function(e,t,n){if(!l(e._batchTableAttributeIndices.color)&&!l(e._batchTableAttributeIndices.depthFailColor)||t.search(/in\s+vec4\s+color;/g)===-1)return t;let i=t;return i=i.replace(/in\s+vec4\s+color;/g,""),n?i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_depthFailColor(batchId)$2"):i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_color(batchId)$2"),i};function Gee(e){return`${Oe.replaceMain(e,"czm_non_pick_main")}
out vec4 v_pickColor;
void main()
{
czm_non_pick_main();
v_pickColor = czm_batchTable_pickColor(batchId);
}`}function Eee(e){return`in vec4 v_pickColor;
${e}`}xr._updatePickColorAttribute=function(e){let t=e.replace(/in\s+vec4\s+pickColor;/g,"");return t=t.replace(/(\b)pickColor(\b)/g,"$1czm_batchTable_pickColor(batchId)$2"),t};xr._appendOffsetToShader=function(e,t){if(!l(e._batchTableAttributeIndices.offset))return t;let n=`in float batchId;
`;n+="in float applyOffset;";let i=t.replace(/in\s+float\s+batchId;/g,n),o=`vec4 $1 = czm_computePosition();
`;return o+=` if (czm_sceneMode == czm_sceneMode3D)
`,o+=` {
`,o+=" $1 = $1 + vec4(czm_batchTable_offset(batchId) * applyOffset, 0.0);",o+=` }
`,o+=` else
`,o+=` {
`,o+=" $1 = $1 + vec4(czm_batchTable_offset2D(batchId) * applyOffset, 0.0);",o+=` }
`,i=i.replace(/vec4\s+([A-Za-z0-9_]+)\s+=\s+czm_computePosition\(\);/g,o),i};xr._appendDistanceDisplayConditionToShader=function(e,t,n){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition))return t;let i=Oe.replaceMain(t,"czm_non_distanceDisplayCondition_main"),o=`void main()
{
czm_non_distanceDisplayCondition_main();
vec2 distanceDisplayCondition = czm_batchTable_distanceDisplayCondition(batchId);
vec3 boundingSphereCenter3DHigh = czm_batchTable_boundingSphereCenter3DHigh(batchId);
vec3 boundingSphereCenter3DLow = czm_batchTable_boundingSphereCenter3DLow(batchId);
float boundingSphereRadius = czm_batchTable_boundingSphereRadius(batchId);
`;return n?o+=` vec4 centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);
`:o+=` vec3 boundingSphereCenter2DHigh = czm_batchTable_boundingSphereCenter2DHigh(batchId);
vec3 boundingSphereCenter2DLow = czm_batchTable_boundingSphereCenter2DLow(batchId);
vec4 centerRTE;
if (czm_morphTime == 1.0)
{
centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);
}
else if (czm_morphTime == 0.0)
{
centerRTE = czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy);
}
else
{
centerRTE = czm_columbusViewMorph(
czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy),
czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow),
czm_morphTime);
}
`,o+=` float radiusSq = boundingSphereRadius * boundingSphereRadius;
float distanceSq;
if (czm_sceneMode == czm_sceneMode2D)
{
distanceSq = czm_eyeHeight2D.y - radiusSq;
}
else
{
distanceSq = dot(centerRTE.xyz, centerRTE.xyz) - radiusSq;
}
distanceSq = max(distanceSq, 0.0);
float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x;
float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y;
float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0;
gl_Position *= show;
}`,`${i}
${o}`};function Iee(e,t){if(!e.compressVertices)return t;let n=t.search(/in\s+vec3\s+normal;/g)!==-1,i=t.search(/in\s+vec2\s+st;/g)!==-1;if(!n&&!i)return t;let o=t.search(/in\s+vec3\s+tangent;/g)!==-1,r=t.search(/in\s+vec3\s+bitangent;/g)!==-1,s=i&&n?2:1;s+=o||r?1:0;let a=s>1?`vec${s}`:"float",c="compressedAttributes",d=`in ${a} ${c};`,u="",m="";if(i){u+=`vec2 st;
`;let f=s>1?`${c}.x`:c;m+=` st = czm_decompressTextureCoordinates(${f});
`}n&&o&&r?(u+=`vec3 normal;
vec3 tangent;
vec3 bitangent;
`,m+=` czm_octDecode(${c}.${i?"yz":"xy"}, normal, tangent, bitangent);
`):(n&&(u+=`vec3 normal;
`,m+=` normal = czm_octDecode(${c}${s>1?`.${i?"y":"x"}`:""});
`),o&&(u+=`vec3 tangent;
`,m+=` tangent = czm_octDecode(${c}.${i&&n?"z":"y"});
`),r&&(u+=`vec3 bitangent;
`,m+=` bitangent = czm_octDecode(${c}.${i&&n?"z":"y"});
`));let p=t;p=p.replace(/in\s+vec3\s+normal;/g,""),p=p.replace(/in\s+vec2\s+st;/g,""),p=p.replace(/in\s+vec3\s+tangent;/g,""),p=p.replace(/in\s+vec3\s+bitangent;/g,""),p=Oe.replaceMain(p,"czm_non_compressed_main");let y=`void main()
{
${m} czm_non_compressed_main();
}`;return[d,u,p,y].join(`
`)}function XGe(e){let t=Oe.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() {
czm_non_depth_clamp_main();
gl_Position = czm_depthClamp(gl_Position);}
`,t}function WGe(e){let t=Oe.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() {
czm_non_depth_clamp_main();
#if defined(LOG_DEPTH)
czm_writeLogDepth();
#else
czm_writeDepthClamp();
#endif
}
`,t}function Xee(e,t){let n=e.vertexAttributes}function PGe(e,t){return function(){return e[t]}}var VO=Math.max(Bt.hardwareConcurrency-1,1),qM,vGe=new gi("combineGeometry");function wGe(e,t){let n,i,o,r,s=e._instanceIds;if(e._state===gr.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let a=e._numberOfInstances=n.length,c=[],d=[];for(o=0;o<a;++o)i=n[o].geometry,s.push(n[o].id),d.push({moduleName:i._workerName,geometry:i});if(!l(qM))for(qM=new Array(VO),o=0;o<VO;o++)qM[o]=new gi("createGeometry");let u;for(d=iE(d,VO),o=0;o<d.length;o++){let m=0,p=d[o],y=p.length;for(r=0;r<y;++r)u=p[r],i=u.geometry,l(i.constructor.pack)&&(u.offset=m,m+=g(i.constructor.packedLength,i.packedLength));let f;if(m>0){let x=new Float64Array(m);for(f=[x.buffer],r=0;r<y;++r)u=p[r],i=u.geometry,l(i.constructor.pack)&&(i.constructor.pack(i,x,u.offset),u.geometry=x)}c.push(qM[o].scheduleTask({subTasks:d[o]},f))}e._state=gr.CREATING,Promise.all(c).then(function(m){e._createGeometryResults=m,e._state=gr.CREATED}).catch(function(m){uE(e,t,gr.FAILED,m)})}else if(e._state===gr.CREATED){let a=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let c=t.scene3DOnly,d=t.mapProjection,u=vGe.scheduleTask(dx.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:n,ellipsoid:d.ellipsoid,projection:d,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:c,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},a),a);e._createGeometryResults=void 0,e._state=gr.COMBINING,Promise.resolve(u).then(function(m){let p=dx.unpackCombineGeometryResults(m);e._geometries=p.geometries,e._attributeLocations=p.attributeLocations,e.modelMatrix=A.clone(p.modelMatrix,e.modelMatrix),e._pickOffsets=p.pickOffsets,e._offsetInstanceExtend=p.offsetInstanceExtend,e._instanceBoundingSpheres=p.boundingSpheres,e._instanceBoundingSpheresCV=p.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=gr.COMBINED):uE(e,t,gr.FAILED,void 0)}).catch(function(m){uE(e,t,gr.FAILED,m)})}}function FGe(e,t){let n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,o=new Array(i),r=e._instanceIds,s,a,c=0;for(a=0;a<i;a++){s=n[a];let p=s.geometry,y;l(p.attributes)&&l(p.primitiveType)?y=GGe(p):y=p.constructor.createGeometry(p),o[c++]=EGe(s,y),r.push(s.id)}o.length=c;let d=t.scene3DOnly,u=t.mapProjection,m=dx.combineGeometry({instances:o,ellipsoid:u.ellipsoid,projection:u,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:d,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=m.geometries,e._attributeLocations=m.attributeLocations,e.modelMatrix=A.clone(m.modelMatrix,e.modelMatrix),e._pickOffsets=m.pickOffsets,e._offsetInstanceExtend=m.offsetInstanceExtend,e._instanceBoundingSpheres=m.boundingSpheres,e._instanceBoundingSpheresCV=m.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=gr.COMBINED):uE(e,t,gr.FAILED,void 0)}function AGe(e,t){let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!l(n)){e._recomputeBoundingSpheres=!1;return}let i,o=e._offsetInstanceExtend,r=e._instanceBoundingSpheres,s=r.length,a=e._tempBoundingSpheres;if(!l(a)){for(a=new Array(s),i=0;i<s;i++)a[i]=new ce;e._tempBoundingSpheres=a}for(i=0;i<s;++i){let x=a[i],_=e._batchTable.getBatchedAttribute(i,n,new h);x=r[i].clone(x),kee(x,_,o[i])}let c=[],d=[],u=[];for(i=0;i<s;++i){let x=a[i];x.center.x-x.radius>0||ce.intersectPlane(x,ln.ORIGIN_ZX_PLANE)!==nn.INTERSECTING?c.push(x):(d.push(x),u.push(x))}let m=c[0],p=u[0],y=d[0];for(i=1;i<c.length;i++)m=ce.union(m,c[i]);for(i=1;i<u.length;i++)p=ce.union(p,u[i]);for(i=1;i<d.length;i++)y=ce.union(y,d[i]);let f=[];for(l(m)&&f.push(m),l(p)&&f.push(p),l(y)&&f.push(y),i=0;i<f.length;i++){let x=f[i].clone(e._boundingSpheres[i]);e._boundingSpheres[i]=x,e._boundingSphereCV[i]=ce.projectTo2D(x,t.mapProjection,e._boundingSphereCV[i])}xr._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}var Wee=new Kn,Mee=new he,Nee=new h,Uee=new ce;function MGe(e,t){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition)||e._batchTableBoundingSpheresUpdated)return;let i=e._batchTableBoundingSphereAttributeIndices,o=i.center3DHigh,r=i.center3DLow,s=i.center2DHigh,a=i.center2DLow,c=i.radius,d=t.mapProjection,u=d.ellipsoid,m=e._batchTable,p=e._instanceBoundingSpheres,y=p.length;for(let f=0;f<y;++f){let x=p[f];if(!l(x))continue;let _=e.modelMatrix;l(_)&&(x=ce.transform(x,_,Uee));let C=x.center,V=x.radius,L=Kn.fromCartesian(C,Wee);if(m.setBatchedAttribute(f,o,L.high),m.setBatchedAttribute(f,r,L.low),!t.scene3DOnly){let Z=u.cartesianToCartographic(C,Mee),G=d.project(Z,Nee);L=Kn.fromCartesian(G,Wee),m.setBatchedAttribute(f,s,L.high),m.setBatchedAttribute(f,a,L.low)}m.setBatchedAttribute(f,c,V)}e._batchTableBoundingSpheresUpdated=!0}var LO=new h,NGe=new h;function Pee(e,t){if(!l(e._batchTableAttributeIndices.offset)||e._batchTableOffsetsUpdated||t.scene3DOnly)return;let i=e._batchTableOffsetAttribute2DIndex,o=t.mapProjection,r=o.ellipsoid,s=e._batchTable,a=e._instanceBoundingSpheres,c=a.length;for(let d=0;d<c;++d){let u=a[d];if(!l(u))continue;let m=s.getBatchedAttribute(d,e._batchTableAttributeIndices.offset);if(h.equals(m,h.ZERO)){s.setBatchedAttribute(d,i,h.ZERO);continue}let p=e.modelMatrix;l(p)&&(u=ce.transform(u,p,Uee));let y=u.center;y=r.scaleToGeodeticSurface(y,NGe);let f=r.cartesianToCartographic(y,Mee),x=o.project(f,Nee),_=h.add(m,y,LO);f=r.cartesianToCartographic(_,f);let C=o.project(f,LO),V=h.subtract(C,x,LO),L=V.x;V.x=V.z,V.z=V.y,V.y=L,s.setBatchedAttribute(d,i,V)}e._batchTableOffsetsUpdated=!0}function UGe(e,t){let n=e._attributeLocations,i=e._geometries,o=t.scene3DOnly,r=t.context,s=[],a=i.length;for(let c=0;c<a;++c){let d=i[c];if(s.push(oi.fromGeometry({context:r,geometry:d,attributeLocations:n,bufferUsage:Ue.STATIC_DRAW,interleave:e._interleave})),l(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,d);else if(e._boundingSpheres.push(ce.clone(d.boundingSphere)),e._boundingSphereWC.push(new ce),!o){let u=d.boundingSphereCV.center,m=u.x,p=u.y,y=u.z;u.x=y,u.y=m,u.z=p,e._boundingSphereCV.push(ce.clone(d.boundingSphereCV)),e._boundingSphere2D.push(new ce),e._boundingSphereMorph.push(new ce)}}e._va=s,e._primitiveType=i[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,uE(e,t,gr.COMPLETE,void 0)}function kGe(e,t,n,i){let o=n.getRenderState(),r;i?(r=ze(o,!1),r.cull={enabled:!0,face:yi.BACK},e._frontFaceRS=ke.fromCache(r),r.cull.face=yi.FRONT,e._backFaceRS=ke.fromCache(r)):(e._frontFaceRS=ke.fromCache(o),e._backFaceRS=e._frontFaceRS),r=ze(o,!1),l(e._depthFailAppearance)&&(r.depthTest.enabled=!1),l(e._depthFailAppearance)&&(o=e._depthFailAppearance.getRenderState(),r=ze(o,!1),r.depthTest.func=ja.GREATER,i?(r.cull={enabled:!0,face:yi.BACK},e._frontFaceDepthFailRS=ke.fromCache(r),r.cull.face=yi.FRONT,e._backFaceDepthFailRS=ke.fromCache(r)):(e._frontFaceDepthFailRS=ke.fromCache(r),e._backFaceDepthFailRS=e._frontFaceRS))}function DGe(e,t,n){let i=t.context,o=e._attributeLocations,r=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);r=xr._appendOffsetToShader(e,r),r=xr._appendShowToShader(e,r),r=xr._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=Gee(r),r=xr._updateColorAttribute(e,r,!1),r=Iee(e,r),r=xr._modifyShaderPosition(e,r,t.scene3DOnly);let s=n.getFragmentShaderSource();s=Eee(s),e._sp=Qt.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),Xee(e._sp,o),l(e._depthFailAppearance)&&(r=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),r=xr._appendShowToShader(e,r),r=xr._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=Gee(r),r=xr._updateColorAttribute(e,r,!0),r=Iee(e,r),r=xr._modifyShaderPosition(e,r,t.scene3DOnly),r=XGe(r),s=e._depthFailAppearance.getFragmentShaderSource(),s=Eee(s),s=WGe(s),e._spDepthFail=Qt.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),Xee(e._spDepthFail,o))}var dE=new A,vee=new h;function wee(e,t,n,i){let o=l(n)?n._uniforms:void 0,r={},s=t.uniforms;if(l(s))for(let c in s)s.hasOwnProperty(c)&&(r[c]=PGe(s,c));let a=Tt(r,o);return a=e._batchTable.getUniformMapCallback()(a),l(e.rtcCenter)&&(a.u_modifiedModelView=function(){let c=i.context.uniformState.view;return A.multiply(c,e._modelMatrix,dE),A.multiplyByPoint(dE,e.rtcCenter,vee),A.setTranslation(dE,vee,dE),dE}),a}function BGe(e,t,n,i,o,r,s,a){let c=wee(e,t,n,a),d;l(e._depthFailAppearance)&&(d=wee(e,e._depthFailAppearance,e._depthFailAppearance.material,a));let u=i?Ve.TRANSLUCENT:Ve.OPAQUE,m=o?2:1;m*=l(e._depthFailAppearance)?2:1,r.length=e._va.length*m;let p=r.length,y=0;for(let f=0;f<p;++f){let x;o&&(x=r[f],l(x)||(x=r[f]=new nt({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[y],x.renderState=e._backFaceRS,x.shaderProgram=e._sp,x.uniformMap=c,x.pass=u,++f),x=r[f],l(x)||(x=r[f]=new nt({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[y],x.renderState=e._frontFaceRS,x.shaderProgram=e._sp,x.uniformMap=c,x.pass=u,l(e._depthFailAppearance)&&(o&&(++f,x=r[f],l(x)||(x=r[f]=new nt({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[y],x.renderState=e._backFaceDepthFailRS,x.shaderProgram=e._spDepthFail,x.uniformMap=d,x.pass=u),++f,x=r[f],l(x)||(x=r[f]=new nt({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[y],x.renderState=e._frontFaceDepthFailRS,x.shaderProgram=e._spDepthFail,x.uniformMap=d,x.pass=u),++y}}xr._updateBoundingVolumes=function(e,t,n,i){let o,r,s;if(i||!A.equals(n,e._modelMatrix))for(A.clone(n,e._modelMatrix),r=e._boundingSpheres.length,o=0;o<r;++o)s=e._boundingSpheres[o],l(s)&&(e._boundingSphereWC[o]=ce.transform(s,n,e._boundingSphereWC[o]),t.scene3DOnly||(e._boundingSphere2D[o]=ce.clone(e._boundingSphereCV[o],e._boundingSphere2D[o]),e._boundingSphere2D[o].center.x=0,e._boundingSphereMorph[o]=ce.union(e._boundingSphereWC[o],e._boundingSphereCV[o])));let a=e.appearance.pixelSize;if(l(a))for(r=e._boundingSpheres.length,o=0;o<r;++o){s=e._boundingSpheres[o];let c=e._boundingSphereWC[o],u=t.camera.getPixelSize(s,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*a;c.radius=s.radius+u}};function OGe(e,t,n,i,o,r,s,a){xr._updateBoundingVolumes(e,t,o);let c;t.mode===ie.SCENE3D?c=e._boundingSphereWC:t.mode===ie.COLUMBUS_VIEW?c=e._boundingSphereCV:t.mode===ie.SCENE2D&&l(e._boundingSphere2D)?c=e._boundingSphere2D:l(e._boundingSphereMorph)&&(c=e._boundingSphereMorph);let d=t.commandList,u=t.passes;if(u.render||u.pick){let m=e.allowPicking,p=Cn.castShadows(e.shadows),y=Cn.receiveShadows(e.shadows),f=n.length,x=a?2:1;x*=l(e._depthFailAppearance)?2:1;for(let _=0;_<f;++_){let C=Math.floor(_/x),V=n[_];V.modelMatrix=o,V.boundingVolume=c[C],V.cull=r,V.debugShowBoundingVolume=s,V.castShadows=p,V.receiveShadows=y,m?V.pickId="v_pickColor":V.pickId=void 0,d.push(V)}}}xr.prototype.update=function(e){if(!l(this.geometryInstances)&&this._va.length===0||l(this.geometryInstances)&&Array.isArray(this.geometryInstances)&&this.geometryInstances.length===0||!l(this.appearance)||e.mode!==ie.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)return;if(l(this._error))throw this._error;if(this._state===gr.FAILED)return;let t=e.context;if(l(this._batchTable)||RGe(this,t),this._batchTable.attributes.length>0){if(Yt.maximumVertexTextureImageUnits===0)throw new me("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!==gr.COMPLETE&&this._state!==gr.COMBINED&&(this.asynchronous?wGe(this,e):FGe(this,e)),this._state===gr.COMBINED&&(MGe(this,e),Pee(this,e),UGe(this,e)),!this.show||this._state!==gr.COMPLETE)return;this._batchTableOffsetsUpdated||Pee(this,e),this._recomputeBoundingSpheres&&AGe(this,e);let n=this.appearance,i=n.material,o=!1,r=!1;this._appearance!==n?(this._appearance=n,this._material=i,o=!0,r=!0):this._material!==i&&(this._material=i,r=!0);let s=this.depthFailAppearance,a=l(s)?s.material:void 0;this._depthFailAppearance!==s?(this._depthFailAppearance=s,this._depthFailMaterial=a,o=!0,r=!0):this._depthFailMaterial!==a&&(this._depthFailMaterial=a,r=!0);let c=this._appearance.isTranslucent();this._translucent!==c&&(this._translucent=c,o=!0),l(this._material)&&this._material.update(t);let d=n.closed&&c;o&&g(this._createRenderStatesFunction,kGe)(this,t,n,d),r&&g(this._createShaderProgramFunction,DGe)(this,e,n),(o||r)&&g(this._createCommandsFunction,BGe)(this,n,i,c,d,this._colorCommands,this._pickCommands,e),g(this._updateAndQueueCommandsFunction,OGe)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,d)};var YGe=new ce,HGe=new ce;function kee(e,t,n){if(n===an.TOP){let i=ce.clone(e,YGe),o=ce.clone(e,HGe);o.center=h.add(o.center,t,o.center),e=ce.union(i,o,e)}else n===an.ALL&&(e.center=h.add(e.center,t,e.center));return e}function KGe(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),o=e.attributes[n],r=o.componentsPerAttribute,s=Q.createTypedArray(o.componentDatatype,r);return l(i.constructor.pack)?i.constructor.pack(i,s,0):s[0]=i,s}}function zGe(e,t,n,i,o){return function(r){let s=Aee(r);e.setBatchedAttribute(t,n,s),o==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var JGe=new h;function QGe(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(l(i)){i=i.clone();let o=e.modelMatrix,r=t.offset;l(r)&&kee(i,h.fromArray(r.get(),0,JGe),e._offsetInstanceExtend[n]),l(o)&&(i=ce.transform(i,o))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function jGe(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}xr.prototype.getGeometryInstanceAttributes=function(e){let t=this._perInstanceAttributeCache.get(e);if(l(t))return t;let n=-1,i=this._lastPerInstanceAttributeIndex,o=this._instanceIds,r=o.length;for(let d=0;d<r;++d){let u=(i+d)%r;if(e===o[u]){n=u;break}}if(n===-1)return;let s=this._batchTable,a=this._batchTableAttributeIndices;t={};let c={};for(let d in a)if(a.hasOwnProperty(d)){let u=a[d];c[d]={get:KGe(s,n,u),set:zGe(s,n,u,this,d)}}return QGe(this,c,n),jGe(this,c,n),Object.defineProperties(t,c),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t};xr.prototype.isDestroyed=function(){return!1};xr.prototype.destroy=function(){let e,t;this._sp=this._sp&&this._sp.destroy(),this._spDepthFail=this._spDepthFail&&this._spDepthFail.destroy();let n=this._va;for(e=n.length,t=0;t<e;++t)n[t].destroy();this._va=void 0;let i=this._pickIds;for(e=i.length,t=0;t<e;++t)i[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,ue(this)};function uE(e,t,n,i){e._error=i,e._state=n,t.afterRender.push(function(){if(e._ready=e._state===gr.COMPLETE||e._state===gr.FAILED,!l(i))return!0})}var En=xr;var W3t=T(S(),1);var h3t=T(S(),1);function qGe(e){e=g(e,g.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=g(e.normalize,!1),this.value=e.value}var qa=qGe;var p3t=T(S(),1),DS=`#ifdef TEXTURE_COORDINATES
#ifdef SPHERICAL
in vec4 v_sphericalExtents;
#else // SPHERICAL
in vec2 v_inversePlaneExtents;
in vec4 v_westPlane;
in vec4 v_southPlane;
#endif // SPHERICAL
in vec3 v_uvMinAndSphericalLongitudeRotation;
in vec3 v_uMaxAndInverseDistance;
in vec3 v_vMaxAndInverseDistance;
#endif // TEXTURE_COORDINATES
#ifdef PER_INSTANCE_COLOR
in vec4 v_color;
#endif
#ifdef NORMAL_EC
vec3 getEyeCoordinate3FromWindowCoordinate(vec2 fragCoord, float logDepthOrDepth) {
vec4 eyeCoordinate = czm_windowToEyeCoordinates(fragCoord, logDepthOrDepth);
return eyeCoordinate.xyz / eyeCoordinate.w;
}
vec3 vectorFromOffset(vec4 eyeCoordinate, vec2 positiveOffset) {
vec2 glFragCoordXY = gl_FragCoord.xy;
// Sample depths at both offset and negative offset
float upOrRightLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY + positiveOffset) / czm_viewport.zw));
float downOrLeftLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY - positiveOffset) / czm_viewport.zw));
// Explicitly evaluate both paths
// Necessary for multifrustum and for edges of the screen
bvec2 upOrRightInBounds = lessThan(glFragCoordXY + positiveOffset, czm_viewport.zw);
float useUpOrRight = float(upOrRightLogDepth > 0.0 && upOrRightInBounds.x && upOrRightInBounds.y);
float useDownOrLeft = float(useUpOrRight == 0.0);
vec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth);
vec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth);
return (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft;
}
#endif // NORMAL_EC
void main(void)
{
#ifdef REQUIRES_EC
float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw));
vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
#endif
#ifdef REQUIRES_WC
vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate;
vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w;
#endif
#ifdef TEXTURE_COORDINATES
vec2 uv;
#ifdef SPHERICAL
// Treat world coords as a sphere normal for spherical coordinates
vec2 sphericalLatLong = czm_approximateSphericalCoordinates(worldCoordinate);
sphericalLatLong.y += v_uvMinAndSphericalLongitudeRotation.z;
sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi);
uv.x = (sphericalLatLong.y - v_sphericalExtents.y) * v_sphericalExtents.w;
uv.y = (sphericalLatLong.x - v_sphericalExtents.x) * v_sphericalExtents.z;
#else // SPHERICAL
// Unpack planes and transform to eye space
uv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x;
uv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y;
#endif // SPHERICAL
#endif // TEXTURE_COORDINATES
#ifdef PICK
#ifdef CULL_FRAGMENTS
// When classifying translucent geometry, logDepthOrDepth == 0.0
// indicates a region that should not be classified, possibly due to there
// being opaque pixels there in another buffer.
// Check for logDepthOrDepth != 0.0 to make sure this should be classified.
if (0.0 <= uv.x && uv.x <= 1.0 && 0.0 <= uv.y && uv.y <= 1.0 || logDepthOrDepth != 0.0) {
out_FragColor.a = 1.0; // 0.0 alpha leads to discard from ShaderSource.createPickFragmentShaderSource
czm_writeDepthClamp();
}
#else // CULL_FRAGMENTS
out_FragColor.a = 1.0;
#endif // CULL_FRAGMENTS
#else // PICK
#ifdef CULL_FRAGMENTS
// When classifying translucent geometry, logDepthOrDepth == 0.0
// indicates a region that should not be classified, possibly due to there
// being opaque pixels there in another buffer.
if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) {
discard;
}
#endif
#ifdef NORMAL_EC
// Compute normal by sampling adjacent pixels in 2x2 block in screen space
vec3 downUp = vectorFromOffset(eyeCoordinate, vec2(0.0, 1.0));
vec3 leftRight = vectorFromOffset(eyeCoordinate, vec2(1.0, 0.0));
vec3 normalEC = normalize(cross(leftRight, downUp));
#endif
#ifdef PER_INSTANCE_COLOR
vec4 color = czm_gammaCorrect(v_color);
#ifdef FLAT
out_FragColor = color;
#else // FLAT
czm_materialInput materialInput;
materialInput.normalEC = normalEC;
materialInput.positionToEyeEC = -eyeCoordinate.xyz;
czm_material material = czm_getDefaultMaterial(materialInput);
material.diffuse = color.rgb;
material.alpha = color.a;
out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC);
#endif // FLAT
// Premultiply alpha. Required for classification primitives on translucent globe.
out_FragColor.rgb *= out_FragColor.a;
#else // PER_INSTANCE_COLOR
// Material support.
// USES_ is distinct from REQUIRES_, because some things are dependencies of each other or
// dependencies for culling but might not actually be used by the material.
czm_materialInput materialInput;
#ifdef USES_NORMAL_EC
materialInput.normalEC = normalEC;
#endif
#ifdef USES_POSITION_TO_EYE_EC
materialInput.positionToEyeEC = -eyeCoordinate.xyz;
#endif
#ifdef USES_TANGENT_TO_EYE
materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(worldCoordinate, normalEC);
#endif
#ifdef USES_ST
// Remap texture coordinates from computed (approximately aligned with cartographic space) to the desired
// texture coordinate system, which typically forms a tight oriented bounding box around the geometry.
// Shader is provided a set of reference points for remapping.
materialInput.st.x = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_uMaxAndInverseDistance.xy, uv) * v_uMaxAndInverseDistance.z;
materialInput.st.y = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_vMaxAndInverseDistance.xy, uv) * v_vMaxAndInverseDistance.z;
#endif
czm_material material = czm_getMaterial(materialInput);
#ifdef FLAT
out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#else // FLAT
out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC);
#endif // FLAT
// Premultiply alpha. Required for classification primitives on translucent globe.
out_FragColor.rgb *= out_FragColor.a;
#endif // PER_INSTANCE_COLOR
czm_writeDepthClamp();
#endif // PICK
}
`;function su(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new RO;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let o=new RO;if(o.requiresTextureCoordinates=e,n instanceof cn)i.requiresNormalEC=!n.flat;else{let r=`${n.material.shaderSource}
${n.fragmentShaderSource}`;i.normalEC=r.indexOf("materialInput.normalEC")!==-1||r.indexOf("czm_getDefaultMaterial")!==-1,i.positionToEyeEC=r.indexOf("materialInput.positionToEyeEC")!==-1,i.tangentToEyeMatrix=r.indexOf("materialInput.tangentToEyeMatrix")!==-1,i.st=r.indexOf("materialInput.st")!==-1}this._colorShaderDependencies=i,this._pickShaderDependencies=o,this._appearance=n,this._extentsCulling=e,this._planarExtents=t}su.prototype.createFragmentShader=function(e){let t=this._appearance,n=this._colorShaderDependencies,i=[];!e&&!this._planarExtents&&i.push("SPHERICAL"),n.requiresEC&&i.push("REQUIRES_EC"),n.requiresWC&&i.push("REQUIRES_WC"),n.requiresTextureCoordinates&&i.push("TEXTURE_COORDINATES"),this._extentsCulling&&i.push("CULL_FRAGMENTS"),n.requiresNormalEC&&i.push("NORMAL_EC"),t instanceof cn&&i.push("PER_INSTANCE_COLOR"),n.normalEC&&i.push("USES_NORMAL_EC"),n.positionToEyeEC&&i.push("USES_POSITION_TO_EYE_EC"),n.tangentToEyeMatrix&&i.push("USES_TANGENT_TO_EYE"),n.st&&i.push("USES_ST"),t.flat&&i.push("FLAT");let o="";return t instanceof cn||(o=t.material.shaderSource),new Oe({defines:i,sources:[o,DS]})};su.prototype.createPickFragmentShader=function(e){let t=this._pickShaderDependencies,n=["PICK"];return!e&&!this._planarExtents&&n.push("SPHERICAL"),t.requiresEC&&n.push("REQUIRES_EC"),t.requiresWC&&n.push("REQUIRES_WC"),t.requiresTextureCoordinates&&n.push("TEXTURE_COORDINATES"),this._extentsCulling&&n.push("CULL_FRAGMENTS"),new Oe({defines:n,sources:[DS],pickColorQualifier:"in"})};su.prototype.createVertexShader=function(e,t,n,i){return Jee(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};su.prototype.createPickVertexShader=function(e,t,n,i){return Jee(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var Dee=new h,Bee=new he,Oee={high:0,low:0};function Jee(e,t,n,i,o,r,s,a){let c=i.slice();if(a.eastMostYhighDefine===""){let d=Bee;d.longitude=W.PI,d.latitude=0,d.height=0;let u=s.project(d,Dee),m=Kn.encode(u.x,Oee);a.eastMostYhighDefine=`EAST_MOST_X_HIGH ${m.high.toFixed(`${m.high}`.length+1)}`,a.eastMostYlowDefine=`EAST_MOST_X_LOW ${m.low.toFixed(`${m.low}`.length+1)}`;let p=Bee;p.longitude=-W.PI,p.latitude=0,p.height=0;let y=s.project(p,Dee);m=Kn.encode(y.x,Oee),a.westMostYhighDefine=`WEST_MOST_X_HIGH ${m.high.toFixed(`${m.high}`.length+1)}`,a.westMostYlowDefine=`WEST_MOST_X_LOW ${m.low.toFixed(`${m.low}`.length+1)}`}return n&&(c.push(a.eastMostYhighDefine),c.push(a.eastMostYlowDefine),c.push(a.westMostYhighDefine),c.push(a.westMostYlowDefine)),l(r)&&r instanceof cn&&c.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(c.push("TEXTURE_COORDINATES"),t||n||c.push("SPHERICAL"),n&&c.push("COLUMBUS_VIEW_2D")),new Oe({defines:c,sources:[o]})}function RO(){this._requiresEC=!1,this._requiresWC=!1,this._requiresNormalEC=!1,this._requiresTextureCoordinates=!1,this._usesNormalEC=!1,this._usesPositionToEyeEC=!1,this._usesTangentToEyeMat=!1,this._usesSt=!1}Object.defineProperties(RO.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}}});function Yee(e,t,n){return Math.abs((t.y-e.y)*n.x-(t.x-e.x)*n.y+t.x*e.y-t.y*e.x)/B.distance(t,e)}var $Ge=[new B,new B,new B,new B];function Qee(e,t){let n=$Ge,i=B.unpack(t,0,n[0]),o=B.unpack(t,2,n[1]),r=B.unpack(t,4,n[2]);e.uMaxVmax=new qa({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o.x,o.y,r.x,r.y]});let s=1/Yee(i,o,r),a=1/Yee(i,r,o);e.uvMinAndExtents=new qa({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var jee=new he,qee=new h,eEe=new h,tEe=new h,$M={high:0,low:0};function $ee(e,t,n){let i=jee;i.height=0,i.longitude=e.west,i.latitude=e.south;let o=t.project(i,qee);i.latitude=e.north;let r=t.project(i,eEe);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,tEe),a=[0,0,0,0],c=[0,0,0,0],d=Kn.encode(o.x,$M);a[0]=d.high,c[0]=d.low,d=Kn.encode(o.y,$M),a[1]=d.high,c[1]=d.low,d=Kn.encode(r.y,$M),a[2]=d.high,c[2]=d.low,d=Kn.encode(s.x,$M),a[3]=d.high,c[3]=d.low,n.planes2D_HIGH=new qa({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new qa({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var nEe=new A,iEe=new A,Hee=new h,oEe=new he,rEe=[new he,new he,new he,new he,new he,new he,new he,new he];function sEe(e,t,n,i,o,r){let s=de.center(e,oEe);s.height=n;let a=he.toCartesian(s,t,Hee),c=Xt.eastNorthUpToFixedFrame(a,t,nEe),d=A.inverse(c,iEe),u=e.west,m=e.east,p=e.north,y=e.south,f=rEe;f[0].latitude=y,f[0].longitude=u,f[1].latitude=p,f[1].longitude=u,f[2].latitude=p,f[2].longitude=m,f[3].latitude=y,f[3].longitude=m;let x=(u+m)*.5,_=(p+y)*.5;f[4].latitude=y,f[4].longitude=x,f[5].latitude=p,f[5].longitude=x,f[6].latitude=_,f[6].longitude=u,f[7].latitude=_,f[7].longitude=m;let C=Number.POSITIVE_INFINITY,V=Number.NEGATIVE_INFINITY,L=Number.POSITIVE_INFINITY,Z=Number.NEGATIVE_INFINITY;for(let v=0;v<8;v++){f[v].height=n;let F=he.toCartesian(f[v],t,Hee);A.multiplyByPoint(d,F,F),F.z=0,C=Math.min(C,F.x),V=Math.max(V,F.x),L=Math.min(L,F.y),Z=Math.max(Z,F.y)}let G=i;G.x=C,G.y=L,G.z=0,A.multiplyByPoint(c,G,G);let I=o;I.x=V,I.y=L,I.z=0,A.multiplyByPoint(c,I,I),h.subtract(I,G,o);let P=r;P.x=C,P.y=Z,P.z=0,A.multiplyByPoint(c,P,P),h.subtract(P,G,r)}var aEe=new h,cEe=new h,lEe=new Kn;su.getPlanarTextureCoordinateAttributes=function(e,t,n,i,o){let r=qee,s=aEe,a=cEe;sEe(e,n,g(o,0),r,s,a);let c={};Qee(c,t);let d=Kn.fromCartesian(r,lEe);return c.southWest_HIGH=new qa({componentDatatype:Q.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(d.high,[0,0,0])}),c.southWest_LOW=new qa({componentDatatype:Q.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(d.low,[0,0,0])}),c.eastward=new qa({componentDatatype:Q.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(s,[0,0,0])}),c.northward=new qa({componentDatatype:Q.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(a,[0,0,0])}),$ee(e,i,c),c};var dEe=new h;function Kee(e,t,n,i){let o=jee;o.latitude=e,o.longitude=t,o.height=0;let r=he.toCartesian(o,n,dEe),s=Math.sqrt(r.x*r.x+r.y*r.y),a=W.fastApproximateAtan2(s,r.z),c=W.fastApproximateAtan2(r.x,r.y);return i.x=a,i.y=c,i}var zee=new B;su.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let o=Kee(e.south,e.west,n,zee),r=o.x,s=o.y,a=Kee(e.north,e.east,n,zee),c=a.x,d=a.y,u=0;s>d&&(u=W.PI-s,s=-W.PI,d+=u),r-=W.EPSILON5,s-=W.EPSILON5,c+=W.EPSILON5,d+=W.EPSILON5;let m=1/(d-s),p=1/(c-r),y={sphericalExtents:new qa({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r,s,p,m]}),longitudeRotation:new qa({componentDatatype:Q.FLOAT,componentsPerAttribute:1,normalize:!1,value:[u]})};return Qee(y,t),$ee(e,i,y),y};su.hasAttributesForTextureCoordinatePlanes=function(e){return l(e.southWest_HIGH)&&l(e.southWest_LOW)&&l(e.northward)&&l(e.eastward)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};su.hasAttributesForSphericalExtents=function(e){return l(e.sphericalExtents)&&l(e.longitudeRotation)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};function uEe(e){return Math.max(e.width,e.height)>su.MAX_WIDTH_FOR_PLANAR_EXTENTS}su.shouldUseSphericalCoordinates=function(e){return uEe(e)};su.MAX_WIDTH_FOR_PLANAR_EXTENTS=W.toRadians(1);var id=su;var D3t=T(S(),1);var w3t=T(S(),1);var mEe={NEVER:ne.NEVER,LESS:ne.LESS,EQUAL:ne.EQUAL,LESS_OR_EQUAL:ne.LEQUAL,GREATER:ne.GREATER,NOT_EQUAL:ne.NOTEQUAL,GREATER_OR_EQUAL:ne.GEQUAL,ALWAYS:ne.ALWAYS},On=Object.freeze(mEe);var M3t=T(S(),1);var hEe={ZERO:ne.ZERO,KEEP:ne.KEEP,REPLACE:ne.REPLACE,INCREMENT:ne.INCR,DECREMENT:ne.DECR,INVERT:ne.INVERT,INCREMENT_WRAP:ne.INCR_WRAP,DECREMENT_WRAP:ne.DECR_WRAP},pt=Object.freeze(hEe);var eN={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};eN.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:On.ALWAYS,frontOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.REPLACE},backFunction:On.ALWAYS,backOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.REPLACE},reference:eN.CESIUM_3D_TILE_MASK,mask:eN.CESIUM_3D_TILE_MASK}};var Nt=Object.freeze(eN);function ux(e){e=g(e,g.EMPTY_OBJECT);let t=e.geometryInstances;this.geometryInstances=t,this.show=g(e.show,!0),this.classificationType=g(e.classificationType,Bn.BOTH),this.debugShowBoundingVolume=g(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=g(e.debugShowShadowVolume,!1),this._debugShowShadowVolume=!1,this._extruded=g(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._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._commandsIgnoreShow=[],this._ready=!1,this._primitive=void 0,this._pickPrimitive=e._pickPrimitive,this._hasSphericalExtentsAttribute=!1,this._hasPlanarExtentsAttributes=!1,this._hasPerColorAttribute=!1,this.appearance=e.appearance,this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._usePickOffsets=!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:g(e.vertexCacheOptimize,!1),interleave:g(e.interleave,!1),releaseGeometryInstances:g(e.releaseGeometryInstances,!0),allowPicking:g(e.allowPicking,!0),asynchronous:g(e.asynchronous,!0),compressVertices:g(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(ux.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}},_needs2DShader:{get:function(){return this._hasPlanarExtentsAttributes||this._hasSphericalExtentsAttribute}}});ux.isSupported=function(e){return e.context.stencilBuffer};function BS(e,t){let n=t?On.EQUAL:On.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:pt.KEEP,zFail:pt.DECREMENT_WRAP,zPass:pt.KEEP},backFunction:n,backOperation:{fail:pt.KEEP,zFail:pt.INCREMENT_WRAP,zPass:pt.KEEP},reference:Nt.CESIUM_3D_TILE_MASK,mask:Nt.CESIUM_3D_TILE_MASK},stencilMask:Nt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:ja.LESS_OR_EQUAL},depthMask:!1}}function GO(e){return{stencilTest:{enabled:e,frontFunction:On.NOT_EQUAL,frontOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},backFunction:On.NOT_EQUAL,backOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},reference:0,mask:Nt.CLASSIFICATION_MASK},stencilMask:Nt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:mn.PRE_MULTIPLIED_ALPHA_BLEND}}var fEe={stencilTest:{enabled:!0,frontFunction:On.NOT_EQUAL,frontOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},backFunction:On.NOT_EQUAL,backOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},reference:0,mask:Nt.CLASSIFICATION_MASK},stencilMask:Nt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function pEe(e,t,n,i){if(l(e._rsStencilDepthPass))return;let o=!e.debugShowShadowVolume;e._rsStencilDepthPass=ke.fromCache(BS(o,!1)),e._rsStencilDepthPass3DTiles=ke.fromCache(BS(o,!0)),e._rsColorPass=ke.fromCache(GO(o,!1)),e._rsPickPass=ke.fromCache(fEe)}function bEe(e,t){if(!e.compressVertices)return t;if(t.search(/in\s+vec3\s+extrudeDirection;/g)!==-1){let n="compressedAttributes",i=`in vec2 ${n};`,o=`vec3 extrudeDirection;
`,r=` extrudeDirection = czm_octDecode(${n}, 65535.0);
`,s=t;s=s.replace(/in\s+vec3\s+extrudeDirection;/g,""),s=Oe.replaceMain(s,"czm_non_compressed_main");let a=`void main()
{
${r} czm_non_compressed_main();
}`;return[i,o,s,a].join(`
`)}}function yEe(e,t){let n=t.context,i=e._primitive,o=nE;o=e._primitive._batchTable.getVertexShaderCallback()(o),o=En._appendDistanceDisplayConditionToShader(i,o),o=En._modifyShaderPosition(e,o,t.scene3DOnly),o=En._updateColorAttribute(i,o);let r=e._hasPlanarExtentsAttributes,s=r||e._hasSphericalExtentsAttribute;e._extruded&&(o=bEe(i,o));let a=e._extruded?"EXTRUDED_GEOMETRY":"",c=new Oe({defines:[a],sources:[o]}),d=new Oe({sources:[Cb]}),u=e._primitive._attributeLocations,m=new id(s,r,e.appearance);if(e._spStencil=Qt.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:u}),e._primitive.allowPicking){let f=Oe.createPickVertexShaderSource(o);f=En._appendShowToShader(i,f),f=En._updatePickColorAttribute(f);let x=m.createPickFragmentShader(!1),_=m.createPickVertexShader([a],f,!1,t.mapProjection);if(e._spPick=Qt.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:_,fragmentShaderSource:x,attributeLocations:u}),s){let C=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!l(C)){let V=m.createPickFragmentShader(!0),L=m.createPickVertexShader([a],f,!0,t.mapProjection);C=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:L,fragmentShaderSource:V,attributeLocations:u})}e._spPick2D=C}}else e._spPick=Qt.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:u});o=En._appendShowToShader(i,o),c=new Oe({defines:[a],sources:[o]}),e._sp=Qt.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:u});let p=m.createFragmentShader(!1),y=m.createVertexShader([a],o,!1,t.mapProjection);if(e._spColor=Qt.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:y,fragmentShaderSource:p,attributeLocations:u}),s){let f=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!l(f)){let x=m.createFragmentShader(!0),_=m.createVertexShader([a],o,!0,t.mapProjection);f=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:_,fragmentShaderSource:x,attributeLocations:u})}e._spColor2D=f}}function gEe(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let o,r,s,a=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap),d=e._needs2DShader;for(o=0;o<i;o+=2){let y=n._va[a++];r=t[o],l(r)||(r=t[o]=new nt({owner:e,primitiveType:n._primitiveType})),r.vertexArray=y,r.renderState=e._rsStencilDepthPass,r.shaderProgram=e._sp,r.uniformMap=c,r.pass=Ve.TERRAIN_CLASSIFICATION,s=nt.shallowClone(r,r.derivedCommands.tileset),s.renderState=e._rsStencilDepthPass3DTiles,s.pass=Ve.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,r=t[o+1],l(r)||(r=t[o+1]=new nt({owner:e,primitiveType:n._primitiveType})),r.vertexArray=y,r.renderState=e._rsColorPass,r.shaderProgram=e._spColor,r.pass=Ve.TERRAIN_CLASSIFICATION;let x=e.appearance.material;if(l(x)&&(c=Tt(c,x._uniforms)),r.uniformMap=c,s=nt.shallowClone(r,r.derivedCommands.tileset),s.pass=Ve.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,d){let _=nt.shallowClone(r,r.derivedCommands.appearance2D);_.shaderProgram=e._spColor2D,r.derivedCommands.appearance2D=_,_=nt.shallowClone(s,s.derivedCommands.appearance2D),_.shaderProgram=e._spColor2D,s.derivedCommands.appearance2D=_}}let u=e._commandsIgnoreShow,m=e._spStencil,p=0;i=u.length=i/2;for(let y=0;y<i;++y){let f=u[y]=nt.shallowClone(t[p],u[y]);f.shaderProgram=m,f.pass=Ve.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,p+=2}}function xEe(e,t){let n=e._usePickOffsets,i=e._primitive,o=i._va.length*2,r,s=0,a;n&&(r=i._pickOffsets,o=r.length*2),t.length=o;let c,d,u,m=0,p=i._batchTable.getUniformMapCallback()(e._uniformMap),y=e._needs2DShader;for(c=0;c<o;c+=2){let f=i._va[m++];if(n&&(a=r[s++],f=i._va[a.index]),d=t[c],l(d)||(d=t[c]=new nt({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),d.vertexArray=f,d.renderState=e._rsStencilDepthPass,d.shaderProgram=e._sp,d.uniformMap=p,d.pass=Ve.TERRAIN_CLASSIFICATION,n&&(d.offset=a.offset,d.count=a.count),u=nt.shallowClone(d,d.derivedCommands.tileset),u.renderState=e._rsStencilDepthPass3DTiles,u.pass=Ve.CESIUM_3D_TILE_CLASSIFICATION,d.derivedCommands.tileset=u,d=t[c+1],l(d)||(d=t[c+1]=new nt({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),d.vertexArray=f,d.renderState=e._rsPickPass,d.shaderProgram=e._spPick,d.uniformMap=p,d.pass=Ve.TERRAIN_CLASSIFICATION,n&&(d.offset=a.offset,d.count=a.count),u=nt.shallowClone(d,d.derivedCommands.tileset),u.pass=Ve.CESIUM_3D_TILE_CLASSIFICATION,d.derivedCommands.tileset=u,y){let x=nt.shallowClone(d,d.derivedCommands.pick2D);x.shaderProgram=e._spPick2D,d.derivedCommands.pick2D=x,x=nt.shallowClone(u,u.derivedCommands.pick2D),x.shaderProgram=e._spPick2D,u.derivedCommands.pick2D=x}}}function _Ee(e,t,n,i,o,r,s){gEe(e,r),xEe(e,s)}function ete(e,t){return Math.floor(e%t/2)}function ZO(e,t,n,i,o,r){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,e.debugShowBoundingVolume=r,t.commandList.push(e)}function tte(e,t,n,i,o){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,t.commandList.push(e)}function TEe(e,t,n,i,o,r,s,a){let c=e._primitive;En._updateBoundingVolumes(c,t,o);let d;t.mode===ie.SCENE3D?d=c._boundingSphereWC:t.mode===ie.COLUMBUS_VIEW?d=c._boundingSphereCV:t.mode===ie.SCENE2D&&l(c._boundingSphere2D)?d=c._boundingSphere2D:l(c._boundingSphereMorph)&&(d=c._boundingSphereMorph);let u=e.classificationType,m=u!==Bn.CESIUM_3D_TILE,p=u!==Bn.TERRAIN,y=t.passes,f,x,_;if(y.render){let C=n.length;for(f=0;f<C;++f)x=d[ete(f,C)],m&&(_=n[f],ZO(_,t,o,r,x,s)),p&&(_=n[f].derivedCommands.tileset,ZO(_,t,o,r,x,s));if(t.invertClassification){let V=e._commandsIgnoreShow,L=V.length;for(f=0;f<L;++f)x=d[f],_=V[f],ZO(_,t,o,r,x,s)}}if(y.pick){let C=i.length,V=c._pickOffsets;for(f=0;f<C;++f){let L=V[ete(f,C)];x=d[L.index],m&&(_=i[f],tte(_,t,o,r,x)),p&&(_=i[f].derivedCommands.tileset,tte(_,t,o,r,x))}}}ux.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;let t=this.appearance;l(t)&&l(t.material)&&t.material.update(e.context);let n=this,i=this._primitiveOptions;if(!l(this._primitive)){let o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],r=o.length,s,a,c,d=!1,u=!0,m,p=!1,y=!1;for(r>0&&(c=o[0].attributes,p=id.hasAttributesForSphericalExtents(c),y=id.hasAttributesForTextureCoordinatePlanes(c),m=c.color),s=0;s<r;s++){a=o[s];let x=a.attributes.color;l(x)&&(d=!0),u=u&&l(x)&&Ot.equals(m,x)}if(!u&&!p&&!y)throw new fe("All GeometryInstances must have the same color attribute except via GroundPrimitives");d&&!l(t)&&(t=new cn({flat:!0}),this.appearance=t),this._usePickOffsets=!p&&!y,this._hasSphericalExtentsAttribute=p,this._hasPlanarExtentsAttributes=y,this._hasPerColorAttribute=d;let f=new Array(r);for(s=0;s<r;++s)a=o[s],f[s]=new St({geometry:a.geometry,attributes:a.attributes,modelMatrix:a.modelMatrix,id:a.id,pickPrimitive:g(this._pickPrimitive,n)});i.appearance=t,i.geometryInstances=f,l(this._createBoundingVolumeFunction)&&(i._createBoundingVolumeFunction=function(x,_){n._createBoundingVolumeFunction(x,_)}),i._createRenderStatesFunction=function(x,_,C,V){pEe(n,_)},i._createShaderProgramFunction=function(x,_,C){yEe(n,_)},i._createCommandsFunction=function(x,_,C,V,L,Z,G){_Ee(n,void 0,void 0,!0,!1,Z,G)},l(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(x,_,C,V,L,Z,G,I){n._updateAndQueueCommandsFunction(x,_,C,V,L,Z,G,I)}:i._updateAndQueueCommandsFunction=function(x,_,C,V,L,Z,G,I){TEe(n,_,C,V,L,Z,G,I)},this._primitive=new En(i)}this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=ke.fromCache(BS(!1,!1)),this._rsStencilDepthPass3DTiles=ke.fromCache(BS(!1,!0)),this._rsColorPass=ke.fromCache(GO(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=ke.fromCache(BS(!0,!1)),this._rsStencilDepthPass3DTiles=ke.fromCache(BS(!0,!0)),this._rsColorPass=ke.fromCache(GO(!0))),this._primitive.appearance!==t&&(this._primitive.appearance=t),this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};ux.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};ux.prototype.isDestroyed=function(){return!1};ux.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,ue(this)};var OS=ux;var SEe={u_globeMinimumAltitude:function(){return 55e3}};function gl(e){e=g(e,g.EMPTY_OBJECT);let t=e.appearance,n=e.geometryInstances;if(!l(t)&&l(n)){let o=Array.isArray(n)?n:[n],r=o.length;for(let s=0;s<r;s++){let a=o[s].attributes;if(l(a)&&l(a.color)){t=new cn({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=g(e.show,!0),this.classificationType=g(e.classificationType,Bn.BOTH),this.debugShowBoundingVolume=g(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=g(e.debugShowShadowVolume,!1),this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1,this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=hi._defaultMaxTerrainHeight,this._minTerrainHeight=hi._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;let i=this;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:g(e.vertexCacheOptimize,!1),interleave:g(e.interleave,!1),releaseGeometryInstances:g(e.releaseGeometryInstances,!0),allowPicking:g(e.allowPicking,!0),asynchronous:g(e.asynchronous,!0),compressVertices:g(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:i,_extruded:!0,_uniformMap:SEe}}Object.defineProperties(gl.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}}});gl.isSupported=OS.isSupported;function nte(e){return function(t,n){let i=n.maximumRadius,o=i/Math.cos(t*.5)-i;return e._maxHeight+o}}function ite(e){return function(t,n){return e._minHeight}}var CEe=new h,VEe=new h,LEe=new h,REe=new he,ZEe=new de;function tN(e,t){let n=e.mapProjection.ellipsoid;if(!l(t.attributes)||!l(t.attributes.position3DHigh))return l(t.rectangle)?t.rectangle:void 0;let i=t.attributes.position3DHigh.values,o=t.attributes.position3DLow.values,r=i.length,s=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,d=Number.NEGATIVE_INFINITY;for(let m=0;m<r;m+=3){let p=h.unpack(i,m,CEe),y=h.unpack(o,m,VEe),f=h.add(p,y,LEe),x=n.cartesianToCartographic(f,REe),_=x.latitude,C=x.longitude;s=Math.min(s,_),a=Math.min(a,C),c=Math.max(c,_),d=Math.max(d,C)}let u=ZEe;return u.north=c,u.south=s,u.east=d,u.west=a,u}function GEe(e,t,n){let i=hi.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function EEe(e,t,n){let i=t.mapProjection.ellipsoid,o=tN(t,n),r=Xn.fromRectangle(o,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(r),!t.scene3DOnly){let s=t.mapProjection,a=ce.fromRectangleWithHeights2D(o,s,e._maxHeight,e._minHeight);h.fromElements(a.center.z,a.center.x,a.center.y,a.center),e._boundingVolumes2D.push(a)}}function EO(e,t){return Math.floor(e%t/2)}function IO(e,t,n,i,o,r,s){let a=e._primitive;n.mode!==ie.SCENE3D&&t.shaderProgram===a._spColor&&a._needs2DShader&&(t=t.derivedCommands.appearance2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=r,t.cull=o,t.debugShowBoundingVolume=s,n.commandList.push(t)}function ote(e,t,n,i,o,r){let s=e._primitive;n.mode!==ie.SCENE3D&&t.shaderProgram===s._spPick&&s._needs2DShader&&(t=t.derivedCommands.pick2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=r,t.cull=o,n.commandList.push(t)}function IEe(e,t,n,i,o,r,s,a){let c;t.mode===ie.SCENE3D?c=e._boundingVolumes:c=e._boundingVolumes2D;let d=e.classificationType,u=d!==Bn.CESIUM_3D_TILE,m=d!==Bn.TERRAIN,p=t.passes,y=e._primitive,f,x,_;if(p.render){let C=n.length;for(f=0;f<C;++f)x=c[EO(f,C)],u&&(_=n[f],IO(e,_,t,o,r,x,s)),m&&(_=n[f].derivedCommands.tileset,IO(e,_,t,o,r,x,s));if(t.invertClassification){let V=y._commandsIgnoreShow,L=V.length;for(f=0;f<L;++f)x=c[f],_=V[f],IO(e,_,t,o,r,x,s)}}if(p.pick){let C=i.length,V;for(e._useFragmentCulling||(V=y._primitive._pickOffsets),f=0;f<C;++f){if(x=c[EO(f,C)],!e._useFragmentCulling){let L=V[EO(f,C)];x=c[L.index]}u&&(_=i[f],ote(e,_,t,o,r,x)),m&&(_=i[f].derivedCommands.tileset,ote(e,_,t,o,r,x))}}}gl.initializeTerrainHeights=function(){return hi.initialize()};gl.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!hi.initialized){gl.initializeTerrainHeights();return}let t=this,n=this._classificationPrimitiveOptions;if(!l(this._primitive)){let i=e.mapProjection.ellipsoid,o,r,s,a=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],c=a.length,d=new Array(c),u,m;for(u=0;u<c;++u){o=a[u],r=o.geometry;let x=tN(e,r);l(m)?l(x)&&de.union(m,x,m):m=de.clone(x);let _=o.id;if(l(_)&&l(x)){let C=hi.getBoundingSphere(x,i);this._boundingSpheresKeys.push(_),this._boundingSpheres.push(C)}s=r.constructor,!l(s)||l(s.createShadowVolume)}GEe(this,m,i);let p=e.verticalExaggeration,y=e.verticalExaggerationRelativeHeight;this._minHeight=Dr.getHeight(this._minTerrainHeight,p,y),this._maxHeight=Dr.getHeight(this._maxTerrainHeight,p,y);let f=gl._supportsMaterials(e.context);if(this._useFragmentCulling=f,f){let x,_=!0;for(u=0;u<c;++u)if(o=a[u],r=o.geometry,m=tN(e,r),id.shouldUseSphericalCoordinates(m)){_=!1;break}for(u=0;u<c;++u){o=a[u],r=o.geometry,s=r.constructor;let C=tN(e,r),V=r.textureCoordinateRotationPoints;_?x=id.getPlanarTextureCoordinateAttributes(C,V,i,e.mapProjection,this._maxHeight):x=id.getSphericalExtentGeometryInstanceAttributes(C,V,i,e.mapProjection);let L=o.attributes;for(let Z in L)L.hasOwnProperty(Z)&&(x[Z]=L[Z]);d[u]=new St({geometry:s.createShadowVolume(r,ite(this),nte(this)),attributes:x,id:o.id})}}else for(u=0;u<c;++u)o=a[u],r=o.geometry,s=r.constructor,d[u]=new St({geometry:s.createShadowVolume(r,ite(this),nte(this)),attributes:o.attributes,id:o.id});n.geometryInstances=d,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(x,_){EEe(t,x,_)},n._updateAndQueueCommandsFunction=function(x,_,C,V,L,Z,G,I){IEe(t,_,C,V,L,Z,G,I)},this._primitive=new OS(n)}this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowShadowVolume=this.debugShowShadowVolume,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};gl.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};gl.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};gl.prototype.isDestroyed=function(){return!1};gl.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};gl._supportsMaterials=function(e){return e.depthTexture};gl.supportsMaterials=function(e){return gl._supportsMaterials(e.frameState.context)};var Pc=gl;var MOt=T(S(),1);function YS(){fe.throwInstantiationError()}Object.defineProperties(YS.prototype,{isConstant:{get:fe.throwInstantiationError},definitionChanged:{get:fe.throwInstantiationError}});YS.prototype.getType=fe.throwInstantiationError;YS.prototype.getValue=fe.throwInstantiationError;YS.prototype.equals=fe.throwInstantiationError;YS.getValue=function(e,t,n){let i;return l(t)&&(i=t.getType(e),l(i))?((!l(n)||n.type!==i)&&(n=Bi.fromType(i)),t.getValue(e,n.uniforms),n):((!l(n)||n.type!==Bi.ColorType)&&(n=Bi.fromType(Bi.ColorType)),O.clone(O.WHITE,n.uniforms.color),n)};var zo=YS;function mx(e,t,n){this._primitives=t,this._orderedGroundPrimitives=n,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=e,this._options=e._options,this._entity=e._entity,this._material=void 0}mx.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!z.getValueOrDefault(t.show,n,!0)};mx.prototype._setOptions=fe.throwInstantiationError;mx.prototype.update=function(e){let t=this._geometryUpdater,n=t._onTerrain,i=this._primitives,o=this._orderedGroundPrimitives;n?o.remove(this._primitive):(i.removeAndDestroy(this._primitive),i.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;let r=this._entity,s=r[this._geometryUpdater._geometryPropertyName];if(this._setOptions(r,s,e),this._isHidden(r,s,e))return;let a=this._geometryUpdater.shadowsProperty.getValue(e),c=this._options;if(!l(s.fill)||s.fill.getValue(e)){let d=t.fillMaterialProperty,u=d instanceof Ut,m,p=t._getIsClosed(c);if(u)m=new cn({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let y=zo.getValue(e,d,this._material);this._material=y,m=new mo({material:y,translucent:y.isTranslucent(),closed:p})}if(n)c.vertexFormat=cn.VERTEX_FORMAT,this._primitive=o.add(new Pc({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:m,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),z.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{c.vertexFormat=m.vertexFormat;let y=this._geometryUpdater.createFillGeometryInstance(e);u&&(m.translucent=y.attributes.color.value[3]!==255),this._primitive=i.add(new En({geometryInstances:y,appearance:m,asynchronous:!1,shadows:a}))}}if(!n&&l(s.outline)&&s.outline.getValue(e)){let d=this._geometryUpdater.createOutlineGeometryInstance(e),u=z.getValueOrDefault(s.outlineWidth,e,1);this._outlinePrimitive=i.add(new En({geometryInstances:d,appearance:new cn({flat:!0,translucent:d.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(u)}}),asynchronous:!1,shadows:a}))}};mx.prototype.getBoundingSphere=function(e){let t=this._entity,n=this._primitive,i=this._outlinePrimitive,o;return l(n)&&n.show&&n.ready&&(o=n.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(ce.clone(o.boundingSphere,e),ut.DONE):l(i)&&i.show&&i.ready&&(o=i.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(ce.clone(o.boundingSphere,e),ut.DONE):l(n)&&!n.ready||l(i)&&!i.ready?ut.PENDING:ut.FAILED};mx.prototype.isDestroyed=function(){return!1};mx.prototype.destroy=function(){let e=this._primitives,t=this._orderedGroundPrimitives;this._geometryUpdater._onTerrain?t.remove(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),ue(this)};var ri=mx;var T4t=T(S(),1);var nYt=T(S(),1);var rte={};function mE(e,t){l(rte[e])||(rte[e]=!0,console.warn(g(t,e)))}mE.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.";mE.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";mE.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";mE.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var Ft=mE;var o4t=T(S(),1);var cKt=T(S(),1);var QYt=T(S(),1);var oYt=T(S(),1),XEe={NONE:0,GEODESIC:1,RHUMB:2},jt=Object.freeze(XEe);var lYt=T(S(),1);var ste=W.EPSILON10;function WEe(e,t,n,i){if(!l(e))return;n=g(n,!1);let o=l(i),r=e.length;if(r<2)return e;let s,a=e[0],c,d,u=0,m=-1;for(s=1;s<r;++s)c=e[s],t(a,c,ste)?(l(d)||(d=e.slice(0,s),u=s-1,m=0),o&&i.push(s)):(l(d)&&(d.push(c),u=s,o&&(m=i.length)),a=c);return n&&t(e[0],e[r-1],ste)&&(o&&(l(d)?i.splice(m,0,u):i.push(r-1)),l(d)?d.length-=1:d=e.slice(0,-1)),l(d)?d:e}var So=WEe;var yYt=T(S(),1);function PEe(e){let t=e._uSquared,n=e._ellipsoid.maximumRadius,i=e._ellipsoid.minimumRadius,o=(n-i)/n,r=Math.cos(e._startHeading),s=Math.sin(e._startHeading),a=(1-o)*Math.tan(e._start.latitude),c=1/Math.sqrt(1+a*a),d=c*a,u=Math.atan2(a,r),m=c*s,p=m*m,y=1-p,f=Math.sqrt(y),x=t/4,_=x*x,C=_*x,V=_*_,L=1+x-3*_/4+5*C/4-175*V/64,Z=1-x+15*_/8-35*C/8,G=1-3*x+35*_/4,I=1-5*x,P=L*u-Z*Math.sin(2*u)*x/2-G*Math.sin(4*u)*_/16-I*Math.sin(6*u)*C/48-Math.sin(8*u)*5*V/512,v=e._constants;v.a=n,v.b=i,v.f=o,v.cosineHeading=r,v.sineHeading=s,v.tanU=a,v.cosineU=c,v.sineU=d,v.sigma=u,v.sineAlpha=m,v.sineSquaredAlpha=p,v.cosineSquaredAlpha=y,v.cosineAlpha=f,v.u2Over4=x,v.u4Over16=_,v.u6Over64=C,v.u8Over256=V,v.a0=L,v.a1=Z,v.a2=G,v.a3=I,v.distanceRatio=P}function vEe(e,t){return e*t*(4+e*(4-3*t))/16}function ate(e,t,n,i,o,r,s){let a=vEe(e,n);return(1-a)*e*t*(i+a*o*(s+a*r*(2*s*s-1)))}function wEe(e,t,n,i,o,r,s){let a=(t-n)/t,c=r-i,d=Math.atan((1-a)*Math.tan(o)),u=Math.atan((1-a)*Math.tan(s)),m=Math.cos(d),p=Math.sin(d),y=Math.cos(u),f=Math.sin(u),x=m*y,_=m*f,C=p*f,V=p*y,L=c,Z=W.TWO_PI,G=Math.cos(L),I=Math.sin(L),P,v,F,M,b;do{G=Math.cos(L),I=Math.sin(L);let U=_-V*G;F=Math.sqrt(y*y*I*I+U*U),v=C+x*G,P=Math.atan2(F,v);let J;F===0?(J=0,M=1):(J=x*I/F,M=1-J*J),Z=L,b=v-2*C/M,isFinite(b)||(b=0),L=c+ate(a,J,M,P,F,v,b)}while(Math.abs(L-Z)>W.EPSILON12);let R=M*(t*t-n*n)/(n*n),E=1+R*(4096+R*(R*(320-175*R)-768))/16384,X=R*(256+R*(R*(74-47*R)-128))/1024,w=b*b,N=X*F*(b+X*(v*(2*w-1)-X*b*(4*F*F-3)*(4*w-3)/6)/4),D=n*E*(P-N),k=Math.atan2(y*I,_-V*G),Y=Math.atan2(m*I,_*G-V);e._distance=D,e._startHeading=k,e._endHeading=Y,e._uSquared=R}var FEe=new h,XO=new h;function cte(e,t,n,i){let o=h.normalize(i.cartographicToCartesian(t,XO),FEe),r=h.normalize(i.cartographicToCartesian(n,XO),XO);wEe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=he.clone(t,e._start),e._end=he.clone(n,e._end),e._start.height=0,e._end.height=0,PEe(e)}function hE(e,t,n){let i=g(n,oe.WGS84);this._ellipsoid=i,this._start=new he,this._end=new he,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,l(e)&&l(t)&&cte(this,e,t,i)}Object.defineProperties(hE.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}}});hE.prototype.setEndPoints=function(e,t){cte(this,e,t,this._ellipsoid)};hE.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};hE.prototype.interpolateUsingSurfaceDistance=function(e,t){let n=this._constants,i=n.distanceRatio+e/n.b,o=Math.cos(2*i),r=Math.cos(4*i),s=Math.cos(6*i),a=Math.sin(2*i),c=Math.sin(4*i),d=Math.sin(6*i),u=Math.sin(8*i),m=i*i,p=i*m,y=n.u8Over256,f=n.u2Over4,x=n.u6Over64,_=n.u4Over16,C=2*p*y*o/3+i*(1-f+7*_/4-15*x/4+579*y/64-(_-15*x/4+187*y/16)*o-(5*x/4-115*y/16)*r-29*y*s/16)+(f/2-_+71*x/32-85*y/16)*a+(5*_/16-5*x/4+383*y/96)*c-m*((x-11*y/2)*a+5*y*c/2)+(29*x/96-29*y/16)*d+539*y*u/1536,V=Math.asin(Math.sin(C)*n.cosineAlpha),L=Math.atan(n.a/n.b*Math.tan(V));C=C-n.sigma;let Z=Math.cos(2*n.sigma+C),G=Math.sin(C),I=Math.cos(C),P=n.cosineU*I,v=n.sineU*G,M=Math.atan2(G*n.sineHeading,P-v*n.cosineHeading)-ate(n.f,n.sineAlpha,n.cosineSquaredAlpha,C,G,I,Z);return l(t)?(t.longitude=this._start.longitude+M,t.latitude=L,t.height=0,t):new he(this._start.longitude+M,L,0)};var xp=hE;var LYt=T(S(),1);function PO(e,t,n){if(e===0)return t*n;let i=e*e,o=i*i,r=o*i,s=r*i,a=s*i,c=a*i,d=n,u=Math.sin(2*d),m=Math.sin(4*d),p=Math.sin(6*d),y=Math.sin(8*d),f=Math.sin(10*d),x=Math.sin(12*d);return t*((1-i/4-3*o/64-5*r/256-175*s/16384-441*a/65536-4851*c/1048576)*d-(3*i/8+3*o/32+45*r/1024+105*s/4096+2205*a/131072+6237*c/524288)*u+(15*o/256+45*r/1024+525*s/16384+1575*a/65536+155925*c/8388608)*m-(35*r/3072+175*s/12288+3675*a/262144+13475*c/1048576)*p+(315*s/131072+2205*a/524288+43659*c/8388608)*y-(693*a/1310720+6237*c/5242880)*f+1001*c/8388608*x)}function AEe(e,t,n){let i=e/n;if(t===0)return i;let o=i*i,r=o*i,s=r*i,a=t,c=a*a,d=c*c,u=d*c,m=u*c,p=m*c,y=p*c,f=Math.sin(2*i),x=Math.cos(2*i),_=Math.sin(4*i),C=Math.cos(4*i),V=Math.sin(6*i),L=Math.cos(6*i),Z=Math.sin(8*i),G=Math.cos(8*i),I=Math.sin(10*i),P=Math.cos(10*i),v=Math.sin(12*i);return i+i*c/4+7*i*d/64+15*i*u/256+579*i*m/16384+1515*i*p/65536+16837*i*y/1048576+(3*i*d/16+45*i*u/256-i*(32*o-561)*m/4096-i*(232*o-1677)*p/16384+i*(399985-90560*o+512*s)*y/5242880)*x+(21*i*u/256+483*i*m/4096-i*(224*o-1969)*p/16384-i*(33152*o-112599)*y/1048576)*C+(151*i*m/4096+4681*i*p/65536+1479*i*y/16384-453*r*y/32768)*L+(1097*i*p/65536+42783*i*y/1048576)*G+8011*i*y/1048576*P+(3*c/8+3*d/16+213*u/2048-3*o*u/64+255*m/4096-33*o*m/512+20861*p/524288-33*o*p/512+s*p/1024+28273*y/1048576-471*o*y/8192+9*s*y/4096)*f+(21*d/256+21*u/256+533*m/8192-21*o*m/512+197*p/4096-315*o*p/4096+584039*y/16777216-12517*o*y/131072+7*s*y/2048)*_+(151*u/6144+151*m/4096+5019*p/131072-453*o*p/16384+26965*y/786432-8607*o*y/131072)*V+(1097*m/131072+1097*p/65536+225797*y/10485760-1097*o*y/65536)*Z+(8011*p/2621440+8011*y/1048576)*I+293393*y/251658240*v}function HS(e,t){if(e===0)return Math.log(Math.tan(.5*(W.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(W.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function MEe(e,t,n,i,o){let r=HS(e._ellipticity,n),s=HS(e._ellipticity,o);return Math.atan2(W.negativePiToPi(i-t),s-r)}function NEe(e,t,n,i,o,r,s){let a=e._heading,c=r-i,d=0;if(W.equalsEpsilon(Math.abs(a),W.PI_OVER_TWO,W.EPSILON8))if(t===n)d=t*Math.cos(o)*W.negativePiToPi(c);else{let u=Math.sin(o);d=t*Math.cos(o)*W.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*u*u)}else{let u=PO(e._ellipticity,t,o);d=(PO(e._ellipticity,t,s)-u)/Math.cos(a)}return Math.abs(d)}var UEe=new h,WO=new h;function lte(e,t,n,i){let o=h.normalize(i.cartographicToCartesian(t,WO),UEe),r=h.normalize(i.cartographicToCartesian(n,WO),WO),s=i.maximumRadius,a=i.minimumRadius,c=s*s,d=a*a;e._ellipticitySquared=(c-d)/c,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=he.clone(t,e._start),e._start.height=0,e._end=he.clone(n,e._end),e._end.height=0,e._heading=MEe(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=NEe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function dte(e,t,n,i,o,r){if(n===0)return he.clone(e,r);let s=o*o,a,c,d;if(Math.abs(W.PI_OVER_TWO-Math.abs(t))>W.EPSILON8){let u=PO(o,i,e.latitude),m=n*Math.cos(t),p=u+m;if(c=AEe(p,o,i),Math.abs(t)<W.EPSILON10)a=W.negativePiToPi(e.longitude);else{let y=HS(o,e.latitude),f=HS(o,c);d=Math.tan(t)*(f-y),a=W.negativePiToPi(e.longitude+d)}}else{c=e.latitude;let u;if(o===0)u=i*Math.cos(e.latitude);else{let m=Math.sin(e.latitude);u=i*Math.cos(e.latitude)/Math.sqrt(1-s*m*m)}d=n/u,t>0?a=W.negativePiToPi(e.longitude+d):a=W.negativePiToPi(e.longitude-d)}return l(r)?(r.longitude=a,r.latitude=c,r.height=0,r):new he(a,c,0)}function _p(e,t,n){let i=g(n,oe.WGS84);this._ellipsoid=i,this._start=new he,this._end=new he,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(e)&&l(t)&&lte(this,e,t,i)}Object.defineProperties(_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}},heading:{get:function(){return this._heading}}});_p.fromStartHeadingDistance=function(e,t,n,i,o){let r=g(i,oe.WGS84),s=r.maximumRadius,a=r.minimumRadius,c=s*s,d=a*a,u=Math.sqrt((c-d)/c);t=W.negativePiToPi(t);let m=dte(e,t,n,r.maximumRadius,u);return!l(o)||l(i)&&!i.equals(o.ellipsoid)?new _p(e,m,r):(o.setEndPoints(e,m),o)};_p.prototype.setEndPoints=function(e,t){lte(this,e,t,this._ellipsoid)};_p.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};_p.prototype.interpolateUsingSurfaceDistance=function(e,t){return dte(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};_p.prototype.findIntersectionWithLongitude=function(e,t){let n=this._ellipticity,i=this._heading,o=Math.abs(i),r=this._start;if(e=W.negativePiToPi(e),W.equalsEpsilon(Math.abs(e),Math.PI,W.EPSILON14)&&(e=W.sign(r.longitude)*Math.PI),l(t)||(t=new he),Math.abs(W.PI_OVER_TWO-o)<=W.EPSILON8)return t.longitude=e,t.latitude=r.latitude,t.height=0,t;if(W.equalsEpsilon(Math.abs(W.PI_OVER_TWO-o),W.PI_OVER_TWO,W.EPSILON8))return W.equalsEpsilon(e,r.longitude,W.EPSILON12)?void 0:(t.longitude=e,t.latitude=W.PI_OVER_TWO*W.sign(W.PI_OVER_TWO-i),t.height=0,t);let s=r.latitude,a=n*Math.sin(s),c=Math.tan(.5*(W.PI_OVER_TWO+s))*Math.exp((e-r.longitude)/Math.tan(i)),d=(1+a)/(1-a),u=r.latitude,m;do{m=u;let p=n*Math.sin(m),y=(1+p)/(1-p);u=2*Math.atan(c*Math.pow(y/d,n/2))-W.PI_OVER_TWO}while(!W.equalsEpsilon(u,m,W.EPSILON12));return t.longitude=e,t.latitude=u,t.height=0,t};_p.prototype.findIntersectionWithLatitude=function(e,t){let n=this._ellipticity,i=this._heading,o=this._start;if(W.equalsEpsilon(Math.abs(i),W.PI_OVER_TWO,W.EPSILON8))return;let r=HS(n,o.latitude),s=HS(n,e),a=Math.tan(i)*(s-r),c=W.negativePiToPi(o.longitude+a);return l(t)?(t.longitude=c,t.latitude=e,t.height=0,t):new he(c,e,0)};var Ca=_p;var kO=[Ri,Gi],kEe=kO.length,Ite=Math.cos(W.toRadians(30)),ute=Math.cos(W.toRadians(150)),Xte=0,Wte=1e3;function Rb(e){e=g(e,g.EMPTY_OBJECT);let t=e.positions;this.width=g(e.width,1),this._positions=t,this.granularity=g(e.granularity,9999),this.loop=g(e.loop,!1),this.arcType=g(e.arcType,jt.GEODESIC),this._ellipsoid=oe.WGS84,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(Rb.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+oe.packedLength+1+1}}});Rb.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<kEe;i++)if(t instanceof kO[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};var DEe=new h,mte=new h,hte=new h;function UO(e,t,n,i,o){let r=vc(i,e,0,DEe),s=vc(i,e,n,mte),a=vc(i,t,0,hte),c=Tp(s,r,mte),d=Tp(a,r,hte);return h.cross(d,c,o),h.normalize(o,o)}var BEe=new he,OEe=new h,YEe=new h,HEe=new h;function vO(e,t,n,i,o,r,s,a,c,d,u){if(o===0)return;let m;r===jt.GEODESIC?m=new xp(e,t,s):r===jt.RHUMB&&(m=new Ca(e,t,s));let p=m.surfaceDistance;if(p<o)return;let y=UO(e,t,i,s,HEe),f=Math.ceil(p/o),x=p/f,_=x,C=f-1,V=a.length;for(let L=0;L<C;L++){let Z=m.interpolateUsingSurfaceDistance(_,BEe),G=vc(s,Z,n,OEe),I=vc(s,Z,i,YEe);h.pack(y,a,V),h.pack(G,c,V),h.pack(I,d,V),u.push(Z.latitude),u.push(Z.longitude),V+=3,_+=x}}var wO=new he;function vc(e,t,n,i){return he.clone(t,wO),wO.height=n,he.toCartesian(wO,e,i)}Rb.pack=function(e,t,n){let i=g(n,0),o=e._positions,r=o.length;t[i++]=r;for(let s=0;s<r;++s){let a=o[s];h.pack(a,t,i),i+=3}return t[i++]=e.granularity,t[i++]=e.loop?1:0,t[i++]=e.arcType,oe.pack(e._ellipsoid,t,i),i+=oe.packedLength,t[i++]=e._projectionIndex,t[i++]=e._scene3DOnly?1:0,t};Rb.unpack=function(e,t,n){let i=g(t,0),o=e[i++],r=new Array(o);for(let p=0;p<o;p++)r[p]=h.unpack(e,i),i+=3;let s=e[i++],a=e[i++]===1,c=e[i++],d=oe.unpack(e,i);i+=oe.packedLength;let u=e[i++],m=e[i++]===1;return l(n)||(n=new Rb({positions:r})),n._positions=r,n.granularity=s,n.loop=a,n.arcType=c,n._ellipsoid=d,n._projectionIndex=u,n._scene3DOnly=m,n};function Tp(e,t,n){return h.subtract(e,t,n),h.normalize(n,n),n}function fte(e,t,n,i){return i=Tp(e,t,i),i=h.cross(i,n,i),i=h.normalize(i,i),i=h.cross(n,i,i),i}var KEe=new h,zEe=new h,JEe=new h,Pte=new h,QEe=0,jEe=-1;function FO(e,t,n,i,o){let r=Tp(n,t,Pte),s=fte(e,t,r,KEe),a=fte(i,t,r,zEe);if(W.equalsEpsilon(h.dot(s,a),jEe,W.EPSILON5))return o=h.cross(r,s,o),o=h.normalize(o,o),o;o=h.add(a,s,o),o=h.normalize(o,o);let c=h.cross(r,o,JEe);return h.dot(a,c)<QEe&&(o=h.negate(o,o)),o}var rN=ln.fromPointNormal(h.ZERO,h.UNIT_Y),qEe=new h,$Ee=new h,eIe=new h,tIe=new h,nIe=new h,nN=new h,iN=new he,pte=new he,bte=new he;Rb.createGeometry=function(e){let t=!e._scene3DOnly,n=e.loop,i=e._ellipsoid,o=e.granularity,r=e.arcType,s=new kO[e._projectionIndex](i),a=Xte,c=Wte,d,u,m=e._positions,p=m.length;p===2&&(n=!1);let y,f,x,_,C=new Ca(void 0,void 0,i),V,L,Z,G=[m[0]];for(u=0;u<p-1;u++)y=m[u],f=m[u+1],V=ni.lineSegmentPlane(y,f,rN,nN),l(V)&&!h.equalsEpsilon(V,y,W.EPSILON7)&&!h.equalsEpsilon(V,f,W.EPSILON7)&&(e.arcType===jt.GEODESIC?G.push(h.clone(V)):e.arcType===jt.RHUMB&&(Z=i.cartesianToCartographic(V,iN).longitude,x=i.cartesianToCartographic(y,iN),_=i.cartesianToCartographic(f,pte),C.setEndPoints(x,_),L=C.findIntersectionWithLongitude(Z,bte),V=i.cartographicToCartesian(L,nN),l(V)&&!h.equalsEpsilon(V,y,W.EPSILON7)&&!h.equalsEpsilon(V,f,W.EPSILON7)&&G.push(h.clone(V)))),G.push(f);n&&(y=m[p-1],f=m[0],V=ni.lineSegmentPlane(y,f,rN,nN),l(V)&&!h.equalsEpsilon(V,y,W.EPSILON7)&&!h.equalsEpsilon(V,f,W.EPSILON7)&&(e.arcType===jt.GEODESIC?G.push(h.clone(V)):e.arcType===jt.RHUMB&&(Z=i.cartesianToCartographic(V,iN).longitude,x=i.cartesianToCartographic(y,iN),_=i.cartesianToCartographic(f,pte),C.setEndPoints(x,_),L=C.findIntersectionWithLongitude(Z,bte),V=i.cartographicToCartesian(L,nN),l(V)&&!h.equalsEpsilon(V,y,W.EPSILON7)&&!h.equalsEpsilon(V,f,W.EPSILON7)&&G.push(h.clone(V)))));let I=G.length,P=new Array(I);for(u=0;u<I;u++){let K=he.fromCartesian(G[u],i);K.height=0,P[u]=K}if(P=So(P,he.equalsEpsilon),I=P.length,I<2)return;let v=[],F=[],M=[],b=[],R=qEe,E=$Ee,X=eIe,w=tIe,N=nIe,D=P[0],k=P[1],Y=P[I-1];for(R=vc(i,Y,a,R),w=vc(i,k,a,w),E=vc(i,D,a,E),X=vc(i,D,c,X),n?N=FO(R,E,X,w,N):N=UO(D,k,c,i,N),h.pack(N,F,0),h.pack(E,M,0),h.pack(X,b,0),v.push(D.latitude),v.push(D.longitude),vO(D,k,a,c,o,r,i,F,M,b,v),u=1;u<I-1;++u){R=h.clone(E,R),E=h.clone(w,E);let K=P[u];vc(i,K,c,X),vc(i,P[u+1],a,w),FO(R,E,X,w,N),d=F.length,h.pack(N,F,d),h.pack(E,M,d),h.pack(X,b,d),v.push(K.latitude),v.push(K.longitude),vO(P[u],P[u+1],a,c,o,r,i,F,M,b,v)}let U=P[I-1],J=P[I-2];if(E=vc(i,U,a,E),X=vc(i,U,c,X),n){let K=P[0];R=vc(i,J,a,R),w=vc(i,K,a,w),N=FO(R,E,X,w,N)}else N=UO(J,U,c,i,N);if(d=F.length,h.pack(N,F,d),h.pack(E,M,d),h.pack(X,b,d),v.push(U.latitude),v.push(U.longitude),n){for(vO(U,D,a,c,o,r,i,F,M,b,v),d=F.length,u=0;u<3;++u)F[d+u]=F[u],M[d+u]=M[u],b[d+u]=b[u];v.push(D.latitude),v.push(D.longitude)}return GIe(n,s,M,b,F,v,t)};var iIe=new h,oIe=new q,rIe=new Me;function yte(e,t,n,i){let o=Tp(n,t,iIe),r=h.dot(o,e);if(r>Ite||r<ute){let s=Tp(i,n,Pte),a=r<ute?W.PI_OVER_TWO:-W.PI_OVER_TWO,c=Me.fromAxisAngle(s,a,rIe),d=q.fromQuaternion(c,oIe);return q.multiplyByVector(d,e,e),!0}return!1}var gte=new he,sIe=new h,xte=new h;function fE(e,t,n,i,o){let r=he.toCartesian(t,e._ellipsoid,sIe),s=h.add(r,n,xte),a=!1,c=e._ellipsoid,d=c.cartesianToCartographic(s,gte);Math.abs(t.longitude-d.longitude)>W.PI_OVER_TWO&&(a=!0,s=h.subtract(r,n,xte),d=c.cartesianToCartographic(s,gte)),d.height=0;let u=e.project(d,o);return o=h.subtract(u,i,o),o.z=0,o=h.normalize(o,o),a&&h.negate(o,o),o}var aIe=new h,_te=new h;function Tte(e,t,n,i,o,r){let s=h.subtract(t,e,aIe);h.normalize(s,s);let a=n-Xte,c=h.multiplyByScalar(s,a,_te);h.add(e,c,o);let d=i-Wte;c=h.multiplyByScalar(s,d,_te),h.add(t,c,r)}var cIe=new h;function oN(e,t){let n=ln.getPointDistance(rN,e),i=ln.getPointDistance(rN,t),o=cIe;W.equalsEpsilon(n,0,W.EPSILON2)?(o=Tp(t,e,o),h.multiplyByScalar(o,W.EPSILON2,o),h.add(e,o,e)):W.equalsEpsilon(i,0,W.EPSILON2)&&(o=Tp(e,t,o),h.multiplyByScalar(o,W.EPSILON2,o),h.add(t,o,t))}function lIe(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(W.equalsEpsilon(n,W.PI,W.EPSILON11)){let o=W.sign(t.longitude);return e.longitude=o*(n-W.EPSILON11),1}else if(W.equalsEpsilon(i,W.PI,W.EPSILON11)){let o=W.sign(e.longitude);return t.longitude=o*(i-W.EPSILON11),2}return 0}var vte=new he,wte=new he,Ste=new h,AO=new h,Cte=new h,Vte=new h,dIe=new h,Lte=new h,uIe=[vte,wte],mIe=new de,hIe=new h,fIe=new h,pIe=new h,bIe=new h,yIe=new h,gIe=new h,MO=new h,NO=new h,xIe=new h,_Ie=new h,TIe=new h,Rte=new h,SIe=new h,CIe=new h,VIe=new Kn,LIe=new Kn,Zte=new h,RIe=new h,Gte=new h,ZIe=[new ce,new ce],Fte=[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],Ete=Fte.length;function GIe(e,t,n,i,o,r,s){let a,c,d=t._ellipsoid,u=n.length/3-1,m=u*8,p=m*4,y=u*36,f=m>65535?new Uint32Array(y):new Uint16Array(y),x=new Float64Array(m*3),_=new Float32Array(p),C=new Float32Array(p),V=new Float32Array(p),L=new Float32Array(p),Z=new Float32Array(p),G,I,P,v;s&&(G=new Float32Array(p),I=new Float32Array(p),P=new Float32Array(p),v=new Float32Array(m*2));let F=r.length/2,M=0,b=vte;b.height=0;let R=wte;R.height=0;let E=Ste,X=AO;if(s)for(c=0,a=1;a<F;a++)b.latitude=r[c],b.longitude=r[c+1],R.latitude=r[c+2],R.longitude=r[c+3],E=t.project(b,E),X=t.project(R,X),M+=h.distance(E,X),c+=2;let w=i.length/3;X=h.unpack(i,0,X);let N=0;for(c=3,a=1;a<w;a++)E=h.clone(X,E),X=h.unpack(i,c,X),N+=h.distance(E,X),c+=3;let D;c=3;let k=0,Y=0,U=0,J=0,K=!1,ee=h.unpack(n,0,Vte),H=h.unpack(i,0,AO),j=h.unpack(o,0,Lte);if(e){let Le=h.unpack(n,n.length-6,Cte);yte(j,Le,ee,H)&&(j=h.negate(j,j))}let $=0,pe=0,ge=0;for(a=0;a<u;a++){let Le=h.clone(ee,Cte),Ee=h.clone(H,Ste),He=h.clone(j,dIe);K&&(He=h.negate(He,He)),ee=h.unpack(n,c,Vte),H=h.unpack(i,c,AO),j=h.unpack(o,c,Lte),K=yte(j,Le,ee,H),b.latitude=r[k],b.longitude=r[k+1],R.latitude=r[k+2],R.longitude=r[k+3];let we,dt,bt,it;if(s){let Ji=lIe(b,R);we=t.project(b,yIe),dt=t.project(R,gIe);let hs=Tp(dt,we,Zte);hs.y=Math.abs(hs.y),bt=MO,it=NO,Ji===0||h.dot(hs,h.UNIT_Y)>Ite?(bt=fE(t,b,He,we,MO),it=fE(t,R,j,dt,NO)):Ji===1?(it=fE(t,R,j,dt,NO),bt.x=0,bt.y=W.sign(b.longitude-Math.abs(R.longitude)),bt.z=0):(bt=fE(t,b,He,we,MO),it.x=0,it.y=W.sign(b.longitude-R.longitude),it.z=0)}let en=h.distance(Ee,H),_n=Kn.fromCartesian(Le,VIe),kt=h.subtract(ee,Le,xIe),At=h.normalize(kt,Rte),Te=h.subtract(Ee,Le,_Ie);Te=h.normalize(Te,Te);let Re=h.cross(At,Te,Rte);Re=h.normalize(Re,Re);let ct=h.cross(Te,He,SIe);ct=h.normalize(ct,ct);let Jt=h.subtract(H,ee,TIe);Jt=h.normalize(Jt,Jt);let mi=h.cross(j,Jt,CIe);mi=h.normalize(mi,mi);let Ke=en/N,$r=$/N,es=0,ga,ms,Fe,rt=0,qe=0;if(s){es=h.distance(we,dt),ga=Kn.fromCartesian(we,LIe),ms=h.subtract(dt,we,Zte),Fe=h.normalize(ms,RIe);let Ji=Fe.x;Fe.x=Fe.y,Fe.y=-Ji,rt=es/M,qe=pe/M}for(D=0;D<8;D++){let Ji=J+D*4,hs=Y+D*2,Jn=Ji+3,Un=D<4?1:-1,un=D===2||D===3||D===6||D===7?1:-1;h.pack(_n.high,_,Ji),_[Jn]=kt.x,h.pack(_n.low,C,Ji),C[Jn]=kt.y,h.pack(ct,V,Ji),V[Jn]=kt.z,h.pack(mi,L,Ji),L[Jn]=Ke*Un,h.pack(Re,Z,Ji);let fi=$r*un;fi===0&&un<0&&(fi=9),Z[Jn]=fi,s&&(G[Ji]=ga.high.x,G[Ji+1]=ga.high.y,G[Ji+2]=ga.low.x,G[Ji+3]=ga.low.y,P[Ji]=-bt.y,P[Ji+1]=bt.x,P[Ji+2]=it.y,P[Ji+3]=-it.x,I[Ji]=ms.x,I[Ji+1]=ms.y,I[Ji+2]=Fe.x,I[Ji+3]=Fe.y,v[hs]=rt*Un,fi=qe*un,fi===0&&un<0&&(fi=9),v[hs+1]=fi)}let Ye=pIe,ht=bIe,Dt=hIe,fn=fIe,jn=de.fromCartographicArray(uIe,mIe),ki=hi.getMinimumMaximumHeights(jn,d),Lo=ki.minimumTerrainHeight,Is=ki.maximumTerrainHeight;ge+=Math.abs(Lo),ge+=Math.abs(Is),Tte(Le,Ee,Lo,Is,Ye,Dt),Tte(ee,H,Lo,Is,ht,fn);let fr=h.multiplyByScalar(Re,W.EPSILON5,Gte);h.add(Ye,fr,Ye),h.add(ht,fr,ht),h.add(Dt,fr,Dt),h.add(fn,fr,fn),oN(Ye,ht),oN(Dt,fn),h.pack(Ye,x,U),h.pack(ht,x,U+3),h.pack(fn,x,U+6),h.pack(Dt,x,U+9),fr=h.multiplyByScalar(Re,-2*W.EPSILON5,Gte),h.add(Ye,fr,Ye),h.add(ht,fr,ht),h.add(Dt,fr,Dt),h.add(fn,fr,fn),oN(Ye,ht),oN(Dt,fn),h.pack(Ye,x,U+12),h.pack(ht,x,U+15),h.pack(fn,x,U+18),h.pack(Dt,x,U+21),k+=2,c+=3,Y+=16,U+=24,J+=32,$+=en,pe+=es}c=0;let ae=0;for(a=0;a<u;a++){for(D=0;D<Ete;D++)f[c+D]=Fte[D]+ae;ae+=8,c+=Ete}let be=ZIe;ce.fromVertices(n,h.ZERO,3,be[0]),ce.fromVertices(i,h.ZERO,3,be[1]);let _e=ce.fromBoundingSpheres(be);_e.radius+=ge/(u*2);let Ze={position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,normalize:!1,values:x}),startHiAndForwardOffsetX:Lb(_),startLoAndForwardOffsetY:Lb(C),startNormalAndForwardOffsetZ:Lb(V),endNormalAndTextureCoordinateNormalizationX:Lb(L),rightNormalAndTextureCoordinateNormalizationY:Lb(Z)};return s&&(Ze.startHiLo2D=Lb(G),Ze.offsetAndRight2D=Lb(I),Ze.startEndNormals2D=Lb(P),Ze.texcoordNormalization2D=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,normalize:!1,values:v})),new mt({attributes:Ze,indices:f,boundingSphere:_e})}function Lb(e){return new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}Rb._projectNormal=fE;var hx=Rb;var qYt=T(S(),1),pE=`in vec4 v_startPlaneNormalEcAndHalfWidth;
in vec4 v_endPlaneNormalEcAndBatchId;
in vec4 v_rightPlaneEC; // Technically can compute distance for this here
in vec4 v_endEcAndStartEcX;
in vec4 v_texcoordNormalizationAndStartEcYZ;
#ifdef PER_INSTANCE_COLOR
in vec4 v_color;
#endif
void main(void)
{
float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)));
vec3 ecStart = vec3(v_endEcAndStartEcX.w, v_texcoordNormalizationAndStartEcYZ.zw);
// Discard for sky
if (logDepthOrDepth == 0.0) {
#ifdef DEBUG_SHOW_VOLUME
out_FragColor = vec4(1.0, 0.0, 0.0, 0.5);
return;
#else // DEBUG_SHOW_VOLUME
discard;
#endif // DEBUG_SHOW_VOLUME
}
vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
eyeCoordinate /= eyeCoordinate.w;
float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate);
// Check distance of the eye coordinate against the right-facing plane
float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz);
// Check eye coordinate against the mitering planes
float distanceFromStart = czm_planeDistance(v_startPlaneNormalEcAndHalfWidth.xyz, -dot(ecStart, v_startPlaneNormalEcAndHalfWidth.xyz), eyeCoordinate.xyz);
float distanceFromEnd = czm_planeDistance(v_endPlaneNormalEcAndBatchId.xyz, -dot(v_endEcAndStartEcX.xyz, v_endPlaneNormalEcAndBatchId.xyz), eyeCoordinate.xyz);
if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) {
#ifdef DEBUG_SHOW_VOLUME
out_FragColor = vec4(1.0, 0.0, 0.0, 0.5);
return;
#else // DEBUG_SHOW_VOLUME
discard;
#endif // DEBUG_SHOW_VOLUME
}
// Check distance of the eye coordinate against start and end planes with normals in the right plane.
// For computing unskewed lengthwise texture coordinate.
// Can also be used for clipping extremely pointy miters, but in practice unnecessary because of miter breaking.
// aligned plane: cross the right plane normal with miter plane normal, then cross the result with right again to point it more "forward"
vec3 alignedPlaneNormal;
// start aligned plane
alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz);
alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz));
distanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz);
// end aligned plane
alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_endPlaneNormalEcAndBatchId.xyz);
alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz));
distanceFromEnd = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, v_endEcAndStartEcX.xyz), eyeCoordinate.xyz);
#ifdef PER_INSTANCE_COLOR
out_FragColor = czm_gammaCorrect(v_color);
#else // PER_INSTANCE_COLOR
// Clamp - distance to aligned planes may be negative due to mitering,
// so fragment texture coordinate might be out-of-bounds.
float s = clamp(distanceFromStart / (distanceFromStart + distanceFromEnd), 0.0, 1.0);
s = (s * v_texcoordNormalizationAndStartEcYZ.x) + v_texcoordNormalizationAndStartEcYZ.y;
float t = (widthwiseDistance + halfMaxWidth) / (2.0 * halfMaxWidth);
czm_materialInput materialInput;
materialInput.s = s;
materialInput.st = vec2(s, t);
materialInput.str = vec3(s, t, 0.0);
czm_material material = czm_getMaterial(materialInput);
out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#endif // PER_INSTANCE_COLOR
// Premultiply alpha. Required for classification primitives on translucent globe.
out_FragColor.rgb *= out_FragColor.a;
czm_writeDepthClamp();
}
`;var eHt=T(S(),1),bE=`in vec3 v_forwardDirectionEC;
in vec3 v_texcoordNormalizationAndHalfWidth;
in float v_batchId;
#ifdef PER_INSTANCE_COLOR
in vec4 v_color;
#else
in vec2 v_alignedPlaneDistances;
in float v_texcoordT;
#endif
float rayPlaneDistanceUnsafe(vec3 origin, vec3 direction, vec3 planeNormal, float planeDistance) {
// We don't expect the ray to ever be parallel to the plane
return (-planeDistance - dot(planeNormal, origin)) / dot(planeNormal, direction);
}
void main(void)
{
vec4 eyeCoordinate = gl_FragCoord;
eyeCoordinate /= eyeCoordinate.w;
#ifdef PER_INSTANCE_COLOR
out_FragColor = czm_gammaCorrect(v_color);
#else // PER_INSTANCE_COLOR
// Use distances for planes aligned with segment to prevent skew in dashing
float distanceFromStart = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, -v_forwardDirectionEC, v_forwardDirectionEC.xyz, v_alignedPlaneDistances.x);
float distanceFromEnd = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, v_forwardDirectionEC, -v_forwardDirectionEC.xyz, v_alignedPlaneDistances.y);
// Clamp - distance to aligned planes may be negative due to mitering
distanceFromStart = max(0.0, distanceFromStart);
distanceFromEnd = max(0.0, distanceFromEnd);
float s = distanceFromStart / (distanceFromStart + distanceFromEnd);
s = (s * v_texcoordNormalizationAndHalfWidth.x) + v_texcoordNormalizationAndHalfWidth.y;
czm_materialInput materialInput;
materialInput.s = s;
materialInput.st = vec2(s, v_texcoordT);
materialInput.str = vec3(s, v_texcoordT, 0.0);
czm_material material = czm_getMaterial(materialInput);
out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#endif // PER_INSTANCE_COLOR
}
`;var nHt=T(S(),1),yE=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec4 startHiAndForwardOffsetX;
in vec4 startLoAndForwardOffsetY;
in vec4 startNormalAndForwardOffsetZ;
in vec4 endNormalAndTextureCoordinateNormalizationX;
in vec4 rightNormalAndTextureCoordinateNormalizationY;
in vec4 startHiLo2D;
in vec4 offsetAndRight2D;
in vec4 startEndNormals2D;
in vec2 texcoordNormalization2D;
in float batchId;
out vec3 v_forwardDirectionEC;
out vec3 v_texcoordNormalizationAndHalfWidth;
out float v_batchId;
// For materials
#ifdef WIDTH_VARYING
out float v_width;
#endif
#ifdef ANGLE_VARYING
out float v_polylineAngle;
#endif
#ifdef PER_INSTANCE_COLOR
out vec4 v_color;
#else
out vec2 v_alignedPlaneDistances;
out float v_texcoordT;
#endif
// Morphing planes using SLERP or NLERP doesn't seem to work, so instead draw the material directly on the shadow volume.
// Morph views are from very far away and aren't meant to be used precisely, so this should be sufficient.
void main()
{
v_batchId = batchId;
// Start position
vec4 posRelativeToEye2D = czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw));
vec4 posRelativeToEye3D = czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz);
vec4 posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime);
vec3 posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz;
vec3 posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz;
vec3 startEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz;
// Start plane
vec4 startPlane2D;
vec4 startPlane3D;
startPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy);
startPlane3D.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz;
startPlane2D.w = -dot(startPlane2D.xyz, posEc2D);
startPlane3D.w = -dot(startPlane3D.xyz, posEc3D);
// Right plane
vec4 rightPlane2D;
vec4 rightPlane3D;
rightPlane2D.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw);
rightPlane3D.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz;
rightPlane2D.w = -dot(rightPlane2D.xyz, posEc2D);
rightPlane3D.w = -dot(rightPlane3D.xyz, posEc3D);
// End position
posRelativeToEye2D = posRelativeToEye2D + vec4(0.0, offsetAndRight2D.xy, 0.0);
posRelativeToEye3D = posRelativeToEye3D + vec4(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w, 0.0);
posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime);
posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz;
posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz;
vec3 endEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz;
vec3 forwardEc3D = czm_normal * normalize(vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w));
vec3 forwardEc2D = czm_normal * normalize(vec3(0.0, offsetAndRight2D.xy));
// End plane
vec4 endPlane2D;
vec4 endPlane3D;
endPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw);
endPlane3D.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz;
endPlane2D.w = -dot(endPlane2D.xyz, posEc2D);
endPlane3D.w = -dot(endPlane3D.xyz, posEc3D);
// Forward direction
v_forwardDirectionEC = normalize(endEC - startEC);
vec2 cleanTexcoordNormalization2D;
cleanTexcoordNormalization2D.x = abs(texcoordNormalization2D.x);
cleanTexcoordNormalization2D.y = czm_branchFreeTernary(texcoordNormalization2D.y > 1.0, 0.0, abs(texcoordNormalization2D.y));
vec2 cleanTexcoordNormalization3D;
cleanTexcoordNormalization3D.x = abs(endNormalAndTextureCoordinateNormalizationX.w);
cleanTexcoordNormalization3D.y = rightNormalAndTextureCoordinateNormalizationY.w;
cleanTexcoordNormalization3D.y = czm_branchFreeTernary(cleanTexcoordNormalization3D.y > 1.0, 0.0, abs(cleanTexcoordNormalization3D.y));
v_texcoordNormalizationAndHalfWidth.xy = mix(cleanTexcoordNormalization2D, cleanTexcoordNormalization3D, czm_morphTime);
#ifdef PER_INSTANCE_COLOR
v_color = czm_batchTable_color(batchId);
#else // PER_INSTANCE_COLOR
// For computing texture coordinates
v_alignedPlaneDistances.x = -dot(v_forwardDirectionEC, startEC);
v_alignedPlaneDistances.y = -dot(-v_forwardDirectionEC, endEC);
#endif // PER_INSTANCE_COLOR
#ifdef WIDTH_VARYING
float width = czm_batchTable_width(batchId);
float halfWidth = width * 0.5;
v_width = width;
v_texcoordNormalizationAndHalfWidth.z = halfWidth;
#else
float halfWidth = 0.5 * czm_batchTable_width(batchId);
v_texcoordNormalizationAndHalfWidth.z = halfWidth;
#endif
// Compute a normal along which to "push" the position out, extending the miter depending on view distance.
// Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes.
// Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be.
// Since this is morphing, compute both 3D and 2D positions and then blend.
// ****** 3D ******
// Check distance to the end plane and start plane, pick the plane that is closer
vec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow); // w = 1.0, see czm_computePosition
float absStartPlaneDistance = abs(czm_planeDistance(startPlane3D, positionEc3D.xyz));
float absEndPlaneDistance = abs(czm_planeDistance(endPlane3D, positionEc3D.xyz));
vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane3D.xyz, endPlane3D.xyz);
vec3 upOrDown = normalize(cross(rightPlane3D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane.
vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too.
// Nudge the top vertex upwards to prevent flickering
vec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D));
geodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0);
geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT;
positionEc3D.xyz += geodeticSurfaceNormal;
// Determine if this vertex is on the "left" or "right"
normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w);
// A "perfect" implementation would push along normals according to the angle against forward.
// In practice, just pushing the normal out by halfWidth is sufficient for morph views.
positionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera)
// ****** 2D ******
// Check distance to the end plane and start plane, pick the plane that is closer
vec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); // w = 1.0, see czm_computePosition
absStartPlaneDistance = abs(czm_planeDistance(startPlane2D, positionEc2D.xyz));
absEndPlaneDistance = abs(czm_planeDistance(endPlane2D, positionEc2D.xyz));
planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane2D.xyz, endPlane2D.xyz);
upOrDown = normalize(cross(rightPlane2D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane.
normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too.
// Nudge the top vertex upwards to prevent flickering
geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D));
geodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0);
geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT;
positionEc2D.xyz += geodeticSurfaceNormal;
// Determine if this vertex is on the "left" or "right"
normalEC *= sign(texcoordNormalization2D.x);
#ifndef PER_INSTANCE_COLOR
// Use vertex's sidedness to compute its texture coordinate.
v_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.0);
#endif
// A "perfect" implementation would push along normals according to the angle against forward.
// In practice, just pushing the normal out by halfWidth is sufficient for morph views.
positionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera)
// Blend for actual position
gl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime);
#ifdef ANGLE_VARYING
// Approximate relative screen space direction of the line.
vec2 approxLineDirection = normalize(vec2(v_forwardDirectionEC.x, -v_forwardDirectionEC.y));
approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y);
v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y);
#endif
}
`;var oHt=T(S(),1),gE=`in vec3 position3DHigh;
in vec3 position3DLow;
// In 2D and in 3D, texture coordinate normalization component signs encodes:
// * X sign - sidedness relative to right plane
// * Y sign - is negative OR magnitude is greater than 1.0 if vertex is on bottom of volume
#ifndef COLUMBUS_VIEW_2D
in vec4 startHiAndForwardOffsetX;
in vec4 startLoAndForwardOffsetY;
in vec4 startNormalAndForwardOffsetZ;
in vec4 endNormalAndTextureCoordinateNormalizationX;
in vec4 rightNormalAndTextureCoordinateNormalizationY;
#else
in vec4 startHiLo2D;
in vec4 offsetAndRight2D;
in vec4 startEndNormals2D;
in vec2 texcoordNormalization2D;
#endif
in float batchId;
out vec4 v_startPlaneNormalEcAndHalfWidth;
out vec4 v_endPlaneNormalEcAndBatchId;
out vec4 v_rightPlaneEC;
out vec4 v_endEcAndStartEcX;
out vec4 v_texcoordNormalizationAndStartEcYZ;
// For materials
#ifdef WIDTH_VARYING
out float v_width;
#endif
#ifdef ANGLE_VARYING
out float v_polylineAngle;
#endif
#ifdef PER_INSTANCE_COLOR
out vec4 v_color;
#endif
void main()
{
#ifdef COLUMBUS_VIEW_2D
vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw))).xyz;
vec3 forwardDirectionEC = czm_normal * vec3(0.0, offsetAndRight2D.xy);
vec3 ecEnd = forwardDirectionEC + ecStart;
forwardDirectionEC = normalize(forwardDirectionEC);
// Right plane
v_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw);
v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart);
// start plane
vec4 startPlaneEC;
startPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy);
startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart);
// end plane
vec4 endPlaneEC;
endPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw);
endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd);
v_texcoordNormalizationAndStartEcYZ.x = abs(texcoordNormalization2D.x);
v_texcoordNormalizationAndStartEcYZ.y = texcoordNormalization2D.y;
#else // COLUMBUS_VIEW_2D
vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz)).xyz;
vec3 offset = czm_normal * vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w);
vec3 ecEnd = ecStart + offset;
vec3 forwardDirectionEC = normalize(offset);
// start plane
vec4 startPlaneEC;
startPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz;
startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart);
// end plane
vec4 endPlaneEC;
endPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz;
endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd);
// Right plane
v_rightPlaneEC.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz;
v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart);
v_texcoordNormalizationAndStartEcYZ.x = abs(endNormalAndTextureCoordinateNormalizationX.w);
v_texcoordNormalizationAndStartEcYZ.y = rightNormalAndTextureCoordinateNormalizationY.w;
#endif // COLUMBUS_VIEW_2D
v_endEcAndStartEcX.xyz = ecEnd;
v_endEcAndStartEcX.w = ecStart.x;
v_texcoordNormalizationAndStartEcYZ.zw = ecStart.yz;
#ifdef PER_INSTANCE_COLOR
v_color = czm_batchTable_color(batchId);
#endif // PER_INSTANCE_COLOR
// Compute a normal along which to "push" the position out, extending the miter depending on view distance.
// Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes.
// Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be.
vec4 positionRelativeToEye = czm_computePosition();
// Check distance to the end plane and start plane, pick the plane that is closer
vec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye; // w = 1.0, see czm_computePosition
float absStartPlaneDistance = abs(czm_planeDistance(startPlaneEC, positionEC.xyz));
float absEndPlaneDistance = abs(czm_planeDistance(endPlaneEC, positionEC.xyz));
vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlaneEC.xyz, endPlaneEC.xyz);
vec3 upOrDown = normalize(cross(v_rightPlaneEC.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane.
vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too.
// Extrude bottom vertices downward for far view distances, like for GroundPrimitives
upOrDown = cross(forwardDirectionEC, normalEC);
upOrDown = float(czm_sceneMode == czm_sceneMode3D) * upOrDown;
upOrDown = float(v_texcoordNormalizationAndStartEcYZ.y > 1.0 || v_texcoordNormalizationAndStartEcYZ.y < 0.0) * upOrDown;
upOrDown = min(GLOBE_MINIMUM_ALTITUDE, czm_geometricToleranceOverMeter * length(positionRelativeToEye.xyz)) * upOrDown;
positionEC.xyz += upOrDown;
v_texcoordNormalizationAndStartEcYZ.y = czm_branchFreeTernary(v_texcoordNormalizationAndStartEcYZ.y > 1.0, 0.0, abs(v_texcoordNormalizationAndStartEcYZ.y));
// Determine distance along normalEC to push for a volume of appropriate width.
// Make volumes about double pixel width for a conservative fit - in practice the
// extra cost here is minimal compared to the loose volume heights.
//
// N = normalEC (guaranteed "right-facing")
// R = rightEC
// p = angle between N and R
// w = distance to push along R if R == N
// d = distance to push along N
//
// N R
// { p| } * cos(p) = dot(N, R) = w / d
// d | |w * d = w / dot(N, R)
// { | }
// o---------- polyline segment ---->
//
float width = czm_batchTable_width(batchId);
#ifdef WIDTH_VARYING
v_width = width;
#endif
v_startPlaneNormalEcAndHalfWidth.xyz = startPlaneEC.xyz;
v_startPlaneNormalEcAndHalfWidth.w = width * 0.5;
v_endPlaneNormalEcAndBatchId.xyz = endPlaneEC.xyz;
v_endPlaneNormalEcAndBatchId.w = batchId;
width = width * max(0.0, czm_metersPerPixel(positionEC)); // width = distance to push along R
width = width / dot(normalEC, v_rightPlaneEC.xyz); // width = distance to push along N
// Determine if this vertex is on the "left" or "right"
#ifdef COLUMBUS_VIEW_2D
normalEC *= sign(texcoordNormalization2D.x);
#else
normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w);
#endif
positionEC.xyz += width * normalEC;
gl_Position = czm_depthClamp(czm_projection * positionEC);
#ifdef ANGLE_VARYING
// Approximate relative screen space direction of the line.
vec2 approxLineDirection = normalize(vec2(forwardDirectionEC.x, -forwardDirectionEC.y));
approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y);
v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y);
#endif
}
`;var yHt=T(S(),1);var sHt=T(S(),1),xE=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec3 prevPosition3DHigh;
in vec3 prevPosition3DLow;
in vec3 nextPosition3DHigh;
in vec3 nextPosition3DLow;
in vec2 expandAndWidth;
in vec4 color;
in float batchId;
out vec4 v_color;
void main()
{
float expandDir = expandAndWidth.x;
float width = abs(expandAndWidth.y) + 0.5;
bool usePrev = expandAndWidth.y < 0.0;
vec4 p = czm_computePosition();
vec4 prev = czm_computePrevPosition();
vec4 next = czm_computeNextPosition();
float angle;
vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle);
gl_Position = czm_viewportOrthographic * positionWC;
v_color = color;
}
`;var cHt=T(S(),1),od=`void clipLineSegmentToNearPlane(
vec3 p0,
vec3 p1,
out vec4 positionWC,
out bool clipped,
out bool culledByNearPlane,
out vec4 clippedPositionEC)
{
culledByNearPlane = false;
clipped = false;
vec3 p0ToP1 = p1 - p0;
float magnitude = length(p0ToP1);
vec3 direction = normalize(p0ToP1);
// Distance that p0 is behind the near plane. Negative means p0 is
// in front of the near plane.
float endPoint0Distance = czm_currentFrustum.x + p0.z;
// Camera looks down -Z.
// When moving a point along +Z: LESS VISIBLE
// * Points in front of the camera move closer to the camera.
// * Points behind the camrea move farther away from the camera.
// When moving a point along -Z: MORE VISIBLE
// * Points in front of the camera move farther away from the camera.
// * Points behind the camera move closer to the camera.
// Positive denominator: -Z, becoming more visible
// Negative denominator: +Z, becoming less visible
// Nearly zero: parallel to near plane
float denominator = -direction.z;
if (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7)
{
// p0 is behind the near plane and the line to p1 is nearly parallel to
// the near plane, so cull the segment completely.
culledByNearPlane = true;
}
else if (endPoint0Distance > 0.0)
{
// p0 is behind the near plane, and the line to p1 is moving distinctly
// toward or away from it.
// t = (-plane distance - dot(plane normal, ray origin)) / dot(plane normal, ray direction)
float t = endPoint0Distance / denominator;
if (t < 0.0 || t > magnitude)
{
// Near plane intersection is not between the two points.
// We already confirmed p0 is behind the naer plane, so now
// we know the entire segment is behind it.
culledByNearPlane = true;
}
else
{
// Segment crosses the near plane, update p0 to lie exactly on it.
p0 = p0 + t * direction;
// Numerical noise might put us a bit on the wrong side of the near plane.
// Don't let that happen.
p0.z = min(p0.z, -czm_currentFrustum.x);
clipped = true;
}
}
clippedPositionEC = vec4(p0, 1.0);
positionWC = czm_eyeToWindowCoordinates(clippedPositionEC);
}
vec4 getPolylineWindowCoordinatesEC(vec4 positionEC, vec4 prevEC, vec4 nextEC, float expandDirection, float width, bool usePrevious, out float angle)
{
// expandDirection +1 is to the _left_ when looking from positionEC toward nextEC.
#ifdef POLYLINE_DASH
// Compute the window coordinates of the points.
vec4 positionWindow = czm_eyeToWindowCoordinates(positionEC);
vec4 previousWindow = czm_eyeToWindowCoordinates(prevEC);
vec4 nextWindow = czm_eyeToWindowCoordinates(nextEC);
// Determine the relative screen space direction of the line.
vec2 lineDir;
if (usePrevious) {
lineDir = normalize(positionWindow.xy - previousWindow.xy);
}
else {
lineDir = normalize(nextWindow.xy - positionWindow.xy);
}
angle = atan(lineDir.x, lineDir.y) - 1.570796327; // precomputed atan(1,0)
// Quantize the angle so it doesn't change rapidly between segments.
angle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour;
#endif
vec4 clippedPrevWC, clippedPrevEC;
bool prevSegmentClipped, prevSegmentCulled;
clipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, clippedPrevWC, prevSegmentClipped, prevSegmentCulled, clippedPrevEC);
vec4 clippedNextWC, clippedNextEC;
bool nextSegmentClipped, nextSegmentCulled;
clipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, clippedNextWC, nextSegmentClipped, nextSegmentCulled, clippedNextEC);
bool segmentClipped, segmentCulled;
vec4 clippedPositionWC, clippedPositionEC;
clipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, clippedPositionWC, segmentClipped, segmentCulled, clippedPositionEC);
if (segmentCulled)
{
return vec4(0.0, 0.0, 0.0, 1.0);
}
vec2 directionToPrevWC = normalize(clippedPrevWC.xy - clippedPositionWC.xy);
vec2 directionToNextWC = normalize(clippedNextWC.xy - clippedPositionWC.xy);
// If a segment was culled, we can't use the corresponding direction
// computed above. We should never see both of these be true without
// \`segmentCulled\` above also being true.
if (prevSegmentCulled)
{
directionToPrevWC = -directionToNextWC;
}
else if (nextSegmentCulled)
{
directionToNextWC = -directionToPrevWC;
}
vec2 thisSegmentForwardWC, otherSegmentForwardWC;
if (usePrevious)
{
thisSegmentForwardWC = -directionToPrevWC;
otherSegmentForwardWC = directionToNextWC;
}
else
{
thisSegmentForwardWC = directionToNextWC;
otherSegmentForwardWC = -directionToPrevWC;
}
vec2 thisSegmentLeftWC = vec2(-thisSegmentForwardWC.y, thisSegmentForwardWC.x);
vec2 leftWC = thisSegmentLeftWC;
float expandWidth = width * 0.5;
// When lines are split at the anti-meridian, the position may be at the
// same location as the next or previous position, and we need to handle
// that to avoid producing NaNs.
if (!czm_equalsEpsilon(prevEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1) && !czm_equalsEpsilon(nextEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1))
{
vec2 otherSegmentLeftWC = vec2(-otherSegmentForwardWC.y, otherSegmentForwardWC.x);
vec2 leftSumWC = thisSegmentLeftWC + otherSegmentLeftWC;
float leftSumLength = length(leftSumWC);
leftWC = leftSumLength < czm_epsilon6 ? thisSegmentLeftWC : (leftSumWC / leftSumLength);
// The sine of the angle between the two vectors is given by the formula
// |a x b| = |a||b|sin(theta)
// which is
// float sinAngle = length(cross(vec3(leftWC, 0.0), vec3(-thisSegmentForwardWC, 0.0)));
// Because the z components of both vectors are zero, the x and y coordinate will be zero.
// Therefore, the sine of the angle is just the z component of the cross product.
vec2 u = -thisSegmentForwardWC;
vec2 v = leftWC;
float sinAngle = abs(u.x * v.y - u.y * v.x);
expandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0);
}
vec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio;
return vec4(clippedPositionWC.xy + offset, -clippedPositionWC.z, 1.0) * (czm_projection * clippedPositionEC).w;
}
vec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle)
{
vec4 positionEC = czm_modelViewRelativeToEye * position;
vec4 prevEC = czm_modelViewRelativeToEye * previous;
vec4 nextEC = czm_modelViewRelativeToEye * next;
return getPolylineWindowCoordinatesEC(positionEC, prevEC, nextEC, expandDirection, width, usePrevious, angle);
}
`;var DO=`${od}
${xE}`,EIe=$g;Bt.isInternetExplorer()||(DO=`#define CLIP_POLYLINE
${DO}`);function fx(e){e=g(e,g.EMPTY_OBJECT);let t=g(e.translucent,!0),n=!1,i=fx.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=g(e.vertexShaderSource,DO),this._fragmentShaderSource=g(e.fragmentShaderSource,EIe),this._renderState=ro.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(fx.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}}});fx.VERTEX_FORMAT=Pe.POSITION_ONLY;fx.prototype.getFragmentShaderSource=ro.prototype.getFragmentShaderSource;fx.prototype.isTranslucent=ro.prototype.isTranslucent;fx.prototype.getRenderState=ro.prototype.getRenderState;var Br=fx;var WHt=T(S(),1);var xHt=T(S(),1),_E=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec3 prevPosition3DHigh;
in vec3 prevPosition3DLow;
in vec3 nextPosition3DHigh;
in vec3 nextPosition3DLow;
in vec2 expandAndWidth;
in vec2 st;
in float batchId;
out float v_width;
out vec2 v_st;
out float v_polylineAngle;
void main()
{
float expandDir = expandAndWidth.x;
float width = abs(expandAndWidth.y) + 0.5;
bool usePrev = expandAndWidth.y < 0.0;
vec4 p = czm_computePosition();
vec4 prev = czm_computePrevPosition();
vec4 next = czm_computeNextPosition();
float angle;
vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle);
gl_Position = czm_viewportOrthographic * positionWC;
v_width = width;
v_st.s = st.s;
v_st.t = czm_writeNonPerspective(st.t, gl_Position.w);
v_polylineAngle = angle;
}
`;var THt=T(S(),1),px=`#ifdef VECTOR_TILE
uniform vec4 u_highlightColor;
#endif
in vec2 v_st;
void main()
{
czm_materialInput materialInput;
vec2 st = v_st;
st.t = czm_readNonPerspective(st.t, gl_FragCoord.w);
materialInput.s = st.s;
materialInput.st = st;
materialInput.str = vec3(st, 0.0);
czm_material material = czm_getMaterial(materialInput);
out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#ifdef VECTOR_TILE
out_FragColor *= u_highlightColor;
#endif
czm_writeLogDepth();
}
`;var BO=`${od}
${_E}`,IIe=px;Bt.isInternetExplorer()||(BO=`#define CLIP_POLYLINE
${BO}`);function bx(e){e=g(e,g.EMPTY_OBJECT);let t=g(e.translucent,!0),n=!1,i=bx.VERTEX_FORMAT;this.material=l(e.material)?e.material:Bi.fromType(Bi.ColorType),this.translucent=t,this._vertexShaderSource=g(e.vertexShaderSource,BO),this._fragmentShaderSource=g(e.fragmentShaderSource,IIe),this._renderState=ro.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(bx.prototype,{vertexShaderSource:{get:function(){let e=this._vertexShaderSource;return this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&(e=`#define POLYLINE_DASH
${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}}});bx.VERTEX_FORMAT=Pe.POSITION_AND_ST;bx.prototype.getFragmentShaderSource=ro.prototype.getFragmentShaderSource;bx.prototype.isTranslucent=ro.prototype.isTranslucent;bx.prototype.getRenderState=ro.prototype.getRenderState;var qs=bx;function Sp(e){e=g(e,g.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new qs),this.appearance=t,this.show=g(e.show,!0),this.classificationType=g(e.classificationType,Bn.BOTH),this.debugShowBoundingVolume=g(e.debugShowBoundingVolume,!1),this._debugShowShadowVolume=g(e.debugShowShadowVolume,!1),this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:g(e.interleave,!1),releaseGeometryInstances:g(e.releaseGeometryInstances,!0),allowPicking:g(e.allowPicking,!0),asynchronous:g(e.asynchronous,!0),compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1,this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=Ate(!1),this._renderState3DTiles=Ate(!0),this._renderStateMorph=ke.fromCache({cull:{enabled:!0,face:yi.FRONT},depthTest:{enabled:!0},blending:mn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(Sp.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}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}});Sp.initializeTerrainHeights=function(){return hi.initialize()};function XIe(e,t,n){let i=t.context,o=e._primitive,r=o._attributeLocations,s=o._batchTable.getVertexShaderCallback()(gE);s=En._appendShowToShader(o,s),s=En._appendDistanceDisplayConditionToShader(o,s),s=En._modifyShaderPosition(e,s,t.scene3DOnly);let a=o._batchTable.getVertexShaderCallback()(yE);a=En._appendShowToShader(o,a),a=En._appendDistanceDisplayConditionToShader(o,a),a=En._modifyShaderPosition(e,a,t.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()(pE),d=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],u="",m="";l(n.material)?(m=l(n.material)?n.material.shaderSource:"",m.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&d.push("ANGLE_VARYING"),m.search(/in\s+float\s+v_width;/g)!==-1&&d.push("WIDTH_VARYING")):u="PER_INSTANCE_COLOR",d.push(u);let p=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",u]:[u],y=new Oe({defines:d,sources:[s]}),f=new Oe({defines:p,sources:[m,c]});e._sp=Qt.replaceCache({context:i,shaderProgram:o._sp,vertexShaderSource:y,fragmentShaderSource:f,attributeLocations:r});let x=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!l(x)){let C=new Oe({defines:d.concat(["COLUMBUS_VIEW_2D"]),sources:[s]});x=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:C,fragmentShaderSource:f,attributeLocations:r})}e._sp2D=x;let _=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!l(_)){let C=new Oe({defines:d.concat([`MAX_TERRAIN_HEIGHT ${hi._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});c=o._batchTable.getVertexShaderCallback()(bE);let V=new Oe({defines:p,sources:[m,c]});_=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:C,fragmentShaderSource:V,attributeLocations:r})}e._spMorph=_}function Ate(e){return ke.fromCache({cull:{enabled:!0},blending:mn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:On.EQUAL,frontOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.KEEP},backFunction:On.EQUAL,backOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.KEEP},reference:Nt.CESIUM_3D_TILE_MASK,mask:Nt.CESIUM_3D_TILE_MASK}})}function WIe(e,t,n,i,o,r){let s=e._primitive,a=s._va.length;o.length=a,r.length=a;let d=t instanceof Br?{}:n._uniforms,u=s._batchTable.getUniformMapCallback()(d);for(let m=0;m<a;m++){let p=s._va[m],y=o[m];l(y)||(y=o[m]=new nt({owner:e,primitiveType:s._primitiveType})),y.vertexArray=p,y.renderState=e._renderState,y.shaderProgram=e._sp,y.uniformMap=u,y.pass=Ve.TERRAIN_CLASSIFICATION,y.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";let f=nt.shallowClone(y,y.derivedCommands.tileset);f.renderState=e._renderState3DTiles,f.pass=Ve.CESIUM_3D_TILE_CLASSIFICATION,y.derivedCommands.tileset=f;let x=nt.shallowClone(y,y.derivedCommands.color2D);x.shaderProgram=e._sp2D,y.derivedCommands.color2D=x;let _=nt.shallowClone(f,f.derivedCommands.color2D);_.shaderProgram=e._sp2D,f.derivedCommands.color2D=_;let C=nt.shallowClone(y,y.derivedCommands.colorMorph);C.renderState=e._renderStateMorph,C.shaderProgram=e._spMorph,C.pickId="czm_batchTable_pickColor(v_batchId)",y.derivedCommands.colorMorph=C}}function Mte(e,t,n,i,o,r,s){n.mode===ie.MORPHING?t=t.derivedCommands.colorMorph:n.mode!==ie.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=i,t.boundingVolume=r,t.cull=o,t.debugShowBoundingVolume=s,n.commandList.push(t)}function PIe(e,t,n,i,o,r,s){let a=e._primitive;En._updateBoundingVolumes(a,t,o);let c;t.mode===ie.SCENE3D?c=a._boundingSphereWC:t.mode===ie.COLUMBUS_VIEW?c=a._boundingSphereCV:t.mode===ie.SCENE2D&&l(a._boundingSphere2D)?c=a._boundingSphere2D:l(a._boundingSphereMorph)&&(c=a._boundingSphereMorph);let d=t.mode===ie.MORPHING,u=e.classificationType,m=u!==Bn.CESIUM_3D_TILE,p=u!==Bn.TERRAIN&&!d,y,f=t.passes;if(f.render||f.pick&&a.allowPicking){let x=n.length;for(let _=0;_<x;++_){let C=c[_];m&&(y=n[_],Mte(e,y,t,o,r,C,s)),p&&(y=n[_].derivedCommands.tileset,Mte(e,y,t,o,r,C,s))}}}Sp.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!hi.initialized){Sp.initializeTerrainHeights();return}let t,n=this,i=this._primitiveOptions;if(!l(this._primitive)){let o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],r=o.length,s=new Array(r),a;for(t=0;t<r;++t)if(a=o[t].attributes,!l(a)||!l(a.color)){this._hasPerInstanceColors=!1;break}for(t=0;t<r;++t){let c=o[t];a={};let d=c.attributes;for(let u in d)d.hasOwnProperty(u)&&(a[u]=d[u]);l(a.width)||(a.width=new qa({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=e.scene3DOnly,hx.setProjectionAndEllipsoid(c.geometry,e.mapProjection),s[t]=new St({geometry:c.geometry,attributes:a,id:c.id,pickPrimitive:n})}i.geometryInstances=s,i.appearance=this.appearance,i._createShaderProgramFunction=function(c,d,u){XIe(n,d,u)},i._createCommandsFunction=function(c,d,u,m,p,y,f){WIe(n,d,u,m,y,f)},i._updateAndQueueCommandsFunction=function(c,d,u,m,p,y,f,x){PIe(n,d,u,m,p,y,f)},this._primitive=new En(i)}if(this.appearance instanceof Br&&!this._hasPerInstanceColors)throw new fe("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(e),e.afterRender.push(()=>{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};Sp.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Sp.isSupported=function(e){return e.frameState.context.depthTexture};Sp.prototype.isDestroyed=function(){return!1};Sp.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,ue(this)};var Tm=Sp;var XKt=T(S(),1);var VKt=T(S(),1);var yKt=T(S(),1);var vIe=new B(1,1),wIe=!1,FIe=O.WHITE;function KS(e){e=g(e,g.EMPTY_OBJECT),this._definitionChanged=new ye,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}Object.defineProperties(KS.prototype,{isConstant:{get:function(){return z.isConstant(this._image)&&z.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:le("image"),repeat:le("repeat"),color:le("color"),transparent:le("transparent")});KS.prototype.getType=function(e){return"Image"};KS.prototype.getValue=function(e,t){return l(t)||(t={}),t.image=z.getValueOrUndefined(this._image,e),t.repeat=z.getValueOrClonedDefault(this._repeat,e,vIe,t.repeat),t.color=z.getValueOrClonedDefault(this._color,e,FIe,t.color),z.getValueOrDefault(this._transparent,e,wIe)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};KS.prototype.equals=function(e){return this===e||e instanceof KS&&z.equals(this._image,e._image)&&z.equals(this._repeat,e._repeat)&&z.equals(this._color,e._color)&&z.equals(this._transparent,e._transparent)};var Zb=KS;function AIe(e){if(e instanceof O)return new Ut(e);if(typeof e=="string"||e instanceof Xe||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new Zb;return t.image=e,t}}function MIe(e,t){return le(e,t,AIe)}var Xo=MIe;function TE(e){this._definitionChanged=new ye,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(g(e,g.EMPTY_OBJECT))}Object.defineProperties(TE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),dimensions:le("dimensions"),heightReference:le("heightReference"),fill:le("fill"),material:Xo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});TE.prototype.clone=function(e){return l(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 TE(this)};TE.prototype.merge=function(e){this.show=g(this.show,e.show),this.dimensions=g(this.dimensions,e.dimensions),this.heightReference=g(this.heightReference,e.heightReference),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition)};var yx=TE;var JKt=T(S(),1);var PKt=T(S(),1),NIe={FIXED:0,INERTIAL:1},ao=Object.freeze(NIe);var kKt=T(S(),1);function zS(){fe.throwInstantiationError()}Object.defineProperties(zS.prototype,{isConstant:{get:fe.throwInstantiationError},definitionChanged:{get:fe.throwInstantiationError},referenceFrame:{get:fe.throwInstantiationError}});zS.prototype.getValue=fe.throwInstantiationError;zS.prototype.getValueInReferenceFrame=fe.throwInstantiationError;zS.prototype.equals=fe.throwInstantiationError;var OO=new q;zS.convertToReferenceFrame=function(e,t,n,i,o){if(!l(t))return t;if(l(o)||(o=new h),n===i)return h.clone(t,o);let r=Xt.computeIcrfToFixedMatrix(e,OO);if(l(r)||(r=Xt.computeTemeToPseudoFixedMatrix(e,OO)),n===ao.INERTIAL)return q.multiplyByVector(r,t,o);if(n===ao.FIXED)return q.multiplyByVector(q.transpose(r,OO),t,o)};var Cp=zS;function gx(e,t){this._definitionChanged=new ye,this._value=h.clone(e),this._referenceFrame=g(t,ao.FIXED)}Object.defineProperties(gx.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===ao.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});gx.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,ao.FIXED,t)};gx.prototype.setValue=function(e,t){let n=!1;h.equals(this._value,e)||(n=!0,this._value=h.clone(e)),l(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};gx.prototype.getValueInReferenceFrame=function(e,t,n){return Cp.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};gx.prototype.equals=function(e){return this===e||e instanceof gx&&h.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var wc=gx;var nzt=T(S(),1);function SE(e){this._definitionChanged=new ye,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(g(e,g.EMPTY_OBJECT))}Object.defineProperties(SE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),width:le("width"),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),cornerType:le("cornerType"),granularity:le("granularity"),fill:le("fill"),material:Xo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});SE.prototype.clone=function(e){return l(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 SE(this)};SE.prototype.merge=function(e){this.show=g(this.show,e.show),this.positions=g(this.positions,e.positions),this.width=g(this.width,e.width),this.height=g(this.height,e.height),this.heightReference=g(this.heightReference,e.heightReference),this.extrudedHeight=g(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=g(this.extrudedHeightReference,e.extrudedHeightReference),this.cornerType=g(this.cornerType,e.cornerType),this.granularity=g(this.granularity,e.granularity),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=g(this.classificationType,e.classificationType),this.zIndex=g(this.zIndex,e.zIndex)};var xx=SE;var rzt=T(S(),1);function UIe(e){return e}function kIe(e,t){return le(e,t,UIe)}var xl=kIe;var mzt=T(S(),1);function CE(e){this._definitionChanged=new ye,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(g(e,g.EMPTY_OBJECT))}Object.defineProperties(CE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),length:le("length"),topRadius:le("topRadius"),bottomRadius:le("bottomRadius"),heightReference:le("heightReference"),fill:le("fill"),material:Xo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),numberOfVerticalLines:le("numberOfVerticalLines"),slices:le("slices"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});CE.prototype.clone=function(e){return l(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 CE(this)};CE.prototype.merge=function(e){this.show=g(this.show,e.show),this.length=g(this.length,e.length),this.topRadius=g(this.topRadius,e.topRadius),this.bottomRadius=g(this.bottomRadius,e.bottomRadius),this.heightReference=g(this.heightReference,e.heightReference),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=g(this.numberOfVerticalLines,e.numberOfVerticalLines),this.slices=g(this.slices,e.slices),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition)};var _x=CE;var xzt=T(S(),1);function VE(e){this._definitionChanged=new ye,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(g(e,g.EMPTY_OBJECT))}Object.defineProperties(VE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),semiMajorAxis:le("semiMajorAxis"),semiMinorAxis:le("semiMinorAxis"),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),rotation:le("rotation"),stRotation:le("stRotation"),granularity:le("granularity"),fill:le("fill"),material:Xo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),numberOfVerticalLines:le("numberOfVerticalLines"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});VE.prototype.clone=function(e){return l(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 VE(this)};VE.prototype.merge=function(e){this.show=g(this.show,e.show),this.semiMajorAxis=g(this.semiMajorAxis,e.semiMajorAxis),this.semiMinorAxis=g(this.semiMinorAxis,e.semiMinorAxis),this.height=g(this.height,e.height),this.heightReference=g(this.heightReference,e.heightReference),this.extrudedHeight=g(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=g(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=g(this.rotation,e.rotation),this.stRotation=g(this.stRotation,e.stRotation),this.granularity=g(this.granularity,e.granularity),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=g(this.numberOfVerticalLines,e.numberOfVerticalLines),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=g(this.classificationType,e.classificationType),this.zIndex=g(this.zIndex,e.zIndex)};var Tx=VE;var Rzt=T(S(),1);function LE(e){this._definitionChanged=new ye,this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._innerRadii=void 0,this._innerRadiiSubscription=void 0,this._minimumClock=void 0,this._minimumClockSubscription=void 0,this._maximumClock=void 0,this._maximumClockSubscription=void 0,this._minimumCone=void 0,this._minimumConeSubscription=void 0,this._maximumCone=void 0,this._maximumConeSubscription=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(g(e,g.EMPTY_OBJECT))}Object.defineProperties(LE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),radii:le("radii"),innerRadii:le("innerRadii"),minimumClock:le("minimumClock"),maximumClock:le("maximumClock"),minimumCone:le("minimumCone"),maximumCone:le("maximumCone"),heightReference:le("heightReference"),fill:le("fill"),material:Xo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),stackPartitions:le("stackPartitions"),slicePartitions:le("slicePartitions"),subdivisions:le("subdivisions"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});LE.prototype.clone=function(e){return l(e)?(e.show=this.show,e.radii=this.radii,e.innerRadii=this.innerRadii,e.minimumClock=this.minimumClock,e.maximumClock=this.maximumClock,e.minimumCone=this.minimumCone,e.maximumCone=this.maximumCone,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 LE(this)};LE.prototype.merge=function(e){this.show=g(this.show,e.show),this.radii=g(this.radii,e.radii),this.innerRadii=g(this.innerRadii,e.innerRadii),this.minimumClock=g(this.minimumClock,e.minimumClock),this.maximumClock=g(this.maximumClock,e.maximumClock),this.minimumCone=g(this.minimumCone,e.minimumCone),this.maximumCone=g(this.maximumCone,e.maximumCone),this.heightReference=g(this.heightReference,e.heightReference),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.stackPartitions=g(this.stackPartitions,e.stackPartitions),this.slicePartitions=g(this.slicePartitions,e.slicePartitions),this.subdivisions=g(this.subdivisions,e.subdivisions),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition)};var Sx=LE;var Wzt=T(S(),1);function RE(e){this._definitionChanged=new ye,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(g(e,g.EMPTY_OBJECT))}Object.defineProperties(RE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),text:le("text"),font:le("font"),style:le("style"),scale:le("scale"),showBackground:le("showBackground"),backgroundColor:le("backgroundColor"),backgroundPadding:le("backgroundPadding"),pixelOffset:le("pixelOffset"),eyeOffset:le("eyeOffset"),horizontalOrigin:le("horizontalOrigin"),verticalOrigin:le("verticalOrigin"),heightReference:le("heightReference"),fillColor:le("fillColor"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),translucencyByDistance:le("translucencyByDistance"),pixelOffsetScaleByDistance:le("pixelOffsetScaleByDistance"),scaleByDistance:le("scaleByDistance"),distanceDisplayCondition:le("distanceDisplayCondition"),disableDepthTestDistance:le("disableDepthTestDistance")});RE.prototype.clone=function(e){return l(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 RE(this)};RE.prototype.merge=function(e){this.show=g(this.show,e.show),this.text=g(this.text,e.text),this.font=g(this.font,e.font),this.style=g(this.style,e.style),this.scale=g(this.scale,e.scale),this.showBackground=g(this.showBackground,e.showBackground),this.backgroundColor=g(this.backgroundColor,e.backgroundColor),this.backgroundPadding=g(this.backgroundPadding,e.backgroundPadding),this.pixelOffset=g(this.pixelOffset,e.pixelOffset),this.eyeOffset=g(this.eyeOffset,e.eyeOffset),this.horizontalOrigin=g(this.horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=g(this.verticalOrigin,e.verticalOrigin),this.heightReference=g(this.heightReference,e.heightReference),this.fillColor=g(this.fillColor,e.fillColor),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.translucencyByDistance=g(this.translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=g(this.pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.scaleByDistance=g(this.scaleByDistance,e.scaleByDistance),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=g(this.disableDepthTestDistance,e.disableDepthTestDistance)};var Sm=RE;var cJt=T(S(),1);var Hzt=T(S(),1);var Mzt=T(S(),1);var DIe=new h(1,1,1),BIe=h.ZERO,OIe=Me.IDENTITY;function Nte(e,t,n){this.translation=h.clone(g(e,BIe)),this.rotation=Me.clone(g(t,OIe)),this.scale=h.clone(g(n,DIe))}Nte.prototype.equals=function(e){return this===e||l(e)&&h.equals(this.translation,e.translation)&&Me.equals(this.rotation,e.rotation)&&h.equals(this.scale,e.scale)};var Gb=Nte;var YO=new Gb;function ZE(e){e=g(e,g.EMPTY_OBJECT),this._definitionChanged=new ye,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=e.translation,this.rotation=e.rotation,this.scale=e.scale}Object.defineProperties(ZE.prototype,{isConstant:{get:function(){return z.isConstant(this._translation)&&z.isConstant(this._rotation)&&z.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:le("translation"),rotation:le("rotation"),scale:le("scale")});ZE.prototype.getValue=function(e,t){return l(t)||(t=new Gb),t.translation=z.getValueOrClonedDefault(this._translation,e,YO.translation,t.translation),t.rotation=z.getValueOrClonedDefault(this._rotation,e,YO.rotation,t.rotation),t.scale=z.getValueOrClonedDefault(this._scale,e,YO.scale,t.scale),t};ZE.prototype.equals=function(e){return this===e||e instanceof ZE&&z.equals(this._translation,e._translation)&&z.equals(this._rotation,e._rotation)&&z.equals(this._scale,e._scale)};var Cx=ZE;var eJt=T(S(),1);function Vp(e,t){this._propertyNames=[],this._definitionChanged=new ye,l(e)&&this.merge(e,t)}Object.defineProperties(Vp.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){let e=this._propertyNames;for(let t=0,n=e.length;t<n;t++)if(!z.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});Vp.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function YIe(e){return new ei(e)}Vp.prototype.addProperty=function(e,t,n){this._propertyNames.push(e),Object.defineProperty(this,e,le(e,!0,g(n,YIe))),l(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)};Vp.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};Vp.prototype.getValue=function(e,t){l(t)||(t={});let n=this._propertyNames;for(let i=0,o=n.length;i<o;i++){let r=n[i];t[r]=z.getValueOrUndefined(this[r],e,t[r])}return t};Vp.prototype.merge=function(e,t){let n=this._propertyNames,i=l(e._propertyNames)?e._propertyNames:Object.keys(e);for(let o=0,r=i.length;o<r;o++){let s=i[o],a=this[s],c=e[s];a===void 0&&n.indexOf(s)===-1&&this.addProperty(s,void 0,t),c!==void 0&&(a!==void 0?l(a)&&l(a.merge)&&a.merge(c):l(c)&&l(c.merge)&&l(c.clone)?this[s]=c.clone():this[s]=c)}};function HIe(e,t){let n=e._propertyNames,i=t._propertyNames,o=n.length;if(o!==i.length)return!1;for(let r=0;r<o;++r){let s=n[r];if(i.indexOf(s)===-1||!z.equals(e[s],t[s]))return!1}return!0}Vp.prototype.equals=function(e){return this===e||e instanceof Vp&&HIe(this,e)};var _l=Vp;function Ute(e){return new Cx(e)}function KIe(e){return new _l(e,Ute)}function zIe(e){return new _l(e)}function GE(e){this._definitionChanged=new ye,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._customShader=void 0,this._customShaderSubscription=void 0,this._marsOptions=e&&e.marsOptions||{},this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(GE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),uri:le("uri"),scale:le("scale"),minimumPixelSize:le("minimumPixelSize"),maximumScale:le("maximumScale"),incrementallyLoadTextures:le("incrementallyLoadTextures"),runAnimations:le("runAnimations"),clampAnimations:le("clampAnimations"),shadows:le("shadows"),heightReference:le("heightReference"),silhouetteColor:le("silhouetteColor"),silhouetteSize:le("silhouetteSize"),color:le("color"),colorBlendMode:le("colorBlendMode"),colorBlendAmount:le("colorBlendAmount"),imageBasedLightingFactor:le("imageBasedLightingFactor"),lightColor:le("lightColor"),distanceDisplayCondition:le("distanceDisplayCondition"),nodeTransformations:le("nodeTransformations",void 0,KIe),articulations:le("articulations",void 0,zIe),clippingPlanes:le("clippingPlanes"),customShader:le("customShader")});GE.prototype.clone=function(e){return l(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.customShader=this.customShader,e):new GE(this)};GE.prototype.merge=function(e){this.show=g(this.show,e.show),this.uri=g(this.uri,e.uri),this.scale=g(this.scale,e.scale),this.minimumPixelSize=g(this.minimumPixelSize,e.minimumPixelSize),this.maximumScale=g(this.maximumScale,e.maximumScale),this.incrementallyLoadTextures=g(this.incrementallyLoadTextures,e.incrementallyLoadTextures),this.runAnimations=g(this.runAnimations,e.runAnimations),this.clampAnimations=g(this.clampAnimations,e.clampAnimations),this.shadows=g(this.shadows,e.shadows),this.heightReference=g(this.heightReference,e.heightReference),this.silhouetteColor=g(this.silhouetteColor,e.silhouetteColor),this.silhouetteSize=g(this.silhouetteSize,e.silhouetteSize),this.color=g(this.color,e.color),this.colorBlendMode=g(this.colorBlendMode,e.colorBlendMode),this.colorBlendAmount=g(this.colorBlendAmount,e.colorBlendAmount),this.imageBasedLightingFactor=g(this.imageBasedLightingFactor,e.imageBasedLightingFactor),this.lightColor=g(this.lightColor,e.lightColor),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition),this.clippingPlanes=g(this.clippingPlanes,e.clippingPlanes),this.customShader=g(this.customShader,e.customShader);let t=e.nodeTransformations;if(l(t)){let i=this.nodeTransformations;l(i)?i.merge(t):this.nodeTransformations=new _l(t,Ute)}let n=e.articulations;if(l(n)){let i=this.articulations;l(i)?i.merge(n):this.articulations=new _l(n)}};var Lp=GE;var fJt=T(S(),1);function EE(e){this._definitionChanged=new ye,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._maximumScreenSpaceError=void 0,this._maximumScreenSpaceErrorSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(EE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),uri:le("uri"),maximumScreenSpaceError:le("maximumScreenSpaceError")});EE.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new EE(this)};EE.prototype.merge=function(e){this.show=g(this.show,e.show),this.uri=g(this.uri,e.uri),this.maximumScreenSpaceError=g(this.maximumScreenSpaceError,e.maximumScreenSpaceError)};var Vx=EE;var TJt=T(S(),1);function IE(e){this._definitionChanged=new ye,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(g(e,g.EMPTY_OBJECT))}Object.defineProperties(IE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),leadTime:le("leadTime"),trailTime:le("trailTime"),width:le("width"),resolution:le("resolution"),material:Xo("material"),distanceDisplayCondition:le("distanceDisplayCondition")});IE.prototype.clone=function(e){return l(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 IE(this)};IE.prototype.merge=function(e){this.show=g(this.show,e.show),this.leadTime=g(this.leadTime,e.leadTime),this.trailTime=g(this.trailTime,e.trailTime),this.width=g(this.width,e.width),this.resolution=g(this.resolution,e.resolution),this.material=g(this.material,e.material),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition)};var Rp=IE;var GJt=T(S(),1);function XE(e){this._definitionChanged=new ye,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(g(e,g.EMPTY_OBJECT))}Object.defineProperties(XE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),plane:le("plane"),dimensions:le("dimensions"),fill:le("fill"),material:Xo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});XE.prototype.clone=function(e){return l(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 XE(this)};XE.prototype.merge=function(e){this.show=g(this.show,e.show),this.plane=g(this.plane,e.plane),this.dimensions=g(this.dimensions,e.dimensions),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition)};var WE=XE;var vJt=T(S(),1);function PE(e){this._definitionChanged=new ye,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(g(e,g.EMPTY_OBJECT))}Object.defineProperties(PE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),pixelSize:le("pixelSize"),heightReference:le("heightReference"),color:le("color"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),scaleByDistance:le("scaleByDistance"),translucencyByDistance:le("translucencyByDistance"),distanceDisplayCondition:le("distanceDisplayCondition"),disableDepthTestDistance:le("disableDepthTestDistance")});PE.prototype.clone=function(e){return l(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 PE(this)};PE.prototype.merge=function(e){this.show=g(this.show,e.show),this.pixelSize=g(this.pixelSize,e.pixelSize),this.heightReference=g(this.heightReference,e.heightReference),this.color=g(this.color,e.color),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.scaleByDistance=g(this.scaleByDistance,e.scaleByDistance),this.translucencyByDistance=g(this._translucencyByDistance,e.translucencyByDistance),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=g(this.disableDepthTestDistance,e.disableDepthTestDistance)};var Lx=PE;var HJt=T(S(),1);var AJt=T(S(),1);function JIe(e,t){this.positions=l(e)?e:[],this.holes=l(t)?t:[]}var Va=JIe;function QIe(e){return Array.isArray(e)&&(e=new Va(e)),new ei(e)}function vE(e){this._definitionChanged=new ye,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._textureCoordinates=void 0,this._textureCoordinatesSubscription=void 0,this.merge(g(e,g.EMPTY_OBJECT))}Object.defineProperties(vE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),hierarchy:le("hierarchy",void 0,QIe),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),stRotation:le("stRotation"),granularity:le("granularity"),fill:le("fill"),material:Xo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),perPositionHeight:le("perPositionHeight"),closeTop:le("closeTop"),closeBottom:le("closeBottom"),arcType:le("arcType"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex"),textureCoordinates:le("textureCoordinates")});vE.prototype.clone=function(e){return l(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.textureCoordinates=this.textureCoordinates,e):new vE(this)};vE.prototype.merge=function(e){this.show=g(this.show,e.show),this.hierarchy=g(this.hierarchy,e.hierarchy),this.height=g(this.height,e.height),this.heightReference=g(this.heightReference,e.heightReference),this.extrudedHeight=g(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=g(this.extrudedHeightReference,e.extrudedHeightReference),this.stRotation=g(this.stRotation,e.stRotation),this.granularity=g(this.granularity,e.granularity),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.perPositionHeight=g(this.perPositionHeight,e.perPositionHeight),this.closeTop=g(this.closeTop,e.closeTop),this.closeBottom=g(this.closeBottom,e.closeBottom),this.arcType=g(this.arcType,e.arcType),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=g(this.classificationType,e.classificationType),this.zIndex=g(this.zIndex,e.zIndex),this.textureCoordinates=g(this.textureCoordinates,e.textureCoordinates)};var Cm=vE;var $Jt=T(S(),1);function wE(e){this._definitionChanged=new ye,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(g(e,g.EMPTY_OBJECT))}Object.defineProperties(wE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),width:le("width"),granularity:le("granularity"),material:Xo("material"),depthFailMaterial:Xo("depthFailMaterial"),arcType:le("arcType"),clampToGround:le("clampToGround"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});wE.prototype.clone=function(e){return l(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 wE(this)};wE.prototype.merge=function(e){this.show=g(this.show,e.show),this.positions=g(this.positions,e.positions),this.width=g(this.width,e.width),this.granularity=g(this.granularity,e.granularity),this.material=g(this.material,e.material),this.depthFailMaterial=g(this.depthFailMaterial,e.depthFailMaterial),this.arcType=g(this.arcType,e.arcType),this.clampToGround=g(this.clampToGround,e.clampToGround),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=g(this.classificationType,e.classificationType),this.zIndex=g(this.zIndex,e.zIndex)};var $a=wE;var sQt=T(S(),1);function FE(e){this._definitionChanged=new ye,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(g(e,g.EMPTY_OBJECT))}Object.defineProperties(FE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),shape:le("shape"),cornerType:le("cornerType"),granularity:le("granularity"),fill:le("fill"),material:Xo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});FE.prototype.clone=function(e){return l(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 FE(this)};FE.prototype.merge=function(e){this.show=g(this.show,e.show),this.positions=g(this.positions,e.positions),this.shape=g(this.shape,e.shape),this.cornerType=g(this.cornerType,e.cornerType),this.granularity=g(this.granularity,e.granularity),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition)};var Rx=FE;var hQt=T(S(),1);function AE(e){this._definitionChanged=new ye,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(g(e,g.EMPTY_OBJECT))}Object.defineProperties(AE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),coordinates:le("coordinates"),height:le("height"),heightReference:le("heightReference"),extrudedHeight:le("extrudedHeight"),extrudedHeightReference:le("extrudedHeightReference"),rotation:le("rotation"),stRotation:le("stRotation"),granularity:le("granularity"),fill:le("fill"),material:Xo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition"),classificationType:le("classificationType"),zIndex:le("zIndex")});AE.prototype.clone=function(e){return l(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 AE(this)};AE.prototype.merge=function(e){this.show=g(this.show,e.show),this.coordinates=g(this.coordinates,e.coordinates),this.height=g(this.height,e.height),this.heightReference=g(this.heightReference,e.heightReference),this.extrudedHeight=g(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=g(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=g(this.rotation,e.rotation),this.stRotation=g(this.stRotation,e.stRotation),this.granularity=g(this.granularity,e.granularity),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=g(this.classificationType,e.classificationType),this.zIndex=g(this.zIndex,e.zIndex)};var Vm=AE;var _Qt=T(S(),1);function ME(e){this._definitionChanged=new ye,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(g(e,g.EMPTY_OBJECT))}Object.defineProperties(ME.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:le("show"),positions:le("positions"),minimumHeights:le("minimumHeights"),maximumHeights:le("maximumHeights"),granularity:le("granularity"),fill:le("fill"),material:Xo("material"),outline:le("outline"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth"),shadows:le("shadows"),distanceDisplayCondition:le("distanceDisplayCondition")});ME.prototype.clone=function(e){return l(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 ME(this)};ME.prototype.merge=function(e){this.show=g(this.show,e.show),this.positions=g(this.positions,e.positions),this.minimumHeights=g(this.minimumHeights,e.minimumHeights),this.maximumHeights=g(this.maximumHeights,e.maximumHeights),this.granularity=g(this.granularity,e.granularity),this.fill=g(this.fill,e.fill),this.material=g(this.material,e.material),this.outline=g(this.outline,e.outline),this.outlineColor=g(this.outlineColor,e.outlineColor),this.outlineWidth=g(this.outlineWidth,e.outlineWidth),this.shadows=g(this.shadows,e.shadows),this.distanceDisplayCondition=g(this.distanceDisplayCondition,e.distanceDisplayCondition)};var Zp=ME;var jIe=new he;function qIe(e){return new wc(e)}function $Ie(e){return le(e,void 0,qIe)}function $s(e,t){return le(e,void 0,function(n){return n instanceof t?n:new t(n)})}function jh(e){e=g(e,g.EMPTY_OBJECT);let t=e.id;l(t)||(t=Hn()),this._availability=void 0,this._id=t,this._definitionChanged=new ye,this._name=e.name,this._show=g(e.show,!0),this._parent=void 0,this._propertyNames=["billboard","box","corridor","cylinder","description","ellipse","ellipsoid","label","model","tileset","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._tileset=void 0,this._tilesetSubscription=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 HO(e,t,n){let i=t.length;for(let o=0;o<i;o++){let r=t[o],s=r._show;(!n&&s)!==(n&&s)&&HO(r,r._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(jh.prototype,{availability:xl("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:xl("name"),show:{get:function(){return this._show},set:function(e){if(e===this._show)return;let t=this.isShowing;this._show=e;let n=this.isShowing;t!==n&&HO(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},isShowing:{get:function(){return this._show&&(!l(this.entityCollection)||this.entityCollection.show)&&(!l(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(e){let t=this._parent;if(t===e)return;let n=this.isShowing;if(l(t)){let o=t._children.indexOf(this);t._children.splice(o,1)}this._parent=e,l(e)&&e._children.push(this);let i=this.isShowing;n!==i&&HO(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:$s("billboard",Da),box:$s("box",yx),corridor:$s("corridor",xx),cylinder:$s("cylinder",_x),description:le("description"),ellipse:$s("ellipse",Tx),ellipsoid:$s("ellipsoid",Sx),label:$s("label",Sm),model:$s("model",Lp),tileset:$s("tileset",Vx),orientation:le("orientation"),path:$s("path",Rp),plane:$s("plane",WE),point:$s("point",Lx),polygon:$s("polygon",Cm),polyline:$s("polyline",$a),polylineVolume:$s("polylineVolume",Rx),properties:$s("properties",_l),position:$Ie("position"),rectangle:$s("rectangle",Vm),viewFrom:le("viewFrom"),wall:$s("wall",Zp)});jh.prototype.isAvailable=function(e){let t=this._availability;return!l(t)||t.contains(e)};jh.prototype.addProperty=function(e){this._propertyNames.push(e),Object.defineProperty(this,e,xl(e,!0))};jh.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e]};jh.prototype.merge=function(e){this.name=g(this.name,e.name),this.availability=g(this.availability,e.availability);let t=this._propertyNames,n=l(e._propertyNames)?e._propertyNames:Object.keys(e),i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r==="parent"||r==="name"||r==="availability"||r==="children")continue;let s=this[r],a=e[r];!l(s)&&t.indexOf(r)===-1&&this.addProperty(r),l(a)&&(l(s)?l(s.merge)&&s.merge(a):l(a.merge)&&l(a.clone)?this[r]=a.clone():this[r]=a)}};var kte=new q,Dte=new h,Bte=new Me;jh.prototype.computeModelMatrix=function(e,t){let n=z.getValueOrUndefined(this._position,e,Dte);if(!l(n))return;let i=z.getValueOrUndefined(this._orientation,e,Bte);return l(i)?t=A.fromRotationTranslation(q.fromQuaternion(i,kte),n,t):t=Xt.eastNorthUpToFixedFrame(n,void 0,t),t};jh.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,o){let r=z.getValueOrDefault(t,e,Qe.NONE),s=z.getValueOrUndefined(this._position,e,Dte);if(r===Qe.NONE||!l(s)||h.equalsEpsilon(s,h.ZERO,W.EPSILON8))return this.computeModelMatrix(e,o);let a=i.cartesianToCartographic(s,jIe);tu(r)?a.height=n:a.height+=n,s=i.cartographicToCartesian(a,s);let c=z.getValueOrUndefined(this._orientation,e,Bte);return l(c)?o=A.fromRotationTranslation(q.fromQuaternion(c,kte),s,o):o=Xt.eastNorthUpToFixedFrame(s,void 0,o),o};jh.supportsMaterialsforEntitiesOnTerrain=function(e){return Pc.supportsMaterials(e)};jh.supportsPolylinesOnTerrain=function(e){return Tm.isSupported(e)};var Jo=jh;var eXe=new Ut(O.WHITE),tXe=new ei(!0),nXe=new ei(!0),iXe=new ei(!1),oXe=new ei(O.BLACK),rXe=new ei(Cn.DISABLED),sXe=new ei(new It),aXe=new ei(Bn.BOTH);function Fc(e){let t=e.entity,n=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 ye,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=n,this._id=`${n}-${t.id}`,this._observedPropertyNames=e.observedPropertyNames,this._supportsMaterialsforEntitiesOnTerrain=Jo.supportsMaterialsforEntitiesOnTerrain(e.scene)}Object.defineProperties(Fc.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||!l(this._entity.availability)&&z.isConstant(this._showProperty)&&z.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!l(this._entity.availability)&&z.isConstant(this._showProperty)&&z.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}}});Fc.prototype.isOutlineVisible=function(e){let t=this._entity,n=this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e);return g(n,!1)};Fc.prototype.isFilled=function(e){let t=this._entity,n=this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e);return g(n,!1)};Fc.prototype.createFillGeometryInstance=fe.throwInstantiationError;Fc.prototype.createOutlineGeometryInstance=fe.throwInstantiationError;Fc.prototype.isDestroyed=function(){return!1};Fc.prototype.destroy=function(){ue(this)};Fc.prototype._isHidden=function(e,t){let n=t.show;return l(n)&&n.isConstant&&!n.getValue(Be.MINIMUM_VALUE)};Fc.prototype._isOnTerrain=function(e,t){return!1};Fc.prototype._getIsClosed=function(e){return!0};Fc.prototype._isDynamic=fe.throwInstantiationError;Fc.prototype._setStaticOptions=fe.throwInstantiationError;Fc.prototype._onEntityPropertyChanged=function(e,t,n,i){if(this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let r=o.fill,s=l(r)&&r.isConstant?r.getValue(Be.MINIMUM_VALUE):!0,a=o.outline,c=l(a);if(c&&a.isConstant&&(c=a.getValue(Be.MINIMUM_VALUE)),!s&&!c){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let d=o.show;if(this._isHidden(e,o)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}this._materialProperty=g(o.material,eXe),this._fillProperty=g(r,nXe),this._showProperty=g(d,tXe),this._showOutlineProperty=g(o.outline,iXe),this._outlineColorProperty=c?g(o.outlineColor,oXe):void 0,this._shadowsProperty=g(o.shadows,rXe),this._distanceDisplayConditionProperty=g(o.distanceDisplayCondition,sXe),this._classificationTypeProperty=g(o.classificationType,aXe),this._fillEnabled=s;let u=this._isOnTerrain(e,o)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof Ut);if(c&&u&&(Ft(Ft.geometryOutlines),c=!1),this._onTerrain=u,this._outlineEnabled=c,this._isDynamic(e,o))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{this._setStaticOptions(e,o),this._isClosed=this._getIsClosed(this._options);let m=o.outlineWidth;this._outlineWidth=l(m)?m.getValue(Be.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Fc.prototype.createDynamicUpdater=function(e,t){return new this.constructor.DynamicGeometryUpdater(this,e,t)};var si=Fc;var k4t=T(S(),1);var V4t=T(S(),1);function JS(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new ye,this.setCallback(e,t)}Object.defineProperties(JS.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}});JS.prototype.getValue=function(e,t){return this._callback(e,t)};JS.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};JS.prototype.equals=function(e){return this===e||e instanceof JS&&this._callback===e._callback&&this._isConstant===e._isConstant};var Lm=JS;var w4t=T(S(),1);var Ote=new h;function QS(e,t,n,i){this._scene=e,this._heightReference=n,this._extrudedHeightReference=i,this._positionProperty=t,this._position=new h,this._cartographicPosition=new he,this._normal=new h,this._definitionChanged=new ye,this._terrainHeight=0,this._removeCallbackFunc=void 0,this._removeEventListener=void 0,this._removeModeListener=void 0;let o=this;if(l(e.globe)&&(this._removeEventListener=e.terrainProviderChanged.addEventListener(function(){o._updateClamping()}),this._removeModeListener=e.morphComplete.addEventListener(function(){o._updateClamping()})),t.isConstant){let r=t.getValue(Be.MINIMUM_VALUE,Ote);if(!l(r)||h.equals(r,h.ZERO)||!l(e.globe))return;this._position=h.clone(r,this._position),this._updateClamping(),this._normal=e.globe.ellipsoid.geodeticSurfaceNormal(r,this._normal)}}Object.defineProperties(QS.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});QS.prototype._updateClamping=function(){l(this._removeCallbackFunc)&&this._removeCallbackFunc();let e=this._scene,t=e.globe,n=this._position;if(h.equals(n,h.ZERO)){this._terrainHeight=0;return}let o=t.ellipsoid.cartesianToCartographic(n,this._cartographicPosition),r=e.getHeight(o,this._heightReference);l(r)?this._terrainHeight=r:this._terrainHeight=0;let s=a=>{this._terrainHeight=a.height,this.definitionChanged.raiseEvent()};this._removeCallbackFunc=e.updateHeight(o,s,this._heightReference)};QS.prototype.getValue=function(e,t){let n=z.getValueOrDefault(this._heightReference,e,Qe.NONE),i=z.getValueOrDefault(this._extrudedHeightReference,e,Qe.NONE);if(n===Qe.NONE&&!TS(i))return this._position=h.clone(h.ZERO,this._position),h.clone(h.ZERO,t);if(this._positionProperty.isConstant)return h.multiplyByScalar(this._normal,this._terrainHeight,t);let o=this._scene,r=this._positionProperty.getValue(e,Ote);if(!l(r)||h.equals(r,h.ZERO)||!l(o.globe))return h.clone(h.ZERO,t);if(h.equalsEpsilon(this._position,r,W.EPSILON10))return h.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=h.clone(r,this._position),this._updateClamping();let s=o.globe.ellipsoid.geodeticSurfaceNormal(r,this._normal);return h.multiplyByScalar(s,this._terrainHeight,t)};QS.prototype.isDestroyed=function(){return!1};QS.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),ue(this)};var Zx=QS;function cXe(e,t,n,i){if(si.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o))return;l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference;if(l(r)){let s=new Lm(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new Zx(this._scene,s,r)}}var Gp=cXe;var Yte=h.ZERO,Hte=new h,lXe=new h,Kte=new O;function dXe(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function rd(e,t){si.call(this,{entity:e,scene:t,geometryOptions:new dXe(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}l(Object.create)&&(rd.prototype=Object.create(si.prototype),rd.prototype.constructor=rd);Object.defineProperties(rd.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});rd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Dn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Ut){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Kte)),l(a)||(a=O.WHITE),s.color=Ot.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=eo.fromCartesian3(z.getValueOrDefault(this._terrainOffsetProperty,e,Yte,Hte))),new St({id:t,geometry:pl.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.mapProjection.ellipsoid),attributes:s})};rd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=z.getValueOrDefault(this._outlineColorProperty,e,O.BLACK,Kte),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ot.fromColor(i),distanceDisplayCondition:Dn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=eo.fromCartesian3(z.getValueOrDefault(this._terrainOffsetProperty,e,Yte,Hte))),new St({id:t,geometry:bm.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.mapProjection.ellipsoid),attributes:r})};rd.prototype._computeCenter=function(e,t){return z.getValueOrUndefined(this._entity.position,e,t)};rd.prototype._isHidden=function(e,t){return!l(t.dimensions)||!l(e.position)||si.prototype._isHidden.call(this,e,t)};rd.prototype._isDynamic=function(e,t){return!e.position.isConstant||!z.isConstant(e.orientation)||!t.dimensions.isConstant||!z.isConstant(t.outlineWidth)};rd.prototype._setStaticOptions=function(e,t){let n=z.getValueOrDefault(t.heightReference,Be.MINIMUM_VALUE,Qe.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Ut?cn.VERTEX_FORMAT:mo.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(Be.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==Qe.NONE?an.ALL:void 0};rd.prototype._onEntityPropertyChanged=Gp;rd.DynamicGeometryUpdater=jS;function jS(e,t,n){ri.call(this,e,t,n)}l(Object.create)&&(jS.prototype=Object.create(ri.prototype),jS.prototype.constructor=jS);jS.prototype._isHidden=function(e,t,n){let i=z.getValueOrUndefined(e.position,n,lXe),o=this._options.dimensions;return!l(i)||!l(o)||ri.prototype._isHidden.call(this,e,t,n)};jS.prototype._setOptions=function(e,t,n){let i=z.getValueOrDefault(t.heightReference,n,Qe.NONE),o=this._options;o.dimensions=z.getValueOrUndefined(t.dimensions,n,o.dimensions),o.offsetAttribute=i!==Qe.NONE?an.ALL:void 0};var NE=rd;var sMn=T(S(),1);var JAn=T(S(),1);var fjt=T(S(),1),Jte=T(zte(),1);var uXe=0,JO={};function qh(e,t){let n,i=e;l(JO[i])?n=JO[i]:(n=uXe++,JO[i]=n),t=g(t,!1),this._id=n,this._html=e,this._showOnScreen=t,this._element=void 0}Object.defineProperties(qh.prototype,{html:{get:function(){return this._html}},id:{get:function(){return this._id}},showOnScreen:{get:function(){return this._showOnScreen},set:function(e){this._showOnScreen=e}},element:{get:function(){if(!l(this._element)){let e=Jte.default.sanitize(this._html),t=document.createElement("div");t._creditId=this._id,t.style.display="inline",t.innerHTML=e;let n=t.querySelectorAll("a");for(let i=0;i<n.length;i++)n[i].setAttribute("target","_blank");this._element=t}return this._element}}});qh.equals=function(e,t){return e===t||l(e)&&l(t)&&e._id===t._id&&e._showOnScreen===t._showOnScreen};qh.prototype.equals=function(e){return qh.equals(this,e)};qh.prototype.isIon=function(){return this.html.indexOf("ion-credit.png")!==-1};qh.getIonCredit=function(e){let t=l(e.collapsible)&&!e.collapsible;return new qh(e.html,t)};qh.clone=function(e){if(l(e))return new qh(e.html,e.showOnScreen)};var Vt=qh;var yjt=T(S(),1);function mXe(e,t){Ft(e,t)}var _r=mXe;var n8t=T(S(),1);var Jjt=T(S(),1);var Tjt=T(S(),1);function Qte(e){e=g(e,g.EMPTY_OBJECT),this.vertexArray=e.vertexArray,this.fragmentShaderSource=e.fragmentShaderSource,this.shaderProgram=e.shaderProgram,this.uniformMap=e.uniformMap,this.outputTexture=e.outputTexture,this.preExecute=e.preExecute,this.postExecute=e.postExecute,this.canceled=e.canceled,this.persists=g(e.persists,!1),this.pass=Ve.COMPUTE,this.owner=e.owner}Qte.prototype.execute=function(e){e.execute(this)};var au=Qte;var Cjt=T(S(),1),UE=`in vec2 v_textureCoordinates;
uniform float originalSize;
uniform sampler2D texture0;
uniform sampler2D texture1;
uniform sampler2D texture2;
uniform sampler2D texture3;
uniform sampler2D texture4;
uniform sampler2D texture5;
const float yMipLevel1 = 1.0 - (1.0 / pow(2.0, 1.0));
const float yMipLevel2 = 1.0 - (1.0 / pow(2.0, 2.0));
const float yMipLevel3 = 1.0 - (1.0 / pow(2.0, 3.0));
const float yMipLevel4 = 1.0 - (1.0 / pow(2.0, 4.0));
void main()
{
vec2 uv = v_textureCoordinates;
vec2 textureSize = vec2(originalSize * 1.5 + 2.0, originalSize);
vec2 pixel = 1.0 / textureSize;
float mipLevel = 0.0;
if (uv.x - pixel.x > (textureSize.y / textureSize.x))
{
mipLevel = 1.0;
if (uv.y - pixel.y > yMipLevel1)
{
mipLevel = 2.0;
if (uv.y - pixel.y * 3.0 > yMipLevel2)
{
mipLevel = 3.0;
if (uv.y - pixel.y * 5.0 > yMipLevel3)
{
mipLevel = 4.0;
if (uv.y - pixel.y * 7.0 > yMipLevel4)
{
mipLevel = 5.0;
}
}
}
}
}
if (mipLevel > 0.0)
{
float scale = pow(2.0, mipLevel);
uv.y -= (pixel.y * (mipLevel - 1.0) * 2.0);
uv.x *= ((textureSize.x - 2.0) / textureSize.y);
uv.x -= 1.0 + pixel.x;
uv.y -= (1.0 - (1.0 / pow(2.0, mipLevel - 1.0)));
uv *= scale;
}
else
{
uv.x *= (textureSize.x / textureSize.y);
}
if(mipLevel == 0.0)
{
out_FragColor = texture(texture0, uv);
}
else if(mipLevel == 1.0)
{
out_FragColor = texture(texture1, uv);
}
else if(mipLevel == 2.0)
{
out_FragColor = texture(texture2, uv);
}
else if(mipLevel == 3.0)
{
out_FragColor = texture(texture3, uv);
}
else if(mipLevel == 4.0)
{
out_FragColor = texture(texture4, uv);
}
else if(mipLevel == 5.0)
{
out_FragColor = texture(texture5, uv);
}
else
{
out_FragColor = vec4(0.0);
}
}
`;var Ljt=T(S(),1),kE=`in vec3 v_cubeMapCoordinates;
uniform samplerCube cubeMap;
void main()
{
vec4 rgba = czm_textureCube(cubeMap, v_cubeMapCoordinates);
#ifdef RGBA_NORMALIZED
out_FragColor = vec4(rgba.rgb, 1.0);
#else
float m = rgba.a * 16.0;
vec3 r = rgba.rgb * m;
out_FragColor = vec4(r * r, 1.0);
#endif
}
`;var Zjt=T(S(),1),DE=`in vec4 position;
in vec3 cubeMapCoordinates;
out vec3 v_cubeMapCoordinates;
void main()
{
gl_Position = position;
v_cubeMapCoordinates = cubeMapCoordinates;
}
`;function Gx(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._errorEvent=new ye}Object.defineProperties(Gx.prototype,{url:{get:function(){return this._url}},errorEvent:{get:function(){return this._errorEvent}},texture:{get:function(){return this._texture}},maximumMipmapLevel:{get:function(){return this._maximumMipmapLevel}},ready:{get:function(){return this._ready}}});Gx.isSupported=function(e){return e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat};var hXe=new h(1,0,0),fXe=new h(0,0,1),pXe=new h(-1,0,0),bXe=new h(0,0,-1),sN=new h(0,1,0),yXe=new h(0,-1,0),$te=[sN,pXe,fXe,yXe,hXe,sN,bXe,sN,sN],ene=$te.length,tne=new Float32Array(ene*3),jte=0;for(let e=0;e<ene;++e,jte+=3)h.pack($te[e],tne,jte);var gXe=new Float32Array([-1,1,-1,0,0,1,0,0,1,0,1,1,0,-1,-1,-1,1,-1]),xXe=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]);function _Xe(e){let t=ft.createVertexBuffer({context:e,typedArray:gXe,usage:Ue.STATIC_DRAW}),n=ft.createVertexBuffer({context:e,typedArray:tne,usage:Ue.STATIC_DRAW}),i=ft.createIndexBuffer({context:e,typedArray:xXe,usage:Ue.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT}),o=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:Q.FLOAT},{index:1,vertexBuffer:n,componentsPerAttribute:3,componentDatatype:Q.FLOAT}];return new oi({context:e,attributes:o,indexBuffer:i})}function qte(e){return function(){return e}}function QO(e){e._va=e._va&&e._va.destroy(),e._sp=e._sp&&e._sp.destroy();let t,n,i=e._cubeMaps;if(l(i))for(n=i.length,t=0;t<n;++t)i[t].destroy();let o=e._mipTextures;if(l(o))for(n=o.length,t=0;t<n;++t)o[t].destroy();e._va=void 0,e._sp=void 0,e._cubeMaps=void 0,e._cubeMapBuffers=void 0,e._mipTextures=void 0}Gx.prototype.update=function(e){let t=e.context;if(!Gx.isSupported(t)||(l(this._texture)&&l(this._va)&&QO(this),l(this._texture)))return;if(!l(this._texture)&&!this._loading){let y=e.context.textureCache.getTexture(this._url);l(y)&&(QO(this),this._texture=y,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0)}let n=this._cubeMapBuffers;if(!l(n)&&!this._loading){let y=this;bl(this._url).then(function(f){y._cubeMapBuffers=f,y._loading=!1}).catch(function(f){y.isDestroyed()||y._errorEvent.raiseEvent(f)}),this._loading=!0}if(!l(this._cubeMapBuffers))return;let i=[],o=n[0].positiveX.pixelDatatype;l(o)?i.push("RGBA_NORMALIZED"):o=t.halfFloatingPointTexture?je.HALF_FLOAT:je.FLOAT;let r=at.RGBA,s=new Oe({defines:i,sources:[kE]});this._va=_Xe(t),this._sp=Qt.fromCache({context:t,vertexShaderSource:DE,fragmentShaderSource:s,attributeLocations:{position:0,cubeMapCoordinates:1}});let a=Math.min(n.length,6);this._maximumMipmapLevel=a-1;let c=this._cubeMaps=new Array(a),d=this._mipTextures=new Array(a),u=n[0].positiveX.width*2,m={originalSize:function(){return u}};for(let y=0;y<a;++y){let f=n[y].positiveY;n[y].positiveY=n[y].negativeY,n[y].negativeY=f;let x=c[y]=new Ja({context:t,source:n[y],pixelDatatype:o}),_=c[y].width*2,C=d[y]=new wt({context:t,width:_,height:_,pixelDatatype:o,pixelFormat:r}),V=new au({vertexArray:this._va,shaderProgram:this._sp,uniformMap:{cubeMap:qte(x)},outputTexture:C,persists:!0,owner:this});e.commandList.push(V),m[`texture${y}`]=qte(C)}this._texture=new wt({context:t,width:u*1.5+2,height:u,pixelDatatype:o,pixelFormat:r}),this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture);let p=new au({fragmentShaderSource:UE,uniformMap:m,outputTexture:this._texture,persists:!1,owner:this});e.commandList.push(p),this._ready=!0};Gx.prototype.isDestroyed=function(){return!1};Gx.prototype.destroy=function(){return QO(this),this._texture=this._texture&&this._texture.destroy(),ue(this)};var Rm=Gx;function BE(e){e=g(e,g.EMPTY_OBJECT);let t=l(e.imageBasedLightingFactor)?B.clone(e.imageBasedLightingFactor):new B(1,1);this._imageBasedLightingFactor=t;let n=g(e.luminanceAtZenith,.2);this._luminanceAtZenith=n;let i=e.sphericalHarmonicCoefficients;this._sphericalHarmonicCoefficients=i,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapAtlas=void 0,this._specularEnvironmentMapAtlasDirty=!0,this._specularEnvironmentMapLoaded=!1,this._previousSpecularEnvironmentMapLoaded=!1,this._useDefaultSpecularMaps=!1,this._useDefaultSphericalHarmonics=!1,this._shouldRegenerateShaders=!1,this._previousFrameNumber=void 0,this._previousImageBasedLightingFactor=B.clone(t),this._previousLuminanceAtZenith=n,this._previousSphericalHarmonicCoefficients=i,this._removeErrorListener=void 0}Object.defineProperties(BE.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){this._previousImageBasedLightingFactor=B.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=B.clone(e,this._imageBasedLightingFactor)}},luminanceAtZenith:{get:function(){return this._luminanceAtZenith},set:function(e){this._previousLuminanceAtZenith=this._luminanceAtZenith,this._luminanceAtZenith=e}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients},set:function(e){this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients,this._sphericalHarmonicCoefficients=e}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps},set:function(e){e!==this._specularEnvironmentMaps&&(this._specularEnvironmentMapAtlasDirty=this._specularEnvironmentMapAtlasDirty||e!==this._specularEnvironmentMaps,this._specularEnvironmentMapLoaded=!1),this._specularEnvironmentMaps=e}},enabled:{get:function(){return this._imageBasedLightingFactor.x>0||this._imageBasedLightingFactor.y>0}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},useDefaultSphericalHarmonics:{get:function(){return this._useDefaultSphericalHarmonics}},useSphericalHarmonicCoefficients:{get:function(){return l(this._sphericalHarmonicCoefficients)||this._useDefaultSphericalHarmonics}},specularEnvironmentMapAtlas:{get:function(){return this._specularEnvironmentMapAtlas}},useDefaultSpecularMaps:{get:function(){return this._useDefaultSpecularMaps}},useSpecularEnvironmentMaps:{get:function(){return l(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.ready||this._useDefaultSpecularMaps}}});function TXe(e,t){if(Rm.isSupported(t)){if(e._specularEnvironmentMapAtlas=e._specularEnvironmentMapAtlas&&e._specularEnvironmentMapAtlas.destroy(),l(e._specularEnvironmentMaps)){let n=new Rm(e._specularEnvironmentMaps);e._specularEnvironmentMapAtlas=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}BE.prototype.update=function(e){if(e.frameNumber===this._previousFrameNumber)return;this._previousFrameNumber=e.frameNumber;let t=e.context;e.brdfLutGenerator.update(e),this._shouldRegenerateShaders=!1;let n=this._imageBasedLightingFactor,i=this._previousImageBasedLightingFactor;B.equals(n,i)||(this._shouldRegenerateShaders=n.x>0&&i.x===0||n.x===0&&i.x>0,this._shouldRegenerateShaders=this._shouldRegenerateShaders||n.y>0&&i.y===0||n.y===0&&i.y>0,this._previousImageBasedLightingFactor=B.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),this._luminanceAtZenith!==this._previousLuminanceAtZenith&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(this._luminanceAtZenith)!==l(this._previousLuminanceAtZenith),this._previousLuminanceAtZenith=this._luminanceAtZenith),this._previousSphericalHarmonicCoefficients!==this._sphericalHarmonicCoefficients&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(this._previousSphericalHarmonicCoefficients)!==l(this._sphericalHarmonicCoefficients),this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients),this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._previousSpecularEnvironmentMapLoaded!==this._specularEnvironmentMapLoaded,this._previousSpecularEnvironmentMapLoaded=this._specularEnvironmentMapLoaded,this._specularEnvironmentMapAtlasDirty&&(TXe(this,t),this._specularEnvironmentMapAtlasDirty=!1),l(this._specularEnvironmentMapAtlas)&&(this._specularEnvironmentMapAtlas.update(e),this._specularEnvironmentMapAtlas.ready&&(this._specularEnvironmentMapLoaded=!0));let o=!l(this._specularEnvironmentMapAtlas)&&l(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,r=!l(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,s=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,a=!l(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||o||r||s||a,this._useDefaultSpecularMaps=!l(this._specularEnvironmentMapAtlas)&&l(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)};BE.prototype.isDestroyed=function(){return!1};BE.prototype.destroy=function(){return this._specularEnvironmentMapAtlas=this._specularEnvironmentMapAtlas&&this._specularEnvironmentMapAtlas.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),ue(this)};var Ex=BE;var p8t=T(S(),1),qO=T($l(),1);var a8t=T(S(),1);var jO,nne="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJiOGQ5NjRhYy1lYzBmLTRjYjktODA5MC01M2FhYmE4YjliZTIiLCJpZCI6MjU5LCJpYXQiOjE3MDY4MDU1MTR9.3b1XUfaoUwtY0Mi87tOQUGTnU4oMyyzSwAYqkDENcHo",aN={};aN.defaultAccessToken=nne;aN.defaultServer=new Xe({url:"https://api.cesium.com/"});aN.getDefaultTokenCredit=function(e){if(e===nne){if(!l(jO)){let t=`<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>`;jO=new Vt(t,!0)}return jO}};var Zm=aN;function Ac(e,t){let n,i=e.externalType,o=l(i);if(!o)n={url:e.url,retryAttempts:1,retryCallback:SXe};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new me("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");Xe.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=o?void 0:new qO.default(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=o}l(Object.create)&&(Ac.prototype=Object.create(Xe.prototype),Ac.prototype.constructor=Ac);Ac.fromAssetId=function(e,t){let n=Ac._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new Ac(i,n)})};Object.defineProperties(Ac.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=Ac.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});Ac.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(Vt.getIonCredit),i=Zm.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(Vt.clone(i)),n};Ac.prototype.clone=function(e){let t=g(this._ionRoot,this);return l(e)||(e=new Ac(t._ionEndpoint,t._ionEndpointResource)),e=Xe.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};Ac.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},l(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return Xe.prototype.fetchImage.call(this,e)};Ac.prototype._makeRequest=function(e){return this._isExternal||new qO.default(this.url).authority()!==this._ionEndpointDomain?Xe.prototype._makeRequest.call(this,e):(l(e.headers)||(e.headers={}),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,e.headers["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e.headers["X-Cesium-Client-Version"]=CESIUM_VERSION),Xe.prototype._makeRequest.call(this,e))};Ac._createEndpointResource=function(e,t){t=g(t,g.EMPTY_OBJECT);let n=g(t.server,Zm.defaultServer),i=g(t.accessToken,Zm.defaultAccessToken);n=Xe.createIfNeeded(n);let o={url:`v1/assets/${e}/endpoint`};return l(i)&&(o.queryParameters={access_token:i}),n.getDerivedResource(o)};function SXe(e,t){let n=g(e._ionRoot,e),i=n._ionEndpointResource,o=typeof Image<"u";return!l(t)||t.statusCode!==401&&!(o&&t.target instanceof Image)?Promise.resolve(!1):(l(n._pendingPromise)||(n._pendingPromise=i.fetchJson().then(function(r){return n._ionEndpoint=r,r}).finally(function(r){return n._pendingPromise=void 0,r})),n._pendingPromise.then(function(r){return e._ionEndpoint=r,!0}))}var sd=Ac;var g8t=T(S(),1);function $h(e){e=g(e,0),this._array=new Array(e),this._length=e}Object.defineProperties($h.prototype,{length:{get:function(){return this._length},set:function(e){let t=this._array,n=this._length;if(e<n)for(let i=e;i<n;++i)t[i]=void 0;else e>t.length&&(t.length=e);this._length=e}},values:{get:function(){return this._array}}});$h.prototype.get=function(e){return this._array[e]};$h.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};$h.prototype.peek=function(){return this._array[this._length-1]};$h.prototype.push=function(e){let t=this.length++;this._array[t]=e};$h.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};$h.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};$h.prototype.resize=function(e){this.length=e};$h.prototype.trim=function(e){e=g(e,this._length),this._array.length=e};var Mc=$h;var S8t=T(S(),1);function cN(e){e=g(e,g.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}cN.ALL=Object.freeze(new cN({color:new O(0,0,0,0),depth:1,stencil:0}));cN.prototype.execute=function(e,t){e.clear(this,t)};var ai=cN;var Z8t=T(S(),1);var Ep={X:0,Y:1,Z:2};Ep.Y_UP_TO_Z_UP=A.fromRotationTranslation(q.fromRotationX(W.PI_OVER_TWO));Ep.Z_UP_TO_Y_UP=A.fromRotationTranslation(q.fromRotationX(-W.PI_OVER_TWO));Ep.X_UP_TO_Z_UP=A.fromRotationTranslation(q.fromRotationY(-W.PI_OVER_TWO));Ep.Z_UP_TO_X_UP=A.fromRotationTranslation(q.fromRotationY(W.PI_OVER_TWO));Ep.X_UP_TO_Y_UP=A.fromRotationTranslation(q.fromRotationZ(W.PI_OVER_TWO));Ep.Y_UP_TO_X_UP=A.fromRotationTranslation(q.fromRotationZ(-W.PI_OVER_TWO));Ep.fromName=function(e){return Ep[e]};var Wo=Object.freeze(Ep);var mFn=T(S(),1);var w8t=T(S(),1);function cu(e){this.planes=g(e,[])}var OE=[new h,new h,new h];h.clone(h.UNIT_X,OE[0]);h.clone(h.UNIT_Y,OE[1]);h.clone(h.UNIT_Z,OE[2]);var Eb=new h,CXe=new h,ine=new ln(new h(1,0,0),0);cu.fromBoundingSphere=function(e,t){l(t)||(t=new cu);let n=OE.length,i=t.planes;i.length=2*n;let o=e.center,r=e.radius,s=0;for(let a=0;a<n;++a){let c=OE[a],d=i[s],u=i[s+1];l(d)||(d=i[s]=new se),l(u)||(u=i[s+1]=new se),h.multiplyByScalar(c,-r,Eb),h.add(o,Eb,Eb),d.x=c.x,d.y=c.y,d.z=c.z,d.w=-h.dot(c,Eb),h.multiplyByScalar(c,r,Eb),h.add(o,Eb,Eb),u.x=-c.x,u.y=-c.y,u.z=-c.z,u.w=-h.dot(h.negate(c,CXe),Eb),s+=2}return t};cu.prototype.computeVisibility=function(e){let t=this.planes,n=!1;for(let i=0,o=t.length;i<o;++i){let r=e.intersectPlane(ln.fromCartesian4(t[i],ine));if(r===nn.OUTSIDE)return nn.OUTSIDE;r===nn.INTERSECTING&&(n=!0)}return n?nn.INTERSECTING:nn.INSIDE};cu.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===cu.MASK_OUTSIDE||t===cu.MASK_INSIDE)return t;let n=cu.MASK_INSIDE,i=this.planes;for(let o=0,r=i.length;o<r;++o){let s=o<31?1<<o:0;if(o<31&&!(t&s))continue;let a=e.intersectPlane(ln.fromCartesian4(i[o],ine));if(a===nn.OUTSIDE)return cu.MASK_OUTSIDE;a===nn.INTERSECTING&&(n|=s)}return n};cu.MASK_OUTSIDE=4294967295;cu.MASK_INSIDE=0;cu.MASK_INDETERMINATE=2147483647;var as=cu;var Q8t=T(S(),1);var O8t=T(S(),1);function ef(e){e=g(e,g.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=g(e.near,1),this._near=this.near,this.far=g(e.far,5e8),this._far=this.far,this._cullingVolume=new as,this._orthographicMatrix=new A}function one(e){(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far)&&(e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=A.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}Object.defineProperties(ef.prototype,{projectionMatrix:{get:function(){return one(this),this._orthographicMatrix}}});var VXe=new h,LXe=new h,RXe=new h,$O=new h;ef.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,c=this.near,d=this.far,u=h.cross(t,n,VXe);h.normalize(u,u);let m=LXe;h.multiplyByScalar(t,c,m),h.add(e,m,m);let p=RXe;h.multiplyByScalar(u,a,p),h.add(m,p,p);let y=i[0];return l(y)||(y=i[0]=new se),y.x=u.x,y.y=u.y,y.z=u.z,y.w=-h.dot(u,p),h.multiplyByScalar(u,s,p),h.add(m,p,p),y=i[1],l(y)||(y=i[1]=new se),y.x=-u.x,y.y=-u.y,y.z=-u.z,y.w=-h.dot(h.negate(u,$O),p),h.multiplyByScalar(n,r,p),h.add(m,p,p),y=i[2],l(y)||(y=i[2]=new se),y.x=n.x,y.y=n.y,y.z=n.z,y.w=-h.dot(n,p),h.multiplyByScalar(n,o,p),h.add(m,p,p),y=i[3],l(y)||(y=i[3]=new se),y.x=-n.x,y.y=-n.y,y.z=-n.z,y.w=-h.dot(h.negate(n,$O),p),y=i[4],l(y)||(y=i[4]=new se),y.x=t.x,y.y=t.y,y.z=t.z,y.w=-h.dot(t,m),h.multiplyByScalar(t,d,p),h.add(e,p,p),y=i[5],l(y)||(y=i[5]=new se),y.x=-t.x,y.y=-t.y,y.z=-t.z,y.w=-h.dot(h.negate(t,$O),p),this._cullingVolume};ef.prototype.getPixelDimensions=function(e,t,n,i,o){one(this);let r=this.right-this.left,s=this.top-this.bottom,a=i*r/e,c=i*s/t;return o.x=a,o.y=c,o};ef.prototype.clone=function(e){return l(e)||(e=new ef),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};ef.prototype.equals=function(e){return l(e)&&e instanceof ef&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};ef.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof ef&&W.equalsEpsilon(this.right,e.right,t,n)&&W.equalsEpsilon(this.left,e.left,t,n)&&W.equalsEpsilon(this.top,e.top,t,n)&&W.equalsEpsilon(this.bottom,e.bottom,t,n)&&W.equalsEpsilon(this.near,e.near,t,n)&&W.equalsEpsilon(this.far,e.far,t,n)};var Vr=ef;function Tl(e){e=g(e,g.EMPTY_OBJECT),this._offCenterFrustum=new Vr,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=g(e.near,1),this._near=this.near,this.far=g(e.far,5e8),this._far=this.far}Tl.packedLength=4;Tl.pack=function(e,t,n){return n=g(n,0),t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};Tl.unpack=function(e,t,n){return t=g(t,0),l(n)||(n=new Tl),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function Ib(e){let 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;let n=1/e.aspectRatio;t.right=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties(Tl.prototype,{projectionMatrix:{get:function(){return Ib(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return Ib(this),this._offCenterFrustum}}});Tl.prototype.computeCullingVolume=function(e,t,n){return Ib(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};Tl.prototype.getPixelDimensions=function(e,t,n,i,o){return Ib(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};Tl.prototype.clone=function(e){return l(e)||(e=new Tl),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};Tl.prototype.equals=function(e){return!l(e)||!(e instanceof Tl)?!1:(Ib(this),Ib(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};Tl.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof Tl)?!1:(Ib(this),Ib(e),W.equalsEpsilon(this.width,e.width,t,n)&&W.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var rn=Tl;var $8t=T(S(),1);function rne(e){e=g(e,g.EMPTY_OBJECT),this._metadata=e.metadata}Object.defineProperties(rne.prototype,{metadata:{get:function(){return this._metadata}}});var Ix=rne;var zXn=T(S(),1);var p7t=T(S(),1);var a7t=T(S(),1);var i7t=T(S(),1);function Xb(e,t,n){return t=g(t,0),n=g(n,e.byteLength-t),e=e.subarray(t,t+n),Xb.decode(e)}Xb.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};Xb.decodeWithFromCharCode=function(e){let t="",n=ZXe(e),i=n.length;for(let o=0;o<i;++o){let r=n[o];r<=65535?t+=String.fromCharCode(r):(r-=65536,t+=String.fromCharCode((r>>10)+55296,(r&1023)+56320))}return t};function YE(e,t,n){return t<=e&&e<=n}function ZXe(e){let t=0,n=0,i=0,o=128,r=191,s=[],a=e.length;for(let c=0;c<a;++c){let d=e[c];if(i===0){if(YE(d,0,127)){s.push(d);continue}if(YE(d,194,223)){i=1,t=d&31;continue}if(YE(d,224,239)){d===224&&(o=160),d===237&&(r=159),i=2,t=d&15;continue}if(YE(d,240,244)){d===240&&(o=144),d===244&&(r=143),i=3,t=d&7;continue}throw new me("String decoding failed.")}if(!YE(d,o,r)){t=i=n=0,o=128,r=191,--c;continue}o=128,r=191,t=t<<6|d&63,++n,n===i&&(s.push(t),t=i=n=0)}return s}typeof TextDecoder<"u"?Xb.decode=Xb.decodeWithTextDecoder:Xb.decode=Xb.decodeWithFromCharCode;var Sl=Xb;function GXe(e,t){return t=g(t,0),Sl(e,t,Math.min(4,e.length))}var Gm=GXe;function lu(e,t,n,i){this._tileset=e,this._tile=t,this._resource=n,l(i)||(i=[]),this._contents=i,this._metadata=void 0,this._group=void 0,this._ready=!1}Object.defineProperties(lu.prototype,{featurePropertiesDirty:{get:function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)if(e[n].featurePropertiesDirty)return!0;return!1},set:function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].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}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e;let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].metadata=e}},batchTable:{get:function(){}},group:{get:function(){return this._group},set:function(e){this._group=e;let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].group=e}}});var HE=Uint32Array.BYTES_PER_ELEMENT;lu.fromTileType=async function(e,t,n,i,o,r){o=g(o,0);let s=new Uint8Array(i),a=new DataView(i);o+=HE;let c=a.getUint32(o,!0);if(c!==1)throw new me(`Only Composite Tile version 1 is supported. Version ${c} is not.`);o+=HE,o+=HE;let d=a.getUint32(o,!0);o+=HE;let u=n.queryParameters.compositeIndex;l(u)?u=`${u}_`:u="";let m=[];m.length=d;for(let f=0;f<d;++f){let x=Gm(s,o),_=a.getUint32(o+HE*2,!0),C=r[x],V=`${u}${f}`,L=n.getDerivedResource({queryParameters:{compositeIndex:V}});if(l(C))m[f]=Promise.resolve(C(e,t,L,i,o));else throw new me(`Unknown tile content type, ${x}, inside Composite tile`);o+=_}let p=await Promise.all(m);return new lu(e,t,n,p)};lu.prototype.hasProperty=function(e,t){return!1};lu.prototype.getFeature=function(e){};lu.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};lu.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};lu.prototype.update=function(e,t){let n=this._contents,i=n.length,o=!0;for(let r=0;r<i;++r)n[r].update(e,t),o=o&&n[r].ready;!this._ready&&o&&(this._ready=!0)};lu.prototype.pick=function(e,t,n){if(!this._ready)return;let i,o=Number.POSITIVE_INFINITY,r=this._contents,s=r.length;for(let a=0;a<s;++a){let c=r[a].pick(e,t,n);if(!l(c))continue;let d=h.distance(e.origin,c);d<o&&(i=c,o=d)}if(l(i))return n};lu.prototype.isDestroyed=function(){return!1};lu.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var KE=lu;var Kqt=T(S(),1);var g7t=T(S(),1);function EXe(e,t,n){return JSON.parse(Sl(e,t,n))}var Po=EXe;var V6t=T(S(),1);var X7t=T(S(),1);function ec(e){this._id=Hn();let t=e.featuresLength;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=[];let n,i;if(t>0){let o=Math.min(t,Yt.maximumTextureSize),r=Math.ceil(t/Yt.maximumTextureSize),s=1/o,a=s*.5,c=1/r,d=c*.5;n=new B(o,r),i=new se(s,a,c,d)}this._translucentFeaturesLength=0,this._featuresLength=t,this._textureDimensions=n,this._textureStep=i,this._owner=e.owner,this._statistics=e.statistics,this._colorChangedCallback=e.colorChangedCallback}Object.defineProperties(ec.prototype,{translucentFeaturesLength:{get:function(){return this._translucentFeaturesLength}},byteLength:{get:function(){let e=0;return l(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),l(this._batchTexture)&&(e+=this._batchTexture.sizeInBytes),e}},textureDimensions:{get:function(){return this._textureDimensions}},textureStep:{get:function(){return this._textureStep}},batchTexture:{get:function(){return this._batchTexture}},defaultTexture:{get:function(){return this._defaultTexture}},pickTexture:{get:function(){return this._pickTexture}}});ec.DEFAULT_COLOR_VALUE=O.WHITE;ec.DEFAULT_SHOW_VALUE=!0;function sne(e){let t=e._textureDimensions;return t.x*t.y*4}function ane(e){if(!l(e._batchValues)){let t=sne(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function cne(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}ec.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=cne(this),i=e*2,o=t?255:0;if(n[i]!==o){n[i]=o;let r=ane(this),s=e*4+3;r[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};ec.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setShow(n,e)};ec.prototype.getShow=function(e){if(!l(this._showAlphaProperties))return!0;let t=e*2;return this._showAlphaProperties[t]===255};var IXe=new Array(4);ec.prototype.setColor=function(e,t){if(O.equals(t,ec.DEFAULT_COLOR_VALUE)&&!l(this._batchValues))return;let n=t.toBytes(IXe),i=n[3],o=ane(this),r=e*4,s=cne(this),a=e*2;if(o[r]!==n[0]||o[r+1]!==n[1]||o[r+2]!==n[2]||s[a+1]!==i){o[r]=n[0],o[r+1]=n[1],o[r+2]=n[2];let c=s[a+1]!==255,d=s[a]!==0;o[r+3]=d?i:0,s[a+1]=i;let u=i!==255;u&&!c?++this._translucentFeaturesLength:!u&&c&&--this._translucentFeaturesLength,this._batchValuesDirty=!0,l(this._colorChangedCallback)&&this._colorChangedCallback(e,t)}};ec.prototype.setAllColor=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setColor(n,e)};ec.prototype.getColor=function(e,t){if(!l(this._batchValues))return O.clone(ec.DEFAULT_COLOR_VALUE,t);let n=this._batchValues,i=e*4,o=this._showAlphaProperties,r=e*2;return O.fromBytes(n[i],n[i+1],n[i+2],o[r+1],t)};ec.prototype.getPickColor=function(e){return this._pickIds[e]};function lne(e,t,n){let i=e._textureDimensions;return new wt({context:t,pixelFormat:at.RGBA,pixelDatatype:je.UNSIGNED_BYTE,source:{width:i.x,height:i.y,arrayBufferView:n},flipY:!1,sampler:hn.NEAREST})}function XXe(e,t){let n=e._featuresLength;if(!l(e._pickTexture)&&n>0){let i=e._pickIds,o=sne(e),r=new Uint8Array(o),s=e._owner,a=e._statistics;for(let c=0;c<n;++c){let d=t.createPickId(s.getFeature(c));i.push(d);let u=d.color,m=c*4;r[m]=O.floatToByte(u.red),r[m+1]=O.floatToByte(u.green),r[m+2]=O.floatToByte(u.blue),r[m+3]=O.floatToByte(u.alpha)}e._pickTexture=lne(e,t,r),l(a)&&(a.batchTableByteLength+=e._pickTexture.sizeInBytes)}}function WXe(e){let t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}ec.prototype.update=function(e,t){let n=t.context;this._defaultTexture=n.defaultTexture;let i=t.passes;(i.pick||i.postProcess)&&XXe(this,n),this._batchValuesDirty&&(this._batchValuesDirty=!1,l(this._batchTexture)||(this._batchTexture=lne(this,n,this._batchValues),l(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),WXe(this))};ec.prototype.isDestroyed=function(){return!1};ec.prototype.destroy=function(){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),this._pickTexture=this._pickTexture&&this._pickTexture.destroy();let e=this._pickIds,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var Nc=ec;var Q7t=T(S(),1);var U7t=T(S(),1);var PXe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},vXe={SCALAR:void 0,VEC2:B,VEC3:h,VEC4:se,MAT2:io,MAT3:q,MAT4:A};function wXe(e){let t=e.componentType,n;typeof t=="string"?n=Q.fromName(t):n=t;let i=PXe[e.type],o=vXe[e.type];return{componentsPerAttribute:i,classType:o,createArrayBufferView:function(r,s,a){return Q.createArrayBufferView(n,r,s,i*a)}}}var ad=wXe;function Ip(e){this._classes=void 0,this._classIds=void 0,this._classIndexes=void 0,this._parentCounts=void 0,this._parentIndexes=void 0,this._parentIds=void 0,this._byteLength=0,FXe(this,e.extension,e.binaryBody)}Object.defineProperties(Ip.prototype,{byteLength:{get:function(){return this._byteLength}}});function FXe(e,t,n){let i,o,r,s=t.instancesLength,a=t.classes,c=t.classIds,d=t.parentCounts,u=t.parentIds,m=s,p=0;l(c.byteOffset)&&(c.componentType=g(c.componentType,Q.UNSIGNED_SHORT),c.type=tn.SCALAR,r=ad(c),c=r.createArrayBufferView(n.buffer,n.byteOffset+c.byteOffset,s),p+=c.byteLength);let y;if(l(d)){for(l(d.byteOffset)&&(d.componentType=g(d.componentType,Q.UNSIGNED_SHORT),d.type=tn.SCALAR,r=ad(d),d=r.createArrayBufferView(n.buffer,n.byteOffset+d.byteOffset,s),p+=d.byteLength),y=new Uint16Array(s),m=0,i=0;i<s;++i)y[i]=m,m+=d[i];p+=y.byteLength}l(u)&&l(u.byteOffset)&&(u.componentType=g(u.componentType,Q.UNSIGNED_SHORT),u.type=tn.SCALAR,r=ad(u),u=r.createArrayBufferView(n.buffer,n.byteOffset+u.byteOffset,m),p+=u.byteLength);let f=a.length;for(i=0;i<f;++i){let C=a[i].length,V=a[i].instances,L=AXe(C,V,n);p+=MXe(L),a[i].instances=Tt(L,V)}let x=new Array(f).fill(0),_=new Uint16Array(s);for(i=0;i<s;++i)o=c[i],_[i]=x[o],++x[o];p+=_.byteLength,e._classes=a,e._classIds=c,e._classIndexes=_,e._parentCounts=d,e._parentIndexes=y,e._parentIds=u,e._byteLength=p}function AXe(e,t,n){let i;for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=r.byteOffset;if(l(s)){let a=r.componentType,c=r.type;if(!l(a))throw new me("componentType is required.");if(!l(c))throw new me("type is required.");if(!l(n))throw new me(`Property ${o} requires a batch table binary.`);let d=ad(r),u=d.componentsPerAttribute,m=d.classType,p=d.createArrayBufferView(n.buffer,n.byteOffset+s,e);l(i)||(i={}),i[o]={typedArray:p,componentCount:u,type:m}}}return i}function MXe(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}var NXe=[],UXe=[],kXe=0;function DXe(e,t,n){let i=e._classIds,o=e._parentCounts,r=e._parentIds,s=e._parentIndexes,a=i.length,c=NXe;c.length=Math.max(c.length,a);let d=++kXe,u=UXe;for(u.length=0,u.push(t);u.length>0;){if(t=u.pop(),c[t]===d)continue;c[t]=d;let m=n(e,t);if(l(m))return m;let p=o[t],y=s[t];for(let f=0;f<p;++f){let x=r[y+f];x!==t&&u.push(x)}}}function BXe(e,t,n){let i=!0;for(;i;){let o=n(e,t);if(l(o))return o;let r=e._parentIds[t];i=r!==t,t=r}}function zE(e,t,n){let i=e._parentCounts,o=e._parentIds;if(l(o)){if(l(i))return DXe(e,t,n)}else return n(e,t);return BXe(e,t,n)}Ip.prototype.hasProperty=function(e,t){let n=zE(this,e,function(i,o){let r=i._classIds[o],s=i._classes[r].instances;if(l(s[t]))return!0});return l(n)};Ip.prototype.propertyExists=function(e){let t=this._classes,n=t.length;for(let i=0;i<n;++i){let o=t[i].instances;if(l(o[e]))return!0}return!1};Ip.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,zE(this,e,function(n,i){let o=n._classIds[i],r=n._classes[o].instances;for(let s in r)r.hasOwnProperty(s)&&t.indexOf(s)===-1&&t.push(s)}),t};Ip.prototype.getProperty=function(e,t){return zE(this,e,function(n,i){let o=n._classIds[i],r=n._classes[o],s=n._classIndexes[i],a=r.instances[t];if(l(a))return l(a.typedArray)?OXe(a,s):ze(a[s],!0)})};function OXe(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}Ip.prototype.setProperty=function(e,t,n){let i=zE(this,e,function(o,r){let s=o._classIds[r],a=o._classes[s],c=o._classIndexes[r],d=a.instances[t];if(l(d))return l(d.typedArray)?YXe(d,c,n):d[c]=ze(n,!0),!0});return l(i)};function YXe(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}Ip.prototype.isClass=function(e,t){let n=zE(this,e,function(i,o){let r=i._classIds[o];if(i._classes[r].name===t)return!0});return l(n)};Ip.prototype.getClassName=function(e){let t=this._classIds[e];return this._classes[t].name};var Xx=Ip;var q7t=T(S(),1),HXe={HIGHLIGHT:0,REPLACE:1,MIX:2},Cl=Object.freeze(HXe);var eY=Nc.DEFAULT_COLOR_VALUE,tY=Nc.DEFAULT_SHOW_VALUE;function bo(e,t,n,i,o){this.featuresLength=t;let r;l(n)&&(r=n.extensions),this._extensions=g(r,{});let s=KXe(n);this._properties=s,this._batchTableHierarchy=zXe(this,n,i);let a=une(t,s,i);this._binaryPropertiesByteLength=JXe(a),this._batchTableBinaryProperties=a,this._content=e,this._batchTexture=new Nc({featuresLength:t,colorChangedCallback:o,owner:e,statistics:e.tileset.statistics})}bo._deprecationWarning=_r;Object.defineProperties(bo.prototype,{batchTableByteLength:{get:function(){let e=this._binaryPropertiesByteLength;return l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e+=this._batchTexture.byteLength,e}}});function KXe(e){let t={};if(!l(e))return t;for(let n in e)e.hasOwnProperty(n)&&n!=="HIERARCHY"&&n!=="extensions"&&n!=="extras"&&(t[n]=ze(e[n],!0));return t}function zXe(e,t,n){if(!l(t))return;let i=e._extensions["3DTILES_batch_table_hierarchy"],o=t.HIERARCHY;if(l(o)&&(bo._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"]=o,i=o),!!l(i))return new Xx({extension:i,binaryBody:n})}function une(e,t,n){let i;for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=r.byteOffset;if(l(s)){let a=r.componentType,c=r.type;if(!l(a))throw new me("componentType is required.");if(!l(c))throw new me("type is required.");if(!l(n))throw new me(`Property ${o} requires a batch table binary.`);let d=ad(r),u=d.componentsPerAttribute,m=d.classType,p=d.createArrayBufferView(n.buffer,n.byteOffset+s,e);l(i)||(i={}),i[o]={typedArray:p,componentCount:u,type:m}}}return i}function JXe(e){if(!l(e))return 0;let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}bo.getBinaryProperties=function(e,t,n){return une(e,t,n)};bo.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};bo.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};bo.prototype.getShow=function(e){return this._batchTexture.getShow(e)};bo.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};bo.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};bo.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};bo.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};var QXe=new O;bo.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(eY),this.setAllShow(tY);return}let t=this._content,n=this.featuresLength;for(let i=0;i<n;++i){let o=t.getFeature(i),r=l(e.color)?g(e.color.evaluateColor(o,QXe),eY):eY,s=l(e.show)?g(e.show.evaluate(o),tY):tY;this.setColor(i,r),this.setShow(i,s)}};function jXe(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}function qXe(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}bo.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};bo.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};bo.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};bo.prototype.hasProperty=function(e,t){return l(this._properties[t])||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)};bo.prototype.hasPropertyBySemantic=function(){return!1};bo.prototype.getPropertyIds=function(e,t){t=l(t)?t:[],t.length=0;let n=Object.keys(this._properties);return t.push.apply(t,n),l(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,n)),t};bo.prototype.getPropertyBySemantic=function(e,t){};bo.prototype.getProperty=function(e,t){if(l(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if(l(i))return jXe(i,e)}let n=this._properties[t];if(l(n))return ze(n[e],!0);if(l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getProperty(e,t);if(l(i))return i}};bo.prototype.setProperty=function(e,t,n){let i=this.featuresLength;if(l(this._batchTableBinaryProperties)){let r=this._batchTableBinaryProperties[t];if(l(r)){qXe(r,e,n);return}}if(l(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n))return;let o=this._properties[t];l(o)||(this._properties[t]=new Array(i),o=this._properties[t]),o[e]=ze(n,!0)};function $Xe(e){return e._batchTexture.textureDimensions.y===1?`uniform vec4 tile_textureStep;
vec2 computeSt(float batchId)
{
float stepX = tile_textureStep.x;
float centerX = tile_textureStep.y;
return vec2(centerX + (batchId * stepX), 0.5);
}
`:`uniform vec4 tile_textureStep;
uniform vec2 tile_textureDimensions;
vec2 computeSt(float batchId)
{
float stepX = tile_textureStep.x;
float centerX = tile_textureStep.y;
float stepY = tile_textureStep.z;
float centerY = tile_textureStep.w;
float xId = mod(batchId, tile_textureDimensions.x);
float yId = floor(batchId / tile_textureDimensions.x);
return vec2(centerX + (xId * stepX), centerY + (yId * stepY));
}
`}bo.prototype.getVertexShaderCallback=function(e,t,n){if(this.featuresLength===0)return;let i=this;return function(o){let r=mne(o,n,!1),s;return Yt.maximumVertexTextureImageUnits>0?(s="",e&&(s+=`uniform bool tile_translucentCommand;
`),s+=`uniform sampler2D tile_batchTexture;
out vec4 tile_featureColor;
out vec2 tile_featureSt;
void main()
{
vec2 st = computeSt(${t});
vec4 featureProperties = texture(tile_batchTexture, st);
tile_color(featureProperties);
float show = ceil(featureProperties.a);
gl_Position *= show;
`,e&&(s+=` bool isStyleTranslucent = (featureProperties.a != 1.0);
if (czm_pass == czm_passTranslucent)
{
if (!isStyleTranslucent && !tile_translucentCommand)
{
gl_Position *= 0.0;
}
}
else
{
if (isStyleTranslucent)
{
gl_Position *= 0.0;
}
}
`),s+=` tile_featureColor = featureProperties;
tile_featureSt = st;
}`):s=`out vec2 tile_featureSt;
void main()
{
tile_color(vec4(1.0));
tile_featureSt = computeSt(${t});
}`,`${r}
${$Xe(i)}${s}`}};function dne(e,t){return e=Oe.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend;
void tile_color(vec4 tile_featureColor)
{
tile_main();
tile_featureColor = czm_gammaCorrect(tile_featureColor);
out_FragColor.a *= tile_featureColor.a;
float highlight = ceil(tile_colorBlend);
out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight);
}
`:`${e}void tile_color(vec4 tile_featureColor)
{
tile_main();
}
`}function eWe(e,t){let n=`texture(${t}`,i=0,o=e.indexOf(n,i),r;for(;o>-1;){let s=0;for(let d=o;d<e.length;++d){let u=e.charAt(d);if(u==="(")++s;else if(u===")"&&(--s,s===0)){r=d+1;break}}let c=`tile_diffuse_final(${e.slice(o,r)}, tile_diffuse)`;e=e.slice(0,o)+c+e.slice(r),i=o+c.length,o=e.indexOf(n,i)}return e}function mne(e,t,n){if(!l(t))return dne(e,n);let i=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`),o=e.match(i);if(!l(o))return dne(e,n);let r=o[0],s=o[2];e=Oe.replaceMain(e,"tile_main"),e=e.replace(r,"");let a=`bool isWhite(vec3 color)
{
return all(greaterThan(color, vec3(1.0 - czm_epsilon3)));
}
vec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse)
{
vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend);
vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse;
return vec4(diffuse.rgb, sourceDiffuse.a);
}
`,c=` tile_featureColor = czm_gammaCorrect(tile_featureColor);
out_FragColor.a *= tile_featureColor.a;
float highlight = ceil(tile_colorBlend);
out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight);
`,d;if(s==="vec3"||s==="vec4"){let u=s==="vec3"?`vec4(${t}, 1.0)`:t,m=s==="vec3"?"tile_diffuse.xyz":"tile_diffuse";i=new RegExp(t,"g"),e=e.replace(i,m),d=` vec4 source = ${u};
tile_diffuse = tile_diffuse_final(source, tile_featureColor);
tile_main();
`}else s==="sampler2D"&&(e=eWe(e,t),d=` tile_diffuse = tile_featureColor;
tile_main();
`);return e=`uniform float tile_colorBlend;
vec4 tile_diffuse = vec4(1.0);
${a}${r}
${e}
void tile_color(vec4 tile_featureColor)
{
${d}`,n&&(e+=c),e+=`}
`,e}bo.prototype.getFragmentShaderCallback=function(e,t,n){if(this.featuresLength!==0)return function(i){return i=mne(i,t,!0),Yt.maximumVertexTextureImageUnits>0?(i+=`uniform sampler2D tile_pickTexture;
in vec2 tile_featureSt;
in vec4 tile_featureColor;
void main()
{
tile_color(tile_featureColor);
`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a;
`),i+="}"):(e&&(i+=`uniform bool tile_translucentCommand;
`),i+=`uniform sampler2D tile_pickTexture;
uniform sampler2D tile_batchTexture;
in vec2 tile_featureSt;
void main()
{
vec4 featureProperties = texture(tile_batchTexture, tile_featureSt);
if (featureProperties.a == 0.0) {
discard;
}
`,e&&(i+=` bool isStyleTranslucent = (featureProperties.a != 1.0);
if (czm_pass == czm_passTranslucent)
{
if (!isStyleTranslucent && !tile_translucentCommand)
{
discard;
}
}
else
{
if (isStyleTranslucent)
{
discard;
}
}
`),i+=` tile_color(featureProperties);
`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a;
`),i+=`}
`),i}};bo.prototype.getClassificationFragmentShaderCallback=function(){if(this.featuresLength!==0)return function(e){return e=Oe.replaceMain(e,"tile_main"),Yt.maximumVertexTextureImageUnits>0?e+=`uniform sampler2D tile_pickTexture;
in vec2 tile_featureSt;
in vec4 tile_featureColor;
void main()
{
tile_main();
out_FragColor = tile_featureColor;
out_FragColor.rgb *= out_FragColor.a;
}`:e+=`uniform sampler2D tile_batchTexture;
uniform sampler2D tile_pickTexture;
in vec2 tile_featureSt;
void main()
{
tile_main();
vec4 featureProperties = texture(tile_batchTexture, tile_featureSt);
if (featureProperties.a == 0.0) {
discard;
}
out_FragColor = featureProperties;
out_FragColor.rgb *= out_FragColor.a;
}
`,e}};function tWe(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===Cl.HIGHLIGHT)return 0;if(n===Cl.REPLACE)return 1;if(n===Cl.MIX)return W.clamp(i,W.EPSILON4,1)}bo.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return Tt(t,{tile_batchTexture:function(){return g(e._batchTexture.batchTexture,e._batchTexture.defaultTexture)},tile_textureDimensions:function(){return e._batchTexture.textureDimensions},tile_textureStep:function(){return e._batchTexture.textureStep},tile_colorBlend:function(){return tWe(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};bo.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var Wb={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};bo.prototype.addDerivedCommands=function(e,t){let n=e.commandList,i=n.length,o=this._content._tile,r=o._finalResolution,s=o.tileset,a=s.isSkippingLevelOfDetail&&s.hasMixedContent&&e.context.stencilBuffer,c=nWe(this);for(let d=t;d<i;++d){let u=n[d];if(u.pass===Ve.COMPUTE)continue;let m=u.derivedCommands.tileset;(!l(m)||u.dirty)&&(m={},u.derivedCommands.tileset=m,m.originalCommand=iWe(u),u.dirty=!1);let p=m.originalCommand;c!==Wb.ALL_OPAQUE&&u.pass!==Ve.TRANSLUCENT&&(l(m.translucent)||(m.translucent=oWe(p))),c!==Wb.ALL_TRANSLUCENT&&u.pass!==Ve.TRANSLUCENT&&(l(m.opaque)||(m.opaque=rWe(p)),a&&(r||(l(m.zback)||(m.zback=aWe(e.context,p)),s._backfaceCommands.push(m.zback)),(!l(m.stencil)||o._selectionDepth!==lWe(m.stencil))&&(u.renderState.depthMask?m.stencil=cWe(p,o._selectionDepth):m.stencil=m.opaque)));let y=a?m.stencil:m.opaque,f=m.translucent;u.pass!==Ve.TRANSLUCENT?(c===Wb.ALL_OPAQUE&&(n[d]=y),c===Wb.ALL_TRANSLUCENT&&(n[d]=f),c===Wb.OPAQUE_AND_TRANSLUCENT&&(n[d]=y,n.push(f))):n[d]=p}};function nWe(e){let t=e._batchTexture.translucentFeaturesLength;return t===0?Wb.ALL_OPAQUE:t===e.featuresLength?Wb.ALL_TRANSLUCENT:Wb.OPAQUE_AND_TRANSLUCENT}function iWe(e){let t=nt.shallowClone(e),n=t.pass===Ve.TRANSLUCENT;return t.uniformMap=l(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return n},t}function oWe(e){let t=nt.shallowClone(e);return t.pass=Ve.TRANSLUCENT,t.renderState=dWe(e.renderState),t}function rWe(e){let t=nt.shallowClone(e);return t.renderState=uWe(e.renderState),t}function sWe(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"zBackfaceLogDepth");if(!l(n)){let i=t.fragmentShaderSource.clone();i.defines=l(i.defines)?i.defines.slice(0):[],i.defines.push("POLYGON_OFFSET"),n=e.shaderCache.createDerivedShaderProgram(t,"zBackfaceLogDepth",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}return n}function aWe(e,t){let n=nt.shallowClone(t),i=ze(n.renderState,!0);i.cull.enabled=!0,i.cull.face=yi.FRONT,i.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i.polygonOffset={enabled:!0,factor:5,units:5},i.stencilTest=Nt.setCesium3DTileBit(),i.stencilMask=Nt.CESIUM_3D_TILE_MASK,n.renderState=ke.fromCache(i),n.castShadows=!1,n.receiveShadows=!1,n.uniformMap=ze(t.uniformMap);let o=new B(5,5);return n.uniformMap.u_polygonOffset=function(){return o},n.shaderProgram=sWe(e,t.shaderProgram),n}function cWe(e,t){let n=nt.shallowClone(e),i=ze(n.renderState,!0);return i.stencilTest.enabled=!0,i.stencilTest.mask=Nt.SKIP_LOD_MASK,i.stencilTest.reference=Nt.CESIUM_3D_TILE_MASK|t<<Nt.SKIP_LOD_BIT_SHIFT,i.stencilTest.frontFunction=On.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=pt.REPLACE,i.stencilTest.backFunction=On.GREATER_OR_EQUAL,i.stencilTest.backOperation.zPass=pt.REPLACE,i.stencilMask=Nt.CESIUM_3D_TILE_MASK|Nt.SKIP_LOD_MASK,n.renderState=ke.fromCache(i),n}function lWe(e){return(e.renderState.stencilTest.reference&Nt.SKIP_LOD_MASK)>>>Nt.SKIP_LOD_BIT_SHIFT}function dWe(e){let t=ze(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=mn.ALPHA_BLEND,t.stencilTest=Nt.setCesium3DTileBit(),t.stencilMask=Nt.CESIUM_3D_TILE_MASK,ke.fromCache(t)}function uWe(e){let t=ze(e,!0);return t.stencilTest=Nt.setCesium3DTileBit(),t.stencilMask=Nt.CESIUM_3D_TILE_MASK,ke.fromCache(t)}bo.prototype.update=function(e,t){this._batchTexture.update(e,t)};bo.prototype.isDestroyed=function(){return!1};bo.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),ue(this)};var Xp=bo;var Fqt=T(S(),1);var R6t=T(S(),1);function mWe(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var tf=mWe;var Cqt=T(S(),1);var G6t=T(S(),1),qS=`in vec3 position;
in float a_batchId;
uniform mat4 u_modifiedModelViewProjection;
void main()
{
gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0));
}
`;var W6t=T(S(),1);function du(e,t){this._content=e,this._batchId=t,this._color=void 0}Object.defineProperties(du.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 l(this._color)||(this._color=new O),this._content.batchTable.getColor(this._batchId,this._color)},set:function(e){this._content.batchTable.setColor(this._batchId,e)}},polylinePositions:{get:function(){if(l(this._content.getPolylinePositions))return this._content.getPolylinePositions(this._batchId)}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},featureId:{get:function(){return this._batchId}},pickId:{get:function(){return this._content.batchTable.getPickColor(this._batchId)}}});du.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};du.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};du.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};du.getPropertyInherited=function(e,t,n){let i=e.batchTable;if(l(i)){if(i.hasPropertyBySemantic(t,n))return i.getPropertyBySemantic(t,n);if(i.hasProperty(t,n))return i.getProperty(t,n)}let o=e.metadata;if(l(o)){if(o.hasPropertyBySemantic(n))return o.getPropertyBySemantic(n);if(o.hasProperty(n))return o.getProperty(n)}let r=e.tile,s=r.metadata;if(l(s)){if(s.hasPropertyBySemantic(n))return s.getPropertyBySemantic(n);if(s.hasProperty(n))return s.getProperty(n)}let a;if(l(r.implicitSubtree)&&(a=r.implicitSubtree.metadata),l(a)){if(a.hasPropertyBySemantic(n))return a.getPropertyBySemantic(n);if(a.hasProperty(n))return a.getProperty(n)}let c=l(e.group)?e.group.metadata:void 0;if(l(c)){if(c.hasPropertyBySemantic(n))return c.getPropertyBySemantic(n);if(c.hasProperty(n))return c.getProperty(n)}let d=e.tileset.metadata;if(l(d)){if(d.hasPropertyBySemantic(n))return d.getPropertyBySemantic(n);if(d.hasProperty(n))return d.getProperty(n)}};du.prototype.getPropertyInherited=function(e){return du.getPropertyInherited(this._content,this._batchId,e)};du.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};du.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};du.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};du.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var vs=du;var K6t=T(S(),1);var v6t=T(S(),1),nY=class{add(t,n,i){if(typeof arguments[0]!="string")for(let o in arguments[0])this.add(o,arguments[0][o],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(o){this[o]=this[o]||[],n&&this[o][i?"unshift":"push"](n)},this)}run(t,n){this[t]=this[t]||[],this[t].forEach(function(i){i.call(n&&n.context?n.context:n,n)})}},iY=class{constructor(t){this.jsep=t,this.registered={}}register(...t){t.forEach(n=>{if(typeof n!="object"||!n.name||!n.init)throw new Error("Invalid JSEP plugin format");this.registered[n.name]||(n.init(this.jsep),this.registered[n.name]=n)})}},Vl=class e{static get version(){return"1.3.8"}static toString(){return"JavaScript Expression Parser (JSEP) v"+e.version}static addUnaryOp(t){return e.max_unop_len=Math.max(t.length,e.max_unop_len),e.unary_ops[t]=1,e}static addBinaryOp(t,n,i){return e.max_binop_len=Math.max(t.length,e.max_binop_len),e.binary_ops[t]=n,i?e.right_associative.add(t):e.right_associative.delete(t),e}static addIdentifierChar(t){return e.additional_identifier_chars.add(t),e}static addLiteral(t,n){return e.literals[t]=n,e}static removeUnaryOp(t){return delete e.unary_ops[t],t.length===e.max_unop_len&&(e.max_unop_len=e.getMaxKeyLen(e.unary_ops)),e}static removeAllUnaryOps(){return e.unary_ops={},e.max_unop_len=0,e}static removeIdentifierChar(t){return e.additional_identifier_chars.delete(t),e}static removeBinaryOp(t){return delete e.binary_ops[t],t.length===e.max_binop_len&&(e.max_binop_len=e.getMaxKeyLen(e.binary_ops)),e.right_associative.delete(t),e}static removeAllBinaryOps(){return e.binary_ops={},e.max_binop_len=0,e}static removeLiteral(t){return delete e.literals[t],e}static removeAllLiterals(){return e.literals={},e}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new e(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(n=>n.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return e.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!e.binary_ops[String.fromCharCode(t)]||e.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return e.isIdentifierStart(t)||e.isDecimalDigit(t)}throwError(t){let n=new Error(t+" at character "+this.index);throw n.index=this.index,n.description=t,n}runHook(t,n){if(e.hooks[t]){let i={context:this,node:n};return e.hooks.run(t,i),i.node}return n}searchHook(t){if(e.hooks[t]){let n={context:this};return e.hooks[t].find(function(i){return i.call(n.context,n),n.node}),n.node}}gobbleSpaces(){let t=this.code;for(;t===e.SPACE_CODE||t===e.TAB_CODE||t===e.LF_CODE||t===e.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let t=this.gobbleExpressions(),n=t.length===1?t[0]:{type:e.COMPOUND,body:t};return this.runHook("after-all",n)}gobbleExpressions(t){let n=[],i,o;for(;this.index<this.expr.length;)if(i=this.code,i===e.SEMCOL_CODE||i===e.COMMA_CODE)this.index++;else if(o=this.gobbleExpression())n.push(o);else if(this.index<this.expr.length){if(i===t)break;this.throwError('Unexpected "'+this.char+'"')}return n}gobbleExpression(){let t=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",t)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,e.max_binop_len),n=t.length;for(;n>0;){if(e.binary_ops.hasOwnProperty(t)&&(!e.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=n,t;t=t.substr(0,--n)}return!1}gobbleBinaryExpression(){let t,n,i,o,r,s,a,c,d;if(s=this.gobbleToken(),!s||(n=this.gobbleBinaryOp(),!n))return s;for(r={value:n,prec:e.binaryPrecedence(n),right_a:e.right_associative.has(n)},a=this.gobbleToken(),a||this.throwError("Expected expression after "+n),o=[s,r,a];n=this.gobbleBinaryOp();){if(i=e.binaryPrecedence(n),i===0){this.index-=n.length;break}r={value:n,prec:i,right_a:e.right_associative.has(n)},d=n;let u=m=>r.right_a&&m.right_a?i>m.prec:i<=m.prec;for(;o.length>2&&u(o[o.length-2]);)a=o.pop(),n=o.pop().value,s=o.pop(),t={type:e.BINARY_EXP,operator:n,left:s,right:a},o.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+d),o.push(r,t)}for(c=o.length-1,t=o[c];c>1;)t={type:e.BINARY_EXP,operator:o[c-1].value,left:o[c-2],right:t},c-=2;return t}gobbleToken(){let t,n,i,o;if(this.gobbleSpaces(),o=this.searchHook("gobble-token"),o)return this.runHook("after-token",o);if(t=this.code,e.isDecimalDigit(t)||t===e.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===e.SQUOTE_CODE||t===e.DQUOTE_CODE)o=this.gobbleStringLiteral();else if(t===e.OBRACK_CODE)o=this.gobbleArray();else{for(n=this.expr.substr(this.index,e.max_unop_len),i=n.length;i>0;){if(e.unary_ops.hasOwnProperty(n)&&(!e.isIdentifierStart(this.code)||this.index+n.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+n.length)))){this.index+=i;let r=this.gobbleToken();return r||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:e.UNARY_EXP,operator:n,argument:r,prefix:!0})}n=n.substr(0,--i)}e.isIdentifierStart(t)?(o=this.gobbleIdentifier(),e.literals.hasOwnProperty(o.name)?o={type:e.LITERAL,value:e.literals[o.name],raw:o.name}:o.name===e.this_str&&(o={type:e.THIS_EXP})):t===e.OPAREN_CODE&&(o=this.gobbleGroup())}return o?(o=this.gobbleTokenProperty(o),this.runHook("after-token",o)):this.runHook("after-token",!1)}gobbleTokenProperty(t){this.gobbleSpaces();let n=this.code;for(;n===e.PERIOD_CODE||n===e.OBRACK_CODE||n===e.OPAREN_CODE||n===e.QUMARK_CODE;){let i;if(n===e.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==e.PERIOD_CODE)break;i=!0,this.index+=2,this.gobbleSpaces(),n=this.code}this.index++,n===e.OBRACK_CODE?(t={type:e.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},this.gobbleSpaces(),n=this.code,n!==e.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):n===e.OPAREN_CODE?t={type:e.CALL_EXP,arguments:this.gobbleArguments(e.CPAREN_CODE),callee:t}:(n===e.PERIOD_CODE||i)&&(i&&this.index--,this.gobbleSpaces(),t={type:e.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),i&&(t.optional=!0),this.gobbleSpaces(),n=this.code}return t}gobbleNumericLiteral(){let t="",n,i;for(;e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(this.code===e.PERIOD_CODE)for(t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(n=this.char,n==="e"||n==="E"){for(t+=this.expr.charAt(this.index++),n=this.char,(n==="+"||n==="-")&&(t+=this.expr.charAt(this.index++));e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+t+this.char+")")}return i=this.code,e.isIdentifierStart(i)?this.throwError("Variable names cannot start with a number ("+t+this.char+")"):(i===e.PERIOD_CODE||t.length===1&&t.charCodeAt(0)===e.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:e.LITERAL,value:parseFloat(t),raw:t}}gobbleStringLiteral(){let t="",n=this.index,i=this.expr.charAt(this.index++),o=!1;for(;this.index<this.expr.length;){let r=this.expr.charAt(this.index++);if(r===i){o=!0;break}else if(r==="\\")switch(r=this.expr.charAt(this.index++),r){case"n":t+=`
`;break;case"r":t+="\r";break;case"t":t+=" ";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:t+=r}else t+=r}return o||this.throwError('Unclosed quote after "'+t+'"'),{type:e.LITERAL,value:t,raw:this.expr.substring(n,this.index)}}gobbleIdentifier(){let t=this.code,n=this.index;for(e.isIdentifierStart(t)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(t=this.code,e.isIdentifierPart(t));)this.index++;return{type:e.IDENTIFIER,name:this.expr.slice(n,this.index)}}gobbleArguments(t){let n=[],i=!1,o=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let r=this.code;if(r===t){i=!0,this.index++,t===e.CPAREN_CODE&&o&&o>=n.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(r===e.COMMA_CODE){if(this.index++,o++,o!==n.length){if(t===e.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===e.CBRACK_CODE)for(let s=n.length;s<o;s++)n.push(null)}}else if(n.length!==o&&o!==0)this.throwError("Expected comma");else{let s=this.gobbleExpression();(!s||s.type===e.COMPOUND)&&this.throwError("Expected comma"),n.push(s)}}return i||this.throwError("Expected "+String.fromCharCode(t)),n}gobbleGroup(){this.index++;let t=this.gobbleExpressions(e.CPAREN_CODE);if(this.code===e.CPAREN_CODE)return this.index++,t.length===1?t[0]:t.length?{type:e.SEQUENCE_EXP,expressions:t}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:e.ARRAY_EXP,elements:this.gobbleArguments(e.CBRACK_CODE)}}},hWe=new nY;Object.assign(Vl,{hooks:hWe,plugins:new iY(Vl),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},right_associative:new Set,additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});Vl.max_unop_len=Vl.getMaxKeyLen(Vl.unary_ops);Vl.max_binop_len=Vl.getMaxKeyLen(Vl.binary_ops);var Pb=e=>new Vl(e).parse(),fWe=Object.getOwnPropertyNames(Vl);fWe.forEach(e=>{Pb[e]===void 0&&e!=="prototype"&&(Pb[e]=Vl[e])});Pb.Jsep=Vl;var pWe="ConditionalExpression",bWe={name:"ternary",init(e){e.hooks.add("after-expression",function(n){if(n.node&&this.code===e.QUMARK_CODE){this.index++;let i=n.node,o=this.gobbleExpression();if(o||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let r=this.gobbleExpression();if(r||this.throwError("Expected expression"),n.node={type:pWe,test:i,consequent:o,alternate:r},i.operator&&e.binary_ops[i.operator]<=.9){let s=i;for(;s.right.operator&&e.binary_ops[s.right.operator]<=.9;)s=s.right;n.node.test=s.right,s.right=n.node,n.node=i}}else this.throwError("Expected :")}})}};Pb.plugins.register(bWe);var F6t=T(S(),1),yWe={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},yt=Object.freeze(yWe);function Em(e,t){this._expression=e,e=IWe(e,t),e=WWe(XWe(e)),Pb.addBinaryOp("=~",0),Pb.addBinaryOp("!~",0);let n;try{n=Pb(e)}catch(i){throw new me(i)}this._runtimeAst=Si(this,n)}Object.defineProperties(Em.prototype,{expression:{get:function(){return this._expression}}});var wn={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new B],cartesian3Array:[new h],cartesian4Array:[new se],reset:function(){this.arrayIndex=0,this.cartesian2Index=0,this.cartesian3Index=0,this.cartesian4Index=0},getArray:function(){this.arrayIndex>=this.arrayArray.length&&this.arrayArray.push([]);let e=this.arrayArray[this.arrayIndex++];return e.length=0,e},getCartesian2:function(){return this.cartesian2Index>=this.cartesian2Array.length&&this.cartesian2Array.push(new B),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new h),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new se),this.cartesian4Array[this.cartesian4Index++]}};Em.prototype.evaluate=function(e,t){wn.reset();let n=this._runtimeAst.evaluate(e);return t instanceof O&&n instanceof se?O.fromCartesian4(n,t):n instanceof B||n instanceof h||n instanceof se?n.clone(t):n};Em.prototype.evaluateColor=function(e,t){wn.reset();let n=this._runtimeAst.evaluate(e);return O.fromCartesian4(n,t)};Em.prototype.getShaderFunction=function(e,t,n,i){let o=this.getShaderExpression(t,n);return o=`${i} ${e}
{
return ${o};
}
`,o};Em.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};Em.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var gWe=["!","-","+"],hne=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],uN=/\${(.*?)}/g,xWe=/\\/g,_We="@#%",TWe=/@#%/g,mN=new O,hN={abs:ws(Math.abs),sqrt:ws(Math.sqrt),cos:ws(Math.cos),sin:ws(Math.sin),tan:ws(Math.tan),acos:ws(Math.acos),asin:ws(Math.asin),atan:ws(Math.atan),radians:ws(W.toRadians),degrees:ws(W.toDegrees),sign:ws(W.sign),floor:ws(Math.floor),ceil:ws(Math.ceil),round:ws(Math.round),exp:ws(Math.exp),exp2:ws(CWe),log:ws(Math.log),log2:ws(VWe),fract:ws(SWe),length:LWe,normalize:RWe},fN={atan2:lN(Math.atan2,!1),pow:lN(Math.pow,!1),min:lN(Math.min,!0),max:lN(Math.max,!0),distance:ZWe,dot:GWe,cross:EWe},sY={clamp:fne(W.clamp,!0),mix:fne(W.lerp,!0)};function SWe(e){return e-Math.floor(e)}function CWe(e){return Math.pow(2,e)}function VWe(e){return W.log2(e)}function ws(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof B)return B.fromElements(e(n.x),e(n.y),wn.getCartesian2());if(n instanceof h)return h.fromElements(e(n.x),e(n.y),e(n.z),wn.getCartesian3());if(n instanceof se)return se.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),wn.getCartesian4());throw new me(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function lN(e,t){return function(n,i,o){if(t&&typeof o=="number"){if(typeof i=="number")return e(i,o);if(i instanceof B)return B.fromElements(e(i.x,o),e(i.y,o),wn.getCartesian2());if(i instanceof h)return h.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),wn.getCartesian3());if(i instanceof se)return se.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),e(i.w,o),wn.getCartesian4())}if(typeof i=="number"&&typeof o=="number")return e(i,o);if(i instanceof B&&o instanceof B)return B.fromElements(e(i.x,o.x),e(i.y,o.y),wn.getCartesian2());if(i instanceof h&&o instanceof h)return h.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),wn.getCartesian3());if(i instanceof se&&o instanceof se)return se.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),e(i.w,o.w),wn.getCartesian4());throw new me(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${o}.`)}}function fne(e,t){return function(n,i,o,r){if(t&&typeof r=="number"){if(typeof i=="number"&&typeof o=="number")return e(i,o,r);if(i instanceof B&&o instanceof B)return B.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),wn.getCartesian2());if(i instanceof h&&o instanceof h)return h.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),wn.getCartesian3());if(i instanceof se&&o instanceof se)return se.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),e(i.w,o.w,r),wn.getCartesian4())}if(typeof i=="number"&&typeof o=="number"&&typeof r=="number")return e(i,o,r);if(i instanceof B&&o instanceof B&&r instanceof B)return B.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),wn.getCartesian2());if(i instanceof h&&o instanceof h&&r instanceof h)return h.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),wn.getCartesian3());if(i instanceof se&&o instanceof se&&r instanceof se)return se.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),e(i.w,o.w,r.w),wn.getCartesian4());throw new me(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${o}, and ${r}.`)}}function LWe(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof B)return B.magnitude(t);if(t instanceof h)return h.magnitude(t);if(t instanceof se)return se.magnitude(t);throw new me(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function RWe(e,t){if(typeof t=="number")return 1;if(t instanceof B)return B.normalize(t,wn.getCartesian2());if(t instanceof h)return h.normalize(t,wn.getCartesian3());if(t instanceof se)return se.normalize(t,wn.getCartesian4());throw new me(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function ZWe(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof B&&n instanceof B)return B.distance(t,n);if(t instanceof h&&n instanceof h)return h.distance(t,n);if(t instanceof se&&n instanceof se)return se.distance(t,n);throw new me(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function GWe(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof B&&n instanceof B)return B.dot(t,n);if(t instanceof h&&n instanceof h)return h.dot(t,n);if(t instanceof se&&n instanceof se)return se.dot(t,n);throw new me(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function EWe(e,t,n){if(t instanceof h&&n instanceof h)return h.cross(t,n,wn.getCartesian3());throw new me(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function xt(e,t,n,i,o){this._type=e,this._value=t,this._left=n,this._right=i,this._test=o,this.evaluate=void 0,DWe(this)}function IWe(e,t){if(!l(t))return e;for(let n in t)if(t.hasOwnProperty(n)){let i=new RegExp(`\\$\\{${n}\\}`,"g"),o=`(${t[n]})`;l(o)&&(e=e.replace(i,o))}return e}function XWe(e){return e.replace(xWe,_We)}function rY(e){return e.replace(TWe,"\\")}function WWe(e){let t=e,n="",i=t.indexOf("${");for(;i>=0;){let o=t.indexOf("'"),r=t.indexOf('"'),s;if(o>=0&&o<i)s=t.indexOf("'",o+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else if(r>=0&&r<i)s=t.indexOf('"',r+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else{n+=t.substr(0,i);let a=t.indexOf("}");if(a<0)throw new me("Unmatched {.");n+=`czm_${t.substr(i+2,a-(i+2))}`,t=t.substr(a+1),i=t.indexOf("${")}}return n+=t,n}function PWe(e){let t=typeof e.value;if(e.value===null)return new xt(yt.LITERAL_NULL,null);if(t==="boolean")return new xt(yt.LITERAL_BOOLEAN,e.value);if(t==="number")return new xt(yt.LITERAL_NUMBER,e.value);if(t==="string")return e.value.indexOf("${")>=0?new xt(yt.VARIABLE_IN_STRING,e.value):new xt(yt.LITERAL_STRING,rY(e.value))}function vWe(e,t){let n=t.arguments,i=n.length,o,r,s,a;if(t.callee.type==="MemberExpression"){o=t.callee.property.name;let c=t.callee.object;if(o==="test"||o==="exec"){if(!l(c.callee)||c.callee.name!=="regExp")throw new me(`${o} is not a function.`);return i===0?o==="test"?new xt(yt.LITERAL_BOOLEAN,!1):new xt(yt.LITERAL_NULL,null):(s=Si(e,c),a=Si(e,n[0]),new xt(yt.FUNCTION_CALL,o,s,a))}else if(o==="toString")return r=Si(e,c),new xt(yt.FUNCTION_CALL,o,r);throw new me(`Unexpected function call "${o}".`)}if(o=t.callee.name,o==="color"){if(i===0)return new xt(yt.LITERAL_COLOR,o);if(r=Si(e,n[0]),l(n[1])){let c=Si(e,n[1]);return new xt(yt.LITERAL_COLOR,o,[r,c])}return new xt(yt.LITERAL_COLOR,o,[r])}else if(o==="rgb"||o==="hsl"){if(i<3)throw new me(`${o} requires three arguments.`);return r=[Si(e,n[0]),Si(e,n[1]),Si(e,n[2])],new xt(yt.LITERAL_COLOR,o,r)}else if(o==="rgba"||o==="hsla"){if(i<4)throw new me(`${o} requires four arguments.`);return r=[Si(e,n[0]),Si(e,n[1]),Si(e,n[2]),Si(e,n[3])],new xt(yt.LITERAL_COLOR,o,r)}else if(o==="vec2"||o==="vec3"||o==="vec4"){r=new Array(i);for(let c=0;c<i;++c)r[c]=Si(e,n[c]);return new xt(yt.LITERAL_VECTOR,o,r)}else{if(o==="isNaN"||o==="isFinite")return i===0?o==="isNaN"?new xt(yt.LITERAL_BOOLEAN,!0):new xt(yt.LITERAL_BOOLEAN,!1):(r=Si(e,n[0]),new xt(yt.UNARY,o,r));if(o==="isExactClass"||o==="isClass"){if(i<1||i>1)throw new me(`${o} requires exactly one argument.`);return r=Si(e,n[0]),new xt(yt.UNARY,o,r)}else if(o==="getExactClassName"){if(i>0)throw new me(`${o} does not take any argument.`);return new xt(yt.UNARY,o)}else if(l(hN[o])){if(i!==1)throw new me(`${o} requires exactly one argument.`);return r=Si(e,n[0]),new xt(yt.UNARY,o,r)}else if(l(fN[o])){if(i!==2)throw new me(`${o} requires exactly two arguments.`);return s=Si(e,n[0]),a=Si(e,n[1]),new xt(yt.BINARY,o,s,a)}else if(l(sY[o])){if(i!==3)throw new me(`${o} requires exactly three arguments.`);s=Si(e,n[0]),a=Si(e,n[1]);let c=Si(e,n[2]);return new xt(yt.TERNARY,o,s,a,c)}else{if(o==="Boolean")return i===0?new xt(yt.LITERAL_BOOLEAN,!1):(r=Si(e,n[0]),new xt(yt.UNARY,o,r));if(o==="Number")return i===0?new xt(yt.LITERAL_NUMBER,0):(r=Si(e,n[0]),new xt(yt.UNARY,o,r));if(o==="String")return i===0?new xt(yt.LITERAL_STRING,""):(r=Si(e,n[0]),new xt(yt.UNARY,o,r));if(o==="regExp")return wWe(e,t)}}throw new me(`Unexpected function call "${o}".`)}function wWe(e,t){let n=t.arguments;if(n.length===0)return new xt(yt.LITERAL_REGEX,new RegExp);let i=Si(e,n[0]),o;if(n.length>1){let r=Si(e,n[1]);if(oY(i)&&oY(r)){try{o=new RegExp(rY(String(i._value)),r._value)}catch(s){throw new me(s)}return new xt(yt.LITERAL_REGEX,o)}return new xt(yt.REGEX,i,r)}if(oY(i)){try{o=new RegExp(rY(String(i._value)))}catch(r){throw new me(r)}return new xt(yt.LITERAL_REGEX,o)}return new xt(yt.REGEX,i)}function FWe(e){if(UWe(e.name)){let t=kWe(e.name);return t.substr(0,8)==="tiles3d_"?new xt(yt.BUILTIN_VARIABLE,t):new xt(yt.VARIABLE,t)}else{if(e.name==="NaN")return new xt(yt.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new xt(yt.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new xt(yt.LITERAL_UNDEFINED,void 0)}throw new me(`${e.name} is not defined.`)}function AWe(e){let t=e.property.name;if(t==="PI")return new xt(yt.LITERAL_NUMBER,Math.PI);if(t==="E")return new xt(yt.LITERAL_NUMBER,Math.E)}function MWe(e){if(e.property.name==="POSITIVE_INFINITY")return new xt(yt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function NWe(e,t){if(t.object.name==="Math")return AWe(t);if(t.object.name==="Number")return MWe(t);let n,i=Si(e,t.object);return t.computed?(n=Si(e,t.property),new xt(yt.MEMBER,"brackets",i,n)):(n=new xt(yt.LITERAL_STRING,t.property.name),new xt(yt.MEMBER,"dot",i,n))}function oY(e){return e._type>=yt.LITERAL_NULL}function UWe(e){return e.substr(0,4)==="czm_"}function kWe(e){return e.substr(4)}function Si(e,t){let n,i,o,r;if(t.type==="Literal")n=PWe(t);else if(t.type==="CallExpression")n=vWe(e,t);else if(t.type==="Identifier")n=FWe(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=Si(e,t.argument);if(gWe.indexOf(i)>-1)n=new xt(yt.UNARY,i,s);else throw new me(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,o=Si(e,t.left),r=Si(e,t.right),hne.indexOf(i)>-1)n=new xt(yt.BINARY,i,o,r);else throw new me(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,o=Si(e,t.left),r=Si(e,t.right),hne.indexOf(i)>-1&&(n=new xt(yt.BINARY,i,o,r));else if(t.type==="ConditionalExpression"){let s=Si(e,t.test);o=Si(e,t.consequent),r=Si(e,t.alternate),n=new xt(yt.CONDITIONAL,"?",o,r,s)}else if(t.type==="MemberExpression")n=NWe(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a<t.elements.length;a++)s[a]=Si(e,t.elements[a]);n=new xt(yt.ARRAY,s)}else throw t.type==="Compound"?new me("Provide exactly one expression."):new me("Cannot parse expression.");return n}function DWe(e){e._type===yt.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===yt.FUNCTION_CALL?e._value==="test"?e.evaluate=e._evaluateRegExpTest:e._value==="exec"?e.evaluate=e._evaluateRegExpExec:e._value==="toString"&&(e.evaluate=e._evaluateToString):e._type===yt.UNARY?e._value==="!"?e.evaluate=e._evaluateNot:e._value==="-"?e.evaluate=e._evaluateNegative:e._value==="+"?e.evaluate=e._evaluatePositive:e._value==="isNaN"?e.evaluate=e._evaluateNaN:e._value==="isFinite"?e.evaluate=e._evaluateIsFinite:e._value==="isExactClass"?e.evaluate=e._evaluateIsExactClass:e._value==="isClass"?e.evaluate=e._evaluateIsClass:e._value==="getExactClassName"?e.evaluate=e._evaluateGetExactClassName:e._value==="Boolean"?e.evaluate=e._evaluateBooleanConversion:e._value==="Number"?e.evaluate=e._evaluateNumberConversion:e._value==="String"?e.evaluate=e._evaluateStringConversion:l(hN[e._value])&&(e.evaluate=OWe(e._value)):e._type===yt.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:l(fN[e._value])&&(e.evaluate=YWe(e._value)):e._type===yt.TERNARY?e.evaluate=HWe(e._value):e._type===yt.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===yt.ARRAY?e.evaluate=e._evaluateArray:e._type===yt.VARIABLE?e.evaluate=e._evaluateVariable:e._type===yt.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===yt.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===yt.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===yt.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===yt.REGEX?e.evaluate=e._evaluateRegExp:e._type===yt.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=BWe):e.evaluate=e._evaluateLiteral}function BWe(e){return l(e)?e.content.tileset.timeSinceLoad:0}function OWe(e){let t=hN[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function YWe(e){let t=fN[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n);return t(e,i,o)}}function HWe(e){let t=sY[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n),r=this._test.evaluate(n);return t(e,i,o,r)}}function pN(e,t){if(l(e))return e.getPropertyInherited(t)}xt.prototype._evaluateLiteral=function(){return this._value};xt.prototype._evaluateLiteralColor=function(e){let t=mN,n=this._left;if(this._value==="color")l(n)?n.length>1?(O.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):O.fromCssColorString(n[0].evaluate(e),t):O.fromBytes(255,255,255,255,t);else if(this._value==="rgb")O.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),255,t);else if(this._value==="rgba"){let i=n[3].evaluate(e)*255;O.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?O.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&O.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return se.fromColor(t,wn.getCartesian4())};xt.prototype._evaluateLiteralVector=function(e){let t=wn.getArray(),n=this._value,i=this._left,o=i.length;for(let a=0;a<o;++a){let c=i[a].evaluate(e);if(typeof c=="number")t.push(c);else if(c instanceof B)t.push(c.x,c.y);else if(c instanceof h)t.push(c.x,c.y,c.z);else if(c instanceof se)t.push(c.x,c.y,c.z,c.w);else throw new me(`${n} argument must be a vector or number. Argument is ${c}.`)}let r=t.length,s=parseInt(n.charAt(3));if(r===0)throw new me(`Invalid ${n} constructor. No valid arguments.`);if(r<s&&r>1)throw new me(`Invalid ${n} constructor. Not enough arguments.`);if(r>s&&o>1)throw new me(`Invalid ${n} constructor. Too many arguments.`);if(r===1){let a=t[0];t.push(a,a,a)}if(n==="vec2")return B.fromArray(t,0,wn.getCartesian2());if(n==="vec3")return h.fromArray(t,0,wn.getCartesian3());if(n==="vec4")return se.fromArray(t,0,wn.getCartesian4())};xt.prototype._evaluateLiteralString=function(){return this._value};xt.prototype._evaluateVariableString=function(e){let t=this._value,n=uN.exec(t);for(;n!==null;){let i=n[0],o=n[1],r=pN(e,o);l(r)||(r=""),t=t.replace(i,r),n=uN.exec(t)}return t};xt.prototype._evaluateVariable=function(e){return pN(e,this._value)};function Wx(e){return e._value==="feature"}xt.prototype._evaluateMemberDot=function(e){if(Wx(this._left))return pN(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof B||t instanceof h||t instanceof se){if(n==="r")return t.x;if(n==="g")return t.y;if(n==="b")return t.z;if(n==="a")return t.w}return t[n]};xt.prototype._evaluateMemberBrackets=function(e){if(Wx(this._left))return pN(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof B||t instanceof h||t instanceof se){if(n===0||n==="r")return t.x;if(n===1||n==="g")return t.y;if(n===2||n==="b")return t.z;if(n===3||n==="a")return t.w}return t[n]};xt.prototype._evaluateArray=function(e){let t=[];for(let n=0;n<this._value.length;n++)t[n]=this._value[n].evaluate(e);return t};xt.prototype._evaluateNot=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new me(`Operator "!" requires a boolean argument. Argument is ${t}.`);return!t};xt.prototype._evaluateNegative=function(e){let t=this._left.evaluate(e);if(t instanceof B)return B.negate(t,wn.getCartesian2());if(t instanceof h)return h.negate(t,wn.getCartesian3());if(t instanceof se)return se.negate(t,wn.getCartesian4());if(typeof t=="number")return-t;throw new me(`Operator "-" requires a vector or number argument. Argument is ${t}.`)};xt.prototype._evaluatePositive=function(e){let t=this._left.evaluate(e);if(!(t instanceof B||t instanceof h||t instanceof se||typeof t=="number"))throw new me(`Operator "+" requires a vector or number argument. Argument is ${t}.`);return t};xt.prototype._evaluateLessThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new me(`Operator "<" requires number arguments. Arguments are ${t} and ${n}.`);return t<n};xt.prototype._evaluateLessThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new me(`Operator "<=" requires number arguments. Arguments are ${t} and ${n}.`);return t<=n};xt.prototype._evaluateGreaterThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new me(`Operator ">" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};xt.prototype._evaluateGreaterThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new me(`Operator ">=" requires number arguments. Arguments are ${t} and ${n}.`);return t>=n};xt.prototype._evaluateOr=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new me(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new me(`Operator "||" requires boolean arguments. Second argument is ${n}.`);return t||n};xt.prototype._evaluateAnd=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new me(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new me(`Operator "&&" requires boolean arguments. Second argument is ${n}.`);return t&&n};xt.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof B&&t instanceof B)return B.add(t,n,wn.getCartesian2());if(n instanceof h&&t instanceof h)return h.add(t,n,wn.getCartesian3());if(n instanceof se&&t instanceof se)return se.add(t,n,wn.getCartesian4());if(typeof t=="string"||typeof n=="string")return t+n;if(typeof t=="number"&&typeof n=="number")return t+n;throw new me(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof B&&t instanceof B)return B.subtract(t,n,wn.getCartesian2());if(n instanceof h&&t instanceof h)return h.subtract(t,n,wn.getCartesian3());if(n instanceof se&&t instanceof se)return se.subtract(t,n,wn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new me(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof B&&t instanceof B)return B.multiplyComponents(t,n,wn.getCartesian2());if(n instanceof B&&typeof t=="number")return B.multiplyByScalar(n,t,wn.getCartesian2());if(t instanceof B&&typeof n=="number")return B.multiplyByScalar(t,n,wn.getCartesian2());if(n instanceof h&&t instanceof h)return h.multiplyComponents(t,n,wn.getCartesian3());if(n instanceof h&&typeof t=="number")return h.multiplyByScalar(n,t,wn.getCartesian3());if(t instanceof h&&typeof n=="number")return h.multiplyByScalar(t,n,wn.getCartesian3());if(n instanceof se&&t instanceof se)return se.multiplyComponents(t,n,wn.getCartesian4());if(n instanceof se&&typeof t=="number")return se.multiplyByScalar(n,t,wn.getCartesian4());if(t instanceof se&&typeof n=="number")return se.multiplyByScalar(t,n,wn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new me(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof B&&t instanceof B)return B.divideComponents(t,n,wn.getCartesian2());if(t instanceof B&&typeof n=="number")return B.divideByScalar(t,n,wn.getCartesian2());if(n instanceof h&&t instanceof h)return h.divideComponents(t,n,wn.getCartesian3());if(t instanceof h&&typeof n=="number")return h.divideByScalar(t,n,wn.getCartesian3());if(n instanceof se&&t instanceof se)return se.divideComponents(t,n,wn.getCartesian4());if(t instanceof se&&typeof n=="number")return se.divideByScalar(t,n,wn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new me(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof B&&t instanceof B)return B.fromElements(t.x%n.x,t.y%n.y,wn.getCartesian2());if(n instanceof h&&t instanceof h)return h.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,wn.getCartesian3());if(n instanceof se&&t instanceof se)return se.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,t.w%n.w,wn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t%n;throw new me(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof B&&t instanceof B||n instanceof h&&t instanceof h||n instanceof se&&t instanceof se?t.equals(n):t===n};xt.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof B&&t instanceof B||n instanceof h&&t instanceof h||n instanceof se&&t instanceof se?!t.equals(n):t!==n};xt.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new me(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)};xt.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};xt.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};xt.prototype._evaluateIsExactClass=function(e){return l(e)?e.isExactClass(this._left.evaluate(e)):!1};xt.prototype._evaluateIsClass=function(e){return l(e)?e.isClass(this._left.evaluate(e)):!1};xt.prototype._evaluateGetExactClassName=function(e){if(l(e))return e.getExactClassName()};xt.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};xt.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};xt.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};xt.prototype._evaluateRegExp=function(e){let t=this._value.evaluate(e),n="";l(this._left)&&(n=this._left.evaluate(e));let i;try{i=new RegExp(t,n)}catch(o){throw new me(o)}return i};xt.prototype._evaluateRegExpTest=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new me(`RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);return t.test(n)};xt.prototype._evaluateRegExpMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return t.test(n);if(n instanceof RegExp&&typeof t=="string")return n.test(t);throw new me(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateRegExpNotMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return!t.test(n);if(n instanceof RegExp&&typeof t=="string")return!n.test(t);throw new me(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};xt.prototype._evaluateRegExpExec=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new me(`RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);let i=t.exec(n);return l(i)?i[1]:null};xt.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof B||t instanceof h||t instanceof se)return String(t);throw new me(`Unexpected function call "${this._value}".`)};function pne(e){let t=e._left,n=t.length;for(let a=0;a<n;++a)if(t[a]._type!==yt.LITERAL_NUMBER)return;let i=t[0]._value,o=t[1]._value,r=t[2]._value,s=n===4?t[3]._value:1;return O.fromHsl(i,o,r,s,mN)}function bne(e){let t=e._left,n=t.length;for(let o=0;o<n;++o)if(t[o]._type!==yt.LITERAL_NUMBER)return;let i=mN;return i.red=t[0]._value/255,i.green=t[1]._value/255,i.blue=t[2]._value/255,i.alpha=n===4?t[3]._value:1,i}function vb(e){return e%1===0?e.toFixed(1):e.toString()}function KWe(e){let t=vb(e.red),n=vb(e.green),i=vb(e.blue);return`vec3(${t}, ${n}, ${i})`}function dN(e){let t=vb(e.red),n=vb(e.green),i=vb(e.blue),o=vb(e.alpha);return`vec4(${t}, ${n}, ${i}, ${o})`}function yne(e,t,n,i){let o=e.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=e[s].getShaderExpression(t,n,i);return r}function gne(e,t){return l(t[e])?t[e]:Em.NULL_SENTINEL}Em.NULL_SENTINEL="czm_infinity";xt.prototype.getShaderExpression=function(e,t,n){let i,o,r,s,a=this._type,c=this._value;l(this._left)&&(Array.isArray(this._left)?o=yne(this._left,e,t,this):o=this._left.getShaderExpression(e,t,this)),l(this._right)&&(r=this._right.getShaderExpression(e,t,this)),l(this._test)&&(s=this._test.getShaderExpression(e,t,this)),Array.isArray(this._value)&&(c=yne(this._value,e,t,this));let d,u,m;switch(a){case yt.VARIABLE:return Wx(this)?void 0:gne(c,e);case yt.UNARY:if(c==="Boolean")return`bool(${o})`;if(c==="Number")return`float(${o})`;if(c==="round")return`floor(${o} + 0.5)`;if(l(hN[c]))return`${c}(${o})`;if(c==="isNaN")return`(${o} != ${o})`;if(c==="isFinite")return`(abs(${o}) < czm_infinity)`;if(c==="String"||c==="isExactClass"||c==="isClass"||c==="getExactClassName")throw new me(`Error generating style shader: "${c}" is not supported.`);return c+o;case yt.BINARY:return c==="%"?`mod(${o}, ${r})`:c==="==="?`(${o} == ${r})`:c==="!=="?`(${o} != ${r})`:c==="atan2"?`atan(${o}, ${r})`:l(fN[c])?`${c}(${o}, ${r})`:`(${o} ${c} ${r})`;case yt.TERNARY:if(l(sY[c]))return`${c}(${o}, ${r}, ${s})`;break;case yt.CONDITIONAL:return`(${s} ? ${o} : ${r})`;case yt.MEMBER:return Wx(this._left)?gne(r,e):r==="r"||r==="x"||r==="0.0"?`${o}[0]`:r==="g"||r==="y"||r==="1.0"?`${o}[1]`:r==="b"||r==="z"||r==="2.0"?`${o}[2]`:r==="a"||r==="w"||r==="3.0"?`${o}[3]`:`${o}[int(${r})]`;case yt.FUNCTION_CALL:throw new me(`Error generating style shader: "${c}" is not supported.`);case yt.ARRAY:if(c.length===4)return`vec4(${c[0]}, ${c[1]}, ${c[2]}, ${c[3]})`;if(c.length===3)return`vec3(${c[0]}, ${c[1]}, ${c[2]})`;if(c.length===2)return`vec2(${c[0]}, ${c[1]})`;throw new me("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case yt.REGEX:throw new me("Error generating style shader: Regular expressions are not supported.");case yt.VARIABLE_IN_STRING:throw new me("Error generating style shader: Converting a variable to a string is not supported.");case yt.LITERAL_NULL:return Em.NULL_SENTINEL;case yt.LITERAL_BOOLEAN:return c?"true":"false";case yt.LITERAL_NUMBER:return vb(c);case yt.LITERAL_STRING:if(l(n)&&n._type===yt.MEMBER&&(c==="r"||c==="g"||c==="b"||c==="a"||c==="x"||c==="y"||c==="z"||c==="w"||Wx(n._left)))return c;if(i=O.fromCssColorString(c,mN),l(i))return KWe(i);throw new me("Error generating style shader: String literals are not supported.");case yt.LITERAL_COLOR:if(d=o,c==="color"){if(l(d)){if(d.length>1){let p=d[0],y=d[1];return y!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${y})`}}else return"vec4(1.0)";return`vec4(${d[0]}, 1.0)`}else{if(c==="rgb")return i=bne(this),l(i)?dN(i):`vec4(${d[0]} / 255.0, ${d[1]} / 255.0, ${d[2]} / 255.0, 1.0)`;if(c==="rgba")return d[3]!=="1.0"&&(t.translucent=!0),i=bne(this),l(i)?dN(i):`vec4(${d[0]} / 255.0, ${d[1]} / 255.0, ${d[2]} / 255.0, ${d[3]})`;if(c==="hsl")return i=pne(this),l(i)?dN(i):`vec4(czm_HSLToRGB(vec3(${d[0]}, ${d[1]}, ${d[2]})), 1.0)`;if(c==="hsla")return i=pne(this),l(i)?(i.alpha!==1&&(t.translucent=!0),dN(i)):(d[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${d[0]}, ${d[1]}, ${d[2]})), ${d[3]})`)}break;case yt.LITERAL_VECTOR:u=o.length,m=`${c}(`;for(let p=0;p<u;++p)m+=o[p],p<u-1&&(m+=", ");return m+=")",m;case yt.LITERAL_REGEX:throw new me("Error generating style shader: Regular expressions are not supported.");case yt.LITERAL_UNDEFINED:return Em.NULL_SENTINEL;case yt.BUILTIN_VARIABLE:if(c==="tiles3d_tileset_time")return c}};xt.prototype.getVariables=function(e,t){let n,i,o,r=this._type,s=this._value;if(l(this._left))if(Array.isArray(this._left))for(n=this._left,i=n.length,o=0;o<i;++o)n[o].getVariables(e,this);else this._left.getVariables(e,this);if(l(this._right)&&this._right.getVariables(e,this),l(this._test)&&this._test.getVariables(e,this),Array.isArray(this._value))for(n=this._value,i=n.length,o=0;o<i;++o)n[o].getVariables(e,this);let a;switch(r){case yt.VARIABLE:Wx(this)||e.push(s);break;case yt.VARIABLE_IN_STRING:for(a=uN.exec(s);a!==null;)e.push(a[1]),a=uN.exec(s);break;case yt.LITERAL_STRING:l(t)&&t._type===yt.MEMBER&&Wx(t._left)&&e.push(s);break}};var uu=Em;function Wp(e){e=g(e,g.EMPTY_OBJECT),this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._vertexBatchIds=e.vertexBatchIds,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=e.indexOffsets,this._batchedIndices=e.batchedIndices,this._boundingVolume=e.boundingVolume,this._boundingVolumes=e.boundingVolumes,this._center=g(e.center,h.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._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=O.clone(O.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=g(e.classificationType,Bn.BOTH),this._vertexShaderSource=e._vertexShaderSource,this._fragmentShaderSource=e._fragmentShaderSource,this._attributeLocations=e._attributeLocations,this._uniformMap=e._uniformMap,this._pickId=e._pickId,this._modelMatrix=e._modelMatrix,this._boundingSphere=e._boundingSphere,this._batchIdLookUp={};let t=this._batchIds.length;for(let n=0;n<t;++n){let i=this._batchIds[n];this._batchIdLookUp[i]=n}}Object.defineProperties(Wp.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var zWe={position:0,a_batchId:1};function JWe(e,t){if(l(e._va))return;let n=ft.createVertexBuffer({context:t,typedArray:e._positions,usage:Ue.STATIC_DRAW}),i=ft.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:Ue.STATIC_DRAW}),o=ft.createIndexBuffer({context:t,typedArray:e._indices,usage:Ue.DYNAMIC_DRAW,indexDatatype:e._indices.BYTES_PER_ELEMENT===2?Ne.UNSIGNED_SHORT:Ne.UNSIGNED_INT}),r=[{index:0,vertexBuffer:n,componentDatatype:Q.fromTypedArray(e._positions),componentsPerAttribute:3},{index:1,vertexBuffer:i,componentDatatype:Q.fromTypedArray(e._vertexBatchIds),componentsPerAttribute:1}];e._va=new oi({context:t,attributes:r,indexBuffer:o}),t.webgl2&&(e._vaSwap=new oi({context:t,attributes:r,indexBuffer:ft.createIndexBuffer({context:t,sizeInBytes:o.sizeInBytes,usage:Ue.DYNAMIC_DRAW,indexDatatype:o.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0}function QWe(e,t){if(l(e._sp))return;let n=e._batchTable,i=g(e._attributeLocations,zWe),o=e._pickId,r=e._vertexShaderSource,s=e._fragmentShaderSource;if(l(r)){e._sp=Qt.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i}),e._spStencil=e._sp,s=Oe.replaceMain(s,"czm_non_pick_main"),s=`${s}void main()
{
czm_non_pick_main();
out_FragColor = ${o};
}
`,e._spPick=Qt.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i});return}let a=n.getVertexShaderCallback(!1,"a_batchId",void 0)(qS),c=n.getFragmentShaderCallback(!1,void 0,!0)(Cb);o=n.getPickId();let d=new Oe({sources:[a]}),u=new Oe({defines:["VECTOR_TILE"],sources:[c]});e._sp=Qt.fromCache({context:t,vertexShaderSource:d,fragmentShaderSource:u,attributeLocations:i}),d=new Oe({sources:[qS]}),u=new Oe({defines:["VECTOR_TILE"],sources:[Cb]}),e._spStencil=Qt.fromCache({context:t,vertexShaderSource:d,fragmentShaderSource:u,attributeLocations:i}),c=Oe.replaceMain(c,"czm_non_pick_main"),c=`${c}
void main()
{
czm_non_pick_main();
out_FragColor = ${o};
}
`;let m=new Oe({sources:[a]}),p=new Oe({defines:["VECTOR_TILE"],sources:[c]});e._spPick=Qt.fromCache({context:t,vertexShaderSource:m,fragmentShaderSource:p,attributeLocations:i})}function xne(e){let t=e?On.EQUAL:On.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:pt.KEEP,zFail:pt.DECREMENT_WRAP,zPass:pt.KEEP},backFunction:t,backOperation:{fail:pt.KEEP,zFail:pt.INCREMENT_WRAP,zPass:pt.KEEP},reference:Nt.CESIUM_3D_TILE_MASK,mask:Nt.CESIUM_3D_TILE_MASK},stencilMask:Nt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:ja.LESS_OR_EQUAL},depthMask:!1}}var jWe={stencilTest:{enabled:!0,frontFunction:On.NOT_EQUAL,frontOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},backFunction:On.NOT_EQUAL,backOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},reference:0,mask:Nt.CLASSIFICATION_MASK},stencilMask:Nt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:mn.PRE_MULTIPLIED_ALPHA_BLEND},qWe={stencilTest:{enabled:!0,frontFunction:On.NOT_EQUAL,frontOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},backFunction:On.NOT_EQUAL,backOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},reference:0,mask:Nt.CLASSIFICATION_MASK},stencilMask:Nt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function $We(e){l(e._rsStencilDepthPass)||(e._rsStencilDepthPass=ke.fromCache(xne(!1)),e._rsStencilDepthPass3DTiles=ke.fromCache(xne(!0)),e._rsColorPass=ke.fromCache(jWe),e._rsPickPass=ke.fromCache(qWe))}var Px=new A,_ne=new h;function e2e(e,t){if(l(e._uniformMap))return;let n={u_modifiedModelViewProjection:function(){let i=t.uniformState.view,o=t.uniformState.projection;return A.clone(i,Px),A.multiplyByPoint(Px,e._center,_ne),A.setTranslation(Px,_ne,Px),A.multiply(o,Px,Px),Px},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function aY(e,t,n,i,o,r,s){let a=e.constructor.BYTES_PER_ELEMENT,c=r.length;for(let d=0;d<c;++d){let u=r[d],m=s[u],p=i[m],y=o[m],f=new e.constructor(e.buffer,a*p,y);t.set(f,n),i[m]=n,n+=y}return n}function t2e(e,t){let n=e._indices,i=e._indexOffsets,o=e._indexCounts,r=e._batchIdLookUp,s=new n.constructor(n.length),a=t.pop(),c=[a],d=aY(n,s,0,i,o,a.batchIds,r);for(a.offset=0,a.count=d;t.length>0;){let u=t.pop();if(O.equals(u.color,a.color))d=aY(n,s,d,i,o,u.batchIds,r),a.batchIds=a.batchIds.concat(u.batchIds),a.count=d-a.offset;else{let m=d;d=aY(n,s,d,i,o,u.batchIds,r),u.offset=m,u.count=d-m,c.push(u),a=u}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=c}function cY(e,t,n,i,o,r,s){let a=e.bytesPerIndex,c=r.length;for(let d=0;d<c;++d){let u=r[d],m=s[u],p=i[m],y=o[m];t.copyFromBuffer(e,p*a,n*a,y*a),i[m]=n,n+=y}return n}function n2e(e,t){let n=e._indexOffsets,i=e._indexCounts,o=e._batchIdLookUp,r=t.pop(),s=[r],a=e._va.indexBuffer,c=e._vaSwap.indexBuffer,d=cY(a,c,0,n,i,r.batchIds,o);for(r.offset=0,r.count=d;t.length>0;){let m=t.pop();if(O.equals(m.color,r.color))d=cY(a,c,d,n,i,m.batchIds,o),r.batchIds=r.batchIds.concat(m.batchIds),r.count=d-r.offset;else{let p=d;d=cY(a,c,d,n,i,m.batchIds,o),m.offset=p,m.count=d-p,s.push(m),r=m}}let u=e._va;e._va=e._vaSwap,e._vaSwap=u,e._batchedIndices=s}function i2e(e,t){return t.color.toRgba()-e.color.toRgba()}function o2e(e,t){if(!e._batchDirty)return!1;let n=e._batchedIndices,i=n.length,o=!1,r={};for(let s=0;s<i;++s){let c=n[s].color.toRgba();if(l(r[c])){o=!0;break}else r[c]=!0}if(!o)return e._batchDirty=!1,!1;if(o&&!e.forceRebatch&&e._framesSinceLastRebatch<120){++e._framesSinceLastRebatch;return}return n.sort(i2e),t.webgl2?n2e(e,n):t2e(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}function r2e(e,t){let n=o2e(e,t),i=e._commands,o=e._batchedIndices,r=o.length,s=r*2;if(l(i)&&!n&&i.length===s)return;i.length=s;let a=e._va,c=e._sp,d=g(e._modelMatrix,A.IDENTITY),u=e._uniformMap,m=e._boundingVolume;for(let p=0;p<r;++p){let y=o[p].offset,f=o[p].count,x=i[p*2];l(x)||(x=i[p*2]=new nt({owner:e})),x.vertexArray=a,x.modelMatrix=d,x.offset=y,x.count=f,x.renderState=e._rsStencilDepthPass,x.shaderProgram=c,x.uniformMap=u,x.boundingVolume=m,x.cull=!1,x.pass=Ve.TERRAIN_CLASSIFICATION;let _=nt.shallowClone(x,x.derivedCommands.tileset);_.renderState=e._rsStencilDepthPass3DTiles,_.pass=Ve.CESIUM_3D_TILE_CLASSIFICATION,x.derivedCommands.tileset=_;let C=i[p*2+1];l(C)||(C=i[p*2+1]=new nt({owner:e})),C.vertexArray=a,C.modelMatrix=d,C.offset=y,C.count=f,C.renderState=e._rsColorPass,C.shaderProgram=c,C.uniformMap=u,C.boundingVolume=m,C.cull=!1,C.pass=Ve.TERRAIN_CLASSIFICATION;let V=nt.shallowClone(C,C.derivedCommands.tileset);V.pass=Ve.CESIUM_3D_TILE_CLASSIFICATION,C.derivedCommands.tileset=V}e._commandsDirty=!0}function s2e(e,t){if(e.classificationType===Bn.TERRAIN||!t.invertClassification||l(e._commandsIgnoreShow)&&!e._commandsDirty)return;let n=e._commands,i=e._commandsIgnoreShow,o=e._spStencil,r=n.length,s=i.length=r/2,a=0;for(let c=0;c<s;++c){let d=i[c]=nt.shallowClone(n[a],i[c]);d.shaderProgram=o,d.pass=Ve.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,a+=2}e._commandsDirty=!1}function a2e(e){if(!e._pickCommandsDirty)return;let t=e._indexOffsets.length,n=e._pickCommands;n.length=t*2;let i=e._va,o=e._spStencil,r=e._spPick,s=g(e._modelMatrix,A.IDENTITY),a=e._uniformMap;for(let c=0;c<t;++c){let d=e._indexOffsets[c],u=e._indexCounts[c],m=l(e._boundingVolumes)?e._boundingVolumes[c]:e.boundingVolume,p=n[c*2];l(p)||(p=n[c*2]=new nt({owner:e,pickOnly:!0})),p.vertexArray=i,p.modelMatrix=s,p.offset=d,p.count=u,p.renderState=e._rsStencilDepthPass,p.shaderProgram=o,p.uniformMap=a,p.boundingVolume=m,p.pass=Ve.TERRAIN_CLASSIFICATION;let y=nt.shallowClone(p,p.derivedCommands.tileset);y.renderState=e._rsStencilDepthPass3DTiles,y.pass=Ve.CESIUM_3D_TILE_CLASSIFICATION,p.derivedCommands.tileset=y;let f=n[c*2+1];l(f)||(f=n[c*2+1]=new nt({owner:e,pickOnly:!0})),f.vertexArray=i,f.modelMatrix=s,f.offset=d,f.count=u,f.renderState=e._rsPickPass,f.shaderProgram=r,f.uniformMap=a,f.boundingVolume=m,f.pass=Ve.TERRAIN_CLASSIFICATION;let x=nt.shallowClone(f,f.derivedCommands.tileset);x.pass=Ve.CESIUM_3D_TILE_CLASSIFICATION,f.derivedCommands.tileset=x}e._pickCommandsDirty=!1}Wp.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o];t[r]=new vs(e,r)}};Wp.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function c2e(e,t){e._updatingAllCommands=!0;let n=e._batchIds,i=n.length,o;for(o=0;o<i;++o){let s=n[o],a=t[s];a.show=!0,a.color=O.WHITE}let r=e._batchedIndices;for(i=r.length,o=0;o<i;++o)r[o].color=O.clone(O.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}var l2e=new O,d2e=O.WHITE,u2e=!0,m2e=/\$/;Wp.prototype.applyStyle=function(e,t){if(!l(e)){c2e(this,t);return}let n=e.color,i=n instanceof uu&&!m2e.test(n.expression);this._updatingAllCommands=i;let o=this._batchIds,r=o.length,s;for(s=0;s<r;++s){let a=o[s],c=t[a];c.color=l(e.color)?e.color.evaluateColor(c,l2e):d2e,c.show=l(e.show)?e.show.evaluate(c):u2e}if(i){let a=this._batchedIndices;for(r=a.length,s=0;s<r;++s)a[s].color=O.clone(O.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}};Wp.prototype.updateCommands=function(e,t){if(this._updatingAllCommands)return;let n=this._batchIdLookUp,i=n[e];if(!l(i))return;let o=this._indexOffsets,r=this._indexCounts,s=o[i],a=r[i],c=this._batchedIndices,d=c.length,u;for(u=0;u<d;++u){let x=c[u].offset,_=c[u].count;if(s>=x&&s<x+_)break}c.push(new tf({color:O.clone(t),offset:s,count:a,batchIds:[e]}));let m=[],p=[],y=c[u].batchIds,f=y.length;for(let x=0;x<f;++x){let _=y[x];if(_===e)continue;let C=n[_];o[C]<s?m.push(_):p.push(_)}p.length!==0&&c.push(new tf({color:O.clone(c[u].color),offset:s+a,count:c[u].offset+c[u].count-(s+a),batchIds:p})),m.length!==0?(c[u].count=s-c[u].offset,c[u].batchIds=m):c.splice(u,1),this._batchDirty=!0};function Tne(e,t,n,i){let o=e.classificationType,r=o!==Bn.CESIUM_3D_TILE,s=o!==Bn.TERRAIN,a=t.commandList,c=n.length,d,u;for(u=0;u<c;++u)r&&(d=n[u],d.pass=Ve.TERRAIN_CLASSIFICATION,a.push(d)),s&&(d=n[u].derivedCommands.tileset,d.pass=Ve.CESIUM_3D_TILE_CLASSIFICATION,a.push(d));if(!(!t.invertClassification||!l(i)))for(c=i.length,u=0;u<c;++u)a.push(i[u])}function h2e(e,t){let n=e.commandList,i=t.length;for(let o=0;o<i;o+=2){let r=t[o+1];r.pass=Ve.OPAQUE,n.push(r)}}function f2e(e){let t=e.debugWireframe===e._debugWireframe;if(t=t&&!(e.debugWireframe&&e._wireframeDirty),t)return;l(e._rsWireframe)||(e._rsWireframe=ke.fromCache({}));let n,i;e.debugWireframe?(n=e._rsWireframe,i=Ae.LINES):(n=e._rsColorPass,i=Ae.TRIANGLES);let o=e._commands,r=o.length;for(let s=0;s<r;s+=2){let a=o[s+1];a.renderState=n,a.primitiveType=i}e._debugWireframe=e.debugWireframe,e._wireframeDirty=!1}Wp.prototype.update=function(e){let t=e.context;JWe(this,t),QWe(this,t),$We(this),e2e(this,t);let n=e.passes;n.render&&(r2e(this,t),s2e(this,e),f2e(this),this._debugWireframe?h2e(e,this._commands):Tne(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&(a2e(this),Tne(this,e,this._pickCommands))};Wp.prototype.isDestroyed=function(){return!1};Wp.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(),ue(this)};var vx=Wp;function cd(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,l(this._center)||(l(this._boundingVolume)?this._center=h.clone(this._boundingVolume.center):this._center=h.clone(h.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._promise=void 0,this._error=void 0,this._verticesPromise=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=Bn.BOTH}Object.defineProperties(cd.prototype,{trianglesLength:{get:function(){return l(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});cd.packedBoxLength=A.packedLength+h.packedLength;cd.packedCylinderLength=A.packedLength+2;cd.packedEllipsoidLength=A.packedLength+h.packedLength;cd.packedSphereLength=h.packedLength+1;function p2e(e){let t=new Float64Array(A.packedLength+h.packedLength),n=0;return h.pack(e._center,t,n),n+=h.packedLength,A.pack(e._modelMatrix,t,n),t}function b2e(e,t){let n=0,i=t[n++],o=t[n++],r=e._boundingVolumes=new Array(o);for(let c=0;c<o;++c)r[c]=ce.unpack(t,n),n+=ce.packedLength;let s=t[n++],a=e._batchedIndices=new Array(s);for(let c=0;c<s;++c){let d=O.unpack(t,n);n+=O.packedLength;let u=t[n++],m=t[n++],p=t[n++],y=new Array(p);for(let f=0;f<p;++f)y[f]=t[n++];a[c]=new tf({color:d,offset:u,count:m,batchIds:y})}return i}var y2e=new gi("createVectorTileGeometries",5),g2e=new O;function x2e(e){if(!l(e._primitive)&&!l(e._verticesPromise)){let t=e._boxes,n=e._boxBatchIds,i=e._cylinders,o=e._cylinderBatchIds,r=e._ellipsoids,s=e._ellipsoidBatchIds,a=e._spheres,c=e._sphereBatchIds,d=e._batchTableColors,u=e._packedBuffer;if(!l(d)){let f=0;l(e._boxes)&&(t=e._boxes=t.slice(),n=e._boxBatchIds=n.slice(),f+=n.length),l(e._cylinders)&&(i=e._cylinders=i.slice(),o=e._cylinderBatchIds=o.slice(),f+=o.length),l(e._ellipsoids)&&(r=e._ellipsoids=r.slice(),s=e._ellipsoidBatchIds=s.slice(),f+=s.length),l(e._spheres)&&(a=e._sphere=a.slice(),c=e._sphereBatchIds=c.slice(),f+=c.length),d=e._batchTableColors=new Uint32Array(f);let x=e._batchTable;for(let _=0;_<f;++_){let C=x.getColor(_,g2e);d[_]=C.toRgba()}u=e._packedBuffer=p2e(e)}let m=[];l(t)&&m.push(t.buffer,n.buffer),l(i)&&m.push(i.buffer,o.buffer),l(r)&&m.push(r.buffer,s.buffer),l(a)&&m.push(a.buffer,c.buffer),m.push(d.buffer,u.buffer);let p={boxes:l(t)?t.buffer:void 0,boxBatchIds:l(t)?n.buffer:void 0,cylinders:l(i)?i.buffer:void 0,cylinderBatchIds:l(i)?o.buffer:void 0,ellipsoids:l(r)?r.buffer:void 0,ellipsoidBatchIds:l(r)?s.buffer:void 0,spheres:l(a)?a.buffer:void 0,sphereBatchIds:l(a)?c.buffer:void 0,batchTableColors:d.buffer,packedBuffer:u.buffer},y=e._verticesPromise=y2e.scheduleTask(p,m);return l(y)?y.then(function(f){if(e.isDestroyed())return;let x=new Float64Array(f.packedBuffer);b2e(e,x)===2?e._indices=new Uint16Array(f.indices):e._indices=new Uint32Array(f.indices),e._indexOffsets=new Uint32Array(f.indexOffsets),e._indexCounts=new Uint32Array(f.indexCounts),e._positions=new Float32Array(f.positions),e._vertexBatchIds=new Uint16Array(f.vertexBatchIds),e._batchIds=new Uint16Array(f.batchIds),_2e(e),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)}):void 0}}function _2e(e){l(e._primitive)||(e._primitive=new vx({batchTable:e._batchTable,positions:e._positions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center,pickObject:g(e._pickObject,e)}),e._boxes=void 0,e._boxBatchIds=void 0,e._cylinders=void 0,e._cylinderBatchIds=void 0,e._ellipsoids=void 0,e._ellipsoidBatchIds=void 0,e._spheres=void 0,e._sphereBatchIds=void 0,e._center=void 0,e._modelMatrix=void 0,e._batchTable=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0,e._indices=void 0,e._indexOffsets=void 0,e._indexCounts=void 0,e._positions=void 0,e._vertexBatchIds=void 0,e._batchIds=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._verticesPromise=void 0)}cd.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};cd.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};cd.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};cd.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};cd.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=x2e(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};cd.prototype.isDestroyed=function(){return!1};cd.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var Pp=cd;function nf(e,t,n,i,o){this._tileset=e,this._tile=t,this._resource=n,this._geometries=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,C2e(this,i,o)}Object.defineProperties(nf.prototype,{featuresLength:{get:function(){return l(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return l(this._geometries)?this._geometries.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._geometries)?this._geometries.geometryByteLength:0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function T2e(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function S2e(e,t){let n,i,o,r,s,a=g(e.BOXES_LENGTH,0),c=g(e.CYLINDERS_LENGTH,0),d=g(e.ELLIPSOIDS_LENGTH,0),u=g(e.SPHERES_LENGTH,0);if(a>0&&l(e.BOX_BATCH_IDS)){let f=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,f,a)}if(c>0&&l(e.CYLINDER_BATCH_IDS)){let f=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,f,c)}if(d>0&&l(e.ELLIPSOID_BATCH_IDS)){let f=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,f,d)}if(u>0&&l(e.SPHERE_BATCH_IDS)){let f=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,f,u)}let m=l(n)||l(i)||l(o)||l(r),p=a>0&&!l(n)||c>0&&!l(i)||d>0&&!l(o)||u>0&&!l(r);if(m&&p)throw new me("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(o)&&!l(r)){let f=0;if(!l(n)&&a>0)for(n=new Uint16Array(a),s=0;s<a;++s)n[s]=f++;if(!l(i)&&c>0)for(i=new Uint16Array(c),s=0;s<c;++s)i[s]=f++;if(!l(o)&&d>0)for(o=new Uint16Array(d),s=0;s<d;++s)o[s]=f++;if(!l(r)&&u>0)for(r=new Uint16Array(u),s=0;s<u;++s)r[s]=f++}return{boxes:n,cylinders:i,ellipsoids:o,spheres:r}}var wx=Uint32Array.BYTES_PER_ELEMENT;function C2e(e,t,n){n=g(n,0);let i=new Uint8Array(t),o=new DataView(t);n+=wx;let r=o.getUint32(n,!0);if(r!==1)throw new me(`Only Geometry tile version 1 is supported. Version ${r} is not.`);n+=wx;let s=o.getUint32(n,!0);if(n+=wx,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=wx,a===0)throw new me("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=wx;let d=o.getUint32(n,!0);n+=wx;let u=o.getUint32(n,!0);n+=wx;let m=Po(i,n,a);n+=a;let p=new Uint8Array(t,n,c);n+=c;let y,f;d>0&&(y=Po(i,n,d),n+=d,u>0&&(f=new Uint8Array(t,n,u),f=new Uint8Array(f)));let x=g(m.BOXES_LENGTH,0),_=g(m.CYLINDERS_LENGTH,0),C=g(m.ELLIPSOIDS_LENGTH,0),V=g(m.SPHERES_LENGTH,0),L=x+_+C+V,Z=new Xp(e,L,y,f,T2e(e));if(e._batchTable=Z,L===0)return;let G=e.tile.computedTransform,I;l(m.RTC_CENTER)&&(I=h.unpack(m.RTC_CENTER),A.multiplyByPoint(G,I,I));let P=S2e(m,p);if(x>0||_>0||C>0||V>0){let v,F,M,b;if(x>0){let R=p.byteOffset+m.BOXES.byteOffset;v=new Float32Array(p.buffer,R,Pp.packedBoxLength*x)}if(_>0){let R=p.byteOffset+m.CYLINDERS.byteOffset;F=new Float32Array(p.buffer,R,Pp.packedCylinderLength*_)}if(C>0){let R=p.byteOffset+m.ELLIPSOIDS.byteOffset;M=new Float32Array(p.buffer,R,Pp.packedEllipsoidLength*C)}if(V>0){let R=p.byteOffset+m.SPHERES.byteOffset;b=new Float32Array(p.buffer,R,Pp.packedSphereLength*V)}return e._geometries=new Pp({boxes:v,boxBatchIds:P.boxes,cylinders:F,cylinderBatchIds:P.cylinders,ellipsoids:M,ellipsoidBatchIds:P.ellipsoids,spheres:b,sphereBatchIds:P.spheres,center:I,modelMatrix:G,batchTable:Z,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function Sne(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._geometries)&&e._geometries.createFeatures(e,n),e._features=n}}nf.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};nf.prototype.getFeature=function(e){return Sne(this),this._features[e]};nf.prototype.applyDebugSettings=function(e,t){l(this._geometries)&&this._geometries.applyDebugSettings(e,t)};nf.prototype.applyStyle=function(e){Sne(this),l(this._geometries)&&this._geometries.applyStyle(e,this._features)};nf.prototype.update=function(e,t){l(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(t)),l(this._batchTable)&&this._geometries.ready&&(this._batchTable.update(e,t),this._ready=!0)};nf.prototype.pick=function(e,t,n){};nf.prototype.isDestroyed=function(){return!1};nf.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};var JE=nf;var Zan=T(S(),1);var Jqt=T(S(),1);var lY={};lY.encode2D=function(e,t,n){let i=Math.pow(2,e),o={x:t,y:n},r,s,a,c=BigInt(0);for(a=i/2;a>0;a/=2)r=(o.x&a)>0?1:0,s=(o.y&a)>0?1:0,c+=BigInt((3*r^s)*a*a),Cne(i,o,r,s);return c};lY.decode2D=function(e,t){let n=Math.pow(2,e),i={x:0,y:0},o,r,s,a;for(s=1,a=t;s<n;s*=2)o=1&Number(a/BigInt(2)),r=1&Number(a^BigInt(o)),Cne(s,i,o,r),i.x+=s*o,i.y+=s*r,a/=BigInt(4);return[i.x,i.y]};function Cne(e,t,n,i){if(i!==0)return;n===1&&(t.x=e-1-t.x,t.y=e-1-t.y);let o=t.x;t.x=t.y,t.y=o}var $S=lY;var i$t=T(S(),1);var Fx=30,V2e=1<<Fx,L2e=1<<Fx+1>>>0,dY=2*Fx+1,wb=4,Rne=[],Zne=[],R2e=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],Fb=1,eC=2,bN=[Fb,0,0,Fb|eC];function Or(e){if(!Bt.supportsBigInt())throw new me("S2 required BigInt support");this._cellId=e,this._level=Or.getLevel(e)}Or.fromToken=function(e){return new Or(Or.getIdFromToken(e))};Or.isValidId=function(e){return!(e<=0||e>>BigInt(dY)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};Or.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?Or.isValidId(Or.getIdFromToken(e)):!1};Or.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};Or.getTokenFromId=function(e){let t=Math.floor(F2e(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};Or.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return Fx-(t>>1)};Or.prototype.getChild=function(e){let t=Ine(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new Or(n)};Or.prototype.getParent=function(){let e=Ine(this._cellId)<<BigInt(2);return new Or(this._cellId&~e+BigInt(1)|e)};Or.prototype.getParentAtLevel=function(e){let t=v2e(e);return new Or(this._cellId&-t|t)};Or.prototype.getCenter=function(e){e=g(e,oe.WGS84);let t=Z2e(this._cellId,this._level);t=h.normalize(t,t);let n=new he.fromCartesian(t,oe.UNIT_SPHERE);return he.toCartesian(n,e,new h)};Or.prototype.getVertex=function(e,t){t=g(t,oe.WGS84);let n=G2e(this._cellId,this._level,e);n=h.normalize(n,n);let i=new he.fromCartesian(n,oe.UNIT_SPHERE);return he.toCartesian(i,t,new h)};Or.fromFacePositionLevel=function(e,t,n){let i=(e<4?"0":"")+(e<2?"0":"")+e.toString(2),o=t.toString(2),r=Array(2*n-o.length+1).join("0"),s=Array(dY-2*n).join("0"),a=BigInt(`0b${i}${r}${o}1${s}`);return new Or(a)};function Z2e(e,t){let n=E2e(e,t);return I2e(n[0],n[1],n[2])}function G2e(e,t,n){let i=Gne(e,t),o=X2e([i[1],i[2]],t),r=n>>1&1;return Ene(i[0],o[0][r^n&1],o[1][r])}function E2e(e,t){let n=Gne(e),i=n[0],o=n[1],r=n[2],s=t===30,a=!s&&(BigInt(o)^e>>BigInt(2))&BigInt(1),c=s?1:a?2:0,d=(o<<1)+c,u=(r<<1)+c;return[i,d,u]}function Gne(e){Rne.length===0&&P2e();let t=Number(e>>BigInt(dY)),n=t&Fb,i=(1<<wb)-1,o=0,r=0;for(let s=7;s>=0;s--){let c=(1<<2*(s===7?Fx-7*wb:wb))-1;n+=Number(e>>BigInt(s*2*wb+1)&BigInt(c))<<2,n=Zne[n];let d=s*wb;o+=n>>wb+2<<d,r+=(n>>2&i)<<d,n&=Fb|eC}return[t,o,r]}function I2e(e,t,n){let i=Vne(t),o=Vne(n),r=yN(i),s=yN(o);return Ene(e,r,s)}function Ene(e,t,n){switch(e){case 0:return new h(1,t,n);case 1:return new h(-t,1,n);case 2:return new h(-t,-n,1);case 3:return new h(-1,-n,-t);case 4:return new h(n,-1,-t);default:return new h(n,t,-1)}}function yN(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function Vne(e){return 1/L2e*e}function X2e(e,t){let n=[[],[]],i=W2e(t);for(let o=0;o<2;++o){let r=e[o]&-i,s=r+i;n[o][0]=yN(Lne(r)),n[o][1]=yN(Lne(s))}return n}function W2e(e){return 1<<Fx-e>>>0}function Lne(e){return 1/V2e*e}function Ab(e,t,n,i,o,r){if(e===wb){let s=(t<<wb)+n;Rne[(s<<2)+i]=(o<<2)+r,Zne[(o<<2)+i]=(s<<2)+r}else{e++,t<<=1,n<<=1,o<<=2;let s=R2e[r];Ab(e,t+(s[0]>>1),n+(s[0]&1),i,o,r^bN[0]),Ab(e,t+(s[1]>>1),n+(s[1]&1),i,o+1,r^bN[1]),Ab(e,t+(s[2]>>1),n+(s[2]&1),i,o+2,r^bN[2]),Ab(e,t+(s[3]>>1),n+(s[3]&1),i,o+3,r^bN[3])}}function P2e(){Ab(0,0,0,0,0,0),Ab(0,0,0,Fb,0,Fb),Ab(0,0,0,eC,0,eC),Ab(0,0,0,Fb|eC,0,Fb|eC)}function Ine(e){return e&~e+BigInt(1)}function v2e(e){return BigInt(1)<<BigInt(2*(Fx-e))}var w2e=[64,0,1,39,2,15,40,23,3,12,16,59,41,19,24,54,4,64,13,10,17,62,60,28,42,30,20,51,25,44,55,47,5,32,65,38,14,22,11,58,18,53,63,9,61,27,29,50,43,46,31,37,21,57,52,8,26,49,45,36,56,7,48,35,6,34,33,0];function F2e(e){return w2e[(-e&e)%BigInt(67)]}var vp=Or;var ran=T(S(),1);var s$t=T(S(),1);function A2e(e,t){return l(e)&&l(e.extensions)&&l(e.extensions[t])}var ci=A2e;var u$t=T(S(),1);function uY(e){let t=e.lengthBits,n=e.availableCount,i=e.constant,o=e.bitstream;if(l(i))n=t;else{let r=Math.ceil(t/8);if(o.length!==r)throw new me(`Availability bitstream must be exactly ${r} bytes long to store ${t} bits. Actual bitstream was ${o.length} bytes long.`);let s=g(e.computeAvailableCountEnabled,!1);!l(n)&&s&&(n=M2e(o,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=o}function M2e(e,t){let n=0;for(let i=0;i<t;i++){let o=i>>3,r=i%8;n+=e[o]>>r&1}return n}Object.defineProperties(uY.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});uY.prototype.getBit=function(e){if(l(this._constant))return this._constant;let t=e>>3,n=e%8;return(this._bitstream[t]>>n&1)===1};var tC=uY;var f$t=T(S(),1);function wp(e){e=g(e,g.EMPTY_OBJECT);let t=e.metadataTable,n=e.class,i=e.entityId,o=e.propertyTableJson;this._class=n,this._metadataTable=t,this._entityId=i,this._extensions=o.extensions,this._extras=o.extras}Object.defineProperties(wp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});wp.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};wp.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};wp.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};wp.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};wp.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};wp.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};wp.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var nC=wp;var b$t=T(S(),1);var gN={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};gN.getBranchingFactor=function(e){switch(e){case gN.OCTREE:return 8;case gN.QUADTREE:return 4}};var Yr=Object.freeze(gN);var R$t=T(S(),1);var T$t=T(S(),1);function ea(){}Object.defineProperties(ea.prototype,{class:{get:function(){fe.throwInstantiationError()}}});ea.prototype.hasProperty=function(e){fe.throwInstantiationError()};ea.prototype.hasPropertyBySemantic=function(e){fe.throwInstantiationError()};ea.prototype.getPropertyIds=function(e){fe.throwInstantiationError()};ea.prototype.getProperty=function(e){fe.throwInstantiationError()};ea.prototype.setProperty=function(e,t){fe.throwInstantiationError()};ea.prototype.getPropertyBySemantic=function(e){fe.throwInstantiationError()};ea.prototype.setPropertyBySemantic=function(e,t){fe.throwInstantiationError()};ea.hasProperty=function(e,t,n){if(l(t[e]))return!0;let i=n.properties;if(!l(i))return!1;let o=i[e];return!!(l(o)&&l(o.default))};ea.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return!1;let o=i[e];return l(o)};ea.getPropertyIds=function(e,t,n){n=l(n)?n:[],n.length=0;for(let o in e)e.hasOwnProperty(o)&&l(e[o])&&n.push(o);let i=t.properties;if(l(i))for(let o in i)i.hasOwnProperty(o)&&!l(e[o])&&l(i[o].default)&&n.push(o);return n};ea.getProperty=function(e,t,n){let i=n.properties[e],o=t[e];Array.isArray(o)&&(o=o.slice());let r=!0;if(o=i.handleNoData(o),!l(o)&&l(i.default))return o=ze(i.default,!0),i.unpackVectorAndMatrixTypes(o,r);if(l(o))return o=i.normalize(o),o=i.applyValueTransform(o),i.unpackVectorAndMatrixTypes(o,r)};ea.setProperty=function(e,t,n,i){if(!l(n[e]))return!1;Array.isArray(t)&&(t=t.slice());let o,r=i.properties;return l(r)&&(o=r[e]),l(o)&&(t=o.packVectorAndMatrixTypes(t,!0),t=o.unapplyValueTransform(t),t=o.unnormalize(t)),n[e]=t,!0};ea.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return;let o=i[e];if(l(o))return ea.getProperty(o.id,t,n)};ea.setPropertyBySemantic=function(e,t,n,i){let o=i.propertiesBySemantic;if(!l(o))return!1;let r=i.propertiesBySemantic[e];return l(r)?ea.setProperty(r.id,t,n,i):!1};var Nn=ea;function Fp(e){e=g(e,g.EMPTY_OBJECT);let t=e.subtreeMetadata,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Fp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Fp.prototype.hasProperty=function(e){return Nn.hasProperty(e,this._properties,this._class)};Fp.prototype.hasPropertyBySemantic=function(e){return Nn.hasPropertyBySemantic(e,this._properties,this._class)};Fp.prototype.getPropertyIds=function(e){return Nn.getPropertyIds(this._properties,this._class,e)};Fp.prototype.getProperty=function(e){return Nn.getProperty(e,this._properties,this._class)};Fp.prototype.setProperty=function(e,t){return Nn.setProperty(e,t,this._properties,this._class)};Fp.prototype.getPropertyBySemantic=function(e){return Nn.getPropertyBySemantic(e,this._properties,this._class)};Fp.prototype.setPropertyBySemantic=function(e,t){return Nn.setPropertyBySemantic(e,t,this._properties,this._class)};var QE=Fp;var yen=T(S(),1);var den=T(S(),1);var X$t=T(S(),1);var Wt={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"};Wt.getMinimum=function(e){switch(e){case Wt.INT8:return-128;case Wt.UINT8:return 0;case Wt.INT16:return-32768;case Wt.UINT16:return 0;case Wt.INT32:return-2147483648;case Wt.UINT32:return 0;case Wt.INT64:return Bt.supportsBigInt()?BigInt("-9223372036854775808"):-Math.pow(2,63);case Wt.UINT64:return Bt.supportsBigInt()?BigInt(0):0;case Wt.FLOAT32:return-34028234663852886e22;case Wt.FLOAT64:return-Number.MAX_VALUE}};Wt.getMaximum=function(e){switch(e){case Wt.INT8:return 127;case Wt.UINT8:return 255;case Wt.INT16:return 32767;case Wt.UINT16:return 65535;case Wt.INT32:return 2147483647;case Wt.UINT32:return 4294967295;case Wt.INT64:return Bt.supportsBigInt()?BigInt("9223372036854775807"):Math.pow(2,63)-1;case Wt.UINT64:return Bt.supportsBigInt()?BigInt("18446744073709551615"):Math.pow(2,64)-1;case Wt.FLOAT32:return 34028234663852886e22;case Wt.FLOAT64:return Number.MAX_VALUE}};Wt.isIntegerType=function(e){switch(e){case Wt.INT8:case Wt.UINT8:case Wt.INT16:case Wt.UINT16:case Wt.INT32:case Wt.UINT32:case Wt.INT64:case Wt.UINT64:return!0;default:return!1}};Wt.isUnsignedIntegerType=function(e){switch(e){case Wt.UINT8:case Wt.UINT16:case Wt.UINT32:case Wt.UINT64:return!0;default:return!1}};Wt.isVectorCompatible=function(e){switch(e){case Wt.INT8:case Wt.UINT8:case Wt.INT16:case Wt.UINT16:case Wt.INT32:case Wt.UINT32:case Wt.FLOAT32:case Wt.FLOAT64:return!0;default:return!1}};Wt.normalize=function(e,t){return Math.max(Number(e)/Number(Wt.getMaximum(t)),-1)};Wt.unnormalize=function(e,t){let n=Wt.getMaximum(t),i=Wt.isUnsignedIntegerType(t)?0:-n;return e=W.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===Wt.INT64||t===Wt.UINT64)&&Bt.supportsBigInt()&&(e=BigInt(e)),e>n?n:e<i?i:e};Wt.applyValueTransform=function(e,t,n){return n*e+t};Wt.unapplyValueTransform=function(e,t,n){return n===0?0:(e-t)/n};Wt.getSizeInBytes=function(e){switch(e){case Wt.INT8:case Wt.UINT8:return 1;case Wt.INT16:case Wt.UINT16:return 2;case Wt.INT32:case Wt.UINT32:return 4;case Wt.INT64:case Wt.UINT64:return 8;case Wt.FLOAT32:return 4;case Wt.FLOAT64:return 8}};Wt.fromComponentDatatype=function(e){switch(e){case Q.BYTE:return Wt.INT8;case Q.UNSIGNED_BYTE:return Wt.UINT8;case Q.SHORT:return Wt.INT16;case Q.UNSIGNED_SHORT:return Wt.UINT16;case Q.INT:return Wt.INT32;case Q.UNSIGNED_INT:return Wt.UINT32;case Q.FLOAT:return Wt.FLOAT32;case Q.DOUBLE:return Wt.FLOAT64}};Wt.toComponentDatatype=function(e){switch(e){case Wt.INT8:return Q.BYTE;case Wt.UINT8:return Q.UNSIGNED_BYTE;case Wt.INT16:return Q.SHORT;case Wt.UINT16:return Q.UNSIGNED_SHORT;case Wt.INT32:return Q.INT;case Wt.UINT32:return Q.UNSIGNED_INT;case Wt.FLOAT32:return Q.FLOAT;case Wt.FLOAT64:return Q.DOUBLE}};var sn=Object.freeze(Wt);var q$t=T(S(),1);var N$t=T(S(),1);var Fo={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};Fo.isVectorType=function(e){switch(e){case Fo.VEC2:case Fo.VEC3:case Fo.VEC4:return!0;default:return!1}};Fo.isMatrixType=function(e){switch(e){case Fo.MAT2:case Fo.MAT3:case Fo.MAT4:return!0;default:return!1}};Fo.getComponentCount=function(e){switch(e){case Fo.SCALAR:case Fo.STRING:case Fo.ENUM:case Fo.BOOLEAN:return 1;case Fo.VEC2:return 2;case Fo.VEC3:return 3;case Fo.VEC4:return 4;case Fo.MAT2:return 4;case Fo.MAT3:return 9;case Fo.MAT4:return 16}};Fo.getMathType=function(e){switch(e){case Fo.VEC2:return B;case Fo.VEC3:return h;case Fo.VEC4:return se;case Fo.MAT2:return io;case Fo.MAT3:return q;case Fo.MAT4:return A;default:return}};var Ht=Object.freeze(Fo);function La(e){e=g(e,g.EMPTY_OBJECT);let t=e.id,n=e.type,i=e.componentType,o=e.enumType,r=l(i)&&sn.isIntegerType(i)&&g(e.normalized,!1);this._id=t,this._name=e.name,this._description=e.description,this._semantic=e.semantic,this._isLegacyExtension=e.isLegacyExtension,this._type=n,this._componentType=i,this._enumType=o,this._valueType=l(o)?o.valueType:i,this._isArray=g(e.isArray,!1),this._isVariableLengthArray=g(e.isVariableLengthArray,!1),this._arrayLength=e.arrayLength,this._min=ze(e.min,!0),this._max=ze(e.max,!0),this._normalized=r;let s=ze(e.offset,!0),a=ze(e.scale,!0),c=l(s)||l(a),d=!0;l(s)||(s=this.expandConstant(0,d)),l(a)||(a=this.expandConstant(1,d)),this._offset=s,this._scale=a,this._hasValueTransform=c,this._noData=ze(e.noData,!0),this._default=ze(e.default,!0),this._required=g(e.required,!0),this._extras=ze(e.extras,!0),this._extensions=ze(e.extensions,!0)}La.fromJson=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.id,n=e.property,i=N2e(n),o=U2e(n,e.enums),r;return l(i)?i?r=l(n.optional)?!n.optional:!0:r=g(n.required,!1):r=!1,new La({id:t,type:o.type,componentType:o.componentType,enumType:o.enumType,isArray:o.isArray,isVariableLengthArray:o.isVariableLengthArray,arrayLength:o.arrayLength,normalized:n.normalized,min:n.min,max:n.max,offset:n.offset,scale:n.scale,noData:n.noData,default:n.default,required:r,name:n.name,description:n.description,semantic:n.semantic,extras:n.extras,extensions:n.extensions,isLegacyExtension:i})};Object.defineProperties(La.prototype,{id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},type:{get:function(){return this._type}},enumType:{get:function(){return this._enumType}},componentType:{get:function(){return this._componentType}},valueType:{get:function(){return this._valueType}},isArray:{get:function(){return this._isArray}},isVariableLengthArray:{get:function(){return this._isVariableLengthArray}},arrayLength:{get:function(){return this._arrayLength}},normalized:{get:function(){return this._normalized}},max:{get:function(){return this._max}},min:{get:function(){return this._min}},noData:{get:function(){return this._noData}},default:{get:function(){return this._default}},required:{get:function(){return this._required}},semantic:{get:function(){return this._semantic}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});function N2e(e){if(e.type==="ARRAY")return!0;let t=e.type;if(t===Ht.SCALAR||Ht.isMatrixType(t)||Ht.isVectorType(t))return!1;if(l(sn[t]))return!0;if(l(e.noData)||l(e.scale)||l(e.offset)||l(e.required)||l(e.count)||l(e.array)||l(e.optional))return!1}function U2e(e,t){let n=e.type,i=e.componentType,o=n==="ARRAY",r,s,a;o?(r=!0,s=e.componentCount,a=!l(s)):e.array?(r=!0,s=e.count,a=!l(e.count)):(r=!1,s=void 0,a=!1);let c;if(l(e.enumType)&&(c=t[e.enumType]),n===Ht.ENUM)return{type:n,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&i===Ht.ENUM)return{type:i,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===Ht.SCALAR||Ht.isMatrixType(n)||Ht.isVectorType(n))return{type:n,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===Ht.BOOLEAN||n===Ht.STRING)return{type:n,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&(i===Ht.BOOLEAN||i===Ht.STRING))return{type:i,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(l(i)&&l(sn[i]))return{type:Ht.SCALAR,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(l(sn[n]))return{type:Ht.SCALAR,componentType:n,enumType:void 0,valueType:n,isArray:r,isVariableLengthArray:a,arrayLength:s}}La.prototype.normalize=function(e){return this._normalized?mY(e,this._valueType,sn.normalize):e};La.prototype.unnormalize=function(e){return this._normalized?mY(e,this._valueType,sn.unnormalize):e};La.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:La.valueTransformInPlace(e,this._offset,this._scale,sn.applyValueTransform)};La.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:La.valueTransformInPlace(e,this._offset,this._scale,sn.unapplyValueTransform)};La.prototype.expandConstant=function(e,t){t=g(t,!1);let n=this._isArray,i=this._arrayLength,o=Ht.getComponentCount(this._type),r=n&&o>1;if(!n&&o===1)return e;if(!n)return new Array(o).fill(e);if(!r)return new Array(i).fill(e);if(!t)return new Array(this._arrayLength*o).fill(e);let s=new Array(o).fill(e);return new Array(this._arrayLength).fill(s)};La.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!vne(e,t))return e};function vne(e,t){if(!Array.isArray(e))return e===t;if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!vne(e[n],t[n]))return!1;return!0}La.prototype.unpackVectorAndMatrixTypes=function(e,t){t=g(t,!1);let n=Ht.getMathType(this._type),i=this._isArray,o=Ht.getComponentCount(this._type),r=i&&o>1;return l(n)?t&&r?e.map(function(s){return n.unpack(s)}):i?n.unpackArray(e):n.unpack(e):e};La.prototype.packVectorAndMatrixTypes=function(e,t){t=g(t,!1);let n=Ht.getMathType(this._type),i=this._isArray,o=Ht.getComponentCount(this._type),r=i&&o>1;return l(n)?t&&r?e.map(function(s){return n.pack(s,[])}):i?n.packArray(e,[]):n.pack(e,[]):e};La.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?k2e(this,e):wne(this,e)};function k2e(e,t){if(!Array.isArray(t))return`value ${t} must be an array`;let n=t.length;if(!e._isVariableLengthArray&&n!==e._arrayLength)return"Array length does not match property.arrayLength";for(let i=0;i<n;i++){let o=wne(e,t[i]);if(l(o))return o}}function wne(e,t){let n=e._type,i=e._componentType,o=e._enumType,r=e._normalized;return Ht.isVectorType(n)?D2e(t,n,i):Ht.isMatrixType(n)?B2e(t,n,i):n===Ht.STRING?O2e(t):n===Ht.BOOLEAN?Y2e(t):n===Ht.ENUM?H2e(t,o):K2e(t,i,r)}function D2e(e,t,n){if(!sn.isVectorCompatible(n))return`componentType ${n} is incompatible with vector type ${t}`;if(t===Ht.VEC2&&!(e instanceof B))return`vector value ${e} must be a Cartesian2`;if(t===Ht.VEC3&&!(e instanceof h))return`vector value ${e} must be a Cartesian3`;if(t===Ht.VEC4&&!(e instanceof se))return`vector value ${e} must be a Cartesian4`}function B2e(e,t,n){if(!sn.isVectorCompatible(n))return`componentType ${n} is incompatible with matrix type ${t}`;if(t===Ht.MAT2&&!(e instanceof io))return`matrix value ${e} must be a Matrix2`;if(t===Ht.MAT3&&!(e instanceof q))return`matrix value ${e} must be a Matrix3`;if(t===Ht.MAT4&&!(e instanceof A))return`matrix value ${e} must be a Matrix4`}function O2e(e){if(typeof e!="string")return xN(e,Ht.STRING)}function Y2e(e){if(typeof e!="boolean")return xN(e,Ht.BOOLEAN)}function H2e(e,t){let n=typeof e;if(l(t))return n!=="string"||!l(t.valuesByName[e])?`value ${e} is not a valid enum name for ${t.id}`:void 0}function K2e(e,t,n){let i=typeof e;switch(t){case sn.INT8:case sn.UINT8:case sn.INT16:case sn.UINT16:case sn.INT32:case sn.UINT32:case sn.FLOAT32:case sn.FLOAT64:return i!=="number"?xN(e,t):isFinite(e)?Wne(e,t,n):Pne(e,t);case sn.INT64:case sn.UINT64:return i!=="number"&&i!=="bigint"?xN(e,t):i==="number"&&!isFinite(e)?Pne(e,t):Wne(e,t,n)}}function xN(e,t){return`value ${e} does not match type ${t}`}function Xne(e,t,n){let i=`value ${e} is out of range for type ${t}`;return n&&(i+=" (normalized)"),i}function Wne(e,t,n){if(n){let i=sn.isUnsignedIntegerType(t)?0:-1;return e<i||e>1?Xne(e,t,n):void 0}if(e<sn.getMinimum(t)||e>sn.getMaximum(t))return Xne(e,t,n)}function Pne(e,t){return`value ${e} of type ${t} must be finite`}function mY(e,t,n){if(!Array.isArray(e))return n(e,t);for(let i=0;i<e.length;i++)e[i]=mY(e[i],t,n);return e}La.valueTransformInPlace=function(e,t,n,i){if(!Array.isArray(e))return i(e,t,n);for(let o=0;o<e.length;o++)e[o]=La.valueTransformInPlace(e[o],t[o],n[o],i);return e};var Mb=La;function jE(e){e=g(e,g.EMPTY_OBJECT);let t=e.count,n=e.property,i=e.classProperty,o=e.bufferViews,r=i.type,s=i.isArray,a=i.isVariableLengthArray,c=i.valueType,d=i.enumType,u=r===Ht.STRING,m=r===Ht.BOOLEAN,p=0,y;if(a){let b=g(n.arrayOffsetType,n.offsetType);b=g(sn[b],sn.UINT32);let R=g(n.arrayOffsets,n.arrayOffsetBufferView);y=new hY(o[R],b,t+1),p+=y.typedArray.byteLength}let f=Ht.getComponentCount(r),x;a?x=y.get(t)-y.get(0):s?x=t*i.arrayLength:x=t;let _=f*x,C;if(u){let b=g(n.stringOffsetType,n.offsetType);b=g(sn[b],sn.UINT32);let R=g(n.stringOffsets,n.stringOffsetBufferView);C=new hY(o[R],b,_+1),p+=C.typedArray.byteLength}(u||m)&&(c=sn.UINT8);let V;u?V=C.get(_)-C.get(0):m?V=Math.ceil(_/8):V=_;let L=g(n.values,n.bufferView),Z=new hY(o[L],c,V);p+=Z.typedArray.byteLength;let G=n.offset,I=n.scale,P=i.hasValueTransform||l(G)||l(I);G=g(G,i.offset),I=g(I,i.scale),G=Fne(G),I=Fne(I);let v,F,M=this;u?v=function(b){return Q2e(b,M._values,M._stringOffsets)}:m?(v=function(b){return j2e(b,M._values)},F=function(b,R){q2e(b,M._values,R)}):l(d)?(v=function(b){let R=M._values.get(b);return d.namesByValue[R]},F=function(b,R){let E=d.valuesByName[R];M._values.set(b,E)}):(v=function(b){return M._values.get(b)},F=function(b,R){M._values.set(b,R)}),this._arrayOffsets=y,this._stringOffsets=C,this._values=Z,this._classProperty=i,this._count=t,this._vectorComponentCount=f,this._min=n.min,this._max=n.max,this._offset=G,this._scale=I,this._hasValueTransform=P,this._getValue=v,this._setValue=F,this._unpackedValues=void 0,this._extras=n.extras,this._extensions=n.extensions,this._byteLength=p}Object.defineProperties(jE.prototype,{hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){return this._byteLength}}});jE.prototype.get=function(e){let t=z2e(this,e);return t=this._classProperty.handleNoData(t),l(t)?(t=this._classProperty.normalize(t),t=sPe(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};jE.prototype.set=function(e,t){let n=this._classProperty;t=n.packVectorAndMatrixTypes(t),t=aPe(this,t),t=n.unnormalize(t),J2e(this,e,t)};jE.prototype.getTypedArray=function(){if(l(this._values))return this._values.typedArray};function Fne(e){if(!Array.isArray(e))return e;let t=[];for(let n=0;n<e.length;n++){let i=e[n];Array.isArray(i)?t.push.apply(t,i):t.push(i)}return t}function z2e(e,t){Mne(e)&&Nne(e);let n=e._classProperty,i=n.isArray,o=n.type,r=Ht.getComponentCount(o);if(l(e._unpackedValues)){let s=e._unpackedValues[t];return i?ze(s,!0):s}return!i&&r===1?e._getValue(t):Ane(e,n,t)}function Ane(e,t,n){let i,o;if(t.isVariableLengthArray){i=e._arrayOffsets.get(n),o=e._arrayOffsets.get(n+1)-i;let s=Ht.getComponentCount(t.type);i*=s,o*=s}else{let a=g(t.arrayLength,1)*e._vectorComponentCount;i=n*a,o=a}let r=new Array(o);for(let s=0;s<o;s++)r[s]=e._getValue(i+s);return r}function J2e(e,t,n){oPe(e,t,n)&&Nne(e);let i=e._classProperty,o=i.isArray,r=i.type,s=Ht.getComponentCount(r);if(l(e._unpackedValues)){i.isArray&&(n=ze(n,!0)),e._unpackedValues[t]=n;return}if(!o&&s===1){e._setValue(t,n);return}let a,c;if(i.isVariableLengthArray)a=e._arrayOffsets.get(t),c=e._arrayOffsets.get(t+1)-a;else{let u=g(i.arrayLength,1)*e._vectorComponentCount;a=t*u,c=u}for(let d=0;d<c;++d)e._setValue(a+d,n[d])}function Q2e(e,t,n){let i=n.get(e),o=n.get(e+1)-i;return Sl(t.typedArray,i,o)}function j2e(e,t){let n=e>>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function q2e(e,t,n){let i=e>>3,o=e%8;n?t.typedArray[i]|=1<<o:t.typedArray[i]&=~(1<<o)}function $2e(e,t){let n=t.dataView,i=e*8,o=0,r=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);r&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),o+=c*Math.pow(256,a)}return r&&(o=-o),o}function ePe(e,t){let n=t.dataView,i=e*8,o=BigInt(0),r=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);r&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),o+=BigInt(c)*(BigInt(1)<<BigInt(a*8))}return r&&(o=-o),o}function tPe(e,t){let n=t.dataView,i=e*8,o=n.getUint32(i,!0),r=n.getUint32(i+4,!0);return o+4294967296*r}function nPe(e,t){let n=t.dataView,i=e*8,o=BigInt(n.getUint32(i,!0)),r=BigInt(n.getUint32(i+4,!0));return o+BigInt(4294967296)*r}function iPe(e){switch(e){case sn.INT8:return Q.BYTE;case sn.UINT8:return Q.UNSIGNED_BYTE;case sn.INT16:return Q.SHORT;case sn.UINT16:return Q.UNSIGNED_SHORT;case sn.INT32:return Q.INT;case sn.UINT32:return Q.UNSIGNED_INT;case sn.FLOAT32:return Q.FLOAT;case sn.FLOAT64:return Q.DOUBLE}}function Mne(e){if(l(e._unpackedValues))return!1;let t=e._classProperty,n=t.type,i=t.valueType;return n===Ht.STRING||i===sn.INT64&&!Bt.supportsBigInt64Array()||i===sn.UINT64&&!Bt.supportsBigUint64Array()}function oPe(e,t,n){if(Mne(e))return!0;let i=e._arrayOffsets;if(l(i)){let o=i.get(t+1)-i.get(t),r=n.length;if(o!==r)return!0}return!1}function Nne(e){e._unpackedValues=rPe(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function rPe(e){let t=e._count,n=new Array(t),i=e._classProperty,o=i.isArray,r=i.type,s=Ht.getComponentCount(r);if(!o&&s===1){for(let a=0;a<t;++a)n[a]=e._getValue(a);return n}for(let a=0;a<t;a++)n[a]=Ane(e,i,a);return n}function sPe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:Mb.valueTransformInPlace(t,e._offset,e._scale,sn.applyValueTransform)}function aPe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:Mb.valueTransformInPlace(t,e._offset,e._scale,sn.unapplyValueTransform)}function hY(e,t,n){let i=this,o,r,s;if(t===sn.INT64)Bt.supportsBigInt()?Bt.supportsBigInt64Array()?(o=new BigInt64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return ePe(a,i)}):(Ft("INT64 type is not fully supported on this platform. Values greater than 2^53 - 1 or less than -(2^53 - 1) may lose precision when read."),o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return $2e(a,i)});else if(t===sn.UINT64)Bt.supportsBigInt()?Bt.supportsBigUint64Array()?(o=new BigUint64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return nPe(a,i)}):(Ft("UINT64 type is not fully supported on this platform. Values greater than 2^53 - 1 may lose precision when read."),o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return tPe(a,i)});else{let a=iPe(t);o=Q.createArrayBufferView(a,e.buffer,e.byteOffset,n),s=function(c,d){i.typedArray[c]=d}}l(r)||(r=function(a){return i.typedArray[a]}),this.typedArray=o,this.dataView=new DataView(o.buffer,o.byteOffset),this.get=r,this.set=s,this._componentType=t}var qE=jE;function Im(e){e=g(e,g.EMPTY_OBJECT);let t=e.count,n=e.class,i=0,o={};if(l(e.properties)){for(let r in e.properties)if(e.properties.hasOwnProperty(r)){let s=new qE({count:t,property:e.properties[r],classProperty:n.properties[r],bufferViews:e.bufferViews});o[r]=s,i+=s.byteLength}}this._count=t,this._class=n,this._properties=o,this._byteLength=i}Object.defineProperties(Im.prototype,{count:{get:function(){return this._count}},class:{get:function(){return this._class}},byteLength:{get:function(){return this._byteLength}}});Im.prototype.hasProperty=function(e){return Nn.hasProperty(e,this._properties,this._class)};Im.prototype.hasPropertyBySemantic=function(e){return Nn.hasPropertyBySemantic(e,this._properties,this._class)};Im.prototype.getPropertyIds=function(e){return Nn.getPropertyIds(this._properties,this._class,e)};Im.prototype.getProperty=function(e,t){let n=this._properties[t],i;return l(n)?i=n.get(e):i=cPe(this._class,t),i};Im.prototype.setProperty=function(e,t,n){let i=this._properties[t];return l(i)?(i.set(e,n),!0):!1};Im.prototype.getPropertyBySemantic=function(e,t){let n,i=this._class.propertiesBySemantic;if(l(i)&&(n=i[t]),l(n))return this.getProperty(e,n.id)};Im.prototype.setPropertyBySemantic=function(e,t,n){let i,o=this._class.propertiesBySemantic;return l(o)&&(i=o[t]),l(i)?this.setProperty(e,i.id,n):!1};Im.prototype.getPropertyTypedArray=function(e){let t=this._properties[e];if(l(t))return t.getTypedArray()};Im.prototype.getPropertyTypedArrayBySemantic=function(e){let t,n=this._class.propertiesBySemantic;if(l(n)&&(t=n[e]),l(t))return this.getPropertyTypedArray(t.id)};function cPe(e,t){let n=e.properties;if(!l(n))return;let i=n[t];if(l(i)&&l(i.default)){let o=i.default;return i.isArray&&(o=ze(o,!0)),o=i.normalize(o),i.unpackVectorAndMatrixTypes(o)}}var Ll=Im;var Ysn=T(S(),1);var Xen=T(S(),1);var Cen=T(S(),1);function Nb(){}Object.defineProperties(Nb.prototype,{cacheKey:{get:function(){fe.throwInstantiationError()}}});Nb.prototype.load=function(){fe.throwInstantiationError()};Nb.prototype.unload=function(){};Nb.prototype.process=function(e){return!1};Nb.prototype.getError=function(e,t){l(t)&&l(t.message)&&(e+=`
${t.message}`);let n=new me(e);return l(t)&&(n.stack=`Original stack:
${t.stack}
Handler stack:
${n.stack}`),n};Nb.prototype.isDestroyed=function(){return!1};Nb.prototype.destroy=function(){return this.unload(),ue(this)};var co=Nb;var Len=T(S(),1),lPe={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5},Gt=Object.freeze(lPe);function Ap(e){e=g(e,g.EMPTY_OBJECT);let t=e.typedArray,n=e.resource,i=e.cacheKey;this._typedArray=t,this._resource=n,this._cacheKey=i,this._state=Gt.UNLOADED,this._promise=void 0}l(Object.create)&&(Ap.prototype=Object.create(co.prototype),Ap.prototype.constructor=Ap);Object.defineProperties(Ap.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});Ap.prototype.load=async function(){return l(this._promise)?this._promise:l(this._typedArray)?(this._promise=Promise.resolve(this),this._promise):(this._promise=dPe(this),this._promise)};async function dPe(e){let t=e._resource;e._state=Gt.LOADING;try{let n=await Ap._fetchArrayBuffer(t);return e.isDestroyed()?void 0:(e._typedArray=new Uint8Array(n),e._state=Gt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=Gt.FAILED;let i=`Failed to load external buffer: ${t.url}`;throw e.getError(i,n)}}Ap._fetchArrayBuffer=function(e){return e.fetchArrayBuffer()};Ap.prototype.unload=function(){this._typedArray=void 0};var Ax=Ap;var qen=T(S(),1);var ken=T(S());var ven=T(S()),Wen=function(){var e="b9H79TebbbeJq9Geueu9Geub9Gbb9Gvuuuuueu9Gduueu9Gluuuueu9Gvuuuuub9Gouuuuuub9Gluuuub9GiuuueuiKLdilevlevlooroowwvwbDDbelve9Weiiviebeoweuec:W;kekr;RiOo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWVbe8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9c9V919U9KbdE9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949wWV79P9V9UbiY9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWVbl8E9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWV9c9V919U9Kbv8A9TW79O9V9Wt9FW9U9J9V9KW69U9KW949wWV79P9V9UboE9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JWbra9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JW9c9V919U9KbwL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9p9JtbDK9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9r919HtbqL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVT949WbkE9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OWbPa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OW9ttV9P9Wbsa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9WbzK9TW79O9V9Wt9F79W9Ht9P9H29t9VVt9sW9T9H9WbHl79IV9RbODwebcekdQXq:g9sLdbk;3keYu8Jjjjjbcjo9Rgv8Kjjjjbcbhodnalcefae0mbabcbRb:S:kjjbc:GeV86bbavcjdfcbcjdzNjjjb8AdnaiTmbavcjdfadalz:tjjjb8Akabaefhrabcefhwavalfcbcbcjdal9RalcFe0EzNjjjb8Aavavcjdfalz:tjjjbhDcj;abal9UhodndndndndnalTmbaoc;WFbGgecjdaecjd6Ehqcbhkdninakai9pmiaDcjlfcbcjdzNjjjb8Aaqaiak9Rakaqfai6Egxcsfgecl4cifcd4hmadakal2fhPdndndndndnaec9WGgsTmbcbhzcehHaPhOawhAxekdnaxTmbcbhAcehHaPhCinaDaAfRbbhXaDcjlfheaChoaxhQinaeaoRbbgLaX9RgXcetaX;acr4786bbaoalfhoaecefheaLhXaQcufgQmbkaraw9Ram6miawcbamzNjjjbgeTmiaCcefhCaeamfhwaAcefgAal6hHaAal9hmbxvkkaraw9Ram6mvawcbamzNjjjb8AceheinawgXamfhwalaegoSmldnaraw9Ram6mbaocefheawcbamzNjjjb8AaXmekkaoal6hHxekindnaxTmbaDazfRbbhXaDcjlfheaOhoaxhQinaeaoRbbgLaX9RgXcetaX;acr4786bbaoalfhoaecefheaLhXaQcufgQmbkkaraA9Ram6mearaAcbamzNjjjbgKamfgw9RcK6mdcbhYaDcjlfhAinaDcjlfaYfh8AcwhCczhLcehQindndnaQce9hmbcuhoa8ARbbmecbhodninaogecsSmeaecefhoaAaefcefRbbTmbkkcucbaecs6EhoxekaQcetc;:FFFeGhocuaQtcu7cFeGhXcbheinaoaXaAaefRbb9nfhoaecefgecz9hmbkkaoaLaoaL6geEhLaQaCaeEhCaQcetgQcw6mbkdndndndnaCcufPdiebkaKaYco4fgeaeRbbcdciaCclSEaYci4coGtV86bbaCcw9hmeawa8A8Pbb83bbawcwfa8Acwf8Pbb83bbawczfhwxdkaKaYco4fgeaeRbbceaYci4coGtV86bbkdncwaC9TgEmbinawcb86bbawcefhwxbkkcuaCtcu7h8Acbh3aAh5ina5heaEhQcbhoinaeRbbgLa8AcFeGgXaLaX6EaoaCtVhoaecefheaQcufgQmbkawao86bba5aEfh5awcefhwa3aEfg3cz6mbkcbheindnaAaefRbbgoaX6mbawao86bbawcefhwkaecefgecz9hmbkkdnaYczfgYas9pmbaAczfhAaraw9RcL0mekkaYas6meawTmeaOcefhOazcefgzal6hHawhAazalSmixbkkcbhwaHceGTmexikcbhwaHceGmdkaDaPaxcufal2falz:tjjjb8AaxakfhkawmbkcbhoxokcbhoxvkaiTmekcbhoaraw9Ralcaalca0E6mialc8F9nmexdkcbhoaecufca6mdkawcbcaal9RgezNjjjbaefhwkawaDcjdfalz:tjjjbalfab9Rhokavcjof8Kjjjjbaok9heeuaecaaeca0Eabcj;abae9Uc;WFbGgdcjdadcjd6Egdfcufad9Uae2adcl4cifcd4adV2fcefkmbcbabBd:S:kjjbk;rse3u8Jjjjjbc;ae9Rgl8Kjjjjbcbhvdnaici9UgocHfae0mbabcbyd:C:kjjbgrc;GeV86bbalc;abfcFecjezNjjjb8AalcUfgw9cu83ibalc8WfgD9cu83ibalcyfgq9cu83ibalcafgk9cu83ibalcKfgx9cu83ibalczfgm9cu83ibal9cu83iwal9cu83ibabaefc9WfhPabcefgsaofhednaiTmbcmcsarcb9kgzEhHcbhOcbhAcbhCcbhXcbhQindnaeaP9nmbcbhvxikaQcufhvadaCcdtfgoydbhLaocwfydbhKaoclfydbhYcbh8Adndninalc;abfavcsGcitfgoydlhEdndndnaoydbgoaL9hmbaEaYSmekdnaoaY9hmbaEaK9hmba8Acefh8AxekaoaK9hmeaEaL9hmea8Acdfh8Aka8Ac870mdaXcufhvada8AciGcx2goc:y1jjbfydbaCfcdtfydbhEadaocN1jjbfydbaCfcdtfydbhKadaoc:q1jjbfydbaCfcdtfydbhLcbhodnindnalavcsGcdtfydbaE9hmbaohYxdkcuhYavcufhvaocefgocz9hmbkkaEaOSgvaYce9iaYaH9oVgoGh3dndndndndncbcsavEaYaoEgvcs9hmbarce9imbaEaEaAaEcefaASgvEgAcefSmecmcsavEhvkasava8Acdtc;WeGV86bbavcs9hmeaEaA9Rgvcetavc8F917hvinaeavcFb0crtavcFbGV86bbaecefheavcje6hoavcr4hvaoTmbkaEhAxdkcPhvasa8AcdtcPV86bbaEhAkavTmbavaH9imekalaXcdtfaEBdbaXcefcsGhXkaOa3fhOalc;abfaQcitfgvaKBdlavaEBdbalc;abfaQcefcsGgvcitfgoaEBdlaoaLBdbavcefhoxikavcufhva8Aclfg8Ac;ab9hmbkkdnadceaKaOScetaYaOSEcx2gvc:q1jjbfydbaCfcdtfydbgLTadavcN1jjbfydbaCfcdtfydbg8AceSGadavc:y1jjbfydbaCfcdtfydbgYcdSGaOcb9hGazGg5ce9hmbaw9cu83ibaD9cu83ibaq9cu83ibak9cu83ibax9cu83ibam9cu83ibal9cu83iwal9cu83ibcbhOkcbhEaXcufgvhodnindnalaocsGcdtfydba8A9hmbaEhKxdkcuhKaocufhoaEcefgEcz9hmbkkcbhodnindnalavcsGcdtfydbaY9hmbaohExdkcuhEavcufhvaocefgocz9hmbkkaOaLaOSg8Efh3dndnaKcm0mbaKcefhKxekcbcsa8Aa3SgvEhKa3avfh3kdndnaEcm0mbaEcefhExekcbcsaYa3SgvEhEa3avfh3kc9:cua8EEh8FaEaKcltVhocbhvdndndninavcj1jjbfRbbaocFeGSmeavcefgvcz9hmbxdkka5aLaO9havcm0VVmbasavc;WeV86bbxekasa8F86bbaeao86bbaecefhekdna8EmbaLaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombkaLhAkdnaKcs9hmba8AaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka8AhAkdnaEcs9hmbaYaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombkaYhAkalaXcdtfaLBdbaXcefcsGhvdndnaKPzbeeeeeeeeeeeeeebekalavcdtfa8ABdbaXcdfcsGhvkdndnaEPzbeeeeeeeeeeeeeebekalavcdtfaYBdbavcefcsGhvkalc;abfaQcitfgoaLBdlaoa8ABdbalc;abfaQcefcsGcitfgoa8ABdlaoaYBdbalc;abfaQcdfcsGcitfgoaYBdlaoaLBdbaQcifhoavhXa3hOkascefhsaocsGhQaCcifgCai6mbkkcbhvaeaP0mbcbhvinaeavfavcj1jjbfRbb86bbavcefgvcz9hmbkaeab9Ravfhvkalc;aef8KjjjjbavkZeeucbhddninadcefgdc8F0meceadtae6mbkkadcrfcFeGcr9Uci2cdfabci9U2cHfkmbcbabBd:C:kjjbk:ydewu8Jjjjjbcz9Rhlcbhvdnaicvfae0mbcbhvabcbRb:C:kjjbc;qeV86bbal9cb83iwabcefhoabaefc98fhrdnaiTmbcbhwcbhDindnaoar6mbcbskadaDcdtfydbgqalcwfawaqav9Rgvavc8F91gv7av9Rc507gwcdtfgkydb9Rgvc8E91c9:Gavcdt7awVhvinaoavcFb0gecrtavcFbGV86bbavcr4hvaocefhoaembkakaqBdbaqhvaDcefgDai9hmbkkcbhvaoar0mbaocbBbbaoab9RclfhvkavkBeeucbhddninadcefgdc8F0meceadtae6mbkkadcwfcFeGcr9Uab2cvfk:dvli99dui99ludnaeTmbcuadcetcuftcu7:Yhvdndncuaicuftcu7:YgoJbbbZMgr:lJbbb9p9DTmbar:Ohwxekcjjjj94hwkcbhicbhDinalclfIdbgrJbbbbJbbjZalIdbgq:lar:lMalcwfIdbgk:lMgr:varJbbbb9BEgrNhxaqarNhralcxfIdbhqdndnakJbbbb9GTmbaxhkxekJbbjZar:l:tgkak:maxJbbbb9GEhkJbbjZax:l:tgxax:marJbbbb9GEhrkdndnaqJbbj:;aqJbbj:;9GEgxJbbjZaxJbbjZ9FEavNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohmxekcjjjj94hmkdndnakJbbj:;akJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;akJbbbb9GEMgq:lJbbb9p9DTmbaq:OhPxekcjjjj94hPkdndnarJbbj:;arJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;arJbbbb9GEMgr:lJbbb9p9DTmbar:Ohsxekcjjjj94hskdndnadcl9hmbabaifgzas86bbazcifam86bbazcdfaw86bbazcefaP86bbxekabaDfgzas87ebazcofam87ebazclfaw87ebazcdfaP87ebkalczfhlaiclfhiaDcwfhDaecufgembkkk;klld99eud99eudnaeTmbdndncuaicuftcu7:YgvJbbbZMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikaic;8FiGhrinabcofcicdalclfIdb:lalIdb:l9EgialcwfIdb:lalaicdtfIdb:l9EEgialcxfIdb:lalaicdtfIdb:l9EEgiarV87ebdndnalaicefciGcdtfIdbJ;Zl:1ZNJbbj:;JbbjZalaicdtfIdbJbbbb9DEgoNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabaq87ebdndnaoalaicdfciGcdtfIdbJ;Zl:1ZNNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabcdfaq87ebdndnaoalaicufciGcdtfIdbJ;Zl:1ZNNgoJbbj:;aoJbbj:;9GEgwJbbjZawJbbjZ9FEavNJbbbZJbbb:;aoJbbbb9GEMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikabclfai87ebabcwfhbalczfhlaecufgembkkk:Hvdxue998Jjjjjbcjd9Rgo8Kjjjjbadcd4hrdndndndnavcd9hmbadcl6mearcearce0EhwaohDinaDc:CuBdbaDclfhDawcufgwmbkaeTmiadcl6mdarcearce0EhqarcdthkalhxcbhminaohDaxhwaqhPinaDaDydbgsawydbgzcL4cFeGc:cufcbazEgzasaz9kEBdbawclfhwaDclfhDaPcufgPmbkaxakfhxamcefgmae9hmbkkaeTmdxekaeTmekavcb9hadcl6gqVhHarcearce0Ehkarcdthrceai9Rhmcbhdindndndnavce9hmbaqmdc:CuhwalhDakhPinawaDydbgscL4cFeGc:cufcbasEgsawas9kEhwaDclfhDaPcufgPmbxdkkc:CuhwaHmbaohDalhPakhsinaDaPydbgzcL4cFeGgxc8Aaxc8A9kEc:cufcbazEBdbaPclfhPaDclfhDascufgsmbkkaqmbcbhDakhsinawhPdnavceSmbaoaDfydbhPkdndnalaDfIdbgOcjjj;8iamaPfgPcLt9R::NJbbbZJbbb:;aOJbbbb9GEMgO:lJbbb9p9DTmbaO:Ohzxekcjjjj94hzkabaDfazcFFFrGaPcKtVBdbaDclfhDascufgsmbkkabarfhbalarfhladcefgdae9hmbkkaocjdf8KjjjjbkFkdCui998Jjjjjbc:Gd9Rgv8Kjjjjbavc:4efcbc;KbzNjjjb8AcbhodnadTmbcbhoaiTmbdnabae9hmbavcuadcdtgoadcFFFFi0Ecbyd:K:kjjbHjjjjbbgeBd:4eavceBd:ydaeabaoz:tjjjb8Akavc:OefcwfcbBdbav9cb83i:Oeavc:Oefaeadaiavc:4efz:njjjbcuaicdtgraicFFFFi0Egwcbyd:K:kjjbHjjjjbbhoavc:4efavyd:ydgDcdtfaoBdbavaDcefgqBd:ydaoavyd:Oegkarz:tjjjbhxavc:4efaqcdtfadci9Ugmcbyd:K:kjjbHjjjjbbgoBdbavaDcdfgrBd:ydaocbamzNjjjbhPavc:4efarcdtfawcbyd:K:kjjbHjjjjbbgsBdbavaDcifgqBd:ydaxhoashrinaralIdbalaoydbgwcwawcw6Ecdtfc;ebfIdbMUdbaoclfhoarclfhraicufgimbkavc:4efaqcdtfcuamcdtadcFFFF970Ecbyd:K:kjjbHjjjjbbgqBdbavaDclfBd:yddnadci6mbamceamce0EhiaehoaqhrinarasaoydbcdtfIdbasaoclfydbcdtfIdbMasaocwfydbcdtfIdbMUdbaocxfhoarclfhraicufgimbkkavc;qbfhzavhoavyd:SehHavyd:WehOcbhwcbhrcbhAcehCinaohXcihQaearci2gLcdtfgocwfydbhdaoydbhDabaAcx2fgiclfaoclfydbgKBdbaiaDBdbaicwfadBdbaParfce86bbazadBdwazaKBdlazaDBdbaqarcdtfcbBdbdnawTmbcihQaXhiinazaQcdtfaiydbgoBdbaQaoaD9haoaK9hGaoad9hGfhQaiclfhiawcufgwmbkkaAcefhAaxaDcdtfgoaoydbcufBdbaxaKcdtfgoaoydbcufBdbaxadcdtfgoaoydbcufBdbcbhwinaOaHaeawaLfcdtfydbcdtgifydbcdtfgKhoakaifgDydbgdhidnadTmbdninaoydbarSmeaoclfhoaicufgiTmdxbkkaoadcdtaKfc98fydbBdbaDaDydbcufBdbkawcefgwci9hmbkdndndnaQTmbcuhrJbbbbhYcbhDavyd:SehKavyd:WehLindndnakazaDcdtfydbcdtgofydbgimbaDcefhDxekaDcs0hwasaofgdIdbh8AadalcbaDcefgDawEcdtfIdbalaxaofydbgwcwawcw6Ecdtfc;ebfIdbMgEUdbaEa8A:thEaicdthiaLaKaofydbcdtfhoinaqaoydbgwcdtfgdaEadIdbMg8AUdba8AaYaYa8A9DgdEhYawaradEhraoclfhoaic98fgimbkkaDaQ9hmbkarcu9hmekaCam9pmeindnaPaCfRbbmbaChrxdkamaCcefgC9hmbxdkkaQczaQcz6EhwazhoaXhzarcu9hmekkavyd:ydhokaocdtavc:4effc98fhrdninaoTmearydbcbyd:G:kjjbH:bjjjbbarc98fhraocufhoxbkkavc:Gdf8Kjjjjbk;UlevucuaicdtgvaicFFFFi0Egocbyd:K:kjjbHjjjjbbhralalyd9GgwcdtfarBdbalawcefBd9GabarBdbaocbyd:K:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdlcuadcdtadcFFFFi0Ecbyd:K:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdwabydbcbavzNjjjb8Aadci9UhwdnadTmbabydbhoaehladhrinaoalydbcdtfgvavydbcefBdbalclfhlarcufgrmbkkdnaiTmbabydbhlabydlhrcbhvaihoinaravBdbarclfhralydbavfhvalclfhlaocufgombkkdnadci6mbawceawce0EhDabydlhrabydwhvcbhlinaecwfydbhoaeclfydbhdaraeydbcdtfgwawydbgwcefBdbavawcdtfalBdbaradcdtfgdadydbgdcefBdbavadcdtfalBdbaraocdtfgoaoydbgocefBdbavaocdtfalBdbaecxfheaDalcefgl9hmbkkdnaiTmbabydlheabydbhlinaeaeydbalydb9RBdbalclfhlaeclfheaicufgimbkkkQbabaeadaic:01jjbz:mjjjbkQbabaeadaic:C:jjjbz:mjjjbk9DeeuabcFeaicdtzNjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk;:kivuo99lu8Jjjjjbcj;Hb9Rgl8Kjjjjbcbhvalc1;Gbfcbc;KbzNjjjb8AalcuadcdtadcFFFFi0Egocbyd:K:kjjbHjjjjbbgrBd19GalceBd;O9Galcwfcbyd:m:kjjbBdbalcb8Pd:e:kjjb83ibalc;W;Gbfcwfcbyd:y:kjjbBdbalcb8Pd:q:kjjb83i;W9Gaicd4hwdndnadmbJFFuFhDJFFuuhqJFFuuhkJFFuFhxJFFuuhmJFFuFhPxekawcdthsaehzincbhiinalaifgHazaifIdbgDaHIdbgxaxaD9EEUdbalc;W;GbfaifgHaDaHIdbgxaxaD9DEUdbaiclfgicx9hmbkazasfhzavcefgvad9hmbkalIdwhqalId;49GhDalIdlhkalId;09GhxalIdbhmalId;W9GhPkdndnadTmbJbbbbJbbjZaPam:tJbbbb:xgPaxak:tgxaxaP9DEgxaDaq:tgDaDax9DEgD:vaDJbbbb9BEhDawcdthsarhHadhzindndnaDaeIdbam:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcv2c;j:KM;jbGhvdndnaDaeclfIdbak:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcq2cM;j:KMeGavVhvdndnaDaecwfIdbaq:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaHavaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcC2c:KM;j:KdGVBdbaeasfheaHclfhHazcufgzmbkalcbcj;GbzNjjjbhiarhHadheinaiaHydbgzcFrGcx2fgvavydbcefBdbaiazcq4cFrGcx2fgvavydlcefBdlaiazcC4cFrGcx2fgzazydwcefBdwaHclfhHaecufgembxdkkalcbcj;GbzNjjjb8AkcbhHcbhzcbhecbhvinalaHfgiydbhsaiazBdbaicwfgwydbhOawavBdbaiclfgiydbhwaiaeBdbasazfhzaOavfhvawaefheaHcxfgHcj;Gb9hmbkcbhialaocbyd:K:kjjbHjjjjbbgzBd:m9GdnadTmbabhHinaHaiBdbaHclfhHadaicefgi9hmbkadTmbabhiadhHinalaraiydbgecdtfydbcFrGcx2fgvavydbgvcefBdbazavcdtfaeBdbaiclfhiaHcufgHmbkazhiadhHinalaraiydbgecdtfydbcq4cFrGcx2fgvavydlgvcefBdlabavcdtfaeBdbaiclfhiaHcufgHmbkabhiadhHinalaraiydbgecdtfydbcC4cFrGcx2fgvavydwgvcefBdwazavcdtfaeBdbaiclfhiaHcufgHmbkadTmbcbhiinabazydbcdtfaiBdbazclfhzadaicefgi9hmbkkclhidninaic98Smealc1;Gbfaifydbcbyd:G:kjjbH:bjjjbbaic98fhixbkkalcj;Hbf8Kjjjjbk9teiucbcbyd:O:kjjbgeabcifc98GfgbBd:O:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:O:kjjbgeabcrfc94GfgbBd:O:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd:O:kjjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd:O:kjjbfgdBd:O:kjjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akkk:6ddbcjwk:Cdb4:h9w9N94:P:gW:j9O:ye9Pbbbbbbebbbdbbbebbbdbbbbbbbdbbbbbbbebbbbbbb:l29hZ;69:9kZ;N;76Z;rg97Z;z;o9xZ8J;B85Z;:;u9yZ;b;k9HZ:2;Z9DZ9e:l9mZ59A8KZ:r;T3Z:A:zYZ79OHZ;j4::8::Y:D9V8:bbbb9s:49:Z8R:hBZ9M9M;M8:L;z;o8:;8:PG89q;x:J878R:hQ8::M:B;e87bbbbbbjZbbjZbbjZ:E;V;N8::Y:DsZ9i;H;68:xd;R8:;h0838:;W:NoZbbbb:WV9O8:uf888:9i;H;68:9c9G;L89;n;m9m89;D8Ko8:bbbbf:8tZ9m836ZS:2AZL;zPZZ818EZ9e:lxZ;U98F8:819E;68:FFuuFFuuFFuuFFuFFFuFFFuFbc:Cqkzebbbebbbdbbb8WWbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(y){n=y.instance,n.exports.__wasm_call_ctors(),n.exports.meshopt_encodeVertexVersion(0),n.exports.meshopt_encodeIndexVersion(1)});function o(y){for(var f=new Uint8Array(y.length),x=0;x<y.length;++x){var _=y.charCodeAt(x);f[x]=_>96?_-97:_>64?_-39:_+4}for(var C=0,x=0;x<y.length;++x)f[C++]=f[x]<60?t[f[x]]:(f[x]-60)*64+f[++x];return f.buffer.slice(0,C)}function r(y){if(!y)throw new Error("Assertion failed")}function s(y){return new Uint8Array(y.buffer,y.byteOffset,y.byteLength)}function a(y,f,x,_){var C=n.exports.sbrk,V=C(f.length*4),L=C(x*4),Z=new Uint8Array(n.exports.memory.buffer),G=s(f);Z.set(G,V),_&&_(V,V,f.length,x);var I=y(L,V,f.length,x);Z=new Uint8Array(n.exports.memory.buffer);var P=new Uint32Array(x);new Uint8Array(P.buffer).set(Z.subarray(L,L+x*4)),G.set(Z.subarray(V,V+f.length*4)),C(V-C(0));for(var v=0;v<f.length;++v)f[v]=P[f[v]];return[P,I]}function c(y,f,x,_){var C=n.exports.sbrk,V=C(x*4),L=C(x*_),Z=new Uint8Array(n.exports.memory.buffer);Z.set(s(f),L),y(V,L,x,_),Z=new Uint8Array(n.exports.memory.buffer);var G=new Uint32Array(x);return new Uint8Array(G.buffer).set(Z.subarray(V,V+x*4)),C(V-C(0)),G}function d(y,f,x,_,C){var V=n.exports.sbrk,L=V(f),Z=V(_*C),G=new Uint8Array(n.exports.memory.buffer);G.set(s(x),Z);var I=y(L,f,Z,_,C),P=new Uint8Array(I);return P.set(G.subarray(L,L+I)),V(L-V(0)),P}function u(y){for(var f=0,x=0;x<y.length;++x){var _=y[x];f=f<_?_:f}return f}function m(y,f){if(r(f==2||f==4),f==4)return new Uint32Array(y.buffer,y.byteOffset,y.byteLength/4);var x=new Uint16Array(y.buffer,y.byteOffset,y.byteLength/2);return new Uint32Array(x)}function p(y,f,x,_,C,V,L){var Z=n.exports.sbrk,G=Z(x*_),I=Z(x*V),P=new Uint8Array(n.exports.memory.buffer);P.set(s(f),I),y(G,x,_,C,I,L);var v=new Uint8Array(x*_);return v.set(P.subarray(G,G+x*_)),Z(G-Z(0)),v}return{ready:i,supported:!0,reorderMesh:function(y,f,x){var _=f?x?n.exports.meshopt_optimizeVertexCacheStrip:n.exports.meshopt_optimizeVertexCache:void 0;return a(n.exports.meshopt_optimizeVertexFetchRemap,y,u(y)+1,_)},reorderPoints:function(y,f){return r(y instanceof Float32Array),r(y.length%f==0),r(f>=3),c(n.exports.meshopt_spatialSortRemap,y,y.length/f,f*4)},encodeVertexBuffer:function(y,f,x){r(x>0&&x<=256),r(x%4==0);var _=n.exports.meshopt_encodeVertexBufferBound(f,x);return d(n.exports.meshopt_encodeVertexBuffer,_,y,f,x)},encodeIndexBuffer:function(y,f,x){r(x==2||x==4),r(f%3==0);var _=m(y,x),C=n.exports.meshopt_encodeIndexBufferBound(f,u(_)+1);return d(n.exports.meshopt_encodeIndexBuffer,C,_,f,4)},encodeIndexSequence:function(y,f,x){r(x==2||x==4);var _=m(y,x),C=n.exports.meshopt_encodeIndexSequenceBound(f,u(_)+1);return d(n.exports.meshopt_encodeIndexSequence,C,_,f,4)},encodeGltfBuffer:function(y,f,x,_){var C={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return r(C[_]),C[_](y,f,x)},encodeFilterOct:function(y,f,x,_){return r(x==4||x==8),r(_>=1&&_<=16),p(n.exports.meshopt_encodeFilterOct,y,f,x,_,16)},encodeFilterQuat:function(y,f,x,_){return r(x==8),r(_>=4&&_<=16),p(n.exports.meshopt_encodeFilterQuat,y,f,x,_,16)},encodeFilterExp:function(y,f,x,_,C){r(x>0&&x%4==0),r(_>=1&&_<=24);var V={Separate:0,SharedVector:1,SharedComponent:2};return p(n.exports.meshopt_encodeFilterExp,y,f,x,_,x,C?V[C]:1)}}}();var Fen=T(S()),Une=function(){var e="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q;iekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq;d8Yqdbk:yzeHu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9UhlaicefhodnadTmbalc;WFbGglcjdalcjd6EhDcbhqinaqae9pmeaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxdndndndnalc9WGgmTmbcbhPcehsawcjdfhzaohHinaraH9Rax6midnaraHaxfgo9RcK6mbczhlcbhOinalgic9WfgAawcj;cbffhldndndndndnaHaAco4fRbbaOcoG4ciGPlbedibkal9cb83ibalcwf9cb83ibxikalaoRblaoRbbgAco4gCaCciSgCE86bbawcj;cbfaifglcGfaoclfaCfgCRbbaAcl4ciGgXaXciSgXE86bbalcVfaCaXfgCRbbaAcd4ciGgXaXciSgXE86bbalc7faCaXfgCRbbaAciGgAaAciSgAE86bbalctfaCaAfgCRbbaoRbegAco4gXaXciSgXE86bbalc91faCaXfgCRbbaAcl4ciGgXaXciSgXE86bbalc4faCaXfgCRbbaAcd4ciGgXaXciSgXE86bbalc93faCaXfgCRbbaAciGgAaAciSgAE86bbalc94faCaAfgCRbbaoRbdgAco4gXaXciSgXE86bbalc95faCaXfgCRbbaAcl4ciGgXaXciSgXE86bbalc96faCaXfgCRbbaAcd4ciGgXaXciSgXE86bbalc97faCaXfgCRbbaAciGgAaAciSgAE86bbalc98faCaAfgARbbaoRbigoco4gCaCciSgCE86bbalc99faAaCfgARbbaocl4ciGgCaCciSgCE86bbalc9:faAaCfgARbbaocd4ciGgCaCciSgCE86bbalcufaAaCfglRbbaociGgoaociSgoE86bbalaofhoxdkalaoRbwaoRbbgAcl4gCaCcsSgCE86bbawcj;cbfaifglcGfaocwfaCfgCRbbaAcsGgAaAcsSgAE86bbalcVfaCaAfgARbbaoRbegCcl4gXaXcsSgXE86bbalc7faAaXfgARbbaCcsGgCaCcsSgCE86bbalctfaAaCfgARbbaoRbdgCcl4gXaXcsSgXE86bbalc91faAaXfgARbbaCcsGgCaCcsSgCE86bbalc4faAaCfgARbbaoRbigCcl4gXaXcsSgXE86bbalc93faAaXfgARbbaCcsGgCaCcsSgCE86bbalc94faAaCfgARbbaoRblgCcl4gXaXcsSgXE86bbalc95faAaXfgARbbaCcsGgCaCcsSgCE86bbalc96faAaCfgARbbaoRbvgCcl4gXaXcsSgXE86bbalc97faAaXfgARbbaCcsGgCaCcsSgCE86bbalc98faAaCfgARbbaoRbogCcl4gXaXcsSgXE86bbalc99faAaXfgARbbaCcsGgCaCcsSgCE86bbalc9:faAaCfgARbbaoRbrgocl4gCaCcsSgCE86bbalcufaAaCfglRbbaocsGgoaocsSgoE86bbalaofhoxekalao8Pbb83bbalcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaOcdfhOaiczfhlarao9RcL0mekkaiam6miaoTmidnakTmbawaPfRbbhOawcj;cbfhlazhiakhAinaialRbbgHce4cbaHceG9R7aOfgO86bbaiadfhialcefhlaAcufgAmbkkazcefhzaPcefgPad6hsaohHaPad9hmexvkkcbhoasceGmdxikaoaxad2fhXdnakTmbcbhmcehsawcjdfhCinarao9Rax6miaoTmdaoaxfhoawamfRbbhOawcj;cbfhlaChiakhAinaialRbbgHce4cbaHceG9R7aOfgO86bbaiadfhialcefhlaAcufgAmbkaCcefhCamcefgmad6hsamad9hmbkaXhoxikcbhlcehsinarao9Rax6mdaoTmeaoaxfhoalcefglad6hsadal9hmbkaXhoxdkcbhoasceGTmekc9:hoxikabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekcbc99arao9Radcaadca0ESEhokavcj;ebf8Kjjjjbaok;xzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfalaDcu7gPcl4fcsGcitfgsydlhzasydbhHdnaDcsGgDak9pmbavaiaPfcsGcdtfydbaxaDEhsaDThDdndnadcd9hmbabarcetfgPaH87ebaPcdfaz87ebaPclfas87ebxekabarcdtfgPaHBdbaPclfazBdbaPcwfasBdbkaxaDfhxavc;abfalcitfgPasBdbaPazBdlavaicdtfasBdbavc;abfalcefcsGglcitfgPaHBdbaPasBdlaiaDfhialcefhlxdkdndnaDcsSmbamaDfaDc987fcefhmxekaocefhDao8SbbgscFeGhPdndnascu9mmbaDhoxekaocvfhoaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhokaPce4cbaPceG9R7amfhmkdndnadcd9hmbabarcetfgDaH87ebaDcdfaz87ebaDclfam87ebxekabarcdtfgDaHBdbaDclfazBdbaDcwfamBdbkavc;abfalcitfgDamBdbaDazBdlavaicdtfamBdbavc;abfalcefcsGglcitfgDaHBdbaDamBdlaicefhialcefhlxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHcdfaD87ebaHclfas87ebxekabarcdtfgHaxBdbaHclfaDBdbaHcwfasBdbkavaicdtfaxBdbavc;abfalcitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfalcefcsGcitfgHasBdbaHaDBdlavaiaPfcsGgicdtfasBdbavc;abfalcdfcsGglcitfgDaxBdbaDasBdlalcefhlaiaOfhiazaOfhxxekaxcbaoRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbaocefhDxekaocdfhDao8SbegPcFeGhsdnaPcu9kmbaocofhAascFbGhscrhodninaD8SbbgPcFbGaotasVhsaPcu9kmeaDcefhDaocrfgoc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbgocFeGhPdnaocu9kmbaDcvfhzaPcFbGhPcrhodninas8SbbgDcFbGaotaPVhPaDcu9kmeascefhsaocrfgoc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashoxekascefhoas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninao8SbbgscFbGaDtaPVhPascu9kmeaocefhoaDcrfgDc8J9hmbkaOhoxekaocefhokaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDcdfaz87ebaDclfaO87ebxekabarcdtfgDaABdbaDclfazBdbaDcwfaOBdbkavc;abfalcitfgDazBdbaDaABdlavaicdtfaABdbavc;abfalcefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfalcdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiarcifgrae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;siliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabaiavcefciGfcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:Ohkxekcjjjj94hkkabaiavcdfciGfcetfak87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:Ohqxekcjjjj94hqkabaiavcufciGfcetfaq87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohqxekcjjjj94hqkabaiavciGfcetfaq87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklz9Kbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q;Aekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq;b9tqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk;e8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhwcbhDinaDae9pmeawaeaD9RaDawfae6Egqcsfgoc9WGgkci2hxakcethmaocl4cifcd4hPabaDad2fhscbhzdnincbhHalhOcbhAdninaraO9RaP6miavcj;cbfaAak2fhCaOaPfhlcbhidnakc;ab6mbaral9Rc;Gb6mbcbhoinaCaofhidndndndndnaOaoco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklbalczfhlkdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklzalczfhlkdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklaalczfhlkdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalclfaYpQbfaXc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalcwfaYpQbfaXc:q:yjjbfRbbfhlxekaialpbbbpkl8Walczfhlkaoc;abfhiaocjefak0meaihoaral9Rc;Fb0mbkkdndnaiak9pmbaici4hoinaral9RcK6mdaCaifhXdndndndndnaOaico4fRbbaocoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpklbxikaXalpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaXalpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q: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ibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfhiaXczfgXak6mbkkazclfgzad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfhDc9:hoalmexikkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk;tzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfalaDcu7gPcl4fcsGcitfgsydlhzasydbhHdnaDcsGgDak9pmbavaiaPfcsGcdtfydbaxaDEhsaDThDdndnadcd9hmbabarcetfgPaH87ebaPcdfaz87ebaPclfas87ebxekabarcdtfgPaHBdbaPclfazBdbaPcwfasBdbkaxaDfhxavc;abfalcitfgPasBdbaPazBdlavaicdtfasBdbavc;abfalcefcsGglcitfgPaHBdbaPasBdlaiaDfhialcefhlxdkdndnaDcsSmbamaDfaDc987fcefhmxekaocefhDao8SbbgscFeGhPdndnascu9mmbaDhoxekaocvfhoaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhokaPce4cbaPceG9R7amfhmkdndnadcd9hmbabarcetfgDaH87ebaDcdfaz87ebaDclfam87ebxekabarcdtfgDaHBdbaDclfazBdbaDcwfamBdbkavc;abfalcitfgDamBdbaDazBdlavaicdtfamBdbavc;abfalcefcsGglcitfgDaHBdbaDamBdlaicefhialcefhlxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHcdfaD87ebaHclfas87ebxekabarcdtfgHaxBdbaHclfaDBdbaHcwfasBdbkavaicdtfaxBdbavc;abfalcitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfalcefcsGcitfgHasBdbaHaDBdlavaiaPfcsGgicdtfasBdbavc;abfalcdfcsGglcitfgDaxBdbaDasBdlalcefhlaiaOfhiazaOfhxxekaxcbaoRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbaocefhDxekaocdfhDao8SbegPcFeGhsdnaPcu9kmbaocofhAascFbGhscrhodninaD8SbbgPcFbGaotasVhsaPcu9kmeaDcefhDaocrfgoc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbgocFeGhPdnaocu9kmbaDcvfhzaPcFbGhPcrhodninas8SbbgDcFbGaotaPVhPaDcu9kmeascefhsaocrfgoc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashoxekascefhoas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninao8SbbgscFbGaDtaPVhPascu9kmeaocefhoaDcrfgDc8J9hmbkaOhoxekaocefhokaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDcdfaz87ebaDclfaO87ebxekabarcdtfgDaABdbaDclfazBdbaDcwfaOBdbkavc;abfalcitfgDazBdbaDaABdlavaicdtfaABdbavc;abfalcefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfalcdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiarcifgrae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:wPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalae9pmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oawaopmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalae9pmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oawaopmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalae9pmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbadczfhdaeclfgeav6mbkkdnaval9pmbaialciGgecdtgdVcbc;abad9R;8kbaiabavcdtfgvad;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepklbkavaiad;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz9Tbb",n=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var o=WebAssembly.validate(n)?t:e,r,s=WebAssembly.instantiate(a(o),{}).then(function(C){r=C.instance,r.exports.__wasm_call_ctors()});function a(C){for(var V=new Uint8Array(C.length),L=0;L<C.length;++L){var Z=C.charCodeAt(L);V[L]=Z>96?Z-97:Z>64?Z-39:Z+4}for(var G=0,L=0;L<C.length;++L)V[G++]=V[L]<60?i[V[L]]:(V[L]-60)*64+V[++L];return V.buffer.slice(0,G)}function c(C,V,L,Z,G,I,P){var v=C.exports.sbrk,F=Z+3&-4,M=v(F*G),b=v(I.length),R=new Uint8Array(C.exports.memory.buffer);R.set(I,b);var E=V(M,Z,G,b,I.length);if(E==0&&P&&P(M,F,G),L.set(R.subarray(M,M+Z*G)),v(M-v(0)),E!=0)throw new Error("Malformed buffer data: "+E)}var d={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},u={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},m=[],p=0;function y(C){var V={object:new Worker(C),pending:0,requests:{}};return V.object.onmessage=function(L){var Z=L.data;V.pending-=Z.count,V.requests[Z.id][Z.action](Z.value),delete V.requests[Z.id]},V}function f(C){for(var V="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(a(o))+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+_.name+";"+c.toString()+_.toString(),L=new Blob([V],{type:"text/javascript"}),Z=URL.createObjectURL(L),G=m.length;G<C;++G)m[G]=y(Z);for(var G=C;G<m.length;++G)m[G].object.postMessage({});m.length=C,URL.revokeObjectURL(Z)}function x(C,V,L,Z,G){for(var I=m[0],P=1;P<m.length;++P)m[P].pending<I.pending&&(I=m[P]);return new Promise(function(v,F){var M=new Uint8Array(L),b=++p;I.pending+=C,I.requests[b]={resolve:v,reject:F},I.object.postMessage({id:b,count:C,size:V,source:M,mode:Z,filter:G},[M.buffer])})}function _(C){var V=C.data;if(!V.id)return self.close();self.ready.then(function(L){try{var Z=new Uint8Array(V.count*V.size);c(L,L.exports[V.mode],Z,V.count,V.size,V.source,L.exports[V.filter]),self.postMessage({id:V.id,count:V.count,action:"resolve",value:Z},[Z.buffer])}catch(G){self.postMessage({id:V.id,count:V.count,action:"reject",value:G})}})}return{ready:s,supported:!0,useWorkers:function(C){f(C)},decodeVertexBuffer:function(C,V,L,Z,G){c(r,r.exports.meshopt_decodeVertexBuffer,C,V,L,Z,r.exports[d[G]])},decodeIndexBuffer:function(C,V,L,Z){c(r,r.exports.meshopt_decodeIndexBuffer,C,V,L,Z)},decodeIndexSequence:function(C,V,L,Z){c(r,r.exports.meshopt_decodeIndexSequence,C,V,L,Z)},decodeGltfBuffer:function(C,V,L,Z,G,I){c(r,r.exports[u[G]],C,V,L,Z,r.exports[d[I]])},decodeGltfBufferAsync:function(C,V,L,Z,G){return m.length>0?x(C,V,L,u[Z],d[G]):s.then(function(){var I=new Uint8Array(C*V);return c(r,r.exports[u[Z]],I,C,V,L,r.exports[d[G]]),I})}}}();var Nen=T(S()),Aen=function(){var e="b9H79Tebbbe9Ek9Geueu9Geub9Gbb9GPuuuuuuuuuuu99uueu9Gvuuuuub9Gluuuub9Gquuuuuuu99uueu9Gwuuuuuu99ueu9Giuuue999Gluuuueu9GiuuueuizsdilvoirwDbqqbeqlve9Weiiviebeoweuec:G;jekr:Tewo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95bl8E9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9OcttV9P9I91tW7bvQ9TW79O9V9Wt9F79P9T9W29P9M959q9V9P9Ut7boX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2Wbra9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T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meaLas9Rh8Lascu7aLfhYaha3fhLcbhsinaYasSmeascefhsaLydbh3aLcwfhLa3aQ9hmbkasa8L6mekaaa8KfgsaQa5asydbcuSEBdbaKa5aQaKydbcuSEBdbka8Acefg8AaO9hmbkka8Eal9hmbkaChLaXhQaah3a8Fh8AcbhsindndnasaLydbg59hmbdnasaQydbg59hmba8Aydbh5dna3ydbgYcu9hmba5cu9hmbaEasfcb86bbxikaEasfhKdnasaYSmbasa5SmbaKce86bbxikaKcl86bbxdkdnasaXa5cdtgYfydb9hmbdna3ydbgKcuSmbasaKSmba8AydbgOcuSmbasaOSmbaaaYfydbggcuSmbaga5Smba8FaYfydbgYcuSmbaYa5SmbdnaCaKcdtfydbaCaYcdtfydb9hmbaCaOcdtfydbaCagcdtfydb9hmbaEasfcd86bbxlkaEasfcl86bbxikaEasfcl86bbxdkaEasfcl86bbxekaEasfaEa5fRbb86bbkaLclfhLaQclfhQa3clfh3a8Aclfh8Aalascefgs9hmbkaxceGTmbaEhsalhLindnasRbbce9hmbascl86bbkascefhsaLcufgLmbkkcualcx2alc;v:Q;v:Qe0Ecbyd1:jjjbHjjjjbbh8JaPcwfaPyd9Ogscdtfa8JBdbaPascefgOBd9Oa8Jaialavz:djjjbdndnaDmbcbhvxekcbh5aPcwfaOcdtfcuaDal2gLcdtaLcFFFFi0Ecbyd1:jjjbHjjjjbbgvBdbaPascdfgOBd9OalTmbarcd4cdthYaDcdthKavh8AinaohsawhLa8AhQaDh3inaQasIdbaLIdbNUdbasclfhsaLclfhLaQclfhQa3cufg3mbkaoaYfhoa8AaKfh8Aa5cefg5al9hmbkkaPcwfaOcdtfcualc8S2gsalc;D;O;f8U0EgQcbyd1:jjjbHjjjjbbgLBdbaPaOcefg3Bd9OaLcbasz:ljjjbh8EdndndnaDTmbaPcwfa3cdtfaQcbyd1:jjjbHjjjjbbgoBdbaPaOcdfgLBd9Oaocbasz:ljjjb8AaPcwfaLcdtfcuaDal2gscltgLascFFFFb0Ecbyd1:jjjbHjjjjbbgwBdbaPaOcifBd9OawcbaLz:ljjjb8AadmexdkcbhocbhwadTmekcbh8AaehLindna8JaLclfydbg5cx2fgsIdba8JaLydbgYcx2fgQIdbg8M:tg8Na8JaLcwfydbgKcx2fg3IdlaQIdlgy:tg8PNa3Idba8M:tgIasIdlay:tg8RN:tg8Sa8SNa8Ra3IdwaQIdwgR:tg8UNa8PasIdwaR:tg8RN:tg8Pa8PNa8RaINa8Ua8NN:tg8Na8NNMM:rgIJbbbb9ETmba8SaI:vh8Sa8NaI:vh8Na8PaI:vh8Pka8EaCaYcdtfydbc8S2fgsa8PaI:rgIa8PNNg8RasIdbMUdbasa8NaIa8NNg8VNg8UasIdlMUdlasa8SaIa8SNg8WNg8XasIdwMUdwasa8Va8PNg8VasIdxMUdxasa8Wa8PNg8YasIdzMUdzasa8Wa8NNg8WasIdCMUdCasa8PaIa8SaRNa8Pa8MNaya8NNMM:mgyNg8MNg8PasIdKMUdKasa8Na8MNg8NasId3MUd3asa8Sa8MNg8SasIdaMUdaasa8MayNg8MasId8KMUd8KasaIasIdyMUdya8EaCa5cdtfydbc8S2fgsa8RasIdbMUdbasa8UasIdlMUdlasa8XasIdwMUdwasa8VasIdxMUdxasa8YasIdzMUdzasa8WasIdCMUdCasa8PasIdKMUdKasa8NasId3MUd3asa8SasIdaMUdaasa8MasId8KMUd8KasaIasIdyMUdya8EaCaKcdtfydbc8S2fgsa8RasIdbMUdbasa8UasIdlMUdlasa8XasIdwMUdwasa8VasIdxMUdxasa8YasIdzMUdzasa8WasIdCMUdCasa8PasIdKMUdKasa8NasId3MUd3asa8SasIdaMUdaasa8MasId8KMUd8KasaIasIdyMUdyaLcxfhLa8Acifg8Aad6mbkcbh5aehYincbhLinaEaeaLc:G1jjbfydba5fcdtfydbgQfRbbhsdndnaEaYaLfydbg3fRbbg8Ac99fcFeGcpe0mbasceSmbascd9hmekdna8AcufcFeGce0mba8Fa3cdtfydbaQ9hmekdnascufcFeGce0mbaaaQcdtfydba39hmekdna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Udxasa8VasIdzMUdzasa8XasIdCMUdCasa8WasIdKMUdKasa8UasId3MUd3asa8RasIdaMUdaasaRasId8KMUd8Kasa8PasIdyMUdyaoaCagcdtfydbgOc8S2fgsa8:asIdbMUdbasa89asIdlMUdlasa8ZasIdwMUdwasa8YasIdxMUdxasa8VasIdzMUdzasa8XasIdCMUdCasa8WasIdKMUdKasa8UasId3MUd3asa8RasIdaMUdaasaRasId8KMUd8Kasa8PasIdyMUdyawaLaD2cltfh5cbhLaDh3ina5aLfgsaPc;WbfaLfgQIdbasIdbMUdbasclfg8AaQclfIdba8AIdbMUdbascwfg8AaQcwfIdba8AIdbMUdbascxfgsaQcxfIdbasIdbMUdbaLczfhLa3cufg3mbkawaKaD2cltfh5cbhLaDh3ina5aLfgsaPc;WbfaLfgQIdbasIdbMUdbasclfg8AaQclfIdba8AIdbMUdbascwfg8AaQcwfIdba8AIdbMUdbascxfgsaQcxfIdbasIdbMUdbaLczfhLa3cufg3mbkawaOaD2cltfh5cbhLaDh3ina5aLfgsaPc;WbfaLfgQIdbasIdbMUdbasclfg8AaQclfIdba8AIdbMUdbascwfg8AaQcwfIdba8AIdbMUdbascxfgsaQcxfIdbasIdbMUdbaLczfhLa3cufg3mbkaYcifgYad6mbkkdnabaeSmbabaeadcdtz:kjjjb8AkaPydbhZcbhsdnalTmbaZclfhsaZydbh3aEhLalh8AcbhQincbasydbg5a39RaLRbbcpeGEaQfhQaLcefhLasclfhsa5h3a8Acufg8AmbkaQce4hskcuadas9Rcifgrcx2arc;v:Q;v:Qe0Ecbyd1:jjjbHjjjjbbh8LaPcwfaPyd9Ogscdtfa8LBdbaPascefgLBd9OaPcwfaLcdtfcuarcdtarcFFFFi0Ecbyd1:jjjbHjjjjbbgxBdbaPascdfgLBd9OaPcwfaLcdtfaAcbyd1:jjjbHjjjjbbgHBdbaPascifgLBd9OaPcwfaLcdtfalcbyd1:jjjbHjjjjbbgnBdbaPasclfBd9OJbbbbh8Ydnadaq9nmbdnarci6mbakakN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:tg8NN:ta8PaAIdba8S:tgRNaYIdbaI:tg8Ra8NN:tNa8Na9pIdbaQIdwg8S:tg8UNa8Ma8AIdwa8S:tgIN:ta8NadIdba8S:tg8SNaRaIN:tNaIayNa8Ua8PN:taIa8RNa8Sa8PN:tNMMJbbbb9FmdkascwfhsaLcefgLa56hea5aL9hmbkkaeceGTmba9hcefh9hxeka8Ea3c8S2gQfgsa8Ea9nc8S2g8AfgLIdbasIdbMUdbasaLIdlasIdlMUdlasaLIdwasIdwMUdwasaLIdxasIdxMUdxasaLIdzasIdzMUdzasaLIdCasIdCMUdCasaLIdKasIdKMUdKasaLId3asId3MUd3asaLIdaasIdaMUdaasaLId8KasId8KMUd8KasaLIdyasIdyMUdydnaDTmbaoaQfgsaoa8AfgLIdbasIdbMUdbasaLIdlasIdlMUdlasaLIdwasIdwMUdwasaLIdxasIdxMUdxasaLIdzasIdzMUdzasaLIdCasIdCMUdCasaLIdKasIdKMUdKasaLId3asId3MUd3asaLIdaasIdaMUdaasaLId8KasId8KMUd8KasaLIdyasIdyMUdyaca9n2heaca32hYawhLaDh8AinaLaYfgsaLaefgQIdbasIdbMUdbasclfg5aQclfIdba5IdbMUdbascwfg5aQcwfIdba5IdbMUdbascxfgsaQcxfIdbasIdbMUdbaLczfhLa8Acufg8AmbkkaOcwfhLdndndndnaEaKfgQRbbc9:fPdebdkaKhsinaHascdtgsfa3BdbaXasfydbgsaK9hmbxikkaXa9kfydbhsaXa9mfydbhKaHa9mfa6Bdbash6kaHaKcdtfa6Bdbka9oce86bba0ce86bbaLIdbg8Pa8Ya8Ya8P9DEh8Ya9ecefh9ececdaQRbbceSEaifhikagcefggaz9hmbkkdna9embahhdxikdnalTmbcbhLa8FhsindnasydbgQcuSmbdnaLaHaQcdtg3fydbgQ9hmba8Fa3fydbhQkasaQBdbkasclfhsalaLcefgL9hmbkcbhLaahsindnasydbgQcuSmbdnaLaHaQcdtg3fydbgQ9hmbaaa3fydbhQkasaQBdbkasclfhsalaLcefgL9hmbkkcbhdabhscbh8AindnaHasydbcdtfydbgLaHasclfydbcdtfydbgQSmbaLaHascwfydbcdtfydbg3SmbaQa3Smbabadcdtfg5aLBdba5clfaQBdba5cwfa3Bdbadcifhdkascxfhsa8Acifg8Aah6mbkadaq9nmdxbkkaPabadalaCz:cjjjbkdnamTmbama8Y:rUdbkaPyd9OgscdtaPcwffc98fhCdninasTmeaCydbcbyd:m:jjjbH:bjjjbbaCc98fhCascufhsxbkkaPc;W;abf8Kjjjjbadk;:ieouabydlhvabydbclfcbaicdtz:ljjjbhoadci9UhrdnadTmbdnalTmbaehwadhDinaoalawydbcdtfydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbxdkkaehwadhDinaoawydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbkkdnaiTmbcbhDaohwinawydbhqawaDBdbawclfhwaqaDfhDaicufgimbkkdnadci6mbarcearce0EhdinaecwfydbhwaeclfydbhDaeydbhidnalTmbalawcdtfydbhwalaDcdtfydbhDalaicdtfydbhikavaoaicdtfgqydbcitfaDBdbavaqydbcitfawBdlaqaqydbcefBdbavaoaDcdtfgqydbcitfawBdbavaqydbcitfaiBdlaqaqydbcefBdbavaoawcdtfgwydbcitfaiBdbavawydbcitfaDBdlawawydbcefBdbaecxfheadcufgdmbkkabydbcbBdbk:Zldouv998Jjjjjbca9Rglczfcwfcbyd11jjbBdbalcb8Pdj1jjb83izalcwfcbydN1jjbBdbalcb8Pd:m1jjb83ibdnadTmbaicd4hvdnabTmbavcdthocbhraehwinabarcx2fgiaearav2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinalczfaifgDawaifIdbgqaDIdbgkakaq9EEUdbalaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkawaofhwarcefgrad9hmbxdkkavcdthrcbhwincbhiinalczfaifgDaeaifIdbgqaDIdbgkakaq9EEUdbalaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkaearfheawcefgwad9hmbkkdnabTmbadTmbJbbbbJbbjZalIdbalIdzgk:tJbbbb:xgqalIdlalIdCgx:tgmamaq9DEgqalIdwalIdKgm:tgPaPaq9DEgq:vaqJbbbb9BEhqinabaqabIdbak:tNUdbabclfgiaqaiIdbax:tNUdbabcwfgiaqaiIdbam:tNUdbabcxfhbadcufgdmbkkk8KbabaeadaialavcbcbcbcbaoarawaDz:bjjjbk8KbabaeadaialavaoarawaDaqakaxamz:bjjjbk;lOowud99wue99iul998Jjjjjbc;Wb9Rgw8KjjjjbdndnarmbcbhDxekawcwfcbc;Kbz:ljjjb8Aawcuadcx2adc;v:Q;v:Qe0Ecbyd1:jjjbHjjjjbbgqBdwawceBd9Oaqaeadaiz:djjjbawcuadcdtadcFFFFi0Egkcbyd1:jjjbHjjjjbbgxBdxawcdBd9Oadcd4adfhmceheinaegicetheaiam6mbkcbhmawcuaicdtgPaicFFFFi0Ecbyd1:jjjbHjjjjbbgsBdzawciBd9Odndnar:Zgz:rJbbbZMgH:lJbbb9p9DTmbaH:Ohexekcjjjj94hekaicufhOc:bwhAcbhCcbhXadhQinaChLaeaAgKcufaeaK9iEamgDcefaeaD9kEhYdndnadTmbaYcuf:YhHaqhiaxheadhmindndnaiIdbaHNJbbbZMg8A:lJbbb9p9DTmba8A:OhAxekcjjjj94hAkaAcCthAdndnaiclfIdbaHNJbbbZMg8A:lJbbb9p9DTmba8A:OhCxekcjjjj94hCkaCcqtaAVhAdndnaicwfIdbaHNJbbbZMg8A:lJbbb9p9DTmba8A:OhCxekcjjjj94hCkaeaAaCVBdbaicxfhiaeclfheamcufgmmbkascFeaPz:ljjjbhEcbh3cbh5indnaEaxa5cdtfydbgAcm4aA7c:v;t;h;Ev2gics4ai7aOGgmcdtfgCydbgecuSmbaeaASmbcehiinaEamaifaOGgmcdtfgCydbgecuSmeaicefhiaeaA9hmbkkaCaABdba3aecuSfh3a5cefg5ad9hmbxdkkascFeaPz:ljjjb8Acbh3kaDaYa3ar0giEhmaLa3aiEhCdna3arSmbaYaKaiEgAam9Rcd9imbdndnaXcl0mbdnaQ:ZgHaL:Zg8A:taY:Yg8EaD:Y:tg8Fa8EaK:Y:tgaa3:Zghaz:tNNNaHaz:taaNa8Aah:tNa8Aaz:ta8FNahaH:tNM:va8EMJbbbZMgH:lJbbb9p9DTmbaH:Ohexdkcjjjj94hexekamaAfcd9Theka3aQaiEhQaXcefgXcs9hmekkdndnaCmbcihicbhDxekcbhiawakcbyd1:jjjbHjjjjbbg5BdCawclBd9OdndnadTmbamcuf:YhHaqhiaxheadhmindndnaiIdbaHNJbbbZMg8A:lJbbb9p9DTmba8A:OhAxekcjjjj94hAkaAcCthAdndnaiclfIdbaHNJbbbZMg8A:lJbbb9p9DTmba8A:OhCxekcjjjj94hCkaCcqtaAVhAdndnaicwfIdbaHNJbbbZMg8A:lJbbb9p9DTmba8A:OhCxekcjjjj94hCkaeaAaCVBdbaicxfhiaeclfheamcufgmmbkascFeaPz:ljjjbhEcbhDcbh3inaxa3cdtgYfydbgAcm4aA7c:v;t;h;Ev2gics4ai7hecbhidndninaEaeaOGgmcdtfgCydbgecuSmednaxaecdtgCfydbaASmbaicefgiamfheaiaO9nmekka5aCfydbhixekaCa3BdbaDhiaDcefhDka5aYfaiBdba3cefg3ad9hmbkcuaDc32giaDc;j:KM;jb0EhexekascFeaPz:ljjjb8AcbhDcbhekawaecbyd1:jjjbHjjjjbbgeBdKawcvBd9Oaecbaiz:ljjjbhOavcd4hxdnadTmbaxcdth3a5hmalhAaqheadhEinaOamydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiaAc;81jjbalEgCIdbaiIdxMUdxaiaCIdlaiIdzMUdzaiaCIdwaiIdCMUdCaiaiIdKJbbjZMUdKamclfhmaAa3fhAaecxfheaEcufgEmbkkdnaDTmbaOcxfhiaDheinaictfgmamIdbJbbbbJbbjZaicxfIdbgH:vaHJbbbb9BEgHNUdbaic94fgmaHamIdbNUdbaic98fgmaHamIdbNUdbaiaHaiIdbNUdbaiclfgmaHamIdbNUdbaicwfgmaHamIdbNUdbaic3fhiaecufgembkkcbhAawcuaDcdtgYaDcFFFFi0Egicbyd1:jjjbHjjjjbbgeBd3awcoBd9Oawaicbyd1:jjjbHjjjjbbgEBdaaecFeaYz:ljjjbh3dnadTmbaoaoNh8Aaxcdthxalheina8Aaec;81jjbalEgmIdwaOa5ydbgCc32fgiIdC:tgHaHNamIdbaiIdx:tgHaHNamIdlaiIdz:tgHaHNMMNaqcwfIdbaiIdw:tgHaHNaqIdbaiIdb:tgHaHNaqclfIdbaiIdl:tgHaHNMMMhHdndna3aCcdtgifgmydbcuSmbaEaifIdbaH9ETmekamaABdbaEaifaHUdbka5clfh5aeaxfheaqcxfhqadaAcefgA9hmbkkaba3aYz:kjjjb8AcrhikaicdthiinaiTmeaic98fgiawcwffydbcbyd:m:jjjbH:bjjjbbxbkkawc;Wbf8KjjjjbaDk:Qdidui99ducbhi8Jjjjjbca9Rglczfcwfcbyd11jjbBdbalcb8Pdj1jjb83izalcwfcbydN1jjbBdbalcb8Pd:m1jjb83ibdndnaembJbbjFhvJbbjFhoJbbjFhrxekadcd4cdthwincbhdinalczfadfgDabadfIdbgoaDIdbgrarao9EEUdbaladfgDaoaDIdbgrarao9DEUdbadclfgdcx9hmbkabawfhbaicefgiae9hmbkalIdwalIdK:thralIdlalIdC:thoalIdbalIdz:thvkavJbbbb:xgvaoaoav9DEgoararao9DEk9DeeuabcFeaicdtz:ljjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk9teiucbcbyd:q:jjjbgeabcifc98GfgbBd:q:jjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:q:jjjbgeabcrfc94GfgbBd:q:jjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd:q:jjjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd:q:jjjbfgdBd:q:jjjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk6eiucbhidnadTmbdninabRbbglaeRbbgv9hmeaecefheabcefhbadcufgdmbxdkkalav9Rhikaikk:Iedbcjwk1eFFuuFFuuFFuuFFuFFFuFFFuFbbbbbbbbebbbdbbbbbbbebbbeeebeebebbeeebebbbbbebebbbbbebbbdbbbbbbbbbbbbbbbeeeeebebbbbbebbbbbeebbbbbbbbbbbbbbbbbbbbbc1Dkxebbbdbbb:G9Kbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(f){n=f.instance,n.exports.__wasm_call_ctors()});function o(f){for(var x=new Uint8Array(f.length),_=0;_<f.length;++_){var C=f.charCodeAt(_);x[_]=C>96?C-97:C>64?C-39:C+4}for(var V=0,_=0;_<f.length;++_)x[V++]=x[_]<60?t[x[_]]:(x[_]-60)*64+x[++_];return x.buffer.slice(0,V)}function r(f){if(!f)throw new Error("Assertion failed")}function s(f){return new Uint8Array(f.buffer,f.byteOffset,f.byteLength)}function a(f,x,_){var C=n.exports.sbrk,V=C(x.length*4),L=C(_*4),Z=new Uint8Array(n.exports.memory.buffer),G=s(x);Z.set(G,V);var I=f(L,V,x.length,_);Z=new Uint8Array(n.exports.memory.buffer);var P=new Uint32Array(_);new Uint8Array(P.buffer).set(Z.subarray(L,L+_*4)),G.set(Z.subarray(V,V+x.length*4)),C(V-C(0));for(var v=0;v<x.length;++v)x[v]=P[x[v]];return[P,I]}function c(f){for(var x=0,_=0;_<f.length;++_){var C=f[_];x=x<C?C:x}return x}function d(f,x,_,C,V,L,Z,G,I){var P=n.exports.sbrk,v=P(4),F=P(_*4),M=P(V*L),b=P(_*4),R=new Uint8Array(n.exports.memory.buffer);R.set(s(C),M),R.set(s(x),b);var E=f(F,b,_,M,V,L,Z,G,I,v);R=new Uint8Array(n.exports.memory.buffer);var X=new Uint32Array(E);s(X).set(R.subarray(F,F+E*4));var w=new Float32Array(1);return s(w).set(R.subarray(v,v+4)),P(v-P(0)),[X,w[0]]}function u(f,x,_,C,V,L,Z,G,I,P,v,F){var M=n.exports.sbrk,b=M(4),R=M(_*4),E=M(V*L),X=M(V*G),w=M(I.length*4),N=M(_*4),D=new Uint8Array(n.exports.memory.buffer);D.set(s(C),E),D.set(s(Z),X),D.set(s(I),w),D.set(s(x),N);var k=f(R,N,_,E,V,L,X,G,w,I.length,P,v,F,b);D=new Uint8Array(n.exports.memory.buffer);var Y=new Uint32Array(k);s(Y).set(D.subarray(R,R+k*4));var U=new Float32Array(1);return s(U).set(D.subarray(b,b+4)),M(b-M(0)),[Y,U[0]]}function m(f,x,_,C){var V=n.exports.sbrk,L=V(_*C),Z=new Uint8Array(n.exports.memory.buffer);Z.set(s(x),L);var G=f(L,_,C);return V(L-V(0)),G}function p(f,x,_,C,V,L,Z,G){var I=n.exports.sbrk,P=I(G*4),v=I(_*C),F=I(_*L),M=new Uint8Array(n.exports.memory.buffer);M.set(s(x),v),V&&M.set(s(V),F);var b=f(P,v,_,C,F,L,Z,G);M=new Uint8Array(n.exports.memory.buffer);var R=new Uint32Array(b);return s(R).set(M.subarray(P,P+b*4)),I(P-I(0)),R}var y={LockBorder:1};return{ready:i,supported:!0,useExperimentalFeatures:!1,compactMesh:function(f){r(f instanceof Uint32Array||f instanceof Int32Array||f instanceof Uint16Array||f instanceof Int16Array),r(f.length%3==0);var x=f.BYTES_PER_ELEMENT==4?f:new Uint32Array(f);return a(n.exports.meshopt_optimizeVertexFetchRemap,x,c(f)+1)},simplify:function(f,x,_,C,V,L){r(f instanceof Uint32Array||f instanceof Int32Array||f instanceof Uint16Array||f instanceof Int16Array),r(f.length%3==0),r(x instanceof Float32Array),r(x.length%_==0),r(_>=3),r(C>=0&&C<=f.length),r(C%3==0),r(V>=0&&V<=1);for(var Z=0,G=0;G<(L?L.length:0);++G)Z|=y[L[G]];var I=f.BYTES_PER_ELEMENT==4?f:new Uint32Array(f),P=d(n.exports.meshopt_simplify,I,f.length,x,x.length/_,_*4,C,V,Z);return P[0]=f instanceof Uint32Array?P[0]:new f.constructor(P[0]),P},simplifyWithAttributes:function(f,x,_,C,V,L,Z,G,I){r(this.useExperimentalFeatures),r(f instanceof Uint32Array||f instanceof Int32Array||f instanceof Uint16Array||f instanceof Int16Array),r(f.length%3==0),r(x instanceof Float32Array),r(x.length%_==0),r(_>=3),r(C instanceof Float32Array),r(C.length%V==0),r(V>=0),r(Z>=0&&Z<=f.length),r(Z%3==0),r(G>=0&&G<=1),r(Array.isArray(L)),r(V>=L.length),r(L.length<=16);for(var P=0,v=0;v<(I?I.length:0);++v)P|=y[I[v]];var F=f.BYTES_PER_ELEMENT==4?f:new Uint32Array(f),M=u(n.exports.meshopt_simplifyWithAttributes,F,f.length,x,x.length/_,_*4,C,V*4,new Float32Array(L),Z,G,P);return M[0]=f instanceof Uint32Array?M[0]:new f.constructor(M[0]),M},getScale:function(f,x){return r(f instanceof Float32Array),r(f.length%x==0),r(x>=3),m(n.exports.meshopt_simplifyScale,f,f.length/x,x*4)},simplifyPoints:function(f,x,_,C,V,L){return r(this.useExperimentalFeatures),r(f instanceof Float32Array),r(f.length%x==0),r(x>=3),r(_>=0&&_<=f.length/x),C?(r(C instanceof Float32Array),r(C.length%V==0),r(V>=3),r(f.length/x==C.length/V),p(n.exports.meshopt_simplifyPoints,f,f.length/x,x*4,C,V*4,L,_)):p(n.exports.meshopt_simplifyPoints,f,f.length/x,x*4,void 0,0,0,_)}}}();function Mx(e){e=g(e,g.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.bufferViewId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey,a=n.bufferViews[i],c=a.buffer,d=a.byteOffset,u=a.byteLength,m=!1,p,y,f,x;if(ci(a,"EXT_meshopt_compression")){let C=a.extensions.EXT_meshopt_compression;c=C.buffer,d=g(C.byteOffset,0),u=C.byteLength,m=!0,p=C.byteStride,y=C.count,f=C.mode,x=g(C.filter,"NONE")}let _=n.buffers[c];this._hasMeshopt=m,this._meshoptByteStride=p,this._meshoptCount=y,this._meshoptMode=f,this._meshoptFilter=x,this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._buffer=_,this._bufferId=c,this._byteOffset=d,this._byteLength=u,this._cacheKey=s,this._bufferLoader=void 0,this._typedArray=void 0,this._state=Gt.UNLOADED,this._promise=void 0}l(Object.create)&&(Mx.prototype=Object.create(co.prototype),Mx.prototype.constructor=Mx);Object.defineProperties(Mx.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});async function uPe(e){try{let t=mPe(e);if(e._bufferLoader=t,await t.load(),e.isDestroyed())return;let n=t.typedArray,i=new Uint8Array(n.buffer,n.byteOffset+e._byteOffset,e._byteLength);if(e.unload(),e._typedArray=i,e._hasMeshopt){let o=e._meshoptCount,r=e._meshoptByteStride,s=new Uint8Array(o*r);Une.decodeGltfBuffer(s,o,r,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=s}return e._state=Gt.READY,e}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=Gt.FAILED,e.getError("Failed to load buffer view",t)}}Mx.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=Gt.LOADING,this._promise=uPe(this),this._promise)};function mPe(e){let t=e._resourceCache,n=e._buffer;if(l(n.uri)){let o=e._baseResource.getDerivedResource({url:n.uri});return t.getExternalBufferLoader({resource:o})}return t.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:e._bufferId})}Mx.prototype.unload=function(){l(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0};var iC=Mx;var utn=T(S(),1);var otn=T(S(),1);function Lr(){}Lr._maxDecodingConcurrency=Math.max(Bt.hardwareConcurrency-1,1);Lr._decoderTaskProcessor=void 0;Lr._taskProcessorReady=!1;Lr._error=void 0;Lr._getDecoderTaskProcessor=function(){if(!l(Lr._decoderTaskProcessor)){let e=new gi("decodeDraco",Lr._maxDecodingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(t){t?Lr._taskProcessorReady=!0:Lr._error=new me("Draco decoder could not be initialized.")}).catch(t=>{Lr._error=t}),Lr._decoderTaskProcessor=e}return Lr._decoderTaskProcessor};Lr.decodePointCloud=function(e){let t=Lr._getDecoderTaskProcessor();if(l(Lr._error))throw Lr._error;if(Lr._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])};Lr.decodeBufferView=function(e){let t=Lr._getDecoderTaskProcessor();if(l(Lr._error))throw Lr._error;if(Lr._taskProcessorReady)return t.scheduleTask(e,[e.array.buffer])};var Mp=Lr;function Ub(e){e=g(e,g.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.draco,o=e.gltfResource,r=e.baseResource,s=e.cacheKey;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._draco=i,this._cacheKey=s,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=Gt.UNLOADED,this._promise=void 0,this._dracoError=void 0}l(Object.create)&&(Ub.prototype=Object.create(co.prototype),Ub.prototype.constructor=Ub);Object.defineProperties(Ub.prototype,{cacheKey:{get:function(){return this._cacheKey}},decodedData:{get:function(){return this._decodedData}}});async function hPe(e){let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._draco.bufferView,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._bufferViewTypedArray=n.typedArray,e._state=Gt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;kne(e,n)}}Ub.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=Gt.LOADING,this._promise=hPe(this),this._promise)};function kne(e,t){throw e.unload(),e._state=Gt.FAILED,e.getError("Failed to load Draco",t)}async function fPe(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=Gt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}Ub.prototype.process=function(e){if(this._state===Gt.READY)return!0;if(this._state!==Gt.PROCESSING||(l(this._dracoError)&&kne(this,this._dracoError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let t=this._draco,i=this._gltf.bufferViews,o=t.bufferView,r=i[o],s=t.attributes,a={array:new Uint8Array(this._bufferViewTypedArray),bufferView:r,compressedAttributes:s,dequantizeInShader:!0},c=Mp.decodeBufferView(a);if(!l(c))return!1;this._decodePromise=fPe(this,c)};Ub.prototype.unload=function(){l(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0};var oC=Ub;var Ltn=T(S(),1);var btn=T(S(),1);function pPe(e){let t=e.uint8Array,n=e.format,i=e.request,o=g(e.flipY,!1),r=g(e.skipColorSpaceConversion,!1),s=new Blob([t],{type:n}),a;return Xe.supportsImageBitmapOptions().then(function(c){return c?Promise.resolve(Xe.createImageBitmapFromBlob(s,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:r})):(a=window.URL.createObjectURL(s),new Xe({url:a,request:i}).fetchImage({flipY:o,skipColorSpaceConversion:r}))}).then(function(c){return l(a)&&window.URL.revokeObjectURL(a),c}).catch(function(c){return l(a)&&window.URL.revokeObjectURL(a),Promise.reject(c)})}var Nx=pPe;function Np(e){e=g(e,g.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.imageId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey,a=n.images[i],c=a.bufferView,d=a.uri;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._bufferViewId=c,this._uri=d,this._cacheKey=s,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=Gt.UNLOADED,this._promise=void 0}l(Object.create)&&(Np.prototype=Object.create(co.prototype),Np.prototype.constructor=Np);Object.defineProperties(Np.prototype,{cacheKey:{get:function(){return this._cacheKey}},image:{get:function(){return this._image}},mipLevels:{get:function(){return this._mipLevels}}});Np.prototype.load=function(){return l(this._promise)?this._promise:l(this._bufferViewId)?(this._promise=bPe(this),this._promise):(this._promise=yPe(this),this._promise)};function Dne(e){let t;return Array.isArray(e)&&(t=e.slice(1,e.length).map(function(n){return n.bufferView}),e=e[0]),{image:e,mipLevels:t}}async function bPe(e){e._state=Gt.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=n,await n.load(),e.isDestroyed())return;let i=n.typedArray,o=await xPe(i);if(e.isDestroyed())return;let r=Dne(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=Gt.READY,e}catch(n){return e.isDestroyed()?void 0:Bne(e,n,"Failed to load embedded image")}}async function yPe(e){e._state=Gt.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let o=await TPe(i);if(e.isDestroyed())return;let r=Dne(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=Gt.READY,e}catch(o){return e.isDestroyed()?void 0:Bne(e,o,`Failed to load image: ${n}`)}}function Bne(e,t,n){return e.unload(),e._state=Gt.FAILED,Promise.reject(e.getError(n,t))}function gPe(e){let t=e.subarray(0,2),n=e.subarray(0,4),i=e.subarray(8,12);if(t[0]===255&&t[1]===216)return"image/jpeg";if(t[0]===137&&t[1]===80)return"image/png";if(t[0]===171&&t[1]===75)return"image/ktx2";if(n[0]===82&&n[1]===73&&n[2]===70&&n[3]===70&&i[0]===87&&i[1]===69&&i[2]===66&&i[3]===80)return"image/webp";throw new me("Image format is not recognized")}async function xPe(e){let t=gPe(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return bl(n)}return Np._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var _Pe=/(^data:image\/ktx2)|(\.ktx2$)/i;function TPe(e){let t=e.getUrlComponent(!1,!0);return _Pe.test(t)?bl(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}Np.prototype.unload=function(){l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._uri=void 0,this._image=void 0,this._mipLevels=void 0,this._gltf=void 0};Np._loadImageFromTypedArray=Nx;var rC=Np;var Ntn=T(S(),1);var Ztn=T(S(),1),SPe={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},Ra=Object.freeze(SPe);function kb(e){e=g(e,g.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.accessorId,o=e.gltfResource,r=e.baseResource,s=e.draco,a=e.cacheKey,c=g(e.asynchronous,!0),d=g(e.loadBuffer,!1),u=g(e.loadTypedArray,!1),m=n.accessors[i].componentType;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._accessorId=i,this._indexDatatype=m,this._draco=s,this._cacheKey=a,this._asynchronous=c,this._loadBuffer=d,this._loadTypedArray=u,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=Gt.UNLOADED,this._promise=void 0}l(Object.create)&&(kb.prototype=Object.create(co.prototype),kb.prototype.constructor=kb);Object.defineProperties(kb.prototype,{cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},indexDatatype:{get:function(){return this._indexDatatype}}});var CPe=new pY;kb.prototype.load=async function(){return l(this._promise)?this._promise:l(this._draco)?(this._promise=VPe(this),this._promise):(this._promise=LPe(this),this._promise)};async function VPe(e){e._state=Gt.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=Gt.LOADED,e)}catch(n){if(e.isDestroyed())return;fY(e,n)}}async function LPe(e){let t=e._gltf,n=e._accessorId,o=t.accessors[n].bufferView;e._state=Gt.LOADING;let r=e._resourceCache;try{let s=r.getBufferViewLoader({gltf:t,bufferViewId:o,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=s,await s.load(),e.isDestroyed())return;let a=s.typedArray;return e._typedArray=RPe(e,a),e._state=Gt.PROCESSING,e}catch(s){if(e.isDestroyed())return;fY(e,s)}}function RPe(e,t){let n=e._gltf,i=e._accessorId,o=n.accessors[i],r=o.count,s=o.componentType,a=Ne.getSizeInBytes(s),c=t.buffer,d=t.byteOffset+o.byteOffset;if(d%a!==0){let m=r*a,p=new Uint8Array(c,d,m);c=new Uint8Array(p).buffer,d=0,_r("index-buffer-unaligned",`The index array is not aligned to a ${a}-byte boundary.`)}let u;return s===Ne.UNSIGNED_BYTE?u=new Uint8Array(c,d,r):s===Ne.UNSIGNED_SHORT?u=new Uint16Array(c,d,r):s===Ne.UNSIGNED_INT&&(u=new Uint32Array(c,d,r)),u}function fY(e,t){throw e.unload(),e._state=Gt.FAILED,e.getError("Failed to load index buffer",t)}function pY(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}pY.prototype.set=function(e,t,n){this.typedArray=e,this.indexDatatype=t,this.context=n};pY.prototype.execute=function(){this.buffer=One(this.typedArray,this.indexDatatype,this.context)};function One(e,t,n){let i=ft.createIndexBuffer({typedArray:e,context:n,usage:Ue.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}kb.prototype.process=function(e){if(this._state===Gt.READY)return!0;if(this._state!==Gt.LOADED&&this._state!==Gt.PROCESSING)return!1;let t=this._typedArray,n=this._indexDatatype;if(l(this._dracoLoader))try{this._dracoLoader.process(e)&&(t=this._dracoLoader.decodedData.indices.typedArray,this._typedArray=t,n=Q.fromTypedArray(t),this._indexDatatype=n)}catch(o){fY(this,o)}if(!l(t))return!1;let i;if(this._loadBuffer&&this._asynchronous){let o=CPe;if(o.set(t,n,e.context),!e.jobScheduler.execute(o,Ra.BUFFER))return!1;i=o.buffer}else this._loadBuffer&&(i=One(t,n,e.context));return this.unload(),this._buffer=i,this._typedArray=this._loadTypedArray?t:void 0,this._state=Gt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};kb.prototype.unload=function(){l(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),l(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0};var sC=kb;var Qon=T(S(),1);var dnn=T(S(),1);var Dtn=T(S(),1);function ZPe(e,t,n){if(n=g(n,!1),n){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1}var bs=ZPe;var Jtn=T(S(),1);var Ytn=T(S(),1);function GPe(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var ar=GPe;function Kt(){}Kt.objectLegacy=function(e,t){if(l(e)){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],o=t(i,n);if(l(o))return o}}};Kt.object=function(e,t){if(l(e)){let n=e.length;for(let i=0;i<n;i++){let o=e[i],r=t(o,i);if(l(r))return r}}};Kt.topLevel=function(e,t,n){let i=e[t];return l(i)&&!Array.isArray(i)?Kt.objectLegacy(i,n):Kt.object(i,n)};Kt.accessor=function(e,t){return Kt.topLevel(e,"accessors",t)};Kt.accessorWithSemantic=function(e,t,n){let i={};return Kt.mesh(e,function(o){return Kt.meshPrimitive(o,function(r){let s=Kt.meshPrimitiveAttribute(r,function(a,c){if(c.indexOf(t)===0&&!l(i[a])){i[a]=!0;let d=n(a);if(l(d))return d}});return l(s)?s:Kt.meshPrimitiveTarget(r,function(a){return Kt.meshPrimitiveTargetAttribute(a,function(c,d){if(d.indexOf(t)===0&&!l(i[c])){i[c]=!0;let u=n(c);if(l(u))return u}})})})})};Kt.accessorContainingVertexAttributeData=function(e,t){let n={};return Kt.mesh(e,function(i){return Kt.meshPrimitive(i,function(o){let r=Kt.meshPrimitiveAttribute(o,function(s){if(!l(n[s])){n[s]=!0;let a=t(s);if(l(a))return a}});return l(r)?r:Kt.meshPrimitiveTarget(o,function(s){return Kt.meshPrimitiveTargetAttribute(s,function(a){if(!l(n[a])){n[a]=!0;let c=t(a);if(l(c))return c}})})})})};Kt.accessorContainingIndexData=function(e,t){let n={};return Kt.mesh(e,function(i){return Kt.meshPrimitive(i,function(o){let r=o.indices;if(l(r)&&!l(n[r])){n[r]=!0;let s=t(r);if(l(s))return s}})})};Kt.animation=function(e,t){return Kt.topLevel(e,"animations",t)};Kt.animationChannel=function(e,t){let n=e.channels;return Kt.object(n,t)};Kt.animationSampler=function(e,t){let n=e.samplers;return Kt.object(n,t)};Kt.buffer=function(e,t){return Kt.topLevel(e,"buffers",t)};Kt.bufferView=function(e,t){return Kt.topLevel(e,"bufferViews",t)};Kt.camera=function(e,t){return Kt.topLevel(e,"cameras",t)};Kt.image=function(e,t){return Kt.topLevel(e,"images",t)};Kt.material=function(e,t){return Kt.topLevel(e,"materials",t)};Kt.materialValue=function(e,t){let n=e.values;l(e.extensions)&&l(e.extensions.KHR_techniques_webgl)&&(n=e.extensions.KHR_techniques_webgl.values);for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};Kt.mesh=function(e,t){return Kt.topLevel(e,"meshes",t)};Kt.meshPrimitive=function(e,t){let n=e.primitives;if(l(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o],s=t(r,o);if(l(s))return s}}};Kt.meshPrimitiveAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};Kt.meshPrimitiveTarget=function(e,t){let n=e.targets;if(l(n)){let i=n.length;for(let o=0;o<i;++o){let r=t(n[o],o);if(l(r))return r}}};Kt.meshPrimitiveTargetAttribute=function(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],o=t(i,n);if(l(o))return o}};Kt.node=function(e,t){return Kt.topLevel(e,"nodes",t)};Kt.nodeInTree=function(e,t,n){let i=e.nodes;if(l(i)){let o=t.length;for(let r=0;r<o;r++){let s=t[r],a=i[s];if(l(a)){let c=n(a,s);if(l(c))return c;let d=a.children;if(l(d)&&(c=Kt.nodeInTree(e,d,n),l(c)))return c}}}};Kt.nodeInScene=function(e,t,n){let i=t.nodes;if(l(i))return Kt.nodeInTree(e,i,n)};Kt.program=function(e,t){return ar(e,"KHR_techniques_webgl")?Kt.object(e.extensions.KHR_techniques_webgl.programs,t):Kt.topLevel(e,"programs",t)};Kt.sampler=function(e,t){return Kt.topLevel(e,"samplers",t)};Kt.scene=function(e,t){return Kt.topLevel(e,"scenes",t)};Kt.shader=function(e,t){return ar(e,"KHR_techniques_webgl")?Kt.object(e.extensions.KHR_techniques_webgl.shaders,t):Kt.topLevel(e,"shaders",t)};Kt.skin=function(e,t){return Kt.topLevel(e,"skins",t)};Kt.skinJoint=function(e,t){let n=e.joints;if(l(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o],s=t(r);if(l(s))return s}}};Kt.techniqueAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};Kt.techniqueUniform=function(e,t){let n=e.uniforms;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};Kt.techniqueParameter=function(e,t){let n=e.parameters;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};Kt.technique=function(e,t){return ar(e,"KHR_techniques_webgl")?Kt.object(e.extensions.KHR_techniques_webgl.techniques,t):Kt.topLevel(e,"techniques",t)};Kt.texture=function(e,t){return Kt.topLevel(e,"textures",t)};var We=Kt;var nnn=T(S(),1);var jtn=T(S(),1);function EPe(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}}var ld=EPe;function IPe(e,t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n];if(l(i.byteStride)&&i.byteStride>0)return i.byteStride}return Q.getSizeInBytes(t.componentType)*ld(t.type)}var Rl=IPe;function XPe(e){We.accessor(e,function(n){l(n.bufferView)&&(n.byteOffset=g(n.byteOffset,0))}),We.bufferView(e,function(n){l(n.buffer)&&(n.byteOffset=g(n.byteOffset,0))}),We.mesh(e,function(n){We.meshPrimitive(n,function(i){if(i.mode=g(i.mode,ne.TRIANGLES),!l(i.material)){l(e.materials)||(e.materials=[]);let o={name:"default"};i.material=bs(e.materials,o)}})}),We.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],o=i.bufferView;if(i.normalized=g(i.normalized,!1),l(o)){let r=e.bufferViews[o];r.byteStride=Rl(e,i),r.target=ne.ARRAY_BUFFER}}),We.accessorContainingIndexData(e,function(n){let o=e.accessors[n].bufferView;if(l(o)){let r=e.bufferViews[o];r.target=ne.ELEMENT_ARRAY_BUFFER}}),We.material(e,function(n){let i=g(n.extensions,g.EMPTY_OBJECT),o=i.KHR_materials_common;if(l(o)){let c=o.technique,d=l(o.values)?o.values:{};o.values=d,d.ambient=l(d.ambient)?d.ambient:[0,0,0,1],d.emission=l(d.emission)?d.emission:[0,0,0,1],d.transparency=g(d.transparency,1),c!=="CONSTANT"&&(d.diffuse=l(d.diffuse)?d.diffuse:[0,0,0,1],c!=="LAMBERT"&&(d.specular=l(d.specular)?d.specular:[0,0,0,1],d.shininess=g(d.shininess,0))),o.transparent=g(o.transparent,!1),o.doubleSided=g(o.doubleSided,!1);return}n.emissiveFactor=g(n.emissiveFactor,[0,0,0]),n.alphaMode=g(n.alphaMode,"OPAQUE"),n.doubleSided=g(n.doubleSided,!1),n.alphaMode==="MASK"&&(n.alphaCutoff=g(n.alphaCutoff,.5));let r=i.KHR_techniques_webgl;l(r)&&We.materialValue(n,function(c){l(c.index)&&Ux(c)}),Ux(n.emissiveTexture),Ux(n.normalTexture),Ux(n.occlusionTexture);let s=n.pbrMetallicRoughness;l(s)&&(s.baseColorFactor=g(s.baseColorFactor,[1,1,1,1]),s.metallicFactor=g(s.metallicFactor,1),s.roughnessFactor=g(s.roughnessFactor,1),Ux(s.baseColorTexture),Ux(s.metallicRoughnessTexture));let a=i.KHR_materials_pbrSpecularGlossiness;l(a)&&(a.diffuseFactor=g(a.diffuseFactor,[1,1,1,1]),a.specularFactor=g(a.specularFactor,[1,1,1]),a.glossinessFactor=g(a.glossinessFactor,1),Ux(a.specularGlossinessTexture))}),We.animation(e,function(n){We.animationSampler(n,function(i){i.interpolation=g(i.interpolation,"LINEAR")})});let t=WPe(e);return We.node(e,function(n,i){l(t[i])||l(n.translation)||l(n.rotation)||l(n.scale)?(n.translation=g(n.translation,[0,0,0]),n.rotation=g(n.rotation,[0,0,0,1]),n.scale=g(n.scale,[1,1,1])):n.matrix=g(n.matrix,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}),We.sampler(e,function(n){n.wrapS=g(n.wrapS,ne.REPEAT),n.wrapT=g(n.wrapT,ne.REPEAT)}),l(e.scenes)&&!l(e.scene)&&(e.scene=0),e}function WPe(e){let t={};return We.animation(e,function(n){We.animationChannel(n,function(i){let o=i.target,r=o.node,s=o.path;(s==="translation"||s==="rotation"||s==="scale")&&(t[r]=!0)})}),t}function Ux(e){l(e)&&(e.texCoord=g(e.texCoord,0))}var $E=XPe;var fnn=T(S(),1);function PPe(e){return We.shader(e,function(t){_N(t)}),We.buffer(e,function(t){_N(t)}),We.image(e,function(t){_N(t)}),_N(e),e}function _N(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var Db=PPe;var Inn=T(S(),1);var Tnn=T(S(),1);var ynn=T(S(),1);function vPe(e,t){let n=e.extensionsRequired;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),n.length===0&&delete e.extensionsRequired}}var eI=vPe;function wPe(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),eI(e,t),n.length===0&&delete e.extensionsUsed}}var kx=wPe;var FPe=4;function APe(e){if(Gm(e)!=="glTF")throw new me("File is not valid binary glTF");let n=Yne(e,0,5),i=n[1];if(i!==1&&i!==2)throw new me("Binary glTF version is not 1 or 2");return i===1?MPe(e,n):NPe(e,n)}function Yne(e,t,n){let i=new DataView(e.buffer),o=new Array(n);for(let r=0;r<n;++r)o[r]=i.getUint32(e.byteOffset+t+r*FPe,!0);return o}function MPe(e,t){let n=t[2],i=t[3];if(t[4]!==0)throw new me("Binary glTF scene format is not JSON");let r=20,s=r+i,a=Sl(e,r,i),c=JSON.parse(a);Db(c);let d=e.subarray(s,n),u=c.buffers;if(l(u)&&Object.keys(u).length>0){let m=g(u.binary_glTF,u.KHR_binary_glTF);l(m)&&(m.extras._pipeline.source=d,delete m.uri)}return kx(c,"KHR_binary_glTF"),c}function NPe(e,t){let n=t[2],i=12,o,r;for(;i<n;){let s=Yne(e,i,2),a=s[0],c=s[1];i+=8;let d=e.subarray(i,i+a);if(i+=a,c===1313821514){let u=Sl(d);o=JSON.parse(u),Db(o)}else c===5130562&&(r=d)}if(l(o)&&l(r)){let s=o.buffers;if(l(s)&&s.length>0){let a=s[0];a.extras._pipeline.source=r}}return o}var tI=APe;var vnn=T(S(),1);function UPe(e){return We.shader(e,function(t){TN(t)}),We.buffer(e,function(t){TN(t)}),We.image(e,function(t){TN(t)}),TN(e),e}function TN(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var nI=UPe;var pon=T(S(),1);var Mnn=T(S(),1);function kPe(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),bs(n,t,!0)}var mu=kPe;var znn=T(S(),1);var knn=T(S(),1);function DPe(e){switch(e){case Q.BYTE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt8(n+s*o)};case Q.UNSIGNED_BYTE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint8(n+s*o)};case Q.SHORT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt16(n+s*o,!0)};case Q.UNSIGNED_SHORT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint16(n+s*o,!0)};case Q.INT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt32(n+s*o,!0)};case Q.UNSIGNED_INT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint32(n+s*o,!0)};case Q.FLOAT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getFloat32(n+s*o,!0)};case Q.DOUBLE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getFloat64(n+s*o,!0)}}}var Up=DPe;function BPe(e,t){let n=e.bufferViews,i=e.buffers,o=t.bufferView,r=ld(t.type);if(!l(t.bufferView))return{min:new Array(r).fill(0),max:new Array(r).fill(0)};let s=new Array(r).fill(Number.POSITIVE_INFINITY),a=new Array(r).fill(Number.NEGATIVE_INFINITY),c=n[o],d=c.buffer,m=i[d].extras._pipeline.source,p=t.count,y=Rl(e,t),f=t.byteOffset+c.byteOffset+m.byteOffset,x=t.componentType,_=Q.getSizeInBytes(x),C=new DataView(m.buffer),V=new Array(r),L=Up(x);for(let Z=0;Z<p;Z++){L(C,f,r,_,V);for(let G=0;G<r;G++){let I=V[G];s[G]=Math.min(s[G],I),a[G]=Math.max(a[G],I)}f+=y}return{min:s,max:a}}var Dx=BPe;var tin=T(S(),1);var OPe=[ne.FUNC_ADD,ne.FUNC_ADD],YPe=[ne.ONE,ne.ZERO,ne.ONE,ne.ZERO];function Hne(e,t){let n=e.enable;return l(n)?n.indexOf(t)>-1:!1}var HPe=[ne.ZERO,ne.ONE,ne.SRC_COLOR,ne.ONE_MINUS_SRC_COLOR,ne.SRC_ALPHA,ne.ONE_MINUS_SRC_ALPHA,ne.DST_ALPHA,ne.ONE_MINUS_DST_ALPHA,ne.DST_COLOR,ne.ONE_MINUS_DST_COLOR];function KPe(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(HPe.indexOf(e[n])===-1)return t;return e}function zPe(e){let t={},n={},i=e.techniques;return l(i)&&(We.technique(e,function(o,r){let s=o.states;if(l(s)){let a=n[r]={};if(Hne(s,ne.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[r]={blendEquation:g(c.blendEquationSeparate,OPe),blendFactors:KPe(c.blendFuncSeparate,YPe)})}Hne(s,ne.CULL_FACE)||(a.doubleSided=!0),delete o.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),mu(e,"KHR_blend")),We.material(e,function(o){if(l(o.technique)){let r=n[o.technique];We.objectLegacy(r,function(a,c){o[c]=a});let s=t[o.technique];l(s)&&(l(o.extensions)||(o.extensions={}),o.extensions.KHR_blend=s)}})),e}var iI=zPe;var hin=T(S(),1);var sin=T(S(),1);function JPe(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),bs(n,t,!0),mu(e,t)}var oI=JPe;function QPe(e){let t=e.techniques,n={},i={},o={};if(l(t)){let r={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,We.technique(e,function(a,c){let d={name:a.name,program:void 0,attributes:{},uniforms:{}},u;if(We.techniqueAttribute(a,function(m,p){u=a.parameters[m],d.attributes[p]={semantic:u.semantic}}),We.techniqueUniform(a,function(m,p){u=a.parameters[m],d.uniforms[p]={count:u.count,node:u.node,type:u.type,semantic:u.semantic,value:u.value},l(n[c])||(n[c]={}),n[c][m]=p}),l(o[a.program]))d.program=o[a.program];else{let m=e.programs[a.program],p={name:m.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:s},y=e.shaders[m.fragmentShader];p.fragmentShader=bs(r.shaders,y,!0);let f=e.shaders[m.vertexShader];p.vertexShader=bs(r.shaders,f,!0),d.program=bs(r.programs,p),o[a.program]=d.program}i[c]=bs(r.techniques,d)}),r.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=r,mu(e,"KHR_techniques_webgl"),oI(e,"KHR_techniques_webgl"))}return We.material(e,function(r){if(l(r.technique)){let s={technique:i[r.technique]};We.objectLegacy(r.values,function(a,c){l(s.values)||(s.values={});let d=n[r.technique][c];l(d)&&(s.values[d]=a)}),l(r.extensions)||(r.extensions={}),r.extensions.KHR_techniques_webgl=s}delete r.technique,delete r.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var rI=QPe;var Lin=T(S(),1);var gin=T(S(),1);function jPe(e,t){_o.typeOf.object("material",e),_o.defined("handler",t);let n=e.pbrMetallicRoughness;if(l(n)){if(l(n.baseColorTexture)){let o=n.baseColorTexture,r=t(o.index,o);if(l(r))return r}if(l(n.metallicRoughnessTexture)){let o=n.metallicRoughnessTexture,r=t(o.index,o);if(l(r))return r}}if(l(e.extensions)){let o=e.extensions.KHR_materials_pbrSpecularGlossiness;if(l(o)){if(l(o.diffuseTexture)){let s=o.diffuseTexture,a=t(s.index,s);if(l(a))return a}if(l(o.specularGlossinessTexture)){let s=o.specularGlossinessTexture,a=t(s.index,s);if(l(a))return a}}let r=e.extensions.KHR_materials_common;if(l(r)&&l(r.values)){let s=r.values.diffuse,a=r.values.ambient,c=r.values.emission,d=r.values.specular;if(l(s)&&l(s.index)){let u=t(s.index,s);if(l(u))return u}if(l(a)&&l(a.index)){let u=t(a.index,a);if(l(u))return u}if(l(c)&&l(c.index)){let u=t(c.index,c);if(l(u))return u}if(l(d)&&l(d.index)){let u=t(d.index,d);if(l(u))return u}}}let i=We.materialValue(e,function(o){if(l(o.index)){let r=t(o.index,o);if(l(r))return r}});if(l(i))return i;if(l(e.emissiveTexture)){let o=e.emissiveTexture,r=t(o.index,o);if(l(r))return r}if(l(e.normalTexture)){let o=e.normalTexture,r=t(o.index,o);if(l(r))return r}if(l(e.occlusionTexture)){let o=e.occlusionTexture,r=t(o.index,o);if(l(r))return r}}var aC=jPe;var Kne=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function qPe(e,t){return t=g(t,Kne),Kne.forEach(function(n){t.indexOf(n)>-1&&eve(e,n)}),e}var $Pe={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function eve(e,t){let n=$Pe[t],i=e[n];if(l(i)){let o=0,r=rf[t](e),s=i.length;for(let a=0;a<s;++a)r[a]||(of[t](e,a-o),o++)}}function of(){}of.accessor=function(e,t){e.accessors.splice(t,1),We.mesh(e,function(i){We.meshPrimitive(i,function(o){We.meshPrimitiveAttribute(o,function(a,c){a>t&&o.attributes[c]--}),We.meshPrimitiveTarget(o,function(a){We.meshPrimitiveTargetAttribute(a,function(c,d){c>t&&a[d]--})});let r=o.indices;l(r)&&r>t&&o.indices--;let s=o.extensions;l(s)&&l(s.CESIUM_primitive_outline)&&s.CESIUM_primitive_outline.indices>t&&--s.CESIUM_primitive_outline.indices})}),We.skin(e,function(i){l(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),We.animation(e,function(i){We.animationSampler(i,function(o){l(o.input)&&o.input>t&&o.input--,l(o.output)&&o.output>t&&o.output--})})};of.buffer=function(e,t){e.buffers.splice(t,1),We.bufferView(e,function(i){l(i.buffer)&&i.buffer>t&&i.buffer--,l(i.extensions)&&l(i.extensions.EXT_meshopt_compression)&&i.extensions.EXT_meshopt_compression.buffer--})};of.bufferView=function(e,t){if(e.bufferViews.splice(t,1),We.accessor(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),We.shader(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),We.image(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),ar(e,"KHR_draco_mesh_compression")&&We.mesh(e,function(i){We.meshPrimitive(i,function(o){l(o.extensions)&&l(o.extensions.KHR_draco_mesh_compression)&&o.extensions.KHR_draco_mesh_compression.bufferView>t&&o.extensions.KHR_draco_mesh_compression.bufferView--})}),ar(e,"EXT_feature_metadata")){let o=e.extensions.EXT_feature_metadata.featureTables;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let d=a[c];l(d.bufferView)&&d.bufferView>t&&d.bufferView--,l(d.arrayOffsetBufferView)&&d.arrayOffsetBufferView>t&&d.arrayOffsetBufferView--,l(d.stringOffsetBufferView)&&d.stringOffsetBufferView>t&&d.stringOffsetBufferView--}}}}if(ar(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTables;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let c=o[s].properties;for(let d in c)if(c.hasOwnProperty(d)){let u=c[d];l(u.values)&&u.values>t&&u.values--,l(u.arrayOffsets)&&u.arrayOffsets>t&&u.arrayOffsets--,l(u.stringOffsets)&&u.stringOffsets>t&&u.stringOffsets--}}}}};of.image=function(e,t){e.images.splice(t,1),We.texture(e,function(i){l(i.source)&&i.source>t&&--i.source;let o=i.extensions;l(o)&&l(o.EXT_texture_webp)&&o.EXT_texture_webp.source>t?--i.extensions.EXT_texture_webp.source:l(o)&&l(o.KHR_texture_basisu)&&o.KHR_texture_basisu.source>t&&--i.extensions.KHR_texture_basisu.source})};of.mesh=function(e,t){e.meshes.splice(t,1),We.node(e,function(i){l(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};of.node=function(e,t){e.nodes.splice(t,1),We.skin(e,function(i){l(i.skeleton)&&i.skeleton>t&&i.skeleton--,i.joints=i.joints.map(function(o){return o>t?o-1:o})}),We.animation(e,function(i){We.animationChannel(i,function(o){l(o.target)&&l(o.target.node)&&o.target.node>t&&o.target.node--})}),We.technique(e,function(i){We.techniqueUniform(i,function(o){l(o.node)&&o.node>t&&o.node--})}),We.node(e,function(i){l(i.children)&&(i.children=i.children.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o}))}),We.scene(e,function(i){i.nodes=i.nodes.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o})})};of.material=function(e,t){e.materials.splice(t,1),We.mesh(e,function(i){We.meshPrimitive(i,function(o){l(o.material)&&o.material>t&&o.material--})})};of.sampler=function(e,t){e.samplers.splice(t,1),We.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};of.texture=function(e,t){if(e.textures.splice(t,1),We.material(e,function(i){aC(i,function(o,r){r.index>t&&--r.index})}),ar(e,"EXT_feature_metadata")){We.mesh(e,function(r){We.meshPrimitive(r,function(s){let a=s.extensions;if(l(a)&&l(a.EXT_feature_metadata)){let d=a.EXT_feature_metadata.featureIdTextures;if(l(d)){let u=d.length;for(let m=0;m<u;++m){let y=d[m].featureIds.texture;y.index>t&&--y.index}}}})});let o=e.extensions.EXT_feature_metadata.featureTextures;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let u=a[c].texture;u.index>t&&--u.index}}}}if(ar(e,"EXT_mesh_features")&&We.mesh(e,function(i){We.meshPrimitive(i,function(o){let r=o.extensions;if(l(r)&&l(r.EXT_mesh_features)){let a=r.EXT_mesh_features.featureIds;if(l(a)){let c=a.length;for(let d=0;d<c;++d){let u=a[d];l(u.texture)&&u.texture.index>t&&--u.texture.index}}}})}),ar(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTextures;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let c=o[s].properties;for(let d in c)if(c.hasOwnProperty(d)){let u=c[d];u.index>t&&--u.index}}}}};function rf(){}rf.accessor=function(e){let t={};return We.mesh(e,function(n){We.meshPrimitive(n,function(i){We.meshPrimitiveAttribute(i,function(r){t[r]=!0}),We.meshPrimitiveTarget(i,function(r){We.meshPrimitiveTargetAttribute(r,function(s){t[s]=!0})});let o=i.indices;l(o)&&(t[o]=!0)})}),We.skin(e,function(n){l(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),We.animation(e,function(n){We.animationSampler(n,function(i){l(i.input)&&(t[i.input]=!0),l(i.output)&&(t[i.output]=!0)})}),ar(e,"EXT_mesh_gpu_instancing")&&We.node(e,function(n){l(n.extensions)&&l(n.extensions.EXT_mesh_gpu_instancing)&&Object.keys(n.extensions.EXT_mesh_gpu_instancing.attributes).forEach(function(i){let o=n.extensions.EXT_mesh_gpu_instancing.attributes[i];t[o]=!0})}),ar(e,"CESIUM_primitive_outline")&&We.mesh(e,function(n){We.meshPrimitive(n,function(i){let o=i.extensions;if(l(o)&&l(o.CESIUM_primitive_outline)){let s=o.CESIUM_primitive_outline.indices;l(s)&&(t[s]=!0)}})}),t};rf.buffer=function(e){let t={};return We.bufferView(e,function(n){l(n.buffer)&&(t[n.buffer]=!0),l(n.extensions)&&l(n.extensions.EXT_meshopt_compression)&&(t[n.extensions.EXT_meshopt_compression.buffer]=!0)}),t};rf.bufferView=function(e){let t={};if(We.accessor(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),We.shader(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),We.image(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),ar(e,"KHR_draco_mesh_compression")&&We.mesh(e,function(n){We.meshPrimitive(n,function(i){l(i.extensions)&&l(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),ar(e,"EXT_feature_metadata")){let i=e.extensions.EXT_feature_metadata.featureTables;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let c=s[a];l(c.bufferView)&&(t[c.bufferView]=!0),l(c.arrayOffsetBufferView)&&(t[c.arrayOffsetBufferView]=!0),l(c.stringOffsetBufferView)&&(t[c.stringOffsetBufferView]=!0)}}}}if(ar(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(l(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let c in a)if(a.hasOwnProperty(c)){let d=a[c];l(d.values)&&(t[d.values]=!0),l(d.arrayOffsets)&&(t[d.arrayOffsets]=!0),l(d.stringOffsets)&&(t[d.stringOffsets]=!0)}}}}return t};rf.image=function(e){let t={};return We.texture(e,function(n){l(n.source)&&(t[n.source]=!0),l(n.extensions)&&l(n.extensions.EXT_texture_webp)?t[n.extensions.EXT_texture_webp.source]=!0:l(n.extensions)&&l(n.extensions.KHR_texture_basisu)&&(t[n.extensions.KHR_texture_basisu.source]=!0)}),t};rf.mesh=function(e){let t={};return We.node(e,function(n){if(l(n.mesh&&l(e.meshes))){let i=e.meshes[n.mesh];l(i)&&l(i.primitives)&&i.primitives.length>0&&(t[n.mesh]=!0)}}),t};function zne(e,t,n){let i=e.nodes[t];return l(i.mesh)||l(i.camera)||l(i.skin)||l(i.weights)||l(i.extras)||l(i.extensions)&&Object.keys(i.extensions).length!==0||l(n[t])?!1:!l(i.children)||i.children.filter(function(o){return!zne(e,o,n)}).length===0}rf.node=function(e){let t={};return We.skin(e,function(n){l(n.skeleton)&&(t[n.skeleton]=!0),We.skinJoint(n,function(i){t[i]=!0})}),We.animation(e,function(n){We.animationChannel(n,function(i){l(i.target)&&l(i.target.node)&&(t[i.target.node]=!0)})}),We.technique(e,function(n){We.techniqueUniform(n,function(i){l(i.node)&&(t[i.node]=!0)})}),We.node(e,function(n,i){zne(e,i,t)||(t[i]=!0)}),t};rf.material=function(e){let t={};return We.mesh(e,function(n){We.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};rf.texture=function(e){let t={};if(We.material(e,function(n){aC(n,function(i){t[i]=!0})}),ar(e,"EXT_feature_metadata")){We.mesh(e,function(o){We.meshPrimitive(o,function(r){let s=r.extensions;if(l(s)&&l(s.EXT_feature_metadata)){let c=s.EXT_feature_metadata.featureIdTextures;if(l(c)){let d=c.length;for(let u=0;u<d;++u){let p=c[u].featureIds.texture;t[p.index]=!0}}}})});let i=e.extensions.EXT_feature_metadata.featureTextures;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let d=s[a].texture;t[d.index]=!0}}}}if(ar(e,"EXT_mesh_features")&&We.mesh(e,function(n){We.meshPrimitive(n,function(i){let o=i.extensions;if(l(o)&&l(o.EXT_mesh_features)){let s=o.EXT_mesh_features.featureIds;if(l(s)){let a=s.length;for(let c=0;c<a;++c){let d=s[c];l(d.texture)&&(t[d.texture.index]=!0)}}}})}),ar(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTextures;if(l(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let c in a)if(a.hasOwnProperty(c)){let d=a[c];t[d.index]=!0}}}}return t};rf.sampler=function(e){let t={};return We.texture(e,function(n){l(n.sampler)&&(t[n.sampler]=!0)}),t};var sI=qPe;var Din=T(S(),1);var Gin=T(S(),1);function tve(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},o={buffer:bs(e.buffers,n),byteOffset:0,byteLength:t.length};return bs(e.bufferViews,o)}var aI=tve;var win=T(S(),1);function nve(e,t){let n=Rl(e,t),i=Q.getSizeInBytes(t.componentType),o=ld(t.type),r=t.count,s=new Array(o*r);if(!l(t.bufferView))return s.fill(0);let a=e.bufferViews[t.bufferView],c=e.buffers[a.buffer].extras._pipeline.source,d=t.byteOffset+a.byteOffset+c.byteOffset,u=new DataView(c.buffer),m=new Array(o),p=Up(t.componentType);for(let y=0;y<r;++y){p(u,d,o,i,m);for(let f=0;f<o;++f)s[y*o+f]=m[f];d+=n}return s}var cI=nve;function ive(e){let t;return We.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===ne.BYTE?SN(e,i,Q.UNSIGNED_BYTE):t!==ne.UNSIGNED_BYTE&&t!==ne.UNSIGNED_SHORT&&SN(e,i,Q.UNSIGNED_SHORT)}),We.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===ne.BYTE?SN(e,i,Q.UNSIGNED_BYTE):t===ne.SHORT&&SN(e,i,Q.UNSIGNED_SHORT)}),e}function SN(e,t,n){let i=Q.createTypedArray(n,cI(e,t)),o=new Uint8Array(i.buffer);t.bufferView=aI(e,o),t.componentType=n,t.byteOffset=0}var lI=ive;var Kin=T(S(),1);function ove(e,t){return kx(e,t),t==="CESIUM_RTC"&&rve(e),bY(e,t)}function rve(e){We.technique(e,function(t){We.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function bY(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)bY(e[i],t)}else if(e!==null&&typeof e=="object"&&e.constructor===Object){let n=e.extensions,i;l(n)&&(i=n[t],l(i)&&(delete n[t],Object.keys(n).length===0&&delete e.extensions));for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&bY(e[o],t);return i}}var Bx=ove;var CN={.8:uve,"1.0":Wve,"2.0":void 0};function sve(e,t){t=g(t,g.EMPTY_OBJECT);let n=t.targetVersion,i=e.version;e.asset=g(e.asset,{version:"1.0"}),e.asset.version=g(e.asset.version,"1.0"),i=g(i,e.asset.version).toString(),Object.prototype.hasOwnProperty.call(CN,i)||(l(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(CN,i)||(i="1.0"));let o=CN[i];for(;l(o)&&i!==n;)o(e,t),i=e.asset.version,o=CN[i];return t.keepLegacyExtensions||(wve(e,t),Fve(e)),e}function Qne(e){let t=e.materials;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.instanceTechnique;l(o)&&(i.technique=o.technique,i.values=o.values,delete i.instanceTechnique)}}function ave(e){let t=e.meshes;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let o=t[n].primitives;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let a=o[s],c=g(a.primitive,ne.TRIANGLES);a.mode=g(a.mode,c),delete a.primitive}}}}function cve(e){let t=e.nodes,n=new h,i=new Me;for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o];if(l(r.rotation)){let a=r.rotation;h.fromArray(a,0,n),Me.fromAxisAngle(n,a[3],i),r.rotation=[i.x,i.y,i.z,i.w]}let s=r.instanceSkin;l(s)&&(r.skeletons=s.skeletons,r.skin=s.skin,r.meshes=s.meshes,delete r.instanceSkin)}}function lve(e){let t=e.animations,n=e.accessors,i=e.bufferViews,o=e.buffers,r={},s=new h,a=new Me;for(let c in t)if(Object.prototype.hasOwnProperty.call(t,c)){let d=t[c],u=d.channels,m=d.parameters,p=d.samplers;if(l(u)){let y=u.length;for(let f=0;f<y;++f){let x=u[f];if(x.target.path==="rotation"){let _=m[p[x.sampler].output];if(l(r[_]))continue;r[_]=!0;let C=n[_],V=i[C.bufferView],Z=o[V.buffer].extras._pipeline.source,G=Z.byteOffset+V.byteOffset+C.byteOffset,I=C.componentType,P=C.count,v=ld(C.type),F=C.count*v,M=Q.createArrayBufferView(I,Z.buffer,G,F);for(let b=0;b<P;b++){let R=b*v;h.unpack(M,R,s);let E=M[R+3];Me.fromAxisAngle(s,E,a),Me.pack(a,M,R)}}}}}}function dve(e){let t=e.techniques;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.passes;if(l(o)){let r=g(i.pass,"defaultPass");if(Object.prototype.hasOwnProperty.call(o,r)){let s=o[r],a=s.instanceProgram;i.attributes=g(i.attributes,a.attributes),i.program=g(i.program,a.program),i.uniforms=g(i.uniforms,a.uniforms),i.states=g(i.states,s.states)}delete i.passes,delete i.pass}}}function uve(e){l(e.asset)||(e.asset={});let t=e.asset;if(t.version="1.0",typeof t.profile=="string"){let n=t.profile.split(" ");t.profile={api:n[0],version:n[1]}}else t.profile={};if(l(e.version)&&delete e.version,Qne(e),ave(e),cve(e),lve(e),dve(e),l(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,delete e.allExtensions),l(e.lights)){let n=g(e.extensions,{});e.extensions=n;let i=g(n.KHR_materials_common,{});n.KHR_materials_common=i,i.lights=e.lights,delete e.lights,mu(e,"KHR_materials_common")}}function mve(e){let t=e.animations;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.parameters;if(l(o)){let r=i.samplers;for(let s in r)if(Object.prototype.hasOwnProperty.call(r,s)){let a=r[s];a.input=o[a.input],a.output=o[a.output]}delete i.parameters}}}function Jne(e,t){let n=[];for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)){let o=e[i];t[i]=n.length,n.push(o),l(o.name)||(o.name=i)}return n}function hve(e){let t,n={accessors:{},animations:{},buffers:{},bufferViews:{},cameras:{},images:{},materials:{},meshes:{},nodes:{},programs:{},samplers:{},scenes:{},shaders:{},skins:{},textures:{},techniques:{}},i,o={},r=e.nodes;for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i=r[s].jointName,l(i)&&(o[i]=s));for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&l(n[s])){let a={},c=e[s];e[s]=Jne(c,a),n[s]=a}for(i in o)Object.prototype.hasOwnProperty.call(o,i)&&(o[i]=n.nodes[o[i]]);l(e.scene)&&(e.scene=n.scenes[e.scene]),We.bufferView(e,function(s){l(s.buffer)&&(s.buffer=n.buffers[s.buffer])}),We.accessor(e,function(s){l(s.bufferView)&&(s.bufferView=n.bufferViews[s.bufferView])}),We.shader(e,function(s){let a=s.extensions;if(l(a)){let c=a.KHR_binary_glTF;l(c)&&(s.bufferView=n.bufferViews[c.bufferView],delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),We.program(e,function(s){l(s.vertexShader)&&(s.vertexShader=n.shaders[s.vertexShader]),l(s.fragmentShader)&&(s.fragmentShader=n.shaders[s.fragmentShader])}),We.technique(e,function(s){l(s.program)&&(s.program=n.programs[s.program]),We.techniqueParameter(s,function(a){l(a.node)&&(a.node=n.nodes[a.node]);let c=a.value;typeof c=="string"&&(a.value={index:n.textures[c]})})}),We.mesh(e,function(s){We.meshPrimitive(s,function(a){l(a.indices)&&(a.indices=n.accessors[a.indices]),We.meshPrimitiveAttribute(a,function(c,d){a.attributes[d]=n.accessors[c]}),l(a.material)&&(a.material=n.materials[a.material])})}),We.node(e,function(s){let a=s.children;if(l(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}if(l(s.meshes)){let c=s.meshes,d=c.length;if(d>0)for(s.mesh=n.meshes[c[0]],t=1;t<d;++t){let u={mesh:n.meshes[c[t]]},m=bs(e.nodes,u);l(a)||(a=[],s.children=a),a.push(m)}delete s.meshes}if(l(s.camera)&&(s.camera=n.cameras[s.camera]),l(s.skin)&&(s.skin=n.skins[s.skin]),l(s.skeletons)){let c=s.skeletons;if(c.length>0&&l(s.skin)){let u=e.skins[s.skin];u.skeleton=n.nodes[c[0]]}delete s.skeletons}l(s.jointName)&&delete s.jointName}),We.skin(e,function(s){l(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(l(a)){let c=[],d=a.length;for(t=0;t<d;++t)c[t]=o[a[t]];s.joints=c,delete s.jointNames}}),We.scene(e,function(s){let a=s.nodes;if(l(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}}),We.animation(e,function(s){let a={};s.samplers=Jne(s.samplers,a),We.animationSampler(s,function(c){c.input=n.accessors[c.input],c.output=n.accessors[c.output]}),We.animationChannel(s,function(c){c.sampler=a[c.sampler];let d=c.target;l(d)&&(d.node=n.nodes[d.id],delete d.id)})}),We.material(e,function(s){l(s.technique)&&(s.technique=n.techniques[s.technique]),We.materialValue(s,function(c,d){typeof c=="string"&&(s.values[d]={index:n.textures[c]})});let a=s.extensions;if(l(a)){let c=a.KHR_materials_common;l(c)&&l(c.values)&&We.materialValue(c,function(d,u){typeof d=="string"&&(c.values[u]={index:n.textures[d]})})}}),We.image(e,function(s){let a=s.extensions;if(l(a)){let c=a.KHR_binary_glTF;l(c)&&(s.bufferView=n.bufferViews[c.bufferView],s.mimeType=c.mimeType,delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),We.texture(e,function(s){l(s.sampler)&&(s.sampler=n.samplers[s.sampler]),l(s.source)&&(s.source=n.images[s.source])})}function fve(e){We.animation(e,function(t){We.animationSampler(t,function(n){delete n.name})})}function pve(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];Array.isArray(n)&&n.length===0&&delete e[t]}We.node(e,function(t){l(t.children)&&t.children.length===0&&delete t.children})}function bve(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var yve={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function gve(e){let t=e.extensionsUsed;if(e.extensionsRequired=g(e.extensionsRequired,[]),l(t)){let n=t.length;for(let i=0;i<n;++i){let o=t[i];l(yve[o])&&e.extensionsRequired.push(o)}}}function xve(e){We.buffer(e,function(t){delete t.type})}function _ve(e){We.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function Tve(e){We.mesh(e,function(t){We.meshPrimitive(t,function(n){We.meshPrimitiveAttribute(n,function(i,o){o==="TEXCOORD"?n.attributes.TEXCOORD_0=i:o==="COLOR"&&(n.attributes.COLOR_0=i)}),delete n.attributes.TEXCOORD,delete n.attributes.COLOR})}),We.technique(e,function(t){We.techniqueParameter(t,function(n){let i=n.semantic;l(i)&&(i==="TEXCOORD"?n.semantic="TEXCOORD_0":i==="COLOR"&&(n.semantic="COLOR_0"))})})}var Sve={POSITION:!0,NORMAL:!0,TANGENT:!0},Cve={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function Vve(e){let t={};We.mesh(e,function(n){We.meshPrimitive(n,function(i){We.meshPrimitiveAttribute(i,function(o,r){if(r.charAt(0)!=="_"){let s=r.search(/_[0-9]+/g),a=r,c="_0";s>=0&&(a=r.substring(0,s),c=r.substring(s));let d,u=Cve[a];l(u)?(d=u+c,t[r]=d):l(Sve[a])||(d=`_${r}`,t[r]=d)}});for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o],s=i.attributes[o];l(s)&&(delete i.attributes[o],i.attributes[r]=s)}})}),We.technique(e,function(n){We.techniqueParameter(n,function(i){let o=t[i.semantic];l(o)&&(i.semantic=o)})})}function Lve(e){We.camera(e,function(t){let n=t.perspective;if(l(n)){let i=n.aspectRatio;l(i)&&i===0&&delete n.aspectRatio;let o=n.yfov;l(o)&&o===0&&(n.yfov=1)}})}function yY(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:Rl(e,t)}function Rve(e){We.buffer(e,function(t){l(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),We.accessor(e,function(t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n],o=yY(e,t),r=t.byteOffset+t.count*o;i.byteLength=Math.max(g(i.byteLength,0),r)}})}function Zve(e){let t,n,i,o=e.bufferViews,r={};We.accessorContainingVertexAttributeData(e,function(a){let c=e.accessors[a];l(c.bufferView)&&(r[c.bufferView]=!0)});let s={};We.accessor(e,function(a){l(a.bufferView)&&(s[a.bufferView]=g(s[a.bufferView],[]),s[a.bufferView].push(a))});for(let a in s)if(Object.prototype.hasOwnProperty.call(s,a)){i=o[a];let c=s[a];c.sort(function(p,y){return p.byteOffset-y.byteOffset});let d=0,u=0,m=c.length;for(t=0;t<m;++t){let p=c[t],y=yY(e,p),f=p.byteOffset,x=p.count*y;delete p.byteStride;let _=t<m-1,C=_?yY(e,c[t+1]):void 0;if(y!==C){let V=ze(i,!0);r[a]&&(V.byteStride=y),V.byteOffset+=d,V.byteLength=f+x-d;let L=bs(o,V);for(n=u;n<=t;++n)p=c[n],p.bufferView=L,p.byteOffset=p.byteOffset-d;d=_?c[t+1].byteOffset:void 0,u=t+1}}}sI(e,["accessor","bufferView","buffer"])}function Gve(e){We.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!l(n.min)||!l(n.max)){let i=Dx(e,n);n.min=i.min,n.max=i.max}})}function jne(e){return(!l(e.children)||e.children.length===0)&&(!l(e.meshes)||e.meshes.length===0)&&!l(e.camera)&&!l(e.skin)&&!l(e.skeletons)&&!l(e.jointName)&&(!l(e.translation)||h.fromArray(e.translation).equals(h.ZERO))&&(!l(e.scale)||h.fromArray(e.scale).equals(new h(1,1,1)))&&(!l(e.rotation)||se.fromArray(e.rotation).equals(new se(0,0,0,1)))&&(!l(e.matrix)||A.fromColumnMajorArray(e.matrix).equals(A.IDENTITY))&&!l(e.extensions)&&!l(e.extras)}function qne(e,t){We.scene(e,function(n){let i=n.nodes;if(l(i)){let o=i.length;for(let r=o;r>=0;--r)if(i[r]===t){i.splice(r,1);return}}}),We.node(e,function(n,i){if(l(n.children)){let o=n.children.indexOf(t);o>-1&&(n.children.splice(o,1),jne(n)&&qne(e,i))}}),delete e.nodes[t]}function Eve(e){return We.node(e,function(t,n){jne(t)&&qne(e,n)}),e}function Ive(e){We.animation(e,function(t){We.animationSampler(t,function(n){let i=e.accessors[n.input];if(!l(i.min)||!l(i.max)){let o=Dx(e,i);i.min=o.min,i.max=o.max}})})}function Xve(e){We.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=Dx(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function Wve(e){e.asset=g(e.asset,{}),e.asset.version="2.0",Qne(e),mve(e),Eve(e),hve(e),fve(e),bve(e),gve(e),Rve(e),Zve(e),Gve(e),Ive(e),Xve(e),xve(e),_ve(e),Tve(e),Vve(e),lI(e),Lve(e),iI(e),rI(e),pve(e)}var Pve=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],vve=["u_diffuse","u_diffuse_mat"];function gY(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function VN(e){return l(e.index)}function LN(e){return Array.isArray(e)&&e.length===4}function $ne(e){let t=new Array(4);t[3]=e[3];for(let n=0;n<3;n++){let i=e[n];i<=.04045?t[n]=e[n]*.07739938080495357:t[n]=Math.pow((i+.055)*.9478672985781991,2.4)}return t}function wve(e,t){t=g(t,g.EMPTY_OBJECT);let n=g(t.baseColorTextureNames,Pve),i=g(t.baseColorFactorNames,vve);We.material(e,function(o){We.materialValue(o,function(r,s){n.indexOf(s)!==-1&&VN(r)?(gY(o),o.pbrMetallicRoughness.baseColorTexture=r):i.indexOf(s)!==-1&&LN(r)&&(gY(o),o.pbrMetallicRoughness.baseColorFactor=$ne(r))})}),Bx(e,"KHR_techniques_webgl"),Bx(e,"KHR_blend")}function Fve(e){We.material(e,function(t){let n=g(t.extensions,g.EMPTY_OBJECT).KHR_materials_common;if(l(n)){n.technique==="CONSTANT"&&(mu(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={});let o=l(n.values)?n.values:{},r=o.ambient,s=o.diffuse,a=o.emission,c=o.transparency,d=n.doubleSided,u=n.transparent;gY(t),l(r)&&(LN(r)?t.emissiveFactor=r.slice(0,3):VN(r)&&(t.emissiveTexture=r)),l(s)&&(LN(s)?t.pbrMetallicRoughness.baseColorFactor=$ne(s):VN(s)&&(t.pbrMetallicRoughness.baseColorTexture=s)),l(d)&&(t.doubleSided=d),l(a)&&(LN(a)?t.emissiveFactor=a.slice(0,3):VN(a)&&(t.emissiveTexture=a)),l(c)&&(l(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=c:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,c]),l(u)&&(t.alphaMode=u?"BLEND":"OPAQUE")}}),Bx(e,"KHR_materials_common")}var dI=sve;var Xon=T(S(),1);var gon=T(S(),1);var li={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID"};function Ave(e){switch(e){case li.POSITION:return"positionMC";case li.NORMAL:return"normalMC";case li.TANGENT:return"tangentMC";case li.TEXCOORD:return"texCoord";case li.COLOR:return"color";case li.JOINTS:return"joints";case li.WEIGHTS:return"weights";case li.FEATURE_ID:return"featureId"}}li.hasSetIndex=function(e){switch(e){case li.POSITION:case li.NORMAL:case li.TANGENT:return!1;case li.TEXCOORD:case li.COLOR:case li.JOINTS:case li.WEIGHTS:case li.FEATURE_ID:return!0}};li.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return li.POSITION;case"NORMAL":return li.NORMAL;case"TANGENT":return li.TANGENT;case"TEXCOORD":return li.TEXCOORD;case"COLOR":return li.COLOR;case"JOINTS":return li.JOINTS;case"WEIGHTS":return li.WEIGHTS;case"_FEATURE_ID":return li.FEATURE_ID}};li.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return li.POSITION;case"RGBA":case"RGB":case"RGB565":return li.COLOR;case"NORMAL":case"NORMAL_OCT16P":return li.NORMAL;case"BATCH_ID":return li.FEATURE_ID}};li.getGlslType=function(e){switch(e){case li.POSITION:case li.NORMAL:case li.TANGENT:return"vec3";case li.TEXCOORD:return"vec2";case li.COLOR:return"vec4";case li.JOINTS:return"ivec4";case li.WEIGHTS:return"vec4";case li.FEATURE_ID:return"int"}};li.getVariableName=function(e,t){let n=Ave(e);return l(t)&&(n+=`_${t}`),n};var _t=Object.freeze(li);function tc(){}tc.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;l(n)&&l(n.message)&&(i+=`
${n.message}`);let o=new me(i);return l(n)&&(o.stack=`Original stack:
${n.stack}
Handler stack:
${o.stack}`),o};tc.getNodeTransform=function(e){return l(e.matrix)?e.matrix:A.fromTranslationQuaternionRotationScale(l(e.translation)?e.translation:h.ZERO,l(e.rotation)?e.rotation:Me.IDENTITY,l(e.scale)?e.scale:h.ONE)};tc.getAttributeBySemantic=function(e,t,n){let i=e.attributes,o=i.length;for(let r=0;r<o;++r){let s=i[r],a=l(n)?s.setIndex===n:!0;if(s.semantic===t&&a)return s}};tc.getAttributeByName=function(e,t){let n=e.attributes,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.name===t)return r}};tc.getFeatureIdsByLabel=function(e,t){for(let n=0;n<e.length;n++){let i=e[n];if(i.positionalLabel===t||i.label===t)return i}};tc.hasQuantizedAttributes=function(e){if(!l(e))return!1;for(let t=0;t<e.length;t++){let n=e[t];if(l(n.quantization))return!0}return!1};tc.getAttributeInfo=function(e){let t=e.semantic,n=e.setIndex,i,o=!1;l(t)?(i=_t.getVariableName(t,n),o=!0):(i=e.name,i=i.replace(/^_/,""),i=i.toLowerCase());let r=/^color_\d+$/.test(i),s=e.type,a=tn.getGlslType(s);r&&(a="vec4");let c=l(e.quantization),d;return c&&(d=r?"vec4":tn.getGlslType(e.quantization.type)),{attribute:e,isQuantized:c,variableName:i,hasSemantic:o,glslType:a,quantizedGlslType:d}};var Mve=new h,Nve=new h;tc.getPositionMinMax=function(e,t,n){let i=tc.getAttributeBySemantic(e,"POSITION"),o=i.max,r=i.min;return l(n)&&l(t)&&(r=h.add(r,t,Nve),o=h.add(o,n,Mve)),{min:r,max:o}};tc.getAxisCorrectionMatrix=function(e,t,n){return n=A.clone(A.IDENTITY,n),e===Wo.Y?n=A.clone(Wo.Y_UP_TO_Z_UP,n):e===Wo.X&&(n=A.clone(Wo.X_UP_TO_Z_UP,n)),t===Wo.Z&&(n=A.multiplyTransformation(n,Wo.Z_UP_TO_X_UP,n)),n};var Uve=new q;tc.getCullFace=function(e,t){if(!Ae.isTriangles(t))return yi.BACK;let n=A.getMatrix3(e,Uve);return q.determinant(n)<0?yi.FRONT:yi.BACK};tc.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t=`_${t}`),t};tc.supportedExtensions={AGI_articulations:!0,CESIUM_primitive_outline:!0,CESIUM_RTC:!0,EXT_feature_metadata:!0,EXT_instance_features:!0,EXT_mesh_features:!0,EXT_mesh_gpu_instancing:!0,EXT_meshopt_compression:!0,EXT_structural_metadata:!0,EXT_texture_webp:!0,KHR_blend:!0,KHR_draco_mesh_compression:!0,KHR_techniques_webgl:!0,KHR_materials_common:!0,KHR_materials_pbrSpecularGlossiness:!0,KHR_materials_unlit:!0,KHR_mesh_quantization:!0,KHR_texture_basisu:!0,KHR_texture_transform:!0,WEB3D_quantized_attributes:!0};tc.checkSupportedExtensions=function(e){let t=e.length;for(let n=0;n<t;n++){let i=e[n];if(!tc.supportedExtensions[i])throw new me(`Unsupported glTF Extension: ${i}`)}};var qt=tc;function Bb(e){e=g(e,g.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltfResource,i=e.baseResource,o=e.typedArray,r=e.gltfJson,s=e.cacheKey;this._resourceCache=t,this._gltfResource=n,this._baseResource=i,this._typedArray=o,this._gltfJson=r,this._cacheKey=s,this._gltf=void 0,this._bufferLoaders=[],this._state=Gt.UNLOADED,this._promise=void 0}l(Object.create)&&(Bb.prototype=Object.create(co.prototype),Bb.prototype.constructor=Bb);Object.defineProperties(Bb.prototype,{cacheKey:{get:function(){return this._cacheKey}},gltf:{get:function(){return this._gltf}}});Bb.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=Gt.LOADING,l(this._gltfJson)?(this._promise=eie(this,this._gltfJson),this._promise):l(this._typedArray)?(this._promise=tie(this,this._typedArray),this._promise):(this._promise=kve(this),this._promise))};async function kve(e){let t;try{let n=await e._fetchGltf();if(e.isDestroyed())return;t=new Uint8Array(n)}catch(n){if(e.isDestroyed())return;xY(e,n)}return tie(e,t)}function xY(e,t){e.unload(),e._state=Gt.FAILED;let n=`Failed to load glTF: ${e._gltfResource.url}`;throw e.getError(n,t)}async function Dve(e,t){if(l(t.asset)&&t.asset.version==="2.0"&&!ar(t,"KHR_techniques_webgl")&&!ar(t,"KHR_materials_common"))return Promise.resolve();let n=[];We.buffer(t,function(i){if(!l(i.extras._pipeline.source)&&l(i.uri)){let o=e._baseResource.getDerivedResource({url:i.uri}),s=e._resourceCache.getExternalBufferLoader({resource:o});e._bufferLoaders.push(s),n.push(s.load().then(function(){s.isDestroyed()||(i.extras._pipeline.source=s.typedArray)}))}}),await Promise.all(n),dI(t)}function Bve(e){let t=[];return We.buffer(e,function(n){let i=n.uri;!l(n.extras._pipeline.source)&&l(i)&&lp(i)&&(delete n.uri,t.push(Xe.fetchArrayBuffer(i).then(function(o){n.extras._pipeline.source=new Uint8Array(o)})))}),Promise.all(t)}function Ove(e,t){let n=[];return We.buffer(t,function(i,o){let r=i.extras._pipeline.source;if(l(r)&&!l(i.uri)){let a=e._resourceCache.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:o,typedArray:r});e._bufferLoaders.push(a),n.push(a.load())}}),Promise.all(n)}async function eie(e,t){try{Db(t),await Bve(t),await Dve(e,t),$E(t),await Ove(e,t),nI(t);let n=t.asset.version;if(n!=="1.0"&&n!=="2.0")throw new me(`Unsupported glTF version: ${n}`);let i=t.extensionsRequired;return l(i)&&qt.checkSupportedExtensions(i),e._gltf=t,e._state=Gt.READY,e}catch(n){if(e.isDestroyed())return;xY(e,n)}}async function tie(e,t){let n;try{Gm(t)==="glTF"?n=tI(t):n=Po(t)}catch(i){if(e.isDestroyed())return;xY(e,i)}return eie(e,n)}Bb.prototype.unload=function(){let e=this._bufferLoaders,t=e.length;for(let n=0;n<t;++n)e[n]=!e[n].isDestroyed()&&this._resourceCache.unload(e[n]);this._bufferLoaders.length=0,this._gltf=void 0};Bb.prototype._fetchGltf=function(){return this._gltfResource.fetchArrayBuffer()};var cC=Bb;var Prn=T(S(),1);var brn=T(S(),1);var rrn=T(S(),1);var qon=T(S(),1),Yve={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"},sf=Object.freeze(Yve);var Qo={};function Hve(){this.octEncoded=!1,this.octEncodedZXY=!1,this.normalizationRange=void 0,this.quantizedVolumeOffset=void 0,this.quantizedVolumeDimensions=void 0,this.quantizedVolumeStepSize=void 0,this.componentDatatype=void 0,this.type=void 0}function Kve(){this.name=void 0,this.semantic=void 0,this.setIndex=void 0,this.componentDatatype=void 0,this.type=void 0,this.normalized=!1,this.count=void 0,this.min=void 0,this.max=void 0,this.constant=void 0,this.quantization=void 0,this.typedArray=void 0,this.buffer=void 0,this.byteOffset=0,this.byteStride=void 0}function zve(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}function Jve(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.setIndex=void 0,this.label=void 0,this.positionalLabel=void 0}function Qve(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.offset=0,this.repeat=void 0,this.label=void 0,this.positionalLabel=void 0}function jve(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.textureReader=void 0,this.label=void 0,this.positionalLabel=void 0}function qve(){this.attributes=[]}function $ve(){this.attributes=[],this.morphTargets=[],this.indices=void 0,this.material=void 0,this.primitiveType=void 0,this.featureIds=[],this.propertyTextureIds=[],this.propertyAttributeIds=[],this.outlineCoordinates=void 0}function ewe(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}function twe(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}function nwe(){this.name=void 0,this.index=void 0,this.children=[],this.primitives=[],this.instances=void 0,this.skin=void 0,this.matrix=void 0,this.translation=void 0,this.rotation=void 0,this.scale=void 0,this.morphWeights=[],this.articulationName=void 0}function iwe(){this.nodes=[]}var owe={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"};function rwe(){this.input=[],this.interpolation=void 0,this.output=[]}function swe(){this.node=void 0,this.path=void 0}function awe(){this.sampler=void 0,this.target=void 0}function cwe(){this.name=void 0,this.samplers=[],this.channels=[]}function lwe(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}function dwe(){this.name=void 0,this.stages=[]}function nie(){this.credits=[]}function uwe(){this.asset=new nie,this.scene=void 0,this.nodes=[],this.skins=[],this.animations=[],this.articulations=[],this.structuralMetadata=void 0,this.upAxis=void 0,this.forwardAxis=void 0,this.transform=A.clone(A.IDENTITY)}function mwe(){this.texture=void 0,this.index=void 0,this.texCoord=0,this.transform=q.clone(q.IDENTITY),this.channels=void 0}function Ob(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=se.clone(Ob.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=Ob.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=Ob.DEFAULT_ROUGHNESS_FACTOR}Ob.DEFAULT_BASE_COLOR_FACTOR=se.ONE;Ob.DEFAULT_METALLIC_FACTOR=1;Ob.DEFAULT_ROUGHNESS_FACTOR=1;function Ox(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=se.clone(Ox.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=h.clone(Ox.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=Ox.DEFAULT_GLOSSINESS_FACTOR}Ox.DEFAULT_DIFFUSE_FACTOR=se.ONE;Ox.DEFAULT_SPECULAR_FACTOR=h.ONE;Ox.DEFAULT_GLOSSINESS_FACTOR=1;function _Y(){this.metallicRoughness=new Ob,this.specularGlossiness=void 0,this.emissiveTexture=void 0,this.normalTexture=void 0,this.occlusionTexture=void 0,this.emissiveFactor=h.clone(_Y.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=sf.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1}_Y.DEFAULT_EMISSIVE_FACTOR=h.ZERO;Qo.Quantization=Hve;Qo.Attribute=Kve;Qo.Indices=zve;Qo.FeatureIdAttribute=Jve;Qo.FeatureIdTexture=jve;Qo.FeatureIdImplicitRange=Qve;Qo.MorphTarget=qve;Qo.Primitive=$ve;Qo.Instances=ewe;Qo.Skin=twe;Qo.Node=nwe;Qo.Scene=iwe;Qo.AnimatedPropertyType=Object.freeze(owe);Qo.AnimationSampler=rwe;Qo.AnimationTarget=swe;Qo.AnimationChannel=awe;Qo.Animation=cwe;Qo.ArticulationStage=lwe;Qo.Articulation=dwe;Qo.Asset=nie;Qo.Components=uwe;Qo.TextureReader=mwe;Qo.MetallicRoughness=Ob;Qo.SpecularGlossiness=Ox;Qo.Material=_Y;var Mt=Qo;var RN={};RN.getImageIdFromTexture=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.gltf,n=e.textureId,i=e.supportedImageFormats,o=t.textures[n],r=o.extensions;if(l(r)){if(i.webp&&l(r.EXT_texture_webp))return r.EXT_texture_webp.source;if(i.basis&&l(r.KHR_texture_basisu))return r.KHR_texture_basisu.source}return o.source};RN.createSampler=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.gltf,n=e.textureInfo,i=g(e.compressedTextureNoMipmap,!1),o=In.REPEAT,r=In.REPEAT,s=dn.LINEAR,a=Ti.LINEAR,c=n.index,u=t.textures[c].sampler;if(l(u)){let m=t.samplers[u];o=g(m.wrapS,o),r=g(m.wrapT,r),s=g(m.minFilter,s),a=g(m.magFilter,a)}return i&&s!==dn.LINEAR&&s!==dn.NEAREST&&(s===dn.NEAREST_MIPMAP_NEAREST||s===dn.NEAREST_MIPMAP_LINEAR?s=dn.NEAREST:s=dn.LINEAR),new hn({wrapS:o,wrapT:r,minificationFilter:s,magnificationFilter:a})};var hwe=new B(1,1);RN.createModelTextureReader=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.textureInfo,n=e.channels,i=e.texture,o=g(t.texCoord,0),r,s=g(t.extensions,g.EMPTY_OBJECT).KHR_texture_transform;if(l(s)){o=g(s.texCoord,o);let c=l(s.offset)?B.unpack(s.offset):B.ZERO,d=g(s.rotation,0),u=l(s.scale)?B.unpack(s.scale):hwe;d=-d,r=new q(Math.cos(d)*u.x,-Math.sin(d)*u.y,c.x,Math.sin(d)*u.x,Math.cos(d)*u.y,c.y,0,0,1)}let a=new Mt.TextureReader;return a.index=t.index,a.texture=i,a.texCoord=o,a.transform=r,a.channels=n,a};var Zl=RN;var xrn=T(S(),1);function fwe(e){let t=document.createElement("canvas");return t.width=W.nextPowerOfTwo(e.width),t.height=W.nextPowerOfTwo(e.height),t.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),t}var Yb=fwe;function Hb(e){e=g(e,g.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.textureInfo,o=e.gltfResource,r=e.baseResource,s=e.supportedImageFormats,a=e.cacheKey,c=g(e.asynchronous,!0),d=i.index,u=Zl.getImageIdFromTexture({gltf:n,textureId:d,supportedImageFormats:s});this._resourceCache=t,this._gltf=n,this._textureInfo=i,this._imageId=u,this._gltfResource=o,this._baseResource=r,this._cacheKey=a,this._asynchronous=c,this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._state=Gt.UNLOADED,this._promise=void 0}l(Object.create)&&(Hb.prototype=Object.create(co.prototype),Hb.prototype.constructor=Hb);Object.defineProperties(Hb.prototype,{cacheKey:{get:function(){return this._cacheKey}},texture:{get:function(){return this._texture}}});var pwe=new TY;async function bwe(e){let t=e._resourceCache;try{let n=t.getImageLoader({gltf:e._gltf,imageId:e._imageId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._imageLoader=n,await n.load(),e.isDestroyed()?void 0:(e._image=n.image,e._mipLevels=n.mipLevels,e._state=Gt.LOADED,e)}catch(n){if(e.isDestroyed())return;throw e.unload(),e._state=Gt.FAILED,e.getError("Failed to load texture",n)}}Hb.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=Gt.LOADING,this._promise=bwe(this),this._promise)};function TY(){this.gltf=void 0,this.textureInfo=void 0,this.image=void 0,this.context=void 0,this.texture=void 0}TY.prototype.set=function(e,t,n,i,o){this.gltf=e,this.textureInfo=t,this.image=n,this.mipLevels=i,this.context=o};TY.prototype.execute=function(){this.texture=iie(this.gltf,this.textureInfo,this.image,this.mipLevels,this.context)};function iie(e,t,n,i,o){let r=n.internalFormat,s=!1;at.isCompressedFormat(r)&&!l(i)&&(s=!0);let a=Zl.createSampler({gltf:e,textureInfo:t,compressedTextureNoMipmap:s}),c=a.minificationFilter,d=a.wrapS,u=a.wrapT,m=c===dn.NEAREST_MIPMAP_NEAREST||c===dn.NEAREST_MIPMAP_LINEAR||c===dn.LINEAR_MIPMAP_NEAREST||c===dn.LINEAR_MIPMAP_LINEAR,p=!l(r)&&m,y=p||d===In.REPEAT||d===In.MIRRORED_REPEAT||u===In.REPEAT||u===In.MIRRORED_REPEAT,f=!W.isPowerOfTwo(n.width)||!W.isPowerOfTwo(n.height),x=y&&f,_;return l(r)?(!o.webgl2&&at.isCompressedFormat(r)&&f&&y&&console.warn("Compressed texture uses REPEAT or MIRRORED_REPEAT texture wrap mode and dimensions are not powers of two. The texture may be rendered incorrectly."),_=wt.create({context:o,source:{arrayBufferView:n.bufferView,mipLevels:i},width:n.width,height:n.height,pixelFormat:n.internalFormat,sampler:a})):(x&&(n=Yb(n)),_=wt.create({context:o,source:n,sampler:a,flipY:!1,skipColorSpaceConversion:!0})),p&&_.generateMipmap(),_}Hb.prototype.process=function(e){if(this._state===Gt.READY)return!0;if(this._state!==Gt.LOADED&&this._state!==Gt.PROCESSING||l(this._texture)||!l(this._image))return!1;this._state=Gt.PROCESSING;let t;if(this._asynchronous){let n=pwe;if(n.set(this._gltf,this._textureInfo,this._image,this._mipLevels,e.context),!e.jobScheduler.execute(n,Ra.TEXTURE))return;t=n.texture}else t=iie(this._gltf,this._textureInfo,this._image,this._mipLevels,e.context);return this.unload(),this._texture=t,this._state=Gt.READY,this._resourceCache.statistics.addTextureLoader(this),!0};Hb.prototype.unload=function(){l(this._texture)&&this._texture.destroy(),l(this._imageLoader)&&!this._imageLoader.isDestroyed()&&this._resourceCache.unload(this._imageLoader),this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._gltf=void 0};var lC=Hb;var Orn=T(S(),1);function Kb(e){e=g(e,g.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.gltfResource,o=e.baseResource,r=e.bufferViewId,s=e.draco,a=e.attributeSemantic,c=e.accessorId,d=e.cacheKey,u=g(e.asynchronous,!0),m=g(e.loadBuffer,!1),p=g(e.loadTypedArray,!1);this._resourceCache=t,this._gltfResource=i,this._baseResource=o,this._gltf=n,this._bufferViewId=r,this._draco=s,this._attributeSemantic=a,this._accessorId=c,this._cacheKey=d,this._asynchronous=u,this._loadBuffer=m,this._loadTypedArray=p,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._quantization=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=Gt.UNLOADED,this._promise=void 0}l(Object.create)&&(Kb.prototype=Object.create(co.prototype),Kb.prototype.constructor=Kb);Object.defineProperties(Kb.prototype,{cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},quantization:{get:function(){return this._quantization}}});function ywe(e,t){return l(e)&&l(e.attributes)&&l(e.attributes[t])}Kb.prototype.load=async function(){return l(this._promise)?this._promise:ywe(this._draco,this._attributeSemantic)?(this._promise=xwe(this),this._promise):(this._promise=Twe(this),this._promise)};function gwe(e,t,n,i){let r=(1<<e.quantizationBits)-1,s=1/r,a=new Mt.Quantization;if(a.componentDatatype=t,a.octEncoded=e.octEncoded,a.octEncodedZXY=!0,a.type=i,a.octEncoded)a.type=tn.VEC2,a.normalizationRange=r;else{let c=tn.getMathType(i);if(c===Number){let d=e.range;a.quantizedVolumeOffset=e.minValues[0],a.quantizedVolumeDimensions=d,a.normalizationRange=r,a.quantizedVolumeStepSize=d*s}else{a.quantizedVolumeOffset=c.unpack(e.minValues),a.normalizationRange=c.unpack(new Array(n).fill(r));let d=new Array(n).fill(e.range);a.quantizedVolumeDimensions=c.unpack(d);let u=d.map(function(m){return m*s});a.quantizedVolumeStepSize=c.unpack(u)}}return a}async function xwe(e){e._state=Gt.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=Gt.LOADED,e)}catch{if(e.isDestroyed())return;SY(e)}}function _we(e){e._state=Gt.PROCESSING;let n=e._dracoLoader.decodedData.vertexAttributes,i=e._attributeSemantic,o=n[i],r=e._accessorId,a=e._gltf.accessors[r].type,c=o.array,d=o.data.quantization;l(d)&&(e._quantization=gwe(d,o.data.componentDatatype,o.data.componentsPerAttribute,a)),e._typedArray=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}async function Twe(e){e._state=Gt.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._typedArray=n.typedArray,e._state=Gt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;SY(e,n)}}function SY(e,t){throw e.unload(),e._state=Gt.FAILED,e.getError("Failed to load vertex buffer",t)}function CY(){this.typedArray=void 0,this.context=void 0,this.buffer=void 0}CY.prototype.set=function(e,t){this.typedArray=e,this.context=t};CY.prototype.execute=function(){this.buffer=oie(this.typedArray,this.context)};function oie(e,t){let n=ft.createVertexBuffer({typedArray:e,context:t,usage:Ue.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}var Swe=new CY;Kb.prototype.process=function(e){if(this._state===Gt.READY)return!0;if(this._state!==Gt.LOADED&&this._state!==Gt.PROCESSING)return!1;if(l(this._dracoLoader)){try{if(!this._dracoLoader.process(e))return!1}catch(i){SY(this,i)}_we(this)}let t,n=this._typedArray;if(this._loadBuffer&&this._asynchronous){let i=Swe;if(i.set(n,e.context),!e.jobScheduler.execute(i,Ra.BUFFER))return!1;t=i.buffer}else this._loadBuffer&&(t=oie(n,e.context));return this.unload(),this._buffer=t,this._typedArray=this._loadTypedArray?n:void 0,this._state=Gt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};Kb.prototype.unload=function(){l(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),l(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0};var dC=Kb;var _sn=T(S(),1);var hsn=T(S(),1);var Qrn=T(S(),1);function uI(e){e=g(e,g.EMPTY_OBJECT);let t=e.id,n=g(e.properties,{}),i={};for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];l(r.semantic)&&(i[r.semantic]=r)}this._id=t,this._name=e.name,this._description=e.description,this._properties=n,this._propertiesBySemantic=i,this._extras=ze(e.extras,!0),this._extensions=ze(e.extensions,!0)}uI.fromJson=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.id,n=e.class,i={};for(let o in n.properties)if(n.properties.hasOwnProperty(o)){let r=Mb.fromJson({id:o,property:n.properties[o],enums:e.enums});i[o]=r}return new uI({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(uI.prototype,{properties:{get:function(){return this._properties}},propertiesBySemantic:{get:function(){return this._propertiesBySemantic}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});uI.BATCH_TABLE_CLASS_NAME="_batchTable";var Xm=uI;var ssn=T(S(),1);var esn=T(S(),1);function ZN(e){e=g(e,g.EMPTY_OBJECT);let t=e.value,n=e.name;this._value=t,this._name=n,this._description=e.description,this._extras=ze(e.extras,!0),this._extensions=ze(e.extensions,!0)}ZN.fromJson=function(e){return new ZN({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(ZN.prototype,{value:{get:function(){return this._value}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var mI=ZN;function GN(e){e=g(e,g.EMPTY_OBJECT);let t=e.id,n=e.values,i={},o={},r=n.length;for(let a=0;a<r;++a){let c=n[a];i[c.value]=c.name,o[c.name]=c.value}let s=g(e.valueType,sn.UINT16);this._values=n,this._namesByValue=i,this._valuesByName=o,this._valueType=s,this._id=t,this._name=e.name,this._description=e.description,this._extras=ze(e.extras,!0),this._extensions=ze(e.extensions,!0)}GN.fromJson=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.id,n=e.enum,i=n.values.map(function(o){return mI.fromJson(o)});return new GN({id:t,values:i,valueType:sn[n.valueType],name:n.name,description:n.description,extras:n.extras,extensions:n.extensions})};Object.defineProperties(GN.prototype,{values:{get:function(){return this._values}},namesByValue:{get:function(){return this._namesByValue}},valuesByName:{get:function(){return this._valuesByName}},valueType:{get:function(){return this._valueType}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var hI=GN;function EN(e){e=g(e,g.EMPTY_OBJECT);let t=g(e.classes,{}),n=g(e.enums,{});this._classes=t,this._enums=n,this._id=e.id,this._name=e.name,this._description=e.description,this._version=e.version,this._extras=ze(e.extras,!0),this._extensions=ze(e.extensions,!0)}EN.fromJson=function(e){let t={};if(l(e.enums))for(let i in e.enums)e.enums.hasOwnProperty(i)&&(t[i]=hI.fromJson({id:i,enum:e.enums[i]}));let n={};if(l(e.classes))for(let i in e.classes)e.classes.hasOwnProperty(i)&&(n[i]=Xm.fromJson({id:i,class:e.classes[i],enums:t}));return new EN({id:e.id,name:e.name,description:e.description,version:e.version,classes:n,enums:t,extras:e.extras,extensions:e.extensions})};Object.defineProperties(EN.prototype,{classes:{get:function(){return this._classes}},enums:{get:function(){return this._enums}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},version:{get:function(){return this._version}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var Wm=EN;function Yx(e){e=g(e,g.EMPTY_OBJECT);let t=e.schema,n=e.resource,i=e.cacheKey;this._schema=l(t)?Wm.fromJson(t):void 0,this._resource=n,this._cacheKey=i,this._state=Gt.UNLOADED,this._promise=void 0}l(Object.create)&&(Yx.prototype=Object.create(co.prototype),Yx.prototype.constructor=Yx);Object.defineProperties(Yx.prototype,{cacheKey:{get:function(){return this._cacheKey}},schema:{get:function(){return this._schema}}});Yx.prototype.load=async function(){return l(this._promise)?this._promise:l(this._schema)?(this._promise=Promise.resolve(this),this._promise):(this._promise=Cwe(this),this._promise)};async function Cwe(e){let t=e._resource;e._state=Gt.LOADING;try{let n=await t.fetchJson();return e.isDestroyed()?void 0:(e._schema=Wm.fromJson(n),e._state=Gt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=Gt.FAILED;let i=`Failed to load schema: ${t.url}`;throw e.getError(i,n)}}Yx.prototype.unload=function(){this._schema=void 0};var uC=Yx;var Zsn=T(S(),1);var Pm={};function fI(e){return Ah(e.url)}function IN(e){let t=e.byteOffset,n=e.byteLength;if(ci(e,"EXT_meshopt_compression")){let i=e.extensions.EXT_meshopt_compression;t=g(i.byteOffset,0),n=i.byteLength}return`${t}-${t+n}`}function Vwe(e,t){let n=t.byteOffset+e.byteOffset,i=e.componentType,o=e.type,r=e.count;return`${n}-${i}-${o}-${r}`}function rie(e){return fI(e)}function sie(e,t){return`${fI(e)}-buffer-id-${t}`}function pI(e,t,n,i){if(l(e.uri)){let o=i.getDerivedResource({url:e.uri});return rie(o)}return sie(n,t)}function VY(e,t,n,i){let o=t.bufferView,r=e.bufferViews[o],s=r.buffer,a=e.buffers[s],c=pI(a,s,n,i),d=IN(r);return`${c}-range-${d}`}function aie(e,t,n,i){let o=e.images[t],r=o.bufferView,s=o.uri;if(l(s)){let p=i.getDerivedResource({url:s});return fI(p)}let a=e.bufferViews[r],c=a.buffer,d=e.buffers[c],u=pI(d,c,n,i),m=IN(a);return`${u}-range-${m}`}function Lwe(e,t){let n=Zl.createSampler({gltf:e,textureInfo:t});return`${n.wrapS}-${n.wrapT}-${n.minificationFilter}-${n.magnificationFilter}`}Pm.getSchemaCacheKey=function(e){let t=e.schema,n=e.resource;return l(t)?`embedded-schema:${JSON.stringify(t)}`:`external-schema:${fI(n)}`};Pm.getExternalBufferCacheKey=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.resource;return`external-buffer:${rie(t)}`};Pm.getEmbeddedBufferCacheKey=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.parentResource,n=e.bufferId;return`embedded-buffer:${sie(t,n)}`};Pm.getGltfCacheKey=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.gltfResource;return`gltf:${fI(t)}`};Pm.getBufferViewCacheKey=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.gltf,n=e.bufferViewId,i=e.gltfResource,o=e.baseResource,r=t.bufferViews[n],s=r.buffer,a=t.buffers[s];ci(r,"EXT_meshopt_compression")&&(s=r.extensions.EXT_meshopt_compression.buffer);let c=pI(a,s,i,o),d=IN(r);return`buffer-view:${c}-range-${d}`};Pm.getDracoCacheKey=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.gltf,n=e.draco,i=e.gltfResource,o=e.baseResource;return`draco:${VY(t,n,i,o)}`};Pm.getVertexBufferCacheKey=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.gltf,n=e.gltfResource,i=e.baseResource,o=e.frameState,r=e.bufferViewId,s=e.draco,a=e.attributeSemantic,c=g(e.dequantize,!1),d=g(e.loadBuffer,!1),u=g(e.loadTypedArray,!1),m="";if(c&&(m+="-dequantize"),d&&(m+="-buffer",m+=`-context-${o.context.id}`),u&&(m+="-typed-array"),l(s))return`vertex-buffer:${VY(t,s,n,i)}-draco-${a}${m}`;let p=t.bufferViews[r],y=p.buffer,f=t.buffers[y],x=pI(f,y,n,i),_=IN(p);return`vertex-buffer:${x}-range-${_}${m}`};Pm.getIndexBufferCacheKey=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.gltf,n=e.accessorId,i=e.gltfResource,o=e.baseResource,r=e.frameState,s=e.draco,a=g(e.loadBuffer,!1),c=g(e.loadTypedArray,!1),d="";if(a&&(d+="-buffer",d+=`-context-${r.context.id}`),c&&(d+="-typed-array"),l(s))return`index-buffer:${VY(t,s,i,o)}-draco${d}`;let u=t.accessors[n],m=u.bufferView,p=t.bufferViews[m],y=p.buffer,f=t.buffers[y],x=pI(f,y,i,o),_=Vwe(u,p);return`index-buffer:${x}-accessor-${_}${d}`};Pm.getImageCacheKey=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.gltf,n=e.imageId,i=e.gltfResource,o=e.baseResource;return`image:${aie(t,n,i,o)}`};Pm.getTextureCacheKey=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.gltf,n=e.textureInfo,i=e.gltfResource,o=e.baseResource,r=e.supportedImageFormats,s=e.frameState,a=n.index,c=Zl.getImageIdFromTexture({gltf:t,textureId:a,supportedImageFormats:r}),d=aie(t,c,i,o),u=Lwe(t,n);return`texture:${d}-sampler-${u}-context-${s.context.id}`};var Gl=Pm;var Isn=T(S(),1);function bI(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}bI.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}};bI.prototype.addGeometryLoader=function(e){let t=e.cacheKey;if(this._geometrySizes.hasOwnProperty(t))return;this._geometrySizes[t]=0;let n=e.buffer,i=e.typedArray,o=0;l(n)&&(o+=n.sizeInBytes),l(i)&&(o+=i.byteLength),this.geometryByteLength+=o,this._geometrySizes[t]=o};bI.prototype.addTextureLoader=function(e){let t=e.cacheKey;if(this._textureSizes.hasOwnProperty(t))return;this._textureSizes[t]=0;let n=e.texture.sizeInBytes;this.texturesByteLength+=e.texture.sizeInBytes,this._textureSizes[t]=n};bI.prototype.removeLoader=function(e){let t=e.cacheKey,n=this._geometrySizes[t];delete this._geometrySizes[t],l(n)&&(this.geometryByteLength-=n);let i=this._textureSizes[t];delete this._textureSizes[t],l(i)&&(this.texturesByteLength-=i)};var yI=bI;function An(){}An.cacheEntries={};An.statistics=new yI;function Rwe(e){this.referenceCount=1,this.resourceLoader=e,this._statisticsPromise=void 0}An.get=function(e){let t=An.cacheEntries[e];if(l(t))return++t.referenceCount,t.resourceLoader};An.add=function(e){let t=e.cacheKey;return An.cacheEntries[t]=new Rwe(e),e};An.unload=function(e){let t=e.cacheKey,n=An.cacheEntries[t];--n.referenceCount,n.referenceCount===0&&(An.statistics.removeLoader(e),e.destroy(),delete An.cacheEntries[t])};An.getSchemaLoader=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.schema,n=e.resource,i=Gl.getSchemaCacheKey({schema:t,resource:n}),o=An.get(i);return l(o)?o:(o=new uC({schema:t,resource:n,cacheKey:i}),An.add(o))};An.getEmbeddedBufferLoader=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.parentResource,n=e.bufferId,i=e.typedArray,o=Gl.getEmbeddedBufferCacheKey({parentResource:t,bufferId:n}),r=An.get(o);return l(r)?r:(r=new Ax({typedArray:i,cacheKey:o}),An.add(r))};An.getExternalBufferLoader=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.resource,n=Gl.getExternalBufferCacheKey({resource:t}),i=An.get(n);return l(i)?i:(i=new Ax({resource:t,cacheKey:n}),An.add(i))};An.getGltfJsonLoader=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.gltfResource,n=e.baseResource,i=e.typedArray,o=e.gltfJson,r=Gl.getGltfCacheKey({gltfResource:t}),s=An.get(r);return l(s)?s:(s=new cC({resourceCache:An,gltfResource:t,baseResource:n,typedArray:i,gltfJson:o,cacheKey:r}),An.add(s))};An.getBufferViewLoader=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.gltf,n=e.bufferViewId,i=e.gltfResource,o=e.baseResource,r=Gl.getBufferViewCacheKey({gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}),s=An.get(r);return l(s)?s:(s=new iC({resourceCache:An,gltf:t,bufferViewId:n,gltfResource:i,baseResource:o,cacheKey:r}),An.add(s))};An.getDracoLoader=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.gltf,n=e.draco,i=e.gltfResource,o=e.baseResource,r=Gl.getDracoCacheKey({gltf:t,draco:n,gltfResource:i,baseResource:o}),s=An.get(r);return l(s)?s:(s=new oC({resourceCache:An,gltf:t,draco:n,gltfResource:i,baseResource:o,cacheKey:r}),An.add(s))};An.getVertexBufferLoader=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.gltf,n=e.gltfResource,i=e.baseResource,o=e.frameState,r=e.bufferViewId,s=e.draco,a=e.attributeSemantic,c=e.accessorId,d=g(e.asynchronous,!0),u=g(e.dequantize,!1),m=g(e.loadBuffer,!1),p=g(e.loadTypedArray,!1),y=Gl.getVertexBufferCacheKey({gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:s,attributeSemantic:a,dequantize:u,loadBuffer:m,loadTypedArray:p}),f=An.get(y);return l(f)?f:(f=new dC({resourceCache:An,gltf:t,gltfResource:n,baseResource:i,bufferViewId:r,draco:s,attributeSemantic:a,accessorId:c,cacheKey:y,asynchronous:d,dequantize:u,loadBuffer:m,loadTypedArray:p}),An.add(f))};An.getIndexBufferLoader=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.gltf,n=e.accessorId,i=e.gltfResource,o=e.baseResource,r=e.frameState,s=e.draco,a=g(e.asynchronous,!0),c=g(e.loadBuffer,!1),d=g(e.loadTypedArray,!1),u=Gl.getIndexBufferCacheKey({gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:s,loadBuffer:c,loadTypedArray:d}),m=An.get(u);return l(m)?m:(m=new sC({resourceCache:An,gltf:t,accessorId:n,gltfResource:i,baseResource:o,draco:s,cacheKey:u,asynchronous:a,loadBuffer:c,loadTypedArray:d}),An.add(m))};An.getImageLoader=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.gltf,n=e.imageId,i=e.gltfResource,o=e.baseResource,r=Gl.getImageCacheKey({gltf:t,imageId:n,gltfResource:i,baseResource:o}),s=An.get(r);return l(s)?s:(s=new rC({resourceCache:An,gltf:t,imageId:n,gltfResource:i,baseResource:o,cacheKey:r}),An.add(s))};An.getTextureLoader=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.gltf,n=e.textureInfo,i=e.gltfResource,o=e.baseResource,r=e.supportedImageFormats,s=e.frameState,a=g(e.asynchronous,!0),c=Gl.getTextureCacheKey({gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s}),d=An.get(c);return l(d)?d:(d=new lC({resourceCache:An,gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,cacheKey:c,asynchronous:a}),An.add(d))};An.clearForSpecs=function(){let e=[dC,sC,oC,lC,rC,iC,Ax,uC,cC],t,n=An.cacheEntries,i=[];for(t in n)n.hasOwnProperty(t)&&i.push(n[t]);i.sort(function(r,s){let a=e.indexOf(r.resourceLoader.constructor),c=e.indexOf(s.resourceLoader.constructor);return a-c});let o=i.length;for(let r=0;r<o;++r){let s=i[r];t=s.resourceLoader.cacheKey,l(n[t])&&(s.resourceLoader.destroy(),delete n[t])}An.statistics.clear()};var Yi=An;function ta(e,t,n){this._resource=e,this._subtreeJson=void 0,this._bufferLoader=void 0,this._tileAvailability=void 0,this._contentAvailabilityBitstreams=[],this._childSubtreeAvailability=void 0,this._implicitCoordinates=n,this._subtreeLevels=t.subtreeLevels,this._subdivisionScheme=t.subdivisionScheme,this._branchingFactor=t.branchingFactor,this._metadata=void 0,this._tileMetadataTable=void 0,this._tilePropertyTableJson=void 0,this._contentMetadataTables=[],this._contentPropertyTableJsons=[],this._tileJumpBuffer=void 0,this._contentJumpBuffers=[],this._ready=!1}Object.defineProperties(ta.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}},tileMetadataTable:{get:function(){return this._tileMetadataTable}},tilePropertyTableJson:{get:function(){return this._tilePropertyTableJson}},contentMetadataTables:{get:function(){return this._contentMetadataTables}},contentPropertyTableJsons:{get:function(){return this._contentPropertyTableJsons}},implicitCoordinates:{get:function(){return this._implicitCoordinates}}});ta.prototype.tileIsAvailableAtIndex=function(e){return this._tileAvailability.getBit(e)};ta.prototype.tileIsAvailableAtCoordinates=function(e){let t=this.getTileIndex(e);return this.tileIsAvailableAtIndex(t)};ta.prototype.contentIsAvailableAtIndex=function(e,t){return t=g(t,0),this._contentAvailabilityBitstreams[t].getBit(e)};ta.prototype.contentIsAvailableAtCoordinates=function(e,t){let n=this.getTileIndex(e);return this.contentIsAvailableAtIndex(n,t)};ta.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)};ta.prototype.childSubtreeIsAvailableAtCoordinates=function(e){let t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)};ta.prototype.getLevelOffset=function(e){let t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)};ta.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===Yr.OCTREE&&(t=3),e>>t};ta.fromSubtreeJson=async function(e,t,n,i,o){let r=new ta(e,i,o),s;l(t)?s={json:t,binary:void 0}:s=Zwe(n);let a=s.json;r._subtreeJson=a;let c;if(ci(a,"3DTILES_metadata"))c=a.extensions["3DTILES_metadata"];else if(l(a.tileMetadata)){let V=a.tileMetadata;c=a.propertyTables[V]}let d=[];if(l(a.contentMetadata)){let V=a.contentMetadata.length;for(let L=0;L<V;L++){let Z=a.contentMetadata[L];d.push(a.propertyTables[Z])}}let u,m=i.metadataSchema,p=a.subtreeMetadata;if(l(p)){let V=p.class,L=m.classes[V];u=new QE({subtreeMetadata:p,class:L})}r._metadata=u,r._tilePropertyTableJson=c,r._contentPropertyTableJsons=d;let y={constant:0};a.contentAvailabilityHeaders=[],ci(a,"3DTILES_multiple_contents")?a.contentAvailabilityHeaders=a.extensions["3DTILES_multiple_contents"].contentAvailability:Array.isArray(a.contentAvailability)?a.contentAvailabilityHeaders=a.contentAvailability:a.contentAvailabilityHeaders.push(g(a.contentAvailability,y));let f=Gwe(a.buffers),x=Ewe(a.bufferViews,f);Iwe(a,x),l(c)&&cie(c,x);for(let V=0;V<d.length;V++){let L=d[V];cie(L,x)}let _=await Xwe(r,f,s.binary),C=Pwe(x,_);return vwe(r,a,i,C),l(c)&&(wwe(r,i,C),Awe(r)),Fwe(r,i,C),Mwe(r),r._ready=!0,r};function Zwe(e){let n=new DataView(e.buffer,e.byteOffset),i=8,o=n.getUint32(i,!0);i+=8;let r=n.getUint32(i,!0);i+=8;let s=Po(e,i,o);i+=o;let a=e.subarray(i,i+r);return{json:s,binary:a}}function Gwe(e){e=l(e)?e:[];for(let t=0;t<e.length;t++){let n=e[t];n.isExternal=l(n.uri),n.isActive=!1}return e}function Ewe(e,t){e=l(e)?e:[];for(let n=0;n<e.length;n++){let i=e[n],o=t[i.buffer];i.bufferHeader=o,i.isActive=!1}return e}function Iwe(e,t){let n,i=e.tileAvailability;l(i.bitstream)?n=t[i.bitstream]:l(i.bufferView)&&(n=t[i.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);let o=e.contentAvailabilityHeaders;for(let s=0;s<o.length;s++)n=void 0,l(o[s].bitstream)?n=t[o[s].bitstream]:l(o[s].bufferView)&&(n=t[o[s].bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);n=void 0;let r=e.childSubtreeAvailability;l(r.bitstream)?n=t[r.bitstream]:l(r.bufferView)&&(n=t[r.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0)}function cie(e,t){let n=e.properties,i;for(let o in n)if(n.hasOwnProperty(o)){let r=n[o],s=g(r.values,r.bufferView);i=t[s],i.isActive=!0,i.bufferHeader.isActive=!0;let a=g(r.stringOffsets,r.stringOffsetBufferView);l(a)&&(i=t[a],i.isActive=!0,i.bufferHeader.isActive=!0);let c=g(r.arrayOffsets,r.arrayOffsetBufferView);l(c)&&(i=t[c],i.isActive=!0,i.bufferHeader.isActive=!0)}}function Xwe(e,t,n){let i=[];for(let o=0;o<t.length;o++){let r=t[o];if(!r.isActive)i.push(Promise.resolve(void 0));else if(r.isExternal){let s=Wwe(e,r);i.push(s)}else i.push(Promise.resolve(n))}return Promise.all(i).then(function(o){let r={};for(let s=0;s<o.length;s++){let a=o[s];l(a)&&(r[s]=a)}return r})}async function Wwe(e,t){let i=e._resource.getDerivedResource({url:t.uri}),o=Yi.getExternalBufferLoader({resource:i});e._bufferLoader=o;try{await o.load()}catch(r){if(o.isDestroyed())return;throw r}return o.typedArray}function Pwe(e,t){let n={};for(let i=0;i<e.length;i++){let o=e[i];if(!o.isActive)continue;let r=o.byteOffset,s=r+o.byteLength,c=t[o.buffer].subarray(r,s);n[i]=c}return n}function vwe(e,t,n,i){let o=n.branchingFactor,r=n.subtreeLevels,s=(Math.pow(o,r)-1)/(o-1),a=Math.pow(o,r),c=ci(t,"3DTILES_metadata"),d=l(e._tilePropertyTableJson),u=c||d;e._tileAvailability=LY(t.tileAvailability,i,s,u);let m=e._contentPropertyTableJsons.length>0;u=u||m;for(let p=0;p<t.contentAvailabilityHeaders.length;p++){let y=LY(t.contentAvailabilityHeaders[p],i,s,u);e._contentAvailabilityBitstreams.push(y)}e._childSubtreeAvailability=LY(t.childSubtreeAvailability,i,a)}function LY(e,t,n,i){if(l(e.constant))return new tC({constant:!!e.constant,lengthBits:n,availableCount:e.availableCount});let o;return l(e.bitstream)?o=t[e.bitstream]:l(e.bufferView)&&(o=t[e.bufferView]),new tC({bitstream:o,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function wwe(e,t,n){let i=e._tilePropertyTableJson,o=e._tileAvailability.availableCount,r=t.metadataSchema,s=i.class,a=r.classes[s];e._tileMetadataTable=new Ll({class:a,count:o,properties:i.properties,bufferViews:n})}function Fwe(e,t,n){let i=e._contentPropertyTableJsons,o=e._contentAvailabilityBitstreams,r=t.metadataSchema,s=e._contentMetadataTables;for(let a=0;a<i.length;a++){let c=i[a],u=o[a].availableCount,m=c.class,p=r.classes[m],y=new Ll({class:p,count:u,properties:c.properties,bufferViews:n});s.push(y)}}function lie(e){let t=0,n=e.lengthBits,i=e.availableCount,o;i<256?o=new Uint8Array(n):i<65536?o=new Uint16Array(n):o=new Uint32Array(n);for(let r=0;r<e.lengthBits;r++)e.getBit(r)&&(o[r]=t,t++);return o}function Awe(e){let t=lie(e._tileAvailability);e._tileJumpBuffer=t}function Mwe(e){let t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let i=0;i<n.length;i++){let o=n[i],r=lie(o);t.push(r)}}ta.prototype.getTileIndex=function(e){let t=e.level-this._implicitCoordinates.level;if(t<0||this._subtreeLevels<=t)throw new me("level is out of bounds for this subtree");return e.getSubtreeCoordinates().getOffsetCoordinates(e).tileIndex};ta.prototype.getChildSubtreeIndex=function(e){if(e.level-this._implicitCoordinates.level!==this._implicitCoordinates.subtreeLevels)throw new me("level is out of bounds for this subtree");return e.getParentSubtreeCoordinates().getOffsetCoordinates(e).mortonIndex};function Nwe(e,t){if(!l(e._tileMetadataTable))return;let n=e.getTileIndex(t);if(e._tileAvailability.getBit(n))return e._tileJumpBuffer[n]}function Uwe(e,t,n){let i=e._contentMetadataTables;if(!l(i))return;let o=i[n];if(!l(o))return;let r=e._contentAvailabilityBitstreams[n],s=e.getTileIndex(t);if(r.getBit(s))return e._contentJumpBuffers[n][s]}ta.prototype.getTileMetadataView=function(e){let t=Nwe(this,e);if(!l(t))return;let n=this._tileMetadataTable;return new nC({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})};ta.prototype.getContentMetadataView=function(e,t){let n=Uwe(this,e,t);if(!l(n))return;let i=this._contentMetadataTables[t],o=this._contentPropertyTableJsons[t];return new nC({class:i.class,metadataTable:i,entityId:n,contentIndex:t,propertyTableJson:o})};ta.prototype.isDestroyed=function(){return!1};ta.prototype.destroy=function(){return l(this._bufferLoader)&&Yi.unload(this._bufferLoader),ue(this)};var Hx=ta;var aan=T(S(),1),kwe={ID:"ID",NAME:"NAME",DESCRIPTION:"DESCRIPTION",TILESET_TILE_COUNT:"TILESET_TILE_COUNT",TILE_BOUNDING_BOX:"TILE_BOUNDING_BOX",TILE_BOUNDING_REGION:"TILE_BOUNDING_REGION",TILE_BOUNDING_SPHERE:"TILE_BOUNDING_SPHERE",TILE_MINIMUM_HEIGHT:"TILE_MINIMUM_HEIGHT",TILE_MAXIMUM_HEIGHT:"TILE_MAXIMUM_HEIGHT",TILE_HORIZON_OCCLUSION_POINT:"TILE_HORIZON_OCCLUSION_POINT",TILE_GEOMETRIC_ERROR:"TILE_GEOMETRIC_ERROR",CONTENT_BOUNDING_BOX:"CONTENT_BOUNDING_BOX",CONTENT_BOUNDING_REGION:"CONTENT_BOUNDING_REGION",CONTENT_BOUNDING_SPHERE:"CONTENT_BOUNDING_SPHERE",CONTENT_MINIMUM_HEIGHT:"CONTENT_MINIMUM_HEIGHT",CONTENT_MAXIMUM_HEIGHT:"CONTENT_MAXIMUM_HEIGHT",CONTENT_HORIZON_OCCLUSION_POINT:"CONTENT_HORIZON_OCCLUSION_POINT"},Kx=Object.freeze(kwe);var dan=T(S(),1);var vm={};vm.parseAllBoundingVolumeSemantics=function(e){return{tile:{boundingVolume:vm.parseBoundingVolumeSemantic("TILE",e),minimumHeight:vm._parseMinimumHeight("TILE",e),maximumHeight:vm._parseMaximumHeight("TILE",e)},content:{boundingVolume:vm.parseBoundingVolumeSemantic("CONTENT",e),minimumHeight:vm._parseMinimumHeight("CONTENT",e),maximumHeight:vm._parseMaximumHeight("CONTENT",e)}}};vm.parseBoundingVolumeSemantic=function(e,t){let n=`${e}_BOUNDING_BOX`,i=t.getPropertyBySemantic(n);if(l(i))return{box:i};let o=`${e}_BOUNDING_REGION`,r=t.getPropertyBySemantic(o);if(l(r))return{region:r};let s=`${e}_BOUNDING_SPHERE`,a=t.getPropertyBySemantic(s);if(l(a))return{sphere:a}};vm._parseMinimumHeight=function(e,t){let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};vm._parseMaximumHeight=function(e,t){let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};var zx=vm;function Uc(e,t,n){let i=t.implicitTileset,o=t.implicitCoordinates;this._implicitTileset=i,this._implicitCoordinates=o,this._implicitSubtree=void 0,this._tileset=e,this._tile=t,this._resource=n,this._metadata=void 0,this.featurePropertiesDirty=!1,this._group=void 0;let r=o.getTemplateValues(),s=i.subtreeUriTemplate.getDerivedResource({templateValues:r});this._url=s.getUrlComponent(!0),this._ready=!1}Object.defineProperties(Uc.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(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._url}},metadata:{get:function(){},set:function(){}},batchTable:{get:function(){}},group:{get:function(){return this._group},set:function(e){this._group=e}}});Uc.fromSubtreeJson=async function(e,t,n,i,o,r){r=g(r,0);let s;l(o)&&(s=new Uint8Array(o,r));let a=t.implicitTileset,c=t.implicitCoordinates,d=await Hx.fromSubtreeJson(n,i,s,a,c),u=new Uc(e,t,n);return u._implicitSubtree=d,Dwe(u,d),u._ready=!0,u};function Dwe(e,t){let n=e._tile,i=e._implicitCoordinates.childIndex,o=Owe(e,t,n,i),r=e._tileset.statistics;n.children.push(o.rootTile),r.numberOfTilesTotal++;let s=Bwe(e,t,o.bottomRow);for(let a=0;a<s.length;a++){let c=s[a],d=c.tile,u=$we(e,d,c.childIndex);d.children.push(u),r.numberOfTilesTotal++}}function Bwe(e,t,n){let i=[],o=e._implicitTileset.branchingFactor;for(let r=0;r<n.length;r++){let s=n[r];if(l(s))for(let a=0;a<o;a++){let c=r*o+a;t.childSubtreeIsAvailableAtIndex(c)&&i.push({tile:s,childIndex:a})}}return i}function Owe(e,t,n,i){let s=die(e,t,n,i,0,!0),a=e._tileset.statistics,c=[s],d=[],u=e._implicitTileset;for(let m=1;m<u.subtreeLevels;m++){let p=t.getLevelOffset(m),y=u.branchingFactor*c.length;for(let f=0;f<y;f++){let x=p+f;if(!t.tileIsAvailableAtIndex(x)){d.push(void 0);continue}let _=t.getParentMortonIndex(f),C=c[_],V=f%u.branchingFactor,L=die(e,t,C,V,x);C.children.push(L),a.numberOfTilesTotal++,d.push(L)}c=d,d=[]}return{rootTile:s,bottomRow:c}}function uie(e,t,n){let i=Kx.TILE_GEOMETRIC_ERROR;return l(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function die(e,t,n,i,o,r){let s=e._implicitTileset,a;g(r,!1)?a=n.implicitCoordinates:a=n.implicitCoordinates.getChildCoordinates(i);let c,d,u;if(l(t.tilePropertyTableJson)){c=t.getTileMetadataView(a);let I=zx.parseAllBoundingVolumeSemantics(c);d=I.tile,u=I.content}let p=t.contentPropertyTableJsons.length,y=!1;for(let I=0;I<p;I++)if(t.contentIsAvailableAtCoordinates(a,I)){y=!0;break}let f=Kwe(s,a,i,r,n,d),x=[];for(let I=0;I<s.contentCount;I++){if(!t.contentIsAvailableAtIndex(o,I))continue;let F={uri:s.contentUriTemplates[I].getDerivedResource({templateValues:a.getTemplateValues()}).url},M=zwe(f,u);l(M)&&(F.boundingVolume=M),x.push(Tt(F,s.contentHeaders[I]))}let _=uie(c,s,a),C={boundingVolume:f,geometricError:_,refine:s.refine,contents:x},V=!0,L=ze(s.tileHeader,V);delete L.boundingVolume,delete L.transform,delete L.metadata;let Z=Tt(C,L,V),G=bie(e,s.baseResource,Z,n);return G.implicitCoordinates=a,G.implicitSubtree=t,G.metadata=c,G.hasImplicitContentMetadata=y,G}function XN(e,t){return l(e)&&l(t)&&(l(t.minimumHeight)||l(t.maximumHeight))&&(ci(e,"3DTILES_bounding_volume_S2")||l(e.region))}function ZY(e,t){l(t)&&(ci(e,"3DTILES_bounding_volume_S2")?Hwe(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):l(e.region)&&Ywe(e.region,t.minimumHeight,t.maximumHeight))}function Ywe(e,t,n){l(t)&&(e[4]=t),l(n)&&(e[5]=n)}function Hwe(e,t,n){l(t)&&(e.minimumHeight=t),l(n)&&(e.maximumHeight=n)}function Kwe(e,t,n,i,o,r){let s;return!l(r)||!l(r.boundingVolume)||!XN(r.boundingVolume,r)&&XN(e.boundingVolume,r)?s=mie(e,t,n,g(i,!1),o):s=r.boundingVolume,ZY(s,r),s}function zwe(e,t){let n;return l(t)&&(n=t.boundingVolume),XN(n,t)?ZY(n,t):XN(e,t)&&(n=ze(e,!0),ZY(n,t)),n}function mie(e,t,n,i,o){let r=e.boundingVolume;return ci(r,"3DTILES_bounding_volume_S2")?hie(i,o,n,t.level,t.x,t.y,t.z):l(r.region)?{region:pie(r.region,t.level,t.x,t.y,t.z)}:{box:fie(r.box,t.level,t.x,t.y,t.z)}}function hie(e,t,n,i,o,r,s){let a=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:vp.getTokenFromId(a.s2Cell._cellId),minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight}}};let c=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),d=c%2===0?$S.encode2D(i,o,r):$S.encode2D(i,r,o),u=vp.fromFacePositionLevel(c,BigInt(d),i),m,p;if(l(s)){let y=(a.maximumHeight+a.minimumHeight)/2;m=n<4?a.minimumHeight:y,p=n<4?y:a.maximumHeight}else m=a.minimumHeight,p=a.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:vp.getTokenFromId(u._cellId),minimumHeight:m,maximumHeight:p}}}}var Jwe=new h,Qwe=new h,RY=new h,jwe=new q;function fie(e,t,n,i,o){if(t===0)return e;let r=h.unpack(e,0,Qwe),s=q.unpack(e,3,jwe),a=Math.pow(2,-t),c=-1+(2*n+1)*a,d=-1+(2*i+1)*a,u=0,m=h.fromElements(a,a,1,Jwe);l(o)&&(u=-1+(2*o+1)*a,m.z=a);let p=h.fromElements(c,d,u,RY);p=q.multiplyByVector(s,p,RY),p=h.add(p,r,RY);let y=q.clone(s);y=q.multiplyByScale(y,m,y);let f=new Array(12);return h.pack(p,f),q.pack(y,f,3),f}var qwe=new de;function pie(e,t,n,i,o){if(t===0)return e.slice();let r=de.unpack(e,0,qwe),s=e[4],a=e[5],c=Math.pow(2,-t),d=c*r.width,u=W.negativePiToPi(r.west+n*d),m=W.negativePiToPi(u+d),p=c*r.height,y=W.negativePiToPi(r.south+i*p),f=W.negativePiToPi(y+p),x=s,_=a;if(l(o)){let C=c*(a-s);x+=o*C,_=x+C}return[u,y,m,f,x,_]}function $we(e,t,n){let i=e._implicitTileset,o=t.implicitCoordinates.getChildCoordinates(n),r=mie(i,o,n,!1,t),s=uie(void 0,i,o),a=i.subtreeUriTemplate.getDerivedResource({templateValues:o.getTemplateValues()}).url,c={boundingVolume:r,geometricError:s,refine:i.refine,contents:[{uri:a}]},d=bie(e,i.baseResource,c,t);return d.implicitTileset=i,d.implicitCoordinates=o,d}function bie(e,t,n,i){let o=e._tile.constructor;return new o(e._tileset,t,n,i)}Uc.prototype.hasProperty=function(e,t){return!1};Uc.prototype.getFeature=function(e){};Uc.prototype.applyDebugSettings=function(e,t){};Uc.prototype.applyStyle=function(e){};Uc.prototype.update=function(e,t){};Uc.prototype.pick=function(e,t,n){};Uc.prototype.isDestroyed=function(){return!1};Uc.prototype.destroy=function(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),ue(this)};Uc._deriveBoundingBox=fie;Uc._deriveBoundingRegion=pie;Uc._deriveBoundingVolumeS2=hie;var mC=Uc;var SLn=T(S(),1);var Ean=T(S(),1),eFe={NONE:0,REPEAT:1,MIRRORED_REPEAT:2},El=Object.freeze(eFe);var mLn=T(S(),1);var $an=T(S(),1);var Pan=T(S(),1);function hC(e,t){this._distance=t,this._normal=new yie(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(hC.prototype,{distance:{get:function(){return this._distance},set:function(e){l(this.onChangeCallback)&&e!==this._distance&&this.onChangeCallback(this.index),this._distance=e}},normal:{get:function(){return this._normal},set:function(e){l(this.onChangeCallback)&&!h.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),h.clone(e,this._normal._cartesian3)}}});hC.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new hC(e.normal,e.distance),t};hC.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new hC(e.normal,e.distance)};function yie(e,t){this._clippingPlane=t,this._cartesian3=h.clone(e)}Object.defineProperties(yie.prototype,{x:{get:function(){return this._cartesian3.x},set:function(e){l(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){l(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){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.z&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.z=e}}});var Jx=hC;function nc(e){e=g(e,g.EMPTY_OBJECT),this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=g(e.enabled,!0),this.modelMatrix=A.clone(g(e.modelMatrix,A.IDENTITY)),this.edgeColor=O.clone(g(e.edgeColor,O.WHITE)),this.edgeWidth=g(e.edgeWidth,0),this.planeAdded=new ye,this.planeRemoved=new ye,this._owner=void 0;let t=g(e.unionClippingRegions,!1);this._unionClippingRegions=t,this._testIntersection=t?Sie:Cie,this._uint8View=void 0,this._float32View=void 0,this._clippingPlanesTexture=void 0;let n=e.planes;if(l(n)){let i=n.length;for(let o=0;o<i;++o)this.add(n[o])}}function Sie(e){return e===nn.OUTSIDE}function Cie(e){return e===nn.INSIDE}Object.defineProperties(nc.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?Sie:Cie)}},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}}});function gie(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}nc.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){gie(n,i)},e.index=t,gie(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};nc.prototype.get=function(e){return this._planes[e]};function Vie(e,t){let n=e.length;for(let i=0;i<n;++i)if(ln.equals(e[i],t))return i;return-1}nc.prototype.contains=function(e){return Vie(this._planes,e)!==-1};nc.prototype.remove=function(e){let t=this._planes,n=Vie(t,e);if(n===-1)return!1;e instanceof Jx&&(e.onChangeCallback=void 0,e.index=-1);let i=t.length-1;for(let o=n;o<i;++o){let r=t[o+1];t[o]=r,r instanceof Jx&&(r.index=o)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};nc.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof Jx&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var tFe=new se,nFe=new se;function xie(e,t,n){let i=e._uint8View,o=e._planes,r=0;for(let s=t;s<n;++s){let a=o[s],c=Fn.octEncodeToCartesian4(a.normal,nFe);i[r]=c.x,i[r+1]=c.y,i[r+2]=c.z,i[r+3]=c.w;let d=se.packFloat(a.distance,tFe);i[r+4]=d.x,i[r+5]=d.y,i[r+6]=d.z,i[r+7]=d.w,r+=8}}function _ie(e,t,n){let i=e._float32View,o=e._planes,r=0;for(let s=t;s<n;++s){let a=o[s],c=a.normal;i[r]=c.x,i[r+1]=c.y,i[r+2]=c.z,i[r+3]=a.distance,r+=4}}function Lie(e,t){let n=Yt.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var iFe=new B;nc.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=nc.useFloatTexture(n),o=i?this.length:this.length*2;if(l(t)){let s=t.width*t.height;(s<o||o<.25*s)&&(t.destroy(),t=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!l(t)){let s=Lie(o,iFe);s.y*=2,i?(t=new wt({context:n,width:s.x,height:s.y,pixelFormat:at.RGBA,pixelDatatype:je.FLOAT,sampler:hn.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4)):(t=new wt({context:n,width:s.x,height:s.y,pixelFormat:at.RGBA,pixelDatatype:je.UNSIGNED_BYTE,sampler:hn.NEAREST,flipY:!1}),this._uint8View=new Uint8Array(s.x*s.y*4)),this._clippingPlanesTexture=t,this._multipleDirtyPlanes=!0}let r=this._dirtyIndex;if(!(!this._multipleDirtyPlanes&&r===-1)){if(this._multipleDirtyPlanes)i?(_ie(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(xie(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._uint8View}}));else{let s=0,a=0;i?(a=Math.floor(r/t.width),s=Math.floor(r-a*t.width),_ie(this,r,r+1),t.copyFrom({source:{width:1,height:1,arrayBufferView:this._float32View},xOffset:s,yOffset:a})):(a=Math.floor(r*2/t.width),s=Math.floor(r*2-a*t.width),xie(this,r,r+1),t.copyFrom({source:{width:2,height:1,arrayBufferView:this._uint8View},xOffset:s,yOffset:a}))}this._multipleDirtyPlanes=!1,this._dirtyIndex=-1}};var oFe=new A,Tie=new ln(h.UNIT_X,0);nc.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,o=this.modelMatrix;l(t)&&(o=A.multiply(t,o,oFe));let r=nn.INSIDE;!this.unionClippingRegions&&i>0&&(r=nn.OUTSIDE);for(let s=0;s<i;++s){let a=n[s];ln.transform(a,o,Tie);let c=e.intersectPlane(Tie);if(c===nn.INTERSECTING)r=c;else if(this._testIntersection(c))return c}return r};nc.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};nc.useFloatTexture=function(e){return e.floatingPointTexture};nc.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let o=nc.useFloatTexture(t)?e.length:e.length*2,r=Lie(o,n);return r.y*=2,r};nc.prototype.isDestroyed=function(){return!1};nc.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),ue(this)};var ys=nc;var ncn=T(S(),1);var gI={HIGHLIGHT:0,REPLACE:1,MIX:2};gI.getColorBlend=function(e,t){if(e===gI.HIGHLIGHT)return 0;if(e===gI.REPLACE)return 1;if(e===gI.MIX)return W.clamp(t,W.EPSILON4,1)};var ic=Object.freeze(gI);var gdn=T(S(),1);var ocn=T(S(),1),rFe={XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"},oc=Object.freeze(rFe);var scn=T(S(),1),sFe={STEP:0,LINEAR:1,CUBICSPLINE:2},wm=Object.freeze(sFe);var fln=T(S(),1);var Qcn=T(S(),1);var bcn=T(S(),1);var ucn=T(S(),1);var Rie={};function xI(e){this._count=e.count,this._properties=ze(e.properties,!0)}xI.prototype.hasProperty=function(e){return Nn.hasProperty(e,this._properties,Rie)};xI.prototype.getPropertyIds=function(e){return Nn.getPropertyIds(this._properties,Rie,e)};xI.prototype.getProperty=function(e,t){let n=this._properties[t];if(l(n))return ze(n[e],!0)};xI.prototype.setProperty=function(e,t,n){let i=this._properties[t];l(i)||(i=new Array(this._count),this._properties[t]=i),i[e]=ze(n,!0)};var kp=xI;function rc(e){e=g(e,g.EMPTY_OBJECT),this._name=e.name,this._id=e.id,this._count=e.count,this._extras=e.extras,this._extensions=e.extensions,this._metadataTable=e.metadataTable,this._jsonMetadataTable=e.jsonMetadataTable,this._batchTableHierarchy=e.batchTableHierarchy}Object.defineProperties(rc.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},count:{get:function(){return this._count}},class:{get:function(){if(l(this._metadataTable))return this._metadataTable.class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){let e=0;return l(this._metadataTable)&&(e+=this._metadataTable.byteLength),l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e}}});rc.prototype.hasProperty=function(e,t){return!!(l(this._metadataTable)&&this._metadataTable.hasProperty(t)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)||l(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(t))};rc.prototype.hasPropertyBySemantic=function(e,t){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};rc.prototype.propertyExists=function(e){return!!(l(this._metadataTable)&&this._metadataTable.hasProperty(e)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.propertyExists(e)||l(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(e))};rc.prototype.propertyExistsBySemantic=function(e){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var GY=[];rc.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,l(this._metadataTable)&&t.push.apply(t,this._metadataTable.getPropertyIds(GY)),l(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,GY)),l(this._jsonMetadataTable)&&t.push.apply(t,this._jsonMetadataTable.getPropertyIds(GY)),t};rc.prototype.getProperty=function(e,t){let n;if(l(this._metadataTable)&&(n=this._metadataTable.getProperty(e,t),l(n))||l(this._batchTableHierarchy)&&(n=this._batchTableHierarchy.getProperty(e,t),l(n))||l(this._jsonMetadataTable)&&(n=this._jsonMetadataTable.getProperty(e,t),l(n)))return n};rc.prototype.setProperty=function(e,t,n){l(this._metadataTable)&&this._metadataTable.setProperty(e,t,n)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n)||(l(this._jsonMetadataTable)||(this._jsonMetadataTable=new kp({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,n))};rc.prototype.getPropertyBySemantic=function(e,t){if(l(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};rc.prototype.setPropertyBySemantic=function(e,t,n){return l(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};rc.prototype.getPropertyTypedArray=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};rc.prototype.getPropertyTypedArrayBySemantic=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};rc.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};rc.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};rc.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};var kc=rc;var Gcn=T(S(),1);var Ccn=T(S(),1);function _I(e){e=g(e,g.EMPTY_OBJECT);let t=e.property,n=e.classProperty,i=e.textures,o=l(t.channels)?t.channels:[0],r=t,s=Zl.createModelTextureReader({textureInfo:r,channels:lFe(o),texture:i[r.index]});this._min=t.min,this._max=t.max;let a=t.offset,c=t.scale,d=n.hasValueTransform||l(a)||l(c);a=g(a,n.offset),c=g(c,n.scale),a=n.unpackVectorAndMatrixTypes(a),c=n.unpackVectorAndMatrixTypes(c),this._offset=a,this._scale=c,this._hasValueTransform=d,this._textureReader=s,this._classProperty=n,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(_I.prototype,{textureReader:{get:function(){return this._textureReader}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});_I.prototype.isGpuCompatible=function(){let e=this._classProperty,t=e.type,n=e.componentType;return e.isArray?!e.isVariableLengthArray&&e.arrayLength<=4&&t===Ht.SCALAR&&n===sn.UINT8:Ht.isVectorType(t)||t===Ht.SCALAR?n===sn.UINT8:!1};var aFe=[void 0,"float","vec2","vec3","vec4"],cFe=[void 0,"int","ivec2","ivec3","ivec4"];_I.prototype.getGlslType=function(){let e=this._classProperty,t=Ht.getComponentCount(e.type);return e.isArray&&(t=e.arrayLength),e.normalized?aFe[t]:cFe[t]};_I.prototype.unpackInShader=function(e){return this._classProperty.normalized?e:`${this.getGlslType()}(255.0 * ${e})`};function lFe(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var TI=_I;function EY(e){e=g(e,g.EMPTY_OBJECT);let t=e.propertyTexture,n=e.class,i=e.textures,o=t.extensions,r=t.extras,s={};if(l(t.properties))for(let a in t.properties)t.properties.hasOwnProperty(a)&&(s[a]=new TI({property:t.properties[a],classProperty:n.properties[a],textures:i}));this._name=e.name,this._id=e.id,this._class=n,this._properties=s,this._extras=r,this._extensions=o}Object.defineProperties(EY.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});EY.prototype.getProperty=function(e){return this._properties[e]};var Qx=EY;var Acn=T(S(),1);var Wcn=T(S(),1);function Zie(e){e=g(e,g.EMPTY_OBJECT);let t=e.property,n=e.classProperty;this._attribute=t.attribute,this._classProperty=n,this._min=t.min,this._max=t.max;let i=t.offset,o=t.scale,r=n.hasValueTransform||l(i)||l(o);i=g(i,n.offset),o=g(o,n.scale),i=n.unpackVectorAndMatrixTypes(i),o=n.unpackVectorAndMatrixTypes(o),this._offset=i,this._scale=o,this._hasValueTransform=r,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Zie.prototype,{attribute:{get:function(){return this._attribute}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var SI=Zie;function IY(e){e=g(e,g.EMPTY_OBJECT);let t=e.propertyAttribute,n=e.class,i={};if(l(t.properties))for(let o in t.properties)t.properties.hasOwnProperty(o)&&(i[o]=new SI({property:t.properties[o],classProperty:n.properties[o]}));this._name=e.name,this._id=e.id,this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(IY.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});IY.prototype.getProperty=function(e){return this._properties[e]};var jx=IY;var kcn=T(S(),1);function CI(e){e=g(e,g.EMPTY_OBJECT),this._schema=e.schema;let t=e.propertyTables;this._propertyTableCount=l(t)?t.length:0,this._propertyTables=t,this._propertyTextures=e.propertyTextures,this._propertyAttributes=e.propertyAttributes,this._statistics=e.statistics,this._extras=e.extras,this._extensions=e.extensions}Object.defineProperties(CI.prototype,{schema:{get:function(){return this._schema}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},propertyTableCount:{get:function(){return this._propertyTableCount}},propertyTables:{get:function(){return this._propertyTables}},propertyTextures:{get:function(){return this._propertyTextures}},propertyAttributes:{get:function(){return this._propertyAttributes}},propertyTablesByteLength:{get:function(){if(!l(this._propertyTables))return 0;let e=0,t=this._propertyTables.length;for(let n=0;n<t;n++)e+=this._propertyTables[n].byteLength;return e}}});CI.prototype.getPropertyTable=function(e){return this._propertyTables[e]};CI.prototype.getPropertyTexture=function(e){return this._propertyTextures[e]};CI.prototype.getPropertyAttribute=function(e){return this._propertyAttributes[e]};var Za=CI;function dFe(e){e=g(e,g.EMPTY_OBJECT);let t=e.extension,n=e.schema,i=[];if(l(t.propertyTables))for(let s=0;s<t.propertyTables.length;s++){let a=t.propertyTables[s],c=n.classes[a.class],d=new Ll({count:a.count,properties:a.properties,class:c,bufferViews:e.bufferViews});i.push(new kc({id:s,name:a.name,count:a.count,metadataTable:d,extras:a.extras,extensions:a.extensions}))}let o=[];if(l(t.propertyTextures))for(let s=0;s<t.propertyTextures.length;s++){let a=t.propertyTextures[s];o.push(new Qx({id:s,name:a.name,propertyTexture:a,class:n.classes[a.class],textures:e.textures}))}let r=[];if(l(t.propertyAttributes))for(let s=0;s<t.propertyAttributes.length;s++){let a=t.propertyAttributes[s];r.push(new jx({id:s,name:a.name,class:n.classes[a.class],propertyAttribute:a}))}return new Za({schema:n,propertyTables:i,propertyTextures:o,propertyAttributes:r,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}var VI=dFe;var rln=T(S(),1);function uFe(e){e=g(e,g.EMPTY_OBJECT);let t=e.extension,n=e.schema,i,o=[],r;if(l(t.featureTables))for(r=Object.keys(t.featureTables).sort(),i=0;i<r.length;i++){let a=r[i],c=t.featureTables[a],d=n.classes[c.class],u=new Ll({count:c.count,properties:c.properties,class:d,bufferViews:e.bufferViews});o.push(new kc({id:a,count:c.count,metadataTable:u,extras:c.extras,extensions:c.extensions}))}let s=[];if(l(t.featureTextures))for(r=Object.keys(t.featureTextures).sort(),i=0;i<r.length;i++){let a=r[i],c=t.featureTextures[a];s.push(new Qx({id:a,propertyTexture:mFe(c),class:n.classes[c.class],textures:e.textures}))}return new Za({schema:n,propertyTables:o,propertyTextures:s,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function mFe(e){let t={class:e.class,properties:{}},n=e.properties;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i],r={channels:hFe(o.channels),extras:o.extras,extensions:o.extensions};t.properties[i]=Tt(o.texture,r,!0)}return t}function hFe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]="rgba".indexOf(e[i]);return n}var LI=uFe;function zb(e){e=g(e,g.EMPTY_OBJECT);let t=e.gltf,n=e.extension,i=e.extensionLegacy,o=e.gltfResource,r=e.baseResource,s=e.supportedImageFormats,a=e.frameState,c=e.cacheKey,d=g(e.asynchronous,!0);this._gltfResource=o,this._baseResource=r,this._gltf=t,this._extension=n,this._extensionLegacy=i,this._supportedImageFormats=s,this._frameState=a,this._cacheKey=c,this._asynchronous=d,this._bufferViewLoaders=[],this._bufferViewIds=[],this._textureLoaders=[],this._textureIds=[],this._schemaLoader=void 0,this._structuralMetadata=void 0,this._state=Gt.UNLOADED,this._promise=void 0}l(Object.create)&&(zb.prototype=Object.create(co.prototype),zb.prototype.constructor=zb);Object.defineProperties(zb.prototype,{cacheKey:{get:function(){return this._cacheKey}},structuralMetadata:{get:function(){return this._structuralMetadata}}});async function fFe(e){try{let t=xFe(e),n=VFe(e),i=LFe(e);return await Promise.all([t,n,i]),e.isDestroyed()?void 0:(e._gltf=void 0,e._state=Gt.LOADED,e)}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=Gt.FAILED,e.getError("Failed to load structural metadata",t)}}zb.prototype.load=function(){return l(this._promise)?this._promise:(this._state=Gt.LOADING,this._promise=fFe(this),this._promise)};function pFe(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.values,r=i.arrayOffsets,s=i.stringOffsets;l(o)&&(t[o]=!0),l(r)&&(t[r]=!0),l(s)&&(t[s]=!0)}}function bFe(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.bufferView,r=i.arrayOffsetBufferView,s=i.stringOffsetBufferView;l(o)&&(t[o]=!0),l(r)&&(t[r]=!0),l(s)&&(t[s]=!0)}}function yFe(e){let t=e.propertyTables,n={};if(l(t))for(let i=0;i<t.length;i++){let o=t[i];pFe(o.properties,n)}return n}function gFe(e){let t=e.featureTables,n={};if(l(t)){for(let i in t)if(t.hasOwnProperty(i)){let r=t[i].properties;l(r)&&bFe(r,n)}}return n}async function xFe(e){let t;l(e._extension)?t=yFe(e._extension):t=gFe(e._extensionLegacy);let n=[];for(let i in t)if(t.hasOwnProperty(i)){let o=Yi.getBufferViewLoader({gltf:e._gltf,bufferViewId:parseInt(i),gltfResource:e._gltfResource,baseResource:e._baseResource});e._bufferViewLoaders.push(o),e._bufferViewIds.push(i),n.push(o.load())}return Promise.all(n)}function _Fe(e){let t={},n=e.propertyTextures;if(l(n))for(let i=0;i<n.length;i++){let r=n[i].properties;l(r)&&TFe(r,t)}return t}function TFe(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t[i.index]=i}}function SFe(e){let t={},n=e.featureTextures;if(l(n)){for(let i in n)if(n.hasOwnProperty(i)){let r=n[i].properties;l(r)&&CFe(r,t)}}return t}function CFe(e,t){for(let n in e)if(e.hasOwnProperty(n)){let o=e[n].texture;t[o.index]=o}}function VFe(e){let t;l(e._extension)?t=_Fe(e._extension):t=SFe(e._extensionLegacy);let n=e._gltf,i=e._gltfResource,o=e._baseResource,r=e._supportedImageFormats,s=e._frameState,a=e._asynchronous,c=[];for(let d in t)if(t.hasOwnProperty(d)){let u=Yi.getTextureLoader({gltf:n,textureInfo:t[d],gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s,asynchronous:a});e._textureLoaders.push(u),e._textureIds.push(d),c.push(u.load())}return Promise.all(c)}async function LFe(e){let t=g(e._extension,e._extensionLegacy),n;if(l(t.schemaUri)){let i=e._baseResource.getDerivedResource({url:t.schemaUri});n=Yi.getSchemaLoader({resource:i})}else n=Yi.getSchemaLoader({schema:t.schema});if(e._schemaLoader=n,await n.load(),!n.isDestroyed())return n.schema}zb.prototype.process=function(e){if(this._state===Gt.READY)return!0;if(this._state!==Gt.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let a=0;a<n;++a){let d=t[a].process(e);i=i&&d}if(!i)return!1;let o=this._schemaLoader.schema,r={};for(let a=0;a<this._bufferViewIds.length;++a){let c=this._bufferViewIds[a],d=this._bufferViewLoaders[a];if(!d.isDestroyed()){let u=new Uint8Array(d.typedArray);r[c]=u}}let s={};for(let a=0;a<this._textureIds.length;++a){let c=this._textureIds[a],d=t[a];d.isDestroyed()||(s[c]=d.texture)}return l(this._extension)?this._structuralMetadata=VI({extension:this._extension,schema:o,bufferViews:r,textures:s}):this._structuralMetadata=LI({extension:this._extensionLegacy,schema:o,bufferViews:r,textures:s}),Gie(this),this._state=Gt.READY,!0};function Gie(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)Yi.unload(t[i]);e._bufferViewLoaders.length=0,e._bufferViewIds.length=0}function RFe(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)Yi.unload(t[i]);e._textureLoaders.length=0,e._textureIds.length=0}zb.prototype.unload=function(){Gie(this),RFe(this),l(this._schemaLoader)&&Yi.unload(this._schemaLoader),this._schemaLoader=void 0,this._structuralMetadata=void 0};var RI=zb;var bln=T(S(),1);var fC={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};fC.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"TRANSLATION":return fC.TRANSLATION;case"ROTATION":return fC.ROTATION;case"SCALE":return fC.SCALE;case"_FEATURE_ID":return fC.FEATURE_ID}};var Hr=Object.freeze(fC);var Aln=T(S(),1);var Zln=T(S(),1);var ZFe=65534,GFe=255;function WN(e){e=g(e,g.EMPTY_OBJECT);let t=e.triangleIndices,n=e.outlineIndices,i=e.originalVertexCount;this._triangleIndices=t,this._originalVertexCount=i,this._edges=new Xie(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],EFe(this)}Object.defineProperties(WN.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}});function EFe(e){let t=e._triangleIndices,n=e._edges,i=[],o=e._extraVertices,r=e._originalVertexCount,s={};for(let a=0;a<t.length;a+=3){let c=t[a],d=t[a+1],u=t[a+2],m=!1,p=m||n.hasEdge(c,d),y=m||n.hasEdge(d,u),f=m||n.hasEdge(u,c),x=Eie(i,c,d,u,p,y,f);for(;l(x);){let _=s[x];if(!l(_)){_=r+o.length;let C=x;for(;C>=r;)C=o[C-r];o.push(C),s[x]=_}_>ZFe&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):_>GFe&&t instanceof Uint8Array&&(t=new Uint16Array(t)),x===c?(c=_,t[a]=_):x===d?(d=_,t[a+1]=_):(u=_,t[a+2]=_),x=Eie(i,c,d,u,p,y,f)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function Eie(e,t,n,i,o,r,s){let a=s?1:0,c=o?1:0,d=0,u=XY(e,t,a,c,d);if(u===0)return t;let m=0,p=o?1:0,y=r?1:0,f=XY(e,n,m,p,y);if(f===0)return n;let x=s?1:0,_=0,C=r?1:0,V=XY(e,i,x,_,C);if(V===0)return i;let L=u&f&V,Z,G,I;if(L&1)Z=0,G=1,I=2;else if(L&2)Z=0,I=1,G=2;else if(L&4)G=0,Z=1,I=2;else if(L&8)G=0,I=1,Z=2;else if(L&16)I=0,Z=1,G=2;else if(L&32)I=0,G=1,Z=2;else{let M=WY(u),b=WY(f),R=WY(V);return M<b&&M<R?t:b<R?n:i}let P=t*3;e[P+Z]=a,e[P+G]=c,e[P+I]=d;let v=n*3;e[v+Z]=m,e[v+G]=p,e[v+I]=y;let F=i*3;e[F+Z]=x,e[F+G]=_,e[F+I]=C}function XY(e,t,n,i,o){let r=t*3,s=e[r],a=e[r+1],c=e[r+2];return l(s)?(s===n&&a===i&&c===o)<<0|(s===n&&a===o&&c===i)<<1|(s===i&&a===n&&c===o)<<2|(s===i&&a===o&&c===n)<<3|(s===o&&a===n&&c===i)<<4|(s===o&&a===i&&c===n)<<5:63}function WY(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}WN.prototype.updateAttribute=function(e){let t=this._extraVertices,n=e.length,i=n/this._originalVertexCount,o=t.length,r=e.constructor,s=new r(e.length+o*i);s.set(e);for(let a=0;a<o;a++){let c=t[a]*i,d=n+a*i;for(let u=0;u<i;u++)s[d+u]=s[c+u]}return s};WN.createTexture=function(e){let t=e.cache.modelOutliningCache;if(l(t)||(t=e.cache.modelOutliningCache={}),l(t.outlineTexture))return t.outlineTexture;let n=Math.min(4096,Yt.maximumTextureSize),i=n,o=Iie(i),r=[];for(;i>1;)i>>=1,r.push(Iie(i));let s=new wt({context:e,source:{arrayBufferView:o,mipLevels:r},width:n,height:1,pixelFormat:at.LUMINANCE,sampler:new hn({wrapS:In.CLAMP_TO_EDGE,wrapT:In.CLAMP_TO_EDGE,minificationFilter:dn.LINEAR_MIPMAP_LINEAR,magnificationFilter:Ti.LINEAR})});return t.outlineTexture=s,s};function Iie(e){let t=new Uint8Array(e);return t[e-1]=192,e===8?t[e-1]=96:e===4?t[e-1]=48:e===2?t[e-1]=24:e===1&&(t[e-1]=12),t}function Xie(e,t){this._originalVertexCount=t,this._edges=new Set;for(let n=0;n<e.length;n+=2){let i=e[n],o=e[n+1],r=Math.min(i,o),s=Math.max(i,o),a=r*this._originalVertexCount+s;this._edges.add(a)}}Xie.prototype.hasEdge=function(e,t){let n=Math.min(e,t),i=Math.max(e,t),o=n*this._originalVertexCount+i;return this._edges.has(o)};var qx=WN;function Wie(e){this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function IFe(e){this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1}function PN(e){this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0}PN.prototype.postProcess=function(e){this.needsOutlines&&(XFe(this),PFe(this,e))};function XFe(e){let t=e.primitive,n=t.indices,i=t.attributes[0].count,o=new qx({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=o.updatedTriangleIndices,n.indexDatatype=Ne.fromTypedArray(n.typedArray);let r=WFe(o.outlineCoordinates),s=new Wie(r);s.loadBuffer=!0,s.loadTypedArray=!1,e.attributePlans.push(s),t.outlineCoordinates=s.attribute;let a=e.attributePlans,c=e.attributePlans.length;for(let d=0;d<c;d++){let u=a[d].attribute;u.typedArray=o.updateAttribute(u.typedArray)}}function WFe(e){let t=new Mt.Attribute;return t.name="_OUTLINE_COORDINATES",t.typedArray=e,t.componentDatatype=Q.FLOAT,t.type=tn.VEC3,t.normalized=!1,t.count=e.length/3,t}function PFe(e,t){vFe(e.attributePlans,t),l(e.indicesPlan)&&wFe(e.indicesPlan,t)}function vFe(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i],r=o.attribute,s=r.typedArray;if(o.loadBuffer){let a=ft.createVertexBuffer({typedArray:s,context:t,usage:Ue.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.buffer=a}o.loadTypedArray||(r.typedArray=void 0)}}function wFe(e,t){let n=e.indices;if(e.loadBuffer){let i=ft.createIndexBuffer({typedArray:n.typedArray,context:t,usage:Ue.STATIC_DRAW,indexDatatype:n.indexDatatype});n.buffer=i,i.vertexArrayDestroyable=!1}e.loadTypedArray||(n.typedArray=void 0)}PN.AttributeLoadPlan=Wie;PN.IndicesLoadPlan=IFe;var $x=PN;var Uln=T(S(),1);function FFe(e){e=g(e,g.EMPTY_OBJECT),this.webp=g(e.webp,!1),this.basis=g(e.basis,!1)}var ZI=FFe;var AFe=Mt.Attribute,MFe=Mt.Indices,Pie=Mt.FeatureIdAttribute,vie=Mt.FeatureIdTexture,wie=Mt.FeatureIdImplicitRange,NFe=Mt.MorphTarget,UFe=Mt.Primitive,kFe=Mt.Instances,DFe=Mt.Skin,BFe=Mt.Node,OFe=Mt.AnimatedPropertyType,YFe=Mt.AnimationSampler,HFe=Mt.AnimationTarget,KFe=Mt.AnimationChannel,zFe=Mt.Animation,JFe=Mt.ArticulationStage,QFe=Mt.Articulation,jFe=Mt.Asset,qFe=Mt.Scene,$Fe=Mt.Components,e9e=Mt.MetallicRoughness,t9e=Mt.SpecularGlossiness,n9e=Mt.Material,vo={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8};function Fm(e){e=g(e,g.EMPTY_OBJECT);let t=e.gltfResource,n=e.baseResource,i=e.typedArray,o=g(e.releaseGltfJson,!1),r=g(e.asynchronous,!0),s=g(e.incrementallyLoadTextures,!0),a=g(e.upAxis,Wo.Y),c=g(e.forwardAxis,Wo.Z),d=g(e.loadAttributesAsTypedArray,!1),u=g(e.loadAttributesFor2D,!1),m=g(e.enablePick),p=g(e.loadIndicesForWireframe,!1),y=g(e.loadPrimitiveOutline,!0),f=g(e.loadForClassification,!1),x=g(e.renameBatchIdSemantic,!1);n=l(n)?n:t.clone(),this._gltfJson=e.gltfJson,this._gltfResource=t,this._baseResource=n,this._typedArray=i,this._releaseGltfJson=o,this._asynchronous=r,this._incrementallyLoadTextures=s,this._upAxis=a,this._forwardAxis=c,this._loadAttributesAsTypedArray=d,this._loadAttributesFor2D=u,this._enablePick=m,this._loadIndicesForWireframe=p,this._loadPrimitiveOutline=y,this._loadForClassification=f,this._renameBatchIdSemantic=x,this._sortedPropertyTableIds=void 0,this._sortedFeatureTextureIds=void 0,this._gltfJsonLoader=void 0,this._state=vo.NOT_LOADED,this._textureState=vo.NOT_LOADED,this._promise=void 0,this._processError=void 0,this._textureErrors=[],this._primitiveLoadPlans=[],this._loaderPromises=[],this._textureLoaders=[],this._texturesPromises=[],this._textureCallbacks=[],this._bufferViewLoaders=[],this._geometryLoaders=[],this._geometryCallbacks=[],this._structuralMetadataLoader=void 0,this._loadResourcesPromise=void 0,this._resourcesLoaded=!1,this._texturesLoaded=!1,this._postProcessBuffers=[],this._components=void 0}l(Object.create)&&(Fm.prototype=Object.create(co.prototype),Fm.prototype.constructor=Fm);Object.defineProperties(Fm.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},gltfJson:{get:function(){return l(this._gltfJsonLoader)?this._gltfJsonLoader.gltf:this._gltfJson}},incrementallyLoadTextures:{get:function(){return this._incrementallyLoadTextures}},texturesLoaded:{get:function(){return this._texturesLoaded}}});async function i9e(e){e._state=vo.LOADING,e._textureState=vo.LOADING;try{let t=Yi.getGltfJsonLoader({gltfResource:e._gltfResource,baseResource:e._baseResource,typedArray:e._typedArray,gltfJson:e._gltfJson});return e._gltfJsonLoader=t,await t.load(),e.isDestroyed()||e.isUnloaded()||t.isDestroyed()?void 0:(e._state=vo.LOADED,e._textureState=vo.LOADED,e)}catch(t){if(e.isDestroyed())return;e._state=vo.FAILED,e._textureState=vo.FAILED,vN(e,t)}}async function o9e(e,t){Bt.supportsWebP.initialized||await Bt.supportsWebP.initialize();let n=new ZI({webp:Bt.supportsWebP(),basis:t.context.supportsBasis}),i=e.gltfJson,o=tAe(e,i,n,t);return e._state=vo.PROCESSING,e._textureState=vo.PROCESSING,l(e._gltfJsonLoader)&&e._releaseGltfJson&&(Yi.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),o}Fm.prototype.load=async function(){return l(this._promise)?this._promise:(this._promise=i9e(this),this._promise)};function vN(e,t){throw e.unload(),e.getError("Failed to load glTF",t)}function r9e(e,t){let n,i=!0,o=e._geometryLoaders,r=o.length;for(n=0;n<r;++n){let a=o[n].process(t);a&&l(e._geometryCallbacks[n])&&(e._geometryCallbacks[n](),e._geometryCallbacks[n]=void 0),i=i&&a}let s=e._structuralMetadataLoader;if(l(s)){let a=s.process(t);a&&(e._components.structuralMetadata=s.structuralMetadata),i=i&&a}i&&(e._state=vo.POST_PROCESSING)}function s9e(e,t){let n=e._primitiveLoadPlans,i=n.length;for(let o=0;o<i;o++){let r=n[o];r.postProcess(t),r.needsOutlines&&a9e(e,r)}}function a9e(e,t){let n=e._postProcessBuffers,i=t.primitive,o=i.outlineCoordinates;l(o)&&n.push(o.buffer);let r=i.attributes,s=r.length;for(let c=0;c<s;c++){let d=r[c];l(d.buffer)&&n.push(d.buffer)}let a=i.indices;l(a)&&l(a.buffer)&&n.push(a.buffer)}Fm.prototype._process=function(e){return this._state===vo.READY?!0:(this._state===vo.PROCESSING&&r9e(this,e),this._resourcesLoaded&&this._state===vo.POST_PROCESSING&&(s9e(this,e.context),this._state=vo.PROCESSED),this._resourcesLoaded&&this._state===vo.PROCESSED?(Oie(this),this._typedArray=void 0,this._state=vo.READY,!0):!1)};Fm.prototype._processTextures=function(e){if(this._textureState===vo.READY)return!0;if(this._textureState!==vo.PROCESSING)return!1;let t,n=!0,i=this._textureLoaders,o=i.length;for(t=0;t<o;++t){let r=i[t].process(e);r&&l(this._textureCallbacks[t])&&(this._textureCallbacks[t](),this._textureCallbacks[t]=void 0),n=n&&r}return n?(this._textureState=vo.READY,this._texturesLoaded=!0,!0):!1};Fm.prototype.process=function(e){if(this._state===vo.LOADED&&!l(this._loadResourcesPromise)&&(this._loadResourcesPromise=o9e(this,e).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),l(this._processError)){this._state=vo.FAILED;let o=this._processError;this._processError=void 0,vN(this,o)}let t=this._textureErrors.pop();if(l(t)){let o=this.getError("Failed to load glTF texture",t);throw o.name="TextureError",o}if(this._state===vo.FAILED)return!1;let n=!1;try{n=this._process(e)}catch(o){this._state=vo.FAILED,vN(this,o)}let i=!1;try{i=this._processTextures(e)}catch(o){this._textureState=vo.FAILED,vN(this,o)}return this._incrementallyLoadTextures?n:n&&i};function c9e(e,t,n,i,o,r,s,a){let d=t.accessors[n].bufferView;return Yi.getVertexBufferLoader({gltf:t,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:a,bufferViewId:d,draco:o,attributeSemantic:i,accessorId:n,asynchronous:e._asynchronous,loadBuffer:r,loadTypedArray:s})}function l9e(e,t,n,i,o,r,s){return Yi.getIndexBufferLoader({gltf:t,accessorId:n,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:s,draco:i,asynchronous:e._asynchronous,loadBuffer:o,loadTypedArray:r})}function d9e(e,t,n){let i=Yi.getBufferViewLoader({gltf:t,bufferViewId:n,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(i),i}function Fie(e,t,n){let i=t.byteOffset,o=Rl(e,t),r=t.count,s=ld(t.type),a=t.componentType,c=Q.getSizeInBytes(a),d=c*s,u=r*s;if(o===d)return n=new Uint8Array(n),Q.createArrayBufferView(a,n.buffer,n.byteOffset+i,u);let m=Q.createTypedArray(a,u),p=new DataView(n.buffer),y=new Array(s),f=Up(t.componentType);i=n.byteOffset+i;for(let x=0;x<r;++x){f(p,i,s,c,y);for(let _=0;_<s;++_)m[x*s+_]=y[_];i+=o}return m}function u9e(e,t){let n=e.type;if(n===tn.SCALAR)return t.fill(0);let i=tn.getMathType(n);return t.fill(i.clone(i.ZERO))}function m9e(e,t,n,i){let o=e.type,r=e.count;if(o===tn.SCALAR)for(let s=0;s<r;s++)n[s]=t[s];else if(o===tn.VEC4&&i)for(let s=0;s<r;s++)n[s]=Me.unpack(t,s*4);else{let s=tn.getMathType(o),a=tn.getNumberOfComponents(o);for(let c=0;c<r;c++)n[c]=s.unpack(t,c*a)}return n}async function h9e(e,t,n,i,o,r){if(await t.load(),e.isDestroyed())return;let s=t.typedArray,a=Fie(n,i,s);o=g(o,!1),m9e(i,a,r,o)}function wN(e,t,n,i){let o=t.accessors[n],r=o.count,s=new Array(r),a=o.bufferView;if(l(a)){let c=d9e(e,t,a),d=h9e(e,c,t,o,i,s);return e._loaderPromises.push(d),s}return u9e(o,s)}function hu(e,t){if(l(t))return e===Number?t[0]:e.unpack(t)}function f9e(e){return e===Number?0:new e}function p9e(e){switch(e){case Q.BYTE:return 127;case Q.UNSIGNED_BYTE:return 255;case Q.SHORT:return 32767;case Q.UNSIGNED_SHORT:return 65535;default:return 1}}var b9e={VEC2:new B(-1,-1),VEC3:new h(-1,-1,-1),VEC4:new se(-1,-1,-1,-1)};function y9e(e,t){let n=p9e(e.componentDatatype),i=b9e[e.type],o=e.min;l(o)&&(o=t.divideByScalar(o,n,o),o=t.maximumByComponent(o,i,o));let r=e.max;l(r)&&(r=t.divideByScalar(r,n,r),r=t.maximumByComponent(r,i,r)),e.min=o,e.max=r}function g9e(e,t,n){let i=e.decodeMatrix,o=hu(n,e.decodedMin),r=hu(n,e.decodedMax);l(o)&&l(r)&&(t.min=o,t.max=r);let s=new Mt.Quantization;s.componentDatatype=t.componentDatatype,s.type=t.type,i.length===4?(s.quantizedVolumeOffset=i[2],s.quantizedVolumeStepSize=i[0]):i.length===9?(s.quantizedVolumeOffset=new B(i[6],i[7]),s.quantizedVolumeStepSize=new B(i[0],i[4])):i.length===16?(s.quantizedVolumeOffset=new h(i[12],i[13],i[14]),s.quantizedVolumeStepSize=new h(i[0],i[5],i[10])):i.length===25&&(s.quantizedVolumeOffset=new se(i[20],i[21],i[22],i[23]),s.quantizedVolumeStepSize=new se(i[0],i[6],i[12],i[18])),t.quantization=s}function x9e(e,t,n,i,o){let r=e.accessors[t],s=tn.getMathType(r.type),a=g(r.normalized,!1),c=new AFe;c.name=n,c.semantic=i,c.setIndex=o,c.constant=f9e(s),c.componentDatatype=r.componentType,c.normalized=a,c.count=r.count,c.type=r.type,c.min=hu(s,r.min),c.max=hu(s,r.max),c.byteOffset=r.byteOffset,c.byteStride=Rl(e,r),ci(r,"WEB3D_quantized_attributes")&&g9e(r.extensions.WEB3D_quantized_attributes,c,s);let d=c.semantic===_t.POSITION||c.semantic===_t.NORMAL||c.semantic===_t.TANGENT||c.semantic===_t.TEXCOORD;return e.extensionsRequired?.includes("KHR_mesh_quantization")&&a&&d&&y9e(c,s),c}function Aie(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var _9e={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function PY(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let o=t.fromGltfSemantic(i),r=_9e;return r.gltfSemantic=n,r.renamedSemantic=i,r.modelSemantic=o,r}function T9e(e){let t=e===_t.POSITION,n=e===_t.FEATURE_ID,i=e===_t.TEXCOORD;return t||n||i}function S9e(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,e.quantization=t.quantization,n&&(e.buffer=t.buffer),i){let o=l(t.quantization)?t.quantization.componentDatatype:e.componentDatatype;e.typedArray=Q.createArrayBufferView(o,t.typedArray.buffer)}}function C9e(e,t,n,i,o,r){if(o&&(n.buffer=i.buffer),r){let s=i.typedArray;n.typedArray=Fie(e,t,s),o||(n.byteOffset=0,n.byteStride=void 0)}}function Mie(e,t,n,i,o,r,s,a){let c=t.accessors[n],d=c.bufferView,u=i.gltfSemantic,m=i.renamedSemantic,p=i.modelSemantic,y=l(p)?Aie(m):void 0,x=x9e(t,n,u,p,y);if(!l(o)&&!l(d))return x;let _=c9e(e,t,n,u,o,r,s,a),C=e._geometryLoaders.length;e._geometryLoaders.push(_);let V=_.load();return e._loaderPromises.push(V),e._geometryCallbacks[C]=()=>{l(o)&&l(o.attributes)&&l(o.attributes[u])?S9e(x,_,r,s):C9e(t,c,x,_,r,s)},x}function Nie(e,t,n,i,o,r,s,a){let c=i.modelSemantic,d=c===_t.POSITION,u=c===_t.FEATURE_ID,m=d&&!r&&e._loadAttributesFor2D&&!a.scene3DOnly,p=d&&e._enablePick&&!a.context.webgl2,y=e._loadForClassification&&u,f=e._loadAttributesAsTypedArray,x=!f,_=f||m||p||y,L=Mie(e,t,n,i,o,s?!1:x,s?!0:_,a),Z=new $x.AttributeLoadPlan(L);return Z.loadBuffer=x,Z.loadTypedArray=_,Z}function V9e(e,t,n,i,o,r){let s=l(i.ROTATION),a=l(i.TRANSLATION)&&l(t.accessors[i.TRANSLATION].min)&&l(t.accessors[i.TRANSLATION].max),c=PY(e,Hr,o),d=c.modelSemantic,u=d===Hr.TRANSLATION||d===Hr.ROTATION||d===Hr.SCALE,m=d===Hr.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&u||!r.context.instancedArrays,y=e._enablePick&&!r.context.webgl2,f=!p,x=e._loadAttributesFor2D&&!r.scene3DOnly;return Mie(e,t,n,c,void 0,f,p||m&&(!a||x||y),r)}function L9e(e,t,n,i,o,r,s){let a=t.accessors[n],c=a.bufferView;if(!l(i)&&!l(c))return;let d=new MFe;d.count=a.count;let u=e._loadAttributesAsTypedArray,m=(e._loadIndicesForWireframe||e._enablePick)&&!s.context.webgl2,p=e._loadForClassification&&o,f=!u,x=u||m||p,V=l9e(e,t,n,i,r?!1:f,r?!0:x,s),L=e._geometryLoaders.length;e._geometryLoaders.push(V);let Z=V.load();e._loaderPromises.push(Z),e._geometryCallbacks[L]=()=>{d.indexDatatype=V.indexDatatype,d.buffer=V.buffer,d.typedArray=V.typedArray};let G=new $x.IndicesLoadPlan(d);return G.loadBuffer=f,G.loadTypedArray=x,G}function Dp(e,t,n,i,o,r){let s=Zl.getImageIdFromTexture({gltf:t,textureId:n.index,supportedImageFormats:i});if(!l(s))return;let a=Yi.getTextureLoader({gltf:t,textureInfo:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:i,frameState:o,asynchronous:e._asynchronous}),c=Zl.createModelTextureReader({textureInfo:n}),d=e._textureLoaders.length;e._textureLoaders.push(a);let u=a.load().catch(m=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw m;e._textureState=vo.FAILED,e._textureErrors.push(m)}});return e._texturesPromises.push(u),e._textureCallbacks[d]=()=>{c.texture=a.texture,l(r)&&(c.texture.sampler=r)},c}function R9e(e,t,n,i,o){let r=new n9e,s=g(n.extensions,g.EMPTY_OBJECT),a=s.KHR_materials_pbrSpecularGlossiness,c=n.pbrMetallicRoughness;if(r.unlit=l(s.KHR_materials_unlit),l(a)){let d=new t9e;r.specularGlossiness=d,l(a.diffuseTexture)&&(d.diffuseTexture=Dp(e,t,a.diffuseTexture,i,o)),l(a.specularGlossinessTexture)&&l(a.specularGlossinessTexture)&&(d.specularGlossinessTexture=Dp(e,t,a.specularGlossinessTexture,i,o)),d.diffuseFactor=hu(se,a.diffuseFactor),d.specularFactor=hu(h,a.specularFactor),d.glossinessFactor=a.glossinessFactor,r.pbrSpecularGlossiness=a}else if(l(c)){let d=new e9e;l(c.baseColorTexture)&&(d.baseColorTexture=Dp(e,t,c.baseColorTexture,i,o)),l(c.metallicRoughnessTexture)&&(d.metallicRoughnessTexture=Dp(e,t,c.metallicRoughnessTexture,i,o)),d.baseColorFactor=hu(se,c.baseColorFactor),d.metallicFactor=c.metallicFactor,d.roughnessFactor=c.roughnessFactor,r.metallicRoughness=d}return l(n.emissiveTexture)&&(r.emissiveTexture=Dp(e,t,n.emissiveTexture,i,o)),l(n.normalTexture)&&!e._loadForClassification&&(r.normalTexture=Dp(e,t,n.normalTexture,i,o)),l(n.occlusionTexture)&&(r.occlusionTexture=Dp(e,t,n.occlusionTexture,i,o)),r.emissiveFactor=hu(h,n.emissiveFactor),r.alphaMode=n.alphaMode,r.alphaCutoff=n.alphaCutoff,r.doubleSided=n.doubleSided,r}function Uie(e,t){let n=new Pie;return n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.propertyTableId=e.propertyTable,n.setIndex=e.attribute,n.label=e.label,n.positionalLabel=t,n}function kie(e,t,n,i){let o=new Pie,r=e.featureIds;return o.featureCount=n,o.propertyTableId=t,o.setIndex=Aie(r.attribute),o.positionalLabel=i,o}function Die(e,t){let n=new wie;return n.propertyTableId=e.propertyTable,n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.label=e.label,n.positionalLabel=t,n.offset=0,n.repeat=1,n}function Bie(e,t,n,i){let o=new wie,r=e.featureIds;o.propertyTableId=t,o.featureCount=n,o.offset=g(r.constant,0);let s=g(r.divisor,0);return o.repeat=s===0?void 0:s,o.positionalLabel=i,o}function Z9e(e,t,n,i,o,r){let s=new vie;s.featureCount=n.featureCount,s.nullFeatureId=n.nullFeatureId,s.propertyTableId=n.propertyTable,s.label=n.label,s.positionalLabel=r;let a=n.texture;s.textureReader=Dp(e,t,a,i,o,hn.NEAREST);let d=(l(a.channels)?a.channels:[0]).map(function(u){return"rgba".charAt(u)}).join("");return s.textureReader.channels=d,s}function G9e(e,t,n,i,o,r,s,a){let c=new vie,d=n.featureIds,u=d.texture;return c.featureCount=s,c.propertyTableId=i,c.textureReader=Dp(e,t,u,o,r,hn.NEAREST),c.textureReader.channels=d.channels,c.positionalLabel=a,c}function E9e(e,t,n,i,o,r){let s=new NFe,a=void 0,c=!1;for(let d in n)if(n.hasOwnProperty(d)){let u=n[d],m=PY(e,_t,d),p=Nie(e,t,u,m,a,c,i,r);s.attributes.push(p.attribute),o.attributePlans.push(p)}return s}function I9e(e,t,n,i,o,r){let s=new UFe,a=new $x(s);e._primitiveLoadPlans.push(a);let c=n.material;l(c)&&(s.material=R9e(e,t,t.materials[c],o,r));let d=g(n.extensions,g.EMPTY_OBJECT),u=!1,m=d.CESIUM_primitive_outline;e._loadPrimitiveOutline&&l(m)&&(u=!0,a.needsOutlines=!0,a.outlineIndices=X9e(e,t,m,a));let p=e._loadForClassification,y=d.KHR_draco_mesh_compression,f=!1,x=n.attributes;if(l(x)){for(let P in x)if(x.hasOwnProperty(P)){let v=x[P],F=PY(e,_t,P),M=F.modelSemantic;if(p&&!T9e(M))continue;M===_t.FEATURE_ID&&(f=!0);let b=Nie(e,t,v,F,y,i,u,r);a.attributePlans.push(b),s.attributes.push(b.attribute)}}let _=n.targets;if(l(_)&&!p){let P=_.length;for(let v=0;v<P;++v)s.morphTargets.push(E9e(e,t,_[v],u,a,r))}let C=n.indices;if(l(C)){let P=L9e(e,t,C,y,f,u,r);l(P)&&(a.indicesPlan=P,s.indices=P.indices)}let V=d.EXT_structural_metadata,L=d.EXT_mesh_features,Z=d.EXT_feature_metadata,G=l(Z);l(L)?W9e(e,t,s,L,o,r):G&&P9e(e,t,s,Z,o,r),l(V)?v9e(s,V):G&&w9e(e,s,Z);let I=n.mode;if(p&&I!==Ae.TRIANGLES)throw new me("Only triangle meshes can be used for classification.");return s.primitiveType=I,s}function X9e(e,t,n){let i=n.indices;return wN(e,t,i,!1)}function W9e(e,t,n,i,o,r){let s;l(i)&&l(i.featureIds)?s=i.featureIds:s=[];for(let a=0;a<s.length;a++){let c=s[a],d=`featureId_${a}`,u;l(c.texture)?u=Z9e(e,t,c,o,r,d):l(c.attribute)?u=Uie(c,d):u=Die(c,d),n.featureIds.push(u)}}function P9e(e,t,n,i,o,r){let s=t.extensions.EXT_feature_metadata.featureTables,a=0,c=i.featureIdAttributes;if(l(c)){let u=c.length;for(let m=0;m<u;++m){let p=c[m],y=p.featureTable,f=e._sortedPropertyTableIds.indexOf(y),x=s[y].count,_=`featureId_${a}`;a++;let C;l(p.featureIds.attribute)?C=kie(p,f,x,_):C=Bie(p,f,x,_),n.featureIds.push(C)}}let d=i.featureIdTextures;if(l(d)){let u=d.length;for(let m=0;m<u;++m){let p=d[m],y=p.featureTable,f=e._sortedPropertyTableIds.indexOf(y),x=s[y].count,_=`featureId_${a}`;a++;let C=G9e(e,t,p,f,o,r,x,_);n.featureIds.push(C)}}}function v9e(e,t){l(t)&&(l(t.propertyTextures)&&(e.propertyTextureIds=t.propertyTextures),l(t.propertyAttributes)&&(e.propertyAttributeIds=t.propertyAttributes))}function w9e(e,t,n){l(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map(function(i){return e._sortedFeatureTextureIds.indexOf(i)}))}function F9e(e,t,n,i){let o=n.EXT_mesh_gpu_instancing,r=new kFe,s=o.attributes;if(l(s)){for(let u in s)if(s.hasOwnProperty(u)){let m=s[u];r.attributes.push(V9e(e,t,m,s,u,i))}}let a=g(o.extensions,g.EMPTY_OBJECT),c=n.EXT_instance_features,d=a.EXT_feature_metadata;return l(c)?A9e(r,c):l(d)&&M9e(t,r,d,e._sortedPropertyTableIds),r}function A9e(e,t){let n=t.featureIds;for(let i=0;i<n.length;i++){let o=n[i],r=`instanceFeatureId_${i}`,s;l(o.attribute)?s=Uie(o,r):s=Die(o,r),e.featureIds.push(s)}}function M9e(e,t,n,i){let o=e.extensions.EXT_feature_metadata.featureTables,r=n.featureIdAttributes;if(l(r)){let s=r.length;for(let a=0;a<s;++a){let c=r[a],d=c.featureTable,u=i.indexOf(d),m=o[d].count,p=`instanceFeatureId_${a}`,y;l(c.featureIds.attribute)?y=kie(c,u,m,p):y=Bie(c,u,m,p),t.featureIds.push(y)}}}function N9e(e,t,n,i,o){let r=new BFe;r.name=n.name,r.matrix=hu(A,n.matrix),r.translation=hu(h,n.translation),r.rotation=hu(Me,n.rotation),r.scale=hu(h,n.scale);let s=g(n.extensions,g.EMPTY_OBJECT),a=s.EXT_mesh_gpu_instancing,c=s.AGI_articulations;if(l(a)){if(e._loadForClassification)throw new me("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");r.instances=F9e(e,t,s,o)}l(c)&&(r.articulationName=c.articulationName);let d=n.mesh;if(l(d)){let u=t.meshes[d],m=u.primitives,p=m.length;for(let _=0;_<p;++_)r.primitives.push(I9e(e,t,m[_],l(r.instances),i,o));let y=g(n.weights,u.weights),x=r.primitives[0].morphTargets.length;r.morphWeights=l(y)?y.slice():new Array(x).fill(0)}return r}function U9e(e,t,n,i){if(!l(t.nodes))return[];let o,r,s=t.nodes.length,a=new Array(s);for(o=0;o<s;++o){let c=N9e(e,t,t.nodes[o],n,i);c.index=o,a[o]=c}for(o=0;o<s;++o){let c=t.nodes[o].children;if(l(c)){let d=c.length;for(r=0;r<d;++r)a[o].children.push(a[c[r]])}}return a}function k9e(e,t,n,i){let o=new DFe,r=n.joints,s=r.length,a=new Array(s);for(let d=0;d<s;++d)a[d]=i[r[d]];o.joints=a;let c=n.inverseBindMatrices;return l(c)?o.inverseBindMatrices=wN(e,t,c):o.inverseBindMatrices=new Array(s).fill(A.IDENTITY),o}function D9e(e,t,n){let i=t.skins;if(e._loadForClassification||!l(i))return[];let o=t.skins.length,r=new Array(o);for(let a=0;a<o;++a){let c=k9e(e,t,t.skins[a],n);c.index=a,r[a]=c}let s=n.length;for(let a=0;a<s;++a){let c=t.nodes[a].skin;l(c)&&(n[a].skin=r[c])}return r}async function B9e(e,t,n,i,o,r){let s=new RI({gltf:t,extension:n,extensionLegacy:i,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:o,frameState:r,asynchronous:e._asynchronous});return e._structuralMetadataLoader=s,s.load()}function O9e(e,t,n){let i=new YFe,o=n.input;i.input=wN(e,t,o);let r=n.interpolation;i.interpolation=g(wm[r],wm.LINEAR);let s=n.output;return i.output=wN(e,t,s,!0),i}function Y9e(e,t){let n=new HFe,i=e.node;if(!l(i))return;n.node=t[i];let o=e.path.toUpperCase();return n.path=OFe[o],n}function H9e(e,t,n){let i=new KFe,o=e.sampler;return i.sampler=t[o],i.target=Y9e(e.target,n),i}function K9e(e,t,n,i){let o,r=new zFe;r.name=n.name;let s=n.samplers,a=s.length,c=new Array(a);for(o=0;o<a;o++){let p=O9e(e,t,s[o]);p.index=o,c[o]=p}let d=n.channels,u=d.length,m=new Array(u);for(o=0;o<u;o++)m[o]=H9e(d[o],c,i);return r.samplers=c,r.channels=m,r}function z9e(e,t,n){let i=t.animations;if(e._loadForClassification||!l(i))return[];let o=t.animations.length,r=new Array(o);for(let s=0;s<o;++s){let a=K9e(e,t,t.animations[s],n);a.index=s,r[s]=a}return r}function J9e(e){let t=new JFe;t.name=e.name;let n=e.type.toUpperCase();return t.type=oc[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function Q9e(e){let t=new QFe;t.name=e.name;let n=e.stages,i=n.length,o=new Array(i);for(let r=0;r<i;r++){let s=J9e(n[r]);o[r]=s}return t.stages=o,t}function j9e(e){let n=g(e.extensions,g.EMPTY_OBJECT).AGI_articulations;if(!l(n))return[];let i=n.articulations;if(!l(i))return[];let o=i.length,r=new Array(o);for(let s=0;s<o;s++){let a=Q9e(i[s]);r[s]=a}return r}function q9e(e){let t;return l(e.scenes)&&l(e.scene)&&(t=e.scenes[e.scene].nodes),t=g(t,e.nodes),t=l(t)?t:[],t}function $9e(e,t){let n=new qFe,i=q9e(e);return n.nodes=i.map(function(o){return t[o]}),n}var eAe=new h;function tAe(e,t,n,i){let o=g(t.extensions,g.EMPTY_OBJECT),r=o.EXT_structural_metadata,s=o.EXT_feature_metadata,a=o.CESIUM_RTC;if(l(s)){let C=s.featureTables,V=s.featureTextures,L=l(C)?C:[],Z=l(V)?V:[];e._sortedPropertyTableIds=Object.keys(L).sort(),e._sortedFeatureTextureIds=Object.keys(Z).sort()}let c=U9e(e,t,n,i),d=D9e(e,t,c),u=z9e(e,t,c),m=j9e(t),p=$9e(t,c),y=new $Fe,f=new jFe,x=t.asset.copyright;if(l(x)){let C=x.split(";").map(function(V){return new Vt(V.trim())});f.credits=C}if(y.asset=f,y.scene=p,y.nodes=c,y.skins=d,y.animations=u,y.articulations=m,y.upAxis=e._upAxis,y.forwardAxis=e._forwardAxis,l(a)){let C=h.fromArray(a.center,0,eAe);y.transform=A.fromTranslation(C,y.transform)}if(e._components=y,l(r)||l(s)){let C=B9e(e,t,r,s,n,i);e._loaderPromises.push(C)}let _=[];return _.push.apply(_,e._loaderPromises),e._incrementallyLoadTextures||_.push.apply(_,e._texturesPromises),Promise.all(_)}function nAe(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)t[i]=!t[i].isDestroyed()&&Yi.unload(t[i]);e._textureLoaders.length=0}function Oie(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)t[i]=!t[i].isDestroyed()&&Yi.unload(t[i]);e._bufferViewLoaders.length=0}function iAe(e){let t=e._geometryLoaders,n=t.length;for(let i=0;i<n;++i)t[i]=!t[i].isDestroyed()&&Yi.unload(t[i]);e._geometryLoaders.length=0}function oAe(e){let t=e._postProcessBuffers,n=t.length;for(let i=0;i<n;i++){let o=t[i];o.isDestroyed()||o.destroy()}t.length=0}function rAe(e){l(e._structuralMetadataLoader)&&!e._structuralMetadataLoader.isDestroyed()&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0)}Fm.prototype.isUnloaded=function(){return this._state===vo.UNLOADED};Fm.prototype.unload=function(){l(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&Yi.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,nAe(this),Oie(this),iAe(this),oAe(this),rAe(this),this._components=void 0,this._typedArray=void 0,this._state=vo.UNLOADED};var Bp=Fm;var Tun=T(S(),1);var yun=T(S(),1);var $dn=T(S(),1);var Vdn=T(S(),1);function vY(e,t,n){let i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function FN(e,t,n){let i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function Am(e){e=g(e,g.EMPTY_OBJECT);let n=e.context._gl,i=Yt.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=g(e.destroyAttachments,!0);let o=l(e.depthTexture)||l(e.depthRenderbuffer),r=l(e.depthStencilTexture)||l(e.depthStencilRenderbuffer);this._bind();let s,a,c,d,u;if(l(e.colorTextures)){let m=e.colorTextures;for(d=this._colorTextures.length=this._activeColorAttachments.length=m.length,c=0;c<d;++c)s=m[c],u=this._gl.COLOR_ATTACHMENT0+c,vY(this,u,s),this._activeColorAttachments[c]=u,this._colorTextures[c]=s}if(l(e.colorRenderbuffers)){let m=e.colorRenderbuffers;for(d=this._colorRenderbuffers.length=this._activeColorAttachments.length=m.length,c=0;c<d;++c)a=m[c],u=this._gl.COLOR_ATTACHMENT0+c,FN(this,u,a),this._activeColorAttachments[c]=u,this._colorRenderbuffers[c]=a}l(e.depthTexture)&&(s=e.depthTexture,vY(this,this._gl.DEPTH_ATTACHMENT,s),this._depthTexture=s),l(e.depthRenderbuffer)&&(a=e.depthRenderbuffer,FN(this,this._gl.DEPTH_ATTACHMENT,a),this._depthRenderbuffer=a),l(e.stencilRenderbuffer)&&(a=e.stencilRenderbuffer,FN(this,this._gl.STENCIL_ATTACHMENT,a),this._stencilRenderbuffer=a),l(e.depthStencilTexture)&&(s=e.depthStencilTexture,vY(this,this._gl.DEPTH_STENCIL_ATTACHMENT,s),this._depthStencilTexture=s),l(e.depthStencilRenderbuffer)&&(a=e.depthStencilRenderbuffer,FN(this,this._gl.DEPTH_STENCIL_ATTACHMENT,a),this._depthStencilRenderbuffer=a),this._unBind()}Object.defineProperties(Am.prototype,{status:{get:function(){this._bind();let 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)}}});Am.prototype._bind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)};Am.prototype._unBind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)};Am.prototype.bindDraw=function(){let e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)};Am.prototype.bindRead=function(){let e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)};Am.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments};Am.prototype.getColorTexture=function(e){return this._colorTextures[e]};Am.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]};Am.prototype.isDestroyed=function(){return!1};Am.prototype.destroy=function(){if(this.destroyAttachments){let e=0,t=this._colorTextures,n=t.length;for(;e<n;++e){let o=t[e];l(o)&&o.destroy()}let i=this._colorRenderbuffers;for(n=i.length,e=0;e<n;++e){let o=i[e];l(o)&&o.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),ue(this)};var na=Am;var Xdn=T(S(),1);function pC(e){e=g(e,g.EMPTY_OBJECT);let t=e.context,n=e.width,i=e.height;this._width=n,this._height=i;let o=e.colorRenderbuffers,r=e.colorTextures;if(l(o)!==l(r))throw new fe("Both color renderbuffer and texture attachments must be provided.");let s=e.depthStencilRenderbuffer,a=e.depthStencilTexture;if(l(s)!==l(a))throw new fe("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new na({context:t,colorRenderbuffers:o,depthStencilRenderbuffer:s,destroyAttachments:e.destroyAttachments}),this._colorFramebuffer=new na({context:t,colorTextures:r,depthStencilTexture:a,destroyAttachments:e.destroyAttachments})}pC.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};pC.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};pC.prototype.blitFramebuffers=function(e,t){this._renderFramebuffer.bindRead(),this._colorFramebuffer.bindDraw();let n=e._gl,i=0;this._colorFramebuffer._colorTextures.length>0&&(i|=n.COLOR_BUFFER_BIT),l(this._colorFramebuffer.depthStencilTexture)&&(i|=n.DEPTH_BUFFER_BIT|(t?n.STENCIL_BUFFER_BIT:0)),n.blitFramebuffer(0,0,this._width,this._height,0,0,this._width,this._height,i,n.NEAREST),n.bindFramebuffer(n.READ_FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null)};pC.prototype.isDestroyed=function(){return!1};pC.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),ue(this)};var GI=pC;var kdn=T(S(),1);var vdn=T(S(),1);var Il={RGBA4:ne.RGBA4,RGBA8:ne.RGBA8,RGBA16F:ne.RGBA16F,RGBA32F:ne.RGBA32F,RGB5_A1:ne.RGB5_A1,RGB565:ne.RGB565,DEPTH_COMPONENT16:ne.DEPTH_COMPONENT16,STENCIL_INDEX8:ne.STENCIL_INDEX8,DEPTH_STENCIL:ne.DEPTH_STENCIL,DEPTH24_STENCIL8:ne.DEPTH24_STENCIL8,validate:function(e){return e===Il.RGBA4||e===Il.RGBA8||e===Il.RGBA16F||e===Il.RGBA32F||e===Il.RGB5_A1||e===Il.RGB565||e===Il.DEPTH_COMPONENT16||e===Il.STENCIL_INDEX8||e===Il.DEPTH_STENCIL||e===Il.DEPTH24_STENCIL8},getColorFormat:function(e){return e===ne.FLOAT?Il.RGBA32F:e===ne.HALF_FLOAT_OES?Il.RGBA16F:Il.RGBA8}},Dc=Object.freeze(Il);function EI(e){e=g(e,g.EMPTY_OBJECT);let n=e.context._gl,i=Yt.maximumRenderbufferSize,o=g(e.format,Dc.RGBA4),r=l(e.width)?e.width:n.drawingBufferWidth,s=l(e.height)?e.height:n.drawingBufferHeight,a=g(e.numSamples,1);this._gl=n,this._format=o,this._width=r,this._height=s,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),a>1?n.renderbufferStorageMultisample(n.RENDERBUFFER,a,o,r,s):n.renderbufferStorage(n.RENDERBUFFER,o,r,s),n.bindRenderbuffer(n.RENDERBUFFER,null)}Object.defineProperties(EI.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});EI.prototype._getRenderbuffer=function(){return this._renderbuffer};EI.prototype.isDestroyed=function(){return!1};EI.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),ue(this)};var dd=EI;function gs(e){e=g(e,g.EMPTY_OBJECT),this._numSamples=g(e.numSamples,1),this._colorAttachmentsLength=g(e.colorAttachmentsLength,1),this._color=g(e.color,!0),this._depth=g(e.depth,!1),this._depthStencil=g(e.depthStencil,!1),this._supportsDepthTexture=g(e.supportsDepthTexture,!1),this._createColorAttachments=g(e.createColorAttachments,!0),this._createDepthAttachments=g(e.createDepthAttachments,!0),this._pixelDatatype=e.pixelDatatype,this._pixelFormat=e.pixelFormat,this._width=void 0,this._height=void 0,this._framebuffer=void 0,this._multisampleFramebuffer=void 0,this._colorTextures=void 0,this._color&&(this._colorTextures=new Array(this._colorAttachmentsLength),this._colorRenderbuffers=new Array(this._colorAttachmentsLength)),this._colorRenderbuffer=void 0,this._depthStencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthRenderbuffer=void 0,this._depthTexture=void 0,this._attachmentsDirty=!1}Object.defineProperties(gs.prototype,{framebuffer:{get:function(){return this._numSamples>1?this._multisampleFramebuffer.getRenderFramebuffer():this._framebuffer}},numSamples:{get:function(){return this._numSamples}},status:{get:function(){return this.framebuffer.status}}});gs.prototype.isDirty=function(e,t,n,i,o){n=g(n,1);let r=this._width!==e||this._height!==t,s=this._numSamples!==n,a=l(i)&&this._pixelDatatype!==i||l(o)&&this._pixelFormat!==o,c=n===1?l(this._framebuffer):l(this._multisampleFramebuffer);return this._attachmentsDirty||r||s||a||!c||this._color&&!l(this._colorTextures[0])};gs.prototype.update=function(e,t,n,i,o,r){if(i=e.msaa?g(i,1):1,o=g(o,this._color?g(this._pixelDatatype,je.UNSIGNED_BYTE):void 0),r=g(r,this._color?g(this._pixelFormat,at.RGBA):void 0),this.isDirty(t,n,i,o,r)){if(this.destroy(),this._width=t,this._height=n,this._numSamples=i,this._pixelDatatype=o,this._pixelFormat=r,this._attachmentsDirty=!1,this._color&&this._createColorAttachments){for(let s=0;s<this._colorAttachmentsLength;++s)if(this._colorTextures[s]=new wt({context:e,width:t,height:n,pixelFormat:r,pixelDatatype:o,sampler:hn.NEAREST}),this._numSamples>1){let a=Dc.getColorFormat(o);this._colorRenderbuffers[s]=new dd({context:e,width:t,height:n,format:a,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new wt({context:e,width:t,height:n,pixelFormat:at.DEPTH_STENCIL,pixelDatatype:je.UNSIGNED_INT_24_8,sampler:hn.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new dd({context:e,width:t,height:n,format:Dc.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new dd({context:e,width:t,height:n,format:Dc.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new wt({context:e,width:t,height:n,pixelFormat:at.DEPTH_COMPONENT,pixelDatatype:je.UNSIGNED_INT,sampler:hn.NEAREST}):this._depthRenderbuffer=new dd({context:e,width:t,height:n,format:Dc.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new GI({context:e,width:this._width,height:this._height,colorTextures:this._colorTextures,colorRenderbuffers:this._colorRenderbuffers,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1}):this._framebuffer=new na({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};gs.prototype.getColorTexture=function(e){return e=g(e,0),this._colorTextures[e]};gs.prototype.setColorTexture=function(e,t){t=g(t,0),this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};gs.prototype.getColorRenderbuffer=function(e){return e=g(e,0),this._colorRenderbuffers[e]};gs.prototype.setColorRenderbuffer=function(e,t){t=g(t,0),this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};gs.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};gs.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};gs.prototype.getDepthTexture=function(){return this._depthTexture};gs.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};gs.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};gs.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};gs.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};gs.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};gs.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};gs.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};gs.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};gs.prototype.destroy=function(){if(this._color){let e,t=this._colorTextures.length;for(e=0;e<t;++e){let n=this._colorTextures[e];this._createColorAttachments&&l(n)&&!n.isDestroyed()&&(this._colorTextures[e].destroy(),this._colorTextures[e]=void 0),l(n)&&n.isDestroyed()&&(this._colorTextures[e]=void 0);let i=this._colorRenderbuffers[e];this._createColorAttachments&&l(i)&&!i.isDestroyed()&&(this._colorRenderbuffers[e].destroy(),this._colorRenderbuffers[e]=void 0),l(i)&&i.isDestroyed()&&(this._colorRenderbuffers[e]=void 0)}}this._depthStencil&&(this._createDepthAttachments&&(this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()),l(this._depthStencilTexture)&&this._depthStencilTexture.isDestroyed()&&(this._depthStencilTexture=void 0),l(this._depthStencilRenderbuffer)&&this._depthStencilRenderbuffer.isDestroyed()&&(this._depthStencilRenderbuffer=void 0)),this._depth&&(this._createDepthAttachments&&(this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy()),l(this._depthTexture)&&this._depthTexture.isDestroyed()&&(this._depthTexture=void 0),l(this._depthRenderbuffer)&&this._depthRenderbuffer.isDestroyed()&&(this._depthRenderbuffer=void 0)),this.destroyFramebuffer()};var pi=gs;var tun=T(S(),1),II=`uniform sampler2D u_pointCloud_colorGBuffer;
uniform sampler2D u_pointCloud_depthGBuffer;
uniform vec2 u_distanceAndEdlStrength;
in vec2 v_textureCoordinates;
vec2 neighborContribution(float log2Depth, vec2 offset)
{
float dist = u_distanceAndEdlStrength.x;
vec2 texCoordOrig = v_textureCoordinates + offset * dist;
vec2 texCoord0 = v_textureCoordinates + offset * floor(dist);
vec2 texCoord1 = v_textureCoordinates + offset * ceil(dist);
float depthOrLogDepth0 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord0));
float depthOrLogDepth1 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord1));
// ignore depth values that are the clear depth
if (depthOrLogDepth0 == 0.0 || depthOrLogDepth1 == 0.0) {
return vec2(0.0);
}
// interpolate the two adjacent depth values
float depthMix = mix(depthOrLogDepth0, depthOrLogDepth1, fract(dist));
vec4 eyeCoordinate = czm_windowToEyeCoordinates(texCoordOrig, depthMix);
return vec2(max(0.0, log2Depth - log2(-eyeCoordinate.z / eyeCoordinate.w)), 1.0);
}
void main()
{
float depthOrLogDepth = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, v_textureCoordinates));
vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depthOrLogDepth);
eyeCoordinate /= eyeCoordinate.w;
float log2Depth = log2(-eyeCoordinate.z);
if (depthOrLogDepth == 0.0) // 0.0 is the clear value for the gbuffer
{
discard;
}
vec4 color = texture(u_pointCloud_colorGBuffer, v_textureCoordinates);
// sample from neighbors left, right, down, up
vec2 texelSize = 1.0 / czm_viewport.zw;
vec2 responseAndCount = vec2(0.0);
responseAndCount += neighborContribution(log2Depth, vec2(-texelSize.x, 0.0));
responseAndCount += neighborContribution(log2Depth, vec2(+texelSize.x, 0.0));
responseAndCount += neighborContribution(log2Depth, vec2(0.0, -texelSize.y));
responseAndCount += neighborContribution(log2Depth, vec2(0.0, +texelSize.y));
float response = responseAndCount.x / responseAndCount.y;
float strength = u_distanceAndEdlStrength.y;
float shade = exp(-response * 300.0 * strength);
color.rgb *= shade;
out_FragColor = vec4(color);
// Input and output depth are the same.
gl_FragDepth = depthOrLogDepth;
}
`;function bC(){this._framebuffer=new pi({colorAttachmentsLength:2,depth:!0,supportsDepthTexture:!0}),this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}Object.defineProperties(bC.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}},colorGBuffer:{get:function(){return this._framebuffer.getColorTexture(0)}},depthGBuffer:{get:function(){return this._framebuffer.getColorTexture(1)}}});function sAe(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var wY=new B;function aAe(e,t){let n=new Oe({defines:["LOG_DEPTH_WRITE"],sources:[II]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return wY.x=e._radius,wY.y=e._strength,wY}},o=ke.fromCache({blending:mn.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:Nt.setCesium3DTileBit(),stencilMask:Nt.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(n,{uniformMap:i,renderState:o,pass:Ve.CESIUM_3D_TILE,owner:e}),e._clearCommand=new ai({framebuffer:e.framebuffer,color:new O(0,0,0,0),depth:1,renderState:ke.fromCache(),pass:Ve.CESIUM_3D_TILE,owner:e})}function cAe(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),aAe(e,t)}function Yie(e){return e.drawBuffers&&e.fragmentDepth}bC.isSupported=Yie;function lAe(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"EC");if(!l(n)){let i=t._attributeLocations,o=t.fragmentShaderSource.clone();o.sources.splice(0,0,`layout (location = 0) out vec4 out_FragData_0;
layout (location = 1) out vec4 out_FragData_1;`),o.sources=o.sources.map(function(r){return r=Oe.replaceMain(r,"czm_point_cloud_post_process_main"),r=r.replaceAll(/out_FragColor/g,"out_FragData_0"),r}),o.sources.push(`void main()
{
czm_point_cloud_post_process_main();
#ifdef LOG_DEPTH
czm_writeLogDepth();
out_FragData_1 = czm_packDepth(gl_FragDepth);
#else
out_FragData_1 = czm_packDepth(gl_FragCoord.z);
#endif
}`),n=e.shaderCache.createDerivedShaderProgram(t,"EC",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:o,attributeLocations:i})}return n}bC.prototype.update=function(e,t,n,i){if(!Yie(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,cAe(this,e.context);let o,r=e.commandList,s=r.length;for(o=t;o<s;++o){let d=r[o];if(d.primitiveType!==Ae.POINTS||d.pass===Ve.TRANSLUCENT)continue;let u,m,p=d.derivedCommands.pointCloudProcessor;l(p)&&(u=p.command,m=p.originalShaderProgram),(!l(u)||d.dirty||m!==d.shaderProgram||u.framebuffer!==this.framebuffer)&&(u=nt.shallowClone(d,u),u.framebuffer=this.framebuffer,u.shaderProgram=lAe(e.context,d.shaderProgram),u.castShadows=!1,u.receiveShadows=!1,l(p)||(p={command:u,originalShaderProgram:d.shaderProgram},d.derivedCommands.pointCloudProcessor=p),p.originalShaderProgram=d.shaderProgram),r[o]=u}let a=this._clearCommand,c=this._drawCommand;c.boundingVolume=i,r.push(c),r.push(a)};bC.prototype.isDestroyed=function(){return!1};bC.prototype.destroy=function(){return sAe(this),ue(this)};var Op=bC;function Hie(e){let t=g(e,{});this.attenuation=g(t.attenuation,!1),this.geometricErrorScale=g(t.geometricErrorScale,1),this.maximumAttenuation=t.maximumAttenuation,this.baseResolution=t.baseResolution,this.eyeDomeLighting=g(t.eyeDomeLighting,!0),this.eyeDomeLightingStrength=g(t.eyeDomeLightingStrength,1),this.eyeDomeLightingRadius=g(t.eyeDomeLightingRadius,1),this.backFaceCulling=g(t.backFaceCulling,!1),this.normalShading=g(t.normalShading,!0)}Hie.isSupported=function(e){return Op.isSupported(e.context)};var af=Hie;var wun=T(S(),1);var Ga={},dAe=new se(0,0,0,1),sc=new se,uAe=new De,FY=new B,AY=new B;Ga.wgs84ToWindowCoordinates=function(e,t,n){return Ga.wgs84WithEyeOffsetToWindowCoordinates(e,t,h.ZERO,n)};var Kie=new se,zie=new h;function XI(e,t,n,i){let o=n.viewMatrix,r=A.multiplyByVector(o,se.fromElements(e.x,e.y,e.z,1,Kie),Kie),s=h.multiplyComponents(t,h.normalize(r,zie),zie);return r.x+=t.x+s.x,r.y+=t.y+s.y,r.z+=s.z,A.multiplyByVector(n.frustum.projectionMatrix,r,i)}var mAe=new he(Math.PI,W.PI_OVER_TWO),hAe=new h,fAe=new h;Ga.wgs84WithEyeOffsetToWindowCoordinates=function(e,t,n,i){let o=e.frameState,r=Ga.computeActualWgs84Position(o,t,dAe);if(!l(r))return;let s=e.canvas,a=uAe;a.x=0,a.y=0,a.width=s.clientWidth,a.height=s.clientHeight;let c=e.camera,d=!1;if(o.mode===ie.SCENE2D){let u=e.mapProjection,m=mAe,p=u.project(m,hAe),y=h.clone(c.position,fAe),f=c.frustum.clone(),x=A.computeViewportTransformation(a,0,1,new A),_=c.frustum.projectionMatrix,C=c.positionWC.y,V=h.fromElements(W.sign(C)*p.x-C,0,-c.positionWC.x),L=Xt.pointToGLWindowCoordinates(_,x,V);if(C===0||L.x<=0||L.x>=s.clientWidth)d=!0;else{if(L.x>s.clientWidth*.5){a.width=L.x,c.frustum.right=p.x-C,sc=XI(r,n,c,sc),Ga.clipToGLWindowCoordinates(a,sc,FY),a.x+=L.x,c.position.x=-c.position.x;let Z=c.frustum.right;c.frustum.right=-c.frustum.left,c.frustum.left=-Z,sc=XI(r,n,c,sc),Ga.clipToGLWindowCoordinates(a,sc,AY)}else{a.x+=L.x,a.width-=L.x,c.frustum.left=-p.x-C,sc=XI(r,n,c,sc),Ga.clipToGLWindowCoordinates(a,sc,FY),a.x=a.x-a.width,c.position.x=-c.position.x;let Z=c.frustum.left;c.frustum.left=-c.frustum.right,c.frustum.right=-Z,sc=XI(r,n,c,sc),Ga.clipToGLWindowCoordinates(a,sc,AY)}h.clone(y,c.position),c.frustum=f.clone(),i=B.clone(FY,i),(i.x<0||i.x>s.clientWidth)&&(i.x=AY.x)}}if(o.mode!==ie.SCENE2D||d){if(sc=XI(r,n,c,sc),sc.z<0&&!(c.frustum instanceof rn)&&!(c.frustum instanceof Vr))return;i=Ga.clipToGLWindowCoordinates(a,sc,i)}return i.y=s.clientHeight-i.y,i};Ga.wgs84ToDrawingBufferCoordinates=function(e,t,n){if(n=Ga.wgs84ToWindowCoordinates(e,t,n),!!l(n))return Ga.transformWindowToDrawingBuffer(e,n,n)};var Yp=new h,pAe=new he;Ga.computeActualWgs84Position=function(e,t,n){let i=e.mode;if(i===ie.SCENE3D)return h.clone(t,n);let o=e.mapProjection,r=o.ellipsoid.cartesianToCartographic(t,pAe);if(!l(r))return;if(o.project(r,Yp),i===ie.COLUMBUS_VIEW)return h.fromElements(Yp.z,Yp.x,Yp.y,n);if(i===ie.SCENE2D)return h.fromElements(0,Yp.x,Yp.y,n);let s=e.morphTime;return h.fromElements(W.lerp(Yp.z,t.x,s),W.lerp(Yp.x,t.y,s),W.lerp(Yp.y,t.z,s),n)};var Jie=new h,Qie=new h,jie=new A;Ga.clipToGLWindowCoordinates=function(e,t,n){return h.divideByScalar(t,t.w,Jie),A.computeViewportTransformation(e,0,1,jie),A.multiplyByPoint(jie,Jie,Qie),B.fromCartesian3(Qie,n)};Ga.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,o=e.drawingBufferWidth/i.clientWidth,r=e.drawingBufferHeight/i.clientHeight;return B.fromElements(t.x*o,t.y*r,n)};var bAe=new se,qie=new se;Ga.drawingBufferToWgs84Coordinates=function(e,t,n,i){let r=e.context.uniformState,s=r.currentFrustum,a=s.x,c=s.y;if(e.frameState.useLogDepth){let y=n*r.log2FarDepthFromNearPlusOne,f=Math.pow(2,y)-1;n=c*(1-a/(f+a))/(c-a)}let d=e.view.passState.viewport,u=se.clone(se.UNIT_W,bAe);u.x=(t.x-d.x)/d.width*2-1,u.y=(t.y-d.y)/d.height*2-1,u.z=n*2-1,u.w=1;let m,p=e.camera.frustum;if(l(p.fovy)){m=A.multiplyByVector(r.inverseViewProjection,u,qie);let y=1/m.w;h.multiplyByScalar(m,y,m)}else{let y=p.offCenterFrustum;l(y)&&(p=y),m=qie,m.x=(u.x*(p.right-p.left)+p.left+p.right)*.5,m.y=(u.y*(p.top-p.bottom)+p.bottom+p.top)*.5,m.z=(u.z*(a-c)-a-c)*.5,m.w=1,m=A.multiplyByVector(r.inverseView,m,m)}return h.fromCartesian4(m,i)};var to=Ga;var Aun=T(S(),1),yAe={LEFT:-1,NONE:0,RIGHT:1},Bc=Object.freeze(yAe);var Wmn=T(S(),1);var Bun=T(S(),1);var yC={};yC._deprecationWarning=_r;var Hp=Uint32Array.BYTES_PER_ELEMENT;yC.parse=function(e,t){let n=g(t,0);t=n;let i=new Uint8Array(e),o=new DataView(e);t+=Hp;let r=o.getUint32(t,!0);if(r!==1)throw new me(`Only Batched 3D Model version 1 is supported. Version ${r} is not.`);t+=Hp;let s=o.getUint32(t,!0);t+=Hp;let a=o.getUint32(t,!0);t+=Hp;let c=o.getUint32(t,!0);t+=Hp;let d=o.getUint32(t,!0);t+=Hp;let u=o.getUint32(t,!0);t+=Hp;let m;d>=570425344?(t-=Hp*2,m=a,d=c,u=0,a=0,c=0,yC._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/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel.")):u>=570425344&&(t-=Hp,m=d,d=a,u=c,a=0,c=0,yC._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/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel."));let p;a===0?p={BATCH_LENGTH:g(m,0)}:(p=Po(i,t,a),t+=a);let y=new Uint8Array(e,t,c);t+=c;let f,x;d>0&&(f=Po(i,t,d),t+=d,u>0&&(x=new Uint8Array(e,t,u),x=new Uint8Array(x),t+=u));let _=n+s-t;if(_===0)throw new me("glTF byte length must be greater than 0.");let C;return t%4===0?C=new Uint8Array(e,t,_):(yC._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),C=new Uint8Array(i.subarray(t,t+_))),{batchLength:m,featureTableJson:p,featureTableBinary:y,batchTableJson:f,batchTableBinary:x,gltf:C}};var WI=yC;var zun=T(S(),1);function PI(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function $ie(e,t,n,i,o,r){let s=e._cachedTypedArrays,a=s[t];return l(a)||(a=Q.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+r,o*i),s[t]=a),a}function gAe(e,t,n,i){let o=e._cachedTypedArrays,r=o[t];return l(r)||(r=Q.createTypedArray(n,i),o[t]=r),r}PI.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(t=g(t,Q.UNSIGNED_INT),n=g(n,1),$ie(this,e,t,n,1,i.byteOffset)):i};PI.prototype.hasProperty=function(e){return l(this.json[e])};PI.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(l(i.componentType)&&(t=Q.fromName(i.componentType)),$ie(this,e,t,n,this.featuresLength,i.byteOffset)):gAe(this,e,t,i)};PI.prototype.getProperty=function(e,t,n,i,o){let r=this.json[e];if(!l(r))return;let s=this.getPropertyArray(e,t,n);if(n===1)return s[i];for(let a=0;a<n;++a)o[a]=s[n*i+a];return o};var Mm=PI;var hmn=T(S(),1);function vI(e){let t=e.count,n=e.batchTable,i=e.binaryBody,o=g(e.parseAsPropertyAttributes,!1),r=e.customAttributeOutput,s=xAe(n),a;l(s.jsonProperties)&&(a=new kp({count:t,properties:s.jsonProperties}));let c;l(s.hierarchy)&&(c=new Xx({extension:s.hierarchy,binaryBody:i}));let d=Xm.BATCH_TABLE_CLASS_NAME,u=s.binaryProperties,m,p,y;if(o){let _=TAe(t,d,u,i,r);y=_.transcodedSchema,p=[new jx({propertyAttribute:_.propertyAttributeJson,class:_.transcodedClass})]}else{let _=_Ae(t,d,u,i);y=_.transcodedSchema;let C=_.featureTableJson;m=new Ll({count:C.count,properties:C.properties,class:_.transcodedClass,bufferViews:_.bufferViewsTypedArrays}),p=[]}let f=[];if(l(m)||l(a)||l(c)){let _=new kc({id:0,name:"Batch Table",count:t,metadataTable:m,jsonMetadataTable:a,batchTableHierarchy:c});f.push(_)}let x={schema:y,propertyTables:f,propertyAttributes:p,extensions:s.extensions,extras:s.extras};return new Za(x)}function xAe(e){let t=e.HIERARCHY,n=e.extras,i=e.extensions,o;l(t)?(vI._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),o=t):l(i)&&(o=i["3DTILES_batch_table_hierarchy"]);let r,s={};for(let a in e){if(!e.hasOwnProperty(a)||a==="HIERARCHY"||a==="extensions"||a==="extras")continue;let c=e[a];Array.isArray(c)?(r=l(r)?r:{},r[a]=c):s[a]=c}return{binaryProperties:s,jsonProperties:r,hierarchy:o,extras:n,extensions:i}}function _Ae(e,t,n,i){let o={},r={},s={},a=0;for(let m in n){if(!n.hasOwnProperty(m))continue;if(!l(i))throw new me(`Property ${m} requires a batch table binary.`);let p=n[m],y=ad(p);r[m]={bufferView:a},o[m]=eoe(p),s[a]=y.createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e),a++}let c={classes:{}};c.classes[t]={properties:o};let d=Wm.fromJson(c);return{featureTableJson:{class:t,count:e,properties:r},bufferViewsTypedArrays:s,transcodedSchema:d,transcodedClass:d.classes[t]}}function TAe(e,t,n,i,o){let r={},s={},a=0;for(let m in n){if(!n.hasOwnProperty(m))continue;let p=n[m];if(!l(i)&&!l(p.typedArray))throw new me(`Property ${m} requires a batch table binary.`);let y=qt.sanitizeGlslIdentifier(m);(y===""||r.hasOwnProperty(y))&&(y=`property_${a}`,a++);let f=eoe(p);f.name=m,r[y]=f;let x=y.toUpperCase();x.startsWith("_")||(x=`_${x}`);let _=p.typedArray;l(_)||(_=ad(p).createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e));let C=new Mt.Attribute;C.name=x,C.count=e,C.type=p.type;let V=Q.fromTypedArray(_);(V===Q.INT||V===Q.UNSIGNED_INT||V===Q.DOUBLE)&&(vI._oneTimeWarning("Cast pnts property to floats",`Point cloud property "${x}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),_=new Float32Array(_)),C.componentDatatype=Q.fromTypedArray(_),C.typedArray=_,o.push(C),s[y]={attribute:x}}let c={classes:{}};c.classes[t]={properties:r};let d=Wm.fromJson(c);return{class:t,propertyAttributeJson:{properties:s},transcodedSchema:d,transcodedClass:d.classes[t]}}function eoe(e){let t=SAe(e.componentType);return{type:e.type,componentType:t}}function SAe(e){switch(e){case"BYTE":return"INT8";case"UNSIGNED_BYTE":return"UINT8";case"SHORT":return"INT16";case"UNSIGNED_SHORT":return"UINT16";case"INT":return"INT32";case"UNSIGNED_INT":return"UINT32";case"FLOAT":return"FLOAT32";case"DOUBLE":return"FLOAT64"}}vI._deprecationWarning=_r;vI._oneTimeWarning=Ft;var Kp=vI;var e_={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},CAe=Mt.FeatureIdAttribute;function Jb(e){e=g(e,g.EMPTY_OBJECT);let t=e.b3dmResource,n=e.baseResource,i=e.arrayBuffer,o=g(e.byteOffset,0),r=g(e.releaseGltfJson,!1),s=g(e.asynchronous,!0),a=g(e.incrementallyLoadTextures,!0),c=g(e.upAxis,Wo.Y),d=g(e.forwardAxis,Wo.X),u=g(e.loadAttributesAsTypedArray,!1),m=g(e.loadAttributesFor2D,!1),p=g(e.enablePick,!1),y=g(e.loadIndicesForWireframe,!1),f=g(e.loadPrimitiveOutline,!0),x=g(e.loadForClassification,!1);n=l(n)?n:t.clone(),this._b3dmResource=t,this._baseResource=n,this._arrayBuffer=i,this._byteOffset=o,this._releaseGltfJson=r,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=c,this._forwardAxis=d,this._loadAttributesAsTypedArray=u,this._loadAttributesFor2D=m,this._enablePick=p,this._loadIndicesForWireframe=y,this._loadPrimitiveOutline=f,this._loadForClassification=x,this._state=e_.UNLOADED,this._promise=void 0,this._gltfLoader=void 0,this._batchLength=0,this._propertyTable=void 0,this._batchTable=void 0,this._components=void 0,this._transform=A.IDENTITY}l(Object.create)&&(Jb.prototype=Object.create(co.prototype),Jb.prototype.constructor=Jb);Object.defineProperties(Jb.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});Jb.prototype.load=function(){if(l(this._promise))return this._promise;let e=WI.parse(this._arrayBuffer,this._byteOffset),t=e.batchLength,n=e.featureTableJson,i=e.featureTableBinary,o=e.batchTableJson,r=e.batchTableBinary,s=new Mm(n,i);t=s.getGlobalProperty("BATCH_LENGTH"),this._batchLength=t;let a=s.getGlobalProperty("RTC_CENTER",Q.FLOAT,3);l(a)&&(this._transform=A.fromTranslation(h.fromArray(a))),this._batchTable={json:o,binary:r};let c=new Bp({typedArray:e.gltf,upAxis:this._upAxis,forwardAxis:this._forwardAxis,gltfResource:this._b3dmResource,baseResource:this._baseResource,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,loadAttributesFor2D:this._loadAttributesFor2D,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline,loadForClassification:this._loadForClassification,renameBatchIdSemantic:!0});this._gltfLoader=c,this._state=e_.LOADING;let d=this;return this._promise=c.load().then(function(){if(!d.isDestroyed())return d._state=e_.PROCESSING,d}).catch(function(u){if(!d.isDestroyed())return VAe(d,u)}),this._promise};function VAe(e,t){return e.unload(),e._state=e_.FAILED,t=e.getError("Failed to load b3dm",t),Promise.reject(t)}Jb.prototype.process=function(e){if(this._state===e_.READY)return!0;if(this._state!==e_.PROCESSING||!this._gltfLoader.process(e))return!1;let n=this._gltfLoader.components;return n.transform=A.multiplyTransformation(this._transform,n.transform,n.transform),LAe(this,n),this._components=n,this._arrayBuffer=void 0,this._state=e_.READY,!0};function LAe(e,t){let n=e._batchTable,i=e._batchLength;if(i===0)return;let o;if(l(n.json))o=Kp({count:i,batchTable:n.json,binaryBody:n.binary});else{let a=new kc({name:Xm.BATCH_TABLE_CLASS_NAME,count:i});o=new Za({schema:{},propertyTables:[a]})}let r=t.scene.nodes,s=r.length;for(let a=0;a<s;a++)toe(r[a]);t.structuralMetadata=o}function toe(e){let t=e.children.length;for(let i=0;i<t;i++)toe(e.children[i]);let n=e.primitives.length;for(let i=0;i<n;i++){let o=e.primitives[i],r=qt.getAttributeBySemantic(o,_t.FEATURE_ID);if(l(r)){r.setIndex=0;let s=new CAe;s.propertyTableId=0,s.setIndex=0,s.positionalLabel="featureId_0",o.featureIds.push(s)}}}Jb.prototype.unload=function(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),this._components=void 0,this._arrayBuffer=void 0};var wI=Jb;var ehn=T(S(),1);function Qb(e){e=g(e,g.EMPTY_OBJECT),this._geoJson=e.geoJson,this._components=void 0}l(Object.create)&&(Qb.prototype=Object.create(co.prototype),Qb.prototype.constructor=Qb);Object.defineProperties(Qb.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}}});Qb.prototype.load=function(){return Promise.resolve(this)};Qb.prototype.process=function(e){return l(this._components)||(this._components=MAe(this._geoJson,e),this._geoJson=void 0),!0};function RAe(){this.lines=void 0,this.points=void 0,this.properties=void 0}function ZAe(){this.features=[]}function MY(e){let t=e[0],n=e[1],i=g(e[2],0);return new h(t,n,i)}function NY(e){let t=e.length,n=new Array(t);for(let o=0;o<t;o++)n[o]=MY(e[o]);return[n]}function GAe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=NY(e[i])[0];return n}function noe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=NY(e[i])[0];return n}function EAe(e){let t=e.length,n=[];for(let i=0;i<t;i++)Array.prototype.push.apply(n,noe(e[i]));return n}function IAe(e){return[MY(e)]}function XAe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=MY(e[i]);return n}var WAe={LineString:NY,MultiLineString:GAe,MultiPolygon:EAe,Polygon:noe,MultiPoint:XAe,Point:IAe},PAe={LineString:Ae.LINES,MultiLineString:Ae.LINES,MultiPolygon:Ae.LINES,Polygon:Ae.LINES,MultiPoint:Ae.POINTS,Point:Ae.POINTS};function ioe(e,t){if(!l(e.geometry))return;let n=e.geometry.type,i=WAe[n],o=PAe[n],r=e.geometry.coordinates;if(!l(i)||!l(r))return;let s=new RAe;o===Ae.LINES?s.lines=i(r):o===Ae.POINTS&&(s.points=i(r)),s.properties=e.properties,t.features.push(s)}function vAe(e,t){let n=e.features,i=n.length;for(let o=0;o<i;o++)ioe(n[o],t)}var wAe={FeatureCollection:vAe,Feature:ioe},AN=new h;function FAe(e,t,n){let i=0,o=0,r=e.length;for(let F=0;F<r;F++){let M=e[F];if(l(M.lines)){let b=M.lines.length;for(let R=0;R<b;R++){let E=M.lines[R];i+=E.length,o+=(E.length-1)*2}}}let s=new Float32Array(i*3),a=new Float32Array(i),c=Ne.createTypedArray(i,o),d=Ne.fromTypedArray(c),u=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),m=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),p=0,y=0;for(let F=0;F<r;F++){let M=e[F];if(!l(M.lines))continue;let b=M.lines.length;for(let R=0;R<b;R++){let E=M.lines[R],X=E.length;for(let w=0;w<X;w++){let N=E[w],D=h.fromDegrees(N.x,N.y,N.z,oe.WGS84,AN),k=A.multiplyByPoint(t,D,AN);h.minimumByComponent(u,k,u),h.maximumByComponent(m,k,m),h.pack(k,s,p*3),a[p]=F,w<X-1&&(c[y*2]=p,c[y*2+1]=p+1,y++),p++}}}let f=ft.createVertexBuffer({typedArray:s,context:n.context,usage:Ue.STATIC_DRAW});f.vertexArrayDestroyable=!1;let x=ft.createVertexBuffer({typedArray:a,context:n.context,usage:Ue.STATIC_DRAW});x.vertexArrayDestroyable=!1;let _=ft.createIndexBuffer({typedArray:c,context:n.context,usage:Ue.STATIC_DRAW,indexDatatype:d});_.vertexArrayDestroyable=!1;let C=new Mt.Attribute;C.semantic=_t.POSITION,C.componentDatatype=Q.FLOAT,C.type=tn.VEC3,C.count=i,C.min=u,C.max=m,C.buffer=f;let V=new Mt.Attribute;V.semantic=_t.FEATURE_ID,V.setIndex=0,V.componentDatatype=Q.FLOAT,V.type=tn.SCALAR,V.count=i,V.buffer=x;let L=[C,V],Z=new Mt.Material;Z.unlit=!0;let G=new Mt.Indices;G.indexDatatype=d,G.count=c.length,G.buffer=_;let I=new Mt.FeatureIdAttribute;I.featureCount=r,I.propertyTableId=0,I.setIndex=0,I.positionalLabel="featureId_0";let P=[I],v=new Mt.Primitive;return v.attributes=L,v.indices=G,v.featureIds=P,v.primitiveType=Ae.LINES,v.material=Z,v}function AAe(e,t,n){let i=0,o=e.length;for(let L=0;L<o;L++){let Z=e[L];l(Z.points)&&(i+=Z.points.length)}let r=new Float32Array(i*3),s=new Float32Array(i),a=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),c=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),d=0;for(let L=0;L<o;L++){let Z=e[L];if(!l(Z.points))continue;let G=Z.points.length;for(let I=0;I<G;I++){let P=Z.points[I],v=h.fromDegrees(P.x,P.y,P.z,oe.WGS84,AN),F=A.multiplyByPoint(t,v,AN);h.minimumByComponent(a,F,a),h.maximumByComponent(c,F,c),h.pack(F,r,d*3),s[d]=L,d++}}let u=ft.createVertexBuffer({typedArray:r,context:n.context,usage:Ue.STATIC_DRAW});u.vertexArrayDestroyable=!1;let m=ft.createVertexBuffer({typedArray:s,context:n.context,usage:Ue.STATIC_DRAW});m.vertexArrayDestroyable=!1;let p=new Mt.Attribute;p.semantic=_t.POSITION,p.componentDatatype=Q.FLOAT,p.type=tn.VEC3,p.count=i,p.min=a,p.max=c,p.buffer=u;let y=new Mt.Attribute;y.semantic=_t.FEATURE_ID,y.setIndex=0,y.componentDatatype=Q.FLOAT,y.type=tn.SCALAR,y.count=i,y.buffer=m;let f=[p,y],x=new Mt.Material;x.unlit=!0;let _=new Mt.FeatureIdAttribute;_.featureCount=o,_.propertyTableId=0,_.setIndex=0,_.positionalLabel="featureId_0";let C=[_],V=new Mt.Primitive;return V.attributes=f,V.featureIds=C,V.primitiveType=Ae.POINTS,V.material=x,V}function MAe(e,t){let n=new ZAe,i=wAe[e.type];l(i)&&i(e,n);let o=n.features,r=o.length;if(r===0)throw new me("GeoJSON must have at least one feature");let s={};for(let F=0;F<r;F++){let M=o[F],b=g(M.properties,g.EMPTY_OBJECT);for(let R in b)b.hasOwnProperty(R)&&(l(s[R])||(s[R]=new Array(r)))}for(let F=0;F<r;F++){let M=o[F];for(let b in s)if(s.hasOwnProperty(b)){let R=g(M.properties[b],"");s[b][F]=R}}let a=new kp({count:r,properties:s}),d=[new kc({id:0,count:r,jsonMetadataTable:a})],u=Wm.fromJson({}),m=new Za({schema:u,propertyTables:d}),p=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),y=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),f=!1,x=!1;for(let F=0;F<r;F++){let M=o[F];if(l(M.lines)){f=!0;let b=M.lines.length;for(let R=0;R<b;R++){let E=M.lines[R],X=E.length;for(let w=0;w<X;w++)h.minimumByComponent(p,E[w],p),h.maximumByComponent(y,E[w],y)}}if(l(M.points)){x=!0;let b=M.points.length;for(let R=0;R<b;R++){let E=M.points[R];h.minimumByComponent(p,E,p),h.maximumByComponent(y,E,y)}}}let _=h.midpoint(p,y,new h),C=h.fromDegrees(_.x,_.y,_.z,oe.WGS84,new h),V=Xt.eastNorthUpToFixedFrame(C,oe.WGS84,new A),L=A.inverseTransformation(V,new A),Z=[];f&&Z.push(FAe(o,L,t)),x&&Z.push(AAe(o,L,t));let G=new Mt.Node;G.index=0,G.primitives=Z;let I=[G],P=new Mt.Scene;P.nodes=I;let v=new Mt.Components;return v.scene=P,v.nodes=I,v.transform=V,v.structuralMetadata=m,v}Qb.prototype.unload=function(){this._components=void 0};var FI=Qb;var Fhn=T(S(),1);var shn=T(S(),1);var MN={};MN._deprecationWarning=_r;var jb=Uint32Array.BYTES_PER_ELEMENT;MN.parse=function(e,t){let n=g(t,0);t=n;let i=new Uint8Array(e),o=new DataView(e);t+=jb;let r=o.getUint32(t,!0);if(r!==1)throw new me(`Only Instanced 3D Model version 1 is supported. Version ${r} is not.`);t+=jb;let s=o.getUint32(t,!0);t+=jb;let a=o.getUint32(t,!0);if(a===0)throw new me("featureTableJsonByteLength is zero, the feature table must be defined.");t+=jb;let c=o.getUint32(t,!0);t+=jb;let d=o.getUint32(t,!0);t+=jb;let u=o.getUint32(t,!0);t+=jb;let m=o.getUint32(t,!0);if(m!==1&&m!==0)throw new me(`Only glTF format 0 (uri) or 1 (embedded) are supported. Format ${m} is not.`);t+=jb;let p=Po(i,t,a);t+=a;let y=new Uint8Array(e,t,c);t+=c;let f,x;d>0&&(f=Po(i,t,d),t+=d,u>0&&(x=new Uint8Array(e,t,u),x=new Uint8Array(x),t+=u));let _=n+s-t;if(_===0)throw new me("glTF byte length must be greater than 0.");let C;return t%4===0?C=new Uint8Array(e,t,_):(MN._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),C=new Uint8Array(i.subarray(t,t+_))),{gltfFormat:m,featureTableJson:p,featureTableBinary:y,batchTableJson:f,batchTableBinary:x,gltf:C}};var AI=MN;var zp={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},NN=Mt.Attribute,NAe=Mt.FeatureIdAttribute,roe=Mt.Instances;function Jp(e){e=g(e,g.EMPTY_OBJECT);let t=e.i3dmResource,n=e.arrayBuffer,i=e.baseResource,o=g(e.byteOffset,0),r=g(e.releaseGltfJson,!1),s=g(e.asynchronous,!0),a=g(e.incrementallyLoadTextures,!0),c=g(e.upAxis,Wo.Y),d=g(e.forwardAxis,Wo.X),u=g(e.loadAttributesAsTypedArray,!1),m=g(e.loadIndicesForWireframe,!1),p=g(e.loadPrimitiveOutline,!0),y=g(e.enablePick,!1);i=l(i)?i:t.clone(),this._i3dmResource=t,this._baseResource=i,this._arrayBuffer=n,this._byteOffset=o,this._releaseGltfJson=r,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=c,this._forwardAxis=d,this._loadAttributesAsTypedArray=u,this._loadIndicesForWireframe=m,this._loadPrimitiveOutline=p,this._enablePick=y,this._state=zp.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=A.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}l(Object.create)&&(Jp.prototype=Object.create(co.prototype),Jp.prototype.constructor=Jp);Object.defineProperties(Jp.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});Jp.prototype.load=function(){if(l(this._promise))return this._promise;let e=AI.parse(this._arrayBuffer,this._byteOffset),t=e.featureTableJson,n=e.featureTableBinary,i=e.batchTableJson,o=e.batchTableBinary,r=e.gltfFormat,s=new Mm(t,n);this._featureTable=s;let a=s.getGlobalProperty("INSTANCES_LENGTH");if(s.featuresLength=a,!l(a))throw new me("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=a;let c=s.getGlobalProperty("RTC_CENTER",Q.FLOAT,3);l(c)&&(this._transform=A.fromTranslation(h.fromArray(c))),this._batchTable={json:i,binary:o};let d={upAxis:this._upAxis,forwardAxis:this._forwardAxis,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline};if(r===0){let m=Sl(e.gltf);m=m.replace(/[\s\0]+$/,"");let p=this._baseResource.getDerivedResource({url:m});d.gltfResource=p,d.baseResource=p}else d.gltfResource=this._i3dmResource,d.typedArray=e.gltf;let u=new Bp(d);return this._gltfLoader=u,this._state=zp.LOADING,this._promise=u.load().then(()=>{if(!this.isDestroyed())return this._state=zp.PROCESSING,this}).catch(m=>{if(!this.isDestroyed())throw UAe(this,m)}),this._promise};function UAe(e,t){return e.unload(),e._state=zp.FAILED,e.getError("Failed to load i3dm",t)}Jp.prototype.process=function(e){if(this._state===zp.READY)return!0;let t=this._gltfLoader,n=!1;if(this._state===zp.PROCESSING&&(n=t.process(e)),!n)return!1;let i=t.components;return i.transform=A.multiplyTransformation(this._transform,i.transform,i.transform),BAe(this,i,e),kAe(this,i),this._components=i,this._arrayBuffer=void 0,this._state=zp.READY,!0};function kAe(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let o;if(l(n.json))o=Kp({count:i,batchTable:n.json,binaryBody:n.binary});else{let r=new kc({name:Xm.BATCH_TABLE_CLASS_NAME,count:i});o=new Za({schema:{},propertyTables:[r]})}t.structuralMetadata=o}var UN=new h,UY=new Array(4),DAe=new A;function BAe(e,t,n){let i,o=e._featureTable,r=e._instancesLength;if(r===0)return;let s=o.getGlobalProperty("RTC_CENTER",Q.FLOAT,3),a=o.getGlobalProperty("EAST_NORTH_UP"),c=o.hasProperty("NORMAL_UP")||o.hasProperty("NORMAL_UP_OCT32P")||a,d=o.hasProperty("SCALE")||o.hasProperty("SCALE_NON_UNIFORM"),u=YAe(o,r),m;c&&(m=new Float32Array(4*r));let p;d&&(p=new Float32Array(3*r));let y=new Float32Array(r),f=h.unpackArray(u),x=new h,_=new h,C=new h,V=new h,L=new q,Z=new Me,G=new Array(4),I=new h,P=new Array(3),v=new A;if(!l(s)||h.equals(h.unpack(s),h.ZERO)){let k=ce.fromPoints(f);for(i=0;i<f.length;i++)h.subtract(f[i],k.center,UN),u[3*i+0]=UN.x,u[3*i+1]=UN.y,u[3*i+2]=UN.z;let Y=A.fromTranslation(k.center,DAe);t.transform=A.multiplyTransformation(Y,t.transform,t.transform)}for(i=0;i<r;i++){x=h.clone(f[i]),l(s)&&h.add(x,h.unpack(s),x),c&&(HAe(o,a,i,Z,x,C,_,V,L,v),Me.pack(Z,G,0),m[4*i+0]=G[0],m[4*i+1]=G[1],m[4*i+2]=G[2],m[4*i+3]=G[3]),d&&(KAe(o,i,I),h.pack(I,P,0),p[3*i+0]=P[0],p[3*i+1]=P[1],p[3*i+2]=P[2]);let k=o.getProperty("BATCH_ID",Q.UNSIGNED_SHORT,1,i);l(k)||(k=i),y[i]=k}let F=new roe;F.transformInWorldSpace=!0;let M=e._buffers,b=new NN;if(b.name="Instance Translation",b.semantic=Hr.TRANSLATION,b.componentDatatype=Q.FLOAT,b.type=tn.VEC3,b.count=r,b.typedArray=u,!c){let k=ft.createVertexBuffer({context:n.context,typedArray:u,usage:Ue.STATIC_DRAW});k.vertexArrayDestroyable=!1,M.push(k),b.buffer=k}if(F.attributes.push(b),c){let k=new NN;k.name="Instance Rotation",k.semantic=Hr.ROTATION,k.componentDatatype=Q.FLOAT,k.type=tn.VEC4,k.count=r,k.typedArray=m,F.attributes.push(k)}if(d){let k=new NN;if(k.name="Instance Scale",k.semantic=Hr.SCALE,k.componentDatatype=Q.FLOAT,k.type=tn.VEC3,k.count=r,c)k.typedArray=p;else{let Y=ft.createVertexBuffer({context:n.context,typedArray:p,usage:Ue.STATIC_DRAW});Y.vertexArrayDestroyable=!1,M.push(Y),k.buffer=Y}F.attributes.push(k)}let R=new NN;R.name="Instance Feature ID",R.setIndex=0,R.semantic=Hr.FEATURE_ID,R.componentDatatype=Q.FLOAT,R.type=tn.SCALAR,R.count=r;let E=ft.createVertexBuffer({context:n.context,typedArray:y,usage:Ue.STATIC_DRAW});E.vertexArrayDestroyable=!1,M.push(E),R.buffer=E,F.attributes.push(R);let X=new NAe;X.propertyTableId=0,X.setIndex=0,X.positionalLabel="instanceFeatureId_0",F.featureIds.push(X);let w=t.nodes,N=w.length,D=!1;for(i=0;i<N;i++){let k=w[i];k.primitives.length>0&&(k.instances=D?OAe(F):F,D=!0)}}function OAe(e){let t=new roe;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=ze(n[o],!1);t.attributes.push(r)}return t.featureIds=e.featureIds,t}function YAe(e,t){if(e.hasProperty("POSITION"))return e.getPropertyArray("POSITION",Q.FLOAT,3);if(e.hasProperty("POSITION_QUANTIZED")){let n=e.getPropertyArray("POSITION_QUANTIZED",Q.UNSIGNED_SHORT,3),i=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Q.FLOAT,3);if(!l(i))throw new me("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let o=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Q.FLOAT,3);if(!l(o))throw new me("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let r=new Float32Array(n.length);for(let s=0;s<n.length/3;s++)for(let a=0;a<3;a++){let c=3*s+a;r[c]=n[c]/65535*o[a]+i[a]}return r}else throw new me("Either POSITION or POSITION_QUANTIZED must be defined for each instance.")}var ooe=new Array(4);function HAe(e,t,n,i,o,r,s,a,c,d){let u=e.getProperty("NORMAL_UP",Q.FLOAT,3,n,UY),m=e.getProperty("NORMAL_RIGHT",Q.FLOAT,3,n,ooe),p=!1;if(l(u)){if(!l(m))throw new me("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");h.unpack(u,0,r),h.unpack(m,0,s),p=!0}else{let y=e.getProperty("NORMAL_UP_OCT32P",Q.UNSIGNED_SHORT,2,n,UY),f=e.getProperty("NORMAL_RIGHT_OCT32P",Q.UNSIGNED_SHORT,2,n,ooe);if(l(y)){if(!l(f))throw new me("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");Fn.octDecodeInRange(y[0],y[1],65535,r),Fn.octDecodeInRange(f[0],f[1],65535,s),p=!0}else t?(Xt.eastNorthUpToFixedFrame(o,oe.WGS84,d),A.getMatrix3(d,c)):q.clone(q.IDENTITY,c)}p&&(h.cross(s,r,a),h.normalize(a,a),q.setColumn(c,0,s,c),q.setColumn(c,1,r,c),q.setColumn(c,2,a,c)),Me.fromRotationMatrix(c,i)}function KAe(e,t,n){n=h.fromElements(1,1,1,n);let i=e.getProperty("SCALE",Q.FLOAT,1,t);l(i)&&h.multiplyByScalar(n,i,n);let o=e.getProperty("SCALE_NON_UNIFORM",Q.FLOAT,3,t,UY);l(o)&&(n.x*=o[0],n.y*=o[1],n.z*=o[2])}function zAe(e){let t=e._buffers,n=t.length;for(let i=0;i<n;i++){let o=t[i];o.isDestroyed()||o.destroy()}t.length=0}Jp.prototype.isUnloaded=function(){return this._state===zp.UNLOADED};Jp.prototype.unload=function(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),zAe(this),this._components=void 0,this._arrayBuffer=void 0,this._state=zp.UNLOADED};var MI=Jp;var npn=T(S(),1);var Hfn=T(S(),1);var Mhn=T(S(),1),JAe={STOPPED:0,ANIMATING:1},Nm=Object.freeze(JAe);var Afn=T(S(),1);var zhn=T(S(),1);var Yhn=T(S(),1);function gC(){this.times=void 0,this.points=void 0,fe.throwInstantiationError()}gC.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof h)return h;if(e instanceof Me)return Me};gC.prototype.evaluate=fe.throwInstantiationError;gC.prototype.findTimeInterval=function(e,t){let n=this.times,i=n.length;if(t=g(t,0),e>=n[t]){if(t+1<i&&e<n[t+1])return t;if(t+2<i&&e<n[t+2])return t+1}else if(t-1>=0&&e>=n[t-1])return t-1;let o;if(e>n[t])for(o=t;o<i-1&&!(e>=n[o]&&e<n[o+1]);++o);else for(o=t-1;o>=0&&!(e>=n[o]&&e<n[o+1]);--o);return o===i-1&&(o=i-2),o};gC.prototype.wrapTime=function(e){let t=this.times,n=t[t.length-1],i=t[0],o=n-i,r;return e<i&&(r=Math.floor((i-e)/o)+1,e+=r*o),e>n&&(r=Math.floor((e-n)/o)+1,e-=r*o),e};gC.prototype.clampTime=function(e){let t=this.times;return W.clamp(e,t[0],t[t.length-1])};var lo=gC;function xC(e){this._value=e,this._valueType=lo.getPointType(e)}Object.defineProperties(xC.prototype,{value:{get:function(){return this._value}}});xC.prototype.findTimeInterval=function(e){};xC.prototype.wrapTime=function(e){return 0};xC.prototype.clampTime=function(e){return 0};xC.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var NI=xC;var hfn=T(S(),1);var efn=T(S(),1);function _C(e){e=g(e,g.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=lo.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(_C.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});_C.prototype.findTimeInterval=lo.prototype.findTimeInterval;_C.prototype.wrapTime=lo.prototype.wrapTime;_C.prototype.clampTime=lo.prototype.clampTime;_C.prototype.evaluate=function(e,t){let n=this.points,i=this.times,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),r=(e-i[o])/(i[o+1]-i[o]);return this._pointType===Number?(1-r)*n[o]+r*n[o+1]:(l(t)||(t=new h),h.lerp(n[o],n[o+1],r,t))};var qb=_C;var ifn=T(S(),1);var soe={};soe.solve=function(e,t,n,i){let o=new Array(n.length),r=new Array(i.length),s=new Array(i.length),a;for(a=0;a<r.length;a++)r[a]=new h,s[a]=new h;o[0]=n[0]/t[0],r[0]=h.multiplyByScalar(i[0],1/t[0],r[0]);let c;for(a=1;a<o.length;++a)c=1/(t[a]-o[a-1]*e[a-1]),o[a]=n[a]*c,r[a]=h.subtract(i[a],h.multiplyByScalar(r[a-1],e[a-1],r[a]),r[a]),r[a]=h.multiplyByScalar(r[a],c,r[a]);for(c=1/(t[a]-o[a-1]*e[a-1]),r[a]=h.subtract(i[a],h.multiplyByScalar(r[a-1],e[a-1],r[a]),r[a]),r[a]=h.multiplyByScalar(r[a],c,r[a]),s[s.length-1]=r[r.length-1],a=s.length-2;a>=0;--a)s[a]=h.subtract(r[a],h.multiplyByScalar(s[a+1],o[a],s[a]),s[a]);return s};var TC=soe;var aoe=[],coe=[],loe=[],doe=[];function QAe(e,t,n){let i=aoe,o=loe,r=coe,s=doe;i.length=o.length=e.length-1,r.length=s.length=e.length;let a;i[0]=r[0]=1,o[0]=0;let c=s[0];for(l(c)||(c=s[0]=new h),h.clone(t,c),a=1;a<i.length-1;++a)i[a]=o[a]=1,r[a]=4,c=s[a],l(c)||(c=s[a]=new h),h.subtract(e[a+1],e[a-1],c),h.multiplyByScalar(c,3,c);return i[a]=0,o[a]=1,r[a]=4,c=s[a],l(c)||(c=s[a]=new h),h.subtract(e[a+1],e[a-1],c),h.multiplyByScalar(c,3,c),r[a+1]=1,c=s[a+1],l(c)||(c=s[a+1]=new h),h.clone(n,c),TC.solve(i,r,o,s)}function jAe(e){let t=aoe,n=loe,i=coe,o=doe;t.length=n.length=e.length-1,i.length=o.length=e.length;let r;t[0]=n[0]=1,i[0]=2;let s=o[0];for(l(s)||(s=o[0]=new h),h.subtract(e[1],e[0],s),h.multiplyByScalar(s,3,s),r=1;r<t.length;++r)t[r]=n[r]=1,i[r]=4,s=o[r],l(s)||(s=o[r]=new h),h.subtract(e[r+1],e[r-1],s),h.multiplyByScalar(s,3,s);return i[r]=2,s=o[r],l(s)||(s=o[r]=new h),h.subtract(e[r],e[r-1],s),h.multiplyByScalar(s,3,s),TC.solve(t,i,n,o)}function Xl(e){e=g(e,g.EMPTY_OBJECT);let t=e.points,n=e.times,i=e.inTangents,o=e.outTangents;this._times=n,this._points=t,this._pointType=lo.getPointType(t[0]),this._inTangents=i,this._outTangents=o,this._lastTimeIndex=0}Object.defineProperties(Xl.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}}});Xl.createC1=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.times,n=e.points,i=e.tangents,o=i.slice(0,i.length-1),r=i.slice(1,i.length);return new Xl({times:t,points:n,inTangents:r,outTangents:o})};Xl.createNaturalCubic=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.times,n=e.points;if(n.length<3)return new qb({points:n,times:t});let i=jAe(n),o=i.slice(0,i.length-1),r=i.slice(1,i.length);return new Xl({times:t,points:n,inTangents:r,outTangents:o})};Xl.createClampedCubic=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.times,n=e.points,i=e.firstTangent,o=e.lastTangent,r=lo.getPointType(n[0]);if(n.length<3)return new qb({points:n,times:t});let s=QAe(n,i,o),a=s.slice(0,s.length-1),c=s.slice(1,s.length);return new Xl({times:t,points:n,inTangents:c,outTangents:a})};Xl.hermiteCoefficientMatrix=new A(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);Xl.prototype.findTimeInterval=lo.prototype.findTimeInterval;var qAe=new se,SC=new h;Xl.prototype.wrapTime=lo.prototype.wrapTime;Xl.prototype.clampTime=lo.prototype.clampTime;Xl.prototype.evaluate=function(e,t){let n=this.points,i=this.times,o=this.inTangents,r=this.outTangents;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let s=this._lastTimeIndex,a=i[s+1]-i[s],c=(e-i[s])/a,d=qAe;d.z=c,d.y=c*c,d.x=d.y*c,d.w=1;let u=A.multiplyByVector(Xl.hermiteCoefficientMatrix,d,d);u.z*=a,u.w*=a;let m=this._pointType;return m===Number?n[s]*u.x+n[s+1]*u.y+r[s]*u.z+o[s]*u.w:(l(t)||(t=new m),t=m.multiplyByScalar(n[s],u.x,t),m.multiplyByScalar(n[s+1],u.y,SC),m.add(t,SC,t),m.multiplyByScalar(r[s],u.z,SC),m.add(t,SC,t),m.multiplyByScalar(o[s],u.w,SC),m.add(t,SC,t))};var $b=Xl;var gfn=T(S(),1);function CC(e){e=g(e,g.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=lo.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(CC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});CC.prototype.findTimeInterval=lo.prototype.findTimeInterval;CC.prototype.wrapTime=lo.prototype.wrapTime;CC.prototype.clampTime=lo.prototype.clampTime;CC.prototype.evaluate=function(e,t){let n=this.points;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let i=this._lastTimeIndex,o=this._pointType;return o===Number?n[i]:(l(t)||(t=new o),o.clone(n[i],t))};var UI=CC;var Vfn=T(S(),1);function $Ae(e){let t=e.points,n=e.times;return function(i,o){l(o)||(o=new Me);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=t[r],c=t[r+1];return Me.fastSlerp(a,c,s,o)}}function VC(e){e=g(e,g.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._evaluateFunction=$Ae(this),this._lastTimeIndex=0}Object.defineProperties(VC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});VC.prototype.findTimeInterval=lo.prototype.findTimeInterval;VC.prototype.wrapTime=lo.prototype.wrapTime;VC.prototype.clampTime=lo.prototype.clampTime;VC.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var kI=VC;var LC=Mt.AnimatedPropertyType;function kY(e){e=g(e,g.EMPTY_OBJECT);let t=e.channel,n=e.runtimeAnimation,i=e.runtimeNode;this._channel=t,this._runtimeAnimation=n,this._runtimeNode=i,this._splines=[],this._path=void 0,oMe(this)}Object.defineProperties(kY.prototype,{channel:{get:function(){return this._channel}},runtimeAnimation:{get:function(){return this._runtimeAnimation}},runtimeNode:{get:function(){return this._runtimeNode}},splines:{get:function(){return this._splines}}});function eMe(e,t){let n=[],i=[],o=[],r=t.length;for(let s=0;s<r;s+=3)i.push(t[s]),n.push(t[s+1]),o.push(t[s+2]);return i.splice(0,1),o.length=o.length-1,new $b({times:e,points:n,inTangents:i,outTangents:o})}function uoe(e,t,n,i){if(e.length===1&&t.length===1)return new NI(t[0]);switch(n){case wm.STEP:return new UI({times:e,points:t});case wm.CUBICSPLINE:return eMe(e,t);case wm.LINEAR:return i===LC.ROTATION?new kI({times:e,points:t}):new qb({times:e,points:t})}}function tMe(e,t,n,i,o){let r=[];if(i===LC.WEIGHTS){let a=t.length/o,c,d;for(c=0;c<o;c++){let u=new Array(a),m=c;if(n===wm.CUBICSPLINE)for(d=0;d<a;d+=3)u[d]=t[m],u[d+1]=t[m+o],u[d+2]=t[m+2*o],m+=o*3;else for(d=0;d<a;d++)u[d]=t[m],m+=o;r.push(uoe(e,u,n,i))}}else r.push(uoe(e,t,n,i));return r}var nMe=new h,iMe=new Me;function oMe(e){let t=e._channel,n=t.sampler,i=n.input,o=n.output,r=n.interpolation,a=t.target.path,c=e._runtimeNode,d=l(c.morphWeights)?c.morphWeights.length:1,u=tMe(i,o,r,a,d);e._splines=u,e._path=a}kY.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,o=this._runtimeNode;if(n===LC.WEIGHTS){let r=o.morphWeights,s=r.length;for(let a=0;a<s;a++){let c=t[a],d=i.clampAnimations?c.clampTime(e):c.wrapTime(e);r[a]=c.evaluate(d)}}else{if(o.userAnimated)return;{let r=t[0],s=i.clampAnimations?r.clampTime(e):r.wrapTime(e);n===LC.TRANSLATION||n===LC.SCALE?o[n]=r.evaluate(s,nMe):n===LC.ROTATION&&(o[n]=r.evaluate(s,iMe))}}};var DI=kY;function DY(e,t,n){this._animation=t,this._name=t.name,this._runtimeChannels=void 0,this._startTime=te.clone(n.startTime),this._delay=g(n.delay,0),this._stopTime=te.clone(n.stopTime),this.removeOnStop=g(n.removeOnStop,!1),this._multiplier=g(n.multiplier,1),this._reverse=g(n.reverse,!1),this._loop=g(n.loop,El.NONE),this._animationTime=n.animationTime,this._prevAnimationDelta=void 0,this.start=new ye,this.update=new ye,this.stop=new ye,this._state=Nm.STOPPED,this._computedStartTime=void 0,this._duration=void 0;let i=this;this._raiseStartEvent=function(){i.start.raiseEvent(e,i)},this._updateEventTime=0,this._raiseUpdateEvent=function(){i.update.raiseEvent(e,i,i._updateEventTime)},this._raiseStopEvent=function(){i.stop.raiseEvent(e,i)},this._model=e,this._localStartTime=void 0,this._localStopTime=void 0,rMe(this)}Object.defineProperties(DY.prototype,{animation:{get:function(){return this._animation}},name:{get:function(){return this._name}},runtimeChannels:{get:function(){return this._runtimeChannels}},model:{get:function(){return this._model}},localStartTime:{get:function(){return this._localStartTime}},localStopTime:{get:function(){return this._localStopTime}},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}},animationTime:{get:function(){return this._animationTime}}});function rMe(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE,i=e._model.sceneGraph,r=e._animation.channels,s=r.length,a=[];for(let c=0;c<s;c++){let d=r[c],u=d.target;if(!l(u))continue;let m=u.node.index,p=i._runtimeNodes[m],y=new DI({channel:d,runtimeAnimation:e,runtimeNode:p}),f=d.sampler.input;t=Math.min(t,f[0]),n=Math.max(n,f[f.length-1]),a.push(y)}e._runtimeChannels=a,e._localStartTime=t,e._localStopTime=n}DY.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var BI=DY;function Qp(e){this.animationAdded=new ye,this.animationRemoved=new ye,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(Qp.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function BY(e,t,n){let i=e._model,o=new BI(i,t,n);return e._runtimeAnimations.push(o),e.animationAdded.raiseEvent(i,o),o}Qp.prototype.add=function(e){e=g(e,g.EMPTY_OBJECT);let n=this._model.sceneGraph.components.animations,i=e.index;if(l(i))return BY(this,n[i],e);let o=n.length;for(let r=0;r<o;++r)if(n[r].name===e.name){i=r;break}return BY(this,n[i],e)};Qp.prototype.addAll=function(e){e=g(e,g.EMPTY_OBJECT);let n=this._model.sceneGraph.components.animations,i=[],o=n.length;for(let r=0;r<o;++r){let s=BY(this,n[r],e);i.push(s)}return i};Qp.prototype.remove=function(e){if(!l(e))return!1;let t=this._runtimeAnimations,n=t.indexOf(e);return n!==-1?(t.splice(n,1),this.animationRemoved.raiseEvent(this._model,e),!0):!1};Qp.prototype.removeAll=function(){let e=this._model,t=this._runtimeAnimations,n=t.length;this._runtimeAnimations.length=0;for(let i=0;i<n;++i)this.animationRemoved.raiseEvent(e,t[i])};Qp.prototype.contains=function(e){return l(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};Qp.prototype.get=function(e){return this._runtimeAnimations[e]};var kN=[];function sMe(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}Qp.prototype.update=function(e){let t=this._runtimeAnimations,n=t.length;if(n===0)return this._previousTime=void 0,!1;if(!this.animateWhilePaused&&te.equals(e.time,this._previousTime))return!1;this._previousTime=te.clone(e.time,this._previousTime);let i=!1,o=e.time,r=this._model;for(let s=0;s<n;++s){let a=t[s];l(a._computedStartTime)||(a._computedStartTime=te.addSeconds(g(a.startTime,o),a.delay,new te)),l(a._duration)||(a._duration=a.localStopTime*(1/a.multiplier));let c=a._computedStartTime,d=a._duration,u=a.stopTime,m=te.lessThanOrEquals(c,o),p=l(u)&&te.greaterThan(o,u),y=0;if(d!==0){let _=te.secondsDifference(p?u:o,c);y=l(a._animationTime)?a._animationTime(d,_):_/d}let f=a.loop===El.REPEAT||a.loop===El.MIRRORED_REPEAT,x=(m||f&&!l(a.startTime))&&(y<=1||f)&&!p;if(y===a._prevAnimationDelta){let _=a._state===Nm.STOPPED;if(x!==_)continue}if(a._prevAnimationDelta=y,x||a._state===Nm.ANIMATING){if(x&&a._state===Nm.STOPPED&&(a._state=Nm.ANIMATING,a.start.numberOfListeners>0&&e.afterRender.push(a._raiseStartEvent)),a.loop===El.REPEAT)y=y-Math.floor(y);else if(a.loop===El.MIRRORED_REPEAT){let C=Math.floor(y),V=y-C;y=C%2===1?1-V:V}a.reverse&&(y=1-y);let _=y*d*a.multiplier;_=W.clamp(_,a.localStartTime,a.localStopTime),a.animate(_),a.update.numberOfListeners>0&&(a._updateEventTime=_,e.afterRender.push(a._raiseUpdateEvent)),i=!0,x||(a._state=Nm.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&kN.push(a))}}n=kN.length;for(let s=0;s<n;++s){let a=kN[s];t.splice(t.indexOf(a),1),e.afterRender.push(sMe(this,r,a))}return kN.length=0,i};var OI=Qp;var Tpn=T(S(),1);var spn=T(S(),1);function t_(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties(t_.prototype,{show:{get:function(){return this._featureTable.getShow(this._featureId)},set:function(e){this._featureTable.setShow(this._featureId,e)}},color:{get:function(){return l(this._color)||(this._color=new O),this._featureTable.getColor(this._featureId,this._color)},set:function(e){this._featureTable.setColor(this._featureId,e)}},primitive:{get:function(){return this._model}},featureTable:{get:function(){return this._featureTable}},featureId:{get:function(){return this._featureId}}});t_.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)};t_.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)};t_.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)};t_.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)};t_.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};var YI=t_;var cpn=T(S(),1),HI={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};HI.getStyleCommandsNeeded=function(e,t){return t===0?HI.ALL_OPAQUE:t===e?HI.ALL_TRANSLUCENT:HI.OPAQUE_AND_TRANSLUCENT};var Um=Object.freeze(HI);var dpn=T(S(),1);var ey={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};ey.is3DTiles=function(e){switch(e){case ey.TILE_GLTF:case ey.TILE_B3DM:case ey.TILE_I3DM:case ey.TILE_PNTS:case ey.TILE_GEOJSON:return!0;case ey.GLTF:return!1}};var cr=Object.freeze(ey);function Rr(e){let t=e.model,n=e.propertyTable;this._propertyTable=n,this._model=t,this._features=void 0,this._featuresLength=0,this._batchTexture=void 0,this._styleCommandsNeededDirty=!1,this._styleCommandsNeeded=Um.ALL_OPAQUE,aMe(this)}Object.defineProperties(Rr.prototype,{batchTexture:{get:function(){return this._batchTexture}},featuresLength:{get:function(){return this._featuresLength}},batchTextureByteLength:{get:function(){return l(this._batchTexture)?this._batchTexture.byteLength:0}},styleCommandsNeededDirty:{get:function(){return this._styleCommandsNeededDirty}}});function aMe(e){let t=e._model,n=cr.is3DTiles(t.type),i=e._propertyTable.count;if(i===0)return;let o,r=new Array(i);if(n){let s=t.content;for(o=0;o<i;o++)r[o]=new vs(s,o)}else for(o=0;o<i;o++)r[o]=new YI({model:t,featureId:o,featureTable:e});e._features=r,e._featuresLength=i,e._batchTexture=new Nc({featuresLength:i,owner:e,statistics:n?t.content.tileset.statistics:void 0})}Rr.prototype.update=function(e){this._styleCommandsNeededDirty=!1,this._batchTexture.update(void 0,e);let t=Um.getStyleCommandsNeeded(this._featuresLength,this._batchTexture.translucentFeaturesLength);this._styleCommandsNeeded!==t&&(this._styleCommandsNeededDirty=!0,this._styleCommandsNeeded=t)};Rr.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};Rr.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};Rr.prototype.getShow=function(e){return this._batchTexture.getShow(e)};Rr.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};Rr.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};Rr.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};Rr.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};Rr.prototype.getFeature=function(e){return this._features[e]};Rr.prototype.hasProperty=function(e,t){return this._propertyTable.hasProperty(e,t)};Rr.prototype.hasPropertyBySemantic=function(e,t){return this._propertyTable.hasPropertyBySemantic(e,t)};Rr.prototype.getProperty=function(e,t){return this._propertyTable.getProperty(e,t)};Rr.prototype.getPropertyBySemantic=function(e,t){return this._propertyTable.getPropertyBySemantic(e,t)};Rr.prototype.getPropertyIds=function(e){return this._propertyTable.getPropertyIds(e)};Rr.prototype.setProperty=function(e,t,n){return this._propertyTable.setProperty(e,t,n)};Rr.prototype.isClass=function(e,t){return this._propertyTable.isClass(e,t)};Rr.prototype.isExactClass=function(e,t){return this._propertyTable.isExactClass(e,t)};Rr.prototype.getExactClassName=function(e){return this._propertyTable.getExactClassName(e)};var cMe=new O;Rr.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(Nc.DEFAULT_COLOR_VALUE),this.setAllShow(Nc.DEFAULT_SHOW_VALUE);return}for(let t=0;t<this._featuresLength;t++){let n=this.getFeature(t),i=l(e.color)?g(e.color.evaluateColor(n,cMe),Nc.DEFAULT_COLOR_VALUE):Nc.DEFAULT_COLOR_VALUE,o=l(e.show)?g(e.show.evaluate(n),Nc.DEFAULT_SHOW_VALUE):Nc.DEFAULT_SHOW_VALUE;this.setColor(t,i),this.setShow(t,o)}};Rr.prototype.isDestroyed=function(){return!1};Rr.prototype.destroy=function(e){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),ue(this)};var KI=Rr;var g1n=T(S(),1);var S0n=T(S(),1);var Cpn=T(S(),1),zI=`czm_modelMaterial defaultModelMaterial()
{
czm_modelMaterial material;
material.diffuse = vec3(0.0);
material.specular = vec3(1.0);
material.roughness = 1.0;
material.occlusion = 1.0;
material.normalEC = vec3(0.0, 0.0, 1.0);
material.emissive = vec3(0.0);
material.alpha = 1.0;
return material;
}
vec4 handleAlpha(vec3 color, float alpha)
{
#ifdef ALPHA_MODE_MASK
if (alpha < u_alphaCutoff) {
discard;
}
#endif
return vec4(color, alpha);
}
SelectedFeature selectedFeature;
void main()
{
#ifdef HAS_MODEL_SPLITTER
modelSplitterStage();
#endif
czm_modelMaterial material = defaultModelMaterial();
ProcessedAttributes attributes;
geometryStage(attributes);
FeatureIds featureIds;
featureIdStage(featureIds, attributes);
Metadata metadata;
MetadataClass metadataClass;
MetadataStatistics metadataStatistics;
metadataStage(metadata, metadataClass, metadataStatistics, attributes);
#ifdef HAS_SELECTED_FEATURE_ID
selectedFeatureIdStage(selectedFeature, featureIds);
#endif
#ifndef CUSTOM_SHADER_REPLACE_MATERIAL
materialStage(material, attributes, selectedFeature);
#endif
#ifdef HAS_CUSTOM_FRAGMENT_SHADER
customShaderStage(material, attributes, featureIds, metadata, metadataClass, metadataStatistics);
#endif
lightingStage(material, attributes);
#ifdef HAS_SELECTED_FEATURE_ID
cpuStylingStage(material, selectedFeature);
#endif
#ifdef HAS_MODEL_COLOR
modelColorStage(material);
#endif
#ifdef HAS_PRIMITIVE_OUTLINE
primitiveOutlineStage(material);
#endif
vec4 color = handleAlpha(material.diffuse, material.alpha);
#ifdef HAS_CLIPPING_PLANES
modelClippingPlanesStage(color);
#endif
#if defined(HAS_SILHOUETTE) && defined(HAS_NORMALS)
silhouetteStage(color);
#endif
#ifdef HAS_ATMOSPHERE
atmosphereStage(color, attributes);
#endif
out_FragColor = color;
}
`;var Lpn=T(S(),1),JI=`precision highp float;
czm_modelVertexOutput defaultVertexOutput(vec3 positionMC) {
czm_modelVertexOutput vsOutput;
vsOutput.positionMC = positionMC;
vsOutput.pointSize = 1.0;
return vsOutput;
}
void main()
{
// Initialize the attributes struct with all
// attributes except quantized ones.
ProcessedAttributes attributes;
initializeAttributes(attributes);
// Dequantize the quantized ones and add them to the
// attributes struct.
#ifdef USE_DEQUANTIZATION
dequantizationStage(attributes);
#endif
#ifdef HAS_MORPH_TARGETS
morphTargetsStage(attributes);
#endif
#ifdef HAS_SKINNING
skinningStage(attributes);
#endif
#ifdef HAS_PRIMITIVE_OUTLINE
primitiveOutlineStage();
#endif
// Compute the bitangent according to the formula in the glTF spec.
// Normal and tangents can be affected by morphing and skinning, so
// the bitangent should not be computed until their values are finalized.
#ifdef HAS_BITANGENTS
attributes.bitangentMC = normalize(cross(attributes.normalMC, attributes.tangentMC) * attributes.tangentSignMC);
#endif
FeatureIds featureIds;
featureIdStage(featureIds, attributes);
#ifdef HAS_SELECTED_FEATURE_ID
SelectedFeature feature;
selectedFeatureIdStage(feature, featureIds);
// Handle any show properties that come from the style.
cpuStylingStage(attributes.positionMC, feature);
#endif
#if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING)
// The scene mode 2D pipeline stage and instancing stage add a different
// model view matrix to accurately project the model to 2D. However, the
// output positions and normals should be transformed by the 3D matrices
// to keep the data the same for the fragment shader.
mat4 modelView = czm_modelView3D;
mat3 normal = czm_normal3D;
#else
// These are used for individual model projection because they will
// automatically change based on the scene mode.
mat4 modelView = czm_modelView;
mat3 normal = czm_normal;
#endif
// Update the position for this instance in place
#ifdef HAS_INSTANCING
// The legacy instance stage is used when rendering i3dm models that
// encode instances transforms in world space, as opposed to glTF models
// that use EXT_mesh_gpu_instancing, where instance transforms are encoded
// in object space.
#ifdef USE_LEGACY_INSTANCING
mat4 instanceModelView;
mat3 instanceModelViewInverseTranspose;
legacyInstancingStage(attributes, instanceModelView, instanceModelViewInverseTranspose);
modelView = instanceModelView;
normal = instanceModelViewInverseTranspose;
#else
instancingStage(attributes);
#endif
#ifdef USE_PICKING
v_pickColor = a_pickColor;
#endif
#endif
Metadata metadata;
MetadataClass metadataClass;
MetadataStatistics metadataStatistics;
metadataStage(metadata, metadataClass, metadataStatistics, attributes);
#ifdef HAS_VERTICAL_EXAGGERATION
verticalExaggerationStage(attributes);
#endif
#ifdef HAS_CUSTOM_VERTEX_SHADER
czm_modelVertexOutput vsOutput = defaultVertexOutput(attributes.positionMC);
customShaderStage(vsOutput, attributes, featureIds, metadata, metadataClass, metadataStatistics);
#endif
// Compute the final position in each coordinate system needed.
// This returns the value that will be assigned to gl_Position.
vec4 positionClip = geometryStage(attributes, modelView, normal);
// This must go after the geometry stage as it needs v_positionWC
#ifdef HAS_ATMOSPHERE
atmosphereStage(attributes);
#endif
#ifdef HAS_SILHOUETTE
silhouetteStage(attributes, positionClip);
#endif
#ifdef HAS_POINT_CLOUD_SHOW_STYLE
float show = pointCloudShowStylingStage(attributes, metadata);
#else
float show = 1.0;
#endif
#ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING
show *= pointCloudBackFaceCullingStage();
#endif
#ifdef HAS_POINT_CLOUD_COLOR_STYLE
v_pointCloudColor = pointCloudColorStylingStage(attributes, metadata);
#endif
#ifdef PRIMITIVE_TYPE_POINTS
#ifdef HAS_CUSTOM_VERTEX_SHADER
gl_PointSize = vsOutput.pointSize;
#elif defined(HAS_POINT_CLOUD_POINT_SIZE_STYLE) || defined(HAS_POINT_CLOUD_ATTENUATION)
gl_PointSize = pointCloudPointSizeStylingStage(attributes, metadata);
#else
gl_PointSize = 1.0;
#endif
gl_PointSize *= show;
#endif
gl_Position = show * positionClip;
}
`;var Npn=T(S(),1);function YY(e){e=g(e,g.EMPTY_OBJECT);let t=e.command,n=e.primitiveRenderResources,i=n.model;this._command=t,this._model=i,this._runtimePrimitive=n.runtimePrimitive,this._modelMatrix=t.modelMatrix,this._boundingVolume=t.boundingVolume,this._cullFace=t.renderState.cull.face;let o=i.classificationType;this._classificationType=o,this._classifiesTerrain=o!==Bn.CESIUM_3D_TILE,this._classifies3DTiles=o!==Bn.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],mMe(this)}function lMe(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:pt.KEEP,zFail:pt.DECREMENT_WRAP,zPass:pt.KEEP},backFunction:e,backOperation:{fail:pt.KEEP,zFail:pt.INCREMENT_WRAP,zPass:pt.KEEP},reference:Nt.CESIUM_3D_TILE_MASK,mask:Nt.CESIUM_3D_TILE_MASK},stencilMask:Nt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:ja.LESS_OR_EQUAL},depthMask:!1}}var dMe={stencilTest:{enabled:!0,frontFunction:On.NOT_EQUAL,frontOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},backFunction:On.NOT_EQUAL,backOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},reference:0,mask:Nt.CLASSIFICATION_MASK},stencilMask:Nt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:mn.PRE_MULTIPLIED_ALPHA_BLEND},uMe={stencilTest:{enabled:!0,frontFunction:On.NOT_EQUAL,frontOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},backFunction:On.NOT_EQUAL,backOperation:{fail:pt.ZERO,zFail:pt.ZERO,zPass:pt.ZERO},reference:0,mask:Nt.CLASSIFICATION_MASK},stencilMask:Nt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},foe=[];function mMe(e){let t=e._command,n=foe;if(e._useDebugWireframe){t.pass=Ve.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=QI(e,n,e._commandListDebugWireframe);let r=e._commandListDebugWireframe,s=r.length;for(let a=0;a<s;a++){let c=r[a];c.count*=2,c.offset*=2}return}let o=e.model.allowPicking;if(e._classifiesTerrain){let r=Ve.TERRAIN_CLASSIFICATION,s=OY(t,r),a=moe(t,r);n.length=0,n.push(s,a),e._commandListTerrain=QI(e,n,e._commandListTerrain),o&&(e._commandListTerrainPicking=hoe(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let r=Ve.CESIUM_3D_TILE_CLASSIFICATION,s=OY(t,r),a=moe(t,r);n.length=0,n.push(s,a),e._commandList3DTiles=QI(e,n,e._commandList3DTiles),o&&(e._commandList3DTilesPicking=hoe(e,n,e._commandList3DTilesPicking))}}function QI(e,t,n){let i=e._runtimePrimitive,o=i.batchLengths,r=i.batchOffsets,s=o.length,a=t.length;for(let c=0;c<s;c++){let d=o[c],u=r[c];for(let m=0;m<a;m++){let p=t[m],y=nt.shallowClone(p);y.count=d,y.offset=u,n.push(y)}}return n}function OY(e,t){let n=nt.shallowClone(e);n.cull=!1,n.pass=t;let i=t===Ve.TERRAIN_CLASSIFICATION?On.ALWAYS:On.EQUAL,o=lMe(i);return n.renderState=ke.fromCache(o),n}function moe(e,t){let n=nt.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=ke.fromCache(dMe),n}var hMe=[];function hoe(e,t,n){let i=ke.fromCache(uMe),o=t[0],r=t[1],s=nt.shallowClone(o);s.cull=!0,s.pickOnly=!0;let a=nt.shallowClone(r);a.cull=!0,a.pickOnly=!0,a.renderState=i,a.pickId=e._pickId;let c=hMe;return c.length=0,c.push(s,a),QI(e,c,n)}Object.defineProperties(YY.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},batchLengths:{get:function(){return this._runtimePrimitive.batchLengths}},batchOffsets:{get:function(){return this._runtimePrimitive.batchOffsets}},model:{get:function(){return this._model}},classificationType:{get:function(){return this._classificationType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=A.clone(e,this._modelMatrix);let t=this._runtimePrimitive.boundingSphere;this._boundingVolume=ce.transform(t,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace=e}}});YY.prototype.pushCommands=function(e,t){let n=e.passes;if(n.render){if(this._useDebugWireframe){t.push.apply(t,this._commandListDebugWireframe);return}if(this._classifiesTerrain&&t.push.apply(t,this._commandListTerrain),this._classifies3DTiles&&t.push.apply(t,this._commandList3DTiles),e.invertClassification&&this._classifies3DTiles){if(this._commandListIgnoreShow.length===0){let o=Ve.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,r=OY(this._command,o),s=foe;s.length=0,s.push(r),this._commandListIgnoreShow=QI(this,s,this._commandListIgnoreShow)}t.push.apply(t,this._commandListIgnoreShow)}}return n.pick&&(this._classifiesTerrain&&t.push.apply(t,this._commandListTerrainPicking),this._classifies3DTiles&&t.push.apply(t,this._commandList3DTilesPicking)),t};var jI=YY;var s0n=T(S(),1);function DN(e){e=g(e,g.EMPTY_OBJECT);let t=e.command,n=e.primitiveRenderResources,i=n.model;this._model=i;let o=n.runtimePrimitive;this._runtimePrimitive=o;let r=t.pass===Ve.TRANSLUCENT,a=!o.primitive.material.doubleSided&&!r,c=n.hasSilhouette,d=!r&&!c,u=n.hasSkipLevelOfDetail&&!r,m=c;this._command=t,this._modelMatrix=A.clone(t.modelMatrix),this._boundingVolume=ce.clone(t.boundingVolume),this._modelMatrix2D=new A,this._boundingVolume2D=new ce,this._modelMatrix2DDirty=!1,this._backFaceCulling=t.renderState.cull.enabled,this._cullFace=t.renderState.cull.face,this._shadows=i.shadows,this._debugShowBoundingVolume=t.debugShowBoundingVolume,this._usesBackFaceCulling=a,this._needsTranslucentCommand=d,this._needsSkipLevelOfDetailCommands=u,this._needsSilhouetteCommands=m,this._originalCommand=void 0,this._translucentCommand=void 0,this._skipLodBackfaceCommand=void 0,this._skipLodStencilCommand=void 0,this._silhouetteModelCommand=void 0,this._silhouetteColorCommand=void 0,this._derivedCommands=[],this._has2DCommands=!1,fMe(this)}function jp(e){this.command=e.command,this.updateShadows=e.updateShadows,this.updateBackFaceCulling=e.updateBackFaceCulling,this.updateCullFace=e.updateCullFace,this.updateDebugShowBoundingVolume=e.updateDebugShowBoundingVolume,this.is2D=g(e.is2D,!1),this.derivedCommand2D=void 0}jp.clone=function(e){return new jp({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function fMe(e){let t=e._command;t.modelMatrix=e._modelMatrix,t.boundingVolume=e._boundingVolume;let n=e._model,i=e._usesBackFaceCulling,o=e._derivedCommands;e._originalCommand=new jp({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),o.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new jp({command:TMe(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),o.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new jp({command:ZMe(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new jp({command:GMe(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),o.push(e._skipLodBackfaceCommand),o.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new jp({command:SMe(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new jp({command:CMe(t,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._silhouetteModelCommand),o.push(e._silhouetteColorCommand))}Object.defineProperties(DN.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},model:{get:function(){return this._model}},primitiveType:{get:function(){return this._command.primitiveType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=A.clone(e,this._modelMatrix),this._modelMatrix2DDirty=!0,this._boundingVolume=ce.transform(this.runtimePrimitive.boundingSphere,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},shadows:{get:function(){return this._shadows},set:function(e){this._shadows=e,bMe(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,yMe(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,gMe(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,xMe(this))}}});function pMe(e,t){let n=e._modelMatrix;e._modelMatrix2D=A.clone(n,e._modelMatrix2D),e._modelMatrix2D[13]-=W.sign(n[13])*2*W.PI*t.mapProjection.ellipsoid.maximumRadius,e._boundingVolume2D=ce.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function bMe(e){let t=e.shadows,n=Cn.castShadows(t),i=Cn.receiveShadows(t),o=e._derivedCommands;for(let r=0;r<o.length;++r){let s=o[r];if(s.updateShadows){let a=s.command;a.castShadows=n,a.receiveShadows=i}}}function yMe(e){let t=e.backFaceCulling,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateBackFaceCulling){let r=o.command,s=ze(r.renderState,!0);s.cull.enabled=t,r.renderState=ke.fromCache(s)}}}function gMe(e){let t=e.cullFace,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateCullFace){let r=o.command,s=ze(r.renderState,!0);s.cull.face=t,r.renderState=ke.fromCache(s)}}}function xMe(e){let t=e.debugShowBoundingVolume,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateDebugShowBoundingVolume){let r=o.command;r.debugShowBoundingVolume=t}}}DN.prototype.pushCommands=function(e,t){let n=poe(this,e);n&&!this._has2DCommands&&(_Me(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(pMe(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&l(i)&&(i!==Um.ALL_OPAQUE&&ZC(t,this._translucentCommand,n),i===Um.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:o,tile:r}=this._model.content;if(o.hasMixedContent){r._finalResolution||ZC(o._backfaceCommands,this._skipLodBackfaceCommand,n),VMe(this,r,n),ZC(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){ZC(t,this._silhouetteModelCommand,n);return}return ZC(t,this._originalCommand,n),t}};DN.prototype.pushSilhouetteCommands=function(e,t){let n=poe(this,e);return ZC(t,this._silhouetteColorCommand,n),t};function ZC(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function poe(e,t){if(t.mode!==ie.SCENE2D||e.model._projectTo2D)return!1;let i=e.model.sceneGraph._boundingSphere2D,o=i.center.y-i.radius,r=i.center.y+i.radius,s=t.mapProjection.ellipsoid.maximumRadius*W.PI;return o<s&&r>s||o<-s&&r>-s}function RC(e,t){if(!l(t))return;let n=jp.clone(t),i=nt.shallowClone(t.command);return i.modelMatrix=e._modelMatrix2D,i.boundingVolume=e._boundingVolume2D,n.command=i,n.updateShadows=!1,n.is2D=!0,t.derivedCommand2D=n,e._derivedCommands.push(n),n}function _Me(e){RC(e,e._originalCommand),RC(e,e._translucentCommand),RC(e,e._skipLodBackfaceCommand),RC(e,e._skipLodStencilCommand),RC(e,e._silhouetteModelCommand),RC(e,e._silhouetteColorCommand)}function TMe(e){let t=nt.shallowClone(e);t.pass=Ve.TRANSLUCENT;let n=ze(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=mn.ALPHA_BLEND,t.renderState=ke.fromCache(n),t}function SMe(e,t){let n=t._silhouetteId%255,i=nt.shallowClone(e),o=ze(e.renderState,!0);return o.stencilTest={enabled:!0,frontFunction:ne.ALWAYS,backFunction:ne.ALWAYS,reference:n,mask:-1,frontOperation:{fail:ne.KEEP,zFail:ne.KEEP,zPass:ne.REPLACE},backOperation:{fail:ne.KEEP,zFail:ne.KEEP,zPass:ne.REPLACE}},t.isInvisible()&&(o.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=ke.fromCache(o),i}function CMe(e,t){let n=t._silhouetteId%255,i=nt.shallowClone(e),o=ze(e.renderState,!0);o.cull.enabled=!1,(e.pass===Ve.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=Ve.TRANSLUCENT,o.depthMask=!1,o.blending=mn.ALPHA_BLEND),o.stencilTest={enabled:!0,frontFunction:ne.NOTEQUAL,backFunction:ne.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:ne.KEEP,zFail:ne.KEEP,zPass:ne.KEEP},backOperation:{fail:ne.KEEP,zFail:ne.KEEP,zPass:ne.KEEP}};let s=ze(e.uniformMap);return s.model_silhouettePass=function(){return!0},i.renderState=ke.fromCache(o),i.uniformMap=s,i.castShadows=!1,i.receiveShadows=!1,i}function VMe(e,t,n){let i=e._skipLodStencilCommand,o=i.command,r=t._selectionDepth,s=LMe(o);if(r!==s){let a=RMe(r),c=ze(o.renderState,!0);c.stencilTest.reference=a,o.renderState=ke.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function LMe(e){return(e.renderState.stencilTest.reference&Nt.SKIP_LOD_MASK)>>>Nt.SKIP_LOD_BIT_SHIFT}function RMe(e){return Nt.CESIUM_3D_TILE_MASK|e<<Nt.SKIP_LOD_BIT_SHIFT}function ZMe(e){let t=nt.shallowClone(e),n=ze(e.renderState,!0);n.cull.enabled=!0,n.cull.face=yi.FRONT,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n.polygonOffset={enabled:!0,factor:5,units:5};let i=ze(t.uniformMap),o=new B(5,5);return i.u_polygonOffset=function(){return o},t.renderState=ke.fromCache(n),t.uniformMap=i,t.castShadows=!1,t.receiveShadows=!1,t}function GMe(e){let t=nt.shallowClone(e),n=ze(e.renderState,!0),{stencilTest:i}=n;return i.enabled=!0,i.mask=Nt.SKIP_LOD_MASK,i.reference=Nt.CESIUM_3D_TILE_MASK,i.frontFunction=On.GREATER_OR_EQUAL,i.frontOperation.zPass=pt.REPLACE,i.backFunction=On.GREATER_OR_EQUAL,i.backOperation.zPass=pt.REPLACE,n.stencilMask=Nt.CESIUM_3D_TILE_MASK|Nt.SKIP_LOD_MASK,t.renderState=ke.fromCache(n),t}var qI=DN;function EMe(e,t){let n=e.shaderBuilder;n.addVertexLines(JI),n.addFragmentLines(zI);let i=IMe(e),o=new oi({context:t.context,indexBuffer:i,attributes:e.attributes}),r=e.model;r._pipelineResources.push(o);let s=n.buildShaderProgram(t.context);r._pipelineResources.push(s);let a=e.alphaOptions.pass,c=r.sceneGraph,d=t.mode===ie.SCENE3D,u,m;if(!d&&!t.scene3DOnly&&r._projectTo2D)u=A.multiplyTransformation(c._computedModelMatrix,e.runtimeNode.computedTransform,new A),m=e.runtimePrimitive.boundingSphere2D;else{let V=d?c._computedModelMatrix:c._computedModelMatrix2D;u=A.multiplyTransformation(V,e.runtimeNode.computedTransform,new A),m=ce.transform(e.boundingSphere,u,e.boundingSphere)}let p=ze(ke.fromCache(e.renderStateOptions),!0);p.cull.face=qt.getCullFace(u,e.primitiveType),p=ke.fromCache(p);let y=l(r.classificationType),f=y?!1:Cn.castShadows(r.shadows),x=y?!1:Cn.receiveShadows(r.shadows),_=y?void 0:e.pickId,C=new nt({boundingVolume:m,modelMatrix:u,uniformMap:e.uniformMap,renderState:p,vertexArray:o,shaderProgram:s,cull:r.cull,pass:a,count:e.count,owner:r,pickId:_,instanceCount:e.instanceCount,primitiveType:e.primitiveType,debugShowBoundingVolume:r.debugShowBoundingVolume,castShadows:f,receiveShadows:x});return y?new jI({primitiveRenderResources:e,command:C}):new qI({primitiveRenderResources:e,command:C})}function IMe(e){let t=e.wireframeIndexBuffer;if(l(t))return t;let n=e.indices;if(l(n))return n.buffer}var $I=EMe;var I0n=T(S(),1);var V0n=T(S(),1);var n_={VERTEX:0,FRAGMENT:1,BOTH:2};n_.includesVertexShader=function(e){return e===n_.VERTEX||e===n_.BOTH};n_.includesFragmentShader=function(e){return e===n_.FRAGMENT||e===n_.BOTH};var Se=Object.freeze(n_);var boe={name:"TilesetPipelineStage"};boe.process=function(e,t,n){if(t.hasSkipLevelOfDetail(n)){e.shaderBuilder.addDefine("POLYGON_OFFSET",void 0,Se.FRAGMENT);let r={u_polygonOffset:function(){return B.ZERO}};e.uniformMap=Tt(r,e.uniformMap),e.hasSkipLevelOfDetail=!0}let i=e.renderStateOptions;i.stencilTest=Nt.setCesium3DTileBit(),i.stencilMask=Nt.CESIUM_3D_TILE_MASK};var eX=boe;var k0n=T(S(),1);var W0n=T(S(),1),tX=`// robust iterative solution without trig functions
// https://github.com/0xfaded/ellipse_demo/issues/1
// https://stackoverflow.com/questions/22959698/distance-from-given-point-to-given-ellipse
//
// This version uses only a single iteration for best performance. For fog
// rendering, the difference is negligible.
vec2 nearestPointOnEllipseFast(vec2 pos, vec2 radii) {
vec2 p = abs(pos);
vec2 inverseRadii = 1.0 / radii;
vec2 evoluteScale = (radii.x * radii.x - radii.y * radii.y) * vec2(1.0, -1.0) * inverseRadii;
// We describe the ellipse parametrically: v = radii * vec2(cos(t), sin(t))
// but store the cos and sin of t in a vec2 for efficiency.
// Initial guess: t = cos(pi/4)
vec2 tTrigs = vec2(0.70710678118);
vec2 v = radii * tTrigs;
// Find the evolute of the ellipse (center of curvature) at v.
vec2 evolute = evoluteScale * tTrigs * tTrigs * tTrigs;
// Find the (approximate) intersection of p - evolute with the ellipsoid.
vec2 q = normalize(p - evolute) * length(v - evolute);
// Update the estimate of t.
tTrigs = (q + evolute) * inverseRadii;
tTrigs = normalize(clamp(tTrigs, 0.0, 1.0));
v = radii * tTrigs;
return v * sign(pos);
}
vec3 computeEllipsoidPositionWC(vec3 positionMC) {
// Get the world-space position and project onto a meridian plane of
// the ellipsoid
vec3 positionWC = (czm_model * vec4(positionMC, 1.0)).xyz;
vec2 positionEllipse = vec2(length(positionWC.xy), positionWC.z);
vec2 nearestPoint = nearestPointOnEllipseFast(positionEllipse, czm_ellipsoidRadii.xz);
// Reconstruct a 3D point in world space
return vec3(nearestPoint.x * normalize(positionWC.xy), nearestPoint.y);
}
void applyFog(inout vec4 color, vec4 groundAtmosphereColor, vec3 lightDirection, float distanceToCamera) {
vec3 fogColor = groundAtmosphereColor.rgb;
// If there is dynamic lighting, apply that to the fog.
const float NONE = 0.0;
if (czm_atmosphereDynamicLighting != NONE) {
float darken = clamp(dot(normalize(czm_viewerPositionWC), lightDirection), czm_fogMinimumBrightness, 1.0);
fogColor *= darken;
}
// Tonemap if HDR rendering is disabled
#ifndef HDR
fogColor.rgb = czm_acesTonemapping(fogColor.rgb);
fogColor.rgb = czm_inverseGamma(fogColor.rgb);
#endif
// Matches the constant in GlobeFS.glsl. This makes the fog falloff
// more gradual.
const float fogModifier = 0.15;
vec3 withFog = czm_fog(distanceToCamera, color.rgb, fogColor, fogModifier);
color = vec4(withFog, color.a);
}
void atmosphereStage(inout vec4 color, in ProcessedAttributes attributes) {
vec3 rayleighColor;
vec3 mieColor;
float opacity;
vec3 positionWC;
vec3 lightDirection;
// When the camera is in space, compute the position per-fragment for
// more accurate ground atmosphere. All other cases will use
//
// The if condition will be added in https://github.com/CesiumGS/cesium/issues/11717
if (false) {
positionWC = computeEllipsoidPositionWC(attributes.positionMC);
lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC, czm_atmosphereDynamicLighting);
// The fog color is derived from the ground atmosphere color
czm_computeGroundAtmosphereScattering(
positionWC,
lightDirection,
rayleighColor,
mieColor,
opacity
);
} else {
positionWC = attributes.positionWC;
lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC, czm_atmosphereDynamicLighting);
rayleighColor = v_atmosphereRayleighColor;
mieColor = v_atmosphereMieColor;
opacity = v_atmosphereOpacity;
}
//color correct rayleigh and mie colors
const bool ignoreBlackPixels = true;
rayleighColor = czm_applyHSBShift(rayleighColor, czm_atmosphereHsbShift, ignoreBlackPixels);
mieColor = czm_applyHSBShift(mieColor, czm_atmosphereHsbShift, ignoreBlackPixels);
vec4 groundAtmosphereColor = czm_computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity);
if (u_isInFog) {
float distanceToCamera = length(attributes.positionEC);
applyFog(color, groundAtmosphereColor, lightDirection, distanceToCamera);
} else {
// Ground atmosphere
}
}
`;var v0n=T(S(),1),nX=`void atmosphereStage(ProcessedAttributes attributes) {
vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(v_positionWC, czm_atmosphereDynamicLighting);
czm_computeGroundAtmosphereScattering(
// This assumes the geometry stage came before this.
v_positionWC,
lightDirection,
v_atmosphereRayleighColor,
v_atmosphereMieColor,
v_atmosphereOpacity
);
}
`;var yoe={name:"AtmospherePipelineStage"};yoe.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_ATMOSPHERE",void 0,Se.BOTH),i.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,Se.BOTH),i.addVarying("vec3","v_atmosphereRayleighColor"),i.addVarying("vec3","v_atmosphereMieColor"),i.addVarying("float","v_atmosphereOpacity"),i.addVertexLines([nX]),i.addFragmentLines([tX]),i.addUniform("bool","u_isInFog",Se.FRAGMENT),e.uniformMap.u_isInFog=function(){let o=h.distance(n.camera.positionWC,t.boundingSphere.center);return W.fog(o,n.fog.density)>W.EPSILON3}};var iX=yoe;var Q0n=T(S(),1);var B0n=T(S(),1),oX=`vec3 proceduralIBL(
vec3 positionEC,
vec3 normalEC,
vec3 lightDirectionEC,
vec3 lightColorHdr,
czm_pbrParameters pbrParameters
) {
vec3 v = -positionEC;
vec3 positionWC = vec3(czm_inverseView * vec4(positionEC, 1.0));
vec3 vWC = -normalize(positionWC);
vec3 l = normalize(lightDirectionEC);
vec3 n = normalEC;
vec3 r = normalize(czm_inverseViewRotation * normalize(reflect(v, n)));
float NdotL = clamp(dot(n, l), 0.001, 1.0);
float NdotV = abs(dot(n, v)) + 0.001;
// Figure out if the reflection vector hits the ellipsoid
float vertexRadius = length(positionWC);
float horizonDotNadir = 1.0 - min(1.0, czm_ellipsoidRadii.x / vertexRadius);
float reflectionDotNadir = dot(r, normalize(positionWC));
// Flipping the X vector is a cheap way to get the inverse of czm_temeToPseudoFixed, since that's a rotation about Z.
r.x = -r.x;
r = -normalize(czm_temeToPseudoFixed * r);
r.x = -r.x;
vec3 diffuseColor = pbrParameters.diffuseColor;
float roughness = pbrParameters.roughness;
vec3 specularColor = pbrParameters.f0;
float inverseRoughness = 1.04 - roughness;
inverseRoughness *= inverseRoughness;
vec3 sceneSkyBox = czm_textureCube(czm_environmentMap, r).rgb * inverseRoughness;
float atmosphereHeight = 0.05;
float blendRegionSize = 0.1 * ((1.0 - inverseRoughness) * 8.0 + 1.1 - horizonDotNadir);
float blendRegionOffset = roughness * -1.0;
float farAboveHorizon = clamp(horizonDotNadir - blendRegionSize * 0.5 + blendRegionOffset, 1.0e-10 - blendRegionSize, 0.99999);
float aroundHorizon = clamp(horizonDotNadir + blendRegionSize * 0.5, 1.0e-10 - blendRegionSize, 0.99999);
float farBelowHorizon = clamp(horizonDotNadir + blendRegionSize * 1.5, 1.0e-10 - blendRegionSize, 0.99999);
float smoothstepHeight = smoothstep(0.0, atmosphereHeight, horizonDotNadir);
vec3 belowHorizonColor = mix(vec3(0.1, 0.15, 0.25), vec3(0.4, 0.7, 0.9), smoothstepHeight);
vec3 nadirColor = belowHorizonColor * 0.5;
vec3 aboveHorizonColor = mix(vec3(0.9, 1.0, 1.2), belowHorizonColor, roughness * 0.5);
vec3 blueSkyColor = mix(vec3(0.18, 0.26, 0.48), aboveHorizonColor, reflectionDotNadir * inverseRoughness * 0.5 + 0.75);
vec3 zenithColor = mix(blueSkyColor, sceneSkyBox, smoothstepHeight);
vec3 blueSkyDiffuseColor = vec3(0.7, 0.85, 0.9);
float diffuseIrradianceFromEarth = (1.0 - horizonDotNadir) * (reflectionDotNadir * 0.25 + 0.75) * smoothstepHeight;
float diffuseIrradianceFromSky = (1.0 - smoothstepHeight) * (1.0 - (reflectionDotNadir * 0.25 + 0.25));
vec3 diffuseIrradiance = blueSkyDiffuseColor * clamp(diffuseIrradianceFromEarth + diffuseIrradianceFromSky, 0.0, 1.0);
float notDistantRough = (1.0 - horizonDotNadir * roughness * 0.8);
vec3 specularIrradiance = mix(zenithColor, aboveHorizonColor, smoothstep(farAboveHorizon, aroundHorizon, reflectionDotNadir) * notDistantRough);
specularIrradiance = mix(specularIrradiance, belowHorizonColor, smoothstep(aroundHorizon, farBelowHorizon, reflectionDotNadir) * inverseRoughness);
specularIrradiance = mix(specularIrradiance, nadirColor, smoothstep(farBelowHorizon, 1.0, reflectionDotNadir) * inverseRoughness);
// Luminance model from page 40 of http://silviojemma.com/public/papers/lighting/spherical-harmonic-lighting.pdf
#ifdef USE_SUN_LUMINANCE
// Angle between sun and zenith
float LdotZenith = clamp(dot(normalize(czm_inverseViewRotation * l), vWC), 0.001, 1.0);
float S = acos(LdotZenith);
// Angle between zenith and current pixel
float NdotZenith = clamp(dot(normalize(czm_inverseViewRotation * n), vWC), 0.001, 1.0);
// Angle between sun and current pixel
float gamma = acos(NdotL);
float numerator = ((0.91 + 10.0 * exp(-3.0 * gamma) + 0.45 * pow(NdotL, 2.0)) * (1.0 - exp(-0.32 / NdotZenith)));
float denominator = (0.91 + 10.0 * exp(-3.0 * S) + 0.45 * pow(LdotZenith,2.0)) * (1.0 - exp(-0.32));
float luminance = model_luminanceAtZenith * (numerator / denominator);
#endif
vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg;
vec3 iblColor = (diffuseIrradiance * diffuseColor * model_iblFactor.x) + (specularIrradiance * czm_srgbToLinear(specularColor * brdfLut.x + brdfLut.y) * model_iblFactor.y);
float maximumComponent = max(max(lightColorHdr.x, lightColorHdr.y), lightColorHdr.z);
vec3 lightColor = lightColorHdr / max(maximumComponent, 1.0);
iblColor *= lightColor;
#ifdef USE_SUN_LUMINANCE
iblColor *= luminance;
#endif
return iblColor;
}
#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL)
vec3 textureIBL(
vec3 positionEC,
vec3 normalEC,
vec3 lightDirectionEC,
czm_pbrParameters pbrParameters
) {
vec3 diffuseColor = pbrParameters.diffuseColor;
float roughness = pbrParameters.roughness;
vec3 specularColor = pbrParameters.f0;
vec3 v = -positionEC;
vec3 n = normalEC;
vec3 l = normalize(lightDirectionEC);
vec3 h = normalize(v + l);
float NdotV = abs(dot(n, v)) + 0.001;
float VdotH = clamp(dot(v, h), 0.0, 1.0);
const mat3 yUpToZUp = mat3(
-1.0, 0.0, 0.0,
0.0, 0.0, -1.0,
0.0, 1.0, 0.0
);
vec3 cubeDir = normalize(yUpToZUp * model_iblReferenceFrameMatrix * normalize(reflect(-v, n)));
#ifdef DIFFUSE_IBL
#ifdef CUSTOM_SPHERICAL_HARMONICS
vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, model_sphericalHarmonicCoefficients);
#else
vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients);
#endif
#else
vec3 diffuseIrradiance = vec3(0.0);
#endif
#ifdef SPECULAR_IBL
vec3 r0 = specularColor.rgb;
float reflectance = max(max(r0.r, r0.g), r0.b);
vec3 r90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0));
vec3 F = fresnelSchlick2(r0, r90, VdotH);
vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg;
#ifdef CUSTOM_SPECULAR_IBL
vec3 specularIBL = czm_sampleOctahedralProjection(model_specularEnvironmentMaps, model_specularEnvironmentMapsSize, cubeDir, roughness * model_specularEnvironmentMapsMaximumLOD, model_specularEnvironmentMapsMaximumLOD);
#else
vec3 specularIBL = czm_sampleOctahedralProjection(czm_specularEnvironmentMaps, czm_specularEnvironmentMapSize, cubeDir, roughness * czm_specularEnvironmentMapsMaximumLOD, czm_specularEnvironmentMapsMaximumLOD);
#endif
specularIBL *= F * brdfLut.x + brdfLut.y;
#else
vec3 specularIBL = vec3(0.0);
#endif
return diffuseColor * diffuseIrradiance + specularColor * specularIBL;
}
#endif
vec3 imageBasedLightingStage(
vec3 positionEC,
vec3 normalEC,
vec3 lightDirectionEC,
vec3 lightColorHdr,
czm_pbrParameters pbrParameters
) {
#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL)
// Environment maps were provided, use them for IBL
return textureIBL(
positionEC,
normalEC,
lightDirectionEC,
pbrParameters
);
#else
// Use the procedural IBL if there are no environment maps
return proceduralIBL(
positionEC,
normalEC,
lightDirectionEC,
lightColorHdr,
pbrParameters
);
#endif
}`;var goe={name:"ImageBasedLightingPipelineStage"};goe.process=function(e,t,n){let i=t.imageBasedLighting,o=e.shaderBuilder;o.addDefine("USE_IBL_LIGHTING",void 0,Se.FRAGMENT),o.addUniform("vec2","model_iblFactor",Se.FRAGMENT),Rm.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&o.addUniform("mat3","model_iblReferenceFrameMatrix",Se.FRAGMENT),l(i.sphericalHarmonicCoefficients)?(o.addDefine("DIFFUSE_IBL",void 0,Se.FRAGMENT),o.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,Se.FRAGMENT),o.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",Se.FRAGMENT)):i.useDefaultSphericalHarmonics&&o.addDefine("DIFFUSE_IBL",void 0,Se.FRAGMENT),l(i.specularEnvironmentMapAtlas)&&i.specularEnvironmentMapAtlas.ready?(o.addDefine("SPECULAR_IBL",void 0,Se.FRAGMENT),o.addDefine("CUSTOM_SPECULAR_IBL",void 0,Se.FRAGMENT),o.addUniform("sampler2D","model_specularEnvironmentMaps",Se.FRAGMENT),o.addUniform("vec2","model_specularEnvironmentMapsSize",Se.FRAGMENT),o.addUniform("float","model_specularEnvironmentMapsMaximumLOD",Se.FRAGMENT)):t.useDefaultSpecularMaps&&o.addDefine("SPECULAR_IBL",void 0,Se.FRAGMENT)),l(i.luminanceAtZenith)&&(o.addDefine("USE_SUN_LUMINANCE",void 0,Se.FRAGMENT),o.addUniform("float","model_luminanceAtZenith",Se.FRAGMENT)),o.addFragmentLines(oX);let r={model_iblFactor:function(){return i.imageBasedLightingFactor},model_iblReferenceFrameMatrix:function(){return t._iblReferenceFrameMatrix},model_luminanceAtZenith:function(){return i.luminanceAtZenith},model_sphericalHarmonicCoefficients:function(){return i.sphericalHarmonicCoefficients},model_specularEnvironmentMaps:function(){return i.specularEnvironmentMapAtlas.texture},model_specularEnvironmentMapsSize:function(){return i.specularEnvironmentMapAtlas.texture.dimensions},model_specularEnvironmentMapsMaximumLOD:function(){return i.specularEnvironmentMapAtlas.maximumMipmapLevel}};e.uniformMap=Tt(r,e.uniformMap)};var rX=goe;var dbn=T(S(),1);var obn=T(S(),1);var XMe=W.EPSILON16;function KY(e){e=g(e,g.EMPTY_OBJECT);let t=e.stage,n=e.runtimeArticulation;this._stage=t,this._runtimeArticulation=n,this._name=t.name,this._type=t.type,this._minimumValue=t.minimumValue,this._maximumValue=t.maximumValue,this._currentValue=t.initialValue}Object.defineProperties(KY.prototype,{stage:{get:function(){return this._stage}},runtimeArticulation:{get:function(){return this._runtimeArticulation}},name:{get:function(){return this._name}},type:{get:function(){return this._type}},minimumValue:{get:function(){return this._minimumValue}},maximumValue:{get:function(){return this._maximumValue}},currentValue:{get:function(){return this._currentValue},set:function(e){e=W.clamp(e,this.minimumValue,this.maximumValue),W.equalsEpsilon(this._currentValue,e,XMe)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var WMe=new h,HY=new q;KY.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=WMe,o;switch(t){case oc.XROTATE:o=q.fromRotationX(W.toRadians(n),HY),e=A.multiplyByMatrix3(e,o,e);break;case oc.YROTATE:o=q.fromRotationY(W.toRadians(n),HY),e=A.multiplyByMatrix3(e,o,e);break;case oc.ZROTATE:o=q.fromRotationZ(W.toRadians(n),HY),e=A.multiplyByMatrix3(e,o,e);break;case oc.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=A.multiplyByTranslation(e,i,e);break;case oc.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=A.multiplyByTranslation(e,i,e);break;case oc.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=A.multiplyByTranslation(e,i,e);break;case oc.XSCALE:i.x=n,i.y=1,i.z=1,e=A.multiplyByScale(e,i,e);break;case oc.YSCALE:i.x=1,i.y=n,i.z=1,e=A.multiplyByScale(e,i,e);break;case oc.ZSCALE:i.x=1,i.y=1,i.z=n,e=A.multiplyByScale(e,i,e);break;case oc.UNIFORMSCALE:e=A.multiplyByUniformScale(e,n,e);break;default:break}return e};var sX=KY;function BN(e){e=g(e,g.EMPTY_OBJECT);let t=e.articulation,n=e.sceneGraph;this._articulation=t,this._sceneGraph=n,this._name=t.name,this._runtimeStages=[],this._runtimeStagesByName={},this._runtimeNodes=[],this._dirty=!0,PMe(this)}Object.defineProperties(BN.prototype,{articulation:{get:function(){return this._articulation}},sceneGraph:{get:function(){return this._sceneGraph}},name:{get:function(){return this._name}},runtimeStages:{get:function(){return this._runtimeStages}},runtimeNodes:{get:function(){return this._runtimeNodes}}});function PMe(e){let n=e.articulation.stages,i=n.length,o=e._runtimeStages,r=e._runtimeStagesByName;for(let s=0;s<i;s++){let a=n[s],c=new sX({stage:a,runtimeArticulation:e});o.push(c);let d=a.name;r[d]=c}}BN.prototype.setArticulationStage=function(e,t){let n=this._runtimeStagesByName[e];l(n)&&(n.currentValue=t)};var vMe=new A,wMe=new A;BN.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e=A.clone(A.IDENTITY,vMe),t,n=this._runtimeStages,i=n.length;for(t=0;t<i;t++)e=n[t].applyStageToMatrix(e);let o=this._runtimeNodes,r=o.length;for(t=0;t<r;t++){let s=o[t],a=A.multiplyTransformation(s.originalTransform,e,wMe);s.transform=a}};var aX=BN;var xbn=T(S(),1);var mbn=T(S(),1),cX=`void modelColorStage(inout czm_modelMaterial material)
{
material.diffuse = mix(material.diffuse, model_color.rgb, model_colorBlend);
float highlight = ceil(model_colorBlend);
material.diffuse *= mix(model_color.rgb, vec3(1.0), highlight);
material.alpha *= model_color.a;
}
`;var GC={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend"};GC.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,Se.FRAGMENT),i.addFragmentLines(cX);let o={},r=t.color;r.alpha===0&&!t.hasSilhouette(n)&&(e.renderStateOptions.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),r.alpha<1&&(e.alphaOptions.pass=Ve.TRANSLUCENT),i.addUniform("vec4",GC.COLOR_UNIFORM_NAME,Se.FRAGMENT),o[GC.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",GC.COLOR_BLEND_UNIFORM_NAME,Se.FRAGMENT),o[GC.COLOR_BLEND_UNIFORM_NAME]=function(){return ic.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=Tt(o,e.uniformMap)};var ty=GC;var Ebn=T(S(),1);var Tbn=T(S(),1),lX=`#ifdef USE_CLIPPING_PLANES_FLOAT_TEXTURE
vec4 getClippingPlane(
highp sampler2D packedClippingPlanes,
int clippingPlaneNumber,
mat4 transform
) {
int pixY = clippingPlaneNumber / CLIPPING_PLANES_TEXTURE_WIDTH;
int pixX = clippingPlaneNumber - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH);
float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH);
float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT);
float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel
float v = (float(pixY) + 0.5) * pixelHeight;
vec4 plane = texture(packedClippingPlanes, vec2(u, v));
return czm_transformPlane(plane, transform);
}
#else
// Handle uint8 clipping texture instead
vec4 getClippingPlane(
highp sampler2D packedClippingPlanes,
int clippingPlaneNumber,
mat4 transform
) {
int clippingPlaneStartIndex = clippingPlaneNumber * 2; // clipping planes are two pixels each
int pixY = clippingPlaneStartIndex / CLIPPING_PLANES_TEXTURE_WIDTH;
int pixX = clippingPlaneStartIndex - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH);
float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH);
float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT);
float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel
float v = (float(pixY) + 0.5) * pixelHeight;
vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0;
vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w);
vec4 plane;
plane.xyz = czm_octDecode(oct, 65535.0);
plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + pixelWidth, v)));
return czm_transformPlane(plane, transform);
}
#endif
float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) {
vec4 position = czm_windowToEyeCoordinates(fragCoord);
vec3 clipNormal = vec3(0.0);
vec3 clipPosition = vec3(0.0);
float pixelWidth = czm_metersPerPixel(position);
#ifdef UNION_CLIPPING_REGIONS
float clipAmount; // For union planes, we want to get the min distance. So we set the initial value to the first plane distance in the loop below.
#else
float clipAmount = 0.0;
bool clipped = true;
#endif
for (int i = 0; i < CLIPPING_PLANES_LENGTH; ++i) {
vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);
clipNormal = clippingPlane.xyz;
clipPosition = -clippingPlane.w * clipNormal;
float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;
#ifdef UNION_CLIPPING_REGIONS
clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount));
if (amount <= 0.0) {
discard;
}
#else
clipAmount = max(amount, clipAmount);
clipped = clipped && (amount <= 0.0);
#endif
}
#ifndef UNION_CLIPPING_REGIONS
if (clipped) {
discard;
}
#endif
return clipAmount;
}
void modelClippingPlanesStage(inout vec4 color)
{
float clipDistance = clip(gl_FragCoord, model_clippingPlanes, model_clippingPlanesMatrix);
vec4 clippingPlanesEdgeColor = vec4(1.0);
clippingPlanesEdgeColor.rgb = model_clippingPlanesEdgeStyle.rgb;
float clippingPlanesEdgeWidth = model_clippingPlanesEdgeStyle.a;
if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) {
color = clippingPlanesEdgeColor;
}
}
`;var xoe={name:"ModelClippingPlanesPipelineStage"},FMe=new B;xoe.process=function(e,t,n){let i=t.clippingPlanes,o=n.context,r=e.shaderBuilder;r.addDefine("HAS_CLIPPING_PLANES",void 0,Se.FRAGMENT),r.addDefine("CLIPPING_PLANES_LENGTH",i.length,Se.FRAGMENT),i.unionClippingRegions&&r.addDefine("UNION_CLIPPING_REGIONS",void 0,Se.FRAGMENT),ys.useFloatTexture(o)&&r.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,Se.FRAGMENT);let s=ys.getTextureResolution(i,o,FMe);r.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",s.x,Se.FRAGMENT),r.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",s.y,Se.FRAGMENT),r.addUniform("sampler2D","model_clippingPlanes",Se.FRAGMENT),r.addUniform("vec4","model_clippingPlanesEdgeStyle",Se.FRAGMENT),r.addUniform("mat4","model_clippingPlanesMatrix",Se.FRAGMENT),r.addFragmentLines(lX);let a={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let c=O.clone(i.edgeColor);return c.alpha=i.edgeWidth,c},model_clippingPlanesMatrix:function(){return t._clippingPlanesMatrix}};e.uniformMap=Tt(a,e.uniformMap)};var dX=xoe;var Wbn=T(S(),1);function _oe(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(_oe.prototype,{name:{get:function(){return this._runtimeNode._name}},id:{get:function(){return this._runtimeNode._id}},show:{get:function(){return this._runtimeNode.show},set:function(e){this._runtimeNode.show=e}},matrix:{get:function(){return this._runtimeNode.transform},set:function(e){l(e)?(this._runtimeNode.transform=e,this._runtimeNode.userAnimated=!0,this._model._userAnimationDirty=!0):(this._runtimeNode.transform=this.originalMatrix,this._runtimeNode.userAnimated=!1)}},originalMatrix:{get:function(){return this._runtimeNode.originalTransform}}});var uX=_oe;var Lyn=T(S(),1);var syn=T(S(),1);var vbn=T(S(),1),mX=`mat4 getInstancingTransform()
{
mat4 instancingTransform;
#ifdef HAS_INSTANCE_MATRICES
instancingTransform = mat4(
a_instancingTransformRow0.x, a_instancingTransformRow1.x, a_instancingTransformRow2.x, 0.0, // Column 1
a_instancingTransformRow0.y, a_instancingTransformRow1.y, a_instancingTransformRow2.y, 0.0, // Column 2
a_instancingTransformRow0.z, a_instancingTransformRow1.z, a_instancingTransformRow2.z, 0.0, // Column 3
a_instancingTransformRow0.w, a_instancingTransformRow1.w, a_instancingTransformRow2.w, 1.0 // Column 4
);
#else
vec3 translation = vec3(0.0, 0.0, 0.0);
vec3 scale = vec3(1.0, 1.0, 1.0);
#ifdef HAS_INSTANCE_TRANSLATION
translation = a_instanceTranslation;
#endif
#ifdef HAS_INSTANCE_SCALE
scale = a_instanceScale;
#endif
instancingTransform = mat4(
scale.x, 0.0, 0.0, 0.0,
0.0, scale.y, 0.0, 0.0,
0.0, 0.0, scale.z, 0.0,
translation.x, translation.y, translation.z, 1.0
);
#endif
return instancingTransform;
}
#ifdef USE_2D_INSTANCING
mat4 getInstancingTransform2D()
{
mat4 instancingTransform2D;
#ifdef HAS_INSTANCE_MATRICES
instancingTransform2D = mat4(
a_instancingTransform2DRow0.x, a_instancingTransform2DRow1.x, a_instancingTransform2DRow2.x, 0.0, // Column 1
a_instancingTransform2DRow0.y, a_instancingTransform2DRow1.y, a_instancingTransform2DRow2.y, 0.0, // Column 2
a_instancingTransform2DRow0.z, a_instancingTransform2DRow1.z, a_instancingTransform2DRow2.z, 0.0, // Column 3
a_instancingTransform2DRow0.w, a_instancingTransform2DRow1.w, a_instancingTransform2DRow2.w, 1.0 // Column 4
);
#else
vec3 translation2D = vec3(0.0, 0.0, 0.0);
vec3 scale = vec3(1.0, 1.0, 1.0);
#ifdef HAS_INSTANCE_TRANSLATION
translation2D = a_instanceTranslation2D;
#endif
#ifdef HAS_INSTANCE_SCALE
scale = a_instanceScale;
#endif
instancingTransform2D = mat4(
scale.x, 0.0, 0.0, 0.0,
0.0, scale.y, 0.0, 0.0,
0.0, 0.0, scale.z, 0.0,
translation2D.x, translation2D.y, translation2D.z, 1.0
);
#endif
return instancingTransform2D;
}
#endif
`;var Fbn=T(S(),1),hX=`void instancingStage(inout ProcessedAttributes attributes)
{
vec3 positionMC = attributes.positionMC;
mat4 instancingTransform = getInstancingTransform();
attributes.positionMC = (instancingTransform * vec4(positionMC, 1.0)).xyz;
#ifdef HAS_NORMALS
vec3 normalMC = attributes.normalMC;
attributes.normalMC = (instancingTransform * vec4(normalMC, 0.0)).xyz;
#endif
#ifdef USE_2D_INSTANCING
mat4 instancingTransform2D = getInstancingTransform2D();
attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz;
#endif
}
`;var Mbn=T(S(),1),fX=`void legacyInstancingStage(
inout ProcessedAttributes attributes,
out mat4 instanceModelView,
out mat3 instanceModelViewInverseTranspose)
{
vec3 positionMC = attributes.positionMC;
mat4 instancingTransform = getInstancingTransform();
mat4 instanceModel = instancingTransform * u_instance_nodeTransform;
instanceModelView = u_instance_modifiedModelView;
instanceModelViewInverseTranspose = mat3(u_instance_modifiedModelView * instanceModel);
attributes.positionMC = (instanceModel * vec4(positionMC, 1.0)).xyz;
#ifdef USE_2D_INSTANCING
mat4 instancingTransform2D = getInstancingTransform2D();
attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz;
#endif
}
`;var ON=new A,AMe=new A,MMe=new A,Soe={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:Zoe,_transformsToTypedArray:JY};Soe.process=function(e,t,n){let i=t.instances,o=i.attributes[0].count,r=e.shaderBuilder;r.addDefine("HAS_INSTANCING"),r.addVertexLines(mX);let s=e.model,a=s.sceneGraph,c=e.runtimeNode,d=n.mode!==ie.SCENE3D&&!n.scene3DOnly&&s._projectTo2D,u=s._enablePick&&!n.context.webgl2,m=[];$Me(e,n,i,m,d,u),nNe(e,n,i,m);let p={};if(i.transformInWorldSpace?(r.addDefine("USE_LEGACY_INSTANCING",void 0,Se.VERTEX),r.addUniform("mat4","u_instance_modifiedModelView",Se.VERTEX),r.addUniform("mat4","u_instance_nodeTransform",Se.VERTEX),p.u_instance_modifiedModelView=function(){let y=A.multiplyTransformation(s.modelMatrix,a.components.transform,ON);return d?A.multiplyTransformation(n.context.uniformState.view3D,y,ON):(n.mode!==ie.SCENE3D&&(y=Xt.basisTo2D(n.mapProjection,y,ON)),A.multiplyTransformation(n.context.uniformState.view,y,ON))},p.u_instance_nodeTransform=function(){return A.multiplyTransformation(a.axisCorrectionMatrix,c.computedTransform,AMe)},r.addVertexLines(fX)):r.addVertexLines(hX),d){r.addDefine("USE_2D_INSTANCING",void 0,Se.VERTEX),r.addUniform("mat4","u_modelView2D",Se.VERTEX);let y=n.context,f=A.fromTranslation(c.instancingReferencePoint2D,new A);p.u_modelView2D=function(){return A.multiplyTransformation(y.uniformState.view,f,MMe)}}e.uniformMap=Tt(p,e.uniformMap),e.instanceCount=o,e.attributes.push.apply(e.attributes,m)};var pX=new A,NMe=new h;function UMe(e,t,n,i,o){let r=A.multiplyTransformation(t,e,pX);return r=A.multiplyTransformation(r,n,pX),o=Xt.basisTo2D(i.mapProjection,r,o),o}function kMe(e,t,n,i,o){let r=A.fromTranslation(e,pX),s=A.multiplyTransformation(t,r,pX);s=A.multiplyTransformation(s,n,pX);let a=A.getTranslation(s,NMe);return o=to.computeActualWgs84Position(i,a,o),o}function Coe(e,t,n){let i=e.model,o=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(t=A.multiplyTransformation(i.modelMatrix,o.components.transform,t),n=A.multiplyTransformation(o.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=A.clone(o.computedModelMatrix,t),t=A.multiplyTransformation(t,e.runtimeNode.computedTransform,t),n=A.clone(A.IDENTITY,n))}var Voe=new A,Loe=new A,DMe=new A,BMe=new h;function OMe(e,t,n,i){let o=Voe,r=Loe;Coe(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let d=0;d<c;d++){let u=e[d],m=UMe(u,o,r,n,DMe),p=A.getTranslation(m,BMe),y=h.subtract(p,a,p);i[d]=A.setTranslation(m,y,i[d])}return i}function YMe(e,t,n,i){let o=Voe,r=Loe;Coe(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let d=0;d<c;d++){let u=e[d],m=kMe(u,o,r,n,u);i[d]=h.subtract(m,a,i[d])}return i}var HMe=new h,KMe=new h;function Roe(e,t){let n=e.runtimeNode,i=e.model.sceneGraph.computedModelMatrix,o=A.multiplyByPoint(i,n.instancingTranslationMin,HMe),r=to.computeActualWgs84Position(t,o,o),s=A.multiplyByPoint(i,n.instancingTranslationMax,KMe),a=to.computeActualWgs84Position(t,s,s);n.instancingReferencePoint2D=h.lerp(r,a,.5,new h)}function JY(e){let n=e.length,i=new Float32Array(n*12);for(let o=0;o<n;o++){let r=e[o],s=12*o;i[s+0]=r[0],i[s+1]=r[4],i[s+2]=r[8],i[s+3]=r[12],i[s+4]=r[1],i[s+5]=r[5],i[s+6]=r[9],i[s+7]=r[13],i[s+8]=r[2],i[s+9]=r[6],i[s+10]=r[10],i[s+11]=r[14]}return i}function zMe(e){let n=e.length,i=new Float32Array(n*3);for(let o=0;o<n;o++){let r=e[o],s=3*o;i[s+0]=r[0],i[s+1]=r[4],i[s+2]=r[8]}return i}var JMe=new h,QMe=new Me,jMe=new h;function Zoe(e,t,n){let i=new Array(t),o=qt.getAttributeBySemantic(e,Hr.TRANSLATION),r=qt.getAttributeBySemantic(e,Hr.ROTATION),s=qt.getAttributeBySemantic(e,Hr.SCALE),a=new h(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),c=new h(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),d=l(o),u=l(r),m=l(s),p=d?o.typedArray:new Float32Array(t*3),y=u?r.typedArray:new Float32Array(t*4);u&&r.normalized&&(y=Fn.dequantize(y,r.componentDatatype,r.type,t));let f;m?f=s.typedArray:(f=new Float32Array(t*3),f.fill(1));for(let _=0;_<t;_++){let C=new h(p[_*3],p[_*3+1],p[_*3+2],JMe);h.maximumByComponent(a,C,a),h.minimumByComponent(c,C,c);let V=new Me(y[_*4],y[_*4+1],y[_*4+2],u?y[_*4+3]:1,QMe),L=new h(f[_*3],f[_*3+1],f[_*3+2],jMe),Z=A.fromTranslationQuaternionRotationScale(C,V,L,new A);i[_]=Z}let x=n.runtimeNode;return x.instancingTranslationMin=c,x.instancingTranslationMax=a,d&&(o.typedArray=void 0),u&&(r.typedArray=void 0),m&&(s.typedArray=void 0),i}function qMe(e,t,n){let i=new Array(t),o=e.typedArray,r=new h(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),s=new h(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let c=0;c<t;c++){let d=new h(o[c*3],o[c*3+1],o[c*3+2]);i[c]=d,h.minimumByComponent(r,d,r),h.maximumByComponent(s,d,s)}let a=n.runtimeNode;return a.instancingTranslationMin=r,a.instancingTranslationMax=s,e.typedArray=void 0,i}function QY(e,t){let n=ft.createVertexBuffer({context:t.context,typedArray:e,usage:Ue.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function $Me(e,t,n,i,o,r){let s=qt.getAttributeBySemantic(n,Hr.ROTATION);l(s)?eNe(e,n,i,t,o,r):tNe(e,n,i,t,o)}function eNe(e,t,n,i,o,r){let s=e.shaderBuilder,a=t.attributes[0].count,c=e.model,d=e.runtimeNode;s.addDefine("HAS_INSTANCE_MATRICES");let u="Transform",m,p=d.instancingTransformsBuffer;if(!l(p)){m=Zoe(t,a,e);let _=JY(m);p=QY(_,i),c._modelResources.push(p),r&&(d.transformsTypedArray=_),d.instancingTransformsBuffer=p}if(Toe(e,p,n,u),!o)return;let y=ze(i);y.mode=ie.COLUMBUS_VIEW,Roe(e,y);let f=d.instancingTransformsBuffer2D;if(!l(f)){let _=OMe(m,e,y,m),C=JY(_);f=QY(C,i),c._modelResources.push(f),d.instancingTransformsBuffer2D=f}Toe(e,f,n,"Transform2D")}function tNe(e,t,n,i,o,r){let s=e.shaderBuilder,a=e.runtimeNode,c=qt.getAttributeBySemantic(t,Hr.TRANSLATION),d=qt.getAttributeBySemantic(t,Hr.SCALE);if(l(d)&&(s.addDefine("HAS_INSTANCE_SCALE"),zY(e,d.buffer,d.byteOffset,d.byteStride,n,"Scale")),!l(c))return;let u,m=c.typedArray;if(l(m)?u=qMe(c,c.count,e):l(a.instancingTranslationMin)||(a.instancingTranslationMin=c.min,a.instancingTranslationMax=c.max),s.addDefine("HAS_INSTANCE_TRANSLATION"),zY(e,c.buffer,c.byteOffset,c.byteStride,n,"Translation"),!o&&!r)return;let y=ze(i);y.mode=ie.COLUMBUS_VIEW,Roe(e,y);let f=a.instancingTranslationBuffer2D;if(!l(f)){let V=YMe(u,e,y,u),L=zMe(V);r&&(a.transformsTypedArray=L),f=QY(L,i),e.model._modelResources.push(f),a.instancingTranslationBuffer2D=f}if(!o)return;zY(e,f,0,void 0,n,"Translation2D")}function Toe(e,t,n,i){let r=Q.getSizeInBytes(Q.FLOAT),s=r*12,a=[{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:Q.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:Q.FLOAT,normalize:!1,offsetInBytes:r*4,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:Q.FLOAT,normalize:!1,offsetInBytes:r*8,strideInBytes:s,instanceDivisor:1}],c=e.shaderBuilder;c.addAttribute("vec4",`a_instancing${i}Row0`),c.addAttribute("vec4",`a_instancing${i}Row1`),c.addAttribute("vec4",`a_instancing${i}Row2`),n.push.apply(n,a)}function zY(e,t,n,i,o,r){o.push({index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:3,componentDatatype:Q.FLOAT,normalize:!1,offsetInBytes:n,strideInBytes:i,instanceDivisor:1}),e.shaderBuilder.addAttribute("vec3",`a_instance${r}`)}function nNe(e,t,n,i){let o=n.attributes,r=e.shaderBuilder;for(let s=0;s<o.length;s++){let a=o[s];a.semantic===Hr.FEATURE_ID&&(a.setIndex>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:a.buffer,componentsPerAttribute:tn.getNumberOfComponents(a.type),componentDatatype:a.componentDatatype,normalize:!1,offsetInBytes:a.byteOffset,strideInBytes:a.byteStride,instanceDivisor:1}),r.addAttribute("float",`a_instanceFeatureId_${a.setIndex}`))}}var bX=Soe;var uyn=T(S(),1);var jY={};jY.name="ModelMatrixUpdateStage";jY.update=function(e,t,n){let i=n.mode!==ie.SCENE3D;if(!(i&&t._model._projectTo2D)&&e._transformDirty){let o=i?t._computedModelMatrix2D:t._computedModelMatrix;Goe(e,t,o,e.transformToRoot),e._transformDirty=!1}};function Goe(e,t,n,i){let o;i=A.multiplyTransformation(i,e.transform,new A),e.updateComputedTransform();let r=e.runtimePrimitives.length;for(o=0;o<r;o++){let c=e.runtimePrimitives[o].drawCommand;c.modelMatrix=A.multiplyTransformation(n,i,c.modelMatrix),c.cullFace=qt.getCullFace(c.modelMatrix,c.primitiveType)}let s=e.children.length;for(o=0;o<s;o++){let a=t._runtimeNodes[e.children[o]];a._transformToRoot=A.clone(i,a._transformToRoot),Goe(a,t,n,i),a._transformDirty=!1}}var yX=jY;var fyn=T(S(),1);var Eoe={name:"NodeStatisticsPipelineStage",_countInstancingAttributes:Ioe,_countGeneratedBuffers:Xoe};Eoe.process=function(e,t,n){let i=e.model.statistics,o=t.instances,r=e.runtimeNode;Ioe(i,o),Xoe(i,r)};function Ioe(e,t){if(!l(t))return;let n=t.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];l(r.buffer)&&e.addBuffer(r.buffer,!1)}}function Xoe(e,t){l(t.instancingTransformsBuffer)&&e.addBuffer(t.instancingTransformsBuffer,!1),l(t.instancingTransformsBuffer2D)&&e.addBuffer(t.instancingTransformsBuffer2D,!1),l(t.instancingTranslationBuffer2D)&&e.addBuffer(t.instancingTranslationBuffer2D,!1)}var gX=Eoe;function EC(e){e=g(e,g.EMPTY_OBJECT);let t=e.node,n=e.transform,i=e.transformToRoot,o=e.sceneGraph,r=e.children;this._node=t,this._name=t.name,this._id=t.index,this._sceneGraph=o,this._children=r,this._originalTransform=A.clone(n,this._originalTransform),this._transform=A.clone(n,this._transform),this._transformToRoot=A.clone(i,this._transformToRoot),this._computedTransform=new A,this._transformDirty=!1,this._transformParameters=void 0,this._morphWeights=[],this._runtimeSkin=void 0,this._computedJointMatrices=[],this.show=!0,this.userAnimated=!1,this.pipelineStages=[],this.runtimePrimitives=[],this.updateStages=[],this.instancingTranslationMin=void 0,this.instancingTranslationMax=void 0,this.instancingTransformsBuffer=void 0,this.instancingTransformsBuffer2D=void 0,this.instancingTranslationBuffer2D=void 0,this.instancingReferencePoint2D=void 0,iNe(this)}Object.defineProperties(EC.prototype,{node:{get:function(){return this._node}},sceneGraph:{get:function(){return this._sceneGraph}},children:{get:function(){return this._children}},transform:{get:function(){return this._transform},set:function(e){this._transformDirty=!0,this._transform=A.clone(e,this._transform)}},transformToRoot:{get:function(){return this._transformToRoot}},computedTransform:{get:function(){return this._computedTransform}},originalTransform:{get:function(){return this._originalTransform}},translation:{get:function(){return l(this._transformParameters)?this._transformParameters.translation:void 0},set:function(e){let t=this._transformParameters,n=t.translation;h.equals(n,e)||(t.translation=h.clone(e,t.translation),qY(this,t))}},rotation:{get:function(){return l(this._transformParameters)?this._transformParameters.rotation:void 0},set:function(e){let t=this._transformParameters,n=t.rotation;Me.equals(n,e)||(t.rotation=Me.clone(e,t.rotation),qY(this,t))}},scale:{get:function(){return l(this._transformParameters)?this._transformParameters.scale:void 0},set:function(e){let t=this._transformParameters,n=t.scale;h.equals(n,e)||(t.scale=h.clone(e,t.scale),qY(this,t))}},morphWeights:{get:function(){return this._morphWeights},set:function(e){let t=e.length;for(let n=0;n<t;n++)this._morphWeights[n]=e[n]}},runtimeSkin:{get:function(){return this._runtimeSkin}},computedJointMatrices:{get:function(){return this._computedJointMatrices}}});function iNe(e){let t=e.transform,n=e.transformToRoot,i=e._computedTransform;e._computedTransform=A.multiply(n,t,i);let o=e.node;l(o.matrix)||(e._transformParameters=new Gb(o.translation,o.rotation,o.scale)),l(o.morphWeights)&&(e._morphWeights=o.morphWeights.slice());let r=o.articulationName;if(l(r)){let c=e.sceneGraph._runtimeArticulations[r];l(c)&&c.runtimeNodes.push(e)}}function qY(e,t){e._transformDirty=!0,e._transform=A.fromTranslationRotationScale(t,e._transform)}EC.prototype.getChild=function(e){return this.sceneGraph._runtimeNodes[this.children[e]]};EC.prototype.configurePipeline=function(){let e=this.node,t=this.pipelineStages;t.length=0;let n=this.updateStages;n.length=0,l(e.instances)&&t.push(bX),t.push(gX),n.push(yX)};EC.prototype.updateComputedTransform=function(){this._computedTransform=A.multiply(this._transformToRoot,this._transform,this._computedTransform)};EC.prototype.updateJointMatrices=function(){let e=this._runtimeSkin;if(!l(e))return;e.updateJointMatrices();let t=this._computedJointMatrices,n=e.jointMatrices,i=n.length;for(let o=0;o<i;o++){l(t[o])||(t[o]=new A);let r=A.multiplyTransformation(this.transformToRoot,this.transform,t[o]),s=A.inverseTransformation(r,t[o]);t[o]=A.multiplyTransformation(s,n[o],t[o])}};var xX=EC;var NSn=T(S(),1);var Wyn=T(S(),1);var Woe={name:"AlphaPipelineStage"};Woe.process=function(e,t,n){let i=e.alphaOptions,o=e.model;i.pass=g(i.pass,o.opaquePass);let r=e.renderStateOptions;i.pass===Ve.TRANSLUCENT&&(r.cull.enabled=!1,r.depthMask=!1,r.blending=mn.ALPHA_BLEND);let s=e.shaderBuilder,a=e.uniformMap;l(i.alphaCutoff)&&(s.addDefine("ALPHA_MODE_MASK",void 0,Se.FRAGMENT),s.addUniform("float","u_alphaCutoff",Se.FRAGMENT),a.u_alphaCutoff=function(){return i.alphaCutoff})};var _X=Woe;var Fyn=T(S(),1);var Poe={name:"BatchTexturePipelineStage"};Poe.process=function(e,t,n){let i=e.shaderBuilder,o={},r=e.model,s=r.featureTables[r.featureTableId],a=s.featuresLength;i.addUniform("int","model_featuresLength"),o.model_featuresLength=function(){return a};let c=s.batchTexture;i.addUniform("sampler2D","model_batchTexture"),o.model_batchTexture=function(){return g(c.batchTexture,c.defaultTexture)},i.addUniform("vec4","model_textureStep"),o.model_textureStep=function(){return c.textureStep},c.textureDimensions.y>1&&(i.addDefine("MULTILINE_BATCH_TEXTURE"),i.addUniform("vec2","model_textureDimensions"),o.model_textureDimensions=function(){return c.textureDimensions}),e.uniformMap=Tt(o,e.uniformMap)};var TX=Poe;var Byn=T(S(),1);var voe={name:"ClassificationPipelineStage"};voe.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,Se.BOTH);let o=e.runtimePrimitive;l(o.batchLengths)||oNe(t,o)};function oNe(e,t){let n=qt.getAttributeBySemantic(e,_t.POSITION);if(!l(n))throw new me("Primitives must have a position attribute to be used for classification.");let i,o=e.indices,r=l(o);r&&(i=o.typedArray,o.typedArray=void 0);let s=r?o.count:n.count,a=qt.getAttributeBySemantic(e,_t.FEATURE_ID,0);if(!l(a)){t.batchLengths=[s],t.batchOffsets=[0];return}let c=a.typedArray;a.typedArray=void 0;let d=[],u=[0],m=r?i[0]:0,p=c[m],y=0;for(let x=1;x<s;x++){let _=r?i[x]:x,C=c[_];if(C!==p){let V=x-y,L=x;d.push(V),u.push(L),y=L,p=C}}let f=s-y;d.push(f),t.batchLengths=d,t.batchOffsets=u}var SX=voe;var ngn=T(S(),1);var Yyn=T(S(),1),CX=`void filterByPassType(inout vec3 positionMC, vec4 featureColor)
{
bool styleTranslucent = (featureColor.a != 1.0);
// Only render translucent features in the translucent pass (if the style or the original command has translucency).
if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent)
{
// If the model has a translucent silhouette, it needs to render during the silhouette color command,
// (i.e. the command where model_silhouettePass = true), even if the model isn't translucent.
#ifdef HAS_SILHOUETTE
positionMC *= float(model_silhouettePass);
#else
positionMC *= 0.0;
#endif
}
// If the current pass is not the translucent pass and the style is not translucent, don't render the feature.
else if (czm_pass != czm_passTranslucent && styleTranslucent)
{
positionMC *= 0.0;
}
}
void cpuStylingStage(inout vec3 positionMC, inout SelectedFeature feature)
{
float show = ceil(feature.color.a);
positionMC *= show;
#if defined(HAS_SELECTED_FEATURE_ID_ATTRIBUTE) && !defined(HAS_CLASSIFICATION)
filterByPassType(positionMC, feature.color);
#endif
}
`;var Kyn=T(S(),1),VX=`void filterByPassType(vec4 featureColor)
{
bool styleTranslucent = (featureColor.a != 1.0);
// Only render translucent features in the translucent pass (if the style or the original command has translucency).
if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent)
{
// If the model has a translucent silhouette, it needs to render during the silhouette color command,
// (i.e. the command where model_silhouettePass = true), even if the model isn't translucent.
#ifdef HAS_SILHOUETTE
if(!model_silhouettePass) {
discard;
}
#else
discard;
#endif
}
// If the current pass is not the translucent pass and the style is not translucent, don't render the feature.
else if (czm_pass != czm_passTranslucent && styleTranslucent)
{
discard;
}
}
void cpuStylingStage(inout czm_modelMaterial material, SelectedFeature feature)
{
vec4 featureColor = feature.color;
if (featureColor.a == 0.0)
{
discard;
}
// If a feature ID vertex attribute is used, the pass type filter is applied in the vertex shader.
// So, we only apply in in the fragment shader if the feature ID texture is used.
#if defined(HAS_SELECTED_FEATURE_ID_TEXTURE) && !defined(HAS_CLASSIFICATION)
filterByPassType(featureColor);
#endif
featureColor = czm_gammaCorrect(featureColor);
// Classification models compute the diffuse differently.
#ifdef HAS_CLASSIFICATION
material.diffuse = featureColor.rgb * featureColor.a;
#else
float highlight = ceil(model_colorBlend);
material.diffuse *= mix(featureColor.rgb, vec3(1.0), highlight);
#endif
material.alpha *= featureColor.a;
}
`;var woe={name:"CPUStylingPipelineStage"};woe.process=function(e,t,n){let i=e.model,o=e.shaderBuilder;o.addVertexLines(CX),o.addFragmentLines(VX),o.addDefine("USE_CPU_STYLING",void 0,Se.BOTH),l(i.color)||(o.addUniform("float",ty.COLOR_BLEND_UNIFORM_NAME,Se.FRAGMENT),e.uniformMap[ty.COLOR_BLEND_UNIFORM_NAME]=function(){return ic.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),o.addUniform("bool","model_commandTranslucent",Se.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===Ve.TRANSLUCENT}};var LX=woe;var ogn=T(S(),1),Foe={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};Foe.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};var qp=Object.freeze(Foe);var nxn=T(S(),1);var sgn=T(S(),1),RX=`void customShaderStage(
inout czm_modelVertexOutput vsOutput,
inout ProcessedAttributes attributes,
FeatureIds featureIds,
Metadata metadata,
MetadataClass metadataClass,
MetadataStatistics metadataStatistics
) {
// VertexInput and initializeInputStruct() are dynamically generated in JS,
// see CustomShaderPipelineStage.js
VertexInput vsInput;
initializeInputStruct(vsInput, attributes);
vsInput.featureIds = featureIds;
vsInput.metadata = metadata;
vsInput.metadataClass = metadataClass;
vsInput.metadataStatistics = metadataStatistics;
vertexMain(vsInput, vsOutput);
attributes.positionMC = vsOutput.positionMC;
}
`;var cgn=T(S(),1),ZX=`void customShaderStage(
inout czm_modelMaterial material,
ProcessedAttributes attributes,
FeatureIds featureIds,
Metadata metadata,
MetadataClass metadataClass,
MetadataStatistics metadataStatistics
) {
// FragmentInput and initializeInputStruct() are dynamically generated in JS,
// see CustomShaderPipelineStage.js
FragmentInput fsInput;
initializeInputStruct(fsInput, attributes);
fsInput.featureIds = featureIds;
fsInput.metadata = metadata;
fsInput.metadataClass = metadataClass;
fsInput.metadataStatistics = metadataStatistics;
fragmentMain(fsInput, material);
}
`;var Rgn=T(S(),1);var dgn=T(S(),1),GX=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) {
initializeFeatureIds(featureIds, attributes);
initializeFeatureIdAliases(featureIds);
}
`;var mgn=T(S(),1),EX=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes)
{
initializeFeatureIds(featureIds, attributes);
initializeFeatureIdAliases(featureIds);
setFeatureIdVaryings();
}
`;var Ai={name:"FeatureIdPipelineStage",STRUCT_ID_FEATURE_IDS_VS:"FeatureIdsVS",STRUCT_ID_FEATURE_IDS_FS:"FeatureIdsFS",STRUCT_NAME_FEATURE_IDS:"FeatureIds",FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS:"initializeFeatureIdsVS",FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS:"initializeFeatureIdsFS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS:"initializeFeatureIdAliasesVS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS:"initializeFeatureIdAliasesFS",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS:"void initializeFeatureIds(out FeatureIds featureIds, ProcessedAttributes attributes)",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES:"void initializeFeatureIdAliases(inout FeatureIds featureIds)",FUNCTION_ID_SET_FEATURE_ID_VARYINGS:"setFeatureIdVaryings",FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS:"void setFeatureIdVaryings()"};Ai.process=function(e,t,n){let i=e.shaderBuilder;rNe(i);let o=e.runtimeNode.node.instances;l(o)&&sNe(e,o,n),aNe(e,t,n),i.addVertexLines(EX),i.addFragmentLines(GX)};function rNe(e){e.addStruct(Ai.STRUCT_ID_FEATURE_IDS_VS,Ai.STRUCT_NAME_FEATURE_IDS,Se.VERTEX),e.addStruct(Ai.STRUCT_ID_FEATURE_IDS_FS,Ai.STRUCT_NAME_FEATURE_IDS,Se.FRAGMENT),e.addFunction(Ai.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,Ai.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,Se.VERTEX),e.addFunction(Ai.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,Ai.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,Se.FRAGMENT),e.addFunction(Ai.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,Ai.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,Se.VERTEX),e.addFunction(Ai.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,Ai.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,Se.FRAGMENT),e.addFunction(Ai.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,Ai.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,Se.VERTEX)}function sNe(e,t,n){let i=t.featureIds,o=t.attributes[0].count;for(let r=0;r<i.length;r++){let s=i[r],a=s.positionalLabel;s instanceof Mt.FeatureIdAttribute?cNe(e,s,a):Aoe(e,s,a,o,1,n);let c=s.label;l(c)&&Moe(e,a,c,Se.BOTH)}}function aNe(e,t,n){let i=t.featureIds,r=qt.getAttributeBySemantic(t,_t.POSITION).count;for(let s=0;s<i.length;s++){let a=i[s],c=a.positionalLabel,d=Se.BOTH;a instanceof Mt.FeatureIdAttribute?lNe(e,a,c):a instanceof Mt.FeatureIdImplicitRange?Aoe(e,a,c,r,void 0,n):(dNe(e,a,c,s,n),d=Se.FRAGMENT);let u=a.label;l(u)&&Moe(e,c,u,d)}}function cNe(e,t,n){let i=e.shaderBuilder;i.addStructField(Ai.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Ai.STRUCT_ID_FEATURE_IDS_FS,"int",n);let o=t.setIndex,r=n.replace(/_\d+$/,"_"),s=`a_${r}${o}`,a=`v_${r}${o}`,c=`featureIds.${n} = int(czm_round(${s}));`,d=`featureIds.${n} = int(czm_round(${a}));`;i.addFunctionLines(Ai.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[c]),i.addFunctionLines(Ai.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[d]),i.addVarying("float",a),i.addFunctionLines(Ai.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${a} = ${s};`])}function lNe(e,t,n){let i=e.shaderBuilder;i.addStructField(Ai.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Ai.STRUCT_ID_FEATURE_IDS_FS,"int",n);let o=t.setIndex,r=n.replace(/_\d+$/,"_"),s=[`featureIds.${n} = int(czm_round(attributes.${r}${o}));`];i.addFunctionLines(Ai.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,s),i.addFunctionLines(Ai.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,s)}function Aoe(e,t,n,i,o,r){uNe(e,t,i,o,r);let s=e.shaderBuilder,a=`a_implicit_${n}`;s.addAttribute("float",a);let c=`v_implicit_${n}`;s.addVarying("float",c),s.addStructField(Ai.STRUCT_ID_FEATURE_IDS_VS,"int",n),s.addStructField(Ai.STRUCT_ID_FEATURE_IDS_FS,"int",n),s.addFunctionLines(Ai.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${c} = ${a};`]),s.addFunctionLines(Ai.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${a}));`]),s.addFunctionLines(Ai.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${c}));`])}function dNe(e,t,n,i,o){let r=`u_featureIdTexture_${i}`,s=e.uniformMap,a=t.textureReader;s[r]=function(){return g(a.texture,o.context.defaultTexture)};let c=a.channels,d=e.shaderBuilder;d.addStructField(Ai.STRUCT_ID_FEATURE_IDS_FS,"int",n),d.addUniform("sampler2D",r,Se.FRAGMENT);let m=`v_texCoord_${a.texCoord}`,p=m,y=a.transform;if(l(y)&&!q.equals(y,q.IDENTITY)){let _=`${r}Transform`;d.addUniform("mat3",_,Se.FRAGMENT),s[_]=function(){return y},p=`vec2(${_} * vec3(${m}, 1.0))`}let f=`texture(${r}, ${p}).${c}`,x=`featureIds.${n} = czm_unpackUint(${f});`;d.addFunctionLines(Ai.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[x])}function Moe(e,t,n,i){let o=e.shaderBuilder,r=Se.includesVertexShader(i);r&&o.addStructField(Ai.STRUCT_ID_FEATURE_IDS_VS,"int",n),o.addStructField(Ai.STRUCT_ID_FEATURE_IDS_FS,"int",n);let s=[`featureIds.${n} = featureIds.${t};`];r&&o.addFunctionLines(Ai.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,s),o.addFunctionLines(Ai.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,s)}function uNe(e,t,n,i,o){let r=e.model,s,a;if(l(t.repeat)){let d=mNe(t,n);s=ft.createVertexBuffer({context:o.context,typedArray:d,usage:Ue.STATIC_DRAW}),s.vertexArrayDestroyable=!1,r._pipelineResources.push(s),r.statistics.addBuffer(s,!1)}else a=[t.offset];let c={index:e.attributeIndex++,instanceDivisor:i,value:a,vertexBuffer:s,normalize:!1,componentsPerAttribute:1,componentDatatype:Q.FLOAT,strideInBytes:Q.getSizeInBytes(Q.FLOAT),offsetInBytes:0};e.attributes.push(c)}function mNe(e,t){let n=e.offset,i=e.repeat,o=new Float32Array(t);for(let r=0;r<t;r++)o[r]=n+Math.floor(r/i);return o}var ny=Ai;var Ngn=T(S(),1);var Ggn=T(S(),1),IX=`void metadataStage(
out Metadata metadata,
out MetadataClass metadataClass,
out MetadataStatistics metadataStatistics,
ProcessedAttributes attributes
)
{
initializeMetadata(metadata, metadataClass, metadataStatistics, attributes);
}
`;var Ign=T(S(),1),XX=`void metadataStage(
out Metadata metadata,
out MetadataClass metadataClass,
out MetadataStatistics metadataStatistics,
ProcessedAttributes attributes
)
{
initializeMetadata(metadata, metadataClass, metadataStatistics, attributes);
setMetadataVaryings();
}
`;var Ci={name:"MetadataPipelineStage",STRUCT_ID_METADATA_VS:"MetadataVS",STRUCT_ID_METADATA_FS:"MetadataFS",STRUCT_NAME_METADATA:"Metadata",STRUCT_ID_METADATA_CLASS_VS:"MetadataClassVS",STRUCT_ID_METADATA_CLASS_FS:"MetadataClassFS",STRUCT_NAME_METADATA_CLASS:"MetadataClass",STRUCT_ID_METADATA_STATISTICS_VS:"MetadataStatisticsVS",STRUCT_ID_METADATA_STATISTICS_FS:"MetadataStatisticsFS",STRUCT_NAME_METADATA_STATISTICS:"MetadataStatistics",FUNCTION_ID_INITIALIZE_METADATA_VS:"initializeMetadataVS",FUNCTION_ID_INITIALIZE_METADATA_FS:"initializeMetadataFS",FUNCTION_SIGNATURE_INITIALIZE_METADATA:"void initializeMetadata(out Metadata metadata, out MetadataClass metadataClass, out MetadataStatistics metadataStatistics, ProcessedAttributes attributes)",FUNCTION_ID_SET_METADATA_VARYINGS:"setMetadataVaryings",FUNCTION_SIGNATURE_SET_METADATA_VARYINGS:"void setMetadataVaryings()",METADATA_CLASS_FIELDS:[{specName:"noData",shaderName:"noData"},{specName:"default",shaderName:"defaultValue"},{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"}],METADATA_STATISTICS_FIELDS:[{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"},{specName:"mean",shaderName:"mean",type:"float"},{specName:"median",shaderName:"median"},{specName:"standardDeviation",shaderName:"standardDeviation",type:"float"},{specName:"variance",shaderName:"variance",type:"float"},{specName:"sum",shaderName:"sum"}]};Ci.process=function(e,t,n){let{shaderBuilder:i,model:o}=e,{structuralMetadata:r={},content:s}=o,a=s?.tileset.metadataExtension?.statistics,c=hNe(r.propertyAttributes,t,a),d=pNe(r.propertyTextures,a),u=c.concat(d);yNe(i,u),_Ne(i),i.addVertexLines(XX),i.addFragmentLines(IX);for(let m=0;m<c.length;m++){let p=c[m];TNe(e,p)}for(let m=0;m<d.length;m++){let p=d[m];CNe(e,p)}};function hNe(e,t,n){return l(e)?e.flatMap(i=>fNe(i,t,n)):[]}function fNe(e,t,n){let{getAttributeByName:i,getAttributeInfo:o,sanitizeGlslIdentifier:r}=qt,s=e.class.id,a=n?.classes[s],c=Object.entries(e.properties),d=new Array(c.length);for(let u=0;u<c.length;u++){let[m,p]=c[u],y=i(t,p.attribute),{glslType:f,variableName:x}=o(y);d[u]={metadataVariable:r(m),property:p,type:p.classProperty.type,glslType:f,variableName:x,propertyStatistics:a?.properties[m],shaderDestination:Se.BOTH}}return d}function pNe(e,t){return l(e)?e.flatMap(n=>bNe(n,t)):[]}function bNe(e,t){let{sanitizeGlslIdentifier:n}=qt,i=e.class.id,o=t?.classes[i],r=Object.entries(e.properties).filter(([a,c])=>c.isGpuCompatible()),s=new Array(r.length);for(let a=0;a<r.length;a++){let[c,d]=r[a];s[a]={metadataVariable:n(c),property:d,type:d.classProperty.type,glslType:d.getGlslType(),propertyStatistics:o?.properties[c],shaderDestination:Se.FRAGMENT}}return s}function yNe(e,t){let n=new Set,i=new Set;for(let a=0;a<t.length;a++){let{type:c,glslType:d,propertyStatistics:u}=t[a];n.add(d),l(u)&&c!==Ht.ENUM&&i.add(d)}let o=Ci.METADATA_CLASS_FIELDS;for(let a of n){let c=`${a}MetadataClass`;s(c,a,o)}let r=Ci.METADATA_STATISTICS_FIELDS;for(let a of i){let c=`${a}MetadataStatistics`;s(c,a,r)}function s(a,c,d){e.addStruct(a,a,Se.BOTH);for(let u=0;u<d.length;u++){let{shaderName:m}=d[u],p=d[u].type==="float"?xNe(c):c;e.addStructField(a,p,m)}}}var gNe={int:"float",ivec2:"vec2",ivec3:"vec3",ivec4:"vec4"};function xNe(e){let t=gNe[e];return l(t)?t:e}function _Ne(e){e.addStruct(Ci.STRUCT_ID_METADATA_VS,Ci.STRUCT_NAME_METADATA,Se.VERTEX),e.addStruct(Ci.STRUCT_ID_METADATA_FS,Ci.STRUCT_NAME_METADATA,Se.FRAGMENT),e.addStruct(Ci.STRUCT_ID_METADATA_CLASS_VS,Ci.STRUCT_NAME_METADATA_CLASS,Se.VERTEX),e.addStruct(Ci.STRUCT_ID_METADATA_CLASS_FS,Ci.STRUCT_NAME_METADATA_CLASS,Se.FRAGMENT),e.addStruct(Ci.STRUCT_ID_METADATA_STATISTICS_VS,Ci.STRUCT_NAME_METADATA_STATISTICS,Se.VERTEX),e.addStruct(Ci.STRUCT_ID_METADATA_STATISTICS_FS,Ci.STRUCT_NAME_METADATA_STATISTICS,Se.FRAGMENT),e.addFunction(Ci.FUNCTION_ID_INITIALIZE_METADATA_VS,Ci.FUNCTION_SIGNATURE_INITIALIZE_METADATA,Se.VERTEX),e.addFunction(Ci.FUNCTION_ID_INITIALIZE_METADATA_FS,Ci.FUNCTION_SIGNATURE_INITIALIZE_METADATA,Se.FRAGMENT),e.addFunction(Ci.FUNCTION_ID_SET_METADATA_VARYINGS,Ci.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,Se.VERTEX)}function TNe(e,t){SNe(e,t),Noe(e.shaderBuilder,t),Uoe(e.shaderBuilder,t)}function SNe(e,t){let{shaderBuilder:n}=e,{metadataVariable:i,property:o,glslType:r}=t,s=Doe({valueExpression:`attributes.${t.variableName}`,renderResources:e,glslType:r,metadataVariable:i,shaderDestination:Se.BOTH,property:o});n.addStructField(Ci.STRUCT_ID_METADATA_VS,r,i),n.addStructField(Ci.STRUCT_ID_METADATA_FS,r,i);let a=`metadata.${i} = ${s};`;n.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_VS,[a]),n.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_FS,[a])}function CNe(e,t){VNe(e,t),Noe(e.shaderBuilder,t),Uoe(e.shaderBuilder,t)}function VNe(e,t){let{shaderBuilder:n,uniformMap:i}=e,{metadataVariable:o,glslType:r,property:s}=t,{texCoord:a,channels:c,index:d,texture:u,transform:m}=s.textureReader,p=`u_propertyTexture_${d}`;i.hasOwnProperty(p)||(n.addUniform("sampler2D",p,Se.FRAGMENT),i[p]=()=>u),n.addStructField(Ci.STRUCT_ID_METADATA_FS,r,o);let y=`attributes.texCoord_${a}`,f=y;if(l(m)&&!q.equals(m,q.IDENTITY)){let L=`${p}Transform`;n.addUniform("mat3",L,Se.FRAGMENT),i[L]=function(){return m},f=`vec2(${L} * vec3(${y}, 1.0))`}let x=`texture(${p}, ${f}).${c}`,_=s.unpackInShader(x),C=Doe({valueExpression:_,renderResources:e,glslType:r,metadataVariable:o,shaderDestination:Se.FRAGMENT,property:s}),V=`metadata.${o} = ${C};`;n.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_FS,[V])}function Noe(e,t){let{classProperty:n}=t.property,{metadataVariable:i,glslType:o,shaderDestination:r}=t,s=koe(Ci.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,o),a=`${o}MetadataClass`;e.addStructField(Ci.STRUCT_ID_METADATA_CLASS_FS,a,i),e.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_FS,s),Se.includesVertexShader(r)&&(e.addStructField(Ci.STRUCT_ID_METADATA_CLASS_VS,a,i),e.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_VS,s))}function Uoe(e,t){let{propertyStatistics:n}=t;if(!l(n))return;let{metadataVariable:i,type:o,glslType:r}=t;if(o===Ht.ENUM)return;let s=Ci.METADATA_STATISTICS_FIELDS,a=`metadataStatistics.${i}`,c=koe(s,n,a,r),d=`${r}MetadataStatistics`;e.addStructField(Ci.STRUCT_ID_METADATA_STATISTICS_FS,d,i),e.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_FS,c),Se.includesVertexShader(t.shaderDestination)&&(e.addStructField(Ci.STRUCT_ID_METADATA_STATISTICS_VS,d,i),e.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_VS,c))}function koe(e,t,n,i){function o(r){let s=t[r.specName];if(l(s))return`${n}.${r.shaderName} = ${i}(${s});`}return l(t)?e.map(o).filter(l):[]}function Doe(e){let{valueExpression:t,property:n}=e;if(!n.hasValueTransform)return t;let i=e.metadataVariable,o=`u_${i}_offset`,r=`u_${i}_scale`,{shaderBuilder:s,uniformMap:a}=e.renderResources,{glslType:c,shaderDestination:d}=e;s.addUniform(c,o,d),s.addUniform(c,r,d);let{offset:u,scale:m}=n;return a[o]=()=>u,a[r]=()=>m,`czm_valueTransform(${o}, ${r}, ${t})`}var fu=Ci;var kgn=T(S(),1),LNe={INHERIT:0,OPAQUE:1,TRANSLUCENT:2},iy=Object.freeze(LNe);var cs={name:"CustomShaderPipelineStage",STRUCT_ID_ATTRIBUTES_VS:"AttributesVS",STRUCT_ID_ATTRIBUTES_FS:"AttributesFS",STRUCT_NAME_ATTRIBUTES:"Attributes",STRUCT_ID_VERTEX_INPUT:"VertexInput",STRUCT_NAME_VERTEX_INPUT:"VertexInput",STRUCT_ID_FRAGMENT_INPUT:"FragmentInput",STRUCT_NAME_FRAGMENT_INPUT:"FragmentInput",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS:"initializeInputStructVS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS:"void initializeInputStruct(out VertexInput vsInput, ProcessedAttributes attributes)",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS:"initializeInputStructFS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS:"void initializeInputStruct(out FragmentInput fsInput, ProcessedAttributes attributes)",_oneTimeWarning:Ft};cs.process=function(e,t,n){let i=e.model.customShader;if(i&&cs.process_original(e,t,n,i),l(e.model._marsOptions)&&l(e.model._marsOptions.customShaders)){let o=ip.getCache(e.model._marsOptions.customShaders);for(let r in o)Object.prototype.hasOwnProperty.call(o,r)&&cs.process_original(e,t,n,o[r])}};cs.process_original=function(e,t,n,i){let{shaderBuilder:o,alphaOptions:r}=e,{lightingModel:s,translucencyMode:a}=i;l(s)&&(e.lightingOptions.lightingModel=s),a===iy.TRANSLUCENT?r.pass=Ve.TRANSLUCENT:a===iy.OPAQUE&&(r.pass=void 0);let c=PNe(i,t);if(!c.customShaderEnabled)return;if(ANe(o,i,c),c.shouldComputePositionWC&&o.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,Se.BOTH),l(i.vertexShaderText)&&o.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,Se.VERTEX),l(i.fragmentShaderText)){o.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,Se.FRAGMENT);let m=qp.getDefineName(i.mode);o.addDefine(m,void 0,Se.FRAGMENT)}let d=i.uniforms;for(let m in d)if(d.hasOwnProperty(m)){let p=d[m];o.addUniform(p.type,m)}let u=i.varyings;for(let m in u)if(u.hasOwnProperty(m)){let p=u[m];o.addVarying(p,m)}e.uniformMap=Tt(e.uniformMap,i.uniformMap)};function RNe(e){let t={};for(let n=0;n<e.length;n++){let i=qt.getAttributeInfo(e[n]);t[i.variableName]=i}return t}var ZNe={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},GNe={position:"vec3(0.0)",normal:"vec3(0.0, 0.0, 1.0)",tangent:"vec3(1.0, 0.0, 0.0)",bitangent:"vec3(0.0, 1.0, 0.0)",texCoord:"vec2(0.0)",color:"vec4(1.0)",joints:"ivec4(0)",weights:"vec4(0.0)"};function Boe(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");let n=ZNe[t],i=GNe[t];if(l(n))return{attributeField:[n,e],value:i}}function ENe(e,t){if(!l(e.vertexShaderText))return{enabled:!1};let n=e.usedVariablesVertex.attributeSet,i=Ooe(t,n,!1),o=Yoe(t,n,!1),r,s=[],a=[];for(let c in i){if(!i.hasOwnProperty(c))continue;let u=[i[c].glslType,c];s.push(u),r=`vsInput.attributes.${c} = attributes.${c};`,a.push(r)}for(let c=0;c<o.length;c++){let d=o[c],u=Boe(d);if(!l(u))return cs._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveVS",`Primitive is missing attribute ${d}, disabling custom vertex shader`),{enabled:!1};s.push(u.attributeField),r=`vsInput.attributes.${d} = ${u.value};`,a.push(r)}return{enabled:!0,attributeFields:s,initializationLines:a}}function INe(e){let t=[],n=[],i=e.usedVariablesFragment.attributeSet;return i.hasOwnProperty("positionWC")&&(t.push(["vec3","positionWC"]),n.push("fsInput.attributes.positionWC = attributes.positionWC;")),i.hasOwnProperty("positionEC")&&(t.push(["vec3","positionEC"]),n.push("fsInput.attributes.positionEC = attributes.positionEC;")),{attributeFields:t,initializationLines:n}}function XNe(e,t){if(!l(e.fragmentShaderText))return{enabled:!1};let n=e.usedVariablesFragment.attributeSet,i=Ooe(t,n,!0),o=Yoe(t,n,!0),r,s=[],a=[];for(let d in i){if(!i.hasOwnProperty(d))continue;let m=[i[d].glslType,d];s.push(m),r=`fsInput.attributes.${d} = attributes.${d};`,a.push(r)}for(let d=0;d<o.length;d++){let u=o[d],m=Boe(u);if(!l(m))return cs._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveFS",`Primitive is missing attribute ${u}, disabling custom fragment shader.`),{enabled:!1};s.push(m.attributeField),r=`fsInput.attributes.${u} = ${m.value};`,a.push(r)}let c=INe(e);return{enabled:!0,attributeFields:s.concat(c.attributeFields),initializationLines:c.initializationLines.concat(a)}}var WNe={positionWC:!0,positionEC:!0};function Ooe(e,t,n){let i={};for(let o in e){if(!e.hasOwnProperty(o))continue;let r=e[o],s=o;n&&o==="normalMC"?s="normalEC":n&&o==="tangentMC"&&(s="tangentEC",r.glslType="vec3"),t.hasOwnProperty(s)&&(i[s]=r)}return i}function Yoe(e,t,n){let i=[];for(let o in t){if(!t.hasOwnProperty(o)||WNe.hasOwnProperty(o))continue;let r=o;n&&o==="normalEC"?r="normalMC":n&&o==="tangentEC"&&(r="tangentMC"),e.hasOwnProperty(r)||i.push(o)}return i}function PNe(e,t){let n=RNe(t.attributes),i=ENe(e,n),o=XNe(e,n),s=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&o.enabled;return{vertexLines:i,fragmentLines:o,customShaderEnabled:i.enabled||o.enabled,shouldComputePositionWC:s}}function vNe(e,t){let n=cs.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(n,cs.STRUCT_NAME_ATTRIBUTES,Se.VERTEX);let{attributeFields:i,initializationLines:o}=t;for(let s=0;s<i.length;s++){let[a,c]=i[s];e.addStructField(n,a,c)}n=cs.STRUCT_ID_VERTEX_INPUT,e.addStruct(n,cs.STRUCT_NAME_VERTEX_INPUT,Se.VERTEX),e.addStructField(n,cs.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,ny.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,fu.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,fu.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,fu.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=cs.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(r,cs.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,Se.VERTEX),e.addFunctionLines(r,o)}function wNe(e,t){let n=cs.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(n,cs.STRUCT_NAME_ATTRIBUTES,Se.FRAGMENT);let{attributeFields:i,initializationLines:o}=t;for(let s=0;s<i.length;s++){let[a,c]=i[s];e.addStructField(n,a,c)}n=cs.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(n,cs.STRUCT_NAME_FRAGMENT_INPUT,Se.FRAGMENT),e.addStructField(n,cs.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,ny.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,fu.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,fu.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,fu.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=cs.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(r,cs.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,Se.FRAGMENT),e.addFunctionLines(r,o)}var FNe=[];function ANe(e,t,n){let{vertexLines:i,fragmentLines:o}=n,r=FNe;i.enabled&&(vNe(e,i),r.length=0,r.push("#line 0",t.vertexShaderText,RX),e.addVertexLines(r)),o.enabled&&(wNe(e,o),r.length=0,r.push("#line 0",t.fragmentShaderText,ZX),e.addFragmentLines(r))}var WX=cs;var lxn=T(S(),1);var PX={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};PX.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=l(o.classificationType);i.addDefine("USE_DEQUANTIZATION",void 0,Se.VERTEX),i.addFunction(PX.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,PX.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,Se.VERTEX);let s=t.attributes;for(let a=0;a<s.length;a++){let c=s[a],d=c.quantization;if(!l(d))continue;let u=c.semantic===_t.POSITION,m=c.semantic===_t.TEXCOORD;if(r&&!u&&!m)continue;let p=qt.getAttributeInfo(c);NNe(i,p),MNe(e,p)}};function MNe(e,t){let n=e.shaderBuilder,i=e.uniformMap,o=t.variableName,r=t.attribute.quantization;if(r.octEncoded){let s=`model_normalizationRange_${o}`;n.addUniform("float",s,Se.VERTEX),i[s]=function(){return r.normalizationRange}}else{let s=`model_quantizedVolumeOffset_${o}`,a=`model_quantizedVolumeStepSize_${o}`,c=t.glslType;n.addUniform(c,s,Se.VERTEX),n.addUniform(c,a,Se.VERTEX);let d=r.quantizedVolumeOffset,u=r.quantizedVolumeStepSize;/^color_\d+$/.test(o)&&(d=Hoe(d,0),u=Hoe(u,1)),i[s]=function(){return d},i[a]=function(){return u}}}function Hoe(e,t){return e instanceof se?e:new se(e.x,e.y,e.z,t)}function NNe(e,t){let n=t.variableName,i=t.attribute.quantization,o;i.octEncoded?o=UNe(n,i):o=kNe(n),e.addFunctionLines(PX.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[o])}function UNe(e,t){let n=`attributes.${e}`,i=`a_quantized_${e}`,o=`model_normalizationRange_${e}`,r=t.octEncodedZXY?".zxy":".xyz";return`${n} = czm_octDecode(${i}, ${o})${r};`}function kNe(e){let t=`attributes.${e}`,n=`a_quantized_${e}`,i=`model_quantizedVolumeOffset_${e}`,o=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${i} + ${n} * ${o};`}var vX=PX;var Axn=T(S(),1);var uxn=T(S(),1),wX=`void geometryStage(out ProcessedAttributes attributes)
{
attributes.positionMC = v_positionMC;
attributes.positionEC = v_positionEC;
#if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) || defined(COMPUTE_POSITION_WC_ATMOSPHERE)
attributes.positionWC = v_positionWC;
#endif
#ifdef HAS_NORMALS
// renormalize after interpolation
attributes.normalEC = normalize(v_normalEC);
#endif
#ifdef HAS_TANGENTS
attributes.tangentEC = normalize(v_tangentEC);
#endif
#ifdef HAS_BITANGENTS
attributes.bitangentEC = normalize(v_bitangentEC);
#endif
// Everything else is dynamically generated in GeometryPipelineStage
setDynamicVaryings(attributes);
}
`;var hxn=T(S(),1),FX=`vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal)
{
vec4 computedPosition;
// Compute positions in different coordinate systems
vec3 positionMC = attributes.positionMC;
v_positionMC = positionMC;
v_positionEC = (modelView * vec4(positionMC, 1.0)).xyz;
#if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING)
vec3 position2D = attributes.position2D;
vec3 positionEC = (u_modelView2D * vec4(position2D, 1.0)).xyz;
computedPosition = czm_projection * vec4(positionEC, 1.0);
#else
computedPosition = czm_projection * vec4(v_positionEC, 1.0);
#endif
// Sometimes the custom shader and/or style needs this
#if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) || defined(COMPUTE_POSITION_WC_ATMOSPHERE)
// Note that this is a 32-bit position which may result in jitter on small
// scales.
v_positionWC = (czm_model * vec4(positionMC, 1.0)).xyz;
#endif
#ifdef HAS_NORMALS
v_normalEC = normalize(normal * attributes.normalMC);
#endif
#ifdef HAS_TANGENTS
v_tangentEC = normalize(normal * attributes.tangentMC);
#endif
#ifdef HAS_BITANGENTS
v_bitangentEC = normalize(normal * attributes.bitangentMC);
#endif
// All other varyings need to be dynamically generated in
// GeometryPipelineStage
setDynamicVaryings(attributes);
return computedPosition;
}
`;var Cxn=T(S(),1);var pxn=T(S(),1),IC=`vec2 computeSt(float featureId)
{
float stepX = model_textureStep.x;
float centerX = model_textureStep.y;
#ifdef MULTILINE_BATCH_TEXTURE
float stepY = model_textureStep.z;
float centerY = model_textureStep.w;
float xId = mod(featureId, model_textureDimensions.x);
float yId = floor(featureId / model_textureDimensions.x);
return vec2(centerX + (xId * stepX), centerY + (yId * stepY));
#else
return vec2(centerX + (featureId * stepX), 0.5);
#endif
}
void selectedFeatureIdStage(out SelectedFeature feature, FeatureIds featureIds)
{
int featureId = featureIds.SELECTED_FEATURE_ID;
if (featureId < model_featuresLength)
{
vec2 featureSt = computeSt(float(featureId));
feature.id = featureId;
feature.st = featureSt;
feature.color = texture(model_batchTexture, featureSt);
}
// Floating point comparisons can be unreliable in GLSL, so we
// increment the feature ID to make sure it's always greater
// then the model_featuresLength - a condition we check for in the
// pick ID, to avoid sampling the pick texture if the feature ID is
// greater than the number of features.
else
{
feature.id = model_featuresLength + 1;
feature.st = vec2(0.0);
feature.color = vec4(1.0);
}
#ifdef HAS_NULL_FEATURE_ID
if (featureId == model_nullFeatureId) {
feature.id = featureId;
feature.st = vec2(0.0);
feature.color = vec4(1.0);
}
#endif
}
`;var AX={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature",FUNCTION_ID_FEATURE_VARYINGS_VS:"updateFeatureStructVS",FUNCTION_ID_FEATURE_VARYINGS_FS:"updateFeatureStructFS",FUNCTION_SIGNATURE_UPDATE_FEATURE:"void updateFeatureStruct(inout SelectedFeature feature)"};AX.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let o=e.model,r=e.runtimeNode.node,s=DNe(o,r,t),a=s.shaderDestination;i.addDefine("HAS_SELECTED_FEATURE_ID",void 0,a),i.addDefine("SELECTED_FEATURE_ID",s.variableName,a),i.addDefine(s.featureIdDefine,void 0,a),BNe(i);let c=s.featureIds.nullFeatureId,d=e.uniformMap;l(c)&&(i.addDefine("HAS_NULL_FEATURE_ID",void 0,a),i.addUniform("int","model_nullFeatureId",a),d.model_nullFeatureId=function(){return c}),s.shaderDestination===Se.BOTH&&i.addVertexLines(IC),i.addFragmentLines(IC)};function Koe(e){return e instanceof Mt.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function zoe(e){return e instanceof Mt.FeatureIdTexture?Se.FRAGMENT:Se.BOTH}function DNe(e,t,n){let i,o;return l(t.instances)&&(o=qt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(o))?(i=g(o.label,o.positionalLabel),{featureIds:o,variableName:i,shaderDestination:zoe(o),featureIdDefine:Koe(o)}):(o=qt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=g(o.label,o.positionalLabel),{featureIds:o,variableName:i,shaderDestination:zoe(o),featureIdDefine:Koe(o)})}function BNe(e){e.addStructField(AX.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(AX.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(AX.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var oy=AX;var Fs={name:"GeometryPipelineStage",STRUCT_ID_PROCESSED_ATTRIBUTES_VS:"ProcessedAttributesVS",STRUCT_ID_PROCESSED_ATTRIBUTES_FS:"ProcessedAttributesFS",STRUCT_NAME_PROCESSED_ATTRIBUTES:"ProcessedAttributes",FUNCTION_ID_INITIALIZE_ATTRIBUTES:"initializeAttributes",FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES:"void initializeAttributes(out ProcessedAttributes attributes)",FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS:"setDynamicVaryingsVS",FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS:"setDynamicVaryingsFS",FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS:"void setDynamicVaryings(inout ProcessedAttributes attributes)"};Fs.process=function(e,t,n){let i=e.shaderBuilder,o=e.model;i.addStruct(Fs.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",Se.VERTEX),i.addStruct(Fs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",Se.FRAGMENT),i.addStruct(oy.STRUCT_ID_SELECTED_FEATURE,oy.STRUCT_NAME_SELECTED_FEATURE,Se.BOTH),i.addFunction(Fs.FUNCTION_ID_INITIALIZE_ATTRIBUTES,Fs.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,Se.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(Fs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(Fs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(Fs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,Fs.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,Se.VERTEX),i.addFunction(Fs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,Fs.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,Se.FRAGMENT),o.type===cr.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,Se.FRAGMENT);let s=n.mode!==ie.SCENE3D&&!n.scene3DOnly&&o._projectTo2D,a=l(e.runtimeNode.node.instances),c=s&&!a,d=t.attributes.length;for(let u=0;u<d;u++){let m=t.attributes[u],p=tn.getAttributeLocationCount(m.type),y=m.semantic===_t.POSITION,f;p>1?(f=e.attributeIndex,e.attributeIndex+=p):y&&!c?f=0:f=e.attributeIndex++,ONe(e,m,f,p,s,a)}$Ne(i,t.attributes),t.primitiveType===Ae.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(FX),i.addFragmentLines(wX)};function ONe(e,t,n,i,o,r){let s=e.shaderBuilder,a=qt.getAttributeInfo(t),c=o&&!r;i>1?KNe(e,t,n,i):HNe(e,t,n,c),JNe(s,a,c),zNe(s,a),l(t.semantic)&&YNe(s,t),QNe(s,a,o),jNe(s,a,c),qNe(s,a)}function YNe(e,t){let n=t.semantic,i=t.setIndex;switch(n){case _t.NORMAL:e.addDefine("HAS_NORMALS");break;case _t.TANGENT:e.addDefine("HAS_TANGENTS");break;case _t.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case _t.TEXCOORD:case _t.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function HNe(e,t,n,i){let o=t.quantization,r,s;l(o)?(r=o.type,s=o.componentDatatype):(r=t.type,s=t.componentDatatype);let a=t.semantic,c=t.setIndex;a===_t.FEATURE_ID&&c>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=c+1);let d=a===_t.POSITION,u=d?0:n,m=tn.getNumberOfComponents(r),p={index:u,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:m,componentDatatype:s,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!d||!i)return;let y=e.runtimePrimitive.positionBuffer2D,f={index:n,vertexBuffer:y,count:t.count,componentsPerAttribute:m,componentDatatype:Q.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(f)}function KNe(e,t,n,i){let o=t.quantization,r,s;l(o)?(r=o.type,s=o.componentDatatype):(r=t.type,s=t.componentDatatype);let a=t.normalized,d=tn.getNumberOfComponents(r)/i,u=Q.getSizeInBytes(s),m=d*u,p=t.byteStride;for(let y=0;y<i;y++){let f=t.byteOffset+y*m,x={index:n+y,vertexBuffer:t.buffer,componentsPerAttribute:d,componentDatatype:s,offsetInBytes:f,strideInBytes:p,normalize:a};e.attributes.push(x)}}function zNe(e,t){let n=t.variableName,i=`v_${n}`,o;n==="normalMC"?(i="v_normalEC",o=t.glslType):n==="tangentMC"?(o="vec3",i="v_tangentEC"):o=t.glslType,e.addVarying(o,i)}function JNe(e,t,n){let i=t.attribute.semantic,o=t.variableName,r,s;t.isQuantized?(r=`a_quantized_${o}`,s=t.quantizedGlslType):(r=`a_${o}`,s=t.glslType);let a=i===_t.POSITION;a?e.setPositionAttribute(s,r):e.addAttribute(s,r),a&&n&&e.addAttribute("vec3","a_position2D")}function QNe(e,t,n){let i=Fs.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,o=Fs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,r=t.variableName;r==="tangentMC"?(e.addStructField(i,"vec3","tangentMC"),e.addStructField(i,"float","tangentSignMC"),e.addStructField(o,"vec3","tangentEC")):r==="normalMC"?(e.addStructField(i,"vec3","normalMC"),e.addStructField(o,"vec3","normalEC")):(e.addStructField(i,t.glslType,r),e.addStructField(o,t.glslType,r)),r==="positionMC"&&n&&e.addStructField(i,"vec3","position2D")}function jNe(e,t,n){let i=Fs.FUNCTION_ID_INITIALIZE_ATTRIBUTES,o=t.variableName;if(o==="positionMC"&&n&&e.addFunctionLines(i,["attributes.position2D = a_position2D;"]),t.isQuantized)return;let s=[];o==="tangentMC"?(s.push("attributes.tangentMC = a_tangentMC.xyz;"),s.push("attributes.tangentSignMC = a_tangentMC.w;")):s.push(`attributes.${o} = a_${o};`),e.addFunctionLines(i,s)}function qNe(e,t){let n=t.attribute.semantic,i=t.attribute.setIndex;if(l(n)&&!l(i))return;let o=Fs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,r=t.variableName,s=`v_${r} = attributes.${r};`;e.addFunctionLines(o,[s]),o=Fs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,s=`attributes.${r} = v_${r};`,e.addFunctionLines(o,[s])}function $Ne(e,t){let n=!1,i=!1;for(let o=0;o<t.length;o++){let r=t[o];r.semantic===_t.NORMAL?n=!0:r.semantic===_t.TANGENT&&(i=!0)}!n||!i||(e.addDefine("HAS_BITANGENTS"),e.addVarying("vec3","v_bitangentEC"),e.addStructField(Fs.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"vec3","bitangentMC"),e.addStructField(Fs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","bitangentEC"))}var MX=Fs;var Kxn=T(S(),1);var Nxn=T(S(),1),NX=`#ifdef LIGHTING_PBR
vec3 computePbrLighting(czm_modelMaterial inputMaterial, ProcessedAttributes attributes)
{
czm_pbrParameters pbrParameters;
pbrParameters.diffuseColor = inputMaterial.diffuse;
pbrParameters.f0 = inputMaterial.specular;
pbrParameters.roughness = inputMaterial.roughness;
#ifdef USE_CUSTOM_LIGHT_COLOR
vec3 lightColorHdr = model_lightColorHdr;
#else
vec3 lightColorHdr = czm_lightColorHdr;
#endif
vec3 color = inputMaterial.diffuse;
#ifdef HAS_NORMALS
color = czm_pbrLighting(
attributes.positionEC,
inputMaterial.normalEC,
czm_lightDirectionEC,
lightColorHdr,
pbrParameters
);
#ifdef USE_IBL_LIGHTING
color += imageBasedLightingStage(
attributes.positionEC,
inputMaterial.normalEC,
czm_lightDirectionEC,
lightColorHdr,
pbrParameters
);
#endif
#endif
color *= inputMaterial.occlusion;
color += inputMaterial.emissive;
// In HDR mode, the frame buffer is in linear color space. The
// post-processing stages (see PostProcessStageCollection) will handle
// tonemapping. However, if HDR is not enabled, we must tonemap else large
// values may be clamped to 1.0
#ifndef HDR
color = czm_acesTonemapping(color);
#endif
return color;
}
#endif
void lightingStage(inout czm_modelMaterial material, ProcessedAttributes attributes)
{
// Even though the lighting will only set the diffuse color,
// pass all other properties so further stages have access to them.
vec3 color = vec3(0.0);
#ifdef LIGHTING_PBR
color = computePbrLighting(material, attributes);
#else // unlit
color = material.diffuse;
#endif
#ifdef HAS_POINT_CLOUD_COLOR_STYLE
// The colors resulting from point cloud styles are adjusted differently.
color = czm_gammaCorrect(color);
#elif !defined(HDR)
// If HDR is not enabled, the frame buffer stores sRGB colors rather than
// linear colors so the linear value must be converted.
color = czm_linearToSrgb(color);
#endif
material.diffuse = color;
}
`;var kxn=T(S(),1),e5e={UNLIT:0,PBR:1},cf=Object.freeze(e5e);var Joe={name:"LightingPipelineStage"};Joe.process=function(e,t){let n=e.model,i=e.lightingOptions,o=e.shaderBuilder;if(l(n.lightColor)){o.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,Se.FRAGMENT),o.addUniform("vec3","model_lightColorHdr",Se.FRAGMENT);let s=e.uniformMap;s.model_lightColorHdr=function(){return n.lightColor}}i.lightingModel===cf.PBR?o.addDefine("LIGHTING_PBR",void 0,Se.FRAGMENT):o.addDefine("LIGHTING_UNLIT",void 0,Se.FRAGMENT),o.addFragmentLines(NX)};var UX=Joe;var d_n=T(S(),1);var Jxn=T(S(),1),kX=`// If the style color is white, it implies the feature has not been styled.
bool isDefaultStyleColor(vec3 color)
{
return all(greaterThan(color, vec3(1.0 - czm_epsilon3)));
}
vec3 blend(vec3 sourceColor, vec3 styleColor, float styleColorBlend)
{
vec3 blendColor = mix(sourceColor, styleColor, styleColorBlend);
vec3 color = isDefaultStyleColor(styleColor.rgb) ? sourceColor : blendColor;
return color;
}
vec2 computeTextureTransform(vec2 texCoord, mat3 textureTransform)
{
return vec2(textureTransform * vec3(texCoord, 1.0));
}
#ifdef HAS_NORMALS
vec3 computeNormal(ProcessedAttributes attributes)
{
// Geometry normal. This is already normalized
vec3 ng = attributes.normalEC;
vec3 normal = ng;
#if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME)
vec2 normalTexCoords = TEXCOORD_NORMAL;
#ifdef HAS_NORMAL_TEXTURE_TRANSFORM
normalTexCoords = computeTextureTransform(normalTexCoords, u_normalTextureTransform);
#endif
// If HAS_BITANGENTS is set, then HAS_TANGENTS is also set
#ifdef HAS_BITANGENTS
vec3 t = attributes.tangentEC;
vec3 b = attributes.bitangentEC;
mat3 tbn = mat3(t, b, ng);
vec3 n = texture(u_normalTexture, normalTexCoords).rgb;
normal = normalize(tbn * (2.0 * n - 1.0));
#elif (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
// If derivatives are available (not IE 10), compute tangents
vec3 positionEC = attributes.positionEC;
vec3 pos_dx = dFdx(positionEC);
vec3 pos_dy = dFdy(positionEC);
vec3 tex_dx = dFdx(vec3(normalTexCoords,0.0));
vec3 tex_dy = dFdy(vec3(normalTexCoords,0.0));
vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);
t = normalize(t - ng * dot(ng, t));
vec3 b = normalize(cross(ng, t));
mat3 tbn = mat3(t, b, ng);
vec3 n = texture(u_normalTexture, normalTexCoords).rgb;
normal = normalize(tbn * (2.0 * n - 1.0));
#endif
#endif
#ifdef HAS_DOUBLE_SIDED_MATERIAL
if (czm_backFacing()) {
normal = -normal;
}
#endif
return normal;
}
#endif
void materialStage(inout czm_modelMaterial material, ProcessedAttributes attributes, SelectedFeature feature)
{
#ifdef HAS_NORMALS
material.normalEC = computeNormal(attributes);
#endif
vec4 baseColorWithAlpha = vec4(1.0);
// Regardless of whether we use PBR, set a base color
#ifdef HAS_BASE_COLOR_TEXTURE
vec2 baseColorTexCoords = TEXCOORD_BASE_COLOR;
#ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM
baseColorTexCoords = computeTextureTransform(baseColorTexCoords, u_baseColorTextureTransform);
#endif
baseColorWithAlpha = czm_srgbToLinear(texture(u_baseColorTexture, baseColorTexCoords));
#ifdef HAS_BASE_COLOR_FACTOR
baseColorWithAlpha *= u_baseColorFactor;
#endif
#elif defined(HAS_BASE_COLOR_FACTOR)
baseColorWithAlpha = u_baseColorFactor;
#endif
#ifdef HAS_POINT_CLOUD_COLOR_STYLE
baseColorWithAlpha = v_pointCloudColor;
#elif defined(HAS_COLOR_0)
vec4 color = attributes.color_0;
// .pnts files store colors in the sRGB color space
#ifdef HAS_SRGB_COLOR
color = czm_srgbToLinear(color);
#endif
baseColorWithAlpha *= color;
#endif
material.diffuse = baseColorWithAlpha.rgb;
material.alpha = baseColorWithAlpha.a;
#ifdef USE_CPU_STYLING
material.diffuse = blend(material.diffuse, feature.color.rgb, model_colorBlend);
#endif
#ifdef HAS_OCCLUSION_TEXTURE
vec2 occlusionTexCoords = TEXCOORD_OCCLUSION;
#ifdef HAS_OCCLUSION_TEXTURE_TRANSFORM
occlusionTexCoords = computeTextureTransform(occlusionTexCoords, u_occlusionTextureTransform);
#endif
material.occlusion = texture(u_occlusionTexture, occlusionTexCoords).r;
#endif
#ifdef HAS_EMISSIVE_TEXTURE
vec2 emissiveTexCoords = TEXCOORD_EMISSIVE;
#ifdef HAS_EMISSIVE_TEXTURE_TRANSFORM
emissiveTexCoords = computeTextureTransform(emissiveTexCoords, u_emissiveTextureTransform);
#endif
vec3 emissive = czm_srgbToLinear(texture(u_emissiveTexture, emissiveTexCoords).rgb);
#ifdef HAS_EMISSIVE_FACTOR
emissive *= u_emissiveFactor;
#endif
material.emissive = emissive;
#elif defined(HAS_EMISSIVE_FACTOR)
material.emissive = u_emissiveFactor;
#endif
#if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS)
#ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE
vec2 specularGlossinessTexCoords = TEXCOORD_SPECULAR_GLOSSINESS;
#ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE_TRANSFORM
specularGlossinessTexCoords = computeTextureTransform(specularGlossinessTexCoords, u_specularGlossinessTextureTransform);
#endif
vec4 specularGlossiness = czm_srgbToLinear(texture(u_specularGlossinessTexture, specularGlossinessTexCoords));
vec3 specular = specularGlossiness.rgb;
float glossiness = specularGlossiness.a;
#ifdef HAS_SPECULAR_FACTOR
specular *= u_specularFactor;
#endif
#ifdef HAS_GLOSSINESS_FACTOR
glossiness *= u_glossinessFactor;
#endif
#else
#ifdef HAS_SPECULAR_FACTOR
vec3 specular = clamp(u_specularFactor, vec3(0.0), vec3(1.0));
#else
vec3 specular = vec3(1.0);
#endif
#ifdef HAS_GLOSSINESS_FACTOR
float glossiness = clamp(u_glossinessFactor, 0.0, 1.0);
#else
float glossiness = 1.0;
#endif
#endif
#ifdef HAS_DIFFUSE_TEXTURE
vec2 diffuseTexCoords = TEXCOORD_DIFFUSE;
#ifdef HAS_DIFFUSE_TEXTURE_TRANSFORM
diffuseTexCoords = computeTextureTransform(diffuseTexCoords, u_diffuseTextureTransform);
#endif
vec4 diffuse = czm_srgbToLinear(texture(u_diffuseTexture, diffuseTexCoords));
#ifdef HAS_DIFFUSE_FACTOR
diffuse *= u_diffuseFactor;
#endif
#elif defined(HAS_DIFFUSE_FACTOR)
vec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0));
#else
vec4 diffuse = vec4(1.0);
#endif
czm_pbrParameters parameters = czm_pbrSpecularGlossinessMaterial(
diffuse.rgb,
specular,
glossiness
);
material.diffuse = parameters.diffuseColor;
// the specular glossiness extension's alpha overrides anything set
// by the base material.
material.alpha = diffuse.a;
material.specular = parameters.f0;
material.roughness = parameters.roughness;
#elif defined(LIGHTING_PBR)
#ifdef HAS_METALLIC_ROUGHNESS_TEXTURE
vec2 metallicRoughnessTexCoords = TEXCOORD_METALLIC_ROUGHNESS;
#ifdef HAS_METALLIC_ROUGHNESS_TEXTURE_TRANSFORM
metallicRoughnessTexCoords = computeTextureTransform(metallicRoughnessTexCoords, u_metallicRoughnessTextureTransform);
#endif
vec3 metallicRoughness = texture(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb;
float metalness = clamp(metallicRoughness.b, 0.0, 1.0);
float roughness = clamp(metallicRoughness.g, 0.04, 1.0);
#ifdef HAS_METALLIC_FACTOR
metalness *= u_metallicFactor;
#endif
#ifdef HAS_ROUGHNESS_FACTOR
roughness *= u_roughnessFactor;
#endif
#else
#ifdef HAS_METALLIC_FACTOR
float metalness = clamp(u_metallicFactor, 0.0, 1.0);
#else
float metalness = 1.0;
#endif
#ifdef HAS_ROUGHNESS_FACTOR
float roughness = clamp(u_roughnessFactor, 0.04, 1.0);
#else
float roughness = 1.0;
#endif
#endif
czm_pbrParameters parameters = czm_pbrMetallicRoughnessMaterial(
material.diffuse,
metalness,
roughness
);
material.diffuse = parameters.diffuseColor;
material.specular = parameters.f0;
material.roughness = parameters.roughness;
#endif
}
`;var t5e=Mt.Material,$Y=Mt.MetallicRoughness,eH=Mt.SpecularGlossiness,Qoe={name:"MaterialPipelineStage",_processTexture:ry,_processTextureTransform:joe};Qoe.process=function(e,t,n){let i=t.material,o=e.model,r=l(o.classificationType),s=r,a=e.uniformMap,c=e.shaderBuilder,d=n.context.defaultTexture,u=n.context.defaultNormalTexture,m=n.context.defaultEmissiveTexture;n5e(i,a,c,d,u,m,s),l(i.specularGlossiness)?i5e(i,a,c,d,s):o5e(i,a,c,d,s);let p=qt.getAttributeBySemantic(t,_t.NORMAL),y=e.lightingOptions;i.unlit||!p||r?y.lightingModel=cf.UNLIT:y.lightingModel=cf.PBR;let f=o.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=f;let x=e.alphaOptions;i.alphaMode===sf.BLEND?x.pass=Ve.TRANSLUCENT:i.alphaMode===sf.MASK&&(x.alphaCutoff=i.alphaCutoff),c.addFragmentLines(kX),i.doubleSided&&c.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,Se.BOTH)};function joe(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_TRANSFORM`;e.addDefine(r,void 0,Se.FRAGMENT);let s=`${i}Transform`;e.addUniform("mat3",s,Se.FRAGMENT),t[s]=function(){return n.transform}}function ry(e,t,n,i,o,r){e.addUniform("sampler2D",i,Se.FRAGMENT),t[i]=function(){return g(n.texture,r)};let s=`HAS_${o}_TEXTURE`;e.addDefine(s,void 0,Se.FRAGMENT);let c=`v_texCoord_${n.texCoord}`,d=`TEXCOORD_${o}`;e.addDefine(d,c,Se.FRAGMENT);let u=n.transform;l(u)&&!q.equals(u,q.IDENTITY)&&joe(e,t,n,i,o)}function n5e(e,t,n,i,o,r,s){let a=e.emissiveFactor;if(l(a)&&!h.equals(a,t5e.DEFAULT_EMISSIVE_FACTOR)){n.addUniform("vec3","u_emissiveFactor",Se.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},n.addDefine("HAS_EMISSIVE_FACTOR",void 0,Se.FRAGMENT);let u=e.emissiveTexture;l(u)&&!s&&ry(n,t,u,"u_emissiveTexture","EMISSIVE",r)}let c=e.normalTexture;l(c)&&!s&&ry(n,t,c,"u_normalTexture","NORMAL",o);let d=e.occlusionTexture;l(d)&&!s&&ry(n,t,d,"u_occlusionTexture","OCCLUSION",i)}function i5e(e,t,n,i,o){let r=e.specularGlossiness;n.addDefine("USE_SPECULAR_GLOSSINESS",void 0,Se.FRAGMENT);let s=r.diffuseTexture;l(s)&&!o&&ry(n,t,s,"u_diffuseTexture","DIFFUSE",i);let a=r.diffuseFactor;l(a)&&!se.equals(a,eH.DEFAULT_DIFFUSE_FACTOR)&&(n.addUniform("vec4","u_diffuseFactor",Se.FRAGMENT),t.u_diffuseFactor=function(){return r.diffuseFactor},n.addDefine("HAS_DIFFUSE_FACTOR",void 0,Se.FRAGMENT));let c=r.specularGlossinessTexture;l(c)&&!o&&ry(n,t,c,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i);let d=r.specularFactor;l(d)&&!h.equals(d,eH.DEFAULT_SPECULAR_FACTOR)&&(n.addUniform("vec3","u_specularFactor",Se.FRAGMENT),t.u_specularFactor=function(){return r.specularFactor},n.addDefine("HAS_SPECULAR_FACTOR",void 0,Se.FRAGMENT));let u=r.glossinessFactor;l(u)&&u!==eH.DEFAULT_GLOSSINESS_FACTOR&&(n.addUniform("float","u_glossinessFactor",Se.FRAGMENT),t.u_glossinessFactor=function(){return r.glossinessFactor},n.addDefine("HAS_GLOSSINESS_FACTOR",void 0,Se.FRAGMENT))}function o5e(e,t,n,i,o){let r=e.metallicRoughness;n.addDefine("USE_METALLIC_ROUGHNESS",void 0,Se.FRAGMENT);let s=r.baseColorTexture;l(s)&&!o&&ry(n,t,s,"u_baseColorTexture","BASE_COLOR",i);let a=r.baseColorFactor;l(a)&&!se.equals(a,$Y.DEFAULT_BASE_COLOR_FACTOR)&&(n.addUniform("vec4","u_baseColorFactor",Se.FRAGMENT),t.u_baseColorFactor=function(){return r.baseColorFactor},n.addDefine("HAS_BASE_COLOR_FACTOR",void 0,Se.FRAGMENT));let c=r.metallicRoughnessTexture;l(c)&&!o&&ry(n,t,c,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let d=r.metallicFactor;l(d)&&d!==$Y.DEFAULT_METALLIC_FACTOR&&(n.addUniform("float","u_metallicFactor",Se.FRAGMENT),t.u_metallicFactor=function(){return r.metallicFactor},n.addDefine("HAS_METALLIC_FACTOR",void 0,Se.FRAGMENT));let u=r.roughnessFactor;l(u)&&u!==$Y.DEFAULT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_roughnessFactor",Se.FRAGMENT),t.u_roughnessFactor=function(){return r.roughnessFactor},n.addDefine("HAS_ROUGHNESS_FACTOR",void 0,Se.FRAGMENT))}var DX=Qoe;var __n=T(S(),1);var m_n=T(S(),1),BX=`void morphTargetsStage(inout ProcessedAttributes attributes)
{
vec3 positionMC = attributes.positionMC;
attributes.positionMC = getMorphedPosition(positionMC);
#ifdef HAS_NORMALS
vec3 normalMC = attributes.normalMC;
attributes.normalMC = getMorphedNormal(normalMC);
#endif
#ifdef HAS_TANGENTS
vec3 tangentMC = attributes.tangentMC;
attributes.tangentMC = getMorphedTangent(tangentMC);
#endif
}`;var Ea={name:"MorphTargetsPipelineStage",FUNCTION_ID_GET_MORPHED_POSITION:"getMorphedPosition",FUNCTION_SIGNATURE_GET_MORPHED_POSITION:"vec3 getMorphedPosition(in vec3 position)",FUNCTION_ID_GET_MORPHED_NORMAL:"getMorphedNormal",FUNCTION_SIGNATURE_GET_MORPHED_NORMAL:"vec3 getMorphedNormal(in vec3 normal)",FUNCTION_ID_GET_MORPHED_TANGENT:"getMorphedTangent",FUNCTION_SIGNATURE_GET_MORPHED_TANGENT:"vec3 getMorphedTangent(in vec3 tangent)"};Ea.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,Se.VERTEX),d5e(n);let i=t.morphTargets.length;for(let a=0;a<i;a++){let c=t.morphTargets[a].attributes,d=c.length;for(let u=0;u<d;u++){let m=c[u],p=m.semantic;p!==_t.POSITION&&p!==_t.NORMAL&&p!==_t.TANGENT||(s5e(e,m,e.attributeIndex,a),e.attributeIndex++)}}u5e(n);let r=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${r}]`,Se.VERTEX),n.addVertexLines(BX);let s={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=Tt(s,e.uniformMap)};var r5e={attributeString:void 0,functionId:void 0};function s5e(e,t,n,i){let o=e.shaderBuilder;a5e(e,t,n);let r=c5e(t,r5e);l5e(o,r,i)}function a5e(e,t,n){let i={index:n,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,componentsPerAttribute:tn.getNumberOfComponents(t.type),componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(i)}function c5e(e,t){switch(e.semantic){case _t.POSITION:t.attributeString="Position",t.functionId=Ea.FUNCTION_ID_GET_MORPHED_POSITION;break;case _t.NORMAL:t.attributeString="Normal",t.functionId=Ea.FUNCTION_ID_GET_MORPHED_NORMAL;break;case _t.TANGENT:t.attributeString="Tangent",t.functionId=Ea.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function l5e(e,t,n){let i=t.attributeString,o=`a_target${i}_${n}`,r=`morphed${i} += u_morphWeights[${n}] * a_target${i}_${n};`;e.addAttribute("vec3",o),e.addFunctionLines(t.functionId,[r])}function d5e(e){e.addFunction(Ea.FUNCTION_ID_GET_MORPHED_POSITION,Ea.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,Se.VERTEX),e.addFunctionLines(Ea.FUNCTION_ID_GET_MORPHED_POSITION,["vec3 morphedPosition = position;"]),e.addFunction(Ea.FUNCTION_ID_GET_MORPHED_NORMAL,Ea.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,Se.VERTEX),e.addFunctionLines(Ea.FUNCTION_ID_GET_MORPHED_NORMAL,["vec3 morphedNormal = normal;"]),e.addFunction(Ea.FUNCTION_ID_GET_MORPHED_TANGENT,Ea.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,Se.VERTEX),e.addFunctionLines(Ea.FUNCTION_ID_GET_MORPHED_TANGENT,["vec3 morphedTangent = tangent;"])}function u5e(e){e.addFunctionLines(Ea.FUNCTION_ID_GET_MORPHED_POSITION,["return morphedPosition;"]),e.addFunctionLines(Ea.FUNCTION_ID_GET_MORPHED_NORMAL,["return morphedNormal;"]),e.addFunctionLines(Ea.FUNCTION_ID_GET_MORPHED_TANGENT,["return morphedTangent;"])}var OX=Ea;var X_n=T(S(),1);var qoe={name:"PickingPipelineStage"};qoe.process=function(e,t,n){let i=n.context,o=e.runtimeNode,r=e.shaderBuilder,s=e.model,a=o.node.instances;if(e.hasPropertyTable)m5e(e,t,a,i);else if(l(a))h5e(e,i);else{let c=$oe(e),d=i.createPickId(c);s._pipelineResources.push(d),s._pickIds.push(d),r.addUniform("vec4","czm_pickColor",Se.FRAGMENT);let u=e.uniformMap;u.czm_pickColor=function(){return d.color},e.pickId="czm_pickColor"}};function $oe(e,t){let n=e.model;if(l(n.pickObject))return n.pickObject;let i={model:n,node:e.runtimeNode,primitive:e.runtimePrimitive},o;if(cr.is3DTiles(n.type)){let r=n.content;o={content:r,primitive:r.tileset,detail:i}}else o={primitive:n,detail:i};return o.id=n.id,l(t)&&(o.instanceId=t),o}function m5e(e,t,n){let i=e.model,o,r,s=i.featureIdLabel,a=i.instanceFeatureIdLabel;l(i.featureTableId)?o=i.featureTableId:l(n)?(r=qt.getFeatureIdsByLabel(n.featureIds,a),o=r.propertyTableId):(r=qt.getFeatureIdsByLabel(t.featureIds,s),o=r.propertyTableId);let c=i.featureTables[o];e.shaderBuilder.addUniform("sampler2D","model_pickTexture",Se.FRAGMENT);let u=c.batchTexture;e.uniformMap.model_pickTexture=function(){return g(u.pickTexture,u.defaultTexture)},e.pickId="((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))"}function h5e(e,t){let n=e.instanceCount,i=new Array(n),o=new Uint8Array(n*4),r=e.model,s=r._pipelineResources;for(let m=0;m<n;m++){let p=$oe(e,m),y=t.createPickId(p);s.push(y),i[m]=y;let f=y.color;o[m*4+0]=O.floatToByte(f.red),o[m*4+1]=O.floatToByte(f.green),o[m*4+2]=O.floatToByte(f.blue),o[m*4+3]=O.floatToByte(f.alpha)}r._pickIds=i;let a=ft.createVertexBuffer({context:t,typedArray:o,usage:Ue.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.statistics.addBuffer(a,!1),s.push(a);let d={index:e.attributeIndex++,vertexBuffer:a,componentsPerAttribute:4,componentDatatype:Q.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1};e.attributes.push(d);let u=e.shaderBuilder;u.addDefine("USE_PICKING",void 0,Se.BOTH),u.addAttribute("vec4","a_pickColor"),u.addVarying("vec4","v_pickColor"),e.pickId="v_pickColor"}var YX=qoe;var eTn=T(S(),1);var P_n=T(S(),1),f5e={ADD:0,REPLACE:1},Ao=Object.freeze(f5e);var w_n=T(S(),1),HX=`float getPointSizeFromAttenuation(vec3 positionEC) {
// Variables are packed into a single vector to minimize gl.uniformXXX() calls
float pointSize = model_pointCloudParameters.x;
float geometricError = model_pointCloudParameters.y;
float depthMultiplier = model_pointCloudParameters.z;
float depth = -positionEC.z;
return min((geometricError / depth) * depthMultiplier, pointSize);
}
#ifdef HAS_POINT_CLOUD_SHOW_STYLE
float pointCloudShowStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
float tiles3d_tileset_time = model_pointCloudParameters.w;
return float(getShowFromStyle(attributes, metadata, tiles3d_tileset_time));
}
#endif
#ifdef HAS_POINT_CLOUD_COLOR_STYLE
vec4 pointCloudColorStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
float tiles3d_tileset_time = model_pointCloudParameters.w;
return getColorFromStyle(attributes, metadata, tiles3d_tileset_time);
}
#endif
#ifdef HAS_POINT_CLOUD_POINT_SIZE_STYLE
float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
float tiles3d_tileset_time = model_pointCloudParameters.w;
return float(getPointSizeFromStyle(attributes, metadata, tiles3d_tileset_time));
}
#elif defined(HAS_POINT_CLOUD_ATTENUATION)
float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
return getPointSizeFromAttenuation(v_positionEC);
}
#endif
#ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING
float pointCloudBackFaceCullingStage() {
#if defined(HAS_NORMALS) && !defined(HAS_DOUBLE_SIDED_MATERIAL)
// This needs to be computed in eye coordinates so we can't use attributes.normalMC
return step(-v_normalEC.z, 0.0);
#else
return 1.0;
#endif
}
#endif`;var p5e=new se,tre={name:"PointCloudStylingPipelineStage"};tre.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=o.style,s=o.structuralMetadata,a=l(s)?s.propertyAttributes:void 0,c=l(o.featureTableId)&&o.featureTables[o.featureTableId].featuresLength>0,d=!l(a)&&c;if(l(r)&&!d){let x=x5e(a),_=_5e(r,x);T5e(i,_);let V=S5e(_).indexOf("normalMC")>=0,L=qt.getAttributeBySemantic(t,_t.NORMAL);if(V&&!L)throw new me("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,Se.VERTEX),_.styleTranslucent&&(e.alphaOptions.pass=Ve.TRANSLUCENT)}let u=o.pointCloudShading;u.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,Se.VERTEX),u.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,Se.VERTEX);let m,p,y;cr.is3DTiles(o.type)&&(p=!0,m=o.content,y=m.tile.refine===Ao.ADD),i.addUniform("vec4","model_pointCloudParameters",Se.VERTEX),i.addVertexLines(HX);let f=e.uniformMap;f.model_pointCloudParameters=function(){let x=p5e,_=1;p&&(_=y?5:m.tileset.memoryAdjustedScreenSpaceError),x.x=g(u.maximumAttenuation,_),x.x*=n.pixelRatio;let C=b5e(e,t,u,m);x.y=C*u.geometricErrorScale;let V=n.context,L=n.camera.frustum,Z;return n.mode===ie.SCENE2D||L instanceof rn?Z=Number.POSITIVE_INFINITY:Z=V.drawingBufferHeight/n.camera.frustum.sseDenominator,x.z=Z,p&&(x.w=m.tileset.timeSinceLoad),x}};var ere=new h;function b5e(e,t,n,i){if(l(i)){let u=i.tile.geometricError;if(u>0)return u}if(l(n.baseResolution))return n.baseResolution;let o=qt.getAttributeBySemantic(t,_t.POSITION),r=o.count,s=e.runtimeNode.transform,a=h.subtract(o.max,o.min,ere);a=A.multiplyByPointAsVector(s,a,ere);let c=a.x*a.y*a.z;return W.cbrt(c/r)}var y5e={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},g5e={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function x5e(e){let t=ze(g5e);if(!l(e))return t;for(let n=0;n<e.length;n++){let o=e[n].properties;for(let r in o)o.hasOwnProperty(r)&&(t[r]=`metadata.${r}`)}return t}var tH="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function _5e(e,t){let n=y5e,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${tH})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${tH})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${tH})`,t,i),n.styleTranslucent=l(n.colorStyleFunction)&&i.translucent,n}function T5e(e,t){let n=t.colorStyleFunction;l(n)&&(e.addDefine("HAS_POINT_CLOUD_COLOR_STYLE",void 0,Se.BOTH),e.addVertexLines(n),e.addVarying("vec4","v_pointCloudColor"));let i=t.showStyleFunction;l(i)&&(e.addDefine("HAS_POINT_CLOUD_SHOW_STYLE",void 0,Se.VERTEX),e.addVertexLines(i));let o=t.pointSizeStyleFunction;l(o)&&(e.addDefine("HAS_POINT_CLOUD_POINT_SIZE_STYLE",void 0,Se.VERTEX),e.addVertexLines(o))}function nH(e,t){let n=/attributes\.(\w+)/g,i=n.exec(e);for(;i!==null;){let o=i[1];t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function S5e(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,o=[];return l(t)&&nH(t,o),l(n)&&nH(n,o),l(i)&&nH(i,o),o}var KX=tre;var uTn=T(S(),1);var nTn=T(S(),1),zX=`void primitiveOutlineStage() {
v_outlineCoordinates = a_outlineCoordinates;
}
`;var oTn=T(S(),1),JX=`void primitiveOutlineStage(inout czm_modelMaterial material) {
if (!model_showOutline) {
return;
}
float outlineX =
texture(model_outlineTexture, vec2(v_outlineCoordinates.x, 0.5)).r;
float outlineY =
texture(model_outlineTexture, vec2(v_outlineCoordinates.y, 0.5)).r;
float outlineZ =
texture(model_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r;
float outlineness = max(outlineX, max(outlineY, outlineZ));
material.diffuse = mix(material.diffuse, model_outlineColor.rgb, model_outlineColor.a * outlineness);
}
`;var nre={name:"PrimitiveOutlinePipelineStage"};nre.process=function(e,t,n){let i=e.shaderBuilder,o=e.uniformMap;i.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,Se.BOTH),i.addAttribute("vec3","a_outlineCoordinates"),i.addVarying("vec3","v_outlineCoordinates");let r=t.outlineCoordinates,s={index:e.attributeIndex++,vertexBuffer:r.buffer,componentsPerAttribute:tn.getNumberOfComponents(r.type),componentDatatype:r.componentDatatype,offsetInBytes:r.byteOffset,strideInBytes:r.byteStride,normalize:r.normalized};e.attributes.push(s),i.addUniform("sampler2D","model_outlineTexture",Se.FRAGMENT);let a=qx.createTexture(n.context);o.model_outlineTexture=function(){return a};let c=e.model;i.addUniform("vec4","model_outlineColor",Se.FRAGMENT),o.model_outlineColor=function(){return c.outlineColor},i.addUniform("bool","model_showOutline",Se.FRAGMENT),o.model_showOutline=function(){return c.showOutline},i.addVertexLines(zX),i.addFragmentLines(JX)};var QX=nre;var yTn=T(S(),1);var ire={name:"PrimitiveStatisticsPipelineStage",_countGeometry:ore,_count2DPositions:rre,_countMorphTargetAttributes:sre,_countMaterialTextures:are,_countFeatureIdTextures:cre,_countBinaryMetadata:lre};ire.process=function(e,t,n){let i=e.model,o=i.statistics;ore(o,t),rre(o,e.runtimePrimitive),sre(o,t),are(o,t.material),cre(o,t.featureIds),lre(o,i)};function ore(e,t){let n=l(t.indices)?t.indices.count:qt.getAttributeBySemantic(t,"POSITION").count,i=t.primitiveType;i===Ae.POINTS?e.pointsLength+=n:Ae.isTriangles(i)&&(e.trianglesLength+=C5e(i,n));let o=t.attributes,r=o.length;for(let c=0;c<r;c++){let d=o[c];if(l(d.buffer)){let u=l(d.typedArray);e.addBuffer(d.buffer,u)}}let s=t.outlineCoordinates;l(s)&&l(s.buffer)&&e.addBuffer(s.buffer,!1);let a=t.indices;if(l(a)&&l(a.buffer)){let c=l(a.typedArray);e.addBuffer(a.buffer,c)}}function C5e(e,t){switch(e){case Ae.TRIANGLES:return t/3;case Ae.TRIANGLE_STRIP:case Ae.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function rre(e,t){let n=t.positionBuffer2D;l(n)&&e.addBuffer(n,!0)}function sre(e,t){let n=t.morphTargets;if(!l(n))return;let i=!1,o=n.length;for(let r=0;r<o;r++){let s=n[r].attributes,a=s.length;for(let c=0;c<a;c++){let d=s[c];l(d.buffer)&&e.addBuffer(d.buffer,i)}}}function are(e,t){let n=V5e(t),i=n.length;for(let o=0;o<i;o++){let r=n[o];l(r)&&l(r.texture)&&e.addTexture(r.texture)}}function V5e(e){let t=e.metallicRoughness,n=[e.emissiveTexture,e.normalTexture,e.occlusionTexture,t.baseColorTexture,t.metallicRoughnessTexture],i=e.specularGlossiness;return l(i)&&(n.push(i.diffuseTexture),n.push(i.specularGlossinessTexture)),n}function cre(e,t){let n=t.length;for(let i=0;i<n;i++){let o=t[i];if(o instanceof Mt.FeatureIdTexture){let r=o.textureReader;l(r.texture)&&e.addTexture(r.texture)}}}function lre(e,t){let n=t.structuralMetadata;l(n)&&(L5e(e,n),e.propertyTablesByteLength+=n.propertyTablesByteLength);let i=t.featureTables;if(!l(i))return;let o=i.length;for(let r=0;r<o;r++){let s=i[r];e.addBatchTexture(s.batchTexture)}}function L5e(e,t){let n=t.propertyTextures;if(!l(n))return;let i=n.length;for(let o=0;o<i;o++){let s=n[o].properties;for(let a in s)if(s.hasOwnProperty(a)){let d=s[a].textureReader;l(d.texture)&&e.addTexture(d.texture)}}}var jX=ire;var WTn=T(S(),1);var R5e=new A,Z5e=new A,dre={name:"SceneMode2DPipelineStage"};dre.process=function(e,t,n){let i=qt.getAttributeBySemantic(t,_t.POSITION),o=e.shaderBuilder,r=e.model,s=r.sceneGraph.computedModelMatrix,a=e.runtimeNode.computedTransform,c=A.multiplyTransformation(s,a,R5e),d=I5e(e,c,n),u=e.runtimePrimitive;u.boundingSphere2D=d;let m=e.runtimeNode.node.instances;if(l(m))return;if(l(i.typedArray)){let x=P5e(i,c,d,n);u.positionBuffer2D=x,r._modelResources.push(x),i.typedArray=void 0}o.addDefine("USE_2D_POSITIONS",void 0,Se.VERTEX),o.addUniform("mat4","u_modelView2D",Se.VERTEX);let p=A.fromTranslation(d.center,new A),y=n.context,f={u_modelView2D:function(){return A.multiplyTransformation(y.uniformState.view,p,Z5e)}};e.uniformMap=Tt(f,e.uniformMap)};var G5e=new h,E5e=new h;function I5e(e,t,n){let i=A.multiplyByPoint(t,e.positionMin,G5e),o=to.computeActualWgs84Position(n,i,i),r=A.multiplyByPoint(t,e.positionMax,E5e),s=to.computeActualWgs84Position(n,r,r);return ce.fromCornerPoints(o,s,new ce)}var ure=new h;function X5e(e,t){let n=e.length,i=new Float32Array(n),o=t.quantizedVolumeOffset,r=t.quantizedVolumeStepSize;for(let s=0;s<n;s+=3){let a=h.fromArray(e,s,ure),c=h.multiplyComponents(a,r,a),d=h.add(c,o,c);i[s]=d.x,i[s+1]=d.y,i[s+2]=d.z}return i}function W5e(e,t,n,i){let o;l(e.quantization)?o=X5e(e.typedArray,e.quantization):o=e.typedArray.slice();let r=e.byteOffset/Float32Array.BYTES_PER_ELEMENT,s=o.length,a=l(e.byteStride)?e.byteStride/Float32Array.BYTES_PER_ELEMENT:3;for(let c=r;c<s;c+=a){let d=h.fromArray(o,c,ure);if(isNaN(d.x)||isNaN(d.y)||isNaN(d.z))continue;let u=A.multiplyByPoint(t,d,d),m=to.computeActualWgs84Position(i,u,u),p=h.subtract(m,n,m);o[c]=p.x,o[c+1]=p.y,o[c+2]=p.z}return o}function P5e(e,t,n,i){let o=ze(i);o.mode=ie.COLUMBUS_VIEW;let r=n.center,s=W5e(e,t,r,o),a=ft.createVertexBuffer({context:i.context,typedArray:s,usage:Ue.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}var qX=dre;var UTn=T(S(),1);var vTn=T(S(),1),$X=`void skinningStage(inout ProcessedAttributes attributes)
{
mat4 skinningMatrix = getSkinningMatrix();
mat3 skinningMatrixMat3 = mat3(skinningMatrix);
vec4 positionMC = vec4(attributes.positionMC, 1.0);
attributes.positionMC = vec3(skinningMatrix * positionMC);
#ifdef HAS_NORMALS
vec3 normalMC = attributes.normalMC;
attributes.normalMC = skinningMatrixMat3 * normalMC;
#endif
#ifdef HAS_TANGENTS
vec3 tangentMC = attributes.tangentMC;
attributes.tangentMC = skinningMatrixMat3 * tangentMC;
#endif
}`;var i_={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};i_.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,Se.VERTEX),w5e(n,t);let i=e.runtimeNode,o=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${o.length}]`,Se.VERTEX),n.addVertexLines($X);let r={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=Tt(r,e.uniformMap)};function v5e(e){let t=-1,n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];(r.semantic===_t.JOINTS||r.semantic===_t.WEIGHTS)&&(t=Math.max(t,r.setIndex))}return t}function w5e(e,t){e.addFunction(i_.FUNCTION_ID_GET_SKINNING_MATRIX,i_.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,Se.VERTEX),e.addFunctionLines(i_.FUNCTION_ID_GET_SKINNING_MATRIX,["mat4 skinnedMatrix = mat4(0);"]);let i,o,r=["x","y","z","w"],s=v5e(t);for(i=0;i<=s;i++)for(o=0;o<=3;o++){let c=r[o],d=`skinnedMatrix += a_weights_${i}.${c} * u_jointMatrices[int(a_joints_${i}.${c})];`;e.addFunctionLines(i_.FUNCTION_ID_GET_SKINNING_MATRIX,[d])}e.addFunctionLines(i_.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}var eW=i_;var KTn=T(S(),1);var DTn=T(S(),1),tW=`void verticalExaggerationStage(
inout ProcessedAttributes attributes
) {
// Compute the distance from the camera to the local center of curvature.
vec4 vertexPositionENU = czm_modelToEnu * vec4(attributes.positionMC, 1.0);
vec2 vertexAzimuth = normalize(vertexPositionENU.xy);
// Curvature = 1 / radius of curvature.
float azimuthalCurvature = dot(vertexAzimuth * vertexAzimuth, czm_eyeEllipsoidCurvature);
float eyeToCenter = 1.0 / azimuthalCurvature + czm_eyeHeight;
// Compute the approximate ellipsoid normal at the vertex position.
// Uses a circular approximation for the Earth curvature along the geodesic.
vec3 vertexPositionEC = (czm_modelView * vec4(attributes.positionMC, 1.0)).xyz;
vec3 centerToVertex = eyeToCenter * czm_eyeEllipsoidNormalEC + vertexPositionEC;
vec3 vertexNormal = normalize(centerToVertex);
// Estimate the (sine of the) angle between the camera direction and the vertex normal
float verticalDistance = dot(vertexPositionEC, czm_eyeEllipsoidNormalEC);
float horizontalDistance = length(vertexPositionEC - verticalDistance * czm_eyeEllipsoidNormalEC);
float sinTheta = horizontalDistance / (eyeToCenter + verticalDistance);
bool isSmallAngle = clamp(sinTheta, 0.0, 0.05) == sinTheta;
// Approximate the change in height above the ellipsoid, from camera to vertex position.
float exactVersine = 1.0 - dot(czm_eyeEllipsoidNormalEC, vertexNormal);
float smallAngleVersine = 0.5 * sinTheta * sinTheta;
float versine = isSmallAngle ? smallAngleVersine : exactVersine;
float dHeight = dot(vertexPositionEC, vertexNormal) - eyeToCenter * versine;
float vertexHeight = czm_eyeHeight + dHeight;
// Transform the approximate vertex normal to model coordinates.
vec3 vertexNormalMC = (czm_inverseModelView * vec4(vertexNormal, 0.0)).xyz;
vertexNormalMC = normalize(vertexNormalMC);
// Compute the exaggeration and apply it along the approximate vertex normal.
float stretch = u_verticalExaggerationAndRelativeHeight.x;
float shift = u_verticalExaggerationAndRelativeHeight.y;
float exaggeration = (vertexHeight - shift) * (stretch - 1.0);
attributes.positionMC += exaggeration * vertexNormalMC;
}
`;var mre={name:"VerticalExaggerationPipelineStage"},F5e=new B;mre.process=function(e,t,n){let{shaderBuilder:i,uniformMap:o}=e;i.addVertexLines(tW),i.addDefine("HAS_VERTICAL_EXAGGERATION",void 0,Se.VERTEX),i.addUniform("vec2","u_verticalExaggerationAndRelativeHeight",Se.VERTEX),o.u_verticalExaggerationAndRelativeHeight=function(){return B.fromElements(n.verticalExaggeration,n.verticalExaggerationRelativeHeight,F5e)}};var nW=mre;var lSn=T(S(),1);var qTn=T(S(),1);var iH={};function A5e(e){let t=Ne.createTypedArray(e,e*2),n=e,i=0;for(let o=0;o<n;o+=3)t[i++]=o,t[i++]=o+1,t[i++]=o+1,t[i++]=o+2,t[i++]=o+2,t[i++]=o;return t}function M5e(e,t){let n=t.length,i=Ne.createTypedArray(e,n*2),o=0;for(let r=0;r<n;r+=3){let s=t[r],a=t[r+1],c=t[r+2];i[o++]=s,i[o++]=a,i[o++]=a,i[o++]=c,i[o++]=c,i[o++]=s}return i}function N5e(e){let t=e-2,n=2+t*4,i=Ne.createTypedArray(e,n),o=0;i[o++]=0,i[o++]=1;for(let r=0;r<t;r++)i[o++]=r+1,i[o++]=r+2,i[o++]=r+2,i[o++]=r;return i}function U5e(e,t){let i=t.length-2,o=2+i*4,r=Ne.createTypedArray(e,o),s=0;r[s++]=t[0],r[s++]=t[1];for(let a=0;a<i;a++){let c=t[a],d=t[a+1],u=t[a+2];r[s++]=d,r[s++]=u,r[s++]=u,r[s++]=c}return r}function k5e(e){let t=e-2,n=2+t*4,i=Ne.createTypedArray(e,n),o=0;i[o++]=0,i[o++]=1;for(let r=0;r<t;r++)i[o++]=r+1,i[o++]=r+2,i[o++]=r+2,i[o++]=0;return i}function D5e(e,t){let i=t.length-2,o=2+i*4,r=Ne.createTypedArray(e,o),s=0,a=t[0];r[s++]=a,r[s++]=t[1];for(let c=0;c<i;c++){let d=t[c+1],u=t[c+2];r[s++]=d,r[s++]=u,r[s++]=u,r[s++]=a}return r}iH.createWireframeIndices=function(e,t,n){let i=l(n);if(e===Ae.TRIANGLES)return i?M5e(t,n):A5e(t);if(e===Ae.TRIANGLE_STRIP)return i?U5e(t,n):N5e(t);if(e===Ae.TRIANGLE_FAN)return i?D5e(t,n):k5e(t)};iH.getWireframeIndicesCount=function(e,t){return e===Ae.TRIANGLES?t*2:e===Ae.TRIANGLE_STRIP||e===Ae.TRIANGLE_FAN?2+(t-2)*4:t};var XC=iH;var hre={name:"WireframePipelineStage"};hre.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,Se.FRAGMENT);let o=e.model,r=B5e(t,e.indices,n);o._pipelineResources.push(r),e.wireframeIndexBuffer=r,o.statistics.addBuffer(r,!1);let a=e.primitiveType,c=e.count;e.primitiveType=Ae.LINES,e.count=XC.getWireframeIndicesCount(a,c)};function B5e(e,t,n){let o=qt.getAttributeBySemantic(e,_t.POSITION).count,r=n.context.webgl2,s;if(l(t)){let u=t.buffer,m=t.count;l(u)&&r?(s=u.sizeInBytes===m?new Uint8Array(m):Ne.createTypedArray(o,m),u.getBufferData(s)):s=t.typedArray}let a=e.primitiveType,c=XC.createWireframeIndices(a,o,s),d=Ne.fromSizeInBytes(c.BYTES_PER_ELEMENT);return ft.createIndexBuffer({context:n.context,typedArray:c,usage:Ue.STATIC_DRAW,indexDatatype:d})}var iW=hre;function fre(e){e=g(e,g.EMPTY_OBJECT);let t=e.primitive,n=e.node,i=e.model;this.primitive=t,this.node=n,this.model=i,this.pipelineStages=[],this.drawCommand=void 0,this.boundingSphere=void 0,this.boundingSphere2D=void 0,this.positionBuffer2D=void 0,this.batchLengths=void 0,this.batchOffsets=void 0,this.updateStages=[]}fre.prototype.configurePipeline=function(e){let t=this.pipelineStages;t.length=0;let n=this.primitive,i=this.node,o=this.model,r=o.customShader;if(l(o._marsOptions)&&l(o._marsOptions.customShaders)){let F=ip.getCache(o._marsOptions.customShaders);for(let M in F)if(Object.prototype.hasOwnProperty.call(F,M)){r=F[M];break}}let s=o.style,a=e.context.webgl2,d=e.mode!==ie.SCENE3D&&!e.scene3DOnly&&o._projectTo2D,u=e.verticalExaggeration!==1,m=l(n.morphTargets)&&n.morphTargets.length>0,p=l(i.skin),y=l(r),x=!(y&&l(r.fragmentShaderText))||r.mode!==qp.REPLACE_MATERIAL,_=qt.hasQuantizedAttributes(n.attributes),C=o.debugWireframe&&Ae.isTriangles(n.primitiveType)&&(o._enableDebugWireframe||a),V=o.pointCloudShading,L=l(V)&&V.attenuation,Z=l(V)&&V.backFaceCulling,G=n.primitiveType===Ae.POINTS&&(l(s)||L||Z),I=o._enableShowOutline&&l(n.outlineCoordinates),P=O5e(o,i,n),v=l(o.classificationType);d&&t.push(qX),t.push(MX),C&&t.push(iW),v&&t.push(SX),m&&t.push(OX),p&&t.push(eW),G&&t.push(KX),_&&t.push(vX),x&&t.push(DX),t.push(ny),t.push(fu),P.hasPropertyTable&&(t.push(oy),t.push(TX),t.push(LX)),u&&t.push(nW),y&&t.push(WX),t.push(UX),o.allowPicking&&t.push(YX),I&&t.push(QX),t.push(_X),t.push(jX)};function O5e(e,t,n){let i;return l(t.instances)&&(i=qt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(i))?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:(i=qt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),l(i)?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var oW=fre;var BSn=T(S(),1);function oH(e){e=g(e,g.EMPTY_OBJECT),this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],Y5e(this)}Object.defineProperties(oH.prototype,{skin:{get:function(){return this._skin}},sceneGraph:{get:function(){return this._sceneGraph}},inverseBindMatrices:{get:function(){return this._inverseBindMatrices}},joints:{get:function(){return this._joints}},jointMatrices:{get:function(){return this._jointMatrices}}});function Y5e(e){let t=e.skin,n=t.inverseBindMatrices;e._inverseBindMatrices=n;let i=t.joints,o=i.length,r=e.sceneGraph._runtimeNodes,s=e.joints,a=e._jointMatrices;for(let c=0;c<o;c++){let d=i[c].index,u=r[d];s.push(u);let m=n[c],p=pre(u,m,new A);a.push(p)}}function pre(e,t,n){let i=A.multiplyTransformation(e.transformToRoot,e.transform,n);return n=A.multiplyTransformation(i,t,n),n}oH.prototype.updateJointMatrices=function(){let e=this._jointMatrices,t=e.length;for(let n=0;n<t;n++){let i=this.joints[n],o=this.inverseBindMatrices[n];e[n]=pre(i,o,e[n])}};var rW=oH;var uCn=T(S(),1);var YSn=T(S(),1);function H5e(){this.pass=void 0,this.alphaCutoff=void 0}var sW=H5e;var rCn=T(S(),1);var KSn=T(S(),1);function rH(e){this.name=e,this.fields=[]}rH.prototype.addField=function(e,t){let n=` ${e} ${t};`;this.fields.push(n)};rH.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=[" float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var aW=rH;var JSn=T(S(),1);function sH(e){this.signature=e,this.body=[]}sH.prototype.addLines=function(e){let t=this.body;if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;i++)t.push(` ${e[i]}`)}else t.push(` ${e}`)};sH.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};var cW=sH;function Oc(){this._positionAttributeLine=void 0,this._nextAttributeLocation=1,this._attributeLocations={},this._attributeLines=[],this._structs={},this._functions={},this._vertexShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]},this._fragmentShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]}}Object.defineProperties(Oc.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});Oc.prototype.addDefine=function(e,t,n){n=g(n,Se.BOTH);let i=e;l(t)&&(i+=` ${t.toString()}`),Se.includesVertexShader(n)&&this._vertexShaderParts.defineLines.push(i),Se.includesFragmentShader(n)&&this._fragmentShaderParts.defineLines.push(i)};Oc.prototype.addStruct=function(e,t,n){this._structs[e]=new aW(t),Se.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),Se.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};Oc.prototype.addStructField=function(e,t,n){this._structs[e].addField(t,n)};Oc.prototype.addFunction=function(e,t,n){this._functions[e]=new cW(t),Se.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),Se.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};Oc.prototype.addFunctionLines=function(e,t){this._functions[e].addLines(t)};Oc.prototype.addUniform=function(e,t,n){n=g(n,Se.BOTH);let i=`uniform ${e} ${t};`;Se.includesVertexShader(n)&&this._vertexShaderParts.uniformLines.push(i),Se.includesFragmentShader(n)&&this._fragmentShaderParts.uniformLines.push(i)};Oc.prototype.setPositionAttribute=function(e,t){return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0};Oc.prototype.addAttribute=function(e,t){let n=`in ${e} ${t};`;this._attributeLines.push(n);let i=this._nextAttributeLocation;return this._attributeLocations[t]=i,this._nextAttributeLocation+=z5e(e),i};Oc.prototype.addVarying=function(e,t){let n=`${e} ${t};`;this._vertexShaderParts.varyingLines.push(`out ${n}`),this._fragmentShaderParts.varyingLines.push(`in ${n}`)};Oc.prototype.addVertexLines=function(e){let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};Oc.prototype.addFragmentLines=function(e){let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};Oc.prototype.buildShaderProgram=function(e){let t=l(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=K5e(this),i=J5e(this),o=t.concat(this._attributeLines,this._vertexShaderParts.uniformLines,this._vertexShaderParts.varyingLines,n.vertexLines,i.vertexLines,this._vertexShaderParts.shaderLines).join(`
`),r=new Oe({defines:this._vertexShaderParts.defineLines,sources:[o]}),s=this._fragmentShaderParts.uniformLines.concat(this._fragmentShaderParts.varyingLines,n.fragmentLines,i.fragmentLines,this._fragmentShaderParts.shaderLines).join(`
`),a=new Oe({defines:this._fragmentShaderParts.defineLines,sources:[s]});return Qt.fromCache({context:e,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:this._attributeLocations})};Oc.prototype.clone=function(){return ze(this,!0)};function K5e(e){let t=[],n=[],i,o=e._vertexShaderParts.structIds,r,s,a;for(i=0;i<o.length;i++)r=o[i],s=e._structs[r],a=s.generateGlslLines(),t.push.apply(t,a);for(o=e._fragmentShaderParts.structIds,i=0;i<o.length;i++)r=o[i],s=e._structs[r],a=s.generateGlslLines(),n.push.apply(n,a);return{vertexLines:t,fragmentLines:n}}function z5e(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function J5e(e){let t=[],n=[],i,o=e._vertexShaderParts.functionIds,r,s,a;for(i=0;i<o.length;i++)r=o[i],s=e._functions[r],a=s.generateGlslLines(),t.push.apply(t,a);for(o=e._fragmentShaderParts.functionIds,i=0;i<o.length;i++)r=o[i],s=e._functions[r],a=s.generateGlslLines(),n.push.apply(n,a);return{vertexLines:t,fragmentLines:n}}var o_=Oc;function Q5e(e){this.shaderBuilder=new o_,this.model=e,this.uniformMap={},this.alphaOptions=new sW,this.renderStateOptions=ke.getState(ke.fromCache({depthTest:{enabled:!0,func:ja.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1}var lW=Q5e;var SCn=T(S(),1);var hCn=T(S(),1),dW=`void silhouetteStage(inout vec4 color) {
if(model_silhouettePass) {
color = czm_gammaCorrect(model_silhouetteColor);
}
}`;var pCn=T(S(),1),uW=`void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) {
#ifdef HAS_NORMALS
if(model_silhouettePass) {
vec3 normal = normalize(czm_normal3D * attributes.normalMC);
normal.x *= czm_projection[0][0];
normal.y *= czm_projection[1][1];
positionClip.xy += normal.xy * positionClip.w * model_silhouetteSize * czm_pixelRatio / czm_viewport.z;
}
#endif
}
`;var YN={name:"ModelSilhouettePipelineStage"};YN.silhouettesLength=0;YN.process=function(e,t,n){l(t._silhouetteId)||(t._silhouetteId=++YN.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,Se.BOTH),i.addVertexLines(uW),i.addFragmentLines(dW),i.addUniform("vec4","model_silhouetteColor",Se.FRAGMENT),i.addUniform("float","model_silhouetteSize",Se.VERTEX),i.addUniform("bool","model_silhouettePass",Se.BOTH);let o={model_silhouetteColor:function(){return t.silhouetteColor},model_silhouetteSize:function(){return t.silhouetteSize},model_silhouettePass:function(){return!1}};e.uniformMap=Tt(o,e.uniformMap),e.hasSilhouette=!0};var mW=YN;var ECn=T(S(),1);var VCn=T(S(),1),hW=`void modelSplitterStage()
{
// Don't split when rendering the shadow map, because it is rendered from
// the perspective of a totally different camera.
#ifndef SHADOW_MAP
if (model_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;
if (model_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;
#endif
}
`;var HN={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};HN.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,Se.FRAGMENT),i.addFragmentLines(hW);let o={};i.addUniform("float",HN.SPLIT_DIRECTION_UNIFORM_NAME,Se.FRAGMENT),o[HN.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=Tt(o,e.uniformMap)};var fW=HN;var WCn=T(S(),1);function j5e(e,t){this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=ze(e.uniformMap),this.alphaOptions=ze(e.alphaOptions),this.renderStateOptions=ze(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.runtimeNode=t,this.attributes=[],this.attributeIndex=1,this.featureIdVertexAttributeSetIndex=0,this.instanceCount=0}var pW=j5e;var OCn=T(S(),1);var FCn=T(S(),1);function q5e(e){e=g(e,g.EMPTY_OBJECT),this.lightingModel=g(e.lightingModel,cf.UNLIT)}var bW=q5e;function $5e(e,t){this.model=e.model,this.runtimeNode=e.runtimeNode,this.attributes=e.attributes.slice(),this.attributeIndex=e.attributeIndex,this.featureIdVertexAttributeSetIndex=e.featureIdVertexAttributeSetIndex,this.uniformMap=ze(e.uniformMap),this.alphaOptions=ze(e.alphaOptions),this.renderStateOptions=ze(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.shaderBuilder=e.shaderBuilder.clone(),this.instanceCount=e.instanceCount,this.runtimePrimitive=t;let n=t.primitive;this.count=l(n.indices)?n.indices.count:qt.getAttributeBySemantic(n,"POSITION").count,this.hasPropertyTable=!1,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=qt.getPositionMinMax(n,this.runtimeNode.instancingTranslationMin,this.runtimeNode.instancingTranslationMax);this.positionMin=h.clone(i.min,new h),this.positionMax=h.clone(i.max,new h),this.boundingSphere=ce.fromCornerPoints(this.positionMin,this.positionMax,new ce),this.lightingOptions=new bW,this.pickId=void 0}var yW=$5e;function ud(e){e=g(e,g.EMPTY_OBJECT);let t=e.modelComponents;this._model=e.model,this._components=t,this._pipelineStages=[],this._updateStages=[],this._runtimeNodes=[],this._rootNodes=[],this._skinnedNodes=[],this._runtimeSkins=[],this.modelPipelineStages=[],this._boundingSphere=void 0,this._boundingSphere2D=void 0,this._computedModelMatrix=A.clone(A.IDENTITY),this._computedModelMatrix2D=A.clone(A.IDENTITY),this._axisCorrectionMatrix=qt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new A),this._runtimeArticulations={},eUe(this)}Object.defineProperties(ud.prototype,{components:{get:function(){return this._components}},computedModelMatrix:{get:function(){return this._computedModelMatrix}},axisCorrectionMatrix:{get:function(){return this._axisCorrectionMatrix}},boundingSphere:{get:function(){return this._boundingSphere}}});function eUe(e){let t=e._components,n=t.scene,o=e._model.modelMatrix;bre(e,o);let r=t.articulations,s=r.length,a=e._runtimeArticulations;for(let V=0;V<s;V++){let L=r[V],Z=new aX({articulation:L,sceneGraph:e}),G=Z.name;a[G]=Z}let c=t.nodes,d=c.length;e._runtimeNodes=new Array(d);let m=n.nodes.length,p=A.IDENTITY;for(let V=0;V<m;V++){let L=n.nodes[V],Z=yre(e,L,p);e._rootNodes.push(Z)}let y=t.skins,f=e._runtimeSkins,x=y.length;for(let V=0;V<x;V++){let L=y[V];f.push(new rW({skin:L,sceneGraph:e}))}let _=e._skinnedNodes,C=_.length;for(let V=0;V<C;V++){let L=_[V],Z=e._runtimeNodes[L],I=c[L].skin.index;Z._runtimeSkin=f[I],Z.updateJointMatrices()}e.applyArticulations()}function bre(e,t){let n=e._components,i=e._model;e._computedModelMatrix=A.multiplyTransformation(t,n.transform,e._computedModelMatrix),e._computedModelMatrix=A.multiplyTransformation(e._computedModelMatrix,e._axisCorrectionMatrix,e._computedModelMatrix),e._computedModelMatrix=A.multiplyByUniformScale(e._computedModelMatrix,i.computedScale,e._computedModelMatrix)}var tUe=new h;function nUe(e,t){let n=e._computedModelMatrix,i=A.getTranslation(n,tUe);if(!h.equals(i,h.ZERO))e._computedModelMatrix2D=Xt.basisTo2D(t.mapProjection,n,e._computedModelMatrix2D);else{let o=e.boundingSphere.center,r=Xt.wgs84To2DModelMatrix(t.mapProjection,o,e._computedModelMatrix2D);e._computedModelMatrix2D=A.multiply(r,n,e._computedModelMatrix2D)}e._boundingSphere2D=ce.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function yre(e,t,n){let i=[],o=qt.getNodeTransform(t),r=t.children.length;for(let u=0;u<r;u++){let m=t.children[u],p=A.multiplyTransformation(n,o,new A),y=yre(e,m,p);i.push(y)}let s=new xX({node:t,transform:o,transformToRoot:n,children:i,sceneGraph:e}),a=t.primitives.length;for(let u=0;u<a;u++)s.runtimePrimitives.push(new oW({primitive:t.primitives[u],node:t,model:e._model}));let c=t.index;e._runtimeNodes[c]=s,l(t.skin)&&e._skinnedNodes.push(c);let d=t.name;if(l(d)){let u=e._model,m=new uX(u,s);u._nodesByName[d]=m}return c}var iUe=new h,oUe=new h,rUe=new h,sUe=new h;ud.prototype.buildDrawCommands=function(e){let t=this._model,n=new lW(t);t.statistics.clear(),this.configurePipeline(e);let i=this.modelPipelineStages,o,r,s;for(o=0;o<i.length;o++)i[o].process(n,t,e);let a=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,iUe),c=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,oUe);for(o=0;o<this._runtimeNodes.length;o++){let d=this._runtimeNodes[o];if(!l(d))continue;d.configurePipeline();let u=d.pipelineStages,m=new pW(n,d);for(r=0;r<u.length;r++)u[r].process(m,d.node,e);let p=d.computedTransform;for(r=0;r<d.runtimePrimitives.length;r++){let y=d.runtimePrimitives[r];y.configurePipeline(e);let f=y.pipelineStages,x=new yW(m,y);for(s=0;s<f.length;s++)f[s].process(x,y.primitive,e);y.boundingSphere=ce.clone(x.boundingSphere,new ce);let _=A.multiplyByPoint(p,x.positionMin,rUe),C=A.multiplyByPoint(p,x.positionMax,sUe);h.minimumByComponent(a,_,a),h.maximumByComponent(c,C,c);let V=$I(x,e);y.drawCommand=V}}this._boundingSphere=ce.fromCornerPoints(a,c,new ce),this._boundingSphere=ce.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=ce.transform(this._boundingSphere,this._components.transform,this._boundingSphere),t._boundingSphere=ce.transform(this._boundingSphere,t.modelMatrix,t._boundingSphere),t._initialRadius=t._boundingSphere.radius,t._boundingSphere.radius*=t._clampedScale};ud.prototype.configurePipeline=function(e){let t=this.modelPipelineStages;t.length=0;let n=this._model,i=e.fog.enabled&&e.fog.renderable;l(n.color)&&t.push(ty),!l(n.classificationType)&&(n.imageBasedLighting.enabled&&t.push(rX),n.isClippingEnabled()&&t.push(dX),n.hasSilhouette(e)&&t.push(mW),l(n.splitDirection)&&n.splitDirection!==Bc.NONE&&t.push(fW),cr.is3DTiles(n.type)&&t.push(eX),i&&t.push(iX))};ud.prototype.update=function(e,t){let n,i,o;for(n=0;n<this._runtimeNodes.length;n++){let r=this._runtimeNodes[n];if(!l(r))continue;for(i=0;i<r.updateStages.length;i++)r.updateStages[i].update(r,this,e);let s=e.mode!==ie.SCENE3D&&this._model._projectTo2D;for(t&&!s&&this.updateJointMatrices(),i=0;i<r.runtimePrimitives.length;i++){let a=r.runtimePrimitives[i];for(o=0;o<a.updateStages.length;o++)a.updateStages[o].update(a,this)}}};ud.prototype.updateModelMatrix=function(e,t){bre(this,e),t.mode!==ie.SCENE3D&&nUe(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let o=this._runtimeNodes[n[i]];o._transformDirty=!0}};ud.prototype.updateJointMatrices=function(){let e=this._skinnedNodes,t=e.length;for(let n=0;n<t;n++){let i=e[n];this._runtimeNodes[i].updateJointMatrices()}};function gre(e,t,n,i,o){if(n&&!t.show)return;let r=t.children.length;for(let c=0;c<r;c++){let d=t.getChild(c);gre(e,d,n,i,o)}let s=t.runtimePrimitives,a=s.length;for(let c=0;c<a;c++){let d=s[c];i(d,o)}}function KN(e,t,n,i){let o=e._rootNodes,r=o.length;for(let s=0;s<r;s++){let a=o[s],c=e._runtimeNodes[a];gre(e,c,t,n,i)}}var aUe={backFaceCulling:void 0};ud.prototype.updateBackFaceCulling=function(e){let t=aUe;t.backFaceCulling=e,KN(this,!1,cUe,t)};function cUe(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var lUe={shadowMode:void 0};ud.prototype.updateShadows=function(e){let t=lUe;t.shadowMode=e,KN(this,!1,dUe,t)};function dUe(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var uUe={debugShowBoundingVolume:void 0};ud.prototype.updateShowBoundingVolume=function(e){let t=uUe;t.debugShowBoundingVolume=e,KN(this,!1,mUe,t)};function mUe(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var xre=[],hUe={frameState:void 0,hasSilhouette:void 0};ud.prototype.pushDrawCommands=function(e){let t=xre;t.length=0;let n=hUe;n.hasSilhouette=this._model.hasSilhouette(e),n.frameState=e,KN(this,!0,fUe,n),e.commandList.push.apply(e.commandList,t)};function fUe(e,t){let n=t.frameState,i=t.hasSilhouette,o=n.passes,r=xre,s=e.drawCommand;s.pushCommands(n,n.commandList),i&&!o.pick&&s.pushSilhouetteCommands(n,r)}ud.prototype.setArticulationStage=function(e,t){let n=e.split(" ");if(n.length!==2)return;let i=n[0],o=n[1],r=this._runtimeArticulations[i];l(r)&&r.setArticulationStage(o,t)};ud.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var gW=ud;var T1n=T(S(),1);function WC(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdSet={},this._batchTextureIdMap=new Ct}Object.defineProperties(WC.prototype,{batchTexturesByteLength:{get:function(){let e=this._batchTextureIdMap.length,t=this._batchTextureIdMap.values,n=0;for(let i=0;i<e;i++)n+=t[i].byteLength;return n}}});WC.prototype.clear=function(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdSet={},this._batchTextureIdMap.removeAll()};WC.prototype.addBuffer=function(e,t){if(!this._bufferIdSet.hasOwnProperty(e._id)){let n=t?2:1;this.geometryByteLength+=e.sizeInBytes*n}this._bufferIdSet[e._id]=!0};WC.prototype.addTexture=function(e){this._textureIdSet.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes),this._textureIdSet[e._id]=!0};WC.prototype.addBatchTexture=function(e){this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var xW=WC;var oVn=T(S(),1);var Cre=T(jA(),1);var v1n=T(S(),1);var _re={},r_=Uint32Array.BYTES_PER_ELEMENT;_re.parse=function(e,t){t=g(t,0);let n=new Uint8Array(e),i=new DataView(e);t+=r_;let o=i.getUint32(t,!0);if(o!==1)throw new me(`Only Point Cloud tile version 1 is supported. Version ${o} is not.`);t+=r_,t+=r_;let r=i.getUint32(t,!0);if(r===0)throw new me("Feature table must have a byte length greater than zero");t+=r_;let s=i.getUint32(t,!0);t+=r_;let a=i.getUint32(t,!0);t+=r_;let c=i.getUint32(t,!0);t+=r_;let d=Po(n,t,r);t+=r;let u=new Uint8Array(e,t,s);t+=s;let m,p;a>0&&(m=Po(n,t,a),t+=a,c>0&&(p=new Uint8Array(e,t,c),t+=c));let y=new Mm(d,u),f=y.getGlobalProperty("POINTS_LENGTH");if(y.featuresLength=f,!l(f))throw new me("Feature table global property: POINTS_LENGTH must be defined");let x=y.getGlobalProperty("RTC_CENTER",Q.FLOAT,3);l(x)&&(x=h.unpack(x));let _=pUe(y,m);if(_.rtcCenter=x,_.pointsLength=f,!_.hasPositions){let C=bUe(y);_.positions=C,_.hasPositions=_.hasPositions||l(C)}if(!_.hasPositions)throw new me("Either POSITION or POSITION_QUANTIZED must be defined.");if(!_.hasNormals){let C=gUe(y);_.normals=C,_.hasNormals=_.hasNormals||l(C)}if(!_.hasColors){let C=yUe(y);_.colors=C,_.hasColors=_.hasColors||l(C),_.hasConstantColor=l(_.constantColor),_.isTranslucent=l(C)&&C.isTranslucent}if(!_.hasBatchIds){let C=xUe(y);_.batchIds=C,_.hasBatchIds=_.hasBatchIds||l(C)}if(_.hasBatchIds){let C=y.getGlobalProperty("BATCH_LENGTH");if(!l(C))throw new me("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");_.batchLength=C}return l(p)&&(p=new Uint8Array(p),_.batchTableJson=m,_.batchTableBinary=p),_};function pUe(e,t){let n=e.json,i,o,r,s=l(n.extensions)?n.extensions["3DTILES_draco_point_compression"]:void 0,a=l(t)&&l(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;l(a)&&(r=a.properties);let c,d,u,m,p;if(l(s)){o=s.properties;let f=s.byteOffset,x=s.byteLength;if(!l(o)||!l(f)||!l(x))throw new me("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(f,f+x),c=l(o.POSITION),d=l(o.RGB)||l(o.RGBA),u=l(o.NORMAL),m=l(o.BATCH_ID),p=l(o.RGBA)}let y;return l(i)&&(y={buffer:i,featureTableProperties:o,batchTableProperties:r,properties:Tt(o,r),dequantizeInShader:!0}),{draco:y,hasPositions:c,hasColors:d,isTranslucent:p,hasNormals:u,hasBatchIds:m}}function bUe(e){let t=e.json,n;if(l(t.POSITION))return n=e.getPropertyArray("POSITION",Q.FLOAT,3),{name:_t.POSITION,semantic:_t.POSITION,typedArray:n,isQuantized:!1,componentDatatype:Q.FLOAT,type:tn.VEC3};if(l(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",Q.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Q.FLOAT,3);if(!l(i))throw new me("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let o=65535,r=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Q.FLOAT,3);if(!l(r))throw new me("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:_t.POSITION,semantic:_t.POSITION,typedArray:n,isQuantized:!0,componentDatatype:Q.FLOAT,type:tn.VEC3,quantizedRange:o,quantizedVolumeOffset:h.unpack(r),quantizedVolumeScale:h.unpack(i),quantizedComponentDatatype:Q.UNSIGNED_SHORT,quantizedType:tn.VEC3}}}function yUe(e){let t=e.json,n;if(l(t.RGBA))return n=e.getPropertyArray("RGBA",Q.UNSIGNED_BYTE,4),{name:_t.COLOR,semantic:_t.COLOR,setIndex:0,typedArray:n,componentDatatype:Q.UNSIGNED_BYTE,type:tn.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(l(t.RGB))return n=e.getPropertyArray("RGB",Q.UNSIGNED_BYTE,3),{name:"COLOR",semantic:_t.COLOR,setIndex:0,typedArray:n,componentDatatype:Q.UNSIGNED_BYTE,type:tn.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(l(t.RGB565))return n=e.getPropertyArray("RGB565",Q.UNSIGNED_SHORT,1),{name:"COLOR",semantic:_t.COLOR,setIndex:0,typedArray:n,componentDatatype:Q.FLOAT,type:tn.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(l(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",Q.UNSIGNED_BYTE,4),o=i[3],r=O.fromBytes(i[0],i[1],i[2],o),s=o<255;return{name:_t.COLOR,semantic:_t.COLOR,setIndex:0,constantColor:r,componentDatatype:Q.FLOAT,type:tn.VEC4,isQuantized:!1,isTranslucent:s}}}function gUe(e){let t=e.json,n;if(l(t.NORMAL))return n=e.getPropertyArray("NORMAL",Q.FLOAT,3),{name:_t.NORMAL,semantic:_t.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:Q.FLOAT,type:tn.VEC3};if(l(t.NORMAL_OCT16P))return n=e.getPropertyArray("NORMAL_OCT16P",Q.UNSIGNED_BYTE,2),{name:_t.NORMAL,semantic:_t.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<8)-1,quantizedType:tn.VEC2,quantizedComponentDatatype:Q.UNSIGNED_BYTE,componentDatatype:Q.FLOAT,type:tn.VEC3}}function xUe(e){let t=e.json;if(l(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",Q.UNSIGNED_SHORT,1);return{name:_t.FEATURE_ID,semantic:_t.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:Q.fromTypedArray(n),type:tn.SCALAR}}}var s_=_re;var _Ue=Mt.Components,TUe=Mt.Scene,SUe=Mt.Node,CUe=Mt.Primitive,VUe=Mt.Attribute,Tre=Mt.Quantization,LUe=Mt.FeatureIdAttribute,RUe=Mt.Material,ZUe=Mt.MetallicRoughness;function sy(e){e=g(e,g.EMPTY_OBJECT);let t=e.arrayBuffer,n=g(e.byteOffset,0);this._arrayBuffer=t,this._byteOffset=n,this._loadAttributesFor2D=g(e.loadAttributesFor2D,!1),this._parsedContent=void 0,this._decodePromise=void 0,this._decodedAttributes=void 0,this._promise=void 0,this._error=void 0,this._state=Gt.UNLOADED,this._buffers=[],this._components=void 0,this._transform=A.IDENTITY}l(Object.create)&&(sy.prototype=Object.create(co.prototype),sy.prototype.constructor=sy);Object.defineProperties(sy.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},transform:{get:function(){return this._transform}}});sy.prototype.load=function(){if(l(this._promise))return this._promise;this._parsedContent=s_.parse(this._arrayBuffer,this._byteOffset),this._state=Gt.PROCESSING,this._promise=Promise.resolve(this)};sy.prototype.process=function(e){if(l(this._error)){let t=this._error;throw this._error=void 0,t}if(this._state===Gt.READY)return!0;if(this._state===Gt.PROCESSING){if(l(this._decodePromise))return!1;this._decodePromise=GUe(this,e.context)}return!1};function GUe(e,t){let i=e._parsedContent.draco,o;if(l(i)?o=Mp.decodePointCloud(i,t):o=Promise.resolve(),!!l(o))return e._decodePromise=o,o.then(function(r){if(!e.isDestroyed())return l(r)&&EUe(e,i,r),UUe(e,t),e._state=Gt.READY,e}).catch(function(r){e.unload(),e._state=Gt.FAILED;let s="Failed to load Draco pnts";e._error=e.getError(s,r)})}function EUe(e,t,n){e._state=Gt.READY;let i=e._parsedContent,o;if(l(n.POSITION)){if(o={name:"POSITION",semantic:_t.POSITION,typedArray:n.POSITION.array,componentDatatype:Q.FLOAT,type:tn.VEC3,isQuantized:!1},l(n.POSITION.data.quantization)){let a=n.POSITION.data.quantization,c=a.range,d=h.fromElements(c,c,c),u=h.unpack(a.minValues),m=(1<<a.quantizationBits)-1;o.isQuantized=!0,o.quantizedRange=m,o.quantizedVolumeOffset=u,o.quantizedVolumeScale=d,o.quantizedComponentDatatype=m<=255?Q.UNSIGNED_BYTE:Q.UNSIGNED_SHORT,o.quantizedType=tn.VEC3}i.positions=o}if(l(n.NORMAL)){if(o={name:"NORMAL",semantic:_t.NORMAL,typedArray:n.NORMAL.array,componentDatatype:Q.FLOAT,type:tn.VEC3,isQuantized:!1,octEncoded:!1,octEncodedZXY:!1},l(n.NORMAL.data.quantization)){let a=(1<<n.NORMAL.data.quantization.quantizationBits)-1;o.quantizedRange=a,o.octEncoded=!0,o.octEncodedZXY=!0,o.quantizedComponentDatatype=Q.UNSIGNED_BYTE,o.quantizedType=tn.VEC2}i.normals=o}if(l(n.RGBA)?i.colors={name:"COLOR",semantic:_t.COLOR,setIndex:0,typedArray:n.RGBA.array,componentDatatype:Q.UNSIGNED_BYTE,type:tn.VEC4,normalized:!0,isTranslucent:!0}:l(n.RGB)&&(i.colors={name:"COLOR",semantic:_t.COLOR,setIndex:0,typedArray:n.RGB.array,componentDatatype:Q.UNSIGNED_BYTE,type:tn.VEC3,normalized:!0,isTranslucent:!1}),l(n.BATCH_ID)){let a=n.BATCH_ID.array;i.batchIds={name:"_FEATURE_ID",semantic:_t.FEATURE_ID,setIndex:0,typedArray:a,componentDatatype:Q.fromTypedArray(a),type:tn.SCALAR}}let r=i.batchTableJson,s=t.batchTableProperties;for(let a in s)if(s.hasOwnProperty(a)){let c=n[a];l(r)||(r={}),i.hasDracoBatchTable=!0;let d=c.data;r[a]={byteOffset:d.byteOffset,type:IUe(d.componentsPerAttribute),componentType:XUe(d.componentDatatype),typedArray:c.array}}i.batchTableJson=r}function IUe(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4"}}function XUe(e){switch(e){case ne.BYTE:return"BYTE";case ne.UNSIGNED_BYTE:return"UNSIGNED_BYTE";case ne.SHORT:return"SHORT";case ne.UNSIGNED_SHORT:return"UNSIGNED_SHORT";case ne.INT:return"INT";case ne.UNSIGNED_INT:return"UNSIGNED_INT";case ne.DOUBLE:return"DOUBLE";case ne.FLOAT:return"FLOAT"}}function _W(e,t,n){let i=t.typedArray,o;if(t.octEncoded&&(o=new Tre,o.octEncoded=t.octEncoded,o.octEncodedZXY=t.octEncodedZXY,o.normalizationRange=t.quantizedRange,o.type=t.quantizedType,o.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){o=new Tre;let a=t.quantizedRange;o.normalizationRange=a,o.quantizedVolumeOffset=h.ZERO;let c=t.quantizedVolumeScale;o.quantizedVolumeDimensions=c,o.quantizedVolumeStepSize=h.divideByScalar(c,a,new h),o.componentDatatype=t.quantizedComponentDatatype,o.type=t.quantizedType}let r=new VUe;if(r.name=t.name,r.semantic=t.semantic,r.setIndex=t.setIndex,r.componentDatatype=t.componentDatatype,r.type=t.type,r.normalized=g(t.normalized,!1),r.min=t.min,r.max=t.max,r.quantization=o,t.isRGB565&&(i=Fn.decodeRGB565(i)),l(t.constantColor)){let a=new Array(4);r.constant=O.pack(t.constantColor,a)}else{let a=ft.createVertexBuffer({typedArray:i,context:n,usage:Ue.STATIC_DRAW});a.vertexArrayDestroyable=!1,e._buffers.push(a),r.buffer=a}let s=e._loadAttributesFor2D;return r.semantic===_t.POSITION&&s&&(r.typedArray=i),r}var Sre,zN;function WUe(e){if(!l(zN)){Sre=new Cre.default(0),zN=new Array(e);for(let t=0;t<e;++t)zN[t]=Sre.random()}return zN}var PUe=new h,vUe=new h,wUe=new h;function FUe(e){let t=e.typedArray,n=20,i=t.length/3,o=Math.min(i,n),r=WUe(n),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=h.fromElements(s,s,s,PUe),d=h.fromElements(a,a,a,vUe),u,m,p;if(e.isQuantized)c=h.ZERO,d=e.quantizedVolumeScale;else for(u=0;u<o;++u)m=Math.floor(r[u]*i),p=h.unpack(t,m*3,wUe),h.minimumByComponent(c,p,c),h.maximumByComponent(d,p,d);e.min=h.clone(c),e.max=h.clone(d)}var AUe={name:_t.COLOR,semantic:_t.COLOR,setIndex:0,constantColor:O.DARKGRAY,componentDatatype:Q.FLOAT,type:tn.VEC4,isQuantized:!1,isTranslucent:!1};function MUe(e,t,n){let i=[],o,r=t.positions;return l(r)&&(FUe(r),o=_W(e,r,n),o.count=t.pointsLength,i.push(o)),l(t.normals)&&(o=_W(e,t.normals,n),i.push(o)),l(t.colors)?(o=_W(e,t.colors,n),i.push(o)):(o=_W(e,AUe,n),i.push(o)),l(t.batchIds)&&(o=_W(e,t.batchIds,n),i.push(o)),i}function NUe(e,t){let n=e.batchLength,i=e.pointsLength,o=e.batchTableBinary,r=!l(e.batchIds);if(l(o)||e.hasDracoBatchTable){let s=g(n,i);return Kp({count:s,batchTable:e.batchTableJson,binaryBody:o,parseAsPropertyAttributes:r,customAttributeOutput:t})}return new Za({schema:{},propertyTables:[]})}function UUe(e,t){let n=e._parsedContent,i=new ZUe;i.metallicFactor=0,i.roughnessFactor=.9;let o=new RUe;o.metallicRoughness=i;let r=n.colors;l(r)&&r.isTranslucent&&(o.alphaMode=sf.BLEND);let s=!l(n.normals);o.unlit=s;let a=new CUe;if(a.attributes=MUe(e,n,t),a.primitiveType=Ae.POINTS,a.material=o,l(n.batchIds)){let y=new LUe;y.propertyTableId=0,y.setIndex=0,y.positionalLabel="featureId_0",a.featureIds.push(y)}let c=new SUe;c.index=0,c.primitives=[a];let d=new TUe;d.nodes=[c],d.upAxis=Wo.Z,d.forwardAxis=Wo.X;let u=new _Ue;u.scene=d,u.nodes=[c];let m=[];u.structuralMetadata=NUe(n,m),m.length>0&&kUe(e,a,m,t),l(n.rtcCenter)&&(u.transform=A.multiplyByTranslation(u.transform,n.rtcCenter,u.transform));let p=n.positions;l(p)&&p.isQuantized&&(u.transform=A.multiplyByTranslation(u.transform,p.quantizedVolumeOffset,u.transform)),e._components=u,e._parsedContent=void 0,e._arrayBuffer=void 0}function kUe(e,t,n,i){let o=t.attributes,r=n.length;for(let s=0;s<r;s++){let a=n[s],c=ft.createVertexBuffer({typedArray:a.typedArray,context:i,usage:Ue.STATIC_DRAW});c.vertexArrayDestroyable=!1,e._buffers.push(c),a.buffer=c,a.typedArray=void 0,o.push(a)}t.propertyAttributeIds=[0]}sy.prototype.unload=function(){let e=this._buffers;for(let t=0;t<e.length;t++)e[t].destroy();e.length=0,this._components=void 0,this._parsedContent=void 0,this._arrayBuffer=void 0};var TW=sy;var VVn=T(S(),1);var DUe=new h,BUe=new h,OUe=new h,YUe=new A,HUe=new A,KUe=new A,zUe=new he,JUe=new ce;function PC(e,t,n,i,o,r,s){if(!e._ready||n.mode===ie.MORPHING)return;let a=Number.MAX_VALUE,c=e.sceneGraph,d=c._runtimeNodes;for(let u=0;u<d.length;u++){let m=d[u],p=m.node,y=A.clone(m.computedTransform,YUe),f=A.clone(c.computedModelMatrix,HUe),x=p.instances;l(x)&&x.transformInWorldSpace&&(f=A.multiplyTransformation(e.modelMatrix,c.components.transform,f),y=A.multiplyTransformation(c.axisCorrectionMatrix,m.computedTransform,y));let _=A.multiplyTransformation(f,y,KUe);n.mode!==ie.SCENE3D&&(_=Xt.basisTo2D(n.mapProjection,_,_));let C=[];if(l(x)){let L=x.attributes[0].count,Z=x.attributes[0].componentDatatype,G=12,I=m.transformsTypedArray;if(!l(I)){let P=m.instancingTransformsBuffer;l(P)&&n.context.webgl2&&(I=Q.createTypedArray(Z,L*G),P.getBufferData(I))}if(l(I))for(let P=0;P<L;P++){let v=P*G,F=new A(I[v],I[v+1],I[v+2],I[v+3],I[v+4],I[v+5],I[v+6],I[v+7],I[v+8],I[v+9],I[v+10],I[v+11],0,0,0,1);x.transformInWorldSpace?(A.multiplyTransformation(F,y,F),A.multiplyTransformation(f,F,F)):A.multiplyTransformation(F,_,F),C.push(F)}}C.length===0&&C.push(_);let V=m.runtimePrimitives.length;for(let L=0;L<V;L++){let Z=m.runtimePrimitives[L],G=Z.primitive;if(l(Z.boundingSphere)&&!l(x)){let N=ce.transform(Z.boundingSphere,_,JUe),D=ni.raySphere(t,N);if(!l(D))continue}let I=qt.getAttributeBySemantic(G,_t.POSITION),P=I.count;if(!l(G.indices))continue;let v=G.indices.typedArray;if(!l(v)){let N=G.indices.buffer,D=G.indices.count,k=G.indices.indexDatatype;l(N)&&n.context.webgl2&&(k===Ne.UNSIGNED_BYTE?v=new Uint8Array(D):k===Ne.UNSIGNED_SHORT?v=new Uint16Array(D):k===Ne.UNSIGNED_INT&&(v=new Uint32Array(D)),N.getBufferData(v))}let F=I.typedArray,M=I.componentDatatype,b=I.type,R=I.quantization;l(R)&&(M=I.quantization.componentDatatype,b=I.quantization.type);let E=tn.getNumberOfComponents(b),X=P*E;if(!l(F)){let N=I.buffer;l(N)&&n.context.webgl2&&(F=Q.createTypedArray(M,X),N.getBufferData(F,I.byteOffset,0,X)),R&&I.normalized&&(F=Fn.dequantize(F,M,b,P))}if(!l(v)||!l(F))return;r=g(r,oe.WGS84),i=g(i,1),o=g(o,0);let w=v.length;for(let N=0;N<w;N+=3){let D=v[N],k=v[N+1],Y=v[N+2];for(let U of C){let J=aH(F,D,E,R,U,i,o,r,DUe),K=aH(F,k,E,R,U,i,o,r,BUe),ee=aH(F,Y,E,R,U,i,o,r,OUe),H=ni.rayTriangleParametric(t,J,K,ee,g(e.backFaceCulling,!0));l(H)&&H<a&&H>=0&&(a=H)}}}}if(a!==Number.MAX_VALUE){if(s=gn.getPoint(t,a,s),n.mode!==ie.SCENE3D){h.fromElements(s.y,s.z,s.x,s);let u=n.mapProjection,m=u.ellipsoid,p=u.unproject(s,zUe);m.cartographicToCartesian(p,s)}return s}}function aH(e,t,n,i,o,r,s,a,c){let d=t*n;if(c.x=e[d],c.y=e[d+1],c.z=e[d+2],l(i))if(i.octEncoded){if(c=Fn.octDecodeInRange(c,i.normalizationRange,c),i.octEncodedZXY){let u=c.x;c.x=c.z,c.z=c.y,c.y=u}}else c=h.multiplyComponents(c,i.quantizedVolumeStepSize,c),c=h.add(c,i.quantizedVolumeOffset,c);return c=A.multiplyByPoint(o,c,c),r!==1&&Dr.getPosition(c,a,r,s,c),c}function Co(e){e=g(e,g.EMPTY_OBJECT),this._loader=e.loader,this._resource=e.resource,this.type=g(e.type,cr.GLTF),this.modelMatrix=A.clone(g(e.modelMatrix,A.IDENTITY)),this._modelMatrix=A.clone(this.modelMatrix),this._scale=g(e.scale,1),this._minimumPixelSize=g(e.minimumPixelSize,0),this._maximumScale=e.maximumScale,this._clampedScale=l(this._maximumScale)?Math.min(this._scale,this._maximumScale):this._scale,this._computedScale=this._clampedScale,this._updateModelMatrix=!1,this.referenceMatrix=void 0,this._iblReferenceFrameMatrix=q.clone(q.IDENTITY),this._resourcesLoaded=!1,this._drawCommandsBuilt=!1,this._ready=!1,this._customShader=e.customShader,this._content=e.content,this._texturesLoaded=!1,this._defaultTexture=void 0,this._activeAnimations=new OI(this),this._clampAnimations=g(e.clampAnimations,!0),this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=O.clone(e.color),this._colorBlendMode=g(e.colorBlendMode,ic.HIGHLIGHT),this._colorBlendAmount=g(e.colorBlendAmount,.5);let t=g(e.silhouetteColor,O.RED);this._silhouetteColor=O.clone(t),this._silhouetteSize=g(e.silhouetteSize,0),this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=g(e.cull,!0),this._opaquePass=g(e.opaquePass,Ve.OPAQUE),this._allowPicking=g(e.allowPicking,!0),this._show=g(e.show,!0),this._style=void 0,this._styleDirty=!1,this._styleCommandsNeeded=void 0;let n=g(e.featureIdLabel,"featureId_0");typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=g(e.instanceFeatureIdLabel,"instanceFeatureId_0");typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i,this._featureTables=[],this._featureTableId=void 0,this._featureTableIdDirty=!0,this._pipelineResources=[],this._modelResources=[],this._pickIds=[],this._boundingSphere=new ce,this._initialRadius=void 0,this._heightReference=g(e.heightReference,Qe.NONE),this._heightDirty=this._heightReference!==Qe.NONE,this._removeUpdateHeightCallback=void 0,this._verticalExaggerationOn=!1,this._clampedModelMatrix=void 0;let o=e.scene;l(o)&&l(o.terrainProviderChanged)&&(this._terrainProviderChangedCallback=o.terrainProviderChanged.addEventListener(()=>{this._heightDirty=!0})),this._scene=o,this._distanceDisplayCondition=e.distanceDisplayCondition;let r=new af(e.pointCloudShading);this._pointCloudShading=r,this._attenuation=r.attenuation,this._pointCloudBackFaceCulling=r.backFaceCulling;let s=e.clippingPlanes;l(s)&&s.owner===void 0?ys.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0,this._clippingPlanesMatrix=A.clone(A.IDENTITY),this._lightColor=h.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new Ex,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._backFaceCulling=g(e.backFaceCulling,!0),this._backFaceCullingDirty=!1,this._shadows=g(e.shadows,Cn.ENABLED),this._shadowsDirty=!1,this._debugShowBoundingVolumeDirty=!1,this._debugShowBoundingVolume=g(e.debugShowBoundingVolume,!1),this._enableDebugWireframe=g(e.enableDebugWireframe,!1),this._enableShowOutline=g(e.enableShowOutline,!0),this._debugWireframe=g(e.debugWireframe,!1),this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===cr.GLTF&&Ft("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.");let a=e.credit;typeof a=="string"&&(a=new Vt(a)),this._credits=[],this._credit=a,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=g(e.showCreditsOnScreen,!1),this._showCreditsOnScreenDirty=!0,this._splitDirection=g(e.splitDirection,Bc.NONE),this._enableShowOutline=g(e.enableShowOutline,!0),this.showOutline=g(e.showOutline,!0),this.outlineColor=g(e.outlineColor,O.BLACK),this._classificationType=e.classificationType,this._statistics=new xW,this._sceneMode=void 0,this._projectTo2D=g(e.projectTo2D,!1),this._enablePick=g(e.enablePick,!1),this._fogRenderable=void 0,this._skipLevelOfDetail=!1,this._ignoreCommands=g(e.ignoreCommands,!1),this._errorEvent=new ye,this._readyEvent=new ye,this._texturesReadyEvent=new ye,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject,this._marsOptions=g(e.marsOptions,{})}function cH(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function QUe(e,t){let n=e._featureTables,i=t.propertyTables,o=i.length;for(let r=0;r<o;r++){let s=i[r],a=new KI({model:e,propertyTable:s});n.push(a)}return n}function jUe(e,t){let n=t._featureIdLabel,i=t._instanceFeatureIdLabel,o,r,s,a;for(o=0;o<e.nodes.length;o++)if(a=e.nodes[o],l(a.instances)&&(s=qt.getFeatureIdsByLabel(a.instances.featureIds,i),l(s)&&l(s.propertyTableId)))return s.propertyTableId;for(o=0;o<e.nodes.length;o++)for(a=e.nodes[o],r=0;r<a.primitives.length;r++){let c=a.primitives[r],d=qt.getFeatureIdsByLabel(c.featureIds,n);if(l(d))return d.propertyTableId}if(t._featureTables.length===1)return 0}function uH(e,t){if(!l(e)&&!l(t))return!1;if(l(e)!==l(t))return!0;let n=e.alpha,i=t.alpha;return Math.floor(n)!==Math.floor(i)||Math.ceil(n)!==Math.ceil(i)}Object.defineProperties(Co.prototype,{ready:{get:function(){return this._ready}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},incrementallyLoadTextures:{get:function(){return g(this._loader.incrementallyLoadTextures,!1)}},texturesReadyEvent:{get:function(){return this._texturesReadyEvent}},loader:{get:function(){return this._loader}},statistics:{get:function(){return this._statistics}},activeAnimations:{get:function(){return this._activeAnimations}},clampAnimations:{get:function(){return this._clampAnimations},set:function(e){this._clampAnimations=e}},cull:{get:function(){return this._cull}},opaquePass:{get:function(){return this._opaquePass}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){e!==this._pointCloudShading&&this.resetDrawCommands(),this._pointCloudShading=e}},customShader:{get:function(){return this._customShader},set:function(e){e!==this._customShader&&this.resetDrawCommands(),this._customShader=e}},sceneGraph:{get:function(){return this._sceneGraph}},content:{get:function(){return this._content}},heightReference:{get:function(){return this._heightReference},set:function(e){e!==this._heightReference&&(this._heightDirty=!0),this._heightReference=e}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=It.clone(e,this._distanceDisplayCondition)}},structuralMetadata:{get:function(){return this._sceneGraph.components.structuralMetadata}},featureTableId:{get:function(){return this._featureTableId},set:function(e){this._featureTableId=e}},featureTables:{get:function(){return this._featureTables},set:function(e){this._featureTables=e}},id:{get:function(){return this._id},set:function(e){e!==this._id&&(this._idDirty=!0),this._id=e}},allowPicking:{get:function(){return this._allowPicking}},style:{get:function(){return this._style},set:function(e){this._style=e,this._styleDirty=!0}},color:{get:function(){return this._color},set:function(e){uH(e,this._color)&&this.resetDrawCommands(),this._color=O.clone(e,this._color)}},colorBlendMode:{get:function(){return this._colorBlendMode},set:function(e){this._colorBlendMode=e}},colorBlendAmount:{get:function(){return this._colorBlendAmount},set:function(e){this._colorBlendAmount=e}},silhouetteColor:{get:function(){return this._silhouetteColor},set:function(e){if(!O.equals(e,this._silhouetteColor)){let t=uH(e,this._silhouetteColor);this._silhouetteDirty=this._silhouetteDirty||t}this._silhouetteColor=O.clone(e,this._silhouetteColor)}},silhouetteSize:{get:function(){return this._silhouetteSize},set:function(e){if(e!==this._silhouetteSize){let t=this._silhouetteSize,n=e>0&&t===0||e===0&&t>0;this._silhouetteDirty=this._silhouetteDirty||n,this._backFaceCullingDirty=this._backFaceCullingDirty||n}this._silhouetteSize=e}},boundingSphere:{get:function(){let e=l(this._clampedModelMatrix)?this._clampedModelMatrix:this.modelMatrix;return Rre(this,e),this._boundingSphere}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolumeDirty=!0),this._debugShowBoundingVolume=e}},debugWireframe:{get:function(){return this._debugWireframe},set:function(e){this._debugWireframe!==e&&this.resetDrawCommands(),this._debugWireframe=e,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===cr.GLTF&&Ft("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltfAsync, otherwise debugWireframe will be ignored.")}},show:{get:function(){return this._show},set:function(e){this._show=e}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),e!==this._featureIdLabel&&(this._featureTableIdDirty=!0),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),e!==this._instanceFeatureIdLabel&&(this._featureTableIdDirty=!0),this._instanceFeatureIdLabel=e}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&(ys.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},lightColor:{get:function(){return this._lightColor},set:function(e){l(e)!==l(this._lightColor)&&this.resetDrawCommands(),this._lightColor=h.clone(e,this._lightColor)}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1,this.resetDrawCommands())}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){e!==this._backFaceCulling&&(this._backFaceCullingDirty=!0),this._backFaceCulling=e}},scale:{get:function(){return this._scale},set:function(e){e!==this._scale&&(this._updateModelMatrix=!0),this._scale=e}},computedScale:{get:function(){return this._computedScale}},minimumPixelSize:{get:function(){return this._minimumPixelSize},set:function(e){e!==this._minimumPixelSize&&(this._updateModelMatrix=!0),this._minimumPixelSize=e}},maximumScale:{get:function(){return this._maximumScale},set:function(e){e!==this._maximumScale&&(this._updateModelMatrix=!0),this._maximumScale=e}},shadows:{get:function(){return this._shadows},set:function(e){e!==this._shadows&&(this._shadowsDirty=!0),this._shadows=e}},credit:{get:function(){return this._credit}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen!==e&&(this._showCreditsOnScreenDirty=!0),this._showCreditsOnScreen=e}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&this.resetDrawCommands(),this._splitDirection=e}},classificationType:{get:function(){return this._classificationType}},pickIds:{get:function(){return this._pickIds}},styleCommandsNeeded:{get:function(){return this._styleCommandsNeeded}}});Co.prototype.getNode=function(e){return this._nodesByName[e]};Co.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};Co.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};Co.prototype.makeStyleDirty=function(){this._styleDirty=!0};Co.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var qUe=new A,$Ue=new q,eke=new A;Co.prototype.update=function(e){let t=!1;try{t=tke(this,e)}catch(n){if(!this._loader.incrementallyLoadTextures&&n.name==="TextureError")cH(this,n);else{let i=qt.getError("model",this._resource,n);cH(this,i)}}if(ike(this,e),nke(this,e),oke(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let n=this._loader.components;if(!l(n)){if(this._loader.isUnloaded())return;let r=qt.getError("model",this._resource,new me("Failed to load model."));cH(r),this._rejectLoad=this._rejectLoad&&this._rejectLoad(r)}let i=n.structuralMetadata;l(i)&&i.propertyTableCount>0&&QUe(this,i);let o=new gW({model:this,modelComponents:n});this._sceneGraph=o,this._gltfCredits=o.components.asset.credits}if(!(!this._resourcesLoaded||e.mode===ie.MORPHING)){if(rke(this),ske(this),ake(this,e),cke(this),lke(this,e),dke(this,e),uke(this,e),mke(this,e),hke(this,e),fke(this,e),this._defaultTexture=e.context.defaultTexture,pke(this,e),bke(this,e),yke(this),gke(this,e),Tke(this,e),!this._ready){e.afterRender.push(()=>{this._ready=!0,this._readyEvent.raiseEvent(this)});return}this._loader.incrementallyLoadTextures&&!this._texturesLoaded&&this._loader.texturesLoaded&&(this.resetDrawCommands(),this._texturesLoaded=!0,this._texturesReadyEvent.raiseEvent(this)),_ke(this),Ske(this,e),Cke(this),Vke(this,e)}};function tke(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function nke(e,t){l(e._customShader)&&e._customShader.update(t)}function ike(e,t){if(l(e._marsOptions)&&l(e._marsOptions.customShaders)){let n=ip.getCache(e._marsOptions.customShaders);for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&n[i].update(t)}}function oke(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function rke(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=jUe(t,e),e._styleDirty=!0,e.resetDrawCommands())}function ske(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function ake(e,t){let n=e._featureTables,i=n.length,o=!1;for(let r=0;r<i;r++)n[r].update(t),n[r].styleCommandsNeededDirty&&(o=!0);o&&Lre(e)}function Lre(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=Um.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function cke(e){let t=e.pointCloudShading;t.attenuation!==e._attenuation&&(e.resetDrawCommands(),e._attenuation=t.attenuation),t.backFaceCulling!==e._pointCloudBackFaceCulling&&(e.resetDrawCommands(),e._pointCloudBackFaceCulling=t.backFaceCulling)}function lke(e,t){e._silhouetteDirty&&(Zre(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function dke(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function uke(e,t){let n=0;e.isClippingEnabled()&&(e._clippingPlanes.owner===e&&e._clippingPlanes.update(t),n=e._clippingPlanes.clippingPlanesState),n!==e._clippingPlanesState&&(e.resetDrawCommands(),e._clippingPlanesState=n)}function mke(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function hke(e,t){let n=t.fog.enabled&&t.fog.renderable;n!==e._fogRenderable&&(e.resetDrawCommands(),e._fogRenderable=n)}function fke(e,t){let n=t.verticalExaggeration!==1;e._verticalExaggerationOn!==n&&(e.resetDrawCommands(),e._verticalExaggerationOn=n)}function pke(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function bke(e,t){A.equals(e.modelMatrix,e._modelMatrix)||(e._updateModelMatrix=!0,e._modelMatrix=A.clone(e.modelMatrix,e._modelMatrix))}var ay=new h,lH=new he;function yke(e){if(!e._updateModelMatrix&&!e._heightDirty&&e._minimumPixelSize===0)return;l(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);let t=e._scene;if(!l(t)||e.heightReference===Qe.NONE){e._clampedModelMatrix=void 0;return}let n=t.globe,i=g(n?.ellipsoid,oe.WGS84),o=e.modelMatrix;ay.x=o[12],ay.y=o[13],ay.z=o[14];let r=i.cartesianToCartographic(ay);if(!l(r)){e._clampedModelMatrix=void 0;return}l(e._clampedModelMatrix)||(e._clampedModelMatrix=A.clone(o,new A)),e._removeUpdateHeightCallback=t.updateHeight(r,Vre(e,i,r),e.heightReference);let s=t.getHeight(r,e.heightReference);if(l(s)){let a=Vre(e,i,r);he.clone(r,lH),lH.height=s,a(lH)}e._heightDirty=!1,e._updateModelMatrix=!0}function gke(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;Rre(e,n),xke(e,n,t)}function Rre(e,t){e._clampedScale=l(e._maximumScale)?Math.min(e._scale,e._maximumScale):e._scale,e._boundingSphere.center=h.multiplyByScalar(e._sceneGraph.boundingSphere.center,e._clampedScale,e._boundingSphere.center),e._boundingSphere.radius=e._initialRadius*e._clampedScale,e._boundingSphere=ce.transform(e._boundingSphere,t,e._boundingSphere)}function xke(e,t,n){let i=e.scale;if(e.minimumPixelSize!==0&&!e._projectTo2D){let o=n.context,r=Math.max(o.drawingBufferWidth,o.drawingBufferHeight);A.getTranslation(t,ay),e._sceneMode!==ie.SCENE3D&&to.computeActualWgs84Position(n,ay,ay);let s=e._boundingSphere.radius,a=Lke(ay,s,n),c=1/a;Math.min(c*(2*s),r)<e.minimumPixelSize&&(i=e.minimumPixelSize*a/(2*e._initialRadius))}e._computedScale=l(e.maximumScale)?Math.min(e.maximumScale,i):i}function _ke(e){if(!e._idDirty)return;e._idDirty=!1;let t=e._id,n=e._pickIds,i=n.length;for(let o=0;o<i;++o)n[o].object.id=t}function Tke(e,t){let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=g(e.referenceMatrix,n),o=t.context,r=e._imageBasedLighting;if(r.useSphericalHarmonicCoefficients||r.useSpecularEnvironmentMaps){let s=$Ue,a=qUe;a=A.multiply(o.uniformState.view3D,i,a),s=A.getMatrix3(a,s),s=q.getRotation(s,s),e._iblReferenceFrameMatrix=q.transpose(s,e._iblReferenceFrameMatrix)}if(e.isClippingEnabled()){let s=eke;s=A.multiply(o.uniformState.view3D,i,s),s=A.multiply(s,e._clippingPlanes.modelMatrix,s),e._clippingPlanesMatrix=A.inverseTranspose(s,e._clippingPlanesMatrix)}}function Ske(e,t){let n=e._sceneGraph;if(e._updateModelMatrix||e._minimumPixelSize!==0){let o=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;n.updateModelMatrix(o,t),e._updateModelMatrix=!1}e._backFaceCullingDirty&&(n.updateBackFaceCulling(e._backFaceCulling),e._backFaceCullingDirty=!1),e._shadowsDirty&&(n.updateShadows(e._shadows),e._shadowsDirty=!1),e._debugShowBoundingVolumeDirty&&(n.updateShowBoundingVolume(e._debugShowBoundingVolume),e._debugShowBoundingVolumeDirty=!1);let i=!1;l(e.classificationType)||(i=e._userAnimationDirty||e._activeAnimations.update(t)),n.update(t,i),e._userAnimationDirty=!1}function Cke(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1,e._credits.length=0;let t=e._showCreditsOnScreen;if(l(e._credit)){let s=Vt.clone(e._credit);s.showOnScreen=s.showOnScreen||t,e._credits.push(s)}let n=e._resourceCredits,i=n.length;for(let s=0;s<i;s++){let a=Vt.clone(n[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}let o=e._gltfCredits,r=o.length;for(let s=0;s<r;s++){let a=Vt.clone(o[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}}function Vke(e,t){let n=Zke(e,t),i=e.isInvisible(),o=e.hasSilhouette(t),r=e._show&&e._computedScale!==0&&n&&(!i||o),s=t.passes,a=s.render||s.pick&&e.allowPicking;r&&!e._ignoreCommands&&a&&(Gke(e,t),e._sceneGraph.pushDrawCommands(t))}var dH=new ce;function Lke(e,t,n){return dH.center=e,dH.radius=t,n.camera.getPixelSize(dH,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var JN=new h;function Vre(e,t,n){return function(i){TS(e.heightReference)&&(i.height+=n.height),t.cartographicToCartesian(i,JN);let o=e._clampedModelMatrix;A.clone(e.modelMatrix,o),o[12]=JN.x,o[13]=JN.y,o[14]=JN.z,e._heightDirty=!0}}var Rke=new h;function Zke(e,t){let n=e.distanceDisplayCondition;if(!l(n))return!0;let i=n.near*n.near,o=n.far*n.far,r;if(t.mode===ie.SCENE2D){let a=(t.camera.frustum.right-t.camera.frustum.left)*.5;r=a*a}else{let s=A.getTranslation(e.modelMatrix,Rke);to.computeActualWgs84Position(t,s,s),r=h.distanceSquared(s,t.camera.positionWC)}return r>=i&&r<=o}function Gke(e,t){let n=t.creditDisplay,i=e._credits,o=i.length;for(let r=0;r<o;r++)n.addCreditToNextFrame(i[r])}Co.prototype.isTranslucent=function(){let e=this.color;return l(e)&&e.alpha>0&&e.alpha<1};Co.prototype.isInvisible=function(){let e=this.color;return l(e)&&e.alpha===0};function Zre(e){return e.context.stencilBuffer}Co.prototype.hasSilhouette=function(e){return Zre(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};Co.prototype.hasSkipLevelOfDetail=function(e){if(!cr.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};Co.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return l(e)&&e.enabled&&e.length!==0};Co.prototype.pick=function(e,t,n,i,o){return PC(this,e,t,n,i,o)};Co.prototype.isDestroyed=function(){return!1};Co.prototype.destroy=function(){let e=this._loader;l(e)&&e.destroy();let t=this._featureTables;if(l(t)){let i=t.length;for(let o=0;o<i;o++)t[o].destroy()}this.destroyPipelineResources(),this.destroyModelResources(),l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),l(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0);let n=this._clippingPlanes;l(n)&&!n.isDestroyed()&&n.owner===this&&n.destroy(),this._clippingPlanes=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,ue(this)};Co.prototype.destroyPipelineResources=function(){let e=this._pipelineResources;for(let t=0;t<e.length;t++)e[t].destroy();this._pipelineResources.length=0,this._pickIds.length=0};Co.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0};Co.fromGltfAsync=async function(e){e=g(e,g.EMPTY_OBJECT);let t=g(e.url,e.gltf),n={releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},i=g(e.basePath,""),o=Xe.createIfNeeded(i);l(t.asset)?(n.gltfJson=t,n.baseResource=o,n.gltfResource=o):t instanceof Uint8Array?(n.typedArray=t,n.baseResource=o,n.gltfResource=o):n.gltfResource=Xe.createIfNeeded(t);let r=new Bp(n),a=l(e.content)?cr.TILE_GLTF:cr.GLTF,c=n.gltfResource,d=SW(r,a,e);d.resource=c;try{await r.load()}catch(y){throw r.destroy(),qt.getError("model",c,y)}let u=e.gltfCallback;l(u)&&u(r.gltfJson);let m=new Co(d),p=m._resource.credits;if(l(p)){let y=p.length;for(let f=0;f<y;f++)m._resourceCredits.push(Vt.clone(p[f]))}return m};Co.fromB3dm=async function(e){let t={b3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},n=new wI(t);try{await n.load();let i=SW(n,cr.TILE_B3DM,e);return new Co(i)}catch(i){throw n.destroy(),i}};Co.fromPnts=async function(e){let t={arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D},n=new TW(t);try{await n.load();let i=SW(n,cr.TILE_PNTS,e);return new Co(i)}catch(i){throw n.destroy(),i}};Co.fromI3dm=async function(e){let t={i3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline},n=new MI(t);try{await n.load();let i=SW(n,cr.TILE_I3DM,e);return new Co(i)}catch(i){throw n.destroy(),i}};Co.fromGeoJson=async function(e){let t={geoJson:e.geoJson},n=new FI(t),i=SW(n,cr.TILE_GEOJSON,e);return new Co(i)};var Eke=new O;Co.prototype.applyColorAndShow=function(e){let t=O.clone(this._color,Eke),n=l(e)&&l(e.color),i=l(e)&&l(e.show);this._color=n?e.color.evaluateColor(void 0,this._color):O.clone(O.WHITE,this._color),this._show=i?e.show.evaluate(void 0):!0,uH(t,this._color)&&this.resetDrawCommands()};Co.prototype.applyStyle=function(e){let t=this.type===cr.TILE_PNTS,n=l(this.featureTableId)&&this.featureTables[this.featureTableId].featuresLength>0,i=l(this.structuralMetadata)?this.structuralMetadata.propertyAttributes:void 0,o=l(i)&&l(i[0]);if(t&&(!n||o)){this.resetDrawCommands();return}n?(this.featureTables[this.featureTableId].applyStyle(e),Lre(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function SW(e,t,n){return{loader:e,type:t,resource:n.resource,show:n.show,modelMatrix:n.modelMatrix,scale:n.scale,minimumPixelSize:n.minimumPixelSize,maximumScale:n.maximumScale,id:n.id,allowPicking:n.allowPicking,clampAnimations:n.clampAnimations,shadows:n.shadows,debugShowBoundingVolume:n.debugShowBoundingVolume,enableDebugWireframe:n.enableDebugWireframe,debugWireframe:n.debugWireframe,cull:n.cull,opaquePass:n.opaquePass,customShader:n.customShader,content:n.content,heightReference:n.heightReference,scene:n.scene,distanceDisplayCondition:n.distanceDisplayCondition,color:n.color,colorBlendAmount:n.colorBlendAmount,colorBlendMode:n.colorBlendMode,silhouetteColor:n.silhouetteColor,silhouetteSize:n.silhouetteSize,enableShowOutline:n.enableShowOutline,showOutline:n.showOutline,outlineColor:n.outlineColor,clippingPlanes:n.clippingPlanes,lightColor:n.lightColor,imageBasedLighting:n.imageBasedLighting,backFaceCulling:n.backFaceCulling,credit:n.credit,showCreditsOnScreen:n.showCreditsOnScreen,splitDirection:n.splitDirection,projectTo2D:n.projectTo2D,enablePick:n.enablePick,featureIdLabel:n.featureIdLabel,instanceFeatureIdLabel:n.instanceFeatureIdLabel,pointCloudShading:n.pointCloudShading,classificationType:n.classificationType,pickObject:n.pickObject,marsOptions:n.marsOptions}}var km=Co;function xs(e,t,n){this._tileset=e,this._tile=t,this._resource=n,this._model=void 0,this._metadata=void 0,this._group=void 0,this._ready=!1}Object.defineProperties(xs.prototype,{featuresLength:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;return l(t)&&l(t[n])?t[n].featuresLength:0}},pointsLength:{get:function(){return this._model.statistics.pointsLength}},trianglesLength:{get:function(){return this._model.statistics.trianglesLength}},geometryByteLength:{get:function(){return this._model.statistics.geometryByteLength}},texturesByteLength:{get:function(){return this._model.statistics.texturesByteLength}},batchTableByteLength:{get:function(){let e=this._model.statistics;return e.propertyTablesByteLength+e.batchTexturesByteLength}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;if(l(t)&&l(t[n]))return t[n]}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}});xs.prototype.getFeature=function(e){let t=this._model,n=t.featureTableId;return t.featureTables[n].getFeature(e)};xs.prototype.hasProperty=function(e,t){let n=this._model,i=n.featureTableId;return l(i)?n.featureTables[i].hasProperty(e,t):!1};xs.prototype.applyDebugSettings=function(e,t){t=e?t:O.WHITE,this.featuresLength===0?this._model.color=t:l(this.batchTable)&&this.batchTable.setAllColor(t)};xs.prototype.applyStyle=function(e){this._model.style=e};xs.prototype.update=function(e,t){let n=this._model,i=this._tile;n.colorBlendAmount=e.colorBlendAmount,n.colorBlendMode=e.colorBlendMode,n.modelMatrix=i.computedTransform,n.customShader=e.customShader,n.featureIdLabel=e.featureIdLabel,n.instanceFeatureIdLabel=e.instanceFeatureIdLabel,n.lightColor=e.lightColor,n.imageBasedLighting=e.imageBasedLighting,n.backFaceCulling=e.backFaceCulling,n.shadows=e.shadows,n.showCreditsOnScreen=e.showCreditsOnScreen,n.splitDirection=e.splitDirection,n.debugWireframe=e.debugWireframe,n.showOutline=e.showOutline,n.outlineColor=e.outlineColor,n.pointCloudShading=e.pointCloudShading;let o=e.clippingPlanes;n.referenceMatrix=e.clippingPlanesOriginMatrix,l(o)&&i.clippingPlanesDirty&&(n._clippingPlanes=o.enabled&&i._isClipped?o:void 0),l(o)&&l(n._clippingPlanes)&&n._clippingPlanes!==o&&(n._clippingPlanes=o,n._clippingPlanesState=0),n.update(t),!this._ready&&n.ready&&(n.activeAnimations.addAll({loop:El.REPEAT}),this._ready=!0)};xs.prototype.isDestroyed=function(){return!1};xs.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),ue(this)};xs.fromGltf=async function(e,t,n,i){let o=new xs(e,t,n),s=CW(e,t,o,{gltf:i,basePath:n}),a=e.vectorClassificationOnly?void 0:e.classificationType;s.classificationType=a;let c=await km.fromGltfAsync(s);return o._model=c,o};xs.fromB3dm=async function(e,t,n,i,o){let r=new xs(e,t,n),a=CW(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=e.vectorClassificationOnly?void 0:e.classificationType;a.classificationType=c;let d=await km.fromB3dm(a);return r._model=d,r};xs.fromI3dm=async function(e,t,n,i,o){let r=new xs(e,t,n),a=CW(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await km.fromI3dm(a);return r._model=c,r};xs.fromPnts=async function(e,t,n,i,o){let r=new xs(e,t,n),a=CW(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await km.fromPnts(a);return r._model=c,r};xs.fromGeoJson=async function(e,t,n,i){let o=new xs(e,t,n),s=CW(e,t,o,{geoJson:i,resource:n}),a=await km.fromGeoJson(s);return o._model=a,o};xs.prototype.pick=function(e,t,n){if(!l(this._model)||!this._ready)return;let i=t.verticalExaggeration,o=t.verticalExaggerationRelativeHeight;return this._model.pick(e,t,i,o,oe.WGS84,n)};function CW(e,t,n,i){let o={cull:!1,releaseGltfJson:!0,opaquePass:Ve.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,customShader:e.customShader,content:n,colorBlendMode:e.colorBlendMode,colorBlendAmount:e.colorBlendAmount,lightColor:e.lightColor,imageBasedLighting:e.imageBasedLighting,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,pointCloudShading:e.pointCloudShading,clippingPlanes:e.clippingPlanes,backFaceCulling:e.backFaceCulling,shadows:e.shadows,showCreditsOnScreen:e.showCreditsOnScreen,splitDirection:e.splitDirection,enableDebugWireframe:e._enableDebugWireframe,debugWireframe:e.debugWireframe,projectTo2D:e._projectTo2D,enablePick:e._enablePick,enableShowOutline:e._enableShowOutline,showOutline:e.showOutline,outlineColor:e.outlineColor,marsOptions:e._marsOptions};return Tt(i,o)}var lf=xs;var LLn=T(S(),1);function pu(e,t,n){this._tileset=e,this._tile=t,this._resource=n,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1}Object.defineProperties(pu.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(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}});pu.fromJson=function(e,t,n,i){let o=new pu(e,t,n);return o._tileset.loadTileset(o._resource,i,o._tile),o._ready=!0,o};pu.prototype.hasProperty=function(e,t){return!1};pu.prototype.getFeature=function(e){};pu.prototype.applyDebugSettings=function(e,t){};pu.prototype.applyStyle=function(e){};pu.prototype.update=function(e,t){};pu.prototype.pick=function(e,t,n){};pu.prototype.isDestroyed=function(){return!1};pu.prototype.destroy=function(){return ue(this)};var VW=pu;var NXn=T(S(),1);var MEn=T(S(),1);var rZn=T(S(),1);var wLn=T(S(),1);function As(e,t,n,i){let o=As._verifyAttributes(t);n=g(n,0);let r=[],s={},a,c,d=o.length;for(let m=0;m<d;++m){let p=o[m];if(p.vertexBuffer){r.push(p);continue}c=p.usage,a=s[c],l(a)||(a=s[c]=[]),a.push(p)}function u(m,p){return Q.getSizeInBytes(p.componentDatatype)-Q.getSizeInBytes(m.componentDatatype)}this._allBuffers=[];for(c in s)if(s.hasOwnProperty(c)){a=s[c],a.sort(u);let m=As._vertexSizeInBytes(a),p=a[0].usage,y={vertexSizeInBytes:m,vertexBuffer:void 0,usage:p,needsCommit:!1,arrayBuffer:void 0,arrayViews:As._createArrayViews(a,m)};this._allBuffers.push(y)}this._size=0,this._instanced=g(i,!1),this._precreated=r,this._context=e,this.writers=void 0,this.va=void 0,this.resize(n)}As._verifyAttributes=function(e){let t=[];for(let i=0;i<e.length;++i){let o=e[i],r={index:g(o.index,i),enabled:g(o.enabled,!0),componentsPerAttribute:o.componentsPerAttribute,componentDatatype:g(o.componentDatatype,Q.FLOAT),normalize:g(o.normalize,!1),vertexBuffer:o.vertexBuffer,usage:g(o.usage,Ue.STATIC_DRAW)};t.push(r)}let n=new Array(t.length);for(let i=0;i<t.length;++i){let r=t[i].index;n[r]=!0}return t};As._vertexSizeInBytes=function(e){let t=0,n=e.length;for(let s=0;s<n;++s){let a=e[s];t+=a.componentsPerAttribute*Q.getSizeInBytes(a.componentDatatype)}let i=n>0?Q.getSizeInBytes(e[0].componentDatatype):0,o=i>0?t%i:0,r=o===0?0:i-o;return t+=r,t};As._createArrayViews=function(e,t){let n=[],i=0,o=e.length;for(let r=0;r<o;++r){let s=e[r],a=s.componentDatatype;n.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:a,normalize:s.normalize,offsetInBytes:i,vertexSizeInComponentType:t/Q.getSizeInBytes(a),view:void 0}),i+=s.componentsPerAttribute*Q.getSizeInBytes(a)}return n};As.prototype.resize=function(e){this._size=e;let t=this._allBuffers;this.writers=[];for(let n=0,i=t.length;n<i;++n){let o=t[n];As._resize(o,this._size),As._appendWriters(this.writers,o)}mH(this)};As._resize=function(e,t){if(e.vertexSizeInBytes>0){let n=new ArrayBuffer(t*e.vertexSizeInBytes);if(l(e.arrayBuffer)){let r=new Uint8Array(n),s=new Uint8Array(e.arrayBuffer),a=s.length;for(let c=0;c<a;++c)r[c]=s[c]}let i=e.arrayViews,o=i.length;for(let r=0;r<o;++r){let s=i[r];s.view=Q.createArrayBufferView(s.componentDatatype,n,s.offsetInBytes)}e.arrayBuffer=n}};var Ike=[function(e,t,n){return function(i,o){t[i*n]=o,e.needsCommit=!0}},function(e,t,n){return function(i,o,r){let s=i*n;t[s]=o,t[s+1]=r,e.needsCommit=!0}},function(e,t,n){return function(i,o,r,s){let a=i*n;t[a]=o,t[a+1]=r,t[a+2]=s,e.needsCommit=!0}},function(e,t,n){return function(i,o,r,s,a){let c=i*n;t[c]=o,t[c+1]=r,t[c+2]=s,t[c+3]=a,e.needsCommit=!0}}];As._appendWriters=function(e,t){let n=t.arrayViews,i=n.length;for(let o=0;o<i;++o){let r=n[o];e[r.index]=Ike[r.componentsPerAttribute-1](t,r.view,r.vertexSizeInComponentType)}};As.prototype.commit=function(e){let t=!1,n=this._allBuffers,i,o,r;for(o=0,r=n.length;o<r;++o)i=n[o],t=Xke(this,i)||t;if(t||!l(this.va)){mH(this);let s=this.va=[],a=W.SIXTY_FOUR_KILOBYTES-4,c=l(e)&&!this._instanced?Math.ceil(this._size/a):1;for(let d=0;d<c;++d){let u=[];for(o=0,r=n.length;o<r;++o){i=n[o];let m=d*(i.vertexSizeInBytes*a);As._appendAttributes(u,i,m,this._instanced)}u=u.concat(this._precreated),s.push({va:new oi({context:this._context,attributes:u,indexBuffer:e}),indicesCount:1.5*(d!==c-1?a:this._size%a)})}}};function Xke(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;let n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,o=l(n);if(!o||n.sizeInBytes<i)return o&&n.destroy(),t.vertexBuffer=ft.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}As._appendAttributes=function(e,t,n,i){let o=t.arrayViews,r=o.length;for(let s=0;s<r;++s){let a=o[s];e.push({index:a.index,enabled:a.enabled,componentsPerAttribute:a.componentsPerAttribute,componentDatatype:a.componentDatatype,normalize:a.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:n+a.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:i?1:0})}};As.prototype.subCommit=function(e,t){let n=this._allBuffers;for(let i=0,o=n.length;i<o;++i)Wke(n[i],e,t)};function Wke(e,t,n){if(e.needsCommit&&e.vertexSizeInBytes>0){let i=e.vertexSizeInBytes*t,o=e.vertexSizeInBytes*n;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,o),i)}}As.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function mH(e){let t=e.va;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].va.destroy();e.va=void 0}As.prototype.isDestroyed=function(){return!1};As.prototype.destroy=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t){let i=e[t];i.vertexBuffer=i.vertexBuffer&&i.vertexBuffer.destroy()}return mH(this),ue(this)};var $p=As;var ALn=T(S(),1),LW=`uniform sampler2D u_atlas;
#ifdef VECTOR_TILE
uniform vec4 u_highlightColor;
#endif
in vec2 v_textureCoordinates;
in vec4 v_pickColor;
in vec4 v_color;
#ifdef SDF
in vec4 v_outlineColor;
in float v_outlineWidth;
#endif
#ifdef FRAGMENT_DEPTH_CHECK
in vec4 v_textureCoordinateBounds; // the min and max x and y values for the texture coordinates
in vec4 v_originTextureCoordinateAndTranslate; // texture coordinate at the origin, billboard translate (used for label glyphs)
in vec4 v_compressed; // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize
in mat2 v_rotationMatrix;
const float SHIFT_LEFT12 = 4096.0;
const float SHIFT_LEFT1 = 2.0;
const float SHIFT_RIGHT12 = 1.0 / 4096.0;
const float SHIFT_RIGHT1 = 1.0 / 2.0;
float getGlobeDepth(vec2 adjustedST, vec2 depthLookupST, bool applyTranslate, vec2 dimensions, vec2 imageSize)
{
vec2 lookupVector = imageSize * (depthLookupST - adjustedST);
lookupVector = v_rotationMatrix * lookupVector;
vec2 labelOffset = (dimensions - imageSize) * (depthLookupST - vec2(0.0, v_originTextureCoordinateAndTranslate.y)); // aligns label glyph with bounding rectangle. Will be zero for billboards because dimensions and imageSize will be equal
vec2 translation = v_originTextureCoordinateAndTranslate.zw;
if (applyTranslate)
{
// this is only needed for labels where the horizontal origin is not LEFT
// it moves the label back to where the "origin" should be since all label glyphs are set to HorizontalOrigin.LEFT
translation += (dimensions * v_originTextureCoordinateAndTranslate.xy * vec2(1.0, 0.0));
}
vec2 st = ((lookupVector - translation + labelOffset) + gl_FragCoord.xy) / czm_viewport.zw;
float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st));
if (logDepthOrDepth == 0.0)
{
return 0.0; // not on the globe
}
vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
return eyeCoordinate.z / eyeCoordinate.w;
}
#endif
#ifdef SDF
// Get the distance from the edge of a glyph at a given position sampling an SDF texture.
float getDistance(vec2 position)
{
return texture(u_atlas, position).r;
}
// Samples the sdf texture at the given position and produces a color based on the fill color and the outline.
vec4 getSDFColor(vec2 position, float outlineWidth, vec4 outlineColor, float smoothing)
{
float distance = getDistance(position);
if (outlineWidth > 0.0)
{
// Don't get the outline edge exceed the SDF_EDGE
float outlineEdge = clamp(SDF_EDGE - outlineWidth, 0.0, SDF_EDGE);
float outlineFactor = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance);
vec4 sdfColor = mix(outlineColor, v_color, outlineFactor);
float alpha = smoothstep(outlineEdge - smoothing, outlineEdge + smoothing, distance);
return vec4(sdfColor.rgb, sdfColor.a * alpha);
}
else
{
float alpha = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance);
return vec4(v_color.rgb, v_color.a * alpha);
}
}
#endif
void main()
{
vec4 color = texture(u_atlas, v_textureCoordinates);
#ifdef SDF
float outlineWidth = v_outlineWidth;
vec4 outlineColor = v_outlineColor;
// Get the current distance
float distance = getDistance(v_textureCoordinates);
#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
float smoothing = fwidth(distance);
// Get an offset that is approximately half the distance to the neighbor pixels
// 0.354 is approximately half of 1/sqrt(2)
vec2 sampleOffset = 0.354 * vec2(dFdx(v_textureCoordinates) + dFdy(v_textureCoordinates));
// Sample the center point
vec4 center = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing);
// Sample the 4 neighbors
vec4 color1 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing);
vec4 color2 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing);
vec4 color3 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing);
vec4 color4 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing);
// Equally weight the center sample and the 4 neighboring samples
color = (center + color1 + color2 + color3 + color4)/5.0;
#else
// If no derivatives available (IE 10?), just do a single sample
float smoothing = 1.0/32.0;
color = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing);
#endif
color = czm_gammaCorrect(color);
#else
color = czm_gammaCorrect(color);
color *= czm_gammaCorrect(v_color);
#endif
// Fully transparent parts of the billboard are not pickable.
#if !defined(OPAQUE) && !defined(TRANSLUCENT)
if (color.a < 0.005) // matches 0/255 and 1/255
{
discard;
}
#else
// The billboard is rendered twice. The opaque pass discards translucent fragments
// and the translucent pass discards opaque fragments.
#ifdef OPAQUE
if (color.a < 0.995) // matches < 254/255
{
discard;
}
#else
if (color.a >= 0.995) // matches 254/255 and 255/255
{
discard;
}
#endif
#endif
#ifdef VECTOR_TILE
color *= u_highlightColor;
#endif
out_FragColor = color;
#ifdef LOG_DEPTH
czm_writeLogDepth();
#endif
#ifdef FRAGMENT_DEPTH_CHECK
float temp = v_compressed.y;
temp = temp * SHIFT_RIGHT1;
float temp2 = (temp - floor(temp)) * SHIFT_LEFT1;
bool enableDepthTest = temp2 != 0.0;
bool applyTranslate = floor(temp) != 0.0;
if (enableDepthTest) {
temp = v_compressed.z;
temp = temp * SHIFT_RIGHT12;
vec2 dimensions;
dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12;
dimensions.x = floor(temp);
temp = v_compressed.w;
temp = temp * SHIFT_RIGHT12;
vec2 imageSize;
imageSize.y = (temp - floor(temp)) * SHIFT_LEFT12;
imageSize.x = floor(temp);
vec2 adjustedST = v_textureCoordinates - v_textureCoordinateBounds.xy;
adjustedST = adjustedST / vec2(v_textureCoordinateBounds.z - v_textureCoordinateBounds.x, v_textureCoordinateBounds.w - v_textureCoordinateBounds.y);
float epsilonEyeDepth = v_compressed.x + czm_epsilon1;
float globeDepth1 = getGlobeDepth(adjustedST, v_originTextureCoordinateAndTranslate.xy, applyTranslate, dimensions, imageSize);
// negative values go into the screen
if (globeDepth1 != 0.0 && globeDepth1 > epsilonEyeDepth)
{
float globeDepth2 = getGlobeDepth(adjustedST, vec2(0.0, 1.0), applyTranslate, dimensions, imageSize); // top left corner
if (globeDepth2 != 0.0 && globeDepth2 > epsilonEyeDepth)
{
float globeDepth3 = getGlobeDepth(adjustedST, vec2(1.0, 1.0), applyTranslate, dimensions, imageSize); // top right corner
if (globeDepth3 != 0.0 && globeDepth3 > epsilonEyeDepth)
{
discard;
}
}
}
}
#endif
}
`;var NLn=T(S(),1),RW=`#ifdef INSTANCED
in vec2 direction;
#endif
in vec4 positionHighAndScale;
in vec4 positionLowAndRotation;
in vec4 compressedAttribute0; // pixel offset, translate, horizontal origin, vertical origin, show, direction, texture coordinates (texture offset)
in vec4 compressedAttribute1; // aligned axis, translucency by distance, image width
in vec4 compressedAttribute2; // label horizontal origin, image height, color, pick color, size in meters, valid aligned axis, 13 bits free
in vec4 eyeOffset; // eye offset in meters, 4 bytes free (texture range)
in vec4 scaleByDistance; // near, nearScale, far, farScale
in vec4 pixelOffsetScaleByDistance; // near, nearScale, far, farScale
in vec4 compressedAttribute3; // distance display condition near, far, disableDepthTestDistance, dimensions
in vec2 sdf; // sdf outline color (rgb) and width (w)
#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK)
in vec4 textureCoordinateBoundsOrLabelTranslate; // the min and max x and y values for the texture coordinates
#endif
#ifdef VECTOR_TILE
in float a_batchId;
#endif
out vec2 v_textureCoordinates;
#ifdef FRAGMENT_DEPTH_CHECK
out vec4 v_textureCoordinateBounds;
out vec4 v_originTextureCoordinateAndTranslate;
out vec4 v_compressed; // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize
out mat2 v_rotationMatrix;
#endif
out vec4 v_pickColor;
out vec4 v_color;
#ifdef SDF
out vec4 v_outlineColor;
out float v_outlineWidth;
#endif
const float UPPER_BOUND = 32768.0;
const float SHIFT_LEFT16 = 65536.0;
const float SHIFT_LEFT12 = 4096.0;
const float SHIFT_LEFT8 = 256.0;
const float SHIFT_LEFT7 = 128.0;
const float SHIFT_LEFT5 = 32.0;
const float SHIFT_LEFT3 = 8.0;
const float SHIFT_LEFT2 = 4.0;
const float SHIFT_LEFT1 = 2.0;
const float SHIFT_RIGHT12 = 1.0 / 4096.0;
const float SHIFT_RIGHT8 = 1.0 / 256.0;
const float SHIFT_RIGHT7 = 1.0 / 128.0;
const float SHIFT_RIGHT5 = 1.0 / 32.0;
const float SHIFT_RIGHT3 = 1.0 / 8.0;
const float SHIFT_RIGHT2 = 1.0 / 4.0;
const float SHIFT_RIGHT1 = 1.0 / 2.0;
vec4 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)
{
// Note the halfSize cannot be computed in JavaScript because it is sent via
// compressed vertex attributes that coerce it to an integer.
vec2 halfSize = imageSize * scale * 0.5;
halfSize *= ((direction * 2.0) - 1.0);
vec2 originTranslate = origin * abs(halfSize);
#if defined(ROTATION) || defined(ALIGNED_AXIS)
if (validAlignedAxis || rotation != 0.0)
{
float angle = rotation;
if (validAlignedAxis)
{
vec4 projectedAlignedAxis = czm_modelView3D * vec4(alignedAxis, 0.0);
angle += sign(-projectedAlignedAxis.x) * acos(sign(projectedAlignedAxis.y) * (projectedAlignedAxis.y * projectedAlignedAxis.y) /
(projectedAlignedAxis.x * projectedAlignedAxis.x + projectedAlignedAxis.y * projectedAlignedAxis.y));
}
float cosTheta = cos(angle);
float sinTheta = sin(angle);
rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta);
halfSize = rotationMatrix * halfSize;
}
else
{
rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0);
}
#endif
mpp = czm_metersPerPixel(positionEC);
positionEC.xy += (originTranslate + halfSize) * czm_branchFreeTernary(sizeInMeters, 1.0, mpp);
positionEC.xy += (translate + pixelOffset) * mpp;
return positionEC;
}
#ifdef VERTEX_DEPTH_CHECK
float getGlobeDepth(vec4 positionEC)
{
vec4 posWC = czm_eyeToWindowCoordinates(positionEC);
float globeDepth = czm_unpackDepth(texture(czm_globeDepthTexture, posWC.xy / czm_viewport.zw));
if (globeDepth == 0.0)
{
return 0.0; // not on the globe
}
vec4 eyeCoordinate = czm_windowToEyeCoordinates(posWC.xy, globeDepth);
return eyeCoordinate.z / eyeCoordinate.w;
}
#endif
void main()
{
// Modifying this shader may also require modifications to Billboard._computeScreenSpacePosition
// unpack attributes
vec3 positionHigh = positionHighAndScale.xyz;
vec3 positionLow = positionLowAndRotation.xyz;
float scale = positionHighAndScale.w;
#if defined(ROTATION) || defined(ALIGNED_AXIS)
float rotation = positionLowAndRotation.w;
#else
float rotation = 0.0;
#endif
float compressed = compressedAttribute0.x;
vec2 pixelOffset;
pixelOffset.x = floor(compressed * SHIFT_RIGHT7);
compressed -= pixelOffset.x * SHIFT_LEFT7;
pixelOffset.x -= UPPER_BOUND;
vec2 origin;
origin.x = floor(compressed * SHIFT_RIGHT5);
compressed -= origin.x * SHIFT_LEFT5;
origin.y = floor(compressed * SHIFT_RIGHT3);
compressed -= origin.y * SHIFT_LEFT3;
#ifdef FRAGMENT_DEPTH_CHECK
vec2 depthOrigin = origin.xy;
#endif
origin -= vec2(1.0);
float show = floor(compressed * SHIFT_RIGHT2);
compressed -= show * SHIFT_LEFT2;
#ifdef INSTANCED
vec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w);
vec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w);
vec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange;
#else
vec2 direction;
direction.x = floor(compressed * SHIFT_RIGHT1);
direction.y = compressed - direction.x * SHIFT_LEFT1;
vec2 textureCoordinates = czm_decompressTextureCoordinates(compressedAttribute0.w);
#endif
float temp = compressedAttribute0.y * SHIFT_RIGHT8;
pixelOffset.y = -(floor(temp) - UPPER_BOUND);
vec2 translate;
translate.y = (temp - floor(temp)) * SHIFT_LEFT16;
temp = compressedAttribute0.z * SHIFT_RIGHT8;
translate.x = floor(temp) - UPPER_BOUND;
translate.y += (temp - floor(temp)) * SHIFT_LEFT8;
translate.y -= UPPER_BOUND;
temp = compressedAttribute1.x * SHIFT_RIGHT8;
float temp2 = floor(compressedAttribute2.w * SHIFT_RIGHT2);
vec2 imageSize = vec2(floor(temp), temp2);
#ifdef FRAGMENT_DEPTH_CHECK
float labelHorizontalOrigin = floor(compressedAttribute2.w - (temp2 * SHIFT_LEFT2));
float applyTranslate = 0.0;
if (labelHorizontalOrigin != 0.0) // is a billboard, so set apply translate to false
{
applyTranslate = 1.0;
labelHorizontalOrigin -= 2.0;
depthOrigin.x = labelHorizontalOrigin + 1.0;
}
depthOrigin = vec2(1.0) - (depthOrigin * 0.5);
#endif
#ifdef EYE_DISTANCE_TRANSLUCENCY
vec4 translucencyByDistance;
translucencyByDistance.x = compressedAttribute1.z;
translucencyByDistance.z = compressedAttribute1.w;
translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;
temp = compressedAttribute1.y * SHIFT_RIGHT8;
translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;
#endif
#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK)
temp = compressedAttribute3.w;
temp = temp * SHIFT_RIGHT12;
vec2 dimensions;
dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12;
dimensions.x = floor(temp);
#endif
#ifdef ALIGNED_AXIS
vec3 alignedAxis = czm_octDecode(floor(compressedAttribute1.y * SHIFT_RIGHT8));
temp = compressedAttribute2.z * SHIFT_RIGHT5;
bool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0;
#else
vec3 alignedAxis = vec3(0.0);
bool validAlignedAxis = false;
#endif
vec4 pickColor;
vec4 color;
temp = compressedAttribute2.y;
temp = temp * SHIFT_RIGHT8;
pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8;
temp = floor(temp) * SHIFT_RIGHT8;
pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8;
pickColor.r = floor(temp);
temp = compressedAttribute2.x;
temp = temp * SHIFT_RIGHT8;
color.b = (temp - floor(temp)) * SHIFT_LEFT8;
temp = floor(temp) * SHIFT_RIGHT8;
color.g = (temp - floor(temp)) * SHIFT_LEFT8;
color.r = floor(temp);
temp = compressedAttribute2.z * SHIFT_RIGHT8;
bool sizeInMeters = floor((temp - floor(temp)) * SHIFT_LEFT7) > 0.0;
temp = floor(temp) * SHIFT_RIGHT8;
pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;
pickColor /= 255.0;
color.a = floor(temp);
color /= 255.0;
///////////////////////////////////////////////////////////////////////////
vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
vec4 positionEC = czm_modelViewRelativeToEye * p;
#if defined(FRAGMENT_DEPTH_CHECK) || defined(VERTEX_DEPTH_CHECK)
float eyeDepth = positionEC.z;
#endif
positionEC = czm_eyeOffset(positionEC, eyeOffset.xyz);
positionEC.xyz *= show;
///////////////////////////////////////////////////////////////////////////
#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE)
float lengthSq;
if (czm_sceneMode == czm_sceneMode2D)
{
// 2D camera distance is a special case
// treat all billboards as flattened to the z=0.0 plane
lengthSq = czm_eyeHeight2D.y;
}
else
{
lengthSq = dot(positionEC.xyz, positionEC.xyz);
}
#endif
#ifdef EYE_DISTANCE_SCALING
float distanceScale = czm_nearFarScalar(scaleByDistance, lengthSq);
scale *= distanceScale;
translate *= distanceScale;
// push vertex behind near plane for clipping
if (scale == 0.0)
{
positionEC.xyz = vec3(0.0);
}
#endif
float translucency = 1.0;
#ifdef EYE_DISTANCE_TRANSLUCENCY
translucency = czm_nearFarScalar(translucencyByDistance, lengthSq);
// push vertex behind near plane for clipping
if (translucency == 0.0)
{
positionEC.xyz = vec3(0.0);
}
#endif
#ifdef EYE_DISTANCE_PIXEL_OFFSET
float pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq);
pixelOffset *= pixelOffsetScale;
#endif
#ifdef DISTANCE_DISPLAY_CONDITION
float nearSq = compressedAttribute3.x;
float farSq = compressedAttribute3.y;
if (lengthSq < nearSq || lengthSq > farSq)
{
positionEC.xyz = vec3(0.0);
}
#endif
mat2 rotationMatrix;
float mpp;
#ifdef DISABLE_DEPTH_DISTANCE
float disableDepthTestDistance = compressedAttribute3.z;
#endif
#ifdef VERTEX_DEPTH_CHECK
if (lengthSq < disableDepthTestDistance) {
float depthsilon = 10.0;
vec2 labelTranslate = textureCoordinateBoundsOrLabelTranslate.xy;
vec4 pEC1 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
float globeDepth1 = getGlobeDepth(pEC1);
if (globeDepth1 != 0.0 && pEC1.z + depthsilon < globeDepth1)
{
vec4 pEC2 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0, 1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
float globeDepth2 = getGlobeDepth(pEC2);
if (globeDepth2 != 0.0 && pEC2.z + depthsilon < globeDepth2)
{
vec4 pEC3 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
float globeDepth3 = getGlobeDepth(pEC3);
if (globeDepth3 != 0.0 && pEC3.z + depthsilon < globeDepth3)
{
positionEC.xyz = vec3(0.0);
}
}
}
}
#endif
positionEC = addScreenSpaceOffset(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
gl_Position = czm_projection * positionEC;
v_textureCoordinates = textureCoordinates;
#ifdef LOG_DEPTH
czm_vertexLogDepth();
#endif
#ifdef DISABLE_DEPTH_DISTANCE
if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)
{
disableDepthTestDistance = czm_minimumDisableDepthTestDistance;
}
if (disableDepthTestDistance != 0.0)
{
// Don't try to "multiply both sides" by w. Greater/less-than comparisons won't work for negative values of w.
float zclip = gl_Position.z / gl_Position.w;
bool clipped = (zclip < -1.0 || zclip > 1.0);
if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance)))
{
// Position z on the near plane.
gl_Position.z = -gl_Position.w;
#ifdef LOG_DEPTH
v_depthFromNearPlusOne = 1.0;
#endif
}
}
#endif
#ifdef FRAGMENT_DEPTH_CHECK
if (sizeInMeters) {
translate /= mpp;
dimensions /= mpp;
imageSize /= mpp;
}
#if defined(ROTATION) || defined(ALIGNED_AXIS)
v_rotationMatrix = rotationMatrix;
#else
v_rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0);
#endif
float enableDepthCheck = 0.0;
if (lengthSq < disableDepthTestDistance)
{
enableDepthCheck = 1.0;
}
float dw = floor(clamp(dimensions.x, 0.0, SHIFT_LEFT12));
float dh = floor(clamp(dimensions.y, 0.0, SHIFT_LEFT12));
float iw = floor(clamp(imageSize.x, 0.0, SHIFT_LEFT12));
float ih = floor(clamp(imageSize.y, 0.0, SHIFT_LEFT12));
v_compressed.x = eyeDepth;
v_compressed.y = applyTranslate * SHIFT_LEFT1 + enableDepthCheck;
v_compressed.z = dw * SHIFT_LEFT12 + dh;
v_compressed.w = iw * SHIFT_LEFT12 + ih;
v_originTextureCoordinateAndTranslate.xy = depthOrigin;
v_originTextureCoordinateAndTranslate.zw = translate;
v_textureCoordinateBounds = textureCoordinateBoundsOrLabelTranslate;
#endif
#ifdef SDF
vec4 outlineColor;
float outlineWidth;
temp = sdf.x;
temp = temp * SHIFT_RIGHT8;
outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8;
temp = floor(temp) * SHIFT_RIGHT8;
outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8;
outlineColor.r = floor(temp);
temp = sdf.y;
temp = temp * SHIFT_RIGHT8;
float temp3 = (temp - floor(temp)) * SHIFT_LEFT8;
temp = floor(temp) * SHIFT_RIGHT8;
outlineWidth = (temp - floor(temp)) * SHIFT_LEFT8;
outlineColor.a = floor(temp);
outlineColor /= 255.0;
v_outlineWidth = outlineWidth / 255.0;
v_outlineColor = outlineColor;
v_outlineColor.a *= translucency;
#endif
v_pickColor = pickColor;
v_color = color;
v_color.a *= translucency;
}
`;var sRn=T(S(),1);function Vi(e,t){e=g(e,g.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=vt.clone(n)),l(i)&&(i=vt.clone(i)),l(o)&&(o=vt.clone(o)),l(r)&&(r=It.clone(r)),this._show=g(e.show,!0),this._position=h.clone(g(e.position,h.ZERO)),this._actualPosition=h.clone(this._position),this._pixelOffset=B.clone(g(e.pixelOffset,B.ZERO)),this._translate=new B(0,0),this._eyeOffset=h.clone(g(e.eyeOffset,h.ZERO)),this._heightReference=g(e.heightReference,Qe.NONE),this._verticalOrigin=g(e.verticalOrigin,vn.CENTER),this._horizontalOrigin=g(e.horizontalOrigin,bi.CENTER),this._scale=g(e.scale,1),this._color=O.clone(g(e.color,O.WHITE)),this._rotation=g(e.rotation,0),this._alignedAxis=h.clone(g(e.alignedAxis,h.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=o,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=g(e.sizeInMeters,!1),this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=g(e.collection,t),this._pickId=void 0,this._pickPrimitive=g(e._pickPrimitive,this),this._billboardCollection=t,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;let s=e.image,a=e.imageId;l(s)&&(l(a)||(typeof s=="string"?a=s:l(s.src)?a=s.src:a=Hn()),this._imageId=a,this._image=s),l(e.imageSubRegion)&&(this._imageId=a,this._imageSubRegion=e.imageSubRegion),l(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=ie.SCENE3D,this._clusterShow=!0,this._outlineColor=O.clone(g(e.outlineColor,O.BLACK)),this._outlineWidth=g(e.outlineWidth,0),this._updateClamping()}var Gre=Vi.SHOW_INDEX=0,jN=Vi.POSITION_INDEX=1,Wre=Vi.PIXEL_OFFSET_INDEX=2,Pke=Vi.EYE_OFFSET_INDEX=3,vke=Vi.HORIZONTAL_ORIGIN_INDEX=4,wke=Vi.VERTICAL_ORIGIN_INDEX=5,Fke=Vi.SCALE_INDEX=6,qN=Vi.IMAGE_INDEX_INDEX=7,Ere=Vi.COLOR_INDEX=8,Ake=Vi.ROTATION_INDEX=9,Mke=Vi.ALIGNED_AXIS_INDEX=10,Nke=Vi.SCALE_BY_DISTANCE_INDEX=11,Uke=Vi.TRANSLUCENCY_BY_DISTANCE_INDEX=12,kke=Vi.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,Dke=Vi.DISTANCE_DISPLAY_CONDITION=14,Bke=Vi.DISABLE_DEPTH_DISTANCE=15;Vi.TEXTURE_COORDINATE_BOUNDS=16;var Ire=Vi.SDF_INDEX=17;Vi.NUMBER_OF_PROPERTIES=18;function Mo(e,t){let n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(Vi.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Mo(this,Gre))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),h.clone(e,this._actualPosition),this._updateClamping(),Mo(this,jN))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),Mo(this,jN))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;B.equals(t,e)||(B.clone(e,t),Mo(this,Wre))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;vt.equals(t,e)||(this._scaleByDistance=vt.clone(e,t),Mo(this,Nke))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;vt.equals(t,e)||(this._translucencyByDistance=vt.clone(e,t),Mo(this,Uke))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;vt.equals(t,e)||(this._pixelOffsetScaleByDistance=vt.clone(e,t),Mo(this,kke))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;h.equals(t,e)||(h.clone(e,t),Mo(this,Pke))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Mo(this,vke))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,Mo(this,wke))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,Mo(this,Fke))}},color:{get:function(){return this._color},set:function(e){let t=this._color;O.equals(t,e)||(O.clone(e,t),Mo(this,Ere))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,Mo(this,Ake))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;h.equals(t,e)||(h.clone(e,t),Mo(this,Mke))}},width:{get:function(){return g(this._width,this._imageWidth)},set:function(e){this._width!==e&&(this._width=e,Mo(this,qN))}},height:{get:function(){return g(this._height,this._imageHeight)},set:function(e){this._height!==e&&(this._height=e,Mo(this,qN))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,Mo(this,Ere))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){It.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=It.clone(e,this._distanceDisplayCondition),Mo(this,Dke))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Mo(this,Bke))}},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)?typeof e=="string"?this.setImage(e,e):e instanceof Xe?this.setImage(e.url,e):l(e.src)?this.setImage(e.src,e):this.setImage(Hn(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,Mo(this,qN))}},ready:{get:function(){return this._imageIndex!==-1}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=h.clone(e,this._actualClampedPosition),Mo(this,jN)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Mo(this,Gre))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;O.equals(t,e)||(O.clone(e,t),Mo(this,Ire))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Mo(this,Ire))}}});Vi.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};Vi.prototype._updateClamping=function(){Vi._updateClamping(this._billboardCollection,this)};var $N=new he;Vi._updateClamping=function(e,t){let n=e._scene;if(!l(n))return;let i=n.globe,o=g(i?.ellipsoid,oe.WGS84),r=n.frameState.mode,s=r!==t._mode;if(t._mode=r,(t._heightReference===Qe.NONE||s)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference===Qe.NONE||!l(t._position))return;l(t._removeCallbackFunc)&&t._removeCallbackFunc();let a=o.cartesianToCartographic(t._position);if(!l(a)){t._actualClampedPosition=void 0;return}function c(u){t._clampedPosition=o.cartographicToCartesian(u,t._clampedPosition),TS(t._heightReference)&&(t._mode===ie.SCENE3D?(u.height+=a.height,o.cartographicToCartesian(u,t._clampedPosition)):t._clampedPosition.x+=a.height)}t._removeCallbackFunc=n.updateHeight(a,c,t._heightReference),he.clone(a,$N);let d=n.getHeight(a,t._heightReference);l(d)&&($N.height=d),c($N)};Vi.prototype._loadImage=function(){let e=this._billboardCollection._textureAtlas,t=this._imageId,n=this._image,i=this._imageSubRegion,o,r=this;function s(c){if(r._imageId!==t||r._image!==n||!De.equals(r._imageSubRegion,i))return;let d=e.textureCoordinates[c];r._imageWidth=e.texture.width*d.width,r._imageHeight=e.texture.height*d.height,r._imageIndex=c,r._ready=!0,r._image=void 0,r._imageIndexPromise=void 0,Mo(r,qN);let u=r._billboardCollection._scene;l(u)&&u.frameState.afterRender.push(()=>!0)}if(l(n)&&(o=e.addImage(t,n)),l(i)&&(o=e.addSubRegion(t,i)),this._imageIndexPromise=o,!l(o))return;let a=e.getImageIndex(t);if(l(a)&&!l(i)){s(a);return}o.then(s).catch(function(c){console.error(`Error loading image for billboard: ${c}`),r._imageIndexPromise=void 0})};Vi.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())};Vi.prototype.setImageSubRegion=function(e,t){this._imageId===e&&De.equals(this._imageSubRegion,t)||(this._imageIndex=-1,this._imageId=e,this._imageSubRegion=De.clone(t),l(this._billboardCollection._textureAtlas)&&this._loadImage())};Vi.prototype._setTranslate=function(e){let t=this._translate;B.equals(t,e)||(B.clone(e,t),Mo(this,Wre))};Vi.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition};Vi.prototype._setActualPosition=function(e){l(this._clampedPosition)||h.clone(e,this._actualPosition),Mo(this,jN)};var Xre=new se;Vi._computeActualPosition=function(e,t,n,i){return l(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===ie.SCENE3D?t:(A.multiplyByPoint(i,t,Xre),to.computeActualWgs84Position(n,Xre))};var Pre=new h;Vi._computeScreenSpacePosition=function(e,t,n,i,o,r){let s=A.multiplyByPoint(e,t,Pre),a=to.wgs84WithEyeOffsetToWindowCoordinates(o,s,n,r);if(l(a))return B.add(a,i,a),a};var QN=new B(0,0);Vi.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new B),B.clone(this._pixelOffset,QN),B.add(QN,this._translate,QN);let i=n.modelMatrix,o=this._position;if(l(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==ie.SCENE3D)){let s=e.mapProjection,a=s.ellipsoid,c=s.unproject(o,$N);o=a.cartographicToCartesian(c,Pre),i=A.IDENTITY}return Vi._computeScreenSpacePosition(i,o,this._eyeOffset,QN,e,t)};Vi.getScreenSpaceBoundingBox=function(e,t,n){let i=e.width,o=e.height,r=e.scale;i*=r,o*=r;let s=t.x;e.horizontalOrigin===bi.RIGHT?s-=i:e.horizontalOrigin===bi.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===vn.BOTTOM||e.verticalOrigin===vn.BASELINE?a-=o:e.verticalOrigin===vn.CENTER&&(a-=o*.5),l(n)||(n=new De),n.x=s,n.y=a,n.width=i,n.height=o,n};Vi.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&h.equals(this._position,e._position)&&this._imageId===e._imageId&&this._show===e._show&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&De.equals(this._imageSubRegion,e._imageSubRegion)&&O.equals(this._color,e._color)&&B.equals(this._pixelOffset,e._pixelOffset)&&B.equals(this._translate,e._translate)&&h.equals(this._eyeOffset,e._eyeOffset)&&vt.equals(this._scaleByDistance,e._scaleByDistance)&&vt.equals(this._translucencyByDistance,e._translucencyByDistance)&&vt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&It.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance};Vi.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};var Hi=Vi;var cRn=T(S(),1),Oke={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2},Zo=Object.freeze(Oke);var dRn=T(S(),1),Yke={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},Ms=Object.freeze(Yke);var CRn=T(S(),1);function e0(e,t,n,i,o){this.bottomLeft=g(e,B.ZERO),this.topRight=g(t,B.ZERO),this.childNode1=n,this.childNode2=i,this.imageIndex=o}var Hke=new B(16,16);function cy(e){e=g(e,g.EMPTY_OBJECT);let t=g(e.borderWidthInPixels,1),n=g(e.initialSize,Hke);this._context=e.context,this._pixelFormat=g(e.pixelFormat,at.RGBA),this._borderWidthInPixels=t,this._textureCoordinates=[],this._guid=Hn(),this._idHash={},this._indexHash={},this._initialSize=n,this._root=void 0}Object.defineProperties(cy.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},textureCoordinates:{get:function(){return this._textureCoordinates}},texture:{get:function(){return l(this._texture)||(this._texture=new wt({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}}});function Kke(e,t){let n=e._context,i=e.numberOfImages,o=2,r=e._borderWidthInPixels;if(i>0){let s=e._texture.width,a=e._texture.height,c=o*(s+t.width+r),d=o*(a+t.height+r),u=s/c,m=a/d,p=new e0(new B(s+r,r),new B(c,a)),y=new e0(new B,new B(c,a),e._root,p),f=new e0(new B(r,a+r),new B(c,d)),x=new e0(new B,new B(c,d),y,f);for(let V=0;V<e._textureCoordinates.length;V++){let L=e._textureCoordinates[V];l(L)&&(L.x*=u,L.y*=m,L.width*=u,L.height*=m)}let _=new wt({context:e._context,width:c,height:d,pixelFormat:e._pixelFormat}),C=new na({context:n,colorTextures:[e._texture],destroyAttachments:!1});C._bind(),_.copyFromFramebuffer(0,0,0,0,c,d),C._unBind(),C.destroy(),e._texture=e._texture&&e._texture.destroy(),e._texture=_,e._root=x}else{let s=o*(t.width+2*r),a=o*(t.height+2*r);s<e._initialSize.x&&(s=e._initialSize.x),a<e._initialSize.y&&(a=e._initialSize.y),e._texture=e._texture&&e._texture.destroy(),e._texture=new wt({context:e._context,width:s,height:a,pixelFormat:e._pixelFormat}),e._root=new e0(new B(r,r),new B(s,a))}}function e5(e,t,n){if(l(t)){if(!l(t.childNode1)&&!l(t.childNode2)){if(l(t.imageIndex))return;let i=t.topRight.x-t.bottomLeft.x,o=t.topRight.y-t.bottomLeft.y,r=i-n.width,s=o-n.height;if(r<0||s<0)return;if(r===0&&s===0)return t;if(r>s){t.childNode1=new e0(new B(t.bottomLeft.x,t.bottomLeft.y),new B(t.bottomLeft.x+n.width,t.topRight.y));let a=t.bottomLeft.x+n.width+e._borderWidthInPixels;a<t.topRight.x&&(t.childNode2=new e0(new B(a,t.bottomLeft.y),new B(t.topRight.x,t.topRight.y)))}else{t.childNode1=new e0(new B(t.bottomLeft.x,t.bottomLeft.y),new B(t.topRight.x,t.bottomLeft.y+n.height));let a=t.bottomLeft.y+n.height+e._borderWidthInPixels;a<t.topRight.y&&(t.childNode2=new e0(new B(t.bottomLeft.x,a),new B(t.topRight.x,t.topRight.y)))}return e5(e,t.childNode1,n)}return e5(e,t.childNode1,n)||e5(e,t.childNode2,n)}}function vre(e,t,n){let i=e5(e,e._root,t);if(l(i)){i.imageIndex=n;let o=e._texture.width,r=e._texture.height,s=i.topRight.x-i.bottomLeft.x,a=i.topRight.y-i.bottomLeft.y,c=i.bottomLeft.x/o,d=i.bottomLeft.y/r,u=s/o,m=a/r;e._textureCoordinates[n]=new De(c,d,u,m),e._texture.copyFrom({source:t,xOffset:i.bottomLeft.x,yOffset:i.bottomLeft.y})}else Kke(e,t),vre(e,t,n);e._guid=Hn()}function wre(e,t){if(!l(e)||e.isDestroyed())return-1;let n=e.numberOfImages;return vre(e,t,n),n}cy.prototype.getImageIndex=function(e){return this._indexHash[e]};cy.prototype.addImageSync=function(e,t){let n=this._indexHash[e];return l(n)||(n=wre(this,t),this._idHash[e]=Promise.resolve(n),this._indexHash[e]=n),n};cy.prototype.addImage=function(e,t){let n=this._idHash[e];if(l(n))return n;typeof t=="function"?t=t(e):(typeof t=="string"||t instanceof Xe)&&(t=Xe.createIfNeeded(t).fetchImage());let i=this;return n=Promise.resolve(t).then(function(o){let r=wre(i,o);return i._indexHash[e]=r,r}),this._idHash[e]=n,n};cy.prototype.addSubRegion=function(e,t){let n=this._idHash[e];if(!l(n))throw new me(`image with id "${e}" not found in the atlas.`);let i=this;return Promise.resolve(n).then(function(o){if(o===-1)return-1;let r=i._texture.width,s=i._texture.height,a=i._textureCoordinates[o],c=a.x+t.x/r,d=a.y+t.y/s,u=t.width/r,m=t.height/s,p=i._textureCoordinates.push(new De(c,d,u,m))-1;return i._indexHash[e]=p,i._guid=Hn(),p})};cy.prototype.isDestroyed=function(){return!1};cy.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),ue(this)};var ly=cy;var zke=Hi.SHOW_INDEX,GW=Hi.POSITION_INDEX,Fre=Hi.PIXEL_OFFSET_INDEX,Are=Hi.EYE_OFFSET_INDEX,Jke=Hi.HORIZONTAL_ORIGIN_INDEX,Qke=Hi.VERTICAL_ORIGIN_INDEX,jke=Hi.SCALE_INDEX,ZW=Hi.IMAGE_INDEX_INDEX,Mre=Hi.COLOR_INDEX,qke=Hi.ROTATION_INDEX,$ke=Hi.ALIGNED_AXIS_INDEX,Nre=Hi.SCALE_BY_DISTANCE_INDEX,Ure=Hi.TRANSLUCENCY_BY_DISTANCE_INDEX,kre=Hi.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,Dre=Hi.DISTANCE_DISPLAY_CONDITION,eDe=Hi.DISABLE_DEPTH_DISTANCE,tDe=Hi.TEXTURE_COORDINATE_BOUNDS,Bre=Hi.SDF_INDEX,xH=Hi.NUMBER_OF_PROPERTIES,Vo,nDe={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},iDe={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};function gu(e){e=g(e,g.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(xH),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new ce,this._baseVolumeWC=new ce,this._baseVolume2D=new ce,this._boundingVolume=new ce,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=g(e.show,!0),this.modelMatrix=A.clone(g(e.modelMatrix,A.IDENTITY)),this._modelMatrix=A.clone(A.IDENTITY),this.debugShowBoundingVolume=g(e.debugShowBoundingVolume,!1),this.debugShowTextureAtlas=g(e.debugShowTextureAtlas,!1),this.blendOption=g(e.blendOption,Zo.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=ie.SCENE3D,this._buffersUsage=[Ue.STATIC_DRAW,Ue.STATIC_DRAW,Ue.STATIC_DRAW,Ue.STATIC_DRAW,Ue.STATIC_DRAW,Ue.STATIC_DRAW,Ue.STATIC_DRAW,Ue.STATIC_DRAW,Ue.STATIC_DRAW,Ue.STATIC_DRAW,Ue.STATIC_DRAW,Ue.STATIC_DRAW,Ue.STATIC_DRAW,Ue.STATIC_DRAW,Ue.STATIC_DRAW,Ue.STATIC_DRAW],this._highlightColor=O.clone(O.WHITE);let t=this;this._uniforms={u_atlas:function(){return t._textureAtlas.texture},u_highlightColor:function(){return t._highlightColor}};let n=this._scene;l(n)&&l(n.terrainProviderChanged)&&(this._removeCallbackFunc=n.terrainProviderChanged.addEventListener(function(){let i=this._billboards,o=i.length;for(let r=0;r<o;++r)l(i[r])&&i[r]._updateClamping()},this))}Object.defineProperties(gu.prototype,{length:{get:function(){return _H(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}}});function Ore(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}gu.prototype.add=function(e){let t=new Hi(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};gu.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};gu.prototype.removeAll=function(){Ore(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function _H(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;let t=[],n=e._billboards,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];l(s)&&(s._index=r++,t.push(s))}e._billboards=t}}gu.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};gu.prototype.contains=function(e){return l(e)&&e._billboardCollection===this};gu.prototype.get=function(e){return _H(this),this._billboards[e]};var hH;function oDe(e){let n=e.cache.billboardCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,o=new Uint16Array(i);for(let r=0,s=0;r<i;r+=6,s+=4)o[r]=s,o[r+1]=s+1,o[r+2]=s+2,o[r+3]=s+0,o[r+4]=s+2,o[r+5]=s+3;return n=ft.createIndexBuffer({context:e,typedArray:o,usage:Ue.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=n,n}function rDe(e){let t=e.cache.billboardCollection_indexBufferInstanced;return l(t)||(t=ft.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Ue.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function sDe(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return l(t)||(t=ft.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Ue.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}gu.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<xH;++i){let o=n[i]===0?Ue.STATIC_DRAW:Ue.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function aDe(e,t,n,i,o,r){let s=[{index:Vo.positionHighAndScale,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[GW]},{index:Vo.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[GW]},{index:Vo.compressedAttribute0,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[Fre]},{index:Vo.compressedAttribute1,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[Ure]},{index:Vo.compressedAttribute2,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[Mre]},{index:Vo.eyeOffset,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[Are]},{index:Vo.scaleByDistance,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[Nre]},{index:Vo.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[kre]},{index:Vo.compressedAttribute3,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[Dre]},{index:Vo.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[tDe]}];i&&s.push({index:Vo.direction,componentsPerAttribute:2,componentDatatype:Q.FLOAT,vertexBuffer:sDe(e)}),l(o)&&s.push({index:Vo.a_batchId,componentsPerAttribute:1,componentDatatype:Q.FLOAT,bufferUsage:Ue.STATIC_DRAW}),r&&s.push({index:Vo.sdf,componentsPerAttribute:2,componentDatatype:Q.FLOAT,usage:n[Bre]});let a=i?t:4*t;return new $p(e,s,a,i)}var fH=new Kn;function Yre(e,t,n,i,o){let r,s=i[Vo.positionHighAndScale],a=i[Vo.positionLowAndRotation],c=o._getActualPosition();e._mode===ie.SCENE3D&&(ce.expand(e._baseVolume,c,e._baseVolume),e._boundingVolumeDirty=!0),Kn.fromCartesian(c,fH);let d=o.scale,u=o.rotation;u!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,d);let m=fH.high,p=fH.low;e._instanced?(r=o._index,s(r,m.x,m.y,m.z,d),a(r,p.x,p.y,p.z,u)):(r=o._index*4,s(r+0,m.x,m.y,m.z,d),s(r+1,m.x,m.y,m.z,d),s(r+2,m.x,m.y,m.z,d),s(r+3,m.x,m.y,m.z,d),a(r+0,p.x,p.y,p.z,u),a(r+1,p.x,p.y,p.z,u),a(r+2,p.x,p.y,p.z,u),a(r+3,p.x,p.y,p.z,u))}var yu=new B,bu=32768,vC=65536,pH=4096,df=256,cDe=128,lDe=32,dDe=8,Hre=4,uDe=1/256,Kre=0,zre=2,Jre=3,Qre=1;function jre(e,t,n,i,o){let r,s=i[Vo.compressedAttribute0],a=o.pixelOffset,c=a.x,d=a.y,u=o._translate,m=u.x,p=u.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(c+m),Math.abs(-d+p));let y=o.horizontalOrigin,f=o._verticalOrigin,x=o.show&&o.clusterShow;o.color.alpha===0&&(x=!1),f===vn.BASELINE&&(f=vn.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&y===bi.CENTER,e._allVerticalCenter=e._allVerticalCenter&&f===vn.CENTER;let _=0,C=0,V=0,L=0,Z=o._imageIndex;if(Z!==-1){let D=n[Z];_=D.x,C=D.y,V=D.width,L=D.height}let G=_+V,I=C+L,P=Math.floor(W.clamp(c,-bu,bu)+bu)*cDe;P+=(y+1)*lDe,P+=(f+1)*dDe,P+=(x?1:0)*Hre;let v=Math.floor(W.clamp(d,-bu,bu)+bu)*df,F=Math.floor(W.clamp(m,-bu,bu)+bu)*df,M=(W.clamp(p,-bu,bu)+bu)*uDe,b=Math.floor(M),R=Math.floor((M-b)*df);v+=b,F+=R,yu.x=_,yu.y=C;let E=Fn.compressTextureCoordinates(yu);yu.x=G;let X=Fn.compressTextureCoordinates(yu);yu.y=I;let w=Fn.compressTextureCoordinates(yu);yu.x=_;let N=Fn.compressTextureCoordinates(yu);e._instanced?(r=o._index,s(r,P,v,F,E)):(r=o._index*4,s(r+0,P+Kre,v,F,E),s(r+1,P+zre,v,F,X),s(r+2,P+Jre,v,F,w),s(r+3,P+Qre,v,F,N))}function qre(e,t,n,i,o){let r,s=i[Vo.compressedAttribute1],a=o.alignedAxis;h.equals(a,h.ZERO)||(e._shaderAlignedAxis=!0);let c=0,d=1,u=1,m=1,p=o.translucencyByDistance;l(p)&&(c=p.near,d=p.nearValue,u=p.far,m=p.farValue,(d!==1||m!==1)&&(e._shaderTranslucencyByDistance=!0));let y=0,f=o._imageIndex;f!==-1&&(y=n[f].width);let x=e._textureAtlas.texture.width,_=Math.round(g(o.width,x*y));e._maxSize=Math.max(e._maxSize,_);let C=W.clamp(_,0,vC),V=0;Math.abs(h.magnitudeSquared(a)-1)<W.EPSILON6&&(V=Fn.octEncodeFloat(a)),d=W.clamp(d,0,1),d=d===1?255:d*255|0,C=C*df+d,m=W.clamp(m,0,1),m=m===1?255:m*255|0,V=V*df+m,e._instanced?(r=o._index,s(r,C,V,c,u)):(r=o._index*4,s(r+0,C,V,c,u),s(r+1,C,V,c,u),s(r+2,C,V,c,u),s(r+3,C,V,c,u))}function yH(e,t,n,i,o){let r,s=i[Vo.compressedAttribute2],a=o.color,c=l(e._batchTable)?O.WHITE:o.getPickId(t.context).color,d=o.sizeInMeters?1:0,u=Math.abs(h.magnitudeSquared(o.alignedAxis)-1)<W.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&d===1;let m=0,p=o._imageIndex;p!==-1&&(m=n[p].height);let y=e._textureAtlas.texture.dimensions,f=Math.round(g(o.height,y.y*m));e._maxSize=Math.max(e._maxSize,f);let x=g(o._labelHorizontalOrigin,-2);x+=2;let _=f*Hre+x,C=O.floatToByte(a.red),V=O.floatToByte(a.green),L=O.floatToByte(a.blue),Z=C*vC+V*df+L;C=O.floatToByte(c.red),V=O.floatToByte(c.green),L=O.floatToByte(c.blue);let G=C*vC+V*df+L,I=O.floatToByte(a.alpha)*vC+O.floatToByte(c.alpha)*df;I+=d*2+u,e._instanced?(r=o._index,s(r,Z,G,I,_)):(r=o._index*4,s(r+0,Z,G,I,_),s(r+1,Z,G,I,_),s(r+2,Z,G,I,_),s(r+3,Z,G,I,_))}function gH(e,t,n,i,o){let r,s=i[Vo.eyeOffset],a=o.eyeOffset,c=a.z;if(o._heightReference!==Qe.NONE&&(c*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(a.x),Math.abs(a.y),Math.abs(c)),e._instanced){let d=0,u=0,m=o._imageIndex;if(m!==-1){let y=n[m];d=y.width,u=y.height}yu.x=d,yu.y=u;let p=Fn.compressTextureCoordinates(yu);r=o._index,s(r,a.x,a.y,c,p)}else r=o._index*4,s(r+0,a.x,a.y,c,0),s(r+1,a.x,a.y,c,0),s(r+2,a.x,a.y,c,0),s(r+3,a.x,a.y,c,0)}function $re(e,t,n,i,o){let r,s=i[Vo.scaleByDistance],a=0,c=1,d=1,u=1,m=o.scaleByDistance;l(m)&&(a=m.near,c=m.nearValue,d=m.far,u=m.farValue,(c!==1||u!==1)&&(e._shaderScaleByDistance=!0)),e._instanced?(r=o._index,s(r,a,c,d,u)):(r=o._index*4,s(r+0,a,c,d,u),s(r+1,a,c,d,u),s(r+2,a,c,d,u),s(r+3,a,c,d,u))}function ese(e,t,n,i,o){let r,s=i[Vo.pixelOffsetScaleByDistance],a=0,c=1,d=1,u=1,m=o.pixelOffsetScaleByDistance;l(m)&&(a=m.near,c=m.nearValue,d=m.far,u=m.farValue,(c!==1||u!==1)&&(e._shaderPixelOffsetScaleByDistance=!0)),e._instanced?(r=o._index,s(r,a,c,d,u)):(r=o._index*4,s(r+0,a,c,d,u),s(r+1,a,c,d,u),s(r+2,a,c,d,u),s(r+3,a,c,d,u))}function tse(e,t,n,i,o){let r,s=i[Vo.compressedAttribute3],a=0,c=Number.MAX_VALUE,d=o.distanceDisplayCondition;l(d)&&(a=d.near,c=d.far,a*=a,c*=c,e._shaderDistanceDisplayCondition=!0);let u=o.disableDepthTestDistance,m=tu(o.heightReference)&&t.context.depthTexture;l(u)||(u=m?5e3:0),u*=u,(m||u>0)&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1));let p,y;if(l(o._labelDimensions))y=o._labelDimensions.x,p=o._labelDimensions.y;else{let C=0,V=0,L=o._imageIndex;if(L!==-1){let G=n[L];C=G.height,V=G.width}p=Math.round(g(o.height,e._textureAtlas.texture.dimensions.y*C));let Z=e._textureAtlas.texture.width;y=Math.round(g(o.width,Z*V))}let f=Math.floor(W.clamp(y,0,pH)),x=Math.floor(W.clamp(p,0,pH)),_=f*pH+x;e._instanced?(r=o._index,s(r,a,c,u,_)):(r=o._index*4,s(r+0,a,c,u,_),s(r+1,a,c,u,_),s(r+2,a,c,u,_),s(r+3,a,c,u,_))}function nse(e,t,n,i,o){if(tu(o.heightReference)){let f=e._scene,x=t.context,_=t.globeTranslucencyState.translucent,C=l(f.globe)&&f.globe.depthTestAgainstTerrain;e._shaderClampToGround=x.depthTexture&&!_&&C}let r,s=i[Vo.textureCoordinateBoundsOrLabelTranslate];if(Yt.maximumVertexTextureImageUnits>0){let f=0,x=0;l(o._labelTranslate)&&(f=o._labelTranslate.x,x=o._labelTranslate.y),e._instanced?(r=o._index,s(r,f,x,0,0)):(r=o._index*4,s(r+0,f,x,0,0),s(r+1,f,x,0,0),s(r+2,f,x,0,0),s(r+3,f,x,0,0));return}let a=0,c=0,d=0,u=0,m=o._imageIndex;if(m!==-1){let f=n[m];a=f.x,c=f.y,d=f.width,u=f.height}let p=a+d,y=c+u;e._instanced?(r=o._index,s(r,a,c,p,y)):(r=o._index*4,s(r+0,a,c,p,y),s(r+1,a,c,p,y),s(r+2,a,c,p,y),s(r+3,a,c,p,y))}function mDe(e,t,n,i,o){if(!l(e._batchTable))return;let r=i[Vo.a_batchId],s=o._batchIndex,a;e._instanced?(a=o._index,r(a,s)):(a=o._index*4,r(a+0,s),r(a+1,s),r(a+2,s),r(a+3,s))}function ise(e,t,n,i,o){if(!e._sdf)return;let r,s=i[Vo.sdf],a=o.outlineColor,c=o.outlineWidth,d=O.floatToByte(a.red),u=O.floatToByte(a.green),m=O.floatToByte(a.blue),p=d*vC+u*df+m,y=c/Ms.RADIUS,f=O.floatToByte(a.alpha)*vC+O.floatToByte(y)*df;e._instanced?(r=o._index,s(r,p,f)):(r=o._index*4,s(r+0,p+Kre,f),s(r+1,p+zre,f),s(r+2,p+Jre,f),s(r+3,p+Qre,f))}function hDe(e,t,n,i,o){Yre(e,t,n,i,o),jre(e,t,n,i,o),qre(e,t,n,i,o),yH(e,t,n,i,o),gH(e,t,n,i,o),$re(e,t,n,i,o),ese(e,t,n,i,o),tse(e,t,n,i,o),nse(e,t,n,i,o),mDe(e,t,n,i,o),ise(e,t,n,i,o)}function bH(e,t,n,i,o,r){let s;i.mode===ie.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let d=t[c],u=d.position,m=Hi._computeActualPosition(d,u,i,o);l(m)&&(d._setActualPosition(m),r?a.push(m):ce.expand(s,m,s))}r&&ce.fromPoints(a,s)}function fDe(e,t){let n=t.mode,i=e._billboards,o=e._billboardsToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==ie.SCENE3D&&!A.equals(r,e.modelMatrix)?(e._mode=n,A.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===ie.SCENE3D||n===ie.SCENE2D||n===ie.COLUMBUS_VIEW)&&bH(e,i,i.length,t,r,!0)):n===ie.MORPHING?bH(e,i,i.length,t,r,!0):(n===ie.SCENE2D||n===ie.COLUMBUS_VIEW)&&bH(e,o,e._billboardsToUpdateIndex,t,r,!1)}function pDe(e,t,n){let i=1;(!e._allSizedInMeters||e._maxPixelOffset!==0)&&(i=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight));let o=i*e._maxScale*e._maxSize*2;e._allHorizontalCenter&&e._allVerticalCenter&&(o*=.5);let r=i*e._maxPixelOffset+e._maxEyeOffset;n.radius+=o+r}function bDe(e,t){let i=t.createViewportQuadCommand(`uniform sampler2D billboard_texture;
in vec2 v_textureCoordinates;
void main()
{
out_FragColor = texture(billboard_texture, v_textureCoordinates);
}
`,{uniformMap:{billboard_texture:function(){return e._textureAtlas.texture}}});return i.pass=Ve.OVERLAY,i}var yDe=[];gu.prototype.update=function(e){if(_H(this),!this.show)return;let t=this._billboards,n=t.length,i=e.context;this._instanced=i.instancedArrays,Vo=this._instanced?iDe:nDe,hH=this._instanced?rDe:oDe;let o=this._textureAtlas;if(!l(o)){o=this._textureAtlas=new ly({context:i});for(let v=0;v<n;++v)t[v]._loadImage()}let r=o.textureCoordinates;if(r.length===0)return;fDe(this,e),t=this._billboards,n=t.length;let s=this._billboardsToUpdate,a=this._billboardsToUpdateIndex,c=this._propertiesChanged,d=o.guid,u=this._createVertexArray||this._textureAtlasGUID!==d;this._textureAtlasGUID=d;let m,p=e.passes,y=p.pick;if(u||!y&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let v=0;v<xH;++v)c[v]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=aDe(i,n,this._buffersUsage,this._instanced,this._batchTable,this._sdf),m=this._vaf.writers;for(let v=0;v<n;++v){let F=this._billboards[v];F._dirty=!1,hDe(this,e,r,m,F)}this._vaf.commit(hH(i))}this._billboardsToUpdateIndex=0}else if(a>0){let v=yDe;v.length=0,(c[GW]||c[qke]||c[jke])&&v.push(Yre),(c[ZW]||c[Fre]||c[Jke]||c[Qke]||c[zke])&&(v.push(jre),this._instanced&&v.push(gH)),(c[ZW]||c[$ke]||c[Ure])&&(v.push(qre),v.push(yH)),(c[ZW]||c[Mre])&&v.push(yH),c[Are]&&v.push(gH),c[Nre]&&v.push($re),c[kre]&&v.push(ese),(c[Dre]||c[eDe]||c[ZW]||c[GW])&&v.push(tse),(c[ZW]||c[GW])&&v.push(nse),c[Bre]&&v.push(ise);let F=v.length;if(m=this._vaf.writers,a/n>.1){for(let M=0;M<a;++M){let b=s[M];b._dirty=!1;for(let R=0;R<F;++R)v[R](this,e,r,m,b)}this._vaf.commit(hH(i))}else{for(let M=0;M<a;++M){let b=s[M];b._dirty=!1;for(let R=0;R<F;++R)v[R](this,e,r,m,b);this._instanced?this._vaf.subCommit(b._index,1):this._vaf.subCommit(b._index*4,4)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(a>n*1.5&&(s.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ce.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let f,x=A.IDENTITY;e.mode===ie.SCENE3D?(x=this.modelMatrix,f=ce.clone(this._baseVolumeWC,this._boundingVolume)):f=ce.clone(this._baseVolume2D,this._boundingVolume),pDe(this,e,f);let _=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,_){this._blendOption===Zo.OPAQUE||this._blendOption===Zo.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=ke.fromCache({depthTest:{enabled:!0,func:ne.LESS},depthMask:!0}):this._rsOpaque=void 0;let v=this._blendOption===Zo.TRANSLUCENT;this._blendOption===Zo.TRANSLUCENT||this._blendOption===Zo.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=ke.fromCache({depthTest:{enabled:!0,func:v?ne.LEQUAL:ne.LESS},depthMask:v,blending:mn.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let C,V,L,Z,G,I=Yt.maximumVertexTextureImageUnits>0;if(_||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){C=RW,V=LW,G=[],l(this._batchTable)&&(G.push("VECTOR_TILE"),C=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(C),V=this._batchTable.getFragmentShaderCallback(!1,void 0)(V)),L=new Oe({defines:G,sources:[C]}),this._instanced&&L.defines.push("INSTANCED"),this._shaderRotation&&L.defines.push("ROTATION"),this._shaderAlignedAxis&&L.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&L.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&L.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&L.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&L.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&L.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&(I?L.defines.push("VERTEX_DEPTH_CHECK"):L.defines.push("FRAGMENT_DEPTH_CHECK"));let v=1-Ms.CUTOFF;this._sdf&&L.defines.push("SDF");let F=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===Zo.OPAQUE_AND_TRANSLUCENT&&(Z=new Oe({defines:["OPAQUE",F],sources:[V]}),this._shaderClampToGround&&(I?Z.defines.push("VERTEX_DEPTH_CHECK"):Z.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(Z.defines.push("SDF"),Z.defines.push(`SDF_EDGE ${v}`)),this._sp=Qt.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:L,fragmentShaderSource:Z,attributeLocations:Vo}),Z=new Oe({defines:["TRANSLUCENT",F],sources:[V]}),this._shaderClampToGround&&(I?Z.defines.push("VERTEX_DEPTH_CHECK"):Z.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(Z.defines.push("SDF"),Z.defines.push(`SDF_EDGE ${v}`)),this._spTranslucent=Qt.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:L,fragmentShaderSource:Z,attributeLocations:Vo})),this._blendOption===Zo.OPAQUE&&(Z=new Oe({defines:[F],sources:[V]}),this._shaderClampToGround&&(I?Z.defines.push("VERTEX_DEPTH_CHECK"):Z.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(Z.defines.push("SDF"),Z.defines.push(`SDF_EDGE ${v}`)),this._sp=Qt.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:L,fragmentShaderSource:Z,attributeLocations:Vo})),this._blendOption===Zo.TRANSLUCENT&&(Z=new Oe({defines:[F],sources:[V]}),this._shaderClampToGround&&(I?Z.defines.push("VERTEX_DEPTH_CHECK"):Z.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(Z.defines.push("SDF"),Z.defines.push(`SDF_EDGE ${v}`)),this._spTranslucent=Qt.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:L,fragmentShaderSource:Z,attributeLocations:Vo})),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}let P=e.commandList;if(p.render||p.pick){let v=this._colorCommands,F=this._blendOption===Zo.OPAQUE,M=this._blendOption===Zo.OPAQUE_AND_TRANSLUCENT,b=this._vaf.va,R=b.length,E=this._uniforms,X;l(this._batchTable)?(E=this._batchTable.getUniformMapCallback()(E),X=this._batchTable.getPickId()):X="v_pickColor",v.length=R;let w=M?R*2:R;for(let N=0;N<w;++N){let D=v[N];l(D)||(D=v[N]=new nt);let k=F||M&&N%2===0;D.pass=k||!M?Ve.OPAQUE:Ve.TRANSLUCENT,D.owner=this;let Y=M?Math.floor(N/2):N;D.boundingVolume=f,D.modelMatrix=x,D.count=b[Y].indicesCount,D.shaderProgram=k?this._sp:this._spTranslucent,D.uniformMap=E,D.vertexArray=b[Y].va,D.renderState=k?this._rsOpaque:this._rsTranslucent,D.debugShowBoundingVolume=this.debugShowBoundingVolume,D.pickId=X,this._instanced&&(D.count=6,D.instanceCount=n),P.push(D)}this.debugShowTextureAtlas&&(l(this.debugCommand)||(this.debugCommand=bDe(this,e.context)),P.push(this.debugCommand))}};gu.prototype.isDestroyed=function(){return!1};gu.prototype.destroy=function(){return l(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(),Ore(this._billboards),ue(this)};var ac=gu;var pZn=T(S(),1);var aZn=T(S(),1);function gDe(e,t,n,i,o){return function(){let r=document.createElement("canvas"),s=o+2*i;r.height=r.width=s;let a=r.getContext("2d");return a.clearRect(0,0,s,s),i!==0&&(a.beginPath(),a.arc(s/2,s/2,s/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=n,a.fill(),e<1&&(a.save(),a.globalCompositeOperation="destination-out",a.beginPath(),a.arc(s/2,s/2,o/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle="black",a.fill(),a.restore())),a.beginPath(),a.arc(s/2,s/2,o/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=t,a.fill(),r}}var a_=gDe;function ia(e,t,n,i,o){this._content=e,this._billboard=n,this._label=i,this._polyline=o,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),wC(this)}var xDe=new he;Object.defineProperties(ia.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=O.clone(e,this._color),wC(this)}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=e,wC(this)}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=O.clone(e,this._pointOutlineColor),wC(this)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=e,wC(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){l(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){let t=g(this._heightOffset,0),n=this._content.tileset.ellipsoid,i=n.cartesianToCartographic(this._billboard.position,xDe);i.height=i.height-t+e;let o=n.cartographicToCartesian(i);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=O.clone(e,this._polyline.material.uniforms.color)}},image:{get:function(){return this._billboardImage},set:function(e){let t=this._billboardImage!==e;this._billboardImage=e,t&&wC(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(){let e=this._pickIds;return e[0]=this._billboard.pickId,e[1]=this._label.pickId,e[2]=this._polyline.pickId,e}}});ia.defaultColor=O.WHITE;ia.defaultPointOutlineColor=O.BLACK;ia.defaultPointOutlineWidth=0;ia.defaultPointSize=8;function wC(e){let t=e._billboard;if(l(e._billboardImage)&&e._billboardImage!==t.image){t.image=e._billboardImage;return}if(l(e._billboardImage))return;let n=g(e._color,ia.defaultColor),i=g(e._pointOutlineColor,ia.defaultPointOutlineColor),o=g(e._pointOutlineWidth,ia.defaultPointOutlineWidth),r=g(e._pointSize,ia.defaultPointSize),s=e._billboardColor,a=e._billboardOutlineColor,c=e._billboardOutlineWidth,d=e._billboardSize;if(O.equals(n,s)&&O.equals(i,a)&&o===c&&r===d)return;e._billboardColor=O.clone(n,e._billboardColor),e._billboardOutlineColor=O.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=o,e._billboardSize=r;let u=n.alpha,m=n.toCssColorString(),p=i.toCssColorString(),y=JSON.stringify([m,r,p,o]);t.setImage(y,a_(u,m,p,o,r))}ia.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};ia.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};ia.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};ia.prototype.getPropertyInherited=function(e){return vs.getPropertyInherited(this._content,this._batchId,e)};ia.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};ia.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};ia.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};ia.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var t0=ia;var aGn=T(S(),1);var _Zn=T(S(),1);function _De(e,t,n,i,o){let r=e.measureText(t);if(!!/\S/.test(t)){let a=document.defaultView.getComputedStyle(e.canvas).getPropertyValue("font-size").replace("px",""),c=document.createElement("canvas"),d=100,u=r.width+d|0,m=3*a,p=m/2;c.width=u,c.height=m;let y=c.getContext("2d");y.font=n,y.fillStyle="white",y.fillRect(0,0,c.width+1,c.height+1),i&&(y.strokeStyle="black",y.lineWidth=e.lineWidth,y.strokeText(t,d/2,p)),o&&(y.fillStyle="black",y.fillText(t,d/2,p));let f=y.getImageData(0,0,u,m).data,x=f.length,_=u*4,C,V,L,Z;for(C=0;C<x;++C)if(f[C]!==255){L=C/_|0;break}for(C=x-1;C>=0;--C)if(f[C]!==255){Z=C/_|0;break}let G=-1;for(C=0;C<u&&G===-1;++C)for(V=0;V<m;++V){let I=C*4+V*_;if(f[I]!==255||f[I+1]!==255||f[I+2]!==255||f[I+3]!==255){G=C;break}}return{width:r.width,height:Z-L,ascent:p-L,descent:Z-p,minx:G-d/2}}return{width:r.width,height:0,ascent:0,descent:0,minx:0}}var c_;function TDe(e,t){if(e==="")return;t=g(t,g.EMPTY_OBJECT);let n=g(t.font,"10px sans-serif"),i=g(t.stroke,!1),o=g(t.fill,!0),r=g(t.strokeWidth,1),s=g(t.backgroundColor,O.TRANSPARENT),a=g(t.padding,0),c=a*2,d=document.createElement("canvas");d.width=1,d.height=1,d.style.font=n;let u=d.getContext("2d",{willReadFrequently:!0});l(c_)||(l(u.imageSmoothingEnabled)?c_="imageSmoothingEnabled":l(u.mozImageSmoothingEnabled)?c_="mozImageSmoothingEnabled":l(u.webkitImageSmoothingEnabled)?c_="webkitImageSmoothingEnabled":l(u.msImageSmoothingEnabled)&&(c_="msImageSmoothingEnabled")),u.font=n,u.lineJoin="round",u.lineWidth=r,u[c_]=!1,d.style.visibility="hidden",document.body.appendChild(d);let m=_De(u,e,n,i,o);d.dimensions=m,document.body.removeChild(d),d.style.visibility="";let p=-m.minx,y=Math.ceil(m.width)+p+c,f=m.height+c,x=f-m.ascent+a,_=f-x+c;if(d.width=y,d.height=f,u.font=n,u.lineJoin="round",u.lineWidth=r,u[c_]=!1,s!==O.TRANSPARENT&&(u.fillStyle=s.toCssColorString(),u.fillRect(0,0,d.width,d.height)),i){let C=g(t.strokeColor,O.BLACK);u.strokeStyle=C.toCssColorString(),u.strokeText(e,p+a,_)}if(o){let C=g(t.fillColor,O.WHITE);u.fillStyle=C.toCssColorString(),u.fillText(e,p+a,_)}return d}var l_=TDe;var fse=T(ase(),1);var UZn=T(S(),1);var VZn=T(S(),1),CDe={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2},No=Object.freeze(CDe);var cse={},lse=0,VDe=256,LDe=new O(.165,.165,.165,.8),RDe=new B(7,5),ls=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function d_(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function IW(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function XW(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function use(e){let t=cse[e._font];if(!l(t)){let n=document.createElement("div");n.style.position="absolute",n.style.opacity=0,n.style.font=e._font,document.body.appendChild(n);let i=parseFloat(XW(n,"line-height"));isNaN(i)&&(i=void 0),t={family:XW(n,"font-family"),size:XW(n,"font-size").replace("px",""),style:XW(n,"font-style"),weight:XW(n,"font-weight"),lineHeight:i},document.body.removeChild(n),lse<VDe&&(cse[e._font]=t,lse++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function n0(e,t){e=g(e,g.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=vt.clone(n)),l(i)&&(i=vt.clone(i)),l(o)&&(o=vt.clone(o)),l(r)&&(r=It.clone(r)),this._renderedText=void 0,this._text=void 0,this._show=g(e.show,!0),this._font=g(e.font,"30px sans-serif"),this._fillColor=O.clone(g(e.fillColor,O.WHITE)),this._outlineColor=O.clone(g(e.outlineColor,O.BLACK)),this._outlineWidth=g(e.outlineWidth,1),this._showBackground=g(e.showBackground,!1),this._backgroundColor=O.clone(g(e.backgroundColor,LDe)),this._backgroundPadding=B.clone(g(e.backgroundPadding,RDe)),this._style=g(e.style,No.FILL),this._verticalOrigin=g(e.verticalOrigin,vn.BASELINE),this._horizontalOrigin=g(e.horizontalOrigin,bi.LEFT),this._pixelOffset=B.clone(g(e.pixelOffset,B.ZERO)),this._eyeOffset=h.clone(g(e.eyeOffset,h.ZERO)),this._position=h.clone(g(e.position,h.ZERO)),this._scale=g(e.scale,1),this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=o,this._heightReference=g(e.heightReference,Qe.NONE),this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance,this._labelCollection=t,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=g(e.text,""),this._relativeSize=1,use(this),this._updateClamping()}Object.defineProperties(n0.prototype,{show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i].billboard;l(r)&&(r.show=e)}let n=this._backgroundBillboard;l(n)&&(n.show=e)}}},position:{get:function(){return this._position},set:function(e){let t=this._position;if(!h.equals(t,e)){h.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o].billboard;l(s)&&(s.position=e)}let i=this._backgroundBillboard;l(i)&&(i.position=e),this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(e!==this._heightReference){this._heightReference=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i].billboard;l(r)&&(r.heightReference=e)}let n=this._backgroundBillboard;l(n)&&(n.heightReference=e),IW(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(this._text!==e){this._text=e;let t=e.replace(/\u00ad/g,"");this._renderedText=n0.enableRightToLeftDetection?WDe(t):t,d_(this)}}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,d_(this),use(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){let t=this._fillColor;O.equals(t,e)||(O.clone(e,t),d_(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;O.equals(t,e)||(O.clone(e,t),d_(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,d_(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,d_(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){let t=this._backgroundColor;if(!O.equals(t,e)){O.clone(e,t);let n=this._backgroundBillboard;l(n)&&(n.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){let t=this._backgroundPadding;B.equals(t,e)||(B.clone(e,t),IW(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,d_(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;if(!B.equals(t,e)){B.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.pixelOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;if(!vt.equals(t,e)){this._translucencyByDistance=vt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.translucencyByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;if(!vt.equals(t,e)){this._pixelOffsetScaleByDistance=vt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.pixelOffsetScaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffsetScaleByDistance=e)}}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;if(!vt.equals(t,e)){this._scaleByDistance=vt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.scaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.scaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;if(!h.equals(t,e)){h.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.eyeOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,IW(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(this._verticalOrigin!==e){this._verticalOrigin=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.verticalOrigin=e)}let n=this._backgroundBillboard;l(n)&&(n.verticalOrigin=e),IW(this)}}},scale:{get:function(){return this._scale},set:function(e){if(this._scale!==e){this._scale=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.scale=e*this._relativeSize)}let n=this._backgroundBillboard;l(n)&&(n.scale=e*this._relativeSize),IW(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!It.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=It.clone(e,this._distanceDisplayCondition);let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.distanceDisplayCondition=e)}let n=this._backgroundBillboard;l(n)&&(n.distanceDisplayCondition=e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){this._disableDepthTestDistance=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.disableDepthTestDistance=e)}let n=this._backgroundBillboard;l(n)&&(n.disableDepthTestDistance=e)}}},id:{get:function(){return this._id},set:function(e){if(this._id!==e){this._id=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.id=e)}let n=this._backgroundBillboard;l(n)&&(n.id=e)}}},pickId:{get:function(){if(!(this._glyphs.length===0||!l(this._glyphs[0].billboard)))return this._glyphs[0].billboard.pickId}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=h.clone(e,this._actualClampedPosition);let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard._clampedPosition=e)}let n=this._backgroundBillboard;l(n)&&(n._clampedPosition=e)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){if(this._clusterShow!==e){this._clusterShow=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.clusterShow=e)}let n=this._backgroundBillboard;l(n)&&(n.clusterShow=e)}}}});n0.prototype._updateClamping=function(){Hi._updateClamping(this._labelCollection,this)};n0.prototype.computeScreenSpacePosition=function(e,t){l(t)||(t=new B);let i=this._labelCollection.modelMatrix,o=l(this._actualClampedPosition)?this._actualClampedPosition:this._position;return Hi._computeScreenSpacePosition(i,o,this._eyeOffset,this._pixelOffset,e,t)};n0.getScreenSpaceBoundingBox=function(e,t,n){let i=0,o=0,r=0,s=0,a=e.totalScale,c=e._backgroundBillboard;if(l(c))i=t.x+c._translate.x,o=t.y-c._translate.y,r=c.width*a,s=c.height*a,e.verticalOrigin===vn.BOTTOM||e.verticalOrigin===vn.BASELINE?o-=s:e.verticalOrigin===vn.CENTER&&(o-=s*.5);else{i=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;let d=0,u=0,m=e._glyphs,p=m.length;for(let y=0;y<p;++y){let f=m[y],x=f.billboard;if(!l(x))continue;let _=t.x+x._translate.x,C=t.y-x._translate.y,V=f.dimensions.width*a,L=f.dimensions.height*a;e.verticalOrigin===vn.BOTTOM||e.verticalOrigin===vn.BASELINE?C-=L:e.verticalOrigin===vn.CENTER&&(C-=L*.5),e._verticalOrigin===vn.TOP?C+=Ms.PADDING*a:(e._verticalOrigin===vn.BOTTOM||e._verticalOrigin===vn.BASELINE)&&(C-=Ms.PADDING*a),i=Math.min(i,_),o=Math.min(o,C),d=Math.max(d,_+V),u=Math.max(u,C+L)}r=d-i,s=u-o}return l(n)||(n=new De),n.x=i,n.y=o,n.width=r,n.height=s,n};n0.prototype.equals=function(e){return this===e||l(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&&h.equals(this._position,e._position)&&O.equals(this._fillColor,e._fillColor)&&O.equals(this._outlineColor,e._outlineColor)&&O.equals(this._backgroundColor,e._backgroundColor)&&B.equals(this._backgroundPadding,e._backgroundPadding)&&B.equals(this._pixelOffset,e._pixelOffset)&&h.equals(this._eyeOffset,e._eyeOffset)&&vt.equals(this._translucencyByDistance,e._translucencyByDistance)&&vt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&vt.equals(this._scaleByDistance,e._scaleByDistance)&&It.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id};n0.prototype.isDestroyed=function(){return!1};n0.enableRightToLeftDetection=!1;function ZDe(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,o=[],r="",s=ls.LTR,a="",c=e.length;for(let d=0;d<c;++d){let u=e.charAt(d);t.test(u)?a=ls.RTL:n.test(u)?a=ls.LTR:i.test(u)?a=ls.BRACKETS:a=ls.WEAK,d===0&&(s=a),s===a&&a!==ls.BRACKETS?r+=u:(r!==""&&o.push({Type:s,Word:r}),s=a,r=u)}return o.push({Type:a,Word:r}),o}function GDe(e){return e.split("").reverse().join("")}function WW(e,t,n){return e.slice(0,t)+n+e.slice(t)}function EDe(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var IDe="\u05D0-\u05EA",XDe="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",dse=new RegExp(`[${IDe}${XDe}]`);function WDe(e){let t=e.split(`
`),n="";for(let i=0;i<t.length;i++){let o=t[i],r=dse.test(o.charAt(0)),s=ZDe(o,dse),a=0,c="";for(let d=0;d<s.length;++d){let u=s[d],m=u.Type===ls.BRACKETS?EDe(u.Word):GDe(u.Word);r?u.Type===ls.RTL?(c=m+c,a=0):u.Type===ls.LTR?(c=WW(c,a,u.Word),a+=u.Word.length):(u.Type===ls.WEAK||u.Type===ls.BRACKETS)&&(u.Type===ls.WEAK&&s[d-1].Type===ls.BRACKETS?c=m+c:s[d-1].Type===ls.RTL?(c=m+c,a=0):s.length>d+1?s[d+1].Type===ls.RTL?(c=m+c,a=0):(c=WW(c,a,u.Word),a+=u.Word.length):c=WW(c,0,m)):u.Type===ls.RTL?c=WW(c,a,m):u.Type===ls.LTR?(c+=u.Word,a=c.length):(u.Type===ls.WEAK||u.Type===ls.BRACKETS)&&(d>0&&s[d-1].Type===ls.RTL?s.length>d+1?s[d+1].Type===ls.RTL?c=WW(c,a,m):(c+=u.Word,a=c.length):c+=u.Word:(c+=u.Word,a=c.length))}n+=c,i<t.length-1&&(n+=`
`)}return n}var Dm=n0;var pse=T(mse(),1);function vDe(){this.textureInfo=void 0,this.dimensions=void 0,this.billboard=void 0}function wDe(e,t,n){this.labelCollection=e,this.index=t,this.dimensions=n}var FDe=1.2,bse="ID_WHITE_PIXEL",TH=new B(4,4),ADe=new De(1,1,1,1);function MDe(e){let t=document.createElement("canvas");t.width=TH.x,t.height=TH.y;let n=t.getContext("2d");return n.fillStyle="#fff",n.fillRect(0,0,t.width,t.height),e.addImage(bse,t)}var xu={};function NDe(e,t,n,i,o,r,s){return xu.font=t,xu.fillColor=n,xu.strokeColor=i,xu.strokeWidth=o,xu.padding=Ms.PADDING,s===vn.CENTER?xu.textBaseline="middle":s===vn.TOP?xu.textBaseline="top":xu.textBaseline="bottom",xu.fill=r===No.FILL||r===No.FILL_AND_OUTLINE,xu.stroke=r===No.OUTLINE||r===No.FILL_AND_OUTLINE,xu.backgroundColor=O.BLACK,l_(e,xu)}function SH(e,t){t.textureInfo=void 0,t.dimensions=void 0;let n=t.billboard;l(n)&&(n.show=!1,n.image=void 0,l(n._removeCallbackFunc)&&(n._removeCallbackFunc(),n._removeCallbackFunc=void 0),e._spareBillboards.push(n),t.billboard=void 0)}function UDe(e,t,n,i){i.index=e.addImageSync(t,n)}var kDe=new pse.default;function DDe(e,t){let n=t._renderedText,i=kDe.splitGraphemes(n),o=i.length,r=t._glyphs,s=r.length,a,c,d;if(t._relativeSize=t._fontSize/Ms.FONT_SIZE,o<s)for(c=o;c<s;++c)SH(e,r[c]);r.length=o;let u=t.show&&t._showBackground&&n.split(`
`).join("").length>0,m=t._backgroundBillboard,p=e._backgroundBillboardCollection;u?(l(m)||(m=p.add({collection:e,image:bse,imageSubRegion:ADe}),t._backgroundBillboard=m),m.color=t._backgroundColor,m.show=t._show,m.position=t._position,m.eyeOffset=t._eyeOffset,m.pixelOffset=t._pixelOffset,m.horizontalOrigin=bi.LEFT,m.verticalOrigin=t._verticalOrigin,m.heightReference=t._heightReference,m.scale=t.totalScale,m.pickPrimitive=t,m.id=t._id,m.translucencyByDistance=t._translucencyByDistance,m.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,m.scaleByDistance=t._scaleByDistance,m.distanceDisplayCondition=t._distanceDisplayCondition,m.disableDepthTestDistance=t._disableDepthTestDistance,m.clusterShow=t.clusterShow):l(m)&&(p.remove(m),t._backgroundBillboard=m=void 0);let y=e._glyphTextureCache;for(d=0;d<o;++d){let f=i[d],x=t._verticalOrigin,_=JSON.stringify([f,t._fontFamily,t._fontStyle,t._fontWeight,+x]),C=y[_];if(!l(C)){let V=`${t._fontStyle} ${t._fontWeight} ${Ms.FONT_SIZE}px ${t._fontFamily}`,L=NDe(f,V,O.WHITE,O.WHITE,0,No.FILL,x);if(C=new wDe(e,-1,L.dimensions),y[_]=C,L.width>0&&L.height>0){let Z=(0,fse.default)(L,{cutoff:Ms.CUTOFF,radius:Ms.RADIUS}),G=L.getContext("2d"),I=L.width,P=L.height,v=G.getImageData(0,0,I,P);for(let F=0;F<I;F++)for(let M=0;M<P;M++){let b=M*I+F,R=Z[b]*255,E=b*4;v.data[E+0]=R,v.data[E+1]=R,v.data[E+2]=R,v.data[E+3]=R}G.putImageData(v,0,0),f!==" "&&UDe(e._textureAtlas,_,L,C)}}if(a=r[d],l(a)?C.index===-1?SH(e,a):l(a.textureInfo)&&(a.textureInfo=void 0):(a=new vDe,r[d]=a),a.textureInfo=C,a.dimensions=C.dimensions,C.index!==-1){let V=a.billboard,L=e._spareBillboards;l(V)||(L.length>0?V=L.pop():(V=e._billboardCollection.add({collection:e}),V._labelDimensions=new B,V._labelTranslate=new B),a.billboard=V),V.show=t._show,V.position=t._position,V.eyeOffset=t._eyeOffset,V.pixelOffset=t._pixelOffset,V.horizontalOrigin=bi.LEFT,V.verticalOrigin=t._verticalOrigin,V.heightReference=t._heightReference,V.scale=t.totalScale,V.pickPrimitive=t,V.id=t._id,V.image=_,V.translucencyByDistance=t._translucencyByDistance,V.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,V.scaleByDistance=t._scaleByDistance,V.distanceDisplayCondition=t._distanceDisplayCondition,V.disableDepthTestDistance=t._disableDepthTestDistance,V._batchIndex=t._batchIndex,V.outlineColor=t.outlineColor,t.style===No.FILL_AND_OUTLINE?(V.color=t._fillColor,V.outlineWidth=t.outlineWidth):t.style===No.FILL?(V.color=t._fillColor,V.outlineWidth=0):t.style===No.OUTLINE&&(V.color=O.TRANSPARENT,V.outlineWidth=t.outlineWidth)}}t._repositionAllGlyphs=!0}function hse(e,t,n){return t===bi.CENTER?-e/2:t===bi.RIGHT?-(e+n.x):n.x}var lr=new B,BDe=new B;function ODe(e){let t=e._glyphs,n=e._renderedText,i,o,r=0,s=0,a=[],c=Number.NEGATIVE_INFINITY,d=0,u=1,m,p=t.length,y=e._backgroundBillboard,f=B.clone(l(y)?e._backgroundPadding:B.ZERO,BDe);for(f.x/=e._relativeSize,f.y/=e._relativeSize,m=0;m<p;++m)n.charAt(m)===`
`?(a.push(r),++u,r=0):(i=t[m],o=i.dimensions,d=Math.max(d,o.height-o.descent),c=Math.max(c,o.descent),r+=o.width-o.minx,m<p-1&&(r+=t[m+1].dimensions.minx),s=Math.max(s,r));a.push(r);let x=d+c,_=e.totalScale,C=e._horizontalOrigin,V=e._verticalOrigin,L=0,Z=a[L],G=hse(Z,C,f),I=(l(e._lineHeight)?e._lineHeight:FDe*e._fontSize)/e._relativeSize,P=I*(u-1),v=s,F=x+P;l(y)&&(v+=f.x*2,F+=f.y*2,y._labelHorizontalOrigin=C),lr.x=G*_,lr.y=0;let M=!0,b=0;for(m=0;m<p;++m)if(n.charAt(m)===`
`)++L,b+=I,Z=a[L],G=hse(Z,C,f),lr.x=G*_,M=!0;else if(i=t[m],o=i.dimensions,V===vn.TOP?(lr.y=o.height-d-f.y,lr.y+=Ms.PADDING):V===vn.CENTER?lr.y=(P+o.height-d)/2:V===vn.BASELINE?(lr.y=P,lr.y-=Ms.PADDING):(lr.y=P+c+f.y,lr.y-=Ms.PADDING),lr.y=(lr.y-o.descent-b)*_,M&&(lr.x-=Ms.PADDING*_,M=!1),l(i.billboard)&&(i.billboard._setTranslate(lr),i.billboard._labelDimensions.x=v,i.billboard._labelDimensions.y=F,i.billboard._labelHorizontalOrigin=C),m<p-1){let R=t[m+1];lr.x+=(o.width-o.minx+R.dimensions.minx)*_}if(l(y)&&n.split(`
`).join("").length>0&&(C===bi.CENTER?G=-s/2-f.x:C===bi.RIGHT?G=-(s+f.x*2):G=0,lr.x=G*_,V===vn.TOP?lr.y=x-d-c:V===vn.CENTER?lr.y=(x-d)/2-c:V===vn.BASELINE?lr.y=-f.y-c:lr.y=0,lr.y=lr.y*_,y.width=v,y.height=F,y._setTranslate(lr),y._labelTranslate=B.clone(lr,y._labelTranslate)),tu(e.heightReference))for(m=0;m<p;++m){i=t[m];let R=i.billboard;l(R)&&(R._labelTranslate=B.clone(lr,R._labelTranslate))}}function yse(e,t){let n=t._glyphs;for(let i=0,o=n.length;i<o;++i)SH(e,n[i]);l(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,l(t._removeCallbackFunc)&&t._removeCallbackFunc(),ue(t)}function uf(e){e=g(e,g.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._backgroundTextureAtlas=void 0,this._backgroundBillboardCollection=new ac({scene:this._scene}),this._backgroundBillboardCollection.destroyTextureAtlas=!1,this._billboardCollection=new ac({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._highlightColor=O.clone(O.WHITE),this.show=g(e.show,!0),this.modelMatrix=A.clone(g(e.modelMatrix,A.IDENTITY)),this.debugShowBoundingVolume=g(e.debugShowBoundingVolume,!1),this.blendOption=g(e.blendOption,Zo.OPAQUE_AND_TRANSLUCENT)}Object.defineProperties(uf.prototype,{length:{get:function(){return this._labels.length}}});uf.prototype.add=function(e){let t=new Dm(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};uf.prototype.remove=function(e){if(l(e)&&e._labelCollection===this){let t=this._labels.indexOf(e);if(t!==-1)return this._labels.splice(t,1),yse(this,e),!0}return!1};uf.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)yse(this,e[t]);e.length=0};uf.prototype.contains=function(e){return l(e)&&e._labelCollection===this};uf.prototype.get=function(e){return this._labels[e]};uf.prototype.update=function(e){if(!this.show)return;let t=this._billboardCollection,n=this._backgroundBillboardCollection;t.modelMatrix=this.modelMatrix,t.debugShowBoundingVolume=this.debugShowBoundingVolume,n.modelMatrix=this.modelMatrix,n.debugShowBoundingVolume=this.debugShowBoundingVolume;let i=e.context;l(this._textureAtlas)||(this._textureAtlas=new ly({context:i}),t.textureAtlas=this._textureAtlas),l(this._backgroundTextureAtlas)||(this._backgroundTextureAtlas=new ly({context:i,initialSize:TH}),n.textureAtlas=this._backgroundTextureAtlas,MDe(this._backgroundTextureAtlas));let o=this._labelsToUpdate.length;for(let s=0;s<o;++s){let a=this._labelsToUpdate[s];if(a.isDestroyed())continue;let c=a._glyphs.length;a._rebindAllGlyphs&&(DDe(this,a),a._rebindAllGlyphs=!1),a._repositionAllGlyphs&&(ODe(a),a._repositionAllGlyphs=!1);let d=a._glyphs.length-c;this._totalGlyphCount+=d}let r=n.length>0?Zo.TRANSLUCENT:this.blendOption;t.blendOption=r,n.blendOption=r,t._highlightColor=this._highlightColor,n._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,n.update(e),t.update(e)};uf.prototype.isDestroyed=function(){return!1};uf.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(),ue(this)};var md=uf;var xEn=T(S(),1);var lGn=T(S(),1),PW=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec3 position2DHigh;
in vec3 position2DLow;
in vec3 prevPosition3DHigh;
in vec3 prevPosition3DLow;
in vec3 prevPosition2DHigh;
in vec3 prevPosition2DLow;
in vec3 nextPosition3DHigh;
in vec3 nextPosition3DLow;
in vec3 nextPosition2DHigh;
in vec3 nextPosition2DLow;
in vec4 texCoordExpandAndBatchIndex;
out vec2 v_st;
out float v_width;
out vec4 v_pickColor;
out float v_polylineAngle;
void main()
{
float texCoord = texCoordExpandAndBatchIndex.x;
float expandDir = texCoordExpandAndBatchIndex.y;
bool usePrev = texCoordExpandAndBatchIndex.z < 0.0;
float batchTableIndex = texCoordExpandAndBatchIndex.w;
vec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex);
float width = widthAndShow.x + 0.5;
float show = widthAndShow.y;
if (width < 1.0)
{
show = 0.0;
}
vec4 pickColor = batchTable_getPickColor(batchTableIndex);
vec4 p, prev, next;
if (czm_morphTime == 1.0)
{
p = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz);
prev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz);
next = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz);
}
else if (czm_morphTime == 0.0)
{
p = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy);
prev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy);
next = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy);
}
else
{
p = czm_columbusViewMorph(
czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy),
czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz),
czm_morphTime);
prev = czm_columbusViewMorph(
czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy),
czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz),
czm_morphTime);
next = czm_columbusViewMorph(
czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy),
czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz),
czm_morphTime);
}
#ifdef DISTANCE_DISPLAY_CONDITION
vec3 centerHigh = batchTable_getCenterHigh(batchTableIndex);
vec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex);
vec3 centerLow = centerLowAndRadius.xyz;
float radius = centerLowAndRadius.w;
vec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex);
float lengthSq;
if (czm_sceneMode == czm_sceneMode2D)
{
lengthSq = czm_eyeHeight2D.y;
}
else
{
vec4 center = czm_translateRelativeToEye(centerHigh.xyz, centerLow.xyz);
lengthSq = max(0.0, dot(center.xyz, center.xyz) - radius * radius);
}
float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x;
float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y;
if (lengthSq < nearSq || lengthSq > farSq)
{
show = 0.0;
}
#endif
float polylineAngle;
vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, polylineAngle);
gl_Position = czm_viewportOrthographic * positionWC * show;
v_st.s = texCoord;
v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w);
v_width = width;
v_pickColor = pickColor;
v_polylineAngle = polylineAngle;
}
`;var vGn=T(S(),1);var SGn=T(S(),1);var Yc={};Yc.numberOfPoints=function(e,t,n){let i=h.distance(e,t);return Math.ceil(i/n)};Yc.numberOfPointsRhumbLine=function(e,t,n){let i=Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(i/(n*n))))};var YDe=new he;Yc.extractHeights=function(e,t){let n=e.length,i=new Array(n);for(let o=0;o<n;o++){let r=e[o];i[o]=t.cartesianToCartographic(r,YDe).height}return i};var HDe=new A,KDe=new h,gse=new h,zDe=new ln(h.UNIT_X,0),xse=new h,JDe=new ln(h.UNIT_X,0),QDe=new h,jDe=new h,VH=[];function Tse(e,t,n){let i=VH;i.length=e;let o;if(t===n){for(o=0;o<e;o++)i[o]=t;return i}let s=(n-t)/e;for(o=0;o<e;o++){let a=t+o*s;i[o]=a}return i}var i5=new he,n5=new he,dy=new h,LH=new h,qDe=new h,CH=new xp,vW=new Ca;function $De(e,t,n,i,o,r,s,a){let c=i.scaleToGeodeticSurface(e,LH),d=i.scaleToGeodeticSurface(t,qDe),u=Yc.numberOfPoints(e,t,n),m=i.cartesianToCartographic(c,i5),p=i.cartesianToCartographic(d,n5),y=Tse(u,o,r);CH.setEndPoints(m,p);let f=CH.surfaceDistance/u,x=a;m.height=o;let _=i.cartographicToCartesian(m,dy);h.pack(_,s,x),x+=3;for(let C=1;C<u;C++){let V=CH.interpolateUsingSurfaceDistance(C*f,n5);V.height=y[C],_=i.cartographicToCartesian(V,dy),h.pack(_,s,x),x+=3}return x}function eBe(e,t,n,i,o,r,s,a){let c=i.cartesianToCartographic(e,i5),d=i.cartesianToCartographic(t,n5),u=Yc.numberOfPointsRhumbLine(c,d,n);c.height=0,d.height=0;let m=Tse(u,o,r);vW.ellipsoid.equals(i)||(vW=new Ca(void 0,void 0,i)),vW.setEndPoints(c,d);let p=vW.surfaceDistance/u,y=a;c.height=o;let f=i.cartographicToCartesian(c,dy);h.pack(f,s,y),y+=3;for(let x=1;x<u;x++){let _=vW.interpolateUsingSurfaceDistance(x*p,n5);_.height=m[x],f=i.cartographicToCartesian(_,dy),h.pack(f,s,y),y+=3}return y}Yc.wrapLongitude=function(e,t){let n=[],i=[];if(l(e)&&e.length>0){t=g(t,A.IDENTITY);let o=A.inverseTransformation(t,HDe),r=A.multiplyByPoint(o,h.ZERO,KDe),s=h.normalize(A.multiplyByPointAsVector(o,h.UNIT_Y,gse),gse),a=ln.fromPointNormal(r,s,zDe),c=h.normalize(A.multiplyByPointAsVector(o,h.UNIT_X,xse),xse),d=ln.fromPointNormal(r,c,JDe),u=1;n.push(h.clone(e[0]));let m=n[0],p=e.length;for(let y=1;y<p;++y){let f=e[y];if(ln.getPointDistance(d,m)<0||ln.getPointDistance(d,f)<0){let x=ni.lineSegmentPlane(m,f,a,QDe);if(l(x)){let _=h.multiplyByScalar(s,5e-9,jDe);ln.getPointDistance(a,m)<0&&h.negate(_,_),n.push(h.add(x,_,new h)),i.push(u+1),h.negate(_,_),n.push(h.add(x,_,new h)),u=1}}n.push(h.clone(e[y])),u++,m=f}i.push(u)}return{positions:n,lengths:i}};Yc.generateArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=g(e.ellipsoid,oe.WGS84),o=g(e.height,0),r=Array.isArray(o);if(n<1)return[];if(n===1){let x=i.scaleToGeodeticSurface(t[0],LH);if(o=r?o[0]:o,o!==0){let _=i.geodeticSurfaceNormal(x,dy);h.multiplyByScalar(_,o,_),h.add(x,_,x)}return[x.x,x.y,x.z]}let s=e.minDistance;if(!l(s)){let x=g(e.granularity,W.RADIANS_PER_DEGREE);s=W.chordLength(x,i.maximumRadius)}let a=0,c;for(c=0;c<n-1;c++)a+=Yc.numberOfPoints(t[c],t[c+1],s);let d=(a+1)*3,u=new Array(d),m=0;for(c=0;c<n-1;c++){let x=t[c],_=t[c+1],C=r?o[c]:o,V=r?o[c+1]:o;m=$De(x,_,s,i,C,V,u,m)}VH.length=0;let p=t[n-1],y=i.cartesianToCartographic(p,i5);y.height=r?o[n-1]:o;let f=i.cartographicToCartesian(y,dy);return h.pack(f,u,d-3),u};var _se=new he,tBe=new he;Yc.generateRhumbArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=g(e.ellipsoid,oe.WGS84),o=g(e.height,0),r=Array.isArray(o);if(n<1)return[];if(n===1){let C=i.scaleToGeodeticSurface(t[0],LH);if(o=r?o[0]:o,o!==0){let V=i.geodeticSurfaceNormal(C,dy);h.multiplyByScalar(V,o,V),h.add(C,V,C)}return[C.x,C.y,C.z]}let s=g(e.granularity,W.RADIANS_PER_DEGREE),a=0,c,d=i.cartesianToCartographic(t[0],_se),u;for(c=0;c<n-1;c++)u=i.cartesianToCartographic(t[c+1],tBe),a+=Yc.numberOfPointsRhumbLine(d,u,s),d=he.clone(u,_se);let m=(a+1)*3,p=new Array(m),y=0;for(c=0;c<n-1;c++){let C=t[c],V=t[c+1],L=r?o[c]:o,Z=r?o[c+1]:o;y=eBe(C,V,s,i,L,Z,p,y)}VH.length=0;let f=t[n-1],x=i.cartesianToCartographic(f,i5);x.height=r?o[n-1]:o;let _=i.cartographicToCartesian(x,dy);return h.pack(_,p,m-3),p};Yc.generateCartesianArc=function(e){let t=Yc.generateArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=h.unpack(t,o*3);return i};Yc.generateCartesianRhumbArc=function(e){let t=Yc.generateRhumbArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=h.unpack(t,o*3);return i};var Ei=Yc;function hd(e,t){e=g(e,g.EMPTY_OBJECT),this._show=g(e.show,!0),this._width=g(e.width,1),this._loop=g(e.loop,!1),this._distanceDisplayCondition=e.distanceDisplayCondition,this._material=e.material,l(this._material)||(this._material=Bi.fromType(Bi.ColorType,{color:new O(1,1,1,1)}));let n=e.positions;l(n)||(n=[]),this._positions=n,this._actualPositions=So(n,h.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(h.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id;let i;l(t)&&(i=A.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=Ei.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(Cse),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=ce.fromPoints(this._actualPositions),this._boundingVolumeWC=ce.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new ce}var Sse=hd.POSITION_INDEX=0,nBe=hd.SHOW_INDEX=1,iBe=hd.WIDTH_INDEX=2,oBe=hd.MATERIAL_INDEX=3,wW=hd.POSITION_SIZE_INDEX=4,rBe=hd.DISTANCE_DISPLAY_CONDITION=5,Cse=hd.NUMBER_OF_PROPERTIES=6;function i0(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(hd.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,i0(this,nBe))}},positions:{get:function(){return this._positions},set:function(e){let t=So(e,h.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(h.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&i0(this,wW),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=ce.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=ce.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),i0(this,Sse),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,i0(this,oBe))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,i0(this,iBe))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!h.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(h.clone(t[0]))):t.length>2&&h.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,i0(this,wW)}}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},isDestroyed:{get:function(){return!l(this._polylineCollection)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){It.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=It.clone(e,this._distanceDisplayCondition),i0(this,rBe))}}});hd.prototype.update=function(){let e=A.IDENTITY;l(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[Sse]>0||this._propertiesChanged[wW]>0;if((!A.equals(e,this._modelMatrix)||i)&&(this._segments=Ei.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=ce.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=A.clone(e,this._modelMatrix),this._segments.positions.length!==t)i0(this,wW);else{let o=n.length;for(let r=0;r<o;++r)if(n[r]!==this._segments.lengths[r]){i0(this,wW);break}}};hd.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};hd.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<Cse-1;++t)e[t]=0};hd.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var _u=hd;var sBe=_u.SHOW_INDEX,aBe=_u.WIDTH_INDEX,ZH=_u.POSITION_INDEX,cBe=_u.MATERIAL_INDEX,Vse=_u.POSITION_SIZE_INDEX,lBe=_u.DISTANCE_DISPLAY_CONDITION,Xse=_u.NUMBER_OF_PROPERTIES,Wl={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};function Bm(e){e=g(e,g.EMPTY_OBJECT),this.show=g(e.show,!0),this.modelMatrix=A.clone(g(e.modelMatrix,A.IDENTITY)),this._modelMatrix=A.clone(A.IDENTITY),this.debugShowBoundingVolume=g(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(Xse),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:Ue.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);let t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}Object.defineProperties(Bm.prototype,{length:{get:function(){return GH(this),this._polylines.length}}});Bm.prototype.add=function(e){let t=new _u(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};Bm.prototype.remove=function(e){if(this.contains(e)){if(this._polylinesRemoved=!0,this._createVertexArray=!0,this._createBatchTable=!0,l(e._bucket)){let t=e._bucket;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()}return e._destroy(),!0}return!1};Bm.prototype.removeAll=function(){EH(this),Fse(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};Bm.prototype.contains=function(e){return l(e)&&e._polylineCollection===this};Bm.prototype.get=function(e){return GH(this),this._polylines[e]};function dBe(e,t){l(e._batchTable)&&e._batchTable.destroy();let n=[{functionName:"batchTable_getWidthAndShow",componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:Q.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:Q.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:Q.FLOAT,componentsPerAttribute:2}];e._batchTable=new ox(t,n,e._polylines.length)}var Wse=new Kn,Pse=new se,vse=new B;Bm.prototype.update=function(e){if(GH(this),this._polylines.length===0||!this.show)return;bBe(this,e);let t=e.context,n=e.mapProjection,i,o=this._propertiesChanged;if(this._createBatchTable){if(Yt.maximumVertexTextureImageUnits===0)throw new me("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");dBe(this,t),this._createBatchTable=!1}if(this._createVertexArray||mBe(this))Zse(this,t,n);else if(this._polylinesUpdated){let c=this._polylinesToUpdate;if(this._mode!==ie.SCENE3D){let d=c.length;for(let u=0;u<d;++u)i=c[u],i.update()}if(o[Vse]||o[cBe])Zse(this,t,n);else{let d=c.length,u=this._polylineBuckets;for(let m=0;m<d;++m){i=c[m],o=i._propertiesChanged;let p=i._bucket,y=0;for(let f in u)if(u.hasOwnProperty(f)){if(u[f]===p){o[ZH]&&p.writeUpdate(y,i,this._positionBuffer,n);break}y+=u[f].lengthOfPositions}if((o[sBe]||o[aBe])&&this._batchTable.setBatchedAttribute(i._index,0,new B(i._width,i._show)),this._batchTable.attributes.length>2){if(o[ZH]||o[Vse]){let f=e.mode===ie.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,x=Kn.fromCartesian(f.center,Wse),_=se.fromElements(x.low.x,x.low.y,x.low.z,f.radius,Pse);this._batchTable.setBatchedAttribute(i._index,2,x.high),this._batchTable.setBatchedAttribute(i._index,3,_)}if(o[lBe]){let f=vse;f.x=0,f.y=Number.MAX_VALUE;let x=i.distanceDisplayCondition;l(x)&&(f.x=x.near,f.y=x.far),this._batchTable.setBatchedAttribute(i._index,4,f)}}i._clean()}}c.length=0,this._polylinesUpdated=!1}o=this._propertiesChanged;for(let c=0;c<Xse;++c)o[c]=0;let r=A.IDENTITY;e.mode===ie.SCENE3D&&(r=this.modelMatrix);let s=e.passes,a=e.morphTime!==0;if((!l(this._opaqueRS)||this._opaqueRS.depthTest.enabled!==a)&&(this._opaqueRS=ke.fromCache({depthMask:a,depthTest:{enabled:a}})),(!l(this._translucentRS)||this._translucentRS.depthTest.enabled!==a)&&(this._translucentRS=ke.fromCache({blending:mn.ALPHA_BLEND,depthMask:!a,depthTest:{enabled:a}})),this._batchTable.update(e),s.render||s.pick){let c=this._colorCommands;uBe(this,e,c,r)}};var FW=new ce,Lse=new ce;function uBe(e,t,n,i){let o=t.context,r=t.commandList,s=n.length,a=0,c=!0,d=e._vertexArrays,u=e.debugShowBoundingVolume,p=e._batchTable.getUniformMapCallback(),y=d.length;for(let f=0;f<y;++f){let x=d[f],_=x.buckets,C=_.length;for(let V=0;V<C;++V){let L=_[V],Z=L.offset,G=L.bucket.shaderProgram,I=L.bucket.polylines,P=I.length,v,F,M=0,b,R;for(let E=0;E<P;++E){let X=I[E],w=fBe(X._material);if(w!==v){if(l(v)&&M>0){let Y=F.isTranslucent();a>=s?(b=new nt({owner:e}),n.push(b)):b=n[a],++a,R=Tt(p(F._uniforms),e._uniformMap),b.boundingVolume=ce.clone(FW,b.boundingVolume),b.modelMatrix=i,b.shaderProgram=G,b.vertexArray=x.va,b.renderState=Y?e._translucentRS:e._opaqueRS,b.pass=Y?Ve.TRANSLUCENT:Ve.OPAQUE,b.debugShowBoundingVolume=u,b.pickId="v_pickColor",b.uniformMap=R,b.count=M,b.offset=Z,Z+=M,M=0,c=!0,r.push(b)}F=X._material,F.update(o),v=w}let N=X._locatorBuckets,D=N.length;for(let Y=0;Y<D;++Y){let U=N[Y];U.locator===L&&(M+=U.count)}let k;t.mode===ie.SCENE3D?k=X._boundingVolumeWC:t.mode===ie.COLUMBUS_VIEW?k=X._boundingVolume2D:t.mode===ie.SCENE2D?l(X._boundingVolume2D)&&(k=ce.clone(X._boundingVolume2D,Lse),k.center.x=0):l(X._boundingVolumeWC)&&l(X._boundingVolume2D)&&(k=ce.union(X._boundingVolumeWC,X._boundingVolume2D,Lse)),c?(c=!1,ce.clone(k,FW)):ce.union(k,FW,FW)}l(v)&&M>0&&(a>=s?(b=new nt({owner:e}),n.push(b)):b=n[a],++a,R=Tt(p(F._uniforms),e._uniformMap),b.boundingVolume=ce.clone(FW,b.boundingVolume),b.modelMatrix=i,b.shaderProgram=G,b.vertexArray=x.va,b.renderState=F.isTranslucent()?e._translucentRS:e._opaqueRS,b.pass=F.isTranslucent()?Ve.TRANSLUCENT:Ve.OPAQUE,b.debugShowBoundingVolume=u,b.pickId="v_pickColor",b.uniformMap=R,b.count=M,b.offset=Z,c=!0,r.push(b)),v=void 0}}n.length=a}Bm.prototype.isDestroyed=function(){return!1};Bm.prototype.destroy=function(){return wse(this),EH(this),Fse(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};function mBe(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[ZH]?(i.bufferUsage!==Ue.STREAM_DRAW&&(t=!0,i.bufferUsage=Ue.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==Ue.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=Ue.STATIC_DRAW):i.frameCount--),t}var Rse=[0,0,0];function Zse(e,t,n){e._createVertexArray=!1,EH(e),wse(e),pBe(e);let i=[[]],o=i[0],r=e._batchTable,s=e._useHighlightColor,a=[0],c=0,d=[[]],u=0,m=e._polylineBuckets,p,y;for(p in m)m.hasOwnProperty(p)&&(y=m[p],y.updateShader(t,r,s),u+=y.lengthOfPositions);if(u>0){let f=e._mode,x=new Float32Array(6*u*3),_=new Float32Array(u*4),C,V=0,L=0,Z=0;for(p in m)if(m.hasOwnProperty(p)){y=m[p],y.write(x,_,V,L,Z,r,t,n),f===ie.MORPHING&&(l(C)||(C=new Float32Array(6*u*3)),y.writeForMorph(C,V));let R=y.lengthOfPositions;V+=6*R*3,L+=R*4,Z+=R*4,c=y.updateIndices(i,a,d,c)}let G=e._positionBufferUsage.bufferUsage,I=Ue.STATIC_DRAW;e._positionBuffer=ft.createVertexBuffer({context:t,typedArray:x,usage:G});let P;l(C)&&(P=ft.createVertexBuffer({context:t,typedArray:C,usage:G})),e._texCoordExpandAndBatchIndexBuffer=ft.createVertexBuffer({context:t,typedArray:_,usage:I});let v=3*Float32Array.BYTES_PER_ELEMENT,F=4*Float32Array.BYTES_PER_ELEMENT,M=0,b=i.length;for(let R=0;R<b;++R)if(o=i[R],o.length>0){let E=new Uint16Array(o),X=ft.createIndexBuffer({context:t,typedArray:E,usage:Ue.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT});M+=a[R];let w=6*(R*(v*W.SIXTY_FOUR_KILOBYTES)-M*v),N=v+w,D=v+N,k=v+D,Y=v+k,U=v+Y,J=R*(F*W.SIXTY_FOUR_KILOBYTES)-M*F,K=[{index:Wl.position3DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:w,strideInBytes:6*v},{index:Wl.position3DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:N,strideInBytes:6*v},{index:Wl.position2DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:w,strideInBytes:6*v},{index:Wl.position2DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:N,strideInBytes:6*v},{index:Wl.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:D,strideInBytes:6*v},{index:Wl.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:k,strideInBytes:6*v},{index:Wl.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:D,strideInBytes:6*v},{index:Wl.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:k,strideInBytes:6*v},{index:Wl.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:Y,strideInBytes:6*v},{index:Wl.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:U,strideInBytes:6*v},{index:Wl.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:Y,strideInBytes:6*v},{index:Wl.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:U,strideInBytes:6*v},{index:Wl.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:Q.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:J}],ee,H,j,$;f===ie.SCENE3D?(H=e._positionBuffer,ee="vertexBuffer",j=Rse,$="value"):f===ie.SCENE2D||f===ie.COLUMBUS_VIEW?(H=Rse,ee="value",j=e._positionBuffer,$="vertexBuffer"):(H=P,ee="vertexBuffer",j=e._positionBuffer,$="vertexBuffer"),K[0][ee]=H,K[1][ee]=H,K[2][$]=j,K[3][$]=j,K[4][ee]=H,K[5][ee]=H,K[6][$]=j,K[7][$]=j,K[8][ee]=H,K[9][ee]=H,K[10][$]=j,K[11][$]=j;let pe=new oi({context:t,attributes:K,indexBuffer:X});e._vertexArrays.push({va:pe,buckets:d[R]})}}}function hBe(e,t){return t instanceof wt?t.id:t}var o5=[];function fBe(e){let t=Bi._uniformList[e.type],n=t.length;o5.length=2*n;let i=0;for(let o=0;o<n;++o){let r=t[o];o5[i]=r,o5[i+1]=e._uniforms[r](),i+=2}return`${e.type}:${JSON.stringify(o5,hBe)}`}function pBe(e){let t=e._mode,n=e._modelMatrix,i=e._polylineBuckets={},o=e._polylines,r=o.length;for(let s=0;s<r;++s){let a=o[s];if(a._actualPositions.length>1){a.update();let c=a.material,d=i[c.type];l(d)||(d=i[c.type]=new mf(c,t,n)),d.addPolyline(a)}}}function bBe(e,t){let n=t.mode;(e._mode!==n||!A.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=A.clone(e.modelMatrix),e._createVertexArray=!0)}function GH(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;let t=[],n=[],i=0,o,r=e._polylines.length;for(let s=0;s<r;++s)o=e._polylines[s],o.isDestroyed||(o._index=i++,n.push(o),t.push(o));e._polylines=t,e._polylinesToUpdate=n}}function EH(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)if(!t[i].isDestroyed){let o=t[i]._bucket;l(o)&&(o.shaderProgram=o.shaderProgram&&o.shaderProgram.destroy())}}function wse(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}Bm.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function Fse(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function RH(e,t,n){this.count=e,this.offset=t,this.bucket=n}function mf(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}mf.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};mf.prototype.updateShader=function(e,t,n){if(l(this.shaderProgram))return;let i=["DISTANCE_DISPLAY_CONDITION"];n&&i.push("VECTOR_TILE"),this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&i.push("POLYLINE_DASH"),Bt.isInternetExplorer()||i.push("CLIP_POLYLINE");let o=new Oe({defines:i,sources:[`in vec4 v_pickColor;
`,this.material.shaderSource,px]}),r=t.getVertexShaderCallback()(PW),s=new Oe({defines:i,sources:[od,r]});this.shaderProgram=Qt.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:o,attributeLocations:Wl})};function Ase(e){return h.dot(h.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(ln.ORIGIN_ZX_PLANE)===nn.INTERSECTING}mf.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===ie.SCENE3D||!Ase(e))return t=e._actualPositions.length,t*4-4;let n=0,i=e._segments.lengths;t=i.length;for(let o=0;o<t;++o)n+=i[o]*4-4;return n};var _s=new h,Tu=new h,Su=new h,r5=new h,yBe=new se,gBe=new B;mf.prototype.write=function(e,t,n,i,o,r,s,a){let c=this.mode,d=a.ellipsoid.maximumRadius*W.PI,u=this.polylines,m=u.length;for(let p=0;p<m;++p){let y=u[p],f=y.width,x=y.show&&f>0,_=y._index,C=this.getSegments(y,a),V=C.positions,L=C.lengths,Z=V.length,G=y.getPickId(s).color,I=0,P=0,v;for(let D=0;D<Z;++D){D===0?y._loop?v=V[Z-2]:(v=r5,h.subtract(V[0],V[1],v),h.add(V[0],v,v)):v=V[D-1],h.clone(v,Tu),h.clone(V[D],_s),D===Z-1?y._loop?v=V[1]:(v=r5,h.subtract(V[Z-1],V[Z-2],v),h.add(V[Z-1],v,v)):v=V[D+1],h.clone(v,Su);let k=L[I];D===P+k&&(P+=k,++I);let Y=D-P===0,U=D===P+L[I]-1;c===ie.SCENE2D&&(Tu.z=0,_s.z=0,Su.z=0),(c===ie.SCENE2D||c===ie.MORPHING)&&(Y||U)&&d-Math.abs(_s.x)<1&&((_s.x<0&&Tu.x>0||_s.x>0&&Tu.x<0)&&h.clone(_s,Tu),(_s.x<0&&Su.x>0||_s.x>0&&Su.x<0)&&h.clone(_s,Su));let J=Y?2:0,K=U?2:4;for(let ee=J;ee<K;++ee){Kn.writeElements(_s,e,n),Kn.writeElements(Tu,e,n+6),Kn.writeElements(Su,e,n+12);let H=ee-2<0?-1:1;t[o]=D/(Z-1),t[o+1]=2*(ee%2)-1,t[o+2]=H,t[o+3]=_,n+=6*3,o+=4}}let F=yBe;F.x=O.floatToByte(G.red),F.y=O.floatToByte(G.green),F.z=O.floatToByte(G.blue),F.w=O.floatToByte(G.alpha);let M=gBe;M.x=f,M.y=x?1:0;let b=c===ie.SCENE2D?y._boundingVolume2D:y._boundingVolumeWC,R=Kn.fromCartesian(b.center,Wse),E=R.high,X=se.fromElements(R.low.x,R.low.y,R.low.z,b.radius,Pse),w=vse;w.x=0,w.y=Number.MAX_VALUE;let N=y.distanceDisplayCondition;l(N)&&(w.x=N.near,w.y=N.far),r.setBatchedAttribute(_,0,M),r.setBatchedAttribute(_,1,F),r.attributes.length>2&&(r.setBatchedAttribute(_,2,E),r.setBatchedAttribute(_,3,X),r.setBatchedAttribute(_,4,w))}};var xBe=new h,_Be=new h,TBe=new h,Gse=new h;mf.prototype.writeForMorph=function(e,t){let n=this.modelMatrix,i=this.polylines,o=i.length;for(let r=0;r<o;++r){let s=i[r],a=s._segments.positions,c=s._segments.lengths,d=a.length,u=0,m=0;for(let p=0;p<d;++p){let y;p===0?s._loop?y=a[d-2]:(y=Gse,h.subtract(a[0],a[1],y),h.add(a[0],y,y)):y=a[p-1],y=A.multiplyByPoint(n,y,_Be);let f=A.multiplyByPoint(n,a[p],xBe),x;p===d-1?s._loop?x=a[1]:(x=Gse,h.subtract(a[d-1],a[d-2],x),h.add(a[d-1],x,x)):x=a[p+1],x=A.multiplyByPoint(n,x,TBe);let _=c[u];p===m+_&&(m+=_,++u);let C=p-m===0,V=p===m+c[u]-1,L=C?2:0,Z=V?2:4;for(let G=L;G<Z;++G)Kn.writeElements(f,e,t),Kn.writeElements(y,e,t+6),Kn.writeElements(x,e,t+12),t+=6*3}}};var SBe=new Array(1);mf.prototype.updateIndices=function(e,t,n,i){let o=n.length-1,r=new RH(0,i,this);n[o].push(r);let s=0,a=e[e.length-1],c=0;a.length>0&&(c=a[a.length-1]+1);let d=this.polylines,u=d.length;for(let m=0;m<u;++m){let p=d[m];p._locatorBuckets=[];let y;if(this.mode===ie.SCENE3D){y=SBe;let x=p._actualPositions.length;if(x>0)y[0]=x;else continue}else y=p._segments.lengths;let f=y.length;if(f>0){let x=0;for(let _=0;_<f;++_){let C=y[_]-1;for(let V=0;V<C;++V)c+4>W.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:r,count:x}),x=0,t.push(4),a=[],e.push(a),c=0,r.count=s,s=0,i=0,r=new RH(0,0,this),n[++o]=[r]),a.push(c,c+2,c+1),a.push(c+1,c+2,c+3),x+=6,s+=6,i+=6,c+=4}p._locatorBuckets.push({locator:r,count:x}),c+4>W.SIXTY_FOUR_KILOBYTES&&(t.push(0),a=[],e.push(a),c=0,r.count=s,i=0,s=0,r=new RH(0,0,this),n[++o]=[r])}p._clean()}return r.count=s,i};mf.prototype.getPolylineStartIndex=function(e){let t=this.polylines,n=0,i=t.length;for(let o=0;o<i;++o){let r=t[o];if(r===e)break;n+=r._actualLength}return n};var FC={positions:void 0,lengths:void 0},Ese=new Array(1),CBe=new h,VBe=new he;mf.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===ie.SCENE3D)return Ese[0]=n.length,FC.positions=n,FC.lengths=Ese,FC;Ase(e)&&(n=e._segments.positions);let i=t.ellipsoid,o=[],r=this.modelMatrix,s=n.length,a,c=CBe;for(let d=0;d<s;++d)a=n[d],c=A.multiplyByPoint(r,a,c),o.push(t.project(i.cartesianToCartographic(c,VBe)));if(o.length>0){e._boundingVolume2D=ce.fromPoints(o,e._boundingVolume2D);let d=e._boundingVolume2D.center;e._boundingVolume2D.center=new h(d.z,d.x,d.y)}return FC.positions=o,FC.lengths=e._segments.lengths,FC};var Ise;mf.prototype.writeUpdate=function(e,t,n,i){let o=this.mode,r=i.ellipsoid.maximumRadius*W.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);let a=Ise,c=6*s*3;!l(a)||a.length<c?a=Ise=new Float32Array(c):a.length>c&&(a=new Float32Array(a.buffer,0,c));let d=this.getSegments(t,i),u=d.positions,m=d.lengths,p=0,y=0,f=0,x;s=u.length;for(let _=0;_<s;++_){_===0?t._loop?x=u[s-2]:(x=r5,h.subtract(u[0],u[1],x),h.add(u[0],x,x)):x=u[_-1],h.clone(x,Tu),h.clone(u[_],_s),_===s-1?t._loop?x=u[1]:(x=r5,h.subtract(u[s-1],u[s-2],x),h.add(u[s-1],x,x)):x=u[_+1],h.clone(x,Su);let C=m[y];_===f+C&&(f+=C,++y);let V=_-f===0,L=_===f+m[y]-1;o===ie.SCENE2D&&(Tu.z=0,_s.z=0,Su.z=0),(o===ie.SCENE2D||o===ie.MORPHING)&&(V||L)&&r-Math.abs(_s.x)<1&&((_s.x<0&&Tu.x>0||_s.x>0&&Tu.x<0)&&h.clone(_s,Tu),(_s.x<0&&Su.x>0||_s.x>0&&Su.x<0)&&h.clone(_s,Su));let Z=V?2:0,G=L?2:4;for(let I=Z;I<G;++I)Kn.writeElements(_s,a,p),Kn.writeElements(Tu,a,p+6),Kn.writeElements(Su,a,p+12),p+=6*3}n.copyFromArrayView(a,6*3*Float32Array.BYTES_PER_ELEMENT*e)}};var Om=Bm;function uy(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=new ac({batchTable:e.batchTable}),this._labelCollection=new md({batchTable:e.batchTable}),this._polylineCollection=new Om,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(uy.prototype,{ready:{get:function(){return this._ready}},pointsLength:{get:function(){return this._billboardCollection.length}},texturesByteLength:{get:function(){let e=this._billboardCollection.textureAtlas.texture.sizeInBytes,t=this._labelCollection._textureAtlas.texture.sizeInBytes;return e+t}}});function LBe(e,t){let n=e._rectangle,i=e._minHeight,o=e._maxHeight,r=2+de.packedLength+oe.packedLength,s=new Float64Array(r),a=0;return s[a++]=i,s[a++]=o,de.pack(n,s,a),a+=de.packedLength,oe.pack(t,s,a),s}var RBe=new gi("createVectorTilePoints",5),ZBe=new h;function GBe(e,t){let n=e._positions,i=e._packedBuffer;l(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=LBe(e,t));let o=[n.buffer,i.buffer],r={positions:n.buffer,packedBuffer:i.buffer},s=RBe.scheduleTask(r,o);if(l(s))return s.then(a=>{if(e.isDestroyed())return;e._positions=new Float64Array(a.positions);let c=e._billboardCollection,d=e._labelCollection,u=e._polylineCollection;n=e._positions;let m=e._batchIds,p=n.length/3;for(let y=0;y<p;++y){let f=m[y],x=h.unpack(n,y*3,ZBe),_=c.add();_.position=x,_._batchIndex=f;let C=d.add();C.text=" ",C.position=x,C._batchIndex=f;let V=u.add();V.positions=[h.clone(x),h.clone(x)]}e._positions=void 0,e._packedBuffer=void 0,e._ready=!0}).catch(a=>{e.isDestroyed()||(e._error=a)})}uy.prototype.createFeatures=function(e,t){let n=this._billboardCollection,i=this._labelCollection,o=this._polylineCollection,r=this._batchIds,s=r.length;for(let a=0;a<s;++a){let c=r[a],d=n.get(a),u=i.get(a),m=o.get(a);t[c]=new t0(e,c,d,u,m)}};uy.prototype.applyDebugSettings=function(e,t){e?(O.clone(t,this._billboardCollection._highlightColor),O.clone(t,this._labelCollection._highlightColor),O.clone(t,this._polylineCollection._highlightColor)):(O.clone(O.WHITE,this._billboardCollection._highlightColor),O.clone(O.WHITE,this._labelCollection._highlightColor),O.clone(O.WHITE,this._polylineCollection._highlightColor))};function EBe(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.pointSize=t0.defaultPointSize,s.color=t0.defaultColor,s.pointOutlineColor=t0.defaultPointOutlineColor,s.pointOutlineWidth=t0.defaultPointOutlineWidth,s.labelColor=O.WHITE,s.labelOutlineColor=O.WHITE,s.labelOutlineWidth=1,s.font="30px sans-serif",s.labelStyle=No.FILL,s.labelText=void 0,s.backgroundColor=new O(.165,.165,.165,.8),s.backgroundPadding=new B(7,5),s.backgroundEnabled=!1,s.scaleByDistance=void 0,s.translucencyByDistance=void 0,s.distanceDisplayCondition=void 0,s.heightOffset=0,s.anchorLineEnabled=!1,s.anchorLineColor=O.WHITE,s.image=void 0,s.disableDepthTestDistance=0,s.horizontalOrigin=bi.CENTER,s.verticalOrigin=vn.CENTER,s.labelHorizontalOrigin=bi.RIGHT,s.labelVerticalOrigin=vn.BASELINE}}var IBe=new O,XBe=new O,WBe=new O,PBe=new O,vBe=new O,wBe=new O,AW=new vt,MW=new vt,IH=new It;uy.prototype.applyStyle=function(e,t){if(!l(e)){EBe(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];if(l(e.show)&&(s.show=e.show.evaluate(s)),l(e.pointSize)&&(s.pointSize=e.pointSize.evaluate(s)),l(e.color)&&(s.color=e.color.evaluateColor(s,IBe)),l(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,XBe)),l(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),l(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,WBe)),l(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,PBe)),l(e.labelOutlineWidth)&&(s.labelOutlineWidth=e.labelOutlineWidth.evaluate(s)),l(e.font)&&(s.font=e.font.evaluate(s)),l(e.labelStyle)&&(s.labelStyle=e.labelStyle.evaluate(s)),l(e.labelText)?s.labelText=e.labelText.evaluate(s):s.labelText=void 0,l(e.backgroundColor)&&(s.backgroundColor=e.backgroundColor.evaluateColor(s,vBe)),l(e.backgroundPadding)&&(s.backgroundPadding=e.backgroundPadding.evaluate(s)),l(e.backgroundEnabled)&&(s.backgroundEnabled=e.backgroundEnabled.evaluate(s)),l(e.scaleByDistance)){let a=e.scaleByDistance.evaluate(s);l(a)?(AW.near=a.x,AW.nearValue=a.y,AW.far=a.z,AW.farValue=a.w,s.scaleByDistance=AW):s.scaleByDistance=void 0}else s.scaleByDistance=void 0;if(l(e.translucencyByDistance)){let a=e.translucencyByDistance.evaluate(s);l(a)?(MW.near=a.x,MW.nearValue=a.y,MW.far=a.z,MW.farValue=a.w,s.translucencyByDistance=MW):s.translucencyByDistance=void 0}else s.translucencyByDistance=void 0;if(l(e.distanceDisplayCondition)){let a=e.distanceDisplayCondition.evaluate(s);l(a)?(IH.near=a.x,IH.far=a.y,s.distanceDisplayCondition=IH):s.distanceDisplayCondition=void 0}else s.distanceDisplayCondition=void 0;l(e.heightOffset)&&(s.heightOffset=e.heightOffset.evaluate(s)),l(e.anchorLineEnabled)&&(s.anchorLineEnabled=e.anchorLineEnabled.evaluate(s)),l(e.anchorLineColor)&&(s.anchorLineColor=e.anchorLineColor.evaluateColor(s,wBe)),l(e.image)?s.image=e.image.evaluate(s):s.image=void 0,l(e.disableDepthTestDistance)&&(s.disableDepthTestDistance=e.disableDepthTestDistance.evaluate(s)),l(e.horizontalOrigin)&&(s.horizontalOrigin=e.horizontalOrigin.evaluate(s)),l(e.verticalOrigin)&&(s.verticalOrigin=e.verticalOrigin.evaluate(s)),l(e.labelHorizontalOrigin)&&(s.labelHorizontalOrigin=e.labelHorizontalOrigin.evaluate(s)),l(e.labelVerticalOrigin)&&(s.labelVerticalOrigin=e.labelVerticalOrigin.evaluate(s))}};uy.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=GBe(this,e.mapProjection.ellipsoid)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._polylineCollection.update(e),this._billboardCollection.update(e),this._labelCollection.update(e)};uy.prototype.isDestroyed=function(){return!1};uy.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(),ue(this)};var NW=uy;var $En=T(S(),1);function o0(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=g(e.ellipsoid,oe.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=g(e.center,h.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._promise=void 0,this._error=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=Bn.BOTH}Object.defineProperties(o0.prototype,{trianglesLength:{get:function(){return l(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});function FBe(e){let t=new Float64Array(3+h.packedLength+oe.packedLength+de.packedLength),n=0;return t[n++]=e._indices.BYTES_PER_ELEMENT,t[n++]=e._minimumHeight,t[n++]=e._maximumHeight,h.pack(e._center,t,n),n+=h.packedLength,oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,de.pack(e._rectangle,t,n),t}function ABe(e,t){let n=1,i=t[n++],o=e._boundingVolumes=new Array(i);for(let a=0;a<i;++a)o[a]=Xn.unpack(t,n),n+=Xn.packedLength;let r=t[n++],s=e._batchedIndices=new Array(r);for(let a=0;a<r;++a){let c=O.unpack(t,n);n+=O.packedLength;let d=t[n++],u=t[n++],m=t[n++],p=new Array(m);for(let y=0;y<m;++y)p[y]=t[n++];s[a]=new tf({color:c,offset:d,count:u,batchIds:p})}}var MBe=new gi("createVectorTilePolygons",5),NBe=new O;function UBe(e){if(l(e._primitive))return;let t=e._positions,n=e._counts,i=e._indexCounts,o=e._indices,r=e._transferrableBatchIds,s=e._batchTableColors,a=e._packedBuffer;if(!l(s)){t=e._positions=e._positions.slice(),n=e._counts=e._counts.slice(),i=e._indexCounts=e._indexCounts.slice(),o=e._indices=e._indices.slice(),e._center=e._ellipsoid.cartographicToCartesian(de.center(e._rectangle)),r=e._transferrableBatchIds=new Uint32Array(e._batchIds),s=e._batchTableColors=new Uint32Array(r.length);let y=e._batchTable,f=s.length;for(let x=0;x<f;++x){let _=y.getColor(x,NBe);s[x]=_.toRgba()}a=e._packedBuffer=FBe(e)}let c=[t.buffer,n.buffer,i.buffer,o.buffer,r.buffer,s.buffer,a.buffer],d={packedBuffer:a.buffer,positions:t.buffer,counts:n.buffer,indexCounts:i.buffer,indices:o.buffer,batchIds:r.buffer,batchTableColors:s.buffer},u=e._polygonMinimumHeights,m=e._polygonMaximumHeights;l(u)&&l(m)&&(u=u.slice(),m=m.slice(),c.push(u.buffer,m.buffer),d.minimumHeights=u,d.maximumHeights=m);let p=MBe.scheduleTask(d,c);if(l(p))return p.then(y=>{if(e.isDestroyed())return;e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;let f=new Float64Array(y.packedBuffer),x=f[0];ABe(e,f),e._indices=Ne.getSizeInBytes(x)===2?new Uint16Array(y.indices):new Uint32Array(y.indices),e._indexOffsets=new Uint32Array(y.indexOffsets),e._indexCounts=new Uint32Array(y.indexCounts),e._batchedPositions=new Float32Array(y.positions),e._vertexBatchIds=new Uint16Array(y.batchIds),kBe(e),e._ready=!0}).catch(y=>{e.isDestroyed()||(e._error=y)})}function kBe(e){l(e._primitive)||(e._primitive=new vx({batchTable:e._batchTable,positions:e._batchedPositions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center}),e._batchTable=void 0,e._batchIds=void 0,e._positions=void 0,e._counts=void 0,e._indices=void 0,e._indexCounts=void 0,e._indexOffsets=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0,e._center=void 0,e._rectangle=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0)}o0.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};o0.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};o0.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};o0.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};o0.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=UBe(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};o0.prototype.isDestroyed=function(){return!1};o0.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var UW=o0;var ZIn=T(S(),1);var tIn=T(S(),1),kW=`in vec4 currentPosition;
in vec4 previousPosition;
in vec4 nextPosition;
in vec2 expandAndWidth;
in float a_batchId;
uniform mat4 u_modifiedModelView;
void main()
{
float expandDir = expandAndWidth.x;
float width = abs(expandAndWidth.y) + 0.5;
bool usePrev = expandAndWidth.y < 0.0;
vec4 p = u_modifiedModelView * currentPosition;
vec4 prev = u_modifiedModelView * previousPosition;
vec4 next = u_modifiedModelView * nextPosition;
float angle;
vec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle);
gl_Position = czm_viewportOrthographic * positionWC;
}
`;function Ym(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=g(e.ellipsoid,oe.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._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=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=O.clone(O.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Ym.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function DBe(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+de.packedLength+oe.packedLength+h.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,de.pack(t,a,c),c+=de.packedLength,oe.pack(o,a,c),c+=oe.packedLength,h.pack(r,a,c),a}var BBe=new gi("createVectorTilePolylines",5),AC={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function OBe(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=DBe(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},d=BBe.scheduleTask(c,a);if(l(d))return d.then(function(u){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(u.decodedPositions),e._decodedPositionOffsets=new Uint32Array(u.decodedPositionOffsets)),e._currentPositions=new Float32Array(u.currentPositions),e._previousPositions=new Float32Array(u.previousPositions),e._nextPositions=new Float32Array(u.nextPositions),e._expandAndWidth=new Float32Array(u.expandAndWidth),e._vertexBatchIds=new Uint16Array(u.batchIds);let m=u.indexDatatype;e._indices=m===Ne.UNSIGNED_SHORT?new Uint16Array(u.indices):new Uint32Array(u.indices),YBe(e,t),e._ready=!0}).catch(u=>{e.isDestroyed()||(e._error=u)})}function YBe(e,t){if(!l(e._va)){let n=e._currentPositions,i=e._previousPositions,o=e._nextPositions,r=e._expandAndWidth,s=e._vertexBatchIds,a=e._indices,c=i.byteLength+n.byteLength+o.byteLength;c+=r.byteLength+s.byteLength+a.byteLength,e._trianglesLength=a.length/3,e._geometryByteLength=c;let d=ft.createVertexBuffer({context:t,typedArray:i,usage:Ue.STATIC_DRAW}),u=ft.createVertexBuffer({context:t,typedArray:n,usage:Ue.STATIC_DRAW}),m=ft.createVertexBuffer({context:t,typedArray:o,usage:Ue.STATIC_DRAW}),p=ft.createVertexBuffer({context:t,typedArray:r,usage:Ue.STATIC_DRAW}),y=ft.createVertexBuffer({context:t,typedArray:s,usage:Ue.STATIC_DRAW}),f=ft.createIndexBuffer({context:t,typedArray:a,usage:Ue.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?Ne.UNSIGNED_SHORT:Ne.UNSIGNED_INT}),x=[{index:AC.previousPosition,vertexBuffer:d,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:AC.currentPosition,vertexBuffer:u,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:AC.nextPosition,vertexBuffer:m,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:AC.expandAndWidth,vertexBuffer:p,componentDatatype:Q.FLOAT,componentsPerAttribute:2},{index:AC.a_batchId,vertexBuffer:y,componentDatatype:Q.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new oi({context:t,attributes:x,indexBuffer:f}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._currentPositions=void 0,e._previousPositions=void 0,e._nextPositions=void 0,e._expandAndWidth=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var DW=new A,Mse=new h;function HBe(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return A.clone(n,DW),A.multiplyByPoint(DW,e._center,Mse),A.setTranslation(DW,Mse,DW),DW},u_highlightColor:function(){return e._highlightColor}})}function KBe(e){if(l(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=ke.fromCache({blending:mn.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var zBe=`uniform vec4 u_highlightColor;
void main()
{
out_FragColor = u_highlightColor;
}
`;function JBe(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(kW),o=n.getFragmentShaderCallback(!1,void 0,!1)(zBe),r=new Oe({defines:["VECTOR_TILE",Bt.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[od,i]}),s=new Oe({defines:["VECTOR_TILE"],sources:[o]});e._sp=Qt.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:AC})}function QBe(e,t){if(!l(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new nt({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:Ve.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}Ym.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,o=e._decodedPositionOffsets;if(!l(n)||!l(i))return;let r,s,a=n.length,c=0,d=0;for(r=0;r<a;++r)n[r]===t&&(c+=o[r+1]-o[r]);if(c===0)return;let u=new Float64Array(c*3);for(r=0;r<a;++r)if(n[r]===t){let m=o[r],p=o[r+1]-m;for(s=0;s<p;++s){let y=(m+s)*3;u[d++]=i[y],u[d++]=i[y+1],u[d++]=i[y+2]}}return u};Ym.prototype.getPositions=function(e){return Ym.getPolylinePositions(this,e)};Ym.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o];t[r]=new vs(e,r)}};Ym.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function jBe(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.color=O.WHITE}}var qBe=new O,$Be=O.WHITE,e3e=!0;Ym.prototype.applyStyle=function(e,t){if(!l(e)){jBe(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.color=l(e.color)?e.color.evaluateColor(s,qBe):$Be,s.show=l(e.show)?e.show.evaluate(s):e3e}};Ym.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=OBe(this,t)),l(this._error)){let i=this._error;throw this._error=void 0,i}return}HBe(this,t),JBe(this,t),KBe(this);let n=e.passes;(n.render||n.pick)&&QBe(this,e)};Ym.prototype.isDestroyed=function(){return!1};Ym.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ue(this)};var u_=Ym;var hXn=T(S(),1);var EIn=T(S(),1),BW=`in vec3 startEllipsoidNormal;
in vec3 endEllipsoidNormal;
in vec4 startPositionAndHeight;
in vec4 endPositionAndHeight;
in vec4 startFaceNormalAndVertexCorner;
in vec4 endFaceNormalAndHalfWidth;
in float a_batchId;
uniform mat4 u_modifiedModelView;
uniform vec2 u_minimumMaximumVectorHeights;
out vec4 v_startPlaneEC;
out vec4 v_endPlaneEC;
out vec4 v_rightPlaneEC;
out float v_halfWidth;
out vec3 v_volumeUpEC;
void main()
{
// vertex corner IDs
// 3-----------7
// /| left /|
// / | 1 / |
// 2-----------6 5 end
// | / | /
// start |/ right |/
// 0-----------4
//
float isEnd = floor(startFaceNormalAndVertexCorner.w * 0.251); // 0 for front, 1 for end
float isTop = floor(startFaceNormalAndVertexCorner.w * mix(0.51, 0.19, isEnd)); // 0 for bottom, 1 for top
vec3 forward = endPositionAndHeight.xyz - startPositionAndHeight.xyz;
vec3 right = normalize(cross(forward, startEllipsoidNormal));
vec4 position = vec4(startPositionAndHeight.xyz, 1.0);
position.xyz += forward * isEnd;
v_volumeUpEC = czm_normal * normalize(cross(right, forward));
// Push for volume height
float offset;
vec3 ellipsoidNormal = mix(startEllipsoidNormal, endEllipsoidNormal, isEnd);
// offset height to create volume
offset = mix(startPositionAndHeight.w, endPositionAndHeight.w, isEnd);
offset = mix(u_minimumMaximumVectorHeights.y, u_minimumMaximumVectorHeights.x, isTop) - offset;
position.xyz += offset * ellipsoidNormal;
// move from RTC to EC
position = u_modifiedModelView * position;
right = czm_normal * right;
// Push for width in a direction that is in the start or end plane and in a plane with right
// N = normalEC ("right-facing" direction for push)
// R = right
// p = angle between N and R
// w = distance to push along R if R == N
// d = distance to push along N
//
// N R
// { p| } * cos(p) = dot(N, R) = w / d
// d | |w * d = w / dot(N, R)
// { | }
// o---------- polyline segment ---->
//
vec3 scratchNormal = mix(-startFaceNormalAndVertexCorner.xyz, endFaceNormalAndHalfWidth.xyz, isEnd);
scratchNormal = cross(scratchNormal, mix(startEllipsoidNormal, endEllipsoidNormal, isEnd));
vec3 miterPushNormal = czm_normal * normalize(scratchNormal);
offset = 2.0 * endFaceNormalAndHalfWidth.w * max(0.0, czm_metersPerPixel(position)); // offset = widthEC
offset = offset / dot(miterPushNormal, right);
position.xyz += miterPushNormal * (offset * sign(0.5 - mod(startFaceNormalAndVertexCorner.w, 2.0)));
gl_Position = czm_depthClamp(czm_projection * position);
position = u_modifiedModelView * vec4(startPositionAndHeight.xyz, 1.0);
vec3 startNormalEC = czm_normal * startFaceNormalAndVertexCorner.xyz;
v_startPlaneEC = vec4(startNormalEC, -dot(startNormalEC, position.xyz));
v_rightPlaneEC = vec4(right, -dot(right, position.xyz));
position = u_modifiedModelView * vec4(endPositionAndHeight.xyz, 1.0);
vec3 endNormalEC = czm_normal * endFaceNormalAndHalfWidth.xyz;
v_endPlaneEC = vec4(endNormalEC, -dot(endNormalEC, position.xyz));
v_halfWidth = endFaceNormalAndHalfWidth.w;
}
`;var XIn=T(S(),1),OW=`in vec4 v_startPlaneEC;
in vec4 v_endPlaneEC;
in vec4 v_rightPlaneEC;
in float v_halfWidth;
in vec3 v_volumeUpEC;
uniform vec4 u_highlightColor;
void main()
{
float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)));
// Discard for sky
if (logDepthOrDepth == 0.0) {
#ifdef DEBUG_SHOW_VOLUME
out_FragColor = vec4(0.0, 0.0, 1.0, 0.5);
return;
#else // DEBUG_SHOW_VOLUME
discard;
#endif // DEBUG_SHOW_VOLUME
}
vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
eyeCoordinate /= eyeCoordinate.w;
float halfMaxWidth = v_halfWidth * czm_metersPerPixel(eyeCoordinate);
// Expand halfMaxWidth if direction to camera is almost perpendicular with the volume's up direction
halfMaxWidth += halfMaxWidth * (1.0 - dot(-normalize(eyeCoordinate.xyz), v_volumeUpEC));
// Check distance of the eye coordinate against the right-facing plane
float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz);
// Check eye coordinate against the mitering planes
float distanceFromStart = czm_planeDistance(v_startPlaneEC, eyeCoordinate.xyz);
float distanceFromEnd = czm_planeDistance(v_endPlaneEC, eyeCoordinate.xyz);
if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) {
#ifdef DEBUG_SHOW_VOLUME
out_FragColor = vec4(logDepthOrDepth, 0.0, 0.0, 0.5);
return;
#else // DEBUG_SHOW_VOLUME
discard;
#endif // DEBUG_SHOW_VOLUME
}
out_FragColor = u_highlightColor;
czm_writeDepthClamp();
}
`;function r0(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=g(e.ellipsoid,oe.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,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._minimumMaximumVectorHeights=new B(hi._defaultMinTerrainHeight,hi._defaultMaxTerrainHeight),this._boundingVolume=Xn.fromRectangle(e.rectangle,hi._defaultMinTerrainHeight,hi._defaultMaxTerrainHeight,this._ellipsoid),this._classificationType=e.classificationType,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._startEllipsoidNormals=void 0,this._endEllipsoidNormals=void 0,this._startPositionAndHeights=void 0,this._startFaceNormalAndVertexCornerIds=void 0,this._endPositionAndHeights=void 0,this._endFaceNormalAndHalfWidths=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=O.clone(O.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(r0.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function t3e(e,t,n){let i=hi.getMinimumMaximumHeights(t,n),o=i.minimumTerrainHeight,r=i.maximumTerrainHeight,s=e._minimumMaximumVectorHeights;s.x=o,s.y=r;let a=e._boundingVolume,c=e._rectangle;Xn.fromRectangle(c,o,r,n,a)}function n3e(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+de.packedLength+oe.packedLength+h.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,de.pack(t,a,c),c+=de.packedLength,oe.pack(o,a,c),c+=oe.packedLength,h.pack(r,a,c),a}var i3e=new gi("createVectorTileClampedPolylines"),my={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function o3e(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=n3e(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},d=i3e.scheduleTask(c,a);if(l(d))return d.then(function(u){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(u.decodedPositions),e._decodedPositionOffsets=new Uint32Array(u.decodedPositionOffsets)),e._startEllipsoidNormals=new Float32Array(u.startEllipsoidNormals),e._endEllipsoidNormals=new Float32Array(u.endEllipsoidNormals),e._startPositionAndHeights=new Float32Array(u.startPositionAndHeights),e._startFaceNormalAndVertexCornerIds=new Float32Array(u.startFaceNormalAndVertexCornerIds),e._endPositionAndHeights=new Float32Array(u.endPositionAndHeights),e._endFaceNormalAndHalfWidths=new Float32Array(u.endFaceNormalAndHalfWidths),e._vertexBatchIds=new Uint16Array(u.vertexBatchIds);let m=u.indexDatatype;e._indices=m===Ne.UNSIGNED_SHORT?new Uint16Array(u.indices):new Uint32Array(u.indices),r3e(e,t),e._ready=!0}).catch(u=>{e.isDestroyed()||(e._error=u)})}function r3e(e,t){if(!l(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,o=e._startPositionAndHeights,r=e._endPositionAndHeights,s=e._startFaceNormalAndVertexCornerIds,a=e._endFaceNormalAndHalfWidths,c=e._vertexBatchIds,d=e._indices,u=n.byteLength+i.byteLength;u+=o.byteLength+r.byteLength,u+=s.byteLength+a.byteLength,u+=c.byteLength+d.byteLength,e._trianglesLength=d.length/3,e._geometryByteLength=u;let m=ft.createVertexBuffer({context:t,typedArray:n,usage:Ue.STATIC_DRAW}),p=ft.createVertexBuffer({context:t,typedArray:i,usage:Ue.STATIC_DRAW}),y=ft.createVertexBuffer({context:t,typedArray:o,usage:Ue.STATIC_DRAW}),f=ft.createVertexBuffer({context:t,typedArray:r,usage:Ue.STATIC_DRAW}),x=ft.createVertexBuffer({context:t,typedArray:s,usage:Ue.STATIC_DRAW}),_=ft.createVertexBuffer({context:t,typedArray:a,usage:Ue.STATIC_DRAW}),C=ft.createVertexBuffer({context:t,typedArray:c,usage:Ue.STATIC_DRAW}),V=ft.createIndexBuffer({context:t,typedArray:d,usage:Ue.STATIC_DRAW,indexDatatype:d.BYTES_PER_ELEMENT===2?Ne.UNSIGNED_SHORT:Ne.UNSIGNED_INT}),L=[{index:my.startEllipsoidNormal,vertexBuffer:m,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:my.endEllipsoidNormal,vertexBuffer:p,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:my.startPositionAndHeight,vertexBuffer:y,componentDatatype:Q.FLOAT,componentsPerAttribute:4},{index:my.endPositionAndHeight,vertexBuffer:f,componentDatatype:Q.FLOAT,componentsPerAttribute:4},{index:my.startFaceNormalAndVertexCorner,vertexBuffer:x,componentDatatype:Q.FLOAT,componentsPerAttribute:4},{index:my.endFaceNormalAndHalfWidth,vertexBuffer:_,componentDatatype:Q.FLOAT,componentsPerAttribute:4},{index:my.a_batchId,vertexBuffer:C,componentDatatype:Q.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new oi({context:t,attributes:L,indexBuffer:V}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._startEllipsoidNormals=void 0,e._endEllipsoidNormals=void 0,e._startPositionAndHeights=void 0,e._startFaceNormalAndVertexCornerIds=void 0,e._endPositionAndHeights=void 0,e._endFaceNormalAndHalfWidths=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var YW=new A,Nse=new h;function s3e(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return A.clone(n,YW),A.multiplyByPoint(YW,e._center,Nse),A.setTranslation(YW,Nse,YW),YW},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function Use(e){return ke.fromCache({cull:{enabled:!0,face:yi.FRONT},blending:mn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:On.EQUAL,frontOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.KEEP},backFunction:On.EQUAL,backOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.KEEP},reference:Nt.CESIUM_3D_TILE_MASK,mask:Nt.CESIUM_3D_TILE_MASK}})}function a3e(e){l(e._rs)||(e._rs=Use(!1),e._rs3DTiles=Use(!0))}function c3e(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(BW),o=n.getFragmentShaderCallback(!1,void 0,!0)(OW),r=new Oe({defines:["VECTOR_TILE",Bt.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[od,i]}),s=new Oe({defines:["VECTOR_TILE"],sources:[o]});e._sp=Qt.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:my})}function l3e(e,t){let n=e._command;if(!l(e._command)){let o=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new nt({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:o,boundingVolume:e._boundingVolume,pass:Ve.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let r=nt.shallowClone(n,n.derivedCommands.tileset);r.renderState=e._rs3DTiles,r.pass=Ve.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=r}let i=e._classificationType;(i===Bn.TERRAIN||i===Bn.BOTH)&&t.commandList.push(n),(i===Bn.CESIUM_3D_TILE||i===Bn.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}r0.prototype.getPositions=function(e){return u_.getPolylinePositions(this,e)};r0.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o];t[r]=new vs(e,r)}};r0.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function d3e(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.color=O.WHITE}}var u3e=new O,m3e=O.WHITE,h3e=!0;r0.prototype.applyStyle=function(e,t){if(!l(e)){d3e(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.color=l(e.color)?e.color.evaluateColor(s,u3e):m3e,s.show=l(e.show)?e.show.evaluate(s):h3e}};function f3e(e){return hi.initialize().then(function(){t3e(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}r0.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=f3e(this).then(o3e(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}s3e(this,t),c3e(this,t),a3e(this);let n=e.passes;(n.render||n.pick)&&l3e(this,e)};r0.prototype.isDestroyed=function(){return!1};r0.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ue(this)};var HW=r0;var xXn=T(S(),1);var XH=32767,p3e=new he,b3e=new h;function y3e(e,t,n,i,o){let r=e.length/3,s=e.subarray(0,r),a=e.subarray(r,2*r),c=e.subarray(2*r,3*r);Fn.zigZagDeltaDecode(s,a,c);let d=new Float64Array(e.length);for(let u=0;u<r;++u){let m=s[u],p=a[u],y=c[u],f=W.lerp(t.west,t.east,m/XH),x=W.lerp(t.south,t.north,p/XH),_=W.lerp(n,i,y/XH),C=he.fromRadians(f,x,_,p3e),V=o.cartographicToCartesian(C,b3e);h.pack(V,d,u*3)}return d}var KW=y3e;function Km(e,t,n,i,o){this._tileset=e,this._tile=t,this._resource=n,this._polygons=void 0,this._polylines=void 0,this._points=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,S3e(this,i,o)}Object.defineProperties(Km.prototype,{featuresLength:{get:function(){return l(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return l(this._points)?this._points.pointsLength:0}},trianglesLength:{get:function(){let e=0;return l(this._polygons)&&(e+=this._polygons.trianglesLength),l(this._polylines)&&(e+=this._polylines.trianglesLength),e}},geometryByteLength:{get:function(){let e=0;return l(this._polygons)&&(e+=this._polygons.geometryByteLength),l(this._polylines)&&(e+=this._polylines.geometryByteLength),e}},texturesByteLength:{get:function(){return l(this._points)?this._points.texturesByteLength:0}},batchTableByteLength:{get:function(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function g3e(e){return function(t,n){l(e._polygons)&&e._polygons.updateCommands(t,n)}}function x3e(e,t){let n,i,o,r,s=g(e.POLYGONS_LENGTH,0),a=g(e.POLYLINES_LENGTH,0),c=g(e.POINTS_LENGTH,0);if(s>0&&l(e.POLYGON_BATCH_IDS)){let p=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,p,s)}if(a>0&&l(e.POLYLINE_BATCH_IDS)){let p=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,p,a)}if(c>0&&l(e.POINT_BATCH_IDS)){let p=t.byteOffset+e.POINT_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,p,c)}let d=l(n)||l(i)||l(o),u=s>0&&!l(n)||a>0&&!l(i)||c>0&&!l(o);if(d&&u)throw new me("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(o)){let p=0;if(!l(n)&&s>0)for(n=new Uint16Array(s),r=0;r<s;++r)n[r]=p++;if(!l(i)&&a>0)for(i=new Uint16Array(a),r=0;r<a;++r)i[r]=p++;if(!l(o)&&c>0)for(o=new Uint16Array(c),r=0;r<c;++r)o[r]=p++}return{polygons:n,polylines:i,points:o}}var Hm=Uint32Array.BYTES_PER_ELEMENT;function _3e(e){return new u_(e)}function T3e(e){return new HW(e)}function S3e(e,t,n){n=g(n,0);let i=new Uint8Array(t),o=new DataView(t);n+=Hm;let r=o.getUint32(n,!0);if(r!==1)throw new me(`Only Vector tile version 1 is supported. Version ${r} is not.`);n+=Hm;let s=o.getUint32(n,!0);if(n+=Hm,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=Hm,a===0)throw new me("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=Hm;let d=o.getUint32(n,!0);n+=Hm;let u=o.getUint32(n,!0);n+=Hm;let m=o.getUint32(n,!0);n+=Hm;let p=o.getUint32(n,!0);n+=Hm;let y=o.getUint32(n,!0);n+=Hm;let f=o.getUint32(n,!0);n+=Hm;let x=Po(i,n,a);n+=a;let _=new Uint8Array(t,n,c);n+=c;let C,V;d>0&&(C=Po(i,n,d),n+=d,u>0&&(V=new Uint8Array(t,n,u),V=new Uint8Array(V),n+=u));let L=g(x.POLYGONS_LENGTH,0),Z=g(x.POLYLINES_LENGTH,0),G=g(x.POINTS_LENGTH,0),I=L+Z+G,P=new Xp(e,I,C,V,g3e(e));if(e._batchTable=P,I===0)return;let v=new Mm(x,_),F=v.getGlobalProperty("REGION");if(!l(F))throw new me("Feature table global property: REGION must be defined");let M=de.unpack(F),b=F[4],R=F[5],E=e._tile.computedTransform,X=v.getGlobalProperty("RTC_CENTER",Q.FLOAT,3);l(X)?(X=h.unpack(X),A.multiplyByPoint(E,X,X)):(X=de.center(M),X.height=W.lerp(b,R,.5),X=oe.WGS84.cartographicToCartesian(X));let w=x3e(x,_);if(n+=(4-n%4)%4,L>0){v.featuresLength=L;let N=g(v.getPropertyArray("POLYGON_COUNTS",Q.UNSIGNED_INT,1),v.getPropertyArray("POLYGON_COUNT",Q.UNSIGNED_INT,1));if(!l(N))throw new me("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let D=g(v.getPropertyArray("POLYGON_INDEX_COUNTS",Q.UNSIGNED_INT,1),v.getPropertyArray("POLYGON_INDEX_COUNT",Q.UNSIGNED_INT,1));if(!l(D))throw new me("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let k=N.reduce(function(H,j){return H+j*2},0),Y=D.reduce(function(H,j){return H+j},0),U=new Uint32Array(t,n,Y);n+=m;let J=new Uint16Array(t,n,k);n+=p;let K,ee;l(x.POLYGON_MINIMUM_HEIGHTS)&&l(x.POLYGON_MAXIMUM_HEIGHTS)&&(K=v.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",Q.FLOAT,1),ee=v.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",Q.FLOAT,1)),e._polygons=new UW({positions:J,counts:N,indexCounts:D,indices:U,minimumHeight:b,maximumHeight:R,polygonMinimumHeights:K,polygonMaximumHeights:ee,center:X,rectangle:M,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:P,batchIds:w.polygons,modelMatrix:E})}if(Z>0){v.featuresLength=Z;let N=g(v.getPropertyArray("POLYLINE_COUNTS",Q.UNSIGNED_INT,1),v.getPropertyArray("POLYLINE_COUNT",Q.UNSIGNED_INT,1));if(!l(N))throw new me("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let D=v.getPropertyArray("POLYLINE_WIDTHS",Q.UNSIGNED_SHORT,1);if(!l(D)){D=new Uint16Array(Z);for(let ee=0;ee<Z;++ee)D[ee]=2}let k=N.reduce(function(ee,H){return ee+H*3},0),Y=new Uint16Array(t,n,k);n+=y;let U=e._tileset,J=U.examineVectorLinesFunction;if(l(J)){let ee=KW(new Uint16Array(Y),M,b,R,oe.WGS84);C3e(ee,N,w.polylines,P,e.url,J)}let K=_3e;l(U.classificationType)&&(K=T3e),e._polylines=K({positions:Y,widths:D,counts:N,batchIds:w.polylines,minimumHeight:b,maximumHeight:R,center:X,rectangle:M,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:P,classificationType:U.classificationType,keepDecodedPositions:U.vectorKeepDecodedPositions})}if(G>0){let N=new Uint16Array(t,n,G*3);n+=f,e._points=new NW({positions:N,batchIds:w.points,minimumHeight:b,maximumHeight:R,rectangle:M,batchTable:P})}}function WH(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._polygons)&&e._polygons.createFeatures(e,n),l(e._polylines)&&e._polylines.createFeatures(e,n),l(e._points)&&e._points.createFeatures(e,n),e._features=n}}Km.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};Km.prototype.getFeature=function(e){return l(this._features)||WH(this),this._features[e]};Km.prototype.applyDebugSettings=function(e,t){l(this._polygons)&&this._polygons.applyDebugSettings(e,t),l(this._polylines)&&this._polylines.applyDebugSettings(e,t),l(this._points)&&this._points.applyDebugSettings(e,t)};Km.prototype.applyStyle=function(e){l(this._features)||WH(this),l(this._polygons)&&this._polygons.applyStyle(e,this._features),l(this._polylines)&&this._polylines.applyStyle(e,this._features),l(this._points)&&this._points.applyStyle(e,this._features)};Km.prototype.update=function(e,t){let n=!0;l(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(t),n=n&&this._polygons.ready),l(this._polylines)&&(this._polylines.update(t),n=n&&this._polylines.ready),l(this._points)&&(this._points.update(t),n=n&&this._points.ready),l(this._batchTable)&&n&&(l(this._features)||WH(this),this._batchTable.update(e,t),this._ready=!0)};Km.prototype.pick=function(e,t,n){};Km.prototype.getPolylinePositions=function(e){let t=this._polylines;if(l(t))return t.getPositions(e)};Km.prototype.isDestroyed=function(){return!1};Km.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(),ue(this)};function C3e(e,t,n,i,o,r){let s=t.length,a=0;for(let c=0;c<s;c++){let d=t[c]*3,u=e.slice(a,a+d);a+=d,r(u,n[c],o,i)}}var zW=Km;var kse={b3dm:function(e,t,n,i,o){return lf.fromB3dm(e,t,n,i,o)},pnts:function(e,t,n,i,o){return lf.fromPnts(e,t,n,i,o)},i3dm:function(e,t,n,i,o){return lf.fromI3dm(e,t,n,i,o)},cmpt:function(e,t,n,i,o){return KE.fromTileType(e,t,n,i,o,kse)},externalTileset:function(e,t,n,i){return VW.fromJson(e,t,n,i)},geom:function(e,t,n,i,o){return new JE(e,t,n,i,o)},vctr:function(e,t,n,i,o){return new zW(e,t,n,i,o)},subt:function(e,t,n,i,o){return mC.fromSubtreeJson(e,t,n,void 0,i,o)},subtreeJson:function(e,t,n,i){return mC.fromSubtreeJson(e,t,n,i)},glb:function(e,t,n,i,o){if(i.byteLength<12)throw new me("Invalid glb content");let a=new DataView(i,o).getUint32(8,!0),c=new Uint8Array(i,o,a);return lf.fromGltf(e,t,n,c)},gltf:function(e,t,n,i){return lf.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return lf.fromGeoJson(e,t,n,i)}},m_=kse;var QXn=T(S(),1),V3e={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},Uo=Object.freeze(V3e);var qXn=T(S(),1),zm={BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",COMPOSITE:"cmpt",POINT_CLOUD:"pnts",VECTOR:"vctr",GEOMETRY:"geom",GLTF:"gltf",GLTF_BINARY:"glb",IMPLICIT_SUBTREE:"subt",IMPLICIT_SUBTREE_JSON:"subtreeJson",EXTERNAL_TILESET:"externalTileset",MULTIPLE_CONTENT:"multipleContent",GEOJSON:"geoJson",VOXEL_BINARY:"voxl",VOXEL_JSON:"voxelJson"};zm.isBinaryFormat=function(e){switch(e){case zm.BATCHED_3D_MODEL:case zm.INSTANCED_3D_MODEL:case zm.COMPOSITE:case zm.POINT_CLOUD:case zm.VECTOR:case zm.GEOMETRY:case zm.IMPLICIT_SUBTREE:case zm.VOXEL_BINARY:case zm.GLTF_BINARY:return!0;default:return!1}};var Ts=Object.freeze(zm);var eWn=T(S(),1),L3e={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0},Cu=Object.freeze(L3e);var nWn=T(S(),1),Ns={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},s0=new Array(Ns.NUMBER_OF_PASSES);s0[Ns.RENDER]=Object.freeze({pass:Ns.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});s0[Ns.PICK]=Object.freeze({pass:Ns.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});s0[Ns.SHADOW]=Object.freeze({pass:Ns.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});s0[Ns.PRELOAD]=Object.freeze({pass:Ns.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});s0[Ns.PRELOAD_FLIGHT]=Object.freeze({pass:Ns.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});s0[Ns.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:Ns.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});s0[Ns.MOST_DETAILED_PRELOAD]=Object.freeze({pass:Ns.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});s0[Ns.MOST_DETAILED_PICK]=Object.freeze({pass:Ns.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Ns.getPassOptions=function(e){return s0[e]};var wo=Object.freeze(Ns);var rWn=T(S(),1);function hf(e,t){this._tileset=e,this._tile=t,this.featurePropertiesDirty=!1}Object.defineProperties(hf.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(){}},ready:{get:function(){return!0}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},metadata:{get:function(){},set:function(e){}},batchTable:{get:function(){}},group:{get:function(){},set:function(e){}}});hf.prototype.hasProperty=function(e,t){return!1};hf.prototype.getFeature=function(e){};hf.prototype.applyDebugSettings=function(e,t){};hf.prototype.applyStyle=function(e){};hf.prototype.update=function(e,t){};hf.prototype.pick=function(e,t,n){};hf.prototype.isDestroyed=function(){return!1};hf.prototype.destroy=function(){return ue(this)};var MC=hf;var bWn=T(S(),1);var lWn=T(S(),1);function a0(e){e=g(e,g.EMPTY_OBJECT);let t=e.content,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(a0.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});a0.prototype.hasProperty=function(e){return Nn.hasProperty(e,this._properties,this._class)};a0.prototype.hasPropertyBySemantic=function(e){return Nn.hasPropertyBySemantic(e,this._properties,this._class)};a0.prototype.getPropertyIds=function(e){return Nn.getPropertyIds(this._properties,this._class,e)};a0.prototype.getProperty=function(e){return Nn.getProperty(e,this._properties,this._class)};a0.prototype.setProperty=function(e,t){return Nn.setProperty(e,t,this._properties,this._class)};a0.prototype.getPropertyBySemantic=function(e){return Nn.getPropertyBySemantic(e,this._properties,this._class)};a0.prototype.setPropertyBySemantic=function(e,t){return Nn.setPropertyBySemantic(e,t,this._properties,this._class)};var JW=a0;function PH(e,t){let n=ci(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){PH._oneTimeWarning("findContentMetadata-missing-root-schema","Could not find a metadata schema for content metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=g(e.schema.classes,g.EMPTY_OBJECT);if(l(n.class)){let o=i[n.class];return new JW({content:n,class:o})}}PH._oneTimeWarning=Ft;var h_=PH;var _Wn=T(S(),1);function R3e(e,t){let n=e.metadataExtension;if(!l(n))return;let i=n.groups,o=ci(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"].group:t.group;if(typeof o=="number")return i[o];let r=n.groupIds.findIndex(function(s){return s===o});return r>=0?i[r]:void 0}var f_=R3e;var XWn=T(S(),1);var VWn=T(S(),1);function c0(e){e=g(e,g.EMPTY_OBJECT);let t=e.tile,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(c0.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});c0.prototype.hasProperty=function(e){return Nn.hasProperty(e,this._properties,this._class)};c0.prototype.hasPropertyBySemantic=function(e){return Nn.hasPropertyBySemantic(e,this._properties,this._class)};c0.prototype.getPropertyIds=function(e){return Nn.getPropertyIds(this._properties,this._class,e)};c0.prototype.getProperty=function(e){return Nn.getProperty(e,this._properties,this._class)};c0.prototype.setProperty=function(e,t){return Nn.setProperty(e,t,this._properties,this._class)};c0.prototype.getPropertyBySemantic=function(e){return Nn.getPropertyBySemantic(e,this._properties,this._class)};c0.prototype.setPropertyBySemantic=function(e,t){return Nn.setPropertyBySemantic(e,t,this._properties,this._class)};var QW=c0;function vH(e,t){let n=ci(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){vH._oneTimeWarning("findTileMetadata-missing-root-schema","Could not find a metadata schema for tile metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=g(e.schema.classes,g.EMPTY_OBJECT);if(l(n.class)){let o=i[n.class];return new QW({tile:n,class:o})}}vH._oneTimeWarning=Ft;var jW=vH;var e2n=T(S(),1);var MWn=T(S(),1);function Z3e(e){let t=new Uint8Array(e),n=Gm(t);if(n==="glTF"&&(n="glb"),Ts.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=G3e(t);if(l(i.root))return{contentType:Ts.EXTERNAL_TILESET,jsonPayload:i};if(l(i.asset))return{contentType:Ts.GLTF,jsonPayload:i};if(l(i.tileAvailability))return{contentType:Ts.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(l(i.type))return{contentType:Ts.GEOJSON,jsonPayload:i};if(l(i.voxelTable))return{contentType:Ts.VOXEL_JSON,jsonPayload:i};throw new me("Invalid tile content.")}function G3e(e){let t;try{t=Po(e)}catch{throw new me("Invalid tile content.")}return t}var ff=Z3e;function Vu(e,t,n,i){this._tileset=e,this._tile=t,this._tilesetResource=n,this._contents=[],this._contentsCreated=!1;let o=l(i.contents)?i.contents:i.content;this._innerContentHeaders=o,this._requestsInFlight=0,this._cancelCount=0;let r=this._innerContentHeaders.length;this._arrayFetchPromises=new Array(r),this._requests=new Array(r),this._ready=!1,this._innerContentResources=new Array(r),this._serverKeys=new Array(r);for(let s=0;s<r;s++){let a=n.getDerivedResource({url:o[s].uri}),c=Ha.getServerKey(a.getUrlComponent());this._innerContentResources[s]=a,this._serverKeys[s]=c}}Object.defineProperties(Vu.prototype,{featurePropertiesDirty:{get:function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)if(e[n].featurePropertiesDirty)return!0;return!1},set:function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].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}},ready:{get:function(){return this._contentsCreated?this._ready:!1}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},metadata:{get:function(){},set:function(){}},batchTable:{get:function(){}},group:{get:function(){},set:function(){}},innerContentUrls:{get:function(){return this._innerContentHeaders.map(function(e){return e.uri})}}});function wH(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function Dse(e,t){e._cancelCount++,e._tile._contentState=t;let n=e.tileset.statistics;n.numberOfPendingRequests-=e._requestsInFlight,n.numberOfAttemptedRequests+=e._requestsInFlight,e._requestsInFlight=0;let i=e._innerContentHeaders.length;e._arrayFetchPromises=new Array(i)}Vu.prototype.requestInnerContents=function(){if(!E3e(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let e=this._innerContentHeaders;wH(this,e.length);let t=this._cancelCount;for(let n=0;n<e.length;n++)this._arrayFetchPromises[n]=I3e(this,n,t,this._tile._contentState);return X3e(this)};function E3e(e){let t={};for(let n=0;n<e.length;n++){let i=e[n];l(t[i])?t[i]++:t[i]=1}for(let n in t)if(t.hasOwnProperty(n)&&!Ha.serverHasOpenSlots(n,t[n]))return!1;return Ha.heapHasOpenSlots(e.length)}function I3e(e,t,n,i){let o=e._innerContentResources[t].clone(),r=e.tile,s=function(){return r._priority},a=e._serverKeys[t],c=new Yo({throttle:!0,throttleByServer:!0,type:os.TILES3D,priorityFunction:s,serverKey:a});o.request=c,e._requests[t]=c;let d=o.fetchArrayBuffer();if(l(d))return d.then(function(u){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===ti.CANCELLED){Dse(e,i);return}return wH(e,-1),u}}).catch(function(u){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===ti.CANCELLED){Dse(e,i);return}wH(e,-1),Bse(e,t,u)}})}async function X3e(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((r,s)=>W3e(e,r,s)),o=await Promise.all(i);return e._contentsCreated=!0,e._contents=o.filter(l),o}async function W3e(e,t,n){if(l(t))try{let i=ff(t);if(i.contentType===Ts.EXTERNAL_TILESET)throw new me("External tilesets are disallowed inside multiple contents");e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===Ts.GEOMETRY||i.contentType===Ts.VECTOR;let o=e._tileset,r=e._innerContentResources[n],s=e._tile,a,c=m_[i.contentType];l(i.binaryPayload)?a=await Promise.resolve(c(o,s,r,i.binaryPayload.buffer,0)):a=await Promise.resolve(c(o,s,r,i.jsonPayload));let d=e._innerContentHeaders[n];if(s.hasImplicitContentMetadata){let m=s.implicitSubtree,p=s.implicitCoordinates;a.metadata=m.getContentMetadataView(p,n)}else s.hasImplicitContent||(a.metadata=h_(o,d));let u=f_(o,d);return l(u)&&(a.group=new Ix({metadata:u})),a}catch(i){Bse(e,n,i)}}function Bse(e,t,n){let i=e._tileset,o=e._innerContentResources[t].url,r=l(n.message)?n.message:n.toString();i.tileFailed.numberOfListeners>0?i.tileFailed.raiseEvent({url:o,message:r}):(console.log(`A content failed to load: ${o}`),console.log(`Error: ${r}`))}Vu.prototype.cancelRequests=function(){for(let e=0;e<this._requests.length;e++){let t=this._requests[e];l(t)&&t.cancel()}};Vu.prototype.hasProperty=function(e,t){return!1};Vu.prototype.getFeature=function(e){};Vu.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};Vu.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};Vu.prototype.update=function(e,t){let n=this._contents,i=n.length,o=!0;for(let r=0;r<i;++r)n[r].update(e,t),o=o&&n[r].ready;!this._ready&&o&&(this._ready=!0)};Vu.prototype.pick=function(e,t,n){if(!this._ready)return;let i,o=Number.POSITIVE_INFINITY,r=this._contents,s=r.length;for(let a=0;a<s;++a){let c=r[a].pick(e,t,n);if(!l(c))continue;let d=h.distance(e.origin,c);d<o&&(i=c,o=d)}if(l(i))return n};Vu.prototype.isDestroyed=function(){return!1};Vu.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var qW=Vu;var uPn=T(S(),1);var Y2n=T(S(),1);var y2n=T(S(),1),qse=T(zse(),1);var z3e=new h,J3e=new h,hy={};hy.computeArea2D=function(e){let t=e.length,n=0;for(let i=t-1,o=0;o<t;i=o++){let r=e[i],s=e[o];n+=r.x*s.y-s.x*r.y}return n*.5};hy.computeWindingOrder2D=function(e){return hy.computeArea2D(e)>0?ss.COUNTER_CLOCKWISE:ss.CLOCKWISE};hy.triangulate=function(e,t){let n=B.packArray(e);return(0,qse.default)(n,t,2)};var $se=new h,eae=new h,tae=new h,Jse=new h,Qse=new h,jse=new h,l0=new h,nae=new B,iae=new B,oae=new B,UC=new B;hy.computeSubdivision=function(e,t,n,i,o){o=g(o,W.RADIANS_PER_DEGREE);let r=l(i),s=n.slice(0),a,c=t.length,d=new Array(c*3),u=new Array(c*2),m=0,p=0;for(a=0;a<c;a++){let L=t[a];if(d[m++]=L.x,d[m++]=L.y,d[m++]=L.z,r){let Z=i[a];u[p++]=Z.x,u[p++]=Z.y}}let y=[],f={},x=e.maximumRadius,_=W.chordLength(o,x),C=_*_;for(;s.length>0;){let L=s.pop(),Z=s.pop(),G=s.pop(),I=h.fromArray(d,G*3,$se),P=h.fromArray(d,Z*3,eae),v=h.fromArray(d,L*3,tae),F,M,b;r&&(F=B.fromArray(u,G*2,nae),M=B.fromArray(u,Z*2,iae),b=B.fromArray(u,L*2,oae));let R=h.multiplyByScalar(h.normalize(I,Jse),x,Jse),E=h.multiplyByScalar(h.normalize(P,Qse),x,Qse),X=h.multiplyByScalar(h.normalize(v,jse),x,jse),w=h.magnitudeSquared(h.subtract(R,E,l0)),N=h.magnitudeSquared(h.subtract(E,X,l0)),D=h.magnitudeSquared(h.subtract(X,R,l0)),k=Math.max(w,N,D),Y,U,J;k>C?w===k?(Y=`${Math.min(G,Z)} ${Math.max(G,Z)}`,a=f[Y],l(a)||(U=h.add(I,P,l0),h.multiplyByScalar(U,.5,U),d.push(U.x,U.y,U.z),a=d.length/3-1,f[Y]=a,r&&(J=B.add(F,M,UC),B.multiplyByScalar(J,.5,J),u.push(J.x,J.y))),s.push(G,a,L),s.push(a,Z,L)):N===k?(Y=`${Math.min(Z,L)} ${Math.max(Z,L)}`,a=f[Y],l(a)||(U=h.add(P,v,l0),h.multiplyByScalar(U,.5,U),d.push(U.x,U.y,U.z),a=d.length/3-1,f[Y]=a,r&&(J=B.add(M,b,UC),B.multiplyByScalar(J,.5,J),u.push(J.x,J.y))),s.push(Z,a,G),s.push(a,L,G)):D===k&&(Y=`${Math.min(L,G)} ${Math.max(L,G)}`,a=f[Y],l(a)||(U=h.add(v,I,l0),h.multiplyByScalar(U,.5,U),d.push(U.x,U.y,U.z),a=d.length/3-1,f[Y]=a,r&&(J=B.add(b,F,UC),B.multiplyByScalar(J,.5,J),u.push(J.x,J.y))),s.push(L,a,Z),s.push(a,G,Z)):(y.push(G),y.push(Z),y.push(L))}let V={attributes:{position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:d})},indices:y,primitiveType:Ae.TRIANGLES};return r&&(V.attributes.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:u})),new mt(V)};var Q3e=new he,j3e=new he,q3e=new he,UH=new he;hy.computeRhumbLineSubdivision=function(e,t,n,i,o){o=g(o,W.RADIANS_PER_DEGREE);let r=l(i),s=n.slice(0),a,c=t.length,d=new Array(c*3),u=new Array(c*2),m=0,p=0;for(a=0;a<c;a++){let G=t[a];if(d[m++]=G.x,d[m++]=G.y,d[m++]=G.z,r){let I=i[a];u[p++]=I.x,u[p++]=I.y}}let y=[],f={},x=e.maximumRadius,_=W.chordLength(o,x),C=new Ca(void 0,void 0,e),V=new Ca(void 0,void 0,e),L=new Ca(void 0,void 0,e);for(;s.length>0;){let G=s.pop(),I=s.pop(),P=s.pop(),v=h.fromArray(d,P*3,$se),F=h.fromArray(d,I*3,eae),M=h.fromArray(d,G*3,tae),b,R,E;r&&(b=B.fromArray(u,P*2,nae),R=B.fromArray(u,I*2,iae),E=B.fromArray(u,G*2,oae));let X=e.cartesianToCartographic(v,Q3e),w=e.cartesianToCartographic(F,j3e),N=e.cartesianToCartographic(M,q3e);C.setEndPoints(X,w);let D=C.surfaceDistance;V.setEndPoints(w,N);let k=V.surfaceDistance;L.setEndPoints(N,X);let Y=L.surfaceDistance,U=Math.max(D,k,Y),J,K,ee,H,j;U>_?D===U?(J=`${Math.min(P,I)} ${Math.max(P,I)}`,a=f[J],l(a)||(K=C.interpolateUsingFraction(.5,UH),ee=(X.height+w.height)*.5,H=h.fromRadians(K.longitude,K.latitude,ee,e,l0),d.push(H.x,H.y,H.z),a=d.length/3-1,f[J]=a,r&&(j=B.add(b,R,UC),B.multiplyByScalar(j,.5,j),u.push(j.x,j.y))),s.push(P,a,G),s.push(a,I,G)):k===U?(J=`${Math.min(I,G)} ${Math.max(I,G)}`,a=f[J],l(a)||(K=V.interpolateUsingFraction(.5,UH),ee=(w.height+N.height)*.5,H=h.fromRadians(K.longitude,K.latitude,ee,e,l0),d.push(H.x,H.y,H.z),a=d.length/3-1,f[J]=a,r&&(j=B.add(R,E,UC),B.multiplyByScalar(j,.5,j),u.push(j.x,j.y))),s.push(I,a,P),s.push(a,G,P)):Y===U&&(J=`${Math.min(G,P)} ${Math.max(G,P)}`,a=f[J],l(a)||(K=L.interpolateUsingFraction(.5,UH),ee=(N.height+X.height)*.5,H=h.fromRadians(K.longitude,K.latitude,ee,e,l0),d.push(H.x,H.y,H.z),a=d.length/3-1,f[J]=a,r&&(j=B.add(E,b,UC),B.multiplyByScalar(j,.5,j),u.push(j.x,j.y))),s.push(G,a,I),s.push(a,P,I)):(y.push(P),y.push(I),y.push(G))}let Z={attributes:{position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:d})},indices:y,primitiveType:Ae.TRIANGLES};return r&&(Z.attributes.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:u})),new mt(Z)};hy.scaleToGeodeticHeight=function(e,t,n,i){n=g(n,oe.WGS84);let o=z3e,r=J3e;if(t=g(t,0),i=g(i,!0),l(e)){let s=e.length;for(let a=0;a<s;a+=3)h.fromArray(e,a,r),i&&(r=n.scaleToGeodeticSurface(r,r)),t!==0&&(o=n.geodeticSurfaceNormal(r,o),h.multiplyByScalar(o,t,o),h.add(r,o,r)),e[a]=r.x,e[a+1]=r.y,e[a+2]=r.z}return e};var di=hy;var R2n=T(S(),1);var rae=Math.cos,sae=Math.sin,$3e=Math.sqrt,DH={};DH.computePosition=function(e,t,n,i,o,r,s){let a=t.radiiSquared,c=e.nwCorner,d=e.boundingRectangle,u=c.latitude-e.granYCos*i+o*e.granXSin,m=rae(u),p=sae(u),y=a.z*p,f=c.longitude+i*e.granYSin+o*e.granXCos,x=m*rae(f),_=m*sae(f),C=a.x*x,V=a.y*_,L=$3e(C*x+V*_+y*p);if(r.x=C/L,r.y=V/L,r.z=y/L,n){let Z=e.stNwCorner;l(Z)?(u=Z.latitude-e.stGranYCos*i+o*e.stGranXSin,f=Z.longitude+i*e.stGranYSin+o*e.stGranXCos,s.x=(f-e.stWest)*e.lonScalar,s.y=(u-e.stSouth)*e.latScalar):(s.x=(f-d.west)*e.lonScalar,s.y=(u-d.south)*e.latScalar)}};var eOe=new io,Lu=new h,tOe=new he,d5=new h,kH=new Ri;function aae(e,t,n,i,o,r,s){let a=Math.cos(t),c=i*a,d=n*a,u=Math.sin(t),m=i*u,p=n*u;Lu=kH.project(e,Lu),Lu=h.subtract(Lu,d5,Lu);let y=io.fromRotation(t,eOe);Lu=io.multiplyByVector(y,Lu,Lu),Lu=h.add(Lu,d5,Lu),e=kH.unproject(Lu,e),r-=1,s-=1;let f=e.latitude,x=f+r*p,_=f-c*s,C=f-c*s+r*p,V=Math.max(f,x,_,C),L=Math.min(f,x,_,C),Z=e.longitude,G=Z+r*d,I=Z+s*m,P=Z+s*m+r*d,v=Math.max(Z,G,I,P),F=Math.min(Z,G,I,P);return{north:V,south:L,east:v,west:F,granYCos:c,granYSin:m,granXCos:d,granXSin:p,nwCorner:e}}DH.computeOptions=function(e,t,n,i,o,r,s){let a=e.east,c=e.west,d=e.north,u=e.south,m=!1,p=!1;d===W.PI_OVER_TWO&&(m=!0),u===-W.PI_OVER_TWO&&(p=!0);let y,f=d-u;c>a?y=W.TWO_PI-c+a:y=a-c;let x=Math.ceil(y/t)+1,_=Math.ceil(f/t)+1,C=y/(x-1),V=f/(_-1),L=de.northwest(e,r),Z=de.center(e,tOe);(n!==0||i!==0)&&(Z.longitude<L.longitude&&(Z.longitude+=W.TWO_PI),d5=kH.project(Z,d5));let G=V,I=C,P=0,v=0,F=de.clone(e,o),M={granYCos:G,granYSin:P,granXCos:I,granXSin:v,nwCorner:L,boundingRectangle:F,width:x,height:_,northCap:m,southCap:p};if(n!==0){let b=aae(L,n,C,V,Z,x,_);d=b.north,u=b.south,a=b.east,c=b.west,M.granYCos=b.granYCos,M.granYSin=b.granYSin,M.granXCos=b.granXCos,M.granXSin=b.granXSin,F.north=d,F.south=u,F.east=a,F.west=c}if(i!==0){n=n-i;let b=de.northwest(F,s),R=aae(b,n,C,V,Z,x,_);M.stGranYCos=R.granYCos,M.stGranXCos=R.granXCos,M.stGranYSin=R.granYSin,M.stGranXSin=R.granXSin,M.stNwCorner=b,M.stWest=R.west,M.stSouth=R.south}return M};var Ss=DH;var nOe=new ce,iOe=new ce,oOe=new h,rOe=new de;function cae(e,t){let n=e._ellipsoid,i=t.height,o=t.width,r=t.northCap,s=t.southCap,a=i,c=2,d=0,u=4;r&&(c-=1,a-=1,d+=1,u-=2),s&&(c-=1,a-=1,d+=1,u-=2),d+=c*o+2*a-u;let m=new Float64Array(d*3),p=0,y=0,f,x=oOe;if(r)Ss.computePosition(t,n,!1,y,0,x),m[p++]=x.x,m[p++]=x.y,m[p++]=x.z;else for(f=0;f<o;f++)Ss.computePosition(t,n,!1,y,f,x),m[p++]=x.x,m[p++]=x.y,m[p++]=x.z;for(f=o-1,y=1;y<i;y++)Ss.computePosition(t,n,!1,y,f,x),m[p++]=x.x,m[p++]=x.y,m[p++]=x.z;if(y=i-1,!s)for(f=o-2;f>=0;f--)Ss.computePosition(t,n,!1,y,f,x),m[p++]=x.x,m[p++]=x.y,m[p++]=x.z;for(f=0,y=i-2;y>0;y--)Ss.computePosition(t,n,!1,y,f,x),m[p++]=x.x,m[p++]=x.y,m[p++]=x.z;let _=m.length/3*2,C=Ne.createTypedArray(m.length/3,_),V=0;for(let Z=0;Z<m.length/3-1;Z++)C[V++]=Z,C[V++]=Z+1;C[V++]=m.length/3-1,C[V++]=0;let L=new mt({attributes:new pn,primitiveType:Ae.LINES});return L.attributes.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:m}),L.indices=C,L}function sOe(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,o=e._ellipsoid,r=cae(e,t),s=t.height,a=t.width,c=di.scaleToGeodeticHeight(r.attributes.position.values,n,o,!1),d=c.length,u=new Float64Array(d*2);u.set(c);let m=di.scaleToGeodeticHeight(r.attributes.position.values,i,o);u.set(m,d),r.attributes.position.values=u;let p=t.northCap,y=t.southCap,f=4;p&&(f-=1),y&&(f-=1);let x=(u.length/3+f)*2,_=Ne.createTypedArray(u.length/3,x);d=u.length/6;let C=0;for(let L=0;L<d-1;L++)_[C++]=L,_[C++]=L+1,_[C++]=L+d,_[C++]=L+d+1;_[C++]=d-1,_[C++]=0,_[C++]=d+d-1,_[C++]=d,_[C++]=0,_[C++]=d;let V;if(p)V=s-1;else{let L=a-1;_[C++]=L,_[C++]=L+d,V=a+s-2}if(_[C++]=V,_[C++]=V+d,!y){let L=a+V-1;_[C++]=L,_[C]=L+d}return r.indices=_,r}function DC(e){e=g(e,g.EMPTY_OBJECT);let t=e.rectangle,n=g(e.granularity,W.RADIANS_PER_DEGREE),i=g(e.ellipsoid,oe.WGS84),o=g(e.rotation,0),r=g(e.height,0),s=g(e.extrudedHeight,r);this._rectangle=de.clone(t),this._granularity=n,this._ellipsoid=i,this._surfaceHeight=Math.max(r,s),this._rotation=o,this._extrudedHeight=Math.min(r,s),this._offsetAttribute=e.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}DC.packedLength=de.packedLength+oe.packedLength+5;DC.pack=function(e,t,n){return n=g(n,0),de.pack(e._rectangle,t,n),n+=de.packedLength,oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._extrudedHeight,t[n]=g(e._offsetAttribute,-1),t};var lae=new de,dae=oe.clone(oe.UNIT_SPHERE),kC={rectangle:lae,ellipsoid:dae,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};DC.unpack=function(e,t,n){t=g(t,0);let i=de.unpack(e,t,lae);t+=de.packedLength;let o=oe.unpack(e,t,dae);t+=oe.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],d=e[t];return l(n)?(n._rectangle=de.clone(i,n._rectangle),n._ellipsoid=oe.clone(o,n._ellipsoid),n._surfaceHeight=s,n._rotation=a,n._extrudedHeight=c,n._offsetAttribute=d===-1?void 0:d,n):(kC.granularity=r,kC.height=s,kC.rotation=a,kC.extrudedHeight=c,kC.offsetAttribute=d===-1?void 0:d,new DC(kC))};var aOe=new he;DC.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=Ss.computeOptions(t,e._granularity,e._rotation,0,rOe,aOe),o,r;if(W.equalsEpsilon(t.north,t.south,W.EPSILON10)||W.equalsEpsilon(t.east,t.west,W.EPSILON10))return;let s=e._surfaceHeight,a=e._extrudedHeight,c=!W.equalsEpsilon(s,a,0,W.EPSILON2),d;if(c){if(o=sOe(e,i),l(e._offsetAttribute)){let p=o.attributes.position.values.length/3,y=new Uint8Array(p);e._offsetAttribute===an.TOP?y=y.fill(1,0,p/2):(d=e._offsetAttribute===an.NONE?0:1,y=y.fill(d)),o.attributes.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}let u=ce.fromRectangle3D(t,n,s,iOe),m=ce.fromRectangle3D(t,n,a,nOe);r=ce.union(u,m)}else{if(o=cae(e,i),o.attributes.position.values=di.scaleToGeodeticHeight(o.attributes.position.values,s,n,!1),l(e._offsetAttribute)){let u=o.attributes.position.values.length;d=e._offsetAttribute===an.NONE?0:1;let m=new Uint8Array(u/3).fill(d);o.attributes.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}r=ce.fromRectangle3D(t,n,s)}return new mt({attributes:o.attributes,indices:o.indices,primitiveType:Ae.LINES,boundingSphere:r,offsetAttribute:e._offsetAttribute})};var b_=DC;function OC(e){this.rectangle=de.clone(e.rectangle),this.minimumHeight=g(e.minimumHeight,0),this.maximumHeight=g(e.maximumHeight,0),this.southwestCornerCartesian=new h,this.northeastCornerCartesian=new h,this.westNormal=new h,this.southNormal=new h,this.eastNormal=new h,this.northNormal=new h;let t=g(e.ellipsoid,oe.WGS84);mOe(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,g(e.computeBoundingVolumes,!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(OC.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});OC.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=Xn.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=ce.fromOrientedBoundingBox(this._orientedBoundingBox)};var uae=new h,u5=new h,mae=new h,cOe=new h,lOe=new h,dOe=new h,uOe=new h,Ru=new he,hae=new ln(h.UNIT_X,0),BC=new gn;function mOe(e,t,n){n.cartographicToCartesian(de.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(de.northeast(t),e.northeastCornerCartesian),Ru.longitude=t.west,Ru.latitude=(t.south+t.north)*.5,Ru.height=0;let i=n.cartographicToCartesian(Ru,dOe),o=h.cross(i,h.UNIT_Z,cOe);h.normalize(o,e.westNormal),Ru.longitude=t.east;let r=n.cartographicToCartesian(Ru,uOe),s=h.cross(h.UNIT_Z,r,uae);h.normalize(s,e.eastNormal);let a=h.subtract(i,r,uae);h.magnitude(a)===0&&(a=h.clone(o,a));let c=h.normalize(a,lOe),d=t.south,u;if(d>0){Ru.longitude=(t.west+t.east)*.5,Ru.latitude=d;let x=n.cartographicToCartesian(Ru,BC.origin);h.clone(c,BC.direction);let _=ln.fromPointNormal(e.southwestCornerCartesian,e.westNormal,hae);ni.rayPlane(BC,_,e.southwestCornerCartesian),u=n.geodeticSurfaceNormal(x,u5)}else u=n.geodeticSurfaceNormalCartographic(de.southeast(t),u5);let m=h.cross(u,a,mae);h.normalize(m,e.southNormal);let p=t.north,y;if(p<0){Ru.longitude=(t.west+t.east)*.5,Ru.latitude=p;let x=n.cartographicToCartesian(Ru,BC.origin);h.negate(c,BC.direction);let _=ln.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,hae);ni.rayPlane(BC,_,e.northeastCornerCartesian),y=n.geodeticSurfaceNormal(x,u5)}else y=n.geodeticSurfaceNormalCartographic(de.northwest(t),u5);let f=h.cross(a,y,mae);h.normalize(f,e.northNormal)}var hOe=new h,fOe=new h,pOe=new h(0,-1,0),bOe=new h(0,0,-1),fae=new h;function yOe(e,t){let n=t.camera,i=n.positionWC,o=n.positionCartographic,r=0;if(!de.contains(e.rectangle,o)){let d=e.southwestCornerCartesian,u=e.northeastCornerCartesian,m=e.westNormal,p=e.southNormal,y=e.eastNormal,f=e.northNormal;t.mode!==ie.SCENE3D&&(d=t.mapProjection.project(de.southwest(e.rectangle),hOe),d.z=d.y,d.y=d.x,d.x=0,u=t.mapProjection.project(de.northeast(e.rectangle),fOe),u.z=u.y,u.y=u.x,u.x=0,m=pOe,y=h.UNIT_Y,p=bOe,f=h.UNIT_Z);let x=h.subtract(i,d,fae),_=h.dot(x,m),C=h.dot(x,p),V=h.subtract(i,u,fae),L=h.dot(V,y),Z=h.dot(V,f);_>0?r+=_*_:L>0&&(r+=L*L),C>0?r+=C*C:Z>0&&(r+=Z*Z)}let s,a,c;if(t.mode===ie.SCENE3D?(s=o.height,a=e.minimumHeight,c=e.maximumHeight):(s=i.x,a=0,c=0),s>c){let d=s-c;r+=d*d}else if(s<a){let d=a-s;r+=d*d}return Math.sqrt(r)}OC.prototype.distanceToCamera=function(e){let t=yOe(this,e);if(e.mode===ie.SCENE3D&&l(this._orientedBoundingBox)){let n=Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC));return Math.max(t,n)}return t};OC.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};OC.prototype.createDebugVolume=function(e){let t=new A.clone(A.IDENTITY),n=new b_({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new St({geometry:n,id:"outline",modelMatrix:t,attributes:{color:Ot.fromColor(e)}});return new En({geometryInstances:i,appearance:new cn({translucent:!1,flat:!0}),asynchronous:!1})};var Zu=OC;var Zvn=T(S(),1);var lvn=T(S(),1);var yPn=T(S(),1);var n2={},gOe=new h,pae=new h,bae=new h,yae=new h,gae=new Xn;n2.validOutline=function(e){let n=Xn.fromPoints(e,gae).halfAxes,i=q.getColumn(n,0,pae),o=q.getColumn(n,1,bae),r=q.getColumn(n,2,yae),s=h.magnitude(i),a=h.magnitude(o),c=h.magnitude(r);return!(s===0&&(a===0||c===0)||a===0&&c===0)};n2.computeProjectTo2DArguments=function(e,t,n,i){let o=Xn.fromPoints(e,gae),r=o.halfAxes,s=q.getColumn(r,0,pae),a=q.getColumn(r,1,bae),c=q.getColumn(r,2,yae),d=h.magnitude(s),u=h.magnitude(a),m=h.magnitude(c),p=Math.min(d,u,m);if(d===0&&(u===0||m===0)||u===0&&m===0)return!1;let y,f;return(p===u||p===m)&&(y=s),p===d?y=a:p===m&&(f=a),(p===d||p===u)&&(f=c),h.normalize(y,n),h.normalize(f,i),h.clone(o.center,t),!0};function xae(e,t,n,i,o){let r=h.subtract(e,t,gOe),s=h.dot(n,r),a=h.dot(i,r);return B.fromElements(s,a,o)}n2.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let o=new Array(i.length);for(let r=0;r<i.length;r++)o[r]=xae(i[r],e,t,n);return o}};n2.createProjectPointTo2DFunction=function(e,t,n){return function(i,o){return xae(i,e,t,n,o)}};var d0=n2;var HPn=T(S(),1);var xPn=T(S(),1);function fy(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(fy.prototype,{length:{get:function(){return this._length}}});fy.prototype.enqueue=function(e){this._array.push(e),this._length++};fy.prototype.dequeue=function(){if(this._length===0)return;let e=this._array,t=this._offset,n=e[t];return e[t]=void 0,t++,t>10&&t*2>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n};fy.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};fy.prototype.contains=function(e){return this._array.indexOf(e)!==-1};fy.prototype.clear=function(){this._array.length=this._offset=this._length=0};fy.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var py=fy;var jo={};jo.computeHierarchyPackedLength=function(e,t){let n=0,i=[e];for(;i.length>0;){let o=i.pop();if(!l(o))continue;n+=2;let r=o.positions,s=o.holes;if(l(r)&&r.length>0&&(n+=r.length*t.packedLength),l(s)){let a=s.length;for(let c=0;c<a;++c)i.push(s[c])}}return n};jo.packPolygonHierarchy=function(e,t,n,i){let o=[e];for(;o.length>0;){let r=o.pop();if(!l(r))continue;let s=r.positions,a=r.holes;if(t[n++]=l(s)?s.length:0,t[n++]=l(a)?a.length:0,l(s)){let c=s.length;for(let d=0;d<c;++d,n+=i.packedLength)i.pack(s[d],t,n)}if(l(a)){let c=a.length;for(let d=0;d<c;++d)o.push(a[d])}}return n};jo.unpackPolygonHierarchy=function(e,t,n){let i=e[t++],o=e[t++],r=new Array(i),s=o>0?new Array(o):void 0;for(let a=0;a<i;++a,t+=n.packedLength)r[a]=n.unpack(e,t);for(let a=0;a<o;++a)s[a]=jo.unpackPolygonHierarchy(e,t,n),t=s[a].startingIndex,delete s[a].startingIndex;return{positions:r,holes:s,startingIndex:t}};var y_=new B;function Sae(e,t,n,i){return B.subtract(t,e,y_),B.multiplyByScalar(y_,n/i,y_),B.add(e,y_,y_),[y_.x,y_.y]}var by=new h;function xOe(e,t,n,i){return h.subtract(t,e,by),h.multiplyByScalar(by,n/i,by),h.add(e,by,by),[by.x,by.y,by.z]}jo.subdivideLineCount=function(e,t,n){let o=h.distance(e,t)/n,r=Math.max(0,Math.ceil(W.log2(o)));return Math.pow(2,r)};var h5=new he,f5=new he,_Oe=new he,TOe=new h,m5=new Ca;jo.subdivideRhumbLineCount=function(e,t,n,i){let o=e.cartesianToCartographic(t,h5),r=e.cartesianToCartographic(n,f5),a=new Ca(o,r,e).surfaceDistance/i,c=Math.max(0,Math.ceil(W.log2(a)));return Math.pow(2,c)};jo.subdivideTexcoordLine=function(e,t,n,i,o,r){let s=jo.subdivideLineCount(n,i,o),a=B.distance(e,t),c=a/s,d=r;d.length=s*2;let u=0;for(let m=0;m<s;m++){let p=Sae(e,t,m*c,a);d[u++]=p[0],d[u++]=p[1]}return d};jo.subdivideLine=function(e,t,n,i){let o=jo.subdivideLineCount(e,t,n),r=h.distance(e,t),s=r/o;l(i)||(i=[]);let a=i;a.length=o*3;let c=0;for(let d=0;d<o;d++){let u=xOe(e,t,d*s,r);a[c++]=u[0],a[c++]=u[1],a[c++]=u[2]}return a};jo.subdivideTexcoordRhumbLine=function(e,t,n,i,o,r,s){let a=n.cartesianToCartographic(i,h5),c=n.cartesianToCartographic(o,f5);m5.setEndPoints(a,c);let d=m5.surfaceDistance/r,u=Math.max(0,Math.ceil(W.log2(d))),m=Math.pow(2,u),p=B.distance(e,t),y=p/m,f=s;f.length=m*2;let x=0;for(let _=0;_<m;_++){let C=Sae(e,t,_*y,p);f[x++]=C[0],f[x++]=C[1]}return f};jo.subdivideRhumbLine=function(e,t,n,i,o){let r=e.cartesianToCartographic(t,h5),s=e.cartesianToCartographic(n,f5),a=new Ca(r,s,e),c=a.surfaceDistance/i,d=Math.max(0,Math.ceil(W.log2(c))),u=Math.pow(2,d),m=a.surfaceDistance/u;l(o)||(o=[]);let p=o;p.length=u*3;let y=0;for(let f=0;f<u;f++){let x=a.interpolateUsingSurfaceDistance(f*m,_Oe),_=e.cartographicToCartesian(x,TOe);p[y++]=_.x,p[y++]=_.y,p[y++]=_.z}return p};var SOe=new h,COe=new h,VOe=new h,LOe=new h;jo.scaleToGeodeticHeightExtruded=function(e,t,n,i,o){i=g(i,oe.WGS84);let r=SOe,s=COe,a=VOe,c=LOe;if(l(e)&&l(e.attributes)&&l(e.attributes.position)){let d=e.attributes.position.values,u=d.length/2;for(let m=0;m<u;m+=3)h.fromArray(d,m,a),i.geodeticSurfaceNormal(a,r),c=i.scaleToGeodeticSurface(a,c),s=h.multiplyByScalar(r,n,s),s=h.add(c,s,s),d[m+u]=s.x,d[m+1+u]=s.y,d[m+2+u]=s.z,o&&(c=h.clone(a,c)),s=h.multiplyByScalar(r,t,s),s=h.add(c,s,s),d[m]=s.x,d[m+1]=s.y,d[m+2]=s.z}return e};jo.polygonOutlinesFromHierarchy=function(e,t,n){let i=[],o=new py;o.enqueue(e);let r,s,a;for(;o.length!==0;){let c=o.dequeue(),d=c.positions;if(t)for(a=d.length,r=0;r<a;r++)n.scaleToGeodeticSurface(d[r],d[r]);if(d=So(d,h.equalsEpsilon,!0),d.length<3)continue;let u=c.holes?c.holes.length:0;for(r=0;r<u;r++){let m=c.holes[r],p=m.positions;if(t)for(a=p.length,s=0;s<a;++s)n.scaleToGeodeticSurface(p[s],p[s]);if(p=So(p,h.equalsEpsilon,!0),p.length<3)continue;i.push(p);let y=0;for(l(m.holes)&&(y=m.holes.length),s=0;s<y;s++)o.enqueue(m.holes[s])}i.push(d)}return i};var ROe=new he;function ZOe(e,t,n){let i=n.cartesianToCartographic(e,h5),o=n.cartesianToCartographic(t,f5);if(Math.sign(i.latitude)===Math.sign(o.latitude))return;m5.setEndPoints(i,o);let r=m5.findIntersectionWithLatitude(0,ROe);if(!l(r))return;let s=Math.min(i.longitude,o.longitude),a=Math.max(i.longitude,o.longitude);if(Math.abs(a-s)>W.PI){let c=s;s=a,a=c}if(!(r.longitude<s||r.longitude>a))return n.cartographicToCartesian(r)}function GOe(e,t,n,i){if(i===jt.RHUMB)return ZOe(e,t,n);let o=ni.lineSegmentPlane(e,t,ln.ORIGIN_XY_PLANE);if(l(o))return n.scaleToGeodeticSurface(o,o)}var EOe=new he;function IOe(e,t,n){let i=[],o,r,s,a,c,d=0;for(;d<e.length;){o=e[d],r=e[(d+1)%e.length],s=W.sign(o.z),a=W.sign(r.z);let u=m=>t.cartesianToCartographic(m,EOe).longitude;if(s===0)i.push({position:d,type:s,visited:!1,next:a,theta:u(o)});else if(a!==0){if(c=GOe(o,r,t,n),++d,!l(c))continue;e.splice(d,0,c),i.push({position:d,type:s,visited:!1,next:a,theta:u(c)})}++d}return i}function Cae(e,t,n,i,o,r,s){let a=[],c=r,d=m=>p=>p.position===m,u=[];do{let m=n[c];a.push(m);let p=i.findIndex(d(c)),y=i[p];if(!l(y)){++c;continue}let{visited:f,type:x,next:_}=y;if(y.visited=!0,x===0){if(_===0){let Z=i[p-(s?1:-1)];if(Z?.position===c+1)Z.visited=!0;else{++c;continue}}if(!f&&s&&_>0||r===c&&!s&&_<0){++c;continue}}if(!(s?x>=0:x<=0)){++c;continue}f||u.push(c);let V=p+(s?1:-1),L=i[V];if(!l(L)){++c;continue}c=L.position}while(c<n.length&&c>=0&&c!==r&&a.length<n.length);e.splice(t,o,a);for(let m of u)t=Cae(e,++t,n,i,0,m,!s);return t}jo.splitPolygonsOnEquator=function(e,t,n,i){l(i)||(i=[]),i.splice(0,0,...e),i.length=e.length;let o=0;for(;o<i.length;){let r=i[o],s=r.slice();if(r.length<3){i[o]=s,++o;continue}let a=IOe(s,t,n);if(s.length===r.length||a.length<=1){i[o]=s,++o;continue}a.sort((d,u)=>d.theta-u.theta);let c=s[0].z>=0;o=Cae(i,o,s,a,1,0,c)}return i};jo.polygonsFromHierarchy=function(e,t,n,i,o,r){let s=[],a=[],c=new py;c.enqueue(e);let d=l(r);for(;c.length!==0;){let u=c.dequeue(),m=u.positions,p=u.holes,y,f;if(i)for(f=m.length,y=0;y<f;y++)o.scaleToGeodeticSurface(m[y],m[y]);if(t||(m=So(m,h.equalsEpsilon,!0)),m.length<3)continue;let x=n(m);if(!l(x))continue;let _=[],C=di.computeWindingOrder2D(x);if(C===ss.CLOCKWISE&&(x.reverse(),m=m.slice().reverse()),d){d=!1;let I=[m];if(I=r(I,I),I.length>1){for(let P of I)c.enqueue(new Va(P,p));continue}}let V=m.slice(),L=l(p)?p.length:0,Z=[],G;for(y=0;y<L;y++){let I=p[y],P=I.positions;if(i)for(f=P.length,G=0;G<f;++G)o.scaleToGeodeticSurface(P[G],P[G]);if(t||(P=So(P,h.equalsEpsilon,!0)),P.length<3)continue;let v=n(P);if(!l(v))continue;C=di.computeWindingOrder2D(v),C===ss.CLOCKWISE&&(v.reverse(),P=P.slice().reverse()),Z.push(P),_.push(V.length),V=V.concat(P),x=x.concat(v);let F=0;for(l(I.holes)&&(F=I.holes.length),G=0;G<F;G++)c.enqueue(I.holes[G])}s.push({outerRing:m,holes:Z}),a.push({positions:V,positions2D:x,holes:_})}return{hierarchy:s,polygons:a}};var XOe=new B,WOe=new h,POe=new Me,vOe=new q;jo.computeBoundingRectangle=function(e,t,n,i,o){let r=Me.fromAxisAngle(e,i,POe),s=q.fromQuaternion(r,vOe),a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,d=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,m=n.length;for(let p=0;p<m;++p){let y=h.clone(n[p],WOe);q.multiplyByVector(s,y,y);let f=t(y,XOe);l(f)&&(a=Math.min(a,f.x),c=Math.max(c,f.x),d=Math.min(d,f.y),u=Math.max(u,f.y))}return o.x=a,o.y=d,o.width=c-a,o.height=u-d,o};jo.createGeometryFromPositions=function(e,t,n,i,o,r,s){let a=di.triangulate(t.positions2D,t.holes);a.length<3&&(a=[0,1,2]);let c=t.positions,d=l(n),u=d?n.positions:void 0;if(o){let m=c.length,p=new Array(m*3),y=0;for(let _=0;_<m;_++){let C=c[_];p[y++]=C.x,p[y++]=C.y,p[y++]=C.z}let f={attributes:{position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:p})},indices:a,primitiveType:Ae.TRIANGLES};d&&(f.attributes.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:B.packArray(u)}));let x=new mt(f);return r.normal?Mn.computeNormal(x):x}if(s===jt.GEODESIC)return di.computeSubdivision(e,c,a,u,i);if(s===jt.RHUMB)return di.computeRhumbLineSubdivision(e,c,a,u,i)};var _ae=[],Tae=[],wOe=new h,FOe=new h;jo.computeWallGeometry=function(e,t,n,i,o,r){let s,a,c,d,u,m,p,y,f,x=e.length,_=0,C=0,V=l(t),L=V?t.positions:void 0;if(o)for(a=x*3*2,s=new Array(a*2),V&&(f=x*2*2,y=new Array(f*2)),c=0;c<x;c++)d=e[c],u=e[(c+1)%x],s[_]=s[_+a]=d.x,++_,s[_]=s[_+a]=d.y,++_,s[_]=s[_+a]=d.z,++_,s[_]=s[_+a]=u.x,++_,s[_]=s[_+a]=u.y,++_,s[_]=s[_+a]=u.z,++_,V&&(m=L[c],p=L[(c+1)%x],y[C]=y[C+f]=m.x,++C,y[C]=y[C+f]=m.y,++C,y[C]=y[C+f]=p.x,++C,y[C]=y[C+f]=p.y,++C);else{let v=W.chordLength(i,n.maximumRadius),F=0;if(r===jt.GEODESIC)for(c=0;c<x;c++)F+=jo.subdivideLineCount(e[c],e[(c+1)%x],v);else if(r===jt.RHUMB)for(c=0;c<x;c++)F+=jo.subdivideRhumbLineCount(n,e[c],e[(c+1)%x],v);for(a=(F+x)*3,s=new Array(a*2),V&&(f=(F+x)*2,y=new Array(f*2)),c=0;c<x;c++){d=e[c],u=e[(c+1)%x];let M,b;V&&(m=L[c],p=L[(c+1)%x]),r===jt.GEODESIC?(M=jo.subdivideLine(d,u,v,Tae),V&&(b=jo.subdivideTexcoordLine(m,p,d,u,v,_ae))):r===jt.RHUMB&&(M=jo.subdivideRhumbLine(n,d,u,v,Tae),V&&(b=jo.subdivideTexcoordRhumbLine(m,p,n,d,u,v,_ae)));let R=M.length;for(let E=0;E<R;++E,++_)s[_]=M[E],s[_+a]=M[E];if(s[_]=u.x,s[_+a]=u.x,++_,s[_]=u.y,s[_+a]=u.y,++_,s[_]=u.z,s[_+a]=u.z,++_,V){let E=b.length;for(let X=0;X<E;++X,++C)y[C]=b[X],y[C+f]=b[X];y[C]=p.x,y[C+f]=p.x,++C,y[C]=p.y,y[C+f]=p.y,++C}}}x=s.length;let Z=Ne.createTypedArray(x/3,x-e.length*6),G=0;for(x/=6,c=0;c<x;c++){let v=c,F=v+1,M=v+x,b=M+1;d=h.fromArray(s,v*3,wOe),u=h.fromArray(s,F*3,FOe),!h.equalsEpsilon(d,u,W.EPSILON10,W.EPSILON10)&&(Z[G++]=v,Z[G++]=M,Z[G++]=F,Z[G++]=F,Z[G++]=M,Z[G++]=b)}let I={attributes:new pn({position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:s})}),indices:Z,primitiveType:Ae.TRIANGLES};return V&&(I.attributes.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:y})),new mt(I)};var Yn=jo;function AOe(e){let t=e.length,n=new Float64Array(t*3),i=Ne.createTypedArray(t,t*2),o=0,r=0;for(let a=0;a<t;a++){let c=e[a];n[o++]=c.x,n[o++]=c.y,n[o++]=c.z,i[r++]=a,i[r++]=(a+1)%t}let s=new pn({position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:n})});return new mt({attributes:s,indices:i,primitiveType:Ae.LINES})}function g_(e){e=g(e,g.EMPTY_OBJECT);let t=e.polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=Yn.computeHierarchyPackedLength(t,h)+1}g_.fromPositions=function(e){e=g(e,g.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions}};return new g_(t)};g_.pack=function(e,t,n){return n=g(n,0),n=Yn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),t[n]=e.packedLength,t};var MOe={polygonHierarchy:{}};g_.unpack=function(e,t,n){t=g(t,0);let i=Yn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=e[t];return l(n)||(n=new g_(MOe)),n._polygonHierarchy=i,n.packedLength=o,n};g_.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=So(n,h.equalsEpsilon,!0),n.length<3||!d0.validOutline(n))return;let o=Yn.polygonOutlinesFromHierarchy(t,!1);if(o.length===0)return;let r=[];for(let c=0;c<o.length;c++){let d=new St({geometry:AOe(o[c])});r.push(d)}let s=Mn.combineInstances(r)[0],a=ce.fromPoints(t.positions);return new mt({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:a})};var Gu=g_;var p5=new he;function i2(e){let t=vp.fromToken(e.token),n=g(e.minimumHeight,0),i=g(e.maximumHeight,0),o=g(e.ellipsoid,oe.WGS84);this.s2Cell=t,this.minimumHeight=n,this.maximumHeight=i,this.ellipsoid=o;let r=KOe(t,n,i,o);this._boundingPlanes=r;let s=jOe(r);this._vertices=s,this._edgeNormals=new Array(6),this._edgeNormals[0]=QH(r[0],s.slice(0,4));let a;for(a=0;a<4;a++)this._edgeNormals[0][a]=h.negate(this._edgeNormals[0][a],this._edgeNormals[0][a]);for(this._edgeNormals[1]=QH(r[1],s.slice(4,8)),a=0;a<4;a++)this._edgeNormals[2+a]=QH(r[2+a],[s[a%4],s[(a+1)%4],s[4+(a+1)%4],s[4+a]]);for(this._planeVertices=[this._vertices.slice(0,4),this._vertices.slice(4,8)],a=0;a<4;a++)this._planeVertices.push([this._vertices[a%4],this._vertices[(a+1)%4],this._vertices[4+(a+1)%4],this._vertices[4+a]]);let c=t.getCenter();p5=o.cartesianToCartographic(c,p5),p5.height=(i+n)/2,this.center=o.cartographicToCartesian(p5,c),this._boundingSphere=ce.fromPoints(s)}var NOe=new h,UOe=new he,kOe=new h,DOe=new he,BOe=new h,OOe=new h,YOe=new h,HOe=new h;function KOe(e,t,n,i){let o=new Array(6),r=e.getCenter(),s=i.geodeticSurfaceNormal(r,NOe),a=i.cartesianToCartographic(r,UOe);a.height=n;let c=i.cartographicToCartesian(a,kOe),d=ln.fromPointNormal(c,s);o[0]=d;let u=0,m,p=[],y,f;for(m=0;m<4;m++){y=e.getVertex(m),p[m]=y,f=i.cartesianToCartographic(y,DOe),f.height=t;let _=ln.getPointDistance(d,i.cartographicToCartesian(f,BOe));_<u&&(u=_)}let x=ln.clone(d);for(x.normal=h.negate(x.normal,x.normal),x.distance=x.distance*-1+u,o[1]=x,m=0;m<4;m++){y=p[m];let _=p[(m+1)%4],C=i.geodeticSurfaceNormal(y,OOe),V=h.subtract(_,y,HOe),L=h.cross(V,C,YOe);L=h.normalize(L,L),o[2+m]=ln.fromPointNormal(y,L)}return o}var x_=new h,__=new h,T_=new h,BH=new h,OH=new h,YH=new h,zOe=new h,JOe=new h,QOe=new h,HH=new h,KH=new h,zH=new h,yy=new h,pf=new q;function Vae(e,t,n){x_=e.normal,__=t.normal,T_=n.normal,BH=h.multiplyByScalar(e.normal,-e.distance,BH),OH=h.multiplyByScalar(t.normal,-t.distance,OH),YH=h.multiplyByScalar(n.normal,-n.distance,YH),HH=h.multiplyByScalar(h.cross(__,T_,zOe),h.dot(BH,x_),HH),KH=h.multiplyByScalar(h.cross(T_,x_,JOe),h.dot(OH,__),KH),zH=h.multiplyByScalar(h.cross(x_,__,QOe),h.dot(YH,T_),zH),pf[0]=x_.x,pf[1]=__.x,pf[2]=T_.x,pf[3]=x_.y,pf[4]=__.y,pf[5]=T_.y,pf[6]=x_.z,pf[7]=__.z,pf[8]=T_.z;let i=q.determinant(pf);return yy=h.add(HH,KH,yy),yy=h.add(yy,zH,yy),new h(yy.x/i,yy.y/i,yy.z/i)}function jOe(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=Vae(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=Vae(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var JH=new h,YC=new h;function QH(e,t){let n=[];for(let i=0;i<4;i++)JH=h.subtract(t[(i+1)%4],t[i],JH),YC=h.cross(e.normal,JH,YC),YC=h.normalize(YC,YC),n[i]=h.clone(YC);return n}Object.defineProperties(i2.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var jH=new h;i2.prototype.distanceToCamera=function(e){let t=e.camera.positionWC,n=[],i=[],o;ln.getPointDistance(this._boundingPlanes[0],t)>0?(n.push(0),i.push(this._planeVertices[0]),o=this._edgeNormals[0]):ln.getPointDistance(this._boundingPlanes[1],t)>0&&(n.push(1),i.push(this._planeVertices[1]),o=this._edgeNormals[1]);let r,s;for(r=0;r<4;r++)s=2+r,ln.getPointDistance(this._boundingPlanes[s],t)>0&&(n.push(s),i.push(this._planeVertices[s]),o=this._edgeNormals[s]);if(n.length===0)return 0;let a,c;if(n.length===1)return c=this._boundingPlanes[n[0]],a=qH(ln.projectPointOntoPlane(c,t,jH),i[0],c,o),h.distance(a,t);if(n.length===2){if(n[0]===0){let p=[this._vertices[4*n[0]+(n[1]-2)],this._vertices[4*n[0]+(n[1]-2+1)%4]];return a=Lae(t,p[0],p[1]),h.distance(a,t)}let u=Number.MAX_VALUE,m;for(r=0;r<2;r++)c=this._boundingPlanes[n[r]],a=qH(ln.projectPointOntoPlane(c,t,jH),i[r],c,this._edgeNormals[n[r]]),m=h.distanceSquared(a,t),m<u&&(u=m);return Math.sqrt(u)}else if(n.length>3)return a=qH(ln.projectPointOntoPlane(this._boundingPlanes[1],t,jH),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),h.distance(a,t);let d=n[1]===2&&n[2]===5?0:1;return n[0]===0?h.distance(t,this._vertices[(n[1]-2+d)%4]):h.distance(t,this._vertices[4+(n[1]-2+d)%4])};var qOe=new h,$Oe=new h;function Lae(e,t,n){let i=h.subtract(n,t,qOe),o=h.subtract(e,t,$Oe),r=h.dot(i,o);if(r<=0)return t;let s=h.dot(i,i);return r>=s?n:(r=r/s,new h((1-r)*t.x+r*n.x,(1-r)*t.y+r*n.y,(1-r)*t.z+r*n.z))}var eYe=new ln(h.UNIT_X,0);function qH(e,t,n,i){let o=Number.MAX_VALUE,r,s,a;for(let c=0;c<t.length;c++){let d=ln.fromPointNormal(t[c],i[c],eYe);ln.getPointDistance(d,e)<0||(a=Lae(e,t[c],t[(c+1)%4]),r=h.distance(e,a),r<o&&(o=r,s=a))}return l(s)?s:e}i2.prototype.intersectPlane=function(e){let t=0,n=0;for(let i=0;i<this._vertices.length;i++)h.dot(e.normal,this._vertices[i])+e.distance<0?n++:t++;return t===this._vertices.length?nn.INSIDE:n===this._vertices.length?nn.OUTSIDE:nn.INTERSECTING};i2.prototype.createDebugVolume=function(e){let t=new A.clone(A.IDENTITY),n=new Gu({polygonHierarchy:{positions:this._planeVertices[0]}}),i=Gu.createGeometry(n),o=new St({geometry:i,id:"outline",modelMatrix:t,attributes:{color:Ot.fromColor(e)}}),r=new Gu({polygonHierarchy:{positions:this._planeVertices[1]}}),s=Gu.createGeometry(r),a=new St({geometry:s,id:"outline",modelMatrix:t,attributes:{color:Ot.fromColor(e)}}),c=[];for(let d=0;d<4;d++){let u=new Gu({polygonHierarchy:{positions:this._planeVertices[2+d]}}),m=Gu.createGeometry(u);c[d]=new St({geometry:m,id:"outline",modelMatrix:t,attributes:{color:Ot.fromColor(e)}})}return new En({geometryInstances:[c[0],c[1],c[2],c[3],a,o],appearance:new cn({translucent:!1,flat:!0}),asynchronous:!1})};var o2=i2;var rwn=T(S(),1);var zvn=T(S(),1);var Dvn=T(S(),1);var tYe=new h(1,1,1),b5=Math.cos,y5=Math.sin;function HC(e){e=g(e,g.EMPTY_OBJECT);let t=g(e.radii,tYe),n=g(e.innerRadii,t),i=g(e.minimumClock,0),o=g(e.maximumClock,W.TWO_PI),r=g(e.minimumCone,0),s=g(e.maximumCone,W.PI),a=Math.round(g(e.stackPartitions,10)),c=Math.round(g(e.slicePartitions,8)),d=Math.round(g(e.subdivisions,128));this._radii=h.clone(t),this._innerRadii=h.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._subdivisions=d,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}HC.packedLength=2*h.packedLength+8;HC.pack=function(e,t,n){return n=g(n,0),h.pack(e._radii,t,n),n+=h.packedLength,h.pack(e._innerRadii,t,n),n+=h.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n++]=e._subdivisions,t[n]=g(e._offsetAttribute,-1),t};var Rae=new h,Zae=new h,u0={radii:Rae,innerRadii:Zae,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};HC.unpack=function(e,t,n){t=g(t,0);let i=h.unpack(e,t,Rae);t+=h.packedLength;let o=h.unpack(e,t,Zae);t+=h.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],m=e[t++],p=e[t];return l(n)?(n._radii=h.clone(i,n._radii),n._innerRadii=h.clone(o,n._innerRadii),n._minimumClock=r,n._maximumClock=s,n._minimumCone=a,n._maximumCone=c,n._stackPartitions=d,n._slicePartitions=u,n._subdivisions=m,n._offsetAttribute=p===-1?void 0:p,n):(u0.minimumClock=r,u0.maximumClock=s,u0.minimumCone=a,u0.maximumCone=c,u0.stackPartitions=d,u0.slicePartitions=u,u0.subdivisions=m,u0.offsetAttribute=p===-1?void 0:p,new HC(u0))};HC.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,o=e._maximumClock,r=e._minimumCone,s=e._maximumCone,a=e._subdivisions,c=oe.fromCartesian3(t),d=e._slicePartitions+1,u=e._stackPartitions+1;d=Math.round(d*Math.abs(o-i)/W.TWO_PI),u=Math.round(u*Math.abs(s-r)/W.PI),d<2&&(d=2),u<2&&(u=2);let m=0,p=1,y=n.x!==t.x||n.y!==t.y||n.z!==t.z,f=!1,x=!1;y&&(p=2,r>0&&(f=!0,m+=d),s<Math.PI&&(x=!0,m+=d));let _=a*p*(u+d),C=new Float64Array(_*3),V=2*(_+m-(d+u)*p),L=Ne.createTypedArray(_,V),Z,G,I,P,v=0,F=new Array(u),M=new Array(u);for(Z=0;Z<u;Z++)P=r+Z*(s-r)/(u-1),F[Z]=y5(P),M[Z]=b5(P);let b=new Array(a),R=new Array(a);for(Z=0;Z<a;Z++)I=i+Z*(o-i)/(a-1),b[Z]=y5(I),R[Z]=b5(I);for(Z=0;Z<u;Z++)for(G=0;G<a;G++)C[v++]=t.x*F[Z]*R[G],C[v++]=t.y*F[Z]*b[G],C[v++]=t.z*M[Z];if(y)for(Z=0;Z<u;Z++)for(G=0;G<a;G++)C[v++]=n.x*F[Z]*R[G],C[v++]=n.y*F[Z]*b[G],C[v++]=n.z*M[Z];for(F.length=a,M.length=a,Z=0;Z<a;Z++)P=r+Z*(s-r)/(a-1),F[Z]=y5(P),M[Z]=b5(P);for(b.length=d,R.length=d,Z=0;Z<d;Z++)I=i+Z*(o-i)/(d-1),b[Z]=y5(I),R[Z]=b5(I);for(Z=0;Z<a;Z++)for(G=0;G<d;G++)C[v++]=t.x*F[Z]*R[G],C[v++]=t.y*F[Z]*b[G],C[v++]=t.z*M[Z];if(y)for(Z=0;Z<a;Z++)for(G=0;G<d;G++)C[v++]=n.x*F[Z]*R[G],C[v++]=n.y*F[Z]*b[G],C[v++]=n.z*M[Z];for(v=0,Z=0;Z<u*p;Z++){let w=Z*a;for(G=0;G<a-1;G++)L[v++]=w+G,L[v++]=w+G+1}let E=u*a*p;for(Z=0;Z<d;Z++)for(G=0;G<a-1;G++)L[v++]=E+Z+G*d,L[v++]=E+Z+(G+1)*d;if(y)for(E=u*a*p+d*a,Z=0;Z<d;Z++)for(G=0;G<a-1;G++)L[v++]=E+Z+G*d,L[v++]=E+Z+(G+1)*d;if(y){let w=u*a*p,N=w+a*d;if(f)for(Z=0;Z<d;Z++)L[v++]=w+Z,L[v++]=N+Z;if(x)for(w+=a*d-d,N+=a*d-d,Z=0;Z<d;Z++)L[v++]=w+Z,L[v++]=N+Z}let X=new pn({position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:C})});if(l(e._offsetAttribute)){let w=C.length,N=e._offsetAttribute===an.NONE?0:1,D=new Uint8Array(w/3).fill(N);X.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:D})}return new mt({attributes:X,indices:L,primitiveType:Ae.LINES,boundingSphere:ce.fromEllipsoid(c),offsetAttribute:e._offsetAttribute})};var fd=HC;function KC(e){let t=g(e.radius,1),i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new fd(i),this._workerName="createSphereOutlineGeometry"}KC.packedLength=fd.packedLength;KC.pack=function(e,t,n){return fd.pack(e._ellipsoidGeometry,t,n)};var nYe=new fd,S_={radius:void 0,radii:new h,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};KC.unpack=function(e,t,n){let i=fd.unpack(e,t,nYe);return S_.stackPartitions=i._stackPartitions,S_.slicePartitions=i._slicePartitions,S_.subdivisions=i._subdivisions,l(n)?(h.clone(i._radii,S_.radii),n._ellipsoidGeometry=new fd(S_),n):(S_.radius=i._radii.x,new KC(S_))};KC.createGeometry=function(e){return fd.createGeometry(e._ellipsoidGeometry)};var m0=KC;function zC(e,t){t===0&&(t=W.EPSILON7),this._boundingSphere=new ce(e,t)}Object.defineProperties(zC.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}}});zC.prototype.distanceToCamera=function(e){let t=this._boundingSphere;return Math.max(0,h.distance(t.center,e.camera.positionWC)-t.radius)};zC.prototype.intersectPlane=function(e){return ce.intersectPlane(this._boundingSphere,e)};zC.prototype.update=function(e,t){h.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};zC.prototype.createDebugVolume=function(e){let t=new m0({radius:this.radius}),n=A.fromTranslation(this.center,new A.clone(A.IDENTITY)),i=new St({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Ot.fromColor(e)}});return new En({geometryInstances:i,appearance:new cn({translucent:!1,flat:!0}),asynchronous:!1})};var h0=zC;var gwn=T(S(),1);var iYe=new h,oYe=new h,rYe=new h,sYe=new h;function C_(e,t,n){n=h.cross(e,t,n);let i=h.magnitude(n);return h.multiplyByScalar(n,W.EPSILON7/i,n)}function $H(e,t){let n=h.normalize(e,sYe),i=h.equalsEpsilon(n,h.UNIT_X,W.EPSILON6)?h.UNIT_Y:h.UNIT_X;return C_(e,i,t)}function Gae(e){let t=q.getColumn(e,0,iYe),n=q.getColumn(e,1,oYe),i=q.getColumn(e,2,rYe),o=h.equals(t,h.ZERO),r=h.equals(n,h.ZERO),s=h.equals(i,h.ZERO);return!o&&!r&&!s?e:o&&r&&s?(e[0]=W.EPSILON7,e[4]=W.EPSILON7,e[8]=W.EPSILON7,e):(o&&!r&&!s?t=C_(n,i,t):!o&&r&&!s?n=C_(t,i,n):!o&&!r&&s?i=C_(n,t,i):o?r?s||(t=$H(i,t),n=C_(i,t,n)):(t=$H(n,t),i=C_(n,t,i)):(n=$H(t,n),i=C_(n,t,i)),q.setColumn(e,0,t,e),q.setColumn(e,1,n,e),q.setColumn(e,2,i,e),e)}function JC(e,t){t=Gae(t),this._orientedBoundingBox=new Xn(e,t),this._boundingSphere=ce.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(JC.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});JC.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};JC.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};JC.prototype.update=function(e,t){h.clone(e,this._orientedBoundingBox.center),t=Gae(t),q.clone(t,this._orientedBoundingBox.halfAxes),ce.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};JC.prototype.createDebugVolume=function(e){let t=new bm({minimum:new h(-1,-1,-1),maximum:new h(1,1,1)}),n=A.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new St({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Ot.fromColor(e)}});return new En({geometryInstances:i,appearance:new cn({translucent:!1,flat:!0}),asynchronous:!1})};var pd=JC;function qo(e,t,n,i){this._tileset=e,this._header=n;let o=l(n.contents),r=o&&n.contents.length>1||ci(n,"3DTILES_multiple_contents"),s=o&&!r?n.contents[0]:n.content;this._contentHeader=s,this.transform=l(n.transform)?A.unpack(n.transform):A.clone(A.IDENTITY);let a=l(i)?i.computedTransform:e.modelMatrix,c=A.multiply(a,this.transform,new A),d=l(i)?i._initialTransform:A.IDENTITY;this._initialTransform=A.multiply(d,this.transform,new A),this.computedTransform=c,this.metadata=jW(e,n),this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,c),this._boundingVolume2D=void 0;let u;l(s)&&l(s.boundingVolume)&&(u=this.createBoundingVolume(s.boundingVolume,c)),this._contentBoundingVolume=u,this._contentBoundingVolume2D=void 0;let m;l(n.viewerRequestVolume)&&(m=this.createBoundingVolume(n.viewerRequestVolume,c)),this._viewerRequestVolume=m,this.geometricError=n.geometricError,this._geometricError=n.geometricError,l(this._geometricError)||(this._geometricError=l(i)?i._geometricError:e._geometricError,qo._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead.")),this.updateGeometricErrorScale();let p;l(n.refine)?((n.refine==="replace"||n.refine==="add")&&qo._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?Ao.REPLACE:Ao.ADD):l(i)?p=i.refine:p=Ao.REPLACE,this.refine=p,this.children=[],this.parent=i;let y,f=!1,x,_,C;if(t=Xe.createIfNeeded(t),r)x=Uo.UNLOADED,_=t.clone();else if(l(s)){let G=s.uri;l(s.url)&&(qo._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),G=s.url),G===""?(qo._deprecationWarning("contentUriEmpty","content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"),y=new MC(e,this),f=!0,x=Uo.READY):(x=Uo.UNLOADED,_=t.getDerivedResource({url:G}),C=Ha.getServerKey(_.getUrlComponent()))}else y=new MC(e,this),f=!0,x=Uo.READY;this._content=y,this._contentResource=_,this._contentState=x,this._expiredContent=void 0,this._serverKey=C,this.hasEmptyContent=f,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=r,this.cacheNode=void 0;let V=n.expire,L,Z;l(V)&&(L=V.duration,l(V.date)&&(Z=te.fromIso8601(V.date))),this.expireDuration=L,this.expireDate=Z,this.lastStyleTime=0,this._optimChildrenWithinParent=Cu.NOT_COMPUTED,this.clippingPlanesDirty=!1,this.priorityDeferred=!1,this.implicitTileset=void 0,this.implicitCoordinates=void 0,this.implicitSubtree=void 0,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._wasSelectedLastFrame=!1,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=O.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 te,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}qo._deprecationWarning=_r;Object.defineProperties(qo.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return g(this._contentBoundingVolume,this._boundingVolume)}},boundingSphere:{get:function(){return this._boundingVolume.boundingSphere}},isVisible:{get:function(){return this._visible&&this._inRequestVolume}},extras:{get:function(){return this._header.extras}},color:{get:function(){return l(this._color)||(this._color=new O),O.clone(this._color)},set:function(e){this._color=O.clone(e,this._color),this._colorDirty=!0}},hasRenderableContent:{get:function(){return!this.hasEmptyContent&&!this.hasTilesetContent&&!this.hasImplicitContent}},contentAvailable:{get:function(){return this.contentReady&&this.hasRenderableContent||l(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===Uo.READY}},contentUnloaded:{get:function(){return this._contentState===Uo.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===Uo.EXPIRED}},contentFailed:{get:function(){return this._contentState===Uo.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var gy=new h;function aYe(e,t){let{tileset:n,boundingSphere:i}=e,{radius:o,center:r}=i,{camera:s}=t,a=h.multiplyByScalar(s.directionWC,e._centerZDepth,gy),c=h.add(s.positionWC,a,gy),d=h.subtract(c,r,gy);if(h.magnitude(d)>o){let Z=h.normalize(d,gy),G=h.multiplyByScalar(Z,o,gy),I=h.add(r,G,gy),P=h.subtract(I,s.positionWC,gy),v=h.normalize(P,gy);e._foveatedFactor=1-Math.abs(h.dot(s.directionWC,v))}else e._foveatedFactor=0;let p=e.refine===Ao.REPLACE,y=n.isSkippingLevelOfDetail;if(p&&!y||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&y||n._pass===wo.PRELOAD_FLIGHT||n._pass===wo.PRELOAD)return!1;let f=1-Math.cos(s.frustum.fov*.5),x=n.foveatedConeSize*f;if(e._foveatedFactor<=x)return!1;let _=f-x,C=W.clamp((e._foveatedFactor-x)/_,0,1),V=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.memoryAdjustedScreenSpaceError,C),L=e._screenSpaceError===0&&l(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.memoryAdjustedScreenSpaceError-V<=L}var Wae=new te;qo.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,o=g(n,1),r=l(this.parent)?this.parent.geometricError:i._scaledGeometricError,s=t?r:this.geometricError;if(s===0)return 0;let{camera:a,context:c}=e,d=a.frustum,u=c.drawingBufferWidth,m=c.drawingBufferHeight*o,p;if(e.mode===ie.SCENE2D||d instanceof rn){let y=d.offCenterFrustum;l(y)&&(d=y);let f=Math.max(d.top-d.bottom,d.right-d.left)/Math.max(u,m);p=s/f}else{let y=Math.max(this._distanceToCamera,W.EPSILON7),f=d.sseDenominator;if(p=s*m/(y*f),i.dynamicScreenSpaceError){let x=i._dynamicScreenSpaceErrorComputedDensity,_=i.dynamicScreenSpaceErrorFactor,C=W.fog(y,x)*_;p-=C}}return p/=e.pixelRatio,p};function cYe(e,t){if(e.progressiveResolutionHeightFraction<=0||e.progressiveResolutionHeightFraction>.5)return!1;let n=e.memoryAdjustedScreenSpaceError,i=t._screenSpaceErrorProgressiveResolution>n;t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1;let o=t.parent,r=t._screenSpaceErrorProgressiveResolution<=n,s=l(o)&&o._screenSpaceErrorProgressiveResolution>n;return r&&s&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,i=!0),i}function lYe(e,t){let n=t.parent,o=l(n)&&(!e.isSkippingLevelOfDetail||t._screenSpaceError===0||n.hasTilesetContent||n.hasImplicitContent)?n._screenSpaceError:t._screenSpaceError;return e.root._screenSpaceError-o}qo.prototype.updateVisibility=function(e){let{parent:t,tileset:n}=this;if(this._updatedVisibilityFrame===n._updatedVisibilityFrame)return;let i=l(t)?t.computedTransform:n.modelMatrix,o=l(t)?t._visibilityPlaneMask:as.MASK_INDETERMINATE;this.updateTransform(i,e),this._distanceToCamera=this.distanceToTile(e),this._centerZDepth=this.distanceToTileCenter(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._screenSpaceErrorProgressiveResolution=this.getScreenSpaceError(e,!1,n.progressiveResolutionHeightFraction),this._visibilityPlaneMask=this.visibility(e,o),this._visible=this._visibilityPlaneMask!==as.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=lYe(n,this),this._priorityProgressiveResolution=cYe(n,this),this.priorityDeferred=aYe(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};qo.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=te.now(Wae);te.lessThan(this.expireDate,e)&&(this._contentState=Uo.EXPIRED,this._expiredContent=this._content)}};function dYe(e){if(!l(e.expireDuration))return;let t=te.now(Wae);te.addSeconds(t,e.expireDuration,t),l(e.expireDate)?te.lessThan(e.expireDate,t)&&te.clone(t,e.expireDate):e.expireDate=te.clone(t)}function uYe(e){return function(){return e._priority}}qo.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?mYe(this):fYe(this)};function mYe(e){let t=e._content,n=e._tileset;if(!l(t)){let o=ci(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new qW(n,e,e._contentResource.clone(),o),e._content=t}let i=t.requestInnerContents();if(l(i))return e._contentState=Uo.LOADING,i.then(o=>{if(!e.isDestroyed()&&l(o))return e._contentState=Uo.PROCESSING,t}).catch(o=>{if(!e.isDestroyed())throw e._contentState=Uo.FAILED,o})}async function hYe(e,t,n,i,o){let r=e._contentState;e._contentState=Uo.LOADING,++t.statistics.numberOfPendingRequests;let s;try{s=await o}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(n.cancelled||n.state===ti.CANCELLED){e._contentState=r,++t.statistics.numberOfAttemptedRequests;return}throw e._contentState=Uo.FAILED,a}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(n.cancelled||n.state===ti.CANCELLED){e._contentState=r,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let a=await pYe(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,e._contentState=Uo.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=Uo.FAILED,a}}function fYe(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new Yo({throttle:!0,throttleByServer:!0,type:os.TILES3D,priorityFunction:uYe(e),serverKey:e._serverKey});e._request=i,t.request=i;let o=e._tileset,r=t.fetchArrayBuffer();if(!l(r)){++o.statistics.numberOfAttemptedRequests;return}return hYe(e,o,i,n,r)}async function pYe(e,t){let n=ff(t),i=e._tileset;i._disableSkipLevelOfDetail=i._disableSkipLevelOfDetail||n.contentType===Ts.GEOMETRY||n.contentType===Ts.VECTOR,(n.contentType===Ts.IMPLICIT_SUBTREE||n.contentType===Ts.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0),n.contentType===Ts.EXTERNAL_TILESET&&(e.hasTilesetContent=!0);let o,r=m_[n.contentType];if(e.isDestroyed())return;l(n.binaryPayload)?o=await Promise.resolve(r(i,e,e._contentResource,n.binaryPayload.buffer,0)):o=await Promise.resolve(r(i,e,e._contentResource,n.jsonPayload));let s=e._contentHeader;if(e.hasImplicitContentMetadata){let c=e.implicitSubtree,d=e.implicitCoordinates;o.metadata=c.getContentMetadataView(d,0)}else e.hasImplicitContent||(o.metadata=h_(i,s));let a=f_(i,s);return l(a)&&(o.group=new Ix({metadata:a})),o}qo.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};qo.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Uo.UNLOADED,this.lastStyleTime=0,this.clippingPlanesDirty=this._clippingPlanesState===0,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 Pae=new ce;function tK(e,t){if(t.mode!==ie.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=ce.projectTo2D(n,t.mapProjection,Pae);e._boundingVolume2D=new h0(i.center,i.radius)}return t.mode!==ie.SCENE3D?e._boundingVolume2D:e._boundingVolume}function bYe(e,t){if(t.mode!==ie.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=ce.projectTo2D(n,t.mapProjection,Pae);e._contentBoundingVolume2D=new h0(i.center,i.radius)}return t.mode!==ie.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}qo.prototype.visibility=function(e,t){let n=e.cullingVolume,i=tK(this,e),o=this._tileset,r=o.clippingPlanes;if(l(r)&&r.enabled){let s=r.computeIntersectionWithBoundingVolume(i,o.clippingPlanesOriginMatrix);if(this._isClipped=s!==nn.INSIDE,s===nn.OUTSIDE)return as.MASK_OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};qo.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return nn.INSIDE;if(this._visibilityPlaneMask===as.MASK_INSIDE)return nn.INSIDE;let t=e.cullingVolume,n=bYe(this,e),i=this._tileset,o=i.clippingPlanes;if(l(o)&&o.enabled){let r=o.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=r!==nn.INSIDE,r===nn.OUTSIDE)return nn.OUTSIDE}return t.computeVisibility(n)};qo.prototype.distanceToTile=function(e){return tK(this,e).distanceToCamera(e)};var yYe=new h;qo.prototype.distanceToTileCenter=function(e){let n=tK(this,e).boundingVolume,i=h.subtract(n.center,e.camera.positionWC,yYe);return h.dot(e.camera.directionWC,i)};qo.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var vae=new q,wae=new h,gYe=new q,nK=new h,Fae=new de,Aae=new Xn,eK=new A;function xYe(e,t,n){let i=h.fromElements(e[0],e[1],e[2],nK),o=q.fromArray(e,3,gYe);i=A.multiplyByPoint(t,i,i);let r=A.getMatrix3(t,vae);return o=q.multiply(r,o,o),l(n)?(n.update(i,o),n):new pd(i,o)}function _Ye(e,t,n,i){let o=de.unpack(e,0,Fae),r=e[4],s=e[5],a=Xn.fromRectangle(o,r,s,oe.WGS84,Aae),c=a.center,d=a.halfAxes;t=A.multiplyTransformation(t,A.inverseTransformation(n,eK),eK),c=A.multiplyByPoint(t,c,c);let u=A.getMatrix3(t,vae);return d=q.multiply(u,d,d),l(i)&&i instanceof pd?(i.update(c,d),i):new pd(c,d)}function TYe(e,t,n,i){if(!A.equalsEpsilon(t,n,W.EPSILON8))return _Ye(e,t,n,i);let o=de.unpack(e,0,Fae);return l(i)?(i.rectangle=de.clone(o,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(oe.WGS84),i):new Zu({rectangle:o,minimumHeight:e[4],maximumHeight:e[5]})}function SYe(e,t,n){let i=h.fromElements(e[0],e[1],e[2],nK),o=e[3];i=A.multiplyByPoint(t,i,i);let r=A.getScale(t,wae),s=h.maximumComponent(r);return o*=s,l(n)?(n.update(i,o),n):new h0(i,o)}qo.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,o;if(l(i)&&(o=zx.parseBoundingVolumeSemantic("TILE",i)),l(o)&&(e=o),!l(e))throw new me("boundingVolume must be defined");if(ci(e,"3DTILES_bounding_volume_S2"))return new o2(e.extensions["3DTILES_bounding_volume_S2"]);let{box:r,region:s,sphere:a}=e;if(l(r)){let c=xYe(r,t,n);return this._verticalExaggeration!==1&&Eae(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c}if(l(s)){let c=TYe(s,t,this._initialTransform,n);return this._verticalExaggeration===1||(c instanceof pd?Eae(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight):(c.minimumHeight=Dr.getHeight(c.minimumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.maximumHeight=Dr.getHeight(c.maximumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.computeBoundingVolumes(oe.WGS84))),c}if(l(a)){let c=SYe(a,t,n);if(this._verticalExaggeration!==1){let d=Dr.getPosition(c.center,oe.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,nK),u=c.radius*this._verticalExaggeration;c.update(d,u)}return c}throw new me("boundingVolume must contain a sphere, region, or box")};var CYe=h.unpackArray(new Array(8*3).fill(0));function Eae(e,t,n){let i=e.boundingVolume.computeCorners(CYe).map(r=>Dr.getPosition(r,oe.WGS84,t,n,r)),o=Xn.fromPoints(i,Aae);e.update(o.center,o.halfAxes)}qo.prototype.updateTransform=function(e,t){e=g(e,A.IDENTITY);let n=A.multiplyTransformation(e,this.transform,eK),i=!A.equals(n,this.computedTransform),o=l(t)&&(this._verticalExaggeration!==t.verticalExaggeration||this._verticalExaggerationRelativeHeight!==t.verticalExaggerationRelativeHeight);if(!i&&!o)return;i&&A.clone(n,this.computedTransform),o&&(this._verticalExaggeration=t.verticalExaggeration,this._verticalExaggerationRelativeHeight=t.verticalExaggerationRelativeHeight);let r=this._header,s=this._contentHeader;this._boundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform,this._boundingVolume),l(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(s.boundingVolume,this.computedTransform,this._contentBoundingVolume)),l(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(r.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()};qo.prototype.updateGeometricErrorScale=function(){let e=A.getScale(this.computedTransform,wae),t=h.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function VYe(e,t,n,i){if(!i.isRender)return;let o=l(e._contentHeader)&&l(e._contentHeader.boundingVolume),r=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!o;if(r){let c;e._finalResolution?e.hasRenderableContent?c=O.WHITE:c=O.DARKGRAY:c=O.YELLOW,l(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(c)),e._debugBoundingVolume.update(n);let d=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");d.color=Ot.toValue(c,d.color)}else!r&&l(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&o?(l(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(O.BLUE)),e._debugContentBoundingVolume.update(n)):!t.debugShowContentBoundingVolume&&l(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&l(e._viewerRequestVolume)?(l(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(O.YELLOW)),e._debugViewerRequestVolume.update(n)):!t.debugShowViewerRequestVolume&&l(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());let s=t.debugColorizeTiles&&!e._debugColorizeTiles||l(t._heatmap.tilePropertyName),a=!t.debugColorizeTiles&&e._debugColorizeTiles;s?(t._heatmap.colorize(e,n),e._debugColorizeTiles=!0,e.color=e._debugColor):a&&(e._debugColorizeTiles=!1,e.color=O.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),a&&t.makeStyleDirty()}function LYe(e,t,n){let i=e._expiredContent;if(!e.hasMultipleContents&&l(i)){if(!e.contentReady){try{i.update(t,n)}catch{}return}e._expiredContent.destroy(),e._expiredContent=void 0}if(l(e.content))try{e.content.update(t,n)}catch(o){throw e._contentState=Uo.FAILED,o}}function RYe(e,t){let n=t.clippingPlanes,i=0;l(n)&&e._isClipped&&n.enabled&&(i=n.clippingPlanesState),i!==e._clippingPlanesState&&(e._clippingPlanesState=i,e.clippingPlanesDirty=!0)}qo.prototype.update=function(e,t,n){let{commandList:i}=t,o=i.length;RYe(this,e),VYe(this,e,t,n),LYe(this,e,t);let r=i.length;this._commandsLength=r-o;for(let s=o;s<r;++s){let a=i[s],c=a.pass===Ve.TRANSLUCENT;a.depthForTranslucentClassification=c}this.clippingPlanesDirty=!1};var Iae=[];qo.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(dYe(this),this._selectedFrame=0,this.lastStyleTime=0,te.now(this._loadTimestamp),this._contentState=Uo.READY,!this.hasTilesetContent&&!this.hasImplicitContent&&(e._statistics.incrementLoadCounts(this.content),++e._statistics.numberOfTilesWithContentReady,++e._statistics.numberOfLoadedTilesTotal,e._cache.add(this)));let n=t.commandList;t.commandList=Iae;try{this._content.update(e,t)}catch(i){throw this._contentState=Uo.FAILED,i}Iae.length=0,t.commandList=n};function Xae(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function g5(e,t,n){return Math.max(W.normalize(e,t,n)-W.EPSILON7,0)}qo.prototype.updatePriority=function(){let e=this.tileset,t=e.preferLeaves,n=e._minimumPriority,i=e._maximumPriority,o=4,r=1,s=0,a=o,c=s+a,d=o,u=c+d,m=r,p=Math.pow(10,u),y=u+m,f=r,x=Math.pow(10,y),_=y+f,C=Math.pow(10,_),V=g5(this._depth,n.depth,i.depth);V=t?1-V:V;let Z=!e.isSkippingLevelOfDetail&&this.refine===Ao.REPLACE?g5(this._priorityHolder._distanceToCamera,n.distance,i.distance):g5(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),G=Xae(Z,a,s),I=this._priorityProgressiveResolution?0:p,P=g5(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),v=Xae(P,d,c),F=this.priorityDeferred?x:0,M=e._pass===wo.PRELOAD_FLIGHT?0:C;this._priority=V+G+I+v+F+M};qo.prototype.isDestroyed=function(){return!1};qo.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(),ue(this)};var Eu=qo;var GFn=T(S(),1);var yFn=T(S(),1);function f0(e){e=g(e,g.EMPTY_OBJECT);let t=e.id,n=e.group,i=e.class,o=l(n.properties)?n.properties:{};this._class=i,this._properties=o,this._id=t,this._extras=n.extras,this._extensions=n.extensions}Object.defineProperties(f0.prototype,{class:{get:function(){return this._class}},id:{get:function(){return this._id}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});f0.prototype.hasProperty=function(e){return Nn.hasProperty(e,this._properties,this._class)};f0.prototype.hasPropertyBySemantic=function(e){return Nn.hasPropertyBySemantic(e,this._properties,this._class)};f0.prototype.getPropertyIds=function(e){return Nn.getPropertyIds(this._properties,this._class,e)};f0.prototype.getProperty=function(e){return Nn.getProperty(e,this._properties,this._class)};f0.prototype.setProperty=function(e,t){return Nn.setProperty(e,t,this._properties,this._class)};f0.prototype.getPropertyBySemantic=function(e){return Nn.getPropertyBySemantic(e,this._properties,this._class)};f0.prototype.setPropertyBySemantic=function(e,t){return Nn.setPropertyBySemantic(e,t,this._properties,this._class)};var QC=f0;var SFn=T(S(),1);function p0(e){e=g(e,g.EMPTY_OBJECT);let t=e.tileset,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(p0.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});p0.prototype.hasProperty=function(e){return Nn.hasProperty(e,this._properties,this._class)};p0.prototype.hasPropertyBySemantic=function(e){return Nn.hasPropertyBySemantic(e,this._properties,this._class)};p0.prototype.getPropertyIds=function(e){return Nn.getPropertyIds(this._properties,this._class,e)};p0.prototype.getProperty=function(e){return Nn.getProperty(e,this._properties,this._class)};p0.prototype.setProperty=function(e,t){return Nn.setProperty(e,t,this._properties,this._class)};p0.prototype.getPropertyBySemantic=function(e){return Nn.getPropertyBySemantic(e,this._properties,this._class)};p0.prototype.setPropertyBySemantic=function(e,t){return Nn.setPropertyBySemantic(e,t,this._properties,this._class)};var r2=p0;function Mae(e){e=g(e,g.EMPTY_OBJECT);let t=e.metadataJson,n=e.schema,i=g(t.metadata,t.tileset),o;l(i)&&(o=new r2({tileset:i,class:n.classes[i.class]}));let r=[],s=[],a=t.groups;if(Array.isArray(a)){let c=a.length;for(let d=0;d<c;d++){let u=a[d];s.push(new QC({group:u,class:n.classes[u.class]}))}}else if(l(a)){r=Object.keys(a).sort();let c=r.length;for(let d=0;d<c;d++){let u=r[d];if(a.hasOwnProperty(u)){let m=a[u];s.push(new QC({id:u,group:a[u],class:n.classes[m.class]}))}}}this._schema=n,this._groups=s,this._groupIds=r,this._tileset=o,this._statistics=t.statistics,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Mae.prototype,{schema:{get:function(){return this._schema}},groups:{get:function(){return this._groups}},groupIds:{get:function(){return this._groupIds}},tileset:{get:function(){return this._tileset}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var V_=Mae;var vFn=T(S(),1);var Nae={},ZYe=new h;Nae.checkChildrenWithinParent=function(e){let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof pd||i instanceof Zu){let o=i._orientedBoundingBox;e._optimChildrenWithinParent=Cu.USE_OPTIMIZATION;for(let r=0;r<n;++r){let a=t[r].boundingVolume;if(!(a instanceof pd||a instanceof Zu)){e._optimChildrenWithinParent=Cu.SKIP_OPTIMIZATION;break}let c=a._orientedBoundingBox,d=h.subtract(c.center,o.center,ZYe),u=h.magnitude(d);h.divideByScalar(d,u,d);let m=Math.abs(o.halfAxes[0]*d.x)+Math.abs(o.halfAxes[1]*d.y)+Math.abs(o.halfAxes[2]*d.z)+Math.abs(o.halfAxes[3]*d.x)+Math.abs(o.halfAxes[4]*d.y)+Math.abs(o.halfAxes[5]*d.z)+Math.abs(o.halfAxes[6]*d.x)+Math.abs(o.halfAxes[7]*d.y)+Math.abs(o.halfAxes[8]*d.z),p=Math.abs(c.halfAxes[0]*d.x)+Math.abs(c.halfAxes[1]*d.y)+Math.abs(c.halfAxes[2]*d.z)+Math.abs(c.halfAxes[3]*d.x)+Math.abs(c.halfAxes[4]*d.y)+Math.abs(c.halfAxes[5]*d.z)+Math.abs(c.halfAxes[6]*d.x)+Math.abs(c.halfAxes[7]*d.y)+Math.abs(c.halfAxes[8]*d.z);if(m<=p+u){e._optimChildrenWithinParent=Cu.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===Cu.USE_OPTIMIZATION};var s2=Nae;var kFn=T(S(),1);var AFn=T(S(),1);function a2(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(a2.prototype,{length:{get:function(){return this._length}}});function GYe(e,t,n){this.item=e,this.previous=t,this.next=n}a2.prototype.add=function(e){let t=new GYe(e,this.tail,void 0);return l(this.tail)?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t};function Uae(e,t){l(t.previous)&&l(t.next)?(t.previous.next=t.next,t.next.previous=t.previous):l(t.previous)?(t.previous.next=void 0,e.tail=t.previous):l(t.next)?(t.next.previous=void 0,e.head=t.next):(e.head=void 0,e.tail=void 0),t.next=void 0,t.previous=void 0}a2.prototype.remove=function(e){l(e)&&(Uae(this,e),--this._length)};a2.prototype.splice=function(e,t){if(e===t)return;Uae(this,t);let n=e.next;e.next=t,this.tail===e?this.tail=t:n.previous=t,t.next=n,t.previous=e};var c2=a2;function L_(){this._list=new c2,this._sentinel=this._list.add(),this._trimTiles=!1}L_.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};L_.prototype.touch=function(e){let t=e.cacheNode;l(t)&&this._list.splice(this._sentinel,t)};L_.prototype.add=function(e){l(e.cacheNode)||(e.cacheNode=this._list.add(e))};L_.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;l(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};L_.prototype.unloadTiles=function(e,t){let n=this._trimTiles;this._trimTiles=!1;let i=this._list,o=this._sentinel,r=i.head;for(;r!==o&&(e.totalMemoryUsageInBytes>e.cacheBytes||n);){let s=r.item;r=r.next,this.unloadTile(e,s,t)}};L_.prototype.trim=function(){this._trimTiles=!0};var l2=L_;var KFn=T(S(),1);function x5(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 oK(e,t){let n;return t==="_loadTimestamp"?n=te.toDate(e).getTime():n=e,n}x5.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=oK(e,n),this._referenceMaximum[n]=oK(t,n)};function EYe(e,t){let n=e.tilePropertyName;if(l(n)){let i=oK(t[n],n);return l(i)?(e._maximum=Math.max(i,e._maximum),e._minimum=Math.min(i,e._minimum),i):(e.tilePropertyName=void 0,i)}}var iK=[new O(.1,.1,.1,1),new O(.153,.278,.878,1),new O(.827,.231,.49,1),new O(.827,.188,.22,1),new O(1,.592,.259,1),new O(1,.843,0,1)];x5.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=EYe(this,e),o=this._previousMinimum,r=this._previousMaximum;if(o===Number.MAX_VALUE||r===-Number.MAX_VALUE)return;let s=r-o+W.EPSILON7,c=W.clamp(i-o,0,s)/s,d=iK.length-1,u=c*d,m=Math.floor(u),p=Math.ceil(u),y=u-m,f=iK[m],x=iK[p],_=O.clone(O.WHITE);_.red=W.lerp(f.red,x.red,y),_.green=W.lerp(f.green,x.green,y),_.blue=W.lerp(f.blue,x.blue,y),e._debugColor=_};x5.prototype.resetMinimumMaximum=function(){let e=this.tilePropertyName;if(l(e)){let t=this._referenceMinimum[e],n=this._referenceMaximum[e],i=l(t)&&l(n);this._previousMinimum=i?t:this._minimum,this._previousMaximum=i?n:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE}};var d2=x5;var QFn=T(S(),1);function jC(){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}jC.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};function _5(e,t,n,i){let o=t.innerContents,r=t.pointsLength,s=t.trianglesLength,a=t.featuresLength,c=t.geometryByteLength,d=t.texturesByteLength,u=t.batchTableByteLength;if(i?(e.numberOfFeaturesLoaded+=n?-a:a,e.numberOfPointsLoaded+=n?-r:r,e.geometryByteLength+=n?-c:c,e.texturesByteLength+=n?-d:d,e.batchTableByteLength+=n?-u:u):(e.numberOfFeaturesSelected+=n?-a:a,e.numberOfPointsSelected+=n?-r:r,e.numberOfTrianglesSelected+=n?-s:s),l(o)){let m=o.length;for(let p=0;p<m;++p)_5(e,o[p],n,i)}}jC.prototype.incrementSelectionCounts=function(e){_5(this,e,!1,!1)};jC.prototype.incrementLoadCounts=function(e){_5(this,e,!1,!0)};jC.prototype.decrementLoadCounts=function(e){_5(this,e,!0,!0)};jC.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};var b0=jC;var $Fn=T(S(),1);function u2(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(u2.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});u2.prototype.makeDirty=function(){this._styleDirty=!0};u2.prototype.resetDirty=function(){this._styleDirty=!1};u2.prototype.applyStyle=function(e){if(!l(e.root)||l(this._style)&&!this._style._ready)return;let t=this._styleDirty;t&&++this._lastStyleTime;let n=this._lastStyleTime,i=e._statistics,o=t?e._selectedTiles:e._selectedTilesToStyle,r=o.length;for(let s=0;s<r;++s){let a=o[s];if(a.lastStyleTime!==n){let c=a.content;a.lastStyleTime=n,c.applyStyle(this._style),i.numberOfFeaturesStyled+=c.featuresLength,++i.numberOfTilesStyled}}};var m2=u2;var a9n=T(S(),1);function IYe(e,t,n){let i=ci(t,"3DTILES_implicit_tiling")?t.extensions["3DTILES_implicit_tiling"]:t.implicitTiling;this.baseResource=e,this.geometricError=t.geometricError,this.metadataSchema=n;let o=t.boundingVolume;if(!l(o.box)&&!l(o.region)&&!ci(o,"3DTILES_bounding_volume_S2")&&!ci(o,"3DTILES_bounding_volume_cylinder"))throw new me("Only box, region, 3DTILES_bounding_volume_S2, and 3DTILES_bounding_volume_cylinder are supported for implicit tiling");this.boundingVolume=o,this.refine=t.refine,this.subtreeUriTemplate=new Xe({url:i.subtrees.uri}),this.contentUriTemplates=[],this.contentHeaders=[];let r=XYe(t);for(let s=0;s<r.length;s++){let a=r[s];this.contentHeaders.push(ze(a,!0));let c=new Xe({url:a.uri});this.contentUriTemplates.push(c)}this.contentCount=this.contentHeaders.length,this.tileHeader=WYe(t),this.subdivisionScheme=Yr[i.subdivisionScheme],this.branchingFactor=Yr.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,l(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function XYe(e){if(ci(e,"3DTILES_multiple_contents")){let t=e.extensions["3DTILES_multiple_contents"];return l(t.contents)?t.contents:t.content}return l(e.contents)?e.contents:l(e.content)?[e.content]:[]}function WYe(e){let t=ze(e,!0);return l(t.extensions)&&(delete t.extensions["3DTILES_implicit_tiling"],delete t.extensions["3DTILES_multiple_contents"],Object.keys(t.extensions).length===0&&delete t.extensions),delete t.implicitTiling,delete t.contents,delete t.content,t}var R_=IYe;var p9n=T(S(),1);var d9n=T(S(),1);var h2={};function kae(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function rK(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function Dae(e){return e&=1431655765,e=(e^e>>1)&858993459,e=(e^e>>2)&252645135,e=(e^e>>4)&16711935,e=(e^e>>8)&65535,e}function sK(e){return e&=153391689,e=(e^e>>2)&51130563,e=(e^e>>4)&50393103,e=(e^e>>8)&4278190335,e=(e^e>>16)&1023,e}h2.encode2D=function(e,t){return(kae(e)|kae(t)<<1)>>>0};h2.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=Dae(e),t[1]=Dae(e>>1),t};h2.encode3D=function(e,t,n){return rK(e)|rK(t)<<1|rK(n)<<2};h2.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=sK(e),t[1]=sK(e>>1),t[2]=sK(e>>2),t};var xy=h2;function Do(e){this.subdivisionScheme=e.subdivisionScheme,this.subtreeLevels=e.subtreeLevels,this.level=e.level,this.x=e.x,this.y=e.y,this.z=void 0,e.subdivisionScheme===Yr.OCTREE&&(this.z=e.z)}Object.defineProperties(Do.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===Yr.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===Yr.OCTREE?xy.encode3D(this.x,this.y,this.z):xy.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===Yr.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});Do.prototype.getDescendantCoordinates=function(e){let t=this.level+e.level,n=(this.x<<e.level)+e.x,i=(this.y<<e.level)+e.y;if(this.subdivisionScheme===Yr.OCTREE){let o=(this.z<<e.level)+e.z;return new Do({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new Do({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};Do.prototype.getAncestorCoordinates=function(e){let t=1<<e,n=this.level-e,i=Math.floor(this.x/t),o=Math.floor(this.y/t);if(this.subdivisionScheme===Yr.OCTREE){let r=Math.floor(this.z/t);return new Do({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o,z:r})}return new Do({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o})};Do.prototype.getOffsetCoordinates=function(e){let t=e.level-this.level,n=1<<t,i=e.x%n,o=e.y%n;if(this.subdivisionScheme===Yr.OCTREE){let r=e.z%n;return new Do({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o,z:r})}return new Do({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o})};Do.prototype.getChildCoordinates=function(e){let t=this.level+1,n=2*this.x+e%2,i=2*this.y+Math.floor(e/2)%2;if(this.subdivisionScheme===Yr.OCTREE){let o=2*this.z+Math.floor(e/4)%2;return new Do({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new Do({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};Do.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};Do.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};Do.prototype.isAncestor=function(e){let t=e.level-this.level;if(t<=0)return!1;let n=e.x>>t,i=e.y>>t,o=this.x===n,r=this.y===i;if(this.subdivisionScheme===Yr.OCTREE){let s=e.z>>t,a=this.z===s;return o&&r&&a}return o&&r};Do.prototype.isEqual=function(e){return this.subdivisionScheme===e.subdivisionScheme&&this.subtreeLevels===e.subtreeLevels&&this.level===e.level&&this.x===e.x&&this.y===e.y&&(this.subdivisionScheme===Yr.OCTREE?this.z===e.z:!0)};Do.prototype.isImplicitTilesetRoot=function(){return this.level===0};Do.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};Do.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};Do.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===Yr.OCTREE&&(e.z=this.z),e};var Bae=[0,0,0];Do.fromMortonIndex=function(e,t,n,i){let o;return e===Yr.OCTREE?(o=xy.decode3D(i,Bae),new Do({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1],z:o[2]})):(o=xy.decode2D(i,Bae),new Do({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1]}))};Do.fromTileIndex=function(e,t,n){let i,o,r;return e===Yr.OCTREE?(i=Math.floor(W.log2(7*n+1)/3),o=((1<<3*i)-1)/7,r=n-o):(i=Math.floor(W.log2(3*n+1)/2),o=((1<<2*i)-1)/3,r=n-o),Do.fromMortonIndex(e,t,i,r)};var Z_=Do;var G9n=T(S(),1);var S9n=T(S(),1);function y0(){}y0.selectTiles=function(e,t){fe.throwInstantiationError()};y0.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};y0.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};y0.selectTile=function(e,t){if(e.contentVisibility(t)===nn.OUTSIDE)return;e._wasSelectedLastFrame=!0;let{content:n,tileset:i}=e;n.featurePropertiesDirty?(n.featurePropertiesDirty=!1,e.lastStyleTime=0,i._selectedTilesToStyle.push(e)):e._selectedFrame<t.frameNumber-1&&(i._selectedTilesToStyle.push(e),e._wasSelectedLastFrame=!1),e._selectedFrame=t.frameNumber,i._selectedTiles.push(e)};y0.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};y0.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};y0.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!PYe(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function PYe(e,t){let{tileset:n}=e;if(!n._cullRequestsWhileMoving)return!0;let{positionWCDeltaMagnitude:i,positionWCDeltaMagnitudeLastFrame:o}=t.camera,r=i!==0?i:o,s=Math.max(e.boundingSphere.radius*2,1);return n.cullRequestsWhileMovingMultiplier*r/s<1}y0.updateTile=function(e,t){Oae(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,FYe(e),e._shouldSelect=!1,e._finalResolution=!0};function Oae(e,t){if(e.updateVisibility(t),!e.isVisible)return;let n=e.children.length>0;if((e.hasTilesetContent||e.hasImplicitContent)&&n){let r=e.children[0];Oae(r,t),e._visible=r._visible;return}if(vYe(e,t)){e._visible=!1;return}let i=e.refine===Ao.REPLACE,o=e._optimChildrenWithinParent===Cu.USE_OPTIMIZATION;if(i&&o&&n&&!wYe(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function vYe(e,t){let{parent:n,tileset:i}=e;return!l(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==Ao.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function wYe(e,t){let n=!1,i=e.children;for(let o=0;o<i.length;++o){let r=i[o];r.updateVisibility(t),n=n||r.isVisible}return n}function FYe(e){let t=e.tileset._minimumPriority,n=e.tileset._maximumPriority,i=e._priorityHolder;n.distance=Math.max(i._distanceToCamera,n.distance),t.distance=Math.min(i._distanceToCamera,t.distance),n.depth=Math.max(e._depth,n.depth),t.depth=Math.min(e._depth,t.depth),n.foveatedFactor=Math.max(i._foveatedFactor,n.foveatedFactor),t.foveatedFactor=Math.min(i._foveatedFactor,t.foveatedFactor),n.reverseScreenSpaceError=Math.max(e._priorityReverseScreenSpaceError,n.reverseScreenSpaceError),t.reverseScreenSpaceError=Math.min(e._priorityReverseScreenSpaceError,t.reverseScreenSpaceError)}var Us=y0;function Yae(){}var f2={stack:new Mc,stackMaximumLength:0};Yae.selectTiles=function(e,t){e._selectedTiles.length=0,e._requestedTiles.length=0,e.hasMixedContent=!1;let n=!0,i=e.root;if(i.updateVisibility(t),!i.isVisible)return n;let{touchTile:o,visitTile:r}=Us,s=f2.stack;for(s.push(i);s.length>0;){f2.stackMaximumLength=Math.max(f2.stackMaximumLength,s.length);let a=s.pop(),c=a.refine===Ao.ADD,d=a.refine===Ao.REPLACE,u=AYe(a);u&&MYe(a,s,t),(c||d&&!u)&&(NYe(e,a),o(a,t),UYe(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),r(a,t)}return f2.stack.trim(f2.stackMaximumLength),n};function AYe(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function MYe(e,t,n){let{children:i}=e;for(let o=0;o<i.length;++o){let r=i[o];r.updateVisibility(n),r.isVisible&&t.push(r)}}function NYe(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function UYe(e,t){e.contentAvailable&&e.contentVisibility(t)!==nn.OUTSIDE&&e.tileset._selectedTiles.push(e)}var p2=Yae;var v9n=T(S(),1);function Hae(){}var b2={stack:new Mc,stackMaximumLength:0},y2={stack:new Mc,stackMaximumLength:0};Hae.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(Us.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;DYe(n,t),b2.stack.trim(b2.stackMaximumLength),y2.stack.trim(y2.stackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function aK(e,t){e.contentAvailable&&Us.selectTile(e,t)}function kYe(e,t,n){let i=e.refine===Ao.REPLACE,{tileset:o,children:r}=e,{updateTile:s,loadTile:a,touchTile:c}=Us;for(let f=0;f<r.length;++f)s(r[f],n);r.sort(Us.sortChildrenByDistanceToCamera);let d=i&&e.hasRenderableContent,u=!0,m=!1,p=-1,y=Number.MAX_VALUE;for(let f=0;f<r.length;++f){let x=r[f];if(x.isVisible?(t.push(x),x._foveatedFactor<y&&(p=f,y=x._foveatedFactor),m=!0):(d||o.loadSiblings)&&(x._foveatedFactor<y&&(p=f,y=x._foveatedFactor),a(x,n),c(x,n)),d){let _;x._inRequestVolume?x.hasRenderableContent?_=x.contentAvailable:_=BYe(x,n):_=!1,u=u&&_}}if(m||(u=!1),p!==-1&&i){let f=r[p];f._wasMinPriorityChild=!0;let x=(e._wasMinPriorityChild||e===o.root)&&y<=e._priorityHolder._foveatedFactor?e._priorityHolder:e;x._foveatedFactor=Math.min(f._foveatedFactor,x._foveatedFactor),x._distanceToCamera=Math.min(f._distanceToCamera,x._distanceToCamera);for(let _=0;_<r.length;++_)r[_]._priorityHolder=x}return u}function DYe(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:o,visitTile:r,touchTile:s}=Us,a=b2.stack;for(a.push(e);a.length>0;){b2.stackMaximumLength=Math.max(b2.stackMaximumLength,a.length);let c=a.pop(),d=c.parent,u=!l(d)||d._refines;c._refines=i(c)?kYe(c,a,t)&&u:!1;let m=!c._refines&&u;c.hasRenderableContent?c.refine===Ao.ADD?(aK(c,t),o(c,t)):c.refine===Ao.REPLACE&&(o(c,t),m&&aK(c,t)):(n._emptyTiles.push(c),o(c,t),m&&aK(c,t)),r(c,t),s(c,t)}}function BYe(e,t){let{canTraverse:n,updateTile:i,loadTile:o,touchTile:r}=Us,s=!0,a=y2.stack;for(a.push(e);a.length>0;){y2.stackMaximumLength=Math.max(y2.stackMaximumLength,a.length);let c=a.pop(),d=c.children,u=d.length,m=!c.hasRenderableContent&&n(c),p=!c.hasRenderableContent&&c.children.length===0;if(!m&&!c.contentAvailable&&!p&&(s=!1),i(c,t),c.isVisible||(o(c,t),r(c,t)),m)for(let y=0;y<u;++y){let f=d[y];a.push(f)}}return s}var g2=Hae;var U9n=T(S(),1);function Kae(){}var x2={stack:new Mc,stackMaximumLength:0},_2={stack:new Mc,stackMaximumLength:0},g0={stack:new Mc,stackMaximumLength:0,ancestorStack:new Mc,ancestorStackMaximumLength:0},OYe=2;Kae.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(Us.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;QYe(n,t),jYe(n,t),x2.stack.trim(x2.stackMaximumLength),_2.stack.trim(_2.stackMaximumLength),g0.stack.trim(g0.stackMaximumLength),g0.ancestorStack.trim(g0.ancestorStackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function YYe(e,t){let{updateTile:n,touchTile:i,selectTile:o}=Us,r=_2.stack;for(r.push(e);r.length>0;){_2.stackMaximumLength=Math.max(_2.stackMaximumLength,r.length);let a=r.pop().children;for(let c=0;c<a.length;++c){let d=a[c];d.isVisible&&(d.contentAvailable?(n(d,t),i(d,t),o(d,t)):d._depth-e._depth<OYe&&r.push(d))}}}function T5(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;l(n)?n._shouldSelect=!0:YYe(e,t)}function HYe(e,t){e._ancestorWithContent=void 0,e._ancestorWithContentAvailable=void 0;let{parent:n}=e;if(!l(n))return;let i=!n.hasUnloadedRenderableContent||n._requestedFrame===t.frameNumber;e._ancestorWithContent=i?n:n._ancestorWithContent,e._ancestorWithContentAvailable=n.contentAvailable?n:n._ancestorWithContentAvailable}function KYe(e,t){let n=t._ancestorWithContent;return!e.immediatelyLoadDesiredLevelOfDetail&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf||l(n)&&t._screenSpaceError<n._screenSpaceError/e.skipScreenSpaceErrorFactor&&t._depth>n._depth+e.skipLevels)}function zYe(e,t,n){let{tileset:i,children:o}=e,{updateTile:r,loadTile:s,touchTile:a}=Us;for(let d=0;d<o.length;++d)r(o[d],n);o.sort(Us.sortChildrenByDistanceToCamera);let c=!1;for(let d=0;d<o.length;++d){let u=o[d];u.isVisible?(t.push(u),c=!0):i.loadSiblings&&(s(u,n),a(u,n))}return c}function JYe(e,t){let{tileset:n}=e;return n.immediatelyLoadDesiredLevelOfDetail?!1:l(e._ancestorWithContent)?e._screenSpaceError===0?e.parent._screenSpaceError>t:e._screenSpaceError>t:!0}function QYe(e,t){let{tileset:n}=e,i=n.immediatelyLoadDesiredLevelOfDetail?Number.MAX_VALUE:Math.max(n.baseScreenSpaceError,n.memoryAdjustedScreenSpaceError),{canTraverse:o,loadTile:r,visitTile:s,touchTile:a}=Us,c=x2.stack;for(c.push(e);c.length>0;){x2.stackMaximumLength=Math.max(x2.stackMaximumLength,c.length);let d=c.pop();HYe(d,t);let u=d.parent,m=!l(u)||u._refines;d._refines=o(d)?zYe(d,c,t)&&m:!1;let p=!d._refines&&m;d.hasRenderableContent?d.refine===Ao.ADD?(T5(d,t),r(d,t)):d.refine===Ao.REPLACE&&(JYe(d,i)?(r(d,t),p&&T5(d,t)):p?(T5(d,t),r(d,t)):KYe(n,d)&&r(d,t)):(n._emptyTiles.push(d),r(d,t),p&&T5(d,t)),s(d,t),a(d,t)}}function jYe(e,t){let{selectTile:n,canTraverse:i}=Us,{stack:o,ancestorStack:r}=g0,s;for(o.push(e);o.length>0||r.length>0;){if(g0.stackMaximumLength=Math.max(g0.stackMaximumLength,o.length),g0.ancestorStackMaximumLength=Math.max(g0.ancestorStackMaximumLength,r.length),r.length>0){let d=r.peek();if(d._stackLength===o.length){r.pop(),d!==s&&(d._finalResolution=!1),n(d,t);continue}}let a=o.pop();if(!l(a))continue;let c=i(a);if(a._shouldSelect)if(a.refine===Ao.ADD)n(a,t);else{if(a._selectionDepth=r.length,a._selectionDepth>0&&(a.tileset.hasMixedContent=!0),s=a,!c){n(a,t);continue}r.push(a),a._stackLength=o.length}if(c){let d=a.children;for(let u=0;u<d.length;++u){let m=d[u];m.isVisible&&o.push(m)}}}}var T2=Kae;function $o(e){e=g(e,g.EMPTY_OBJECT),this._marsOptions=g(e.marsOptions,{}),this._url=void 0,this._basePath=void 0,this._root=void 0,this._resource=void 0,this._asset=void 0,this._properties=void 0,this._geometricError=void 0,this._scaledGeometricError=void 0,this._extensionsUsed=void 0,this._extensions=void 0,this._modelUpAxis=void 0,this._modelForwardAxis=void 0,this._cache=new l2,this._processingQueue=[],this._selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this._selectedTilesToStyle=[],this._loadTimestamp=void 0,this._timeSinceLoad=0,this._updatedVisibilityFrame=0,this._updatedModelMatrixFrame=0,this._modelMatrixChanged=!1,this._previousModelMatrix=void 0,this._extras=void 0,this._credits=void 0,this._showCreditsOnScreen=g(e.showCreditsOnScreen,!1),this._cullWithChildrenBounds=g(e.cullWithChildrenBounds,!0),this._allTilesAdditive=!0,this._hasMixedContent=!1,this._stencilClearCommand=void 0,this._backfaceCommands=new Mc,this._maximumScreenSpaceError=g(e.maximumScreenSpaceError,16),this._memoryAdjustedScreenSpaceError=this._maximumScreenSpaceError,this._cacheBytes=g(e.cacheBytes,512*1024*1024);let t=g(e.maximumCacheOverflowBytes,512*1024*1024);this._maximumCacheOverflowBytes=t,this._styleEngine=new m2,this._styleApplied=!1,this._modelMatrix=l(e.modelMatrix)?A.clone(e.modelMatrix):A.clone(A.IDENTITY),this._addHeightCallbacks=[],this._statistics=new b0,this._statisticsLast=new b0,this._statisticsPerPass=new Array(wo.NUMBER_OF_PASSES);for(let o=0;o<wo.NUMBER_OF_PASSES;++o)this._statisticsPerPass[o]=new b0;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 d2(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=g(e.cullRequestsWhileMoving,!0),this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=g(e.cullRequestsWhileMovingMultiplier,60),this.progressiveResolutionHeightFraction=W.clamp(g(e.progressiveResolutionHeightFraction,.3),0,.5),this.preferLeaves=g(e.preferLeaves,!1),this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._classificationType=e.classificationType,this._ellipsoid=g(e.ellipsoid,oe.WGS84),this._initialClippingPlanesOriginMatrix=A.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=g(e.vectorClassificationOnly,!1),this._vectorKeepDecodedPositions=g(e.vectorKeepDecodedPositions,!1),this.preloadWhenHidden=g(e.preloadWhenHidden,!1),this.preloadFlightDestinations=g(e.preloadFlightDestinations,!0),this._pass=void 0,this.dynamicScreenSpaceError=g(e.dynamicScreenSpaceError,!0),this.foveatedScreenSpaceError=g(e.foveatedScreenSpaceError,!0),this._foveatedConeSize=g(e.foveatedConeSize,.1),this._foveatedMinimumScreenSpaceErrorRelaxation=g(e.foveatedMinimumScreenSpaceErrorRelaxation,0),this.foveatedInterpolationCallback=g(e.foveatedInterpolationCallback,W.lerp),this.foveatedTimeDelay=g(e.foveatedTimeDelay,.2),this.dynamicScreenSpaceErrorDensity=g(e.dynamicScreenSpaceErrorDensity,2e-4),this.dynamicScreenSpaceErrorFactor=g(e.dynamicScreenSpaceErrorFactor,24),this.dynamicScreenSpaceErrorHeightFalloff=g(e.dynamicScreenSpaceErrorHeightFalloff,.25),this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=g(e.shadows,Cn.ENABLED),this.show=g(e.show,!0),this.colorBlendMode=Cl.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new af(e.pointCloudShading),this._pointCloudEyeDomeLighting=new Op,this.loadProgress=new ye,this.allTilesLoaded=new ye,this.initialTilesLoaded=new ye,this.tileLoad=new ye,this.tileUnload=new ye,this.tileFailed=new ye,this.tileVisible=new ye,this.skipLevelOfDetail=g(e.skipLevelOfDetail,!1),this._disableSkipLevelOfDetail=!1,this.baseScreenSpaceError=g(e.baseScreenSpaceError,1024),this.skipScreenSpaceErrorFactor=g(e.skipScreenSpaceErrorFactor,16),this.skipLevels=g(e.skipLevels,1),this.immediatelyLoadDesiredLevelOfDetail=g(e.immediatelyLoadDesiredLevelOfDetail,!1),this.loadSiblings=g(e.loadSiblings,!1),this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new Ex,this._shouldDestroyImageBasedLighting=!0),this.lightColor=e.lightColor,this.backFaceCulling=g(e.backFaceCulling,!0),this._enableShowOutline=g(e.enableShowOutline,!0),this.showOutline=g(e.showOutline,!0),this.outlineColor=g(e.outlineColor,O.BLACK),this.splitDirection=g(e.splitDirection,Bc.NONE),this.disableCollision=g(e.disableCollision,!1),this._projectTo2D=g(e.projectTo2D,!1),this._enablePick=g(e.enablePick,!1),this.debugFreezeFrame=g(e.debugFreezeFrame,!1),this.debugColorizeTiles=g(e.debugColorizeTiles,!1),this._enableDebugWireframe=g(e.enableDebugWireframe,!1),this.debugWireframe=g(e.debugWireframe,!1),this.debugWireframe===!0&&this._enableDebugWireframe===!1&&Ft("tileset-debug-wireframe-ignored","enableDebugWireframe must be set to true in the Cesium3DTileset constructor, otherwise debugWireframe will be ignored."),this.debugShowBoundingVolume=g(e.debugShowBoundingVolume,!1),this.debugShowContentBoundingVolume=g(e.debugShowContentBoundingVolume,!1),this.debugShowViewerRequestVolume=g(e.debugShowViewerRequestVolume,!1),this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=g(e.debugShowGeometricError,!1),this.debugShowRenderingStatistics=g(e.debugShowRenderingStatistics,!1),this.debugShowMemoryUsage=g(e.debugShowMemoryUsage,!1),this.debugShowUrl=g(e.debugShowUrl,!1),this.examineVectorLinesFunction=void 0,this._metadataExtension=void 0,this._customShader=e.customShader;let n=g(e.featureIdLabel,"featureId_0");typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=g(e.instanceFeatureIdLabel,"instanceFeatureId_0");typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i}Object.defineProperties($o.prototype,{isCesium3DTileset:{get:function(){return!0}},asset:{get:function(){return this._asset}},extensions:{get:function(){return this._extensions}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){ys.setOwner(e,this,"_clippingPlanes")}},properties:{get:function(){return this._properties}},tilesLoaded:{get:function(){return this._tilesLoaded}},resource:{get:function(){return this._resource}},basePath:{get:function(){return _r("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}},customShader:{get:function(){return this._customShader},set:function(e){this._customShader=e}},hasMixedContent:{get:function(){return this._hasMixedContent},set:function(e){this._hasMixedContent=e}},isSkippingLevelOfDetail:{get:function(){return this.skipLevelOfDetail&&!l(this._classificationType)&&!this._disableSkipLevelOfDetail&&!this._allTilesAdditive}},metadataExtension:{get:function(){return this._metadataExtension}},metadata:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.tileset}},schema:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.schema}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){this._maximumScreenSpaceError=e,this._memoryAdjustedScreenSpaceError=e}},cacheBytes:{get:function(){return this._cacheBytes},set:function(e){this._cacheBytes=e}},maximumCacheOverflowBytes:{get:function(){return this._maximumCacheOverflowBytes},set:function(e){this._maximumCacheOverflowBytes=e}},memoryAdjustedScreenSpaceError:{get:function(){return this._memoryAdjustedScreenSpaceError}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){this._pointCloudShading=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=A.clone(e,this._modelMatrix)}},timeSinceLoad:{get:function(){return this._timeSinceLoad}},totalMemoryUsageInBytes:{get:function(){let e=this._statistics;return e.texturesByteLength+e.geometryByteLength+e.batchTableByteLength}},clippingPlanesOriginMatrix:{get:function(){return l(this._clippingPlanesOriginMatrix)?(this._clippingPlanesOriginMatrixDirty&&(A.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):A.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}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1)}},vectorClassificationOnly:{get:function(){return this._vectorClassificationOnly}},vectorKeepDecodedPositions:{get:function(){return this._vectorKeepDecodedPositions}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen=e,tce(this)}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),this._instanceFeatureIdLabel=e}}});$o.fromIonAssetId=async function(e,t){let n=await sd.fromAssetId(e);return $o.fromUrl(n,t)};$o.fromUrl=async function(e,t){t=g(t,g.EMPTY_OBJECT);let n=Xe.createIfNeeded(e),i;n.extension==="json"?i=n.getBaseUri(!0):n.isDataUri&&(i="");let o=await $o.loadJson(n),r=await qYe(n,o),s=new $o(t);s._resource=n,s._url=n.url,s._basePath=i,s._metadataExtension=r,s._geometricError=o.geometricError,s._scaledGeometricError=o.geometricError;let a=o.asset;s._asset=a,s._extras=o.extras,tce(s);let c=l(o.asset.gltfUpAxis)?Wo.fromName(o.asset.gltfUpAxis):Wo.Y,d=g(t.modelUpAxis,c),u=g(t.modelForwardAxis,Wo.X);s._properties=o.properties,s._extensionsUsed=o.extensionsUsed,s._extensions=o.extensions,s._modelUpAxis=d,s._modelForwardAxis=u,s._root=s.loadTileset(n,o);let p=s._root.createBoundingVolume(o.root.boundingVolume,A.IDENTITY).boundingSphere.center,y=s._ellipsoid.cartesianToCartographic(p);return l(y)&&y.height>hi._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=Xt.eastNorthUpToFixedFrame(p)),s._clippingPlanesOriginMatrix=A.clone(s._initialClippingPlanesOriginMatrix),s};$o.loadJson=function(e){return Xe.createIfNeeded(e).fetchJson()};$o.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};$o.prototype.loadTileset=function(e,t,n){let i=t.asset;if(!l(i))throw new me("Tileset must have an asset property.");if(i.version!=="0.0"&&i.version!=="1.0"&&i.version!=="1.1")throw new me("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");l(t.extensionsRequired)&&$o.checkSupportedExtensions(t.extensionsRequired);let o=this._statistics,r=i.tilesetVersion;l(r)&&(this._basePath+=`?v=${r}`,e=e.clone(),e.setQueryParameters({v:r}));let s=zae(this,e,t.root,n);l(n)&&(n.children.push(s),s._depth=n._depth+1);let a=[];for(a.push(s);a.length>0;){let c=a.pop();++o.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&c.refine===Ao.ADD;let d=c._header.children;if(l(d))for(let u=0;u<d.length;++u){let m=d[u],p=zae(this,e,m,c);c.children.push(p),p._depth=c._depth+1,a.push(p)}this._cullWithChildrenBounds&&s2.checkChildrenWithinParent(c)}return s};function zae(e,t,n,i){if(!(l(n.implicitTiling)||ci(n,"3DTILES_implicit_tiling")))return new Eu(e,t,n,i);let r=e.schema,s=new R_(t,n,r),a=new Z_({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:0,x:0,y:0,z:0}),c=s.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()}).url,u=ze(n,!0);u.contents=[{uri:c}],delete u.content,delete u.extensions;let m=new Eu(e,t,u,i);return m.implicitTileset=s,m.implicitCoordinates=a,m}async function qYe(e,t){let n=ci(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(l(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=Yi.getSchemaLoader({resource:e});else if(l(n.schema))i=Yi.getSchemaLoader({schema:n.schema});else return;await i.load();let o=new V_({schema:i.schema,metadataJson:n});return Yi.unload(i),o}var Jae=new h,$Ye=new he,eHe=new A,tHe=new h,nHe=new h,iHe=new h,oHe=new h;function rHe(e,t){let n,i,o,r,s,a=t.camera,c=e._root,d=c.contentBoundingVolume;if(d instanceof Zu)n=h.normalize(a.positionWC,Jae),i=a.directionWC,o=a.positionCartographic.height,r=d.minimumHeight,s=d.maximumHeight;else{let x=A.inverseTransformation(c.computedTransform,eHe),_=t.mapProjection.ellipsoid,C=d.boundingVolume,V=A.multiplyByPoint(x,C.center,tHe);if(h.magnitude(V)>_.minimumRadius){let L=he.fromCartesian(V,_,$Ye);n=h.normalize(a.positionWC,Jae),i=a.directionWC,o=a.positionCartographic.height,r=0,s=L.height*2}else{let L=A.multiplyByPoint(x,a.positionWC,nHe);if(n=h.UNIT_Z,i=A.multiplyByPointAsVector(x,a.directionWC,iHe),i=h.normalize(i,i),o=L.z,d instanceof pd){let Z=q.getColumn(C.halfAxes,2,oHe),G=h.magnitude(Z);r=V.z-G,s=V.z+G}else if(d instanceof h0){let Z=C.radius;r=V.z-Z,s=V.z+Z}}}let u=e.dynamicScreenSpaceErrorHeightFalloff,m=r+(s-r)*u,p=s,y=W.clamp((o-m)/(p-m),0,1),f=1-Math.abs(h.dot(i,n));f=f*(1-y),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*f}function sHe(e,t){if(t.hasEmptyContent)return;let{statistics:n}=e,i=t.contentExpired,o=t.requestContent();l(o)&&(o.then(r=>{!l(r)||t.isDestroyed()||e.isDestroyed()||(e._processingQueue.push(t),++n.numberOfTilesProcessing)}).catch(r=>{qae(r,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?_He(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function jae(e,t){return e._priority-t._priority}$o.prototype.postPassesUpdate=function(e){l(this._root)&&(aHe(this,e),SHe(this,e),this._cache.unloadTiles(this,ece),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};$o.prototype.prePassesUpdate=function(e){if(!l(this._root))return;fHe(this,e);let t=this._clippingPlanes;this._clippingPlanesOriginMatrixDirty=!0,l(t)&&t.enabled&&t.update(e),l(this._loadTimestamp)||(this._loadTimestamp=te.clone(e.time)),this._timeSinceLoad=Math.max(te.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&rHe(this,e),e.newFrame&&this._cache.reset()};function aHe(e,t){let n=e._requestedTilesInFlight,i=0;for(let o=0;o<n.length;++o){let r=n[o],s=t.frameNumber-r._touchedFrame>=1;if(r._contentState!==Uo.LOADING){++i;continue}else if(s){r.cancelRequests(),++i;continue}i>0&&(n[o-i]=r)}n.length-=i}function cHe(e){let t=e._requestedTiles;t.sort(jae);for(let n=0;n<t.length;++n)sHe(e,t[n])}function qae(e,t,n){if(t.isDestroyed())return;let i;n.isDestroyed()||(i=n._contentResource.url);let o=l(e.message)?e.message:e.toString();t.tileFailed.numberOfListeners>0?t.tileFailed.raiseEvent({url:i,message:o}):(console.log(`A 3D tile failed to load: ${i}`),console.log(`Error: ${o}`))}function lHe(e){let t=e._processingQueue,n=0;for(let i=0;i<t.length;++i){let o=t[i];if(o.isDestroyed()||o._contentState!==Uo.PROCESSING){++n;continue}n>0&&(t[i-n]=o)}t.length-=n}var dHe=new he,uHe=new he,mHe=new h;function hHe(e,t,n){let i=e._addHeightCallbacks,o=t.boundingSphere;for(let r of i){if(r.invoked||t._wasSelectedLastFrame)continue;let s=r.ellipsoid,a=he.clone(r.positionCartographic,dHe),c=he.fromCartesian(o.center,s,uHe);l(c)&&(a.height=c.height);let d=he.toCartesian(a,s,mHe);h.distance(d,o.center)<=o.radius&&n.afterRender.push(()=>{l(r.callback)&&r.callback(a),r.invoked=!1})}}function fHe(e,t){lHe(e);let n=e._processingQueue,{cacheBytes:i,maximumCacheOverflowBytes:o,statistics:r}=e,s=i+o,a=!1;for(let c=0;c<n.length;++c){if(e.totalMemoryUsageInBytes>s){a=!0;break}let d=n[c];try{d.process(e,t),d.contentReady&&(--r.numberOfTilesProcessing,e.tileLoad.raiseEvent(d))}catch(u){--r.numberOfTilesProcessing,qae(u,e,d)}}e.totalMemoryUsageInBytes<i?bHe(e):a&&n.length>0&&pHe(e)}function pHe(e){e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n<t.length;++n)t[n].updatePriority();t.sort(jae)}function bHe(e){e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError)}var S5=new h,yHe={maximumFractionDigits:3};function Qae(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,yHe):Math.round(t).toLocaleString()}function cK(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,o=h.clone(i,S5);if(l(t))o.x+=.75*(t[0]+t[3]+t[6]),o.y+=.75*(t[1]+t[4]+t[7]),o.z+=.75*(t[2]+t[5]+t[8]);else if(l(n)){let r=h.normalize(i,S5);r=h.multiplyByScalar(r,.75*n,S5),o=h.add(r,i,S5)}return o}function lK(e,t,n){let i="",o=0;if(t.debugShowGeometricError&&(i+=`
Geometric error: ${e.geometricError}`,o++),t.debugShowRenderingStatistics&&(i+=`
Commands: ${e.commandsLength}`,o++,e.content.pointsLength>0&&(i+=`
Points: ${e.content.pointsLength}`,o++),e.content.trianglesLength>0&&(i+=`
Triangles: ${e.content.trianglesLength}`,o++),i+=`
Features: ${e.content.featuresLength}`,o++),t.debugShowMemoryUsage&&(i+=`
Texture Memory: ${Qae(e.content.texturesByteLength)}`,i+=`
Geometry Memory: ${Qae(e.content.geometryByteLength)}`,o+=2),t.debugShowUrl)if(e.hasMultipleContents){i+=`
Urls:`;let s=e.content.innerContentUrls;for(let a=0;a<s.length;a++)i+=`
- ${s[a]}`;o+=s.length}else i+=`
Url: ${e._contentHeader.uri}`,o++;let r={text:i.substring(1),position:n,font:`${19-o}px sans-serif`,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY};return t._tileDebugLabels.add(r)}function gHe(e,t){let n=e._selectedTiles,i=n.length,o=e._emptyTiles,r=o.length;if(e._tileDebugLabels.removeAll(),e.debugPickedTileLabelOnly){if(l(e.debugPickedTile)){let s=l(e.debugPickPosition)?e.debugPickPosition:cK(e.debugPickedTile),a=lK(e.debugPickedTile,e,s);a.pixelOffset=new B(15,-15)}}else{for(let s=0;s<i;++s){let a=n[s];lK(a,e,cK(a))}for(let s=0;s<r;++s){let a=o[s];(a.hasTilesetContent||a.hasImplicitContent)&&lK(a,e,cK(a))}}e._tileDebugLabels.update(t)}function xHe(e,t,n){e._styleEngine.applyStyle(e),e._styleApplied=!0;let{commandList:i,context:o}=t,r=i.length,s=e._selectedTiles,a=e.isSkippingLevelOfDetail&&e._hasMixedContent&&o.stencilBuffer&&s.length>0;e._backfaceCommands.length=0,a&&(l(e._stencilClearCommand)||(e._stencilClearCommand=new ai({stencil:0,pass:Ve.CESIUM_3D_TILE,renderState:ke.fromCache({stencilMask:Nt.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:c,tileVisible:d}=e,u=n.isRender,m=i.length;for(let f=0;f<s.length;++f){let x=s[f];u&&d.raiseEvent(x),hHe(e,x,t),x.update(e,t,n),c.incrementSelectionCounts(x.content),++c.selected}let p=e._emptyTiles;for(let f=0;f<p.length;++f)p[f].update(e,t,n);let y=i.length-m;if(e._backfaceCommands.trim(),a){let f=e._backfaceCommands.values,x=f.length;i.length+=x;for(let _=y-1;_>=0;--_)i[m+x+_]=i[m+_];for(let _=0;_<x;++_)i[m+_]=f[_]}y=i.length-r,c.numberOfCommands=y,u&&(e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&y>0&&e._pointCloudEyeDomeLighting.update(t,r,e.pointCloudShading,e.boundingSphere),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(l(e._tileDebugLabels)||(e._tileDebugLabels=new md),gHe(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var $ae=[];function _He(e,t){let n=t,i=$ae;for(i.push(t);i.length>0;){t=i.pop();let o=t.children;for(let r=0;r<o.length;++r)i.push(o[r]);t!==n&&(THe(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function ece(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function THe(e,t){e._cache.unloadTile(e,t,ece),t.destroy()}$o.prototype.trimLoadedTiles=function(){this._cache.trim()};function SHe(e,t){let n=e._statistics,i=e._statisticsLast,o=n.numberOfPendingRequests,r=n.numberOfTilesProcessing,s=i.numberOfPendingRequests,a=i.numberOfTilesProcessing;b0.clone(n,i);let c=o!==s||r!==a;c&&t.afterRender.push(function(){return e.loadProgress.raiseEvent(o,r),!0}),e._tilesLoaded=n.numberOfPendingRequests===0&&n.numberOfTilesProcessing===0&&n.numberOfAttemptedRequests===0,c&&e._tilesLoaded&&(t.afterRender.push(function(){return e.allTilesLoaded.raiseEvent(),!0}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){return e.initialTilesLoaded.raiseEvent(),!0})))}function CHe(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 VHe(e,t){t.frameNumber===e._updatedModelMatrixFrame&&l(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!A.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=A.clone(e.modelMatrix,e._previousModelMatrix)))}function LHe(e,t,n,i){if(t.mode===ie.MORPHING||!l(e._root))return!1;let o=e._statistics;o.clear(),++e._updatedVisibilityFrame,CHe(e),VHe(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let r=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&cHe(e),xHe(e,t,i),b0.clone(o,n),i.isRender){let s=e._credits;if(l(s)&&o.selected!==0)for(let a=0;a<s.length;++a){let c=s[a];t.creditDisplay.addCreditToNextFrame(c)}}return r}function tce(e){let t=e._credits;l(t)||(t=[]),t.length=0,l(e.resource.credits)&&e.resource.credits.forEach(i=>{t.push(Vt.clone(i))});let n=e.asset.extras;if(l(n)&&l(n.cesium)&&l(n.cesium.credits)){let i=n.cesium.credits;for(let o=0;o<i.length;++o){let r=i[o];t.push(new Vt(r.html))}}t.forEach(i=>i.showOnScreen=i.showOnScreen||e._showCreditsOnScreen),e._credits=t}$o.prototype.getTraversal=function(e){let{pass:t}=e;return t===wo.MOST_DETAILED_PRELOAD||t===wo.MOST_DETAILED_PICK?p2:this.isSkippingLevelOfDetail?T2:g2};$o.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};$o.prototype.updateForPass=function(e,t){let n=t.pass;if(n===wo.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===wo.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===wo.REQUEST_RENDER_MODE_DEFER_CHECK&&(!this._cullRequestsWhileMoving&&this.foveatedTimeDelay<=0||!this.show))return;let i=e.commandList,o=e.camera,r=e.cullingVolume;t.ready=!1;let s=wo.getPassOptions(n),a=s.ignoreCommands,c=g(t.commandList,i),d=c.length;e.commandList=c,e.camera=g(t.camera,o),e.cullingVolume=g(t.cullingVolume,r);let u=this._statisticsPerPass[n];(this.show||a)&&(this._pass=n,t.ready=LHe(this,e,u,s)),a&&(c.length=d),e.commandList=i,e.camera=o,e.cullingVolume=r};$o.prototype.hasExtension=function(e){return l(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};$o.prototype.isDestroyed=function(){return!1};$o.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),l(this._root)){let e=$ae;for(e.push(this._root);e.length>0;){let t=e.pop();t.destroy();let n=t.children;for(let i=0;i<n.length;++i)e.push(n[i])}}return this._root=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,ue(this)};$o.supportedExtensions={"3DTILES_metadata":!0,"3DTILES_implicit_tiling":!0,"3DTILES_content_gltf":!0,"3DTILES_multiple_contents":!0,"3DTILES_bounding_volume_S2":!0,"3DTILES_batch_table_hierarchy":!0,"3DTILES_draco_point_compression":!0,MAXAR_content_geojson:!0};$o.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!$o.supportedExtensions[e[t]])throw new me(`Unsupported 3D Tiles Extension: ${e[t]}`)};var RHe=new gn,ZHe=new h,GHe=new he;$o.prototype.getHeight=function(e,t){let n=t.globe?.ellipsoid;l(n)||(n=oe.WGS84);let i=RHe,o=n.cartographicToCartesian(e,i.direction);h.normalize(i.direction,i.direction),i.direction=h.normalize(o,i.direction),i.direction=h.negate(o,i.direction),i.origin=h.multiplyByScalar(i.direction,-2*n.maximumRadius,i.origin);let r=this.pick(i,t.frameState,ZHe);if(l(r))return n.cartesianToCartographic(r,GHe)?.height};$o.prototype.updateHeight=function(e,t,n){n=g(n,oe.WGS84);let i={positionCartographic:e,ellipsoid:n,callback:t,invoked:!1},o=()=>{let r=this._addHeightCallbacks,s=r.length;for(let a=0;a<s;++a)if(r[a]===i){r.splice(a,1);break}i.callback&&(i.callback=void 0)};return this._addHeightCallbacks.push(i),o};var EHe=new xa,IHe=new h;$o.prototype.pick=function(e,t,n){if(!t.context.webgl2&&!this._enablePick)return;let i=this._selectedTiles,o=i.length,r=[];for(let c=0;c<o;++c){let d=i[c],u=ni.raySphere(e,d.contentBoundingVolume.boundingSphere,EHe);!l(u)||!l(d.content)||r.push(d)}let s=r.length;r.sort((c,d)=>{let u=ce.distanceSquaredTo(c.contentBoundingVolume.boundingSphere,e.origin),m=ce.distanceSquaredTo(d.contentBoundingVolume.boundingSphere,e.origin);return u-m});let a;for(let c=0;c<s;++c){let u=r[c].content.pick(e,t,IHe);if(l(u))return a=h.clone(u,n),a}};var oa=$o;var XHe=new A;function _y(e,t){t.collectionChanged.addEventListener(_y.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new Ct,this._onCollectionChanged(t,t.values,[],[])}_y.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._tilesetHash,i=this._primitives;for(let o=0,r=t.length;o<r;o++){let s=t[o],a=s._tileset,c,d=n[s.id],u=s.isShowing&&s.isAvailable(e)&&z.getValueOrDefault(a._show,e,!0),m;u&&(m=s.computeModelMatrix(e,XHe),c=Xe.createIfNeeded(z.getValueOrUndefined(a._uri,e)));let p=l(d)?d.tilesetPrimitive:void 0;if(!u){l(p)&&(p.show=!1);continue}(!l(d)||c.url!==d.url)&&(l(p)&&i.removeAndDestroy(p),delete n[s.id],WHe(c,n,s,i)),l(p)&&(p.show=!0,l(m)&&(p.modelMatrix=m),p.maximumScreenSpaceError=z.getValueOrDefault(a.maximumScreenSpaceError,e,p.maximumScreenSpaceError))}return!0};_y.prototype.isDestroyed=function(){return!1};_y.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(_y.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)dK(this,e[i],t,n);return ue(this)};_y.prototype.getBoundingSphere=function(e,t){let n=this._tilesetHash[e.id];if(!l(n)||n.loadFail)return ut.FAILED;let i=n.tilesetPrimitive;return l(i)?i.show?(ce.clone(i.boundingSphere,t),ut.DONE):ut.FAILED:ut.PENDING};_y.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._tilesetHash,c=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],l(r._tileset)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],l(r._tileset)?s.set(r.id,r):(dK(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],dK(this,r,a,c),s.remove(r.id)};function dK(e,t,n,i){let o=n[t.id];l(o)&&(l(o.tilesetPrimitive)&&i.removeAndDestroy(o.tilesetPrimitive),delete n[t.id])}async function WHe(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let o=await oa.fromUrl(e);if(o.id=n,i.add(o),!l(t[n.id]))return;t[n.id].tilesetPrimitive=o}catch(o){console.error(o),t[n.id].loadFail=!0}}var S2=_y;var pMn=T(S(),1);var PHe=O.WHITE,vHe=O.BLACK,wHe=new B(2,2);function qC(e){e=g(e,g.EMPTY_OBJECT),this._definitionChanged=new ye,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}Object.defineProperties(qC.prototype,{isConstant:{get:function(){return z.isConstant(this._evenColor)&&z.isConstant(this._oddColor)&&z.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:le("evenColor"),oddColor:le("oddColor"),repeat:le("repeat")});qC.prototype.getType=function(e){return"Checkerboard"};qC.prototype.getValue=function(e,t){return l(t)||(t={}),t.lightColor=z.getValueOrClonedDefault(this._evenColor,e,PHe,t.lightColor),t.darkColor=z.getValueOrClonedDefault(this._oddColor,e,vHe,t.darkColor),t.repeat=z.getValueOrDefault(this._repeat,e,wHe),t};qC.prototype.equals=function(e){return this===e||e instanceof qC&&z.equals(this._evenColor,e._evenColor)&&z.equals(this._oddColor,e._oddColor)&&z.equals(this._repeat,e._repeat)};var $C=qC;var PMn=T(S(),1);var RMn=T(S(),1);var nce={id:void 0};function C2(e){if(e._firing){e._refire=!0;return}if(e._suspendCount===0){let t=e._addedEntities,n=e._removedEntities,i=e._changedEntities;if(i.length!==0||t.length!==0||n.length!==0){e._firing=!0;do{e._refire=!1;let o=t.values.slice(0),r=n.values.slice(0),s=i.values.slice(0);t.removeAll(),n.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,o,r,s)}while(e._refire);e._firing=!1}}}function cc(e){this._owner=e,this._entities=new Ct,this._addedEntities=new Ct,this._removedEntities=new Ct,this._changedEntities=new Ct,this._suspendCount=0,this._collectionChanged=new ye,this._id=Hn(),this._show=!0,this._firing=!1,this._refire=!1}cc.prototype.suspendEvents=function(){this._suspendCount++};cc.prototype.resumeEvents=function(){this._suspendCount--,C2(this)};Object.defineProperties(cc.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)return;this.suspendEvents();let t,n=[],i=this._entities.values,o=i.length;for(t=0;t<o;t++)n.push(i[t].isShowing);for(this._show=e,t=0;t<o;t++){let r=n[t],s=i[t];r!==s.isShowing&&s.definitionChanged.raiseEvent(s,"isShowing",s.isShowing,r)}this.resumeEvents()}},owner:{get:function(){return this._owner}}});cc.prototype.computeAvailability=function(){let e=Be.MAXIMUM_VALUE,t=Be.MINIMUM_VALUE,n=this._entities.values;for(let i=0,o=n.length;i<o;i++){let s=n[i].availability;if(l(s)){let a=s.start,c=s.stop;te.lessThan(a,e)&&!a.equals(Be.MINIMUM_VALUE)&&(e=a),te.greaterThan(c,t)&&!c.equals(Be.MAXIMUM_VALUE)&&(t=c)}}return Be.MAXIMUM_VALUE.equals(e)&&(e=Be.MINIMUM_VALUE),Be.MINIMUM_VALUE.equals(t)&&(t=Be.MAXIMUM_VALUE),new Ln({start:e,stop:t})};cc.prototype.add=function(e){e instanceof Jo||(e=new Jo(e));let t=e.id,n=this._entities;if(n.contains(t))throw new fe(`An entity with id ${t} already exists in this collection.`);return e.entityCollection=this,n.set(t,e),this._removedEntities.remove(t)||this._addedEntities.set(t,e),e.definitionChanged.addEventListener(cc.prototype._onEntityDefinitionChanged,this),C2(this),e};cc.prototype.remove=function(e){return l(e)?this.removeById(e.id):!1};cc.prototype.contains=function(e){return this._entities.get(e.id)===e};cc.prototype.removeById=function(e){if(!l(e))return!1;let n=this._entities.get(e);return this._entities.remove(e)?(this._addedEntities.remove(e)||(this._removedEntities.set(e,n),this._changedEntities.remove(e)),this._entities.remove(e),n.definitionChanged.removeEventListener(cc.prototype._onEntityDefinitionChanged,this),C2(this),!0):!1};cc.prototype.removeAll=function(){let e=this._entities,t=e.length,n=e.values,i=this._addedEntities,o=this._removedEntities;for(let r=0;r<t;r++){let s=n[r],a=s.id,c=i.get(a);l(c)||(s.definitionChanged.removeEventListener(cc.prototype._onEntityDefinitionChanged,this),o.set(a,s))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),C2(this)};cc.prototype.getById=function(e){return this._entities.get(e)};cc.prototype.getOrCreateEntity=function(e){let t=this._entities.get(e);return l(t)||(nce.id=e,t=new Jo(nce),this.add(t)),t};cc.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),C2(this)};var ks=cc;var C5={id:void 0},e1=new Array(2);function uK(e){let t=e.propertyNames,n=t.length;for(let i=0;i<n;i++)e[t[i]]=void 0;e._name=void 0,e._availability=void 0}function ice(e,t,n,i){e1[0]=n,e1[1]=i.id,t[JSON.stringify(e1)]=i.definitionChanged.addEventListener(Gr.prototype._onDefinitionChanged,e)}function oce(e,t,n,i){e1[0]=n,e1[1]=i.id;let o=JSON.stringify(e1);t[o](),t[o]=void 0}function Ty(e){if(e._shouldRecomposite=!0,e._suspendCount!==0)return;let t=e._collections,n=t.length,i=e._collectionsCopy,o=i.length,r,s,a,c,d,u=e._composite,m=new ks(e),p=e._eventHash,y;for(r=0;r<o;r++)for(d=i[r],d.collectionChanged.removeEventListener(Gr.prototype._onCollectionChanged,e),a=d.values,y=d.id,c=a.length-1;c>-1;c--)s=a[c],oce(e,p,y,s);for(r=n-1;r>=0;r--)for(d=t[r],d.collectionChanged.addEventListener(Gr.prototype._onCollectionChanged,e),a=d.values,y=d.id,c=a.length-1;c>-1;c--){s=a[c],ice(e,p,y,s);let x=m.getById(s.id);l(x)||(x=u.getById(s.id),l(x)?uK(x):(C5.id=s.id,x=new Jo(C5)),m.add(x)),x.merge(s)}e._collectionsCopy=t.slice(0),u.suspendEvents(),u.removeAll();let f=m.values;for(r=0;r<f.length;r++)u.add(f[r]);u.resumeEvents()}function Gr(e,t){this._owner=t,this._composite=new ks(this),this._suspendCount=0,this._collections=l(e)?e.slice():[],this._collectionsCopy=[],this._id=Hn(),this._eventHash={},Ty(this),this._shouldRecomposite=!1}Object.defineProperties(Gr.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}}});Gr.prototype.addCollection=function(e,t){l(t)?this._collections.splice(t,0,e):(t=this._collections.length,this._collections.push(e)),Ty(this)};Gr.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),Ty(this),!0):!1};Gr.prototype.removeAllCollections=function(){this._collections.length=0,Ty(this)};Gr.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};Gr.prototype.contains=function(e){return this._composite.contains(e)};Gr.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};Gr.prototype.getCollection=function(e){return this._collections[e]};Gr.prototype.getCollectionsLength=function(){return this._collections.length};function V5(e,t){return e.indexOf(t)}function rce(e,t,n){let i=e._collections;if(t=W.clamp(t,0,i.length-1),n=W.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,Ty(e)}Gr.prototype.raiseCollection=function(e){let t=V5(this._collections,e);rce(this,t,t+1)};Gr.prototype.lowerCollection=function(e){let t=V5(this._collections,e);rce(this,t,t-1)};Gr.prototype.raiseCollectionToTop=function(e){let t=V5(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),Ty(this))};Gr.prototype.lowerCollectionToBottom=function(e){let t=V5(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),Ty(this))};Gr.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};Gr.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(Ty(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};Gr.prototype.computeAvailability=function(){return this._composite.computeAvailability()};Gr.prototype.getById=function(e){return this._composite.getById(e)};Gr.prototype._onCollectionChanged=function(e,t,n){let i=this._collectionsCopy,o=i.length,r=this._composite;r.suspendEvents();let s,a,c,d,u=n.length,m=this._eventHash,p=e.id;for(s=0;s<u;s++){let f=n[s];oce(this,m,p,f);let x=f.id;for(a=o-1;a>=0;a--)c=i[a].getById(x),l(c)&&(l(d)||(d=r.getById(x),uK(d)),d.merge(c));l(d)||r.removeById(x),d=void 0}let y=t.length;for(s=0;s<y;s++){let f=t[s];ice(this,m,p,f);let x=f.id;for(a=o-1;a>=0;a--)c=i[a].getById(x),l(c)&&(l(d)||(d=r.getById(x),l(d)?uK(d):(C5.id=x,d=new Jo(C5),r.add(d))),d.merge(c));d=void 0}r.resumeEvents()};Gr.prototype._onDefinitionChanged=function(e,t,n,i){let o=this._collections,r=this._composite,s=o.length,a=e.id,c=r.getById(a),d=c[t],u=!l(d),m=!0;for(let p=s-1;p>=0;p--){let y=o[p].getById(e.id);if(l(y)){let f=y[t];if(l(f)){if(m)if(m=!1,l(f.merge)&&l(f.clone))d=f.clone(d);else{d=f;break}d.merge(f)}}}u&&c.propertyNames.indexOf(t)===-1&&c.addProperty(t),c[t]=d};var mK=Gr;var rNn=T(S(),1);var $Mn=T(S(),1);var wMn=T(S(),1);function hK(){this._removalFunctions=[]}hK.prototype.add=function(e,t,n){let i=e.addEventListener(t,n);this._removalFunctions.push(i);let o=this;return function(){i();let r=o._removalFunctions;r.splice(r.indexOf(i),1)}};hK.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var Er=hK;var HMn=T(S(),1);function bK(e,t){return te.compare(e.start,t.start)}function Ir(e){if(this._intervals=[],this._changedEvent=new ye,l(e)){let t=e.length;for(let n=0;n<t;n++)this.addInterval(e[n])}}Object.defineProperties(Ir.prototype,{changedEvent:{get:function(){return this._changedEvent}},start:{get:function(){let e=this._intervals;return e.length===0?void 0:e[0].start}},isStartIncluded:{get:function(){let e=this._intervals;return e.length===0?!1:e[0].isStartIncluded}},stop:{get:function(){let e=this._intervals,t=e.length;return t===0?void 0:e[t-1].stop}},isStopIncluded:{get:function(){let e=this._intervals,t=e.length;return t===0?!1:e[t-1].isStopIncluded}},length:{get:function(){return this._intervals.length}},isEmpty:{get:function(){return this._intervals.length===0}}});Ir.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof Ir))return!1;let n=this._intervals,i=e._intervals,o=n.length;if(o!==i.length)return!1;for(let r=0;r<o;r++)if(!Ln.equals(n[r],i[r],t))return!1;return!0};Ir.prototype.get=function(e){return this._intervals[e]};Ir.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};Ir.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};Ir.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};Ir.prototype.contains=function(e){return this.indexOf(e)>=0};var fK=new Ln;Ir.prototype.indexOf=function(e){let t=this._intervals;fK.start=e,fK.stop=e;let n=Io(t,fK,bK);return n>=0?t[n].isStartIncluded?n:n>0&&t[n-1].stop.equals(e)&&t[n-1].isStopIncluded?n-1:~n:(n=~n,n>0&&n-1<t.length&&Ln.contains(t[n-1],e)?n-1:~n)};Ir.prototype.findInterval=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.start,n=e.stop,i=e.isStartIncluded,o=e.isStopIncluded,r=this._intervals;for(let s=0,a=r.length;s<a;s++){let c=r[s];if((!l(t)||c.start.equals(t))&&(!l(n)||c.stop.equals(n))&&(!l(i)||c.isStartIncluded===i)&&(!l(o)||c.isStopIncluded===o))return r[s]}};Ir.prototype.addInterval=function(e,t){if(e.isEmpty)return;let n=this._intervals;if(n.length===0||te.greaterThan(e.start,n[n.length-1].stop)){n.push(e),this._changedEvent.raiseEvent(this);return}let i=Io(n,e,bK);i<0?i=~i:i>0&&e.isStartIncluded&&n[i-1].isStartIncluded&&n[i-1].start.equals(e.start)?--i:i<n.length&&!e.isStartIncluded&&n[i].isStartIncluded&&n[i].start.equals(e.start)&&++i;let o;for(i>0&&(o=te.compare(n[i-1].stop,e.start),(o>0||o===0&&(n[i-1].isStopIncluded||e.isStartIncluded))&&((l(t)?t(n[i-1].data,e.data):n[i-1].data===e.data)?(te.greaterThan(e.stop,n[i-1].stop)?e=new Ln({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new Ln({start:n[i-1].start,stop:n[i-1].stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:n[i-1].isStopIncluded||e.stop.equals(n[i-1].stop)&&e.isStopIncluded,data:e.data}),n.splice(i-1,1),--i):(o=te.compare(n[i-1].stop,e.stop),(o>0||o===0&&n[i-1].isStopIncluded&&!e.isStopIncluded)&&n.splice(i,0,new Ln({start:e.stop,stop:n[i-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i-1].isStopIncluded,data:n[i-1].data})),n[i-1]=new Ln({start:n[i-1].start,stop:e.start,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:n[i-1].data}))));i<n.length&&(o=te.compare(e.stop,n[i].start),o>0||o===0&&(e.isStopIncluded||n[i].isStartIncluded));)if(l(t)?t(n[i].data,e.data):n[i].data===e.data)e=new Ln({start:e.start,stop:te.greaterThan(n[i].stop,e.stop)?n[i].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:te.greaterThan(n[i].stop,e.stop)?n[i].isStopIncluded:e.isStopIncluded,data:e.data}),n.splice(i,1);else if(n[i]=new Ln({start:e.stop,stop:n[i].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i].isStopIncluded,data:n[i].data}),n[i].isEmpty)n.splice(i,1);else break;n.splice(i,0,e),this._changedEvent.raiseEvent(this)};Ir.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=Io(t,e,bK);n<0&&(n=~n);let i=!1;for(n>0&&(te.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,(te.greaterThan(t[n-1].stop,e.stop)||t[n-1].isStopIncluded&&!e.isStopIncluded&&t[n-1].stop.equals(e.stop))&&t.splice(n,0,new Ln({start:e.stop,stop:t[n-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n-1].isStopIncluded,data:t[n-1].data})),t[n-1]=new Ln({start:t[n-1].start,stop:e.start,isStartIncluded:t[n-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:t[n-1].data})),n<t.length&&!e.isStartIncluded&&t[n].isStartIncluded&&e.start.equals(t[n].start)&&(i=!0,t.splice(n,0,new Ln({start:t[n].start,stop:t[n].start,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data})),++n);n<t.length&&te.greaterThan(e.stop,t[n].stop);)i=!0,t.splice(n,1);return n<t.length&&e.stop.equals(t[n].stop)&&(i=!0,!e.isStopIncluded&&t[n].isStopIncluded?n+1<t.length&&t[n+1].start.equals(e.stop)&&t[n].data===t[n+1].data?(t.splice(n,1),t[n]=new Ln({start:t[n].start,stop:t[n].stop,isStartIncluded:!0,isStopIncluded:t[n].isStopIncluded,data:t[n].data})):t[n]=new Ln({start:e.stop,stop:e.stop,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data}):t.splice(n,1)),n<t.length&&(te.greaterThan(e.stop,t[n].start)||e.stop.equals(t[n].start)&&e.isStopIncluded&&t[n].isStartIncluded)&&(i=!0,t[n]=new Ln({start:e.stop,stop:t[n].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n].isStopIncluded,data:t[n].data})),i&&this._changedEvent.raiseEvent(this),i};Ir.prototype.intersect=function(e,t,n){let i=new Ir,o=0,r=0,s=this._intervals,a=e._intervals;for(;o<s.length&&r<a.length;){let c=s[o],d=a[r];if(te.lessThan(c.stop,d.start))++o;else if(te.lessThan(d.stop,c.start))++r;else{if(l(n)||l(t)&&t(c.data,d.data)||!l(t)&&d.data===c.data){let u=Ln.intersect(c,d,new Ln,n);u.isEmpty||i.addInterval(u,t)}te.lessThan(c.stop,d.stop)||c.stop.equals(d.stop)&&!c.isStopIncluded&&d.isStopIncluded?++o:++r}}return i};Ir.fromJulianDateArray=function(e,t){l(t)||(t=new Ir);let n=e.julianDates,i=n.length,o=e.dataCallback,r=g(e.isStartIncluded,!0),s=g(e.isStopIncluded,!0),a=g(e.leadingInterval,!1),c=g(e.trailingInterval,!1),d,u=0;a&&(++u,d=new Ln({start:Be.MINIMUM_VALUE,stop:n[0],isStartIncluded:!0,isStopIncluded:!r}),d.data=l(o)?o(d,t.length):t.length,t.addInterval(d));for(let m=0;m<i-1;++m){let p=n[m],y=n[m+1];d=new Ln({start:p,stop:y,isStartIncluded:t.length===u?r:!0,isStopIncluded:m===i-2?s:!1}),d.data=l(o)?o(d,t.length):t.length,t.addInterval(d),p=y}return c&&(d=new Ln({start:n[i-1],stop:Be.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0}),d.data=l(o)?o(d,t.length):t.length,t.addInterval(d)),t};var lc=new cp,V2=[0,31,28,31,30,31,30,31,31,30,31,30,31];function pK(e,t,n){l(n)||(n=new te),te.toGregorianDate(e,lc);let i=lc.millisecond+t.millisecond,o=lc.second+t.second,r=lc.minute+t.minute,s=lc.hour+t.hour,a=lc.day+t.day,c=lc.month+t.month,d=lc.year+t.year;for(i>=1e3&&(o+=Math.floor(i/1e3),i=i%1e3),o>=60&&(r+=Math.floor(o/60),o=o%60),r>=60&&(s+=Math.floor(r/60),r=r%60),s>=24&&(a+=Math.floor(s/24),s=s%24),V2[2]=fm(d)?29:28;a>V2[c]||c>=13;)a>V2[c]&&(a-=V2[c],++c),c>=13&&(--c,d+=Math.floor(c/12),c=c%12,++c),V2[2]=fm(d)?29:28;return lc.millisecond=i,lc.second=o,lc.minute=r,lc.hour=s,lc.day=a,lc.month=c,lc.year=d,te.fromGregorianDate(lc,n)}var FHe=new te,AHe=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function sce(e,t){if(!l(e)||e.length===0)return!1;if(t.year=0,t.month=0,t.day=0,t.hour=0,t.minute=0,t.second=0,t.millisecond=0,e[0]==="P"){let n=e.match(AHe);if(!l(n))return!1;if(l(n[1])&&(t.year=Number(n[1].replace(",","."))),l(n[2])&&(t.month=Number(n[2].replace(",","."))),l(n[3])&&(t.day=Number(n[3].replace(",","."))*7),l(n[4])&&(t.day+=Number(n[4].replace(",","."))),l(n[5])&&(t.hour=Number(n[5].replace(",","."))),l(n[6])&&(t.minute=Number(n[6].replace(",","."))),l(n[7])){let i=Number(n[7].replace(",","."));t.second=Math.floor(i),t.millisecond=i%1*1e3}}else e[e.length-1]!=="Z"&&(e+="Z"),te.toGregorianDate(te.fromIso8601(e,FHe),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var L2=new cp;Ir.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=te.fromIso8601(n[0]),o=te.fromIso8601(n[1]),r=[];if(!sce(n[2],L2))r.push(i,o);else{let s=te.clone(i);for(r.push(s);te.compare(s,o)<0;)s=pK(s,L2),te.compare(o,s)<=0&&te.clone(o,s),r.push(s)}return Ir.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Ir.fromIso8601DateArray=function(e,t){return Ir.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(n){return te.fromIso8601(n)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Ir.fromIso8601DurationArray=function(e,t){let n=e.epoch,i=e.iso8601Durations,o=g(e.relativeToPrevious,!1),r=[],s,a,c=i.length;for(let d=0;d<c;++d)(sce(i[d],L2)||d===0)&&(o&&l(a)?s=pK(a,L2):s=pK(n,L2),r.push(s),a=s);return Ir.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var Xr=Ir;function MHe(e,t,n,i){function o(){n.raiseEvent(e)}let r=[];t.removeAll();let s=i.length;for(let a=0;a<s;a++){let c=i.get(a);l(c.data)&&r.indexOf(c.data)===-1&&t.add(c.data.definitionChanged,o)}}function G_(){this._eventHelper=new Er,this._definitionChanged=new ye,this._intervals=new Xr,this._intervals.changedEvent.addEventListener(G_.prototype._intervalsChanged,this)}Object.defineProperties(G_.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});G_.prototype.getValue=function(e,t){let n=this._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};G_.prototype.equals=function(e){return this===e||e instanceof G_&&this._intervals.equals(e._intervals,z.equals)};G_.prototype._intervalsChanged=function(){MHe(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var dc=G_;function Sy(){this._definitionChanged=new ye,this._composite=new dc,this._composite.definitionChanged.addEventListener(Sy.prototype._raiseDefinitionChanged,this)}Object.defineProperties(Sy.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});Sy.prototype.getType=function(e){let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(t))return t.getType(e)};Sy.prototype.getValue=function(e,t){let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};Sy.prototype.equals=function(e){return this===e||e instanceof Sy&&this._composite.equals(e._composite,z.equals)};Sy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var t1=Sy;var hNn=T(S(),1);function Cy(e){this._referenceFrame=g(e,ao.FIXED),this._definitionChanged=new ye,this._composite=new dc,this._composite.definitionChanged.addEventListener(Cy.prototype._raiseDefinitionChanged,this)}Object.defineProperties(Cy.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}}});Cy.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,ao.FIXED,t)};Cy.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(i))return i.getValueInReferenceFrame(e,t,n)};Cy.prototype.equals=function(e){return this===e||e instanceof Cy&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,z.equals)};Cy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var ra=Cy;var lUn=T(S(),1);var c5n=T(S(),1);var pNn=T(S(),1),NHe={ROUNDED:0,MITERED:1,BEVELED:2},Ii=Object.freeze(NHe);var UNn=T(S(),1);var INn=T(S(),1);var sa=[new h,new h],UHe=new h,kHe=new h,DHe=new h,BHe=new h,OHe=new h,YHe=new h,HHe=new h,KHe=new h,zHe=new h,n1=new h,L5=new h,R2={},yK=new he;function JHe(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let o=e[i];yK=t.cartesianToCartographic(o,yK),n[i]=yK.height,e[i]=t.scaleToGeodeticSurface(o,o)}return n}function gK(e,t,n,i){let o=e[0],r=e[1],s=h.angleBetween(o,r),a=Math.ceil(s/i),c=new Array(a),d;if(t===n){for(d=0;d<a;d++)c[d]=t;return c.push(n),c}let m=(n-t)/a;for(d=1;d<a;d++){let p=t+d*m;c[d]=p}return c[0]=t,c.push(n),c}var R5=new h,Z5=new h;function QHe(e,t,n,i){let o=new kr(n,i),r=o.projectPointOntoPlane(h.add(n,e,R5),R5),s=o.projectPointOntoPlane(h.add(n,t,Z5),Z5),a=B.angleBetween(r,s);return s.x*r.y-s.y*r.x>=0?-a:a}var jHe=new h(-1,0,0),E_=new A,qHe=new A,xK=new q,$He=q.IDENTITY.clone(),eKe=new h,tKe=new se,ace=new h;function x0(e,t,n,i,o,r,s,a){let c=eKe,d=tKe;E_=Xt.eastNorthUpToFixedFrame(e,o,E_),c=A.multiplyByPointAsVector(E_,jHe,c),c=h.normalize(c,c);let u=QHe(c,t,e,o);xK=q.fromRotationZ(u,xK),ace.z=r,E_=A.multiplyTransformation(E_,A.fromRotationTranslation(xK,ace,qHe),E_);let m=$He;m[0]=s;for(let p=0;p<a;p++)for(let y=0;y<n.length;y+=3)d=h.fromArray(n,y,d),d=q.multiplyByVector(m,d,d),d=A.multiplyByPoint(E_,d,d),i.push(d.x,d.y,d.z);return i}var nKe=new h;function _K(e,t,n,i,o,r,s){for(let a=0;a<e.length;a+=3){let c=h.fromArray(e,a,nKe);i=x0(c,t,n,i,o,r[a/3],s,1)}return i}function iKe(e,t){let n=e.length,i=new Array(n*6),o=0,r=t.x+t.width/2,s=t.y+t.height/2,a=e[0];i[o++]=a.x-r,i[o++]=0,i[o++]=a.y-s;for(let c=1;c<n;c++){a=e[c];let d=a.x-r,u=a.y-s;i[o++]=d,i[o++]=0,i[o++]=u,i[o++]=d,i[o++]=0,i[o++]=u}return a=e[0],i[o++]=a.x-r,i[o++]=0,i[o++]=a.y-s,i}function cce(e,t){let n=e.length,i=new Array(n*3),o=0,r=t.x+t.width/2,s=t.y+t.height/2;for(let a=0;a<n;a++)i[o++]=e[a].x-r,i[o++]=0,i[o++]=e[a].y-s;return i}var lce=new Me,dce=new h,uce=new q;function mce(e,t,n,i,o,r,s,a,c,d){let u=h.angleBetween(h.subtract(t,e,n1),h.subtract(n,e,L5)),m=i===Ii.BEVELED?0:Math.ceil(u/W.toRadians(5)),p;o?p=q.fromQuaternion(Me.fromAxisAngle(h.negate(e,n1),u/(m+1),lce),uce):p=q.fromQuaternion(Me.fromAxisAngle(e,u/(m+1),lce),uce);let y,f;if(t=h.clone(t,dce),m>0){let x=d?2:1;for(let _=0;_<m;_++)t=q.multiplyByVector(p,t,t),y=h.subtract(t,e,n1),y=h.normalize(y,y),o||(y=h.negate(y,y)),f=r.scaleToGeodeticSurface(t,L5),s=x0(f,y,a,s,r,c,1,x)}else y=h.subtract(t,e,n1),y=h.normalize(y,y),o||(y=h.negate(y,y)),f=r.scaleToGeodeticSurface(t,L5),s=x0(f,y,a,s,r,c,1,1),n=h.clone(n,dce),y=h.subtract(n,e,n1),y=h.normalize(y,y),o||(y=h.negate(y,y)),f=r.scaleToGeodeticSurface(n,L5),s=x0(f,y,a,s,r,c,1,1);return s}R2.removeDuplicatesFromShape=function(e){let t=e.length,n=[];for(let i=t-1,o=0;o<t;i=o++){let r=e[i],s=e[o];B.equals(r,s)||n.push(s)}return n};R2.angleIsGreaterThanPi=function(e,t,n,i){let o=new kr(n,i),r=o.projectPointOntoPlane(h.add(n,e,R5),R5),s=o.projectPointOntoPlane(h.add(n,t,Z5),Z5);return s.x*r.y-s.y*r.x>=0};var oKe=new h,rKe=new h;R2.computePositions=function(e,t,n,i,o){let r=i._ellipsoid,s=JHe(e,r),a=i._granularity,c=i._cornerType,d=o?iKe(t,n):cce(t,n),u=o?cce(t,n):void 0,m=n.height/2,p=n.width/2,y=e.length,f=[],x=o?[]:void 0,_=UHe,C=kHe,V=DHe,L=BHe,Z=OHe,G=YHe,I=HHe,P=KHe,v=zHe,F=e[0],M=e[1];L=r.geodeticSurfaceNormal(F,L),_=h.subtract(M,F,_),_=h.normalize(_,_),P=h.cross(L,_,P),P=h.normalize(P,P);let b=s[0],R=s[1];o&&(x=x0(F,P,u,x,r,b+m,1,1)),v=h.clone(F,v),F=M,C=h.negate(_,C);let E,X;for(let D=1;D<y-1;D++){let k=o?2:1;if(M=e[D+1],F.equals(M)){Ft("Positions are too close and are considered equivalent with rounding error.");continue}_=h.subtract(M,F,_),_=h.normalize(_,_),V=h.add(_,C,V),V=h.normalize(V,V),L=r.geodeticSurfaceNormal(F,L);let Y=h.multiplyByScalar(L,h.dot(_,L),oKe);h.subtract(_,Y,Y),h.normalize(Y,Y);let U=h.multiplyByScalar(L,h.dot(C,L),rKe);if(h.subtract(C,U,U),h.normalize(U,U),!W.equalsEpsilon(Math.abs(h.dot(Y,U)),1,W.EPSILON7)){V=h.cross(V,L,V),V=h.cross(L,V,V),V=h.normalize(V,V);let K=1/Math.max(.25,h.magnitude(h.cross(V,C,n1))),ee=R2.angleIsGreaterThanPi(_,C,F,r);ee?(Z=h.add(F,h.multiplyByScalar(V,K*p,V),Z),G=h.add(Z,h.multiplyByScalar(P,p,G),G),sa[0]=h.clone(v,sa[0]),sa[1]=h.clone(G,sa[1]),E=gK(sa,b+m,R+m,a),X=Ei.generateArc({positions:sa,granularity:a,ellipsoid:r}),f=_K(X,P,d,f,r,E,1),P=h.cross(L,_,P),P=h.normalize(P,P),I=h.add(Z,h.multiplyByScalar(P,p,I),I),c===Ii.ROUNDED||c===Ii.BEVELED?mce(Z,G,I,c,ee,r,f,d,R+m,o):(V=h.negate(V,V),f=x0(F,V,d,f,r,R+m,K,k)),v=h.clone(I,v)):(Z=h.add(F,h.multiplyByScalar(V,K*p,V),Z),G=h.add(Z,h.multiplyByScalar(P,-p,G),G),sa[0]=h.clone(v,sa[0]),sa[1]=h.clone(G,sa[1]),E=gK(sa,b+m,R+m,a),X=Ei.generateArc({positions:sa,granularity:a,ellipsoid:r}),f=_K(X,P,d,f,r,E,1),P=h.cross(L,_,P),P=h.normalize(P,P),I=h.add(Z,h.multiplyByScalar(P,-p,I),I),c===Ii.ROUNDED||c===Ii.BEVELED?mce(Z,G,I,c,ee,r,f,d,R+m,o):f=x0(F,V,d,f,r,R+m,K,k),v=h.clone(I,v)),C=h.negate(_,C)}else f=x0(v,P,d,f,r,b+m,1,1),v=F;b=R,R=s[D+1],F=M}sa[0]=h.clone(v,sa[0]),sa[1]=h.clone(F,sa[1]),E=gK(sa,b+m,R+m,a),X=Ei.generateArc({positions:sa,granularity:a,ellipsoid:r}),f=_K(X,P,d,f,r,E,1),o&&(x=x0(F,P,u,x,r,R+m,1,1)),y=f.length;let w=o?y+x.length:y,N=new Float64Array(w);return N.set(f),o&&N.set(x,y),N};var Jm=R2;var SK={},i1=new h,yce=new h,sKe=new h,hce=new h,Hc=[new h,new h],gce=new h,xce=new h,_ce=new h,aKe=new h,cKe=new h,lKe=new h,dKe=new h,uKe=new h,mKe=new h,hKe=new h,fce=new Me,pce=new q;function G5(e,t,n,i,o){let r=h.angleBetween(h.subtract(t,e,i1),h.subtract(n,e,yce)),s=i===Ii.BEVELED?1:Math.ceil(r/W.toRadians(5))+1,a=s*3,c=new Array(a);c[a-3]=n.x,c[a-2]=n.y,c[a-1]=n.z;let d;o?d=q.fromQuaternion(Me.fromAxisAngle(h.negate(e,i1),r/s,fce),pce):d=q.fromQuaternion(Me.fromAxisAngle(e,r/s,fce),pce);let u=0;t=h.clone(t,i1);for(let m=0;m<s;m++)t=q.multiplyByVector(d,t,t),c[u++]=t.x,c[u++]=t.y,c[u++]=t.z;return c}function fKe(e){let t=gce,n=xce,i=_ce,o=e[1];n=h.fromArray(e[1],o.length-3,n),i=h.fromArray(e[0],0,i),t=h.midpoint(n,i,t);let r=G5(t,n,i,Ii.ROUNDED,!1),s=e.length-1,a=e[s-1];o=e[s],n=h.fromArray(a,a.length-3,n),i=h.fromArray(o,0,i),t=h.midpoint(n,i,t);let c=G5(t,n,i,Ii.ROUNDED,!1);return[r,c]}function bce(e,t,n,i){let o=i1;return i?o=h.add(e,t,o):(t=h.negate(t,t),o=h.add(e,t,o)),[o.x,o.y,o.z,n.x,n.y,n.z]}function TK(e,t,n,i){let o=new Array(e.length),r=new Array(e.length),s=h.multiplyByScalar(t,n,i1),a=h.negate(s,yce),c=0,d=e.length-1;for(let u=0;u<e.length;u+=3){let m=h.fromArray(e,u,sKe),p=h.add(m,a,hce);o[c++]=p.x,o[c++]=p.y,o[c++]=p.z;let y=h.add(m,s,hce);r[d--]=y.z,r[d--]=y.y,r[d--]=y.x}return i.push(o,r),i}SK.addAttribute=function(e,t,n,i){let o=t.x,r=t.y,s=t.z;l(n)&&(e[n]=o,e[n+1]=r,e[n+2]=s),l(i)&&(e[i]=s,e[i-1]=r,e[i-2]=o)};var pKe=new h,bKe=new h;SK.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,o=e.width/2,r=e.cornerType,s=e.saveAttributes,a=gce,c=xce,d=_ce,u=aKe,m=cKe,p=lKe,y=dKe,f=uKe,x=mKe,_=hKe,C=[],V=s?[]:void 0,L=s?[]:void 0,Z=n[0],G=n[1];c=h.normalize(h.subtract(G,Z,c),c),a=i.geodeticSurfaceNormal(Z,a),u=h.normalize(h.cross(a,c,u),u),s&&(V.push(u.x,u.y,u.z),L.push(a.x,a.y,a.z)),y=h.clone(Z,y),Z=G,d=h.negate(c,d);let I,P=[],v,F=n.length;for(v=1;v<F-1;v++){a=i.geodeticSurfaceNormal(Z,a),G=n[v+1],c=h.normalize(h.subtract(G,Z,c),c),m=h.normalize(h.add(c,d,m),m);let b=h.multiplyByScalar(a,h.dot(c,a),pKe);h.subtract(c,b,b),h.normalize(b,b);let R=h.multiplyByScalar(a,h.dot(d,a),bKe);if(h.subtract(d,R,R),h.normalize(R,R),!W.equalsEpsilon(Math.abs(h.dot(b,R)),1,W.EPSILON7)){m=h.cross(m,a,m),m=h.cross(a,m,m),m=h.normalize(m,m);let X=o/Math.max(.25,h.magnitude(h.cross(m,d,i1))),w=Jm.angleIsGreaterThanPi(c,d,Z,i);m=h.multiplyByScalar(m,X,m),w?(f=h.add(Z,m,f),_=h.add(f,h.multiplyByScalar(u,o,_),_),x=h.add(f,h.multiplyByScalar(u,o*2,x),x),Hc[0]=h.clone(y,Hc[0]),Hc[1]=h.clone(_,Hc[1]),I=Ei.generateArc({positions:Hc,granularity:t,ellipsoid:i}),C=TK(I,u,o,C),s&&(V.push(u.x,u.y,u.z),L.push(a.x,a.y,a.z)),p=h.clone(x,p),u=h.normalize(h.cross(a,c,u),u),x=h.add(f,h.multiplyByScalar(u,o*2,x),x),y=h.add(f,h.multiplyByScalar(u,o,y),y),r===Ii.ROUNDED||r===Ii.BEVELED?P.push({leftPositions:G5(f,p,x,r,w)}):P.push({leftPositions:bce(Z,h.negate(m,m),x,w)})):(x=h.add(Z,m,x),_=h.add(x,h.negate(h.multiplyByScalar(u,o,_),_),_),f=h.add(x,h.negate(h.multiplyByScalar(u,o*2,f),f),f),Hc[0]=h.clone(y,Hc[0]),Hc[1]=h.clone(_,Hc[1]),I=Ei.generateArc({positions:Hc,granularity:t,ellipsoid:i}),C=TK(I,u,o,C),s&&(V.push(u.x,u.y,u.z),L.push(a.x,a.y,a.z)),p=h.clone(f,p),u=h.normalize(h.cross(a,c,u),u),f=h.add(x,h.negate(h.multiplyByScalar(u,o*2,f),f),f),y=h.add(x,h.negate(h.multiplyByScalar(u,o,y),y),y),r===Ii.ROUNDED||r===Ii.BEVELED?P.push({rightPositions:G5(x,p,f,r,w)}):P.push({rightPositions:bce(Z,m,f,w)})),d=h.negate(c,d)}Z=G}a=i.geodeticSurfaceNormal(Z,a),Hc[0]=h.clone(y,Hc[0]),Hc[1]=h.clone(Z,Hc[1]),I=Ei.generateArc({positions:Hc,granularity:t,ellipsoid:i}),C=TK(I,u,o,C),s&&(V.push(u.x,u.y,u.z),L.push(a.x,a.y,a.z));let M;return r===Ii.ROUNDED&&(M=fKe(C)),{positions:C,corners:P,lefts:V,normals:L,endPositions:M}};var Mi=SK;var Cce=new h,Vce=new h,E5=new h,I5=new h,yKe=new h,Lce=new h,Vy=new h,o1=new h;function Rce(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function Qm(e,t,n,i,o,r){let s=e.normals,a=e.tangents,c=e.bitangents,d=h.normalize(h.cross(n,t,Vy),Vy);r.normal&&Mi.addAttribute(s,t,i,o),r.tangent&&Mi.addAttribute(a,d,i,o),r.bitangent&&Mi.addAttribute(c,n,i,o)}function Zce(e,t,n){let i=e.positions,o=e.corners,r=e.endPositions,s=e.lefts,a=e.normals,c=new pn,d,u=0,m=0,p,y=0,f;for(p=0;p<i.length;p+=2)f=i[p].length-3,u+=f,y+=f*2,m+=i[p+1].length-3;for(u+=3,m+=3,p=0;p<o.length;p++){d=o[p];let $=o[p].leftPositions;l($)?(f=$.length,u+=f,y+=f):(f=o[p].rightPositions.length,m+=f,y+=f)}let x=l(r),_;x&&(_=r[0].length-3,u+=_,m+=_,_/=3,y+=_*6);let C=u+m,V=new Float64Array(C),L=t.normal?new Float32Array(C):void 0,Z=t.tangent?new Float32Array(C):void 0,G=t.bitangent?new Float32Array(C):void 0,I={normals:L,tangents:Z,bitangents:G},P=0,v=C-1,F,M,b,R,E=Cce,X=Vce,w,N,D=_/2,k=Ne.createTypedArray(C/3,y),Y=0;if(x){N=E5,w=I5;let $=r[0];for(E=h.fromArray(a,0,E),X=h.fromArray(s,0,X),p=0;p<D;p++)N=h.fromArray($,(D-1-p)*3,N),w=h.fromArray($,(D+p)*3,w),Mi.addAttribute(V,w,P),Mi.addAttribute(V,N,void 0,v),Qm(I,E,X,P,v,t),M=P/3,R=M+1,F=(v-2)/3,b=F-1,k[Y++]=F,k[Y++]=M,k[Y++]=b,k[Y++]=b,k[Y++]=M,k[Y++]=R,P+=3,v-=3}let U=0,J=0,K=i[U++],ee=i[U++];V.set(K,P),V.set(ee,v-ee.length+1),X=h.fromArray(s,J,X);let H,j;for(f=ee.length-3,p=0;p<f;p+=3)H=n.geodeticSurfaceNormal(h.fromArray(K,p,Vy),Vy),j=n.geodeticSurfaceNormal(h.fromArray(ee,f-p,o1),o1),E=h.normalize(h.add(H,j,E),E),Qm(I,E,X,P,v,t),M=P/3,R=M+1,F=(v-2)/3,b=F-1,k[Y++]=F,k[Y++]=M,k[Y++]=b,k[Y++]=b,k[Y++]=M,k[Y++]=R,P+=3,v-=3;for(H=n.geodeticSurfaceNormal(h.fromArray(K,f,Vy),Vy),j=n.geodeticSurfaceNormal(h.fromArray(ee,f,o1),o1),E=h.normalize(h.add(H,j,E),E),J+=3,p=0;p<o.length;p++){let $;d=o[p];let pe=d.leftPositions,ge=d.rightPositions,ae,be,_e=Lce,Ze=E5,Le=I5;if(E=h.fromArray(a,J,E),l(pe)){for(Qm(I,E,X,void 0,v,t),v-=3,ae=R,be=b,$=0;$<pe.length/3;$++)_e=h.fromArray(pe,$*3,_e),k[Y++]=ae,k[Y++]=be-$-1,k[Y++]=be-$,Mi.addAttribute(V,_e,void 0,v),Ze=h.fromArray(V,(be-$-1)*3,Ze),Le=h.fromArray(V,ae*3,Le),X=h.normalize(h.subtract(Ze,Le,X),X),Qm(I,E,X,void 0,v,t),v-=3;_e=h.fromArray(V,ae*3,_e),Ze=h.subtract(h.fromArray(V,be*3,Ze),_e,Ze),Le=h.subtract(h.fromArray(V,(be-$)*3,Le),_e,Le),X=h.normalize(h.add(Ze,Le,X),X),Qm(I,E,X,P,void 0,t),P+=3}else{for(Qm(I,E,X,P,void 0,t),P+=3,ae=b,be=R,$=0;$<ge.length/3;$++)_e=h.fromArray(ge,$*3,_e),k[Y++]=ae,k[Y++]=be+$,k[Y++]=be+$+1,Mi.addAttribute(V,_e,P),Ze=h.fromArray(V,ae*3,Ze),Le=h.fromArray(V,(be+$)*3,Le),X=h.normalize(h.subtract(Ze,Le,X),X),Qm(I,E,X,P,void 0,t),P+=3;_e=h.fromArray(V,ae*3,_e),Ze=h.subtract(h.fromArray(V,(be+$)*3,Ze),_e,Ze),Le=h.subtract(h.fromArray(V,be*3,Le),_e,Le),X=h.normalize(h.negate(h.add(Le,Ze,X),X),X),Qm(I,E,X,void 0,v,t),v-=3}for(K=i[U++],ee=i[U++],K.splice(0,3),ee.splice(ee.length-3,3),V.set(K,P),V.set(ee,v-ee.length+1),f=ee.length-3,J+=3,X=h.fromArray(s,J,X),$=0;$<ee.length;$+=3)H=n.geodeticSurfaceNormal(h.fromArray(K,$,Vy),Vy),j=n.geodeticSurfaceNormal(h.fromArray(ee,f-$,o1),o1),E=h.normalize(h.add(H,j,E),E),Qm(I,E,X,P,v,t),R=P/3,M=R-1,b=(v-2)/3,F=b+1,k[Y++]=F,k[Y++]=M,k[Y++]=b,k[Y++]=b,k[Y++]=M,k[Y++]=R,P+=3,v-=3;P-=3,v+=3}if(E=h.fromArray(a,a.length-3,E),Qm(I,E,X,P,v,t),x){P+=3,v-=3,N=E5,w=I5;let $=r[1];for(p=0;p<D;p++)N=h.fromArray($,(_-p-1)*3,N),w=h.fromArray($,p*3,w),Mi.addAttribute(V,N,void 0,v),Mi.addAttribute(V,w,P),Qm(I,E,X,P,v,t),R=P/3,M=R-1,b=(v-2)/3,F=b+1,k[Y++]=F,k[Y++]=M,k[Y++]=b,k[Y++]=b,k[Y++]=M,k[Y++]=R,P+=3,v-=3}if(c.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:V}),t.st){let $=new Float32Array(C/3*2),pe,ge,ae=0;if(x){u/=3,m/=3;let be=Math.PI/(_+1);ge=1/(u-_+1),pe=1/(m-_+1);let _e,Ze=_/2;for(p=Ze+1;p<_+1;p++)_e=W.PI_OVER_TWO+be*p,$[ae++]=pe*(1+Math.cos(_e)),$[ae++]=.5*(1+Math.sin(_e));for(p=1;p<m-_+1;p++)$[ae++]=p*pe,$[ae++]=0;for(p=_;p>Ze;p--)_e=W.PI_OVER_TWO-p*be,$[ae++]=1-pe*(1+Math.cos(_e)),$[ae++]=.5*(1+Math.sin(_e));for(p=Ze;p>0;p--)_e=W.PI_OVER_TWO-be*p,$[ae++]=1-ge*(1+Math.cos(_e)),$[ae++]=.5*(1+Math.sin(_e));for(p=u-_;p>0;p--)$[ae++]=p*ge,$[ae++]=1;for(p=1;p<Ze+1;p++)_e=W.PI_OVER_TWO+be*p,$[ae++]=ge*(1+Math.cos(_e)),$[ae++]=.5*(1+Math.sin(_e))}else{for(u/=3,m/=3,ge=1/(u-1),pe=1/(m-1),p=0;p<m;p++)$[ae++]=p*pe,$[ae++]=0;for(p=u;p>0;p--)$[ae++]=(p-1)*ge,$[ae++]=1}c.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:$})}return t.normal&&(c.normal=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:I.normals})),t.tangent&&(c.tangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:I.tangents})),t.bitangent&&(c.bitangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:I.bitangents})),{attributes:c,indices:k}}function gKe(e,t){if(!t.normal&&!t.tangent&&!t.bitangent&&!t.st)return e;let n=e.position.values,i,o;(t.normal||t.bitangent)&&(i=e.normal.values,o=e.bitangent.values);let r=e.position.values.length/18,s=r*3,a=r*2,c=s*2,d;if(t.normal||t.bitangent||t.tangent){let u=t.normal?new Float32Array(s*6):void 0,m=t.tangent?new Float32Array(s*6):void 0,p=t.bitangent?new Float32Array(s*6):void 0,y=Cce,f=Vce,x=E5,_=I5,C=yKe,V=Lce,L=c;for(d=0;d<s;d+=3){let Z=L+c;y=h.fromArray(n,d,y),f=h.fromArray(n,d+s,f),x=h.fromArray(n,(d+3)%s,x),f=h.subtract(f,y,f),x=h.subtract(x,y,x),_=h.normalize(h.cross(f,x,_),_),t.normal&&(Mi.addAttribute(u,_,Z),Mi.addAttribute(u,_,Z+3),Mi.addAttribute(u,_,L),Mi.addAttribute(u,_,L+3)),(t.tangent||t.bitangent)&&(V=h.fromArray(i,d,V),t.bitangent&&(Mi.addAttribute(p,V,Z),Mi.addAttribute(p,V,Z+3),Mi.addAttribute(p,V,L),Mi.addAttribute(p,V,L+3)),t.tangent&&(C=h.normalize(h.cross(V,_,C),C),Mi.addAttribute(m,C,Z),Mi.addAttribute(m,C,Z+3),Mi.addAttribute(m,C,L),Mi.addAttribute(m,C,L+3))),L+=6}if(t.normal){for(u.set(i),d=0;d<s;d+=3)u[d+s]=-i[d],u[d+s+1]=-i[d+1],u[d+s+2]=-i[d+2];e.normal.values=u}else e.normal=void 0;if(t.bitangent?(p.set(o),p.set(o,s),e.bitangent.values=p):e.bitangent=void 0,t.tangent){let Z=e.tangent.values;m.set(Z),m.set(Z,s),e.tangent.values=m}}if(t.st){let u=e.st.values,m=new Float32Array(a*6);m.set(u),m.set(u,a);let p=a*2;for(let y=0;y<2;y++){for(m[p++]=u[0],m[p++]=u[1],d=2;d<a;d+=2){let f=u[d],x=u[d+1];m[p++]=f,m[p++]=x,m[p++]=f,m[p++]=x}m[p++]=u[0],m[p++]=u[1]}e.st.values=m}return e}function CK(e,t,n){n[t++]=e[0],n[t++]=e[1],n[t++]=e[2];for(let i=3;i<e.length;i+=3){let o=e[i],r=e[i+1],s=e[i+2];n[t++]=o,n[t++]=r,n[t++]=s,n[t++]=o,n[t++]=r,n[t++]=s}return n[t++]=e[0],n[t++]=e[1],n[t++]=e[2],n}function xKe(e,t){let n=new Pe({position:t.position,normal:t.normal||t.bitangent||e.shadowVolume,tangent:t.tangent,bitangent:t.normal||t.bitangent,st:t.st}),i=e.ellipsoid,o=Mi.computePositions(e),r=Zce(o,n,i),s=e.height,a=e.extrudedHeight,c=r.attributes,d=r.indices,u=c.position.values,m=u.length,p=new Float64Array(m*6),y=new Float64Array(m);y.set(u);let f=new Float64Array(m*4);u=di.scaleToGeodeticHeight(u,s,i),f=CK(u,0,f),y=di.scaleToGeodeticHeight(y,a,i),f=CK(y,m*2,f),p.set(u),p.set(y,m),p.set(f,m*2),c.position.values=p,c=gKe(c,t);let x,_=m/3;if(e.shadowVolume){let F=c.normal.values;m=F.length;let M=new Float32Array(m*6);for(x=0;x<m;x++)F[x]=-F[x];M.set(F,m),M=CK(F,m*4,M),c.extrudeDirection=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:M}),t.normal||(c.normal=void 0)}if(l(e.offsetAttribute)){let F=new Uint8Array(_*6);if(e.offsetAttribute===an.TOP)F=F.fill(1,0,_).fill(1,_*2,_*4);else{let M=e.offsetAttribute===an.NONE?0:1;F=F.fill(M)}c.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:F})}let C=d.length,V=_+_,L=Ne.createTypedArray(p.length/3,C*2+V*3);L.set(d);let Z=C;for(x=0;x<C;x+=3){let F=d[x],M=d[x+1],b=d[x+2];L[Z++]=b+_,L[Z++]=M+_,L[Z++]=F+_}let G,I,P,v;for(x=0;x<V;x+=2)G=x+V,I=G+V,P=G+1,v=I+1,L[Z++]=G,L[Z++]=I,L[Z++]=P,L[Z++]=P,L[Z++]=I,L[Z++]=v;return{attributes:c,indices:L}}var Tce=new h,Z2=new h,Xu=new he;function Sce(e,t,n,i,o,r){let s=h.subtract(t,e,Tce);h.normalize(s,s);let a=n.geodeticSurfaceNormal(e,Z2),c=h.cross(s,a,Tce);h.multiplyByScalar(c,i,c);let d=o.latitude,u=o.longitude,m=r.latitude,p=r.longitude;h.add(e,c,Z2),n.cartesianToCartographic(Z2,Xu);let y=Xu.latitude,f=Xu.longitude;d=Math.min(d,y),u=Math.min(u,f),m=Math.max(m,y),p=Math.max(p,f),h.subtract(e,c,Z2),n.cartesianToCartographic(Z2,Xu),y=Xu.latitude,f=Xu.longitude,d=Math.min(d,y),u=Math.min(u,f),m=Math.max(m,y),p=Math.max(p,f),o.latitude=d,o.longitude=u,r.latitude=m,r.longitude=p}var Iu=new h,G2=new h,Pl=new he,vl=new he;function Gce(e,t,n,i,o){e=Rce(e,t);let r=So(e,h.equalsEpsilon),s=r.length;if(s<2||n<=0)return new de;let a=n*.5;Pl.latitude=Number.POSITIVE_INFINITY,Pl.longitude=Number.POSITIVE_INFINITY,vl.latitude=Number.NEGATIVE_INFINITY,vl.longitude=Number.NEGATIVE_INFINITY;let c,d;if(i===Ii.ROUNDED){let p=r[0];h.subtract(p,r[1],Iu),h.normalize(Iu,Iu),h.multiplyByScalar(Iu,a,Iu),h.add(p,Iu,G2),t.cartesianToCartographic(G2,Xu),c=Xu.latitude,d=Xu.longitude,Pl.latitude=Math.min(Pl.latitude,c),Pl.longitude=Math.min(Pl.longitude,d),vl.latitude=Math.max(vl.latitude,c),vl.longitude=Math.max(vl.longitude,d)}for(let p=0;p<s-1;++p)Sce(r[p],r[p+1],t,a,Pl,vl);let u=r[s-1];h.subtract(u,r[s-2],Iu),h.normalize(Iu,Iu),h.multiplyByScalar(Iu,a,Iu),h.add(u,Iu,G2),Sce(u,G2,t,a,Pl,vl),i===Ii.ROUNDED&&(t.cartesianToCartographic(G2,Xu),c=Xu.latitude,d=Xu.longitude,Pl.latitude=Math.min(Pl.latitude,c),Pl.longitude=Math.min(Pl.longitude,d),vl.latitude=Math.max(vl.latitude,c),vl.longitude=Math.max(vl.longitude,d));let m=l(o)?o:new de;return m.north=vl.latitude,m.south=Pl.latitude,m.east=vl.longitude,m.west=Pl.longitude,m}function T0(e){e=g(e,g.EMPTY_OBJECT);let t=e.positions,n=e.width,i=g(e.height,0),o=g(e.extrudedHeight,i);this._positions=t,this._ellipsoid=oe.clone(g(e.ellipsoid,oe.WGS84)),this._vertexFormat=Pe.clone(g(e.vertexFormat,Pe.DEFAULT)),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=g(e.cornerType,Ii.ROUNDED),this._granularity=g(e.granularity,W.RADIANS_PER_DEGREE),this._shadowVolume=g(e.shadowVolume,!1),this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*h.packedLength+oe.packedLength+Pe.packedLength+7}T0.pack=function(e,t,n){n=g(n,0);let i=e._positions,o=i.length;t[n++]=o;for(let r=0;r<o;++r,n+=h.packedLength)h.pack(i[r],t,n);return oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,Pe.pack(e._vertexFormat,t,n),n+=Pe.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n++]=e._shadowVolume?1:0,t[n]=g(e._offsetAttribute,-1),t};var Ece=oe.clone(oe.UNIT_SPHERE),Ice=new Pe,_0={positions:void 0,ellipsoid:Ece,vertexFormat:Ice,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};T0.unpack=function(e,t,n){t=g(t,0);let i=e[t++],o=new Array(i);for(let f=0;f<i;++f,t+=h.packedLength)o[f]=h.unpack(e,t);let r=oe.unpack(e,t,Ece);t+=oe.packedLength;let s=Pe.unpack(e,t,Ice);t+=Pe.packedLength;let a=e[t++],c=e[t++],d=e[t++],u=e[t++],m=e[t++],p=e[t++]===1,y=e[t];return l(n)?(n._positions=o,n._ellipsoid=oe.clone(r,n._ellipsoid),n._vertexFormat=Pe.clone(s,n._vertexFormat),n._width=a,n._height=c,n._extrudedHeight=d,n._cornerType=u,n._granularity=m,n._shadowVolume=p,n._offsetAttribute=y===-1?void 0:y,n):(_0.positions=o,_0.width=a,_0.height=c,_0.extrudedHeight=d,_0.cornerType=u,_0.granularity=m,_0.shadowVolume=p,_0.offsetAttribute=y===-1?void 0:y,new T0(_0))};T0.computeRectangle=function(e,t){e=g(e,g.EMPTY_OBJECT);let n=e.positions,i=e.width,o=g(e.ellipsoid,oe.WGS84),r=g(e.cornerType,Ii.ROUNDED);return Gce(n,o,i,r,t)};T0.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=Rce(t,i);let o=So(t,h.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,s=e._extrudedHeight,a=!W.equalsEpsilon(r,s,0,W.EPSILON2),c=e._vertexFormat,d={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0},u;if(a)d.height=r,d.extrudedHeight=s,d.shadowVolume=e._shadowVolume,d.offsetAttribute=e._offsetAttribute,u=xKe(d,c);else{let y=Mi.computePositions(d);if(u=Zce(y,c,i),u.attributes.position.values=di.scaleToGeodeticHeight(u.attributes.position.values,r,i),l(e._offsetAttribute)){let f=e._offsetAttribute===an.NONE?0:1,x=u.attributes.position.values.length,_=new Uint8Array(x/3).fill(f);u.attributes.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:_})}}let m=u.attributes,p=ce.fromVertices(m.position.values,void 0,3);return c.position||(u.attributes.position.values=void 0),new mt({attributes:m,indices:u.indices,primitiveType:Ae.TRIANGLES,boundingSphere:p,offsetAttribute:e._offsetAttribute})};T0.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new T0({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:o,granularity:i,extrudedHeight:r,height:s,vertexFormat:Pe.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(T0.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=Gce(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var I_=T0;var Z5n=T(S(),1);var Xce=new h,Wce=new h,_Ke=new h;function TKe(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function Pce(e,t){let n=[],i=e.positions,o=e.corners,r=e.endPositions,s=new pn,a,c=0,d=0,u,m=0,p;for(u=0;u<i.length;u+=2)p=i[u].length-3,c+=p,m+=p/3*4,d+=i[u+1].length-3;for(c+=3,d+=3,u=0;u<o.length;u++){a=o[u];let w=o[u].leftPositions;l(w)?(p=w.length,c+=p,m+=p/3*2):(p=o[u].rightPositions.length,d+=p,m+=p/3*2)}let y=l(r),f;y&&(f=r[0].length-3,c+=f,d+=f,f/=3,m+=f*4);let x=c+d,_=new Float64Array(x),C=0,V=x-1,L,Z,G,I,P,v,F=f/2,M=Ne.createTypedArray(x/3,m+4),b=0;if(M[b++]=C/3,M[b++]=(V-2)/3,y){n.push(C/3),v=Xce,P=Wce;let w=r[0];for(u=0;u<F;u++)v=h.fromArray(w,(F-1-u)*3,v),P=h.fromArray(w,(F+u)*3,P),Mi.addAttribute(_,P,C),Mi.addAttribute(_,v,void 0,V),Z=C/3,I=Z+1,L=(V-2)/3,G=L-1,M[b++]=L,M[b++]=G,M[b++]=Z,M[b++]=I,C+=3,V-=3}let R=0,E=i[R++],X=i[R++];for(_.set(E,C),_.set(X,V-X.length+1),p=X.length-3,n.push(C/3,(V-2)/3),u=0;u<p;u+=3)Z=C/3,I=Z+1,L=(V-2)/3,G=L-1,M[b++]=L,M[b++]=G,M[b++]=Z,M[b++]=I,C+=3,V-=3;for(u=0;u<o.length;u++){let w;a=o[u];let N=a.leftPositions,D=a.rightPositions,k,Y=_Ke;if(l(N)){for(V-=3,k=G,n.push(I),w=0;w<N.length/3;w++)Y=h.fromArray(N,w*3,Y),M[b++]=k-w-1,M[b++]=k-w,Mi.addAttribute(_,Y,void 0,V),V-=3;n.push(k-Math.floor(N.length/6)),t===Ii.BEVELED&&n.push((V-2)/3+1),C+=3}else{for(C+=3,k=I,n.push(G),w=0;w<D.length/3;w++)Y=h.fromArray(D,w*3,Y),M[b++]=k+w,M[b++]=k+w+1,Mi.addAttribute(_,Y,C),C+=3;n.push(k+Math.floor(D.length/6)),t===Ii.BEVELED&&n.push(C/3-1),V-=3}for(E=i[R++],X=i[R++],E.splice(0,3),X.splice(X.length-3,3),_.set(E,C),_.set(X,V-X.length+1),p=X.length-3,w=0;w<X.length;w+=3)I=C/3,Z=I-1,G=(V-2)/3,L=G+1,M[b++]=L,M[b++]=G,M[b++]=Z,M[b++]=I,C+=3,V-=3;C-=3,V+=3,n.push(C/3,(V-2)/3)}if(y){C+=3,V-=3,v=Xce,P=Wce;let w=r[1];for(u=0;u<F;u++)v=h.fromArray(w,(f-u-1)*3,v),P=h.fromArray(w,u*3,P),Mi.addAttribute(_,v,void 0,V),Mi.addAttribute(_,P,C),I=C/3,Z=I-1,G=(V-2)/3,L=G+1,M[b++]=L,M[b++]=G,M[b++]=Z,M[b++]=I,C+=3,V-=3;n.push(C/3)}else n.push(C/3,(V-2)/3);return M[b++]=C/3,M[b++]=(V-2)/3,s.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:_}),{attributes:s,indices:M,wallIndices:n}}function SKe(e){let t=e.ellipsoid,n=Mi.computePositions(e),i=Pce(n,e.cornerType),o=i.wallIndices,r=e.height,s=e.extrudedHeight,a=i.attributes,c=i.indices,d=a.position.values,u=d.length,m=new Float64Array(u);m.set(d);let p=new Float64Array(u*2);if(d=di.scaleToGeodeticHeight(d,r,t),m=di.scaleToGeodeticHeight(m,s,t),p.set(d),p.set(m,u),a.position.values=p,u/=3,l(e.offsetAttribute)){let L=new Uint8Array(u*2);if(e.offsetAttribute===an.TOP)L=L.fill(1,0,u);else{let Z=e.offsetAttribute===an.NONE?0:1;L=L.fill(Z)}a.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:L})}let y,f=c.length,x=Ne.createTypedArray(p.length/3,(f+o.length)*2);x.set(c);let _=f;for(y=0;y<f;y+=2){let L=c[y],Z=c[y+1];x[_++]=L+u,x[_++]=Z+u}let C,V;for(y=0;y<o.length;y++)C=o[y],V=C+u,x[_++]=C,x[_++]=V;return{attributes:a,indices:x}}function E2(e){e=g(e,g.EMPTY_OBJECT);let t=e.positions,n=e.width,i=g(e.height,0),o=g(e.extrudedHeight,i);this._positions=t,this._ellipsoid=oe.clone(g(e.ellipsoid,oe.WGS84)),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=g(e.cornerType,Ii.ROUNDED),this._granularity=g(e.granularity,W.RADIANS_PER_DEGREE),this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*h.packedLength+oe.packedLength+6}E2.pack=function(e,t,n){n=g(n,0);let i=e._positions,o=i.length;t[n++]=o;for(let r=0;r<o;++r,n+=h.packedLength)h.pack(i[r],t,n);return oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n]=g(e._offsetAttribute,-1),t};var vce=oe.clone(oe.UNIT_SPHERE),Ly={positions:void 0,ellipsoid:vce,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};E2.unpack=function(e,t,n){t=g(t,0);let i=e[t++],o=new Array(i);for(let p=0;p<i;++p,t+=h.packedLength)o[p]=h.unpack(e,t);let r=oe.unpack(e,t,vce);t+=oe.packedLength;let s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],m=e[t];return l(n)?(n._positions=o,n._ellipsoid=oe.clone(r,n._ellipsoid),n._width=s,n._height=a,n._extrudedHeight=c,n._cornerType=d,n._granularity=u,n._offsetAttribute=m===-1?void 0:m,n):(Ly.positions=o,Ly.width=s,Ly.height=a,Ly.extrudedHeight=c,Ly.cornerType=d,Ly.granularity=u,Ly.offsetAttribute=m===-1?void 0:m,new E2(Ly))};E2.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=TKe(t,i);let o=So(t,h.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,s=e._extrudedHeight,a=!W.equalsEpsilon(r,s,0,W.EPSILON2),c={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1},d;if(a)c.height=r,c.extrudedHeight=s,c.offsetAttribute=e._offsetAttribute,d=SKe(c);else{let p=Mi.computePositions(c);if(d=Pce(p,c.cornerType),d.attributes.position.values=di.scaleToGeodeticHeight(d.attributes.position.values,r,i),l(e._offsetAttribute)){let y=d.attributes.position.values.length,f=e._offsetAttribute===an.NONE?0:1,x=new Uint8Array(y/3).fill(f);d.attributes.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}}let u=d.attributes,m=ce.fromVertices(u.position.values,void 0,3);return new mt({attributes:u,indices:d.indices,primitiveType:Ae.LINES,boundingSphere:m,offsetAttribute:e._offsetAttribute})};var I2=E2;var U5n=T(S(),1);var CKe=new ei(0);function Kc(e){si.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}l(Object.create)&&(Kc.prototype=Object.create(si.prototype),Kc.prototype.constructor=Kc);Object.defineProperties(Kc.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Kc.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!l(t.height)&&!l(t.extrudedHeight)&&Pc.isSupported(this._scene)};Kc.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||l(n)&&n!==t};Kc.prototype._computeCenter=fe.throwInstantiationError;Kc.prototype._onEntityPropertyChanged=function(e,t,n,i){if(si.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o))return;l(o.zIndex)&&(l(o.height)||l(o.extrudedHeight))&&Ft(Ft.geometryZIndex),this._zIndex=g(o.zIndex,CKe),l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference,s=o.extrudedHeightReference;if(l(r)||l(s)){let a=new Lm(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new Zx(this._scene,a,r,s)}};Kc.prototype.destroy=function(){l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),si.prototype.destroy.call(this)};Kc.getGeometryHeight=function(e,t){if(!l(e)){t!==Qe.NONE&&Ft(Ft.geometryHeightReference);return}return tu(t)?0:e};Kc.getGeometryExtrudedHeight=function(e,t){if(!l(e)){t!==Qe.NONE&&Ft(Ft.geometryExtrudedHeightReference);return}return tu(t)?Kc.CLAMP_TO_GROUND:e};Kc.CLAMP_TO_GROUND="clamp";Kc.computeGeometryOffsetAttribute=function(e,t,n,i){(!l(e)||!l(t))&&(t=Qe.NONE),(!l(n)||!l(i))&&(i=Qe.NONE);let o=0;if(t!==Qe.NONE&&o++,i===Qe.RELATIVE_TO_GROUND&&o++,o===2)return an.ALL;if(o===1)return an.TOP};var zn=Kc;var wce=new O,Fce=h.ZERO,Ace=new h,Mce=new de;function VKe(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 jm(e,t){zn.call(this,{entity:e,scene:t,geometryOptions:new VKe(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}l(Object.create)&&(jm.prototype=Object.create(zn.prototype),jm.prototype.constructor=jm);jm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Dn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Ut){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,wce)),l(o)||(o=O.WHITE),i.color=Ot.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=eo.fromCartesian3(z.getValueOrDefault(this._terrainOffsetProperty,e,Fce,Ace))),new St({id:t,geometry:new I_(this._options),attributes:i})};jm.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=z.getValueOrDefault(this._outlineColorProperty,e,O.BLACK,wce),o={show:new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ot.fromColor(i),distanceDisplayCondition:Dn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=eo.fromCartesian3(z.getValueOrDefault(this._terrainOffsetProperty,e,Fce,Ace))),new St({id:t,geometry:new I2(this._options),attributes:o})};jm.prototype._computeCenter=function(e,t){let n=z.getValueOrUndefined(this._entity.corridor.positions,e);if(!(!l(n)||n.length===0))return h.clone(n[Math.floor(n.length/2)],t)};jm.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.width)||si.prototype._isHidden.call(this,e,t)};jm.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!z.isConstant(t.height)||!z.isConstant(t.extrudedHeight)||!z.isConstant(t.granularity)||!z.isConstant(t.width)||!z.isConstant(t.outlineWidth)||!z.isConstant(t.cornerType)||!z.isConstant(t.zIndex)||this._onTerrain&&!z.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Ut)};jm.prototype._setStaticOptions=function(e,t){let n=z.getValueOrUndefined(t.height,Be.MINIMUM_VALUE),i=z.getValueOrDefault(t.heightReference,Be.MINIMUM_VALUE,Qe.NONE),o=z.getValueOrUndefined(t.extrudedHeight,Be.MINIMUM_VALUE),r=z.getValueOrDefault(t.extrudedHeightReference,Be.MINIMUM_VALUE,Qe.NONE);l(o)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Ut?cn.VERTEX_FORMAT:mo.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(Be.MINIMUM_VALUE,s.positions),s.width=t.width.getValue(Be.MINIMUM_VALUE),s.granularity=z.getValueOrUndefined(t.granularity,Be.MINIMUM_VALUE),s.cornerType=z.getValueOrUndefined(t.cornerType,Be.MINIMUM_VALUE),s.offsetAttribute=zn.computeGeometryOffsetAttribute(n,i,o,r),s.height=zn.getGeometryHeight(n,i),o=zn.getGeometryExtrudedHeight(o,r),o===zn.CLAMP_TO_GROUND&&(o=hi.getMinimumMaximumHeights(I_.computeRectangle(s,Mce)).minimumTerrainHeight),s.extrudedHeight=o};jm.DynamicGeometryUpdater=r1;function r1(e,t,n){ri.call(this,e,t,n)}l(Object.create)&&(r1.prototype=Object.create(ri.prototype),r1.prototype.constructor=r1);r1.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.positions)||!l(i.width)||ri.prototype._isHidden.call(this,e,t,n)};r1.prototype._setOptions=function(e,t,n){let i=this._options,o=z.getValueOrUndefined(t.height,n),r=z.getValueOrDefault(t.heightReference,n,Qe.NONE),s=z.getValueOrUndefined(t.extrudedHeight,n),a=z.getValueOrDefault(t.extrudedHeightReference,n,Qe.NONE);l(s)&&!l(o)&&(o=0),i.positions=z.getValueOrUndefined(t.positions,n),i.width=z.getValueOrUndefined(t.width,n),i.granularity=z.getValueOrUndefined(t.granularity,n),i.cornerType=z.getValueOrUndefined(t.cornerType,n),i.offsetAttribute=zn.computeGeometryOffsetAttribute(o,r,s,a),i.height=zn.getGeometryHeight(o,r),s=zn.getGeometryExtrudedHeight(s,a),s===zn.CLAMP_TO_GROUND&&(s=hi.getMinimumMaximumHeights(I_.computeRectangle(i,Mce)).minimumTerrainHeight),i.extrudedHeight=s};var X2=jm;var Akn=T(S(),1);var mUn=T(S(),1);function X5(){fe.throwInstantiationError()}Object.defineProperties(X5.prototype,{name:{get:fe.throwInstantiationError},clock:{get:fe.throwInstantiationError},entities:{get:fe.throwInstantiationError},isLoading:{get:fe.throwInstantiationError},changedEvent:{get:fe.throwInstantiationError},errorEvent:{get:fe.throwInstantiationError},loadingEvent:{get:fe.throwInstantiationError},show:{get:fe.throwInstantiationError},clustering:{get:fe.throwInstantiationError}});X5.prototype.update=function(e){fe.throwInstantiationError()};X5.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var Wr=X5;var Xkn=T(S(),1);var _Un=T(S(),1);function bf(e,t){this._ellipsoid=e,this._cameraPosition=new h,this._cameraPositionInScaledSpace=new h,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(bf.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),i=h.magnitudeSquared(n)-1;h.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=n,this._distanceToLimbInScaledSpaceSquared=i}}});var Nce=new h;bf.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,Nce);return LK(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};bf.prototype.isScaledSpacePointVisible=function(e){return LK(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var LKe=new h;bf.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,o;return l(t)&&t<0&&n.minimumRadius>-t?(o=LKe,o.x=this._cameraPosition.x/(n.radii.x+t),o.y=this._cameraPosition.y/(n.radii.y+t),o.z=this._cameraPosition.z/(n.radii.z+t),i=o.x*o.x+o.y*o.y+o.z*o.z-1):(o=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared),LK(e,o,i)};bf.prototype.computeHorizonCullingPoint=function(e,t,n){return Dce(this._ellipsoid,e,t,n)};var Uce=oe.clone(oe.UNIT_SPHERE);bf.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let o=kce(this._ellipsoid,n,Uce);return Dce(o,e,t,i)};bf.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,o){return Bce(this._ellipsoid,e,t,n,i,o)};bf.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,o,r){let s=kce(this._ellipsoid,o,Uce);return Bce(s,e,t,n,i,r)};var RKe=[];bf.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=de.subsample(e,t,0,RKe),o=ce.fromPoints(i);if(!(h.magnitude(o.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(o.center,i,n)};var ZKe=new h;function kce(e,t,n){if(l(t)&&t<0&&e.minimumRadius>-t){let i=h.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,ZKe);e=oe.fromCartesian3(i,n)}return e}function Dce(e,t,n,i){l(i)||(i=new h);let o=Hce(e,t),r=0;for(let s=0,a=n.length;s<a;++s){let c=n[s],d=Oce(e,c,o);if(d<0)return;r=Math.max(r,d)}return Yce(o,r,i)}var W5=new h;function Bce(e,t,n,i,o,r){l(r)||(r=new h),i=g(i,3),o=g(o,h.ZERO);let s=Hce(e,t),a=0;for(let c=0,d=n.length;c<d;c+=i){W5.x=n[c]+o.x,W5.y=n[c+1]+o.y,W5.z=n[c+2]+o.z;let u=Oce(e,W5,s);if(u<0)return;a=Math.max(a,u)}return Yce(s,a,r)}function LK(e,t,n){let i=t,o=n,r=h.subtract(e,i,Nce),s=-h.dot(r,i);return!(o<0?s>0:s>o&&s*s/h.magnitudeSquared(r)>o)}var GKe=new h,EKe=new h;function Oce(e,t,n){let i=e.transformPositionToScaledSpace(t,GKe),o=h.magnitudeSquared(i),r=Math.sqrt(o),s=h.divideByScalar(i,r,EKe);o=Math.max(1,o),r=Math.max(1,r);let a=h.dot(s,n),c=h.magnitude(h.cross(s,n,s)),d=1/r,u=Math.sqrt(o-1)*d;return 1/(a*d-c*u)}function Yce(e,t,n){if(!(t<=0||t===1/0||t!==t))return h.multiplyByScalar(e,t,n)}var VK=new h;function Hce(e,t){return h.equals(t,h.ZERO)?t:(e.transformPositionToScaledSpace(t,VK),h.normalize(VK,VK))}var qm=bf;var vUn=T(S(),1);function Pr(e,t){e=g(e,g.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=vt.clone(n)),l(i)&&(i=vt.clone(i)),l(o)&&(o=It.clone(o)),this._show=g(e.show,!0),this._position=h.clone(g(e.position,h.ZERO)),this._actualPosition=h.clone(this._position),this._color=O.clone(g(e.color,O.WHITE)),this._outlineColor=O.clone(g(e.outlineColor,O.TRANSPARENT)),this._outlineWidth=g(e.outlineWidth,0),this._pixelSize=g(e.pixelSize,10),this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=o,this._disableDepthTestDistance=g(e.disableDepthTestDistance,0),this._id=e.id,this._collection=g(e.collection,t),this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1}var Kce=Pr.SHOW_INDEX=0,Qce=Pr.POSITION_INDEX=1,IKe=Pr.COLOR_INDEX=2,XKe=Pr.OUTLINE_COLOR_INDEX=3,WKe=Pr.OUTLINE_WIDTH_INDEX=4,PKe=Pr.PIXEL_SIZE_INDEX=5,vKe=Pr.SCALE_BY_DISTANCE_INDEX=6,wKe=Pr.TRANSLUCENCY_BY_DISTANCE_INDEX=7,FKe=Pr.DISTANCE_DISPLAY_CONDITION_INDEX=8,AKe=Pr.DISABLE_DEPTH_DISTANCE_INDEX=9;Pr.NUMBER_OF_PROPERTIES=10;function Wu(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(Pr.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Wu(this,Kce))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),h.clone(e,this._actualPosition),Wu(this,Qce))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;vt.equals(t,e)||(this._scaleByDistance=vt.clone(e,t),Wu(this,vKe))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;vt.equals(t,e)||(this._translucencyByDistance=vt.clone(e,t),Wu(this,wKe))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,Wu(this,PKe))}},color:{get:function(){return this._color},set:function(e){let t=this._color;O.equals(t,e)||(O.clone(e,t),Wu(this,IKe))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;O.equals(t,e)||(O.clone(e,t),Wu(this,XKe))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Wu(this,WKe))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){It.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=It.clone(e,this._distanceDisplayCondition),Wu(this,FKe))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Wu(this,AKe))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(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,Wu(this,Kce))}}});Pr.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};Pr.prototype._getActualPosition=function(){return this._actualPosition};Pr.prototype._setActualPosition=function(e){h.clone(e,this._actualPosition),Wu(this,Qce)};var zce=new se;Pr._computeActualPosition=function(e,t,n){return t.mode===ie.SCENE3D?e:(A.multiplyByPoint(n,e,zce),to.computeActualWgs84Position(t,zce))};var Jce=new se;Pr._computeScreenSpacePosition=function(e,t,n,i){let o=A.multiplyByVector(e,se.fromElements(t.x,t.y,t.z,1,Jce),Jce);return to.wgs84ToWindowCoordinates(n,o,i)};Pr.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new B);let i=n.modelMatrix,o=Pr._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(o))return o.y=e.canvas.clientHeight-o.y,o};Pr.getScreenSpaceBoundingBox=function(e,t,n){let i=e.pixelSize,o=i*.5,r=t.x-o,s=t.y-o,a=i,c=i;return l(n)||(n=new De),n.x=r,n.y=s,n.width=a,n.height=c,n};Pr.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&h.equals(this._position,e._position)&&O.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&O.equals(this._outlineColor,e._outlineColor)&&vt.equals(this._scaleByDistance,e._scaleByDistance)&&vt.equals(this._translucencyByDistance,e._translucencyByDistance)&&It.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance};Pr.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var ds=Pr;var ukn=T(S(),1);var FUn=T(S(),1),Ry=`in vec4 v_color;
in vec4 v_outlineColor;
in float v_innerPercent;
in float v_pixelDistance;
in vec4 v_pickColor;
void main()
{
// The distance in UV space from this fragment to the center of the point, at most 0.5.
float distanceToCenter = length(gl_PointCoord - vec2(0.5));
// The max distance stops one pixel shy of the edge to leave space for anti-aliasing.
float maxDistance = max(0.0, 0.5 - v_pixelDistance);
float wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter);
float innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter);
vec4 color = mix(v_outlineColor, v_color, innerAlpha);
color.a *= wholeAlpha;
// Fully transparent parts of the billboard are not pickable.
#if !defined(OPAQUE) && !defined(TRANSLUCENT)
if (color.a < 0.005) // matches 0/255 and 1/255
{
discard;
}
#else
// The billboard is rendered twice. The opaque pass discards translucent fragments
// and the translucent pass discards opaque fragments.
#ifdef OPAQUE
if (color.a < 0.995) // matches < 254/255
{
discard;
}
#else
if (color.a >= 0.995) // matches 254/255 and 255/255
{
discard;
}
#endif
#endif
out_FragColor = czm_gammaCorrect(color);
czm_writeLogDepth();
}
`;var MUn=T(S(),1),W2=`uniform float u_maxTotalPointSize;
in vec4 positionHighAndSize;
in vec4 positionLowAndOutline;
in vec4 compressedAttribute0; // color, outlineColor, pick color
in vec4 compressedAttribute1; // show, translucency by distance, some free space
in vec4 scaleByDistance; // near, nearScale, far, farScale
in vec3 distanceDisplayConditionAndDisableDepth; // near, far, disableDepthTestDistance
out vec4 v_color;
out vec4 v_outlineColor;
out float v_innerPercent;
out float v_pixelDistance;
out vec4 v_pickColor;
const float SHIFT_LEFT8 = 256.0;
const float SHIFT_RIGHT8 = 1.0 / 256.0;
void main()
{
// Modifying this shader may also require modifications to PointPrimitive._computeScreenSpacePosition
// unpack attributes
vec3 positionHigh = positionHighAndSize.xyz;
vec3 positionLow = positionLowAndOutline.xyz;
float outlineWidthBothSides = 2.0 * positionLowAndOutline.w;
float totalSize = positionHighAndSize.w + outlineWidthBothSides;
float outlinePercent = outlineWidthBothSides / totalSize;
// Scale in response to browser-zoom.
totalSize *= czm_pixelRatio;
float temp = compressedAttribute1.x * SHIFT_RIGHT8;
float show = floor(temp);
#ifdef EYE_DISTANCE_TRANSLUCENCY
vec4 translucencyByDistance;
translucencyByDistance.x = compressedAttribute1.z;
translucencyByDistance.z = compressedAttribute1.w;
translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;
temp = compressedAttribute1.y * SHIFT_RIGHT8;
translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;
#endif
///////////////////////////////////////////////////////////////////////////
vec4 color;
vec4 outlineColor;
vec4 pickColor;
// compressedAttribute0.z => pickColor.rgb
temp = compressedAttribute0.z * SHIFT_RIGHT8;
pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8;
temp = floor(temp) * SHIFT_RIGHT8;
pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8;
pickColor.r = floor(temp);
// compressedAttribute0.x => color.rgb
temp = compressedAttribute0.x * SHIFT_RIGHT8;
color.b = (temp - floor(temp)) * SHIFT_LEFT8;
temp = floor(temp) * SHIFT_RIGHT8;
color.g = (temp - floor(temp)) * SHIFT_LEFT8;
color.r = floor(temp);
// compressedAttribute0.y => outlineColor.rgb
temp = compressedAttribute0.y * SHIFT_RIGHT8;
outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8;
temp = floor(temp) * SHIFT_RIGHT8;
outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8;
outlineColor.r = floor(temp);
// compressedAttribute0.w => color.a, outlineColor.a, pickColor.a
temp = compressedAttribute0.w * SHIFT_RIGHT8;
pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;
pickColor = pickColor / 255.0;
temp = floor(temp) * SHIFT_RIGHT8;
outlineColor.a = (temp - floor(temp)) * SHIFT_LEFT8;
outlineColor /= 255.0;
color.a = floor(temp);
color /= 255.0;
///////////////////////////////////////////////////////////////////////////
vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
vec4 positionEC = czm_modelViewRelativeToEye * p;
///////////////////////////////////////////////////////////////////////////
#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE)
float lengthSq;
if (czm_sceneMode == czm_sceneMode2D)
{
// 2D camera distance is a special case
// treat all billboards as flattened to the z=0.0 plane
lengthSq = czm_eyeHeight2D.y;
}
else
{
lengthSq = dot(positionEC.xyz, positionEC.xyz);
}
#endif
#ifdef EYE_DISTANCE_SCALING
totalSize *= czm_nearFarScalar(scaleByDistance, lengthSq);
#endif
if (totalSize > 0.0) {
// Add padding for anti-aliasing on both sides.
totalSize += 3.0;
}
// Clamp to max point size.
totalSize = min(totalSize, u_maxTotalPointSize);
// If size is too small, push vertex behind near plane for clipping.
// Note that context.minimumAliasedPointSize "will be at most 1.0".
if (totalSize < 1.0)
{
positionEC.xyz = vec3(0.0);
totalSize = 1.0;
}
float translucency = 1.0;
#ifdef EYE_DISTANCE_TRANSLUCENCY
translucency = czm_nearFarScalar(translucencyByDistance, lengthSq);
// push vertex behind near plane for clipping
if (translucency < 0.004)
{
positionEC.xyz = vec3(0.0);
}
#endif
#ifdef DISTANCE_DISPLAY_CONDITION
float nearSq = distanceDisplayConditionAndDisableDepth.x;
float farSq = distanceDisplayConditionAndDisableDepth.y;
if (lengthSq < nearSq || lengthSq > farSq) {
// push vertex behind camera to force it to be clipped
positionEC.xyz = vec3(0.0, 0.0, 1.0);
}
#endif
gl_Position = czm_projection * positionEC;
czm_vertexLogDepth();
#ifdef DISABLE_DEPTH_DISTANCE
float disableDepthTestDistance = distanceDisplayConditionAndDisableDepth.z;
if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)
{
disableDepthTestDistance = czm_minimumDisableDepthTestDistance;
}
if (disableDepthTestDistance != 0.0)
{
// Don't try to "multiply both sides" by w. Greater/less-than comparisons won't work for negative values of w.
float zclip = gl_Position.z / gl_Position.w;
bool clipped = (zclip < -1.0 || zclip > 1.0);
if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance)))
{
// Position z on the near plane.
gl_Position.z = -gl_Position.w;
#ifdef LOG_DEPTH
czm_vertexLogDepth(vec4(czm_currentFrustum.x));
#endif
}
}
#endif
v_color = color;
v_color.a *= translucency * show;
v_outlineColor = outlineColor;
v_outlineColor.a *= translucency * show;
v_innerPercent = 1.0 - outlinePercent;
v_pixelDistance = 2.0 / totalSize;
gl_PointSize = totalSize * show;
gl_Position *= show;
v_pickColor = pickColor;
}
`;var MKe=ds.SHOW_INDEX,GK=ds.POSITION_INDEX,jce=ds.COLOR_INDEX,NKe=ds.OUTLINE_COLOR_INDEX,UKe=ds.OUTLINE_WIDTH_INDEX,kKe=ds.PIXEL_SIZE_INDEX,qce=ds.SCALE_BY_DISTANCE_INDEX,$ce=ds.TRANSLUCENCY_BY_DISTANCE_INDEX,ele=ds.DISTANCE_DISPLAY_CONDITION_INDEX,DKe=ds.DISABLE_DEPTH_DISTANCE_INDEX,EK=ds.NUMBER_OF_PROPERTIES,uc={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepth:5};function Pu(e){e=g(e,g.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(EK),this._maxPixelSize=1,this._baseVolume=new ce,this._baseVolumeWC=new ce,this._baseVolume2D=new ce,this._boundingVolume=new ce,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=g(e.show,!0),this.modelMatrix=A.clone(g(e.modelMatrix,A.IDENTITY)),this._modelMatrix=A.clone(A.IDENTITY),this.debugShowBoundingVolume=g(e.debugShowBoundingVolume,!1),this.blendOption=g(e.blendOption,Zo.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=ie.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Ue.STATIC_DRAW,Ue.STATIC_DRAW,Ue.STATIC_DRAW,Ue.STATIC_DRAW,Ue.STATIC_DRAW,Ue.STATIC_DRAW,Ue.STATIC_DRAW,Ue.STATIC_DRAW,Ue.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(Pu.prototype,{length:{get:function(){return IK(this),this._pointPrimitives.length}}});function tle(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Pu.prototype.add=function(e){let t=new ds(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};Pu.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Pu.prototype.removeAll=function(){tle(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function IK(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;let t=[],n=e._pointPrimitives,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];s&&(s._index=r++,t.push(s))}e._pointPrimitives=t}}Pu.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};Pu.prototype.contains=function(e){return l(e)&&e._pointPrimitiveCollection===this};Pu.prototype.get=function(e){return IK(this),this._pointPrimitives[e]};Pu.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<EK;++i){let o=n[i]===0?Ue.STATIC_DRAW:Ue.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function BKe(e,t,n){return new $p(e,[{index:uc.positionHighAndSize,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[GK]},{index:uc.positionLowAndShow,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[GK]},{index:uc.compressedAttribute0,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[jce]},{index:uc.compressedAttribute1,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[$ce]},{index:uc.scaleByDistance,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[qce]},{index:uc.distanceDisplayConditionAndDisableDepth,componentsPerAttribute:3,componentDatatype:Q.FLOAT,usage:n[ele]}],t)}var RK=new Kn;function nle(e,t,n,i){let o=i._index,r=i._getActualPosition();e._mode===ie.SCENE3D&&(ce.expand(e._baseVolume,r,e._baseVolume),e._boundingVolumeDirty=!0),Kn.fromCartesian(r,RK);let s=i.pixelSize,a=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,s+a);let c=n[uc.positionHighAndSize],d=RK.high;c(o,d.x,d.y,d.z,s);let u=n[uc.positionLowAndOutline],m=RK.low;u(o,m.x,m.y,m.z,a)}var P5=65536,P2=256;function ile(e,t,n,i){let o=i._index,r=i.color,s=i.getPickId(t).color,a=i.outlineColor,c=O.floatToByte(r.red),d=O.floatToByte(r.green),u=O.floatToByte(r.blue),m=c*P5+d*P2+u;c=O.floatToByte(a.red),d=O.floatToByte(a.green),u=O.floatToByte(a.blue);let p=c*P5+d*P2+u;c=O.floatToByte(s.red),d=O.floatToByte(s.green),u=O.floatToByte(s.blue);let y=c*P5+d*P2+u,f=O.floatToByte(r.alpha)*P5+O.floatToByte(a.alpha)*P2+O.floatToByte(s.alpha),x=n[uc.compressedAttribute0];x(o,m,p,y,f)}function ole(e,t,n,i){let o=i._index,r=0,s=1,a=1,c=1,d=i.translucencyByDistance;l(d)&&(r=d.near,s=d.nearValue,a=d.far,c=d.farValue,(s!==1||c!==1)&&(e._shaderTranslucencyByDistance=!0));let u=i.show&&i.clusterShow;i.color.alpha===0&&i.outlineColor.alpha===0&&(u=!1),s=W.clamp(s,0,1),s=s===1?255:s*255|0;let m=(u?1:0)*P2+s;c=W.clamp(c,0,1),c=c===1?255:c*255|0;let p=c,y=n[uc.compressedAttribute1];y(o,m,p,r,a)}function rle(e,t,n,i){let o=i._index,r=n[uc.scaleByDistance],s=0,a=1,c=1,d=1,u=i.scaleByDistance;l(u)&&(s=u.near,a=u.nearValue,c=u.far,d=u.farValue,(a!==1||d!==1)&&(e._shaderScaleByDistance=!0)),r(o,s,a,c,d)}function sle(e,t,n,i){let o=i._index,r=n[uc.distanceDisplayConditionAndDisableDepth],s=0,a=Number.MAX_VALUE,c=i.distanceDisplayCondition;l(c)&&(s=c.near,a=c.far,s*=s,a*=a,e._shaderDistanceDisplayCondition=!0);let d=i.disableDepthTestDistance;d*=d,d>0&&(e._shaderDisableDepthDistance=!0,d===Number.POSITIVE_INFINITY&&(d=-1)),r(o,s,a,d)}function OKe(e,t,n,i){nle(e,t,n,i),ile(e,t,n,i),ole(e,t,n,i),rle(e,t,n,i),sle(e,t,n,i)}function ZK(e,t,n,i,o,r){let s;i.mode===ie.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let d=t[c],u=d.position,m=ds._computeActualPosition(u,i,o);l(m)&&(d._setActualPosition(m),r?a.push(m):ce.expand(s,m,s))}r&&ce.fromPoints(a,s)}function YKe(e,t){let n=t.mode,i=e._pointPrimitives,o=e._pointPrimitivesToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==ie.SCENE3D&&!A.equals(r,e.modelMatrix)?(e._mode=n,A.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===ie.SCENE3D||n===ie.SCENE2D||n===ie.COLUMBUS_VIEW)&&ZK(e,i,i.length,t,r,!0)):n===ie.MORPHING?ZK(e,i,i.length,t,r,!0):(n===ie.SCENE2D||n===ie.COLUMBUS_VIEW)&&ZK(e,o,e._pointPrimitivesToUpdateIndex,t,r,!1)}function HKe(e,t,n){let o=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=o}var KKe=[];Pu.prototype.update=function(e){if(IK(this),!this.show)return;this._maxTotalPointSize=Yt.maximumAliasedPointSize,YKe(this,e);let n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,o=this._pointPrimitivesToUpdateIndex,r=this._propertiesChanged,s=this._createVertexArray,a,c=e.context,d=e.passes,u=d.pick;if(s||!u&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let G=0;G<EK;++G)r[G]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=BKe(c,n,this._buffersUsage),a=this._vaf.writers;for(let G=0;G<n;++G){let I=this._pointPrimitives[G];I._dirty=!1,OKe(this,c,a,I)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(o>0){let G=KKe;G.length=0,(r[GK]||r[UKe]||r[kKe])&&G.push(nle),(r[jce]||r[NKe])&&G.push(ile),(r[MKe]||r[$ce])&&G.push(ole),r[qce]&&G.push(rle),(r[ele]||r[DKe])&&G.push(sle);let I=G.length;if(a=this._vaf.writers,o/n>.1){for(let P=0;P<o;++P){let v=i[P];v._dirty=!1;for(let F=0;F<I;++F)G[F](this,c,a,v)}this._vaf.commit()}else{for(let P=0;P<o;++P){let v=i[P];v._dirty=!1;for(let F=0;F<I;++F)G[F](this,c,a,v);this._vaf.subCommit(v._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(o>n*1.5&&(i.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ce.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let m,p=A.IDENTITY;e.mode===ie.SCENE3D?(p=this.modelMatrix,m=ce.clone(this._baseVolumeWC,this._boundingVolume)):m=ce.clone(this._baseVolume2D,this._boundingVolume),HKe(this,e,m);let y=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,y&&(this._blendOption===Zo.OPAQUE||this._blendOption===Zo.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=ke.fromCache({depthTest:{enabled:!0,func:ne.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===Zo.TRANSLUCENT||this._blendOption===Zo.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=ke.fromCache({depthTest:{enabled:!0,func:ne.LEQUAL},depthMask:!1,blending:mn.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let f,x;(y||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(f=new Oe({sources:[W2]}),this._shaderScaleByDistance&&f.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&f.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&f.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&f.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===Zo.OPAQUE_AND_TRANSLUCENT&&(x=new Oe({defines:["OPAQUE"],sources:[Ry]}),this._sp=Qt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:f,fragmentShaderSource:x,attributeLocations:uc}),x=new Oe({defines:["TRANSLUCENT"],sources:[Ry]}),this._spTranslucent=Qt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:f,fragmentShaderSource:x,attributeLocations:uc})),this._blendOption===Zo.OPAQUE&&(x=new Oe({sources:[Ry]}),this._sp=Qt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:f,fragmentShaderSource:x,attributeLocations:uc})),this._blendOption===Zo.TRANSLUCENT&&(x=new Oe({sources:[Ry]}),this._spTranslucent=Qt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:f,fragmentShaderSource:x,attributeLocations:uc})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let _,C,V,L,Z=e.commandList;if(d.render||u){let G=this._colorCommands,I=this._blendOption===Zo.OPAQUE,P=this._blendOption===Zo.OPAQUE_AND_TRANSLUCENT;_=this._vaf.va,C=_.length,G.length=C;let v=P?C*2:C;for(L=0;L<v;++L){let F=I||P&&L%2===0;V=G[L],l(V)||(V=G[L]=new nt),V.primitiveType=Ae.POINTS,V.pass=F||!P?Ve.OPAQUE:Ve.TRANSLUCENT,V.owner=this;let M=P?Math.floor(L/2):L;V.boundingVolume=m,V.modelMatrix=p,V.shaderProgram=F?this._sp:this._spTranslucent,V.uniformMap=this._uniforms,V.vertexArray=_[M].va,V.renderState=F?this._rsOpaque:this._rsTranslucent,V.debugShowBoundingVolume=this.debugShowBoundingVolume,V.pickId="v_pickColor",Z.push(V)}}};Pu.prototype.isDestroyed=function(){return!1};Pu.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(),tle(this._pointPrimitives),ue(this)};var S0=Pu;var hkn=T(S(),1),ale=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],XK=1,v2=8,X_=class e{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[n,i]=new Uint8Array(t,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");let o=i>>4;if(o!==XK)throw new Error(`Got v${o} data when expected v${XK}.`);let r=ale[i&15];if(!r)throw new Error("Unrecognized array type.");let[s]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new e(a,s,r,t)}constructor(t,n=64,i=Float64Array,o){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;let r=ale.indexOf(this.ArrayType),s=t*2*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,c=(8-a%8)%8;if(r<0)throw new Error(`Unexpected typed array class: ${i}.`);o&&o instanceof ArrayBuffer?(this.data=o,this.ids=new this.IndexArrayType(this.data,v2,t),this.coords=new this.ArrayType(this.data,v2+a+c,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(v2+s+a+c),this.ids=new this.IndexArrayType(this.data,v2,t),this.coords=new this.ArrayType(this.data,v2+a+c,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(XK<<4)+r]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=t)}add(t,n){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=n,i}finish(){let t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return PK(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,i,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:r,coords:s,nodeSize:a}=this,c=[0,r.length-1,0],d=[];for(;c.length;){let u=c.pop()||0,m=c.pop()||0,p=c.pop()||0;if(m-p<=a){for(let _=p;_<=m;_++){let C=s[2*_],V=s[2*_+1];C>=t&&C<=i&&V>=n&&V<=o&&d.push(r[_])}continue}let y=p+m>>1,f=s[2*y],x=s[2*y+1];f>=t&&f<=i&&x>=n&&x<=o&&d.push(r[y]),(u===0?t<=f:n<=x)&&(c.push(p),c.push(y-1),c.push(1-u)),(u===0?i>=f:o>=x)&&(c.push(y+1),c.push(m),c.push(1-u))}return d}within(t,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:r,nodeSize:s}=this,a=[0,o.length-1,0],c=[],d=i*i;for(;a.length;){let u=a.pop()||0,m=a.pop()||0,p=a.pop()||0;if(m-p<=s){for(let _=p;_<=m;_++)cle(r[2*_],r[2*_+1],t,n)<=d&&c.push(o[_]);continue}let y=p+m>>1,f=r[2*y],x=r[2*y+1];cle(f,x,t,n)<=d&&c.push(o[y]),(u===0?t-i<=f:n-i<=x)&&(a.push(p),a.push(y-1),a.push(1-u)),(u===0?t+i>=f:n+i>=x)&&(a.push(y+1),a.push(m),a.push(1-u))}return c}};function PK(e,t,n,i,o,r){if(o-i<=n)return;let s=i+o>>1;lle(e,t,s,i,o,r),PK(e,t,n,i,s-1,1-r),PK(e,t,n,s+1,o,1-r)}function lle(e,t,n,i,o,r){for(;o>i;){if(o-i>600){let d=o-i+1,u=n-i+1,m=Math.log(d),p=.5*Math.exp(2*m/3),y=.5*Math.sqrt(m*p*(d-p)/d)*(u-d/2<0?-1:1),f=Math.max(i,Math.floor(n-u*p/d+y)),x=Math.min(o,Math.floor(n+(d-u)*p/d+y));lle(e,t,n,f,x,r)}let s=t[2*n+r],a=i,c=o;for(w2(e,t,i,n),t[2*o+r]>s&&w2(e,t,i,o);a<c;){for(w2(e,t,a,c),a++,c--;t[2*a+r]<s;)a++;for(;t[2*c+r]>s;)c--}t[2*i+r]===s?w2(e,t,i,c):(c++,w2(e,t,c,o)),c<=n&&(i=c+1),n<=c&&(o=c-1)}}function w2(e,t,n,i){WK(e,n,i),WK(t,2*n,2*i),WK(t,2*n+1,2*i+1)}function WK(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function cle(e,t,n,i){let o=e-n,r=t-i;return o*o+r*r}function $m(e){e=g(e,g.EMPTY_OBJECT),this._enabled=g(e.enabled,!1),this._pixelRange=g(e.pixelRange,80),this._minimumClusterSize=g(e.minimumClusterSize,2),this._clusterBillboards=g(e.clusterBillboards,!0),this._clusterLabels=g(e.clusterLabels,!0),this._clusterPoints=g(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 ye,this.show=g(e.show,!0)}function dle(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var zKe=new De;function ule(e,t,n,i,o){if(l(e._labelCollection)&&i._clusterLabels?o=Dm.getScreenSpaceBoundingBox(e,t,o):l(e._billboardCollection)&&i._clusterBillboards?o=Hi.getScreenSpaceBoundingBox(e,t,o):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=ds.getScreenSpaceBoundingBox(e,t,o)),dle(o,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&hle(i,e.id.id)&&l(e.id._label)){let r=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(r),a=Dm.getScreenSpaceBoundingBox(s,t,zKe);dle(a,n),o=De.union(o,a,o)}return o}function JKe(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&hle(t,e.id.id)&&l(e.id._label)){let n=t._collectionIndicesByEntity[e.id.id].labelIndex,i=t._labelCollection.get(n);i.clusterShow=!0}}function mle(e,t,n,i){let o={billboard:i._clusterBillboardCollection.add(),label:i._clusterLabelCollection.add(),point:i._clusterPointCollection.add()};o.billboard.show=!1,o.point.show=!1,o.label.show=!0,o.label.text=t.toLocaleString(),o.label.id=n,o.billboard.position=o.label.position=o.point.position=e,i._clusterEvent.raiseEvent(n,o)}function hle(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function vK(e,t,n,i,o){if(!l(e))return;let r=e.length;for(let s=0;s<r;++s){let a=e.get(s);if(a.clusterShow=!1,!a.show||o._scene.mode===ie.SCENE3D&&!i.isPointVisible(a.position))continue;let c=o._clusterLabels&&l(a._labelCollection),d=o._clusterBillboards&&l(a.id._billboard),u=o._clusterPoints&&l(a.id._point);if(c&&(u||d))continue;let m=a.computeScreenSpacePosition(n);l(m)&&t.push({index:s,collection:e,clustered:!1,coord:m})}}var QKe=new De,jKe=new De,qKe=new De;function $Ke(e){return function(t){if(l(t)&&t<.05||!e.enabled)return;let n=e._scene,i=e._labelCollection,o=e._billboardCollection,r=e._pointCollection;if(!l(i)&&!l(o)&&!l(r)||!e._clusterBillboards&&!e._clusterLabels&&!e._clusterPoints)return;let s=e._clusterLabelCollection,a=e._clusterBillboardCollection,c=e._clusterPointCollection;l(s)?s.removeAll():s=e._clusterLabelCollection=new md({scene:n}),l(a)?a.removeAll():a=e._clusterBillboardCollection=new ac({scene:n}),l(c)?c.removeAll():c=e._clusterPointCollection=new S0;let d=e._pixelRange,u=e._minimumClusterSize,m=e._previousClusters,p=[],y=e._previousHeight,f=n.camera.positionCartographic.height,x=n.mapProjection.ellipsoid,_=n.camera.positionWC,C=new qm(x,_),V=[];e._clusterLabels&&vK(i,V,n,C,e),e._clusterBillboards&&vK(o,V,n,C,e),e._clusterPoints&&vK(r,V,n,C,e);let L,Z,G,I,P,v,F,M,b,R,E,X;if(V.length>0){let w=new X_(V.length,64,Uint32Array);for(let N=0;N<V.length;++N)w.add(V[N].coord.x,V[N].coord.y);if(w.finish(),f<y)for(G=m.length,L=0;L<G;++L){let N=m[L];if(!C.isPointVisible(N.position))continue;let D=Hi._computeScreenSpacePosition(A.IDENTITY,N.position,h.ZERO,B.ZERO,n);if(!l(D))continue;let k=1-f/y,Y=N.width=N.width*k,U=N.height=N.height*k;Y=Math.max(Y,N.minimumWidth),U=Math.max(U,N.minimumHeight);let J=D.x-Y*.5,K=D.y-U*.5,ee=D.x+Y,H=D.y+U;for(P=w.range(J,K,ee,H),v=P.length,R=0,b=[],Z=0;Z<v;++Z)F=P[Z],M=V[F],M.clustered||(++R,E=M.collection,X=M.index,b.push(E.get(X).id));if(R>=u)for(mle(N.position,R,b,e),p.push(N),Z=0;Z<v;++Z)V[P[Z]].clustered=!0}for(G=V.length,L=0;L<G;++L){let N=V[L];if(N.clustered)continue;N.clustered=!0,E=N.collection,X=N.index;let D=E.get(X);I=ule(D,N.coord,d,e,QKe);let k=De.clone(I,jKe);P=w.range(I.x,I.y,I.x+I.width,I.y+I.height),v=P.length;let Y=h.clone(D.position);for(R=1,b=[D.id],Z=0;Z<v;++Z)if(F=P[Z],M=V[F],!M.clustered){let U=M.collection.get(M.index),J=ule(U,M.coord,d,e,qKe);h.add(U.position,Y,Y),De.union(k,J,k),++R,b.push(U.id)}if(R>=u){let U=h.multiplyByScalar(Y,1/R,Y);for(mle(U,R,b,e),p.push({position:U,width:k.width,height:k.height,minimumWidth:I.width,minimumHeight:I.height}),Z=0;Z<v;++Z)V[P[Z]].clustered=!0}else JKe(D,e)}}s.length===0&&(s.destroy(),e._clusterLabelCollection=void 0),a.length===0&&(a.destroy(),e._clusterBillboardCollection=void 0),c.length===0&&(c.destroy(),e._clusterPointCollection=void 0),e._previousClusters=p,e._previousHeight=f}}$m.prototype._initialize=function(e){this._scene=e;let t=$Ke(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties($m.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}}});function FK(e,t,n,i){return function(o){let r=this[e];l(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let s=this._collectionIndicesByEntity[o.id];if(l(s)||(s=this._collectionIndicesByEntity[o.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),l(r)&&l(s[i]))return r.get(s[i]);l(r)||(r=this[e]=new t({scene:this._scene}));let a,c,d=this[n];d.length>0?(a=d.shift(),c=r.get(a)):(c=r.add(),a=r.length-1),s[i]=a;let u=this;return Promise.resolve().then(function(){u._clusterDirty=!0}),c}}function AK(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}$m.prototype.getLabel=FK("_labelCollection",md,"_unusedLabelIndices","labelIndex");$m.prototype.removeLabel=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._labelCollection)||!l(t)||!l(t.labelIndex))return;let n=t.labelIndex;t.labelIndex=void 0,AK(this,e.id);let i=this._labelCollection.get(n);i.show=!1,i.text="",i.id=void 0,this._unusedLabelIndices.push(n),this._clusterDirty=!0};$m.prototype.getBillboard=FK("_billboardCollection",ac,"_unusedBillboardIndices","billboardIndex");$m.prototype.removeBillboard=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._billboardCollection)||!l(t)||!l(t.billboardIndex))return;let n=t.billboardIndex;t.billboardIndex=void 0,AK(this,e.id);let i=this._billboardCollection.get(n);i.id=void 0,i.show=!1,i.image=void 0,this._unusedBillboardIndices.push(n),this._clusterDirty=!0};$m.prototype.getPoint=FK("_pointCollection",S0,"_unusedPointIndices","pointIndex");$m.prototype.removePoint=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._pointCollection)||!l(t)||!l(t.pointIndex))return;let n=t.pointIndex;t.pointIndex=void 0,AK(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function wK(e){if(!l(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function eze(e){e.enabled||(l(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),l(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),l(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,wK(e._labelCollection),wK(e._billboardCollection),wK(e._pointCollection))}$m.prototype.update=function(e){if(!this.show)return;let t;l(this._labelCollection)&&this._labelCollection.length>0&&this._labelCollection.get(0)._glyphs.length===0&&(t=e.commandList,e.commandList=[],this._labelCollection.update(e),e.commandList=t),l(this._billboardCollection)&&this._billboardCollection.length>0&&!l(this._billboardCollection.get(0).width)&&(t=e.commandList,e.commandList=[],this._billboardCollection.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,eze(this),this._clusterDirty=!0),this._clusterDirty&&(this._clusterDirty=!1,this._cluster()),l(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),l(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),l(this._clusterPointCollection)&&this._clusterPointCollection.update(e),l(this._labelCollection)&&this._labelCollection.update(e),l(this._billboardCollection)&&this._billboardCollection.update(e),l(this._pointCollection)&&this._pointCollection.update(e)};$m.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(),l(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};var bd=$m;function MK(e){this._name=e,this._clock=void 0,this._changed=new ye,this._error=new ye,this._isLoading=!1,this._loading=new ye,this._entityCollection=new ks(this),this._entityCluster=new bd}Object.defineProperties(MK.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){Wr.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}}});MK.prototype.update=function(e){return!0};var F2=MK;var UDn=T(S(),1);var iDn=T(S(),1);var Ukn=T(S(),1);var fle={};fle.computePositions=function(e,t,n,i,o){let r=e*.5,s=-r,a=i+i,c=o?2*a:a,d=new Float64Array(c*3),u,m=0,p=0,y=o?a*3:0,f=o?(a+i)*3:i*3;for(u=0;u<i;u++){let x=u/i*W.TWO_PI,_=Math.cos(x),C=Math.sin(x),V=_*n,L=C*n,Z=_*t,G=C*t;d[p+y]=V,d[p+y+1]=L,d[p+y+2]=s,d[p+f]=Z,d[p+f+1]=G,d[p+f+2]=r,p+=3,o&&(d[m++]=V,d[m++]=L,d[m++]=s,d[m++]=Z,d[m++]=G,d[m++]=r)}return d};var W_=fle;var NK=new B,tze=new h,nze=new h,ize=new h,oze=new h;function C0(e){e=g(e,g.EMPTY_OBJECT);let t=e.length,n=e.topRadius,i=e.bottomRadius,o=g(e.vertexFormat,Pe.DEFAULT),r=g(e.slices,128);this._length=t,this._topRadius=n,this._bottomRadius=i,this._vertexFormat=Pe.clone(o),this._slices=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}C0.packedLength=Pe.packedLength+5;C0.pack=function(e,t,n){return n=g(n,0),Pe.pack(e._vertexFormat,t,n),n+=Pe.packedLength,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n]=g(e._offsetAttribute,-1),t};var ple=new Pe,s1={vertexFormat:ple,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};C0.unpack=function(e,t,n){t=g(t,0);let i=Pe.unpack(e,t,ple);t+=Pe.packedLength;let o=e[t++],r=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._vertexFormat=Pe.clone(i,n._vertexFormat),n._length=o,n._topRadius=r,n._bottomRadius=s,n._slices=a,n._offsetAttribute=c===-1?void 0:c,n):(s1.length=o,s1.topRadius=r,s1.bottomRadius=s,s1.slices=a,s1.offsetAttribute=c===-1?void 0:c,new C0(s1))};C0.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,o=e._vertexFormat,r=e._slices;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=r+r,a=r+s,c=s+s,d=W_.computePositions(t,n,i,r,!0),u=o.st?new Float32Array(c*2):void 0,m=o.normal?new Float32Array(c*3):void 0,p=o.tangent?new Float32Array(c*3):void 0,y=o.bitangent?new Float32Array(c*3):void 0,f,x=o.normal||o.tangent||o.bitangent;if(x){let P=o.tangent||o.bitangent,v=0,F=0,M=0,b=Math.atan2(i-n,t),R=tze;R.z=Math.sin(b);let E=Math.cos(b),X=ize,w=nze;for(f=0;f<r;f++){let N=f/r*W.TWO_PI,D=E*Math.cos(N),k=E*Math.sin(N);x&&(R.x=D,R.y=k,P&&(X=h.normalize(h.cross(h.UNIT_Z,R,X),X)),o.normal&&(m[v++]=R.x,m[v++]=R.y,m[v++]=R.z,m[v++]=R.x,m[v++]=R.y,m[v++]=R.z),o.tangent&&(p[F++]=X.x,p[F++]=X.y,p[F++]=X.z,p[F++]=X.x,p[F++]=X.y,p[F++]=X.z),o.bitangent&&(w=h.normalize(h.cross(R,X,w),w),y[M++]=w.x,y[M++]=w.y,y[M++]=w.z,y[M++]=w.x,y[M++]=w.y,y[M++]=w.z))}for(f=0;f<r;f++)o.normal&&(m[v++]=0,m[v++]=0,m[v++]=-1),o.tangent&&(p[F++]=1,p[F++]=0,p[F++]=0),o.bitangent&&(y[M++]=0,y[M++]=-1,y[M++]=0);for(f=0;f<r;f++)o.normal&&(m[v++]=0,m[v++]=0,m[v++]=1),o.tangent&&(p[F++]=1,p[F++]=0,p[F++]=0),o.bitangent&&(y[M++]=0,y[M++]=1,y[M++]=0)}let _=12*r-12,C=Ne.createTypedArray(c,_),V=0,L=0;for(f=0;f<r-1;f++)C[V++]=L,C[V++]=L+2,C[V++]=L+3,C[V++]=L,C[V++]=L+3,C[V++]=L+1,L+=2;for(C[V++]=s-2,C[V++]=0,C[V++]=1,C[V++]=s-2,C[V++]=1,C[V++]=s-1,f=1;f<r-1;f++)C[V++]=s+f+1,C[V++]=s+f,C[V++]=s;for(f=1;f<r-1;f++)C[V++]=a,C[V++]=a+f,C[V++]=a+f+1;let Z=0;if(o.st){let P=Math.max(n,i);for(f=0;f<c;f++){let v=h.fromArray(d,f*3,oze);u[Z++]=(v.x+P)/(2*P),u[Z++]=(v.y+P)/(2*P)}}let G=new pn;o.position&&(G.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:d})),o.normal&&(G.normal=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:m})),o.tangent&&(G.tangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:p})),o.bitangent&&(G.bitangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:y})),o.st&&(G.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:u})),NK.x=t*.5,NK.y=Math.max(i,n);let I=new ce(h.ZERO,B.magnitude(NK));if(l(e._offsetAttribute)){t=d.length;let P=e._offsetAttribute===an.NONE?0:1,v=new Uint8Array(t/3).fill(P);G.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:v})}return new mt({attributes:G,indices:C,primitiveType:Ae.TRIANGLES,boundingSphere:I,offsetAttribute:e._offsetAttribute})};var UK;C0.getUnitCylinder=function(){return l(UK)||(UK=C0.createGeometry(new C0({topRadius:1,bottomRadius:1,length:1,vertexFormat:Pe.POSITION_ONLY}))),UK};var A2=C0;var gDn=T(S(),1);var kK=new B;function a1(e){e=g(e,g.EMPTY_OBJECT);let t=e.length,n=e.topRadius,i=e.bottomRadius,o=g(e.slices,128),r=Math.max(g(e.numberOfVerticalLines,16),0);this._length=t,this._topRadius=n,this._bottomRadius=i,this._slices=o,this._numberOfVerticalLines=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}a1.packedLength=6;a1.pack=function(e,t,n){return n=g(n,0),t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n++]=e._numberOfVerticalLines,t[n]=g(e._offsetAttribute,-1),t};var P_={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};a1.unpack=function(e,t,n){t=g(t,0);let i=e[t++],o=e[t++],r=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._length=i,n._topRadius=o,n._bottomRadius=r,n._slices=s,n._numberOfVerticalLines=a,n._offsetAttribute=c===-1?void 0:c,n):(P_.length=i,P_.topRadius=o,P_.bottomRadius=r,P_.slices=s,P_.numberOfVerticalLines=a,P_.offsetAttribute=c===-1?void 0:c,new a1(P_))};a1.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,o=e._slices,r=e._numberOfVerticalLines;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=o*2,a=W_.computePositions(t,n,i,o,!1),c=o*2,d;if(r>0){let x=Math.min(r,o);d=Math.round(o/x),c+=x}let u=Ne.createTypedArray(s,c*2),m=0,p;for(p=0;p<o-1;p++)u[m++]=p,u[m++]=p+1,u[m++]=p+o,u[m++]=p+1+o;if(u[m++]=o-1,u[m++]=0,u[m++]=o+o-1,u[m++]=o,r>0)for(p=0;p<o;p+=d)u[m++]=p,u[m++]=p+o;let y=new pn;y.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:a}),kK.x=t*.5,kK.y=Math.max(i,n);let f=new ce(h.ZERO,B.magnitude(kK));if(l(e._offsetAttribute)){t=a.length;let x=e._offsetAttribute===an.NONE?0:1,_=new Uint8Array(t/3).fill(x);y.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:_})}return new mt({attributes:y,indices:u,primitiveType:Ae.LINES,boundingSphere:f,offsetAttribute:e._offsetAttribute})};var M2=a1;var ble=h.ZERO,yle=new h,rze=new h,gle=new O;function sze(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 yd(e,t){si.call(this,{entity:e,scene:t,geometryOptions:new sze(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}l(Object.create)&&(yd.prototype=Object.create(si.prototype),yd.prototype.constructor=yd);Object.defineProperties(yd.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});yd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Dn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Ut){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,gle)),l(a)||(a=O.WHITE),s.color=Ot.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=eo.fromCartesian3(z.getValueOrDefault(this._terrainOffsetProperty,e,ble,yle))),new St({id:t,geometry:new A2(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.mapProjection.ellipsoid),attributes:s})};yd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=z.getValueOrDefault(this._outlineColorProperty,e,O.BLACK,gle),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ot.fromColor(i),distanceDisplayCondition:Dn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=eo.fromCartesian3(z.getValueOrDefault(this._terrainOffsetProperty,e,ble,yle))),new St({id:t,geometry:new M2(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.mapProjection.ellipsoid),attributes:r})};yd.prototype._computeCenter=function(e,t){return z.getValueOrUndefined(this._entity.position,e,t)};yd.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.length)||!l(t.topRadius)||!l(t.bottomRadius)||si.prototype._isHidden.call(this,e,t)};yd.prototype._isDynamic=function(e,t){return!e.position.isConstant||!z.isConstant(e.orientation)||!t.length.isConstant||!t.topRadius.isConstant||!t.bottomRadius.isConstant||!z.isConstant(t.slices)||!z.isConstant(t.outlineWidth)||!z.isConstant(t.numberOfVerticalLines)};yd.prototype._setStaticOptions=function(e,t){let n=z.getValueOrDefault(t.heightReference,Be.MINIMUM_VALUE,Qe.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Ut?cn.VERTEX_FORMAT:mo.MaterialSupport.TEXTURED.vertexFormat,i.length=t.length.getValue(Be.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(Be.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(Be.MINIMUM_VALUE),i.slices=z.getValueOrUndefined(t.slices,Be.MINIMUM_VALUE),i.numberOfVerticalLines=z.getValueOrUndefined(t.numberOfVerticalLines,Be.MINIMUM_VALUE),i.offsetAttribute=n!==Qe.NONE?an.ALL:void 0};yd.prototype._onEntityPropertyChanged=Gp;yd.DynamicGeometryUpdater=c1;function c1(e,t,n){ri.call(this,e,t,n)}l(Object.create)&&(c1.prototype=Object.create(ri.prototype),c1.prototype.constructor=c1);c1.prototype._isHidden=function(e,t,n){let i=this._options,o=z.getValueOrUndefined(e.position,n,rze);return!l(o)||!l(i.length)||!l(i.topRadius)||!l(i.bottomRadius)||ri.prototype._isHidden.call(this,e,t,n)};c1.prototype._setOptions=function(e,t,n){let i=z.getValueOrDefault(t.heightReference,n,Qe.NONE),o=this._options;o.length=z.getValueOrUndefined(t.length,n),o.topRadius=z.getValueOrUndefined(t.topRadius,n),o.bottomRadius=z.getValueOrUndefined(t.bottomRadius,n),o.slices=z.getValueOrUndefined(t.slices,n),o.numberOfVerticalLines=z.getValueOrUndefined(t.numberOfVerticalLines,n),o.offsetAttribute=i!==Qe.NONE?an.ALL:void 0};var N2=yd;var PHn=T(S(),1);var DDn=T(S(),1),aze={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2},vr=Object.freeze(aze);var ODn=T(S(),1),cze={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2},yo=Object.freeze(cze);var HDn=T(S(),1),lze={NONE:0,HOLD:1,EXTRAPOLATE:2},gd=Object.freeze(lze);var zDn=T(S(),1),xle=T($l(),1);function dze(e){let t=new xle.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var V0=dze;var $Dn=T(S(),1);var uze=W.factorial;function DK(e,t,n,i,o,r){let s=0,a,c,d;if(i>0){for(c=0;c<o;c++){for(a=!1,d=0;d<r.length&&!a;d++)c===r[d]&&(a=!0);a||(r.push(c),s+=DK(e,t,n,i-1,o,r),r.splice(r.length-1,1))}return s}for(s=1,c=0;c<o;c++){for(a=!1,d=0;d<r.length&&!a;d++)c===r[d]&&(a=!0);a||(s*=e-n[t[c]])}return s}var v5={type:"Hermite"};v5.getRequiredDataPoints=function(e,t){return t=g(t,0),Math.max(Math.floor((e+1)/(t+1)),2)};v5.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,s,a,c,d,u,m=t.length,p=new Array(i);for(r=0;r<i;r++){o[r]=0;let _=new Array(m);for(p[r]=_,s=0;s<m;s++)_[s]=[]}let y=m,f=new Array(y);for(r=0;r<y;r++)f[r]=r;let x=m-1;for(c=0;c<i;c++){for(s=0;s<y;s++)u=f[s]*i+c,p[c][0].push(n[u]);for(r=1;r<y;r++){let _=!1;for(s=0;s<y-r;s++){let C=t[f[s]],V=t[f[s+r]],L;V-C<=0?(u=f[s]*i+i*r+c,L=n[u],p[c][r].push(L/uze(r))):(L=p[c][r-1][s+1]-p[c][r-1][s],p[c][r].push(L/(V-C))),_=_||L!==0}_||(x=r-1)}}for(a=0,d=0;a<=d;a++)for(r=a;r<=x;r++){let _=DK(e,f,t,a,r,[]);for(c=0;c<i;c++){let C=p[c][r][0];o[c+a*i]+=C*_}}return o};var mze=[];v5.interpolate=function(e,t,n,i,o,r,s){let a=i*(r+1);l(s)||(s=new Array(a));for(let C=0;C<a;C++)s[C]=0;let c=t.length,d=new Array(c*(o+1)),u;for(u=0;u<c;u++)for(let C=0;C<o+1;C++)d[u*(o+1)+C]=u;let m=d.length,p=mze,y=hze(p,d,t,n,i,o),f=[],x=m*(m+1)/2,_=Math.min(y,r);for(let C=0;C<=_;C++)for(u=C;u<=y;u++){f.length=0;let V=DK(e,d,t,C,u,f),L=Math.floor(u*(1-u)/2)+m*u;for(let Z=0;Z<i;Z++){let G=Math.floor(Z*x),I=p[G+L];s[Z+C*i]+=I*V}}return s};function hze(e,t,n,i,o,r){let s,a,c=-1,d=t.length,u=d*(d+1)/2;for(let m=0;m<o;m++){let p=Math.floor(m*u);for(s=0;s<d;s++)a=t[s]*o*(r+1)+m,e[p+s]=i[a];for(let y=1;y<d;y++){let f=0,x=Math.floor(y*(1-y)/2)+d*y,_=!1;for(s=0;s<d-y;s++){let C=n[t[s]],V=n[t[s+y]],L,Z;if(V-C<=0)a=t[s]*o*(r+1)+o*y+m,L=i[a],Z=L/W.factorial(y),e[p+x+f]=Z,f++;else{let G=Math.floor((y-1)*(2-y)/2)+d*(y-1);L=e[p+G+s+1]-e[p+G+s],Z=L/(V-C),e[p+x+f]=Z,f++}_=_||L!==0}_&&(c=Math.max(c,y))}}return c}var U2=v5;var nBn=T(S(),1);var BK={type:"Lagrange"};BK.getRequiredDataPoints=function(e){return Math.max(e+1,2)};BK.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,s,a=t.length;for(r=0;r<i;r++)o[r]=0;for(r=0;r<a;r++){let c=1;for(s=0;s<a;s++)if(s!==r){let d=t[r]-t[s];c*=(e-t[s])/d}for(s=0;s<i;s++)o[s]+=c*n[r*i+s]}return o};var k2=BK;var rBn=T(S(),1);var OK={type:"Linear"};OK.getRequiredDataPoints=function(e){return 2};OK.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,s,a,c=t[0],d=t[1];for(r=0;r<i;r++)s=n[r],a=n[r+i],o[r]=((a-s)*e+d*s-c*a)/(d-c);return o};var v_=OK;var lBn=T(S(),1);function mc(e,t,n){this.clock=g(e,0),this.cone=g(t,0),this.magnitude=g(n,1)}mc.fromCartesian3=function(e,t){let n=e.x,i=e.y,o=e.z,r=n*n+i*i;return l(t)||(t=new mc),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(r),o),t.magnitude=Math.sqrt(r+o*o),t};mc.clone=function(e,t){if(l(e))return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new mc(e.clock,e.cone,e.magnitude)};mc.normalize=function(e,t){return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new mc(e.clock,e.cone,1)};mc.equals=function(e,t){return e===t||l(e)&&l(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};mc.equalsEpsilon=function(e,t,n){return n=g(n,0),e===t||l(e)&&l(t)&&Math.abs(e.clock-t.clock)<=n&&Math.abs(e.cone-t.cone)<=n&&Math.abs(e.magnitude-t.magnitude)<=n};mc.prototype.equals=function(e){return mc.equals(this,e)};mc.prototype.clone=function(e){return mc.clone(this,e)};mc.prototype.equalsEpsilon=function(e,t){return mc.equalsEpsilon(this,e,t)};mc.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var D2=mc;var K2=T($l(),1);var GBn=T(S(),1);var _Bn=T(S(),1);var uBn=T(S(),1),YK;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?YK=function(){return performance.now()}:YK=function(){return Date.now()};var xi=YK;function HK(e){e=g(e,g.EMPTY_OBJECT);let t=e.currentTime,n=e.startTime,i=e.stopTime;l(t)?t=te.clone(t):l(n)?t=te.clone(n):l(i)?t=te.addDays(i,-1,new te):t=te.now(),l(n)?n=te.clone(n):n=te.clone(t),l(i)?i=te.clone(i):i=te.addDays(n,1,new te),this.startTime=n,this.stopTime=i,this.clockRange=g(e.clockRange,vr.UNBOUNDED),this.canAnimate=g(e.canAnimate,!0),this.onTick=new ye,this.onStop=new ye,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=xi(),this.currentTime=t,this.multiplier=g(e.multiplier,1),this.shouldAnimate=g(e.shouldAnimate,!1),this.clockStep=g(e.clockStep,yo.SYSTEM_CLOCK_MULTIPLIER)}Object.defineProperties(HK.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){te.equals(this._currentTime,e)||(this._clockStep===yo.SYSTEM_CLOCK&&(this._clockStep=yo.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===yo.SYSTEM_CLOCK&&(this._clockStep=yo.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===yo.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=te.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===yo.SYSTEM_CLOCK&&(this._clockStep=yo.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});HK.prototype.tick=function(){let e=xi(),t=te.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===yo.SYSTEM_CLOCK)t=te.now(t);else{let i=this._multiplier;if(n===yo.TICK_DEPENDENT)t=te.addSeconds(t,i,t);else{let a=e-this._lastSystemTime;t=te.addSeconds(t,i*(a/1e3),t)}let o=this.clockRange,r=this.startTime,s=this.stopTime;if(o===vr.CLAMPED)te.lessThan(t,r)?t=te.clone(r,t):te.greaterThan(t,s)&&(t=te.clone(s,t),this.onStop.raiseEvent(this));else if(o===vr.LOOP_STOP)for(te.lessThan(t,r)&&(t=te.clone(r,t));te.greaterThan(t,s);)t=te.addSeconds(r,te.secondsDifference(t,s),t),this.onStop.raiseEvent(this)}}return this._currentTime=t,this._lastSystemTime=e,this.onTick.raiseEvent(this),t};var eh=HK;function w_(){this._definitionChanged=new ye,this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0}Object.defineProperties(w_.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:xl("startTime"),stopTime:xl("stopTime"),currentTime:xl("currentTime"),clockRange:xl("clockRange"),clockStep:xl("clockStep"),multiplier:xl("multiplier")});w_.prototype.clone=function(e){return l(e)||(e=new w_),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};w_.prototype.equals=function(e){return this===e||l(e)&&te.equals(this.startTime,e.startTime)&&te.equals(this.stopTime,e.stopTime)&&te.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier};w_.prototype.merge=function(e){this.startTime=g(this.startTime,e.startTime),this.stopTime=g(this.stopTime,e.stopTime),this.currentTime=g(this.currentTime,e.currentTime),this.clockRange=g(this.clockRange,e.clockRange),this.clockStep=g(this.clockStep,e.clockStep),this.multiplier=g(this.multiplier,e.multiplier)};w_.prototype.getValue=function(e){return l(e)||(e=new eh),e.startTime=g(this.startTime,e.startTime),e.stopTime=g(this.stopTime,e.stopTime),e.currentTime=g(this.currentTime,e.currentTime),e.clockRange=g(this.clockRange,e.clockRange),e.multiplier=g(this.multiplier,e.multiplier),e.clockStep=g(this.clockStep,e.clockStep),e};var th=w_;var ABn=T(S(),1);var fze=O.WHITE,pze=.1,bze=new B(8,8),yze=new B(0,0),gze=new B(1,1);function l1(e){e=g(e,g.EMPTY_OBJECT),this._definitionChanged=new ye,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}Object.defineProperties(l1.prototype,{isConstant:{get:function(){return z.isConstant(this._color)&&z.isConstant(this._cellAlpha)&&z.isConstant(this._lineCount)&&z.isConstant(this._lineThickness)&&z.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),cellAlpha:le("cellAlpha"),lineCount:le("lineCount"),lineThickness:le("lineThickness"),lineOffset:le("lineOffset")});l1.prototype.getType=function(e){return"Grid"};l1.prototype.getValue=function(e,t){return l(t)||(t={}),t.color=z.getValueOrClonedDefault(this._color,e,fze,t.color),t.cellAlpha=z.getValueOrDefault(this._cellAlpha,e,pze),t.lineCount=z.getValueOrClonedDefault(this._lineCount,e,bze,t.lineCount),t.lineThickness=z.getValueOrClonedDefault(this._lineThickness,e,gze,t.lineThickness),t.lineOffset=z.getValueOrClonedDefault(this._lineOffset,e,yze,t.lineOffset),t};l1.prototype.equals=function(e){return this===e||e instanceof l1&&z.equals(this._color,e._color)&&z.equals(this._cellAlpha,e._cellAlpha)&&z.equals(this._lineCount,e._lineCount)&&z.equals(this._lineThickness,e._lineThickness)&&z.equals(this._lineOffset,e._lineOffset)};var d1=l1;var OBn=T(S(),1);function u1(e){this._definitionChanged=new ye,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(u1.prototype,{isConstant:{get:function(){return z.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color")});u1.prototype.getType=function(e){return"PolylineArrow"};u1.prototype.getValue=function(e,t){return l(t)||(t={}),t.color=z.getValueOrClonedDefault(this._color,e,O.WHITE,t.color),t};u1.prototype.equals=function(e){return this===e||e instanceof u1&&z.equals(this._color,e._color)};var m1=u1;var qBn=T(S(),1);var xze=O.WHITE,_ze=O.TRANSPARENT,Tze=16,Sze=255;function h1(e){e=g(e,g.EMPTY_OBJECT),this._definitionChanged=new ye,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}Object.defineProperties(h1.prototype,{isConstant:{get:function(){return z.isConstant(this._color)&&z.isConstant(this._gapColor)&&z.isConstant(this._dashLength)&&z.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),gapColor:le("gapColor"),dashLength:le("dashLength"),dashPattern:le("dashPattern")});h1.prototype.getType=function(e){return"PolylineDash"};h1.prototype.getValue=function(e,t){return l(t)||(t={}),t.color=z.getValueOrClonedDefault(this._color,e,xze,t.color),t.gapColor=z.getValueOrClonedDefault(this._gapColor,e,_ze,t.gapColor),t.dashLength=z.getValueOrDefault(this._dashLength,e,Tze,t.dashLength),t.dashPattern=z.getValueOrDefault(this._dashPattern,e,Sze,t.dashPattern),t};h1.prototype.equals=function(e){return this===e||e instanceof h1&&z.equals(this._color,e._color)&&z.equals(this._gapColor,e._gapColor)&&z.equals(this._dashLength,e._dashLength)&&z.equals(this._dashPattern,e._dashPattern)};var f1=h1;var s3n=T(S(),1);var Cze=O.WHITE,Vze=.25,Lze=1;function p1(e){e=g(e,g.EMPTY_OBJECT),this._definitionChanged=new ye,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}Object.defineProperties(p1.prototype,{isConstant:{get:function(){return z.isConstant(this._color)&&z.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),glowPower:le("glowPower"),taperPower:le("taperPower")});p1.prototype.getType=function(e){return"PolylineGlow"};p1.prototype.getValue=function(e,t){return l(t)||(t={}),t.color=z.getValueOrClonedDefault(this._color,e,Cze,t.color),t.glowPower=z.getValueOrDefault(this._glowPower,e,Vze,t.glowPower),t.taperPower=z.getValueOrDefault(this._taperPower,e,Lze,t.taperPower),t};p1.prototype.equals=function(e){return this===e||e instanceof p1&&z.equals(this._color,e._color)&&z.equals(this._glowPower,e._glowPower)&&z.equals(this._taperPower,e._taperPower)};var b1=p1;var f3n=T(S(),1);var Rze=O.WHITE,Zze=O.BLACK,Gze=1;function y1(e){e=g(e,g.EMPTY_OBJECT),this._definitionChanged=new ye,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}Object.defineProperties(y1.prototype,{isConstant:{get:function(){return z.isConstant(this._color)&&z.isConstant(this._outlineColor)&&z.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:le("color"),outlineColor:le("outlineColor"),outlineWidth:le("outlineWidth")});y1.prototype.getType=function(e){return"PolylineOutline"};y1.prototype.getValue=function(e,t){return l(t)||(t={}),t.color=z.getValueOrClonedDefault(this._color,e,Rze,t.color),t.outlineColor=z.getValueOrClonedDefault(this._outlineColor,e,Zze,t.outlineColor),t.outlineWidth=z.getValueOrDefault(this._outlineWidth,e,Gze),t};y1.prototype.equals=function(e){return this===e||e instanceof y1&&z.equals(this._color,e._color)&&z.equals(this._outlineColor,e._outlineColor)&&z.equals(this._outlineWidth,e._outlineWidth)};var Zy=y1;var S3n=T(S(),1);function L0(e,t){this._value=void 0,this._definitionChanged=new ye,this._eventHelper=new Er,this._referenceFrame=g(t,ao.FIXED),this.setValue(e)}Object.defineProperties(L0.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!z.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});L0.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,ao.FIXED,t)};L0.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._value;if(!l(i))return;let o=i.length;l(n)||(n=new Array(o));let r=0,s=0;for(;r<o;){let c=i[r].getValueInReferenceFrame(e,t,n[r]);l(c)&&(n[s]=c,s++),r++}return n.length=s,n};L0.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let o=e[i];l(o)&&t.add(o.definitionChanged,L0.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};L0.prototype.equals=function(e){return this===e||e instanceof L0&&this._referenceFrame===e._referenceFrame&&z.arrayEquals(this._value,e._value)};L0.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var R0=L0;var G3n=T(S(),1);function Gy(e){this._value=void 0,this._definitionChanged=new ye,this._eventHelper=new Er,this.setValue(e)}Object.defineProperties(Gy.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!z.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});Gy.prototype.getValue=function(e,t){let n=this._value;if(!l(n))return;let i=n.length;l(t)||(t=new Array(i));let o=0,r=0;for(;o<i;){let a=this._value[o].getValue(e,t[o]);l(a)&&(t[r]=a,r++),o++}return t.length=r,t};Gy.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let o=e[i];l(o)&&t.add(o.definitionChanged,Gy.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};Gy.prototype.equals=function(e){return this===e||e instanceof Gy&&z.arrayEquals(this._value,e._value)};Gy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var g1=Gy;var P3n=T(S(),1);function F_(e){let t=e._targetProperty;if(!l(t)){let n=e._targetEntity;if(!l(n)){if(n=e._targetCollection.getById(e._targetId),!l(n)){e._targetEntity=e._targetProperty=void 0;return}n.definitionChanged.addEventListener(xd.prototype._onTargetEntityDefinitionChanged,e),e._targetEntity=n}let i=e._targetPropertyNames;t=e._targetEntity;for(let o=0,r=i.length;o<r&&l(t);++o)t=t[i[o]];e._targetProperty=t}return t}function xd(e,t,n){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new ye,e.collectionChanged.addEventListener(xd.prototype._onCollectionChanged,this)}Object.defineProperties(xd.prototype,{isConstant:{get:function(){return z.isConstant(F_(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=F_(this);return l(e)?e.referenceFrame:void 0}},targetId:{get:function(){return this._targetId}},targetCollection:{get:function(){return this._targetCollection}},targetPropertyNames:{get:function(){return this._targetPropertyNames}},resolvedProperty:{get:function(){return F_(this)}}});xd.fromString=function(e,t){let n,i=[],o=!0,r=!1,s="";for(let a=0;a<t.length;++a){let c=t.charAt(a);r?(s+=c,r=!1):c==="\\"?r=!0:o&&c==="#"?(n=s,o=!1,s=""):!o&&c==="."?(i.push(s),s=""):s+=c}return i.push(s),new xd(e,n,i)};xd.prototype.getValue=function(e,t){let n=F_(this);return l(n)?n.getValue(e,t):void 0};xd.prototype.getValueInReferenceFrame=function(e,t,n){let i=F_(this);return l(i)?i.getValueInReferenceFrame(e,t,n):void 0};xd.prototype.getType=function(e){let t=F_(this);return l(t)?t.getType(e):void 0};xd.prototype.equals=function(e){if(this===e)return!0;let t=this._targetPropertyNames,n=e._targetPropertyNames;if(this._targetCollection!==e._targetCollection||this._targetId!==e._targetId||t.length!==n.length)return!1;let i=this._targetPropertyNames.length;for(let o=0;o<i;o++)if(t[o]!==n[o])return!1;return!0};xd.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){l(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};xd.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;l(i)&&n.indexOf(i)!==-1?(i.definitionChanged.removeEventListener(xd.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):l(i)||(i=F_(this),l(i)&&this._definitionChanged.raiseEvent(this))};var Z0=xd;var M3n=T(S(),1);var Eze={packedLength:1,pack:function(e,t,n){return n=g(n,0),t[n]=e,t},unpack:function(e,t,n){return t=g(t,0),e[t]},convertPackedArrayForInterpolation:function(e,t,n,i){l(i)||(i=[]),t=g(t,0),n=g(n,e.length);let o;for(let r=0,s=n-t+1;r<s;r++){let a=e[t+r];r===0||Math.abs(o-a)<Math.PI?i[r]=a:i[r]=a-W.TWO_PI,o=a}},unpackInterpolationResult:function(e,t,n,i,o){return o=e[0],o<0?o+W.TWO_PI:o}},vu=Eze;var iOn=T(S(),1);var K3n=T(S(),1);var _le={packedLength:1,pack:function(e,t,n){n=g(n,0),t[n]=e},unpack:function(e,t,n){return t=g(t,0),e[t]}};function Tle(e,t,n){let i,o=e.length,r=n.length,s=o+r;if(e.length=s,o!==t){let a=o-1;for(i=s-1;i>=t;i--)e[i]=e[a--]}for(i=0;i<r;i++)e[t++]=n[i]}function Sle(e,t){return e instanceof te?e:typeof e=="string"?te.fromIso8601(e):te.addSeconds(t,e,new te)}var KK=[],zK=[];function w5(e,t,n,i,o){let r=0,s,a,c,d,u,m;for(;r<i.length;){u=Sle(i[r],e),c=Io(t,u,te.compare);let p=0,y=0;if(c<0){for(c=~c,d=c*o,a=void 0,m=t[c];r<i.length&&(u=Sle(i[r],e),!(l(a)&&te.compare(a,u)>=0||l(m)&&te.compare(u,m)>=0));){for(KK[p++]=u,r=r+1,s=0;s<o;s++)zK[y++]=i[r],r=r+1;a=u}p>0&&(zK.length=y,Tle(n,d,zK),KK.length=p,Tle(t,c,KK))}else{for(s=0;s<o;s++)r++,n[c*o+s]=i[r];r++}}}function nh(e,t){let n=e;n===Number&&(n=_le);let i=n.packedLength,o=g(n.packedInterpolationLength,i),r=0,s;if(l(t)){let a=t.length;s=new Array(a);for(let c=0;c<a;c++){let d=t[c];d===Number&&(d=_le);let u=d.packedLength;i+=u,o+=g(d.packedInterpolationLength,u),s[c]=d}r=a}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=v_,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedLength=i,this._packedInterpolationLength=o,this._updateTableLength=!0,this._interpolationResult=new Array(o),this._definitionChanged=new ye,this._derivativeTypes=t,this._innerDerivativeTypes=s,this._inputOrder=r,this._forwardExtrapolationType=gd.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=gd.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(nh.prototype,{isConstant:{get:function(){return this._values.length===0}},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))}}});nh.prototype.getValue=function(e,t){let n=this._times,i=n.length;if(i===0)return;let o,r=this._innerType,s=this._values,a=Io(n,e,te.compare);if(a<0){if(a=~a,a===0){let Z=n[a];if(o=this._backwardExtrapolationDuration,this._backwardExtrapolationType===gd.NONE||o!==0&&te.secondsDifference(Z,e)>o)return;if(this._backwardExtrapolationType===gd.HOLD)return r.unpack(s,0,t)}if(a>=i){a=i-1;let Z=n[a];if(o=this._forwardExtrapolationDuration,this._forwardExtrapolationType===gd.NONE||o!==0&&te.secondsDifference(e,Z)>o)return;if(this._forwardExtrapolationType===gd.HOLD)return a=i-1,r.unpack(s,a*r.packedLength,t)}let c=this._xTable,d=this._yTable,u=this._interpolationAlgorithm,m=this._packedInterpolationLength,p=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let Z=Math.min(u.getRequiredDataPoints(this._interpolationDegree,p),i);Z!==this._numberOfPoints&&(this._numberOfPoints=Z,c.length=Z,d.length=Z*m)}let y=this._numberOfPoints-1;if(y<1)return;let f=0,x=i-1;if(x-f+1>=y+1){let Z=a-(y/2|0)-1;Z<f&&(Z=f);let G=Z+y;G>x&&(G=x,Z=G-y,Z<f&&(Z=f)),f=Z,x=G}let C=x-f+1;for(let Z=0;Z<C;++Z)c[Z]=te.secondsDifference(n[f+Z],n[x]);if(l(r.convertPackedArrayForInterpolation))r.convertPackedArrayForInterpolation(s,f,x,d);else{let Z=0,G=this._packedLength,I=f*G,P=(x+1)*G;for(;I<P;)d[Z]=s[I],I++,Z++}let V=te.secondsDifference(e,n[x]),L;if(p===0||!l(u.interpolate))L=u.interpolateOrderZero(V,c,d,m,this._interpolationResult);else{let Z=Math.floor(m/(p+1));L=u.interpolate(V,c,d,Z,p,p,this._interpolationResult)}return l(r.unpackInterpolationResult)?r.unpackInterpolationResult(L,s,f,x,t):r.unpack(L,0,t)}return r.unpack(s,a*this._packedLength,t)};nh.prototype.setInterpolationOptions=function(e){if(!l(e))return;let t=!1,n=e.interpolationAlgorithm,i=e.interpolationDegree;l(n)&&this._interpolationAlgorithm!==n&&(this._interpolationAlgorithm=n,t=!0),l(i)&&this._interpolationDegree!==i&&(this._interpolationDegree=i,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))};nh.prototype.addSample=function(e,t,n){let i=this._innerDerivativeTypes,o=l(i),r=this._innerType,s=[];if(s.push(e),r.pack(t,s,s.length),o){let a=i.length;for(let c=0;c<a;c++)i[c].pack(n[c],s,s.length)}w5(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};nh.prototype.addSamples=function(e,t,n){let i=this._innerDerivativeTypes,o=l(i),r=this._innerType,s=e.length,a=[];for(let c=0;c<s;c++)if(a.push(e[c]),r.pack(t[c],a,a.length),o){let d=n[c],u=i.length;for(let m=0;m<u;m++)i[m].pack(d[m],a,a.length)}w5(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};nh.prototype.addSamplesPackedArray=function(e,t){w5(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};nh.prototype.removeSample=function(e){let t=Io(this._times,e,te.compare);return t<0?!1:(Cle(this,t,1),!0)};function Cle(e,t,n){let i=e._packedLength;e._times.splice(t,n),e._values.splice(t*i,n*i),e._updateTableLength=!0,e._definitionChanged.raiseEvent(e)}nh.prototype.removeSamples=function(e){let t=this._times,n=Io(t,e.start,te.compare);n<0?n=~n:e.isStartIncluded||++n;let i=Io(t,e.stop,te.compare);i<0?i=~i:e.isStopIncluded&&++i,Cle(this,n,i-n)};nh.prototype.equals=function(e){if(this===e)return!0;if(!l(e)||this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;let t=this._derivativeTypes,n=l(t),i=e._derivativeTypes,o=l(i);if(n!==o)return!1;let r,s;if(n){if(s=t.length,s!==i.length)return!1;for(r=0;r<s;r++)if(t[r]!==i[r])return!1}let a=this._times,c=e._times;if(s=a.length,s!==c.length)return!1;for(r=0;r<s;r++)if(!te.equals(a[r],c[r]))return!1;let d=this._values,u=e._values;for(s=d.length,r=0;r<s;r++)if(d[r]!==u[r])return!1;return!0};nh._mergeNewSamples=w5;var _d=nh;function wu(e,t){t=g(t,0);let n;if(t>0){n=new Array(t);for(let i=0;i<t;i++)n[i]=h}this._numberOfDerivatives=t,this._property=new _d(h,n),this._definitionChanged=new ye,this._referenceFrame=g(e,ao.FIXED),this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(wu.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}}});wu.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,ao.FIXED,t)};wu.prototype.getValueInReferenceFrame=function(e,t,n){if(n=this._property.getValue(e,n),l(n))return Cp.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};wu.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};wu.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;this._property.addSample(e,t,n)};wu.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};wu.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};wu.prototype.removeSample=function(e){return this._property.removeSample(e)};wu.prototype.removeSamples=function(e){this._property.removeSamples(e)};wu.prototype.equals=function(e){return this===e||e instanceof wu&&z.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var aa=wu;var fOn=T(S(),1);var rOn=T(S(),1),Ize={HORIZONTAL:0,VERTICAL:1},ih=Object.freeze(Ize);var Xze=ih.HORIZONTAL,Wze=O.WHITE,Pze=O.BLACK,vze=0,wze=1;function x1(e){e=g(e,g.EMPTY_OBJECT),this._definitionChanged=new ye,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}Object.defineProperties(x1.prototype,{isConstant:{get:function(){return z.isConstant(this._orientation)&&z.isConstant(this._evenColor)&&z.isConstant(this._oddColor)&&z.isConstant(this._offset)&&z.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:le("orientation"),evenColor:le("evenColor"),oddColor:le("oddColor"),offset:le("offset"),repeat:le("repeat")});x1.prototype.getType=function(e){return"Stripe"};x1.prototype.getValue=function(e,t){return l(t)||(t={}),t.horizontal=z.getValueOrDefault(this._orientation,e,Xze)===ih.HORIZONTAL,t.evenColor=z.getValueOrClonedDefault(this._evenColor,e,Wze,t.evenColor),t.oddColor=z.getValueOrClonedDefault(this._oddColor,e,Pze,t.oddColor),t.offset=z.getValueOrDefault(this._offset,e,vze),t.repeat=z.getValueOrDefault(this._repeat,e,wze),t};x1.prototype.equals=function(e){return this===e||e instanceof x1&&z.equals(this._orientation,e._orientation)&&z.equals(this._evenColor,e._evenColor)&&z.equals(this._oddColor,e._oddColor)&&z.equals(this._offset,e._offset)&&z.equals(this._repeat,e._repeat)};var _1=x1;var COn=T(S(),1);function Ey(e){this._definitionChanged=new ye,this._intervals=new Xr,this._intervals.changedEvent.addEventListener(Ey.prototype._intervalsChanged,this),this._referenceFrame=g(e,ao.FIXED)}Object.defineProperties(Ey.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}}});Ey.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,ao.FIXED,t)};Ey.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._intervals.findDataForIntervalContainingDate(e);if(l(i))return Cp.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};Ey.prototype.equals=function(e){return this===e||e instanceof Ey&&this._intervals.equals(e._intervals,z.equals)&&this._referenceFrame===e._referenceFrame};Ey.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var G0=Ey;var EOn=T(S(),1);function A_(){this._definitionChanged=new ye,this._intervals=new Xr,this._intervals.changedEvent.addEventListener(A_.prototype._intervalsChanged,this)}Object.defineProperties(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(e,t){let n=this._intervals.findDataForIntervalContainingDate(e);return l(n)&&typeof n.clone=="function"?n.clone(t):n};A_.prototype.equals=function(e){return this===e||e instanceof A_&&this._intervals.equals(e._intervals,z.equals)};A_.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var E0=A_;var JOn=T(S(),1);var AOn=T(S(),1);function T1(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new ye,this._normalize=g(t,!0),this.position=e}Object.defineProperties(T1.prototype,{isConstant:{get:function(){return z.isConstant(this._position)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._position},set:function(e){let t=this._position;t!==e&&(l(t)&&this._subscription(),this._position=e,l(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 Fze=new h,Vle=new h,Lle=new te,JK=1/60;T1.prototype.getValue=function(e,t){return this._getValue(e,t)};T1.prototype._getValue=function(e,t,n){l(t)||(t=new h);let i=this._position;if(z.isConstant(i))return this._normalize?void 0:h.clone(h.ZERO,t);let o=i.getValue(e,Fze),r=i.getValue(te.addSeconds(e,JK,Lle),Vle);if(!l(o)||!l(r)&&(r=o,o=i.getValue(te.addSeconds(e,-JK,Lle),Vle),!l(o)))return;if(h.equals(o,r))return this._normalize?void 0:h.clone(h.ZERO,t);l(n)&&o.clone(n);let s=h.subtract(r,o,t);return this._normalize?h.normalize(s,t):h.divideByScalar(s,JK,t)};T1.prototype.equals=function(e){return this===e||e instanceof T1&&z.equals(this._position,e._position)};var M_=T1;function B2(e,t){this._velocityVectorProperty=new M_(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new ye,this.ellipsoid=g(t,oe.WGS84);let n=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){n._definitionChanged.raiseEvent(n)})}Object.defineProperties(B2.prototype,{isConstant:{get:function(){return z.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 Rle=new h,Aze=new h,Zle=new q;B2.prototype.getValue=function(e,t){let n=this._velocityVectorProperty._getValue(e,Aze,Rle);if(l(n))return Xt.rotationMatrixFromPositionVelocity(Rle,n,this._ellipsoid,Zle),Me.fromRotationMatrix(Zle,t)};B2.prototype.equals=function(e){return this===e||e instanceof B2&&z.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var O2=B2;function Iy(){}Iy.packedLength=h.packedLength;Iy.unpack=h.unpack;Iy.pack=h.pack;var QK;function Y2(e,t){return t[0]==="#"&&(t=QK+t),Z0.fromString(e,t)}function Gle(e,t,n){if(l(n.reference))return Y2(t,n.reference);if(l(n.velocityReference)){let i=Y2(t,n.velocityReference);switch(e){case h:case Iy:return new M_(i,e===Iy);case Me:return new O2(i)}}throw new me(`${JSON.stringify(n)} is not valid CZML.`)}function Mze(e,t){return new Lm(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var Ni=new h,zc=new D2,hc=new he,N_=new Ln,F5=new Me;function Nze(e){let t=e.rgbaf;if(l(t))return t;let n=e.rgba;if(!l(n))return;let i=n.length;if(i===O.packedLength)return[O.byteToFloat(n[0]),O.byteToFloat(n[1]),O.byteToFloat(n[2]),O.byteToFloat(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=O.byteToFloat(n[o+1]),t[o+2]=O.byteToFloat(n[o+2]),t[o+3]=O.byteToFloat(n[o+3]),t[o+4]=O.byteToFloat(n[o+4]);return t}function Ele(e,t){let n=g(e.uri,e);return l(t)?t.getDerivedResource({url:n}):Xe.createIfNeeded(n)}function Uze(e){let t=e.wsen;if(l(t))return t;let n=e.wsenDegrees;if(!l(n))return;let i=n.length;if(i===de.packedLength)return[W.toRadians(n[0]),W.toRadians(n[1]),W.toRadians(n[2]),W.toRadians(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=W.toRadians(n[o+1]),t[o+2]=W.toRadians(n[o+2]),t[o+3]=W.toRadians(n[o+3]),t[o+4]=W.toRadians(n[o+4]);return t}function kze(e){let t=e.length;if(zc.magnitude=1,t===2)return zc.clock=e[0],zc.cone=e[1],h.fromSpherical(zc,Ni),[Ni.x,Ni.y,Ni.z];let n=new Array(t/3*4);for(let i=0,o=0;i<t;i+=3,o+=4)n[o]=e[i],zc.clock=e[i+1],zc.cone=e[i+2],h.fromSpherical(zc,Ni),n[o+1]=Ni.x,n[o+2]=Ni.y,n[o+3]=Ni.z;return n}function Dze(e){let t=e.length;if(t===3)return zc.clock=e[0],zc.cone=e[1],zc.magnitude=e[2],h.fromSpherical(zc,Ni),[Ni.x,Ni.y,Ni.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],zc.clock=e[i+1],zc.cone=e[i+2],zc.magnitude=e[i+3],h.fromSpherical(zc,Ni),n[i+1]=Ni.x,n[i+2]=Ni.y,n[i+3]=Ni.z;return n}function Bze(e){let t=e.length;if(t===3)return hc.longitude=e[0],hc.latitude=e[1],hc.height=e[2],oe.WGS84.cartographicToCartesian(hc,Ni),[Ni.x,Ni.y,Ni.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],hc.longitude=e[i+1],hc.latitude=e[i+2],hc.height=e[i+3],oe.WGS84.cartographicToCartesian(hc,Ni),n[i+1]=Ni.x,n[i+2]=Ni.y,n[i+3]=Ni.z;return n}function Oze(e){let t=e.length;if(t===3)return hc.longitude=W.toRadians(e[0]),hc.latitude=W.toRadians(e[1]),hc.height=e[2],oe.WGS84.cartographicToCartesian(hc,Ni),[Ni.x,Ni.y,Ni.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],hc.longitude=W.toRadians(e[i+1]),hc.latitude=W.toRadians(e[i+2]),hc.height=e[i+3],oe.WGS84.cartographicToCartesian(hc,Ni),n[i+1]=Ni.x,n[i+2]=Ni.y,n[i+3]=Ni.z;return n}function jK(e){let t=e.cartesian;if(l(t))return t;let n=e.cartesianVelocity;if(l(n))return n;let i=e.unitCartesian;if(l(i))return i;let o=e.unitSpherical;if(l(o))return kze(o);let r=e.spherical;if(l(r))return Dze(r);let s=e.cartographicRadians;if(l(s))return Bze(s);let a=e.cartographicDegrees;if(l(a))return Oze(a);throw new me(`${JSON.stringify(e)} is not a valid CZML interval.`)}function Ile(e,t){h.unpack(e,t,Ni),h.normalize(Ni,Ni),h.pack(Ni,e,t)}function Yze(e){let t=jK(e);if(t.length===3)return Ile(t,0),t;for(let n=1;n<t.length;n+=4)Ile(t,n);return t}function Xle(e,t){Me.unpack(e,t,F5),Me.normalize(F5,F5),Me.pack(F5,e,t)}function Hze(e){let t=e.unitQuaternion;if(l(t)){if(t.length===4)return Xle(t,0),t;for(let n=1;n<t.length;n+=5)Xle(t,n)}return t}function Wle(e){return typeof e=="boolean"?Boolean:typeof e=="number"?Number:typeof e=="string"?String:e.hasOwnProperty("array")?Array:e.hasOwnProperty("boolean")?Boolean:e.hasOwnProperty("boundingRectangle")?De:e.hasOwnProperty("cartesian2")?B:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?h:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?Iy:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?O:e.hasOwnProperty("arcType")?jt:e.hasOwnProperty("classificationType")?Bn:e.hasOwnProperty("colorBlendMode")?ic:e.hasOwnProperty("cornerType")?Ii:e.hasOwnProperty("heightReference")?Qe:e.hasOwnProperty("horizontalOrigin")?bi:e.hasOwnProperty("date")?te:e.hasOwnProperty("labelStyle")?No:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?vt:e.hasOwnProperty("distanceDisplayCondition")?It:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?Me:e.hasOwnProperty("shadowMode")?Cn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?ih:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?de:e.hasOwnProperty("uri")?K2.default:e.hasOwnProperty("verticalOrigin")?vn:Object}function Kze(e,t,n){switch(e){case jt:return jt[g(t.arcType,t)];case Array:return t.array;case Boolean:return g(t.boolean,t);case De:return t.boundingRectangle;case B:return t.cartesian2;case h:return jK(t);case Iy:return Yze(t);case O:return Nze(t);case Bn:return Bn[g(t.classificationType,t)];case ic:return ic[g(t.colorBlendMode,t)];case Ii:return Ii[g(t.cornerType,t)];case Qe:return Qe[g(t.heightReference,t)];case bi:return bi[g(t.horizontalOrigin,t)];case Image:return Ele(t,n);case te:return te.fromIso8601(g(t.date,t));case No:return No[g(t.labelStyle,t)];case Number:return g(t.number,t);case vt:return t.nearFarScalar;case It:return t.distanceDisplayCondition;case Object:return g(g(t.object,t.value),t);case Me:return Hze(t);case vu:return g(t.number,t);case Cn:return Cn[g(g(t.shadowMode,t.shadows),t)];case String:return g(t.string,t);case ih:return ih[g(t.stripeOrientation,t)];case de:return Uze(t);case K2.default:return Ele(t,n);case vn:return vn[g(t.verticalOrigin,t)];default:throw new me(e)}}var zze={HERMITE:U2,LAGRANGE:k2,LINEAR:v_};function A5(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(l(n)||l(i))&&t.setInterpolationOptions({interpolationAlgorithm:zze[n],interpolationDegree:i});let o=e.forwardExtrapolationType;l(o)&&(t.forwardExtrapolationType=gd[o]);let r=e.forwardExtrapolationDuration;l(r)&&(t.forwardExtrapolationDuration=r);let s=e.backwardExtrapolationType;l(s)&&(t.backwardExtrapolationType=gd[s]);let a=e.backwardExtrapolationDuration;l(a)&&(t.backwardExtrapolationDuration=a)}var Ple={iso8601:void 0};function dr(e){if(l(e))return Ple.iso8601=e,Ln.fromIso8601(Ple)}function qK(e){let t=Be.MAXIMUM_INTERVAL.clone();return t.data=e,t}function vle(e){let t=new dc;return t.intervals.addInterval(qK(e)),t}function wle(e){let t=new ra(e.referenceFrame);return t.intervals.addInterval(qK(e)),t}function M5(e,t,n,i,o,r,s){let a=dr(i.interval);l(o)&&(l(a)?a=Ln.intersect(a,o,N_):a=o);let c,d,u,m=!l(i.reference)&&!l(i.velocityReference),p=l(a)&&!a.equals(Be.MAXIMUM_INTERVAL);if(i.delete===!0){if(!p){t[n]=void 0;return}return Hle(t[n],a)}let y=!1;if(m){if(d=Kze(e,i,r),!l(d))return;c=g(e.packedLength,1),u=g(d.length,1),y=!l(i.array)&&typeof d!="string"&&u>c&&e!==Object}let f=typeof e.unpack=="function"&&e!==vu;if(!y&&!p){m?t[n]=new ei(f?e.unpack(d,0):d):t[n]=Gle(e,s,i);return}let x=t[n],_,C=i.epoch;if(l(C)&&(_=te.fromIso8601(C)),y&&!p){x instanceof _d||(t[n]=x=new _d(e)),x.addSamplesPackedArray(d,_),A5(i,x);return}let V;if(!y&&p){a=a.clone(),m?a.data=f?e.unpack(d,0):d:a.data=Gle(e,s,i),l(x)||(t[n]=x=m?new E0:new dc),m&&x instanceof E0?x.intervals.addInterval(a):x instanceof dc?(m&&(a.data=new ei(a.data)),x.intervals.addInterval(a)):(t[n]=x=vle(x),m&&(a.data=new ei(a.data)),x.intervals.addInterval(a));return}l(x)||(t[n]=x=new dc),x instanceof dc||(t[n]=x=vle(x));let L=x.intervals;V=L.findInterval(a),(!l(V)||!(V.data instanceof _d))&&(V=a.clone(),V.data=new _d(e),L.addInterval(V)),V.data.addSamplesPackedArray(d,_),A5(i,V.data)}function Hle(e,t){if(e instanceof _d){e.removeSamples(t);return}else if(e instanceof E0){e.intervals.removeInterval(t);return}else if(e instanceof dc){let n=e.intervals;for(let i=0;i<n.length;++i){let o=Ln.intersect(n.get(i),t,N_);o.isEmpty||Hle(o.data,t)}n.removeInterval(t);return}}function xe(e,t,n,i,o,r,s){if(l(i))if(Array.isArray(i))for(let a=0,c=i.length;a<c;++a)M5(e,t,n,i[a],o,r,s);else M5(e,t,n,i,o,r,s)}function Fle(e,t,n,i,o,r){let s=dr(n.interval);l(i)&&(l(s)?s=Ln.intersect(s,i,N_):s=i);let a=l(n.cartesianVelocity)?1:0,c=h.packedLength*(a+1),d,u,m=!l(n.reference),p=l(s)&&!s.equals(Be.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return Kle(e[t],s)}let y,f=!1;if(m&&(l(n.referenceFrame)&&(y=ao[n.referenceFrame]),y=g(y,ao.FIXED),d=jK(n),u=g(d.length,1),f=u>c),!f&&!p){m?e[t]=new wc(h.unpack(d),y):e[t]=Y2(r,n.reference);return}let x=e[t],_,C=n.epoch;if(l(C)&&(_=te.fromIso8601(C)),f&&!p){(!(x instanceof aa)||l(y)&&x.referenceFrame!==y)&&(e[t]=x=new aa(y,a)),x.addSamplesPackedArray(d,_),A5(n,x);return}let V;if(!f&&p){s=s.clone(),m?s.data=h.unpack(d):s.data=Y2(r,n.reference),l(x)||(m?x=new G0(y):x=new ra(y),e[t]=x),m&&x instanceof G0&&l(y)&&x.referenceFrame===y?x.intervals.addInterval(s):x instanceof ra?(m&&(s.data=new wc(s.data,y)),x.intervals.addInterval(s)):(e[t]=x=wle(x),m&&(s.data=new wc(s.data,y)),x.intervals.addInterval(s));return}l(x)?x instanceof ra||(e[t]=x=wle(x)):e[t]=x=new ra(y);let L=x.intervals;V=L.findInterval(s),(!l(V)||!(V.data instanceof aa)||l(y)&&V.data.referenceFrame!==y)&&(V=s.clone(),V.data=new aa(y,a),L.addInterval(V)),V.data.addSamplesPackedArray(d,_),A5(n,V.data)}function Kle(e,t){if(e instanceof aa){e.removeSamples(t);return}else if(e instanceof G0){e.intervals.removeInterval(t);return}else if(e instanceof ra){let n=e.intervals;for(let i=0;i<n.length;++i){let o=Ln.intersect(n.get(i),t,N_);o.isEmpty||Kle(o.data,t)}n.removeInterval(t);return}}function zle(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)Fle(e,t,n[s],i,o,r);else Fle(e,t,n,i,o,r)}function Ale(e,t,n,i){l(n.references)?N5(e,t,n.references,n.interval,i,g1,dc):(l(n.cartesian2)?n.array=B.unpackArray(n.cartesian2):l(n.cartesian)&&(n.array=B.unpackArray(n.cartesian)),l(n.array)&&xe(Array,e,t,n,void 0,void 0,i))}function Mle(e,t,n,i,o,r){let s=dr(n.interval);l(i)&&(l(s)?s=Ln.intersect(s,i,N_):s=i);let a=e[t],c,d;if(l(s)){a instanceof t1||(a=new t1,e[t]=a);let m=a.intervals;d=m.findInterval({start:s.start,stop:s.stop}),l(d)?c=d.data:(d=s.clone(),m.addInterval(d))}else c=a;let u;l(n.solidColor)?(c instanceof Ut||(c=new Ut),u=n.solidColor,xe(O,c,"color",u.color,void 0,void 0,r)):l(n.grid)?(c instanceof d1||(c=new d1),u=n.grid,xe(O,c,"color",u.color,void 0,o,r),xe(Number,c,"cellAlpha",u.cellAlpha,void 0,o,r),xe(B,c,"lineCount",u.lineCount,void 0,o,r),xe(B,c,"lineThickness",u.lineThickness,void 0,o,r),xe(B,c,"lineOffset",u.lineOffset,void 0,o,r)):l(n.image)?(c instanceof Zb||(c=new Zb),u=n.image,xe(Image,c,"image",u.image,void 0,o,r),xe(B,c,"repeat",u.repeat,void 0,o,r),xe(O,c,"color",u.color,void 0,o,r),xe(Boolean,c,"transparent",u.transparent,void 0,o,r)):l(n.stripe)?(c instanceof _1||(c=new _1),u=n.stripe,xe(ih,c,"orientation",u.orientation,void 0,o,r),xe(O,c,"evenColor",u.evenColor,void 0,o,r),xe(O,c,"oddColor",u.oddColor,void 0,o,r),xe(Number,c,"offset",u.offset,void 0,o,r),xe(Number,c,"repeat",u.repeat,void 0,o,r)):l(n.polylineOutline)?(c instanceof Zy||(c=new Zy),u=n.polylineOutline,xe(O,c,"color",u.color,void 0,o,r),xe(O,c,"outlineColor",u.outlineColor,void 0,o,r),xe(Number,c,"outlineWidth",u.outlineWidth,void 0,o,r)):l(n.polylineGlow)?(c instanceof b1||(c=new b1),u=n.polylineGlow,xe(O,c,"color",u.color,void 0,o,r),xe(Number,c,"glowPower",u.glowPower,void 0,o,r),xe(Number,c,"taperPower",u.taperPower,void 0,o,r)):l(n.polylineArrow)?(c instanceof m1||(c=new m1),u=n.polylineArrow,xe(O,c,"color",u.color,void 0,void 0,r)):l(n.polylineDash)?(c instanceof f1||(c=new f1),u=n.polylineDash,xe(O,c,"color",u.color,void 0,void 0,r),xe(O,c,"gapColor",u.gapColor,void 0,void 0,r),xe(Number,c,"dashLength",u.dashLength,void 0,o,r),xe(Number,c,"dashPattern",u.dashPattern,void 0,o,r)):l(n.checkerboard)&&(c instanceof $C||(c=new $C),u=n.checkerboard,xe(O,c,"evenColor",u.evenColor,void 0,o,r),xe(O,c,"oddColor",u.oddColor,void 0,o,r),xe(B,c,"repeat",u.repeat,void 0,o,r)),l(d)?d.data=c:e[t]=c}function Td(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)Mle(e,t,n[s],i,o,r);else Mle(e,t,n,i,o,r)}function Jze(e,t,n,i){let o=t.name;l(o)&&(e.name=t.name)}function Qze(e,t,n,i){let o=t.description;l(o)&&xe(String,e,"description",o,void 0,i,n)}function jze(e,t,n,i){let o=t.position;l(o)&&zle(e,"position",o,void 0,i,n)}function qze(e,t,n,i){let o=t.viewFrom;l(o)&&xe(h,e,"viewFrom",o,void 0,i,n)}function $ze(e,t,n,i){let o=t.orientation;l(o)&&xe(Me,e,"orientation",o,void 0,i,n)}function eJe(e,t,n,i){let o=t.properties;if(l(o)){l(e.properties)||(e.properties=new _l);for(let r in o)if(o.hasOwnProperty(r)){e.properties.hasProperty(r)||e.properties.addProperty(r);let s=o[r];if(Array.isArray(s))for(let a=0,c=s.length;a<c;++a)M5(Wle(s[a]),e.properties,r,s[a],void 0,i,n);else M5(Wle(s),e.properties,r,s,void 0,i,n)}}}function N5(e,t,n,i,o,r,s){let a=n.map(function(c){return Y2(o,c)});if(l(i)){i=dr(i);let c=e[t];if(!(c instanceof s)){let d=new s;d.intervals.addInterval(qK(c)),e[t]=c=d}i.data=new r(a),c.intervals.addInterval(i)}else e[t]=new r(a)}function Nle(e,t,n,i){let o=n.references;l(o)?N5(e,t,o,n.interval,i,g1,dc):xe(Array,e,t,n,void 0,void 0,i)}function Ule(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)Nle(e,t,n[o],i);else Nle(e,t,n,i)}function kle(e,t,n,i){let o=n.references;l(o)?N5(e,t,o,n.interval,i,R0,ra):(l(n.cartesian)?n.array=h.unpackArray(n.cartesian):l(n.cartographicRadians)?n.array=h.fromRadiansArrayHeights(n.cartographicRadians,oe.WGS84):l(n.cartographicDegrees)&&(n.array=h.fromDegreesArrayHeights(n.cartographicDegrees,oe.WGS84)),l(n.array)&&xe(Array,e,t,n,void 0,void 0,i))}function z2(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)kle(e,t,n[o],i);else kle(e,t,n,i)}function tJe(e){return h.unpackArray(e)}function nJe(e){return h.fromRadiansArrayHeights(e,oe.WGS84)}function iJe(e){return h.fromDegreesArrayHeights(e,oe.WGS84)}function Dle(e,t,n,i){let o=n.references;if(l(o)){let r=o.map(function(s){let a={};return N5(a,"positions",s,n.interval,i,R0,ra),a.positions});e[t]=new R0(r)}else l(n.cartesian)?n.array=n.cartesian.map(tJe):l(n.cartographicRadians)?n.array=n.cartographicRadians.map(nJe):l(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(iJe)),l(n.array)&&xe(Array,e,t,n,void 0,void 0,i)}function oJe(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)Dle(e,t,n[o],i);else Dle(e,t,n,i)}function rJe(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;o++)Ale(e,t,n[o],i);else Ale(e,t,n,i)}function sJe(e,t,n,i){let o=t.availability;if(!l(o))return;let r;if(Array.isArray(o))for(let s=0,a=o.length;s<a;++s)l(r)||(r=new Xr),r.addInterval(dr(o[s]));else r=new Xr,r.addInterval(dr(o));e.availability=r}function aJe(e,t,n,i,o){l(t)&&xe(Iy,e,"alignedAxis",t,n,i,o)}function cJe(e,t,n,i){let o=t.billboard;if(!l(o))return;let r=dr(o.interval),s=e.billboard;l(s)||(e.billboard=s=new Da),xe(Boolean,s,"show",o.show,r,i,n),xe(Image,s,"image",o.image,r,i,n),xe(Number,s,"scale",o.scale,r,i,n),xe(B,s,"pixelOffset",o.pixelOffset,r,i,n),xe(h,s,"eyeOffset",o.eyeOffset,r,i,n),xe(bi,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),xe(vn,s,"verticalOrigin",o.verticalOrigin,r,i,n),xe(Qe,s,"heightReference",o.heightReference,r,i,n),xe(O,s,"color",o.color,r,i,n),xe(vu,s,"rotation",o.rotation,r,i,n),aJe(s,o.alignedAxis,r,i,n),xe(Boolean,s,"sizeInMeters",o.sizeInMeters,r,i,n),xe(Number,s,"width",o.width,r,i,n),xe(Number,s,"height",o.height,r,i,n),xe(vt,s,"scaleByDistance",o.scaleByDistance,r,i,n),xe(vt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),xe(vt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),xe(De,s,"imageSubRegion",o.imageSubRegion,r,i,n),xe(It,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),xe(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function lJe(e,t,n,i){let o=t.box;if(!l(o))return;let r=dr(o.interval),s=e.box;l(s)||(e.box=s=new yx),xe(Boolean,s,"show",o.show,r,i,n),xe(h,s,"dimensions",o.dimensions,r,i,n),xe(Qe,s,"heightReference",o.heightReference,r,i,n),xe(Boolean,s,"fill",o.fill,r,i,n),Td(s,"material",o.material,r,i,n),xe(Boolean,s,"outline",o.outline,r,i,n),xe(O,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(Cn,s,"shadows",o.shadows,r,i,n),xe(It,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function dJe(e,t,n,i){let o=t.corridor;if(!l(o))return;let r=dr(o.interval),s=e.corridor;l(s)||(e.corridor=s=new xx),xe(Boolean,s,"show",o.show,r,i,n),z2(s,"positions",o.positions,n),xe(Number,s,"width",o.width,r,i,n),xe(Number,s,"height",o.height,r,i,n),xe(Qe,s,"heightReference",o.heightReference,r,i,n),xe(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),xe(Qe,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),xe(Ii,s,"cornerType",o.cornerType,r,i,n),xe(Number,s,"granularity",o.granularity,r,i,n),xe(Boolean,s,"fill",o.fill,r,i,n),Td(s,"material",o.material,r,i,n),xe(Boolean,s,"outline",o.outline,r,i,n),xe(O,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(Cn,s,"shadows",o.shadows,r,i,n),xe(It,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),xe(Bn,s,"classificationType",o.classificationType,r,i,n),xe(Number,s,"zIndex",o.zIndex,r,i,n)}function uJe(e,t,n,i){let o=t.cylinder;if(!l(o))return;let r=dr(o.interval),s=e.cylinder;l(s)||(e.cylinder=s=new _x),xe(Boolean,s,"show",o.show,r,i,n),xe(Number,s,"length",o.length,r,i,n),xe(Number,s,"topRadius",o.topRadius,r,i,n),xe(Number,s,"bottomRadius",o.bottomRadius,r,i,n),xe(Qe,s,"heightReference",o.heightReference,r,i,n),xe(Boolean,s,"fill",o.fill,r,i,n),Td(s,"material",o.material,r,i,n),xe(Boolean,s,"outline",o.outline,r,i,n),xe(O,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),xe(Number,s,"slices",o.slices,r,i,n),xe(Cn,s,"shadows",o.shadows,r,i,n),xe(It,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function mJe(e,t){let n=e.version;if(l(n)&&typeof n=="string"){let r=n.split(".");if(r.length===2){if(r[0]!=="1")throw new me("Cesium only supports CZML version 1.");t._version=n}}if(!l(t._version))throw new me("CZML version information invalid. It is expected to be a property on the document object in the <Major>.<Minor> version format.");let i=t._documentPacket;l(e.name)&&(i.name=e.name);let o=e.clock;if(l(o)){let r=i.clock;l(r)?(r.interval=g(o.interval,r.interval),r.currentTime=g(o.currentTime,r.currentTime),r.range=g(o.range,r.range),r.step=g(o.step,r.step),r.multiplier=g(o.multiplier,r.multiplier)):i.clock={interval:o.interval,currentTime:o.currentTime,range:o.range,step:o.step,multiplier:o.multiplier}}}function hJe(e,t,n,i){let o=t.ellipse;if(!l(o))return;let r=dr(o.interval),s=e.ellipse;l(s)||(e.ellipse=s=new Tx),xe(Boolean,s,"show",o.show,r,i,n),xe(Number,s,"semiMajorAxis",o.semiMajorAxis,r,i,n),xe(Number,s,"semiMinorAxis",o.semiMinorAxis,r,i,n),xe(Number,s,"height",o.height,r,i,n),xe(Qe,s,"heightReference",o.heightReference,r,i,n),xe(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),xe(Qe,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),xe(vu,s,"rotation",o.rotation,r,i,n),xe(vu,s,"stRotation",o.stRotation,r,i,n),xe(Number,s,"granularity",o.granularity,r,i,n),xe(Boolean,s,"fill",o.fill,r,i,n),Td(s,"material",o.material,r,i,n),xe(Boolean,s,"outline",o.outline,r,i,n),xe(O,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),xe(Cn,s,"shadows",o.shadows,r,i,n),xe(It,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),xe(Bn,s,"classificationType",o.classificationType,r,i,n),xe(Number,s,"zIndex",o.zIndex,r,i,n)}function fJe(e,t,n,i){let o=t.ellipsoid;if(!l(o))return;let r=dr(o.interval),s=e.ellipsoid;l(s)||(e.ellipsoid=s=new Sx),xe(Boolean,s,"show",o.show,r,i,n),xe(h,s,"radii",o.radii,r,i,n),xe(h,s,"innerRadii",o.innerRadii,r,i,n),xe(Number,s,"minimumClock",o.minimumClock,r,i,n),xe(Number,s,"maximumClock",o.maximumClock,r,i,n),xe(Number,s,"minimumCone",o.minimumCone,r,i,n),xe(Number,s,"maximumCone",o.maximumCone,r,i,n),xe(Qe,s,"heightReference",o.heightReference,r,i,n),xe(Boolean,s,"fill",o.fill,r,i,n),Td(s,"material",o.material,r,i,n),xe(Boolean,s,"outline",o.outline,r,i,n),xe(O,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(Number,s,"stackPartitions",o.stackPartitions,r,i,n),xe(Number,s,"slicePartitions",o.slicePartitions,r,i,n),xe(Number,s,"subdivisions",o.subdivisions,r,i,n),xe(Cn,s,"shadows",o.shadows,r,i,n),xe(It,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function pJe(e,t,n,i){let o=t.label;if(!l(o))return;let r=dr(o.interval),s=e.label;l(s)||(e.label=s=new Sm),xe(Boolean,s,"show",o.show,r,i,n),xe(String,s,"text",o.text,r,i,n),xe(String,s,"font",o.font,r,i,n),xe(No,s,"style",o.style,r,i,n),xe(Number,s,"scale",o.scale,r,i,n),xe(Boolean,s,"showBackground",o.showBackground,r,i,n),xe(O,s,"backgroundColor",o.backgroundColor,r,i,n),xe(B,s,"backgroundPadding",o.backgroundPadding,r,i,n),xe(B,s,"pixelOffset",o.pixelOffset,r,i,n),xe(h,s,"eyeOffset",o.eyeOffset,r,i,n),xe(bi,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),xe(vn,s,"verticalOrigin",o.verticalOrigin,r,i,n),xe(Qe,s,"heightReference",o.heightReference,r,i,n),xe(O,s,"fillColor",o.fillColor,r,i,n),xe(O,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(vt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),xe(vt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),xe(vt,s,"scaleByDistance",o.scaleByDistance,r,i,n),xe(It,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),xe(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function bJe(e,t,n,i){let o=t.model;if(!l(o))return;let r=dr(o.interval),s=e.model;l(s)||(e.model=s=new Lp),xe(Boolean,s,"show",o.show,r,i,n),xe(K2.default,s,"uri",o.gltf,r,i,n),xe(Number,s,"scale",o.scale,r,i,n),xe(Number,s,"minimumPixelSize",o.minimumPixelSize,r,i,n),xe(Number,s,"maximumScale",o.maximumScale,r,i,n),xe(Boolean,s,"incrementallyLoadTextures",o.incrementallyLoadTextures,r,i,n),xe(Boolean,s,"runAnimations",o.runAnimations,r,i,n),xe(Boolean,s,"clampAnimations",o.clampAnimations,r,i,n),xe(Cn,s,"shadows",o.shadows,r,i,n),xe(Qe,s,"heightReference",o.heightReference,r,i,n),xe(O,s,"silhouetteColor",o.silhouetteColor,r,i,n),xe(Number,s,"silhouetteSize",o.silhouetteSize,r,i,n),xe(O,s,"color",o.color,r,i,n),xe(ic,s,"colorBlendMode",o.colorBlendMode,r,i,n),xe(Number,s,"colorBlendAmount",o.colorBlendAmount,r,i,n),xe(It,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n);let a,c,d=o.nodeTransformations;if(l(d))if(Array.isArray(d))for(a=0,c=d.length;a<c;++a)Ble(s,d[a],r,i,n);else Ble(s,d,r,i,n);let u=o.articulations;if(l(u))if(Array.isArray(u))for(a=0,c=u.length;a<c;++a)Ole(s,u[a],r,i,n);else Ole(s,u,r,i,n)}function Ble(e,t,n,i,o){let r=dr(t.interval);l(n)&&(l(r)?r=Ln.intersect(r,n,N_):r=n);let s=e.nodeTransformations,a=Object.keys(t);for(let c=0,d=a.length;c<d;++c){let u=a[c];if(u==="interval")continue;let m=t[u];if(!l(m))continue;l(s)||(e.nodeTransformations=s=new _l),s.hasProperty(u)||s.addProperty(u);let p=s[u];l(p)||(s[u]=p=new Cx),xe(h,p,"translation",m.translation,r,i,o),xe(Me,p,"rotation",m.rotation,r,i,o),xe(h,p,"scale",m.scale,r,i,o)}}function Ole(e,t,n,i,o){let r=dr(t.interval);l(n)&&(l(r)?r=Ln.intersect(r,n,N_):r=n);let s=e.articulations,a=Object.keys(t);for(let c=0,d=a.length;c<d;++c){let u=a[c];if(u==="interval")continue;let m=t[u];l(m)&&(l(s)||(e.articulations=s=new _l),s.hasProperty(u)||s.addProperty(u),xe(Number,s,u,m,r,i,o))}}function yJe(e,t,n,i){let o=t.path;if(!l(o))return;let r=dr(o.interval),s=e.path;l(s)||(e.path=s=new Rp),xe(Boolean,s,"show",o.show,r,i,n),xe(Number,s,"leadTime",o.leadTime,r,i,n),xe(Number,s,"trailTime",o.trailTime,r,i,n),xe(Number,s,"width",o.width,r,i,n),xe(Number,s,"resolution",o.resolution,r,i,n),Td(s,"material",o.material,r,i,n),xe(It,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function gJe(e,t,n,i){let o=t.point;if(!l(o))return;let r=dr(o.interval),s=e.point;l(s)||(e.point=s=new Lx),xe(Boolean,s,"show",o.show,r,i,n),xe(Number,s,"pixelSize",o.pixelSize,r,i,n),xe(Qe,s,"heightReference",o.heightReference,r,i,n),xe(O,s,"color",o.color,r,i,n),xe(O,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(vt,s,"scaleByDistance",o.scaleByDistance,r,i,n),xe(vt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),xe(It,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),xe(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function H2(e){this.polygon=e,this._definitionChanged=new ye}Object.defineProperties(H2.prototype,{isConstant:{get:function(){let e=this.polygon._positions,t=this.polygon._holes;return(!l(e)||e.isConstant)&&(!l(t)||t.isConstant)}},definitionChanged:{get:function(){return this._definitionChanged}}});H2.prototype.getValue=function(e,t){let n;l(this.polygon._positions)&&(n=this.polygon._positions.getValue(e));let i;return l(this.polygon._holes)&&(i=this.polygon._holes.getValue(e),l(i)&&(i=i.map(function(o){return new Va(o)}))),l(t)?(t.positions=n,t.holes=i,t):new Va(n,i)};H2.prototype.equals=function(e){return this===e||e instanceof H2&&z.equals(this.polygon._positions,e.polygon._positions)&&z.equals(this.polygon._holes,e.polygon._holes)};function xJe(e,t,n,i){let o=t.polygon;if(!l(o))return;let r=dr(o.interval),s=e.polygon;l(s)||(e.polygon=s=new Cm),xe(Boolean,s,"show",o.show,r,i,n),z2(s,"_positions",o.positions,n),oJe(s,"_holes",o.holes,n),(l(s._positions)||l(s._holes))&&(s.hierarchy=new H2(s)),xe(Number,s,"height",o.height,r,i,n),xe(Qe,s,"heightReference",o.heightReference,r,i,n),xe(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),xe(Qe,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),xe(vu,s,"stRotation",o.stRotation,r,i,n),xe(Number,s,"granularity",o.granularity,r,i,n),xe(Boolean,s,"fill",o.fill,r,i,n),Td(s,"material",o.material,r,i,n),xe(Boolean,s,"outline",o.outline,r,i,n),xe(O,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(Boolean,s,"perPositionHeight",o.perPositionHeight,r,i,n),xe(Boolean,s,"closeTop",o.closeTop,r,i,n),xe(Boolean,s,"closeBottom",o.closeBottom,r,i,n),xe(jt,s,"arcType",o.arcType,r,i,n),xe(Cn,s,"shadows",o.shadows,r,i,n),xe(It,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),xe(Bn,s,"classificationType",o.classificationType,r,i,n),xe(Number,s,"zIndex",o.zIndex,r,i,n)}function _Je(e){return e?jt.GEODESIC:jt.NONE}function TJe(e,t,n,i){let o=t.polyline;if(!l(o))return;let r=dr(o.interval),s=e.polyline;if(l(s)||(e.polyline=s=new $a),xe(Boolean,s,"show",o.show,r,i,n),z2(s,"positions",o.positions,n),xe(Number,s,"width",o.width,r,i,n),xe(Number,s,"granularity",o.granularity,r,i,n),Td(s,"material",o.material,r,i,n),Td(s,"depthFailMaterial",o.depthFailMaterial,r,i,n),xe(jt,s,"arcType",o.arcType,r,i,n),xe(Boolean,s,"clampToGround",o.clampToGround,r,i,n),xe(Cn,s,"shadows",o.shadows,r,i,n),xe(It,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),xe(Bn,s,"classificationType",o.classificationType,r,i,n),xe(Number,s,"zIndex",o.zIndex,r,i,n),l(o.followSurface)&&!l(o.arcType)){let a={};xe(Boolean,a,"followSurface",o.followSurface,r,i,n),s.arcType=Mze(a.followSurface,_Je)}}function SJe(e,t,n,i){let o=t.polylineVolume;if(!l(o))return;let r=dr(o.interval),s=e.polylineVolume;l(s)||(e.polylineVolume=s=new Rx),z2(s,"positions",o.positions,n),rJe(s,"shape",o.shape,n),xe(Boolean,s,"show",o.show,r,i,n),xe(Ii,s,"cornerType",o.cornerType,r,i,n),xe(Boolean,s,"fill",o.fill,r,i,n),Td(s,"material",o.material,r,i,n),xe(Boolean,s,"outline",o.outline,r,i,n),xe(O,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(Number,s,"granularity",o.granularity,r,i,n),xe(Cn,s,"shadows",o.shadows,r,i,n),xe(It,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function CJe(e,t,n,i){let o=t.rectangle;if(!l(o))return;let r=dr(o.interval),s=e.rectangle;l(s)||(e.rectangle=s=new Vm),xe(Boolean,s,"show",o.show,r,i,n),xe(de,s,"coordinates",o.coordinates,r,i,n),xe(Number,s,"height",o.height,r,i,n),xe(Qe,s,"heightReference",o.heightReference,r,i,n),xe(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),xe(Qe,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),xe(vu,s,"rotation",o.rotation,r,i,n),xe(vu,s,"stRotation",o.stRotation,r,i,n),xe(Number,s,"granularity",o.granularity,r,i,n),xe(Boolean,s,"fill",o.fill,r,i,n),Td(s,"material",o.material,r,i,n),xe(Boolean,s,"outline",o.outline,r,i,n),xe(O,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(Cn,s,"shadows",o.shadows,r,i,n),xe(It,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),xe(Bn,s,"classificationType",o.classificationType,r,i,n),xe(Number,s,"zIndex",o.zIndex,r,i,n)}function VJe(e,t,n,i){let o=t.tileset;if(!l(o))return;let r=dr(o.interval),s=e.tileset;l(s)||(e.tileset=s=new Vx),xe(Boolean,s,"show",o.show,r,i,n),xe(K2.default,s,"uri",o.uri,r,i,n),xe(Number,s,"maximumScreenSpaceError",o.maximumScreenSpaceError,r,i,n)}function LJe(e,t,n,i){let o=t.wall;if(!l(o))return;let r=dr(o.interval),s=e.wall;l(s)||(e.wall=s=new Zp),xe(Boolean,s,"show",o.show,r,i,n),z2(s,"positions",o.positions,n),Ule(s,"minimumHeights",o.minimumHeights,n),Ule(s,"maximumHeights",o.maximumHeights,n),xe(Number,s,"granularity",o.granularity,r,i,n),xe(Boolean,s,"fill",o.fill,r,i,n),Td(s,"material",o.material,r,i,n),xe(Boolean,s,"outline",o.outline,r,i,n),xe(O,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(Cn,s,"shadows",o.shadows,r,i,n),xe(It,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function Yle(e,t,n,i,o){let r=e.id;if(l(r)||(r=Hn()),QK=r,!l(o._version)&&r!=="document")throw new me("The first CZML packet is required to be the document object.");if(e.delete===!0)t.removeById(r);else if(r==="document")mJe(e,o);else{let s=t.getOrCreateEntity(r),a=e.parent;l(a)&&(s.parent=t.getOrCreateEntity(a));for(let c=n.length-1;c>-1;c--)n[c](s,e,t,i)}QK=void 0}function RJe(e){let t,n=e._documentPacket.clock;if(!l(n)){if(!l(e._clock)){let o=e._entityCollection.computeAvailability();if(!o.start.equals(Be.MINIMUM_VALUE)){let r=o.start,s=o.stop,a=te.secondsDifference(s,r),c=Math.round(a/120);return t=new th,t.startTime=te.clone(r),t.stopTime=te.clone(s),t.clockRange=vr.LOOP_STOP,t.multiplier=c,t.currentTime=te.clone(r),t.clockStep=yo.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}l(e._clock)?t=e._clock.clone():(t=new th,t.startTime=Be.MINIMUM_VALUE.clone(),t.stopTime=Be.MAXIMUM_VALUE.clone(),t.currentTime=Be.MINIMUM_VALUE.clone(),t.clockRange=vr.LOOP_STOP,t.clockStep=yo.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=dr(n.interval);return l(i)&&(t.startTime=i.start,t.stopTime=i.stop),l(n.currentTime)&&(t.currentTime=te.fromIso8601(n.currentTime)),l(n.range)&&(t.clockRange=g(vr[n.range],vr.LOOP_STOP)),l(n.step)&&(t.clockStep=g(yo[n.step],yo.SYSTEM_CLOCK_MULTIPLIER)),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function Jle(e,t,n,i){n=g(n,g.EMPTY_OBJECT);let o=t,r=n.sourceUri,s=n.credit;if(typeof s=="string"&&(s=new Vt(s)),e._credit=s,typeof t=="string"||t instanceof Xe){t=Xe.createIfNeeded(t),o=t.fetchJson(),r=g(r,t.clone());let a=e._resourceCredits,c=t.credits;if(l(c)){let d=c.length;for(let u=0;u<d;u++)a.push(c[u])}}return r=Xe.createIfNeeded(r),Wr.setLoading(e,!0),Promise.resolve(o).then(function(a){return ZJe(e,a,r,i)}).catch(function(a){return Wr.setLoading(e,!1),e._error.raiseEvent(e,a),console.log(a),Promise.reject(a)})}function ZJe(e,t,n,i){Wr.setLoading(e,!0);let o=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new Qle,o.removeAll()),wl._processCzml(t,o,n,void 0,e);let r=RJe(e),s=e._documentPacket;return l(s.name)&&e._name!==s.name?(e._name=s.name,r=!0):!l(e._name)&&l(n)&&(e._name=V0(n.getUrlComponent()),r=!0),Wr.setLoading(e,!1),r&&e._changed.raiseEvent(e),e}function Qle(){this.name=void 0,this.clock=void 0}function wl(e){this._name=e,this._changed=new ye,this._error=new ye,this._isLoading=!1,this._loading=new ye,this._clock=void 0,this._documentPacket=new Qle,this._version=void 0,this._entityCollection=new ks(this),this._entityCluster=new bd,this._credit=void 0,this._resourceCredits=[]}wl.load=function(e,t){return new wl().load(e,t)};Object.defineProperties(wl.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}},credit:{get:function(){return this._credit}}});wl.updaters=[cJe,lJe,dJe,uJe,hJe,fJe,pJe,bJe,Jze,Qze,yJe,gJe,xJe,TJe,SJe,eJe,CJe,jze,VJe,qze,LJe,$ze,sJe];wl.prototype.process=function(e,t){return Jle(this,e,t,!1)};wl.prototype.load=function(e,t){return Jle(this,e,t,!0)};wl.prototype.update=function(e){return!0};wl.processPacketData=xe;wl.processPositionPacketData=zle;wl.processMaterialPacketData=Td;wl._processCzml=function(e,t,n,i,o){if(i=g(i,wl.updaters),Array.isArray(e))for(let r=0,s=e.length;r<s;++r)Yle(e[r],t,i,n,o);else Yle(e,t,i,n,o)};var J2=wl;var NHn=T(S(),1);function Jc(){this._dataSources=[],this._dataSourceAdded=new ye,this._dataSourceRemoved=new ye,this._dataSourceMoved=new ye}Object.defineProperties(Jc.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}}});Jc.prototype.add=function(e){let t=this,n=this._dataSources;return Promise.resolve(e).then(function(i){return n===t._dataSources&&(t._dataSources.push(i),t._dataSourceAdded.raiseEvent(t,i)),i})};Jc.prototype.remove=function(e,t){t=g(t,!1);let n=this._dataSources.indexOf(e);return n!==-1?(this._dataSources.splice(n,1),this._dataSourceRemoved.raiseEvent(this,e),t&&typeof e.destroy=="function"&&e.destroy(),!0):!1};Jc.prototype.removeAll=function(e){e=g(e,!1);let t=this._dataSources;for(let n=0,i=t.length;n<i;++n){let o=t[n];this._dataSourceRemoved.raiseEvent(this,o),e&&typeof o.destroy=="function"&&o.destroy()}this._dataSources=[]};Jc.prototype.contains=function(e){return this.indexOf(e)!==-1};Jc.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};Jc.prototype.get=function(e){return this._dataSources[e]};Jc.prototype.getByName=function(e){return this._dataSources.filter(function(t){return t.name===e})};function U5(e,t){return e.indexOf(t)}function jle(e,t,n){let i=e._dataSources,o=i.length-1;if(t=W.clamp(t,0,o),n=W.clamp(n,0,o),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,e.dataSourceMoved.raiseEvent(r,n,t)}Jc.prototype.raise=function(e){let t=U5(this._dataSources,e);jle(this,t,t+1)};Jc.prototype.lower=function(e){let t=U5(this._dataSources,e);jle(this,t,t-1)};Jc.prototype.raiseToTop=function(e){let t=U5(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))};Jc.prototype.lowerToBottom=function(e){let t=U5(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};Jc.prototype.isDestroyed=function(){return!1};Jc.prototype.destroy=function(){return this.removeAll(!0),ue(this)};var Q2=Jc;var Uni=T(S(),1);var qHn=T(S(),1);var HHn=T(S(),1);function ca(e){e=g(e,g.EMPTY_OBJECT),this._primitives=[],this._guid=Hn(),this._primitiveAdded=new ye,this._primitiveRemoved=new ye,this._zIndex=void 0,this.show=g(e.show,!0),this.destroyPrimitives=g(e.destroyPrimitives,!0)}Object.defineProperties(ca.prototype,{length:{get:function(){return this._primitives.length}},primitiveAdded:{get:function(){return this._primitiveAdded}},primitiveRemoved:{get:function(){return this._primitiveRemoved}}});ca.prototype.add=function(e,t){let n=l(t),i=e._external=e._external||{},o=i._composites=i._composites||{};return o[this._guid]={collection:this},n?this._primitives.splice(t,0,e):this._primitives.push(e),this._primitiveAdded.raiseEvent(e),e};ca.prototype.remove=function(e){if(this.contains(e)){let t=this._primitives.indexOf(e);if(t!==-1)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this.destroyPrimitives&&e.destroy(),this._primitiveRemoved.raiseEvent(e),!0}return!1};ca.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};ca.prototype.removeAll=function(){let e=this._primitives,t=e.length;for(let n=0;n<t;++n)delete e[n]._external._composites[this._guid],this.destroyPrimitives&&e[n].destroy(),this._primitiveRemoved.raiseEvent(e[n]);this._primitives=[]};ca.prototype.contains=function(e){return!!(l(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function k5(e,t){return e._primitives.indexOf(t)}ca.prototype.raise=function(e){if(l(e)){let t=k5(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};ca.prototype.raiseToTop=function(e){if(l(e)){let t=k5(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};ca.prototype.lower=function(e){if(l(e)){let t=k5(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};ca.prototype.lowerToBottom=function(e){if(l(e)){let t=k5(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};ca.prototype.get=function(e){return this._primitives[e]};ca.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};ca.prototype.prePassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];l(i.prePassesUpdate)&&i.prePassesUpdate(e)}};ca.prototype.updateForPass=function(e,t){let n=this._primitives;for(let i=0;i<n.length;++i){let o=n[i];l(o.updateForPass)&&o.updateForPass(e,t)}};ca.prototype.postPassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];l(i.postPassesUpdate)&&i.postPassesUpdate(e)}};ca.prototype.isDestroyed=function(){return!1};ca.prototype.destroy=function(){return this.removeAll(),ue(this)};var Fl=ca;function yf(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(yf.prototype,{length:{get:function(){return this._length}}});yf.prototype.add=function(e,t){t=g(t,0);let n=this._collections[t];if(!l(n)){n=new Fl({destroyPrimitives:!1}),n._zIndex=t,this._collections[t]=n;let i=this._collectionsArray,o=0;for(;o<i.length&&i[o]._zIndex<t;)o++;i.splice(o,0,n)}return n.add(e),this._length++,e._zIndex=t,e};yf.prototype.set=function(e,t){return t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};yf.prototype.remove=function(e,t){if(this.contains(e)){let n=e._zIndex,i=this._collections[n],o;return t?o=i.remove(e):o=i.removeAndDestroy(e),o&&this._length--,i.length===0&&(this._collectionsArray.splice(this._collectionsArray.indexOf(i),1),this._collections[n]=void 0,i.destroy()),o}return!1};yf.prototype.removeAll=function(){let e=this._collectionsArray;for(let t=0;t<e.length;t++){let n=e[t];n.destroyPrimitives=!0,n.destroy()}this._collections={},this._collectionsArray=[],this._length=0};yf.prototype.contains=function(e){if(!l(e))return!1;let t=this._collections[e._zIndex];return l(t)&&t.contains(e)};yf.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};yf.prototype.isDestroyed=function(){return!1};yf.prototype.destroy=function(){return this.removeAll(),ue(this)};var j2=yf;var f$n=T(S(),1);var iKn=T(S(),1);function S1(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new Ct}S1.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};S1.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);l(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};S1.prototype.update=function(e){let t=this._dynamicUpdaters.values;for(let n=0,i=t.length;n<i;n++)t[n].update(e);return!0};S1.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};S1.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),l(e)&&l(e.getBoundingSphere)?e.getBoundingSphere(t):ut.FAILED};var U_=S1;var xzn=T(S(),1);var vKn=T(S(),1);var lKn=T(S(),1);var ez={},D5=new h,qle=new h,$le=new Me,ede=new q;function C1(e,t,n,i,o,r,s,a,c,d){let u=e+t;h.multiplyByScalar(i,Math.cos(u),D5),h.multiplyByScalar(n,Math.sin(u),qle),h.add(D5,qle,D5);let m=Math.cos(e);m=m*m;let p=Math.sin(e);p=p*p;let f=r/Math.sqrt(s*m+o*p)/a;return Me.fromAxisAngle(D5,f,$le),q.fromQuaternion($le,ede),q.multiplyByVector(ede,c,d),h.normalize(d,d),h.multiplyByScalar(d,a,d),d}var tde=new h,nde=new h,$K=new h,GJe=new h;ez.raisePositionsToHeight=function(e,t,n){let i=t.ellipsoid,o=t.height,r=t.extrudedHeight,s=n?e.length/3*2:e.length/3,a=new Float64Array(s*3),c=e.length,d=n?c:0;for(let u=0;u<c;u+=3){let m=u+1,p=u+2,y=h.fromArray(e,u,tde);i.scaleToGeodeticSurface(y,y);let f=h.clone(y,nde),x=i.geodeticSurfaceNormal(y,GJe),_=h.multiplyByScalar(x,o,$K);h.add(y,_,y),n&&(h.multiplyByScalar(x,r,_),h.add(f,_,f),a[u+d]=f.x,a[m+d]=f.y,a[p+d]=f.z),a[u]=y.x,a[m]=y.y,a[p]=y.z}return a};var EJe=new h,IJe=new h,XJe=new h;ez.computeEllipsePositions=function(e,t,n){let i=e.semiMinorAxis,o=e.semiMajorAxis,r=e.rotation,s=e.center,a=e.granularity*8,c=i*i,d=o*o,u=o*i,m=h.magnitude(s),p=h.normalize(s,EJe),y=h.cross(h.UNIT_Z,s,IJe);y=h.normalize(y,y);let f=h.cross(p,y,XJe),x=1+Math.ceil(W.PI_OVER_TWO/a),_=W.PI_OVER_TWO/(x-1),C=W.PI_OVER_TWO-x*_;C<0&&(x-=Math.ceil(Math.abs(C)/_));let V=2*(x*(x+2)),L=t?new Array(V*3):void 0,Z=0,G=tde,I=nde,P=x*4*3,v=P-1,F=0,M=n?new Array(P):void 0,b,R,E,X,w;for(C=W.PI_OVER_TWO,G=C1(C,r,f,y,c,u,d,m,p,G),t&&(L[Z++]=G.x,L[Z++]=G.y,L[Z++]=G.z),n&&(M[v--]=G.z,M[v--]=G.y,M[v--]=G.x),C=W.PI_OVER_TWO-_,b=1;b<x+1;++b){if(G=C1(C,r,f,y,c,u,d,m,p,G),I=C1(Math.PI-C,r,f,y,c,u,d,m,p,I),t){for(L[Z++]=G.x,L[Z++]=G.y,L[Z++]=G.z,E=2*b+2,R=1;R<E-1;++R)X=R/(E-1),w=h.lerp(G,I,X,$K),L[Z++]=w.x,L[Z++]=w.y,L[Z++]=w.z;L[Z++]=I.x,L[Z++]=I.y,L[Z++]=I.z}n&&(M[v--]=G.z,M[v--]=G.y,M[v--]=G.x,M[F++]=I.x,M[F++]=I.y,M[F++]=I.z),C=W.PI_OVER_TWO-(b+1)*_}for(b=x;b>1;--b){if(C=W.PI_OVER_TWO-(b-1)*_,G=C1(-C,r,f,y,c,u,d,m,p,G),I=C1(C+Math.PI,r,f,y,c,u,d,m,p,I),t){for(L[Z++]=G.x,L[Z++]=G.y,L[Z++]=G.z,E=2*(b-1)+2,R=1;R<E-1;++R)X=R/(E-1),w=h.lerp(G,I,X,$K),L[Z++]=w.x,L[Z++]=w.y,L[Z++]=w.z;L[Z++]=I.x,L[Z++]=I.y,L[Z++]=I.z}n&&(M[v--]=G.z,M[v--]=G.y,M[v--]=G.x,M[F++]=I.x,M[F++]=I.y,M[F++]=I.z)}C=W.PI_OVER_TWO,G=C1(-C,r,f,y,c,u,d,m,p,G);let N={};return t&&(L[Z++]=G.x,L[Z++]=G.y,L[Z++]=G.z,N.positions=L,N.numPts=x),n&&(M[v--]=G.z,M[v--]=G.y,M[v--]=G.x,N.outerPositions=M),N};var Al=ez;var V1=new h,tz=new h,nz=new h,ide=new h,Cs=new B,ode=new q,WJe=new q,iz=new Me,rde=new h,sde=new h,ade=new h,Y5=new he,cde=new h,lde=new B,dde=new B;function ude(e,t,n){let i=t.vertexFormat,o=t.center,r=t.semiMajorAxis,s=t.semiMinorAxis,a=t.ellipsoid,c=t.stRotation,d=n?e.length/3*2:e.length/3,u=t.shadowVolume,m=i.st?new Float32Array(d*2):void 0,p=i.normal?new Float32Array(d*3):void 0,y=i.tangent?new Float32Array(d*3):void 0,f=i.bitangent?new Float32Array(d*3):void 0,x=u?new Float32Array(d*3):void 0,_=0,C=rde,V=sde,L=ade,Z=new Ri(a),G=Z.project(a.cartesianToCartographic(o,Y5),cde),I=a.scaleToGeodeticSurface(o,V1);a.geodeticSurfaceNormal(I,I);let P=ode,v=WJe;if(c!==0){let w=Me.fromAxisAngle(I,c,iz);P=q.fromQuaternion(w,P),w=Me.fromAxisAngle(I,-c,iz),v=q.fromQuaternion(w,v)}else P=q.clone(q.IDENTITY,P),v=q.clone(q.IDENTITY,v);let F=B.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,lde),M=B.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,dde),b=e.length,R=n?b:0,E=R/3*2;for(let w=0;w<b;w+=3){let N=w+1,D=w+2,k=h.fromArray(e,w,V1);if(i.st){let Y=q.multiplyByVector(P,k,tz),U=Z.project(a.cartesianToCartographic(Y,Y5),nz);h.subtract(U,G,U),Cs.x=(U.x+r)/(2*r),Cs.y=(U.y+s)/(2*s),F.x=Math.min(Cs.x,F.x),F.y=Math.min(Cs.y,F.y),M.x=Math.max(Cs.x,M.x),M.y=Math.max(Cs.y,M.y),n&&(m[_+E]=Cs.x,m[_+1+E]=Cs.y),m[_++]=Cs.x,m[_++]=Cs.y}(i.normal||i.tangent||i.bitangent||u)&&(C=a.geodeticSurfaceNormal(k,C),u&&(x[w+R]=-C.x,x[N+R]=-C.y,x[D+R]=-C.z),(i.normal||i.tangent||i.bitangent)&&((i.tangent||i.bitangent)&&(V=h.normalize(h.cross(h.UNIT_Z,C,V),V),q.multiplyByVector(v,V,V)),i.normal&&(p[w]=C.x,p[N]=C.y,p[D]=C.z,n&&(p[w+R]=-C.x,p[N+R]=-C.y,p[D+R]=-C.z)),i.tangent&&(y[w]=V.x,y[N]=V.y,y[D]=V.z,n&&(y[w+R]=-V.x,y[N+R]=-V.y,y[D+R]=-V.z)),i.bitangent&&(L=h.normalize(h.cross(C,V,L),L),f[w]=L.x,f[N]=L.y,f[D]=L.z,n&&(f[w+R]=L.x,f[N+R]=L.y,f[D+R]=L.z))))}if(i.st){b=m.length;for(let w=0;w<b;w+=2)m[w]=(m[w]-F.x)/(M.x-F.x),m[w+1]=(m[w+1]-F.y)/(M.y-F.y)}let X=new pn;if(i.position){let w=Al.raisePositionsToHeight(e,t,n);X.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:w})}if(i.st&&(X.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:m})),i.normal&&(X.normal=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(X.tangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:y})),i.bitangent&&(X.bitangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:f})),u&&(X.extrudeDirection=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:x})),n&&l(t.offsetAttribute)){let w=new Uint8Array(d);if(t.offsetAttribute===an.TOP)w=w.fill(1,0,d/2);else{let N=t.offsetAttribute===an.NONE?0:1;w=w.fill(N)}X.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:w})}return X}function mde(e){let t=new Array(12*(e*(e+1))-6),n=0,i,o,r,s,a;for(i=0,r=1,s=0;s<3;s++)t[n++]=r++,t[n++]=i,t[n++]=r;for(s=2;s<e+1;++s){for(r=s*(s+1)-1,i=(s-1)*s-1,t[n++]=r++,t[n++]=i,t[n++]=r,o=2*s,a=0;a<o-1;++a)t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i,t[n++]=r;t[n++]=r++,t[n++]=i,t[n++]=r}for(o=e*2,++r,++i,s=0;s<o-1;++s)t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i,t[n++]=r;for(t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i++,t[n++]=i,++i,s=e-1;s>1;--s){for(t[n++]=i++,t[n++]=i,t[n++]=r,o=2*s,a=0;a<o-1;++a)t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i,t[n++]=r;t[n++]=i++,t[n++]=i++,t[n++]=r++}for(s=0;s<3;s++)t[n++]=i++,t[n++]=i,t[n++]=r;return t}var k_=new h;function PJe(e){let t=e.center;k_=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,k_),e.height,k_),k_=h.add(t,k_,k_);let n=new ce(k_,e.semiMajorAxis),i=Al.computeEllipsePositions(e,!0,!1),o=i.positions,r=i.numPts,s=ude(o,e,!1),a=mde(r);return a=Ne.createTypedArray(o.length/3,a),{boundingSphere:n,attributes:s,indices:a}}function vJe(e,t){let n=t.vertexFormat,i=t.center,o=t.semiMajorAxis,r=t.semiMinorAxis,s=t.ellipsoid,a=t.height,c=t.extrudedHeight,d=t.stRotation,u=e.length/3*2,m=new Float64Array(u*3),p=n.st?new Float32Array(u*2):void 0,y=n.normal?new Float32Array(u*3):void 0,f=n.tangent?new Float32Array(u*3):void 0,x=n.bitangent?new Float32Array(u*3):void 0,_=t.shadowVolume,C=_?new Float32Array(u*3):void 0,V=0,L=rde,Z=sde,G=ade,I=new Ri(s),P=I.project(s.cartesianToCartographic(i,Y5),cde),v=s.scaleToGeodeticSurface(i,V1);s.geodeticSurfaceNormal(v,v);let F=Me.fromAxisAngle(v,d,iz),M=q.fromQuaternion(F,ode),b=B.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,lde),R=B.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,dde),E=e.length,X=E/3*2;for(let N=0;N<E;N+=3){let D=N+1,k=N+2,Y=h.fromArray(e,N,V1),U;if(n.st){let K=q.multiplyByVector(M,Y,tz),ee=I.project(s.cartesianToCartographic(K,Y5),nz);h.subtract(ee,P,ee),Cs.x=(ee.x+o)/(2*o),Cs.y=(ee.y+r)/(2*r),b.x=Math.min(Cs.x,b.x),b.y=Math.min(Cs.y,b.y),R.x=Math.max(Cs.x,R.x),R.y=Math.max(Cs.y,R.y),p[V+X]=Cs.x,p[V+1+X]=Cs.y,p[V++]=Cs.x,p[V++]=Cs.y}Y=s.scaleToGeodeticSurface(Y,Y),U=h.clone(Y,tz),L=s.geodeticSurfaceNormal(Y,L),_&&(C[N+E]=-L.x,C[D+E]=-L.y,C[k+E]=-L.z);let J=h.multiplyByScalar(L,a,ide);if(Y=h.add(Y,J,Y),J=h.multiplyByScalar(L,c,J),U=h.add(U,J,U),n.position&&(m[N+E]=U.x,m[D+E]=U.y,m[k+E]=U.z,m[N]=Y.x,m[D]=Y.y,m[k]=Y.z),n.normal||n.tangent||n.bitangent){G=h.clone(L,G);let K=h.fromArray(e,(N+3)%E,ide);h.subtract(K,Y,K);let ee=h.subtract(U,Y,nz);L=h.normalize(h.cross(ee,K,L),L),n.normal&&(y[N]=L.x,y[D]=L.y,y[k]=L.z,y[N+E]=L.x,y[D+E]=L.y,y[k+E]=L.z),n.tangent&&(Z=h.normalize(h.cross(G,L,Z),Z),f[N]=Z.x,f[D]=Z.y,f[k]=Z.z,f[N+E]=Z.x,f[N+1+E]=Z.y,f[N+2+E]=Z.z),n.bitangent&&(x[N]=G.x,x[D]=G.y,x[k]=G.z,x[N+E]=G.x,x[D+E]=G.y,x[k+E]=G.z)}}if(n.st){E=p.length;for(let N=0;N<E;N+=2)p[N]=(p[N]-b.x)/(R.x-b.x),p[N+1]=(p[N+1]-b.y)/(R.y-b.y)}let w=new pn;if(n.position&&(w.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:m})),n.st&&(w.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:p})),n.normal&&(w.normal=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:y})),n.tangent&&(w.tangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:f})),n.bitangent&&(w.bitangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:x})),_&&(w.extrudeDirection=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:C})),l(t.offsetAttribute)){let N=new Uint8Array(u);if(t.offsetAttribute===an.TOP)N=N.fill(1,0,u/2);else{let D=t.offsetAttribute===an.NONE?0:1;N=N.fill(D)}w.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:N})}return w}function wJe(e){let t=e.length/3,n=Ne.createTypedArray(t,t*6),i=0;for(let o=0;o<t;o++){let r=o,s=o+t,a=(r+1)%t,c=a+t;n[i++]=r,n[i++]=s,n[i++]=a,n[i++]=a,n[i++]=s,n[i++]=c}return n}var B5=new ce,O5=new ce;function FJe(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,V1),e.height,V1);B5.center=h.add(t,o,B5.center),B5.radius=i,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),O5.center=h.add(t,o,O5.center),O5.radius=i;let r=Al.computeEllipsePositions(e,!0,!0),s=r.positions,a=r.numPts,c=r.outerPositions,d=ce.union(B5,O5),u=ude(s,e,!0),m=mde(a),p=m.length;m.length=p*2;let y=s.length/3;for(let Z=0;Z<p;Z+=3)m[Z+p]=m[Z+2]+y,m[Z+1+p]=m[Z+1]+y,m[Z+2+p]=m[Z]+y;let f=Ne.createTypedArray(y*2/3,m),x=new mt({attributes:u,indices:f,primitiveType:Ae.TRIANGLES}),_=vJe(c,e);m=wJe(c);let C=Ne.createTypedArray(c.length*2/3,m),V=new mt({attributes:_,indices:C,primitiveType:Ae.TRIANGLES}),L=Mn.combineInstances([new St({geometry:x}),new St({geometry:V})]);return{boundingSphere:d,attributes:L[0].attributes,indices:L[0].indices}}function hde(e,t,n,i,o,r,s){let c=Al.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:n,rotation:i,granularity:o},!1,!0).outerPositions,d=c.length/3,u=new Array(d);for(let p=0;p<d;++p)u[p]=h.fromArray(c,p*3);let m=de.fromCartesianArray(u,r,s);return m.width>W.PI&&(m.north=m.north>0?W.PI_OVER_TWO-W.EPSILON7:m.north,m.south=m.south<0?W.EPSILON7-W.PI_OVER_TWO:m.south,m.east=W.PI,m.west=-W.PI),m}function xf(e){e=g(e,g.EMPTY_OBJECT);let t=e.center,n=g(e.ellipsoid,oe.WGS84),i=e.semiMajorAxis,o=e.semiMinorAxis,r=g(e.granularity,W.RADIANS_PER_DEGREE),s=g(e.vertexFormat,Pe.DEFAULT),a=g(e.height,0),c=g(e.extrudedHeight,a);this._center=h.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=oe.clone(n),this._rotation=g(e.rotation,0),this._stRotation=g(e.stRotation,0),this._height=Math.max(c,a),this._granularity=r,this._vertexFormat=Pe.clone(s),this._extrudedHeight=Math.min(c,a),this._shadowVolume=g(e.shadowVolume,!1),this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}xf.packedLength=h.packedLength+oe.packedLength+Pe.packedLength+9;xf.pack=function(e,t,n){return n=g(n,0),h.pack(e._center,t,n),n+=h.packedLength,oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,Pe.pack(e._vertexFormat,t,n),n+=Pe.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=g(e._offsetAttribute,-1),t};var fde=new h,pde=new oe,bde=new Pe,gf={center:fde,ellipsoid:pde,vertexFormat:bde,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};xf.unpack=function(e,t,n){t=g(t,0);let i=h.unpack(e,t,fde);t+=h.packedLength;let o=oe.unpack(e,t,pde);t+=oe.packedLength;let r=Pe.unpack(e,t,bde);t+=Pe.packedLength;let s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],m=e[t++],p=e[t++],y=e[t++]===1,f=e[t];return l(n)?(n._center=h.clone(i,n._center),n._ellipsoid=oe.clone(o,n._ellipsoid),n._vertexFormat=Pe.clone(r,n._vertexFormat),n._semiMajorAxis=s,n._semiMinorAxis=a,n._rotation=c,n._stRotation=d,n._height=u,n._granularity=m,n._extrudedHeight=p,n._shadowVolume=y,n._offsetAttribute=f===-1?void 0:f,n):(gf.height=u,gf.extrudedHeight=p,gf.granularity=m,gf.stRotation=d,gf.rotation=c,gf.semiMajorAxis=s,gf.semiMinorAxis=a,gf.shadowVolume=y,gf.offsetAttribute=f===-1?void 0:f,new xf(gf))};xf.computeRectangle=function(e,t){e=g(e,g.EMPTY_OBJECT);let n=e.center,i=g(e.ellipsoid,oe.WGS84),o=e.semiMajorAxis,r=e.semiMinorAxis,s=g(e.granularity,W.RADIANS_PER_DEGREE),a=g(e.rotation,0);return hde(n,o,r,a,s,i,t)};xf.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!W.equalsEpsilon(t,n,0,W.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation},r;if(i)o.extrudedHeight=n,o.shadowVolume=e._shadowVolume,o.offsetAttribute=e._offsetAttribute,r=FJe(o);else if(r=PJe(o),l(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===an.NONE?0:1,c=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new mt({attributes:r.attributes,indices:r.indices,primitiveType:Ae.TRIANGLES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};xf.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new xf({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:o,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:Pe.POSITION_ONLY,shadowVolume:!0})};function AJe(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=Al.computeEllipsePositions({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,rotation:e._rotation,granularity:e._granularity},!1,!0).outerPositions,o=i.length/3,r=new Array(o);for(let c=0;c<o;++c)r[c]=h.fromArray(i,c*3);let s=e._ellipsoid,a=e.rectangle;return mt._textureCoordinateRotationPoints(r,t,s,a)}Object.defineProperties(xf.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=hde(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=AJe(this)),this._textureCoordinateRotationPoints}}});var Qc=xf;var QKn=T(S(),1);var yde=new h,D_=new h;function MJe(e){let t=e.center;D_=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,D_),e.height,D_),D_=h.add(t,D_,D_);let n=new ce(D_,e.semiMajorAxis),i=Al.computeEllipsePositions(e,!1,!0).outerPositions,o=new pn({position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:Al.raisePositionsToHeight(i,e,!1)})}),r=i.length/3,s=Ne.createTypedArray(r,r*2),a=0;for(let c=0;c<r;++c)s[a++]=c,s[a++]=(c+1)%r;return{boundingSphere:n,attributes:o,indices:s}}var H5=new ce,K5=new ce;function NJe(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,yde),e.height,yde);H5.center=h.add(t,o,H5.center),H5.radius=i,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),K5.center=h.add(t,o,K5.center),K5.radius=i;let r=Al.computeEllipsePositions(e,!1,!0).outerPositions,s=new pn({position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:Al.raisePositionsToHeight(r,e,!0)})});r=s.position.values;let a=ce.union(H5,K5),c=r.length/3;if(l(e.offsetAttribute)){let f=new Uint8Array(c);if(e.offsetAttribute===an.TOP)f=f.fill(1,0,c/2);else{let x=e.offsetAttribute===an.NONE?0:1;f=f.fill(x)}s.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}let d=g(e.numberOfVerticalLines,16);d=W.clamp(d,0,c/2);let u=Ne.createTypedArray(c,c*2+d*2);c/=2;let m=0,p;for(p=0;p<c;++p)u[m++]=p,u[m++]=(p+1)%c,u[m++]=p+c,u[m++]=(p+1)%c+c;let y;if(d>0){let f=Math.min(d,c);y=Math.round(c/f);let x=Math.min(y*d,c);for(p=0;p<x;p+=y)u[m++]=p,u[m++]=p+c}return{boundingSphere:a,attributes:s,indices:u}}function L1(e){e=g(e,g.EMPTY_OBJECT);let t=e.center,n=g(e.ellipsoid,oe.WGS84),i=e.semiMajorAxis,o=e.semiMinorAxis,r=g(e.granularity,W.RADIANS_PER_DEGREE),s=g(e.height,0),a=g(e.extrudedHeight,s);this._center=h.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=oe.clone(n),this._rotation=g(e.rotation,0),this._height=Math.max(a,s),this._granularity=r,this._extrudedHeight=Math.min(a,s),this._numberOfVerticalLines=Math.max(g(e.numberOfVerticalLines,16),0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}L1.packedLength=h.packedLength+oe.packedLength+8;L1.pack=function(e,t,n){return n=g(n,0),h.pack(e._center,t,n),n+=h.packedLength,oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._numberOfVerticalLines,t[n]=g(e._offsetAttribute,-1),t};var gde=new h,xde=new oe,I0={center:gde,ellipsoid:xde,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};L1.unpack=function(e,t,n){t=g(t,0);let i=h.unpack(e,t,gde);t+=h.packedLength;let o=oe.unpack(e,t,xde);t+=oe.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],m=e[t++],p=e[t];return l(n)?(n._center=h.clone(i,n._center),n._ellipsoid=oe.clone(o,n._ellipsoid),n._semiMajorAxis=r,n._semiMinorAxis=s,n._rotation=a,n._height=c,n._granularity=d,n._extrudedHeight=u,n._numberOfVerticalLines=m,n._offsetAttribute=p===-1?void 0:p,n):(I0.height=c,I0.extrudedHeight=u,I0.granularity=d,I0.rotation=a,I0.semiMajorAxis=r,I0.semiMinorAxis=s,I0.numberOfVerticalLines=m,I0.offsetAttribute=p===-1?void 0:p,new L1(I0))};L1.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!W.equalsEpsilon(t,n,0,W.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},r;if(i)o.extrudedHeight=n,o.offsetAttribute=e._offsetAttribute,r=NJe(o);else if(r=MJe(o),l(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===an.NONE?0:1,c=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new mt({attributes:r.attributes,indices:r.indices,primitiveType:Ae.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var Sd=L1;var _de=new O,Tde=h.ZERO,Sde=new h,Cde=new de;function UJe(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 oh(e,t){zn.call(this,{entity:e,scene:t,geometryOptions:new UJe(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}l(Object.create)&&(oh.prototype=Object.create(zn.prototype),oh.prototype.constructor=oh);oh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Dn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Ut){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,_de)),l(o)||(o=O.WHITE),i.color=Ot.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=eo.fromCartesian3(z.getValueOrDefault(this._terrainOffsetProperty,e,Tde,Sde))),new St({id:t,geometry:new Qc(this._options),attributes:i})};oh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=z.getValueOrDefault(this._outlineColorProperty,e,O.BLACK,_de),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ot.fromColor(i),distanceDisplayCondition:Dn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=eo.fromCartesian3(z.getValueOrDefault(this._terrainOffsetProperty,e,Tde,Sde))),new St({id:t,geometry:new Sd(this._options),attributes:r})};oh.prototype._computeCenter=function(e,t){return z.getValueOrUndefined(this._entity.position,e,t)};oh.prototype._isHidden=function(e,t){let n=e.position;return!l(n)||!l(t.semiMajorAxis)||!l(t.semiMinorAxis)||si.prototype._isHidden.call(this,e,t)};oh.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!z.isConstant(t.rotation)||!z.isConstant(t.height)||!z.isConstant(t.extrudedHeight)||!z.isConstant(t.granularity)||!z.isConstant(t.stRotation)||!z.isConstant(t.outlineWidth)||!z.isConstant(t.numberOfVerticalLines)||!z.isConstant(t.zIndex)||this._onTerrain&&!z.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Ut)};oh.prototype._setStaticOptions=function(e,t){let n=z.getValueOrUndefined(t.height,Be.MINIMUM_VALUE),i=z.getValueOrDefault(t.heightReference,Be.MINIMUM_VALUE,Qe.NONE),o=z.getValueOrUndefined(t.extrudedHeight,Be.MINIMUM_VALUE),r=z.getValueOrDefault(t.extrudedHeightReference,Be.MINIMUM_VALUE,Qe.NONE);l(o)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Ut?cn.VERTEX_FORMAT:mo.MaterialSupport.TEXTURED.vertexFormat,s.center=e.position.getValue(Be.MINIMUM_VALUE,s.center),s.semiMajorAxis=t.semiMajorAxis.getValue(Be.MINIMUM_VALUE,s.semiMajorAxis),s.semiMinorAxis=t.semiMinorAxis.getValue(Be.MINIMUM_VALUE,s.semiMinorAxis),s.rotation=z.getValueOrUndefined(t.rotation,Be.MINIMUM_VALUE),s.granularity=z.getValueOrUndefined(t.granularity,Be.MINIMUM_VALUE),s.stRotation=z.getValueOrUndefined(t.stRotation,Be.MINIMUM_VALUE),s.numberOfVerticalLines=z.getValueOrUndefined(t.numberOfVerticalLines,Be.MINIMUM_VALUE),s.offsetAttribute=zn.computeGeometryOffsetAttribute(n,i,o,r),s.height=zn.getGeometryHeight(n,i),o=zn.getGeometryExtrudedHeight(o,r),o===zn.CLAMP_TO_GROUND&&(o=hi.getMinimumMaximumHeights(Qc.computeRectangle(s,Cde)).minimumTerrainHeight),s.extrudedHeight=o};oh.DynamicGeometryUpdater=R1;function R1(e,t,n){ri.call(this,e,t,n)}l(Object.create)&&(R1.prototype=Object.create(ri.prototype),R1.prototype.constructor=R1);R1.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.center)||!l(i.semiMajorAxis)||!l(i.semiMinorAxis)||ri.prototype._isHidden.call(this,e,t,n)};R1.prototype._setOptions=function(e,t,n){let i=this._options,o=z.getValueOrUndefined(t.height,n),r=z.getValueOrDefault(t.heightReference,n,Qe.NONE),s=z.getValueOrUndefined(t.extrudedHeight,n),a=z.getValueOrDefault(t.extrudedHeightReference,n,Qe.NONE);l(s)&&!l(o)&&(o=0),i.center=z.getValueOrUndefined(e.position,n,i.center),i.semiMajorAxis=z.getValueOrUndefined(t.semiMajorAxis,n),i.semiMinorAxis=z.getValueOrUndefined(t.semiMinorAxis,n),i.rotation=z.getValueOrUndefined(t.rotation,n),i.granularity=z.getValueOrUndefined(t.granularity,n),i.stRotation=z.getValueOrUndefined(t.stRotation,n),i.numberOfVerticalLines=z.getValueOrUndefined(t.numberOfVerticalLines,n),i.offsetAttribute=zn.computeGeometryOffsetAttribute(o,r,s,a),i.height=zn.getGeometryHeight(o,r),s=zn.getGeometryExtrudedHeight(s,a),s===zn.CLAMP_TO_GROUND&&(s=hi.getMinimumMaximumHeights(Qc.computeRectangle(i,Cde)).minimumTerrainHeight),i.extrudedHeight=s};var q2=oh;var dJn=T(S(),1);var Fzn=T(S(),1);var kJe=new h,DJe=new h,BJe=new h,OJe=new h,YJe=new h,HJe=new h(1,1,1),Vde=Math.cos,Lde=Math.sin;function X0(e){e=g(e,g.EMPTY_OBJECT);let t=g(e.radii,HJe),n=g(e.innerRadii,t),i=g(e.minimumClock,0),o=g(e.maximumClock,W.TWO_PI),r=g(e.minimumCone,0),s=g(e.maximumCone,W.PI),a=Math.round(g(e.stackPartitions,64)),c=Math.round(g(e.slicePartitions,64)),d=g(e.vertexFormat,Pe.DEFAULT);this._radii=h.clone(t),this._innerRadii=h.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._vertexFormat=Pe.clone(d),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}X0.packedLength=2*h.packedLength+Pe.packedLength+7;X0.pack=function(e,t,n){return n=g(n,0),h.pack(e._radii,t,n),n+=h.packedLength,h.pack(e._innerRadii,t,n),n+=h.packedLength,Pe.pack(e._vertexFormat,t,n),n+=Pe.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n]=g(e._offsetAttribute,-1),t};var Rde=new h,Zde=new h,Gde=new Pe,Xy={radii:Rde,innerRadii:Zde,vertexFormat:Gde,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};X0.unpack=function(e,t,n){t=g(t,0);let i=h.unpack(e,t,Rde);t+=h.packedLength;let o=h.unpack(e,t,Zde);t+=h.packedLength;let r=Pe.unpack(e,t,Gde);t+=Pe.packedLength;let s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],m=e[t++],p=e[t];return l(n)?(n._radii=h.clone(i,n._radii),n._innerRadii=h.clone(o,n._innerRadii),n._vertexFormat=Pe.clone(r,n._vertexFormat),n._minimumClock=s,n._maximumClock=a,n._minimumCone=c,n._maximumCone=d,n._stackPartitions=u,n._slicePartitions=m,n._offsetAttribute=p===-1?void 0:p,n):(Xy.minimumClock=s,Xy.maximumClock=a,Xy.minimumCone=c,Xy.maximumCone=d,Xy.stackPartitions=u,Xy.slicePartitions=m,Xy.offsetAttribute=p===-1?void 0:p,new X0(Xy))};X0.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,o=e._maximumClock,r=e._minimumCone,s=e._maximumCone,a=e._vertexFormat,c=e._slicePartitions+1,d=e._stackPartitions+1;c=Math.round(c*Math.abs(o-i)/W.TWO_PI),d=Math.round(d*Math.abs(s-r)/W.PI),c<2&&(c=2),d<2&&(d=2);let u,m,p=0,y=[r],f=[i];for(u=0;u<d;u++)y.push(r+u*(s-r)/(d-1));for(y.push(s),m=0;m<c;m++)f.push(i+m*(o-i)/(c-1));f.push(o);let x=y.length,_=f.length,C=0,V=1,L=n.x!==t.x||n.y!==t.y||n.z!==t.z,Z=!1,G=!1,I=!1;L&&(V=2,r>0&&(Z=!0,C+=c-1),s<Math.PI&&(G=!0,C+=c-1),(o-i)%W.TWO_PI?(I=!0,C+=(d-1)*2+1):C+=1);let P=_*x*V,v=new Float64Array(P*3),F=new Array(P).fill(!1),M=new Array(P).fill(!1),b=c*d*V,R=6*(b+C+1-(c+d)*V),E=Ne.createTypedArray(b,R),X=a.normal?new Float32Array(P*3):void 0,w=a.tangent?new Float32Array(P*3):void 0,N=a.bitangent?new Float32Array(P*3):void 0,D=a.st?new Float32Array(P*2):void 0,k=new Array(x),Y=new Array(x);for(u=0;u<x;u++)k[u]=Lde(y[u]),Y[u]=Vde(y[u]);let U=new Array(_),J=new Array(_);for(m=0;m<_;m++)J[m]=Vde(f[m]),U[m]=Lde(f[m]);for(u=0;u<x;u++)for(m=0;m<_;m++)v[p++]=t.x*k[u]*J[m],v[p++]=t.y*k[u]*U[m],v[p++]=t.z*Y[u];let K=P/2;if(L)for(u=0;u<x;u++)for(m=0;m<_;m++)v[p++]=n.x*k[u]*J[m],v[p++]=n.y*k[u]*U[m],v[p++]=n.z*Y[u],F[K]=!0,u>0&&u!==x-1&&m!==0&&m!==_-1&&(M[K]=!0),K++;p=0;let ee,H;for(u=1;u<x-2;u++)for(ee=u*_,H=(u+1)*_,m=1;m<_-2;m++)E[p++]=H+m,E[p++]=H+m+1,E[p++]=ee+m+1,E[p++]=H+m,E[p++]=ee+m+1,E[p++]=ee+m;if(L){let we=x*_;for(u=1;u<x-2;u++)for(ee=we+u*_,H=we+(u+1)*_,m=1;m<_-2;m++)E[p++]=H+m,E[p++]=ee+m,E[p++]=ee+m+1,E[p++]=H+m,E[p++]=ee+m+1,E[p++]=H+m+1}let j,$;if(L){if(Z)for($=x*_,u=1;u<_-2;u++)E[p++]=u,E[p++]=u+1,E[p++]=$+u+1,E[p++]=u,E[p++]=$+u+1,E[p++]=$+u;if(G)for(j=x*_-_,$=x*_*V-_,u=1;u<_-2;u++)E[p++]=j+u+1,E[p++]=j+u,E[p++]=$+u,E[p++]=j+u+1,E[p++]=$+u,E[p++]=$+u+1}if(I){for(u=1;u<x-2;u++)$=_*x+_*u,j=_*u,E[p++]=$,E[p++]=j+_,E[p++]=j,E[p++]=$,E[p++]=$+_,E[p++]=j+_;for(u=1;u<x-2;u++)$=_*x+_*(u+1)-1,j=_*(u+1)-1,E[p++]=j+_,E[p++]=$,E[p++]=j,E[p++]=j+_,E[p++]=$+_,E[p++]=$}let pe=new pn;a.position&&(pe.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:v}));let ge=0,ae=0,be=0,_e=0,Ze=P/2,Le,Ee=oe.fromCartesian3(t),He=oe.fromCartesian3(n);if(a.st||a.normal||a.tangent||a.bitangent){for(u=0;u<P;u++){Le=F[u]?He:Ee;let we=h.fromArray(v,u*3,kJe),dt=Le.geodeticSurfaceNormal(we,DJe);if(M[u]&&h.negate(dt,dt),a.st){let bt=B.negate(dt,YJe);D[ge++]=Math.atan2(bt.y,bt.x)/W.TWO_PI+.5,D[ge++]=Math.asin(dt.z)/Math.PI+.5}if(a.normal&&(X[ae++]=dt.x,X[ae++]=dt.y,X[ae++]=dt.z),a.tangent||a.bitangent){let bt=BJe,it=0,en;if(F[u]&&(it=Ze),!Z&&u>=it&&u<it+_*2?en=h.UNIT_X:en=h.UNIT_Z,h.cross(en,dt,bt),h.normalize(bt,bt),a.tangent&&(w[be++]=bt.x,w[be++]=bt.y,w[be++]=bt.z),a.bitangent){let _n=h.cross(dt,bt,OJe);h.normalize(_n,_n),N[_e++]=_n.x,N[_e++]=_n.y,N[_e++]=_n.z}}}a.st&&(pe.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:D})),a.normal&&(pe.normal=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:X})),a.tangent&&(pe.tangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:w})),a.bitangent&&(pe.bitangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:N}))}if(l(e._offsetAttribute)){let we=v.length,dt=e._offsetAttribute===an.NONE?0:1,bt=new Uint8Array(we/3).fill(dt);pe.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:bt})}return new mt({attributes:pe,indices:E,primitiveType:Ae.TRIANGLES,boundingSphere:ce.fromEllipsoid(Ee),offsetAttribute:e._offsetAttribute})};var oz;X0.getUnitEllipsoid=function(){return l(oz)||(oz=X0.createGeometry(new X0({radii:new h(1,1,1),vertexFormat:Pe.POSITION_ONLY}))),oz};var Ds=X0;var KJe=new Ut(O.WHITE),rz=h.ZERO,sz=new h,zJe=new h,JJe=new h,az=new O,QJe=new h(1,1,1);function jJe(e){this.id=e,this.vertexFormat=void 0,this.radii=void 0,this.innerRadii=void 0,this.minimumClock=void 0,this.maximumClock=void 0,this.minimumCone=void 0,this.maximumCone=void 0,this.stackPartitions=void 0,this.slicePartitions=void 0,this.subdivisions=void 0,this.offsetAttribute=void 0}function Cd(e,t){si.call(this,{entity:e,scene:t,geometryOptions:new jJe(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}l(Object.create)&&(Cd.prototype=Object.create(si.prototype),Cd.prototype.constructor=Cd);Object.defineProperties(Cd.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Cd.prototype.createFillGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r,s=new Sn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),c=Dn.fromDistanceDisplayCondition(a),d={show:s,distanceDisplayCondition:c,color:void 0,offset:void 0};if(this._materialProperty instanceof Ut){let u;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||o)&&(u=this._materialProperty.color.getValue(e,az)),l(u)||(u=O.WHITE),r=Ot.fromColor(u),d.color=r}return l(this._options.offsetAttribute)&&(d.offset=eo.fromCartesian3(z.getValueOrDefault(this._terrainOffsetProperty,e,rz,sz))),new St({id:i,geometry:new Ds(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.mapProjection.ellipsoid,n),attributes:d})};Cd.prototype.createOutlineGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r=z.getValueOrDefault(this._outlineColorProperty,e,O.BLACK,az),s=this._distanceDisplayConditionProperty.getValue(e),a={show:new Sn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ot.fromColor(r),distanceDisplayCondition:Dn.fromDistanceDisplayCondition(s),offset:void 0};return l(this._options.offsetAttribute)&&(a.offset=eo.fromCartesian3(z.getValueOrDefault(this._terrainOffsetProperty,e,rz,sz))),new St({id:i,geometry:new fd(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.mapProjection.ellipsoid,n),attributes:a})};Cd.prototype._computeCenter=function(e,t){return z.getValueOrUndefined(this._entity.position,e,t)};Cd.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.radii)||si.prototype._isHidden.call(this,e,t)};Cd.prototype._isDynamic=function(e,t){return!e.position.isConstant||!z.isConstant(e.orientation)||!t.radii.isConstant||!z.isConstant(t.innerRadii)||!z.isConstant(t.stackPartitions)||!z.isConstant(t.slicePartitions)||!z.isConstant(t.outlineWidth)||!z.isConstant(t.minimumClock)||!z.isConstant(t.maximumClock)||!z.isConstant(t.minimumCone)||!z.isConstant(t.maximumCone)||!z.isConstant(t.subdivisions)};Cd.prototype._setStaticOptions=function(e,t){let n=z.getValueOrDefault(t.heightReference,Be.MINIMUM_VALUE,Qe.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Ut?cn.VERTEX_FORMAT:mo.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(Be.MINIMUM_VALUE,i.radii),i.innerRadii=z.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=z.getValueOrUndefined(t.minimumClock,Be.MINIMUM_VALUE),i.maximumClock=z.getValueOrUndefined(t.maximumClock,Be.MINIMUM_VALUE),i.minimumCone=z.getValueOrUndefined(t.minimumCone,Be.MINIMUM_VALUE),i.maximumCone=z.getValueOrUndefined(t.maximumCone,Be.MINIMUM_VALUE),i.stackPartitions=z.getValueOrUndefined(t.stackPartitions,Be.MINIMUM_VALUE),i.slicePartitions=z.getValueOrUndefined(t.slicePartitions,Be.MINIMUM_VALUE),i.subdivisions=z.getValueOrUndefined(t.subdivisions,Be.MINIMUM_VALUE),i.offsetAttribute=n!==Qe.NONE?an.ALL:void 0};Cd.prototype._onEntityPropertyChanged=Gp;Cd.DynamicGeometryUpdater=$2;function $2(e,t,n){ri.call(this,e,t,n),this._scene=e._scene,this._modelMatrix=new A,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 h,this._material={}}l(Object.create)&&($2.prototype=Object.create(ri.prototype),$2.prototype.constructor=$2);$2.prototype.update=function(e){let t=this._entity,n=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!z.getValueOrDefault(n.show,e,!0)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let i=z.getValueOrUndefined(n.radii,e,zJe),o=l(i)?t.computeModelMatrixForHeightReference(e,n.heightReference,i.z*.5,this._scene.mapProjection.ellipsoid,this._modelMatrix):void 0;if(!l(o)||!l(i)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let r=z.getValueOrDefault(n.fill,e,!0),s=z.getValueOrDefault(n.outline,e,!1),a=z.getValueOrClonedDefault(n.outlineColor,e,O.BLACK,az),c=zo.getValue(e,g(n.material,KJe),this._material),d=z.getValueOrUndefined(n.innerRadii,e,JJe),u=z.getValueOrUndefined(n.minimumClock,e),m=z.getValueOrUndefined(n.maximumClock,e),p=z.getValueOrUndefined(n.minimumCone,e),y=z.getValueOrUndefined(n.maximumCone,e),f=z.getValueOrUndefined(n.stackPartitions,e),x=z.getValueOrUndefined(n.slicePartitions,e),_=z.getValueOrUndefined(n.subdivisions,e),C=z.getValueOrDefault(n.outlineWidth,e,1),V=z.getValueOrDefault(n.heightReference,e,Qe.NONE),L=V!==Qe.NONE?an.ALL:void 0,Z=this._scene.mode,G=Z===ie.SCENE3D&&V===Qe.NONE,I=this._options,P=this._geometryUpdater.shadowsProperty.getValue(e),F=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),M=z.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,rz,sz);if(!G||this._lastSceneMode!==Z||!l(this._primitive)||I.stackPartitions!==f||I.slicePartitions!==x||l(d)&&!h.equals(I.innerRadii!==d)||I.minimumClock!==u||I.maximumClock!==m||I.minimumCone!==p||I.maximumCone!==y||I.subdivisions!==_||this._lastOutlineWidth!==C||I.offsetAttribute!==L){let R=this._primitives;R.removeAndDestroy(this._primitive),R.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=Z,this._lastOutlineWidth=C,I.stackPartitions=f,I.slicePartitions=x,I.subdivisions=_,I.offsetAttribute=L,I.radii=h.clone(G?QJe:i,I.radii),l(d)?G?I.innerRadii=h.fromElements(d.x/i.x,d.y/i.y,d.z/i.z,I.innerRadii):I.innerRadii=h.clone(d,I.innerRadii):I.innerRadii=void 0,I.minimumClock=u,I.maximumClock=m,I.minimumCone=p,I.maximumCone=y;let E=new mo({material:c,translucent:c.isTranslucent(),closed:!0});I.vertexFormat=E.vertexFormat;let X=this._geometryUpdater.createFillGeometryInstance(e,G,this._modelMatrix);this._primitive=R.add(new En({geometryInstances:X,appearance:E,asynchronous:!1,shadows:P}));let w=this._geometryUpdater.createOutlineGeometryInstance(e,G,this._modelMatrix);this._outlinePrimitive=R.add(new En({geometryInstances:w,appearance:new cn({flat:!0,translucent:w.attributes.color.value[3]!==255,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(C)}}),asynchronous:!1,shadows:P})),this._lastShow=r,this._lastOutlineShow=s,this._lastOutlineColor=O.clone(a,this._lastOutlineColor),this._lastDistanceDisplayCondition=F,this._lastOffset=h.clone(M,this._lastOffset)}else if(this._primitive.ready){let R=this._primitive,E=this._outlinePrimitive;R.show=!0,E.show=!0,R.appearance.material=c;let X=this._attributes;l(X)||(X=R.getGeometryInstanceAttributes(t),this._attributes=X),r!==this._lastShow&&(X.show=Sn.toValue(r,X.show),this._lastShow=r);let w=this._outlineAttributes;l(w)||(w=E.getGeometryInstanceAttributes(t),this._outlineAttributes=w),s!==this._lastOutlineShow&&(w.show=Sn.toValue(s,w.show),this._lastOutlineShow=s),O.equals(a,this._lastOutlineColor)||(w.color=Ot.toValue(a,w.color),O.clone(a,this._lastOutlineColor)),It.equals(F,this._lastDistanceDisplayCondition)||(X.distanceDisplayCondition=Dn.toValue(F,X.distanceDisplayCondition),w.distanceDisplayCondition=Dn.toValue(F,w.distanceDisplayCondition),It.clone(F,this._lastDistanceDisplayCondition)),h.equals(M,this._lastOffset)||(X.offset=eo.toValue(M,X.offset),w.offset=eo.toValue(M,X.offset),h.clone(M,this._lastOffset))}G&&(i.x=Math.max(i.x,.001),i.y=Math.max(i.y,.001),i.z=Math.max(i.z,.001),o=A.multiplyByScale(o,i,o),this._primitive.modelMatrix=o,this._outlinePrimitive.modelMatrix=o)};var eP=Cd;var $Jn=T(S(),1);var SJn=T(S(),1);function Z1(e){e=g(e,g.EMPTY_OBJECT);let t=g(e.vertexFormat,Pe.DEFAULT);this._vertexFormat=t,this._workerName="createPlaneGeometry"}Z1.packedLength=Pe.packedLength;Z1.pack=function(e,t,n){return n=g(n,0),Pe.pack(e._vertexFormat,t,n),t};var Ede=new Pe,qJe={vertexFormat:Ede};Z1.unpack=function(e,t,n){t=g(t,0);let i=Pe.unpack(e,t,Ede);return l(n)?(n._vertexFormat=Pe.clone(i,n._vertexFormat),n):new Z1(qJe)};var z5=new h(-.5,-.5,0),J5=new h(.5,.5,0);Z1.createGeometry=function(e){let t=e._vertexFormat,n=new pn,i,o;if(t.position){if(o=new Float64Array(4*3),o[0]=z5.x,o[1]=z5.y,o[2]=0,o[3]=J5.x,o[4]=z5.y,o[5]=0,o[6]=J5.x,o[7]=J5.y,o[8]=0,o[9]=z5.x,o[10]=J5.y,o[11]=0,n.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:o}),t.normal){let r=new Float32Array(12);r[0]=0,r[1]=0,r[2]=1,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=1,r[9]=0,r[10]=0,r[11]=1,n.normal=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:r})}if(t.st){let r=new Float32Array(8);r[0]=0,r[1]=0,r[2]=1,r[3]=0,r[4]=1,r[5]=1,r[6]=0,r[7]=1,n.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:r})}if(t.tangent){let r=new Float32Array(12);r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r[6]=1,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,n.tangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:r})}if(t.bitangent){let r=new Float32Array(12);r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=0,r[7]=1,r[8]=0,r[9]=0,r[10]=1,r[11]=0,n.bitangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:r})}i=new Uint16Array(2*3),i[0]=0,i[1]=1,i[2]=2,i[3]=0,i[4]=2,i[5]=3}return new mt({attributes:n,indices:i,primitiveType:Ae.TRIANGLES,boundingSphere:new ce(h.ZERO,Math.sqrt(2))})};var tP=Z1;var WJn=T(S(),1);function G1(){this._workerName="createPlaneOutlineGeometry"}G1.packedLength=0;G1.pack=function(e,t){return t};G1.unpack=function(e,t,n){return l(n)?n:new G1};var Wy=new h(-.5,-.5,0),Q5=new h(.5,.5,0);G1.createGeometry=function(){let e=new pn,t=new Uint16Array(4*2),n=new Float64Array(4*3);return n[0]=Wy.x,n[1]=Wy.y,n[2]=Wy.z,n[3]=Q5.x,n[4]=Wy.y,n[5]=Wy.z,n[6]=Q5.x,n[7]=Q5.y,n[8]=Wy.z,n[9]=Wy.x,n[10]=Q5.y,n[11]=Wy.z,e.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:n}),t[0]=0,t[1]=1,t[2]=1,t[3]=2,t[4]=2,t[5]=3,t[6]=3,t[7]=0,new mt({attributes:e,indices:t,primitiveType:Ae.LINES,boundingSphere:new ce(h.ZERO,Math.sqrt(2))})};var nP=G1;var $Je=new h,Ide=new O;function eQe(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function Fu(e,t){si.call(this,{entity:e,scene:t,geometryOptions:new eQe(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}l(Object.create)&&(Fu.prototype=Object.create(si.prototype),Fu.prototype.constructor=Fu);Fu.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Dn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Ut){let y;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(y=this._materialProperty.color.getValue(e,Ide)),l(y)||(y=O.WHITE),o=Ot.fromColor(y),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};let c=t.plane,d=this._options,u=t.computeModelMatrix(e),m=z.getValueOrDefault(c.plane,e,d.plane),p=z.getValueOrUndefined(c.dimensions,e,d.dimensions);return d.plane=m,d.dimensions=p,u=cz(m,p,u,u),new St({id:t,geometry:new tP(this._options),modelMatrix:u,attributes:i})};Fu.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=z.getValueOrDefault(this._outlineColorProperty,e,O.BLACK,Ide),o=this._distanceDisplayConditionProperty.getValue(e),r=t.plane,s=this._options,a=t.computeModelMatrix(e),c=z.getValueOrDefault(r.plane,e,s.plane),d=z.getValueOrUndefined(r.dimensions,e,s.dimensions);return s.plane=c,s.dimensions=d,a=cz(c,d,a,a),new St({id:t,geometry:new nP,modelMatrix:a,attributes:{show:new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ot.fromColor(i),distanceDisplayCondition:Dn.fromDistanceDisplayCondition(o)}})};Fu.prototype._isHidden=function(e,t){return!l(t.plane)||!l(t.dimensions)||!l(e.position)||si.prototype._isHidden.call(this,e,t)};Fu.prototype._getIsClosed=function(e){return!1};Fu.prototype._isDynamic=function(e,t){return!e.position.isConstant||!z.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!z.isConstant(t.outlineWidth)};Fu.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Ut,i=this._options;i.vertexFormat=n?cn.VERTEX_FORMAT:mo.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(Be.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(Be.MINIMUM_VALUE,i.dimensions)};Fu.DynamicGeometryUpdater=E1;function E1(e,t,n){ri.call(this,e,t,n)}l(Object.create)&&(E1.prototype=Object.create(ri.prototype),E1.prototype.constructor=E1);E1.prototype._isHidden=function(e,t,n){let i=this._options,o=z.getValueOrUndefined(e.position,n,$Je);return!l(o)||!l(i.plane)||!l(i.dimensions)||ri.prototype._isHidden.call(this,e,t,n)};E1.prototype._setOptions=function(e,t,n){let i=this._options;i.plane=z.getValueOrDefault(t.plane,n,i.plane),i.dimensions=z.getValueOrUndefined(t.dimensions,n,i.dimensions)};var tQe=new h,nQe=new h,iQe=new h,oQe=new h,rQe=new q,sQe=new q,aQe=new A;function cz(e,t,n,i){let o=e.normal,r=e.distance,s=h.multiplyByScalar(o,-r,iQe),a=h.clone(h.UNIT_Z,nQe);W.equalsEpsilon(Math.abs(h.dot(a,o)),1,W.EPSILON8)&&(a=h.clone(h.UNIT_Y,a));let c=h.cross(a,o,tQe);a=h.cross(o,c,a),h.normalize(c,c),h.normalize(a,a);let d=rQe;q.setColumn(d,0,c,d),q.setColumn(d,1,a,d),q.setColumn(d,2,o,d);let u=h.fromElements(t.x,t.y,1,oQe),m=q.multiplyByScale(d,u,sQe),p=A.fromRotationTranslation(m,s,aQe);return A.multiplyTransformation(n,p,i)}Fu.createPrimitiveMatrix=cz;var iP=Fu;var sjn=T(S(),1);var VQn=T(S(),1);var cQe=new h,lQe=new De,dQe=new B,uQe=new B,mQe=new h,hQe=new h,fQe=new h,oP=new h,pQe=new h,bQe=new h,Xde=new Me,yQe=new q,gQe=new q,xQe=new h;function _Qe(e,t,n,i,o,r,s,a,c){let d=e.positions,u=di.triangulate(e.positions2D,e.holes);u.length<3&&(u=[0,1,2]);let m=Ne.createTypedArray(d.length,u.length);m.set(u);let p=yQe;if(i!==0){let b=Me.fromAxisAngle(s,i,Xde);if(p=q.fromQuaternion(b,p),t.tangent||t.bitangent){b=Me.fromAxisAngle(s,-i,Xde);let R=q.fromQuaternion(b,gQe);a=h.normalize(q.multiplyByVector(R,a,a),a),t.bitangent&&(c=h.normalize(h.cross(s,a,c),c))}}else p=q.clone(q.IDENTITY,p);let y=uQe;t.st&&(y.x=n.x,y.y=n.y);let f=d.length,x=f*3,_=new Float64Array(x),C=t.normal?new Float32Array(x):void 0,V=t.tangent?new Float32Array(x):void 0,L=t.bitangent?new Float32Array(x):void 0,Z=t.st?new Float32Array(f*2):void 0,G=0,I=0,P=0,v=0,F=0;for(let b=0;b<f;b++){let R=d[b];if(_[G++]=R.x,_[G++]=R.y,_[G++]=R.z,t.st)if(l(o)&&o.positions.length===f)Z[F++]=o.positions[b].x,Z[F++]=o.positions[b].y;else{let E=q.multiplyByVector(p,R,cQe),X=r(E,dQe);B.subtract(X,y,X);let w=W.clamp(X.x/n.width,0,1),N=W.clamp(X.y/n.height,0,1);Z[F++]=w,Z[F++]=N}t.normal&&(C[I++]=s.x,C[I++]=s.y,C[I++]=s.z),t.tangent&&(V[v++]=a.x,V[v++]=a.y,V[v++]=a.z),t.bitangent&&(L[P++]=c.x,L[P++]=c.y,L[P++]=c.z)}let M=new pn;return t.position&&(M.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:_})),t.normal&&(M.normal=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:C})),t.tangent&&(M.tangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:V})),t.bitangent&&(M.bitangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:L})),t.st&&(M.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:Z})),new mt({attributes:M,indices:m,primitiveType:Ae.TRIANGLES})}function B_(e){e=g(e,g.EMPTY_OBJECT);let t=e.polygonHierarchy,n=e.textureCoordinates,i=g(e.vertexFormat,Pe.DEFAULT);this._vertexFormat=Pe.clone(i),this._polygonHierarchy=t,this._stRotation=g(e.stRotation,0),this._ellipsoid=oe.clone(g(e.ellipsoid,oe.WGS84)),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=Yn.computeHierarchyPackedLength(t,h)+Pe.packedLength+oe.packedLength+(l(n)?Yn.computeHierarchyPackedLength(n,B):1)+2}B_.fromPositions=function(e){e=g(e,g.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new B_(t)};B_.pack=function(e,t,n){return n=g(n,0),n=Yn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,Pe.pack(e._vertexFormat,t,n),n+=Pe.packedLength,t[n++]=e._stRotation,l(e._textureCoordinates)?n=Yn.packPolygonHierarchy(e._textureCoordinates,t,n,B):t[n++]=-1,t[n++]=e.packedLength,t};var TQe=oe.clone(oe.UNIT_SPHERE),SQe=new Pe,CQe={polygonHierarchy:{}};B_.unpack=function(e,t,n){t=g(t,0);let i=Yn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=oe.unpack(e,t,TQe);t+=oe.packedLength;let r=Pe.unpack(e,t,SQe);t+=Pe.packedLength;let s=e[t++],a=e[t]===-1?void 0:Yn.unpackPolygonHierarchy(e,t,B);l(a)?(t=a.startingIndex,delete a.startingIndex):t++;let c=e[t++];return l(n)||(n=new B_(CQe)),n._polygonHierarchy=i,n._ellipsoid=oe.clone(o,n._ellipsoid),n._vertexFormat=Pe.clone(r,n._vertexFormat),n._stRotation=s,n._textureCoordinates=a,n.packedLength=c,n};B_.createGeometry=function(e){let t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,o=e._textureCoordinates,r=l(o),s=n.positions;if(s=So(s,h.equalsEpsilon,!0),s.length<3)return;let a=mQe,c=hQe,d=fQe,u=pQe,m=bQe;if(!d0.computeProjectTo2DArguments(s,oP,u,m))return;if(a=h.cross(u,m,a),a=h.normalize(a,a),!h.equalsEpsilon(oP,h.ZERO,W.EPSILON6)){let F=e._ellipsoid.geodeticSurfaceNormal(oP,xQe);h.dot(a,F)<0&&(a=h.negate(a,a),u=h.negate(u,u))}let y=d0.createProjectPointsTo2DFunction(oP,u,m),f=d0.createProjectPointTo2DFunction(oP,u,m);t.tangent&&(c=h.clone(u,c)),t.bitangent&&(d=h.clone(m,d));let x=Yn.polygonsFromHierarchy(n,r,y,!1),_=x.hierarchy,C=x.polygons,V=function(F){return F},L=r?Yn.polygonsFromHierarchy(o,!0,V,!1).polygons:void 0;if(_.length===0)return;s=_[0].outerRing;let Z=ce.fromPoints(s),G=Yn.computeBoundingRectangle(a,f,s,i,lQe),I=[];for(let F=0;F<C.length;F++){let M=new St({geometry:_Qe(C[F],t,G,i,r?L[F]:void 0,f,a,c,d)});I.push(M)}let P=Mn.combineInstances(I)[0];P.attributes.position.values=new Float64Array(P.attributes.position.values),P.indices=Ne.createTypedArray(P.attributes.position.values.length/3,P.indices);let v=P.attributes;return t.position||delete v.position,new mt({attributes:v,indices:P.indices,primitiveType:P.primitiveType,boundingSphere:Z})};var rP=B_;var l4n=T(S(),1);var wQn=T(S(),1);function wr(e,t){this.position=e,l(this.position)||(this.position=new B),this.tangentPlane=t,l(this.tangentPlane)||(this.tangentPlane=wr.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(wr.prototype,{ellipsoid:{get:function(){return this.tangentPlane.ellipsoid}},x:{get:function(){return this.position.x}},y:{get:function(){return this.position.y}},conformalLatitude:{get:function(){let e=B.magnitude(this.position),t=2*this.ellipsoid.maximumRadius;return this.tangentPlane.plane.normal.z*(W.PI_OVER_TWO-2*Math.atan2(e,t))}},longitude:{get:function(){let e=W.PI_OVER_TWO+Math.atan2(this.y,this.x);return e>Math.PI&&(e-=W.TWO_PI),e}}});var I1=new he,VQe=new h;wr.prototype.getLatitude=function(e){l(e)||(e=oe.WGS84),I1.latitude=this.conformalLatitude,I1.longitude=this.longitude,I1.height=0;let t=this.ellipsoid.cartographicToCartesian(I1,VQe);return e.cartesianToCartographic(t,I1),I1.latitude};var LQe=new gn,RQe=new h,ZQe=new h;wr.fromCartesian=function(e,t){let n=W.signNotZero(e.z),i=wr.NORTH_POLE_TANGENT_PLANE,o=wr.SOUTH_POLE;n<0&&(i=wr.SOUTH_POLE_TANGENT_PLANE,o=wr.NORTH_POLE);let r=LQe;r.origin=i.ellipsoid.scaleToGeocentricSurface(e,r.origin),r.direction=h.subtract(r.origin,o,RQe),h.normalize(r.direction,r.direction);let s=ni.rayPlane(r,i.plane,ZQe),a=h.subtract(s,o,s),c=h.dot(i.xAxis,a),d=n*h.dot(i.yAxis,a);return l(t)?(t.position=new B(c,d),t.tangentPlane=i,t):new wr(new B(c,d),i)};wr.fromCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;i++)t[i]=wr.fromCartesian(e[i],t[i]);return t};wr.clone=function(e,t){if(l(e))return l(t)?(t.position=e.position,t.tangentPlane=e.tangentPlane,t):new wr(e.position,e.tangentPlane)};wr.HALF_UNIT_SPHERE=Object.freeze(new oe(.5,.5,.5));wr.NORTH_POLE=Object.freeze(new h(0,0,.5));wr.SOUTH_POLE=Object.freeze(new h(0,0,-.5));wr.NORTH_POLE_TANGENT_PLANE=Object.freeze(new kr(wr.NORTH_POLE,wr.HALF_UNIT_SPHERE));wr.SOUTH_POLE_TANGENT_PLANE=Object.freeze(new kr(wr.SOUTH_POLE,wr.HALF_UNIT_SPHERE));var fc=wr;var GQe=new he,Wde=new he;function EQe(e,t,n,i){let r=i.cartesianToCartographic(e,GQe).height,s=i.cartesianToCartographic(t,Wde);s.height=r,i.cartographicToCartesian(s,t);let a=i.cartesianToCartographic(n,Wde);a.height=r-100,i.cartographicToCartesian(a,n)}var Pde=new De,IQe=new h,XQe=new h,WQe=new h,PQe=new h,vQe=new h,wQe=new h,j5=new h,_f=new h,X1=new h,FQe=new B,AQe=new B,MQe=new h,vde=new Me,NQe=new q,UQe=new q;function lz(e){let t=e.vertexFormat,n=e.geometry,i=e.shadowVolume,o=n.attributes.position.values,r=l(n.attributes.st)?n.attributes.st.values:void 0,s=o.length,a=e.wall,c=e.top||a,d=e.bottom||a;if(t.st||t.normal||t.tangent||t.bitangent||i){let u=e.boundingRectangle,m=e.rotationAxis,p=e.projectTo2d,y=e.ellipsoid,f=e.stRotation,x=e.perPositionHeight,_=FQe;_.x=u.x,_.y=u.y;let C=t.st?new Float32Array(2*(s/3)):void 0,V;t.normal&&(x&&c&&!a?V=n.attributes.normal.values:V=new Float32Array(s));let L=t.tangent?new Float32Array(s):void 0,Z=t.bitangent?new Float32Array(s):void 0,G=i?new Float32Array(s):void 0,I=0,P=0,v=XQe,F=WQe,M=PQe,b=!0,R=NQe,E=UQe;if(f!==0){let N=Me.fromAxisAngle(m,f,vde);R=q.fromQuaternion(N,R),N=Me.fromAxisAngle(m,-f,vde),E=q.fromQuaternion(N,E)}else R=q.clone(q.IDENTITY,R),E=q.clone(q.IDENTITY,E);let X=0,w=0;c&&d&&(X=s/2,w=s/3,s/=2);for(let N=0;N<s;N+=3){let D=h.fromArray(o,N,MQe);if(t.st&&!l(r)){let k=q.multiplyByVector(R,D,IQe);k=y.scaleToGeodeticSurface(k,k);let Y=p(k,AQe);B.subtract(Y,_,Y);let U=W.clamp(Y.x/u.width,0,1),J=W.clamp(Y.y/u.height,0,1);d&&(C[I+w]=U,C[I+1+w]=J),c&&(C[I]=U,C[I+1]=J),I+=2}if(t.normal||t.tangent||t.bitangent||i){let k=P+1,Y=P+2;if(a){if(N+3<s){let U=h.fromArray(o,N+3,vQe);if(b){let J=h.fromArray(o,N+s,wQe);x&&EQe(D,U,J,y),h.subtract(U,D,U),h.subtract(J,D,J),v=h.normalize(h.cross(J,U,v),v),b=!1}h.equalsEpsilon(U,D,W.EPSILON10)&&(b=!0)}(t.tangent||t.bitangent)&&(M=y.geodeticSurfaceNormal(D,M),t.tangent&&(F=h.normalize(h.cross(M,v,F),F)))}else v=y.geodeticSurfaceNormal(D,v),(t.tangent||t.bitangent)&&(x&&(j5=h.fromArray(V,P,j5),_f=h.cross(h.UNIT_Z,j5,_f),_f=h.normalize(q.multiplyByVector(E,_f,_f),_f),t.bitangent&&(X1=h.normalize(h.cross(j5,_f,X1),X1))),F=h.cross(h.UNIT_Z,v,F),F=h.normalize(q.multiplyByVector(E,F,F),F),t.bitangent&&(M=h.normalize(h.cross(v,F,M),M)));t.normal&&(e.wall?(V[P+X]=v.x,V[k+X]=v.y,V[Y+X]=v.z):d&&(V[P+X]=-v.x,V[k+X]=-v.y,V[Y+X]=-v.z),(c&&!x||a)&&(V[P]=v.x,V[k]=v.y,V[Y]=v.z)),i&&(a&&(v=y.geodeticSurfaceNormal(D,v)),G[P+X]=-v.x,G[k+X]=-v.y,G[Y+X]=-v.z),t.tangent&&(e.wall?(L[P+X]=F.x,L[k+X]=F.y,L[Y+X]=F.z):d&&(L[P+X]=-F.x,L[k+X]=-F.y,L[Y+X]=-F.z),c&&(x?(L[P]=_f.x,L[k]=_f.y,L[Y]=_f.z):(L[P]=F.x,L[k]=F.y,L[Y]=F.z))),t.bitangent&&(d&&(Z[P+X]=M.x,Z[k+X]=M.y,Z[Y+X]=M.z),c&&(x?(Z[P]=X1.x,Z[k]=X1.y,Z[Y]=X1.z):(Z[P]=M.x,Z[k]=M.y,Z[Y]=M.z))),P+=3}}t.st&&!l(r)&&(n.attributes.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:C})),t.normal&&(n.attributes.normal=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:V})),t.tangent&&(n.attributes.tangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:L})),t.bitangent&&(n.attributes.bitangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:Z})),i&&(n.attributes.extrudeDirection=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:G}))}if(e.extrude&&l(e.offsetAttribute)){let u=o.length/3,m=new Uint8Array(u);if(e.offsetAttribute===an.TOP)c&&d||a?m=m.fill(1,0,u/2):c&&(m=m.fill(1));else{let p=e.offsetAttribute===an.NONE?0:1;m=m.fill(p)}n.attributes.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}return n}var wde=[];function kQe(e,t,n,i,o,r,s,a,c,d){let u={walls:[]},m;if(s||a){let V=Yn.createGeometryFromPositions(e,t,n,i,r,c,d),L=V.attributes.position.values,Z=V.indices,G,I;if(s&&a){let P=L.concat(L);G=P.length/3,I=Ne.createTypedArray(G,Z.length*2),I.set(Z);let v=Z.length,F=G/2;for(m=0;m<v;m+=3){let M=I[m]+F,b=I[m+1]+F,R=I[m+2]+F;I[m+v]=R,I[m+1+v]=b,I[m+2+v]=M}if(V.attributes.position.values=P,r&&c.normal){let M=V.attributes.normal.values;V.attributes.normal.values=new Float32Array(P.length),V.attributes.normal.values.set(M)}if(c.st&&l(n)){let M=V.attributes.st.values;V.attributes.st.values=new Float32Array(G*2),V.attributes.st.values=M.concat(M)}V.indices=I}else if(a){for(G=L.length/3,I=Ne.createTypedArray(G,Z.length),m=0;m<Z.length;m+=3)I[m]=Z[m+2],I[m+1]=Z[m+1],I[m+2]=Z[m];V.indices=I}u.topAndBottom=new St({geometry:V})}let p=o.outerRing,y=kr.fromPoints(p,e),f=y.projectPointsOntoPlane(p,wde),x=di.computeWindingOrder2D(f);x===ss.CLOCKWISE&&(p=p.slice().reverse());let _=Yn.computeWallGeometry(p,n,e,i,r,d);u.walls.push(new St({geometry:_}));let C=o.holes;for(m=0;m<C.length;m++){let V=C[m];f=y.projectPointsOntoPlane(V,wde),x=di.computeWindingOrder2D(f),x===ss.COUNTER_CLOCKWISE&&(V=V.slice().reverse()),_=Yn.computeWallGeometry(V,n,e,i,r,d),u.walls.push(new St({geometry:_}))}return u}function Mu(e){let t=e.polygonHierarchy,n=g(e.vertexFormat,Pe.DEFAULT),i=g(e.ellipsoid,oe.WGS84),o=g(e.granularity,W.RADIANS_PER_DEGREE),r=g(e.stRotation,0),s=e.textureCoordinates,a=g(e.perPositionHeight,!1),c=a&&l(e.extrudedHeight),d=g(e.height,0),u=g(e.extrudedHeight,d);if(!c){let m=Math.max(d,u);u=Math.min(d,u),d=m}this._vertexFormat=Pe.clone(n),this._ellipsoid=oe.clone(i),this._granularity=o,this._stRotation=r,this._height=d,this._extrudedHeight=u,this._closeTop=g(e.closeTop,!0),this._closeBottom=g(e.closeBottom,!0),this._polygonHierarchy=t,this._perPositionHeight=a,this._perPositionHeightExtrude=c,this._shadowVolume=g(e.shadowVolume,!1),this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=g(e.arcType,jt.GEODESIC),this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=s,this.packedLength=Yn.computeHierarchyPackedLength(t,h)+oe.packedLength+Pe.packedLength+(s?Yn.computeHierarchyPackedLength(s,B):1)+12}Mu.fromPositions=function(e){e=g(e,g.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,closeTop:e.closeTop,closeBottom:e.closeBottom,offsetAttribute:e.offsetAttribute,arcType:e.arcType,textureCoordinates:e.textureCoordinates};return new Mu(t)};Mu.pack=function(e,t,n){return n=g(n,0),n=Yn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,Pe.pack(e._vertexFormat,t,n),n+=Pe.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._stRotation,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._closeTop?1:0,t[n++]=e._closeBottom?1:0,t[n++]=e._shadowVolume?1:0,t[n++]=g(e._offsetAttribute,-1),t[n++]=e._arcType,l(e._textureCoordinates)?n=Yn.packPolygonHierarchy(e._textureCoordinates,t,n,B):t[n++]=-1,t[n++]=e.packedLength,t};var DQe=oe.clone(oe.UNIT_SPHERE),BQe=new Pe,OQe={polygonHierarchy:{}};Mu.unpack=function(e,t,n){t=g(t,0);let i=Yn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=oe.unpack(e,t,DQe);t+=oe.packedLength;let r=Pe.unpack(e,t,BQe);t+=Pe.packedLength;let s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++]===1,m=e[t++]===1,p=e[t++]===1,y=e[t++]===1,f=e[t++]===1,x=e[t++],_=e[t++],C=e[t]===-1?void 0:Yn.unpackPolygonHierarchy(e,t,B);l(C)?(t=C.startingIndex,delete C.startingIndex):t++;let V=e[t++];return l(n)||(n=new Mu(OQe)),n._polygonHierarchy=i,n._ellipsoid=oe.clone(o,n._ellipsoid),n._vertexFormat=Pe.clone(r,n._vertexFormat),n._height=s,n._extrudedHeight=a,n._granularity=c,n._stRotation=d,n._perPositionHeightExtrude=u,n._perPositionHeight=m,n._closeTop=p,n._closeBottom=y,n._shadowVolume=f,n._offsetAttribute=x===-1?void 0:x,n._arcType=_,n._textureCoordinates=C,n.packedLength=V,n};var YQe=new B,HQe=new B,KQe=new fc;function Fde(e,t,n,i,o,r){let s=e.longitude,a=s>=0?s:s+W.TWO_PI;o.westOverIdl=Math.min(o.westOverIdl,a),o.eastOverIdl=Math.max(o.eastOverIdl,a),r.west=Math.min(r.west,s),r.east=Math.max(r.east,s);let c=e.getLatitude(n),d=c;if(r.south=Math.min(r.south,c),r.north=Math.max(r.north,c),i!==jt.RHUMB){let p=B.subtract(t.position,e.position,YQe),y=B.dot(t.position,p)/B.dot(p,p);if(y>0&&y<1){let f=B.add(t.position,B.multiplyByScalar(p,-y,p),HQe),x=fc.clone(t,KQe);x.position=f;let _=x.getLatitude(n);r.south=Math.min(r.south,_),r.north=Math.max(r.north,_),Math.abs(c)>Math.abs(_)&&(d=_)}}let u=t.x*e.y-e.x*t.y,m=Math.sign(u);m!==0&&(m*=B.angleBetween(t.position,e.position)),d>=0&&(o.northAngle+=m),d<=0&&(o.southAngle+=m)}var Ade=new fc,zQe=new fc,Au={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};Mu.computeRectangleFromPositions=function(e,t,n,i){if(l(i)||(i=new de),e.length<3)return i;i.west=Number.POSITIVE_INFINITY,i.east=Number.NEGATIVE_INFINITY,i.south=Number.POSITIVE_INFINITY,i.north=Number.NEGATIVE_INFINITY,Au.northAngle=0,Au.southAngle=0,Au.westOverIdl=Number.POSITIVE_INFINITY,Au.eastOverIdl=Number.NEGATIVE_INFINITY;let o=e.length,r=fc.fromCartesian(e[0],zQe);for(let s=1;s<o;s++){let a=fc.fromCartesian(e[s],Ade);Fde(a,r,t,n,Au,i),r=fc.clone(a,r)}return Fde(fc.fromCartesian(e[0],Ade),r,t,n,Au,i),i.east-i.west>Au.eastOverIdl-Au.westOverIdl&&(i.west=Au.westOverIdl,i.east=Au.eastOverIdl,i.east>W.PI&&(i.east=i.east-W.TWO_PI),i.west>W.PI&&(i.west=i.west-W.TWO_PI)),W.equalsEpsilon(Math.abs(Au.northAngle),W.TWO_PI,W.EPSILON10)&&(i.north=W.PI_OVER_TWO,i.east=W.PI,i.west=-W.PI),W.equalsEpsilon(Math.abs(Au.southAngle),W.TWO_PI,W.EPSILON10)&&(i.south=-W.PI_OVER_TWO,i.east=W.PI,i.west=-W.PI),i};var JQe=new fc;function QQe(e,t,n){return e.height>=W.PI||e.width>=W.PI?fc.fromCartesian(t[0],JQe).tangentPlane:kr.fromPoints(t,n)}var Mde=new he;function jQe(e,t,n){return(i,o)=>{if(e.height>=W.PI||e.width>=W.PI){if(e.south<0&&e.north>0){l(o)||(o=[]);for(let s=0;s<i.length;++s){let a=n.cartesianToCartographic(i[s],Mde);o[s]=new B(a.longitude/W.PI,a.latitude/W.PI_OVER_TWO)}return o.length=i.length,o}return fc.fromCartesianArray(i,o)}return kr.fromPoints(t,n).projectPointsOntoPlane(i,o)}}function qQe(e,t,n){if(e.height>=W.PI||e.width>=W.PI)return(o,r)=>{if(e.south<0&&e.north>0){let s=n.cartesianToCartographic(o,Mde);return l(r)||(r=new B),r.x=s.longitude/W.PI,r.y=s.latitude/W.PI_OVER_TWO,r}return fc.fromCartesian(o,r)};let i=kr.fromPoints(t,n);return(o,r)=>i.projectPointOntoPlane(o,r)}function $Qe(e,t,n,i){return(o,r)=>!i&&(e.height>=W.PI_OVER_TWO||e.width>=2*W.PI_OVER_THREE)?Yn.splitPolygonsOnEquator(o,t,n,r):o}function e4e(e,t,n,i){if(t.height>=W.PI||t.width>=W.PI)return De.fromRectangle(t,void 0,Pde);let o=e,r=kr.fromPoints(o,n);return Yn.computeBoundingRectangle(r.plane.normal,r.projectPointOntoPlane.bind(r),o,i,Pde)}Mu.createGeometry=function(e){let t=e._vertexFormat,n=e._ellipsoid,i=e._granularity,o=e._stRotation,r=e._polygonHierarchy,s=e._perPositionHeight,a=e._closeTop,c=e._closeBottom,d=e._arcType,u=e._textureCoordinates,m=l(u),p=r.positions;if(p.length<3)return;let y=e.rectangle,f=Yn.polygonsFromHierarchy(r,m,jQe(y,p,n),!s,n,$Qe(y,n,d,s)),x=f.hierarchy,_=f.polygons,C=function(X){return X},V=m?Yn.polygonsFromHierarchy(u,!0,C,!1,n).polygons:void 0;if(x.length===0)return;let L=x[0].outerRing,Z=e4e(L,y,n,o),G=[],I=e._height,P=e._extrudedHeight,v=e._perPositionHeightExtrude||!W.equalsEpsilon(I,P,0,W.EPSILON2),F={perPositionHeight:s,vertexFormat:t,geometry:void 0,rotationAxis:QQe(y,L,n).plane.normal,projectTo2d:qQe(y,L,n),boundingRectangle:Z,ellipsoid:n,stRotation:o,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:d},M;if(v)for(F.extrude=!0,F.top=a,F.bottom=c,F.shadowVolume=e._shadowVolume,F.offsetAttribute=e._offsetAttribute,M=0;M<_.length;M++){let X=kQe(n,_[M],m?V[M]:void 0,i,x[M],s,a,c,t,d),w;a&&c?(w=X.topAndBottom,F.geometry=Yn.scaleToGeodeticHeightExtruded(w.geometry,I,P,n,s)):a?(w=X.topAndBottom,w.geometry.attributes.position.values=di.scaleToGeodeticHeight(w.geometry.attributes.position.values,I,n,!s),F.geometry=w.geometry):c&&(w=X.topAndBottom,w.geometry.attributes.position.values=di.scaleToGeodeticHeight(w.geometry.attributes.position.values,P,n,!0),F.geometry=w.geometry),(a||c)&&(F.wall=!1,w.geometry=lz(F),G.push(w));let N=X.walls;F.wall=!0;for(let D=0;D<N.length;D++){let k=N[D];F.geometry=Yn.scaleToGeodeticHeightExtruded(k.geometry,I,P,n,s),k.geometry=lz(F),G.push(k)}}else for(M=0;M<_.length;M++){let X=new St({geometry:Yn.createGeometryFromPositions(n,_[M],m?V[M]:void 0,i,s,t,d)});if(X.geometry.attributes.position.values=di.scaleToGeodeticHeight(X.geometry.attributes.position.values,I,n,!s),F.geometry=X.geometry,X.geometry=lz(F),l(e._offsetAttribute)){let w=X.geometry.attributes.position.values.length,N=e._offsetAttribute===an.NONE?0:1,D=new Uint8Array(w/3).fill(N);X.geometry.attributes.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:D})}G.push(X)}let b=Mn.combineInstances(G)[0];b.attributes.position.values=new Float64Array(b.attributes.position.values),b.indices=Ne.createTypedArray(b.attributes.position.values.length/3,b.indices);let R=b.attributes,E=ce.fromVertices(R.position.values);return t.position||delete R.position,new mt({attributes:R,indices:b.indices,primitiveType:b.primitiveType,boundingSphere:E,offsetAttribute:e._offsetAttribute})};Mu.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Mu({polygonHierarchy:e._polygonHierarchy,ellipsoid:o,stRotation:e._stRotation,granularity:i,perPositionHeight:!1,extrudedHeight:r,height:s,vertexFormat:Pe.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})};function t4e(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let n=e._ellipsoid,i=e._polygonHierarchy.positions,o=e.rectangle;return mt._textureCoordinateRotationPoints(i,t,n,o)}Object.defineProperties(Mu.prototype,{rectangle:{get:function(){if(!l(this._rectangle)){let e=this._polygonHierarchy.positions;this._rectangle=Mu.computeRectangleFromPositions(e,this._ellipsoid,this._arcType)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=t4e(this)),this._textureCoordinateRotationPoints}}});var O_=Mu;var X4n=T(S(),1);var Nde=[],q5=[];function n4e(e,t,n,i,o){let s=kr.fromPoints(t,e).projectPointsOntoPlane(t,Nde);di.computeWindingOrder2D(s)===ss.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,d,u=t.length,m=0;if(i)for(c=new Float64Array(u*2*3),d=0;d<u;d++){let f=t[d],x=t[(d+1)%u];c[m++]=f.x,c[m++]=f.y,c[m++]=f.z,c[m++]=x.x,c[m++]=x.y,c[m++]=x.z}else{let f=0;if(o===jt.GEODESIC)for(d=0;d<u;d++)f+=Yn.subdivideLineCount(t[d],t[(d+1)%u],n);else if(o===jt.RHUMB)for(d=0;d<u;d++)f+=Yn.subdivideRhumbLineCount(e,t[d],t[(d+1)%u],n);for(c=new Float64Array(f*3),d=0;d<u;d++){let x;o===jt.GEODESIC?x=Yn.subdivideLine(t[d],t[(d+1)%u],n,q5):o===jt.RHUMB&&(x=Yn.subdivideRhumbLine(e,t[d],t[(d+1)%u],n,q5));let _=x.length;for(let C=0;C<_;++C)c[m++]=x[C]}}u=c.length/3;let p=u*2,y=Ne.createTypedArray(u,p);for(m=0,d=0;d<u-1;d++)y[m++]=d,y[m++]=d+1;return y[m++]=u-1,y[m++]=0,new St({geometry:new mt({attributes:new pn({position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:c})}),indices:y,primitiveType:Ae.LINES})})}function i4e(e,t,n,i,o){let s=kr.fromPoints(t,e).projectPointsOntoPlane(t,Nde);di.computeWindingOrder2D(s)===ss.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,d,u=t.length,m=new Array(u),p=0;if(i)for(c=new Float64Array(u*2*3*2),d=0;d<u;++d){m[d]=p/3;let _=t[d],C=t[(d+1)%u];c[p++]=_.x,c[p++]=_.y,c[p++]=_.z,c[p++]=C.x,c[p++]=C.y,c[p++]=C.z}else{let _=0;if(o===jt.GEODESIC)for(d=0;d<u;d++)_+=Yn.subdivideLineCount(t[d],t[(d+1)%u],n);else if(o===jt.RHUMB)for(d=0;d<u;d++)_+=Yn.subdivideRhumbLineCount(e,t[d],t[(d+1)%u],n);for(c=new Float64Array(_*3*2),d=0;d<u;++d){m[d]=p/3;let C;o===jt.GEODESIC?C=Yn.subdivideLine(t[d],t[(d+1)%u],n,q5):o===jt.RHUMB&&(C=Yn.subdivideRhumbLine(e,t[d],t[(d+1)%u],n,q5));let V=C.length;for(let L=0;L<V;++L)c[p++]=C[L]}}u=c.length/(3*2);let y=m.length,f=(u*2+y)*2,x=Ne.createTypedArray(u+y,f);for(p=0,d=0;d<u;++d)x[p++]=d,x[p++]=(d+1)%u,x[p++]=d+u,x[p++]=(d+1)%u+u;for(d=0;d<y;d++){let _=m[d];x[p++]=_,x[p++]=_+u}return new St({geometry:new mt({attributes:new pn({position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:c})}),indices:x,primitiveType:Ae.LINES})})}function Y_(e){let t=e.polygonHierarchy,n=g(e.ellipsoid,oe.WGS84),i=g(e.granularity,W.RADIANS_PER_DEGREE),o=g(e.perPositionHeight,!1),r=o&&l(e.extrudedHeight),s=g(e.arcType,jt.GEODESIC),a=g(e.height,0),c=g(e.extrudedHeight,a);if(!r){let d=Math.max(a,c);c=Math.min(a,c),a=d}this._ellipsoid=oe.clone(n),this._granularity=i,this._height=a,this._extrudedHeight=c,this._arcType=s,this._polygonHierarchy=t,this._perPositionHeight=o,this._perPositionHeightExtrude=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=Yn.computeHierarchyPackedLength(t,h)+oe.packedLength+8}Y_.pack=function(e,t,n){return n=g(n,0),n=Yn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._arcType,t[n++]=g(e._offsetAttribute,-1),t[n]=e.packedLength,t};var o4e=oe.clone(oe.UNIT_SPHERE),r4e={polygonHierarchy:{}};Y_.unpack=function(e,t,n){t=g(t,0);let i=Yn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=oe.unpack(e,t,o4e);t+=oe.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++]===1,d=e[t++]===1,u=e[t++],m=e[t++],p=e[t];return l(n)||(n=new Y_(r4e)),n._polygonHierarchy=i,n._ellipsoid=oe.clone(o,n._ellipsoid),n._height=r,n._extrudedHeight=s,n._granularity=a,n._perPositionHeight=d,n._perPositionHeightExtrude=c,n._arcType=u,n._offsetAttribute=m===-1?void 0:m,n.packedLength=p,n};Y_.fromPositions=function(e){e=g(e,g.EMPTY_OBJECT);let t={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};return new Y_(t)};Y_.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,o=e._perPositionHeight,r=e._arcType,s=Yn.polygonOutlinesFromHierarchy(i,!o,t);if(s.length===0)return;let a,c=[],d=W.chordLength(n,t.maximumRadius),u=e._height,m=e._extrudedHeight,p=e._perPositionHeightExtrude||!W.equalsEpsilon(u,m,0,W.EPSILON2),y,f;if(p)for(f=0;f<s.length;f++){if(a=i4e(t,s[f],d,o,r),a.geometry=Yn.scaleToGeodeticHeightExtruded(a.geometry,u,m,t,o),l(e._offsetAttribute)){let C=a.geometry.attributes.position.values.length/3,V=new Uint8Array(C);e._offsetAttribute===an.TOP?V=V.fill(1,0,C/2):(y=e._offsetAttribute===an.NONE?0:1,V=V.fill(y)),a.geometry.attributes.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:V})}c.push(a)}else for(f=0;f<s.length;f++){if(a=n4e(t,s[f],d,o,r),a.geometry.attributes.position.values=di.scaleToGeodeticHeight(a.geometry.attributes.position.values,u,t,!o),l(e._offsetAttribute)){let C=a.geometry.attributes.position.values.length;y=e._offsetAttribute===an.NONE?0:1;let V=new Uint8Array(C/3).fill(y);a.geometry.attributes.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:V})}c.push(a)}let x=Mn.combineInstances(c)[0],_=ce.fromVertices(x.attributes.position.values);return new mt({attributes:x.attributes,indices:x.indices,primitiveType:x.primitiveType,boundingSphere:_,offsetAttribute:e._offsetAttribute})};var sP=Y_;var Ude="Entity polygons cannot have both height and perPositionHeight. height will be ignored",kde="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",Dde=new O,Bde=h.ZERO,Ode=new h,Yde=new de,s4e=[],a4e=new B;function c4e(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,this.textureCoordinates=void 0}function Vd(e,t){zn.call(this,{entity:e,scene:t,geometryOptions:new c4e(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}l(Object.create)&&(Vd.prototype=Object.create(zn.prototype),Vd.prototype.constructor=Vd);Vd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o={show:new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Dn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Ut){let s;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,Dde)),l(s)||(s=O.WHITE),o.color=Ot.fromColor(s)}l(i.offsetAttribute)&&(o.offset=eo.fromCartesian3(z.getValueOrDefault(this._terrainOffsetProperty,e,Bde,Ode)));let r;return i.perPositionHeight&&!l(i.extrudedHeight)?r=new rP(i):r=new O_(i),new St({id:t,geometry:r,attributes:o})};Vd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o=z.getValueOrDefault(this._outlineColorProperty,e,O.BLACK,Dde),r=this._distanceDisplayConditionProperty.getValue(e),s={show:new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ot.fromColor(o),distanceDisplayCondition:Dn.fromDistanceDisplayCondition(r),offset:void 0};l(i.offsetAttribute)&&(s.offset=eo.fromCartesian3(z.getValueOrDefault(this._terrainOffsetProperty,e,Bde,Ode)));let a;return i.perPositionHeight&&!l(i.extrudedHeight)?a=new Gu(i):a=new sP(i),new St({id:t,geometry:a,attributes:s})};Vd.prototype._computeCenter=function(e,t){let n=z.getValueOrUndefined(this._entity.polygon.hierarchy,e);if(!l(n))return;let i=n.positions;if(i.length===0)return;let o=this._scene.mapProjection.ellipsoid,r=kr.fromPoints(i,o),s=r.projectPointsOntoPlane(i,s4e),a=s.length,c=0,d=a-1,u=new B;for(let p=0;p<a;d=p++){let y=s[p],f=s[d],x=y.x*f.y-f.x*y.y,_=B.add(y,f,a4e);_=B.multiplyByScalar(_,x,_),u=B.add(u,_,u),c+=x}let m=1/(c*3);return u=B.multiplyByScalar(u,m,u),r.projectPointOntoEllipsoid(u,t)};Vd.prototype._isHidden=function(e,t){return!l(t.hierarchy)||si.prototype._isHidden.call(this,e,t)};Vd.prototype._isOnTerrain=function(e,t){let n=zn.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,o=l(i)&&(i.isConstant?i.getValue(Be.MINIMUM_VALUE):!0);return n&&!o};Vd.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!z.isConstant(t.height)||!z.isConstant(t.extrudedHeight)||!z.isConstant(t.granularity)||!z.isConstant(t.stRotation)||!z.isConstant(t.textureCoordinates)||!z.isConstant(t.outlineWidth)||!z.isConstant(t.perPositionHeight)||!z.isConstant(t.closeTop)||!z.isConstant(t.closeBottom)||!z.isConstant(t.zIndex)||!z.isConstant(t.arcType)||this._onTerrain&&!z.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Ut)};Vd.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Ut,i=this._options;i.vertexFormat=n?cn.VERTEX_FORMAT:mo.MaterialSupport.TEXTURED.vertexFormat;let o=t.hierarchy.getValue(Be.MINIMUM_VALUE),r=z.getValueOrUndefined(t.height,Be.MINIMUM_VALUE),s=z.getValueOrDefault(t.heightReference,Be.MINIMUM_VALUE,Qe.NONE),a=z.getValueOrUndefined(t.extrudedHeight,Be.MINIMUM_VALUE),c=z.getValueOrDefault(t.extrudedHeightReference,Be.MINIMUM_VALUE,Qe.NONE),d=z.getValueOrDefault(t.perPositionHeight,Be.MINIMUM_VALUE,!1);r=zn.getGeometryHeight(r,s);let u;if(d?(l(r)&&(r=void 0,Ft(Ude)),s!==Qe.NONE&&d&&(r=void 0,Ft(kde))):(l(a)&&!l(r)&&(r=0),u=zn.computeGeometryOffsetAttribute(r,s,a,c)),i.polygonHierarchy=o,i.granularity=z.getValueOrUndefined(t.granularity,Be.MINIMUM_VALUE),i.stRotation=z.getValueOrUndefined(t.stRotation,Be.MINIMUM_VALUE),i.perPositionHeight=d,i.closeTop=z.getValueOrDefault(t.closeTop,Be.MINIMUM_VALUE,!0),i.closeBottom=z.getValueOrDefault(t.closeBottom,Be.MINIMUM_VALUE,!0),i.offsetAttribute=u,i.height=r,i.arcType=z.getValueOrDefault(t.arcType,Be.MINIMUM_VALUE,jt.GEODESIC),i.textureCoordinates=z.getValueOrUndefined(t.textureCoordinates,Be.MINIMUM_VALUE),a=zn.getGeometryExtrudedHeight(a,c),a===zn.CLAMP_TO_GROUND){let m=O_.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,Yde);a=hi.getMinimumMaximumHeights(m).minimumTerrainHeight}i.extrudedHeight=a};Vd.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight,i=l(n)&&n!==t;return!e.perPositionHeight&&(!i&&t===0||i&&e.closeTop&&e.closeBottom)};Vd.DynamicGeometryUpdater=W1;function W1(e,t,n){ri.call(this,e,t,n)}l(Object.create)&&(W1.prototype=Object.create(ri.prototype),W1.prototype.constructor=W1);W1.prototype._isHidden=function(e,t,n){return!l(this._options.polygonHierarchy)||ri.prototype._isHidden.call(this,e,t,n)};W1.prototype._setOptions=function(e,t,n){let i=this._options;i.polygonHierarchy=z.getValueOrUndefined(t.hierarchy,n);let o=z.getValueOrUndefined(t.height,n),r=z.getValueOrDefault(t.heightReference,n,Qe.NONE),s=z.getValueOrDefault(t.extrudedHeightReference,n,Qe.NONE),a=z.getValueOrUndefined(t.extrudedHeight,n),c=z.getValueOrUndefined(t.perPositionHeight,n);o=zn.getGeometryHeight(o,s);let d;if(c?(l(o)&&(o=void 0,Ft(Ude)),r!==Qe.NONE&&c&&(o=void 0,Ft(kde))):(l(a)&&!l(o)&&(o=0),d=zn.computeGeometryOffsetAttribute(o,r,a,s)),i.granularity=z.getValueOrUndefined(t.granularity,n),i.stRotation=z.getValueOrUndefined(t.stRotation,n),i.textureCoordinates=z.getValueOrUndefined(t.textureCoordinates,n),i.perPositionHeight=z.getValueOrUndefined(t.perPositionHeight,n),i.closeTop=z.getValueOrDefault(t.closeTop,n,!0),i.closeBottom=z.getValueOrDefault(t.closeBottom,n,!0),i.offsetAttribute=d,i.height=o,i.arcType=z.getValueOrDefault(t.arcType,n,jt.GEODESIC),a=zn.getGeometryExtrudedHeight(a,s),a===zn.CLAMP_TO_GROUND){let u=O_.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,Yde);a=hi.getMinimumMaximumHeights(u).minimumTerrainHeight}i.extrudedHeight=a};var aP=Vd;var f8n=T(S(),1);var Ijn=T(S(),1);function l4e(e,t,n,i){let o=new pn;i.position&&(o.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:e}));let r=t.length,s=e.length/3,a=(s-r*2)/(r*2),c=di.triangulate(t),d=(a-1)*r*6+c.length*2,u=Ne.createTypedArray(s,d),m,p,y,f,x,_,C=r*2,V=0;for(m=0;m<a-1;m++){for(p=0;p<r-1;p++)y=p*2+m*r*2,_=y+C,f=y+1,x=f+C,u[V++]=f,u[V++]=y,u[V++]=x,u[V++]=x,u[V++]=y,u[V++]=_;y=r*2-2+m*r*2,f=y+1,x=f+C,_=y+C,u[V++]=f,u[V++]=y,u[V++]=x,u[V++]=x,u[V++]=y,u[V++]=_}if(i.st||i.tangent||i.bitangent){let G=new Float32Array(s*2),I=1/(a-1),P=1/n.height,v=n.height/2,F,M,b=0;for(m=0;m<a;m++){for(F=m*I,M=P*(t[0].y+v),G[b++]=F,G[b++]=M,p=1;p<r;p++)M=P*(t[p].y+v),G[b++]=F,G[b++]=M,G[b++]=F,G[b++]=M;M=P*(t[0].y+v),G[b++]=F,G[b++]=M}for(p=0;p<r;p++)F=0,M=P*(t[p].y+v),G[b++]=F,G[b++]=M;for(p=0;p<r;p++)F=(a-1)*I,M=P*(t[p].y+v),G[b++]=F,G[b++]=M;o.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:new Float32Array(G)})}let L=s-r*2;for(m=0;m<c.length;m+=3){let G=c[m]+L,I=c[m+1]+L,P=c[m+2]+L;u[V++]=G,u[V++]=I,u[V++]=P,u[V++]=P+r,u[V++]=I+r,u[V++]=G+r}let Z=new mt({attributes:o,indices:u,boundingSphere:ce.fromVertices(e),primitiveType:Ae.TRIANGLES});if(i.normal&&(Z=Mn.computeNormal(Z)),i.tangent||i.bitangent){try{Z=Mn.computeTangentAndBitangent(Z)}catch{Ft("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}i.tangent||(Z.attributes.tangent=void 0),i.bitangent||(Z.attributes.bitangent=void 0),i.st||(Z.attributes.st=void 0)}return Z}function lP(e){e=g(e,g.EMPTY_OBJECT);let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=oe.clone(g(e.ellipsoid,oe.WGS84)),this._cornerType=g(e.cornerType,Ii.ROUNDED),this._vertexFormat=Pe.clone(g(e.vertexFormat,Pe.DEFAULT)),this._granularity=g(e.granularity,W.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*B.packedLength,this.packedLength=i+oe.packedLength+Pe.packedLength+2}lP.pack=function(e,t,n){n=g(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=B.packedLength)B.pack(s[i],t,n);return oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,Pe.pack(e._vertexFormat,t,n),n+=Pe.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Hde=oe.clone(oe.UNIT_SPHERE),Kde=new Pe,cP={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Hde,vertexFormat:Kde,cornerType:void 0,granularity:void 0};lP.unpack=function(e,t,n){t=g(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=B.packedLength)s[i]=B.unpack(e,t);let a=oe.unpack(e,t,Hde);t+=oe.packedLength;let c=Pe.unpack(e,t,Kde);t+=Pe.packedLength;let d=e[t++],u=e[t];return l(n)?(n._positions=r,n._shape=s,n._ellipsoid=oe.clone(a,n._ellipsoid),n._vertexFormat=Pe.clone(c,n._vertexFormat),n._cornerType=d,n._granularity=u,n):(cP.polylinePositions=r,cP.shapePositions=s,cP.cornerType=d,cP.granularity=u,new lP(cP))};var d4e=new De;lP.createGeometry=function(e){let t=e._positions,n=So(t,h.equalsEpsilon),i=e._shape;if(i=Jm.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;di.computeWindingOrder2D(i)===ss.CLOCKWISE&&i.reverse();let o=De.fromPoints(i,d4e),r=Jm.computePositions(n,i,o,e,!0);return l4e(r,i,o,e._vertexFormat)};var dP=lP;var jjn=T(S(),1);function u4e(e,t){let n=new pn;n.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:e});let i=t.length,o=n.position.values.length/3,s=e.length/3/i,a=Ne.createTypedArray(o,2*i*(s+1)),c,d,u=0;c=0;let m=c*i;for(d=0;d<i-1;d++)a[u++]=d+m,a[u++]=d+m+1;for(a[u++]=i-1+m,a[u++]=m,c=s-1,m=c*i,d=0;d<i-1;d++)a[u++]=d+m,a[u++]=d+m+1;for(a[u++]=i-1+m,a[u++]=m,c=0;c<s-1;c++){let y=i*c,f=y+i;for(d=0;d<i;d++)a[u++]=d+y,a[u++]=d+f}return new mt({attributes:n,indices:Ne.createTypedArray(o,a),boundingSphere:ce.fromVertices(e),primitiveType:Ae.LINES})}function mP(e){e=g(e,g.EMPTY_OBJECT);let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=oe.clone(g(e.ellipsoid,oe.WGS84)),this._cornerType=g(e.cornerType,Ii.ROUNDED),this._granularity=g(e.granularity,W.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*B.packedLength,this.packedLength=i+oe.packedLength+2}mP.pack=function(e,t,n){n=g(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=B.packedLength)B.pack(s[i],t,n);return oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var zde=oe.clone(oe.UNIT_SPHERE),uP={polylinePositions:void 0,shapePositions:void 0,ellipsoid:zde,height:void 0,cornerType:void 0,granularity:void 0};mP.unpack=function(e,t,n){t=g(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=B.packedLength)s[i]=B.unpack(e,t);let a=oe.unpack(e,t,zde);t+=oe.packedLength;let c=e[t++],d=e[t];return l(n)?(n._positions=r,n._shape=s,n._ellipsoid=oe.clone(a,n._ellipsoid),n._cornerType=c,n._granularity=d,n):(uP.polylinePositions=r,uP.shapePositions=s,uP.cornerType=c,uP.granularity=d,new mP(uP))};var m4e=new De;mP.createGeometry=function(e){let t=e._positions,n=So(t,h.equalsEpsilon),i=e._shape;if(i=Jm.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;di.computeWindingOrder2D(i)===ss.CLOCKWISE&&i.reverse();let o=De.fromPoints(i,m4e),r=Jm.computePositions(n,i,o,e,!1);return u4e(r,i)};var hP=mP;var Jde=new O;function h4e(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 Tf(e,t){si.call(this,{entity:e,scene:t,geometryOptions:new h4e(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}l(Object.create)&&(Tf.prototype=Object.create(si.prototype),Tf.prototype.constructor=Tf);Tf.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Dn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Ut){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,Jde)),l(c)||(c=O.WHITE),o=Ot.fromColor(c),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new St({id:t,geometry:new dP(this._options),attributes:i})};Tf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=z.getValueOrDefault(this._outlineColorProperty,e,O.BLACK,Jde),o=this._distanceDisplayConditionProperty.getValue(e);return new St({id:t,geometry:new hP(this._options),attributes:{show:new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ot.fromColor(i),distanceDisplayCondition:Dn.fromDistanceDisplayCondition(o)}})};Tf.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.shape)||si.prototype._isHidden.call(this,e,t)};Tf.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!z.isConstant(t.granularity)||!z.isConstant(t.outlineWidth)||!z.isConstant(t.cornerType)};Tf.prototype._setStaticOptions=function(e,t){let n=t.granularity,i=t.cornerType,o=this._options,r=this._materialProperty instanceof Ut;o.vertexFormat=r?cn.VERTEX_FORMAT:mo.MaterialSupport.TEXTURED.vertexFormat,o.polylinePositions=t.positions.getValue(Be.MINIMUM_VALUE,o.polylinePositions),o.shapePositions=t.shape.getValue(Be.MINIMUM_VALUE,o.shape),o.granularity=l(n)?n.getValue(Be.MINIMUM_VALUE):void 0,o.cornerType=l(i)?i.getValue(Be.MINIMUM_VALUE):void 0};Tf.DynamicGeometryUpdater=P1;function P1(e,t,n){ri.call(this,e,t,n)}l(Object.create)&&(P1.prototype=Object.create(ri.prototype),P1.prototype.constructor=P1);P1.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.polylinePositions)||!l(i.shapePositions)||ri.prototype._isHidden.call(this,e,t,n)};P1.prototype._setOptions=function(e,t,n){let i=this._options;i.polylinePositions=z.getValueOrUndefined(t.positions,n,i.polylinePositions),i.shapePositions=z.getValueOrUndefined(t.shape,n),i.granularity=z.getValueOrUndefined(t.granularity,n),i.cornerType=z.getValueOrUndefined(t.cornerType,n)};var fP=Tf;var u7n=T(S(),1);var U8n=T(S(),1);var dz=new h,qde=new h,$de=new h,eue=new h,tue=new de,f4e=new B,p4e=new ce,b4e=new ce;function nue(e,t){let n=new mt({attributes:new pn,primitiveType:Ae.TRIANGLES});return n.attributes.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(n.attributes.bitangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:t.bitangents})),n}function y4e(e,t,n,i){let o=e.length,r=t.normal?new Float32Array(o):void 0,s=t.tangent?new Float32Array(o):void 0,a=t.bitangent?new Float32Array(o):void 0,c=0,d=eue,u=$de,m=qde;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<o;p+=3){let y=h.fromArray(e,p,dz),f=c+1,x=c+2;m=n.geodeticSurfaceNormal(y,m),(t.tangent||t.bitangent)&&(h.cross(h.UNIT_Z,m,u),q.multiplyByVector(i,u,u),h.normalize(u,u),t.bitangent&&h.normalize(h.cross(m,u,d),d)),t.normal&&(r[c]=m.x,r[f]=m.y,r[x]=m.z),t.tangent&&(s[c]=u.x,s[f]=u.y,s[x]=u.z),t.bitangent&&(a[c]=d.x,a[f]=d.y,a[x]=d.z),c+=3}return nue(t,{positions:e,normals:r,tangents:s,bitangents:a})}var uz=new h,iue=new h;function g4e(e,t,n){let i=e.length,o=t.normal?new Float32Array(i):void 0,r=t.tangent?new Float32Array(i):void 0,s=t.bitangent?new Float32Array(i):void 0,a=0,c=0,d=0,u=!0,m=eue,p=$de,y=qde;if(t.normal||t.tangent||t.bitangent)for(let f=0;f<i;f+=6){let x=h.fromArray(e,f,dz),_=h.fromArray(e,(f+6)%i,uz);if(u){let C=h.fromArray(e,(f+3)%i,iue);h.subtract(_,x,_),h.subtract(C,x,C),y=h.normalize(h.cross(C,_,y),y),u=!1}h.equalsEpsilon(_,x,W.EPSILON10)&&(u=!0),(t.tangent||t.bitangent)&&(m=n.geodeticSurfaceNormal(x,m),t.tangent&&(p=h.normalize(h.cross(m,y,p),p))),t.normal&&(o[a++]=y.x,o[a++]=y.y,o[a++]=y.z,o[a++]=y.x,o[a++]=y.y,o[a++]=y.z),t.tangent&&(r[c++]=p.x,r[c++]=p.y,r[c++]=p.z,r[c++]=p.x,r[c++]=p.y,r[c++]=p.z),t.bitangent&&(s[d++]=m.x,s[d++]=m.y,s[d++]=m.z,s[d++]=m.x,s[d++]=m.y,s[d++]=m.z)}return nue(t,{positions:e,normals:o,tangents:r,bitangents:s})}function oue(e,t){let n=e._vertexFormat,i=e._ellipsoid,o=t.height,r=t.width,s=t.northCap,a=t.southCap,c=0,d=o,u=o,m=0;s&&(c=1,u-=1,m+=1),a&&(d-=1,u-=1,m+=1),m+=r*u;let p=n.position?new Float64Array(m*3):void 0,y=n.st?new Float32Array(m*2):void 0,f=0,x=0,_=dz,C=f4e,V=Number.MAX_VALUE,L=Number.MAX_VALUE,Z=-Number.MAX_VALUE,G=-Number.MAX_VALUE;for(let R=c;R<d;++R)for(let E=0;E<r;++E)Ss.computePosition(t,i,n.st,R,E,_,C),p[f++]=_.x,p[f++]=_.y,p[f++]=_.z,n.st&&(y[x++]=C.x,y[x++]=C.y,V=Math.min(V,C.x),L=Math.min(L,C.y),Z=Math.max(Z,C.x),G=Math.max(G,C.y));if(s&&(Ss.computePosition(t,i,n.st,0,0,_,C),p[f++]=_.x,p[f++]=_.y,p[f++]=_.z,n.st&&(y[x++]=C.x,y[x++]=C.y,V=C.x,L=C.y,Z=C.x,G=C.y)),a&&(Ss.computePosition(t,i,n.st,o-1,0,_,C),p[f++]=_.x,p[f++]=_.y,p[f]=_.z,n.st&&(y[x++]=C.x,y[x]=C.y,V=Math.min(V,C.x),L=Math.min(L,C.y),Z=Math.max(Z,C.x),G=Math.max(G,C.y))),n.st&&(V<0||L<0||Z>1||G>1))for(let R=0;R<y.length;R+=2)y[R]=(y[R]-V)/(Z-V),y[R+1]=(y[R+1]-L)/(G-L);let I=y4e(p,n,i,t.tangentRotationMatrix),P=6*(r-1)*(u-1);s&&(P+=3*(r-1)),a&&(P+=3*(r-1));let v=Ne.createTypedArray(m,P),F=0,M=0,b;for(b=0;b<u-1;++b){for(let R=0;R<r-1;++R){let E=F,X=E+r,w=X+1,N=E+1;v[M++]=E,v[M++]=X,v[M++]=N,v[M++]=N,v[M++]=X,v[M++]=w,++F}++F}if(s||a){let R=m-1,E=m-1;s&&a&&(R=m-2);let X,w;if(F=0,s)for(b=0;b<r-1;b++)X=F,w=X+1,v[M++]=R,v[M++]=X,v[M++]=w,++F;if(a)for(F=(u-1)*r,b=0;b<r-1;b++)X=F,w=X+1,v[M++]=X,v[M++]=E,v[M++]=w,++F}return I.indices=v,n.st&&(I.attributes.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:y})),I}function v1(e,t,n,i,o){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n+2],e[t++]=o[n],e[t++]=o[n+1],e[t]=o[n+2],e}function w1(e,t,n,i){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n],e[t]=i[n+1],e}var mz=new Pe;function x4e(e,t){let n=e._shadowVolume,i=e._offsetAttribute,o=e._vertexFormat,r=e._extrudedHeight,s=e._surfaceHeight,a=e._ellipsoid,c=t.height,d=t.width,u;if(n){let it=Pe.clone(o,mz);it.normal=!0,e._vertexFormat=it}let m=oue(e,t);n&&(e._vertexFormat=o);let p=di.scaleToGeodeticHeight(m.attributes.position.values,s,a,!1);p=new Float64Array(p);let y=p.length,f=y*2,x=new Float64Array(f);x.set(p);let _=di.scaleToGeodeticHeight(m.attributes.position.values,r,a);x.set(_,y),m.attributes.position.values=x;let C=o.normal?new Float32Array(f):void 0,V=o.tangent?new Float32Array(f):void 0,L=o.bitangent?new Float32Array(f):void 0,Z=o.st?new Float32Array(f/3*2):void 0,G,I;if(o.normal){for(I=m.attributes.normal.values,C.set(I),u=0;u<y;u++)I[u]=-I[u];C.set(I,y),m.attributes.normal.values=C}if(n){I=m.attributes.normal.values,o.normal||(m.attributes.normal=void 0);let it=new Float32Array(f);for(u=0;u<y;u++)I[u]=-I[u];it.set(I,y),m.attributes.extrudeDirection=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:it})}let P,v=l(i);if(v){let it=y/3*2,en=new Uint8Array(it);i===an.TOP?en=en.fill(1,0,it/2):(P=i===an.NONE?0:1,en=en.fill(P)),m.attributes.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:en})}if(o.tangent){let it=m.attributes.tangent.values;for(V.set(it),u=0;u<y;u++)it[u]=-it[u];V.set(it,y),m.attributes.tangent.values=V}if(o.bitangent){let it=m.attributes.bitangent.values;L.set(it),L.set(it,y),m.attributes.bitangent.values=L}o.st&&(G=m.attributes.st.values,Z.set(G),Z.set(G,y/3*2),m.attributes.st.values=Z);let F=m.indices,M=F.length,b=y/3,R=Ne.createTypedArray(f/3,M*2);for(R.set(F),u=0;u<M;u+=3)R[u+M]=F[u+2]+b,R[u+1+M]=F[u+1]+b,R[u+2+M]=F[u]+b;m.indices=R;let E=t.northCap,X=t.southCap,w=c,N=2,D=0,k=4,Y=4;E&&(N-=1,w-=1,D+=1,k-=2,Y-=1),X&&(N-=1,w-=1,D+=1,k-=2,Y-=1),D+=N*d+2*w-k;let U=(D+Y)*2,J=new Float64Array(U*3),K=n?new Float32Array(U*3):void 0,ee=v?new Uint8Array(U):void 0,H=o.st?new Float32Array(U*2):void 0,j=i===an.TOP;v&&!j&&(P=i===an.ALL?1:0,ee=ee.fill(P));let $=0,pe=0,ge=0,ae=0,be=d*w,_e;for(u=0;u<be;u+=d)_e=u*3,J=v1(J,$,_e,p,_),$+=6,o.st&&(H=w1(H,pe,u*2,G),pe+=4),n&&(ge+=3,K[ge++]=I[_e],K[ge++]=I[_e+1],K[ge++]=I[_e+2]),j&&(ee[ae++]=1,ae+=1);if(X){let it=E?be+1:be;for(_e=it*3,u=0;u<2;u++)J=v1(J,$,_e,p,_),$+=6,o.st&&(H=w1(H,pe,it*2,G),pe+=4),n&&(ge+=3,K[ge++]=I[_e],K[ge++]=I[_e+1],K[ge++]=I[_e+2]),j&&(ee[ae++]=1,ae+=1)}else for(u=be-d;u<be;u++)_e=u*3,J=v1(J,$,_e,p,_),$+=6,o.st&&(H=w1(H,pe,u*2,G),pe+=4),n&&(ge+=3,K[ge++]=I[_e],K[ge++]=I[_e+1],K[ge++]=I[_e+2]),j&&(ee[ae++]=1,ae+=1);for(u=be-1;u>0;u-=d)_e=u*3,J=v1(J,$,_e,p,_),$+=6,o.st&&(H=w1(H,pe,u*2,G),pe+=4),n&&(ge+=3,K[ge++]=I[_e],K[ge++]=I[_e+1],K[ge++]=I[_e+2]),j&&(ee[ae++]=1,ae+=1);if(E){let it=be;for(_e=it*3,u=0;u<2;u++)J=v1(J,$,_e,p,_),$+=6,o.st&&(H=w1(H,pe,it*2,G),pe+=4),n&&(ge+=3,K[ge++]=I[_e],K[ge++]=I[_e+1],K[ge++]=I[_e+2]),j&&(ee[ae++]=1,ae+=1)}else for(u=d-1;u>=0;u--)_e=u*3,J=v1(J,$,_e,p,_),$+=6,o.st&&(H=w1(H,pe,u*2,G),pe+=4),n&&(ge+=3,K[ge++]=I[_e],K[ge++]=I[_e+1],K[ge++]=I[_e+2]),j&&(ee[ae++]=1,ae+=1);let Ze=g4e(J,o,a);o.st&&(Ze.attributes.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:H})),n&&(Ze.attributes.extrudeDirection=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:K})),v&&(Ze.attributes.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:ee}));let Le=Ne.createTypedArray(U,D*6),Ee,He,we,dt;y=J.length/3;let bt=0;for(u=0;u<y-1;u+=2){Ee=u,dt=(Ee+2)%y;let it=h.fromArray(J,Ee*3,uz),en=h.fromArray(J,dt*3,iue);h.equalsEpsilon(it,en,W.EPSILON10)||(He=(Ee+1)%y,we=(He+2)%y,Le[bt++]=Ee,Le[bt++]=He,Le[bt++]=dt,Le[bt++]=dt,Le[bt++]=He,Le[bt++]=we)}return Ze.indices=Le,Ze=Mn.combineInstances([new St({geometry:m}),new St({geometry:Ze})]),Ze[0]}var _4e=[new h,new h,new h,new h],rue=new he,T4e=new he;function hz(e,t,n,i,o){if(n===0)return de.clone(e,o);let r=Ss.computeOptions(e,t,n,0,tue,rue),s=r.height,a=r.width,c=_4e;return Ss.computePosition(r,i,!1,0,0,c[0]),Ss.computePosition(r,i,!1,0,a-1,c[1]),Ss.computePosition(r,i,!1,s-1,0,c[2]),Ss.computePosition(r,i,!1,s-1,a-1,c[3]),de.fromCartesianArray(c,i,o)}function Sf(e){e=g(e,g.EMPTY_OBJECT);let t=e.rectangle,n=g(e.height,0),i=g(e.extrudedHeight,n);this._rectangle=de.clone(t),this._granularity=g(e.granularity,W.RADIANS_PER_DEGREE),this._ellipsoid=oe.clone(g(e.ellipsoid,oe.WGS84)),this._surfaceHeight=Math.max(n,i),this._rotation=g(e.rotation,0),this._stRotation=g(e.stRotation,0),this._vertexFormat=Pe.clone(g(e.vertexFormat,Pe.DEFAULT)),this._extrudedHeight=Math.min(n,i),this._shadowVolume=g(e.shadowVolume,!1),this._workerName="createRectangleGeometry",this._offsetAttribute=e.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}Sf.packedLength=de.packedLength+oe.packedLength+Pe.packedLength+7;Sf.pack=function(e,t,n){return n=g(n,0),de.pack(e._rectangle,t,n),n+=de.packedLength,oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,Pe.pack(e._vertexFormat,t,n),n+=Pe.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=g(e._offsetAttribute,-1),t};var sue=new de,aue=oe.clone(oe.UNIT_SPHERE),Py={rectangle:sue,ellipsoid:aue,vertexFormat:mz,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};Sf.unpack=function(e,t,n){t=g(t,0);let i=de.unpack(e,t,sue);t+=de.packedLength;let o=oe.unpack(e,t,aue);t+=oe.packedLength;let r=Pe.unpack(e,t,mz);t+=Pe.packedLength;let s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],m=e[t++]===1,p=e[t];return l(n)?(n._rectangle=de.clone(i,n._rectangle),n._ellipsoid=oe.clone(o,n._ellipsoid),n._vertexFormat=Pe.clone(r,n._vertexFormat),n._granularity=s,n._surfaceHeight=a,n._rotation=c,n._stRotation=d,n._extrudedHeight=u,n._shadowVolume=m,n._offsetAttribute=p===-1?void 0:p,n):(Py.granularity=s,Py.height=a,Py.rotation=c,Py.stRotation=d,Py.extrudedHeight=u,Py.shadowVolume=m,Py.offsetAttribute=p===-1?void 0:p,new Sf(Py))};Sf.computeRectangle=function(e,t){e=g(e,g.EMPTY_OBJECT);let n=e.rectangle,i=g(e.granularity,W.RADIANS_PER_DEGREE),o=g(e.ellipsoid,oe.WGS84),r=g(e.rotation,0);return hz(n,i,r,o,t)};var S4e=new q,Qde=new Me,C4e=new he;Sf.createGeometry=function(e){if(W.equalsEpsilon(e._rectangle.north,e._rectangle.south,W.EPSILON10)||W.equalsEpsilon(e._rectangle.east,e._rectangle.west,W.EPSILON10))return;let t=e._rectangle,n=e._ellipsoid,i=e._rotation,o=e._stRotation,r=e._vertexFormat,s=Ss.computeOptions(t,e._granularity,i,o,tue,rue,T4e),a=S4e;if(o!==0||i!==0){let y=de.center(t,C4e),f=n.geodeticSurfaceNormalCartographic(y,uz);Me.fromAxisAngle(f,-o,Qde),q.fromQuaternion(Qde,a)}else q.clone(q.IDENTITY,a);let c=e._surfaceHeight,d=e._extrudedHeight,u=!W.equalsEpsilon(c,d,0,W.EPSILON2);s.lonScalar=1/e._rectangle.width,s.latScalar=1/e._rectangle.height,s.tangentRotationMatrix=a;let m,p;if(t=e._rectangle,u){m=x4e(e,s);let y=ce.fromRectangle3D(t,n,c,b4e),f=ce.fromRectangle3D(t,n,d,p4e);p=ce.union(y,f)}else{if(m=oue(e,s),m.attributes.position.values=di.scaleToGeodeticHeight(m.attributes.position.values,c,n,!1),l(e._offsetAttribute)){let y=m.attributes.position.values.length,f=e._offsetAttribute===an.NONE?0:1,x=new Uint8Array(y/3).fill(f);m.attributes.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}p=ce.fromRectangle3D(t,n,c)}return r.position||delete m.attributes.position,new mt({attributes:m.attributes,indices:m.indices,primitiveType:m.primitiveType,boundingSphere:p,offsetAttribute:e._offsetAttribute})};Sf.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Sf({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:o,stRotation:e._stRotation,granularity:i,extrudedHeight:s,height:r,vertexFormat:Pe.POSITION_ONLY,shadowVolume:!0})};var jde=new de,V4e=[new B,new B,new B],L4e=new io,R4e=new he;function Z4e(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=de.clone(e._rectangle,jde),n=e._granularity,i=e._ellipsoid,o=e._rotation-e._stRotation,r=hz(t,n,o,i,jde),s=V4e;s[0].x=r.west,s[0].y=r.south,s[1].x=r.west,s[1].y=r.north,s[2].x=r.east,s[2].y=r.south;let a=e.rectangle,c=io.fromRotation(e._stRotation,L4e),d=de.center(a,R4e);for(let f=0;f<3;++f){let x=s[f];x.x-=d.longitude,x.y-=d.latitude,io.multiplyByVector(c,x,x),x.x+=d.longitude,x.y+=d.latitude,x.x=(x.x-a.west)/a.width,x.y=(x.y-a.south)/a.height}let u=s[0],m=s[1],p=s[2],y=new Array(6);return B.pack(u,y),B.pack(m,y,2),B.pack(p,y,4),y}Object.defineProperties(Sf.prototype,{rectangle:{get:function(){return l(this._rotatedRectangle)||(this._rotatedRectangle=hz(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=Z4e(this)),this._textureCoordinateRotationPoints}}});var H_=Sf;var cue=new O,lue=h.ZERO,due=new h,uue=new de,G4e=new de,E4e=new he;function I4e(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 rh(e,t){zn.call(this,{entity:e,scene:t,geometryOptions:new I4e(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}l(Object.create)&&(rh.prototype=Object.create(zn.prototype),rh.prototype.constructor=rh);rh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Dn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Ut){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,cue)),l(o)||(o=O.WHITE),i.color=Ot.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=eo.fromCartesian3(z.getValueOrDefault(this._terrainOffsetProperty,e,lue,due))),new St({id:t,geometry:new H_(this._options),attributes:i})};rh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=z.getValueOrDefault(this._outlineColorProperty,e,O.BLACK,cue),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ot.fromColor(i),distanceDisplayCondition:Dn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=eo.fromCartesian3(z.getValueOrDefault(this._terrainOffsetProperty,e,lue,due))),new St({id:t,geometry:new b_(this._options),attributes:r})};rh.prototype._computeCenter=function(e,t){let n=z.getValueOrUndefined(this._entity.rectangle.coordinates,e,G4e);if(!l(n))return;let i=de.center(n,E4e);return he.toCartesian(i,oe.WGS84,t)};rh.prototype._isHidden=function(e,t){return!l(t.coordinates)||si.prototype._isHidden.call(this,e,t)};rh.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!z.isConstant(t.height)||!z.isConstant(t.extrudedHeight)||!z.isConstant(t.granularity)||!z.isConstant(t.stRotation)||!z.isConstant(t.rotation)||!z.isConstant(t.outlineWidth)||!z.isConstant(t.zIndex)||this._onTerrain&&!z.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Ut)};rh.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Ut,i=z.getValueOrUndefined(t.height,Be.MINIMUM_VALUE),o=z.getValueOrDefault(t.heightReference,Be.MINIMUM_VALUE,Qe.NONE),r=z.getValueOrUndefined(t.extrudedHeight,Be.MINIMUM_VALUE),s=z.getValueOrDefault(t.extrudedHeightReference,Be.MINIMUM_VALUE,Qe.NONE);l(r)&&!l(i)&&(i=0);let a=this._options;a.vertexFormat=n?cn.VERTEX_FORMAT:mo.MaterialSupport.TEXTURED.vertexFormat,a.rectangle=t.coordinates.getValue(Be.MINIMUM_VALUE,a.rectangle),a.granularity=z.getValueOrUndefined(t.granularity,Be.MINIMUM_VALUE),a.stRotation=z.getValueOrUndefined(t.stRotation,Be.MINIMUM_VALUE),a.rotation=z.getValueOrUndefined(t.rotation,Be.MINIMUM_VALUE),a.offsetAttribute=zn.computeGeometryOffsetAttribute(i,o,r,s),a.height=zn.getGeometryHeight(i,o),r=zn.getGeometryExtrudedHeight(r,s),r===zn.CLAMP_TO_GROUND&&(r=hi.getMinimumMaximumHeights(H_.computeRectangle(a,uue)).minimumTerrainHeight),a.extrudedHeight=r};rh.DynamicGeometryUpdater=F1;function F1(e,t,n){ri.call(this,e,t,n)}l(Object.create)&&(F1.prototype=Object.create(ri.prototype),F1.prototype.constructor=F1);F1.prototype._isHidden=function(e,t,n){return!l(this._options.rectangle)||ri.prototype._isHidden.call(this,e,t,n)};F1.prototype._setOptions=function(e,t,n){let i=this._options,o=z.getValueOrUndefined(t.height,n),r=z.getValueOrDefault(t.heightReference,n,Qe.NONE),s=z.getValueOrUndefined(t.extrudedHeight,n),a=z.getValueOrDefault(t.extrudedHeightReference,n,Qe.NONE);l(s)&&!l(o)&&(o=0),i.rectangle=z.getValueOrUndefined(t.coordinates,n,i.rectangle),i.granularity=z.getValueOrUndefined(t.granularity,n),i.stRotation=z.getValueOrUndefined(t.stRotation,n),i.rotation=z.getValueOrUndefined(t.rotation,n),i.offsetAttribute=zn.computeGeometryOffsetAttribute(o,r,s,a),i.height=zn.getGeometryHeight(o,r),s=zn.getGeometryExtrudedHeight(s,a),s===zn.CLAMP_TO_GROUND&&(s=hi.getMinimumMaximumHeights(H_.computeRectangle(i,uue)).minimumTerrainHeight),i.extrudedHeight=s};var pP=rh;var Z7n=T(S(),1);var mue=new O,X4e=new It,W4e=new It,P4e=h.ZERO,v4e=new h;function sh(e,t,n,i,o,r,s){this.translucent=t,this.appearanceType=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=o,this.depthFailMaterial=void 0,this.closed=r,this.shadows=s,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Ct,this.updaters=new Ct,this.updatersWithAttributes=new Ct,this.attributes=new Ct,this.subscriptions=new Ct,this.showsUpdated=new Ct,this.itemsToRemove=[],this.invalidated=!1;let a;l(o)&&(a=o.definitionChanged.addEventListener(sh.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=a}sh.prototype.onMaterialChanged=function(){this.invalidated=!0};sh.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:l(t)?t.equals(n):!1};sh.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!z.isConstant(e.distanceDisplayConditionProperty)||!z.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};sh.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};sh.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0){l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i);let c;l(this.depthFailAppearanceType)&&(l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=zo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial)),c=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})),i=new En({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed}),depthFailAppearance:c,shadows:this.shadows}),o.add(i),t=!1}else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0),l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Ut)&&(this.depthFailMaterial=zo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let d=s[r],u=this.geometry.get(d.id),m=this.attributes.get(u.id.id);if(l(m)||(m=i.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,m)),!d.fillMaterialProperty.isConstant||c){let _=d.fillMaterialProperty.color,C=z.getValueOrDefault(_,e,O.WHITE,mue);O.equals(m._lastColor,C)||(m._lastColor=O.clone(C,m._lastColor),m.color=Ot.toValue(C,m.color),(this.translucent&&m.color[3]===255||!this.translucent&&m.color[3]!==255)&&(this.itemsToRemove[n++]=d))}if(l(this.depthFailAppearanceType)&&d.depthFailMaterialProperty instanceof Ut&&(!d.depthFailMaterialProperty.isConstant||c)){let _=d.depthFailMaterialProperty.color,C=z.getValueOrDefault(_,e,O.WHITE,mue);O.equals(m._lastDepthFailColor,C)||(m._lastDepthFailColor=O.clone(C,m._lastDepthFailColor),m.depthFailColor=Ot.toValue(C,m.depthFailColor))}let p=d.entity.isShowing&&(d.hasConstantFill||d.isFilled(e)),y=m.show[0]===1;p!==y&&(m.show=Sn.toValue(p,m.show));let f=d.distanceDisplayConditionProperty;if(!z.isConstant(f)){let _=z.getValueOrDefault(f,e,W4e,X4e);It.equals(_,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=It.clone(_,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=Dn.toValue(_,m.distanceDisplayCondition))}let x=d.terrainOffsetProperty;if(!z.isConstant(x)){let _=z.getValueOrDefault(x,e,P4e,v4e);h.equals(_,m._lastOffset)||(m._lastOffset=h.clone(_,m._lastOffset),m.offset=eo.toValue(_,m.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};sh.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);l(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=Sn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};sh.prototype.contains=function(e){return this.updaters.contains(e.id)};sh.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ut.FAILED:(i.boundingSphere.clone(t),ut.DONE)};sh.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),l(this.removeMaterialSubscription)&&this.removeMaterialSubscription()};function A1(e,t,n,i,o){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}A1.prototype.add=function(e,t){let n,i,o=t.createFillGeometryInstance(e);o.attributes.color.value[3]===255?(n=this._solidItems,i=!1):(n=this._translucentItems,i=!0);let r=n.length;for(let a=0;a<r;a++){let c=n[a];if(c.isMaterial(t)){c.add(t,o);return}}let s=new sh(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);s.add(t,o),n.push(s)};function hue(e,t){let n=e.length;for(let i=n-1;i>=0;i--){let o=e[i];if(o.remove(t))return o.updaters.length===0&&(e.splice(i,1),o.destroy()),!0}return!1}A1.prototype.remove=function(e){hue(this._solidItems,e)||hue(this._translucentItems,e)};function fue(e,t,n){let i=!1,o=t.length;for(let r=0;r<o;++r){let s=t[r],a=s.itemsToRemove,c=a.length;if(c>0)for(r=0;r<c;r++){let d=a[r];s.remove(d),e.add(n,d),i=!0}}return i}function $5(e,t,n,i){let o=t.length,r;for(r=o-1;r>=0;r--){let s=t[r];if(s.invalidated){t.splice(r,1);let a=s.updaters.values,c=a.length;for(let d=0;d<c;d++)e.add(n,a[d]);s.destroy()}}for(o=t.length,r=0;r<o;++r)i=t[r].update(n)&&i;return i}A1.prototype.update=function(e){let t=$5(this,this._solidItems,e,!0);t=$5(this,this._translucentItems,e,t)&&t;let n=fue(this,this._solidItems,e),i=fue(this,this._translucentItems,e);return(n||i)&&(t=$5(this,this._solidItems,e,t)&&t,t=$5(this,this._translucentItems,e,t)&&t),t};function pue(e,t,n){let i=e.length;for(let o=0;o<i;o++){let r=e[o];if(r.contains(t))return r.getBoundingSphere(t,n)}return ut.FAILED}A1.prototype.getBoundingSphere=function(e,t){let n=pue(this._solidItems,e,t);return n===ut.FAILED?pue(this._translucentItems,e,t):n};function bue(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}A1.prototype.removeAllPrimitives=function(){bue(this._solidItems),bue(this._translucentItems)};var Nu=A1;var B7n=T(S(),1);var w4e=new It,F4e=new It,A4e=h.ZERO,M4e=new h;function ah(e,t,n,i,o,r,s){this.primitives=e,this.appearanceType=t,this.materialProperty=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=o,this.closed=r,this.shadows=s,this.updaters=new Ct,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Ct,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new Ct,this.attributes=new Ct,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(ah.prototype.onMaterialChanged,this),this.subscriptions=new Ct,this.showsUpdated=new Ct}ah.prototype.onMaterialChanged=function(){this.invalidated=!0};ah.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty,i=this.depthFailMaterialProperty,o=e.depthFailMaterialProperty;if(n===t&&o===i)return!0;let r=l(t)&&t.equals(n);return r=(!l(i)&&!l(o)||l(i)&&i.equals(o))&&r,r};ah.prototype.add=function(e,t){let n=t.id;if(this.updaters.set(n,t),this.geometry.set(n,t.createFillGeometryInstance(e)),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!z.isConstant(t.distanceDisplayConditionProperty)||!z.isConstant(t.terrainOffsetProperty))this.updatersWithAttributes.set(n,t);else{let i=this;this.subscriptions.set(n,t.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};ah.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};var N4e=new O;ah.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=zo.getValue(e,this.materialProperty,this.material);let a;l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=zo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),a=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})),n=new En({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:a,shadows:this.shadows}),i.add(n),t=!1}else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=zo.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Ut)&&(this.depthFailMaterial=zo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],d=c.entity,u=this.geometry.get(c.id),m=this.attributes.get(u.id.id);if(l(m)||(m=n.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,m)),l(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof Ut&&!c.depthFailMaterialProperty.isConstant){let _=c.depthFailMaterialProperty.color,C=z.getValueOrDefault(_,e,O.WHITE,N4e);O.equals(m._lastDepthFailColor,C)||(m._lastDepthFailColor=O.clone(C,m._lastDepthFailColor),m.depthFailColor=Ot.toValue(C,m.depthFailColor))}let p=d.isShowing&&(c.hasConstantFill||c.isFilled(e)),y=m.show[0]===1;p!==y&&(m.show=Sn.toValue(p,m.show));let f=c.distanceDisplayConditionProperty;if(!z.isConstant(f)){let _=z.getValueOrDefault(f,e,F4e,w4e);It.equals(_,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=It.clone(_,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=Dn.toValue(_,m.distanceDisplayCondition))}let x=c.terrainOffsetProperty;if(!z.isConstant(x)){let _=z.getValueOrDefault(x,e,A4e,M4e);h.equals(_,m._lastOffset)||(m._lastOffset=h.clone(_,m._lastOffset),m.offset=eo.toValue(_,m.offset))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};ah.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,d=a.show[0]===1;c!==d&&(a.show=Sn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};ah.prototype.contains=function(e){return this.updaters.contains(e.id)};ah.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ut.FAILED:(i.boundingSphere.clone(t),ut.DONE)};ah.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function M1(e,t,n,i,o){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}M1.prototype.add=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let s=n[r];if(s.isMaterial(t)){s.add(e,t);return}}let o=new ah(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);o.add(e,t),n.push(o)};M1.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};M1.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};M1.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return ut.FAILED};M1.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var Uu=M1;var r6n=T(S(),1);var H7n=T(S(),1),gue=T(yue(),1);function eU(){this._tree=new gue.default}function K_(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}K_.fromRectangleAndId=function(e,t,n){return n.minX=t.west,n.minY=t.south,n.maxX=t.east,n.maxY=t.north,n.id=e,n};eU.prototype.insert=function(e,t){let n=K_.fromRectangleAndId(e,t,new K_);this._tree.insert(n)};function U4e(e,t){return e.id===t.id}var k4e=new K_;eU.prototype.remove=function(e,t){let n=K_.fromRectangleAndId(e,t,k4e);this._tree.remove(n,U4e)};var D4e=new K_;eU.prototype.collides=function(e){let t=K_.fromRectangleAndId("",e,D4e);return this._tree.collides(t)};var z_=eU;var B4e=new O,O4e=new It,Y4e=new It;function W0(e,t,n,i){this.primitives=e,this.zIndex=i,this.classificationType=t,this.color=n,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Ct,this.updaters=new Ct,this.updatersWithAttributes=new Ct,this.attributes=new Ct,this.subscriptions=new Ct,this.showsUpdated=new Ct,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new z_}W0.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};W0.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),this.rectangleCollisionCheck.insert(n,t.geometry.rectangle),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!z.isConstant(e.distanceDisplayConditionProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};W0.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return l(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};W0.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new Pc({show:!1,asynchronous:!0,geometryInstances:s.slice(),classificationType:this.classificationType}),o.add(i,this.zIndex),t=!1;else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let d=s[r],u=this.geometry.get(d.id),m=this.attributes.get(u.id.id);if(l(m)||(m=i.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,m)),!d.fillMaterialProperty.isConstant||c){let x=d.fillMaterialProperty.color,_=z.getValueOrDefault(x,e,O.WHITE,B4e);O.equals(m._lastColor,_)||(m._lastColor=O.clone(_,m._lastColor),m.color=Ot.toValue(_,m.color))}let p=d.entity.isShowing&&(d.hasConstantFill||d.isFilled(e)),y=m.show[0]===1;p!==y&&(m.show=Sn.toValue(p,m.show));let f=d.distanceDisplayConditionProperty;if(!z.isConstant(f)){let x=z.getValueOrDefault(f,e,Y4e,O4e);It.equals(x,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=It.clone(x,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=Dn.toValue(x,m.distanceDisplayCondition))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};W0.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);l(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=Sn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};W0.prototype.contains=function(e){return this.updaters.contains(e.id)};W0.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getBoundingSphere(e.entity);return l(i)?(i.clone(t),ut.DONE):ut.FAILED};W0.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;l(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;l(n)&&(e.remove(n),this.oldPrimitive=void 0)};function N1(e,t){this._batches=[],this._primitives=e,this._classificationType=t}N1.prototype.add=function(e,t){let n=t.createFillGeometryInstance(e),i=this._batches,o=z.getValueOrDefault(t.zIndex,0),r,s=i.length;for(let a=0;a<s;++a){let c=i[a];if(c.zIndex===o&&!c.overlapping(n.geometry.rectangle)){r=c;break}}return l(r)||(r=new W0(this._primitives,this._classificationType,n.attributes.color.value,o),i.push(r)),r.add(t,n),r};N1.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};N1.prototype.update=function(e){let t,n,i=!0,o=this._batches,r=o.length;for(t=0;t<r;++t)i=o[t].update(e)&&i;for(t=0;t<r;++t){let s=o[t],a=s.itemsToRemove,c=a.length;for(let d=0;d<c;d++){n=a[d],s.remove(n);let u=this.add(e,n);s.isDirty=!0,u.isDirty=!0}}for(t=r-1;t>=0;--t){let s=o[t];s.isDirty&&(i=o[t].update(e)&&i,s.isDirty=!1),s.geometry.length===0&&o.splice(t,1)}return i};N1.prototype.getBoundingSphere=function(e,t){let n=this._batches,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return ut.FAILED};N1.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var U1=N1;var x6n=T(S(),1);var H4e=new It,K4e=new It;function ku(e,t,n,i,o,r){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new Ct,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Ct,this.material=void 0,this.updatersWithAttributes=new Ct,this.attributes=new Ct,this.invalidated=!1,this.removeMaterialSubscription=i.definitionChanged.addEventListener(ku.prototype.onMaterialChanged,this),this.subscriptions=new Ct,this.showsUpdated=new Ct,this.usingSphericalTextureCoordinates=o,this.zIndex=r,this.rectangleCollisionCheck=new z_}ku.prototype.onMaterialChanged=function(){this.invalidated=!0};ku.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};ku.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Ut&&t instanceof Ut?!0:l(t)&&t.equals(n)};ku.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),this.rectangleCollisionCheck.insert(i,n.geometry.rectangle),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!z.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,s,a,c){s==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};ku.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return l(i)&&(i(),this.subscriptions.remove(t)),!0}return!1};ku.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0)l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=zo.getValue(e,this.materialProperty,this.material),n=new Pc({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new this.appearanceType({material:this.material}),classificationType:this.classificationType}),i.add(n,this.zIndex),t=!1;else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=zo.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],d=c.entity,u=this.geometry.get(c.id),m=this.attributes.get(u.id.id);l(m)||(m=n.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,m));let p=d.isShowing&&(c.hasConstantFill||c.isFilled(e)),y=m.show[0]===1;p!==y&&(m.show=Sn.toValue(p,m.show));let f=c.distanceDisplayConditionProperty;if(!z.isConstant(f)){let x=z.getValueOrDefault(f,e,K4e,H4e);It.equals(x,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=It.clone(x,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=Dn.toValue(x,m.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};ku.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,d=a.show[0]===1;c!==d&&(a.show=Sn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};ku.prototype.contains=function(e){return this.updaters.contains(e.id)};ku.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ut.FAILED:(i.boundingSphere.clone(t),ut.DONE)};ku.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function k1(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}k1.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=id.shouldUseSphericalCoordinates(o.geometry.rectangle),s=z.getValueOrDefault(t.zIndex,0);for(let c=0;c<i;++c){let d=n[c];if(d.isMaterial(t)&&d.usingSphericalTextureCoordinates===r&&d.zIndex===s&&!d.overlapping(o.geometry.rectangle)){d.add(e,t,o);return}}let a=new ku(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,r,s);a.add(e,t,o),n.push(a)};k1.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};k1.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};k1.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return ut.FAILED};k1.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var bP=k1;var v6n=T(S(),1);var z4e=new O,J4e=new It,Q4e=new It,j4e=h.ZERO,q4e=new h;function P0(e,t,n,i){this.translucent=t,this.width=n,this.shadows=i,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Ct,this.updaters=new Ct,this.updatersWithAttributes=new Ct,this.attributes=new Ct,this.itemsToRemove=[],this.subscriptions=new Ct,this.showsUpdated=new Ct}P0.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantOutline||!e.outlineColorProperty.isConstant||!z.isConstant(e.distanceDisplayConditionProperty)||!z.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};P0.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};P0.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new En({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new cn({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),o.add(i),t=!1;else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let d=s[r],u=this.geometry.get(d.id),m=this.attributes.get(u.id.id);if(l(m)||(m=i.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,m)),!d.outlineColorProperty.isConstant||c){let _=d.outlineColorProperty,C=z.getValueOrDefault(_,e,O.WHITE,z4e);O.equals(m._lastColor,C)||(m._lastColor=O.clone(C,m._lastColor),m.color=Ot.toValue(C,m.color),(this.translucent&&m.color[3]===255||!this.translucent&&m.color[3]!==255)&&(this.itemsToRemove[n++]=d))}let p=d.entity.isShowing&&(d.hasConstantOutline||d.isOutlineVisible(e)),y=m.show[0]===1;p!==y&&(m.show=Sn.toValue(p,m.show));let f=d.distanceDisplayConditionProperty;if(!z.isConstant(f)){let _=z.getValueOrDefault(f,e,Q4e,J4e);It.equals(_,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=It.clone(_,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=Dn.toValue(_,m.distanceDisplayCondition))}let x=d.terrainOffsetProperty;if(!z.isConstant(x)){let _=z.getValueOrDefault(x,e,j4e,q4e);h.equals(_,m._lastOffset)||(m._lastOffset=h.clone(_,m._lastOffset),m.offset=eo.toValue(_,m.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};P0.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);l(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=Sn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};P0.prototype.contains=function(e){return this.updaters.contains(e.id)};P0.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ut.FAILED:(i.boundingSphere.clone(t),ut.DONE)};P0.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;l(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;l(n)&&(e.remove(n),this.oldPrimitive=void 0)};function D1(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new Ct,this._translucentBatches=new Ct}D1.prototype.add=function(e,t){let n=t.createOutlineGeometryInstance(e),i=this._scene.clampLineWidth(t.outlineWidth),o,r;n.attributes.color.value[3]===255?(o=this._solidBatches,r=o.get(i),l(r)||(r=new P0(this._primitives,!1,i,this._shadows),o.set(i,r)),r.add(t,n)):(o=this._translucentBatches,r=o.get(i),l(r)||(r=new P0(this._primitives,!0,i,this._shadows),o.set(i,r)),r.add(t,n))};D1.prototype.remove=function(e){let t,n=this._solidBatches.values,i=n.length;for(t=0;t<i;t++)if(n[t].remove(e))return;let o=this._translucentBatches.values,r=o.length;for(t=0;t<r;t++)if(o[t].remove(e))return};D1.prototype.update=function(e){let t,n,i,o,r=this._solidBatches.values,s=r.length,a=this._translucentBatches.values,c=a.length,d,u=!0,m=!1;do{for(m=!1,n=0;n<s;n++){o=r[n],u=o.update(e),d=o.itemsToRemove;let p=d.length;if(p>0)for(m=!0,t=0;t<p;t++)i=d[t],o.remove(i),this.add(e,i)}for(n=0;n<c;n++){o=a[n],u=o.update(e),d=o.itemsToRemove;let p=d.length;if(p>0)for(m=!0,t=0;t<p;t++)i=d[t],o.remove(i),this.add(e,i)}}while(m);return u};D1.prototype.getBoundingSphere=function(e,t){let n,i=this._solidBatches.values,o=i.length;for(n=0;n<o;n++){let a=i[n];if(a.contains(e))return a.getBoundingSphere(e,t)}let r=this._translucentBatches.values,s=r.length;for(n=0;n<s;n++){let a=r[n];if(a.contains(e))return a.getBoundingSphere(e,t)}return ut.FAILED};D1.prototype.removeAllPrimitives=function(){let e,t=this._solidBatches.values,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._translucentBatches.values,o=i.length;for(e=0;e<o;e++)i[e].removeAllPrimitives()};var B1=D1;var Fqn=T(S(),1);var oqn=T(S(),1);var D6n=T(S(),1);var xue={};function $4e(e,t){return W.equalsEpsilon(e.latitude,t.latitude,W.EPSILON10)&&W.equalsEpsilon(e.longitude,t.longitude,W.EPSILON10)}var eje=new he,tje=new he;function nje(e,t,n,i){t=So(t,h.equalsEpsilon);let o=t.length;if(o<2)return;let r=l(i),s=l(n),a=new Array(o),c=new Array(o),d=new Array(o),u=t[0];a[0]=u;let m=e.cartesianToCartographic(u,eje);s&&(m.height=n[0]),c[0]=m.height,r?d[0]=i[0]:d[0]=0;let p=c[0],y=d[0],f=p===y,x=1;for(let _=1;_<o;++_){let C=t[_],V=e.cartesianToCartographic(C,tje);s&&(V.height=n[_]),f=f&&V.height===0,$4e(m,V)?m.height<V.height&&(c[x-1]=V.height):(a[x]=C,c[x]=V.height,r?d[x]=i[_]:d[x]=0,f=f&&c[x]===d[x],he.clone(V,m),++x)}if(!(f||x<2))return a.length=x,c.length=x,d.length=x,{positions:a,topHeights:c,bottomHeights:d}}var ije=new Array(2),oje=new Array(2),rje={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};xue.computePositions=function(e,t,n,i,o,r){let s=nje(e,t,n,i);if(!l(s))return;t=s.positions,n=s.topHeights,i=s.bottomHeights;let a=t.length,c=a-2,d,u,m=W.chordLength(o,e.maximumRadius),p=rje;if(p.minDistance=m,p.ellipsoid=e,r){let y=0,f;for(f=0;f<a-1;f++)y+=Ei.numberOfPoints(t[f],t[f+1],m)+1;d=new Float64Array(y*3),u=new Float64Array(y*3);let x=ije,_=oje;p.positions=x,p.height=_;let C=0;for(f=0;f<a-1;f++){x[0]=t[f],x[1]=t[f+1],_[0]=n[f],_[1]=n[f+1];let V=Ei.generateArc(p);d.set(V,C),_[0]=i[f],_[1]=i[f+1],u.set(Ei.generateArc(p),C),C+=V.length}}else p.positions=t,p.height=n,d=new Float64Array(Ei.generateArc(p)),p.height=i,u=new Float64Array(Ei.generateArc(p));return{bottomPositions:u,topPositions:d,numCorners:c}};var J_=xue;var bz=new h,tU=new h,sje=new h,_ue=new h,aje=new h,cje=new h,lje=new h;function Q_(e){e=g(e,g.EMPTY_OBJECT);let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=g(e.vertexFormat,Pe.DEFAULT),r=g(e.granularity,W.RADIANS_PER_DEGREE),s=g(e.ellipsoid,oe.WGS84);this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=Pe.clone(o),this._granularity=r,this._ellipsoid=oe.clone(s),this._workerName="createWallGeometry";let a=1+t.length*h.packedLength+2;l(i)&&(a+=i.length),l(n)&&(a+=n.length),this.packedLength=a+oe.packedLength+Pe.packedLength+1}Q_.pack=function(e,t,n){n=g(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._minimumHeights;if(r=l(s)?s.length:0,t[n++]=r,l(s))for(i=0;i<r;++i)t[n++]=s[i];let a=e._maximumHeights;if(r=l(a)?a.length:0,t[n++]=r,l(a))for(i=0;i<r;++i)t[n++]=a[i];return oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,Pe.pack(e._vertexFormat,t,n),n+=Pe.packedLength,t[n]=e._granularity,t};var Tue=oe.clone(oe.UNIT_SPHERE),Sue=new Pe,yP={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:Tue,vertexFormat:Sue,granularity:void 0};Q_.unpack=function(e,t,n){t=g(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s;if(o>0)for(s=new Array(o),i=0;i<o;++i)s[i]=e[t++];o=e[t++];let a;if(o>0)for(a=new Array(o),i=0;i<o;++i)a[i]=e[t++];let c=oe.unpack(e,t,Tue);t+=oe.packedLength;let d=Pe.unpack(e,t,Sue);t+=Pe.packedLength;let u=e[t];return l(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=oe.clone(c,n._ellipsoid),n._vertexFormat=Pe.clone(d,n._vertexFormat),n._granularity=u,n):(yP.positions=r,yP.minimumHeights=s,yP.maximumHeights=a,yP.granularity=u,new Q_(yP))};Q_.fromConstantHeights=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.positions,n,i,o=e.minimumHeight,r=e.maximumHeight,s=l(o),a=l(r);if(s||a){let d=t.length;n=s?new Array(d):void 0,i=a?new Array(d):void 0;for(let u=0;u<d;++u)s&&(n[u]=o),a&&(i[u]=r)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new Q_(c)};Q_.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._vertexFormat,r=e._granularity,s=e._ellipsoid,a=J_.computePositions(s,t,i,n,r,!0);if(!l(a))return;let c=a.bottomPositions,d=a.topPositions,u=a.numCorners,m=d.length,p=m*2,y=o.position?new Float64Array(p):void 0,f=o.normal?new Float32Array(p):void 0,x=o.tangent?new Float32Array(p):void 0,_=o.bitangent?new Float32Array(p):void 0,C=o.st?new Float32Array(p/3*2):void 0,V=0,L=0,Z=0,G=0,I=0,P=lje,v=cje,F=aje,M=!0;m/=3;let b,R=0,E=1/(m-u-1);for(b=0;b<m;++b){let k=b*3,Y=h.fromArray(d,k,bz),U=h.fromArray(c,k,tU);if(o.position&&(y[V++]=U.x,y[V++]=U.y,y[V++]=U.z,y[V++]=Y.x,y[V++]=Y.y,y[V++]=Y.z),o.st&&(C[I++]=R,C[I++]=0,C[I++]=R,C[I++]=1),o.normal||o.tangent||o.bitangent){let J=h.clone(h.ZERO,_ue),K=h.subtract(Y,s.geodeticSurfaceNormal(Y,tU),tU);if(b+1<m&&(J=h.fromArray(d,k+3,_ue)),M){let ee=h.subtract(J,Y,sje),H=h.subtract(K,Y,bz);P=h.normalize(h.cross(H,ee,P),P),M=!1}h.equalsEpsilon(Y,J,W.EPSILON10)?M=!0:(R+=E,o.tangent&&(v=h.normalize(h.subtract(J,Y,v),v)),o.bitangent&&(F=h.normalize(h.cross(P,v,F),F))),o.normal&&(f[L++]=P.x,f[L++]=P.y,f[L++]=P.z,f[L++]=P.x,f[L++]=P.y,f[L++]=P.z),o.tangent&&(x[G++]=v.x,x[G++]=v.y,x[G++]=v.z,x[G++]=v.x,x[G++]=v.y,x[G++]=v.z),o.bitangent&&(_[Z++]=F.x,_[Z++]=F.y,_[Z++]=F.z,_[Z++]=F.x,_[Z++]=F.y,_[Z++]=F.z)}}let X=new pn;o.position&&(X.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:y})),o.normal&&(X.normal=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:f})),o.tangent&&(X.tangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:x})),o.bitangent&&(X.bitangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:_})),o.st&&(X.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:C}));let w=p/3;p-=6*(u+1);let N=Ne.createTypedArray(w,p),D=0;for(b=0;b<w-2;b+=2){let k=b,Y=b+2,U=h.fromArray(y,k*3,bz),J=h.fromArray(y,Y*3,tU);if(h.equalsEpsilon(U,J,W.EPSILON10))continue;let K=b+1,ee=b+3;N[D++]=K,N[D++]=k,N[D++]=ee,N[D++]=ee,N[D++]=k,N[D++]=Y}return new mt({attributes:X,indices:N,primitiveType:Ae.TRIANGLES,boundingSphere:new ce.fromVertices(y)})};var gP=Q_;var xqn=T(S(),1);var Cue=new h,Vue=new h;function j_(e){e=g(e,g.EMPTY_OBJECT);let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=g(e.granularity,W.RADIANS_PER_DEGREE),r=g(e.ellipsoid,oe.WGS84);this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._granularity=o,this._ellipsoid=oe.clone(r),this._workerName="createWallOutlineGeometry";let s=1+t.length*h.packedLength+2;l(i)&&(s+=i.length),l(n)&&(s+=n.length),this.packedLength=s+oe.packedLength+1}j_.pack=function(e,t,n){n=g(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._minimumHeights;if(r=l(s)?s.length:0,t[n++]=r,l(s))for(i=0;i<r;++i)t[n++]=s[i];let a=e._maximumHeights;if(r=l(a)?a.length:0,t[n++]=r,l(a))for(i=0;i<r;++i)t[n++]=a[i];return oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,t[n]=e._granularity,t};var Lue=oe.clone(oe.UNIT_SPHERE),xP={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:Lue,granularity:void 0};j_.unpack=function(e,t,n){t=g(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s;if(o>0)for(s=new Array(o),i=0;i<o;++i)s[i]=e[t++];o=e[t++];let a;if(o>0)for(a=new Array(o),i=0;i<o;++i)a[i]=e[t++];let c=oe.unpack(e,t,Lue);t+=oe.packedLength;let d=e[t];return l(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=oe.clone(c,n._ellipsoid),n._granularity=d,n):(xP.positions=r,xP.minimumHeights=s,xP.maximumHeights=a,xP.granularity=d,new j_(xP))};j_.fromConstantHeights=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.positions,n,i,o=e.minimumHeight,r=e.maximumHeight,s=l(o),a=l(r);if(s||a){let d=t.length;n=s?new Array(d):void 0,i=a?new Array(d):void 0;for(let u=0;u<d;++u)s&&(n[u]=o),a&&(i[u]=r)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid};return new j_(c)};j_.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._granularity,r=e._ellipsoid,s=J_.computePositions(r,t,i,n,o,!1);if(!l(s))return;let a=s.bottomPositions,c=s.topPositions,d=c.length,u=d*2,m=new Float64Array(u),p=0;d/=3;let y;for(y=0;y<d;++y){let V=y*3,L=h.fromArray(c,V,Cue),Z=h.fromArray(a,V,Vue);m[p++]=Z.x,m[p++]=Z.y,m[p++]=Z.z,m[p++]=L.x,m[p++]=L.y,m[p++]=L.z}let f=new pn({position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:m})}),x=u/3;u=2*x-4+x;let _=Ne.createTypedArray(x,u),C=0;for(y=0;y<x-2;y+=2){let V=y,L=y+2,Z=h.fromArray(m,V*3,Cue),G=h.fromArray(m,L*3,Vue);if(h.equalsEpsilon(Z,G,W.EPSILON10))continue;let I=y+1,P=y+3;_[C++]=I,_[C++]=V,_[C++]=I,_[C++]=P,_[C++]=V,_[C++]=L}return _[C++]=x-2,_[C++]=x-1,new mt({attributes:f,indices:_,primitiveType:Ae.LINES,boundingSphere:new ce.fromVertices(m)})};var _P=j_;var Rue=new O;function dje(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 ch(e,t){si.call(this,{entity:e,scene:t,geometryOptions:new dje(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}l(Object.create)&&(ch.prototype=Object.create(si.prototype),ch.prototype.constructor=ch);ch.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Dn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Ut){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,Rue)),l(c)||(c=O.WHITE),o=Ot.fromColor(c),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new St({id:t,geometry:new gP(this._options),attributes:i})};ch.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=z.getValueOrDefault(this._outlineColorProperty,e,O.BLACK,Rue),o=this._distanceDisplayConditionProperty.getValue(e);return new St({id:t,geometry:new _P(this._options),attributes:{show:new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ot.fromColor(i),distanceDisplayCondition:Dn.fromDistanceDisplayCondition(o)}})};ch.prototype._isHidden=function(e,t){return!l(t.positions)||si.prototype._isHidden.call(this,e,t)};ch.prototype._getIsClosed=function(e){return!1};ch.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!z.isConstant(t.minimumHeights)||!z.isConstant(t.maximumHeights)||!z.isConstant(t.outlineWidth)||!z.isConstant(t.granularity)};ch.prototype._setStaticOptions=function(e,t){let n=t.minimumHeights,i=t.maximumHeights,o=t.granularity,r=this._materialProperty instanceof Ut,s=this._options;s.vertexFormat=r?cn.VERTEX_FORMAT:mo.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(Be.MINIMUM_VALUE,s.positions),s.minimumHeights=l(n)?n.getValue(Be.MINIMUM_VALUE,s.minimumHeights):void 0,s.maximumHeights=l(i)?i.getValue(Be.MINIMUM_VALUE,s.maximumHeights):void 0,s.granularity=l(o)?o.getValue(Be.MINIMUM_VALUE):void 0};ch.DynamicGeometryUpdater=O1;function O1(e,t,n){ri.call(this,e,t,n)}l(Object.create)&&(O1.prototype=Object.create(ri.prototype),O1.prototype.constructor=O1);O1.prototype._isHidden=function(e,t,n){return!l(this._options.positions)||ri.prototype._isHidden.call(this,e,t,n)};O1.prototype._setOptions=function(e,t,n){let i=this._options;i.positions=z.getValueOrUndefined(t.positions,n,i.positions),i.minimumHeights=z.getValueOrUndefined(t.minimumHeights,n,i.minimumHeights),i.maximumHeights=z.getValueOrUndefined(t.maximumHeights,n,i.maximumHeights),i.granularity=z.getValueOrUndefined(t.granularity,n)};var TP=ch;var uje=[],Zue=[NE,N2,X2,q2,eP,iP,aP,fP,pP,TP];function SP(e,t){this.entity=e,this.scene=t;let n=new Array(Zue.length),i=new ye;function o(s){i.raiseEvent(s)}let r=new Er;for(let s=0;s<n.length;s++){let a=new Zue[s](e,t);r.add(a.geometryChanged,o),n[s]=a}this.updaters=n,this.geometryChanged=i,this.eventHelper=r,this._removeEntitySubscription=e.definitionChanged.addEventListener(SP.prototype._onEntityPropertyChanged,this)}SP.prototype._onEntityPropertyChanged=function(e,t,n,i){let o=this.updaters;for(let r=0;r<o.length;r++)o[r]._onEntityPropertyChanged(e,t,n,i)};SP.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};SP.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),ue(this)};function Du(e,t,n,i){n=g(n,e.primitives),i=g(i,e.groundPrimitives),this._scene=e,this._primitives=n,this._groundPrimitives=i,this._entityCollection=void 0,this._addedObjects=new Ct,this._removedObjects=new Ct,this._changedObjects=new Ct;let o=Cn.NUMBER_OF_SHADOW_MODES;this._outlineBatches=new Array(o*2),this._closedColorBatches=new Array(o*2),this._closedMaterialBatches=new Array(o*2),this._openColorBatches=new Array(o*2),this._openMaterialBatches=new Array(o*2);let r=Jo.supportsMaterialsforEntitiesOnTerrain(e);this._supportsMaterialsforEntitiesOnTerrain=r;let s;for(s=0;s<o;++s)this._outlineBatches[s]=new B1(n,e,s,!1),this._outlineBatches[o+s]=new B1(n,e,s,!0),this._closedColorBatches[s]=new Nu(n,cn,void 0,!0,s,!0),this._closedColorBatches[o+s]=new Nu(n,cn,void 0,!0,s,!1),this._closedMaterialBatches[s]=new Uu(n,mo,void 0,!0,s,!0),this._closedMaterialBatches[o+s]=new Uu(n,mo,void 0,!0,s,!1),this._openColorBatches[s]=new Nu(n,cn,void 0,!1,s,!0),this._openColorBatches[o+s]=new Nu(n,cn,void 0,!1,s,!1),this._openMaterialBatches[s]=new Uu(n,mo,void 0,!1,s,!0),this._openMaterialBatches[o+s]=new Uu(n,mo,void 0,!1,s,!1);let a=Bn.NUMBER_OF_CLASSIFICATION_TYPES,c=new Array(a),d=[];if(r)for(s=0;s<a;++s)d.push(new bP(i,s,mo)),c[s]=new U1(i,s);else for(s=0;s<a;++s)c[s]=new U1(i,s);this._groundColorBatches=c,this._groundMaterialBatches=d,this._dynamicBatch=new U_(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new Ct,this._updaterSets=new Ct,this._entityCollection=t,t.collectionChanged.addEventListener(Du.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,uje)}Du.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,s=r.values,a,c,d,u,m=this;for(a=s.length-1;a>-1;a--)c=s[a],d=c.id,u=this._updaterSets.get(d),u.entity===c?u.forEach(function(x){m._removeUpdater(x),m._insertUpdaterIntoBatch(e,x)}):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],d=c.id,u=this._updaterSets.get(d),u.forEach(this._removeUpdater.bind(this)),u.destroy(),this._updaterSets.remove(d),this._subscriptions.get(d)(),this._subscriptions.remove(d);for(a=n.length-1;a>-1;a--)c=n[a],d=c.id,u=new SP(c,this._scene),this._updaterSets.set(d,u),u.forEach(function(x){m._insertUpdaterIntoBatch(e,x)}),this._subscriptions.set(d,u.geometryChanged.addEventListener(Du._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let p=!0,y=this._batches,f=y.length;for(a=0;a<f;a++)p=y[a].update(e)&&p;return p};var mje=[],hje=new ce;Du.prototype.getBoundingSphere=function(e,t){let n=mje,i=hje,o=0,r=ut.DONE,s=this._batches,a=s.length,c=e.id;if(!this._updaterSets.get(c))return ut.FAILED;let d=this._updaterSets.get(c).updaters;for(let u=0;u<d.length;u++){let m=d[u];for(let p=0;p<a;p++){if(r=s[p].getBoundingSphere(m,i),r===ut.PENDING)return ut.PENDING;r===ut.DONE&&(n[o]=ce.clone(i,n[o]),o++)}}return o===0?ut.FAILED:(n.length=o,ce.fromBoundingSpheres(n,t),ut.DONE)};Du.prototype.isDestroyed=function(){return!1};Du.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Du.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();this._subscriptions.removeAll();let o=this._updaterSets.values;for(n=o.length,e=0;e<n;e++)o[e].destroy();return this._updaterSets.removeAll(),ue(this)};Du.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};Du.prototype._insertUpdaterIntoBatch=function(e,t){if(t.isDynamic){this._dynamicBatch.add(e,t);return}let n;(t.outlineEnabled||t.fillEnabled)&&(n=t.shadowsProperty.getValue(e));let i=Cn.NUMBER_OF_SHADOW_MODES;if(t.outlineEnabled&&(l(t.terrainOffsetProperty)?this._outlineBatches[i+n].add(e,t):this._outlineBatches[n].add(e,t)),t.fillEnabled)if(t.onTerrain){let o=t.classificationTypeProperty.getValue(e);t.fillMaterialProperty instanceof Ut?this._groundColorBatches[o].add(e,t):this._groundMaterialBatches[o].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof Ut?l(t.terrainOffsetProperty)?this._closedColorBatches[i+n].add(e,t):this._closedColorBatches[n].add(e,t):l(t.terrainOffsetProperty)?this._closedMaterialBatches[i+n].add(e,t):this._closedMaterialBatches[n].add(e,t):t.fillMaterialProperty instanceof Ut?l(t.terrainOffsetProperty)?this._openColorBatches[i+n].add(e,t):this._openColorBatches[n].add(e,t):l(t.terrainOffsetProperty)?this._openMaterialBatches[i+n].add(e,t):this._openMaterialBatches[n].add(e,t)};Du._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,o=i.id;!l(t.get(o))&&!l(n.get(o))&&n.set(o,i)};Du.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(o.set(a,c),r.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,o.remove(a)?r.set(a,c):i.set(a,c)};var CP=Du;var X$n=T(S(),1);var fje=1,pje="30px sans-serif",bje=No.FILL,yje=O.WHITE,gje=O.BLACK,xje=1,_je=!1,Tje=new O(.165,.165,.165,.8),Sje=new B(7,5),Cje=B.ZERO,Vje=h.ZERO,Lje=Qe.NONE,Rje=bi.CENTER,Zje=vn.CENTER,Gje=new h,Eje=new O,Ije=new O,Xje=new O,Wje=new B,Pje=new h,vje=new B,wje=new vt,Fje=new vt,Aje=new vt,Mje=new It;function Gue(e){this.entity=e,this.label=void 0,this.index=void 0}function vy(e,t){t.collectionChanged.addEventListener(vy.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Ct,this._onCollectionChanged(t,t.values,[],[])}vy.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._label,c,d=r.label,u=s.isShowing&&s.isAvailable(e)&&z.getValueOrDefault(a._show,e,!0),m;if(u&&(m=z.getValueOrUndefined(s._position,e,Gje),c=z.getValueOrUndefined(a._text,e),u=l(m)&&l(c)),!u){yz(r,s,n);continue}z.isConstant(s._position)||(n._clusterDirty=!0);let p=!1,y=z.getValueOrDefault(a._heightReference,e,Lje);l(d)||(d=n.getLabel(s),d.id=s,r.label=d,p=h.equals(d.position,m)&&d.heightReference===y),d.show=!0,d.position=m,d.text=c,d.scale=z.getValueOrDefault(a._scale,e,fje),d.font=z.getValueOrDefault(a._font,e,pje),d.style=z.getValueOrDefault(a._style,e,bje),d.fillColor=z.getValueOrDefault(a._fillColor,e,yje,Eje),d.outlineColor=z.getValueOrDefault(a._outlineColor,e,gje,Ije),d.outlineWidth=z.getValueOrDefault(a._outlineWidth,e,xje),d.showBackground=z.getValueOrDefault(a._showBackground,e,_je),d.backgroundColor=z.getValueOrDefault(a._backgroundColor,e,Tje,Xje),d.backgroundPadding=z.getValueOrDefault(a._backgroundPadding,e,Sje,Wje),d.pixelOffset=z.getValueOrDefault(a._pixelOffset,e,Cje,vje),d.eyeOffset=z.getValueOrDefault(a._eyeOffset,e,Vje,Pje),d.heightReference=y,d.horizontalOrigin=z.getValueOrDefault(a._horizontalOrigin,e,Rje),d.verticalOrigin=z.getValueOrDefault(a._verticalOrigin,e,Zje),d.translucencyByDistance=z.getValueOrUndefined(a._translucencyByDistance,e,wje),d.pixelOffsetScaleByDistance=z.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,Fje),d.scaleByDistance=z.getValueOrUndefined(a._scaleByDistance,e,Aje),d.distanceDisplayCondition=z.getValueOrUndefined(a._distanceDisplayCondition,e,Mje),d.disableDepthTestDistance=z.getValueOrUndefined(a._disableDepthTestDistance,e),p&&d._updateClamping()}return!0};vy.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.label))return ut.FAILED;let i=n.label;return t.center=h.clone(g(i._clampedPosition,i.position),t.center),t.radius=0,ut.DONE};vy.prototype.isDestroyed=function(){return!1};vy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(vy.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return ue(this)};vy.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._label)&&l(r._position)&&s.set(r.id,new Gue(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._label)&&l(r._position)?s.contains(r.id)||s.set(r.id,new Gue(r)):(yz(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],yz(s.get(r.id),r,a),s.remove(r.id)};function yz(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var VP=vy;var q$n=T(S(),1);var Nje=1,Uje=0,kje=!0,Dje=!0,Bje=Cn.ENABLED,Oje=Qe.NONE,Yje=O.RED,Hje=0,Kje=O.WHITE,zje=ic.HIGHLIGHT,Jje=.5,Qje=new B(1,1),jje=new A,qje=new A,Eue=new O,Iue=new Array(4),$je=new h;function wy(e,t){t.collectionChanged.addEventListener(wy.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new Ct,this._onCollectionChanged(t,t.values,[],[])}async function e8e(e,t,n,i){let o=e._primitives,r=e._modelHash;try{let s=await km.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene});if(e.isDestroyed()||!l(r[t.id]))return;s.id=t,o.add(s),r[t.id].modelPrimitive=s,s.errorEvent.addEventListener(a=>{l(r[t.id])&&(console.log(a),a.name!=="TextureError"&&s.incrementallyLoadTextures&&(r[t.id].loadFailed=!0))})}catch(s){if(e.isDestroyed()||!l(r[t.id]))return;console.log(s),r[t.id].loadFailed=!0}}wy.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._modelHash,i=this._primitives;for(let o=0,r=t.length;o<r;o++){let s=t[o],a=s._model,c,d=n[s.id],u=s.isShowing&&s.isAvailable(e)&&z.getValueOrDefault(a._show,e,!0),m;if(u&&(m=s.computeModelMatrix(e,jje),c=Xe.createIfNeeded(z.getValueOrUndefined(a._uri,e)),u=l(m)&&l(c)),!u){l(d)&&d.modelPrimitive&&(d.modelPrimitive.show=!1);continue}if(!l(d)||c.url!==d.url){l(d?.modelPrimitive)&&(i.removeAndDestroy(d.modelPrimitive),delete n[s.id]),d={modelPrimitive:void 0,url:c.url,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1},n[s.id]=d;let f=z.getValueOrDefault(a._incrementallyLoadTextures,e,kje);e8e(this,s,c,f)}let p=d.modelPrimitive;if(!l(p))continue;p.show=!0,p.scale=z.getValueOrDefault(a._scale,e,Nje),p.minimumPixelSize=z.getValueOrDefault(a._minimumPixelSize,e,Uje),p.maximumScale=z.getValueOrUndefined(a._maximumScale,e),p.modelMatrix=A.clone(m,p.modelMatrix),p.shadows=z.getValueOrDefault(a._shadows,e,Bje),p.heightReference=z.getValueOrDefault(a._heightReference,e,Oje),p.distanceDisplayCondition=z.getValueOrUndefined(a._distanceDisplayCondition,e),p.silhouetteColor=z.getValueOrDefault(a._silhouetteColor,e,Yje,Eue),p.silhouetteSize=z.getValueOrDefault(a._silhouetteSize,e,Hje),p.color=z.getValueOrDefault(a._color,e,Kje,Eue),p.colorBlendMode=z.getValueOrDefault(a._colorBlendMode,e,zje),p.colorBlendAmount=z.getValueOrDefault(a._colorBlendAmount,e,Jje),p.clippingPlanes=z.getValueOrUndefined(a._clippingPlanes,e),p.clampAnimations=z.getValueOrDefault(a._clampAnimations,e,Dje),p.imageBasedLighting.imageBasedLightingFactor=z.getValueOrDefault(a._imageBasedLightingFactor,e,Qje);let y=z.getValueOrUndefined(a._lightColor,e);if(l(y)&&(O.pack(y,Iue,0),y=h.unpack(Iue,0,$je)),p.lightColor=y,p.customShader=z.getValueOrUndefined(a._customShader,e),n[s.id].modelUpdated=!0,p.ready){!a._readyOk&&a._marsOptions&&a._marsOptions.callback&&(a._marsOptions.callback(s,p),a._readyOk=!0);let f=z.getValueOrDefault(a._runAnimations,e,!0);d.animationsRunning!==f&&(f?p.activeAnimations.addAll({loop:El.REPEAT}):p.activeAnimations.removeAll(),d.animationsRunning=f);let x=z.getValueOrUndefined(a._nodeTransformations,e,d.nodeTransformationsScratch);if(l(x)){let V=Object.keys(x);for(let L=0,Z=V.length;L<Z;++L){let G=V[L],I=x[G];if(!l(I))continue;let P=p.getNode(G);if(!l(P))continue;let v=A.fromTranslationRotationScale(I,qje);P.matrix=A.multiply(P.originalMatrix,v,v)}}let _=!1,C=z.getValueOrUndefined(a._articulations,e,d.articulationsScratch);if(l(C)){let V=Object.keys(C);for(let L=0,Z=V.length;L<Z;++L){let G=V[L],I=C[G];l(I)&&(_=!0,p.setArticulationStage(G,I))}}_&&p.applyArticulations()}}return!0};wy.prototype.isDestroyed=function(){return!1};wy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(wy.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)gz(this,e[i],t,n);return ue(this)};var nU=new h,t8e=new he;wy.prototype.getBoundingSphere=function(e,t){let n=this._modelHash[e.id];if(!l(n))return ut.FAILED;if(n.loadFailed)return ut.FAILED;let i=n.modelPrimitive;if(!l(i)||!i.show)return ut.PENDING;if(!i.ready||!n.modelUpdated)return ut.PENDING;let o=this._scene,r=o.globe,s=g(r?.ellipsoid,oe.WGS84);if(i.heightReference!==Qe.NONE){let c=i.modelMatrix;nU.x=c[12],nU.y=c[13],nU.z=c[14];let d=s.cartesianToCartographic(nU,t8e),u=o.getHeight(d,i.heightReference);return l(u)&&(tu(i.heightReference)?d.height=u:d.height+=u),ce.clone(i.boundingSphere,t),t.center=s.cartographicToCartesian(d),ut.DONE}return ce.clone(i.boundingSphere,t),ut.DONE};wy.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._modelHash,c=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],l(r._model)&&l(r._position)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],l(r._model)&&l(r._position)?(n8e(r,a),s.set(r.id,r)):(gz(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],gz(this,r,a,c),s.remove(r.id)};function gz(e,t,n,i){let o=n[t.id];l(o)&&(i.removeAndDestroy(o.modelPrimitive),delete n[t.id])}function n8e(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var LP=wy;var Zei=T(S(),1);var rei=T(S(),1);function Fy(e){this._definitionChanged=new ye,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(Fy.prototype,{isConstant:{get:function(){return z.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return l(this._value)?this._value.referenceFrame:ao.FIXED}}});Fy.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,ao.FIXED,t)};Fy.prototype.setValue=function(e){this._value!==e&&(this._value=e,l(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),l(e)&&(this._removeSubscription=e.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))};Fy.prototype.getValueInReferenceFrame=function(e,t,n){if(l(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),l(n)?oe.WGS84.scaleToGeodeticSurface(n,n):void 0};Fy.prototype.equals=function(e){return this===e||e instanceof Fy&&this._value===e._value};Fy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Cf=Fy;var i8e=60,o8e=1,Pue=new Ln,xz=new Ln,_z=new Ln;function Xue(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function r8e(e,t,n,i,o,r,s,a,c){let d=a,u;u=e.getValueInReferenceFrame(t,r,c[d]),l(u)&&(c[d++]=u);let m=!l(o)||te.lessThanOrEquals(o,t)||te.greaterThanOrEquals(o,n),p=0,y=i.length,f=i[p],x=n,_=!1,C,V,L;for(;p<y;){if(!m&&te.greaterThanOrEquals(f,o)&&(u=e.getValueInReferenceFrame(o,r,c[d]),l(u)&&(c[d++]=u),m=!0),te.greaterThan(f,t)&&te.lessThan(f,x)&&!f.equals(o)&&(u=e.getValueInReferenceFrame(f,r,c[d]),l(u)&&(c[d++]=u)),p<y-1){if(s>0&&!_){let Z=i[p+1],G=te.secondsDifference(Z,f);_=G>s,_&&(C=Math.ceil(G/s),V=0,L=G/Math.max(C,2),C=Math.max(C-1,1))}if(_&&V<C){f=te.addSeconds(f,L,new te),V++;continue}}_=!1,p++,f=i[p]}return u=e.getValueInReferenceFrame(n,r,c[d]),l(u)&&(c[d++]=u),d}function s8e(e,t,n,i,o,r,s,a){let c,d=0,u=s,m=t,p=Math.max(r,60),y=!l(i)||te.lessThanOrEquals(i,t)||te.greaterThanOrEquals(i,n);for(;te.lessThan(m,n);)!y&&te.greaterThanOrEquals(m,i)&&(y=!0,c=e.getValueInReferenceFrame(i,o,a[u]),l(c)&&(a[u]=c,u++)),c=e.getValueInReferenceFrame(m,o,a[u]),l(c)&&(a[u]=c,u++),d++,m=te.addSeconds(t,p*d,new te);return c=e.getValueInReferenceFrame(n,o,a[u]),l(c)&&(a[u]=c,u++),u}function a8e(e,t,n,i,o,r,s,a){_z.start=t,_z.stop=n;let c=s,d=e.intervals;for(let u=0;u<d.length;u++){let m=d.get(u);if(!Ln.intersect(m,_z,Pue).isEmpty){let p=m.start;m.isStartIncluded||(m.isStopIncluded?p=m.stop:p=te.addSeconds(m.start,te.secondsDifference(m.stop,m.start)/2,new te));let y=e.getValueInReferenceFrame(p,o,a[c]);l(y)&&(a[c]=y,c++)}}return c}function c8e(e,t,n,i,o,r,s,a){let c=e.getValueInReferenceFrame(t,o,a[s]);return l(c)&&(a[s++]=c),s}function l8e(e,t,n,i,o,r,s,a){xz.start=t,xz.stop=n;let c=s,d=e.intervals;for(let u=0;u<d.length;u++){let m=d.get(u);if(!Ln.intersect(m,xz,Pue).isEmpty){let p=m.start,y=m.stop,f=t;te.greaterThan(p,f)&&(f=p);let x=n;te.lessThan(y,x)&&(x=y),c=vue(m.data,f,x,i,o,r,c,a)}}return c}function vue(e,t,n,i,o,r,s,a){for(;e instanceof Z0;)e=e.resolvedProperty;if(e instanceof aa){let c=e._property._times;s=r8e(e,t,n,c,i,o,r,s,a)}else e instanceof ra?s=l8e(e,t,n,i,o,r,s,a):e instanceof G0?s=a8e(e,t,n,i,o,r,s,a):e instanceof wc||e instanceof Cf&&z.isConstant(e)?s=c8e(e,t,n,i,o,r,s,a):s=s8e(e,t,n,i,o,r,s,a);return s}function wue(e,t,n,i,o,r,s){l(s)||(s=[]);let a=vue(e,t,n,i,o,r,0,s);return s.length=a,s}var Wue=new q;function RP(e,t){this._unusedIndexes=[],this._polylineCollection=new Om,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}RP.prototype.update=function(e){if(this._referenceFrame===ao.INERTIAL){let t=Xt.computeIcrfToFixedMatrix(e,Wue);l(t)||(t=Xt.computeTemeToPseudoFixedMatrix(e,Wue)),A.fromRotationTranslation(t,h.ZERO,this._polylineCollection.modelMatrix)}};RP.prototype.updateObject=function(e,t){let n=t.entity,i=n._path,o=n._position,r,s,a=i._show,c=t.polyline,d=n.isShowing&&n.isAvailable(e)&&(!l(a)||a.getValue(e));if(d){let m=z.getValueOrUndefined(i._leadTime,e),p=z.getValueOrUndefined(i._trailTime,e),y=n._availability,f=l(y),x=l(m),_=l(p);if(d=f||x&&_,d){if(_&&(r=te.addSeconds(e,-p,new te)),x&&(s=te.addSeconds(e,m,new te)),f){let C=y.start,V=y.stop;(!_||te.greaterThan(C,r))&&(r=C),(!x||te.lessThan(V,s))&&(s=V)}d=te.lessThan(r,s)}}if(!d){l(c)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,c.show=!1,t.index=void 0);return}if(!l(c)){let m=this._unusedIndexes;if(m.length>0){let y=m.pop();c=this._polylineCollection.get(y),t.index=y}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=n,t.polyline=c}let u=z.getValueOrDefault(i._resolution,e,i8e);c.show=!0,c.positions=wue(o,r,s,e,this._referenceFrame,u,c.positions.slice()),c.material=zo.getValue(e,i._material,c.material),c.width=z.getValueOrDefault(i._width,e,o8e),c.distanceDisplayCondition=z.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};RP.prototype.removeObject=function(e){let t=e.polyline;l(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0)};RP.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),ue(this)};function Ay(e,t){t.collectionChanged.addEventListener(Ay.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new Ct,this._onCollectionChanged(t,t.values,[],[])}Ay.prototype.update=function(e){let t=this._updaters;for(let i in t)t.hasOwnProperty(i)&&t[i].update(e);let n=this._items.values;if(n.length===0&&l(this._updaters)&&Object.keys(this._updaters).length>0){for(let i in t)t.hasOwnProperty(i)&&t[i].destroy();this._updaters={}}for(let i=0,o=n.length;i<o;i++){let r=n[i],a=r.entity._position,c=r.updater,d=ao.FIXED;this._scene.mode===ie.SCENE3D&&(d=a.referenceFrame);let u=this._updaters[d];if(c===u&&l(u)){u.updateObject(e,r);continue}l(c)&&c.removeObject(r),l(u)||(u=new RP(this._scene,d),u.update(e),this._updaters[d]=u),r.updater=u,l(u)&&u.updateObject(e,r)}return!0};Ay.prototype.isDestroyed=function(){return!1};Ay.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Ay.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return ue(this)};Ay.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s,a=this._items;for(o=t.length-1;o>-1;o--)r=t[o],l(r._path)&&l(r._position)&&a.set(r.id,new Xue(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._path)&&l(r._position)?a.contains(r.id)||a.set(r.id,new Xue(r)):(s=a.get(r.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(r.id)));for(o=n.length-1;o>-1;o--)r=n[o],s=a.get(r.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(r.id))};Ay._subSample=wue;var ZP=Ay;var Uei=T(S(),1);var Fue=O.WHITE,Aue=O.BLACK,Mue=0,Nue=1,Uue=0,kue=new O,d8e=new h,Due=new O,Bue=new vt,Oue=new vt,Yue=new It;function Hue(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 My(e,t){t.collectionChanged.addEventListener(My.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Ct,this._onCollectionChanged(t,t.values,[],[])}My.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._point,c=r.pointPrimitive,d=r.billboard,u=z.getValueOrDefault(a._heightReference,e,Qe.NONE),m=s.isShowing&&s.isAvailable(e)&&z.getValueOrDefault(a._show,e,!0),p;if(m&&(p=z.getValueOrUndefined(s._position,e,d8e),m=l(p)),!m){GP(r,s,n);continue}z.isConstant(s._position)||(n._clusterDirty=!0);let y=!1,f=!1;if(u!==Qe.NONE&&!l(d)?(l(c)&&(GP(r,s,n),c=void 0),d=n.getBillboard(s),d.id=s,d.image=void 0,r.billboard=d,y=!0,f=h.equals(d.position,p)&&d.heightReference===u):u===Qe.NONE&&!l(c)&&(l(d)&&(GP(r,s,n),d=void 0),c=n.getPoint(s),c.id=s,r.pointPrimitive=c),l(c))c.show=!0,c.position=p,c.scaleByDistance=z.getValueOrUndefined(a._scaleByDistance,e,Bue),c.translucencyByDistance=z.getValueOrUndefined(a._translucencyByDistance,e,Oue),c.color=z.getValueOrDefault(a._color,e,Fue,kue),c.outlineColor=z.getValueOrDefault(a._outlineColor,e,Aue,Due),c.outlineWidth=z.getValueOrDefault(a._outlineWidth,e,Mue),c.pixelSize=z.getValueOrDefault(a._pixelSize,e,Nue),c.distanceDisplayCondition=z.getValueOrUndefined(a._distanceDisplayCondition,e,Yue),c.disableDepthTestDistance=z.getValueOrDefault(a._disableDepthTestDistance,e,Uue);else if(l(d)){d.show=!0,d.position=p,d.scaleByDistance=z.getValueOrUndefined(a._scaleByDistance,e,Bue),d.translucencyByDistance=z.getValueOrUndefined(a._translucencyByDistance,e,Oue),d.distanceDisplayCondition=z.getValueOrUndefined(a._distanceDisplayCondition,e,Yue),d.disableDepthTestDistance=z.getValueOrDefault(a._disableDepthTestDistance,e,Uue),d.heightReference=u;let x=z.getValueOrDefault(a._color,e,Fue,kue),_=z.getValueOrDefault(a._outlineColor,e,Aue,Due),C=Math.round(z.getValueOrDefault(a._outlineWidth,e,Mue)),V=Math.max(1,Math.round(z.getValueOrDefault(a._pixelSize,e,Nue)));if(C>0?(d.scale=1,y=y||C!==r.outlineWidth||V!==r.pixelSize||!O.equals(x,r.color)||!O.equals(_,r.outlineColor)):(d.scale=V/50,V=50,y=y||C!==r.outlineWidth||!O.equals(x,r.color)||!O.equals(_,r.outlineColor)),y){r.color=O.clone(x,r.color),r.outlineColor=O.clone(_,r.outlineColor),r.pixelSize=V,r.outlineWidth=C;let L=x.alpha,Z=x.toCssColorString(),G=_.toCssColorString(),I=JSON.stringify([Z,V,G,C]);d.setImage(I,a_(L,Z,G,C,V))}f&&d._updateClamping()}}return!0};My.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!(l(n.pointPrimitive)||l(n.billboard)))return ut.FAILED;if(l(n.pointPrimitive))t.center=h.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(!l(i._clampedPosition))return ut.PENDING;t.center=h.clone(i._clampedPosition,t.center)}return t.radius=0,ut.DONE};My.prototype.isDestroyed=function(){return!1};My.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(My.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return ue(this)};My.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._point)&&l(r._position)&&s.set(r.id,new Hue(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._point)&&l(r._position)?s.contains(r.id)||s.set(r.id,new Hue(r)):(GP(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],GP(s.get(r.id),r,a),s.remove(r.id)};function GP(e,t,n){if(l(e)){let i=e.pointPrimitive;if(l(i)){e.pointPrimitive=void 0,n.removePoint(t);return}let o=e.billboard;l(o)&&(e.billboard=void 0,n.removeBillboard(t))}}var EP=My;var gni=T(S(),1);var Ati=T(S(),1);var sti=T(S(),1);var jue=[];function u8e(e,t,n,i,o){let r=jue;r.length=o;let s,a=n.red,c=n.green,d=n.blue,u=n.alpha,m=i.red,p=i.green,y=i.blue,f=i.alpha;if(O.equals(n,i)){for(s=0;s<o;s++)r[s]=O.clone(n);return r}let x=(m-a)/o,_=(p-c)/o,C=(y-d)/o,V=(f-u)/o;for(s=0;s<o;s++)r[s]=new O(a+s*x,c+s*_,d+s*C,u+s*V);return r}function IP(e){e=g(e,g.EMPTY_OBJECT);let t=e.positions,n=e.colors,i=g(e.width,1),o=g(e.colorsPerVertex,!1);this._positions=t,this._colors=n,this._width=i,this._colorsPerVertex=o,this._vertexFormat=Pe.clone(g(e.vertexFormat,Pe.DEFAULT)),this._arcType=g(e.arcType,jt.GEODESIC),this._granularity=g(e.granularity,W.RADIANS_PER_DEGREE),this._ellipsoid=oe.clone(g(e.ellipsoid,oe.WGS84)),this._workerName="createPolylineGeometry";let r=1+t.length*h.packedLength;r+=l(n)?1+n.length*O.packedLength:1,this.packedLength=r+oe.packedLength+Pe.packedLength+4}IP.pack=function(e,t,n){n=g(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._colors;for(r=l(s)?s.length:0,t[n++]=r,i=0;i<r;++i,n+=O.packedLength)O.pack(s[i],t,n);return oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,Pe.pack(e._vertexFormat,t,n),n+=Pe.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};var que=oe.clone(oe.UNIT_SPHERE),$ue=new Pe,q_={positions:void 0,colors:void 0,ellipsoid:que,vertexFormat:$ue,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};IP.unpack=function(e,t,n){t=g(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=O.packedLength)s[i]=O.unpack(e,t);let a=oe.unpack(e,t,que);t+=oe.packedLength;let c=Pe.unpack(e,t,$ue);t+=Pe.packedLength;let d=e[t++],u=e[t++]===1,m=e[t++],p=e[t];return l(n)?(n._positions=r,n._colors=s,n._ellipsoid=oe.clone(a,n._ellipsoid),n._vertexFormat=Pe.clone(c,n._vertexFormat),n._width=d,n._colorsPerVertex=u,n._arcType=m,n._granularity=p,n):(q_.positions=r,q_.colors=s,q_.width=d,q_.colorsPerVertex=u,q_.arcType=m,q_.granularity=p,new IP(q_))};var Kue=new h,zue=new h,Jue=new h,Que=new h;IP.createGeometry=function(e){let t=e._width,n=e._vertexFormat,i=e._colors,o=e._colorsPerVertex,r=e._arcType,s=e._granularity,a=e._ellipsoid,c,d,u,m=[],p=So(e._positions,h.equalsEpsilon,!1,m);if(l(i)&&m.length>0){let w=0,N=m[0];i=i.filter(function(D,k){let Y=!1;return o?Y=k===N||k===0&&N===1:Y=k+1===N,Y?(w++,N=m[w],!1):!0})}let y=p.length;if(y<2||t<=0)return;if(r===jt.GEODESIC||r===jt.RHUMB){let w,N;r===jt.GEODESIC?(w=W.chordLength(s,a.maximumRadius),N=Ei.numberOfPoints):(w=s,N=Ei.numberOfPointsRhumbLine);let D=Ei.extractHeights(p,a);if(l(i)){let k=1;for(c=0;c<y-1;++c)k+=N(p[c],p[c+1],w);let Y=new Array(k),U=0;for(c=0;c<y-1;++c){let J=p[c],K=p[c+1],ee=i[c],H=N(J,K,w);if(o&&c<k){let j=i[c+1],$=u8e(J,K,ee,j,H),pe=$.length;for(d=0;d<pe;++d)Y[U++]=$[d]}else for(d=0;d<H;++d)Y[U++]=O.clone(ee)}Y[U]=O.clone(i[i.length-1]),i=Y,jue.length=0}r===jt.GEODESIC?p=Ei.generateCartesianArc({positions:p,minDistance:w,ellipsoid:a,height:D}):p=Ei.generateCartesianRhumbArc({positions:p,granularity:w,ellipsoid:a,height:D})}y=p.length;let f=y*4-4,x=new Float64Array(f*3),_=new Float64Array(f*3),C=new Float64Array(f*3),V=new Float32Array(f*2),L=n.st?new Float32Array(f*2):void 0,Z=l(i)?new Uint8Array(f*4):void 0,G=0,I=0,P=0,v=0,F;for(d=0;d<y;++d){d===0?(F=Kue,h.subtract(p[0],p[1],F),h.add(p[0],F,F)):F=p[d-1],h.clone(F,Jue),h.clone(p[d],zue),d===y-1?(F=Kue,h.subtract(p[y-1],p[y-2],F),h.add(p[y-1],F,F)):F=p[d+1],h.clone(F,Que);let w,N;l(Z)&&(d!==0&&!o?w=i[d-1]:w=i[d],d!==y-1&&(N=i[d]));let D=d===0?2:0,k=d===y-1?2:4;for(u=D;u<k;++u){h.pack(zue,x,G),h.pack(Jue,_,G),h.pack(Que,C,G),G+=3;let Y=u-2<0?-1:1;if(V[I++]=2*(u%2)-1,V[I++]=Y*t,n.st&&(L[P++]=d/(y-1),L[P++]=Math.max(V[I-2],0)),l(Z)){let U=u<2?w:N;Z[v++]=O.floatToByte(U.red),Z[v++]=O.floatToByte(U.green),Z[v++]=O.floatToByte(U.blue),Z[v++]=O.floatToByte(U.alpha)}}}let M=new pn;M.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:x}),M.prevPosition=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:_}),M.nextPosition=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:C}),M.expandAndWidth=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:V}),n.st&&(M.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:L})),l(Z)&&(M.color=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:4,values:Z,normalize:!0}));let b=Ne.createTypedArray(f,y*6-6),R=0,E=0,X=y-1;for(d=0;d<X;++d)b[E++]=R,b[E++]=R+2,b[E++]=R+1,b[E++]=R+1,b[E++]=R+2,b[E++]=R+3,R+=4;return new mt({attributes:M,indices:b,primitiveType:Ae.TRIANGLES,boundingSphere:ce.fromPoints(p),geometryType:nu.POLYLINES})};var v0=IP;var m8e=new ei(0),iU={},eme=new O,h8e=new Ut(O.WHITE),f8e=new ei(!0),p8e=new ei(Cn.DISABLED),b8e=new ei(new It),y8e=new ei(Bn.BOTH);function g8e(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function x8e(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function lh(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(lh.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new ye,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 g8e,this._groundGeometryOptions=new x8e,this._id=`polyline-${e.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=Jo.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(lh.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||!l(this._entity.availability)&&z.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}}});lh.prototype.isOutlineVisible=function(e){return!1};lh.prototype.isFilled=function(e){let t=this._entity,n=this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e);return g(n,!1)};lh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Sn(n&&t.isShowing&&this._showProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Dn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r},a;return this._materialProperty instanceof Ut&&(l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,eme)),l(a)||(a=O.WHITE),s.color=Ot.fromColor(a)),this.clampToGround?new St({id:t,geometry:new hx(this._groundGeometryOptions),attributes:s}):(l(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof Ut&&(l(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||n)&&(a=this._depthFailMaterialProperty.color.getValue(e,eme)),l(a)||(a=O.WHITE),s.depthFailColor=Ot.fromColor(a)),new St({id:t,geometry:new v0(this._geometryOptions),attributes:s}))};lh.prototype.createOutlineGeometryInstance=function(e){};lh.prototype.isDestroyed=function(){return!1};lh.prototype.destroy=function(){this._entitySubscription(),ue(this)};lh.prototype._onEntityPropertyChanged=function(e,t,n,i){if(!(t==="availability"||t==="polyline"))return;let o=this._entity.polyline;if(!l(o)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let r=o.positions,s=o.show;if(l(s)&&s.isConstant&&!s.getValue(Be.MINIMUM_VALUE)||!l(r)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let a=o.zIndex,c=g(o.material,h8e),d=c instanceof Ut;this._materialProperty=c,this._depthFailMaterialProperty=o.depthFailMaterial,this._showProperty=g(s,f8e),this._shadowsProperty=g(o.shadows,p8e),this._distanceDisplayConditionProperty=g(o.distanceDisplayCondition,b8e),this._classificationTypeProperty=g(o.classificationType,y8e),this._fillEnabled=!0,this._zIndex=g(a,m8e);let u=o.width,m=o.arcType,p=o.clampToGround,y=o.granularity;if(!r.isConstant||!z.isConstant(u)||!z.isConstant(m)||!z.isConstant(y)||!z.isConstant(p)||!z.isConstant(a))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{let f=this._geometryOptions,x=r.getValue(Be.MINIMUM_VALUE,f.positions);if(!l(x)||x.length<2){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let _;d&&(!l(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof Ut)?_=Br.VERTEX_FORMAT:_=qs.VERTEX_FORMAT,f.vertexFormat=_,f.positions=x,f.width=l(u)?u.getValue(Be.MINIMUM_VALUE):void 0,f.arcType=l(m)?m.getValue(Be.MINIMUM_VALUE):void 0,f.granularity=l(y)?y.getValue(Be.MINIMUM_VALUE):void 0;let C=this._groundGeometryOptions;C.positions=x,C.width=f.width,C.arcType=f.arcType,C.granularity=f.granularity,this._clampToGround=l(p)?p.getValue(Be.MINIMUM_VALUE):!1,!this._clampToGround&&l(a)&&Ft("Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};lh.prototype.createDynamicUpdater=function(e,t){return new XP(e,t,this)};var Y1={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function XP(e,t,n){this._line=void 0,this._primitives=e,this._groundPrimitives=t,this._groundPolylinePrimitive=void 0,this._material=void 0,this._geometryUpdater=n,this._positions=[]}function tme(e){if(l(e._line))return e._line;let t=e._primitives,n=e._geometryUpdater._scene.id+t._guid,i=iU[n];!l(i)||i.isDestroyed()?(i=new Om,iU[n]=i,t.add(i)):t.contains(i)||t.add(i);let o=i.add();return o.id=e._geometryUpdater._entity,e._line=o,o}XP.prototype.update=function(e){let t=this._geometryUpdater,n=t._entity,i=n.polyline,o=i.positions,r=z.getValueOrUndefined(o,e,this._positions);t._clampToGround=z.getValueOrDefault(i._clampToGround,e,!1),t._groundGeometryOptions.positions=r,t._groundGeometryOptions.width=z.getValueOrDefault(i._width,e,1),t._groundGeometryOptions.arcType=z.getValueOrDefault(i._arcType,e,jt.GEODESIC),t._groundGeometryOptions.granularity=z.getValueOrDefault(i._granularity,e,9999);let s=this._groundPrimitives;if(l(this._groundPolylinePrimitive)&&(s.remove(this._groundPolylinePrimitive),this._groundPolylinePrimitive=void 0),t.clampToGround){if(!n.isShowing||!n.isAvailable(e)||!z.getValueOrDefault(i._show,e,!0)||!l(r)||r.length<2)return;let u=t.fillMaterialProperty,m;if(u instanceof Ut)m=new Br;else{let p=zo.getValue(e,u,this._material);m=new qs({material:p,translucent:p.isTranslucent()}),this._material=p}this._groundPolylinePrimitive=s.add(new Tm({geometryInstances:t.createFillGeometryInstance(e),appearance:m,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),z.getValueOrUndefined(t.zIndex,e)),l(this._line)&&(this._line.show=!1);return}let a=tme(this);if(!n.isShowing||!n.isAvailable(e)||!z.getValueOrDefault(i._show,e,!0)){a.show=!1;return}if(!l(r)||r.length<2){a.show=!1;return}let c=jt.GEODESIC;c=z.getValueOrDefault(i._arcType,e,c);let d=t._scene.globe;c!==jt.NONE&&l(d)&&(Y1.ellipsoid=d.ellipsoid,Y1.positions=r,Y1.granularity=z.getValueOrUndefined(i._granularity,e),Y1.height=Ei.extractHeights(r,d.ellipsoid),c===jt.GEODESIC?r=Ei.generateCartesianArc(Y1):r=Ei.generateCartesianRhumbArc(Y1)),a.show=!0,a.positions=r.slice(),a.material=zo.getValue(e,t.fillMaterialProperty,a.material),a.width=z.getValueOrDefault(i._width,e,1),a.distanceDisplayCondition=z.getValueOrUndefined(i._distanceDisplayCondition,e,a.distanceDisplayCondition)};XP.prototype.getBoundingSphere=function(e){if(this._geometryUpdater.clampToGround){let t=this._groundPolylinePrimitive;if(l(t)&&t.show&&t.ready){let n=t.getGeometryInstanceAttributes(this._geometryUpdater._entity);if(l(n)&&l(n.boundingSphere))return ce.clone(n.boundingSphere,e),ut.DONE}return l(t)&&!t.ready?ut.PENDING:ut.DONE}else{let t=tme(this);if(t.show&&t.positions.length>0)return ce.fromPoints(t.positions,e),ut.DONE}return ut.FAILED};XP.prototype.isDestroyed=function(){return!1};XP.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=iU[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete iU[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),ue(this)};var WP=lh;var eni=T(S(),1);var _8e=new O,T8e=new It,S8e=new It;function dh(e,t,n,i,o){let r;n instanceof Ut?r=Br:r=qs,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=r,this.materialProperty=n,this.updaters=new Ct,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Ct,this.material=void 0,this.updatersWithAttributes=new Ct,this.attributes=new Ct,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(dh.prototype.onMaterialChanged,this),this.subscriptions=new Ct,this.showsUpdated=new Ct,this.zIndex=i,this._asynchronous=o}dh.prototype.onMaterialChanged=function(){this.invalidated=!0};dh.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Ut&&t instanceof Ut?!0:l(t)&&t.equals(n)};dh.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!z.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,s,a,c){s==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};dh.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t)),!0}return!1};dh.prototype.update=function(e){let t=!0,n=this.primitive,i=this.orderedGroundPrimitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0)l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),n=new Tm({show:!1,asynchronous:this._asynchronous,geometryInstances:o.slice(),appearance:new this.appearanceType,classificationType:this.classificationType}),this.appearanceType===qs&&(this.material=zo.getValue(e,this.materialProperty,this.material),n.appearance.material=this.material),i.add(n,this.zIndex),t=!1;else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.appearanceType===qs&&(this.material=zo.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],d=c.entity,u=this.geometry.get(c.id),m=this.attributes.get(u.id.id);if(l(m)||(m=n.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,m)),!c.fillMaterialProperty.isConstant){let x=c.fillMaterialProperty.color,_=z.getValueOrDefault(x,e,O.WHITE,_8e);O.equals(m._lastColor,_)||(m._lastColor=O.clone(_,m._lastColor),m.color=Ot.toValue(_,m.color))}let p=d.isShowing&&(c.hasConstantFill||c.isFilled(e)),y=m.show[0]===1;p!==y&&(m.show=Sn.toValue(p,m.show));let f=c.distanceDisplayConditionProperty;if(!z.isConstant(f)){let x=z.getValueOrDefault(f,e,S8e,T8e);It.equals(x,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=It.clone(x,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=Dn.toValue(x,m.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};dh.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id);if(!s)continue;let a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,d=a.show[0]===1;c!==d&&(a.show=Sn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};dh.prototype.contains=function(e){return this.updaters.contains(e.id)};dh.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ut.FAILED:(i.boundingSphere.clone(t),ut.DONE)};dh.prototype.destroy=function(){let e=this.primitive,t=this.orderedGroundPrimitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function H1(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=g(n,!0)}H1.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=z.getValueOrDefault(t.zIndex,0);for(let a=0;a<i;++a){let c=n[a];if(c.isMaterial(t)&&c.zIndex===r){c.add(e,t,o);return}}let s=new dh(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,r,this._asynchronous);s.add(e,t,o),n.push(s)};H1.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};H1.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};H1.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return ut.FAILED};H1.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var PP=H1;var C8e=[];function nme(e,t){let n=e._batches,i=n.length;for(let o=0;o<i;o++)n[o].remove(t)}function ime(e,t,n){if(n.isDynamic){e._dynamicBatch.add(t,n);return}if(n.clampToGround&&n.fillEnabled){let s=n.classificationTypeProperty.getValue(t);e._groundBatches[s].add(t,n);return}let i;n.fillEnabled&&(i=n.shadowsProperty.getValue(t));let o=0;l(n.depthFailMaterialProperty)&&(o=n.depthFailMaterialProperty instanceof Ut?1:2);let r;l(i)&&(r=i+o*Cn.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof Ut?e._colorBatches[r].add(t,n):e._materialBatches[r].add(t,n))}function Vf(e,t,n,i){i=g(i,e.groundPrimitives),n=g(n,e.primitives),this._scene=e,this._primitives=n,this._entityCollection=void 0,this._addedObjects=new Ct,this._removedObjects=new Ct,this._changedObjects=new Ct;let o,r=Cn.NUMBER_OF_SHADOW_MODES;for(this._colorBatches=new Array(r*3),this._materialBatches=new Array(r*3),o=0;o<r;++o)this._colorBatches[o]=new Nu(n,Br,void 0,!1,o),this._materialBatches[o]=new Uu(n,qs,void 0,!1,o),this._colorBatches[o+r]=new Nu(n,Br,Br,!1,o),this._materialBatches[o+r]=new Uu(n,qs,Br,!1,o),this._colorBatches[o+r*2]=new Nu(n,Br,qs,!1,o),this._materialBatches[o+r*2]=new Uu(n,qs,qs,!1,o);this._dynamicBatch=new U_(n,i);let s=Bn.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(s),o=0;o<s;++o)this._groundBatches[o]=new PP(i,o);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new Ct,this._updaters=new Ct,this._entityCollection=t,t.collectionChanged.addEventListener(Vf.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,C8e)}Vf.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,s=r.values,a,c,d,u;for(a=s.length-1;a>-1;a--)c=s[a],d=c.id,u=this._updaters.get(d),u.entity===c?(nme(this,u),ime(this,e,u)):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],d=c.id,u=this._updaters.get(d),nme(this,u),u.destroy(),this._updaters.remove(d),this._subscriptions.get(d)(),this._subscriptions.remove(d);for(a=n.length-1;a>-1;a--)c=n[a],d=c.id,u=new WP(c,this._scene),this._updaters.set(d,u),ime(this,e,u),this._subscriptions.set(d,u.geometryChanged.addEventListener(Vf._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let m=!0,p=this._batches,y=p.length;for(a=0;a<y;a++)m=p[a].update(e)&&m;return m};var V8e=[],L8e=new ce;Vf.prototype.getBoundingSphere=function(e,t){let n=V8e,i=L8e,o=0,r=ut.DONE,s=this._batches,a=s.length,c=this._updaters.get(e.id);if(!c)return ut.FAILED;for(let d=0;d<a;d++){if(r=s[d].getBoundingSphere(c,i),r===ut.PENDING)return ut.PENDING;r===ut.DONE&&(n[o]=ce.clone(i,n[o]),o++)}return o===0?ut.FAILED:(n.length=o,ce.fromBoundingSpheres(n,t),ut.DONE)};Vf.prototype.isDestroyed=function(){return!1};Vf.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Vf.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();return this._subscriptions.removeAll(),ue(this)};Vf._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,o=i.id;!l(t.get(o))&&!l(n.get(o))&&n.set(o,i)};Vf.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(o.set(a,c),r.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,o.remove(a)?r.set(a,c):i.set(a,c)};var vP=Vf;function Bu(e){Pc.initializeTerrainHeights(),Tm.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new Er,this._eventHelper.add(n.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(n.dataSourceRemoved,this._onDataSourceRemoved,this),this._eventHelper.add(n.dataSourceMoved,this._onDataSourceMoved,this),this._eventHelper.add(t.postRender,this._postRender,this),this._dataSourceCollection=n,this._scene=t,this._visualizersCallback=g(e.visualizersCallback,Bu.defaultVisualizersCallback);let i=!1,o=new Fl,r=new Fl;n.length>0&&(t.primitives.add(o),t.groundPrimitives.add(r),i=!0),this._primitives=o,this._groundPrimitives=r;for(let d=0,u=n.length;d<u;d++)this._onDataSourceAdded(n,n.get(d));let s=new F2;this._onDataSourceAdded(void 0,s),this._defaultDataSource=s;let a,c;if(!i){let d=this,u=function(){t.primitives.add(o),t.groundPrimitives.add(r),a(),c(),d._removeDefaultDataSourceListener=void 0,d._removeDataSourceCollectionListener=void 0};a=s.entities.collectionChanged.addEventListener(u),c=n.dataSourceAdded.addEventListener(u)}this._removeDefaultDataSourceListener=a,this._removeDataSourceCollectionListener=c,this._ready=!1}Bu.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new LL(t,i),new CP(e,i,n._primitives,n._groundPrimitives),new VP(t,i),new LP(e,i),new S2(e,i),new EP(t,i),new ZP(e,i),new vP(e,i,n._primitives,n._groundPrimitives)]};Object.defineProperties(Bu.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}}});Bu.prototype.isDestroyed=function(){return!1};Bu.prototype.destroy=function(){this._eventHelper.removeAll();let e=this._dataSourceCollection;for(let t=0,n=e.length;t<n;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return this._onDataSourceRemoved(void 0,this._defaultDataSource),l(this._removeDefaultDataSourceListener)?(this._removeDefaultDataSourceListener(),this._removeDataSourceCollectionListener()):(this._scene.primitives.remove(this._primitives),this._scene.groundPrimitives.remove(this._groundPrimitives)),ue(this)};Bu.prototype.update=function(e){if(!hi.initialized)return this._ready=!1,!1;let t=!0,n,i,o,r,s=this._dataSourceCollection,a=s.length;for(n=0;n<a;n++){let c=s.get(n);for(l(c.update)&&(t=c.update(e)&&t),o=c._visualizers,r=o.length,i=0;i<r;i++)t=o[i].update(e)&&t}for(o=this._defaultDataSource._visualizers,r=o.length,i=0;i<r;i++)t=o[i].update(e)&&t;return this._ready=t,t};Bu.prototype._postRender=function(){let e=this._scene.frameState,t=this._dataSourceCollection,n=t.length;for(let i=0;i<n;i++){let o=t.get(i),r=o.credit;l(r)&&e.creditDisplay.addCreditToNextFrame(r);let s=o._resourceCredits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)e.creditDisplay.addCreditToNextFrame(s[c])}}};var R8e=[],Z8e=new ce;Bu.prototype.getBoundingSphere=function(e,t,n){if(!this._ready)return ut.PENDING;let i,o,r=this._defaultDataSource;if(!r.entities.contains(e)){r=void 0;let p=this._dataSourceCollection;for(o=p.length,i=0;i<o;i++){let y=p.get(i);if(y.entities.contains(e)){r=y;break}}}if(!l(r))return ut.FAILED;let s=R8e,a=Z8e,c=0,d=ut.DONE,u=r._visualizers,m=u.length;for(i=0;i<m;i++){let p=u[i];if(l(p.getBoundingSphere)){if(d=u[i].getBoundingSphere(e,a),!t&&d===ut.PENDING)return ut.PENDING;d===ut.DONE&&(s[c]=ce.clone(a,s[c]),c++)}}return c===0?ut.FAILED:(s.length=c,ce.fromBoundingSpheres(s,n),ut.DONE)};Bu.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,o=this._groundPrimitives,r=i.add(new Fl),s=o.add(new j2);t._primitives=r,t._groundPrimitives=s;let a=t.clustering;a._initialize(n),r.add(a),t._visualizers=this._visualizersCallback(n,a,t)};Bu.prototype._onDataSourceRemoved=function(e,t){let n=this._primitives,i=this._groundPrimitives,o=t._primitives,r=t._groundPrimitives,s=t.clustering;o.remove(s);let a=t._visualizers,c=a.length;for(let d=0;d<c;d++)a[d].destroy();n.remove(o),i.remove(r),t._visualizers=void 0};Bu.prototype._onDataSourceMoved=function(e,t,n){let i=this._primitives,o=this._groundPrimitives,r=e._primitives,s=e._groundPrimitives;t===n+1?(i.raise(r),o.raise(s)):t===n-1?(i.lower(r),o.lower(s)):t===0?(i.lowerToBottom(r),o.lowerToBottom(s),i.raise(r),o.raise(s)):(i.raiseToTop(r),o.raiseToTop(s))};var wP=Bu;var iii=T(S(),1);var Oni=T(S(),1);function Tz(e,t,n){this.heading=g(e,0),this.pitch=g(t,0),this.range=g(n,0)}Tz.clone=function(e,t){if(l(e))return l(t)||(t=new Tz),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var Ou=Tz;var ome=new q,rme=new q,sme=new q,G8e=new A,oU=new h,ame=new h,Sz=new h,Cz=new h,cme=new h,lme=new h,K1=new te,E8e=1.25;function I8e(e,t,n,i,o,r,s){let a=e.scene.mode,c=o.getValue(r,e._lastCartesian);if(l(c)){let d=!1,u=!1,m,p,y;if(a===ie.SCENE3D){te.addSeconds(r,.001,K1);let V=o.getValue(K1,oU);if(l(V)||(te.addSeconds(r,-.001,K1),V=o.getValue(K1,oU),u=!0),l(V)){let L=Xt.computeFixedToIcrfMatrix(r,ome),Z=Xt.computeFixedToIcrfMatrix(K1,rme),G;!l(L)||!l(Z)?(G=Xt.computeTemeToPseudoFixedMatrix(r,sme),L=q.transpose(G,ome),Z=Xt.computeTemeToPseudoFixedMatrix(K1,rme),q.transpose(Z,Z)):G=q.transpose(L,sme);let I=q.multiplyByVector(L,c,cme),P=q.multiplyByVector(Z,V,lme);h.subtract(I,P,Cz);let v=h.magnitude(Cz)*1e3,F=W.GRAVITATIONALPARAMETER,M=-F/(v*v-2*F/h.magnitude(I));M<0||M>E8e*s.maximumRadius?(m=ame,h.normalize(c,m),h.negate(m,m),y=h.clone(h.UNIT_Z,Sz),p=h.cross(y,m,oU),h.magnitude(p)>W.EPSILON7&&(h.normalize(m,m),h.normalize(p,p),y=h.cross(m,p,Sz),h.normalize(y,y),d=!0)):h.equalsEpsilon(c,V,W.EPSILON7)||(y=ame,h.normalize(I,y),h.normalize(P,P),p=h.cross(y,P,Sz),u&&(p=h.multiplyByScalar(p,-1,p)),h.equalsEpsilon(p,h.ZERO,W.EPSILON7)||(m=h.cross(p,y,oU),q.multiplyByVector(G,m,m),q.multiplyByVector(G,p,p),q.multiplyByVector(G,y,y),h.normalize(m,m),h.normalize(p,p),h.normalize(y,y),d=!0))}}l(e.boundingSphere)&&(c=e.boundingSphere.center);let f,x,_;i&&(f=h.clone(t.position,Cz),x=h.clone(t.direction,cme),_=h.clone(t.up,lme));let C=G8e;d?(C[0]=m.x,C[1]=m.y,C[2]=m.z,C[3]=0,C[4]=p.x,C[5]=p.y,C[6]=p.z,C[7]=0,C[8]=y.x,C[9]=y.y,C[10]=y.z,C[11]=0,C[12]=c.x,C[13]=c.y,C[14]=c.z,C[15]=0):Xt.eastNorthUpToFixedFrame(c,s,C),t._setTransform(C),i&&(h.clone(f,t.position),h.clone(x,t.direction),h.clone(_,t.up),h.cross(x,_,t.right))}if(n){let d=a===ie.SCENE2D||h.equals(e._offset3D,h.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,d)}}function FP(e,t,n){this.entity=e,this.scene=t,this.ellipsoid=g(n,oe.WGS84),this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new h,this._defaultOffset3D=void 0,this._offset3D=new h}Object.defineProperties(FP,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=h.clone(e,new h)}}});FP.defaultOffset3D=new h(-14e3,3500,3500);var rU=new Ou,X8e=new h;FP.prototype.update=function(e,t){let n=this.scene,i=this.ellipsoid,o=n.mode;if(o===ie.MORPHING)return;let r=this.entity,s=r.position;if(!l(s))return;let a=r!==this._lastEntity,c=o!==this._mode,d=n.camera,u=a||c,m=!0;if(a){let p=r.viewFrom,y=l(p);if(!y&&l(t)){rU.pitch=-W.PI_OVER_FOUR,rU.range=0;let f=s.getValue(e,X8e);if(l(f)){let x=2-1/Math.max(1,h.magnitude(f)/i.maximumRadius);rU.pitch*=x}d.viewBoundingSphere(t,rU),this.boundingSphere=t,u=!1,m=!1}else(!y||!l(p.getValue(e,this._offset3D)))&&h.clone(FP._defaultOffset3D,this._offset3D)}else!c&&this._mode!==ie.SCENE2D&&h.clone(d.position,this._offset3D);this._lastEntity=r,this._mode=o,I8e(this,d,u,m,s,e,i)};var AP=FP;var Lri=T(S(),1);var Hoi=T(S(),1);var rii=T(S(),1);function mU(e){return hU(e.map(([t,n])=>new Array(t).fill(n,0,t)))}function hU(e){return e.reduce((t,n)=>t.concat(Array.isArray(n)?hU(n):n),[])}var dme=[0,1,2,3].concat(...mU([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function ur(){let e=this;function t(o){let r=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,d=e.stat_desc.max_length,u,m,p,y,f,x,_=0;for(y=0;y<=15;y++)o.bl_count[y]=0;for(r[o.heap[o.heap_max]*2+1]=0,u=o.heap_max+1;u<573;u++)m=o.heap[u],y=r[r[m*2+1]*2+1]+1,y>d&&(y=d,_++),r[m*2+1]=y,!(m>e.max_code)&&(o.bl_count[y]++,f=0,m>=c&&(f=a[m-c]),x=r[m*2],o.opt_len+=x*(y+f),s&&(o.static_len+=x*(s[m*2+1]+f)));if(_!==0){do{for(y=d-1;o.bl_count[y]===0;)y--;o.bl_count[y]--,o.bl_count[y+1]+=2,o.bl_count[d]--,_-=2}while(_>0);for(y=d;y!==0;y--)for(m=o.bl_count[y];m!==0;)p=o.heap[--u],!(p>e.max_code)&&(r[p*2+1]!=y&&(o.opt_len+=(y-r[p*2+1])*r[p*2],r[p*2+1]=y),m--)}}function n(o,r){let s=0;do s|=o&1,o>>>=1,s<<=1;while(--r>0);return s>>>1}function i(o,r,s){let a=[],c=0,d,u,m;for(d=1;d<=15;d++)a[d]=c=c+s[d-1]<<1;for(u=0;u<=r;u++)m=o[u*2+1],m!==0&&(o[u*2]=n(a[m]++,m))}e.build_tree=function(o){let r=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.elems,c,d,u=-1,m;for(o.heap_len=0,o.heap_max=573,c=0;c<a;c++)r[c*2]!==0?(o.heap[++o.heap_len]=u=c,o.depth[c]=0):r[c*2+1]=0;for(;o.heap_len<2;)m=o.heap[++o.heap_len]=u<2?++u:0,r[m*2]=1,o.depth[m]=0,o.opt_len--,s&&(o.static_len-=s[m*2+1]);for(e.max_code=u,c=Math.floor(o.heap_len/2);c>=1;c--)o.pqdownheap(r,c);m=a;do c=o.heap[1],o.heap[1]=o.heap[o.heap_len--],o.pqdownheap(r,1),d=o.heap[1],o.heap[--o.heap_max]=c,o.heap[--o.heap_max]=d,r[m*2]=r[c*2]+r[d*2],o.depth[m]=Math.max(o.depth[c],o.depth[d])+1,r[c*2+1]=r[d*2+1]=m,o.heap[1]=m++,o.pqdownheap(r,1);while(o.heap_len>=2);o.heap[--o.heap_max]=o.heap[1],t(o),i(r,e.max_code,o.bl_count)}}ur._length_code=[0,1,2,3,4,5,6,7].concat(...mU([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]]));ur.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0];ur.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576];ur.d_code=function(e){return e<256?dme[e]:dme[256+(e>>>7)]};ur.extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];ur.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];ur.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];ur.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function Ia(e,t,n,i,o){let r=this;r.static_tree=e,r.extra_bits=t,r.extra_base=n,r.elems=i,r.max_length=o}var W8e=[12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227],P8e=mU([[144,8],[112,9],[24,7],[8,8]]);Ia.static_ltree=hU(W8e.map((e,t)=>[e,P8e[t]]));var v8e=[0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23],w8e=mU([[30,5]]);Ia.static_dtree=hU(v8e.map((e,t)=>[e,w8e[t]]));Ia.static_l_desc=new Ia(Ia.static_ltree,ur.extra_lbits,257,286,15);Ia.static_d_desc=new Ia(Ia.static_dtree,ur.extra_dbits,0,30,15);Ia.static_bl_desc=new Ia(null,ur.extra_blbits,0,19,7);var F8e=9,A8e=8;function Lf(e,t,n,i,o){let r=this;r.good_length=e,r.max_lazy=t,r.nice_length=n,r.max_chain=i,r.func=o}var mme=0,dU=1,$_=2,uh=[new Lf(0,0,0,0,mme),new Lf(4,4,8,4,dU),new Lf(4,5,16,8,dU),new Lf(4,6,32,32,dU),new Lf(4,4,16,16,$_),new Lf(8,16,32,32,$_),new Lf(8,16,128,128,$_),new Lf(8,32,128,256,$_),new Lf(32,128,258,1024,$_),new Lf(32,258,258,4096,$_)],sU=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],Yu=0,aU=1,MP=2,cU=3,M8e=32,Vz=42,lU=113,NP=666,Lz=8,N8e=0,Rz=1,U8e=2,Tr=3,uU=258,Ld=uU+Tr+1;function ume(e,t,n,i){let o=e[t*2],r=e[n*2];return o<r||o==r&&i[t]<=i[n]}function k8e(){let e=this,t,n,i,o,r,s,a,c,d,u,m,p,y,f,x,_,C,V,L,Z,G,I,P,v,F,M,b,R,E,X,w,N,D,k=new ur,Y=new ur,U=new ur;e.depth=[];let J,K,ee,H,j,$;e.bl_count=[],e.heap=[],w=[],N=[],D=[];function pe(){d=2*r,m[y-1]=0;for(let Fe=0;Fe<y-1;Fe++)m[Fe]=0;M=uh[b].max_lazy,E=uh[b].good_length,X=uh[b].nice_length,F=uh[b].max_chain,G=0,C=0,P=0,V=v=Tr-1,Z=0,p=0}function ge(){let Fe;for(Fe=0;Fe<286;Fe++)w[Fe*2]=0;for(Fe=0;Fe<30;Fe++)N[Fe*2]=0;for(Fe=0;Fe<19;Fe++)D[Fe*2]=0;w[256*2]=1,e.opt_len=e.static_len=0,K=ee=0}function ae(){k.dyn_tree=w,k.stat_desc=Ia.static_l_desc,Y.dyn_tree=N,Y.stat_desc=Ia.static_d_desc,U.dyn_tree=D,U.stat_desc=Ia.static_bl_desc,j=0,$=0,H=8,ge()}e.pqdownheap=function(Fe,rt){let qe=e.heap,Ye=qe[rt],ht=rt<<1;for(;ht<=e.heap_len&&(ht<e.heap_len&&ume(Fe,qe[ht+1],qe[ht],e.depth)&&ht++,!ume(Fe,Ye,qe[ht],e.depth));)qe[rt]=qe[ht],rt=ht,ht<<=1;qe[rt]=Ye};function be(Fe,rt){let qe=-1,Ye,ht=Fe[0*2+1],Dt=0,fn=7,jn=4;ht===0&&(fn=138,jn=3),Fe[(rt+1)*2+1]=65535;for(let ki=0;ki<=rt;ki++)Ye=ht,ht=Fe[(ki+1)*2+1],!(++Dt<fn&&Ye==ht)&&(Dt<jn?D[Ye*2]+=Dt:Ye!==0?(Ye!=qe&&D[Ye*2]++,D[16*2]++):Dt<=10?D[17*2]++:D[18*2]++,Dt=0,qe=Ye,ht===0?(fn=138,jn=3):Ye==ht?(fn=6,jn=3):(fn=7,jn=4))}function _e(){let Fe;for(be(w,k.max_code),be(N,Y.max_code),U.build_tree(e),Fe=18;Fe>=3&&D[ur.bl_order[Fe]*2+1]===0;Fe--);return e.opt_len+=3*(Fe+1)+5+5+4,Fe}function Ze(Fe){e.pending_buf[e.pending++]=Fe}function Le(Fe){Ze(Fe&255),Ze(Fe>>>8&255)}function Ee(Fe){Ze(Fe>>8&255),Ze(Fe&255&255)}function He(Fe,rt){let qe,Ye=rt;$>16-Ye?(qe=Fe,j|=qe<<$&65535,Le(j),j=qe>>>16-$,$+=Ye-16):(j|=Fe<<$&65535,$+=Ye)}function we(Fe,rt){let qe=Fe*2;He(rt[qe]&65535,rt[qe+1]&65535)}function dt(Fe,rt){let qe,Ye=-1,ht,Dt=Fe[0*2+1],fn=0,jn=7,ki=4;for(Dt===0&&(jn=138,ki=3),qe=0;qe<=rt;qe++)if(ht=Dt,Dt=Fe[(qe+1)*2+1],!(++fn<jn&&ht==Dt)){if(fn<ki)do we(ht,D);while(--fn!==0);else ht!==0?(ht!=Ye&&(we(ht,D),fn--),we(16,D),He(fn-3,2)):fn<=10?(we(17,D),He(fn-3,3)):(we(18,D),He(fn-11,7));fn=0,Ye=ht,Dt===0?(jn=138,ki=3):ht==Dt?(jn=6,ki=3):(jn=7,ki=4)}}function bt(Fe,rt,qe){let Ye;for(He(Fe-257,5),He(rt-1,5),He(qe-4,4),Ye=0;Ye<qe;Ye++)He(D[ur.bl_order[Ye]*2+1],3);dt(w,Fe-1),dt(N,rt-1)}function it(){$==16?(Le(j),j=0,$=0):$>=8&&(Ze(j&255),j>>>=8,$-=8)}function en(){He(Rz<<1,3),we(256,Ia.static_ltree),it(),1+H+10-$<9&&(He(Rz<<1,3),we(256,Ia.static_ltree),it()),H=7}function _n(Fe,rt){let qe,Ye,ht;if(e.dist_buf[K]=Fe,e.lc_buf[K]=rt&255,K++,Fe===0?w[rt*2]++:(ee++,Fe--,w[(ur._length_code[rt]+256+1)*2]++,N[ur.d_code(Fe)*2]++),!(K&8191)&&b>2){for(qe=K*8,Ye=G-C,ht=0;ht<30;ht++)qe+=N[ht*2]*(5+ur.extra_dbits[ht]);if(qe>>>=3,ee<Math.floor(K/2)&&qe<Math.floor(Ye/2))return!0}return K==J-1}function kt(Fe,rt){let qe,Ye,ht=0,Dt,fn;if(K!==0)do qe=e.dist_buf[ht],Ye=e.lc_buf[ht],ht++,qe===0?we(Ye,Fe):(Dt=ur._length_code[Ye],we(Dt+256+1,Fe),fn=ur.extra_lbits[Dt],fn!==0&&(Ye-=ur.base_length[Dt],He(Ye,fn)),qe--,Dt=ur.d_code(qe),we(Dt,rt),fn=ur.extra_dbits[Dt],fn!==0&&(qe-=ur.base_dist[Dt],He(qe,fn)));while(ht<K);we(256,Fe),H=Fe[256*2+1]}function At(){$>8?Le(j):$>0&&Ze(j&255),j=0,$=0}function Te(Fe,rt,qe){At(),H=8,qe&&(Le(rt),Le(~rt)),e.pending_buf.set(c.subarray(Fe,Fe+rt),e.pending),e.pending+=rt}function Re(Fe,rt,qe){He((N8e<<1)+(qe?1:0),3),Te(Fe,rt,!0)}function ct(Fe,rt,qe){let Ye,ht,Dt=0;b>0?(k.build_tree(e),Y.build_tree(e),Dt=_e(),Ye=e.opt_len+3+7>>>3,ht=e.static_len+3+7>>>3,ht<=Ye&&(Ye=ht)):Ye=ht=rt+5,rt+4<=Ye&&Fe!=-1?Re(Fe,rt,qe):ht==Ye?(He((Rz<<1)+(qe?1:0),3),kt(Ia.static_ltree,Ia.static_dtree)):(He((U8e<<1)+(qe?1:0),3),bt(k.max_code+1,Y.max_code+1,Dt+1),kt(w,N)),ge(),qe&&At()}function Jt(Fe){ct(C>=0?C:-1,G-C,Fe),C=G,t.flush_pending()}function mi(){let Fe,rt,qe,Ye;do{if(Ye=d-P-G,Ye===0&&G===0&&P===0)Ye=r;else if(Ye==-1)Ye--;else if(G>=r+r-Ld){c.set(c.subarray(r,r+r),0),I-=r,G-=r,C-=r,Fe=y,qe=Fe;do rt=m[--qe]&65535,m[qe]=rt>=r?rt-r:0;while(--Fe!==0);Fe=r,qe=Fe;do rt=u[--qe]&65535,u[qe]=rt>=r?rt-r:0;while(--Fe!==0);Ye+=r}if(t.avail_in===0)return;Fe=t.read_buf(c,G+P,Ye),P+=Fe,P>=Tr&&(p=c[G]&255,p=(p<<_^c[G+1]&255)&x)}while(P<Ld&&t.avail_in!==0)}function Ke(Fe){let rt=65535,qe;for(rt>i-5&&(rt=i-5);;){if(P<=1){if(mi(),P===0&&Fe==0)return Yu;if(P===0)break}if(G+=P,P=0,qe=C+rt,(G===0||G>=qe)&&(P=G-qe,G=qe,Jt(!1),t.avail_out===0)||G-C>=r-Ld&&(Jt(!1),t.avail_out===0))return Yu}return Jt(Fe==4),t.avail_out===0?Fe==4?MP:Yu:Fe==4?cU:aU}function $r(Fe){let rt=F,qe=G,Ye,ht,Dt=v,fn=G>r-Ld?G-(r-Ld):0,jn=X,ki=a,Lo=G+uU,Is=c[qe+Dt-1],fr=c[qe+Dt];v>=E&&(rt>>=2),jn>P&&(jn=P);do if(Ye=Fe,!(c[Ye+Dt]!=fr||c[Ye+Dt-1]!=Is||c[Ye]!=c[qe]||c[++Ye]!=c[qe+1])){qe+=2,Ye++;do;while(c[++qe]==c[++Ye]&&c[++qe]==c[++Ye]&&c[++qe]==c[++Ye]&&c[++qe]==c[++Ye]&&c[++qe]==c[++Ye]&&c[++qe]==c[++Ye]&&c[++qe]==c[++Ye]&&c[++qe]==c[++Ye]&&qe<Lo);if(ht=uU-(Lo-qe),qe=Lo-uU,ht>Dt){if(I=Fe,Dt=ht,ht>=jn)break;Is=c[qe+Dt-1],fr=c[qe+Dt]}}while((Fe=u[Fe&ki]&65535)>fn&&--rt!==0);return Dt<=P?Dt:P}function es(Fe){let rt=0,qe;for(;;){if(P<Ld){if(mi(),P<Ld&&Fe==0)return Yu;if(P===0)break}if(P>=Tr&&(p=(p<<_^c[G+(Tr-1)]&255)&x,rt=m[p]&65535,u[G&a]=m[p],m[p]=G),rt!==0&&(G-rt&65535)<=r-Ld&&R!=2&&(V=$r(rt)),V>=Tr)if(qe=_n(G-I,V-Tr),P-=V,V<=M&&P>=Tr){V--;do G++,p=(p<<_^c[G+(Tr-1)]&255)&x,rt=m[p]&65535,u[G&a]=m[p],m[p]=G;while(--V!==0);G++}else G+=V,V=0,p=c[G]&255,p=(p<<_^c[G+1]&255)&x;else qe=_n(0,c[G]&255),P--,G++;if(qe&&(Jt(!1),t.avail_out===0))return Yu}return Jt(Fe==4),t.avail_out===0?Fe==4?MP:Yu:Fe==4?cU:aU}function ga(Fe){let rt=0,qe,Ye;for(;;){if(P<Ld){if(mi(),P<Ld&&Fe==0)return Yu;if(P===0)break}if(P>=Tr&&(p=(p<<_^c[G+(Tr-1)]&255)&x,rt=m[p]&65535,u[G&a]=m[p],m[p]=G),v=V,L=I,V=Tr-1,rt!==0&&v<M&&(G-rt&65535)<=r-Ld&&(R!=2&&(V=$r(rt)),V<=5&&(R==1||V==Tr&&G-I>4096)&&(V=Tr-1)),v>=Tr&&V<=v){Ye=G+P-Tr,qe=_n(G-1-L,v-Tr),P-=v-1,v-=2;do++G<=Ye&&(p=(p<<_^c[G+(Tr-1)]&255)&x,rt=m[p]&65535,u[G&a]=m[p],m[p]=G);while(--v!==0);if(Z=0,V=Tr-1,G++,qe&&(Jt(!1),t.avail_out===0))return Yu}else if(Z!==0){if(qe=_n(0,c[G-1]&255),qe&&Jt(!1),G++,P--,t.avail_out===0)return Yu}else Z=1,G++,P--}return Z!==0&&(qe=_n(0,c[G-1]&255),Z=0),Jt(Fe==4),t.avail_out===0?Fe==4?MP:Yu:Fe==4?cU:aU}function ms(Fe){return Fe.total_in=Fe.total_out=0,Fe.msg=null,e.pending=0,e.pending_out=0,n=lU,o=0,ae(),pe(),0}e.deflateInit=function(Fe,rt,qe,Ye,ht,Dt){return Ye||(Ye=Lz),ht||(ht=A8e),Dt||(Dt=0),Fe.msg=null,rt==-1&&(rt=6),ht<1||ht>F8e||Ye!=Lz||qe<9||qe>15||rt<0||rt>9||Dt<0||Dt>2?-2:(Fe.dstate=e,s=qe,r=1<<s,a=r-1,f=ht+7,y=1<<f,x=y-1,_=Math.floor((f+Tr-1)/Tr),c=new Uint8Array(r*2),u=[],m=[],J=1<<ht+6,e.pending_buf=new Uint8Array(J*4),i=J*4,e.dist_buf=new Uint16Array(J),e.lc_buf=new Uint8Array(J),b=rt,R=Dt,ms(Fe))},e.deflateEnd=function(){return n!=Vz&&n!=lU&&n!=NP?-2:(e.lc_buf=null,e.dist_buf=null,e.pending_buf=null,m=null,u=null,c=null,e.dstate=null,n==lU?-3:0)},e.deflateParams=function(Fe,rt,qe){let Ye=0;return rt==-1&&(rt=6),rt<0||rt>9||qe<0||qe>2?-2:(uh[b].func!=uh[rt].func&&Fe.total_in!==0&&(Ye=Fe.deflate(1)),b!=rt&&(b=rt,M=uh[b].max_lazy,E=uh[b].good_length,X=uh[b].nice_length,F=uh[b].max_chain),R=qe,Ye)},e.deflateSetDictionary=function(Fe,rt,qe){let Ye=qe,ht,Dt=0;if(!rt||n!=Vz)return-2;if(Ye<Tr)return 0;for(Ye>r-Ld&&(Ye=r-Ld,Dt=qe-Ye),c.set(rt.subarray(Dt,Dt+Ye),0),G=Ye,C=Ye,p=c[0]&255,p=(p<<_^c[1]&255)&x,ht=0;ht<=Ye-Tr;ht++)p=(p<<_^c[ht+(Tr-1)]&255)&x,u[ht&a]=m[p],m[p]=ht;return 0},e.deflate=function(Fe,rt){let qe,Ye,ht,Dt,fn;if(rt>4||rt<0)return-2;if(!Fe.next_out||!Fe.next_in&&Fe.avail_in!==0||n==NP&&rt!=4)return Fe.msg=sU[4],-2;if(Fe.avail_out===0)return Fe.msg=sU[7],-5;if(t=Fe,Dt=o,o=rt,n==Vz&&(Ye=Lz+(s-8<<4)<<8,ht=(b-1&255)>>1,ht>3&&(ht=3),Ye|=ht<<6,G!==0&&(Ye|=M8e),Ye+=31-Ye%31,n=lU,Ee(Ye)),e.pending!==0){if(t.flush_pending(),t.avail_out===0)return o=-1,0}else if(t.avail_in===0&&rt<=Dt&&rt!=4)return t.msg=sU[7],-5;if(n==NP&&t.avail_in!==0)return Fe.msg=sU[7],-5;if(t.avail_in!==0||P!==0||rt!=0&&n!=NP){switch(fn=-1,uh[b].func){case mme:fn=Ke(rt);break;case dU:fn=es(rt);break;case $_:fn=ga(rt);break;default:}if((fn==MP||fn==cU)&&(n=NP),fn==Yu||fn==MP)return t.avail_out===0&&(o=-1),0;if(fn==aU){if(rt==1)en();else if(Re(0,0,!1),rt==3)for(qe=0;qe<y;qe++)m[qe]=0;if(t.flush_pending(),t.avail_out===0)return o=-1,0}}return rt!=4?0:1}}function hme(){let e=this;e.next_in_index=0,e.next_out_index=0,e.avail_in=0,e.total_in=0,e.avail_out=0,e.total_out=0}hme.prototype={deflateInit(e,t){let n=this;return n.dstate=new k8e,t||(t=15),n.dstate.deflateInit(n,e,t)},deflate(e){let t=this;return t.dstate?t.dstate.deflate(t,e):-2},deflateEnd(){let e=this;if(!e.dstate)return-2;let t=e.dstate.deflateEnd();return e.dstate=null,t},deflateParams(e,t){let n=this;return n.dstate?n.dstate.deflateParams(n,e,t):-2},deflateSetDictionary(e,t){let n=this;return n.dstate?n.dstate.deflateSetDictionary(n,e,t):-2},read_buf(e,t,n){let i=this,o=i.avail_in;return o>n&&(o=n),o===0?0:(i.avail_in-=o,e.set(i.next_in.subarray(i.next_in_index,i.next_in_index+o),t),i.next_in_index+=o,i.total_in+=o,o)},flush_pending(){let e=this,t=e.dstate.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.next_out.set(e.dstate.pending_buf.subarray(e.dstate.pending_out,e.dstate.pending_out+t),e.next_out_index),e.next_out_index+=t,e.dstate.pending_out+=t,e.total_out+=t,e.avail_out-=t,e.dstate.pending-=t,e.dstate.pending===0&&(e.dstate.pending_out=0))}};function fme(e){let t=this,n=new hme,i=D8e(e&&e.chunkSize?e.chunkSize:64*1024),o=0,r=new Uint8Array(i),s=e?e.level:-1;typeof s>"u"&&(s=-1),n.deflateInit(s),n.next_out=r,t.append=function(a,c){let d,u,m=0,p=0,y=0,f=[];if(a.length){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=i,d=n.deflate(o),d!=0)throw new Error("deflating: "+n.msg);n.next_out_index&&(n.next_out_index==i?f.push(new Uint8Array(r)):f.push(r.subarray(0,n.next_out_index))),y+=n.next_out_index,c&&n.next_in_index>0&&n.next_in_index!=m&&(c(n.next_in_index),m=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return f.length>1?(u=new Uint8Array(y),f.forEach(function(x){u.set(x,p),p+=x.length})):u=f[0]?new Uint8Array(f[0]):new Uint8Array,u}},t.flush=function(){let a,c,d=0,u=0,m=[];do{if(n.next_out_index=0,n.avail_out=i,a=n.deflate(4),a!=1&&a!=0)throw new Error("deflating: "+n.msg);i-n.avail_out>0&&m.push(r.slice(0,n.next_out_index)),u+=n.next_out_index}while(n.avail_in>0||n.avail_out===0);return n.deflateEnd(),c=new Uint8Array(u),m.forEach(function(p){c.set(p,d),d+=p.length}),c}}function D8e(e){return e+5*(Math.floor(e/16383)+1)}var aii=T(S(),1);var Rd=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],vme=1440,B8e=0,O8e=4,Y8e=9,H8e=5,K8e=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],z8e=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],J8e=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],Q8e=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],j8e=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],q8e=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Ny=15;function Iz(){let e=this,t,n,i,o,r,s;function a(d,u,m,p,y,f,x,_,C,V,L){let Z,G,I,P,v,F,M,b,R,E,X,w,N,D,k;E=0,v=m;do i[d[u+E]]++,E++,v--;while(v!==0);if(i[0]==m)return x[0]=-1,_[0]=0,0;for(b=_[0],F=1;F<=Ny&&i[F]===0;F++);for(M=F,b<F&&(b=F),v=Ny;v!==0&&i[v]===0;v--);for(I=v,b>v&&(b=v),_[0]=b,D=1<<F;F<v;F++,D<<=1)if((D-=i[F])<0)return-3;if((D-=i[v])<0)return-3;for(i[v]+=D,s[1]=F=0,E=1,N=2;--v!==0;)s[N]=F+=i[E],N++,E++;v=0,E=0;do(F=d[u+E])!==0&&(L[s[F]++]=v),E++;while(++v<m);for(m=s[I],s[0]=v=0,E=0,P=-1,w=-b,r[0]=0,X=0,k=0;M<=I;M++)for(Z=i[M];Z--!==0;){for(;M>w+b;){if(P++,w+=b,k=I-w,k=k>b?b:k,(G=1<<(F=M-w))>Z+1&&(G-=Z+1,N=M,F<k))for(;++F<k&&!((G<<=1)<=i[++N]);)G-=i[N];if(k=1<<F,V[0]+k>vme)return-3;r[P]=X=V[0],V[0]+=k,P!==0?(s[P]=v,o[0]=F,o[1]=b,F=v>>>w-b,o[2]=X-r[P-1]-F,C.set(o,(r[P-1]+F)*3)):x[0]=X}for(o[1]=M-w,E>=m?o[0]=192:L[E]<p?(o[0]=L[E]<256?0:96,o[2]=L[E++]):(o[0]=f[L[E]-p]+16+64,o[2]=y[L[E++]-p]),G=1<<M-w,F=v>>>w;F<k;F+=G)C.set(o,(X+F)*3);for(F=1<<M-1;v&F;F>>>=1)v^=F;for(v^=F,R=(1<<w)-1;(v&R)!=s[P];)P--,w-=b,R=(1<<w)-1}return D!==0&&I!=1?-5:0}function c(d){let u;for(t||(t=[],n=[],i=new Int32Array(Ny+1),o=[],r=new Int32Array(Ny),s=new Int32Array(Ny+1)),n.length<d&&(n=[]),u=0;u<d;u++)n[u]=0;for(u=0;u<Ny+1;u++)i[u]=0;for(u=0;u<3;u++)o[u]=0;r.set(i.subarray(0,Ny),0),s.set(i.subarray(0,Ny+1),0)}e.inflate_trees_bits=function(d,u,m,p,y){let f;return c(19),t[0]=0,f=a(d,0,19,19,null,null,m,u,p,t,n),f==-3?y.msg="oversubscribed dynamic bit lengths tree":(f==-5||u[0]===0)&&(y.msg="incomplete dynamic bit lengths tree",f=-3),f},e.inflate_trees_dynamic=function(d,u,m,p,y,f,x,_,C){let V;return c(288),t[0]=0,V=a(m,0,d,257,J8e,Q8e,f,p,_,t,n),V!=0||p[0]===0?(V==-3?C.msg="oversubscribed literal/length tree":V!=-4&&(C.msg="incomplete literal/length tree",V=-3),V):(c(288),V=a(m,d,u,0,j8e,q8e,x,y,_,t,n),V!=0||y[0]===0&&d>257?(V==-3?C.msg="oversubscribed distance tree":V==-5?(C.msg="incomplete distance tree",V=-3):V!=-4&&(C.msg="empty distance tree with lengths",V=-3),V):0)}}Iz.inflate_trees_fixed=function(e,t,n,i){return e[0]=Y8e,t[0]=H8e,n[0]=K8e,i[0]=z8e,0};var fU=0,pme=1,bme=2,yme=3,gme=4,xme=5,_me=6,Zz=7,Tme=8,pU=9;function $8e(){let e=this,t,n=0,i,o=0,r=0,s=0,a=0,c=0,d=0,u=0,m,p=0,y,f=0;function x(_,C,V,L,Z,G,I,P){let v,F,M,b,R,E,X,w,N,D,k,Y,U,J,K,ee;X=P.next_in_index,w=P.avail_in,R=I.bitb,E=I.bitk,N=I.write,D=N<I.read?I.read-N-1:I.end-N,k=Rd[_],Y=Rd[C];do{for(;E<20;)w--,R|=(P.read_byte(X++)&255)<<E,E+=8;if(v=R&k,F=V,M=L,ee=(M+v)*3,(b=F[ee])===0){R>>=F[ee+1],E-=F[ee+1],I.win[N++]=F[ee+2],D--;continue}do{if(R>>=F[ee+1],E-=F[ee+1],b&16){for(b&=15,U=F[ee+2]+(R&Rd[b]),R>>=b,E-=b;E<15;)w--,R|=(P.read_byte(X++)&255)<<E,E+=8;v=R&Y,F=Z,M=G,ee=(M+v)*3,b=F[ee];do if(R>>=F[ee+1],E-=F[ee+1],b&16){for(b&=15;E<b;)w--,R|=(P.read_byte(X++)&255)<<E,E+=8;if(J=F[ee+2]+(R&Rd[b]),R>>=b,E-=b,D-=U,N>=J)K=N-J,N-K>0&&2>N-K?(I.win[N++]=I.win[K++],I.win[N++]=I.win[K++],U-=2):(I.win.set(I.win.subarray(K,K+2),N),N+=2,K+=2,U-=2);else{K=N-J;do K+=I.end;while(K<0);if(b=I.end-K,U>b){if(U-=b,N-K>0&&b>N-K)do I.win[N++]=I.win[K++];while(--b!==0);else I.win.set(I.win.subarray(K,K+b),N),N+=b,K+=b,b=0;K=0}}if(N-K>0&&U>N-K)do I.win[N++]=I.win[K++];while(--U!==0);else I.win.set(I.win.subarray(K,K+U),N),N+=U,K+=U,U=0;break}else if(!(b&64))v+=F[ee+2],v+=R&Rd[b],ee=(M+v)*3,b=F[ee];else return P.msg="invalid distance code",U=P.avail_in-w,U=E>>3<U?E>>3:U,w+=U,X-=U,E-=U<<3,I.bitb=R,I.bitk=E,P.avail_in=w,P.total_in+=X-P.next_in_index,P.next_in_index=X,I.write=N,-3;while(!0);break}if(b&64)return b&32?(U=P.avail_in-w,U=E>>3<U?E>>3:U,w+=U,X-=U,E-=U<<3,I.bitb=R,I.bitk=E,P.avail_in=w,P.total_in+=X-P.next_in_index,P.next_in_index=X,I.write=N,1):(P.msg="invalid literal/length code",U=P.avail_in-w,U=E>>3<U?E>>3:U,w+=U,X-=U,E-=U<<3,I.bitb=R,I.bitk=E,P.avail_in=w,P.total_in+=X-P.next_in_index,P.next_in_index=X,I.write=N,-3);if(v+=F[ee+2],v+=R&Rd[b],ee=(M+v)*3,(b=F[ee])===0){R>>=F[ee+1],E-=F[ee+1],I.win[N++]=F[ee+2],D--;break}}while(!0)}while(D>=258&&w>=10);return U=P.avail_in-w,U=E>>3<U?E>>3:U,w+=U,X-=U,E-=U<<3,I.bitb=R,I.bitk=E,P.avail_in=w,P.total_in+=X-P.next_in_index,P.next_in_index=X,I.write=N,0}e.init=function(_,C,V,L,Z,G){t=fU,d=_,u=C,m=V,p=L,y=Z,f=G,i=null},e.proc=function(_,C,V){let L,Z,G,I=0,P=0,v=0,F,M,b,R;for(v=C.next_in_index,F=C.avail_in,I=_.bitb,P=_.bitk,M=_.write,b=M<_.read?_.read-M-1:_.end-M;;)switch(t){case fU:if(b>=258&&F>=10&&(_.bitb=I,_.bitk=P,C.avail_in=F,C.total_in+=v-C.next_in_index,C.next_in_index=v,_.write=M,V=x(d,u,m,p,y,f,_,C),v=C.next_in_index,F=C.avail_in,I=_.bitb,P=_.bitk,M=_.write,b=M<_.read?_.read-M-1:_.end-M,V!=0)){t=V==1?Zz:pU;break}r=d,i=m,o=p,t=pme;case pme:for(L=r;P<L;){if(F!==0)V=0;else return _.bitb=I,_.bitk=P,C.avail_in=F,C.total_in+=v-C.next_in_index,C.next_in_index=v,_.write=M,_.inflate_flush(C,V);F--,I|=(C.read_byte(v++)&255)<<P,P+=8}if(Z=(o+(I&Rd[L]))*3,I>>>=i[Z+1],P-=i[Z+1],G=i[Z],G===0){s=i[Z+2],t=_me;break}if(G&16){a=G&15,n=i[Z+2],t=bme;break}if(!(G&64)){r=G,o=Z/3+i[Z+2];break}if(G&32){t=Zz;break}return t=pU,C.msg="invalid literal/length code",V=-3,_.bitb=I,_.bitk=P,C.avail_in=F,C.total_in+=v-C.next_in_index,C.next_in_index=v,_.write=M,_.inflate_flush(C,V);case bme:for(L=a;P<L;){if(F!==0)V=0;else return _.bitb=I,_.bitk=P,C.avail_in=F,C.total_in+=v-C.next_in_index,C.next_in_index=v,_.write=M,_.inflate_flush(C,V);F--,I|=(C.read_byte(v++)&255)<<P,P+=8}n+=I&Rd[L],I>>=L,P-=L,r=u,i=y,o=f,t=yme;case yme:for(L=r;P<L;){if(F!==0)V=0;else return _.bitb=I,_.bitk=P,C.avail_in=F,C.total_in+=v-C.next_in_index,C.next_in_index=v,_.write=M,_.inflate_flush(C,V);F--,I|=(C.read_byte(v++)&255)<<P,P+=8}if(Z=(o+(I&Rd[L]))*3,I>>=i[Z+1],P-=i[Z+1],G=i[Z],G&16){a=G&15,c=i[Z+2],t=gme;break}if(!(G&64)){r=G,o=Z/3+i[Z+2];break}return t=pU,C.msg="invalid distance code",V=-3,_.bitb=I,_.bitk=P,C.avail_in=F,C.total_in+=v-C.next_in_index,C.next_in_index=v,_.write=M,_.inflate_flush(C,V);case gme:for(L=a;P<L;){if(F!==0)V=0;else return _.bitb=I,_.bitk=P,C.avail_in=F,C.total_in+=v-C.next_in_index,C.next_in_index=v,_.write=M,_.inflate_flush(C,V);F--,I|=(C.read_byte(v++)&255)<<P,P+=8}c+=I&Rd[L],I>>=L,P-=L,t=xme;case xme:for(R=M-c;R<0;)R+=_.end;for(;n!==0;){if(b===0&&(M==_.end&&_.read!==0&&(M=0,b=M<_.read?_.read-M-1:_.end-M),b===0&&(_.write=M,V=_.inflate_flush(C,V),M=_.write,b=M<_.read?_.read-M-1:_.end-M,M==_.end&&_.read!==0&&(M=0,b=M<_.read?_.read-M-1:_.end-M),b===0)))return _.bitb=I,_.bitk=P,C.avail_in=F,C.total_in+=v-C.next_in_index,C.next_in_index=v,_.write=M,_.inflate_flush(C,V);_.win[M++]=_.win[R++],b--,R==_.end&&(R=0),n--}t=fU;break;case _me:if(b===0&&(M==_.end&&_.read!==0&&(M=0,b=M<_.read?_.read-M-1:_.end-M),b===0&&(_.write=M,V=_.inflate_flush(C,V),M=_.write,b=M<_.read?_.read-M-1:_.end-M,M==_.end&&_.read!==0&&(M=0,b=M<_.read?_.read-M-1:_.end-M),b===0)))return _.bitb=I,_.bitk=P,C.avail_in=F,C.total_in+=v-C.next_in_index,C.next_in_index=v,_.write=M,_.inflate_flush(C,V);V=0,_.win[M++]=s,b--,t=fU;break;case Zz:if(P>7&&(P-=8,F++,v--),_.write=M,V=_.inflate_flush(C,V),M=_.write,b=M<_.read?_.read-M-1:_.end-M,_.read!=_.write)return _.bitb=I,_.bitk=P,C.avail_in=F,C.total_in+=v-C.next_in_index,C.next_in_index=v,_.write=M,_.inflate_flush(C,V);t=Tme;case Tme:return V=1,_.bitb=I,_.bitk=P,C.avail_in=F,C.total_in+=v-C.next_in_index,C.next_in_index=v,_.write=M,_.inflate_flush(C,V);case pU:return V=-3,_.bitb=I,_.bitk=P,C.avail_in=F,C.total_in+=v-C.next_in_index,C.next_in_index=v,_.write=M,_.inflate_flush(C,V);default:return V=-2,_.bitb=I,_.bitk=P,C.avail_in=F,C.total_in+=v-C.next_in_index,C.next_in_index=v,_.write=M,_.inflate_flush(C,V)}},e.free=function(){}}var Sme=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],z1=0,Gz=1,Cme=2,Vme=3,Lme=4,Rme=5,bU=6,yU=7,Zme=8,eT=9;function e7e(e,t){let n=this,i=z1,o=0,r=0,s=0,a,c=[0],d=[0],u=new $8e,m=0,p=new Int32Array(vme*3),y=0,f=new Iz;n.bitk=0,n.bitb=0,n.win=new Uint8Array(t),n.end=t,n.read=0,n.write=0,n.reset=function(x,_){_&&(_[0]=y),i==bU&&u.free(x),i=z1,n.bitk=0,n.bitb=0,n.read=n.write=0},n.reset(e,null),n.inflate_flush=function(x,_){let C,V,L;return V=x.next_out_index,L=n.read,C=(L<=n.write?n.write:n.end)-L,C>x.avail_out&&(C=x.avail_out),C!==0&&_==-5&&(_=0),x.avail_out-=C,x.total_out+=C,x.next_out.set(n.win.subarray(L,L+C),V),V+=C,L+=C,L==n.end&&(L=0,n.write==n.end&&(n.write=0),C=n.write-L,C>x.avail_out&&(C=x.avail_out),C!==0&&_==-5&&(_=0),x.avail_out-=C,x.total_out+=C,x.next_out.set(n.win.subarray(L,L+C),V),V+=C,L+=C),x.next_out_index=V,n.read=L,_},n.proc=function(x,_){let C,V,L,Z,G,I,P,v;for(Z=x.next_in_index,G=x.avail_in,V=n.bitb,L=n.bitk,I=n.write,P=I<n.read?n.read-I-1:n.end-I;;){let F,M,b,R,E,X,w,N;switch(i){case z1:for(;L<3;){if(G!==0)_=0;else return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);G--,V|=(x.read_byte(Z++)&255)<<L,L+=8}switch(C=V&7,m=C&1,C>>>1){case 0:V>>>=3,L-=3,C=L&7,V>>>=C,L-=C,i=Gz;break;case 1:F=[],M=[],b=[[]],R=[[]],Iz.inflate_trees_fixed(F,M,b,R),u.init(F[0],M[0],b[0],0,R[0],0),V>>>=3,L-=3,i=bU;break;case 2:V>>>=3,L-=3,i=Vme;break;case 3:return V>>>=3,L-=3,i=eT,x.msg="invalid block type",_=-3,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_)}break;case Gz:for(;L<32;){if(G!==0)_=0;else return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);G--,V|=(x.read_byte(Z++)&255)<<L,L+=8}if((~V>>>16&65535)!=(V&65535))return i=eT,x.msg="invalid stored block lengths",_=-3,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);o=V&65535,V=L=0,i=o!==0?Cme:m!==0?yU:z1;break;case Cme:if(G===0||P===0&&(I==n.end&&n.read!==0&&(I=0,P=I<n.read?n.read-I-1:n.end-I),P===0&&(n.write=I,_=n.inflate_flush(x,_),I=n.write,P=I<n.read?n.read-I-1:n.end-I,I==n.end&&n.read!==0&&(I=0,P=I<n.read?n.read-I-1:n.end-I),P===0)))return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);if(_=0,C=o,C>G&&(C=G),C>P&&(C=P),n.win.set(x.read_buf(Z,C),I),Z+=C,G-=C,I+=C,P-=C,(o-=C)!==0)break;i=m!==0?yU:z1;break;case Vme:for(;L<14;){if(G!==0)_=0;else return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);G--,V|=(x.read_byte(Z++)&255)<<L,L+=8}if(r=C=V&16383,(C&31)>29||(C>>5&31)>29)return i=eT,x.msg="too many length or distance symbols",_=-3,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);if(C=258+(C&31)+(C>>5&31),!a||a.length<C)a=[];else for(v=0;v<C;v++)a[v]=0;V>>>=14,L-=14,s=0,i=Lme;case Lme:for(;s<4+(r>>>10);){for(;L<3;){if(G!==0)_=0;else return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);G--,V|=(x.read_byte(Z++)&255)<<L,L+=8}a[Sme[s++]]=V&7,V>>>=3,L-=3}for(;s<19;)a[Sme[s++]]=0;if(c[0]=7,C=f.inflate_trees_bits(a,c,d,p,x),C!=0)return _=C,_==-3&&(a=null,i=eT),n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);s=0,i=Rme;case Rme:for(;C=r,!(s>=258+(C&31)+(C>>5&31));){let D,k;for(C=c[0];L<C;){if(G!==0)_=0;else return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);G--,V|=(x.read_byte(Z++)&255)<<L,L+=8}if(C=p[(d[0]+(V&Rd[C]))*3+1],k=p[(d[0]+(V&Rd[C]))*3+2],k<16)V>>>=C,L-=C,a[s++]=k;else{for(v=k==18?7:k-14,D=k==18?11:3;L<C+v;){if(G!==0)_=0;else return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);G--,V|=(x.read_byte(Z++)&255)<<L,L+=8}if(V>>>=C,L-=C,D+=V&Rd[v],V>>>=v,L-=v,v=s,C=r,v+D>258+(C&31)+(C>>5&31)||k==16&&v<1)return a=null,i=eT,x.msg="invalid bit length repeat",_=-3,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);k=k==16?a[v-1]:0;do a[v++]=k;while(--D!==0);s=v}}if(d[0]=-1,E=[],X=[],w=[],N=[],E[0]=9,X[0]=6,C=r,C=f.inflate_trees_dynamic(257+(C&31),1+(C>>5&31),a,E,X,w,N,p,x),C!=0)return C==-3&&(a=null,i=eT),_=C,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);u.init(E[0],X[0],p,w[0],p,N[0]),i=bU;case bU:if(n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,(_=u.proc(n,x,_))!=1)return n.inflate_flush(x,_);if(_=0,u.free(x),Z=x.next_in_index,G=x.avail_in,V=n.bitb,L=n.bitk,I=n.write,P=I<n.read?n.read-I-1:n.end-I,m===0){i=z1;break}i=yU;case yU:if(n.write=I,_=n.inflate_flush(x,_),I=n.write,P=I<n.read?n.read-I-1:n.end-I,n.read!=n.write)return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);i=Zme;case Zme:return _=1,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);case eT:return _=-3,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);default:return _=-2,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_)}}},n.free=function(x){n.reset(x,null),n.win=null,p=null},n.set_dictionary=function(x,_,C){n.win.set(x.subarray(_,_+C),0),n.read=n.write=C},n.sync_point=function(){return i==Gz?1:0}}var t7e=32,n7e=8,i7e=0,Gme=1,Eme=2,Ime=3,Xme=4,Wme=5,Ez=6,UP=7,Pme=12,Uy=13,o7e=[0,0,255,255];function r7e(){let e=this;e.mode=0,e.method=0,e.was=[0],e.need=0,e.marker=0,e.wbits=0;function t(n){return!n||!n.istate?-2:(n.total_in=n.total_out=0,n.msg=null,n.istate.mode=UP,n.istate.blocks.reset(n,null),0)}e.inflateEnd=function(n){return e.blocks&&e.blocks.free(n),e.blocks=null,0},e.inflateInit=function(n,i){return n.msg=null,e.blocks=null,i<8||i>15?(e.inflateEnd(n),-2):(e.wbits=i,n.istate.blocks=new e7e(n,1<<i),t(n),0)},e.inflate=function(n,i){let o,r;if(!n||!n.istate||!n.next_in)return-2;let s=n.istate;for(i=i==O8e?-5:0,o=-5;;)switch(s.mode){case i7e:if(n.avail_in===0)return o;if(o=i,n.avail_in--,n.total_in++,((s.method=n.read_byte(n.next_in_index++))&15)!=n7e){s.mode=Uy,n.msg="unknown compression method",s.marker=5;break}if((s.method>>4)+8>s.wbits){s.mode=Uy,n.msg="invalid win size",s.marker=5;break}s.mode=Gme;case Gme:if(n.avail_in===0)return o;if(o=i,n.avail_in--,n.total_in++,r=n.read_byte(n.next_in_index++)&255,((s.method<<8)+r)%31!==0){s.mode=Uy,n.msg="incorrect header check",s.marker=5;break}if(!(r&t7e)){s.mode=UP;break}s.mode=Eme;case Eme:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need=(n.read_byte(n.next_in_index++)&255)<<24&4278190080,s.mode=Ime;case Ime:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<16&16711680,s.mode=Xme;case Xme:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<8&65280,s.mode=Wme;case Wme:return n.avail_in===0?o:(o=i,n.avail_in--,n.total_in++,s.need+=n.read_byte(n.next_in_index++)&255,s.mode=Ez,2);case Ez:return s.mode=Uy,n.msg="need dictionary",s.marker=0,-2;case UP:if(o=s.blocks.proc(n,o),o==-3){s.mode=Uy,s.marker=0;break}if(o==0&&(o=i),o!=1)return o;o=i,s.blocks.reset(n,s.was),s.mode=Pme;case Pme:return n.avail_in=0,1;case Uy:return-3;default:return-2}},e.inflateSetDictionary=function(n,i,o){let r=0,s=o;if(!n||!n.istate||n.istate.mode!=Ez)return-2;let a=n.istate;return s>=1<<a.wbits&&(s=(1<<a.wbits)-1,r=o-s),a.blocks.set_dictionary(i,r,s),a.mode=UP,0},e.inflateSync=function(n){let i,o,r,s,a;if(!n||!n.istate)return-2;let c=n.istate;if(c.mode!=Uy&&(c.mode=Uy,c.marker=0),(i=n.avail_in)===0)return-5;for(o=n.next_in_index,r=c.marker;i!==0&&r<4;)n.read_byte(o)==o7e[r]?r++:n.read_byte(o)!==0?r=0:r=4-r,o++,i--;return n.total_in+=o-n.next_in_index,n.next_in_index=o,n.avail_in=i,c.marker=r,r!=4?-3:(s=n.total_in,a=n.total_out,t(n),n.total_in=s,n.total_out=a,c.mode=UP,0)},e.inflateSyncPoint=function(n){return!n||!n.istate||!n.istate.blocks?-2:n.istate.blocks.sync_point()}}function wme(){}wme.prototype={inflateInit(e){let t=this;return t.istate=new r7e,e||(e=15),t.istate.inflateInit(t,e)},inflate(e){let t=this;return t.istate?t.istate.inflate(t,e):-2},inflateEnd(){let e=this;if(!e.istate)return-2;let t=e.istate.inflateEnd(e);return e.istate=null,t},inflateSync(){let e=this;return e.istate?e.istate.inflateSync(e):-2},inflateSetDictionary(e,t){let n=this;return n.istate?n.istate.inflateSetDictionary(n,e,t):-2},read_byte(e){return this.next_in[e]},read_buf(e,t){return this.next_in.subarray(e,e+t)}};function Fme(e){let t=this,n=new wme,i=e&&e.chunkSize?Math.floor(e.chunkSize*2):128*1024,o=B8e,r=new Uint8Array(i),s=!1;n.inflateInit(),n.next_out=r,t.append=function(a,c){let d=[],u,m,p=0,y=0,f=0;if(a.length!==0){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=i,n.avail_in===0&&!s&&(n.next_in_index=0,s=!0),u=n.inflate(o),s&&u===-5){if(n.avail_in!==0)throw new Error("inflating: bad input")}else if(u!==0&&u!==1)throw new Error("inflating: "+n.msg);if((s||u===1)&&n.avail_in===a.length)throw new Error("inflating: bad input");n.next_out_index&&(n.next_out_index===i?d.push(new Uint8Array(r)):d.push(r.subarray(0,n.next_out_index))),f+=n.next_out_index,c&&n.next_in_index>0&&n.next_in_index!=p&&(c(n.next_in_index),p=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return d.length>1?(m=new Uint8Array(f),d.forEach(function(x){m.set(x,y),y+=x.length})):m=d[0]?new Uint8Array(d[0]):new Uint8Array,m}},t.flush=function(){n.inflateEnd()}}var bii=T(S(),1);var lii=T(S(),1);var J1="/",Xz=new Date(2107,11,31),Wz=new Date(1980,0,1),er=void 0,Zd="undefined",w0="function";var uii=T(S(),1);var kP=class{constructor(t){return class extends TransformStream{constructor(n,i){let o=new t(i);super({transform(r,s){s.enqueue(o.append(r))},flush(r){let s=o.flush();s&&r.enqueue(s)}})}}}};var s7e=64,Ame=2;try{typeof navigator!=Zd&&navigator.hardwareConcurrency&&(Ame=navigator.hardwareConcurrency)}catch{}var a7e={chunkSize:512*1024,maxWorkers:Ame,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,workerScripts:er,CompressionStreamNative:typeof CompressionStream!=Zd&&CompressionStream,DecompressionStreamNative:typeof DecompressionStream!=Zd&&DecompressionStream},Dy=Object.assign({},a7e);function DP(){return Dy}function gU(e){return Math.max(e.chunkSize,s7e)}function Q1(e){let{baseURL:t,chunkSize:n,maxWorkers:i,terminateWorkerTimeout:o,useCompressionStream:r,useWebWorkers:s,Deflate:a,Inflate:c,CompressionStream:d,DecompressionStream:u,workerScripts:m}=e;if(ky("baseURL",t),ky("chunkSize",n),ky("maxWorkers",i),ky("terminateWorkerTimeout",o),ky("useCompressionStream",r),ky("useWebWorkers",s),a&&(Dy.CompressionStream=new kP(a)),c&&(Dy.DecompressionStream=new kP(c)),ky("CompressionStream",d),ky("DecompressionStream",u),m!==er){let{deflate:p,inflate:y}=m;if((p||y)&&(Dy.workerScripts||(Dy.workerScripts={})),p){if(!Array.isArray(p))throw new Error("workerScripts.deflate must be an array");Dy.workerScripts.deflate=p}if(y){if(!Array.isArray(y))throw new Error("workerScripts.inflate must be an array");Dy.workerScripts.inflate=y}}}function ky(e,t){t!==er&&(Dy[e]=t)}var gii=T(S(),1);var doi=T(S(),1);var toi=T(S(),1);var qii=T(S(),1);var Cii=T(S(),1);var _ii=T(S(),1),Mme=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t&1?t=t>>>1^3988292384:t=t>>>1;Mme[e]=t}var F0=class{constructor(t){this.crc=t||-1}append(t){let n=this.crc|0;for(let i=0,o=t.length|0;i<o;i++)n=n>>>8^Mme[(n^t[i])&255];this.crc=n}get(){return~this.crc}};var BP=class extends TransformStream{constructor(){let t,n=new F0;super({transform(i,o){n.append(i),o.enqueue(i)},flush(){let i=new Uint8Array(4);new DataView(i.buffer).setUint32(0,n.get()),t.value=i}}),t=this}};var Dii=T(S(),1);var Rii=T(S(),1);function OP(e){if(typeof TextEncoder==Zd){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}else return new TextEncoder().encode(e)}var Gii=T(S(),1),jc={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=jc.getPartial(n);return i===32?e.concat(t):jc._shiftRight(t,i,n|0,e.slice(0,e.length-1))},bitLength(e){let t=e.length;if(t===0)return 0;let n=e[t-1];return(t-1)*32+jc.getPartial(n)},clamp(e,t){if(e.length*32<t)return e;e=e.slice(0,Math.ceil(t/32));let n=e.length;return t=t&31,n>0&&t&&(e[n-1]=jc.partial(t,e[n-1]&2147483648>>t-1,1)),e},partial(e,t,n){return e===32?t:(n?t|0:t<<32-e)+e*1099511627776},getPartial(e){return Math.round(e/1099511627776)||32},_shiftRight(e,t,n,i){for(i===void 0&&(i=[]);t>=32;t-=32)i.push(n),n=0;if(t===0)return i.concat(e);for(let s=0;s<e.length;s++)i.push(n|e[s]>>>t),n=e[s]<<32-t;let o=e.length?e[e.length-1]:0,r=jc.getPartial(o);return i.push(jc.partial(t+r&31,t+r>32?n:i.pop(),1)),i}},YP={bytes:{fromBits(e){let n=jc.bitLength(e)/8,i=new Uint8Array(n),o;for(let r=0;r<n;r++)r&3||(o=e[r/4]),i[r]=o>>>24,o<<=8;return i},toBits(e){let t=[],n,i=0;for(n=0;n<e.length;n++)i=i<<8|e[n],(n&3)===3&&(t.push(i),i=0);return n&3&&t.push(jc.partial(8*(n&3),i)),t}}},Nme={};Nme.sha1=class{constructor(e){let t=this;t.blockSize=512,t._init=[1732584193,4023233417,2562383102,271733878,3285377520],t._key=[1518500249,1859775393,2400959708,3395469782],e?(t._h=e._h.slice(0),t._buffer=e._buffer.slice(0),t._length=e._length):t.reset()}reset(){let e=this;return e._h=e._init.slice(0),e._buffer=[],e._length=0,e}update(e){let t=this;typeof e=="string"&&(e=YP.utf8String.toBits(e));let n=t._buffer=jc.concat(t._buffer,e),i=t._length,o=t._length=i+jc.bitLength(e);if(o>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");let r=new Uint32Array(n),s=0;for(let a=t.blockSize+i-(t.blockSize+i&t.blockSize-1);a<=o;a+=t.blockSize)t._block(r.subarray(16*s,16*(s+1))),s+=1;return n.splice(0,16*s),t}finalize(){let e=this,t=e._buffer,n=e._h;t=jc.concat(t,[jc.partial(1,1)]);for(let i=t.length+2;i&15;i++)t.push(0);for(t.push(Math.floor(e._length/4294967296)),t.push(e._length|0);t.length;)e._block(t.splice(0,16));return e.reset(),n}_f(e,t,n,i){if(e<=19)return t&n|~t&i;if(e<=39)return t^n^i;if(e<=59)return t&n|t&i|n&i;if(e<=79)return t^n^i}_S(e,t){return t<<e|t>>>32-e}_block(e){let t=this,n=t._h,i=Array(80);for(let d=0;d<16;d++)i[d]=e[d];let o=n[0],r=n[1],s=n[2],a=n[3],c=n[4];for(let d=0;d<=79;d++){d>=16&&(i[d]=t._S(1,i[d-3]^i[d-8]^i[d-14]^i[d-16]));let u=t._S(5,o)+t._f(d,r,s,a)+c+i[d]+t._key[Math.floor(d/20)]|0;c=a,a=s,s=t._S(30,r),r=o,o=u}n[0]=n[0]+o|0,n[1]=n[1]+r|0,n[2]=n[2]+s|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0}};var Pz={};Pz.aes=class{constructor(e){let t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();let n=t._tables[0][4],i=t._tables[1],o=e.length,r,s,a,c=1;if(o!==4&&o!==6&&o!==8)throw new Error("invalid aes key size");for(t._key=[s=e.slice(0),a=[]],r=o;r<4*o+28;r++){let d=s[r-1];(r%o===0||o===8&&r%o===4)&&(d=n[d>>>24]<<24^n[d>>16&255]<<16^n[d>>8&255]<<8^n[d&255],r%o===0&&(d=d<<8^d>>>24^c<<24,c=c<<1^(c>>7)*283)),s[r]=s[r-o]^d}for(let d=0;r;d++,r--){let u=s[d&3?r:r-4];r<=4||d<4?a[d]=u:a[d]=i[0][n[u>>>24]]^i[1][n[u>>16&255]]^i[2][n[u>>8&255]]^i[3][n[u&255]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){let e=this._tables[0],t=this._tables[1],n=e[4],i=t[4],o=[],r=[],s,a,c,d;for(let u=0;u<256;u++)r[(o[u]=u<<1^(u>>7)*283)^u]=u;for(let u=s=0;!n[u];u^=a||1,s=r[s]||1){let m=s^s<<1^s<<2^s<<3^s<<4;m=m>>8^m&255^99,n[u]=m,i[m]=u,d=o[c=o[a=o[u]]];let p=d*16843009^c*65537^a*257^u*16843008,y=o[m]*257^m*16843008;for(let f=0;f<4;f++)e[f][u]=y=y<<24^y>>>8,t[f][m]=p=p<<24^p>>>8}for(let u=0;u<5;u++)e[u]=e[u].slice(0),t[u]=t[u].slice(0)}_crypt(e,t){if(e.length!==4)throw new Error("invalid aes block size");let n=this._key[t],i=n.length/4-2,o=[0,0,0,0],r=this._tables[t],s=r[0],a=r[1],c=r[2],d=r[3],u=r[4],m=e[0]^n[0],p=e[t?3:1]^n[1],y=e[2]^n[2],f=e[t?1:3]^n[3],x=4,_,C,V;for(let L=0;L<i;L++)_=s[m>>>24]^a[p>>16&255]^c[y>>8&255]^d[f&255]^n[x],C=s[p>>>24]^a[y>>16&255]^c[f>>8&255]^d[m&255]^n[x+1],V=s[y>>>24]^a[f>>16&255]^c[m>>8&255]^d[p&255]^n[x+2],f=s[f>>>24]^a[m>>16&255]^c[p>>8&255]^d[y&255]^n[x+3],x+=4,m=_,p=C,y=V;for(let L=0;L<4;L++)o[t?3&-L:L]=u[m>>>24]<<24^u[p>>16&255]<<16^u[y>>8&255]<<8^u[f&255]^n[x++],_=m,m=p,p=y,y=f,f=_;return o}};var Ume={getRandomValues(e){let t=new Uint32Array(e.buffer),n=i=>{let o=987654321,r=4294967295;return function(){return o=36969*(o&65535)+(o>>16)&r,i=18e3*(i&65535)+(i>>16)&r,(((o<<16)+i&r)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let i=0,o;i<e.length;i+=4){let r=n((o||Math.random())*4294967296);o=r()*987654071,t[i/4]=r()*4294967296|0}return e}},vz={};vz.ctrGladman=class{constructor(e,t){this._prf=e,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(e){return this.calculate(this._prf,e,this._iv)}incWord(e){if((e>>24&255)===255){let t=e>>16&255,n=e>>8&255,i=e&255;t===255?(t=0,n===255?(n=0,i===255?i=0:++i):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=i}else e+=1<<24;return e}incCounter(e){(e[0]=this.incWord(e[0]))===0&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let i;if(!(i=t.length))return[];let o=jc.bitLength(t);for(let r=0;r<i;r+=4){this.incCounter(n);let s=e.encrypt(n);t[r]^=s[0],t[r+1]^=s[1],t[r+2]^=s[2],t[r+3]^=s[3]}return jc.clamp(t,o)}};var By={importKey(e){return new By.hmacSha1(YP.bytes.toBits(e))},pbkdf2(e,t,n,i){if(n=n||1e4,i<0||n<0)throw new Error("invalid params to pbkdf2");let o=(i>>5)+1<<2,r,s,a,c,d,u=new ArrayBuffer(o),m=new DataView(u),p=0,y=jc;for(t=YP.bytes.toBits(t),d=1;p<(o||1);d++){for(r=s=e.encrypt(y.concat(t,[d])),a=1;a<n;a++)for(s=e.encrypt(s),c=0;c<s.length;c++)r[c]^=s[c];for(a=0;p<(o||1)&&a<r.length;a++)m.setInt32(p,r[a]),p+=4}return u.slice(0,i/8)}};By.hmacSha1=class{constructor(e){let t=this,n=t._hash=Nme.sha1,i=[[],[]];t._baseHash=[new n,new n];let o=t._baseHash[0].blockSize/32;e.length>o&&(e=new n().update(e).finalize());for(let r=0;r<o;r++)i[0][r]=e[r]^909522486,i[1][r]=e[r]^1549556828;t._baseHash[0].update(i[0]),t._baseHash[1].update(i[1]),t._resultHash=new n(t._baseHash[0])}reset(){let e=this;e._resultHash=new e._hash(e._baseHash[0]),e._updated=!1}update(e){let t=this;t._updated=!0,t._resultHash.update(e)}digest(){let e=this,t=e._resultHash.finalize(),n=new e._hash(e._baseHash[1]).update(t).finalize();return e.reset(),n}encrypt(e){if(this._updated)throw new Error("encrypt on already updated hmac called!");return this.update(e),this.digest(e)}};var Fii=T(S(),1);var c7e=typeof crypto!=Zd&&typeof crypto.getRandomValues==w0,Oy="Invalid password",tT="Invalid signature",A0="zipjs-abort-check-password";function xU(e){return c7e?crypto.getRandomValues(e):Ume.getRandomValues(e)}var j1=16,l7e="raw",Bme={name:"PBKDF2"},d7e={name:"HMAC"},u7e="SHA-1",m7e=Object.assign({hash:d7e},Bme),wz=Object.assign({iterations:1e3,hash:{name:u7e}},Bme),h7e=["deriveBits"],KP=[8,12,16],HP=[16,24,32],Yy=10,f7e=[0,0,0,0],SU=typeof crypto!=Zd,QP=SU&&crypto.subtle,Ome=SU&&typeof QP!=Zd,Rf=YP.bytes,p7e=Pz.aes,b7e=vz.ctrGladman,y7e=By.hmacSha1,kme=SU&&Ome&&typeof QP.importKey==w0,Dme=SU&&Ome&&typeof QP.deriveBits==w0,_U=class extends TransformStream{constructor({password:t,rawPassword:n,signed:i,encryptionStrength:o,checkPasswordOnly:r}){super({start(){Object.assign(this,{ready:new Promise(s=>this.resolveReady=s),password:Kme(t,n),signed:i,strength:o-1,pending:new Uint8Array})},async transform(s,a){let c=this,{password:d,strength:u,resolveReady:m,ready:p}=c;d?(await g7e(c,u,d,Hu(s,0,KP[u]+2)),s=Hu(s,KP[u]+2),r?a.error(new Error(A0)):m()):await p;let y=new Uint8Array(s.length-Yy-(s.length-Yy)%j1);a.enqueue(Yme(c,s,y,0,Yy,!0))},async flush(s){let{signed:a,ctr:c,hmac:d,pending:u,ready:m}=this;if(d&&c){await m;let p=Hu(u,0,u.length-Yy),y=Hu(u,u.length-Yy),f=new Uint8Array;if(p.length){let x=JP(Rf,p);d.update(x);let _=c.update(x);f=zP(Rf,_)}if(a){let x=Hu(zP(Rf,d.digest()),0,Yy);for(let _=0;_<Yy;_++)if(x[_]!=y[_])throw new Error(tT)}s.enqueue(f)}}})}},TU=class extends TransformStream{constructor({password:t,rawPassword:n,encryptionStrength:i}){let o;super({start(){Object.assign(this,{ready:new Promise(r=>this.resolveReady=r),password:Kme(t,n),strength:i-1,pending:new Uint8Array})},async transform(r,s){let a=this,{password:c,strength:d,resolveReady:u,ready:m}=a,p=new Uint8Array;c?(p=await x7e(a,d,c),u()):await m;let y=new Uint8Array(p.length+r.length-r.length%j1);y.set(p,0),s.enqueue(Yme(a,r,y,p.length,0))},async flush(r){let{ctr:s,hmac:a,pending:c,ready:d}=this;if(a&&s){await d;let u=new Uint8Array;if(c.length){let m=s.update(JP(Rf,c));a.update(m),u=zP(Rf,m)}o.signature=zP(Rf,a.digest()).slice(0,Yy),r.enqueue(Fz(u,o.signature))}}}),o=this}};function Yme(e,t,n,i,o,r){let{ctr:s,hmac:a,pending:c}=e,d=t.length-o;c.length&&(t=Fz(c,t),n=S7e(n,d-d%j1));let u;for(u=0;u<=d-j1;u+=j1){let m=JP(Rf,Hu(t,u,u+j1));r&&a.update(m);let p=s.update(m);r||a.update(p),n.set(zP(Rf,p),u+i)}return e.pending=Hu(t,u),n}async function g7e(e,t,n,i){let o=await Hme(e,t,n,Hu(i,0,KP[t])),r=Hu(i,KP[t]);if(o[0]!=r[0]||o[1]!=r[1])throw new Error(Oy)}async function x7e(e,t,n){let i=xU(new Uint8Array(KP[t])),o=await Hme(e,t,n,i);return Fz(i,o)}async function Hme(e,t,n,i){e.password=null;let o=await _7e(l7e,n,m7e,!1,h7e),r=await T7e(Object.assign({salt:i},wz),o,8*(HP[t]*2+2)),s=new Uint8Array(r),a=JP(Rf,Hu(s,0,HP[t])),c=JP(Rf,Hu(s,HP[t],HP[t]*2)),d=Hu(s,HP[t]*2);return Object.assign(e,{keys:{key:a,authentication:c,passwordVerification:d},ctr:new b7e(new p7e(a),Array.from(f7e)),hmac:new y7e(c)}),d}async function _7e(e,t,n,i,o){if(kme)try{return await QP.importKey(e,t,n,i,o)}catch{return kme=!1,By.importKey(t)}else return By.importKey(t)}async function T7e(e,t,n){if(Dme)try{return await QP.deriveBits(e,t,n)}catch{return Dme=!1,By.pbkdf2(t,e.salt,wz.iterations,n)}else return By.pbkdf2(t,e.salt,wz.iterations,n)}function Kme(e,t){return t===er?OP(e):t}function Fz(e,t){let n=e;return e.length+t.length&&(n=new Uint8Array(e.length+t.length),n.set(e,0),n.set(t,e.length)),n}function S7e(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function Hu(e,t,n){return e.subarray(t,n)}function zP(e,t){return e.fromBits(t)}function JP(e,t){return e.toBits(t)}var Hii=T(S(),1);var q1=12,CU=class extends TransformStream{constructor({password:t,passwordVerification:n,checkPasswordOnly:i}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),jme(this,t)},transform(o,r){let s=this;if(s.password){let a=zme(s,o.subarray(0,q1));if(s.password=null,a[q1-1]!=s.passwordVerification)throw new Error(Oy);o=o.subarray(q1)}i?r.error(new Error(A0)):r.enqueue(zme(s,o))}})}},VU=class extends TransformStream{constructor({password:t,passwordVerification:n}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),jme(this,t)},transform(i,o){let r=this,s,a;if(r.password){r.password=null;let c=xU(new Uint8Array(q1));c[q1-1]=r.passwordVerification,s=new Uint8Array(i.length+c.length),s.set(Jme(r,c),0),a=q1}else s=new Uint8Array(i.length),a=0;s.set(Jme(r,i),a),o.enqueue(s)}})}};function zme(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=qme(e)^t[i],Az(e,n[i]);return n}function Jme(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=qme(e)^t[i],Az(e,t[i]);return n}function jme(e,t){let n=[305419896,591751049,878082192];Object.assign(e,{keys:n,crcKey0:new F0(n[0]),crcKey2:new F0(n[2])});for(let i=0;i<t.length;i++)Az(e,t.charCodeAt(i))}function Az(e,t){let[n,i,o]=e.keys;e.crcKey0.append([t]),n=~e.crcKey0.get(),i=Qme(Math.imul(Qme(i+$me(n)),134775813)+1),e.crcKey2.append([i>>>24]),o=~e.crcKey2.get(),e.keys=[n,i,o]}function qme(e){let t=e.keys[2]|2;return $me(Math.imul(t,t^1)>>>8)}function $me(e){return e&255}function Qme(e){return e&4294967295}var ehe="deflate-raw",LU=class extends TransformStream{constructor(t,{chunkSize:n,CompressionStream:i,CompressionStreamNative:o}){super({});let{compressed:r,encrypted:s,useCompressionStream:a,zipCrypto:c,signed:d,level:u}=t,m=this,p,y,f=the(super.readable);(!s||c)&&d&&(p=new BP,f=Zf(f,p)),r&&(f=ihe(f,a,{level:u,chunkSize:n},o,i)),s&&(c?f=Zf(f,new VU(t)):(y=new TU(t),f=Zf(f,y))),nhe(m,f,()=>{let x;s&&!c&&(x=y.signature),(!s||c)&&d&&(x=new DataView(p.value.buffer).getUint32(0)),m.signature=x})}},RU=class extends TransformStream{constructor(t,{chunkSize:n,DecompressionStream:i,DecompressionStreamNative:o}){super({});let{zipCrypto:r,encrypted:s,signed:a,signature:c,compressed:d,useCompressionStream:u}=t,m,p,y=the(super.readable);s&&(r?y=Zf(y,new CU(t)):(p=new _U(t),y=Zf(y,p))),d&&(y=ihe(y,u,{chunkSize:n},o,i)),(!s||r)&&a&&(m=new BP,y=Zf(y,m)),nhe(this,y,()=>{if((!s||r)&&a){let f=new DataView(m.value.buffer);if(c!=f.getUint32(0,!1))throw new Error(tT)}})}};function the(e){return Zf(e,new TransformStream({transform(t,n){t&&t.length&&n.enqueue(t)}}))}function nhe(e,t,n){t=Zf(t,new TransformStream({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function ihe(e,t,n,i,o){try{let r=t&&i?i:o;e=Zf(e,new r(ehe,n))}catch{if(t)try{e=Zf(e,new o(ehe,n))}catch{return e}else return e}return e}function Zf(e,t){return e.pipeThrough(t)}var ohe="message",rhe="start",she="pull",Mz="data",ahe="ack",Nz="close",EU="deflate",IU="inflate";var ZU=class extends TransformStream{constructor(t,n){super({});let i=this,{codecType:o}=t,r;o.startsWith(EU)?r=LU:o.startsWith(IU)&&(r=RU);let s=0,a=0,c=new r(t,n),d=super.readable,u=new TransformStream({transform(p,y){p&&p.length&&(a+=p.length,y.enqueue(p))},flush(){Object.assign(i,{inputSize:a})}}),m=new TransformStream({transform(p,y){p&&p.length&&(s+=p.length,y.enqueue(p))},flush(){let{signature:p}=c;Object.assign(i,{signature:p,outputSize:s,inputSize:a})}});Object.defineProperty(i,"readable",{get(){return d.pipeThrough(u).pipeThrough(c).pipeThrough(m)}})}},GU=class extends TransformStream{constructor(t){let n;super({transform:i,flush(o){n&&n.length&&o.enqueue(n)}});function i(o,r){if(n){let s=new Uint8Array(n.length+o.length);s.set(n),s.set(o,n.length),o=s,n=null}o.length>t?(r.enqueue(o.slice(0,t)),i(o.slice(t),r)):n=o}}};var roi=T(S(),1);var dhe=typeof Worker!=Zd;var $1=class{constructor(t,{readable:n,writable:i},{options:o,config:r,streamOptions:s,useWebWorkers:a,transferStreams:c,scripts:d},u){let{signal:m}=s;return Object.assign(t,{busy:!0,readable:n.pipeThrough(new GU(r.chunkSize)).pipeThrough(new kz(n,s),{signal:m}),writable:i,options:Object.assign({},o),scripts:d,transferStreams:c,terminate(){return new Promise(p=>{let{worker:y,busy:f}=t;y?(f?t.resolveTerminated=p:(y.terminate(),p()),t.interface=null):p()})},onTaskFinished(){let{resolveTerminated:p}=t;p&&(t.resolveTerminated=null,t.terminated=!0,t.worker.terminate(),p()),t.busy=!1,u(t)}}),(a&&dhe?C7e:uhe)(t,r)}},kz=class extends TransformStream{constructor(t,{onstart:n,onprogress:i,size:o,onend:r}){let s=0;super({async start(){n&&await Uz(n,o)},async transform(a,c){s+=a.length,i&&await Uz(i,s,o),c.enqueue(a)},async flush(){t.size=s,r&&await Uz(r,s)}})}};async function Uz(e,...t){try{await e(...t)}catch{}}function uhe(e,t){return{run:()=>V7e(e,t)}}function C7e(e,t){let{baseURL:n,chunkSize:i}=t;if(!e.interface){let o;try{o=Z7e(e.scripts[0],n,e)}catch{return dhe=!1,uhe(e,t)}Object.assign(e,{worker:o,interface:{run:()=>L7e(e,{chunkSize:i})}})}return e.interface}async function V7e({options:e,readable:t,writable:n,onTaskFinished:i},o){try{let r=new ZU(e,o);await t.pipeThrough(r).pipeTo(n,{preventClose:!0,preventAbort:!0});let{signature:s,inputSize:a,outputSize:c}=r;return{signature:s,inputSize:a,outputSize:c}}finally{i()}}async function L7e(e,t){let n,i,o=new Promise((p,y)=>{n=p,i=y});Object.assign(e,{reader:null,writer:null,resolveResult:n,rejectResult:i,result:o});let{readable:r,options:s,scripts:a}=e,{writable:c,closed:d}=R7e(e.writable);XU({type:rhe,scripts:a.slice(1),options:s,config:t,readable:r,writable:c},e)||Object.assign(e,{reader:r.getReader(),writer:c.getWriter()});let m=await o;try{await c.getWriter().close()}catch{}return await d,m}function R7e(e){let t,n=new Promise(o=>t=o);return{writable:new WritableStream({async write(o){let r=e.getWriter();await r.ready,await r.write(o),r.releaseLock()},close(){t()},abort(o){return e.getWriter().abort(o)}}),closed:n}}var che=!0,lhe=!0;function Z7e(e,t,n){let i={type:"module"},o,r;typeof e==w0&&(e=e());try{o=new URL(e,t)}catch{o=e}if(che)try{r=new Worker(o)}catch{che=!1,r=new Worker(o,i)}else r=new Worker(o,i);return r.addEventListener(ohe,s=>G7e(s,n)),r}function XU(e,{worker:t,writer:n,onTaskFinished:i,transferStreams:o}){try{let{value:r,readable:s,writable:a}=e,c=[];if(r&&(r.byteLength<r.buffer.byteLength?e.value=r.buffer.slice(0,r.byteLength):e.value=r.buffer,c.push(e.value)),o&&lhe?(s&&c.push(s),a&&c.push(a)):e.readable=e.writable=null,c.length)try{return t.postMessage(e,c),!0}catch{lhe=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(r){throw n&&n.releaseLock(),i(),r}}async function G7e({data:e},t){let{type:n,value:i,messageId:o,result:r,error:s}=e,{reader:a,writer:c,resolveResult:d,rejectResult:u,onTaskFinished:m}=t;try{if(s){let{message:y,stack:f,code:x,name:_}=s,C=new Error(y);Object.assign(C,{stack:f,code:x,name:_}),p(C)}else{if(n==she){let{value:y,done:f}=await a.read();XU({type:Mz,value:y,done:f,messageId:o},t)}n==Mz&&(await c.ready,await c.write(new Uint8Array(i)),XU({type:ahe,messageId:o},t)),n==Nz&&p(null,r)}}catch(y){XU({type:Nz,messageId:o},t),p(y)}function p(y,f){y?u(y):d(f),c&&c.releaseLock(),m()}}var nT=[],Dz=[];var mhe=0;async function WU(e,t){let{options:n,config:i}=t,{transferStreams:o,useWebWorkers:r,useCompressionStream:s,codecType:a,compressed:c,signed:d,encrypted:u}=n,{workerScripts:m,maxWorkers:p}=i;t.transferStreams=o||o===er;let y=!c&&!d&&!u&&!t.transferStreams;return t.useWebWorkers=!y&&(r||r===er&&i.useWebWorkers),t.scripts=t.useWebWorkers&&m?m[a]:[],n.useCompressionStream=s||s===er&&i.useCompressionStream,(await f()).run();async function f(){let _=nT.find(C=>!C.busy);if(_)return hhe(_),new $1(_,e,t,x);if(nT.length<p){let C={indexWorker:mhe};return mhe++,nT.push(C),new $1(C,e,t,x)}else return new Promise(C=>Dz.push({resolve:C,stream:e,workerOptions:t}))}function x(_){if(Dz.length){let[{resolve:C,stream:V,workerOptions:L}]=Dz.splice(0,1);C(new $1(_,V,L,x))}else _.worker?(hhe(_),E7e(_,t)):nT=nT.filter(C=>C!=_)}}function E7e(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{nT=nT.filter(o=>o!=e);try{await e.terminate()}catch{}},i))}function hhe(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var foi=T(S(),1);var I7e="Writer iterator completed too soon",X7e="text/plain";var W7e="Content-Type";var P7e=64*1024,Yz="writable",eV=class{constructor(){this.size=0}init(){this.initialized=!0}},PU=class extends eV{get readable(){let t=this,{chunkSize:n=P7e}=t,i=new ReadableStream({start(){this.chunkOffset=0},async pull(o){let{offset:r=0,size:s,diskNumberStart:a}=i,{chunkOffset:c}=this;o.enqueue(await Xa(t,r+c,Math.min(n,s-c),a)),c+n>s?o.close():this.chunkOffset+=n}});return i}},Bz=class extends eV{constructor(){super();let t=this,n=new WritableStream({write(i){return t.writeUint8Array(i)}});Object.defineProperty(t,Yz,{get(){return n}})}writeUint8Array(){}};var vU=class extends Bz{constructor(t){super(),Object.assign(this,{data:"data:"+(t||"")+";base64,",pending:[]})}writeUint8Array(t){let n=this,i=0,o=n.pending,r=n.pending.length;for(n.pending="",i=0;i<Math.floor((r+t.length)/3)*3-r;i++)o+=String.fromCharCode(t[i]);for(;i<t.length;i++)n.pending+=String.fromCharCode(t[i]);o.length>2?n.data+=btoa(o):n.pending=o}getData(){return this.data+btoa(this.pending)}},M0=class extends PU{constructor(t){super(),Object.assign(this,{blob:t,size:t.size})}async readUint8Array(t,n){let i=this,o=t+n,s=await(t||o<i.size?i.blob.slice(t,o):i.blob).arrayBuffer();return s.byteLength>n&&(s=s.slice(t,o)),new Uint8Array(s)}},iT=class extends eV{constructor(t){super();let n=this,i=new TransformStream,o=[];t&&o.push([W7e,t]),Object.defineProperty(n,Yz,{get(){return i.writable}}),n.blob=new Response(i.readable,{headers:o}).blob()}getData(){return this.blob}},wU=class extends M0{constructor(t){super(new Blob([t],{type:X7e}))}},FU=class extends iT{constructor(t){super(t),Object.assign(this,{encoding:t,utf8:!t||t.toLowerCase()=="utf-8"})}async getData(){let{encoding:t,utf8:n}=this,i=await super.getData();if(i.text&&n)return i.text();{let o=new FileReader;return new Promise((r,s)=>{Object.assign(o,{onload:({target:a})=>r(a.result),onerror:()=>s(o.error)}),o.readAsText(i,t)})}}};var Oz=class extends PU{constructor(t){super(),this.readers=t}async init(){let t=this,{readers:n}=t;t.lastDiskNumber=0,t.lastDiskOffset=0,await Promise.all(n.map(async(i,o)=>{await i.init(),o!=n.length-1&&(t.lastDiskOffset+=i.size),t.size+=i.size})),super.init()}async readUint8Array(t,n,i=0){let o=this,{readers:r}=this,s,a=i;a==-1&&(a=r.length-1);let c=t;for(;c>=r[a].size;)c-=r[a].size,a++;let d=r[a],u=d.size;if(c+n<=u)s=await Xa(d,c,n);else{let m=u-c;s=new Uint8Array(n),s.set(await Xa(d,c,m)),s.set(await o.readUint8Array(t+m,n-m,i),m)}return o.lastDiskNumber=Math.max(a,o.lastDiskNumber),s}},tV=class extends eV{constructor(t,n=4294967295){super();let i=this;Object.assign(i,{diskNumber:0,diskOffset:0,size:0,maxSize:n,availableSize:n});let o,r,s,a=new WritableStream({async write(u){let{availableSize:m}=i;if(s)u.length>=m?(await c(u.slice(0,m)),await d(),i.diskOffset+=o.size,i.diskNumber++,s=null,await this.write(u.slice(m))):await c(u);else{let{value:p,done:y}=await t.next();if(y&&!p)throw new Error(I7e);o=p,o.size=0,o.maxSize&&(i.maxSize=o.maxSize),i.availableSize=i.maxSize,await Gf(o),r=p.writable,s=r.getWriter(),await this.write(u)}},async close(){await s.ready,await d()}});Object.defineProperty(i,Yz,{get(){return a}});async function c(u){let m=u.length;m&&(await s.ready,await s.write(u),o.size+=m,i.size+=m,i.availableSize-=m)}async function d(){r.size=o.size,await s.close()}}};async function Gf(e,t){e.init&&!e.initialized&&await e.init(t)}function AU(e){return Array.isArray(e)&&(e=new Oz(e)),e instanceof ReadableStream&&(e={readable:e}),e}function MU(e){e.writable===er&&typeof e.next==w0&&(e=new tV(e)),e instanceof WritableStream&&(e={writable:e});let{writable:t}=e;return t.size===er&&(t.size=0),e instanceof tV||Object.assign(e,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),e}function Xa(e,t,n,i){return e.readUint8Array(t,n,i)}var Ioi=T(S(),1);var xoi=T(S(),1);var boi=T(S(),1),fhe="\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0 ".split(""),v7e=fhe.length==256;function phe(e){if(v7e){let t="";for(let n=0;n<e.length;n++)t+=fhe[e[n]];return t}else return new TextDecoder().decode(e)}function NU(e,t){return t&&t.trim().toLowerCase()=="cp437"?phe(e):new TextDecoder(t).decode(e)}var Toi=T(S(),1),Hz="filename",Kz="rawFilename",zz="comment",Jz="rawComment",Qz="uncompressedSize",jz="compressedSize",qz="offset",UU="diskNumberStart",nV="lastModDate",kU="rawLastModDate",jP="lastAccessDate",bhe="rawLastAccessDate",qP="creationDate",yhe="rawCreationDate",$z="internalFileAttribute",eJ="externalFileAttribute",tJ="msDosCompatible",nJ="zip64",w7e=[Hz,Kz,jz,Qz,nV,kU,zz,Jz,jP,qP,qz,UU,UU,$z,eJ,tJ,nJ,"directory","bitFlag","encrypted","signature","filenameUTF8","commentUTF8","compressionMethod","version","versionMadeBy","extraField","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"],Hy=class{constructor(t){w7e.forEach(n=>this[n]=t[n])}};var iJ="File format is not recognized",N7e="End of central directory not found",U7e="End of Zip64 central directory not found",k7e="End of Zip64 central directory locator not found",D7e="Central directory header not found",B7e="Local file header not found",O7e="Zip64 extra field not found",Y7e="File contains encrypted entry",H7e="Encryption method not supported",ghe="Compression method not supported",xhe="Split zip file",_he="utf-8",The="cp437",K7e=[[Qz,4294967295],[jz,4294967295],[qz,4294967295],[UU,65535]],z7e={[65535]:{getValue:us,bytes:4},[4294967295]:{getValue:DU,bytes:8}},JU=class{constructor(t,n={}){Object.assign(this,{reader:AU(t),options:n,config:DP()})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n,{config:o}=n;if(await Gf(i),(i.size===er||!i.readUint8Array)&&(i=new M0(await new Response(i.readable).blob()),await Gf(i)),i.size<22)throw new Error(iJ);i.chunkSize=gU(o);let r=await $7e(i,101010256,i.size,22,65535*16);if(!r){let M=await Xa(i,0,4),b=da(M);throw us(b)==134695760?new Error(xhe):new Error(N7e)}let s=da(r),a=us(s,12),c=us(s,16),d=r.offset,u=la(s,20),m=d+22+u,p=la(s,4),y=i.lastDiskNumber||0,f=la(s,6),x=la(s,8),_=0,C=0;if(c==4294967295||a==4294967295||x==65535||f==65535){let M=await Xa(i,r.offset-20,20),b=da(M);if(us(b,0)!=117853008)throw new Error(U7e);c=DU(b,8);let R=await Xa(i,c,56,-1),E=da(R),X=r.offset-20-56;if(us(E,0)!=101075792&&c!=X){let w=c;c=X,_=c-w,R=await Xa(i,c,56,-1),E=da(R)}if(us(E,0)!=101075792)throw new Error(k7e);p==65535&&(p=us(E,16)),f==65535&&(f=us(E,20)),x==65535&&(x=DU(E,32)),a==4294967295&&(a=DU(E,40)),c-=a}if(c>=i.size&&(_=i.size-c-a-22,c=i.size-a-22),y!=p)throw new Error(xhe);if(c<0)throw new Error(iJ);let V=0,L=await Xa(i,c,a,f),Z=da(L);if(a){let M=r.offset-a;if(us(Z,V)!=33639248&&c!=M){let b=c;c=M,_+=c-b,L=await Xa(i,c,a,f),Z=da(L)}}let G=r.offset-c-(i.lastDiskOffset||0);if(a!=G&&G>=0&&(a=G,L=await Xa(i,c,a,f),Z=da(L)),c<0||c>=i.size)throw new Error(iJ);let I=Gd(n,t,"filenameEncoding"),P=Gd(n,t,"commentEncoding");for(let M=0;M<x;M++){let b=new rJ(i,o,n.options);if(us(Z,V)!=33639248)throw new Error(D7e);Che(b,Z,V+6);let R=!!b.bitFlag.languageEncodingFlag,E=V+46,X=E+b.filenameLength,w=X+b.extraFieldLength,N=la(Z,V+4),D=(N&0)==0,k=L.subarray(E,X),Y=la(Z,V+32),U=w+Y,J=L.subarray(w,U),K=R,ee=R,H=D&&(iV(Z,V+38)&16)==16,j=us(Z,V+42)+_;Object.assign(b,{versionMadeBy:N,msDosCompatible:D,compressedSize:0,uncompressedSize:0,commentLength:Y,directory:H,offset:j,diskNumberStart:la(Z,V+34),internalFileAttribute:la(Z,V+36),externalFileAttribute:us(Z,V+38),rawFilename:k,filenameUTF8:K,commentUTF8:ee,rawExtraField:L.subarray(X,w)});let[$,pe]=await Promise.all([NU(k,K?_he:I||The),NU(J,ee?_he:P||The)]);Object.assign(b,{rawComment:J,filename:$,comment:pe,directory:H||$.endsWith(J1)}),C=Math.max(j,C),await Vhe(b,b,Z,V+6);let ge=new Hy(b);ge.getData=(be,_e)=>b.getData(be,ge,_e),V=U;let{onprogress:ae}=t;if(ae)try{await ae(M+1,x,new Hy(b))}catch{}yield ge}let v=Gd(n,t,"extractPrependedData"),F=Gd(n,t,"extractAppendedData");return v&&(n.prependedData=C>0?await Xa(i,0,C):new Uint8Array),n.comment=u?await Xa(i,d+22,u):new Uint8Array,F&&(n.appendedData=m<i.size?await Xa(i,m,i.size-m):new Uint8Array),!0}async getEntries(t={}){let n=[];for await(let i of this.getEntriesGenerator(t))n.push(i);return n}async close(){}};var rJ=class{constructor(t,n,i){Object.assign(this,{reader:t,config:n,options:i})}async getData(t,n,i={}){let o=this,{reader:r,offset:s,diskNumberStart:a,extraFieldAES:c,compressionMethod:d,config:u,bitFlag:m,signature:p,rawLastModDate:y,uncompressedSize:f,compressedSize:x}=o,_=n.localDirectory={},C=await Xa(r,s,30,a),V=da(C),L=Gd(o,i,"password"),Z=Gd(o,i,"rawPassword");if(L=L&&L.length&&L,Z=Z&&Z.length&&Z,c&&c.originalCompressionMethod!=99)throw new Error(ghe);if(d!=0&&d!=8)throw new Error(ghe);if(us(V,0)!=67324752)throw new Error(B7e);Che(_,V,4),_.rawExtraField=_.extraFieldLength?await Xa(r,s+30+_.filenameLength,_.extraFieldLength,a):new Uint8Array,await Vhe(o,_,V,4,!0),Object.assign(n,{lastAccessDate:_.lastAccessDate,creationDate:_.creationDate});let G=o.encrypted&&_.encrypted,I=G&&!c;if(G){if(!I&&c.strength===er)throw new Error(H7e);if(!L&&!Z)throw new Error(Y7e)}let P=s+30+_.filenameLength+_.extraFieldLength,v=x,F=r.readable;Object.assign(F,{diskNumberStart:a,offset:P,size:v});let M=Gd(o,i,"signal"),b=Gd(o,i,"checkPasswordOnly");b&&(t=new WritableStream),t=MU(t),await Gf(t,f);let{writable:R}=t,{onstart:E,onprogress:X,onend:w}=i,N={options:{codecType:IU,password:L,rawPassword:Z,zipCrypto:I,encryptionStrength:c&&c.strength,signed:Gd(o,i,"checkSignature"),passwordVerification:I&&(m.dataDescriptor?y>>>8&255:p>>>24&255),signature:p,compressed:d!=0,encrypted:G,useWebWorkers:Gd(o,i,"useWebWorkers"),useCompressionStream:Gd(o,i,"useCompressionStream"),transferStreams:Gd(o,i,"transferStreams"),checkPasswordOnly:b},config:u,streamOptions:{signal:M,size:v,onstart:E,onprogress:X,onend:w}},D=0;try{({outputSize:D}=await WU({readable:F,writable:R},N))}catch(k){if(!b||k.message!=A0)throw k}finally{let k=Gd(o,i,"preventClose");R.size+=D,!k&&!R.locked&&await R.getWriter().close()}return b?er:t.getData?t.getData():R}};function Che(e,t,n){let i=e.rawBitFlag=la(t,n+2),o=(i&1)==1,r=us(t,n+6);Object.assign(e,{encrypted:o,version:la(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:r,lastModDate:e6e(r),filenameLength:la(t,n+22),extraFieldLength:la(t,n+24)})}async function Vhe(e,t,n,i,o){let{rawExtraField:r}=t,s=t.extraField=new Map,a=da(new Uint8Array(r)),c=0;try{for(;c<r.length;){let C=la(a,c),V=la(a,c+2);s.set(C,{type:C,data:r.slice(c+4,c+4+V)}),c+=4+V}}catch{}let d=la(n,i+4);Object.assign(t,{signature:us(n,i+10),uncompressedSize:us(n,i+18),compressedSize:us(n,i+14)});let u=s.get(1);u&&(J7e(u,t),t.extraFieldZip64=u);let m=s.get(28789);m&&(await She(m,Hz,Kz,t,e),t.extraFieldUnicodePath=m);let p=s.get(25461);p&&(await She(p,zz,Jz,t,e),t.extraFieldUnicodeComment=p);let y=s.get(39169);y?(Q7e(y,t,d),t.extraFieldAES=y):t.compressionMethod=d;let f=s.get(10);f&&(j7e(f,t),t.extraFieldNTFS=f);let x=s.get(21589);x&&(q7e(x,t,o),t.extraFieldExtendedTimestamp=x);let _=s.get(6534);_&&(t.extraFieldUSDZ=_)}function J7e(e,t){t.zip64=!0;let n=da(e.data),i=K7e.filter(([o,r])=>t[o]==r);for(let o=0,r=0;o<i.length;o++){let[s,a]=i[o];if(t[s]==a){let c=z7e[a];t[s]=e[s]=c.getValue(n,r),r+=c.bytes}else if(e[s])throw new Error(O7e)}}async function She(e,t,n,i,o){let r=da(e.data),s=new F0;s.append(o[n]);let a=da(new Uint8Array(4));a.setUint32(0,s.get(),!0);let c=us(r,1);Object.assign(e,{version:iV(r,0),[t]:NU(e.data.subarray(5)),valid:!o.bitFlag.languageEncodingFlag&&c==us(a,0)}),e.valid&&(i[t]=e[t],i[t+"UTF8"]=!0)}function Q7e(e,t,n){let i=da(e.data),o=iV(i,4);Object.assign(e,{vendorVersion:iV(i,0),vendorId:iV(i,2),strength:o,originalCompressionMethod:n,compressionMethod:la(i,5)}),t.compressionMethod=e.compressionMethod}function j7e(e,t){let n=da(e.data),i=4,o;try{for(;i<e.data.length&&!o;){let r=la(n,i),s=la(n,i+2);r==1&&(o=e.data.slice(i+4,i+4+s)),i+=4+s}}catch{}try{if(o&&o.length==24){let r=da(o),s=r.getBigUint64(0,!0),a=r.getBigUint64(8,!0),c=r.getBigUint64(16,!0);Object.assign(e,{rawLastModDate:s,rawLastAccessDate:a,rawCreationDate:c});let d=oJ(s),u=oJ(a),m=oJ(c),p={lastModDate:d,lastAccessDate:u,creationDate:m};Object.assign(e,p),Object.assign(t,p)}}catch{}}function q7e(e,t,n){let i=da(e.data),o=iV(i,0),r=[],s=[];n?((o&1)==1&&(r.push(nV),s.push(kU)),(o&2)==2&&(r.push(jP),s.push(bhe)),(o&4)==4&&(r.push(qP),s.push(yhe))):e.data.length>=5&&(r.push(nV),s.push(kU));let a=1;r.forEach((c,d)=>{if(e.data.length>=a+4){let u=us(i,a);t[c]=e[c]=new Date(u*1e3);let m=s[d];e[m]=u}a+=4})}async function $7e(e,t,n,i,o){let r=new Uint8Array(4),s=da(r);t6e(s,0,t);let a=i+o;return await c(i)||await c(Math.min(a,n));async function c(d){let u=n-d,m=await Xa(e,u,d);for(let p=m.length-i;p>=0;p--)if(m[p]==r[0]&&m[p+1]==r[1]&&m[p+2]==r[2]&&m[p+3]==r[3])return{offset:u+p,buffer:m.slice(p,p+i).buffer}}}function Gd(e,t,n){return t[n]===er?e.options[n]:t[n]}function e6e(e){let t=(e&4294901760)>>16,n=e&65535;try{return new Date(1980+((t&65024)>>9),((t&480)>>5)-1,t&31,(n&63488)>>11,(n&2016)>>5,(n&31)*2,0)}catch{}}function oJ(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function iV(e,t){return e.getUint8(t)}function la(e,t){return e.getUint16(t,!0)}function us(e,t){return e.getUint32(t,!0)}function DU(e,t){return Number(e.getBigUint64(t,!0))}function t6e(e,t,n){e.setUint32(t,n,!0)}function da(e){return new DataView(e.buffer)}var Moi=T(S(),1);var r6e="File already exists",s6e="Zip file comment exceeds 64KB",a6e="File entry comment exceeds 64KB",c6e="File entry name exceeds 64KB",Zhe="Version exceeds 65535",l6e="The strength must equal 1, 2, or 3",d6e="Extra field type exceeds 65535",u6e="Extra field data exceeds 64KB",xJ="Zip64 is not supported (make sure 'keepOrder' is set to 'true')",Ghe=new Uint8Array([7,0,2,0,65,69,3,0,0]),yJ=0,Ehe=[],qU=class{constructor(t,n={}){t=MU(t),Object.assign(this,{writer:t,addSplitZipSignature:t instanceof tV,options:n,config:DP(),files:new Map,filenames:new Set,offset:t.writable.size,pendingEntriesSize:0,pendingAddFileCalls:new Set,bufferedWrites:0})}async add(t="",n,i={}){let o=this,{pendingAddFileCalls:r,config:s}=o;yJ<s.maxWorkers?yJ++:await new Promise(c=>Ehe.push(c));let a;try{if(t=t.trim(),o.filenames.has(t))throw new Error(r6e);return o.filenames.add(t),a=m6e(o,t,n,i),r.add(a),await a}catch(c){throw o.filenames.delete(t),c}finally{r.delete(a);let c=Ehe.shift();c?c():yJ--}}async close(t=new Uint8Array,n={}){let i=this,{pendingAddFileCalls:o,writer:r}=this,{writable:s}=r;for(;o.size;)await Promise.allSettled(Array.from(o));return await T6e(this,t,n),tr(i,n,"preventClose")||await s.getWriter().close(),r.getData?r.getData():s}};async function m6e(e,t,n,i){t=t.trim(),i.directory&&!t.endsWith(J1)?t+=J1:i.directory=t.endsWith(J1);let o=OP(t);if(zi(o)>65535)throw new Error(c6e);let r=i.comment||"",s=OP(r);if(zi(s)>65535)throw new Error(a6e);let a=tr(e,i,"version",20);if(a>65535)throw new Error(Zhe);let c=tr(e,i,"versionMadeBy",20);if(c>65535)throw new Error(Zhe);let d=tr(e,i,nV,new Date),u=tr(e,i,jP),m=tr(e,i,qP),p=tr(e,i,tJ,!0),y=tr(e,i,$z,0),f=tr(e,i,eJ,0),x=tr(e,i,"password"),_=tr(e,i,"rawPassword"),C=tr(e,i,"encryptionStrength",3),V=tr(e,i,"zipCrypto"),L=tr(e,i,"extendedTimestamp",!0),Z=tr(e,i,"keepOrder",!0),G=tr(e,i,"level"),I=tr(e,i,"useWebWorkers"),P=tr(e,i,"bufferedWrite"),v=tr(e,i,"dataDescriptorSignature",!1),F=tr(e,i,"signal"),M=tr(e,i,"useCompressionStream"),b=tr(e,i,"dataDescriptor",!0),R=tr(e,i,nJ);if(x!==er&&C!==er&&(C<1||C>3))throw new Error(l6e);let E=new Uint8Array,{extraField:X}=i;if(X){let _e=0,Ze=0;X.forEach(Le=>_e+=4+zi(Le)),E=new Uint8Array(_e),X.forEach((Le,Ee)=>{if(Ee>65535)throw new Error(d6e);if(zi(Le)>65535)throw new Error(u6e);Vs(E,new Uint16Array([Ee]),Ze),Vs(E,new Uint16Array([zi(Le)]),Ze+2),Vs(E,Le,Ze+4),Ze+=4+zi(Le)})}let w=0,N=0,D=0,k=R===!0;n&&(n=AU(n),await Gf(n),n.size===er?(b=!0,(R||R===er)&&(R=!0,D=w=4294967295)):(D=n.size,w=S6e(D)));let{diskOffset:Y,diskNumber:U,maxSize:J}=e.writer,K=k||D>=4294967295,ee=k||w>=4294967295,H=k||e.offset+e.pendingEntriesSize-Y>=4294967295,$=tr(e,i,"supportZip64SplitFile",!0)&&k||U+Math.ceil(e.pendingEntriesSize/J)>=65535;if(H||K||ee||$){if(R===!1||!Z)throw new Error(xJ);R=!0}R=R||!1,i=Object.assign({},i,{rawFilename:o,rawComment:s,version:a,versionMadeBy:c,lastModDate:d,lastAccessDate:u,creationDate:m,rawExtraField:E,zip64:R,zip64UncompressedSize:K,zip64CompressedSize:ee,zip64Offset:H,zip64DiskNumberStart:$,password:x,rawPassword:_,level:G,useWebWorkers:I,encryptionStrength:C,extendedTimestamp:L,zipCrypto:V,bufferedWrite:P,keepOrder:Z,dataDescriptor:b,dataDescriptorSignature:v,signal:F,msDosCompatible:p,internalFileAttribute:y,externalFileAttribute:f,useCompressionStream:M});let pe=p6e(i),ge=y6e(i),ae=zi(pe.localHeaderArray,ge.dataDescriptorArray);N=ae+w,e.options.usdz&&(N+=N+64),e.pendingEntriesSize+=N;let be;try{be=await h6e(e,t,n,{headerInfo:pe,dataDescriptorInfo:ge,metadataSize:ae},i)}finally{e.pendingEntriesSize-=N}return Object.assign(be,{name:t,comment:r,extraField:X}),new Hy(be)}async function h6e(e,t,n,i,o){let{files:r,writer:s}=e,{keepOrder:a,dataDescriptor:c,signal:d}=o,{headerInfo:u}=i,{usdz:m}=e.options,p=Array.from(r.values()).pop(),y={},f,x,_,C,V,L;r.set(t,y);try{let P;a&&(P=p&&p.lock,Z()),(o.bufferedWrite||e.writerLocked||e.bufferedWrites&&a||!c)&&!m?(L=new iT,L.writable.size=0,f=!0,e.bufferedWrites++,await Gf(s)):(L=s,await G()),await Gf(L);let{writable:v}=s,{diskOffset:F}=s;if(e.addSplitZipSignature){delete e.addSplitZipSignature;let b=new Uint8Array(4),R=Wa(b);Ki(R,0,134695760),await Ef(v,b),e.offset+=4}m&&b6e(i,e.offset-F),f||(await P,await I(v));let{diskNumber:M}=s;if(V=!0,y.diskNumberStart=M,y=await f6e(n,L,y,i,e.config,o),V=!1,r.set(t,y),y.filename=t,f){await L.writable.getWriter().close();let b=await L.getData();await P,await G(),C=!0,c||(b=await x6e(y,b,v,o)),await I(v),y.diskNumberStart=s.diskNumber,F=s.diskOffset,await b.stream().pipeTo(v,{preventClose:!0,preventAbort:!0,signal:d}),v.size+=b.size,C=!1}if(y.offset=e.offset-F,y.zip64)_6e(y,o);else if(y.offset>=4294967295)throw new Error(xJ);return e.offset+=y.size,y}catch(P){if(f&&C||!f&&V){if(e.hasCorruptedEntries=!0,P)try{P.corruptedEntry=!0}catch{}f?e.offset+=L.writable.size:e.offset=L.writable.size}throw r.delete(t),P}finally{f&&e.bufferedWrites--,_&&_(),x&&x()}function Z(){y.lock=new Promise(P=>_=P)}async function G(){e.writerLocked=!0;let{lockWriter:P}=e;e.lockWriter=new Promise(v=>x=()=>{e.writerLocked=!1,v()}),await P}async function I(P){zi(u.localHeaderArray)>s.availableSize&&(s.availableSize=0,await Ef(P,new Uint8Array))}}async function f6e(e,t,{diskNumberStart:n,lock:i},o,r,s){let{headerInfo:a,dataDescriptorInfo:c,metadataSize:d}=o,{localHeaderArray:u,headerArray:m,lastModDate:p,rawLastModDate:y,encrypted:f,compressed:x,version:_,compressionMethod:C,rawExtraFieldExtendedTimestamp:V,extraFieldExtendedTimestampFlag:L,rawExtraFieldNTFS:Z,rawExtraFieldAES:G}=a,{dataDescriptorArray:I}=c,{rawFilename:P,lastAccessDate:v,creationDate:F,password:M,rawPassword:b,level:R,zip64:E,zip64UncompressedSize:X,zip64CompressedSize:w,zip64Offset:N,zip64DiskNumberStart:D,zipCrypto:k,dataDescriptor:Y,directory:U,versionMadeBy:J,rawComment:K,rawExtraField:ee,useWebWorkers:H,onstart:j,onprogress:$,onend:pe,signal:ge,encryptionStrength:ae,extendedTimestamp:be,msDosCompatible:_e,internalFileAttribute:Ze,externalFileAttribute:Le,useCompressionStream:Ee}=s,He={lock:i,versionMadeBy:J,zip64:E,directory:!!U,filenameUTF8:!0,rawFilename:P,commentUTF8:!0,rawComment:K,rawExtraFieldExtendedTimestamp:V,rawExtraFieldNTFS:Z,rawExtraFieldAES:G,rawExtraField:ee,extendedTimestamp:be,msDosCompatible:_e,internalFileAttribute:Ze,externalFileAttribute:Le,diskNumberStart:n},we=0,dt=0,bt,{writable:it}=t;if(e){e.chunkSize=gU(r),await Ef(it,u);let _n=e.readable,kt=_n.size=e.size,At={options:{codecType:EU,level:R,rawPassword:b,password:M,encryptionStrength:ae,zipCrypto:f&&k,passwordVerification:f&&k&&y>>8&255,signed:!0,compressed:x,encrypted:f,useWebWorkers:H,useCompressionStream:Ee,transferStreams:!1},config:r,streamOptions:{signal:ge,size:kt,onstart:j,onprogress:$,onend:pe}},Te=await WU({readable:_n,writable:it},At);dt=Te.inputSize,we=Te.outputSize,bt=Te.signature,it.size+=dt}else await Ef(it,u);let en;if(E){let _n=4;X&&(_n+=8),w&&(_n+=8),N&&(_n+=8),D&&(_n+=4),en=new Uint8Array(_n)}else en=new Uint8Array;return g6e({signature:bt,rawExtraFieldZip64:en,compressedSize:we,uncompressedSize:dt,headerInfo:a,dataDescriptorInfo:c},s),Y&&await Ef(it,I),Object.assign(He,{uncompressedSize:dt,compressedSize:we,lastModDate:p,rawLastModDate:y,creationDate:F,lastAccessDate:v,encrypted:f,size:d+we,compressionMethod:C,version:_,headerArray:m,signature:bt,rawExtraFieldZip64:en,extraFieldExtendedTimestampFlag:L,zip64UncompressedSize:X,zip64CompressedSize:w,zip64Offset:N,zip64DiskNumberStart:D}),He}function p6e(e){let{rawFilename:t,lastModDate:n,lastAccessDate:i,creationDate:o,rawPassword:r,password:s,level:a,zip64:c,zipCrypto:d,dataDescriptor:u,directory:m,rawExtraField:p,encryptionStrength:y,extendedTimestamp:f}=e,x=a!==0&&!m,_=!!(s&&zi(s)||r&&zi(r)),C=e.version,V;if(_&&!d){V=new Uint8Array(zi(Ghe)+2);let D=Wa(V);uo(D,0,39169),Vs(V,Ghe,2),$U(D,8,y)}else V=new Uint8Array;let L,Z,G;if(f){Z=new Uint8Array(9+(i?4:0)+(o?4:0));let D=Wa(Z);uo(D,0,21589),uo(D,2,zi(Z)-4),G=1+(i?2:0)+(o?4:0),$U(D,4,G);let k=5;Ki(D,k,Math.floor(n.getTime()/1e3)),k+=4,i&&(Ki(D,k,Math.floor(i.getTime()/1e3)),k+=4),o&&Ki(D,k,Math.floor(o.getTime()/1e3));try{L=new Uint8Array(36);let Y=Wa(L),U=gJ(n);uo(Y,0,10),uo(Y,2,32),uo(Y,8,1),uo(Y,10,24),Ml(Y,12,U),Ml(Y,20,gJ(i)||U),Ml(Y,28,gJ(o)||U)}catch{L=new Uint8Array}}else L=Z=new Uint8Array;let I=2048;u&&(I=I|8);let P=0;x&&(P=8),c&&(C=C>45?C:45),_&&(I=I|1,d||(C=C>51?C:51,P=99,x&&(V[9]=8)));let v=new Uint8Array(26),F=Wa(v);uo(F,0,C),uo(F,2,I),uo(F,4,P);let M=new Uint32Array(1),b=Wa(M),R;n<Wz?R=Wz:n>Xz?R=Xz:R=n,uo(b,0,(R.getHours()<<6|R.getMinutes())<<5|R.getSeconds()/2),uo(b,2,(R.getFullYear()-1980<<4|R.getMonth()+1)<<5|R.getDate());let E=M[0];Ki(F,6,E),uo(F,22,zi(t));let X=zi(V,Z,L,p);uo(F,24,X);let w=new Uint8Array(30+zi(t)+X),N=Wa(w);return Ki(N,0,67324752),Vs(w,v,4),Vs(w,t,30),Vs(w,V,30+zi(t)),Vs(w,Z,30+zi(t,V)),Vs(w,L,30+zi(t,V,Z)),Vs(w,p,30+zi(t,V,Z,L)),{localHeaderArray:w,headerArray:v,headerView:F,lastModDate:n,rawLastModDate:E,encrypted:_,compressed:x,version:C,compressionMethod:P,extraFieldExtendedTimestampFlag:G,rawExtraFieldExtendedTimestamp:Z,rawExtraFieldNTFS:L,rawExtraFieldAES:V,extraFieldLength:X}}function b6e(e,t){let{headerInfo:n}=e,{localHeaderArray:i,extraFieldLength:o}=n,r=Wa(i),s=64-(t+zi(i))%64;s<4&&(s+=64);let a=new Uint8Array(s),c=Wa(a);uo(c,0,6534),uo(c,2,s-2);let d=i;n.localHeaderArray=i=new Uint8Array(zi(d)+s),Vs(i,d),Vs(i,a,zi(d)),r=Wa(i),uo(r,28,o+s),e.metadataSize+=s}function y6e(e){let{zip64:t,dataDescriptor:n,dataDescriptorSignature:i}=e,o=new Uint8Array,r,s=0;return n&&(o=new Uint8Array(t?i?24:20:i?16:12),r=Wa(o),i&&(s=4,Ki(r,0,134695760))),{dataDescriptorArray:o,dataDescriptorView:r,dataDescriptorOffset:s}}function g6e(e,t){let{signature:n,rawExtraFieldZip64:i,compressedSize:o,uncompressedSize:r,headerInfo:s,dataDescriptorInfo:a}=e,{headerView:c,encrypted:d}=s,{dataDescriptorView:u,dataDescriptorOffset:m}=a,{zip64:p,zip64UncompressedSize:y,zip64CompressedSize:f,zipCrypto:x,dataDescriptor:_}=t;if((!d||x)&&n!==er&&(Ki(c,10,n),_&&Ki(u,m,n)),p){let C=Wa(i);uo(C,0,1),uo(C,2,zi(i)-4);let V=4;y&&(Ki(c,18,4294967295),Ml(C,V,BigInt(r)),V+=8),f&&(Ki(c,14,4294967295),Ml(C,V,BigInt(o))),_&&(Ml(u,m+4,BigInt(o)),Ml(u,m+12,BigInt(r)))}else Ki(c,14,o),Ki(c,18,r),_&&(Ki(u,m+4,o),Ki(u,m+8,r))}async function x6e(e,t,n,{zipCrypto:i}){let o;o=await t.slice(0,26).arrayBuffer(),o.byteLength!=26&&(o=o.slice(0,26));let r=new DataView(o);return(!e.encrypted||i)&&Ki(r,14,e.signature),e.zip64?(Ki(r,18,4294967295),Ki(r,22,4294967295)):(Ki(r,18,e.compressedSize),Ki(r,22,e.uncompressedSize)),await Ef(n,new Uint8Array(o)),t.slice(o.byteLength)}function _6e(e,t){let{rawExtraFieldZip64:n,offset:i,diskNumberStart:o}=e,{zip64UncompressedSize:r,zip64CompressedSize:s,zip64Offset:a,zip64DiskNumberStart:c}=t,d=Wa(n),u=4;r&&(u+=8),s&&(u+=8),a&&(Ml(d,u,BigInt(i)),u+=8),c&&Ki(d,u,o)}async function T6e(e,t,n){let{files:i,writer:o}=e,{diskOffset:r,writable:s}=o,{diskNumber:a}=o,c=0,d=0,u=e.offset-r,m=i.size;for(let[,G]of i){let{rawFilename:I,rawExtraFieldZip64:P,rawExtraFieldAES:v,rawComment:F,rawExtraFieldNTFS:M,rawExtraField:b,extendedTimestamp:R,extraFieldExtendedTimestampFlag:E,lastModDate:X}=G,w;if(R){w=new Uint8Array(9);let N=Wa(w);uo(N,0,21589),uo(N,2,5),$U(N,4,E),Ki(N,5,Math.floor(X.getTime()/1e3))}else w=new Uint8Array;G.rawExtraFieldCDExtendedTimestamp=w,d+=46+zi(I,F,P,v,M,w,b)}let p=new Uint8Array(d),y=Wa(p);await Gf(o);let f=0;for(let[G,I]of Array.from(i.values()).entries()){let{offset:P,rawFilename:v,rawExtraFieldZip64:F,rawExtraFieldAES:M,rawExtraFieldCDExtendedTimestamp:b,rawExtraFieldNTFS:R,rawExtraField:E,rawComment:X,versionMadeBy:w,headerArray:N,directory:D,zip64:k,zip64UncompressedSize:Y,zip64CompressedSize:U,zip64DiskNumberStart:J,zip64Offset:K,msDosCompatible:ee,internalFileAttribute:H,externalFileAttribute:j,diskNumberStart:$,uncompressedSize:pe,compressedSize:ge}=I,ae=zi(F,M,b,R,E);Ki(y,c,33639248),uo(y,c+4,w);let be=Wa(N);Y||Ki(be,18,pe),U||Ki(be,14,ge),Vs(p,N,c+6),uo(y,c+30,ae),uo(y,c+32,zi(X)),uo(y,c+34,k&&J?65535:$),uo(y,c+36,H),j?Ki(y,c+38,j):D&&ee&&$U(y,c+38,16),Ki(y,c+42,k&&K?4294967295:P),Vs(p,v,c+46),Vs(p,F,c+46+zi(v)),Vs(p,M,c+46+zi(v,F)),Vs(p,b,c+46+zi(v,F,M)),Vs(p,R,c+46+zi(v,F,M,b)),Vs(p,E,c+46+zi(v,F,M,b,R)),Vs(p,X,c+46+zi(v)+ae);let _e=46+zi(v,X)+ae;if(c-f>o.availableSize&&(o.availableSize=0,await Ef(s,p.slice(f,c)),f=c),c+=_e,n.onprogress)try{await n.onprogress(G+1,i.size,new Hy(I))}catch{}}await Ef(s,f?p.slice(f):p);let x=o.diskNumber,{availableSize:_}=o;_<22&&x++;let C=tr(e,n,"zip64");if(u>=4294967295||d>=4294967295||m>=65535||x>=65535){if(C===!1)throw new Error(xJ);C=!0}let V=new Uint8Array(C?98:22),L=Wa(V);c=0,C&&(Ki(L,0,101075792),Ml(L,4,BigInt(44)),uo(L,12,45),uo(L,14,45),Ki(L,16,x),Ki(L,20,a),Ml(L,24,BigInt(m)),Ml(L,32,BigInt(m)),Ml(L,40,BigInt(d)),Ml(L,48,BigInt(u)),Ki(L,56,117853008),Ml(L,64,BigInt(u)+BigInt(d)),Ki(L,72,x+1),tr(e,n,"supportZip64SplitFile",!0)&&(x=65535,a=65535),m=65535,u=4294967295,d=4294967295,c+=76),Ki(L,c,101010256),uo(L,c+4,x),uo(L,c+6,a),uo(L,c+8,m),uo(L,c+10,m),Ki(L,c+12,d),Ki(L,c+16,u);let Z=zi(t);if(Z)if(Z<=65535)uo(L,c+20,Z);else throw new Error(s6e);await Ef(s,V),Z&&await Ef(s,t)}async function Ef(e,t){let n=e.getWriter();try{await n.ready,e.size+=zi(t),await n.write(t)}finally{n.releaseLock()}}function gJ(e){if(e)return(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4)}function tr(e,t,n,i){let o=t[n]===er?e.options[n]:t[n];return o===er?i:o}function S6e(e){return e+5*(Math.floor(e/16383)+1)}function $U(e,t,n){e.setUint8(t,n)}function uo(e,t,n){e.setUint16(t,n,!0)}function Ki(e,t,n){e.setUint32(t,n,!0)}function Ml(e,t,n){e.setBigUint64(t,n,!0)}function Vs(e,t,n){e.set(t,n)}function Wa(e){return new DataView(e.buffer)}function zi(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}Q1({Deflate:fme,Inflate:Fme});var _J=32,C6e="http://www.opengis.net/kml/2.2",hh="http://www.google.com/kml/ext/2.2",V6e="http://www.w3.org/2000/xmlns/";function ek(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var L6e=/^data:image\/([^,;]+)/;ek.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof Xe){if(e=Xe.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(L6e);n=`texture_${++this._count}`,l(i)&&(n+=`.${i[1]}`);let o=e.fetchBlob().then(function(r){t._files[n]=r});return this._promises.push(o),n}if(e instanceof HTMLCanvasElement){n=`texture_${++this._count}.png`;let i=new Promise(o=>{e.toBlob(function(r){t._files[n]=r,o()})});return this._promises.push(i),n}return""};function R6e(e,t){return function(n){e._files[t]=n}}ek.prototype.model=function(e,t){let n=this._modelCallback;if(!l(n))throw new me("Encountered a model entity while exporting to KML, but no model callback was supplied.");let i={},o=n(e,t,i);for(let r in i)if(i.hasOwnProperty(r)){let s=Promise.resolve(i[r]);this._promises.push(s),s.then(R6e(this,r))}return o};Object.defineProperties(ek.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function tk(e){this._time=e}tk.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),g(i,t)};tk.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return rT(n)};tk.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function TJ(){this._ids={},this._styles={},this._count=0}TJ.prototype.get=function(e){let t=this._ids,n=e.innerHTML;if(l(t[n]))return t[n];let i=`style-${++this._count}`;return e.setAttribute("id",i),i=`#${i}`,t[n]=i,this._styles[n]=e,i};TJ.prototype.save=function(e){let t=this._styles,n=e.childNodes[0];for(let i in t)t.hasOwnProperty(i)&&e.insertBefore(t[i],n)};function Phe(){this._ids={}}Phe.prototype.get=function(e){if(!l(e))return this.get(Hn());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function SJ(e){e=g(e,g.EMPTY_OBJECT);let t=e.entities,n=g(e.kmz,!1),i=SJ._createState(e),o=t.values.filter(function(d){return!l(d.parent)}),r=i.kmlDoc,s=r.documentElement;s.setAttributeNS(V6e,"xmlns:gx",hh);let a=r.createElement("Document");s.appendChild(a),whe(i,a,o),i.styleCache.save(a);let c=i.externalFileHandler;return c.promise.then(function(){let u=new XMLSerializer().serializeToString(i.kmlDoc);return n?Z6e(u,c.files):{kml:u,externalFiles:c.files}})}function Z6e(e,t){let n=on("ThirdParty/Workers/z-worker-pako.js");Q1({workerScripts:{deflate:[n,"./pako_deflate.min.js"],inflate:[n,"./pako_inflate.min.js"]}});let i=new iT,o=new qU(i);return o.add("doc.kml",new wU(e)).then(function(){let r=Object.keys(t);return vhe(o,r,t,0)}).then(function(){return o.close()}).then(function(r){return{kmz:r}})}function vhe(e,t,n,i){if(t.length===i)return;let o=t[i];return e.add(o,new M0(n[o])).then(function(){return vhe(e,t,n,i+1)})}SJ._createState=function(e){let t=e.entities,n=new TJ,i=t.computeAvailability(),o=l(e.time)?e.time:i.start,r=g(e.defaultAvailability,i),s=g(e.sampleDuration,60);r.start===Be.MINIMUM_VALUE?r.stop===Be.MAXIMUM_VALUE?r=new Ln:te.addSeconds(r.stop,-10*s,r.start):r.stop===Be.MAXIMUM_VALUE&&te.addSeconds(r.start,10*s,r.stop);let a=new ek(e.modelCallback);return{kmlDoc:document.implementation.createDocument(C6e,"kml"),ellipsoid:g(e.ellipsoid,oe.WGS84),idManager:new Phe,styleCache:n,externalFileHandler:a,time:o,valueGetter:new tk(o),sampleDuration:s,defaultAvailability:new Xr([r])}};function whe(e,t,n){let i=e.kmlDoc,o=e.styleCache,r=e.valueGetter,s=e.idManager,a=n.length,c,d,u;for(let m=0;m<a;++m){let p=n[m];c=[],d=[],u=[],G6e(e,p,d,u),E6e(e,p.polyline,d,u),Whe(e,p.rectangle,d,u,c),Whe(e,p.polygon,d,u,c),P6e(e,p,p.model,d,u);let y,f=p.availability;l(f)&&(y=i.createElement("TimeSpan"),te.equals(f.start,Be.MINIMUM_VALUE)||y.appendChild(bn(i,"begin",te.toIso8601(f.start))),te.equals(f.stop,Be.MAXIMUM_VALUE)||y.appendChild(bn(i,"end",te.toIso8601(f.stop))));for(let C=0;C<c.length;++C){let V=c[C];V.setAttribute("id",s.get(p.id)),V.appendChild(bn(i,"name",p.name)),V.appendChild(bn(i,"visibility",p.show)),V.appendChild(bn(i,"description",p.description)),l(y)&&V.appendChild(y),t.appendChild(V)}let x=d.length;if(x>0){let C=i.createElement("Placemark");C.setAttribute("id",s.get(p.id));let V=p.name,L=p.label;if(l(L)){let G=i.createElement("LabelStyle"),I=r.get(L.text);V=l(I)&&I.length>0?I:V;let P=r.getColor(L.fillColor);l(P)&&(G.appendChild(bn(i,"color",P)),G.appendChild(bn(i,"colorMode","normal")));let v=r.get(L.scale);l(v)&&G.appendChild(bn(i,"scale",v)),u.push(G)}C.appendChild(bn(i,"name",V)),C.appendChild(bn(i,"visibility",p.show)),C.appendChild(bn(i,"description",p.description)),l(y)&&C.appendChild(y),t.appendChild(C);let Z=u.length;if(Z>0){let G=i.createElement("Style");for(let I=0;I<Z;++I)G.appendChild(u[I]);C.appendChild(bn(i,"styleUrl",o.get(G)))}if(d.length===1)C.appendChild(d[0]);else if(d.length>1){let G=i.createElement("MultiGeometry");for(let I=0;I<x;++I)G.appendChild(d[I]);C.appendChild(G)}}let _=p._children;if(_.length>0){let C=i.createElement("Folder");C.setAttribute("id",s.get(p.id)),C.appendChild(bn(i,"name",p.name)),C.appendChild(bn(i,"visibility",p.show)),C.appendChild(bn(i,"description",p.description)),t.appendChild(C),whe(e,C,_)}}}var Nl=new h,qc=new he,mh=new te;function G6e(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter,a=g(t.billboard,t.point);if(!l(a)&&!l(t.path))return;let c=t.position;if(!c.isConstant){Fhe(e,t,a,n,i);return}s.get(c,void 0,Nl);let d=bn(o,"coordinates",oT(Nl,r)),u=o.createElement("Point"),m=o.createElement("altitudeMode");m.appendChild(sT(e,a.heightReference)),u.appendChild(m),u.appendChild(d),n.push(u);let p=a instanceof Da?Mhe(e,a):Ahe(e,a);i.push(p)}function Fhe(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,c,d=t.position,u=!0;d instanceof ra?(c=d.intervals,u=!1):c=g(t.availability,e.defaultAvailability);let m=n instanceof Lp,p,y,f,x=[];for(p=0;p<c.length;++p){let C=c.get(p),V=u?d:C.data,L=r.createElement("altitudeMode");V instanceof Cf?(V=V._value,L.appendChild(sT(e,Qe.CLAMP_TO_GROUND))):l(n)?L.appendChild(sT(e,n.heightReference)):L.appendChild(sT(e,Qe.NONE));let Z=[],G=[];if(V.isConstant){a.get(V,void 0,Nl);let P=bn(r,"coordinates",oT(Nl,s));Z.push(te.toIso8601(C.start)),G.push(P),Z.push(te.toIso8601(C.stop)),G.push(P)}else if(V instanceof aa)for(f=V._property._times,y=0;y<f.length;++y)Z.push(te.toIso8601(f[y])),V.getValueInReferenceFrame(f[y],ao.FIXED,Nl),G.push(oT(Nl,s));else if(V instanceof _d){f=V._times;let P=V._values;for(y=0;y<f.length;++y)Z.push(te.toIso8601(f[y])),h.fromArray(P,y*3,Nl),G.push(oT(Nl,s))}else{let P=e.sampleDuration;C.start.clone(mh),C.isStartIncluded||te.addSeconds(mh,P,mh);let v=C.stop;for(;te.lessThan(mh,v);)V.getValue(mh,Nl),Z.push(te.toIso8601(mh)),G.push(oT(Nl,s)),te.addSeconds(mh,P,mh);C.isStopIncluded&&te.equals(mh,v)&&(V.getValue(mh,Nl),Z.push(te.toIso8601(mh)),G.push(oT(Nl,s)))}let I=r.createElementNS(hh,"Track");I.appendChild(L);for(let P=0;P<Z.length;++P){let v=bn(r,"when",Z[P]),F=bn(r,"coord",G[P],hh);I.appendChild(v),I.appendChild(F)}m&&I.appendChild(Nhe(e,n)),x.push(I)}if(x.length===1)i.push(x[0]);else if(x.length>1){let C=r.createElementNS(hh,"MultiTrack");for(p=0;p<x.length;++p)C.appendChild(x[p]);i.push(C)}if(l(n)&&!m){let C=n instanceof Da?Mhe(e,n):Ahe(e,n);o.push(C)}let _=t.path;if(l(_)){let C=a.get(_.width),V=_.material;if(l(V)||l(C)){let L=r.createElement("LineStyle");l(C)&&L.appendChild(bn(r,"width",C)),CJ(e,V,L),o.push(L)}}}function Ahe(e,t){let n=e.kmlDoc,i=e.valueGetter,o=n.createElement("IconStyle"),r=i.getColor(t.color);l(r)&&(o.appendChild(bn(n,"color",r)),o.appendChild(bn(n,"colorMode","normal")));let s=i.get(t.pixelSize);return l(s)&&o.appendChild(bn(n,"scale",s/_J)),o}function Mhe(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("IconStyle"),s=i.get(t.image);if(l(s)){s=o.texture(s);let p=n.createElement("Icon");p.appendChild(bn(n,"href",s));let y=i.get(t.imageSubRegion);l(y)&&(p.appendChild(bn(n,"x",y.x,hh)),p.appendChild(bn(n,"y",y.y,hh)),p.appendChild(bn(n,"w",y.width,hh)),p.appendChild(bn(n,"h",y.height,hh))),r.appendChild(p)}let a=i.getColor(t.color);l(a)&&(r.appendChild(bn(n,"color",a)),r.appendChild(bn(n,"colorMode","normal")));let c=i.get(t.scale);l(c)&&r.appendChild(bn(n,"scale",c));let d=i.get(t.pixelOffset);if(l(d)){c=g(c,1),B.divideByScalar(d,c,d);let p=i.get(t.width,_J),y=i.get(t.height,_J),f=i.get(t.horizontalOrigin,bi.CENTER);f===bi.CENTER?d.x-=p*.5:f===bi.RIGHT&&(d.x-=p);let x=i.get(t.verticalOrigin,vn.CENTER);x===vn.TOP?d.y+=y:x===vn.CENTER&&(d.y+=y*.5);let _=n.createElement("hotSpot");_.setAttribute("x",-d.x),_.setAttribute("y",d.y),_.setAttribute("xunits","pixels"),_.setAttribute("yunits","pixels"),r.appendChild(_)}let u=i.get(t.rotation),m=i.get(t.alignedAxis);return l(u)&&h.equals(h.UNIT_Z,m)&&(u=W.toDegrees(-u),u===0&&(u=360),r.appendChild(bn(n,"heading",u))),r}function E6e(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter;if(!l(t))return;let a=o.createElement("LineString"),c=o.createElement("altitudeMode"),d=s.get(t.clampToGround,!1),u;d?(a.appendChild(bn(o,"tessellate",!0)),u=o.createTextNode("clampToGround")):u=o.createTextNode("absolute"),c.appendChild(u),a.appendChild(c);let m=t.positions,p=s.get(m),y=bn(o,"coordinates",oT(p,r));a.appendChild(y);let f=s.get(t.zIndex);d&&l(f)&&a.appendChild(bn(o,"drawOrder",f,hh)),n.push(a);let x=o.createElement("LineStyle"),_=s.get(t.width);l(_)&&x.appendChild(bn(o,"width",_)),CJ(e,t.material,x),i.push(x)}function I6e(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=o.get(t.height,0);n>0&&(r=n);let s=t.coordinates,a=o.get(s),c=[],d=[de.northeast,de.southeast,de.southwest,de.northwest];for(let y=0;y<4;++y)d[y](a,qc),c.push(`${W.toDegrees(qc.longitude)},${W.toDegrees(qc.latitude)},${r}`);let u=bn(i,"coordinates",c.join(" ")),m=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(u),m.appendChild(p),[m]}function Xhe(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=[],a=t.length;for(let u=0;u<a;++u)he.fromCartesian(t[u],r,qc),s.push(`${W.toDegrees(qc.longitude)},${W.toDegrees(qc.latitude)},${i?qc.height:n}`);let c=bn(o,"coordinates",s.join(" ")),d=o.createElement("LinearRing");return d.appendChild(c),d}function X6e(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=o.get(t.height,0),s=o.get(t.perPositionHeight,!1);!s&&n>0&&(r=n);let a=[],c=t.hierarchy,d=o.get(c),u=Array.isArray(d)?d:d.positions,m=i.createElement("outerBoundaryIs");m.appendChild(Xhe(e,u,r,s)),a.push(m);let p=d.holes;if(l(p)){let y=p.length;for(let f=0;f<y;++f){let x=i.createElement("innerBoundaryIs");x.appendChild(Xhe(e,p[f].positions,r,s)),a.push(x)}}return a}function Whe(e,t,n,i,o){let r=e.kmlDoc,s=e.valueGetter;if(!l(t))return;let a=t instanceof Vm;if(a&&s.getMaterialType(t.material)==="Image"){W6e(e,t,o);return}let c=r.createElement("Polygon"),d=s.get(t.extrudedHeight,0);d>0&&c.appendChild(bn(r,"extrude",!0));let u=a?I6e(e,t,d):X6e(e,t,d),m=u.length;for(let _=0;_<m;++_)c.appendChild(u[_]);let p=r.createElement("altitudeMode");p.appendChild(sT(e,t.heightReference)),c.appendChild(p),n.push(c);let y=r.createElement("PolyStyle"),f=s.get(t.fill,!1);f&&y.appendChild(bn(r,"fill",f)),CJ(e,t.material,y);let x=s.get(t.outline,!1);if(x){y.appendChild(bn(r,"outline",x));let _=r.createElement("LineStyle"),C=s.get(t.outlineWidth,1);_.appendChild(bn(r,"width",C));let V=s.getColor(t.outlineColor,O.BLACK);_.appendChild(bn(r,"color",V)),_.appendChild(bn(r,"colorMode","normal")),i.push(_)}i.push(y)}function W6e(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=e.externalFileHandler,s=i.createElement("GroundOverlay"),a=i.createElement("altitudeMode");a.appendChild(sT(e,t.heightReference)),s.appendChild(a);let c=o.get(t.height);l(c)&&s.appendChild(bn(i,"altitude",c));let d=o.get(t.coordinates),u=i.createElement("LatLonBox");u.appendChild(bn(i,"north",W.toDegrees(d.north))),u.appendChild(bn(i,"south",W.toDegrees(d.south))),u.appendChild(bn(i,"east",W.toDegrees(d.east))),u.appendChild(bn(i,"west",W.toDegrees(d.west))),s.appendChild(u);let m=o.get(t.material),p=r.texture(m.image),y=i.createElement("Icon");y.appendChild(bn(i,"href",p)),s.appendChild(y);let f=m.color;l(f)&&s.appendChild(bn(i,"color",rT(m.color))),n.push(s)}function Nhe(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("Model"),s=i.get(t.scale);if(l(s)){let d=n.createElement("scale");d.appendChild(bn(n,"x",s)),d.appendChild(bn(n,"y",s)),d.appendChild(bn(n,"z",s)),r.appendChild(d)}let a=n.createElement("Link"),c=o.model(t,e.time);return a.appendChild(bn(n,"href",c)),r.appendChild(a),r}function P6e(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter;if(!l(n))return;let c=t.position;if(!c.isConstant){Fhe(e,t,n,i,o);return}let d=Nhe(e,n),u=r.createElement("altitudeMode");u.appendChild(sT(e,n.heightReference)),d.appendChild(u),a.get(c,void 0,Nl),he.fromCartesian(Nl,s,qc);let m=r.createElement("Location");m.appendChild(bn(r,"longitude",W.toDegrees(qc.longitude))),m.appendChild(bn(r,"latitude",W.toDegrees(qc.latitude))),m.appendChild(bn(r,"altitude",qc.height)),d.appendChild(m),i.push(d)}function CJ(e,t,n){let i=e.kmlDoc,o=e.valueGetter;if(!l(t))return;let r=o.get(t);if(!l(r))return;let s,a=o.getMaterialType(t),c,d;switch(a){case"Image":s=rT(O.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":s=rT(r.color);break;case"PolylineOutline":s=rT(r.color),c=rT(r.outlineColor),d=r.outlineWidth,n.appendChild(bn(i,"outerColor",c,hh)),n.appendChild(bn(i,"outerWidth",d,hh));break;case"Stripe":s=rT(r.oddColor);break}l(s)&&(n.appendChild(bn(i,"color",s)),n.appendChild(bn(i,"colorMode","normal")))}function sT(e,t){let n=e.kmlDoc,o=e.valueGetter.get(t,Qe.NONE),r;switch(o){case Qe.NONE:r=n.createTextNode("absolute");break;case Qe.CLAMP_TO_GROUND:r=n.createTextNode("clampToGround");break;case Qe.RELATIVE_TO_GROUND:r=n.createTextNode("relativeToGround");break}return r}function oT(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let o=0;o<n;++o)he.fromCartesian(e[o],t,qc),i.push(`${W.toDegrees(qc.longitude)},${W.toDegrees(qc.latitude)},${qc.height}`);return i.join(" ")}function bn(e,t,n,i){n=g(n,""),typeof n=="boolean"&&(n=n?"1":"0");let o=l(i)?e.createElementNS(i,t):e.createElement(t),r=n==="string"&&n.indexOf("<")!==-1?e.createCDATASection(n):e.createTextNode(n);return o.appendChild(r),o}function rT(e){let t="",n=e.toBytes();for(let i=3;i>=0;--i)t+=n[i]<16?`0${n[i].toString(16)}`:n[i].toString(16);return t}var VJ=SJ;var iai=T(S(),1);var Wri=T(S(),1);function nv(){this._cache={}}nv.prototype.fromColor=function(e,t){return nk(void 0,void 0,e,t,this._cache)};nv.prototype.fromUrl=function(e,t,n){return nk(e,void 0,t,n,this._cache)};nv.prototype.fromMakiIconId=function(e,t,n){return nk(on(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};nv.prototype.fromText=function(e,t,n){return nk(void 0,e,t,n,this._cache)};var v6e=new O;function w6e(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,v6e).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 Uhe(e,t,n){let i=n/2.5,o=i,r=i;t.width>t.height?r=i*(t.height/t.width):t.width<t.height&&(o=i*(t.width/t.height));let s=Math.round((n-o)/2),a=Math.round(7/24*n-r/2);e.globalCompositeOperation="destination-out",e.drawImage(t,s-1,a,o,r),e.drawImage(t,s,a-1,o,r),e.drawImage(t,s+1,a,o,r),e.drawImage(t,s,a+1,o,r),e.globalCompositeOperation="destination-over",e.fillStyle=O.BLACK.toCssColorString(),e.fillRect(s-1,a-1,o+2,r+2),e.globalCompositeOperation="destination-out",e.drawImage(t,s,a,o,r),e.globalCompositeOperation="destination-over",e.fillStyle=O.WHITE.toCssColorString(),e.fillRect(s-1,a-2,o+2,r+2)}var tv=new Array(4);function nk(e,t,n,i,o){tv[0]=e,tv[1]=t,tv[2]=n,tv[3]=i;let r=JSON.stringify(tv),s=o[r];if(l(s))return s;let a=document.createElement("canvas");a.width=i,a.height=i;let c=a.getContext("2d");if(w6e(c,n,i),l(e)){let u=Xe.createIfNeeded(e).fetchImage().then(function(m){return Uhe(c,m,i),o[r]=a,a});return o[r]=u,u}else if(l(t)){let d=l_(t,{font:`bold ${i}px sans-serif`});Uhe(c,d,i)}return o[r]=a,a}var U0=nv;var Ssi=T(S());var Uri=T(S());var Ari=T(S());var vri=T(S());function LJ(e){return e}function ik(e){if(e==null)return LJ;var t,n,i=e.scale[0],o=e.scale[1],r=e.translate[0],s=e.translate[1];return function(a,c){c||(t=n=0);var d=2,u=a.length,m=new Array(u);for(m[0]=(t+=a[0])*i+r,m[1]=(n+=a[1])*o+s;d<u;)m[d]=a[d],++d;return m}}var Hri=T(S());var Dri=T(S());function khe(e,t){for(var n,i=e.length,o=i-t;o<--i;)n=e[o],e[o++]=e[i],e[i]=n}function RJ(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return Dhe(e,n)})}:Dhe(e,t)}function Dhe(e,t){var n=t.id,i=t.bbox,o=t.properties==null?{}:t.properties,r=ZJ(e,t);return n==null&&i==null?{type:"Feature",properties:o,geometry:r}:i==null?{type:"Feature",id:n,properties:o,geometry:r}:{type:"Feature",id:n,bbox:i,properties:o,geometry:r}}function ZJ(e,t){var n=ik(e.transform),i=e.arcs;function o(u,m){m.length&&m.pop();for(var p=i[u<0?~u:u],y=0,f=p.length;y<f;++y)m.push(n(p[y],y));u<0&&khe(m,f)}function r(u){return n(u)}function s(u){for(var m=[],p=0,y=u.length;p<y;++p)o(u[p],m);return m.length<2&&m.push(m[0]),m}function a(u){for(var m=s(u);m.length<4;)m.push(m[0]);return m}function c(u){return u.map(a)}function d(u){var m=u.type,p;switch(m){case"GeometryCollection":return{type:m,geometries:u.geometries.map(d)};case"Point":p=r(u.coordinates);break;case"MultiPoint":p=u.coordinates.map(r);break;case"LineString":p=s(u.arcs);break;case"MultiLineString":p=u.arcs.map(s);break;case"Polygon":p=c(u.arcs);break;case"MultiPolygon":p=u.arcs.map(c);break;default:return null}return{type:m,coordinates:p}}return d(t)}var qri=T(S());var zri=T(S());var nsi=T(S());var csi=T(S());var osi=T(S());var psi=T(S());var usi=T(S());function ok(e){return h.fromDegrees(e[0],e[1],e[2])}var GJ={"urn:ogc:def:crs:OGC:1.3:CRS84":ok,"EPSG:4326":ok,"urn:ogc:def:crs:EPSG::4326":ok},Bhe={},Ohe={},EJ=48,IJ,XJ=O.ROYALBLUE,WJ=O.YELLOW,PJ=2,vJ=O.fromBytes(255,255,0,100),wJ=!1,U6e={small:24,medium:48,large:64},k6e=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function Yhe(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||k6e.indexOf(i)!==-1)continue;let o=e[i];l(o)&&(typeof o=="object"?n+=`<tr><th>${i}</th><td>${Yhe(o)}</td></tr>`:n+=`<tr><th>${i}</th><td>${o}</td></tr>`)}return n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function D6e(e,t,n){let i;return function(o,r){return l(i)||(i=e(t,n)),i}}function B6e(e,t){return new Lm(D6e(Yhe,e,t),!0)}function rk(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=Hn();else{let s=2,a=i;for(;l(t.getById(a));)a=`${i}_${s}`,s++;i=a}let o=t.getOrCreateEntity(i),r=e.properties;if(l(r)){o.properties=r;let s,a=r.title;if(l(a))o.name=a,s="title";else{let d=Number.MAX_VALUE;for(let u in r)if(r.hasOwnProperty(u)&&r[u]){let m=u.toLowerCase();if(d>1&&m==="title"){d=1,s=u;break}else d>2&&m==="name"?(d=2,s=u):d>3&&/title/i.test(u)?(d=3,s=u):d>4&&/name/i.test(u)&&(d=4,s=u)}l(s)&&(o.name=r[s])}let c=r.description;c!==null&&(o.description=l(c)?new ei(c):n(r,s))}return o}function FJ(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var Hhe={Feature:zhe,FeatureCollection:O6e,GeometryCollection:Jhe,LineString:efe,MultiLineString:tfe,MultiPoint:qhe,MultiPolygon:ofe,Point:jhe,Polygon:ife,Topology:rfe},Khe={GeometryCollection:Jhe,LineString:efe,MultiLineString:tfe,MultiPoint:qhe,MultiPolygon:ofe,Point:jhe,Polygon:ife,Topology:rfe};function zhe(e,t,n,i,o){if(t.geometry===null){rk(t,e._entityCollection,o.describe);return}if(!l(t.geometry))throw new me("feature.geometry is required.");let r=t.geometry.type,s=Khe[r];if(!l(s))throw new me(`Unknown geometry type: ${r}`);s(e,t,t.geometry,i,o)}function O6e(e,t,n,i,o){let r=t.features;for(let s=0,a=r.length;s<a;s++)zhe(e,r[s],void 0,i,o)}function Jhe(e,t,n,i,o){let r=n.geometries;for(let s=0,a=r.length;s<a;s++){let c=r[s],d=c.type,u=Khe[d];if(!l(u))throw new me(`Unknown geometry type: ${d}`);u(e,t,c,i,o)}}function Qhe(e,t,n,i,o){let r=o.markerSymbol,s=o.markerColor,a=o.markerSize,c=t.properties;if(l(c)){let y=c["marker-color"];l(y)&&(s=O.fromCssColorString(y)),a=g(U6e[c["marker-size"]],a);let f=c["marker-symbol"];l(f)&&(r=f)}let d;l(r)?r.length===1?d=e._pinBuilder.fromText(r.toUpperCase(),s,a):d=e._pinBuilder.fromMakiIconId(r,s,a):d=e._pinBuilder.fromColor(s,a);let u=new Da;u.verticalOrigin=new ei(vn.BOTTOM),i.length===2&&o.clampToGround&&(u.heightReference=Qe.CLAMP_TO_GROUND);let m=rk(t,e._entityCollection,o.describe);m.billboard=u,m.position=new wc(n(i));let p=Promise.resolve(d).then(function(y){u.image=new ei(y)}).catch(function(){u.image=new ei(e._pinBuilder.fromColor(s,a))});e._promises.push(p)}function jhe(e,t,n,i,o){Qhe(e,t,i,n.coordinates,o)}function qhe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)Qhe(e,t,i,r[s],o)}function $he(e,t,n,i,o){let r=o.strokeMaterialProperty,s=o.strokeWidthProperty,a=t.properties;if(l(a)){let u=a["stroke-width"];l(u)&&(s=new ei(u));let m,p=a.stroke;l(p)&&(m=O.fromCssColorString(p));let y=a["stroke-opacity"];l(y)&&y!==1&&(l(m)||(m=r.color.getValue().clone()),m.alpha=y),l(m)&&(r=new Ut(m))}let c=rk(t,e._entityCollection,o.describe),d=new $a;c.polyline=d,d.clampToGround=o.clampToGround,d.material=r,d.width=s,d.positions=new ei(FJ(i,n)),d.arcType=jt.RHUMB}function efe(e,t,n,i,o){$he(e,t,i,n.coordinates,o)}function tfe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)$he(e,t,i,r[s],o)}function nfe(e,t,n,i,o){if(i.length===0||i[0].length===0)return;let r=o.strokeMaterialProperty.color,s=o.fillMaterialProperty,a=o.strokeWidthProperty,c=t.properties;if(l(c)){let y=c["stroke-width"];l(y)&&(a=new ei(y));let f,x=c.stroke;l(x)&&(f=O.fromCssColorString(x));let _=c["stroke-opacity"];l(_)&&_!==1&&(l(f)||(f=r.getValue().clone()),f.alpha=_),l(f)&&(r=new ei(f));let C,V=c.fill,L=s.color.getValue();l(V)&&(C=O.fromCssColorString(V),C.alpha=L.alpha),_=c["fill-opacity"],l(_)&&_!==L.alpha&&(l(C)||(C=L.clone()),C.alpha=_),l(C)&&(s=new Ut(C))}let d=new Cm;d.outline=new ei(!0),d.outlineColor=r,d.outlineWidth=a,d.material=s,d.arcType=jt.RHUMB;let u=[];for(let y=1,f=i.length;y<f;y++)u.push(new Va(FJ(i[y],n)));let m=i[0];d.hierarchy=new ei(new Va(FJ(m,n),u)),m[0].length>2?d.perPositionHeight=new ei(!0):o.clampToGround||(d.height=0);let p=rk(t,e._entityCollection,o.describe);p.polygon=d}function ife(e,t,n,i,o){nfe(e,t,i,n.coordinates,o)}function ofe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)nfe(e,t,i,r[s],o)}function rfe(e,t,n,i,o){for(let r in n.objects)if(n.objects.hasOwnProperty(r)){let s=RJ(n,n.objects[r]),a=Hhe[s.type];a(e,s,s,i,o)}}function Ky(e){this._name=e,this._changed=new ye,this._error=new ye,this._isLoading=!1,this._loading=new ye,this._entityCollection=new ks(this),this._promises=[],this._pinBuilder=new U0,this._entityCluster=new bd,this._credit=void 0,this._resourceCredits=[]}Ky.load=function(e,t){return new Ky().load(e,t)};Object.defineProperties(Ky,{markerSize:{get:function(){return EJ},set:function(e){EJ=e}},markerSymbol:{get:function(){return IJ},set:function(e){IJ=e}},markerColor:{get:function(){return XJ},set:function(e){XJ=e}},stroke:{get:function(){return WJ},set:function(e){WJ=e}},strokeWidth:{get:function(){return PJ},set:function(e){PJ=e}},fill:{get:function(){return vJ},set:function(e){vJ=e}},clampToGround:{get:function(){return wJ},set:function(e){wJ=e}},crsNames:{get:function(){return GJ}},crsLinkHrefs:{get:function(){return Bhe}},crsLinkTypes:{get:function(){return Ohe}}});Object.defineProperties(Ky.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}},credit:{get:function(){return this._credit}}});Ky.prototype.load=function(e,t){return sfe(this,e,t,!0)};Ky.prototype.process=function(e,t){return sfe(this,e,t,!1)};function sfe(e,t,n,i){Wr.setLoading(e,!0),n=g(n,g.EMPTY_OBJECT);let o=n.credit;typeof o=="string"&&(o=new Vt(o)),e._credit=o;let r=t,s=n.sourceUri;if(typeof t=="string"||t instanceof Xe){t=Xe.createIfNeeded(t),r=t.fetchJson(),s=g(s,t.getUrlComponent());let a=e._resourceCredits,c=t.credits;if(l(c)){let d=c.length;for(let u=0;u<d;u++)a.push(c[u])}}return n={describe:g(n.describe,B6e),markerSize:g(n.markerSize,EJ),markerSymbol:g(n.markerSymbol,IJ),markerColor:g(n.markerColor,XJ),strokeWidthProperty:new ei(g(n.strokeWidth,PJ)),strokeMaterialProperty:new Ut(g(n.stroke,WJ)),fillMaterialProperty:new Ut(g(n.fill,vJ)),clampToGround:g(n.clampToGround,wJ)},Promise.resolve(r).then(function(a){return Y6e(e,a,n,s,i)}).catch(function(a){throw Wr.setLoading(e,!1),e._error.raiseEvent(e,a),a})}Ky.prototype.update=function(e){return!0};function Y6e(e,t,n,i,o){let r;l(i)&&(r=V0(i)),l(r)&&e._name!==r&&(e._name=r,e._changed.raiseEvent(e));let s=Hhe[t.type];if(!l(s))throw new me(`Unsupported GeoJSON object type: ${t.type}`);let a=t.crs,c=a!==null?ok:null;if(l(a)){if(!l(a.properties))throw new me("crs.properties is undefined.");let d=a.properties;if(a.type==="name"){if(c=GJ[d.name],!l(c))throw new me(`Unknown crs name: ${d.name}`)}else if(a.type==="link"){let u=Bhe[d.href];if(l(u)||(u=Ohe[d.type]),!l(u))throw new me(`Unable to resolve crs link: ${JSON.stringify(d)}`);c=u(d)}else if(a.type==="EPSG"){if(c=GJ[`EPSG:${d.code}`],!l(c))throw new me(`Unknown crs EPSG code: ${d.code}`)}else throw new me(`Unknown crs type: ${a.type}`)}return Promise.resolve(c).then(function(d){return o&&e._entityCollection.removeAll(),d!==null&&s(e,t,t,d,n),Promise.all(e._promises).then(function(){return e._promises.length=0,Wr.setLoading(e,!1),e})})}var iv=Ky;var rai=T(S(),1);function H6e(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var Wn=H6e;var zli=T(S(),1);var cli=T(S());var Hci=T(S());var aai=T(S()),afe="4.0.0";var lai=T(S());function K6e(e){return e===void 0}function Ed(e){return typeof e=="boolean"}function cfe(e,t){for(var n in t)t.hasOwnProperty(n)&&K6e(e[n])&&(e[n]=t[n]);return e}function lfe(e,t,n){var i;return e.length>t&&(n==null?(n="&hellip;",i=3):i=n.length,e=e.substring(0,t-i)+n),e}function Bo(e,t){for(var n=e.length-1;n>=0;n--)e[n]===t&&e.splice(n,1)}function zy(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function Jy(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}var Gai=T(S());var pai=T(S());var mai=T(S()),Qy=/[A-Za-z]/,Bs=/[\d]/;var Id=/\s/,sk=/['"]/,dfe=/[\x00-\x1F\x7F]/,ufe=/A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source,z6e=/\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source,J6e=/\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source,Q6e=ufe+z6e+J6e,mfe=/0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source,dai=new RegExp("[".concat(ufe+mfe,"]")),AJ=Q6e+mfe,fh=new RegExp("[".concat(AJ,"]"));var ak=function(){function e(t){t===void 0&&(t={}),this.tagName="",this.attrs={},this.innerHTML="",this.tagName=t.tagName||"",this.attrs=t.attrs||{},this.innerHTML=t.innerHtml||t.innerHTML||""}return e.prototype.setTagName=function(t){return this.tagName=t,this},e.prototype.getTagName=function(){return this.tagName||""},e.prototype.setAttr=function(t,n){var i=this.getAttrs();return i[t]=n,this},e.prototype.getAttr=function(t){return this.getAttrs()[t]},e.prototype.setAttrs=function(t){return Object.assign(this.getAttrs(),t),this},e.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},e.prototype.setClass=function(t){return this.setAttr("class",t)},e.prototype.addClass=function(t){for(var n=this.getClass(),i=n?n.split(Id):[],o=t.split(Id),r;r=o.shift();)i.indexOf(r)===-1&&i.push(r);return this.getAttrs().class=i.join(" "),this},e.prototype.removeClass=function(t){for(var n=this.getClass(),i=n?n.split(Id):[],o=t.split(Id),r;i.length&&(r=o.shift());){var s=i.indexOf(r);s!==-1&&i.splice(s,1)}return this.getAttrs().class=i.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(t){return(" "+this.getClass()+" ").indexOf(" "+t+" ")!==-1},e.prototype.setInnerHTML=function(t){return this.innerHTML=t,this},e.prototype.setInnerHtml=function(t){return this.setInnerHTML(t)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var t=this.getTagName(),n=this.buildAttrsStr();return n=n?" "+n:"",["<",t,n,">",this.getInnerHtml(),"</",t,">"].join("")},e.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var t=this.getAttrs(),n=[];for(var i in t)t.hasOwnProperty(i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e}();var yai=T(S());function hfe(e,t,n){var i,o;n==null?(n="&hellip;",o=3,i=8):(o=n.length,i=n.length);var r=function(V){var L={},Z=V,G=Z.match(/^([a-z]+):\/\//i);return G&&(L.scheme=G[1],Z=Z.substr(G[0].length)),G=Z.match(/^(.*?)(?=(\?|#|\/|$))/i),G&&(L.host=G[1],Z=Z.substr(G[0].length)),G=Z.match(/^\/(.*?)(?=(\?|#|$))/i),G&&(L.path=G[1],Z=Z.substr(G[0].length)),G=Z.match(/^\?(.*?)(?=(#|$))/i),G&&(L.query=G[1],Z=Z.substr(G[0].length)),G=Z.match(/^#(.*?)$/i),G&&(L.fragment=G[1]),L},s=function(V){var L="";return V.scheme&&V.host&&(L+=V.scheme+"://"),V.host&&(L+=V.host),V.path&&(L+="/"+V.path),V.query&&(L+="?"+V.query),V.fragment&&(L+="#"+V.fragment),L},a=function(V,L){var Z=L/2,G=Math.ceil(Z),I=-1*Math.floor(Z),P="";return I<0&&(P=V.substr(I)),V.substr(0,G)+n+P};if(e.length<=t)return e;var c=t-o,d=r(e);if(d.query){var u=d.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);u&&(d.query=d.query.substr(0,u[1].length),e=s(d))}if(e.length<=t||(d.host&&(d.host=d.host.replace(/^www\./,""),e=s(d)),e.length<=t))return e;var m="";if(d.host&&(m+=d.host),m.length>=c)return d.host.length==t?(d.host.substr(0,t-o)+n).substr(0,c+i):a(m,c).substr(0,c+i);var p="";if(d.path&&(p+="/"+d.path),d.query&&(p+="?"+d.query),p)if((m+p).length>=c){if((m+p).length==t)return(m+p).substr(0,t);var y=c-m.length;return(m+a(p,y)).substr(0,c+i)}else m+=p;if(d.fragment){var f="#"+d.fragment;if((m+f).length>=c){if((m+f).length==t)return(m+f).substr(0,t);var x=c-m.length;return(m+a(f,x)).substr(0,c+i)}else m+=f}if(d.scheme&&d.host){var _=d.scheme+"://";if((m+_).length<c)return(_+m).substr(0,t)}if(m.length<=t)return m;var C="";return c>0&&(C=m.substr(-1*Math.floor(c/2))),(m.substr(0,Math.ceil(c/2))+n+C).substr(0,c+i)}var xai=T(S());function ffe(e,t,n){if(e.length<=t)return e;var i,o;n==null?(n="&hellip;",i=8,o=3):(i=n.length,o=n.length);var r=t-o,s="";return r>0&&(s=e.substr(-1*Math.floor(r/2))),(e.substr(0,Math.ceil(r/2))+n+s).substr(0,r+i)}var Sai=T(S());function pfe(e,t,n){return lfe(e,t,n)}var bfe=function(){function e(t){t===void 0&&(t={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=t.newWindow||!1,this.truncate=t.truncate||{},this.className=t.className||""}return e.prototype.build=function(t){return new ak({tagName:"a",attrs:this.createAttrs(t),innerHtml:this.processAnchorText(t.getAnchorText())})},e.prototype.createAttrs=function(t){var n={href:t.getAnchorHref()},i=this.createCssClass(t);return i&&(n.class=i),this.newWindow&&(n.target="_blank",n.rel="noopener noreferrer"),this.truncate&&this.truncate.length&&this.truncate.length<t.getAnchorText().length&&(n.title=t.getAnchorHref()),n},e.prototype.createCssClass=function(t){var n=this.className;if(n){for(var i=[n],o=t.getCssClassSuffixes(),r=0,s=o.length;r<s;r++)i.push(n+"-"+o[r]);return i.join(" ")}else return""},e.prototype.processAnchorText=function(t){return t=this.doTruncate(t),t},e.prototype.doTruncate=function(t){var n=this.truncate;if(!n||!n.length)return t;var i=n.length,o=n.location;return o==="smart"?hfe(t,i):o==="middle"?ffe(t,i):pfe(t,i)},e}();var Xci=T(S());var Bai=T(S());var Iai=T(S(),1),MJ=function(e,t){return MJ=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},MJ(e,t)};function If(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");MJ(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Os=function(){return Os=Object.assign||function(t){for(var n,i=1,o=arguments.length;i<o;i++){n=arguments[i];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Os.apply(this,arguments)};var Wai=T(S()),Xf=function(){function e(t){this._=null,this.matchedText="",this.offset=0,this.tagBuilder=t.tagBuilder,this.matchedText=t.matchedText,this.offset=t.offset}return e.prototype.getMatchedText=function(){return this.matchedText},e.prototype.setOffset=function(t){this.offset=t},e.prototype.getOffset=function(){return this.offset},e.prototype.getCssClassSuffixes=function(){return[this.type]},e.prototype.buildTag=function(){return this.tagBuilder.build(this)},e}();var Mai=T(S());var vai=T(S()),j6e="(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|verm\xF6gensberatung|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|verm\xF6gensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq480n2rg|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|travelchannel|wolterskluwer|xn--cckwcxetd|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--4dbrk0ce|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nextdirect|properties|protection|prudential|realestate|republican|restaurant|schaeffler|tatamotors|technology|university|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--q7ce6a|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--qxa6a|xn--tckwe|xn--vhquv|yodobashi|\u0645\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u0627|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|builders|business|capetown|catering|catholic|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|etisalat|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|training|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|\u0627\u0644\u0633\u0639\u0648\u062F\u064A\u0629|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|singles|staples|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|\u043A\u0430\u0442\u043E\u043B\u0438\u043A|\u0627\u062A\u0635\u0627\u0644\u0627\u062A|\u0627\u0644\u0628\u062D\u0631\u064A\u0646|\u0627\u0644\u062C\u0632\u0627\u0626\u0631|\u0627\u0644\u0639\u0644\u064A\u0627\u0646|\u067E\u0627\u06A9\u0633\u062A\u0627\u0646|\u0643\u0627\u062B\u0648\u0644\u064A\u0643|\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE|abarth|abbott|abbvie|africa|agency|airbus|airtel|alipay|alsace|alstom|amazon|anquan|aramco|author|bayern|beauty|berlin|bharti|bostik|boston|broker|camera|career|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|webcam|xihuan|yachts|yandex|zappos|\u043C\u043E\u0441\u043A\u0432\u0430|\u043E\u043D\u043B\u0430\u0439\u043D|\u0627\u0628\u0648\u0638\u0628\u064A|\u0627\u0631\u0627\u0645\u0643\u0648|\u0627\u0644\u0627\u0631\u062F\u0646|\u0627\u0644\u0645\u063A\u0631\u0628|\u0627\u0645\u0627\u0631\u0627\u062A|\u0641\u0644\u0633\u0637\u064A\u0646|\u0645\u0644\u064A\u0633\u064A\u0627|\u092D\u093E\u0930\u0924\u092E\u094D|\u0B87\u0BB2\u0B99\u0BCD\u0B95\u0BC8|\u30D5\u30A1\u30C3\u30B7\u30E7\u30F3|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|drive|dubai|earth|edeka|email|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|irish|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|loans|locus|lotte|lotto|macys|mango|media|miami|money|movie|music|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|\u05D9\u05E9\u05E8\u05D0\u05DC|\u0627\u06CC\u0631\u0627\u0646|\u0628\u0627\u0632\u0627\u0631|\u0628\u06BE\u0627\u0631\u062A|\u0633\u0648\u062F\u0627\u0646|\u0633\u0648\u0631\u064A\u0629|\u0647\u0645\u0631\u0627\u0647|\u092D\u093E\u0930\u094B\u0924|\u0938\u0902\u0917\u0920\u0928|\u09AC\u09BE\u0982\u09B2\u09BE|\u0C2D\u0C3E\u0C30\u0C24\u0C4D|\u0D2D\u0D3E\u0D30\u0D24\u0D02|\u5609\u91CC\u5927\u9152\u5E97|aarp|able|adac|aero|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kids|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|read|reit|rent|rest|rich|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|\u0434\u0435\u0442\u0438|\u0441\u0430\u0439\u0442|\u0628\u0627\u0631\u062A|\u0628\u064A\u062A\u0643|\u0680\u0627\u0631\u062A|\u062A\u0648\u0646\u0633|\u0634\u0628\u0643\u0629|\u0639\u0631\u0627\u0642|\u0639\u0645\u0627\u0646|\u0645\u0648\u0642\u0639|\u092D\u093E\u0930\u0924|\u09AD\u09BE\u09B0\u09A4|\u09AD\u09BE\u09F0\u09A4|\u0A2D\u0A3E\u0A30\u0A24|\u0AAD\u0ABE\u0AB0\u0AA4|\u0B2D\u0B3E\u0B30\u0B24|\u0CAD\u0CBE\u0CB0\u0CA4|\u0DBD\u0D82\u0D9A\u0DCF|\u30A2\u30DE\u30BE\u30F3|\u30B0\u30FC\u30B0\u30EB|\u30AF\u30E9\u30A6\u30C9|\u30DD\u30A4\u30F3\u30C8|\u7EC4\u7EC7\u673A\u6784|\u96FB\u8A0A\u76C8\u79D1|\u9999\u683C\u91CC\u62C9|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceo|cfa|cfd|com|cpa|crs|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gay|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|llp|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|spa|srl|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|\u0431\u0435\u043B|\u043A\u043E\u043C|\u049B\u0430\u0437|\u043C\u043A\u0434|\u043C\u043E\u043D|\u043E\u0440\u0433|\u0440\u0443\u0441|\u0441\u0440\u0431|\u0443\u043A\u0440|\u0570\u0561\u0575|\u05E7\u05D5\u05DD|\u0639\u0631\u0628|\u0642\u0637\u0631|\u0643\u0648\u0645|\u0645\u0635\u0631|\u0915\u0949\u092E|\u0928\u0947\u091F|\u0E04\u0E2D\u0E21|\u0E44\u0E17\u0E22|\u0EA5\u0EB2\u0EA7|\u30B9\u30C8\u30A2|\u30BB\u30FC\u30EB|\u307F\u3093\u306A|\u4E2D\u6587\u7F51|\u4E9A\u9A6C\u900A|\u5929\u4E3B\u6559|\u6211\u7231\u4F60|\u65B0\u52A0\u5761|\u6DE1\u9A6C\u9521|\u8BFA\u57FA\u4E9A|\u98DE\u5229\u6D66|ac|ad|ae|af|ag|ai|al|am|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|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|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|\u03B5\u03BB|\u03B5\u03C5|\u0431\u0433|\u0435\u044E|\u0440\u0444|\u10D2\u10D4|\uB2F7\uB137|\uB2F7\uCEF4|\uC0BC\uC131|\uD55C\uAD6D|\u30B3\u30E0|\u4E16\u754C|\u4E2D\u4FE1|\u4E2D\u56FD|\u4E2D\u570B|\u4F01\u4E1A|\u4F5B\u5C71|\u4FE1\u606F|\u5065\u5EB7|\u516B\u5366|\u516C\u53F8|\u516C\u76CA|\u53F0\u6E7E|\u53F0\u7063|\u5546\u57CE|\u5546\u5E97|\u5546\u6807|\u5609\u91CC|\u5728\u7EBF|\u5927\u62FF|\u5A31\u4E50|\u5BB6\u96FB|\u5E7F\u4E1C|\u5FAE\u535A|\u6148\u5584|\u624B\u673A|\u62DB\u8058|\u653F\u52A1|\u653F\u5E9C|\u65B0\u95FB|\u65F6\u5C1A|\u66F8\u7C4D|\u673A\u6784|\u6E38\u620F|\u6FB3\u9580|\u70B9\u770B|\u79FB\u52A8|\u7F51\u5740|\u7F51\u5E97|\u7F51\u7AD9|\u7F51\u7EDC|\u8054\u901A|\u8C37\u6B4C|\u8D2D\u7269|\u901A\u8CA9|\u96C6\u56E2|\u98DF\u54C1|\u9910\u5385|\u9999\u6E2F)",yfe=new RegExp("^"+j6e+"$");var q6e=/[\/?#]/,$6e=/[-+&@#/%=~_()|'$*\[\]{}\u2713]/,gfe=/[?!:,.;^]/,NJ=/https?:\/\//i,xfe=new RegExp("^"+NJ.source,"i"),_fe=new RegExp(gfe.source+"$"),eqe=/^(javascript|vbscript):/i,tqe=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/,nqe=/^(?:\/\/)?([^/#?:]+)/;function ck(e){return Qy.test(e)}function UJ(e){return Qy.test(e)||Bs.test(e)||e==="+"||e==="-"||e==="."}function k0(e){return fh.test(e)}function lk(e){return e==="_"||k0(e)}function kJ(e){return fh.test(e)||$6e.test(e)||gfe.test(e)}function dk(e){return q6e.test(e)}function DJ(e){return yfe.test(e.toLowerCase())}function Tfe(e){if(eqe.test(e))return!1;var t=e.match(tqe);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!Qy.test(i))}function Sfe(e){var t=e.match(nqe);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var o=i[i.length-1];return!!DJ(o)}var iqe=/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,oqe=/[:/?#]/;function Cfe(e){var t=e.split(oqe,1)[0];return iqe.test(t)}var rqe=/^(https?:\/\/)?(www\.)?/i,sqe=/^\/\//,Vfe=function(e){If(t,e);function t(n){var i=e.call(this,n)||this;return i.type="url",i.url="",i.urlMatchType="scheme",i.protocolRelativeMatch=!1,i.stripPrefix={scheme:!0,www:!0},i.stripTrailingSlash=!0,i.decodePercentEncoding=!0,i.protocolPrepended=!1,i.urlMatchType=n.urlMatchType,i.url=n.url,i.protocolRelativeMatch=n.protocolRelativeMatch,i.stripPrefix=n.stripPrefix,i.stripTrailingSlash=n.stripTrailingSlash,i.decodePercentEncoding=n.decodePercentEncoding,i}return t.prototype.getType=function(){return"url"},t.prototype.getUrlMatchType=function(){return this.urlMatchType},t.prototype.getUrl=function(){var n=this.url;return!this.protocolRelativeMatch&&this.urlMatchType!=="scheme"&&!this.protocolPrepended&&(n=this.url="http://"+n,this.protocolPrepended=!0),n},t.prototype.getAnchorHref=function(){var n=this.getUrl();return n.replace(/&amp;/g,"&")},t.prototype.getAnchorText=function(){var n=this.getMatchedText();return this.protocolRelativeMatch&&(n=lqe(n)),this.stripPrefix.scheme&&(n=aqe(n)),this.stripPrefix.www&&(n=cqe(n)),this.stripTrailingSlash&&(n=dqe(n)),this.decodePercentEncoding&&(n=uqe(n)),n},t}(Xf);function aqe(e){return e.replace(xfe,"")}function cqe(e){return e.replace(rqe,"$1")}function lqe(e){return e.replace(sqe,"")}function dqe(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function uqe(e){var t=e.replace(/%22/gi,"&quot;").replace(/%26/gi,"&amp;").replace(/%27/gi,"&#39;").replace(/%3C/gi,"&lt;").replace(/%3E/gi,"&gt;");try{return decodeURIComponent(t)}catch{return t}}var Kai=T(S());var Lfe=/^mailto:/i,mqe=new RegExp("[".concat(AJ,"!#$%&'*+/=?^_`{|}~-]"));function Rfe(e){return fh.test(e)}function uk(e){return mqe.test(e)}function Zfe(e){var t=e.split(".").pop()||"";return DJ(t)}var jai=T(S());var Gfe=function(e){If(t,e);function t(n){var i=e.call(this,n)||this;return i.type="email",i.email="",i.email=n.email,i}return t.prototype.getType=function(){return"email"},t.prototype.getEmail=function(){return this.email},t.prototype.getAnchorHref=function(){return"mailto:"+this.email},t.prototype.getAnchorText=function(){return this.email},t}(Xf);var eci=T(S());function BJ(e){return e==="_"||fh.test(e)}function Efe(e){return e.length<=140}var Ife=["twitter","facebook","instagram","tiktok"];var rci=T(S());var Xfe=function(e){If(t,e);function t(n){var i=e.call(this,n)||this;return i.type="hashtag",i.serviceName="twitter",i.hashtag="",i.serviceName=n.serviceName,i.hashtag=n.hashtag,i}return t.prototype.getType=function(){return"hashtag"},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getHashtag=function(){return this.hashtag},t.prototype.getAnchorHref=function(){var n=this.serviceName,i=this.hashtag;switch(n){case"twitter":return"https://twitter.com/hashtag/"+i;case"facebook":return"https://www.facebook.com/hashtag/"+i;case"instagram":return"https://instagram.com/explore/tags/"+i;case"tiktok":return"https://www.tiktok.com/tag/"+i;default:throw Jy(n),new Error("Invalid hashtag service: ".concat(n))}},t.prototype.getAnchorText=function(){return"#"+this.hashtag},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t}(Xf);var aci=T(S()),hqe={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/},fqe=/[-\w.]/;function OJ(e){return fqe.test(e)}function Wfe(e,t){var n=hqe[t];return n.test(e)}var Pfe=["twitter","instagram","soundcloud","tiktok"];var uci=T(S());var vfe=function(e){If(t,e);function t(n){var i=e.call(this,n)||this;return i.type="mention",i.serviceName="twitter",i.mention="",i.mention=n.mention,i.serviceName=n.serviceName,i}return t.prototype.getType=function(){return"mention"},t.prototype.getMention=function(){return this.mention},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;case"tiktok":return"https://www.tiktok.com/@"+this.mention;default:throw new Error("Unknown service name to point mention to: "+this.serviceName)}},t.prototype.getAnchorText=function(){return"@"+this.mention},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t}(Xf);var hci=T(S()),pqe=/[-. ]/,bqe=/[-. ()]/,yqe=/[,;]/,gqe=/(?:(?:(?:(\+)?\d{1,3}[-. ]?)?\(?\d{3}\)?[-. ]?\d{3}[-. ]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-. ]?(?:\d[-. ]?){6,12}\d+))([,;]+[0-9]+#?)*/,xqe=/(0([1-9]-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/,_qe=new RegExp("^".concat(gqe.source,"|").concat(xqe.source,"$"));function YJ(e){return pqe.test(e)}function mk(e){return yqe.test(e)}function wfe(e){var t=e.charAt(0)==="+"||bqe.test(e);return t&&_qe.test(e)}var yci=T(S());var Ffe=function(e){If(t,e);function t(n){var i=e.call(this,n)||this;return i.type="phone",i.number="",i.plusSign=!1,i.number=n.number,i.plusSign=n.plusSign,i}return t.prototype.getType=function(){return"phone"},t.prototype.getPhoneNumber=function(){return this.number},t.prototype.getNumber=function(){return this.getPhoneNumber()},t.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},t.prototype.getAnchorText=function(){return this.matchedText},t}(Xf);function Nfe(e,t){for(var n=t.tagBuilder,i=t.stripPrefix,o=t.stripTrailingSlash,r=t.decodePercentEncoding,s=t.hashtagServiceName,a=t.mentionServiceName,c=[],d=e.length,u=[],m=0;m<d;m++){var p=e.charAt(m);if(u.length===0)_(p);else for(var y=u.length-1;y>=0;y--){var f=u[y];switch(f.state){case 11:I(f,p);break;case 12:P(f,p);break;case 0:C(f,p);break;case 1:V(f,p);break;case 2:L(f,p);break;case 3:Z(f,p);break;case 4:G(f,p);break;case 5:v(f,p);break;case 6:F(f,p);break;case 7:M(f,p);break;case 13:b(f,p);break;case 14:R(f,p);break;case 8:E(f,p);break;case 9:X(f,p);break;case 10:w(f,p);break;case 15:N(f,p);break;case 16:D(f,p);break;case 17:k(f,p);break;case 18:Y(f,p);break;case 19:U(f,p);break;case 20:J(f,p);break;case 21:K(f,p);break;case 22:ee(f,p);break;case 23:H(f,p);break;case 24:j(f,p);break;case 25:$(f,p);break;case 26:pe(f,p);break;case 27:ge(f,p);break;case 28:ae(f,p);break;case 29:be(f,p);break;case 30:_e(f,p);break;case 31:Ze(f,p);break;case 32:Ee(f,p);break;case 33:He(f,p);break;case 34:we(f,p);break;case 35:dt(f,p);break;case 36:bt(f,p);break;case 37:Le(f,p);break;case 38:it(f,p);break;case 39:en(f,p);break;case 40:_n(f,p);break;case 41:kt(f,p);break;default:Jy(f.state)}}}for(var x=u.length-1;x>=0;x--)u.forEach(function(Te){return At(Te)});return c;function _(Te){if(Te==="#")u.push(Lqe(m,28));else if(Te==="@")u.push(Rqe(m,30));else if(Te==="/")u.push(KJ(m,11));else if(Te==="+")u.push(zJ(m,37));else if(Te==="(")u.push(zJ(m,32));else{if(Bs.test(Te)&&(u.push(zJ(m,38)),u.push(Cqe(m,13))),Rfe(Te)){var Re=Te.toLowerCase()==="m"?15:22;u.push(Vqe(m,Re))}ck(Te)&&u.push(HJ(m,0)),fh.test(Te)&&u.push(KJ(m,5))}}function C(Te,Re){Re===":"?Te.state=2:Re==="-"?Te.state=1:UJ(Re)||Bo(u,Te)}function V(Te,Re){Re==="-"||(Re==="/"?(Bo(u,Te),u.push(KJ(m,11))):UJ(Re)?Te.state=0:Bo(u,Te))}function L(Te,Re){Re==="/"?Te.state=3:Re==="."?Bo(u,Te):k0(Re)?(Te.state=5,ck(Re)&&u.push(HJ(m,0))):Bo(u,Te)}function Z(Te,Re){Re==="/"?Te.state=4:kJ(Re)?(Te.state=10,Te.acceptStateReached=!0):At(Te)}function G(Te,Re){Re==="/"?Te.state=10:k0(Re)?(Te.state=5,Te.acceptStateReached=!0):Bo(u,Te)}function I(Te,Re){Re==="/"?Te.state=12:Bo(u,Te)}function P(Te,Re){k0(Re)?Te.state=5:Bo(u,Te)}function v(Te,Re){Re==="."?Te.state=7:Re==="-"?Te.state=6:Re===":"?Te.state=8:dk(Re)?Te.state=10:lk(Re)||At(Te)}function F(Te,Re){Re==="-"||(Re==="."?At(Te):k0(Re)?Te.state=5:At(Te))}function M(Te,Re){Re==="."?At(Te):k0(Re)?(Te.state=5,Te.acceptStateReached=!0):At(Te)}function b(Te,Re){Re==="."?Te.state=14:Re===":"?Te.state=8:Bs.test(Re)||(dk(Re)?Te.state=10:fh.test(Re)?Bo(u,Te):At(Te))}function R(Te,Re){Bs.test(Re)?(Te.octetsEncountered++,Te.octetsEncountered===4&&(Te.acceptStateReached=!0),Te.state=13):At(Te)}function E(Te,Re){Bs.test(Re)?Te.state=9:At(Te)}function X(Te,Re){Bs.test(Re)||(dk(Re)?Te.state=10:At(Te))}function w(Te,Re){kJ(Re)||At(Te)}function N(Te,Re){Re.toLowerCase()==="a"?Te.state=16:ee(Te,Re)}function D(Te,Re){Re.toLowerCase()==="i"?Te.state=17:ee(Te,Re)}function k(Te,Re){Re.toLowerCase()==="l"?Te.state=18:ee(Te,Re)}function Y(Te,Re){Re.toLowerCase()==="t"?Te.state=19:ee(Te,Re)}function U(Te,Re){Re.toLowerCase()==="o"?Te.state=20:ee(Te,Re)}function J(Te,Re){Re.toLowerCase()===":"?Te.state=21:ee(Te,Re)}function K(Te,Re){uk(Re)?Te.state=22:Bo(u,Te)}function ee(Te,Re){Re==="."?Te.state=23:Re==="@"?Te.state=24:uk(Re)?Te.state=22:Bo(u,Te)}function H(Te,Re){Re==="."?Bo(u,Te):Re==="@"?Bo(u,Te):uk(Re)?Te.state=22:Bo(u,Te)}function j(Te,Re){k0(Re)?Te.state=25:Bo(u,Te)}function $(Te,Re){Re==="."?Te.state=27:Re==="-"?Te.state=26:lk(Re)||At(Te)}function pe(Te,Re){Re==="-"||Re==="."?At(Te):lk(Re)?Te.state=25:At(Te)}function ge(Te,Re){Re==="."||Re==="-"?At(Te):k0(Re)?(Te.state=25,Te.acceptStateReached=!0):At(Te)}function ae(Te,Re){BJ(Re)?(Te.state=29,Te.acceptStateReached=!0):Bo(u,Te)}function be(Te,Re){BJ(Re)||At(Te)}function _e(Te,Re){OJ(Re)?(Te.state=31,Te.acceptStateReached=!0):Bo(u,Te)}function Ze(Te,Re){OJ(Re)||(fh.test(Re)?Bo(u,Te):At(Te))}function Le(Te,Re){Bs.test(Re)?Te.state=38:(Bo(u,Te),_(Re))}function Ee(Te,Re){Bs.test(Re)?Te.state=33:Bo(u,Te),_(Re)}function He(Te,Re){Bs.test(Re)?Te.state=34:Bo(u,Te)}function we(Te,Re){Bs.test(Re)?Te.state=35:Bo(u,Te)}function dt(Te,Re){Re===")"?Te.state=36:Bo(u,Te)}function bt(Te,Re){Bs.test(Re)?Te.state=38:YJ(Re)?Te.state=39:Bo(u,Te)}function it(Te,Re){Te.acceptStateReached=!0,mk(Re)?Te.state=40:Re==="#"?Te.state=41:Bs.test(Re)||(Re==="("?Te.state=32:YJ(Re)?Te.state=39:(At(Te),ck(Re)&&u.push(HJ(m,0))))}function en(Te,Re){Bs.test(Re)?Te.state=38:Re==="("?Te.state=32:(At(Te),_(Re))}function _n(Te,Re){mk(Re)||(Re==="#"?Te.state=41:Bs.test(Re)?Te.state=38:At(Te))}function kt(Te,Re){mk(Re)?Te.state=40:Bs.test(Re)?Bo(u,Te):At(Te)}function At(Te){if(Bo(u,Te),!!Te.acceptStateReached){var Re=Te.startIdx,ct=e.slice(Te.startIdx,m);if(ct=Sqe(ct),Te.type==="url"){var Jt=e.charAt(Te.startIdx-1);if(Jt==="@")return;var mi=Te.matchType;if(mi==="scheme"){var Ke=NJ.exec(ct);if(Ke&&(Re=Re+Ke.index,ct=ct.slice(Ke.index)),!Tfe(ct))return}else if(mi==="tld"){if(!Sfe(ct))return}else if(mi==="ipV4"){if(!Cfe(ct))return}else Jy(mi);c.push(new Vfe({tagBuilder:n,matchedText:ct,offset:Re,urlMatchType:mi,url:ct,protocolRelativeMatch:ct.slice(0,2)==="//",stripPrefix:i,stripTrailingSlash:o,decodePercentEncoding:r}))}else if(Te.type==="email")Zfe(ct)&&c.push(new Gfe({tagBuilder:n,matchedText:ct,offset:Re,email:ct.replace(Lfe,"")}));else if(Te.type==="hashtag")Efe(ct)&&c.push(new Xfe({tagBuilder:n,matchedText:ct,offset:Re,serviceName:s,hashtag:ct.slice(1)}));else if(Te.type==="mention")Wfe(ct,a)&&c.push(new vfe({tagBuilder:n,matchedText:ct,offset:Re,serviceName:a,mention:ct.slice(1)}));else if(Te.type==="phone"){if(ct=ct.replace(/ +$/g,""),wfe(ct)){var $r=ct.replace(/[^0-9,;#]/g,"");c.push(new Ffe({tagBuilder:n,matchedText:ct,offset:Re,number:$r,plusSign:ct.charAt(0)==="+"}))}}else Jy(Te)}}}var Tqe=/[\(\{\[]/,Afe=/[\)\}\]]/,Mfe={")":"(","}":"{","]":"["};function Sqe(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n);Tqe.test(i)?t[i]++:Afe.test(i)&&t[Mfe[i]]--}for(var o=e.length-1,r;o>=0;)if(r=e.charAt(o),Afe.test(r)){var s=Mfe[r];if(t[s]<0)t[s]++,o--;else break}else if(_fe.test(r))o--;else break;return e.slice(0,o+1)}function HJ(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"scheme"}}function KJ(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"tld"}}function Cqe(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"ipV4",octetsEncountered:1}}function Vqe(e,t){return{type:"email",startIdx:e,state:t,acceptStateReached:!1}}function Lqe(e,t){return{type:"hashtag",startIdx:e,state:t,acceptStateReached:!1}}function Rqe(e,t){return{type:"mention",startIdx:e,state:t,acceptStateReached:!1}}function zJ(e,t){return{type:"phone",startIdx:e,state:t,acceptStateReached:!1}}var Fci=T(S());function Ufe(e,t){for(var n=t.onOpenTag,i=t.onCloseTag,o=t.onText,r=t.onComment,s=t.onDoctype,a=new Wf,c=0,d=e.length,u=0,m=0,p=a;c<d;){var y=e.charAt(c);switch(u){case 0:f(y);break;case 1:x(y);break;case 2:C(y);break;case 3:_(y);break;case 4:V(y);break;case 5:L(y);break;case 6:Z(y);break;case 7:G(y);break;case 8:I(y);break;case 9:P(y);break;case 10:v(y);break;case 11:F(y);break;case 12:M(y);break;case 13:b(y);break;case 14:R(y);break;case 15:E(y);break;case 16:X(y);break;case 17:w(y);break;case 18:N(y);break;case 19:D(y);break;case 20:k(y);break;default:Jy(u)}c++}m<c&&K();function f(j){j==="<"&&U()}function x(j){j==="!"?u=13:j==="/"?(u=2,p=new Wf(Os(Os({},p),{isClosing:!0}))):j==="<"?U():Qy.test(j)?(u=3,p=new Wf(Os(Os({},p),{isOpening:!0}))):(u=0,p=a)}function _(j){Id.test(j)?(p=new Wf(Os(Os({},p),{name:ee()})),u=4):j==="<"?U():j==="/"?(p=new Wf(Os(Os({},p),{name:ee()})),u=12):j===">"?(p=new Wf(Os(Os({},p),{name:ee()})),J()):!Qy.test(j)&&!Bs.test(j)&&j!==":"&&Y()}function C(j){j===">"?Y():Qy.test(j)?u=3:Y()}function V(j){Id.test(j)||(j==="/"?u=12:j===">"?J():j==="<"?U():j==="="||sk.test(j)||dfe.test(j)?Y():u=5)}function L(j){Id.test(j)?u=6:j==="/"?u=12:j==="="?u=7:j===">"?J():j==="<"?U():sk.test(j)&&Y()}function Z(j){Id.test(j)||(j==="/"?u=12:j==="="?u=7:j===">"?J():j==="<"?U():sk.test(j)?Y():u=5)}function G(j){Id.test(j)||(j==='"'?u=8:j==="'"?u=9:/[>=`]/.test(j)?Y():j==="<"?U():u=10)}function I(j){j==='"'&&(u=11)}function P(j){j==="'"&&(u=11)}function v(j){Id.test(j)?u=4:j===">"?J():j==="<"&&U()}function F(j){Id.test(j)?u=4:j==="/"?u=12:j===">"?J():j==="<"?U():(u=4,H())}function M(j){j===">"?(p=new Wf(Os(Os({},p),{isClosing:!0})),J()):u=4}function b(j){e.substr(c,2)==="--"?(c+=2,p=new Wf(Os(Os({},p),{type:"comment"})),u=14):e.substr(c,7).toUpperCase()==="DOCTYPE"?(c+=7,p=new Wf(Os(Os({},p),{type:"doctype"})),u=20):Y()}function R(j){j==="-"?u=15:j===">"?Y():u=16}function E(j){j==="-"?u=18:j===">"?Y():u=16}function X(j){j==="-"&&(u=17)}function w(j){j==="-"?u=18:u=16}function N(j){j===">"?J():j==="!"?u=19:j==="-"||(u=16)}function D(j){j==="-"?u=17:j===">"?J():u=16}function k(j){j===">"?J():j==="<"&&U()}function Y(){u=0,p=a}function U(){u=1,p=new Wf({idx:c})}function J(){var j=e.slice(m,p.idx);j&&o(j,m),p.type==="comment"?r(p.idx):p.type==="doctype"?s(p.idx):(p.isOpening&&n(p.name,p.idx),p.isClosing&&i(p.name,p.idx)),Y(),m=c+1}function K(){var j=e.slice(m,c);o(j,m),m=c+1}function ee(){var j=p.idx+(p.isClosing?2:1);return e.slice(j,c).toLowerCase()}function H(){c--}}var Wf=function(){function e(t){t===void 0&&(t={}),this.idx=t.idx!==void 0?t.idx:-1,this.type=t.type||"tag",this.name=t.name||"",this.isOpening=!!t.isOpening,this.isClosing=!!t.isClosing}return e}();var Zqe=function(){function e(t){t===void 0&&(t={}),this.version=e.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.tagBuilder=null,this.urls=Gqe(t.urls),this.email=Ed(t.email)?t.email:this.email,this.phone=Ed(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=Ed(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=Eqe(t.stripPrefix),this.stripTrailingSlash=Ed(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=Ed(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&Pfe.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&Ife.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=Iqe(t.truncate),this.className=t.className||this.className,this.replaceFn=t.replaceFn||this.replaceFn,this.context=t.context||this}return e.link=function(t,n){var i=new e(n);return i.link(t)},e.parse=function(t,n){var i=new e(n);return i.parse(t)},e.prototype.parse=function(t){var n=this,i=["a","style","script"],o=0,r=[];return Ufe(t,{onOpenTag:function(s){i.indexOf(s)>=0&&o++},onText:function(s,a){if(o===0){var c=/(&nbsp;|&#160;|&lt;|&#60;|&gt;|&#62;|&quot;|&#34;|&#39;)/gi,d=s.split(c),u=a;d.forEach(function(m,p){if(p%2===0){var y=n.parseText(m,u);r.push.apply(r,y)}u+=m.length})}},onCloseTag:function(s){i.indexOf(s)>=0&&(o=Math.max(o-1,0))},onComment:function(s){},onDoctype:function(s){}}),r=this.compactMatches(r),r=this.removeUnwantedMatches(r),r},e.prototype.compactMatches=function(t){t.sort(function(c,d){return c.getOffset()-d.getOffset()});for(var n=0;n<t.length-1;){var i=t[n],o=i.getOffset(),r=i.getMatchedText().length,s=o+r;if(n+1<t.length){if(t[n+1].getOffset()===o){var a=t[n+1].getMatchedText().length>r?n:n+1;t.splice(a,1);continue}if(t[n+1].getOffset()<s){t.splice(n+1,1);continue}}n++}return t},e.prototype.removeUnwantedMatches=function(t){return this.hashtag||zy(t,function(n){return n.getType()==="hashtag"}),this.email||zy(t,function(n){return n.getType()==="email"}),this.phone||zy(t,function(n){return n.getType()==="phone"}),this.mention||zy(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||zy(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||zy(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||zy(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="ipV4"}),t},e.prototype.parseText=function(t,n){n===void 0&&(n=0),n=n||0;for(var i=Nfe(t,{tagBuilder:this.getTagBuilder(),stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding,hashtagServiceName:this.hashtag,mentionServiceName:this.mention||"twitter"}),o=0,r=i.length;o<r;o++)i[o].setOffset(n+i[o].getOffset());return i},e.prototype.link=function(t){if(!t)return"";this.sanitizeHtml&&(t=t.replace(/</g,"&lt;").replace(/>/g,"&gt;"));for(var n=this.parse(t),i=[],o=0,r=0,s=n.length;r<s;r++){var a=n[r];i.push(t.substring(o,a.getOffset())),i.push(this.createMatchReturnVal(a)),o=a.getOffset()+a.getMatchedText().length}return i.push(t.substring(o)),i.join("")},e.prototype.createMatchReturnVal=function(t){var n;if(this.replaceFn&&(n=this.replaceFn.call(this.context,t)),typeof n=="string")return n;if(n===!1)return t.getMatchedText();if(n instanceof ak)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new bfe({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=afe,e}(),kfe=Zqe;function Gqe(e){return e==null&&(e=!0),Ed(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:Ed(e.schemeMatches)?e.schemeMatches:!0,tldMatches:Ed(e.tldMatches)?e.tldMatches:!0,ipV4Matches:Ed(e.ipV4Matches)?e.ipV4Matches:!0}}function Eqe(e){return e==null&&(e=!0),Ed(e)?{scheme:e,www:e}:{scheme:Ed(e.scheme)?e.scheme:!0,www:Ed(e.www)?e.www:!0}}function Iqe(e){return typeof e=="number"?{length:e,location:"end"}:cfe(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})}var Jci=T(S());var Kci=T(S());var oli=T(S());var hk=kfe;var Qfe;typeof DOMParser<"u"&&(Qfe=new DOMParser);var Xqe=new hk({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),fk=32,Dfe=2414016,Bfe=1,Ofe=16093e3,Yfe=.1,Wqe=[null,void 0,"http://www.topografix.com/GPX/1/1"],Go={gpx:Wqe};function Pqe(e){return new Promise((t,n)=>{let i=new FileReader;i.addEventListener("load",function(){t(i.result)}),i.addEventListener("error",function(){n(i.error)}),i.readAsText(e)})}function JJ(e,t){let n=sv(e,"id");return n=l(n)?n:Hn(),t.getOrCreateEntity(n)}function QJ(e){let t=Hfe(e,"lon"),n=Hfe(e,"lat"),i=ov(e,"ele",Go.gpx);return h.fromDegrees(t,n,i)}function Hfe(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function sv(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function jy(e,t,n){if(!l(e))return;let i=e.childNodes,o=i.length;for(let r=0;r<o;r++){let s=i[r];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function jJ(e,t,n){if(!l(e))return;let i=[],o=e.getElementsByTagName(t),r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function ov(e,t,n){let i=jy(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function Ul(e,t,n){let i=jy(e,t,n);if(l(i))return i.textContent.trim()}function jfe(e){let t=new Da;return t.width=fk,t.height=fk,t.scaleByDistance=new vt(Dfe,Bfe,Ofe,Yfe),t.pixelOffsetScaleByDistance=new vt(Dfe,Bfe,Ofe,Yfe),t.verticalOrigin=new ei(vn.BOTTOM),t.image=e,t}function vqe(){let e=new Sm;return e.translucencyByDistance=new vt(3e6,1,5e6,0),e.pixelOffset=new B(17,0),e.horizontalOrigin=bi.LEFT,e.font="16px sans-serif",e.style=No.FILL_AND_OUTLINE,e}function qfe(e){let t=new $a;return t.width=4,t.material=new Zy,t.material.color=l(e)?e:O.RED,t.material.outlineWidth=2,t.material.outlineColor=O.BLACK,t}var Kfe={time:{text:"Time",tag:"time"},comment:{text:"Comment",tag:"cmt"},description:{text:"Description",tag:"desc"},source:{text:"Source",tag:"src"},number:{text:"GPS track/route number",tag:"number"},type:{text:"Type",tag:"type"}},rv;typeof document<"u"&&(rv=document.createElement("div"));function qJ(e,t){let n,i="",o=Object.keys(Kfe),r=o.length;for(n=0;n<r;n++){let u=o[n],m=Kfe[u];m.value=g(Ul(e,m.tag,Go.gpx),""),l(m.value)&&m.value!==""&&(i=`${i}<p>${m.text}: ${m.value}</p>`)}if(!l(i)||i==="")return;i=Xqe.link(i),rv.innerHTML=i;let s=rv.querySelectorAll("a");for(n=0;n<s.length;n++)s[n].setAttribute("target","_blank");let a=O.WHITE,c=O.BLACK,d='<div class="cesium-infoBox-description-lighter" style="';return d+="overflow:auto;",d+="word-wrap:break-word;",d+=`background-color:${a.toCssColorString()};`,d+=`color:${c.toCssColorString()};`,d+='">',d+=`${rv.innerHTML}</div>`,rv.innerHTML="",d}function $fe(e,t,n,i){let o=QJ(t),r=JJ(t,n);r.position=o;let s=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",O.RED,fk);r.billboard=jfe(s);let a=Ul(t,"name",Go.gpx);r.name=a,r.label=vqe(),r.label.text=a,r.description=qJ(t,r),i.clampToGround&&(r.billboard.heightReference=Qe.CLAMP_TO_GROUND,r.label.heightReference=Qe.CLAMP_TO_GROUND)}function wqe(e,t,n,i){let o=JJ(t,n);o.description=qJ(t,o);let r=jJ(t,"rtept",Go.gpx),s=new Array(r.length);for(let a=0;a<r.length;a++)$fe(e,r[a],n,i),s[a]=QJ(r[a]);o.polyline=qfe(i.routeColor),i.clampToGround&&(o.polyline.clampToGround=!0),o.polyline.positions=s}function Fqe(e,t,n,i){let o=JJ(t,n);o.description=qJ(t,o);let r=jJ(t,"trkseg",Go.gpx),s=[],a=[],c,d=!0,u=new aa;for(let m=0;m<r.length;m++)c=Aqe(r[m]),s=s.concat(c.positions),c.times.length>0?(a=a.concat(c.times),u.addSamples(a,s),d=d&&!0):d=!1;if(d){let m=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",O.RED,fk);o.billboard=jfe(m),o.position=u,i.clampToGround&&(o.billboard.heightReference=Qe.CLAMP_TO_GROUND),o.availability=new Xr,o.availability.addInterval(new Ln({start:a[0],stop:a[a.length-1]}))}o.polyline=qfe(i.trackColor),o.polyline.positions=s,i.clampToGround&&(o.polyline.clampToGround=!0)}function Aqe(e){let t={positions:[],times:[]},n=jJ(e,"trkpt",Go.gpx),i;for(let o=0;o<n.length;o++){let r=QJ(n[o]);t.positions.push(r),i=Ul(n[o],"time",Go.gpx),l(i)&&t.times.push(te.fromIso8601(i))}return t}function Mqe(e){let t=jy(e,"metadata",Go.gpx);if(l(t)){let n={name:Ul(t,"name",Go.gpx),desc:Ul(t,"desc",Go.gpx),author:Nqe(t),copyright:kqe(t),link:epe(t),time:Ul(t,"time",Go.gpx),keywords:Ul(t,"keywords",Go.gpx),bounds:Dqe(t)};if(l(n.name)||l(n.desc)||l(n.author)||l(n.copyright)||l(n.link)||l(n.time)||l(n.keywords)||l(n.bounds))return n}}function Nqe(e){let t=jy(e,"author",Go.gpx);if(l(t)){let n={name:Ul(t,"name",Go.gpx),email:Uqe(t),link:epe(t)};if(l(n.name)||l(n.email)||l(n.link))return n}}function Uqe(e){let t=jy(e,"email",Go.gpx);if(l(t)){let n=Ul(t,"id",Go.gpx),i=Ul(t,"domain",Go.gpx);return`${n}@${i}`}}function epe(e){let t=jy(e,"link",Go.gpx);if(l(t)){let n={href:sv(t,"href"),text:Ul(t,"text",Go.gpx),mimeType:Ul(t,"type",Go.gpx)};if(l(n.href)||l(n.text)||l(n.mimeType))return n}}function kqe(e){let t=jy(e,"copyright",Go.gpx);if(l(t)){let n={author:sv(t,"author"),year:Ul(t,"year",Go.gpx),license:Ul(t,"license",Go.gpx)};if(l(n.author)||l(n.year)||l(n.license))return n}}function Dqe(e){let t=jy(e,"bounds",Go.gpx);if(l(t)){let n={minLat:ov(t,"minlat",Go.gpx),maxLat:ov(t,"maxlat",Go.gpx),minLon:ov(t,"minlon",Go.gpx),maxLon:ov(t,"maxlon",Go.gpx)};if(l(n.minLat)||l(n.maxLat)||l(n.minLon)||l(n.maxLon))return n}}var zfe={wpt:$fe,rte:wqe,trk:Fqe};function Bqe(e,t,n,i){let o=Object.keys(zfe),r=o.length;for(let s=0;s<r;s++){let a=o[s],c=zfe[a],d=t.childNodes,u=d.length;for(let m=0;m<u;m++){let p=d[m];p.localName===a&&Go.gpx.indexOf(p.namespaceURI)!==-1&&c(e,p,n,i)}}}function Jfe(e,t,n){let i=e._entityCollection;i.removeAll();let o=t.documentElement,r=sv(o,"version"),s=sv(o,"creator"),a,c=Mqe(o);l(c)&&(a=c.name),o.localName==="gpx"?Bqe(e,o,i,n):console.log(`GPX - Unsupported node: ${o.localName}`);let d,u=i.computeAvailability(),m=u.start,p=u.stop,y=te.equals(m,Be.MINIMUM_VALUE),f=te.equals(p,Be.MAXIMUM_VALUE);if(!y||!f){let _;y&&(_=new Date,_.setHours(0,0,0,0),m=te.fromDate(_)),f&&(_=new Date,_.setHours(24,0,0,0),p=te.fromDate(_)),d=new th,d.startTime=m,d.stopTime=p,d.currentTime=te.clone(m),d.clockRange=vr.LOOP_STOP,d.clockStep=yo.SYSTEM_CLOCK_MULTIPLIER,d.multiplier=Math.round(Math.min(Math.max(te.secondsDifference(p,m)/60,1),31556900))}let x=!1;return e._name!==a&&(e._name=a,x=!0),e._creator!==s&&(e._creator=s,x=!0),Oqe(e._metadata,c)&&(e._metadata=c,x=!0),e._version!==r&&(e._version=r,x=!0),d!==e._clock&&(x=!0,e._clock=d),x&&e._changed.raiseEvent(e),Wr.setLoading(e,!1),e}function Oqe(e,t){return!l(e)&&!l(t)?!1:l(e)&&l(t)?e.name!==t.name||e.dec!==t.desc||e.src!==t.src||e.author!==t.author||e.copyright!==t.copyright||e.link!==t.link||e.time!==t.time||e.bounds!==t.bounds:!0}function Yqe(e,t,n,i){i=g(i,g.EMPTY_OBJECT);let o=n;if(typeof n=="string"||n instanceof Xe){n=Xe.createIfNeeded(n),o=n.fetchBlob();let r=e._resourceCredits,s=n.credits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)r.push(s[c])}}return Promise.resolve(o).then(function(r){return r instanceof Blob?Pqe(r).then(function(s){let a,c;try{a=Qfe.parseFromString(s,"application/xml")}catch(d){c=d.toString()}if(l(c)||a.body||a.documentElement.tagName==="parsererror"){let d=l(c)?c:a.documentElement.firstChild.nodeValue;throw d||(d=a.body.innerText),new me(d)}return Jfe(e,a,i)}):Jfe(e,r,i)}).catch(function(r){return e._error.raiseEvent(e,r),console.log(r),Promise.reject(r)})}function oV(){this._changed=new ye,this._error=new ye,this._loading=new ye,this._clock=void 0,this._entityCollection=new ks(this),this._entityCluster=new bd,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new U0}oV.load=function(e,t){return new oV().load(e,t)};Object.defineProperties(oV.prototype,{name:{get:function(){return this._name}},version:{get:function(){return this._version}},creator:{get:function(){return this._creator}},metadata:{get:function(){return this._metadata}},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}}});oV.prototype.update=function(e){return!0};oV.prototype.load=function(e,t){if(!l(e))throw new fe("data is required.");t=g(t,g.EMPTY_OBJECT),Wr.setLoading(this,!0);let n=this._name,i=this;return Yqe(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,c=te.equals(s,Be.MINIMUM_VALUE),d=te.equals(a,Be.MAXIMUM_VALUE);if(!c||!d){let m;c&&(m=new Date,m.setHours(0,0,0,0),s=te.fromDate(m)),d&&(m=new Date,m.setHours(24,0,0,0),a=te.fromDate(m)),o=new th,o.startTime=s,o.stopTime=a,o.currentTime=te.clone(s),o.clockRange=vr.LOOP_STOP,o.clockStep=yo.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(te.secondsDifference(a,s)/60,1),31556900))}let u=!1;return o!==i._clock&&(i._clock=o,u=!0),n!==i._name&&(u=!0),u&&i._changed.raiseEvent(i),Wr.setLoading(i,!1),i}).catch(function(o){return Wr.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};var av=oV;var Qli=T(S(),1);function Hqe(e,t){this.position=e,this.headingPitchRoll=t}var cv=Hqe;var Fui=T(S(),1);var fv=T($l(),1);var qli=T(S(),1);function Kqe(e,t){this.position=e,this.headingPitchRange=t}var lv=Kqe;var ndi=T(S(),1);function pk(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new ye,this.tourEnd=new ye,this.entryStart=new ye,this.entryEnd=new ye,this._activeEntries=[]}pk.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};pk.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;npe.call(this,e,t,function(i){n.playlistIndex=0,i||tpe(n._activeEntries),n.tourEnd.raiseEvent(i)})};pk.prototype.stop=function(){tpe(this._activeEntries)};function tpe(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function npe(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let o=zqe.bind(this,e,t,n);if(this._activeEntries.push(i),this.entryStart.raiseEvent(i),i.blocking)i.play(o,e.scene.camera,t);else{let r=this;i.play(function(){r.entryEnd.raiseEvent(i);let s=r._activeEntries.indexOf(i);s>=0&&r._activeEntries.splice(s,1)}),o(e,t,n)}}else l(n)&&n(!1)}function zqe(e,t,n,i){let o=this.playlist[this.playlistIndex];if(this.entryEnd.raiseEvent(o,i),i)n(i);else{let r=this._activeEntries.indexOf(o);r>=0&&this._activeEntries.splice(r,1),this.playlistIndex++,npe.call(this,e,t,n)}}var dv=pk;var xdi=T(S(),1);var hdi=T(S(),1);var ddi=T(S(),1),Xi=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return this.None(e)},Out:function(e){return this.None(e)},InOut:function(e){return this.None(e)}}),Quadratic:Object.freeze({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:Object.freeze({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:Object.freeze({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:Object.freeze({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:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}}),Circular:Object.freeze({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:Object.freeze({In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(e){var t=1.70158;return e===1?1:e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return e===0?0:--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)}}),Bounce:Object.freeze({In:function(e){return 1-Xi.Bounce.Out(1-e)},Out:function(e){return e<.36363636363636365?7.5625*e*e:e<.7272727272727273?7.5625*(e-=.5454545454545454)*e+.75:e<.9090909090909091?7.5625*(e-=.8181818181818182)*e+.9375:7.5625*(e-=.9545454545454546)*e+.984375},InOut:function(e){return e<.5?Xi.Bounce.In(e*2)*.5:Xi.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e<Number.EPSILON?Number.EPSILON:e,e=e>1e4?1e4:e,{In:function(t){return Math.pow(t,e)},Out:function(t){return 1-Math.pow(1-t,e)},InOut:function(t){return t<.5?Math.pow(t*2,e)/2:(1-Math.pow(2-t*2,e))/2+.5}}}}),uv=function(){return performance.now()},Jqe=function(){function e(){this._tweens={},this._tweensAddedDuringUpdate={}}return e.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(n){return t._tweens[n]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},e.prototype.remove=function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},e.prototype.update=function(t,n){t===void 0&&(t=uv()),n===void 0&&(n=!1);var i=Object.keys(this._tweens);if(i.length===0)return!1;for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var o=0;o<i.length;o++){var r=this._tweens[i[o]],s=!n;r&&r.update(t,s)===!1&&!n&&delete this._tweens[i[o]]}i=Object.keys(this._tweensAddedDuringUpdate)}return!0},e}(),rV={Linear:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=rV.Utils.Linear;return t<0?r(e[0],e[1],i):t>1?r(e[n],e[n-1],n-i):r(e[o],e[o+1>n?n:o+1],i-o)},Bezier:function(e,t){for(var n=0,i=e.length-1,o=Math.pow,r=rV.Utils.Bernstein,s=0;s<=i;s++)n+=o(1-t,i-s)*o(t,s)*e[s]*r(i,s);return n},CatmullRom:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=rV.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(o=Math.floor(i=n*(1+t))),r(e[(o-1+n)%n],e[o],e[(o+1)%n],e[(o+2)%n],i-o)):t<0?e[0]-(r(e[0],e[0],e[1],e[1],-i)-e[0]):t>1?e[n]-(r(e[n],e[n],e[n-1],e[n-1],i-n)-e[n]):r(e[o?o-1:0],e[o],e[n<o+1?n:o+1],e[n<o+2?n:o+2],i-o)},Utils:{Linear:function(e,t,n){return(t-e)*n+e},Bernstein:function(e,t){var n=rV.Utils.Factorial;return n(e)/n(t)/n(e-t)},Factorial:function(){var e=[1];return function(t){var n=1;if(e[t])return e[t];for(var i=t;i>1;i--)n*=i;return e[t]=n,n}}(),CatmullRom:function(e,t,n,i,o){var r=(n-e)*.5,s=(i-t)*.5,a=o*o,c=o*a;return(2*t-2*n+r+s)*c+(-3*t+3*n-2*r-s)*a+r*o+t}}},ipe=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),$J=new Jqe,ope=function(){function e(t,n){n===void 0&&(n=$J),this._object=t,this._group=n,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Xi.Linear.None,this._interpolationFunction=rV.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=ipe.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(t,n){if(n===void 0&&(n=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=n<0?0:n,this},e.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t<0?0:t,this},e.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},e.prototype.start=function(t,n){if(t===void 0&&(t=uv()),n===void 0&&(n=!1),this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||n){if(this._propertiesAreSetUp=!0,!this._isDynamic){var o={};for(var r in this._valuesEnd)o[r]=this._valuesEnd[r];this._valuesEnd=o}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,n)}return this},e.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},e.prototype._setupProperties=function(t,n,i,o,r){for(var s in i){var a=t[s],c=Array.isArray(a),d=c?"array":typeof a,u=!c&&Array.isArray(i[s]);if(!(d==="undefined"||d==="function")){if(u){var m=i[s];if(m.length===0)continue;for(var p=[a],y=0,f=m.length;y<f;y+=1){var x=this._handleRelativeValue(a,m[y]);if(isNaN(x)){u=!1,console.warn("Found invalid interpolation list. Skipping.");break}p.push(x)}u&&(i[s]=p)}if((d==="object"||c)&&a&&!u){n[s]=c?[]:{};var _=a;for(var C in _)n[s][C]=_[C];o[s]=c?[]:{};var m=i[s];if(!this._isDynamic){var V={};for(var C in m)V[C]=m[C];i[s]=m=V}this._setupProperties(_,n[s],m,o[s],r)}else(typeof n[s]>"u"||r)&&(n[s]=a),c||(n[s]*=1),u?o[s]=i[s].slice().reverse():o[s]=n[s]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},e.prototype.pause=function(t){return t===void 0&&(t=uv()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this._group&&this._group.remove(this),this)},e.prototype.resume=function(t){return t===void 0&&(t=uv()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this)},e.prototype.stopChainedTweens=function(){for(var t=0,n=this._chainedTweens.length;t<n;t++)this._chainedTweens[t].stop();return this},e.prototype.group=function(t){return t===void 0&&(t=$J),this._group=t,this},e.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},e.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},e.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},e.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},e.prototype.easing=function(t){return t===void 0&&(t=Xi.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=rV.Linear),this._interpolationFunction=t,this},e.prototype.chain=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this._chainedTweens=t,this},e.prototype.onStart=function(t){return this._onStartCallback=t,this},e.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},e.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},e.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},e.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},e.prototype.onStop=function(t){return this._onStopCallback=t,this},e.prototype.update=function(t,n){var i=this,o;if(t===void 0&&(t=uv()),n===void 0&&(n=!0),this._isPaused)return!0;var r,s=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(t>s)return!1;n&&this.start(t,!0)}if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var a=t-this._startTime,c=this._duration+((o=this._repeatDelayTime)!==null&&o!==void 0?o:this._delayTime),d=this._duration+this._repeat*c,u=function(){if(i._duration===0||a>d)return 1;var _=Math.trunc(a/c),C=a-_*c,V=Math.min(C/i._duration,1);return V===0&&a===i._duration?1:V},m=u(),p=this._easingFunction(m);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,p),this._onUpdateCallback&&this._onUpdateCallback(this._object,m),this._duration===0||a>=this._duration)if(this._repeat>0){var y=Math.min(Math.trunc((a-this._duration)/c)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=y);for(r in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[r]=="string"&&(this._valuesStartRepeat[r]=this._valuesStartRepeat[r]+parseFloat(this._valuesEnd[r])),this._yoyo&&this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=c*y,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var f=0,x=this._chainedTweens.length;f<x;f++)this._chainedTweens[f].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(t,n,i,o){for(var r in i)if(n[r]!==void 0){var s=n[r]||0,a=i[r],c=Array.isArray(t[r]),d=Array.isArray(a),u=!c&&d;u?t[r]=this._interpolationFunction(a,o):typeof a=="object"&&a?this._updateProperties(t[r],s,a,o):(a=this._handleRelativeValue(s,a),typeof a=="number"&&(t[r]=s+(a-s)*o))}},e.prototype._handleRelativeValue=function(t,n){return typeof n!="string"?n:n.charAt(0)==="+"||n.charAt(0)==="-"?t+parseFloat(n):parseFloat(n)},e.prototype._swapEndStartRepeatValues=function(t){var n=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=n},e}();var idi=ipe.nextId,Pf=$J,odi=Pf.getAll.bind(Pf),rdi=Pf.removeAll.bind(Pf),sdi=Pf.add.bind(Pf),adi=Pf.remove.bind(Pf),cdi=Pf.update.bind(Pf);var Qqe={LINEAR_NONE:Xi.Linear.None,QUADRATIC_IN:Xi.Quadratic.In,QUADRATIC_OUT:Xi.Quadratic.Out,QUADRATIC_IN_OUT:Xi.Quadratic.InOut,CUBIC_IN:Xi.Cubic.In,CUBIC_OUT:Xi.Cubic.Out,CUBIC_IN_OUT:Xi.Cubic.InOut,QUARTIC_IN:Xi.Quartic.In,QUARTIC_OUT:Xi.Quartic.Out,QUARTIC_IN_OUT:Xi.Quartic.InOut,QUINTIC_IN:Xi.Quintic.In,QUINTIC_OUT:Xi.Quintic.Out,QUINTIC_IN_OUT:Xi.Quintic.InOut,SINUSOIDAL_IN:Xi.Sinusoidal.In,SINUSOIDAL_OUT:Xi.Sinusoidal.Out,SINUSOIDAL_IN_OUT:Xi.Sinusoidal.InOut,EXPONENTIAL_IN:Xi.Exponential.In,EXPONENTIAL_OUT:Xi.Exponential.Out,EXPONENTIAL_IN_OUT:Xi.Exponential.InOut,CIRCULAR_IN:Xi.Circular.In,CIRCULAR_OUT:Xi.Circular.Out,CIRCULAR_IN_OUT:Xi.Circular.InOut,ELASTIC_IN:Xi.Elastic.In,ELASTIC_OUT:Xi.Elastic.Out,ELASTIC_IN_OUT:Xi.Elastic.InOut,BACK_IN:Xi.Back.In,BACK_OUT:Xi.Back.Out,BACK_IN_OUT:Xi.Back.InOut,BOUNCE_IN:Xi.Bounce.In,BOUNCE_OUT:Xi.Bounce.Out,BOUNCE_IN_OUT:Xi.Bounce.InOut},Ar=Object.freeze(Qqe);function bk(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}bk.prototype.play=function(e,t,n){if(this.activeCamera=t,l(e)&&e!==null){let o=this;this.activeCallback=function(r){delete o.activeCallback,delete o.activeCamera,e(l(r)?!1:r)}}let i=this.getCameraOptions(n);if(this.view.headingPitchRoll)t.flyTo(i);else if(this.view.headingPitchRange){let o=new ce(this.view.position);t.flyToBoundingSphere(o,i)}};bk.prototype.stop=function(){l(this.activeCamera)&&this.activeCamera.cancelFlight(),l(this.activeCallback)&&this.activeCallback(!0)};bk.prototype.getCameraOptions=function(e){let t={duration:this.duration};return l(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=Ar.LINEAR_NONE),this.view.headingPitchRoll?(t.destination=this.view.position,t.orientation=this.view.headingPitchRoll):this.view.headingPitchRange&&(t.offset=this.view.headingPitchRange),l(e)&&(t=Tt(t,e)),t};var mv=bk;var Sdi=T(S(),1);function eQ(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}eQ.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};eQ.prototype.stop=function(){clearTimeout(this.timeout),l(this.activeCallback)&&this.activeCallback(!0)};var hv=eQ;var fpe={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){let t=e.toLowerCase();return t=Dg(t),fpe[t]}},aQ;typeof DOMParser<"u"&&(aQ=new DOMParser);var jqe=new hk({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),qy=32,rpe=2414016,spe=1,ape=16093e3,cpe=.1,lpe=[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"],dpe=["http://www.google.com/kml/ext/2.2"],qqe=["http://www.w3.org/2005/Atom"],ve={kml:lpe,gx:dpe,atom:qqe,kmlgx:lpe.concat(dpe)},cQ={Document:Vpe,Folder:y$e,Placemark:g$e,NetworkLink:Z$e,GroundOverlay:V$e,PhotoOverlay:Zpe,ScreenOverlay:C$e,Tour:_$e};function vf(e){this._dataSource=e,this._deferred=hl(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}Object.defineProperties(vf.prototype,{dataSource:{get:function(){return this._dataSource}}});vf.prototype.addNodes=function(e,t){this._stack.push({nodes:e,index:0,processingData:t}),this._used=!0};vf.prototype.addPromise=function(e){this._promises.push(e)};vf.prototype.wait=function(){let e=this._deferred;return this._used||e.resolve(),Promise.all([e.promise,Promise.all(this._promises)])};vf.prototype.process=function(){let e=this._stack.length===1;return e&&(this._started=Pd._getTimestamp()),this._process(e)};vf.prototype._giveUpTime=function(){if(this._timeoutSet)return;this._timeoutSet=!0,this._timeThreshold=50;let e=this;setTimeout(function(){e._timeoutSet=!1,e._started=Pd._getTimestamp(),e._process(!0)},0)};vf.prototype._nextNode=function(){let e=this._stack,t=e[e.length-1],n=t.index,i=t.nodes;if(n!==i.length)return++t.index,i[n]};vf.prototype._pop=function(){let e=this._stack;return e.pop(),e.length===0?(this._deferred.resolve(),!1):!0};vf.prototype._process=function(e){let t=this.dataSource,n=this._stack[this._stack.length-1].processingData,i=this._nextNode();for(;l(i);){let o=cQ[i.localName];if(l(o)&&(ve.kml.indexOf(i.namespaceURI)!==-1||ve.gx.indexOf(i.namespaceURI)!==-1)&&(o(t,i,n,this),this._timeoutSet||Pd._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}i=this._nextNode()}this._pop()&&e&&this._process(!0)};function $qe(e){let t=e.slice(0,Math.min(4,e.size)),n=hl(),i=new FileReader;return i.addEventListener("load",function(){n.resolve(new DataView(i.result).getUint32(0,!1)===1347093252)}),i.addEventListener("error",function(){n.reject(i.error)}),i.readAsArrayBuffer(t),n.promise}function e$e(e){let t=hl(),n=new FileReader;return n.addEventListener("load",function(){t.resolve(n.result)}),n.addEventListener("error",function(){t.reject(n.error)}),n.readAsText(e),t.promise}function ppe(e){let t={xsi:"http://www.w3.org/2001/XMLSchema-instance"},n,i,o,r;for(let s in t)t.hasOwnProperty(s)&&(o=RegExp(`[< ]${s}:`),r=`xmlns:${s}=`,o.test(e)&&e.indexOf(r)===-1&&(l(n)||(n=e.substr(0,e.indexOf("<kml")+4),i=e.substr(n.length)),n+=` ${r}"${t[s]}"`));return l(n)&&(e=n+i),e}function bpe(e){let t=e.indexOf("xmlns:"),n=e.indexOf(">",t),i,o,r;for(;t!==-1&&t<n;)i=e.slice(t,e.indexOf('"',t)),o=t,t=e.indexOf(i,t+1),t!==-1?(r=e.indexOf('"',e.indexOf('"',t)+1),e=e.slice(0,t-1)+e.slice(r+1,e.length),t=e.indexOf("xmlns:",o-1)):t=e.indexOf("xmlns:",o+1);return e}function t$e(e,t){return Promise.resolve(e.getData(new FU)).then(function(n){n=ppe(n),n=bpe(n),t.kml=aQ.parseFromString(n,"application/xml")})}function tQ(e,t){let n=g(fpe.detectFromFilename(e.filename),"application/octet-stream");return Promise.resolve(e.getData(new vU(n))).then(function(i){t[e.filename]=i})}function Xd(e,t,n,i){let o=i.keys,r=new fv.default("."),s=e.querySelectorAll(t);for(let a=0;a<s.length;a++){let c=s[a],d=c.getAttribute(n);if(l(d)){let m=new fv.default(d).absoluteTo(r).toString(),p=o.indexOf(m);if(p!==-1){let y=o[p];c.setAttribute(n,i[y]),t==="a"&&c.getAttribute("download")===null&&c.setAttribute("download",y)}}}}function Wd(e,t,n,i){let o=e.querySelectorAll(t);for(let r=0;r<o.length;r++){let s=o[r],a=s.getAttribute(n),c=lQ(a,i);l(c)&&s.setAttribute(n,c.url)}}function ype(e,t,n){let i=Ls(e,"id");i=l(i)&&i.length!==0?i:Hn(),l(n)&&(i=n+i);let o=t.getById(i);return l(o)&&(i=Hn(),l(n)&&(i=n+i)),o=t.add(new Jo({id:i})),l(o.kml)||(o.addProperty("kml"),o.kml=new X$e),o}function pv(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function _k(e,t){if(!l(e))return h.fromDegrees(0,0,0,t);let n=e.match(/[^\s,\n]+/g);if(!l(n))return h.fromDegrees(0,0,0,t);let i=parseFloat(n[0]),o=parseFloat(n[1]),r=parseFloat(n[2]);return i=isNaN(i)?0:i,o=isNaN(o)?0:o,r=isNaN(r)?0:r,h.fromDegrees(i,o,r,t)}function yk(e,t){if(!l(e))return;let n=e.textContent.match(/[^\s\n]+/g);if(!l(n))return;let i=n.length,o=new Array(i),r=0;for(let s=0;s<i;s++)o[r++]=_k(n[s],t);return o}function $y(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function Ls(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function Wi(e,t,n){if(!l(e))return;let i=e.childNodes,o=i.length;for(let r=0;r<o;r++){let s=i[r];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function upe(e,t,n){if(!l(e))return;let i=[],o=e.getElementsByTagNameNS("*",t),r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function ph(e,t,n){if(!l(e))return[];let i=[],o=e.childNodes,r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function ii(e,t,n){let i=Wi(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function Pn(e,t,n){let i=Wi(e,t,n);if(l(i))return i.textContent.trim()}function bh(e,t,n){let i=Wi(e,t,n);if(l(i)){let o=i.textContent.trim();return o==="1"||/^true$/i.test(o)}}function lQ(e,t,n){if(!l(e))return;let i;if(l(n)){e=e.replace(/\\/g,"/");let o=n[e];if(l(o))i=new Xe({url:o});else{let r=new fv.default(t.getUrlComponent()),s=new fv.default(e);o=n[s.absoluteTo(r)],l(o)&&(i=new Xe({url:o}))}}return l(i)||(i=t.getDerivedResource({url:e})),i}var kl={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function rQ(e,t){if(!l(e)||/^\s*$/gm.test(e))return;e[0]==="#"&&(e=e.substring(1));let n=parseInt(e.substring(0,2),16)/255,i=parseInt(e.substring(2,4),16)/255,o=parseInt(e.substring(4,6),16)/255,r=parseInt(e.substring(6,8),16)/255;return t?(r>0?(kl.maximumRed=r,kl.red=void 0):(kl.maximumRed=void 0,kl.red=0),o>0?(kl.maximumGreen=o,kl.green=void 0):(kl.maximumGreen=void 0,kl.green=0),i>0?(kl.maximumBlue=i,kl.blue=void 0):(kl.maximumBlue=void 0,kl.blue=0),kl.alpha=n,O.fromRandom(kl)):new O(r,o,i,n)}function aT(e,t,n){let i=Pn(e,t,n);if(l(i))return rQ(i,Pn(e,"colorMode",n)==="random")}function n$e(e){let t=Wi(e,"TimeStamp",ve.kmlgx),n=Pn(t,"when",ve.kmlgx);if(!l(t)||!l(n)||n.length===0)return;let i=te.fromIso8601(n),o=new Xr;return o.addInterval(new Ln({start:i,stop:Be.MAXIMUM_VALUE})),o}function i$e(e){let t=Wi(e,"TimeSpan",ve.kmlgx);if(!l(t))return;let n,i=Wi(t,"begin",ve.kmlgx),o=l(i)?te.fromIso8601(i.textContent):void 0,r=Wi(t,"end",ve.kmlgx),s=l(r)?te.fromIso8601(r.textContent):void 0;if(l(o)&&l(s)){if(te.lessThan(s,o)){let a=o;o=s,s=a}n=new Xr,n.addInterval(new Ln({start:o,stop:s}))}else l(o)?(n=new Xr,n.addInterval(new Ln({start:o,stop:Be.MAXIMUM_VALUE}))):l(s)&&(n=new Xr,n.addInterval(new Ln({start:Be.MINIMUM_VALUE,stop:s})));return n}function gpe(){let e=new Da;return e.width=qy,e.height=qy,e.scaleByDistance=new vt(rpe,spe,ape,cpe),e.pixelOffsetScaleByDistance=new vt(rpe,spe,ape,cpe),e}function dQ(){let e=new Cm;return e.outline=!0,e.outlineColor=O.WHITE,e}function xpe(){let e=new Sm;return e.translucencyByDistance=new vt(3e6,1,5e6,0),e.pixelOffset=new B(17,0),e.horizontalOrigin=bi.LEFT,e.font="16px sans-serif",e.style=No.FILL_AND_OUTLINE,e}function uQ(e,t,n,i,o){let r=Pn(e,"href",ve.kml);if(!l(r)||r.length===0)return;if(r.indexOf("root://icons/palette-")===0){let a=r.charAt(21),c=g(ii(e,"x",ve.gx),0),d=g(ii(e,"y",ve.gx),0);c=Math.min(c/32,7),d=7-Math.min(d/32,7);let u=8*d+c;r=`https://maps.google.com/mapfiles/kml/pal${a}/icon${u}.png`}let s=lQ(r,n,i);if(o){let a=Pn(e,"refreshMode",ve.kml),c=Pn(e,"viewRefreshMode",ve.kml);a==="onInterval"||a==="onExpire"?Ft(`kml-refreshMode-${a}`,`KML - Unsupported Icon refreshMode: ${a}`):(c==="onStop"||c==="onRegion")&&Ft(`kml-refreshMode-${c}`,`KML - Unsupported Icon viewRefreshMode: ${c}`);let d=g(Pn(e,"viewBoundScale",ve.kml),1),u=c==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",m=g(Pn(e,"viewFormat",ve.kml),u),p=Pn(e,"httpQuery",ve.kml);l(m)&&s.setQueryParameters(ed(xk(m))),l(p)&&s.setQueryParameters(ed(xk(p)));let y=t._ellipsoid;return hQ(s,t.camera,t.canvas,d,t._lastCameraView.bbox,y),s}return s}function o$e(e,t,n,i,o){let r=ii(t,"scale",ve.kml),s=ii(t,"heading",ve.kml),a=aT(t,"color",ve.kml),c=Wi(t,"Icon",ve.kml),d=uQ(c,e,i,o,!1);l(c)&&!l(d)&&(d=!1);let u=ii(c,"x",ve.gx),m=ii(c,"y",ve.gx),p=ii(c,"w",ve.gx),y=ii(c,"h",ve.gx),f=Wi(t,"hotSpot",ve.kml),x=$y(f,"x"),_=$y(f,"y"),C=Ls(f,"xunits"),V=Ls(f,"yunits"),L=n.billboard;l(L)||(L=gpe(),n.billboard=L),L.image=d,L.scale=r,L.color=a,(l(u)||l(m)||l(p)||l(y))&&(L.imageSubRegion=new De(u,m,p,y)),l(s)&&s!==0&&(L.rotation=W.toRadians(-s),L.alignedAxis=h.UNIT_Z),r=g(r,1);let Z,G;l(x)&&(C==="pixels"?Z=-x*r:C==="insetPixels"?Z=(x-qy)*r:C==="fraction"&&(Z=-x*qy*r),Z+=qy*.5*r),l(_)&&(V==="pixels"?G=_*r:V==="insetPixels"?G=(-_+qy)*r:V==="fraction"&&(G=_*qy*r),G-=qy*.5*r),(l(Z)||l(G))&&(L.pixelOffset=new B(Z,G))}function gk(e,t,n,i,o){for(let r=0,s=t.childNodes.length;r<s;r++){let a=t.childNodes.item(r);if(a.localName==="IconStyle")o$e(e,a,n,i,o);else if(a.localName==="LabelStyle"){let c=n.label;l(c)||(c=xpe(),n.label=c),c.scale=g(ii(a,"scale",ve.kml),c.scale),c.fillColor=g(aT(a,"color",ve.kml),c.fillColor),c.text=n.name}else if(a.localName==="LineStyle"){let c=n.polyline;l(c)||(c=new $a,n.polyline=c),c.width=ii(a,"width",ve.kml),c.material=aT(a,"color",ve.kml),l(aT(a,"outerColor",ve.gx))&&Ft("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),l(ii(a,"outerWidth",ve.gx))&&Ft("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),l(ii(a,"physicalWidth",ve.gx))&&Ft("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),l(bh(a,"labelVisibility",ve.gx))&&Ft("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if(a.localName==="PolyStyle"){let c=n.polygon;l(c)||(c=dQ(),n.polygon=c),c.material=g(aT(a,"color",ve.kml),c.material),c.fill=g(bh(a,"fill",ve.kml),c.fill),c.outline=g(bh(a,"outline",ve.kml),c.outline)}else if(a.localName==="BalloonStyle"){let c=g(rQ(Pn(a,"bgColor",ve.kml)),O.WHITE),d=g(rQ(Pn(a,"textColor",ve.kml)),O.BLACK),u=Pn(a,"text",ve.kml);n.addProperty("balloonStyle"),n.balloonStyle={bgColor:c,textColor:d,text:u}}else if(a.localName==="ListStyle"){let c=Pn(a,"listItemType",ve.kml);(c==="radioFolder"||c==="checkOffOnly")&&Ft(`kml-listStyle-${c}`,`KML - Unsupported ListStyle with listItemType: ${c}`)}}}function r$e(e,t,n,i,o){let r=new Jo,s,a=-1,c=t.childNodes,d=c.length;for(let m=0;m<d;m++){let p=c[m];(p.localName==="Style"||p.localName==="StyleMap")&&(a=m)}if(a!==-1){let m=c[a];if(m.localName==="Style")gk(e,m,r,i,o);else{let p=ph(m,"Pair",ve.kml);for(let y=0;y<p.length;y++){let f=p[y],x=Pn(f,"key",ve.kml);if(x==="normal"){let _=Pn(f,"styleUrl",ve.kml);if(l(_))s=n.getById(_),l(s)||(s=n.getById(`#${_}`)),l(s)&&r.merge(s);else{let C=Wi(f,"Style",ve.kml);gk(e,C,r,i,o)}}else Ft(`kml-styleMap-${x}`,`KML - Unsupported StyleMap key: ${x}`)}}}let u=Pn(t,"styleUrl",ve.kml);if(l(u)){let m=u;if(u[0]!=="#"&&u.indexOf("#")!==-1){let p=u.split("#"),y=p[0];m=`${i.getDerivedResource({url:y}).getUrlComponent()}#${p[1]}`}s=n.getById(m),l(s)||(s=n.getById(`#${m}`)),l(s)&&r.merge(s)}return r}function s$e(e,t,n){return t.fetchXML().then(function(i){return _pe(e,i,n,t,!0)})}function _pe(e,t,n,i,o,r){let s,a,c,d,u=upe(t,"Style",ve.kml);if(l(u)){let x=u.length;for(s=0;s<x;s++)d=u[s],a=Ls(d,"id"),l(a)&&(a=`#${a}`,o&&l(i)&&(a=i.getUrlComponent()+a),l(n.getById(a))||(c=new Jo({id:a}),n.add(c),gk(e,d,c,i,r)))}let m=upe(t,"StyleMap",ve.kml);if(l(m)){let x=m.length;for(s=0;s<x;s++){let _=m[s];if(a=Ls(_,"id"),l(a)){let C=ph(_,"Pair",ve.kml);for(let V=0;V<C.length;V++){let L=C[V],Z=Pn(L,"key",ve.kml);if(Z==="normal"){if(a=`#${a}`,o&&l(i)&&(a=i.getUrlComponent()+a),!l(n.getById(a))){c=n.getOrCreateEntity(a);let G=Pn(L,"styleUrl",ve.kml);if(l(G)){G[0]!=="#"&&(G=`#${G}`),o&&l(i)&&(G=i.getUrlComponent()+G);let I=n.getById(G);l(I)&&c.merge(I)}else d=Wi(L,"Style",ve.kml),gk(e,d,c,i,r)}}else Ft(`kml-styleMap-${Z}`,`KML - Unsupported StyleMap key: ${Z}`)}}}}let p=[],y=t.getElementsByTagName("styleUrl"),f=y.length;for(s=0;s<f;s++){let x=y[s].textContent;if(x[0]!=="#"){let _=x.split("#");if(_.length===2){let C=_[0],V=i.getDerivedResource({url:C});p.push(s$e(e,V,n))}}}return p}function mQ(e,t,n){let i=new Z0(e,t.id,["position"]),o=new Cf(t.position);t.polyline=l(n.polyline)?n.polyline.clone():new $a,t.polyline.positions=new R0([i,o])}function Tpe(e,t){return!l(e)&&!l(t)||e==="clampToGround"?Qe.CLAMP_TO_GROUND:e==="relativeToGround"?Qe.RELATIVE_TO_GROUND:e==="absolute"?Qe.NONE:t==="clampToSeaFloor"?(Ft("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),Qe.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(Ft("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),Qe.RELATIVE_TO_GROUND):(l(e)?Ft("kml-altitudeMode-unknown",`KML - Unknown <kml:altitudeMode>:${e}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`):Ft("kml-gx:altitudeMode-unknown",`KML - Unknown <gx:altitudeMode>:${t}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`),Qe.CLAMP_TO_GROUND)}function a$e(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&Ft("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g(t,n)}`),new Cf(e))}function c$e(e,t,n,i){if(!l(e))return;if(n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround")return e;(l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&Ft("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g(t,n)}`);let o=e.length;for(let r=0;r<o;r++){let s=e[r];i.scaleToGeodeticSurface(s,s)}return e}function Tk(e,t,n,i){let o=t.label;l(o)||(o=l(n.label)?n.label.clone():xpe(),t.label=o),o.text=t.name;let r=t.billboard;l(r)||(r=l(n.billboard)?n.billboard.clone():gpe(),t.billboard=r),l(r.image)?r.image.getValue()||(r.image=void 0):r.image=e._pinBuilder.fromColor(O.YELLOW,64);let s=1;l(r.scale)&&(s=r.scale.getValue(),s!==0?o.pixelOffset=new B(s*16+1,0):(o.pixelOffset=void 0,o.horizontalOrigin=void 0)),l(i)&&e._clampToGround&&(r.heightReference=i,o.heightReference=i)}function Spe(e,t){let n=e.path;l(n)||(n=new Rp,n.leadTime=0,e.path=n);let i=t.polyline;l(i)&&(n.material=i.material,n.width=i.width)}function l$e(e,t,n,i,o){let r=Pn(n,"coordinates",ve.kml),s=Pn(n,"altitudeMode",ve.kml),a=Pn(n,"altitudeMode",ve.gx),c=bh(n,"extrude",ve.kml),d=e._ellipsoid,u=_k(r,d);return i.position=u,Tk(e,i,o,Tpe(s,a)),c&&pv(s,a)&&mQ(t,i,o),!0}function mpe(e,t,n,i,o){let r=Wi(n,"coordinates",ve.kml),s=Pn(n,"altitudeMode",ve.kml),a=Pn(n,"altitudeMode",ve.gx),c=bh(n,"extrude",ve.kml),d=bh(n,"tessellate",ve.kml),u=pv(s,a),m=ii(n,"drawOrder",ve.gx),p=e._ellipsoid,y=yk(r,p),f=o.polyline;if(u&&c){let x=new Zp;i.wall=x,x.positions=y;let _=o.polygon;l(_)&&(x.fill=_.fill,x.material=_.material),x.outline=!0,l(f)?(x.outlineColor=l(f.material)?f.material.color:O.WHITE,x.outlineWidth=f.width):l(_)&&(x.outlineColor=l(_.material)?_.material.color:O.WHITE)}else if(e._clampToGround&&!u&&d){let x=new $a;x.clampToGround=!0,i.polyline=x,x.positions=y,l(f)?(x.material=l(f.material)?f.material.color.getValue(Be.MINIMUM_VALUE):O.WHITE,x.width=g(f.width,1)):(x.material=O.WHITE,x.width=1),x.zIndex=m}else l(m)&&Ft("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!d&&Ft("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),f=l(f)?f.clone():new $a,i.polyline=f,f.positions=c$e(y,s,a,p),(!d||u)&&(f.arcType=jt.NONE);return!0}function d$e(e,t,n,i,o){let r=Wi(n,"outerBoundaryIs",ve.kml),s=Wi(r,"LinearRing",ve.kml),a=Wi(s,"coordinates",ve.kml),c=e._ellipsoid,d=yk(a,c),u=bh(n,"extrude",ve.kml),m=Pn(n,"altitudeMode",ve.kml),p=Pn(n,"altitudeMode",ve.gx),y=pv(m,p),f=l(o.polygon)?o.polygon.clone():dQ(),x=o.polyline;if(l(x)&&(f.outlineColor=l(x.material)?x.material.color:O.WHITE,f.outlineWidth=x.width),i.polygon=f,y?(f.perPositionHeight=!0,f.extrudedHeight=u?0:void 0):e._clampToGround||(f.height=0),l(d)){let _=new Va(d),C=ph(n,"innerBoundaryIs",ve.kml);for(let V=0;V<C.length;V++){s=ph(C[V],"LinearRing",ve.kml);for(let L=0;L<s.length;L++)a=Wi(s[L],"coordinates",ve.kml),d=yk(a,c),l(d)&&_.holes.push(new Va(d))}f.hierarchy=_}return!0}function u$e(e,t,n,i,o){let r=Pn(n,"altitudeMode",ve.kml),s=Pn(n,"altitudeMode",ve.gx),a=ph(n,"coord",ve.gx),c=ph(n,"angles",ve.gx),d=ph(n,"when",ve.kml),u=bh(n,"extrude",ve.kml),m=pv(r,s),p=e._ellipsoid;c.length>0&&Ft("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let y=Math.min(a.length,d.length),f=[],x=[];for(let C=0;C<y;C++){let V=_k(a[C].textContent,p);f.push(V),x.push(te.fromIso8601(d[C].textContent))}let _=new aa;return _.addSamples(x,f),i.position=_,Tk(e,i,o,Tpe(r,s)),Spe(i,o),i.availability=new Xr,d.length>0&&i.availability.addInterval(new Ln({start:x[0],stop:x[x.length-1]})),m&&u&&mQ(t,i,o),!0}function hpe(e,t,n,i,o,r,s,a,c){let d=e[0],u=e[e.length-1],m=new aa;m.addSamples(e,t),n.intervals.addInterval(new Ln({start:d,stop:u,isStartIncluded:c,isStopIncluded:c,data:a$e(m,s,a)})),i.addInterval(new Ln({start:d,stop:u,isStartIncluded:c,isStopIncluded:c})),o.intervals.addInterval(new Ln({start:d,stop:u,isStartIncluded:c,isStopIncluded:c,data:r}))}function m$e(e,t,n,i,o){let r=bh(n,"interpolate",ve.gx),s=ph(n,"Track",ve.gx),a,c,d,u=!1,m=new E0,p=new Xr,y=new ra,f=e._ellipsoid;for(let x=0,_=s.length;x<_;x++){let C=s[x],V=ph(C,"when",ve.kml),L=ph(C,"coord",ve.gx),Z=Pn(C,"altitudeMode",ve.kml),G=Pn(C,"altitudeMode",ve.gx),I=pv(Z,G),P=bh(C,"extrude",ve.kml),v=Math.min(L.length,V.length),F=[];a=[];for(let M=0;M<v;M++){let b=_k(L[M].textContent,f);F.push(b),a.push(te.fromIso8601(V[M].textContent))}r&&(l(c)&&hpe([c,a[0]],[d,F[0]],y,p,m,!1,"absolute",void 0,!1),c=a[v-1],d=F[F.length-1]),hpe(a,F,y,p,m,I&&P,Z,G,!0),u=u||I&&P}return i.availability=p,i.position=y,Tk(e,i,o),Spe(i,o),u&&(mQ(t,i,o),i.polyline.show=m),!0}var Cpe={Point:l$e,LineString:mpe,LinearRing:mpe,Polygon:d$e,Track:u$e,MultiTrack:m$e,MultiGeometry:h$e,Model:f$e};function h$e(e,t,n,i,o,r){let s=n.childNodes,a=!1;for(let c=0,d=s.length;c<d;c++){let u=s.item(c),m=Cpe[u.localName];if(l(m)){let p=ype(u,t,r);p.parent=i,p.name=i.name,p.availability=i.availability,p.description=i.description,p.kml=i.kml,m(e,t,u,p,o)&&(a=!0)}}return a}function f$e(e,t,n,i,o){return Ft("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function p$e(e,t){let n=Wi(e,"ExtendedData",ve.kml);if(!l(n))return;l(Wi(n,"SchemaData",ve.kml))&&Ft("kml-schemaData","KML - SchemaData is unsupported"),l(Ls(n,"xmlns:prefix"))&&Ft("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");let i={},o=ph(n,"Data",ve.kml);if(l(o)){let r=o.length;for(let s=0;s<r;s++){let a=o[s],c=Ls(a,"name");l(c)&&(i[c]={displayName:Pn(a,"displayName",ve.kml),value:Pn(a,"value",ve.kml)})}}t.kml.extendedData=i}var go;typeof document<"u"&&(go=document.createElement("div"));function b$e(e,t,n,i,o){let r,s,a,c=t.kml,d=c.extendedData,u=Pn(e,"description",ve.kml),m=g(t.balloonStyle,n.balloonStyle),p=O.WHITE,y=O.BLACK,f=u;l(m)&&(p=g(m.bgColor,O.WHITE),y=g(m.textColor,O.BLACK),f=g(m.text,u));let x;if(l(f)){if(f=f.replace("$[name]",g(t.name,"")),f=f.replace("$[description]",g(u,"")),f=f.replace("$[address]",g(c.address,"")),f=f.replace("$[Snippet]",g(c.snippet,"")),f=f.replace("$[id]",t.id),f=f.replace("$[geDirections]",""),l(d)){let V=f.match(/\$\[.+?\]/g);if(V!==null)for(r=0;r<V.length;r++){let L=V[r],Z=L.substr(2,L.length-3),G=/\/displayName$/.test(Z);Z=Z.replace(/\/displayName$/,""),x=d[Z],l(x)&&(x=G?x.displayName:x.value),l(x)&&(f=f.replace(L,g(x,"")))}}}else if(l(d)&&(a=Object.keys(d),a.length>0)){for(f='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',r=0;r<a.length;r++)s=a[r],x=d[s],f+=`<tr><th>${g(x.displayName,s)}</th><td>${g(x.value,"")}</td></tr>`;f+="</tbody></table>"}if(!l(f))return;f=jqe.link(f),go.innerHTML=f;let _=go.querySelectorAll("a");for(r=0;r<_.length;r++)_[r].setAttribute("target","_blank");l(i)&&i.keys.length>1&&(Xd(go,"a","href",i),Xd(go,"link","href",i),Xd(go,"area","href",i),Xd(go,"img","src",i),Xd(go,"iframe","src",i),Xd(go,"video","src",i),Xd(go,"audio","src",i),Xd(go,"source","src",i),Xd(go,"track","src",i),Xd(go,"input","src",i),Xd(go,"embed","src",i),Xd(go,"script","src",i),Xd(go,"video","poster",i)),Wd(go,"a","href",o),Wd(go,"link","href",o),Wd(go,"area","href",o),Wd(go,"img","src",o),Wd(go,"iframe","src",o),Wd(go,"video","src",o),Wd(go,"audio","src",o),Wd(go,"source","src",o),Wd(go,"track","src",o),Wd(go,"input","src",o),Wd(go,"embed","src",o),Wd(go,"script","src",o),Wd(go,"video","poster",o);let C='<div class="cesium-infoBox-description-lighter" style="';C+="overflow:auto;",C+="word-wrap:break-word;",C+=`background-color:${p.toCssColorString()};`,C+=`color:${y.toCssColorString()};`,C+='">',C+=`${go.innerHTML}</div>`,go.innerHTML="",t.description=C}function Sk(e,t,n){let i=n.entityCollection,o=n.parentEntity,r=n.sourceResource,s=n.uriResolver,a=ype(t,i,n.context),c=a.kml,d=r$e(e,t,n.styleCollection,r,s),u=Pn(t,"name",ve.kml);a.name=u,a.parent=o;let m=i$e(t);l(m)||(m=n$e(t)),a.availability=m,pQ(a);function p(L){return L?L.show&&p(L.parent):!0}let y=bh(t,"visibility",ve.kml);a.show=p(o)&&g(y,!0);let f=Wi(t,"author",ve.atom),x=c.author;x.name=Pn(f,"name",ve.atom),x.uri=Pn(f,"uri",ve.atom),x.email=Pn(f,"email",ve.atom);let _=Wi(t,"link",ve.atom),C=c.link;C.href=Ls(_,"href"),C.hreflang=Ls(_,"hreflang"),C.rel=Ls(_,"rel"),C.type=Ls(_,"type"),C.title=Ls(_,"title"),C.length=Ls(_,"length"),c.address=Pn(t,"address",ve.kml),c.phoneNumber=Pn(t,"phoneNumber",ve.kml),c.snippet=Pn(t,"Snippet",ve.kml),p$e(t,a),b$e(t,a,d,s,r);let V=e._ellipsoid;return Rpe(t,a,V),Lpe(t,a,V),l(Wi(t,"Region",ve.kml))&&Ft("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:d}}function Vpe(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function y$e(e,t,n,i){let o=Sk(e,t,n),r=ze(n);r.parentEntity=o.entity,Vpe(e,t,r,i)}function g$e(e,t,n,i){let o=Sk(e,t,n),r=o.entity,s=o.styleEntity,a=!1,c=t.childNodes;for(let d=0,u=c.length;d<u&&!a;d++){let m=c.item(d),p=Cpe[m.localName];l(p)&&(p(e,n.entityCollection,m,r,s,r.id),a=!0)}a||(r.merge(s),Tk(e,r,s))}var x$e={FlyTo:S$e,Wait:T$e,SoundCue:nQ,AnimatedUpdate:nQ,TourControl:nQ};function _$e(e,t,n,i){let o=Pn(t,"name",ve.kml),r=Ls(t,"id"),s=new dv(o,r),a=Wi(t,"Playlist",ve.gx);if(a){let c=e._ellipsoid,d=a.childNodes;for(let u=0;u<d.length;u++){let m=d[u];if(m.localName){let p=x$e[m.localName];p?p(s,m,c):console.log(`Unknown KML Tour playlist entry type ${m.localName}`)}}}e._kmlTours.push(s)}function nQ(e,t){Ft(`KML Tour unsupported node ${t.localName}`)}function T$e(e,t){let n=ii(t,"duration",ve.gx);e.addPlaylistEntry(new hv(n))}function S$e(e,t,n){let i=ii(t,"duration",ve.gx),o=Pn(t,"flyToMode",ve.gx),r={kml:{}};Rpe(t,r,n),Lpe(t,r,n);let s=r.kml.lookAt||r.kml.camera,a=new mv(i,o,s);e.addPlaylistEntry(a)}function Lpe(e,t,n){let i=Wi(e,"Camera",ve.kml);if(l(i)){let o=g(ii(i,"longitude",ve.kml),0),r=g(ii(i,"latitude",ve.kml),0),s=g(ii(i,"altitude",ve.kml),0),a=g(ii(i,"heading",ve.kml),0),c=g(ii(i,"tilt",ve.kml),0),d=g(ii(i,"roll",ve.kml),0),u=h.fromDegrees(o,r,s,n),m=za.fromDegrees(a,c-90,d);t.kml.camera=new cv(u,m)}}function Rpe(e,t,n){let i=Wi(e,"LookAt",ve.kml);if(l(i)){let o=g(ii(i,"longitude",ve.kml),0),r=g(ii(i,"latitude",ve.kml),0),s=g(ii(i,"altitude",ve.kml),0),a=ii(i,"heading",ve.kml),c=ii(i,"tilt",ve.kml),d=g(ii(i,"range",ve.kml),0);c=W.toRadians(g(c,0)),a=W.toRadians(g(a,0));let u=new Ou(a,c-W.PI_OVER_TWO,d),m=h.fromDegrees(o,r,s,n);t.kml.lookAt=new lv(m,u)}}function C$e(e,t,n,i){let o=n.screenOverlayContainer;if(!l(o))return;let r=n.sourceResource,s=n.uriResolver,a=Wi(t,"Icon",ve.kml),c=uQ(a,e,r,s,!1);if(!l(c))return;let d=document.createElement("img");e._screenOverlays.push(d),d.src=c.url,d.onload=function(){let u=["position: absolute"],m=Wi(t,"screenXY",ve.kml),p=Wi(t,"overlayXY",ve.kml),y=Wi(t,"size",ve.kml),f,x,_,C,V,L;l(y)&&(f=$y(y,"x"),x=$y(y,"y"),_=Ls(y,"xunits"),C=Ls(y,"yunits"),l(f)&&f!==-1&&f!==0&&(_==="fraction"?V=`width: ${Math.floor(f*100)}%`:_==="pixels"&&(V=`width: ${f}px`),u.push(V)),l(x)&&x!==-1&&x!==0&&(C==="fraction"?L=`height: ${Math.floor(x*100)}%`:C==="pixels"&&(L=`height: ${x}px`),u.push(L))),d.style=u.join(";");let Z=0,G=d.height;l(p)&&(f=$y(p,"x"),x=$y(p,"y"),_=Ls(p,"xunits"),C=Ls(p,"yunits"),l(f)&&(_==="fraction"?Z=f*d.width:(_==="pixels"||_==="insetPixels")&&(Z=f)),l(x)&&(C==="fraction"?G=x*d.height:(C==="pixels"||C==="insetPixels")&&(G=x))),l(m)&&(f=$y(m,"x"),x=$y(m,"y"),_=Ls(m,"xunits"),C=Ls(m,"yunits"),l(f)&&(_==="fraction"?V=`left: calc(${Math.floor(f*100)}% - ${Z}px)`:_==="pixels"?V=`left: ${f-Z}px`:_==="insetPixels"&&(V=`right: ${f-Z}px`),u.push(V)),l(x)&&(C==="fraction"?L=`bottom: calc(${Math.floor(x*100)}% - ${G}px)`:C==="pixels"?L=`bottom: ${x-G}px`:C==="insetPixels"&&(L=`top: ${x-G}px`),u.push(L))),d.style=u.join(";")},o.appendChild(d)}function V$e(e,t,n,i){let r=Sk(e,t,n).entity,s,a=!1,c=e._ellipsoid,d=yk(Wi(t,"LatLonQuad",ve.gx),c),u=ii(t,"drawOrder",ve.kml);if(l(d))s=dQ(),s.hierarchy=new Va(d),s.zIndex=u,r.polygon=s,a=!0;else{s=new Vm,s.zIndex=u,r.rectangle=s;let f=Wi(t,"LatLonBox",ve.kml);if(l(f)){let x=ii(f,"west",ve.kml),_=ii(f,"south",ve.kml),C=ii(f,"east",ve.kml),V=ii(f,"north",ve.kml);l(x)&&(x=W.negativePiToPi(W.toRadians(x))),l(_)&&(_=W.clampToLatitudeRange(W.toRadians(_))),l(C)&&(C=W.negativePiToPi(W.toRadians(C))),l(V)&&(V=W.clampToLatitudeRange(W.toRadians(V))),s.coordinates=new de(x,_,C,V);let L=ii(f,"rotation",ve.kml);if(l(L)){let Z=W.toRadians(L);s.rotation=Z,s.stRotation=Z}}}let m=Wi(t,"Icon",ve.kml),p=uQ(m,e,n.sourceResource,n.uriResolver,!0);if(l(p)){a&&Ft("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");let f=ii(m,"x",ve.gx),x=ii(m,"y",ve.gx),_=ii(m,"w",ve.gx),C=ii(m,"h",ve.gx);(l(f)||l(x)||l(_)||l(C))&&Ft("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),s.material=p,s.material.color=aT(t,"color",ve.kml),s.material.transparent=!0}else s.material=aT(t,"color",ve.kml);let y=Pn(t,"altitudeMode",ve.kml);l(y)?y==="absolute"?(s.height=ii(t,"altitude",ve.kml),s.zIndex=void 0):y!=="clampToGround"&&Ft("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y}`):(y=Pn(t,"altitudeMode",ve.gx),y==="relativeToSeaFloor"?(Ft("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),s.height=ii(t,"altitude",ve.kml),s.zIndex=void 0):y==="clampToSeaFloor"?Ft("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):l(y)&&Ft("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y}`))}function Zpe(e,t,n,i){e._unsupportedNode.raiseEvent(e,n.parentEntity,t,n.entityCollection,n.styleCollection,n.sourceResource,n.uriResolver),Ft(`kml-unsupportedFeature-${t.nodeName}`,`KML - Unsupported feature: ${t.nodeName}`)}var eg={INTERVAL:0,EXPIRE:1,STOP:2};function xk(e){if(!l(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var L$e=new de,sV=new he,iQ=new B,R$e=new h;function hQ(e,t,n,i,o,r){function s(d){return d<-W.PI_OVER_TWO?-W.PI_OVER_TWO:d>W.PI_OVER_TWO?W.PI_OVER_TWO:d}function a(d){return d>W.PI?d-W.TWO_PI:d<-W.PI?d+W.TWO_PI:d}let c=Hg(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==ie.MORPHING){let d,u;if(o=g(o,L$e),l(n)&&(iQ.x=n.clientWidth*.5,iQ.y=n.clientHeight*.5,d=t.pickEllipsoid(iQ,r,R$e)),l(d)?u=r.cartesianToCartographic(d,sV):(u=de.center(o,sV),d=r.cartographicToCartesian(u)),l(i)&&!W.equalsEpsilon(i,1,W.EPSILON9)){let C=o.width*i*.5,V=o.height*i*.5;o=new de(a(u.longitude-C),s(u.latitude-V),a(u.longitude+C),s(u.latitude+V))}c=c.replace("[bboxWest]",W.toDegrees(o.west).toString()),c=c.replace("[bboxSouth]",W.toDegrees(o.south).toString()),c=c.replace("[bboxEast]",W.toDegrees(o.east).toString()),c=c.replace("[bboxNorth]",W.toDegrees(o.north).toString());let m=W.toDegrees(u.longitude).toString(),p=W.toDegrees(u.latitude).toString();c=c.replace("[lookatLon]",m),c=c.replace("[lookatLat]",p),c=c.replace("[lookatTilt]",W.toDegrees(t.pitch).toString()),c=c.replace("[lookatHeading]",W.toDegrees(t.heading).toString()),c=c.replace("[lookatRange]",h.distance(t.positionWC,d)),c=c.replace("[lookatTerrainLon]",m),c=c.replace("[lookatTerrainLat]",p),c=c.replace("[lookatTerrainAlt]",u.height.toString()),r.cartesianToCartographic(t.positionWC,sV),c=c.replace("[cameraLon]",W.toDegrees(sV.longitude).toString()),c=c.replace("[cameraLat]",W.toDegrees(sV.latitude).toString()),c=c.replace("[cameraAlt]",W.toDegrees(sV.height).toString());let y=t.frustum,f=y.aspectRatio,x="",_="";if(l(f)){let C=W.toDegrees(y.fov);f>1?(x=C,_=C/f):(_=C,x=C*f)}c=c.replace("[horizFov]",x.toString()),c=c.replace("[vertFov]",_.toString())}else c=c.replace("[bboxWest]","-180"),c=c.replace("[bboxSouth]","-90"),c=c.replace("[bboxEast]","180"),c=c.replace("[bboxNorth]","90"),c=c.replace("[lookatLon]",""),c=c.replace("[lookatLat]",""),c=c.replace("[lookatRange]",""),c=c.replace("[lookatTilt]",""),c=c.replace("[lookatHeading]",""),c=c.replace("[lookatTerrainLon]",""),c=c.replace("[lookatTerrainLat]",""),c=c.replace("[lookatTerrainAlt]",""),c=c.replace("[cameraLon]",""),c=c.replace("[cameraLat]",""),c=c.replace("[cameraAlt]",""),c=c.replace("[horizFov]",""),c=c.replace("[vertFov]","");l(n)?(c=c.replace("[horizPixels]",n.clientWidth),c=c.replace("[vertPixels]",n.clientHeight)):(c=c.replace("[horizPixels]",""),c=c.replace("[vertPixels]","")),c=c.replace("[terrainEnabled]","1"),c=c.replace("[clientVersion]","1"),c=c.replace("[kmlVersion]","2.2"),c=c.replace("[clientName]","Cesium"),c=c.replace("[language]","English"),e.setQueryParameters(ed(c))}function Z$e(e,t,n,i){let r=Sk(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,c=Wi(t,"Link",ve.kml);if(l(c)||(c=Wi(t,"Url",ve.kml)),l(c)){let d=Pn(c,"href",ve.kml),u,m;if(l(d)){let p=d;if(d=lQ(d,s,n.uriResolver),/^data:/.test(d.getUrlComponent()))/\.kmz/i.test(s.getUrlComponent())||(p=s.getDerivedResource({url:p}));else{if(p=d.clone(),u=Pn(c,"viewRefreshMode",ve.kml),u==="onRegion"){Ft("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}m=g(Pn(c,"viewBoundScale",ve.kml),1);let _=u==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",C=g(Pn(c,"viewFormat",ve.kml),_),V=Pn(c,"httpQuery",ve.kml);l(C)&&d.setQueryParameters(ed(xk(C))),l(V)&&d.setQueryParameters(ed(xk(V)));let L=e._ellipsoid;hQ(d,e.camera,e.canvas,m,e._lastCameraView.bbox,L)}let y={sourceUri:p,uriResolver:a,context:r.id,screenOverlayContainer:n.screenOverlayContainer},f=new ks,x=fQ(e,f,d,y).then(function(_){let C=e._entityCollection,V=f.values;C.suspendEvents();for(let G=0;G<V.length;G++){let I=V[G];l(I.parent)||(I.parent=r,pQ(I)),C.add(I)}C.resumeEvents();let L=Pn(c,"refreshMode",ve.kml),Z=g(ii(c,"refreshInterval",ve.kml),0);if(L==="onInterval"&&Z>0||L==="onExpire"||u==="onStop"){let G=Wi(_,"NetworkLinkControl",ve.kml),I=l(G),P=te.now(),v={id:Hn(),href:d,cookie:{},lastUpdated:P,updating:!1,entity:r,viewBoundScale:m,needsUpdate:!1,cameraUpdateTime:P},F=0;if(I&&(v.cookie=ed(g(Pn(G,"cookie",ve.kml),"")),F=g(ii(G,"minRefreshPeriod",ve.kml),0)),L==="onInterval")I&&(Z=Math.max(F,Z)),v.refreshMode=eg.INTERVAL,v.time=Z;else if(L==="onExpire"){let M;if(I&&(M=Pn(G,"expires",ve.kml)),l(M))try{let b=te.fromIso8601(M),R=te.secondsDifference(b,P);R>0&&R<F&&te.addSeconds(P,F,b),v.refreshMode=eg.EXPIRE,v.time=b}catch{Ft("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else Ft("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else l(e.camera)?(v.refreshMode=eg.STOP,v.time=g(ii(c,"viewRefreshTime",ve.kml),0)):Ft("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.");l(v.refreshMode)&&e._networkLinks.set(v.id,v)}}).catch(function(_){Ft(`An error occured during loading ${d.url}`),e._error.raiseEvent(e,_)});i.addPromise(x)}}}function G$e(e,t,n,i){let o=cQ[t.localName];return l(o)?o(e,t,n,i):Zpe(e,t,n,i)}function sQ(e,t,n,i,o,r,s){t.removeAll();let a=n.documentElement,c=a.localName==="Document"?a:Wi(a,"Document",ve.kml),d=Pn(c,"name",ve.kml);l(d)||(d=V0(i.getUrlComponent())),l(e._name)||(e._name=d);let u=new Pd._DeferredLoading(e),m=new ks(e);return Promise.all(_pe(e,n,m,i,!1,o)).then(function(){let p=n.documentElement;if(p.localName==="kml"){let f=p.childNodes;for(let x=0;x<f.length;x++){let _=f[x];if(l(cQ[_.localName])){p=_;break}}}let y={parentEntity:void 0,entityCollection:t,styleCollection:m,sourceResource:i,uriResolver:o,context:s,screenOverlayContainer:r};return t.suspendEvents(),G$e(e,p,y,u),t.resumeEvents(),u.wait().then(function(){return n.documentElement})})}function E$e(e,t,n,i,o){let r=on("ThirdParty/Workers/z-worker-pako.js");Q1({workerScripts:{deflate:[r,"./pako_deflate.min.js"],inflate:[r,"./pako_inflate.min.js"]}});let s=new JU(new M0(n));return Promise.resolve(s.getEntries()).then(function(a){let c=[],d={},u;for(let m=0;m<a.length;m++){let p=a[m];p.directory||(/\.kml$/i.test(p.filename)&&(!l(u)||!/\//i.test(p.filename))?(l(u)&&c.push(tQ(u,d)),u=p):c.push(tQ(p,d)))}return l(u)&&c.push(t$e(u,d)),Promise.all(c).then(function(){if(s.close(),!l(d.kml))throw new me("KMZ file does not contain a KML document.");return d.keys=Object.keys(d),sQ(e,t,d.kml,i,d,o)})})}function fQ(e,t,n,i){i=g(i,g.EMPTY_OBJECT);let o=i.sourceUri,r=i.uriResolver,s=i.context,a=i.screenOverlayContainer,c=n;if(typeof n=="string"||n instanceof Xe){n=Xe.createIfNeeded(n),c=n.fetchBlob(),o=g(o,n.clone());let d=e._resourceCredits,u=n.credits;if(l(u)){let m=u.length;for(let p=0;p<m;p++)d.push(u[p])}}else o=g(o,Xe.DEFAULT.clone());return o=Xe.createIfNeeded(o),l(a)&&(a=Wn(a)),Promise.resolve(c).then(function(d){return d instanceof Blob?$qe(d).then(function(u){return u?E$e(e,t,d,o,a):e$e(d).then(function(m){m=ppe(m),m=bpe(m);let p,y;try{p=aQ.parseFromString(m,"application/xml")}catch(f){y=f.toString()}if(l(y)||p.body||p.documentElement.tagName==="parsererror"){let f=l(y)?y:p.documentElement.firstChild.nodeValue;throw f||(f=p.body.innerText),new me(f)}return sQ(e,t,p,o,r,a,s)})}):sQ(e,t,d,o,r,a,s)}).catch(function(d){return e._error.raiseEvent(e,d),console.log(d),Promise.reject(d)})}function Pd(e){e=g(e,g.EMPTY_OBJECT);let t=e.camera,n=e.canvas;this._changed=new ye,this._error=new ye,this._loading=new ye,this._refresh=new ye,this._unsupportedNode=new ye,this._clock=void 0,this._entityCollection=new ks(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new U0,this._networkLinks=new Ct,this._entityCluster=new bd,this.canvas=n,this.camera=t,this._lastCameraView={position:l(t)?h.clone(t.positionWC):void 0,direction:l(t)?h.clone(t.directionWC):void 0,up:l(t)?h.clone(t.upWC):void 0,bbox:l(t)?t.computeViewRectangle():de.clone(de.MAX_VALUE)},this._ellipsoid=g(e.ellipsoid,oe.WGS84);let i=e.credit;typeof i=="string"&&(i=new Vt(i)),this._credit=i,this._resourceCredits=[],this._kmlTours=[],this._screenOverlays=[]}Pd.load=function(e,t){return t=g(t,g.EMPTY_OBJECT),new Pd(t).load(e,t)};Object.defineProperties(Pd.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}},credit:{get:function(){return this._credit}},kmlTours:{get:function(){return this._kmlTours}}});Pd.prototype.load=function(e,t){t=g(t,g.EMPTY_OBJECT),Wr.setLoading(this,!0);let n=this._name;this._name=void 0,this._clampToGround=g(t.clampToGround,!1);let i=this;return fQ(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,c=te.equals(s,Be.MINIMUM_VALUE),d=te.equals(a,Be.MAXIMUM_VALUE);if(!c||!d){let m;c&&(m=new Date,m.setHours(0,0,0,0),s=te.fromDate(m)),d&&(m=new Date,m.setHours(24,0,0,0),a=te.fromDate(m)),o=new th,o.startTime=s,o.stopTime=a,o.currentTime=te.clone(s),o.clockRange=vr.LOOP_STOP,o.clockStep=yo.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(te.secondsDifference(a,s)/60,1),31556900))}let u=!1;return o!==i._clock&&(i._clock=o,u=!0),n!==i._name&&(u=!0),u&&i._changed.raiseEvent(i),Wr.setLoading(i,!1),i}).catch(function(o){return Wr.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};Pd.prototype.destroy=function(){for(;this._screenOverlays.length>0;)this._screenOverlays.pop().remove()};function pQ(e){let t=e.parent;if(l(t)){let n=t.availability;if(l(n)){let i=e.availability;l(i)?i.intersect(n):e.availability=n}}}function I$e(e,t,n,i,o){return function(r){if(!i.contains(t.id))return;let s=!1,a=Wi(r,"NetworkLinkControl",ve.kml),c=l(a),d=0;if(c){if(l(Wi(a,"Update",ve.kml))){Ft("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=ed(g(Pn(a,"cookie",ve.kml),"")),d=g(ii(a,"minRefreshPeriod",ve.kml),0)}let u=te.now(),m=t.refreshMode;if(m===eg.INTERVAL)l(a)&&(t.time=Math.max(d,t.time));else if(m===eg.EXPIRE){let P;if(l(a)&&(P=Pn(a,"expires",ve.kml)),l(P))try{let v=te.fromIso8601(P),F=te.secondsDifference(v,u);F>0&&F<d&&te.addSeconds(u,d,v),t.time=v}catch{Ft("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),s=!0}else Ft("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),s=!0}let p=t.entity,y=e._entityCollection,f=n.values;function x(P){y.remove(P);let v=P._children,F=v.length;for(let M=0;M<F;++M)x(v[M])}y.suspendEvents();let _=y.values.slice(),C;for(C=0;C<_.length;++C){let P=_[C];P.parent===p&&(P.parent=void 0,x(P))}for(y.resumeEvents(),y.suspendEvents(),C=0;C<f.length;C++){let P=f[C];l(P.parent)||(P.parent=p,pQ(P)),y.add(P)}y.resumeEvents(),s?i.remove(t.id):t.lastUpdated=u;let V=y.computeAvailability(),L=V.start,Z=V.stop,G=te.equals(L,Be.MINIMUM_VALUE),I=te.equals(Z,Be.MAXIMUM_VALUE);if(!G||!I){let P=e._clock;(P.startTime!==L||P.stopTime!==Z)&&(P.startTime=L,P.stopTime=Z,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,o.getUrlComponent(!0))}}var oQ=new Ct;Pd.prototype.update=function(e){let t=this._networkLinks;if(t.length===0)return!0;let n=te.now(),i=this;oQ.removeAll();function o(u){let m=u._children,p=m.length;for(let y=0;y<p;++y){let f=m[y];oQ.set(f.id,f),o(f)}}let r=!1,s=this._lastCameraView,a=this.camera;l(a)&&!(a.positionWC.equalsEpsilon(s.position,W.EPSILON7)&&a.directionWC.equalsEpsilon(s.direction,W.EPSILON7)&&a.upWC.equalsEpsilon(s.up,W.EPSILON7))&&(s.position=h.clone(a.positionWC),s.direction=h.clone(a.directionWC),s.up=h.clone(a.upWC),s.bbox=a.computeViewRectangle(),r=!0);let c=new Ct,d=!1;return t.values.forEach(function(u){let m=u.entity;if(!oQ.contains(m.id)){if(!u.updating){let p=!1;if(u.refreshMode===eg.INTERVAL?te.secondsDifference(n,u.lastUpdated)>u.time&&(p=!0):u.refreshMode===eg.EXPIRE?te.greaterThan(n,u.time)&&(p=!0):u.refreshMode===eg.STOP&&(r&&(u.needsUpdate=!0,u.cameraUpdateTime=n),u.needsUpdate&&te.secondsDifference(n,u.cameraUpdateTime)>=u.time&&(p=!0)),p){o(m),u.updating=!0;let y=new ks,f=u.href.clone();f.setQueryParameters(u.cookie);let x=g(i._ellipsoid,oe.WGS84);hQ(f,i.camera,i.canvas,u.viewBoundScale,s.bbox,x),fQ(i,y,f,{context:m.id}).then(I$e(i,u,y,c,f)).catch(function(_){let C=`NetworkLink ${u.href} refresh failed: ${_}`;console.log(C),i._error.raiseEvent(i,C)}),d=!0}}c.set(u.id,u)}}),d&&(this._networkLinks=c,this._changed.raiseEvent(this)),!0};function X$e(){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}Pd._DeferredLoading=vf;Pd._getTimestamp=xi;var bv=Pd;var emi=T(S(),1);function yh(e){e=g(e,g.EMPTY_OBJECT),this._enabled=g(e.enabled,!1),this._pixelRange=g(e.pixelRange,80),this._minimumClusterSize=g(e.minimumClusterSize,2),this._clusterBillboards=g(e.clusterBillboards,!0),this._clusterLabels=g(e.clusterLabels,!0),this._clusterPoints=g(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 ye,this.show=g(e.show,!0)}function Gpe(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var W$e=new De;function Epe(e,t,n,i,o){if(l(e._labelCollection)&&i._clusterLabels?o=Dm.getScreenSpaceBoundingBox(e,t,o):l(e._billboardCollection)&&i._clusterBillboards?e.width&&e.height?o=Hi.getScreenSpaceBoundingBox(e,t,o):o=Hi.getScreenSpaceBoundingBox({width:e.width||30,height:e.height||30,scale:e.scale||1,horizontalOrigin:e.horizontalOrigin,verticalOrigin:e.verticalOrigin},t,o):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=ds.getScreenSpaceBoundingBox(e,t,o)),Gpe(o,n),i._clusterLabels&&!l(e._labelCollection)&&l(e._mars3d_graphicId)&&Xpe(i,e._mars3d_graphicId)){let r=i._labelCollection.get(e._mars3d_graphicId);if(r){let s=Dm.getScreenSpaceBoundingBox(r,t,W$e);Gpe(s,n),o=De.union(o,s,o)}}return o}function P$e(e,t){if(e.clusterShow=!0,t._clusterLabels&&!l(e._labelCollection)&&l(e._mars3d_graphicId)&&Xpe(t,e._mars3d_graphicId)){let n=t._labelCollection.get(e._mars3d_graphicId);n&&(n.clusterShow=!0)}}function Ipe(e,t,n,i){let o={billboard:i._clusterBillboardCollection.add(),label:i._clusterLabelCollection.add(),point:i._clusterPointCollection.add()};o.billboard.show=!1,o.point.show=!1,o.label.show=!0,o.label.text=t.toLocaleString(),o.label.id=n,o.billboard.position=o.label.position=o.point.position=e,i._clusterEvent.raiseEvent(n,o)}function Xpe(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function bQ(e,t,n,i,o){if(!l(e))return;let r=e.length;for(let s=0;s<r;++s){let a=e.get(s);if(a.clusterShow=!1,!a.show||o._scene.mode===ie.SCENE3D&&!i.isPointVisible(a.position))continue;let c=o._clusterLabels&&l(a._labelCollection),d=o._clusterBillboards&&l(o._billboardCollection.get(a._mars3d_graphicId)),u=o._clusterPoints&&l(o._pointCollection.get(a._mars3d_graphicId));if(c&&(u||d))continue;let m=a.computeScreenSpacePosition(n);l(m)&&t.push({index:s,collection:e,clustered:!1,coord:m})}}var v$e=new De,w$e=new De,F$e=new De;function A$e(e){return function(t){if(l(t)&&t<.05||!e.enabled)return;let n=e._scene,i=e._labelCollection,o=e._billboardCollection,r=e._pointCollection;if(!l(i)&&!l(o)&&!l(r)||!e._clusterBillboards&&!e._clusterLabels&&!e._clusterPoints)return;let s=e._clusterLabelCollection,a=e._clusterBillboardCollection,c=e._clusterPointCollection;l(s)?s.removeAll():s=e._clusterLabelCollection=new md({scene:n}),l(a)?a.removeAll():a=e._clusterBillboardCollection=new ac({scene:n}),l(c)?c.removeAll():c=e._clusterPointCollection=new S0;let d=e._pixelRange,u=e._minimumClusterSize,m=e._previousClusters,p=[],y=e._previousHeight,f=n.camera.positionCartographic.height,x=n.mapProjection.ellipsoid,_=n.camera.positionWC,C=new qm(x,_),V=[];e._clusterLabels&&bQ(i,V,n,C,e),e._clusterBillboards&&bQ(o,V,n,C,e),e._clusterPoints&&bQ(r,V,n,C,e);let L,Z,G,I,P,v,F,M,b,R,E,X;if(V.length>0){let w=new X_(V.length,64,Uint32Array);for(let N=0;N<V.length;++N)w.add(V[N].coord.x,V[N].coord.y);if(w.finish(),f<y)for(G=m.length,L=0;L<G;++L){let N=m[L];if(!C.isPointVisible(N.position))continue;let D=Hi._computeScreenSpacePosition(A.IDENTITY,N.position,h.ZERO,B.ZERO,n);if(!l(D))continue;let k=1-f/y,Y=N.width=N.width*k,U=N.height=N.height*k;Y=Math.max(Y,N.minimumWidth),U=Math.max(U,N.minimumHeight);let J=D.x-Y*.5,K=D.y-U*.5,ee=D.x+Y,H=D.y+U;for(P=w.range(J,K,ee,H),v=P.length,R=0,b=[],Z=0;Z<v;++Z)F=P[Z],M=V[F],M.clustered||(++R,E=M.collection,X=M.index,b.push(E.get(X)));if(R>=u)for(Ipe(N.position,R,b,e),p.push(N),Z=0;Z<v;++Z)V[P[Z]].clustered=!0}for(G=V.length,L=0;L<G;++L){let N=V[L];if(N.clustered)continue;N.clustered=!0,E=N.collection,X=N.index;let D=E.get(X);I=Epe(D,N.coord,d,e,v$e);let k=De.clone(I,w$e);P=w.range(I.x,I.y,I.x+I.width,I.y+I.height),v=P.length;let Y=h.clone(D.position);for(R=1,b=[D],Z=0;Z<v;++Z)if(F=P[Z],M=V[F],!M.clustered){let U=M.collection.get(M.index),J=Epe(U,M.coord,d,e,F$e);h.add(U.position,Y,Y),De.union(k,J,k),++R,b.push(U)}if(R>=u){let U=h.multiplyByScalar(Y,1/R,Y);for(Ipe(U,R,b,e),p.push({position:U,width:k.width,height:k.height,minimumWidth:I.width,minimumHeight:I.height}),Z=0;Z<v;++Z)V[P[Z]].clustered=!0}else P$e(D,e)}}s.length===0&&(s.destroy(),e._clusterLabelCollection=void 0),a.length===0&&(a.destroy(),e._clusterBillboardCollection=void 0),c.length===0&&(c.destroy(),e._clusterPointCollection=void 0),e._previousClusters=p,e._previousHeight=f}}yh.prototype._initialize=function(e){this._scene=e;let t=A$e(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(yh.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}}});function gQ(e,t,n,i){return function(o){let r=this[e];l(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let s=this._collectionIndicesByEntity[o];if(l(s)||(s=this._collectionIndicesByEntity[o]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),l(r)&&l(s[i]))return r.get(s[i]);l(r)||(r=this[e]=new t({scene:this._scene}));let a,c,d=this[n];d.length>0?(a=d.shift(),c=r.get(a)):(c=r.add(),a=r.length-1),s[i]=a;let u=this;return Promise.resolve().then(function(){u._clusterDirty=!0}),c}}function xQ(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}yh.prototype.getLabel=gQ("_labelCollection",md,"_unusedLabelIndices","labelIndex");yh.prototype.removeLabel=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e];if(!l(this._labelCollection)||!l(t)||!l(t.labelIndex))return;let n=t.labelIndex;t.labelIndex=void 0,xQ(this,e);let i=this._labelCollection.get(n);i.show=!1,i.text="",i.id=void 0,this._unusedLabelIndices.push(n),this._clusterDirty=!0};yh.prototype.getBillboard=gQ("_billboardCollection",ac,"_unusedBillboardIndices","billboardIndex");yh.prototype.removeBillboard=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e];if(!l(this._billboardCollection)||!l(t)||!l(t.billboardIndex))return;let n=t.billboardIndex;t.billboardIndex=void 0,xQ(this,e);let i=this._billboardCollection.get(n);i.id=void 0,i.show=!1,i.image=void 0,this._unusedBillboardIndices.push(n),this._clusterDirty=!0};yh.prototype.getPoint=gQ("_pointCollection",S0,"_unusedPointIndices","pointIndex");yh.prototype.removePoint=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e];if(!l(this._pointCollection)||!l(t)||!l(t.pointIndex))return;let n=t.pointIndex;t.pointIndex=void 0,xQ(this,e);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function yQ(e){if(!l(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function M$e(e){e.enabled||(l(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),l(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),l(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,yQ(e._labelCollection),yQ(e._billboardCollection),yQ(e._pointCollection))}yh.prototype.update=function(e){if(!this.show)return;let t;l(this._labelCollection)&&this._labelCollection.length>0&&this._labelCollection.get(0)._glyphs.length===0&&(t=e.commandList,e.commandList=[],this._labelCollection.update(e),e.commandList=t),l(this._billboardCollection)&&this._billboardCollection.length>0&&!l(this._billboardCollection.get(0).width)&&(t=e.commandList,e.commandList=[],this._billboardCollection.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,M$e(this),this._clusterDirty=!0),this._clusterDirty&&(this._clusterDirty=!1,this._cluster()),l(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),l(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),l(this._clusterPointCollection)&&this._clusterPointCollection.update(e),l(this._labelCollection)&&this._labelCollection.update(e),l(this._billboardCollection)&&this._billboardCollection.update(e),l(this._pointCollection)&&this._pointCollection.update(e)};yh.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(),l(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};var _Q=yh;var imi=T(S(),1);function yv(){fe.throwInstantiationError()}yv.prototype.update=fe.throwInstantiationError;yv.prototype.getBoundingSphere=fe.throwInstantiationError;yv.prototype.isDestroyed=fe.throwInstantiationError;yv.prototype.destroy=fe.throwInstantiationError;var TQ=yv;var gmi=T(S(),1);var rmi=T(S(),1),cT=`in vec4 position;
in vec2 textureCoordinates;
out vec2 v_textureCoordinates;
void main()
{
gl_Position = position;
v_textureCoordinates = textureCoordinates;
}
`;function Ck(e){this._context=e}var gv,N$e=new nt({primitiveType:Ae.TRIANGLES}),U$e=new ai({color:new O(0,0,0,0)});function k$e(e,t){return new na({context:e,colorTextures:[t],destroyAttachments:!1})}function D$e(e,t){return Qt.fromCache({context:e,vertexShaderSource:cT,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function B$e(e,t){return(!l(gv)||gv.viewport.width!==e||gv.viewport.height!==t)&&(gv=ke.fromCache({viewport:new De(0,0,e,t)})),gv}Ck.prototype.execute=function(e){l(e.preExecute)&&e.preExecute(e);let t=e.outputTexture,n=t.width,i=t.height,o=this._context,r=l(e.vertexArray)?e.vertexArray:o.getViewportQuadVertexArray(),s=l(e.shaderProgram)?e.shaderProgram:D$e(o,e.fragmentShaderSource),a=k$e(o,t),c=B$e(n,i),d=e.uniformMap,u=U$e;u.framebuffer=a,u.renderState=c,u.execute(o);let m=N$e;m.vertexArray=r,m.renderState=c,m.shaderProgram=s,m.uniformMap=d,m.framebuffer=a,m.execute(o),a.destroy(),e.persists||(s.destroy(),l(e.vertexArray)&&r.destroy()),l(e.postExecute)&&e.postExecute(t)};Ck.prototype.isDestroyed=function(){return!1};Ck.prototype.destroy=function(){return ue(this)};var xv=Ck;var khi=T(S(),1);var _mi=T(S(),1);function O$e(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var pc=O$e;var Rmi=T(S(),1);function gh(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(gh.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});gh.prototype.replaceShaderProgram=function(e){return l(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function Y$e(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}gh.prototype.getShaderProgram=function(e){let t=e.vertexShaderSource,n=e.fragmentShaderSource,i=e.attributeLocations;typeof t=="string"&&(t=new Oe({sources:[t]})),typeof n=="string"&&(n=new Oe({sources:[n]}));let o=t.getCacheKey(),r=n.getCacheKey(),s=l(i)?Y$e(i):"",a=`${o}:${r}:${s}`,c;if(l(this._shaders[a]))c=this._shaders[a],delete this._shadersToRelease[a];else{let d=this._context,u=t.createCombinedVertexShader(d),m=n.createCombinedFragmentShader(d),p=new Qt({gl:d._gl,logShaderCompilation:d.logShaderCompilation,debugShaders:d.debugShaders,vertexShaderSource:t,vertexShaderText:u,fragmentShaderSource:n,fragmentShaderText:m,attributeLocations:i});c={cache:this,shaderProgram:p,keyword:a,derivedKeywords:[],count:0},p._cachedShader=c,this._shaders[a]=c,++this._numberOfShaders}return++c.count,c.shaderProgram};gh.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=this._shaders[o];if(l(r)){SQ(this,r);let s=i.derivedKeywords.indexOf(t);s>-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};gh.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,o=this._shaders[i];if(l(o))return o.shaderProgram};gh.prototype.createDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=n.vertexShaderSource,s=n.fragmentShaderSource,a=n.attributeLocations;typeof r=="string"&&(r=new Oe({sources:[r]})),typeof s=="string"&&(s=new Oe({sources:[s]}));let c=this._context,d=r.createCombinedVertexShader(c),u=s.createCombinedFragmentShader(c),m=new Qt({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:r,vertexShaderText:d,fragmentShaderSource:s,fragmentShaderText:u,attributeLocations:a}),p={cache:this,shaderProgram:m,keyword:o,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),m._cachedShader=p,this._shaders[o]=p,m};function SQ(e,t){let n=t.derivedKeywords,i=n.length;for(let o=0;o<i;++o){let r=n[o]+t.keyword,s=e._shaders[r];SQ(e,s)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}gh.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];SQ(this,n),--this._numberOfShaders}this._shadersToRelease={}};gh.prototype.releaseShaderProgram=function(e){if(l(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};gh.prototype.isDestroyed=function(){return!1};gh.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return ue(this)};var _v=gh;var Imi=T(S(),1);function lT(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(lT.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});lT.prototype.getTexture=function(e){let t=this._textures[e];if(l(t))return delete this._texturesToRelease[e],++t.count,t.texture};lT.prototype.addTexture=function(e,t){let n={texture:t,count:1};t.finalDestroy=t.destroy;let i=this;t.destroy=function(){--n.count===0&&(i._texturesToRelease[e]=n)},this._textures[e]=n,++this._numberOfTextures};lT.prototype.destroyReleasedTextures=function(){let e=this._texturesToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];delete this._textures[t],n.texture.finalDestroy(),--this._numberOfTextures}this._texturesToRelease={}};lT.prototype.isDestroyed=function(){return!1};lT.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return ue(this)};var Tv=lT;var lhi=T(S(),1);var Nmi=T(S(),1);var CQ={};function H$e(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var K$e=32.184,z$e=2451545;function Qpe(e,t){t=te.addSeconds(e,K$e,t);let n=te.totalDays(t)-z$e;return t=te.addSeconds(t,H$e(n),t),t}var Vk=new te(2451545,0,Qn.TAI),J$e=1e3,Ku=W.RADIANS_PER_DEGREE,vd=W.RADIANS_PER_ARCSECOND,Pa=14959787e4,Wpe=new q;function jpe(e,t,n,i,o,r,s){n<0&&(n=-n,o+=W.PI);let a=e*(1-t),c=i-o,d=o,u=j$e(r-i,t),m=Q$e(t,0);net(c,n,d,Wpe);let p=a*(1+t),y=Math.cos(u),f=Math.sin(u),x=1+t*y,_=p/x;return l(s)?(s.x=_*y,s.y=_*f,s.z=0):s=new h(_*y,_*f,0),q.multiplyByVector(Wpe,s,s)}function Q$e(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function j$e(e,t){let n=eet(e,t);return tet(n,t)}var q$e=50,$$e=W.EPSILON8;function eet(e,t){let n=Math.floor(e/W.TWO_PI);e-=n*W.TWO_PI;let i=e+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),o=Number.MAX_VALUE,r;for(r=0;r<q$e&&Math.abs(o-i)>$$e;++r){o=i;let s=o-t*Math.sin(o)-e,a=1-t*Math.cos(o);i=o-s/a}return o=i+n*W.TWO_PI,o}function tet(e,t){let n=Math.floor(e/W.TWO_PI);e-=n*W.TWO_PI;let i=Math.cos(e)-t,o=Math.sin(e)*Math.sqrt(1-t*t),r=Math.atan2(o,i);return r=W.zeroToTwoPi(r),e<0&&(r-=W.TWO_PI),r+=n*W.TWO_PI,r}function net(e,t,n,i){let o=Math.cos(e),r=Math.sin(e),s=Math.cos(t),a=Math.sin(t),c=Math.cos(n),d=Math.sin(n);return l(i)?(i[0]=c*o-d*r*s,i[1]=d*o+c*r*s,i[2]=r*a,i[3]=-c*r-d*o*s,i[4]=-d*r+c*o*s,i[5]=o*a,i[6]=d*a,i[7]=-c*a,i[8]=s):i=new q(c*o-d*r*s,-c*r-d*o*s,d*a,d*o+c*r*s,-d*r+c*o*s,-c*a,r*a,o*a,s),i}var iet=1.0000010178*Pa,oet=100.46645683*Ku,ret=129597742283429e-5*vd,Ppe=16002,vpe=21863,wpe=32004,Fpe=10931,Ape=14529,Mpe=16368,Npe=15318,Upe=32794,set=64*1e-7*Pa,aet=-152*1e-7*Pa,cet=62*1e-7*Pa,det=-8*1e-7*Pa,uet=32*1e-7*Pa,met=-41*1e-7*Pa,het=19*1e-7*Pa,fet=-11*1e-7*Pa,pet=-150*1e-7*Pa,bet=-46*1e-7*Pa,yet=68*1e-7*Pa,get=54*1e-7*Pa,xet=14*1e-7*Pa,_et=24*1e-7*Pa,Tet=-28*1e-7*Pa,Cet=22*1e-7*Pa,kpe=10,Dpe=16002,Bpe=21863,Ope=10931,Ype=1473,Hpe=32004,Kpe=4387,zpe=73,Vet=-325*1e-7,Let=-322*1e-7,Ret=-79*1e-7,Zet=232*1e-7,Get=-52*1e-7,Eet=97*1e-7,Iet=55*1e-7,Xet=-41*1e-7,Wet=-105*1e-7,Pet=-137*1e-7,vet=258*1e-7,wet=35*1e-7,Fet=-116*1e-7,Aet=-88*1e-7,Met=-112*1e-7,Net=-80*1e-7,aV=new te(0,0,Qn.TAI);function Uet(e,t){Qpe(e,aV);let i=(aV.dayNumber-Vk.dayNumber+(aV.secondsOfDay-Vk.secondsOfDay)/qn.SECONDS_PER_DAY)/(qn.DAYS_PER_JULIAN_CENTURY*10),o=.3595362*i,r=iet+set*Math.cos(Ppe*o)+pet*Math.sin(Ppe*o)+aet*Math.cos(vpe*o)+bet*Math.sin(vpe*o)+cet*Math.cos(wpe*o)+yet*Math.sin(wpe*o)+det*Math.cos(Fpe*o)+get*Math.sin(Fpe*o)+uet*Math.cos(Ape*o)+xet*Math.sin(Ape*o)+met*Math.cos(Mpe*o)+_et*Math.sin(Mpe*o)+het*Math.cos(Npe*o)+Tet*Math.sin(Npe*o)+fet*Math.cos(Upe*o)+Cet*Math.sin(Upe*o),s=oet+ret*i+Vet*Math.cos(kpe*o)+Wet*Math.sin(kpe*o)+Let*Math.cos(Dpe*o)+Pet*Math.sin(Dpe*o)+Ret*Math.cos(Bpe*o)+vet*Math.sin(Bpe*o)+Zet*Math.cos(Ope*o)+wet*Math.sin(Ope*o)+Get*Math.cos(Ype*o)+Fet*Math.sin(Ype*o)+Eet*Math.cos(Hpe*o)+Aet*Math.sin(Hpe*o)+Iet*Math.cos(Kpe*o)+Met*Math.sin(Kpe*o)+Xet*Math.cos(zpe*o)+Net*Math.sin(zpe*o),a=.0167086342-.0004203654*i,c=102.93734808*Ku+11612.3529*vd*i,d=469.97289*vd*i,u=174.87317577*Ku-8679.27034*vd*i;return jpe(r,a,d,c,u,s,t)}function qpe(e,t){Qpe(e,aV);let i=(aV.dayNumber-Vk.dayNumber+(aV.secondsOfDay-Vk.secondsOfDay)/qn.SECONDS_PER_DAY)/qn.DAYS_PER_JULIAN_CENTURY,o=i*i,r=o*i,s=r*i,a=383397.7725+.004*i,c=.055545526-16e-9*i,d=5.15668983*Ku,u=-8e-5*i+.02966*o-42e-6*r-13e-8*s,m=83.35324312*Ku,p=146434202669e-4*i-38.2702*o-.045047*r+21301e-8*s,y=125.04455501*Ku,f=-69679193631e-4*i+6.3602*o+.007625*r-3586e-8*s,x=218.31664563*Ku,_=17325593434847e-4*i-6.391*o+.006588*r-3169e-8*s,C=297.85019547*Ku+vd*(1602961601209e-3*i-6.3706*o+.006593*r-3169e-8*s),V=93.27209062*Ku+vd*(17395272628478e-4*i-12.7512*o-.001037*r+417e-8*s),L=134.96340251*Ku+vd*(17179159232178e-4*i+31.8792*o+.051635*r-2447e-7*s),Z=357.52910918*Ku+vd*(1295965810481e-4*i-.5532*o+136e-6*r-1149e-8*s),G=310.17137918*Ku-vd*(6967051436e-3*i+6.2068*o+.007618*r-3219e-8*s),I=2*C,P=4*C,v=6*C,F=2*L,M=3*L,b=4*L,R=2*V;a+=3400.4*Math.cos(I)-635.6*Math.cos(I-L)-235.6*Math.cos(L)+218.1*Math.cos(I-Z)+181*Math.cos(I+L),c+=.014216*Math.cos(I-L)+.008551*Math.cos(I-F)-.001383*Math.cos(L)+.001356*Math.cos(I+L)-.001147*Math.cos(P-M)-914e-6*Math.cos(P-F)+869e-6*Math.cos(I-Z-L)-627e-6*Math.cos(I)-394e-6*Math.cos(P-b)+282e-6*Math.cos(I-Z-F)-279e-6*Math.cos(C-L)-236e-6*Math.cos(F)+231e-6*Math.cos(P)+229e-6*Math.cos(v-b)-201e-6*Math.cos(F-R),u+=486.26*Math.cos(I-R)-40.13*Math.cos(I)+37.51*Math.cos(R)+25.73*Math.cos(F-R)+19.97*Math.cos(I-Z-R),p+=-55609*Math.sin(I-L)-34711*Math.sin(I-F)-9792*Math.sin(L)+9385*Math.sin(P-M)+7505*Math.sin(P-F)+5318*Math.sin(I+L)+3484*Math.sin(P-b)-3417*Math.sin(I-Z-L)-2530*Math.sin(v-b)-2376*Math.sin(I)-2075*Math.sin(I-M)-1883*Math.sin(F)-1736*Math.sin(v-5*L)+1626*Math.sin(Z)-1370*Math.sin(v-M),f+=-5392*Math.sin(I-R)-540*Math.sin(Z)-441*Math.sin(I)+423*Math.sin(R)-288*Math.sin(F-R),_+=-3332.9*Math.sin(I)+1197.4*Math.sin(I-L)-662.5*Math.sin(Z)+396.3*Math.sin(L)-218*Math.sin(I-Z);let E=2*G,X=3*G;u+=46.997*Math.cos(G)*i-.614*Math.cos(I-R+G)*i+.614*Math.cos(I-R-G)*i-.0297*Math.cos(E)*o-.0335*Math.cos(G)*o+.0012*Math.cos(I-R+E)*o-16e-5*Math.cos(G)*r+4e-5*Math.cos(X)*r+4e-5*Math.cos(E)*r;let w=2.116*Math.sin(G)*i-.111*Math.sin(I-R-G)*i-.0015*Math.sin(G)*o;p+=w,_+=w,f+=-520.77*Math.sin(G)*i+13.66*Math.sin(I-R+G)*i+1.12*Math.sin(I-G)*i-1.06*Math.sin(R-G)*i+.66*Math.sin(E)*o+.371*Math.sin(G)*o-.035*Math.sin(I-R+E)*o-.015*Math.sin(I-R+G)*o+.0014*Math.sin(G)*r-.0011*Math.sin(X)*r-9e-4*Math.sin(E)*r,a*=J$e;let N=d+u*vd,D=m+p*vd,k=x+_*vd,Y=y+f*vd;return jpe(a,c,N,D,Y,k,t)}var Jpe=.012300034,ket=Jpe/(Jpe+1)*-1;function Det(e,t){return t=qpe(e,t),h.multiplyByScalar(t,ket,t)}var $pe=new q(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),Sv=new h;CQ.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=te.now()),l(t)||(t=new h),Sv=Uet(e,Sv),t=h.negate(Sv,t),Det(e,Sv),h.subtract(t,Sv,t),q.multiplyByVector($pe,t,t),t};CQ.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=te.now()),t=qpe(e,t),q.multiplyByVector($pe,t,t),t};var tg=CQ;var Bmi=T(S(),1);function Bet(e){e=g(e,g.EMPTY_OBJECT),this.color=O.clone(g(e.color,O.WHITE)),this.intensity=g(e.intensity,2)}var D0=Bet;function cV(){this.globeDepthTexture=void 0,this.gamma=void 0,this._viewport=new De,this._viewportCartesian4=new se,this._viewportDirty=!1,this._viewportOrthographicMatrix=A.clone(A.IDENTITY),this._viewportTransformation=A.clone(A.IDENTITY),this._model=A.clone(A.IDENTITY),this._view=A.clone(A.IDENTITY),this._inverseView=A.clone(A.IDENTITY),this._projection=A.clone(A.IDENTITY),this._infiniteProjection=A.clone(A.IDENTITY),this._entireFrustum=new B,this._currentFrustum=new B,this._frustumPlanes=new se,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=q.clone(A.IDENTITY),this._view3DDirty=!0,this._view3D=new A,this._inverseView3DDirty=!0,this._inverseView3D=new A,this._inverseModelDirty=!0,this._inverseModel=new A,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new q,this._viewRotation=new q,this._inverseViewRotation=new q,this._viewRotation3D=new q,this._inverseViewRotation3D=new q,this._inverseProjectionDirty=!0,this._inverseProjection=new A,this._modelViewDirty=!0,this._modelView=new A,this._modelView3DDirty=!0,this._modelView3D=new A,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new A,this._inverseModelViewDirty=!0,this._inverseModelView=new A,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new A,this._viewProjectionDirty=!0,this._viewProjection=new A,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new A,this._modelViewProjectionDirty=!0,this._modelViewProjection=new A,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new A,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new A,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new A,this._normalDirty=!0,this._normal=new q,this._normal3DDirty=!0,this._normal3D=new q,this._inverseNormalDirty=!0,this._inverseNormal=new q,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new q,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new Kn,this._cameraPosition=new h,this._sunPositionWC=new h,this._sunPositionColumbusView=new h,this._sunDirectionWC=new h,this._sunDirectionEC=new h,this._moonDirectionEC=new h,this._lightDirectionWC=new h,this._lightDirectionEC=new h,this._lightColor=new h,this._lightColorHdr=new h,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new h,this._cameraRight=new h,this._cameraUp=new h,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new B,this._eyeEllipsoidNormalEC=new h,this._eyeEllipsoidCurvature=new B,this._modelToEnu=new A,this._enuToModel=new A,this._pixelRatio=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 B,this._specularEnvironmentMapsMaximumLOD=void 0,this._fogDensity=void 0,this._fogMinimumBrightness=void 0,this._atmosphereHsbShift=void 0,this._atmosphereLightIntensity=void 0,this._atmosphereRayleighCoefficient=new h,this._atmosphereRayleighScaleHeight=new h,this._atmosphereMieCoefficient=new h,this._atmosphereMieScaleHeight=void 0,this._atmosphereMieAnisotropy=void 0,this._atmosphereDynamicLighting=void 0,this._invertClassificationColor=void 0,this._splitPosition=0,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0,this._minimumDisableDepthTestDistance=void 0}Object.defineProperties(cV.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!De.equals(e,this._viewport)){De.clone(e,this._viewport);let t=this._viewport,n=this._viewportCartesian4;n.x=t.x,n.y=t.y,n.z=t.width,n.w=t.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return t0e(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return t0e(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){A.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,A.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,A.getMatrix3(this.inverseModel,e),q.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return VQ(this),this._view3D}},viewRotation:{get:function(){return VQ(this),this._viewRotation}},viewRotation3D:{get:function(){return VQ(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return o0e(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return o0e(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return ett(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return ttt(this),this._modelView}},modelView3D:{get:function(){return ntt(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return ctt(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return itt(this),this._inverseModelView}},inverseModelView3D:{get:function(){return ott(this),this._inverseModelView3D}},viewProjection:{get:function(){return rtt(this),this._viewProjection}},inverseViewProjection:{get:function(){return stt(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return att(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return ltt(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return dtt(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return utt(this),this._modelViewInfiniteProjection}},normal:{get:function(){return mtt(this),this._normal}},normal3D:{get:function(){return htt(this),this._normal3D}},inverseNormal:{get:function(){return ftt(this),this._inverseNormal}},inverseNormal3D:{get:function(){return ptt(this),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},frustumPlanes:{get:function(){return this._frustumPlanes}},farDepthFromNearPlusOne:{get:function(){return this._farDepthFromNearPlusOne}},log2FarDepthFromNearPlusOne:{get:function(){return this._log2FarDepthFromNearPlusOne}},oneOverLog2FarDepthFromNearPlusOne:{get:function(){return this._oneOverLog2FarDepthFromNearPlusOne}},eyeHeight:{get:function(){return this._eyeHeight}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},eyeEllipsoidNormalEC:{get:function(){return this._eyeEllipsoidNormalEC}},eyeEllipsoidCurvature:{get:function(){return this._eyeEllipsoidCurvature}},modelToEnu:{get:function(){return this._modelToEnu}},enuToModel:{get:function(){return this._enuToModel}},sunPositionWC:{get:function(){return this._sunPositionWC}},sunPositionColumbusView:{get:function(){return this._sunPositionColumbusView}},sunDirectionWC:{get:function(){return this._sunDirectionWC}},sunDirectionEC:{get:function(){return this._sunDirectionEC}},moonDirectionEC:{get:function(){return this._moonDirectionEC}},lightDirectionWC:{get:function(){return this._lightDirectionWC}},lightDirectionEC:{get:function(){return this._lightDirectionEC}},lightColor:{get:function(){return this._lightColor}},lightColorHdr:{get:function(){return this._lightColorHdr}},encodedCameraPositionMCHigh:{get:function(){return i0e(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return i0e(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},pixelRatio:{get:function(){return this._pixelRatio}},fogDensity:{get:function(){return this._fogDensity}},fogMinimumBrightness:{get:function(){return this._fogMinimumBrightness}},atmosphereHsbShift:{get:function(){return this._atmosphereHsbShift}},atmosphereLightIntensity:{get:function(){return this._atmosphereLightIntensity}},atmosphereRayleighCoefficient:{get:function(){return this._atmosphereRayleighCoefficient}},atmosphereRayleighScaleHeight:{get:function(){return this._atmosphereRayleighScaleHeight}},atmosphereMieCoefficient:{get:function(){return this._atmosphereMieCoefficient}},atmosphereMieScaleHeight:{get:function(){return this._atmosphereMieScaleHeight}},atmosphereMieAnisotropy:{get:function(){return this._atmosphereMieAnisotropy}},atmosphereDynamicLighting:{get:function(){return this._atmosphereDynamicLighting}},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}},splitPosition:{get:function(){return this._splitPosition}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance}},invertClassificationColor:{get:function(){return this._invertClassificationColor}},orthographicIn3D:{get:function(){return this._orthographicIn3D}},ellipsoid:{get:function(){return g(this._ellipsoid,oe.WGS84)}}});function Oet(e,t){A.clone(t,e._view),A.getMatrix3(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 Yet(e,t){A.clone(t,e._inverseView),A.getMatrix3(t,e._inverseViewRotation)}function Het(e,t){A.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function Ket(e,t){A.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var e0e=new h,zet=new A;function Jet(e,t){h.clone(t.positionWC,e._cameraPosition),h.clone(t.directionWC,e._cameraDirection),h.clone(t.rightWC,e._cameraRight),h.clone(t.upWC,e._cameraUp);let n=e._ellipsoid,i,o=t.positionCartographic;if(l(o)?(e._eyeHeight=o.height,e._eyeEllipsoidNormalEC=n.geodeticSurfaceNormalCartographic(o,e._eyeEllipsoidNormalEC),i=h.fromRadians(o.longitude,o.latitude,0,n,e0e)):(e._eyeHeight=-n.maximumRadius,h.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=h.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,e0e)),e._encodedCameraPositionMCDirty=!0,!l(i))return;e._eyeEllipsoidNormalEC=q.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let r=Xt.eastNorthUpToFixedFrame(i,n,zet);e._enuToModel=A.multiplyTransformation(e.inverseModel,r,e._enuToModel),e._modelToEnu=A.inverseTransformation(e._enuToModel,e._modelToEnu),W.equalsEpsilon(n._radii.x,n._radii.y,W.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var Cv=new q,Qet=new he;function jet(e,t){l(Xt.computeIcrfToFixedMatrix(t.time,Cv))||(Cv=Xt.computeTemeToPseudoFixedMatrix(t.time,Cv));let n=tg.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);q.multiplyByVector(Cv,n,n),h.normalize(n,e._sunDirectionWC),n=q.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),h.normalize(n,n),n=tg.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),q.multiplyByVector(Cv,n,n),q.multiplyByVector(e.viewRotation3D,n,n),h.normalize(n,n);let i=t.mapProjection,r=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,Qet);i.project(r,e._sunPositionColumbusView)}cV.prototype.updateCamera=function(e){Oet(this,e.viewMatrix),Yet(this,e.inverseViewMatrix),Jet(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==ie.SCENE2D&&e.frustum instanceof rn};cV.prototype.updateFrustum=function(e){Het(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&Ket(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=W.log2(this._farDepthFromNearPlusOne),this._oneOverLog2FarDepthFromNearPlusOne=1/this._log2FarDepthFromNearPlusOne;let t=e.offCenterFrustum;l(t)&&(e=t),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right};cV.prototype.updatePass=function(e){this._pass=e};var qet=[],$et=new D0;cV.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection,this._ellipsoid=e.mapProjection.ellipsoid,this._pixelRatio=e.pixelRatio;let t=e.camera;this.updateCamera(t),e.mode===ie.SCENE2D?(this._frustum2DWidth=t.frustum.right-t.frustum.left,this._eyeHeight2D.x=this._frustum2DWidth*.5,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),jet(this,e);let n=g(e.light,$et);n instanceof D0?(this._lightDirectionWC=h.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=h.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=h.normalize(h.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=q.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let i=n.color,o=h.fromElements(i.red,i.green,i.blue,this._lightColorHdr);o=h.multiplyByScalar(o,n.intensity,o);let r=h.maximumComponent(o);r>1?h.divideByScalar(o,r,this._lightColor):h.clone(o,this._lightColor);let s=e.brdfLutGenerator,a=l(s)?s.colorTexture:void 0;this._brdfLut=a,this._environmentMap=g(e.environmentMap,e.context.defaultCubeMap),this._sphericalHarmonicCoefficients=g(e.sphericalHarmonicCoefficients,qet),this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,l(this._specularEnvironmentMaps)&&B.clone(this._specularEnvironmentMaps.dimensions,this._specularEnvironmentMapsDimensions),this._fogDensity=e.fog.density,this._fogMinimumBrightness=e.fog.minimumBrightness;let c=e.atmosphere;l(c)&&(this._atmosphereHsbShift=h.fromElements(c.hueShift,c.saturationShift,c.brightnessShift,this._atmosphereHsbShift),this._atmosphereLightIntensity=c.lightIntensity,this._atmosphereRayleighCoefficient=h.clone(c.rayleighCoefficient,this._atmosphereRayleighCoefficient),this._atmosphereRayleighScaleHeight=c.rayleighScaleHeight,this._atmosphereMieCoefficient=h.clone(c.mieCoefficient,this._atmosphereMieCoefficient),this._atmosphereMieScaleHeight=c.mieScaleHeight,this._atmosphereMieAnisotropy=c.mieAnisotropy,this._atmosphereDynamicLighting=c.dynamicLighting),this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=Xt.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let d=t.frustum.fov,u=this._viewport,m;l(d)?u.height>u.width?m=Math.tan(.5*d)*2/u.height:m=Math.tan(.5*d)*2/u.width:m=1/Math.max(u.width,u.height),this._geometricToleranceOverMeter=m*e.maximumScreenSpaceError,O.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function t0e(e){if(e._viewportDirty){let t=e._viewport;A.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),A.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function ett(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==ie.SCENE2D&&e._mode!==ie.MORPHING&&!e._orthographicIn3D?A.inverse(e._projection,e._inverseProjection):A.clone(A.ZERO,e._inverseProjection))}function ttt(e){e._modelViewDirty&&(e._modelViewDirty=!1,A.multiplyTransformation(e._view,e._model,e._modelView))}function ntt(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,A.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function itt(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,A.inverse(e.modelView,e._inverseModelView))}function ott(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,A.inverse(e.modelView3D,e._inverseModelView3D))}function rtt(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,A.multiply(e._projection,e._view,e._viewProjection))}function stt(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,A.inverse(e.viewProjection,e._inverseViewProjection))}function att(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,A.multiply(e._projection,e.modelView,e._modelViewProjection))}function ctt(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;let t=e.modelView,n=e._modelViewRelativeToEye;n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=0,n[13]=0,n[14]=0,n[15]=t[15]}}function ltt(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,A.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function dtt(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,A.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function utt(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,A.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function mtt(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;A.getMatrix3(e.inverseModelView,t),q.transpose(t,t)}}function htt(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;A.getMatrix3(e.inverseModelView3D,t),q.transpose(t,t)}}function ftt(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;A.getMatrix3(e.modelView,t),q.transpose(t,t)}}function ptt(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;A.getMatrix3(e.modelView3D,t),q.transpose(t,t)}}var n0e=new h;function i0e(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,A.multiplyByPoint(e.inverseModel,e._cameraPosition,n0e),Kn.fromCartesian(n0e,e._encodedCameraPositionMC))}var btt=new h,ytt=new h,gtt=new h,xtt=new h,_tt=new he,Ttt=new h,Stt=new A;function Ctt(e,t,n,i,o,r,s,a){let c=btt;c.x=e.y,c.y=e.z,c.z=e.x;let d=ytt;d.x=n.y,d.y=n.z,d.z=n.x;let u=gtt;u.x=i.y,u.y=i.z,u.z=i.x;let m=xtt;m.x=t.y,m.y=t.z,m.z=t.x,r===ie.SCENE2D&&(c.z=o*.5);let p=s.unproject(c,_tt);p.longitude=W.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=W.clamp(p.latitude,-W.PI_OVER_TWO,W.PI_OVER_TWO);let y=s.ellipsoid,f=y.cartographicToCartesian(p,Ttt),x=Xt.eastNorthUpToFixedFrame(f,y,Stt);return A.multiplyByPointAsVector(x,d,d),A.multiplyByPointAsVector(x,u,u),A.multiplyByPointAsVector(x,m,m),l(a)||(a=new A),a[0]=d.x,a[1]=u.x,a[2]=-m.x,a[3]=0,a[4]=d.y,a[5]=u.y,a[6]=-m.y,a[7]=0,a[8]=d.z,a[9]=u.z,a[10]=-m.z,a[11]=0,a[12]=-h.dot(d,f),a[13]=-h.dot(u,f),a[14]=h.dot(m,f),a[15]=1,a}function VQ(e){e._view3DDirty&&(e._mode===ie.SCENE3D?A.clone(e._view,e._view3D):Ctt(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),A.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function o0e(e){e._inverseView3DDirty&&(A.inverseTransformation(e.view3D,e._inverseView3D),A.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var Vv=cV;function wd(e,t){let{getWebGLStub:n,requestWebgl1:i,webgl:o={},allowTextureFilterAnisotropic:r=!0}=g(t,{});o.alpha=g(o.alpha,!1),o.stencil=g(o.stencil,!0),o.powerPreference=g(o.powerPreference,"high-performance");let s=l(n)?n(e,o):Vtt(e,o,i),c=typeof WebGL2RenderingContext<"u"&&s instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=s,this._gl=s,this._webgl2=c,this._id=Hn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new _v(this),this._textureCache=new Tv;let d=s;this._stencilBits=d.getParameter(d.STENCIL_BITS),Yt._maximumCombinedTextureImageUnits=d.getParameter(d.MAX_COMBINED_TEXTURE_IMAGE_UNITS),Yt._maximumCubeMapSize=d.getParameter(d.MAX_CUBE_MAP_TEXTURE_SIZE),Yt._maximumFragmentUniformVectors=d.getParameter(d.MAX_FRAGMENT_UNIFORM_VECTORS),Yt._maximumTextureImageUnits=d.getParameter(d.MAX_TEXTURE_IMAGE_UNITS),Yt._maximumRenderbufferSize=d.getParameter(d.MAX_RENDERBUFFER_SIZE),Yt._maximumTextureSize=d.getParameter(d.MAX_TEXTURE_SIZE),Yt._maximumVaryingVectors=d.getParameter(d.MAX_VARYING_VECTORS),Yt._maximumVertexAttributes=d.getParameter(d.MAX_VERTEX_ATTRIBS),Yt._maximumVertexTextureImageUnits=d.getParameter(d.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Yt._maximumVertexUniformVectors=d.getParameter(d.MAX_VERTEX_UNIFORM_VECTORS),Yt._maximumSamples=this._webgl2?d.getParameter(d.MAX_SAMPLES):0;let u=d.getParameter(d.ALIASED_LINE_WIDTH_RANGE);Yt._minimumAliasedLineWidth=u[0],Yt._maximumAliasedLineWidth=u[1];let m=d.getParameter(d.ALIASED_POINT_SIZE_RANGE);Yt._minimumAliasedPointSize=m[0],Yt._maximumAliasedPointSize=m[1];let p=d.getParameter(d.MAX_VIEWPORT_DIMS);Yt._maximumViewportWidth=p[0],Yt._maximumViewportHeight=p[1];let y=d.getShaderPrecisionFormat(d.FRAGMENT_SHADER,d.HIGH_FLOAT);Yt._highpFloatSupported=y.precision!==0;let f=d.getShaderPrecisionFormat(d.FRAGMENT_SHADER,d.HIGH_INT);Yt._highpIntSupported=f.rangeMax!==0,this._antialias=d.getContextAttributes().antialias,this._standardDerivatives=!!Mr(d,["OES_standard_derivatives"]),this._blendMinmax=!!Mr(d,["EXT_blend_minmax"]),this._elementIndexUint=!!Mr(d,["OES_element_index_uint"]),this._depthTexture=!!Mr(d,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!Mr(d,["EXT_frag_depth"]),this._debugShaders=Mr(d,["WEBGL_debug_shaders"]),this._textureFloat=!!Mr(d,["OES_texture_float"]),this._textureHalfFloat=!!Mr(d,["OES_texture_half_float"]),this._textureFloatLinear=!!Mr(d,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!Mr(d,["OES_texture_half_float_linear"]),this._colorBufferFloat=!!Mr(d,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!Mr(d,["EXT_float_blend"]),this._colorBufferHalfFloat=!!Mr(d,["EXT_color_buffer_half_float"]),this._s3tc=!!Mr(d,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!Mr(d,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!Mr(d,["WEBGL_compressed_texture_astc"]),this._etc=!!Mr(d,["WEBG_compressed_texture_etc"]),this._etc1=!!Mr(d,["WEBGL_compressed_texture_etc1"]),this._bc7=!!Mr(d,["EXT_texture_compression_bptc"]),bl.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let x=r?Mr(d,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=x,Yt._maximumTextureFilterAnisotropy=l(x)?d.getParameter(x.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let _,C,V,L,Z,G,I,P,v,F;if(c){let E=this;_=function(){return E._gl.createVertexArray()},C=function(X){E._gl.bindVertexArray(X)},V=function(X){E._gl.deleteVertexArray(X)},L=function(X,w,N,D,k){d.drawElementsInstanced(X,w,N,D,k)},Z=function(X,w,N,D){d.drawArraysInstanced(X,w,N,D)},G=function(X,w){d.vertexAttribDivisor(X,w)},I=function(X){d.drawBuffers(X)}}else P=Mr(d,["OES_vertex_array_object"]),l(P)&&(_=function(){return P.createVertexArrayOES()},C=function(E){P.bindVertexArrayOES(E)},V=function(E){P.deleteVertexArrayOES(E)}),v=Mr(d,["ANGLE_instanced_arrays"]),l(v)&&(L=function(E,X,w,N,D){v.drawElementsInstancedANGLE(E,X,w,N,D)},Z=function(E,X,w,N){v.drawArraysInstancedANGLE(E,X,w,N)},G=function(E,X){v.vertexAttribDivisorANGLE(E,X)}),F=Mr(d,["WEBGL_draw_buffers"]),l(F)&&(I=function(E){F.drawBuffersWEBGL(E)});this.glCreateVertexArray=_,this.glBindVertexArray=C,this.glDeleteVertexArray=V,this.glDrawElementsInstanced=L,this.glDrawArraysInstanced=Z,this.glVertexAttribDivisor=G,this.glDrawBuffers=I,this._vertexArrayObject=!!P,this._instancedArrays=!!v,this._drawBuffers=!!F,Yt._maximumDrawBuffers=this.drawBuffers?d.getParameter(ne.MAX_DRAW_BUFFERS):1,Yt._maximumColorAttachments=this.drawBuffers?d.getParameter(ne.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new O(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let M=new Vv,b=new pc(this),R=ke.fromCache();this._defaultPassState=b,this._defaultRenderState=R,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=M,this._currentRenderState=R,this._currentPassState=b,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let E=0;E<Yt._maximumVertexAttributes;E++)this._vertexAttribDivisors.push(0);this._pickObjects={},this._nextPickColor=new Uint32Array(1),this.options={getWebGLStub:n,requestWebgl1:i,webgl:o,allowTextureFilterAnisotropic:r},this.cache={},ke.apply(d,R,b)}function Vtt(e,t,n){if(typeof WebGLRenderingContext>"u")throw new me("The browser does not support WebGL. Visit http://get.webgl.org.");!n&&!(typeof WebGL2RenderingContext<"u")&&(n=!0);let o=n?"webgl":"webgl2",r=e.getContext(o,t);if(!l(r))throw new me("The browser supports WebGL, but initialization failed.");return r}function Ltt(e,t){let n="WebGL Error: ";switch(t){case e.INVALID_ENUM:n+="INVALID_ENUM";break;case e.INVALID_VALUE:n+="INVALID_VALUE";break;case e.INVALID_OPERATION:n+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:n+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:n+="CONTEXT_LOST_WEBGL lost";break;default:n+=`Unknown (${t})`}return n}function Rtt(e,t,n,i){let o=`${Ltt(e,i)}: ${t.name}(`;for(let r=0;r<n.length;++r)r!==0&&(o+=", "),o+=n[r];return o+=");",o}function Ztt(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new me(Rtt(e,t,n,i))}function Gtt(e,t,n){return{get:function(){let i=e[t];return n(e,`get: ${t}`,i),e[t]},set:function(i){e[t]=i,n(e,`set: ${t}`,i)}}}function Ett(e,t){if(!l(t))return e;function n(o){return function(){let r=o.apply(e,arguments);return t(e,o,arguments),r}}let i={};for(let o in e){let r=e[o];r instanceof Function?i[o]=n(r):Object.defineProperty(i,o,Gtt(e,o,t))}return i}function Mr(e,t){let n=t.length;for(let i=0;i<n;++i){let o=e.getExtension(t[i]);if(o)return o}}var Itt={};Object.defineProperties(wd.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}},msaa:{get:function(){return this._webgl2}},standardDerivatives:{get:function(){return this._standardDerivatives||this._webgl2}},floatBlend:{get:function(){return this._floatBlend}},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}},astc:{get:function(){return this._astc}},etc:{get:function(){return this._etc}},etc1:{get:function(){return this._etc1}},bc7:{get:function(){return this._bc7}},supportsBasis:{get:function(){return this._s3tc||this._pvrtc||this._astc||this._etc||this._etc1||this._bc7}},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=Ett(this._originalGLContext,e?Ztt:void 0)}},defaultTexture:{get:function(){return this._defaultTexture===void 0&&(this._defaultTexture=new wt({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])},flipY:!1})),this._defaultTexture}},defaultEmissiveTexture:{get:function(){return this._defaultEmissiveTexture===void 0&&(this._defaultEmissiveTexture=new wt({context:this,pixelFormat:at.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([0,0,0])},flipY:!1})),this._defaultEmissiveTexture}},defaultNormalTexture:{get:function(){return this._defaultNormalTexture===void 0&&(this._defaultNormalTexture=new wt({context:this,pixelFormat:at.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([128,128,255])},flipY:!1})),this._defaultNormalTexture}},defaultCubeMap:{get:function(){if(this._defaultCubeMap===void 0){let e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=new Ja({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 Itt}}});function r0e(e,t,n,i){let o=e._currentRenderState,r=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,ke.partialApply(e._gl,o,t,r,n,i)}var LQ;typeof WebGLRenderingContext<"u"&&(LQ=[ne.BACK]);function RQ(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=LQ;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var Xtt=new ai;wd.prototype.clear=function(e,t){e=g(e,Xtt),t=g(t,this._defaultPassState);let n=this._gl,i=0,o=e.color,r=e.depth,s=e.stencil;l(o)&&(O.equals(this._clearColor,o)||(O.clone(o,this._clearColor),n.clearColor(o.red,o.green,o.blue,o.alpha)),i|=n.COLOR_BUFFER_BIT),l(r)&&(r!==this._clearDepth&&(this._clearDepth=r,n.clearDepth(r)),i|=n.DEPTH_BUFFER_BIT),l(s)&&(s!==this._clearStencil&&(this._clearStencil=s,n.clearStencil(s)),i|=n.STENCIL_BUFFER_BIT);let a=g(e.renderState,this._defaultRenderState);r0e(this,a,t,!0);let c=g(e.framebuffer,t.framebuffer);RQ(this,c),n.clear(i)};function Wtt(e,t,n,i,o){RQ(e,t),r0e(e,o,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function Ptt(e,t,n,i){let o=t._primitiveType,r=t._vertexArray,s=t._offset,a=t._count,c=t.instanceCount;e._us.model=g(t._modelMatrix,A.IDENTITY),n._setUniforms(i,e._us,e.validateShaderProgram),r._bind();let d=r.indexBuffer;l(d)?(s=s*d.bytesPerIndex,l(a)?a=Math.min(a,d.numberOfIndices):a=d.numberOfIndices,c===0?e._gl.drawElements(o,a,d.indexDatatype,s):e.glDrawElementsInstanced(o,a,d.indexDatatype,s,c)):(l(a)?a=Math.min(a,r.numberOfVertices):a=r.numberOfVertices,c===0?e._gl.drawArrays(o,s,a):e.glDrawArraysInstanced(o,s,a,c)),r._unBind()}wd.prototype.draw=function(e,t,n,i){t=g(t,this._defaultPassState);let o=g(e._framebuffer,t.framebuffer),r=g(e._renderState,this._defaultRenderState);n=g(n,e._shaderProgram),i=g(i,e._uniformMap),Wtt(this,o,t,n,r),Ptt(this,e,n,i)};wd.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=LQ;this.drawBuffers&&this.glDrawBuffers(t);let n=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(let i=0;i<n;++i)e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,null),e.bindTexture(e.TEXTURE_CUBE_MAP,null)};wd.prototype.readPixels=function(e){let t=this._gl;e=g(e,g.EMPTY_OBJECT);let n=Math.max(g(e.x,0),0),i=Math.max(g(e.y,0),0),o=g(e.width,t.drawingBufferWidth),r=g(e.height,t.drawingBufferHeight),s=e.framebuffer,a=je.UNSIGNED_BYTE;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype);let c=at.createTypedArray(at.RGBA,a,o,r);return RQ(this,s),t.readPixels(n,i,o,r,at.RGBA,je.toWebGLConstant(a,this),c),c};var s0e={position:0,textureCoordinates:1};wd.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!l(e)){let t=new mt({attributes:{position:new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:Ae.TRIANGLES});e=oi.fromGeometry({context:this,geometry:t,attributeLocations:s0e,bufferUsage:Ue.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};wd.prototype.createViewportQuadCommand=function(e,t){return t=g(t,g.EMPTY_OBJECT),new nt({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Ae.TRIANGLES,renderState:t.renderState,shaderProgram:Qt.fromCache({context:this,vertexShaderSource:cT,fragmentShaderSource:e,attributeLocations:s0e}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};wd.prototype.getObjectByPickColor=function(e){return this._pickObjects[e.toRgba()]};function ZQ(e,t,n){this._pickObjects=e,this.key=t,this.color=n}Object.defineProperties(ZQ.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}});ZQ.prototype.destroy=function(){delete this._pickObjects[this.key]};wd.prototype.createPickId=function(e){++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new me("Out of unique Pick IDs.");return this._pickObjects[t]=e,new ZQ(this._pickObjects,t,O.fromRgba(t))};wd.prototype.isDestroyed=function(){return!1};wd.prototype.destroy=function(){let e=this.cache;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];l(n.destroy)&&n.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._textureCache=this._textureCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultEmissiveTexture=this._defaultEmissiveTexture&&this._defaultEmissiveTexture.destroy(),this._defaultNormalTexture=this._defaultNormalTexture&&this._defaultNormalTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),ue(this)};wd._deprecationWarning=_r;var Lv=wd;var Yhi=T(S(),1);function vtt(e,t,n){let i={flipY:!0,skipColorSpaceConversion:n,preferImageBitmap:!0},o=[Xe.createIfNeeded(t.positiveX).fetchImage(i),Xe.createIfNeeded(t.negativeX).fetchImage(i),Xe.createIfNeeded(t.positiveY).fetchImage(i),Xe.createIfNeeded(t.negativeY).fetchImage(i),Xe.createIfNeeded(t.positiveZ).fetchImage(i),Xe.createIfNeeded(t.negativeZ).fetchImage(i)];return Promise.all(o).then(function(r){return new Ja({context:e,source:{positiveX:r[0],negativeX:r[1],positiveY:r[2],negativeY:r[3],positiveZ:r[4],negativeZ:r[5]}})})}var Rv=vtt;var Khi=T(S(),1),lV=`#ifdef MRT
layout (location = 0) out vec4 out_FragData_0;
layout (location = 1) out vec4 out_FragData_1;
#else
layout (location = 0) out vec4 out_FragColor;
#endif
uniform vec4 u_bgColor;
uniform sampler2D u_depthTexture;
in vec2 v_textureCoordinates;
void main()
{
if (texture(u_depthTexture, v_textureCoordinates).r < 1.0)
{
#ifdef MRT
out_FragData_0 = u_bgColor;
out_FragData_1 = vec4(u_bgColor.a);
#else
out_FragColor = u_bgColor;
#endif
return;
}
discard;
}
`;var Jhi=T(S(),1),B0=`uniform vec3 u_radiiAndDynamicAtmosphereColor;
uniform float u_atmosphereLightIntensity;
uniform float u_atmosphereRayleighScaleHeight;
uniform float u_atmosphereMieScaleHeight;
uniform float u_atmosphereMieAnisotropy;
uniform vec3 u_atmosphereRayleighCoefficient;
uniform vec3 u_atmosphereMieCoefficient;
const float ATMOSPHERE_THICKNESS = 111e3; // The thickness of the atmosphere in meters.
const int PRIMARY_STEPS_MAX = 16; // Maximum number of times the ray from the camera to the world position (primary ray) is sampled.
const int LIGHT_STEPS_MAX = 4; // Maximum number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray.
/**
* This function computes the colors contributed by Rayliegh and Mie scattering on a given ray, as well as
* the transmittance value for the ray.
*
* @param {czm_ray} primaryRay The ray from the camera to the position.
* @param {float} primaryRayLength The length of the primary ray.
* @param {vec3} lightDirection The direction of the light to calculate the scattering from.
* @param {vec3} rayleighColor The variable the Rayleigh scattering will be written to.
* @param {vec3} mieColor The variable the Mie scattering will be written to.
* @param {float} opacity The variable the transmittance will be written to.
* @glslFunction
*/
void computeScattering(
czm_ray primaryRay,
float primaryRayLength,
vec3 lightDirection,
float atmosphereInnerRadius,
out vec3 rayleighColor,
out vec3 mieColor,
out float opacity
) {
// Initialize the default scattering amounts to 0.
rayleighColor = vec3(0.0);
mieColor = vec3(0.0);
opacity = 0.0;
float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;
vec3 origin = vec3(0.0);
// Calculate intersection from the camera to the outer ring of the atmosphere.
czm_raySegment primaryRayAtmosphereIntersect = czm_raySphereIntersectionInterval(primaryRay, origin, atmosphereOuterRadius);
// Return empty colors if no intersection with the atmosphere geometry.
if (primaryRayAtmosphereIntersect == czm_emptyRaySegment) {
return;
}
// To deal with smaller values of PRIMARY_STEPS (e.g. 4)
// we implement a split strategy: sky or horizon.
// For performance reasons, instead of a if/else branch
// a soft choice is implemented through a weight 0.0 <= w_stop_gt_lprl <= 1.0
float x = 1e-7 * primaryRayAtmosphereIntersect.stop / length(primaryRayLength);
// Value close to 0.0: close to the horizon
// Value close to 1.0: above in the sky
float w_stop_gt_lprl = 0.5 * (1.0 + czm_approximateTanh(x));
// The ray should start from the first intersection with the outer atmopshere, or from the camera position, if it is inside the atmosphere.
float start_0 = primaryRayAtmosphereIntersect.start;
primaryRayAtmosphereIntersect.start = max(primaryRayAtmosphereIntersect.start, 0.0);
// The ray should end at the exit from the atmosphere or at the distance to the vertex, whichever is smaller.
primaryRayAtmosphereIntersect.stop = min(primaryRayAtmosphereIntersect.stop, length(primaryRayLength));
// For the number of ray steps, distinguish inside or outside atmosphere (outer space)
// (1) from outer space we have to use more ray steps to get a realistic rendering
// (2) within atmosphere we need fewer steps for faster rendering
float x_o_a = start_0 - ATMOSPHERE_THICKNESS; // ATMOSPHERE_THICKNESS used as an ad-hoc constant, no precise meaning here, only the order of magnitude matters
float w_inside_atmosphere = 1.0 - 0.5 * (1.0 + czm_approximateTanh(x_o_a));
int PRIMARY_STEPS = PRIMARY_STEPS_MAX - int(w_inside_atmosphere * 12.0); // Number of times the ray from the camera to the world position (primary ray) is sampled.
int LIGHT_STEPS = LIGHT_STEPS_MAX - int(w_inside_atmosphere * 2.0); // Number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray.
// Setup for sampling positions along the ray - starting from the intersection with the outer ring of the atmosphere.
float rayPositionLength = primaryRayAtmosphereIntersect.start;
// (1) Outside the atmosphere: constant rayStepLength
// (2) Inside atmosphere: variable rayStepLength to compensate the rough rendering of the smaller number of ray steps
float totalRayLength = primaryRayAtmosphereIntersect.stop - rayPositionLength;
float rayStepLengthIncrease = w_inside_atmosphere * ((1.0 - w_stop_gt_lprl) * totalRayLength / (float(PRIMARY_STEPS * (PRIMARY_STEPS + 1)) / 2.0));
float rayStepLength = max(1.0 - w_inside_atmosphere, w_stop_gt_lprl) * totalRayLength / max(7.0 * w_inside_atmosphere, float(PRIMARY_STEPS));
vec3 rayleighAccumulation = vec3(0.0);
vec3 mieAccumulation = vec3(0.0);
vec2 opticalDepth = vec2(0.0);
vec2 heightScale = vec2(u_atmosphereRayleighScaleHeight, u_atmosphereMieScaleHeight);
// Sample positions on the primary ray.
for (int i = 0; i < PRIMARY_STEPS_MAX; ++i) {
// The loop should be: for (int i = 0; i < PRIMARY_STEPS; ++i) {...} but WebGL1 cannot
// loop with non-constant condition, so it has to break early instead
if (i >= PRIMARY_STEPS) {
break;
}
// Calculate sample position along viewpoint ray.
vec3 samplePosition = primaryRay.origin + primaryRay.direction * (rayPositionLength + rayStepLength);
// Calculate height of sample position above ellipsoid.
float sampleHeight = length(samplePosition) - atmosphereInnerRadius;
// Calculate and accumulate density of particles at the sample position.
vec2 sampleDensity = exp(-sampleHeight / heightScale) * rayStepLength;
opticalDepth += sampleDensity;
// Generate ray from the sample position segment to the light source, up to the outer ring of the atmosphere.
czm_ray lightRay = czm_ray(samplePosition, lightDirection);
czm_raySegment lightRayAtmosphereIntersect = czm_raySphereIntersectionInterval(lightRay, origin, atmosphereOuterRadius);
float lightStepLength = lightRayAtmosphereIntersect.stop / float(LIGHT_STEPS);
float lightPositionLength = 0.0;
vec2 lightOpticalDepth = vec2(0.0);
// Sample positions along the light ray, to accumulate incidence of light on the latest sample segment.
for (int j = 0; j < LIGHT_STEPS_MAX; ++j) {
// The loop should be: for (int j = 0; i < LIGHT_STEPS; ++j) {...} but WebGL1 cannot
// loop with non-constant condition, so it has to break early instead
if (j >= LIGHT_STEPS) {
break;
}
// Calculate sample position along light ray.
vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5);
// Calculate height of the light sample position above ellipsoid.
float lightHeight = length(lightPosition) - atmosphereInnerRadius;
// Calculate density of photons at the light sample position.
lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength;
// Increment distance on light ray.
lightPositionLength += lightStepLength;
}
// Compute attenuation via the primary ray and the light ray.
vec3 attenuation = exp(-((u_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (u_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x))));
// Accumulate the scattering.
rayleighAccumulation += sampleDensity.x * attenuation;
mieAccumulation += sampleDensity.y * attenuation;
// Increment distance on primary ray.
rayPositionLength += (rayStepLength += rayStepLengthIncrease);
}
// Compute the scattering amount.
rayleighColor = u_atmosphereRayleighCoefficient * rayleighAccumulation;
mieColor = u_atmosphereMieCoefficient * mieAccumulation;
// Compute the transmittance i.e. how much light is passing through the atmosphere.
opacity = length(exp(-((u_atmosphereMieCoefficient * opticalDepth.y) + (u_atmosphereRayleighCoefficient * opticalDepth.x))));
}
vec4 computeAtmosphereColor(
vec3 positionWC,
vec3 lightDirection,
vec3 rayleighColor,
vec3 mieColor,
float opacity
) {
// Setup the primary ray: from the camera position to the vertex position.
vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);
float cosAngle = dot(cameraToPositionWCDirection, lightDirection);
float cosAngleSq = cosAngle * cosAngle;
float G = u_atmosphereMieAnisotropy;
float GSq = G * G;
// The Rayleigh phase function.
float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq);
// The Mie phase function.
float miePhase = 3.0 / (25.1327412287) * ((1.0 - GSq) * (cosAngleSq + 1.0)) / (pow(1.0 + GSq - 2.0 * cosAngle * G, 1.5) * (2.0 + GSq));
// The final color is generated by combining the effects of the Rayleigh and Mie scattering.
vec3 rayleigh = rayleighPhase * rayleighColor;
vec3 mie = miePhase * mieColor;
vec3 color = (rayleigh + mie) * u_atmosphereLightIntensity;
return vec4(color, opacity);
}
`;var jhi=T(S(),1),Zv=`in vec2 v_textureCoordinates;
const float M_PI = 3.141592653589793;
float vdcRadicalInverse(int i)
{
float r;
float base = 2.0;
float value = 0.0;
float invBase = 1.0 / base;
float invBi = invBase;
for (int x = 0; x < 100; x++)
{
if (i <= 0)
{
break;
}
r = mod(float(i), base);
value += r * invBi;
invBi *= invBase;
i = int(float(i) * invBase);
}
return value;
}
vec2 hammersley2D(int i, int N)
{
return vec2(float(i) / float(N), vdcRadicalInverse(i));
}
vec3 importanceSampleGGX(vec2 xi, float roughness, vec3 N)
{
float a = roughness * roughness;
float phi = 2.0 * M_PI * xi.x;
float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (a * a - 1.0) * xi.y));
float sinTheta = sqrt(1.0 - cosTheta * cosTheta);
vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta);
vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
vec3 tangentX = normalize(cross(upVector, N));
vec3 tangentY = cross(N, tangentX);
return tangentX * H.x + tangentY * H.y + N * H.z;
}
float G1_Smith(float NdotV, float k)
{
return NdotV / (NdotV * (1.0 - k) + k);
}
float G_Smith(float roughness, float NdotV, float NdotL)
{
float k = roughness * roughness / 2.0;
return G1_Smith(NdotV, k) * G1_Smith(NdotL, k);
}
vec2 integrateBrdf(float roughness, float NdotV)
{
vec3 V = vec3(sqrt(1.0 - NdotV * NdotV), 0.0, NdotV);
float A = 0.0;
float B = 0.0;
const int NumSamples = 1024;
for (int i = 0; i < NumSamples; i++)
{
vec2 xi = hammersley2D(i, NumSamples);
vec3 H = importanceSampleGGX(xi, roughness, vec3(0.0, 0.0, 1.0));
vec3 L = 2.0 * dot(V, H) * H - V;
float NdotL = clamp(L.z, 0.0, 1.0);
float NdotH = clamp(H.z, 0.0, 1.0);
float VdotH = clamp(dot(V, H), 0.0, 1.0);
if (NdotL > 0.0)
{
float G = G_Smith(roughness, NdotV, NdotL);
float G_Vis = G * VdotH / (NdotH * NdotV);
float Fc = pow(1.0 - VdotH, 5.0);
A += (1.0 - Fc) * G_Vis;
B += Fc * G_Vis;
}
}
return vec2(A, B) / float(NumSamples);
}
void main()
{
out_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0);
}
`;var $hi=T(S(),1),Gv=`uniform sampler2D u_noiseTexture;
uniform vec3 u_noiseTextureDimensions;
uniform float u_noiseDetail;
in vec2 v_offset;
in vec3 v_maximumSize;
in vec4 v_color;
in float v_slice;
in float v_brightness;
float wrap(float value, float rangeLength) {
if(value < 0.0) {
float absValue = abs(value);
float modValue = mod(absValue, rangeLength);
return mod(rangeLength - modValue, rangeLength);
}
return mod(value, rangeLength);
}
vec3 wrapVec(vec3 value, float rangeLength) {
return vec3(wrap(value.x, rangeLength),
wrap(value.y, rangeLength),
wrap(value.z, rangeLength));
}
vec2 voxelToUV(vec3 voxelIndex) {
float textureSliceWidth = u_noiseTextureDimensions.x;
float noiseTextureRows = u_noiseTextureDimensions.y;
float inverseNoiseTextureRows = u_noiseTextureDimensions.z;
float textureSliceWidthSquared = textureSliceWidth * textureSliceWidth;
vec2 inverseNoiseTextureDimensions = vec2(noiseTextureRows / textureSliceWidthSquared,
inverseNoiseTextureRows / textureSliceWidth);
vec3 wrappedIndex = wrapVec(voxelIndex, textureSliceWidth);
float column = mod(wrappedIndex.z, textureSliceWidth * inverseNoiseTextureRows);
float row = floor(wrappedIndex.z / textureSliceWidth * noiseTextureRows);
float xPixelCoord = wrappedIndex.x + column * textureSliceWidth;
float yPixelCoord = wrappedIndex.y + row * textureSliceWidth;
return vec2(xPixelCoord, yPixelCoord) * inverseNoiseTextureDimensions;
}
// Interpolate a voxel with its neighbor (along the positive X-axis)
vec4 lerpSamplesX(vec3 voxelIndex, float x) {
vec2 uv0 = voxelToUV(voxelIndex);
vec2 uv1 = voxelToUV(voxelIndex + vec3(1.0, 0.0, 0.0));
vec4 sample0 = texture(u_noiseTexture, uv0);
vec4 sample1 = texture(u_noiseTexture, uv1);
return mix(sample0, sample1, x);
}
vec4 sampleNoiseTexture(vec3 position) {
float textureSliceWidth = u_noiseTextureDimensions.x;
vec3 recenteredPos = position + vec3(textureSliceWidth / 2.0);
vec3 lerpValue = fract(recenteredPos);
vec3 voxelIndex = floor(recenteredPos);
vec4 xLerp00 = lerpSamplesX(voxelIndex, lerpValue.x);
vec4 xLerp01 = lerpSamplesX(voxelIndex + vec3(0.0, 0.0, 1.0), lerpValue.x);
vec4 xLerp10 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 0.0), lerpValue.x);
vec4 xLerp11 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 1.0), lerpValue.x);
vec4 yLerp0 = mix(xLerp00, xLerp10, lerpValue.y);
vec4 yLerp1 = mix(xLerp01, xLerp11, lerpValue.y);
return mix(yLerp0, yLerp1, lerpValue.z);
}
// Intersection with a unit sphere with radius 0.5 at center (0, 0, 0).
bool intersectSphere(vec3 origin, vec3 dir, float slice,
out vec3 point, out vec3 normal) {
float A = dot(dir, dir);
float B = dot(origin, dir);
float C = dot(origin, origin) - 0.25;
float discriminant = (B * B) - (A * C);
if(discriminant < 0.0) {
return false;
}
float root = sqrt(discriminant);
float t = (-B - root) / A;
if(t < 0.0) {
t = (-B + root) / A;
}
point = origin + t * dir;
if(slice >= 0.0) {
point.z = (slice / 2.0) - 0.5;
if(length(point) > 0.5) {
return false;
}
}
normal = normalize(point);
point -= czm_epsilon2 * normal;
return true;
}
// Transforms the ray origin and direction into unit sphere space,
// then transforms the result back into the ellipsoid's space.
bool intersectEllipsoid(vec3 origin, vec3 dir, vec3 center, vec3 scale, float slice,
out vec3 point, out vec3 normal) {
if(scale.x <= 0.01 || scale.y < 0.01 || scale.z < 0.01) {
return false;
}
vec3 o = (origin - center) / scale;
vec3 d = dir / scale;
vec3 p, n;
bool intersected = intersectSphere(o, d, slice, p, n);
if(intersected) {
point = (p * scale) + center;
normal = n;
}
return intersected;
}
// Assume that if phase shift is being called for octave i,
// the frequency is of i - 1. This saves us from doing extra
// division / multiplication operations.
vec2 phaseShift2D(vec2 p, vec2 freq) {
return (czm_pi / 2.0) * sin(freq.yx * p.yx);
}
vec2 phaseShift3D(vec3 p, vec2 freq) {
return phaseShift2D(p.xy, freq) + czm_pi * vec2(sin(freq.x * p.z));
}
// The cloud texture function derived from Gardner's 1985 paper,
// "Visual Simulation of Clouds."
// https://www.cs.drexel.edu/~david/Classes/Papers/p297-gardner.pdf
const float T0 = 0.6; // contrast of the texture pattern
const float k = 0.1; // computed to produce a maximum value of 1
const float C0 = 0.8; // coefficient
const float FX0 = 0.6; // frequency X
const float FY0 = 0.6; // frequency Y
const int octaves = 5;
float T(vec3 point) {
vec2 sum = vec2(0.0);
float Ci = C0;
vec2 FXY = vec2(FX0, FY0);
vec2 PXY = vec2(0.0);
for(int i = 1; i <= octaves; i++) {
PXY = phaseShift3D(point, FXY);
Ci *= 0.707;
FXY *= 2.0;
vec2 sinTerm = sin(FXY * point.xy + PXY);
sum += Ci * sinTerm + vec2(T0);
}
return k * sum.x * sum.y;
}
const float a = 0.5; // fraction of surface reflection due to ambient or scattered light,
const float t = 0.4; // fraction of texture shading
const float s = 0.25; // fraction of specular reflection
float I(float Id, float Is, float It) {
return (1.0 - a) * ((1.0 - t) * ((1.0 - s) * Id + s * Is) + t * It) + a;
}
const vec3 lightDir = normalize(vec3(0.2, -1.0, 0.7));
vec4 drawCloud(vec3 rayOrigin, vec3 rayDir, vec3 cloudCenter, vec3 cloudScale, float cloudSlice,
float brightness) {
vec3 cloudPoint, cloudNormal;
if(!intersectEllipsoid(rayOrigin, rayDir, cloudCenter, cloudScale, cloudSlice,
cloudPoint, cloudNormal)) {
return vec4(0.0);
}
float Id = clamp(dot(cloudNormal, -lightDir), 0.0, 1.0); // diffuse reflection
float Is = max(pow(dot(-lightDir, -rayDir), 2.0), 0.0); // specular reflection
float It = T(cloudPoint); // texture function
float intensity = I(Id, Is, It);
vec3 color = vec3(intensity * clamp(brightness, 0.1, 1.0));
vec4 noise = sampleNoiseTexture(u_noiseDetail * cloudPoint);
float W = noise.x;
float W2 = noise.y;
float W3 = noise.z;
// The dot product between the cloud's normal and the ray's direction is greatest
// in the center of the ellipsoid's surface. It decreases towards the edge.
// Thus, it is used to blur the areas leading to the edges of the ellipsoid,
// so that no harsh lines appear.
// The first (and biggest) layer of worley noise is then subtracted from this.
// The final result is scaled up so that the base cloud is not too translucent.
float ndDot = clamp(dot(cloudNormal, -rayDir), 0.0, 1.0);
float TR = pow(ndDot, 3.0) - W; // translucency
TR *= 1.3;
// Subtracting the second and third layers of worley noise is more complicated.
// If these layers of noise were simply subtracted from the current translucency,
// the shape derived from the first layer of noise would be completely deleted.
// The erosion of this noise should thus be constricted to the edges of the cloud.
// However, because the edges of the ellipsoid were already blurred away, mapping
// the noise to (1.0 - ndDot) will have no impact on most of the cloud's appearance.
// The value of (0.5 - ndDot) provides the best compromise.
float minusDot = 0.5 - ndDot;
// Even with the previous calculation, subtracting the second layer of wnoise
// erode too much of the cloud. The addition of it, however, will detailed
// volume to the cloud. As long as the noise is only added and not subtracted,
// the results are aesthetically pleasing.
// The minusDot product is mapped in a way that it is larger at the edges of
// the ellipsoid, so a subtraction and min operation are used instead of
// an addition and max one.
TR -= min(minusDot * W2, 0.0);
// The third level of worley noise is subtracted from the result, with some
// modifications. First, a scalar is added to minusDot so that the noise
// starts affecting the shape farther away from the center of the ellipsoid's
// surface. Then, it is scaled down so its impact is not too intense.
TR -= 0.8 * (minusDot + 0.25) * W3;
// The texture function's shading does not correlate with the shape of the cloud
// produced by the layers of noise, so an extra shading scalar is calculated.
// The darkest areas of the cloud are assigned to be where the noise erodes
// the cloud the most. This is then interpolated based on the translucency
// and the diffuse shading term of that point in the cloud.
float shading = mix(1.0 - 0.8 * W * W, 1.0, Id * TR);
// To avoid values that are too dark, this scalar is increased by a small amount
// and clamped so it never goes to zero.
shading = clamp(shading + 0.2, 0.3, 1.0);
// Finally, the contrast of the cloud's color is increased.
vec3 finalColor = mix(vec3(0.5), shading * color, 1.15);
return vec4(finalColor, clamp(TR, 0.0, 1.0)) * v_color;
}
void main() {
#ifdef DEBUG_BILLBOARDS
out_FragColor = vec4(0.0, 0.5, 0.5, 1.0);
#endif
// To avoid calculations with high values,
// we raycast from an arbitrarily smaller space.
vec2 coordinate = v_maximumSize.xy * v_offset;
vec3 ellipsoidScale = 0.82 * v_maximumSize;
vec3 ellipsoidCenter = vec3(0.0);
float zOffset = max(ellipsoidScale.z - 10.0, 0.0);
vec3 eye = vec3(0, 0, -10.0 - zOffset);
vec3 rayDir = normalize(vec3(coordinate, 1.0) - eye);
vec3 rayOrigin = eye;
#ifdef DEBUG_ELLIPSOIDS
vec3 point, normal;
if(intersectEllipsoid(rayOrigin, rayDir, ellipsoidCenter, ellipsoidScale, v_slice,
point, normal)) {
out_FragColor = v_brightness * v_color;
}
#else
#ifndef DEBUG_BILLBOARDS
vec4 cloud = drawCloud(rayOrigin, rayDir,
ellipsoidCenter, ellipsoidScale, v_slice, v_brightness);
if(cloud.w < 0.01) {
discard;
}
out_FragColor = cloud;
#endif
#endif
}
`;var tfi=T(S(),1),Ev=`#ifdef INSTANCED
in vec2 direction;
#endif
in vec4 positionHighAndScaleX;
in vec4 positionLowAndScaleY;
in vec4 packedAttribute0;
in vec4 packedAttribute1;
in vec4 color;
out vec2 v_offset;
out vec3 v_maximumSize;
out vec4 v_color;
out float v_slice;
out float v_brightness;
void main() {
// Unpack attributes.
vec3 positionHigh = positionHighAndScaleX.xyz;
vec3 positionLow = positionLowAndScaleY.xyz;
vec2 scale = vec2(positionHighAndScaleX.w, positionLowAndScaleY.w);
float show = packedAttribute0.x;
float brightness = packedAttribute0.y;
vec2 coordinates = packedAttribute0.wz;
vec3 maximumSize = packedAttribute1.xyz;
float slice = packedAttribute1.w;
#ifdef INSTANCED
vec2 dir = direction;
#else
vec2 dir = coordinates;
#endif
vec2 offset = dir - vec2(0.5, 0.5);
vec2 scaledOffset = scale * offset;
vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
vec4 positionEC = czm_modelViewRelativeToEye * p;
positionEC.xy += scaledOffset;
positionEC.xyz *= show;
gl_Position = czm_projection * positionEC;
v_offset = offset;
v_maximumSize = maximumSize;
v_color = color;
v_slice = slice;
v_brightness = brightness;
}
`;var ifi=T(S(),1),Iv=`uniform vec3 u_noiseTextureDimensions;
uniform float u_noiseDetail;
uniform vec3 u_noiseOffset;
in vec2 v_position;
float wrap(float value, float rangeLength) {
if(value < 0.0) {
float absValue = abs(value);
float modValue = mod(absValue, rangeLength);
return mod(rangeLength - modValue, rangeLength);
}
return mod(value, rangeLength);
}
vec3 wrapVec(vec3 value, float rangeLength) {
return vec3(wrap(value.x, rangeLength),
wrap(value.y, rangeLength),
wrap(value.z, rangeLength));
}
vec3 random3(vec3 p) {
float dot1 = dot(p, vec3(127.1, 311.7, 932.8));
float dot2 = dot(p, vec3(269.5, 183.3, 421.4));
return fract(vec3(sin(dot1 - dot2), cos(dot1 * dot2), dot1 * dot2));
}
// Frequency corresponds to cell size.
// The higher the frequency, the smaller the cell size.
vec3 getWorleyCellPoint(vec3 centerCell, vec3 offset, float freq) {
float textureSliceWidth = u_noiseTextureDimensions.x;
vec3 cell = centerCell + offset;
cell = wrapVec(cell, textureSliceWidth / u_noiseDetail);
cell += floor(u_noiseOffset / u_noiseDetail);
vec3 p = offset + random3(cell);
return p;
}
float worleyNoise(vec3 p, float freq) {
vec3 centerCell = floor(p * freq);
vec3 pointInCell = fract(p * freq);
float shortestDistance = 1000.0;
for(float z = -1.0; z <= 1.0; z++) {
for(float y = -1.0; y <= 1.0; y++) {
for(float x = -1.0; x <= 1.0; x++) {
vec3 offset = vec3(x, y, z);
vec3 point = getWorleyCellPoint(centerCell, offset, freq);
float distance = length(pointInCell - point);
if(distance < shortestDistance) {
shortestDistance = distance;
}
}
}
}
return shortestDistance;
}
const float MAX_FBM_ITERATIONS = 10.0;
float worleyFBMNoise(vec3 p, float octaves, float scale) {
float noise = 0.0;
float freq = 1.0;
float persistence = 0.625;
for(float i = 0.0; i < MAX_FBM_ITERATIONS; i++) {
if(i >= octaves) {
break;
}
noise += worleyNoise(p * scale, freq * scale) * persistence;
persistence *= 0.5;
freq *= 2.0;
}
return noise;
}
void main() {
float textureSliceWidth = u_noiseTextureDimensions.x;
float inverseNoiseTextureRows = u_noiseTextureDimensions.z;
float x = mod(v_position.x, textureSliceWidth);
float y = mod(v_position.y, textureSliceWidth);
float sliceRow = floor(v_position.y / textureSliceWidth);
float z = floor(v_position.x / textureSliceWidth) + sliceRow * inverseNoiseTextureRows * textureSliceWidth;
vec3 position = vec3(x, y, z);
position /= u_noiseDetail;
float worley0 = clamp(worleyFBMNoise(position, 3.0, 1.0), 0.0, 1.0);
float worley1 = clamp(worleyFBMNoise(position, 3.0, 2.0), 0.0, 1.0);
float worley2 = clamp(worleyFBMNoise(position, 3.0, 3.0), 0.0, 1.0);
out_FragColor = vec4(worley0, worley1, worley2, 1.0);
}
`;var rfi=T(S(),1),Xv=`uniform vec3 u_noiseTextureDimensions;
in vec2 position;
out vec2 v_position;
void main()
{
gl_Position = vec4(position, 0.1, 1.0);
float textureSliceWidth = u_noiseTextureDimensions.x;
float noiseTextureRows = u_noiseTextureDimensions.y;
float inverseNoiseTextureRows = u_noiseTextureDimensions.z;
vec2 transformedPos = (position * 0.5) + vec2(0.5);
transformedPos *= textureSliceWidth;
transformedPos.x *= textureSliceWidth * inverseNoiseTextureRows;
transformedPos.y *= noiseTextureRows;
v_position = transformedPos;
}
`;var afi=T(S(),1),Wv=`uniform sampler2D u_opaqueDepthTexture;
uniform sampler2D u_translucentDepthTexture;
in vec2 v_textureCoordinates;
void main()
{
float opaqueDepth = texture(u_opaqueDepthTexture, v_textureCoordinates).r;
float translucentDepth = texture(u_translucentDepthTexture, v_textureCoordinates).r;
translucentDepth = czm_branchFreeTernary(translucentDepth > opaqueDepth, 1.0, translucentDepth);
out_FragColor = czm_packDepth(translucentDepth);
}
`;var lfi=T(S(),1),Pv=`/**
* Compositing for Weighted Blended Order-Independent Transparency. See:
* - http://jcgt.org/published/0002/02/09/
* - http://casual-effects.blogspot.com/2014/03/weighted-blended-order-independent.html
*/
uniform sampler2D u_opaque;
uniform sampler2D u_accumulation;
uniform sampler2D u_revealage;
in vec2 v_textureCoordinates;
void main()
{
vec4 opaque = texture(u_opaque, v_textureCoordinates);
vec4 accum = texture(u_accumulation, v_textureCoordinates);
float r = texture(u_revealage, v_textureCoordinates).r;
#ifdef MRT
vec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a);
#else
vec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r);
#endif
out_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque;
if (opaque != czm_backgroundColor)
{
out_FragColor.a = 1.0;
}
}
`;var ufi=T(S(),1),vv=`in vec4 positionEC;
void main()
{
vec3 position;
vec3 direction;
if (czm_orthographicIn3D == 1.0)
{
vec2 uv = (gl_FragCoord.xy - czm_viewport.xy) / czm_viewport.zw;
vec2 minPlane = vec2(czm_frustumPlanes.z, czm_frustumPlanes.y); // left, bottom
vec2 maxPlane = vec2(czm_frustumPlanes.w, czm_frustumPlanes.x); // right, top
position = vec3(mix(minPlane, maxPlane, uv), 0.0);
direction = vec3(0.0, 0.0, -1.0);
}
else
{
position = vec3(0.0);
direction = normalize(positionEC.xyz);
}
czm_ray ray = czm_ray(position, direction);
vec3 ellipsoid_center = czm_view[3].xyz;
czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii);
if (!czm_isEmpty(intersection))
{
out_FragColor = vec4(1.0, 1.0, 0.0, 1.0);
}
else
{
discard;
}
czm_writeLogDepth();
}
`;var hfi=T(S(),1),wv=`in vec4 position;
out vec4 positionEC;
void main()
{
positionEC = czm_modelView * position;
gl_Position = czm_projection * positionEC;
czm_vertexLogDepth();
}
`;var pfi=T(S(),1),dV=`uniform vec3 u_radii;
uniform vec3 u_oneOverEllipsoidRadiiSquared;
in vec3 v_positionEC;
vec4 computeEllipsoidColor(czm_ray ray, float intersection, float side)
{
vec3 positionEC = czm_pointAlongRay(ray, intersection);
vec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz;
vec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared));
vec3 sphericalNormal = normalize(positionMC / u_radii);
vec3 normalMC = geodeticNormal * side; // normalized surface normal (always facing the viewer) in model coordinates
vec3 normalEC = normalize(czm_normal * normalMC); // normalized surface normal in eye coordinates
vec2 st = czm_ellipsoidWgs84TextureCoordinates(sphericalNormal);
vec3 positionToEyeEC = -positionEC;
czm_materialInput materialInput;
materialInput.s = st.s;
materialInput.st = st;
materialInput.str = (positionMC + u_radii) / u_radii;
materialInput.normalEC = normalEC;
materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC);
materialInput.positionToEyeEC = positionToEyeEC;
czm_material material = czm_getMaterial(materialInput);
#ifdef ONLY_SUN_LIGHTING
return czm_private_phong(normalize(positionToEyeEC), material, czm_sunDirectionEC);
#else
return czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
#endif
}
void main()
{
// PERFORMANCE_TODO: When dynamic branching is available, compute ratio of maximum and minimum radii
// in the vertex shader. Only when it is larger than some constant, march along the ray.
// Otherwise perform one intersection test which will be the common case.
// Test if the ray intersects a sphere with the ellipsoid's maximum radius.
// For very oblate ellipsoids, using the ellipsoid's radii for an intersection test
// may cause false negatives. This will discard fragments before marching the ray forward.
float maxRadius = max(u_radii.x, max(u_radii.y, u_radii.z)) * 1.5;
vec3 direction = normalize(v_positionEC);
vec3 ellipsoidCenter = czm_modelView[3].xyz;
float t1 = -1.0;
float t2 = -1.0;
float b = -2.0 * dot(direction, ellipsoidCenter);
float c = dot(ellipsoidCenter, ellipsoidCenter) - maxRadius * maxRadius;
float discriminant = b * b - 4.0 * c;
if (discriminant >= 0.0) {
t1 = (-b - sqrt(discriminant)) * 0.5;
t2 = (-b + sqrt(discriminant)) * 0.5;
}
if (t1 < 0.0 && t2 < 0.0) {
discard;
}
float t = min(t1, t2);
if (t < 0.0) {
t = 0.0;
}
// March ray forward to intersection with larger sphere and find
czm_ray ray = czm_ray(t * direction, direction);
vec3 ellipsoid_inverseRadii = vec3(1.0 / u_radii.x, 1.0 / u_radii.y, 1.0 / u_radii.z);
czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoidCenter, ellipsoid_inverseRadii);
if (czm_isEmpty(intersection))
{
discard;
}
// If the viewer is outside, compute outsideFaceColor, with normals facing outward.
vec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0);
// If the viewer either is inside or can see inside, compute insideFaceColor, with normals facing inward.
vec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0);
out_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a);
out_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a);
#if (defined(WRITE_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth)))
t = (intersection.start != 0.0) ? intersection.start : intersection.stop;
vec3 positionEC = czm_pointAlongRay(ray, t);
vec4 positionCC = czm_projection * vec4(positionEC, 1.0);
#ifdef LOG_DEPTH
czm_writeLogDepth(1.0 + positionCC.w);
#else
float z = positionCC.z / positionCC.w;
float n = czm_depthRange.near;
float f = czm_depthRange.far;
gl_FragDepth = (z * (f - n) + f + n) * 0.5;
#endif
#endif
}
`;var yfi=T(S(),1),uV=`in vec3 position;
uniform vec3 u_radii;
out vec3 v_positionEC;
void main()
{
// In the vertex data, the cube goes from (-1.0, -1.0, -1.0) to (1.0, 1.0, 1.0) in model coordinates.
// Scale to consider the radii. We could also do this once on the CPU when using the BoxGeometry,
// but doing it here allows us to change the radii without rewriting the vertex data, and
// allows all ellipsoids to reuse the same vertex data.
vec4 p = vec4(u_radii * position, 1.0);
v_positionEC = (czm_modelView * p).xyz; // position in eye coordinates
gl_Position = czm_modelViewProjection * p; // position in clip coordinates
// With multi-frustum, when the ellipsoid primitive is positioned on the intersection of two frustums
// and close to terrain, the terrain (writes depth) in the closest frustum can overwrite part of the
// ellipsoid (does not write depth) that was rendered in the farther frustum.
//
// Here, we clamp the depth in the vertex shader to avoid being overwritten; however, this creates
// artifacts since some fragments can be alpha blended twice. This is solved by only rendering
// the ellipsoid in the closest frustum to the viewer.
gl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far);
czm_vertexLogDepth();
}
`;var xfi=T(S(),1);/**
* @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.
*/var Fv=`/**
* @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.
*/
// NVIDIA GameWorks Graphics Samples GitHub link: https://github.com/NVIDIAGameWorks/GraphicsSamples
// Original FXAA 3.11 shader link: https://github.com/NVIDIAGameWorks/GraphicsSamples/blob/master/samples/es3-kepler/FXAA/FXAA3_11.h
// Steps used to integrate into Cesium:
// * The following defines are set:
// #define FXAA_PC 1
// #define FXAA_WEBGL_1 1
// #define FXAA_GREEN_AS_LUMA 1
// #define FXAA_EARLY_EXIT 1
// #define FXAA_GLSL_120 1
// * All other preprocessor directives besides the FXAA_QUALITY__P* directives were removed.
// * Double underscores are invalid for preprocessor directives so replace them with a single underscore. Replace
// /FXAA_QUALITY__P(.*)/g with /FXAA_QUALITY__P$1/.
// * There are no implicit conversions from ivec* to vec* so replace:
// #define FxaaInt2 ivec2
// with
// #define FxaaInt2 vec2
// * The texture2DLod function is only available in vertex shaders so replace:
// #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)
// #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)
// with
// #define FxaaTexTop(t, p) texture(t, p)
// #define FxaaTexOff(t, p, o, r) texture(t, p + (o * r))
// * FXAA_QUALITY_PRESET is prepended in the javascript code. We may want to expose that setting in the future.
// * The following parameters to FxaaPixelShader are unused and can be removed:
// fxaaConsolePosPos
// fxaaConsoleRcpFrameOpt
// fxaaConsoleRcpFrameOpt2
// fxaaConsole360RcpFrameOpt2
// fxaaConsoleEdgeSharpness
// fxaaConsoleEdgeThreshold
// fxaaConsoleEdgeThresholdMi
// fxaaConsole360ConstDir
//
// Choose the quality preset.
// This needs to be compiled into the shader as it effects code.
// Best option to include multiple presets is to
// in each shader define the preset, then include this file.
//
// OPTIONS
// -----------------------------------------------------------------------
// 10 to 15 - default medium dither (10=fastest, 15=highest quality)
// 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)
// 39 - no dither, very expensive
//
// NOTES
// -----------------------------------------------------------------------
// 12 = slightly faster then FXAA 3.9 and higher edge quality (default)
// 13 = about same speed as FXAA 3.9 and better than 12
// 23 = closest to FXAA 3.9 visually and performance wise
// _ = the lowest digit is directly related to performance
// _ = the highest digit is directly related to style
//
//#define FXAA_QUALITY_PRESET 12
#if (FXAA_QUALITY_PRESET == 10)
#define FXAA_QUALITY_PS 3
#define FXAA_QUALITY_P0 1.5
#define FXAA_QUALITY_P1 3.0
#define FXAA_QUALITY_P2 12.0
#endif
#if (FXAA_QUALITY_PRESET == 11)
#define FXAA_QUALITY_PS 4
#define FXAA_QUALITY_P0 1.0
#define FXAA_QUALITY_P1 1.5
#define FXAA_QUALITY_P2 3.0
#define FXAA_QUALITY_P3 12.0
#endif
#if (FXAA_QUALITY_PRESET == 12)
#define FXAA_QUALITY_PS 5
#define FXAA_QUALITY_P0 1.0
#define FXAA_QUALITY_P1 1.5
#define FXAA_QUALITY_P2 2.0
#define FXAA_QUALITY_P3 4.0
#define FXAA_QUALITY_P4 12.0
#endif
#if (FXAA_QUALITY_PRESET == 13)
#define FXAA_QUALITY_PS 6
#define FXAA_QUALITY_P0 1.0
#define FXAA_QUALITY_P1 1.5
#define FXAA_QUALITY_P2 2.0
#define FXAA_QUALITY_P3 2.0
#define FXAA_QUALITY_P4 4.0
#define FXAA_QUALITY_P5 12.0
#endif
#if (FXAA_QUALITY_PRESET == 14)
#define FXAA_QUALITY_PS 7
#define FXAA_QUALITY_P0 1.0
#define FXAA_QUALITY_P1 1.5
#define FXAA_QUALITY_P2 2.0
#define FXAA_QUALITY_P3 2.0
#define FXAA_QUALITY_P4 2.0
#define FXAA_QUALITY_P5 4.0
#define FXAA_QUALITY_P6 12.0
#endif
#if (FXAA_QUALITY_PRESET == 15)
#define FXAA_QUALITY_PS 8
#define FXAA_QUALITY_P0 1.0
#define FXAA_QUALITY_P1 1.5
#define FXAA_QUALITY_P2 2.0
#define FXAA_QUALITY_P3 2.0
#define FXAA_QUALITY_P4 2.0
#define FXAA_QUALITY_P5 2.0
#define FXAA_QUALITY_P6 4.0
#define FXAA_QUALITY_P7 12.0
#endif
#if (FXAA_QUALITY_PRESET == 20)
#define FXAA_QUALITY_PS 3
#define FXAA_QUALITY_P0 1.5
#define FXAA_QUALITY_P1 2.0
#define FXAA_QUALITY_P2 8.0
#endif
#if (FXAA_QUALITY_PRESET == 21)
#define FXAA_QUALITY_PS 4
#define FXAA_QUALITY_P0 1.0
#define FXAA_QUALITY_P1 1.5
#define FXAA_QUALITY_P2 2.0
#define FXAA_QUALITY_P3 8.0
#endif
#if (FXAA_QUALITY_PRESET == 22)
#define FXAA_QUALITY_PS 5
#define FXAA_QUALITY_P0 1.0
#define FXAA_QUALITY_P1 1.5
#define FXAA_QUALITY_P2 2.0
#define FXAA_QUALITY_P3 2.0
#define FXAA_QUALITY_P4 8.0
#endif
#if (FXAA_QUALITY_PRESET == 23)
#define FXAA_QUALITY_PS 6
#define FXAA_QUALITY_P0 1.0
#define FXAA_QUALITY_P1 1.5
#define FXAA_QUALITY_P2 2.0
#define FXAA_QUALITY_P3 2.0
#define FXAA_QUALITY_P4 2.0
#define FXAA_QUALITY_P5 8.0
#endif
#if (FXAA_QUALITY_PRESET == 24)
#define FXAA_QUALITY_PS 7
#define FXAA_QUALITY_P0 1.0
#define FXAA_QUALITY_P1 1.5
#define FXAA_QUALITY_P2 2.0
#define FXAA_QUALITY_P3 2.0
#define FXAA_QUALITY_P4 2.0
#define FXAA_QUALITY_P5 3.0
#define FXAA_QUALITY_P6 8.0
#endif
#if (FXAA_QUALITY_PRESET == 25)
#define FXAA_QUALITY_PS 8
#define FXAA_QUALITY_P0 1.0
#define FXAA_QUALITY_P1 1.5
#define FXAA_QUALITY_P2 2.0
#define FXAA_QUALITY_P3 2.0
#define FXAA_QUALITY_P4 2.0
#define FXAA_QUALITY_P5 2.0
#define FXAA_QUALITY_P6 4.0
#define FXAA_QUALITY_P7 8.0
#endif
#if (FXAA_QUALITY_PRESET == 26)
#define FXAA_QUALITY_PS 9
#define FXAA_QUALITY_P0 1.0
#define FXAA_QUALITY_P1 1.5
#define FXAA_QUALITY_P2 2.0
#define FXAA_QUALITY_P3 2.0
#define FXAA_QUALITY_P4 2.0
#define FXAA_QUALITY_P5 2.0
#define FXAA_QUALITY_P6 2.0
#define FXAA_QUALITY_P7 4.0
#define FXAA_QUALITY_P8 8.0
#endif
#if (FXAA_QUALITY_PRESET == 27)
#define FXAA_QUALITY_PS 10
#define FXAA_QUALITY_P0 1.0
#define FXAA_QUALITY_P1 1.5
#define FXAA_QUALITY_P2 2.0
#define FXAA_QUALITY_P3 2.0
#define FXAA_QUALITY_P4 2.0
#define FXAA_QUALITY_P5 2.0
#define FXAA_QUALITY_P6 2.0
#define FXAA_QUALITY_P7 2.0
#define FXAA_QUALITY_P8 4.0
#define FXAA_QUALITY_P9 8.0
#endif
#if (FXAA_QUALITY_PRESET == 28)
#define FXAA_QUALITY_PS 11
#define FXAA_QUALITY_P0 1.0
#define FXAA_QUALITY_P1 1.5
#define FXAA_QUALITY_P2 2.0
#define FXAA_QUALITY_P3 2.0
#define FXAA_QUALITY_P4 2.0
#define FXAA_QUALITY_P5 2.0
#define FXAA_QUALITY_P6 2.0
#define FXAA_QUALITY_P7 2.0
#define FXAA_QUALITY_P8 2.0
#define FXAA_QUALITY_P9 4.0
#define FXAA_QUALITY_P10 8.0
#endif
#if (FXAA_QUALITY_PRESET == 29)
#define FXAA_QUALITY_PS 12
#define FXAA_QUALITY_P0 1.0
#define FXAA_QUALITY_P1 1.5
#define FXAA_QUALITY_P2 2.0
#define FXAA_QUALITY_P3 2.0
#define FXAA_QUALITY_P4 2.0
#define FXAA_QUALITY_P5 2.0
#define FXAA_QUALITY_P6 2.0
#define FXAA_QUALITY_P7 2.0
#define FXAA_QUALITY_P8 2.0
#define FXAA_QUALITY_P9 2.0
#define FXAA_QUALITY_P10 4.0
#define FXAA_QUALITY_P11 8.0
#endif
#if (FXAA_QUALITY_PRESET == 39)
#define FXAA_QUALITY_PS 12
#define FXAA_QUALITY_P0 1.0
#define FXAA_QUALITY_P1 1.0
#define FXAA_QUALITY_P2 1.0
#define FXAA_QUALITY_P3 1.0
#define FXAA_QUALITY_P4 1.0
#define FXAA_QUALITY_P5 1.5
#define FXAA_QUALITY_P6 2.0
#define FXAA_QUALITY_P7 2.0
#define FXAA_QUALITY_P8 2.0
#define FXAA_QUALITY_P9 2.0
#define FXAA_QUALITY_P10 4.0
#define FXAA_QUALITY_P11 8.0
#endif
#define FxaaBool bool
#define FxaaFloat float
#define FxaaFloat2 vec2
#define FxaaFloat3 vec3
#define FxaaFloat4 vec4
#define FxaaHalf float
#define FxaaHalf2 vec2
#define FxaaHalf3 vec3
#define FxaaHalf4 vec4
#define FxaaInt2 vec2
#define FxaaTex sampler2D
#define FxaaSat(x) clamp(x, 0.0, 1.0)
#define FxaaTexTop(t, p) texture(t, p)
#define FxaaTexOff(t, p, o, r) texture(t, p + (o * r))
FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }
FxaaFloat4 FxaaPixelShader(
//
// Use noperspective interpolation here (turn off perspective interpolation).
// {xy} = center of pixel
FxaaFloat2 pos,
//
// Input color texture.
// {rgb_} = color in linear or perceptual color space
// if (FXAA_GREEN_AS_LUMA == 0)
// {___a} = luma in perceptual color space (not linear)
FxaaTex tex,
//
// Only used on FXAA Quality.
// This must be from a constant/uniform.
// {x_} = 1.0/screenWidthInPixels
// {_y} = 1.0/screenHeightInPixels
FxaaFloat2 fxaaQualityRcpFrame,
//
// Only used on FXAA Quality.
// This used to be the FXAA_QUALITY_SUBPIX define.
// It is here now to allow easier tuning.
// Choose the amount of sub-pixel aliasing removal.
// This can effect sharpness.
// 1.00 - upper limit (softer)
// 0.75 - default amount of filtering
// 0.50 - lower limit (sharper, less sub-pixel aliasing removal)
// 0.25 - almost off
// 0.00 - completely off
FxaaFloat fxaaQualitySubpix,
//
// Only used on FXAA Quality.
// This used to be the FXAA_QUALITY_EDGE_THRESHOLD define.
// It is here now to allow easier tuning.
// The minimum amount of local contrast required to apply algorithm.
// 0.333 - too little (faster)
// 0.250 - low quality
// 0.166 - default
// 0.125 - high quality
// 0.063 - overkill (slower)
FxaaFloat fxaaQualityEdgeThreshold,
//
// Only used on FXAA Quality.
// This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define.
// It is here now to allow easier tuning.
// Trims the algorithm from processing darks.
// 0.0833 - upper limit (default, the start of visible unfiltered edges)
// 0.0625 - high quality (faster)
// 0.0312 - visible limit (slower)
// Special notes when using FXAA_GREEN_AS_LUMA,
// Likely want to set this to zero.
// As colors that are mostly not-green
// will appear very dark in the green channel!
// Tune by looking at mostly non-green content,
// then start at zero and increase until aliasing is a problem.
FxaaFloat fxaaQualityEdgeThresholdMin
) {
/*--------------------------------------------------------------------------*/
FxaaFloat2 posM;
posM.x = pos.x;
posM.y = pos.y;
FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);
#define lumaM rgbyM.y
FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));
FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));
FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));
FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));
/*--------------------------------------------------------------------------*/
FxaaFloat maxSM = max(lumaS, lumaM);
FxaaFloat minSM = min(lumaS, lumaM);
FxaaFloat maxESM = max(lumaE, maxSM);
FxaaFloat minESM = min(lumaE, minSM);
FxaaFloat maxWN = max(lumaN, lumaW);
FxaaFloat minWN = min(lumaN, lumaW);
FxaaFloat rangeMax = max(maxWN, maxESM);
FxaaFloat rangeMin = min(minWN, minESM);
FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;
FxaaFloat range = rangeMax - rangeMin;
FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);
FxaaBool earlyExit = range < rangeMaxClamped;
/*--------------------------------------------------------------------------*/
if(earlyExit)
return rgbyM;
/*--------------------------------------------------------------------------*/
FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));
FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));
FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));
FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));
/*--------------------------------------------------------------------------*/
FxaaFloat lumaNS = lumaN + lumaS;
FxaaFloat lumaWE = lumaW + lumaE;
FxaaFloat subpixRcpRange = 1.0/range;
FxaaFloat subpixNSWE = lumaNS + lumaWE;
FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;
FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;
/*--------------------------------------------------------------------------*/
FxaaFloat lumaNESE = lumaNE + lumaSE;
FxaaFloat lumaNWNE = lumaNW + lumaNE;
FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;
FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;
/*--------------------------------------------------------------------------*/
FxaaFloat lumaNWSW = lumaNW + lumaSW;
FxaaFloat lumaSWSE = lumaSW + lumaSE;
FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);
FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);
FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;
FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;
FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;
FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;
/*--------------------------------------------------------------------------*/
FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;
FxaaFloat lengthSign = fxaaQualityRcpFrame.x;
FxaaBool horzSpan = edgeHorz >= edgeVert;
FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;
/*--------------------------------------------------------------------------*/
if(!horzSpan) lumaN = lumaW;
if(!horzSpan) lumaS = lumaE;
if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;
FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;
/*--------------------------------------------------------------------------*/
FxaaFloat gradientN = lumaN - lumaM;
FxaaFloat gradientS = lumaS - lumaM;
FxaaFloat lumaNN = lumaN + lumaM;
FxaaFloat lumaSS = lumaS + lumaM;
FxaaBool pairN = abs(gradientN) >= abs(gradientS);
FxaaFloat gradient = max(abs(gradientN), abs(gradientS));
if(pairN) lengthSign = -lengthSign;
FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);
/*--------------------------------------------------------------------------*/
FxaaFloat2 posB;
posB.x = posM.x;
posB.y = posM.y;
FxaaFloat2 offNP;
offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;
offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;
if(!horzSpan) posB.x += lengthSign * 0.5;
if( horzSpan) posB.y += lengthSign * 0.5;
/*--------------------------------------------------------------------------*/
FxaaFloat2 posN;
posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;
posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;
FxaaFloat2 posP;
posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;
posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;
FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;
FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));
FxaaFloat subpixE = subpixC * subpixC;
FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));
/*--------------------------------------------------------------------------*/
if(!pairN) lumaNN = lumaSS;
FxaaFloat gradientScaled = gradient * 1.0/4.0;
FxaaFloat lumaMM = lumaM - lumaNN * 0.5;
FxaaFloat subpixF = subpixD * subpixE;
FxaaBool lumaMLTZero = lumaMM < 0.0;
/*--------------------------------------------------------------------------*/
lumaEndN -= lumaNN * 0.5;
lumaEndP -= lumaNN * 0.5;
FxaaBool doneN = abs(lumaEndN) >= gradientScaled;
FxaaBool doneP = abs(lumaEndP) >= gradientScaled;
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;
FxaaBool doneNP = (!doneN) || (!doneP);
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;
/*--------------------------------------------------------------------------*/
if(doneNP) {
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
doneN = abs(lumaEndN) >= gradientScaled;
doneP = abs(lumaEndP) >= gradientScaled;
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;
doneNP = (!doneN) || (!doneP);
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;
/*--------------------------------------------------------------------------*/
#if (FXAA_QUALITY_PS > 3)
if(doneNP) {
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
doneN = abs(lumaEndN) >= gradientScaled;
doneP = abs(lumaEndP) >= gradientScaled;
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;
doneNP = (!doneN) || (!doneP);
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;
/*--------------------------------------------------------------------------*/
#if (FXAA_QUALITY_PS > 4)
if(doneNP) {
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
doneN = abs(lumaEndN) >= gradientScaled;
doneP = abs(lumaEndP) >= gradientScaled;
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;
doneNP = (!doneN) || (!doneP);
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;
/*--------------------------------------------------------------------------*/
#if (FXAA_QUALITY_PS > 5)
if(doneNP) {
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
doneN = abs(lumaEndN) >= gradientScaled;
doneP = abs(lumaEndP) >= gradientScaled;
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;
doneNP = (!doneN) || (!doneP);
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;
/*--------------------------------------------------------------------------*/
#if (FXAA_QUALITY_PS > 6)
if(doneNP) {
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
doneN = abs(lumaEndN) >= gradientScaled;
doneP = abs(lumaEndP) >= gradientScaled;
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;
doneNP = (!doneN) || (!doneP);
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;
/*--------------------------------------------------------------------------*/
#if (FXAA_QUALITY_PS > 7)
if(doneNP) {
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
doneN = abs(lumaEndN) >= gradientScaled;
doneP = abs(lumaEndP) >= gradientScaled;
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;
doneNP = (!doneN) || (!doneP);
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;
/*--------------------------------------------------------------------------*/
#if (FXAA_QUALITY_PS > 8)
if(doneNP) {
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
doneN = abs(lumaEndN) >= gradientScaled;
doneP = abs(lumaEndP) >= gradientScaled;
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;
doneNP = (!doneN) || (!doneP);
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;
/*--------------------------------------------------------------------------*/
#if (FXAA_QUALITY_PS > 9)
if(doneNP) {
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
doneN = abs(lumaEndN) >= gradientScaled;
doneP = abs(lumaEndP) >= gradientScaled;
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;
doneNP = (!doneN) || (!doneP);
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;
/*--------------------------------------------------------------------------*/
#if (FXAA_QUALITY_PS > 10)
if(doneNP) {
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
doneN = abs(lumaEndN) >= gradientScaled;
doneP = abs(lumaEndP) >= gradientScaled;
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;
doneNP = (!doneN) || (!doneP);
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;
/*--------------------------------------------------------------------------*/
#if (FXAA_QUALITY_PS > 11)
if(doneNP) {
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
doneN = abs(lumaEndN) >= gradientScaled;
doneP = abs(lumaEndP) >= gradientScaled;
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;
doneNP = (!doneN) || (!doneP);
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;
/*--------------------------------------------------------------------------*/
#if (FXAA_QUALITY_PS > 12)
if(doneNP) {
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
doneN = abs(lumaEndN) >= gradientScaled;
doneP = abs(lumaEndP) >= gradientScaled;
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;
doneNP = (!doneN) || (!doneP);
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;
/*--------------------------------------------------------------------------*/
}
#endif
/*--------------------------------------------------------------------------*/
}
#endif
/*--------------------------------------------------------------------------*/
}
#endif
/*--------------------------------------------------------------------------*/
}
#endif
/*--------------------------------------------------------------------------*/
}
#endif
/*--------------------------------------------------------------------------*/
}
#endif
/*--------------------------------------------------------------------------*/
}
#endif
/*--------------------------------------------------------------------------*/
}
#endif
/*--------------------------------------------------------------------------*/
}
#endif
/*--------------------------------------------------------------------------*/
}
#endif
/*--------------------------------------------------------------------------*/
}
/*--------------------------------------------------------------------------*/
FxaaFloat dstN = posM.x - posN.x;
FxaaFloat dstP = posP.x - posM.x;
if(!horzSpan) dstN = posM.y - posN.y;
if(!horzSpan) dstP = posP.y - posM.y;
/*--------------------------------------------------------------------------*/
FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;
FxaaFloat spanLength = (dstP + dstN);
FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;
FxaaFloat spanLengthRcp = 1.0/spanLength;
/*--------------------------------------------------------------------------*/
FxaaBool directionN = dstN < dstP;
FxaaFloat dst = min(dstN, dstP);
FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;
FxaaFloat subpixG = subpixF * subpixF;
FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;
FxaaFloat subpixH = subpixG * fxaaQualitySubpix;
/*--------------------------------------------------------------------------*/
FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;
FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);
if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;
if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;
return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);
}
`;var Tfi=T(S(),1),Av=`uniform vec4 u_initialColor;
#if TEXTURE_UNITS > 0
uniform sampler2D u_dayTextures[TEXTURE_UNITS];
uniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS];
uniform bool u_dayTextureUseWebMercatorT[TEXTURE_UNITS];
#ifdef APPLY_ALPHA
uniform float u_dayTextureAlpha[TEXTURE_UNITS];
#endif
#ifdef APPLY_DAY_NIGHT_ALPHA
uniform float u_dayTextureNightAlpha[TEXTURE_UNITS];
uniform float u_dayTextureDayAlpha[TEXTURE_UNITS];
#endif
#ifdef APPLY_SPLIT
uniform float u_dayTextureSplit[TEXTURE_UNITS];
#endif
#ifdef APPLY_BRIGHTNESS
uniform float u_dayTextureBrightness[TEXTURE_UNITS];
#endif
#ifdef APPLY_CONTRAST
uniform float u_dayTextureContrast[TEXTURE_UNITS];
#endif
#ifdef APPLY_HUE
uniform float u_dayTextureHue[TEXTURE_UNITS];
#endif
#ifdef APPLY_SATURATION
uniform float u_dayTextureSaturation[TEXTURE_UNITS];
#endif
#ifdef APPLY_GAMMA
uniform float u_dayTextureOneOverGamma[TEXTURE_UNITS];
#endif
//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C
#ifdef APPLY_INVERT_COLOR_MARS3D
uniform bool u_mars3dTextureInvertColor[TEXTURE_UNITS];
#endif
#ifdef APPLY_FILTER_COLOR_MARS3D
uniform vec3 u_mars3dTextureFilterColor[TEXTURE_UNITS];
#endif
//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C
#ifdef APPLY_IMAGERY_CUTOUT
uniform vec4 u_dayTextureCutoutRectangles[TEXTURE_UNITS];
#endif
#ifdef APPLY_COLOR_TO_ALPHA
uniform vec4 u_colorsToAlpha[TEXTURE_UNITS];
#endif
uniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS];
#endif
#ifdef SHOW_REFLECTIVE_OCEAN
uniform sampler2D u_waterMask;
uniform vec4 u_waterMaskTranslationAndScale;
uniform float u_zoomedOutOceanSpecularIntensity;
#endif
#ifdef SHOW_OCEAN_WAVES
uniform sampler2D u_oceanNormalMap;
#endif
#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE)
uniform vec2 u_lightingFadeDistance;
#endif
#ifdef TILE_LIMIT_RECTANGLE
uniform vec4 u_cartographicLimitRectangle;
#endif
#ifdef GROUND_ATMOSPHERE
uniform vec2 u_nightFadeDistance;
#endif
#ifdef ENABLE_CLIPPING_PLANES
uniform highp sampler2D u_clippingPlanes;
uniform mat4 u_clippingPlanesMatrix;
uniform vec4 u_clippingPlanesEdgeStyle;
#endif
#if defined(GROUND_ATMOSPHERE) || defined(FOG) && defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))
uniform float u_minimumBrightness;
#endif
#ifdef COLOR_CORRECT
uniform vec3 u_hsbShift; // Hue, saturation, brightness
#endif
#ifdef HIGHLIGHT_FILL_TILE
uniform vec4 u_fillHighlightColor;
#endif
#ifdef TRANSLUCENT
uniform vec4 u_frontFaceAlphaByDistance;
uniform vec4 u_backFaceAlphaByDistance;
uniform vec4 u_translucencyRectangle;
#endif
#ifdef UNDERGROUND_COLOR
uniform vec4 u_undergroundColor;
uniform vec4 u_undergroundColorAlphaByDistance;
#endif
#ifdef ENABLE_VERTEX_LIGHTING
uniform float u_lambertDiffuseMultiplier;
uniform float u_vertexShadowDarkness;
#endif
in vec3 v_positionMC;
in vec3 v_positionEC;
in vec3 v_textureCoordinates;
in vec3 v_normalMC;
in vec3 v_normalEC;
#ifdef APPLY_MATERIAL
in float v_height;
in float v_slope;
in float v_aspect;
#endif
//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-07-19 \u5730\u5F62\u533A\u57DF\u6750\u8D28(\u6DF9\u6CA1\uFF0C\u7B49\u9AD8\u7EBF)
#ifdef APPLY_MARS3D_FLOOD
uniform bool u_mars_flood_enabled;
uniform bool u_mars_flood_only;
uniform vec4 u_mars_flood_rectangle;
uniform highp sampler2D u_mars_flood_texture;
#endif
//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-07-19 \u5730\u5F62\u533A\u57DF\u6750\u8D28(\u6DF9\u6CA1\uFF0C\u7B49\u9AD8\u7EBF)
//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-07-19 \u5730\u5F62\u5F00\u6316
#ifdef APPLY_MARS3D_CLIP
uniform bool u_mars_clip_enabled;
uniform bool u_mars_clip_only;
uniform vec4 u_mars_clip_rectangle;
uniform highp sampler2D u_mars_clip_texture;
#endif
//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-07-19 \u5730\u5F62\u5F00\u6316
//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-07-19 \u5730\u5F62\u7F16\u8F91\u901A\u7528\u7684\u8303\u56F4\u5224\u65AD\u65B9\u6CD5\uFF08\u542B \u5730\u5F62\u62AC\u5347/\u5730\u5F62\u538B\u5E73/\u5730\u5F62\u5F00\u6316/\u5730\u5F62\u533A\u57DF\u6750\u8D28\uFF09
uniform highp float u_mars_inverseTileWidth;
uniform highp vec2 u_mars_cartographicTileRectangle;
bool inAreaMars3DRange(vec4 rectangle, sampler2D rangeTexture) {
float lo = v_textureCoordinates.x / u_mars_inverseTileWidth + u_mars_cartographicTileRectangle.x;
float la = v_textureCoordinates.y / u_mars_inverseTileWidth + u_mars_cartographicTileRectangle.y;
float newX = (lo - rectangle.x) / rectangle.z;
float newY = (la - rectangle.y) / rectangle.w;
if(newX >= 0.0 && newX <= 1.0 && newY >= 0.0 && newY <= 1.0){
vec4 point = texture(rangeTexture, vec2(newX, newY));
return point.r > 0.0;
}
return false;
}
//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-07-19 \u5730\u5F62\u7F16\u8F91\u901A\u7528\u7684\u8303\u56F4\u5224\u65AD\u65B9\u6CD5\uFF08\u542B \u5730\u5F62\u62AC\u5347/\u5730\u5F62\u538B\u5E73/\u5730\u5F62\u5F00\u6316/\u5730\u5F62\u533A\u57DF\u6750\u8D28\uFF09
#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)
in float v_distance;
#endif
#if defined(GROUND_ATMOSPHERE) || defined(FOG)
in vec3 v_atmosphereRayleighColor;
in vec3 v_atmosphereMieColor;
in float v_atmosphereOpacity;
#endif
// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u62AC\u5347
#ifdef APPLY_MARS3D_UPLIFT
uniform vec4 u_mars_uplift_rectangle;
uniform highp sampler2D u_mars_uplift_texture;
uniform bool u_mars_uplift_enabled;
uniform bool u_mars_uplift_hideInsideOrOutside;
#endif
// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u62AC\u5347
#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)
float interpolateByDistance(vec4 nearFarScalar, float distance)
{
float startDistance = nearFarScalar.x;
float startValue = nearFarScalar.y;
float endDistance = nearFarScalar.z;
float endValue = nearFarScalar.w;
float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0);
return mix(startValue, endValue, t);
}
#endif
#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) || defined(APPLY_MATERIAL)
vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor)
{
return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a);
}
#endif
#ifdef TRANSLUCENT
bool inTranslucencyRectangle()
{
return
v_textureCoordinates.x > u_translucencyRectangle.x &&
v_textureCoordinates.x < u_translucencyRectangle.z &&
v_textureCoordinates.y > u_translucencyRectangle.y &&
v_textureCoordinates.y < u_translucencyRectangle.w;
}
#endif
vec4 sampleAndBlend(
vec4 previousColor,
sampler2D textureToSample,
vec2 tileTextureCoordinates,
vec4 textureCoordinateRectangle,
vec4 textureCoordinateTranslationAndScale,
float textureAlpha,
float textureNightAlpha,
float textureDayAlpha,
float textureBrightness,
float textureContrast,
float textureHue,
float textureSaturation,
float textureOneOverGamma,
//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C
bool textureInvertColor,
vec3 texturefilterColor,
//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C
float split,
vec4 colorToAlpha,
float nightBlend)
{
// This crazy step stuff sets the alpha to 0.0 if this following condition is true:
// tileTextureCoordinates.s < textureCoordinateRectangle.s ||
// tileTextureCoordinates.s > textureCoordinateRectangle.p ||
// tileTextureCoordinates.t < textureCoordinateRectangle.t ||
// tileTextureCoordinates.t > textureCoordinateRectangle.q
// In other words, the alpha is zero if the fragment is outside the rectangle
// covered by this texture. Would an actual 'if' yield better performance?
vec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates);
textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;
alphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates);
textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;
#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING)
textureAlpha *= mix(textureDayAlpha, textureNightAlpha, nightBlend);
#endif
vec2 translation = textureCoordinateTranslationAndScale.xy;
vec2 scale = textureCoordinateTranslationAndScale.zw;
vec2 textureCoordinates = tileTextureCoordinates * scale + translation;
vec4 value = texture(textureToSample, textureCoordinates);
vec3 color = value.rgb;
float alpha = value.a;
#ifdef APPLY_COLOR_TO_ALPHA
vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb);
colorDiff.r = max(max(colorDiff.r, colorDiff.g), colorDiff.b);
alpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha);
#endif
#if !defined(APPLY_GAMMA)
vec4 tempColor = czm_gammaCorrect(vec4(color, alpha));
color = tempColor.rgb;
alpha = tempColor.a;
#else
color = pow(color, vec3(textureOneOverGamma));
#endif
#ifdef APPLY_SPLIT
float splitPosition = czm_splitPosition;
// Split to the left
if (split < 0.0 && gl_FragCoord.x > splitPosition) {
alpha = 0.0;
}
// Split to the right
else if (split > 0.0 && gl_FragCoord.x < splitPosition) {
alpha = 0.0;
}
#endif
#ifdef APPLY_BRIGHTNESS
color = mix(vec3(0.0), color, textureBrightness);
#endif
#ifdef APPLY_CONTRAST
color = mix(vec3(0.5), color, textureContrast);
#endif
#ifdef APPLY_HUE
color = czm_hue(color, textureHue);
#endif
#ifdef APPLY_SATURATION
color = czm_saturation(color, textureSaturation);
#endif
//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C
#ifdef APPLY_INVERT_COLOR_MARS3D
if(textureInvertColor) {
color = vec3(1.0 - color.r, 1.0 - color.g, 1.0 - color.b);
}
#endif
#ifdef APPLY_FILTER_COLOR_MARS3D
if(texturefilterColor.x != 1.0 || texturefilterColor.y != 1.0 || texturefilterColor.z != 1.0) {
color = vec3(color.r * texturefilterColor.x, color.g * texturefilterColor.y, color.b * texturefilterColor.z);
}
#endif
//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C
float sourceAlpha = alpha * textureAlpha;
float outAlpha = mix(previousColor.a, 1.0, sourceAlpha);
outAlpha += sign(outAlpha) - 1.0;
vec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;
// When rendering imagery for a tile in multiple passes,
// some GPU/WebGL implementation combinations will not blend fragments in
// additional passes correctly if their computation includes an unmasked
// divide-by-zero operation,
// even if it's not in the output or if the output has alpha zero.
//
// For example, without sanitization for outAlpha,
// this renders without artifacts:
// if (outAlpha == 0.0) { outColor = vec3(0.0); }
//
// but using czm_branchFreeTernary will cause portions of the tile that are
// alpha-zero in the additional pass to render as black instead of blending
// with the previous pass:
// outColor = czm_branchFreeTernary(outAlpha == 0.0, vec3(0.0), outColor);
//
// So instead, sanitize against divide-by-zero,
// store this state on the sign of outAlpha, and correct on return.
return vec4(outColor, max(outAlpha, 0.0));
}
vec3 colorCorrect(vec3 rgb) {
#ifdef COLOR_CORRECT
// Convert rgb color to hsb
vec3 hsb = czm_RGBToHSB(rgb);
// Perform hsb shift
hsb.x += u_hsbShift.x; // hue
hsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0); // saturation
hsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0; // brightness
// Convert shifted hsb back to rgb
rgb = czm_HSBToRGB(hsb);
#endif
return rgb;
}
vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend);
vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue, float fade);
const float fExposure = 2.0;
vec3 computeEllipsoidPosition()
{
float mpp = czm_metersPerPixel(vec4(0.0, 0.0, -czm_currentFrustum.x, 1.0), 1.0);
vec2 xy = gl_FragCoord.xy / czm_viewport.zw * 2.0 - vec2(1.0);
xy *= czm_viewport.zw * mpp * 0.5;
vec3 direction = normalize(vec3(xy, -czm_currentFrustum.x));
czm_ray ray = czm_ray(vec3(0.0), direction);
vec3 ellipsoid_center = czm_view[3].xyz;
czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii);
vec3 ellipsoidPosition = czm_pointAlongRay(ray, intersection.start);
return (czm_inverseView * vec4(ellipsoidPosition, 1.0)).xyz;
}
void main()
{
//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-07-19 \u5730\u5F62\u5F00\u6316
#ifdef APPLY_MARS3D_CLIP
if(u_mars_clip_enabled) {
if(u_mars_clip_only) {
if(!inAreaMars3DRange(u_mars_clip_rectangle, u_mars_clip_texture)) {
discard;
}
} else {
if(inAreaMars3DRange(u_mars_clip_rectangle, u_mars_clip_texture)) {
discard;
}
}
}
#endif
//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-07-19 \u5730\u5F62\u5F00\u6316
#ifdef TILE_LIMIT_RECTANGLE
if (v_textureCoordinates.x < u_cartographicLimitRectangle.x || u_cartographicLimitRectangle.z < v_textureCoordinates.x ||
v_textureCoordinates.y < u_cartographicLimitRectangle.y || u_cartographicLimitRectangle.w < v_textureCoordinates.y)
{
discard;
}
#endif
#ifdef ENABLE_CLIPPING_PLANES
float clipDistance = clip(gl_FragCoord, u_clippingPlanes, u_clippingPlanesMatrix);
#endif
#if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(HDR)
vec3 normalMC = czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)); // normalized surface normal in model coordinates
vec3 normalEC = czm_normal3D * normalMC; // normalized surface normal in eye coordinates
#endif
#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING)
float nightBlend = 1.0 - clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0, 0.0, 1.0);
#else
float nightBlend = 0.0;
#endif
// The clamp below works around an apparent bug in Chrome Canary v23.0.1241.0
// where the fragment shader sees textures coordinates < 0.0 and > 1.0 for the
// fragments on the edges of tiles even though the vertex shader is outputting
// coordinates strictly in the 0-1 range.
vec4 color = computeDayColor(u_initialColor, clamp(v_textureCoordinates, 0.0, 1.0), nightBlend);
#ifdef SHOW_TILE_BOUNDARIES
if (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) ||
v_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0))
{
color = vec4(1.0, 0.0, 0.0, 1.0);
}
#endif
#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE)
float cameraDist;
if (czm_sceneMode == czm_sceneMode2D)
{
cameraDist = max(czm_frustumPlanes.x - czm_frustumPlanes.y, czm_frustumPlanes.w - czm_frustumPlanes.z) * 0.5;
}
else if (czm_sceneMode == czm_sceneModeColumbusView)
{
cameraDist = -czm_view[3].z;
}
else
{
cameraDist = length(czm_view[3]);
}
float fadeOutDist = u_lightingFadeDistance.x;
float fadeInDist = u_lightingFadeDistance.y;
if (czm_sceneMode != czm_sceneMode3D) {
vec3 radii = czm_ellipsoidRadii;
float maxRadii = max(radii.x, max(radii.y, radii.z));
fadeOutDist -= maxRadii;
fadeInDist -= maxRadii;
}
float fade = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0);
#else
float fade = 0.0;
#endif
#ifdef SHOW_REFLECTIVE_OCEAN
vec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy;
vec2 waterMaskScale = u_waterMaskTranslationAndScale.zw;
vec2 waterMaskTextureCoordinates = v_textureCoordinates.xy * waterMaskScale + waterMaskTranslation;
waterMaskTextureCoordinates.y = 1.0 - waterMaskTextureCoordinates.y;
float mask = texture(u_waterMask, waterMaskTextureCoordinates).r;
if (mask > 0.0)
{
mat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC);
vec2 ellipsoidTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC);
vec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC.zyx);
vec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z));
color = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, color, mask, fade);
}
#endif
#ifdef APPLY_MATERIAL
czm_materialInput materialInput;
materialInput.st = v_textureCoordinates.st;
materialInput.normalEC = normalize(v_normalEC);
materialInput.positionToEyeEC = -v_positionEC;
materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalize(v_normalEC));
materialInput.slope = v_slope;
materialInput.height = v_height;
materialInput.aspect = v_aspect;
czm_material material = czm_getMaterial(materialInput);
//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-07-19 \u5730\u5F62\u533A\u57DF\u6750\u8D28(\u6DF9\u6CA1\uFF0C\u7B49\u9AD8\u7EBF)
bool hasAlphaBlend = true;
#ifdef APPLY_MARS3D_FLOOD
hasAlphaBlend = !u_mars_flood_enabled || (u_mars_flood_enabled && inAreaMars3DRange(u_mars_flood_rectangle, u_mars_flood_texture));
if(u_mars_flood_enabled) {
if(u_mars_flood_only) {
if(! inAreaMars3DRange(u_mars_flood_rectangle, u_mars_flood_texture)) {
discard;
}
}
}
#endif
//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-07-19 \u5730\u5F62\u533A\u57DF\u6750\u8D28(\u6DF9\u6CA1\uFF0C\u7B49\u9AD8\u7EBF)
if(hasAlphaBlend) {
vec4 materialColor = vec4(material.diffuse, material.alpha);
color = alphaBlend(materialColor, color);
}
#endif
#ifdef ENABLE_VERTEX_LIGHTING
float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalize(v_normalEC)) * u_lambertDiffuseMultiplier + u_vertexShadowDarkness, 0.0, 1.0);
vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a);
#elif defined(ENABLE_DAYNIGHT_SHADING)
float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0);
diffuseIntensity = mix(1.0, diffuseIntensity, fade);
vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a);
#else
vec4 finalColor = color;
#endif
#ifdef ENABLE_CLIPPING_PLANES
vec4 clippingPlanesEdgeColor = vec4(1.0);
clippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb;
float clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a;
if (clipDistance < clippingPlanesEdgeWidth)
{
finalColor = clippingPlanesEdgeColor;
}
#endif
#ifdef HIGHLIGHT_FILL_TILE
finalColor = vec4(mix(finalColor.rgb, u_fillHighlightColor.rgb, u_fillHighlightColor.a), finalColor.a);
#endif
#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN)
vec3 atmosphereLightDirection = czm_sunDirectionWC;
#else
vec3 atmosphereLightDirection = czm_lightDirectionWC;
#endif
#if defined(GROUND_ATMOSPHERE) || defined(FOG)
if (!czm_backFacing())
{
bool dynamicLighting = false;
#if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING))
dynamicLighting = true;
#endif
vec3 rayleighColor;
vec3 mieColor;
float opacity;
vec3 positionWC;
vec3 lightDirection;
// When the camera is far away (camera distance > nightFadeOutDistance), the scattering is computed in the fragment shader.
// Otherwise, the scattering is computed in the vertex shader.
#ifdef PER_FRAGMENT_GROUND_ATMOSPHERE
positionWC = computeEllipsoidPosition();
lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC));
computeAtmosphereScattering(
positionWC,
lightDirection,
rayleighColor,
mieColor,
opacity
);
#else
positionWC = v_positionMC;
lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC));
rayleighColor = v_atmosphereRayleighColor;
mieColor = v_atmosphereMieColor;
opacity = v_atmosphereOpacity;
#endif
#ifdef COLOR_CORRECT
const bool ignoreBlackPixels = true;
rayleighColor = czm_applyHSBShift(rayleighColor, u_hsbShift, ignoreBlackPixels);
mieColor = czm_applyHSBShift(mieColor, u_hsbShift, ignoreBlackPixels);
#endif
vec4 groundAtmosphereColor = computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity);
// Fog is applied to tiles selected for fog, close to the Earth.
#ifdef FOG
vec3 fogColor = groundAtmosphereColor.rgb;
// If there is lighting, apply that to the fog.
#if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))
float darken = clamp(dot(normalize(czm_viewerPositionWC), atmosphereLightDirection), u_minimumBrightness, 1.0);
fogColor *= darken;
#endif
#ifndef HDR
fogColor.rgb = czm_acesTonemapping(fogColor.rgb);
fogColor.rgb = czm_inverseGamma(fogColor.rgb);
#endif
const float modifier = 0.15;
finalColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor.rgb, modifier), finalColor.a);
#else
// Apply ground atmosphere. This happens when the camera is far away from the earth.
// The transmittance is based on optical depth i.e. the length of segment of the ray inside the atmosphere.
// This value is larger near the "circumference", as it is further away from the camera. We use it to
// brighten up that area of the ground atmosphere.
const float transmittanceModifier = 0.5;
float transmittance = transmittanceModifier + clamp(1.0 - groundAtmosphereColor.a, 0.0, 1.0);
vec3 finalAtmosphereColor = finalColor.rgb + groundAtmosphereColor.rgb * transmittance;
#if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))
float fadeInDist = u_nightFadeDistance.x;
float fadeOutDist = u_nightFadeDistance.y;
float sunlitAtmosphereIntensity = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.05, 1.0);
float darken = clamp(dot(normalize(positionWC), atmosphereLightDirection), 0.0, 1.0);
vec3 darkenendGroundAtmosphereColor = mix(groundAtmosphereColor.rgb, finalAtmosphereColor.rgb, darken);
finalAtmosphereColor = mix(darkenendGroundAtmosphereColor, finalAtmosphereColor, sunlitAtmosphereIntensity);
#endif
#ifndef HDR
finalAtmosphereColor.rgb = vec3(1.0) - exp(-fExposure * finalAtmosphereColor.rgb);
#else
finalAtmosphereColor.rgb = czm_saturation(finalAtmosphereColor.rgb, 1.6);
#endif
finalColor.rgb = mix(finalColor.rgb, finalAtmosphereColor.rgb, fade);
#endif
}
#endif
#ifdef UNDERGROUND_COLOR
if (czm_backFacing())
{
float distanceFromEllipsoid = max(czm_eyeHeight, 0.0);
float distance = max(v_distance - distanceFromEllipsoid, 0.0);
float blendAmount = interpolateByDistance(u_undergroundColorAlphaByDistance, distance);
vec4 undergroundColor = vec4(u_undergroundColor.rgb, u_undergroundColor.a * blendAmount);
finalColor = alphaBlend(undergroundColor, finalColor);
}
#endif
#ifdef TRANSLUCENT
if (inTranslucencyRectangle())
{
vec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance;
finalColor.a *= interpolateByDistance(alphaByDistance, v_distance);
}
#endif
// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u62AC\u5347
#ifdef APPLY_MARS3D_UPLIFT
if(u_mars_uplift_enabled) {
bool isInSlopeRampRectangle = inAreaMars3DRange(u_mars_uplift_rectangle, u_mars_uplift_texture);
if(isInSlopeRampRectangle == u_mars_uplift_hideInsideOrOutside) {
discard;
}
}
#endif
out_FragColor = finalColor;
}
#ifdef SHOW_REFLECTIVE_OCEAN
float waveFade(float edge0, float edge1, float x)
{
float y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);
return pow(1.0 - y, 5.0);
}
float linearFade(float edge0, float edge1, float x)
{
return clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);
}
// Based on water rendering by Jonas Wagner:
// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog
// low altitude wave settings
const float oceanFrequencyLowAltitude = 825000.0;
const float oceanAnimationSpeedLowAltitude = 0.004;
const float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0;
const float oceanSpecularIntensity = 0.5;
// high altitude wave settings
const float oceanFrequencyHighAltitude = 125000.0;
const float oceanAnimationSpeedHighAltitude = 0.008;
const float oceanOneOverAmplitudeHighAltitude = 1.0 / 2.0;
vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float maskValue, float fade)
{
vec3 positionToEyeEC = -positionEyeCoordinates;
float positionToEyeECLength = length(positionToEyeEC);
// The double normalize below works around a bug in Firefox on Android devices.
vec3 normalizedPositionToEyeEC = normalize(normalize(positionToEyeEC));
// Fade out the waves as the camera moves far from the surface.
float waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength);
#ifdef SHOW_OCEAN_WAVES
// high altitude waves
float time = czm_frameNumber * oceanAnimationSpeedHighAltitude;
vec4 noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyHighAltitude, time, 0.0);
vec3 normalTangentSpaceHighAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeHighAltitude);
// low altitude waves
time = czm_frameNumber * oceanAnimationSpeedLowAltitude;
noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0);
vec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude);
// blend the 2 wave layers based on distance to surface
float highAltitudeFade = linearFade(0.0, 60000.0, positionToEyeECLength);
float lowAltitudeFade = 1.0 - linearFade(20000.0, 60000.0, positionToEyeECLength);
vec3 normalTangentSpace =
(highAltitudeFade * normalTangentSpaceHighAltitude) +
(lowAltitudeFade * normalTangentSpaceLowAltitude);
normalTangentSpace = normalize(normalTangentSpace);
// fade out the normal perturbation as we move farther from the water surface
normalTangentSpace.xy *= waveIntensity;
normalTangentSpace = normalize(normalTangentSpace);
#else
vec3 normalTangentSpace = vec3(0.0, 0.0, 1.0);
#endif
vec3 normalEC = enuToEye * normalTangentSpace;
const vec3 waveHighlightColor = vec3(0.3, 0.45, 0.6);
// Use diffuse light to highlight the waves
float diffuseIntensity = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * maskValue;
vec3 diffuseHighlight = waveHighlightColor * diffuseIntensity * (1.0 - fade);
#ifdef SHOW_OCEAN_WAVES
// Where diffuse light is low or non-existent, use wave highlights based solely on
// the wave bumpiness and no particular light direction.
float tsPerturbationRatio = normalTangentSpace.z;
vec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity);
#else
vec3 nonDiffuseHighlight = vec3(0.0);
#endif
// Add specular highlights in 3D, and in all modes when zoomed in.
float specularIntensity = czm_getSpecular(czm_lightDirectionEC, normalizedPositionToEyeEC, normalEC, 10.0);
float surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), maskValue);
float specular = specularIntensity * surfaceReflectance;
#ifdef HDR
specular *= 1.4;
float e = 0.2;
float d = 3.3;
float c = 1.7;
vec3 color = imageryColor.rgb + (c * (vec3(e) + imageryColor.rgb * d) * (diffuseHighlight + nonDiffuseHighlight + specular));
#else
vec3 color = imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular;
#endif
return vec4(color, imageryColor.a);
}
#endif // #ifdef SHOW_REFLECTIVE_OCEAN
`;var Cfi=T(S(),1),Mv=`#ifdef QUANTIZATION_BITS12
in vec4 compressed0;
in float compressed1;
#else
in vec4 position3DAndHeight;
in vec4 textureCoordAndEncodedNormals;
#endif
#ifdef GEODETIC_SURFACE_NORMALS
in vec3 geodeticSurfaceNormal;
#endif
#ifdef EXAGGERATION
uniform vec2 u_verticalExaggerationAndRelativeHeight;
#endif
uniform vec3 u_center3D;
uniform mat4 u_modifiedModelView;
uniform mat4 u_modifiedModelViewProjection;
uniform vec4 u_tileRectangle;
// Uniforms for 2D Mercator projection
uniform vec2 u_southAndNorthLatitude;
uniform vec2 u_southMercatorYAndOneOverHeight;
out vec3 v_positionMC;
out vec3 v_positionEC;
out vec3 v_textureCoordinates;
out vec3 v_normalMC;
out vec3 v_normalEC;
#ifdef APPLY_MATERIAL
out float v_slope;
out float v_aspect;
out float v_height;
#endif
#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)
out float v_distance;
#endif
#if defined(FOG) || defined(GROUND_ATMOSPHERE)
out vec3 v_atmosphereRayleighColor;
out vec3 v_atmosphereMieColor;
out float v_atmosphereOpacity;
#endif
// These functions are generated at runtime.
vec4 getPosition(vec3 position, float height, vec2 textureCoordinates);
float get2DYPositionFraction(vec2 textureCoordinates);
vec4 getPosition3DMode(vec3 position, float height, vec2 textureCoordinates)
{
return u_modifiedModelViewProjection * vec4(position, 1.0);
}
float get2DMercatorYPositionFraction(vec2 textureCoordinates)
{
// The width of a tile at level 11, in radians and assuming a single root tile, is
// 2.0 * czm_pi / pow(2.0, 11.0)
// We want to just linearly interpolate the 2D position from the texture coordinates
// when we're at this level or higher. The constant below is the expression
// above evaluated and then rounded up at the 4th significant digit.
const float maxTileWidth = 0.003068;
float positionFraction = textureCoordinates.y;
float southLatitude = u_southAndNorthLatitude.x;
float northLatitude = u_southAndNorthLatitude.y;
if (northLatitude - southLatitude > maxTileWidth)
{
float southMercatorY = u_southMercatorYAndOneOverHeight.x;
float oneOverMercatorHeight = u_southMercatorYAndOneOverHeight.y;
float currentLatitude = mix(southLatitude, northLatitude, textureCoordinates.y);
currentLatitude = clamp(currentLatitude, -czm_webMercatorMaxLatitude, czm_webMercatorMaxLatitude);
positionFraction = czm_latitudeToWebMercatorFraction(currentLatitude, southMercatorY, oneOverMercatorHeight);
}
return positionFraction;
}
float get2DGeographicYPositionFraction(vec2 textureCoordinates)
{
return textureCoordinates.y;
}
vec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates)
{
float yPositionFraction = get2DYPositionFraction(textureCoordinates);
vec4 rtcPosition2D = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);
return u_modifiedModelViewProjection * rtcPosition2D;
}
vec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates)
{
return getPositionPlanarEarth(position, 0.0, textureCoordinates);
}
vec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates)
{
return getPositionPlanarEarth(position, height, textureCoordinates);
}
vec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates)
{
// We do not do RTC while morphing, so there is potential for jitter.
// This is unlikely to be noticeable, though.
vec3 position3DWC = position + u_center3D;
float yPositionFraction = get2DYPositionFraction(textureCoordinates);
vec4 position2DWC = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);
vec4 morphPosition = czm_columbusViewMorph(position2DWC, vec4(position3DWC, 1.0), czm_morphTime);
return czm_modelViewProjection * morphPosition;
}
#ifdef QUANTIZATION_BITS12
uniform vec2 u_minMaxHeight;
uniform mat4 u_scaleAndBias;
#endif
// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u538B\u5E73
#ifdef APPLY_MARS3D_FLAT
uniform bool u_mars_flat_enabled;
uniform vec4 u_mars_flat_rectangle;
uniform highp sampler2D u_mars_flat_texture;
uniform highp float u_mars_inverseTileWidth;
uniform highp vec2 u_mars_cartographicTileRectangle;
vec4 getAreaMars3DRange(vec4 rectangle, sampler2D rangeTexture, vec2 textureCoordinates) {
float lo = textureCoordinates.x / u_mars_inverseTileWidth + u_mars_cartographicTileRectangle.x;
float la = textureCoordinates.y / u_mars_inverseTileWidth + u_mars_cartographicTileRectangle.y;
float newX = (lo - rectangle.x) / rectangle.z;
float newY = (la - rectangle.y) / rectangle.w;
vec4 point;
if(newX >= 0.0 && newX <= 1.0 && newY >= 0.0 && newY <= 1.0){
vec4 point = texture(rangeTexture, vec2(newX, newY));
return point;
}else{
return vec4(0.0);
}
}
#endif
// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u538B\u5E73
void main()
{
#ifdef QUANTIZATION_BITS12
vec2 xy = czm_decompressTextureCoordinates(compressed0.x);
vec2 zh = czm_decompressTextureCoordinates(compressed0.y);
vec3 position = vec3(xy, zh.x);
float height = zh.y;
vec2 textureCoordinates = czm_decompressTextureCoordinates(compressed0.z);
height = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x;
position = (u_scaleAndBias * vec4(position, 1.0)).xyz;
#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y) || defined(APPLY_MATERIAL)
float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;
float encodedNormal = compressed1;
#elif defined(INCLUDE_WEB_MERCATOR_Y)
float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;
float encodedNormal = 0.0;
#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)
float webMercatorT = textureCoordinates.y;
float encodedNormal = compressed0.w;
#else
float webMercatorT = textureCoordinates.y;
float encodedNormal = 0.0;
#endif
#else
// A single float per element
vec3 position = position3DAndHeight.xyz;
float height = position3DAndHeight.w;
vec2 textureCoordinates = textureCoordAndEncodedNormals.xy;
#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)) && defined(INCLUDE_WEB_MERCATOR_Y)
float webMercatorT = textureCoordAndEncodedNormals.z;
float encodedNormal = textureCoordAndEncodedNormals.w;
#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)
float webMercatorT = textureCoordinates.y;
float encodedNormal = textureCoordAndEncodedNormals.z;
#elif defined(INCLUDE_WEB_MERCATOR_Y)
float webMercatorT = textureCoordAndEncodedNormals.z;
float encodedNormal = 0.0;
#else
float webMercatorT = textureCoordinates.y;
float encodedNormal = 0.0;
#endif
#endif
vec3 position3DWC = position + u_center3D;
#ifdef GEODETIC_SURFACE_NORMALS
vec3 ellipsoidNormal = geodeticSurfaceNormal;
#else
vec3 ellipsoidNormal = normalize(position3DWC);
#endif
#if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS)
float exaggeration = u_verticalExaggerationAndRelativeHeight.x;
float relativeHeight = u_verticalExaggerationAndRelativeHeight.y;
float newHeight = (height - relativeHeight) * exaggeration + relativeHeight;
// stop from going through center of earth
float minRadius = min(min(czm_ellipsoidRadii.x, czm_ellipsoidRadii.y), czm_ellipsoidRadii.z);
newHeight = max(newHeight, -minRadius);
vec3 offset = ellipsoidNormal * (newHeight - height);
position += offset;
position3DWC += offset;
height = newHeight;
#endif
// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u538B\u5E73
#ifdef APPLY_MARS3D_FLAT
if(u_mars_flat_enabled) {
vec4 isInside = getAreaMars3DRange(u_mars_flat_rectangle,u_mars_flat_texture,textureCoordinates);
if(isInside.r>0.0 || isInside.g>0.0 || isInside.b>0.0 || isInside.a>0.0){
float newHeight = czm_unpackFloat(isInside);
if(newHeight>-9999.0 && newHeight<9999.0){
vec3 offset = (newHeight - height) * ellipsoidNormal;
position += offset;
position3DWC += offset;
height = newHeight;
// vec3 newPosition = (position3DWC + offset) - u_center3D;
}
}
}
#endif
// \u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Muyao 2023-02-20 \u5730\u5F62\u538B\u5E73
gl_Position = getPosition(position, height, textureCoordinates);
v_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;
v_positionMC = position3DWC; // position in model coordinates
v_textureCoordinates = vec3(textureCoordinates, webMercatorT);
#if defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)
vec3 normalMC = czm_octDecode(encodedNormal);
#if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS)
vec3 projection = dot(normalMC, ellipsoidNormal) * ellipsoidNormal;
vec3 rejection = normalMC - projection;
normalMC = normalize(projection + rejection * exaggeration);
#endif
v_normalMC = normalMC;
v_normalEC = czm_normal3D * v_normalMC;
#endif
#if defined(FOG) || (defined(GROUND_ATMOSPHERE) && !defined(PER_FRAGMENT_GROUND_ATMOSPHERE))
bool dynamicLighting = false;
#if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING))
dynamicLighting = true;
#endif
#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN)
vec3 atmosphereLightDirection = czm_sunDirectionWC;
#else
vec3 atmosphereLightDirection = czm_lightDirectionWC;
#endif
vec3 lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(position3DWC));
computeAtmosphereScattering(
position3DWC,
lightDirection,
v_atmosphereRayleighColor,
v_atmosphereMieColor,
v_atmosphereOpacity
);
#endif
#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)
v_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz);
#endif
#ifdef APPLY_MATERIAL
float northPoleZ = czm_ellipsoidRadii.z;
vec3 northPolePositionMC = vec3(0.0, 0.0, northPoleZ);
vec3 vectorEastMC = normalize(cross(northPolePositionMC - v_positionMC, ellipsoidNormal));
float dotProd = abs(dot(ellipsoidNormal, v_normalMC));
v_slope = acos(dotProd);
vec3 normalRejected = ellipsoidNormal * dotProd;
vec3 normalProjected = v_normalMC - normalRejected;
vec3 aspectVector = normalize(normalProjected);
v_aspect = acos(dot(aspectVector, vectorEastMC));
float determ = dot(cross(vectorEastMC, aspectVector), ellipsoidNormal);
v_aspect = czm_branchFreeTernary(determ < 0.0, 2.0 * czm_pi - v_aspect, v_aspect);
v_height = height;
#endif
}
`;var Lfi=T(S(),1),mV=`void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) {
vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);
czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection);
float atmosphereInnerRadius = length(positionWC);
computeScattering(
primaryRay,
length(cameraToPositionWC),
lightDirection,
atmosphereInnerRadius,
rayleighColor,
mieColor,
opacity
);
}
`;var Zfi=T(S(),1),Nv=`uniform sampler2D u_texture;
in vec2 v_textureCoordinates;
void main()
{
out_FragColor = texture(u_texture, v_textureCoordinates);
}
`;var Efi=T(S(),1),Uv=`in vec4 position;
in float webMercatorT;
uniform vec2 u_textureDimensions;
out vec2 v_textureCoordinates;
void main()
{
v_textureCoordinates = vec2(position.x, webMercatorT);
gl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0));
}
`;var Xfi=T(S(),1),hV=`float interpolateByDistance(vec4 nearFarScalar, float distance)
{
float startDistance = nearFarScalar.x;
float startValue = nearFarScalar.y;
float endDistance = nearFarScalar.z;
float endValue = nearFarScalar.w;
float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0);
return mix(startValue, endValue, t);
}
void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity, out float underTranslucentGlobe)
{
float ellipsoidRadiiDifference = czm_ellipsoidRadii.x - czm_ellipsoidRadii.z;
// Adjustment to the atmosphere radius applied based on the camera height.
float distanceAdjustMin = czm_ellipsoidRadii.x / 4.0;
float distanceAdjustMax = czm_ellipsoidRadii.x;
float distanceAdjustModifier = ellipsoidRadiiDifference / 2.0;
float distanceAdjust = distanceAdjustModifier * clamp((czm_eyeHeight - distanceAdjustMin) / (distanceAdjustMax - distanceAdjustMin), 0.0, 1.0);
// Since atmosphere scattering assumes the atmosphere is a spherical shell, we compute an inner radius of the atmosphere best fit
// for the position on the ellipsoid.
float radiusAdjust = (ellipsoidRadiiDifference / 4.0) + distanceAdjust;
float atmosphereInnerRadius = (length(czm_viewerPositionWC) - czm_eyeHeight) - radiusAdjust;
// Setup the primary ray: from the camera position to the vertex position.
vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);
czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection);
underTranslucentGlobe = 0.0;
// Brighten the sky atmosphere under the Earth's atmosphere when translucency is enabled.
#if defined(GLOBE_TRANSLUCENT)
// Check for intersection with the inner radius of the atmopshere.
czm_raySegment primaryRayEarthIntersect = czm_raySphereIntersectionInterval(primaryRay, vec3(0.0), atmosphereInnerRadius + radiusAdjust);
if (primaryRayEarthIntersect.start > 0.0 && primaryRayEarthIntersect.stop > 0.0) {
// Compute position on globe.
vec3 direction = normalize(positionWC);
czm_ray ellipsoidRay = czm_ray(positionWC, -direction);
czm_raySegment ellipsoidIntersection = czm_rayEllipsoidIntersectionInterval(ellipsoidRay, vec3(0.0), czm_ellipsoidInverseRadii);
vec3 onEarth = positionWC - (direction * ellipsoidIntersection.start);
// Control the color using the camera angle.
float angle = dot(normalize(czm_viewerPositionWC), normalize(onEarth));
// Control the opacity using the distance from Earth.
opacity = interpolateByDistance(vec4(0.0, 1.0, czm_ellipsoidRadii.x, 0.0), length(czm_viewerPositionWC - onEarth));
vec3 horizonColor = vec3(0.1, 0.2, 0.3);
vec3 nearColor = vec3(0.0);
rayleighColor = mix(nearColor, horizonColor, exp(-angle) * opacity);
// Set the traslucent flag to avoid alpha adjustment in computeFinalColor funciton.
underTranslucentGlobe = 1.0;
return;
}
#endif
computeScattering(
primaryRay,
length(cameraToPositionWC),
lightDirection,
atmosphereInnerRadius,
rayleighColor,
mieColor,
opacity
);
// Alter the opacity based on how close the viewer is to the ground.
// (0.0 = At edge of atmosphere, 1.0 = On ground)
float cameraHeight = czm_eyeHeight + atmosphereInnerRadius;
float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;
opacity = clamp((atmosphereOuterRadius - cameraHeight) / (atmosphereOuterRadius - atmosphereInnerRadius), 0.0, 1.0);
// Alter alpha based on time of day (0.0 = night , 1.0 = day)
float nightAlpha = (u_radiiAndDynamicAtmosphereColor.z != 0.0) ? clamp(dot(normalize(positionWC), lightDirection), 0.0, 1.0) : 1.0;
opacity *= pow(nightAlpha, 0.5);
}
`;var Pfi=T(S(),1),kv=`in vec3 v_outerPositionWC;
uniform vec3 u_hsbShift;
#ifndef PER_FRAGMENT_ATMOSPHERE
in vec3 v_mieColor;
in vec3 v_rayleighColor;
in float v_opacity;
in float v_translucent;
#endif
void main (void)
{
float lightEnum = u_radiiAndDynamicAtmosphereColor.z;
vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(v_outerPositionWC, lightEnum);
vec3 mieColor;
vec3 rayleighColor;
float opacity;
float translucent;
#ifdef PER_FRAGMENT_ATMOSPHERE
computeAtmosphereScattering(
v_outerPositionWC,
lightDirection,
rayleighColor,
mieColor,
opacity,
translucent
);
#else
mieColor = v_mieColor;
rayleighColor = v_rayleighColor;
opacity = v_opacity;
translucent = v_translucent;
#endif
vec4 color = computeAtmosphereColor(v_outerPositionWC, lightDirection, rayleighColor, mieColor, opacity);
#ifndef HDR
color.rgb = czm_acesTonemapping(color.rgb);
color.rgb = czm_inverseGamma(color.rgb);
#endif
#ifdef COLOR_CORRECT
const bool ignoreBlackPixels = true;
color.rgb = czm_applyHSBShift(color.rgb, u_hsbShift, ignoreBlackPixels);
#endif
// For the parts of the sky atmosphere that are not behind a translucent globe,
// we mix in the default opacity so that the sky atmosphere still appears at distance.
// This is needed because the opacity in the sky atmosphere is initially adjusted based
// on the camera height.
if (translucent == 0.0) {
color.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime);
}
out_FragColor = color;
}
`;var wfi=T(S(),1),Dv=`in vec4 position;
out vec3 v_outerPositionWC;
#ifndef PER_FRAGMENT_ATMOSPHERE
out vec3 v_mieColor;
out vec3 v_rayleighColor;
out float v_opacity;
out float v_translucent;
#endif
void main(void)
{
vec4 positionWC = czm_model * position;
float lightEnum = u_radiiAndDynamicAtmosphereColor.z;
vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC.xyz, lightEnum);
#ifndef PER_FRAGMENT_ATMOSPHERE
computeAtmosphereScattering(
positionWC.xyz,
lightDirection,
v_rayleighColor,
v_mieColor,
v_opacity,
v_translucent
);
#endif
v_outerPositionWC = positionWC.xyz;
gl_Position = czm_modelViewProjection * position;
}
`;var Afi=T(S(),1),Bv=`uniform samplerCube u_cubeMap;
in vec3 v_texCoord;
void main()
{
vec4 color = czm_textureCube(u_cubeMap, normalize(v_texCoord));
out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);
}
`;var Nfi=T(S(),1),Ov=`in vec3 position;
out vec3 v_texCoord;
void main()
{
vec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));
gl_Position = czm_projection * vec4(p, 1.0);
v_texCoord = position.xyz;
}
`;var kfi=T(S(),1),Yv=`uniform sampler2D u_texture;
in vec2 v_textureCoordinates;
void main()
{
vec4 color = texture(u_texture, v_textureCoordinates);
out_FragColor = czm_gammaCorrect(color);
}
`;var Bfi=T(S(),1),Hv=`uniform float u_radiusTS;
in vec2 v_textureCoordinates;
vec2 rotate(vec2 p, vec2 direction)
{
return vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x);
}
vec4 addBurst(vec2 position, vec2 direction, float lengthScalar)
{
vec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75);
float radius = length(rotatedPosition) * lengthScalar;
float burst = 1.0 - smoothstep(0.0, 0.55, radius);
return vec4(burst);
}
void main()
{
float lengthScalar = 2.0 / sqrt(2.0);
vec2 position = v_textureCoordinates - vec2(0.5);
float radius = length(position) * lengthScalar;
float surface = step(radius, u_radiusTS);
vec4 color = vec4(vec2(1.0), surface + 0.2, surface);
float glow = 1.0 - smoothstep(0.0, 0.55, radius);
color.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75;
vec4 burst = vec4(0.0);
// The following loop has been manually unrolled for speed, to
// avoid sin() and cos().
//
//for (float i = 0.4; i < 3.2; i += 1.047) {
// vec2 direction = vec2(sin(i), cos(i));
// burst += 0.4 * addBurst(position, direction, lengthScalar);
//
// direction = vec2(sin(i - 0.08), cos(i - 0.08));
// burst += 0.3 * addBurst(position, direction, lengthScalar);
//}
burst += 0.4 * addBurst(position, vec2(0.38942, 0.92106), lengthScalar); // angle == 0.4
burst += 0.4 * addBurst(position, vec2(0.99235, 0.12348), lengthScalar); // angle == 0.4 + 1.047
burst += 0.4 * addBurst(position, vec2(0.60327, -0.79754), lengthScalar); // angle == 0.4 + 1.047 * 2.0
burst += 0.3 * addBurst(position, vec2(0.31457, 0.94924), lengthScalar); // angle == 0.4 - 0.08
burst += 0.3 * addBurst(position, vec2(0.97931, 0.20239), lengthScalar); // angle == 0.4 + 1.047 - 0.08
burst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar); // angle == 0.4 + 1.047 * 2.0 - 0.08
// End of manual loop unrolling.
color += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15;
out_FragColor = clamp(color, vec4(0.0), vec4(1.0));
}
`;var Yfi=T(S(),1),Kv=`in vec2 direction;
uniform float u_size;
out vec2 v_textureCoordinates;
void main()
{
vec4 position;
if (czm_morphTime == 1.0)
{
position = vec4(czm_sunPositionWC, 1.0);
}
else
{
position = vec4(czm_sunPositionColumbusView.zxy, 1.0);
}
vec4 positionEC = czm_view * position;
vec4 positionWC = czm_eyeToWindowCoordinates(positionEC);
vec2 halfSize = vec2(u_size * 0.5);
halfSize *= ((direction * 2.0) - 1.0);
gl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0);
v_textureCoordinates = direction;
}
`;var Kfi=T(S(),1),zv=`
in vec2 v_textureCoordinates;
void main()
{
czm_materialInput materialInput;
materialInput.s = v_textureCoordinates.s;
materialInput.st = v_textureCoordinates;
materialInput.str = vec3(v_textureCoordinates, 0.0);
materialInput.normalEC = vec3(0.0, 0.0, -1.0);
czm_material material = czm_getMaterial(materialInput);
out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
}
`;var DAi=T(S(),1);var Qfi=T(S(),1);function wtt(e){let t,n=e.name,i=e.message;l(n)&&l(i)?t=`${n}: ${i}`:t=e.toString();let o=e.stack;return l(o)&&(t+=`
${o}`),t}var wf=wtt;var UCi=T(S(),1);var h0i=T(S(),1);var o0i=T(S(),1);var qfi=T(S(),1),Ftt={NONE:0,LERC:1},zu=Object.freeze(Ftt);var Epi=T(S(),1);var mpi=T(S(),1);var epi=T(S(),1),Att={NONE:0,BITS12:1},Ys=Object.freeze(Att);var dT=new h,Mtt=new h,Ju=new B,Lk=new A,Ntt=new A,Utt=Math.pow(2,12);function bc(e,t,n,i,o,r,s,a,c,d){let u=Ys.NONE,m,p;if(l(t)&&l(n)&&l(i)&&l(o)){let y=t.minimum,f=t.maximum,x=h.subtract(f,y,Mtt),_=i-n;Math.max(h.maximumComponent(x),_)<Utt-1?u=Ys.BITS12:u=Ys.NONE,m=A.inverseTransformation(o,new A);let V=h.negate(y,dT);A.multiply(A.fromTranslation(V,Lk),m,m);let L=dT;L.x=1/x.x,L.y=1/x.y,L.z=1/x.z,A.multiply(A.fromScale(L,Lk),m,m),p=A.clone(o),A.setTranslation(p,h.ZERO,p),o=A.clone(o,new A);let Z=A.fromTranslation(y,Lk),G=A.fromScale(x,Ntt),I=A.multiply(Z,G,Lk);A.multiply(o,I,o),A.multiply(p,I,p)}this.quantization=u,this.minimumHeight=n,this.maximumHeight=i,this.center=h.clone(e),this.toScaledENU=m,this.fromScaledENU=o,this.matrix=p,this.hasVertexNormals=r,this.hasWebMercatorT=g(s,!1),this.hasGeodeticSurfaceNormals=g(a,!1),this.exaggeration=g(c,1),this.exaggerationRelativeHeight=g(d,0),this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}bc.prototype.encode=function(e,t,n,i,o,r,s,a){let c=i.x,d=i.y;if(this.quantization===Ys.BITS12){n=A.multiplyByPoint(this.toScaledENU,n,dT),n.x=W.clamp(n.x,0,1),n.y=W.clamp(n.y,0,1),n.z=W.clamp(n.z,0,1);let u=this.maximumHeight-this.minimumHeight,m=W.clamp((o-this.minimumHeight)/u,0,1);B.fromElements(n.x,n.y,Ju);let p=Fn.compressTextureCoordinates(Ju);B.fromElements(n.z,m,Ju);let y=Fn.compressTextureCoordinates(Ju);B.fromElements(c,d,Ju);let f=Fn.compressTextureCoordinates(Ju);if(e[t++]=p,e[t++]=y,e[t++]=f,this.hasWebMercatorT){B.fromElements(s,0,Ju);let x=Fn.compressTextureCoordinates(Ju);e[t++]=x}}else h.subtract(n,this.center,dT),e[t++]=dT.x,e[t++]=dT.y,e[t++]=dT.z,e[t++]=o,e[t++]=c,e[t++]=d,this.hasWebMercatorT&&(e[t++]=s);return this.hasVertexNormals&&(e[t++]=Fn.octPackFloat(r)),this.hasGeodeticSurfaceNormals&&(e[t++]=a.x,e[t++]=a.y,e[t++]=a.z),t};var ktt=new h,a0e=new h;bc.prototype.addGeodeticSurfaceNormals=function(e,t,n){if(this.hasGeodeticSurfaceNormals)return;let i=this.stride,o=e.length/i;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let r=this.stride;for(let s=0;s<o;s++){for(let u=0;u<i;u++){let m=s*i+u,p=s*r+u;t[p]=e[m]}let a=this.decodePosition(t,s,ktt),c=n.geodeticSurfaceNormal(a,a0e),d=s*r+this._offsetGeodeticSurfaceNormal;t[d]=c.x,t[d+1]=c.y,t[d+2]=c.z}};bc.prototype.removeGeodeticSurfaceNormals=function(e,t){if(!this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=e.length/n;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let o=this.stride;for(let r=0;r<i;r++)for(let s=0;s<o;s++){let a=r*n+s,c=r*o+s;t[c]=e[a]}};bc.prototype.decodePosition=function(e,t,n){if(l(n)||(n=new h),t*=this.stride,this.quantization===Ys.BITS12){let i=Fn.decompressTextureCoordinates(e[t],Ju);n.x=i.x,n.y=i.y;let o=Fn.decompressTextureCoordinates(e[t+1],Ju);return n.z=o.x,A.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=e[t],n.y=e[t+1],n.z=e[t+2],h.add(n,this.center,n)};bc.prototype.getExaggeratedPosition=function(e,t,n){n=this.decodePosition(e,t,n);let i=this.exaggeration,o=this.exaggerationRelativeHeight;if(i!==1&&this.hasGeodeticSurfaceNormals){let s=this.decodeGeodeticSurfaceNormal(e,t,a0e),a=this.decodeHeight(e,t),c=Dr.getHeight(a,i,o)-a;n.x+=s.x*c,n.y+=s.y*c,n.z+=s.z*c}return n};bc.prototype.decodeTextureCoordinates=function(e,t,n){return l(n)||(n=new B),t*=this.stride,this.quantization===Ys.BITS12?Fn.decompressTextureCoordinates(e[t+2],n):B.fromElements(e[t+4],e[t+5],n)};bc.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===Ys.BITS12?Fn.decompressTextureCoordinates(e[t+1],Ju).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};bc.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===Ys.BITS12?Fn.decompressTextureCoordinates(e[t+3],Ju).x:e[t+6]};bc.prototype.getOctEncodedNormal=function(e,t,n){t=t*this.stride+this._offsetVertexNormal;let i=e[t]/256,o=Math.floor(i),r=(i-o)*256;return B.fromElements(o,r,n)};bc.prototype.decodeGeodeticSurfaceNormal=function(e,t,n){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,n.x=e[t],n.y=e[t+1],n.z=e[t+2],n};bc.prototype._calculateStrideAndOffsets=function(){let e=0;switch(this.quantization){case Ys.BITS12:e+=3;break;default:e+=6}this.hasWebMercatorT&&(e+=1),this.hasVertexNormals&&(this._offsetVertexNormal=e,e+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=e,e+=3),this.stride=e};var Rk={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},Zk={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};bc.prototype.getAttributes=function(e){let t=Q.FLOAT,n=Q.getSizeInBytes(t),i=this.stride*n,o=0,r=[];function s(a,c){r.push({index:a,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:c,offsetInBytes:o,strideInBytes:i}),o+=c*n}if(this.quantization===Ys.NONE){s(Rk.position3DAndHeight,4);let a=2;a+=this.hasWebMercatorT?1:0,a+=this.hasVertexNormals?1:0,s(Rk.textureCoordAndEncodedNormals,a),this.hasGeodeticSurfaceNormals&&s(Rk.geodeticSurfaceNormal,3)}else{let a=this.hasWebMercatorT||this.hasVertexNormals,c=this.hasWebMercatorT&&this.hasVertexNormals;s(Zk.compressed0,a?4:3),c&&s(Zk.compressed1,1),this.hasGeodeticSurfaceNormals&&s(Zk.geodeticSurfaceNormal,3)}return r};bc.prototype.getAttributeLocations=function(){return this.quantization===Ys.NONE?Rk:Zk};bc.clone=function(e,t){if(l(e))return l(t)||(t=new bc),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=h.clone(e.center),t.toScaledENU=A.clone(e.toScaledENU),t.fromScaledENU=A.clone(e.fromScaledENU),t.matrix=A.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t.hasGeodeticSurfaceNormals=e.hasGeodeticSurfaceNormals,t.exaggeration=e.exaggeration,t.exaggerationRelativeHeight=e.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var yc=bc;var Ff={};Ff.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var GQ=new h,Dtt=new A,Btt=new h,Ott=new h;Ff.computeVertices=function(e){let t=Math.cos,n=Math.sin,i=Math.sqrt,o=Math.atan,r=Math.exp,s=W.PI_OVER_TWO,a=W.toRadians,c=e.heightmap,d=e.width,u=e.height,m=e.skirtHeight,p=m>0,y=g(e.isGeographic,!0),f=g(e.ellipsoid,oe.WGS84),x=1/f.maximumRadius,_=de.clone(e.nativeRectangle),C=de.clone(e.rectangle),V,L,Z,G;l(C)?(V=C.west,L=C.south,Z=C.east,G=C.north):y?(V=a(_.west),L=a(_.south),Z=a(_.east),G=a(_.north)):(V=_.west*x,L=s-2*o(r(-_.south*x)),Z=_.east*x,G=s-2*o(r(-_.north*x)));let I=e.relativeToCenter,P=l(I);I=P?I:h.ZERO;let v=g(e.includeWebMercatorT,!1),F=g(e.exaggeration,1),M=g(e.exaggerationRelativeHeight,0),R=F!==1,E=g(e.structure,Ff.DEFAULT_STRUCTURE),X=g(E.heightScale,Ff.DEFAULT_STRUCTURE.heightScale),w=g(E.heightOffset,Ff.DEFAULT_STRUCTURE.heightOffset),N=g(E.elementsPerHeight,Ff.DEFAULT_STRUCTURE.elementsPerHeight),D=g(E.stride,Ff.DEFAULT_STRUCTURE.stride),k=g(E.elementMultiplier,Ff.DEFAULT_STRUCTURE.elementMultiplier),Y=g(E.isBigEndian,Ff.DEFAULT_STRUCTURE.isBigEndian),U=de.computeWidth(_),J=de.computeHeight(_),K=U/(d-1),ee=J/(u-1);y||(U*=x,J*=x);let H=f.radiiSquared,j=H.x,$=H.y,pe=H.z,ge=65536,ae=-65536,be=Xt.eastNorthUpToFixedFrame(I,f),_e=A.inverseTransformation(be,Dtt),Ze,Le;v&&(Ze=Gi.geodeticLatitudeToMercatorAngle(L),Le=1/(Gi.geodeticLatitudeToMercatorAngle(G)-Ze));let Ee=Btt;Ee.x=Number.POSITIVE_INFINITY,Ee.y=Number.POSITIVE_INFINITY,Ee.z=Number.POSITIVE_INFINITY;let He=Ott;He.x=Number.NEGATIVE_INFINITY,He.y=Number.NEGATIVE_INFINITY,He.z=Number.NEGATIVE_INFINITY;let we=Number.POSITIVE_INFINITY,dt=d*u,bt=m>0?d*2+u*2:0,it=dt+bt,en=new Array(it),_n=new Array(it),kt=new Array(it),At=v?new Array(it):[],Te=R?new Array(it):[],Re=0,ct=u,Jt=0,mi=d;p&&(--Re,++ct,--Jt,++mi);let Ke=1e-5;for(let Ye=Re;Ye<ct;++Ye){let ht=Ye;ht<0&&(ht=0),ht>=u&&(ht=u-1);let Dt=_.north-ee*ht;y?Dt=a(Dt):Dt=s-2*o(r(-Dt*x));let fn=(Dt-L)/(G-L);fn=W.clamp(fn,0,1);let jn=Ye===Re,ki=Ye===ct-1;m>0&&(jn?Dt+=Ke*J:ki&&(Dt-=Ke*J));let Lo=t(Dt),Is=n(Dt),fr=pe*Is,Ji;v&&(Ji=(Gi.geodeticLatitudeToMercatorAngle(Dt)-Ze)*Le);for(let hs=Jt;hs<mi;++hs){let Jn=hs;Jn<0&&(Jn=0),Jn>=d&&(Jn=d-1);let Un=ht*(d*D)+Jn*D,un;if(N===1)un=c[Un];else{un=0;let zs;if(Y)for(zs=0;zs<N;++zs)un=un*k+c[Un+zs];else for(zs=N-1;zs>=0;--zs)un=un*k+c[Un+zs]}un=un*X+w,ae=Math.max(ae,un),ge=Math.min(ge,un);let fi=_.west+K*Jn;y?fi=a(fi):fi=fi*x;let Qi=(fi-V)/(Z-V);Qi=W.clamp(Qi,0,1);let fs=ht*d+Jn;if(m>0){let zs=hs===Jt,ji=hs===mi-1,ll=jn||ki||zs||ji;if((jn||ki)&&(zs||ji))continue;ll&&(un-=m,zs?(fs=dt+(u-ht-1),fi-=Ke*U):ki?fs=dt+u+(d-Jn-1):ji?(fs=dt+u+d+ht,fi+=Ke*U):jn&&(fs=dt+u+d+u+Jn))}let po=Lo*t(fi),Rc=Lo*n(fi),jd=j*po,Ql=$*Rc,wh=1/i(jd*po+Ql*Rc+fr*Is),cl=jd*wh,Fh=Ql*wh,ts=fr*wh,ns=new h;ns.x=cl+po*un,ns.y=Fh+Rc*un,ns.z=ts+Is*un,A.multiplyByPoint(_e,ns,GQ),h.minimumByComponent(GQ,Ee,Ee),h.maximumByComponent(GQ,He,He),we=Math.min(we,un),en[fs]=ns,kt[fs]=new B(Qi,fn),_n[fs]=un,v&&(At[fs]=Ji),R&&(Te[fs]=f.geodeticSurfaceNormal(ns))}}let $r=ce.fromPoints(en),es;l(C)&&(es=Xn.fromRectangle(C,ge,ae,f));let ga;P&&(ga=new qm(f).computeHorizonCullingPointPossiblyUnderEllipsoid(I,en,ge));let ms=new Tb(Ee,He,I),Fe=new yc(I,ms,we,ae,be,!1,v,R,F,M),rt=new Float32Array(it*Fe.stride),qe=0;for(let Ye=0;Ye<it;++Ye)qe=Fe.encode(rt,qe,en[Ye],kt[Ye],_n[Ye],void 0,At[Ye],Te[Ye]);return{vertices:rt,maximumHeight:ae,minimumHeight:ge,encoding:Fe,boundingSphere3D:$r,orientedBoundingBox:es,occludeePointInScaledSpace:ga}};var fV=Ff;var Wpi=T(S(),1);function ng(){fe.throwInstantiationError()}Object.defineProperties(ng.prototype,{credits:{get:fe.throwInstantiationError},waterMask:{get:fe.throwInstantiationError}});ng.prototype.interpolateHeight=fe.throwInstantiationError;ng.prototype.isChildAvailable=fe.throwInstantiationError;ng.prototype.createMesh=fe.throwInstantiationError;ng.prototype.upsample=fe.throwInstantiationError;ng.prototype.wasCreatedByUpsampling=fe.throwInstantiationError;ng.maximumAsynchronousTasks=5;var xh=ng;var wpi=T(S(),1);function Ytt(e,t,n,i,o,r,s,a,c,d,u,m,p,y,f,x){this.center=e,this.vertices=t,this.stride=g(d,6),this.indices=n,this.indexCountWithoutSkirts=i,this.vertexCountWithoutSkirts=o,this.minimumHeight=r,this.maximumHeight=s,this.boundingSphere3D=a,this.occludeePointInScaledSpace=c,this.orientedBoundingBox=u,this.encoding=m,this.westIndicesSouthToNorth=p,this.southIndicesEastToWest=y,this.eastIndicesNorthToSouth=f,this.northIndicesWestToEast=x}var Qu=Ytt;var kpi=T(S(),1);function $c(){fe.throwInstantiationError()}Object.defineProperties($c.prototype,{errorEvent:{get:fe.throwInstantiationError},credit:{get:fe.throwInstantiationError},tilingScheme:{get:fe.throwInstantiationError},hasWaterMask:{get:fe.throwInstantiationError},hasVertexNormals:{get:fe.throwInstantiationError},availability:{get:fe.throwInstantiationError}});var c0e=[];$c.getRegularGridIndices=function(e,t){let n=c0e[e];l(n)||(c0e[e]=n=[]);let i=n[t];return l(i)||(e*t<W.SIXTY_FOUR_KILOBYTES?i=n[t]=new Uint16Array((e-1)*(t-1)*6):i=n[t]=new Uint32Array((e-1)*(t-1)*6),m0e(e,t,i,0)),i};var l0e=[];$c.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=l0e[e];l(n)||(l0e[e]=n=[]);let i=n[t];if(!l(i)){let o=$c.getRegularGridIndices(e,t),r=u0e(e,t),s=r.westIndicesSouthToNorth,a=r.southIndicesEastToWest,c=r.eastIndicesNorthToSouth,d=r.northIndicesWestToEast;i=n[t]={indices:o,westIndicesSouthToNorth:s,southIndicesEastToWest:a,eastIndicesNorthToSouth:c,northIndicesWestToEast:d}}return i};var d0e=[];$c.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=d0e[e];l(n)||(d0e[e]=n=[]);let i=n[t];if(!l(i)){let o=e*t,r=(e-1)*(t-1)*6,s=e*2+t*2,a=Math.max(0,s-4)*6,c=o+s,d=r+a,u=u0e(e,t),m=u.westIndicesSouthToNorth,p=u.southIndicesEastToWest,y=u.eastIndicesNorthToSouth,f=u.northIndicesWestToEast,x=Ne.createTypedArray(c,d);m0e(e,t,x,0),$c.addSkirtIndices(m,p,y,f,o,x,r),i=n[t]={indices:x,westIndicesSouthToNorth:m,southIndicesEastToWest:p,eastIndicesNorthToSouth:y,northIndicesWestToEast:f,indexCountWithoutSkirts:r}}return i};$c.addSkirtIndices=function(e,t,n,i,o,r,s){let a=o;s=Gk(e,a,r,s),a+=e.length,s=Gk(t,a,r,s),a+=t.length,s=Gk(n,a,r,s),a+=n.length,Gk(i,a,r,s)};function u0e(e,t){let n=new Array(t),i=new Array(e),o=new Array(t),r=new Array(e),s;for(s=0;s<e;++s)r[s]=s,i[s]=e*t-1-s;for(s=0;s<t;++s)o[s]=(s+1)*e-1,n[s]=(t-s-1)*e;return{westIndicesSouthToNorth:n,southIndicesEastToWest:i,eastIndicesNorthToSouth:o,northIndicesWestToEast:r}}function m0e(e,t,n,i){let o=0;for(let r=0;r<t-1;++r){for(let s=0;s<e-1;++s){let a=o,c=a+e,d=c+1,u=a+1;n[i++]=a,n[i++]=c,n[i++]=u,n[i++]=u,n[i++]=c,n[i++]=d,++o}++o}}function Gk(e,t,n,i){let o=e[0],r=e.length;for(let s=1;s<r;++s){let a=e[s];n[i++]=o,n[i++]=a,n[i++]=t,n[i++]=t,n[i++]=a,n[i++]=t+1,o=a,++t}return i}$c.heightmapTerrainQuality=.25;$c.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*$c.heightmapTerrainQuality/(t*n)};$c.prototype.requestTileGeometry=fe.throwInstantiationError;$c.prototype.getLevelMaximumGeometricError=fe.throwInstantiationError;$c.prototype.getTileDataAvailable=fe.throwInstantiationError;$c.prototype.loadTileDataAvailability=fe.throwInstantiationError;var zr=$c;function O0(e){this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=g(e.childTileMask,15),this._encoding=g(e.encoding,zu.NONE);let t=fV.DEFAULT_STRUCTURE,n=e.structure;l(n)?n!==t&&(n.heightScale=g(n.heightScale,t.heightScale),n.heightOffset=g(n.heightOffset,t.heightOffset),n.elementsPerHeight=g(n.elementsPerHeight,t.elementsPerHeight),n.stride=g(n.stride,t.stride),n.elementMultiplier=g(n.elementMultiplier,t.elementMultiplier),n.isBigEndian=g(n.isBigEndian,t.isBigEndian)):n=t,this._structure=n,this._createdByUpsampling=g(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._encoding===zu.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(O0.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var h0e="createVerticesFromHeightmap",Htt=new gi(h0e),Ktt=new gi(h0e,xh.maximumAsynchronousTasks);O0.prototype.createMesh=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=g(e.exaggeration,1),s=g(e.exaggerationRelativeHeight,0),a=g(e.throttle,!0),c=t.ellipsoid,d=t.tileXYToNativeRectangle(n,i,o),u=t.tileXYToRectangle(n,i,o),m=c.cartographicToCartesian(de.center(u)),p=this._structure,f=zr.getEstimatedLevelZeroGeometricErrorForAHeightmap(c,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(f*4,1e3);let _=(a?Ktt:Htt).scheduleTask({heightmap:this._buffer,structure:p,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:d,rectangle:u,relativeToCenter:m,ellipsoid:c,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Ri,exaggeration:r,exaggerationRelativeHeight:s,encoding:this._encoding});if(!l(_))return;let C=this;return Promise.resolve(_).then(function(V){let L;C._skirtHeight>0?L=zr.getRegularGridAndSkirtIndicesAndEdgeIndices(V.gridWidth,V.gridHeight):L=zr.getRegularGridIndicesAndEdgeIndices(V.gridWidth,V.gridHeight);let Z=V.gridWidth*V.gridHeight;return C._mesh=new Qu(m,new Float32Array(V.vertices),L.indices,L.indexCountWithoutSkirts,Z,V.minimumHeight,V.maximumHeight,ce.clone(V.boundingSphere3D),h.clone(V.occludeePointInScaledSpace),V.numberOfAttributes,Xn.clone(V.orientedBoundingBox),yc.clone(V.encoding),L.westIndicesSouthToNorth,L.southIndicesEastToWest,L.eastIndicesNorthToSouth,L.northIndicesWestToEast),C._buffer=void 0,C._mesh})};O0.prototype._createMeshSync=function(e){let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=g(e.exaggeration,1),s=g(e.exaggerationRelativeHeight,0),a=t.ellipsoid,c=t.tileXYToNativeRectangle(n,i,o),d=t.tileXYToRectangle(n,i,o),u=a.cartographicToCartesian(de.center(d)),m=this._structure,y=zr.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(y*4,1e3);let f=fV.computeVertices({heightmap:this._buffer,structure:m,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:c,rectangle:d,relativeToCenter:u,ellipsoid:a,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Ri,exaggeration:r,exaggerationRelativeHeight:s});this._buffer=void 0;let x;this._skirtHeight>0?x=zr.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):x=zr.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let _=f.gridWidth*f.gridHeight;return this._mesh=new Qu(u,f.vertices,x.indices,x.indexCountWithoutSkirts,_,f.minimumHeight,f.maximumHeight,f.boundingSphere3D,f.occludeePointInScaledSpace,f.encoding.stride,f.orientedBoundingBox,f.encoding,x.westIndicesSouthToNorth,x.southIndicesEastToWest,x.eastIndicesNorthToSouth,x.northIndicesWestToEast),this._mesh};O0.prototype.interpolateHeight=function(e,t,n){let i=this._width,o=this._height,r=this._structure,s=r.stride,a=r.elementsPerHeight,c=r.elementMultiplier,d=r.isBigEndian,u=r.heightOffset,m=r.heightScale,p=l(this._mesh),y=this._encoding===zu.LERC;if(!p&&y)return;let x;if(p){let _=this._mesh.vertices,C=this._mesh.encoding;x=f0e(_,C,u,m,e,i,o,t,n)}else x=ztt(this._buffer,a,c,s,d,e,i,o,t,n),x=x*m+u;return x};O0.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(a))return;let c=this._width,d=this._height,u=this._structure,m=u.stride,p=new this._bufferType(c*d*m),y=a.vertices,f=a.encoding,x=e.tileXYToRectangle(t,n,i),_=e.tileXYToRectangle(o,r,s),C=u.heightOffset,V=u.heightScale,L=u.elementsPerHeight,Z=u.elementMultiplier,G=u.isBigEndian,I=Math.pow(Z,L-1);for(let P=0;P<d;++P){let v=W.lerp(_.north,_.south,P/(d-1));for(let F=0;F<c;++F){let M=W.lerp(_.west,_.east,F/(c-1)),b=f0e(y,f,C,V,x,c,d,M,v);b=b<u.lowestEncodedHeight?u.lowestEncodedHeight:b,b=b>u.highestEncodedHeight?u.highestEncodedHeight:b,Jtt(p,L,Z,I,m,G,P*c+F,b)}}return Promise.resolve(new O0({buffer:p,width:c,height:d,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};O0.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};O0.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function ztt(e,t,n,i,o,r,s,a,c,d){let u=(c-r.west)*(s-1)/(r.east-r.west),m=(d-r.south)*(a-1)/(r.north-r.south),p=u|0,y=p+1;y>=s&&(y=s-1,p=s-2);let f=m|0,x=f+1;x>=a&&(x=a-1,f=a-2);let _=u-p,C=m-f;f=a-1-f,x=a-1-x;let V=Ek(e,t,n,i,o,f*s+p),L=Ek(e,t,n,i,o,f*s+y),Z=Ek(e,t,n,i,o,x*s+p),G=Ek(e,t,n,i,o,x*s+y);return p0e(_,C,V,L,Z,G)}function f0e(e,t,n,i,o,r,s,a,c){let d=(a-o.west)*(r-1)/(o.east-o.west),u=(c-o.south)*(s-1)/(o.north-o.south),m=d|0,p=m+1;p>=r&&(p=r-1,m=r-2);let y=u|0,f=y+1;f>=s&&(f=s-1,y=s-2);let x=d-m,_=u-y;y=s-1-y,f=s-1-f;let C=(t.decodeHeight(e,y*r+m)-n)/i,V=(t.decodeHeight(e,y*r+p)-n)/i,L=(t.decodeHeight(e,f*r+m)-n)/i,Z=(t.decodeHeight(e,f*r+p)-n)/i;return p0e(x,_,C,V,L,Z)}function p0e(e,t,n,i,o,r){return t<e?n+e*(i-n)+t*(r-i):n+e*(r-o)+t*(o-n)}function Ek(e,t,n,i,o,r){r*=i;let s=0,a;if(o)for(a=0;a<t;++a)s=s*n+e[r+a];else for(a=t-1;a>=0;--a)s=s*n+e[r+a];return s}function Jtt(e,t,n,i,o,r,s,a){s*=o;let c;if(r)for(c=0;c<t-1;++c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;else for(c=t-1;c>0;--c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;e[s+c]=a}var va=O0;function pV(e){e=g(e,g.EMPTY_OBJECT),this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Oi({ellipsoid:g(e.ellipsoid,oe.WGS84)})),this._levelZeroMaximumGeometricError=zr.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new ye}Object.defineProperties(pV.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});pV.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new va({buffer:new Uint8Array(16*16),width:16,height:16}))};pV.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};pV.prototype.getTileDataAvailable=function(e,t,n){};pV.prototype.loadTileDataAvailability=function(e,t,n){};var uT=pV;var L0i=T(S(),1);var y0i=T(S(),1);var Qtt=new B;function jtt(e,t){let n=e.unionClippingRegions,i=e.length,o=ys.useFloatTexture(t),r=ys.getTextureResolution(e,t,Qtt),s=r.x,a=r.y,c=o?ent(s,a):tnt(s,a);return c+=`
`,c+=n?qtt(i):$tt(i),c}function qtt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)
{
vec4 position = czm_windowToEyeCoordinates(fragCoord);
vec3 clipNormal = vec3(0.0);
vec3 clipPosition = vec3(0.0);
float clipAmount;
float pixelWidth = czm_metersPerPixel(position);
bool breakAndDiscard = false;
for (int i = 0; i < ${e}; ++i)
{
vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);
clipNormal = clippingPlane.xyz;
clipPosition = -clippingPlane.w * clipNormal;
float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;
clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount));
if (amount <= 0.0)
{
breakAndDiscard = true;
break;
}
}
if (breakAndDiscard) {
discard;
}
return clipAmount;
}
`}function $tt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)
{
bool clipped = true;
vec4 position = czm_windowToEyeCoordinates(fragCoord);
vec3 clipNormal = vec3(0.0);
vec3 clipPosition = vec3(0.0);
float clipAmount = 0.0;
float pixelWidth = czm_metersPerPixel(position);
for (int i = 0; i < ${e}; ++i)
{
vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);
clipNormal = clippingPlane.xyz;
clipPosition = -clippingPlane.w * clipNormal;
float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;
clipAmount = max(amount, clipAmount);
clipped = clipped && (amount <= 0.0);
}
if (clipped)
{
discard;
}
return clipAmount;
}
`}function ent(e,t){let n=1/e,i=1/t,o=`${n}`;o.indexOf(".")===-1&&(o+=".0");let r=`${i}`;return r.indexOf(".")===-1&&(r+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)
{
int pixY = clippingPlaneNumber / ${e};
int pixX = clippingPlaneNumber - (pixY * ${e});
float u = (float(pixX) + 0.5) * ${o};
float v = (float(pixY) + 0.5) * ${r};
vec4 plane = texture(packedClippingPlanes, vec2(u, v));
return czm_transformPlane(plane, transform);
}
`}function tnt(e,t){let n=1/e,i=1/t,o=`${n}`;o.indexOf(".")===-1&&(o+=".0");let r=`${i}`;return r.indexOf(".")===-1&&(r+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)
{
int clippingPlaneStartIndex = clippingPlaneNumber * 2;
int pixY = clippingPlaneStartIndex / ${e};
int pixX = clippingPlaneStartIndex - (pixY * ${e});
float u = (float(pixX) + 0.5) * ${o};
float v = (float(pixY) + 0.5) * ${r};
vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0;
vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w);
vec4 plane;
plane.xyz = czm_octDecode(oct, 65535.0);
plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + ${o}, v)));
return czm_transformPlane(plane, transform);
}
`}var Y0=jtt;function nnt(e,t,n,i,o){this.numberOfDayTextures=e,this.flags=t,this.material=n,this.shaderProgram=i,this.clippingShaderState=o}function EQ(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}function int(e){let t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }",n="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }",i="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }",o;switch(e){case ie.SCENE3D:o=t;break;case ie.SCENE2D:case ie.COLUMBUS_VIEW:o=n;break;case ie.MORPHING:o=i;break}return o}function ont(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}EQ.prototype.getShaderProgram=function(e){let t=e.frameState,n=e.surfaceTile,i=e.numberOfDayTextures,o=e.applyBrightness,r=e.applyContrast,s=e.applyHue,a=e.applySaturation,c=e.applyGamma,d=e.applyAlpha,u=e.applyDayNightAlpha,m=e.applySplit,p=e.showReflectiveOcean,y=e.showOceanWaves,f=e.enableLighting,x=e.dynamicAtmosphereLighting,_=e.dynamicAtmosphereLightingFromSun,C=e.showGroundAtmosphere,V=e.perFragmentGroundAtmosphere,L=e.hasVertexNormals,Z=e.useWebMercatorProjection,G=e.enableFog,I=e.enableClippingPlanes,P=e.clippingPlanes,v=e.clippedByBoundaries,F=e.hasImageryLayerCutout,M=e.colorCorrect,b=e.highlightFillTile,R=e.colorToAlpha,E=e.hasGeodeticSurfaceNormals,X=e.hasExaggeration,w=e.showUndergroundColor,N=e.translucent,D=e.marsOptions||{},k=0,Y="",J=n.renderedMesh.encoding;J.quantization===Ys.BITS12&&(k=1,Y="QUANTIZATION_BITS12");let ee=0,H="";v&&(ee=1,H="TILE_LIMIT_RECTANGLE");let j=0,$="";F&&(j=1,$="APPLY_IMAGERY_CUTOUT");let pe=t.mode,ge=pe|o<<2|r<<3|s<<4|a<<5|c<<6|d<<7|p<<8|y<<9|f<<10|x<<11|_<<12|C<<13|V<<14|L<<15|Z<<16|G<<17|k<<18|m<<19|I<<20|ee<<21|j<<22|M<<23|b<<24|R<<25|E<<26|X<<27|w<<28|N<<29|u<<30,ae=0;l(P)&&P.length>0&&(ae=I?P.clippingPlanesState:0);let be=n.surfaceShader;if(l(be)&&be.numberOfDayTextures===i&&be.flags===ge&&be.material===this.material&&be.clippingShaderState===ae)return be.shaderProgram;let _e=this._shadersByTexturesFlags[i];if(l(_e)||(_e=this._shadersByTexturesFlags[i]=[]),be=_e[ge],!l(be)||be.material!==this.material||be.clippingShaderState!==ae){let Ze=this.baseVertexShaderSource.clone(),Le=this.baseFragmentShaderSource.clone();ae!==0&&Le.sources.unshift(Y0(P,t.context)),D.enableUplift&&Le.defines.push("APPLY_MARS3D_UPLIFT"),D.enableFlat&&Ze.defines.push("APPLY_MARS3D_FLAT"),D.enableClip&&Le.defines.push("APPLY_MARS3D_CLIP"),D.enableFlood&&Le.defines.push("APPLY_MARS3D_FLOOD"),Ze.defines.push(Y),Le.defines.push(`TEXTURE_UNITS ${i}`,H,$),o&&Le.defines.push("APPLY_BRIGHTNESS"),r&&Le.defines.push("APPLY_CONTRAST"),s&&Le.defines.push("APPLY_HUE"),a&&Le.defines.push("APPLY_SATURATION"),c&&Le.defines.push("APPLY_GAMMA"),D.invertColor&&Le.defines.push("APPLY_INVERT_COLOR_MARS3D"),D.filterColor&&Le.defines.push("APPLY_FILTER_COLOR_MARS3D"),d&&Le.defines.push("APPLY_ALPHA"),u&&Le.defines.push("APPLY_DAY_NIGHT_ALPHA"),p&&(Le.defines.push("SHOW_REFLECTIVE_OCEAN"),Ze.defines.push("SHOW_REFLECTIVE_OCEAN")),y&&Le.defines.push("SHOW_OCEAN_WAVES"),R&&Le.defines.push("APPLY_COLOR_TO_ALPHA"),w&&(Ze.defines.push("UNDERGROUND_COLOR"),Le.defines.push("UNDERGROUND_COLOR")),N&&(Ze.defines.push("TRANSLUCENT"),Le.defines.push("TRANSLUCENT")),f&&(L?(Ze.defines.push("ENABLE_VERTEX_LIGHTING"),Le.defines.push("ENABLE_VERTEX_LIGHTING")):(Ze.defines.push("ENABLE_DAYNIGHT_SHADING"),Le.defines.push("ENABLE_DAYNIGHT_SHADING"))),x&&(Ze.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),Le.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),_&&(Ze.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),Le.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),C&&(Ze.defines.push("GROUND_ATMOSPHERE"),Le.defines.push("GROUND_ATMOSPHERE"),V&&(Ze.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),Le.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),Ze.defines.push("INCLUDE_WEB_MERCATOR_Y"),Le.defines.push("INCLUDE_WEB_MERCATOR_Y"),G&&(Ze.defines.push("FOG"),Le.defines.push("FOG")),m&&Le.defines.push("APPLY_SPLIT"),I&&Le.defines.push("ENABLE_CLIPPING_PLANES"),M&&Le.defines.push("COLOR_CORRECT"),b&&Le.defines.push("HIGHLIGHT_FILL_TILE"),E&&Ze.defines.push("GEODETIC_SURFACE_NORMALS"),X&&Ze.defines.push("EXAGGERATION");let Ee=` vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend)
{
vec4 color = initialColor;
`;F&&(Ee+=` vec4 cutoutAndColorResult;
bool texelUnclipped;
`);for(let we=0;we<i;++we)F?Ee+=` cutoutAndColorResult = u_dayTextureCutoutRectangles[${we}];
texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y;
cutoutAndColorResult = sampleAndBlend(
`:Ee+=` color = sampleAndBlend(
`,Ee+=` color,
u_dayTextures[${we}],
u_dayTextureUseWebMercatorT[${we}] ? textureCoordinates.xz : textureCoordinates.xy,
u_dayTextureTexCoordsRectangle[${we}],
u_dayTextureTranslationAndScale[${we}],
${d?`u_dayTextureAlpha[${we}]`:"1.0"},
${u?`u_dayTextureNightAlpha[${we}]`:"1.0"},
${u?`u_dayTextureDayAlpha[${we}]`:"1.0"},
${o?`u_dayTextureBrightness[${we}]`:"0.0"},
${r?`u_dayTextureContrast[${we}]`:"0.0"},
${s?`u_dayTextureHue[${we}]`:"0.0"},
${a?`u_dayTextureSaturation[${we}]`:"0.0"},
${c?`u_dayTextureOneOverGamma[${we}]`:"0.0"},
//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C
${D.invertColor?`u_mars3dTextureInvertColor[${we}]`:"false"},
${D.filterColor?`u_mars3dTextureFilterColor[${we}]`:"vec3(1.0)"},
//\u3010\u706B\u661F\u79D1\u6280marsgis.cn\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C
${m?`u_dayTextureSplit[${we}]`:"0.0"},
${R?`u_colorsToAlpha[${we}]`:"vec4(0.0)"},
nightBlend );
`,F&&(Ee+=` color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color);
`);Ee+=` return color;
}`,Le.sources.push(Ee),Ze.sources.push(int(pe)),Ze.sources.push(ont(Z));let He=Qt.fromCache({context:t.context,vertexShaderSource:Ze,fragmentShaderSource:Le,attributeLocations:J.getAttributeLocations()});be=_e[ge]=new nnt(i,ge,this.material,He,ae)}return n.surfaceShader=be,be.shaderProgram};EQ.prototype.destroy=function(){let e,t,n=this._shadersByTexturesFlags;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];if(!l(o))continue;for(e in o)o.hasOwnProperty(e)&&(t=o[e],l(t)&&t.shaderProgram.destroy())}return ue(this)};var Jv=EQ;var fSi=T(S(),1);var Z0i=T(S(),1),rnt={NONE:-1,PARTIAL:0,FULL:1},mr=Object.freeze(rnt);var hbi=T(S(),1);var W0i=T(S(),1);function Ik(e,t,n,i,o,r,s){this.provider=e,this.message=t,this.x=n,this.y=i,this.level=o,this.timesRetried=g(r,0),this.retry=!1,this.error=s}Ik.reportError=function(e,t,n,i,o,r,s,a){let c=e;return l(e)?(c.provider=t,c.message=i,c.x=o,c.y=r,c.level=s,c.retry=!1,c.error=a,++c.timesRetried):c=new Ik(t,i,o,r,s,0,a),l(n)&&n.numberOfListeners>0?n.raiseEvent(c):l(t)&&console.log(`An error occurred in "${t.constructor.name}": ${wf(i)}`),c};Ik.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var Eo=Ik;var v0i=T(S(),1),snt={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7},ui=Object.freeze(snt);var F0i=T(S(),1),ant={START:0,LOADING:1,DONE:2,FAILED:3},Hs=Object.freeze(ant);var M0i=T(S(),1),cnt={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6},ho=Object.freeze(cnt);function nr(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new se(0,0,1,1),this.terrainData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new h,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=ho.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new ce,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}Object.defineProperties(nr.prototype,{eligibleForUnloading:{get:function(){let e=this.terrainState,n=!(e===ho.RECEIVING||e===ho.TRANSFORMING),i=this.imagery;for(let o=0,r=i.length;n&&o<r;++o){let s=i[o];n=!l(s.loadingImagery)||s.loadingImagery.state!==ui.TRANSITIONING}return n}},renderedMesh:{get:function(){if(l(this.vertexArray))return this.mesh;if(l(this.fill))return this.fill.mesh}}});var lnt=new he;function IQ(e,t,n,i,o,r){let s=e.getExaggeratedPosition(i,o,r);if(l(t)&&t!==ie.SCENE3D){let c=n.ellipsoid.cartesianToCartographic(s,lnt);s=n.project(c,r),s=h.fromElements(s.z,s.x,s.y,r)}return s}var dnt=new h,unt=new h,mnt=new h;nr.prototype.pick=function(e,t,n,i,o){let r=this.renderedMesh;if(!l(r))return;let s=r.vertices,a=r.indices,c=r.encoding,d=a.length,u=Number.MAX_VALUE;for(let m=0;m<d;m+=3){let p=a[m],y=a[m+1],f=a[m+2],x=IQ(c,t,n,s,p,dnt),_=IQ(c,t,n,s,y,unt),C=IQ(c,t,n,s,f,mnt),V=ni.rayTriangleParametric(e,x,_,C,i);l(V)&&V<u&&V>=0&&(u=V)}return u!==Number.MAX_VALUE?gn.getPoint(e,u,o):void 0};nr.prototype.freeResources=function(){l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,this.terrainState=ho.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();let e=this.imagery;for(let t=0,n=e.length;t<n;++t)e[t].freeResources();this.imagery.length=0,this.freeVertexArray()};nr.prototype.freeVertexArray=function(){nr._freeVertexArray(this.vertexArray),this.vertexArray=void 0,nr._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0};nr.initialize=function(e,t,n){let i=e.data;l(i)||(i=e.data=new nr),e.state===Hs.START&&(hnt(e,t,n),e.state=Hs.LOADING)};nr.processStateMachine=function(e,t,n,i,o,r,s){nr.initialize(e,n,i);let a=e.data;if(e.state===Hs.LOADING&&fnt(e,t,n,i,o,r),s)return;let c=e.renderable;e.renderable=l(a.vertexArray);let d=a.terrainState===ho.READY;e.upsampledFromParent=l(a.terrainData)&&a.terrainData.wasCreatedByUpsampling();let u=a.processImagery(e,n,t);if(d&&u){let m=e._loadedCallbacks,p={};for(let y in m)m.hasOwnProperty(y)&&(m[y](e)||(p[y]=m[y]));e._loadedCallbacks=p,e.state=Hs.DONE}c&&(e.renderable=!0)};nr.prototype.processImagery=function(e,t,n,i){let o=e.data,r=e.upsampledFromParent,s=!1,a=!0,c=o.imagery,d,u;for(d=0,u=c.length;d<u;++d){let m=c[d];if(!l(m.loadingImagery)){r=!1;continue}if(m.loadingImagery.state===ui.PLACEHOLDER){let y=m.loadingImagery.imageryLayer;if(y.ready){m.freeResources(),c.splice(d,1),y._createTileImagerySkeletons(e,t,d),--d,u=c.length;continue}else r=!1}let p=m.processStateMachine(e,n,i);a=a&&p,s=s||p||l(m.readyImagery),r=r&&l(m.loadingImagery)&&(m.loadingImagery.state===ui.FAILED||m.loadingImagery.state===ui.INVALID)}return e.upsampledFromParent=r,e.renderable=e.renderable&&(s||a),a};function b0e(e,t,n,i){let o=e.renderedMesh,r=o.vertices,s=o.encoding,a=r.length/s.stride,c=yc.clone(s);c.hasGeodeticSurfaceNormals=t,c=yc.clone(c);let d=c.stride,u=new Float32Array(a*d);t?s.addGeodeticSurfaceNormals(r,u,n):s.removeGeodeticSurfaceNormals(r,u),o.vertices=u,o.stride=d,o!==e.mesh?(nr._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=nr._createVertexArrayForMesh(i.context,o)):(nr._freeVertexArray(e.vertexArray),e.vertexArray=nr._createVertexArrayForMesh(i.context,o)),nr._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}nr.prototype.addGeodeticSurfaceNormals=function(e,t){b0e(this,!0,e,t)};nr.prototype.removeGeodeticSurfaceNormals=function(e){b0e(this,!1,void 0,e)};nr.prototype.updateExaggeration=function(e,t,n){let i=this,o=i.renderedMesh;if(o===void 0)return;let r=t.verticalExaggeration,s=t.verticalExaggerationRelativeHeight,a=r!==1,c=o.encoding,d=c.exaggeration!==r,u=c.exaggerationRelativeHeight!==s;if(d||u){if(d)if(a&&!c.hasGeodeticSurfaceNormals){let m=e.tilingScheme.ellipsoid;i.addGeodeticSurfaceNormals(m,t)}else!a&&c.hasGeodeticSurfaceNormals&&i.removeGeodeticSurfaceNormals(t);if(c.exaggeration=r,c.exaggerationRelativeHeight=s,n!==void 0){n._tileToUpdateHeights.push(e);let m=e.customData,p=m.length;for(let y=0;y<p;y++){let f=m[y];f.level=-1}}}};function hnt(e,t,n){let i=t.getTileDataAvailable(e.x,e.y,e.level);if(!l(i)&&l(e.parent)){let o=e.parent,r=o.data;l(r)&&l(r.terrainData)&&(i=r.terrainData.isChildAvailable(o.x,o.y,e.x,e.y))}i===!1&&(e.data.terrainState=ho.FAILED);for(let o=0,r=n.length;o<r;++o){let s=n.get(o);s.show&&s._createTileImagerySkeletons(e,t)}}function fnt(e,t,n,i,o,r){let s=e.data,a=e.parent;if(s.terrainState===ho.FAILED&&a!==void 0&&(a.data!==void 0&&a.data.terrainData!==void 0&&a.data.terrainData.canUpsample!==!1||nr.processStateMachine(a,t,n,i,o,r,!0)),s.terrainState===ho.FAILED&&pnt(s,e,t,n,e.x,e.y,e.level),s.terrainState===ho.UNLOADED&&bnt(s,n,e.x,e.y,e.level),s.terrainState===ho.RECEIVED&&gnt(s,t,n,e.x,e.y,e.level),s.terrainState===ho.TRANSFORMED&&(xnt(s,t.context,n,e.x,e.y,e.level,r),s.updateExaggeration(e,t,o)),s.terrainState>=ho.RECEIVED&&s.waterMaskTexture===void 0&&n.hasWaterMask)if(s.terrainData.waterMask!==void 0)Tnt(t.context,s);else{let d=s._findAncestorTileWithTerrainData(e);l(d)&&l(d.data.waterMaskTexture)&&(s.waterMaskTexture=d.data.waterMaskTexture,++s.waterMaskTexture.referenceCount,s._computeWaterMaskTranslationAndScale(e,d,s.waterMaskTranslationAndScale))}}function pnt(e,t,n,i,o,r,s){let a=t.parent;if(!a){t.state=Hs.FAILED;return}let c=a.data.terrainData,d=a.x,u=a.y,m=a.level;if(!l(c))return;let p=c.upsample(i.tilingScheme,d,u,m,o,r,s);l(p)&&(e.terrainState=ho.RECEIVING,Promise.resolve(p).then(function(y){l(y)&&(e.terrainData=y,e.terrainState=ho.RECEIVED)}).catch(function(){e.terrainState=ho.FAILED}))}function bnt(e,t,n,i,o){function r(c){if(!l(c)){e.terrainState=ho.UNLOADED,e.request=void 0;return}e.terrainData=c,e.terrainState=ho.RECEIVED,e.request=void 0}function s(c){if(e.request.state===ti.CANCELLED){e.terrainData=void 0,e.terrainState=ho.UNLOADED,e.request=void 0;return}e.terrainState=ho.FAILED,e.request=void 0;let d=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${o}. Error message: "${c}"`;t._requestError=Eo.reportError(t._requestError,t,t.errorEvent,d,n,i,o),t._requestError.retry&&a()}function a(){let c=new Yo({throttle:!1,throttleByServer:!0,type:os.TERRAIN});e.request=c;let d=t.requestTileGeometry(n,i,o,c);l(d)?(e.terrainState=ho.RECEIVING,Promise.resolve(d).then(function(u){r(u)}).catch(function(u){s(u)})):(e.terrainState=ho.UNLOADED,e.request=void 0)}a()}var ynt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function gnt(e,t,n,i,o,r){let s=n.tilingScheme,a=ynt;a.tilingScheme=s,a.x=i,a.y=o,a.level=r,a.exaggeration=t.verticalExaggeration,a.exaggerationRelativeHeight=t.verticalExaggerationRelativeHeight,a.throttle=!0;let d=e.terrainData.createMesh(a);l(d)&&(e.terrainState=ho.TRANSFORMING,Promise.resolve(d).then(function(u){e.mesh=u,e.terrainState=ho.TRANSFORMED}).catch(function(){e.terrainState=ho.FAILED}))}nr._createVertexArrayForMesh=function(e,t){let n=t.vertices,i=ft.createVertexBuffer({context:e,typedArray:n,usage:Ue.STATIC_DRAW}),o=t.encoding.getAttributes(i),r=t.indices.indexBuffers||{},s=r[e.id];if(!l(s)||s.isDestroyed()){let a=t.indices;s=ft.createIndexBuffer({context:e,typedArray:a,usage:Ue.STATIC_DRAW,indexDatatype:Ne.fromSizeInBytes(a.BYTES_PER_ELEMENT)}),s.vertexArrayDestroyable=!1,s.referenceCount=1,r[e.id]=s,t.indices.indexBuffers=r}else++s.referenceCount;return new oi({context:e,attributes:o,indexBuffer:s})};nr._freeVertexArray=function(e){if(l(e)){let t=e.indexBuffer;e.isDestroyed()||e.destroy(),l(t)&&!t.isDestroyed()&&l(t.referenceCount)&&(--t.referenceCount,t.referenceCount===0&&t.destroy())}};function xnt(e,t,n,i,o,r,s){e.vertexArray=nr._createVertexArrayForMesh(t,e.mesh),e.terrainState=ho.READY,e.fill=e.fill&&e.fill.destroy(s)}function _nt(e){let t=e.cache.tile_waterMaskData;if(!l(t)){let n=wt.create({context:e,pixelFormat:at.LUMINANCE,pixelDatatype:je.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new hn({wrapS:In.CLAMP_TO_EDGE,wrapT:In.CLAMP_TO_EDGE,minificationFilter:dn.LINEAR,magnificationFilter:Ti.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function Tnt(e,t){let n=t.terrainData.waterMask,i=_nt(e),o,r=n.length;if(r===1)if(n[0]!==0)o=i.allWaterTexture;else return;else{let s=Math.sqrt(r);o=wt.create({context:e,pixelFormat:at.LUMINANCE,pixelDatatype:je.UNSIGNED_BYTE,source:{width:s,height:s,arrayBufferView:n},sampler:i.sampler,flipY:!1}),o.referenceCount=0}++o.referenceCount,t.waterMaskTexture=o,se.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}nr.prototype._findAncestorTileWithTerrainData=function(e){let t=e.parent;for(;l(t)&&(!l(t.data)||!l(t.data.terrainData)||t.data.terrainData.wasCreatedByUpsampling());)t=t.parent;return t};nr.prototype._computeWaterMaskTranslationAndScale=function(e,t,n){let i=t.rectangle,o=e.rectangle,r=o.width,s=o.height,a=r/i.width,c=s/i.height;return n.x=a*(o.west-i.west)/r,n.y=c*(o.south-i.south)/s,n.z=a,n.w=c,n};var ju=nr;var D_i=T(S(),1);var Kxi=T(S(),1);var Uxi=T(S(),1);var uyi=T(S(),1);var Tbi=T(S(),1);function ig(e){if(e=g(e,g.EMPTY_OBJECT),this._ellipsoid=g(e.ellipsoid,oe.WGS84),this._numberOfLevelZeroTilesX=g(e.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=g(e.numberOfLevelZeroTilesY,1),this._projection=new Gi(this._ellipsoid),l(e.rectangleSouthwestInMeters)&&l(e.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=e.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=e.rectangleNortheastInMeters;else{let i=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new B(-i,-i),this._rectangleNortheastInMeters=new B(i,i)}let t=this._projection.unproject(this._rectangleSouthwestInMeters),n=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new de(t.longitude,t.latitude,n.longitude,n.latitude)}Object.defineProperties(ig.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});ig.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};ig.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};ig.prototype.rectangleToNativeRectangle=function(e,t){let n=this._projection,i=n.project(de.southwest(e)),o=n.project(de.northeast(e));return l(t)?(t.west=i.x,t.south=i.y,t.east=o.x,t.north=o.y,t):new de(i.x,i.y,o.x,o.y)};ig.prototype.tileXYToNativeRectangle=function(e,t,n,i){let o=this.getNumberOfXTilesAtLevel(n),r=this.getNumberOfYTilesAtLevel(n),s=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,a=this._rectangleSouthwestInMeters.x+e*s,c=this._rectangleSouthwestInMeters.x+(e+1)*s,d=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,u=this._rectangleNortheastInMeters.y-t*d,m=this._rectangleNortheastInMeters.y-(t+1)*d;return l(i)?(i.west=a,i.south=m,i.east=c,i.north=u,i):new de(a,m,c,u)};ig.prototype.tileXYToRectangle=function(e,t,n,i){let o=this.tileXYToNativeRectangle(e,t,n,i),r=this._projection,s=r.unproject(new B(o.west,o.south)),a=r.unproject(new B(o.east,o.north));return o.west=s.longitude,o.south=s.latitude,o.east=a.longitude,o.north=a.latitude,o};ig.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!de.contains(i,e))return;let o=this.getNumberOfXTilesAtLevel(t),r=this.getNumberOfYTilesAtLevel(t),a=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,d=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,m=this._projection.project(e),p=m.x-this._rectangleSouthwestInMeters.x,y=this._rectangleNortheastInMeters.y-m.y,f=p/a|0;f>=o&&(f=o-1);let x=y/d|0;return x>=r&&(x=r-1),l(n)?(n.x=f,n.y=x,n):new B(f,x)};var Jr=ig;var Rbi=T(S(),1);var XQ,y0e="AAPK997c8ac9b63f486188c3bede0b85ba5b2SiLv1qk7ZCEiBYZ_1i90XplcyGpzezMhO7wTadCKmemjXjb1Mtj112fAt6gbfL-",bV={};bV.defaultAccessToken=y0e;bV.defaultWorldImageryServer=new Xe({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});bV.defaultWorldHillshadeServer=new Xe({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});bV.defaultWorldOceanServer=new Xe({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});bV.getDefaultTokenCredit=function(e){if(e===y0e){if(!l(XQ)){let t='<b> This application is using a default ArcGIS access token. Please assign <i>Cesium.ArcGisMapService.defaultAccessToken</i> with an API key from your ArcGIS Developer account before using the ArcGIS tile services. You can sign up for a free ArcGIS Developer account at <a href="https://developers.arcgis.com/">https://developers.arcgis.com/</a>.</b>';XQ=new Vt(t,!0)}return XQ}};var Fd=bV;var Wbi=T(S(),1);function WQ(e){e=g(e,g.EMPTY_OBJECT),this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=Xe.createIfNeeded(e.missingImageUrl),n=this;function i(r){l(r.blob)&&(n._missingImageByteLength=r.blob.size);let s=pm(r);if(e.disableCheckIfAllPixelsAreTransparent){let a=!0,c=r.width,d=e.pixelsToCheck;for(let u=0,m=d.length;a&&u<m;++u){let p=d[u],y=p.x*4+p.y*c;s[y+3]>0&&(a=!1)}a&&(s=void 0)}n._missingImagePixels=s,n._isReady=!0}function o(){n._missingImagePixels=void 0,n._isReady=!0}t.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then(i).catch(o)}WQ.prototype.isReady=function(){return this._isReady};WQ.prototype.shouldDiscardImage=function(e){let t=this._pixelsToCheck,n=this._missingImagePixels;if(!l(n)||l(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;let i=pm(e),o=e.width;for(let r=0,s=t.length;r<s;++r){let a=t[r],c=a.x*4+a.y*o;for(let d=0;d<4;++d){let u=c+d;if(i[u]!==n[u])return!1}}return!0};var Qv=WQ;var wbi=T(S(),1);function PQ(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}PQ.prototype.configureNameFromProperties=function(e){let t=10,n;for(let i in e)if(e.hasOwnProperty(i)&&e[i]){let o=i.toLowerCase();t>1&&o==="name"?(t=1,n=i):t>2&&o==="title"?(t=2,n=i):t>3&&/name/i.test(i)?(t=3,n=i):t>4&&/title/i.test(i)&&(t=4,n=i)}l(n)&&(this.name=e[n])};PQ.prototype.configureDescriptionFromProperties=function(e){function t(n){let i='<table class="cesium-infoBox-defaultTable">';for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];l(r)&&(typeof r=="object"?i+=`<tr><td>${o}</td><td>${t(r)}</td></tr>`:i+=`<tr><td>${o}</td><td>${r}</td></tr>`)}return i+="</table>",i}this.description=t(e)};var _h=PQ;var kbi=T(S(),1);function yV(){fe.throwInstantiationError()}Object.defineProperties(yV.prototype,{rectangle:{get:fe.throwInstantiationError},tileWidth:{get:fe.throwInstantiationError},tileHeight:{get:fe.throwInstantiationError},maximumLevel:{get:fe.throwInstantiationError},minimumLevel:{get:fe.throwInstantiationError},tilingScheme:{get:fe.throwInstantiationError},tileDiscardPolicy:{get:fe.throwInstantiationError},errorEvent:{get:fe.throwInstantiationError},credit:{get:fe.throwInstantiationError},proxy:{get:fe.throwInstantiationError},hasAlphaChannel:{get:fe.throwInstantiationError}});yV.prototype.getTileCredits=function(e,t,n){fe.throwInstantiationError()};yV.prototype.requestImage=function(e,t,n,i){fe.throwInstantiationError()};yV.prototype.pickFeatures=function(e,t,n,i,o){fe.throwInstantiationError()};var Snt=/\.ktx2$/i;yV.loadImage=function(e,t){let n=Xe.createIfNeeded(t);return Snt.test(n.url)?bl(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var el=yV;var Bbi=T(S(),1),Cnt={SATELLITE:1,OCEANS:2,HILLSHADE:3},Th=Object.freeze(Cnt);function g0e(e){this.useTiles=g(e.usePreCachedTilesIfAvailable,!0);let t=e.ellipsoid;this.tilingScheme=g(e.tilingScheme,new Oi({ellipsoid:t})),this.rectangle=g(e.rectangle,this.tilingScheme.rectangle),this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new Vt(n)),this.credit=n,this.tileCredits=void 0,this.tileDiscardPolicy=e.tileDiscardPolicy,this.tileWidth=g(e.tileWidth,256),this.tileHeight=g(e.tileHeight,256),this.maximumLevel=e.maximumLevel}g0e.prototype.build=function(e){e._useTiles=this.useTiles,e._tilingScheme=this.tilingScheme,e._rectangle=this.rectangle,e._credit=this.credit,e._tileCredits=this.tileCredits,e._tileDiscardPolicy=this.tileDiscardPolicy,e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,this.useTiles&&!l(this.tileDiscardPolicy)&&(e._tileDiscardPolicy=new Qv({missingImageUrl:x0e(e,0,0,this.maximumLevel).url,pixelsToCheck:[new B(0,0),new B(200,20),new B(20,200),new B(80,110),new B(160,130)],disableCheckIfAllPixelsAreTransparent:!0}))};function Vnt(e,t){let n=e.tileInfo;if(!l(n))t.useTiles=!1;else{if(t.tileWidth=n.rows,t.tileHeight=n.cols,n.spatialReference.wkid===102100||n.spatialReference.wkid===102113)t.tilingScheme=new Jr({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new Oi({ellipsoid:t.ellipsoid});else{let i=`Tile spatial reference WKID ${e.tileInfo.spatialReference.wkid} is not supported.`;throw new me(i)}if(t.maximumLevel=e.tileInfo.lods.length-1,l(e.fullExtent)){if(l(e.fullExtent.spatialReference)&&l(e.fullExtent.spatialReference.wkid))if(e.fullExtent.spatialReference.wkid===102100||e.fullExtent.spatialReference.wkid===102113){let i=new Gi,o=e.fullExtent,r=i.unproject(new h(Math.max(o.xmin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(o.ymin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),s=i.unproject(new h(Math.min(o.xmax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(o.ymax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0));t.rectangle=new de(r.longitude,r.latitude,s.longitude,s.latitude)}else if(e.fullExtent.spatialReference.wkid===4326)t.rectangle=de.fromDegrees(e.fullExtent.xmin,e.fullExtent.ymin,e.fullExtent.xmax,e.fullExtent.ymax);else{let i=`fullExtent.spatialReference WKID ${e.fullExtent.spatialReference.wkid} is not supported.`;throw new me(i)}}else t.rectangle=t.tilingScheme.rectangle;t.useTiles=!0}l(e.copyrightText)&&e.copyrightText.length>0&&(l(t.credit)?t.tileCredits=[new Vt(e.copyrightText)]:t.credit=new Vt(e.copyrightText))}function Lnt(e,t){let n=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(n+=`: ${t.message}`),new me(n)}async function Rnt(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();Vnt(i,t)}catch(i){Lnt(e,i)}}function Af(e){e=g(e,g.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=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._tileDiscardPolicy=e.tileDiscardPolicy,this._tileWidth=g(e.tileWidth,256),this._tileHeight=g(e.tileHeight,256),this._maximumLevel=e.maximumLevel,this._tilingScheme=g(e.tilingScheme,new Oi({ellipsoid:e.ellipsoid})),this._useTiles=g(e.usePreCachedTilesIfAvailable,!0),this._rectangle=g(e.rectangle,this._tilingScheme.rectangle),this._layers=e.layers,this._credit=e.credit,this._tileCredits=void 0;let t=e.credit;typeof t=="string"&&(t=new Vt(t)),this.enablePickFeatures=g(e.enablePickFeatures,!0),this._errorEvent=new ye}Af.fromBasemapType=async function(e,t){t=g(t,g.EMPTY_OBJECT);let n,i,o;switch(e){case Th.SATELLITE:{n=g(t.token,Fd.defaultAccessToken),i=Xe.createIfNeeded(Fd.defaultWorldImageryServer),i.appendForwardSlash();let r=Fd.getDefaultTokenCredit(n);l(r)&&(o=Vt.clone(r))}break;case Th.OCEANS:{n=g(t.token,Fd.defaultAccessToken),i=Xe.createIfNeeded(Fd.defaultWorldOceanServer),i.appendForwardSlash();let r=Fd.getDefaultTokenCredit(n);l(r)&&(o=Vt.clone(r))}break;case Th.HILLSHADE:{n=g(t.token,Fd.defaultAccessToken),i=Xe.createIfNeeded(Fd.defaultWorldHillshadeServer),i.appendForwardSlash();let r=Fd.getDefaultTokenCredit(n);l(r)&&(o=Vt.clone(r))}break;default:}return Af.fromUrl(i,{...t,token:n,credit:o,usePreCachedTilesIfAvailable:!0})};function x0e(e,t,n,i,o){let r;if(e._useTiles)r=e._resource.getDerivedResource({url:`tile/${i}/${n}/${t}`,request:o});else{let s=e._tilingScheme.tileXYToNativeRectangle(t,n,i),c={bbox:`${s.west},${s.south},${s.east},${s.north}`,size:`${e._tileWidth},${e._tileHeight}`,format:"png32",transparent:!0,f:"image"};e._tilingScheme.projection instanceof Ri?(c.bboxSR=4326,c.imageSR=4326):(c.bboxSR=3857,c.imageSR=3857),e.layers&&(c.layers=`show:${e.layers}`),r=e._resource.getDerivedResource({url:"export",request:o,queryParameters:c})}return r}Object.defineProperties(Af.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}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}});Af.fromUrl=async function(e,t){t=g(t,g.EMPTY_OBJECT);let n=Xe.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&n.setQueryParameters({token:t.token});let i=new Af(t);i._resource=n;let o=new g0e(t);return g(t.usePreCachedTilesIfAvailable,!0)&&await Rnt(n,o),o.build(i),i};Af.prototype.getTileCredits=function(e,t,n){return this._tileCredits};Af.prototype.requestImage=function(e,t,n,i){return el.loadImage(this,x0e(this,e,t,n,i))};Af.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures)return;let r=this._tilingScheme.tileXYToNativeRectangle(e,t,n),s,a,c;if(this._tilingScheme.projection instanceof Ri)s=W.toDegrees(i),a=W.toDegrees(o),c="4326";else{let p=this._tilingScheme.projection.project(new he(i,o,0));s=p.x,a=p.y,c="3857"}let d="visible";l(this._layers)&&(d+=`:${this._layers}`);let u={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${s},${a}`,mapExtent:`${r.west},${r.south},${r.east},${r.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:c,layers:d};return this._resource.getDerivedResource({url:"identify",queryParameters:u}).fetchJson().then(function(p){let y=[],f=p.results;if(!l(f))return y;for(let x=0;x<f.length;++x){let _=f[x],C=new _h;if(C.data=_,C.name=_.value,C.properties=_.attributes,C.configureDescriptionFromProperties(_.attributes),_.geometryType==="esriGeometryPoint"&&_.geometry){let V=_.geometry.spatialReference&&_.geometry.spatialReference.wkid?_.geometry.spatialReference.wkid:4326;if(V===4326||V===4283)C.position=he.fromDegrees(_.geometry.x,_.geometry.y,_.geometry.z);else if(V===102100||V===900913||V===3857){let L=new Gi;C.position=L.unproject(new h(_.geometry.x,_.geometry.y,_.geometry.z))}}y.push(C)}return y})};Af._metadataCache={};var H0=Af;var Wyi=T(S(),1);var hyi=T(S(),1),Znt={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"},gV=Object.freeze(Znt);var byi=T(S(),1);function jv(e){}jv.prototype.isReady=function(){return!0};jv.prototype.shouldDiscardImage=function(e){return jv.EMPTY_IMAGE===e};var Xk;Object.defineProperties(jv,{EMPTY_IMAGE:{get:function(){return l(Xk)||(Xk=new Image,Xk.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),Xk}}});var xV=jv;function _0e(e){this.tileWidth=void 0,this.tileHeight=void 0,this.maximumLevel=void 0,this.imageUrlSubdomains=void 0,this.imageUrlTemplate=void 0,this.attributionList=void 0}_0e.prototype.build=function(e){e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,e._imageUrlSubdomains=this.imageUrlSubdomains,e._imageUrlTemplate=this.imageUrlTemplate;let t=e._attributionList=this.attributionList;t||(t=[]),e._attributionList=t;for(let n=0,i=t.length;n<i;++n){let o=t[n];if(o.credit instanceof Vt)break;o.credit=new Vt(o.attribution);let r=o.coverageAreas;for(let s=0,a=o.coverageAreas.length;s<a;++s){let c=r[s],d=c.bbox;c.bbox=new de(W.toRadians(d[1]),W.toRadians(d[0]),W.toRadians(d[3]),W.toRadians(d[2]))}}};function Gnt(e,t){if(e.resourceSets.length!==1)throw new me("metadata does not specify one resource in resourceSets");let n=e.resourceSets[0].resources[0];t.tileWidth=n.imageWidth,t.tileHeight=n.imageHeight,t.maximumLevel=n.zoomMax-1,t.imageUrlSubdomains=n.imageUrlSubdomains,t.imageUrlTemplate=n.imageUrl,t.attributionList=n.imageryProviders}function Ent(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),Eo.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new me(i)}async function Int(e,t,n){let i=e.url,o=Rs._metadataCache[i];l(o)||(o=e.fetchJsonp("jsonp"),Rs._metadataCache[i]=o);try{let r=await o;return Gnt(r,t)}catch(r){Ent(e,r,n)}}function Rs(e){e=g(e,g.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._mapStyle=g(e.mapStyle,gV.AERIAL),this._mapLayer=e.mapLayer,this._culture=g(e.culture,""),this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new xV),this._proxy=e.proxy,this._credit=new Vt(`<a href="https://www.microsoft.com/en-us/maps/product/enduserterms"><img src="${Rs.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new Jr({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:e.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._attributionList=void 0,this._errorEvent=new ye}Object.defineProperties(Rs.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}},mapLayer:{get:function(){return this._mapLayer}},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}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return l(this.mapLayer)}}});Rs.fromUrl=async function(e,t){t=g(t,g.EMPTY_OBJECT);let n=t.tileProtocol;l(n)?n.length>0&&n[n.length-1]===":"&&(n=n.substr(0,n.length-1)):n=document.location.protocol==="http:"?"http":"https";let i=g(t.mapStyle,gV.AERIAL),o=Xe.createIfNeeded(e);o.appendForwardSlash();let r={incl:"ImageryProviders",key:t.key,uriScheme:n};l(t.mapLayer)&&(r.mapLayer=t.mapLayer);let s=o.getDerivedResource({url:`REST/v1/Imagery/Metadata/${i}`,queryParameters:r}),a=new Rs(t);a._resource=o;let c=new _0e(t);return await Int(s,c),c.build(a),a};var Xnt=new de;Rs.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,Xnt);return vnt(this._attributionList,n,i)};Rs.prototype.requestImage=function(e,t,n,i){let o=el.loadImage(this,Wnt(this,e,t,n,i));if(l(o))return o.catch(function(r){return l(r.blob)&&r.blob.size===0?xV.EMPTY_IMAGE:Promise.reject(r)})};Rs.prototype.pickFeatures=function(e,t,n,i,o){};Rs.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;e&r&&(s|=1),t&r&&(s|=2),i+=s}return i};Rs.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let o=i;o>=0;--o){let r=1<<o,s=+e[i-o];s&1&&(t|=r),s&2&&(n|=r)}return{x:t,y:n,level:i}};Rs._logoUrl=void 0;Object.defineProperties(Rs,{logoUrl:{get:function(){return l(Rs._logoUrl)||(Rs._logoUrl=on("Assets/Images/bing_maps_credit.png")),Rs._logoUrl},set:function(e){Rs._logoUrl=e}}});function Wnt(e,t,n,i,o){let r=e._imageUrlTemplate,s=e._imageUrlSubdomains,a=(t+n+i)%s.length;return e._resource.getDerivedResource({url:r,request:o,templateValues:{quadkey:Rs.tileXYToQuadKey(t,n,i),subdomain:s[a],culture:e._culture},queryParameters:{n:"z"}})}var Pnt=new de;function vnt(e,t,n){++t;let i=[];for(let o=0,r=e.length;o<r;++o){let s=e[o],a=s.coverageAreas,c=!1;for(let d=0,u=s.coverageAreas.length;!c&&d<u;++d){let m=a[d];if(t>=m.zoomMin&&t<=m.zoomMax){let p=de.intersection(n,m.bbox,Pnt);l(p)&&(c=!0)}}c&&i.push(s.credit)}return i}Rs._metadataCache={};var qv=Rs;var lgi=T(S(),1);var zyi=T(S(),1);var T0e=/{[^}]+}/g,S0e={x:Mnt,y:Unt,z:Bnt,s:Ont,reverseX:Nnt,reverseY:knt,reverseZ:Dnt,westDegrees:Ynt,southDegrees:Hnt,eastDegrees:Knt,northDegrees:znt,westProjected:Jnt,southProjected:Qnt,eastProjected:jnt,northProjected:qnt,width:$nt,height:eit},wnt=Tt(S0e,{i:tit,j:nit,reverseI:iit,reverseJ:oit,longitudeDegrees:sit,latitudeDegrees:ait,longitudeProjected:cit,latitudeProjected:lit,format:uit});function $v(e){e=g(e,g.EMPTY_OBJECT),this._errorEvent=new ye;let t=Xe.createIfNeeded(e.url),n=Xe.createIfNeeded(e.pickFeaturesUrl);this._resource=t,this._urlSchemeZeroPadding=e.urlSchemeZeroPadding,this._getFeatureInfoFormats=e.getFeatureInfoFormats,this._pickFeaturesResource=n;let i=e.subdomains;Array.isArray(i)?i=i.slice():l(i)&&i.length>0?i=i.split(""):i=["a","b","c"],this._subdomains=i,this._tileWidth=g(e.tileWidth,256),this._tileHeight=g(e.tileHeight,256),this._minimumLevel=g(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._tilingScheme=g(e.tilingScheme,new Jr({ellipsoid:e.ellipsoid})),this._rectangle=g(e.rectangle,this._tilingScheme.rectangle),this._rectangle=de.intersection(this._rectangle,this._tilingScheme.rectangle),this._tileDiscardPolicy=e.tileDiscardPolicy;let o=e.credit;typeof o=="string"&&(o=new Vt(o)),this._credit=o,this._hasAlphaChannel=g(e.hasAlphaChannel,!0);let r=e.customTags,s=Tt(S0e,r),a=Tt(wnt,r);this._tags=s,this._pickFeaturesTags=a,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=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.enablePickFeatures=g(e.enablePickFeatures,!0)}Object.defineProperties($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}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}}});$v.prototype.getTileCredits=function(e,t,n){};$v.prototype.requestImage=function(e,t,n,i){return el.loadImage(this,Fnt(this,e,t,n,i))};$v.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures||!l(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let r=0,s=this;function a(d,u){return d.callback(u)}function c(){if(r>=s._getFeatureInfoFormats.length)return Promise.resolve([]);let d=s._getFeatureInfoFormats[r],u=Ant(s,e,t,n,i,o,d.format);return++r,d.type==="json"?u.fetchJson().then(d.callback).catch(c):d.type==="xml"?u.fetchXML().then(d.callback).catch(c):d.type==="text"||d.type==="html"?u.fetchText().then(d.callback).catch(c):u.fetch({responseType:d.format}).then(a.bind(void 0,d)).catch(c)}return c()};var Wk=!1,Ad=new de,Pk=!1,ew=new de;function Fnt(e,t,n,i,o){Wk=!1,Pk=!1;let r=e._resource,s=r.getUrlComponent(!0),a=e._tags,c={},d=s.match(T0e);return l(d)&&d.forEach(function(u){let m=u.substring(1,u.length-1);l(a[m])&&(c[m]=a[m](e,t,n,i))}),r.getDerivedResource({request:o,templateValues:c})}var vQ=!1,TV=new B,wQ=!1;function Ant(e,t,n,i,o,r,s){Wk=!1,Pk=!1,vQ=!1,wQ=!1;let a=e._pickFeaturesResource,c=a.getUrlComponent(!0),d=e._pickFeaturesTags,u={},m=c.match(T0e);return l(m)&&m.forEach(function(p){let y=p.substring(1,p.length-1);l(d[y])&&(u[y]=d[y](e,t,n,i,o,r,s))}),a.getDerivedResource({templateValues:u})}function SV(e,t,n){if(e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)){let i=e.urlSchemeZeroPadding[t];if(typeof i=="string"){let o=i.length;o>1&&(n=n.length>=o?n:new Array(o-n.toString().length+1).join("0")+n)}}return n}function Mnt(e,t,n,i){return SV(e,"{x}",t)}function Nnt(e,t,n,i){let o=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return SV(e,"{reverseX}",o)}function Unt(e,t,n,i){return SV(e,"{y}",n)}function knt(e,t,n,i){let o=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return SV(e,"{reverseY}",o)}function Dnt(e,t,n,i){let o=e.maximumLevel,r=l(o)&&i<o?o-i-1:i;return SV(e,"{reverseZ}",r)}function Bnt(e,t,n,i){return SV(e,"{z}",i)}function Ont(e,t,n,i){let o=(t+n+i)%e._subdomains.length;return e._subdomains[o]}function vk(e,t,n,i){Wk||(e.tilingScheme.tileXYToRectangle(t,n,i,Ad),Ad.west=W.toDegrees(Ad.west),Ad.south=W.toDegrees(Ad.south),Ad.east=W.toDegrees(Ad.east),Ad.north=W.toDegrees(Ad.north),Wk=!0)}function Ynt(e,t,n,i){return vk(e,t,n,i),Ad.west}function Hnt(e,t,n,i){return vk(e,t,n,i),Ad.south}function Knt(e,t,n,i){return vk(e,t,n,i),Ad.east}function znt(e,t,n,i){return vk(e,t,n,i),Ad.north}function wk(e,t,n,i){Pk||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,ew),Pk=!0)}function Jnt(e,t,n,i){return wk(e,t,n,i),ew.west}function Qnt(e,t,n,i){return wk(e,t,n,i),ew.south}function jnt(e,t,n,i){return wk(e,t,n,i),ew.east}function qnt(e,t,n,i){return wk(e,t,n,i),ew.north}function $nt(e,t,n,i){return e.tileWidth}function eit(e,t,n,i){return e.tileHeight}function tit(e,t,n,i,o,r,s){return Fk(e,t,n,i,o,r),TV.x}function nit(e,t,n,i,o,r,s){return Fk(e,t,n,i,o,r),TV.y}function iit(e,t,n,i,o,r,s){return Fk(e,t,n,i,o,r),e.tileWidth-TV.x-1}function oit(e,t,n,i,o,r,s){return Fk(e,t,n,i,o,r),e.tileHeight-TV.y-1}var rit=new de,_V=new h;function Fk(e,t,n,i,o,r,s){if(vQ)return;FQ(e,t,n,i,o,r);let a=_V,c=e.tilingScheme.tileXYToNativeRectangle(t,n,i,rit);TV.x=e.tileWidth*(a.x-c.west)/c.width|0,TV.y=e.tileHeight*(c.north-a.y)/c.height|0,vQ=!0}function sit(e,t,n,i,o,r,s){return W.toDegrees(o)}function ait(e,t,n,i,o,r,s){return W.toDegrees(r)}function cit(e,t,n,i,o,r,s){return FQ(e,t,n,i,o,r),_V.x}function lit(e,t,n,i,o,r,s){return FQ(e,t,n,i,o,r),_V.y}var dit=new he;function FQ(e,t,n,i,o,r,s){if(!wQ){if(e.tilingScheme.projection instanceof Ri)_V.x=W.toDegrees(o),_V.y=W.toDegrees(r);else{let a=dit;a.longitude=o,a.latitude=r,e.tilingScheme.projection.project(a,_V)}wQ=!0}}function uit(e,t,n,i,o,r,s){return s}var wa=$v;function qu(e){wa.call(this,e)}qu._requestMetadata=async function(e,t,n,i){try{let o=await n.fetchXML();return qu._metadataSuccess(o,e,t,n,i)}catch(o){if(o instanceof Nh)return qu._metadataFailure(e,t);throw o}};qu.fromUrl=async function(e,t){let n=Xe.createIfNeeded(e);n.appendForwardSlash();let i=n,o=n.getDerivedResource({url:"tilemapresource.xml"});t=g(t,g.EMPTY_OBJECT);let r=await qu._requestMetadata(t,i,o);return new qu(r)};l(Object.create)&&(qu.prototype=Object.create(wa.prototype),qu.prototype.constructor=qu);function C0e(e,t){return e.west<t.rectangle.west&&(e.west=t.rectangle.west),e.east>t.rectangle.east&&(e.east=t.rectangle.east),e.south<t.rectangle.south&&(e.south=t.rectangle.south),e.north>t.rectangle.north&&(e.north=t.rectangle.north),e}function V0e(e,t,n){let i=e.positionToTileXY(de.southwest(t),n),o=e.positionToTileXY(de.northeast(t),n);return(Math.abs(o.x-i.x)+1)*(Math.abs(o.y-i.y)+1)>4?0:n}qu._metadataSuccess=function(e,t,n,i,o){let r=/tileformat/i,s=/tileset/i,a=/tilesets/i,c=/boundingbox/i,d,u,m,p=[],y=e.childNodes[0].childNodes;for(let v=0;v<y.length;v++)if(r.test(y.item(v).nodeName))d=y.item(v);else if(a.test(y.item(v).nodeName)){m=y.item(v);let F=y.item(v).childNodes;for(let M=0;M<F.length;M++)s.test(F.item(M).nodeName)&&p.push(F.item(M))}else c.test(y.item(v).nodeName)&&(u=y.item(v));let f;if(!l(m)||!l(u))throw f=`Unable to find expected tilesets or bbox attributes in ${i.url}.`,l(o)&&Eo.reportError(void 0,o,o.errorEvent,f),new me(f);let x=g(t.fileExtension,d.getAttribute("extension")),_=g(t.tileWidth,parseInt(d.getAttribute("width"),10)),C=g(t.tileHeight,parseInt(d.getAttribute("height"),10)),V=g(t.minimumLevel,parseInt(p[0].getAttribute("order"),10)),L=g(t.maximumLevel,parseInt(p[p.length-1].getAttribute("order"),10)),Z=m.getAttribute("profile"),G=t.tilingScheme;if(!l(G))if(Z==="geodetic"||Z==="global-geodetic")G=new Oi({ellipsoid:t.ellipsoid});else if(Z==="mercator"||Z==="global-mercator")G=new Jr({ellipsoid:t.ellipsoid});else throw f=`${i.url} specifies an unsupported profile attribute, ${Z}.`,l(o)&&Eo.reportError(void 0,o,o.errorEvent,f),new me(f);let I=de.clone(t.rectangle);if(!l(I)){let v,F,M,b;g(t.flipXY,!1)?(M=new B(parseFloat(u.getAttribute("miny")),parseFloat(u.getAttribute("minx"))),b=new B(parseFloat(u.getAttribute("maxy")),parseFloat(u.getAttribute("maxx")))):(M=new B(parseFloat(u.getAttribute("minx")),parseFloat(u.getAttribute("miny"))),b=new B(parseFloat(u.getAttribute("maxx")),parseFloat(u.getAttribute("maxy"))));let E=Z==="geodetic"||Z==="mercator";if(G.projection instanceof Ri||E)v=he.fromDegrees(M.x,M.y),F=he.fromDegrees(b.x,b.y);else{let X=G.projection;v=X.unproject(M),F=X.unproject(b)}I=new de(v.longitude,v.latitude,F.longitude,F.latitude)}return I=C0e(I,G),V=V0e(G,I,V),{url:n.getDerivedResource({url:`{z}/{x}/{reverseY}.${x}`}),tilingScheme:G,rectangle:I,tileWidth:_,tileHeight:C,minimumLevel:V,maximumLevel:L,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit}};qu._metadataFailure=function(e,t){let n=g(e.fileExtension,"png"),i=g(e.tileWidth,256),o=g(e.tileHeight,256),r=e.maximumLevel,s=l(e.tilingScheme)?e.tilingScheme:new Jr({ellipsoid:e.ellipsoid}),a=g(e.rectangle,s.rectangle);a=C0e(a,s);let c=V0e(s,a,e.minimumLevel);return{url:t.getDerivedResource({url:`{z}/{x}/{reverseY}.${n}`}),tilingScheme:s,rectangle:a,tileWidth:i,tileHeight:o,minimumLevel:c,maximumLevel:r,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit}};var og=qu;var Cgi=T(S(),1);function L0e(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}L0e.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function mit(e,t){let n;try{n=JSON.parse(e)}catch{n=JSON.parse(e.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}let i;for(let o=0;o<n.layers.length;o++)if(n.layers[o].id===t.channel){i=n.layers[o];break}if(!l(i)){let o=`Could not find layer with channel (id) of ${t.channel}.`;throw new me(o)}if(!l(i.version)){let o=`Could not find a version in channel (id) ${t.channel}.`;throw new me(o)}if(t.version=i.version,l(n.projection)&&n.projection==="flat")t.tilingScheme=new Oi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new de(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:t.ellipsoid});else if(!l(n.projection)||n.projection==="mercator")t.tilingScheme=new Jr({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let o=`Unsupported projection ${n.projection}.`;throw new me(o)}return!0}function hit(e,t,n){let i=`An error occurred while accessing ${t.url}.`;throw l(e)&&l(e.message)&&(i+=`: ${e.message}`),Eo.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new me(i)}async function fit(e,t,n){try{let i=await e.fetchText();mit(i,t)}catch(i){hit(i,e,n)}}function Dl(e){e=g(e,{}),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1.9,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._channel=e.channel,this._requestType="ImageryMaps",this._credit=new Vt(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${Dl.logoUrl}" title="Google Imagery"/></a>`),this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=e.maximumLevel,this._errorEvent=new ye}Object.defineProperties(Dl.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}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});Dl.fromUrl=async function(e,t,n){n=g(n,{});let i=g(n.path,"/default_map"),o=Xe.createIfNeeded(e).getDerivedResource({url:i[0]==="/"?i.substring(1):i});o.appendForwardSlash();let r=o.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),s=new L0e(n);s.channel=t,await fit(r,s);let a=new Dl(n);return s.build(a),a._resource=o,a._url=e,a._path=i,a};Dl.prototype.getTileCredits=function(e,t,n){};Dl.prototype.requestImage=function(e,t,n,i){let o=this._resource.getDerivedResource({url:"query",request:i,queryParameters:{request:this._requestType,channel:this._channel,version:this._version,x:e,y:t,z:n+1}});return el.loadImage(this,o)};Dl.prototype.pickFeatures=function(e,t,n,i,o){};Dl._logoUrl=void 0;Object.defineProperties(Dl,{logoUrl:{get:function(){return l(Dl._logoUrl)||(Dl._logoUrl=on("Assets/Images/google_earth_credit.png")),Dl._logoUrl},set:function(e){Dl._logoUrl=e}}});var tw=Dl;var Igi=T(S(),1);var pit=/\/$/,R0e=new Vt('&copy; <a href="https://www.mapbox.com/about/maps/">Mapbox</a> &copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function CV(e){e=g(e,g.EMPTY_OBJECT);let t=e.mapId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=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;let i=Xe.createIfNeeded(g(e.url,"https://{s}.tiles.mapbox.com/v4/"));this._mapId=t,this._accessToken=n;let o=g(e.format,"png");/\./.test(o)||(o=`.${o}`),this._format=o;let r=i.getUrlComponent();pit.test(r)||(r+="/"),r+=`${t}/{z}/{x}/{y}${this._format}`,i.url=r,i.setQueryParameters({access_token:n});let s;l(e.credit)?(s=e.credit,typeof s=="string"&&(s=new Vt(s))):s=R0e,this._resource=i,this._imageryProvider=new wa({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(CV.prototype,{url:{get:function(){return this._imageryProvider.url}},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}}});CV.prototype.getTileCredits=function(e,t,n){};CV.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};CV.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};CV._defaultCredit=R0e;var nw=CV;var Dgi=T(S(),1);function mT(e){e=g(e,g.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=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;let t=g(e.rectangle,de.MAX_VALUE),n=new Oi({rectangle:t,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});this._tilingScheme=n,this._image=void 0,this._texture=void 0,this._hasError=!1,this._errorEvent=new ye;let i=e.credit;typeof i=="string"&&(i=new Vt(i)),this._credit=i;let o=Xe.createIfNeeded(e.url);this._resource=o,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight}Object.defineProperties(mT.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}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});function bit(e,t,n,i){let o=`Failed to load image ${e.url}`;l(t)&&l(t.message)&&(o+=`: ${t.message}`);let r=Eo.reportError(i,n,l(n)?n._errorEvent:void 0,o,0,0,0,t);if(r.retry)return AQ(e,n,r);throw l(n)&&(n._hasError=!0),new me(o)}async function AQ(e,t,n){try{return await el.loadImage(null,e)}catch(i){return bit(e,i,t,n)}}mT.fromUrl=async function(e,t){let n=Xe.createIfNeeded(e),i=await AQ(n);t=g(t,g.EMPTY_OBJECT);let o=new mT({...t,url:e,tileWidth:i.width,tileHeight:i.height});return o._image=i,o};mT.prototype.getTileCredits=function(e,t,n){};mT.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let o=await AQ(this._resource,this);return this._image=o,Eo.reportSuccess(this._errorEvent),o}return this._image};mT.prototype.pickFeatures=function(e,t,n,i,o){};var iw=mT;var mxi=T(S(),1);var zgi=T(S(),1);function yit(e,t,n){this.type=e,l(t)||(e==="json"?t="application/json":e==="xml"?t="text/xml":e==="html"?t="text/html":e==="text"&&(t="text/plain")),this.format=t,l(n)||(e==="json"?n=git:e==="xml"?n=Sit:(e==="html"||e==="text")&&(n=Z0e)),this.callback=n}function git(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let o=n[i],r=new _h;if(r.data=o,r.properties=o.properties,r.configureNameFromProperties(o.properties),r.configureDescriptionFromProperties(o.properties),l(o.geometry)&&o.geometry.type==="Point"){let s=o.geometry.coordinates[0],a=o.geometry.coordinates[1];r.position=he.fromDegrees(s,a)}t.push(r)}return t}var MQ="http://www.mapinfo.com/mxp",xit="http://www.esri.com/wms",_it="http://www.opengis.net/wfs",Tit="http://www.opengis.net/gml";function Sit(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===MQ)return Cit(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===xit)return Vit(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===_it)return Lit(e);if(t.localName==="ServiceExceptionReport")throw new me(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?Rit(e):Zit(e)}function Cit(e){let t=[],i=e.documentElement.getElementsByTagNameNS(MQ,"Feature");for(let o=0;o<i.length;++o){let r=i[o],s={},a=r.getElementsByTagNameNS(MQ,"Val");for(let d=0;d<a.length;++d){let u=a[d];if(u.hasAttribute("ref")){let m=u.getAttribute("ref"),p=u.textContent.trim();s[m]=p}}let c=new _h;c.data=r,c.properties=s,c.configureNameFromProperties(s),c.configureDescriptionFromProperties(s),t.push(c)}return t}function Vit(e){let t=e.documentElement,n=[],i,o=t.getElementsByTagNameNS("*","FIELDS");if(o.length>0)for(let r=0;r<o.length;++r){let s=o[r];i={};let a=s.attributes;for(let c=0;c<a.length;++c){let d=a[c];i[d.name]=d.value}n.push(Ak(s,i))}else{let r=t.getElementsByTagNameNS("*","FeatureInfo");for(let s=0;s<r.length;++s){let a=r[s];i={};let c=a.childNodes;for(let d=0;d<c.length;++d){let u=c[d];u.nodeType===Node.ELEMENT_NODE&&(i[u.localName]=u.textContent)}n.push(Ak(a,i))}}return n}function Lit(e){let t=[],i=e.documentElement.getElementsByTagNameNS(Tit,"featureMember");for(let o=0;o<i.length;++o){let r=i[o],s={};NQ(r,s),t.push(Ak(r,s))}return t}function Rit(e){let t=[],n,i=e.documentElement.childNodes;for(let r=0;r<i.length;r++)if(i[r].nodeType===Node.ELEMENT_NODE){n=i[r];break}if(!l(n))throw new me("Unable to find first child of the feature info xml document");let o=n.childNodes;for(let r=0;r<o.length;++r){let s=o[r];if(s.nodeType===Node.ELEMENT_NODE){let a={};NQ(s,a),t.push(Ak(s,a))}}return t}function NQ(e,t){let n=!0;for(let i=0;i<e.childNodes.length;++i){let o=e.childNodes[i];o.nodeType===Node.ELEMENT_NODE&&(n=!1),!(o.localName==="Point"||o.localName==="LineString"||o.localName==="Polygon"||o.localName==="boundedBy")&&o.hasChildNodes()&&NQ(o,t)&&(t[o.localName]=o.textContent)}return n}function Ak(e,t){let n=new _h;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function Zit(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let o=new _h;return o.data=e,o.description=n.innerHTML,[o]}var Git=/<body>\s*<\/body>/im,Eit=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,Iit=/<title>([\s\S]*)<\/title>/im;function Z0e(e){if(Git.test(e)||Eit.test(e))return;let t,n=Iit.exec(e);n&&n.length>1&&(t=n[1]);let i=new _h;return i.name=t,i.description=e,i.data=e,[i]}var hT=yit;var txi=T(S(),1);function ow(e){e=g(e,g.EMPTY_OBJECT),this._tileCache={},this._tilesRequestedForInterval=[];let t=this._clock=e.clock;this._times=e.times,this._requestImageFunction=e.requestImageFunction,this._reloadFunction=e.reloadFunction,this._currentIntervalIndex=-1,t.onTick.addEventListener(this._clockOnTick,this),this._clockOnTick(t)}Object.defineProperties(ow.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)}}});ow.prototype.getFromCache=function(e,t,n,i){let o=G0e(e,t,n),r,s=this._tileCache[this._currentIntervalIndex];if(l(s)&&l(s[o])){let a=s[o];r=a.promise.catch(function(c){throw i.state=a.request.state,c}),delete s[o]}return r};ow.prototype.checkApproachingInterval=function(e,t,n,i){let o=G0e(e,t,n),r=this._tilesRequestedForInterval,s=E0e(this),a={key:o,priorityFunction:i.priorityFunction};(!l(s)||!I0e(this,a,s))&&r.push(a),r.length>=512&&r.splice(0,256)};ow.prototype._clockOnTick=function(e){let t=e.currentTime,i=this._times.indexOf(t),o=this._currentIntervalIndex;if(i!==o){let s=this._tileCache[o];for(let a in s)s.hasOwnProperty(a)&&s[a].request.cancel();delete this._tileCache[o],this._tilesRequestedForInterval=[],this._currentIntervalIndex=i,this._reloadFunction();return}let r=E0e(this);if(l(r)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let c=s.pop();a=I0e(this,c,r),a||s.push(c)}}};function G0e(e,t,n){return`${e}-${t}-${n}`}function Xit(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function E0e(e){let t=e._times;if(!l(t))return;let n=e._clock,i=n.currentTime,o=n.canAnimate&&n.shouldAnimate,r=n.multiplier;if(!o&&r!==0)return;let s,a=t.indexOf(i);if(a<0)return;let c=t.get(a);return r>0?(s=te.secondsDifference(c.stop,i),++a):(s=te.secondsDifference(c.start,i),--a),s/=r,a>=0&&s<=5?t.get(a):void 0}function I0e(e,t,n){let i=e._times.indexOf(n.start),o=e._tileCache,r=o[i];l(r)||(r=o[i]={});let s=t.key;if(l(r[s]))return!0;let a=Xit(s),c=new Yo({throttle:!1,throttleByServer:!0,type:os.IMAGERY,priorityFunction:t.priorityFunction}),d=e._requestImageFunction(a.x,a.y,a.level,c,n);return l(d)?(r[s]={promise:d,request:c},!0):!1}var fT=ow;var Wit=[3034,3035,3042,3043,3044],Pit=[4471,4559];function Sh(e){if(e=g(e,g.EMPTY_OBJECT),l(e.times)&&!l(e.clock))throw new fe("options.times was specified, so options.clock is required.");this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=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._getFeatureInfoUrl=g(e.getFeatureInfoUrl,e.url);let t=Xe.createIfNeeded(e.url),n=Xe.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(Sh.DefaultParameters,!0),n.setQueryParameters(Sh.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(X0e(e.parameters,e.toLowerCase)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(X0e(e.getFeatureInfoParameters,e.toLowerCase));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new fT({clock:e.clock,times:e.times,requestImageFunction:function(s,a,c,d,u){return W0e(i,s,a,c,d,u)},reloadFunction:function(){l(i._reload)&&i._reload()}}));let o={};if(o.layers=e.layers,o.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",o.width="{width}",o.height="{height}",parseFloat(t.queryParameters.version)>=1.3){o.crs=g(e.crs,e.tilingScheme&&e.tilingScheme.projection instanceof Gi?"EPSG:3857":"CRS:84");let s=o.crs.split(":");if(s[0]==="EPSG"&&s.length===2){let a=Number(s[1]);(a>=4e3&&a<5e3&&!Pit.includes(a)||Wit.includes(a))&&(o.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else o.srs=g(e.srs,e.tilingScheme&&e.tilingScheme.projection instanceof Gi?"EPSG:3857":"EPSG:4326");t.setQueryParameters(o,!0),n.setQueryParameters(o,!0);let r={query_layers:e.layers,info_format:"{format}"};parseFloat(n.queryParameters.version)>=1.3?(r.i="{i}",r.j="{j}"):(r.x="{i}",r.y="{j}"),n.setQueryParameters(r,!0),this._resource=t,this._pickFeaturesResource=n,this._layers=e.layers,this._tileProvider=new wa({url:t,pickFeaturesUrl:n,tilingScheme:g(e.tilingScheme,new Oi({ellipsoid:e.ellipsoid})),rectangle:e.rectangle,tileWidth:e.tileWidth,tileHeight:e.tileHeight,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,subdomains:e.subdomains,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit,getFeatureInfoFormats:g(e.getFeatureInfoFormats,Sh.DefaultGetFeatureInfoFormats),enablePickFeatures:e.enablePickFeatures})}function W0e(e,t,n,i,o,r){let s=l(r)?r.data:void 0,a=e._tileProvider;return l(s)&&a._resource.setQueryParameters(s),a.requestImage(t,n,i,o)}function vit(e,t,n,i,o,r,s){let a=l(s)?s.data:void 0,c=e._tileProvider;return l(a)&&c._pickFeaturesResource.setQueryParameters(a),c.pickFeatures(t,n,i,o,r)}Object.defineProperties(Sh.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}},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}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}}});Sh.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};Sh.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return l(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),l(o)||(o=W0e(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};Sh.prototype.pickFeatures=function(e,t,n,i,o){let r=this._timeDynamicImagery,s=l(r)?r.currentInterval:void 0;return vit(this,e,t,n,i,o,s)};Sh.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});Sh.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});Sh.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new hT("json","application/json")),Object.freeze(new hT("xml","text/xml")),Object.freeze(new hT("text","text/html"))]);function X0e(e,t=!0){if(t){let n={};for(let i in e)e.hasOwnProperty(i)&&(n[i.toLowerCase()]=e[i]);return n}return e}var rw=Sh;var Vxi=T(S(),1);var wit=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});function sw(e){e=g(e,g.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=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;let t=Xe.createIfNeeded(e.url),n=e.style,i=e.tileMatrixSetID,o=t.url,r=o.match(/{/g);if(!l(r)||r.length===1&&/{s}/.test(o))t.setQueryParameters(wit),this._useKvp=!0;else{let m={style:n,Style:n,TileMatrixSet:i};t.setTemplateValues(m),this._useKvp=!1}this._resource=t,this._layer=e.layer,this._style=n,this._tileMatrixSetID=i,this._tileMatrixLabels=e.tileMatrixLabels,this._format=g(e.format,"image/jpeg"),this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Jr({ellipsoid:e.ellipsoid}),this._tileWidth=g(e.tileWidth,256),this._tileHeight=g(e.tileHeight,256),this._minimumLevel=g(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=g(e.rectangle,this._tilingScheme.rectangle),this._dimensions=e.dimensions;let s=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new fT({clock:e.clock,times:e.times,requestImageFunction:function(m,p,y,f,x){return P0e(s,m,p,y,f,x)},reloadFunction:function(){l(s._reload)&&s._reload()}}));let a=this._tilingScheme.positionToTileXY(de.southwest(this._rectangle),this._minimumLevel),c=this._tilingScheme.positionToTileXY(de.northeast(this._rectangle),this._minimumLevel),d=(Math.abs(c.x-a.x)+1)*(Math.abs(c.y-a.y)+1);this._errorEvent=new ye;let u=e.credit;this._credit=typeof u=="string"?new Vt(u):u,this._subdomains=e.subdomains,Array.isArray(this._subdomains)?this._subdomains=this._subdomains.slice():l(this._subdomains)&&this._subdomains.length>0?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function P0e(e,t,n,i,o,r){let s=e._tileMatrixLabels,a=l(s)?s[i]:i.toString(),c=e._subdomains,d=e._dimensions,u=l(r)?r.data:void 0,m,p;if(!e._useKvp)p={TileMatrix:a,TileRow:n.toString(),TileCol:t.toString(),s:c[(t+n+i)%c.length]},m=e._resource.getDerivedResource({request:o}),m.setTemplateValues(p),l(d)&&m.setTemplateValues(d),l(u)&&m.setTemplateValues(u);else{let y={};y.tilematrix=a,y.layer=e._layer,y.style=e._style,y.tilerow=n,y.tilecol=t,y.tilematrixset=e._tileMatrixSetID,y.format=e._format,l(d)&&(y=Tt(y,d)),l(u)&&(y=Tt(y,u)),p={s:c[(t+n+i)%c.length]},m=e._resource.getDerivedResource({queryParameters:y,request:o}),m.setTemplateValues(p)}return el.loadImage(e,m)}Object.defineProperties(sw.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}},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,l(this._reload)&&this._reload())}}});sw.prototype.getTileCredits=function(e,t,n){};sw.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return l(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),l(o)||(o=P0e(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};sw.prototype.pickFeatures=function(e,t,n,i,o){};var aw=sw;var Fit={ARCGIS_MAPSERVER:H0.fromUrl,BING:async(e,t)=>qv.fromUrl(e,t),GOOGLE_EARTH:async(e,t)=>{let n=t.channel;return delete t.channel,tw.fromUrl(e,n,t)},MAPBOX:(e,t)=>new nw({url:e,...t}),SINGLE_TILE:iw.fromUrl,TMS:og.fromUrl,URL_TEMPLATE:(e,t)=>new wa({url:e,...t}),WMS:(e,t)=>new rw({url:e,...t}),WMTS:(e,t)=>new aw({url:e,...t})};function Mf(e){e=g(e,g.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=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._tileCredits=void 0,this._errorEvent=new ye}Object.defineProperties(Mf.prototype,{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}},proxy:{get:function(){}}});Mf.fromAssetId=async function(e,t){t=g(t,g.EMPTY_OBJECT);let n=sd._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,o=Mf._endpointCache[i];l(o)||(o=n.fetchJson(),Mf._endpointCache[i]=o);let r=await o;if(r.type!=="IMAGERY")throw new me(`Cesium ion asset ${e} is not an imagery asset.`);let s,a=r.externalType;if(!l(a))s=await og.fromUrl(new sd(r,n));else{let d=Fit[a];if(!l(d))throw new me(`Unrecognized Cesium ion imagery type: ${a}`);let u={...r.options},m=u.url;delete u.url,s=await d(m,u)}let c=new Mf(t);return s.errorEvent.addEventListener(function(d){d.provider=c,c._errorEvent.raiseEvent(d)}),c._tileCredits=sd.getCreditsFromEndpoint(r,n),c._imageryProvider=s,c};Mf.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};Mf.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};Mf.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};Mf._endpointCache={};var K0=Mf;var Dxi=T(S(),1),Ait={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4},z0=Object.freeze(Ait);function Mit(e){e=g(e,g.EMPTY_OBJECT);let t=g(e.style,z0.AERIAL);return K0.fromAssetId(t)}var J0=Mit;var qxi=T(S(),1);function VV(e,t,n,i,o){if(this.imageryLayer=e,this.x=t,this.y=n,this.level=i,this.request=void 0,i!==0){let r=t/2|0,s=n/2|0,a=i-1;this.parent=e.getImageryFromCache(r,s,a)}this.state=ui.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!l(o)&&e.ready&&(o=e.imageryProvider.tilingScheme.tileXYToRectangle(t,n,i)),this.rectangle=o}VV.createPlaceholder=function(e){let t=new VV(e,0,0,0);return t.addReference(),t.state=ui.PLACEHOLDER,t};VV.prototype.addReference=function(){++this.referenceCount};VV.prototype.releaseReference=function(){return--this.referenceCount,this.referenceCount===0?(this.imageryLayer.removeImageryFromCache(this),l(this.parent)&&this.parent.releaseReference(),l(this.image)&&l(this.image.destroy)&&this.image.destroy(),l(this.texture)&&this.texture.destroy(),l(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),ue(this),0):this.referenceCount};VV.prototype.processStateMachine=function(e,t,n){this.state===ui.UNLOADED&&!n&&(this.state=ui.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===ui.RECEIVED&&(this.state=ui.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===ui.READY&&t&&!this.texture;(this.state===ui.TEXTURE_LOADED||i)&&(this.state=ui.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var LV=VV;var n_i=T(S(),1);function UQ(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}UQ.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};UQ.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,o=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===ui.READY)return l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this),!0;let r=i.parent,s;for(;l(r)&&(r.state!==ui.READY||!this.useWebMercatorT&&!l(r.texture));)r.state!==ui.FAILED&&r.state!==ui.INVALID&&(s=s||r),r=r.parent;return this.readyImagery!==r&&(l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=r,l(r)&&(r.addReference(),this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this))),i.state===ui.FAILED||i.state===ui.INVALID?l(s)?(s.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var RV=UQ;function _i(e,t){this._imageryProvider=e,this._readyEvent=new ye,this._errorEvent=new ye,t=g(t,g.EMPTY_OBJECT),e=g(e,g.EMPTY_OBJECT),this.alpha=g(t.alpha,g(e._defaultAlpha,1)),this.nightAlpha=g(t.nightAlpha,g(e._defaultNightAlpha,1)),this.dayAlpha=g(t.dayAlpha,g(e._defaultDayAlpha,1)),this.brightness=g(t.brightness,g(e._defaultBrightness,_i.DEFAULT_BRIGHTNESS)),this.contrast=g(t.contrast,g(e._defaultContrast,_i.DEFAULT_CONTRAST)),this.hue=g(t.hue,g(e._defaultHue,_i.DEFAULT_HUE)),this.saturation=g(t.saturation,g(e._defaultSaturation,_i.DEFAULT_SATURATION)),this.gamma=g(t.gamma,g(e._defaultGamma,_i.DEFAULT_GAMMA)),this.splitDirection=g(t.splitDirection,_i.DEFAULT_SPLIT),this.minificationFilter=g(t.minificationFilter,g(e._defaultMinificationFilter,_i.DEFAULT_MINIFICATION_FILTER)),this.magnificationFilter=g(t.magnificationFilter,g(e._defaultMagnificationFilter,_i.DEFAULT_MAGNIFICATION_FILTER)),this.show=g(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=g(t.rectangle,de.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new RV(LV.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=g(t.colorToAlphaThreshold,_i.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD),this._marsOptions=g(t.marsOptions,{}),this._initByMars3D&&this._initByMars3D(e,t)}Object.defineProperties(_i.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},ready:{get:function(){return l(this._imageryProvider)}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},rectangle:{get:function(){return this._rectangle}}});_i.DEFAULT_BRIGHTNESS=1;_i.DEFAULT_CONTRAST=1;_i.DEFAULT_HUE=0;_i.DEFAULT_SATURATION=1;_i.DEFAULT_GAMMA=1;_i.DEFAULT_SPLIT=Bc.NONE;_i.DEFAULT_MINIFICATION_FILTER=dn.LINEAR;_i.DEFAULT_MAGNIFICATION_FILTER=Ti.LINEAR;_i.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;_i.fromProviderAsync=function(e,t){let n=new _i(void 0,t);return Bit(n,Promise.resolve(e)),n};_i.fromWorldImagery=function(e){return e=g(e,g.EMPTY_OBJECT),_i.fromProviderAsync(J0({style:e.style}),e)};_i.prototype.isBaseLayer=function(){return this._isBaseLayer};_i.prototype.isDestroyed=function(){return!1};_i.prototype.destroy=function(){return ue(this)};var F0e=new de,v0e=new de,kQ=new de,A0e=new de;_i.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return de.intersection(e.rectangle,t)};_i.prototype._createTileImagerySkeletons=function(e,t,n){let i=e.data;if(!l(t)||l(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel||l(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;l(n)||(n=i.imagery.length);let o=this._imageryProvider;if(!this.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),i.imagery.splice(n,0,this._skeletonPlaceholder),!0;let r=o.tilingScheme.projection instanceof Gi&&e.rectangle.north<Gi.MaximumLatitude&&e.rectangle.south>-Gi.MaximumLatitude,s=de.intersection(o.rectangle,this._rectangle,F0e),a=de.intersection(e.rectangle,s,v0e);if(!l(a)){if(!this.isBaseLayer())return!1;let E=s,X=e.rectangle;a=v0e,X.south>=E.north?a.north=a.south=E.north:X.north<=E.south?a.north=a.south=E.south:(a.south=Math.max(X.south,E.south),a.north=Math.min(X.north,E.north)),X.west>=E.east?a.west=a.east=E.east:X.east<=E.west?a.west=a.east=E.west:(a.west=Math.max(X.west,E.west),a.east=Math.min(X.east,E.east))}let c=0;a.south>0?c=a.south:a.north<0&&(c=a.north);let u=1*t.getLevelMaximumGeometricError(e.level),m=kit(this,u,c);m=Math.max(0,m);let p=o.maximumLevel;if(m>p&&(m=p),l(o.minimumLevel)){let E=o.minimumLevel;m<E&&(m=E)}let y=o.tilingScheme,f=y.positionToTileXY(de.northwest(a),m),x=y.positionToTileXY(de.southeast(a),m),_=e.rectangle.width/512,C=e.rectangle.height/512,V=y.tileXYToRectangle(f.x,f.y,m);Math.abs(V.south-e.rectangle.north)<C&&f.y<x.y&&++f.y,Math.abs(V.east-e.rectangle.west)<_&&f.x<x.x&&++f.x;let L=y.tileXYToRectangle(x.x,x.y,m);Math.abs(L.north-e.rectangle.south)<C&&x.y>f.y&&--x.y,Math.abs(L.west-e.rectangle.east)<_&&x.x>f.x&&--x.x;let Z=de.clone(e.rectangle,A0e),G=y.tileXYToRectangle(f.x,f.y,m),I=de.intersection(G,s,kQ),P;r?(y.rectangleToNativeRectangle(Z,Z),y.rectangleToNativeRectangle(G,G),y.rectangleToNativeRectangle(I,I),y.rectangleToNativeRectangle(s,s),P=y.tileXYToNativeRectangle.bind(y),_=Z.width/512,C=Z.height/512):P=y.tileXYToRectangle.bind(y);let v,F=0,M=1,b;!this.isBaseLayer()&&Math.abs(I.west-Z.west)>=_&&(F=Math.min(1,(I.west-Z.west)/Z.width)),!this.isBaseLayer()&&Math.abs(I.north-Z.north)>=C&&(M=Math.max(0,(I.north-Z.south)/Z.height));let R=M;for(let E=f.x;E<=x.x;E++)if(v=F,G=P(E,f.y,m),I=de.simpleIntersection(G,s,kQ),!!l(I)){F=Math.min(1,(I.east-Z.west)/Z.width),E===x.x&&(this.isBaseLayer()||Math.abs(I.east-Z.east)<_)&&(F=1),M=R;for(let X=f.y;X<=x.y;X++){if(b=M,G=P(E,X,m),I=de.simpleIntersection(G,s,kQ),!l(I))continue;M=Math.max(0,(I.south-Z.south)/Z.height),X===x.y&&(this.isBaseLayer()||Math.abs(I.south-Z.south)<C)&&(M=0);let w=new se(v,M,F,b),N=this.getImageryFromCache(E,X,m);i.imagery.splice(n,0,new RV(N,w,r)),++n}}return!0};_i.prototype._calculateTextureTranslationAndScale=function(e,t){let n=t.readyImagery.rectangle,i=e.rectangle;if(t.useWebMercatorT){let c=t.readyImagery.imageryLayer.imageryProvider.tilingScheme;n=c.rectangleToNativeRectangle(n,F0e),i=c.rectangleToNativeRectangle(i,A0e)}let o=i.width,r=i.height,s=o/n.width,a=r/n.height;return new se(s*(i.west-n.west)/o,a*(i.south-n.south)/r,s,a)};_i.prototype._requestImagery=function(e){let t=this._imageryProvider,n=this;function i(s){if(!l(s))return o();e.image=s,e.state=ui.RECEIVED,e.request=void 0,Eo.reportSuccess(n._requestImageError),n._marsOptions.onAddTileSuccess&&n._marsOptions.onAddTileSuccess(e)}function o(s){if(e.request.state===ti.CANCELLED){e.state=ui.UNLOADED,e.request=void 0;return}e.state=ui.FAILED,e.request=void 0;let a=`\u65E0\u6CD5\u83B7\u5F97\u56FE\u5757 x:${e.x},y: ${e.y},z:${e.level}. `;t._resource&&t._resource._last_url&&(a+=t._resource._last_url),n._requestImageError=Eo.reportError(n._requestImageError,t,t.errorEvent,a,e.x,e.y,e.level,s),n._requestImageError.retry&&r(),n._marsOptions.onAddTileError&&n._marsOptions.onAddTileError(e)}function r(){let s=new Yo({throttle:!1,throttleByServer:!0,type:os.IMAGERY});e.request=s,e.state=ui.TRANSITIONING;let a=t.requestImage(e.x,e.y,e.level,s);if(!l(a)){e.state=ui.UNLOADED,e.request=void 0;return}l(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),n._marsOptions.onAddTile&&n._marsOptions.onAddTile(e),a.then?a.then(function(c){i(c)}).catch(function(c){o(c)}):i(a)}r()};_i.prototype._createTextureWebGL=function(e,t){let n=new hn({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return l(i.internalFormat)?new wt({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new wt({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?at.RGBA:at.RGB,sampler:n})};_i.prototype._createTexture=function(e,t){let n=this._imageryProvider,i=t.image;if(l(n.tileDiscardPolicy)){let r=n.tileDiscardPolicy;if(l(r)){if(!r.isReady()){t.state=ui.RECEIVED;return}if(r.shouldDiscardImage(i)){t.state=ui.INVALID;return}}}let o=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof Gi?t.textureWebMercator=o:t.texture=o,t.image=void 0,t.state=ui.TEXTURE_LOADED};function w0e(e,t,n){return`${e}:${t}:${n}`}_i.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===dn.LINEAR&&i===Ti.LINEAR&&!at.isCompressedFormat(t.pixelFormat)&&W.isPowerOfTwo(t.width)&&W.isPowerOfTwo(t.height)){n=dn.LINEAR_MIPMAP_LINEAR;let r=Yt.maximumTextureFilterAnisotropy,s=Math.min(r,g(this._maximumAnisotropy,r)),a=w0e(n,i,s),c=e.cache.imageryLayerMipmapSamplers;l(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let d=c[a];l(d)||(d=c[a]=new hn({wrapS:In.CLAMP_TO_EDGE,wrapT:In.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(Oh.NICEST),t.sampler=d}else{let r=w0e(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;l(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[r];l(a)||(a=s[r]=new hn({wrapS:In.CLAMP_TO_EDGE,wrapT:In.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}};_i.prototype._reprojectTexture=function(e,t,n){let i=t.textureWebMercator||t.texture,o=t.rectangle,r=e.context;if(n=g(n,!0),n&&!(this._imageryProvider.tilingScheme.projection instanceof Ri)&&o.width/i.width>1e-5){let s=this;t.addReference();let a=new au({persists:!0,owner:this,preExecute:function(c){Uit(c,r,i,t.rectangle)},postExecute:function(c){t.texture=c,s._finalizeReprojectTexture(r,c),t.state=ui.READY,t.releaseReference()},canceled:function(){t.state=ui.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(a)}else n&&(t.texture=i),this._finalizeReprojectTexture(r,i),t.state=ui.READY};_i.prototype.queueReprojectionCommands=function(e){let t=this._reprojectComputeCommands,n=t.length;for(let i=0;i<n;++i)e.commandList.push(t[i]);t.length=0};_i.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){l(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};_i.prototype.getImageryFromCache=function(e,t,n,i){let o=M0e(e,t,n),r=this._imageryCache[o];return l(r)||(r=new LV(this,e,t,n,i),this._imageryCache[o]=r),r.addReference(),r};_i.prototype.removeImageryFromCache=function(e){this._marsOptions.onRemoveTile&&this._marsOptions.onRemoveTile(e);let t=M0e(e.x,e.y,e.level);delete this._imageryCache[t]};function M0e(e,t,n){return JSON.stringify([e,t,n])}var Mk={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new B,texture:void 0},Nit=Bt.supportsTypedArrays()?new Float32Array(2*64):void 0;function Uit(e,t,n,i){let o=t.cache.imageryLayer_reproject;if(!l(o)){o=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){l(this.framebuffer)&&this.framebuffer.destroy(),l(this.vertexArray)&&this.vertexArray.destroy(),l(this.shaderProgram)&&this.shaderProgram.destroy()}};let _=new Float32Array(2*64*2),C=0;for(let I=0;I<64;++I){let P=I/63;_[C++]=0,_[C++]=P,_[C++]=1,_[C++]=P}let V={position:0,webMercatorT:1},L=zr.getRegularGridIndices(2,64),Z=ft.createIndexBuffer({context:t,typedArray:L,usage:Ue.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT});o.vertexArray=new oi({context:t,attributes:[{index:V.position,vertexBuffer:ft.createVertexBuffer({context:t,typedArray:_,usage:Ue.STATIC_DRAW}),componentsPerAttribute:2},{index:V.webMercatorT,vertexBuffer:ft.createVertexBuffer({context:t,sizeInBytes:64*2*4,usage:Ue.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:Z});let G=new Oe({sources:[Uv]});o.shaderProgram=Qt.fromCache({context:t,vertexShaderSource:G,fragmentShaderSource:Nv,attributeLocations:V}),o.sampler=new hn({wrapS:In.CLAMP_TO_EDGE,wrapT:In.CLAMP_TO_EDGE,minificationFilter:dn.LINEAR,magnificationFilter:Ti.LINEAR})}n.sampler=o.sampler;let r=n.width,s=n.height;Mk.textureDimensions.x=r,Mk.textureDimensions.y=s,Mk.texture=n;let a=Math.sin(i.south),c=.5*Math.log((1+a)/(1-a));a=Math.sin(i.north);let u=1/(.5*Math.log((1+a)/(1-a))-c),m=new wt({context:t,width:r,height:s,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});W.isPowerOfTwo(r)&&W.isPowerOfTwo(s)&&m.generateMipmap(Oh.NICEST);let p=i.south,y=i.north,f=Nit,x=0;for(let _=0;_<64;++_){let C=_/63,V=W.lerp(p,y,C);a=Math.sin(V);let Z=(.5*Math.log((1+a)/(1-a))-c)*u;f[x++]=Z,f[x++]=Z}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(f),e.shaderProgram=o.shaderProgram,e.outputTexture=m,e.uniformMap=Mk,e.vertexArray=o.vertexArray}function kit(e,t,n){let i=e._imageryProvider,o=i.tilingScheme,r=o.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof Ri?1:Math.cos(n),a=o.rectangle,d=r.maximumRadius*a.width*s/(i.tileWidth*o.getNumberOfXTilesAtLevel(0))/t,u=Math.log(d)/Math.log(2);return Math.round(u)|0}function Dit(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function Bit(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){Dit(e._errorEvent,i)}}var ua=_i;var fTi=T(S(),1);var O_i=T(S(),1),Oit={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},Tn=Oit;var H_i=T(S(),1),N0e={NONE:0,CULLED:1,RENDERED:2,REFINED:3,RENDERED_AND_KICKED:6,REFINED_AND_KICKED:7,CULLED_BUT_NEEDED:9,wasKicked:function(e){return e>=N0e.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},$n=N0e;function GV(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 se}GV.prototype.update=function(e,t,n){this.changedThisFrame&&(H0e(e,t,this.tile,n),this.changedThisFrame=!1)};GV.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};GV.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):ju._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var Yit=new py;GV.updateFillTiles=function(e,t,n,i){let o=e._quadtree,r=o._levelZeroTiles,s=o._lastSelectionFrameNumber,a=Yit;a.clear();for(let d=0;d<t.length;++d){let u=t[d];l(u.data.vertexArray)&&a.enqueue(t[d])}let c=a.dequeue();for(;c!==void 0;){let d=c.findTileToWest(r),u=c.findTileToSouth(r),m=c.findTileToEast(r),p=c.findTileToNorth(r);Zs(e,n,c,d,s,Tn.EAST,!1,a,i),Zs(e,n,c,u,s,Tn.NORTH,!1,a,i),Zs(e,n,c,m,s,Tn.WEST,!1,a,i),Zs(e,n,c,p,s,Tn.SOUTH,!1,a,i);let y=d.findTileToNorth(r),f=d.findTileToSouth(r),x=m.findTileToNorth(r),_=m.findTileToSouth(r);Zs(e,n,c,y,s,Tn.SOUTHEAST,!1,a,i),Zs(e,n,c,x,s,Tn.SOUTHWEST,!1,a,i),Zs(e,n,c,f,s,Tn.NORTHEAST,!1,a,i),Zs(e,n,c,_,s,Tn.NORTHWEST,!1,a,i),c=a.dequeue()}};function Zs(e,t,n,i,o,r,s,a,c){if(i===void 0)return;let d=i;for(;d&&(d._lastSelectionResultFrame!==o||$n.wasKicked(d._lastSelectionResult)||$n.originalResult(d._lastSelectionResult)===$n.CULLED);){if(s)return;let u=d.parent;if(r>=Tn.NORTHWEST&&u!==void 0)switch(r){case Tn.NORTHWEST:d=d===u.northwestChild?u:void 0;break;case Tn.NORTHEAST:d=d===u.northeastChild?u:void 0;break;case Tn.SOUTHWEST:d=d===u.southwestChild?u:void 0;break;case Tn.SOUTHEAST:d=d===u.southeastChild?u:void 0;break}else d=u}if(d!==void 0){if(d._lastSelectionResult===$n.RENDERED){if(l(d.data.vertexArray))return;Hit(e,t,n,d,r,o,a,c);return}if($n.originalResult(i._lastSelectionResult)!==$n.CULLED)switch(r){case Tn.WEST:Zs(e,t,n,i.northwestChild,o,r,!0,a,c),Zs(e,t,n,i.southwestChild,o,r,!0,a,c);break;case Tn.EAST:Zs(e,t,n,i.southeastChild,o,r,!0,a,c),Zs(e,t,n,i.northeastChild,o,r,!0,a,c);break;case Tn.SOUTH:Zs(e,t,n,i.southwestChild,o,r,!0,a,c),Zs(e,t,n,i.southeastChild,o,r,!0,a,c);break;case Tn.NORTH:Zs(e,t,n,i.northeastChild,o,r,!0,a,c),Zs(e,t,n,i.northwestChild,o,r,!0,a,c);break;case Tn.NORTHWEST:Zs(e,t,n,i.northwestChild,o,r,!0,a,c);break;case Tn.NORTHEAST:Zs(e,t,n,i.northeastChild,o,r,!0,a,c);break;case Tn.SOUTHWEST:Zs(e,t,n,i.southwestChild,o,r,!0,a,c);break;case Tn.SOUTHEAST:Zs(e,t,n,i.southeastChild,o,r,!0,a,c);break;default:throw new fe("Invalid edge")}}}function Hit(e,t,n,i,o,r,s,a){let c=i.data;if(c.fill===void 0)c.fill=new GV(i);else if(c.fill.visitedFrame===r)return;c.fill.enqueuedFrame!==r&&(c.fill.enqueuedFrame=r,c.fill.changedThisFrame=!1,s.enqueue(i)),Kit(e,t,n,i,o,a)}function Kit(e,t,n,i,o,r){let s=i.data.fill,a,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(H0e(e,t,n,r),c.changedThisFrame=!1),a=n.data.fill.mesh):a=n.data.mesh;let d,u;switch(o){case Tn.WEST:d=s.westMeshes,u=s.westTiles;break;case Tn.SOUTH:d=s.southMeshes,u=s.southTiles;break;case Tn.EAST:d=s.eastMeshes,u=s.eastTiles;break;case Tn.NORTH:d=s.northMeshes,u=s.northTiles;break;case Tn.NORTHWEST:s.changedThisFrame=s.changedThisFrame||s.northwestMesh!==a,s.northwestMesh=a,s.northwestTile=n;return;case Tn.NORTHEAST:s.changedThisFrame=s.changedThisFrame||s.northeastMesh!==a,s.northeastMesh=a,s.northeastTile=n;return;case Tn.SOUTHWEST:s.changedThisFrame=s.changedThisFrame||s.southwestMesh!==a,s.southwestMesh=a,s.southwestTile=n;return;case Tn.SOUTHEAST:s.changedThisFrame=s.changedThisFrame||s.southeastMesh!==a,s.southeastMesh=a,s.southeastTile=n;return}if(n.level<=i.level){s.changedThisFrame=s.changedThisFrame||d[0]!==a||d.length!==1,d[0]=a,u[0]=n,d.length=1,u.length=1;return}let m,p,y,f,x=n.rectangle,_,C=i.rectangle;switch(o){case Tn.WEST:for(_=(C.north-C.south)*W.EPSILON5,m=0;m<u.length&&(y=u[m],f=y.rectangle,!W.greaterThan(x.north,f.south,_));++m);for(p=m;p<u.length&&(y=u[p],f=y.rectangle,!W.greaterThanOrEquals(x.south,f.north,_));++p);break;case Tn.SOUTH:for(_=(C.east-C.west)*W.EPSILON5,m=0;m<u.length&&(y=u[m],f=y.rectangle,!W.lessThan(x.west,f.east,_));++m);for(p=m;p<u.length&&(y=u[p],f=y.rectangle,!W.lessThanOrEquals(x.east,f.west,_));++p);break;case Tn.EAST:for(_=(C.north-C.south)*W.EPSILON5,m=0;m<u.length&&(y=u[m],f=y.rectangle,!W.lessThan(x.south,f.north,_));++m);for(p=m;p<u.length&&(y=u[p],f=y.rectangle,!W.lessThanOrEquals(x.north,f.south,_));++p);break;case Tn.NORTH:for(_=(C.east-C.west)*W.EPSILON5,m=0;m<u.length&&(y=u[m],f=y.rectangle,!W.greaterThan(x.east,f.west,_));++m);for(p=m;p<u.length&&(y=u[p],f=y.rectangle,!W.greaterThanOrEquals(x.west,f.east,_));++p);break}p-m===1?(s.changedThisFrame=s.changedThisFrame||d[m]!==a,d[m]=a,u[m]=n):(s.changedThisFrame=!0,d.splice(m,p-m,a),u.splice(m,p-m,n))}var pT=new he,zit=new he,ZV=new h,YQ=new h,DQ=new B,BQ=new B,Md=new B;function Yk(){this.height=0,this.encodedNormal=new B}function Nk(e,t,n,i,o,r,s,a,c){if(l(o))return o;let d;if(l(r)&&l(s))d=(r.height+s.height)*.5;else if(l(r))d=r.height;else if(l(s))d=s.height;else if(l(a))d=a.height;else{let m=e.tile.data.tileBoundingRegion,p=0,y=0;l(m)&&(p=m.minimumHeight,y=m.maximumHeight),d=(p+y)*.5}return K0e(e,t,n,i,d,c),c}var Jit={minimumHeight:0,maximumHeight:0},Qit=new h,U0e=new Yk,k0e=new Yk,D0e=new Yk,B0e=new Yk,jit=typeof Uint8Array<"u"?new Uint8Array(9*9):void 0,qit={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function H0e(e,t,n,i){ju.initialize(n,e.terrainProvider,e._imageryLayers);let o=n.data,r=o.fill,s=n.rectangle,a=t.verticalExaggeration,c=t.verticalExaggerationRelativeHeight,d=a!==1,u=n.tilingScheme.ellipsoid,m=kk(r,u,0,1,r.northwestTile,r.northwestMesh,r.northTiles,r.northMeshes,r.westTiles,r.westMeshes,D0e),p=kk(r,u,0,0,r.southwestTile,r.southwestMesh,r.westTiles,r.westMeshes,r.southTiles,r.southMeshes,U0e),y=kk(r,u,1,0,r.southeastTile,r.southeastMesh,r.southTiles,r.southMeshes,r.eastTiles,r.eastMeshes,k0e),f=kk(r,u,1,1,r.northeastTile,r.northeastMesh,r.eastTiles,r.eastMeshes,r.northTiles,r.northMeshes,B0e);m=Nk(r,u,0,1,m,p,f,y,D0e),p=Nk(r,u,0,0,p,m,y,f,U0e),y=Nk(r,u,1,1,y,p,f,m,k0e),f=Nk(r,u,1,1,f,y,m,p,B0e);let x=p.height,_=y.height,C=m.height,V=f.height,L=Math.min(x,_,C,V),Z=Math.max(x,_,C,V),G=(L+Z)*.5,I,P,v=e.getLevelMaximumGeometricError(n.level),F=u.maximumRadius-v,M=Math.acos(F/u.maximumRadius)*4;if(M*=1.5,s.width>M&&Z-L<=v){let E=new va({width:9,height:9,buffer:jit,structure:{heightOffset:Z}}),X=qit;X.tilingScheme=n.tilingScheme,X.x=n.x,X.y=n.y,X.level=n.level,X.exaggeration=a,X.exaggerationRelativeHeight=c,r.mesh=E._createMeshSync(X)}else{let E=d,X=de.center(s,zit);X.height=G;let w=u.cartographicToCartesian(X,Qit),N=new yc(w,void 0,void 0,void 0,void 0,!0,!0,E,a,c),D=5,k;for(k=r.westMeshes,I=0,P=k.length;I<P;++I)D+=k[I].eastIndicesNorthToSouth.length;for(k=r.southMeshes,I=0,P=k.length;I<P;++I)D+=k[I].northIndicesWestToEast.length;for(k=r.eastMeshes,I=0,P=k.length;I<P;++I)D+=k[I].westIndicesSouthToNorth.length;for(k=r.northMeshes,I=0,P=k.length;I<P;++I)D+=k[I].southIndicesEastToWest.length;let Y=Jit;Y.minimumHeight=L,Y.maximumHeight=Z;let U=N.stride,J=new Float32Array(D*U),K=0,ee=K;K=Uk(u,s,N,J,K,0,1,m.height,m.encodedNormal,1,Y),K=Bk(r,u,N,J,K,r.westTiles,r.westMeshes,Tn.EAST,Y);let H=K;K=Uk(u,s,N,J,K,0,0,p.height,p.encodedNormal,0,Y),K=Bk(r,u,N,J,K,r.southTiles,r.southMeshes,Tn.NORTH,Y);let j=K;K=Uk(u,s,N,J,K,1,0,y.height,y.encodedNormal,0,Y),K=Bk(r,u,N,J,K,r.eastTiles,r.eastMeshes,Tn.WEST,Y);let $=K;K=Uk(u,s,N,J,K,1,1,f.height,f.encodedNormal,1,Y),K=Bk(r,u,N,J,K,r.northTiles,r.northMeshes,Tn.SOUTH,Y),L=Y.minimumHeight,Z=Y.maximumHeight;let pe=Xn.fromRectangle(s,L,Z,n.tilingScheme.ellipsoid),ge=Gi.geodeticLatitudeToMercatorAngle(s.south),ae=1/(Gi.geodeticLatitudeToMercatorAngle(s.north)-ge),be=(Gi.geodeticLatitudeToMercatorAngle(X.latitude)-ge)*ae,_e=u.geodeticSurfaceNormalCartographic(pT,YQ),Ze=Fn.octEncode(_e,DQ),Le=K;N.encode(J,K*U,pe.center,B.fromElements(.5,.5,Md),G,Ze,be,_e),++K;let Ee=K,He=Ee<256?1:2,we=(Ee-1)*3,dt=we*He,bt=(J.length-Ee*U)*Float32Array.BYTES_PER_ELEMENT,it;if(bt>=dt){let Re=Ee*U*Float32Array.BYTES_PER_ELEMENT;it=Ee<256?new Uint8Array(J.buffer,Re,we):new Uint16Array(J.buffer,Re,we)}else it=Ee<256?new Uint8Array(we):new Uint16Array(we);J=new Float32Array(J.buffer,0,Ee*U);let en=0;for(I=0;I<Ee-2;++I)it[en++]=Le,it[en++]=I,it[en++]=I+1;it[en++]=Le,it[en++]=I,it[en++]=0;let _n=[];for(I=H;I>=ee;--I)_n.push(I);let kt=[];for(I=j;I>=H;--I)kt.push(I);let At=[];for(I=$;I>=j;--I)At.push(I);let Te=[];for(Te.push(0),I=Le-1;I>=$;--I)Te.push(I);r.mesh=new Qu(N.center,J,it,we,Ee,L,Z,ce.fromOrientedBoundingBox(pe),rot(e,pe.center,s,L,Z),N.stride,pe,N,_n,kt,At,Te)}let b=t.context;r._destroyVertexArray(i),r.vertexArray=ju._createVertexArrayForMesh(b,r.mesh),o.processImagery(n,e.terrainProvider,t,!0);let R=r.waterMaskTexture;if(r.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let E=o._findAncestorTileWithTerrainData(n);l(E)&&l(E.data.waterMaskTexture)&&(r.waterMaskTexture=E.data.waterMaskTexture,++r.waterMaskTexture.referenceCount,o._computeWaterMaskTranslationAndScale(n,E,r.waterMaskTranslationAndScale))}l(R)&&(--R.referenceCount,R.referenceCount===0&&R.destroy())}function Uk(e,t,n,i,o,r,s,a,c,d,u){let m=pT;m.longitude=W.lerp(t.west,t.east,r),m.latitude=W.lerp(t.south,t.north,s),m.height=a;let p=e.cartographicToCartesian(m,ZV),y;n.hasGeodeticSurfaceNormals&&(y=e.geodeticSurfaceNormal(p,YQ));let f=BQ;return f.x=r,f.y=s,n.encode(i,o*n.stride,p,f,a,c,d,y),u.minimumHeight=Math.min(u.minimumHeight,a),u.maximumHeight=Math.max(u.maximumHeight,a),o+1}var Ok=new de;function cw(e,t,n,i){let o=e.rectangle,r=t.rectangle;t.x===0&&n.x===1&&e.x===e.tilingScheme.getNumberOfXTilesAtLevel(e.level)-1?(o=de.clone(e.rectangle,Ok),o.west-=W.TWO_PI,o.east-=W.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(o=de.clone(e.rectangle,Ok),o.west+=W.TWO_PI,o.east+=W.TWO_PI);let s=o.east-o.west,a=(r.west-o.west)/s,c=(r.east-o.west)/s,d=o.north-o.south,u=(r.south-o.south)/d,m=(r.north-o.south)/d,p=(n.x-a)/(c-a),y=(n.y-u)/(m-u);return Math.abs(p)<Math.EPSILON5?p=0:Math.abs(p-1)<Math.EPSILON5&&(p=1),Math.abs(y)<Math.EPSILON5?y=0:Math.abs(y-1)<Math.EPSILON5&&(y=1),i.x=p,i.y=y,i}var $it=new B;function OQ(e,t,n,i,o){let r=e.encoding,s=e.vertices;if(o.height=r.decodeHeight(s,t),r.hasVertexNormals)r.getOctEncodedNormal(s,t,o.encodedNormal);else{let a=o.encodedNormal;a.x=0,a.y=0}}var eot=new B,tot=new h;function not(e,t,n,i,o,r,s,a,c,d){let u=i.encoding,m=i.vertices,p=cw(t,n,u.decodeTextureCoordinates(m,o,Md),Md),y=cw(t,n,u.decodeTextureCoordinates(m,r,BQ),BQ),f;c?f=(s-p.x)/(y.x-p.x):f=(a-p.y)/(y.y-p.y);let x=u.decodeHeight(m,o),_=u.decodeHeight(m,r),C=n.rectangle;pT.longitude=W.lerp(C.west,C.east,s),pT.latitude=W.lerp(C.south,C.north,a),d.height=pT.height=W.lerp(x,_,f);let V;if(u.hasVertexNormals){let L=u.getOctEncodedNormal(m,o,$it),Z=u.getOctEncodedNormal(m,r,eot),G=Fn.octDecode(L.x,L.y,ZV),I=Fn.octDecode(Z.x,Z.y,tot);V=h.lerp(G,I,f,ZV),h.normalize(V,V),Fn.octEncode(V,d.encodedNormal)}else V=e.geodeticSurfaceNormalCartographic(pT,ZV),Fn.octEncode(V,d.encodedNormal)}function K0e(e,t,n,i,o,r){r.height=o;let s=t.geodeticSurfaceNormalCartographic(pT,ZV);Fn.octEncode(s,r.encodedNormal)}function kk(e,t,n,i,o,r,s,a,c,d,u){if(Y0e(e,t,a,s,!1,n,i,u)||Y0e(e,t,d,c,!0,n,i,u))return u;let p;if(HQ(o,r))return n===0?i===0?p=r.eastIndicesNorthToSouth[0]:p=r.southIndicesEastToWest[0]:i===0?p=r.northIndicesWestToEast[0]:p=r.westIndicesSouthToNorth[0],OQ(r,p,n,i,u),u;let y;if(n===0?i===0?y=Dk(e.westMeshes,e.westTiles,Tn.EAST,e.southMeshes,e.southTiles,Tn.NORTH,n,i):y=Dk(e.northMeshes,e.northTiles,Tn.SOUTH,e.westMeshes,e.westTiles,Tn.EAST,n,i):i===0?y=Dk(e.southMeshes,e.southTiles,Tn.NORTH,e.eastMeshes,e.eastTiles,Tn.WEST,n,i):y=Dk(e.eastMeshes,e.eastTiles,Tn.WEST,e.northMeshes,e.northTiles,Tn.SOUTH,n,i),l(y))return K0e(e,t,n,i,y,u),u}function Dk(e,t,n,i,o,r,s,a){let c=O0e(e,t,!1,n,s,a),d=O0e(i,o,!0,r,s,a);return l(c)&&l(d)?(c+d)*.5:l(c)?c:d}function Bk(e,t,n,i,o,r,s,a,c){for(let d=0;d<r.length;++d)o=iot(e,t,n,i,o,r[d],s[d],a,c);return o}function iot(e,t,n,i,o,r,s,a,c){let d=r.rectangle;a===Tn.EAST&&e.tile.x===0?(d=de.clone(r.rectangle,Ok),d.west-=W.TWO_PI,d.east-=W.TWO_PI):a===Tn.WEST&&r.x===0&&(d=de.clone(r.rectangle,Ok),d.west+=W.TWO_PI,d.east+=W.TWO_PI);let u=e.tile.rectangle,m,p;o>0&&(n.decodeTextureCoordinates(i,o-1,Md),m=Md.x,p=Md.y);let y,f;switch(a){case Tn.WEST:y=s.westIndicesSouthToNorth,f=!1;break;case Tn.NORTH:y=s.northIndicesWestToEast,f=!0;break;case Tn.EAST:y=s.eastIndicesNorthToSouth,f=!1;break;case Tn.SOUTH:y=s.southIndicesEastToWest,f=!0;break}let x=r,_=e.tile,C=s.encoding,V=s.vertices,L=n.stride,Z,G;C.hasWebMercatorT&&(Z=Gi.geodeticLatitudeToMercatorAngle(u.south),G=1/(Gi.geodeticLatitudeToMercatorAngle(u.north)-Z));for(let I=0;I<y.length;++I){let P=y[I],v=C.decodeTextureCoordinates(V,P,Md);cw(x,_,v,v);let F=v.x,M=v.y,b=f?F:M;if(b<0||b>1||Math.abs(F-m)<W.EPSILON5&&Math.abs(M-p)<W.EPSILON5)continue;let R=Math.abs(F)<W.EPSILON5||Math.abs(F-1)<W.EPSILON5,E=Math.abs(M)<W.EPSILON5||Math.abs(M-1)<W.EPSILON5;if(R&&E)continue;let X=C.decodePosition(V,P,ZV),w=C.decodeHeight(V,P),N;C.hasVertexNormals?N=C.getOctEncodedNormal(V,P,DQ):(N=DQ,N.x=0,N.y=0);let D=M;if(C.hasWebMercatorT){let Y=W.lerp(u.south,u.north,M);D=(Gi.geodeticLatitudeToMercatorAngle(Y)-Z)*G}let k;n.hasGeodeticSurfaceNormals&&(k=t.geodeticSurfaceNormal(X,YQ)),n.encode(i,o*L,X,v,w,N,D,k),c.minimumHeight=Math.min(c.minimumHeight,w),c.maximumHeight=Math.max(c.maximumHeight,w),++o}return o}function O0e(e,t,n,i,o,r){let s,a,c;n?(s=0,a=e.length,c=1):(s=e.length-1,a=-1,c=-1);for(let d=s;d!==a;d+=c){let u=e[d],m=t[d];if(!HQ(m,u))continue;let p;switch(i){case Tn.WEST:p=u.westIndicesSouthToNorth;break;case Tn.SOUTH:p=u.southIndicesEastToWest;break;case Tn.EAST:p=u.eastIndicesNorthToSouth;break;case Tn.NORTH:p=u.northIndicesWestToEast;break}let y=p[n?0:p.length-1];if(l(y))return u.encoding.decodeHeight(u.vertices,y)}}function HQ(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function Y0e(e,t,n,i,o,r,s,a){let c,d,u,m,p,y=i[o?0:n.length-1],f=n[o?0:n.length-1];if(HQ(y,f)&&(r===0?s===0?(c=o?f.northIndicesWestToEast:f.eastIndicesNorthToSouth,d=o,u=o):(c=o?f.eastIndicesNorthToSouth:f.southIndicesEastToWest,d=!o,u=!1):s===0?(c=o?f.westIndicesSouthToNorth:f.northIndicesWestToEast,d=!o,u=!0):(c=o?f.southIndicesEastToWest:f.westIndicesSouthToNorth,d=o,u=!o),c.length>0)){m=o?0:c.length-1,p=c[m],f.encoding.decodeTextureCoordinates(f.vertices,p,Md);let x=cw(y,e.tile,Md,Md);if(x.x===r&&x.y===s)return OQ(f,p,r,s,a),!0;if(m=Io(c,d?r:s,function(_,C){f.encoding.decodeTextureCoordinates(f.vertices,_,Md);let V=cw(y,e.tile,Md,Md);return u?d?V.x-r:V.y-s:d?r-V.x:s-V.y}),m<0){if(m=~m,m>0&&m<c.length)return not(t,y,e.tile,f,c[m-1],c[m],r,s,d,a),!0}else return OQ(f,c[m],r,s,a),!0}return!1}var oot=[new h,new h,new h,new h];function rot(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=oot;return h.fromRadians(n.west,n.south,o,a,c[0]),h.fromRadians(n.east,n.south,o,a,c[1]),h.fromRadians(n.west,n.north,o,a,c[2]),h.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}var EV=GV;function ir(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.dynamicAtmosphereLighting=!1,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!1,this.shadows=Cn.RECEIVE_ONLY,this.vertexShadowDarkness=.3,this.fillHighlightColor=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this.undergroundColor=void 0,this.undergroundColorAlphaByDistance=void 0,this.lambertDiffuseMultiplier=0,this.materialUniformMap=void 0,this._materialUniformMap=void 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._disableCullingRenderState=void 0,this._disableCullingBlendRenderState=void 0,this._errorEvent=new ye,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(ir.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(ir.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(ir.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(ir.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new ye,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 O(0,0,.5,1),this._clippingPlanes=void 0,this.cartographicLimitRectangle=de.clone(de.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldVerticalExaggeration=void 0,this._oldVerticalExaggerationRelativeHeight=void 0,this._initByMars3D&&this._initByMars3D(e)}Object.defineProperties(ir.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){this._baseColor=e,this._firstPassInitialColor=se.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},tilingScheme:{get:function(){if(l(this._terrainProvider))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,l(this._quadtree)&&this._quadtree.invalidateAllTiles())}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){ys.setOwner(e,this,"_clippingPlanes")}}});function sot(e,t){let n=e.loadingImagery;l(n)||(n=e.readyImagery);let i=t.loadingImagery;return l(i)||(i=t.readyImagery),n.imageryLayer._layerIndex-i.imageryLayer._layerIndex}ir.prototype.update=function(e){this._imageryLayers._update()};function aot(e,t){let n=t.creditDisplay,i=e._terrainProvider;l(i)&&l(i.credit)&&n.addCreditToNextFrame(i.credit);let o=e._imageryLayers;for(let r=0,s=o.length;r<s;++r){let a=o.get(r);a.ready&&a.show&&l(a.imageryProvider.credit)&&n.addCreditToNextFrame(a.imageryProvider.credit)}}ir.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(i){i.data.imagery.sort(sot)})),aot(this,e);let t=this._vertexArraysToDestroy,n=t.length;for(let i=0;i<n;++i)ju._freeVertexArray(t[i]);t.length=0};ir.prototype.beginUpdate=function(e){let t=this._tilesToRenderByTextureCount;for(let i=0,o=t.length;i<o;++i){let r=t[i];l(r)&&(r.length=0)}let n=this._clippingPlanes;l(n)&&n.enabled&&n.update(e),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1};ir.prototype.endUpdate=function(e){if(!l(this._renderState)){this._renderState=ke.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:ja.LESS}}),this._blendRenderState=ke.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:ja.LESS_OR_EQUAL},blending:mn.ALPHA_BLEND});let s=ze(this._renderState,!0);s.cull.enabled=!1,this._disableCullingRenderState=ke.fromCache(s),s=ze(this._blendRenderState,!0),s.cull.enabled=!1,this._disableCullingBlendRenderState=ke.fromCache(s)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&EV.updateFillTiles(this,this._quadtree._tilesToRender,e,this._vertexArraysToDestroy);let t=this.quadtree,n=e.verticalExaggeration,i=e.verticalExaggerationRelativeHeight,o=this._oldVerticalExaggeration!==n||this._oldVerticalExaggerationRelativeHeight!==i;this._oldVerticalExaggeration=n,this._oldVerticalExaggerationRelativeHeight=i,o&&t.forEachLoadedTile(function(s){s.data.updateExaggeration(s,e,t)});let r=this._tilesToRenderByTextureCount;for(let s=0,a=r.length;s<a;++s){let c=r[s];if(l(c))for(let d=0,u=c.length;d<u;++d){let m=c[d],p=m.data.tileBoundingRegion;q0e(this,m,e,!1);let y=this.marsOptions?.uplift;if(y&&y.enabled&&y.height!==0&&y.rectangles){for(let f=0;f<y.rectangles.length;f++)if(de.intersection(p.rectangle,y.rectangles[f])){q0e(this,m,e,!0);break}}e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,p.minimumHeight)}}};function $0e(e,t){let n=t.globeTranslucencyState;if(n.translucent){let i=e.renderState.blending.enabled;n.pushDerivedCommands(e,i,t)}else t.commandList.push(e)}ir.prototype.updateForPick=function(e){let t=this._drawCommands;for(let n=0,i=this._usedDrawCommands;n<i;++n)$0e(t[n],e)};ir.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()};ir.prototype.getLevelMaximumGeometricError=function(e){return l(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(e):0};ir.prototype.loadTile=function(e,t){let n=t.data,i=!0,o;l(n)&&(i=n.boundingVolumeSourceTile!==t||t._lastSelectionResult===$n.CULLED_BUT_NEEDED,o=n.terrainState),ju.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i),n=t.data,i&&o!==t.data.terrainState&&this.computeTileVisibility(t,e,this.quadtree.occluders)!==mr.NONE&&n.boundingVolumeSourceTile===t&&(i=!1,ju.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i))};var cot=new ce,ebe=new de,lot=new de,dot=new he;function Kk(e,t){if(t.west<t.east)return t;let n=de.clone(t,lot);return de.center(e,dot).longitude>0?n.east=W.PI:n.west=-W.PI,n}function tbe(e,t){if(t.cameraUnderground||t.globeTranslucencyState.translucent)return!0;if(e.backFaceCulling)return!1;let n=e._clippingPlanes;return!!(l(n)&&n.enabled||!de.equals(e.cartographicLimitRectangle,de.MAX_VALUE))}ir.prototype.computeTileVisibility=function(e,t,n){let i=this.computeDistanceToTile(e,t);e._distance=i;let o=tbe(this,t);if(t.fog.enabled&&!o&&W.fog(i,t.fog.density)>=1)return mr.NONE;let r=e.data,s=r.tileBoundingRegion;if(r.boundingVolumeSourceTile===void 0)return mr.PARTIAL;let a=t.cullingVolume,c=s.boundingVolume;l(c)||(c=s.boundingSphere),r.clippedByBoundaries=!1;let d=Kk(e.rectangle,this.cartographicLimitRectangle),u=de.simpleIntersection(d,e.rectangle,ebe);if(!l(u))return mr.NONE;if(de.equals(u,e.rectangle)||(r.clippedByBoundaries=!0),t.mode!==ie.SCENE3D&&(c=cot,ce.fromRectangleWithHeights2D(e.rectangle,t.mapProjection,s.minimumHeight,s.maximumHeight,c),h.fromElements(c.center.z,c.center.x,c.center.y,c.center),t.mode===ie.MORPHING&&l(r.renderedMesh)&&(c=ce.union(s.boundingSphere,c,c))),!l(c))return mr.PARTIAL;let m=this._clippingPlanes;if(l(m)&&m.enabled){let x=m.computeIntersectionWithBoundingVolume(c);if(e.isClipped=x!==nn.INSIDE,x===nn.OUTSIDE)return mr.NONE}let p,y=a.computeVisibility(c);if(y===nn.OUTSIDE?p=mr.NONE:y===nn.INTERSECTING?p=mr.PARTIAL:y===nn.INSIDE&&(p=mr.FULL),p===mr.NONE)return p;let f=t.mode===ie.SCENE3D&&t.camera.frustum instanceof rn;if(t.mode===ie.SCENE3D&&!f&&l(n)&&!o){let x=r.occludeePointInScaledSpace;return!l(x)||n.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(x,s.minimumHeight)?p:mr.NONE}return p};ir.prototype.canRefine=function(e){return l(e.data.terrainData)?!0:this.terrainProvider.getTileDataAvailable(e.x*2,e.y*2,e.level+1)!==void 0};var uot=[],mot=[];ir.prototype.canRenderWithoutLosingDetail=function(e,t){let n=e.data,i=uot;i.length=this._imageryLayers.length;let o=!1,r=!1,s;l(n)&&(o=n.terrainState===ho.READY,r=!0,s=n.imagery);let a,c;for(a=0,c=i.length;a<c;++a)i[a]=r;if(l(s))for(a=0,c=s.length;a<c;++a){let m=s[a],p=m.loadingImagery,y=!l(p)||p.state===ui.FAILED||p.state===ui.INVALID,f=(m.loadingImagery||m.readyImagery).imageryLayer._layerIndex;i[f]=y&&i[f]}let d=this.quadtree._lastSelectionFrameNumber,u=mot;for(u.length=0,u.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild);u.length>0;){let m=u.pop(),p=m._lastSelectionResultFrame===d?m._lastSelectionResult:$n.NONE;if(p===$n.RENDERED){let y=m.data;if(!l(y))continue;if(!o&&m.data.terrainState===ho.READY)return!1;let f=m.data.imagery;for(a=0,c=f.length;a<c;++a){let x=f[a],_=x.loadingImagery,C=!l(_)||_.state===ui.FAILED||_.state===ui.INVALID,V=(x.loadingImagery||x.readyImagery).imageryLayer._layerIndex;if(C&&!i[V])return!1}}else p===$n.REFINED&&u.push(m.southwestChild,m.southeastChild,m.northwestChild,m.northeastChild)}return!0};var hot=new h;ir.prototype.computeTileLoadPriority=function(e,t){let n=e.data;if(n===void 0)return 0;let i=n.tileBoundingRegion.boundingVolume;if(i===void 0)return 0;let o=t.camera.positionWC,r=t.camera.directionWC,s=h.subtract(i.center,o,hot),a=h.magnitude(s);return a<W.EPSILON5?0:(h.divideByScalar(s,a,s),(1-h.dot(s,r))*e._distance)};var z0e=new A,Hk=new A,fot=new se,pot=new se,bot=new se,yot=new h,J0e=new h,got=new h,xot=new h;ir.prototype.showTileThisFrame=function(e,t){let n=0,i=e.data.imagery;for(let a=0,c=i.length;a<c;++a){let d=i[a];l(d.readyImagery)&&d.readyImagery.imageryLayer.alpha!==0&&++n}let o=this._tilesToRenderByTextureCount[n];l(o)||(o=[],this._tilesToRenderByTextureCount[n]=o),o.push(e);let r=e.data;l(r.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let s=this._debug;++s.tilesRendered,s.texturesRendered+=n};var _ot=[new h,new h,new h,new h];function Q0e(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=_ot;return h.fromRadians(n.west,n.south,o,a,c[0]),h.fromRadians(n.east,n.south,o,a,c[1]),h.fromRadians(n.west,n.north,o,a,c[2]),h.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}ir.prototype.computeDistanceToTile=function(e,t){Tot(e,this,t);let n=e.data;if(n.boundingVolumeSourceTile===void 0)return 9999999999;let o=n.tileBoundingRegion,r=o.minimumHeight,s=o.maximumHeight;if(n.boundingVolumeSourceTile!==e){let c=t.camera.positionCartographic.height,d=Math.abs(c-r),u=Math.abs(c-s);d>u?(o.minimumHeight=r,o.maximumHeight=r):(o.minimumHeight=s,o.maximumHeight=s)}let a=o.distanceToCamera(t);return o.minimumHeight=r,o.maximumHeight=s,a};function Tot(e,t,n){let i=e.data;i===void 0&&(i=e.data=new ju);let o=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new Zu({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:o,minimumHeight:0,maximumHeight:0}));let r=i.tileBoundingRegion,s=r.minimumHeight,a=r.maximumHeight,c=!1,d=e,u=0,m=t.marsOptions?.flat;if(m&&m.enabled&&m.rectangles){for(let _=0;_<m.rectangles.length;_++)if(de.intersection(e.rectangle,m.rectangles[_])){u=m.rectangles[_]._flatHeight??m.heights[_];break}}let p=t.marsOptions?.uplift,y=0;if(p&&p.enabled&&p.height!==0&&p.rectangles){for(let _=0;_<p.rectangles.length;_++)if(de.intersection(r.rectangle,p.rectangles[_])){y=p.height;break}}let f=i.mesh,x=i.terrainData;if(f!==void 0&&f.minimumHeight!==void 0&&f.maximumHeight!==void 0)r.minimumHeight=f.minimumHeight,r.maximumHeight=f.maximumHeight,c=!0;else if(x!==void 0&&x._minimumHeight!==void 0&&x._maximumHeight!==void 0)r.minimumHeight=x._minimumHeight,r.maximumHeight=x._maximumHeight;else{r.minimumHeight=Number.NaN,r.maximumHeight=Number.NaN;let _=e.parent;for(;_!==void 0;){let C=_.data;if(C!==void 0){let V=C.mesh,L=C.terrainData;if(V!==void 0&&V.minimumHeight!==void 0&&V.maximumHeight!==void 0){r.minimumHeight=V.minimumHeight,r.maximumHeight=V.maximumHeight;break}else if(L!==void 0&&L._minimumHeight!==void 0&&L._maximumHeight!==void 0){r.minimumHeight=L._minimumHeight,r.maximumHeight=L._maximumHeight;break}}_=_.parent}d=_}if(r.maximumHeight+=y,r.minimumHeight-=u,d!==void 0){let _=n.verticalExaggeration,C=n.verticalExaggerationRelativeHeight;if((_!==1||u!==0)&&(c=!1,r.minimumHeight=Dr.getHeight(r.minimumHeight,_,C),r.maximumHeight=Dr.getHeight(r.maximumHeight,_,C)),c)i.boundingVolumeIsFromMesh||(r._orientedBoundingBox=Xn.clone(f.orientedBoundingBox,r._orientedBoundingBox),r._boundingSphere=ce.clone(f.boundingSphere3D,r._boundingSphere),i.occludeePointInScaledSpace=h.clone(f.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=Q0e(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace)));else{let L=r._orientedBoundingBox===void 0||r._boundingSphere===void 0;(r.minimumHeight!==s||r.maximumHeight!==a||L)&&(r.computeBoundingVolumes(o),i.occludeePointInScaledSpace=Q0e(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=d,i.boundingVolumeIsFromMesh=c}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}ir.prototype.isDestroyed=function(){return!1};ir.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._removeLayerAddedListener=this._removeLayerAddedListener&&this._removeLayerAddedListener(),this._removeLayerRemovedListener=this._removeLayerRemovedListener&&this._removeLayerRemovedListener(),this._removeLayerMovedListener=this._removeLayerMovedListener&&this._removeLayerMovedListener(),this._removeLayerShownListener=this._removeLayerShownListener&&this._removeLayerShownListener(),ue(this)};function Sot(e,t,n){return function(i){let o,r,s=-1,a=i.data.imagery,c=a.length,d;for(d=0;d<c;++d)if(o=a[d],r=g(o.readyImagery,o.loadingImagery),r.imageryLayer===t){s=d;break}if(s!==-1){let u=s+e;if(o=a[u],r=l(o)?g(o.readyImagery,o.loadingImagery):void 0,!l(r)||r.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,u);for(d=s;d<u;++d)a[d].freeResources();a.splice(s,e)}return!0}}ir.prototype._onLayerAdded=function(e,t){if(!this.isDestroyed()&&e.show){let n=this._terrainProvider,i=this,o=this._imageryLayersUpdatedEvent,r=function(){e._imageryCache={},i._quadtree.forEachLoadedTile(function(s){if(l(s._loadedCallbacks[e._layerIndex]))return;let a,c=s.data.imagery,d=c.length,u=-1,m=0;for(a=0;a<d;++a){let y=c[a];if(g(y.readyImagery,y.loadingImagery).imageryLayer===e)u===-1&&(u=a),++m;else if(u!==-1)break}if(u===-1)return;let p=u+m;e._createTileImagerySkeletons(s,n,p)&&(s._loadedCallbacks[e._layerIndex]=Sot(m,e,n),s.state=Hs.LOADING)})};if(e.ready){let s=e.imageryProvider;s._reload=r}this._quadtree.forEachLoadedTile(function(s){e._createTileImagerySkeletons(s,n)&&(s.state=Hs.LOADING,s.level!==0&&(s._lastSelectionResultFrame!==i.quadtree._lastSelectionFrameNumber||s._lastSelectionResult!==$n.RENDERED)&&(s.renderable=!1))}),this._layerOrderChanged=!0,o.raiseEvent()}};ir.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile(function(n){let i=n.data.imagery,o=-1,r=0;for(let s=0,a=i.length;s<a;++s){let c=i[s],d=c.loadingImagery;if(l(d)||(d=c.readyImagery),d.imageryLayer===e)o===-1&&(o=s),c.freeResources(),++r;else if(o!==-1)break}o!==-1&&i.splice(o,r)}),l(e.imageryProvider)&&(e.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()};ir.prototype._onLayerMoved=function(e,t,n){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()};ir.prototype._onLayerShownOrHidden=function(e,t,n){n?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var Cot=new A,Vot=new A;function j0e(e,t){let n={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_atmosphereLightIntensity:function(){return this.properties.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return this.properties.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return this.properties.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return this.properties.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return this.properties.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return this.properties.atmosphereMieAnisotropy},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_nightFadeDistance:function(){return this.properties.nightFadeDistance},u_center3D:function(){return this.properties.center3D},u_verticalExaggerationAndRelativeHeight:function(){return this.properties.verticalExaggerationAndRelativeHeight},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){let i=e.context.uniformState.view,o=A.multiplyByPoint(i,this.properties.rtc,J0e);return A.setTranslation(i,o,z0e),z0e},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,o=e.context.uniformState.projection,r=A.multiplyByPoint(i,this.properties.rtc,J0e);return A.setTranslation(i,r,Hk),A.multiply(o,Hk,Hk),Hk},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_dayTextureNightAlpha:function(){return this.properties.dayTextureNightAlpha},u_dayTextureDayAlpha:function(){return this.properties.dayTextureDayAlpha},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(){let i=t._clippingPlanes;return l(i)&&l(i.texture)?i.texture:e.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){let i=t._clippingPlanes,o=l(i)?A.multiply(e.context.uniformState.view,i.modelMatrix,Cot):A.IDENTITY;return A.inverseTranspose(o,Vot)},u_clippingPlanesEdgeStyle:function(){let i=this.properties.clippingPlanesEdgeColor;return i.alpha=this.properties.clippingPlanesEdgeWidth,i},u_minimumBrightness:function(){return e.fog.minimumBrightness},u_hsbShift:function(){return this.properties.hsbShift},u_colorsToAlpha:function(){return this.properties.colorsToAlpha},u_frontFaceAlphaByDistance:function(){return this.properties.frontFaceAlphaByDistance},u_backFaceAlphaByDistance:function(){return this.properties.backFaceAlphaByDistance},u_translucencyRectangle:function(){return this.properties.localizedTranslucencyRectangle},u_undergroundColor:function(){return this.properties.undergroundColor},u_undergroundColorAlphaByDistance:function(){return this.properties.undergroundColorAlphaByDistance},u_lambertDiffuseMultiplier:function(){return this.properties.lambertDiffuseMultiplier},u_vertexShadowDarkness:function(){return this.properties.vertexShadowDarkness},u_mars3dTextureInvertColor:function(){return this.properties.mars3dTextureInvertColor},u_mars3dTextureFilterColor:function(){return this.properties.mars3dTextureFilterColor},u_mars_inverseTileWidth:function(){return this.properties.mars_inverseTileWidth},u_mars_cartographicTileRectangle:function(){return this.properties.mars_cartographicTileRectangle},u_mars_flat_enabled:function(){return this.properties.mars_flat_enabled},u_mars_flat_rectangle:function(){return this.properties.mars_flat_rectangle},u_mars_flat_texture:function(){return l(this.properties.mars_flat_texture)?this.properties.mars_flat_texture:e.context.defaultTexture},u_mars_uplift_enabled:function(){return this.properties.mars_uplift_enabled},u_mars_uplift_hideInsideOrOutside:function(){return this.properties.mars_uplift_hideInsideOrOutside},u_mars_uplift_rectangle:function(){return this.properties.mars_uplift_rectangle},u_mars_uplift_texture:function(){return l(this.properties.mars_uplift_texture)?this.properties.mars_uplift_texture:e.context.defaultTexture},u_mars_clip_enabled:function(){return this.properties.mars_clip_enabled},u_mars_clip_rectangle:function(){return this.properties.mars_clip_rectangle},u_mars_clip_texture:function(){return l(this.properties.mars_clip_texture)?this.properties.mars_clip_texture:e.context.defaultTexture},u_mars_clip_only:function(){return this.properties.mars_clip_only},u_mars_flood_enabled:function(){return this.properties.mars_flood_enabled},u_mars_flood_rectangle:function(){return this.properties.mars_flood_rectangle},u_mars_flood_texture:function(){return l(this.properties.mars_flood_texture)?this.properties.mars_flood_texture:e.context.defaultTexture},u_mars_flood_only:function(){return this.properties.mars_flood_only},properties:{initialColor:new se(0,0,.5,1),fillHighlightColor:new O(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new B(65e5,9e6),nightFadeDistance:new B(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new h(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new h(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new h,center3D:void 0,rtc:new h,modifiedModelView:new A,tileRectangle:new se,verticalExaggerationAndRelativeHeight:new B(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new B,southMercatorYAndOneOverHeight:new B,waterMask:void 0,waterMaskTranslationAndScale:new se,minMaxHeight:new B,scaleAndBias:new A,clippingPlanesEdgeColor:O.clone(O.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new se,frontFaceAlphaByDistance:new se,backFaceAlphaByDistance:new se,localizedTranslucencyRectangle:new se,undergroundColor:O.clone(O.TRANSPARENT),undergroundColorAlphaByDistance:new se,lambertDiffuseMultiplier:0,vertexShadowDarkness:0,mars3dTextureInvertColor:[],mars3dTextureFilterColor:[],mars_inverseTileWidth:0,mars_cartographicTileRectangle:void 0,mars_flat_enabled:!1,mars_flat_rectangle:new se,mars_flat_texture:void 0,mars_uplift_enabled:!1,mars_uplift_hideInsideOrOutside:!1,mars_uplift_rectangle:new se,mars_uplift_texture:void 0,mars_clip_enabled:!1,mars_clip_rectangle:new se,mars_clip_texture:void 0,mars_clip_only:!1,mars_flood_enabled:!1,mars_flood_rectangle:new se,mars_flood_texture:void 0,mars_flood_only:!1}};return l(t.materialUniformMap)?Tt(n,t.materialUniformMap):n}function Lot(e,t,n){let i=n.data,o,r;if(l(i.vertexArray)?(o=i.mesh,r=i.vertexArray):l(i.fill)&&l(i.fill.vertexArray)&&(o=i.fill.mesh,r=i.fill.vertexArray),!(!l(o)||!l(r))){if(l(i.wireframeVertexArray)){if(i.wireframeVertexArray.mesh===o)return;i.wireframeVertexArray.destroy(),i.wireframeVertexArray=void 0}i.wireframeVertexArray=Rot(e,r,o),i.wireframeVertexArray.mesh=o}}function Rot(e,t,n){let o={indices:n.indices,primitiveType:Ae.TRIANGLES};Mn.toWireframe(o);let r=o.indices,s=ft.createIndexBuffer({context:e,typedArray:r,usage:Ue.STATIC_DRAW,indexDatatype:Ne.fromSizeInBytes(r.BYTES_PER_ELEMENT)});return new oi({context:e,attributes:t._attributes,indexBuffer:s})}var nbe,ibe,zk;(function(){let e=new St({geometry:bm.fromDimensions({dimensions:new h(2,2,2)})}),t=new St({geometry:new m0({radius:1})}),n=new A,i,o;function r(s){return new En({geometryInstances:s,appearance:new cn({translucent:!1,flat:!0}),asynchronous:!1})}nbe=function(s,a){return s===i||(zk(),i=s,n=A.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=Ot.fromColor(a),o=r(e)),o},ibe=function(s,a){return s===i||(zk(),i=s,n=A.fromTranslation(s.center,n),n=A.multiplyByUniformScale(n,s.radius,n),t.modelMatrix=n,t.attributes.color=Ot.fromColor(a),o=r(t)),o},zk=function(){l(o)&&(o.destroy(),o=void 0,i=void 0)}})();var Zot=new se(0,0,0,0),Got={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,applyDayNightAlpha:void 0,applySplit:void 0,showReflectiveOcean:void 0,showOceanWaves:void 0,enableLighting:void 0,dynamicAtmosphereLighting:void 0,dynamicAtmosphereLightingFromSun: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,hasGeodeticSurfaceNormals:void 0,hasExaggeration:void 0},Eot=O.TRANSPARENT,Iot=new vt;function q0e(e,t,n,i){let o=t.data;l(o.vertexArray)||(o.fill===void 0&&(o.fill=new EV(t)),o.fill.update(e,n));let r=n.creditDisplay,s=o.terrainData;if(l(s)&&l(s.credits)){let ct=s.credits;for(let Jt=0,mi=ct.length;Jt<mi;++Jt)r.addCreditToNextFrame(ct[Jt])}let a=Yt.maximumTextureImageUnits,c=o.waterMaskTexture,d=o.waterMaskTranslationAndScale;!l(c)&&l(o.fill)&&(c=o.fill.waterMaskTexture,d=o.fill.waterMaskTranslationAndScale);let u=n.cameraUnderground,m=n.globeTranslucencyState,p=m.translucent,y=m.frontFaceAlphaByDistance,f=m.backFaceAlphaByDistance,x=m.rectangle,_=g(e.undergroundColor,Eot),C=g(e.undergroundColorAlphaByDistance,Iot),V=tbe(e,n)&&n.mode===ie.SCENE3D&&_.alpha>0&&(C.nearValue>0||C.farValue>0),L=e.lambertDiffuseMultiplier,Z=e.vertexShadowDarkness,G=e.hasWaterMask&&l(c),I=e.oceanNormalMap,P=G&&l(I),v=e.terrainProvider,F=l(v)&&e.terrainProvider.hasVertexNormals,M=n.fog.enabled&&n.fog.renderable&&!u,b=e.showGroundAtmosphere&&n.mode===ie.SCENE3D,R=Cn.castShadows(e.shadows)&&!p,E=Cn.receiveShadows(e.shadows)&&!p,X=e.hueShift,w=e.saturationShift,N=e.brightnessShift,D=!(W.equalsEpsilon(X,0,W.EPSILON7)&&W.equalsEpsilon(w,0,W.EPSILON7)&&W.equalsEpsilon(N,0,W.EPSILON7)),k=!1;if(b){let ct=h.magnitude(n.camera.positionWC),Jt=e.nightFadeOutDistance;k=ct>Jt}G&&--a,P&&--a,l(n.shadowState)&&n.shadowState.shadowsEnabled&&--a,l(e.clippingPlanes)&&e.clippingPlanes.enabled&&--a,a-=m.numberOfTextureUniforms;let Y=o.renderedMesh,U=Y.center,J=Y.encoding,K=o.tileBoundingRegion,ee=n.verticalExaggeration,H=n.verticalExaggerationRelativeHeight,j=e.marsOptions?.uplift;i&&j&&(H=n.verticalExaggerationRelativeHeight-j.height/(ee-1),--a),e.marsOptions?.clip?.enabled&&--a,e.marsOptions?.flat?.enabled&&--a,e.marsOptions?.flood?.enabled&&--a;let $=ee!==1,pe=J.hasGeodeticSurfaceNormals,ge=fot,ae=0,be=0,_e=0,Ze=0,Le=!1;if(n.mode!==ie.SCENE3D){let ct=n.mapProjection,Jt=ct.project(de.southwest(t.rectangle),got),mi=ct.project(de.northeast(t.rectangle),xot);if(ge.x=Jt.x,ge.y=Jt.y,ge.z=mi.x,ge.w=mi.y,n.mode!==ie.MORPHING&&(U=yot,U.x=0,U.y=(ge.z+ge.x)*.5,U.z=(ge.w+ge.y)*.5,ge.x-=U.y,ge.y-=U.z,ge.z-=U.y,ge.w-=U.z),n.mode===ie.SCENE2D&&J.quantization===Ys.BITS12){let Ke=1/(Math.pow(2,12)-1)*.5,$r=(ge.z-ge.x)*Ke,es=(ge.w-ge.y)*Ke;ge.x-=$r,ge.y-=es,ge.z+=$r,ge.w+=es}ct instanceof Gi&&(ae=t.rectangle.south,be=t.rectangle.north,_e=Gi.geodeticLatitudeToMercatorAngle(ae),Ze=1/(Gi.geodeticLatitudeToMercatorAngle(be)-_e),Le=!0)}let Ee=Got;Ee.frameState=n,Ee.surfaceTile=o,Ee.showReflectiveOcean=G,Ee.showOceanWaves=P,Ee.enableLighting=e.enableLighting,Ee.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,Ee.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,Ee.showGroundAtmosphere=b,Ee.atmosphereLightIntensity=e.atmosphereLightIntensity,Ee.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Ee.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Ee.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Ee.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Ee.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Ee.perFragmentGroundAtmosphere=k,Ee.hasVertexNormals=F,Ee.useWebMercatorProjection=Le,Ee.clippedByBoundaries=o.clippedByBoundaries,Ee.hasGeodeticSurfaceNormals=pe,Ee.hasExaggeration=$;let He=o.imagery,we=0,dt=He.length,bt=e.showSkirts&&!u&&!p,it=e.backFaceCulling&&!u&&!p,en=it?e._renderState:e._disableCullingRenderState,_n=it?e._blendRenderState:e._disableCullingBlendRenderState,kt=en,At=e._firstPassInitialColor,Te=n.context;if(l(e._debug.boundingSphereTile)||zk(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let ct=e._drawCommands.length;for(let Jt=0;Jt<ct;++Jt)e._uniformMaps[Jt]=j0e(n,e)}do{let ct=0,Jt,mi;if(e._drawCommands.length<=e._usedDrawCommands?(Jt=new nt,Jt.owner=t,Jt.cull=!1,Jt.boundingVolume=new ce,Jt.orientedBoundingBox=void 0,mi=j0e(n,e),e._drawCommands.push(Jt),e._uniformMaps.push(mi)):(Jt=e._drawCommands[e._usedDrawCommands],mi=e._uniformMaps[e._usedDrawCommands]),Jt.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let ts=K.boundingVolume,ns=K.boundingSphere;l(ts)?nbe(ts,O.RED).update(n):l(ns)&&ibe(ns,O.RED).update(n)}let Ke=mi.properties;se.clone(At,Ke.initialColor),Ke.oceanNormalMap=I,Ke.lightingFadeDistance.x=e.lightingFadeOutDistance,Ke.lightingFadeDistance.y=e.lightingFadeInDistance,Ke.nightFadeDistance.x=e.nightFadeOutDistance,Ke.nightFadeDistance.y=e.nightFadeInDistance,Ke.atmosphereLightIntensity=e.atmosphereLightIntensity,Ke.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Ke.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Ke.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Ke.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Ke.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Ke.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let $r=u?f:y,es=u?y:f;l($r)&&(se.fromElements($r.near,$r.nearValue,$r.far,$r.farValue,Ke.frontFaceAlphaByDistance),se.fromElements(es.near,es.nearValue,es.far,es.farValue,Ke.backFaceAlphaByDistance)),se.fromElements(C.near,C.nearValue,C.far,C.farValue,Ke.undergroundColorAlphaByDistance),O.clone(_,Ke.undergroundColor),Ke.lambertDiffuseMultiplier=L,Ke.vertexShadowDarkness=Z;let ga=!l(o.vertexArray)&&l(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;ga&&O.clone(e.fillHighlightColor,Ke.fillHighlightColor),Ke.verticalExaggerationAndRelativeHeight.x=ee,Ke.verticalExaggerationAndRelativeHeight.y=H,Ke.center3D=Y.center,h.clone(U,Ke.rtc),se.clone(ge,Ke.tileRectangle),Ke.southAndNorthLatitude.x=ae,Ke.southAndNorthLatitude.y=be,Ke.southMercatorYAndOneOverHeight.x=_e,Ke.southMercatorYAndOneOverHeight.y=Ze;let ms=pot,Fe=Kk(t.rectangle,e.cartographicLimitRectangle),rt=bot,qe=Kk(t.rectangle,x);h.fromElements(X,w,N,Ke.hsbShift);let Ye=t.rectangle,ht=1/Ye.width,Dt=1/Ye.height;ms.x=(Fe.west-Ye.west)*ht,ms.y=(Fe.south-Ye.south)*Dt,ms.z=(Fe.east-Ye.west)*ht,ms.w=(Fe.north-Ye.south)*Dt,se.clone(ms,Ke.localizedCartographicLimitRectangle),rt.x=(qe.west-Ye.west)*ht,rt.y=(qe.south-Ye.south)*Dt,rt.z=(qe.east-Ye.west)*ht,rt.w=(qe.north-Ye.south)*Dt,Ke.mars_inverseTileWidth=ht,Ke.mars_cartographicTileRectangle=new B(Ye.west,Ye.south);let fn=e.marsOptions?.clip;fn?(fn.rectangle?Ke.mars_clip_rectangle=new se(fn.rectangle.west,fn.rectangle.south,fn.rectangle.width,fn.rectangle.height):Ke.mars_clip_rectangle=new se,Ke.mars_clip_texture=fn.texture,Ke.mars_clip_only=fn.onlySelf,Ke.mars_clip_enabled=fn.enabled):(Ke.mars_clip_enabled=!1,Ke.mars_clip_rectangle=new se,Ke.mars_clip_texture=void 0,Ke.mars_clip_only=!1);let jn=e.marsOptions?.flood;jn?(jn.rectangle?Ke.mars_flood_rectangle=new se(jn.rectangle.west,jn.rectangle.south,jn.rectangle.width,jn.rectangle.height):Ke.mars_flood_rectangle=new se,Ke.mars_flood_texture=jn.texture,Ke.mars_flood_only=jn.onlySelf,Ke.mars_flood_enabled=jn.enabled):(Ke.mars_flood_enabled=!1,Ke.mars_flood_rectangle=new se,Ke.mars_flood_texture=void 0);let ki=e.marsOptions?.flat;ki?(ki.rectangle?Ke.mars_flat_rectangle=new se(ki.rectangle.west,ki.rectangle.south,ki.rectangle.width,ki.rectangle.height):Ke.mars_flat_rectangle=new se,Ke.mars_flat_texture=ki.texture,Ke.mars_flat_enabled=ki.enabled):(Ke.mars_flat_enabled=!1,Ke.mars_flat_rectangle=new se,Ke.mars_flat_texture=void 0);let Lo=e.marsOptions?.uplift;Lo?(Lo.rectangle?Ke.mars_uplift_rectangle=new se(Lo.rectangle.west,Lo.rectangle.south,Lo.rectangle.width,Lo.rectangle.height):Ke.mars_uplift_rectangle=new se,Ke.mars_uplift_texture=Lo.texture,Ke.mars_uplift_enabled=(!Lo.showUp||Lo.enabled&&Lo.height!==0)&&l(Lo.rectangles)&&Lo.rectangles.length>0,Ke.mars_uplift_hideInsideOrOutside=!i):(Ke.mars_uplift_enabled=!1,Ke.mars_uplift_rectangle=new se,Ke.mars_uplift_texture=void 0,Ke.mars_uplift_hideInsideOrOutside=!1),se.clone(rt,Ke.localizedTranslucencyRectangle);let Is=M&&W.fog(t._distance,n.fog.density)>W.EPSILON3;D=D&&(Is||b);let fr=!1,Ji=!1,hs=!1,Jn=!1,Un=!1,un=!1,fi=!1,Qi=!1,fs=!1,po=!1,Rc=!1,jd=!1;for(;ct<a&&we<dt;){let ts=He[we],ns=ts.readyImagery;if(++we,!l(ns)||ns.imageryLayer.alpha===0)continue;let zs=ts.useWebMercatorT?ns.textureWebMercator:ns.texture,ji=ns.imageryLayer;l(ts.textureTranslationAndScale)||(ts.textureTranslationAndScale=ji._calculateTextureTranslationAndScale(t,ts)),Ke.dayTextures[ct]=zs,Ke.dayTextureTranslationAndScale[ct]=ts.textureTranslationAndScale,Ke.dayTextureTexCoordsRectangle[ct]=ts.textureCoordinateRectangle,Ke.dayTextureUseWebMercatorT[ct]=ts.useWebMercatorT,Ke.dayTextureAlpha[ct]=ji.alpha,un=un||Ke.dayTextureAlpha[ct]!==1,Ke.dayTextureNightAlpha[ct]=ji.nightAlpha,fi=fi||Ke.dayTextureNightAlpha[ct]!==1,Ke.dayTextureDayAlpha[ct]=ji.dayAlpha,fi=fi||Ke.dayTextureDayAlpha[ct]!==1,Ke.dayTextureBrightness[ct]=ji.brightness,fr=fr||Ke.dayTextureBrightness[ct]!==ua.DEFAULT_BRIGHTNESS,Ke.dayTextureContrast[ct]=ji.contrast,Ji=Ji||Ke.dayTextureContrast[ct]!==ua.DEFAULT_CONTRAST,Ke.dayTextureHue[ct]=ji.hue,hs=hs||Ke.dayTextureHue[ct]!==ua.DEFAULT_HUE,Ke.dayTextureSaturation[ct]=ji.saturation,Jn=Jn||Ke.dayTextureSaturation[ct]!==ua.DEFAULT_SATURATION,Ke.dayTextureOneOverGamma[ct]=1/ji.gamma,Un=Un||Ke.dayTextureOneOverGamma[ct]!==1/ua.DEFAULT_GAMMA,Ke.dayTextureSplit[ct]=ji.splitDirection,Qi=Qi||Ke.dayTextureSplit[ct]!==0,Rc=Rc||!!ji.invertColor,Ke.mars3dTextureInvertColor[ct]=!!ji.invertColor,jd=jd||!!ji.filterColor,ji.filterColor?Ke.mars3dTextureFilterColor[ct]=new h(ji.filterColor.red,ji.filterColor.green,ji.filterColor.blue):Ke.mars3dTextureFilterColor[ct]=new h(1,1,1);let ll=Ke.dayTextureCutoutRectangles[ct];if(l(ll)||(ll=Ke.dayTextureCutoutRectangles[ct]=new se),se.clone(se.ZERO,ll),l(ji.cutoutRectangle)){let Zc=Kk(Ye,ji.cutoutRectangle),Pg=de.simpleIntersection(Zc,Ye,ebe);fs=l(Pg)||fs,ll.x=(Zc.west-Ye.west)*ht,ll.y=(Zc.south-Ye.south)*Dt,ll.z=(Zc.east-Ye.west)*ht,ll.w=(Zc.north-Ye.south)*Dt}let jl=Ke.colorsToAlpha[ct];l(jl)||(jl=Ke.colorsToAlpha[ct]=new se);let gL=l(ji.colorToAlpha)&&ji.colorToAlphaThreshold>0;if(po=po||gL,gL){let Zc=ji.colorToAlpha;jl.x=Zc.red,jl.y=Zc.green,jl.z=Zc.blue,jl.w=ji.colorToAlphaThreshold}else jl.w=-1;if(l(ns.credits)){let Zc=ns.credits;for(let Pg=0,xL=Zc.length;Pg<xL;++Pg)r.addCreditToNextFrame(Zc[Pg])}++ct}Ke.dayTextures.length=ct,Ke.waterMask=c,se.clone(d,Ke.waterMaskTranslationAndScale),Ke.minMaxHeight.x=J.minimumHeight,Ke.minMaxHeight.y=J.maximumHeight,A.clone(J.matrix,Ke.scaleAndBias);let Ql=e._clippingPlanes,Wg=l(Ql)&&Ql.enabled&&t.isClipped;Wg&&(Ke.clippingPlanesEdgeColor=O.clone(Ql.edgeColor,Ke.clippingPlanesEdgeColor),Ke.clippingPlanesEdgeWidth=Ql.edgeWidth),Ee.numberOfDayTextures=ct,Ee.applyBrightness=fr,Ee.applyContrast=Ji,Ee.applyHue=hs,Ee.applySaturation=Jn,Ee.applyGamma=Un,Ee.applyAlpha=un,Ee.applyDayNightAlpha=fi,Ee.applySplit=Qi,Ee.enableFog=Is,Ee.enableClippingPlanes=Wg,Ee.clippingPlanes=Ql,Ee.hasImageryLayerCutout=fs,Ee.colorCorrect=D,Ee.highlightFillTile=ga,Ee.colorToAlpha=po,Ee.showUndergroundColor=V,Ee.translucent=p,Ee.marsOptions={invertColor:Rc,filterColor:jd,enableUplift:e?._marsOptions?.uplift?.enabled,enableFlat:e?._marsOptions?.flat?.enabled,enableClip:e?._marsOptions?.clip?.enabled,enableFlood:e?._marsOptions?.flood?.enabled};let wh=o.renderedMesh.indices.length;bt||(wh=o.renderedMesh.indexCountWithoutSkirts),Jt.shaderProgram=e._surfaceShaderSet.getShaderProgram(Ee),Jt.castShadows=R,Jt.receiveShadows=E,Jt.renderState=kt,Jt.primitiveType=Ae.TRIANGLES,Jt.vertexArray=o.vertexArray||o.fill.vertexArray,Jt.count=wh,Jt.uniformMap=mi,Jt.pass=Ve.GLOBE,e._debug.wireframe&&(Lot(Te,e,t),l(o.wireframeVertexArray)&&(Jt.vertexArray=o.wireframeVertexArray,Jt.primitiveType=Ae.LINES,Jt.count=wh*2));let cl=Jt.boundingVolume,Fh=Jt.orientedBoundingBox;n.mode!==ie.SCENE3D?(ce.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,K.minimumHeight,K.maximumHeight,cl),h.fromElements(cl.center.z,cl.center.x,cl.center.y,cl.center),n.mode===ie.MORPHING&&(cl=ce.union(K.boundingSphere,cl,cl))):(Jt.boundingVolume=ce.clone(K.boundingSphere,cl),Jt.orientedBoundingBox=Xn.clone(K.boundingVolume,Fh)),Jt.dirty=!0,p&&m.updateDerivedCommands(Jt,n),$0e(Jt,n),kt=_n,At=Zot}while(we<dt)}var lw=ir;var xSi=T(S(),1);function obe(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=de.clone(de.MAX_VALUE)}Object.defineProperties(obe.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabled=e}},frontFaceAlpha:{get:function(){return this._frontFaceAlpha},set:function(e){this._frontFaceAlpha=e}},frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance},set:function(e){this._frontFaceAlphaByDistance=vt.clone(e,this._frontFaceAlphaByDistance)}},backFaceAlpha:{get:function(){return this._backFaceAlpha},set:function(e){this._backFaceAlpha=e}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance},set:function(e){this._backFaceAlphaByDistance=vt.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){l(e)||(e=de.clone(de.MAX_VALUE)),de.clone(e,this._rectangle)}}});var dw=obe;var GSi=T(S(),1);function Gs(){this._layers=[],this.layerAdded=new ye,this.layerRemoved=new ye,this.layerMoved=new ye,this.layerShownOrHidden=new ye}Object.defineProperties(Gs.prototype,{length:{get:function(){return this._layers.length}}});Gs.prototype.add=function(e,t){l(t)?this._layers.splice(t,0,e):(t=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,t);let i=e.readyEvent.addEventListener(()=>{this.layerShownOrHidden.raiseEvent(e,e._layerIndex,e.show),i()})};Gs.prototype.addImageryProvider=function(e,t){let n=new ua(e);return this.add(n,t),n};Gs.prototype.remove=function(e,t){t=g(t,!0);let n=this._layers.indexOf(e);return n!==-1?(this._layers.splice(n,1),this._update(),this.layerRemoved.raiseEvent(e,n),t&&e.destroy(),!0):!1};Gs.prototype.removeAll=function(e){e=g(e,!0);let t=this._layers;for(let n=0,i=t.length;n<i;n++){let o=t[n];this.layerRemoved.raiseEvent(o,n),e&&o.destroy()}this._layers=[]};Gs.prototype.contains=function(e){return this.indexOf(e)!==-1};Gs.prototype.indexOf=function(e){return this._layers.indexOf(e)};Gs.prototype.get=function(e){return this._layers[e]};function Jk(e,t){return e.indexOf(t)}function rbe(e,t,n){let i=e._layers;if(t=W.clamp(t,0,i.length-1),n=W.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,e._update(),e.layerMoved.raiseEvent(o,n,t)}Gs.prototype.raise=function(e){let t=Jk(this._layers,e);rbe(this,t,t+1)};Gs.prototype.lower=function(e){let t=Jk(this._layers,e);rbe(this,t,t-1)};Gs.prototype.raiseToTop=function(e){let t=Jk(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))};Gs.prototype.lowerToBottom=function(e){let t=Jk(this._layers,e);t!==0&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))};var Xot=new de;function sbe(e,t,n,i){let o=e.globe._surface._tilesToRender,r;for(let a=0;!l(r)&&a<o.length;++a){let c=o[a];de.contains(c.rectangle,t)&&(r=c)}if(!l(r))return;let s=r.data.imagery;for(let a=s.length-1;a>=0;--a){let c=s[a],d=c.readyImagery;if(!l(d)||!d.imageryLayer.ready)continue;let u=d.imageryLayer.imageryProvider;if(n&&!l(u.pickFeatures)||!de.contains(d.rectangle,t))continue;let m=Xot,p=1/1024;m.west=W.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.x-p),m.east=W.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.z+p),m.south=W.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.y-p),m.north=W.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.w+p),de.contains(m,t)&&i(d)}}Gs.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.globe.ellipsoid.cartesianToCartographic(n),o=[];if(sbe(t,i,!1,function(r){o.push(r.imageryLayer)}),o.length!==0)return o};Gs.prototype.pickImageryLayerFeatures=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.globe.ellipsoid.cartesianToCartographic(n),o=[],r=[];if(sbe(t,i,!0,function(s){if(!s.imageryLayer.ready)return;let a=s.imageryLayer.imageryProvider;for(let d=0;d<r.length;d++)if(r[d]===s.imageryLayer)return;let c=a.pickFeatures(s.x,s.y,s.level,i.longitude,i.latitude);l(c)&&(o.push(c),r.push(s.imageryLayer))}),o.length!==0)return Promise.all(o).then(function(s){let a=[];for(let c=0;c<s.length;++c){let d=s[c],u=r[c];if(l(d)&&d.length>0)for(let m=0;m<d.length;++m){let p=d[m];p.imageryLayer=u,l(p.position)||(p.position=i),a.push(p)}}return a})};Gs.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};Gs.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};Gs.prototype.isDestroyed=function(){return!1};Gs.prototype.destroy=function(){return this.removeAll(!0),ue(this)};Gs.prototype._update=function(){let e=!0,t=this._layers,n,i,o,r;for(o=0,r=t.length;o<r;++o)i=t[o],i._layerIndex=o,i.show?(i._isBaseLayer=e,e=!1):i._isBaseLayer=!1,i.show!==i._show&&(l(i._show)&&(l(n)||(n=[]),n.push(i)),i._show=i.show);if(l(n))for(o=0,r=n.length;o<r;++o)i=n[o],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)};var uw=Gs;var cCi=T(S(),1);var WSi=T(S(),1);function abe(e){this._ellipsoid=new qm(e.ellipsoid,h.ZERO)}Object.defineProperties(abe.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var mw=abe;var MSi=T(S(),1);function tl(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=$n.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this.state=Hs.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}tl.createLevelZeroTiles=function(e){let t=e.getNumberOfXTilesAtLevel(0),n=e.getNumberOfYTilesAtLevel(0),i=new Array(t*n),o=0;for(let r=0;r<n;++r)for(let s=0;s<t;++s)i[o++]=new tl({tilingScheme:e,x:s,y:r,level:0});return i};tl.prototype._updateCustomData=function(e,t,n){let i=this.customData,o,r,s;if(l(t)&&l(n)){for(i=i.filter(function(a){return n.indexOf(a)===-1}),this._customData=i,s=this._rectangle,o=0;o<t.length;++o)r=t[o],de.contains(s,r.positionCartographic)&&i.push(r);this._frameUpdated=e}else{let a=this._parent;if(l(a)&&this._frameUpdated!==a._frameUpdated){i.length=0,s=this._rectangle;let c=a.customData;for(o=0;o<c.length;++o)r=c[o],de.contains(s,r.positionCartographic)&&i.push(r);this._frameUpdated=a._frameUpdated}}};Object.defineProperties(tl.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 l(this._southwestChild)||(this._southwestChild=new tl({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return l(this._southeastChild)||(this._southeastChild=new tl({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2+1,level:this.level+1,parent:this})),this._southeastChild}},northwestChild:{get:function(){return l(this._northwestChild)||(this._northwestChild=new tl({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return l(this._northeastChild)||(this._northeastChild=new tl({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2,level:this.level+1,parent:this})),this._northeastChild}},customData:{get:function(){return this._customData}},needsLoading:{get:function(){return this.state<Hs.DONE}},eligibleForUnloading:{get:function(){let e=!0;return l(this.data)&&(e=this.data.eligibleForUnloading,l(e)||(e=!0)),e}}});tl.prototype.findLevelZeroTile=function(e,t,n){let i=this.tilingScheme.getNumberOfXTilesAtLevel(0);if(t<0?t+=i:t>=i&&(t-=i),!(n<0||n>=this.tilingScheme.getNumberOfYTilesAtLevel(0)))return e.filter(function(o){return o.x===t&&o.y===n})[0]};tl.prototype.findTileToWest=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x-1,this.y);if(t.southeastChild===this)return t.southwestChild;if(t.northeastChild===this)return t.northwestChild;let n=t.findTileToWest(e);if(n!==void 0)return t.southwestChild===this?n.southeastChild:n.northeastChild};tl.prototype.findTileToEast=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x+1,this.y);if(t.southwestChild===this)return t.southeastChild;if(t.northwestChild===this)return t.northeastChild;let n=t.findTileToEast(e);if(n!==void 0)return t.southeastChild===this?n.southwestChild:n.northwestChild};tl.prototype.findTileToSouth=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x,this.y+1);if(t.northwestChild===this)return t.southwestChild;if(t.northeastChild===this)return t.southeastChild;let n=t.findTileToSouth(e);if(n!==void 0)return t.southwestChild===this?n.northwestChild:n.northeastChild};tl.prototype.findTileToNorth=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x,this.y-1);if(t.southwestChild===this)return t.northwestChild;if(t.southeastChild===this)return t.northeastChild;let n=t.findTileToNorth(e);if(n!==void 0)return t.northwestChild===this?n.southwestChild:n.southeastChild};tl.prototype.freeResources=function(){this.state=Hs.START,this.renderable=!1,this.upsampledFromParent=!1,l(this.data)&&l(this.data.freeResources)&&this.data.freeResources(),Qk(this._southwestChild),this._southwestChild=void 0,Qk(this._southeastChild),this._southeastChild=void 0,Qk(this._northwestChild),this._northwestChild=void 0,Qk(this._northeastChild),this._northeastChild=void 0};function Qk(e){l(e)&&e.freeResources()}var hw=tl;var kSi=T(S(),1);function jk(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}jk.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};jk.prototype.trimTiles=function(e){let t=this.tail,n=!0;for(;n&&l(this._lastBeforeStartOfFrame)&&this.count>e&&l(t);){n=t!==this._lastBeforeStartOfFrame;let i=t.replacementPrevious;t.eligibleForUnloading&&(t.freeResources(),cbe(this,t)),t=i}};function cbe(e,t){let n=t.replacementPrevious,i=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=i),t===e.head?e.head=i:n.replacementNext=i,t===e.tail?e.tail=n:i.replacementPrevious=n,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}jk.prototype.markTileRendered=function(e){let t=this.head;if(t===e){e===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=e.replacementNext);return}if(++this.count,!l(t)){e.replacementPrevious=void 0,e.replacementNext=void 0,this.head=e,this.tail=e;return}(l(e.replacementPrevious)||l(e.replacementNext))&&cbe(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var fw=jk;function $u(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};let n=this._tileProvider.tilingScheme.ellipsoid;this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new fw,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=g(e.maximumScreenSpaceError,2),this.tileCacheSize=g(e.tileCacheSize,100),this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new mw({ellipsoid:n}),this._tileLoadProgressEvent=new ye,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties($u.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});$u.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function Wot(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,dbe(e);let n=e._levelZeroTiles;if(l(n))for(let i=0;i<n.length;++i){let r=n[i].customData,s=r.length;for(let a=0;a<s;++a){let c=r[a];c.level=0,e._addHeightCallbacks.push(c)}n[i].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}$u.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==Hs.START&&e(t),t=t.replacementNext};$u.prototype.forEachRenderedTile=function(e){let t=this._tilesToRender;for(let n=0,i=t.length;n<i;++n)e(t[n])};$u.prototype.updateHeight=function(e,t){let n=this,i={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return i.removeFunc=function(){let o=n._addHeightCallbacks,r=o.length;for(let s=0;s<r;++s)if(o[s]===i){o.splice(s,1);break}n._removeHeightCallbacks.push(i),i.callback&&(i.callback=void 0)},n._addHeightCallbacks.push(i),i.removeFunc};$u.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function dbe(e){let 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}$u.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(Wot(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),dbe(this),!this._debug.suspendLodUpdate&&this._tileReplacementQueue.markStartOfRenderFrame())};$u.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),Fot(this,e),Hot(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function Pot(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let o=ye.prototype.raiseEvent.bind(e._tileLoadProgressEvent,n);t.afterRender.push(()=>(o(),!0)),e._lastTileLoadQueueLength=n}let i=e._debug;i.enableDebugOutput&&!i.suspendLodUpdate&&(i.maxDepth=e._tilesToRender.reduce(function(o,r){return Math.max(o,r.level)},-1),i.tilesRendered=e._tilesToRender.length,(i.tilesVisited!==i.lastTilesVisited||i.tilesRendered!==i.lastTilesRendered||i.tilesCulled!==i.lastTilesCulled||i.maxDepth!==i.lastMaxDepth||i.tilesWaitingForChildren!==i.lastTilesWaitingForChildren||i.maxDepthVisited!==i.lastMaxDepthVisited)&&(console.log(`Visited ${i.tilesVisited}, Rendered: ${i.tilesRendered}, Culled: ${i.tilesCulled}, Max Depth Rendered: ${i.maxDepth}, Max Depth Visited: ${i.maxDepthVisited}, Waiting for children: ${i.tilesWaitingForChildren}`),i.lastTilesVisited=i.tilesVisited,i.lastTilesRendered=i.tilesRendered,i.lastTilesCulled=i.tilesCulled,i.lastMaxDepth=i.maxDepth,i.lastTilesWaitingForChildren=i.tilesWaitingForChildren,i.lastMaxDepthVisited=i.maxDepthVisited))}$u.prototype.endFrame=function(e){!e.passes.render||e.mode===ie.MORPHING||(Dot(this,e),Yot(this,e),Pot(this,e))};$u.prototype.isDestroyed=function(){return!1};$u.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var bw,lbe=new he;function vot(e,t){let n=de.center(e.rectangle,lbe),i=n.longitude-bw.longitude,o=n.latitude-bw.latitude;n=de.center(t.rectangle,lbe);let r=n.longitude-bw.longitude,s=n.latitude-bw.latitude;return i*i+o*o-(r*r+s*s)}var wot=new h,pw=[];function Fot(e,t){let n=e._debug;if(n.suspendLodUpdate)return;let i=e._tilesToRender;i.length=0;let o,r=e._tileProvider;if(!l(e._levelZeroTiles)){let x=r.tilingScheme;if(l(x)){let _=r.tilingScheme;e._levelZeroTiles=hw.createLevelZeroTiles(_);let C=e._levelZeroTiles.length;if(pw.length<C)for(pw=new Array(C),o=0;o<C;++o)pw[o]===void 0&&(pw[o]=new yw)}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let s,a=e._levelZeroTiles,c=a.length>1?e._occluders:void 0;bw=t.camera.positionCartographic,a.sort(vot);let d=e._addHeightCallbacks,u=e._removeHeightCallbacks,m=t.frameNumber,p;if(d.length>0||u.length>0){for(o=0,p=a.length;o<p;++o)s=a[o],s._updateCustomData(m,d,u);d.length=0,u.length=0}let y=t.camera;e._cameraPositionCartographic=y.positionCartographic;let f=A.getTranslation(y.transform,wot);for(e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(f,e._cameraReferenceFrameOriginCartographic),o=0,p=a.length;o<p;++o)s=a[o],e._tileReplacementQueue.markTileRendered(s),s.renderable?Fa(e,s,r,t,c,!1,pw[o]):(Q0(e,e._tileLoadQueueHigh,s,t),++n.tilesWaitingForChildren);e._lastSelectionFrameNumber=m}function Q0(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function yw(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function ube(){this.southwest=new yw,this.southeast=new yw,this.northwest=new yw,this.northeast=new yw}ube.prototype.combine=function(e){let t=this.southwest,n=this.southeast,i=this.northwest,o=this.northeast;e.allAreRenderable=t.allAreRenderable&&n.allAreRenderable&&i.allAreRenderable&&o.allAreRenderable,e.anyWereRenderedLastFrame=t.anyWereRenderedLastFrame||n.anyWereRenderedLastFrame||i.anyWereRenderedLastFrame||o.anyWereRenderedLastFrame,e.notYetRenderableCount=t.notYetRenderableCount+n.notYetRenderableCount+i.notYetRenderableCount+o.notYetRenderableCount};var JQ=new Array(31);for(let e=0;e<JQ.length;++e)JQ[e]=new ube;function Aot(e,t,n,i,o){let r=e._debug;++r.tilesVisited,e._tileReplacementQueue.markTileRendered(n),n._updateCustomData(t.frameNumber),n.level>r.maxDepthVisited&&(r.maxDepthVisited=n.level);let s=Uot(e,t,n)<e.maximumScreenSpaceError,a=n.southwestChild,c=n.southeastChild,d=n.northwestChild,u=n.northeastChild,m=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===m?n._lastSelectionResult:$n.NONE,y=e.tileProvider;if(s||i){let f=$n.originalResult(p)===$n.RENDERED,x=$n.originalResult(p)===$n.CULLED||p===$n.NONE,_=n.state===Hs.DONE,C=f||x||_;if(C||l(y.canRenderWithoutLosingDetail)&&(C=y.canRenderWithoutLosingDetail(n)),C){s&&Q0(e,e._tileLoadQueueMedium,n,t),qk(e,n),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===$n.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=$n.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&Q0(e,e._tileLoadQueueHigh,n,t)}if(y.canRefine(n)){if(a.upsampledFromParent&&c.upsampledFromParent&&d.upsampledFromParent&&u.upsampledFromParent){qk(e,n),Q0(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(a),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(d),e._tileReplacementQueue.markTileRendered(u),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===$n.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=$n.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=$n.REFINED;let x=e._tilesToRender.length,_=e._tileLoadQueueLow.length,C=e._tileLoadQueueMedium.length,V=e._tileLoadQueueHigh.length,L=e._tileToUpdateHeights.length;if(Mot(e,a,c,d,u,t,i,o),x!==e._tilesToRender.length){let Z=o.allAreRenderable,G=o.anyWereRenderedLastFrame,I=o.notYetRenderableCount,P=!1;if(!Z&&!G){let v=e._tilesToRender;for(let M=x;M<v.length;++M){let b=v[M];for(;b!==void 0&&b._lastSelectionResult!==$n.KICKED&&b!==n;)b._lastSelectionResult=$n.kick(b._lastSelectionResult),b=b.parent}e._tilesToRender.length=x,e._tileToUpdateHeights.length=L,qk(e,n),n._lastSelectionResult=$n.RENDERED;let F=p===$n.RENDERED;!F&&I>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=_,e._tileLoadQueueMedium.length=C,e._tileLoadQueueHigh.length=V,Q0(e,e._tileLoadQueueMedium,n,t),o.notYetRenderableCount=n.renderable?0:1,P=!0),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=F,F||e._tileToUpdateHeights.push(n),++r.tilesWaitingForChildren}e.preloadAncestors&&!P&&Q0(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=$n.RENDERED,qk(e,n),Q0(e,e._tileLoadQueueHigh,n,t),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===$n.RENDERED,o.notYetRenderableCount=n.renderable?0:1}function Mot(e,t,n,i,o,r,s,a){let c=r.camera.positionCartographic,d=e._tileProvider,u=e._occluders,m=JQ[t.level],p=m.southwest,y=m.southeast,f=m.northwest,x=m.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(Fa(e,t,d,r,u,s,p),Fa(e,n,d,r,u,s,y),Fa(e,i,d,r,u,s,f),Fa(e,o,d,r,u,s,x)):(Fa(e,i,d,r,u,s,f),Fa(e,t,d,r,u,s,p),Fa(e,o,d,r,u,s,x),Fa(e,n,d,r,u,s,y)):c.latitude<t.rectangle.north?(Fa(e,n,d,r,u,s,y),Fa(e,t,d,r,u,s,p),Fa(e,o,d,r,u,s,x),Fa(e,i,d,r,u,s,f)):(Fa(e,o,d,r,u,s,x),Fa(e,i,d,r,u,s,f),Fa(e,n,d,r,u,s,y),Fa(e,t,d,r,u,s,p)),m.combine(a)}function Not(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&de.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&de.contains(n,e._cameraReferenceFrameOriginCartographic)}function Fa(e,t,n,i,o,r,s){if(n.computeTileVisibility(t,i,o)!==mr.NONE)return Aot(e,i,t,r,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,Not(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&Q0(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===a?t._lastSelectionResult:$n.NONE;c!==$n.CULLED_BUT_NEEDED&&c!==$n.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=$n.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(Q0(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=$n.CULLED):t._lastSelectionResult=$n.CULLED;t._lastSelectionResultFrame=i.frameNumber}function Uot(e,t,n){if(t.mode===ie.SCENE2D||t.camera.frustum instanceof rn||t.camera.frustum instanceof Vr)return kot(e,t,n);let i=e._tileProvider.getLevelMaximumGeometricError(n.level),o=n._distance,r=t.context.drawingBufferHeight,s=t.camera.frustum.sseDenominator,a=i*r/(o*s);return t.fog.enabled&&(a-=W.fog(o,t.fog.density)*t.fog.sse),a/=t.pixelRatio,a}function kot(e,t,n){let o=t.camera.frustum,r=o.offCenterFrustum;l(r)&&(o=r);let s=t.context,a=s.drawingBufferWidth,c=s.drawingBufferHeight,d=e._tileProvider.getLevelMaximumGeometricError(n.level),u=Math.max(o.top-o.bottom,o.right-o.left)/Math.max(a,c),m=d/u;return t.fog.enabled&&t.mode!==ie.SCENE2D&&(m-=W.fog(n._distance,t.fog.density)*t.fog.sse),m/=t.pixelRatio,m}function qk(e,t){e._tilesToRender.push(t)}function Dot(e,t){let n=e._tileLoadQueueHigh,i=e._tileLoadQueueMedium,o=e._tileLoadQueueLow;if(n.length===0&&i.length===0&&o.length===0)return;e._tileReplacementQueue.trimTiles(e.tileCacheSize);let r=xi()+e._loadQueueTimeSlice,s=e._tileProvider,a=KQ(e,t,s,r,n,!1);a=KQ(e,t,s,r,i,a),KQ(e,t,s,r,o,a)}function Bot(e,t){return e._loadPriority-t._loadPriority}function KQ(e,t,n,i,o,r){n.computeTileLoadPriority!==void 0&&o.sort(Bot);for(let s=0,a=o.length;s<a&&(xi()<i||!r);++s){let c=o[s];e._tileReplacementQueue.markTileRendered(c),n.loadTile(t,c),r=!0}return r}var IV=new gn,zQ=new he,rg=new h,Oot=[];function Yot(e,t){if(!l(e.tileProvider.tilingScheme))return;let n=Oot;n.length=0;let i=e._tileToUpdateHeights,o=xi(),r=e._updateHeightsTimeSlice,s=o+r,a=t.mode,c=t.mapProjection,d=e.tileProvider.tilingScheme.ellipsoid,u;for(;i.length>0;){let m=i[0];if(!l(m.data)||!l(m.data.mesh)){let x=m._lastSelectionResultFrame===e._lastSelectionFrameNumber?m._lastSelectionResult:$n.NONE;(x===$n.RENDERED||x===$n.CULLED_BUT_NEEDED)&&n.push(m),i.shift(),e._lastTileIndex=0;continue}let p=m.customData,y=p.length,f=!1;for(u=e._lastTileIndex;u<y;++u){let x=p[u],_=m.data.terrainData,C=l(_)&&_.wasCreatedByUpsampling();if(m.level>x.level&&!C){if(l(x.positionOnEllipsoidSurface)||(x.positionOnEllipsoidSurface=h.fromRadians(x.positionCartographic.longitude,x.positionCartographic.latitude,0,d)),a===ie.SCENE3D){let L=d.geodeticSurfaceNormal(x.positionOnEllipsoidSurface,IV.direction),Z=d.getSurfaceNormalIntersectionWithZAxis(x.positionOnEllipsoidSurface,11500,IV.origin);if(!l(Z)){let G=0;l(m.data.tileBoundingRegion)&&(G=m.data.tileBoundingRegion.minimumHeight);let I=Math.min(G,-11500),P=h.multiplyByScalar(L,Math.abs(I)+1,rg);h.subtract(x.positionOnEllipsoidSurface,P,IV.origin)}}else he.clone(x.positionCartographic,zQ),zQ.height=-11500,c.project(zQ,rg),h.fromElements(rg.z,rg.x,rg.y,rg),h.clone(rg,IV.origin),h.clone(h.UNIT_X,IV.direction);let V=m.data.pick(IV,a,c,!1,rg);l(V)&&(l(x.callback)&&x.callback(V),x.level=m.level)}if(xi()>=s){f=!0;break}}if(f){e._lastTileIndex=u;break}else e._lastTileIndex=0,i.shift()}for(u=0;u<n.length;u++)i.push(n[u])}function Hot(e,t){let n=e._tileProvider,i=e._tilesToRender;for(let o=0,r=i.length;o<r;++o){let s=i[o];n.showTileThisFrame(s,t)}}var gw=$u;function Ch(e){e=g(e,oe.WGS84);let t=new uT({ellipsoid:e}),n=new uw;this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new Jv,this._material=void 0,this._surface=new gw({tileProvider:new lw({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=t,this._terrainProviderChanged=new ye,this._undergroundColor=O.clone(O.BLACK),this._undergroundColorAlphaByDistance=new vt(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new dw,jQ(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new Xe({url:on("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.lambertDiffuseMultiplier=.9,this.dynamicAtmosphereLighting=!0,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!0,this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new h(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new h(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=1e7,this.lightingFadeInDistance=2e7,this.nightFadeOutDistance=1e7,this.nightFadeInDistance=5e7,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=Cn.RECEIVE_ONLY,this.atmosphereHueShift=0,this.atmosphereSaturationShift=0,this.atmosphereBrightnessShift=0,this._terrainExaggerationChanged=!1,this._terrainExaggeration=1,this._terrainExaggerationRelativeHeight=0,this.showSkirts=!0,this.backFaceCulling=!0,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=void 0,this.vertexShadowDarkness=.3}Object.defineProperties(Ch.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 l(this._surface)?this._surface._tileLoadQueueHigh.length===0&&this._surface._tileLoadQueueMedium.length===0&&this._surface._tileLoadQueueLow.length===0:!0}},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){l(e)||(e=de.clone(de.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),l(this._material)&&jQ(this))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},terrainExaggeration:{get:function(){return _r("Globe.terrainExaggeration","Globe.terrainExaggeration was deprecated in CesiumJS 1.113. It will be removed in CesiumJS 1.116. Use Scene.verticalExaggeration instead."),this._terrainExaggeration},set:function(e){_r("Globe.terrainExaggeration","Globe.terrainExaggeration was deprecated in CesiumJS 1.113. It will be removed in CesiumJS 1.116. Use Scene.verticalExaggeration instead."),e!==this._terrainExaggeration&&(this._terrainExaggeration=e,this._terrainExaggerationChanged=!0)}},terrainExaggerationRelativeHeight:{get:function(){return _r("Globe.terrainExaggerationRelativeHeight","Globe.terrainExaggerationRelativeHeight was deprecated in CesiumJS 1.113. It will be removed in CesiumJS 1.116. Use Scene.verticalExaggerationRelativeHeight instead."),this._terrainExaggerationRelativeHeight},set:function(e){_r("Globe.terrainExaggerationRelativeHeight","Globe.terrainExaggerationRelativeHeight was deprecated in CesiumJS 1.113. It will be removed in CesiumJS 1.116. Use Scene.verticalExaggerationRelativeHeight instead."),e!==this._terrainExaggerationRelativeHeight&&(this._terrainExaggerationRelativeHeight=e,this._terrainExaggerationChanged=!0)}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,jQ(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=O.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){this._undergroundColorAlphaByDistance=vt.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function jQ(e){let t=[],n=l(e._material)&&(l(e._material.shaderSource.match(/slope/))||l(e._material.shaderSource.match("normalEC"))),i=[B0,mV];l(e._material)&&(!n||e._terrainProvider.requestVertexNormals)?(i.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms):e._surface._tileProvider.materialUniformMap=void 0,i.push(Av),e._surfaceShaderSet.baseVertexShaderSource=new Oe({sources:[B0,mV,Mv],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new Oe({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function Kot(e){return function(t,n){let i=ce.distanceSquaredTo(t.pickBoundingSphere,e),o=ce.distanceSquaredTo(n.pickBoundingSphere,e);return i-o}}var zot=[],Jot={start:0,stop:0};Ch.prototype.pickWorldCoordinates=function(e,t,n,i){n=g(n,!0);let o=t.mode,r=t.mapProjection,s=zot;s.length=0;let a=this._surface._tilesToRender,c=a.length,d,u;for(u=0;u<c;++u){d=a[u];let p=d.data;if(!l(p))continue;let y=p.pickBoundingSphere;if(o!==ie.SCENE3D)p.pickBoundingSphere=y=ce.fromRectangleWithHeights2D(d.rectangle,r,p.tileBoundingRegion.minimumHeight,p.tileBoundingRegion.maximumHeight,y),h.fromElements(y.center.z,y.center.x,y.center.y,y.center);else if(l(p.renderedMesh))ce.clone(p.tileBoundingRegion.boundingSphere,y);else continue;let f=ni.raySphere(e,y,Jot);l(f)&&s.push(p)}s.sort(Kot(e.origin));let m;for(c=s.length,u=0;u<c&&(m=s[u].pick(e,t.mode,t.mapProjection,n,i),!l(m));++u);return m};var Qot=new he;Ch.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),l(n)&&t.mode!==ie.SCENE3D){n=h.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,Qot);n=t.globe.ellipsoid.cartographicToCartesian(i,n)}return n};var jot=new h,mbe=new h,qot=new he,$ot=new gn;function QQ(e,t){return l(e)&&de.contains(e.rectangle,t)?e:void 0}Ch.prototype.getHeight=function(e){let t=this._surface._levelZeroTiles;if(!l(t))return;let n,i,o=t.length;for(i=0;i<o&&(n=t[i],!de.contains(n.rectangle,e));++i);if(i>=o)return;let r=n;for(;l(n);)n=QQ(n._southwestChild,e)||QQ(n._southeastChild,e)||QQ(n._northwestChild,e)||n._northeastChild,l(n)&&l(n.data)&&l(n.data.renderedMesh)&&(r=n);if(n=r,!l(n)||!l(n.data)||!l(n.data.renderedMesh))return;let s=this._surface._tileProvider.tilingScheme.projection,a=this._surface._tileProvider.tilingScheme.ellipsoid,c=h.fromRadians(e.longitude,e.latitude,0,a,jot),d=$ot,u=a.geodeticSurfaceNormal(c,d.direction),m=a.getSurfaceNormalIntersectionWithZAxis(c,11500,d.origin);if(!l(m)){let y;l(n.data.tileBoundingRegion)&&(y=n.data.tileBoundingRegion.minimumHeight);let f=Math.min(g(y,0),-11500),x=h.multiplyByScalar(u,Math.abs(f)+1,mbe);h.subtract(c,x,d.origin)}let p=n.data.pick(d,void 0,s,!1,mbe);if(l(p))return a.cartesianToCartographic(p,qot).height};Ch.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};Ch.prototype.beginFrame=function(e){let t=this._surface,n=t.tileProvider,i=this.terrainProvider,o=this.showWaterEffect&&l(i)&&i.hasWaterMask&&i.hasWaterMask;if(o&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let a=this._oceanNormalMapResource,c=a.url;if(l(c)){let d=this;a.fetchImage().then(function(u){c===d._oceanNormalMapResource.url&&(d._oceanNormalMap=d._oceanNormalMap&&d._oceanNormalMap.destroy(),d._oceanNormalMap=new wt({context:e.context,source:u}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}let r=e.passes,s=e.mode;r.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,n.terrainProvider=this.terrainProvider,n.lightingFadeOutDistance=this.lightingFadeOutDistance,n.lightingFadeInDistance=this.lightingFadeInDistance,n.nightFadeOutDistance=this.nightFadeOutDistance,n.nightFadeInDistance=this.nightFadeInDistance,n.zoomedOutOceanSpecularIntensity=s===ie.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,n.hasWaterMask=o,n.oceanNormalMap=this._oceanNormalMap,n.enableLighting=this.enableLighting,n.dynamicAtmosphereLighting=this.dynamicAtmosphereLighting,n.dynamicAtmosphereLightingFromSun=this.dynamicAtmosphereLightingFromSun,n.showGroundAtmosphere=this.showGroundAtmosphere,n.atmosphereLightIntensity=this.atmosphereLightIntensity,n.atmosphereRayleighCoefficient=this.atmosphereRayleighCoefficient,n.atmosphereMieCoefficient=this.atmosphereMieCoefficient,n.atmosphereRayleighScaleHeight=this.atmosphereRayleighScaleHeight,n.atmosphereMieScaleHeight=this.atmosphereMieScaleHeight,n.atmosphereMieAnisotropy=this.atmosphereMieAnisotropy,n.shadows=this.shadows,n.hueShift=this.atmosphereHueShift,n.saturationShift=this.atmosphereSaturationShift,n.brightnessShift=this.atmosphereBrightnessShift,n.fillHighlightColor=this.fillHighlightColor,n.showSkirts=this.showSkirts,n.backFaceCulling=this.backFaceCulling,n.vertexShadowDarkness=this.vertexShadowDarkness,n.undergroundColor=this._undergroundColor,n.undergroundColorAlphaByDistance=this._undergroundColorAlphaByDistance,n.lambertDiffuseMultiplier=this.lambertDiffuseMultiplier,t.beginFrame(e))};Ch.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};Ch.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};Ch.prototype.isDestroyed=function(){return!1};Ch.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(),ue(this)};var xw=Ch;var B1i=T(S(),1);var o1i=T(S(),1);var JCi=T(S(),1);var DCi=T(S(),1);function ert(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var _w=ert;var Rbe={},trt=32.184,nrt=2451545,hbe=-.0529921,fbe=-.1059842,pbe=13.0120009,bbe=13.3407154,ybe=.9856003,gbe=26.4057084,xbe=13.064993,_be=.3287146,Tbe=1.7484877,Sbe=-.1589763,Cbe=.0036096,Vbe=.1643573,Lbe=12.9590088,qQ=new te;Rbe.ComputeMoon=function(e,t){l(e)||(e=te.now()),qQ=te.addSeconds(e,trt,qQ);let n=te.totalDays(qQ)-nrt,i=n/qn.DAYS_PER_JULIAN_CENTURY,o=(125.045+hbe*n)*W.RADIANS_PER_DEGREE,r=(250.089+fbe*n)*W.RADIANS_PER_DEGREE,s=(260.008+pbe*n)*W.RADIANS_PER_DEGREE,a=(176.625+bbe*n)*W.RADIANS_PER_DEGREE,c=(357.529+ybe*n)*W.RADIANS_PER_DEGREE,d=(311.589+gbe*n)*W.RADIANS_PER_DEGREE,u=(134.963+xbe*n)*W.RADIANS_PER_DEGREE,m=(276.617+_be*n)*W.RADIANS_PER_DEGREE,p=(34.226+Tbe*n)*W.RADIANS_PER_DEGREE,y=(15.134+Sbe*n)*W.RADIANS_PER_DEGREE,f=(119.743+Cbe*n)*W.RADIANS_PER_DEGREE,x=(239.961+Vbe*n)*W.RADIANS_PER_DEGREE,_=(25.053+Lbe*n)*W.RADIANS_PER_DEGREE,C=Math.sin(o),V=Math.sin(r),L=Math.sin(s),Z=Math.sin(a),G=Math.sin(c),I=Math.sin(d),P=Math.sin(u),v=Math.sin(m),F=Math.sin(p),M=Math.sin(y),b=Math.sin(f),R=Math.sin(x),E=Math.sin(_),X=Math.cos(o),w=Math.cos(r),N=Math.cos(s),D=Math.cos(a),k=Math.cos(c),Y=Math.cos(d),U=Math.cos(u),J=Math.cos(m),K=Math.cos(p),ee=Math.cos(y),H=Math.cos(f),j=Math.cos(x),$=Math.cos(_),pe=(269.9949+.0031*i-3.8787*C-.1204*V+.07*L-.0172*Z+.0072*I-.0052*M+.0043*E)*W.RADIANS_PER_DEGREE,ge=(66.5392+.013*i+1.5419*X+.0239*w-.0278*N+.0068*D-.0029*Y+9e-4*U+8e-4*ee-9e-4*$)*W.RADIANS_PER_DEGREE,ae=(38.3213+13.17635815*n-14e-13*n*n+3.561*C+.1208*V-.0642*L+.0158*Z+.0252*G-.0066*I-.0047*P-.0046*v+.0028*F+.0052*M+.004*b+.0019*R-.0044*E)*W.RADIANS_PER_DEGREE,be=(13.17635815-14e-13*(2*n)+3.561*X*hbe+.1208*w*fbe-.0642*N*pbe+.0158*D*bbe+.0252*k*ybe-.0066*Y*gbe-.0047*U*xbe-.0046*J*_be+.0028*K*Tbe+.0052*ee*Sbe+.004*H*Cbe+.0019*j*Vbe-.0044*$*Lbe)/86400*W.RADIANS_PER_DEGREE;return l(t)||(t=new _w),t.rightAscension=pe,t.declination=ge,t.rotation=ae,t.rotationRate=be,t};var Tw=Rbe;function Zbe(e){(!l(e)||typeof e!="function")&&(e=Tw.ComputeMoon),this._computeFunction=e}var irt=new h,ort=new h,rrt=new h;function srt(e,t,n){let i=irt;i.x=Math.cos(e+W.PI_OVER_TWO),i.y=Math.sin(e+W.PI_OVER_TWO),i.z=0;let o=Math.cos(t),r=rrt;r.x=o*Math.cos(e),r.y=o*Math.sin(e),r.z=Math.sin(t);let s=h.cross(r,i,ort);return l(n)||(n=new q),n[0]=i.x,n[1]=s.x,n[2]=r.x,n[3]=i.y,n[4]=s.y,n[5]=r.y,n[6]=i.z,n[7]=s.z,n[8]=r.z,n}var art=new q,crt=new Me;Zbe.prototype.evaluate=function(e,t){l(e)||(e=te.now());let n=this._computeFunction(e),i=srt(n.rightAscension,n.declination,t),o=W.zeroToTwoPi(n.rotation),r=Me.fromAxisAngle(h.UNIT_Z,o,crt),s=q.fromQuaternion(Me.conjugate(r,r),art);return q.multiply(s,i,i)};var Sw=Zbe;var G1i=T(S(),1);var $Q={position:0};function $k(e){e=g(e,g.EMPTY_OBJECT),this.center=h.clone(g(e.center,h.ZERO)),this._center=new h,this.radii=h.clone(e.radii),this._radii=new h,this._oneOverEllipsoidRadiiSquared=new h,this._boundingSphere=new ce,this.modelMatrix=A.clone(g(e.modelMatrix,A.IDENTITY)),this._modelMatrix=new A,this._computedModelMatrix=new A,this.show=g(e.show,!0),this.material=g(e.material,Bi.fromType(Bi.ColorType)),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=g(e.debugShowBoundingVolume,!1),this.onlySunLighting=g(e.onlySunLighting,!1),this._onlySunLighting=!1,this._depthTestEnabled=g(e.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 nt({owner:g(e._owner,this)}),this._pickCommand=new nt({owner:g(e._owner,this),pickOnly:!0});let t=this;this._uniforms={u_radii:function(){return t.radii},u_oneOverEllipsoidRadiiSquared:function(){return t._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return t._pickId.color}}}function lrt(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=pl.createGeometry(pl.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Pe.POSITION_ONLY}));return t=oi.fromGeometry({context:e,geometry:n,attributeLocations:$Q,bufferUsage:Ue.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}$k.prototype.update=function(e){if(!this.show||e.mode!==ie.SCENE3D||!l(this.center)||!l(this.radii))return;let t=e.context,n=this.material.isTranslucent(),i=this._translucent!==n;(!l(this._rs)||i)&&(this._translucent=n,this._rs=ke.fromCache({cull:{enabled:!0,face:yi.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?mn.ALPHA_BLEND:void 0})),l(this._va)||(this._va=lrt(t));let o=!1,r=this.radii;if(!h.equals(this._radii,r)){h.clone(r,this._radii);let x=this._oneOverEllipsoidRadiiSquared;x.x=1/(r.x*r.x),x.y=1/(r.y*r.y),x.z=1/(r.z*r.z),o=!0}(!A.equals(this.modelMatrix,this._modelMatrix)||!h.equals(this.center,this._center))&&(A.clone(this.modelMatrix,this._modelMatrix),h.clone(this.center,this._center),A.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),o=!0),o&&(h.clone(h.ZERO,this._boundingSphere.center),this._boundingSphere.radius=h.maximumComponent(r),ce.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));let s=this._material!==this.material;this._material=this.material,this._material.update(t);let a=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;let c=e.useLogDepth,d=this._useLogDepth!==c;this._useLogDepth=c;let u=this._colorCommand,m,p;(s||a||i||d)&&(m=new Oe({sources:[uV]}),p=new Oe({sources:[this.material.shaderSource,dV]}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(m.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._sp=Qt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:p,attributeLocations:$Q}),u.vertexArray=this._va,u.renderState=this._rs,u.shaderProgram=this._sp,u.uniformMap=Tt(this._uniforms,this.material._uniforms),u.executeInClosestFrustum=n);let y=e.commandList,f=e.passes;if(f.render&&(u.boundingVolume=this._boundingSphere,u.debugShowBoundingVolume=this.debugShowBoundingVolume,u.modelMatrix=this._computedModelMatrix,u.pass=n?Ve.TRANSLUCENT:Ve.OPAQUE,y.push(u)),f.pick){let x=this._pickCommand;(!l(this._pickId)||this._id!==this.id)&&(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=t.createPickId({primitive:this,id:this.id})),(s||a||!l(this._pickSP)||d)&&(m=new Oe({sources:[uV]}),p=new Oe({sources:[this.material.shaderSource,dV],pickColorQualifier:"uniform"}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(m.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._pickSP=Qt.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:m,fragmentShaderSource:p,attributeLocations:$Q}),x.vertexArray=this._va,x.renderState=this._rs,x.shaderProgram=this._pickSP,x.uniformMap=Tt(Tt(this._uniforms,this._pickUniforms),this.material._uniforms),x.executeInClosestFrustum=n),x.boundingVolume=this._boundingSphere,x.modelMatrix=this._computedModelMatrix,x.pass=n?Ve.TRANSLUCENT:Ve.OPAQUE,y.push(x)}};$k.prototype.isDestroyed=function(){return!1};$k.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(),ue(this)};var Cw=$k;function Vw(e){e=g(e,g.EMPTY_OBJECT);let t=e.textureUrl;l(t)||(t=on("Assets/Textures/moonSmall.jpg")),this.show=g(e.show,!0),this.textureUrl=t,this._ellipsoid=g(e.ellipsoid,oe.MOON),this.onlySunLighting=g(e.onlySunLighting,!0),this._ellipsoidPrimitive=new Cw({radii:this.ellipsoid.radii,material:Bi.fromType(Bi.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new Sw}Object.defineProperties(Vw.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var eD=new q,drt=new q,urt=new h,tD=[];Vw.prototype.update=function(e){if(!this.show)return;let t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;let n=e.time;l(Xt.computeIcrfToFixedMatrix(n,eD))||Xt.computeTemeToPseudoFixedMatrix(n,eD);let i=this._axes.evaluate(n,drt);q.transpose(i,i),q.multiply(eD,i,i);let o=tg.computeMoonPositionInEarthInertialFrame(n,urt);q.multiplyByVector(eD,o,o),A.fromRotationTranslation(i,o,t.modelMatrix);let r=e.commandList;return e.commandList=tD,tD.length=0,t.update(e),e.commandList=r,tD.length===1?tD[0]:void 0};Vw.prototype.isDestroyed=function(){return!1};Vw.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),ue(this)};var Lw=Vw;var jFi=T(S(),1);var Y1i=T(S(),1);var e4=[],t4=[];function mrt(e,t,n,i,o,r){let s=o-i+1,a=r-o,c=e4,d=t4,u,m;for(u=0;u<s;++u)c[u]=e[i+u];for(m=0;m<a;++m)d[m]=e[o+m+1];u=0,m=0;for(let p=i;p<=r;++p){let y=c[u],f=d[m];u<s&&(m>=a||t(y,f,n)<=0)?(e[p]=y,++u):m<a&&(e[p]=f,++m)}}function n4(e,t,n,i,o){if(i>=o)return;let r=Math.floor((i+o)*.5);n4(e,t,n,i,r),n4(e,t,n,r+1,o),mrt(e,t,n,i,r,o)}function hrt(e,t,n){let i=e.length,o=Math.ceil(i*.5);e4.length=o,t4.length=o,n4(e,t,n,0,i-1),e4.length=0,t4.length=0}var j0=hrt;var tVi=T(S(),1);function gc(e,t){this._occluderPosition=h.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.cameraPosition=t}var nD=new h;Object.defineProperties(gc.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=h.clone(e,this._cameraPosition);let t=h.subtract(this._occluderPosition,e,nD),n=h.magnitudeSquared(t),i=this._occluderRadius*this._occluderRadius,o,r,s;if(n>i){o=Math.sqrt(n-i),n=1/Math.sqrt(n),r=h.multiplyByScalar(t,n,nD);let a=o*o*n;s=h.add(e,h.multiplyByScalar(r,a,nD),nD)}else o=Number.MAX_VALUE;this._horizonDistance=o,this._horizonPlaneNormal=r,this._horizonPlanePosition=s,this._cameraPosition=e}}});gc.fromBoundingSphere=function(e,t,n){return l(n)?(h.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new gc(e,t)};var Ebe=new h;gc.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=h.subtract(e,this._occluderPosition,Ebe),n=this._occluderRadius;if(n=h.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=h.subtract(e,this._cameraPosition,t),n*n>h.magnitudeSquared(t)}return!1};var frt=new h;gc.prototype.isBoundingSphereVisible=function(e){let t=h.clone(e.center,frt),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,Ebe),o=this._occluderRadius-n;if(o=h.magnitudeSquared(i)-o*o,n<this._occluderRadius)return o>0?(o=Math.sqrt(o)+this._horizonDistance,i=h.subtract(t,this._cameraPosition,i),o*o+n*n>h.magnitudeSquared(i)):!1;if(o>0){i=h.subtract(t,this._cameraPosition,i);let r=h.magnitudeSquared(i),s=this._occluderRadius*this._occluderRadius,a=n*n;return(this._horizonDistance*this._horizonDistance+s)*a>r*s?!0:(o=Math.sqrt(o)+this._horizonDistance,o*o+a>r)}return!0}return!1};var prt=new h;gc.prototype.computeVisibility=function(e){let t=h.clone(e.center),n=e.radius;if(n>this._occluderRadius)return mr.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,prt),o=this._occluderRadius-n,r=h.magnitudeSquared(i);if(o=r-o*o,o>0){o=Math.sqrt(o)+this._horizonDistance,i=h.subtract(t,this._cameraPosition,i);let s=h.magnitudeSquared(i);return o*o+n*n<s?mr.NONE:(o=this._occluderRadius+n,o=r-o*o,o>0?(o=Math.sqrt(o)+this._horizonDistance,s<o*o+n*n?mr.FULL:mr.PARTIAL):(i=h.subtract(t,this._horizonPlanePosition,i),h.dot(i,this._horizonPlaneNormal)>-n?mr.PARTIAL:mr.FULL))}}return mr.NONE};var iD=new h;gc.computeOccludeePoint=function(e,t,n){let i=h.clone(t),o=h.clone(e.center),r=e.radius,s=n.length,a=h.normalize(h.subtract(i,o,iD),iD),c=-h.dot(a,o),d=gc._anyRotationVector(o,a,c),u=gc._horizonToPlaneNormalDotProduct(e,a,c,d,n[0]);if(!u)return;let m;for(let y=1;y<s;++y){if(m=gc._horizonToPlaneNormalDotProduct(e,a,c,d,n[y]),!m)return;m<u&&(u=m)}if(u<.0017453283658983088)return;let p=r/u;return h.add(o,h.multiplyByScalar(a,p,iD),iD)};var brt=[];gc.computeOccludeePointFromRectangle=function(e,t){t=g(t,oe.WGS84);let n=de.subsample(e,t,0,brt),i=ce.fromPoints(n),o=h.ZERO;if(!h.equals(o,i.center))return gc.computeOccludeePoint(new ce(o,t.minimumRadius),i.center,n)};var yrt=new h;gc._anyRotationVector=function(e,t,n){let i=h.abs(t,yrt),o=i.x>i.y?0:1;(o===0&&i.z>i.x||o===1&&i.z>i.y)&&(o=2);let r=new h,s;o===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,s=h.UNIT_X):o===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,s=h.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,s=h.UNIT_Z);let a=(h.dot(t,i)+n)/-h.dot(t,s);return h.normalize(h.subtract(h.add(i,h.multiplyByScalar(s,a,r),i),e,i),i)};var grt=new h;gc._rotationVector=function(e,t,n,i,o){let r=h.subtract(i,e,grt);if(r=h.normalize(r,r),h.dot(t,r)<.9999999847691291){let s=h.cross(t,r,r);if(h.magnitude(s)>W.EPSILON13)return h.normalize(s,new h)}return o};var i4=new h,xrt=new h,oD=new h,Gbe=new h;gc._horizonToPlaneNormalDotProduct=function(e,t,n,i,o){let r=h.clone(o,i4),s=h.clone(e.center,xrt),a=e.radius,c=h.subtract(s,r,oD),d=h.magnitudeSquared(c),u=a*a;if(d<u)return!1;let m=d-u,p=Math.sqrt(m),f=1/Math.sqrt(d),_=p*f*p;c=h.normalize(c,c);let C=h.add(r,h.multiplyByScalar(c,_,Gbe),Gbe),V=Math.sqrt(m-_*_),L=this._rotationVector(s,t,n,r,i),Z=h.fromElements(L.x*L.x*c.x+(L.x*L.y-L.z)*c.y+(L.x*L.z+L.y)*c.z,(L.x*L.y+L.z)*c.x+L.y*L.y*c.y+(L.y*L.z-L.x)*c.z,(L.x*L.z-L.y)*c.x+(L.y*L.z+L.x)*c.y+L.z*L.z*c.z,i4);Z=h.normalize(Z,Z);let G=h.multiplyByScalar(Z,V,i4);L=h.normalize(h.subtract(h.add(C,G,oD),s,oD),oD);let I=h.dot(t,L);L=h.normalize(h.subtract(h.subtract(C,G,L),s,L),L);let P=h.dot(t,L);return I<P?I:P};var Rw=gc;var bVi=T(S(),1);var dVi=T(S(),1);function Nf(e){e=g(e,g.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=g(e.near,1),this._near=this.near,this.far=g(e.far,5e8),this._far=this.far,this._cullingVolume=new as,this._perspectiveMatrix=new A,this._infinitePerspective=new A}function o4(e){let t=e.top,n=e.bottom,i=e.right,o=e.left,r=e.near,s=e.far;(t!==e._top||n!==e._bottom||o!==e._left||i!==e._right||r!==e._near||s!==e._far)&&(e._left=o,e._right=i,e._top=t,e._bottom=n,e._near=r,e._far=s,e._perspectiveMatrix=A.computePerspectiveOffCenter(o,i,n,t,r,s,e._perspectiveMatrix),e._infinitePerspective=A.computeInfinitePerspectiveOffCenter(o,i,n,t,r,e._infinitePerspective))}Object.defineProperties(Nf.prototype,{projectionMatrix:{get:function(){return o4(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return o4(this),this._infinitePerspective}}});var _rt=new h,Trt=new h,Srt=new h,Crt=new h;Nf.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,c=this.near,d=this.far,u=h.cross(t,n,_rt),m=Trt;h.multiplyByScalar(t,c,m),h.add(e,m,m);let p=Srt;h.multiplyByScalar(t,d,p),h.add(e,p,p);let y=Crt;h.multiplyByScalar(u,a,y),h.add(m,y,y),h.subtract(y,e,y),h.normalize(y,y),h.cross(y,n,y),h.normalize(y,y);let f=i[0];return l(f)||(f=i[0]=new se),f.x=y.x,f.y=y.y,f.z=y.z,f.w=-h.dot(y,e),h.multiplyByScalar(u,s,y),h.add(m,y,y),h.subtract(y,e,y),h.cross(n,y,y),h.normalize(y,y),f=i[1],l(f)||(f=i[1]=new se),f.x=y.x,f.y=y.y,f.z=y.z,f.w=-h.dot(y,e),h.multiplyByScalar(n,r,y),h.add(m,y,y),h.subtract(y,e,y),h.cross(u,y,y),h.normalize(y,y),f=i[2],l(f)||(f=i[2]=new se),f.x=y.x,f.y=y.y,f.z=y.z,f.w=-h.dot(y,e),h.multiplyByScalar(n,o,y),h.add(m,y,y),h.subtract(y,e,y),h.cross(y,u,y),h.normalize(y,y),f=i[3],l(f)||(f=i[3]=new se),f.x=y.x,f.y=y.y,f.z=y.z,f.w=-h.dot(y,e),f=i[4],l(f)||(f=i[4]=new se),f.x=t.x,f.y=t.y,f.z=t.z,f.w=-h.dot(t,m),h.negate(t,y),f=i[5],l(f)||(f=i[5]=new se),f.x=y.x,f.y=y.y,f.z=y.z,f.w=-h.dot(y,p),this._cullingVolume};Nf.prototype.getPixelDimensions=function(e,t,n,i,o){o4(this);let r=1/this.near,s=this.top*r,a=2*i*n*s/t;s=this.right*r;let c=2*i*n*s/e;return o.x=c,o.y=a,o};Nf.prototype.clone=function(e){return l(e)||(e=new Nf),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};Nf.prototype.equals=function(e){return l(e)&&e instanceof Nf&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};Nf.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof Nf&&W.equalsEpsilon(this.right,e.right,t,n)&&W.equalsEpsilon(this.left,e.left,t,n)&&W.equalsEpsilon(this.top,e.top,t,n)&&W.equalsEpsilon(this.bottom,e.bottom,t,n)&&W.equalsEpsilon(this.near,e.near,t,n)&&W.equalsEpsilon(this.far,e.far,t,n)};var nl=Nf;function Bl(e){e=g(e,g.EMPTY_OBJECT),this._offCenterFrustum=new nl,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=g(e.near,1),this._near=this.near,this.far=g(e.far,5e8),this._far=this.far,this.xOffset=g(e.xOffset,0),this._xOffset=this.xOffset,this.yOffset=g(e.yOffset,0),this._yOffset=this.yOffset}Bl.packedLength=6;Bl.pack=function(e,t,n){return n=g(n,0),t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};Bl.unpack=function(e,t,n){return t=g(t,0),l(n)||(n=new Bl),n.fov=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t++],n.xOffset=e[t++],n.yOffset=e[t],n};function Vh(e){let 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:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,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)}Object.defineProperties(Bl.prototype,{projectionMatrix:{get:function(){return Vh(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return Vh(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return Vh(this),this._fovy}},sseDenominator:{get:function(){return Vh(this),this._sseDenominator}},offCenterFrustum:{get:function(){return Vh(this),this._offCenterFrustum}}});Bl.prototype.computeCullingVolume=function(e,t,n){return Vh(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};Bl.prototype.getPixelDimensions=function(e,t,n,i,o){return Vh(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};Bl.prototype.clone=function(e){return l(e)||(e=new Bl),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};Bl.prototype.equals=function(e){return!l(e)||!(e instanceof Bl)?!1:(Vh(this),Vh(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};Bl.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof Bl)?!1:(Vh(this),Vh(e),W.equalsEpsilon(this.fov,e.fov,t,n)&&W.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var Li=Bl;var SVi=T(S(),1);var gVi=T(S(),1),Zw={NONE:0,SCENE_LIGHT:1,SUNLIGHT:2};Zw.fromGlobeFlags=function(e){return e.enableLighting&&e.dynamicAtmosphereLighting?e.dynamicAtmosphereLightingFromSun?Zw.SUNLIGHT:Zw.SCENE_LIGHT:Zw.NONE};var bT=Object.freeze(Zw);function Vrt(){this.lightIntensity=10,this.rayleighCoefficient=new h(55e-7,13e-6,284e-7),this.mieCoefficient=new h(21e-6,21e-6,21e-6),this.rayleighScaleHeight=1e4,this.mieScaleHeight=3200,this.mieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.dynamicLighting=bT.NONE}var Gw=Vrt;var vVi=T(S(),1);function Ew(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(Ew.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function Lrt(e,t,n){let i=t.createViewportQuadCommand(Zv,{framebuffer:n,renderState:ke.fromCache({viewport:new De(0,0,256,256)})});e._drawCommand=i}Ew.prototype.update=function(e){if(!l(this._colorTexture)){let t=e.context,n=new wt({context:t,width:256,height:256,pixelFormat:at.RGBA,pixelDatatype:je.UNSIGNED_BYTE,sampler:hn.NEAREST});this._colorTexture=n;let i=new na({context:t,colorTextures:[n],destroyAttachments:!1});Lrt(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};Ew.prototype.isDestroyed=function(){return!1};Ew.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),ue(this)};var Iw=Ew;var VLi=T(S(),1);var HVi=T(S(),1);var Pbe={};function Rrt(e,t,n){let i,o,r;if(e instanceof Li){let s=Math.tan(.5*e.fovy);return i=e.near,o=e.near*s,r=e.aspectRatio*o,Math.max(t*i/r,n*i/o)}else if(e instanceof nl)return i=e.near,o=e.top,r=e.right,Math.max(t*i/r,n*i/o);return Math.max(t,n)}var Zrt=new h,Ibe=new h;function vbe(e,t,n,i){if(l(i)&&n(.5)>i){let o=n(0),r=n(1),s=n(.5),a=s-o,c=s-r;return function(d){let u=n(d);if(d<=.5){let p=(u-o)/a;return W.lerp(e,-W.PI_OVER_TWO,p)}let m=(u-r)/c;return W.lerp(-W.PI_OVER_TWO,t,1-m)}}return function(o){return W.lerp(e,t,o)}}function s4(e,t,n,i,o){let r=o,s=Math.max(n,i);if(!l(r)){let a=e.position,c=t,d=e.up,u=e.right,m=e.frustum,p=h.subtract(a,c,Zrt),y=h.magnitude(h.multiplyByScalar(d,h.dot(p,d),Ibe)),f=h.magnitude(h.multiplyByScalar(u,h.dot(p,u),Ibe));r=Math.min(Rrt(m,y,f)*.2,1e9)}if(s<r){let d=-Math.pow((r-n)*1e6,.125),u=Math.pow((r-i)*1e6,1/8);return function(m){let p=m*(u-d)+d;return-Math.pow(p,8)/1e6+r}}return function(a){return W.lerp(n,i,a)}}function Xw(e,t){return W.equalsEpsilon(e,W.TWO_PI,W.EPSILON11)&&(e=0),t>e+Math.PI?e+=W.TWO_PI:t<e-Math.PI&&(e-=W.TWO_PI),e}var wbe=new h;function Grt(e,t,n,i,o,r,s,a){let c=e.camera,d=h.clone(c.position,wbe),u=c.pitch,m=Xw(c.heading,i),p=Xw(c.roll,r),y=s4(c,n,d.z,n.z,s),f=vbe(u,o,y,a);function x(_){let C=_.time/t;c.setView({orientation:{heading:W.lerp(m,i,C),pitch:f(C),roll:W.lerp(p,r,C)}}),B.lerp(d,n,C,c.position),c.position.z=y(C)}return x}function Ert(e,t){e.longitude<t.longitude?e.longitude+=W.TWO_PI:t.longitude+=W.TWO_PI}function Irt(e,t){let n=e.longitude-t.longitude;n<-W.PI?e.longitude+=W.TWO_PI:n>W.PI&&(t.longitude+=W.TWO_PI)}var Xrt=new he,Wrt=new he;function Prt(e,t,n,i,o,r,s,a,c,d){let u=e.camera,p=e.mapProjection.ellipsoid,y=he.clone(u.positionCartographic,Xrt),f=u.pitch,x=Xw(u.heading,i),_=Xw(u.roll,r),C=p.cartesianToCartographic(n,Wrt);y.longitude=W.zeroToTwoPi(y.longitude),C.longitude=W.zeroToTwoPi(C.longitude);let V=!1;if(l(a)){let I=W.zeroToTwoPi(a),P=Math.min(y.longitude,C.longitude),v=Math.max(y.longitude,C.longitude),F=I>=P&&I<=v;if(l(c)){let M=Math.abs(y.longitude-C.longitude),b=W.TWO_PI-M;(F?M:b)<(F?b:M)*c&&!F&&(V=!0)}else F||(V=!0)}V?Ert(y,C):Irt(y,C);let L=s4(u,n,y.height,C.height,s),Z=vbe(f,o,L,d);function G(){let I=y.longitude,P=C.longitude,v=y.latitude,F=C.latitude;return function(b){let R=b.time/t,E=h.fromRadians(W.lerp(I,P,R),W.lerp(v,F,R),L(R),p);u.setView({destination:E,orientation:{heading:W.lerp(x,i,R),pitch:Z(R),roll:W.lerp(_,r,R)}})}}return G()}function vrt(e,t,n,i,o,r,s){let a=e.camera,c=h.clone(a.position,wbe),d=Xw(a.heading,i),u=a.frustum.right-a.frustum.left,m=s4(a,n,u,n.z,s);function p(y){let f=y.time/t;a.setView({orientation:{heading:W.lerp(d,i,f)}}),B.lerp(c,n,f,a.position);let x=m(f),_=a.frustum,C=_.top/_.right,V=(x-(_.right-_.left))*.5;_.right+=V,_.left-=V,_.top=C*_.right,_.bottom=-_.top}return p}var Xbe=new he,wrt=new h;function r4(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function Wbe(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}Pbe.createTween=function(e,t){t=g(t,g.EMPTY_OBJECT);let n=t.destination,i=e.mode;if(i===ie.MORPHING)return r4();let o=g(t.convert,!0),r=e.mapProjection,s=r.ellipsoid,a=t.maximumHeight,c=t.flyOverLongitude,d=t.flyOverLongitudeWeight,u=t.pitchAdjustHeight,m=t.easingFunction;o&&i!==ie.SCENE3D&&(s.cartesianToCartographic(n,Xbe),n=r.project(Xbe,wrt));let p=e.camera,y=t.endTransform;l(y)&&p._setTransform(y);let f=t.duration;l(f)||(f=Math.ceil(h.distance(p.position,n)/1e6)+2,f=Math.min(f,3));let x=g(t.heading,0),_=g(t.pitch,-W.PI_OVER_TWO),C=g(t.roll,0),V=e.screenSpaceCameraController;V.enableInputs=!1;let L=Wbe(V,t.complete),Z=Wbe(V,t.cancel),G=p.frustum,I=e.mode===ie.SCENE2D;if(I=I&&B.equalsEpsilon(p.position,n,W.EPSILON6),I=I&&W.equalsEpsilon(Math.max(G.right-G.left,G.top-G.bottom),n.z,W.EPSILON6),I=I||e.mode!==ie.SCENE2D&&h.equalsEpsilon(n,p.position,W.EPSILON10),I=I&&W.equalsEpsilon(W.negativePiToPi(x),W.negativePiToPi(p.heading),W.EPSILON10)&&W.equalsEpsilon(W.negativePiToPi(_),W.negativePiToPi(p.pitch),W.EPSILON10)&&W.equalsEpsilon(W.negativePiToPi(C),W.negativePiToPi(p.roll),W.EPSILON10),I)return r4(L,Z);let P=new Array(4);if(P[ie.SCENE2D]=vrt,P[ie.SCENE3D]=Prt,P[ie.COLUMBUS_VIEW]=Grt,f<=0)return r4(function(){P[i](e,1,n,x,_,C,a,c,d,u)({time:1}),typeof L=="function"&&L()},Z);let v=P[i](e,f,n,x,_,C,a,c,d,u);if(!l(m)){let F=p.positionCartographic.height,M=i===ie.SCENE3D?s.cartesianToCartographic(n).height:n.z;F>M&&F>11500?m=Ar.CUBIC_OUT:m=Ar.QUINTIC_IN_OUT}return{duration:f,easingFunction:m,startObject:{time:0},stopObject:{time:f},update:v,complete:L,cancel:Z}};var Ww=Pbe;var zVi=T(S(),1),Frt={ROTATE:0,INFINITE_SCROLL:1},Ol=Object.freeze(Frt);function $t(e){this._scene=e,this._transform=A.clone(A.IDENTITY),this._invTransform=A.clone(A.IDENTITY),this._actualTransform=A.clone(A.IDENTITY),this._actualInvTransform=A.clone(A.IDENTITY),this._transformChanged=!1,this.position=new h,this._position=new h,this._positionWC=new h,this._positionCartographic=new he,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new h,this._direction=new h,this._directionWC=new h,this.up=new h,this._up=new h,this._upWC=new h,this.right=new h,this._right=new h,this._rightWC=new h,this.frustum=new Li,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=W.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 ye,this._moveEnd=new ye,this._changed=new ye,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this._changedHeading=void 0,this.percentageChanged=.5,this._viewMatrix=new A,this._invViewMatrix=new A,Bbe(this),this._mode=ie.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new he(Math.PI,W.PI_OVER_TWO)),this._max2Dfrustum=void 0,tye(this,$t.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=h.magnitude(this.position);n+=n*$t.DEFAULT_VIEW_FACTOR,h.normalize(this.position,this.position),h.multiplyByScalar(this.position,n,this.position)}$t.TRANSFORM_2D=new A(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);$t.TRANSFORM_2D_INVERSE=A.inverseTransformation($t.TRANSFORM_2D,new A);$t.DEFAULT_VIEW_RECTANGLE=de.fromDegrees(-95,-20,-70,90);$t.DEFAULT_VIEW_FACTOR=.5;$t.DEFAULT_OFFSET=new Ou(0,-W.PI_OVER_FOUR,0);function Bbe(e){A.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),A.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),A.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function Art(e){if(!l(e._oldPositionWC))e._oldPositionWC=h.clone(e.positionWC,e._oldPositionWC);else{e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=h.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=h.magnitude(t),e._oldPositionWC=h.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=xi()):e.timeSinceMoved=Math.max(xi()-e._lastMovedTimestamp,0)/1e3}}$t.prototype.canPreloadFlight=function(){return l(this._currentFlight)&&this._mode!==ie.SCENE2D};$t.prototype._updateCameraChanged=function(){let e=this;if(Art(e),e._changed.numberOfListeners===0)return;let t=e.percentageChanged,n=e.heading;l(e._changedHeading)||(e._changedHeading=n);let i=Math.abs(e._changedHeading-n)%W.TWO_PI;i=i>W.PI?W.TWO_PI-i:i;let o=i/Math.PI;if(o>t&&(e._changed.raiseEvent(o),e._changedHeading=n),e._mode===ie.SCENE2D){if(!l(e._changedFrustum)){e._changedPosition=h.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let d=e.position,u=e._changedPosition,m=e.frustum,p=e._changedFrustum,y=d.x+m.left,f=d.x+m.right,x=u.x+p.left,_=u.x+p.right,C=d.y+m.bottom,V=d.y+m.top,L=u.y+p.bottom,Z=u.y+p.top,G=Math.max(y,x),I=Math.min(f,_),P=Math.max(C,L),v=Math.min(V,Z),F;if(G>=I||P>=V)F=1;else{let M=p;y<x&&f>_&&C<L&&V>Z&&(M=m),F=1-(I-G)*(v-P)/((M.right-M.left)*(M.top-M.bottom))}F>t&&(e._changed.raiseEvent(F),e._changedPosition=h.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!l(e._changedDirection)){e._changedPosition=h.clone(e.positionWC,e._changedPosition),e._changedDirection=h.clone(e.directionWC,e._changedDirection);return}let r=W.acosClamped(h.dot(e.directionWC,e._changedDirection)),s;l(e.frustum.fovy)?s=r/(e.frustum.fovy*.5):s=r;let c=h.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(s>t||c>t)&&(e._changed.raiseEvent(Math.max(s,c)),e._changedPosition=h.clone(e.positionWC,e._changedPosition),e._changedDirection=h.clone(e.directionWC,e._changedDirection))};function Mrt(e){Xt.basisTo2D(e._projection,e._transform,e._actualTransform)}var Nrt=new he,Urt=new h,rD=new h,krt=new se,Drt=new se,Brt=new se,Ort=new se,Yrt=new se;function Hrt(e){let t=e._projection,n=t.ellipsoid,i=A.getColumn(e._transform,3,krt),o=n.cartesianToCartographic(i,Nrt),r=t.project(o,Urt),s=Drt;s.x=r.z,s.y=r.x,s.z=r.y,s.w=1;let a=se.clone(se.UNIT_X,Yrt),c=se.add(A.getColumn(e._transform,0,rD),i,rD);n.cartesianToCartographic(c,o),t.project(o,r);let d=Brt;d.x=r.z,d.y=r.x,d.z=r.y,d.w=0,h.subtract(d,s,d),d.x=0;let u=Ort;if(h.magnitudeSquared(d)>W.EPSILON10)h.cross(a,d,u);else{let m=se.add(A.getColumn(e._transform,1,rD),i,rD);n.cartesianToCartographic(m,o),t.project(o,r),u.x=r.z,u.y=r.x,u.z=r.y,u.w=0,h.subtract(u,s,u),u.x=0,h.magnitudeSquared(u)<W.EPSILON10&&(se.clone(se.UNIT_Y,d),se.clone(se.UNIT_Z,u))}h.cross(u,a,d),h.normalize(d,d),h.cross(a,d,u),h.normalize(u,u),A.setColumn(e._actualTransform,0,d,e._actualTransform),A.setColumn(e._actualTransform,1,u,e._actualTransform),A.setColumn(e._actualTransform,2,a,e._actualTransform),A.setColumn(e._actualTransform,3,s,e._actualTransform)}var a4=new h;function _c(e){let t=e._mode,n=!1,i=0;t===ie.SCENE2D&&(i=e.frustum.right-e.frustum.left,n=i!==e._positionCartographic.height);let o=e._position,r=!h.equals(o,e.position)||n;r&&(o=h.clone(e.position,e._position));let s=e._direction,a=!h.equals(s,e.direction);a&&(h.normalize(e.direction,e.direction),s=h.clone(e.direction,e._direction));let c=e._up,d=!h.equals(c,e.up);d&&(h.normalize(e.up,e.up),c=h.clone(e.up,e._up));let u=e._right,m=!h.equals(u,e.right);m&&(h.normalize(e.right,e.right),u=h.clone(e.right,e._right));let p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(A.inverseTransformation(e._transform,e._invTransform),e._mode===ie.COLUMBUS_VIEW||e._mode===ie.SCENE2D?A.equals(A.IDENTITY,e._transform)?A.clone($t.TRANSFORM_2D,e._actualTransform):e._mode===ie.COLUMBUS_VIEW?Mrt(e):Hrt(e):A.clone(e._transform,e._actualTransform),A.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let y=e._actualTransform;if(r||p)if(e._positionWC=A.multiplyByPoint(y,o,e._positionWC),t===ie.SCENE3D||t===ie.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let f=a4;f.x=e._positionWC.y,f.y=e._positionWC.z,f.z=e._positionWC.x,t===ie.SCENE2D&&(f.z=i),e._projection.unproject(f,e._positionCartographic)}if(a||d||m){let f=h.dot(s,h.cross(c,u,a4));if(Math.abs(1-f)>W.EPSILON2){let x=1/h.magnitudeSquared(c),_=h.dot(c,s)*x,C=h.multiplyByScalar(s,_,a4);c=h.normalize(h.subtract(c,C,e._up),e._up),h.clone(c,e.up),u=h.cross(s,c,e._right),h.clone(u,e.right)}}(a||p)&&(e._directionWC=A.multiplyByPointAsVector(y,s,e._directionWC),h.normalize(e._directionWC,e._directionWC)),(d||p)&&(e._upWC=A.multiplyByPointAsVector(y,c,e._upWC),h.normalize(e._upWC,e._upWC)),(m||p)&&(e._rightWC=A.multiplyByPointAsVector(y,u,e._rightWC),h.normalize(e._rightWC,e._rightWC)),(r||a||d||m||p)&&Bbe(e)}function Obe(e,t){let n;return W.equalsEpsilon(Math.abs(e.z),1,W.EPSILON3)?n=Math.atan2(t.y,t.x)-W.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-W.PI_OVER_TWO,W.TWO_PI-W.zeroToTwoPi(n)}function Ybe(e){return W.PI_OVER_TWO-W.acosClamped(e.z)}function Hbe(e,t,n){let i=0;return W.equalsEpsilon(Math.abs(e.z),1,W.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=W.zeroToTwoPi(i+W.TWO_PI)),i}var cD=new A,lD=new A;Object.defineProperties($t.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return _c(this),this._invTransform}},viewMatrix:{get:function(){return _c(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return _c(this),this._invViewMatrix}},positionCartographic:{get:function(){return _c(this),this._positionCartographic}},positionWC:{get:function(){return _c(this),this._positionWC}},directionWC:{get:function(){return _c(this),this._directionWC}},upWC:{get:function(){return _c(this),this._upWC}},rightWC:{get:function(){return _c(this),this._rightWC}},heading:{get:function(){if(this._mode!==ie.MORPHING){let e=this._projection.ellipsoid,t=A.clone(this._transform,cD),n=Xt.eastNorthUpToFixedFrame(this.positionWC,e,lD);this._setTransform(n);let i=Obe(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==ie.MORPHING){let e=this._projection.ellipsoid,t=A.clone(this._transform,cD),n=Xt.eastNorthUpToFixedFrame(this.positionWC,e,lD);this._setTransform(n);let i=Ybe(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==ie.MORPHING){let e=this._projection.ellipsoid,t=A.clone(this._transform,cD),n=Xt.eastNorthUpToFixedFrame(this.positionWC,e,lD);this._setTransform(n);let i=Hbe(this.direction,this.up,this.right);return this._setTransform(t),i}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}});$t.prototype.update=function(e){let t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==ie.MORPHING,t=this._mode===ie.SCENE2D),t){let n=this._max2Dfrustum=this.frustum.clone(),i=2,o=n.top/n.right;n.right=this._maxCoord.x*i,n.left=-n.right,n.top=o*n.right,n.bottom=-n.top}this._mode===ie.SCENE2D&&Qbe(this,this.position)};var Krt=new h,zrt=new h,Jrt=new h;$t.prototype._setTransform=function(e){let t=h.clone(this.positionWC,Krt),n=h.clone(this.upWC,zrt),i=h.clone(this.directionWC,Jrt);A.clone(e,this._transform),this._transformChanged=!0,_c(this);let o=this._actualInvTransform;A.multiplyByPoint(o,t,this.position),A.multiplyByPointAsVector(o,i,this.direction),A.multiplyByPointAsVector(o,n,this.up),h.cross(this.direction,this.up,this.right),_c(this)};var Qrt=new B,jrt=new gn,qrt=new h,$rt=new h;function Kbe(e){if(!A.equals(A.IDENTITY,e.transform))return h.magnitude(e.position);let t=e._scene,n=t.globe,i=Qrt;i.x=t.drawingBufferWidth/2,i.y=t.drawingBufferHeight/2;let o;if(l(n)){let a=e.getPickRay(i,jrt);o=n.pickWorldCoordinates(a,t,!0,qrt)}let r;t.pickPositionSupported&&(r=t.pickPositionWorldCoordinates(i,$rt));let s;if(l(o)||l(r)){let a=l(r)?h.distance(r,e.positionWC):Number.POSITIVE_INFINITY,c=l(o)?h.distance(o,e.positionWC):Number.POSITIVE_INFINITY;s=Math.min(a,c)}else s=Math.max(e.positionCartographic.height,0);return s}$t.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof rn&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=Kbe(this)))};var dD=new h,m4=new A,est=new A,h4=new Me,f4=new q,zbe=new he;function tst(e,t,n){let i=A.clone(e.transform,m4),o=Xt.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,est);e._setTransform(o),h.clone(h.ZERO,e.position),n.heading=n.heading-W.PI_OVER_TWO;let r=Me.fromHeadingPitchRoll(n,h4),s=q.fromQuaternion(r,f4);q.getColumn(s,0,e.direction),q.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function nst(e,t,n,i){let o=A.clone(e.transform,m4);if(e._setTransform(A.IDENTITY),!h.equals(t,e.positionWC)){if(i){let a=e._projection,c=a.ellipsoid.cartesianToCartographic(t,zbe);t=a.project(c,dD)}h.clone(t,e.position)}n.heading=n.heading-W.PI_OVER_TWO;let r=Me.fromHeadingPitchRoll(n,h4),s=q.fromQuaternion(r,f4);q.getColumn(s,0,e.direction),q.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(o),e._adjustOrthographicFrustum(!0)}function ist(e,t,n,i){let o=A.clone(e.transform,m4);if(e._setTransform(A.IDENTITY),!h.equals(t,e.positionWC)){if(i){let c=e._projection,d=c.ellipsoid.cartesianToCartographic(t,zbe);t=c.project(d,dD)}B.clone(t,e.position);let r=-t.z*.5,s=-r,a=e.frustum;if(s>r){let c=a.top/a.right;a.right=s,a.left=r,a.top=a.right*c,a.bottom=-a.top}}if(e._scene.mapMode2D===Ol.ROTATE){n.heading=n.heading-W.PI_OVER_TWO,n.pitch=-W.PI_OVER_TWO,n.roll=0;let r=Me.fromHeadingPitchRoll(n,h4),s=q.fromQuaternion(r,f4);q.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right)}e._setTransform(o)}var ost=new h,rst=new h,sst=new h;function Jbe(e,t,n,i){let o=h.clone(n.direction,ost),r=h.clone(n.up,rst);if(e._scene.mode===ie.SCENE3D){let a=e._projection.ellipsoid,c=Xt.eastNorthUpToFixedFrame(t,a,cD),d=A.inverseTransformation(c,lD);A.multiplyByPointAsVector(d,o,o),A.multiplyByPointAsVector(d,r,r)}let s=h.cross(o,r,sst);return i.heading=Obe(o,r),i.pitch=Ybe(o),i.roll=Hbe(o,r,s),i}var u4={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},XV=new za;$t.prototype.setView=function(e){e=g(e,g.EMPTY_OBJECT);let t=g(e.orientation,g.EMPTY_OBJECT),n=this._mode;if(n===ie.MORPHING)return;l(e.endTransform)&&this._setTransform(e.endTransform);let i=g(e.convert,!0),o=g(e.destination,h.clone(this.positionWC,dD));l(o)&&l(o.west)&&(o=this.getRectangleCameraCoordinates(o,dD),i=!1),l(t.direction)&&(t=Jbe(this,o,t,u4.orientation)),XV.heading=g(t.heading,0),XV.pitch=g(t.pitch,-W.PI_OVER_TWO),XV.roll=g(t.roll,0),n===ie.SCENE3D?tst(this,o,XV):n===ie.SCENE2D?ist(this,o,XV,i):nst(this,o,XV,i)};var ast=new h;$t.prototype.flyHome=function(e){let t=this._mode;if(t===ie.MORPHING&&this._scene.completeMorph(),t===ie.SCENE2D)this.flyTo({destination:$t.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:A.IDENTITY});else if(t===ie.SCENE3D){let n=this.getRectangleCameraCoordinates($t.DEFAULT_VIEW_RECTANGLE),i=h.magnitude(n);i+=i*$t.DEFAULT_VIEW_FACTOR,h.normalize(n,n),h.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:A.IDENTITY})}else if(t===ie.COLUMBUS_VIEW){let n=this._projection.ellipsoid.maximumRadius,i=new h(0,-1,1);i=h.multiplyByScalar(h.normalize(i,i),5*n,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(h.normalize(i,ast).z),roll:0},endTransform:A.IDENTITY,convert:!1})}};$t.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new se),_c(this),A.multiplyByVector(this._actualInvTransform,e,t)};$t.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new h),_c(this),A.multiplyByPoint(this._actualInvTransform,e,t)};$t.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new h),_c(this),A.multiplyByPointAsVector(this._actualInvTransform,e,t)};$t.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new se),_c(this),A.multiplyByVector(this._actualTransform,e,t)};$t.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new h),_c(this),A.multiplyByPoint(this._actualTransform,e,t)};$t.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new h),_c(this),A.multiplyByPointAsVector(this._actualTransform,e,t)};function Qbe(e,t){let n=e._scene.mapMode2D===Ol.ROTATE,i=e._maxCoord.x,o=e._maxCoord.y,r,s;n?(s=i,r=-s):(s=t.x-i*2,r=t.x+i*2),t.x>i&&(t.x=s),t.x<-i&&(t.x=r),t.y>o&&(t.y=o),t.y<-o&&(t.y=-o)}var Fbe=new h;$t.prototype.move=function(e,t){let n=this.position;h.multiplyByScalar(e,t,Fbe),h.add(n,Fbe,n),this._mode===ie.SCENE2D&&Qbe(this,n),this._adjustOrthographicFrustum(!0)};$t.prototype.moveForward=function(e){e=g(e,this.defaultMoveAmount),this._mode===ie.SCENE2D?uD(this,e):this.move(this.direction,e)};$t.prototype.moveBackward=function(e){e=g(e,this.defaultMoveAmount),this._mode===ie.SCENE2D?uD(this,-e):this.move(this.direction,-e)};$t.prototype.moveUp=function(e){e=g(e,this.defaultMoveAmount),this.move(this.up,e)};$t.prototype.moveDown=function(e){e=g(e,this.defaultMoveAmount),this.move(this.up,-e)};$t.prototype.moveRight=function(e){e=g(e,this.defaultMoveAmount),this.move(this.right,e)};$t.prototype.moveLeft=function(e){e=g(e,this.defaultMoveAmount),this.move(this.right,-e)};$t.prototype.lookLeft=function(e){e=g(e,this.defaultLookAmount),this._mode!==ie.SCENE2D&&this.look(this.up,-e)};$t.prototype.lookRight=function(e){e=g(e,this.defaultLookAmount),this._mode!==ie.SCENE2D&&this.look(this.up,e)};$t.prototype.lookUp=function(e){e=g(e,this.defaultLookAmount),this._mode!==ie.SCENE2D&&this.look(this.right,-e)};$t.prototype.lookDown=function(e){e=g(e,this.defaultLookAmount),this._mode!==ie.SCENE2D&&this.look(this.right,e)};var cst=new Me,lst=new q;$t.prototype.look=function(e,t){let n=g(t,this.defaultLookAmount),i=Me.fromAxisAngle(e,-n,cst),o=q.fromQuaternion(i,lst),r=this.direction,s=this.up,a=this.right;q.multiplyByVector(o,r,r),q.multiplyByVector(o,s,s),q.multiplyByVector(o,a,a)};$t.prototype.twistLeft=function(e){e=g(e,this.defaultLookAmount),this.look(this.direction,e)};$t.prototype.twistRight=function(e){e=g(e,this.defaultLookAmount),this.look(this.direction,-e)};var dst=new Me,ust=new q;$t.prototype.rotate=function(e,t){let n=g(t,this.defaultRotateAmount),i=Me.fromAxisAngle(e,-n,dst),o=q.fromQuaternion(i,ust);q.multiplyByVector(o,this.position,this.position),q.multiplyByVector(o,this.direction,this.direction),q.multiplyByVector(o,this.up,this.up),h.cross(this.direction,this.up,this.right),h.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};$t.prototype.rotateDown=function(e){e=g(e,this.defaultRotateAmount),jbe(this,e)};$t.prototype.rotateUp=function(e){e=g(e,this.defaultRotateAmount),jbe(this,-e)};var mst=new h,hst=new h,fst=new h,Abe=new h;function jbe(e,t){let n=e.position;if(l(e.constrainedAxis)&&!h.equalsEpsilon(e.position,h.ZERO,W.EPSILON2)){let i=h.normalize(n,mst),o=h.equalsEpsilon(i,e.constrainedAxis,W.EPSILON2),r=h.equalsEpsilon(i,h.negate(e.constrainedAxis,Abe),W.EPSILON2);if(!o&&!r){let s=h.normalize(e.constrainedAxis,hst),a=h.dot(i,s),c=W.acosClamped(a);t>0&&t>c&&(t=c-W.EPSILON4),a=h.dot(i,h.negate(s,Abe)),c=W.acosClamped(a),t<0&&-t>c&&(t=-c+W.EPSILON4);let d=h.cross(s,i,fst);e.rotate(d,t)}else(o&&t<0||r&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}$t.prototype.rotateRight=function(e){e=g(e,this.defaultRotateAmount),qbe(this,-e)};$t.prototype.rotateLeft=function(e){e=g(e,this.defaultRotateAmount),qbe(this,e)};function qbe(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function uD(e,t){let n=e.frustum,i;if(t=t*.5,Math.abs(n.top)+Math.abs(n.bottom)>Math.abs(n.left)+Math.abs(n.right)){let o=n.top-t,r=n.bottom+t,s=e._maxCoord.y;e._scene.mapMode2D===Ol.ROTATE&&(s*=e.maximumZoomFactor),r>s&&(r=s,o=-s),o<=r&&(o=1,r=-1),i=n.right/n.top,n.top=o,n.bottom=r,n.right=n.top*i,n.left=-n.right}else{let o=n.right-t,r=n.left+t,s=e._maxCoord.x;e._scene.mapMode2D===Ol.ROTATE&&(s*=e.maximumZoomFactor),o>s&&(o=s,r=-s),o<=r&&(o=1,r=-1),i=n.top/n.right,n.right=o,n.left=r,n.top=n.right*i,n.bottom=-n.top}}function $be(e,t){e.move(e.direction,t)}$t.prototype.zoomIn=function(e){e=g(e,this.defaultZoomAmount),this._mode===ie.SCENE2D?uD(this,e):$be(this,e)};$t.prototype.zoomOut=function(e){e=g(e,this.defaultZoomAmount),this._mode===ie.SCENE2D?uD(this,-e):$be(this,-e)};$t.prototype.getMagnitude=function(){if(this._mode===ie.SCENE3D)return h.magnitude(this.position);if(this._mode===ie.COLUMBUS_VIEW)return Math.abs(this.position.z);if(this._mode===ie.SCENE2D)return Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom)};var pst=new A;$t.prototype.lookAt=function(e,t){let n=Xt.eastNorthUpToFixedFrame(e,oe.WGS84,pst);this.lookAtTransform(n,t)};var bst=new h,yst=new Me,gst=new Me,xst=new q;function eye(e,t,n){t=W.clamp(t,-W.PI_OVER_TWO,W.PI_OVER_TWO),e=W.zeroToTwoPi(e)-W.PI_OVER_TWO;let i=Me.fromAxisAngle(h.UNIT_Y,-t,yst),o=Me.fromAxisAngle(h.UNIT_Z,-e,gst),r=Me.multiply(o,i,o),s=q.fromQuaternion(r,xst),a=h.clone(h.UNIT_X,bst);return q.multiplyByVector(s,a,a),h.negate(a,a),h.multiplyByScalar(a,n,a),a}$t.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),!l(t))return;let n;if(l(t.heading)?n=eye(t.heading,t.pitch,t.range):n=t,this._mode===ie.SCENE2D){B.clone(B.ZERO,this.position),h.negate(n,this.up),this.up.z=0,h.magnitudeSquared(this.up)<W.EPSILON10&&h.clone(h.UNIT_Y,this.up),h.normalize(this.up,this.up),this._setTransform(A.IDENTITY),h.negate(h.UNIT_Z,this.direction),h.cross(this.direction,this.up,this.right),h.normalize(this.right,this.right);let i=this.frustum,o=i.top/i.right;i.right=h.magnitude(n)*.5,i.left=-i.right,i.top=o*i.right,i.bottom=-i.top,this._setTransform(e);return}h.clone(n,this.position),h.negate(this.position,this.direction),h.normalize(this.direction,this.direction),h.cross(this.direction,h.UNIT_Z,this.right),h.magnitudeSquared(this.right)<W.EPSILON10&&h.clone(h.UNIT_X,this.right),h.normalize(this.right,this.right),h.cross(this.right,this.direction,this.up),h.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)};var Pw=new he,_st=new he,Tst=new h,Sst=new h,Cst=new h,Vst=new h,Lst=new h,Rst=new h,Zst=new h,c4=new h,Gst={direction:new h,right:new h,up:new h},Mbe;function xc(e,t,n,i){return Math.abs(h.dot(t,n))/i-h.dot(e,n)}function tye(e,t,n,i){let o=e._projection.ellipsoid,r=i?e:Gst,s=t.north,a=t.south,c=t.east,d=t.west;d>c&&(c+=W.TWO_PI);let u=(d+c)*.5,m;if(a<-W.PI_OVER_TWO+W.RADIANS_PER_DEGREE&&s>W.PI_OVER_TWO-W.RADIANS_PER_DEGREE)m=0;else{let F=Pw;F.longitude=u,F.latitude=s,F.height=0;let M=_st;M.longitude=u,M.latitude=a,M.height=0;let b=Mbe;(!l(b)||b.ellipsoid!==o)&&(Mbe=b=new xp(void 0,void 0,o)),b.setEndPoints(F,M),m=b.interpolateUsingFraction(.5,Pw).latitude}let p=Pw;p.longitude=u,p.latitude=m,p.height=0;let y=o.cartographicToCartesian(p,Zst),f=Pw;f.longitude=c,f.latitude=s;let x=o.cartographicToCartesian(f,Tst);f.longitude=d;let _=o.cartographicToCartesian(f,Cst);f.longitude=u;let C=o.cartographicToCartesian(f,Lst);f.latitude=a;let V=o.cartographicToCartesian(f,Rst);f.longitude=c;let L=o.cartographicToCartesian(f,Vst);f.longitude=d;let Z=o.cartographicToCartesian(f,Sst);h.subtract(_,y,_),h.subtract(L,y,L),h.subtract(x,y,x),h.subtract(Z,y,Z),h.subtract(C,y,C),h.subtract(V,y,V);let G=o.geodeticSurfaceNormal(y,r.direction);h.negate(G,G);let I=h.cross(G,h.UNIT_Z,r.right);h.normalize(I,I);let P=h.cross(I,G,r.up),v;if(e.frustum instanceof rn){let F=Math.max(h.distance(x,_),h.distance(L,Z)),M=Math.max(h.distance(x,L),h.distance(_,Z)),b,R,E=e.frustum._offCenterFrustum,X=E.right/E.top,w=M*X;F>w?(b=F,R=b/X):(R=M,b=w),v=Math.max(b,R)}else{let F=Math.tan(e.frustum.fovy*.5),M=e.frustum.aspectRatio*F;if(v=Math.max(xc(G,P,_,F),xc(G,P,L,F),xc(G,P,x,F),xc(G,P,Z,F),xc(G,P,C,F),xc(G,P,V,F),xc(G,I,_,M),xc(G,I,L,M),xc(G,I,x,M),xc(G,I,Z,M),xc(G,I,C,M),xc(G,I,V,M)),a<0&&s>0){let b=Pw;b.longitude=d,b.latitude=0,b.height=0;let R=o.cartographicToCartesian(b,c4);h.subtract(R,y,R),v=Math.max(v,xc(G,P,R,F),xc(G,I,R,M)),b.longitude=c,R=o.cartographicToCartesian(b,c4),h.subtract(R,y,R),v=Math.max(v,xc(G,P,R,F),xc(G,I,R,M))}}return h.add(y,h.multiplyByScalar(G,-v,c4),n)}var Est=new he,Ist=new h,Xst=new h;function Wst(e,t,n){let i=e._projection;t.west>t.east&&(t=de.MAX_VALUE);let o=e._actualTransform,r=e._actualInvTransform,s=Est;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,Ist);A.multiplyByPoint(o,a,a),A.multiplyByPoint(r,a,a),s.longitude=t.west,s.latitude=t.south;let c=i.project(s,Xst);if(A.multiplyByPoint(o,c,c),A.multiplyByPoint(r,c,c),n.x=(a.x-c.x)*.5+c.x,n.y=(a.y-c.y)*.5+c.y,l(e.frustum.fovy)){let d=Math.tan(e.frustum.fovy*.5),u=e.frustum.aspectRatio*d;n.z=Math.max((a.x-c.x)/u,(a.y-c.y)/d)*.5}else{let d=a.x-c.x,u=a.y-c.y;n.z=Math.max(d,u)}return n}var Pst=new he,vst=new h,wst=new h;function Fst(e,t,n){let i=e._projection,o=t.east;t.west>t.east&&(e._scene.mapMode2D===Ol.INFINITE_SCROLL?o+=W.TWO_PI:(t=de.MAX_VALUE,o=t.east));let r=Pst;r.longitude=o,r.latitude=t.north;let s=i.project(r,vst);r.longitude=t.west,r.latitude=t.south;let a=i.project(r,wst),c=Math.abs(s.x-a.x)*.5,d=Math.abs(s.y-a.y)*.5,u,m,p=e.frustum.right/e.frustum.top,y=d*p;return c>y?(u=c,m=u/p):(m=d,u=y),d=Math.max(2*u,2*m),n.x=(s.x-a.x)*.5+a.x,n.y=(s.y-a.y)*.5+a.y,r=i.unproject(n,r),r.height=d,n=i.project(r,n),n}$t.prototype.getRectangleCameraCoordinates=function(e,t){let n=this._mode;if(l(t)||(t=new h),n===ie.SCENE3D)return tye(this,e,t);if(n===ie.COLUMBUS_VIEW)return Wst(this,e,t);if(n===ie.SCENE2D)return Fst(this,e,t)};var Ast=new gn;function Mst(e,t,n,i){n=g(n,oe.WGS84);let o=e.getPickRay(t,Ast),r=ni.rayEllipsoid(o,n);if(!r)return;let s=r.start>0?r.start:r.stop;return gn.getPoint(o,s,i)}var Nst=new gn;function Ust(e,t,n,i){let r=e.getPickRay(t,Nst).origin;r=h.fromElements(r.y,r.z,0,r);let s=n.unproject(r);if(!(s.latitude<-W.PI_OVER_TWO||s.latitude>W.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(s,i)}var kst=new gn;function Dst(e,t,n,i){let o=e.getPickRay(t,kst),r=-o.origin.x/o.direction.x;gn.getPoint(o,r,i);let s=n.unproject(new h(i.y,i.z,0));if(!(s.latitude<-W.PI_OVER_TWO||s.latitude>W.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(s,i)}$t.prototype.pickEllipsoid=function(e,t,n){let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(l(n)||(n=new h),t=g(t,oe.WGS84),this._mode===ie.SCENE3D)n=Mst(this,e,t,n);else if(this._mode===ie.SCENE2D)n=Ust(this,e,this._projection,n);else if(this._mode===ie.COLUMBUS_VIEW)n=Dst(this,e,this._projection,n);else return;return n}};var Bst=new h,Ost=new h,Yst=new h;function Hst(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=Math.tan(e.frustum.fovy*.5),a=e.frustum.aspectRatio*s,c=e.frustum.near,d=2/o*t.x-1,u=2/r*(r-t.y)-1,m=e.positionWC;h.clone(m,n.origin);let p=h.multiplyByScalar(e.directionWC,c,Bst);h.add(m,p,p);let y=h.multiplyByScalar(e.rightWC,d*c*a,Ost),f=h.multiplyByScalar(e.upWC,u*c*s,Yst),x=h.add(p,y,n.direction);return h.add(x,f,x),h.subtract(x,m,x),h.normalize(x,x),n}var sD=new h;function Kst(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=e.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2/o*t.x-1;c*=(s.right-s.left)*.5;let d=2/r*(r-t.y)-1;d*=(s.top-s.bottom)*.5;let u=n.origin;return h.clone(e.position,u),h.multiplyByScalar(e.right,c,sD),h.add(sD,u,u),h.multiplyByScalar(e.up,d,sD),h.add(sD,u,u),h.clone(e.directionWC,n.direction),(e._mode===ie.COLUMBUS_VIEW||e._mode===ie.SCENE2D)&&h.fromElements(n.origin.z,n.origin.x,n.origin.y,n.origin),n}$t.prototype.getPickRay=function(e,t){l(t)||(t=new gn);let n=this._scene.canvas;if(n.clientWidth<=0||n.clientHeight<=0)return;let i=this.frustum;return l(i.aspectRatio)&&l(i.fov)&&l(i.near)?Hst(this,e,t):Kst(this,e,t)};var zst=new h,Jst=new h;$t.prototype.distanceToBoundingSphere=function(e){let t=h.subtract(this.positionWC,e.center,zst),n=h.multiplyByScalar(this.directionWC,h.dot(t,this.directionWC),Jst);return Math.max(0,h.magnitude(n)-e.radius)};var Qst=new B;$t.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),o=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,Qst);return Math.max(o.x,o.y)};function jst(e,t,n,i,o,r){let s=h.clone(t);n.y>i?s.y-=n.y-i:n.y<-i&&(s.y+=-i-n.y),n.z>o?s.z-=n.z-o:n.z<-o&&(s.z+=-o-n.z);function a(c){let d=h.lerp(t,s,c.time,new h);e.worldToCameraCoordinatesPoint(d,e.position)}return{easingFunction:Ar.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:r,update:a}}var qst=new h,Nbe=new h,$st=new h,eat=new h;function tat(e,t){let n=e.position,i=e.direction,o=e.worldToCameraCoordinatesVector(h.UNIT_X,qst),r=-h.dot(o,n)/h.dot(o,i),s=h.add(n,h.multiplyByScalar(i,r,Nbe),Nbe);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,$st);let a=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*a,d=h.magnitude(h.subtract(n,s,eat)),u=c*d,m=a*d,p=e._maxCoord.x,y=e._maxCoord.y,f=Math.max(u-p,p),x=Math.max(m-y,y);if(n.z<-f||n.z>f||n.y<-x||n.y>x){let _=s.y<-f||s.y>f,C=s.z<-x||s.z>x;if(_||C)return jst(e,n,s,f,x,t)}}$t.prototype.createCorrectPositionTween=function(e){if(this._mode===ie.COLUMBUS_VIEW)return tat(this,e)};var nat=new h,Ks={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};$t.prototype.cancelFlight=function(){l(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};$t.prototype.completeFlight=function(){if(l(this._currentFlight)){this._currentFlight.cancelTween();let e={destination:void 0,orientation:{heading:void 0,pitch:void 0,roll:void 0}};e.destination=Ks.destination,e.orientation.heading=Ks.heading,e.orientation.pitch=Ks.pitch,e.orientation.roll=Ks.roll,this.setView(e),l(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};$t.prototype.flyTo=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.destination;if(this._mode===ie.MORPHING)return;this.cancelFlight();let i=t instanceof de;i&&(t=this.getRectangleCameraCoordinates(t,nat));let o=g(e.orientation,g.EMPTY_OBJECT);if(l(o.direction)&&(o=Jbe(this,t,o,u4.orientation)),l(e.duration)&&e.duration<=0){let u=u4;u.destination=e.destination,u.orientation.heading=o.heading,u.orientation.pitch=o.pitch,u.orientation.roll=o.roll,u.convert=e.convert,u.endTransform=e.endTransform,this.setView(u),typeof e.complete=="function"&&e.complete();return}let r=this,s;Ks.destination=t,Ks.heading=o.heading,Ks.pitch=o.pitch,Ks.roll=o.roll,Ks.duration=e.duration,Ks.complete=function(){s===r._currentFlight&&(r._currentFlight=void 0),l(e.complete)&&e.complete()},Ks.cancel=e.cancel,Ks.endTransform=e.endTransform,Ks.convert=i?!1:e.convert,Ks.maximumHeight=e.maximumHeight,Ks.pitchAdjustHeight=e.pitchAdjustHeight,Ks.flyOverLongitude=e.flyOverLongitude,Ks.flyOverLongitudeWeight=e.flyOverLongitudeWeight,Ks.easingFunction=e.easingFunction;let a=this._scene,c=Ww.createTween(a,Ks);if(c.duration===0){typeof c.complete=="function"&&c.complete();return}s=a.tweens.add(c),this._currentFlight=s;let d=this._scene.preloadFlightCamera;this._mode!==ie.SCENE2D&&(l(d)||(d=$t.clone(this)),d.setView({destination:t,orientation:o}),this._scene.preloadFlightCullingVolume=d.frustum.computeCullingVolume(d.positionWC,d.directionWC,d.upWC))};function iat(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),o=n.aspectRatio*i;return Math.max(t/o,t/i)}function oat(e,t){let n=e.frustum,i=n.offCenterFrustum;l(i)&&(n=i);let o,r,s=n.right/n.top,a=t*s;return t>a?(o=t,r=o/s):(r=t,o=a),Math.max(o,r)*1.5}var rat=100;function nye(e,t,n){n=Ou.clone(l(n)?n:$t.DEFAULT_OFFSET);let i=e._scene.screenSpaceCameraController.minimumZoomDistance,o=e._scene.screenSpaceCameraController.maximumZoomDistance,r=n.range;if(!l(r)||r===0){let s=t.radius;s===0?n.range=rat:e.frustum instanceof rn||e._mode===ie.SCENE2D?n.range=oat(e,s):n.range=iat(e,s),n.range=W.clamp(n.range,i,o)}return n}$t.prototype.viewBoundingSphere=function(e,t){t=nye(this,e,t),this.lookAt(e.center,t)};var sat=new A,aat=new h,cat=new h,lat=new h,dat=new h,uat=new se,mat=new Me,hat=new q;$t.prototype.flyToBoundingSphere=function(e,t){t=g(t,g.EMPTY_OBJECT);let n=this._mode===ie.SCENE2D||this._mode===ie.COLUMBUS_VIEW;this._setTransform(A.IDENTITY);let i=nye(this,e,t.offset),o;n?o=h.multiplyByScalar(h.UNIT_Z,i.range,aat):o=eye(i.heading,i.pitch,i.range);let r=Xt.eastNorthUpToFixedFrame(e.center,oe.WGS84,sat);A.multiplyByPoint(r,o,o);let s,a;if(!n){if(s=h.subtract(e.center,o,cat),h.normalize(s,s),a=A.multiplyByPointAsVector(r,h.UNIT_Z,lat),1-Math.abs(h.dot(s,a))<W.EPSILON6){let d=Me.fromAxisAngle(s,i.heading,mat),u=q.fromQuaternion(d,hat);h.fromCartesian4(A.getColumn(r,1,uat),a),q.multiplyByVector(u,a,a)}let c=h.cross(s,a,dat);h.cross(c,s,a),h.normalize(a,a)}this.flyTo({destination:o,orientation:{direction:s,up:a},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 Ube=new h,kbe=new h,l4=new h,Dbe=new h,vw=[new h,new h,new h,new h];function fat(e,t){let n=t.radii,i=e.positionWC,o=h.multiplyComponents(t.oneOverRadii,i,Ube),r=h.magnitude(o),s=h.normalize(o,kbe),a,c;h.equalsEpsilon(s,h.UNIT_Z,W.EPSILON10)?(a=new h(0,1,0),c=new h(0,0,1)):(a=h.normalize(h.cross(h.UNIT_Z,s,l4),l4),c=h.normalize(h.cross(s,a,Dbe),Dbe));let d=Math.sqrt(h.magnitudeSquared(o)-1),u=h.multiplyByScalar(s,1/r,Ube),m=d/r,p=h.multiplyByScalar(a,m,kbe),y=h.multiplyByScalar(c,m,l4),f=h.add(u,y,vw[0]);h.subtract(f,p,f),h.multiplyComponents(n,f,f);let x=h.subtract(u,y,vw[1]);h.subtract(x,p,x),h.multiplyComponents(n,x,x);let _=h.subtract(u,y,vw[2]);h.add(_,p,_),h.multiplyComponents(n,_,_);let C=h.add(u,y,vw[3]);return h.add(C,p,C),h.multiplyComponents(n,C,C),vw}var d4=new B,pat=new h,sg=[new he,new he,new he,new he];function aD(e,t,n,i,o,r){d4.x=e,d4.y=t;let s=i.pickEllipsoid(d4,o,pat);return l(s)?(sg[n]=o.cartesianToCartographic(s,sg[n]),1):(sg[n]=o.cartesianToCartographic(r[n],sg[n]),0)}$t.prototype.computeViewRectangle=function(e,t){e=g(e,oe.WGS84);let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new ce(h.ZERO,e.maximumRadius);if(n.computeVisibility(i)===nn.OUTSIDE)return;let r=this._scene.canvas,s=r.clientWidth,a=r.clientHeight,c=0,d=fat(this,e);if(c+=aD(0,0,0,this,e,d),c+=aD(0,a,1,this,e,d),c+=aD(s,a,2,this,e,d),c+=aD(s,0,3,this,e,d),c<2)return de.MAX_VALUE;t=de.fromCartographicArray(sg,t);let u=0,m=sg[3].longitude;for(let p=0;p<4;++p){let y=sg[p].longitude,f=Math.abs(y-m);f>W.PI?u+=W.TWO_PI-f:u+=f,m=y}return W.equalsEpsilon(Math.abs(u),W.TWO_PI,W.EPSILON9)&&(t.west=-W.PI,t.east=W.PI,sg[0].latitude>=0?t.north=W.PI_OVER_TWO:t.south=-W.PI_OVER_TWO),t};$t.prototype.switchToPerspectiveFrustum=function(){if(this._mode===ie.SCENE2D||this.frustum instanceof Li)return;let e=this._scene;this.frustum=new Li,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=W.toRadians(60)};$t.prototype.switchToOrthographicFrustum=function(){if(this._mode===ie.SCENE2D||this.frustum instanceof rn)return;let e=Kbe(this),t=this._scene;this.frustum=new rn,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};$t.clone=function(e,t){return l(t)||(t=new $t(e._scene)),h.clone(e.position,t.position),h.clone(e.direction,t.direction),h.clone(e.up,t.up),h.clone(e.right,t.right),A.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var fo=$t;var RLi=T(S(),1);function bat(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var em=bat;var vLi=T(S(),1);var aye=T($l(),1),iye=576,yat=100,ww="#ffffff",p4="#48b";function cye(e,t){this.credit=e,this.count=g(t,1)}function gat(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i];if(Vt.equals(o,t))return!0}return!1}function xat(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;Vt.equals(n,t)||(l(t)&&e._cesiumCreditContainer.removeChild(t.element),l(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var lye="cesium-credit-delimiter";function oye(e){let t=document.createElement("span");return t.textContent=e,t.className=lye,t}function rye(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function sye(e,t,n,i){let o=e.childNodes,r=-1;t.sort(function(s,a){return a.count-s.count});for(let s=0;s<t.length;++s){let a=t[s].credit;if(l(a)){if(r=s,l(n)&&(r*=2,s>0)){let d=r-1;if(o.length<=d)e.appendChild(oye(n));else{let u=o[d];u.className!==lye&&e.replaceChild(oye(n),u)}}let c=a.element;if(o.length<=r)e.appendChild(rye(c,i));else{let d=o[r];d._creditId!==a._id&&e.replaceChild(rye(c,i),d)}}}for(++r;r<o.length;)e.removeChild(o[r])}function _at(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<iye?(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((i-t.clientHeight)*.5)}px`),e._lastViewportWidth=n),n>=iye&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function Tc(e,t){let n=`${e} {`;for(let i in t)t.hasOwnProperty(i)&&(n+=`${i}: ${t[i]}; `);return n+=` }
`,n}function Tat(e){let t="";t+=Tc(".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)"}),t+=Tc(".cesium-credit-lightbox",{"background-color":"#303336",color:ww,position:"relative","min-height":`${yat}px`,margin:"auto"}),t+=Tc(".cesium-credit-lightbox > ul > li a, .cesium-credit-lightbox > ul > li a:visited",{color:ww}),t+=Tc(".cesium-credit-lightbox > ul > li a:hover",{color:p4}),t+=Tc(".cesium-credit-lightbox.cesium-credit-lightbox-expanded",{border:"1px solid #444","border-radius":"5px","max-width":"370px"}),t+=Tc(".cesium-credit-lightbox.cesium-credit-lightbox-mobile",{height:"100%",width:"100%"}),t+=Tc(".cesium-credit-lightbox-title",{padding:"20px 20px 0 20px"}),t+=Tc(".cesium-credit-lightbox-close",{"font-size":"18pt",cursor:"pointer",position:"absolute",top:"0",right:"6px",color:ww}),t+=Tc(".cesium-credit-lightbox-close:hover",{color:p4}),t+=Tc(".cesium-credit-lightbox > ul",{margin:"0",padding:"12px 20px 12px 40px","font-size":"13px"}),t+=Tc(".cesium-credit-lightbox > ul > li",{"padding-bottom":"6px"}),t+=Tc(".cesium-credit-lightbox > ul > li *",{padding:"0",margin:"0"}),t+=Tc(".cesium-credit-expand-link",{"padding-left":"5px",cursor:"pointer","text-decoration":"underline",color:ww}),t+=Tc(".cesium-credit-expand-link:hover",{color:p4}),t+=Tc(".cesium-credit-text",{color:ww}),t+=Tc(".cesium-credit-textContainer *, .cesium-credit-logoContainer *",{display:"inline"});function n(r){if(r.shadowRoot)return r.shadowRoot;if(r.getRootNode){let s=r.getRootNode();if(s instanceof ShadowRoot)return s}}let i=g(n(e),document.head),o=document.createElement("style");o.innerHTML=t,i.appendChild(o)}function hr(e,t,n){let i=this;n=g(n,document.body);let o=document.createElement("div");o.className="cesium-credit-lightbox-overlay",n.appendChild(o);let r=document.createElement("div");r.className="cesium-credit-lightbox",o.appendChild(r);function s(f){r.contains(f.target)||i.hideLightbox()}o.addEventListener("click",s,!1);let a=document.createElement("div");a.className="cesium-credit-lightbox-title",a.textContent="Data provided by:",r.appendChild(a);let c=document.createElement("a");c.onclick=this.hideLightbox.bind(this),c.innerHTML="&times;",c.className="cesium-credit-lightbox-close",r.appendChild(c);let d=document.createElement("ul");r.appendChild(d);let u=document.createElement("div");u.className="cesium-credit-logoContainer",u.style.display="inline",e.appendChild(u);let m=document.createElement("div");m.className="cesium-credit-textContainer",m.style.display="inline",e.appendChild(m);let p=document.createElement("a");p.className="cesium-credit-expand-link",p.onclick=this.showLightbox.bind(this),p.textContent="Data attribution",e.appendChild(p),Tat(e);let y=Vt.clone(hr.cesiumCredit);this._delimiter=g(t," \u2022 "),this._screenContainer=m,this._cesiumCreditContainer=u,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=r,this._creditList=d,this._lightbox=o,this._hideLightbox=s,this._expandLink=p,this._expanded=!1,this._staticCredits=[],this._cesiumCredit=y,this._previousCesiumCredit=void 0,this._currentCesiumCredit=y,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new Ct,lightboxCredits:new Ct},this._defaultCredit=void 0,this.viewport=n,this.container=e}function dye(e,t,n,i){i=g(i,1);let o=t.get(n.id);if(l(o))o.count<Number.MAX_VALUE&&(o.count+=i);else{let r=e._creditDisplayElementPool,s=e._creditDisplayElementPoolIndex;s<r.length?(o=r[s],o.credit=n,o.count=i):(o=new cye(n,i),r.push(o)),++e._creditDisplayElementPoolIndex,t.set(n.id,o)}}hr.prototype.addCreditToNextFrame=function(e){if(e.isIon()){l(this._defaultCredit)||(this._defaultCredit=Vt.clone(uye())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,dye(this,t,e)};hr.prototype.addStaticCredit=function(e){let t=this._staticCredits;gat(t,e)||t.push(e)};hr.prototype.removeStaticCredit=function(e){let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};hr.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0};hr.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1};hr.prototype.update=function(){this._expanded&&_at(this)};hr.prototype.beginFrame=function(){let e=this._currentFrameCredits;this._creditDisplayElementPoolIndex=0;let t=e.screenCredits,n=e.lightboxCredits;t.removeAll(),n.removeAll();let i=this._staticCredits;for(let o=0;o<i.length;++o){let r=i[o],s=r.showOnScreen?t:n;r.isIon()&&Vt.equals(hr.cesiumCredit,this._cesiumCredit)||dye(this,s,r,Number.MAX_VALUE)}Vt.equals(hr.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=Vt.clone(hr.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};hr.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;sye(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",sye(this._creditList,t,void 0,"li"),xat(this)};hr.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),ue(this)};hr.prototype.isDestroyed=function(){return!1};hr._cesiumCredit=void 0;hr._cesiumCreditInitialized=!1;var mD;function uye(){if(!l(mD)){let e=on("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new aye.default(e).path()),mD=new Vt(`<a href="https://cesium.com/" target="_blank"><img src="${e}" title="Cesium ion"/></a>`,!0)}return hr._cesiumCreditInitialized||(hr._cesiumCredit=mD,hr._cesiumCreditInitialized=!0),mD}Object.defineProperties(hr,{cesiumCredit:{get:function(){return uye(),hr._cesiumCredit},set:function(e){hr._cesiumCredit=e,hr._cesiumCreditInitialized=!0}}});hr.CreditDisplayElement=cye;var Fw=hr;var WRi=T(S(),1);var qLi=T(S(),1);var hD=0,Sat=1;function yT(e){let t=e.frustum,n=e.orientation,i=e.origin,o=g(e.vertexFormat,Pe.DEFAULT),r=g(e._drawNearPlane,!0),s,a;t instanceof Li?(s=hD,a=Li.packedLength):t instanceof rn&&(s=Sat,a=rn.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=Me.clone(n),this._drawNearPlane=r,this._vertexFormat=o,this._workerName="createFrustumGeometry",this.packedLength=2+a+h.packedLength+Me.packedLength+Pe.packedLength}yT.pack=function(e,t,n){n=g(n,0);let i=e._frustumType,o=e._frustum;return t[n++]=i,i===hD?(Li.pack(o,t,n),n+=Li.packedLength):(rn.pack(o,t,n),n+=rn.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,Me.pack(e._orientation,t,n),n+=Me.packedLength,Pe.pack(e._vertexFormat,t,n),n+=Pe.packedLength,t[n]=e._drawNearPlane?1:0,t};var Cat=new Li,Vat=new rn,Lat=new Me,Rat=new h,Zat=new Pe;yT.unpack=function(e,t,n){t=g(t,0);let i=e[t++],o;i===hD?(o=Li.unpack(e,t,Cat),t+=Li.packedLength):(o=rn.unpack(e,t,Vat),t+=rn.packedLength);let r=h.unpack(e,t,Rat);t+=h.packedLength;let s=Me.unpack(e,t,Lat);t+=Me.packedLength;let a=Pe.unpack(e,t,Zat);t+=Pe.packedLength;let c=e[t]===1;if(!l(n))return new yT({frustum:o,origin:r,orientation:s,vertexFormat:a,_drawNearPlane:c});let d=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(d),n._frustumType=i,n._origin=h.clone(r,n._origin),n._orientation=Me.clone(s,n._orientation),n._vertexFormat=Pe.clone(a,n._vertexFormat),n._drawNearPlane=c,n};function WV(e,t,n,i,o,r,s,a){let c=e/3*2;for(let d=0;d<4;++d)l(t)&&(t[e]=r.x,t[e+1]=r.y,t[e+2]=r.z),l(n)&&(n[e]=s.x,n[e+1]=s.y,n[e+2]=s.z),l(i)&&(i[e]=a.x,i[e+1]=a.y,i[e+2]=a.z),e+=3;o[c]=0,o[c+1]=0,o[c+2]=1,o[c+3]=0,o[c+4]=1,o[c+5]=1,o[c+6]=0,o[c+7]=1}var Gat=new q,Eat=new A,b4=new A,mye=new h,hye=new h,fye=new h,Iat=new h,Xat=new h,Wat=new h,ag=new Array(3),Aw=new Array(4);Aw[0]=new se(-1,-1,1,1);Aw[1]=new se(1,-1,1,1);Aw[2]=new se(1,1,1,1);Aw[3]=new se(-1,1,1,1);var pye=new Array(4);for(let e=0;e<4;++e)pye[e]=new se;yT._computeNearFarPlanes=function(e,t,n,i,o,r,s,a){let c=q.fromQuaternion(t,Gat),d=g(r,mye),u=g(s,hye),m=g(a,fye);d=q.getColumn(c,0,d),u=q.getColumn(c,1,u),m=q.getColumn(c,2,m),h.normalize(d,d),h.normalize(u,u),h.normalize(m,m),h.negate(d,d);let p=A.computeView(e,m,u,d,Eat),y,f,x=i.projectionMatrix;if(n===hD){let _=A.multiply(x,p,b4);f=A.inverse(_,b4)}else y=A.inverseTransformation(p,b4);l(f)?(ag[0]=i.near,ag[1]=i.far):(ag[0]=0,ag[1]=i.near,ag[2]=i.far);for(let _=0;_<2;++_)for(let C=0;C<4;++C){let V=se.clone(Aw[C],pye[C]);if(l(f)){V=A.multiplyByVector(f,V,V);let L=1/V.w;h.multiplyByScalar(V,L,V),h.subtract(V,e,V),h.normalize(V,V);let Z=h.dot(m,V);h.multiplyByScalar(V,ag[_]/Z,V),h.add(V,e,V)}else{let L=i.offCenterFrustum;l(L)&&(i=L);let Z=ag[_],G=ag[_+1];V.x=(V.x*(i.right-i.left)+i.left+i.right)*.5,V.y=(V.y*(i.top-i.bottom)+i.bottom+i.top)*.5,V.z=(V.z*(Z-G)-Z-G)*.5,V.w=1,A.multiplyByVector(y,V,V)}o[12*_+C*3]=V.x,o[12*_+C*3+1]=V.y,o[12*_+C*3+2]=V.z}};yT.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,s=e._vertexFormat,a=r?6:5,c=new Float64Array(3*4*6);yT._computeNearFarPlanes(i,o,t,n,c);let d=3*4*2;c[d]=c[3*4],c[d+1]=c[3*4+1],c[d+2]=c[3*4+2],c[d+3]=c[0],c[d+4]=c[1],c[d+5]=c[2],c[d+6]=c[3*3],c[d+7]=c[3*3+1],c[d+8]=c[3*3+2],c[d+9]=c[3*7],c[d+10]=c[3*7+1],c[d+11]=c[3*7+2],d+=3*4,c[d]=c[3*5],c[d+1]=c[3*5+1],c[d+2]=c[3*5+2],c[d+3]=c[3],c[d+4]=c[4],c[d+5]=c[5],c[d+6]=c[0],c[d+7]=c[1],c[d+8]=c[2],c[d+9]=c[3*4],c[d+10]=c[3*4+1],c[d+11]=c[3*4+2],d+=3*4,c[d]=c[3],c[d+1]=c[4],c[d+2]=c[5],c[d+3]=c[3*5],c[d+4]=c[3*5+1],c[d+5]=c[3*5+2],c[d+6]=c[3*6],c[d+7]=c[3*6+1],c[d+8]=c[3*6+2],c[d+9]=c[3*2],c[d+10]=c[3*2+1],c[d+11]=c[3*2+2],d+=3*4,c[d]=c[3*2],c[d+1]=c[3*2+1],c[d+2]=c[3*2+2],c[d+3]=c[3*6],c[d+4]=c[3*6+1],c[d+5]=c[3*6+2],c[d+6]=c[3*7],c[d+7]=c[3*7+1],c[d+8]=c[3*7+2],c[d+9]=c[3*3],c[d+10]=c[3*3+1],c[d+11]=c[3*3+2],r||(c=c.subarray(3*4));let u=new pn({position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:c})});if(l(s.normal)||l(s.tangent)||l(s.bitangent)||l(s.st)){let p=l(s.normal)?new Float32Array(12*a):void 0,y=l(s.tangent)?new Float32Array(3*4*a):void 0,f=l(s.bitangent)?new Float32Array(3*4*a):void 0,x=l(s.st)?new Float32Array(2*4*a):void 0,_=mye,C=hye,V=fye,L=h.negate(_,Iat),Z=h.negate(C,Xat),G=h.negate(V,Wat);d=0,r&&(WV(d,p,y,f,x,G,_,C),d+=3*4),WV(d,p,y,f,x,V,L,C),d+=3*4,WV(d,p,y,f,x,L,G,C),d+=3*4,WV(d,p,y,f,x,Z,G,L),d+=3*4,WV(d,p,y,f,x,_,V,C),d+=3*4,WV(d,p,y,f,x,C,V,L),l(p)&&(u.normal=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:p})),l(y)&&(u.tangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:y})),l(f)&&(u.bitangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:f})),l(x)&&(u.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:x}))}let m=new Uint16Array(6*a);for(let p=0;p<a;++p){let y=p*6,f=p*4;m[y]=f,m[y+1]=f+1,m[y+2]=f+2,m[y+3]=f,m[y+4]=f+2,m[y+5]=f+3}return new mt({attributes:u,indices:m,primitiveType:Ae.TRIANGLES,boundingSphere:ce.fromVertices(c)})};var gT=yT;var hRi=T(S(),1);var y4=0,Pat=1;function Mw(e){let t=e.frustum,n=e.orientation,i=e.origin,o=g(e._drawNearPlane,!0),r,s;t instanceof Li?(r=y4,s=Li.packedLength):t instanceof rn&&(r=Pat,s=rn.packedLength),this._frustumType=r,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=Me.clone(n),this._drawNearPlane=o,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+s+h.packedLength+Me.packedLength}Mw.pack=function(e,t,n){n=g(n,0);let i=e._frustumType,o=e._frustum;return t[n++]=i,i===y4?(Li.pack(o,t,n),n+=Li.packedLength):(rn.pack(o,t,n),n+=rn.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,Me.pack(e._orientation,t,n),n+=Me.packedLength,t[n]=e._drawNearPlane?1:0,t};var vat=new Li,wat=new rn,Fat=new Me,Aat=new h;Mw.unpack=function(e,t,n){t=g(t,0);let i=e[t++],o;i===y4?(o=Li.unpack(e,t,vat),t+=Li.packedLength):(o=rn.unpack(e,t,wat),t+=rn.packedLength);let r=h.unpack(e,t,Aat);t+=h.packedLength;let s=Me.unpack(e,t,Fat);t+=Me.packedLength;let a=e[t]===1;if(!l(n))return new Mw({frustum:o,origin:r,orientation:s,_drawNearPlane:a});let c=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(c),n._frustumType=i,n._origin=h.clone(r,n._origin),n._orientation=Me.clone(s,n._orientation),n._drawNearPlane=a,n};Mw.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,s=new Float64Array(3*4*2);gT._computeNearFarPlanes(i,o,t,n,s);let a=new pn({position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:s})}),c,d,u=r?2:1,m=new Uint16Array(8*(u+1)),p=r?0:1;for(;p<2;++p)c=r?p*8:0,d=p*4,m[c]=d,m[c+1]=d+1,m[c+2]=d+1,m[c+3]=d+2,m[c+4]=d+2,m[c+5]=d+3,m[c+6]=d+3,m[c+7]=d;for(p=0;p<2;++p)c=(u+p)*8,d=p*4,m[c]=d,m[c+1]=d+4,m[c+2]=d+1,m[c+3]=d+5,m[c+4]=d+2,m[c+5]=d+6,m[c+6]=d+3,m[c+7]=d+7;return new mt({attributes:a,indices:m,primitiveType:Ae.LINES,boundingSphere:ce.fromVertices(s)})};var Nw=Mw;function fD(e){e=g(e,g.EMPTY_OBJECT),this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=g(e.color,O.CYAN),this._updateOnChange=g(e.updateOnChange,!0),this.show=g(e.show,!0),this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var Mat=new h,Nat=new q,Uat=new Me,kat=new Li,Dat=new nl,Bat=new rn,Oat=new Vr,Yat=new O,Hat=[1,1e5];fD.prototype.update=function(e){if(!this.show)return;let t=this._planesPrimitives,n=this._outlinePrimitives,i,o;if(this._updateOnChange){for(o=t.length,i=0;i<o;++i)n[i]=n[i]&&n[i].destroy(),t[i]=t[i]&&t[i].destroy();t.length=0,n.length=0}if(t.length===0){let r=this._camera,s=r.frustum,a;s instanceof Li?a=kat:s instanceof nl?a=Dat:s instanceof rn?a=Bat:a=Oat,a=s.clone(a);let c,d=this._frustumSplits;!l(d)||d.length<=1?(d=Hat,d[0]=this._camera.frustum.near,d[1]=this._camera.frustum.far,c=1):c=d.length-1;let u=r.positionWC,m=r.directionWC,p=r.upWC,y=r.rightWC;y=h.negate(y,Mat);let f=Nat;q.setColumn(f,0,y,f),q.setColumn(f,1,p,f),q.setColumn(f,2,m,f);let x=Me.fromRotationMatrix(f,Uat);for(t.length=n.length=c,i=0;i<c;++i)a.near=d[i],a.far=d[i+1],t[i]=new En({geometryInstances:new St({geometry:new gT({origin:u,orientation:x,frustum:a,_drawNearPlane:i===0}),attributes:{color:Ot.fromColor(O.fromAlpha(this._color,.1,Yat))},id:this.id,pickPrimitive:this}),appearance:new cn({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new En({geometryInstances:new St({geometry:new Nw({origin:u,orientation:x,frustum:a,_drawNearPlane:i===0}),attributes:{color:Ot.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new cn({translucent:!1,flat:!0}),asynchronous:!1})}for(o=t.length,i=0;i<o;++i)n[i].update(e),t[i].update(e)};fD.prototype.isDestroyed=function(){return!1};fD.prototype.destroy=function(){let e=this._planesPrimitives.length;for(let 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 ue(this)};var Uf=fD;var tZi=T(S(),1);function kw(e){this._rs=void 0,this._sp=void 0,this._va=void 0,this._command=void 0,this._mode=void 0,this._useLogDepth=!1,this._ellipsoidOffset=g(e,0)}var Uw=Bt.supportsTypedArrays()?new Float32Array(12):[],bye=new h,yye=new h,g4=new h,gye=new h,pD=new h;function Kat(e,t){let n=e.radii,i=t.camera,o,r,s;if(i.frustum instanceof rn)o=h.ZERO,r=i.rightWC,s=i.upWC;else{let m=i.positionWC,p=h.multiplyComponents(e.oneOverRadii,m,bye),y=h.normalize(p,yye),f=h.normalize(h.cross(h.UNIT_Z,p,g4),g4),x=h.normalize(h.cross(y,f,gye),gye),_=h.magnitude(p),C=Math.sqrt(_*_-1);o=h.multiplyByScalar(y,1/_,bye);let V=C/_;r=h.multiplyByScalar(f,V,yye),s=h.multiplyByScalar(x,V,g4)}let a=h.add(o,s,pD);h.subtract(a,r,a),h.multiplyComponents(n,a,a),h.pack(a,Uw,0);let c=h.subtract(o,s,pD);h.subtract(c,r,c),h.multiplyComponents(n,c,c),h.pack(c,Uw,3);let d=h.add(o,s,pD);h.add(d,r,d),h.multiplyComponents(n,d,d),h.pack(d,Uw,6);let u=h.subtract(o,s,pD);return h.add(u,r,u),h.multiplyComponents(n,u,u),h.pack(u,Uw,9),Uw}kw.prototype.update=function(e){if(this._mode=e.mode,e.mode!==ie.SCENE3D)return;let t=e.context,n=e.mapProjection.ellipsoid.radii,i=new oe(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),o=e.useLogDepth;if(l(this._command)||(this._rs=ke.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new nt({renderState:this._rs,boundingVolume:new ce(h.ZERO,i.maximumRadius),pass:Ve.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==o){this._useLogDepth=o;let s=new Oe({sources:[wv]}),a=new Oe({sources:[vv]});o&&(a.defines.push("LOG_DEPTH"),s.defines.push("LOG_DEPTH")),this._sp=Qt.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let r=Kat(i,e);if(l(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(r);else{let s=new mt({attributes:{position:new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:r})},indices:[0,1,2,2,1,3],primitiveType:Ae.TRIANGLES});this._va=oi.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:Ue.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};kw.prototype.execute=function(e,t){this._mode===ie.SCENE3D&&this._command.execute(e,t)};kw.prototype.isDestroyed=function(){return!1};kw.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var Dw=kw;var cZi=T(S(),1);function Bw(){}var zat=/\bgl_FragDepth\b/,Jat=/\bdiscard\b/;function Qat(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(!l(n)){let i=t._attributeLocations,o=t.fragmentShaderSource,r,s=!1,a=o.sources,c=a.length;for(r=0;r<c;++r)if(zat.test(a[r])||Jat.test(a[r])){s=!0;break}let d=!1,u=o.defines;for(c=u.length,r=0;r<c;++r)if(u[r]==="LOG_DEPTH"){d=!0;break}let m;!s&&!d?(m=`void main()
{
out_FragColor = vec4(1.0);
}
`,o=new Oe({sources:[m]})):!s&&d&&(m=`void main()
{
out_FragColor = vec4(1.0);
czm_writeLogDepth();
}
`,o=new Oe({defines:["LOG_DEPTH"],sources:[m]})),n=e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:o,attributeLocations:i})}return n}function jat(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(!l(i)){let o=ke.getState(t);o.depthMask=!0,o.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i=ke.fromCache(o),n[t.id]=i}return i}Bw.createDepthOnlyDerivedCommand=function(e,t,n,i){l(i)||(i={});let o,r;return l(i.depthOnlyCommand)&&(o=i.depthOnlyCommand.shaderProgram,r=i.depthOnlyCommand.renderState),i.depthOnlyCommand=nt.shallowClone(t,i.depthOnlyCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=Qat(n,t.shaderProgram),i.depthOnlyCommand.renderState=jat(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=o,i.depthOnlyCommand.renderState=r),i};var qat=/\s+czm_writeLogDepth\(/,$at=/\s+czm_vertexLogDepth\(/;function ect(e,t){if(t.fragmentShaderSource.defines.indexOf("LOG_DEPTH_READ_ONLY")>=0)return t;let i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(!l(i)){let o=t._attributeLocations,r=t.vertexShaderSource.clone(),s=t.fragmentShaderSource.clone();r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("LOG_DEPTH"),s.defines=l(s.defines)?s.defines.slice(0):[],s.defines.push("LOG_DEPTH");let a,c,d=!1,u=r.sources,m=u.length;for(a=0;a<m;++a)if($at.test(u[a])){d=!0;break}if(!d){for(a=0;a<m;++a)u[a]=Oe.replaceMain(u[a],"czm_log_depth_main");c=`
void main()
{
czm_log_depth_main();
czm_vertexLogDepth();
}
`,u.push(c)}for(u=s.sources,m=u.length,d=!1,a=0;a<m;++a)qat.test(u[a])&&(d=!0);s.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(d=!0);let p="";if(!d){for(a=0;a<m;a++)u[a]=Oe.replaceMain(u[a],"czm_log_depth_main");p+=`
void main()
{
czm_log_depth_main();
czm_writeLogDepth();
}
`}u.push(p),i=e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o})}return i}Bw.createLogDepthCommand=function(e,t,n){l(n)||(n={});let i;return l(n.command)&&(i=n.command.shaderProgram),n.command=nt.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=ect(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function tct(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(!l(i)){let o=t._attributeLocations,r=t.fragmentShaderSource,s=r.sources,a=s.length;Object.prototype.toString.call(n)==="[object Object]"&&(n.color?n=`vec4(${O.floatToByte(n.color.red)}, ${O.floatToByte(n.color.green)}, ${O.floatToByte(n.color.blue)}, ${O.floatToByte(n.color.alpha)})`:n="vec4(1.0)");let d=s.some(p=>p.includes("out_FragData"))?"out_FragData_0":"out_FragColor",u=`void main ()
{
czm_non_pick_main();
if (${d}.a == 0.0) {
discard;
}
${d} = ${n};
} `,m=new Array(a+1);for(let p=0;p<a;++p)m[p]=Oe.replaceMain(s[p],"czm_non_pick_main");m[a]=u,r=new Oe({sources:m,defines:r.defines}),i=e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:r,attributeLocations:o})}return i}function nct(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(!l(i)){let o=ke.getState(t);o.blending.enabled=!1,o.depthMask=!0,i=ke.fromCache(o),n[t.id]=i}return i}Bw.createPickDerivedCommand=function(e,t,n,i){l(i)||(i={});let o,r;return l(i.pickCommand)&&(o=i.pickCommand.shaderProgram,r=i.pickCommand.renderState),i.pickCommand=nt.shallowClone(t,i.pickCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=tct(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=nct(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=o,i.pickCommand.renderState=r),i};function ict(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(!l(n)){let i=t._attributeLocations,o=t.vertexShaderSource.clone(),r=t.fragmentShaderSource.clone();o.defines=l(o.defines)?o.defines.slice(0):[],o.defines.push("HDR"),r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("HDR"),n=e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:o,fragmentShaderSource:r,attributeLocations:i})}return n}Bw.createHdrCommand=function(e,t,n){l(n)||(n={});let i;return l(n.command)&&(i=n.command.shaderProgram),n.command=nt.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=ict(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var q0=Bw;var pZi=T(S(),1);function bD(e){this._scene=e,this._lastAlpha=void 0,this._lastBeta=void 0,this._lastGamma=void 0,this._alpha=void 0,this._beta=void 0,this._gamma=void 0;let t=this;function n(i){let o=i.alpha;if(!l(o)){t._alpha=void 0,t._beta=void 0,t._gamma=void 0;return}t._alpha=W.toRadians(o),t._beta=W.toRadians(i.beta),t._gamma=W.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var oct=new Me,xye=new Me,rct=new q;function sct(e,t,n,i){let o=e.direction,r=e.right,s=e.up,a=Me.fromAxisAngle(o,n,xye),c=Me.fromAxisAngle(r,i,oct),d=Me.multiply(c,a,c),u=Me.fromAxisAngle(s,t,xye);Me.multiply(u,d,d);let m=q.fromQuaternion(d,rct);q.multiplyByVector(m,r,r),q.multiplyByVector(m,s,s),q.multiplyByVector(m,o,o)}bD.prototype.update=function(){if(!l(this._alpha))return;l(this._lastAlpha)||(this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma);let e=this._lastAlpha-this._alpha,t=this._lastBeta-this._beta,n=this._lastGamma-this._gamma;sct(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};bD.prototype.isDestroyed=function(){return!1};bD.prototype.destroy=function(){return this._removeListener(),ue(this)};var Ow=bD;var TZi=T(S(),1);function _ye(){this.enabled=!0,this.renderable=!0,this.density=2e-4,this.screenSpaceErrorFactor=2,this.minimumBrightness=.03}var yD=[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],kf=[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];for(let e=0;e<kf.length;++e)kf[e]*=1e6;var Tye=kf[1],x4=kf[kf.length-1];for(let e=0;e<kf.length;++e)kf[e]=(kf[e]-x4)/(Tye-x4);var ma=0;function act(e){let t=yD,n=t.length;if(e<t[0])return ma=0,ma;if(e>t[n-1])return ma=n-2,ma;if(e>=t[ma]){if(ma+1<n&&e<t[ma+1])return ma;if(ma+2<n&&e<t[ma+2])return++ma,ma}else if(ma-1>=0&&e>=t[ma-1])return--ma,ma;let i;for(i=0;i<n-2&&!(e>=t[i]&&e<t[i+1]);++i);return ma=i,ma}var cct=new h;_ye.prototype.update=function(e){if(!(e.fog.enabled=this.enabled))return;e.fog.renderable=this.renderable;let n=e.camera,i=n.positionCartographic;if(!l(i)||i.height>8e5||e.mode!==ie.SCENE3D){e.fog.enabled=!1,e.fog.density=0;return}let o=i.height,r=act(o),s=W.clamp((o-yD[r])/(yD[r+1]-yD[r]),0,1),a=W.lerp(kf[r],kf[r+1],s),c=this.density*1e6,d=c/Tye*x4;a=a*(c-d)*1e-6;let u=h.normalize(n.positionWC,cct),m=Math.abs(h.dot(n.directionWC,u));a*=1-m,e.fog.density=a,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness};var Yw=_ye;var VZi=T(S(),1);function lct(e,t,n){this.context=e,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=ie.SCENE3D,this.morphTime=ie.getMorphTime(ie.SCENE3D),this.frameNumber=0,this.newFrame=!1,this.time=void 0,this.jobScheduler=n,this.mapProjection=void 0,this.camera=void 0,this.cameraUnderground=!1,this.globeTranslucencyState=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.pixelRatio=1,this.passes={render:!1,pick:!1,depth:!1,postProcess:!1,offscreen:!1},this.creditDisplay=t,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,renderable:!1,density:void 0,sse:void 0,minimumBrightness:void 0},this.atmosphere=void 0,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.shadowState={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.splitPosition=0,this.frustumSplits=[],this.backgroundColor=void 0,this.light=void 0,this.minimumDisableDepthTestDistance=void 0,this.invertClassification=!1,this.invertClassificationColor=void 0,this.useLogDepth=!1,this.tilesetPassState=void 0,this.minimumTerrainHeight=0}var Hw=lct;var MZi=T(S(),1);var ha={OPAQUE_FRONT_FACE:0,OPAQUE_BACK_FACE:1,DEPTH_ONLY_FRONT_FACE:2,DEPTH_ONLY_BACK_FACE:3,DEPTH_ONLY_FRONT_AND_BACK_FACE:4,TRANSLUCENT_FRONT_FACE:5,TRANSLUCENT_BACK_FACE:6,TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:7,TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:8,PICK_FRONT_FACE:9,PICK_BACK_FACE:10,DERIVED_COMMANDS_MAXIMUM_LENGTH:11},xT=ha.DERIVED_COMMANDS_MAXIMUM_LENGTH,Xye=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function _T(){this._frontFaceAlphaByDistance=new vt(0,1,0,1),this._backFaceAlphaByDistance=new vt(0,1,0,1),this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._requiresManualDepthTest=!1,this._sunVisibleThroughGlobe=!1,this._environmentVisible=!1,this._useDepthPlane=!1,this._numberOfTextureUniforms=0,this._globeTranslucencyFramebuffer=void 0,this._rectangle=de.clone(de.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(xT),this._derivedBlendCommandTypes=new Array(xT),this._derivedPickCommandTypes=new Array(xT),this._derivedCommandTypesToUpdate=new Array(xT),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(_T.prototype,{frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance}},translucent:{get:function(){return this._frontFaceTranslucent}},sunVisibleThroughGlobe:{get:function(){return this._sunVisibleThroughGlobe}},environmentVisible:{get:function(){return this._environmentVisible}},useDepthPlane:{get:function(){return this._useDepthPlane}},numberOfTextureUniforms:{get:function(){return this._numberOfTextureUniforms}},rectangle:{get:function(){return this._rectangle}}});_T.prototype.update=function(e){let t=e.globe;if(!l(t)||!t.show){this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._sunVisibleThroughGlobe=!0,this._environmentVisible=!0,this._useDepthPlane=!1;return}this._frontFaceAlphaByDistance=Sye(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=Sye(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=Cye(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=Cye(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=hct(this,e,t),this._sunVisibleThroughGlobe=dct(this,e),this._environmentVisible=uct(this,e),this._useDepthPlane=mct(this,e),this._numberOfTextureUniforms=fct(this),this._rectangle=de.clone(t.translucency.rectangle,this._rectangle),pct(this,e)};function Sye(e,t,n,i){return e?l(n)?(vt.clone(n,i),i.nearValue*=t,i.farValue*=t,i):(i.nearValue=t,i.farValue=t,i):(i.nearValue=1,i.farValue=1,i)}function Cye(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function dct(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function uct(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function mct(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function hct(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==ie.SCENE2D&&t.context.depthTexture}function fct(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function pct(e,t){e._derivedCommandsLength=_4(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=_4(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=_4(e,t,!1,!0,e._derivedPickCommandTypes);let n,i=0;for(n=0;n<e._derivedCommandsLength;++n)i|=1<<e._derivedCommandTypes[n];for(n=0;n<e._derivedBlendCommandsLength;++n)i|=1<<e._derivedBlendCommandTypes[n];for(n=0;n<e._derivedPickCommandsLength;++n)i|=1<<e._derivedPickCommandTypes[n];let o=0;for(n=0;n<xT;++n)(i&1<<n)>0&&(e._derivedCommandTypesToUpdate[o++]=n);e._derivedCommandsToUpdateLength=o;let r=i!==e._derivedCommandKey;e._derivedCommandKey=i,e._derivedCommandsDirty=r,!l(e._derivedCommandPacks)&&e._frontFaceTranslucent&&(e._derivedCommandPacks=Ict())}function _4(e,t,n,i,o){let r=0,s=e._frontFaceTranslucent,a=e._backFaceTranslucent;if(!s)return r;let c=t.cameraUnderground,d=e._requiresManualDepthTest,u=i?ha.PICK_FRONT_FACE:d?ha.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:ha.TRANSLUCENT_FRONT_FACE,m=i?ha.PICK_BACK_FACE:d?ha.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:ha.TRANSLUCENT_BACK_FACE;return t.mode===ie.SCENE2D?(o[r++]=ha.DEPTH_ONLY_FRONT_FACE,o[r++]=u,r):(a?(n||(o[r++]=ha.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(o[r++]=u,o[r++]=m):(o[r++]=m,o[r++]=u)):c?(n||(o[r++]=ha.DEPTH_ONLY_BACK_FACE),o[r++]=ha.OPAQUE_FRONT_FACE,o[r++]=m):(n||(o[r++]=ha.DEPTH_ONLY_FRONT_FACE),o[r++]=ha.OPAQUE_BACK_FACE,o[r++]=u),r)}function tm(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function Vye(e,t){return e.indexOf(t)>-1}function bct(e,t){tm(e.defines,"TRANSLUCENT"),tm(t.defines,"TRANSLUCENT")}function yct(e,t){tm(e.defines,"GROUND_ATMOSPHERE"),tm(t.defines,"GROUND_ATMOSPHERE"),tm(e.defines,"FOG"),tm(t.defines,"FOG"),tm(e.defines,"TRANSLUCENT"),tm(t.defines,"TRANSLUCENT")}function T4(e,t){if(Vye(t.defines,"TILE_LIMIT_RECTANGLE")||Vye(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main()
{
out_FragColor = vec4(1.0);
}
`;t.sources=[n]}function S4(e,t){let n=t.sources,i=n.length;for(let r=0;r<i;++r)n[r]=Oe.replaceMain(n[r],"czm_globe_translucency_main");n.push(`
uniform sampler2D u_classificationTexture;
void main()
{
vec2 st = gl_FragCoord.xy / czm_viewport.zw;
#ifdef MANUAL_DEPTH_TEST
float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st));
if (logDepthOrDepth != 0.0)
{
vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
float depthEC = eyeCoordinate.z / eyeCoordinate.w;
if (v_positionEC.z < depthEC)
{
discard;
}
}
#endif
czm_globe_translucency_main();
vec4 classificationColor = texture(u_classificationTexture, st);
if (classificationColor.a > 0.0)
{
// Reverse premultiplication process to get the correct composited result of the classification primitives
classificationColor.rgb /= classificationColor.a;
}
out_FragColor = classificationColor * vec4(classificationColor.aaa, 1.0) + out_FragColor * (1.0 - classificationColor.a);
}
`)}function Wye(e,t){S4(e,t),tm(e.defines,"GROUND_ATMOSPHERE"),tm(t.defines,"GROUND_ATMOSPHERE"),tm(e.defines,"FOG"),tm(t.defines,"FOG")}function gct(e,t){S4(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function xct(e,t){Wye(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function Lye(e,t){let n=`uniform sampler2D u_classificationTexture;
void main()
{
vec2 st = gl_FragCoord.xy / czm_viewport.zw;
vec4 pickColor = texture(u_classificationTexture, st);
if (pickColor == vec4(0.0))
{
discard;
}
out_FragColor = pickColor;
}
`;t.sources=[n]}function _ct(e,t,n,i,o,r){if(!l(o))return t;if(!i&&l(n))return n;let s=e.shaderCache.getDerivedShaderProgram(t,r);if(!l(s)){let a=t._attributeLocations,c=t.vertexShaderSource.clone(),d=t.fragmentShaderSource.clone();c.defines=l(c.defines)?c.defines.slice(0):[],d.defines=l(d.defines)?d.defines.slice(0):[],o(c,d),s=e.shaderCache.createDerivedShaderProgram(t,r,{vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:a})}return s}function Tct(e){e.cull.face=yi.BACK,e.cull.enabled=!0}function Sct(e){e.cull.face=yi.FRONT,e.cull.enabled=!0}function Cct(e){e.cull.face=yi.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Vct(e){e.cull.face=yi.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Lct(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Rye(e){e.cull.face=yi.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=mn.ALPHA_BLEND}function Zye(e){e.cull.face=yi.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=mn.ALPHA_BLEND}function Rct(e){e.cull.face=yi.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function Zct(e){e.cull.face=yi.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function Gct(e,t,n,i,o){if(!l(i))return e;if(!n&&l(t))return t;let r=o[e.id];if(!l(r)){let s=ke.getState(e);i(s),r=ke.fromCache(s),o[e.id]=r}return r}function PV(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function Ect(e,t,n,i,o){return l(o)?!i&&l(n)?n:Tt(t,o(e),!1):t}function Lh(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function Ict(){return[new Lh({pass:Ve.GLOBE,pickOnly:!1,getShaderProgramFunction:bct,getRenderStateFunction:Tct,getUniformMapFunction:void 0}),new Lh({pass:Ve.GLOBE,pickOnly:!1,getShaderProgramFunction:yct,getRenderStateFunction:Sct,getUniformMapFunction:void 0}),new Lh({pass:Ve.GLOBE,pickOnly:!1,getShaderProgramFunction:T4,getRenderStateFunction:Cct,getUniformMapFunction:void 0}),new Lh({pass:Ve.GLOBE,pickOnly:!1,getShaderProgramFunction:T4,getRenderStateFunction:Vct,getUniformMapFunction:void 0}),new Lh({pass:Ve.GLOBE,pickOnly:!1,getShaderProgramFunction:T4,getRenderStateFunction:Lct,getUniformMapFunction:void 0}),new Lh({pass:Ve.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:S4,getRenderStateFunction:Rye,getUniformMapFunction:PV}),new Lh({pass:Ve.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Wye,getRenderStateFunction:Zye,getUniformMapFunction:PV}),new Lh({pass:Ve.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:gct,getRenderStateFunction:Rye,getUniformMapFunction:PV}),new Lh({pass:Ve.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:xct,getRenderStateFunction:Zye,getUniformMapFunction:PV}),new Lh({pass:Ve.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:Lye,getRenderStateFunction:Rct,getUniformMapFunction:PV}),new Lh({pass:Ve.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:Lye,getRenderStateFunction:Zct,getUniformMapFunction:PV})]}var Gye=new Array(xT),Eye=new Array(xT);_T.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let o=0;o<i;++o)Eye[o]=this._derivedCommandPacks[n[o]],Gye[o]=Xye[n[o]];Xct(this,e,i,n,Gye,Eye,t)}};function Xct(e,t,n,i,o,r,s){let a=t.derivedCommands.globeTranslucency,c=e._derivedCommandsDirty;if(t.dirty||!l(a)||c){t.dirty=!1,l(a)||(a={},t.derivedCommands.globeTranslucency=a);let d=s.frameNumber,u=g(a.uniformMapDirtyFrame,0),m=g(a.shaderProgramDirtyFrame,0),p=g(a.renderStateDirtyFrame,0),y=a.uniformMap!==t.uniformMap,f=a.shaderProgramId!==t.shaderProgram.id,x=a.renderStateId!==t.renderState.id;y&&(a.uniformMapDirtyFrame=d),f&&(a.shaderProgramDirtyFrame=d),x&&(a.renderStateDirtyFrame=d),a.uniformMap=t.uniformMap,a.shaderProgramId=t.shaderProgram.id,a.renderStateId=t.renderState.id;for(let _=0;_<n;++_){let C=r[_],V=i[_],L=o[_],Z=a[L],G,I,P;l(Z)?(G=Z.uniformMap,I=Z.shaderProgram,P=Z.renderState):(G=void 0,I=void 0,P=void 0),Z=nt.shallowClone(t,Z),a[L]=Z;let v=g(Z.derivedCommands.uniformMapDirtyFrame,0),F=g(Z.derivedCommands.shaderProgramDirtyFrame,0),M=g(Z.derivedCommands.renderStateDirtyFrame,0),b=y||v<u,R=f||F<m,E=x||M<p;b&&(Z.derivedCommands.uniformMapDirtyFrame=d),R&&(Z.derivedCommands.shaderProgramDirtyFrame=d),E&&(Z.derivedCommands.renderStateDirtyFrame=d),Z.derivedCommands.type=V,Z.pass=C.pass,Z.pickOnly=C.pickOnly,Z.uniformMap=Ect(e,t.uniformMap,G,b,C.getUniformMapFunction),Z.shaderProgram=_ct(s.context,t.shaderProgram,I,R,C.getShaderProgramFunction,L),Z.renderState=Gct(t.renderState,P,E,C.getRenderStateFunction,C.renderStateCache)}}}_T.prototype.pushDerivedCommands=function(e,t,n){let i=n.passes.pick;if(i&&t)return;let o=this._derivedCommandTypes,r=this._derivedCommandsLength;if(i?(o=this._derivedPickCommandTypes,r=this._derivedPickCommandsLength):t&&(o=this._derivedBlendCommandTypes,r=this._derivedBlendCommandsLength),r===0){n.commandList.push(e);return}let s=e.derivedCommands.globeTranslucency;for(let a=0;a<r;++a){let c=Xye[o[a]];n.commandList.push(s[c])}};function Pye(e,t,n,i,o,r,s){for(let a=0;a<t;++a){let c=e[a],d=c.derivedCommands.type;(!l(s)||s.indexOf(d)>-1)&&n(c,i,o,r)}}function Iye(e,t,n,i,o,r){for(let s=0;s<t;++s)n(e[s],i,o,r)}var Wct=[ha.OPAQUE_FRONT_FACE,ha.OPAQUE_BACK_FACE],Pct=[ha.DEPTH_ONLY_FRONT_FACE,ha.DEPTH_ONLY_BACK_FACE,ha.DEPTH_ONLY_FRONT_AND_BACK_FACE];_T.prototype.executeGlobeCommands=function(e,t,n,i,o){let r=i.context,s=e.commands[Ve.GLOBE],a=e.indices[Ve.GLOBE];a!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(r,o),Pye(s,a,t,i,r,o,Wct))};_T.prototype.executeGlobeClassificationCommands=function(e,t,n,i,o){let r=i.context,s=e.commands[Ve.GLOBE],a=e.indices[Ve.GLOBE],c=e.commands[Ve.TERRAIN_CLASSIFICATION],d=e.indices[Ve.TERRAIN_CLASSIFICATION];if(a===0||d===0)return;let u=this._frontFaceTranslucent,m=this._backFaceTranslucent;if((!u||!m)&&Iye(c,d,t,i,r,o),!u&&!m)return;this._globeTranslucencyFramebuffer=n;let p=r.uniformState.globeDepthTexture,y=o.framebuffer;if(o.framebuffer=n.classificationFramebuffer,Pye(s,a,t,i,r,o,Pct),r.depthTexture){let f=n.packDepth(r,o);r.uniformState.globeDepthTexture=f}Iye(c,d,t,i,r,o),r.uniformState.globeDepthTexture=p,o.framebuffer=y};var Kw=_T;var rGi=T(S(),1);var UZi=T(S(),1),Yl=`uniform sampler2D colorTexture;
in vec2 v_textureCoordinates;
void main()
{
out_FragColor = texture(colorTexture, v_textureCoordinates);
}
`;function Df(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new pi({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new pi({depthStencil:!0,createDepthAttachments:!1}),this._rsUnclassified=void 0,this._rsClassified=void 0,this._unclassifiedCommand=void 0,this._classifiedCommand=void 0,this._translucentCommand=void 0,this._clearColorCommand=new ai({color:new O(0,0,0,0),owner:this}),this._clearCommand=new ai({color:new O(0,0,0,0),depth:1,stencil:0});let e=this;this._uniformMap={colorTexture:function(){return e._fbo.getColorTexture()},depthTexture:function(){return e._depthStencilTexture},classifiedTexture:function(){return e._fboClassified.getColorTexture()}}}Object.defineProperties(Df.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});Df.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var vct={depthMask:!1,stencilTest:{enabled:!0,frontFunction:On.EQUAL,frontOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.KEEP},backFunction:On.NEVER,reference:0,mask:Nt.CLASSIFICATION_MASK},blending:mn.ALPHA_BLEND},wct={depthMask:!1,stencilTest:{enabled:!0,frontFunction:On.NOT_EQUAL,frontOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.KEEP},backFunction:On.NEVER,reference:0,mask:Nt.CLASSIFICATION_MASK},blending:mn.ALPHA_BLEND},Fct={depthMask:!0,depthTest:{enabled:!0},stencilTest:Nt.setCesium3DTileBit(),stencilMask:Nt.CESIUM_3D_TILE_MASK,blending:mn.ALPHA_BLEND},Act=`uniform sampler2D colorTexture;
uniform sampler2D depthTexture;
uniform sampler2D classifiedTexture;
in vec2 v_textureCoordinates;
void main()
{
vec4 color = texture(colorTexture, v_textureCoordinates);
if (color.a == 0.0)
{
discard;
}
bool isClassified = all(equal(texture(classifiedTexture, v_textureCoordinates), vec4(0.0)));
#ifdef UNCLASSIFIED
vec4 highlightColor = czm_invertClassificationColor;
if (isClassified)
{
discard;
}
#else
vec4 highlightColor = vec4(1.0);
if (!isClassified)
{
discard;
}
#endif
out_FragColor = color * highlightColor;
gl_FragDepth = texture(depthTexture, v_textureCoordinates).r;
}
`,Mct=`uniform sampler2D colorTexture;
in vec2 v_textureCoordinates;
void main()
{
vec4 color = texture(colorTexture, v_textureCoordinates);
if (color.a == 0.0)
{
discard;
}
#ifdef UNCLASSIFIED
out_FragColor = color * czm_invertClassificationColor;
#else
out_FragColor = color;
#endif
}
`;Df.prototype.update=function(e,t,n){let i=this._fbo.getColorTexture(),o=this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;let r=this._numSamples!==t,s=e.drawingBufferWidth,a=e.drawingBufferHeight,c=!l(i)||i.width!==s||i.height!==a;if((c||o||r)&&(this._numSamples=t,this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._previousFramebuffer)||(this._depthStencilTexture=new wt({context:e,width:s,height:a,pixelFormat:at.DEPTH_STENCIL,pixelDatatype:je.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new dd({context:e,width:s,height:a,format:Dc.DEPTH24_STENCIL8,numSamples:t})))),!l(this._fbo.framebuffer)||c||o||r){this._fbo.destroy(),this._fboClassified.destroy();let d,u;l(this._previousFramebuffer)?(d=n.getDepthStencilTexture(),u=n.getDepthStencilRenderbuffer()):(d=this._depthStencilTexture,u=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(d),l(u)&&this._fbo.setDepthStencilRenderbuffer(u),this._fbo.update(e,s,a,t),l(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(d),this._fboClassified.update(e,s,a))}if(l(this._rsUnclassified)||(this._rsUnclassified=ke.fromCache(vct),this._rsClassified=ke.fromCache(wct),this._rsDefault=ke.fromCache(Fct)),!l(this._unclassifiedCommand)||o||r){l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let d=l(this._previousFramebuffer)?Mct:Act,u=new Oe({defines:["UNCLASSIFIED"],sources:[d]}),m=new Oe({sources:[d]});this._unclassifiedCommand=e.createViewportQuadCommand(u,{renderState:l(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(m,{renderState:l(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),l(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),l(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(Yl,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};Df.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};Df.prototype.clear=function(e,t){l(this._previousFramebuffer)?this._fbo.clear(e,this._clearColorCommand,t):(this._fbo.clear(e,this._clearCommand,t),this._fboClassified.clear(e,this._clearCommand,t))};Df.prototype.executeClassified=function(e,t){if(!l(this._previousFramebuffer)){let n=t.framebuffer;this.prepareTextures(e,!0),t.framebuffer=this._fboClassified.framebuffer,this._translucentCommand.execute(e,t),t.framebuffer=n}this._classifiedCommand.execute(e,t)};Df.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};Df.prototype.isDestroyed=function(){return!1};Df.prototype.destroy=function(){return this._fbo.destroy(),this._fboClassified.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),ue(this)};var vV=Df;var dGi=T(S(),1);function gD(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(gD.prototype,{total:{get:function(){return this._total}}});function cg(e){let t=new Array(Ra.NUMBER_OF_JOB_TYPES);t[Ra.TEXTURE]=new gD(l(e)?e[Ra.TEXTURE]:10),t[Ra.PROGRAM]=new gD(l(e)?e[Ra.PROGRAM]:10),t[Ra.BUFFER]=new gD(l(e)?e[Ra.BUFFER]:30);let n=t.length,i,o=0;for(i=0;i<n;++i)o+=t[i].total;let r=new Array(n);for(i=0;i<n;++i)r[i]=!1;this._totalBudget=o,this._totalUsedThisFrame=0,this._budgets=t,this._executedThisFrame=r}cg.getTimestamp=xi;Object.defineProperties(cg.prototype,{totalBudget:{get:function(){return this._totalBudget}}});cg.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};cg.prototype.resetBudgets=function(){let e=this._budgets,t=e.length;for(let n=0;n<t;++n){let i=e[n];i.starvedLastFrame=i.starvedThisFrame,i.starvedThisFrame=!1,i.usedThisFrame=0,i.stolenFromMeThisFrame=0}this._totalUsedThisFrame=0};cg.prototype.execute=function(e,t){let n=this._budgets,i=n[t],o=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&o)return i.starvedThisFrame=!0,!1;let r;if(i.usedThisFrame+i.stolenFromMeThisFrame>=i.total){let c=n.length,d;for(d=0;d<c&&(r=n[d],!(r.usedThisFrame+r.stolenFromMeThisFrame<r.total&&!r.starvedLastFrame));++d);if(d===c&&o)return!1;o&&(i.starvedThisFrame=!0)}let s=cg.getTimestamp();e.execute();let a=cg.getTimestamp()-s;return this._totalUsedThisFrame+=a,r?r.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var zw=cg;var bGi=T(S(),1);function xD(e){e=g(e,g.EMPTY_OBJECT);let t=Wn(e.container);this._container=t;let n=document.createElement("div");n.className="cesium-performanceDisplay";let i=document.createElement("div");i.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),i.appendChild(this._fpsText);let o=document.createElement("div");o.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),o.appendChild(this._msText),n.appendChild(o),n.appendChild(i),this._container.appendChild(n),this._lastFpsSampleTime=xi(),this._lastMsSampleTime=xi(),this._fpsFrameCount=0,this._msFrameCount=0,this._throttled=!1;let r=document.createElement("div");r.className="cesium-performanceDisplay-throttled",this._throttledText=document.createTextNode(""),r.appendChild(this._throttledText),n.appendChild(r)}Object.defineProperties(xD.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});xD.prototype.update=function(e){let t=xi(),n=g(e,!0);this._fpsFrameCount++;let i=t-this._lastFpsSampleTime;if(i>1e3){let r="N/A";n&&(r=this._fpsFrameCount*1e3/i|0),this._fpsText.nodeValue=`${r} FPS`,this._lastFpsSampleTime=t,this._fpsFrameCount=0}this._msFrameCount++;let o=t-this._lastMsSampleTime;if(o>200){let r="N/A";n&&(r=(o/this._msFrameCount).toFixed(2)),this._msText.nodeValue=`${r} MS`,this._lastMsSampleTime=t,this._msFrameCount=0}};xD.prototype.destroy=function(){return ue(this)};var $0=xD;var rWi=T(S(),1);var CGi=T(S(),1);function TT(){this._framebuffer=new pi,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(TT.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function Nct(e,t,n){let i=n.width,o=n.height;e._framebuffer.update(t,i,o)}function Uct(e,t,n){if(!l(e._copyDepthCommand)){let i=`uniform highp sampler2D u_texture;
in vec2 v_textureCoordinates;
void main()
{
out_FragColor = czm_packDepth(texture(u_texture, v_textureCoordinates).r);
}
`;e._copyDepthCommand=t.createViewportQuadCommand(i,{renderState:ke.fromCache(),uniformMap:{u_texture:function(){return e._textureToCopy}},owner:e})}e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}TT.prototype.update=function(e,t){Nct(this,e,t),Uct(this,e,t)};var kct=new se,Dct=new se(1,1/255,1/65025,1/16581375);TT.prototype.getDepth=function(e,t,n){if(!l(this.framebuffer))return;let i=e.readPixels({x:t,y:n,width:1,height:1,framebuffer:this.framebuffer}),o=se.unpack(i,0,kct);return se.divideByScalar(o,255,o),se.dot(o,Dct)};TT.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};TT.prototype.isDestroyed=function(){return!1};TT.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),ue(this)};var Jw=TT;var PXi=T(S(),1);var ZGi=T(S(),1);function Bct(e,t){this.near=g(e,0),this.far=g(t,0);let n=Ve.NUMBER_OF_PASSES,i=new Array(n),o=new Array(n);for(let r=0;r<n;++r)i[r]=[],o[r]=0;this.commands=i,this.indices=o}var Qw=Bct;var YGi=T(S(),1);var EGi=T(S(),1),lg=`uniform highp sampler2D u_depthTexture;
in vec2 v_textureCoordinates;
void main()
{
out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r);
}
`;function Bf(){this._picking=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new pi({depthStencil:!0,supportsDepthTexture:!0}),this._outputFramebuffer=new pi({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new pi,this._tempCopyDepthFramebuffer=new pi,this._updateDepthFramebuffer=new pi({createColorAttachments:!1,createDepthAttachments:!1,depthStencil:!0}),this._clearGlobeColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._tempCopyDepthCommand=void 0,this._updateDepthCommand=void 0,this._viewport=new De,this._rs=void 0,this._rsBlend=void 0,this._rsUpdate=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0,this._clearGlobeDepth=void 0}Object.defineProperties(Bf.prototype,{colorFramebufferManager:{get:function(){return this._picking?this._pickColorFramebuffer:this._outputFramebuffer}},framebuffer:{get:function(){return this.colorFramebufferManager.framebuffer}},depthStencilTexture:{get:function(){return this.colorFramebufferManager.getDepthStencilTexture()}},picking:{get:function(){return this._picking},set:function(e){this._picking=e}}});function Oct(e){e._pickColorFramebuffer.destroy(),e._outputFramebuffer.destroy(),e._copyDepthFramebuffer.destroy(),e._tempCopyDepthFramebuffer.destroy(),e._updateDepthFramebuffer.destroy()}function vye(e,t,n,i,o){e._viewport.width=n,e._viewport.height=i;let r=!De.equals(e._viewport,o.viewport),s=r!==e._useScissorTest;e._useScissorTest=r,De.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=De.clone(o.viewport,e._scissorRectangle),s=!0),(!l(e._rs)||!De.equals(e._viewport,e._rs.viewport)||s)&&(e._rs=ke.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=ke.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:mn.ALPHA_BLEND}),e._rsUpdate=ke.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:On.EQUAL,frontOperation:{fail:pt.KEEP,zFail:pt.KEEP,zPass:pt.KEEP},backFunction:On.NEVER,reference:Nt.CESIUM_3D_TILE_MASK,mask:Nt.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(lg,{uniformMap:{u_depthTexture:function(){return e.colorFramebufferManager.getDepthStencilTexture()}},owner:e})),e._copyDepthCommand.framebuffer=e._copyDepthFramebuffer.framebuffer,e._copyDepthCommand.renderState=e._rs,l(e._copyColorCommand)||(e._copyColorCommand=t.createViewportQuadCommand(Yl,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(lg,{uniformMap:{u_depthTexture:function(){return e._tempCopyDepthTexture}},owner:e})),e._tempCopyDepthCommand.framebuffer=e._tempCopyDepthFramebuffer.framebuffer,e._tempCopyDepthCommand.renderState=e._rs,l(e._updateDepthCommand)||(e._updateDepthCommand=t.createViewportQuadCommand(Yl,{uniformMap:{colorTexture:function(){return e._tempCopyDepthFramebuffer.getColorTexture()}},owner:e})),e._updateDepthCommand.framebuffer=e._updateDepthFramebuffer.framebuffer,e._updateDepthCommand.renderState=e._rsUpdate,l(e._clearGlobeColorCommand)||(e._clearGlobeColorCommand=new ai({color:new O(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}Bf.prototype.update=function(e,t,n,i,o,r){let s=n.width,a=n.height,c=o?e.halfFloatingPointTexture?je.HALF_FLOAT:je.FLOAT:je.UNSIGNED_BYTE;this._numSamples=i,this.picking?this._pickColorFramebuffer.update(e,s,a):this._outputFramebuffer.update(e,s,a,i,c),this._copyDepthFramebuffer.update(e,s,a),vye(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._useHdr=o,this._clearGlobeDepth=r};Bf.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};Bf.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};Bf.prototype.executeUpdateDepth=function(e,t,n,i){let o=l(i)?i:t.framebuffer.depthStencilTexture;if(n||o!==this.colorFramebufferManager.getDepthStencilTexture()){if(l(this._updateDepthCommand)){if(!l(this._updateDepthFramebuffer.framebuffer)||this._updateDepthFramebuffer.getDepthStencilTexture()!==o||this._updateDepthFramebuffer.getColorTexture()!==this._copyDepthFramebuffer.getColorTexture()){let r=this._copyDepthFramebuffer.getColorTexture().width,s=this._copyDepthFramebuffer.getColorTexture().height;this._tempCopyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.update(e,r,s);let a=this._copyDepthFramebuffer.getColorTexture();this._updateDepthFramebuffer.setColorTexture(a,0),this._updateDepthFramebuffer.setDepthStencilTexture(o),this._updateDepthFramebuffer.update(e,r,s),vye(this,e,r,s,t)}this._tempCopyDepthTexture=o,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)}return}l(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t)};Bf.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};Bf.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(O.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};Bf.prototype.isDestroyed=function(){return!1};Bf.prototype.destroy=function(){return Oct(this),l(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),l(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),l(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),ue(this)};var jw=Bf;var nEi=T(S(),1);function ST(){this._framebuffer=new pi({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new pi,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new De,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(ST.prototype,{classificationTexture:{get:function(){return this._framebuffer.getColorTexture()}},classificationFramebuffer:{get:function(){return this._framebuffer.framebuffer}},packedDepthFramebuffer:{get:function(){return this._packedDepthFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._framebuffer.getDepthStencilTexture()}},depthStencilRenderbuffer:{get:function(){return this._framebuffer.getDepthStencilRenderbuffer()}},packedDepthTexture:{get:function(){return this._packedDepthFramebuffer.getColorTexture()}}});function Yct(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function Hct(e,t,n,i,o){let r=o?t.halfFloatingPointTexture?je.HALF_FLOAT:je.FLOAT:je.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,r),e._packedDepthFramebuffer.update(t,n,i)}function Kct(e,t,n,i,o){e._viewport.width=n,e._viewport.height=i;let r=!De.equals(e._viewport,o.viewport),s=r!==e._useScissorTest;e._useScissorTest=r,De.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=De.clone(o.viewport,e._scissorRectangle),s=!0),(!l(e._renderState)||!De.equals(e._viewport,e._renderState.viewport)||s)&&(e._renderState=ke.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(lg,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),l(e._clearCommand)||(e._clearCommand=new ai({color:new O(0,0,0,0),depth:1,stencil:0,owner:e})),e._packedDepthCommand.framebuffer=e._packedDepthFramebuffer.framebuffer,e._packedDepthCommand.renderState=e._renderState,e._clearCommand.framebuffer=e.classificationFramebuffer,e._clearCommand.renderState=e._renderState}ST.prototype.updateAndClear=function(e,t,n,i){let o=t.width,r=t.height;Hct(this,n,o,r,e),Kct(this,n,o,r,i),this._useHdr=e};ST.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};ST.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};ST.prototype.isDestroyed=function(){return!1};ST.prototype.destroy=function(){return Yct(this),ue(this)};var qw=ST;var TEi=T(S(),1);function eb(e){this._numSamples=1,this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;let t=e.colorBufferFloat&&e.depthTexture&&e.floatBlend;this._translucentMRTSupport=e.drawBuffers&&t,this._translucentMultipassSupport=!this._translucentMRTSupport&&t,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=new pi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new pi({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new pi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new pi({createColorAttachments:!1}),this._opaqueClearCommand=new ai({color:new O(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new ai({color:new O(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new ai({color:new O(0,0,0,0),owner:this}),this._alphaClearCommand=new ai({color:new O(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 De,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function wye(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function C4(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function Fye(e){wye(e),C4(e)}function zct(e,t,n,i){wye(e),e._accumulationTexture=new wt({context:t,width:n,height:i,pixelFormat:at.RGBA,pixelDatatype:je.FLOAT});let o=new Float32Array(n*i*4);e._revealageTexture=new wt({context:t,pixelFormat:at.RGBA,pixelDatatype:je.FLOAT,source:{arrayBufferView:o,width:n,height:i},flipY:!1})}function Jct(e,t){C4(e);let n=ne.FRAMEBUFFER_COMPLETE,i=!0,{width:o,height:r}=e._accumulationTexture;if(e._translucentMRTSupport&&(e._translucentFBO.setColorTexture(e._accumulationTexture,0),e._translucentFBO.setColorTexture(e._revealageTexture,1),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,o,r),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture,0),e._adjustTranslucentFBO.setColorTexture(e._revealageTexture,1),e._adjustTranslucentFBO.update(t,o,r),(e._translucentFBO.status!==n||e._adjustTranslucentFBO.status!==n)&&(C4(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO.setColorTexture(e._accumulationTexture),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,o,r),e._alphaFBO.setColorTexture(e._revealageTexture),e._alphaFBO.setDepthStencilTexture(e._depthStencilTexture),e._alphaFBO.update(t,o,r),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture),e._adjustTranslucentFBO.update(t,o,r),e._adjustAlphaFBO.setColorTexture(e._revealageTexture),e._adjustAlphaFBO.update(t,o,r);let s=e._translucentFBO.status===n,a=e._alphaFBO.status===n,c=e._adjustTranslucentFBO.status===n,d=e._adjustAlphaFBO.status===n;(!s||!a||!c||!d)&&(Fye(e),e._translucentMultipassSupport=!1,i=!1)}return i}eb.prototype.update=function(e,t,n,i,o){if(!this.isSupported())return;this._opaqueFBO=n,this._opaqueTexture=n.getColorTexture(0),this._depthStencilTexture=n.getDepthStencilTexture();let{width:r,height:s}=this._opaqueTexture,a=this._accumulationTexture,c=!l(a)||a.width!==r||a.height!==s||i!==this._useHDR,d=this._numSamples!==o;if((c||d)&&(this._numSamples=o,zct(this,e,r,s)),(!l(this._translucentFBO.framebuffer)||c||d)&&!Jct(this,e))return;this._useHDR=i;let u=this,m,p;l(this._compositeCommand)||(m=new Oe({sources:[Pv]}),this._translucentMRTSupport&&m.defines.push("MRT"),p={u_opaque:function(){return u._opaqueTexture},u_accumulation:function(){return u._accumulationTexture},u_revealage:function(){return u._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(m,{uniformMap:p,owner:this})),l(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(m=new Oe({defines:["MRT"],sources:[lV]}),p={u_bgColor:function(){return u._translucentMRTClearCommand.color},u_depthTexture:function(){return u._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(m,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(m=new Oe({sources:[lV]}),p={u_bgColor:function(){return u._translucentMultipassClearCommand.color},u_depthTexture:function(){return u._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(m,{uniformMap:p,owner:this}),p={u_bgColor:function(){return u._alphaClearCommand.color},u_depthTexture:function(){return u._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(m,{uniformMap:p,owner:this}))),this._viewport.width=r,this._viewport.height=s;let y=!De.equals(this._viewport,t.viewport),f=y!==this._useScissorTest;this._useScissorTest=y,De.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=De.clone(t.viewport,this._scissorRectangle),f=!0),(!l(this._rs)||!De.equals(this._viewport,this._rs.viewport)||f)&&(this._rs=ke.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),l(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)};var Qct={enabled:!0,color:new O(0,0,0,0),equationRgb:Ta.ADD,equationAlpha:Ta.ADD,functionSourceRgb:Ro.ONE,functionDestinationRgb:Ro.ONE,functionSourceAlpha:Ro.ZERO,functionDestinationAlpha:Ro.ONE_MINUS_SOURCE_ALPHA},jct={enabled:!0,color:new O(0,0,0,0),equationRgb:Ta.ADD,equationAlpha:Ta.ADD,functionSourceRgb:Ro.ONE,functionDestinationRgb:Ro.ONE,functionSourceAlpha:Ro.ONE,functionDestinationAlpha:Ro.ONE},qct={enabled:!0,color:new O(0,0,0,0),equationRgb:Ta.ADD,equationAlpha:Ta.ADD,functionSourceRgb:Ro.ZERO,functionDestinationRgb:Ro.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:Ro.ZERO,functionDestinationAlpha:Ro.ONE_MINUS_SOURCE_ALPHA};function V4(e,t,n,i){let o=n[i.id];if(!l(o)){let r=ke.getState(i);r.depthMask=!1,r.blending=t,o=ke.fromCache(r),n[i.id]=o}return o}function $ct(e,t,n){return V4(t,Qct,e._translucentRenderStateCache,n)}function elt(e,t,n){return V4(t,jct,e._translucentRenderStateCache,n)}function tlt(e,t,n){return V4(t,qct,e._alphaRenderStateCache,n)}var nlt=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a;
float ai = czm_out_FragColor.a;
float wzi = czm_alphaWeight(ai);
out_FragData_0 = vec4(Ci * wzi, ai);
out_FragData_1 = vec4(ai * wzi);
`,ilt=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a;
float ai = czm_out_FragColor.a;
float wzi = czm_alphaWeight(ai);
out_FragColor = vec4(Ci, ai) * wzi;
`,olt=` float ai = czm_out_FragColor.a;
out_FragColor = vec4(ai);
`;function L4(e,t,n,i){let{shaderCache:o}=e,r=o.getDerivedShaderProgram(t,n);if(l(r))return r;let s=t._attributeLocations,a=t.fragmentShaderSource.clone();a.sources=a.sources.map(function(u){return Oe.replaceMain(u,"czm_translucent_main").replace(/out_FragColor/g,"czm_out_FragColor").replace(/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,"").replace(/\bdiscard\b/g,"czm_discard = true").replace(/czm_phong/g,"czm_translucentPhong")}),a.sources.splice(0,0,`vec4 czm_out_FragColor;
bool czm_discard = false;
`);let c=[...i.matchAll(/out_FragData_(\d+)/g)],d="";for(let u=0;u<c.length;u++){let m=c[u];d=`layout (location = ${m[1]}) out vec4 ${m[0]};
${d}`}return a.sources.push(d),a.sources.push(`void main()
{
czm_translucent_main();
if (czm_discard)
{
discard;
}
${i}}
`),o.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:s})}function rlt(e,t){return L4(e,t,"translucentMRT",nlt)}function slt(e,t){return L4(e,t,"translucentMultipass",ilt)}function alt(e,t){return L4(e,t,"alphaMultipass",olt)}eb.prototype.createDerivedCommands=function(e,t,n){if(l(n)||(n={}),this._translucentMRTSupport){let a,c;return l(n.translucentCommand)&&(a=n.translucentCommand.shaderProgram,c=n.translucentCommand.renderState),n.translucentCommand=nt.shallowClone(e,n.translucentCommand),!l(a)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=rlt(t,e.shaderProgram),n.translucentCommand.renderState=$ct(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=a,n.translucentCommand.renderState=c),n}let i,o,r,s;return l(n.translucentCommand)&&(i=n.translucentCommand.shaderProgram,o=n.translucentCommand.renderState,r=n.alphaCommand.shaderProgram,s=n.alphaCommand.renderState),n.translucentCommand=nt.shallowClone(e,n.translucentCommand),n.alphaCommand=nt.shallowClone(e,n.alphaCommand),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=slt(t,e.shaderProgram),n.translucentCommand.renderState=elt(this,t,e.renderState),n.alphaCommand.shaderProgram=alt(t,e.shaderProgram),n.alphaCommand.renderState=tlt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=i,n.translucentCommand.renderState=o,n.alphaCommand.shaderProgram=r,n.alphaCommand.renderState=s),n};function clt(e,t,n,i,o,r){let s,a,c,{context:d,frameState:u}=t,{useLogDepth:m,shadowState:p}=u,y=t._hdr,f=i.framebuffer,x=p.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(d,i),i.framebuffer=e._adjustAlphaFBO.framebuffer,e._adjustAlphaCommand.execute(d,i);let _=e._opaqueFBO.framebuffer;for(i.framebuffer=e._translucentFBO.framebuffer,c=0;c<o.length;++c)s=o[c],s=m?s.derivedCommands.logDepth.command:s,s=y?s.derivedCommands.hdr.command:s,a=x&&s.receiveShadows?s.derivedCommands.oit.shadows.translucentCommand:s.derivedCommands.oit.translucentCommand,n(a,t,d,i,_);for(l(r)&&(s=r.unclassifiedCommand,a=x&&s.receiveShadows?s.derivedCommands.oit.shadows.translucentCommand:s.derivedCommands.oit.translucentCommand,n(a,t,d,i,_)),i.framebuffer=e._alphaFBO.framebuffer,c=0;c<o.length;++c)s=o[c],s=m?s.derivedCommands.logDepth.command:s,s=y?s.derivedCommands.hdr.command:s,a=x&&s.receiveShadows?s.derivedCommands.oit.shadows.alphaCommand:s.derivedCommands.oit.alphaCommand,n(a,t,d,i,_);l(r)&&(s=r.unclassifiedCommand,a=x&&s.receiveShadows?s.derivedCommands.oit.shadows.alphaCommand:s.derivedCommands.oit.alphaCommand,n(a,t,d,i,_)),i.framebuffer=f}function llt(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:d}=a,u=t._hdr,m=i.framebuffer,p=d.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i);let y=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;let f,x;for(let _=0;_<o.length;++_)f=o[_],f=c?f.derivedCommands.logDepth.command:f,f=u?f.derivedCommands.hdr.command:f,x=p&&f.receiveShadows?f.derivedCommands.oit.shadows.translucentCommand:f.derivedCommands.oit.translucentCommand,n(x,t,s,i,y);l(r)&&(f=r.unclassifiedCommand,x=p&&f.receiveShadows?f.derivedCommands.oit.shadows.translucentCommand:f.derivedCommands.oit.translucentCommand,n(x,t,s,i,y)),i.framebuffer=m}eb.prototype.executeCommands=function(e,t,n,i,o){if(this._translucentMRTSupport){llt(this,e,t,n,i,o);return}clt(this,e,t,n,i,o)};eb.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};eb.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,O.clone(n,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,t),t.framebuffer=this._translucentFBO.framebuffer,(this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand).execute(e,t),this._translucentMultipassSupport&&(t.framebuffer=this._alphaFBO.framebuffer,this._alphaClearCommand.execute(e,t)),t.framebuffer=i};eb.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};eb.prototype.isDestroyed=function(){return!1};eb.prototype.destroy=function(){return Fye(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),ue(this)};var $w=eb;var ZEi=T(S(),1);function eF(){this._framebuffer=new pi({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(eF.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function dlt(e){e._framebuffer.destroy()}function ult(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let o=new pc(t);o.blendingEnabled=!1,o.scissorTest={enabled:!0,rectangle:new De},o.viewport=new De,e._passState=o}eF.prototype.update=function(e,t,n){let i=n.width,o=n.height;this._framebuffer.isDirty(i,o)&&ult(this,e);let r=this.framebuffer,s=this._passState;return s.framebuffer=r,s.viewport.width=i,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};eF.prototype.isDestroyed=function(){return!1};eF.prototype.destroy=function(){return dlt(this),ue(this)};var tF=eF;var FEi=T(S(),1);function iF(e){let t=new pc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new De},t.viewport=new De,this._context=e,this._fb=new pi({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}iF.prototype.begin=function(e,t){let n=this._context,i=t.width,o=t.height;return De.clone(e,this._passState.scissorTest.rectangle),this._width=i,this._height=o,this._fb.update(n,i,o),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=o,this._passState};var nF=new O;iF.prototype.end=function(e){let t=g(e.width,1),n=g(e.height,1),i=this._context,o=i.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),r=Math.max(t,n),s=r*r,a=Math.floor(t*.5),c=Math.floor(n*.5),d=0,u=0,m=0,p=-1;for(let y=0;y<s;++y){if(-a<=d&&d<=a&&-c<=u&&u<=c){let f=4*((c-u)*t+d+a);nF.red=O.byteToFloat(o[f]),nF.green=O.byteToFloat(o[f+1]),nF.blue=O.byteToFloat(o[f+2]),nF.alpha=O.byteToFloat(o[f+3]);let x=i.getObjectByPickColor(nF);if(l(x))return x}if(d===u||d<0&&-d===u||d>0&&d===1-u){let f=m;m=-p,p=f}d+=m,u+=p}};iF.prototype.isDestroyed=function(){return!1};iF.prototype.destroy=function(){return this._fb.destroy(),ue(this)};var oF=iF;var BEi=T(S(),1);function tb(){this._numSamples=1,this._colorFramebuffer=new pi({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new pi({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new O(0,0,0,0),this._clearCommand=new ai({color:new O(0,0,0,0),depth:1,owner:this})}function mlt(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(tb.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});tb.prototype.update=function(e,t,n,i){let o=t.width,r=t.height,s=n?e.halfFloatingPointTexture?je.HALF_FLOAT:je.FLOAT:je.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,o,r,i,s),this._idFramebuffer.update(e,o,r)};tb.prototype.clear=function(e,t,n){O.clone(n,this._clearCommand.color),O.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};tb.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};tb.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};tb.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};tb.prototype.isDestroyed=function(){return!1};tb.prototype.destroy=function(){return mlt(this),ue(this)};var CT=tb;var UIi=T(S(),1);var KEi=T(S(),1);function VT(){}VT.getShadowCastShaderKeyword=function(e,t,n,i){return`castShadow ${e} ${t} ${n} ${i}`};VT.createShadowCastVertexShader=function(e,t,n){let i=e.defines.slice(0),o=e.sources.slice(0);i.push("SHADOW_MAP"),n&&i.push("GENERATE_POSITION");let r=Oe.findPositionVarying(e),s=l(r);if(t&&!s){let a=o.length;for(let d=0;d<a;++d)o[d]=Oe.replaceMain(o[d],"czm_shadow_cast_main");o.push(`out vec3 v_positionEC;
void main()
{
czm_shadow_cast_main();
v_positionEC = (czm_inverseProjection * gl_Position).xyz;
}`)}return new Oe({defines:i,sources:o})};VT.createShadowCastFragmentShader=function(e,t,n,i){let o=e.defines.slice(0),r=e.sources.slice(0);o.push("SHADOW_MAP");let s=Oe.findPositionVarying(e),a=l(s);a||(s="v_positionEC");let c=r.length;for(let u=0;u<c;++u)r[u]=Oe.replaceMain(r[u],"czm_shadow_cast_main");let d="";return t&&(a||(d+=`in vec3 v_positionEC;
`),d+=`uniform vec4 shadowMap_lightPositionEC;
`),i?d+=`void main()
{
`:d+=`void main()
{
czm_shadow_cast_main();
if (out_FragColor.a == 0.0)
{
discard;
}
`,t?d+=` float distance = length(${s});
if (distance >= shadowMap_lightPositionEC.w)
{
discard;
}
distance /= shadowMap_lightPositionEC.w; // radius
out_FragColor = czm_packDepth(distance);
`:n?d+=` out_FragColor = vec4(1.0);
`:d+=` out_FragColor = czm_packDepth(gl_FragCoord.z);
`,d+=`}
`,r.push(d),new Oe({defines:o,sources:r})};VT.getShadowReceiveShaderKeyword=function(e,t,n,i){let o=e._usesDepthTexture,r=e._polygonOffsetSupported,s=e._isPointLight,a=e._isSpotLight,c=e._numberOfCascades>1,d=e.debugCascadeColors,u=e.softShadows;return`receiveShadow ${o}${r}${s}${a}${c}${d}${u}${t}${n}${i}`};VT.createShadowReceiveVertexShader=function(e,t,n){let i=e.defines.slice(0),o=e.sources.slice(0);return i.push("SHADOW_MAP"),t&&(n?i.push("GENERATE_POSITION_AND_NORMAL"):i.push("GENERATE_POSITION")),new Oe({defines:i,sources:o})};VT.createShadowReceiveFragmentShader=function(e,t,n,i,o){let r=Oe.findNormalVarying(e),s=!i&&l(r)||i&&o,a=Oe.findPositionVarying(e),c=l(a),d=t._usesDepthTexture,u=t._polygonOffsetSupported,m=t._isPointLight,p=t._isSpotLight,y=t._numberOfCascades>1,f=t.debugCascadeColors,x=t.softShadows,_=m?t._pointBias:i?t._terrainBias:t._primitiveBias,C=e.defines.slice(0),V=e.sources.slice(0),L=V.length;for(let I=0;I<L;++I)V[I]=Oe.replaceMain(V[I],"czm_shadow_receive_main");m?C.push("USE_CUBE_MAP_SHADOW"):d&&C.push("USE_SHADOW_DEPTH_TEXTURE"),x&&!m&&C.push("USE_SOFT_SHADOWS"),y&&n&&i&&(s?C.push("ENABLE_VERTEX_LIGHTING"):C.push("ENABLE_DAYNIGHT_SHADING")),n&&_.normalShading&&s&&(C.push("USE_NORMAL_SHADING"),_.normalShadingSmooth>0&&C.push("USE_NORMAL_SHADING_SMOOTH"));let Z="";m?Z+=`uniform samplerCube shadowMap_textureCube;
`:Z+=`uniform sampler2D shadowMap_texture;
`;let G;return c?G=` return vec4(${a}, 1.0);
`:G=`#ifndef LOG_DEPTH
return czm_windowToEyeCoordinates(gl_FragCoord);
#else
return vec4(v_logPositionEC, 1.0);
#endif
`,Z+=`uniform mat4 shadowMap_matrix;
uniform vec3 shadowMap_lightDirectionEC;
uniform vec4 shadowMap_lightPositionEC;
uniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness;
uniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth;
#ifdef LOG_DEPTH
in vec3 v_logPositionEC;
#endif
vec4 getPositionEC()
{
${G}}
vec3 getNormalEC()
{
${s?` return normalize(${r});
`:` return vec3(1.0);
`}}
void applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL)
{
${_.normalOffset&&s?` float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x;
float normalOffsetScale = 1.0 - nDotL;
vec3 offset = normalOffset * normalOffsetScale * normalEC;
positionEC.xyz += offset;
`:""}}
`,Z+=`void main()
{
czm_shadow_receive_main();
vec4 positionEC = getPositionEC();
vec3 normalEC = getNormalEC();
float depth = -positionEC.z;
`,Z+=` czm_shadowParameters shadowParameters;
shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy;
shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z;
shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w;
shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w;
`,i?Z+=` shadowParameters.depthBias *= max(depth * 0.01, 1.0);
`:u||(Z+=` shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015);
`),m?Z+=` vec3 directionEC = positionEC.xyz - shadowMap_lightPositionEC.xyz;
float distance = length(directionEC);
directionEC = normalize(directionEC);
float radius = shadowMap_lightPositionEC.w;
// Stop early if the fragment is beyond the point light radius
if (distance > radius)
{
return;
}
vec3 directionWC = czm_inverseViewRotation * directionEC;
shadowParameters.depth = distance / radius;
shadowParameters.nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0);
shadowParameters.texCoords = directionWC;
float visibility = czm_shadowVisibility(shadowMap_textureCube, shadowParameters);
`:p?Z+=` vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz);
float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0);
applyNormalOffset(positionEC, normalEC, nDotL);
vec4 shadowPosition = shadowMap_matrix * positionEC;
// Spot light uses a perspective projection, so perform the perspective divide
shadowPosition /= shadowPosition.w;
// Stop early if the fragment is not in the shadow bounds
if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0))))
{
return;
}
shadowParameters.texCoords = shadowPosition.xy;
shadowParameters.depth = shadowPosition.z;
shadowParameters.nDotL = nDotL;
float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters);
`:y?Z+=` float maxDepth = shadowMap_cascadeSplits[1].w;
// Stop early if the eye depth exceeds the last cascade
if (depth > maxDepth)
{
return;
}
// Get the cascade based on the eye-space depth
vec4 weights = czm_cascadeWeights(depth);
// Apply normal offset
float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0);
applyNormalOffset(positionEC, normalEC, nDotL);
// Transform position into the cascade
vec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC;
// Get visibility
shadowParameters.texCoords = shadowPosition.xy;
shadowParameters.depth = shadowPosition.z;
shadowParameters.nDotL = nDotL;
float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters);
// Fade out shadows that are far away
float shadowMapMaximumDistance = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.z;
float fade = max((depth - shadowMapMaximumDistance * 0.8) / (shadowMapMaximumDistance * 0.2), 0.0);
visibility = mix(visibility, 1.0, fade);
${f?` // Draw cascade colors for debugging
out_FragColor *= czm_cascadeColor(weights);
`:""}`:Z+=` float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0);
applyNormalOffset(positionEC, normalEC, nDotL);
vec4 shadowPosition = shadowMap_matrix * positionEC;
// Stop early if the fragment is not in the shadow bounds
if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0))))
{
return;
}
shadowParameters.texCoords = shadowPosition.xy;
shadowParameters.depth = shadowPosition.z;
shadowParameters.nDotL = nDotL;
float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters);
`,Z+=` out_FragColor.rgb *= visibility;
}
`,V.push(Z),new Oe({defines:C,sources:V})};var Of=VT;function Yf(e){e=g(e,g.EMPTY_OBJECT);let t=e.context;this._enabled=g(e.enabled,!0),this._softShadows=g(e.softShadows,!1),this._normalOffset=g(e.normalOffset,!0),this.dirty=!0,this.fromLightSource=g(e.fromLightSource,!0),this.darkness=g(e.darkness,.3),this._darkness=this.darkness,this.fadingEnabled=g(e.fadingEnabled,!0),this.maximumDistance=g(e.maximumDistance,5e3),this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let n=!0;(Bt.isInternetExplorer()||Bt.isEdge()||(Bt.isChrome()||Bt.isFirefox())&&Bt.isWindows()&&!t.depthTexture)&&(n=!1),this._polygonOffsetSupported=n;let i=g(e.depthBiasStep,1);this._terrainBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4*i},this._primitiveBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5*i},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4*i},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new A,this._shadowMapTexture=void 0,this._lightDirectionEC=new h,this._lightPositionEC=new se,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new _D,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new ce,this._isPointLight=g(e.isPointLight,!1),this._pointLightRadius=g(e.pointLightRadius,100),this._cascadesEnabled=this._isPointLight?!1:g(e.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?g(e.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new B,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new Vr:l(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new se,new se],this._cascadeMatrices=[new A,new A,new A,new A],this._cascadeDistances=new se;let o;this._isPointLight?o=6:this._cascadesEnabled?o=this._numberOfCascades:o=1,this._passes=new Array(o);for(let r=0;r<o;++r)this._passes[r]=new hlt(t);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=t.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,Z4(this),this._clearCommand=new ai({depth:1,color:new O}),this._clearPassState=new pc(t),this._size=g(e.size,2048),this.size=this._size}Yf.MAXIMUM_DISTANCE=2e4;function hlt(e){this.camera=new _D,this.passState=new pc(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function R4(e,t){return ke.fromCache({cull:{enabled:!0,face:yi.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 Z4(e){let t=!e._usesDepthTexture;e._primitiveRenderState=R4(t,e._primitiveBias),e._terrainRenderState=R4(t,e._terrainBias),e._pointRenderState=R4(t,e._pointBias)}Yf.prototype.debugCreateRenderStates=function(){Z4(this)};Object.defineProperties(Yf.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){xlt(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}}});function G4(e){let t=e._passes.length;for(let n=0;n<t;++n){let i=e._passes[n],o=i.framebuffer;l(o)&&!o.isDestroyed()&&o.destroy(),i.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function flt(e,t){let n=new dd({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Dc.DEPTH_COMPONENT16}),i=new wt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:at.RGBA,pixelDatatype:je.UNSIGNED_BYTE,sampler:hn.NEAREST}),o=new na({context:t,depthRenderbuffer:n,colorTextures:[i],destroyAttachments:!1}),r=e._passes.length;for(let s=0;s<r;++s){let a=e._passes[s];a.framebuffer=o,a.passState.framebuffer=o}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function plt(e,t){let n=new wt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:at.DEPTH_STENCIL,pixelDatatype:je.UNSIGNED_INT_24_8,sampler:hn.NEAREST}),i=new na({context:t,depthStencilTexture:n,destroyAttachments:!1}),o=e._passes.length;for(let r=0;r<o;++r){let s=e._passes[r];s.framebuffer=i,s.passState.framebuffer=i}e._shadowMapTexture=n,e._depthAttachment=n}function blt(e,t){let n=new dd({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Dc.DEPTH_COMPONENT16}),i=new Ja({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:at.RGBA,pixelDatatype:je.UNSIGNED_BYTE,sampler:hn.NEAREST}),o=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let r=0;r<6;++r){let s=new na({context:t,depthRenderbuffer:n,colorTextures:[o[r]],destroyAttachments:!1}),a=e._passes[r];a.framebuffer=s,a.passState.framebuffer=s}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function Nye(e,t){e._isPointLight?blt(e,t):e._usesDepthTexture?plt(e,t):flt(e,t)}function ylt(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==ne.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,Z4(e),G4(e),Nye(e,t))}function glt(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(G4(e),Nye(e,t),ylt(e,t),Uye(e,t))}function Uye(e,t,n){n=g(n,0),(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function xlt(e,t){e._size=t;let n=e._passes,i=n.length,o=e._textureSize;if(e._isPointLight){t=Yt.maximumCubeMapSize>=t?t:Yt.maximumCubeMapSize,o.x=t,o.y=t;let r=new De(0,0,t,t);n[0].passState.viewport=r,n[1].passState.viewport=r,n[2].passState.viewport=r,n[3].passState.viewport=r,n[4].passState.viewport=r,n[5].passState.viewport=r}else i===1?(t=Yt.maximumTextureSize>=t?t:Yt.maximumTextureSize,o.x=t,o.y=t,n[0].passState.viewport=new De(0,0,t,t)):i===4&&(t=Yt.maximumTextureSize>=t*2?t:Yt.maximumTextureSize/2,o.x=t*2,o.y=t*2,n[0].passState.viewport=new De(0,0,t,t),n[1].passState.viewport=new De(t,0,t,t),n[2].passState.viewport=new De(0,t,t,t),n[3].passState.viewport=new De(t,t,t,t));e._clearPassState.viewport=new De(0,0,o.x,o.y);for(let r=0;r<i;++r){let s=n[r],a=s.passState.viewport,c=a.x/o.x,d=a.y/o.y,u=a.width/o.x,m=a.height/o.y;s.textureOffsets=new A(u,0,0,c,0,m,0,d,0,0,1,0,0,0,0,1)}}var _lt=new De;function Tlt(e,t){let n;e._isPointLight?n=`uniform samplerCube shadowMap_textureCube;
in vec2 v_textureCoordinates;
void main()
{
vec2 uv = v_textureCoordinates;
vec3 dir;
if (uv.y < 0.5)
{
if (uv.x < 0.333)
{
dir.x = -1.0;
dir.y = uv.x * 6.0 - 1.0;
dir.z = uv.y * 4.0 - 1.0;
}
else if (uv.x < 0.666)
{
dir.y = -1.0;
dir.x = uv.x * 6.0 - 3.0;
dir.z = uv.y * 4.0 - 1.0;
}
else
{
dir.z = -1.0;
dir.x = uv.x * 6.0 - 5.0;
dir.y = uv.y * 4.0 - 1.0;
}
}
else
{
if (uv.x < 0.333)
{
dir.x = 1.0;
dir.y = uv.x * 6.0 - 1.0;
dir.z = uv.y * 4.0 - 3.0;
}
else if (uv.x < 0.666)
{
dir.y = 1.0;
dir.x = uv.x * 6.0 - 3.0;
dir.z = uv.y * 4.0 - 3.0;
}
else
{
dir.z = 1.0;
dir.x = uv.x * 6.0 - 5.0;
dir.y = uv.y * 4.0 - 3.0;
}
}
float shadow = czm_unpackDepth(czm_textureCube(shadowMap_textureCube, dir));
out_FragColor = vec4(vec3(shadow), 1.0);
}
`:n=`uniform sampler2D shadowMap_texture;
in vec2 v_textureCoordinates;
void main()
{
${e._usesDepthTexture?` float shadow = texture(shadowMap_texture, v_textureCoordinates).r;
`:` float shadow = czm_unpackDepth(texture(shadowMap_texture, v_textureCoordinates));
`} out_FragColor = vec4(vec3(shadow), 1.0);
}
`;let i=t.createViewportQuadCommand(n,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return i.pass=Ve.OVERLAY,i}function Slt(e,t){let n=t.context,i=t.context.drawingBufferWidth,o=t.context.drawingBufferHeight,r=Math.min(i,o)*.3,s=_lt;s.x=i-r,s.y=0,s.width=r,s.height=r;let a=e._debugShadowViewCommand;l(a)||(a=Tlt(e,n),e._debugShadowViewCommand=a),(!l(a.renderState)||!De.equals(a.renderState.viewport,s))&&(a.renderState=ke.fromCache({viewport:De.clone(s)})),t.commandList.push(e._debugShadowViewCommand)}var Hf=new Array(8);Hf[0]=new se(-1,-1,-1,1);Hf[1]=new se(1,-1,-1,1);Hf[2]=new se(1,1,-1,1);Hf[3]=new se(-1,1,-1,1);Hf[4]=new se(-1,-1,1,1);Hf[5]=new se(1,-1,1,1);Hf[6]=new se(1,1,1,1);Hf[7]=new se(-1,1,1,1);var dg=new A,E4=new Array(8);for(let e=0;e<8;++e)E4[e]=new se;function Clt(e,t){let n=new St({geometry:new bm({minimum:new h(-.5,-.5,-.5),maximum:new h(.5,.5,.5)}),attributes:{color:Ot.fromColor(t)}}),i=new St({geometry:new m0({radius:.5}),attributes:{color:Ot.fromColor(t)}});return new En({geometryInstances:[n,i],appearance:new cn({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var Vlt=[O.RED,O.GREEN,O.BLUE,O.MAGENTA],Llt=new h;function Rlt(e,t){Slt(e,t);let n=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(n&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new Uf({camera:e._sceneCamera,color:O.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new Uf({camera:e._shadowMapCamera,color:O.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(let i=0;i<e._numberOfCascades;++i)n&&(e._debugCascadeFrustums[i]=e._debugCascadeFrustums[i]&&e._debugCascadeFrustums[i].destroy(),e._debugCascadeFrustums[i]=new Uf({camera:e._passes[i].camera,color:Vlt[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!l(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,o=Me.IDENTITY,r=e._pointLightRadius*2,s=h.fromElements(r,r,r,Llt),a=A.fromTranslationQuaternionRotationScale(i,o,s,dg);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=Clt(a,O.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new Uf({camera:e._shadowMapCamera,color:O.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function _D(){this.viewMatrix=new A,this.inverseViewMatrix=new A,this.frustum=void 0,this.positionCartographic=new he,this.positionWC=new h,this.directionWC=h.clone(h.UNIT_Z),this.upWC=h.clone(h.UNIT_Y),this.rightWC=h.clone(h.UNIT_X),this.viewProjectionMatrix=new A}_D.prototype.clone=function(e){A.clone(e.viewMatrix,this.viewMatrix),A.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),he.clone(e.positionCartographic,this.positionCartographic),h.clone(e.positionWC,this.positionWC),h.clone(e.directionWC,this.directionWC),h.clone(e.upWC,this.upWC),h.clone(e.rightWC,this.rightWC)};var Zlt=new A(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);_D.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return A.multiply(t,e,this.viewProjectionMatrix),A.multiply(Zlt,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var Glt=new Array(5),Elt=new Li,Ilt=new Array(4),kye=new h,Dye=new h;function Xlt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=i.frustum.near,r=i.frustum.far,s=e._numberOfCascades,a,c=r-o,d=r/o,u=.9,m=!1;t.shadowState.closestObjectSize<200&&(m=!0,u=.9);let p=Ilt,y=Glt;for(y[0]=o,y[s]=r,a=0;a<s;++a){let M=(a+1)/s,b=o*Math.pow(d,M),R=o+c*M,E=W.lerp(R,b,u);y[a+1]=E,p[a]=E-y[a]}if(m){for(a=0;a<s;++a)p[a]=Math.min(p[a],e._maximumCascadeDistances[a]);let M=y[0];for(a=0;a<s-1;++a)M+=p[a],y[a+1]=M}se.unpack(y,0,e._cascadeSplits[0]),se.unpack(y,1,e._cascadeSplits[1]),se.unpack(p,0,e._cascadeDistances);let f=n.frustum,x=f.left,_=f.right,C=f.bottom,V=f.top,L=f.near,Z=f.far,G=n.positionWC,I=n.directionWC,P=n.upWC,v=i.frustum.clone(Elt),F=n.getViewProjection();for(a=0;a<s;++a){v.near=y[a],v.far=y[a+1];let M=A.multiply(v.projectionMatrix,i.viewMatrix,dg),b=A.inverse(M,dg),R=A.multiply(F,b,dg),E=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,kye),X=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Dye);for(let Y=0;Y<8;++Y){let U=se.clone(Hf[Y],E4[Y]);A.multiplyByVector(R,U,U),h.divideByScalar(U,U.w,U),h.minimumByComponent(U,E,E),h.maximumByComponent(U,X,X)}E.x=Math.max(E.x,0),E.y=Math.max(E.y,0),E.z=0,X.x=Math.min(X.x,1),X.y=Math.min(X.y,1),X.z=Math.min(X.z,1);let w=e._passes[a],N=w.camera;N.clone(n);let D=N.frustum;D.left=x+E.x*(_-x),D.right=x+X.x*(_-x),D.bottom=C+E.y*(V-C),D.top=C+X.y*(V-C),D.near=L+E.z*(Z-L),D.far=L+X.z*(Z-L),w.cullingVolume=N.frustum.computeCullingVolume(G,I,P);let k=e._cascadeMatrices[a];A.multiply(N.getViewProjection(),i.inverseViewMatrix,k),A.multiply(w.textureOffsets,k,k)}}var Wlt=new A,Plt=new h,vlt=new h,Aye=new h;function wlt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=A.multiply(i.frustum.projectionMatrix,i.viewMatrix,dg),r=A.inverse(o,dg),s=n.directionWC,a=i.directionWC;h.equalsEpsilon(s,a,W.EPSILON10)&&(a=i.upWC);let c=h.cross(s,a,Plt);a=h.cross(c,s,vlt),h.normalize(a,a),h.normalize(c,c);let d=h.fromElements(0,0,0,Aye),u=A.computeView(d,s,a,c,Wlt),m=A.multiply(u,r,dg),p=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,kye),y=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Dye);for(let Z=0;Z<8;++Z){let G=se.clone(Hf[Z],E4[Z]);A.multiplyByVector(m,G,G),h.divideByScalar(G,G.w,G),h.minimumByComponent(G,p,p),h.maximumByComponent(G,y,y)}y.z+=1e3,p.z-=10;let f=Aye;f.x=-(.5*(p.x+y.x)),f.y=-(.5*(p.y+y.y)),f.z=-y.z;let x=A.fromTranslation(f,dg);u=A.multiply(x,u,u);let _=.5*(y.x-p.x),C=.5*(y.y-p.y),V=y.z-p.z,L=n.frustum;L.left=-_,L.right=_,L.bottom=-C,L.top=C,L.near=.01,L.far=V,A.clone(u,n.viewMatrix),A.inverse(u,n.inverseViewMatrix),A.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),h.clone(s,n.directionWC),h.clone(a,n.upWC),h.clone(c,n.rightWC)}var Flt=[new h(-1,0,0),new h(0,-1,0),new h(0,0,-1),new h(1,0,0),new h(0,1,0),new h(0,0,1)],Alt=[new h(0,-1,0),new h(0,0,-1),new h(0,-1,0),new h(0,-1,0),new h(0,0,1),new h(0,-1,0)],Mlt=[new h(0,0,1),new h(1,0,0),new h(-1,0,0),new h(0,0,-1),new h(1,0,0),new h(1,0,0)];function Nlt(e,t){let n=new Li;n.fov=W.PI_OVER_TWO,n.near=1,n.far=e._pointLightRadius,n.aspectRatio=1;for(let i=0;i<6;++i){let o=e._passes[i].camera;o.positionWC=e._shadowMapCamera.positionWC,o.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(o.positionWC,o.positionCartographic),o.directionWC=Flt[i],o.upWC=Alt[i],o.rightWC=Mlt[i],A.computeView(o.positionWC,o.directionWC,o.upWC,o.rightWC,o.viewMatrix),A.inverse(o.viewMatrix,o.inverseViewMatrix),o.frustum=n}}var Ult=new h,klt=new h,Bye=new ce,Mye=Bye.center;function Dlt(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,o=Bye;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let r=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,Ult),s=h.negate(i.directionWC,klt),a=h.dot(r,s);if(e.fadingEnabled){let c=W.clamp(a/.1,0,1);e._darkness=W.lerp(1,e.darkness,c)}else e._darkness=e.darkness;if(a<0){e._outOfView=!0,e._needsUpdate=!1;return}e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)o.center=i.positionWC,o.radius=e._pointLightRadius,e._outOfView=t.cullingVolume.computeVisibility(o)===nn.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),ce.clone(o,e._boundingSphere);else{let r=i.frustum.far/2,s=h.add(i.positionWC,h.multiplyByScalar(i.directionWC,r,Mye),Mye);o.center=s,o.radius=r,e._outOfView=t.cullingVolume.computeVisibility(o)===nn.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),ce.clone(o,e._boundingSphere)}}function Blt(e,t){let n=t.camera,i=e._lightCamera,o=e._sceneCamera,r=e._shadowMapCamera;e._cascadesEnabled?h.clone(i.directionWC,r.directionWC):e._isPointLight?h.clone(i.positionWC,r.positionWC):r.clone(i);let s=e._lightDirectionEC;A.multiplyByPointAsVector(n.viewMatrix,r.directionWC,s),h.normalize(s,s),h.negate(s,s),A.multiplyByPoint(n.viewMatrix,r.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;let a,c;e._fitNearFar?(a=Math.min(t.shadowState.nearPlane,e.maximumDistance),c=Math.min(t.shadowState.farPlane,e.maximumDistance),c=Math.max(c,a+1)):(a=n.frustum.near,c=e.maximumDistance),e._sceneCamera=fo.clone(n,o),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=c,e._distance=c-a,Dlt(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}Yf.prototype.update=function(e){if(Blt(this,e),this._needsUpdate)if(glt(this,e.context),this._isPointLight&&Nlt(this,e),this._cascadesEnabled&&(wlt(this,e),this._numberOfCascades>1&&Xlt(this,e)),this._isPointLight)this._shadowMapCullingVolume=as.fromBoundingSphere(this._boundingSphere);else{let t=this._shadowMapCamera,n=t.positionWC,i=t.directionWC,o=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(n,i,o),this._passes.length===1&&this._passes[0].camera.clone(t)}if(this._passes.length===1){let t=this._sceneCamera.inverseViewMatrix;A.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&Rlt(this,e)};Yf.prototype.updatePass=function(e,t){Uye(this,e,t)};var Olt=new B;function Oye(e,t,n){let i=e._isPointLight?e._pointBias:n?e._terrainBias:e._primitiveBias,o={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(){let r=Olt;return r.x=1/e._textureSize.x,r.y=1/e._textureSize.y,se.fromElements(r.x,r.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return se.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new se,combinedUniforms2:new se};return Tt(t,o,!1)}function Ylt(e,t,n,i,o,r){let s,a,c;if(l(r)&&(s=r.shaderProgram,a=r.renderState,c=r.uniformMap),r=nt.shallowClone(n,r),r.castShadows=!0,r.receiveShadows=!1,!l(s)||o!==n.shaderProgram.id||t){let d=n.shaderProgram,u=n.pass===Ve.GLOBE,m=n.pass!==Ve.TRANSLUCENT,p=e._isPointLight,y=e._usesDepthTexture,f=Of.getShadowCastShaderKeyword(p,u,y,m);if(s=i.shaderCache.getDerivedShaderProgram(d,f),!l(s)){let _=d.vertexShaderSource,C=d.fragmentShaderSource,V=Of.createShadowCastVertexShader(_,p,u),L=Of.createShadowCastFragmentShader(C,p,y,m);s=i.shaderCache.createDerivedShaderProgram(d,f,{vertexShaderSource:V,fragmentShaderSource:L,attributeLocations:d._attributeLocations})}a=e._primitiveRenderState,p?a=e._pointRenderState:u&&(a=e._terrainRenderState),n.renderState.cull.enabled||(a=ze(a,!1),a.cull=ze(a.cull,!1),a.cull.enabled=!1,a=ke.fromCache(a)),c=Oye(e,n.uniformMap,u)}return r.shaderProgram=s,r.renderState=a,r.uniformMap=c,r}Yf.createReceiveDerivedCommand=function(e,t,n,i,o){l(o)||(o={});let r=e.length>0,s=t.shaderProgram,a=s.vertexShaderSource,c=s.fragmentShaderSource,d=t.pass===Ve.GLOBE,u=!1;if(d&&(u=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&r){let m,p;l(o.receiveCommand)&&(m=o.receiveCommand.shaderProgram,p=o.receiveCommand.uniformMap),o.receiveCommand=nt.shallowClone(t,o.receiveCommand),o.castShadows=!1,o.receiveShadows=!0;let y=o.receiveShaderCastShadows!==t.castShadows,f=o.receiveShaderProgramId!==t.shaderProgram.id;if(!l(m)||f||n||y){let x=Of.getShadowReceiveShaderKeyword(e[0],t.castShadows,d,u);if(m=i.shaderCache.getDerivedShaderProgram(s,x),!l(m)){let _=Of.createShadowReceiveVertexShader(a,d,u),C=Of.createShadowReceiveFragmentShader(c,e[0],t.castShadows,d,u);m=i.shaderCache.createDerivedShaderProgram(s,x,{vertexShaderSource:_,fragmentShaderSource:C,attributeLocations:s._attributeLocations})}p=Oye(e[0],t.uniformMap,d)}o.receiveCommand.shaderProgram=m,o.receiveCommand.uniformMap=p,o.receiveShaderProgramId=t.shaderProgram.id,o.receiveShaderCastShadows=t.castShadows}return o};Yf.createCastDerivedCommand=function(e,t,n,i,o){if(l(o)||(o={}),t.castShadows){let r=o.castCommands;l(r)||(r=o.castCommands=[]);let s=o.castShaderProgramId,a=e.length;r.length=a;for(let c=0;c<a;++c)r[c]=Ylt(e[c],n,t,i,s,r[c]);o.castShaderProgramId=t.shaderProgram.id}return o};Yf.prototype.isDestroyed=function(){return!1};Yf.prototype.destroy=function(){G4(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(let e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return ue(this)};var nb=Yf;var lXi=T(S(),1);var DIi=T(S(),1),LT=`uniform sampler2D colorTexture;
#ifdef DEBUG_SHOW_DEPTH
uniform sampler2D u_packedTranslucentDepth;
#endif
in vec2 v_textureCoordinates;
void main()
{
#ifdef DEBUG_SHOW_DEPTH
if (v_textureCoordinates.x < 0.5)
{
out_FragColor.rgb = vec3(czm_unpackDepth(texture(u_packedTranslucentDepth, v_textureCoordinates)));
out_FragColor.a = 1.0;
}
#else
vec4 color = texture(colorTexture, v_textureCoordinates);
#ifdef PICK
if (color == vec4(0.0))
{
discard;
}
#else
// Reverse premultiplication process to get the correct composited result of the classification primitives
color.rgb /= color.a;
#endif
out_FragColor = color;
#endif
}
`;var Hlt=!1;function ug(e){this._drawClassificationFBO=new pi({createDepthAttachments:!1}),this._accumulationFBO=new pi({createDepthAttachments:!1}),this._packFBO=new pi,this._opaqueDepthStencilTexture=void 0,this._textureToComposite=void 0,this._translucentDepthStencilTexture=void 0,this._packDepthCommand=void 0,this._accumulateCommand=void 0,this._compositeCommand=void 0,this._copyCommand=void 0,this._clearColorCommand=new ai({color:new O(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new ai({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new De,this._rsDepth=void 0,this._rsAccumulate=void 0,this._rsComp=void 0,this._useScissorTest=void 0,this._scissorRectangle=void 0,this._hasTranslucentDepth=!1,this._frustumsDrawn=0}Object.defineProperties(ug.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function Yye(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function Hye(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function Klt(e,t,n,i){Yye(e),e._translucentDepthStencilTexture=new wt({context:t,width:n,height:i,pixelFormat:at.DEPTH_STENCIL,pixelDatatype:je.UNSIGNED_INT_24_8,sampler:hn.NEAREST})}function zlt(e,t,n,i){Hye(e),e._drawClassificationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._drawClassificationFBO.update(t,n,i),e._accumulationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._accumulationFBO.update(t,n,i),e._packFBO.update(t,n,i)}function Jlt(e,t,n,i){if(!e.isSupported())return;e._opaqueDepthStencilTexture=i;let o=e._opaqueDepthStencilTexture.width,r=e._opaqueDepthStencilTexture.height;e._drawClassificationFBO.isDirty(o,r)&&(Klt(e,t,o,r),zlt(e,t,o,r));let s,a;if(l(e._packDepthCommand)||(s=new Oe({sources:[Wv]}),a={u_opaqueDepthTexture:function(){return e._opaqueDepthStencilTexture},u_translucentDepthTexture:function(){return e._translucentDepthStencilTexture}},e._packDepthCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),!l(e._compositeCommand)){s=new Oe({sources:[LT]}),a={colorTexture:function(){return e._textureToComposite}},Hlt&&(s.defines=["DEBUG_SHOW_DEPTH"],a.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e});let u=e._compositeCommand,m=u.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(m,"pick",{vertexShaderSource:m.vertexShaderSource,fragmentShaderSource:new Oe({sources:s.sources,defines:["PICK"]}),attributeLocations:m._attributeLocations}),y=nt.shallowClone(u);y.shaderProgram=p,u.derivedCommands.pick=y}l(e._copyCommand)||(s=new Oe({sources:[LT]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),l(e._accumulateCommand)||(s=new Oe({sources:[LT]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._accumulateCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),e._viewport.width=o,e._viewport.height=r;let c=!De.equals(e._viewport,n.viewport),d=c!==e._useScissorTest;e._useScissorTest=c,De.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=De.clone(n.viewport,e._scissorRectangle),d=!0),(!l(e._rsDepth)||!De.equals(e._viewport,e._rsDepth.viewport)||d)&&(e._rsDepth=ke.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!l(e._rsAccumulate)||!De.equals(e._viewport,e._rsAccumulate.viewport)||d)&&(e._rsAccumulate=ke.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:On.EQUAL,reference:Nt.CESIUM_3D_TILE_MASK}})),l(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!l(e._rsComp)||!De.equals(e._viewport,e._rsComp.viewport)||d)&&(e._rsComp=ke.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:mn.ALPHA_BLEND})),l(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}ug.prototype.executeTranslucentCommands=function(e,t,n,i,o){let r=i.length,s,a,c=e.frameState.useLogDepth,d=e.context,u=n.framebuffer;for(a=0;a<r;++a)if(s=i[a],s=c?s.derivedCommands.logDepth.command:s,s.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}if(this._hasTranslucentDepth){for(Jlt(this,d,n,o),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(d,n),a=0;a<r;++a){if(s=i[a],s=c?s.derivedCommands.logDepth.command:s,!s.depthForTranslucentClassification)continue;let m=s.derivedCommands.depth.depthOnlyCommand;t(m,e,d,n)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(n.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(d,n)),n.framebuffer=u}};ug.prototype.executeClassificationCommands=function(e,t,n,i){if(!this._hasTranslucentDepth)return;let o=e.context,r=o.uniformState,s=n.framebuffer;this._frustumsDrawn===2&&(n.framebuffer=this._accumulationFBO.framebuffer,this._copyCommand.execute(o,n)),n.framebuffer=this._drawClassificationFBO.framebuffer,this._frustumsDrawn>1&&this._clearColorCommand.execute(o,n),r.updatePass(Ve.CESIUM_3D_TILE_CLASSIFICATION);let a=r.globeDepthTexture;r.globeDepthTexture=this._packFBO.getColorTexture();let c=i.commands[Ve.CESIUM_3D_TILE_CLASSIFICATION],d=i.indices[Ve.CESIUM_3D_TILE_CLASSIFICATION];for(let u=0;u<d;++u)t(c[u],e,o,n);r.globeDepthTexture=a,n.framebuffer=s,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=s)};ug.prototype.execute=function(e,t){if(!this._hasTranslucentDepth)return;this._frustumsDrawn===1?this._textureToComposite=this._drawClassificationFBO.getColorTexture():this._textureToComposite=this._accumulationFBO.getColorTexture(),(e.frameState.passes.pick?this._compositeCommand.derivedCommands.pick:this._compositeCommand).execute(e.context,t),Qlt(this,e,t)};function Qlt(e,t,n){if(!e._hasTranslucentDepth)return;let i=n.framebuffer;n.framebuffer=e._drawClassificationFBO.framebuffer,e._clearColorCommand.execute(t._context,n),n.framebuffer=i,e._frustumsDrawn>1&&(n.framebuffer=e._accumulationFBO.framebuffer,e._clearColorCommand.execute(t._context,n)),e._hasTranslucentDepth=!1,e._frustumsDrawn=0}ug.prototype.isSupported=function(){return this._supported};ug.prototype.isDestroyed=function(){return!1};ug.prototype.destroy=function(){return Yye(this),Hye(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._packDepthCommand)&&(this._packDepthCommand.shaderProgram=this._packDepthCommand.shaderProgram&&this._packDepthCommand.shaderProgram.destroy()),ue(this)};var rF=ug;function jlt(){this.command=void 0,this.near=void 0,this.far=void 0}function TD(e,t,n){let i=e.context,o;i.depthTexture&&(o=new jw);let r;e._useOIT&&i.depthTexture&&(r=new $w(i));let s=new pc(i);s.viewport=De.clone(n),this.camera=t,this._cameraClone=fo.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=s,this.pickFramebuffer=new oF(i),this.pickDepthFramebuffer=new tF,this.sceneFramebuffer=new CT,this.globeDepth=o,this.globeTranslucencyFramebuffer=new qw,this.oit=r,this.translucentTileClassification=new rF(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var Kye=new h,zye=new h;function qlt(e,t){let n=Math.max(Math.abs(e.x),Math.abs(t.x)),i=Math.max(Math.abs(e.y),Math.abs(t.y)),o=Math.max(Math.abs(e.z),Math.abs(t.z));return Math.max(Math.max(n,i),o)}function $lt(e,t,n){let i=1/Math.max(1,qlt(e.position,t.position));return h.multiplyByScalar(e.position,i,Kye),h.multiplyByScalar(t.position,i,zye),h.equalsEpsilon(Kye,zye,n)&&h.equalsEpsilon(e.direction,t.direction,n)&&h.equalsEpsilon(e.up,t.up,n)&&h.equalsEpsilon(e.right,t.right,n)&&A.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}TD.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return $lt(t,n,W.EPSILON15)?(this._cameraStartFired&&xi()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=xi(),fo.clone(t,n),!0)};function edt(e,t,n,i){let o=t.frameState,r=o.camera,s=o.useLogDepth?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,a=t.mode===ie.SCENE2D,c=t.nearToFarDistance2D;i*=1+W.EPSILON2,n=Math.min(Math.max(n,r.frustum.near),r.frustum.far),i=Math.max(Math.min(i,r.frustum.far),n),isNaN(n)&&(n=r.frustum.near),isNaN(i)&&(i=r.frustum.far);let d;a?(i=Math.min(i,r.position.z+t.nearToFarDistance2D),n=Math.min(n,i),d=Math.ceil(Math.max(1,i-n)/t.nearToFarDistance2D)):d=Math.ceil(Math.log(i/n)/Math.log(s));let u=e.frustumCommandsList;u.length=d;for(let m=0;m<d;++m){let p,y;a?(p=Math.min(i-c,n+m*c),y=Math.min(i,p+c)):(p=Math.max(n,Math.pow(s,m)*n),y=Math.min(i,s*p));let f=u[m];l(f)?(f.near=p,f.far=y):f=u[m]=new Qw(p,y)}}function tdt(e,t,n,i,o){t.debugShowFrustums&&(n.debugOverlappingFrustums=0);let r=e.frustumCommandsList,s=r.length;for(let a=0;a<s;++a){let c=r[a],d=c.near,u=c.far;if(i>u)continue;if(o<d)break;let m=n.pass,p=c.indices[m]++;if(c.commands[m][p]=n,t.debugShowFrustums&&(n.debugOverlappingFrustums|=1<<a),n.executeInClosestFrustum)break}if(t.debugShowFrustums){let a=e.debugFrustumStatistics.commandsInFrustums;a[n.debugOverlappingFrustums]=l(a[n.debugOverlappingFrustums])?a[n.debugOverlappingFrustums]+1:1,++e.debugFrustumStatistics.totalCommands}t.updateDerivedCommands(n)}var Jye=new as,ndt=new xa;TD.prototype.createPotentiallyVisibleSet=function(e){let t=e.frameState,n=t.camera,i=n.directionWC,o=n.positionWC,r=e._computeCommandList,s=e._overlayCommandList,a=t.commandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let c=this.frustumCommandsList,d=c.length,u=Ve.NUMBER_OF_PASSES;for(let R=0;R<d;++R)for(let E=0;E<u;++E)c[R].indices[E]=0;r.length=0,s.length=0;let m=this._commandExtents,p=m.length,y=0,f=+Number.MAX_VALUE,x=-Number.MAX_VALUE,_=t.shadowState.shadowsEnabled,C=+Number.MAX_VALUE,V=-Number.MAX_VALUE,L=Number.MAX_VALUE,Z=t.mode===ie.SCENE3D?t.occluder:void 0,G=t.cullingVolume,I=Jye.planes;for(let R=0;R<5;++R)I[R]=G.planes[R];G=Jye;let P=a.length;for(let R=0;R<P;++R){let E=a[R],X=E.pass;if(X===Ve.COMPUTE)r.push(E);else if(X===Ve.OVERLAY)s.push(E);else{let w,N,D=E.boundingVolume;if(l(D)){if(!e.isVisible(E,G,Z))continue;let Y=D.computePlaneDistances(o,i,ndt);if(w=Y.start,N=Y.stop,f=Math.min(f,w),x=Math.max(x,N),_&&E.receiveShadows&&w<nb.MAXIMUM_DISTANCE&&!(X===Ve.GLOBE&&w<-100&&N>100)){let U=N-w;X!==Ve.GLOBE&&w<100&&(L=Math.min(L,U)),C=Math.min(C,w),V=Math.max(V,N)}}else E instanceof ai?(w=n.frustum.near,N=n.frustum.far):(w=n.frustum.near,N=n.frustum.far,f=Math.min(f,w),x=Math.max(x,N));let k=m[y];l(k)||(k=m[y]=new jlt),k.command=E,k.near=w,k.far=N,y++}}_&&(C=Math.min(Math.max(C,n.frustum.near),n.frustum.far),V=Math.max(Math.min(V,n.frustum.far),C)),_&&(t.shadowState.nearPlane=C,t.shadowState.farPlane=V,t.shadowState.closestObjectSize=L),edt(this,e,f,x);let v,F;for(v=0;v<y;v++)F=m[v],tdt(this,e,F.command,F.near,F.far);if(y<p)for(v=y;v<p&&(F=m[v],!!l(F.command));v++)F.command=void 0;let M=c.length,b=t.frustumSplits;b.length=M+1;for(let R=0;R<M;++R)b[R]=c[R].near,R===M-1&&(b[R+1]=c[R].far)};TD.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(),this.translucentTileClassification=this.translucentTileClassification&&this.translucentTileClassification.destroy(),this.globeTranslucencyFramebuffer=this.globeTranslucencyFramebuffer&&this.globeTranslucencyFramebuffer.destroy();let e,t=this.pickDepths,n=t.length;for(e=0;e<n;++e)t[e].destroy()};var RT=TD;var jye=.1,idt=new em({pass:wo.MOST_DETAILED_PRELOAD}),odt=new em({pass:wo.MOST_DETAILED_PICK}),I4=new em({pass:wo.PICK});function Aa(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new De(0,0,1,1),n=new fo(e);n.frustum=new rn({width:jye,aspectRatio:1,near:.1}),this._pickOffscreenView=new RT(e,n,t)}Aa.prototype.update=function(){this._pickPositionCacheDirty=!0};Aa.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return l(i)||(i=new Jw,n[t]=i),i};var rdt=new Vr,sdt=new h,SD=new h,adt=new B,cdt=new A;function ldt(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2*(t.x-o.x)/o.width-1;c*=(s.right-s.left)*.5;let d=2*(o.height-t.y-o.y)/o.height-1;d*=(s.top-s.bottom)*.5;let u=A.clone(r.transform,cdt);r._setTransform(A.IDENTITY);let m=h.clone(r.position,sdt);h.multiplyByScalar(r.right,c,SD),h.add(SD,m,m),h.multiplyByScalar(r.up,d,SD),h.add(SD,m,m),r._setTransform(u),e.mode===ie.SCENE2D&&h.fromElements(m.z,m.x,m.y,m);let p=s.getPixelDimensions(o.width,o.height,1,1,adt),y=rdt;return y.right=p.x*.5,y.left=-y.right,y.top=p.y*.5,y.bottom=-y.top,y.near=s.near,y.far=s.far,y.computeCullingVolume(m,r.directionWC,r.upWC)}var ddt=new nl,udt=new B;function mdt(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.near,c=Math.tan(s.fovy*.5),d=s.aspectRatio*c,u=2*(t.x-o.x)/o.width-1,m=2*(o.height-t.y-o.y)/o.height-1,p=u*a*d,y=m*a*c,f=s.getPixelDimensions(o.width,o.height,1,1,udt),x=f.x*n*.5,_=f.y*i*.5,C=ddt;return C.top=y+_,C.bottom=y-_,C.right=p+x,C.left=p-x,C.near=a,C.far=s.far,C.computeCullingVolume(r.positionWC,r.directionWC,r.upWC)}function qye(e,t,n,i,o){let r=e.camera.frustum;return r instanceof rn||r instanceof Vr?ldt(e,t,n,i,o):mdt(e,t,n,i,o)}var wV=3,sF=3,Kf=new De(0,0,wV,sF),$ye=new B,X4=new O(0,0,0,0);Aa.prototype.pick=function(e,t,n,i){wV=g(n,3),sF=g(i,wV);let o=e.context,r=o.uniformState,s=e.frameState,a=e.defaultView;e.view=a;let c=a.viewport;c.x=0,c.y=0,c.width=o.drawingBufferWidth,c.height=o.drawingBufferHeight;let d=a.passState;d.viewport=De.clone(c,d.viewport);let u=to.transformWindowToDrawingBuffer(e,t,$ye);e.jobScheduler.disableThisFrame(),e.updateFrameState(),s.cullingVolume=qye(e,u,wV,sF,c),s.invertClassification=!1,s.passes.pick=!0,s.tilesetPassState=I4,r.update(s),e.updateEnvironment(),Kf.x=u.x-(wV-1)*.5,Kf.y=e.drawingBufferHeight-u.y-(sF-1)*.5,Kf.width=wV,Kf.height=sF,d=a.pickFramebuffer.begin(Kf,a.viewport),e.updateAndExecuteCommands(d,X4),e.resolveFramebuffers(d);let m=a.pickFramebuffer.end(Kf);return o.endFrame(),m};function hdt(e,t){let n=e.context,i=e.frameState,o=e.environmentState,r=e.defaultView;e.view=r;let s=r.viewport;s.x=0,s.y=0,s.width=n.drawingBufferWidth,s.height=n.drawingBufferHeight;let a=r.passState;a.viewport=De.clone(s,a.viewport),e.clearPasses(i.passes),i.passes.pick=!0,i.passes.depth=!0,i.cullingVolume=qye(e,t,1,1,s),i.tilesetPassState=I4,e.updateEnvironment(),o.renderTranslucentDepthForPick=!0,a=r.pickDepthFramebuffer.update(n,t,s),e.updateAndExecuteCommands(a,X4),e.resolveFramebuffers(a),n.endFrame()}var fdt=new Li,pdt=new nl,bdt=new rn,ydt=new Vr;Aa.prototype.pickPositionWorldCoordinates=function(e,t,n){if(!e.useDepthPicking)return;let i=t.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(i))return h.clone(this._pickPositionCache[i],n);let o=e.frameState,r=e.context,s=r.uniformState,a=e.defaultView;e.view=a;let c=to.transformWindowToDrawingBuffer(e,t,$ye);e.pickTranslucentDepth?hdt(e,c):(e.updateFrameState(),s.update(o),e.updateEnvironment()),c.y=e.drawingBufferHeight-c.y;let d=e.camera,u;l(d.frustum.fov)?u=d.frustum.clone(fdt):l(d.frustum.infiniteProjectionMatrix)?u=d.frustum.clone(pdt):l(d.frustum.width)?u=d.frustum.clone(bdt):u=d.frustum.clone(ydt);let m=a.frustumCommandsList,p=m.length;for(let y=0;y<p;++y){let x=this.getPickDepth(e,y).getDepth(r,c.x,c.y);if(l(x)&&x>0&&x<1){let _=m[y],C;return e.mode===ie.SCENE2D?(C=d.position.z,d.position.z=C-_.near+1,u.far=Math.max(1,_.far-_.near),u.near=1,s.update(o),s.updateFrustum(u)):(u.near=_.near*(y!==0?e.opaqueFrustumNearOffset:1),u.far=_.far,s.updateFrustum(u)),n=to.drawingBufferToWgs84Coordinates(e,c,x,n),e.mode===ie.SCENE2D&&(d.position.z=C,s.update(o)),this._pickPositionCache[i]=h.clone(n),n}}this._pickPositionCache[i]=void 0};var gdt=new he;Aa.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),l(n)&&e.mode!==ie.SCENE3D){h.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,o=i.ellipsoid,r=i.unproject(n,gdt);o.cartographicToCartesian(r,n)}return n};function ege(e,t){let n,i,o=[],r=[],s=[],a=[];l(e)||(e=Number.MAX_VALUE);let c=t();for(;l(c);){let d=c.object,u=c.position,m=c.exclude;if(l(u)&&!l(d)){o.push(c);break}if(!l(d)||!l(d.primitive)||!m&&(o.push(c),0>=--e))break;let p=d.primitive,y=!1;typeof p.getGeometryInstanceAttributes=="function"&&l(d.id)&&(i=p.getGeometryInstanceAttributes(d.id),l(i)&&l(i.show)&&(y=!0,i.show=Sn.toValue(!1,i.show),s.push(i))),d instanceof vs&&(y=!0,d.show=!1,a.push(d)),y||(p.show=!1,r.push(p)),c=t()}for(n=0;n<r.length;++n)r[n].show=!0;for(n=0;n<s.length;++n)i=s[n],i.show=Sn.toValue(!0,i.show);for(n=0;n<a.length;++n)a[n].show=!0;return o}Aa.prototype.drillPick=function(e,t,n,i,o){let r=this;return ege(n,function(){let c=r.pick(e,t,i,o);if(l(c))return{object:c,position:void 0,exclude:!1}}).map(function(c){return c.object})};var Qye=new h,xdt=new h;function _dt(e,t,n){this.ray=e,this.width=t,this.tilesets=n,this.ready=!1;let i=this;this.promise=new Promise(o=>{i._completePick=()=>{o()}})}function tge(e,t,n,i){let o=t.direction,r=h.mostOrthogonalAxis(o,Qye),s=h.cross(o,r,Qye),a=h.cross(o,s,xdt);return i.position=t.origin,i.direction=o,i.up=a,i.right=s,i.frustum.width=g(n,jye),i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function Tdt(e,t,n){let i=t.frameState,o=n.ray,r=n.width,s=n.tilesets,a=e._pickOffscreenView.camera,c=tge(e,o,r,a),d=idt;d.camera=a,d.cullingVolume=c;let u=!0,m=s.length;for(let p=0;p<m;++p){let y=s[p];y.show&&t.primitives.contains(y)&&(y.updateForPass(i,d),u=u&&d.ready)}return u&&n._completePick(),u}Aa.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)Tdt(this,e,t[n])&&t.splice(n--,1)};function nge(e,t,n){let i=e.length;for(let o=0;o<i;++o){let r=e.get(o);r.show&&(l(r.isCesium3DTileset)?(!l(t)||t.indexOf(r)===-1)&&n.push(r):r instanceof Fl&&nge(r,t,n))}}function CD(e,t,n,i,o,r){let s=[];if(nge(t.primitives,i,s),s.length===0)return Promise.resolve(r());let a=new _dt(n,o,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return r()})}function Sdt(e,t){return!l(e)||!l(t)||t.length===0?!1:t.indexOf(e)>-1||t.indexOf(e.primitive)>-1||t.indexOf(e.id)>-1}function Cdt(e,t,n,i,o,r,s){let a=t.context,c=a.uniformState,d=t.frameState,u=e._pickOffscreenView;t.view=u,tge(e,n,o,u.camera),Kf=De.clone(u.viewport,Kf);let m=u.pickFramebuffer.begin(Kf,u.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),d.invertClassification=!1,d.passes.pick=!0,d.passes.offscreen=!0,s?d.tilesetPassState=odt:d.tilesetPassState=I4,c.update(d),t.updateEnvironment(),t.updateAndExecuteCommands(m,X4),t.resolveFramebuffers(m);let p,y=u.pickFramebuffer.end(Kf);if(t.context.depthTexture){let f=u.frustumCommandsList.length;for(let x=0;x<f;++x){let C=e.getPickDepth(t,x).getDepth(a,0,0);if(l(C)&&C>0&&C<1){let V=u.frustumCommandsList[x],L=V.near*(x!==0?t.opaqueFrustumNearOffset:1),Z=V.far,G=L+C*(Z-L);p=gn.getPoint(n,G);break}}}if(t.view=t.defaultView,a.endFrame(),l(y)||l(p))return{object:y,position:p,exclude:!l(p)&&r||Sdt(y,i)}}function ige(e,t,n,i,o,r,s,a){return ege(i,function(){return Cdt(e,t,n,o,r,s,a)})}function FV(e,t,n,i,o,r,s){let a=ige(e,t,n,1,i,o,r,s);if(a.length>0)return a[0]}function oge(e,t,n,i,o,r,s,a){return ige(e,t,n,i,o,r,s,a)}function VD(e,t){return new Promise((n,i)=>{t.then(function(o){let r=e.postRender.addEventListener(function(){r(),n(o)});e.requestRender()}).catch(function(o){i(o)})})}Aa.prototype.pickFromRay=function(e,t,n,i){return FV(this,e,t,n,i,!1,!1)};Aa.prototype.drillPickFromRay=function(e,t,n,i,o){return oge(this,e,t,n,i,o,!1,!1)};Aa.prototype.pickFromRayMostDetailed=function(e,t,n,i){let o=this;return t=gn.clone(t),n=l(n)?n.slice():n,VD(e,CD(o,e,t,n,i,function(){return FV(o,e,t,n,i,!1,!0)}))};Aa.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,o){let r=this;return t=gn.clone(t),i=l(i)?i.slice():i,VD(e,CD(r,e,t,i,o,function(){return oge(r,e,t,n,i,o,!1,!0)}))};var Vdt=new h,Ldt=new h,Rdt=new gn,rge=new he;function W4(e,t){let n=e.globe,i=l(n)?n.ellipsoid:e.mapProjection.ellipsoid,o=hi._defaultMaxTerrainHeight,r=i.geodeticSurfaceNormalCartographic(t,Ldt),s=he.toCartesian(t,i,Vdt),a=Rdt;a.origin=s,a.direction=r;let c=new gn;return gn.getPoint(a,o,c.origin),h.negate(r,c.direction),c}function sge(e,t){let n=e.globe,i=l(n)?n.ellipsoid:e.mapProjection.ellipsoid,o=he.fromCartesian(t,i,rge);return W4(e,o)}function age(e,t){let n=e.globe,i=l(n)?n.ellipsoid:e.mapProjection.ellipsoid;return he.fromCartesian(t,i,rge).height}function Zdt(e,t,n,i,o){let r=W4(t,n);return CD(e,t,r,i,o,function(){let s=FV(e,t,r,i,o,!0,!0);if(l(s))return age(t,s.position)})}function Gdt(e,t,n,i,o,r){let s=sge(t,n);return CD(e,t,s,i,o,function(){let a=FV(e,t,s,i,o,!0,!0);if(l(a))return h.clone(a.position,r)})}Aa.prototype.sampleHeight=function(e,t,n,i){let o=W4(e,t),r=FV(this,e,o,n,i,!0,!1);if(l(r))return age(e,r.position)};Aa.prototype.clampToHeight=function(e,t,n,i,o){let r=sge(e,t),s=FV(this,e,r,n,i,!0,!1);if(l(s))return h.clone(s.position,o)};Aa.prototype.sampleHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=Zdt(this,e,t[s],n,i);return VD(e,Promise.all(r).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c].height=s[c];return t}))};Aa.prototype.clampToHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=Gdt(this,e,t[s],n,i,t[s]);return VD(e,Promise.all(r).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c]=s[c];return t}))};Aa.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var aF=Aa;var RPi=T(S(),1);var tPi=T(S(),1);var aWi=T(S(),1),cF=`uniform sampler2D colorTexture;
in vec2 v_textureCoordinates;
#ifdef AUTO_EXPOSURE
uniform sampler2D autoExposure;
#endif
void main()
{
vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);
vec3 color = fragmentColor.rgb;
#ifdef AUTO_EXPOSURE
color /= texture(autoExposure, vec2(0.5)).r;
#endif
color = czm_acesTonemapping(color);
color = czm_inverseGamma(color);
out_FragColor = vec4(color, fragmentColor.a);
}
`;var lWi=T(S(),1),lF=`uniform sampler2D randomTexture;
uniform sampler2D depthTexture;
uniform float intensity;
uniform float bias;
uniform float lengthCap;
uniform float stepSize;
uniform float frustumLength;
in vec2 v_textureCoordinates;
vec4 clipToEye(vec2 uv, float depth)
{
vec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0));
vec4 posEC = czm_inverseProjection * vec4(xy, depth, 1.0);
posEC = posEC / posEC.w;
return posEC;
}
//Reconstruct Normal Without Edge Removation
vec3 getNormalXEdge(vec3 posInCamera, float depthU, float depthD, float depthL, float depthR, vec2 pixelSize)
{
vec4 posInCameraUp = clipToEye(v_textureCoordinates - vec2(0.0, pixelSize.y), depthU);
vec4 posInCameraDown = clipToEye(v_textureCoordinates + vec2(0.0, pixelSize.y), depthD);
vec4 posInCameraLeft = clipToEye(v_textureCoordinates - vec2(pixelSize.x, 0.0), depthL);
vec4 posInCameraRight = clipToEye(v_textureCoordinates + vec2(pixelSize.x, 0.0), depthR);
vec3 up = posInCamera.xyz - posInCameraUp.xyz;
vec3 down = posInCameraDown.xyz - posInCamera.xyz;
vec3 left = posInCamera.xyz - posInCameraLeft.xyz;
vec3 right = posInCameraRight.xyz - posInCamera.xyz;
vec3 DX = length(left) < length(right) ? left : right;
vec3 DY = length(up) < length(down) ? up : down;
return normalize(cross(DY, DX));
}
void main(void)
{
float depth = czm_readDepth(depthTexture, v_textureCoordinates);
vec4 posInCamera = clipToEye(v_textureCoordinates, depth);
if (posInCamera.z > frustumLength)
{
out_FragColor = vec4(1.0);
return;
}
vec2 pixelSize = czm_pixelRatio / czm_viewport.zw;
float depthU = czm_readDepth(depthTexture, v_textureCoordinates - vec2(0.0, pixelSize.y));
float depthD = czm_readDepth(depthTexture, v_textureCoordinates + vec2(0.0, pixelSize.y));
float depthL = czm_readDepth(depthTexture, v_textureCoordinates - vec2(pixelSize.x, 0.0));
float depthR = czm_readDepth(depthTexture, v_textureCoordinates + vec2(pixelSize.x, 0.0));
vec3 normalInCamera = getNormalXEdge(posInCamera.xyz, depthU, depthD, depthL, depthR, pixelSize);
float ao = 0.0;
vec2 sampleDirection = vec2(1.0, 0.0);
float gapAngle = 90.0 * czm_radiansPerDegree;
// RandomNoise
float randomVal = texture(randomTexture, v_textureCoordinates / pixelSize / 255.0).x;
//Loop for each direction
for (int i = 0; i < 4; i++)
{
float newGapAngle = gapAngle * (float(i) + randomVal);
float cosVal = cos(newGapAngle);
float sinVal = sin(newGapAngle);
//Rotate Sampling Direction
vec2 rotatedSampleDirection = vec2(cosVal * sampleDirection.x - sinVal * sampleDirection.y, sinVal * sampleDirection.x + cosVal * sampleDirection.y);
float localAO = 0.0;
float localStepSize = stepSize;
//Loop for each step
for (int j = 0; j < 6; j++)
{
vec2 newCoords = v_textureCoordinates + rotatedSampleDirection * localStepSize * pixelSize;
//Exception Handling
if(newCoords.x > 1.0 || newCoords.y > 1.0 || newCoords.x < 0.0 || newCoords.y < 0.0)
{
break;
}
float stepDepthInfo = czm_readDepth(depthTexture, newCoords);
vec4 stepPosInCamera = clipToEye(newCoords, stepDepthInfo);
vec3 diffVec = stepPosInCamera.xyz - posInCamera.xyz;
float len = length(diffVec);
if (len > lengthCap)
{
break;
}
float dotVal = clamp(dot(normalInCamera, normalize(diffVec)), 0.0, 1.0 );
float weight = len / lengthCap;
weight = 1.0 - weight * weight;
if (dotVal < bias)
{
dotVal = 0.0;
}
localAO = max(localAO, dotVal * weight);
localStepSize += stepSize;
}
ao += localAO;
}
ao /= 4.0;
ao = 1.0 - clamp(ao, 0.0, 1.0);
ao = pow(ao, intensity);
out_FragColor = vec4(vec3(ao), 1.0);
}
`;var uWi=T(S(),1),dF=`uniform sampler2D colorTexture;
uniform sampler2D ambientOcclusionTexture;
uniform bool ambientOcclusionOnly;
in vec2 v_textureCoordinates;
void main(void)
{
vec4 color = texture(colorTexture, v_textureCoordinates);
vec4 ao = texture(ambientOcclusionTexture, v_textureCoordinates);
out_FragColor = ambientOcclusionOnly ? ao : ao * color;
}
`;var hWi=T(S(),1),uF=`uniform sampler2D colorTexture;
uniform float gradations;
in vec2 v_textureCoordinates;
void main(void)
{
vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb;
#ifdef CZM_SELECTED_FEATURE
if (czm_selected()) {
out_FragColor = vec4(rgb, 1.0);
return;
}
#endif
float luminance = czm_luminance(rgb);
float darkness = luminance * gradations;
darkness = (darkness - fract(darkness)) / gradations;
out_FragColor = vec4(vec3(darkness), 1.0);
}
`;var pWi=T(S(),1),mF=`uniform sampler2D colorTexture;
uniform sampler2D bloomTexture;
uniform bool glowOnly;
in vec2 v_textureCoordinates;
void main(void)
{
vec4 color = texture(colorTexture, v_textureCoordinates);
#ifdef CZM_SELECTED_FEATURE
if (czm_selected()) {
out_FragColor = color;
return;
}
#endif
vec4 bloom = texture(bloomTexture, v_textureCoordinates);
out_FragColor = glowOnly ? bloom : bloom + color;
}
`;var yWi=T(S(),1),hF=`uniform sampler2D colorTexture;
uniform float brightness;
in vec2 v_textureCoordinates;
void main(void)
{
vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb;
vec3 target = vec3(0.0);
out_FragColor = vec4(mix(target, rgb, brightness), 1.0);
}
`;var xWi=T(S(),1),fF=`uniform sampler2D colorTexture;
uniform float contrast;
uniform float brightness;
in vec2 v_textureCoordinates;
void main(void)
{
vec3 sceneColor = texture(colorTexture, v_textureCoordinates).xyz;
sceneColor = czm_RGBToHSB(sceneColor);
sceneColor.z += brightness;
sceneColor = czm_HSBToRGB(sceneColor);
float factor = (259.0 * (contrast + 255.0)) / (255.0 * (259.0 - contrast));
sceneColor = factor * (sceneColor - vec3(0.5)) + vec3(0.5);
out_FragColor = vec4(sceneColor, 1.0);
}
`;var TWi=T(S(),1),pF=`uniform sampler2D colorTexture;
uniform sampler2D blurTexture;
uniform sampler2D depthTexture;
uniform float focalDistance;
in vec2 v_textureCoordinates;
vec4 toEye(vec2 uv, float depth)
{
vec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0));
vec4 posInCamera = czm_inverseProjection * vec4(xy, depth, 1.0);
posInCamera = posInCamera / posInCamera.w;
return posInCamera;
}
float computeDepthBlur(float depth)
{
float f;
if (depth < focalDistance)
{
f = (focalDistance - depth) / (focalDistance - czm_currentFrustum.x);
}
else
{
f = (depth - focalDistance) / (czm_currentFrustum.y - focalDistance);
f = pow(f, 0.1);
}
f *= f;
f = clamp(f, 0.0, 1.0);
return pow(f, 0.5);
}
void main(void)
{
float depth = czm_readDepth(depthTexture, v_textureCoordinates);
vec4 posInCamera = toEye(v_textureCoordinates, depth);
float d = computeDepthBlur(-posInCamera.z);
out_FragColor = mix(texture(colorTexture, v_textureCoordinates), texture(blurTexture, v_textureCoordinates), d);
}
`;var CWi=T(S(),1),bF=`uniform sampler2D depthTexture;
in vec2 v_textureCoordinates;
void main(void)
{
float depth = czm_readDepth(depthTexture, v_textureCoordinates);
out_FragColor = vec4(vec3(depth), 1.0);
}
`;var LWi=T(S(),1),yF=`uniform sampler2D depthTexture;
uniform float length;
uniform vec4 color;
in vec2 v_textureCoordinates;
void main(void)
{
float directions[3];
directions[0] = -1.0;
directions[1] = 0.0;
directions[2] = 1.0;
float scalars[3];
scalars[0] = 3.0;
scalars[1] = 10.0;
scalars[2] = 3.0;
float padx = czm_pixelRatio / czm_viewport.z;
float pady = czm_pixelRatio / czm_viewport.w;
#ifdef CZM_SELECTED_FEATURE
bool selected = false;
for (int i = 0; i < 3; ++i)
{
float dir = directions[i];
selected = selected || czm_selected(vec2(-padx, dir * pady));
selected = selected || czm_selected(vec2(padx, dir * pady));
selected = selected || czm_selected(vec2(dir * padx, -pady));
selected = selected || czm_selected(vec2(dir * padx, pady));
if (selected)
{
break;
}
}
if (!selected)
{
out_FragColor = vec4(color.rgb, 0.0);
return;
}
#endif
float horizEdge = 0.0;
float vertEdge = 0.0;
for (int i = 0; i < 3; ++i)
{
float dir = directions[i];
float scale = scalars[i];
horizEdge -= texture(depthTexture, v_textureCoordinates + vec2(-padx, dir * pady)).x * scale;
horizEdge += texture(depthTexture, v_textureCoordinates + vec2(padx, dir * pady)).x * scale;
vertEdge -= texture(depthTexture, v_textureCoordinates + vec2(dir * padx, -pady)).x * scale;
vertEdge += texture(depthTexture, v_textureCoordinates + vec2(dir * padx, pady)).x * scale;
}
float len = sqrt(horizEdge * horizEdge + vertEdge * vertEdge);
out_FragColor = vec4(color.rgb, len > length ? color.a : 0.0);
}
`;var ZWi=T(S(),1),gF=`uniform sampler2D colorTexture;
in vec2 v_textureCoordinates;
#ifdef AUTO_EXPOSURE
uniform sampler2D autoExposure;
#endif
// See slides 142 and 143:
// http://www.gdcvault.com/play/1012459/Uncharted_2__HDR_Lighting
void main()
{
vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);
vec3 color = fragmentColor.rgb;
#ifdef AUTO_EXPOSURE
float exposure = texture(autoExposure, vec2(0.5)).r;
color /= exposure;
#endif
const float A = 0.22; // shoulder strength
const float B = 0.30; // linear strength
const float C = 0.10; // linear angle
const float D = 0.20; // toe strength
const float E = 0.01; // toe numerator
const float F = 0.30; // toe denominator
const float white = 11.2; // linear white point value
vec3 c = ((color * (A * color + C * B) + D * E) / (color * ( A * color + B) + D * F)) - E / F;
float w = ((white * (A * white + C * B) + D * E) / (white * ( A * white + B) + D * F)) - E / F;
c = czm_inverseGamma(c / w);
out_FragColor = vec4(c, fragmentColor.a);
}
`;var EWi=T(S(),1),xF=`in vec2 v_textureCoordinates;
uniform sampler2D colorTexture;
const float fxaaQualitySubpix = 0.5;
const float fxaaQualityEdgeThreshold = 0.125;
const float fxaaQualityEdgeThresholdMin = 0.0833;
void main()
{
vec2 fxaaQualityRcpFrame = vec2(1.0) / czm_viewport.zw;
vec4 color = FxaaPixelShader(
v_textureCoordinates,
colorTexture,
fxaaQualityRcpFrame,
fxaaQualitySubpix,
fxaaQualityEdgeThreshold,
fxaaQualityEdgeThresholdMin);
float alpha = texture(colorTexture, v_textureCoordinates).a;
out_FragColor = vec4(color.rgb, alpha);
}
`;var XWi=T(S(),1),mg=`#define SAMPLES 8
uniform float delta;
uniform float sigma;
uniform float direction; // 0.0 for x direction, 1.0 for y direction
uniform sampler2D colorTexture;
#ifdef USE_STEP_SIZE
uniform float stepSize;
#else
uniform vec2 step;
#endif
in vec2 v_textureCoordinates;
// Incremental Computation of the Gaussian:
// https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch40.html
void main()
{
vec2 st = v_textureCoordinates;
vec2 dir = vec2(1.0 - direction, direction);
#ifdef USE_STEP_SIZE
vec2 step = vec2(stepSize * (czm_pixelRatio / czm_viewport.zw));
#else
vec2 step = step;
#endif
vec3 g;
g.x = 1.0 / (sqrt(czm_twoPi) * sigma);
g.y = exp((-0.5 * delta * delta) / (sigma * sigma));
g.z = g.y * g.y;
vec4 result = texture(colorTexture, st) * g.x;
for (int i = 1; i < SAMPLES; ++i)
{
g.xy *= g.yz;
vec2 offset = float(i) * dir * step;
result += texture(colorTexture, st - offset) * g.x;
result += texture(colorTexture, st + offset) * g.x;
}
out_FragColor = result;
}
`;var PWi=T(S(),1),_F=`uniform sampler2D colorTexture;
uniform sampler2D dirtTexture;
uniform sampler2D starTexture;
uniform vec2 dirtTextureDimensions;
uniform float distortion;
uniform float ghostDispersal;
uniform float haloWidth;
uniform float dirtAmount;
uniform float earthRadius;
uniform float intensity;
in vec2 v_textureCoordinates;
// whether it is in space or not
// 6500000.0 is empirical value
#define DISTANCE_TO_SPACE 6500000.0
// return ndc from world coordinate biased earthRadius
vec4 getNDCFromWC(vec3 WC, float earthRadius)
{
vec4 positionEC = czm_view * vec4(WC, 1.0);
positionEC = vec4(positionEC.x + earthRadius, positionEC.y, positionEC.z, 1.0);
vec4 positionWC = czm_eyeToWindowCoordinates(positionEC);
return czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);
}
// Check if current pixel is included Earth
// if then mask it gradually
float isInEarth(vec2 texcoord, vec2 sceneSize)
{
vec2 NDC = texcoord * 2.0 - 1.0;
vec4 earthPosSC = getNDCFromWC(vec3(0.0), 0.0);
vec4 earthPosSCEdge = getNDCFromWC(vec3(0.0), earthRadius * 1.5);
NDC.xy -= earthPosSC.xy;
float X = abs(NDC.x) * sceneSize.x;
float Y = abs(NDC.y) * sceneSize.y;
return clamp(0.0, 1.0, max(sqrt(X * X + Y * Y) / max(abs(earthPosSCEdge.x * sceneSize.x), 1.0) - 0.8 , 0.0));
}
// For Chromatic effect
vec4 textureDistorted(sampler2D tex, vec2 texcoord, vec2 direction, vec3 distortion, bool isSpace)
{
vec2 sceneSize = czm_viewport.zw;
vec3 color;
if(isSpace)
{
color.r = isInEarth(texcoord + direction * distortion.r, sceneSize) * texture(tex, texcoord + direction * distortion.r).r;
color.g = isInEarth(texcoord + direction * distortion.g, sceneSize) * texture(tex, texcoord + direction * distortion.g).g;
color.b = isInEarth(texcoord + direction * distortion.b, sceneSize) * texture(tex, texcoord + direction * distortion.b).b;
}
else
{
color.r = texture(tex, texcoord + direction * distortion.r).r;
color.g = texture(tex, texcoord + direction * distortion.g).g;
color.b = texture(tex, texcoord + direction * distortion.b).b;
}
return vec4(clamp(color, 0.0, 1.0), 0.0);
}
void main(void)
{
vec4 originalColor = texture(colorTexture, v_textureCoordinates);
vec3 rgb = originalColor.rgb;
bool isSpace = length(czm_viewerPositionWC.xyz) > DISTANCE_TO_SPACE;
// Sun position
vec4 sunPos = czm_morphTime == 1.0 ? vec4(czm_sunPositionWC, 1.0) : vec4(czm_sunPositionColumbusView.zxy, 1.0);
vec4 sunPositionEC = czm_view * sunPos;
vec4 sunPositionWC = czm_eyeToWindowCoordinates(sunPositionEC);
sunPos = czm_viewportOrthographic * vec4(sunPositionWC.xy, -sunPositionWC.z, 1.0);
// If sun is not in the screen space, use original color.
if(!isSpace || !((sunPos.x >= -1.1 && sunPos.x <= 1.1) && (sunPos.y >= -1.1 && sunPos.y <= 1.1)))
{
// Lens flare is disabled when not in space until #5932 is fixed.
// https://github.com/CesiumGS/cesium/issues/5932
out_FragColor = originalColor;
return;
}
vec2 texcoord = vec2(1.0) - v_textureCoordinates;
vec2 pixelSize = czm_pixelRatio / czm_viewport.zw;
vec2 invPixelSize = 1.0 / pixelSize;
vec3 distortionVec = pixelSize.x * vec3(-distortion, 0.0, distortion);
// ghost vector to image centre:
vec2 ghostVec = (vec2(0.5) - texcoord) * ghostDispersal;
vec3 direction = normalize(vec3(ghostVec, 0.0));
// sample ghosts:
vec4 result = vec4(0.0);
vec4 ghost = vec4(0.0);
for (int i = 0; i < 4; ++i)
{
vec2 offset = fract(texcoord + ghostVec * float(i));
// Only bright spots from the centre of the source image
ghost += textureDistorted(colorTexture, offset, direction.xy, distortionVec, isSpace);
}
result += ghost;
// sample halo
vec2 haloVec = normalize(ghostVec) * haloWidth;
float weightForHalo = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5));
weightForHalo = pow(1.0 - weightForHalo, 5.0);
result += textureDistorted(colorTexture, texcoord + haloVec, direction.xy, distortionVec, isSpace) * weightForHalo * 1.5;
// dirt on lens
vec2 dirtTexCoords = (v_textureCoordinates * invPixelSize) / dirtTextureDimensions;
if (dirtTexCoords.x > 1.0)
{
dirtTexCoords.x = mod(floor(dirtTexCoords.x), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.x) : fract(dirtTexCoords.x);
}
if (dirtTexCoords.y > 1.0)
{
dirtTexCoords.y = mod(floor(dirtTexCoords.y), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.y) : fract(dirtTexCoords.y);
}
result += dirtAmount * texture(dirtTexture, dirtTexCoords);
// Rotating starburst texture's coordinate
// dot(czm_view[0].xyz, vec3(0.0, 0.0, 1.0)) + dot(czm_view[1].xyz, vec3(0.0, 1.0, 0.0))
float camrot = czm_view[0].z + czm_view[1].y;
float cosValue = cos(camrot);
float sinValue = sin(camrot);
mat3 rotation = mat3(
cosValue, -sinValue, 0.0,
sinValue, cosValue, 0.0,
0.0, 0.0, 1.0
);
vec3 st1 = vec3(v_textureCoordinates * 2.0 - vec2(1.0), 1.0);
vec3 st2 = vec3((rotation * st1).xy, 1.0);
vec3 st3 = st2 * 0.5 + vec3(0.5);
vec2 lensStarTexcoord = st3.xy;
float weightForLensFlare = length(vec3(sunPos.xy, 0.0));
float oneMinusWeightForLensFlare = max(1.0 - weightForLensFlare, 0.0);
if (!isSpace)
{
result *= oneMinusWeightForLensFlare * intensity * 0.2;
}
else
{
result *= oneMinusWeightForLensFlare * intensity;
result *= texture(starTexture, lensStarTexcoord) * pow(weightForLensFlare, 1.0) * max((1.0 - length(vec3(st1.xy, 0.0))), 0.0) * 2.0;
}
result += texture(colorTexture, v_textureCoordinates);
out_FragColor = result;
}
`;var wWi=T(S(),1),TF=`uniform sampler2D colorTexture;
uniform vec3 white;
in vec2 v_textureCoordinates;
#ifdef AUTO_EXPOSURE
uniform sampler2D autoExposure;
#endif
// See equation 4:
// http://www.cs.utah.edu/~reinhard/cdrom/tonemap.pdf
void main()
{
vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);
vec3 color = fragmentColor.rgb;
#ifdef AUTO_EXPOSURE
float exposure = texture(autoExposure, vec2(0.5)).r;
color /= exposure;
#endif
color = (color * (1.0 + color / white)) / (1.0 + color);
color = czm_inverseGamma(color);
out_FragColor = vec4(color, fragmentColor.a);
}
`;var AWi=T(S(),1),SF=`uniform sampler2D colorTexture;
in vec2 v_textureCoordinates;
float rand(vec2 co)
{
return fract(sin(dot(co.xy ,vec2(12.9898, 78.233))) * 43758.5453);
}
void main(void)
{
float noiseValue = rand(v_textureCoordinates + sin(czm_frameNumber)) * 0.1;
vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb;
vec3 green = vec3(0.0, 1.0, 0.0);
out_FragColor = vec4((noiseValue + rgb) * green, 1.0);
}
`;var NWi=T(S(),1),CF=`uniform sampler2D colorTexture;
in vec2 v_textureCoordinates;
#ifdef AUTO_EXPOSURE
uniform sampler2D autoExposure;
#endif
// See equation 3:
// http://www.cs.utah.edu/~reinhard/cdrom/tonemap.pdf
void main()
{
vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);
vec3 color = fragmentColor.rgb;
#ifdef AUTO_EXPOSURE
float exposure = texture(autoExposure, vec2(0.5)).r;
color /= exposure;
#endif
color = color / (1.0 + color);
color = czm_inverseGamma(color);
out_FragColor = vec4(color, fragmentColor.a);
}
`;var kWi=T(S(),1),VF=`uniform sampler2D colorTexture;
uniform sampler2D silhouetteTexture;
in vec2 v_textureCoordinates;
void main(void)
{
vec4 silhouetteColor = texture(silhouetteTexture, v_textureCoordinates);
vec4 color = texture(colorTexture, v_textureCoordinates);
out_FragColor = mix(color, silhouetteColor, silhouetteColor.a);
}
`;var QWi=T(S(),1);function ZT(){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=new pi,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new B,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(ZT.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},outputTexture:{get:function(){let e=this._framebuffers;if(l(e))return e[e.length-1].getColorTexture(0)}}});function cge(e){let t=e._framebuffers;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].destroy();e._framebuffers=void 0,e._previousLuminance.destroy(),e._previousLuminance=void 0}function Edt(e,t){cge(e);let n=e._width,i=e._height,o=t.halfFloatingPointTexture?je.HALF_FLOAT:je.FLOAT,r=Math.ceil(Math.log(Math.max(n,i))/Math.log(3)),s=new Array(r);for(let c=0;c<r;++c)n=Math.max(Math.ceil(n/3),1),i=Math.max(Math.ceil(i/3),1),s[c]=new pi,s[c].update(t,n,i,1,o);let a=s[r-1].getColorTexture(0);e._previousLuminance.update(t,a.width,a.height,1,o),e._framebuffers=s}function lge(e){let t=e._commands;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].shaderProgram.destroy();e._commands=void 0}function Idt(e,t){let n;if(t===0)n={colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions}};else{let i=e._framebuffers[t-1].getColorTexture(0);n={colorTexture:function(){return i},colorTextureDimensions:function(){return i.dimensions}}}return n.minMaxLuminance=function(){return e._minMaxLuminance},n.previousLuminance=function(){return e._previousLuminance.getColorTexture(0)},n}function Xdt(e,t){let n=`uniform sampler2D colorTexture;
in vec2 v_textureCoordinates;
float sampleTexture(vec2 offset) {
`;return e===0?n+=` vec4 color = texture(colorTexture, v_textureCoordinates + offset);
return czm_luminance(color.rgb);
`:n+=` return texture(colorTexture, v_textureCoordinates + offset).r;
`,n+=`}
`,n+=`uniform vec2 colorTextureDimensions;
uniform vec2 minMaxLuminance;
uniform sampler2D previousLuminance;
void main() {
float color = 0.0;
float xStep = 1.0 / colorTextureDimensions.x;
float yStep = 1.0 / colorTextureDimensions.y;
int count = 0;
for (int i = 0; i < 3; ++i) {
for (int j = 0; j < 3; ++j) {
vec2 offset;
offset.x = -xStep + float(i) * xStep;
offset.y = -yStep + float(j) * yStep;
if (offset.x < 0.0 || offset.x > 1.0 || offset.y < 0.0 || offset.y > 1.0) {
continue;
}
color += sampleTexture(offset);
++count;
}
}
if (count > 0) {
color /= float(count);
}
`,e===t-1&&(n+=` float previous = texture(previousLuminance, vec2(0.5)).r;
color = clamp(color, minMaxLuminance.x, minMaxLuminance.y);
color = previous + (color - previous) / (60.0 * 1.5);
color = clamp(color, minMaxLuminance.x, minMaxLuminance.y);
`),n+=` out_FragColor = vec4(color);
}
`,n}function Wdt(e,t){lge(e);let n=e._framebuffers,i=n.length,o=new Array(i);for(let r=0;r<i;++r)o[r]=t.createViewportQuadCommand(Xdt(r,i),{framebuffer:n[r].framebuffer,uniformMap:Idt(e,r)});e._commands=o}ZT.prototype.clear=function(e){let t=this._framebuffers;if(!l(t))return;let n=this._clearCommand;l(n)||(n=this._clearCommand=new ai({color:new O(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let o=0;o<i;++o)t[o].clear(e,n)};ZT.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,Edt(this,e),Wdt(this,e),this._ready||(this._ready=!0)),this._minMaxLuminance.x=this.minimumLuminance,this._minMaxLuminance.y=this.maximumLuminance;let i=this._framebuffers,o=i[i.length-1];i[i.length-1]=this._previousLuminance,this._commands[this._commands.length-1].framebuffer=this._previousLuminance.framebuffer,this._previousLuminance=o};ZT.prototype.execute=function(e,t){this._colorTexture=t;let n=this._commands;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o)n[o].execute(e)};ZT.prototype.isDestroyed=function(){return!1};ZT.prototype.destroy=function(){return cge(this),lge(this),ue(this)};var LF=ZT;var x2i=T(S(),1);var qWi=T(S(),1),Pdt={NEAREST:0,LINEAR:1},Nd=Pdt;function GT(e){e=g(e,g.EMPTY_OBJECT);let t=e.fragmentShader,n=g(e.textureScale,1),i=g(e.pixelFormat,at.RGBA);this._fragmentShader=t,this._uniforms=e.uniforms,this._textureScale=n,this._forcePowerOfTwo=g(e.forcePowerOfTwo,!1),this._sampleMode=g(e.sampleMode,Nd.NEAREST),this._pixelFormat=i,this._pixelDatatype=g(e.pixelDatatype,je.UNSIGNED_BYTE),this._clearColor=g(e.clearColor,O.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;let o=new pc;o.scissorTest={enabled:!0,rectangle:l(e.scissorRectangle)?De.clone(e.scissorRectangle):new De},this._passState=o,this._ready=!1;let r=e.name;l(r)||(r=Hn()),this._name=r,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}Object.defineProperties(GT.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(l(this._textureCache)){let e=this._textureCache.getFramebuffer(this._name);if(l(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 vdt=/uniform\s+sampler2D\s+depthTexture/g;GT.prototype._isSupported=function(e){return!vdt.test(this._fragmentShader)||e.depthTexture};function wdt(e,t,n){let i=t[n];return(typeof i=="string"||i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof HTMLVideoElement||i instanceof ImageData)&&e._dirtyUniforms.push(n),{get:function(){return t[n]},set:function(o){let r=t[n];t[n]=o;let s=e._actualUniforms,a=s[n];l(a)&&a!==r&&a instanceof wt&&!l(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(a),delete s[n],delete s[`${n}Dimensions`]),r instanceof wt&&e._texturesToRelease.push(r),typeof o=="string"||o instanceof HTMLCanvasElement||o instanceof HTMLImageElement||o instanceof HTMLVideoElement||o instanceof ImageData?e._dirtyUniforms.push(n):s[n]=o}}}function Fdt(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function Adt(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function Mdt(e){if(l(e._uniformMap))return;let t={},n={},i=e._uniforms,o=e._actualUniforms;for(let r in i)if(i.hasOwnProperty(r)){typeof i[r]!="function"?(t[r]=Fdt(e,r),n[r]=wdt(e,i,r)):(t[r]=i[r],n[r]=i[r]),o[r]=i[r];let s=t[r]();(typeof s=="string"||s instanceof wt||s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement)&&(t[`${r}Dimensions`]=Adt(t,r))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=Tt(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 Ndt(e,t){if(l(e._command)&&!e._logDepthChanged&&!e._selectedDirty)return;let n=e._fragmentShader;if(l(e._selectedIdTexture)){let o=e._selectedIdTexture.width;n=n.replace(/in\s+vec2\s+v_textureCoordinates;/g,""),n=`#define CZM_SELECTED_FEATURE
uniform sampler2D czm_idTexture;
uniform sampler2D czm_selectedIdTexture;
uniform float czm_selectedIdTextureStep;
in vec2 v_textureCoordinates;
bool czm_selected(vec2 offset)
{
bool selected = false;
vec4 id = texture(czm_idTexture, v_textureCoordinates + offset);
for (int i = 0; i < ${o}; ++i)
{
vec4 selectedId = texture(czm_selectedIdTexture, vec2((float(i) + 0.5) * czm_selectedIdTextureStep, 0.5));
if (all(equal(id, selectedId)))
{
return true;
}
}
return false;
}
bool czm_selected()
{
return czm_selected(vec2(0.0));
}
${n}`}let i=new Oe({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function Udt(e){let t=e._sampleMode,n,i;t===Nd.LINEAR?(n=dn.LINEAR,i=Ti.LINEAR):(n=dn.NEAREST,i=Ti.NEAREST);let o=e._sampler;(!l(o)||o.minificationFilter!==n||o.magnificationFilter!==i)&&(e._sampler=new hn({wrapS:In.CLAMP_TO_EDGE,wrapT:In.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function kdt(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function Ddt(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function Bdt(e,t){let n,i,o,r=e._texturesToRelease,s=r.length;for(n=0;n<s;++n)i=r[n],i=i&&i.destroy();r.length=0;let a=e._texturesToCreate;for(s=a.length,n=0;n<s;++n){let m=a[n];o=m.name;let p=m.source;e._actualUniforms[o]=new wt({context:t,source:p})}a.length=0;let c=e._dirtyUniforms;if(c.length===0&&!l(e._texturePromise)){e._ready=!0;return}if(c.length===0||l(e._texturePromise))return;s=c.length;let d=e._uniforms,u=[];for(n=0;n<s;++n){o=c[n];let m=d[o],p=e._textureCache.getStageByName(m);if(l(p))e._actualUniforms[o]=Ddt(e,m);else if(typeof m=="string"){let y=new Xe({url:m});u.push(y.fetchImage().then(kdt(e,o)))}else e._texturesToCreate.push({name:o,source:m})}c.length=0,u.length>0?(e._ready=!1,e._texturePromise=Promise.all(u).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}function dge(e){l(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0),e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy();let t=e._textureCache;if(!l(t))return;let n=e._uniforms,i=e._actualUniforms;for(let o in i)i.hasOwnProperty(o)&&i[o]instanceof wt&&(l(t.getStageByName(n[o]))||i[o].destroy(),e._dirtyUniforms.push(o))}function Odt(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let o=0;o<t;++o)if(e._combinedSelected[o]!==e._combinedSelectedShadow[o])return!0}return i}function Ydt(e,t){if(!e._selectedDirty)return;e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;let n=e._combinedSelected;if(!l(n))return;let i,o,r=0,s=n.length;for(i=0;i<s;++i)o=n[i],l(o.pickIds)?r+=o.pickIds.length:l(o.pickId)&&++r;if(s===0||r===0){let u=new Uint8Array(4);u[0]=255,u[1]=255,u[2]=255,u[3]=255,e._selectedIdTexture=new wt({context:t,pixelFormat:at.RGBA,pixelDatatype:je.UNSIGNED_BYTE,source:{arrayBufferView:u,width:1,height:1},sampler:hn.NEAREST});return}let a,c=0,d=new Uint8Array(r*4);for(i=0;i<s;++i)if(o=n[i],l(o.pickIds)){let u=o.pickIds,m=u.length;for(let p=0;p<m;++p)a=u[p].color,d[c]=O.floatToByte(a.red),d[c+1]=O.floatToByte(a.green),d[c+2]=O.floatToByte(a.blue),d[c+3]=O.floatToByte(a.alpha),c+=4}else l(o.pickId)&&(a=o.pickId.color,d[c]=O.floatToByte(a.red),d[c+1]=O.floatToByte(a.green),d[c+2]=O.floatToByte(a.blue),d[c+3]=O.floatToByte(a.alpha),c+=4);e._selectedIdTexture=new wt({context:t,pixelFormat:at.RGBA,pixelDatatype:je.UNSIGNED_BYTE,source:{arrayBufferView:d,width:r,height:1},sampler:hn.NEAREST})}GT.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&dge(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=Odt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0,Ydt(this,e),Mdt(this),Bdt(this,e),Ndt(this,e),Udt(this),this._selectedDirty=!1,!this._ready))return;let n=this._textureCache.getFramebuffer(this._name);if(this._command.framebuffer=n,!l(n))return;let i=n.getColorTexture(0),o;(i.width!==e.drawingBufferWidth||i.height!==e.drawingBufferHeight)&&(o=this._renderState,(!l(o)||i.width!==o.viewport.width||i.height!==o.viewport.height)&&(this._renderState=ke.fromCache({viewport:new De(0,0,i.width,i.height)}))),this._command.renderState=o};GT.prototype.execute=function(e,t,n,i){if(!l(this._command)||!l(this._command.framebuffer)||!this._ready||!this._enabled)return;this._colorTexture=t,this._depthTexture=n,this._idTexture=i,hn.equals(this._colorTexture.sampler,this._sampler)||(this._colorTexture.sampler=this._sampler);let o=this.scissorRectangle.width>0&&this.scissorRectangle.height>0?this._passState:void 0;l(o)&&(o.context=e),this._command.execute(e,o)};GT.prototype.isDestroyed=function(){return!1};GT.prototype.destroy=function(){return dge(this),ue(this)};var xo=GT;var L2i=T(S(),1);function ET(e){e=g(e,g.EMPTY_OBJECT),this._stages=e.stages,this._inputPreviousStageTexture=g(e.inputPreviousStageTexture,!0);let t=e.name;l(t)||(t=Hn()),this._name=t,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}Object.defineProperties(ET.prototype,{ready:{get:function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)if(!e[n].ready)return!1;return!0}},name:{get:function(){return this._name}},enabled:{get:function(){return this._stages[0].enabled},set:function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)t[i].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}}});ET.prototype._isSupported=function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)if(!t[i]._isSupported(e))return!1;return!0};ET.prototype.get=function(e){return this._stages[e]};function Hdt(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let o=0;o<t;++o)if(e._combinedSelected[o]!==e._combinedSelectedShadow[o])return!0}return i}ET.prototype.update=function(e,t){this._selectedDirty=Hdt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0;let n=this._stages,i=n.length;for(let o=0;o<i;++o){let r=n[o];this._selectedDirty&&(r.parentSelected=this._combinedSelected),r.update(e,t)}};ET.prototype.isDestroyed=function(){return!1};ET.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var il=ET;var Nr={};function LD(e){let o=`#define USE_STEP_SIZE
${mg}`,r=new xo({name:`${e}_x_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:Nd.LINEAR}),s=new xo({name:`${e}_y_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:Nd.LINEAR}),a={};return Object.defineProperties(a,{delta:{get:function(){return r.uniforms.delta},set:function(c){let d=r.uniforms,u=s.uniforms;d.delta=u.delta=c}},sigma:{get:function(){return r.uniforms.sigma},set:function(c){let d=r.uniforms,u=s.uniforms;d.sigma=u.sigma=c}},stepSize:{get:function(){return r.uniforms.stepSize},set:function(c){let d=r.uniforms,u=s.uniforms;d.stepSize=u.stepSize=c}}}),new il({name:e,stages:[r,s],uniforms:a})}Nr.createBlurStage=function(){return LD("czm_blur")};Nr.createDepthOfFieldStage=function(){let e=LD("czm_depth_of_field_blur"),t=new xo({name:"czm_depth_of_field_composite",fragmentShader:pF,uniforms:{focalDistance:5,blurTexture:e.name}}),n={};return Object.defineProperties(n,{focalDistance:{get:function(){return t.uniforms.focalDistance},set:function(i){t.uniforms.focalDistance=i}},delta:{get:function(){return e.uniforms.delta},set:function(i){e.uniforms.delta=i}},sigma:{get:function(){return e.uniforms.sigma},set:function(i){e.uniforms.sigma=i}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(i){e.uniforms.stepSize=i}}}),new il({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Nr.isDepthOfFieldSupported=function(e){return e.context.depthTexture};Nr.createEdgeDetectionStage=function(){let e=Hn();return new xo({name:`czm_edge_detection_${e}`,fragmentShader:yF,uniforms:{length:.25,color:O.clone(O.BLACK)}})};Nr.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function Kdt(e){if(!l(e))return Nr.createEdgeDetectionStage();let t=new il({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),n={},i="",o="";for(let a=0;a<e.length;++a)i+=`uniform sampler2D edgeTexture${a};
`,o+=` vec4 edge${a} = texture(edgeTexture${a}, v_textureCoordinates);
if (edge${a}.a > 0.0)
{
color = edge${a};
break;
}
`,n[`edgeTexture${a}`]=e[a].name;let r=`${i}in vec2 v_textureCoordinates;
void main() {
vec4 color = vec4(0.0);
for (int i = 0; i < ${e.length}; i++)
{
${o} }
out_FragColor = color;
}
`,s=new xo({name:"czm_edge_detection_combine",fragmentShader:r,uniforms:n});return new il({name:"czm_edge_detection_composite",stages:[t,s]})}Nr.createSilhouetteStage=function(e){let t=Kdt(e),n=new xo({name:"czm_silhouette_color_edges",fragmentShader:VF,uniforms:{silhouetteTexture:t.name}});return new il({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};Nr.isSilhouetteSupported=function(e){return e.context.depthTexture};Nr.createBloomStage=function(){let e=new xo({name:"czm_bloom_contrast_bias",fragmentShader:fF,uniforms:{contrast:128,brightness:-.3}}),t=LD("czm_bloom_blur"),n=new il({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new xo({name:"czm_bloom_generate_composite",fragmentShader:mF,uniforms:{glowOnly:!1,bloomTexture:n.name}}),o={};return Object.defineProperties(o,{glowOnly:{get:function(){return i.uniforms.glowOnly},set:function(r){i.uniforms.glowOnly=r}},contrast:{get:function(){return e.uniforms.contrast},set:function(r){e.uniforms.contrast=r}},brightness:{get:function(){return e.uniforms.brightness},set:function(r){e.uniforms.brightness=r}},delta:{get:function(){return t.uniforms.delta},set:function(r){t.uniforms.delta=r}},sigma:{get:function(){return t.uniforms.sigma},set:function(r){t.uniforms.sigma=r}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(r){t.uniforms.stepSize=r}}}),new il({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};Nr.createAmbientOcclusionStage=function(){let e=new xo({name:"czm_ambient_occlusion_generate",fragmentShader:lF,uniforms:{intensity:3,bias:.1,lengthCap:.26,stepSize:1.95,frustumLength:1e3,randomTexture:void 0}}),t=LD("czm_ambient_occlusion_blur");t.uniforms.stepSize=.86;let n=new il({name:"czm_ambient_occlusion_generate_blur",stages:[e,t]}),i=new xo({name:"czm_ambient_occlusion_composite",fragmentShader:dF,uniforms:{ambientOcclusionOnly:!1,ambientOcclusionTexture:n.name}}),o={};return Object.defineProperties(o,{intensity:{get:function(){return e.uniforms.intensity},set:function(r){e.uniforms.intensity=r}},bias:{get:function(){return e.uniforms.bias},set:function(r){e.uniforms.bias=r}},lengthCap:{get:function(){return e.uniforms.lengthCap},set:function(r){e.uniforms.lengthCap=r}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(r){e.uniforms.stepSize=r}},frustumLength:{get:function(){return e.uniforms.frustumLength},set:function(r){e.uniforms.frustumLength=r}},randomTexture:{get:function(){return e.uniforms.randomTexture},set:function(r){e.uniforms.randomTexture=r}},delta:{get:function(){return t.uniforms.delta},set:function(r){t.uniforms.delta=r}},sigma:{get:function(){return t.uniforms.sigma},set:function(r){t.uniforms.sigma=r}},blurStepSize:{get:function(){return t.uniforms.stepSize},set:function(r){t.uniforms.stepSize=r}},ambientOcclusionOnly:{get:function(){return i.uniforms.ambientOcclusionOnly},set:function(r){i.uniforms.ambientOcclusionOnly=r}}}),new il({name:"czm_ambient_occlusion",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};Nr.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var zdt=`#define FXAA_QUALITY_PRESET 39
${Fv}
${xF}`;Nr.createFXAAStage=function(){return new xo({name:"czm_FXAA",fragmentShader:zdt,sampleMode:Nd.LINEAR})};Nr.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=cF,new xo({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0}})};Nr.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=gF,new xo({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0}})};Nr.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=CF,new xo({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0}})};Nr.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=TF,new xo({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:O.WHITE,autoExposure:void 0}})};Nr.createAutoExposureStage=function(){return new LF};Nr.createBlackAndWhiteStage=function(){return new xo({name:"czm_black_and_white",fragmentShader:uF,uniforms:{gradations:5}})};Nr.createBrightnessStage=function(){return new xo({name:"czm_brightness",fragmentShader:hF,uniforms:{brightness:.5}})};Nr.createNightVisionStage=function(){return new xo({name:"czm_night_vision",fragmentShader:SF})};Nr.createDepthViewStage=function(){return new xo({name:"czm_depth_view",fragmentShader:bF})};Nr.createLensFlareStage=function(){return new xo({name:"czm_lens_flare",fragmentShader:_F,uniforms:{dirtTexture:on("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:on("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:oe.WGS84.maximumRadius}})};var nm=Nr;var lPi=T(S(),1);function ib(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function ZF(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function P4(e,t,n,i,o){if(!i.enabled||!i._isSupported(t))return o;let r=n[i.name]={};if(l(o)){let a=e.getStageByName(o);r[ZF(a)]=!0}let s=i.uniforms;if(l(s)){let a=Object.getOwnPropertyNames(s),c=a.length;for(let d=0;d<c;++d){let u=s[a[d]];if(typeof u=="string"){let m=e.getStageByName(u);l(m)&&(r[ZF(m)]=!0)}}}return i.name}function RF(e,t,n,i,o){if(l(i.enabled)&&!i.enabled||l(i._isSupported)&&!i._isSupported(t))return o;let r=o,s=!l(i.inputPreviousStageTexture)||i.inputPreviousStageTexture,a=o,c=i.length;for(let m=0;m<c;++m){let p=i.get(m);l(p.length)?a=RF(e,t,n,p,o):a=P4(e,t,n,p,o),s&&(o=a)}let d,u;if(s)for(d=1;d<c;++d)u=ZF(i.get(d)),l(n[u])||(n[u]={}),n[u][r]=!0;else for(d=1;d<c;++d){u=ZF(i.get(d));let m=n[u];for(let p=0;p<d;++p)m[ZF(i.get(p))]=!0}return a}function Jdt(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,o=e.bloom,r=e._tonemapping,s=e.fxaa,a=RF(e,t,n,i,void 0);a=RF(e,t,n,o,a),a=P4(e,t,n,r,a),a=RF(e,t,n,e,a),P4(e,t,n,s,a)}else RF(e,t,n,e,void 0);return n}function Qdt(e,t,n){let o=e._collection.getStageByName(t),r=o._textureScale,s=o._forcePowerOfTwo,a=o._pixelFormat,c=o._pixelDatatype,d=o._clearColor,u,m,p=e._framebuffers,y=p.length;for(u=0;u<y;++u){if(m=p[u],r!==m.textureScale||s!==m.forcePowerOfTwo||a!==m.pixelFormat||c!==m.pixelDatatype||!O.equals(d,m.clearColor))continue;let f=m.stages,x=f.length,_=!1;for(let C=0;C<x;++C)if(n[f[C]]){_=!0;break}if(!_)break}return l(m)&&u<y?(m.stages.push(t),m):(m={textureScale:r,forcePowerOfTwo:s,pixelFormat:a,pixelDatatype:c,clearColor:d,stages:[t],buffer:new pi({pixelFormat:a,pixelDatatype:c}),clear:void 0},p.push(m),m)}function jdt(e,t){let n=Jdt(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=Qdt(e,i,n[i]))}function v4(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function qdt(e,t){let n=e._width,i=e._height,o=e._framebuffers,r=o.length;for(let s=0;s<r;++s){let a=o[s],c=a.textureScale,d=Math.ceil(n*c),u=Math.ceil(i*c),m=Math.min(d,u);a.forcePowerOfTwo&&(W.isPowerOfTwo(m)||(m=W.nextPowerOfTwo(m)),d=m,u=m),a.buffer.update(t,d,u),a.clear=new ai({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}ib.prototype.updateDependencies=function(){this._updateDependencies=!0};ib.prototype.update=function(e){let t=this._collection,n=this._updateDependencies,i=l(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),o=l(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),r=l(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),s=l(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),a=!l(t._activeStages)||t._activeStages.length>0||i||o||r||s;if((n||!a&&this._framebuffers.length>0)&&(v4(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&jdt(this,e);let c=e.drawingBufferWidth,d=e.drawingBufferHeight,u=this._width!==c||this._height!==d;!n&&!u||(this._width=c,this._height=d,this._updateDependencies=!1,v4(this),qdt(this,e))};ib.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};ib.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};ib.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};ib.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};ib.prototype.isDestroyed=function(){return!1};ib.prototype.destroy=function(){return v4(this),ue(this)};var IT=ib;var uPi=T(S(),1),GF={REINHARD:0,MODIFIED_REINHARD:1,FILMIC:2,ACES:3,validate:function(e){return e===GF.REINHARD||e===GF.MODIFIED_REINHARD||e===GF.FILMIC||e===GF.ACES}},hg=Object.freeze(GF);var w4=[];function ol(){let e=nm.createFXAAStage(),t=nm.createAmbientOcclusionStage(),n=nm.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=nm.createAutoExposureStage(),this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=hg.ACES;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let o=new IT(this),r={},s=w4;for(s.push(e,t,n,i);s.length>0;){let c=s.pop();r[c.name]=c,c._textureCache=o;let d=c.length;if(l(d))for(let u=0;u<d;++u)s.push(c.get(u))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;let a=this;t.uniforms.randomTexture=function(){return a._randomTexture},this._ao=t,this._bloom=n,this._fxaa=e,this._aoEnabled=void 0,this._bloomEnabled=void 0,this._tonemappingEnabled=void 0,this._fxaaEnabled=void 0,this._activeStagesChanged=!1,this._stagesRemoved=!1,this._textureCacheDirty=!1,this._stageNames=r,this._textureCache=o}Object.defineProperties(ol.prototype,{ready:{get:function(){let e=!1,t=this._stages,n=t.length;for(let a=n-1;a>=0;--a){let c=t[a];e=e||c.ready&&c.enabled}let i=this._fxaa,o=this._ao,r=this._bloom,s=this._tonemapping;return e=e||i.ready&&i.enabled,e=e||o.ready&&o.enabled,e=e||r.ready&&r.enabled,e=e||s.ready&&s.enabled,e}},fxaa:{get:function(){return this._fxaa}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},length:{get:function(){return F4(this),this._stages.length}},outputTexture:{get:function(){let e=this._fxaa;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);let t=this._stages,n=t.length;for(let s=n-1;s>=0;--s){let a=t[s];if(l(a)&&a.ready&&a.enabled)return this.getOutputTexture(a.name)}let i=this._tonemapping;if(i.enabled&&i.ready)return this.getOutputTexture(i.name);let o=this._bloom;if(o.enabled&&o.ready)return this.getOutputTexture(o.name);let r=this._ao;if(r.enabled&&r.ready)return this.getOutputTexture(r.name)}},hasSelected:{get:function(){let e=this._stages.slice();for(;e.length>0;){let t=e.pop();if(!l(t))continue;if(l(t.selected))return!0;let n=t.length;if(l(n))for(let i=0;i<n;++i)e.push(t.get(i))}return!1}},tonemapper:{get:function(){return this._tonemapper},set:function(e){if(this._tonemapper===e)return;l(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());let t=this._autoExposureEnabled,n;switch(e){case hg.REINHARD:n=nm.createReinhardTonemappingStage(t);break;case hg.MODIFIED_REINHARD:n=nm.createModifiedReinhardTonemappingStage(t);break;case hg.FILMIC:n=nm.createFilmicTonemappingStage(t);break;default:n=nm.createAcesTonemappingStage(t);break}if(t){let i=this._autoExposure;n.uniforms.autoExposure=function(){return i.outputTexture}}this._tonemapper=e,this._tonemapping=n,l(this._stageNames)&&(this._stageNames[n.name]=n,n._textureCache=this._textureCache),this._textureCacheDirty=!0}}});function F4(e){if(!e._stagesRemoved)return;e._stagesRemoved=!1;let t=[],n=e._stages,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];s&&(s._index=r++,t.push(s))}e._stages=t}ol.prototype.add=function(e){let t=this._stageNames,n=w4;for(n.push(e);n.length>0;){let o=n.pop();t[o.name]=o,o._textureCache=this._textureCache;let r=o.length;if(l(r))for(let s=0;s<r;++s)n.push(o.get(s))}let i=this._stages;return e._index=i.length,i.push(e),this._textureCacheDirty=!0,e};ol.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=w4;for(n.push(e);n.length>0;){let i=n.pop();delete t[i.name];let o=i.length;if(l(o))for(let r=0;r<o;++r)n.push(i.get(r))}return this._stages[e._index]=void 0,this._stagesRemoved=!0,this._textureCacheDirty=!0,e._index=void 0,e._textureCache=void 0,e.destroy(),!0};ol.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};ol.prototype.get=function(e){return F4(this),this._stages[e]};ol.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};ol.prototype.getStageByName=function(e){return this._stageNames[e]};ol.prototype.update=function(e,t,n){F4(this);let i=this._activeStages,o=this._activeStages=this._previousActiveStages;this._previousActiveStages=i;let r=this._stages,s=o.length=r.length,a,c,d=0;for(a=0;a<s;++a)c=r[a],c.ready&&c.enabled&&c._isSupported(e)&&(o[d++]=c);o.length=d;let u=d!==i.length;if(!u){for(a=0;a<d;++a)if(o[a]!==i[a]){u=!0;break}}let m=this._ao,p=this._bloom,y=this._autoExposure,f=this._tonemapping,x=this._fxaa;f.enabled=n;let _=m.enabled&&m._isSupported(e),C=p.enabled&&p._isSupported(e),V=f.enabled&&f._isSupported(e),L=x.enabled&&x._isSupported(e);if((u||this._textureCacheDirty||_!==this._aoEnabled||C!==this._bloomEnabled||V!==this._tonemappingEnabled||L!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=_,this._bloomEnabled=C,this._tonemappingEnabled=V,this._fxaaEnabled=L,this._textureCacheDirty=!1),l(this._randomTexture)&&!_&&(this._randomTexture.destroy(),this._randomTexture=void 0),!l(this._randomTexture)&&_){s=256*256*3;let Z=new Uint8Array(s);for(a=0;a<s;a+=3)Z[a]=Math.floor(Math.random()*255);this._randomTexture=new wt({context:e,pixelFormat:at.RGB,pixelDatatype:je.UNSIGNED_BYTE,source:{arrayBufferView:Z,width:256,height:256},sampler:new hn({wrapS:In.REPEAT,wrapT:In.REPEAT,minificationFilter:dn.NEAREST,magnificationFilter:Ti.NEAREST})})}for(this._textureCache.update(e),x.update(e,t),m.update(e,t),p.update(e,t),f.update(e,t),this._autoExposureEnabled&&y.update(e,t),s=r.length,a=0;a<s;++a)r[a].update(e,t);for(d=0,a=0;a<s;++a)c=r[a],c.ready&&c.enabled&&c._isSupported(e)&&d++;u=d!==o.length,u&&this.update(e,t,n)};ol.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function XT(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}ol.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return XT(t)};function zf(e,t,n,i,o){if(l(e.execute)){e.execute(t,n,i,o);return}let r=e.length,s;if(e.inputPreviousStageTexture)for(zf(e.get(0),t,n,i,o),s=1;s<r;++s)zf(e.get(s),t,XT(e.get(s-1)),i,o);else for(s=0;s<r;++s)zf(e.get(s),t,n,i,o)}ol.prototype.execute=function(e,t,n,i){let o=this._activeStages,r=o.length,s=this._fxaa,a=this._ao,c=this._bloom,d=this._autoExposure,u=this._tonemapping,m=a.enabled&&a._isSupported(e),p=c.enabled&&c._isSupported(e),y=this._autoExposureEnabled,f=u.enabled&&u._isSupported(e),x=s.enabled&&s._isSupported(e);if(!x&&!m&&!p&&!f&&r===0)return;let _=t;m&&a.ready&&(zf(a,e,_,n,i),_=XT(a)),p&&c.ready&&(zf(c,e,_,n,i),_=XT(c)),y&&d.ready&&zf(d,e,_,n,i),f&&u.ready&&(zf(u,e,_,n,i),_=XT(u));let C=_;if(r>0){zf(o[0],e,_,n,i);for(let V=1;V<r;++V)zf(o[V],e,XT(o[V-1]),n,i);C=XT(o[r-1])}x&&s.ready&&zf(s,e,C,n,i)};ol.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Yl,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};ol.prototype.isDestroyed=function(){return!1};ol.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(),ue(this)};var EF=ol;var rvi=T(S(),1);var kPi=T(S(),1);var GPi=T(S(),1),$dt={SHIFT:0,CTRL:1,ALT:2},fa=Object.freeze($dt);var IPi=T(S(),1),eut={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},Vn=Object.freeze(eut);function fg(e,t,n){let i=e._element;if(i===document)return n.x=t.clientX,n.y=t.clientY,n;let o=i.getBoundingClientRect();return n.x=(t.clientX-o.left)*(i.offsetWidth/o.width),n.y=(t.clientY-o.top)*(i.offsetHeight/o.height),n}function D4(e,t){let n=e;return l(t)&&(n+=`+${t}`),n}function WT(e){if(e.shiftKey)return fa.SHIFT;if(e.ctrlKey)return fa.CTRL;if(e.altKey)return fa.ALT}var Es={LEFT:0,MIDDLE:1,RIGHT:2};function Ud(e,t,n,i){function o(r){i(e,r)}Bt.isInternetExplorer()?n.addEventListener(t,o,!1):n.addEventListener(t,o,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,o,!1)})}function tut(e){let t=e._element,n=l(t.disableRootEvents)?t:document;Bt.supportsPointerEvents()?(Ud(e,"pointerdown",t,aut),Ud(e,"pointerup",t,_ge),Ud(e,"pointermove",t,cut),Ud(e,"pointercancel",t,_ge)):(Ud(e,"mousedown",t,Tge),Ud(e,"mouseup",n,Sge),Ud(e,"mousemove",n,Cge),Ud(e,"touchstart",t,rut),Ud(e,"touchend",n,pge),Ud(e,"touchmove",n,sut),Ud(e,"touchcancel",n,pge)),Ud(e,"dblclick",t,iut);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",Ud(e,i,t,out)}function nut(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var uge={position:new B};function B4(e){e._lastSeenTouchEvent=xi()}function O4(e){return xi()-e._lastSeenTouchEvent>Rh.mouseEmulationIgnoreMilliseconds}function k4(e,t,n){let i=e.x-t.x,o=e.y-t.y;return Math.sqrt(i*i+o*o)<n}function Tge(e,t){if(!O4(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===Es.LEFT)i=Vn.LEFT_DOWN;else if(n===Es.MIDDLE)i=Vn.MIDDLE_DOWN;else if(n===Es.RIGHT)i=Vn.RIGHT_DOWN;else return;let o=fg(e,t,e._primaryPosition);B.clone(o,e._primaryStartPosition),B.clone(o,e._primaryPreviousPosition);let r=WT(t),s=e.getInputAction(i,r);l(s)&&(B.clone(o,uge.position),s(uge),t.preventDefault())}var mge={position:new B},hge={position:new B};function A4(e,t,n,i){let o=WT(i),r=e.getInputAction(t,o),s=e.getInputAction(n,o);if(l(r)||l(s)){let a=fg(e,i,e._primaryPosition);if(l(r)&&(B.clone(a,mge.position),r(mge)),l(s)){let c=e._primaryStartPosition;k4(c,a,e._clickPixelTolerance)&&(B.clone(a,hge.position),s(hge))}}}function Sge(e,t){if(!O4(e))return;let n=t.button;n!==Es.LEFT&&n!==Es.MIDDLE&&n!==Es.RIGHT||(e._buttonDown[Es.LEFT]&&(A4(e,Vn.LEFT_UP,Vn.LEFT_CLICK,t),e._buttonDown[Es.LEFT]=!1),e._buttonDown[Es.MIDDLE]&&(A4(e,Vn.MIDDLE_UP,Vn.MIDDLE_CLICK,t),e._buttonDown[Es.MIDDLE]=!1),e._buttonDown[Es.RIGHT]&&(A4(e,Vn.RIGHT_UP,Vn.RIGHT_CLICK,t),e._buttonDown[Es.RIGHT]=!1))}var M4={startPosition:new B,endPosition:new B};function Cge(e,t){if(!O4(e))return;let n=WT(t),i=fg(e,t,e._primaryPosition),o=e._primaryPreviousPosition,r=e.getInputAction(Vn.MOUSE_MOVE,n);l(r)&&(B.clone(o,M4.startPosition),B.clone(i,M4.endPosition),r(M4)),B.clone(i,o),(e._buttonDown[Es.LEFT]||e._buttonDown[Es.MIDDLE]||e._buttonDown[Es.RIGHT])&&t.preventDefault()}var fge={position:new B};function iut(e,t){let n=t.button,i;if(n===Es.LEFT)i=Vn.LEFT_DOUBLE_CLICK;else return;let o=WT(t),r=e.getInputAction(i,o);l(r)&&(fg(e,t,fge.position),r(fge))}function out(e,t){let n;if(l(t.deltaY)){let r=t.deltaMode;r===t.DOM_DELTA_PIXEL?n=-t.deltaY:r===t.DOM_DELTA_LINE?n=-t.deltaY*40:n=-t.deltaY*120}else t.detail>0?n=t.detail*-120:n=t.wheelDelta;if(!l(n))return;let i=WT(t),o=e.getInputAction(Vn.WHEEL,i);l(o)&&(o(n),t.preventDefault())}function rut(e,t){B4(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i)r=n[i],s=r.identifier,a.set(s,fg(e,r,new B));RD(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.set(s,B.clone(a.get(s)))}function pge(e,t){B4(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i)r=n[i],s=r.identifier,a.remove(s);RD(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.remove(s)}var bge={position:new B},N4={position1:new B,position2:new B},yge={position:new B},gge={position:new B},xge={position:new B};function RD(e,t){let n=WT(t),i=e._positions,o=i.length,r,s,a=e._isPinching;if(o!==1&&e._buttonDown[Es.LEFT]){if(e._buttonDown[Es.LEFT]=!1,l(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),r=e.getInputAction(Vn.LEFT_UP,n),l(r)&&(B.clone(e._primaryPosition,yge.position),r(yge)),o===0&&!e._isTouchHolding&&(s=e.getInputAction(Vn.LEFT_CLICK,n),l(s))){let c=e._primaryStartPosition,d=e._previousPositions.values[0];k4(c,d,e._clickPixelTolerance)&&(B.clone(e._primaryPosition,gge.position),s(gge))}e._isTouchHolding=!1}if(o===0&&a&&(e._isPinching=!1,r=e.getInputAction(Vn.PINCH_END,n),l(r)&&r()),o===1&&!a){let c=i.values[0];B.clone(c,e._primaryPosition),B.clone(c,e._primaryStartPosition),B.clone(c,e._primaryPreviousPosition),e._buttonDown[Es.LEFT]=!0,r=e.getInputAction(Vn.LEFT_DOWN,n),l(r)&&(B.clone(c,bge.position),r(bge)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,s=e.getInputAction(Vn.RIGHT_CLICK,n),l(s))){let d=e._primaryStartPosition,u=e._previousPositions.values[0];k4(d,u,e._holdPixelTolerance)&&(B.clone(e._primaryPosition,xge.position),s(xge))}},Rh.touchHoldDelayMilliseconds),t.preventDefault()}o===2&&!a&&(e._isPinching=!0,r=e.getInputAction(Vn.PINCH_START,n),l(r)&&(B.clone(i.values[0],N4.position1),B.clone(i.values[1],N4.position2),r(N4),t.preventDefault()))}function sut(e,t){B4(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i){r=n[i],s=r.identifier;let d=a.get(s);l(d)&&fg(e,r,d)}Vge(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,B.clone(a.get(s),c.get(s))}var U4={startPosition:new B,endPosition:new B},IF={distance:{startPosition:new B,endPosition:new B},angleAndHeight:{startPosition:new B,endPosition:new B}};function Vge(e,t){let n=WT(t),i=e._positions,o=e._previousPositions,r=i.length,s;if(r===1&&e._buttonDown[Es.LEFT]){let a=i.values[0];B.clone(a,e._primaryPosition);let c=e._primaryPreviousPosition;s=e.getInputAction(Vn.MOUSE_MOVE,n),l(s)&&(B.clone(c,U4.startPosition),B.clone(a,U4.endPosition),s(U4)),B.clone(a,c),t.preventDefault()}else if(r===2&&e._isPinching&&(s=e.getInputAction(Vn.PINCH_MOVE,n),l(s))){let a=i.values[0],c=i.values[1],d=o.values[0],u=o.values[1],m=c.x-a.x,p=c.y-a.y,y=Math.sqrt(m*m+p*p)*.25,f=u.x-d.x,x=u.y-d.y,_=Math.sqrt(f*f+x*x)*.25,C=(c.y+a.y)*.125,V=(u.y+d.y)*.125,L=Math.atan2(p,m),Z=Math.atan2(x,f);B.fromElements(0,_,IF.distance.startPosition),B.fromElements(0,y,IF.distance.endPosition),B.fromElements(Z,V,IF.angleAndHeight.startPosition),B.fromElements(L,C,IF.angleAndHeight.endPosition),s(IF)}}function aut(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,fg(e,t,new B)),RD(e,t),e._previousPositions.set(i,B.clone(n.get(i)))}else Tge(e,t)}function _ge(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),RD(e,t),e._previousPositions.remove(i)}else Sge(e,t)}function cut(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,o=n.get(i);if(!l(o))return;fg(e,t,o),Vge(e,t);let r=e._previousPositions;B.clone(n.get(i),r.get(i))}else Cge(e,t)}function Rh(e){this._inputEvents={},this._buttonDown={LEFT:!1,MIDDLE:!1,RIGHT:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-Rh.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new B,this._primaryPosition=new B,this._primaryPreviousPosition=new B,this._positions=new Ct,this._previousPositions=new Ct,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=g(e,document),tut(this)}Rh.prototype.setInputAction=function(e,t,n){let i=D4(t,n);this._inputEvents[i]=e};Rh.prototype.getInputAction=function(e,t){let n=D4(e,t);return this._inputEvents[n]};Rh.prototype.removeInputAction=function(e,t){let n=D4(e,t);delete this._inputEvents[n]};Rh.prototype.isDestroyed=function(){return!1};Rh.prototype.destroy=function(){return nut(this),ue(this)};Rh.mouseEmulationIgnoreMilliseconds=800;Rh.touchHoldDelayMilliseconds=1500;var kd=Rh;function PT(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}PT.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};PT.prototype.morphTo2D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof rn,!(this._previousMode===ie.SCENE2D||this._previousMode===ie.MORPHING)&&(this._scene.morphStart.raiseEvent(this,this._previousMode,ie.SCENE2D,!0),n._mode=ie.MORPHING,n.camera._setTransform(A.IDENTITY),this._previousMode===ie.COLUMBUS_VIEW?kut(this,e):zut(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var lut=new h,dut=new h,uut=new h,mut=new h,hut=new h,fut=new h,put=new h,but=new he,yut=new A,gut=new Li,xut=new rn,_ut={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};PT.prototype.morphToColumbusView=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,this._previousMode===ie.COLUMBUS_VIEW||this._previousMode===ie.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,ie.COLUMBUS_VIEW,!0),n.camera._setTransform(A.IDENTITY);let i=lut,o=dut,r=uut;if(e>0)i.x=0,i.y=-1,i.z=1,i=h.multiplyByScalar(h.normalize(i,i),5*t.maximumRadius,i),h.negate(h.normalize(i,o),o),h.cross(h.UNIT_X,o,r);else{let d=n.camera;if(this._previousMode===ie.SCENE2D)h.clone(d.position,i),i.z=d.frustum.right-d.frustum.left,h.negate(h.UNIT_Z,o),h.clone(h.UNIT_Y,r);else{h.clone(d.positionWC,i),h.clone(d.directionWC,o),h.clone(d.upWC,r);let u=t.scaleToGeodeticSurface(i,put),m=Xt.eastNorthUpToFixedFrame(u,t,yut);A.inverseTransformation(m,m),n.mapProjection.project(t.cartesianToCartographic(i,but),i),A.multiplyByPointAsVector(m,o,o),A.multiplyByPointAsVector(m,r,r)}}let s;this._morphToOrthographic?(s=xut,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=gut,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=W.toRadians(60));let a=_ut;a.position=i,a.direction=o,a.up=r,a.frustum=s;let c=Qut(a);XF(this,c),this._previousMode===ie.SCENE2D?Jut(this,e,a,c):(a.position2D=A.multiplyByPoint(fo.TRANSFORM_2D,i,mut),a.direction2D=A.multiplyByPointAsVector(fo.TRANSFORM_2D,o,hut),a.up2D=A.multiplyByPointAsVector(fo.TRANSFORM_2D,r,fut),n._mode=ie.MORPHING,wge(this,e,a,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var K4={position:new h,direction:new h,up:new h,frustum:void 0},Rge=new Li;PT.prototype.morphTo3D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,!(this._previousMode===ie.SCENE3D||this._previousMode===ie.MORPHING)){if(this._scene.morphStart.raiseEvent(this,this._previousMode,ie.SCENE3D,!0),n._mode=ie.MORPHING,n.camera._setTransform(A.IDENTITY),this._previousMode===ie.SCENE2D)Xut(this,e,t);else{let i;e>0?(i=K4,h.fromDegrees(0,0,5*t.maximumRadius,t,i.position),h.negate(i.position,i.direction),h.normalize(i.direction,i.direction),h.clone(h.UNIT_Z,i.up)):i=Zge(this,t);let o,r=n.camera;r.frustum instanceof rn?o=r.frustum.clone():(o=Rge,o.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,o.fov=W.toRadians(60)),i.frustum=o;let s=Age(i);XF(this,s),H4(this,e,i,s)}e===0&&l(this._completeMorph)&&this._completeMorph()}};PT.prototype.isDestroyed=function(){return!1};PT.prototype.destroy=function(){return ZD(this),ue(this)};function XF(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new kd(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,Vn.LEFT_DOWN),e._morphHandler.setInputAction(n,Vn.MIDDLE_DOWN),e._morphHandler.setInputAction(n,Vn.RIGHT_DOWN),e._morphHandler.setInputAction(n,Vn.WHEEL)}}function ZD(e){let t=e._currentTweens;for(let n=0;n<t.length;++n)t[n].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}var Tut=new he,Sut=new h,Cut=new A;function Zge(e,t){let n=e._scene,i=n.camera,o=K4,r=o.position,s=o.direction,a=o.up,c=n.mapProjection.unproject(i.position,Tut);t.cartographicToCartesian(c,r);let d=t.scaleToGeodeticSurface(r,Sut),u=Xt.eastNorthUpToFixedFrame(d,t,Cut);return A.multiplyByPointAsVector(u,i.direction,s),A.multiplyByPointAsVector(u,i.up,a),o}var Vut=new h,Lut=new h,Rut=new h,Zut=new h,Gut=new h,Eut=new h;function H4(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=h.clone(r.position,Vut),a=h.clone(r.direction,Lut),c=h.clone(r.up,Rut),d=A.multiplyByPoint(fo.TRANSFORM_2D_INVERSE,n.position,Zut),u=A.multiplyByPointAsVector(fo.TRANSFORM_2D_INVERSE,n.direction,Gut),m=A.multiplyByPointAsVector(fo.TRANSFORM_2D_INVERSE,n.up,Eut);function p(f){im(s,d,f.time,r.position),im(a,u,f.time,r.direction),im(c,m,f.time,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.right,r.right)}let y=o.tweens.add({duration:t,easingFunction:Ar.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){Fge(e,o,0,1,t,i)}});e._currentTweens.push(y)}var Iut=new rn,Gge=new h,Ege=new h,Ige=new h,z4=new h,Xge=new h,Wge=new h;function Xut(e,t,n){t/=3;let i=e._scene,o=i.camera,r;t>0?(r=K4,h.fromDegrees(0,0,5*n.maximumRadius,n,r.position),h.negate(r.position,r.direction),h.normalize(r.direction,r.direction),h.clone(h.UNIT_Z,r.up)):(o.position.z=o.frustum.right-o.frustum.left,r=Zge(e,n));let s;e._morphToOrthographic?(s=Iut,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=o.frustum.right-o.frustum.left):(s=Rge,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=W.toRadians(60)),r.frustum=s;let a=Age(r);XF(e,a);let c;e._morphToOrthographic?c=function(){H4(e,t,r,a)}:c=function(){vge(e,t,r,function(){H4(e,t,r,a)})},t>0?(i._mode=ie.SCENE2D,o.flyTo({duration:t,destination:h.fromDegrees(0,0,5*n.maximumRadius,n,z4),complete:function(){i._mode=ie.MORPHING,c()}})):c()}function im(e,t,n,i){return h.lerp(e,t,n,i)}function Pge(e,t,n,i,o){let r=e._scene,s=r.camera;if(s.frustum instanceof rn)return;let a=s.frustum.fov,c=W.RADIANS_PER_DEGREE*.5,d=n.position.z*Math.tan(a*.5);s.frustum.far=d/Math.tan(c*.5)+1e7;function u(p){s.frustum.fov=W.lerp(a,c,p.time);let y=d/Math.tan(s.frustum.fov*.5);i(s,y)}let m=r.tweens.add({duration:t,easingFunction:Ar.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:u,complete:function(){s.frustum=n.frustum.clone(),o(e)}});e._currentTweens.push(m)}var Wut=new h,Put=new h,vut=new h,Y4=new h,wut=new h,Fut=new h,Aut=new Vr,Mut=new gn,Nut=new h,Uut={position:void 0,direction:void 0,up:void 0,frustum:void 0};function kut(e,t){t*=.5;let n=e._scene,i=n.camera,o=h.clone(i.position,Wut),r=h.clone(i.direction,Put),s=h.clone(i.up,vut),a=h.negate(h.UNIT_Z,wut),c=h.clone(h.UNIT_Y,Fut),d=Y4;if(t>0)h.clone(h.ZERO,Y4),d.z=5*n.mapProjection.ellipsoid.maximumRadius;else{h.clone(o,Y4);let _=Mut;A.multiplyByPoint(fo.TRANSFORM_2D,o,_.origin),A.multiplyByPointAsVector(fo.TRANSFORM_2D,r,_.direction);let C=n.globe;if(l(C)){let V=C.pickWorldCoordinates(_,n,!0,Nut);l(V)&&(A.multiplyByPoint(fo.TRANSFORM_2D_INVERSE,V,d),d.z+=h.distance(o,d))}}let u=Aut;u.right=d.z*.5,u.left=-u.right,u.top=u.right*(n.drawingBufferHeight/n.drawingBufferWidth),u.bottom=-u.top;let m=Uut;m.position=d,m.direction=a,m.up=c,m.frustum=u;let p=Mge(m);XF(e,p);function y(_){im(o,d,_.time,i.position),im(r,a,_.time,i.direction),im(s,c,_.time,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function f(_,C){_.position.z=C}let x=n.tweens.add({duration:t,easingFunction:Ar.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:y,complete:function(){Pge(e,t,m,f,p)}});e._currentTweens.push(x)}var Lge=new he,Dut={position:new h,direction:new h,up:new h,position2D:new h,direction2D:new h,up2D:new h,frustum:new Vr},But={position:new h,direction:new h,up:new h,frustum:void 0},Out=new h,Yut=new gn,Hut=new A,Kut=new h;function zut(e,t,n){t*=.5;let i=e._scene,o=i.camera,r=Dut;if(t>0)h.clone(h.ZERO,r.position),r.position.z=5*n.maximumRadius,h.negate(h.UNIT_Z,r.direction),h.clone(h.UNIT_Y,r.up);else{n.cartesianToCartographic(o.positionWC,Lge),i.mapProjection.project(Lge,r.position),h.negate(h.UNIT_Z,r.direction),h.clone(h.UNIT_Y,r.up);let m=Yut;h.clone(r.position2D,m.origin);let p=h.clone(o.directionWC,m.direction),y=n.scaleToGeodeticSurface(o.positionWC,Kut),f=Xt.eastNorthUpToFixedFrame(y,n,Hut);A.inverseTransformation(f,f),A.multiplyByPointAsVector(f,p,p),A.multiplyByPointAsVector(fo.TRANSFORM_2D,p,p);let x=i.globe;if(l(x)){let _=x.pickWorldCoordinates(m,i,!0,Out);if(l(_)){let C=h.distance(r.position2D,_);_.x+=C,h.clone(_,r.position2D)}}}function s(m,p){m.position.x=p}A.multiplyByPoint(fo.TRANSFORM_2D,r.position,r.position2D),A.multiplyByPointAsVector(fo.TRANSFORM_2D,r.direction,r.direction2D),A.multiplyByPointAsVector(fo.TRANSFORM_2D,r.up,r.up2D);let a=r.frustum;a.right=r.position.z*.5,a.left=-a.right,a.top=a.right*(i.drawingBufferHeight/i.drawingBufferWidth),a.bottom=-a.top;let c=But;A.multiplyByPoint(fo.TRANSFORM_2D_INVERSE,r.position2D,c.position),h.clone(r.direction,c.direction),h.clone(r.up,c.up),c.frustum=a;let d=Mge(c);XF(e,d);function u(){Pge(e,t,r,s,d)}wge(e,t,r,u)}function vge(e,t,n,i){let o=e._scene,r=o.camera,s=r.frustum.right-r.frustum.left;r.frustum=n.frustum.clone();let a=r.frustum.fov,c=W.RADIANS_PER_DEGREE*.5,d=s*Math.tan(a*.5);r.frustum.far=d/Math.tan(c*.5)+1e7,r.frustum.fov=c;function u(p){r.frustum.fov=W.lerp(c,a,p.time),r.position.z=d/Math.tan(r.frustum.fov*.5)}let m=o.tweens.add({duration:t,easingFunction:Ar.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:u,complete:function(){i(e)}});e._currentTweens.push(m)}function Jut(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=h.clone(n.position,z4),a=h.clone(n.direction,Xge),c=h.clone(n.up,Wge);o._mode=ie.MORPHING;function d(){r.frustum=n.frustum.clone();let u=h.clone(r.position,Gge),m=h.clone(r.direction,Ege),p=h.clone(r.up,Ige);u.z=s.z;function y(x){im(u,s,x.time,r.position),im(m,a,x.time,r.direction),im(p,c,x.time,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.right,r.right)}let f=o.tweens.add({duration:t,easingFunction:Ar.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:y,complete:function(){i(e)}});e._currentTweens.push(f)}e._morphToOrthographic?d():vge(e,0,n,d)}function wge(e,t,n,i){let o=e._scene,r=o.camera,s=h.clone(r.position,Gge),a=h.clone(r.direction,Ege),c=h.clone(r.up,Ige),d=h.clone(n.position2D,z4),u=h.clone(n.direction2D,Xge),m=h.clone(n.up2D,Wge);function p(f){im(s,d,f.time,r.position),im(a,u,f.time,r.direction),im(c,m,f.time,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.right,r.right),r._adjustOrthographicFrustum(!0)}let y=o.tweens.add({duration:t,easingFunction:Ar.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){Fge(e,o,1,0,t,i)}});e._currentTweens.push(y)}function Fge(e,t,n,i,o,r){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:o,easingFunction:Ar.QUARTIC_OUT};l(r)&&(s.complete=function(){r(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function Age(e){return function(t){let n=t._scene;n._mode=ie.SCENE3D,n.morphTime=ie.getMorphTime(ie.SCENE3D),ZD(t);let i=n.camera;(t._previousMode!==ie.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,h.clone(e.position,i.position),h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i.frustum=e.frustum.clone());let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,ie.SCENE3D,r)}}function Mge(e){return function(t){let n=t._scene;n._mode=ie.SCENE2D,n.morphTime=ie.getMorphTime(ie.SCENE2D),ZD(t);let i=n.camera;h.clone(e.position,i.position),i.position.z=n.mapProjection.ellipsoid.maximumRadius*2,h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i.frustum=e.frustum.clone();let o=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,ie.SCENE2D,o)}}function Qut(e){return function(t){let n=t._scene;n._mode=ie.COLUMBUS_VIEW,n.morphTime=ie.getMorphTime(ie.COLUMBUS_VIEW),ZD(t);let i=n.camera;(t._previousModeMode!==ie.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,h.clone(e.position,i.position),h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right));let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,ie.COLUMBUS_VIEW,r)}}var WF=PT;var ewi=T(S(),1);var yvi=T(S(),1);var avi=T(S(),1),jut={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4},Pi=Object.freeze(jut);function Sc(e,t){let n=e;return l(t)&&(n+=`+${t}`),n}function qut(e,t){B.clone(e.distance.startPosition,t.distance.startPosition),B.clone(e.distance.endPosition,t.distance.endPosition),B.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),B.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function Nge(e,t,n){let i=Sc(Pi.PINCH,t),o=e._update,r=e._isDown,s=e._eventStartPosition,a=e._pressTime,c=e._releaseTime;o[i]=!0,r[i]=!1,s[i]=new B;let d=e._movement[i];l(d)||(d=e._movement[i]={}),d.distance={startPosition:new B,endPosition:new B},d.angleAndHeight={startPosition:new B,endPosition:new B},d.prevAngle=0,e._eventHandler.setInputAction(function(u){e._buttonsDown++,r[i]=!0,a[i]=new Date,B.lerp(u.position1,u.position2,.5,s[i])},Vn.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),r[i]=!1,c[i]=new Date},Vn.PINCH_END,t),e._eventHandler.setInputAction(function(u){if(r[i]){o[i]?(qut(u,d),o[i]=!1,d.prevAngle=d.angleAndHeight.startPosition.x):(B.clone(u.distance.endPosition,d.distance.endPosition),B.clone(u.angleAndHeight.endPosition,d.angleAndHeight.endPosition));let m=d.angleAndHeight.endPosition.x,p=d.prevAngle,y=Math.PI*2;for(;m>=p+Math.PI;)m-=y;for(;m<p-Math.PI;)m+=y;d.angleAndHeight.endPosition.x=-m*n.clientWidth/12,d.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},Vn.PINCH_MOVE,t)}function Uge(e,t){let n=Sc(Pi.WHEEL,t),i=e._pressTime,o=e._releaseTime,r=e._update;r[n]=!0;let s=e._movement[n];l(s)||(s=e._movement[n]={});let a=e._lastMovement[n];l(a)||(a=e._lastMovement[n]={startPosition:new B,endPosition:new B,valid:!1}),s.startPosition=new B,B.clone(B.ZERO,s.startPosition),s.endPosition=new B,e._eventHandler.setInputAction(function(c){let d=7.5*W.toRadians(c);i[n]=o[n]=new Date,s.endPosition.x=0,s.endPosition.y=d,B.clone(s.endPosition,a.endPosition),a.valid=!0,r[n]=!1},Vn.WHEEL,t)}function AV(e,t,n){let i=Sc(n,t),o=e._isDown,r=e._eventStartPosition,s=e._pressTime,a=e._releaseTime;o[i]=!1,r[i]=new B;let c=e._lastMovement[i];l(c)||(c=e._lastMovement[i]={startPosition:new B,endPosition:new B,valid:!1});let d,u;n===Pi.LEFT_DRAG?(d=Vn.LEFT_DOWN,u=Vn.LEFT_UP):n===Pi.RIGHT_DRAG?(d=Vn.RIGHT_DOWN,u=Vn.RIGHT_UP):n===Pi.MIDDLE_DRAG&&(d=Vn.MIDDLE_DOWN,u=Vn.MIDDLE_UP),e._eventHandler.setInputAction(function(m){e._buttonsDown++,c.valid=!1,o[i]=!0,s[i]=new Date,B.clone(m.position,r[i])},d,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),o[i]=!1,a[i]=new Date},u,t)}function kge(e,t){B.clone(e.startPosition,t.startPosition),B.clone(e.endPosition,t.endPosition)}function Dge(e,t){let n=e._update,i=e._movement,o=e._lastMovement,r=e._isDown;for(let s in Pi)if(Pi.hasOwnProperty(s)){let a=Pi[s];if(l(a)){let c=Sc(a,t);n[c]=!0,l(e._lastMovement[c])||(e._lastMovement[c]={startPosition:new B,endPosition:new B,valid:!1}),l(e._movement[c])||(e._movement[c]={startPosition:new B,endPosition:new B})}}e._eventHandler.setInputAction(function(s){for(let a in Pi)if(Pi.hasOwnProperty(a)){let c=Pi[a];if(l(c)){let d=Sc(c,t);r[d]&&(n[d]?(kge(i[d],o[d]),o[d].valid=!0,kge(s,i[d]),n[d]=!1):B.clone(s.endPosition,i[d].endPosition))}}B.clone(s.endPosition,e._currentMousePosition)},Vn.MOUSE_MOVE,t)}function om(e){this._eventHandler=new kd(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new B,Uge(this,void 0),Nge(this,void 0,e),AV(this,void 0,Pi.LEFT_DRAG),AV(this,void 0,Pi.RIGHT_DRAG),AV(this,void 0,Pi.MIDDLE_DRAG),Dge(this,void 0);for(let t in fa)if(fa.hasOwnProperty(t)){let n=fa[t];l(n)&&(Uge(this,n),Nge(this,n,e),AV(this,n,Pi.LEFT_DRAG),AV(this,n,Pi.RIGHT_DRAG),AV(this,n,Pi.MIDDLE_DRAG),Dge(this,n))}}Object.defineProperties(om.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[Sc(Pi.WHEEL)]||!this._update[Sc(Pi.WHEEL,fa.SHIFT)]||!this._update[Sc(Pi.WHEEL,fa.CTRL)]||!this._update[Sc(Pi.WHEEL,fa.ALT)];return this._buttonsDown>0||e}}});om.prototype.isMoving=function(e,t){let n=Sc(e,t);return!this._update[n]};om.prototype.getMovement=function(e,t){let n=Sc(e,t);return this._movement[n]};om.prototype.getLastMovement=function(e,t){let n=Sc(e,t),i=this._lastMovement[n];if(i.valid)return i};om.prototype.isButtonDown=function(e,t){let n=Sc(e,t);return this._isDown[n]};om.prototype.getStartMousePosition=function(e,t){if(e===Pi.WHEEL)return this._currentMousePosition;let n=Sc(e,t);return this._eventStartPosition[n]};om.prototype.getButtonPressTime=function(e,t){let n=Sc(e,t);return this._pressTime[n]};om.prototype.getButtonReleaseTime=function(e,t){let n=Sc(e,t);return this._releaseTime[n]};om.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};om.prototype.isDestroyed=function(){return!1};om.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),ue(this)};var PF=om;var Rvi=T(S(),1);function GD(e,t,n,i,o,r,s,a,c,d){this._tweens=e,this._tweenjs=t,this._startObject=ze(n),this._stopObject=ze(i),this._duration=o,this._delay=r,this._easingFunction=s,this._update=a,this._complete=c,this.cancel=d,this.needsStart=!0}Object.defineProperties(GD.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}}});GD.prototype.cancelTween=function(){this._tweens.remove(this)};function Zh(){this._tweens=[]}Object.defineProperties(Zh.prototype,{length:{get:function(){return this._tweens.length}}});Zh.prototype.add=function(e){if(e=g(e,g.EMPTY_OBJECT),e.duration===0)return l(e.complete)&&e.complete(),new GD(this);let t=e.duration/qn.SECONDS_PER_MILLISECOND,n=g(e.delay,0),i=n/qn.SECONDS_PER_MILLISECOND,o=g(e.easingFunction,Ar.LINEAR_NONE),r=e.startObject,s=new ope(r);s.to(ze(e.stopObject),t),s.delay(i),s.easing(o),l(e.update)&&s.onUpdate(function(){e.update(r)}),s.onComplete(g(e.complete,null)),s.repeat(g(e._repeat,0));let a=new GD(this,s,e.startObject,e.stopObject,e.duration,n,o,e.update,e.complete,e.cancel);return this._tweens.push(a),a};Zh.prototype.addProperty=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.object,n=e.property,i=e.startValue,o=e.stopValue;function r(s){t[n]=s.value}return this.add({startObject:{value:i},stopObject:{value:o},duration:g(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:r,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})};Zh.prototype.addAlpha=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.material,n=[];for(let o in t.uniforms)t.uniforms.hasOwnProperty(o)&&l(t.uniforms[o])&&l(t.uniforms[o].alpha)&&n.push(o);function i(o){let r=n.length;for(let s=0;s<r;++s)t.uniforms[n[s]].alpha=o.alpha}return this.add({startObject:{alpha:g(e.startValue,0)},stopObject:{alpha:g(e.stopValue,1)},duration:g(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel})};Zh.prototype.addOffsetIncrement=function(e){e=g(e,g.EMPTY_OBJECT);let n=e.material.uniforms;return this.addProperty({object:n,property:"offset",startValue:n.offset,stopValue:n.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})};Zh.prototype.remove=function(e){if(!l(e))return!1;let t=this._tweens.indexOf(e);return t!==-1?(e.tweenjs.stop(),l(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0):!1};Zh.prototype.removeAll=function(){let e=this._tweens;for(let t=0;t<e.length;++t){let n=e[t];n.tweenjs.stop(),l(n.cancel)&&n.cancel()}e.length=0};Zh.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};Zh.prototype.get=function(e){return this._tweens[e]};Zh.prototype.update=function(e){let t=this._tweens,n=0;for(e=l(e)?e/qn.SECONDS_PER_MILLISECOND:xi();n<t.length;){let i=t[n],o=i.tweenjs;i.needsStart?(i.needsStart=!1,o.start(e)):o.update(e)?n++:(o.stop(),t.splice(n,1))}};var vT=Zh;function wF(e){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=Pi.LEFT_DRAG,this.zoomEventTypes=[Pi.RIGHT_DRAG,Pi.WHEEL,Pi.PINCH],this.rotateEventTypes=Pi.LEFT_DRAG,this.tiltEventTypes=[Pi.MIDDLE_DRAG,Pi.PINCH,{eventType:Pi.LEFT_DRAG,modifier:fa.CTRL},{eventType:Pi.RIGHT_DRAG,modifier:fa.CTRL}],this.lookEventTypes={eventType:Pi.LEFT_DRAG,modifier:fa.SHIFT},this.minimumPickingTerrainHeight=15e4,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=4e3,this.minimumCollisionTerrainHeight=15e3,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=75e5,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this._scene=e,this._globe=void 0,this._ellipsoid=void 0,this._aggregator=new PF(e.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._inertiaDisablers={_lastInertiaZoomMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement","_lastInertiaTiltMovement"],_lastInertiaTiltMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement"]},this._tweens=new vT,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new B(-1,-1),this._tiltCenter=new h,this._rotateMousePosition=new B(-1,-1),this._rotateStartPosition=new h,this._strafeStartPosition=new h,this._strafeMousePosition=new B,this._strafeEndMousePosition=new B,this._zoomMouseStart=new B(-1,-1),this._zoomWorldPosition=new h,this._useZoomWorldPosition=!1,this._panLastMousePosition=new B,this._panLastWorldPosition=new h,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._zoomingUnderground=!1,this._rotatingZoom=!1,this._adjustedHeightForTerrain=!1,this._cameraUnderground=!1;let t=e.mapProjection;this._maxCoord=t.project(new he(Math.PI,W.PI_OVER_TWO)),this._zoomFactor=5,this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=1/5e3,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3,this._minimumUndergroundPickDistance=2e3,this._maximumUndergroundPickDistance=1e4}function $ut(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function emt(e){return B.equalsEpsilon(e.startPosition,e.endPosition,W.EPSILON14)}var tmt=.4;function nmt(e,t,n,i,o,r,s){let a=r[s];l(a)||(a=r[s]={startPosition:new B,endPosition:new B,motion:new B,inertiaEnabled:!0});let c=e.getButtonPressTime(t,n),d=e.getButtonReleaseTime(t,n),u=c&&d&&(d.getTime()-c.getTime())/1e3,p=d&&(new Date().getTime()-d.getTime())/1e3;if(c&&d&&u<tmt){let y=$ut(p,i),f=e.getLastMovement(t,n);if(!l(f)||emt(f)||!a.inertiaEnabled||(a.motion.x=(f.endPosition.x-f.startPosition.x)*.5,a.motion.y=(f.endPosition.y-f.startPosition.y)*.5,a.startPosition=B.clone(f.startPosition,a.startPosition),a.endPosition=B.multiplyByScalar(a.motion,y,a.endPosition),a.endPosition=B.add(a.startPosition,a.endPosition,a.endPosition),isNaN(a.endPosition.x)||isNaN(a.endPosition.y)||B.distance(a.startPosition,a.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let x=e.getStartMousePosition(t,n);o(r,x,a)}}}function imt(e,t){if(l(t)){let n=e[t];l(n)&&(n.inertiaEnabled=!0);let i=e._inertiaDisablers[t];if(l(i)){let o=i.length;for(let r=0;r<o;++r)n=e[i[r]],l(n)&&(n.inertiaEnabled=!1)}}}var Bge=[];function rl(e,t,n,i,o,r){if(!l(n))return;let s=e._aggregator;Array.isArray(n)||(Bge[0]=n,n=Bge);let a=n.length;for(let c=0;c<a;++c){let d=n[c],u=l(d.eventType)?d.eventType:d,m=d.modifier,p=s.isMoving(u,m)&&s.getMovement(u,m),y=s.getStartMousePosition(u,m);e.enableInputs&&t&&(p?(i(e,y,p),imt(e,r)):o<1&&nmt(s,u,m,o,i,e,r))}}var ED=new gn,omt=new h,rmt=new B,smt=new h,amt=new B,cmt=new h,lmt=new h,dmt=new h,umt=new h,txe=new h,mmt=new h,hmt=new h,fmt=new h,pmt=new h,bmt=new h,ymt=new h,gmt=new h,xmt=new h,_mt=new h,Tmt=new h,wT=new h,Oge=new h,Yge=new h,J4={orientation:new za};function ij(e,t,n,i,o,r){let s=1;l(r)&&(s=W.clamp(Math.abs(r),.25,1));let a=n.endPosition.y-n.startPosition.y,d=a>0?e.minimumZoomDistance*s:0,u=e.maximumZoomDistance,m=o-d,p=i*m;p=W.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let y=a/e._scene.canvas.clientHeight;y=Math.min(y,e.maximumMovementRatio);let f=p*y;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!l(e._globe)){if(f>0&&Math.abs(o-d)<1||f<0&&Math.abs(o-u)<1)return;o-f<d?f=o-d-1:o-f>u&&(f=o-u)}let x=e._scene,_=x.camera,C=x.mode,V=J4.orientation;if(V.heading=_.heading,V.pitch=_.pitch,V.roll=_.roll,_.frustum instanceof rn){Math.abs(f)>0&&(_.zoomIn(f),_._adjustOrthographicFrustum(!0));return}let L=g(n.inertiaEnabled,B.equals(t,e._zoomMouseStart)),Z=e._zoomingOnVector,G=e._rotatingZoom,I;if(L||(e._zoomMouseStart=B.clone(t,e._zoomMouseStart),l(e._globe)&&C===ie.SCENE2D?(I=_.getPickRay(t,ED).origin,I=h.fromElements(I.y,I.z,I.x)):l(e._globe)&&(I=ob(e,t,omt)),l(I)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=h.clone(I,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,Z=e._zoomingOnVector=!1,G=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){_.zoomIn(f);return}let P=C===ie.COLUMBUS_VIEW;if(_.positionCartographic.height<2e6&&(G=!0),!L||G){if(C===ie.SCENE2D){let v=e._zoomWorldPosition,F=_.position;if(!h.equals(v,F)&&_.positionCartographic.height<e._maxCoord.x*2){let M=_.position.x,b=h.subtract(v,F,smt);h.normalize(b,b);let R=h.distance(v,F)*f/(_.getMagnitude()*.5);_.move(b,R*.5),(_.position.x<0&&M>0||_.position.x>0&&M<0)&&(I=_.getPickRay(t,ED).origin,I=h.fromElements(I.y,I.z,I.x),e._zoomWorldPosition=h.clone(I,e._zoomWorldPosition))}}else if(C===ie.SCENE3D){let v=h.normalize(_.position,txe);if(e._cameraUnderground||e._zoomingUnderground||_.positionCartographic.height<3e3&&Math.abs(h.dot(_.direction,v))<.6)P=!0;else{let F=x.canvas,M=amt;M.x=F.clientWidth/2,M.y=F.clientHeight/2;let b=ob(e,M,cmt);if(!l(b))P=!0;else if(_.positionCartographic.height<1e6)if(h.dot(_.direction,v)>=-.5)P=!0;else{let R=hmt;h.clone(_.position,R);let E=e._zoomWorldPosition,X=mmt;if(X=h.normalize(E,X),h.dot(X,v)<0)return;let w=Tmt,N=bmt;h.clone(_.direction,N),h.add(R,h.multiplyByScalar(N,1e3,wT),w);let D=ymt,k=gmt;h.subtract(E,R,D),h.normalize(D,k);let Y=h.dot(v,k);if(Y>=0){e._zoomMouseStart.x=-1;return}let U=Math.acos(-Y),J=h.magnitude(R),K=h.magnitude(E),ee=J-f,H=h.magnitude(D),j=Math.asin(W.clamp(H/K*Math.sin(U),-1,1)),$=Math.asin(W.clamp(ee/K*Math.sin(U),-1,1)),pe=j-$+U,ge=fmt;h.normalize(R,ge);let ae=pmt;ae=h.cross(k,ge,ae),ae=h.normalize(ae,ae),h.normalize(h.cross(ge,ae,wT),N),h.multiplyByScalar(h.normalize(w,wT),h.magnitude(w)-f,w),h.normalize(R,R),h.multiplyByScalar(R,ee,R);let be=xmt;h.multiplyByScalar(h.add(h.multiplyByScalar(ge,Math.cos(pe)-1,Oge),h.multiplyByScalar(N,Math.sin(pe),Yge),wT),ee,be),h.add(R,be,R),h.normalize(w,ge),h.normalize(h.cross(ge,ae,wT),N);let _e=_mt;h.multiplyByScalar(h.add(h.multiplyByScalar(ge,Math.cos(pe)-1,Oge),h.multiplyByScalar(N,Math.sin(pe),Yge),wT),h.magnitude(w),_e),h.add(w,_e,w),h.clone(R,_.position),h.normalize(h.subtract(w,R,wT),_.direction),h.clone(_.direction,_.direction),h.cross(_.direction,_.up,_.right),h.cross(_.right,_.direction,_.up),_.setView(J4);return}else{let R=h.normalize(b,lmt),E=h.normalize(e._zoomWorldPosition,dmt),X=h.dot(E,R);if(X>0&&X<1){let w=W.acosClamped(X),N=h.cross(E,R,umt),D=Math.abs(w)>W.toRadians(20)?_.positionCartographic.height*.75:_.positionCartographic.height-f,k=f/D;_.rotate(N,w*k)}}}}e._rotatingZoom=!P}if(!L&&P||Z){let v,F=to.wgs84ToWindowCoordinates(x,e._zoomWorldPosition,rmt);C!==ie.COLUMBUS_VIEW&&B.equals(t,e._zoomMouseStart)&&l(F)?v=_.getPickRay(F,ED):v=_.getPickRay(t,ED);let M=v.direction;(C===ie.COLUMBUS_VIEW||C===ie.SCENE2D)&&h.fromElements(M.y,M.z,M.x,M),_.move(M,f),e._zoomingOnVector=!0}else _.zoomIn(f);e._cameraUnderground||_.setView(J4)}var Smt=new gn,Cmt=new gn,Vmt=new h;function Lmt(e,t,n){let o=e._scene.camera,r=o.getPickRay(n.startPosition,Smt).origin,s=o.getPickRay(n.endPosition,Cmt).origin;r=h.fromElements(r.y,r.z,r.x,r),s=h.fromElements(s.y,s.z,s.x,s);let a=h.subtract(r,s,Vmt),c=h.magnitude(a);c>0&&(h.normalize(a,a),o.move(a,c))}function Hge(e,t,n){l(n.distance)&&(n=n.distance);let o=e._scene.camera;ij(e,t,n,e._zoomFactor,o.getMagnitude())}var Rmt=new B,Zmt=new B;function Kge(e,t,n){if(l(n.angleAndHeight)){Gmt(e,t,n.angleAndHeight);return}let i=e._scene,o=i.camera,r=i.canvas,s=r.clientWidth,a=r.clientHeight,c=Rmt;c.x=2/s*n.startPosition.x-1,c.y=2/a*(a-n.startPosition.y)-1,c=B.normalize(c,c);let d=Zmt;d.x=2/s*n.endPosition.x-1,d.y=2/a*(a-n.endPosition.y)-1,d=B.normalize(d,d);let u=W.acosClamped(c.x);c.y<0&&(u=W.TWO_PI-u);let m=W.acosClamped(d.x);d.y<0&&(m=W.TWO_PI-m);let p=m-u;o.twistRight(p)}function Gmt(e,t,n){let i=e._rotateFactor*e._rotateRateRangeAdjustment;i>e._maximumRotateRate&&(i=e._maximumRotateRate),i<e._minimumRotateRate&&(i=e._minimumRotateRate);let o=e._scene,r=o.camera,s=o.canvas,a=(n.endPosition.x-n.startPosition.x)/s.clientWidth;a=Math.min(a,e.maximumMovementRatio);let c=i*a*Math.PI*4;r.twistRight(c)}function Emt(e){let t=e._scene.mapMode2D===Ol.ROTATE;A.equals(A.IDENTITY,e._scene.camera.transform)?(rl(e,e.enableTranslate,e.translateEventTypes,Lmt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),rl(e,e.enableZoom,e.zoomEventTypes,Hge,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&rl(e,e.enableRotate,e.tiltEventTypes,Kge,e.inertiaSpin,"_lastInertiaTiltMovement")):(rl(e,e.enableZoom,e.zoomEventTypes,Hge,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&rl(e,e.enableRotate,e.translateEventTypes,Kge,e.inertiaSpin,"_lastInertiaSpinMovement"))}var nxe=new gn,Imt=new h,Xmt=new h;function ob(e,t,n){let i=e._scene,o=e._globe,r=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,Imt)),!l(o))return h.clone(s,n);let a=!e._cameraUnderground,c=r.getPickRay(t,nxe),d=o.pickWorldCoordinates(c,i,a,Xmt),u=l(s)?h.distance(s,r.positionWC):Number.POSITIVE_INFINITY,m=l(d)?h.distance(d,r.positionWC):Number.POSITIVE_INFINITY;return u<m?h.clone(s,n):h.clone(d,n)}var Wmt=new he;function FD(e){let t=e._ellipsoid,n=e._scene,i=n.camera,o=n.mode,r=0;if(o===ie.SCENE3D){let c=t.cartesianToCartographic(i.position,Wmt);l(c)&&(r=c.height)}else r=i.position.z;let s=g(e._scene.globeHeight,0);return Math.abs(s-r)}var Pmt=new h;function ixe(e,t){let n=t.origin,i=t.direction,o=FD(e),r=h.normalize(n,Pmt),s=Math.abs(h.dot(r,i));return s=Math.max(s,.5)*2,o*s}function oxe(e,t,n,i){let o=h.distance(t.origin,n),r=FD(e),s=W.clamp(r*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return o>s&&(o=Math.min(o,r/5),o=Math.max(o,100)),gn.getPoint(t,o,i)}function rxe(e,t,n,i){let o;return l(n)?(o=h.distance(t.origin,n),o>e._maximumUndergroundPickDistance&&(o=FD(e))):o=FD(e),gn.getPoint(t,o,i)}var vmt=new B;function sxe(e,t){let n=t.endPosition,i=B.subtract(t.endPosition,t.startPosition,vmt),o=e._strafeEndMousePosition;B.add(o,i,o),t.endPosition=o,oj(e,t,e._strafeStartPosition),t.endPosition=n}var zge=new gn,wmt=new gn,Q4=new h,Fmt=new h,Amt=new h,Mmt=new h,Nmt=new ln(h.UNIT_X,0),Umt=new B,kmt=new B;function Dmt(e,t,n){if(h.equals(t,e._translateMousePosition)||(e._looking=!1),h.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){Bd(e,t,n);return}if(e._strafing){sxe(e,n);return}let o=e._scene.camera,r=e._cameraUnderground,s=B.clone(n.startPosition,Umt),a=B.clone(n.endPosition,kmt),c=o.getPickRay(s,zge),d=h.clone(h.ZERO,Mmt),u=h.UNIT_X,m;if(o.position.z<e._minimumPickingTerrainHeight&&(m=ob(e,s,Q4),l(m)&&(d.x=m.x)),r||d.x>o.position.z&&l(m)){let L=m;r&&(L=rxe(e,c,m,Q4)),B.clone(t,e._strafeMousePosition),B.clone(t,e._strafeEndMousePosition),h.clone(L,e._strafeStartPosition),e._strafing=!0,oj(e,n,e._strafeStartPosition);return}let p=ln.fromPointNormal(d,u,Nmt);c=o.getPickRay(s,zge);let y=ni.rayPlane(c,p,Q4),f=o.getPickRay(a,wmt),x=ni.rayPlane(f,p,Fmt);if(!l(y)||!l(x)){e._looking=!0,Bd(e,t,n),B.clone(t,e._translateMousePosition);return}let _=h.subtract(y,x,Amt),C=_.x;_.x=_.y,_.y=_.z,_.z=C;let V=h.magnitude(_);V>W.EPSILON6&&(h.normalize(_,_),o.move(_,V))}var axe=new B,WD=new gn,PD=new h,Bmt=new h,cxe=new A,Omt=new A,Ymt=new h,Hmt=new ln(h.UNIT_X,0),j4=new h,ej=new he,lxe=new A,Kmt=new Me,zmt=new q,vD=new h;function Jmt(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),B.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){Bd(e,t,n);return}let o=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(o.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,Qmt(e,t,n)):jmt(e,t,n)}function Qmt(e,t,n){let i=e._scene,o=i.camera,r=i.canvas,s=axe;s.x=r.clientWidth/2,s.y=r.clientHeight/2;let a=o.getPickRay(s,WD),c=h.UNIT_X,d=a.origin,u=a.direction,m,p=h.dot(c,u);if(Math.abs(p)>W.EPSILON6&&(m=-h.dot(c,d)/p),!l(m)||m<=0){e._looking=!0,Bd(e,t,n),B.clone(t,e._tiltCenterMousePosition);return}let y=h.multiplyByScalar(u,m,PD);h.add(d,y,y);let f=i.mapProjection,x=f.ellipsoid;h.fromElements(y.y,y.z,y.x,y);let _=f.unproject(y,ej);x.cartographicToCartesian(_,y);let C=Xt.eastNorthUpToFixedFrame(y,x,cxe),V=e._globe,L=e._ellipsoid;e._globe=void 0,e._ellipsoid=oe.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let Z=A.clone(o.transform,lxe);o._setTransform(C),Dd(e,t,n,h.UNIT_Z),o._setTransform(Z),e._globe=V,e._ellipsoid=L;let G=L.maximumRadius;e._rotateFactor=1/G,e._rotateRateRangeAdjustment=G}function jmt(e,t,n){let i=e._scene,o=i.camera,r=e._cameraUnderground,s,a,c=h.UNIT_X;if(B.equals(t,e._tiltCenterMousePosition))s=h.clone(e._tiltCenter,PD);else{if(o.position.z<e._minimumPickingTerrainHeight&&(s=ob(e,t,PD)),!l(s)){a=o.getPickRay(t,WD);let b=a.origin,R=a.direction,E,X=h.dot(c,R);if(Math.abs(X)>W.EPSILON6&&(E=-h.dot(c,b)/X),!l(E)||E<=0){e._looking=!0,Bd(e,t,n),B.clone(t,e._tiltCenterMousePosition);return}s=h.multiplyByScalar(R,E,PD),h.add(b,s,s)}r&&(l(a)||(a=o.getPickRay(t,WD)),oxe(e,a,s,s)),B.clone(t,e._tiltCenterMousePosition),h.clone(s,e._tiltCenter)}let d=i.canvas,u=axe;u.x=d.clientWidth/2,u.y=e._tiltCenterMousePosition.y,a=o.getPickRay(u,WD);let m=h.clone(h.ZERO,Ymt);m.x=s.x;let p=ln.fromPointNormal(m,c,Hmt),y=ni.rayPlane(a,p,Bmt),f=o._projection,x=f.ellipsoid;h.fromElements(s.y,s.z,s.x,s);let _=f.unproject(s,ej);x.cartographicToCartesian(_,s);let C=Xt.eastNorthUpToFixedFrame(s,x,cxe),V;l(y)?(h.fromElements(y.y,y.z,y.x,y),_=f.unproject(y,ej),x.cartographicToCartesian(_,y),V=Xt.eastNorthUpToFixedFrame(y,x,Omt)):V=C;let L=e._globe,Z=e._ellipsoid;e._globe=void 0,e._ellipsoid=oe.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let G=h.UNIT_Z,I=A.clone(o.transform,lxe);o._setTransform(C);let P=h.cross(h.UNIT_Z,h.normalize(o.position,j4),j4),v=h.dot(o.right,P);if(Dd(e,t,n,G,!1,!0),o._setTransform(V),v<0){let b=n.startPosition.y-n.endPosition.y;(r&&b<0||!r&&b>0)&&(G=void 0);let R=o.constrainedAxis;o.constrainedAxis=void 0,Dd(e,t,n,G,!0,!1),o.constrainedAxis=R}else Dd(e,t,n,G,!0,!1);if(l(o.constrainedAxis)){let b=h.cross(o.direction,o.constrainedAxis,vD);h.equalsEpsilon(b,h.ZERO,W.EPSILON6)||(h.dot(b,o.right)<0&&h.negate(b,b),h.cross(b,o.direction,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.up,o.up),h.normalize(o.right,o.right))}o._setTransform(I),e._globe=L,e._ellipsoid=Z;let F=Z.maximumRadius;e._rotateFactor=1/F,e._rotateRateRangeAdjustment=F;let M=h.clone(o.positionWC,j4);if(e.enableCollisionDetection&&aj(e),!h.equals(o.positionWC,M)){o._setTransform(V),o.worldToCameraCoordinatesPoint(M,M);let b=h.magnitudeSquared(M);h.magnitudeSquared(o.position)>b&&(h.normalize(o.position,o.position),h.multiplyByScalar(o.position,Math.sqrt(b),o.position));let R=h.angleBetween(M,o.position),E=h.cross(M,o.position,M);h.normalize(E,E);let X=Me.fromAxisAngle(E,R,Kmt),w=q.fromQuaternion(X,zmt);q.multiplyByVector(w,o.direction,o.direction),q.multiplyByVector(w,o.up,o.up),h.cross(o.direction,o.up,o.right),h.cross(o.right,o.direction,o.up),o._setTransform(I)}}var dxe=new B,uxe=new gn,mxe=new h;function qmt(e,t,n){l(n.distance)&&(n=n.distance);let i=e._scene,o=i.camera,r=i.canvas,s=e._cameraUnderground,a;s?a=t:(a=dxe,a.x=r.clientWidth/2,a.y=r.clientHeight/2);let c=o.getPickRay(a,uxe),d=c.origin,u=c.direction,m=o.position.z,p;m<e._minimumPickingTerrainHeight&&(p=ob(e,a,mxe));let y;if(l(p)&&(y=h.distance(d,p)),s){let f=ixe(e,c,m);l(y)?y=Math.min(y,f):y=f}if(!l(y)){let f=h.UNIT_X;y=-h.dot(f,d)/h.dot(f,u)}ij(e,t,n,e._zoomFactor,y)}function $mt(e){let n=e._scene.camera;if(!A.equals(A.IDENTITY,n.transform))rl(e,e.enableRotate,e.rotateEventTypes,Dd,e.inertiaSpin,"_lastInertiaSpinMovement"),rl(e,e.enableZoom,e.zoomEventTypes,fxe,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),rl(e,e.enableTilt,e.tiltEventTypes,Jmt,e.inertiaSpin,"_lastInertiaTiltMovement"),rl(e,e.enableTranslate,e.translateEventTypes,Dmt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),rl(e,e.enableZoom,e.zoomEventTypes,qmt,e.inertiaZoom,"_lastInertiaZoomMovement"),rl(e,e.enableLook,e.lookEventTypes,Bd),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let o=n.createCorrectPositionTween(e.bounceAnimationTime);l(o)&&(e._tween=i.add(o))}i.update()}}var eht=new gn,tht=new ln(h.UNIT_X,0),nht=new h,iht=new h;function oj(e,t,n){let i=e._scene,o=i.camera,r=o.getPickRay(t.endPosition,eht),s=h.clone(o.direction,iht);i.mode===ie.COLUMBUS_VIEW&&h.fromElements(s.z,s.x,s.y,s);let a=ln.fromPointNormal(n,s,tht),c=ni.rayPlane(r,a,nht);l(c)&&(s=h.subtract(n,c,s),i.mode===ie.COLUMBUS_VIEW&&h.fromElements(s.y,s.z,s.x,s),h.add(o.position,s,o.position))}var Jge=new h,hxe=new he,tj=new h,nj=new oe,oht=new h,rht=new h,sht=new h;function aht(e,t,n){let o=e._scene.camera,r=e._cameraUnderground,s=e._ellipsoid;if(!A.equals(o.transform,A.IDENTITY)){Dd(e,t,n);return}let a,c,d=s.geodeticSurfaceNormal(o.position,oht);if(B.equals(t,e._rotateMousePosition)){if(e._looking)Bd(e,t,n,d);else if(e._rotating)Dd(e,t,n);else if(e._strafing)sxe(e,n);else{if(h.magnitude(o.position)<h.magnitude(e._rotateStartPosition))return;a=h.magnitude(e._rotateStartPosition),c=tj,c.x=c.y=c.z=a,s=oe.fromCartesian3(c,nj),$4(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let u=s.cartesianToCartographic(o.positionWC,hxe).height,m=e._globe;if(l(m)&&u<e._minimumPickingTerrainHeight){let p=ob(e,n.startPosition,sht);if(l(p)){let y=!1,f=o.getPickRay(n.startPosition,nxe);if(r)y=!0,rxe(e,f,p,p);else{let x=s.geodeticSurfaceNormal(p,rht);Math.abs(h.dot(f.direction,x))<.05?y=!0:y=h.magnitude(o.position)<h.magnitude(p)}y?(B.clone(t,e._strafeEndMousePosition),h.clone(p,e._strafeStartPosition),e._strafing=!0,oj(e,n,e._strafeStartPosition)):(a=h.magnitude(p),c=tj,c.x=c.y=c.z=a,s=oe.fromCartesian3(c,nj),$4(e,t,n,s),h.clone(p,e._rotateStartPosition))}else e._looking=!0,Bd(e,t,n,d)}else l(o.pickEllipsoid(n.startPosition,e._ellipsoid,Jge))?($4(e,t,n,e._ellipsoid),h.clone(Jge,e._rotateStartPosition)):u>e._minimumTrackBallHeight?(e._rotating=!0,Dd(e,t,n)):(e._looking=!0,Bd(e,t,n,d));B.clone(t,e._rotateMousePosition)}function Dd(e,t,n,i,o,r){o=g(o,!1),r=g(r,!1);let s=e._scene,a=s.camera,c=s.canvas,d=a.constrainedAxis;l(i)&&(a.constrainedAxis=i);let u=h.magnitude(a.position),m=e._rotateFactor*(u-e._rotateRateRangeAdjustment);m>e._maximumRotateRate&&(m=e._maximumRotateRate),m<e._minimumRotateRate&&(m=e._minimumRotateRate);let p=(n.startPosition.x-n.endPosition.x)/c.clientWidth,y=(n.startPosition.y-n.endPosition.y)/c.clientHeight;p=Math.min(p,e.maximumMovementRatio),y=Math.min(y,e.maximumMovementRatio);let f=m*p*Math.PI*2,x=m*y*Math.PI;o||a.rotateRight(f),r||a.rotateUp(x),a.constrainedAxis=d}var q4=se.clone(se.UNIT_W),Qge=se.clone(se.UNIT_W),ID=new h,MV=new h,XD=new h,jge=new h,cht=new B,lht=new B,dht=new B,uht=new B,mht=new gn;function $4(e,t,n,i){let o=e._scene,r=o.camera,s=B.clone(n.startPosition,cht),a=B.clone(n.endPosition,lht),c=i.cartesianToCartographic(r.positionWC,hxe).height,d,u;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(d=h.clone(e._panLastWorldPosition,q4),!l(e._globe)&&!B.equalsEpsilon(s,e._panLastMousePosition)&&(d=ob(e,s,q4)),!l(e._globe)&&l(d))){let m=h.subtract(d,r.positionWC,MV),p=h.multiplyByScalar(r.directionWC,h.dot(r.directionWC,m),MV),y=h.magnitude(p),f=r.frustum.getPixelDimensions(o.drawingBufferWidth,o.drawingBufferHeight,y,o.pixelRatio,uht),x=B.subtract(a,s,dht),_=h.multiplyByScalar(r.rightWC,x.x*f.x,MV),C=h.normalize(r.positionWC,txe),V=r.getPickRay(a,mht).direction,L=h.subtract(V,h.projectVector(V,r.rightWC,XD),XD),Z=h.angleBetween(L,r.directionWC),G=1;l(r.frustum.fov)&&(G=Math.max(Math.tan(Z),.1));let I=Math.abs(h.dot(r.directionWC,C)),P=-x.y*f.y*2/Math.sqrt(G)*(1-I),v=h.multiplyByScalar(V,P,XD);I=Math.abs(h.dot(r.upWC,C));let F=h.multiplyByScalar(r.upWC,-x.y*(1-I)*f.y,jge);u=h.add(d,_,Qge),u=h.add(u,v,u),u=h.add(u,F,u),h.clone(u,e._panLastWorldPosition),B.clone(a,e._panLastMousePosition)}if((!l(d)||!l(u))&&(d=r.pickEllipsoid(s,i,q4),u=r.pickEllipsoid(a,i,Qge)),!l(d)||!l(u)){e._rotating=!0,Dd(e,t,n);return}if(d=r.worldToCameraCoordinates(d,d),u=r.worldToCameraCoordinates(u,u),l(r.constrainedAxis)){let m=r.constrainedAxis,p=h.mostOrthogonalAxis(m,ID);h.cross(p,m,p),h.normalize(p,p);let y=h.cross(m,p,MV),f=h.magnitude(d),x=h.dot(m,d),_=Math.acos(x/f),C=h.multiplyByScalar(m,x,XD);h.subtract(d,C,C),h.normalize(C,C);let V=h.magnitude(u),L=h.dot(m,u),Z=Math.acos(L/V),G=h.multiplyByScalar(m,L,jge);h.subtract(u,G,G),h.normalize(G,G);let I=Math.acos(h.dot(C,p));h.dot(C,y)<0&&(I=W.TWO_PI-I);let P=Math.acos(h.dot(G,p));h.dot(G,y)<0&&(P=W.TWO_PI-P);let v=I-P,F;h.equalsEpsilon(m,r.position,W.EPSILON2)?F=r.right:F=h.cross(m,r.position,ID);let M=h.cross(m,F,ID),b=h.dot(M,h.subtract(d,m,MV)),R=h.dot(M,h.subtract(u,m,MV)),E;b>0&&R>0?E=Z-_:b>0&&R<=0?h.dot(r.position,m)>0?E=-_-Z:E=_+Z:E=_-Z,r.rotateRight(v),r.rotateUp(E)}else{h.normalize(d,d),h.normalize(u,u);let m=h.dot(d,u),p=h.cross(d,u,ID);if(m<1&&!h.equalsEpsilon(p,h.ZERO,W.EPSILON14)){let y=Math.acos(m);r.rotate(p,y)}}}var hht=new h,fht=new he,qge=0;function fxe(e,t,n){l(n.distance)&&(n=n.distance);let i=n.inertiaEnabled,o=e._ellipsoid,r=e._scene,s=r.camera,a=r.canvas,c=e._cameraUnderground,d;c?d=t:(d=dxe,d.x=a.clientWidth/2,d.y=a.clientHeight/2);let u=s.getPickRay(d,uxe),m,p=o.cartesianToCartographic(s.position,fht).height,y=Math.abs(qge)<e.minimumPickingTerrainDistanceWithInertia;(i?y:p<e._minimumPickingTerrainHeight)&&(m=ob(e,d,mxe));let x;if(l(m)&&(x=h.distance(u.origin,m),qge=x),c){let C=ixe(e,u,p);l(x)?x=Math.min(x,C):x=C}l(x)||(x=p);let _=h.normalize(s.position,hht);ij(e,t,n,e._zoomFactor,x,h.dot(_,s.direction))}var pxe=new B,wD=new gn,vF=new h,pht=new h,bxe=new A,bht=new A,yxe=new A,yht=new Me,ght=new q,rj=new he,sj=new h;function xht(e,t,n){let o=e._scene.camera;if(!A.equals(o.transform,A.IDENTITY))return;if(l(n.angleAndHeight)&&(n=n.angleAndHeight),B.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let a=e._ellipsoid.geodeticSurfaceNormal(o.position,sj);Bd(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(o.position,rj);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,Tht(e,t,n)):Sht(e,t,n)}var _ht=new he;function Tht(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(r.positionWC,_ht).height;if(a-s-1<W.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=o.canvas,d=pxe;d.x=c.clientWidth/2,d.y=c.clientHeight/2;let u=r.getPickRay(d,wD),m,p=ni.rayEllipsoid(u,i);if(l(p))m=gn.getPoint(u,p.start,vF);else if(a>e._minimumTrackBallHeight){let V=ni.grazingAltitudeLocation(u,i);if(!l(V))return;let L=i.cartesianToCartographic(V,rj);L.height=0,m=i.cartographicToCartesian(L,vF)}else{e._looking=!0;let V=e._ellipsoid.geodeticSurfaceNormal(r.position,sj);Bd(e,t,n,V),B.clone(t,e._tiltCenterMousePosition);return}let y=Xt.eastNorthUpToFixedFrame(m,i,bxe),f=e._globe,x=e._ellipsoid;e._globe=void 0,e._ellipsoid=oe.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let _=A.clone(r.transform,yxe);r._setTransform(y),Dd(e,t,n,h.UNIT_Z),r._setTransform(_),e._globe=f,e._ellipsoid=x;let C=x.maximumRadius;e._rotateFactor=1/C,e._rotateRateRangeAdjustment=C}function Sht(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e._cameraUnderground,a,c,d;if(B.equals(t,e._tiltCenterMousePosition))a=h.clone(e._tiltCenter,vF);else{if(a=ob(e,t,vF),!l(a)){if(c=r.getPickRay(t,wD),d=ni.rayEllipsoid(c,i),!l(d)){if(i.cartesianToCartographic(r.position,rj).height<=e._minimumTrackBallHeight){e._looking=!0;let R=e._ellipsoid.geodeticSurfaceNormal(r.position,sj);Bd(e,t,n,R),B.clone(t,e._tiltCenterMousePosition)}return}a=gn.getPoint(c,d.start,vF)}s&&(l(c)||(c=r.getPickRay(t,wD)),oxe(e,c,a,a)),B.clone(t,e._tiltCenterMousePosition),h.clone(a,e._tiltCenter)}let u=o.canvas,m=pxe;m.x=u.clientWidth/2,m.y=e._tiltCenterMousePosition.y,c=r.getPickRay(m,wD);let p=h.magnitude(a),y=h.fromElements(p,p,p,tj),f=oe.fromCartesian3(y,nj);if(d=ni.rayEllipsoid(c,f),!l(d))return;let x=h.magnitude(c.origin)>p?d.start:d.stop,_=gn.getPoint(c,x,pht),C=Xt.eastNorthUpToFixedFrame(a,i,bxe),V=Xt.eastNorthUpToFixedFrame(_,f,bht),L=e._globe,Z=e._ellipsoid;e._globe=void 0,e._ellipsoid=oe.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let G=h.UNIT_Z,I=A.clone(r.transform,yxe);r._setTransform(V);let P=h.cross(_,r.positionWC,vD);if(h.dot(r.rightWC,P)<0){let b=n.startPosition.y-n.endPosition.y;(s&&b<0||!s&&b>0)&&(G=void 0);let R=r.constrainedAxis;r.constrainedAxis=void 0,Dd(e,t,n,G,!0,!1),r.constrainedAxis=R}else Dd(e,t,n,G,!0,!1);if(r._setTransform(C),Dd(e,t,n,G,!1,!0),l(r.constrainedAxis)){let b=h.cross(r.direction,r.constrainedAxis,vD);h.equalsEpsilon(b,h.ZERO,W.EPSILON6)||(h.dot(b,r.right)<0&&h.negate(b,b),h.cross(b,r.direction,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.up,r.up),h.normalize(r.right,r.right))}r._setTransform(I),e._globe=L,e._ellipsoid=Z;let F=Z.maximumRadius;e._rotateFactor=1/F,e._rotateRateRangeAdjustment=F;let M=h.clone(r.positionWC,vD);if(e.enableCollisionDetection&&aj(e),!h.equals(r.positionWC,M)){r._setTransform(V),r.worldToCameraCoordinatesPoint(M,M);let b=h.magnitudeSquared(M);h.magnitudeSquared(r.position)>b&&(h.normalize(r.position,r.position),h.multiplyByScalar(r.position,Math.sqrt(b),r.position));let R=h.angleBetween(M,r.position),E=h.cross(M,r.position,M);h.normalize(E,E);let X=Me.fromAxisAngle(E,R,yht),w=q.fromQuaternion(X,ght);q.multiplyByVector(w,r.direction,r.direction),q.multiplyByVector(w,r.up,r.up),h.cross(r.direction,r.up,r.right),h.cross(r.right,r.direction,r.up),r._setTransform(I)}}var Cht=new B,Vht=new B,$ge=new gn,exe=new gn,Lht=new h,Rht=new h;function Bd(e,t,n,i){let r=e._scene.camera,s=Cht;s.x=n.startPosition.x,s.y=0;let a=Vht;a.x=n.endPosition.x,a.y=0;let c=r.getPickRay(s,$ge),d=r.getPickRay(a,exe),u=0,m,p;r.frustum instanceof rn?(m=c.origin,p=d.origin,h.add(r.direction,m,m),h.add(r.direction,p,p),h.subtract(m,r.position,m),h.subtract(p,r.position,p),h.normalize(m,m),h.normalize(p,p)):(m=c.direction,p=d.direction);let y=h.dot(m,p);y<1&&(u=Math.acos(y)),u=n.startPosition.x>n.endPosition.x?-u:u;let f=e._horizontalRotationAxis;if(l(i)?r.look(i,-u):l(f)?r.look(f,-u):r.lookLeft(u),s.x=0,s.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,c=r.getPickRay(s,$ge),d=r.getPickRay(a,exe),u=0,r.frustum instanceof rn?(m=c.origin,p=d.origin,h.add(r.direction,m,m),h.add(r.direction,p,p),h.subtract(m,r.position,m),h.subtract(p,r.position,p),h.normalize(m,m),h.normalize(p,p)):(m=c.direction,p=d.direction),y=h.dot(m,p),y<1&&(u=Math.acos(y)),u=n.startPosition.y>n.endPosition.y?-u:u,i=g(i,f),l(i)){let x=r.direction,_=h.negate(i,Lht),C=h.equalsEpsilon(x,i,W.EPSILON2),V=h.equalsEpsilon(x,_,W.EPSILON2);if(!C&&!V){y=h.dot(x,i);let L=W.acosClamped(y);u>0&&u>L&&(u=L-W.EPSILON4),y=h.dot(x,_),L=W.acosClamped(y),u<0&&-u>L&&(u=-L+W.EPSILON4);let Z=h.cross(i,x,Rht);r.look(Z,u)}else(C&&u<0||V&&u>0)&&r.look(r.right,-u)}else r.lookUp(u)}function Zht(e){rl(e,e.enableRotate,e.rotateEventTypes,aht,e.inertiaSpin,"_lastInertiaSpinMovement"),rl(e,e.enableZoom,e.zoomEventTypes,fxe,e.inertiaZoom,"_lastInertiaZoomMovement"),rl(e,e.enableTilt,e.tiltEventTypes,xht,e.inertiaSpin,"_lastInertiaTiltMovement"),rl(e,e.enableLook,e.lookEventTypes,Bd)}var Ght=new A,Eht=new he;function aj(e){e._adjustedHeightForTerrain=!0;let t=e._scene,n=t.mode,i=t.globe;if(n===ie.SCENE2D||n===ie.MORPHING)return;let o=t.camera,r=g(i?.ellipsoid,oe.WGS84),s=t.mapProjection,a,c;A.equals(o.transform,A.IDENTITY)||(a=A.clone(o.transform,Ght),c=h.magnitude(o.position),o._setTransform(A.IDENTITY));let d=Eht;n===ie.SCENE3D?r.cartesianToCartographic(o.position,d):s.unproject(o.position,d);let u=!1;if(d.height<e._minimumCollisionTerrainHeight){let m=e._scene.globeHeight;if(l(m)){let p=m+e.minimumZoomDistance;d.height<p&&(d.height=p,n===ie.SCENE3D?r.cartographicToCartesian(d,o.position):s.project(d,o.position),u=!0)}}l(a)&&(o._setTransform(a),u&&(h.normalize(o.position,o.position),h.negate(o.position,o.direction),h.multiplyByScalar(o.position,Math.max(c,e.minimumZoomDistance),o.position),h.normalize(o.direction,o.direction),h.cross(o.direction,o.up,o.right),h.cross(o.right,o.direction,o.up)))}wF.prototype.onMap=function(){let e=this._scene,t=e.mode,n=e.camera;return t===ie.COLUMBUS_VIEW?Math.abs(n.position.x)-this._maxCoord.x<0&&Math.abs(n.position.y)-this._maxCoord.y<0:!0};var Iht=new h,Xht=new h;wF.prototype.update=function(){let e=this._scene,{camera:t,globe:n,mode:i}=e;A.equals(t.transform,A.IDENTITY)?(this._globe=n,this._ellipsoid=l(this._globe)?this._globe.ellipsoid:e.mapProjection.ellipsoid):(this._globe=void 0,this._ellipsoid=oe.UNIT_SPHERE);let{verticalExaggeration:o,verticalExaggerationRelativeHeight:r}=e;this._minimumCollisionTerrainHeight=Dr.getHeight(this.minimumCollisionTerrainHeight,o,r),this._minimumPickingTerrainHeight=Dr.getHeight(this.minimumPickingTerrainHeight,o,r),this._minimumTrackBallHeight=Dr.getHeight(this.minimumTrackBallHeight,o,r),this._cameraUnderground=e.cameraUnderground&&l(this._globe);let s=this._ellipsoid.maximumRadius;this._rotateFactor=1/s,this._rotateRateRangeAdjustment=s,this._adjustedHeightForTerrain=!1;let a=h.clone(t.positionWC,Iht),c=h.clone(t.directionWC,Xht);i===ie.SCENE2D?Emt(this):i===ie.COLUMBUS_VIEW?(this._horizontalRotationAxis=h.UNIT_Z,$mt(this)):i===ie.SCENE3D&&(this._horizontalRotationAxis=void 0,Zht(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain&&(!h.equals(a,t.positionWC)||!h.equals(c,t.directionWC))&&aj(this),this._aggregator.reset()};wF.prototype.isDestroyed=function(){return!1};wF.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),ue(this)};var FF=wF;var Cwi=T(S(),1);var nwi=T(S(),1),AF=`uniform sampler2D colorTexture;
uniform sampler2D colorTexture2;
uniform vec2 center;
uniform float radius;
in vec2 v_textureCoordinates;
void main()
{
vec4 color0 = texture(colorTexture, v_textureCoordinates);
vec4 color1 = texture(colorTexture2, v_textureCoordinates);
float x = length(gl_FragCoord.xy - center) / radius;
float t = smoothstep(0.5, 0.8, x);
out_FragColor = mix(color0 + color1, color1, t);
}
`;var owi=T(S(),1),MF=`uniform sampler2D colorTexture;
uniform float avgLuminance;
uniform float threshold;
uniform float offset;
in vec2 v_textureCoordinates;
float key(float avg)
{
float guess = 1.5 - (1.5 / (avg * 0.1 + 1.0));
return max(0.0, guess) + 0.1;
}
// See section 9. "The bright-pass filter" of Realtime HDR Rendering
// http://www.cg.tuwien.ac.at/research/publications/2007/Luksch_2007_RHR/Luksch_2007_RHR-RealtimeHDR%20.pdf
void main()
{
vec4 color = texture(colorTexture, v_textureCoordinates);
vec3 xyz = czm_RGBToXYZ(color.rgb);
float luminance = xyz.r;
float scaledLum = key(avgLuminance) * luminance / avgLuminance;
float brightLum = max(scaledLum - threshold, 0.0);
float brightness = brightLum / (offset + brightLum);
xyz.r = brightness;
out_FragColor = vec4(czm_XYZToRGB(xyz), 1.0);
}
`;function rb(){this._sceneFramebuffer=new CT;let e=.125,t=new Array(6);t[0]=new xo({fragmentShader:Yl,textureScale:e,forcePowerOfTwo:!0,sampleMode:Nd.LINEAR});let n=t[1]=new xo({fragmentShader:MF,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new B,t[2]=new xo({fragmentShader:mg,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:0},textureScale:e,forcePowerOfTwo:!0}),t[3]=new xo({fragmentShader:mg,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:1},textureScale:e,forcePowerOfTwo:!0}),t[4]=new xo({fragmentShader:Yl,sampleMode:Nd.LINEAR}),this._uCenter=new B,this._uRadius=void 0,t[5]=new xo({fragmentShader:AF,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new il({stages:t});let o=new IT(this),r=t.length;for(let s=0;s<r;++s)t[s]._textureCache=o;this._textureCache=o,this.length=t.length}rb.prototype.get=function(e){return this._stages.get(e)};rb.prototype.getStageByName=function(e){let t=this._stages.length;for(let n=0;n<t;++n){let i=this._stages.get(n);if(i.name===e)return i}};var Wht=new se,gxe=new B,Pht=new B,xxe=new A;function vht(e,t,n){let i=t.uniformState,o=i.sunPositionWC,r=i.view,s=i.viewProjection,a=i.projection,c=A.computeViewportTransformation(n,0,1,xxe),d=A.multiplyByPoint(r,o,Wht),u=Xt.pointToGLWindowCoordinates(s,c,o,gxe);d.x+=W.SOLAR_RADIUS;let m=Xt.pointToGLWindowCoordinates(a,c,d,d),p=B.magnitude(B.subtract(m,u,m))*30*2,y=Pht;y.x=p,y.y=p,e._uCenter=B.clone(u,e._uCenter),e._uRadius=Math.max(y.x,y.y)*.15;let f=t.drawingBufferWidth,x=t.drawingBufferHeight,_=e._stages,C=_.get(0),V=C.outputTexture.width,L=C.outputTexture.height,Z=new De;Z.width=V,Z.height=L,c=A.computeViewportTransformation(Z,0,1,xxe),u=Xt.pointToGLWindowCoordinates(s,c,o,gxe),y.x*=V/f,y.y*=L/x;let G=C.scissorRectangle;G.x=Math.max(u.x-y.x*.5,0),G.y=Math.max(u.y-y.y*.5,0),G.width=Math.min(y.x,f),G.height=Math.min(y.y,x);for(let I=1;I<4;++I)De.clone(G,_.get(I).scissorRectangle)}rb.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};rb.prototype.update=function(e){let t=e.context,n=e.viewport,i=this._sceneFramebuffer;i.update(t,n);let o=i.framebuffer;return this._textureCache.update(t),this._stages.update(t,!1),vht(this,t,n),o};rb.prototype.execute=function(e){let t=this._sceneFramebuffer.framebuffer.getColorTexture(0),n=this._stages,i=n.length;n.get(0).execute(e,t);for(let o=1;o<i;++o)n.get(o).execute(e,n.get(o-1).outputTexture)};rb.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Yl,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};rb.prototype.isDestroyed=function(){return!1};rb.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),ue(this)};var NF=rb;var Iwi=T(S(),1);function _xe(){this._cachedShowFrustumsShaders={}}function wht(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function Fht(e,t){let n=e.context,i=t,o=i.fragmentShaderSource.clone(),r=[];o.sources=o.sources.map(function(u){u=Oe.replaceMain(u,"czm_Debug_main");let m=/out_FragData_(\d+)/g,p;for(;(p=m.exec(u))!==null;)r.indexOf(p[1])===-1&&r.push(p[1]);return u});let s=r.length,a="";a+=`uniform vec3 debugShowCommandsColor;
`,a+=`uniform vec3 debugShowFrustumsColor;
`,a+=`void main()
{
czm_Debug_main();
`;let c;if(s>0)for(c=0;c<s;++c)a+=` out_FragData_${r[c]}.rgb *= debugShowCommandsColor;
`,a+=` out_FragData_${r[c]}.rgb *= debugShowFrustumsColor;
`;else a+=` out_FragColor.rgb *= debugShowCommandsColor;
`,a+=` out_FragColor.rgb *= debugShowFrustumsColor;
`;a+="}",o.sources.push(a);let d=wht(i);return Qt.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:o,attributeLocations:d})}var UF=new O;function Aht(e,t){let n;return l(t.uniformMap)?n=t.uniformMap:n={},l(n.debugShowCommandsColor)||l(n.debugShowFrustumsColor)||(n.debugShowCommandsColor=function(){return e.debugShowCommands?(l(t._debugColor)||(t._debugColor=O.fromRandom()),t._debugColor):O.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(UF.red=t.debugOverlappingFrustums&1?1:0,UF.green=t.debugOverlappingFrustums&2?1:0,UF.blue=t.debugOverlappingFrustums&4?1:0,UF.alpha=1,UF):O.WHITE}),n}var Mht=new nt;_xe.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,o=this._cachedShowFrustumsShaders[i];l(o)||(o=Fht(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=o);let r=nt.shallowClone(t,Mht);r.shaderProgram=o,r.uniformMap=Aht(e,t),r.execute(e.context,n)};var kF=_xe;var MD=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function vi(e){e=g(e,g.EMPTY_OBJECT);let t=e.canvas,n=e.creditContainer,i=e.creditViewport,o=ze(e.contextOptions),r=l(n),s=new Lv(t,o);r||(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",t.parentNode.appendChild(n)),l(i)||(i=t.parentNode),this._id=Hn(),this._jobScheduler=new zw,this._frameState=new Hw(s,new Fw(n," \u2022 ",i),this._jobScheduler),this._frameState.scene3DOnly=g(e.scene3DOnly,!1),this._removeCreditContainer=!r,this._creditContainer=n,this._canvas=t,this._context=s,this._computeEngine=new xv(s),this._globe=void 0,this._globeTranslucencyState=new Kw,this._primitives=new Fl,this._groundPrimitives=new Fl,this._globeHeight=void 0,this._globeHeightDirty=void 0,this._cameraUnderground=!1,this._logDepthBuffer=s.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new vT,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=g(e.orderIndependentTranslucency,!0),this._executeOITFunction=void 0,this._depthPlane=new Dw(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new ai({color:new O,stencil:0,owner:this}),this._depthClearCommand=new ai({depth:1,owner:this}),this._stencilClearCommand=new ai({stencil:0}),this._classificationStencilClearCommand=new ai({stencil:0,renderState:ke.fromCache({stencilMask:Nt.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new WF(this),this._preUpdate=new ye,this._postUpdate=new ye,this._renderError=new ye,this._preRender=new ye,this._postRender=new ye,this._minimumDisableDepthTestDistance=0,this._debugInspector=new kF,this._msaaSamples=g(e.msaaSamples,1),this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new ye,this.morphComplete=new ye,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=O.clone(O.BLACK),this._mode=ie.SCENE3D,this._mapProjection=l(e.mapProjection)?e.mapProjection:new Ri,this.morphTime=1,this.farToNearRatio=1e3,this.logarithmicDepthFarToNearRatio=1e9,this.nearToFarDistance2D=175e4,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this.debugShowFramesPerSecond=!1,this.debugShowDepthFrustum=1,this.debugShowFrustumPlanes=!1,this._debugShowFrustumPlanes=!1,this._debugFrustumPlanes=void 0,this.useDepthPicking=!0,this.pickTranslucentDepth=!1,this.cameraEventWaitTime=500,this.atmosphere=new Gw,this.fog=new Yw,this._shadowMapCamera=new fo(this),this.shadowMap=new nb({context:s,lightCamera:this._shadowMapCamera,enabled:g(e.shadows,!1)}),this.invertClassification=!1,this.invertClassificationColor=O.clone(O.WHITE),this._actualInvertClassificationColor=O.clone(this._invertClassificationColor),this._invertClassification=new vV,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new EF,this._brdfLutGenerator=new Iw,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new FF(this),this._cameraUnderground=!1,this._mapMode2D=g(e.mapMode2D,Ol.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=g(e.requestRenderMode,!1),this._renderRequested=!0,this.maximumRenderTimeChange=g(e.maximumRenderTimeChange,0),this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=Ha.requestCompletedEvent.addEventListener(MD(this)),this._removeTaskProcessorListenerCallback=gi.taskCompletedEvent.addEventListener(MD(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new De(0,0,s.drawingBufferWidth,s.drawingBufferHeight),c=new fo(this);this._logDepthBuffer&&(c.frustum.near=.1,c.frustum.far=1e10),this.preloadFlightCamera=new fo(this),this.preloadFlightCullingVolume=void 0,this._picking=new aF(this),this._defaultView=new RT(this,c,a),this._view=this._defaultView,this._hdr=void 0,this._hdrDirty=void 0,this.highDynamicRange=!1,this.gamma=2.2,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this._specularEnvironmentMapAtlas=void 0,this.light=new D0,Vxe(this,0,te.now()),this.updateFrameState(),this.initializeFrame()}function Nht(e,t){for(let i=0;i<e._removeGlobeCallbacks.length;++i)e._removeGlobeCallbacks[i]();e._removeGlobeCallbacks.length=0;let n=[];l(t)&&(n.push(t.imageryLayersUpdatedEvent.addEventListener(MD(e))),n.push(t.terrainProviderChanged.addEventListener(MD(e))),n.push(t.tileLoadProgressEvent.addEventListener(()=>{e._globeHeightDirty=!0}))),e._removeGlobeCallbacks=n}Object.defineProperties(vi.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 Yt.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return Yt.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}},specularEnvironmentMapsSupported:{get:function(){return Rm.isSupported(this._context)}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e,Nht(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}},view:{get:function(){return this._view},set:function(e){this._view=e}},defaultView:{get:function(){return this._defaultView}},picking:{get:function(){return this._picking}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},jobScheduler:{get:function(){return this._jobScheduler}},frameState:{get:function(){return this._frameState}},environmentState:{get:function(){return this._environmentState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){if(l(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(l(this.globe))return this.globe.terrainProvider},set:function(e){this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),l(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(l(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===ie.SCENE2D?this.morphTo2D(0):e===ie.SCENE3D?this.morphTo3D(0):e===ie.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=e}},frustumCommandsList:{get:function(){return this._view.frustumCommandsList}},numberOfFrustums:{get:function(){return this._view.frustumCommandsList.length}},useWebVR:{get:function(){return this._useWebVR},set:function(e){this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new fo(this),l(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new Ow(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}},splitPosition:{get:function(){return this._frameState.splitPosition},set:function(e){this._frameState.splitPosition=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)}},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){let t=this._context,n=e&&t.depthTexture&&(t.colorBufferFloat||t.colorBufferHalfFloat);this._hdrDirty=n!==this._hdr,this._hdr=n}},highDynamicRangeSupported:{get:function(){let e=this._context;return e.depthTexture&&(e.colorBufferFloat||e.colorBufferHalfFloat)}},cameraUnderground:{get:function(){return this._cameraUnderground}},msaaSamples:{get:function(){return this._msaaSamples},set:function(e){e=Math.min(e,Yt.maximumSamples),this._msaaSamples=e}},msaaSupported:{get:function(){return this._context.msaa}},pixelRatio:{get:function(){return this._frameState.pixelRatio},set:function(e){this._frameState.pixelRatio=e}},opaqueFrustumNearOffset:{get:function(){return .9999}},globeHeight:{get:function(){return this._globeHeight}}});vi.prototype.getCompressedTextureFormatSupported=function(e){let t=this.context;return(e==="WEBGL_compressed_texture_s3tc"||e==="s3tc")&&t.s3tc||(e==="WEBGL_compressed_texture_pvrtc"||e==="pvrtc")&&t.pvrtc||(e==="WEBGL_compressed_texture_etc"||e==="etc")&&t.etc||(e==="WEBGL_compressed_texture_etc1"||e==="etc1")&&t.etc1||(e==="WEBGL_compressed_texture_astc"||e==="astc")&&t.astc||(e==="EXT_texture_compression_bptc"||e==="bc7")&&t.bc7};function Txe(e,t,n){let i=e._frameState,o=e._context,r=e._view.oit,s=i.shadowState.lightShadowMaps,a=i.shadowState.lightShadowsEnabled,c=t.derivedCommands;l(t.pickId)&&(c.picking=q0.createPickDerivedCommand(e,t,o,c.picking)),t.pickOnly||(c.depth=q0.createDepthOnlyDerivedCommand(e,t,o,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=q0.createHdrCommand(t,o,c.hdr),t=c.hdr.command,c=t.derivedCommands),a&&t.receiveShadows&&(c.shadows=nb.createReceiveDerivedCommand(s,t,n,o,c.shadows)),t.pass===Ve.TRANSLUCENT&&l(r)&&r.isSupported()&&(a&&t.receiveShadows?(c.oit=l(c.oit)?c.oit:{},c.oit.shadows=r.createDerivedCommands(c.shadows.receiveCommand,o,c.oit.shadows)):c.oit=r.createDerivedCommands(t,o,c.oit))}vi.prototype.updateDerivedCommands=function(e){if(!l(e.derivedCommands))return;let t=this._frameState,n=this._context,i=!1,o=t.shadowState.lastDirtyTime;e.lastDirtyTime!==o&&(e.lastDirtyTime=o,e.dirty=!0,i=!0);let r=t.useLogDepth,s=this._hdr,a=e.derivedCommands,c=l(a.logDepth),d=l(a.hdr),u=l(a.originalCommand),m=r&&!c,p=s&&!d,y=(!r||!s)&&!u;if(e.dirty=e.dirty||m||p||y,e.dirty){e.dirty=!1;let f=t.shadowState.shadowMaps;t.shadowState.shadowsEnabled&&e.castShadows&&(a.shadows=nb.createCastDerivedCommand(f,e,i,n,a.shadows)),(c||m)&&(a.logDepth=q0.createLogDepthCommand(e,n,a.logDepth),Txe(this,a.logDepth.command,i)),(u||y)&&Txe(this,e,i)}};var Uht=new em({pass:wo.RENDER}),cj=new em({pass:wo.PRELOAD}),lj=new em({pass:wo.PRELOAD_FLIGHT}),kht=new em({pass:wo.REQUEST_RENDER_MODE_DEFER_CHECK}),Sxe=new ce,dj;function Dht(e){let t=e.globe;if(e._mode===ie.SCENE3D&&l(t)&&t.show&&!e._cameraUnderground&&!e._globeTranslucencyState.translucent){let n=t.ellipsoid,i=e.frameState.minimumTerrainHeight;return Sxe.radius=n.minimumRadius+i,dj=Rw.fromBoundingSphere(Sxe,e.camera.positionWC,dj),dj}}vi.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function Vxe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=te.clone(n,i.time)}vi.prototype.updateFrameState=function(){let e=this.camera,t=this._frameState;t.commandList.length=0,t.shadowMaps.length=0,t.brdfLutGenerator=this._brdfLutGenerator,t.environmentMap=this.skyBox&&this.skyBox._cubeMap,t.mode=this._mode,t.morphTime=this.morphTime,t.mapProjection=this.mapProjection,t.camera=e,t.cullingVolume=e.frustum.computeCullingVolume(e.positionWC,e.directionWC,e.upWC),t.occluder=Dht(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof rn||this.camera.frustum instanceof Vr),t.light=this.light,t.cameraUnderground=this._cameraUnderground,t.globeTranslucencyState=this._globeTranslucencyState;let{globe:n}=this;l(n)&&n._terrainExaggerationChanged&&(this.verticalExaggeration=n._terrainExaggeration,this.verticalExaggerationRelativeHeight=n._terrainExaggerationRelativeHeight,n._terrainExaggerationChanged=!1),t.verticalExaggeration=this.verticalExaggeration,t.verticalExaggerationRelativeHeight=this.verticalExaggerationRelativeHeight,l(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.ready?(t.specularEnvironmentMaps=this._specularEnvironmentMapAtlas.texture,t.specularEnvironmentMapsMaximumLOD=this._specularEnvironmentMapAtlas.maximumMipmapLevel):(t.specularEnvironmentMaps=void 0,t.specularEnvironmentMapsMaximumLOD=void 0),t.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,this._actualInvertClassificationColor=O.clone(this.invertClassificationColor,this._actualInvertClassificationColor),vV.isTranslucencySupported(this._context)||(this._actualInvertClassificationColor.alpha=1),t.invertClassificationColor=this._actualInvertClassificationColor,l(this.globe)?t.maximumScreenSpaceError=this.globe.maximumScreenSpaceError:t.maximumScreenSpaceError=2,this.clearPasses(t.passes),t.tilesetPassState=void 0};vi.prototype.isVisible=function(e,t,n){return l(e)&&(!l(e.boundingVolume)||!e.cull||t.computeVisibility(e.boundingVolume)!==nn.OUTSIDE&&(!l(n)||!e.occlude||!e.boundingVolume.isOccluded(n)))};var AD=new A(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);AD=A.inverseTransformation(AD,AD);function Bht(e,t,n,i){let o=t._frameState,r=o.context,s=e.boundingVolume;l(t._debugVolume)&&t._debugVolume.destroy();let a,c=h.clone(s.center);if(o.mode!==ie.SCENE3D){c=A.multiplyByPoint(AD,c,c);let p=o.mapProjection,y=p.unproject(c);c=p.ellipsoid.cartographicToCartesian(y)}if(l(s.radius)){let p=s.radius;a=Mn.toWireframe(Ds.createGeometry(new Ds({radii:new h(p,p,p),vertexFormat:cn.FLAT_VERTEX_FORMAT}))),t._debugVolume=new En({geometryInstances:new St({geometry:a,modelMatrix:A.fromTranslation(c),attributes:{color:new Ot(1,0,0,1)}}),appearance:new cn({flat:!0,translucent:!1}),asynchronous:!1})}else{let p=s.halfAxes;a=Mn.toWireframe(pl.createGeometry(pl.fromDimensions({dimensions:new h(2,2,2),vertexFormat:cn.FLAT_VERTEX_FORMAT}))),t._debugVolume=new En({geometryInstances:new St({geometry:a,modelMatrix:A.fromRotationTranslation(p,c,new A),attributes:{color:new Ot(1,0,0,1)}}),appearance:new cn({flat:!0,translucent:!1}),asynchronous:!1})}let d=o.commandList,u=o.commandList=[];t._debugVolume.update(o),e=u[0],o.useLogDepth&&(e=q0.createLogDepthCommand(e,r).command);let m;l(i)&&(m=n.framebuffer,n.framebuffer=i),e.execute(r,n),l(m)&&(n.framebuffer=m),o.commandList=d}function Ma(e,t,n,i,o){let r=t._frameState;if(l(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof ai){e.execute(n,i);return}e.debugShowBoundingVolume&&l(e.boundingVolume)&&Bht(e,t,i,o),r.useLogDepth&&l(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let s=r.passes;if(!s.pick&&!s.depth&&t._hdr&&l(e.derivedCommands)&&l(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),s.pick||s.depth){if(s.pick&&!s.depth&&l(e.derivedCommands.picking)){e=e.derivedCommands.picking.pickCommand,e.execute(n,i);return}else if(l(e.derivedCommands.depth)){e=e.derivedCommands.depth.depthOnlyCommand,e.execute(n,i);return}}if(t.debugShowCommands||t.debugShowFrustums){t._debugInspector.executeDebugShowFrustumsCommand(t,e,i);return}r.shadowState.lightShadowsEnabled&&e.receiveShadows&&l(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(n,i):e.execute(n,i)}function DF(e,t,n,i){let o=t._frameState,r=e.derivedCommands;l(r)&&(o.useLogDepth&&l(r.logDepth)&&(e=r.logDepth.command),r=e.derivedCommands,l(r.picking)?(e=r.picking.pickCommand,e.execute(n,i)):l(r.depth)&&(e=r.depth.depthOnlyCommand,e.execute(n,i)))}function Lxe(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}function Oht(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+W.EPSILON12}function Yht(e,t,n,i,o){let r=e.context;j0(i,Lxe,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,r,n);let s=i.length;for(let a=0;a<s;++a)t(i[a],e,r,n)}function Hht(e,t,n,i,o){let r=e.context;j0(i,Oht,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,r,n);let s=i.length;for(let a=0;a<s;++a)t(i[a],e,r,n)}function Kht(e,t,n,i){let o=e.context;j0(i,Lxe,e.camera.positionWC);let r=i.length;for(let s=0;s<r;++s)t(i[s],e,o,n)}var zht=new Li,Jht=new nl,Qht=new rn,jht=new Vr;function mj(e,t){let n=e.camera,i=e.context,o=e.frameState,r=i.uniformState;r.updateCamera(n);let s;l(n.frustum.fov)?s=n.frustum.clone(zht):l(n.frustum.infiniteProjectionMatrix)?s=n.frustum.clone(Jht):l(n.frustum.width)?s=n.frustum.clone(Qht):s=n.frustum.clone(jht),s.near=n.frustum.near,s.far=n.frustum.far,r.updateFrustum(s),r.updatePass(Ve.ENVIRONMENT);let a=o.passes,c=a.pick,d=e._environmentState,u=e._view,m=d.renderTranslucentDepthForPick,p=d.useWebVR;if(!c){let R=d.skyBoxCommand;if(l(R)&&Ma(R,e,i,t),d.isSkyAtmosphereVisible&&Ma(d.skyAtmosphereCommand,e,i,t),d.isSunVisible&&(d.sunDrawCommand.execute(i,t),e.sunBloom&&!p)){let E;d.useGlobeDepthFramebuffer?E=u.globeDepth.framebuffer:d.usePostProcess?E=u.sceneFramebuffer.framebuffer:E=d.originalFramebuffer,e._sunPostProcess.execute(i),e._sunPostProcess.copy(i,E),t.framebuffer=E}d.isMoonVisible&&d.moonCommand.execute(i,t)}let y;d.useOIT?(l(e._executeOITFunction)||(e._executeOITFunction=function(R,E,X,w,N){u.globeDepth.prepareColorTextures(i),u.oit.executeCommands(R,E,X,w,N)}),y=e._executeOITFunction):a.render?y=Yht:y=Hht;let f=u.frustumCommandsList,x=f.length,_=d.clearGlobeDepth,C=d.useDepthPlane,V=e._globeTranslucencyState,L=V.translucent,Z=e._view.globeTranslucencyFramebuffer,G=e._depthClearCommand,I=e._stencilClearCommand,P=e._classificationStencilClearCommand,v=e._depthPlane,F=d.usePostProcessSelected,M=n.position.z,b;for(let R=0;R<x;++R){let E=x-R-1,X=f[E];e.mode===ie.SCENE2D?(n.position.z=M-X.near+1,s.far=Math.max(1,X.far-X.near),s.near=1,r.update(o),r.updateFrustum(s)):(s.near=E!==0?X.near*e.opaqueFrustumNearOffset:X.near,s.far=X.far,r.updateFrustum(s)),G.execute(i,t),i.stencilBuffer&&I.execute(i,t),r.updatePass(Ve.GLOBE);let w=X.commands[Ve.GLOBE],N=X.indices[Ve.GLOBE];if(L)V.executeGlobeCommands(X,Ma,Z,e,t);else for(b=0;b<N;++b)Ma(w[b],e,i,t);let D=u.globeDepth;if(l(D)&&d.useGlobeDepthFramebuffer&&D.executeCopyDepth(i,t),!d.renderTranslucentDepthForPick)if(r.updatePass(Ve.TERRAIN_CLASSIFICATION),w=X.commands[Ve.TERRAIN_CLASSIFICATION],N=X.indices[Ve.TERRAIN_CLASSIFICATION],L)V.executeGlobeClassificationCommands(X,Ma,Z,e,t);else for(b=0;b<N;++b)Ma(w[b],e,i,t);if(_&&(G.execute(i,t),C&&v.execute(i,t)),!d.useInvertClassification||c||d.renderTranslucentDepthForPick){for(r.updatePass(Ve.CESIUM_3D_TILE),w=X.commands[Ve.CESIUM_3D_TILE],N=X.indices[Ve.CESIUM_3D_TILE],b=0;b<N;++b)Ma(w[b],e,i,t);if(N>0&&(l(D)&&d.useGlobeDepthFramebuffer&&(D.prepareColorTextures(i,_),D.executeUpdateDepth(i,t,_,D.depthStencilTexture)),!d.renderTranslucentDepthForPick))for(r.updatePass(Ve.CESIUM_3D_TILE_CLASSIFICATION),w=X.commands[Ve.CESIUM_3D_TILE_CLASSIFICATION],N=X.indices[Ve.CESIUM_3D_TILE_CLASSIFICATION],b=0;b<N;++b)Ma(w[b],e,i,t)}else{e._invertClassification.clear(i,t);let J=t.framebuffer;for(t.framebuffer=e._invertClassification._fbo.framebuffer,r.updatePass(Ve.CESIUM_3D_TILE),w=X.commands[Ve.CESIUM_3D_TILE],N=X.indices[Ve.CESIUM_3D_TILE],b=0;b<N;++b)Ma(w[b],e,i,t);for(l(D)&&d.useGlobeDepthFramebuffer&&(e._invertClassification.prepareTextures(i),D.executeUpdateDepth(i,t,_,e._invertClassification._fbo.getDepthStencilTexture())),r.updatePass(Ve.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),w=X.commands[Ve.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],N=X.indices[Ve.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],b=0;b<N;++b)Ma(w[b],e,i,t);for(t.framebuffer=J,e._invertClassification.executeClassified(i,t),o.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),N>0&&i.stencilBuffer&&P.execute(i,t),r.updatePass(Ve.CESIUM_3D_TILE_CLASSIFICATION),w=X.commands[Ve.CESIUM_3D_TILE_CLASSIFICATION],N=X.indices[Ve.CESIUM_3D_TILE_CLASSIFICATION],b=0;b<N;++b)Ma(w[b],e,i,t)}for(N>0&&i.stencilBuffer&&I.execute(i,t),r.updatePass(Ve.VOXELS),w=X.commands[Ve.VOXELS],N=X.indices[Ve.VOXELS],w.length=N,Kht(e,Ma,t,w),r.updatePass(Ve.OPAQUE),w=X.commands[Ve.OPAQUE],N=X.indices[Ve.OPAQUE],b=0;b<N;++b)Ma(w[b],e,i,t);E!==0&&e.mode!==ie.SCENE2D&&(s.near=X.near,r.updateFrustum(s));let k;if(!c&&d.useInvertClassification&&o.invertClassificationColor.alpha<1&&(k=e._invertClassification),r.updatePass(Ve.TRANSLUCENT),w=X.commands[Ve.TRANSLUCENT],w.length=X.indices[Ve.TRANSLUCENT],y(e,Ma,t,w,k),X.indices[Ve.CESIUM_3D_TILE_CLASSIFICATION]>0&&u.translucentTileClassification.isSupported()&&(u.translucentTileClassification.executeTranslucentCommands(e,Ma,t,w,D.depthStencilTexture),u.translucentTileClassification.executeClassificationCommands(e,Ma,t,X)),i.depthTexture&&e.useDepthPicking&&(d.useGlobeDepthFramebuffer||m)){let J=D.depthStencilTexture,K=e._picking.getPickDepth(e,E);K.update(i,J),K.executeCopyDepth(i,t)}if(c||!F)continue;let U=t.framebuffer;if(t.framebuffer=u.sceneFramebuffer.getIdFramebuffer(),s.near=E!==0?X.near*e.opaqueFrustumNearOffset:X.near,s.far=X.far,r.updateFrustum(s),r.updatePass(Ve.GLOBE),w=X.commands[Ve.GLOBE],N=X.indices[Ve.GLOBE],L)V.executeGlobeCommands(X,DF,Z,e,t);else for(b=0;b<N;++b)DF(w[b],e,i,t);for(_&&(G.framebuffer=t.framebuffer,G.execute(i,t),G.framebuffer=void 0),_&&C&&v.execute(i,t),r.updatePass(Ve.CESIUM_3D_TILE),w=X.commands[Ve.CESIUM_3D_TILE],N=X.indices[Ve.CESIUM_3D_TILE],b=0;b<N;++b)DF(w[b],e,i,t);for(r.updatePass(Ve.OPAQUE),w=X.commands[Ve.OPAQUE],N=X.indices[Ve.OPAQUE],b=0;b<N;++b)DF(w[b],e,i,t);for(r.updatePass(Ve.TRANSLUCENT),w=X.commands[Ve.TRANSLUCENT],N=X.indices[Ve.TRANSLUCENT],b=0;b<N;++b)DF(w[b],e,i,t);t.framebuffer=U}}function Rxe(e){e.context.uniformState.updatePass(Ve.COMPUTE);let n=e._environmentState.sunComputeCommand;l(n)&&n.execute(e._computeEngine);let i=e._computeCommandList,o=i.length;for(let r=0;r<o;++r)i[r].execute(e._computeEngine)}function qht(e,t){e.context.uniformState.updatePass(Ve.OVERLAY);let i=e.context,o=e._overlayCommandList,r=o.length;for(let s=0;s<r;++s)o[s].execute(i,t)}function $ht(e,t,n){let i=n.shadowMapCullingVolume,o=n.isPointLight,r=n.passes,s=r.length,a=t.length;for(let c=0;c<a;++c){let d=t[c];if(e.updateDerivedCommands(d),d.castShadows&&(d.pass===Ve.GLOBE||d.pass===Ve.CESIUM_3D_TILE||d.pass===Ve.OPAQUE||d.pass===Ve.TRANSLUCENT)&&e.isVisible(d,i))if(o)for(let u=0;u<s;++u)r[u].commandList.push(d);else if(s===1)r[0].commandList.push(d);else{let u=!1;for(let m=s-1;m>=0;--m){let p=r[m].cullingVolume;if(e.isVisible(d,p))r[m].commandList.push(d),u=!0;else if(u)break}}}}function Zxe(e){let t=e.frameState,n=t.shadowState.shadowMaps,i=n.length;if(!t.shadowState.shadowsEnabled)return;let o=e.context,r=o.uniformState;for(let s=0;s<i;++s){let a=n[s];if(a.outOfView)continue;let c=a.passes,d=c.length;for(let m=0;m<d;++m)c[m].commandList.length=0;let u=e.frameState.commandList;$ht(e,u,a);for(let m=0;m<d;++m){let p=a.passes[m];r.updateCamera(p.camera),a.updatePass(o,m);let y=p.commandList.length;for(let f=0;f<y;++f){let x=p.commandList[f];r.updatePass(x.pass),Ma(x.derivedCommands.shadows.castCommands[s],e,o,p.passState)}}}}var eft=new h;vi.prototype.updateAndExecuteCommands=function(e,t){let i=this._frameState.mode;this._environmentState.useWebVR?tft(this,e,t):i!==ie.SCENE2D||this._mapMode2D===Ol.ROTATE?(nft(this,e),pg(!0,this,e,t)):(hj(this,e,t),uft(this,e))};function tft(e,t,n){let i=e._view,o=i.camera,s=e._environmentState.renderTranslucentDepthForPick;hj(e,t,n),Gxe(e),i.createPotentiallyVisibleSet(e),Rxe(e),s||Zxe(e);let a=t.viewport;a.x=0,a.y=0,a.width=a.width*.5;let c=fo.clone(o,e._cameraVR);c.frustum=o.frustum;let d=o.frustum.near,u=d*g(e.focalLength,5),m=g(e.eyeSeparation,u/30),p=h.multiplyByScalar(c.right,m*.5,eft);o.frustum.aspectRatio=a.width/a.height;let y=.5*m*d/u;h.add(c.position,p,o.position),o.frustum.xOffset=y,mj(e,t),a.x=a.width,h.subtract(c.position,p,o.position),o.frustum.xOffset=-y,mj(e,t),fo.clone(c,o)}function nft(e,t){let n=t.viewport;n.x!==0&&(n.width=n.width*2,n.x=0)}var ift=new he(Math.PI,W.PI_OVER_TWO),oft=new h,rft=new h,sft=new A,aft=new A,cft=new h,lft=new h,dft=new De;function uft(e,t){let n=e.context,i=e.frameState,o=e.camera,r=t.viewport,s=De.clone(r,dft);t.viewport=s;let a=ift,c=oft;e.mapProjection.project(a,c);let u=h.clone(o.position,rft),m=A.clone(o.transform,aft),p=o.frustum.clone();o._setTransform(A.IDENTITY);let y=A.computeViewportTransformation(s,0,1,sft),f=o.frustum.projectionMatrix,x=o.positionWC.y,_=h.fromElements(W.sign(x)*c.x-x,0,-o.positionWC.x,cft),C=Xt.pointToGLWindowCoordinates(f,y,_,lft);C.x=Math.floor(C.x);let V=s.x,L=s.width;if(x===0||C.x<=V||C.x>=V+L)pg(!0,e,t);else if(Math.abs(V+L*.5-C.x)<1)s.width=C.x-s.x,o.position.x*=W.sign(o.position.x),o.frustum.right=0,i.cullingVolume=o.frustum.computeCullingVolume(o.positionWC,o.directionWC,o.upWC),n.uniformState.update(i),pg(!0,e,t),s.x=C.x,o.position.x=-o.position.x,o.frustum.right=-o.frustum.left,o.frustum.left=0,i.cullingVolume=o.frustum.computeCullingVolume(o.positionWC,o.directionWC,o.upWC),n.uniformState.update(i),pg(!1,e,t);else if(C.x>V+L*.5){s.width=C.x-V;let Z=o.frustum.right;o.frustum.right=c.x-x,i.cullingVolume=o.frustum.computeCullingVolume(o.positionWC,o.directionWC,o.upWC),n.uniformState.update(i),pg(!0,e,t),s.x=C.x,s.width=V+L-C.x,o.position.x=-o.position.x,o.frustum.left=-o.frustum.right,o.frustum.right=Z-o.frustum.right*2,i.cullingVolume=o.frustum.computeCullingVolume(o.positionWC,o.directionWC,o.upWC),n.uniformState.update(i),pg(!1,e,t)}else{s.x=C.x,s.width=V+L-C.x;let Z=o.frustum.left;o.frustum.left=-c.x-x,i.cullingVolume=o.frustum.computeCullingVolume(o.positionWC,o.directionWC,o.upWC),n.uniformState.update(i),pg(!0,e,t),s.x=V,s.width=C.x-V,o.position.x=-o.position.x,o.frustum.right=-o.frustum.left,o.frustum.left=Z-o.frustum.left*2,i.cullingVolume=o.frustum.computeCullingVolume(o.positionWC,o.directionWC,o.upWC),n.uniformState.update(i),pg(!1,e,t)}o._setTransform(m),h.clone(u,o.position),o.frustum=p.clone(),t.viewport=r}function pg(e,t,n,i){let o=t._environmentState,r=t._view,s=o.renderTranslucentDepthForPick;e||(t.frameState.commandList.length=0),Gxe(t),r.createPotentiallyVisibleSet(t),e&&(l(i)&&hj(t,n,i),Rxe(t),s||Zxe(t)),mj(t,n)}var Cxe=new as;vi.prototype.updateEnvironment=function(){let e=this._frameState,t=this._view,n=this._environmentState,i=e.passes.render,o=e.passes.offscreen,r=this.atmosphere,s=this.skyAtmosphere,a=this.globe,c=this._globeTranslucencyState;if(!i||this._mode!==ie.SCENE2D&&t.camera.frustum instanceof rn||!c.environmentVisible)n.skyAtmosphereCommand=void 0,n.skyBoxCommand=void 0,n.sunDrawCommand=void 0,n.sunComputeCommand=void 0,n.moonCommand=void 0;else{if(l(s)){if(l(a))s.setDynamicLighting(bT.fromGlobeFlags(a)),n.isReadyForAtmosphere=n.isReadyForAtmosphere||!a.show||a._surface._tilesToRender.length>0;else{let C=r.dynamicLighting;s.setDynamicLighting(C),n.isReadyForAtmosphere=!0}n.skyAtmosphereCommand=s.update(e,a),l(n.skyAtmosphereCommand)&&this.updateDerivedCommands(n.skyAtmosphereCommand)}else n.skyAtmosphereCommand=void 0;n.skyBoxCommand=l(this.skyBox)?this.skyBox.update(e,this._hdr):void 0;let _=l(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=l(_)?_.drawCommand:void 0,n.sunComputeCommand=l(_)?_.computeCommand:void 0,n.moonCommand=l(this.moon)?this.moon.update(e):void 0}let d=n.clearGlobeDepth=l(a)&&a.show&&(!a.depthTestAgainstTerrain||this.mode===ie.SCENE2D);(n.useDepthPlane=d&&this.mode===ie.SCENE3D&&c.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==ie.SCENE2D&&!o;let m=e.mode===ie.SCENE3D&&!c.sunVisibleThroughGlobe?e.occluder:void 0,p=e.cullingVolume,y=Cxe.planes;for(let _=0;_<5;++_)y[_]=p.planes[_];p=Cxe,n.isSkyAtmosphereVisible=l(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(n.sunDrawCommand,p,m),n.isMoonVisible=this.isVisible(n.moonCommand,p,m);let f=this.specularEnvironmentMaps,x=this._specularEnvironmentMapAtlas;l(f)&&(!l(x)||x.url!==f)?(x=x&&x.destroy(),this._specularEnvironmentMapAtlas=new Rm(f)):!l(f)&&l(x)&&(x.destroy(),this._specularEnvironmentMapAtlas=void 0),l(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.update(e)};function mft(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new Uf({camera:e.camera,updateOnChange:!1,frustumSplits:t.frustumSplits}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),l(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function hft(e){let t=e._frameState,n=t.shadowMaps,i=n.length,o=i>0&&!t.passes.pick&&e.mode===ie.SCENE3D;if(o!==t.shadowState.shadowsEnabled&&(++t.shadowState.lastDirtyTime,t.shadowState.shadowsEnabled=o),t.shadowState.lightShadowsEnabled=!1,!!o){for(let r=0;r<i;++r)if(n[r]!==t.shadowState.shadowMaps[r]){++t.shadowState.lastDirtyTime;break}t.shadowState.shadowMaps.length=0,t.shadowState.lightShadowMaps.length=0;for(let r=0;r<i;++r){let s=n[r];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 Gxe(e){let t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),mft(e),hft(e),e._globe&&e._globe.render(t)}function hj(e,t,n){let i=e._context,o=e._frameState,r=e._environmentState,s=e._view,c=e._frameState.passes.pick;l(s.globeDepth)&&(s.globeDepth.picking=c);let d=r.useWebVR;r.originalFramebuffer=t.framebuffer,l(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!d?e._sunPostProcess=new NF:l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!l(e.sun)&&l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);let u=e._clearColorCommand;O.clone(n,u.color),u.execute(i,t);let m=r.useGlobeDepthFramebuffer=l(s.globeDepth);m&&(s.globeDepth.update(i,t,s.viewport,e.msaaSamples,e._hdr,r.clearGlobeDepth),s.globeDepth.clear(i,t,n));let p=s.oit,y=r.useOIT=!c&&l(p)&&p.isSupported();y&&(p.update(i,t,s.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),p.clear(i,t,n),r.useOIT=p.isSupported());let f=e.postProcessStages,x=r.usePostProcess=!c&&(e._hdr||f.length>0||f.ambientOcclusion.enabled||f.fxaa.enabled||f.bloom.enabled);if(r.usePostProcessSelected=!1,x&&(s.sceneFramebuffer.update(i,s.viewport,e._hdr,e.msaaSamples),s.sceneFramebuffer.clear(i,t,n),f.update(i,o.useLogDepth,e._hdr),f.clear(i),x=r.usePostProcess=f.ready,r.usePostProcessSelected=x&&f.hasSelected),r.isSunVisible&&e.sunBloom&&!d?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):m?t.framebuffer=s.globeDepth.framebuffer:x&&(t.framebuffer=s.sceneFramebuffer.framebuffer),l(t.framebuffer)&&u.execute(i,t),r.useInvertClassification=!c&&l(t.framebuffer)&&e.invertClassification){let C;if(e.frameState.invertClassificationColor.alpha===1&&r.useGlobeDepthFramebuffer&&(C=s.globeDepth.framebuffer),l(C)||i.depthTexture){if(e._invertClassification.previousFramebuffer=C,e._invertClassification.update(i,e.msaaSamples,s.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),e.frameState.invertClassificationColor.alpha<1&&y){let V=e._invertClassification.unclassifiedCommand,L=V.derivedCommands;L.oit=p.createDerivedCommands(V,i,L.oit)}}else r.useInvertClassification=!1}e._globeTranslucencyState.translucent&&s.globeTranslucencyFramebuffer.updateAndClear(e._hdr,s.viewport,i,t)}vi.prototype.resolveFramebuffers=function(e){let t=this._context,n=this._environmentState,i=this._view,o=i.globeDepth;l(o)&&o.prepareColorTextures(t);let r=n.useOIT,s=n.useGlobeDepthFramebuffer,a=n.usePostProcess,c=n.originalFramebuffer,d=s?o.colorFramebufferManager:void 0,u=i.sceneFramebuffer._colorFramebuffer,m=i.sceneFramebuffer.idFramebuffer;r&&(e.framebuffer=a?u.framebuffer:c,i.oit.execute(t,e));let p=i.translucentTileClassification;if(p.hasTranslucentDepth&&p.isSupported()&&p.execute(this,e),a){i.sceneFramebuffer.prepareColorTextures(t);let y=u;s&&!r&&(y=d);let f=this.postProcessStages,x=y.getColorTexture(0),_=m.getColorTexture(0),C=g(d,u).getDepthStencilTexture();f.execute(t,x,C,_),f.copy(t,c)}!r&&!a&&s&&(e.framebuffer=c,o.executeCopyColor(t,e))};function fft(e){let t=e._frameState.afterRender;for(let n=0,i=t.length;n<i;++n)t[n]()&&e.requestRender();t.length=0}function pft(e){if(e.mode===ie.MORPHING)return;let n=e.camera.positionCartographic;return e.getHeight(n)}vi.prototype.getHeight=function(e,t){if(!l(e))return;let n=t===Qe.CLAMP_TO_TERRAIN||t===Qe.RELATIVE_TO_TERRAIN,i=t===Qe.CLAMP_TO_3D_TILE||t===Qe.RELATIVE_TO_3D_TILE;if(!l(e))return;let o=Number.NEGATIVE_INFINITY;if(!n){let s=this.primitives.length;for(let a=0;a<s;++a){let c=this.primitives.get(a);if(!c.isCesium3DTileset||!c.show||c.disableCollision)continue;let d=c.getHeight(e,this);l(d)&&d>o&&(o=d)}}let r=this._globe;if(!i&&l(r)&&r.show){let s=r.getHeight(e);s>o&&(o=s)}if(o>Number.NEGATIVE_INFINITY)return o};var uj=new he;vi.prototype.updateHeight=function(e,t,n){let i=()=>{he.clone(e,uj);let y=this.getHeight(e,n);l(y)&&(uj.height=y,t(uj))},o=n===Qe.CLAMP_TO_TERRAIN||n===Qe.RELATIVE_TO_TERRAIN,r=n===Qe.CLAMP_TO_3D_TILE||n===Qe.RELATIVE_TO_3D_TILE,s;!r&&l(this.globe)&&(s=this.globe._surface.updateHeight(e,i));let a={},c=this.globe?.ellipsoid,d=y=>{if(o||!y.isCesium3DTileset||y.disableCollision)return;let f=y.updateHeight(e,i,c);a[y.id]=f};if(!o){let y=this.primitives.length;for(let f=0;f<y;++f){let x=this.primitives.get(f);d(x)}}let u=this.primitives.primitiveAdded.addEventListener(d),m=this.primitives.primitiveRemoved.addEventListener(y=>{y.isCesium3DTileset&&(a[y.id](),delete a[y.id])});return()=>{s=s&&s(),Object.values(a).forEach(y=>y()),a={},u(),m()}};function bft(e){let t=e.camera,n=e._mode,i=e._screenSpaceCameraController,o=t.positionCartographic;if(!l(o))return!1;if(!i.onMap()&&o.height<0)return!0;if(n===ie.SCENE2D||n===ie.MORPHING)return!1;let r=e._globeHeight;return l(r)&&o.height<r}vi.prototype.initializeFrame=function(){this._shaderFrameCount++===120&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._globeHeightDirty&&(this._globeHeight=pft(this),this._globeHeightDirty=!1),this._cameraUnderground=bft(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function yft(e,t){if(e.debugShowFramesPerSecond){if(!l(e._performanceDisplay)){let n=document.createElement("div");n.className="cesium-performanceDisplay-defaultContainer",e._canvas.parentNode.appendChild(n);let o=new $0({container:n});e._performanceDisplay=o,e._performanceContainer=n}e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)}else l(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}function gft(e){e._jobScheduler.resetBudgets();let t=e._frameState;e.primitives.prePassesUpdate(t),l(e.globe)&&e.globe.update(t),e._picking.update(),t.creditDisplay.update()}function xft(e){let t=e._frameState;e.primitives.postPassesUpdate(t),Ha.update()}var _ft=new O;function Tft(e){let t=e._frameState,n=e.context,i=n.uniformState,o=e._defaultView;e._view=o,e.updateFrameState(),t.passes.render=!0,t.passes.postProcess=e.postProcessStages.hasSelected,t.tilesetPassState=Uht;let r=g(e.backgroundColor,O.BLACK);e._hdr&&(r=O.clone(r,_ft),r.red=Math.pow(r.red,e.gamma),r.green=Math.pow(r.green,e.gamma),r.blue=Math.pow(r.blue,e.gamma)),t.backgroundColor=r,t.atmosphere=e.atmosphere,e.fog.update(t),i.update(t);let s=e.shadowMap;l(s)&&s.enabled&&(!l(e.light)||e.light instanceof D0?h.negate(i.sunDirectionWC,e._shadowMapCamera.direction):h.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(s)),e._computeCommandList.length=0,e._overlayCommandList.length=0;let a=o.viewport;a.x=0,a.y=0,a.width=n.drawingBufferWidth,a.height=n.drawingBufferHeight;let c=o.passState;c.framebuffer=void 0,c.blendingEnabled=void 0,c.scissorTest=void 0,c.viewport=De.clone(a,c.viewport),l(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(c,r),e.resolveFramebuffers(c),c.framebuffer=void 0,qht(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function FT(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function Sft(e){return e._picking.updateMostDetailedRayPicks(e)}vi.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,l(e)||(e=te.now());let n=this._view.checkForCameraUpdates(this);n&&(this._globeHeightDirty=!0);let i=!this.requestRenderMode||this._renderRequested||n||this._logDepthBufferDirty||this._hdrDirty||this.mode===ie.MORPHING;if(!i&&l(this.maximumRenderTimeChange)&&l(this._lastRenderTime)){let o=Math.abs(te.secondsDifference(this._lastRenderTime,e));i=i||o>this.maximumRenderTimeChange}if(i){this._lastRenderTime=te.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let o=W.incrementWrap(t.frameNumber,15e6,1);Vxe(this,o,e),t.newFrame=!0}FT(this,gft),this.primitives.show&&(FT(this,Sft),FT(this,Cft),FT(this,Vft),i||FT(this,Lft)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),FT(this,Tft)),yft(this,i),FT(this,xft),fft(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};vi.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};vi.prototype.requestRender=function(){this._renderRequested=!0};vi.prototype.clampLineWidth=function(e){return Math.max(Yt.minimumAliasedLineWidth,Math.min(e,Yt.maximumAliasedLineWidth))};vi.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n)};vi.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};vi.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};vi.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function Cft(e){let t=e._frameState;cj.camera=t.camera,cj.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,cj)}function Vft(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;lj.camera=e.preloadFlightCamera,lj.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,lj)}function Lft(e){e.primitives.updateForPass(e._frameState,kht)}vi.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};vi.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};vi.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};vi.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};vi.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};vi.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};vi.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};vi.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};vi.prototype.cartesianToCanvasCoordinates=function(e,t){return to.wgs84ToWindowCoordinates(this,e,t)};vi.prototype.completeMorph=function(){this._transitioner.completeMorph()};vi.prototype.morphTo2D=function(e){let t,n=this.globe;l(n)?t=n.ellipsoid:t=this.mapProjection.ellipsoid,e=g(e,2),this._transitioner.morphTo2D(e,t)};vi.prototype.morphToColumbusView=function(e){let t,n=this.globe;l(n)?t=n.ellipsoid:t=this.mapProjection.ellipsoid,e=g(e,2),this._transitioner.morphToColumbusView(e,t)};vi.prototype.morphTo3D=function(e){let t,n=this.globe;l(n)?t=n.ellipsoid:t=this.mapProjection.ellipsoid,e=g(e,2),this._transitioner.morphTo3D(e,t)};function Rft(e,t){if(e._removeTerrainProviderReadyListener=e._removeTerrainProviderReadyListener&&e._removeTerrainProviderReadyListener(),t.ready){l(e.globe)&&(e.globe.terrainProvider=t.provider);return}e.globe.terrainProvider=void 0,e._removeTerrainProviderReadyListener=t.readyEvent.addEventListener(n=>{l(e)&&l(e.globe)&&(e.globe.terrainProvider=n),e._removeTerrainProviderReadyListener()})}vi.prototype.setTerrain=function(e){return Rft(this,e),e};vi.prototype.isDestroyed=function(){return!1};vi.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._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),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._picking=this._picking&&this._picking.destroy(),this._defaultView=this._defaultView&&this._defaultView.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(),l(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),this._removeRequestListenerCallback(),this._removeTaskProcessorListenerCallback();for(let e=0;e<this._removeGlobeCallbacks.length;++e)this._removeGlobeCallbacks[e]();return this._removeGlobeCallbacks.length=0,ue(this)};var BF=vi;var C9i=T(S(),1);function NV(e){e=g(e,oe.WGS84),this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=h.multiplyByScalar(e.radii,t,new h);this._scaleMatrix=A.fromScale(n),this._modelMatrix=new A,this._command=new nt({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new h(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new h(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new h;let i=new h;i.x=e.maximumRadius*t,i.y=e.maximumRadius,i.z=0,this._radiiAndDynamicAtmosphereColor=i;let o=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return o._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return o._hueSaturationBrightness.x=o.hueShift,o._hueSaturationBrightness.y=o.saturationShift,o._hueSaturationBrightness.z=o.brightnessShift,o._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return o.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return o.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return o.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return o.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return o.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return o.atmosphereMieAnisotropy}}}Object.defineProperties(NV.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});NV.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var fj=new A;NV.prototype.update=function(e,t){if(!this.show)return;let n=e.mode;if(n!==ie.SCENE3D&&n!==ie.MORPHING||!e.passes.render)return;let i=A.fromRotationTranslation(e.context.uniformState.inverseViewRotation,h.ZERO,fj),o=A.multiplyTransformation(i,Wo.Y_UP_TO_Z_UP,fj),r=A.multiply(this._scaleMatrix,o,fj);A.clone(r,this._modelMatrix);let s=e.context,a=Zft(this),c=e.globeTranslucencyState.translucent,d=this.perFragmentAtmosphere||c||!l(t)||!t.show,u=this._command;if(!l(u.vertexArray)){let p=Ds.createGeometry(new Ds({radii:new h(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:Pe.POSITION_ONLY}));u.vertexArray=oi.fromGeometry({context:s,geometry:p,attributeLocations:Mn.createAttributeLocations(p),bufferUsage:Ue.STATIC_DRAW}),u.renderState=ke.fromCache({cull:{enabled:!0,face:yi.FRONT},blending:mn.ALPHA_BLEND,depthMask:!1})}let m=a|d<<2|c<<3;if(m!==this._flags){this._flags=m;let p=[];a&&p.push("COLOR_CORRECT"),d&&p.push("PER_FRAGMENT_ATMOSPHERE"),c&&p.push("GLOBE_TRANSLUCENT");let y=new Oe({defines:p,sources:[B0,hV,Dv]}),f=new Oe({defines:p,sources:[B0,hV,kv]});this._spSkyAtmosphere=Qt.fromCache({context:s,vertexShaderSource:y,fragmentShaderSource:f}),u.shaderProgram=this._spSkyAtmosphere}return u};function Zft(e){return!(W.equalsEpsilon(e.hueShift,0,W.EPSILON7)&&W.equalsEpsilon(e.saturationShift,0,W.EPSILON7)&&W.equalsEpsilon(e.brightnessShift,0,W.EPSILON7))}NV.prototype.isDestroyed=function(){return!1};NV.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),ue(this)};var OF=NV;var Y9i=T(S(),1);function ND(e){this.sources=e.sources,this._sources=void 0,this.show=g(e.show,!0),this._command=new nt({modelMatrix:A.clone(A.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0}ND.prototype.update=function(e,t){let n=this;if(!this.show||e.mode!==ie.SCENE3D&&e.mode!==ie.MORPHING||!e.passes.render)return;let i=e.context;if(this._sources!==this.sources){this._sources=this.sources;let r=this.sources;typeof r.positiveX=="string"?Rv(i,this._sources).then(function(s){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=s}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new Ja({context:i,source:r}))}let o=this._command;if(!l(o.vertexArray)){o.uniformMap={u_cubeMap:function(){return n._cubeMap}};let r=pl.createGeometry(pl.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Pe.POSITION_ONLY})),s=this._attributeLocations=Mn.createAttributeLocations(r);o.vertexArray=oi.fromGeometry({context:i,geometry:r,attributeLocations:s,bufferUsage:Ue.STATIC_DRAW}),o.renderState=ke.fromCache({blending:mn.ALPHA_BLEND})}if(!l(o.shaderProgram)||this._useHdr!==t){let r=new Oe({defines:[t?"HDR":""],sources:[Bv]});o.shaderProgram=Qt.fromCache({context:i,vertexShaderSource:Ov,fragmentShaderSource:r,attributeLocations:this._attributeLocations}),this._useHdr=t}if(l(this._cubeMap))return o};ND.prototype.isDestroyed=function(){return!1};ND.prototype.destroy=function(){let 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(),ue(this)};var YF=ND;var _Ai=T(S(),1);function KF(){this.show=!0,this._drawCommand=new nt({primitiveType:Ae.TRIANGLES,boundingVolume:new ce,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new ce,this._boundingVolume2D=new ce,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;let e=this;this._uniformMap={u_texture:function(){return e._texture},u_size:function(){return e._size}}}Object.defineProperties(KF.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var Gft=new B,Eft=new B,Ift=new se,HF=new se;KF.prototype.update=function(e,t,n){if(!this.show)return;let i=e.mode;if(i===ie.SCENE2D||i===ie.MORPHING||!e.passes.render)return;let o=e.context,r=t.viewport.width,s=t.viewport.height;if(!l(this._texture)||r!==this._drawingBufferWidth||s!==this._drawingBufferHeight||this._glowFactorDirty||n!==this._useHdr){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=r,this._drawingBufferHeight=s,this._glowFactorDirty=!1,this._useHdr=n;let Z=Math.max(r,s);Z=Math.pow(2,Math.ceil(Math.log(Z)/Math.log(2))-2),Z=Math.max(1,Z);let G=n?o.halfFloatingPointTexture?je.HALF_FLOAT:je.FLOAT:je.UNSIGNED_BYTE;this._texture=new wt({context:o,width:Z,height:Z,pixelFormat:at.RGBA,pixelDatatype:G}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let I=this,P={u_radiusTS:function(){return I._radiusTS}};this._commands.computeCommand=new au({fragmentShaderSource:Hv,outputTexture:this._texture,uniformMap:P,persists:!1,owner:this,postExecute:function(){I._commands.computeCommand=void 0}})}let a=this._drawCommand;if(!l(a.vertexArray)){let Z={direction:0},G=new Uint8Array(4*2);G[0]=0,G[1]=0,G[2]=255,G[3]=0,G[4]=255,G[5]=255,G[6]=0,G[7]=255;let I=ft.createVertexBuffer({context:o,typedArray:G,usage:Ue.STATIC_DRAW}),P=[{index:Z.direction,vertexBuffer:I,componentsPerAttribute:2,normalize:!0,componentDatatype:Q.UNSIGNED_BYTE}],v=ft.createIndexBuffer({context:o,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Ue.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT});a.vertexArray=new oi({context:o,attributes:P,indexBuffer:v}),a.shaderProgram=Qt.fromCache({context:o,vertexShaderSource:Kv,fragmentShaderSource:Yv,attributeLocations:Z}),a.renderState=ke.fromCache({blending:mn.ALPHA_BLEND}),a.uniformMap=this._uniformMap}let c=o.uniformState.sunPositionWC,d=o.uniformState.sunPositionColumbusView,u=this._boundingVolume,m=this._boundingVolume2D;h.clone(c,u.center),m.center.x=d.z,m.center.y=d.x,m.center.z=d.y,u.radius=W.SOLAR_RADIUS+W.SOLAR_RADIUS*this._glowLengthTS,m.radius=u.radius,i===ie.SCENE3D?ce.clone(u,a.boundingVolume):i===ie.COLUMBUS_VIEW&&ce.clone(m,a.boundingVolume);let p=to.computeActualWgs84Position(e,c,HF),y=h.magnitude(h.subtract(p,e.camera.position,HF)),f=o.uniformState.projection,x=Ift;x.x=0,x.y=0,x.z=-y,x.w=1;let _=A.multiplyByVector(f,x,HF),C=to.clipToGLWindowCoordinates(t.viewport,_,Gft);x.x=W.SOLAR_RADIUS;let V=A.multiplyByVector(f,x,HF),L=to.clipToGLWindowCoordinates(t.viewport,V,Eft);return this._size=B.magnitude(B.subtract(L,C,HF)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};KF.prototype.isDestroyed=function(){return!1};KF.prototype.destroy=function(){let 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(),ue(this)};var zF=KF;function UV(e){return on(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}function Xft(e){e._renderLoopRunning=!0;let t=0;function n(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{let o=e._targetFrameRate;if(!l(o))e.resize(),e.render(),requestAnimationFrame(n);else{let r=1e3/o,s=i-t;s>r&&(e.resize(),e.render(),t=i-s%r),requestAnimationFrame(n)}}catch(o){e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors&&e.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,o)}else e._renderLoopRunning=!1}requestAnimationFrame(n)}function Exe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function Ixe(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,o=Exe(e);e._canvasClientWidth=n,e._canvasClientHeight=i,n*=o,i*=o,t.width=n,t.height=i,e._canRender=n!==0&&i!==0,e._lastDevicePixelRatio=window.devicePixelRatio}function Xxe(e){let t=e._canvas,n=t.width,i=t.height;if(n!==0&&i!==0){let o=e._scene.camera.frustum;l(o.aspectRatio)?o.aspectRatio=n/i:(o.top=o.right*(i/n),o.bottom=-o.top)}}function AT(e,t){e=Wn(e),t=g(t,g.EMPTY_OBJECT);let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),o=Bt.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=o,o&&(i.style.imageRendering=Bt.imageRenderingValue()),i.oncontextmenu=function(){return!1},i.onselectstart=function(){return!1};function r(){i!==i.ownerDocument.activeElement&&i.ownerDocument.activeElement.blur()}g(t.blurActiveElementOnCanvasFocus,!0)&&(i.addEventListener("mousedown",r),i.addEventListener("pointerdown",r)),n.appendChild(i);let a=document.createElement("div");a.className="cesium-widget-credits";let c=l(t.creditContainer)?Wn(t.creditContainer):n;c.appendChild(a);let d=l(t.creditViewport)?Wn(t.creditViewport):n,u=g(t.showRenderLoopErrors,!0),m=g(t.useBrowserRecommendedResolution,!0);this._element=n,this._container=e,this._canvas=i,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=d,this._creditContainer=c,this._innerCreditContainer=a,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=u,this._resolutionScale=1,this._useBrowserRecommendedResolution=m,this._forceResize=!1,this._clock=l(t.clock)?t.clock:new eh,Ixe(this);try{let p=new BF({canvas:i,contextOptions:t.contextOptions,creditContainer:a,creditViewport:d,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:g(t.scene3DOnly,!1),shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples});this._scene=p,p.camera.constrainedAxis=h.UNIT_Z,Exe(this),Xxe(this);let y=g(p.mapProjection.ellipsoid,oe.WGS84),f=t.globe;l(f)||(f=new xw(y)),f!==!1&&(p.globe=f,p.globe.shadows=g(t.terrainShadows,Cn.RECEIVE_ONLY));let x=t.skyBox;l(x)||(x=new YF({sources:{positiveX:UV("px"),negativeX:UV("mx"),positiveY:UV("py"),negativeY:UV("my"),positiveZ:UV("pz"),negativeZ:UV("mz")}})),x!==!1&&(p.skyBox=x,p.sun=new zF,p.moon=new Lw);let _=t.skyAtmosphere;l(_)||(_=new OF(y),_.show=t.globe!==!1&&f.show),_!==!1&&(p.skyAtmosphere=_);let C=t.baseLayer;t.globe!==!1&&C!==!1&&(l(C)||(C=ua.fromWorldImagery()),p.imageryLayers.add(C)),l(t.terrainProvider)&&t.globe!==!1&&(p.terrainProvider=t.terrainProvider),l(t.terrain)&&t.globe!==!1&&p.setTerrain(t.terrain),this._screenSpaceEventHandler=new kd(i),l(t.sceneMode)&&(t.sceneMode===ie.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===ie.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=g(t.useDefaultRenderLoop,!0),this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let V=this;this._onRenderError=function(L,Z){V._useDefaultRenderLoop=!1,V._renderLoopRunning=!1,V._showRenderLoopErrors&&V.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,Z)},p.renderError.addEventListener(this._onRenderError)}catch(p){throw u&&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:',p),p}}Object.defineProperties(AT.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}},creditDisplay:{get:function(){return this._scene.frameState.creditDisplay}},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&&Xft(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){this._resolutionScale!==e&&(this._resolutionScale=e,this._forceResize=!0)}},useBrowserRecommendedResolution:{get:function(){return this._useBrowserRecommendedResolution},set:function(e){this._useBrowserRecommendedResolution!==e&&(this._useBrowserRecommendedResolution=e,this._forceResize=!0)}}});AT.prototype.showErrorPanel=function(e,t,n){let i=this._element,o=document.createElement("div");o.className="cesium-widget-errorPanel";let r=document.createElement("div");r.className="cesium-widget-errorPanel-content",o.appendChild(r);let s=document.createElement("div");s.className="cesium-widget-errorPanel-header",s.appendChild(document.createTextNode(e)),r.appendChild(s);let a=document.createElement("div");a.className="cesium-widget-errorPanel-scroll",r.appendChild(a);function c(){a.style.maxHeight=`${Math.max(Math.round(i.clientHeight*.9-100),30)}px`}c(),l(window.addEventListener)&&window.addEventListener("resize",c,!1);let d=l(t),u=l(n);if(d||u){let y=document.createElement("div");if(y.className="cesium-widget-errorPanel-message",a.appendChild(y),u){let f=wf(n);d||(typeof n=="string"&&(n=new Error(n)),t=wf({name:n.name,message:n.message}),f=n.stack),typeof console<"u"&&console.error(`${e}
${t}
${f}`);let x=document.createElement("div");x.className="cesium-widget-errorPanel-message-details collapsed";let _=document.createElement("span");_.className="cesium-widget-errorPanel-more-details",_.appendChild(document.createTextNode("See more...")),x.appendChild(_),x.onclick=function(C){x.removeChild(_),x.appendChild(document.createTextNode(f)),x.className="cesium-widget-errorPanel-message-details",r.className="cesium-widget-errorPanel-content expanded",x.onclick=void 0},a.appendChild(x)}y.innerHTML=`<p>${t}</p>`}let m=document.createElement("div");m.className="cesium-widget-errorPanel-buttonPanel",r.appendChild(m);let p=document.createElement("button");p.setAttribute("type","button"),p.className="cesium-button",p.appendChild(document.createTextNode("OK")),p.onclick=function(){l(c)&&l(window.removeEventListener)&&window.removeEventListener("resize",c,!1),i.removeChild(o)},m.appendChild(p),i.appendChild(o)};AT.prototype.isDestroyed=function(){return!1};AT.prototype.destroy=function(){l(this._scene)&&(this._scene.renderError.removeEventListener(this._onRenderError),this._scene=this._scene.destroy()),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),ue(this)};AT.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,Ixe(this),Xxe(this),this._scene.requestRender())};AT.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};var JF=AT;var pMi=T(S(),1);var zAi=T(S(),1);function BV(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var MT=new de;function Wft(e,t,n,i){let o=i.length;for(let r=0;r<o;++r){let s=i[r];if(s.x===t&&s.y===n&&s.level===e)return!0}return!1}BV.prototype.addAvailableTileRange=function(e,t,n,i,o){let r=this._tilingScheme,s=this._rootNodes;if(e===0)for(let p=n;p<=o;++p)for(let y=t;y<=i;++y)Wft(e,y,p,s)||s.push(new kV(r,void 0,0,y,p));r.tileXYToRectangle(t,n,e,MT);let a=MT.west,c=MT.north;r.tileXYToRectangle(i,o,e,MT);let d=MT.east,u=MT.south,m=new Aft(e,a,u,d,c);for(let p=0;p<s.length;++p){let y=s[p];pj(y.extent,m)&&Mft(this._maximumLevel,y,m)}};BV.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(DV(i.extent,e)){t=i;break}}return l(t)?QF(void 0,t,e):-1};var Pft=[],vft=[],wft=new de,Fft=new de;BV.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=Pft;t.length=0,e.east<e.west?(t.push(de.fromRadians(-Math.PI,e.south,e.east,e.north,wft)),t.push(de.fromRadians(e.west,e.south,Math.PI,e.north,Fft))):t.push(e);let n=vft;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)jF(n,this._rootNodes[i],t);for(i=n.length-1;i>=0;--i)if(l(n[i])&&n[i].length===0)return i;return 0};var Wxe=new he;BV.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,MT);return de.center(i,Wxe),this.computeMaximumLevelAtPosition(Wxe)>=e};BV.prototype.computeChildMaskForTile=function(e,t,n){let i=e+1;if(i>=this._maximumLevel)return 0;let o=0;return o|=this.isTileAvailable(i,2*t,2*n+1)?1:0,o|=this.isTileAvailable(i,2*t+1,2*n+1)?2:0,o|=this.isTileAvailable(i,2*t,2*n)?4:0,o|=this.isTileAvailable(i,2*t+1,2*n)?8:0,o};function kV(e,t,n,i,o){this.tilingScheme=e,this.parent=t,this.level=n,this.x=i,this.y=o,this.extent=e.tileXYToRectangle(i,o,n),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}Object.defineProperties(kV.prototype,{nw:{get:function(){return this._nw||(this._nw=new kV(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new kV(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new kV(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new kV(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function Aft(e,t,n,i,o){this.level=e,this.west=t,this.south=n,this.east=i,this.north=o}function pj(e,t){let n=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),r=Math.min(e.north,t.north);return i<r&&n<o}function Mft(e,t,n){for(;t.level<e;)if(UD(t.nw.extent,n))t=t.nw;else if(UD(t.ne.extent,n))t=t.ne;else if(UD(t.sw.extent,n))t=t.sw;else if(UD(t.se.extent,n))t=t.se;else break;if(t.rectangles.length===0||t.rectangles[t.rectangles.length-1].level<=n.level)t.rectangles.push(n);else{let i=Io(t.rectangles,n.level,Nft);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function Nft(e,t){return e.level-t}function UD(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function DV(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function QF(e,t,n){let i=0,o=!1;for(;!o;){let r=t._nw&&DV(t._nw.extent,n),s=t._ne&&DV(t._ne.extent,n),a=t._sw&&DV(t._sw.extent,n),c=t._se&&DV(t._se.extent,n);if(r+s+a+c>1){r&&(i=Math.max(i,QF(t,t._nw,n))),s&&(i=Math.max(i,QF(t,t._ne,n))),a&&(i=Math.max(i,QF(t,t._sw,n))),c&&(i=Math.max(i,QF(t,t._se,n)));break}else r?t=t._nw:s?t=t._ne:a?t=t._sw:c?t=t._se:o=!0}for(;t!==e;){let r=t.rectangles;for(let s=r.length-1;s>=0&&r[s].level>i;--s){let a=r[s];DV(a,n)&&(i=a.level)}t=t.parent}return i}function jF(e,t,n){if(!t)return;let i,o=!1;for(i=0;i<n.length;++i)o=o||pj(t.extent,n[i]);if(!o)return;let r=t.rectangles;for(i=0;i<r.length;++i){let s=r[i];e[s.level]||(e[s.level]=n),e[s.level]=Uft(e[s.level],s)}jF(e,t._nw,n),jF(e,t._ne,n),jF(e,t._sw,n),jF(e,t._se,n)}function Uft(e,t){let n=[];for(let i=0;i<e.length;++i){let o=e[i];pj(o,t)?(o.west<t.west&&n.push(new de(o.west,o.south,t.west,o.north)),o.east>t.east&&n.push(new de(t.east,o.south,o.east,o.north)),o.south<t.south&&n.push(new de(Math.max(t.west,o.west),o.south,Math.min(t.east,o.east),t.south)),o.north>t.north&&n.push(new de(Math.max(t.west,o.west),t.north,Math.min(t.east,o.east),o.north))):n.push(o)}return n}var Gh=BV;var kft=15;function Pxe(e){this.ellipsoid=g(e.ellipsoid,oe.WGS84),this.credit=void 0,this.tilingScheme=void 0,this.height=void 0,this.width=void 0,this.encoding=void 0,this.lodCount=void 0,this.hasAvailability=!1,this.tilesAvailable=void 0,this.tilesAvailabilityLoaded=void 0,this.levelZeroMaximumGeometricError=void 0,this.terrainDataStructure=void 0}Pxe.prototype.build=function(e){e._credit=this.credit,e._tilingScheme=this.tilingScheme,e._height=this.height,e._width=this.width,e._encoding=this.encoding,e._lodCount=this.lodCount,e._hasAvailability=this.hasAvailability,e._tilesAvailable=this.tilesAvailable,e._tilesAvailabilityLoaded=this.tilesAvailabilityLoaded,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._terrainDataStructure=this.terrainDataStructure};function Dft(e,t){let n=t.copyrightText;l(n)&&(e.credit=new Vt(n));let i=t.spatialReference,o=g(i.latestWkid,i.wkid),r=t.extent,s={ellipsoid:e.ellipsoid};if(o===4326)s.rectangle=de.fromDegrees(r.xmin,r.ymin,r.xmax,r.ymax),e.tilingScheme=new Oi(s);else if(o===3857){let d=Math.PI*e.ellipsoid.maximumRadius;t.extent.xmax>d&&(t.extent.xmax=d),t.extent.ymax>d&&(t.extent.ymax=d),t.extent.xmin<-d&&(t.extent.xmin=-d),t.extent.ymin<-d&&(t.extent.ymin=-d),s.rectangleSouthwestInMeters=new B(r.xmin,r.ymin),s.rectangleNortheastInMeters=new B(r.xmax,r.ymax),e.tilingScheme=new Jr(s)}else throw new me("Invalid spatial reference");let a=t.tileInfo;if(!l(a))throw new me("tileInfo is required");e.width=a.rows+1,e.height=a.cols+1,e.encoding=a.format==="LERC"?zu.LERC:zu.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new Gh(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new Gh(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=zr.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.width,e.tilingScheme.getNumberOfXTilesAtLevel(0)),t.bandCount>1&&console.log("ArcGISTiledElevationTerrainProvider: Terrain data has more than 1 band. Using the first one."),l(t.minValues)&&l(t.maxValues)?e.terrainDataStructure={elementMultiplier:1,lowestEncodedHeight:t.minValues[0],highestEncodedHeight:t.maxValues[0]}:e.terrainDataStructure={elementMultiplier:1}}async function Bft(e,t,n){try{let i=await t.fetchJson();Dft(e,i)}catch(i){let o=`An error occurred while accessing ${t}.`;throw Eo.reportError(void 0,n,l(n)?n._errorEvent:void 0,o),i}}function bg(e){e=g(e,g.EMPTY_OBJECT),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._width=void 0,this._height=void 0,this._encoding=void 0,this._lodCount=void 0,this._hasAvailability=!1,this._tilesAvailable=void 0,this._tilesAvailabilityLoaded=void 0,this._availableCache={},this._errorEvent=new ye}Object.defineProperties(bg.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){return this._tilesAvailable}}});bg.fromUrl=async function(e,t){t=g(t,g.EMPTY_OBJECT),e=await Promise.resolve(e);let n=Xe.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),o=new Pxe(t);await Bft(o,i);let r=new bg(t);return o.build(r),r._resource=n,r};bg.prototype.requestTileGeometry=function(e,t,n,i){let o=this._resource.getDerivedResource({url:`tile/${n}/${t}/${e}`,request:i}),r=this._hasAvailability,s=Promise.resolve(!0),a;if(r&&!l(bj(this,n+1,e*2,t*2))){let m=vxe(this,n+1,e*2,t*2);s=m.promise,a=m.request}let c=o.fetchArrayBuffer();if(!l(c)||!l(s))return;let d=this,u=this._tilesAvailable;return Promise.all([c,s]).then(function(m){return new va({buffer:m[0],width:d._width,height:d._height,childTileMask:r?u.computeChildMaskForTile(n,e,t):kft,structure:d._terrainDataStructure,encoding:d._encoding})}).catch(function(m){return l(a)&&a.state===ti.CANCELLED?(i.cancel(),i.deferred.promise.finally(function(){return i.state=ti.CANCELLED,Promise.reject(m)})):Promise.reject(m)})};function bj(e,t,n,i){if(!e._hasAvailability)return;let o=e._tilesAvailabilityLoaded,r=e._tilesAvailable;if(t>e._lodCount)return!1;if(r.isTileAvailable(t,n,i))return!0;if(o.isTileAvailable(t,n,i))return!1}bg.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};bg.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=bj(this,n,e,t);if(l(i))return i;vxe(this,n,e,t)};bg.prototype.loadTileDataAvailability=function(e,t,n){};function Oft(e,t,n,i){let o=t-1,r=n-1,s=i[e.y*t+e.x],a=[],c={startX:e.x,startY:e.y,endX:0,endY:0},d=new B(e.x+1,e.y+1),u=!1,m=!1;for(;!(u&&m);){let p=d.x,y=m?d.y+1:d.y;if(!u){for(let f=e.y;f<y;++f)if(i[f*t+d.x]!==s){u=!0;break}u?(a.push(new B(d.x,e.y)),--d.x,--p,c.endX=d.x):d.x===o?(c.endX=d.x,u=!0):++d.x}if(!m){let f=d.y*t;for(let x=e.x;x<=p;++x)if(i[f+x]!==s){m=!0;break}m?(a.push(new B(e.x,d.y)),--d.y,c.endY=d.y):d.y===r?(c.endY=d.y,m=!0):++d.y}}return{endingIndices:a,range:c,value:s}}function Yft(e,t,n,i,o){let r=[];if(o.every(function(c){return c===o[0]}))return o[0]===1&&r.push({startX:e,startY:t,endX:e+n-1,endY:t+i-1}),r;let a=[new B(0,0)];for(;a.length>0;){let c=a.pop(),d=Oft(c,n,i,o);if(d.value===1){let m=d.range;m.startX+=e,m.endX+=e,m.startY+=t,m.endY+=t,r.push(m)}let u=d.endingIndices;u.length>0&&(a=a.concat(u))}return r}function vxe(e,t,n,i){if(!e._hasAvailability)return{};let o=Math.floor(n/128)*128,r=Math.floor(i/128)*128,s=Math.min(1<<t,128),a=`tilemap/${t}/${r}/${o}/${s}/${s}`,c=e._availableCache;if(l(c[a]))return c[a];let d=new Yo({throttle:!1,throttleByServer:!0,type:os.TERRAIN}),m=e._resource.getDerivedResource({url:a,request:d}).fetchJson();return l(m)?(m=m.then(function(p){let y=Yft(o,r,s,s,p.data);e._tilesAvailabilityLoaded.addAvailableTileRange(t,o,r,o+s,r+s);let f=e._tilesAvailable;for(let x=0;x<y.length;++x){let _=y[x];f.addAvailableTileRange(t,_.startX,_.startY,_.endX,_.endY)}return bj(e,t,n,i)}),c[a]={promise:m,request:d},m=m.finally(function(p){return delete c[a],p}),{promise:m,request:d}):{}}var yj=bg;var SMi=T(S(),1);var wxe="https://dev.virtualearth.net/REST/v1/Locations";function gj(e){e=g(e,g.EMPTY_OBJECT);let t=e.key;this._key=t;let n={key:t};l(e.culture)&&(n.culture=e.culture),this._resource=new Xe({url:wxe,queryParameters:n}),this._credit=new Vt('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(gj.prototype,{url:{get:function(){return wxe}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});gj.prototype.geocode=async function(e){return this._resource.getDerivedResource({queryParameters:{query:e}}).fetchJsonp("jsonp").then(function(n){return n.resourceSets.length===0?[]:n.resourceSets[0].resources.map(function(o){let r=o.bbox,s=r[0],a=r[1],c=r[2],d=r[3];return{displayName:o.name,destination:de.fromDegrees(a,s,d,c)}})})};var xj=gj;var LMi=T(S(),1);function _j(){}Object.defineProperties(_j.prototype,{credit:{get:function(){}}});_j.prototype.geocode=function(e){let t=e.match(/[^\s,\n]+/g);if(t.length===2||t.length===3){let n=+t[0],i=+t[1],o=t.length===3?+t[2]:300;if(isNaN(n)&&isNaN(i)){let r=/^(\d+.?\d*)([nsew])/i;for(let s=0;s<t.length;++s){let a=t[s].match(r);r.test(t[s])&&a.length===3&&(/^[ns]/i.test(a[2])?i=/^[n]/i.test(a[2])?+a[1]:-a[1]:/^[ew]/i.test(a[2])&&(n=/^[e]/i.test(a[2])?+a[1]:-a[1]))}}if(!isNaN(n)&&!isNaN(i)&&!isNaN(o)){let r={displayName:e,destination:h.fromDegrees(n,i,o)};return Promise.resolve([r])}}return Promise.resolve([])};var Tj=_j;var vMi=T(S(),1);var Hft=new se,Fxe=new h,OV=new h;function Kft(e){let t=e.points,n=e.times;if(t.length<3){let i=n[0],o=1/(n[1]-i),r=t[0],s=t[1];return function(a,c){l(c)||(c=new h);let d=(a-i)*o;return h.lerp(r,s,d,c)}}return function(i,o){l(o)||(o=new h);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=Hft;a.z=s,a.y=s*s,a.x=a.y*s,a.w=1;let c,d,u,m,p;return r===0?(c=t[0],d=t[1],u=e.firstTangent,m=h.subtract(t[2],c,Fxe),h.multiplyByScalar(m,.5,m),p=A.multiplyByVector($b.hermiteCoefficientMatrix,a,a)):r===t.length-2?(c=t[r],d=t[r+1],m=e.lastTangent,u=h.subtract(d,t[r-1],Fxe),h.multiplyByScalar(u,.5,u),p=A.multiplyByVector($b.hermiteCoefficientMatrix,a,a)):(c=t[r-1],d=t[r],u=t[r+1],m=t[r+2],p=A.multiplyByVector(yg.catmullRomCoefficientMatrix,a,a)),o=h.multiplyByScalar(c,p.x,o),h.multiplyByScalar(d,p.y,OV),h.add(o,OV,o),h.multiplyByScalar(u,p.z,OV),h.add(o,OV,o),h.multiplyByScalar(m,p.w,OV),h.add(o,OV,o)}}var zft=new h,Jft=new h;function yg(e){e=g(e,g.EMPTY_OBJECT);let t=e.points,n=e.times,i=e.firstTangent,o=e.lastTangent;if(t.length>2&&(l(i)||(i=zft,h.multiplyByScalar(t[1],2,i),h.subtract(i,t[2],i),h.subtract(i,t[0],i),h.multiplyByScalar(i,.5,i)),!l(o))){let r=t.length-1;o=Jft,h.multiplyByScalar(t[r-1],2,o),h.subtract(t[r],o,o),h.add(o,t[r-2],o),h.multiplyByScalar(o,.5,o)}this._times=n,this._points=t,this._firstTangent=h.clone(i),this._lastTangent=h.clone(o),this._evaluateFunction=Kft(this),this._lastTimeIndex=0}Object.defineProperties(yg.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}}});yg.catmullRomCoefficientMatrix=new A(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);yg.prototype.findTimeInterval=lo.prototype.findTimeInterval;yg.prototype.wrapTime=lo.prototype.wrapTime;yg.prototype.clampTime=lo.prototype.clampTime;yg.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var Sj=yg;var VNi=T(S(),1);var eNi=T(S(),1);var NMi=T(S(),1);var kD={};kD.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,o,r){l(r)?r.length=0:r=[];let s,a,c;t?(s=n<e,a=i<e,c=o<e):(s=n>e,a=i>e,c=o>e);let d=s+a+c,u,m,p,y,f,x;return d===1?s?(u=(e-n)/(i-n),m=(e-n)/(o-n),r.push(1),r.push(2),m!==1&&(r.push(-1),r.push(0),r.push(2),r.push(m)),u!==1&&(r.push(-1),r.push(0),r.push(1),r.push(u))):a?(p=(e-i)/(o-i),y=(e-i)/(n-i),r.push(2),r.push(0),y!==1&&(r.push(-1),r.push(1),r.push(0),r.push(y)),p!==1&&(r.push(-1),r.push(1),r.push(2),r.push(p))):c&&(f=(e-o)/(n-o),x=(e-o)/(i-o),r.push(0),r.push(1),x!==1&&(r.push(-1),r.push(2),r.push(1),r.push(x)),f!==1&&(r.push(-1),r.push(2),r.push(0),r.push(f))):d===2?!s&&n!==e?(y=(e-i)/(n-i),f=(e-o)/(n-o),r.push(0),r.push(-1),r.push(1),r.push(0),r.push(y),r.push(-1),r.push(2),r.push(0),r.push(f)):!a&&i!==e?(x=(e-o)/(i-o),u=(e-n)/(i-n),r.push(1),r.push(-1),r.push(2),r.push(1),r.push(x),r.push(-1),r.push(0),r.push(1),r.push(u)):!c&&o!==e&&(m=(e-n)/(o-n),p=(e-i)/(o-i),r.push(2),r.push(-1),r.push(0),r.push(2),r.push(m),r.push(-1),r.push(1),r.push(2),r.push(p)):d!==3&&(r.push(0),r.push(1),r.push(2)),r};kD.computeBarycentricCoordinates=function(e,t,n,i,o,r,s,a,c){let d=n-s,u=s-o,m=r-a,p=i-a,y=1/(m*d+u*p),f=t-a,x=e-s,_=(m*x+u*f)*y,C=(-p*x+d*f)*y,V=1-_-C;return l(c)?(c.x=_,c.y=C,c.z=V,c):new h(_,C,V)};kD.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,o,r,s,a,c){let d=(s-o)*(t-r)-(a-r)*(e-o),u=(n-e)*(t-r)-(i-t)*(e-o),m=(a-r)*(n-e)-(s-o)*(i-t);if(m===0)return;let p=d/m,y=u/m;if(p>=0&&p<=1&&y>=0&&y<=1)return l(c)||(c=new B),c.x=e+p*(n-e),c.y=t+p*(i-t),c};var sb=kD;function gg(e){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;let t=this._quantizedVertices.length/3,n=this._uValues=this._quantizedVertices.subarray(0,t),i=this._vValues=this._quantizedVertices.subarray(t,2*t);this._heightValues=this._quantizedVertices.subarray(2*t,3*t);function o(s,a){return i[s]-i[a]}function r(s,a){return n[s]-n[a]}this._westIndices=BD(e.westIndices,o,t),this._southIndices=BD(e.southIndices,r,t),this._eastIndices=BD(e.eastIndices,o,t),this._northIndices=BD(e.northIndices,r,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=g(e.childTileMask,15),this._createdByUpsampling=g(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._mesh=void 0}Object.defineProperties(gg.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}},canUpsample:{get:function(){return l(this._mesh)}}});var DD=[];function BD(e,t,n){DD.length=e.length;let i=!1;for(let o=0,r=e.length;o<r;++o)DD[o]=e[o],i=i||o>0&&t(e[o-1],e[o])>0;return i?(DD.sort(t),Ne.createTypedArray(n,DD)):e}var Axe="createVerticesFromQuantizedTerrainMesh",Qft=new gi(Axe),jft=new gi(Axe,xh.maximumAsynchronousTasks);gg.prototype.createMesh=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=g(e.exaggeration,1),s=g(e.exaggerationRelativeHeight,0),a=g(e.throttle,!0),c=t.ellipsoid,d=t.tileXYToRectangle(n,i,o),m=(a?jft:Qft).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:d,relativeToCenter:this._boundingSphere.center,ellipsoid:c,exaggeration:r,exaggerationRelativeHeight:s});if(!l(m))return;let p=this;return Promise.resolve(m).then(function(y){let f=p._quantizedVertices.length/3,x=f+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,_=Ne.createTypedArray(x,y.indices),C=new Float32Array(y.vertices),V=y.center,L=y.minimumHeight,Z=y.maximumHeight,G=p._boundingSphere,I=p._orientedBoundingBox,P=g(h.clone(y.occludeePointInScaledSpace),p._horizonOcclusionPoint),v=y.vertexStride,F=yc.clone(y.encoding);return p._mesh=new Qu(V,C,_,y.indexCountWithoutSkirts,f,L,Z,G,P,v,I,F,y.westIndicesSouthToNorth,y.southIndicesEastToWest,y.eastIndicesNorthToSouth,y.northIndicesWestToEast),p._quantizedVertices=void 0,p._encodedNormals=void 0,p._indices=void 0,p._uValues=void 0,p._vValues=void 0,p._heightValues=void 0,p._westIndices=void 0,p._southIndices=void 0,p._eastIndices=void 0,p._northIndices=void 0,p._mesh})};var qft=new gi("upsampleQuantizedTerrainMesh",xh.maximumAsynchronousTasks);gg.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,d=n*2===r,u=e.ellipsoid,m=e.tileXYToRectangle(o,r,s),p=qft.scheduleTask({vertices:a.vertices,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:d,childRectangle:m,ellipsoid:u});if(!l(p))return;let y=Math.min(this._westSkirtHeight,this._eastSkirtHeight);y=Math.min(y,this._southSkirtHeight),y=Math.min(y,this._northSkirtHeight);let f=c?y*.5:this._westSkirtHeight,x=d?y*.5:this._southSkirtHeight,_=c?this._eastSkirtHeight:y*.5,C=d?this._northSkirtHeight:y*.5,V=this._credits;return Promise.resolve(p).then(function(L){let Z=new Uint16Array(L.vertices),G=Ne.createTypedArray(Z.length/3,L.indices),I;return l(L.encodedNormals)&&(I=new Uint8Array(L.encodedNormals)),new gg({quantizedVertices:Z,indices:G,encodedNormals:I,minimumHeight:L.minimumHeight,maximumHeight:L.maximumHeight,boundingSphere:ce.clone(L.boundingSphere),orientedBoundingBox:Xn.clone(L.orientedBoundingBox),horizonOcclusionPoint:h.clone(L.horizonOcclusionPoint),westIndices:L.westIndices,southIndices:L.southIndices,eastIndices:L.eastIndices,northIndices:L.northIndices,westSkirtHeight:f,southSkirtHeight:x,eastSkirtHeight:_,northSkirtHeight:C,childTileMask:0,credits:V,createdByUpsampling:!0})})};var Cj=32767,Mxe=new h;gg.prototype.interpolateHeight=function(e,t,n){let i=W.clamp((t-e.west)/e.width,0,1);i*=Cj;let o=W.clamp((n-e.south)/e.height,0,1);return o*=Cj,l(this._mesh)?npt(this,i,o):ipt(this,i,o)};function Nxe(e,t,n,i,o,r,s,a){let c=Math.min(n,o,s),d=Math.max(n,o,s),u=Math.min(i,r,a),m=Math.max(i,r,a);return e>=c&&e<=d&&t>=u&&t<=m}var $ft=new B,ept=new B,tpt=new B;function npt(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let d=s[a],u=s[a+1],m=s[a+2],p=r.decodeTextureCoordinates(o,d,$ft),y=r.decodeTextureCoordinates(o,u,ept),f=r.decodeTextureCoordinates(o,m,tpt);if(Nxe(t,n,p.x,p.y,y.x,y.y,f.x,f.y)){let x=sb.computeBarycentricCoordinates(t,n,p.x,p.y,y.x,y.y,f.x,f.y,Mxe);if(x.x>=-1e-15&&x.y>=-1e-15&&x.z>=-1e-15){let _=r.decodeHeight(o,d),C=r.decodeHeight(o,u),V=r.decodeHeight(o,m);return x.x*_+x.y*C+x.z*V}}}}function ipt(e,t,n){let i=e._uValues,o=e._vValues,r=e._heightValues,s=e._indices;for(let a=0,c=s.length;a<c;a+=3){let d=s[a],u=s[a+1],m=s[a+2],p=i[d],y=i[u],f=i[m],x=o[d],_=o[u],C=o[m];if(Nxe(t,n,p,x,y,_,f,C)){let V=sb.computeBarycentricCoordinates(t,n,p,x,y,_,f,C,Mxe);if(V.x>=-1e-15&&V.y>=-1e-15&&V.z>=-1e-15){let L=V.x*r[d]+V.y*r[u]+V.z*r[m];return W.lerp(e._minimumHeight,e._maximumHeight,L/Cj)}}}}gg.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};gg.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var NT=gg;function opt(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.availabilityPromiseCache={}}function kxe(e){this.requestVertexNormals=g(e.requestVertexNormals,!1),this.requestWaterMask=g(e.requestWaterMask,!1),this.requestMetadata=g(e.requestMetadata,!0),this.ellipsoid=e.ellipsoid,this.heightmapWidth=65,this.heightmapStructure=void 0,this.hasWaterMask=!1,this.hasMetadata=!1,this.hasVertexNormals=!1,this.scheme=void 0,this.lastResource=void 0,this.layerJsonResource=void 0,this.previousError=void 0,this.availability=void 0,this.tilingScheme=void 0,this.levelZeroMaximumGeometricError=void 0,this.heightmapStructure=void 0,this.layers=[],this.attribution="",this.overallAvailability=[],this.overallMaxZoom=0,this.tileCredits=[]}kxe.prototype.build=function(e){e._heightmapWidth=this.heightmapWidth,e._scheme=this.scheme;let t=l(this.lastResource.credits)?this.lastResource.credits:[];e._tileCredits=t.concat(this.tileCredits),e._availability=this.availability,e._tilingScheme=this.tilingScheme,e._requestWaterMask=this.requestWaterMask,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._heightmapStructure=this.heightmapStructure,e._layers=this.layers,e._hasWaterMask=this.hasWaterMask,e._hasVertexNormals=this.hasVertexNormals,e._hasMetadata=this.hasMetadata};async function Dxe(e,t,n){if(!t.format){let x="The tile format is not specified in the layer.json file.";throw e.previousError=Eo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new me(x)}if(!t.tiles||t.tiles.length===0){let x="The layer.json file does not specify any tile URL templates.";throw e.previousError=Eo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new me(x)}let i=!1,o=!1,r=!1,s=!0,a=!1;if(t.format==="heightmap-1.0")a=!0,l(e.heightmapStructure)||(e.heightmapStructure={heightScale:1/5,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:256*256-1}),o=!0,e.requestWaterMask=!0;else if(t.format.indexOf("quantized-mesh-1.")!==0){let x=`The tile format "${t.format}" is invalid or not supported.`;throw e.previousError=Eo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new me(x)}let c=t.tiles,d=t.maxzoom;if(e.overallMaxZoom=Math.max(e.overallMaxZoom,d),!t.projection||t.projection==="EPSG:4326")e.tilingScheme=new Oi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new Jr({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let x=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=Eo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new me(x)}if(e.levelZeroMaximumGeometricError=zr.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.heightmapWidth,e.tilingScheme.getNumberOfXTilesAtLevel(0)),!t.scheme||t.scheme==="tms"||t.scheme==="slippyMap")e.scheme=t.scheme;else{let x=`The scheme "${t.scheme}" is invalid or not supported.`;throw e.previousError=Eo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new me(x)}let u;l(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?i=!0:l(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(i=!0,s=!1),l(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(o=!0),l(t.extensions)&&t.extensions.indexOf("metadata")!==-1&&(r=!0);let m=t.metadataAvailability,p=t.available,y;if(l(p)&&!l(m)){y=new Gh(e.tilingScheme,p.length);for(let x=0;x<p.length;++x){let _=p[x],C=e.tilingScheme.getNumberOfYTilesAtLevel(x);l(e.overallAvailability[x])||(e.overallAvailability[x]=[]);for(let V=0;V<_.length;++V){let L=_[V],Z=C-L.endY-1,G=C-L.startY-1;e.overallAvailability[x].push([L.startX,Z,L.endX,G]),y.addAvailableTileRange(x,L.startX,Z,L.endX,G)}}}else l(m)&&(u=new Gh(e.tilingScheme,d),y=new Gh(e.tilingScheme,d),e.overallAvailability[0]=[[0,0,1,0]],y.addAvailableTileRange(0,0,0,1,0));e.hasWaterMask=e.hasWaterMask||o,e.hasVertexNormals=e.hasVertexNormals||i,e.hasMetadata=e.hasMetadata||r,l(t.attribution)&&(e.attribution.length>0&&(e.attribution+=" "),e.attribution+=t.attribution),e.layers.push(new opt({resource:e.lastResource,version:t.version,isHeightmap:a,tileUrlTemplates:c,availability:y,hasVertexNormals:i,hasWaterMask:o,hasMetadata:r,availabilityLevels:m,availabilityTilesLoaded:u,littleEndianExtensionSize:s}));let f=t.parentUrl;return l(f)?l(y)?(e.lastResource=e.lastResource.getDerivedResource({url:f}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await Rj(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function rpt(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(l(t)&&(i+=`
${t.message}`),e.previousError=Eo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,i),e.previousError.retry)return Rj(e,n);throw new me(i)}async function spt(e,t,n){await Dxe(e,t,n);let i=e.overallAvailability.length;if(i>0){let o=e.availability=new Gh(e.tilingScheme,e.overallMaxZoom);for(let r=0;r<i;++r){let s=e.overallAvailability[r];for(let a=0;a<s.length;++a){let c=s[a];o.addAvailableTileRange(r,c[0],c[1],c[2],c[3])}}}if(e.attribution.length>0){let o=new Vt(e.attribution);e.tileCredits.push(o)}return!0}async function Rj(e,t){try{let n=await e.layerJsonResource.fetchJson();return spt(e,n,t)}catch(n){return l(n)&&n.statusCode===404?(await Dxe(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):rpt(e,n,t)}}function Eh(e){e=g(e,g.EMPTY_OBJECT),this._heightmapWidth=void 0,this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._hasMetadata=!1,this._scheme=void 0,this._ellipsoid=e.ellipsoid,this._requestVertexNormals=g(e.requestVertexNormals,!1),this._requestWaterMask=g(e.requestWaterMask,!1),this._requestMetadata=g(e.requestMetadata,!0),this._errorEvent=new ye;let t=e.credit;typeof t=="string"&&(t=new Vt(t)),this._credit=t,this._availability=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._layers=void 0,this._tileCredits=void 0}var Vj={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function Uxe(e){return!l(e)||e.length===0?{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}:{Accept:`application/vnd.quantized-mesh;extensions=${e.join("-")},application/octet-stream;q=0.9,*/*;q=0.01`}}function apt(e,t,n,i,o){let r=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new va({buffer:r,childTileMask:new Uint8Array(t,r.byteLength,1)[0],waterMask:new Uint8Array(t,r.byteLength+1,t.byteLength-r.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure,credits:e._tileCredits})}function cpt(e,t,n,i,o,r){let s=r.littleEndianExtensionSize,a=0,c=3,d=c+1,u=Float64Array.BYTES_PER_ELEMENT*c,m=Float64Array.BYTES_PER_ELEMENT*d,y=Uint16Array.BYTES_PER_ELEMENT*3,f=3,x=Uint16Array.BYTES_PER_ELEMENT,_=x*f,C=new DataView(t),V=new h(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0));a+=u;let L=C.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let Z=C.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let G=new ce(new h(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0)),C.getFloat64(a+u,!0));a+=m;let I=new h(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0));a+=u;let P=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let v=new Uint16Array(t,a,P*3);a+=P*y,P>64*1024&&(x=Uint32Array.BYTES_PER_ELEMENT,_=x*f);let F=v.subarray(0,P),M=v.subarray(P,2*P),b=v.subarray(P*2,3*P);Fn.zigZagDeltaDecode(F,M,b),a%x!==0&&(a+=x-a%x);let R=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let E=Ne.createTypedArrayFromArrayBuffer(P,t,a,R*f);a+=R*_;let X=0,w=E.length;for(let ae=0;ae<w;++ae){let be=E[ae];E[ae]=X-be,be===0&&++X}let N=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let D=Ne.createTypedArrayFromArrayBuffer(P,t,a,N);a+=N*x;let k=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let Y=Ne.createTypedArrayFromArrayBuffer(P,t,a,k);a+=k*x;let U=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let J=Ne.createTypedArrayFromArrayBuffer(P,t,a,U);a+=U*x;let K=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let ee=Ne.createTypedArrayFromArrayBuffer(P,t,a,K);a+=K*x;let H,j;for(;a<C.byteLength;){let ae=C.getUint8(a,!0);a+=Uint8Array.BYTES_PER_ELEMENT;let be=C.getUint32(a,s);if(a+=Uint32Array.BYTES_PER_ELEMENT,ae===Vj.OCT_VERTEX_NORMALS&&e._requestVertexNormals)H=new Uint8Array(t,a,P*2);else if(ae===Vj.WATER_MASK&&e._requestWaterMask)j=new Uint8Array(t,a,be);else if(ae===Vj.METADATA&&e._requestMetadata){let _e=C.getUint32(a,!0);if(_e>0){let Le=Po(new Uint8Array(t),a+Uint32Array.BYTES_PER_ELEMENT,_e).available;if(l(Le))for(let Ee=0;Ee<Le.length;++Ee){let He=n+Ee+1,we=Le[Ee],dt=e._tilingScheme.getNumberOfYTilesAtLevel(He);for(let bt=0;bt<we.length;++bt){let it=we[bt],en=dt-it.endY-1,_n=dt-it.startY-1;e.availability.addAvailableTileRange(He,it.startX,en,it.endX,_n),r.availability.addAvailableTileRange(He,it.startX,en,it.endX,_n)}}}r.availabilityTilesLoaded.addAvailableTileRange(n,i,o,i,o)}a+=be}let $=e.getLevelMaximumGeometricError(n)*5,pe=e._tilingScheme.tileXYToRectangle(i,o,n),ge=Xn.fromRectangle(pe,L,Z,e._tilingScheme.ellipsoid);return new NT({center:V,minimumHeight:L,maximumHeight:Z,boundingSphere:G,orientedBoundingBox:ge,horizonOcclusionPoint:I,quantizedVertices:v,encodedNormals:H,indices:E,westIndices:D,southIndices:Y,eastIndices:J,northIndices:ee,westSkirtHeight:$,southSkirtHeight:$,eastSkirtHeight:$,northSkirtHeight:$,childTileMask:e.availability.computeChildMaskForTile(n,i,o),waterMask:j,credits:e._tileCredits})}Eh.prototype.requestTileGeometry=function(e,t,n,i){let o=this._layers,r,s=o.length,a=!1,c=Promise.resolve();if(s===1)r=o[0];else for(let d=0;d<s;++d){let u=o[d];if(!l(u.availability)||u.availability.isTileAvailable(n,e,t)){r=u;break}let m=Zj(this,e,t,n,u,d===0);m.result&&(a=!0,c=c.then(()=>m.promise))}return!l(r)&&a?c.then(()=>new Promise(d=>{setTimeout(()=>{let u=this.requestTileGeometry(e,t,n,i);d(u)},0)})):Bxe(this,e,t,n,r,i)};function Bxe(e,t,n,i,o,r){if(!l(o))return Promise.reject(new me("Terrain tile doesn't exist"));let s=o.tileUrlTemplates;if(s.length===0)return;let a;!e._scheme||e._scheme==="tms"?a=e._tilingScheme.getNumberOfYTilesAtLevel(i)-n-1:a=n;let c=[];e._requestVertexNormals&&o.hasVertexNormals&&c.push(o.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&o.hasWaterMask&&c.push("watermask"),e._requestMetadata&&o.hasMetadata&&c.push("metadata");let d,u,m=s[(t+a+i)%s.length],p=o.resource;l(p._ionEndpoint)&&!l(p._ionEndpoint.externalType)?(c.length!==0&&(u={extensions:c.join("-")}),d=Uxe(void 0)):d=Uxe(c);let y=p.getDerivedResource({url:m,templateValues:{version:o.version,z:i,x:t,y:a},queryParameters:u,headers:d,request:r}).fetchArrayBuffer();if(l(y))return y.then(function(f){return l(f)?l(e._heightmapStructure)?apt(e,f,i,t,n):cpt(e,f,i,t,n,o):Promise.reject(new me("Mesh buffer doesn't exist."))})}Object.defineProperties(Eh.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},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}}});Eh.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Eh.fromIonAssetId=async function(e,t){let n=await sd.fromAssetId(e);return Eh.fromUrl(n,t)};Eh.fromUrl=async function(e,t){t=g(t,g.EMPTY_OBJECT),e=await Promise.resolve(e);let n=Xe.createIfNeeded(e);n.appendForwardSlash();let i=new kxe(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await Rj(i);let o=new Eh(t);return i.build(o),o};Eh.prototype.getTileDataAvailable=function(e,t,n){if(!l(this._availability))return;if(n>this._availability._maximumLevel)return!1;if(this._availability.isTileAvailable(n,e,t))return!0;if(!this._hasMetadata)return!1;let i=this._layers,o=i.length;for(let r=0;r<o;++r)if(Zj(this,e,t,n,i[r],r===0).result)return;return!1};Eh.prototype.loadTileDataAvailability=function(e,t,n){if(!l(this._availability)||n>this._availability._maximumLevel||this._availability.isTileAvailable(n,e,t)||!this._hasMetadata)return;let i=this._layers,o=i.length;for(let r=0;r<o;++r){let s=Zj(this,e,t,n,i[r],r===0);if(l(s.promise))return s.promise}};function Lj(e,t,n,i){if(i===0)return;let o=e.availabilityLevels,r=i%o===0?i-o:(i/o|0)*o,s=1<<i-r,a=t/s|0,c=n/s|0;return{level:r,x:a,y:c}}function Zj(e,t,n,i,o,r){if(!l(o.availabilityLevels))return{result:!1};let s,a=function(){delete o.availabilityPromiseCache[s]},c=o.availabilityTilesLoaded,d=o.availability,u=Lj(o,t,n,i);for(;l(u);){if(d.isTileAvailable(u.level,u.x,u.y)&&!c.isTileAvailable(u.level,u.x,u.y)){let m;if(!r&&(s=`${u.level}-${u.x}-${u.y}`,m=o.availabilityPromiseCache[s],!l(m))){let p=new Yo({throttle:!1,throttleByServer:!0,type:os.TERRAIN});m=Bxe(e,u.x,u.y,u.level,o,p),l(m)&&(o.availabilityPromiseCache[s]=m,m.then(a))}return{result:!0,promise:m}}u=Lj(o,u.x,u.y,u.level)}return{result:!1}}Eh._getAvailabilityTile=Lj;var UT=Eh;var WNi=T(S(),1);function ab(e){e=g(e,g.EMPTY_OBJECT);let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new Qc(n),this._workerName="createCircleGeometry"}ab.packedLength=Qc.packedLength;ab.pack=function(e,t,n){return Qc.pack(e._ellipseGeometry,t,n)};var lpt=new Qc({center:new h,semiMajorAxis:1,semiMinorAxis:1}),Cc={center:new h,radius:void 0,ellipsoid:oe.clone(oe.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new Pe,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};ab.unpack=function(e,t,n){let i=Qc.unpack(e,t,lpt);return Cc.center=h.clone(i._center,Cc.center),Cc.ellipsoid=oe.clone(i._ellipsoid,Cc.ellipsoid),Cc.height=i._height,Cc.extrudedHeight=i._extrudedHeight,Cc.granularity=i._granularity,Cc.vertexFormat=Pe.clone(i._vertexFormat,Cc.vertexFormat),Cc.stRotation=i._stRotation,Cc.shadowVolume=i._shadowVolume,l(n)?(Cc.semiMajorAxis=i._semiMajorAxis,Cc.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new Qc(Cc),n):(Cc.radius=i._semiMajorAxis,new ab(Cc))};ab.createGeometry=function(e){return Qc.createGeometry(e._ellipseGeometry)};ab.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,o=e._ellipseGeometry._ellipsoid,r=t(i,o),s=n(i,o);return new ab({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:o,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:Pe.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(ab.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var Gj=ab;var NNi=T(S(),1);function YV(e){e=g(e,g.EMPTY_OBJECT);let t=e.radius,n={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 Sd(n),this._workerName="createCircleOutlineGeometry"}YV.packedLength=Sd.packedLength;YV.pack=function(e,t,n){return Sd.pack(e._ellipseGeometry,t,n)};var dpt=new Sd({center:new h,semiMajorAxis:1,semiMinorAxis:1}),Od={center:new h,radius:void 0,ellipsoid:oe.clone(oe.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};YV.unpack=function(e,t,n){let i=Sd.unpack(e,t,dpt);return Od.center=h.clone(i._center,Od.center),Od.ellipsoid=oe.clone(i._ellipsoid,Od.ellipsoid),Od.height=i._height,Od.extrudedHeight=i._extrudedHeight,Od.granularity=i._granularity,Od.numberOfVerticalLines=i._numberOfVerticalLines,l(n)?(Od.semiMajorAxis=i._semiMajorAxis,Od.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new Sd(Od),n):(Od.radius=i._semiMajorAxis,new YV(Od))};YV.createGeometry=function(e){return Sd.createGeometry(e._ellipseGeometry)};var Ej=YV;var BNi=T(S(),1);function upt(e){return e=g(e,g.EMPTY_OBJECT),UT.fromIonAssetId(2426648,{requestVertexNormals:g(e.requestVertexNormals,!1)})}var qF=upt;var KNi=T(S(),1);function mpt(e){return e=g(e,g.EMPTY_OBJECT),UT.fromIonAssetId(1,{requestVertexNormals:g(e.requestVertexNormals,!1),requestWaterMask:g(e.requestWaterMask,!1)})}var kT=mpt;var i5i=T(S(),1);function HV(e){e=g(e,g.EMPTY_OBJECT),this._callback=e.callback,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Oi({ellipsoid:g(e.ellipsoid,oe.WGS84)})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=zr.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new ye;let n=e.credit;typeof n=="string"&&(n=new Vt(n)),this._credit=n}Object.defineProperties(HV.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});HV.prototype.requestTileGeometry=function(e,t,n,i){let o=this._callback(e,t,n);if(!l(o))return;let r=this._width,s=this._height;return Promise.resolve(o).then(function(a){let c=a;return Array.isArray(c)&&(c=new Float64Array(c)),new va({buffer:c,width:r,height:s})})};HV.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};HV.prototype.getTileDataAvailable=function(e,t,n){};HV.prototype.loadTileDataAvailability=function(e,t,n){};var Ij=HV;var s5i=T(S(),1);var hpt=1953029805,fpt=2917034100;function Xj(e,t){if(Xj.passThroughDataForTesting)return t;let n=e.byteLength;if(n===0||n%4!==0)throw new me("The length of key must be greater than 0 and a multiple of 4.");let i=new DataView(t),o=i.getUint32(0,!0);if(o===hpt||o===fpt)return t;let r=new DataView(e),s=0,a=t.byteLength,c=a-a%8,d=n,u,m=8;for(;s<c;)for(m=(m+8)%24,u=m;s<c&&u<d;)i.setUint32(s,i.getUint32(s,!0)^r.getUint32(u,!0),!0),i.setUint32(s+4,i.getUint32(s+4,!0)^r.getUint32(u+4,!0),!0),s+=8,u+=24;if(s<a)for(u>=d&&(m=(m+8)%24,u=m);s<a;)i.setUint8(s,i.getUint8(s)^r.getUint8(u)),s++,u++}Xj.passThroughDataForTesting=!1;var $F=Xj;var c5i=T(S(),1);function Oxe(e){this.proxy=e}Oxe.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var Wj=Oxe;var m5i=T(S(),1);function Ih(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=l(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(Ih.prototype,{length:{get:function(){return this._length}},maximumLength:{get:function(){return this._maximumLength},set:function(e){if(l(e)){for(;this._length>e;)this.removeMinimum();this._array.length=e}this._maximumLength=e}},internalArray:{get:function(){return this._array}},comparator:{get:function(){return this._comparator}}});Ih.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,o=new Ih({comparator:t,maximumLength:e});o._length=i;for(let r=0;r<i;r++)o._array[r]=n[r];return o};Ih.prototype.reset=function(){this._length=0;let e=this._maximumLength;if(l(e))for(let t=0;t<e;t++)this._array[t]=void 0;else this._array.length=0};Ih.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)Yxe(this,t)};Ih.prototype.insert=function(e){let t,n=this._maximumLength;if(l(n)){if(n===0)return;if(this._length===n){let o=this._array[0];if(this._comparator(e,o)<=0)return e;t=this.removeMinimum()}}let i=this._length;return this._array[i]=e,this._length++,Yxe(this,i),t};Ih.prototype.removeMinimum=function(){let e=this._length;if(e===0)return;this._length--;let t=this._array[0];return e>=2&&(this._array[0]=this._array[e-1],Hxe(this,0)),this._array[e-1]=void 0,t};Ih.prototype.removeMaximum=function(){let e=this._length;if(e===0)return;this._length--;let t;if(e<=2)t=this._array[e-1];else{let n=Pj(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&Hxe(this,n)}return this._array[e-1]=void 0,t};Ih.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};Ih.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[Pj(this,1,2)?1:2]};function OD(e,t,n){let i=e._array,o=i[t];i[t]=i[n],i[n]=o}function e9(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function Pj(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function Yxe(e,t){if(t===0)return;let n=Math.floor(W.log2(t+1))%2===0,i=Math.floor((t-1)/2),o=e9(e,t,i);for(o!==n&&(OD(e,t,i),t=i);t>=3;){let r=Math.floor((t-3)/4);if(e9(e,t,r)!==o)break;OD(e,t,r),t=r}}function Hxe(e,t){let n=e._length,i=Math.floor(W.log2(t+1))%2===0,o;for(;(o=2*t+1)<n;){let r=o,s=o+1;if(s<n){e9(e,s,r)===i&&(r=s);let a=2*o+1,c=Math.max(Math.min(n-a,4),0);for(let d=0;d<c;d++){let u=a+d;e9(e,u,r)===i&&(r=u)}}if(e9(e,r,t)===i&&(OD(e,r,t),r!==o&&r!==s)){let a=Math.floor((r-1)/2);Pj(e,r,a)===i&&OD(e,r,a)}t=r}}var DT=Ih;var y5i=T(S(),1);function YD(){fe.throwInstantiationError()}Object.defineProperties(YD.prototype,{credit:{get:fe.throwInstantiationError}});YD.getCreditsFromResult=function(e){if(l(e.attributions))return e.attributions.map(Vt.getIonCredit)};YD.prototype.geocode=fe.throwInstantiationError;var KV=YD;var x5i=T(S(),1),ppt={SEARCH:0,AUTOCOMPLETE:1},xg=Object.freeze(ppt);var S5i=T(S(),1);function Kxe(){fe.throwInstantiationError()}Kxe.createGeometry=function(e){fe.throwInstantiationError()};var vj=Kxe;var V5i=T(S(),1);function bpt(e,t,n){let i=new Uint8ClampedArray(e.buffer),o=new ImageData(i,t,n),r=document.createElement("canvas");return r.width=t,r.height=n,r.getContext("2d").putImageData(o,0,0),r}var t9=bpt;var Y5i=T(S(),1),Spt=T(wj(),1);var X5i=T(S(),1);var Z5i=T(S(),1);function ypt(e,t){return(e&t)!==0}var Vc=ypt;var gpt=[1,2,4,8],zxe=15,xpt=16,_pt=64,Tpt=128;function Jf(e,t,n,i,o,r){this._bits=e,this.cnodeVersion=t,this.imageryVersion=n,this.terrainVersion=i,this.imageryProvider=o,this.terrainProvider=r,this.ancestorHasTerrain=!1,this.terrainState=void 0}Jf.clone=function(e,t){return l(t)?(t._bits=e._bits,t.cnodeVersion=e.cnodeVersion,t.imageryVersion=e.imageryVersion,t.terrainVersion=e.terrainVersion,t.imageryProvider=e.imageryProvider,t.terrainProvider=e.terrainProvider):t=new Jf(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};Jf.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};Jf.prototype.hasSubtree=function(){return Vc(this._bits,xpt)};Jf.prototype.hasImagery=function(){return Vc(this._bits,_pt)};Jf.prototype.hasTerrain=function(){return Vc(this._bits,Tpt)};Jf.prototype.hasChildren=function(){return Vc(this._bits,zxe)};Jf.prototype.hasChild=function(e){return Vc(this._bits,gpt[e])};Jf.prototype.getChildBitmask=function(){return this._bits&zxe};var n9=Jf;function Cpt(e){let t=e.length,n=new ArrayBuffer(t),i=new Uint8Array(n);for(let o=0;o<t;++o)i[o]=e.charCodeAt(o);return n}var Vpt=Cpt(`E\xF4\xBD\vy\xE2jE"\x92,\xCDq\xF8IFgQ\0B%\xC6\xE8a,f)\b\xC64\xDCjb%y
wmi\xD6\xF0\x9Ck\x93\xA1\xBDNu\xE0A[\xDF@V\f\xD9\xBBr\x9B\x81|3S\xEEOl\xD4q\xB0{\xC0\x7FEVZ\xADwUe\v3\x92*\xACl5\xC50s\xF83>mF8J\xB4\xDD\xF0.\xDDu\xDA\x8CDt"\xFAa"\f3"So\xAF9D\v\x8C9\xD99L\xB9\xBF\x7F\xAB\\\x8CP_\x9F"ux\xE9\x07q\x91h;\xC1\xC4\x9B\x7F\xF0<VqH\x82'UfYNe\x98u\xA3aF}a?A\0\x9F\xD7\xB44M\xCE\x87F\xB0\xD5\xB8\x8A'{\x8B\xDC+\xBBMg0\xC8\xD1\xF6\\\x8FP\xFA[/F\x9Bn5/'C.\xEB
\f^\xA5s\x1Be4\xE5l.jC'c#U\xA9?q{gC}:\xAF\xCD\xE2TU\x9C\xFDK\xC6\xE2\x9F/(\xED\xCB\\\xC6-f\x07\x88\xA7;/*"N\xB0k.\xDD\r\x95}}G\xBAC\xB2\xB2+>M\xAA>}\xE6\xCEI\x89\xC6\xE6x\fa1-\xA4O\xA5~q \x88\xEC\r1\xE8N\v\0nPh}=\b\r\x95\xA6n\xA3h\x97$[k\xF3#\xF3\xB6s\xB3\r\v@\xC0\x9F\xD8Q]\xFA".j\xDFI\0\xB9\xA0wU\xC6\xEFj\xBF{GL\x7F\x83\xEE\xDC\xDCF\x85\xA9\xADS\x07+S4\x07\xFF\x94Y\xE48\xE81\x83N\xB9XFk\xCB-#\x86\x92p\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E7\v:\xBBOb{\xD2M1\x95/\xBD8{\xA8O!\xE1\xECFpv\x95})"x\x88
\x90\xDD\x9D\\\xDA\xDEQ\xCF\xF0\xFCYRe|3\xDF\xF3H\xDA\xBB*u\xDB\`\xB2\xD4\xFC\xED\x1B\xEC\x7F5\xA8\xFF(1\x07-\xC8\xDC\x88F|\x8A["`);function Yd(e){this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=W.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={}}Object.defineProperties(Yd.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});Yd.fromUrl=async function(e){let t=e;typeof t!="string"&&!(t instanceof Xe)&&(t=e.url);let n=Xe.createIfNeeded(t);n.appendForwardSlash();let i=new Yd;i._resource=n;try{await Lpt(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(o){let r=`An error occurred while accessing ${Qxe(i,"",1).url}: ${o}`;throw new me(r)}return i};Yd.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;Vc(t,r)?Vc(e,r)&&(s|=1):(s|=2,Vc(e,r)||(s|=1)),i+=s}return i};Yd.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let o=i;o>=0;--o){let r=1<<o,s=+e[i-o];Vc(s,2)?Vc(s,1)||(t|=r):(n|=r,Vc(s,1)&&(t|=r))}return{x:t,y:n,level:i}};Yd.prototype.isValid=function(e){let t=this.getTileInformationFromQuadKey(e);if(l(t))return t!==null;let n=!0,i=e,o;for(;i.length>1;)if(o=i.substring(i.length-1),i=i.substring(0,i.length-1),t=this.getTileInformationFromQuadKey(i),l(t)){!t.hasSubtree()&&!t.hasChild(parseInt(o))&&(n=!1);break}else if(t===null){n=!1;break}return n};var Jxe=new gi("decodeGoogleEarthEnterprisePacket");Yd.prototype.getQuadTreePacket=function(e,t,n){t=g(t,1),e=g(e,"");let o=Qxe(this,e,t,n).fetchArrayBuffer();if(!l(o))return;let r=this._tileInfo,s=this.key;return o.then(function(a){return Jxe.scheduleTask({buffer:a,quadKey:e,type:"Metadata",key:s},[a]).then(function(d){let u,m=-1;if(e!==""){m=e.length+1;let f=d[e];u=r[e],u._bits|=f._bits,delete d[e]}let p=Object.keys(d);p.sort(function(f,x){return f.length-x.length});let y=p.length;for(let f=0;f<y;++f){let x=p[f];if(d[x]!==null){let C=n9.clone(d[x]),V=x.length;if(V===m)C.setParent(u);else if(V>1){let L=r[x.substring(0,x.length-1)];C.setParent(L)}r[x]=C}else r[x]=null}})})};Yd.prototype.populateSubtree=function(e,t,n,i){let o=Yd.tileXYToQuadKey(e,t,n);return Mj(this,o,i)};function Mj(e,t,n){let i=e._tileInfo,o=t,r=i[o];if(l(r)&&(!r.hasSubtree()||r.hasChildren()))return r;for(;r===void 0&&o.length>1;)o=o.substring(0,o.length-1),r=i[o];let s,a=e._subtreePromises,c=a[o];if(l(c))return c.then(function(){return s=new Yo({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),Mj(e,t,s)});if(!l(r)||!r.hasSubtree())return Promise.reject(new me(`Couldn't load metadata for tile ${t}`));if(c=e.getQuadTreePacket(o,r.cnodeVersion,n),!!l(c))return a[o]=c,c.then(function(){return s=new Yo({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),Mj(e,t,s)}).finally(function(){delete a[o]})}Yd.prototype.getTileInformation=function(e,t,n){let i=Yd.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};Yd.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function Qxe(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var Fj,Aj;function Lpt(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(Aj)){let n=on("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;Aj=Yg(n).then(function(){Fj=window.cesiumGoogleEarthDbRootParser(Spt),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return Aj.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=Fj.EncryptedDbRootProto.decode(new Uint8Array(n)),o=i.encryptionData,r=o.byteOffset,s=r+o.byteLength,a=e.key=o.buffer.slice(r,s);o=i.dbrootData,r=o.byteOffset,s=r+o.byteLength;let c=o.buffer.slice(r,s);return Jxe.scheduleTask({buffer:c,type:"DbRoot",key:a},[c])}).then(function(n){let i=Fj.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=g(i.imageryPresent,e.imageryPresent),e.protoImagery=i.protoImagery,e.terrainPresent=g(i.terrainPresent,e.terrainPresent),l(i.endSnippet)&&l(i.endSnippet.model)){let a=i.endSnippet.model;e.negativeAltitudeExponentBias=g(a.negativeAltitudeExponentBias,e.negativeAltitudeExponentBias),e.negativeAltitudeThreshold=g(a.compressedNegativeAltitudeThreshold,e.negativeAltitudeThreshold)}l(i.databaseVersion)&&(e._quadPacketVersion=g(i.databaseVersion.quadtreeVersion,e._quadPacketVersion));let o=e.providers,r=g(i.providerInfo,[]),s=r.length;for(let a=0;a<s;++a){let c=r[a],d=c.copyrightString;l(d)&&(o[c.providerId]=new Vt(d.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=Vpt})}var cb=Yd;var cUi=T(S(),1);function BT(e){e=g(e,g.EMPTY_OBJECT),this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;let t=g(e.childTileMask,15),n=t&3;n|=t&4?8:0,n|=t&8?4:0,this._childTileMask=n,this._createdByUpsampling=g(e.createdByUpsampling,!1),this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0,this._minimumHeight=void 0,this._maximumHeight=void 0}Object.defineProperties(BT.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var $xe="createVerticesFromGoogleEarthEnterpriseBuffer",Rpt=new gi($xe),Zpt=new gi($xe,xh.maximumAsynchronousTasks),jxe=new de,Nj=new de;BT.prototype.createMesh=function(e){e=g(e,g.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=g(e.exaggeration,1),s=g(e.exaggerationRelativeHeight,0),a=g(e.throttle,!0),c=t.ellipsoid;t.tileXYToNativeRectangle(n,i,o,jxe),t.tileXYToRectangle(n,i,o,Nj);let d=c.cartographicToCartesian(de.center(Nj)),m=40075.16/(1<<o);this._skirtHeight=Math.min(m*8,1e3);let y=(a?Zpt:Rpt).scheduleTask({buffer:this._buffer,nativeRectangle:jxe,rectangle:Nj,relativeToCenter:d,ellipsoid:c,skirtHeight:this._skirtHeight,exaggeration:r,exaggerationRelativeHeight:s,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!l(y))return;let f=this;return y.then(function(x){return f._mesh=new Qu(d,new Float32Array(x.vertices),new Uint16Array(x.indices),x.indexCountWithoutSkirts,x.vertexCountWithoutSkirts,x.minimumHeight,x.maximumHeight,ce.clone(x.boundingSphere3D),h.clone(x.occludeePointInScaledSpace),x.numberOfAttributes,Xn.clone(x.orientedBoundingBox),yc.clone(x.encoding),x.westIndicesSouthToNorth,x.southIndicesEastToWest,x.eastIndicesNorthToSouth,x.northIndicesWestToEast),f._minimumHeight=x.minimumHeight,f._maximumHeight=x.maximumHeight,f._buffer=void 0,f._mesh})};BT.prototype.interpolateHeight=function(e,t,n){let i=W.clamp((t-e.west)/e.width,0,1),o=W.clamp((n-e.south)/e.height,0,1);return l(this._mesh)?Wpt(this,i,o):wpt(this,i,o,e)};var Gpt=new gi("upsampleQuantizedTerrainMesh",xh.maximumAsynchronousTasks);BT.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,d=n*2===r,u=e.ellipsoid,m=e.tileXYToRectangle(o,r,s),p=Gpt.scheduleTask({vertices:a.vertices,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:d,childRectangle:m,ellipsoid:u});if(!l(p))return;let y=this;return p.then(function(f){let x=new Uint16Array(f.vertices),_=Ne.createTypedArray(x.length/3,f.indices),C=y._skirtHeight;return new NT({quantizedVertices:x,indices:_,minimumHeight:f.minimumHeight,maximumHeight:f.maximumHeight,boundingSphere:ce.clone(f.boundingSphere),orientedBoundingBox:Xn.clone(f.orientedBoundingBox),horizonOcclusionPoint:h.clone(f.horizonOcclusionPoint),westIndices:f.westIndices,southIndices:f.southIndices,eastIndices:f.eastIndices,northIndices:f.northIndices,westSkirtHeight:C,southSkirtHeight:C,eastSkirtHeight:C,northSkirtHeight:C,childTileMask:0,createdByUpsampling:!0,credits:y._credits})})};BT.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};BT.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var Ept=new B,Ipt=new B,Xpt=new B,e_e=new h;function Wpt(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let d=s[a],u=s[a+1],m=s[a+2],p=r.decodeTextureCoordinates(o,d,Ept),y=r.decodeTextureCoordinates(o,u,Ipt),f=r.decodeTextureCoordinates(o,m,Xpt),x=sb.computeBarycentricCoordinates(t,n,p.x,p.y,y.x,y.y,f.x,f.y,e_e);if(x.x>=-1e-15&&x.y>=-1e-15&&x.z>=-1e-15){let _=r.decodeHeight(o,d),C=r.decodeHeight(o,u),V=r.decodeHeight(o,m);return x.x*_+x.y*C+x.z*V}}}var Ppt=Uint16Array.BYTES_PER_ELEMENT,qxe=Uint32Array.BYTES_PER_ELEMENT,Uj=Int32Array.BYTES_PER_ELEMENT,vpt=Float32Array.BYTES_PER_ELEMENT,kj=Float64Array.BYTES_PER_ELEMENT;function wpt(e,t,n,i){let o=e._buffer,r=0,s=0,a=0;n>.5?(t>.5?(r=2,s=.5):r=3,a=.5):t>.5&&(r=1,s=.5);let c=new DataView(o),d=0;for(let G=0;G<r;++G)d+=c.getUint32(d,!0),d+=qxe;d+=qxe,d+=2*kj;let u=W.toRadians(c.getFloat64(d,!0)*180);d+=kj;let m=W.toRadians(c.getFloat64(d,!0)*180);d+=kj;let p=i.width/u/2,y=i.height/m/2,f=c.getInt32(d,!0);d+=Uj;let x=c.getInt32(d,!0)*3;d+=Uj,d+=Uj;let _=new Array(f),C=new Array(f),V=new Array(f),L;for(L=0;L<f;++L)_[L]=s+c.getUint8(d++)*p,C[L]=a+c.getUint8(d++)*y,V[L]=c.getFloat32(d,!0)*6371010,d+=vpt;let Z=new Array(x);for(L=0;L<x;++L)Z[L]=c.getUint16(d,!0),d+=Ppt;for(L=0;L<x;L+=3){let G=Z[L],I=Z[L+1],P=Z[L+2],v=_[G],F=_[I],M=_[P],b=C[G],R=C[I],E=C[P],X=sb.computeBarycentricCoordinates(t,n,v,b,F,R,M,E,e_e);if(X.x>=-1e-15&&X.y>=-1e-15&&X.z>=-1e-15)return X.x*V[G]+X.y*V[I]+X.z*V[P]}}var zV=BT;var RUi=T(S(),1);var rm={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},HD=new te;function KD(){this._terrainCache={},this._lastTidy=te.now()}KD.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:te.now()}};KD.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};KD.prototype.tidy=function(){if(te.now(HD),te.secondsDifference(HD,this._lastTidy)>10){let e=this._terrainCache,t=Object.keys(e),n=t.length;for(let i=0;i<n;++i){let o=t[i],r=e[o];te.secondsDifference(HD,r.timestamp)>10&&delete e[o]}te.clone(HD,this._lastTidy)}};function _g(e){e=g(e,g.EMPTY_OBJECT),this._tilingScheme=new Oi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new de(-W.PI,-W.PI,W.PI,W.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new Vt(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new KD,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new ye}Object.defineProperties(_g.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}},credit:{get:function(){return this._credit}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});_g.fromMetadata=function(e,t){if(!e.terrainPresent)throw new me(`The server ${e.url} doesn't have terrain`);let n=new _g(t);return n._metadata=e,n};var Fpt=new gi("decodeGoogleEarthEnterprisePacket");function t_e(e,t,n){let i=t.getChildBitmask();if(t.terrainState===rm.PARENT){i=0;for(let o=0;o<4;++o){let r=n.getTileInformationFromQuadKey(e+o.toString());l(r)&&r.hasTerrain()&&(i|=1<<o)}}return i}_g.prototype.requestTileGeometry=function(e,t,n,i){let o=cb.tileXYToQuadKey(e,t,n),r=this._terrainCache,s=this._metadata,a=s.getTileInformationFromQuadKey(o);if(!l(a))return Promise.reject(new me("Terrain tile doesn't exist"));let c=a.terrainState;l(c)||(c=a.terrainState=rm.UNKNOWN);let d=r.get(o);if(l(d)){let C=s.providers[a.terrainProvider];return Promise.resolve(new zV({buffer:d,childTileMask:t_e(o,a,s),credits:l(C)?[C]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(r.tidy(),a.ancestorHasTerrain){if(c===rm.NONE)return Promise.reject(new me("Terrain tile doesn't exist"))}else return Promise.resolve(new va({buffer:new Uint8Array(16*16),width:16,height:16}));let u,m=o,p=-1;switch(c){case rm.SELF:p=a.terrainVersion;break;case rm.PARENT:m=m.substring(0,m.length-1),u=s.getTileInformationFromQuadKey(m),p=u.terrainVersion;break;case rm.UNKNOWN:a.hasTerrain()?p=a.terrainVersion:(m=m.substring(0,m.length-1),u=s.getTileInformationFromQuadKey(m),l(u)&&u.hasTerrain()&&(p=u.terrainVersion));break}if(p<0)return Promise.reject(new me("Terrain tile doesn't exist"));let y=this._terrainPromises,f=this._terrainRequests,x,_;if(l(y[m]))x=y[m],_=f[m];else{_=i;let C=Apt(this,m,p,_).fetchArrayBuffer();if(!l(C))return;x=C.then(function(V){return l(V)?Fpt.scheduleTask({buffer:V,type:"Terrain",key:s.key},[V]).then(function(L){let Z=s.getTileInformationFromQuadKey(m);Z.terrainState=rm.SELF,r.add(m,L[0]);let G=Z.terrainProvider,I=L.length-1;for(let P=0;P<I;++P){let v=m+P.toString(),F=s.getTileInformationFromQuadKey(v);l(F)&&(r.add(v,L[P+1]),F.terrainState=rm.PARENT,F.terrainProvider===0&&(F.terrainProvider=G))}}):Promise.reject(new me("Failed to load terrain."))}),y[m]=x,f[m]=_,x=x.finally(function(){delete y[m],delete f[m]})}return x.then(function(){let C=r.get(o);if(l(C)){let V=s.providers[a.terrainProvider];return new zV({buffer:C,childTileMask:t_e(o,a,s),credits:l(V)?[V]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold})}return Promise.reject(new me("Failed to load terrain."))}).catch(function(C){return _.state===ti.CANCELLED?(i.state=_.state,Promise.reject(C)):(a.terrainState=rm.NONE,Promise.reject(C))})};_g.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};_g.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,o=cb.tileXYToQuadKey(e,t,n),r=i.getTileInformation(e,t,n);if(r===null)return!1;if(l(r)){if(!r.ancestorHasTerrain)return!0;let s=r.terrainState;if(s===rm.NONE)return!1;if((!l(s)||s===rm.UNKNOWN)&&(r.terrainState=rm.UNKNOWN,!r.hasTerrain())){o=o.substring(0,o.length-1);let a=i.getTileInformationFromQuadKey(o);if(!l(a)||!a.hasTerrain())return!1}return!0}if(i.isValid(o)){let s=new Yo({throttle:!1,throttleByServer:!0,type:os.TERRAIN});i.populateSubtree(e,t,n,s)}return!1};_g.prototype.loadTileDataAvailability=function(e,t,n){};function Apt(e,t,n,i){return n=l(n)&&n>0?n:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1c-0${t}-t.${n.toString()}`,request:i})}var Dj=_g;var IUi=T(S(),1);var zD={};zD.defaultApiKey=void 0;zD.mapTilesApiEndpoint=new Xe({url:"https://tile.googleapis.com/v1/"});zD.getDefaultCredit=function(){return new Vt('<img src="https://assets.ion-development.cesium.com/google-credit.png" alt="Google">',!0)};var OT=zD;var PUi=T(S(),1);var i9={};i9.type=void 0;i9.getRequiredDataPoints=fe.throwInstantiationError;i9.interpolateOrderZero=fe.throwInstantiationError;i9.interpolate=fe.throwInstantiationError;var Bj=i9;var zUi=T(S(),1);var UUi=T(S(),1);function Oj(e){this._url=Xe.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(Oj.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});Oj.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===xg.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(i){return i.features.map(function(o){let r,s=o.bbox;if(l(s))r=de.fromDegrees(s[0],s[1],s[2],s[3]);else{let a=o.geometry.coordinates[0],c=o.geometry.coordinates[1];r=h.fromDegrees(a,c)}return{displayName:o.properties.label,destination:r,attributions:i.attributions}})})};var o9=Oj;function Yj(e){e=g(e,g.EMPTY_OBJECT);let t=g(e.accessToken,Zm.defaultAccessToken),n=Xe.createIfNeeded(g(e.server,Zm.defaultServer));n.appendForwardSlash();let i=Zm.getDefaultTokenCredit(t);l(i)&&e.scene.frameState.creditDisplay.addStaticCredit(Vt.clone(i));let o=n.getDerivedResource({url:"v1/geocode"});l(t)&&o.appendQueryParameters({access_token:t}),this._accessToken=t,this._server=n,this._pelias=new o9(o)}Object.defineProperties(Yj.prototype,{credit:{get:function(){}}});Yj.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var r9=Yj;var jUi=T(S(),1);function JD(){fe.throwInstantiationError()}Object.defineProperties(JD.prototype,{ellipsoid:{get:fe.throwInstantiationError}});JD.prototype.project=fe.throwInstantiationError;JD.prototype.unproject=fe.throwInstantiationError;var Hj=JD;var nki=T(S(),1);function JV(e){e=g(e,g.EMPTY_OBJECT);let t=e.weights,n=e.times;this._times=n,this._weights=t,this._count=t.length/n.length,this._lastTimeIndex=0}Object.defineProperties(JV.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});JV.prototype.findTimeInterval=lo.prototype.findTimeInterval;JV.prototype.wrapTime=lo.prototype.wrapTime;JV.prototype.clampTime=lo.prototype.clampTime;JV.prototype.evaluate=function(e,t){let n=this.weights,i=this.times,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),r=(e-i[o])/(i[o+1]-i[o]);l(t)||(t=new Array(this._count));for(let s=0;s<this._count;s++){let a=o*this._count+s;t[s]=n[a]*(1-r)+n[a+this._count]*r}return t};var Kj=JV;var uki=T(S(),1);function zj(e,t,n){e=Xe.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=g(n,{}),this._credit=new Vt('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(zj.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});zj.prototype.geocode=async function(e){return this._url.getDerivedResource({url:"json",queryParameters:Tt(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let o,r=i.bounds;if(l(r))o=de.fromDegrees(r.southwest.lng,r.southwest.lat,r.northeast.lng,r.northeast.lat);else{let s=i.geometry.lat,a=i.geometry.lng;o=h.fromDegrees(s,a)}return{displayName:i.formatted,destination:o}})})};var Jj=zj;var fki=T(S(),1);var Mpt={packedLength:void 0,pack:fe.throwInstantiationError,unpack:fe.throwInstantiationError},Qj=Mpt;var yki=T(S(),1);var Npt={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:fe.throwInstantiationError,unpackInterpolationResult:fe.throwInstantiationError},jj=Npt;var Ski=T(S(),1);var Upt=new h;function kpt(e,t,n,i){let o=rx(e,t,n,i,Upt);return l(o)?o.x>0&&o.y>0&&o.z>0:!1}var qj=kpt;var Lki=T(S(),1);function n_e(){fe.throwInstantiationError()}n_e.prototype.getURL=fe.throwInstantiationError;var $j=n_e;var Gki=T(S(),1);async function Dpt(e,t,n,i){return l(i)||(i=!1),Ypt(e,t,n,i)}function Bpt(e,t,n){let i=e[0],o=i.terrainProvider.requestTileGeometry(i.x,i.y,i.level);if(!o)return!1;let r;return n?r=o.then(o_e(i)):r=o.then(o_e(i)).catch(Hpt(i)),e.shift(),t.push(r),!0}function Opt(e){return new Promise(function(t){setTimeout(t,e)})}function e8(e,t,n){return e.length?Bpt(e,t,n)?e8(e,t):Opt(100).then(()=>e8(e,t)):Promise.resolve()}function Ypt(e,t,n,i){let o=e.tilingScheme,r,s=[],a={};for(r=0;r<n.length;++r){let d=o.positionToTileXY(n[r],t);if(!l(d))continue;let u=d.toString();if(!a.hasOwnProperty(u)){let m={x:d.x,y:d.y,level:t,tilingScheme:o,terrainProvider:e,positions:[]};a[u]=m,s.push(m)}a[u].positions.push(n[r])}let c=[];return e8(s,c,i).then(function(){return Promise.all(c).then(function(){return n})})}function i_e(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function o_e(e){let t=e.positions,n=e.tilingScheme.tileXYToRectangle(e.x,e.y,e.level);return function(i){let o=!1;for(let r=0;r<t.length;++r){let s=t[r];if(!i_e(s,i,n)){o=!0;break}}return o?i.createMesh({tilingScheme:e.tilingScheme,x:e.x,y:e.y,level:e.level,throttle:!1}).then(function(){for(let r=0;r<t.length;++r){let s=t[r];i_e(s,i,n)}}):Promise.resolve()}}function Hpt(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var s9=Dpt;var Pki=T(S(),1);var t8=new B;async function r_e(e,t,n){l(n)||(n=!1);let i=[],o=[],r=e.availability,s=[];for(let c=0;c<t.length;++c){let d=t[c],u=r.computeMaximumLevelAtPosition(d);if(o[c]=u,u===0){e.tilingScheme.positionToTileXY(d,1,t8);let p=e.loadTileDataAvailability(t8.x,t8.y,1);l(p)&&s.push(p)}let m=i[u];l(m)||(i[u]=m=[]),m.push(d)}await Promise.all(s),await Promise.all(i.map(function(c,d){if(l(c))return s9(e,d,c,n)}));let a=[];for(let c=0;c<t.length;++c){let d=t[c];r.computeMaximumLevelAtPosition(d)!==o[c]&&a.push(d)}return a.length>0&&await r_e(e,a,n),t}var YT=r_e;var Qki=T(S(),1);function Kpt(e,t,n,i,o,r,s){let a=Ei.numberOfPoints(e,t,o),c,d=n.red,u=n.green,m=n.blue,p=n.alpha,y=i.red,f=i.green,x=i.blue,_=i.alpha;if(O.equals(n,i)){for(c=0;c<a;c++)r[s++]=O.floatToByte(d),r[s++]=O.floatToByte(u),r[s++]=O.floatToByte(m),r[s++]=O.floatToByte(p);return s}let C=(y-d)/a,V=(f-u)/a,L=(x-m)/a,Z=(_-p)/a,G=s;for(c=0;c<a;c++)r[G++]=O.floatToByte(d+c*C),r[G++]=O.floatToByte(u+c*V),r[G++]=O.floatToByte(m+c*L),r[G++]=O.floatToByte(p+c*Z);return G}function a9(e){e=g(e,g.EMPTY_OBJECT);let t=e.positions,n=e.colors,i=g(e.colorsPerVertex,!1);this._positions=t,this._colors=n,this._colorsPerVertex=i,this._arcType=g(e.arcType,jt.GEODESIC),this._granularity=g(e.granularity,W.RADIANS_PER_DEGREE),this._ellipsoid=g(e.ellipsoid,oe.WGS84),this._workerName="createSimplePolylineGeometry";let o=1+t.length*h.packedLength;o+=l(n)?1+n.length*O.packedLength:1,this.packedLength=o+oe.packedLength+3}a9.pack=function(e,t,n){n=g(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._colors;for(r=l(s)?s.length:0,t[n++]=r,i=0;i<r;++i,n+=O.packedLength)O.pack(s[i],t,n);return oe.pack(e._ellipsoid,t,n),n+=oe.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};a9.unpack=function(e,t,n){t=g(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=O.packedLength)s[i]=O.unpack(e,t);let a=oe.unpack(e,t);t+=oe.packedLength;let c=e[t++]===1,d=e[t++],u=e[t];return l(n)?(n._positions=r,n._colors=s,n._ellipsoid=a,n._colorsPerVertex=c,n._arcType=d,n._granularity=u,n):new a9({positions:r,colors:s,ellipsoid:a,colorsPerVertex:c,arcType:d,granularity:u})};var QD=new Array(2),jD=new Array(2),zpt={positions:QD,height:jD,ellipsoid:void 0,minDistance:void 0,granularity:void 0};a9.createGeometry=function(e){let t=e._positions,n=e._colors,i=e._colorsPerVertex,o=e._arcType,r=e._granularity,s=e._ellipsoid,a=W.chordLength(r,s.maximumRadius),c=l(n)&&!i,d,u=t.length,m,p,y,f,x=0;if(o===jt.GEODESIC||o===jt.RHUMB){let Z,G,I;o===jt.GEODESIC?(Z=W.chordLength(r,s.maximumRadius),G=Ei.numberOfPoints,I=Ei.generateArc):(Z=r,G=Ei.numberOfPointsRhumbLine,I=Ei.generateRhumbArc);let P=Ei.extractHeights(t,s),v=zpt;if(o===jt.GEODESIC?v.minDistance=a:v.granularity=r,v.ellipsoid=s,c){let F=0;for(d=0;d<u-1;d++)F+=G(t[d],t[d+1],Z)+1;m=new Float64Array(F*3),y=new Uint8Array(F*4),v.positions=QD,v.height=jD;let M=0;for(d=0;d<u-1;++d){QD[0]=t[d],QD[1]=t[d+1],jD[0]=P[d],jD[1]=P[d+1];let b=I(v);if(l(n)){let R=b.length/3;f=n[d];for(let E=0;E<R;++E)y[M++]=O.floatToByte(f.red),y[M++]=O.floatToByte(f.green),y[M++]=O.floatToByte(f.blue),y[M++]=O.floatToByte(f.alpha)}m.set(b,x),x+=b.length}}else if(v.positions=t,v.height=P,m=new Float64Array(I(v)),l(n)){for(y=new Uint8Array(m.length/3*4),d=0;d<u-1;++d){let M=t[d],b=t[d+1],R=n[d],E=n[d+1];x=Kpt(M,b,R,E,a,y,x)}let F=n[u-1];y[x++]=O.floatToByte(F.red),y[x++]=O.floatToByte(F.green),y[x++]=O.floatToByte(F.blue),y[x++]=O.floatToByte(F.alpha)}}else{p=c?u*2-2:u,m=new Float64Array(p*3),y=l(n)?new Uint8Array(p*4):void 0;let Z=0,G=0;for(d=0;d<u;++d){let I=t[d];if(c&&d>0&&(h.pack(I,m,Z),Z+=3,f=n[d-1],y[G++]=O.floatToByte(f.red),y[G++]=O.floatToByte(f.green),y[G++]=O.floatToByte(f.blue),y[G++]=O.floatToByte(f.alpha)),c&&d===u-1)break;h.pack(I,m,Z),Z+=3,l(n)&&(f=n[d],y[G++]=O.floatToByte(f.red),y[G++]=O.floatToByte(f.green),y[G++]=O.floatToByte(f.blue),y[G++]=O.floatToByte(f.alpha))}}let _=new pn;_.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:m}),l(n)&&(_.color=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:4,values:y,normalize:!0})),p=m.length/3;let C=(p-1)*2,V=Ne.createTypedArray(p,C),L=0;for(d=0;d<p-1;++d)V[L++]=d,V[L++]=d+1;return new mt({attributes:_,indices:V,primitiveType:Ae.LINES,boundingSphere:ce.fromPoints(t)})};var n8=a9;var iDi=T(S(),1);function QV(e){let t=g(e.radius,1),i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new Ds(i),this._workerName="createSphereGeometry"}QV.packedLength=Ds.packedLength;QV.pack=function(e,t,n){return Ds.pack(e._ellipsoidGeometry,t,n)};var Jpt=new Ds,Tg={radius:void 0,radii:new h,vertexFormat:new Pe,stackPartitions:void 0,slicePartitions:void 0};QV.unpack=function(e,t,n){let i=Ds.unpack(e,t,Jpt);return Tg.vertexFormat=Pe.clone(i._vertexFormat,Tg.vertexFormat),Tg.stackPartitions=i._stackPartitions,Tg.slicePartitions=i._slicePartitions,l(n)?(h.clone(i._radii,Tg.radii),n._ellipsoidGeometry=new Ds(Tg),n):(Tg.radius=i._radii.x,new QV(Tg))};QV.createGeometry=function(e){return Ds.createGeometry(e._ellipsoidGeometry)};var i8=QV;var sDi=T(S(),1);function Sg(e){}Object.defineProperties(Sg.prototype,{ellipsoid:{get:fe.throwInstantiationError},rectangle:{get:fe.throwInstantiationError},projection:{get:fe.throwInstantiationError}});Sg.prototype.getNumberOfXTilesAtLevel=fe.throwInstantiationError;Sg.prototype.getNumberOfYTilesAtLevel=fe.throwInstantiationError;Sg.prototype.rectangleToNativeRectangle=fe.throwInstantiationError;Sg.prototype.tileXYToNativeRectangle=fe.throwInstantiationError;Sg.prototype.tileXYToRectangle=fe.throwInstantiationError;Sg.prototype.positionToTileXY=fe.throwInstantiationError;var o8=Sg;var hDi=T(S(),1);function HT(e){e=g(e,g.EMPTY_OBJECT),this._clock=void 0,this._element=void 0,this._clockSubscription=void 0,this._seekFunction=void 0,this._lastPlaybackRate=void 0,this.clock=e.clock,this.element=e.element,this.epoch=g(e.epoch,Be.MINIMUM_VALUE),this.tolerance=g(e.tolerance,1),this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(HT.prototype,{clock:{get:function(){return this._clock},set:function(e){let t=this._clock;t!==e&&(l(t)&&(this._clockSubscription(),this._clockSubscription=void 0),l(e)&&(this._clockSubscription=e.onTick.addEventListener(HT.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){let t=this._element;t!==e&&(l(t)&&t.removeEventListener("seeked",this._seekFunction,!1),l(e)&&(this._seeking=!1,this._seekFunction=Qpt(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});HT.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,ue(this)};HT.prototype.isDestroyed=function(){return!1};HT.prototype._trySetPlaybackRate=function(e){if(this._lastPlaybackRate===e.multiplier)return;let t=this._element;try{t.playbackRate=e.multiplier}catch{t.playbackRate=0}this._lastPlaybackRate=e.multiplier};HT.prototype._onTick=function(e){let t=this._element;if(!l(t)||t.readyState<2)return;let n=t.paused,i=e.shouldAnimate;if(i===n&&(i?t.play():t.pause()),this._seeking||this._firstTickAfterSeek){this._firstTickAfterSeek=!1;return}this._trySetPlaybackRate(e);let o=e.currentTime,r=g(this.epoch,Be.MINIMUM_VALUE),s=te.secondsDifference(o,r),a=t.duration,c,d=t.currentTime;t.loop?(s=s%a,s<0&&(s=a-s),c=s):s>a?c=a:s<0?c=0:c=s;let u=i?g(this.tolerance,1):.001;Math.abs(c-d)>u&&(this._seeking=!0,t.currentTime=c)};function Qpt(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var r8=HT;var EDi=T(S(),1);function jpt(e,t){this.rectangle=e,this.maxLevel=t}function s_e(e){this.ellipsoid=g(e.ellipsoid,oe.WGS84),this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}s_e.prototype.build=function(e){e._tilingScheme=this.tilingScheme,e._heightmapWidth=this.heightmapWidth,e._heightmapHeight=this.heightmapHeight,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._rectangles=this.rectangles};function qpt(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new Oi({ellipsoid:e.ellipsoid});else throw new me(`SRS ${n} is not supported`);let i=t.getElementsByTagName("TileFormat")[0];e.heightmapWidth=parseInt(i.getAttribute("width"),10),e.heightmapHeight=parseInt(i.getAttribute("height"),10),e.levelZeroMaximumGeometricError=zr.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.ellipsoid,Math.min(e.heightmapWidth,e.heightmapHeight),e.tilingScheme.getNumberOfXTilesAtLevel(0));let o=t.getElementsByTagName("DataExtent");for(let r=0;r<o.length;++r){let s=o[r],a=W.toRadians(parseFloat(s.getAttribute("minx"))),c=W.toRadians(parseFloat(s.getAttribute("miny"))),d=W.toRadians(parseFloat(s.getAttribute("maxx"))),u=W.toRadians(parseFloat(s.getAttribute("maxy"))),m=parseInt(s.getAttribute("maxlevel"),10);e.rectangles.push(new jpt(new de(a,c,d,u),m))}}function $pt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i=`${i}: ${t.message}`),Eo.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new me(i)}async function e0t(e,t,n){try{let i=await t.fetchXML();qpt(e,i)}catch(i){$pt(t,i,n)}}function Cg(e){e=g(e,g.EMPTY_OBJECT),this._errorEvent=new ye,this._terrainDataStructure={heightScale:1/1e3,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:256*256*256-1};let t=e.credit;typeof t=="string"&&(t=new Vt(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[]}Object.defineProperties(Cg.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});Cg.fromUrl=async function(e,t){t=g(t,g.EMPTY_OBJECT);let n=new s_e(t),i=Xe.createIfNeeded(e);await e0t(n,i);let o=new Cg(t);return n.build(o),o._resource=i,o};Cg.prototype.requestTileGeometry=function(e,t,n,i){let o=this._tilingScheme.getNumberOfYTilesAtLevel(n),s=this._resource.getDerivedResource({url:`${n}/${e}/${o-t-1}.tif`,queryParameters:{cesium:!0},request:i}).fetchImage({preferImageBitmap:!0});if(!l(s))return;let a=this;return Promise.resolve(s).then(function(c){return new va({buffer:pm(c),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:t0t(a,e,t,n),structure:a._terrainDataStructure})})};Cg.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var a_e=new de;function t0t(e,t,n,i){let o=e._tilingScheme,r=e._rectangles,s=o.tileXYToRectangle(t,n,i),a=0;for(let c=0;c<r.length&&a!==15;++c){let d=r[c];if(d.maxLevel<=i)continue;let u=d.rectangle,m=de.intersection(u,s,a_e);l(m)&&(qD(o,u,t*2,n*2,i+1)&&(a|=4),qD(o,u,t*2+1,n*2,i+1)&&(a|=8),qD(o,u,t*2,n*2+1,i+1)&&(a|=1),qD(o,u,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function qD(e,t,n,i,o){let r=e.tileXYToRectangle(n,i,o);return l(de.intersection(r,t,a_e))}Cg.prototype.getTileDataAvailable=function(e,t,n){};Cg.prototype.loadTileDataAvailability=function(e,t,n){};var s8=Cg;var XDi=T(S(),1),n0t={VK_FORMAT_UNDEFINED:0,VK_FORMAT_R4G4_UNORM_PACK8:1,VK_FORMAT_R4G4B4A4_UNORM_PACK16:2,VK_FORMAT_B4G4R4A4_UNORM_PACK16:3,VK_FORMAT_R5G6B5_UNORM_PACK16:4,VK_FORMAT_B5G6R5_UNORM_PACK16:5,VK_FORMAT_R5G5B5A1_UNORM_PACK16:6,VK_FORMAT_B5G5R5A1_UNORM_PACK16:7,VK_FORMAT_A1R5G5B5_UNORM_PACK16:8,VK_FORMAT_R8_UNORM:9,VK_FORMAT_R8_SNORM:10,VK_FORMAT_R8_USCALED:11,VK_FORMAT_R8_SSCALED:12,VK_FORMAT_R8_UINT:13,VK_FORMAT_R8_SINT:14,VK_FORMAT_R8_SRGB:15,VK_FORMAT_R8G8_UNORM:16,VK_FORMAT_R8G8_SNORM:17,VK_FORMAT_R8G8_USCALED:18,VK_FORMAT_R8G8_SSCALED:19,VK_FORMAT_R8G8_UINT:20,VK_FORMAT_R8G8_SINT:21,VK_FORMAT_R8G8_SRGB:22,VK_FORMAT_R8G8B8_UNORM:23,VK_FORMAT_R8G8B8_SNORM:24,VK_FORMAT_R8G8B8_USCALED:25,VK_FORMAT_R8G8B8_SSCALED:26,VK_FORMAT_R8G8B8_UINT:27,VK_FORMAT_R8G8B8_SINT:28,VK_FORMAT_R8G8B8_SRGB:29,VK_FORMAT_B8G8R8_UNORM:30,VK_FORMAT_B8G8R8_SNORM:31,VK_FORMAT_B8G8R8_USCALED:32,VK_FORMAT_B8G8R8_SSCALED:33,VK_FORMAT_B8G8R8_UINT:34,VK_FORMAT_B8G8R8_SINT:35,VK_FORMAT_B8G8R8_SRGB:36,VK_FORMAT_R8G8B8A8_UNORM:37,VK_FORMAT_R8G8B8A8_SNORM:38,VK_FORMAT_R8G8B8A8_USCALED:39,VK_FORMAT_R8G8B8A8_SSCALED:40,VK_FORMAT_R8G8B8A8_UINT:41,VK_FORMAT_R8G8B8A8_SINT:42,VK_FORMAT_R8G8B8A8_SRGB:43,VK_FORMAT_B8G8R8A8_UNORM:44,VK_FORMAT_B8G8R8A8_SNORM:45,VK_FORMAT_B8G8R8A8_USCALED:46,VK_FORMAT_B8G8R8A8_SSCALED:47,VK_FORMAT_B8G8R8A8_UINT:48,VK_FORMAT_B8G8R8A8_SINT:49,VK_FORMAT_B8G8R8A8_SRGB:50,VK_FORMAT_A8B8G8R8_UNORM_PACK32:51,VK_FORMAT_A8B8G8R8_SNORM_PACK32:52,VK_FORMAT_A8B8G8R8_USCALED_PACK32:53,VK_FORMAT_A8B8G8R8_SSCALED_PACK32:54,VK_FORMAT_A8B8G8R8_UINT_PACK32:55,VK_FORMAT_A8B8G8R8_SINT_PACK32:56,VK_FORMAT_A8B8G8R8_SRGB_PACK32:57,VK_FORMAT_A2R10G10B10_UNORM_PACK32:58,VK_FORMAT_A2R10G10B10_SNORM_PACK32:59,VK_FORMAT_A2R10G10B10_USCALED_PACK32:60,VK_FORMAT_A2R10G10B10_SSCALED_PACK32:61,VK_FORMAT_A2R10G10B10_UINT_PACK32:62,VK_FORMAT_A2R10G10B10_SINT_PACK32:63,VK_FORMAT_A2B10G10R10_UNORM_PACK32:64,VK_FORMAT_A2B10G10R10_SNORM_PACK32:65,VK_FORMAT_A2B10G10R10_USCALED_PACK32:66,VK_FORMAT_A2B10G10R10_SSCALED_PACK32:67,VK_FORMAT_A2B10G10R10_UINT_PACK32:68,VK_FORMAT_A2B10G10R10_SINT_PACK32:69,VK_FORMAT_R16_UNORM:70,VK_FORMAT_R16_SNORM:71,VK_FORMAT_R16_USCALED:72,VK_FORMAT_R16_SSCALED:73,VK_FORMAT_R16_UINT:74,VK_FORMAT_R16_SINT:75,VK_FORMAT_R16_SFLOAT:76,VK_FORMAT_R16G16_UNORM:77,VK_FORMAT_R16G16_SNORM:78,VK_FORMAT_R16G16_USCALED:79,VK_FORMAT_R16G16_SSCALED:80,VK_FORMAT_R16G16_UINT:81,VK_FORMAT_R16G16_SINT:82,VK_FORMAT_R16G16_SFLOAT:83,VK_FORMAT_R16G16B16_UNORM:84,VK_FORMAT_R16G16B16_SNORM:85,VK_FORMAT_R16G16B16_USCALED:86,VK_FORMAT_R16G16B16_SSCALED:87,VK_FORMAT_R16G16B16_UINT:88,VK_FORMAT_R16G16B16_SINT:89,VK_FORMAT_R16G16B16_SFLOAT:90,VK_FORMAT_R16G16B16A16_UNORM:91,VK_FORMAT_R16G16B16A16_SNORM:92,VK_FORMAT_R16G16B16A16_USCALED:93,VK_FORMAT_R16G16B16A16_SSCALED:94,VK_FORMAT_R16G16B16A16_UINT:95,VK_FORMAT_R16G16B16A16_SINT:96,VK_FORMAT_R16G16B16A16_SFLOAT:97,VK_FORMAT_R32_UINT:98,VK_FORMAT_R32_SINT:99,VK_FORMAT_R32_SFLOAT:100,VK_FORMAT_R32G32_UINT:101,VK_FORMAT_R32G32_SINT:102,VK_FORMAT_R32G32_SFLOAT:103,VK_FORMAT_R32G32B32_UINT:104,VK_FORMAT_R32G32B32_SINT:105,VK_FORMAT_R32G32B32_SFLOAT:106,VK_FORMAT_R32G32B32A32_UINT:107,VK_FORMAT_R32G32B32A32_SINT:108,VK_FORMAT_R32G32B32A32_SFLOAT:109,VK_FORMAT_R64_UINT:110,VK_FORMAT_R64_SINT:111,VK_FORMAT_R64_SFLOAT:112,VK_FORMAT_R64G64_UINT:113,VK_FORMAT_R64G64_SINT:114,VK_FORMAT_R64G64_SFLOAT:115,VK_FORMAT_R64G64B64_UINT:116,VK_FORMAT_R64G64B64_SINT:117,VK_FORMAT_R64G64B64_SFLOAT:118,VK_FORMAT_R64G64B64A64_UINT:119,VK_FORMAT_R64G64B64A64_SINT:120,VK_FORMAT_R64G64B64A64_SFLOAT:121,VK_FORMAT_B10G11R11_UFLOAT_PACK32:122,VK_FORMAT_E5B9G9R9_UFLOAT_PACK32:123,VK_FORMAT_D16_UNORM:124,VK_FORMAT_X8_D24_UNORM_PACK32:125,VK_FORMAT_D32_SFLOAT:126,VK_FORMAT_S8_UINT:127,VK_FORMAT_D16_UNORM_S8_UINT:128,VK_FORMAT_D24_UNORM_S8_UINT:129,VK_FORMAT_D32_SFLOAT_S8_UINT:130,VK_FORMAT_BC1_RGB_UNORM_BLOCK:131,VK_FORMAT_BC1_RGB_SRGB_BLOCK:132,VK_FORMAT_BC1_RGBA_UNORM_BLOCK:133,VK_FORMAT_BC1_RGBA_SRGB_BLOCK:134,VK_FORMAT_BC2_UNORM_BLOCK:135,VK_FORMAT_BC2_SRGB_BLOCK:136,VK_FORMAT_BC3_UNORM_BLOCK:137,VK_FORMAT_BC3_SRGB_BLOCK:138,VK_FORMAT_BC4_UNORM_BLOCK:139,VK_FORMAT_BC4_SNORM_BLOCK:140,VK_FORMAT_BC5_UNORM_BLOCK:141,VK_FORMAT_BC5_SNORM_BLOCK:142,VK_FORMAT_BC6H_UFLOAT_BLOCK:143,VK_FORMAT_BC6H_SFLOAT_BLOCK:144,VK_FORMAT_BC7_UNORM_BLOCK:145,VK_FORMAT_BC7_SRGB_BLOCK:146,VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:147,VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK:148,VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK:149,VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK:150,VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK:151,VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK:152,VK_FORMAT_EAC_R11_UNORM_BLOCK:153,VK_FORMAT_EAC_R11_SNORM_BLOCK:154,VK_FORMAT_EAC_R11G11_UNORM_BLOCK:155,VK_FORMAT_EAC_R11G11_SNORM_BLOCK:156,VK_FORMAT_ASTC_4x4_UNORM_BLOCK:157,VK_FORMAT_ASTC_4x4_SRGB_BLOCK:158,VK_FORMAT_ASTC_5x4_UNORM_BLOCK:159,VK_FORMAT_ASTC_5x4_SRGB_BLOCK:160,VK_FORMAT_ASTC_5x5_UNORM_BLOCK:161,VK_FORMAT_ASTC_5x5_SRGB_BLOCK:162,VK_FORMAT_ASTC_6x5_UNORM_BLOCK:163,VK_FORMAT_ASTC_6x5_SRGB_BLOCK:164,VK_FORMAT_ASTC_6x6_UNORM_BLOCK:165,VK_FORMAT_ASTC_6x6_SRGB_BLOCK:166,VK_FORMAT_ASTC_8x5_UNORM_BLOCK:167,VK_FORMAT_ASTC_8x5_SRGB_BLOCK:168,VK_FORMAT_ASTC_8x6_UNORM_BLOCK:169,VK_FORMAT_ASTC_8x6_SRGB_BLOCK:170,VK_FORMAT_ASTC_8x8_UNORM_BLOCK:171,VK_FORMAT_ASTC_8x8_SRGB_BLOCK:172,VK_FORMAT_ASTC_10x5_UNORM_BLOCK:173,VK_FORMAT_ASTC_10x5_SRGB_BLOCK:174,VK_FORMAT_ASTC_10x6_UNORM_BLOCK:175,VK_FORMAT_ASTC_10x6_SRGB_BLOCK:176,VK_FORMAT_ASTC_10x8_UNORM_BLOCK:177,VK_FORMAT_ASTC_10x8_SRGB_BLOCK:178,VK_FORMAT_ASTC_10x10_UNORM_BLOCK:179,VK_FORMAT_ASTC_10x10_SRGB_BLOCK:180,VK_FORMAT_ASTC_12x10_UNORM_BLOCK:181,VK_FORMAT_ASTC_12x10_SRGB_BLOCK:182,VK_FORMAT_ASTC_12x12_UNORM_BLOCK:183,VK_FORMAT_ASTC_12x12_SRGB_BLOCK:184,VK_FORMAT_G8B8G8R8_422_UNORM:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM:1000156006,VK_FORMAT_R10X6_UNORM_PACK16:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16:1000156016,VK_FORMAT_R12X4_UNORM_PACK16:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM:1000156033,VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG:1000054e3,VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG:1000054001,VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG:1000054002,VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG:1000054003,VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG:1000054004,VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG:1000054005,VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG:1000054006,VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG:1000054007,VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT:1000066e3,VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT:1000066001,VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT:1000066002,VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT:1000066003,VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT:1000066004,VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT:1000066005,VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT:1000066006,VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT:1000066007,VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT:1000066008,VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT:1000066009,VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT:1000066010,VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT:1000066011,VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT:1000066012,VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT:1000066013,VK_FORMAT_G8B8G8R8_422_UNORM_KHR:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM_KHR:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR:1000156006,VK_FORMAT_R10X6_UNORM_PACK16_KHR:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR:1000156016,VK_FORMAT_R12X4_UNORM_PACK16_KHR:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM_KHR:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM_KHR:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR:1000156033},a8=Object.freeze(n0t);var vDi=T(S(),1);function i0t(e){switch(e){case ne.FLOAT:return"float";case ne.FLOAT_VEC2:return"vec2";case ne.FLOAT_VEC3:return"vec3";case ne.FLOAT_VEC4:return"vec4";case ne.FLOAT_MAT2:return"mat2";case ne.FLOAT_MAT3:return"mat3";case ne.FLOAT_MAT4:return"mat4";case ne.SAMPLER_2D:return"sampler2D";case ne.BOOL:return"bool"}}var c8=i0t;var FDi=T(S(),1);function o0t(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var c9=o0t;var kDi=T(S(),1);var r0t=new h(1,1,1);function l8(e){e=g(e,r0t),this._dimensions=h.clone(e)}Object.defineProperties(l8.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){h.clone(e,this._dimensions)}}});var s0t=new h;l8.prototype.emit=function(e){let t=this._dimensions,n=h.multiplyByScalar(t,.5,s0t),i=W.randomBetween(-n.x,n.x),o=W.randomBetween(-n.y,n.y),r=W.randomBetween(-n.z,n.z);e.position=h.fromElements(i,o,r,e.position),e.velocity=h.normalize(e.position,e.velocity)};var d8=l8;var e3i=T(S(),1);var FBi=T(S(),1);var BDi=T(S(),1),l9=`// See Intersection.glsl for the definition of intersectScene
// See IntersectionUtils.glsl for the definition of nextIntersection
// See convertUvToBox.glsl, convertUvToCylinder.glsl, or convertUvToEllipsoid.glsl
// for the definition of convertUvToShapeUvSpace. The appropriate function is
// selected based on the VoxelPrimitive shape type, and added to the shader in
// Scene/VoxelRenderResources.js.
// See Octree.glsl for the definitions of TraversalData, SampleData,
// traverseOctreeFromBeginning, and traverseOctreeFromExisting
// See Megatexture.glsl for the definition of accumulatePropertiesFromMegatexture
#define STEP_COUNT_MAX 1000 // Harcoded value because GLSL doesn't like variable length loops
#define ALPHA_ACCUM_MAX 0.98 // Must be > 0.0 and <= 1.0
uniform mat3 u_transformDirectionViewToLocal;
uniform vec3 u_cameraPositionUv;
uniform float u_stepSize;
#if defined(PICKING)
uniform vec4 u_pickColor;
#endif
#if defined(JITTER)
float hash(vec2 p)
{
vec3 p3 = fract(vec3(p.xyx) * 50.0); // magic number = hashscale
p3 += dot(p3, p3.yzx + 19.19);
return fract((p3.x + p3.y) * p3.z);
}
#endif
vec4 getStepSize(in SampleData sampleData, in Ray viewRay, in RayShapeIntersection shapeIntersection) {
#if defined(SHAPE_BOX)
Box voxelBox = constructVoxelBox(sampleData.tileCoords, sampleData.tileUv);
RayShapeIntersection voxelIntersection = intersectBox(viewRay, voxelBox);
vec4 entry = shapeIntersection.entry.w >= voxelIntersection.entry.w ? shapeIntersection.entry : voxelIntersection.entry;
float exit = min(voxelIntersection.exit.w, shapeIntersection.exit.w);
float dt = (exit - entry.w) * RAY_SCALE;
return vec4(normalize(entry.xyz), dt);
#else
float dimAtLevel = pow(2.0, float(sampleData.tileCoords.w));
return vec4(viewRay.dir, u_stepSize / dimAtLevel);
#endif
}
void main()
{
vec4 fragCoord = gl_FragCoord;
vec2 screenCoord = (fragCoord.xy - czm_viewport.xy) / czm_viewport.zw; // [0,1]
vec3 eyeDirection = normalize(czm_windowToEyeCoordinates(fragCoord).xyz);
vec3 viewDirWorld = normalize(czm_inverseViewRotation * eyeDirection); // normalize again just in case
vec3 viewDirUv = normalize(u_transformDirectionViewToLocal * eyeDirection); // normalize again just in case
vec3 viewPosUv = u_cameraPositionUv;
#if defined(SHAPE_BOX)
vec3 dInv = 1.0 / viewDirUv;
Ray viewRayUv = Ray(viewPosUv, viewDirUv, dInv);
#else
Ray viewRayUv = Ray(viewPosUv, viewDirUv);
#endif
Intersections ix;
RayShapeIntersection shapeIntersection = intersectScene(screenCoord, viewRayUv, ix);
// Exit early if the scene was completely missed.
if (shapeIntersection.entry.w == NO_HIT) {
discard;
}
float currT = shapeIntersection.entry.w * RAY_SCALE;
float endT = shapeIntersection.exit.w;
vec3 positionUv = viewPosUv + currT * viewDirUv;
vec3 positionUvShapeSpace = convertUvToShapeUvSpace(positionUv);
// Traverse the tree from the start position
TraversalData traversalData;
SampleData sampleDatas[SAMPLE_COUNT];
traverseOctreeFromBeginning(positionUvShapeSpace, traversalData, sampleDatas);
vec4 step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection);
#if defined(JITTER)
float noise = hash(screenCoord); // [0,1]
currT += noise * step.w;
positionUv += noise * step.w * viewDirUv;
#endif
FragmentInput fragmentInput;
#if defined(STATISTICS)
setStatistics(fragmentInput.metadata.statistics);
#endif
vec4 colorAccum =vec4(0.0);
for (int stepCount = 0; stepCount < STEP_COUNT_MAX; ++stepCount) {
// Read properties from the megatexture based on the traversal state
Properties properties = accumulatePropertiesFromMegatexture(sampleDatas);
// Prepare the custom shader inputs
copyPropertiesToMetadata(properties, fragmentInput.metadata);
fragmentInput.voxel.positionUv = positionUv;
fragmentInput.voxel.positionShapeUv = positionUvShapeSpace;
fragmentInput.voxel.positionUvLocal = sampleDatas[0].tileUv;
fragmentInput.voxel.viewDirUv = viewDirUv;
fragmentInput.voxel.viewDirWorld = viewDirWorld;
fragmentInput.voxel.surfaceNormal = step.xyz;
fragmentInput.voxel.travelDistance = step.w;
// Run the custom shader
czm_modelMaterial materialOutput;
fragmentMain(fragmentInput, materialOutput);
// Sanitize the custom shader output
vec4 color = vec4(materialOutput.diffuse, materialOutput.alpha);
color.rgb = max(color.rgb, vec3(0.0));
color.a = clamp(color.a, 0.0, 1.0);
// Pre-multiplied alpha blend
colorAccum += (1.0 - colorAccum.a) * vec4(color.rgb * color.a, color.a);
// Stop traversing if the alpha has been fully saturated
if (colorAccum.a > ALPHA_ACCUM_MAX) {
colorAccum.a = ALPHA_ACCUM_MAX;
break;
}
if (step.w == 0.0) {
// Shape is infinitely thin. The ray may have hit the edge of a
// foreground voxel. Step ahead slightly to check for more voxels
step.w == 0.00001;
}
// Keep raymarching
currT += step.w;
positionUv += step.w * viewDirUv;
// Check if there's more intersections.
if (currT > endT) {
#if (INTERSECTION_COUNT == 1)
break;
#else
shapeIntersection = nextIntersection(ix);
if (shapeIntersection.entry.w == NO_HIT) {
break;
} else {
// Found another intersection. Resume raymarching there
currT = shapeIntersection.entry.w * RAY_SCALE;
endT = shapeIntersection.exit.w;
positionUv = viewPosUv + currT * viewDirUv;
}
#endif
}
// Traverse the tree from the current ray position.
// This is similar to traverseOctreeFromBeginning but is faster when the ray is in the same tile as the previous step.
positionUvShapeSpace = convertUvToShapeUvSpace(positionUv);
traverseOctreeFromExisting(positionUvShapeSpace, traversalData, sampleDatas);
step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection);
}
// Convert the alpha from [0,ALPHA_ACCUM_MAX] to [0,1]
colorAccum.a /= ALPHA_ACCUM_MAX;
#if defined(PICKING)
// If alpha is 0.0 there is nothing to pick
if (colorAccum.a == 0.0) {
discard;
}
out_FragColor = u_pickColor;
#else
out_FragColor = colorAccum;
#endif
}
`;var YDi=T(S(),1),d9=`in vec2 position;
uniform vec4 u_ndcSpaceAxisAlignedBoundingBox;
void main() {
vec2 aabbMin = u_ndcSpaceAxisAlignedBoundingBox.xy;
vec2 aabbMax = u_ndcSpaceAxisAlignedBoundingBox.zw;
vec2 translation = 0.5 * (aabbMax + aabbMin);
vec2 scale = 0.5 * (aabbMax - aabbMin);
gl_Position = vec4(position * scale + translation, 0.0, 1.0);
}
`;var KDi=T(S(),1),u9=`/* Intersection defines
#define INTERSECTION_COUNT ###
*/
#define NO_HIT (-czm_infinity)
#define INF_HIT (czm_infinity * 0.5)
#define RAY_SHIFT (0.000003163)
#define RAY_SCALE (1.003163)
struct Ray {
vec3 pos;
vec3 dir;
#if defined(SHAPE_BOX)
vec3 dInv;
#endif
};
struct RayShapeIntersection {
vec4 entry;
vec4 exit;
};
struct Intersections {
// Don't access these member variables directly - call the functions instead.
// Store an array of ray-surface intersections. Each intersection is composed of:
// .xyz for the surface normal at the intersection point
// .w for the T value
// The scale of the normal encodes the shape intersection type:
// length(intersection.xyz) = 1: positive shape entry
// length(intersection.xyz) = 2: positive shape exit
// length(intersection.xyz) = 3: negative shape entry
// length(intersection.xyz) = 4: negative shape exit
// INTERSECTION_COUNT is the number of ray-*shape* (volume) intersections,
// so we need twice as many to track ray-*surface* intersections
vec4 intersections[INTERSECTION_COUNT * 2];
#if (INTERSECTION_COUNT > 1)
// Maintain state for future nextIntersection calls
int index;
int surroundCount;
bool surroundIsPositive;
#endif
};
RayShapeIntersection getFirstIntersection(in Intersections ix)
{
return RayShapeIntersection(ix.intersections[0], ix.intersections[1]);
}
vec4 encodeIntersectionType(vec4 intersection, int index, bool entry)
{
float scale = float(index > 0) * 2.0 + float(!entry) + 1.0;
return vec4(intersection.xyz * scale, intersection.w);
}
// Use defines instead of real functions because WebGL1 cannot access array with non-constant index.
#define setIntersection(/*inout Intersections*/ ix, /*int*/ index, /*float*/ t, /*bool*/ positive, /*bool*/ enter) (ix).intersections[(index)] = vec4(0.0, float(!positive) * 2.0 + float(!enter) + 1.0, 0.0, (t))
#define setIntersectionPair(/*inout Intersections*/ ix, /*int*/ index, /*vec2*/ entryExit) (ix).intersections[(index) * 2 + 0] = vec4(0.0, float((index) > 0) * 2.0 + 1.0, 0.0, (entryExit).x); (ix).intersections[(index) * 2 + 1] = vec4(0.0, float((index) > 0) * 2.0 + 2.0, 0.0, (entryExit).y)
#define setSurfaceIntersection(/*inout Intersections*/ ix, /*int*/ index, /*vec4*/ intersection) (ix).intersections[(index)] = intersection;
#define setShapeIntersection(/*inout Intersections*/ ix, /*int*/ index, /*RayShapeIntersection*/ intersection) (ix).intersections[(index) * 2 + 0] = encodeIntersectionType((intersection).entry, (index), true); (ix).intersections[(index) * 2 + 1] = encodeIntersectionType((intersection).exit, (index), false)
#if (INTERSECTION_COUNT > 1)
void initializeIntersections(inout Intersections ix) {
// Sort the intersections from min T to max T with bubble sort.
// Note: If this sorting function changes, some of the intersection test may
// need to be updated. Search for "bubble sort" to find those areas.
const int sortPasses = INTERSECTION_COUNT * 2 - 1;
for (int n = sortPasses; n > 0; --n) {
for (int i = 0; i < sortPasses; ++i) {
// The loop should be: for (i = 0; i < n; ++i) {...} but WebGL1 cannot
// loop with non-constant condition, so it has to break early instead
if (i >= n) { break; }
vec4 intersect0 = ix.intersections[i + 0];
vec4 intersect1 = ix.intersections[i + 1];
bool inOrder = intersect0.w <= intersect1.w;
ix.intersections[i + 0] = inOrder ? intersect0 : intersect1;
ix.intersections[i + 1] = inOrder ? intersect1 : intersect0;
}
}
// Prepare initial state for nextIntersection
ix.index = 0;
ix.surroundCount = 0;
ix.surroundIsPositive = false;
}
#endif
#if (INTERSECTION_COUNT > 1)
RayShapeIntersection nextIntersection(inout Intersections ix) {
vec4 surfaceIntersection = vec4(0.0, 0.0, 0.0, NO_HIT);
RayShapeIntersection shapeIntersection = RayShapeIntersection(surfaceIntersection, surfaceIntersection);
const int passCount = INTERSECTION_COUNT * 2;
if (ix.index == passCount) {
return shapeIntersection;
}
for (int i = 0; i < passCount; ++i) {
// The loop should be: for (i = ix.index; i < passCount; ++i) {...} but WebGL1 cannot
// loop with non-constant condition, so it has to continue instead.
if (i < ix.index) {
continue;
}
ix.index = i + 1;
surfaceIntersection = ix.intersections[i];
int intersectionType = int(length(surfaceIntersection.xyz) - 0.5);
bool currShapeIsPositive = intersectionType < 2;
bool enter = intMod(intersectionType, 2) == 0;
ix.surroundCount += enter ? +1 : -1;
ix.surroundIsPositive = currShapeIsPositive ? enter : ix.surroundIsPositive;
// entering positive or exiting negative
if (ix.surroundCount == 1 && ix.surroundIsPositive && enter == currShapeIsPositive) {
shapeIntersection.entry = surfaceIntersection;
}
// exiting positive or entering negative after being inside positive
bool exitPositive = !enter && currShapeIsPositive && ix.surroundCount == 0;
bool enterNegativeFromPositive = enter && !currShapeIsPositive && ix.surroundCount == 2 && ix.surroundIsPositive;
if (exitPositive || enterNegativeFromPositive) {
shapeIntersection.exit = surfaceIntersection;
// entry and exit have been found, so the loop can stop
if (exitPositive) {
// After exiting positive shape there is nothing left to intersect, so jump to the end index.
ix.index = passCount;
}
break;
}
}
return shapeIntersection;
}
#endif
// NOTE: initializeIntersections, nextIntersection aren't even declared unless INTERSECTION_COUNT > 1
`;var JDi=T(S(),1),m9=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections,
// setIntersectionPair, INF_HIT, NO_HIT
/* intersectDepth defines (set in Scene/VoxelRenderResources.js)
#define DEPTH_INTERSECTION_INDEX ###
*/
uniform mat4 u_transformPositionViewToUv;
void intersectDepth(in vec2 screenCoord, in Ray ray, inout Intersections ix) {
float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, screenCoord));
if (logDepthOrDepth != 0.0) {
// Calculate how far the ray must travel before it hits the depth buffer.
vec4 eyeCoordinateDepth = czm_screenToEyeCoordinates(screenCoord, logDepthOrDepth);
eyeCoordinateDepth /= eyeCoordinateDepth.w;
vec3 depthPositionUv = vec3(u_transformPositionViewToUv * eyeCoordinateDepth);
float t = dot(depthPositionUv - ray.pos, ray.dir);
setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(t, +INF_HIT));
} else {
// There's no depth at this location.
setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(NO_HIT));
}
}
`;var jDi=T(S(),1),h9=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, INF_HIT,
// NO_HIT, setIntersectionPair
/* Clipping plane defines (set in Scene/VoxelRenderResources.js)
#define CLIPPING_PLANES_UNION
#define CLIPPING_PLANES_COUNT
#define CLIPPING_PLANES_INTERSECTION_INDEX
*/
uniform sampler2D u_clippingPlanesTexture;
uniform mat4 u_clippingPlanesMatrix;
// Plane is in Hessian Normal Form
vec4 intersectPlane(in Ray ray, in vec4 plane) {
vec3 n = plane.xyz; // normal
float w = plane.w; // -dot(pointOnPlane, normal)
float a = dot(ray.pos, n);
float b = dot(ray.dir, n);
float t = -(w + a) / b;
return vec4(n, t);
}
void intersectClippingPlanes(in Ray ray, inout Intersections ix) {
vec4 backSide = vec4(-ray.dir, -INF_HIT);
vec4 farSide = vec4(ray.dir, +INF_HIT);
RayShapeIntersection clippingVolume;
#if (CLIPPING_PLANES_COUNT == 1)
// Union and intersection are the same when there's one clipping plane, and the code
// is more simplified.
vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, 0, u_clippingPlanesMatrix);
vec4 intersection = intersectPlane(ray, planeUv);
bool reflects = dot(ray.dir, intersection.xyz) < 0.0;
clippingVolume.entry = reflects ? backSide : intersection;
clippingVolume.exit = reflects ? intersection : farSide;
setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume);
#elif defined(CLIPPING_PLANES_UNION)
vec4 firstTransmission = vec4(ray.dir, +INF_HIT);
vec4 lastReflection = vec4(-ray.dir, -INF_HIT);
for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) {
vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i, u_clippingPlanesMatrix);
vec4 intersection = intersectPlane(ray, planeUv);
if (dot(ray.dir, planeUv.xyz) > 0.0) {
firstTransmission = intersection.w <= firstTransmission.w ? intersection : firstTransmission;
} else {
lastReflection = intersection.w >= lastReflection.w ? intersection : lastReflection;
}
}
clippingVolume.entry = backSide;
clippingVolume.exit = lastReflection;
setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 0, clippingVolume);
clippingVolume.entry = firstTransmission;
clippingVolume.exit = farSide;
setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 1, clippingVolume);
#else // intersection
vec4 lastTransmission = vec4(ray.dir, -INF_HIT);
vec4 firstReflection = vec4(-ray.dir, +INF_HIT);
for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) {
vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i, u_clippingPlanesMatrix);
vec4 intersection = intersectPlane(ray, planeUv);
if (dot(ray.dir, planeUv.xyz) > 0.0) {
lastTransmission = intersection.w > lastTransmission.w ? intersection : lastTransmission;
} else {
firstReflection = intersection.w < firstReflection.w ? intersection: firstReflection;
}
}
if (lastTransmission.w < firstReflection.w) {
clippingVolume.entry = lastTransmission;
clippingVolume.exit = firstReflection;
} else {
clippingVolume.entry = vec4(-ray.dir, NO_HIT);
clippingVolume.exit = vec4(ray.dir, NO_HIT);
}
setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume);
#endif
}
`;var $Di=T(S(),1),f9=`// See IntersectionUtils.glsl for the definitions of Ray and NO_HIT
// See convertUvToBox.glsl for the definition of convertShapeUvToUvSpace
/* Box defines (set in Scene/VoxelBoxShape.js)
#define BOX_INTERSECTION_INDEX ### // always 0
*/
uniform vec3 u_renderMinBounds;
uniform vec3 u_renderMaxBounds;
struct Box {
vec3 p0;
vec3 p1;
};
Box constructVoxelBox(in ivec4 octreeCoords, in vec3 tileUv)
{
// Find the min/max cornerpoints of the voxel in tile coordinates
vec3 tileOrigin = vec3(octreeCoords.xyz);
vec3 numSamples = vec3(u_dimensions);
vec3 voxelSize = 1.0 / numSamples;
vec3 coordP0 = floor(tileUv * numSamples) * voxelSize + tileOrigin;
vec3 coordP1 = coordP0 + voxelSize;
// Transform to the UV coordinates of the scaled tileset
float tileSize = 1.0 / pow(2.0, float(octreeCoords.w));
vec3 p0 = convertShapeUvToUvSpace(coordP0 * tileSize);
vec3 p1 = convertShapeUvToUvSpace(coordP1 * tileSize);
return Box(p0, p1);
}
vec3 getBoxNormal(in Box box, in Ray ray, in float t)
{
vec3 hitPoint = ray.pos + t * ray.dir;
vec3 lower = step(hitPoint, box.p0);
vec3 upper = step(box.p1, hitPoint);
return normalize(upper - lower);
}
// Find the distances along a ray at which the ray intersects an axis-aligned box
// See https://tavianator.com/2011/ray_box.html
RayShapeIntersection intersectBox(in Ray ray, in Box box)
{
// Consider the box as the intersection of the space between 3 pairs of parallel planes
// Compute the distance along the ray to each plane
vec3 t0 = (box.p0 - ray.pos) * ray.dInv;
vec3 t1 = (box.p1 - ray.pos) * ray.dInv;
// Identify candidate entries/exits based on distance from ray.pos
vec3 entries = min(t0, t1);
vec3 exits = max(t0, t1);
// The actual box intersection points are the furthest entry and the closest exit
float entryT = max(max(entries.x, entries.y), entries.z);
float exitT = min(min(exits.x, exits.y), exits.z);
vec3 entryNormal = getBoxNormal(box, ray, entryT - RAY_SHIFT);
vec3 exitNormal = getBoxNormal(box, ray, exitT + RAY_SHIFT);
if (entryT > exitT) {
entryT = NO_HIT;
exitT = NO_HIT;
}
return RayShapeIntersection(vec4(entryNormal, entryT), vec4(exitNormal, exitT));
}
void intersectShape(in Ray ray, inout Intersections ix)
{
RayShapeIntersection intersection = intersectBox(ray, Box(u_renderMinBounds, u_renderMaxBounds));
setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection);
}
`;var tBi=T(S(),1),p9=`// See IntersectionUtils.glsl for the definitions of Ray, setIntersection,
// setIntersectionPair
/* Cylinder defines (set in Scene/VoxelCylinderShape.js)
#define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN
#define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX
#define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT
#define CYLINDER_HAS_RENDER_BOUNDS_HEIGHT
#define CYLINDER_HAS_RENDER_BOUNDS_HEIGHT_FLAT
#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE
#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF
#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF
#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_HALF
#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO
#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS
#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT
#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT
#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT
#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE
#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO
#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY
#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY
#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED
#define CYLINDER_INTERSECTION_INDEX_RADIUS_MAX
#define CYLINDER_INTERSECTION_INDEX_RADIUS_MIN
#define CYLINDER_INTERSECTION_INDEX_ANGLE
*/
// Cylinder uniforms
#if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX) || defined(CYLINDER_HAS_RENDER_BOUNDS_HEIGHT)
uniform vec3 u_cylinderUvToRenderBoundsScale;
uniform vec3 u_cylinderUvToRenderBoundsTranslate;
#endif
#if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN) && !defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT)
uniform float u_cylinderUvToRenderRadiusMin;
#endif
#if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE)
uniform vec2 u_cylinderRenderAngleMinMax;
#endif
vec4 intersectHalfPlane(Ray ray, float angle) {
vec2 o = ray.pos.xy;
vec2 d = ray.dir.xy;
vec2 planeDirection = vec2(cos(angle), sin(angle));
vec2 planeNormal = vec2(planeDirection.y, -planeDirection.x);
float a = dot(o, planeNormal);
float b = dot(d, planeNormal);
float t = -a / b;
vec2 p = o + t * d;
bool outside = dot(p, planeDirection) < 0.0;
if (outside) return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT);
return vec4(-INF_HIT, t, t, +INF_HIT);
}
#define POSITIVE_HIT vec2(t, +INF_HIT);
#define NEGATIVE_HIT vec2(-INF_HIT, t);
vec2 intersectHalfSpace(Ray ray, float angle)
{
vec2 o = ray.pos.xy;
vec2 d = ray.dir.xy;
vec2 n = vec2(sin(angle), -cos(angle));
float a = dot(o, n);
float b = dot(d, n);
float t = -a / b;
float s = sign(a);
// Half space cuts right through the camera, pick the side to intersect
if (a == 0.0) {
if (b >= 0.0) {
return POSITIVE_HIT;
} else {
return NEGATIVE_HIT;
}
}
if (t >= 0.0 != s >= 0.0) {
return POSITIVE_HIT;
} else {
return NEGATIVE_HIT;
}
}
vec2 intersectRegularWedge(Ray ray, float minAngle, float maxAngle)
{
vec2 o = ray.pos.xy;
vec2 d = ray.dir.xy;
vec2 n1 = vec2(sin(minAngle), -cos(minAngle));
vec2 n2 = vec2(-sin(maxAngle), cos(maxAngle));
float a1 = dot(o, n1);
float a2 = dot(o, n2);
float b1 = dot(d, n1);
float b2 = dot(d, n2);
float t1 = -a1 / b1;
float t2 = -a2 / b2;
float s1 = sign(a1);
float s2 = sign(a2);
float tmin = min(t1, t2);
float tmax = max(t1, t2);
float smin = tmin == t1 ? s1 : s2;
float smax = tmin == t1 ? s2 : s1;
bool e = tmin >= 0.0;
bool f = tmax >= 0.0;
bool g = smin >= 0.0;
bool h = smax >= 0.0;
if (e != g && f == h) return vec2(tmin, tmax);
else if (e == g && f == h) return vec2(-INF_HIT, tmin);
else if (e != g && f != h) return vec2(tmax, +INF_HIT);
else return vec2(NO_HIT);
}
vec4 intersectFlippedWedge(Ray ray, float minAngle, float maxAngle)
{
vec2 planeIntersectMin = intersectHalfSpace(ray, minAngle);
vec2 planeIntersectMax = intersectHalfSpace(ray, maxAngle + czm_pi);
return vec4(planeIntersectMin, planeIntersectMax);
}
vec2 intersectUnitCylinder(Ray ray)
{
vec3 o = ray.pos;
vec3 d = ray.dir;
float a = dot(d.xy, d.xy);
float b = dot(o.xy, d.xy);
float c = dot(o.xy, o.xy) - 1.0;
float det = b * b - a * c;
if (det < 0.0) {
return vec2(NO_HIT);
}
det = sqrt(det);
float ta = (-b - det) / a;
float tb = (-b + det) / a;
float t1 = min(ta, tb);
float t2 = max(ta, tb);
float z1 = o.z + t1 * d.z;
float z2 = o.z + t2 * d.z;
if (abs(z1) >= 1.0)
{
float tCap = (sign(z1) - o.z) / d.z;
t1 = abs(b + a * tCap) < det ? tCap : NO_HIT;
}
if (abs(z2) >= 1.0)
{
float tCap = (sign(z2) - o.z) / d.z;
t2 = abs(b + a * tCap) < det ? tCap : NO_HIT;
}
return vec2(t1, t2);
}
vec2 intersectUnitCircle(Ray ray) {
vec3 o = ray.pos;
vec3 d = ray.dir;
float t = -o.z / d.z;
vec2 zPlanePos = o.xy + d.xy * t;
float distSqr = dot(zPlanePos, zPlanePos);
if (distSqr > 1.0) {
return vec2(NO_HIT);
}
return vec2(t, t);
}
vec2 intersectInfiniteUnitCylinder(Ray ray)
{
vec3 o = ray.pos;
vec3 d = ray.dir;
float a = dot(d.xy, d.xy);
float b = dot(o.xy, d.xy);
float c = dot(o.xy, o.xy) - 1.0;
float det = b * b - a * c;
if (det < 0.0) {
return vec2(NO_HIT);
}
det = sqrt(det);
float t1 = (-b - det) / a;
float t2 = (-b + det) / a;
float tmin = min(t1, t2);
float tmax = max(t1, t2);
return vec2(tmin, tmax);
}
void intersectShape(Ray ray, inout Intersections ix)
{
#if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX) || defined(CYLINDER_HAS_RENDER_BOUNDS_HEIGHT)
ray.pos = ray.pos * u_cylinderUvToRenderBoundsScale + u_cylinderUvToRenderBoundsTranslate;
ray.dir *= u_cylinderUvToRenderBoundsScale;
#else
// Position is converted from [0,1] to [-1,+1] because shape intersections assume unit space is [-1,+1].
// Direction is scaled as well to be in sync with position.
ray.pos = ray.pos * 2.0 - 1.0;
ray.dir *= 2.0;
#endif
#if defined(CYLINDER_HAS_RENDER_BOUNDS_HEIGHT_FLAT)
vec2 outerIntersect = intersectUnitCircle(ray);
#else
vec2 outerIntersect = intersectUnitCylinder(ray);
#endif
setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MAX, outerIntersect);
if (outerIntersect.x == NO_HIT) {
return;
}
#if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT)
// When the cylinder is perfectly thin it's necessary to sandwich the
// inner cylinder intersection inside the outer cylinder intersection.
// Without this special case,
// [outerMin, outerMax, innerMin, innerMax] will bubble sort to
// [outerMin, innerMin, outerMax, innerMax] which will cause the back
// side of the cylinder to be invisible because it will think the ray
// is still inside the inner (negative) cylinder after exiting the
// outer (positive) cylinder.
// With this special case,
// [outerMin, innerMin, innerMax, outerMax] will bubble sort to
// [outerMin, innerMin, innerMax, outerMax] which will work correctly.
// Note: If initializeIntersections() changes its sorting function
// from bubble sort to something else, this code may need to change.
vec2 innerIntersect = intersectInfiniteUnitCylinder(ray);
setIntersection(ix, 0, outerIntersect.x, true, true); // positive, enter
setIntersection(ix, 1, innerIntersect.x, false, true); // negative, enter
setIntersection(ix, 2, innerIntersect.y, false, false); // negative, exit
setIntersection(ix, 3, outerIntersect.y, true, false); // positive, exit
#elif defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN)
Ray innerRay = Ray(ray.pos * u_cylinderUvToRenderRadiusMin, ray.dir * u_cylinderUvToRenderRadiusMin);
vec2 innerIntersect = intersectInfiniteUnitCylinder(innerRay);
setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MIN, innerIntersect);
#endif
#if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF)
vec2 wedgeIntersect = intersectRegularWedge(ray, u_cylinderRenderAngleMinMax.x, u_cylinderRenderAngleMinMax.y);
setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE, wedgeIntersect);
#elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF)
vec4 wedgeIntersect = intersectFlippedWedge(ray, u_cylinderRenderAngleMinMax.x, u_cylinderRenderAngleMinMax.y);
setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersect.xy);
setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersect.zw);
#elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_HALF)
vec2 wedgeIntersect = intersectHalfSpace(ray, u_cylinderRenderAngleMinMax.x);
setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE, wedgeIntersect);
#elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO)
vec4 wedgeIntersect = intersectHalfPlane(ray, u_cylinderRenderAngleMinMax.x);
setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersect.xy);
setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersect.zw);
#endif
}
`;var iBi=T(S(),1),b9=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections,
// setIntersection, setIntersectionPair, INF_HIT, NO_HIT
/* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js)
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF
#define ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX
#define ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN
#define ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT
#define ELLIPSOID_INTERSECTION_INDEX_LONGITUDE
#define ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX
#define ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN
#define ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX
#define ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN
*/
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE)
uniform vec2 u_ellipsoidRenderLongitudeMinMax;
#endif
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF)
uniform vec2 u_ellipsoidRenderLatitudeCosSqrHalfMinMax;
#endif
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX)
uniform float u_ellipsoidInverseOuterScaleUv;
#endif
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN)
uniform float u_ellipsoidInverseInnerScaleUv;
#endif
vec2 intersectZPlane(Ray ray)
{
float o = ray.pos.z;
float d = ray.dir.z;
float t = -o / d;
float s = sign(o);
if (t >= 0.0 != s >= 0.0) return vec2(t, +INF_HIT);
else return vec2(-INF_HIT, t);
}
vec4 intersectHalfPlane(Ray ray, float angle) {
vec2 o = ray.pos.xy;
vec2 d = ray.dir.xy;
vec2 planeDirection = vec2(cos(angle), sin(angle));
vec2 planeNormal = vec2(planeDirection.y, -planeDirection.x);
float a = dot(o, planeNormal);
float b = dot(d, planeNormal);
float t = -a / b;
vec2 p = o + t * d;
bool outside = dot(p, planeDirection) < 0.0;
if (outside) return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT);
return vec4(-INF_HIT, t, t, +INF_HIT);
}
vec2 intersectHalfSpace(Ray ray, float angle)
{
vec2 o = ray.pos.xy;
vec2 d = ray.dir.xy;
vec2 n = vec2(sin(angle), -cos(angle));
float a = dot(o, n);
float b = dot(d, n);
float t = -a / b;
float s = sign(a);
if (t >= 0.0 != s >= 0.0) return vec2(t, +INF_HIT);
else return vec2(-INF_HIT, t);
}
vec2 intersectRegularWedge(Ray ray, float minAngle, float maxAngle)
{
vec2 o = ray.pos.xy;
vec2 d = ray.dir.xy;
vec2 n1 = vec2(sin(minAngle), -cos(minAngle));
vec2 n2 = vec2(-sin(maxAngle), cos(maxAngle));
float a1 = dot(o, n1);
float a2 = dot(o, n2);
float b1 = dot(d, n1);
float b2 = dot(d, n2);
float t1 = -a1 / b1;
float t2 = -a2 / b2;
float s1 = sign(a1);
float s2 = sign(a2);
float tmin = min(t1, t2);
float tmax = max(t1, t2);
float smin = tmin == t1 ? s1 : s2;
float smax = tmin == t1 ? s2 : s1;
bool e = tmin >= 0.0;
bool f = tmax >= 0.0;
bool g = smin >= 0.0;
bool h = smax >= 0.0;
if (e != g && f == h) return vec2(tmin, tmax);
else if (e == g && f == h) return vec2(-INF_HIT, tmin);
else if (e != g && f != h) return vec2(tmax, +INF_HIT);
else return vec2(NO_HIT);
}
vec4 intersectFlippedWedge(Ray ray, float minAngle, float maxAngle)
{
vec2 planeIntersectMin = intersectHalfSpace(ray, minAngle);
vec2 planeIntersectMax = intersectHalfSpace(ray, maxAngle + czm_pi);
return vec4(planeIntersectMin, planeIntersectMax);
}
vec2 intersectUnitSphere(Ray ray)
{
vec3 o = ray.pos;
vec3 d = ray.dir;
float b = dot(d, o);
float c = dot(o, o) - 1.0;
float det = b * b - c;
if (det < 0.0) {
return vec2(NO_HIT);
}
det = sqrt(det);
float t1 = -b - det;
float t2 = -b + det;
float tmin = min(t1, t2);
float tmax = max(t1, t2);
return vec2(tmin, tmax);
}
vec2 intersectUnitSphereUnnormalizedDirection(Ray ray)
{
vec3 o = ray.pos;
vec3 d = ray.dir;
float a = dot(d, d);
float b = dot(d, o);
float c = dot(o, o) - 1.0;
float det = b * b - a * c;
if (det < 0.0) {
return vec2(NO_HIT);
}
det = sqrt(det);
float t1 = (-b - det) / a;
float t2 = (-b + det) / a;
float tmin = min(t1, t2);
float tmax = max(t1, t2);
return vec2(tmin, tmax);
}
vec2 intersectDoubleEndedCone(Ray ray, float cosSqrHalfAngle)
{
vec3 o = ray.pos;
vec3 d = ray.dir;
float a = d.z * d.z - dot(d, d) * cosSqrHalfAngle;
float b = d.z * o.z - dot(o, d) * cosSqrHalfAngle;
float c = o.z * o.z - dot(o, o) * cosSqrHalfAngle;
float det = b * b - a * c;
if (det < 0.0) {
return vec2(NO_HIT);
}
det = sqrt(det);
float t1 = (-b - det) / a;
float t2 = (-b + det) / a;
float tmin = min(t1, t2);
float tmax = max(t1, t2);
return vec2(tmin, tmax);
}
vec4 intersectFlippedCone(Ray ray, float cosSqrHalfAngle) {
vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle);
if (intersect.x == NO_HIT) {
return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT);
}
vec3 o = ray.pos;
vec3 d = ray.dir;
float tmin = intersect.x;
float tmax = intersect.y;
float zmin = o.z + tmin * d.z;
float zmax = o.z + tmax * d.z;
// One interval
if (zmin < 0.0 && zmax < 0.0) return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT);
else if (zmin < 0.0) return vec4(-INF_HIT, tmax, NO_HIT, NO_HIT);
else if (zmax < 0.0) return vec4(tmin, +INF_HIT, NO_HIT, NO_HIT);
// Two intervals
else return vec4(-INF_HIT, tmin, tmax, +INF_HIT);
}
vec2 intersectRegularCone(Ray ray, float cosSqrHalfAngle) {
vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle);
if (intersect.x == NO_HIT) {
return vec2(NO_HIT);
}
vec3 o = ray.pos;
vec3 d = ray.dir;
float tmin = intersect.x;
float tmax = intersect.y;
float zmin = o.z + tmin * d.z;
float zmax = o.z + tmax * d.z;
if (zmin < 0.0 && zmax < 0.0) return vec2(NO_HIT);
else if (zmin < 0.0) return vec2(tmax, +INF_HIT);
else if (zmax < 0.0) return vec2(-INF_HIT, tmin);
else return vec2(tmin, tmax);
}
void intersectShape(in Ray ray, inout Intersections ix) {
// Position is converted from [0,1] to [-1,+1] because shape intersections assume unit space is [-1,+1].
// Direction is scaled as well to be in sync with position.
ray.pos = ray.pos * 2.0 - 1.0;
ray.dir *= 2.0;
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX)
Ray outerRay = Ray(ray.pos * u_ellipsoidInverseOuterScaleUv, ray.dir * u_ellipsoidInverseOuterScaleUv);
#else
Ray outerRay = ray;
#endif
// Outer ellipsoid
vec2 outerIntersect = intersectUnitSphereUnnormalizedDirection(outerRay);
setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX, outerIntersect);
// Exit early if the outer ellipsoid was missed.
if (outerIntersect.x == NO_HIT) {
return;
}
// Inner ellipsoid
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT)
// When the ellipsoid is perfectly thin it's necessary to sandwich the
// inner ellipsoid intersection inside the outer ellipsoid intersection.
// Without this special case,
// [outerMin, outerMax, innerMin, innerMax] will bubble sort to
// [outerMin, innerMin, outerMax, innerMax] which will cause the back
// side of the ellipsoid to be invisible because it will think the ray
// is still inside the inner (negative) ellipsoid after exiting the
// outer (positive) ellipsoid.
// With this special case,
// [outerMin, innerMin, innerMax, outerMax] will bubble sort to
// [outerMin, innerMin, innerMax, outerMax] which will work correctly.
// Note: If initializeIntersections() changes its sorting function
// from bubble sort to something else, this code may need to change.
setIntersection(ix, 0, outerIntersect.x, true, true); // positive, enter
setIntersection(ix, 1, outerIntersect.x, false, true); // negative, enter
setIntersection(ix, 2, outerIntersect.y, false, false); // negative, exit
setIntersection(ix, 3, outerIntersect.y, true, false); // positive, exit
#elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN)
Ray innerRay = Ray(ray.pos * u_ellipsoidInverseInnerScaleUv, ray.dir * u_ellipsoidInverseInnerScaleUv);
vec2 innerIntersect = intersectUnitSphereUnnormalizedDirection(innerRay);
if (innerIntersect == vec2(NO_HIT)) {
setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN, innerIntersect);
} else {
// When the ellipsoid is very large and thin it's possible for floating
// point math to cause the ray to intersect the inner ellipsoid before
// the outer ellipsoid. To prevent this from happening, clamp innerIntersect
// to outerIntersect and sandwhich the intersections like described above.
//
// In theory a similar fix is needed for cylinders, however it's more
// complicated to implement because the inner shape is allowed to be
// intersected first.
innerIntersect.x = max(innerIntersect.x, outerIntersect.x);
innerIntersect.y = min(innerIntersect.y, outerIntersect.y);
setIntersection(ix, 0, outerIntersect.x, true, true); // positive, enter
setIntersection(ix, 1, innerIntersect.x, false, true); // negative, enter
setIntersection(ix, 2, innerIntersect.y, false, false); // negative, exit
setIntersection(ix, 3, outerIntersect.y, true, false); // positive, exit
}
#endif
// Flip the ray because the intersection function expects a cone growing towards +Z.
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF)
Ray flippedRay = outerRay;
flippedRay.dir.z *= -1.0;
flippedRay.pos.z *= -1.0;
#endif
// Bottom cone
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF)
vec2 bottomConeIntersection = intersectRegularCone(flippedRay, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.x);
setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection);
#elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF)
vec2 bottomConeIntersection = intersectZPlane(flippedRay);
setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection);
#elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF)
vec4 bottomConeIntersection = intersectFlippedCone(ray, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.x);
setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 0, bottomConeIntersection.xy);
setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 1, bottomConeIntersection.zw);
#endif
// Top cone
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF)
vec4 topConeIntersection = intersectFlippedCone(flippedRay, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.y);
setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 0, topConeIntersection.xy);
setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 1, topConeIntersection.zw);
#elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF)
vec2 topConeIntersection = intersectZPlane(ray);
setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection);
#elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF)
vec2 topConeIntersection = intersectRegularCone(ray, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.y);
setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection);
#endif
// Wedge
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO)
vec4 wedgeIntersect = intersectHalfPlane(ray, u_ellipsoidRenderLongitudeMinMax.x);
setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersect.xy);
setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersect.zw);
#elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF)
vec2 wedgeIntersect = intersectRegularWedge(ray, u_ellipsoidRenderLongitudeMinMax.x, u_ellipsoidRenderLongitudeMinMax.y);
setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE, wedgeIntersect);
#elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF)
vec2 wedgeIntersect = intersectHalfSpace(ray, u_ellipsoidRenderLongitudeMinMax.x);
setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE, wedgeIntersect);
#elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF)
vec4 wedgeIntersect = intersectFlippedWedge(ray, u_ellipsoidRenderLongitudeMinMax.x, u_ellipsoidRenderLongitudeMinMax.y);
setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersect.xy);
setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersect.zw);
#endif
}
`;var rBi=T(S(),1),KT=`// Main intersection function for Voxel scenes.
// See IntersectBox.glsl, IntersectCylinder.glsl, or IntersectEllipsoid.glsl
// for the definition of intersectShape. The appropriate function is selected
// based on the VoxelPrimitive shape type, and added to the shader in
// Scene/VoxelRenderResources.js.
// See also IntersectClippingPlane.glsl and IntersectDepth.glsl.
// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT,
// getFirstIntersection, initializeIntersections, nextIntersection.
/* Intersection defines (set in Scene/VoxelRenderResources.js)
#define INTERSECTION_COUNT ###
*/
RayShapeIntersection intersectScene(in vec2 screenCoord, in Ray ray, out Intersections ix) {
// Do a ray-shape intersection to find the exact starting and ending points.
intersectShape(ray, ix);
// Exit early if the positive shape was completely missed or behind the ray.
RayShapeIntersection intersection = getFirstIntersection(ix);
if (intersection.entry.w == NO_HIT) {
// Positive shape was completely missed - so exit early.
return intersection;
}
// Clipping planes
#if defined(CLIPPING_PLANES)
intersectClippingPlanes(ray, ix);
#endif
// Depth
#if defined(DEPTH_TEST)
intersectDepth(screenCoord, ray, ix);
#endif
// Find the first intersection that's in front of the ray
#if (INTERSECTION_COUNT > 1)
initializeIntersections(ix);
for (int i = 0; i < INTERSECTION_COUNT; ++i) {
intersection = nextIntersection(ix);
if (intersection.exit.w > 0.0) {
// Set start to 0.0 when ray is inside the shape.
intersection.entry.w = max(intersection.entry.w, 0.0);
break;
}
}
#else
// Set start to 0.0 when ray is inside the shape.
intersection.entry.w = max(intersection.entry.w, 0.0);
#endif
return intersection;
}
`;var aBi=T(S(),1),y9=`/* Box defines (set in Scene/VoxelBoxShape.js)
#define BOX_HAS_SHAPE_BOUNDS
*/
#if defined(BOX_HAS_SHAPE_BOUNDS)
uniform vec3 u_boxUvToShapeUvScale;
uniform vec3 u_boxUvToShapeUvTranslate;
#endif
vec3 convertUvToShapeUvSpace(in vec3 positionUv) {
#if defined(BOX_HAS_SHAPE_BOUNDS)
return positionUv * u_boxUvToShapeUvScale + u_boxUvToShapeUvTranslate;
#else
return positionUv;
#endif
}
vec3 convertShapeUvToUvSpace(in vec3 shapeUv) {
#if defined(BOX_HAS_SHAPE_BOUNDS)
return (shapeUv - u_boxUvToShapeUvTranslate) / u_boxUvToShapeUvScale;
#else
return shapeUv;
#endif
}
`;var lBi=T(S(),1),g9=`/* Cylinder defines (set in Scene/VoxelCylinderShape.js)
#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS
#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT
#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT
#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT
#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE
#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO
#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY
#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY
#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED
*/
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS)
uniform vec2 u_cylinderUvToShapeUvRadius; // x = scale, y = offset
#endif
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT)
uniform vec2 u_cylinderUvToShapeUvHeight; // x = scale, y = offset
#endif
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)
uniform vec2 u_cylinderUvToShapeUvAngle; // x = scale, y = offset
#endif
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY)
uniform vec2 u_cylinderShapeUvAngleMinMax;
#endif
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED)
uniform float u_cylinderShapeUvAngleRangeZeroMid;
#endif
vec3 convertUvToShapeUvSpace(in vec3 positionUv) {
vec3 positionLocal = positionUv * 2.0 - 1.0; // [-1,+1]
// Compute radius
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT)
float radius = 1.0;
#else
float radius = length(positionLocal.xy); // [0,1]
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS)
radius = radius * u_cylinderUvToShapeUvRadius.x + u_cylinderUvToShapeUvRadius.y; // x = scale, y = offset
#endif
#endif
// Compute height
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT)
float height = 1.0;
#else
float height = positionUv.z; // [0,1]
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT)
height = height * u_cylinderUvToShapeUvHeight.x + u_cylinderUvToShapeUvHeight.y; // x = scale, y = offset
#endif
#endif
// Compute angle
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO)
float angle = 1.0;
#else
float angle = (atan(positionLocal.y, positionLocal.x) + czm_pi) / czm_twoPi; // [0,1]
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED)
// Comparing against u_cylinderShapeUvAngleMinMax has precision problems. u_cylinderShapeUvAngleRangeZeroMid is more conservative.
angle += float(angle < u_cylinderShapeUvAngleRangeZeroMid);
#endif
// Avoid flickering from reading voxels from both sides of the -pi/+pi discontinuity.
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY)
angle = angle > u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.x : angle;
#elif defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY)
angle = angle < u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.y : angle;
#endif
angle = angle * u_cylinderUvToShapeUvAngle.x + u_cylinderUvToShapeUvAngle.y; // x = scale, y = offset
#endif
#endif
return vec3(radius, height, angle);
}
`;var uBi=T(S(),1),x9=`/* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js)
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY
#define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE
#define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO
#define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED
#define ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE
#define ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO
#define ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN
#define ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT
#define ELLIPSOID_IS_SPHERE
*/
uniform vec3 u_ellipsoidRadiiUv; // [0,1]
#if !defined(ELLIPSOID_IS_SPHERE)
uniform vec3 u_ellipsoidInverseRadiiSquaredUv;
#endif
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY) || defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED)
uniform vec3 u_ellipsoidShapeUvLongitudeMinMaxMid;
#endif
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)
uniform vec2 u_ellipsoidUvToShapeUvLongitude; // x = scale, y = offset
#endif
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)
uniform vec2 u_ellipsoidUvToShapeUvLatitude; // x = scale, y = offset
#endif
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN) && !defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT)
uniform float u_ellipsoidInverseHeightDifferenceUv;
uniform vec2 u_ellipseInnerRadiiUv; // [0,1]
#endif
// robust iterative solution without trig functions
// https://github.com/0xfaded/ellipse_demo/issues/1
// https://stackoverflow.com/questions/22959698/distance-from-given-point-to-given-ellipse
// Pro: Good when radii.x ~= radii.y
// Con: Breaks at pos.x ~= 0.0, especially inside the ellipse
// Con: Inaccurate with exterior points and thin ellipses
float ellipseDistanceIterative (vec2 pos, vec2 radii) {
vec2 p = abs(pos);
vec2 invRadii = 1.0 / radii;
vec2 a = vec2(1.0, -1.0) * (radii.x * radii.x - radii.y * radii.y) * invRadii;
vec2 t = vec2(0.70710678118); // sqrt(2) / 2
vec2 v = radii * t;
const int iterations = 3;
for (int i = 0; i < iterations; ++i) {
vec2 e = a * pow(t, vec2(3.0));
vec2 q = normalize(p - e) * length(v - e);
t = normalize((q + e) * invRadii);
v = radii * t;
}
return length(v * sign(pos) - pos) * sign(p.y - v.y);
}
vec3 convertUvToShapeUvSpace(in vec3 positionUv) {
// Compute position and normal.
// Convert positionUv [0,1] to local space [-1,+1] to "normalized" cartesian space [-a,+a] where a = (radii + height) / (max(radii) + height).
// A point on the largest ellipsoid axis would be [-1,+1] and everything else would be smaller.
vec3 positionLocal = positionUv * 2.0 - 1.0;
#if defined(ELLIPSOID_IS_SPHERE)
vec3 posEllipsoid = positionLocal * u_ellipsoidRadiiUv.x;
vec3 normal = normalize(posEllipsoid);
#else
vec3 posEllipsoid = positionLocal * u_ellipsoidRadiiUv;
vec3 normal = normalize(posEllipsoid * u_ellipsoidInverseRadiiSquaredUv); // geodetic surface normal
#endif
// Compute longitude
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO)
float longitude = 1.0;
#else
float longitude = (atan(normal.y, normal.x) + czm_pi) / czm_twoPi;
// Correct the angle when max < min
// Technically this should compare against min longitude - but it has precision problems so compare against the middle of empty space.
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED)
longitude += float(longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z);
#endif
// Avoid flickering from reading voxels from both sides of the -pi/+pi discontinuity.
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY)
longitude = longitude > u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.x : longitude;
#endif
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY)
longitude = longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.y : longitude;
#endif
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)
longitude = longitude * u_ellipsoidUvToShapeUvLongitude.x + u_ellipsoidUvToShapeUvLongitude.y;
#endif
#endif
// Compute latitude
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO)
float latitude = 1.0;
#else
float latitude = (asin(normal.z) + czm_piOverTwo) / czm_pi;
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)
latitude = latitude * u_ellipsoidUvToShapeUvLatitude.x + u_ellipsoidUvToShapeUvLatitude.y;
#endif
#endif
// Compute height
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT)
// TODO: This breaks down when minBounds == maxBounds. To fix it, this
// function would have to know if ray is intersecting the front or back of the shape
// and set the shape space position to 1 (front) or 0 (back) accordingly.
float height = 1.0;
#else
#if defined(ELLIPSOID_IS_SPHERE)
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN)
float height = (length(posEllipsoid) - u_ellipseInnerRadiiUv.x) * u_ellipsoidInverseHeightDifferenceUv;
#else
float height = length(posEllipsoid);
#endif
#else
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN)
// Convert the 3D position to a 2D position relative to the ellipse (radii.x, radii.z) (assuming radii.x == radii.y which is true for WGS84).
// This is an optimization so that math can be done with ellipses instead of ellipsoids.
vec2 posEllipse = vec2(length(posEllipsoid.xy), posEllipsoid.z);
float height = ellipseDistanceIterative(posEllipse, u_ellipseInnerRadiiUv) * u_ellipsoidInverseHeightDifferenceUv;
#else
// TODO: this is probably not correct
float height = length(posEllipsoid);
#endif
#endif
#endif
return vec3(longitude, latitude, height);
}
`;var hBi=T(S(),1),_9=`// These octree flags must be in sync with GpuOctreeFlag in VoxelTraversal.js
#define OCTREE_FLAG_INTERNAL 0
#define OCTREE_FLAG_LEAF 1
#define OCTREE_FLAG_PACKED_LEAF_FROM_PARENT 2
#define OCTREE_MAX_LEVELS 32 // Harcoded value because GLSL doesn't like variable length loops
uniform sampler2D u_octreeInternalNodeTexture;
uniform vec2 u_octreeInternalNodeTexelSizeUv;
uniform int u_octreeInternalNodeTilesPerRow;
#if (SAMPLE_COUNT > 1)
uniform sampler2D u_octreeLeafNodeTexture;
uniform vec2 u_octreeLeafNodeTexelSizeUv;
uniform int u_octreeLeafNodeTilesPerRow;
#endif
struct OctreeNodeData {
int data;
int flag;
};
struct TraversalData {
ivec4 octreeCoords;
int parentOctreeIndex;
};
struct SampleData {
int megatextureIndex;
ivec4 tileCoords;
vec3 tileUv;
#if (SAMPLE_COUNT > 1)
float weight;
#endif
};
// Integer mod: For WebGL1 only
int intMod(in int a, in int b) {
return a - (b * (a / b));
}
int normU8_toInt(in float value) {
return int(value * 255.0);
}
int normU8x2_toInt(in vec2 value) {
return int(value.x * 255.0) + 256 * int(value.y * 255.0);
}
float normU8x2_toFloat(in vec2 value) {
return float(normU8x2_toInt(value)) / 65535.0;
}
OctreeNodeData getOctreeNodeData(in vec2 octreeUv) {
vec4 texData = texture(u_octreeInternalNodeTexture, octreeUv);
OctreeNodeData data;
data.data = normU8x2_toInt(texData.xy);
data.flag = normU8x2_toInt(texData.zw);
return data;
}
OctreeNodeData getOctreeChildData(in int parentOctreeIndex, in ivec3 childCoord) {
int childIndex = childCoord.z * 4 + childCoord.y * 2 + childCoord.x;
int octreeCoordX = intMod(parentOctreeIndex, u_octreeInternalNodeTilesPerRow) * 9 + 1 + childIndex;
int octreeCoordY = parentOctreeIndex / u_octreeInternalNodeTilesPerRow;
vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5);
return getOctreeNodeData(octreeUv);
}
int getOctreeParentIndex(in int octreeIndex) {
int octreeCoordX = intMod(octreeIndex, u_octreeInternalNodeTilesPerRow) * 9;
int octreeCoordY = octreeIndex / u_octreeInternalNodeTilesPerRow;
vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5);
vec4 parentData = texture(u_octreeInternalNodeTexture, octreeUv);
int parentOctreeIndex = normU8x2_toInt(parentData.xy);
return parentOctreeIndex;
}
/**
* Convert a position in the uv-space of the tileset bounding shape
* into the uv-space of a tile within the tileset
*/
vec3 getTileUv(in vec3 shapePosition, in ivec4 octreeCoords) {
// PERFORMANCE_IDEA: use bit-shifting (only in WebGL2)
float dimAtLevel = pow(2.0, float(octreeCoords.w));
return shapePosition * dimAtLevel - vec3(octreeCoords.xyz);
}
void getOctreeLeafSampleData(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleData) {
sampleData.megatextureIndex = data.data;
sampleData.tileCoords = (data.flag == OCTREE_FLAG_PACKED_LEAF_FROM_PARENT)
? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1)
: octreeCoords;
}
#if (SAMPLE_COUNT > 1)
void getOctreeLeafSampleDatas(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleDatas[SAMPLE_COUNT]) {
int leafIndex = data.data;
int leafNodeTexelCount = 2;
// Adding 0.5 moves to the center of the texel
float leafCoordXStart = float(intMod(leafIndex, u_octreeLeafNodeTilesPerRow) * leafNodeTexelCount) + 0.5;
float leafCoordY = float(leafIndex / u_octreeLeafNodeTilesPerRow) + 0.5;
// Get an interpolation weight and a flag to determine whether to read the parent texture
vec2 leafUv0 = u_octreeLeafNodeTexelSizeUv * vec2(leafCoordXStart + 0.0, leafCoordY);
vec4 leafData0 = texture(u_octreeLeafNodeTexture, leafUv0);
float lerp = normU8x2_toFloat(leafData0.xy);
sampleDatas[0].weight = 1.0 - lerp;
sampleDatas[1].weight = lerp;
// TODO: this looks wrong? Should be comparing to OCTREE_FLAG_PACKED_LEAF_FROM_PARENT
sampleDatas[0].tileCoords = (normU8_toInt(leafData0.z) == 1)
? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1)
: octreeCoords;
sampleDatas[1].tileCoords = (normU8_toInt(leafData0.w) == 1)
? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1)
: octreeCoords;
// Get megatexture indices for both samples
vec2 leafUv1 = u_octreeLeafNodeTexelSizeUv * vec2(leafCoordXStart + 1.0, leafCoordY);
vec4 leafData1 = texture(u_octreeLeafNodeTexture, leafUv1);
sampleDatas[0].megatextureIndex = normU8x2_toInt(leafData1.xy);
sampleDatas[1].megatextureIndex = normU8x2_toInt(leafData1.zw);
}
#endif
OctreeNodeData traverseOctreeDownwards(in vec3 shapePosition, inout TraversalData traversalData) {
float sizeAtLevel = 1.0 / pow(2.0, float(traversalData.octreeCoords.w));
vec3 start = vec3(traversalData.octreeCoords.xyz) * sizeAtLevel;
vec3 end = start + vec3(sizeAtLevel);
OctreeNodeData childData;
for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) {
// Find out which octree child contains the position
// 0 if before center, 1 if after
vec3 center = 0.5 * (start + end);
vec3 childCoord = step(center, shapePosition);
// Get octree coords for the next level down
ivec4 octreeCoords = traversalData.octreeCoords;
traversalData.octreeCoords = ivec4(octreeCoords.xyz * 2 + ivec3(childCoord), octreeCoords.w + 1);
childData = getOctreeChildData(traversalData.parentOctreeIndex, ivec3(childCoord));
if (childData.flag != OCTREE_FLAG_INTERNAL) {
// leaf tile - stop traversing
break;
}
// interior tile - keep going deeper
start = mix(start, center, childCoord);
end = mix(center, end, childCoord);
traversalData.parentOctreeIndex = childData.data;
}
return childData;
}
/**
* Transform a given position to an octree tile coordinate and a position within that tile,
* and find the corresponding megatexture index and texture coordinates
*/
void traverseOctreeFromBeginning(in vec3 shapePosition, out TraversalData traversalData, out SampleData sampleDatas[SAMPLE_COUNT]) {
traversalData.octreeCoords = ivec4(0);
traversalData.parentOctreeIndex = 0;
OctreeNodeData nodeData = getOctreeNodeData(vec2(0.0));
if (nodeData.flag != OCTREE_FLAG_LEAF) {
nodeData = traverseOctreeDownwards(shapePosition, traversalData);
}
#if (SAMPLE_COUNT == 1)
getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]);
sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords);
#else
getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas);
sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords);
sampleDatas[1].tileUv = getTileUv(shapePosition, sampleDatas[1].tileCoords);
#endif
}
bool inRange(in vec3 v, in vec3 minVal, in vec3 maxVal) {
return clamp(v, minVal, maxVal) == v;
}
bool insideTile(in vec3 shapePosition, in ivec4 octreeCoords) {
vec3 tileUv = getTileUv(shapePosition, octreeCoords);
bool inside = inRange(tileUv, vec3(0.0), vec3(1.0));
// Assume (!) the position is always inside the root tile.
return inside || octreeCoords.w == 0;
}
void traverseOctreeFromExisting(in vec3 shapePosition, inout TraversalData traversalData, inout SampleData sampleDatas[SAMPLE_COUNT]) {
if (insideTile(shapePosition, traversalData.octreeCoords)) {
for (int i = 0; i < SAMPLE_COUNT; i++) {
sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords);
}
return;
}
// Go up tree until we find a parent tile containing shapePosition
for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) {
traversalData.octreeCoords.xyz /= 2;
traversalData.octreeCoords.w -= 1;
if (insideTile(shapePosition, traversalData.octreeCoords)) {
break;
}
traversalData.parentOctreeIndex = getOctreeParentIndex(traversalData.parentOctreeIndex);
}
// Go down tree
OctreeNodeData nodeData = traverseOctreeDownwards(shapePosition, traversalData);
#if (SAMPLE_COUNT == 1)
getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]);
sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords);
#else
getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas);
sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords);
sampleDatas[1].tileUv = getTileUv(shapePosition, sampleDatas[1].tileCoords);
#endif
}
`;var pBi=T(S(),1),T9=`// See Octree.glsl for the definitions of SampleData and intMod
/* Megatexture defines (set in Scene/VoxelRenderResources.js)
#define SAMPLE_COUNT ###
#define NEAREST_SAMPLING
#define PADDING
*/
uniform ivec2 u_megatextureSliceDimensions; // number of slices per tile, in two dimensions
uniform ivec2 u_megatextureTileDimensions; // number of tiles per megatexture, in two dimensions
uniform vec2 u_megatextureVoxelSizeUv;
uniform vec2 u_megatextureSliceSizeUv;
uniform vec2 u_megatextureTileSizeUv;
uniform ivec3 u_dimensions; // does not include padding
#if defined(PADDING)
uniform ivec3 u_paddingBefore;
uniform ivec3 u_paddingAfter;
#endif
// Integer min, max, clamp: For WebGL1 only
int intMin(int a, int b) {
return a <= b ? a : b;
}
int intMax(int a, int b) {
return a >= b ? a : b;
}
int intClamp(int v, int minVal, int maxVal) {
return intMin(intMax(v, minVal), maxVal);
}
vec2 index1DTo2DTexcoord(int index, ivec2 dimensions, vec2 uvScale)
{
int indexX = intMod(index, dimensions.x);
int indexY = index / dimensions.x;
return vec2(indexX, indexY) * uvScale;
}
/*
How is 3D data stored in a 2D megatexture?
In this example there is only one loaded tile and it has 2x2x2 voxels (8 voxels total).
The data is sliced by Z. The data at Z = 0 is placed in texels (0,0), (0,1), (1,0), (1,1) and
the data at Z = 1 is placed in texels (2,0), (2,1), (3,0), (3,1).
Note that there could be empty space in the megatexture because it's a power of two.
0 1 2 3
+---+---+---+---+
| | | | | 3
+---+---+---+---+
| | | | | 2
+-------+-------+
|010|110|011|111| 1
|--- ---|--- ---|
|000|100|001|101| 0
+-------+-------+
When doing linear interpolation the megatexture needs to be sampled twice: once for
the Z slice above the voxel coordinate and once for the slice below. The two slices
are interpolated with fract(coord.z - 0.5). For example, a Z coordinate of 1.0 is
halfway between two Z slices so the interpolation factor is 0.5. Below is a side view
of the 3D voxel grid with voxel coordinates on the left side.
2 +---+
|001|
1 +-z-+
|000|
0 +---+
When doing nearest neighbor the megatexture only needs to be sampled once at the closest Z slice.
*/
Properties getPropertiesFromMegatexture(in SampleData sampleData) {
vec3 tileUv = clamp(sampleData.tileUv, vec3(0.0), vec3(1.0)); // TODO is the clamp necessary?
int tileIndex = sampleData.megatextureIndex;
vec3 voxelCoord = tileUv * vec3(u_dimensions);
ivec3 voxelDimensions = u_dimensions;
#if defined(PADDING)
voxelDimensions += u_paddingBefore + u_paddingAfter;
voxelCoord += vec3(u_paddingBefore);
#endif
#if defined(NEAREST_SAMPLING)
// Round to the center of the nearest voxel
voxelCoord = floor(voxelCoord) + vec3(0.5);
#endif
// Tile location
vec2 tileUvOffset = index1DTo2DTexcoord(tileIndex, u_megatextureTileDimensions, u_megatextureTileSizeUv);
// Slice location
float slice = voxelCoord.z - 0.5;
int sliceIndex = int(floor(slice));
int sliceIndex0 = intClamp(sliceIndex, 0, voxelDimensions.z - 1);
vec2 sliceUvOffset0 = index1DTo2DTexcoord(sliceIndex0, u_megatextureSliceDimensions, u_megatextureSliceSizeUv);
// Voxel location
vec2 voxelUvOffset = clamp(voxelCoord.xy, vec2(0.5), vec2(voxelDimensions.xy) - vec2(0.5)) * u_megatextureVoxelSizeUv;
// Final location in the megatexture
vec2 uv0 = tileUvOffset + sliceUvOffset0 + voxelUvOffset;
#if defined(NEAREST_SAMPLING)
return getPropertiesFromMegatextureAtUv(uv0);
#else
float sliceLerp = fract(slice);
int sliceIndex1 = intMin(sliceIndex + 1, voxelDimensions.z - 1);
vec2 sliceUvOffset1 = index1DTo2DTexcoord(sliceIndex1, u_megatextureSliceDimensions, u_megatextureSliceSizeUv);
vec2 uv1 = tileUvOffset + sliceUvOffset1 + voxelUvOffset;
Properties properties0 = getPropertiesFromMegatextureAtUv(uv0);
Properties properties1 = getPropertiesFromMegatextureAtUv(uv1);
return mixProperties(properties0, properties1, sliceLerp);
#endif
}
// Convert an array of sample datas to a final weighted properties.
Properties accumulatePropertiesFromMegatexture(in SampleData sampleDatas[SAMPLE_COUNT]) {
#if (SAMPLE_COUNT == 1)
return getPropertiesFromMegatexture(sampleDatas[0]);
#else
// When more than one sample is taken the accumulator needs to start at 0
Properties properties = clearProperties();
for (int i = 0; i < SAMPLE_COUNT; ++i) {
float weight = sampleDatas[i].weight;
// Avoid reading the megatexture when the weight is 0 as it can be costly.
if (weight > 0.0) {
Properties tempProperties = getPropertiesFromMegatexture(sampleDatas[i]);
tempProperties = scaleProperties(tempProperties, weight);
properties = sumProperties(properties, tempProperties);
}
}
return properties;
#endif
}
`;function a0t(e){let t=new o_;this.shaderBuilder=t;let n=e._customShader,i=Tt(e._uniformMap,n.uniformMap);e._uniformMap=i;let o=n.uniforms;for(let p in o)if(o.hasOwnProperty(p)){let y=o[p];t.addUniform(y.type,p,Se.FRAGMENT)}t.addUniform("sampler2D","u_megatextureTextures[METADATA_COUNT]",Se.FRAGMENT),this.uniformMap=i;let r=e._clippingPlanes,s=l(r)&&r.enabled?r.length:0;this.clippingPlanes=r,this.clippingPlanesLength=s,t.addVertexLines([d9]),t.addFragmentLines([n.fragmentShaderText,"#line 0",_9,u9,T9]),s>0&&(t.addDefine("CLIPPING_PLANES",void 0,Se.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",s,Se.FRAGMENT),r.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,Se.FRAGMENT),t.addFragmentLines([h9])),e._depthTest&&(t.addDefine("DEPTH_TEST",void 0,Se.FRAGMENT),t.addFragmentLines([m9]));let a=e._provider.shape;a==="BOX"?(t.addDefine("SHAPE_BOX",void 0,Se.FRAGMENT),t.addFragmentLines([y9,f9,KT])):a==="CYLINDER"?t.addFragmentLines([p9,KT,g9]):a==="ELLIPSOID"&&t.addFragmentLines([b9,KT,x9]),t.addFragmentLines([l9]);let c=e._shape,d=c.shaderDefines;for(let p in d)if(d.hasOwnProperty(p)){let y=d[p];l(y)&&(y=y===!0?void 0:y,t.addDefine(p,y,Se.FRAGMENT))}let u=c.shaderMaximumIntersectionsLength;s>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",u,Se.FRAGMENT),s===1?u+=1:r.unionClippingRegions?u+=2:u+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",u,Se.FRAGMENT),u+=1),t.addDefine("INTERSECTION_COUNT",u,Se.FRAGMENT),(!h.equals(e.paddingBefore,h.ZERO)||!h.equals(e.paddingAfter,h.ZERO))&&t.addDefine("PADDING",void 0,Se.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,Se.FRAGMENT),e._jitter&&t.addDefine("JITTER",void 0,Se.FRAGMENT),e._nearestSampling&&t.addDefine("NEAREST_SAMPLING",void 0,Se.FRAGMENT);let m=e._traversal;t.addDefine("SAMPLE_COUNT",`${m._sampleCount}`,Se.FRAGMENT)}var S9=a0t;var kBi=T(S(),1);function c0t(e,t){let{shaderBuilder:n}=e,{names:i,types:o,componentTypes:r,minimumValues:s,maximumValues:a}=t._provider,c=o.length,d=l(s)&&l(a);n.addDefine("METADATA_COUNT",c,Se.FRAGMENT),d&&n.addDefine("STATISTICS",void 0,Se.FRAGMENT);for(let v=0;v<c;v++){let F=i[v],M=o[v],b=`PropertyStatistics_${F}`,R=`PropertyStatistics_${F}`;n.addStruct(b,R,Se.FRAGMENT);let E=$D(M);n.addStructField(b,E,"min"),n.addStructField(b,E,"max")}let u="Statistics",m="Statistics",p="statistics";n.addStruct(u,m,Se.FRAGMENT);for(let v=0;v<c;v++){let F=i[v],M=`PropertyStatistics_${F}`,b=F;n.addStructField(u,M,b)}let y="Metadata",f="Metadata",x="metadata";n.addStruct(y,f,Se.FRAGMENT),n.addStructField(y,m,p);for(let v=0;v<c;v++){let F=i[v],M=o[v],b=$D(M);n.addStructField(y,b,F)}for(let v=0;v<c;v++){let F=i[v],M=o[v],b=d0t(M),R=`VoxelProperty_${F}`,E=`VoxelProperty_${F}`;n.addStruct(R,E,Se.FRAGMENT),n.addStructField(R,b,"partialDerivativeLocal"),n.addStructField(R,b,"partialDerivativeWorld"),n.addStructField(R,b,"partialDerivativeView"),n.addStructField(R,b,"partialDerivativeValid")}let _="Voxel",C="Voxel",V="voxel";n.addStruct(_,C,Se.FRAGMENT);for(let v=0;v<c;v++){let F=i[v],M=`VoxelProperty_${F}`;n.addStructField(_,M,F)}n.addStructField(_,"vec3","positionEC"),n.addStructField(_,"vec3","positionUv"),n.addStructField(_,"vec3","positionShapeUv"),n.addStructField(_,"vec3","positionUvLocal"),n.addStructField(_,"vec3","viewDirUv"),n.addStructField(_,"vec3","viewDirWorld"),n.addStructField(_,"vec3","surfaceNormal"),n.addStructField(_,"float","travelDistance");let L="FragmentInput";n.addStruct(L,"FragmentInput",Se.FRAGMENT),n.addStructField(L,f,x),n.addStructField(L,C,V);let G="Properties",I="Properties",P="properties";n.addStruct(G,I,Se.FRAGMENT);for(let v=0;v<c;v++){let F=i[v],M=o[v],b=$D(M);n.addStructField(G,b,F)}{let v="clearProperties";n.addFunction(v,`${I} clearProperties()`,Se.FRAGMENT),n.addFunctionLines(v,[`${I} ${P};`]);for(let F=0;F<c;F++){let M=i[F],b=o[F],R=r[F],E=$D(b,R);n.addFunctionLines(v,[`${P}.${M} = ${E}(0.0);`])}n.addFunctionLines(v,[`return ${P};`])}{let v="sumProperties";n.addFunction(v,`${I} sumProperties(${I} propertiesA, ${I} propertiesB)`,Se.FRAGMENT),n.addFunctionLines(v,[`${I} ${P};`]);for(let F=0;F<c;F++){let M=i[F];n.addFunctionLines(v,[`${P}.${M} = propertiesA.${M} + propertiesB.${M};`])}n.addFunctionLines(v,[`return ${P};`])}{let v="scaleProperties";n.addFunction(v,`${I} scaleProperties(${I} ${P}, float scale)`,Se.FRAGMENT),n.addFunctionLines(v,[`${I} scaledProperties = ${P};`]);for(let F=0;F<c;F++){let M=i[F];n.addFunctionLines(v,[`scaledProperties.${M} *= scale;`])}n.addFunctionLines(v,["return scaledProperties;"])}{let v="mixProperties";n.addFunction(v,`${I} mixProperties(${I} propertiesA, ${I} propertiesB, float mixFactor)`,Se.FRAGMENT),n.addFunctionLines(v,[`${I} ${P};`]);for(let F=0;F<c;F++){let M=i[F];n.addFunctionLines(v,[`${P}.${M} = mix(propertiesA.${M}, propertiesB.${M}, mixFactor);`])}n.addFunctionLines(v,[`return ${P};`])}{let v="copyPropertiesToMetadata";n.addFunction(v,`void copyPropertiesToMetadata(in ${I} ${P}, inout ${f} ${x})`,Se.FRAGMENT);for(let F=0;F<c;F++){let M=i[F];n.addFunctionLines(v,[`${x}.${M} = ${P}.${M};`])}}if(d){let v="setStatistics";n.addFunction(v,`void setStatistics(inout ${m} ${p})`,Se.FRAGMENT);for(let F=0;F<c;F++){let M=i[F],b=o[F],R=Ht.getComponentCount(b);for(let E=0;E<R;E++){let X=u0t(b,E),w=s[F][E],N=a[F][E];n.addFunctionLines(v,[`${p}.${M}.min${X} = ${c_e(w)};`,`${p}.${M}.max${X} = ${c_e(N)};`])}}}{let v="getPropertiesFromMegatextureAtUv";n.addFunction(v,`${I} getPropertiesFromMegatextureAtUv(vec2 texcoord)`,Se.FRAGMENT),n.addFunctionLines(v,[`${I} ${P};`]);for(let F=0;F<c;F++){let M=i[F],b=o[F],R=r[F],E=l0t(b,R);n.addFunctionLines(v,[`properties.${M} = texture(u_megatextureTextures[${F}], texcoord)${E};`])}n.addFunctionLines(v,[`return ${P};`])}}function $D(e){if(e===Ht.SCALAR)return"float";if(e===Ht.VEC2)return"vec2";if(e===Ht.VEC3)return"vec3";if(e===Ht.VEC4)return"vec4"}function l0t(e){if(e===Ht.SCALAR)return".r";if(e===Ht.VEC2)return".ra";if(e===Ht.VEC3)return".rgb";if(e===Ht.VEC4)return""}function d0t(e){if(e===Ht.SCALAR)return"vec3";if(e===Ht.VEC2)return"mat2";if(e===Ht.VEC3)return"mat3";if(e===Ht.VEC4)return"mat4"}function c_e(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function u0t(e,t){return e===Ht.SCALAR?"":`[${t}]`}var C9=c0t;function m0t(e,t){let n=new S9(e);C9(n,e);let{shaderBuilder:i,clippingPlanes:o,clippingPlanesLength:r}=n;if(r>0){let f="getClippingPlane",x=Y0(o,t),_=0,C=x.indexOf(")")+1,V=x.indexOf("{",C)+1,L=x.indexOf("}",V),Z=x.slice(_,C),G=x.slice(V,L);i.addFunction(f,Z,Se.FRAGMENT),i.addFunctionLines(f,[G])}let s=i.clone();s.addDefine("PICKING",void 0,Se.FRAGMENT);let a=i.buildShaderProgram(t),c=s.buildShaderProgram(t),d=ke.fromCache({cull:{enabled:!0,face:yi.BACK},depthTest:{enabled:!1},depthMask:!1,blending:mn.PRE_MULTIPLIED_ALPHA_BLEND}),u=t.getViewportQuadVertexArray(),m=e._depthTest,p=new nt({vertexArray:u,primitiveType:Ae.TRIANGLES,renderState:d,shaderProgram:a,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:Ve.VOXELS,executeInClosestFrustum:!0,owner:this,cull:m,occlude:m}),y=nt.shallowClone(p,new nt);if(y.shaderProgram=c,y.pickOnly=!0,l(e._drawCommand)){let f=e._drawCommand;f.shaderProgram=f.shaderProgram&&f.shaderProgram.destroy()}if(l(e._drawCommandPick)){let f=e._drawCommandPick;f.shaderProgram=f.shaderProgram&&f.shaderProgram.destroy()}e._drawCommand=p,e._drawCommandPick=y}var V9=m0t;var i3i=T(S(),1);function Qf(){this.featurePropertiesDirty=!1}Object.defineProperties(Qf.prototype,{featuresLength:{get:function(){fe.throwInstantiationError()}},pointsLength:{get:function(){fe.throwInstantiationError()}},trianglesLength:{get:function(){fe.throwInstantiationError()}},geometryByteLength:{get:function(){fe.throwInstantiationError()}},texturesByteLength:{get:function(){fe.throwInstantiationError()}},batchTableByteLength:{get:function(){fe.throwInstantiationError()}},innerContents:{get:function(){fe.throwInstantiationError()}},ready:{get:function(){fe.throwInstantiationError()}},tileset:{get:function(){fe.throwInstantiationError()}},tile:{get:function(){fe.throwInstantiationError()}},url:{get:function(){fe.throwInstantiationError()}},batchTable:{get:function(){fe.throwInstantiationError()}},metadata:{get:function(){fe.throwInstantiationError()},set:function(e){fe.throwInstantiationError()}},group:{get:function(){fe.throwInstantiationError()},set:function(e){fe.throwInstantiationError()}}});Qf.prototype.hasProperty=function(e,t){fe.throwInstantiationError()};Qf.prototype.getFeature=function(e){fe.throwInstantiationError()};Qf.prototype.applyDebugSettings=function(e,t){fe.throwInstantiationError()};Qf.prototype.applyStyle=function(e){fe.throwInstantiationError()};Qf.prototype.update=function(e,t){fe.throwInstantiationError()};Qf.prototype.pick=function(e,t,n){fe.throwInstantiationError()};Qf.prototype.isDestroyed=function(){fe.throwInstantiationError()};Qf.prototype.destroy=function(){fe.throwInstantiationError()};var u8=Qf;var b3i=T(S(),1);var c3i=T(S(),1);function jV(e,t){this._conditionsExpression=ze(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,f0t(this,t)}Object.defineProperties(jV.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function h0t(e,t){this.condition=e,this.expression=t}function f0t(e,t){let n=[],i=e._conditions;if(!l(i))return;let o=i.length;for(let r=0;r<o;++r){let s=i[r],a=String(s[0]),c=String(s[1]);n.push(new h0t(new uu(a,t),new uu(c,t)))}e._runtimeConditions=n}jV.prototype.evaluate=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.condition.evaluate(e))return r.expression.evaluate(e,t)}};jV.prototype.evaluateColor=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.condition.evaluate(e))return r.expression.evaluateColor(e,t)}};jV.prototype.getShaderFunction=function(e,t,n,i){let o=this._runtimeConditions;if(!l(o)||o.length===0)return;let r="",s=o.length;for(let a=0;a<s;++a){let c=o[a],d=c.condition.getShaderExpression(t,n),u=c.expression.getShaderExpression(t,n);r+=` ${a===0?"if":"else if"} (${d})
{
return ${u};
}
`}return r=`${i} ${e}
{
${r} return ${i}(1.0);
}
`,r};jV.prototype.getVariables=function(){let e=[],t=this._runtimeConditions;if(!l(t)||t.length===0)return e;let n=t.length;for(let i=0;i<n;++i){let o=t[i];e.push.apply(e,o.condition.getVariables()),e.push.apply(e,o.expression.getVariables())}return e=e.filter(function(i,o,r){return r.indexOf(i)===o}),e};var L9=jV;function Vg(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,p0t(this,e)}function p0t(e,t){t=g(ze(t,!0),e._style),e._style=t,e.show=t.show,e.color=t.color,e.pointSize=t.pointSize,e.pointOutlineColor=t.pointOutlineColor,e.pointOutlineWidth=t.pointOutlineWidth,e.labelColor=t.labelColor,e.labelOutlineColor=t.labelOutlineColor,e.labelOutlineWidth=t.labelOutlineWidth,e.labelStyle=t.labelStyle,e.font=t.font,e.labelText=t.labelText,e.backgroundColor=t.backgroundColor,e.backgroundPadding=t.backgroundPadding,e.backgroundEnabled=t.backgroundEnabled,e.scaleByDistance=t.scaleByDistance,e.translucencyByDistance=t.translucencyByDistance,e.distanceDisplayCondition=t.distanceDisplayCondition,e.heightOffset=t.heightOffset,e.anchorLineEnabled=t.anchorLineEnabled,e.anchorLineColor=t.anchorLineColor,e.image=t.image,e.disableDepthTestDistance=t.disableDepthTestDistance,e.horizontalOrigin=t.horizontalOrigin,e.verticalOrigin=t.verticalOrigin,e.labelHorizontalOrigin=t.labelHorizontalOrigin,e.labelVerticalOrigin=t.labelVerticalOrigin;let n={};if(l(t.meta)){let i=t.defines,o=g(t.meta,g.EMPTY_OBJECT);for(let r in o)o.hasOwnProperty(r)&&(n[r]=new uu(o[r],i))}e._meta=n,e._ready=!0}function or(e,t){let n=g(e._style,g.EMPTY_OBJECT).defines;if(l(t)){if(typeof t=="boolean"||typeof t=="number")return new uu(String(t));if(typeof t=="string")return new uu(t,n);if(l(t.conditions))return new L9(t,n)}else return;return t}function rr(e){if(l(e)){if(l(e.expression))return e.expression;if(l(e.conditionsExpression))return ze(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(Vg.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=or(this,e),this._style.show=rr(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=or(this,e),this._style.color=rr(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=or(this,e),this._style.pointSize=rr(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=or(this,e),this._style.pointOutlineColor=rr(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=or(this,e),this._style.pointOutlineWidth=rr(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=or(this,e),this._style.labelColor=rr(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=or(this,e),this._style.labelOutlineColor=rr(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=or(this,e),this._style.labelOutlineWidth=rr(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=or(this,e),this._style.font=rr(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=or(this,e),this._style.labelStyle=rr(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=or(this,e),this._style.labelText=rr(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=or(this,e),this._style.backgroundColor=rr(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=or(this,e),this._style.backgroundPadding=rr(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=or(this,e),this._style.backgroundEnabled=rr(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=or(this,e),this._style.scaleByDistance=rr(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=or(this,e),this._style.translucencyByDistance=rr(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=or(this,e),this._style.distanceDisplayCondition=rr(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=or(this,e),this._style.heightOffset=rr(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=or(this,e),this._style.anchorLineEnabled=rr(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=or(this,e),this._style.anchorLineColor=rr(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=or(this,e),this._style.image=rr(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=or(this,e),this._style.disableDepthTestDistance=rr(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=or(this,e),this._style.horizontalOrigin=rr(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=or(this,e),this._style.verticalOrigin=rr(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=or(this,e),this._style.labelHorizontalOrigin=rr(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=or(this,e),this._style.labelVerticalOrigin=rr(this._labelVerticalOrigin)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});Vg.fromUrl=function(e){return Xe.createIfNeeded(e).fetchJson(e).then(function(n){return new Vg(n)})};Vg.prototype.getColorShaderFunction=function(e,t,n){return this._colorShaderFunctionReady?(n.translucent=this._colorShaderTranslucent,this._colorShaderFunction):(this._colorShaderFunctionReady=!0,l(this.color)&&l(this.color.getShaderFunction)?this._colorShaderFunction=this.color.getShaderFunction(e,t,n,"vec4"):this._colorShaderFunction=void 0,this._colorShaderTranslucent=n.translucent,this._colorShaderFunction)};Vg.prototype.getShowShaderFunction=function(e,t,n){return this._showShaderFunctionReady?this._showShaderFunction:(this._showShaderFunctionReady=!0,l(this.show)&&l(this.show.getShaderFunction)?this._showShaderFunction=this.show.getShaderFunction(e,t,n,"bool"):this._showShaderFunction=void 0,this._showShaderFunction)};Vg.prototype.getPointSizeShaderFunction=function(e,t,n){return this._pointSizeShaderFunctionReady?this._pointSizeShaderFunction:(this._pointSizeShaderFunctionReady=!0,l(this.pointSize)&&l(this.pointSize.getShaderFunction)?this._pointSizeShaderFunction=this.pointSize.getShaderFunction(e,t,n,"float"):this._pointSizeShaderFunction=void 0,this._pointSizeShaderFunction)};Vg.prototype.getVariables=function(){let e=[];return l(this.color)&&l(this.color.getVariables)&&e.push.apply(e,this.color.getVariables()),l(this.show)&&l(this.show.getVariables)&&e.push.apply(e,this.show.getVariables()),l(this.pointSize)&&l(this.pointSize.getVariables)&&e.push.apply(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var zT=Vg;var WOi=T(S(),1);var _3i=T(S(),1);function R9(e){e=g(e,g.EMPTY_OBJECT),this._maximumSubtreeCount=g(e.maximumSubtreeCount,0),this._subtreeRequestCounter=0,this._queue=new DT({comparator:R9.comparator})}R9.prototype.addSubtree=function(e){let t=new b0t(e,this._subtreeRequestCounter);this._subtreeRequestCounter++,this._queue.insert(t);let n=e.implicitCoordinates;if(n.level>0){let i=n.getParentSubtreeCoordinates(),o=this.find(i)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==t;)this._queue.removeMinimum()};R9.prototype.find=function(e){let t=this._queue,n=t.internalArray,i=t.length;for(let o=0;o<i;o++){let r=n[o],a=r.subtree.implicitCoordinates;if(e.isEqual(a))return r.subtree}};R9.comparator=function(e,t){let n=e.subtree.implicitCoordinates,i=t.subtree.implicitCoordinates;return n.isAncestor(i)?1:i.isAncestor(n)?-1:e.stamp-t.stamp};function b0t(e,t){this.subtree=e,this.stamp=t}var Z9=R9;var E3i=T(S(),1);function Hl(){this.orientedBoundingBox=new Xn,this.boundingSphere=new ce,this.boundTransform=new A,this.shapeTransform=new A,this._minBounds=h.clone(Hl.DefaultMinBounds,new h),this._maxBounds=h.clone(Hl.DefaultMaxBounds,new h),this.shaderUniforms={renderMinBounds:new h,renderMaxBounds:new h,boxUvToShapeUvScale:new h,boxUvToShapeUvTranslate:new h},this.shaderDefines={BOX_INTERSECTION_INDEX:void 0,BOX_HAS_SHAPE_BOUNDS:void 0},this.shaderMaximumIntersectionsLength=0}var y0t=new h,m8=new h,g0t=new q,x0t=new h,_0t=new h,T0t=new h,S0t=new h,l_e=A.fromRotationTranslation(q.fromUniformScale(.5,new q),new h(.5,.5,.5),new A);Hl.prototype.update=function(e,t,n,i,o){i=g(i,Hl.DefaultMinBounds),o=g(o,Hl.DefaultMaxBounds);let r=Hl.DefaultMinBounds,s=Hl.DefaultMaxBounds;t=this._minBounds=h.clamp(t,r,s,this._minBounds),n=this._maxBounds=h.clamp(n,r,s,this._maxBounds),i=h.clamp(i,r,s,x0t),o=h.clamp(o,r,s,_0t);let a=h.clamp(t,i,o,T0t),c=h.clamp(n,i,o,S0t),d=A.getScale(e,m8);if(a.x>c.x||a.y>c.y||a.z>c.z||(a.x===c.x)+(a.y===c.y)+(a.z===c.z)>=2||i.x>o.x||i.y>o.y||i.z>o.z||d.x===0||d.y===0||d.z===0)return!1;this.shapeTransform=A.clone(e,this.shapeTransform),this.orientedBoundingBox=d_e(a,c,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=A.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ce.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let{shaderUniforms:u,shaderDefines:m}=this;for(let f in m)m.hasOwnProperty(f)&&(m[f]=void 0);let p=!h.equals(t,r)||!h.equals(n,s),y=0;if(m.BOX_INTERSECTION_INDEX=y,y+=1,u.renderMinBounds=A.multiplyByPoint(l_e,a,u.renderMinBounds),u.renderMaxBounds=A.multiplyByPoint(l_e,c,u.renderMaxBounds),p){m.BOX_HAS_SHAPE_BOUNDS=!0;let f=t,x=n;u.boxUvToShapeUvScale=h.fromElements(2/(f.x===x.x?1:x.x-f.x),2/(f.y===x.y?1:x.y-f.y),2/(f.z===x.z?1:x.z-f.z),u.boxUvToShapeUvScale),u.boxUvToShapeUvTranslate=h.fromElements(-u.boxUvToShapeUvScale.x*(f.x*.5+.5),-u.boxUvToShapeUvScale.y*(f.y*.5+.5),-u.boxUvToShapeUvScale.z*(f.z*.5+.5),u.boxUvToShapeUvTranslate)}return this.shaderMaximumIntersectionsLength=y,!0};var C0t=new h,V0t=new h;Hl.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=h.fromElements(W.lerp(r.x,s.x,a*t),W.lerp(r.y,s.y,a*n),W.lerp(r.z,s.z,a*i),C0t),d=h.fromElements(W.lerp(r.x,s.x,a*(t+1)),W.lerp(r.y,s.y,a*(n+1)),W.lerp(r.z,s.z,a*(i+1)),V0t);return d_e(c,d,this.shapeTransform,o)};Hl.prototype.computeApproximateStepSize=function(e){return 1/h.maximumComponent(e)};Hl.DefaultMinBounds=Object.freeze(new h(-1,-1,-1));Hl.DefaultMaxBounds=Object.freeze(new h(1,1,1));function d_e(e,t,n,i){let o=Hl.DefaultMinBounds,r=Hl.DefaultMaxBounds;if(h.equals(e,o)&&h.equals(t,r))i.center=A.getTranslation(n,i.center),i.halfAxes=A.getMatrix3(n,i.halfAxes);else{let a=A.getScale(n,m8),c=h.midpoint(e,t,y0t);i.center=A.multiplyByPoint(n,c,i.center),a=h.fromElements(a.x*.5*(t.x-e.x),a.y*.5*(t.y-e.y),a.z*.5*(t.z-e.z),m8);let d=A.getRotation(n,g0t);i.halfAxes=q.setScale(d,a,i.halfAxes)}return i}var jf=Hl;var v3i=T(S(),1);function eB(e){this._resource=e,this._metadataTable=void 0}Object.defineProperties(eB.prototype,{metadataTable:{get:function(){return this._metadataTable}}});eB.fromJson=async function(e,t,n,i){let o;l(t)?o={json:t,binary:void 0}:o=R0t(n);let r=await L0t(e,o.json,o.binary),s={},a=o.json.bufferViews.length;for(let m=0;m<a;++m){let p=o.json.bufferViews[m],y=p.byteOffset,f=y+p.byteLength,_=r[p.buffer].subarray(y,f);s[m]=_}let c=o.json.voxelTable,d=o.json.propertyTables[c],u=new eB(e);return u._metadataTable=new Ll({count:d.count,properties:d.properties,class:i.classes[d.class],bufferViews:s}),u};function L0t(e,t,n){let i=t.buffers.length,o=new Array(i);for(let r=0;r<i;r++){let s=t.buffers[r];if(l(s.uri)){let c=e.getDerivedResource({url:s.uri});o[r]=c.fetchArrayBuffer().then(function(d){return new Uint8Array(d)})}else o[r]=Promise.resolve(n)}return Promise.all(o)}function R0t(e){let n=new DataView(e.buffer,e.byteOffset),i=8,o=n.getUint32(i,!0);i+=8;let r=n.getUint32(i,!0);i+=8;let s=Po(e,i,o);i+=o;let a=e.subarray(i,i+r);return{json:s,binary:a}}var G9=eB;var Y3i=T(S(),1);function Qr(){this.orientedBoundingBox=new Xn,this.boundingSphere=new ce,this.boundTransform=new A,this.shapeTransform=new A,this._minimumRadius=Qr.DefaultMinBounds.x,this._maximumRadius=Qr.DefaultMaxBounds.x,this._minimumHeight=Qr.DefaultMinBounds.y,this._maximumHeight=Qr.DefaultMaxBounds.y,this._minimumAngle=Qr.DefaultMinBounds.z,this._maximumAngle=Qr.DefaultMaxBounds.z,this.shaderUniforms={cylinderUvToRenderBoundsScale:new h,cylinderUvToRenderBoundsTranslate:new h,cylinderUvToRenderRadiusMin:0,cylinderRenderAngleMinMax:new B,cylinderUvToShapeUvRadius:new B,cylinderUvToShapeUvHeight:new B,cylinderUvToShapeUvAngle:new B,cylinderShapeUvAngleMinMax:new B,cylinderShapeUvAngleRangeZeroMid:0},this.shaderDefines={CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT:void 0,CYLINDER_HAS_RENDER_BOUNDS_HEIGHT:void 0,CYLINDER_HAS_RENDER_BOUNDS_HEIGHT_FLAT:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_HALF:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF:void 0,CYLINDER_HAS_SHAPE_BOUNDS_RADIUS:void 0,CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT:void 0,CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT:void 0,CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MAX:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MIN:void 0,CYLINDER_INTERSECTION_INDEX_ANGLE:void 0},this.shaderMaximumIntersectionsLength=0}var m_e=new h,Z0t=new h,G0t=new h,E0t=new q,I0t=new A,X0t=new A,W0t=A.fromRotationTranslation(q.fromUniformScale(2,new q),new h(-1,-1,-1),new A);Qr.prototype.update=function(e,t,n,i,o){i=g(i,Qr.DefaultMinBounds),o=g(o,Qr.DefaultMaxBounds);let r=Qr.DefaultMinBounds.x,s=Qr.DefaultMaxBounds.x,a=Qr.DefaultMinBounds.y,c=Qr.DefaultMaxBounds.y,d=Qr.DefaultMinBounds.z,u=Qr.DefaultMaxBounds.z,m=u-d,p=.5*m,y=W.EPSILON10,f=W.EPSILON3,x=W.EPSILON10,_=W.clamp(t.x,r,s),C=W.clamp(n.x,r,s),V=W.clamp(i.x,r,s),L=W.clamp(o.x,r,s),Z=Math.max(_,V),G=Math.min(C,L),I=W.clamp(t.y,a,c),P=W.clamp(n.y,a,c),v=W.clamp(i.y,a,c),F=W.clamp(o.y,a,c),M=Math.max(I,v),b=Math.min(P,F),R=W.negativePiToPi(t.z),E=W.negativePiToPi(n.z),X=W.negativePiToPi(i.z),w=W.negativePiToPi(o.z),N=Math.max(R,X),D=Math.min(E,w),k=A.getScale(e,m_e);if(G===0||Z>G||M>b||W.equalsEpsilon(k.x,0,void 0,y)||W.equalsEpsilon(k.y,0,void 0,y)||W.equalsEpsilon(k.z,0,void 0,y))return!1;this._minimumRadius=_,this._maximumRadius=C,this._minimumHeight=I,this._maximumHeight=P,this._minimumAngle=R,this._maximumAngle=E,this.shapeTransform=A.clone(e,this.shapeTransform),this.orientedBoundingBox=f8(Z,G,M,b,N,D,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=A.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ce.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let J=_===r&&C===s,K=I===a&&P===c,ee=E<R,H=E-R+ee*m,j=H>p+x&&H<m-x,$=H>x&&H<p-x,pe=H>=p-x&&H<=p+x,ge=H<=x,ae=j||$||pe||ge,be=W.equalsEpsilon(R,d,void 0,f),_e=W.equalsEpsilon(E,u,void 0,f),Ze=G===s,Le=Z===r,Ee=M===a&&b===c,He=D<N,we=D-N+He*m,dt=we>p+x&&we<m-x,bt=we>x&&we<p-x,it=we>=p-x&&we<=p+x,en=we<=x,_n=dt||bt||it||en,kt=this.shaderUniforms,At=this.shaderDefines;for(let Re in At)At.hasOwnProperty(Re)&&(At[Re]=void 0);let Te=0;if(At.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=Te,Te+=1,Le||(At.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,At.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=Te,Te+=1,kt.cylinderUvToRenderRadiusMin=G/Z),Ze||(At.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX=!0),Z===G&&(At.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0),Ee||(At.CYLINDER_HAS_RENDER_BOUNDS_HEIGHT=!0),M===b&&(At.CYLINDER_HAS_RENDER_BOUNDS_HEIGHT_FLAT=!0),I===P&&(At.CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT=!0),_===C&&(At.CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT=!0),!J){At.CYLINDER_HAS_SHAPE_BOUNDS_RADIUS=!0;let Re=1/(C-_),ct=_/(_-C);kt.cylinderUvToShapeUvRadius=B.fromElements(Re,ct,kt.cylinderUvToShapeUvRadius)}if(!K){At.CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT=!0;let Re=2/(P-I),ct=(I+1)/(I-P);kt.cylinderUvToShapeUvHeight=B.fromElements(Re,ct,kt.cylinderUvToShapeUvHeight)}if(!Ze||!Ee){let Re=.5*(b-M),ct=h.fromElements(1/G,1/G,1/(Re===0?1:Re),G0t),Jt=h.fromElements(0,0,-ct.z*.5*(M+b),Z0t),mi=A.fromRotationTranslation(q.fromScale(ct,E0t),Jt,I0t),Ke=A.multiplyTransformation(mi,W0t,X0t);kt.cylinderUvToRenderBoundsScale=A.getScale(Ke,kt.cylinderUvToRenderBoundsScale),kt.cylinderUvToRenderBoundsTranslate=A.getTranslation(Ke,kt.cylinderUvToRenderBoundsTranslate)}if(ee&&(At.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED=!0),_n&&(At.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,At.CYLINDER_INTERSECTION_INDEX_ANGLE=Te,dt?(At.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,Te+=1):bt?(At.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,Te+=2):it?(At.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_HALF=!0,Te+=1):en&&(At.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,Te+=2),kt.cylinderRenderAngleMinMax=B.fromElements(N,D,kt.cylinderAngleMinMax)),ae){At.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0,ge&&(At.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0),be&&(At.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY=!0),_e&&(At.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY=!0);let Re=(R-d)/m,ct=(E-d)/m,Jt=1-H/m;kt.cylinderShapeUvAngleMinMax=B.fromElements(Re,ct,kt.cylinderShapeUvAngleMinMax),kt.cylinderShapeUvAngleRangeZeroMid=(ct+.5*Jt)%1;let mi=m/H,Ke=-(R-d)/H;kt.cylinderUvToShapeUvAngle=B.fromElements(mi,Ke,kt.cylinderUvToShapeUvAngle)}return this.shaderMaximumIntersectionsLength=Te,!0};Qr.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minimumRadius,s=this._maximumRadius,a=this._minimumHeight,c=this._maximumHeight,d=this._minimumAngle,u=this._maximumAngle,m=1/Math.pow(2,e),p=W.lerp(r,s,t*m),y=W.lerp(r,s,(t+1)*m),f=W.lerp(a,c,n*m),x=W.lerp(a,c,(n+1)*m),_=W.lerp(d,u,i*m),C=W.lerp(d,u,(i+1)*m);return f8(p,y,f,x,_,C,this.shapeTransform,o)};var P0t=new Xn,v0t=new h,w0t=new h,F0t=new h;Qr.prototype.computeApproximateStepSize=function(e){let t=this.shapeTransform,n=this._minimumRadius,i=this._maximumRadius,o=this._minimumHeight,r=this._maximumHeight,s=this._minimumAngle,a=this._maximumAngle,c=1-1/e.x,d=1-1/e.y,u=1-1/e.z,m=W.lerp(n,i,c),p=W.lerp(o,r,d),y=W.lerp(s,a,u),C=f8(m,i,p,r,y,a,t,P0t),V=q.getScale(C.halfAxes,v0t),L=A.getScale(t,w0t),Z=h.divideComponents(V,L,F0t);return h.minimumComponent(Z)};Qr.DefaultMinBounds=Object.freeze(new h(0,-1,-W.PI));Qr.DefaultMaxBounds=Object.freeze(new h(1,1,+W.PI));var A0t=5,M0t=new Array(A0t),N0t=new h,U0t=new q,k0t=new A,D0t=new A,B0t=new A,h8=new A,O0t=new h,Y0t=new h,H0t=new h,h_e=new Array(8);for(let e=0;e<8;e++)h_e[e]=new h;function u_e(e,t,n){return Math.abs(se.dot(e,t))<n}function K0t(e){let t=A.getColumn(e,0,O0t),n=A.getColumn(e,1,Y0t),i=A.getColumn(e,2,H0t),o=W.EPSILON4;return u_e(t,n,o)&&u_e(n,i,o)}function z0t(e,t){let n=h_e;h.fromElements(-.5,-.5,-.5,n[0]),h.fromElements(-.5,-.5,.5,n[1]),h.fromElements(-.5,.5,-.5,n[2]),h.fromElements(-.5,.5,.5,n[3]),h.fromElements(.5,-.5,-.5,n[4]),h.fromElements(.5,-.5,.5,n[5]),h.fromElements(.5,.5,-.5,n[6]),h.fromElements(.5,.5,.5,n[7]);for(let i=0;i<8;++i)A.multiplyByPoint(e,n[i],n[i]);return Xn.fromPoints(n,t)}function f8(e,t,n,i,o,r,s,a){let c=Qr.DefaultMinBounds,d=Qr.DefaultMaxBounds,u=c.x,m=d.x,p=c.y,y=d.y,f=c.z,x=d.z;if(e===u&&t===m&&n===p&&i===y&&o===f&&r===x)return a.center=A.getTranslation(s,a.center),a.halfAxes=A.getMatrix3(s,a.halfAxes),a;r<o&&(r+=W.TWO_PI);let C=r-o,V=o+C*.5,L=M0t,Z=0;L[Z++]=o,L[Z++]=r,L[Z++]=V,C>W.PI&&(L[Z++]=V-W.PI_OVER_TWO,L[Z++]=V+W.PI_OVER_TWO);let G=1,I=1,P=-1,v=-1;for(let ee=0;ee<Z;++ee){let H=L[ee]-V,j=Math.cos(H),$=Math.sin(H),pe=j*e,ge=$*e,ae=j*t,be=$*t;G=Math.min(G,pe),I=Math.min(I,ge),G=Math.min(G,ae),I=Math.min(I,be),P=Math.max(P,pe),v=Math.max(v,ge),P=Math.max(P,ae),v=Math.max(v,be)}let F=P-G,M=v-I,b=i-n,R=(G+P)*.5,E=(I+v)*.5,X=(n+i)*.5,w=h.fromElements(R,E,X,N0t),N=q.fromRotationZ(V,U0t),D=h.fromElements(F,M,b,m_e),k=A.fromScale(D,B0t),Y=A.fromRotation(N,D0t),U=A.fromTranslation(w,k0t),J=A.multiplyTransformation(Y,A.multiplyTransformation(U,k,h8),h8),K=A.multiplyTransformation(s,J,h8);return K0t(K)?Xn.fromTransformation(K,a):z0t(K,a)}var qf=Qr;var cOi=T(S(),1);var iOi=T(S(),1);function Kl(){this.orientedBoundingBox=new Xn,this.boundingSphere=new ce,this.boundTransform=new A,this.shapeTransform=new A,this._rectangle=new de,this._minimumHeight=Kl.DefaultMinBounds.z,this._maximumHeight=Kl.DefaultMaxBounds.z,this._ellipsoid=new oe,this._translation=new h,this._rotation=new q,this.shaderUniforms={ellipsoidRadiiUv:new h,ellipsoidInverseRadiiSquaredUv:new h,ellipsoidRenderLongitudeMinMax:new B,ellipsoidShapeUvLongitudeMinMaxMid:new h,ellipsoidUvToShapeUvLongitude:new B,ellipsoidUvToShapeUvLatitude:new B,ellipsoidRenderLatitudeCosSqrHalfMinMax:new B,ellipsoidInverseHeightDifferenceUv:0,ellipseInnerRadiiUv:new B,ellipsoidInverseInnerScaleUv:0,ellipsoidInverseOuterScaleUv:0},this.shaderDefines={ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT:void 0,ELLIPSOID_IS_SPHERE:void 0,ELLIPSOID_INTERSECTION_INDEX_LONGITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN:void 0},this.shaderMaximumIntersectionsLength=0}var J0t=new h,Q0t=new q,f_e=new h,p_e=new h,b_e=new h,y_e=new h,j0t=new de;Kl.prototype.update=function(e,t,n,i,o){i=g(i,Kl.DefaultMinBounds),o=g(o,Kl.DefaultMaxBounds);let r=Kl.DefaultMinBounds.x,s=Kl.DefaultMaxBounds.x,a=s-r,c=.5*a,d=Kl.DefaultMinBounds.y,u=Kl.DefaultMaxBounds.y,m=u-d,p=W.EPSILON10,y=W.EPSILON3,f=W.EPSILON10,x=W.EPSILON10,_=W.EPSILON3,C=W.clamp(t.x,r,s),V=W.clamp(n.x,r,s),L=W.clamp(i.x,r,s),Z=W.clamp(o.x,r,s),G=Math.max(C,L),I=Math.min(V,Z),P=W.clamp(t.y,d,u),v=W.clamp(n.y,d,u),F=W.clamp(i.y,d,u),M=W.clamp(o.y,d,u),b=Math.max(P,F),R=Math.min(v,M),E=A.getScale(e,J0t),X=E.x===E.y&&E.y===E.z,w=h.minimumComponent(E),N=Math.max(t.z,-w),D=Math.max(n.z,-w),k=Math.max(i.z,-w),Y=Math.max(o.z,-w),U=Math.max(N,k),J=Math.min(D,Y),K=h.add(E,h.fromElements(N,N,N,p_e),p_e),ee=h.add(E,h.fromElements(D,D,D,f_e),f_e),H=h.maximumComponent(ee),j=h.add(E,h.fromElements(U,U,U,y_e),y_e),$=h.add(E,h.fromElements(J,J,J,b_e),b_e);if(b>R||b===u||R===d||U>J||W.equalsEpsilon($,h.ZERO,void 0,p))return!1;this._rectangle=de.fromRadians(C,P,V,v),this._translation=A.getTranslation(e,this._translation),this._rotation=A.getRotation(e,this._rotation),this._ellipsoid=oe.fromCartesian3(E,this._ellipsoid),this._minimumHeight=N,this._maximumHeight=D;let pe=de.fromRadians(G,b,I,R,j0t);this.orientedBoundingBox=g_e(pe,U,J,this._ellipsoid,this._translation,this._rotation,this.orientedBoundingBox),this.shapeTransform=A.fromRotationTranslation(q.setScale(this._rotation,ee,Q0t),this._translation,this.shapeTransform),this.boundTransform=A.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ce.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let ge=I<G,ae=I-G+ge*a,be=ae<=f,_e=ae>c+f&&ae<a-f,Ze=ae>=c-f&&ae<=c+f,Le=ae>f&&ae<c-f,Ee=be||_e||Ze||Le,He=V<C,we=V-C+He*a,dt=we<=f,bt=we>c+f&&we<a-f,it=we>=c-f&&we<=c+f,en=we>f&&we<c-f,_n=dt||bt||it||en,kt=R<-_,At=R>=-_&&R<=+_,Te=R>+_&&R<u-x,Re=kt||At||Te,ct=b>d+x&&b<-_,Jt=b>=-_&&b<=+_,mi=b>+_,Ke=ct||Jt||mi,$r=Re||Ke,es=v-P,ga=v<-_,ms=v>=-_&&v<=+_,Fe=v>+_&&v<u-x,rt=ga||ms||Fe,qe=P>d+x&&P<-_,Ye=P>=-_&&P<=+_,ht=P>+_,fn=rt||(qe||Ye||ht),jn=!h.equals(j,h.ZERO),ki=!h.equals($,h.ZERO),Lo=jn||ki,Is=J-U,fr=!h.equals(K,h.ZERO),Ji=!h.equals(ee,h.ZERO),hs=fr||Ji,Jn=this.shaderUniforms,Un=this.shaderDefines;for(let fi in Un)Un.hasOwnProperty(fi)&&(Un[fi]=void 0);Jn.ellipsoidRadiiUv=h.divideByScalar(ee,H,Jn.ellipsoidRadiiUv),Jn.ellipsoidInverseRadiiSquaredUv=h.divideComponents(h.ONE,h.multiplyComponents(Jn.ellipsoidRadiiUv,Jn.ellipsoidRadiiUv,Jn.ellipsoidInverseRadiiSquaredUv),Jn.ellipsoidInverseRadiiSquaredUv);let un=0;if(Un.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=un,un+=1,Lo&&(Is===0&&(Un.ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT=!0),jn&&(Un.ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN=!0,Un.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=un,un+=1,Jn.ellipsoidInverseInnerScaleUv=H/(H-(D-U))),ki&&(Un.ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX=!0,Jn.ellipsoidInverseOuterScaleUv=H/(H-(D-J)))),hs){if(fr){Un.ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN=!0;let fi=(D-N)/H;Jn.ellipsoidInverseHeightDifferenceUv=1/fi,Jn.ellipseInnerRadiiUv=B.fromElements(Jn.ellipsoidRadiiUv.x*(1-fi),Jn.ellipsoidRadiiUv.z*(1-fi),Jn.ellipseInnerRadiiUv)}N===D&&(Un.ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT=!0)}if(Ee&&(Un.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,Un.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=un,_e?(Un.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,un+=1):Le?(Un.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,un+=2):Ze?(Un.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF=!0,un+=1):be&&(Un.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,un+=2),Jn.ellipsoidRenderLongitudeMinMax=B.fromElements(G,I,Jn.ellipsoidRenderLongitudeMinMax)),_n){Un.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0,V<C&&(Un.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED=!0);let Qi=a/we,fs=-(C-r)/we;Jn.ellipsoidUvToShapeUvLongitude=B.fromElements(Qi,fs,Jn.ellipsoidUvToShapeUvLongitude)}if(Ee){let fi=W.equalsEpsilon(G,r,void 0,y),Qi=W.equalsEpsilon(I,s,void 0,y);fi&&(Un.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY=!0),Qi&&(Un.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY=!0);let fs=(C-r)/a,po=(V-r)/a,Rc=(I-r)/a,jd=1-ae/a,Ql=(Rc+.5*jd)%1;Jn.ellipsoidShapeUvLongitudeMinMaxMid=h.fromElements(fs,po,Ql,Jn.ellipsoidShapeUvLongitudeMinMaxMid)}if($r){Un.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE=!0,Ke&&(Un.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,Un.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=un,ct?(Un.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,un+=1):Jt?(Un.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,un+=1):mi&&(Un.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,un+=2)),Re&&(Un.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,Un.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=un,kt?(Un.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,un+=2):At?(Un.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,un+=1):Te&&(Un.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,un+=1)),b===R&&(Un.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO=!0);let fi=Math.pow(Math.cos(W.PI_OVER_TWO-Math.abs(b)),2),Qi=Math.pow(Math.cos(W.PI_OVER_TWO-Math.abs(R)),2);Jn.ellipsoidRenderLatitudeCosSqrHalfMinMax=B.fromElements(fi,Qi,Jn.ellipsoidRenderLatitudeCosSqrHalfMinMax)}if(fn){Un.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,P===v&&(Un.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO=!0);let fi=m/es,Qi=(d-P)/es;Jn.ellipsoidUvToShapeUvLatitude=B.fromElements(fi,Qi,Jn.ellipsoidUvToShapeUvLatitude)}return X&&(Un.ELLIPSOID_IS_SPHERE=!0),this.shaderMaximumIntersectionsLength=un,!0};var q0t=new de;Kl.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=1/Math.pow(2,e),s=t*r,a=(t+1)*r,c=n*r,d=(n+1)*r,u=i*r,m=(i+1)*r,p=de.subsection(this._rectangle,s,c,a,d,q0t),y=W.lerp(this._minimumHeight,this._maximumHeight,u),f=W.lerp(this._minimumHeight,this._maximumHeight,m);return g_e(p,y,f,this._ellipsoid,this._translation,this._rotation,o)};Kl.prototype.computeApproximateStepSize=function(e){let n=this._ellipsoid.maximumRadius,i=this._minimumHeight,o=this._maximumHeight;return .5*((o-i)/(n+o))/e.z};function g_e(e,t,n,i,o,r,s){return s=Xn.fromRectangle(e,t,n,i,s),s.center=h.add(s.center,o,s.center),s.halfAxes=q.multiply(s.halfAxes,r,s.halfAxes),s}Kl.DefaultMinBounds=Object.freeze(new h(-W.PI,-W.PI_OVER_TWO,-Number.MAX_VALUE));Kl.DefaultMaxBounds=Object.freeze(new h(+W.PI,+W.PI_OVER_TWO,+Number.MAX_VALUE));var JT=Kl;var Hd={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};Hd.getMinBounds=function(e){switch(e){case Hd.BOX:return jf.DefaultMinBounds;case Hd.ELLIPSOID:return JT.DefaultMinBounds;case Hd.CYLINDER:return qf.DefaultMinBounds}};Hd.getMaxBounds=function(e){switch(e){case Hd.BOX:return jf.DefaultMaxBounds;case Hd.ELLIPSOID:return JT.DefaultMaxBounds;case Hd.CYLINDER:return qf.DefaultMaxBounds}};Hd.getShapeConstructor=function(e){switch(e){case Hd.BOX:return jf;case Hd.ELLIPSOID:return JT;case Hd.CYLINDER:return qf}};var Ui=Object.freeze(Hd);function tB(e){e=g(e,g.EMPTY_OBJECT),this.shapeTransform=void 0,this.globalTransform=void 0,this.shape=void 0,this.minBounds=void 0,this.maxBounds=void 0,this.dimensions=void 0,this.paddingBefore=void 0,this.paddingAfter=void 0,this.names=void 0,this.types=void 0,this.componentTypes=void 0,this.minimumValues=void 0,this.maximumValues=void 0,this.maximumTileCount=void 0,this._implicitTileset=void 0,this._subtreeCache=new Z9}tB.fromUrl=async function(e){let t=Xe.createIfNeeded(e),n=await t.fetchJson();ebt(n);let i=rbt(n,t);await i.load();let o=n.root,r=o.content.extensions["3DTILES_content_voxels"],s=r.class,a=ci(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,c=i.schema,d=new V_({metadataJson:a,schema:c}),u=new tB;sbt(u,d,s);let m=new R_(t,o,c),{shape:p,minBounds:y,maxBounds:f,shapeTransform:x,globalTransform:_}=tbt(o);u.shape=p,u.minBounds=y,u.maxBounds=f,u.dimensions=h.unpack(r.dimensions),u.shapeTransform=x,u.globalTransform=_,u.maximumTileCount=$0t(d);let C,V;return l(r.padding)&&(C=h.unpack(r.padding.before),V=h.unpack(r.padding.after)),u.paddingBefore=C,u.paddingAfter=V,u._implicitTileset=m,Yi.unload(i),u};function $0t(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(Kx.TILESET_TILE_COUNT)}function ebt(e){let t=e.root;if(!l(t.content))throw new me("Root must have content");if(!ci(t.content,"3DTILES_content_voxels"))throw new me("Root tile content must have 3DTILES_content_voxels extension");if(!ci(t,"3DTILES_implicit_tiling")&&!l(t.implicitTiling))throw new me("Root tile must have implicit tiling");if(!l(e.schema)&&!l(e.schemaUri)&&!ci(e,"3DTILES_metadata"))throw new me("Tileset must have a metadata schema")}function tbt(e){let t=e.boundingVolume,n;if(l(e.transform)?n=A.unpack(e.transform):n=A.clone(A.IDENTITY),l(t.box))return ibt(t.box,n);if(l(t.region))return nbt(t.region);if(ci(t,"3DTILES_bounding_volume_cylinder"))return obt(t.extensions["3DTILES_bounding_volume_cylinder"].cylinder,n);throw new me("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function nbt(e){let t=e[0],n=e[1],i=e[2],o=e[3],r=e[4],s=e[5],a=A.fromScale(oe.WGS84.radii),c=t,d=i,u=n,m=o,p=r,y=s,f=new h(c,u,p),x=new h(d,m,y);return{shape:Ui.ELLIPSOID,minBounds:f,maxBounds:x,shapeTransform:a,globalTransform:A.clone(A.IDENTITY)}}function ibt(e,t){let n=Xn.unpack(e),i=A.fromRotationTranslation(n.halfAxes,n.center);return{shape:Ui.BOX,minBounds:h.clone(jf.DefaultMinBounds),maxBounds:h.clone(jf.DefaultMaxBounds),shapeTransform:i,globalTransform:t}}function obt(e,t){let n=Xn.unpack(e),i=A.fromRotationTranslation(n.halfAxes,n.center);return{shape:Ui.CYLINDER,minBounds:h.clone(qf.DefaultMinBounds),maxBounds:h.clone(qf.DefaultMaxBounds),shapeTransform:i,globalTransform:t}}function rbt(e,t){let{schemaUri:n,schema:i}=e;return l(n)?Yi.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Yi.getSchemaLoader({schema:i})}function sbt(e,t,n){let{schema:i,statistics:o}=t,r=o?.classes[n],s=i.classes[n].properties,a=Object.entries(s).map(([m,p])=>{let{type:y,componentType:f}=p,x=r?.properties[m].min,_=r?.properties[m].max,C=Ht.getComponentCount(y),V=x_e(x,C),L=x_e(_,C);return{id:m,type:y,componentType:f,minValue:V,maxValue:L}});e.names=a.map(m=>m.id),e.types=a.map(m=>m.type),e.componentTypes=a.map(m=>m.componentType);let c=a.map(m=>m.minValue),d=a.map(m=>m.maxValue),u=c.some(l);e.minimumValues=u?c:void 0,e.maximumValues=u?d:void 0}function x_e(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,o)=>n[o])}async function abt(e,t){let n=e.contentUriTemplates[0].getDerivedResource({templateValues:t.getTemplateValues()}),i=e.baseResource.getDerivedResource({url:n.url}),o=await i.fetchArrayBuffer(),r=ff(o);return await G9.fromJson(i,r.jsonPayload,r.binaryPayload,e.metadataSchema)}async function cbt(e,t){let n=e._implicitTileset,i=e._subtreeCache,o=i.find(t);if(l(o))return o;let r=n.subtreeUriTemplate.getDerivedResource({templateValues:t.getTemplateValues()}),s=n.baseResource.getDerivedResource({url:r.url}),a=await s.fetchArrayBuffer();if(o=i.find(t),l(o))return o;let c=ff(a);return o=await Hx.fromSubtreeJson(s,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(o),o}tB.prototype.requestData=function(e){e=g(e,g.EMPTY_OBJECT);let t=g(e.tileLevel,0),n=g(e.tileX,0),i=g(e.tileY,0),o=g(e.tileZ,0);if(g(e.keyframe,0)!==0)return;let s=this._implicitTileset,a=this.names,c=new Z_({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:t,x:n,y:i,z:o}),d=c.isSubtreeRoot()&&c.level>0,u=d?c.getParentSubtreeCoordinates():c.getSubtreeCoordinates();return cbt(this,u).then(function(p){return(d?p.childSubtreeIsAvailableAtCoordinates(c):p.tileIsAvailableAtCoordinates(c))?abt(s,c):Promise.reject("Tile is not available")}).then(function(p){return a.map(function(y){return p.metadataTable.getPropertyTypedArray(y)})})};var p8=tB;var AOi=T(S(),1);function b8(e){e=g(e,1),this._radius=g(e,1)}Object.defineProperties(b8.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});b8.prototype.emit=function(e){let t=W.randomBetween(0,W.TWO_PI),n=W.randomBetween(0,this._radius),i=n*Math.cos(t),o=n*Math.sin(t),r=0;e.position=h.fromElements(i,o,r,e.position),e.velocity=h.clone(h.UNIT_Z,e.velocity)};var E9=b8;var ZYi=T(S(),1);var NOi=T(S(),1),y8={CUMULUS:0};y8.validate=function(e){return e===y8.CUMULUS};var qV=Object.freeze(y8);var HOi=T(S(),1);function Xh(e,t){if(e=g(e,g.EMPTY_OBJECT),this._show=g(e.show,!0),this._position=h.clone(g(e.position,h.ZERO)),!l(e.scale)&&l(e.maximumSize))this._maximumSize=h.clone(e.maximumSize),this._scale=new B(this._maximumSize.x,this._maximumSize.y);else{this._scale=B.clone(g(e.scale,new B(20,12)));let n=new h(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=h.clone(g(e.maximumSize,n))}this._slice=g(e.slice,-1),this._color=O.clone(g(e.color,O.WHITE)),this._brightness=g(e.brightness,1),this._cloudCollection=t,this._index=-1}var lbt=Xh.SHOW_INDEX=0,dbt=Xh.POSITION_INDEX=1,ubt=Xh.SCALE_INDEX=2,mbt=Xh.MAXIMUM_SIZE_INDEX=3,hbt=Xh.SLICE_INDEX=4,fbt=Xh.BRIGHTNESS_INDEX=5,pbt=Xh.COLOR_INDEX=6;Xh.NUMBER_OF_PROPERTIES=7;function QT(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(Xh.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,QT(this,lbt))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),QT(this,dbt))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;B.equals(t,e)||(B.clone(e,t),QT(this,ubt))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;h.equals(t,e)||(h.clone(e,t),QT(this,mbt))}},color:{get:function(){return this._color},set:function(e){let t=this._color;O.equals(t,e)||(O.clone(e,t),QT(this,pbt))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,QT(this,hbt))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,QT(this,fbt))}}});Xh.prototype._destroy=function(){this._cloudCollection=void 0};var Kd=Xh;var zd,nB=new h,bbt={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},ybt={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},gbt=Kd.SHOW_INDEX,xbt=Kd.POSITION_INDEX,_bt=Kd.SCALE_INDEX,Tbt=Kd.MAXIMUM_SIZE_INDEX,Sbt=Kd.SLICE_INDEX,Cbt=Kd.BRIGHTNESS_INDEX,Vbt=Kd.NUMBER_OF_PROPERTIES,Lbt=Kd.COLOR_INDEX;function Wh(e){e=g(e,g.EMPTY_OBJECT),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(Vbt),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=g(e.noiseDetail,16),this.noiseOffset=h.clone(g(e.noiseOffset,h.ZERO)),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:__e(t),u_noiseDetail:function(){return t.noiseDetail}},this._vaNoise=void 0,this._spNoise=void 0,this._spCreated=!1,this._sp=void 0,this._rs=void 0,this.show=g(e.show,!0),this._colorCommands=[],this.debugBillboards=g(e.debugBillboards,!1),this._compiledDebugBillboards=!1,this.debugEllipsoids=g(e.debugEllipsoids,!1),this._compiledDebugEllipsoids=!1}function __e(e){return function(){return nB.x=e._textureSliceWidth,nB.y=e._noiseTextureRows,nB.z=1/e._noiseTextureRows,nB}}Object.defineProperties(Wh.prototype,{length:{get:function(){return x8(this),this._clouds.length}}});function T_e(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Wh.prototype.add=function(e){e=g(e,g.EMPTY_OBJECT);let t=g(e.cloudType,qV.CUMULUS),n;return t===qV.CUMULUS&&(n=new Kd(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};Wh.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Wh.prototype.removeAll=function(){T_e(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function x8(e){if(e._cloudsRemoved){e._cloudsRemoved=!1;let t=[],n=e._clouds,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];l(s)&&(n._index=r++,t.push(s))}e._clouds=t}}Wh.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};Wh.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};Wh.prototype.get=function(e){return x8(this),this._clouds[e]};var Rbt=new Float32Array([-1,-1,1,-1,1,1,-1,1]),Zbt=new Uint16Array([0,1,2,0,2,3]);function Gbt(e){let t=ft.createVertexBuffer({context:e,typedArray:Rbt,usage:Ue.STATIC_DRAW}),n=ft.createIndexBuffer({context:e,typedArray:Zbt,usage:Ue.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:Q.FLOAT}];return new oi({context:e,attributes:i,indexBuffer:n})}var _8;function Ebt(e){let n=e.cache.cloudCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,o=new Uint16Array(i);for(let r=0,s=0;r<i;r+=6,s+=4)o[r]=s,o[r+1]=s+1,o[r+2]=s+2,o[r+3]=s,o[r+4]=s+2,o[r+5]=s+3;return n=ft.createIndexBuffer({context:e,typedArray:o,usage:Ue.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function Ibt(e){let t=e.cache.cloudCollection_indexBufferInstanced;return l(t)||(t=ft.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Ue.STATIC_DRAW,indexDatatype:Ne.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function Xbt(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return l(t)||(t=ft.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Ue.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function Wbt(e,t,n){let i=[{index:zd.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:Ue.STATIC_DRAW},{index:zd.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:Ue.STATIC_DRAW},{index:zd.packedAttribute0,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:Ue.STATIC_DRAW},{index:zd.packedAttribute1,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:Ue.STATIC_DRAW},{index:zd.color,componentsPerAttribute:4,componentDatatype:Q.UNSIGNED_BYTE,normalize:!0,usage:Ue.STATIC_DRAW}];n&&i.push({index:zd.direction,componentsPerAttribute:2,componentDatatype:Q.FLOAT,vertexBuffer:Xbt(e)});let o=n?t:4*t;return new $p(e,i,o,n)}var g8=new Kn;function S_e(e,t,n,i){let o,r=n[zd.positionHighAndScaleX],s=n[zd.positionLowAndScaleY],a=i.position;Kn.fromCartesian(a,g8);let c=i.scale,d=g8.high,u=g8.low;e._instanced?(o=i._index,r(o,d.x,d.y,d.z,c.x),s(o,u.x,u.y,u.z,c.y)):(o=i._index*4,r(o+0,d.x,d.y,d.z,c.x),r(o+1,d.x,d.y,d.z,c.x),r(o+2,d.x,d.y,d.z,c.x),r(o+3,d.x,d.y,d.z,c.x),s(o+0,u.x,u.y,u.z,c.y),s(o+1,u.x,u.y,u.z,c.y),s(o+2,u.x,u.y,u.z,c.y),s(o+3,u.x,u.y,u.z,c.y))}function C_e(e,t,n,i){let o,r=n[zd.packedAttribute0],s=i.show,a=i.brightness;e._instanced?(o=i._index,r(o,s,a,0,0)):(o=i._index*4,r(o+0,s,a,0,0),r(o+1,s,a,1,0),r(o+2,s,a,1,1),r(o+3,s,a,0,1))}function V_e(e,t,n,i){let o,r=n[zd.packedAttribute1],s=i.maximumSize,a=i.slice;e._instanced?(o=i._index,r(o,s.x,s.y,s.z,a)):(o=i._index*4,r(o+0,s.x,s.y,s.z,a),r(o+1,s.x,s.y,s.z,a),r(o+2,s.x,s.y,s.z,a),r(o+3,s.x,s.y,s.z,a))}function L_e(e,t,n,i){let o,r=n[zd.color],s=i.color,a=O.floatToByte(s.red),c=O.floatToByte(s.green),d=O.floatToByte(s.blue),u=O.floatToByte(s.alpha);e._instanced?(o=i._index,r(o,a,c,d,u)):(o=i._index*4,r(o+0,a,c,d,u),r(o+1,a,c,d,u),r(o+2,a,c,d,u),r(o+3,a,c,d,u))}function Pbt(e,t,n,i){S_e(e,t,n,i),C_e(e,t,n,i),V_e(e,t,n,i),L_e(e,t,n,i)}function vbt(e,t,n,i){let o=e,r=o._textureSliceWidth,s=o._noiseTextureRows,a=t.context;o._vaNoise=Gbt(a),o._spNoise=Qt.fromCache({context:a,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let c=o.noiseDetail,d=o.noiseOffset;o._noiseTexture=new wt({context:a,width:r*r/s,height:r*s,pixelDatatype:je.UNSIGNED_BYTE,pixelFormat:at.RGBA,sampler:new hn({wrapS:In.REPEAT,wrapT:In.REPEAT,minificationFilter:dn.NEAREST,magnificationFilter:Ti.NEAREST})});let u=new au({vertexArray:o._vaNoise,shaderProgram:o._spNoise,outputTexture:o._noiseTexture,uniformMap:{u_noiseTextureDimensions:__e(o),u_noiseDetail:function(){return c},u_noiseOffset:function(){return d}},persists:!1,owner:e,postExecute:function(m){o._ready=!0,o._loading=!1}});t.commandList.push(u),o._loading=!0}function wbt(e,t){let n=e,i=t.context;n._createVertexArray=!1,n._vaf=n._vaf&&n._vaf.destroy();let o=e._clouds,r=o.length;if(r>0){n._vaf=Wbt(i,r,n._instanced);let s=n._vaf.writers,a;for(a=0;a<r;++a){let c=o[a];Pbt(e,t,s,c)}n._vaf.commit(_8(i))}}var Fbt=[];function Abt(e,t){let n=t.context,i=e,r=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,c=i._propertiesChanged,d=Fbt;d.length=0,(c[xbt]||c[_bt])&&d.push(S_e),(c[gbt]||c[Cbt])&&d.push(C_e),(c[Tbt]||c[Sbt])&&d.push(V_e),c[Lbt]&&d.push(L_e);let u=d.length,m=i._vaf.writers,p,y,f;if(a/r>.1){for(p=0;p<a;++p)for(y=s[p],y._dirty=!1,f=0;f<u;++f)d[f](e,t,m,y);i._vaf.commit(_8(n))}else{for(p=0;p<a;++p){for(y=s[p],y._dirty=!1,f=0;f<u;++f)d[f](e,t,m,y);i._instanced?i._vaf.subCommit(y._index,1):i._vaf.subCommit(y._index*4,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}function Mbt(e,t,n,i){let o=t.context,r=e,s=new Oe({defines:[],sources:[n]});r._instanced&&s.defines.push("INSTANCED");let a=new Oe({defines:[],sources:[i]});r.debugBillboards&&a.defines.push("DEBUG_BILLBOARDS"),r.debugEllipsoids&&a.defines.push("DEBUG_ELLIPSOIDS"),r._sp=Qt.replaceCache({context:o,shaderProgram:r._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:zd}),r._rs=ke.fromCache({depthTest:{enabled:!0,func:ne.LESS},depthMask:!1,blending:mn.ALPHA_BLEND}),r._spCreated=!0,r._compiledDebugBillboards=r.debugBillboards,r._compiledDebugEllipsoids=r.debugEllipsoids}function Nbt(e,t){let n=e,i=t.passes,o=n._uniforms,r=t.commandList;if(i.render){let s=n._colorCommands,a=n._vaf.va,c=a.length;s.length=c;for(let d=0;d<c;d++){let u=s[d];l(u)||(u=s[d]=new nt),u.pass=Ve.TRANSLUCENT,u.owner=e,u.uniformMap=o,u.count=a[d].indicesCount,u.vertexArray=a[d].va,u.shaderProgram=n._sp,u.renderState=n._rs,n._instanced&&(u.count=6,u.instanceCount=n._clouds.length),r.push(u)}}}Wh.prototype.update=function(e){if(x8(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&vbt(this,e,Xv,Iv),this._instanced=e.context.instancedArrays,zd=this._instanced?ybt:bbt,_8=this._instanced?Ibt:Ebt;let i=this._clouds.length,o=this._cloudsToUpdate,r=this._cloudsToUpdateIndex;this._createVertexArray?wbt(this,e):r>0&&Abt(this,e),r>i*1.5&&(o.length=i),!(!l(this._vaf)||!l(this._vaf.va)||!this._ready&!t)&&((!this._spCreated||this.debugBillboards!==this._compiledDebugBillboards||this.debugEllipsoids!==this._compiledDebugEllipsoids)&&Mbt(this,e,Ev,Gv),Nbt(this,e))};Wh.prototype.isDestroyed=function(){return!1};Wh.prototype.destroy=function(){return this._noiseTexture=this._noiseTexture&&this._noiseTexture.destroy(),this._sp=this._sp&&this._sp.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),T_e(this._clouds),ue(this)};var T8=Wh;var PYi=T(S(),1);async function S8(e,t){let n=t.terrainProvider,i=t.mapProjection,o=i.ellipsoid,r,s=t.camera.getRectangleCameraCoordinates(e);if(t.mode===ie.SCENE3D?r=o.cartesianToCartographic(s):r=i.unproject(s),!l(n))return r;let a=n.availability;if(!l(a)||t.mode===ie.SCENE2D)return r;let c=[de.center(e),de.southeast(e),de.southwest(e),de.northeast(e),de.northwest(e)],d=await S8._sampleTerrainMostDetailed(n,c),u=!1,m=d.reduce(function(y,f){return l(f.height)?(u=!0,Math.max(f.height,y)):y},-Number.MAX_VALUE),p=r;return u&&(p.height+=m),p}S8._sampleTerrainMostDetailed=YT;var jT=S8;var MYi=T(S(),1);var Ubt=W.toRadians(30);function C8(e){this._angle=g(e,Ubt)}Object.defineProperties(C8.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});C8.prototype.emit=function(e){let t=Math.tan(this._angle),n=W.randomBetween(0,W.TWO_PI),i=W.randomBetween(0,t),o=i*Math.cos(n),r=i*Math.sin(n),s=1;e.velocity=h.fromElements(o,r,s,e.velocity),h.normalize(e.velocity,e.velocity),e.position=h.clone(h.ZERO,e.position)};var V8=C8;var eHi=T(S(),1);var kbt=new O,Dbt=new O,Bbt=new O,Obt=new O,R_e=new se,I9=new Uint8Array(4);function Z_e(e,t,n,i){let o=t.height===n.height?0:(e-t.height)/(n.height-t.height);return O.lerp(t.color,n.color,o,i)}function iB(e,t){return{height:e,color:O.clone(t)}}function G_e(e){return e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,s=o?t.height===i[n-1].height:!0,a=r?t.height===i[n+1].height:!0;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,s=o?O.equals(t.color,i[n-1].color):!1,a=r?O.equals(t.color,i[n+1].color):!1;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=o?O.equals(t.color,i[n-1].color):!1,s=o?t.height===i[n-1].height:!0;return!r||!s}),e}function Ybt(e){let t,n,i=[],o=e.length;for(t=0;t<o;t++){let r=e[t],s=r.entries,a=s.length,c=[];for(n=0;n<a;n++){let y=s[n],f=W.clamp(y.height,zl._minimumHeight,zl._maximumHeight),x=O.clone(y.color,kbt);x.red*=x.alpha,x.green*=x.alpha,x.blue*=x.alpha,c.push(iB(f,x))}let d=!0,u=!0;for(n=0;n<a-1;n++){let y=c[n+0],f=c[n+1];d=d&&y.height<=f.height,u=u&&y.height>=f.height}u?c=c.reverse():d||j0(c,function(y,f){return W.sign(y.height-f.height)});let m=g(r.extendDownwards,!1),p=g(r.extendUpwards,!1);c.length===1&&!m&&!p&&(m=!0,p=!0),m&&c.splice(0,0,iB(zl._minimumHeight,c[0].color)),p&&c.splice(c.length,0,iB(zl._maximumHeight,c[c.length-1].color)),c=G_e(c),i.push(c)}return i}function Hbt(e){let t=Ybt(e),n=[],i=[],o;function r(d,u){n.push(iB(d,u))}function s(d,u,m){let p=O.multiplyByScalar(m,1-u.alpha,Obt);p=O.add(p,u,p),r(d,p)}let a=t.length;for(o=0;o<a;o++){let d=t[o],u=0,m=0;i=n,n=[];let p=d.length,y=i.length;for(;u<p||m<y;){let f=u<p?d[u]:void 0,x=u>0?d[u-1]:void 0,_=u<p-1?d[u+1]:void 0,C=m<y?i[m]:void 0,V=m>0?i[m-1]:void 0,L=m<y-1?i[m+1]:void 0;if(l(f)&&l(C)&&f.height===C.height){let Z=l(L)&&C.height===L.height,G=!l(V),I=!l(L),P=l(_)&&f.height===_.height,v=!l(x),F=!l(_);Z?P?(s(f.height,f.color,C.color),s(f.height,_.color,L.color)):v?(r(f.height,C.color),s(f.height,f.color,L.color)):F?(s(f.height,f.color,C.color),r(f.height,L.color)):(s(f.height,f.color,C.color),s(f.height,f.color,L.color)):G?P?(r(f.height,f.color),s(f.height,_.color,C.color)):F?(r(f.height,f.color),r(f.height,C.color)):(v||r(f.height,f.color),s(f.height,f.color,C.color)):I?P?(s(f.height,f.color,C.color),r(f.height,_.color)):v?(r(f.height,C.color),r(f.height,f.color)):F?s(f.height,f.color,C.color):(s(f.height,f.color,C.color),r(f.height,f.color)):P?(s(f.height,f.color,C.color),s(f.height,_.color,C.color)):v?(r(f.height,C.color),s(f.height,f.color,C.color)):F?(s(f.height,f.color,C.color),r(f.height,C.color)):s(f.height,f.color,C.color),u+=P?2:1,m+=Z?2:1}else if(l(f)&&l(C)&&l(V)&&f.height<C.height){let Z=Z_e(f.height,V,C,Bbt);l(x)?l(_)?s(f.height,f.color,Z):(s(f.height,f.color,Z),r(f.height,Z)):(r(f.height,Z),s(f.height,f.color,Z)),u++}else if(l(C)&&l(f)&&l(x)&&C.height<f.height){let Z=Z_e(C.height,x,f,Dbt);l(V)?l(L)?s(C.height,Z,C.color):(s(C.height,Z,C.color),r(C.height,Z)):(r(C.height,Z),s(C.height,Z,C.color)),m++}else l(f)&&(!l(C)||f.height<C.height)?(l(C)&&!l(V)&&!l(_)?(r(f.height,f.color),r(f.height,zl._emptyColor),r(C.height,zl._emptyColor)):(!l(C)&&l(V)&&!l(x)&&(r(V.height,zl._emptyColor),r(f.height,zl._emptyColor)),r(f.height,f.color)),u++):l(C)&&(!l(f)||C.height<f.height)&&(r(C.height,C.color),m++)}}return G_e(n)}function zl(e){let{scene:t,layers:n}=g(e,g.EMPTY_OBJECT),{context:i}=t,o=Hbt(n),r=o.length,s,a,c;if(!zl._useFloatTexture(i)){a=je.UNSIGNED_BYTE,c=at.RGBA,s=new Uint8Array(r*4);for(let y=0;y<r;y++)se.packFloat(o[y].height,R_e),se.pack(R_e,s,y*4)}else{a=je.FLOAT,c=i.webgl2?at.RED:at.LUMINANCE,s=new Float32Array(r);for(let y=0;y<r;y++)s[y]=o[y].height}let u=wt.create({context:i,pixelFormat:c,pixelDatatype:a,source:{arrayBufferView:s,width:r,height:1},sampler:new hn({wrapS:In.CLAMP_TO_EDGE,wrapT:In.CLAMP_TO_EDGE,minificationFilter:dn.NEAREST,magnificationFilter:Ti.NEAREST})}),m=new Uint8Array(r*4);for(let y=0;y<r;y++)o[y].color.toBytes(I9),m[y*4+0]=I9[0],m[y*4+1]=I9[1],m[y*4+2]=I9[2],m[y*4+3]=I9[3];let p=wt.create({context:i,pixelFormat:at.RGBA,pixelDatatype:je.UNSIGNED_BYTE,source:{arrayBufferView:m,width:r,height:1},sampler:new hn({wrapS:In.CLAMP_TO_EDGE,wrapT:In.CLAMP_TO_EDGE,minificationFilter:dn.LINEAR,magnificationFilter:Ti.LINEAR})});return Bi.fromType("ElevationBand",{heights:u,colors:p})}zl._useFloatTexture=function(e){return e.floatingPointTexture};zl._maximumHeight=5906376425472;zl._minimumHeight=-5906376425472;zl._emptyColor=new O(0,0,0,0);var L8=zl;var cHi=T(S(),1);async function Kbt(e,t){if(t=g(t,{}),t.cacheBytes=g(t.cacheBytes,1536*1024*1024),t.maximumCacheOverflowBytes=g(t.maximumCacheOverflowBytes,1024*1024*1024),e=g(e,OT.defaultApiKey),!l(e))return zbt(t);let n,i=OT.getDefaultCredit();l(i)&&(n=[i]);let o=new Xe({url:`${OT.mapTilesApiEndpoint}3dtiles/root.json`,queryParameters:{key:e},credits:n});return oa.fromUrl(o,t)}var E_e={};async function zbt(e){let i=E_e[2275207];l(i)||(i=sd.fromAssetId(2275207),E_e[2275207]=i);let o=await i;return oa.fromUrl(o,e)}var R8=Kbt;var pHi=T(S(),1);async function Jbt(e){let t=await oa.fromIonAssetId(96188,e);e=g(e,g.EMPTY_OBJECT);let n=e.style;if(!l(n)){let i=g(e.defaultColor,O.WHITE).toCssColorString();n=new zT({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var Z8=Jbt;var LHi=T(S(),1);function Qbt(e){e=g(e,g.EMPTY_OBJECT);let t=[],n=e.geometry;(!l(n.attributes)||!l(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,o=A.clone(g(e.modelMatrix,A.IDENTITY)),r=g(e.length,1e4);if(l(i.normal)&&t.push(new St({geometry:Mn.createLineSegmentsForVectors(n,"normal",r),attributes:{color:new Ot(1,0,0,1)},modelMatrix:o})),l(i.tangent)&&t.push(new St({geometry:Mn.createLineSegmentsForVectors(n,"tangent",r),attributes:{color:new Ot(0,1,0,1)},modelMatrix:o})),l(i.bitangent)&&t.push(new St({geometry:Mn.createLineSegmentsForVectors(n,"bitangent",r),attributes:{color:new Ot(0,0,1,1)},modelMatrix:o})),t.length>0)return new En({asynchronous:!1,geometryInstances:t,appearance:new cn({flat:!0,translucent:!1})})}var G8=Qbt;var IHi=T(S(),1);function X9(e){e=g(e,g.EMPTY_OBJECT);let t=e.attributeName,n=e.perInstanceAttribute;l(n)||(n=!1);let i=g(e.glslDatatype,"vec3"),o=`v_${t}`,r;if(t==="normal"||t==="tangent"||t==="bitangent")r=`vec4 getColor() { return vec4((${o} + vec3(1.0)) * 0.5, 1.0); }
`;else switch(t==="st"&&(i="vec2"),i){case"float":r=`vec4 getColor() { return vec4(vec3(${o}), 1.0); }
`;break;case"vec2":r=`vec4 getColor() { return vec4(${o}, 0.0, 1.0); }
`;break;case"vec3":r=`vec4 getColor() { return vec4(${o}, 1.0); }
`;break;case"vec4":r=`vec4 getColor() { return ${o}; }
`;break}let s=`in vec3 position3DHigh;
in vec3 position3DLow;
in float batchId;
${n?"":`in ${i} ${t};
`}out ${i} ${o};
void main()
{
vec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow);
${n?`${o} = czm_batchTable_${t}(batchId);
`:`${o} = ${t};
`}gl_Position = czm_modelViewProjectionRelativeToEye * p;
}`,a=`in ${i} ${o};
${r}
void main()
{
out_FragColor = getColor();
}`;this.material=void 0,this.translucent=g(e.translucent,!1),this._vertexShaderSource=g(e.vertexShaderSource,s),this._fragmentShaderSource=g(e.fragmentShaderSource,a),this._renderState=ro.getDefaultRenderState(!1,!1,e.renderState),this._closed=g(e.closed,!1),this._attributeName=t,this._glslDatatype=i}Object.defineProperties(X9.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}}});X9.prototype.getFragmentShaderSource=ro.prototype.getFragmentShaderSource;X9.prototype.isTranslucent=ro.prototype.isTranslucent;X9.prototype.getRenderState=ro.prototype.getRenderState;var E8=X9;var BHi=T(S(),1);function oB(e){e=g(e,g.EMPTY_OBJECT),this.length=g(e.length,1e7),this._length=void 0,this.width=g(e.width,2),this._width=void 0,this.show=g(e.show,!0),this.modelMatrix=A.clone(g(e.modelMatrix,A.IDENTITY)),this._modelMatrix=new A,this.id=e.id,this._id=void 0,this._primitive=void 0}oB.prototype.update=function(e){if(this.show){if(!l(this._primitive)||!A.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=A.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,l(this._primitive)&&this._primitive.destroy(),this.modelMatrix[12]===0&&this.modelMatrix[13]===0&&this.modelMatrix[14]===0&&(this.modelMatrix[14]=.01);let t=new St({geometry:new v0({positions:[h.ZERO,h.UNIT_X],width:this.width,vertexFormat:Br.VERTEX_FORMAT,colors:[O.RED,O.RED],arcType:jt.NONE}),modelMatrix:A.multiplyByUniformScale(this.modelMatrix,this.length,new A),id:this.id,pickPrimitive:this}),n=new St({geometry:new v0({positions:[h.ZERO,h.UNIT_Y],width:this.width,vertexFormat:Br.VERTEX_FORMAT,colors:[O.GREEN,O.GREEN],arcType:jt.NONE}),modelMatrix:A.multiplyByUniformScale(this.modelMatrix,this.length,new A),id:this.id,pickPrimitive:this}),i=new St({geometry:new v0({positions:[h.ZERO,h.UNIT_Z],width:this.width,vertexFormat:Br.VERTEX_FORMAT,colors:[O.BLUE,O.BLUE],arcType:jt.NONE}),modelMatrix:A.multiplyByUniformScale(this.modelMatrix,this.length,new A),id:this.id,pickPrimitive:this});this._primitive=new En({geometryInstances:[t,n,i],appearance:new Br,asynchronous:!1})}this._primitive.update(e)}};oB.prototype.isDestroyed=function(){return!1};oB.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var W9=oB;var zHi=T(S(),1);function jbt(e){this.direction=h.clone(e.direction),this.color=O.clone(g(e.color,O.WHITE)),this.intensity=g(e.intensity,1)}var I8=jbt;var aKi=T(S(),1);var QHi=T(S(),1),P9=`in vec3 v_positionMC;
in vec3 v_positionEC;
in vec2 v_st;
void main()
{
czm_materialInput materialInput;
vec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));
#ifdef FACE_FORWARD
normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
#endif
materialInput.s = v_st.s;
materialInput.st = v_st;
materialInput.str = vec3(v_st, 0.0);
// Convert tangent space material normal to eye space
materialInput.normalEC = normalEC;
materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);
// Convert view vector to world space
vec3 positionToEyeEC = -v_positionEC;
materialInput.positionToEyeEC = positionToEyeEC;
czm_material material = czm_getMaterial(materialInput);
#ifdef FLAT
out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#else
out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
#endif
}
`;var qHi=T(S(),1),v9=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec2 st;
in float batchId;
out vec3 v_positionMC;
out vec3 v_positionEC;
out vec2 v_st;
void main()
{
vec4 p = czm_computePosition();
v_positionMC = position3DHigh + position3DLow; // position in model coordinates
v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates
v_st = st;
gl_Position = czm_modelViewProjectionRelativeToEye * p;
}
`;function qT(e){e=g(e,g.EMPTY_OBJECT);let t=g(e.translucent,!0),n=g(e.aboveGround,!1);this.material=l(e.material)?e.material:Bi.fromType(Bi.ColorType),this.translucent=g(e.translucent,!0),this._vertexShaderSource=g(e.vertexShaderSource,v9),this._fragmentShaderSource=g(e.fragmentShaderSource,P9),this._renderState=ro.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=g(e.flat,!1),this._faceForward=g(e.faceForward,n),this._aboveGround=n}Object.defineProperties(qT.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 qT.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});qT.VERTEX_FORMAT=Pe.POSITION_AND_ST;qT.prototype.getFragmentShaderSource=ro.prototype.getFragmentShaderSource;qT.prototype.isTranslucent=ro.prototype.isTranslucent;qT.prototype.getRenderState=ro.prototype.getRenderState;var X8=qT;var pKi=T(S(),1);function Jl(e){this._scene=e.scene,this.samplingWindow=g(e.samplingWindow,Jl.defaultSettings.samplingWindow),this.quietPeriod=g(e.quietPeriod,Jl.defaultSettings.quietPeriod),this.warmupPeriod=g(e.warmupPeriod,Jl.defaultSettings.warmupPeriod),this.minimumFrameRateDuringWarmup=g(e.minimumFrameRateDuringWarmup,Jl.defaultSettings.minimumFrameRateDuringWarmup),this.minimumFrameRateAfterWarmup=g(e.minimumFrameRateAfterWarmup,Jl.defaultSettings.minimumFrameRateAfterWarmup),this._lowFrameRate=new ye,this._nominalFrameRate=new ye,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;let t=this;this._preUpdateRemoveListener=this._scene.preUpdate.addEventListener(function(o,r){qbt(t,r)}),this._hiddenPropertyName=document.hidden!==void 0?"hidden":document.mozHidden!==void 0?"mozHidden":document.msHidden!==void 0?"msHidden":document.webkitHidden!==void 0?"webkitHidden":void 0;let n=document.hidden!==void 0?"visibilitychange":document.mozHidden!==void 0?"mozvisibilitychange":document.msHidden!==void 0?"msvisibilitychange":document.webkitHidden!==void 0?"webkitvisibilitychange":void 0;function i(){$bt(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}Jl.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};Jl.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new Jl({scene:e})),e._frameRateMonitor};Object.defineProperties(Jl.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}}});Jl.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};Jl.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};Jl.prototype.isDestroyed=function(){return!1};Jl.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),ue(this)};function qbt(e,t){if(e._pauseCount>0)return;let n=xi();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/qn.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/qn.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/qn.SECONDS_PER_MILLISECOND;if(e._frameTimes.length>=2&&e._frameTimes[0]<=i){for(;e._frameTimes.length>=2&&e._frameTimes[1]<i;)e._frameTimes.shift();let o=(n-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/o;let r=1e3/(n>e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);o>r?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 $bt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var w9=Jl;var yKi=T(S(),1);function eyt(e,t,n){return` float clipDistance = clip(gl_FragCoord, ${e}, ${t});
vec4 clippingPlanesEdgeColor = vec4(1.0);
clippingPlanesEdgeColor.rgb = ${n}.rgb;
float clippingPlanesEdgeWidth = ${n}.a;
if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth)
{
out_FragColor = clippingPlanesEdgeColor;
}
`}var F9=eyt;var XKi=T(S(),1);var I_e=T(wj(),1);function W8(){this._image=new Image}W8.prototype.isReady=function(){return!0};W8.prototype.shouldDiscardImage=function(e){return e===this._image};function $T(e){e=g(e,g.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=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._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=new Oi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new de(-W.PI,-W.PI,W.PI,W.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new Vt(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new W8),this._errorEvent=new ye}Object.defineProperties($T.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}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}});$T.fromMetadata=function(e,t){if(!e.imageryPresent)throw new me(`The server ${e.url} doesn't have imagery`);let n=new $T(t);return n._metadata=e,n};$T.prototype.getTileCredits=function(e,t,n){let i=this._metadata,o=i.getTileInformation(e,t,n);if(l(o)){let r=i.providers[o.imageryProvider];if(l(r))return[r]}};$T.prototype.requestImage=function(e,t,n,i){let o=this._tileDiscardPolicy._image,r=this._metadata,s=cb.tileXYToQuadKey(e,t,n),a=r.getTileInformation(e,t,n);if(!l(a)){if(r.isValid(s)){let d=new Yo({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});r.populateSubtree(e,t,n,d);return}return Promise.resolve(o)}if(!a.hasImagery())return Promise.resolve(o);let c=tyt(this,a,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(d){$F(r.key,d);let u=new Uint8Array(d),m,p=r.protoImagery;if((!l(p)||!p)&&(m=nyt(u)),!l(m)&&(!l(p)||p)){let y=iyt(u);m=y.imageType,u=y.imageData}return!l(m)||!l(u)?o:Nx({uint8Array:u,format:m,flipY:!0})})};$T.prototype.pickFeatures=function(e,t,n,i,o){};function tyt(e,t,n,i,o,r){let s=cb.tileXYToQuadKey(n,i,o),a=t.imageryVersion;return a=l(a)&&a>0?a:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1-0${s}-i.${a.toString()}`,request:r})}function nyt(e){let 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";let n="PNG";if(e[1]===n.charCodeAt(0)&&e[2]===n.charCodeAt(1)&&e[3]===n.charCodeAt(2))return"image/png"}function iyt(e){let t=I_e.Reader.create(e),n=t.len,i={};for(;t.pos<n;){let s=t.uint32(),a;switch(s>>>3){case 1:i.imageType=t.uint32();break;case 2:i.imageData=t.bytes();break;case 3:i.alphaType=t.uint32();break;case 4:i.imageAlpha=t.bytes();break;case 5:if(a=i.copyrightIds,l(a)||(a=i.copyrightIds=[]),(s&7)===2){let c=t.uint32()+t.pos;for(;t.pos<c;)a.push(t.uint32())}else a.push(t.uint32());break;default:t.skipType(s&7);break}}let o=i.imageType;if(l(o))switch(o){case 0:i.imageType="image/jpeg";break;case 4:i.imageType="image/png";break;default:throw new me("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}let r=i.alphaType;return l(r)&&r!==0&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete i.alphaType,delete i.imageAlpha),i}var P8=$T;var MKi=T(S(),1);var oyt=new O(1,1,1,.4),ryt=new O(0,1,0,.05),syt=new O(0,.5,0,.2);function eS(e){e=g(e,g.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=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._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Oi({ellipsoid:e.ellipsoid}),this._cells=g(e.cells,8),this._color=g(e.color,oyt),this._glowColor=g(e.glowColor,ryt),this._glowWidth=g(e.glowWidth,6),this._backgroundColor=g(e.backgroundColor,syt),this._errorEvent=new ye,this._tileWidth=g(e.tileWidth,256),this._tileHeight=g(e.tileHeight,256),this._canvasSize=g(e.canvasSize,256),this._canvas=this._createGridCanvas()}Object.defineProperties(eS.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}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});eS.prototype._drawGrid=function(e){let n=this._canvasSize;for(let i=0;i<=this._cells;++i){let r=1+i/this._cells*(n-1);e.moveTo(r,0),e.lineTo(r,n),e.moveTo(0,r),e.lineTo(n,r)}e.stroke()};eS.prototype._createGridCanvas=function(){let e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;let t=0,n=this._canvasSize,i=e.getContext("2d"),o=this._backgroundColor.toCssColorString();i.fillStyle=o,i.fillRect(t,t,n,n);let r=this._glowColor.toCssColorString();i.strokeStyle=r,i.lineWidth=this._glowWidth,i.strokeRect(t,t,n,n),this._drawGrid(i),i.lineWidth=this._glowWidth*.5,i.strokeRect(t,t,n,n),this._drawGrid(i);let s=this._color.toCssColorString();return i.strokeStyle=s,i.lineWidth=2,i.strokeRect(t,t,n,n),i.lineWidth=1,this._drawGrid(i),e};eS.prototype.getTileCredits=function(e,t,n){};eS.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};eS.prototype.pickFeatures=function(e,t,n,i,o){};var v8=eS;var Kzi=T(S(),1);var Wzi=T(S(),1);var Vzi=T(S(),1);var zKi=T(S(),1);function Ph(){}Ph._maxDecodingConcurrency=Math.max(Bt.hardwareConcurrency-1,1);Ph._decodeTaskProcessor=new gi("decodeI3S",Ph._maxDecodingConcurrency);Ph._promise=void 0;async function ayt(){if(await Ph._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return Ph._decodeTaskProcessor;throw new me("I3S decoder could not be initialized.")}Ph.decode=async function(e,t,n,i){return l(Ph._promise)||(Ph._promise=ayt()),Ph._promise.then(function(o){let r=n._parent._data,s=n._parent._inverseRotationMatrix,a=0,c=0,d=0;l(r.obb)?(a=r.obb.center[0],c=r.obb.center[1],d=r.obb.center[2]):l(r.mbs)&&(a=r.mbs[0],c=r.mbs[1],d=r.mbs[2]);let u=q.fromRotationX(-W.PI_OVER_TWO),m=new q;q.multiply(u,s,m);let p=he.fromDegrees(a,c,d),y=oe.WGS84.cartographicToCartesian(p),f={binaryData:n._data,featureData:l(i)&&l(i[0])?i[0].data:void 0,schema:t,bufferInfo:n._geometryBufferInfo,ellipsoidRadiiSquare:oe.WGS84.radiiSquared,url:e,geoidDataList:n._dataProvider._geoidDataList,cartographicCenter:p,cartesianCenter:y,parentRotation:m};return o.scheduleTask(f)})};var A9=Ph;var qKi=T(S(),1);function w8(e,t){this._parent=e,this._dataProvider=e._dataProvider,this._layer=e._layer,l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${t}`}):this._resource=this._parent.resource.getDerivedResource({url:t})}Object.defineProperties(w8.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});w8.prototype.load=async function(){return this._data=await tS.loadJson(this._resource,this._dataProvider._traceFetches),this._data};var M9=w8;var tzi=T(S(),1);function $V(e,t){this._storageInfo=t,this._parent=e,this._dataProvider=e._dataProvider;let n=`attributes/${t.key}/0`;l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${n}`}):this._resource=this._parent.resource.getDerivedResource({url:n})}Object.defineProperties($V.prototype,{resource:{get:function(){return this._resource}},header:{get:function(){return this._header}},values:{get:function(){return l(this._values)&&l(this._values.attributeValues)?this._values.attributeValues:[]}},name:{get:function(){return this._storageInfo.name}}});function cyt(e){return e==="UInt8"||e==="Int8"?1:e==="UInt16"||e==="Int16"?2:e==="UInt32"||e==="Int32"||e==="Oid32"||e==="Float32"?4:e==="UInt64"||e==="Int64"||e==="Float64"?8:0}$V.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){let n=new DataView(t),i=!0;if(n.getUint8(0)===123&&new TextDecoder().decode(t).includes("404")&&(i=!1,console.error(`Failed to load: ${e.resource.url}`)),i){e._data=t;let o=e._parseHeader(n),r=cyt(e._storageInfo.attributeValues.valueType);r>0&&(o=Math.ceil(o/r)*r),e._parseBody(n,o)}})};$V.prototype._parseValue=function(e,t,n){let i;if(t==="UInt8")i=e.getUint8(n),n+=1;else if(t==="Int8")i=e.getInt8(n),n+=1;else if(t==="UInt16")i=e.getUint16(n,!0),n+=2;else if(t==="Int16")i=e.getInt16(n,!0),n+=2;else if(t==="UInt32")i=e.getUint32(n,!0),n+=4;else if(t==="Oid32")i=e.getUint32(n,!0),n+=4;else if(t==="Int32")i=e.getInt32(n,!0),n+=4;else if(t==="UInt64"){let o=e.getUint32(n,!0),r=e.getUint32(n+4,!0);i=o+Math.pow(2,32)*r,n+=8}else if(t==="Int64"){let o=e.getUint32(n,!0),r=e.getUint32(n+4,!0);r<Math.pow(2,31)?i=o+Math.pow(2,32)*r:i=o+Math.pow(2,32)*(r-Math.pow(2,32)),n+=8}else t==="Float32"?(i=e.getFloat32(n,!0),n+=4):t==="Float64"?(i=e.getFloat64(n,!0),n+=8):t==="String"&&(i=String.fromCharCode(e.getUint8(n)),n+=1);return{value:i,offset:n}};$V.prototype._parseHeader=function(e){let t=0;this._header={};for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n],o=this._parseValue(e,i.valueType,t);this._header[i.property]=o.value,t=o.offset}return t};$V.prototype._parseBody=function(e,t){this._values={};for(let n=0;n<this._storageInfo.ordering.length;n++){let i=this._storageInfo.ordering[n],o=this._storageInfo[i];if(l(o)){this._values[i]=[];for(let r=0;r<this._header.count;++r)if(o.valueType!=="String"){let s=this._parseValue(e,o.valueType,t);this._values[i].push(s.value),t=s.offset}else{let s=this._values.attributeByteCounts[r],a="";for(let c=0;c<s;++c){let d=this._parseValue(e,o.valueType,t);d.value.charCodeAt(0)!==0&&(a+=d.value),t=d.offset}this._values[i].push(a)}}}};var N9=$V;var szi=T(S(),1);function U9(e,t){let n=e._dataProvider,i=e._layer,o;l(e._nodeIndex)?o=i.resource.getDerivedResource({url:`nodes/${e._data.mesh.geometry.resource}/${t}`}):o=e.resource.getDerivedResource({url:t}),this._parent=e,this._dataProvider=n,this._layer=i,this._resource=o,this._customAttributes=void 0}Object.defineProperties(U9.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});U9.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var lyt=new h,dyt=new h,uyt=new h,myt=new h,hyt=new h;function F8(e,t,n,i){let o=h.subtract(i,n,lyt),r=h.cross(o,h.subtract(e,n,dyt),myt),s=h.cross(o,h.subtract(t,n,uyt),hyt);return h.dot(r,s)>=0}var fyt=new h,pyt=new h,byt=new h,yyt=new h,gyt=new h,xyt=new h,_yt=new h,Tyt=new h,Syt=new h,Cyt=new h;U9.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(l(this._customAttributes)&&l(this._customAttributes.positions)){let i=new h(e,t,n);i.x-=this._customAttributes.cartesianCenter.x,i.y-=this._customAttributes.cartesianCenter.y,i.z-=this._customAttributes.cartesianCenter.z,q.multiplyByVector(this._customAttributes.parentRotation,i,i);let o=Number.MAX_VALUE,r,s,a,c,d=this._customAttributes.positions,u=this._customAttributes.indices,m;l(u)?m=u.length:m=d.length/3;for(let p=0;p<m;p++){let y,f,x;l(u)?(y=u[p],f=u[p+1],x=u[p+2]):(y=p*3,f=p*3+1,x=p*3+2);let _=h.fromElements(d[y*3],d[y*3+1],d[y*3+2],fyt),C=h.fromElements(d[f*3],d[f*3+1],d[f*3+2],pyt),V=new h(d[x*3],d[x*3+1],d[x*3+2],byt);if(!F8(i,_,C,V)||!F8(i,C,_,V)||!F8(i,V,_,C))continue;let L=h.subtract(C,_,yyt),Z=h.subtract(V,_,gyt),G=h.cross(L,Z,xyt);if(h.magnitude(G)===0)continue;let I=h.normalize(G,_yt),P=h.subtract(i,_,Tyt),v=Math.abs(h.dot(P,I));if(v<o){o=v,r=p;let F=h.magnitudeSquared(h.subtract(i,_,P)),M=h.magnitudeSquared(h.subtract(i,C,Syt)),b=h.magnitudeSquared(h.subtract(i,V,Cyt));F<M&&F<b?(a=y,c=_,s=F):M<b?(a=f,c=C,s=M):(a=x,c=V,s=b)}}if(l(r))return{index:a,distanceSquared:s,distance:Math.sqrt(s),queriedPosition:i,closestPosition:h.clone(c)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};U9.prototype._generateGltf=function(e,t,n,i,o,r){let s={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},a=!1,c,d="";if(l(this._parent._data.mesh)&&l(this._layer._data.materialDefinitions)){let x=this._parent._data.mesh.material.definition;if(x>=0&&x<this._layer._data.materialDefinitions.length&&(c=this._layer._data.materialDefinitions[x],s=c,l(s.pbrMetallicRoughness)&&l(s.pbrMetallicRoughness.baseColorTexture))){a=!0,s.pbrMetallicRoughness.baseColorTexture.index=0;let _="0";if(l(this._layer._data.textureSetDefinitions))for(let C=0;C<this._layer._data.textureSetDefinitions.length;C++){let V=this._layer._data.textureSetDefinitions[C];for(let L=0;L<V.formats.length;L++){let Z=V.formats[L];if(Z.format==="jpg"){_=Z.name;break}}}l(this._parent._data.mesh)&&this._parent._data.mesh.material.resource>=0&&(d=this._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.material.resource}/textures/${_}`}).url)}}else l(this._parent._data.textureData)&&(a=!0,d=this._parent.resource.getDerivedResource({url:`${this._parent._data.textureData[0].href}`}).url,s.pbrMetallicRoughness.baseColorTexture={index:0});let u=[],m=[],p=[];return a&&(u=[{sampler:0,source:0}],m=[{uri:d}],p=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]),{scene:0,scenes:[{nodes:e}],nodes:t,meshes:n,buffers:i,bufferViews:o,accessors:r,materials:[s],textures:u,images:m,samplers:p,asset:{version:"2.0"}}};var eL=U9;function Jd(e,t,n){let i,o,r,s;n?(i=0,o=e):(i=e._level+1,o=e._layer),typeof t=="number"?r=t:s=e.resource.getDerivedResource({url:`${t}/`}),this._parent=e,this._dataProvider=e._dataProvider,this._isRoot=n,this._level=i,this._layer=o,this._nodeIndex=r,this._resource=s,this._isLoading=!1,this._tile=void 0,this._data=void 0,this._geometryData=[],this._featureData=[],this._fields={},this._children=[],this._childrenReadyPromise=void 0,this._globalTransform=void 0,this._inverseGlobalTransform=void 0,this._inverseRotationMatrix=void 0}Object.defineProperties(Jd.prototype,{resource:{get:function(){return this._resource}},layer:{get:function(){return this._layer}},parent:{get:function(){return this._parent}},children:{get:function(){return this._children}},geometryData:{get:function(){return this._geometryData}},featureData:{get:function(){return this._featureData}},fields:{get:function(){return this._fields}},tile:{get:function(){return this._tile}},data:{get:function(){return this._data}}});Jd.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let o=e._create3DTileDefinition();e._tile=new Eu(e._layer._tileset,e._dataProvider.resource,o,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let o=await tS.loadJson(this._resource,this._dataProvider._traceFetches);e._data=o,t();return}let n=await this._layer._getNodeInNodePages(this._nodeIndex);e._data=n;let i;e._isRoot?i="nodes/root/":l(n.mesh)&&(i=`../${n.mesh.geometry.resource}/`),l(i)&&(e._resource=e._parent.resource.getDerivedResource({url:i})),t()};Jd.prototype.loadFields=function(){let e=this._layer._data.attributeStorageInfo,t=this;function n(o,r){let s=new N9(t,o[r]);return t._fields[s._storageInfo.name]=s,s.load()}let i=[];if(l(e))for(let o=0;o<e.length;o++)i.push(n(e,o));return Promise.all(i)};Jd.prototype.getFieldsForPickedPosition=function(e){let t=this.geometryData[0];if(!l(t.customAttributes.featureIndex))return{};let n=t.getClosestPointIndexOnTriangle(e.x,e.y,e.z);if(n.index===-1||n.index>t.customAttributes.featureIndex.length)return{};let i=t.customAttributes.featureIndex[n.index];return this.getFieldsForFeature(i)};Jd.prototype.getFieldsForFeature=function(e){let t={};for(let n in this.fields)if(this.fields.hasOwnProperty(n)){let i=this.fields[n];e>=0&&e<i.values.length&&(t[i.name]=i.values[e])}return t};Jd.prototype._loadChildren=function(){let e=this;if(l(this._childrenReadyPromise))return this._childrenReadyPromise;let t=[];if(l(e._data.children))for(let n=0;n<e._data.children.length;n++){let i=e._data.children[n],o=new Jd(e,g(i.href,i),!1);e._children.push(o),t.push(o.load())}return this._childrenReadyPromise=Promise.all(t).then(function(){for(let n=0;n<e._children.length;n++)e._tile.children.push(e._children[n]._tile)}),this._childrenReadyPromise};Jd.prototype._loadGeometryData=function(){let e=[];if(l(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new eL(this,this._data.geometryData[t].href);this._geometryData.push(n),e.push(n.load())}else if(l(this._data.mesh)){let t=this._layer._findBestGeometryBuffers(this._data.mesh.geometry.definition,["position","uv0"]),n=`./geometries/${t.bufferIndex}/`,i=new eL(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};Jd.prototype._loadFeatureData=function(){let e=[];if(l(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new M9(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};Jd.prototype._clearGeometryData=function(){this._geometryData=[]};Jd.prototype._create3DTileDefinition=function(){let e=this._data.obb,t=this._data.mbs;if(!l(e)&&!l(t)){console.error("Failed to load I3S node. Bounding volume is required.");return}let n;if(l(e)?n=he.fromDegrees(e.center[0],e.center[1],e.center[2]):n=he.fromDegrees(t[0],t[1],t[2]),l(this._dataProvider._geoidDataList)&&l(n))for(let C=0;C<this._dataProvider._geoidDataList.length;C++){let V=this._dataProvider._geoidDataList[C],L=V.projection.project(n);if(L.x>V.nativeExtent.west&&L.x<V.nativeExtent.east&&L.y>V.nativeExtent.south&&L.y<V.nativeExtent.north){n.height+=Lyt(L.x,L.y,V);break}}let i={},o,r=0;l(e)?(i={box:[0,0,0,e.halfSize[0],0,0,0,e.halfSize[1],0,0,0,e.halfSize[2]]},r=Math.max(Math.max(this._data.obb.halfSize[0],this._data.obb.halfSize[1]),this._data.obb.halfSize[2]),o=oe.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},o=oe.WGS84.cartographicToCartesian(n),r=this._data.mbs[3]),r*=2;let s=1/0;if(l(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let C=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));s=r/C}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let C=this._data.lodThreshold;s=r/C}else console.error("Invalid lodSelectionMetricType in Layer");else if(l(this._data.lodSelection))for(let C=0;C<this._data.lodSelection.length;C++)this._data.lodSelection[C].metricType==="maxScreenThreshold"&&(s=r/this._data.lodSelection[C].maxError);s===1/0&&(s=1e5);let a=s*16,c=new za(0,0,0),d=Xt.headingPitchRollQuaternion(o,c);l(this._data.obb)&&(d=new Me(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let u=q.fromQuaternion(d),m=q.inverse(u,new q),p=new A(u[0],u[1],u[2],0,u[3],u[4],u[5],0,u[6],u[7],u[8],0,o.x,o.y,o.z,1),y=A.inverse(p,new A),f=A.clone(p);l(this._parent._globalTransform)&&A.multiply(p,this._parent._inverseGlobalTransform,f),this._globalTransform=p,this._inverseGlobalTransform=y,this._inverseRotationMatrix=m;let x=[];for(let C=0;C<this._children.length;C++)x.push(this._children[C]._create3DTileDefinition());return{children:x,refine:"REPLACE",boundingVolume:i,transform:[f[0],f[4],f[8],f[12],f[1],f[5],f[9],f[13],f[2],f[6],f[10],f[14],f[3],f[7],f[11],f[15]],content:{uri:l(this._resource)?this._resource.url:void 0},geometricError:a}};Jd.prototype._createContentURL=async function(){let e={scene:0,scenes:[{nodes:[0]}],nodes:[{name:"singleNode"}],meshes:[],buffers:[],bufferViews:[],accessors:[],materials:[],textures:[],images:[],samplers:[],asset:{version:"2.0"}},t=[this._loadGeometryData()];if(this._dataProvider.legacyVersion16&&t.push(this._loadFeatureData()),await Promise.all(t),l(this._geometryData)&&this._geometryData.length>0){let o=this._geometryData[0].resource.url,r=this._layer._data.store.defaultGeometrySchema,s=this._geometryData[0],a=await A9.decode(o,r,s,this._featureData[0]);if(!l(a))return;e=s._generateGltf(a.meshData.nodesInScene,a.meshData.nodes,a.meshData.meshes,a.meshData.buffers,a.meshData.bufferViews,a.meshData.accessors),this._geometryData[0]._customAttributes=a.meshData._customAttributes}let n=this._dataProvider._binarizeGltf(e),i=new Blob([n],{type:"application/binary"});return URL.createObjectURL(i)};Eu.prototype._hookedRequestContent=Eu.prototype.requestContent;Eu.prototype.requestContent=function(){if(!this.tileset._isI3STileSet)return this._hookedRequestContent();if(!this._isLoading)return this._isLoading=!0,this._i3sNode._createContentURL().then(e=>{if(!l(e)){this._isLoading=!1;return}return this._contentResource=new Xe({url:e}),this._hookedRequestContent()}).then(e=>(this._isLoading=!1,e))};function Vyt(e,t,n,i,o,r){let s=n*(1-e)+i*e,a=o*(1-e)+r*e;return s*(1-t)+a*t}function rB(e,t,n,i){let o=e+t*n;return i[o]}function Lyt(e,t,n){let i=n.nativeExtent,o=(e-i.west)/(i.east-i.west)*(n.width-1),r=(t-i.south)/(i.north-i.south)*(n.height-1),s=Math.floor(o),a=Math.floor(r);o-=s,r-=a;let c=s<n.width?s+1:s,d=a<n.height?a+1:a;a=n.height-1-a,d=n.height-1-d;let u=rB(s,a,n.width,n.buffer),m=rB(c,a,n.width,n.buffer),p=rB(s,d,n.width,n.buffer),y=rB(c,d,n.width,n.buffer),f=Vyt(o,r,u,m,p,y);return f=f*n.scale+n.offset,f}Object.defineProperties(Eu.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var tL=Jd;function sm(e,t,n){this._dataProvider=e,!l(t.href)&&l(n)&&(t.href=`layers/${n}`);let i=this._dataProvider.resource.getUrlComponent(),o="";i.match(/layers\/\d/)?o=`${i}`.replace(/\/+$/,""):o=`${i}`.replace(/\/?$/,"/").concat(`${t.href}`),this._version=t.store.version;let r=this._version.split(".");this._majorVersion=parseInt(r[0]),this._minorVersion=r.length>1?parseInt(r[1]):0,this._resource=new Xe({url:o}),this._resource.setQueryParameters(this._dataProvider.resource.queryParameters),this._resource.appendForwardSlash(),this._data=t,this._rootNode=void 0,this._nodePages={},this._nodePageFetches={},this._extent=void 0,this._tileset=void 0,this._geometryDefinitions=void 0,this._computeGeometryDefinitions(!0),this._computeExtent()}Object.defineProperties(sm.prototype,{resource:{get:function(){return this._resource}},rootNode:{get:function(){return this._rootNode}},tileset:{get:function(){return this._tileset}},data:{get:function(){return this._data}},version:{get:function(){return this._version}},majorVersion:{get:function(){return this._majorVersion}},minorVersion:{get:function(){return this._minorVersion}},legacyVersion16:{get:function(){if(l(this.version))return this.majorVersion<1||this.majorVersion===1&&this.minorVersion<=6}}});sm.prototype.load=async function(e){if(this._data.spatialReference.wkid!==4326)throw new me(`Unsupported spatial reference: ${this._data.spatialReference.wkid}`);if(await this._dataProvider.loadGeoidData(),await this._loadRootNode(e),await this._create3DTileset(e),this._rootNode._tile=this._tileset._root,this._tileset._root._i3sNode=this._rootNode,this.legacyVersion16)return this._rootNode._loadChildren()};sm.prototype._computeGeometryDefinitions=function(e){if(this._geometryDefinitions=[],l(this._data.geometryDefinitions))for(let t=0;t<this._data.geometryDefinitions.length;t++){let n=[],i=this._data.geometryDefinitions[t].geometryBuffers;for(let o=0;o<i.length;o++){let r=i[o],s=[],a=!1;if(l(r.compressedAttributes)&&e){a=!0;let c=r.compressedAttributes.attributes;for(let d=0;d<c.length;d++)s.push(c[d])}else for(let c in r)c!=="offset"&&s.push(c);n.push({compressed:a,attributes:s,index:i.indexOf(r)})}n.sort(function(o,r){return o.compressed&&!r.compressed?-1:!o.compressed&&r.compressed?1:o.attributes.length-r.attributes.length}),this._geometryDefinitions.push(n)}};sm.prototype._findBestGeometryBuffers=function(e,t){let n=this._geometryDefinitions[e];if(l(n))for(let i=0;i<n.length;++i){let o=n[i],r=!1,s=o.attributes;for(let a=0;a<t.length;a++)if(!s.includes(t[a])){r=!0;break}if(!r)return{bufferIndex:o.index,definition:n,geometryBufferInfo:o}}return 0};sm.prototype._loadRootNode=function(e){if(l(this._data.nodePages)){let t=0;l(this._data.nodePages.rootIndex)&&(t=this._data.nodePages.rootIndex),this._rootNode=new tL(this,t,!0)}else this._rootNode=new tL(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};sm.prototype._getNodeInNodePages=function(e){let t=Math.floor(e/this._data.nodePages.nodesPerPage),n=e%this._data.nodePages.nodesPerPage;return this._loadNodePage(t).then(function(i){return i.nodes[n]})};sm._fetchJson=function(e){return e.fetchJson()};sm.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=sm._fetchJson(n).then(function(o){return l(o.error)&&o.error.code!==200?Promise.reject(o.error):(t._nodePages[e]=o.nodes,o)});this._nodePageFetches[e]=i}return this._nodePageFetches[e]};sm.prototype._computeExtent=function(){l(this._data.fullExtent)?this._extent=de.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):l(this._data.store.extent)&&(this._extent=de.fromDegrees(this._data.store.extent[0],this._data.store.extent[1],this._data.store.extent[2],this._data.store.extent[3]))};sm.prototype._create3DTileset=async function(e){let t={asset:{version:"1.0"},geometricError:Number.MAX_VALUE,root:this._rootNode._create3DTileDefinition()},n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=URL.createObjectURL(n);this._tileset=await oa.fromUrl(i,e),this._tileset.show=this._dataProvider.show,this._tileset._isI3STileSet=!0,this._tileset.tileUnload.addEventListener(function(o){o._i3sNode._clearGeometryData(),URL.revokeObjectURL(o._contentResource._url),o._contentResource=o._i3sNode.resource}),this._tileset.tileVisible.addEventListener(function(o){l(o._i3sNode)&&o._i3sNode._loadChildren()})};var nL=sm;var W_e=T(X_e(),1);function pa(e){e=g(e,g.EMPTY_OBJECT),this._name=e.name,this._show=g(e.show,!0),this._geoidTiledTerrainProvider=e.geoidTiledTerrainProvider,this._traceFetches=g(e.traceFetches,!1),this._cesium3dTilesetOptions=g(e.cesium3dTilesetOptions,g.EMPTY_OBJECT),this._layers=[],this._data=void 0,this._extent=void 0,this._geoidDataPromise=void 0,this._geoidDataList=void 0,this._decoderTaskProcessor=void 0,this._taskProcessorReadyPromise=void 0}Object.defineProperties(pa.prototype,{name:{get:function(){return this._name}},show:{get:function(){return this._show},set:function(e){this._show=e;for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&(this._layers[t]._tileset.show=this._show)}},traceFetches:{get:function(){return this._traceFetches},set:function(e){this._traceFetches=e}},geoidTiledTerrainProvider:{get:function(){return this._geoidTiledTerrainProvider}},layers:{get:function(){return this._layers}},data:{get:function(){return this._data}},extent:{get:function(){return this._extent}},resource:{get:function(){return this._resource}}});pa.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)l(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return ue(this)};pa.prototype.isDestroyed=function(){return!1};pa.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};pa.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};pa.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};pa.prototype.updateForPass=function(e,t){for(let n=0;n<this._layers.length;n++)l(this._layers[n]._tileset)&&this._layers[n]._tileset.updateForPass(e,t)};pa.fromUrl=async function(e,t){t=g(t,g.EMPTY_OBJECT);let n=Xe.createIfNeeded(e),i=await pa.loadJson(n),o=new pa(t);if(o._resource=n,o._data=i,l(i.layers))for(let s=0;s<i.layers.length;s++){let a=new nL(o,i.layers[s],s);o._layers.push(a)}else{let s=new nL(o,i,i.id);o._layers.push(s)}o._computeExtent();let r=[];for(let s=0;s<o._layers.length;s++)r.push(o._layers[s].load(t.cesium3dTilesetOptions));return await Promise.all(r),o};pa._fetchJson=function(e){return e.fetchJson()};pa.loadJson=async function(e,t){t&&console.log("I3S FETCH:",e.url);let n=await pa._fetchJson(e);if(l(n.error)){if(console.error("Failed to fetch I3S ",e.url),l(n.error.message)&&console.error(n.error.message),l(n.error.details))for(let i=0;i<n.error.details.length;i++)console.log(n.error.details[i]);throw new me(n.error)}return n};pa.prototype._loadBinary=function(e){return this._traceFetches&&console.log("I3S FETCH:",e.url),e.fetchArrayBuffer()};pa.prototype._binarizeGltf=function(e){let n=new TextEncoder().encode(JSON.stringify(e)),i=new Uint8Array(n.byteLength+20),o={magic:new Uint8Array(i.buffer,0,4),version:new Uint32Array(i.buffer,4,1),length:new Uint32Array(i.buffer,8,1),chunkLength:new Uint32Array(i.buffer,12,1),chunkType:new Uint32Array(i.buffer,16,1),chunkData:new Uint8Array(i.buffer,20,n.byteLength)};return o.magic[0]=103,o.magic[1]=108,o.magic[2]=84,o.magic[3]=70,o.version[0]=2,o.length[0]=i.byteLength,o.chunkLength[0]=n.byteLength,o.chunkType[0]=1313821514,o.chunkData.set(n),i};var Ryt=new B;function Zyt(e,t){let n=e.tilingScheme,i=[],o={},r=e._lodCount,s=he.fromRadians(t.west,t.north),a=he.fromRadians(t.east,t.south),c=n.positionToTileXY(s,r),d=n.positionToTileXY(a,r);for(let m=c.x;m<=d.x;m++)for(let p=c.y;p<=d.y;p++){let y=B.fromElements(m,p,Ryt),f=y.toString();if(!o.hasOwnProperty(f)){let x={x:y.x,y:y.y,level:r,tilingScheme:n,terrainProvider:e,positions:[]};o[f]=x,i.push(x)}}let u=[];for(let m=0;m<i.length;++m){let p=i[m],y=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);u.push(y)}return Promise.all(u).then(function(m){let p=[];for(let y=0;y<m.length;y++){let f={tilingScheme:n,x:i[y].x,y:i[y].y,level:i[y].level},x=m[y],_="Geographic";n._projection instanceof Gi&&(_="WebMercator");let C={projectionType:_,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(f.x,f.y,f.level),height:x._height,width:x._width,scale:x._structure.heightScale,offset:x._structure.heightOffset};if(x._encoding===zu.LERC){let V=W_e.default.decode(x._buffer);C.buffer=V.pixels[0]}else C.buffer=x._buffer;p.push(C)}return p})}async function Gyt(e){let t=e._geoidTiledTerrainProvider;if(!l(t)){console.log("No Geoid Terrain service provided - no geoid conversion will be performed.");return}try{let n=await Zyt(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}pa.prototype.loadGeoidData=async function(){return l(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=Gyt(this),this._geoidDataPromise)};pa.prototype._computeExtent=function(){let e;for(let t=0;t<this._layers.length;t++)if(l(this._layers[t]._extent)){let n=this._layers[t]._extent;l(e)?de.union(e,n,e):e=de.clone(n)}this._extent=e};var tS=pa;var Jzi=T(S(),1),P_e=Object.freeze({UNLOADED:0,RECEIVING:1,RECEIVED:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function aB(e,t){this.spatialNode=e,this.keyframe=t,this.state=P_e.UNLOADED,this.metadatas=[],this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}aB.priorityComparator=function(e,t){return e.priority-t.priority};aB.searchComparator=function(e,t){return e.keyframe-t.keyframe};aB.LoadState=P_e;var no=aB;var qzi=T(S(),1);function v_e(){}Object.defineProperties(v_e.prototype,{color:{get:fe.throwInstantiationError},intensity:{get:fe.throwInstantiationError}});var A8=v_e;var rJi=T(S(),1);var Eyt=/\/$/,w_e=new Vt('&copy; <a href="https://www.mapbox.com/about/maps/">Mapbox</a> &copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function iL(e){e=g(e,g.EMPTY_OBJECT);let t=e.styleId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=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;let i=Xe.createIfNeeded(g(e.url,"https://api.mapbox.com/styles/v1/"));this._styleId=t,this._accessToken=n;let o=g(e.tilesize,512);this._tilesize=o;let r=g(e.username,"mapbox");this._username=r;let s=l(e.scaleFactor)?"@2x":"",a=i.getUrlComponent();Eyt.test(a)||(a+="/"),a+=`${this._username}/${t}/tiles/${this._tilesize}/{z}/{x}/{y}${s}`,i.url=a,i.setQueryParameters({access_token:n});let c;l(e.credit)?(c=e.credit,typeof c=="string"&&(c=new Vt(c))):c=w_e,this._resource=i,this._imageryProvider=new wa({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(iL.prototype,{url:{get:function(){return this._imageryProvider.url}},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}}});iL.prototype.getTileCredits=function(e,t,n){};iL.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};iL.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};iL._defaultCredit=w_e;var M8=iL;var LJi=T(S(),1);function Lg(e,t,n,i,o){i===sn.UNSIGNED_SHORT&&(i=sn.FLOAT32);let r=e.floatingPointTexture;if(i===sn.FLOAT32&&!r)throw new me("Floating point texture not supported");let s;i===sn.FLOAT32||i===sn.FLOAT64?s=je.FLOAT:i===sn.UINT8&&(s=je.UNSIGNED_BYTE);let a;n===1?a=e.webgl2?at.RED:at.LUMINANCE:n===2?a=e.webgl2?at.RG:at.LUMINANCE_ALPHA:n===3?a=at.RGB:n===4&&(a=at.RGBA);let c=512*1024*1024,d=128*1024*1024;o=Math.min(g(o,d),c);let u=Yt.maximumTextureSize,m=sn.getSizeInBytes(i),p=Math.floor(o/(n*m)),y=Math.min(u,W.previousPowerOfTwo(Math.floor(Math.sqrt(p)))),f=Math.ceil(Math.sqrt(t.x)),x=Math.ceil(t.z/f),_=f*t.x,C=x*t.y,V=Math.floor(y/_),L=Math.floor(y/C);if(V===0||L===0)throw new me("Tileset is too large to fit into megatexture");this.channelCount=n,this.componentType=i,this.voxelCountPerTile=h.clone(t,new h),this.maximumTileCount=V*L,this.regionCountPerMegatexture=new B(V,L),this.voxelCountPerRegion=new B(_,C),this.sliceCountPerRegion=new B(f,x),this.voxelSizeUv=new B(1/y,1/y),this.sliceSizeUv=new B(t.x/y,t.y/y),this.regionSizeUv=new B(_/y,C/y),this.texture=new wt({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:y,height:y,sampler:new hn({wrapS:In.CLAMP_TO_EDGE,wrapT:In.CLAMP_TO_EDGE,minificationFilter:dn.LINEAR,magnificationFilter:Ti.LINEAR})});let Z=sn.toComponentDatatype(i);this.tileVoxelDataTemp=Q.createTypedArray(Z,_*C*n),this.nodes=new Array(this.maximumTileCount);for(let G=0;G<this.maximumTileCount;G++)this.nodes[G]=new Iyt(G);for(let G=0;G<this.maximumTileCount;G++){let I=this.nodes[G];I.previousNode=G>0?this.nodes[G-1]:void 0,I.nextNode=G<this.maximumTileCount-1?this.nodes[G+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0}function Iyt(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}Lg.prototype.add=function(e){if(this.isFull())throw new fe("Trying to add when there are no empty spots");let t=this.emptyList;this.emptyList=this.emptyList.nextNode,l(this.emptyList)&&(this.emptyList.previousNode=void 0),t.nextNode=this.occupiedList,l(t.nextNode)&&(t.nextNode.previousNode=t),this.occupiedList=t;let n=t.index;return this.writeDataToTexture(n,e),this.occupiedCount++,n};Lg.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new fe("Megatexture index out of bounds");let t=this.nodes[e];l(t.previousNode)&&(t.previousNode.nextNode=t.nextNode),l(t.nextNode)&&(t.nextNode.previousNode=t.previousNode),t.nextNode=this.emptyList,l(t.nextNode)&&(t.nextNode.previousNode=t),t.previousNode=void 0,this.emptyList=t,this.occupiedCount--};Lg.prototype.isFull=function(){return this.emptyList===void 0};Lg.getApproximateTextureMemoryByteLength=function(e,t,n,i){i===sn.UNSIGNED_SHORT&&(i=sn.FLOAT32);let o=sn.getSizeInBytes(i),r=e*t.x*t.y*t.z,s=Math.ceil(Math.sqrt(t.x)),a=Math.ceil(t.z/s),c=s*t.x,d=a*t.y,u=W.previousPowerOfTwo(Math.floor(Math.sqrt(r)));for(;;){let p=Math.floor(u/c),y=Math.floor(u/d);if(p*y>=e)break;u*=2}return u*u*n*o};Lg.prototype.writeDataToTexture=function(e,t){let n=t.constructor===Uint16Array?new Float32Array(t):t,i=this.voxelCountPerTile,o=this.sliceCountPerRegion,r=this.voxelCountPerRegion,s=this.channelCount,a=this.tileVoxelDataTemp;for(let x=0;x<i.z;x++){let _=x%o.x*i.x,C=Math.floor(x/o.x)*i.y;for(let V=0;V<i.y;V++)for(let L=0;L<i.x;L++){let Z=x*i.y*i.x+V*i.x+L,G=(C+V)*r.x+(_+L);for(let I=0;I<s;I++)a[G*s+I]=n[Z*s+I]}}let c=this.regionCountPerMegatexture,d=r.x,u=r.y,m=e%c.x*r.x,p=Math.floor(e/c.x)*r.y,f={source:{arrayBufferView:a,width:d,height:u},xOffset:m,yOffset:p};this.texture.copyFrom(f)};Lg.prototype.isDestroyed=function(){return!1};Lg.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),ue(this)};var oL=Lg;var ZJi=T(S(),1);function N8(e){}N8.prototype.isReady=function(){return!0};N8.prototype.shouldDiscardImage=function(e){return!1};var U8=N8;var FJi=T(S(),1);var Xyt=new Vt("MapQuest, Open Street Map and contributors, CC-BY-SA");function cB(e){e=g(e,g.EMPTY_OBJECT);let t=Xe.createIfNeeded(g(e.url,"https://tile.openstreetmap.org/"));t.appendForwardSlash(),t.url+=`{z}/{x}/{y}${e.retinaTiles?"@2x":""}.${g(e.fileExtension,"png")}`;let n=new Jr({ellipsoid:e.ellipsoid}),i=256,o=256,r=g(e.minimumLevel,0),s=e.maximumLevel,a=g(e.rectangle,n.rectangle),c=n.positionToTileXY(de.southwest(a),r),d=n.positionToTileXY(de.northeast(a),r),u=(Math.abs(d.x-c.x)+1)*(Math.abs(d.y-c.y)+1),m=g(e.credit,Xyt);typeof m=="string"&&(m=new Vt(m)),wa.call(this,{url:t,credit:m,tilingScheme:n,tileWidth:i,tileHeight:o,minimumLevel:r,maximumLevel:s,rectangle:a})}l(Object.create)&&(cB.prototype=Object.create(wa.prototype),cB.prototype.constructor=cB);var lb=cB;var BJi=T(S(),1);var Wyt=new B(1,1);function k8(e){e=g(e,g.EMPTY_OBJECT),this.mass=g(e.mass,1),this.position=h.clone(g(e.position,h.ZERO)),this.velocity=h.clone(g(e.velocity,h.ZERO)),this.life=g(e.life,Number.MAX_VALUE),this.image=e.image,this.startColor=O.clone(g(e.startColor,O.WHITE)),this.endColor=O.clone(g(e.endColor,O.WHITE)),this.startScale=g(e.startScale,1),this.endScale=g(e.endScale,1),this.imageSize=B.clone(g(e.imageSize,Wyt)),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(k8.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var F_e=new h;k8.prototype.update=function(e,t){return h.multiplyByScalar(this.velocity,e,F_e),h.add(this.position,F_e,this.position),l(t)&&t(this,e),this._age+=e,this.life===Number.MAX_VALUE?this._normalizedAge=0:this._normalizedAge=this._age/this.life,this._age<=this.life};var rL=k8;var HJi=T(S(),1);function A_e(e){e=g(e,g.EMPTY_OBJECT),this.time=g(e.time,0),this.minimum=g(e.minimum,0),this.maximum=g(e.maximum,50),this._complete=!1}Object.defineProperties(A_e.prototype,{complete:{get:function(){return this._complete}}});var D8=A_e;var JJi=T(S(),1);function M_e(e){}M_e.prototype.emit=function(e){fe.throwInstantiationError()};var B8=M_e;var dQi=T(S(),1);var N_e=new B(1,1);function k9(e){e=g(e,g.EMPTY_OBJECT),this.show=g(e.show,!0),this.updateCallback=e.updateCallback,this.loop=g(e.loop,!0),this.image=g(e.image,void 0);let t=e.emitter;l(t)||(t=new E9(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=A.clone(g(e.modelMatrix,A.IDENTITY)),this._emitterModelMatrix=A.clone(g(e.emitterModelMatrix,A.IDENTITY)),this._matrixDirty=!0,this._combinedMatrix=new A,this._startColor=O.clone(g(e.color,g(e.startColor,O.WHITE))),this._endColor=O.clone(g(e.color,g(e.endColor,O.WHITE))),this._startScale=g(e.scale,g(e.startScale,1)),this._endScale=g(e.scale,g(e.endScale,1)),this._emissionRate=g(e.emissionRate,5),this._minimumSpeed=g(e.speed,g(e.minimumSpeed,1)),this._maximumSpeed=g(e.speed,g(e.maximumSpeed,1)),this._minimumParticleLife=g(e.particleLife,g(e.minimumParticleLife,5)),this._maximumParticleLife=g(e.particleLife,g(e.maximumParticleLife,5)),this._minimumMass=g(e.mass,g(e.minimumMass,1)),this._maximumMass=g(e.mass,g(e.maximumMass,1)),this._minimumImageSize=B.clone(g(e.imageSize,g(e.minimumImageSize,N_e))),this._maximumImageSize=B.clone(g(e.imageSize,g(e.maximumImageSize,N_e))),this._sizeInMeters=g(e.sizeInMeters,!1),this._lifetime=g(e.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 ye,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties(k9.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||!A.equals(this._modelMatrix,e),A.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!A.equals(this._emitterModelMatrix,e),A.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){O.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){O.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}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters=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}}});function Pyt(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,o=e._bursts;if(l(o)){let m=o.length;for(let p=0;p<m;++p)i+=o[p].maximum}let r=e._billboardCollection,s=e.image,a=Math.ceil(t*n+i),c=e._particles,d=e._particlePool,u=Math.max(a-c.length-d.length,0);for(let m=0;m<u;++m){let p=new rL;p._billboard=r.add({image:s,show:!1}),d.push(p)}e._particleEstimate=a}function vyt(e){let t=e._particlePool.pop();return l(t)||(t=new rL),t}function wyt(e,t){e._particlePool.push(t)}function Fyt(e){let t=e._particles,n=e._particlePool,i=e._billboardCollection,o=t.length,r=n.length,s=e._particleEstimate,a=r-Math.max(s-o-r,0);for(let c=a;c<r;++c){let d=n[c];i.remove(d._billboard)}n.length=a}function Ayt(e){l(e._billboard)&&(e._billboard.show=!1)}function U_e(e,t){let n=t._billboard;l(n)||(n=t._billboard=e._billboardCollection.add({image:t.image})),n.width=t.imageSize.x,n.height=t.imageSize.y,n.position=t.position,n.sizeInMeters=e.sizeInMeters,n.show=!0;let i=W.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),o=W.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),r=W.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),s=W.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new O(i,o,r,s),n.scale=W.lerp(t.startScale,t.endScale,t.normalizedAge)}function Myt(e,t){t.startColor=O.clone(e._startColor,t.startColor),t.endColor=O.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=W.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=W.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=W.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=W.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=W.randomBetween(e._minimumSpeed,e._maximumSpeed);h.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function Nyt(e,t){if(e._isComplete)return 0;t=W.mod(t,e._lifetime);let n=t*e._emissionRate,i=Math.floor(n);if(e._carryOver+=n-i,e._carryOver>1&&(i++,e._carryOver-=1),l(e.bursts)){let o=e.bursts.length;for(let r=0;r<o;r++){let s=e.bursts[r],a=e._currentTime;l(s)&&!s._complete&&a>s.time&&(i+=W.randomBetween(s.minimum,s.maximum),s._complete=!0)}}return i}var lB=new h;k9.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new ac),this._updateParticlePool&&(Pyt(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=te.secondsDifference(e.time,this._previousTime)),t<0&&(t=0);let n=this._particles,i=this._emitter,o=this.updateCallback,r,s,a=n.length;for(r=0;r<a;++r)s=n[r],s.update(t,o)?U_e(this,s):(Ayt(s),wyt(this,s),n[r]=n[a-1],--r,--a);n.length=a;let c=Nyt(this,t);if(c>0&&l(i)){this._matrixDirty&&(this._combinedMatrix=A.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let d=this._combinedMatrix;for(r=0;r<c;r++)s=vyt(this),this._emitter.emit(s),h.add(s.position,s.velocity,lB),A.multiplyByPoint(d,lB,lB),s.position=A.multiplyByPoint(d,s.position,s.position),h.subtract(lB,s.position,s.velocity),h.normalize(s.velocity,s.velocity),Myt(this,s),U_e(this,s)}if(this._billboardCollection.update(e),this._previousTime=te.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=W.mod(this._currentTime,this._lifetime),this.bursts){let d=this.bursts.length;for(r=0;r<d;r++)this.bursts[r]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120===0&&Fyt(this)};k9.prototype.isDestroyed=function(){return!1};k9.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),ue(this)};var O8=k9;var QQi=T(S(),1);var B_e=T(jA(),1);var hQi=T(S(),1);var Uyt={modifyFragmentShader:function(t){return t=Oe.replaceMain(t,"czm_splitter_main"),t+=`uniform float czm_splitDirection;
void main()
{
#ifndef SHADOW_MAP
if (czm_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;
if (czm_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;
#endif
czm_splitter_main();
}
`,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},sL=Uyt;var nS={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function D9(e){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=O.clone(O.DARKGRAY),this._highlightColor=O.clone(O.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=nS.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._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=g(e.opaquePass,Ve.OPAQUE),this._cull=g(e.cull,!0),this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=A.clone(A.IDENTITY),this._modelMatrix=A.clone(A.IDENTITY),this.time=0,this.shadows=Cn.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,this.splitDirection=g(e.splitDirection,Bc.NONE),this._splittingEnabled=!1,this._error=void 0,kyt(this,e)}Object.defineProperties(D9.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return O.clone(this._highlightColor)},set:function(e){this._highlightColor=O.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(l(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=ce.clone(e,this._boundingSphere)}}});function kyt(e,t){let n=s_.parse(t.arrayBuffer,t.byteOffset);if(e._parsedContent=n,e._rtcCenter=n.rtcCenter,e._hasNormals=n.hasNormals,e._hasColors=n.hasColors,e._hasBatchIds=n.hasBatchIds,e._isTranslucent=n.isTranslucent,!n.hasBatchIds&&l(n.batchTableBinary)&&(n.styleableProperties=Xp.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let a=n.draco;e._decodingState=nS.NEEDS_DECODE,a.dequantizeInShader=e._dequantizeInShader}let i=n.positions;l(i)&&(e._isQuantized=i.isQuantized,e._quantizedVolumeScale=i.quantizedVolumeScale,e._quantizedVolumeOffset=i.quantizedVolumeOffset,e._quantizedRange=i.quantizedRange);let o=n.normals;l(o)&&(e._isOctEncoded16P=o.octEncoded);let r=n.colors;l(r)&&(l(r.constantColor)&&(e._constantColor=O.clone(r.constantColor,e._constantColor),e._hasColors=!1),e._isRGB565=r.isRGB565);let s=n.batchIds;l(n.batchIds)&&(s.name="BATCH_ID",s.semantic="BATCH_ID",s.setIndex=void 0),n.hasBatchIds&&e._batchTableLoaded(n.batchLength,n.batchTableJson,n.batchTableBinary),e._pointsLength=n.pointsLength}var Dyt=new h,Byt=new h,Oyt=new h,k_e,dB;function Yyt(e){if(!l(dB)){k_e=new B_e.default(0),dB=new Array(e);for(let t=0;t<e;++t)dB[t]=k_e.random()}return dB}function Hyt(e){let n=e.length/3,i=Math.min(n,20),o=Yyt(20),r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=h.fromElements(r,r,r,Dyt),c=h.fromElements(s,s,s,Byt);for(let u=0;u<i;++u){let m=Math.floor(o[u]*n),p=h.unpack(e,m*3,Oyt);h.minimumByComponent(a,p,a),h.maximumByComponent(c,p,c)}let d=ce.fromCornerPoints(a,c);return d.radius+=W.EPSILON2,d}function D_e(e,t){let n=Q.fromTypedArray(e);return n===Q.INT||n===Q.UNSIGNED_INT||n===Q.DOUBLE?(Ft("Cast pnts property to floats",`Point cloud property "${t}" will be cast 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}var Kyt=new se,zyt=new se,Jyt=new O,O_e=0,uB=1,J8=2,Y_e=3,Qyt=4,Y8=new A,jyt=new A;function qyt(e,t){let n=t.context,i=e._parsedContent,o=e._pointsLength,r=i.positions,s=i.colors,a=i.normals,c=i.batchIds,d=i.styleableProperties,u=l(d),m=e._isQuantized,p=e._isQuantizedDraco,y=e._isOctEncoded16P,f=e._isOctEncodedDraco,x=e._quantizedRange,_=e._octEncodedRange,C=e._isRGB565,V=e._isTranslucent,L=e._hasColors,Z=e._hasNormals,G=e._hasBatchIds,I,P,v=[],F={};if(e._styleableShaderAttributes=F,u){let k=Qyt;for(let Y in d)if(d.hasOwnProperty(Y)){let U=d[Y],J=D_e(U.typedArray,Y);I=U.componentCount,P=Q.fromTypedArray(J);let K=ft.createVertexBuffer({context:n,typedArray:J,usage:Ue.STATIC_DRAW});e._geometryByteLength+=K.sizeInBytes;let ee={index:k,vertexBuffer:K,componentsPerAttribute:I,componentDatatype:P,normalize:!1,offsetInBytes:0,strideInBytes:0};v.push(ee),F[Y]={location:k,componentCount:I},++k}}let M=ft.createVertexBuffer({context:n,typedArray:r.typedArray,usage:Ue.STATIC_DRAW});e._geometryByteLength+=M.sizeInBytes;let b;L&&(b=ft.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Ue.STATIC_DRAW}),e._geometryByteLength+=b.sizeInBytes);let R;Z&&(R=ft.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Ue.STATIC_DRAW}),e._geometryByteLength+=R.sizeInBytes);let E;G&&(c.typedArray=D_e(c.typedArray,"batchIds"),E=ft.createVertexBuffer({context:n,typedArray:c.typedArray,usage:Ue.STATIC_DRAW}),e._geometryByteLength+=E.sizeInBytes);let X=[];if(m?P=Q.UNSIGNED_SHORT:p?P=x<=255?Q.UNSIGNED_BYTE:Q.UNSIGNED_SHORT:P=Q.FLOAT,X.push({index:O_e,vertexBuffer:M,componentsPerAttribute:3,componentDatatype:P,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(m||p?e._boundingSphere=ce.fromCornerPoints(h.ZERO,e._quantizedVolumeScale):e._boundingSphere=Hyt(r.typedArray)),L)if(C)X.push({index:uB,vertexBuffer:b,componentsPerAttribute:1,componentDatatype:Q.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let k=V?4:3;X.push({index:uB,vertexBuffer:b,componentsPerAttribute:k,componentDatatype:Q.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}Z&&(y?(I=2,P=Q.UNSIGNED_BYTE):f?(I=2,P=_<=255?Q.UNSIGNED_BYTE:Q.UNSIGNED_SHORT):(I=3,P=Q.FLOAT),X.push({index:J8,vertexBuffer:R,componentsPerAttribute:I,componentDatatype:P,normalize:!1,offsetInBytes:0,strideInBytes:0})),G&&X.push({index:Y_e,vertexBuffer:E,componentsPerAttribute:1,componentDatatype:Q.fromTypedArray(c.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),u&&(X=X.concat(v));let w=new oi({context:n,attributes:X}),N={depthTest:{enabled:!0}},D={depthTest:{enabled:!0},depthMask:!1,blending:mn.ALPHA_BLEND};e._opaquePass===Ve.CESIUM_3D_TILE&&(N.stencilTest=Nt.setCesium3DTileBit(),N.stencilMask=Nt.CESIUM_3D_TILE_MASK,D.stencilTest=Nt.setCesium3DTileBit(),D.stencilMask=Nt.CESIUM_3D_TILE_MASK),e._opaqueRenderState=ke.fromCache(N),e._translucentRenderState=ke.fromCache(D),e._drawCommand=new nt({boundingVolume:new ce,cull:e._cull,modelMatrix:new A,primitiveType:Ae.POINTS,vertexArray:w,count:o,shaderProgram:void 0,uniformMap:void 0,renderState:V?e._translucentRenderState:e._opaqueRenderState,pass:V?Ve.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function $yt(e,t){let n=t.context,i=e._isQuantized,o=e._isQuantizedDraco,r=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=Kyt;if(a.x=e._attenuation?e.maximumAttenuation:e._pointSize,a.x*=t.pixelRatio,a.y=e.time,e._attenuation){let c=t.camera.frustum,d;t.mode===ie.SCENE2D||c instanceof rn?d=Number.POSITIVE_INFINITY:d=n.drawingBufferHeight/t.camera.frustum.sseDenominator,a.z=e.geometricError*e.geometricErrorScale,a.w=d}return a},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor},u_clippingPlanes:function(){let a=e.clippingPlanes;return e.isClipped?a.texture:n.defaultTexture},u_clippingPlanesEdgeStyle:function(){let a=e.clippingPlanes;if(!l(a))return O.TRANSPARENT;let c=O.clone(a.edgeColor,Jyt);return c.alpha=a.edgeWidth,c},u_clippingPlanesMatrix:function(){let a=e.clippingPlanes;if(!l(a))return A.IDENTITY;let c=g(e.clippingPlanesOriginMatrix,e._modelMatrix);A.multiply(n.uniformState.view3D,c,Y8);let d=A.multiply(Y8,a.modelMatrix,Y8);return A.inverseTranspose(d,jyt)}};sL.addUniforms(e,s),(i||o||r)&&(s=Tt(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=zyt;if(l(e._quantizedVolumeScale)){let c=h.clone(e._quantizedVolumeScale,a);h.divideByScalar(c,e._quantizedRange,a)}return a.w=e._octEncodedRange,a}})),l(e._uniformMapLoaded)&&(s=e._uniformMapLoaded(s)),e._drawCommand.uniformMap=s}function H8(e,t){let n=/czm_3dtiles_property_(\d+)/g,i=n.exec(e);for(;i!==null;){let o=parseInt(i[1]);t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function K8(e,t){e=e.slice(e.indexOf(`
`));let n=/czm_3dtiles_builtin_property_(\w+)/g,i=n.exec(e);for(;i!==null;){let o=i[1];t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function z8(e,t){let n=e.numberOfAttributes;for(let i=0;i<n;++i){let o=e.getAttribute(i);if(o.index===t)return o}}var egt={POSITION:"czm_3dtiles_builtin_property_POSITION",POSITION_ABSOLUTE:"czm_3dtiles_builtin_property_POSITION_ABSOLUTE",COLOR:"czm_3dtiles_builtin_property_COLOR",NORMAL:"czm_3dtiles_builtin_property_NORMAL"};function tgt(e,t,n){let i,o,r,s=t.context,a=l(n),c=e._isQuantized,d=e._isQuantizedDraco,u=e._isOctEncoded16P,m=e._isOctEncodedDraco,p=e._isRGB565,y=e._isTranslucent,f=e._hasColors,x=e._hasNormals,_=e._hasBatchIds,C=e._backFaceCulling,V=e._normalShading,L=e._drawCommand.vertexArray,Z=e.clippingPlanes,G=e._attenuation,I,P,v,F=y,M=ze(egt),b={},R=e._styleableShaderAttributes;for(o in R)R.hasOwnProperty(o)&&(r=R[o],M[o]=`czm_3dtiles_property_${r.location}`,b[r.location]=r);if(a){let ae={translucent:!1},be="(vec3 czm_3dtiles_builtin_property_POSITION, vec3 czm_3dtiles_builtin_property_POSITION_ABSOLUTE, vec4 czm_3dtiles_builtin_property_COLOR, vec3 czm_3dtiles_builtin_property_NORMAL)";I=n.getColorShaderFunction(`getColorFromStyle${be}`,M,ae),P=n.getShowShaderFunction(`getShowFromStyle${be}`,M,ae),v=n.getPointSizeShaderFunction(`getPointSizeFromStyle${be}`,M,ae),l(I)&&ae.translucent&&(F=!0)}e._styleTranslucent=F;let E=l(I),X=l(P),w=l(v),N=e.isClipped,D=[],k=[];E&&(H8(I,D),K8(I,k)),X&&(H8(P,D),K8(P,k)),w&&(H8(v,D),K8(v,k));let Y=k.indexOf("COLOR")>=0,U=k.indexOf("NORMAL")>=0;if(U&&!x)throw new me("Style references the NORMAL semantic but the point cloud does not have normals");for(o in R)if(R.hasOwnProperty(o)){r=R[o];let ae=D.indexOf(r.location)>=0,be=z8(L,r.location);be.enabled=ae}let J=f&&(!E||Y);if(f){let ae=z8(L,uB);ae.enabled=J}let K=x&&(V||C||U);if(x){let ae=z8(L,J8);ae.enabled=K}let ee={a_position:O_e};J&&(ee.a_color=uB),K&&(ee.a_normal=J8),_&&(ee.a_batchId=Y_e);let H="",j=D.length;for(i=0;i<j;++i){let ae=D[i];r=b[ae];let be=r.componentCount,_e=`czm_3dtiles_property_${ae}`,Ze;be===1?Ze="float":Ze=`vec${be}`,H+=`in ${Ze} ${_e};
`,ee[_e]=r.location}$yt(e,t);let $=`in vec3 a_position;
out vec4 v_color;
uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier;
uniform vec4 u_constantColor;
uniform vec4 u_highlightColor;
`;$+=`float u_pointSize;
float tiles3d_tileset_time;
`,G&&($+=`float u_geometricError;
float u_depthMultiplier;
`),$+=H,J&&(y?$+=`in vec4 a_color;
`:p?$+=`in float a_color;
const float SHIFT_RIGHT_11 = 1.0 / 2048.0;
const float SHIFT_RIGHT_5 = 1.0 / 32.0;
const float SHIFT_LEFT_11 = 2048.0;
const float SHIFT_LEFT_5 = 32.0;
const float NORMALIZE_6 = 1.0 / 64.0;
const float NORMALIZE_5 = 1.0 / 32.0;
`:$+=`in vec3 a_color;
`),K&&(u||m?$+=`in vec2 a_normal;
`:$+=`in vec3 a_normal;
`),_&&($+=`in float a_batchId;
`),(c||d||m)&&($+=`uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange;
`),E&&($+=I),X&&($+=P),w&&($+=v),$+=`void main()
{
u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x;
tiles3d_tileset_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y;
`,G&&($+=` u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z;
u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w;
`),J?y?$+=` vec4 color = a_color;
`:p?$+=` float compressed = a_color;
float r = floor(compressed * SHIFT_RIGHT_11);
compressed -= r * SHIFT_LEFT_11;
float g = floor(compressed * SHIFT_RIGHT_5);
compressed -= g * SHIFT_LEFT_5;
float b = compressed;
vec3 rgb = vec3(r * NORMALIZE_5, g * NORMALIZE_6, b * NORMALIZE_5);
vec4 color = vec4(rgb, 1.0);
`:$+=` vec4 color = vec4(a_color, 1.0);
`:$+=` vec4 color = u_constantColor;
`,c||d?$+=` vec3 position = a_position * u_quantizedVolumeScaleAndOctEncodedRange.xyz;
`:$+=` vec3 position = a_position;
`,$+=` vec3 position_absolute = vec3(czm_model * vec4(position, 1.0));
`,K?(u?$+=` vec3 normal = czm_octDecode(a_normal);
`:m?$+=` vec3 normal = czm_octDecode(a_normal, u_quantizedVolumeScaleAndOctEncodedRange.w).zxy;
`:$+=` vec3 normal = a_normal;
`,$+=` vec3 normalEC = czm_normal * normal;
`):$+=` vec3 normal = vec3(1.0);
`,E&&($+=` color = getColorFromStyle(position, position_absolute, color, normal);
`),X&&($+=` float show = float(getShowFromStyle(position, position_absolute, color, normal));
`),w?$+=` gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal) * czm_pixelRatio;
`:G?$+=` vec4 positionEC = czm_modelView * vec4(position, 1.0);
float depth = -positionEC.z;
gl_PointSize = min((u_geometricError / depth) * u_depthMultiplier, u_pointSize);
`:$+=` gl_PointSize = u_pointSize;
`,$+=` color = color * u_highlightColor;
`,K&&V&&($+=` float diffuseStrength = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC);
diffuseStrength = max(diffuseStrength, 0.4);
color.xyz *= diffuseStrength * czm_lightColor;
`),$+=` v_color = color;
gl_Position = czm_modelViewProjection * vec4(position, 1.0);
`,K&&C&&($+=` float visible = step(-normalEC.z, 0.0);
gl_Position *= visible;
gl_PointSize *= visible;
`),X&&($+=` gl_Position.w *= float(show);
gl_PointSize *= float(show);
`),$+=`}
`;let pe=`in vec4 v_color;
`;N&&(pe+=`uniform highp sampler2D u_clippingPlanes;
uniform mat4 u_clippingPlanesMatrix;
uniform vec4 u_clippingPlanesEdgeStyle;
`,pe+=`
`,pe+=Y0(Z,s),pe+=`
`),pe+=`void main()
{
out_FragColor = czm_gammaCorrect(v_color);
`,N&&(pe+=F9("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),pe+=`}
`,e.splitDirection!==Bc.NONE&&(pe=sL.modifyFragmentShader(pe)),l(e._vertexShaderLoaded)&&($=e._vertexShaderLoaded($)),l(e._fragmentShaderLoaded)&&(pe=e._fragmentShaderLoaded(pe));let ge=e._drawCommand;l(ge.shaderProgram)&&ge.shaderProgram.destroy(),ge.shaderProgram=Qt.fromCache({context:s,vertexShaderSource:$,fragmentShaderSource:pe,attributeLocations:ee});try{ge.shaderProgram._bind()}catch{throw new me("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function ngt(e,t){if(e._decodingState===nS.READY)return!1;if(e._decodingState===nS.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,o=Mp.decodePointCloud(i,t);l(o)&&(e._decodingState=nS.DECODING,o.then(function(r){e._decodingState=nS.READY;let s=l(r.POSITION)?r.POSITION.array:void 0,a=l(r.RGB)?r.RGB.array:void 0,c=l(r.RGBA)?r.RGBA.array:void 0,d=l(r.NORMAL)?r.NORMAL.array:void 0,u=l(r.BATCH_ID)?r.BATCH_ID.array:void 0,m=l(s)&&l(r.POSITION.data.quantization),p=l(d)&&l(r.NORMAL.data.quantization);if(m){let _=r.POSITION.data.quantization,C=_.range;e._quantizedVolumeScale=h.fromElements(C,C,C),e._quantizedVolumeOffset=h.unpack(_.minValues),e._quantizedRange=(1<<_.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<r.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let y=n.styleableProperties,f=i.batchTableProperties;for(let _ in f)if(f.hasOwnProperty(_)){let C=r[_];l(y)||(y={}),y[_]={typedArray:C.array,componentCount:C.data.componentsPerAttribute}}l(s)&&(n.positions={typedArray:s});let x=g(c,a);l(x)&&(n.colors={typedArray:x}),l(d)&&(n.normals={typedArray:d}),l(u)&&(n.batchIds={typedArray:u}),n.styleableProperties=y}).catch(function(r){e._decodingState=nS.FAILED,e._error=r}))}return!0}var igt=new se,ogt=new h;D9.prototype.update=function(e){let t=e.context;if(l(this._error)){let d=this._error;throw this._error=void 0,d}if(ngt(this,t))return;let i=!1,o=!A.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,o=!0),l(this._drawCommand)||(qyt(this,e),o=!0,i=!0,this._ready=!0,this._parsedContent=void 0),o){A.clone(this.modelMatrix,this._modelMatrix);let d=this._drawCommand.modelMatrix;if(A.clone(this._modelMatrix,d),l(this._rtcCenter)&&A.multiplyByTranslation(d,this._rtcCenter,d),l(this._quantizedVolumeOffset)&&A.multiplyByTranslation(d,this._quantizedVolumeOffset,d),e.mode!==ie.SCENE3D){let m=e.mapProjection,p=A.getColumn(d,3,igt);se.equals(p,se.UNIT_W)||Xt.basisTo2D(m,d,d)}let u=this._drawCommand.boundingVolume;if(ce.clone(this._boundingSphere,u),this._cull){let m=u.center;A.multiplyByPoint(d,m,m);let p=A.getScale(d,ogt);u.radius*=h.maximumComponent(p)}}this.clippingPlanesDirty&&(this.clippingPlanesDirty=!1,i=!0),this._attenuation!==this.attenuation&&(this._attenuation=this.attenuation,i=!0),this.backFaceCulling!==this._backFaceCulling&&(this._backFaceCulling=this.backFaceCulling,i=!0),this.normalShading!==this._normalShading&&(this._normalShading=this.normalShading,i=!0),(this._style!==this.style||this.styleDirty)&&(this._style=this.style,this.styleDirty=!1,i=!0);let r=this.splitDirection!==Bc.NONE;this._splittingEnabled!==r&&(this._splittingEnabled=r,i=!0),i&&tgt(this,e,this._style),this._drawCommand.castShadows=Cn.castShadows(this.shadows),this._drawCommand.receiveShadows=Cn.receiveShadows(this.shadows);let s=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent;this._drawCommand.renderState=s?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=s?Ve.TRANSLUCENT:this._opaquePass;let a=e.commandList,c=e.passes;(c.render||c.pick)&&a.push(this._drawCommand)};D9.prototype.isDestroyed=function(){return!1};D9.prototype.destroy=function(){let e=this._drawCommand;return l(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),ue(this)};var B9=D9;var $Qi=T(S(),1);function Qd(){fe.throwInstantiationError()}Qd.computeDefaultLevelZeroMaximumGeometricError=function(e){return e.ellipsoid.maximumRadius*2*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))};Object.defineProperties(Qd.prototype,{quadtree:{get:fe.throwInstantiationError,set:fe.throwInstantiationError},tilingScheme:{get:fe.throwInstantiationError},errorEvent:{get:fe.throwInstantiationError}});Qd.prototype.update=fe.throwInstantiationError;Qd.prototype.beginUpdate=fe.throwInstantiationError;Qd.prototype.endUpdate=fe.throwInstantiationError;Qd.prototype.getLevelMaximumGeometricError=fe.throwInstantiationError;Qd.prototype.loadTile=fe.throwInstantiationError;Qd.prototype.computeTileVisibility=fe.throwInstantiationError;Qd.prototype.showTileThisFrame=fe.throwInstantiationError;Qd.prototype.computeDistanceToTile=fe.throwInstantiationError;Qd.prototype.isDestroyed=fe.throwInstantiationError;Qd.prototype.destroy=fe.throwInstantiationError;var Q8=Qd;var l4i=T(S(),1);function am(e,t,n,i,o,r,s){this.children=void 0,this.parent=o,this.level=e,this.x=t,this.y=n,this.z=i,this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new Xn,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(r,s)}var rgt=new h;am.prototype.computeBoundingVolumes=function(e,t){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let n=q.getScale(this.orientedBoundingBox.halfAxes,rgt),i=2*h.maximumComponent(n);this.approximateVoxelSize=i/h.minimumComponent(t)};am.prototype.constructChildNodes=function(e,t){let{level:n,x:i,y:o,z:r}=this,s=i*2,a=o*2,c=r*2,d=a+1,u=s+1,m=c+1,p=n+1,y=[[p,s,a,c],[p,u,a,c],[p,s,d,c],[p,u,d,c],[p,s,a,m],[p,u,a,m],[p,s,d,m],[p,u,d,m]];this.children=y.map(([f,x,_,C])=>new am(f,x,_,C,this,e,t))};am.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};am.prototype.computeScreenSpaceError=function(e,t){let n=this.orientedBoundingBox,i=Math.sqrt(n.distanceSquaredTo(e));i=Math.max(i,W.EPSILON7);let o=this.approximateVoxelSize,r=t*(o/i);this.screenSpaceError=r};var H_e={keyframe:0};function O9(e,t){return H_e.keyframe=e,Io(t,H_e,no.searchComparator)}am.prototype.computeSurroundingRenderableKeyframeNodes=function(e){let t=this,n=t.level,i=Math.floor(e),o=Math.ceil(e),r,s,a=+Number.MAX_VALUE,c=+Number.MAX_VALUE;for(;l(t);){let{renderableKeyframeNodes:m}=t;if(m.length>=1){let p=sgt(i,m),y=m[p],f=o===i||i<y.keyframe?p:Math.min(p+1,m.length-1),x=m[f],_=i-y.keyframe,C=K_e(n-t.level,_);C<a&&(a=C,r=y);let V=x.keyframe-o,L=K_e(n-t.level,V);if(L<c&&(c=L,s=x),_===0&&V===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=r,this.renderableKeyframeNodeNext=s,!l(r)||!l(s))return;let d=r.keyframe,u=s.keyframe;this.renderableKeyframeNodeLerp=d===u?0:W.clamp((e-d)/(u-d),0,1)};function sgt(e,t){let n=O9(e,t);return n<0?W.clamp(~n-1,0,t.length-1):n}function K_e(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}am.prototype.isVisited=function(e){return this.visitedFrameNumber===e};am.prototype.createKeyframeNode=function(e){let t=O9(e,this.keyframeNodes);if(t<0){t=~t;let n=new no(this,e);this.keyframeNodes.splice(t,0,n)}};am.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=O9(n,this.keyframeNodes);if(i<0)throw new fe("Keyframe node does not exist.");if(this.keyframeNodes.splice(i,1),e.megatextureIndex!==-1){for(let r=0;r<t.length;r++)t[r].remove(e.megatextureIndex);let o=O9(n,this.renderableKeyframeNodes);if(o<0)throw new fe("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(o,1)}e.spatialNode=void 0,e.state=no.LoadState.UNLOADED,e.metadatas={},e.megatextureIndex=-1,e.priority=-Number.MAX_VALUE,e.highPriorityFrameNumber=-1};am.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.state!==no.LoadState.RECEIVED||e.megatextureIndex!==-1||e.metadatas.length!==t.length)throw new fe("Keyframe node cannot be added to megatexture");for(let o=0;o<t.length;o++){let r=t[o];e.megatextureIndex=r.add(e.metadatas[o]),e.metadatas[o]=void 0}e.state=no.LoadState.LOADED;let n=this.renderableKeyframeNodes,i=O9(e.keyframe,n);if(i>=0)throw new fe("Keyframe already renderable");i=~i,n.splice(i,0,e)};am.prototype.isRenderable=function(e){let t=this.renderableKeyframeNodePrevious,n=this.renderableKeyframeNodeNext,i=this.level;return l(t)&&l(n)&&(t.spatialNode.level===i||n.spatialNode.level===i)&&this.visitedFrameNumber===e};var Y9=am;var f4i=T(S(),1);function j8(e){e=g(e,1),this._radius=g(e,1)}Object.defineProperties(j8.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});j8.prototype.emit=function(e){let t=W.randomBetween(0,W.TWO_PI),n=W.randomBetween(0,W.PI),i=W.randomBetween(0,this._radius),o=i*Math.cos(t)*Math.sin(n),r=i*Math.sin(t)*Math.sin(n),s=i*Math.cos(n);e.position=h.fromElements(o,r,s,e.position),e.velocity=h.normalize(e.position,e.velocity)};var q8=j8;var y4i=T(S(),1);function H9(){}H9.prototype.evaluate=function(e,t){fe.throwInstantiationError()};H9.prototype.evaluateColor=function(e,t){fe.throwInstantiationError()};H9.prototype.getShaderFunction=function(e,t,n,i){fe.throwInstantiationError()};H9.prototype.getVariables=function(){fe.throwInstantiationError()};var $8=H9;var S4i=T(S(),1);function aL(e){this._ready=!1,this._provider=void 0,this._errorEvent=new ye,this._readyEvent=new ye,cgt(this,e)}Object.defineProperties(aL.prototype,{errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}}});aL.fromWorldTerrain=function(e){return new aL(kT(e))};aL.fromWorldBathymetry=function(e){return new aL(qF(e))};function agt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function cgt(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){agt(e._errorEvent,i)}}var K9=aL;var L4i=T(S(),1);function cL(){}cL.prototype.boundingVolume=void 0;cL.prototype.boundingSphere=void 0;cL.prototype.distanceToCamera=function(e){fe.throwInstantiationError()};cL.prototype.intersectPlane=function(e){fe.throwInstantiationError()};cL.prototype.createDebugVolume=function(e){fe.throwInstantiationError()};var e7=cL;var W4i=T(S(),1);function z9(e){e=g(e,g.EMPTY_OBJECT),this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Oi({ellipsoid:e.ellipsoid}),this._color=g(e.color,O.YELLOW),this._errorEvent=new ye,this._tileWidth=g(e.tileWidth,256),this._tileHeight=g(e.tileHeight,256),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=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}Object.defineProperties(z9.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}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});z9.prototype.getTileCredits=function(e,t,n){};z9.prototype.requestImage=function(e,t,n,i){let o=document.createElement("canvas");o.width=256,o.height=256;let r=o.getContext("2d"),s=this._color.toCssColorString();return r.strokeStyle=s,r.lineWidth=2,r.strokeRect(1,1,255,255),r.font="bold 25px Arial",r.textAlign="center",r.fillStyle=s,r.fillText(`L: ${n}`,124,86),r.fillText(`X: ${e}`,124,136),r.fillText(`Y: ${t}`,124,186),Promise.resolve(o)};z9.prototype.pickFeatures=function(e,t,n,i,o){};var J9=z9;var w4i=T(S(),1);function t7(e){fe.throwInstantiationError()}t7.prototype.isReady=fe.throwInstantiationError;t7.prototype.shouldDiscardImage=fe.throwInstantiationError;var n7=t7;var A4i=T(S(),1),lgt={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3},i7=Object.freeze(lgt);var tji=T(S(),1);function oS(e){e=g(e,g.EMPTY_OBJECT),this.show=g(e.show,!0),this.modelMatrix=A.clone(g(e.modelMatrix,A.IDENTITY)),this.shadows=g(e.shadows,Cn.ENABLED),this.maximumMemoryUsage=g(e.maximumMemoryUsage,256),this.shading=new af(e.shading),this.style=e.style,this.frameFailed=new ye,this.frameChanged=new ye,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new Op,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._runningSum=0,this._runningLength=0,this._runningIndex=0,this._runningSamples=new Array(5).fill(0),this._runningAverage=0}Object.defineProperties(oS.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){ys.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function dgt(e){return`uniform vec4 czm_pickColor;
${e}`}function ugt(e){return function(t){return Tt(t,{czm_pickColor:function(){return e._pickId.color}})}}function mgt(){return"czm_pickColor"}oS.prototype.makeStyleDirty=function(){this._styleDirty=!0};oS.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var hgt=new te;function r7(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function iS(e,t){return e._intervals.indexOf(t.start)}function fgt(e,t){let n=e._intervals,i=e._clock,o=r7(e);if(o===0)return;let r=e._getAverageLoadTime(),s=te.addSeconds(i.currentTime,r*o,hgt),a=n.indexOf(s),c=iS(e,t);return a===c&&(o>=0?++a:--a),n.get(a)}function pgt(e){let t=e._intervals,i=e._clock.currentTime,o=t.indexOf(i);return t.get(o)}function bgt(e,t,n){let i=r7(e),o=iS(e,t),r=iS(e,n);return i>=0?o>=r:o<=r}function J_e(e,t){return function(n){let i=l(n.message)?n.message:n.toString();e.frameFailed.numberOfListeners>0?e.frameFailed.raiseEvent({uri:t,message:i}):(console.log(`A frame failed to load: ${t}`),console.log(`Error: ${i}`))}}function ygt(e,t,n){let i=iS(e,t),o=e._frames,r=o[i];if(!l(r)){let s=t.data.transform,a=l(s)?A.fromArray(s):void 0,c=t.data.uri;r={pointCloud:void 0,transform:a,timestamp:xi(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:c},o[i]=r,Xe.fetchArrayBuffer({url:c}).then(function(d){r.pointCloud=new B9({arrayBuffer:d,cull:!0,fragmentShaderLoaded:dgt,uniformMapLoaded:ugt(e),pickIdLoaded:mgt})}).catch(J_e(e,c))}return r}function ggt(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 xgt(e,t,n,i){t.touchedFrameNumber<i.frameNumber-1&&(t.sequential=!1);let o=t.pointCloud;if(l(o)&&!t.ready){let r=i.commandList,s=r.length;if(Q_e(e,t,n,i),o.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=o.geometryByteLength,r.length=s,t.sequential)){let a=(xi()-t.timestamp)/1e3;ggt(e,a)}}t.touchedFrameNumber=i.frameNumber}var _gt=new A;function Tgt(e,t){let n=e.shading;return l(n)&&l(n.baseResolution)?n.baseResolution:l(t.boundingSphere)?W.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function Sgt(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var Cgt=new af;function Q_e(e,t,n,i){let o=g(e.shading,Cgt),r=t.pointCloud,s=g(t.transform,A.IDENTITY);r.modelMatrix=A.multiplyTransformation(e.modelMatrix,s,_gt),r.style=e.style,r.time=n.timeSinceLoad,r.shadows=e.shadows,r.clippingPlanes=e._clippingPlanes,r.isClipped=n.isClipped,r.attenuation=o.attenuation,r.backFaceCulling=o.backFaceCulling,r.normalShading=o.normalShading,r.geometricError=Tgt(e,r),r.geometricErrorScale=o.geometricErrorScale,r.maximumAttenuation=Sgt(e);try{r.update(i)}catch(a){J_e(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function o7(e,t,n,i){let o=ygt(e,t,i);xgt(e,o,n,i)}function Vgt(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function j_e(e,t){let n=e._frames,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(l(r)&&(!l(t)||t(r))){let s=r.pointCloud;r.ready&&(e._totalMemoryUsageInBytes-=s.geometryByteLength),l(s)&&s.destroy(),r===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),n[o]=void 0}}}function Lgt(e,t){let n=iS(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function z_e(e,t,n,i,o){return l(n)?n.ready?!0:(o7(e,t,i,o),n.ready):!1}function Rgt(e,t,n,i,o){let r,s,a,c=e._intervals,d=e._frames,u=iS(e,n),m=iS(e,t);if(u>=m){for(r=u;r>=m;--r)if(s=c.get(r),a=d[r],z_e(e,s,a,i,o))return s}else for(r=u;r<=m;++r)if(s=c.get(r),a=d[r],z_e(e,s,a,i,o))return s;return t}function Zgt(e,t,n){let i=e._frames,o=i.length;for(let r=0;r<o;++r){let s=i[r];l(s)&&l(s.pointCloud)&&(s.pointCloud.clippingPlanesDirty=t,s.pointCloud.styleDirty=n)}}var lL={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};oS.prototype.update=function(e){if(e.mode===ie.MORPHING||!this.show)return;l(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),l(this._loadTimestamp)||(this._loadTimestamp=te.clone(e.time));let t=Math.max(te.secondsDifference(e.time,this._loadTimestamp)*1e3,0),n=this._clippingPlanes,i=0,o=!1,r=l(n)&&n.enabled;r&&(n.update(e),i=n.clippingPlanesState),this._clippingPlanesState!==i&&(this._clippingPlanesState=i,o=!0);let s=this._styleDirty;this._styleDirty=!1,(o||s)&&Zgt(this,o,s),lL.timeSinceLoad=t,lL.isClipped=r;let a=this.shading,c=this._pointCloudEyeDomeLighting,d=e.commandList,u=d.length,m=this._previousInterval,p=this._nextInterval,y=pgt(this);if(!l(y))return;let f=!1,x=r7(this),_=x===0;x!==this._clockMultiplier&&(f=!0,this._clockMultiplier=x),(!l(m)||_)&&(m=y),(!l(p)||f||bgt(this,y,p))&&(p=fgt(this,y)),m=Rgt(this,m,y,lL,e);let C=Lgt(this,m);l(C)||(o7(this,m,lL,e),C=this._lastRenderedFrame),l(C)&&Q_e(this,C,lL,e),l(p)&&o7(this,p,lL,e);let V=this;l(C)&&!l(this._lastRenderedFrame)&&e.afterRender.push(function(){return!0}),l(C)&&C!==this._lastRenderedFrame&&V.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return V.frameChanged.raiseEvent(V),!0}),this._previousInterval=m,this._nextInterval=p,this._lastRenderedFrame=C;let L=this._totalMemoryUsageInBytes,Z=this.maximumMemoryUsage*1024*1024;L>Z&&j_e(this,Vgt(e));let I=d.length-u;l(a)&&a.attenuation&&a.eyeDomeLighting&&I>0&&c.update(e,u,a,this.boundingSphere)};oS.prototype.isDestroyed=function(){return!1};oS.prototype.destroy=function(){return j_e(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),ue(this)};var dL=oS;var hji=T(S(),1);function mB(e,t){this.show=!0,l(e)||(e=new De),this.rectangle=De.clone(e),l(t)||(t=Bi.fromType(Bi.ColorType,{color:new O(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}mB.prototype.update=function(e){if(!this.show)return;let t=this._rs;if((!l(t)||!De.equals(t.viewport,this.rectangle))&&(this._rs=ke.fromCache({blending:mn.ALPHA_BLEND,viewport:this.rectangle})),e.passes.render){let i=e.context;if(this._material!==this.material||!l(this._overlayCommand)){this._material=this.material,l(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();let o=new Oe({sources:[this._material.shaderSource,zv]});this._overlayCommand=i.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=Ve.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};mB.prototype.isDestroyed=function(){return!1};mB.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),ue(this)};var s7=mB;var L8i=T(S(),1);var Wji=T(S(),1);function Rg(e,t,n,i,o,r,s){this._primitive=e;let a=i.length;this.megatextures=new Array(a);for(let x=0;x<a;x++){let _=i[x],C=Ht.getComponentCount(_),V=o[x];this.megatextures[x]=new oL(t,n,C,V,s)}let c=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._frameNumber=0;let d=e._shape;this.rootNode=new Y9(0,0,0,0,void 0,d,n),this._priorityQueue=new DT({maximumLength:c,comparator:no.priorityComparator}),this._highPriorityKeyframeNodes=new Array(c),this._keyframeNodesInMegatexture=new Array(c),this._keyframeCount=r,this._sampleCount=void 0,this._keyframeLocation=0,this._binaryTreeKeyframeWeighting=new Array(r);let u=this._binaryTreeKeyframeWeighting;u[0]=0,u[r-1]=0,a7(u,1,r-2,0);let m=9,p=2048,y=Math.floor(p/m),f=Math.ceil(c/y);this.internalNodeTexture=new wt({context:t,pixelFormat:at.RGBA,pixelDatatype:je.UNSIGNED_BYTE,flipY:!1,width:p,height:f,sampler:new hn({minificationFilter:dn.NEAREST,magnificationFilter:Ti.NEAREST})}),this.internalNodeTilesPerRow=y,this.internalNodeTexelSizeUv=new B(1/p,1/f),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new B}function a7(e,t,n,i){if(t>n)return;let o=Math.floor((t+n)/2);e[o]=i,a7(e,t,o-1,i+1),a7(e,o+1,n,i+1)}Rg.simultaneousRequestCountMaximum=50;Rg.prototype.update=function(e,t,n,i){let o=this._primitive,r=e.context,s=this.megatextures[0].maximumTileCount,a=this._keyframeCount,c=o._levelBlendFactor,d=c>0,u=a>1,m=(d?2:1)*(u?2:1);this._sampleCount=m;let p=m>=2;if(p&&!l(this.leafNodeTexture)){let V=Math.floor(512),L=Math.ceil(s/V);this.leafNodeTexture=new wt({context:r,pixelFormat:at.RGBA,pixelDatatype:je.UNSIGNED_BYTE,flipY:!1,width:1024,height:L,sampler:new hn({minificationFilter:dn.NEAREST,magnificationFilter:Ti.NEAREST})}),this.leafNodeTexelSizeUv=B.fromElements(1/1024,1/L,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=V}else!p&&l(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=W.clamp(t,0,a-1),n&&q_e(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let y=xi();Igt(this,e);let f=xi();Wgt(this,m,c);let x=xi();if(this._debugPrint){let _=f-y,C=x-f,V=x-y;Xgt(this,_,C,V)}};Rg.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};Rg.prototype.isDestroyed=function(){return!1};Rg.prototype.destroy=function(){let e=this.megatextures,t=e.length;for(let n=0;n<t;n++)e[n]=e[n]&&e[n].destroy();return this.internalNodeTexture=this.internalNodeTexture&&this.internalNodeTexture.destroy(),this.leafNodeTexture=this.leafNodeTexture&&this.leafNodeTexture.destroy(),ue(this)};function q_e(e,t){let n=e._primitive,i=n._shape,o=n._provider.dimensions;if(t.computeBoundingVolumes(i,o),l(t.children))for(let r=0;r<8;r++){let s=t.children[r];q_e(e,s)}}function Ggt(e,t){if(e._simultaneousRequestCount>=Rg.simultaneousRequestCountMaximum)return;let n=e._primitive,i=n._provider;function o(d){e._simultaneousRequestCount--;let u=n._provider.types.length;if(!l(d))t.state=no.LoadState.UNAVAILABLE;else if(d===no.LoadState.FAILED)t.state=no.LoadState.FAILED;else if(!Array.isArray(d)||d.length!==u)t.state=no.LoadState.FAILED;else{let m=e.megatextures;for(let p=0;p<u;p++){let{voxelCountPerTile:y,channelCount:f}=m[p],{x,y:_,z:C}=y,V=x*_*C,L=d[p],Z=V*f;if(L.length===Z)t.metadatas[p]=L,t.state=no.LoadState.RECEIVED;else{t.state=no.LoadState.FAILED;break}}}}function r(){e._simultaneousRequestCount--,t.state=no.LoadState.FAILED}let{keyframe:s,spatialNode:a}=t,c=i.requestData({tileLevel:a.level,tileX:a.x,tileY:a.y,tileZ:a.z,keyframe:s});l(c)?(e._simultaneousRequestCount++,t.state=no.LoadState.RECEIVING,c.then(o).catch(r)):t.state=no.LoadState.FAILED}function Egt(e){return e/(1+e)}function Igt(e,t){let n=e._frameNumber,i=e._primitive,o=i._shape,{dimensions:r}=i,s=i.screenSpaceError,a=e._priorityQueue,c=e._keyframeLocation,d=e._keyframeCount,u=e.rootNode,{camera:m,context:p,pixelRatio:y}=t,{positionWC:f,frustum:x}=m,C=p.drawingBufferHeight/y/x.sseDenominator;function V(R,E,X){let w=Math.min(Math.abs(E-R),Math.abs(E-X)),N=Math.max(R,d-X-1,1),D=Math.pow(1-w/N,4),k=Math.exp(-e._binaryTreeKeyframeWeighting[E]);return W.lerp(k,D,.15+.85*D)}function L(R,E){if(R.computeScreenSpaceError(f,C),E=R.visibility(t,E),E===as.MASK_OUTSIDE)return;R.visitedFrameNumber=n;let X=W.clamp(Math.floor(c),0,d-2),w=X+1;if(d===1)R.createKeyframeNode(0);else if(R.keyframeNodes.length!==d)for(let U=0;U<d;U++)R.createKeyframeNode(U);let N=Egt(R.screenSpaceError),D=!1,k=R.keyframeNodes;for(let U=0;U<k.length;U++){let J=k[U];J.priority=10*N+V(X,J.keyframe,w),J.state!==no.LoadState.UNAVAILABLE&&J.state!==no.LoadState.FAILED&&J.priority!==-Number.MAX_VALUE&&a.insert(J),J.state===no.LoadState.LOADED&&(D=!0)}if(R.screenSpaceError<s||!D){R.children=void 0;return}l(R.children)||R.constructChildNodes(o,r);for(let U=0;U<8;U++){let J=R.children[U];L(J,E)}}a.reset(),L(u,as.MASK_INDETERMINATE);let Z=e._highPriorityKeyframeNodes,G=0,I;for(;a.length>0;)I=a.removeMaximum(),I.highPriorityFrameNumber=n,Z[G]=I,G++;let P=e._keyframeNodesInMegatexture,v=e.megatextures[0],F=v.occupiedCount;P.length=F,P.sort(function(R,E){return R.highPriorityFrameNumber===E.highPriorityFrameNumber?E.priority-R.priority:E.highPriorityFrameNumber-R.highPriorityFrameNumber});let M=0,b=0;for(let R=0;R<G;R++)if(I=Z[R],!(I.state===no.LoadState.LOADED||I.spatialNode===void 0)&&(I.state===no.LoadState.UNLOADED&&Ggt(e,I),I.state===no.LoadState.RECEIVED)){let E=0;if(v.isFull()){E=F-1-M,M++;let X=P[E];X.spatialNode.destroyKeyframeNode(X,e.megatextures)}else E=F+b,b++;I.spatialNode.addKeyframeNodeToMegatextures(I,e.megatextures),P[E]=I}}function Xgt(e,t,n,i){let o=e._keyframeCount,r=e.rootNode,s=Object.keys(no.LoadState).length,a=new Array(s),c=new Array(s),d=0;for(let C=0;C<s;C++){let V=new Array(o);a[C]=V;for(let L=0;L<o;L++)V[L]=0;c[C]=0}function u(C){let V=C.keyframeNodes;for(let L=0;L<V.length;L++){let Z=V[L],G=Z.keyframe,I=Z.state;a[I][G]+=1,c[I]+=1,d++}if(l(C.children))for(let L=0;L<8;L++){let Z=C.children[L];u(Z)}}u(r);let m=`KEYFRAMES: ${a[no.LoadState.LOADED]}`,p=`UNLOADED: ${c[no.LoadState.UNLOADED]} | RECEIVING: ${c[no.LoadState.RECEIVING]} | RECEIVED: ${c[no.LoadState.RECEIVED]} | LOADED: ${c[no.LoadState.LOADED]} | FAILED: ${c[no.LoadState.FAILED]} | UNAVAILABLE: ${c[no.LoadState.UNAVAILABLE]} | TOTAL: ${d}`,y=Math.round(t*100)/100,f=Math.round(n*100)/100,x=Math.round(i*100)/100,_=`LOAD: ${y} | OCT: ${f} | ALL: ${x}`;console.log(`${m} || ${p} || ${_}`)}var hB={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function Wgt(e,t,n){let i=e._primitive._screenSpaceError,o=e._keyframeLocation,r=e._frameNumber,s=t>=2,a=0,c=0,d=[],u=[];function m(y,f,x,_,C){let V=!1;if(l(y.children))for(let L=0;L<8;L++){let Z=y.children[L];Z.computeSurroundingRenderableKeyframeNodes(o),Z.isRenderable(r)&&(V=!0)}if(V){d[C]=hB.INTERNAL<<16|f,d[x]=_,a++,_=f,C=_*9+1;for(let L=0;L<8;L++){let Z=y.children[L];f=a,x=f*9+0,m(Z,f,x,_,C+L)}}else{if(s){let L=c*5,Z=y.renderableKeyframeNodePrevious,G=y.level-Z.spatialNode.level,I=Z.spatialNode.parent,P=l(I)?I.renderableKeyframeNodePrevious:Z,v=Pgt(y,i,n),F=G,M=1,b=Z.megatextureIndex,R=P.megatextureIndex;u[L+0]=v,u[L+1]=F,u[L+2]=M,u[L+3]=b,u[L+4]=R,d[C]=hB.LEAF<<16|c}else{let L=y.renderableKeyframeNodePrevious,G=y.level-L.spatialNode.level===0?hB.LEAF:hB.PACKED_LEAF_FROM_PARENT;d[C]=G<<16|L.megatextureIndex}c++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(o),p.isRenderable(r)&&m(p,0,0,0,0),vgt(d,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&wgt(u,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function Pgt(e,t,n){if(e.parent===void 0)return 0;let i=e.screenSpaceError,o=e.parent.screenSpaceError,s=((t-i)/(o-i)+n-1)/n;return W.clamp(s,0,1)}function vgt(e,t,n,i){let o=at.componentsLength(i.pixelFormat),r=Math.ceil(e.length/t),s=Math.max(1,t*Math.min(r,n)),a=Math.max(1,Math.ceil(r/n)),c=new Uint8Array(s*a*o);for(let m=0;m<e.length;m++){let p=e[m],y=m*o;for(let f=0;f<o;f++)c[y+f]=p>>>f*8&255}let u={source:{arrayBufferView:c,width:s,height:a},xOffset:0,yOffset:0};i.copyFrom(u)}function wgt(e,t,n,i){let o=at.componentsLength(i.pixelFormat),r=5,s=Math.ceil(e.length/r),a=Math.max(1,t*Math.min(s,n)),c=Math.max(1,Math.ceil(s/n)),d=new Uint8Array(a*c*o);for(let p=0;p<s;p++){let y=e[p*r+0],f=e[p*r+1],x=e[p*r+2],_=e[p*r+3],C=e[p*r+4],V=W.clamp(Math.floor(65536*y),0,65535);d[p*8+0]=V>>>0&255,d[p*8+1]=V>>>8&255,d[p*8+2]=f&255,d[p*8+3]=x&255,d[p*8+4]=_>>>0&255,d[p*8+5]=_>>>8&255,d[p*8+6]=C>>>0&255,d[p*8+7]=C>>>8&255}let m={source:{arrayBufferView:d,width:a,height:c},xOffset:0,yOffset:0};i.copyFrom(m)}Rg.getApproximateTextureMemoryByteLength=function(e,t,n,i){let o=0,r=n.length;for(let s=0;s<r;s++){let a=n[s],c=i[s],d=Ht.getComponentCount(a);o+=oL.getApproximateTextureMemoryByteLength(e,t,d,c)}return o};var uL=Rg;var t8i=T(S(),1);var vji=T(S(),1),Fgt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},mL=Object.freeze(Fgt);var Yji=T(S(),1);function hL(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}hL.prototype.getTexture=function(e){return this._textures[e]};function Agt(e,t,n){n.resource.fetchImage().then(function(i){e._loadedImages.push({id:t,image:i,textureUniform:n})}).catch(function(){let i=e._textures[t];l(i)&&i!==e._defaultTexture&&i.destroy(),e._textures[t]=e._defaultTexture})}hL.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):Agt(this,e,t)};function Mgt(e,t,n){let{id:i,textureUniform:o,image:r}=t,s=n.webgl2?fB(o,r,n):Ngt(o,r,n),a=e._textures[i];l(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function fB(e,t,n){let{typedArray:i,sampler:o}=e,r=l(i)?eTe(e,n):new wt({context:n,source:t,sampler:o});return $_e(o)&&r.generateMipmap(),r}function Ngt(e,t,n){let{typedArray:i,sampler:o}=e,r=$_e(o),s=o.wrapS===In.REPEAT||o.wrapS===In.MIRRORED_REPEAT||o.wrapT===In.REPEAT||o.wrapT===In.MIRRORED_REPEAT,{width:a,height:c}=l(i)?e:t,d=[a,c].every(W.isPowerOfTwo);if((r||s)&&!d)if(l(i)){if(e.pixelDatatype===je.UNSIGNED_BYTE){let m=t9(i,a,c),p=Yb(m);return fB({sampler:o},p,n)}}else{let m=Yb(t);return fB(e,m,n)}else return fB(e,t,n);return r?console.warn("Texture requires resizing for mipmaps but pixelDataType cannot be resized. The texture may be rendered incorrectly."):s&&console.warn("Texture requires resizing for wrapping but pixelDataType cannot be resized. The texture may be rendered incorrectly."),eTe(e,n)}function $_e(e){return[dn.NEAREST_MIPMAP_NEAREST,dn.NEAREST_MIPMAP_LINEAR,dn.LINEAR_MIPMAP_NEAREST,dn.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function eTe(e,t){let{pixelFormat:n,pixelDatatype:i,width:o,height:r,typedArray:s,sampler:a}=e;return new wt({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:s,width:o,height:r},sampler:a,flipY:!1})}hL.prototype.update=function(e){if(e.frameNumber===this._lastUpdatedFrame)return;this._lastUpdatedFrame=e.frameNumber;let t=e.context;this._defaultTexture=t.defaultTexture;let n=this._loadedImages;for(let i=0;i<n.length;i++){let o=n[i];Mgt(this,o,t)}n.length=0};hL.prototype.isDestroyed=function(){return!1};hL.prototype.destroy=function(){let e=this._textures;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];n!==this._defaultTexture&&n.destroy()}return ue(this)};var Q9=hL;function j9(e){e=g(e,g.EMPTY_OBJECT),this.mode=g(e.mode,qp.MODIFY_MATERIAL),this.lightingModel=e.lightingModel,this.uniforms=g(e.uniforms,g.EMPTY_OBJECT),this.varyings=g(e.varyings,g.EMPTY_OBJECT),this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=g(e.translucencyMode,iy.INHERIT),this._textureManager=new Q9,this._defaultTexture=void 0,this.uniformMap=Ugt(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},Bgt(this),Ogt(this)}function Ugt(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let o=t[i];o.type===mL.SAMPLER_2D?(e._textureManager.loadTexture2D(i,o.value),n[i]=kgt(e,i)):n[i]=Dgt(e,i)}return n}function kgt(e,t){return function(){return g(e._textureManager.getTexture(t),e._defaultTexture)}}function Dgt(e,t){return function(){return e.uniforms[t].value}}function rS(e,t,n){let i;for(;(i=t.exec(e))!==null;){let o=i[1];n[o]=!0}}function Bgt(e){let t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.metadata.(\w+)/g,o,r=e.vertexShaderText;l(r)&&(o=e.usedVariablesVertex.attributeSet,rS(r,t,o),o=e.usedVariablesVertex.featureIdSet,rS(r,n,o),o=e.usedVariablesVertex.metadataSet,rS(r,i,o));let s=e.fragmentShaderText;if(l(s)){o=e.usedVariablesFragment.attributeSet,rS(s,t,o),o=e.usedVariablesFragment.featureIdSet,rS(s,n,o),o=e.usedVariablesFragment.metadataSet,rS(s,i,o);let a=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;rS(s,a,c)}}function tTe(e){let t=/^.*MC$/,n=/^.*WC$/,i=/^.*EC$/;return t.test(e)?`${e} (model coordinates)`:n.test(e)?`${e} (Cartesian world coordinates)`:i.test(e)?`${e} (eye coordinates)`:e}function Lc(e,t,n,i){if(e.hasOwnProperty(t)){let o=`${tTe(t)} is not available in the ${i} shader. Did you mean ${tTe(n)} instead?`;throw new fe(o)}}function Ogt(e){let t=e.usedVariablesVertex.attributeSet;Lc(t,"position","positionMC","vertex"),Lc(t,"normal","normalMC","vertex"),Lc(t,"tangent","tangentMC","vertex"),Lc(t,"bitangent","bitangentMC","vertex"),Lc(t,"positionWC","positionMC","vertex"),Lc(t,"positionEC","positionMC","vertex"),Lc(t,"normalEC","normalMC","vertex"),Lc(t,"tangentEC","tangentMC","vertex"),Lc(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;Lc(n,"position","positionEC","fragment"),Lc(n,"normal","normalEC","fragment"),Lc(n,"tangent","tangentEC","fragment"),Lc(n,"bitangent","bitangentEC","fragment"),Lc(n,"normalMC","normalEC","fragment"),Lc(n,"tangentMC","tangentEC","fragment"),Lc(n,"bitangentMC","bitangentEC","fragment")}j9.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===mL.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};j9.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};j9.prototype.isDestroyed=function(){return!1};j9.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),ue(this)};var sS=j9;function $f(e){e=g(e,g.EMPTY_OBJECT),this._ready=!1,this._provider=g(e.provider,$f.DefaultProvider),this._traversal=void 0,this._shape=void 0,this._shapeVisible=!1,this._paddingBefore=new h,this._paddingAfter=new h,this._minBounds=new h,this._minBoundsOld=new h,this._maxBounds=new h,this._maxBoundsOld=new h,this._exaggeratedMinBounds=new h,this._exaggeratedMinBoundsOld=new h,this._exaggeratedMaxBounds=new h,this._exaggeratedMaxBoundsOld=new h,this._minClippingBounds=new h,this._minClippingBoundsOld=new h,this._maxClippingBounds=new h,this._maxClippingBoundsOld=new h,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=A.clone(g(e.modelMatrix,A.IDENTITY)),this._compoundModelMatrix=new A,this._compoundModelMatrixOld=new A,this._customShader=g(e.customShader,$f.DefaultCustomShader),this._customShaderCompilationEvent=new ye,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=e.clock,this._transformPositionWorldToUv=new A,this._transformPositionUvToWorld=new A,this._transformDirectionWorldToLocal=new q,this._transformNormalLocalToWorld=new q,this._stepSizeUv=1,this._jitter=!0,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new Om,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1,this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new B,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new B,megatextureTextures:[],megatextureSliceDimensions:new B,megatextureTileDimensions:new B,megatextureVoxelSizeUv:new B,megatextureSliceSizeUv:new B,megatextureTileSizeUv:new B,dimensions:new h,paddingBefore:new h,paddingAfter:new h,transformPositionViewToUv:new A,transformPositionUvToView:new A,transformDirectionViewToLocal:new q,transformNormalLocalToWorld:new q,cameraPositionUv:new h,ndcSpaceAxisAlignedBoundingBox:new se,clippingPlanesTexture:void 0,clippingPlanesMatrix:new A,stepSize:0,pickColor:new O},this._shapeDefinesOld={},this._uniformMap={};let t=this._uniforms,n=this._uniformMap;for(let o in t)if(t.hasOwnProperty(o)){let r=`u_${o}`;n[r]=function(){return t[o]}}let i=this._provider;Ygt(this,i)}function Ygt(e,t){let{shape:n,minBounds:i=Ui.getMinBounds(n),maxBounds:o=Ui.getMaxBounds(n)}=t;e.minBounds=i,e.maxBounds=o,e.minClippingBounds=Ui.getMinBounds(n),e.maxClippingBounds=Ui.getMaxBounds(n),oTe(e,t);let r=Ui.getShapeConstructor(n);e._shape=new r,iTe(e),e._shapeVisible=rTe(e,e._shape,t)}Object.defineProperties($f.prototype,{ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}},boundingSphere:{get:function(){return this._shape.boundingSphere}},orientedBoundingBox:{get:function(){return this.shape.orientedBoundingBox}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=A.clone(e,this._modelMatrix)}},shape:{get:function(){return this._provider.shape}},dimensions:{get:function(){return this._provider.dimensions}},minimumValues:{get:function(){return this._provider.minimumValues}},maximumValues:{get:function(){return this._provider.maximumValues}},show:{get:function(){return!this._disableRender},set:function(e){this._disableRender=!e}},disableUpdate:{get:function(){return this._disableUpdate},set:function(e){this._disableUpdate=e}},debugDraw:{get:function(){return this._debugDraw},set:function(e){this._debugDraw=e}},depthTest:{get:function(){return this._depthTest},set:function(e){this._depthTest!==e&&(this._depthTest=e,this._shaderDirty=!0)}},jitter:{get:function(){return this._jitter},set:function(e){this._jitter!==e&&(this._jitter=e,this._shaderDirty=!0)}},nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling!==e&&(this._nearestSampling=e,this._shaderDirty=!0)}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(e){this._levelBlendFactor=W.clamp(e,0,1)}},screenSpaceError:{get:function(){return this._screenSpaceError},set:function(e){this._screenSpaceError=e}},stepSize:{get:function(){return this._stepSizeMultiplier},set:function(e){this._stepSizeMultiplier=e}},minBounds:{get:function(){return this._minBounds},set:function(e){this._minBounds=h.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){this._maxBounds=h.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){this._minClippingBounds=h.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){this._maxClippingBounds=h.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){ys.setOwner(e,this,"_clippingPlanes")}},customShader:{get:function(){return this._customShader},set:function(e){if(this._customShader!==e){let t=this._uniformMap,i=this._customShader.uniformMap;for(let o in i)i.hasOwnProperty(o)&&delete t[o];l(e)?this._customShader=e:this._customShader=$f.DefaultCustomShader,this._shaderDirty=!0}}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}}});var Hgt=new h,Kgt=new se,zgt=new se,Jgt=new h,Qgt=new h,jgt=new q,qgt=new q,$gt=new A,ext=new A,txt=new A,nxt=A.fromRotationTranslation(q.fromUniformScale(.5,new q),new h(.5,.5,.5),new A),ixt=A.fromRotationTranslation(q.fromUniformScale(2,new q),new h(-1,-1,-1),new A);$f.prototype.update=function(e){let t=this._provider;this._customShader.update(e);let n=e.context;if(!this._ready){oxt(this,t,n),e.afterRender.push(()=>(this._ready=!0,!0));return}iTe(this,e);let i=oTe(this,t),o=this._shape;if(i&&(this._shapeVisible=rTe(this,o,t),axt(this,o)&&(this._shaderDirty=!0)),!this._shapeVisible)return;let r=cxt(t.timeIntervalCollection,this._clock),s=this._traversal,a=s._sampleCount;if(s.update(e,r,i,this._disableUpdate),a!==s._sampleCount&&(this._shaderDirty=!0),!s.isRenderable(s.rootNode)||(this._debugDraw&&bxt(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),lxt(this,e)&&(this._shaderDirty=!0);let d=s.leafNodeTexture,u=this._uniforms;l(d)&&(u.octreeLeafNodeTexture=s.leafNodeTexture,u.octreeLeafNodeTexelSizeUv=B.clone(s.leafNodeTexelSizeUv,u.octreeLeafNodeTexelSizeUv),u.octreeLeafNodeTilesPerRow=s.leafNodeTilesPerRow),this._shaderDirty&&(V9(this,n),this._shaderDirty=!1);let m=n.uniformState.viewProjection,p=o.orientedBoundingBox,y=mxt(p,m,zgt);if(y.x===1||y.y===1||y.z===-1||y.w===-1)return;u.ndcSpaceAxisAlignedBoundingBox=se.clone(y,u.ndcSpaceAxisAlignedBoundingBox);let x=n.uniformState.inverseView;u.transformPositionViewToUv=A.multiplyTransformation(this._transformPositionWorldToUv,x,u.transformPositionViewToUv);let _=n.uniformState.view;u.transformPositionUvToView=A.multiplyTransformation(_,this._transformPositionUvToWorld,u.transformPositionUvToView);let C=n.uniformState.inverseViewRotation;u.transformDirectionViewToLocal=q.multiply(this._transformDirectionWorldToLocal,C,u.transformDirectionViewToLocal),u.transformNormalLocalToWorld=q.clone(this._transformNormalLocalToWorld,u.transformNormalLocalToWorld);let V=e.camera.positionWC;u.cameraPositionUv=A.multiplyByPoint(this._transformPositionWorldToUv,V,u.cameraPositionUv),u.stepSize=this._stepSizeUv*this._stepSizeMultiplier;let L=e.passes.pick?this._drawCommandPick:this._drawCommand;L.boundingVolume=o.boundingSphere,e.commandList.push(L)};function iTe(e,t){if(e._exaggeratedMinBounds=h.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=h.clone(e._maxBounds,e._exaggeratedMaxBounds),l(t)&&e.shape===Ui.ELLIPSOID){let n=t.verticalExaggerationRelativeHeight,i=t.verticalExaggeration;e._exaggeratedMinBounds.z=(e._minBounds.z-n)*i+n,e._exaggeratedMaxBounds.z=(e._maxBounds.z-n)*i+n}}function oxt(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=O.clone(e._pickId.color,i.pickColor);let{shaderDefines:o,shaderUniforms:r}=e._shape;e._shapeDefinesOld=ze(o,!0);let s=e._uniformMap;for(let a in r)if(r.hasOwnProperty(a)){let c=`u_${a}`;s[c]=function(){return r[a]}}i.dimensions=h.clone(t.dimensions,i.dimensions),e._paddingBefore=h.clone(g(t.paddingBefore,h.ZERO),e._paddingBefore),i.paddingBefore=h.clone(e._paddingBefore,i.paddingBefore),e._paddingAfter=h.clone(g(t.paddingAfter,h.ZERO),e._paddingBefore),i.paddingAfter=h.clone(e._paddingAfter,i.paddingAfter),e._traversal=rxt(e,t,n),sxt(e._traversal,i)}function oTe(e,t){let n=g(t.shapeTransform,A.IDENTITY),i=g(t.globalTransform,A.IDENTITY);return A.multiplyTransformation(i,e._modelMatrix,e._compoundModelMatrix),A.multiplyTransformation(e._compoundModelMatrix,n,e._compoundModelMatrix),aS(e,"_compoundModelMatrix","_compoundModelMatrixOld")+aS(e,"_minBounds","_minBoundsOld")+aS(e,"_maxBounds","_maxBoundsOld")+aS(e,"_exaggeratedMinBounds","_exaggeratedMinBoundsOld")+aS(e,"_exaggeratedMaxBounds","_exaggeratedMaxBoundsOld")+aS(e,"_minClippingBounds","_minClippingBoundsOld")+aS(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function aS(e,t,n){let i=e[t],o=e[n],r=!i.equals(o);return r&&i.clone(o),r?1:0}function rTe(e,t,n){if(!t.update(e._compoundModelMatrix,e._exaggeratedMinBounds,e._exaggeratedMaxBounds,e.minClippingBounds,e.maxClippingBounds))return!1;let o=t.shapeTransform,r=A.inverse(o,$gt),s=A.getRotation(o,jgt),a=A.getScale(o,Jgt),c=h.maximumComponent(a),d=h.divideByScalar(a,c,Qgt),u=q.multiplyByScale(s,d,qgt),m=n.dimensions;return e._stepSizeUv=t.computeApproximateStepSize(m),e._transformPositionWorldToUv=A.multiplyTransformation(nxt,r,e._transformPositionWorldToUv),e._transformPositionUvToWorld=A.multiplyTransformation(o,ixt,e._transformPositionUvToWorld),e._transformDirectionWorldToLocal=A.getMatrix3(r,e._transformDirectionWorldToLocal),e._transformNormalLocalToWorld=q.inverseTranspose(u,e._transformNormalLocalToWorld),!0}function rxt(e,t,n){let i=h.clone(t.dimensions,Hgt);h.add(i,e._paddingBefore,i),h.add(i,e._paddingAfter,i);let o=t.maximumTileCount,r=l(o)?uL.getApproximateTextureMemoryByteLength(o,i,t.types,t.componentTypes):void 0,s=g(t.keyframeCount,1);return new uL(e,n,i,t.types,t.componentTypes,s,r)}function sxt(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=B.clone(e.internalNodeTexelSizeUv,t.octreeInternalNodeTexelSizeUv),t.octreeInternalNodeTilesPerRow=e.internalNodeTilesPerRow;let n=e.megatextures,i=n[0],o=n.length;t.megatextureTextures=new Array(o);for(let r=0;r<o;r++)t.megatextureTextures[r]=n[r].texture;t.megatextureSliceDimensions=B.clone(i.sliceCountPerRegion,t.megatextureSliceDimensions),t.megatextureTileDimensions=B.clone(i.regionCountPerMegatexture,t.megatextureTileDimensions),t.megatextureVoxelSizeUv=B.clone(i.voxelSizeUv,t.megatextureVoxelSizeUv),t.megatextureSliceSizeUv=B.clone(i.sliceSizeUv,t.megatextureSliceSizeUv),t.megatextureTileSizeUv=B.clone(i.regionSizeUv,t.megatextureTileSizeUv)}function axt(e,t){let n=t.shaderDefines,i=Object.keys(n).some(o=>n[o]!==e._shapeDefinesOld[o]);return i&&(e._shapeDefinesOld=ze(n,!0)),i}function cxt(e,t){if(!l(e)||!l(t))return 0;let n=t.currentTime,i,o=e.indexOf(n);o>=0?i=e.get(o):(o=~o,o===e.length?(o=e.length-1,i=e.get(o),n=i.stop):(i=e.get(o),n=i.start));let r=te.secondsDifference(i.stop,i.start),a=te.secondsDifference(n,i.start)/r;return o+a}function lxt(e,t){let n=e.clippingPlanes;if(!l(n))return!1;n.update(t);let{clippingPlanesState:i,enabled:o}=n;if(o){let r=e._uniforms;r.clippingPlanesTexture=n.texture,r.clippingPlanesMatrix=A.transpose(A.multiplyTransformation(A.inverse(n.modelMatrix,r.clippingPlanesMatrix),e._transformPositionUvToWorld,r.clippingPlanesMatrix),r.clippingPlanesMatrix)}return e._clippingPlanesState===i&&e._clippingPlanesEnabled===o?!1:(e._clippingPlanesState=i,e._clippingPlanesEnabled=o,!0)}$f.prototype.isDestroyed=function(){return!1};$f.prototype.destroy=function(){let e=this._drawCommand;l(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy());let t=this._drawCommandPick;return l(t)&&(t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()),this._pickId=this._pickId&&this._pickId.destroy(),this._traversal=this._traversal&&this._traversal.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),ue(this)};var nTe=new Array(new se(-1,-1,-1,1),new se(1,-1,-1,1),new se(-1,1,-1,1),new se(1,1,-1,1),new se(-1,-1,1,1),new se(1,-1,1,1),new se(-1,1,1,1),new se(1,1,1,1)),dxt=new Array(1,2,4,0,3,5,0,3,6,1,2,7,0,5,6,1,4,7,2,4,7,3,5,6),uxt=new Array(new se,new se,new se,new se,new se,new se,new se,new se);function mxt(e,t,n){let i=A.fromRotationTranslation(e.halfAxes,e.center,ext),o=A.multiply(t,i,txt),r=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,c=-Number.MAX_VALUE,d,u=uxt,m=nTe.length;for(d=0;d<m;d++)A.multiplyByVector(o,nTe[d],u[d]);for(d=0;d<m;d++){let p=u[d];if(p.z>=-p.w){let y=p.x/p.w,f=p.y/p.w;r=Math.min(r,y),s=Math.max(s,y),a=Math.min(a,f),c=Math.max(c,f)}else for(let y=0;y<3;y++){let f=dxt[d*3+y],x=u[f];if(x.z>=-x.w){let _=p.z+p.w,C=x.z+x.w,V=_/(_-C),L=se.lerp(p,x,V,Kgt),Z=L.x/L.w,G=L.y/L.w;r=Math.min(r,Z),s=Math.max(s,Z),a=Math.min(a,G),c=Math.max(c,G)}}}return r=W.clamp(r,-1,1),a=W.clamp(a,-1,1),s=W.clamp(s,-1,1),c=W.clamp(c,-1,1),n=se.fromElements(r,a,s,c,n),n}var c7=3e7,hxt=new h(c7,0,0),fxt=new h(0,c7,0),pxt=new h(0,0,c7);function bxt(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function o(c,d,u,m){i.add({positions:[c,d],width:m,material:Bi.fromType("Color",{color:u})})}function r(c,d,u){let m=c.computeCorners();o(m[0],m[1],d,u),o(m[2],m[3],d,u),o(m[4],m[5],d,u),o(m[6],m[7],d,u),o(m[0],m[2],d,u),o(m[4],m[6],d,u),o(m[1],m[3],d,u),o(m[5],m[7],d,u),o(m[0],m[4],d,u),o(m[2],m[6],d,u),o(m[1],m[5],d,u),o(m[3],m[7],d,u)}function s(c){if(!n.isRenderable(c))return;let d=c.level,m=Math.max(1,5/Math.pow(2,d)),y=[O.RED,O.LIME,O.BLUE][d%3];if(r(c.orientedBoundingBox,y,m),l(c.children))for(let f=0;f<8;f++)s(c.children[f])}r(e._shape.orientedBoundingBox,O.WHITE,5),s(n.rootNode);let a=10;o(h.ZERO,hxt,O.RED,a),o(h.ZERO,fxt,O.LIME,a),o(h.ZERO,pxt,O.BLUE,a),i.update(t)}$f.DefaultCustomShader=new sS({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material)
{
material.diffuse = vec3(1.0);
material.alpha = 1.0;
}`});function sTe(){this.ready=!0,this.shape=Ui.BOX,this.dimensions=new h(1,1,1),this.names=["data"],this.types=[Ht.SCALAR],this.componentTypes=[sn.FLOAT32],this.maximumTileCount=1}sTe.prototype.requestData=function(e){if(!((l(e)?g(e.tileLevel,0):0)>=1))return Promise.resolve([new Float32Array(1)])};$f.DefaultProvider=new sTe;var fL=$f;var G8i=T(S(),1);function l7(){fe.throwInstantiationError()}Object.defineProperties(l7.prototype,{globalTransform:{get:fe.throwInstantiationError},shapeTransform:{get:fe.throwInstantiationError},shape:{get:fe.throwInstantiationError},minBounds:{get:fe.throwInstantiationError},maxBounds:{get:fe.throwInstantiationError},dimensions:{get:fe.throwInstantiationError},paddingBefore:{get:fe.throwInstantiationError},paddingAfter:{get:fe.throwInstantiationError},names:{get:fe.throwInstantiationError},types:{get:fe.throwInstantiationError},componentTypes:{get:fe.throwInstantiationError},minimumValues:{get:fe.throwInstantiationError},maximumValues:{get:fe.throwInstantiationError},maximumTileCount:{get:fe.throwInstantiationError},keyframeCount:{get:fe.throwInstantiationError},timeIntervalCollection:{get:fe.throwInstantiationError}});l7.prototype.requestData=fe.throwInstantiationError;var d7=l7;var X8i=T(S(),1);function cS(){fe.throwInstantiationError()}Object.defineProperties(cS.prototype,{orientedBoundingBox:{get:fe.throwInstantiationError},boundingSphere:{get:fe.throwInstantiationError},boundTransform:{get:fe.throwInstantiationError},shapeTransform:{get:fe.throwInstantiationError},shaderUniforms:{get:fe.throwInstantiationError},shaderDefines:{get:fe.throwInstantiationError},shaderMaximumIntersectionsLength:{get:fe.throwInstantiationError}});cS.prototype.update=fe.throwInstantiationError;cS.prototype.computeOrientedBoundingBoxForTile=fe.throwInstantiationError;cS.prototype.computeApproximateStepSize=fe.throwInstantiationError;cS.DefaultMinBounds=fe.throwInstantiationError;cS.DefaultMaxBounds=fe.throwInstantiationError;var u7=cS;var P8i=T(S(),1),m7=`uniform sampler2D u_depthTexture;
in vec2 v_textureCoordinates;
void main()
{
float z_window = czm_unpackDepth(texture(u_depthTexture, v_textureCoordinates));
z_window = czm_reverseLogDepth(z_window);
float n_range = czm_depthRange.near;
float f_range = czm_depthRange.far;
float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);
float scale = pow(z_ndc * 0.5 + 0.5, 8.0);
out_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);
}
`;var k8i=T(S(),1);function yxt(e){e=g(e,g.EMPTY_OBJECT),this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=g(e.pixelFormat,at.RGBA),this.pixelDatatype=g(e.pixelDatatype,je.UNSIGNED_BYTE);let t=e.url;typeof t=="string"&&(t=Xe.createIfNeeded(t)),this.resource=t;let i=g(e.repeat,!0)?In.REPEAT:In.CLAMP_TO_EDGE;this.sampler=new hn({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var h7=yxt;var B8i=T(S(),1),gxt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat2",MAT4:"mat4"},f7=Object.freeze(gxt);var H8i=T(S(),1);function xxt(e){async function t({data:i}){let o=[],r={id:i.id,result:void 0,error:void 0};self.CESIUM_BASE_URL=i.baseUrl;try{let s=await e(i.parameters,o);r.result=s}catch(s){s instanceof Error?r.error={name:s.name,message:s.message,stack:s.stack}:r.error=s}i.canTransferArrayBuffer||(o.length=0);try{postMessage(r,o)}catch(s){r.result=void 0,r.error=`postMessage failed with error: ${wf(s)}
with responseMessage: ${JSON.stringify(r)}`,postMessage(r)}}function n(i){postMessage({id:i.data?.id,error:`postMessage failed with error: ${JSON.stringify(i)}`})}return self.onmessage=t,self.onmessageerror=n,self}var p7=xxt;globalThis.CESIUM_VERSION="1.114";var XTo=T(S(),1);var ybo=T(S(),1);var hbo=T(S(),1);var obo=T(S(),1),q9;typeof ko<"u"&&(q9=ko);(function(){/*!
* Knockout JavaScript library v3.5.1
* (c) The Knockout.js team - http://knockoutjs.com/
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
*/(function(){(function(e){var t=this||(0,eval)("this"),n=t.document,i=t.navigator,o=t.jQuery,r=t.JSON;o||typeof jQuery>"u"||(o=jQuery),function(s){s(t.ko={})}(function(s,a){function c(b,R){return b===null||typeof b in x?b===R:!1}function d(b,R){var E;return function(){E||(E=f.a.setTimeout(function(){E=e,b()},R))}}function u(b,R){var E;return function(){clearTimeout(E),E=f.a.setTimeout(b,R)}}function m(b,R){R&&R!=="change"?R==="beforeChange"?this.pc(b):this.gb(b,R):this.qc(b)}function p(b,R){R!==null&&R.s&&R.s()}function y(b,R){var E=this.qd,X=E[Z];X.ra||(this.Qb&&this.mb[R]?(E.uc(R,b,this.mb[R]),this.mb[R]=null,--this.Qb):X.I[R]||E.uc(R,b,X.J?{da:b}:E.$c(b)),b.Ja&&b.gd())}var f=typeof s<"u"?s:{};f.b=function(b,R){for(var E=b.split("."),X=f,w=0;w<E.length-1;w++)X=X[E[w]];X[E[E.length-1]]=R},f.L=function(b,R,E){b[R]=E},f.version="3.5.1",f.b("version",f.version),f.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},f.a=function(){function b(H,j){for(var $ in H)w.call(H,$)&&j($,H[$])}function R(H,j){if(j)for(var $ in j)w.call(j,$)&&(H[$]=j[$]);return H}function E(H,j){return H.__proto__=j,H}function X(H,j,$,pe){var ge=H[j].match(K)||[];f.a.D($.match(K),function(ae){f.a.Na(ge,ae,pe)}),H[j]=ge.join(" ")}var w=Object.prototype.hasOwnProperty,N={__proto__:[]}instanceof Array,D=typeof Symbol=="function",k={},Y={};k[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],k.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),b(k,function(H,j){if(j.length)for(var $=0,pe=j.length;$<pe;$++)Y[j[$]]=H});var U={propertychange:!0},J=n&&function(){for(var H=3,j=n.createElement("div"),$=j.getElementsByTagName("i");j.innerHTML="<!--[if gt IE "+ ++H+"]><i></i><![endif]-->",$[0];);return 4<H?H:e}(),K=/\S+/g,ee;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(H,j,$){for(var pe=0,ge=H.length;pe<ge;pe++)j.call($,H[pe],pe,H)},A:typeof Array.prototype.indexOf=="function"?function(H,j){return Array.prototype.indexOf.call(H,j)}:function(H,j){for(var $=0,pe=H.length;$<pe;$++)if(H[$]===j)return $;return-1},Lb:function(H,j,$){for(var pe=0,ge=H.length;pe<ge;pe++)if(j.call($,H[pe],pe,H))return H[pe];return e},Pa:function(H,j){var $=f.a.A(H,j);0<$?H.splice($,1):$===0&&H.shift()},wc:function(H){var j=[];return H&&f.a.D(H,function($){0>f.a.A(j,$)&&j.push($)}),j},Mb:function(H,j,$){var pe=[];if(H)for(var ge=0,ae=H.length;ge<ae;ge++)pe.push(j.call($,H[ge],ge));return pe},jb:function(H,j,$){var pe=[];if(H)for(var ge=0,ae=H.length;ge<ae;ge++)j.call($,H[ge],ge)&&pe.push(H[ge]);return pe},Nb:function(H,j){if(j instanceof Array)H.push.apply(H,j);else for(var $=0,pe=j.length;$<pe;$++)H.push(j[$]);return H},Na:function(H,j,$){var pe=f.a.A(f.a.bc(H),j);0>pe?$&&H.push(j):$||H.splice(pe,1)},Ba:N,extend:R,setPrototypeOf:E,Ab:N?E:R,P:b,Ga:function(H,j,$){if(!H)return H;var pe={},ge;for(ge in H)w.call(H,ge)&&(pe[ge]=j.call($,H[ge],ge,H));return pe},Tb:function(H){for(;H.firstChild;)f.removeNode(H.firstChild)},Yb:function(H){H=f.a.la(H);for(var j=(H[0]&&H[0].ownerDocument||n).createElement("div"),$=0,pe=H.length;$<pe;$++)j.appendChild(f.oa(H[$]));return j},Ca:function(H,j){for(var $=0,pe=H.length,ge=[];$<pe;$++){var ae=H[$].cloneNode(!0);ge.push(j?f.oa(ae):ae)}return ge},va:function(H,j){if(f.a.Tb(H),j)for(var $=0,pe=j.length;$<pe;$++)H.appendChild(j[$])},Xc:function(H,j){var $=H.nodeType?[H]:H;if(0<$.length){for(var pe=$[0],ge=pe.parentNode,ae=0,be=j.length;ae<be;ae++)ge.insertBefore(j[ae],pe);for(ae=0,be=$.length;ae<be;ae++)f.removeNode($[ae])}},Ua:function(H,j){if(H.length){for(j=j.nodeType===8&&j.parentNode||j;H.length&&H[0].parentNode!==j;)H.splice(0,1);for(;1<H.length&&H[H.length-1].parentNode!==j;)H.length--;if(1<H.length){var $=H[0],pe=H[H.length-1];for(H.length=0;$!==pe;)H.push($),$=$.nextSibling;H.push(pe)}}return H},Zc:function(H,j){7>J?H.setAttribute("selected",j):H.selected=j},Db:function(H){return H===null||H===e?"":H.trim?H.trim():H.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(H,j){return H=H||"",j.length>H.length?!1:H.substring(0,j.length)===j},vd:function(H,j){if(H===j)return!0;if(H.nodeType===11)return!1;if(j.contains)return j.contains(H.nodeType!==1?H.parentNode:H);if(j.compareDocumentPosition)return(j.compareDocumentPosition(H)&16)==16;for(;H&&H!=j;)H=H.parentNode;return!!H},Sb:function(H){return f.a.vd(H,H.ownerDocument.documentElement)},kd:function(H){return!!f.a.Lb(H,f.a.Sb)},R:function(H){return H&&H.tagName&&H.tagName.toLowerCase()},Ac:function(H){return f.onError?function(){try{return H.apply(this,arguments)}catch(j){throw f.onError&&f.onError(j),j}}:H},setTimeout:function(H,j){return setTimeout(f.a.Ac(H),j)},Gc:function(H){setTimeout(function(){throw f.onError&&f.onError(H),H},0)},B:function(H,j,$){var pe=f.a.Ac($);if($=U[j],f.options.useOnlyNativeEvents||$||!o)if($||typeof H.addEventListener!="function")if(typeof H.attachEvent<"u"){var ge=function(be){pe.call(H,be)},ae="on"+j;H.attachEvent(ae,ge),f.a.K.za(H,function(){H.detachEvent(ae,ge)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else H.addEventListener(j,pe,!1);else ee||(ee=typeof o(H).on=="function"?"on":"bind"),o(H)[ee](j,pe)},Fb:function(H,j){if(!H||!H.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var $;if(f.a.R(H)==="input"&&H.type&&j.toLowerCase()=="click"?($=H.type,$=$=="checkbox"||$=="radio"):$=!1,f.options.useOnlyNativeEvents||!o||$)if(typeof n.createEvent=="function")if(typeof H.dispatchEvent=="function")$=n.createEvent(Y[j]||"HTMLEvents"),$.initEvent(j,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,H),H.dispatchEvent($);else throw Error("The supplied element doesn't support dispatchEvent");else if($&&H.click)H.click();else if(typeof H.fireEvent<"u")H.fireEvent("on"+j);else throw Error("Browser doesn't support triggering events");else o(H).trigger(j)},f:function(H){return f.O(H)?H():H},bc:function(H){return f.O(H)?H.v():H},Eb:function(H,j,$){var pe;j&&(typeof H.classList=="object"?(pe=H.classList[$?"add":"remove"],f.a.D(j.match(K),function(ge){pe.call(H.classList,ge)})):typeof H.className.baseVal=="string"?X(H.className,"baseVal",j,$):X(H,"className",j,$))},Bb:function(H,j){var $=f.a.f(j);($===null||$===e)&&($="");var pe=f.h.firstChild(H);!pe||pe.nodeType!=3||f.h.nextSibling(pe)?f.h.va(H,[H.ownerDocument.createTextNode($)]):pe.data=$,f.a.Ad(H)},Yc:function(H,j){if(H.name=j,7>=J)try{var $=H.name.replace(/[&<>'"]/g,function(pe){return"&#"+pe.charCodeAt(0)+";"});H.mergeAttributes(n.createElement("<input name='"+$+"'/>"),!1)}catch{}},Ad:function(H){9<=J&&(H=H.nodeType==1?H:H.parentNode,H.style&&(H.style.zoom=H.style.zoom))},wd:function(H){if(J){var j=H.style.width;H.style.width=0,H.style.width=j}},Pd:function(H,j){H=f.a.f(H),j=f.a.f(j);for(var $=[],pe=H;pe<=j;pe++)$.push(pe);return $},la:function(H){for(var j=[],$=0,pe=H.length;$<pe;$++)j.push(H[$]);return j},Da:function(H){return D?Symbol(H):H},Zd:J===6,$d:J===7,W:J,Lc:function(H,j){for(var $=f.a.la(H.getElementsByTagName("input")).concat(f.a.la(H.getElementsByTagName("textarea"))),pe=typeof j=="string"?function(be){return be.name===j}:function(be){return j.test(be.name)},ge=[],ae=$.length-1;0<=ae;ae--)pe($[ae])&&ge.push($[ae]);return ge},Nd:function(H){return typeof H=="string"&&(H=f.a.Db(H))?r&&r.parse?r.parse(H):new Function("return "+H)():null},hc:function(H,j,$){if(!r||!r.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 r.stringify(f.a.f(H),j,$)},Od:function(H,j,$){$=$||{};var pe=$.params||{},ge=$.includeFields||this.Jc,ae=H;if(typeof H=="object"&&f.a.R(H)==="form")for(var ae=H.action,be=ge.length-1;0<=be;be--)for(var _e=f.a.Lc(H,ge[be]),Ze=_e.length-1;0<=Ze;Ze--)pe[_e[Ze].name]=_e[Ze].value;j=f.a.f(j);var Le=n.createElement("form");Le.style.display="none",Le.action=ae,Le.method="post";for(var Ee in j)H=n.createElement("input"),H.type="hidden",H.name=Ee,H.value=f.a.hc(f.a.f(j[Ee])),Le.appendChild(H);b(pe,function(He,we){var dt=n.createElement("input");dt.type="hidden",dt.name=He,dt.value=we,Le.appendChild(dt)}),n.body.appendChild(Le),$.submitter?$.submitter(Le):Le.submit(),setTimeout(function(){Le.parentNode.removeChild(Le)},0)}}}(),f.b("utils",f.a),f.b("utils.arrayForEach",f.a.D),f.b("utils.arrayFirst",f.a.Lb),f.b("utils.arrayFilter",f.a.jb),f.b("utils.arrayGetDistinctValues",f.a.wc),f.b("utils.arrayIndexOf",f.a.A),f.b("utils.arrayMap",f.a.Mb),f.b("utils.arrayPushAll",f.a.Nb),f.b("utils.arrayRemoveItem",f.a.Pa),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.Jc),f.b("utils.getFormFields",f.a.Lc),f.b("utils.objectMap",f.a.Ga),f.b("utils.peekObservable",f.a.bc),f.b("utils.postJson",f.a.Od),f.b("utils.parseJson",f.a.Nd),f.b("utils.registerEventHandler",f.a.B),f.b("utils.stringifyJson",f.a.hc),f.b("utils.range",f.a.Pd),f.b("utils.toggleDomNodeCssClass",f.a.Eb),f.b("utils.triggerEvent",f.a.Fb),f.b("utils.unwrapObservable",f.a.f),f.b("utils.objectForEach",f.a.P),f.b("utils.addOrRemoveItem",f.a.Na),f.b("utils.setTextContent",f.a.Bb),f.b("unwrap",f.a.f),Function.prototype.bind||(Function.prototype.bind=function(b){var R=this;if(arguments.length===1)return function(){return R.apply(b,arguments)};var E=Array.prototype.slice.call(arguments,1);return function(){var X=E.slice(0);return X.push.apply(X,arguments),R.apply(b,X)}}),f.a.g=new function(){var b=0,R="__ko__"+new Date().getTime(),E={},X,w;return f.a.W?(X=function(N,D){var k=N[R];if(!k||k==="null"||!E[k]){if(!D)return e;k=N[R]="ko"+b++,E[k]={}}return E[k]},w=function(N){var D=N[R];return D?(delete E[D],N[R]=null,!0):!1}):(X=function(N,D){var k=N[R];return!k&&D&&(k=N[R]={}),k},w=function(N){return N[R]?(delete N[R],!0):!1}),{get:function(N,D){var k=X(N,!1);return k&&k[D]},set:function(N,D,k){(N=X(N,k!==e))&&(N[D]=k)},Ub:function(N,D,k){return N=X(N,!0),N[D]||(N[D]=k)},clear:w,Z:function(){return b+++R}}},f.b("utils.domData",f.a.g),f.b("utils.domData.clear",f.a.g.clear),f.a.K=new function(){function b(D,k){var Y=f.a.g.get(D,X);return Y===e&&k&&(Y=[],f.a.g.set(D,X,Y)),Y}function R(D){var k=b(D,!1);if(k)for(var k=k.slice(0),Y=0;Y<k.length;Y++)k[Y](D);f.a.g.clear(D),f.a.K.cleanExternalData(D),N[D.nodeType]&&E(D.childNodes,!0)}function E(D,k){for(var Y=[],U,J=0;J<D.length;J++)if((!k||D[J].nodeType===8)&&(R(Y[Y.length]=U=D[J]),D[J]!==U))for(;J--&&f.a.A(Y,D[J])==-1;);}var X=f.a.g.Z(),w={1:!0,8:!0,9:!0},N={1:!0,9:!0};return{za:function(D,k){if(typeof k!="function")throw Error("Callback must be a function");b(D,!0).push(k)},yb:function(D,k){var Y=b(D,!1);Y&&(f.a.Pa(Y,k),Y.length==0&&f.a.g.set(D,X,e))},oa:function(D){return f.u.G(function(){w[D.nodeType]&&(R(D),N[D.nodeType]&&E(D.getElementsByTagName("*")))}),D},removeNode:function(D){f.oa(D),D.parentNode&&D.parentNode.removeChild(D)},cleanExternalData:function(D){o&&typeof o.cleanData=="function"&&o.cleanData([D])}}},f.oa=f.a.K.oa,f.removeNode=f.a.K.removeNode,f.b("cleanNode",f.oa),f.b("removeNode",f.removeNode),f.b("utils.domNodeDisposal",f.a.K),f.b("utils.domNodeDisposal.addDisposeCallback",f.a.K.za),f.b("utils.domNodeDisposal.removeDisposeCallback",f.a.K.yb),function(){var b=[0,"",""],R=[1,"<table>","</table>"],E=[3,"<table><tbody><tr>","</tr></tbody></table>"],X=[1,"<select multiple='multiple'>","</select>"],w={thead:R,tbody:R,tfoot:R,tr:[2,"<table><tbody>","</tbody></table>"],td:E,th:E,option:X,optgroup:X},N=8>=f.a.W;f.a.ua=function(D,k){var Y;if(o){if(o.parseHTML)Y=o.parseHTML(D,k)||[];else if((Y=o.clean([D],k))&&Y[0]){for(var U=Y[0];U.parentNode&&U.parentNode.nodeType!==11;)U=U.parentNode;U.parentNode&&U.parentNode.removeChild(U)}}else{(Y=k)||(Y=n);var U=Y.parentWindow||Y.defaultView||t,J=f.a.Db(D).toLowerCase(),K=Y.createElement("div"),ee;for(ee=(J=J.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&w[J[1]]||b,J=ee[0],ee="ignored<div>"+ee[1]+D+ee[2]+"</div>",typeof U.innerShiv=="function"?K.appendChild(U.innerShiv(ee)):(N&&Y.body.appendChild(K),K.innerHTML=ee,N&&K.parentNode.removeChild(K));J--;)K=K.lastChild;Y=f.a.la(K.lastChild.childNodes)}return Y},f.a.Md=function(D,k){var Y=f.a.ua(D,k);return Y.length&&Y[0].parentElement||f.a.Yb(Y)},f.a.fc=function(D,k){if(f.a.Tb(D),k=f.a.f(k),k!==null&&k!==e)if(typeof k!="string"&&(k=k.toString()),o)o(D).html(k);else for(var Y=f.a.ua(k,D.ownerDocument),U=0;U<Y.length;U++)D.appendChild(Y[U])}}(),f.b("utils.parseHtmlFragment",f.a.ua),f.b("utils.setHtml",f.a.fc),f.aa=function(){function b(E,X){if(E){if(E.nodeType==8){var w=f.aa.Uc(E.nodeValue);w!=null&&X.push({ud:E,Kd:w})}else if(E.nodeType==1)for(var w=0,N=E.childNodes,D=N.length;w<D;w++)b(N[w],X)}}var R={};return{Xb:function(E){if(typeof E!="function")throw Error("You can only pass a function to ko.memoization.memoize()");var X=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return R[X]=E,"<!--[ko_memo:"+X+"]-->"},bd:function(E,X){var w=R[E];if(w===e)throw Error("Couldn't find any memo with ID "+E+". Perhaps it's already been unmemoized.");try{return w.apply(null,X||[]),!0}finally{delete R[E]}},cd:function(E,X){var w=[];b(E,w);for(var N=0,D=w.length;N<D;N++){var k=w[N].ud,Y=[k];X&&f.a.Nb(Y,X),f.aa.bd(w[N].Kd,Y),k.nodeValue="",k.parentNode&&k.parentNode.removeChild(k)}},Uc:function(E){return(E=E.match(/^\[ko_memo\:(.*?)\]$/))?E[1]:null}}}(),f.b("memoization",f.aa),f.b("memoization.memoize",f.aa.Xb),f.b("memoization.unmemoize",f.aa.bd),f.b("memoization.parseMemoText",f.aa.Uc),f.b("memoization.unmemoizeDomNodeAndDescendants",f.aa.cd),f.na=function(){function b(){if(w){for(var k=w,Y=0,U;D<w;)if(U=X[D++]){if(D>k){if(5e3<=++Y){D=w,f.a.Gc(Error("'Too much recursion' after processing "+Y+" task groups."));break}k=w}try{U()}catch(J){f.a.Gc(J)}}}}function R(){b(),D=w=X.length=0}var E,X=[],w=0,N=1,D=0;return t.MutationObserver?E=function(k){var Y=n.createElement("div");return new MutationObserver(k).observe(Y,{attributes:!0}),function(){Y.classList.toggle("foo")}}(R):E=n&&"onreadystatechange"in n.createElement("script")?function(k){var Y=n.createElement("script");Y.onreadystatechange=function(){Y.onreadystatechange=null,n.documentElement.removeChild(Y),Y=null,k()},n.documentElement.appendChild(Y)}:function(k){setTimeout(k,0)},{scheduler:E,zb:function(k){return w||f.na.scheduler(R),X[w++]=k,N++},cancel:function(k){k=k-(N-w),k>=D&&k<w&&(X[k]=null)},resetForTesting:function(){var k=w-D;return D=w=X.length=0,k},Sd:b}}(),f.b("tasks",f.na),f.b("tasks.schedule",f.na.zb),f.b("tasks.runEarly",f.na.Sd),f.Ta={throttle:function(b,R){b.throttleEvaluation=R;var E=null;return f.$({read:b,write:function(X){clearTimeout(E),E=f.a.setTimeout(function(){b(X)},R)}})},rateLimit:function(b,R){var E,X,w;typeof R=="number"?E=R:(E=R.timeout,X=R.method),b.Hb=!1,w=typeof X=="function"?X:X=="notifyWhenChangesStop"?u:d,b.ub(function(N){return w(N,E,R)})},deferred:function(b,R){if(R!==!0)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");b.Hb||(b.Hb=!0,b.ub(function(E){var X,w=!1;return function(){if(!w){f.na.cancel(X),X=f.na.zb(E);try{w=!0,b.notifySubscribers(e,"dirty")}finally{w=!1}}}}))},notify:function(b,R){b.equalityComparer=R=="always"?null:c}};var x={undefined:1,boolean:1,number:1,string:1};f.b("extenders",f.Ta),f.ic=function(b,R,E){this.da=b,this.lc=R,this.mc=E,this.Ib=!1,this.fb=this.Jb=null,f.L(this,"dispose",this.s),f.L(this,"disposeWhenNodeIsRemoved",this.l)},f.ic.prototype.s=function(){this.Ib||(this.fb&&f.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},f.ic.prototype.l=function(b){this.Jb=b,f.a.K.za(b,this.fb=this.s.bind(this))},f.T=function(){f.a.Ab(this,_),_.qb(this)};var _={qb:function(b){b.U={change:[]},b.sc=1},subscribe:function(b,R,E){var X=this;E=E||"change";var w=new f.ic(X,R?b.bind(R):b,function(){f.a.Pa(X.U[E],w),X.hb&&X.hb(E)});return X.Qa&&X.Qa(E),X.U[E]||(X.U[E]=[]),X.U[E].push(w),w},notifySubscribers:function(b,R){if(R=R||"change",R==="change"&&this.Gb(),this.Wa(R)){var E=R==="change"&&this.ed||this.U[R].slice(0);try{f.u.xc();for(var X=0,w;w=E[X];++X)w.Ib||w.lc(b)}finally{f.u.end()}}},ob:function(){return this.sc},Dd:function(b){return this.ob()!==b},Gb:function(){++this.sc},ub:function(b){var R=this,E=f.O(R),X,w,N,D,k;R.gb||(R.gb=R.notifySubscribers,R.notifySubscribers=m);var Y=b(function(){R.Ja=!1,E&&D===R&&(D=R.nc?R.nc():R());var U=w||k&&R.sb(N,D);k=w=X=!1,U&&R.gb(N=D)});R.qc=function(U,J){J&&R.Ja||(k=!J),R.ed=R.U.change.slice(0),R.Ja=X=!0,D=U,Y()},R.pc=function(U){X||(N=U,R.gb(U,"beforeChange"))},R.rc=function(){k=!0},R.gd=function(){R.sb(N,R.v(!0))&&(w=!0)}},Wa:function(b){return this.U[b]&&this.U[b].length},Bd:function(b){if(b)return this.U[b]&&this.U[b].length||0;var R=0;return f.a.P(this.U,function(E,X){E!=="dirty"&&(R+=X.length)}),R},sb:function(b,R){return!this.equalityComparer||!this.equalityComparer(b,R)},toString:function(){return"[object Object]"},extend:function(b){var R=this;return b&&f.a.P(b,function(E,X){var w=f.Ta[E];typeof w=="function"&&(R=w(R,X)||R)}),R}};f.L(_,"init",_.qb),f.L(_,"subscribe",_.subscribe),f.L(_,"extend",_.extend),f.L(_,"getSubscriptionsCount",_.Bd),f.a.Ba&&f.a.setPrototypeOf(_,Function.prototype),f.T.fn=_,f.Qc=function(b){return b!=null&&typeof b.subscribe=="function"&&typeof b.notifySubscribers=="function"},f.b("subscribable",f.T),f.b("isSubscribable",f.Qc),f.S=f.u=function(){function b(N){E.push(X),X=N}function R(){X=E.pop()}var E=[],X,w=0;return{xc:b,end:R,cc:function(N){if(X){if(!f.Qc(N))throw Error("Only subscribable things can act as dependencies");X.od.call(X.pd,N,N.fd||(N.fd=++w))}},G:function(N,D,k){try{return b(),N.apply(D,k||[])}finally{R()}},qa:function(){if(X)return X.o.qa()},Va:function(){if(X)return X.o.Va()},Ya:function(){if(X)return X.Ya},o:function(){if(X)return X.o}}}(),f.b("computedContext",f.S),f.b("computedContext.getDependenciesCount",f.S.qa),f.b("computedContext.getDependencies",f.S.Va),f.b("computedContext.isInitial",f.S.Ya),f.b("computedContext.registerDependency",f.S.cc),f.b("ignoreDependencies",f.Yd=f.u.G);var C=f.a.Da("_latestValue");f.ta=function(b){function R(){return 0<arguments.length?(R.sb(R[C],arguments[0])&&(R.ya(),R[C]=arguments[0],R.xa()),this):(f.u.cc(R),R[C])}return R[C]=b,f.a.Ba||f.a.extend(R,f.T.fn),f.T.fn.qb(R),f.a.Ab(R,V),f.options.deferUpdates&&f.Ta.deferred(R,!0),R};var V={equalityComparer:c,v:function(){return this[C]},xa:function(){this.notifySubscribers(this[C],"spectate"),this.notifySubscribers(this[C])},ya:function(){this.notifySubscribers(this[C],"beforeChange")}};f.a.Ba&&f.a.setPrototypeOf(V,f.T.fn);var L=f.ta.Ma="__ko_proto__";V[L]=f.ta,f.O=function(b){if((b=typeof b=="function"&&b[L])&&b!==V[L]&&b!==f.o.fn[L])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!b},f.Za=function(b){return typeof b=="function"&&(b[L]===V[L]||b[L]===f.o.fn[L]&&b.Nc)},f.b("observable",f.ta),f.b("isObservable",f.O),f.b("isWriteableObservable",f.Za),f.b("isWritableObservable",f.Za),f.b("observable.fn",V),f.L(V,"peek",V.v),f.L(V,"valueHasMutated",V.xa),f.L(V,"valueWillMutate",V.ya),f.Ha=function(b){if(b=b||[],typeof b!="object"||!("length"in b))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return b=f.ta(b),f.a.Ab(b,f.Ha.fn),b.extend({trackArrayChanges:!0})},f.Ha.fn={remove:function(b){for(var R=this.v(),E=[],X=typeof b!="function"||f.O(b)?function(D){return D===b}:b,w=0;w<R.length;w++){var N=R[w];if(X(N)){if(E.length===0&&this.ya(),R[w]!==N)throw Error("Array modified during remove; cannot remove item");E.push(N),R.splice(w,1),w--}}return E.length&&this.xa(),E},removeAll:function(b){if(b===e){var R=this.v(),E=R.slice(0);return this.ya(),R.splice(0,R.length),this.xa(),E}return b?this.remove(function(X){return 0<=f.a.A(b,X)}):[]},destroy:function(b){var R=this.v(),E=typeof b!="function"||f.O(b)?function(N){return N===b}:b;this.ya();for(var X=R.length-1;0<=X;X--){var w=R[X];E(w)&&(w._destroy=!0)}this.xa()},destroyAll:function(b){return b===e?this.destroy(function(){return!0}):b?this.destroy(function(R){return 0<=f.a.A(b,R)}):[]},indexOf:function(b){var R=this();return f.a.A(R,b)},replace:function(b,R){var E=this.indexOf(b);0<=E&&(this.ya(),this.v()[E]=R,this.xa())},sorted:function(b){var R=this().slice(0);return b?R.sort(b):R.sort()},reversed:function(){return this().slice(0).reverse()}},f.a.Ba&&f.a.setPrototypeOf(f.Ha.fn,f.ta.fn),f.a.D("pop push reverse shift sort splice unshift".split(" "),function(b){f.Ha.fn[b]=function(){var R=this.v();this.ya(),this.zc(R,b,arguments);var E=R[b].apply(R,arguments);return this.xa(),E===R?this:E}}),f.a.D(["slice"],function(b){f.Ha.fn[b]=function(){var R=this();return R[b].apply(R,arguments)}}),f.Pc=function(b){return f.O(b)&&typeof b.remove=="function"&&typeof b.push=="function"},f.b("observableArray",f.Ha),f.b("isObservableArray",f.Pc),f.Ta.trackArrayChanges=function(b,R){function E(){function K(){if(k){var ee=[].concat(b.v()||[]),H;b.Wa("arrayChange")&&((!w||1<k)&&(w=f.a.Pb(Y,ee,b.Ob)),H=w),Y=ee,w=null,k=0,H&&H.length&&b.notifySubscribers(H,"arrayChange")}}X?K():(X=!0,D=b.subscribe(function(){++k},null,"spectate"),Y=[].concat(b.v()||[]),w=null,N=b.subscribe(K))}if(b.Ob={},R&&typeof R=="object"&&f.a.extend(b.Ob,R),b.Ob.sparse=!0,!b.zc){var X=!1,w=null,N,D,k=0,Y,U=b.Qa,J=b.hb;b.Qa=function(K){U&&U.call(b,K),K==="arrayChange"&&E()},b.hb=function(K){J&&J.call(b,K),K!=="arrayChange"||b.Wa("arrayChange")||(N&&N.s(),D&&D.s(),D=N=null,X=!1,Y=e)},b.zc=function(K,ee,H){function j(Le,Ee,He){return $[$.length]={status:Le,value:Ee,index:He}}if(X&&!k){var $=[],pe=K.length,ge=H.length,ae=0;switch(ee){case"push":ae=pe;case"unshift":for(ee=0;ee<ge;ee++)j("added",H[ee],ae+ee);break;case"pop":ae=pe-1;case"shift":pe&&j("deleted",K[ae],ae);break;case"splice":ee=Math.min(Math.max(0,0>H[0]?pe+H[0]:H[0]),pe);for(var pe=ge===1?pe:Math.min(ee+(H[1]||0),pe),ge=ee+ge-2,ae=Math.max(pe,ge),be=[],_e=[],Ze=2;ee<ae;++ee,++Ze)ee<pe&&_e.push(j("deleted",K[ee],ee)),ee<ge&&be.push(j("added",H[Ze],ee));f.a.Kc(_e,be);break;default:return}w=$}}}};var Z=f.a.Da("_state");f.o=f.$=function(b,R,E){function X(){if(0<arguments.length){if(typeof w=="function")w.apply(N.nb,arguments);else 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 this}return N.ra||f.u.cc(X),(N.ka||N.J&&X.Xa())&&X.ha(),N.X}if(typeof b=="object"?E=b:(E=E||{},b&&(E.read=b)),typeof E.read!="function")throw Error("Pass a function that returns the value of the ko.computed");var w=E.write,N={X:e,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:E.read,nb:R||E.owner,l:E.disposeWhenNodeIsRemoved||E.l||null,Sa:E.disposeWhen||E.Sa,Rb:null,I:{},V:0,Ic:null};return X[Z]=N,X.Nc=typeof w=="function",f.a.Ba||f.a.extend(X,f.T.fn),f.T.fn.qb(X),f.a.Ab(X,G),E.pure?(N.wb=!0,N.J=!0,f.a.extend(X,I)):E.deferEvaluation&&f.a.extend(X,P),f.options.deferUpdates&&f.Ta.deferred(X,!0),N.l&&(N.jc=!0,N.l.nodeType||(N.l=null)),N.J||E.deferEvaluation||X.ha(),N.l&&X.ja()&&f.a.K.za(N.l,N.Rb=function(){X.s()}),X};var G={equalityComparer:c,qa:function(){return this[Z].V},Va:function(){var b=[];return f.a.P(this[Z].I,function(R,E){b[E.Ka]=E.da}),b},Vb:function(b){if(!this[Z].V)return!1;var R=this.Va();return f.a.A(R,b)!==-1?!0:!!f.a.Lb(R,function(E){return E.Vb&&E.Vb(b)})},uc:function(b,R,E){if(this[Z].wb&&R===this)throw Error("A 'pure' computed must not be called recursively");this[Z].I[b]=E,E.Ka=this[Z].V++,E.La=R.ob()},Xa:function(){var b,R,E=this[Z].I;for(b in E)if(Object.prototype.hasOwnProperty.call(E,b)&&(R=E[b],this.Ia&&R.da.Ja||R.da.Dd(R.La)))return!0},Jd:function(){this.Ia&&!this[Z].rb&&this.Ia(!1)},ja:function(){var b=this[Z];return b.ka||0<b.V},Rd:function(){this.Ja?this[Z].ka&&(this[Z].sa=!0):this.Hc()},$c:function(b){if(b.Hb){var R=b.subscribe(this.Jd,this,"dirty"),E=b.subscribe(this.Rd,this);return{da:b,s:function(){R.s(),E.s()}}}return b.subscribe(this.Hc,this)},Hc:function(){var b=this,R=b.throttleEvaluation;R&&0<=R?(clearTimeout(this[Z].Ic),this[Z].Ic=f.a.setTimeout(function(){b.ha(!0)},R)):b.Ia?b.Ia(!0):b.ha(!0)},ha:function(b){var R=this[Z],E=R.Sa,X=!1;if(!R.rb&&!R.ra){if(R.l&&!f.a.Sb(R.l)||E&&E()){if(!R.jc){this.s();return}}else R.jc=!1;R.rb=!0;try{X=this.zd(b)}finally{R.rb=!1}return X}},zd:function(b){var R=this[Z],X=!1,E=R.wb?e:!R.V,X={qd:this,mb:R.I,Qb:R.V};f.u.xc({pd:X,od:y,o:this,Ya:E}),R.I={},R.V=0;var w=this.yd(R,X);return R.V?X=this.sb(R.X,w):(this.s(),X=!0),X&&(R.J?this.Gb():this.notifySubscribers(R.X,"beforeChange"),R.X=w,this.notifySubscribers(R.X,"spectate"),!R.J&&b&&this.notifySubscribers(R.X),this.rc&&this.rc()),E&&this.notifySubscribers(R.X,"awake"),X},yd:function(b,R){try{var E=b.Wc;return b.nb?E.call(b.nb):E()}finally{f.u.end(),R.Qb&&!b.J&&f.a.P(R.mb,p),b.sa=b.ka=!1}},v:function(b){var R=this[Z];return(R.ka&&(b||!R.V)||R.J&&this.Xa())&&this.ha(),R.X},ub:function(b){f.T.fn.ub.call(this,b),this.nc=function(){return this[Z].J||(this[Z].sa?this.ha():this[Z].ka=!1),this[Z].X},this.Ia=function(R){this.pc(this[Z].X),this[Z].ka=!0,R&&(this[Z].sa=!0),this.qc(this,!R)}},s:function(){var b=this[Z];!b.J&&b.I&&f.a.P(b.I,function(R,E){E.s&&E.s()}),b.l&&b.Rb&&f.a.K.yb(b.l,b.Rb),b.I=e,b.V=0,b.ra=!0,b.sa=!1,b.ka=!1,b.J=!1,b.l=e,b.Sa=e,b.Wc=e,this.Nc||(b.nb=e)}},I={Qa:function(b){var R=this,E=R[Z];if(!E.ra&&E.J&&b=="change"){if(E.J=!1,E.sa||R.Xa())E.I=null,E.V=0,R.ha()&&R.Gb();else{var X=[];f.a.P(E.I,function(w,N){X[N.Ka]=w}),f.a.D(X,function(w,N){var D=E.I[w],k=R.$c(D.da);k.Ka=N,k.La=D.La,E.I[w]=k}),R.Xa()&&R.ha()&&R.Gb()}E.ra||R.notifySubscribers(E.X,"awake")}},hb:function(b){var R=this[Z];R.ra||b!="change"||this.Wa("change")||(f.a.P(R.I,function(E,X){X.s&&(R.I[E]={da:X.da,Ka:X.Ka,La:X.La},X.s())}),R.J=!0,this.notifySubscribers(e,"asleep"))},ob:function(){var b=this[Z];return b.J&&(b.sa||this.Xa())&&this.ha(),f.T.fn.ob.call(this)}},P={Qa:function(b){b!="change"&&b!="beforeChange"||this.v()}};f.a.Ba&&f.a.setPrototypeOf(G,f.T.fn);var v=f.ta.Ma;G[v]=f.o,f.Oc=function(b){return typeof b=="function"&&b[v]===G[v]},f.Fd=function(b){return f.Oc(b)&&b[Z]&&b[Z].wb},f.b("computed",f.o),f.b("dependentObservable",f.o),f.b("isComputed",f.Oc),f.b("isPureComputed",f.Fd),f.b("computed.fn",G),f.L(G,"peek",G.v),f.L(G,"dispose",G.s),f.L(G,"isActive",G.ja),f.L(G,"getDependenciesCount",G.qa),f.L(G,"getDependencies",G.Va),f.xb=function(b,R){return typeof b=="function"?f.o(b,R,{pure:!0}):(b=f.a.extend({},b),b.pure=!0,f.o(b,R))},f.b("pureComputed",f.xb),function(){function b(X,w,N){if(N=N||new E,X=w(X),typeof X!="object"||X===null||X===e||X instanceof RegExp||X instanceof Date||X instanceof String||X instanceof Number||X instanceof Boolean)return X;var D=X instanceof Array?[]:{};return N.save(X,D),R(X,function(k){var Y=w(X[k]);switch(typeof Y){case"boolean":case"number":case"string":case"function":D[k]=Y;break;case"object":case"undefined":var U=N.get(Y);D[k]=U!==e?U:b(Y,w,N)}}),D}function R(X,w){if(X instanceof Array){for(var N=0;N<X.length;N++)w(N);typeof X.toJSON=="function"&&w("toJSON")}else for(N in X)w(N)}function E(){this.keys=[],this.values=[]}f.ad=function(X){if(arguments.length==0)throw Error("When calling ko.toJS, pass the object you want to convert.");return b(X,function(w){for(var N=0;f.O(w)&&10>N;N++)w=w();return w})},f.toJSON=function(X,w,N){return X=f.ad(X),f.a.hc(X,w,N)},E.prototype={constructor:E,save:function(X,w){var N=f.a.A(this.keys,X);0<=N?this.values[N]=w:(this.keys.push(X),this.values.push(w))},get:function(X){return X=f.a.A(this.keys,X),0<=X?this.values[X]:e}}}(),f.b("toJS",f.ad),f.b("toJSON",f.toJSON),f.Wd=function(b,R,E){function X(w){var N=f.xb(b,E).extend({ma:"always"}),D=N.subscribe(function(k){k&&(D.s(),w(k))});return N.notifySubscribers(N.v()),D}return typeof Promise!="function"||R?X(R.bind(E)):new Promise(X)},f.b("when",f.Wd),function(){f.w={M:function(b){switch(f.a.R(b)){case"option":return b.__ko__hasDomDataOptionValue__===!0?f.a.g.get(b,f.c.options.$b):7>=f.a.W?b.getAttributeNode("value")&&b.getAttributeNode("value").specified?b.value:b.text:b.value;case"select":return 0<=b.selectedIndex?f.w.M(b.options[b.selectedIndex]):e;default:return b.value}},cb:function(b,R,E){switch(f.a.R(b)){case"option":typeof R=="string"?(f.a.g.set(b,f.c.options.$b,e),"__ko__hasDomDataOptionValue__"in b&&delete b.__ko__hasDomDataOptionValue__,b.value=R):(f.a.g.set(b,f.c.options.$b,R),b.__ko__hasDomDataOptionValue__=!0,b.value=typeof R=="number"?R:"");break;case"select":(R===""||R===null)&&(R=e);for(var X=-1,w=0,N=b.options.length,D;w<N;++w)if(D=f.w.M(b.options[w]),D==R||D===""&&R===e){X=w;break}(E||0<=X||R===e&&1<b.size)&&(b.selectedIndex=X,f.a.W===6&&f.a.setTimeout(function(){b.selectedIndex=X},0));break;default:(R===null||R===e)&&(R=""),b.value=R}}}}(),f.b("selectExtensions",f.w),f.b("selectExtensions.readValue",f.w.M),f.b("selectExtensions.writeValue",f.w.cb),f.m=function(){function b(k){k=f.a.Db(k),k.charCodeAt(0)===123&&(k=k.slice(1,-1)),k+=`
,`;var Y=[],U=k.match(X),J,K=[],ee=0;if(1<U.length){for(var H=0,j;j=U[H];++H){var $=j.charCodeAt(0);if($===44){if(0>=ee){Y.push(J&&K.length?{key:J,value:K.join("")}:{unknown:J||K.join("")}),J=ee=0,K=[];continue}}else if($===58){if(!ee&&!J&&K.length===1){J=K.pop();continue}}else{if($===47&&1<j.length&&(j.charCodeAt(1)===47||j.charCodeAt(1)===42))continue;$===47&&H&&1<j.length?($=U[H-1].match(w))&&!N[$[0]]&&(k=k.substr(k.indexOf(j)+1),U=k.match(X),H=-1,j="/"):$===40||$===123||$===91?++ee:$===41||$===125||$===93?--ee:J||K.length||$!==34&&$!==39||(j=j.slice(1,-1))}K.push(j)}if(0<ee)throw Error("Unbalanced parentheses, braces, or brackets")}return Y}var R=["true","false","null","undefined"],E=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,X=RegExp(`"(?:\\\\.|[^"])*"|'(?:\\\\.|[^'])*'|\`(?:\\\\.|[^\`])*\`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.*
|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),w=/[\])"'A-Za-z0-9_$]+$/,N={in:1,return:1,typeof:1},D={};return{Ra:[],wa:D,ac:b,vb:function(k,Y){function U($,pe){var ge;if(!H){var ae=f.getBindingHandler($);if(ae&&ae.preprocess&&!(pe=ae.preprocess(pe,$,U)))return;(ae=D[$])&&(ge=pe,0<=f.a.A(R,ge)?ge=!1:(ae=ge.match(E),ge=ae===null?!1:ae[1]?"Object("+ae[1]+")"+ae[2]:ge),ae=ge),ae&&K.push("'"+(typeof D[$]=="string"?D[$]:$)+"':function(_z){"+ge+"=_z}")}ee&&(pe="function(){return "+pe+" }"),J.push("'"+$+"':"+pe)}Y=Y||{};var J=[],K=[],ee=Y.valueAccessors,H=Y.bindingParams,j=typeof k=="string"?b(k):k;return f.a.D(j,function($){U($.key||$.unknown,$.value)}),K.length&&U("_ko_property_writers","{"+K.join(",")+" }"),J.join(",")},Id:function(k,Y){for(var U=0;U<k.length;U++)if(k[U].key==Y)return!0;return!1},eb:function(k,Y,U,J,K){k&&f.O(k)?!f.Za(k)||K&&k.v()===J||k(J):(k=Y.get("_ko_property_writers"))&&k[U]&&k[U](J)}}}(),f.b("expressionRewriting",f.m),f.b("expressionRewriting.bindingRewriteValidators",f.m.Ra),f.b("expressionRewriting.parseObjectLiteral",f.m.ac),f.b("expressionRewriting.preProcessBindings",f.m.vb),f.b("expressionRewriting._twoWayBindings",f.m.wa),f.b("jsonExpressionRewriting",f.m),f.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",f.m.vb),function(){function b(U){return U.nodeType==8&&N.test(w?U.text:U.nodeValue)}function R(U){return U.nodeType==8&&D.test(w?U.text:U.nodeValue)}function E(U,J){for(var K=U,ee=1,H=[];K=K.nextSibling;){if(R(K)&&(f.a.g.set(K,Y,!0),ee--,ee===0))return H;H.push(K),b(K)&&ee++}if(!J)throw Error("Cannot find closing comment tag to match: "+U.nodeValue);return null}function X(U,J){var K=E(U,J);return K?0<K.length?K[K.length-1].nextSibling:U.nextSibling:null}var w=n&&n.createComment("test").text==="<!--test-->",N=w?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,D=w?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,k={ul:!0,ol:!0},Y="__ko_matchedEndComment__";f.h={ea:{},childNodes:function(U){return b(U)?E(U):U.childNodes},Ea:function(U){if(b(U)){U=f.h.childNodes(U);for(var J=0,K=U.length;J<K;J++)f.removeNode(U[J])}else f.a.Tb(U)},va:function(U,J){if(b(U)){f.h.Ea(U);for(var K=U.nextSibling,ee=0,H=J.length;ee<H;ee++)K.parentNode.insertBefore(J[ee],K)}else f.a.va(U,J)},Vc:function(U,J){var K;b(U)?(K=U.nextSibling,U=U.parentNode):K=U.firstChild,K?J!==K&&U.insertBefore(J,K):U.appendChild(J)},Wb:function(U,J,K){K?(K=K.nextSibling,b(U)&&(U=U.parentNode),K?J!==K&&U.insertBefore(J,K):U.appendChild(J)):f.h.Vc(U,J)},firstChild:function(U){if(b(U))return!U.nextSibling||R(U.nextSibling)?null:U.nextSibling;if(U.firstChild&&R(U.firstChild))throw Error("Found invalid end comment, as the first child of "+U);return U.firstChild},nextSibling:function(U){if(b(U)&&(U=X(U)),U.nextSibling&&R(U.nextSibling)){var J=U.nextSibling;if(R(J)&&!f.a.g.get(J,Y))throw Error("Found end comment without a matching opening comment, as child of "+U);return null}return U.nextSibling},Cd:b,Vd:function(U){return(U=(w?U.text:U.nodeValue).match(N))?U[1]:null},Sc:function(U){if(k[f.a.R(U)]){var J=U.firstChild;if(J)do if(J.nodeType===1){var K;K=J.firstChild;var ee=null;if(K)do if(ee)ee.push(K);else if(b(K)){var H=X(K,!0);H?K=H:ee=[K]}else R(K)&&(ee=[K]);while(K=K.nextSibling);if(K=ee)for(ee=J.nextSibling,H=0;H<K.length;H++)ee?U.insertBefore(K[H],ee):U.appendChild(K[H])}while(J=J.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.Wb),f.b("virtualElements.prepend",f.h.Vc),f.b("virtualElements.setDomNodeChildren",f.h.va),function(){f.ga=function(){this.nd={}},f.a.extend(f.ga.prototype,{nodeHasBindings:function(b){switch(b.nodeType){case 1:return b.getAttribute("data-bind")!=null||f.j.getComponentNameForNode(b);case 8:return f.h.Cd(b);default:return!1}},getBindings:function(b,R){var E=this.getBindingsString(b,R),E=E?this.parseBindingsString(E,R,b):null;return f.j.tc(E,b,R,!1)},getBindingAccessors:function(b,R){var E=this.getBindingsString(b,R),E=E?this.parseBindingsString(E,R,b,{valueAccessors:!0}):null;return f.j.tc(E,b,R,!0)},getBindingsString:function(b){switch(b.nodeType){case 1:return b.getAttribute("data-bind");case 8:return f.h.Vd(b);default:return null}},parseBindingsString:function(b,R,E,X){try{var w=this.nd,N=b+(X&&X.valueAccessors||""),D;if(!(D=w[N])){var k,Y="with($context){with($data||{}){return{"+f.m.vb(b,X)+"}}}";k=new Function("$context","$element",Y),D=w[N]=k}return D(R,E)}catch(U){throw U.message=`Unable to parse bindings.
Bindings value: `+b+`
Message: `+U.message,U}}}),f.ga.instance=new f.ga}(),f.b("bindingProvider",f.ga),function(){function b(ae){var be=(ae=f.a.g.get(ae,ge))&&ae.N;be&&(ae.N=null,be.Tc())}function R(ae,be,_e){this.node=ae,this.yc=be,this.kb=[],this.H=!1,be.N||f.a.K.za(ae,b),_e&&_e.N&&(_e.N.kb.push(ae),this.Kb=_e)}function E(ae){return function(){return ae}}function X(ae){return ae()}function w(ae){return f.a.Ga(f.u.G(ae),function(be,_e){return function(){return ae()[_e]}})}function N(ae,be,_e){return typeof ae=="function"?w(ae.bind(null,be,_e)):f.a.Ga(ae,E)}function D(ae,be){return w(this.getBindings.bind(this,ae,be))}function k(ae,be){var _e=f.h.firstChild(be);if(_e){var Ze,Le=f.ga.instance,Ee=Le.preprocessNode;if(Ee){for(;Ze=_e;)_e=f.h.nextSibling(Ze),Ee.call(Le,Ze);_e=f.h.firstChild(be)}for(;Ze=_e;)_e=f.h.nextSibling(Ze),Y(ae,Ze)}f.i.ma(be,f.i.H)}function Y(ae,be){var _e=ae,Ze=be.nodeType===1;Ze&&f.h.Sc(be),(Ze||f.ga.instance.nodeHasBindings(be))&&(_e=J(be,null,ae).bindingContextForDescendants),_e&&!$[f.a.R(be)]&&k(_e,be)}function U(ae){var be=[],_e={},Ze=[];return f.a.P(ae,function Le(Ee){if(!_e[Ee]){var He=f.getBindingHandler(Ee);He&&(He.after&&(Ze.push(Ee),f.a.D(He.after,function(we){if(ae[we]){if(f.a.A(Ze,we)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+Ze.join(", "));Le(we)}}),Ze.length--),be.push({key:Ee,Mc:He})),_e[Ee]=!0}}),be}function J(ae,be,_e){var Ze=f.a.g.Ub(ae,ge,{}),Le=Ze.hd;if(!be){if(Le)throw Error("You cannot apply bindings multiple times to the same element.");Ze.hd=!0}Le||(Ze.context=_e),Ze.Zb||(Ze.Zb={});var Ee;if(be&&typeof be!="function")Ee=be;else{var He=f.ga.instance,we=He.getBindingAccessors||D,dt=f.$(function(){return(Ee=be?be(_e,ae):we.call(He,ae,_e))&&(_e[ee]&&_e[ee](),_e[j]&&_e[j]()),Ee},null,{l:ae});Ee&&dt.ja()||(dt=null)}var bt=_e,it;if(Ee){var en=function(){return f.a.Ga(dt?dt():Ee,X)},_n=dt?function(kt){return function(){return X(dt()[kt])}}:function(kt){return Ee[kt]};en.get=function(kt){return Ee[kt]&&X(_n(kt))},en.has=function(kt){return kt in Ee},f.i.H in Ee&&f.i.subscribe(ae,f.i.H,function(){var kt=(0,Ee[f.i.H])();if(kt){var At=f.h.childNodes(ae);At.length&&kt(At,f.Ec(At[0]))}}),f.i.pa in Ee&&(bt=f.i.Cb(ae,_e),f.i.subscribe(ae,f.i.pa,function(){var kt=(0,Ee[f.i.pa])();kt&&f.h.firstChild(ae)&&kt(ae)})),Ze=U(Ee),f.a.D(Ze,function(kt){var At=kt.Mc.init,Te=kt.Mc.update,Re=kt.key;if(ae.nodeType===8&&!f.h.ea[Re])throw Error("The binding '"+Re+"' cannot be used with virtual elements");try{typeof At=="function"&&f.u.G(function(){var ct=At(ae,_n(Re),en,bt.$data,bt);if(ct&&ct.controlsDescendantBindings){if(it!==e)throw Error("Multiple bindings ("+it+" and "+Re+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");it=Re}}),typeof Te=="function"&&f.$(function(){Te(ae,_n(Re),en,bt.$data,bt)},null,{l:ae})}catch(ct){throw ct.message='Unable to process binding "'+Re+": "+Ee[Re]+`"
Message: `+ct.message,ct}})}return Ze=it===e,{shouldBindDescendants:Ze,bindingContextForDescendants:Ze&&bt}}function K(ae,be){return ae&&ae instanceof f.fa?ae:new f.fa(ae,e,e,be)}var ee=f.a.Da("_subscribable"),H=f.a.Da("_ancestorBindingInfo"),j=f.a.Da("_dataDependency");f.c={};var $={script:!0,textarea:!0,template:!0};f.getBindingHandler=function(ae){return f.c[ae]};var pe={};f.fa=function(ae,be,_e,Ze,Le){function Ee(){var _n=bt?dt():dt,kt=f.a.f(_n);return be?(f.a.extend(He,be),H in be&&(He[H]=be[H])):(He.$parents=[],He.$root=kt,He.ko=f),He[ee]=it,we?kt=He.$data:(He.$rawData=_n,He.$data=kt),_e&&(He[_e]=kt),Ze&&Ze(He,be,kt),be&&be[ee]&&!f.S.o().Vb(be[ee])&&be[ee](),en&&(He[j]=en),He.$data}var He=this,we=ae===pe,dt=we?e:ae,bt=typeof dt=="function"&&!f.O(dt),it,en=Le&&Le.dataDependency;Le&&Le.exportDependencies?Ee():(it=f.xb(Ee),it.v(),it.ja()?it.equalityComparer=null:He[ee]=e)},f.fa.prototype.createChildContext=function(ae,be,_e,Ze){if(!Ze&&be&&typeof be=="object"&&(Ze=be,be=Ze.as,_e=Ze.extend),be&&Ze&&Ze.noChildContext){var Le=typeof ae=="function"&&!f.O(ae);return new f.fa(pe,this,null,function(Ee){_e&&_e(Ee),Ee[be]=Le?ae():ae},Ze)}return new f.fa(ae,this,be,function(Ee,He){Ee.$parentContext=He,Ee.$parent=He.$data,Ee.$parents=(He.$parents||[]).slice(0),Ee.$parents.unshift(Ee.$parent),_e&&_e(Ee)},Ze)},f.fa.prototype.extend=function(ae,be){return new f.fa(pe,this,null,function(_e){f.a.extend(_e,typeof ae=="function"?ae(_e):ae)},be)};var ge=f.a.g.Z();R.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},R.prototype.sd=function(ae){f.a.Pa(this.kb,ae),!this.kb.length&&this.H&&this.Cc()},R.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,f.a.K.yb(this.node,b),f.i.ma(this.node,f.i.pa),this.Tc())},f.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(ae,be,_e,Ze,Le){var Ee=f.a.g.Ub(ae,ge,{});return Ee.Fa||(Ee.Fa=new f.T),Le&&Le.notifyImmediately&&Ee.Zb[be]&&f.u.G(_e,Ze,[ae]),Ee.Fa.subscribe(_e,Ze,be)},ma:function(ae,be){var _e=f.a.g.get(ae,ge);if(_e&&(_e.Zb[be]=!0,_e.Fa&&_e.Fa.notifySubscribers(ae,be),be==f.i.H)){if(_e.N)_e.N.Cc();else if(_e.N===e&&_e.Fa&&_e.Fa.Wa(f.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(ae,be){var _e=f.a.g.Ub(ae,ge,{});return _e.N||(_e.N=new R(ae,_e,be[H])),be[H]==_e?be:be.extend(function(Ze){Ze[H]=_e})}},f.Td=function(ae){return(ae=f.a.g.get(ae,ge))&&ae.context},f.ib=function(ae,be,_e){return ae.nodeType===1&&f.h.Sc(ae),J(ae,be,K(_e))},f.ld=function(ae,be,_e){return _e=K(_e),f.ib(ae,N(be,_e,ae),_e)},f.Oa=function(ae,be){be.nodeType!==1&&be.nodeType!==8||k(K(ae),be)},f.vc=function(ae,be,_e){if(!o&&t.jQuery&&(o=t.jQuery),2>arguments.length){if(be=n.body,!be)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!be||be.nodeType!==1&&be.nodeType!==8)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");Y(K(ae,_e),be)},f.Dc=function(ae){return!ae||ae.nodeType!==1&&ae.nodeType!==8?e:f.Td(ae)},f.Ec=function(ae){return(ae=f.Dc(ae))?ae.$data:e},f.b("bindingHandlers",f.c),f.b("bindingEvent",f.i),f.b("bindingEvent.subscribe",f.i.subscribe),f.b("bindingEvent.startPossiblyAsyncContentBinding",f.i.Cb),f.b("applyBindings",f.vc),f.b("applyBindingsToDescendants",f.Oa),f.b("applyBindingAccessorsToNode",f.ib),f.b("applyBindingsToNode",f.ld),f.b("contextFor",f.Dc),f.b("dataFor",f.Ec)}(),function(b){function R(D,k){var Y=Object.prototype.hasOwnProperty.call(w,D)?w[D]:b,U;Y?Y.subscribe(k):(Y=w[D]=new f.T,Y.subscribe(k),E(D,function(J,K){var ee=!(!K||!K.synchronous);N[D]={definition:J,Gd:ee},delete w[D],U||ee?Y.notifySubscribers(J):f.na.zb(function(){Y.notifySubscribers(J)})}),U=!0)}function E(D,k){X("getConfig",[D],function(Y){Y?X("loadComponent",[D,Y],function(U){k(U,Y)}):k(null,null)})}function X(D,k,Y,U){U||(U=f.j.loaders.slice(0));var J=U.shift();if(J){var K=J[D];if(K){var ee=!1;if(K.apply(J,k.concat(function(H){ee?Y(null):H!==null?Y(H):X(D,k,Y,U)}))!==b&&(ee=!0,!J.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else X(D,k,Y,U)}else Y(null)}var w={},N={};f.j={get:function(D,k){var Y=Object.prototype.hasOwnProperty.call(N,D)?N[D]:b;Y?Y.Gd?f.u.G(function(){k(Y.definition)}):f.na.zb(function(){k(Y.definition)}):R(D,k)},Bc:function(D){delete N[D]},oc:X},f.j.loaders=[],f.b("components",f.j),f.b("components.get",f.j.get),f.b("components.clearCachedDefinition",f.j.Bc)}(),function(){function b(Y,U,J,K){function ee(){--j===0&&K(H)}var H={},j=2,$=J.template;J=J.viewModel,$?w(U,$,function(pe){f.j.oc("loadTemplate",[Y,pe],function(ge){H.template=ge,ee()})}):ee(),J?w(U,J,function(pe){f.j.oc("loadViewModel",[Y,pe],function(ge){H[k]=ge,ee()})}):ee()}function R(Y,U,J){if(typeof U=="function")J(function(ee){return new U(ee)});else if(typeof U[k]=="function")J(U[k]);else if("instance"in U){var K=U.instance;J(function(){return K})}else"viewModel"in U?R(Y,U.viewModel,J):Y("Unknown viewModel value: "+U)}function E(Y){switch(f.a.R(Y)){case"script":return f.a.ua(Y.text);case"textarea":return f.a.ua(Y.value);case"template":if(X(Y.content))return f.a.Ca(Y.content.childNodes)}return f.a.Ca(Y.childNodes)}function X(Y){return t.DocumentFragment?Y instanceof DocumentFragment:Y&&Y.nodeType===11}function w(Y,U,J){typeof U.require=="string"?a||t.require?(a||t.require)([U.require],function(K){K&&typeof K=="object"&&K.Xd&&K.default&&(K=K.default),J(K)}):Y("Uses require, but no AMD loader is present"):J(U)}function N(Y){return function(U){throw Error("Component '"+Y+"': "+U)}}var D={};f.j.register=function(Y,U){if(!U)throw Error("Invalid configuration for "+Y);if(f.j.tb(Y))throw Error("Component "+Y+" is already registered");D[Y]=U},f.j.tb=function(Y){return Object.prototype.hasOwnProperty.call(D,Y)},f.j.unregister=function(Y){delete D[Y],f.j.Bc(Y)},f.j.Fc={getConfig:function(Y,U){U(f.j.tb(Y)?D[Y]:null)},loadComponent:function(Y,U,J){var K=N(Y);w(K,U,function(ee){b(Y,K,ee,J)})},loadTemplate:function(Y,U,J){if(Y=N(Y),typeof U=="string")J(f.a.ua(U));else if(U instanceof Array)J(U);else if(X(U))J(f.a.la(U.childNodes));else if(U.element)if(U=U.element,t.HTMLElement?U instanceof HTMLElement:U&&U.tagName&&U.nodeType===1)J(E(U));else if(typeof U=="string"){var K=n.getElementById(U);K?J(E(K)):Y("Cannot find element with ID "+U)}else Y("Unknown element type: "+U);else Y("Unknown template value: "+U)},loadViewModel:function(Y,U,J){R(N(Y),U,J)}};var k="createViewModel";f.b("components.register",f.j.register),f.b("components.isRegistered",f.j.tb),f.b("components.unregister",f.j.unregister),f.b("components.defaultLoader",f.j.Fc),f.j.loaders.push(f.j.Fc),f.j.dd=D}(),function(){function b(E,X){var w=E.getAttribute("params");if(w){var w=R.parseBindingsString(w,X,E,{valueAccessors:!0,bindingParams:!0}),w=f.a.Ga(w,function(k){return f.o(k,null,{l:E})}),N=f.a.Ga(w,function(k){var Y=k.v();return k.ja()?f.o({read:function(){return f.a.f(k())},write:f.Za(Y)&&function(U){k()(U)},l:E}):Y});return Object.prototype.hasOwnProperty.call(N,"$raw")||(N.$raw=w),N}return{$raw:{}}}f.j.getComponentNameForNode=function(E){var X=f.a.R(E);if(f.j.tb(X)&&(X.indexOf("-")!=-1||""+E=="[object HTMLUnknownElement]"||8>=f.a.W&&E.tagName===X))return X},f.j.tc=function(E,X,w,N){if(X.nodeType===1){var D=f.j.getComponentNameForNode(X);if(D){if(E=E||{},E.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var k={name:D,params:b(X,w)};E.component=N?function(){return k}:k}}return E};var R=new f.ga;9>f.a.W&&(f.j.register=function(E){return function(X){return E.apply(this,arguments)}}(f.j.register),n.createDocumentFragment=function(E){return function(){var X=E(),w=f.j.dd,N;for(N in w);return X}}(n.createDocumentFragment))}(),function(){function b(X,w,N){if(w=w.template,!w)throw Error("Component '"+X+"' has no template");X=f.a.Ca(w),f.h.va(N,X)}function R(X,w,N){var D=X.createViewModel;return D?D.call(X,w,N):w}var E=0;f.c.component={init:function(X,w,N,D,k){function Y(){var H=U&&U.dispose;typeof H=="function"&&H.call(U),K&&K.s(),J=U=K=null}var U,J,K,ee=f.a.la(f.h.childNodes(X));return f.h.Ea(X),f.a.K.za(X,Y),f.o(function(){var H=f.a.f(w()),j,$;if(typeof H=="string"?j=H:(j=f.a.f(H.name),$=f.a.f(H.params)),!j)throw Error("No component name specified");var pe=f.i.Cb(X,k),ge=J=++E;f.j.get(j,function(ae){if(J===ge){if(Y(),!ae)throw Error("Unknown component '"+j+"'");b(j,ae,X);var be=R(ae,$,{element:X,templateNodes:ee});ae=pe.createChildContext(be,{extend:function(_e){_e.$component=be,_e.$componentTemplateNodes=ee}}),be&&be.koDescendantsComplete&&(K=f.i.subscribe(X,f.i.pa,be.koDescendantsComplete,be)),U=be,f.Oa(ae,X)}})},null,{l:X}),{controlsDescendantBindings:!0}}},f.h.ea.component=!0}();var F={class:"className",for:"htmlFor"};f.c.attr={update:function(b,R){var E=f.a.f(R())||{};f.a.P(E,function(X,w){w=f.a.f(w);var N=X.indexOf(":"),N="lookupNamespaceURI"in b&&0<N&&b.lookupNamespaceURI(X.substr(0,N)),D=w===!1||w===null||w===e;D?N?b.removeAttributeNS(N,X):b.removeAttribute(X):w=w.toString(),8>=f.a.W&&X in F?(X=F[X],D?b.removeAttribute(X):b[X]=w):D||(N?b.setAttributeNS(N,X,w):b.setAttribute(X,w)),X==="name"&&f.a.Yc(b,D?"":w)})}},function(){f.c.checked={after:["value","attr"],init:function(b,R,E){function X(){var H=b.checked,j=N();if(!f.S.Ya()&&(H||!k&&!f.S.qa())){var $=f.u.G(R);if(U){var pe=J?$.v():$,ge=ee;ee=j,ge!==j?H&&(f.a.Na(pe,j,!0),f.a.Na(pe,ge,!1)):f.a.Na(pe,j,H),J&&f.Za($)&&$(pe)}else D&&(j===e?j=H:H||(j=e)),f.m.eb($,E,"checked",j,!0)}}function w(){var H=f.a.f(R()),j=N();U?(b.checked=0<=f.a.A(H,j),ee=j):b.checked=D&&j===e?!!H:N()===H}var N=f.xb(function(){if(E.has("checkedValue"))return f.a.f(E.get("checkedValue"));if(K)return E.has("value")?f.a.f(E.get("value")):b.value}),D=b.type=="checkbox",k=b.type=="radio";if(D||k){var Y=R(),U=D&&f.a.f(Y)instanceof Array,J=!(U&&Y.push&&Y.splice),K=k||U,ee=U?N():e;k&&!b.name&&f.c.uniqueName.init(b,function(){return!0}),f.o(X,null,{l:b}),f.a.B(b,"click",X),f.o(w,null,{l:b}),Y=e}}},f.m.wa.checked=!0,f.c.checkedValue={update:function(b,R){b.value=f.a.f(R())}}}(),f.c.class={update:function(b,R){var E=f.a.Db(f.a.f(R()));f.a.Eb(b,b.__ko__cssValue,!1),b.__ko__cssValue=E,f.a.Eb(b,E,!0)}},f.c.css={update:function(b,R){var E=f.a.f(R());E!==null&&typeof E=="object"?f.a.P(E,function(X,w){w=f.a.f(w),f.a.Eb(b,X,w)}):f.c.class.update(b,R)}},f.c.enable={update:function(b,R){var E=f.a.f(R());E&&b.disabled?b.removeAttribute("disabled"):E||b.disabled||(b.disabled=!0)}},f.c.disable={update:function(b,R){f.c.enable.update(b,function(){return!f.a.f(R())})}},f.c.event={init:function(b,R,E,X,w){var N=R()||{};f.a.P(N,function(D){typeof D=="string"&&f.a.B(b,D,function(k){var Y,U=R()[D];if(U){try{var J=f.a.la(arguments);X=w.$data,J.unshift(X),Y=U.apply(X,J)}finally{Y!==!0&&(k.preventDefault?k.preventDefault():k.returnValue=!1)}E.get(D+"Bubble")===!1&&(k.cancelBubble=!0,k.stopPropagation&&k.stopPropagation())}})})}},f.c.foreach={Rc:function(b){return function(){var R=b(),E=f.a.bc(R);return!E||typeof E.length=="number"?{foreach:R,templateEngine:f.ba.Ma}:(f.a.f(R),{foreach:E.data,as:E.as,noChildContext:E.noChildContext,includeDestroyed:E.includeDestroyed,afterAdd:E.afterAdd,beforeRemove:E.beforeRemove,afterRender:E.afterRender,beforeMove:E.beforeMove,afterMove:E.afterMove,templateEngine:f.ba.Ma})}},init:function(b,R){return f.c.template.init(b,f.c.foreach.Rc(R))},update:function(b,R,E,X,w){return f.c.template.update(b,f.c.foreach.Rc(R),E,X,w)}},f.m.Ra.foreach=!1,f.h.ea.foreach=!0,f.c.hasfocus={init:function(b,R,E){function X(D){b.__ko_hasfocusUpdating=!0;var k=b.ownerDocument;if("activeElement"in k){var Y;try{Y=k.activeElement}catch{Y=k.body}D=Y===b}k=R(),f.m.eb(k,E,"hasfocus",D,!0),b.__ko_hasfocusLastValue=D,b.__ko_hasfocusUpdating=!1}var w=X.bind(null,!0),N=X.bind(null,!1);f.a.B(b,"focus",w),f.a.B(b,"focusin",w),f.a.B(b,"blur",N),f.a.B(b,"focusout",N),b.__ko_hasfocusLastValue=!1},update:function(b,R){var E=!!f.a.f(R());b.__ko_hasfocusUpdating||b.__ko_hasfocusLastValue===E||(E?b.focus():b.blur(),!E&&b.__ko_hasfocusLastValue&&b.ownerDocument.body.focus(),f.u.G(f.a.Fb,null,[b,E?"focusin":"focusout"]))}},f.m.wa.hasfocus=!0,f.c.hasFocus=f.c.hasfocus,f.m.wa.hasFocus="hasfocus",f.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(b,R){f.a.fc(b,R())}},function(){function b(R,E,X){f.c[R]={init:function(w,N,D,k,Y){var U,J,K={},ee,H,j;if(E){k=D.get("as");var $=D.get("noChildContext");j=!(k&&$),K={as:k,noChildContext:$,exportDependencies:j}}return H=(ee=D.get("completeOn")=="render")||D.has(f.i.pa),f.o(function(){var pe=f.a.f(N()),ge=!X!=!pe,ae=!J,be;(j||ge!==U)&&(H&&(Y=f.i.Cb(w,Y)),ge&&((!E||j)&&(K.dataDependency=f.S.o()),be=E?Y.createChildContext(typeof pe=="function"?pe:N,K):f.S.qa()?Y.extend(null,K):Y),ae&&f.S.qa()&&(J=f.a.Ca(f.h.childNodes(w),!0)),ge?(ae||f.h.va(w,f.a.Ca(J)),f.Oa(be,w)):(f.h.Ea(w),ee||f.i.ma(w,f.i.H)),U=ge)},null,{l:w}),{controlsDescendantBindings:!0}}},f.m.Ra[R]=!1,f.h.ea[R]=!0}b("if"),b("ifnot",!1,!0),b("with",!0)}(),f.c.let={init:function(b,R,E,X,w){return R=w.extend(R),f.Oa(R,b),{controlsDescendantBindings:!0}}},f.h.ea.let=!0;var M={};f.c.options={init:function(b){if(f.a.R(b)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<b.length;)b.remove(0);return{controlsDescendantBindings:!0}},update:function(b,R,E){function X(){return f.a.jb(b.options,function($){return $.selected})}function w($,pe,ge){var ae=typeof pe;return ae=="function"?pe($):ae=="string"?$[pe]:ge}function N($,pe){if(H&&U)f.i.ma(b,f.i.H);else if(ee.length){var ge=0<=f.a.A(ee,f.w.M(pe[0]));f.a.Zc(pe[0],ge),H&&!ge&&f.u.G(f.a.Fb,null,[b,"change"])}}var D=b.multiple,k=b.length!=0&&D?b.scrollTop:null,Y=f.a.f(R()),U=E.get("valueAllowUnset")&&E.has("value"),J=E.get("optionsIncludeDestroyed");R={};var K,ee=[];U||(D?ee=f.a.Mb(X(),f.w.M):0<=b.selectedIndex&&ee.push(f.w.M(b.options[b.selectedIndex]))),Y&&(typeof Y.length>"u"&&(Y=[Y]),K=f.a.jb(Y,function($){return J||$===e||$===null||!f.a.f($._destroy)}),E.has("optionsCaption")&&(Y=f.a.f(E.get("optionsCaption")),Y!==null&&Y!==e&&K.unshift(M)));var H=!1;if(R.beforeRemove=function($){b.removeChild($)},Y=N,E.has("optionsAfterRender")&&typeof E.get("optionsAfterRender")=="function"&&(Y=function($,pe){N(0,pe),f.u.G(E.get("optionsAfterRender"),null,[pe[0],$!==M?$:e])}),f.a.ec(b,K,function($,pe,ge){return ge.length&&(ee=!U&&ge[0].selected?[f.w.M(ge[0])]:[],H=!0),pe=b.ownerDocument.createElement("option"),$===M?(f.a.Bb(pe,E.get("optionsCaption")),f.w.cb(pe,e)):(ge=w($,E.get("optionsValue"),$),f.w.cb(pe,f.a.f(ge)),$=w($,E.get("optionsText"),ge),f.a.Bb(pe,$)),[pe]},R,Y),!U){var j;D?j=ee.length&&X().length<ee.length:j=ee.length&&0<=b.selectedIndex?f.w.M(b.options[b.selectedIndex])!==ee[0]:ee.length||0<=b.selectedIndex,j&&f.u.G(f.a.Fb,null,[b,"change"])}(U||f.S.Ya())&&f.i.ma(b,f.i.H),f.a.wd(b),k&&20<Math.abs(k-b.scrollTop)&&(b.scrollTop=k)}},f.c.options.$b=f.a.g.Z(),f.c.selectedOptions={init:function(b,R,E){function X(){var D=R(),k=[];f.a.D(b.getElementsByTagName("option"),function(Y){Y.selected&&k.push(f.w.M(Y))}),f.m.eb(D,E,"selectedOptions",k)}function w(){var D=f.a.f(R()),k=b.scrollTop;D&&typeof D.length=="number"&&f.a.D(b.getElementsByTagName("option"),function(Y){var U=0<=f.a.A(D,f.w.M(Y));Y.selected!=U&&f.a.Zc(Y,U)}),b.scrollTop=k}if(f.a.R(b)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var N;f.i.subscribe(b,f.i.H,function(){N?X():(f.a.B(b,"change",X),N=f.o(w,null,{l:b}))},null,{notifyImmediately:!0})},update:function(){}},f.m.wa.selectedOptions=!0,f.c.style={update:function(b,R){var E=f.a.f(R()||{});f.a.P(E,function(X,w){if(w=f.a.f(w),(w===null||w===e||w===!1)&&(w=""),o)o(b).css(X,w);else if(/^--/.test(X))b.style.setProperty(X,w);else{X=X.replace(/-(\w)/g,function(D,k){return k.toUpperCase()});var N=b.style[X];b.style[X]=w,w===N||b.style[X]!=N||isNaN(w)||(b.style[X]=w+"px")}})}},f.c.submit={init:function(b,R,E,X,w){if(typeof R()!="function")throw Error("The value for a submit binding must be a function");f.a.B(b,"submit",function(N){var D,k=R();try{D=k.call(w.$data,b)}finally{D!==!0&&(N.preventDefault?N.preventDefault():N.returnValue=!1)}})}},f.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(b,R){f.a.Bb(b,R())}},f.h.ea.text=!0,function(){if(t&&t.navigator){var b=function(K){if(K)return parseFloat(K[1])},R=t.navigator.userAgent,E,X,w,N,D;(E=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(D=b(R.match(/Edge\/([^ ]+)$/)))||b(R.match(/Chrome\/([^ ]+)/))||(X=b(R.match(/Version\/([^ ]+) Safari/)))||(w=b(R.match(/Firefox\/([^ ]+)/)))||(N=f.a.W||b(R.match(/MSIE ([^ ]+)/)))||(N=b(R.match(/rv:([^ )]+)/)))}if(8<=N&&10>N)var k=f.a.g.Z(),Y=f.a.g.Z(),U=function(K){var ee=this.activeElement;(ee=ee&&f.a.g.get(ee,Y))&&ee(K)},J=function(K,ee){var H=K.ownerDocument;f.a.g.get(H,k)||(f.a.g.set(H,k,!0),f.a.B(H,"selectionchange",U)),f.a.g.set(K,Y,ee)};f.c.textInput={init:function(K,ee,H){function j(Ee,He){f.a.B(K,Ee,He)}function $(){var Ee=f.a.f(ee());(Ee===null||Ee===e)&&(Ee=""),_e!==e&&Ee===_e?f.a.setTimeout($,4):K.value!==Ee&&(Le=!0,K.value=Ee,Le=!1,ae=K.value)}function pe(){be||(_e=K.value,be=f.a.setTimeout(ge,4))}function ge(){clearTimeout(be),_e=be=e;var Ee=K.value;ae!==Ee&&(ae=Ee,f.m.eb(ee(),H,"textInput",Ee))}var ae=K.value,be,_e,Ze=f.a.W==9?pe:ge,Le=!1;N&&j("keypress",ge),11>N&&j("propertychange",function(Ee){Le||Ee.propertyName!=="value"||Ze(Ee)}),N==8&&(j("keyup",ge),j("keydown",ge)),J&&(J(K,Ze),j("dragend",pe)),(!N||9<=N)&&j("input",Ze),5>X&&f.a.R(K)==="textarea"?(j("keydown",pe),j("paste",pe),j("cut",pe)):11>E?j("keydown",pe):4>w?(j("DOMAutoComplete",ge),j("dragdrop",ge),j("drop",ge)):D&&K.type==="number"&&j("keydown",pe),j("change",ge),j("blur",ge),f.o($,null,{l:K})}},f.m.wa.textInput=!0,f.c.textinput={preprocess:function(K,ee,H){H("textInput",K)}}}(),f.c.uniqueName={init:function(b,R){if(R()){var E="ko_unique_"+ ++f.c.uniqueName.rd;f.a.Yc(b,E)}}},f.c.uniqueName.rd=0,f.c.using={init:function(b,R,E,X,w){var N;return E.has("as")&&(N={as:E.get("as"),noChildContext:E.get("noChildContext")}),R=w.createChildContext(R,N),f.Oa(R,b),{controlsDescendantBindings:!0}}},f.h.ea.using=!0,f.c.value={init:function(b,R,E){var X=f.a.R(b),w=X=="input";if(!w||b.type!="checkbox"&&b.type!="radio"){var N=[],D=E.get("valueUpdate"),k=!1,Y=null;D&&(typeof D=="string"?N=[D]:N=f.a.wc(D),f.a.Pa(N,"change"));var U=function(){Y=null,k=!1;var ee=R(),H=f.w.M(b);f.m.eb(ee,E,"value",H)};!f.a.W||!w||b.type!="text"||b.autocomplete=="off"||b.form&&b.form.autocomplete=="off"||f.a.A(N,"propertychange")!=-1||(f.a.B(b,"propertychange",function(){k=!0}),f.a.B(b,"focus",function(){k=!1}),f.a.B(b,"blur",function(){k&&U()})),f.a.D(N,function(ee){var H=U;f.a.Ud(ee,"after")&&(H=function(){Y=f.w.M(b),f.a.setTimeout(U,0)},ee=ee.substring(5)),f.a.B(b,ee,H)});var J;if(J=w&&b.type=="file"?function(){var ee=f.a.f(R());ee===null||ee===e||ee===""?b.value="":f.u.G(U)}:function(){var ee=f.a.f(R()),H=f.w.M(b);Y!==null&&ee===Y?f.a.setTimeout(J,0):(ee!==H||H===e)&&(X==="select"?(H=E.get("valueAllowUnset"),f.w.cb(b,ee,H),H||ee===f.w.M(b)||f.u.G(U)):f.w.cb(b,ee))},X==="select"){var K;f.i.subscribe(b,f.i.H,function(){K?E.get("valueAllowUnset")?J():U():(f.a.B(b,"change",U),K=f.o(J,null,{l:b}))},null,{notifyImmediately:!0})}else f.a.B(b,"change",U),f.o(J,null,{l:b})}else f.ib(b,{checkedValue:R})},update:function(){}},f.m.wa.value=!0,f.c.visible={update:function(b,R){var E=f.a.f(R()),X=b.style.display!="none";E&&!X?b.style.display="":!E&&X&&(b.style.display="none")}},f.c.hidden={update:function(b,R){f.c.visible.update(b,function(){return!f.a.f(R())})}},function(b){f.c[b]={init:function(R,E,X,w,N){return f.c.event.init.call(this,R,function(){var D={};return D[b]=E(),D},X,w,N)}}}("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(b,R){if(typeof b=="string"){R=R||n;var E=R.getElementById(b);if(!E)throw Error("Cannot find template with ID "+b);return new f.C.F(E)}if(b.nodeType==1||b.nodeType==8)return new f.C.ia(b);throw Error("Unknown template type: "+b)},f.ca.prototype.renderTemplate=function(b,R,E,X){return b=this.makeTemplateSource(b,X),this.renderTemplateSource(b,R,E,X)},f.ca.prototype.isTemplateRewritten=function(b,R){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(b,R).data("isRewritten")},f.ca.prototype.rewriteTemplate=function(b,R,E){b=this.makeTemplateSource(b,E),R=R(b.text()),b.text(R),b.data("isRewritten",!0)},f.b("templateEngine",f.ca),f.kc=function(){function b(X,w,N,D){X=f.m.ac(X);for(var k=f.m.Ra,Y=0;Y<X.length;Y++){var U=X[Y].key;if(Object.prototype.hasOwnProperty.call(k,U)){var J=k[U];if(typeof J=="function"){if(U=J(X[Y].value))throw Error(U)}else if(!J)throw Error("This template engine does not support the '"+U+"' binding within its templates")}}return N="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+f.m.vb(X,{valueAccessors:!0})+" } })()},'"+N.toLowerCase()+"')",D.createJavaScriptEvaluatorBlock(N)+w}var R=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,E=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(X,w,N){w.isTemplateRewritten(X,N)||w.rewriteTemplate(X,function(D){return f.kc.Ld(D,w)},N)},Ld:function(X,w){return X.replace(R,function(N,D,k,Y,U){return b(U,D,k,w)}).replace(E,function(N,D){return b(D,"<!-- ko -->","#comment",w)})},md:function(X,w){return f.aa.Xb(function(N,D){var k=N.nextSibling;k&&k.nodeName.toLowerCase()===w&&f.ib(k,X,D)})}}}(),f.b("__tr_ambtns",f.kc.md),function(){f.C={},f.C.F=function(E){if(this.F=E){var X=f.a.R(E);this.ab=X==="script"?1:X==="textarea"?2:X=="template"&&E.content&&E.content.nodeType===11?3:4}},f.C.F.prototype.text=function(){var E=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[E];var X=arguments[0];E==="innerHTML"?f.a.fc(this.F,X):this.F[E]=X};var b=f.a.g.Z()+"_";f.C.F.prototype.data=function(E){if(arguments.length===1)return f.a.g.get(this.F,b+E);f.a.g.set(this.F,b+E,arguments[1])};var R=f.a.g.Z();f.C.F.prototype.nodes=function(){var E=this.F;if(arguments.length==0){var X=f.a.g.get(E,R)||{},w=X.lb||(this.ab===3?E.content:this.ab===4?E:e);if(!w||X.jd){var N=this.text();N&&N!==X.bb&&(w=f.a.Md(N,E.ownerDocument),f.a.g.set(E,R,{lb:w,bb:N,jd:!0}))}return w}X=arguments[0],this.ab!==e&&this.text(""),f.a.g.set(E,R,{lb:X})},f.C.ia=function(E){this.F=E},f.C.ia.prototype=new f.C.F,f.C.ia.prototype.constructor=f.C.ia,f.C.ia.prototype.text=function(){if(arguments.length==0){var E=f.a.g.get(this.F,R)||{};return E.bb===e&&E.lb&&(E.bb=E.lb.innerHTML),E.bb}f.a.g.set(this.F,R,{bb:arguments[0]})},f.b("templateSources",f.C),f.b("templateSources.domElement",f.C.F),f.b("templateSources.anonymousTemplate",f.C.ia)}(),function(){function b(Y,U,J){var K;for(U=f.h.nextSibling(U);Y&&(K=Y)!==U;)Y=f.h.nextSibling(K),J(K,Y)}function R(Y,U){if(Y.length){var J=Y[0],K=Y[Y.length-1],ee=J.parentNode,H=f.ga.instance,j=H.preprocessNode;if(j){if(b(J,K,function($,pe){var ge=$.previousSibling,ae=j.call(H,$);ae&&($===J&&(J=ae[0]||pe),$===K&&(K=ae[ae.length-1]||ge))}),Y.length=0,!J)return;J===K?Y.push(J):(Y.push(J,K),f.a.Ua(Y,ee))}b(J,K,function($){$.nodeType!==1&&$.nodeType!==8||f.vc(U,$)}),b(J,K,function($){$.nodeType!==1&&$.nodeType!==8||f.aa.cd($,[U])}),f.a.Ua(Y,ee)}}function E(Y){return Y.nodeType?Y:0<Y.length?Y[0]:null}function X(Y,U,J,K,ee){ee=ee||{};var H=(Y&&E(Y)||J||{}).ownerDocument,j=ee.templateEngine||N;if(f.kc.xd(J,j,H),J=j.renderTemplate(J,K,ee,H),typeof J.length!="number"||0<J.length&&typeof J[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(H=!1,U){case"replaceChildren":f.h.va(Y,J),H=!0;break;case"replaceNode":f.a.Xc(Y,J),H=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+U)}return H&&(R(J,K),ee.afterRender&&f.u.G(ee.afterRender,null,[J,K[ee.as||"$data"]]),U=="replaceChildren"&&f.i.ma(Y,f.i.H)),J}function w(Y,U,J){return f.O(Y)?Y():typeof Y=="function"?Y(U,J):Y}var N;f.gc=function(Y){if(Y!=e&&!(Y instanceof f.ca))throw Error("templateEngine must inherit from ko.templateEngine");N=Y},f.dc=function(Y,U,J,K,ee){if(J=J||{},(J.templateEngine||N)==e)throw Error("Set a template engine before calling renderTemplate");if(ee=ee||"replaceChildren",K){var H=E(K);return f.$(function(){var $=U&&U instanceof f.fa?U:new f.fa(U,null,null,null,{exportDependencies:!0}),j=w(Y,$.$data,$),$=X(K,ee,j,$,J);ee=="replaceNode"&&(K=$,H=E(K))},null,{Sa:function(){return!H||!f.a.Sb(H)},l:H&&ee=="replaceNode"?H.parentNode:H})}return f.aa.Xb(function(j){f.dc(Y,U,J,j,"replaceNode")})},f.Qd=function(Y,U,J,K,ee){function H(_e,Ze){f.u.G(f.a.ec,null,[K,_e,$,J,j,Ze]),f.i.ma(K,f.i.H)}function j(_e,Ze){R(Ze,pe),J.afterRender&&J.afterRender(Ze,_e),pe=null}function $(_e,Ze){pe=ee.createChildContext(_e,{as:ge,noChildContext:J.noChildContext,extend:function(Ee){Ee.$index=Ze,ge&&(Ee[ge+"Index"]=Ze)}});var Le=w(Y,_e,pe);return X(K,"ignoreTargetNode",Le,pe,J)}var pe,ge=J.as,ae=J.includeDestroyed===!1||f.options.foreachHidesDestroyed&&!J.includeDestroyed;if(ae||J.beforeRemove||!f.Pc(U))return f.$(function(){var _e=f.a.f(U)||[];typeof _e.length>"u"&&(_e=[_e]),ae&&(_e=f.a.jb(_e,function(Ze){return Ze===e||Ze===null||!f.a.f(Ze._destroy)})),H(_e)},null,{l:K});H(U.v());var be=U.subscribe(function(_e){H(U(),_e)},null,"arrayChange");return be.l(K),be};var D=f.a.g.Z(),k=f.a.g.Z();f.c.template={init:function(Y,U){var J=f.a.f(U());if(typeof J=="string"||"name"in J)f.h.Ea(Y);else if("nodes"in J){if(J=J.nodes||[],f.O(J))throw Error('The "nodes" option must be a plain, non-observable array.');var K=J[0]&&J[0].parentNode;K&&f.a.g.get(K,k)||(K=f.a.Yb(J),f.a.g.set(K,k,!0)),new f.C.ia(Y).nodes(K)}else if(J=f.h.childNodes(Y),0<J.length)K=f.a.Yb(J),new f.C.ia(Y).nodes(K);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(Y,U,J,K,ee){var H=U();U=f.a.f(H),J=!0,K=null,typeof U=="string"?U={}:(H="name"in U?U.name:Y,"if"in U&&(J=f.a.f(U.if)),J&&"ifnot"in U&&(J=!f.a.f(U.ifnot)),J&&!H&&(J=!1)),"foreach"in U?K=f.Qd(H,J&&U.foreach||[],U,Y,ee):J?(J=ee,"data"in U&&(J=ee.createChildContext(U.data,{as:U.as,noChildContext:U.noChildContext,exportDependencies:!0})),K=f.dc(H,J,U,Y)):f.h.Ea(Y),ee=K,(U=f.a.g.get(Y,D))&&typeof U.s=="function"&&U.s(),f.a.g.set(Y,D,!ee||ee.ja&&!ee.ja()?e:ee)}},f.m.Ra.template=function(Y){return Y=f.m.ac(Y),Y.length==1&&Y[0].unknown||f.m.Id(Y,"name")?null:"This template engine does not support anonymous templates nested within its templates"},f.h.ea.template=!0}(),f.b("setTemplateEngine",f.gc),f.b("renderTemplate",f.dc),f.a.Kc=function(b,R,E){if(b.length&&R.length){var X,w,N,D,k;for(X=w=0;(!E||X<E)&&(D=b[w]);++w){for(N=0;k=R[N];++N)if(D.value===k.value){D.moved=k.index,k.moved=D.index,R.splice(N,1),X=N=0;break}X+=N}}},f.a.Pb=function(){function b(R,E,X,w,N){var D=Math.min,k=Math.max,Y=[],U,J=R.length,K,ee=E.length,H=ee-J||1,j=J+ee+1,$,pe,ge;for(U=0;U<=J;U++)for(pe=$,Y.push($=[]),ge=D(ee,U+H),K=k(0,U-1);K<=ge;K++)$[K]=K?U?R[U-1]===E[K-1]?pe[K-1]:D(pe[K]||j,$[K-1]||j)+1:K+1:U+1;for(D=[],k=[],H=[],U=J,K=ee;U||K;)ee=Y[U][K]-1,K&&ee===Y[U][K-1]?k.push(D[D.length]={status:X,value:E[--K],index:K}):U&&ee===Y[U-1][K]?H.push(D[D.length]={status:w,value:R[--U],index:U}):(--K,--U,N.sparse||D.push({status:"retained",value:E[K]}));return f.a.Kc(H,k,!N.dontLimitMoves&&10*J),D.reverse()}return function(R,E,X){return X=typeof X=="boolean"?{dontLimitMoves:X}:X||{},R=R||[],E=E||[],R.length<E.length?b(R,E,"added","deleted",X):b(E,R,"deleted","added",X)}}(),f.b("utils.compareArrays",f.a.Pb),function(){function b(X,w,N,D,k){var Y=[],U=f.$(function(){var J=w(N,k,f.a.Ua(Y,X))||[];0<Y.length&&(f.a.Xc(Y,J),D&&f.u.G(D,null,[N,J,k])),Y.length=0,f.a.Nb(Y,J)},null,{l:X,Sa:function(){return!f.a.kd(Y)}});return{Y,$:U.ja()?U:e}}var R=f.a.g.Z(),E=f.a.g.Z();f.a.ec=function(X,w,N,D,k,Y){function U(kt){Le={Aa:kt,pb:f.ta(pe++)},j.push(Le),H||Ze.push(Le)}function J(kt){Le=ee[kt],pe!==Le.pb.v()&&_e.push(Le),Le.pb(pe++),f.a.Ua(Le.Y,X),j.push(Le)}function K(kt,At){if(kt)for(var Te=0,Re=At.length;Te<Re;Te++)f.a.D(At[Te].Y,function(ct){kt(ct,Te,At[Te].Aa)})}w=w||[],typeof w.length>"u"&&(w=[w]),D=D||{};var ee=f.a.g.get(X,R),H=!ee,j=[],$=0,pe=0,ge=[],ae=[],be=[],_e=[],Ze=[],Le,Ee=0;if(H)f.a.D(w,U);else{if(!Y||ee&&ee._countWaitingForRemove){var He=f.a.Mb(ee,function(kt){return kt.Aa});Y=f.a.Pb(He,w,{dontLimitMoves:D.dontLimitMoves,sparse:!0})}for(var He=0,we,dt,bt;we=Y[He];He++)switch(dt=we.moved,bt=we.index,we.status){case"deleted":for(;$<bt;)J($++);dt===e&&(Le=ee[$],Le.$&&(Le.$.s(),Le.$=e),f.a.Ua(Le.Y,X).length&&(D.beforeRemove&&(j.push(Le),Ee++,Le.Aa===E?Le=null:be.push(Le)),Le&&ge.push.apply(ge,Le.Y))),$++;break;case"added":for(;pe<bt;)J($++);dt!==e?(ae.push(j.length),J(dt)):U(we.value)}for(;pe<w.length;)J($++);j._countWaitingForRemove=Ee}f.a.g.set(X,R,j),K(D.beforeMove,_e),f.a.D(ge,D.beforeRemove?f.oa:f.removeNode);var it,en,_n;try{_n=X.ownerDocument.activeElement}catch{}if(ae.length)for(;(He=ae.shift())!=e;){for(Le=j[He],it=e;He;)if((en=j[--He].Y)&&en.length){it=en[en.length-1];break}for(w=0;$=Le.Y[w];it=$,w++)f.h.Wb(X,$,it)}for(He=0;Le=j[He];He++){for(Le.Y||f.a.extend(Le,b(X,N,Le.Aa,k,Le.pb)),w=0;$=Le.Y[w];it=$,w++)f.h.Wb(X,$,it);!Le.Ed&&k&&(k(Le.Aa,Le.Y,Le.pb),Le.Ed=!0,it=Le.Y[Le.Y.length-1])}for(_n&&X.ownerDocument.activeElement!=_n&&_n.focus(),K(D.beforeRemove,be),He=0;He<be.length;++He)be[He].Aa=E;K(D.afterMove,_e),K(D.afterAdd,Ze)}}(),f.b("utils.setDomNodeChildrenFromArrayMapping",f.a.ec),f.ba=function(){this.allowTemplateRewriting=!1},f.ba.prototype=new f.ca,f.ba.prototype.constructor=f.ba,f.ba.prototype.renderTemplateSource=function(b,R,E,X){return(R=!(9>f.a.W)&&b.nodes?b.nodes():null)?f.a.la(R.cloneNode(!0).childNodes):(b=b.text(),f.a.ua(b,X))},f.ba.Ma=new f.ba,f.gc(f.ba.Ma),f.b("nativeTemplateEngine",f.ba),function(){f.$a=function(){var R=this.Hd=function(){if(!o||!o.tmpl)return 0;try{if(0<=o.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch{}return 1}();this.renderTemplateSource=function(E,X,w,N){if(N=N||n,w=w||{},2>R)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var D=E.data("precompiled");return D||(D=E.text()||"",D=o.template(null,"{{ko_with $item.koBindingContext}}"+D+"{{/ko_with}}"),E.data("precompiled",D)),E=[X.$data],X=o.extend({koBindingContext:X},w.templateOptions),X=o.tmpl(D,E,X),X.appendTo(N.createElement("div")),o.fragments={},X},this.createJavaScriptEvaluatorBlock=function(E){return"{{ko_code ((function() { return "+E+" })()) }}"},this.addTemplate=function(E,X){n.write("<script type='text/html' id='"+E+"'>"+X+"<\/script>")},0<R&&(o.tmpl.tag.ko_code={open:"__.push($1 || '');"},o.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},f.$a.prototype=new f.ca,f.$a.prototype.constructor=f.$a;var b=new f.$a;0<b.Hd&&f.gc(b),f.b("jqueryTmplTemplateEngine",f.$a)}()})})()})()})();var _xt=ko;typeof window<"u"?(ko=window.ko,typeof q9<"u"?window.ko=q9:delete window.ko):(ko=global.ko,typeof q9<"u"?global.ko=q9:delete global.ko);var lS=_xt;var sbo=T(S(),1);/**
* @license
* Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5
* Copyright (c) Steve Sanderson
* MIT license
*/var b7="__knockoutObservables",y7="__knockoutSubscribable";function aTe(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=cTe(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(o){if(!(o===b7||o===y7)&&!(o in i)){var r=e[o],s=r instanceof Array,a=n.isObservable(r)?r:s?n.observableArray(r):n.observable(r);Object.defineProperty(e,o,{configurable:!0,enumerable:!0,get:a,set:n.isWriteableObservable(a)?a:void 0}),i[o]=a,s&&Sxt(n,a)}}),e}function cTe(e,t){var n=e[b7];return!n&&t&&(n={},Object.defineProperty(e,b7,{value:n})),n}function Txt(e,t,n){var i=this,o={owner:e,deferEvaluation:!0};if(typeof n=="function")o.read=n;else{if("value"in n)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if(typeof n.get!="function")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=n.get,o.write=n.set}return e[t]=i.computed(o),aTe.call(i,e,[t]),e}function Sxt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=Cxt(e,t,i))})}function Cxt(e,t,n){var i=Vxt(e,n);return i.subscribe(t)}function Vxt(e,t){var n=t[y7];if(!n){n=new e.subscribable,Object.defineProperty(t,y7,{value:n});var i={};Lxt(t,n,i),Rxt(e,t,n,i)}return n}function Lxt(e,t,n){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(i){var o=e[i];e[i]=function(){var r=o.apply(this,arguments);return n.pause!==!0&&t.notifySubscribers(this),r}})}function Rxt(e,t,n,i){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(o){Object.defineProperty(t,o,{enumerable:!1,value:function(){var r;i.pause=!0;try{r=e.observableArray.fn[o].apply(e.observableArray(t),arguments)}finally{i.pause=!1}return n.notifySubscribers(t),r}})})}function lTe(e,t){if(!e)return null;var n=cTe(e,!1);return n&&n[t]||null}function Zxt(e,t){var n=lTe(e,t);n&&n.valueHasMutated()}function Gxt(e){e.track=aTe,e.getObservable=lTe,e.valueHasMutated=Zxt,e.defineProperty=Txt}var $9={attachToKo:Gxt};var cbo=T(S(),1),dTe="http://www.w3.org/2000/svg",uTe="cesium-svgPath-svg",Ext={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(dTe,"svg:svg");i.setAttribute("class",uTe);let o=document.createElementNS(dTe,"path");return i.appendChild(o),e.virtualElements.setDomNodeChildren(t,[i]),e.computed({read:function(){let r=e.unwrap(n());o.setAttribute("d",e.unwrap(r.path));let s=e.unwrap(r.width),a=e.unwrap(r.height);i.setAttribute("width",s),i.setAttribute("height",a),i.setAttribute("viewBox",`0 0 ${s} ${a}`),r.css&&i.setAttribute("class",`${uTe} ${e.unwrap(r.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},eA=Ext;$9.attachToKo(lS);eA.register(lS);var Ce=lS;function tA(e){l(e)||(e=new eh),this._clock=e,this._eventHelper=new Er,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=Ce.observable(te.now()),this.systemTime.equalityComparer=te.equals,this.startTime=Ce.observable(e.startTime),this.startTime.equalityComparer=te.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=Ce.observable(e.stopTime),this.stopTime.equalityComparer=te.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=Ce.observable(e.currentTime),this.currentTime.equalityComparer=te.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=Ce.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=Ce.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=Ce.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=Ce.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=Ce.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),Ce.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(tA.prototype,{clock:{get:function(){return this._clock}}});tA.prototype.synchronize=function(){let e=this._clock;this.systemTime=te.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};tA.prototype.isDestroyed=function(){return!1};tA.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var nA=tA;var _bo=T(S(),1);function Ixt(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,fe.throwInstantiationError()}var g7=Ixt;var Rbo=T(S(),1);function Xxt(e,t){t=g(t,!0);let n=new ye,i=new ye;function o(){let r={args:arguments,cancel:!1},s;return n.raiseEvent(r),r.cancel||(s=e.apply(null,arguments),i.raiseEvent(s)),s}return o.canExecute=t,Ce.track(o,["canExecute"]),Object.defineProperties(o,{beforeExecute:{value:n},afterExecute:{value:i}}),o}var Rn=Xxt;var Ibo=T(S(),1);var iA={};iA.createCheckbox=function(e,t,n){let i=document.createElement("div"),o=document.createElement("label"),r=document.createElement("input");r.type="checkbox";let s=`checked: ${t}`;return l(n)&&(s+=`, enable: ${n}`),r.setAttribute("data-bind",s),o.appendChild(r),o.appendChild(document.createTextNode(e)),i.appendChild(o),i};iA.createSection=function(e,t,n,i){let o=document.createElement("div");o.className="cesium-cesiumInspector-section",o.setAttribute("data-bind",`css: { "cesium-cesiumInspector-section-collapsed": !${n} }`),e.appendChild(o);let r=document.createElement("h3");r.className="cesium-cesiumInspector-sectionHeader",r.appendChild(document.createTextNode(t)),r.setAttribute("data-bind",`click: ${i}`),o.appendChild(r);let s=document.createElement("div");return s.className="cesium-cesiumInspector-sectionContent",o.appendChild(s),s};iA.createRangeInput=function(e,t,n,i,o,r){r=g(r,t);let s=document.createElement("input");s.setAttribute("data-bind",`value: ${r}`),s.type="number";let a=document.createElement("input");a.type="range",a.min=n,a.max=i,a.step=g(o,"any"),a.setAttribute("data-bind",`valueUpdate: "input", value: ${t}`);let c=document.createElement("div");c.appendChild(a);let d=document.createElement("div");return d.className="cesium-cesiumInspector-slider",d.appendChild(document.createTextNode(e)),d.appendChild(s),d.appendChild(c),d};iA.createButton=function(e,t,n){let i=document.createElement("button");i.type="button",i.textContent=e,i.className="cesium-cesiumInspector-pickButton";let o=`click: ${t}`;return l(n)&&(o+=`, css: {"cesium-cesiumInspector-pickButtonHighlight" : ${n}}`),i.setAttribute("data-bind",o),i};var Na=iA;var Pbo=T(S(),1);function Wxt(e,t,n,i,o){return n.call(i,e[t]),Ce.getObservable(e,t).subscribe(n,i,o)}var ba=Wxt;var Nbo=T(S(),1);function mTe(e,t){this._command=e,t=g(t,g.EMPTY_OBJECT),this.toggled=g(t.toggled,!1),this.tooltip=g(t.tooltip,""),Ce.track(this,["toggled","tooltip"])}Object.defineProperties(mTe.prototype,{command:{get:function(){return this._command}}});var Zg=mTe;var Obo=T(S(),1);var dS="http://www.w3.org/2000/svg",pTe="http://www.w3.org/1999/xlink",pB,oA=O.fromCssColorString("rgba(247,250,255,0.384)"),bB=O.fromCssColorString("rgba(143,191,255,0.216)"),x7=O.fromCssColorString("rgba(153,197,255,0.098)"),yB=O.fromCssColorString("rgba(255,255,255,0.086)"),Pxt=O.fromCssColorString("rgba(255,255,255,0.267)"),vxt=O.fromCssColorString("rgba(255,255,255,0)"),hTe=O.fromCssColorString("rgba(66,67,68,0.3)"),fTe=O.fromCssColorString("rgba(0,0,0,0.5)");function Gg(e){return O.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var rA={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"},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"},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"},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"},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"},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"},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"},animation_pathPointer:{tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},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"}};function vh(e){let t=document.createElementNS(dS,e.tagName);for(let n in e)if(e.hasOwnProperty(n)&&n!=="tagName")if(n==="children"){let i=e.children.length;for(let o=0;o<i;++o)t.appendChild(vh(e.children[o]))}else n.indexOf("xlink:")===0?t.setAttributeNS(pTe,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function _7(e,t,n){let i=document.createElementNS(dS,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let o=document.createElementNS(dS,"tspan");return o.textContent=n,i.appendChild(o),i}function wxt(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var gB=new O;function jr(e,t){let n=t.alpha,i=1-n;return gB.red=e.red*i+t.red*n,gB.green=e.green*i+t.green*n,gB.blue=e.blue*i+t.blue*n,gB.toCssColorString()}function T7(e,t,n){let i=rA[n],o={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},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return vh(o)}function Fxt(e,t,n){let i=rA[n],o=rA.animation_pathWingButton,r={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{class:"cesium-animation-buttonGlow",id:"animation_pathWingButton",tagName:o.tagName,d:o.d},{class:"cesium-animation-buttonMain",id:"animation_pathWingButton",tagName:o.tagName,d:o.d},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return vh(r)}function Axt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&pB!==e))if(t.type==="mousedown"||i&&t.type==="mousemove"||t.type==="touchstart"&&t.touches.length===1||i&&t.type==="touchmove"&&t.touches.length===1){let o=e._centerX,r=e._centerY,a=e._svgNode.getBoundingClientRect(),c,d;if(t.type==="touchstart"||t.type==="touchmove"?(c=t.touches[0].clientX,d=t.touches[0].clientY):(c=t.clientX,d=t.clientY),!i&&(c>a.right||c<a.left||d<a.top||d>a.bottom))return;let u=e._shuttleRingPointer.getBoundingClientRect(),m=c-o-a.left,p=d-r-a.top,y=Math.atan2(p,m)*180/Math.PI+90;y>180&&(y-=360);let f=n.shuttleRingAngle;i||c<u.right&&c>u.left&&d>u.top&&d<u.bottom?(pB=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=y):y<f?n.slower():y>f&&n.faster(),t.preventDefault()}else e===pB&&(pB=void 0),n.shuttleRingDragging=!1}function db(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;let n=this;this._clickFunction=function(){let i=n._viewModel.command;i.canExecute&&i()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[ba(t,"toggled",this.setToggled,this),ba(t,"tooltip",this.setTooltip,this),ba(t.command,"canExecute",this.setEnabled,this)]}db.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);let e=this._subscriptions;for(let t=0,n=e.length;t<n;t++)e[t].dispose();ue(this)};db.prototype.isDestroyed=function(){return!1};db.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!e){this.svgElement.setAttribute("class","cesium-animation-buttonDisabled");return}if(this._toggled){this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled");return}this.svgElement.setAttribute("class","cesium-animation-rectButton")}};db.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")))};db.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function pL(e,t){e=Wn(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;let n=e.ownerDocument,i=document.createElement("style");i.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); }",n.head.insertBefore(i,n.head.childNodes[0]);let o=document.createElement("div");o.className="cesium-animation-theme",o.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=o,this._themeNormal=o.childNodes[0],this._themeHover=o.childNodes[1],this._themeSelect=o.childNodes[2],this._themeDisabled=o.childNodes[3],this._themeKnob=o.childNodes[4],this._themePointer=o.childNodes[5],this._themeSwoosh=o.childNodes[6],this._themeSwooshHover=o.childNodes[7];let r=document.createElementNS(dS,"svg:svg");this._svgNode=r,r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",pTe);let s=document.createElementNS(dS,"g");this._topG=s,this._realtimeSVG=new db(Fxt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new db(T7(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new db(T7(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new db(T7(84,99,"animation_pathPause"),t.pauseViewModel);let a=document.createElementNS(dS,"g");a.appendChild(this._realtimeSVG.svgElement),a.appendChild(this._playReverseSVG.svgElement),a.appendChild(this._playForwardSVG.svgElement),a.appendChild(this._pauseSVG.svgElement);let c=vh({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=c;let d=rA.animation_pathSwooshFX,u=rA.animation_pathPointer,m=vh({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:d.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:d.d},{tagName:d.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:d.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=m,this._shuttleRingPointer=vh({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:u.tagName,d:u.d});let p=vh({tagName:"g",transform:"translate(100,100)"});this._knobOuter=vh({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let y=61,f=vh({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:y});this._knobDate=_7(0,-24,""),this._knobTime=_7(0,-7,""),this._knobStatus=_7(0,-41,"");let x=vh({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:y}),_=document.createElementNS(dS,"g");_.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(o),s.appendChild(_),s.appendChild(p),s.appendChild(a),_.appendChild(c),_.appendChild(m),_.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(f),p.appendChild(this._knobDate),p.appendChild(this._knobTime),p.appendChild(this._knobStatus),p.appendChild(x),r.appendChild(s),e.appendChild(r);let C=this;function V(P){Axt(C,P)}this._mouseCallback=V,c.addEventListener("mousedown",V,!0),c.addEventListener("touchstart",V,!0),m.addEventListener("mousedown",V,!0),m.addEventListener("touchstart",V,!0),n.addEventListener("mousemove",V,!0),n.addEventListener("touchmove",V,!0),n.addEventListener("mouseup",V,!0),n.addEventListener("touchend",V,!0),n.addEventListener("touchcancel",V,!0),this._shuttleRingPointer.addEventListener("mousedown",V,!0),this._shuttleRingPointer.addEventListener("touchstart",V,!0),this._knobOuter.addEventListener("mousedown",V,!0),this._knobOuter.addEventListener("touchstart",V,!0);let L=this._knobTime.childNodes[0],Z=this._knobDate.childNodes[0],G=this._knobStatus.childNodes[0],I;this._subscriptions=[ba(t.pauseViewModel,"toggled",function(P){I!==P&&(I=P,I?C._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):C._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),ba(t,"shuttleRingAngle",function(P){wxt(C._shuttleRingPointer,C._knobOuter,P)}),ba(t,"dateLabel",function(P){Z.textContent!==P&&(Z.textContent=P)}),ba(t,"timeLabel",function(P){L.textContent!==P&&(L.textContent=P)}),ba(t,"multiplierLabel",function(P){G.textContent!==P&&(G.textContent=P)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(pL.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});pL.prototype.isDestroyed=function(){return!1};pL.prototype.destroy=function(){l(this._observer)&&(this._observer.disconnect(),this._observer=void 0);let e=this._container.ownerDocument,t=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",t,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",t,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",t,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",t,!0),e.removeEventListener("mousemove",t,!0),e.removeEventListener("touchmove",t,!0),e.removeEventListener("mouseup",t,!0),e.removeEventListener("touchend",t,!0),e.removeEventListener("touchcancel",t,!0),this._shuttleRingPointer.removeEventListener("mousedown",t,!0),this._shuttleRingPointer.removeEventListener("touchstart",t,!0),this._knobOuter.removeEventListener("mousedown",t,!0),this._knobOuter.removeEventListener("touchstart",t,!0),this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();let n=this._subscriptions;for(let i=0,o=n.length;i<o;i++)n[i].dispose();return ue(this)};pL.prototype.resize=function(){let e=this._container.clientWidth,t=this._container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;let n=this._svgNode,i=200,o=132,r=e,s=t;e===0&&t===0?(r=i,s=o):e===0?(s=t,r=i*(t/o)):t===0&&(r=e,s=o*(e/i));let a=r/i,c=s/o;n.style.cssText=`width: ${r}px; height: ${s}px; position: absolute; bottom: 0; left: 0; overflow: hidden;`,n.setAttribute("width",r),n.setAttribute("height",s),n.setAttribute("viewBox",`0 0 ${r} ${s}`),this._topG.setAttribute("transform",`scale(${a},${c})`),this._centerX=Math.max(1,100*a),this._centerY=Math.max(1,100*c),this._lastHeight=e,this._lastWidth=t};pL.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(l(this._observer))return;let u=this;u._observer=new MutationObserver(function(){e.body.contains(u._container)&&(u._observer.disconnect(),u._observer=void 0,u.applyThemeChanges())}),u._observer.observe(e,{childList:!0,subtree:!0});return}let t=Gg(this._themeNormal),n=Gg(this._themeHover),i=Gg(this._themeSelect),o=Gg(this._themeDisabled),r=Gg(this._themeKnob),s=Gg(this._themePointer),a=Gg(this._themeSwoosh),c=Gg(this._themeSwooshHover),d=vh({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":jr(t,oA)},{tagName:"stop",offset:"12%","stop-color":jr(t,bB)},{tagName:"stop",offset:"46%","stop-color":jr(t,x7)},{tagName:"stop",offset:"81%","stop-color":jr(t,yB)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":jr(n,oA)},{tagName:"stop",offset:"12%","stop-color":jr(n,bB)},{tagName:"stop",offset:"46%","stop-color":jr(n,x7)},{tagName:"stop",offset:"81%","stop-color":jr(n,yB)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":jr(i,oA)},{tagName:"stop",offset:"12%","stop-color":jr(i,bB)},{tagName:"stop",offset:"46%","stop-color":jr(i,x7)},{tagName:"stop",offset:"81%","stop-color":jr(i,yB)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":jr(o,Pxt)},{tagName:"stop",offset:"75%","stop-color":jr(o,vxt)}]},{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":a.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":a.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":jr(s,fTe)},{tagName:"stop",offset:"100%","stop-color":jr(s,fTe)}]},{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":jr(r,oA)},{tagName:"stop",offset:"60%","stop-color":jr(r,hTe)},{tagName:"stop",offset:"85%","stop-color":jr(r,bB)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":jr(r,hTe)},{tagName:"stop",offset:"60%","stop-color":jr(r,oA)},{tagName:"stop",offset:"85%","stop-color":jr(r,yB)}]}]});l(this._defsElement)?this._svgNode.replaceChild(d,this._defsElement):this._svgNode.appendChild(d),this._defsElement=d};var sA=pL;var qbo=T(S(),1);var Mxt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Eg=15,bL=105;function bTe(e,t){return e-t}function S7(e,t){let n=Io(t,e,bTe);return n<0?~n:n}function Nxt(e,t){if(Math.abs(e)<=Eg)return e/Eg;let n=Eg,i=bL,o,r=0,s;return e>0?(o=Math.log(t[t.length-1]),s=(o-r)/(i-n),Math.exp(r+s*(e-n))):(o=Math.log(-t[0]),s=(o-r)/(i-n),-Math.exp(r+s*(Math.abs(e)-n)))}function Uxt(e,t,n){if(n.clockStep===yo.SYSTEM_CLOCK)return Eg;if(Math.abs(e)<=1)return e*Eg;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let o=Eg,r=bL,s,a=0,c;return e>0?(s=Math.log(i),c=(s-a)/(r-o),(Math.log(e)-a)/c+o):(s=Math.log(-t[0]),c=(s-a)/(r-o),-((Math.log(Math.abs(e))-a)/c+o))}function cm(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=cm.defaultDateFormatter,this._timeFormatter=cm.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,Ce.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(cm.defaultTicks),this.timeLabel=void 0,Ce.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,Ce.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,Ce.defineProperty(this,"multiplierLabel",function(){let s=t._clockViewModel;if(s.clockStep===yo.SYSTEM_CLOCK)return"Today";let a=s.multiplier;return a%1===0?`${a.toFixed(0)}x`:`${a.toFixed(3).replace(/0{0,3}$/,"")}x`}),this.shuttleRingAngle=void 0,Ce.defineProperty(this,"shuttleRingAngle",{get:function(){return Uxt(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,bL),-bL);let a=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=yo.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===bL){c.multiplier=s>0?a[a.length-1]:a[0];return}let d=Nxt(s,a);if(t.snapToTicks)d=a[S7(d,a)];else if(d!==0){let u=Math.abs(d);if(u>100){let m=u.toFixed(0).length-2,p=Math.pow(10,m);d=Math.round(d/p)*p|0}else u>Eg?d=Math.round(d):u>1?d=+d.toFixed(1):u>0&&(d=+d.toFixed(2))}c.multiplier=d}}),this._canAnimate=void 0,Ce.defineProperty(this,"_canAnimate",function(){let s=t._clockViewModel,a=s.clockRange;if(t.shuttleRingDragging||a===vr.UNBOUNDED)return!0;let c=s.multiplier,d=s.currentTime,u=s.startTime,m=!1;if(a===vr.LOOP_STOP)m=te.greaterThan(d,u)||d.equals(u)&&c>0;else{let p=s.stopTime;m=te.greaterThan(d,u)&&te.lessThan(d,p)||d.equals(u)&&c>0||d.equals(p)&&c<0}return m||(s.shouldAnimate=!1),m}),this._isSystemTimeAvailable=void 0,Ce.defineProperty(this,"_isSystemTimeAvailable",function(){let s=t._clockViewModel;if(s.clockRange===vr.UNBOUNDED)return!0;let c=s.systemTime;return te.greaterThanOrEquals(c,s.startTime)&&te.lessThanOrEquals(c,s.stopTime)}),this._isAnimating=void 0,Ce.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=Rn(function(){let s=t._clockViewModel;s.shouldAnimate?s.shouldAnimate=!1:t._canAnimate&&(s.shouldAnimate=!0)});this._pauseViewModel=new Zg(n,{toggled:Ce.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=Rn(function(){let s=t._clockViewModel,a=s.multiplier;a>0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playReverseViewModel=new Zg(i,{toggled:Ce.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let o=Rn(function(){let s=t._clockViewModel,a=s.multiplier;a<0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playForwardViewModel=new Zg(o,{toggled:Ce.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==yo.SYSTEM_CLOCK}),tooltip:"Play Forward"});let r=Rn(function(){t._clockViewModel.clockStep=yo.SYSTEM_CLOCK},Ce.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new Zg(r,{toggled:Ce.computed(function(){return e.clockStep===yo.SYSTEM_CLOCK}),tooltip:Ce.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=Rn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,d=S7(c,a)-1;d>=0&&(s.multiplier=a[d])}),this._faster=Rn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,d=S7(c,a)+1;d<a.length&&(s.multiplier=a[d])})}cm.defaultDateFormatter=function(e,t){let n=te.toGregorianDate(e);return`${Mxt[n.month-1]} ${n.day} ${n.year}`};cm.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];cm.defaultTimeFormatter=function(e,t){let n=te.toGregorianDate(e),i=Math.round(n.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")}.${i.toString().padStart(3,"0")}`:`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")} UTC`};cm.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};cm.prototype.setShuttleRingTicks=function(e){let t,n,i,o={},r=this._sortedFilteredPositiveTicks;for(r.length=0,t=0,n=e.length;t<n;++t)i=e[t],o.hasOwnProperty(i)||(o[i]=!0,r.push(i));r.sort(bTe);let s=[];for(n=r.length,t=n-1;t>=0;--t)i=r[t],i!==0&&s.push(-i);Array.prototype.push.apply(s,r),this._allShuttleRingTicks=s};Object.defineProperties(cm.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}}});cm._maxShuttleRingAngle=bL;cm._realtimeShuttleRingAngle=Eg;var aA=cm;var dyo=T(S(),1);var iyo=T(S(),1);function kxt(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof oa&&(e.tileset=n.primitive),e.pickActive=!1}}function gTe(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof oa&&(e.tileset=i.primitive)},Vn.MOUSE_MOVE):(e._eventHandler.removeInputAction(Vn.MOUSE_MOVE),e.picking=e.picking)}var Dxt={maximumFractionDigits:3};function cA(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,Dxt):Math.round(t).toLocaleString()}function lA(e,t){if(!l(e))return"";let n=t?e._statisticsPerPass[wo.PICK]:e._statisticsPerPass[wo.RENDER],i='<ul class="cesium-cesiumInspector-statistics">';return i+=`<li><strong>Visited: </strong>${n.visited.toLocaleString()}</li><li><strong>Selected: </strong>${n.selected.toLocaleString()}</li><li><strong>Commands: </strong>${n.numberOfCommands.toLocaleString()}</li>`,i+="</ul>",t||(i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Requests: </strong>${n.numberOfPendingRequests.toLocaleString()}</li><li><strong>Attempted: </strong>${n.numberOfAttemptedRequests.toLocaleString()}</li><li><strong>Processing: </strong>${n.numberOfTilesProcessing.toLocaleString()}</li><li><strong>Content Ready: </strong>${n.numberOfTilesWithContentReady.toLocaleString()}</li><li><strong>Total: </strong>${n.numberOfTilesTotal.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Features Selected: </strong>${n.numberOfFeaturesSelected.toLocaleString()}</li><li><strong>Features Loaded: </strong>${n.numberOfFeaturesLoaded.toLocaleString()}</li><li><strong>Points Selected: </strong>${n.numberOfPointsSelected.toLocaleString()}</li><li><strong>Points Loaded: </strong>${n.numberOfPointsLoaded.toLocaleString()}</li><li><strong>Triangles Selected: </strong>${n.numberOfTrianglesSelected.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Tiles styled: </strong>${n.numberOfTilesStyled.toLocaleString()}</li><li><strong>Features styled: </strong>${n.numberOfFeaturesStyled.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Children Union Culled: </strong>${n.numberOfTilesCulledWithChildrenUnion.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Geometry Memory (MB): </strong>${cA(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${cA(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${cA(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function xTe(){let e=Yi.statistics;return`
<ul class="cesium-cesiumInspector-statistics">
<li><strong>Geometry Memory (MB): </strong>${cA(e.geometryByteLength)}</li>
<li><strong>Texture Memory (MB): </strong>${cA(e.texturesByteLength)}</li>
</ul>
`}var Bxt=[{text:"Highlight",value:Cl.HIGHLIGHT},{text:"Replace",value:Cl.REPLACE},{text:"Mix",value:Cl.MIX}],yTe=new O(1,1,0,.4),Oxt=new O,xB=new O;function ya(e,t){let n=this,i=e.canvas;this._eventHandler=new kd(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new $0({container:t}),this._statisticsText="",this._pickStatisticsText="",this._resourceCacheStatisticsText="",this._editorError="",this.performance=!1,this.showStatistics=!0,this.showPickStatistics=!0,this.showResourceCacheStatistics=!1,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.hasEnabledWireframe=!1,this._tileset=void 0,this._feature=void 0,this._tile=void 0,Ce.track(this,["performance","inspectorVisible","_statisticsText","_pickStatisticsText","_resourceCacheStatisticsText","_editorError","showPickStatistics","showStatistics","showResourceCacheStatistics","tilesetVisible","displayVisible","updateVisible","loggingVisible","styleVisible","optimizationVisible","tileDebugLabelsVisible","styleString","_feature","_tile","_tileset","hasEnabledWireframe"]),this._properties=Ce.observable({}),this.properties=[],Ce.defineProperty(this,"properties",function(){let U=[],J=n._properties();for(let K in J)J.hasOwnProperty(K)&&U.push(K);return U});let o=Ce.observable();Ce.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return o()},set:function(U){o(U),l(n._tileset)&&(n._tileset.dynamicScreenSpaceError=U)}}),this.dynamicScreenSpaceError=!1;let r=Ce.observable();Ce.defineProperty(this,"colorBlendMode",{get:function(){return r()},set:function(U){r(U),l(n._tileset)&&(n._tileset.colorBlendMode=U,n._scene.requestRender())}}),this.colorBlendMode=Cl.HIGHLIGHT;let s=Ce.observable(),a=Ce.observable();Ce.defineProperty(this,"picking",{get:function(){return a()},set:function(U){a(U),U?n._eventHandler.setInputAction(function(J){let K=e.pick(J.endPosition);if(K instanceof vs?(n.feature=K,n.tile=K.content.tile):l(K)&&l(K.content)?(n.feature=void 0,n.tile=K.content.tile):(n.feature=void 0,n.tile=void 0),!!l(n._tileset)){if(s&&l(K)&&l(K.content)){let ee;e.pickPositionSupported&&(ee=e.pickPosition(J.endPosition),l(ee)&&(n._tileset.debugPickPosition=ee)),n._tileset.debugPickedTile=K.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},Vn.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(Vn.MOUSE_MOVE))}}),this.picking=!0;let c=Ce.observable();Ce.defineProperty(this,"colorize",{get:function(){return c()},set:function(U){c(U),l(n._tileset)&&(n._tileset.debugColorizeTiles=U,n._scene.requestRender())}}),this.colorize=!1;let d=Ce.observable();Ce.defineProperty(this,"wireframe",{get:function(){return d()},set:function(U){d(U),l(n._tileset)&&(n._tileset.debugWireframe=U,n._scene.requestRender())}}),this.wireframe=!1;let u=Ce.observable();Ce.defineProperty(this,"showBoundingVolumes",{get:function(){return u()},set:function(U){u(U),l(n._tileset)&&(n._tileset.debugShowBoundingVolume=U,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let m=Ce.observable();Ce.defineProperty(this,"showContentBoundingVolumes",{get:function(){return m()},set:function(U){m(U),l(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=U,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=Ce.observable();Ce.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(U){p(U),l(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=U,n._scene.requestRender())}}),this.showRequestVolumes=!1;let y=Ce.observable();Ce.defineProperty(this,"freezeFrame",{get:function(){return y()},set:function(U){y(U),l(n._tileset)&&(n._tileset.debugFreezeFrame=U,n._scene.debugShowFrustumPlanes=U,n._scene.requestRender())}}),this.freezeFrame=!1,Ce.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return s()},set:function(U){s(U),l(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=U,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let f=Ce.observable();Ce.defineProperty(this,"showGeometricError",{get:function(){return f()},set:function(U){f(U),l(n._tileset)&&(n._tileset.debugShowGeometricError=U,n._scene.requestRender())}}),this.showGeometricError=!1;let x=Ce.observable();Ce.defineProperty(this,"showRenderingStatistics",{get:function(){return x()},set:function(U){x(U),l(n._tileset)&&(n._tileset.debugShowRenderingStatistics=U,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let _=Ce.observable();Ce.defineProperty(this,"showMemoryUsage",{get:function(){return _()},set:function(U){_(U),l(n._tileset)&&(n._tileset.debugShowMemoryUsage=U,n._scene.requestRender())}}),this.showMemoryUsage=!1;let C=Ce.observable();Ce.defineProperty(this,"showUrl",{get:function(){return C()},set:function(U){C(U),l(n._tileset)&&(n._tileset.debugShowUrl=U,n._scene.requestRender())}}),this.showUrl=!1;let V=Ce.observable();Ce.defineProperty(this,"maximumScreenSpaceError",{get:function(){return V()},set:function(U){U=Number(U),isNaN(U)||(V(U),l(n._tileset)&&(n._tileset.maximumScreenSpaceError=U))}}),this.maximumScreenSpaceError=16;let L=Ce.observable();Ce.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return L()},set:function(U){U=Number(U),isNaN(U)||(L(U),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=U))}}),this.dynamicScreenSpaceErrorDensity=2e-4,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,Ce.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(L(),1/6)},set:function(U){let J=Math.pow(U,6);L(J),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=J)}});let Z=Ce.observable();Ce.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return Z()},set:function(U){U=Number(U),isNaN(U)||(Z(U),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=U))}}),this.dynamicScreenSpaceErrorFactor=24;let G=kxt(this),I=Ce.observable();Ce.defineProperty(this,"pickActive",{get:function(){return I()},set:function(U){I(U),U?n._eventHandler.setInputAction(G,Vn.LEFT_CLICK):n._eventHandler.removeInputAction(Vn.LEFT_CLICK)}});let P=Ce.observable();Ce.defineProperty(this,"pointCloudShading",{get:function(){return P()},set:function(U){P(U),l(n._tileset)&&(n._tileset.pointCloudShading.attenuation=U)}}),this.pointCloudShading=!1;let v=Ce.observable();Ce.defineProperty(this,"geometricErrorScale",{get:function(){return v()},set:function(U){U=Number(U),isNaN(U)||(v(U),l(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=U))}}),this.geometricErrorScale=1;let F=Ce.observable();Ce.defineProperty(this,"maximumAttenuation",{get:function(){return F()},set:function(U){U=Number(U),isNaN(U)||(F(U),l(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=U===0?void 0:U))}}),this.maximumAttenuation=0;let M=Ce.observable();Ce.defineProperty(this,"baseResolution",{get:function(){return M()},set:function(U){U=Number(U),isNaN(U)||(M(U),l(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=U===0?void 0:U))}}),this.baseResolution=0;let b=Ce.observable();Ce.defineProperty(this,"eyeDomeLighting",{get:function(){return b()},set:function(U){b(U),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=U)}}),this.eyeDomeLighting=!1;let R=Ce.observable();Ce.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return R()},set:function(U){U=Number(U),isNaN(U)||(R(U),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=U))}}),this.eyeDomeLightingStrength=1;let E=Ce.observable();Ce.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return E()},set:function(U){U=Number(U),isNaN(U)||(E(U),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=U))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let X=Ce.observable();Ce.defineProperty(this,"skipLevelOfDetail",{get:function(){return X()},set:function(U){X(U),l(n._tileset)&&(n._tileset.skipLevelOfDetail=U)}}),this.skipLevelOfDetail=!0;let w=Ce.observable();Ce.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return w()},set:function(U){U=Number(U),isNaN(U)||(w(U),l(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=U))}}),this.skipScreenSpaceErrorFactor=16;let N=Ce.observable();Ce.defineProperty(this,"baseScreenSpaceError",{get:function(){return N()},set:function(U){U=Number(U),isNaN(U)||(N(U),l(n._tileset)&&(n._tileset.baseScreenSpaceError=U))}}),this.baseScreenSpaceError=1024;let D=Ce.observable();Ce.defineProperty(this,"skipLevels",{get:function(){return D()},set:function(U){U=Number(U),isNaN(U)||(D(U),l(n._tileset)&&(n._tileset.skipLevels=U))}}),this.skipLevels=1;let k=Ce.observable();Ce.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return k()},set:function(U){k(U),l(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=U)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let Y=Ce.observable();Ce.defineProperty(this,"loadSiblings",{get:function(){return Y()},set:function(U){Y(U),l(n._tileset)&&(n._tileset.loadSiblings=U)}}),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(){n._update()}),l(this._tileset)||gTe(this,!0)}Object.defineProperties(ya.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}},resourceCacheStatisticsText:{get:function(){return this._resourceCacheStatisticsText}},colorBlendModes:{get:function(){return Bxt}},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,l(e)){this._properties(e.properties);let t=["colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl"],n=t.length;for(let o=0;o<n;++o){let r=t[o];this[r]=this[r]}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,this.hasEnabledWireframe=e._enableDebugWireframe;let i=e.pointCloudShading;this.pointCloudShading=i.attenuation,this.geometricErrorScale=i.geometricErrorScale,this.maximumAttenuation=i.maximumAttenuation?i.maximumAttenuation:0,this.baseResolution=i.baseResolution?i.baseResolution:0,this.eyeDomeLighting=i.eyeDomeLighting,this.eyeDomeLightingStrength=i.eyeDomeLightingStrength,this.eyeDomeLightingRadius=i.eyeDomeLightingRadius,this._scene.requestRender()}else this._properties({});this._statisticsText=lA(e,!1),this._pickStatisticsText=lA(e,!0),this._resourceCacheStatisticsText=xTe(),gTe(this,!1)}},feature:{get:function(){return this._feature},set:function(e){if(this._feature===e)return;let t=this._feature;l(t)&&!t.content.isDestroyed()&&(!this.colorize&&l(this._style)?t.color=l(this._style.color)?this._style.color.evaluateColor(t,Oxt):O.WHITE:t.color=xB,this._scene.requestRender()),l(e)&&(O.clone(e.color,xB),e.color=yTe,this._scene.requestRender()),this._feature=e}},tile:{get:function(){return this._tile},set:function(e){if(this._tile===e)return;let t=this._tile;l(t)&&!t.isDestroyed()&&!C7(t.content)&&(t.color=xB,this._scene.requestRender()),l(e)&&!C7(e.content)&&(O.clone(e.color,xB),e.color=yTe,this._scene.requestRender()),this._tile=e}}});function C7(e){if(!l(e))return!1;if(e.featuresLength>0)return!0;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)if(!C7(t[i]))return!1;return!0}return!1}ya.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};ya.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};ya.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};ya.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};ya.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};ya.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};ya.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};ya.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};ya.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};ya.prototype.trimTilesCache=function(){l(this._tileset)&&this._tileset.trimLoadedTiles()};ya.prototype.compileStyle=function(){let e=this._tileset;if(!(!l(e)||this.styleString===JSON.stringify(e.style))){this._editorError="";try{this.styleString.length===0&&(this.styleString="{}"),this._style=new zT(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};ya.prototype.styleEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(`
`),c=a.length,d;if(t.shiftKey)for(d=0;d<c;++d)a[d][0]===" "&&(a[d][1]===" "?(a[d]=a[d].substr(2),r-=2):(a[d]=a[d].substr(1),r-=1));else for(d=0;d<c;++d)a[d]=` ${a[d]}`,r+=2;let u=a.join(`
`);n.value=n.value.slice(0,i)+u+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileStyle();return!0};ya.prototype._update=function(){let e=this._tileset;if(this.performance&&this._performanceDisplay.update(),l(e)){if(e.isDestroyed()){this.tile=void 0,this.feature=void 0,this.tileset=void 0;return}let 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=lA(e,!1),this._pickStatisticsText=lA(e,!0),this._resourceCacheStatisticsText=xTe())};ya.prototype.isDestroyed=function(){return!1};ya.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){Ce.getObservable(e,t).dispose()}),ue(this)};ya.getStatistics=lA;var dA=ya;function _B(e,t){e=Wn(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let o=new dA(t,i);this._viewModel=o,this._container=e,this._element=n;let r=document.createElement("div");r.textContent="3D Tiles Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleInspector"),n.appendChild(r),n.className="cesium-cesiumInspector cesium-3DTilesInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",n.appendChild(s);let a=Na.createSection,c=Na.createCheckbox,d=Na.createRangeInput,u=Na.createButton,m=a(s,"Tileset","tilesetVisible","toggleTileset"),p=a(s,"Display","displayVisible","toggleDisplay"),y=a(s,"Update","updateVisible","toggleUpdate"),f=a(s,"Logging","loggingVisible","toggleLogging"),x=a(s,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),_=a(s,"Style","styleVisible","toggleStyle"),C=a(s,"Optimization","optimizationVisible","toggleOptimization"),V=document.createElement("div");V.className="field-group";let L=document.createElement("label");L.className="field-label",L.appendChild(document.createTextNode("Properties: "));let Z=document.createElement("div");Z.setAttribute("data-bind","text: properties"),V.appendChild(L),V.appendChild(Z),m.appendChild(V),m.appendChild(u("Pick Tileset","togglePickTileset","pickActive")),m.appendChild(u("Trim Tiles Cache","trimTilesCache")),m.appendChild(c("Enable Picking","picking")),p.appendChild(c("Colorize","colorize"));let G=p.appendChild(c("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),I=document.createElement("p");I.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),I.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),I.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",G.appendChild(I),p.appendChild(c("Bounding Volumes","showBoundingVolumes")),p.appendChild(c("Content Volumes","showContentBoundingVolumes")),p.appendChild(c("Request Volumes","showRequestVolumes")),p.appendChild(c("Point Cloud Shading","pointCloudShading"));let P=document.createElement("div");P.setAttribute("data-bind","visible: pointCloudShading"),P.appendChild(d("Geometric Error Scale","geometricErrorScale",0,2,.01)),P.appendChild(d("Maximum Attenuation","maximumAttenuation",0,32,1)),P.appendChild(d("Base Resolution","baseResolution",0,1,.01)),P.appendChild(c("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(P);let v=document.createElement("div");v.setAttribute("data-bind","visible: eyeDomeLighting"),v.appendChild(d("EDL Strength","eyeDomeLightingStrength",0,2,.1)),v.appendChild(d("EDL Radius","eyeDomeLightingRadius",0,4,.1)),P.appendChild(v),y.appendChild(c("Freeze Frame","freezeFrame")),y.appendChild(c("Dynamic Screen Space Error","dynamicScreenSpaceError"));let F=document.createElement("div");F.appendChild(d("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),y.appendChild(F);let M=document.createElement("div");M.setAttribute("data-bind","visible: dynamicScreenSpaceError"),M.appendChild(d("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),M.appendChild(d("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,32,.1)),y.appendChild(M),f.appendChild(c("Performance","performance")),f.appendChild(i),f.appendChild(c("Statistics","showStatistics"));let b=document.createElement("div");b.className="cesium-3dTilesInspector-statistics",b.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),f.appendChild(b),f.appendChild(c("Pick Statistics","showPickStatistics"));let R=document.createElement("div");R.className="cesium-3dTilesInspector-statistics",R.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),f.appendChild(R),f.appendChild(c("Resource Cache Statistics","showResourceCacheStatistics"));let E=document.createElement("div");E.className="cesium-3dTilesInspector-statistics",E.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),f.appendChild(E);let X=document.createElement("div");_.appendChild(X),X.appendChild(document.createTextNode("Color Blend Mode: "));let w=document.createElement("select");w.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),X.appendChild(w);let N=document.createElement("textarea");N.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),X.className="cesium-cesiumInspector-styleEditor",X.appendChild(N);let D=u("Compile (Ctrl+Enter)","compileStyle");X.appendChild(D);let k=document.createElement("div");k.className="cesium-cesiumInspector-error",k.setAttribute("data-bind","text: editorError"),X.appendChild(k),x.appendChild(c("Show Picked Only","showOnlyPickedTileDebugLabel")),x.appendChild(c("Geometric Error","showGeometricError")),x.appendChild(c("Rendering Statistics","showRenderingStatistics")),x.appendChild(c("Memory Usage (MB)","showMemoryUsage")),x.appendChild(c("Url","showUrl")),C.appendChild(c("Skip Tile LODs","skipLevelOfDetail"));let Y=document.createElement("div");Y.appendChild(d("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),C.appendChild(Y);let U=document.createElement("div");U.appendChild(d("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),C.appendChild(U);let J=document.createElement("div");J.appendChild(d("Min. levels to skip","skipLevels",0,10,1)),C.appendChild(J),C.appendChild(c("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),C.appendChild(c("Load siblings of visible tiles","loadSiblings")),Ce.applyBindings(o,n)}Object.defineProperties(_B.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});_B.prototype.isDestroyed=function(){return!1};_B.prototype.destroy=function(){return Ce.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var uA=_B;var Cyo=T(S(),1);var byo=T(S(),1);function _Te(e){e=g(e,g.EMPTY_OBJECT);let t=e.globe,n=g(e.imageryProviderViewModels,[]),i=g(e.terrainProviderViewModels,[]);this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,Ce.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let o=Ce.getObservable(this,"imageryProviderViewModels"),r=Ce.pureComputed(function(){let m=o(),p={},y;for(y=0;y<m.length;y++){let _=m[y],C=_.category;l(p[C])?p[C].push(_):p[C]=[_]}let f=Object.keys(p),x=[];for(y=0;y<f.length;y++){let _=f[y];x.push({name:_,providers:p[_]})}return x});this._imageryProviders=r;let s=Ce.getObservable(this,"terrainProviderViewModels"),a=Ce.pureComputed(function(){let m=s(),p={},y;for(y=0;y<m.length;y++){let _=m[y],C=_.category;l(p[C])?p[C].push(_):p[C]=[_]}let f=Object.keys(p),x=[];for(y=0;y<f.length;y++){let _=f[y];x.push({name:_,providers:p[_]})}return x});this._terrainProviders=a,this.buttonTooltip=void 0,Ce.defineProperty(this,"buttonTooltip",function(){let m=this.selectedImagery,p=this.selectedTerrain,y=l(m)?m.name:void 0,f=l(p)?p.name:void 0;return l(y)&&l(f)?`${y}
${f}`:l(y)?y:f}),this.buttonImageUrl=void 0,Ce.defineProperty(this,"buttonImageUrl",function(){let m=this.selectedImagery;if(l(m))return m.iconUrl}),this.selectedImagery=void 0;let c=Ce.observable();this._currentImageryLayers=[],Ce.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(m){if(c()===m){this.dropDownVisible=!1;return}let p=e.map,y,f=this._currentImageryLayers,x=f.length,_=this._globe.imageryLayers,C=!1;if(!p)for(y=0;y<x;y++){let V=_.length;for(let L=0;L<V;L++){let Z=_.get(L);if(Z===f[y]){_.remove(Z),C=!0;break}}}if(l(m))if(p&&m.marsOptions)p.basemap=m.marsOptions.layerId;else if(p&&m.options&&m.isTile)p.basemap=m.options.id;else{let V=m.creationCommand();if(Array.isArray(V)){let L=V.length;for(this._currentImageryLayers=[],y=L-1;y>=0;y--){let Z=ua.fromProviderAsync(V[y]);_.add(Z,0),this._currentImageryLayers.push(Z)}}else{this._currentImageryLayers=[];let L=ua.fromProviderAsync(V);if(L.name=m.name,C)_.add(L,0);else{let Z=_.get(0);l(Z)&&_.remove(Z),_.add(L,0)}this._currentImageryLayers.push(L)}}else p&&(p.basemap=void 0);c(m),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let d=Ce.observable();Ce.defineProperty(this,"selectedTerrain",{get:function(){return d()},set:function(m){if(d()===m){this.dropDownVisible=!1;return}let p;if(l(m)&&(p=m.creationCommand()),l(p)&&!l(p.then)){if(e.map&&m.marsOptions){e.map.terrainProvider=p;return}this._globe.terrainProvider=p}else if(l(p)){let y=!1,f=this._globe.terrainProviderChanged.addEventListener(()=>{y=!0,f()}),_=new K9(p).readyEvent.addEventListener(C=>{if(!y){if(e.map&&m.marsOptions){e.map.terrainProvider=C;return}this._globe.terrainProvider=C,_()}})}d(m),this.dropDownVisible=!1}});let u=this;this._toggleDropDown=Rn(function(){u.dropDownVisible=!u.dropDownVisible}),this.selectedImagery=g(e.selectedImageryProviderViewModel),this.selectedTerrain=g(e.selectedTerrainProviderViewModel)}Object.defineProperties(_Te.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var mA=_Te;function TB(e,t){e=Wn(e);let n=new mA(t),i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button",i.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(i);let o=document.createElement("img");o.setAttribute("draggable","false"),o.className="cesium-baseLayerPicker-selected",o.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),i.appendChild(o);let r=document.createElement("div");r.className="cesium-baseLayerPicker-dropDown",r.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(r);let s=document.createElement("div");s.className="cesium-baseLayerPicker-sectionTitle",s.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),s.innerHTML="Imagery",r.appendChild(s);let a=document.createElement("div");a.className="cesium-baseLayerPicker-section",a.setAttribute("data-bind","foreach: _imageryProviders"),r.appendChild(a);let c=document.createElement("div");c.className="cesium-baseLayerPicker-category",a.appendChild(c);let d=document.createElement("div");d.className="cesium-baseLayerPicker-categoryTitle",d.setAttribute("data-bind","text: name"),c.appendChild(d);let u=document.createElement("div");u.className="cesium-baseLayerPicker-choices",u.setAttribute("data-bind","foreach: providers"),c.appendChild(u);let 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; }'),u.appendChild(m);let p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),m.appendChild(p);let y=document.createElement("div");y.className="cesium-baseLayerPicker-itemLabel",y.setAttribute("data-bind","text: name"),m.appendChild(y);let f=document.createElement("div");f.className="cesium-baseLayerPicker-sectionTitle",f.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),f.innerHTML="Terrain",r.appendChild(f);let x=document.createElement("div");x.className="cesium-baseLayerPicker-section",x.setAttribute("data-bind","foreach: _terrainProviders"),r.appendChild(x);let _=document.createElement("div");_.className="cesium-baseLayerPicker-category",x.appendChild(_);let C=document.createElement("div");C.className="cesium-baseLayerPicker-categoryTitle",C.setAttribute("data-bind","text: name"),_.appendChild(C);let V=document.createElement("div");V.className="cesium-baseLayerPicker-choices",V.setAttribute("data-bind","foreach: providers"),_.appendChild(V);let L=document.createElement("div");L.className="cesium-baseLayerPicker-item",L.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),V.appendChild(L);let Z=document.createElement("img");Z.className="cesium-baseLayerPicker-itemIcon",Z.setAttribute("data-bind","attr: { src: iconUrl }"),Z.setAttribute("draggable","false"),L.appendChild(Z);let G=document.createElement("div");G.className="cesium-baseLayerPicker-itemLabel",G.setAttribute("data-bind","text: name"),L.appendChild(G),Ce.applyBindings(n,i),Ce.applyBindings(n,r),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=r,this._closeDropDown=function(I){i.contains(I.target)||r.contains(I.target)||(n.dropDownVisible=!1)},Bt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(TB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});TB.prototype.isDestroyed=function(){return!1};TB.prototype.destroy=function(){return Bt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Ce.cleanNode(this._element),Ce.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),ue(this)};var hA=TB;var Pyo=T(S(),1);var Eyo=T(S(),1);function TTe(e){let t=e.creationFunction;l(t.canExecute)||(t=Rn(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=g(e.category,""),this.marsOptions=e.marsOptions,Ce.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(TTe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var qr=TTe;function Yxt(){let e=[],t=devicePixelRatio>=2;return e.push(new qr({name:"Bing Maps Aerial",iconUrl:on("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return J0({style:z0.AERIAL})}})),e.push(new qr({name:"Bing Maps Aerial with Labels",iconUrl:on("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return J0({style:z0.AERIAL_WITH_LABELS})}})),e.push(new qr({name:"Bing Maps Roads",iconUrl:on("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return J0({style:z0.ROAD})}})),e.push(new qr({name:"ArcGIS World Imagery",iconUrl:on("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png"),tooltip:`ArcGIS 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 15m TerraColor imagery at small and mid-scales (~1:591M down to ~1:288k) for the world. The map features Maxar imagery at 0.3m resolution for select metropolitan areas around the world, 0.5m resolution across the United States and parts of Western Europe, and 1m resolution imagery across the rest of the world. In addition to commercial sources, the World Imagery map features high-resolution aerial photography contributed by the GIS User Community. This imagery ranges from 0.3m to 0.03m resolution (down to ~1:280 nin select communities). For more information on this map, including the terms of use, visit us online at
https://www.arcgis.com/home/item.html?id=10df2279f9684e4a9f6a7f08febac2a9`,category:"Other",creationFunction:function(){return H0.fromBasemapType(Th.SATELLITE,{enablePickFeatures:!1})}})),e.push(new qr({name:"ArcGIS World Hillshade",iconUrl:on("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png"),tooltip:`ArcGIS World Hillshade map portrays elevation as an artistic hillshade. This map is designed to be used as a backdrop for topographical, soil, hydro, landcover or other outdoor recreational maps. The map was compiled from a variety of sources from several data providers. The basemap has global coverage down to a scale of ~1:72k. In select areas of the United States and Europe, coverage is available down to ~1:9k. For more information on this map, including the terms of use, visit us online at
https://www.arcgis.com/home/item.html?id=1b243539f4514b6ba35e7d995890db1d`,category:"Other",creationFunction:function(){return H0.fromBasemapType(Th.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new qr({name:"Esri World Ocean",iconUrl:on("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png"),tooltip:`ArcGIS World Ocean map is designed to be used as a base map by marine GIS professionals and as a reference map by anyone interested in ocean data. The base map features marine bathymetry. Land features include inland waters and roads overlaid on land cover and shaded relief imagery. The map was compiled from a variety of best available sources from several data providers, including General Bathymetric Chart of the Oceans GEBCO_08 Grid, National Oceanic and Atmospheric Administration (NOAA), and National Geographic, Garmin, HERE, Geonames.org, and Esri, and various other contributors. The base map currently provides coverage for the world down to a scale of ~1:577k, and coverage down to 1:72k in US coastal areas, and various other areas. Coverage down to ~ 1:9k is available limited areas based on regional hydrographic survey data. The base map was designed and developed by Esri. For more information on this map, including our terms of use, visit us online at
https://www.arcgis.com/home/item.html?id=1e126e7520f9466c9ca28b8f28b5e500`,category:"Other",creationFunction:function(){return H0.fromBasemapType(Th.OCEANS,{enablePickFeatures:!1})}})),e.push(new qr({name:"Open\xADStreet\xADMap",iconUrl:on("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:`OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world.
http://www.openstreetmap.org`,category:"Other",creationFunction:function(){return new lb({url:"https://tile.openstreetmap.org/"})}})),e.push(new qr({name:"Stadia x Stamen Watercolor",iconUrl:on("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:`Based on the original basemaps created for the Knight Foundation and reminiscent of hand drawn maps, the watercolor maps from Stamen Design apply raster effect area washes and organic edges over a paper texture to add warm pop to any map.
https://docs.stadiamaps.com/map-styles/stamen-watercolor/`,category:"Other",creationFunction:function(){return new lb({url:"https://tiles.stadiamaps.com/tiles/stamen_watercolor/",fileExtension:"jpg",credit:`&copy; <a href="https://stamen.com/" target="_blank">Stamen Design</a>
&copy; <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a>
&copy; <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a>
&copy; <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new qr({name:"Stadia x Stamen Toner",iconUrl:on("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:`Based on the original basemaps created for the Knight Foundation and the most popular of the excellent styles from Stamen Design, these high-contrast B+W (black and white) maps are the perfect backdrop for your colorful and eye-catching overlays.
https://docs.stadiamaps.com/map-styles/stamen-toner/`,category:"Other",creationFunction:function(){return new lb({url:"https://tiles.stadiamaps.com/tiles/stamen_toner/",retinaTiles:t,credit:`&copy; <a href="https://stamen.com/" target="_blank">Stamen Design</a>
&copy; <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a>
&copy; <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a>
&copy; <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new qr({name:"Stadia Alidade Smooth",iconUrl:on("Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png"),tooltip:`Stadia's custom Alidade Smooth style is designed for maps that use a lot of markers or overlays. It features a muted color scheme and fewer points of interest to allow your added data to shine.
https://docs.stadiamaps.com/map-styles/alidade-smooth/`,category:"Other",creationFunction:function(){return new lb({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth/",retinaTiles:t,credit:`&copy; <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a>
&copy; <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a>
&copy; <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new qr({name:"Stadia Alidade Smooth Dark",iconUrl:on("Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png"),tooltip:`Stadia Alidade Smooth Dark, like its lighter cousin, is also designed to stay out of the way. It just flips the dark mode switch on the color scheme. With the lights out, your data can now literally shine.
https://docs.stadiamaps.com/map-styles/alidade-smooth-dark/`,category:"Other",creationFunction:function(){return new lb({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/",retinaTiles:t,credit:`&copy; <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a>
&copy; <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a>
&copy; <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new qr({name:"Sentinel-2",iconUrl:on("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 K0.fromAssetId(3954)}})),e.push(new qr({name:"Blue Marble",iconUrl:on("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return K0.fromAssetId(3845)}})),e.push(new qr({name:"Earth at night",iconUrl:on("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 K0.fromAssetId(3812)}})),e.push(new qr({name:"Natural Earth\xA0II",iconUrl:on("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast.
http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return og.fromUrl(on("Assets/Textures/NaturalEarthII"))}})),e}var fA=Yxt;var Ayo=T(S(),1);function Hxt(){let e=[];return e.push(new qr({name:"WGS84 Ellipsoid",iconUrl:on("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new uT}})),e.push(new qr({name:"Cesium World Terrain",iconUrl:on("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 kT({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var pA=Hxt;var jyo=T(S(),1);var Byo=T(S(),1);function Kxt(e){let t;if(l(e)){t="Command Statistics";let n=e.commandsInFrustums;for(let i in n)if(n.hasOwnProperty(i)){let o=parseInt(i,10),r;if(o===7)r="1, 2 and 3";else{let s=[];for(let a=2;a>=0;a--){let c=Math.pow(2,a);o>=c&&(s.push(a+1),o-=c)}r=s.reverse().join(" and ")}t+=`<br>&nbsp;&nbsp;&nbsp;&nbsp;${n[i]} in frustum ${r}`}t+=`<br>Total: ${e.totalCommands}`}return t}function V7(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var zxt=new gn,Jxt=new h;function bA(e,t){let n=this,i=e.canvas,o=new kd(i);this._eventHandler=o,this._scene=e,this._canvas=i,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=t;let r=this._scene.globe;r.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.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="",Ce.track(this,["frustums","frustumPlanes","performance","shaderCacheText","primitiveBoundingSphere","primitiveReferenceFrame","filterPrimitive","tileBoundingSphere","filterTile","wireframe","depthFrustum","suspendUpdates","tileCoordinates","frustumStatisticText","tileText","hasPickedPrimitive","hasPickedTile","pickPrimitiveActive","pickTileActive","dropDownVisible","generalVisible","primitivesVisible","terrainVisible","depthFrustumText"]),this._toggleDropDown=Rn(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=Rn(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=Rn(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=Rn(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=Ce.getObservable(this,"frustums").subscribe(function(d){n._scene.debugShowFrustums=d,n._scene.requestRender()}),this._frustumPlanesSubscription=Ce.getObservable(this,"frustumPlanes").subscribe(function(d){n._scene.debugShowFrustumPlanes=d,n._scene.requestRender()}),this._performanceSubscription=Ce.getObservable(this,"performance").subscribe(function(d){d?n._performanceDisplay=new $0({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=Rn(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=Ce.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=Rn(function(){if(n.primitiveReferenceFrame){let d=n._primitive.modelMatrix;n._modelMatrixPrimitive=new W9({modelMatrix:d}),n._scene.primitives.add(n._modelMatrixPrimitive)}else l(n._modelMatrixPrimitive)&&(n._scene.primitives.remove(n._modelMatrixPrimitive),n._modelMatrixPrimitive=void 0);return n._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=Ce.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=Rn(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(d){return l(n._modelMatrixPrimitive)&&d.owner===n._modelMatrixPrimitive._primitive?!0:l(n._primitive)?d.owner===n._primitive||d.owner===n._primitive._billboardCollection||d.owner.primitive===n._primitive:!1}:n._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=Ce.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=Ce.getObservable(this,"wireframe").subscribe(function(d){r._surface.tileProvider._debug.wireframe=d,n._scene.requestRender()}),this._depthFrustumSubscription=Ce.getObservable(this,"depthFrustum").subscribe(function(d){n._scene.debugShowDepthFrustum=d,n._scene.requestRender()}),this._incrementDepthFrustum=Rn(function(){let d=n.depthFrustum+1;return n.depthFrustum=V7(1,n._numberOfFrustums,d),n._scene.requestRender(),!0}),this._decrementDepthFrustum=Rn(function(){let d=n.depthFrustum-1;return n.depthFrustum=V7(1,n._numberOfFrustums,d),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=Ce.getObservable(this,"suspendUpdates").subscribe(function(d){r._surface._debug.suspendLodUpdate=d,d||(n.filterTile=!1)});let s;this._showTileCoordinates=Rn(function(){return n.tileCoordinates&&!l(s)?s=e.imageryLayers.addImageryProvider(new J9({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&l(s)&&(e.imageryLayers.remove(s),s=void 0),!0}),this._tileCoordinatesSubscription=Ce.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=Ce.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=Rn(function(){return n.tileBoundingSphere?r._surface.tileProvider._debug.boundingSphereTile=n._tile:r._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=Rn(function(){return n.filterTile?(n.suspendUpdates=!0,r._surface._tilesToRender=[],l(n._tile)&&n._tile.renderable&&r._surface._tilesToRender.push(n._tile)):n.suspendUpdates=!1,!0}),this._filterTileSubscription=Ce.getObservable(this,"filterTile").subscribe(function(){n.doFilterTile(),n._scene.requestRender()});function a(d){let u=n._scene.pick({x:d.position.x,y:d.position.y});l(u)&&(n.primitive=l(u.collection)?u.collection:u.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=Rn(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=Ce.getObservable(this,"pickPrimitiveActive").subscribe(function(d){d?o.setInputAction(a,Vn.LEFT_CLICK):o.removeInputAction(Vn.LEFT_CLICK)});function c(d){let u,m=r.ellipsoid,p=n._scene.camera.getPickRay(d.position,zxt),y=r.pick(p,n._scene,Jxt);if(l(y)){let f=m.cartesianToCartographic(y),x=r._surface.tileProvider._tilesToRenderByTextureCount;for(let _=0;!u&&_<x.length;++_){let C=x[_];if(l(C))for(let V=0;!u&&V<C.length;++V){let L=C[V];de.contains(L.rectangle,f)&&(u=L)}}}n.tile=u,n.pickTileActive=!1}this._pickTile=Rn(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=Ce.getObservable(this,"pickTileActive").subscribe(function(d){d?o.setInputAction(c,Vn.LEFT_CLICK):o.removeInputAction(Vn.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(bA.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(){let e=this;return Rn(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return Rn(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return Rn(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return Rn(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return Rn(function(){e.tile=e.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(e){let t=this._primitive;e!==t&&(this.hasPickedPrimitive=!0,l(t)&&(t.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,l(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),this._primitive=e,e.show=!1,setTimeout(function(){e.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())}},tile:{get:function(){return this._tile},set:function(e){if(l(e)){this.hasPickedTile=!0;let t=this._tile;if(e!==t){this.tileText=`L: ${e.level} X: ${e.x} Y: ${e.y}`,this.tileText+=`<br>SW corner: ${e.rectangle.west}, ${e.rectangle.south}`,this.tileText+=`<br>NE corner: ${e.rectangle.east}, ${e.rectangle.north}`;let n=e.data;l(n)&&l(n.tileBoundingRegion)?this.tileText+=`<br>Min: ${n.tileBoundingRegion.minimumHeight} Max: ${n.tileBoundingRegion.maximumHeight}`:this.tileText+="<br>(Tile is not loaded)"}this._tile=e,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0}}});bA.prototype._update=function(){this.frustums&&(this.frustumStatisticText=Kxt(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=V7(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}`};bA.prototype.isDestroyed=function(){return!1};bA.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._depthFrustumSubscription.dispose(),this._suspendUpdatesSubscription.dispose(),this._tileCoordinatesSubscription.dispose(),this._tileBoundingSphereSubscription.dispose(),this._filterTileSubscription.dispose(),this._pickPrimitiveActiveSubscription.dispose(),this._pickTileActiveSubscription.dispose(),ue(this)};var yA=bA;function SB(e,t){e=Wn(e);let n=document.createElement("div"),i=new yA(t,n);this._viewModel=i,this._container=e;let o=document.createElement("div");this._element=o;let r=document.createElement("div");r.textContent="Cesium Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleDropDown"),o.appendChild(r),o.className="cesium-cesiumInspector",o.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",o.appendChild(s);let a=Na.createSection,c=Na.createCheckbox,d=a(s,"General","generalVisible","toggleGeneral"),u=c("Show Frustums","frustums"),m=document.createElement("div");m.className="cesium-cesiumInspector-frustumStatistics",m.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),u.appendChild(m),d.appendChild(u),d.appendChild(c("Show Frustum Planes","frustumPlanes")),d.appendChild(c("Performance Display","performance")),n.className="cesium-cesiumInspector-performanceDisplay",d.appendChild(n);let p=document.createElement("div");p.className="cesium-cesiumInspector-shaderCache",p.setAttribute("data-bind","html: shaderCacheText"),d.appendChild(p);let y=document.createElement("div");d.appendChild(y);let f=document.createElement("span");f.setAttribute("data-bind",'html: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Frustum:"'),y.appendChild(f);let x=document.createElement("span");x.setAttribute("data-bind","text: depthFrustumText"),y.appendChild(x);let _=document.createElement("input");_.type="button",_.value="-",_.className="cesium-cesiumInspector-pickButton",_.setAttribute("data-bind","click: decrementDepthFrustum"),y.appendChild(_);let C=document.createElement("input");C.type="button",C.value="+",C.className="cesium-cesiumInspector-pickButton",C.setAttribute("data-bind","click: incrementDepthFrustum"),y.appendChild(C);let V=a(s,"Primitives","primitivesVisible","togglePrimitives"),L=document.createElement("div");L.className="cesium-cesiumInspector-pickSection",V.appendChild(L);let Z=document.createElement("input");Z.type="button",Z.value="Pick a primitive",Z.className="cesium-cesiumInspector-pickButton",Z.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let G=document.createElement("div");G.className="cesium-cesiumInspector-center",G.appendChild(Z),L.appendChild(G),L.appendChild(c("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),L.appendChild(c("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=c("Show only selected","filterPrimitive","hasPickedPrimitive"),L.appendChild(this._primitiveOnly);let I=a(s,"Terrain","terrainVisible","toggleTerrain"),P=document.createElement("div");P.className="cesium-cesiumInspector-pickSection",I.appendChild(P);let v=document.createElement("input");v.type="button",v.value="Pick a tile",v.className="cesium-cesiumInspector-pickButton",v.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),G=document.createElement("div"),G.appendChild(v),G.className="cesium-cesiumInspector-center",P.appendChild(G);let F=document.createElement("div");P.appendChild(F);let M=document.createElement("input");M.type="button",M.value="Parent",M.className="cesium-cesiumInspector-pickButton",M.setAttribute("data-bind","click: selectParent");let b=document.createElement("input");b.type="button",b.value="NW",b.className="cesium-cesiumInspector-pickButton",b.setAttribute("data-bind","click: selectNW");let R=document.createElement("input");R.type="button",R.value="NE",R.className="cesium-cesiumInspector-pickButton",R.setAttribute("data-bind","click: selectNE");let E=document.createElement("input");E.type="button",E.value="SW",E.className="cesium-cesiumInspector-pickButton",E.setAttribute("data-bind","click: selectSW");let X=document.createElement("input");X.type="button",X.value="SE",X.className="cesium-cesiumInspector-pickButton",X.setAttribute("data-bind","click: selectSE");let w=document.createElement("div");w.className="cesium-cesiumInspector-tileText",F.className="cesium-cesiumInspector-frustumStatistics",F.appendChild(w),F.setAttribute("data-bind","visible: hasPickedTile"),w.setAttribute("data-bind","html: tileText");let N=document.createElement("div");N.className="cesium-cesiumInspector-relativeText",N.textContent="Select relative:",F.appendChild(N);let D=document.createElement("table"),k=document.createElement("tr"),Y=document.createElement("tr"),U=document.createElement("td");U.appendChild(M);let J=document.createElement("td");J.appendChild(b);let K=document.createElement("td");K.appendChild(R),k.appendChild(U),k.appendChild(J),k.appendChild(K);let ee=document.createElement("td"),H=document.createElement("td");H.appendChild(E);let j=document.createElement("td");j.appendChild(X),Y.appendChild(ee),Y.appendChild(H),Y.appendChild(j),D.appendChild(k),D.appendChild(Y),F.appendChild(D),P.appendChild(c("Show bounding volume","tileBoundingSphere","hasPickedTile")),P.appendChild(c("Show only selected","filterTile","hasPickedTile")),I.appendChild(c("Wireframe","wireframe")),I.appendChild(c("Suspend LOD update","suspendUpdates")),I.appendChild(c("Show tile coordinates","tileCoordinates")),Ce.applyBindings(i,this._element)}Object.defineProperties(SB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});SB.prototype.isDestroyed=function(){return!1};SB.prototype.destroy=function(){return Ce.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var gA=SB;var dgo=T(S(),1);var igo=T(S(),1);function CB(e,t){l(t)||(t=document.body),t=Wn(t);let n=this,i=Ce.observable(pr.fullscreen),o=Ce.observable(pr.enabled),r=t.ownerDocument;this.isFullscreen=void 0,Ce.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,Ce.defineProperty(this,"isFullscreenEnabled",{get:function(){return o()},set:function(s){o(s&&pr.enabled)}}),this.tooltip=void 0,Ce.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=Rn(function(){pr.fullscreen?pr.exitFullscreen():pr.requestFullscreen(n._fullscreenElement)},Ce.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=g(Wn(e),r.body),this._callback=function(){i(pr.fullscreen)},r.addEventListener(pr.changeEventName,this._callback)}Object.defineProperties(CB.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});CB.prototype.isDestroyed=function(){return!1};CB.prototype.destroy=function(){document.removeEventListener(pr.changeEventName,this._callback),ue(this)};var xA=CB;var Qxt="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",jxt="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";function VB(e,t){e=Wn(e);let n=new xA(t,e);n._exitFullScreenPath=jxt,n._enterFullScreenPath=Qxt;let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-fullscreenButton",i.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(i),Ce.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties(VB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});VB.prototype.isDestroyed=function(){return!1};VB.prototype.destroy=function(){return this._viewModel.destroy(),Ce.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var _A=VB;var Cgo=T(S(),1);var bgo=T(S(),1);var STe=1e3;function lm(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new r9({scene:e.scene})],this._viewContainer=e.container,this._scene=e.scene,this._flightDuration=e.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._wasGeocodeCancelled=!1,this._previousCredits=[],this._complete=new ye,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=VTe,this._handleArrowUp=CTe;let t=this;this._suggestionsVisible=Ce.pureComputed(function(){let o=Ce.getObservable(t,"_suggestions")().length>0,r=Ce.getObservable(t,"_showSuggestions")();return o&&r}),this._searchCommand=Rn(function(i){if(i=g(i,xg.SEARCH),t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)i_t(t);else return t_t(t,t._geocoderServices,i)}),this.deselectSuggestion=function(){t._selectedSuggestion=void 0},this.handleKeyDown=function(i,o){let r=o.key==="ArrowDown"||o.key==="Down"||o.keyCode===40,s=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38;return(r||s)&&o.preventDefault(),!0},this.handleKeyUp=function(i,o){let r=o.key==="ArrowDown"||o.key==="Down"||o.keyCode===40,s=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38,a=o.key==="Enter"||o.keyCode===13;return s?CTe(t):r?VTe(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let o=i.destination;ZTe(t),t.destinationFound(t,o)},this.hideSuggestions=function(){t._showSuggestions=!1,t._selectedSuggestion=void 0},this.showSuggestions=function(){t._showSuggestions=!0},this.handleMouseover=function(i,o){i!==t._selectedSuggestion&&(t._selectedSuggestion=i)},this.keepExpanded=!1,this.autoComplete=g(e.autocomplete,!0),this.destinationFound=g(e.destinationFound,lm.flyToDestination),this._focusTextbox=!1,Ce.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=Ce.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){lm._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,Ce.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,Ce.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){this._searchText=i}}),this.flightDuration=void 0,Ce.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){this._flightDuration=i}})}Object.defineProperties(lm.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}}});lm.prototype.destroy=function(){this._suggestionSubscription.dispose()};function CTe(e){if(e._suggestions.length===0)return;let t=e._suggestions.indexOf(e._selectedSuggestion);if(t===-1||t===0){e._selectedSuggestion=void 0;return}let n=t-1;e._selectedSuggestion=e._suggestions[n],lm._adjustSuggestionsScroll(e,n)}function VTe(e){if(e._suggestions.length===0)return;let t=e._suggestions.length,i=(e._suggestions.indexOf(e._selectedSuggestion)+1)%t;e._selectedSuggestion=e._suggestions[i],lm._adjustSuggestionsScroll(e,i)}function qxt(e,t){let n=l(t)?t.availability:void 0;return l(n)?YT(t,[e]).then(function(i){return e=i[0],e.height+=STe,e}):(e.height+=STe,Promise.resolve(e))}function $xt(e,t){let n=e._scene,o=n.mapProjection.ellipsoid,r=n.camera,s=n.terrainProvider,a=t,c;return t instanceof de?W.equalsEpsilon(t.south,t.north,W.EPSILON7)&&W.equalsEpsilon(t.east,t.west,W.EPSILON7)?t=de.center(t):c=jT(t,n):t=o.cartesianToCartographic(t),l(c)||(c=qxt(t,s)),c.then(function(d){a=o.cartographicToCartesian(d)}).finally(function(){r.flyTo({destination:a,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:A.IDENTITY})})}async function e_t(e,t,n){try{return{state:"fulfilled",value:await e.geocode(t,n),credits:e.credit}}catch(i){return{state:"rejected",reason:i}}}async function t_t(e,t,n){let i=e._searchText;if(RTe(i)){e.showSuggestions();return}e._isSearchInProgress=!0,e._wasGeocodeCancelled=!1;let o,r;for(o=0;o<t.length;o++){if(e._wasGeocodeCancelled)return;if(r=await e_t(t[o],i,n),l(r)&&r.state==="fulfilled"&&r.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,R7(e);let s=r.value;if(r.state==="fulfilled"&&l(s)&&s.length>0){e._searchText=s[0].displayName,e.destinationFound(e,s[0].destination);let a=LTe(e,KV.getCreditsFromResult(s[0]));l(a)||L7(e,t[o].credit);return}e._searchText=`${i} (not found)`}function L7(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function LTe(e,t){return l(t)&&t.forEach(n=>L7(e,n)),t}function R7(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function n_t(e,t){let n=Wn(e._viewContainer),i=n.getElementsByClassName("search-results")[0],r=n.getElementsByTagName("li")[t];if(t===0){i.scrollTop=0;return}let s=r.offsetTop;s+r.clientHeight>i.clientHeight?i.scrollTop=s+r.clientHeight:s<i.scrollTop&&(i.scrollTop=s)}function i_t(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function RTe(e){return/^\s*$/.test(e)}function ZTe(e){Ce.getObservable(e,"_suggestions").removeAll()}async function o_t(e){if(!e.autoComplete)return;let t=e._searchText;if(ZTe(e),R7(e),!RTe(t))for(let n of e._geocoderServices){let i=await n.geocode(t,xg.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let o=!0;i.forEach(r=>{let s=KV.getCreditsFromResult(r);o=o&&!l(s),LTe(e,s)}),o&&L7(e,n.credit)}if(e._suggestions.length>=5)return}}lm.flyToDestination=$xt;lm._updateSearchSuggestions=o_t;lm._adjustSuggestionsScroll=n_t;lm.prototype.isDestroyed=function(){return!1};lm.prototype.destroy=function(){return R7(this),ue(this)};var TA=lm;var r_t="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",s_t="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";function LB(e){let t=Wn(e.container),n=new TA(e);n._startSearchPath=r_t,n._stopSearchPath=s_t;let i=document.createElement("form");i.setAttribute("data-bind","submit: search");let o=document.createElement("input");o.type="search",o.className="cesium-geocoder-input",o.setAttribute("placeholder","Enter an address or landmark..."),o.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(){o.select()},0)},o.addEventListener("focus",this._onTextBoxFocus,!1),i.appendChild(o),this._textBox=o;let r=document.createElement("span");r.className="cesium-geocoder-searchButton",r.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),i.appendChild(r),t.appendChild(i);let s=document.createElement("div");s.className="search-results",s.setAttribute("data-bind","visible: _suggestionsVisible");let a=document.createElement("ul");a.setAttribute("data-bind","foreach: _suggestions");let c=document.createElement("li");a.appendChild(c),c.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),s.appendChild(a),t.appendChild(s),Ce.applyBindings(n,i),Ce.applyBindings(n,s),this._container=t,this._searchSuggestionsContainer=s,this._viewModel=n,this._form=i,this._onInputBegin=function(d){let u=d.target;typeof d.composedPath=="function"&&(u=d.composedPath()[0]),t.contains(u)||(n._focusTextbox=!1,n.hideSuggestions())},this._onInputEnd=function(d){n._focusTextbox=!0,n.showSuggestions()},Bt.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),t.addEventListener("pointerup",this._onInputEnd,!0),t.addEventListener("pointercancel",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),t.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),t.addEventListener("touchend",this._onInputEnd,!0),t.addEventListener("touchcancel",this._onInputEnd,!0))}Object.defineProperties(LB.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});LB.prototype.isDestroyed=function(){return!1};LB.prototype.destroy=function(){let e=this._container;return Bt.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),e.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),e.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),e.removeEventListener("touchend",this._onInputEnd,!0)),this._viewModel.destroy(),Ce.cleanNode(this._form),Ce.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),ue(this)};var SA=LB;var vgo=T(S(),1);var Zgo=T(S(),1);function GTe(e,t){this._scene=e,this._duration=t;let n=this;this._command=Rn(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",Ce.track(this,["tooltip"])}Object.defineProperties(GTe.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}}});var CA=GTe;function RB(e,t,n){e=Wn(e);let i=new CA(t,n);i._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-home-button",o.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(o),Ce.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(RB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});RB.prototype.isDestroyed=function(){return!1};RB.prototype.destroy=function(){return Ce.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var VA=RB;var Ygo=T(S(),1);var Mgo=T(S(),1);var a_t="M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z",c_t="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";function Z7(){this._cameraClicked=new ye,this._closeClicked=new ye,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",Ce.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,Ce.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?c_t:a_t}}),Ce.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}Z7.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(Z7.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var LA=Z7;function ZB(e){e=Wn(e);let t=document.createElement("div");t.className="cesium-infoBox",t.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),e.appendChild(t);let n=document.createElement("div");n.className="cesium-infoBox-title",n.setAttribute("data-bind","text: titleText"),t.appendChild(n);let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-infoBox-camera",i.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),t.appendChild(i);let o=document.createElement("button");o.type="button",o.className="cesium-infoBox-close",o.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),o.innerHTML="&times;",t.appendChild(o);let r=document.createElement("iframe");r.className="cesium-infoBox-iframe",r.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),r.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),r.setAttribute("allowfullscreen",!0),t.appendChild(r);let s=new LA;Ce.applyBindings(s,t),this._container=e,this._element=t,this._frame=r,this._viewModel=s,this._descriptionSubscription=void 0;let a=this;r.addEventListener("load",function(){let c=r.contentDocument,d=c.createElement("link");d.href=on("Widgets/InfoBox/InfoBoxDescription.css"),d.rel="stylesheet",d.type="text/css";let u=c.createElement("div");u.className="cesium-infoBox-description",c.head.appendChild(d),c.body.appendChild(u),a._descriptionSubscription=ba(s,"description",function(m){r.style.height="5px",u.innerHTML=m;let p=null,y=u.firstElementChild;if(y!==null&&u.childNodes.length===1){let x=window.getComputedStyle(y);if(x!==null){let _=x["background-color"],C=O.fromCssColorString(_);l(C)&&C.alpha!==0&&(p=x["background-color"])}}t.style["background-color"]=p;let f=u.getBoundingClientRect().height;r.style.height=`${f}px`})}),r.setAttribute("src","about:blank")}Object.defineProperties(ZB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});ZB.prototype.isDestroyed=function(){return!1};ZB.prototype.destroy=function(){let e=this._container;return Ce.cleanNode(this._element),e.removeChild(this._element),l(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),ue(this)};var RA=ZB;var nxo=T(S(),1);var Jgo=T(S(),1);function ETe(){this.showInstructions=!1;let e=this;this._command=Rn(function(){e.showInstructions=!e.showInstructions}),this._showClick=Rn(function(){e._touch=!1}),this._showTouch=Rn(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",Ce.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(ETe.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var ZA=ETe;function GB(e){let t=Wn(e.container),n=new ZA,i=g(e.instructionsInitiallyVisible,!1);n.showInstructions=i,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";let o=document.createElement("span");o.className="cesium-navigationHelpButton-wrapper",t.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",r.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),o.appendChild(r);let s=document.createElement("div");s.className="cesium-navigation-help",s.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),o.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-navigation-button cesium-navigation-button-left",a.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');let c=document.createElement("img");c.src=on("Widgets/Images/NavigationHelp/Mouse.svg"),c.className="cesium-navigation-button-icon",c.style.width="25px",c.style.height="25px",a.appendChild(c),a.appendChild(document.createTextNode("Mouse"));let d=document.createElement("button");d.type="button",d.className="cesium-navigation-button cesium-navigation-button-right",d.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');let u=document.createElement("img");u.src=on("Widgets/Images/NavigationHelp/Touch.svg"),u.className="cesium-navigation-button-icon",u.style.width="25px",u.style.height="25px",d.appendChild(u),d.appendChild(document.createTextNode("Touch")),s.appendChild(a),s.appendChild(d);let m=document.createElement("div");m.className="cesium-click-navigation-help cesium-navigation-help-instructions",m.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),m.innerHTML=` <table> <tr> <td><img src="${on("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="${on("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="${on("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>`,s.appendChild(m);let p=document.createElement("div");p.className="cesium-touch-navigation-help cesium-navigation-help-instructions",p.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),p.innerHTML=` <table> <tr> <td><img src="${on("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="${on("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="${on("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="${on("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>`,s.appendChild(p),Ce.applyBindings(n,o),this._container=t,this._viewModel=n,this._wrapper=o,this._closeInstructions=function(y){o.contains(y.target)||(n.showInstructions=!1)},Bt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(GB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});GB.prototype.isDestroyed=function(){return!1};GB.prototype.destroy=function(){return Bt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),Ce.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var GA=GB;var bxo=T(S(),1);var lxo=T(S(),1);function G7(e){this._scene=e.scene,this.lowFrameRateMessage=g(e.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,Ce.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=Rn(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=w9.fromScene(e.scene);this._unsubscribeLowFrameRate=n.lowFrameRate.addEventListener(function(){t.lowFrameRateMessageDismissed||(t.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=n.nominalFrameRate.addEventListener(function(){t.showingLowFrameRateMessage=!1})}Object.defineProperties(G7.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});G7.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),ue(this)};var EA=G7;function EB(e){let t=Wn(e.container),n=new EA(e),i=document.createElement("div");i.className="cesium-performance-watchdog-message-area",i.setAttribute("data-bind","visible: showingLowFrameRateMessage");let o=document.createElement("button");o.setAttribute("type","button"),o.className="cesium-performance-watchdog-message-dismiss",o.innerHTML="&times;",o.setAttribute("data-bind","click: dismissMessage"),i.appendChild(o);let r=document.createElement("div");r.className="cesium-performance-watchdog-message",r.setAttribute("data-bind","html: lowFrameRateMessage"),i.appendChild(r),t.appendChild(i),Ce.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(EB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});EB.prototype.isDestroyed=function(){return!1};EB.prototype.destroy=function(){return this._viewModel.destroy(),Ce.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var IA=EB;var Exo=T(S(),1);var Sxo=T(S(),1);function IB(e){this._scene=e,this._orthographic=e.camera.frustum instanceof rn,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,Ce.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;Ce.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=Rn(function(){t.sceneMode===ie.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new Er,this._eventHelper.add(e.morphComplete,function(n,i,o,r){t.sceneMode=o,t._orthographic=o===ie.SCENE2D||t._scene.camera.frustum instanceof rn}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=l(e.camera._currentFlight)}),this._switchToPerspective=Rn(function(){t.sceneMode!==ie.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=Rn(function(){t.sceneMode!==ie.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=ie}Object.defineProperties(IB.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}}});IB.prototype.isDestroyed=function(){return!1};IB.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var XA=IB;var l_t="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",d_t="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";function XB(e,t){e=Wn(e);let n=new XA(t);n._perspectivePath=l_t,n._orthographicPath=d_t;let i=document.createElement("span");i.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(i);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button",o.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'),o.innerHTML='<!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --><!-- /ko -->',i.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",r.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 }'),i.appendChild(r);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",s.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 }'),i.appendChild(s),Ce.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(a){i.contains(a.target)||(n.dropDownVisible=!1)},Bt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(XB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});XB.prototype.isDestroyed=function(){return!1};XB.prototype.destroy=function(){return this._viewModel.destroy(),Bt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Ce.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var WA=XB;var Bxo=T(S(),1);var Fxo=T(S(),1);function WB(e,t){this._scene=e;let n=this,i=function(o,r,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new Er,this._eventHelper.add(e.morphStart,i),this._duration=g(t,2),this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",Ce.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,Ce.defineProperty(this,"selectedTooltip",function(){let o=n.sceneMode;return o===ie.SCENE2D?n.tooltip2D:o===ie.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=Rn(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=Rn(function(){e.morphTo2D(n._duration)}),this._morphTo3D=Rn(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=Rn(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=ie}Object.defineProperties(WB.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}}});WB.prototype.isDestroyed=function(){return!1};WB.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var PA=WB;var u_t="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",m_t="m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z",h_t="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";function PB(e,t,n){e=Wn(e);let i=new PA(t,n);i._globePath=u_t,i._flatMapPath=m_t,i._columbusViewPath=h_t;let o=document.createElement("span");o.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.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'),r.innerHTML='<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->',o.appendChild(r);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",s.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 }'),o.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",a.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 }'),o.appendChild(a);let c=document.createElement("button");c.type="button",c.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",c.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 }'),o.appendChild(c),Ce.applyBindings(i,o),this._viewModel=i,this._container=e,this._wrapper=o,this._closeDropDown=function(d){o.contains(d.target)||(i.dropDownVisible=!1)},Bt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(PB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});PB.prototype.isDestroyed=function(){return!1};PB.prototype.destroy=function(){return this._viewModel.destroy(),Bt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Ce.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var vA=PB;var t_o=T(S(),1);var zxo=T(S(),1);var f_t=new B,vB="-1000px";function wA(e,t,n){this._scene=e,this._screenPositionX=vB,this._screenPositionY=vB,this._tweens=e.tweens,this._container=g(n,document.body),this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,Ce.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,Ce.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&l(this.position)}}),Ce.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,o){return to.wgs84ToWindowCoordinates(e,i,o)}}wA.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,f_t);if(!l(e))this._screenPositionX=vB,this._screenPositionY=vB;else{let t=this._container,n=t.parentNode.clientWidth,i=t.parentNode.clientHeight,o=this._selectionIndicatorElement.clientWidth,r=o*.5;e.x=Math.min(Math.max(e.x,-o),n+o)-r,e.y=Math.min(Math.max(e.y,-o),i+o)-r,this._screenPositionX=`${Math.floor(e.x+.25)}px`,this._screenPositionY=`${Math.floor(e.y+.25)}px`}}};wA.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:Ar.EXPONENTIAL_OUT})};wA.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:Ar.EXPONENTIAL_OUT})};Object.defineProperties(wA.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var FA=wA;function wB(e,t){e=Wn(e),this._container=e;let n=document.createElement("div");n.className="cesium-selection-wrapper",n.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(n),this._element=n;let i="http://www.w3.org/2000/svg",o="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",r=document.createElementNS(i,"svg:svg");r.setAttribute("width",160),r.setAttribute("height",160),r.setAttribute("viewBox","0 0 160 160");let s=document.createElementNS(i,"g");s.setAttribute("transform","translate(80,80)"),r.appendChild(s);let a=document.createElementNS(i,"path");a.setAttribute("data-bind","attr: { transform: _transform }"),a.setAttribute("d",o),s.appendChild(a),n.appendChild(r);let c=new FA(t,this._element,this._container);this._viewModel=c,Ce.applyBindings(this._viewModel,this._element)}Object.defineProperties(wB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});wB.prototype.isDestroyed=function(){return!1};wB.prototype.destroy=function(){let e=this._container;return Ce.cleanNode(this._element),e.removeChild(this._element),ue(this)};var AA=wB;var h_o=T(S(),1);var o_o=T(S(),1);function uS(e,t,n){this._color=e,this._height=t,this._base=g(n,0)}uS.prototype.getHeight=function(){return this._height};uS.prototype.getBase=function(){return this._base};uS.prototype.getStartTime=function(){return this._start};uS.prototype.getStopTime=function(){return this._stop};uS.prototype.setRange=function(e,t){this._start=e,this._stop=t};uS.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){let n=te.secondsDifference(this._start,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(n)),o=te.secondsDifference(this._stop,e.epochJulian),r=Math.round(e.timeBarWidth*e.getAlpha(o))-i;i<0&&(r+=i,i=0),i+r>e.timeBarWidth&&(r=e.timeBarWidth-i),r>0&&(t=`<span class="cesium-timeline-highlight" style="left: ${i.toString()}px; width: ${r.toString()}px; bottom: ${this._base.toString()}px; height: ${this._height}px; background-color: ${this._color};"></span>`)}return t};var MA=uS;var a_o=T(S(),1);function ITe(e,t,n,i){this.interval=e,this.height=t,this.color=n||new O(.5,.5,.5,1),this.backgroundColor=i||new O(0,0,0,0)}ITe.prototype.render=function(e,t){let n=this.interval.start,i=this.interval.stop,o=t.startJulian,r=te.addSeconds(t.startJulian,t.duration,new te);if(te.lessThan(n,o)&&te.greaterThan(i,r))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(te.lessThanOrEquals(n,r)&&te.greaterThanOrEquals(i,o)){let s,a,c;for(s=0;s<t.timeBarWidth;++s){let d=te.addSeconds(t.startJulian,s/t.timeBarWidth*t.duration,new te);!l(a)&&te.greaterThanOrEquals(d,n)?a=s:!l(c)&&te.greaterThanOrEquals(d,i)&&(c=s)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),l(a)&&(l(c)||(c=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(a,t.y,Math.max(c-a,1),this.height))}};var NA=ITe;var E7=1e12,dm={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},sl={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},Ig=[.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],p_t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function al(e,t){e=Wn(e);let n=e.ownerDocument;this.container=e;let i=n.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=dm.none,this._touchMode=sl.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=b_t(this),this._onMouseUp=y_t(this),this._onMouseMove=g_t(this),this._onMouseWheel=x_t(this),this._onTouchStart=__t(this),this._onTouchMove=S_t(this),this._onTouchEnd=T_t(this);let o=this._timeBarEle;n.addEventListener("mouseup",this._onMouseUp,!1),n.addEventListener("mousemove",this._onMouseMove,!1),o.addEventListener("mousedown",this._onMouseDown,!1),o.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),o.addEventListener("mousewheel",this._onMouseWheel,!1),o.addEventListener("touchstart",this._onTouchStart,!1),o.addEventListener("touchmove",this._onTouchMove,!1),o.addEventListener("touchend",this._onTouchEnd,!1),o.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}al.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};al.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};al.prototype.isDestroyed=function(){return!1};al.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this);let e=this.container.ownerDocument;e.removeEventListener("mouseup",this._onMouseUp,!1),e.removeEventListener("mousemove",this._onMouseMove,!1);let t=this._timeBarEle;t.removeEventListener("mousedown",this._onMouseDown,!1),t.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),t.removeEventListener("mousewheel",this._onMouseWheel,!1),t.removeEventListener("touchstart",this._onTouchStart,!1),t.removeEventListener("touchmove",this._onTouchMove,!1),t.removeEventListener("touchend",this._onTouchEnd,!1),t.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),ue(this)};al.prototype.addHighlightRange=function(e,t,n){let i=new MA(e,t,n);return this._highlightRanges.push(i),this.resize(),i};al.prototype.addTrack=function(e,t,n,i){let o=new NA(e,t,n,i);return this._trackList.push(o),this._lastHeight=void 0,this.resize(),o};al.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=te.secondsDifference(t,e),this._clock&&this._clock.clockRange!==vr.UNBOUNDED){let i=this._clock.startTime,o=this._clock.stopTime,r=te.secondsDifference(o,i),s=te.secondsDifference(i,this._startJulian),a=te.secondsDifference(o,this._endJulian);this._timeBarSecondsSpan>=r?(this._timeBarSecondsSpan=r,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=te.addSeconds(this._endJulian,s,new te),this._startJulian=i,this._timeBarSecondsSpan=te.secondsDifference(this._endJulian,this._startJulian)):a<0&&(this._startJulian=te.addSeconds(this._startJulian,a,new te),this._endJulian=o,this._timeBarSecondsSpan=te.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();let n=document.createEvent("Event");n.initEvent("setzoom",!0,!0),n.startJulian=this._startJulian,n.endJulian=this._endJulian,n.epochJulian=this._epochJulian,n.totalSpan=this._timeBarSecondsSpan,n.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(n)};al.prototype.zoomFrom=function(e){let t=te.secondsDifference(this._scrubJulian,this._startJulian);e>1||t<0||t>this._timeBarSecondsSpan?t=this._timeBarSecondsSpan*.5:t+=t-this._timeBarSecondsSpan*.5;let n=this._timeBarSecondsSpan-t;this.zoomTo(te.addSeconds(this._startJulian,t-t*e,new te),te.addSeconds(this._endJulian,n*e-n,new te))};function I7(e){return e<10?`0${e.toString()}`:e.toString()}al.prototype.makeLabel=function(e){let t=te.toGregorianDate(e),n=t.millisecond,i=" UTC";if(n>0&&this._timeBarSecondsSpan<3600){for(i=Math.floor(n).toString();i.length<3;)i=`0${i}`;i=`.${i}`}return`${p_t[t.month-1]} ${t.day} ${t.year} ${I7(t.hour)}:${I7(t.minute)}:${I7(t.second)}${i}`};al.prototype.smallestTicInPixels=7;al.prototype._makeTics=function(){let e=this._timeBarEle,t=te.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan),i=n-8,o,r=this;this._needleEle.style.left=`${n.toString()}px`;let s="",a=.01,c=31536e6,d=1e-10,u=0,m=this._timeBarSecondsSpan;m<a?(m=a,this._timeBarSecondsSpan=a,this._endJulian=te.addSeconds(this._startJulian,a,new te)):m>c&&(m=c,this._timeBarSecondsSpan=c,this._endJulian=te.addSeconds(this._startJulian,c,new te));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let y=this._startJulian,f=Math.min(m/p*1e-5,.4),x,_=te.toGregorianDate(y);m>31536e4?x=te.fromDate(new Date(Date.UTC(Math.floor(_.year/100)*100,0))):m>31536e3?x=te.fromDate(new Date(Date.UTC(Math.floor(_.year/10)*10,0))):m>86400?x=te.fromDate(new Date(Date.UTC(_.year,0))):x=te.fromDate(new Date(Date.UTC(_.year,_.month,_.day)));let C=te.secondsDifference(this._startJulian,te.addSeconds(x,f,new te)),V=C+m;this._epochJulian=x;function L(U){return Math.floor(C/U)*U}function Z(U,J){return Math.ceil(U/J+.5)*J}function G(U){return(U-C)/m}function I(U,J){return U-J*Math.round(U/J)}this._rulerEle.innerHTML=this.makeLabel(te.addSeconds(this._endJulian,-a,new te));let P=this._rulerEle.offsetWidth+20;P<30&&(P=180);let v=u;u-=d;let F={startTime:C,startJulian:y,epochJulian:x,duration:m,timeBarWidth:p,getAlpha:G};this._highlightRanges.forEach(function(U){s+=U.render(F)});let M=0,b=0,R=0,E=P/p;E>1&&(E=1),E*=this._timeBarSecondsSpan;let X=-1,w=-1,N=Ig.length,D;for(D=0;D<N;++D){let U=Ig[D];if(++X,M=U,U>E&&U>u)break;w<0&&p*(U/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(w=X)}if(X>0){for(;X>0;)if(--X,Math.abs(I(M,Ig[X]))<1e-5){Ig[X]>=u&&(b=Ig[X]);break}if(w>=0)for(;w<X;){if(Math.abs(I(b,Ig[w]))<1e-5&&Ig[w]>=u){R=Ig[w];break}++w}}u=v,u>d&&R<1e-5&&Math.abs(u-M)>d&&(R=u,u<=M+d&&(b=0));let k=-999999,Y;if(p*(R/this._timeBarSecondsSpan)>=3)for(o=L(R);o<=V;o=Z(o,R))s+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*G(o)).toString()}px;"></span>`;if(p*(b/this._timeBarSecondsSpan)>=3)for(o=L(b);o<=V;o=Z(o,b))s+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*G(o)).toString()}px;"></span>`;if(p*(M/this._timeBarSecondsSpan)>=2){this._mainTicSpan=M,V+=M,o=L(M);let U=te.computeTaiMinusUtc(x);for(;o<=V;){let J=te.addSeconds(y,o-C,new te);if(M>2.1){let j=te.computeTaiMinusUtc(J);Math.abs(j-U)>.1&&(o+=j-U,J=te.addSeconds(y,o-C,new te))}let K=Math.round(p*G(o)),ee=this.makeLabel(J);this._rulerEle.innerHTML=ee,Y=this._rulerEle.offsetWidth,Y<10&&(Y=P);let H=K-(Y/2-1);H>k?(k=H+Y+5,s+=`<span class="cesium-timeline-ticMain" style="left: ${K.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${H.toString()}px;">${ee}</span>`):s+=`<span class="cesium-timeline-ticSub" style="left: ${K.toString()}px;"></span>`,o=Z(o,M)}}else this._mainTicSpan=-1;s+=`<span class="cesium-timeline-icon16" style="left:${i}px;bottom:0;background-position: 0 0;"></span>`,e.innerHTML=s,this._scrubElement=e.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),F.y=0,this._trackList.forEach(function(U){U.render(r._context,F),F.y+=U.height})};al.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(l(this._scrubElement)){let t=te.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==n&&(this._lastXPos=n,e.style.left=`${n-8}px`,this._needleEle.style.left=`${n}px`)}l(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(te.addSeconds(this._startJulian,this._timelineDrag,new te),te.addSeconds(this._endJulian,this._timelineDrag,new te)))};al.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=te.addSeconds(this._startJulian,t,new te),this._scrubElement){let i=e-8;this._scrubElement.style.left=`${i.toString()}px`,this._needleEle.style.left=`${e.toString()}px`}let n=document.createEvent("Event");n.initEvent("settime",!0,!0),n.clientX=e,n.timeSeconds=t,n.timeJulian=this._scrubJulian,n.clock=this._clock,this._topDiv.dispatchEvent(n)};function b_t(e){return function(t){e._mouseMode!==dm.touchOnly&&(t.button===0?(e._mouseMode=dm.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=dm.zoom:e._mouseMode=dm.slide)),t.preventDefault()}}function y_t(e){return function(t){e._mouseMode=dm.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function g_t(e){return function(t){let n;if(e._mouseMode===dm.scrub){t.preventDefault();let i=t.clientX-e._topDiv.getBoundingClientRect().left;i<0?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):i>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===dm.slide){if(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0){let i=n*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(te.addSeconds(e._startJulian,i,new te),te.addSeconds(e._endJulian,i,new te))}}else e._mouseMode===dm.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function x_t(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;E7=Math.max(Math.min(Math.abs(n),E7),1),n/=E7,e.zoomFrom(Math.pow(1.05,-n))}}function __t(e){return function(t){let n=t.touches.length,i,o,r=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=dm.touchOnly,n===1?(i=te.secondsDifference(e._scrubJulian,e._startJulian),o=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+r),Math.abs(t.touches[0].clientX-o)<50?(e._touchMode=sl.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=sl.singleTap,e._touchState.centerX=t.touches[0].clientX-r)):n===2?(e._touchMode=sl.slideZoom,e._touchState.centerX=(t.touches[0].clientX+t.touches[1].clientX)*.5-r,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=sl.ignore}}function T_t(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===sl.singleTap?(e._touchMode=sl.scrub,e._onTouchMove(t)):e._touchMode===sl.scrub&&e._onTouchMove(t),e._mouseMode=dm.touchOnly,n!==1?e._touchMode=n>0?sl.ignore:sl.none:e._touchMode===sl.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function S_t(e){return function(t){let n,i,o,r,s,a,c=1,d=e._topDiv.getBoundingClientRect().left;e._touchMode===sl.singleTap&&(e._touchMode=sl.slideZoom),e._mouseMode=dm.touchOnly,e._touchMode===sl.scrub?(t.preventDefault(),t.changedTouches.length===1&&(i=t.changedTouches[0].clientX-d,i>=0&&i<=e._topDiv.clientWidth&&e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===sl.slideZoom&&(o=t.touches.length,o===2?(r=(t.touches[0].clientX+t.touches[1].clientX)*.5-d,s=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):o===1&&(r=t.touches[0].clientX-d,s=0),l(r)&&(s>0&&e._touchState.spanX>0?(c=e._touchState.spanX/s,a=te.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-r*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new te)):(n=e._touchState.centerX-r,a=te.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new te)),e.zoomTo(a,te.addSeconds(a,e._timeBarSecondsSpan*c,new te)),e._touchState.centerX=r,e._touchState.spanX=s))}}al.prototype.resize=function(){let e=this.container.clientWidth,t=this.container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;this._trackContainer.style.height=`${t}px`;let n=1;this._trackList.forEach(function(i){n+=i.height}),this._trackListEle.style.height=`${n.toString()}px`,this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=n,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=t};var UA=al;var L_o=T(S(),1);var g_o=T(S(),1);function XTe(e){let t=e.split(`
`),n;for(n=0;n<t.length&&!t[n].match(/\S/);n++);if(n===t.length)return"";let i="",o=/^\s*/,s=t[n].match(o)[0].length;for(let a=n;a<t.length;a++){let c=t[a];c.match(o)[0].length>=s&&(c=c.slice(s)),i+=`${c}
`}return i}function um(e){this._scene=e,this._voxelPrimitive=void 0,this._customShaderCompilationRemoveCallback=void 0,this._definedProperties=[],this._getPrimitiveFunctions=[],this._modelMatrixReady=!1;let t=this;function n(o){let{name:r,initialValue:s}=o;t._definedProperties.push(r);let a=o.setPrimitiveFunction;a===!0&&(a=function(u){t._voxelPrimitive[r]=u});let c=o.getPrimitiveFunction;c===!0&&(c=function(){t[r]=t._voxelPrimitive[r]}),l(c)&&t._getPrimitiveFunctions.push(c);let d=Ce.observable();return Ce.defineProperty(t,r,{get:function(){return d()},set:function(u){typeof s=="number"&&typeof u=="string"&&(u=Number(u),isNaN(u)&&(u=s)),typeof s=="boolean"&&typeof u=="number"&&(u=u===1),d(u),l(a)&&l(t._voxelPrimitive)&&(a(u),e.requestRender())}}),t[r]=s,d}function i(o,r){return function(s){let a=t._voxelPrimitive[o].clone();a[r]=s,t._voxelPrimitive[o]=a}}n({name:"inspectorVisible",initialValue:!0}),n({name:"displayVisible",initialValue:!1}),n({name:"transformVisible",initialValue:!1}),n({name:"boundsVisible",initialValue:!1}),n({name:"clippingVisible",initialValue:!1}),n({name:"shaderVisible",initialValue:!1}),n({name:"shaderString",initialValue:"",getPrimitiveFunction:function(){let o=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=XTe(o)}}),n({name:"shaderCompilationMessage",initialValue:""}),n({name:"shaderCompilationSuccess",initialValue:!0}),n({name:"depthTest",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"show",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"disableUpdate",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"debugDraw",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"jitter",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"nearestSampling",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"screenSpaceError",initialValue:4,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"stepSize",initialValue:1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"shapeIsBox",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsBox=o===Ui.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsEllipsoid=o===Ui.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsCylinder=o===Ui.CYLINDER}}),n({name:"boundsBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsBoxMaxX=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsBoxMinX",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsBoxMinX=t._voxelPrimitive.minBounds.x}}),n({name:"boundsBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsBoxMaxY=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsBoxMinY",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsBoxMinY=t._voxelPrimitive.minBounds.y}}),n({name:"boundsBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsBoxMaxZ=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsBoxMinZ",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsBoxMinZ=t._voxelPrimitive.minBounds.z}}),n({name:"boundsEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxLongitude=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsEllipsoidMinLongitude=t._voxelPrimitive.minBounds.x}}),n({name:"boundsEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxLatitude=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsEllipsoidMinLatitude=t._voxelPrimitive.minBounds.y}}),n({name:"boundsEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxHeight=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsEllipsoidMinHeight=t._voxelPrimitive.minBounds.z}}),n({name:"boundsCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsCylinderMaxRadius=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsCylinderMinRadius=t._voxelPrimitive.minBounds.x}}),n({name:"boundsCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsCylinderMaxHeight=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsCylinderMinHeight=t._voxelPrimitive.minBounds.y}}),n({name:"boundsCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsCylinderMaxAngle=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsCylinderMinAngle=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMaxX=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingBoxMinX",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMinX=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMaxY=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingBoxMinY",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMinY=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMaxZ=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingBoxMinZ",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMinZ=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitude=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitude=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitude=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitude=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMaxRadius=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMinRadius=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMaxHeight=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMinHeight=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMaxAngle=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMinAngle=t._voxelPrimitive.minClippingBounds.z}}),n({name:"translationX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&ep(t)},getPrimitiveFunction:function(){t.translationX=A.getTranslation(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&ep(t)},getPrimitiveFunction:function(){t.translationY=A.getTranslation(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&ep(t)},getPrimitiveFunction:function(){t.translationZ=A.getTranslation(t._voxelPrimitive.modelMatrix,new h).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&ep(t)},getPrimitiveFunction:function(){t.scaleX=A.getScale(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&ep(t)},getPrimitiveFunction:function(){t.scaleY=A.getScale(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&ep(t)},getPrimitiveFunction:function(){t.scaleZ=A.getScale(t._voxelPrimitive.modelMatrix,new h).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&ep(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&ep(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&ep(t)}})}var C_t=new h,V_t=new h,L_t=new za,R_t=new q;function ep(e){let t=h.fromElements(e.translationX,e.translationY,e.translationZ,C_t),n=h.fromElements(e.scaleX,e.scaleY,e.scaleZ,V_t),i=L_t;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let o=q.fromHeadingPitchRoll(i,R_t),r=q.multiplyByScale(o,n,o);e._voxelPrimitive.modelMatrix=A.fromRotationTranslation(r,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(um.prototype,{scene:{get:function(){return this._scene}},voxelPrimitive:{get:function(){return this._voxelPrimitive},set:function(e){if(l(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),l(e)){this._voxelPrimitive=e;let t=this;t._customShaderCompilationRemoveCallback=t._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(n){let i=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=XTe(i),l(n)?(t.shaderCompilationMessage=n.message,t.shaderCompilationSuccess=!1):(t.shaderCompilationMessage="Shader compiled successfully!",t.shaderCompilationSuccess=!0)}),t._modelMatrixReady=!1;for(let n=0;n<t._getPrimitiveFunctions.length;n++)t._getPrimitiveFunctions[n]();t._modelMatrixReady=!0,ep(t)}}}});um.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};um.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};um.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};um.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};um.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};um.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};um.prototype.compileShader=function(){l(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new sS({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};um.prototype.shaderEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(`
`),c=a.length,d;if(t.shiftKey)for(d=0;d<c;++d)a[d][0]===" "&&(a[d][1]===" "?(a[d]=a[d].substr(2),r-=2):(a[d]=a[d].substr(1),r-=1));else for(d=0;d<c;++d)a[d]=` ${a[d]}`,r+=2;let u=a.join(`
`);n.value=n.value.slice(0,i)+u+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileShader();return!0};um.prototype.isDestroyed=function(){return!1};um.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){Ce.getObservable(e,t).dispose()}),ue(this)};var kA=um;function FB(e,t){e=Wn(e);let n=document.createElement("div"),i=new kA(t);this._viewModel=i,this._container=e,this._element=n;let o=document.createElement("div");o.textContent="Voxel Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleInspector"),n.appendChild(o),n.className="cesium-cesiumInspector cesium-VoxelInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let r=document.createElement("div");r.className="cesium-cesiumInspector-dropDown",n.appendChild(r);let s=Na.createSection,a=Na.createCheckbox,c=Na.createRangeInput,d=Na.createButton,u=s(r,"Display","displayVisible","toggleDisplay"),m=s(r,"Transform","transformVisible","toggleTransform"),p=s(r,"Bounds","boundsVisible","toggleBounds"),y=s(r,"Clipping","clippingVisible","toggleClipping"),f=s(r,"Shader","shaderVisible","toggleShader");u.appendChild(a("Depth Test","depthTest")),u.appendChild(a("Show","show")),u.appendChild(a("Disable Update","disableUpdate")),u.appendChild(a("Debug Draw","debugDraw")),u.appendChild(a("Jitter","jitter")),u.appendChild(a("Nearest Sampling","nearestSampling")),u.appendChild(c("Screen Space Error","screenSpaceError",0,128)),u.appendChild(c("Step Size","stepSize",0,2));let x=10,_=10,C=W.PI;m.appendChild(c("Translation X","translationX",-x,+x)),m.appendChild(c("Translation Y","translationY",-x,+x)),m.appendChild(c("Translation Z","translationZ",-x,+x)),m.appendChild(c("Scale X","scaleX",0,+_)),m.appendChild(c("Scale Y","scaleY",0,+_)),m.appendChild(c("Scale Z","scaleZ",0,+_)),m.appendChild(c("Heading","angleX",-C,+C)),m.appendChild(c("Pitch","angleY",-C,+C)),m.appendChild(c("Roll","angleZ",-C,+C));let V=Ui.getMinBounds(Ui.BOX),L=Ui.getMaxBounds(Ui.BOX),Z=h.fromElements(Ui.getMinBounds(Ui.ELLIPSOID).x,Ui.getMinBounds(Ui.ELLIPSOID).y,-oe.WGS84.maximumRadius,new h),G=h.fromElements(Ui.getMaxBounds(Ui.ELLIPSOID).x,Ui.getMaxBounds(Ui.ELLIPSOID).y,1e7,new h),I=Ui.getMinBounds(Ui.CYLINDER),P=Ui.getMaxBounds(Ui.CYLINDER);yL("Max X","Min X","Max Y","Min Y","Max Z","Min Z","boundsBoxMaxX","boundsBoxMinX","boundsBoxMaxY","boundsBoxMinY","boundsBoxMaxZ","boundsBoxMinZ",V,L,"shapeIsBox",p),yL("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","boundsEllipsoidMaxLongitude","boundsEllipsoidMinLongitude","boundsEllipsoidMaxLatitude","boundsEllipsoidMinLatitude","boundsEllipsoidMaxHeight","boundsEllipsoidMinHeight",Z,G,"shapeIsEllipsoid",p),yL("Max Radius","Min Radius","Max Height","Min Height","Max Angle","Min Angle","boundsCylinderMaxRadius","boundsCylinderMinRadius","boundsCylinderMaxHeight","boundsCylinderMinHeight","boundsCylinderMaxAngle","boundsCylinderMinAngle",I,P,"shapeIsCylinder",p),yL("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ",V,L,"shapeIsBox",y),yL("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight",Z,G,"shapeIsEllipsoid",y),yL("Max Radius","Min Radius","Max Height","Min Height","Max Angle","Min Angle","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxHeight","clippingCylinderMinHeight","clippingCylinderMaxAngle","clippingCylinderMinAngle",I,P,"shapeIsCylinder",y);let v=document.createElement("div");f.appendChild(v);let F=document.createElement("textarea");F.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),v.className="cesium-cesiumInspector-styleEditor",v.appendChild(F);let M=d("Compile (Ctrl+Enter)","compileShader");v.appendChild(M);let b=document.createElement("label");b.style.display="block",b.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),v.appendChild(b),Ce.applyBindings(i,n)}Object.defineProperties(FB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});FB.prototype.isDestroyed=function(){return!1};FB.prototype.destroy=function(){return Ce.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};function yL(e,t,n,i,o,r,s,a,c,d,u,m,p,y,f,x){let _=Na.createRangeInput,C=p,V=y,L=x.appendChild(document.createElement("div"));L.setAttribute("data-bind",`if: ${f}`),L.appendChild(_(e,s,C.x,V.x)),L.appendChild(_(t,a,C.x,V.x)),L.appendChild(_(n,c,C.y,V.y)),L.appendChild(_(i,d,C.y,V.y)),L.appendChild(_(o,u,C.z,V.z)),L.appendChild(_(r,m,C.z,V.z))}var DA=FB;var dTo=T(S(),1);var D_o=T(S(),1);var w_o=T(S(),1);var FTe=T(wTe(),1);function E_t(e){let t=!1,n=window.screen;return l(n)&&(l(n.lockOrientation)?t=n.lockOrientation(e):l(n.mozLockOrientation)?t=n.mozLockOrientation(e):l(n.msLockOrientation)?t=n.msLockOrientation(e):l(n.orientation&&n.orientation.lock)&&(t=n.orientation.lock(e))),t}function ATe(){let e=window.screen;l(e)&&(l(e.unlockOrientation)?e.unlockOrientation():l(e.mozUnlockOrientation)?e.mozUnlockOrientation():l(e.msUnlockOrientation)?e.msUnlockOrientation():l(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function I_t(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(ATe(),e._locked=!1),e._noSleep.disable(),pr.exitFullscreen(),n(!1)):(pr.fullscreen||pr.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=E_t("landscape")),t.useWebVR=!0,n(!0)))}function AB(e,t){let n=this,i=Ce.observable(pr.enabled),o=Ce.observable(!1);this.isVRMode=void 0,Ce.defineProperty(this,"isVRMode",{get:function(){return o()}}),this.isVREnabled=void 0,Ce.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(s){i(s&&pr.enabled)}}),this.tooltip=void 0,Ce.defineProperty(this,"tooltip",function(){return i()?o()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let r=Ce.observable(!1);this._isOrthographic=void 0,Ce.defineProperty(this,"_isOrthographic",{get:function(){return r()}}),this._eventHelper=new Er,this._eventHelper.add(e.preRender,function(){r(e.camera.frustum instanceof rn)}),this._locked=!1,this._noSleep=new FTe.default,this._command=Rn(function(){I_t(n,e,o,r)},Ce.getObservable(this,"isVREnabled")),this._vrElement=g(Wn(t),document.body),this._callback=function(){!pr.fullscreen&&o()&&(e.useWebVR=!1,n._locked&&(ATe(),n._locked=!1),n._noSleep.disable(),o(!1))},document.addEventListener(pr.changeEventName,this._callback)}Object.defineProperties(AB.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});AB.prototype.isDestroyed=function(){return!1};AB.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(pr.changeEventName,this._callback),ue(this)};var BA=AB;var X_t="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",W_t="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";function MB(e,t,n){e=Wn(e);let i=new BA(t,n);i._exitVRPath=W_t,i._enterVRPath=X_t;let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-vrButton",o.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(o),Ce.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(MB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});MB.prototype.isDestroyed=function(){return!1};MB.prototype.destroy=function(){return this._viewModel.destroy(),Ce.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var OA=MB;var Xg=new ce;function UTe(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function P_t(e){let t=e.getPropertyIds(),n="";return t.forEach(function(i){let o=e.getProperty(i);l(o)&&(n+=`<tr><th>${i}</th><td>${o}</td></tr>`)}),n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function v_t(e){let t,n=[],i=e.getPropertyIds();for(t=0;t<i.length;t++){let r=i[t];/^name$/i.test(r)?n[0]=e.getProperty(r):/name/i.test(r)?n[1]=e.getProperty(r):/^title$/i.test(r)?n[2]=e.getProperty(r):/^(id|identifier)$/i.test(r)?n[3]=e.getProperty(r):/element/i.test(r)?n[4]=e.getProperty(r):/(id|identifier)$/i.test(r)&&(n[5]=e.getProperty(r))}let o=n.length;for(t=0;t<o;t++){let r=n[t];if(l(r)&&r!=="")return r}return"Unnamed Feature"}function MTe(e,t){let n=e.scene.pick(t.position);if(l(n)){let i=g(n.id,n.primitive.id);if(i instanceof Jo)return i;if(n instanceof vs)return new Jo({name:v_t(n),description:P_t(n),feature:n})}if(l(e.scene.globe))return A_t(e,t.position)}var w_t=new te;function kTe(e,t,n){if(l(n)){let i=n.clock;if(l(i)&&(i.getValue(t),l(e))){let o=i.startTime,r=i.stopTime;te.equals(o,r)&&(r=te.addSeconds(o,W.EPSILON2,w_t)),e.updateFromClock(),e.zoomTo(o,r)}}}var F_t=new h;function A_t(e,t){let n=e.scene,i=n.camera.getPickRay(t),o=n.imageryLayers.pickImageryLayerFeatures(i,n);if(!l(o))return;let r=new Jo({id:"Loading...",description:"Loading feature information..."});return o.then(function(s){if(e.selectedEntity!==r)return;if(!l(s)||s.length===0){e.selectedEntity=NTe();return}let a=s[0],c=new Jo({id:a.name,description:a.description});if(l(a.position)){let d=e.scene.globe.ellipsoid.cartographicToCartesian(a.position,F_t);c.position=new wc(d)}e.selectedEntity=c},function(){e.selectedEntity===r&&(e.selectedEntity=NTe())}),r}function NTe(){return new Jo({id:"None",description:"No features found."})}function M_t(e,t){let n=e._geocoder,i=e._homeButton,o=e._sceneModePicker,r=e._projectionPicker,s=e._baseLayerPicker,a=e._animation,c=e._timeline,d=e._fullscreenButton,u=e._infoBox,m=e._selectionIndicator,p=t?"hidden":"visible";if(l(n)&&(n.container.style.visibility=p),l(i)&&(i.container.style.visibility=p),l(o)&&(o.container.style.visibility=p),l(r)&&(r.container.style.visibility=p),l(s)&&(s.container.style.visibility=p),l(a)&&(a.container.style.visibility=p),l(c)&&(c.container.style.visibility=p),l(d)&&d.viewModel.isFullscreenEnabled&&(d.container.style.visibility=p),l(u)&&(u.container.style.visibility=p),l(m)&&(m.container.style.visibility=p),e._container){let y=t||!l(d)?0:d.container.clientWidth;e._vrButton.container.style.right=`${y}px`,e.forceResize()}}function wi(e,t){e=Wn(e),t=g(t,g.EMPTY_OBJECT);let n=(!l(t.globe)||t.globe!==!1)&&(!l(t.baseLayerPicker)||t.baseLayerPicker!==!1),i=this,o=document.createElement("div");o.className="cesium-viewer",e.appendChild(o);let r=document.createElement("div");r.className="cesium-viewer-cesiumWidgetContainer",o.appendChild(r);let s=document.createElement("div");s.className="cesium-viewer-bottom",o.appendChild(s);let a=g(t.scene3DOnly,!1),c,d,u=!1;l(t.clockViewModel)?(d=t.clockViewModel,c=d.clock):(c=new eh,d=new nA(c),u=!0),l(t.shouldAnimate)&&(c.shouldAnimate=t.shouldAnimate);let m=new JF(r,{baseLayer:n||l(t.baseLayer)||l(t.imageryProvider)?!1:void 0,clock:c,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,useBrowserRecommendedResolution:t.useBrowserRecommendedResolution,creditContainer:l(t.creditContainer)?t.creditContainer:s,creditViewport:t.creditViewport,scene3DOnly:a,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D,blurActiveElementOnCanvasFocus:t.blurActiveElementOnCanvasFocus,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples}),p=t.dataSources,y=!1;l(p)||(p=new Q2,y=!0);let f=m.scene,x=new wP({scene:f,dataSourceCollection:p}),_=new Er;_.add(c.onTick,wi.prototype._onTick,this),_.add(f.morphStart,wi.prototype._clearTrackedObject,this);let C;if(!l(t.selectionIndicator)||t.selectionIndicator!==!1){let K=document.createElement("div");K.className="cesium-viewer-selectionIndicatorContainer",o.appendChild(K),C=new AA(K,f)}let V;if(!l(t.infoBox)||t.infoBox!==!1){let K=document.createElement("div");K.className="cesium-viewer-infoBoxContainer",o.appendChild(K),V=new RA(K);let ee=V.viewModel;_.add(ee.cameraClicked,wi.prototype._onInfoBoxCameraClicked,this),_.add(ee.closeClicked,wi.prototype._onInfoBoxClockClicked,this)}let L=document.createElement("div");L.className="cesium-viewer-toolbar",o.appendChild(L);let Z;if(!l(t.geocoder)||t.geocoder!==!1){let K=document.createElement("div");K.className="cesium-viewer-geocoderContainer",L.appendChild(K);let ee;l(t.geocoder)&&typeof t.geocoder!="boolean"&&(ee=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),Z=new SA({container:K,geocoderServices:ee,scene:f}),_.add(Z.viewModel.search.beforeExecute,wi.prototype._clearObjects,this)}let G;(!l(t.homeButton)||t.homeButton!==!1)&&(G=new VA(L,f),l(Z)&&_.add(G.viewModel.command.afterExecute,function(){let K=Z.viewModel;K.searchText="",K.isSearchInProgress&&K.search()}),_.add(G.viewModel.command.beforeExecute,wi.prototype._clearTrackedObject,this));let I;!a&&(!l(t.sceneModePicker)||t.sceneModePicker!==!1)&&(I=new vA(L,f));let P;t.projectionPicker&&(P=new WA(L,f));let v,F;if(n){let K=g(t.imageryProviderViewModels,fA()),ee=g(t.terrainProviderViewModels,pA());v=new hA(L,{globe:f.globe,imageryProviderViewModels:K,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:ee,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),F=L.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}l(t.baseLayer)&&t.baseLayer!==!1&&(n&&(v.viewModel.selectedImagery=void 0),f.imageryLayers.removeAll(),f.imageryLayers.add(t.baseLayer)),l(t.terrainProvider)&&(n&&(v.viewModel.selectedTerrain=void 0),f.terrainProvider=t.terrainProvider),l(t.terrain)&&(n&&(v.viewModel.selectedTerrain=void 0,f.globe.depthTestAgainstTerrain=!0),f.setTerrain(t.terrain));let M;if(!l(t.navigationHelpButton)||t.navigationHelpButton!==!1){let K=!0;try{if(l(window.localStorage)){let ee=window.localStorage.getItem("cesium-hasSeenNavHelp");l(ee)&&ee?K=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}M=new GA({container:L,instructionsInitiallyVisible:g(t.navigationInstructionsInitiallyVisible,K)})}let b;if(!l(t.animation)||t.animation!==!1){let K=document.createElement("div");K.className="cesium-viewer-animationContainer",o.appendChild(K),b=new sA(K,new aA(d))}let R;if(!l(t.timeline)||t.timeline!==!1){let K=document.createElement("div");K.className="cesium-viewer-timelineContainer",o.appendChild(K),R=new UA(K,c),R.addEventListener("settime",UTe,!1),R.zoomTo(c.startTime,c.stopTime)}let E,X,w;(!l(t.fullscreenButton)||t.fullscreenButton!==!1)&&(w=document.createElement("div"),w.className="cesium-viewer-fullscreenContainer",o.appendChild(w),E=new _A(w,t.fullscreenElement),X=ba(E.viewModel,"isFullscreenEnabled",function(K){w.style.display=K?"block":"none",l(R)&&(R.container.style.right=`${w.clientWidth}px`,R.resize())}));let N,D,k;if(t.vrButton){let K=document.createElement("div");K.className="cesium-viewer-vrContainer",o.appendChild(K),N=new OA(K,f,t.fullScreenElement),D=ba(N.viewModel,"isVREnabled",function(ee){K.style.display=ee?"block":"none",l(E)&&(K.style.right=`${w.clientWidth}px`),l(R)&&(R.container.style.right=`${K.clientWidth}px`,R.resize())}),k=ba(N.viewModel,"isVRMode",function(ee){M_t(i,ee)})}this._baseLayerPickerDropDown=F,this._fullscreenSubscription=X,this._vrSubscription=D,this._vrModeSubscription=k,this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=g(t.automaticallyTrackDataSourceClocks,!0),this._container=e,this._bottomContainer=s,this._element=o,this._cesiumWidget=m,this._selectionIndicator=C,this._infoBox=V,this._dataSourceCollection=p,this._destroyDataSourceCollection=y,this._dataSourceDisplay=x,this._clockViewModel=d,this._destroyClockViewModel=u,this._toolbar=L,this._homeButton=G,this._sceneModePicker=I,this._projectionPicker=P,this._baseLayerPicker=v,this._navigationHelpButton=M,this._animation=b,this._timeline=R,this._fullscreenButton=E,this._vrButton=N,this._geocoder=Z,this._eventHelper=_,this._lastWidth=0,this._lastHeight=0,this._allowDataSourcesToSuspendAnimation=!0,this._entityView=void 0,this._enableInfoOrSelection=l(V)||l(C),this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._selectedEntity=void 0,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._selectedEntityChanged=new ye,this._trackedEntityChanged=new ye,Ce.track(this,["_trackedEntity","_selectedEntity","_clockTrackedDataSource"]),_.add(p.dataSourceAdded,wi.prototype._onDataSourceAdded,this),_.add(p.dataSourceRemoved,wi.prototype._onDataSourceRemoved,this),_.add(f.postUpdate,wi.prototype.resize,this),_.add(f.postRender,wi.prototype._postRender,this);let Y=p.length;for(let K=0;K<Y;K++)this._dataSourceAdded(p,p.get(K));this._dataSourceAdded(void 0,x.defaultDataSource),_.add(p.dataSourceAdded,wi.prototype._dataSourceAdded,this),_.add(p.dataSourceRemoved,wi.prototype._dataSourceRemoved,this);function U(K){let ee=MTe(i,K);l(ee)?z.getValueOrUndefined(ee.position,i.clock.currentTime)?i.trackedEntity=ee:i.zoomTo(ee):l(i.trackedEntity)&&(i.trackedEntity=void 0)}function J(K){i.selectedEntity=MTe(i,K)}m.screenSpaceEventHandler.setInputAction(J,Vn.LEFT_CLICK),m.screenSpaceEventHandler.setInputAction(U,Vn.LEFT_DOUBLE_CLICK)}Object.defineProperties(wi.prototype,{container:{get:function(){return this._container}},creditDisplay:{get:function(){return this._cesiumWidget.creditDisplay}},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}},useBrowserRecommendedResolution:{get:function(){return this._cesiumWidget.useBrowserRecommendedResolution},set:function(e){this._cesiumWidget.useBrowserRecommendedResolution=e}},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,v7(this);let t=this.scene,n=t.mode;!l(e)||!l(e.position)?(this._needTrackedEntityUpdate=!1,(n===ie.COLUMBUS_VIEW||n===ie.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(n===ie.COLUMBUS_VIEW||n===ie.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(A.IDENTITY)):this._needTrackedEntityUpdate=!0,this._trackedEntityChanged.raiseEvent(e),this.scene.requestRender()}}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;let t=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(e)?l(t)&&t.animateAppear():l(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,kTe(this._timeline,this.clock,e))}}});wi.prototype.extend=function(e,t){e(this,t)};wi.prototype.resize=function(){let e=this._cesiumWidget,t=this._container,n=t.clientWidth,i=t.clientHeight,o=l(this._animation),r=l(this._timeline);if(e.resize(),n===this._lastWidth&&i===this._lastHeight)return;let s=i-125,a=this._baseLayerPickerDropDown;if(l(a)&&(a.style.maxHeight=`${s}px`),l(this._geocoder)){let y=this._geocoder.searchSuggestionsContainer;y.style.maxHeight=`${s}px`}l(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);let c=this._timeline,d,u=0,m=0,p=0;if(o&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let y=this._lastWidth;d=this._animation.container,n>900?(u=169,y<=900&&(d.style.width="169px",d.style.height="112px",this._animation.resize())):n>=600?(u=136,(y<600||y>900)&&(d.style.width="136px",d.style.height="90px",this._animation.resize())):(u=106,(y>600||y===0)&&(d.style.width="106px",d.style.height="70px",this._animation.resize())),m=u+5}if(r&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let y=this._fullscreenButton,f=this._vrButton,x=c.container,_=x.style;p=x.clientHeight+3,_.left=`${u}px`;let C=0;l(y)&&(C+=y.container.clientWidth),l(f)&&(C+=f.container.clientWidth),_.right=`${C}px`,c.resize()}this._bottomContainer.style.left=`${m}px`,this._bottomContainer.style.bottom=`${p}px`,this._lastWidth=n,this._lastHeight=i};wi.prototype.forceResize=function(){this._lastWidth=0,this.resize()};wi.prototype.render=function(){this._cesiumWidget.render()};wi.prototype.isDestroyed=function(){return!1};wi.prototype.destroy=function(){let e;this.screenSpaceEventHandler.removeInputAction(Vn.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(Vn.LEFT_DOUBLE_CLICK);let t=this.dataSources,n=t.length;for(e=0;e<n;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(),l(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),l(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),l(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),l(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),l(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),l(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),l(this._timeline)&&(this._timeline.removeEventListener("settime",UTe,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),l(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),l(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),l(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),l(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()),ue(this)};wi.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(wi.prototype._onEntityCollectionChanged,this)};wi.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(wi.prototype._onEntityCollectionChanged,this),l(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0),l(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};wi.prototype._onTick=function(e){let t=e.currentTime,n=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&(this._clockViewModel.canAnimate=n);let i=this._entityView;if(l(i)){let u=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(u,!1,Xg)===ut.DONE&&i.update(t,Xg)}let o,r=!1,s=this.selectedEntity,a=l(s)&&this._enableInfoOrSelection;a&&s.isShowing&&s.isAvailable(t)&&(this._dataSourceDisplay.getBoundingSphere(s,!0,Xg)!==ut.FAILED?o=Xg.center:l(s.position)&&(o=s.position.getValue(t,o)),r=l(o));let c=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(c)&&(c.position=h.clone(o,c.position),c.showSelection=a&&r,c.update());let d=l(this._infoBox)?this._infoBox.viewModel:void 0;l(d)&&(d.showInfo=a,d.enableCamera=r,d.isCameraTracking=this.trackedEntity===this.selectedEntity,a?(d.titleText=g(s.name,s.id),d.description=z.getValueOrDefault(s.description,t,"")):(d.titleText="",d.description=""))};wi.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let o=0;o<i;o++){let r=n[o];this.trackedEntity===r&&(this.trackedEntity=void 0),this.selectedEntity===r&&(this.selectedEntity=void 0)}};wi.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{let n=this.selectedEntity.position;l(n)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}};wi.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};wi.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};wi.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};wi.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&kTe(this.timeline,this.clock,e)};wi.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,wi.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};wi.prototype._onDataSourceRemoved=function(e,t){let n=this.clockTrackedDataSource===t,i=t.entities.id;if(this._dataSourceChangedListeners[i](),this._dataSourceChangedListeners[i]=void 0,n){let o=e.length;this._automaticallyTrackDataSourceClocks&&o>0?this.clockTrackedDataSource=e.get(o-1):this.clockTrackedDataSource=void 0}};wi.prototype.zoomTo=function(e,t){return DTe(this,e,{offset:t},!1)};wi.prototype.flyTo=function(e,t){return DTe(this,e,t,!0)};function DTe(e,t,n,i){v7(e);let o=new Promise(r=>{e._completeZoom=function(s){r(s)}});return e._zoomPromise=o,e._zoomIsFlight=i,e._zoomOptions=n,Promise.resolve(t).then(function(r){if(e._zoomPromise===o){if(r instanceof ua){let s;l(r.imageryProvider)?s=Promise.resolve(r.getImageryRectangle()):s=new Promise(a=>{let c=r.readyEvent.addEventListener(()=>{c(),a(r.getImageryRectangle())})}),s.then(function(a){return jT(a,e.scene)}).then(function(a){e._zoomPromise===o&&(e._zoomTarget=a)});return}if(r instanceof oa||r instanceof dL||r instanceof fL){e._zoomTarget=r;return}if(r.isLoading&&l(r.loadingEvent)){let s=r.loadingEvent.addEventListener(function(){s(),e._zoomPromise===o&&(e._zoomTarget=r.entities.values.slice(0))});return}if(Array.isArray(r)){e._zoomTarget=r.slice(0);return}r=g(r.values,r),l(r.entities)&&(r=r.entities.values),Array.isArray(r)?e._zoomTarget=r.slice(0):e._zoomTarget=[r]}}),e.scene.requestRender(),o}function YA(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function v7(e){let t=e._zoomPromise;l(t)&&(YA(e),e._completeZoom(!1))}wi.prototype._postRender=function(){N_t(this),U_t(this)};function N_t(e){let t=e._zoomTarget;if(!l(t)||e.scene.mode===ie.MORPHING)return;let n=e.scene,i=n.camera,o=g(e._zoomOptions,{}),r;function s(u){l(o.offset)||(o.offset=new Ou(0,-.5,u.radius)),r={offset:o.offset,duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(t.boundingSphere,r):(i.viewBoundingSphere(u,o.offset),i.lookAtTransform(A.IDENTITY),e._completeZoom(!0)),YA(e)}if(t instanceof dL){if(l(t.boundingSphere)){s(t.boundingSphere);return}let u=t.frameChanged.addEventListener(function(m){s(m.boundingSphere),u()});return}if(t instanceof oa||t instanceof fL){s(t.boundingSphere);return}if(t instanceof he){r={destination:n.mapProjection.ellipsoid.cartographicToCartesian(t),duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyTo(r):(i.setView(r),e._completeZoom(!0)),YA(e);return}let a=t,c=[];for(let u=0,m=a.length;u<m;u++){let p=e._dataSourceDisplay.getBoundingSphere(a[u],!1,Xg);if(p===ut.PENDING)return;p!==ut.FAILED&&c.push(ce.clone(Xg))}if(c.length===0){v7(e);return}e.trackedEntity=void 0;let d=ce.fromBoundingSpheres(c);e._zoomIsFlight?(YA(e),i.flyToBoundingSphere(d,{duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:o.offset})):(i.viewBoundingSphere(d,o.offset),i.lookAtTransform(A.IDENTITY),YA(e),e._completeZoom(!0))}function U_t(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=z.getValueOrUndefined(t.position,n);if(!l(i))return;let o=e.scene,r=e._dataSourceDisplay.getBoundingSphere(t,!1,Xg);if(r===ut.PENDING)return;let s=o.mode;(s===ie.COLUMBUS_VIEW||s===ie.SCENE2D)&&(o.screenSpaceCameraController.enableTranslate=!1),(s===ie.COLUMBUS_VIEW||s===ie.SCENE3D)&&(o.screenSpaceCameraController.enableTilt=!1);let a=r!==ut.FAILED?Xg:void 0;e._entityView=new AP(t,o,o.mapProjection.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var w7=wi;var hTo=T(S(),1);function k_t(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new uA(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var F7=k_t;var bTo=T(S(),1);function D_t(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new gA(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var A7=D_t;var _To=T(S(),1);function B_t(e,t){t=g(t,g.EMPTY_OBJECT);let n=!0,i=g(t.flyToOnDrop,!0),o=new ye,r=g(t.clearOnDrop,!0),s=g(t.dropTarget,e.container),a=g(t.clampToGround,!0),c=t.proxy;s=Wn(s),Object.defineProperties(e,{dropTarget:{get:function(){return s},set:function(u){BTe(s,d),s=u,M7(s,d)}},dropEnabled:{get:function(){return n},set:function(u){u!==n&&(u?M7(s,d):BTe(s,d),n=u)}},dropError:{get:function(){return o}},clearOnDrop:{get:function(){return r},set:function(u){r=u}},flyToOnDrop:{get:function(){return i},set:function(u){i=u}},proxy:{get:function(){return c},set:function(u){c=u}},clampToGround:{get:function(){return a},set:function(u){a=u}}});function d(u){mS(u),r&&(e.entities.removeAll(),e.dataSources.removeAll());let m=u.dataTransfer.files,p=m.length;for(let y=0;y<p;y++){let f=m[y],x=new FileReader;x.onload=O_t(e,f,c,a),x.onerror=Y_t(e,f),x.readAsText(f)}}M7(s,d),e.destroy=c9(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=d}function mS(e){e.stopPropagation(),e.preventDefault()}function BTe(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",mS,!1),n.removeEventListener("dragover",mS,!1),n.removeEventListener("dragexit",mS,!1))}function M7(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",mS,!1),e.addEventListener("dragover",mS,!1),e.addEventListener("dragexit",mS,!1)}function O_t(e,t,n,i){let o=e.scene;return function(r){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=J2.load(JSON.parse(r.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=iv.load(JSON.parse(r.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=bv.load(t,{sourceUri:s,proxy:n,camera:o.camera,canvas:o.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=av.load(t,{sourceUri:s,proxy:n});else{e.dropError.raiseEvent(e,s,`Unrecognized file: ${s}`);return}l(a)&&e.dataSources.add(a).then(function(c){e.flyToOnDrop&&e.flyTo(c)}).catch(function(c){e.dropError.raiseEvent(e,s,c)})}catch(a){e.dropError.raiseEvent(e,s,a)}}}function Y_t(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var N7=B_t;var RTo=T(S(),1);function H_t(e,t){t=g(t,g.EMPTY_OBJECT);let n=new IA({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var U7=H_t;var ETo=T(S(),1);function K_t(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new DA(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var k7=K_t;globalThis.CESIUM_VERSION="1.114";var z_t="1.114";return oSe(J_t);})();