/**
 * @license
 * Cesium - https://github.com/CesiumGS/cesium
 * Version 1.121.1
 *
 * 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 cCe=Object.create;var SM=Object.defineProperty;var lCe=Object.getOwnPropertyDescriptor;var dCe=Object.getOwnPropertyNames;var uCe=Object.getPrototypeOf,mCe=Object.prototype.hasOwnProperty;var CM=(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 ed=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),hCe=(e,t)=>{for(var n in t)SM(e,n,{get:t[n],enumerable:!0})},iq=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of dCe(t))!mCe.call(e,o)&&o!==n&&SM(e,o,{get:()=>t[o],enumerable:!(i=lCe(t,o))||i.enumerable});return e};var T=(e,t,n)=>(n=e!=null?cCe(uCe(e)):{},iq(t||!e||!e.__esModule?SM(n,"default",{value:e,enumerable:!0}):n,e)),fCe=e=>iq(SM({},"__esModule",{value:!0}),e);var S=ed(()=>{globalThis.CESIUM_WORKERS=atob(" ")});var VM=ed((ACt,rq)=>{var MCt=T(S()),rp=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)};rp.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}};rp.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};rp.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};rp.prototype.random_int31=function(){return this.random_int()>>>1};rp.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};rp.prototype.random=function(){return this.random_int()*(1/4294967296)};rp.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};rp.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};rq.exports=rp});var Xq=ed((XS,IS)=>{var CLt=T(S());/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof XS=="object"&&XS&&!XS.nodeType&&XS,n=typeof IS=="object"&&IS&&!IS.nodeType&&IS,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,g="-",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,E;function X(U){throw new RangeError(C[U])}function v(U,O){for(var k=U.length,J=[];k--;)J[k]=O(U[k]);return J}function P(U,O){var k=U.split("@"),J="";k.length>1&&(J=k[0]+"@",U=k[1]),U=U.replace(_,".");var H=U.split("."),te=v(H,O).join(".");return J+te}function A(U){for(var O=[],k=0,J=U.length,H,te;k<J;)H=U.charCodeAt(k++),H>=55296&&H<=56319&&k<J?(te=U.charCodeAt(k++),(te&64512)==56320?O.push(((H&1023)<<10)+(te&1023)+65536):(O.push(H),k--)):O.push(H);return O}function M(U){return v(U,function(O){var k="";return O>65535&&(O-=65536,k+=Z(O>>>10&1023|55296),O=56320|O&1023),k+=Z(O),k}).join("")}function b(U){return U-48<10?U-22:U-65<26?U-65:U-97<26?U-97:s}function R(U,O){return U+22+75*(U<26)-((O!=0)<<5)}function G(U,O,k){var J=0;for(U=k?L(U/u):U>>1,U+=L(U/O);U>V*c>>1;J+=s)U=L(U/V);return L(J+(V+1)*U/(U+d))}function I(U){var O=[],k=U.length,J,H=0,te=p,z=m,j,ee,fe,_e,le,ge,Se,Ie,Le;for(j=U.lastIndexOf(g),j<0&&(j=0),ee=0;ee<j;++ee)U.charCodeAt(ee)>=128&&X("not-basic"),O.push(U.charCodeAt(ee));for(fe=j>0?j+1:0;fe<k;){for(_e=H,le=1,ge=s;fe>=k&&X("invalid-input"),Se=b(U.charCodeAt(fe++)),(Se>=s||Se>L((r-H)/le))&&X("overflow"),H+=Se*le,Ie=ge<=z?a:ge>=z+c?c:ge-z,!(Se<Ie);ge+=s)Le=s-Ie,le>L(r/Le)&&X("overflow"),le*=Le;J=O.length+1,z=G(H-_e,J,_e==0),L(H/J)>r-te&&X("overflow"),te+=L(H/J),H%=J,O.splice(H++,0,te)}return M(O)}function w(U){var O,k,J,H,te,z,j,ee,fe,_e,le,ge=[],Se,Ie,Le,ke;for(U=A(U),Se=U.length,O=p,k=0,te=m,z=0;z<Se;++z)le=U[z],le<128&&ge.push(Z(le));for(J=H=ge.length,H&&ge.push(g);J<Se;){for(j=r,z=0;z<Se;++z)le=U[z],le>=O&&le<j&&(j=le);for(Ie=J+1,j-O>L((r-k)/Ie)&&X("overflow"),k+=(j-O)*Ie,O=j,z=0;z<Se;++z)if(le=U[z],le<O&&++k>r&&X("overflow"),le==O){for(ee=k,fe=s;_e=fe<=te?a:fe>=te+c?c:fe-te,!(ee<_e);fe+=s)ke=ee-_e,Le=s-_e,ge.push(Z(R(_e+ke%Le,0))),ee=L(ke/Le);ge.push(Z(R(ee,0))),te=G(k,Ie,J==H),k=0,++J}++k,++O}return ge.join("")}function N(U){return P(U,function(O){return f.test(O)?I(O.slice(4).toLowerCase()):O})}function B(U){return P(U,function(O){return x.test(O)?"xn--"+w(O):O})}if(o={version:"1.3.2",ucs2:{decode:A,encode:M},decode:I,encode:w,toASCII:B,toUnicode:N},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return o});else if(t&&n)if(IS.exports==t)n.exports=o;else for(E in o)o.hasOwnProperty(E)&&(t[E]=o[E]);else e.punycode=o})(XS)});var Wq=ed((Iq,YM)=>{var VLt=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 YM=="object"&&YM.exports?YM.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(Iq,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 g=-1,f=0,x=0,_=-1,C=!1;for(m=0;m<c;m++)C?s[m]==="0"?x+=1:(C=!1,x>f&&(g=_,f=x)):s[m]==="0"&&(C=!0,_=m,x=1);x>f&&(g=_,f=x),f>1&&s.splice(g,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 vq=ed((Pq,OM)=>{var LLt=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 OM=="object"&&OM.exports?OM.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(Pq,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 td=ed((wq,HM)=>{var RLt=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 HM=="object"&&HM.exports?HM.exports=t(Xq(),Wq(),vq()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(wq,function(e,t,n,i){"use strict";var o=i&&i.URI;function r(R,G){var I=arguments.length>=1,w=arguments.length>=2;if(!(this instanceof r))return I?w?new r(R,G):new r(R):new r;if(R===void 0){if(I)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?R=location.href+"":R=""}if(R===null&&I)throw new TypeError("null is not a valid argument for URI");return this.href(R),G!==void 0?this.absoluteTo(G):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,G){var I={},w,N;if(u(G)==="RegExp")I=null;else if(m(G))for(w=0,N=G.length;w<N;w++)I[G[w]]=!0;else I[G]=!0;for(w=0,N=R.length;w<N;w++){var B=I&&I[R[w]]!==void 0||!I&&G.test(R[w]);B&&(R.splice(w,1),N--,w--)}return R}function g(R,G){var I,w;if(m(G)){for(I=0,w=G.length;I<w;I++)if(!g(R,G[I]))return!1;return!0}var N=u(G);for(I=0,w=R.length;I<w;I++)if(N==="RegExp"){if(typeof R[I]=="string"&&R[I].match(G))return!0}else if(R[I]===G)return!0;return!1}function f(R,G){if(!m(R)||!m(G)||R.length!==G.length)return!1;R.sort(),G.sort();for(var I=0,w=R.length;I<w;I++)if(R[I]!==G[I])return!1;return!0}function x(R){var G=/^\/+|\/+$/g;return R.replace(G,"")}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\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[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\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,r.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\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 G=R.nodeName.toLowerCase();if(!(G==="input"&&R.type!=="image"))return r.domAttributes[G]}};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,G){var I=r.encode(R+"");return G===void 0&&(G=r.escapeQuerySpace),G?I.replace(/%20/g,"+"):I},r.decodeQuery=function(R,G){R+="",G===void 0&&(G=r.escapeQuerySpace);try{return r.decode(G?R.replace(/\+/g,"%20"):R)}catch{return R}};var V={encode:"encode",decode:"decode"},L,Z=function(R,G){return function(I){try{return r[G](I+"").replace(r.characters[R][G].expression,function(w){return r.characters[R][G].map[w]})}catch{return I}}};for(L in V)r[L+"PathSegment"]=Z("pathname",V[L]),r[L+"UrnPathSegment"]=Z("urnpath",V[L]);var E=function(R,G,I){return function(w){var N;I?N=function(k){return r[G](r[I](k))}:N=r[G];for(var B=(w+"").split(R),U=0,O=B.length;U<O;U++)B[U]=N(B[U]);return B.join(R)}};r.decodePath=E("/","decodePathSegment"),r.decodeUrnPath=E(":","decodeUrnPathSegment"),r.recodePath=E("/","encodePathSegment","decode"),r.recodeUrnPath=E(":","encodeUrnPathSegment","decode"),r.encodeReserved=Z("reserved","encode"),r.parse=function(R,G){var I;return G||(G={preventInvalidHostname:r.preventInvalidHostname}),R=R.replace(r.leading_whitespace_expression,""),R=R.replace(r.ascii_tab_whitespace,""),I=R.indexOf("#"),I>-1&&(G.fragment=R.substring(I+1)||null,R=R.substring(0,I)),I=R.indexOf("?"),I>-1&&(G.query=R.substring(I+1)||null,R=R.substring(0,I)),R=R.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),R=R.replace(/^[/\\]{2,}/i,"//"),R.substring(0,2)==="//"?(G.protocol=null,R=R.substring(2),R=r.parseAuthority(R,G)):(I=R.indexOf(":"),I>-1&&(G.protocol=R.substring(0,I)||null,G.protocol&&!G.protocol.match(r.protocol_expression)?G.protocol=void 0:R.substring(I+1,I+3).replace(/\\/g,"/")==="//"?(R=R.substring(I+3),R=r.parseAuthority(R,G)):(R=R.substring(I+1),G.urn=!0))),G.path=R,G},r.parseHost=function(R,G){R||(R=""),R=R.replace(/\\/g,"/");var I=R.indexOf("/"),w,N;if(I===-1&&(I=R.length),R.charAt(0)==="[")w=R.indexOf("]"),G.hostname=R.substring(1,w)||null,G.port=R.substring(w+2,I)||null,G.port==="/"&&(G.port=null);else{var B=R.indexOf(":"),U=R.indexOf("/"),O=R.indexOf(":",B+1);O!==-1&&(U===-1||O<U)?(G.hostname=R.substring(0,I)||null,G.port=null):(N=R.substring(0,I).split(":"),G.hostname=N[0]||null,G.port=N[1]||null)}return G.hostname&&R.substring(I).charAt(0)!=="/"&&(I++,R="/"+R),G.preventInvalidHostname&&r.ensureValidHostname(G.hostname,G.protocol),G.port&&r.ensureValidPort(G.port),R.substring(I)||"/"},r.parseAuthority=function(R,G){return R=r.parseUserinfo(R,G),r.parseHost(R,G)},r.parseUserinfo=function(R,G){var I=R,w=R.indexOf("\\");w!==-1&&(R=R.replace(/\\/g,"/"));var N=R.indexOf("/"),B=R.lastIndexOf("@",N>-1?N:R.length-1),U;return B>-1&&(N===-1||B<N)?(U=R.substring(0,B).split(":"),G.username=U[0]?r.decode(U[0]):null,U.shift(),G.password=U[0]?r.decode(U.join(":")):null,R=I.substring(B+1)):(G.username=null,G.password=null),R},r.parseQuery=function(R,G){if(!R)return{};if(R=R.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!R)return{};for(var I={},w=R.split("&"),N=w.length,B,U,O,k=0;k<N;k++)B=w[k].split("="),U=r.decodeQuery(B.shift(),G),O=B.length?r.decodeQuery(B.join("="),G):null,U!=="__proto__"&&(c.call(I,U)?((typeof I[U]=="string"||I[U]===null)&&(I[U]=[I[U]]),I[U].push(O)):I[U]=O);return I},r.build=function(R){var G="",I=!1;return R.protocol&&(G+=R.protocol+":"),!R.urn&&(G||R.hostname)&&(G+="//",I=!0),G+=r.buildAuthority(R)||"",typeof R.path=="string"&&(R.path.charAt(0)!=="/"&&I&&(G+="/"),G+=R.path),typeof R.query=="string"&&R.query&&(G+="?"+R.query),typeof R.fragment=="string"&&R.fragment&&(G+="#"+R.fragment),G},r.buildHost=function(R){var G="";if(R.hostname)r.ip6_expression.test(R.hostname)?G+="["+R.hostname+"]":G+=R.hostname;else return"";return R.port&&(G+=":"+R.port),G},r.buildAuthority=function(R){return r.buildUserinfo(R)+r.buildHost(R)},r.buildUserinfo=function(R){var G="";return R.username&&(G+=r.encode(R.username)),R.password&&(G+=":"+r.encode(R.password)),G&&(G+="@"),G},r.buildQuery=function(R,G,I){var w="",N,B,U,O;for(B in R)if(B!=="__proto__"&&c.call(R,B))if(m(R[B]))for(N={},U=0,O=R[B].length;U<O;U++)R[B][U]!==void 0&&N[R[B][U]+""]===void 0&&(w+="&"+r.buildQueryParameter(B,R[B][U],I),G!==!0&&(N[R[B][U]+""]=!0));else R[B]!==void 0&&(w+="&"+r.buildQueryParameter(B,R[B],I));return w.substring(1)},r.buildQueryParameter=function(R,G,I){return r.encodeQuery(R,I)+(G!==null?"="+r.encodeQuery(G,I):"")},r.addQuery=function(R,G,I){if(typeof G=="object")for(var w in G)c.call(G,w)&&r.addQuery(R,w,G[w]);else if(typeof G=="string"){if(R[G]===void 0){R[G]=I;return}else typeof R[G]=="string"&&(R[G]=[R[G]]);m(I)||(I=[I]),R[G]=(R[G]||[]).concat(I)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(R,G,I){if(typeof G=="object")for(var w in G)c.call(G,w)&&r.setQuery(R,w,G[w]);else if(typeof G=="string")R[G]=I===void 0?null:I;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(R,G,I){var w,N,B;if(m(G))for(w=0,N=G.length;w<N;w++)R[G[w]]=void 0;else if(u(G)==="RegExp")for(B in R)G.test(B)&&(R[B]=void 0);else if(typeof G=="object")for(B in G)c.call(G,B)&&r.removeQuery(R,B,G[B]);else if(typeof G=="string")I!==void 0?u(I)==="RegExp"?!m(R[G])&&I.test(R[G])?R[G]=void 0:R[G]=p(R[G],I):R[G]===String(I)&&(!m(I)||I.length===1)?R[G]=void 0:m(R[G])&&(R[G]=p(R[G],I)):R[G]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(R,G,I,w){switch(u(G)){case"String":break;case"RegExp":for(var N in R)if(c.call(R,N)&&G.test(N)&&(I===void 0||r.hasQuery(R,N,I)))return!0;return!1;case"Object":for(var B in G)if(c.call(G,B)&&!r.hasQuery(R,B,G[B]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(u(I)){case"Undefined":return G in R;case"Boolean":var U=!!(m(R[G])?R[G].length:R[G]);return I===U;case"Function":return!!I(R[G],G,R);case"Array":if(!m(R[G]))return!1;var O=w?g:f;return O(R[G],I);case"RegExp":return m(R[G])?w?g(R[G],I):!1:!!(R[G]&&R[G].match(I));case"Number":I=String(I);case"String":return m(R[G])?w?g(R[G],I):!1:R[G]===I;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var R=[],G=[],I=0,w=0;w<arguments.length;w++){var N=new r(arguments[w]);R.push(N);for(var B=N.segment(),U=0;U<B.length;U++)typeof B[U]=="string"&&G.push(B[U]),B[U]&&I++}if(!G.length||!I)return new r("");var O=new r("").segment(G);return(R[0].path()===""||R[0].path().slice(0,1)==="/")&&O.path("/"+O.path()),O.normalize()},r.commonPath=function(R,G){var I=Math.min(R.length,G.length),w;for(w=0;w<I;w++)if(R.charAt(w)!==G.charAt(w)){w--;break}return w<1?R.charAt(0)===G.charAt(0)&&R.charAt(0)==="/"?"/":"":((R.charAt(w)!=="/"||G.charAt(w)!=="/")&&(w=R.substring(0,w).lastIndexOf("/")),R.substring(0,w+1))},r.withinString=function(R,G,I){I||(I={});var w=I.start||r.findUri.start,N=I.end||r.findUri.end,B=I.trim||r.findUri.trim,U=I.parens||r.findUri.parens,O=/[a-z0-9-]=["']?$/i;for(w.lastIndex=0;;){var k=w.exec(R);if(!k)break;var J=k.index;if(I.ignoreHtml){var H=R.slice(Math.max(J-3,0),J);if(H&&O.test(H))continue}for(var te=J+R.slice(J).search(N),z=R.slice(J,te),j=-1;;){var ee=U.exec(z);if(!ee)break;var fe=ee.index+ee[0].length;j=Math.max(j,fe)}if(j>-1?z=z.slice(0,j)+z.slice(j).replace(B,""):z=z.replace(B,""),!(z.length<=k[0].length)&&!(I.ignore&&I.ignore.test(z))){te=J+z.length;var _e=G(z,J,te,R);if(_e===void 0){w.lastIndex=te;continue}_e=String(_e),R=R.slice(0,J)+_e+R.slice(te),w.lastIndex=J+_e.length}}return w.lastIndex=0,R},r.ensureValidHostname=function(R,G){var I=!!R,w=!!G,N=!1;if(w&&(N=g(r.hostProtocols,G)),N&&!I)throw new TypeError("Hostname cannot be empty, if protocol is "+G);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 G=Number(R);if(!(s(G)&&G>0&&G<65536))throw new TypeError('Port "'+R+'" is not a valid port')}},r.noConflict=function(R){if(R){var G={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(G.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(G.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(G.SecondLevelDomains=i.SecondLevelDomains.noConflict()),G}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 X(R){return function(G,I){return G===void 0?this._parts[R]||"":(this._parts[R]=G||null,this.build(!I),this)}}function v(R,G){return function(I,w){return I===void 0?this._parts[R]||"":(I!==null&&(I=I+"",I.charAt(0)===G&&(I=I.substring(1))),this._parts[R]=I,this.build(!w),this)}}a.protocol=X("protocol"),a.username=X("username"),a.password=X("password"),a.hostname=X("hostname"),a.port=X("port"),a.query=v("query","?"),a.fragment=v("fragment","#"),a.search=function(R,G){var I=this.query(R,G);return typeof I=="string"&&I.length?"?"+I:I},a.hash=function(R,G){var I=this.fragment(R,G);return typeof I=="string"&&I.length?"#"+I:I},a.pathname=function(R,G){if(R===void 0||R===!0){var I=this._parts.path||(this._parts.hostname?"/":"");return R?(this._parts.urn?r.decodeUrnPath:r.decodePath)(I):I}else return this._parts.urn?this._parts.path=R?r.recodeUrnPath(R):"":this._parts.path=R?r.recodePath(R):"/",this.build(!G),this},a.path=a.pathname,a.href=function(R,G){var I;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 B=r.getDomAttribute(R);R=R[B]||"",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 U=w?R._parts:R;for(I in U)I!=="query"&&c.call(this._parts,I)&&(this._parts[I]=U[I]);U.query&&this.query(U.query,!1)}else throw new TypeError("invalid input");return this.build(!G),this},a.is=function(R){var G=!1,I=!1,w=!1,N=!1,B=!1,U=!1,O=!1,k=!this._parts.urn;switch(this._parts.hostname&&(k=!1,I=r.ip4_expression.test(this._parts.hostname),w=r.ip6_expression.test(this._parts.hostname),G=I||w,N=!G,B=N&&n&&n.has(this._parts.hostname),U=N&&r.idn_expression.test(this._parts.hostname),O=N&&r.punycode_expression.test(this._parts.hostname)),R.toLowerCase()){case"relative":return k;case"absolute":return!k;case"domain":case"name":return N;case"sld":return B;case"ip":return G;case"ip4":case"ipv4":case"inet4":return I;case"ip6":case"ipv6":case"inet6":return w;case"idn":return U;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return O}return null};var P=a.protocol,A=a.port,M=a.hostname;a.protocol=function(R,G){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 P.call(this,R,G)},a.scheme=a.protocol,a.port=function(R,G){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))),A.call(this,R,G))},a.hostname=function(R,G){if(this._parts.urn)return R===void 0?"":this;if(R!==void 0){var I={preventInvalidHostname:this._parts.preventInvalidHostname},w=r.parseHost(R,I);if(w!=="/")throw new TypeError('Hostname "'+R+'" contains characters other than [A-Z0-9.-]');R=I.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(R,this._parts.protocol)}return M.call(this,R,G)},a.origin=function(R,G){if(this._parts.urn)return R===void 0?"":this;if(R===void 0){var I=this.protocol(),w=this.authority();return w?(I?I+"://":"")+this.authority():""}else{var N=r(R);return this.protocol(N.protocol()).authority(N.authority()).build(!G),this}},a.host=function(R,G){if(this._parts.urn)return R===void 0?"":this;if(R===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var I=r.parseHost(R,this._parts);if(I!=="/")throw new TypeError('Hostname "'+R+'" contains characters other than [A-Z0-9.-]');return this.build(!G),this},a.authority=function(R,G){if(this._parts.urn)return R===void 0?"":this;if(R===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var I=r.parseAuthority(R,this._parts);if(I!=="/")throw new TypeError('Hostname "'+R+'" contains characters other than [A-Z0-9.-]');return this.build(!G),this},a.userinfo=function(R,G){if(this._parts.urn)return R===void 0?"":this;if(R===void 0){var I=r.buildUserinfo(this._parts);return I&&I.substring(0,I.length-1)}else return R[R.length-1]!=="@"&&(R+="@"),r.parseUserinfo(R,this._parts),this.build(!G),this},a.resource=function(R,G){var I;return R===void 0?this.path()+this.search()+this.hash():(I=r.parse(R),this._parts.path=I.path,this._parts.query=I.query,this._parts.fragment=I.fragment,this.build(!G),this)},a.subdomain=function(R,G){if(this._parts.urn)return R===void 0?"":this;if(R===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,I)||""}else{var w=this._parts.hostname.length-this.domain().length,N=this._parts.hostname.substring(0,w),B=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(B,R),this.build(!G),this}},a.domain=function(R,G){if(this._parts.urn)return R===void 0?"":this;if(typeof R=="boolean"&&(G=R,R=void 0),R===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.match(/\./g);if(I&&I.length<2)return this._parts.hostname;var w=this._parts.hostname.length-this.tld(G).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(!G),this}},a.tld=function(R,G){if(this._parts.urn)return R===void 0?"":this;if(typeof R=="boolean"&&(G=R,R=void 0),R===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.lastIndexOf("."),w=this._parts.hostname.substring(I+1);return G!==!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(!G),this}},a.directory=function(R,G){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 I=this._parts.path.length-this.filename().length-1,w=this._parts.path.substring(0,I)||(this._parts.hostname?"/":"");return R?r.decodePath(w):w}else{var N=this._parts.path.length-this.filename().length,B=this._parts.path.substring(0,N),U=new RegExp("^"+d(B));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(U,R),this.build(!G),this}},a.filename=function(R,G){if(this._parts.urn)return R===void 0?"":this;if(typeof R!="string"){if(!this._parts.path||this._parts.path==="/")return"";var I=this._parts.path.lastIndexOf("/"),w=this._parts.path.substring(I+1);return R?r.decodePathSegment(w):w}else{var N=!1;R.charAt(0)==="/"&&(R=R.substring(1)),R.match(/\.?\//)&&(N=!0);var B=new RegExp(d(this.filename())+"$");return R=r.recodePath(R),this._parts.path=this._parts.path.replace(B,R),N?this.normalizePath(G):this.build(!G),this}},a.suffix=function(R,G){if(this._parts.urn)return R===void 0?"":this;if(R===void 0||R===!0){if(!this._parts.path||this._parts.path==="/")return"";var I=this.filename(),w=I.lastIndexOf("."),N,B;return w===-1?"":(N=I.substring(w+1),B=/^[a-z0-9%]+$/i.test(N)?N:"",R?r.decodePathSegment(B):B)}else{R.charAt(0)==="."&&(R=R.substring(1));var U=this.suffix(),O;if(U)R?O=new RegExp(d(U)+"$"):O=new RegExp(d("."+U)+"$");else{if(!R)return this;this._parts.path+="."+r.recodePath(R)}return O&&(R=r.recodePath(R),this._parts.path=this._parts.path.replace(O,R)),this.build(!G),this}},a.segment=function(R,G,I){var w=this._parts.urn?":":"/",N=this.path(),B=N.substring(0,1)==="/",U=N.split(w);if(R!==void 0&&typeof R!="number"&&(I=G,G=R,R=void 0),R!==void 0&&typeof R!="number")throw new Error('Bad segment "'+R+'", must be 0-based integer');if(B&&U.shift(),R<0&&(R=Math.max(U.length+R,0)),G===void 0)return R===void 0?U:U[R];if(R===null||U[R]===void 0)if(m(G)){U=[];for(var O=0,k=G.length;O<k;O++)!G[O].length&&(!U.length||!U[U.length-1].length)||(U.length&&!U[U.length-1].length&&U.pop(),U.push(x(G[O])))}else(G||typeof G=="string")&&(G=x(G),U[U.length-1]===""?U[U.length-1]=G:U.push(G));else G?U[R]=x(G):U.splice(R,1);return B&&U.unshift(""),this.path(U.join(w),I)},a.segmentCoded=function(R,G,I){var w,N,B;if(typeof R!="number"&&(I=G,G=R,R=void 0),G===void 0){if(w=this.segment(R,G,I),!m(w))w=w!==void 0?r.decode(w):void 0;else for(N=0,B=w.length;N<B;N++)w[N]=r.decode(w[N]);return w}if(!m(G))G=typeof G=="string"||G instanceof String?r.encode(G):G;else for(N=0,B=G.length;N<B;N++)G[N]=r.encode(G[N]);return this.segment(R,G,I)};var b=a.query;return a.query=function(R,G){if(R===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof R=="function"){var I=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),w=R.call(this,I);return this._parts.query=r.buildQuery(w||I,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!G),this}else return R!==void 0&&typeof R!="string"?(this._parts.query=r.buildQuery(R,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!G),this):b.call(this,R,G)},a.setQuery=function(R,G,I){var w=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof R=="string"||R instanceof String)w[R]=G!==void 0?G: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"&&(I=G),this.build(!I),this},a.addQuery=function(R,G,I){var w=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(w,R,G===void 0?null:G),this._parts.query=r.buildQuery(w,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof R!="string"&&(I=G),this.build(!I),this},a.removeQuery=function(R,G,I){var w=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(w,R,G),this._parts.query=r.buildQuery(w,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof R!="string"&&(I=G),this.build(!I),this},a.hasQuery=function(R,G,I){var w=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(w,R,G,I)},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 G=this._parts.path;if(!G)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;G=r.recodePath(G);var I,w="",N,B;for(G.charAt(0)!=="/"&&(I=!0,G="/"+G),(G.slice(-3)==="/.."||G.slice(-2)==="/.")&&(G+="/"),G=G.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),I&&(w=G.substring(1).match(/^(\.\.\/)+/)||"",w&&(w=w[0]));N=G.search(/\/\.\.(\/|$)/),N!==-1;){if(N===0){G=G.substring(3);continue}B=G.substring(0,N).lastIndexOf("/"),B===-1&&(B=N),G=G.substring(0,B)+G.substring(N+3)}return I&&this.is("relative")&&(G=w+G.substring(1)),this._parts.path=G,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,G=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=R,r.decode=G}return this},a.unicode=function(){var R=r.encode,G=r.decode;r.encode=C,r.decode=unescape;try{this.normalize()}finally{r.encode=R,r.decode=G}return this},a.readable=function(){var R=this.clone();R.username("").password("").normalize();var G="";if(R._parts.protocol&&(G+=R._parts.protocol+"://"),R._parts.hostname&&(R.is("punycode")&&e?(G+=e.toUnicode(R._parts.hostname),R._parts.port&&(G+=":"+R._parts.port)):G+=R.host()),R._parts.hostname&&R._parts.path&&R._parts.path.charAt(0)!=="/"&&(G+="/"),G+=R.path(!0),R._parts.query){for(var I="",w=0,N=R._parts.query.split("&"),B=N.length;w<B;w++){var U=(N[w]||"").split("=");I+="&"+r.decodeQuery(U[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),U[1]!==void 0&&(I+="="+r.decodeQuery(U[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}G+="?"+I.substring(1)}return G+=r.decodeQuery(R.hash(),!0),G},a.absoluteTo=function(R){var G=this.clone(),I=["protocol","username","password","hostname","port"],w,N,B;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(R instanceof r||(R=new r(R)),G._parts.protocol||(G._parts.protocol=R._parts.protocol,this._parts.hostname))return G;for(N=0;B=I[N];N++)G._parts[B]=R._parts[B];return G._parts.path?(G._parts.path.substring(-2)===".."&&(G._parts.path+="/"),G.path().charAt(0)!=="/"&&(w=R.directory(),w=w||(R.path().indexOf("/")===0?"/":""),G._parts.path=(w?w+"/":"")+G._parts.path,G.normalizePath())):(G._parts.path=R._parts.path,G._parts.query||(G._parts.query=R._parts.query)),G.build(),G},a.relativeTo=function(R){var G=this.clone().normalize(),I,w,N,B,U;if(G._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(R=new r(R).normalize(),I=G._parts,w=R._parts,B=G.path(),U=R.path(),B.charAt(0)!=="/")throw new Error("URI is already relative");if(U.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(I.protocol===w.protocol&&(I.protocol=null),I.username!==w.username||I.password!==w.password||I.protocol!==null||I.username!==null||I.password!==null)return G.build();if(I.hostname===w.hostname&&I.port===w.port)I.hostname=null,I.port=null;else return G.build();if(B===U)return I.path="",G.build();if(N=r.commonPath(B,U),!N)return G.build();var O=w.path.substring(N.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return I.path=O+I.path.substring(N.length)||"./",G.build()},a.equals=function(R){var G=this.clone(),I=new r(R),w={},N={},B={},U,O,k;if(G.normalize(),I.normalize(),G.toString()===I.toString())return!0;if(U=G.query(),O=I.query(),G.query(""),I.query(""),G.toString()!==I.toString()||U.length!==O.length)return!1;w=r.parseQuery(U,this._parts.escapeQuerySpace),N=r.parseQuery(O,this._parts.escapeQuerySpace);for(k in w)if(c.call(w,k)){if(m(w[k])){if(!f(w[k],N[k]))return!1}else if(w[k]!==N[k])return!1;B[k]=!0}for(k in N)if(c.call(N,k)&&!B[k])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 Wie=ed((BO,YO)=>{var Zen=T(S());/*! @license DOMPurify 3.1.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.1.6/LICENSE */(function(e,t){typeof BO=="object"&&typeof YO<"u"?YO.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.DOMPurify=t())})(BO,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(je){return je}),s||(s=function(je){return je}),c||(c=function(je,$e,He){return je.apply($e,He)}),d||(d=function(je,$e){return new je(...$e)});let u=X(Array.prototype.forEach),m=X(Array.prototype.pop),p=X(Array.prototype.push),g=X(String.prototype.toLowerCase),f=X(String.prototype.toString),x=X(String.prototype.match),_=X(String.prototype.replace),C=X(String.prototype.indexOf),V=X(String.prototype.trim),L=X(Object.prototype.hasOwnProperty),Z=X(RegExp.prototype.test),E=v(TypeError);function X(Xe){return function(je){for(var $e=arguments.length,He=new Array($e>1?$e-1:0),Ut=1;Ut<$e;Ut++)He[Ut-1]=arguments[Ut];return c(Xe,je,He)}}function v(Xe){return function(){for(var je=arguments.length,$e=new Array(je),He=0;He<je;He++)$e[He]=arguments[He];return d(Xe,$e)}}function P(Xe,je){let $e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:g;t&&t(Xe,null);let He=je.length;for(;He--;){let Ut=je[He];if(typeof Ut=="string"){let Ce=$e(Ut);Ce!==Ut&&(n(je)||(je[He]=Ce),Ut=Ce)}Xe[Ut]=!0}return Xe}function A(Xe){for(let je=0;je<Xe.length;je++)L(Xe,je)||(Xe[je]=null);return Xe}function M(Xe){let je=a(null);for(let[$e,He]of e(Xe))L(Xe,$e)&&(Array.isArray(He)?je[$e]=A(He):He&&typeof He=="object"&&He.constructor===Object?je[$e]=M(He):je[$e]=He);return je}function b(Xe,je){for(;Xe!==null;){let He=o(Xe,je);if(He){if(He.get)return X(He.get);if(typeof He.value=="function")return X(He.value)}Xe=i(Xe)}function $e(){return null}return $e}let R=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"]),G=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"]),I=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"]),w=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"]),N=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"]),B=r(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),U=r(["#text"]),O=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","popover","popovertarget","popovertargetaction","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","wrap","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"]),J=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"]),H=r(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),te=s(/\{\{[\w\W]*|[\w\W]*\}\}/gm),z=s(/<%[\w\W]*|[\w\W]*%>/gm),j=s(/\${[\w\W]*}/gm),ee=s(/^data-[\-\w.\u00B7-\uFFFF]/),fe=s(/^aria-[\-\w]+$/),_e=s(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),le=s(/^(?:\w+script|data):/i),ge=s(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Se=s(/^html$/i),Ie=s(/^[a-z][.\w]*(-[.\w]+)+$/i);var Le=Object.freeze({__proto__:null,MUSTACHE_EXPR:te,ERB_EXPR:z,TMPLIT_EXPR:j,DATA_ATTR:ee,ARIA_ATTR:fe,IS_ALLOWED_URI:_e,IS_SCRIPT_OR_DATA:le,ATTR_WHITESPACE:ge,DOCTYPE_NAME:Se,CUSTOM_ELEMENT:Ie});let ke={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Be=function(){return typeof window>"u"?null:window},st=function(je,$e){if(typeof je!="object"||typeof je.createPolicy!="function")return null;let He=null,Ut="data-tt-policy-suffix";$e&&$e.hasAttribute(Ut)&&(He=$e.getAttribute(Ut));let Ce="dompurify"+(He?"#"+He:"");try{return je.createPolicy(Ce,{createHTML(Ve){return Ve},createScriptURL(Ve){return Ve}})}catch{return console.warn("TrustedTypes policy "+Ce+" could not be created."),null}};function vt(){let Xe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Be(),je=Rn=>vt(Rn);if(je.version="3.1.6",je.removed=[],!Xe||!Xe.document||Xe.document.nodeType!==ke.document)return je.isSupported=!1,je;let{document:$e}=Xe,He=$e,Ut=He.currentScript,{DocumentFragment:Ce,HTMLTemplateElement:Ve,Node:ct,Element:Ni,NodeFilter:mt,NamedNodeMap:_o=Xe.NamedNodeMap||Xe.MozNamedAttrMap,HTMLFormElement:ur,DOMParser:Zc,trustedTypes:Sr}=Xe,ts=Ni.prototype,Ne=b(ts,"cloneNode"),ut=b(ts,"remove"),Je=b(ts,"nextSibling"),qe=b(ts,"childNodes"),pt=b(ts,"parentNode");if(typeof Ve=="function"){let Rn=$e.createElement("template");Rn.content&&Rn.content.ownerDocument&&($e=Rn.content.ownerDocument)}let Zt,yn="",{implementation:po,createNodeIterator:ir,createDocumentFragment:Da,getElementsByTagName:Ba}=$e,{importNode:ns}=He,Qn={};je.isSupported=typeof e=="function"&&typeof pt=="function"&&po&&po.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:ms,ERB_EXPR:Cr,TMPLIT_EXPR:dl,DATA_ATTR:To,ARIA_ATTR:Ur,IS_SCRIPT_OR_DATA:tp,ATTR_WHITESPACE:ul,CUSTOM_ELEMENT:np}=Le,{IS_ALLOWED_URI:Ya}=Le,Vr=null,ya=P({},[...R,...G,...I,...N,...U]),bo=null,gb=P({},[...O,...k,...J,...H]),ci=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}})),Gc=null,$l=null,tu=!0,So=!0,nu=!1,yS=!0,Ny=!1,_B=!0,ky=!1,TB=!1,SB=!1,xS=!1,gM=!1,yM=!1,F6=!0,A6=!1,eCe="user-content-",CB=!0,IL=!1,_S={},TS=null,M6=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"]),N6=null,k6=P({},["audio","video","img","source","image","track"]),VB=null,U6=P({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),xM="http://www.w3.org/1998/Math/MathML",_M="http://www.w3.org/2000/svg",ip="http://www.w3.org/1999/xhtml",SS=ip,LB=!1,RB=null,tCe=P({},[xM,_M,ip],f),WL=null,nCe=["application/xhtml+xml","text/html"],iCe="text/html",Js=null,CS=null,oCe=$e.createElement("form"),D6=function(Ze){return Ze instanceof RegExp||Ze instanceof Function},ZB=function(){let Ze=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(CS&&CS===Ze)){if((!Ze||typeof Ze!="object")&&(Ze={}),Ze=M(Ze),WL=nCe.indexOf(Ze.PARSER_MEDIA_TYPE)===-1?iCe:Ze.PARSER_MEDIA_TYPE,Js=WL==="application/xhtml+xml"?f:g,Vr=L(Ze,"ALLOWED_TAGS")?P({},Ze.ALLOWED_TAGS,Js):ya,bo=L(Ze,"ALLOWED_ATTR")?P({},Ze.ALLOWED_ATTR,Js):gb,RB=L(Ze,"ALLOWED_NAMESPACES")?P({},Ze.ALLOWED_NAMESPACES,f):tCe,VB=L(Ze,"ADD_URI_SAFE_ATTR")?P(M(U6),Ze.ADD_URI_SAFE_ATTR,Js):U6,N6=L(Ze,"ADD_DATA_URI_TAGS")?P(M(k6),Ze.ADD_DATA_URI_TAGS,Js):k6,TS=L(Ze,"FORBID_CONTENTS")?P({},Ze.FORBID_CONTENTS,Js):M6,Gc=L(Ze,"FORBID_TAGS")?P({},Ze.FORBID_TAGS,Js):{},$l=L(Ze,"FORBID_ATTR")?P({},Ze.FORBID_ATTR,Js):{},_S=L(Ze,"USE_PROFILES")?Ze.USE_PROFILES:!1,tu=Ze.ALLOW_ARIA_ATTR!==!1,So=Ze.ALLOW_DATA_ATTR!==!1,nu=Ze.ALLOW_UNKNOWN_PROTOCOLS||!1,yS=Ze.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ny=Ze.SAFE_FOR_TEMPLATES||!1,_B=Ze.SAFE_FOR_XML!==!1,ky=Ze.WHOLE_DOCUMENT||!1,xS=Ze.RETURN_DOM||!1,gM=Ze.RETURN_DOM_FRAGMENT||!1,yM=Ze.RETURN_TRUSTED_TYPE||!1,SB=Ze.FORCE_BODY||!1,F6=Ze.SANITIZE_DOM!==!1,A6=Ze.SANITIZE_NAMED_PROPS||!1,CB=Ze.KEEP_CONTENT!==!1,IL=Ze.IN_PLACE||!1,Ya=Ze.ALLOWED_URI_REGEXP||_e,SS=Ze.NAMESPACE||ip,ci=Ze.CUSTOM_ELEMENT_HANDLING||{},Ze.CUSTOM_ELEMENT_HANDLING&&D6(Ze.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ci.tagNameCheck=Ze.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Ze.CUSTOM_ELEMENT_HANDLING&&D6(Ze.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ci.attributeNameCheck=Ze.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Ze.CUSTOM_ELEMENT_HANDLING&&typeof Ze.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ci.allowCustomizedBuiltInElements=Ze.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ny&&(So=!1),gM&&(xS=!0),_S&&(Vr=P({},U),bo=[],_S.html===!0&&(P(Vr,R),P(bo,O)),_S.svg===!0&&(P(Vr,G),P(bo,k),P(bo,H)),_S.svgFilters===!0&&(P(Vr,I),P(bo,k),P(bo,H)),_S.mathMl===!0&&(P(Vr,N),P(bo,J),P(bo,H))),Ze.ADD_TAGS&&(Vr===ya&&(Vr=M(Vr)),P(Vr,Ze.ADD_TAGS,Js)),Ze.ADD_ATTR&&(bo===gb&&(bo=M(bo)),P(bo,Ze.ADD_ATTR,Js)),Ze.ADD_URI_SAFE_ATTR&&P(VB,Ze.ADD_URI_SAFE_ATTR,Js),Ze.FORBID_CONTENTS&&(TS===M6&&(TS=M(TS)),P(TS,Ze.FORBID_CONTENTS,Js)),CB&&(Vr["#text"]=!0),ky&&P(Vr,["html","head","body"]),Vr.table&&(P(Vr,["tbody"]),delete Gc.tbody),Ze.TRUSTED_TYPES_POLICY){if(typeof Ze.TRUSTED_TYPES_POLICY.createHTML!="function")throw E('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Ze.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw E('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');Zt=Ze.TRUSTED_TYPES_POLICY,yn=Zt.createHTML("")}else Zt===void 0&&(Zt=st(Sr,Ut)),Zt!==null&&typeof yn=="string"&&(yn=Zt.createHTML(""));r&&r(Ze),CS=Ze}},B6=P({},["mi","mo","mn","ms","mtext"]),Y6=P({},["foreignobject","annotation-xml"]),rCe=P({},["title","style","font","a","script"]),O6=P({},[...G,...I,...w]),H6=P({},[...N,...B]),sCe=function(Ze){let Wt=pt(Ze);(!Wt||!Wt.tagName)&&(Wt={namespaceURI:SS,tagName:"template"});let bn=g(Ze.tagName),Yo=g(Wt.tagName);return RB[Ze.namespaceURI]?Ze.namespaceURI===_M?Wt.namespaceURI===ip?bn==="svg":Wt.namespaceURI===xM?bn==="svg"&&(Yo==="annotation-xml"||B6[Yo]):!!O6[bn]:Ze.namespaceURI===xM?Wt.namespaceURI===ip?bn==="math":Wt.namespaceURI===_M?bn==="math"&&Y6[Yo]:!!H6[bn]:Ze.namespaceURI===ip?Wt.namespaceURI===_M&&!Y6[Yo]||Wt.namespaceURI===xM&&!B6[Yo]?!1:!H6[bn]&&(rCe[bn]||!O6[bn]):!!(WL==="application/xhtml+xml"&&RB[Ze.namespaceURI]):!1},wh=function(Ze){p(je.removed,{element:Ze});try{pt(Ze).removeChild(Ze)}catch{ut(Ze)}},TM=function(Ze,Wt){try{p(je.removed,{attribute:Wt.getAttributeNode(Ze),from:Wt})}catch{p(je.removed,{attribute:null,from:Wt})}if(Wt.removeAttribute(Ze),Ze==="is"&&!bo[Ze])if(xS||gM)try{wh(Wt)}catch{}else try{Wt.setAttribute(Ze,"")}catch{}},z6=function(Ze){let Wt=null,bn=null;if(SB)Ze="<remove></remove>"+Ze;else{let xa=x(Ze,/^[\r\n\t ]+/);bn=xa&&xa[0]}WL==="application/xhtml+xml"&&SS===ip&&(Ze='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Ze+"</body></html>");let Yo=Zt?Zt.createHTML(Ze):Ze;if(SS===ip)try{Wt=new Zc().parseFromString(Yo,WL)}catch{}if(!Wt||!Wt.documentElement){Wt=po.createDocument(SS,"template",null);try{Wt.documentElement.innerHTML=LB?yn:Yo}catch{}}let Oa=Wt.body||Wt.documentElement;return Ze&&bn&&Oa.insertBefore($e.createTextNode(bn),Oa.childNodes[0]||null),SS===ip?Ba.call(Wt,ky?"html":"body")[0]:ky?Wt.documentElement:Oa},K6=function(Ze){return ir.call(Ze.ownerDocument||Ze,Ze,mt.SHOW_ELEMENT|mt.SHOW_COMMENT|mt.SHOW_TEXT|mt.SHOW_PROCESSING_INSTRUCTION|mt.SHOW_CDATA_SECTION,null)},J6=function(Ze){return Ze instanceof ur&&(typeof Ze.nodeName!="string"||typeof Ze.textContent!="string"||typeof Ze.removeChild!="function"||!(Ze.attributes instanceof _o)||typeof Ze.removeAttribute!="function"||typeof Ze.setAttribute!="function"||typeof Ze.namespaceURI!="string"||typeof Ze.insertBefore!="function"||typeof Ze.hasChildNodes!="function")},Q6=function(Ze){return typeof ct=="function"&&Ze instanceof ct},op=function(Ze,Wt,bn){Qn[Ze]&&u(Qn[Ze],Yo=>{Yo.call(je,Wt,bn,CS)})},j6=function(Ze){let Wt=null;if(op("beforeSanitizeElements",Ze,null),J6(Ze))return wh(Ze),!0;let bn=Js(Ze.nodeName);if(op("uponSanitizeElement",Ze,{tagName:bn,allowedTags:Vr}),Ze.hasChildNodes()&&!Q6(Ze.firstElementChild)&&Z(/<[/\w]/g,Ze.innerHTML)&&Z(/<[/\w]/g,Ze.textContent)||Ze.nodeType===ke.progressingInstruction||_B&&Ze.nodeType===ke.comment&&Z(/<[/\w]/g,Ze.data))return wh(Ze),!0;if(!Vr[bn]||Gc[bn]){if(!Gc[bn]&&$6(bn)&&(ci.tagNameCheck instanceof RegExp&&Z(ci.tagNameCheck,bn)||ci.tagNameCheck instanceof Function&&ci.tagNameCheck(bn)))return!1;if(CB&&!TS[bn]){let Yo=pt(Ze)||Ze.parentNode,Oa=qe(Ze)||Ze.childNodes;if(Oa&&Yo){let xa=Oa.length;for(let ml=xa-1;ml>=0;--ml){let Fh=Ne(Oa[ml],!0);Fh.__removalCount=(Ze.__removalCount||0)+1,Yo.insertBefore(Fh,Je(Ze))}}}return wh(Ze),!0}return Ze instanceof Ni&&!sCe(Ze)||(bn==="noscript"||bn==="noembed"||bn==="noframes")&&Z(/<\/no(script|embed|frames)/i,Ze.innerHTML)?(wh(Ze),!0):(Ny&&Ze.nodeType===ke.text&&(Wt=Ze.textContent,u([ms,Cr,dl],Yo=>{Wt=_(Wt,Yo," ")}),Ze.textContent!==Wt&&(p(je.removed,{element:Ze.cloneNode()}),Ze.textContent=Wt)),op("afterSanitizeElements",Ze,null),!1)},q6=function(Ze,Wt,bn){if(F6&&(Wt==="id"||Wt==="name")&&(bn in $e||bn in oCe))return!1;if(!(So&&!$l[Wt]&&Z(To,Wt))){if(!(tu&&Z(Ur,Wt))){if(!bo[Wt]||$l[Wt]){if(!($6(Ze)&&(ci.tagNameCheck instanceof RegExp&&Z(ci.tagNameCheck,Ze)||ci.tagNameCheck instanceof Function&&ci.tagNameCheck(Ze))&&(ci.attributeNameCheck instanceof RegExp&&Z(ci.attributeNameCheck,Wt)||ci.attributeNameCheck instanceof Function&&ci.attributeNameCheck(Wt))||Wt==="is"&&ci.allowCustomizedBuiltInElements&&(ci.tagNameCheck instanceof RegExp&&Z(ci.tagNameCheck,bn)||ci.tagNameCheck instanceof Function&&ci.tagNameCheck(bn))))return!1}else if(!VB[Wt]){if(!Z(Ya,_(bn,ul,""))){if(!((Wt==="src"||Wt==="xlink:href"||Wt==="href")&&Ze!=="script"&&C(bn,"data:")===0&&N6[Ze])){if(!(nu&&!Z(tp,_(bn,ul,"")))){if(bn)return!1}}}}}}return!0},$6=function(Ze){return Ze!=="annotation-xml"&&x(Ze,np)},eq=function(Ze){op("beforeSanitizeAttributes",Ze,null);let{attributes:Wt}=Ze;if(!Wt)return;let bn={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:bo},Yo=Wt.length;for(;Yo--;){let Oa=Wt[Yo],{name:xa,namespaceURI:ml,value:Fh}=Oa,PL=Js(xa),Ec=xa==="value"?Fh:V(Fh);if(bn.attrName=PL,bn.attrValue=Ec,bn.keepAttr=!0,bn.forceKeepAttr=void 0,op("uponSanitizeAttribute",Ze,bn),Ec=bn.attrValue,_B&&Z(/((--!?|])>)|<\/(style|title)/i,Ec)){TM(xa,Ze);continue}if(bn.forceKeepAttr||(TM(xa,Ze),!bn.keepAttr))continue;if(!yS&&Z(/\/>/i,Ec)){TM(xa,Ze);continue}Ny&&u([ms,Cr,dl],nq=>{Ec=_(Ec,nq," ")});let tq=Js(Ze.nodeName);if(q6(tq,PL,Ec)){if(A6&&(PL==="id"||PL==="name")&&(TM(xa,Ze),Ec=eCe+Ec),Zt&&typeof Sr=="object"&&typeof Sr.getAttributeType=="function"&&!ml)switch(Sr.getAttributeType(tq,PL)){case"TrustedHTML":{Ec=Zt.createHTML(Ec);break}case"TrustedScriptURL":{Ec=Zt.createScriptURL(Ec);break}}try{ml?Ze.setAttributeNS(ml,xa,Ec):Ze.setAttribute(xa,Ec),J6(Ze)?wh(Ze):m(je.removed)}catch{}}}op("afterSanitizeAttributes",Ze,null)},aCe=function Rn(Ze){let Wt=null,bn=K6(Ze);for(op("beforeSanitizeShadowDOM",Ze,null);Wt=bn.nextNode();)op("uponSanitizeShadowNode",Wt,null),!j6(Wt)&&(Wt.content instanceof Ce&&Rn(Wt.content),eq(Wt));op("afterSanitizeShadowDOM",Ze,null)};return je.sanitize=function(Rn){let Ze=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Wt=null,bn=null,Yo=null,Oa=null;if(LB=!Rn,LB&&(Rn="<!-->"),typeof Rn!="string"&&!Q6(Rn))if(typeof Rn.toString=="function"){if(Rn=Rn.toString(),typeof Rn!="string")throw E("dirty is not a string, aborting")}else throw E("toString is not a function");if(!je.isSupported)return Rn;if(TB||ZB(Ze),je.removed=[],typeof Rn=="string"&&(IL=!1),IL){if(Rn.nodeName){let Fh=Js(Rn.nodeName);if(!Vr[Fh]||Gc[Fh])throw E("root node is forbidden and cannot be sanitized in-place")}}else if(Rn instanceof ct)Wt=z6("<!---->"),bn=Wt.ownerDocument.importNode(Rn,!0),bn.nodeType===ke.element&&bn.nodeName==="BODY"||bn.nodeName==="HTML"?Wt=bn:Wt.appendChild(bn);else{if(!xS&&!Ny&&!ky&&Rn.indexOf("<")===-1)return Zt&&yM?Zt.createHTML(Rn):Rn;if(Wt=z6(Rn),!Wt)return xS?null:yM?yn:""}Wt&&SB&&wh(Wt.firstChild);let xa=K6(IL?Rn:Wt);for(;Yo=xa.nextNode();)j6(Yo)||(Yo.content instanceof Ce&&aCe(Yo.content),eq(Yo));if(IL)return Rn;if(xS){if(gM)for(Oa=Da.call(Wt.ownerDocument);Wt.firstChild;)Oa.appendChild(Wt.firstChild);else Oa=Wt;return(bo.shadowroot||bo.shadowrootmode)&&(Oa=ns.call(He,Oa,!0)),Oa}let ml=ky?Wt.outerHTML:Wt.innerHTML;return ky&&Vr["!doctype"]&&Wt.ownerDocument&&Wt.ownerDocument.doctype&&Wt.ownerDocument.doctype.name&&Z(Se,Wt.ownerDocument.doctype.name)&&(ml="<!DOCTYPE "+Wt.ownerDocument.doctype.name+`>
`+ml),Ny&&u([ms,Cr,dl],Fh=>{ml=_(ml,Fh," ")}),Zt&&yM?Zt.createHTML(ml):ml},je.setConfig=function(){let Rn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ZB(Rn),TB=!0},je.clearConfig=function(){CS=null,TB=!1},je.isValidAttribute=function(Rn,Ze,Wt){CS||ZB({});let bn=Js(Rn),Yo=Js(Ze);return q6(bn,Yo,Wt)},je.addHook=function(Rn,Ze){typeof Ze=="function"&&(Qn[Rn]=Qn[Rn]||[],p(Qn[Rn],Ze))},je.removeHook=function(Rn){if(Qn[Rn])return m(Qn[Rn])},je.removeHooks=function(Rn){Qn[Rn]&&(Qn[Rn]=[])},je.removeAllHooks=function(){Qn={}},je}var Ct=vt();return Ct})});var fce=ed((ePn,hce)=>{"use strict";var tPn=T(S());hce.exports=pHe;var t2=1e20;function pHe(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,g,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,g=m.getImageData(0,0,r,s),c=g.data,u=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,m=e,r=p.width,s=p.height,g=m.getImageData(0,0,r,s),c=g.data,u=4):window.ImageData&&e instanceof window.ImageData&&(g=e,r=e.width,s=e.height,c=g.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),E=Array(a);for(f=0,x=r*s;f<x;f++){var X=c[f];_[f]=X===1?0:X===0?t2:Math.pow(Math.max(0,.5-X),2),C[f]=X===1?t2:X===0?0:Math.pow(Math.max(0,X-.5),2)}uce(_,r,s,V,L,E,Z),uce(C,r,s,V,L,E,Z);var v=window.Float32Array?new Float32Array(r*s):new Array(r*s);for(f=0,x=r*s;f<x;f++)v[f]=Math.min(Math.max(1-((_[f]-C[f])/i+n),0),1);return v}function uce(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(mce(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(mce(i,o,r,s,t),a=0;a<t;a++)e[c*t+a]=Math.sqrt(o[a])}}function mce(e,t,n,i,o){n[0]=0,i[0]=-t2,i[1]=+t2;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]=+t2}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 xce=ed((_Pn,F5)=>{var TPn=T(S());function RHe(){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,g=13,f=14,x=15,_=16,C=17,V=0,L=1,Z=2,E=3,X=4;function v(b,R){return 55296<=b.charCodeAt(R)&&b.charCodeAt(R)<=56319&&56320<=b.charCodeAt(R+1)&&b.charCodeAt(R+1)<=57343}function P(b,R){R===void 0&&(R=0);var G=b.charCodeAt(R);if(55296<=G&&G<=56319&&R<b.length-1){var I=G,w=b.charCodeAt(R+1);return 56320<=w&&w<=57343?(I-55296)*1024+(w-56320)+65536:I}if(56320<=G&&G<=57343&&R>=1){var I=b.charCodeAt(R-1),w=G;return 55296<=I&&I<=56319?(I-55296)*1024+(w-56320)+65536:w}return G}function A(b,R,G){var I=[b].concat(R).concat([G]),w=I[I.length-2],N=G,B=I.lastIndexOf(f);if(B>1&&I.slice(1,B).every(function(k){return k==i})&&[i,g,C].indexOf(b)==-1)return Z;var U=I.lastIndexOf(o);if(U>0&&I.slice(1,U).every(function(k){return k==o})&&[p,o].indexOf(w)==-1)return I.filter(function(k){return k==o}).length%2==1?E:X;if(w==e&&N==t)return V;if(w==n||w==e||w==t)return N==f&&R.every(function(k){return k==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 O=I.indexOf(i)!=-1?I.lastIndexOf(i)-1:I.length-2;return[g,C].indexOf(I[O])!=-1&&I.slice(O+1,-1).every(function(k){return k==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 G=M(P(b,R)),I=[],w=R+1;w<b.length;w++)if(!v(b,w-1)){var N=M(P(b,w));if(A(G,I,N))return w;I.push(N)}return b.length},this.splitGraphemes=function(b){for(var R=[],G=0,I;(I=this.nextBreak(b,G))<b.length;)R.push(b.slice(G,I)),G=I;return G<b.length&&R.push(b.slice(G)),R},this.iterateGraphemes=function(b){var R=0,G={next:function(){var I,w;return(w=this.nextBreak(b,R))<b.length?(I=b.slice(R,w),R=w,{value:I,done:!1}):R<b.length?(I=b.slice(R),R=b.length,{value:I,done:!1}):{value:void 0,done:!0}}.bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(G[Symbol.iterator]=function(){return G}),G},this.countGraphemes=function(b){for(var R=0,G=0,I;(I=this.nextBreak(b,G))<b.length;)G=I,R++;return G<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?g: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 F5<"u"&&F5.exports&&(F5.exports=RHe)});var N4=ed((exports,module)=>{var _Ti=T(S());/*!
 * protobuf.js v7.4.0 (c) 2016, daniel wirtz
 * compiled thu, 22 aug 2024 20:30:39 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(g){d&&(d=!1,p(g))}})}},{}],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,g=[],f=0,x=0,_;u<m;){var C=d[u++];switch(x){case 0:g[f++]=o[C>>2],_=(C&3)<<4,x=1;break;case 1:g[f++]=o[_|C>>4],_=(C&15)<<2,x=2;break;case 2:g[f++]=o[_|C>>6],g[f++]=o[C&63],x=0;break}f>8191&&((p||(p=[])).push(String.fromCharCode.apply(String,g)),f=0)}return x&&(g[f++]=o[_],g[f++]=61,x===1&&(g[f++]=61)),p?(f&&p.push(String.fromCharCode.apply(String,g.slice(0,f))),p.join("")):String.fromCharCode.apply(String,g.slice(0,f))};var a="invalid encoding";i.decode=function(d,u,m){for(var p=m,g=0,f,x=0;x<d.length;){var _=d.charCodeAt(x++);if(_===61&&g>1)break;if((_=r[_])===undefined)throw Error(a);switch(g){case 0:f=_,g=1;break;case 1:u[m++]=f<<2|(_&48)>>4,f=_,g=2;break;case 2:u[m++]=(f&15)<<4|(_&60)>>2,f=_,g=3;break;case 3:u[m++]=(f&3)<<6|_,g=0;break}}if(g===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 g(_,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:g,c.writeFloatBE=m?g: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,g,f){var x=p<0?1:0;if(x&&(p=-p),p===0)m(1/p>0?0:2147483648,g,f);else if(isNaN(p))m(2143289344,g,f);else if(p>34028234663852886e22)m((x<<31|2139095040)>>>0,g,f);else if(p<11754943508222875e-54)m((x<<31|Math.round(p/1401298464324817e-60))>>>0,g,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,g,f)}}c.writeFloatLE=d.bind(null,o),c.writeFloatBE=d.bind(null,r);function u(m,p,g){var f=m(p,g),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 g(_,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:g,c.writeDoubleBE=m?g: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,g,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,_+g);else if(isNaN(f))m(0,x,_+p),m(2146959360,x,_+g);else if(f>17976931348623157e292)m(0,x,_+p),m((C<<31|2146435072)>>>0,x,_+g);else{var V;if(f<22250738585072014e-324)V=f/5e-324,m(V>>>0,x,_+p),m((C<<31|V/4294967296)>>>0,x,_+g);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,_+g)}}}c.writeDoubleLE=d.bind(null,o,0,4),c.writeDoubleBE=d.bind(null,r,4,0);function u(m,p,g,f,x){var _=m(f,x+p),C=m(f,x+g),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 g=r.call(d,u,u+=p);return u&7&&(u=(u|7)+1),g}}},{}],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 g(){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 g.call(this)[x](!0)},sfixed64:function(){return g.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(g,f){if(g)return m.emit("error",g,s),u(g);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,E){this.fn=L,this.len=Z,this.next=undefined,this.val=E}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,E,X){return this.tail=this.tail.next=new c(Z,E,X),this.len+=E,this};function g(L,Z,E){Z[E]=L&255}function f(L,Z,E){for(;L>127;)Z[E++]=L&127|128,L>>>=7;Z[E]=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,E){for(;L.hi;)Z[E++]=L.lo&127|128,L.lo=(L.lo>>>7|L.hi<<25)>>>0,L.hi>>>=7;for(;L.lo>127;)Z[E++]=L.lo&127|128,L.lo=L.lo>>>7;Z[E++]=L.lo}m.prototype.uint64=function(Z){var E=r.from(Z);return this._push(_,E.length(),E)},m.prototype.int64=m.prototype.uint64,m.prototype.sint64=function(Z){var E=r.from(Z).zzEncode();return this._push(_,E.length(),E)},m.prototype.bool=function(Z){return this._push(g,1,Z?1:0)};function C(L,Z,E){Z[E]=L&255,Z[E+1]=L>>>8&255,Z[E+2]=L>>>16&255,Z[E+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 E=r.from(Z);return this._push(C,4,E.lo)._push(C,4,E.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,E,X){E.set(Z,X)}:function(Z,E,X){for(var v=0;v<Z.length;++v)E[X+v]=Z[v]};m.prototype.bytes=function(Z){var E=Z.length>>>0;if(!E)return this._push(g,1,0);if(i.isString(Z)){var X=m.alloc(E=s.length(Z));s.decode(Z,X,0),Z=X}return this.uint32(E)._push(V,E,Z)},m.prototype.string=function(Z){var E=a.length(Z);return E?this.uint32(E)._push(a.write,E,Z):this._push(g,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,E=this.tail,X=this.len;return this.reset().uint32(X),X&&(this.tail.next=Z.next,this.tail=E,this.len+=X),this},m.prototype.finish=function(){for(var Z=this.head.next,E=this.constructor.alloc(this.len),X=0;Z;)Z.fn(Z.val,E,X),X+=Z.len,Z=Z.next;return E},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 i_e=ed((Fki,f3)=>{var Aki=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,g=c(u,m.inputOffset||0,p),f=m.noDataValue!==null?m.noDataValue:o.defaultNoDataValue,x=r(g,m.pixelType||Float32Array,m.encodedMaskData,f,m.returnMask),_={width:g.width,height:g.height,pixelData:x.resultPixels,minValue:x.minValue,maxValue:g.pixels.maxValue,noDataValue:f};return x.resultMask&&(_.maskData=x.resultMask),m.returnEncodedMask&&g.mask&&(_.encodedMaskData=g.mask.bitset?g.mask.bitset:null),m.returnFileInfo&&(_.fileInfo=s(g),m.computeUsedBitDepths&&(_.fileInfo.bitDepths=a(g))),_};var r=function(u,m,p,g,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,E=Number.MAX_VALUE,X;p=p||(u.mask?u.mask.bitset:null);var v,P;v=new m(u.width*u.height),f&&p&&(P=new Uint8Array(u.width*u.height));for(var A=new Float32Array(V*L),M,b,R=0;R<=C;R++){var G=R!==C?L:u.height%C;if(G!==0)for(var I=0;I<=_;I++){var w=I!==_?V:u.width%_;if(w!==0){var N=R*u.width*L+I*V,B=u.width-w,U=u.pixels.blocks[x],O,k,J;U.encoding<2?(U.encoding===0?O=U.rawData:(d(U.stuffedData,U.bitsPerPixel,U.numValidPixels,U.offset,Z,A,u.pixels.maxValue),O=A),k=0):U.encoding===2?J=0:J=U.offset;var H;if(p)for(b=0;b<G;b++){for(N&7&&(H=p[N>>3],H<<=N&7),M=0;M<w;M++)N&7||(H=p[N>>3]),H&128?(P&&(P[N]=1),X=U.encoding<2?O[k++]:J,E=E>X?X:E,v[N++]=X):(P&&(P[N]=0),v[N++]=g),H<<=1;N+=B}else if(U.encoding<2)for(b=0;b<G;b++){for(M=0;M<w;M++)X=O[k++],E=E>X?X:E,v[N++]=X;N+=B}else for(E=E>J?J:E,b=0;b<G;b++){for(M=0;M<w;M++)v[N++]=J;N+=B}if(U.encoding===1&&k!==U.numValidPixels)throw"Block and Mask do not match";x++}}}return{resultPixels:v,resultMask:P,minValue:E}},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={},g=0;g<m;g++){var f=u.pixels.blocks[g];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 g={},f=new Uint8Array(u,m,10);if(g.fileIdentifierString=String.fromCharCode.apply(null,f),g.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+g.fileIdentifierString;m+=10;var x=new DataView(u,m,24);if(g.fileVersion=x.getInt32(0,!0),g.imageType=x.getInt32(4,!0),g.height=x.getUint32(8,!0),g.width=x.getUint32(12,!0),g.maxZError=x.getFloat64(16,!0),m+=24,!p)if(x=new DataView(u,m,16),g.mask={},g.mask.numBlocksY=x.getUint32(0,!0),g.mask.numBlocksX=x.getUint32(4,!0),g.mask.numBytes=x.getUint32(8,!0),g.mask.maxValue=x.getFloat32(12,!0),m+=16,g.mask.numBytes>0){var _=new Uint8Array(Math.ceil(g.width*g.height/8));x=new DataView(u,m,g.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<g.mask.numBytes);if(C!==-32768||L<_.length)throw"Unexpected end of mask RLE encoding";g.mask.bitset=_,m+=g.mask.numBytes}else g.mask.numBytes|g.mask.numBlocksY|g.mask.maxValue||(g.mask.bitset=new Uint8Array(Math.ceil(g.width*g.height/8)));x=new DataView(u,m,16),g.pixels={},g.pixels.numBlocksY=x.getUint32(0,!0),g.pixels.numBlocksX=x.getUint32(4,!0),g.pixels.numBytes=x.getUint32(8,!0),g.pixels.maxValue=x.getFloat32(12,!0),m+=16;var E=g.pixels.numBlocksX,X=g.pixels.numBlocksY,v=E+(g.width%E>0?1:0),P=X+(g.height%X>0?1:0);g.pixels.blocks=new Array(v*P);for(var A=0,M=0;M<P;M++)for(var b=0;b<v;b++){var R=0,G=u.byteLength-m;x=new DataView(u,m,Math.min(10,G));var I={};g.pixels.blocks[A++]=I;var w=x.getUint8(0);if(R++,I.encoding=w&63,I.encoding>3)throw"Invalid block encoding ("+I.encoding+")";if(I.encoding===2){m++;continue}if(w!==0&&w!==2){if(w>>=6,I.offsetType=w,w===2)I.offset=x.getInt8(1),R++;else if(w===1)I.offset=x.getInt16(1,!0),R+=2;else if(w===0)I.offset=x.getFloat32(1,!0),R+=4;else throw"Invalid block offset type";if(I.encoding===1)if(w=x.getUint8(R),R++,I.bitsPerPixel=w&63,w>>=6,I.numValidPixelsType=w,w===2)I.numValidPixels=x.getUint8(R),R++;else if(w===1)I.numValidPixels=x.getUint16(R,!0),R+=2;else if(w===0)I.numValidPixels=x.getUint32(R,!0),R+=4;else throw"Invalid valid pixel count type"}if(m+=R,I.encoding!==3){var N,B;if(I.encoding===0){var U=(g.pixels.numBytes-1)/4;if(U!==Math.floor(U))throw"uncompressed block has invalid length";N=new ArrayBuffer(U*4),B=new Uint8Array(N),B.set(new Uint8Array(u,m,U*4));var O=new Float32Array(N);I.rawData=O,m+=U*4}else if(I.encoding===1){var k=Math.ceil(I.numValidPixels*I.bitsPerPixel/8),J=Math.ceil(k/4);N=new ArrayBuffer(J*4),B=new Uint8Array(N),B.set(new Uint8Array(u,m,k)),I.stuffedData=new Uint32Array(N),m+=k}}}return g.eofOffset=m,g},d=function(u,m,p,g,f,x,_){var C=(1<<m)-1,V=0,L,Z=0,E,X,v=Math.ceil((_-g)/f),P=u.length*4-Math.ceil(m*p/8);for(u[u.length-1]<<=8*P,L=0;L<p;L++){if(Z===0&&(X=u[V++],Z=32),Z>=m)E=X>>>Z-m&C,Z-=m;else{var A=m-Z;E=(X&C)<<A&C,X=u[V++],Z=32-A,E+=X>>>Z}x[L]=E<v?g+E*f:_}return x};return o}(),t=function(){"use strict";var o={unstuff:function(c,d,u,m,p,g,f,x){var _=(1<<u)-1,C=0,V,L=0,Z,E,X,v,P=c.length*4-Math.ceil(u*m/8);if(c[c.length-1]<<=8*P,p)for(V=0;V<m;V++)L===0&&(E=c[C++],L=32),L>=u?(Z=E>>>L-u&_,L-=u):(X=u-L,Z=(E&_)<<X&_,E=c[C++],L=32-X,Z+=E>>>L),d[V]=p[Z];else for(v=Math.ceil((x-g)/f),V=0;V<m;V++)L===0&&(E=c[C++],L=32),L>=u?(Z=E>>>L-u&_,L-=u):(X=u-L,Z=(E&_)<<X&_,E=c[C++],L=32-X,Z+=E>>>L),d[V]=Z<v?g+Z*f:x},unstuffLUT:function(c,d,u,m,p,g){var f=(1<<d)-1,x=0,_=0,C=0,V=0,L=0,Z,E=[],X=c.length*4-Math.ceil(d*u/8);c[c.length-1]<<=8*X;var v=Math.ceil((g-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),E[_]=L<v?m+L*p:g;return E.unshift(m),E},unstuff2:function(c,d,u,m,p,g,f,x){var _=(1<<u)-1,C=0,V,L=0,Z=0,E,X,v;if(p)for(V=0;V<m;V++)L===0&&(X=c[C++],L=32,Z=0),L>=u?(E=X>>>Z&_,L-=u,Z+=u):(v=u-L,E=X>>>Z&_,X=c[C++],L=32-v,E|=(X&(1<<v)-1)<<u-v,Z=v),d[V]=p[E];else{var P=Math.ceil((x-g)/f);for(V=0;V<m;V++)L===0&&(X=c[C++],L=32,Z=0),L>=u?(E=X>>>Z&_,L-=u,Z+=u):(v=u-L,E=X>>>Z&_,X=c[C++],L=32-v,E|=(X&(1<<v)-1)<<u-v,Z=v),d[V]=E<P?g+E*f:x}return d},unstuffLUT2:function(c,d,u,m,p,g){var f=(1<<d)-1,x=0,_=0,C=0,V=0,L=0,Z=0,E,X=[],v=Math.ceil((g-m)/p);for(_=0;_<u;_++)V===0&&(E=c[x++],V=32,Z=0),V>=d?(L=E>>>Z&f,V-=d,Z+=d):(C=d-V,L=E>>>Z&f,E=c[x++],V=32-C,L|=(E&(1<<C)-1)<<d-C,Z=C),X[_]=L<v?m+L*p:g;return X.unshift(m),X},originalUnstuff:function(c,d,u,m){var p=(1<<u)-1,g=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[g++],x=32),x>=u?(_=C>>>x-u&p,x-=u):(V=u-x,_=(C&p)<<V&p,C=c[g++],x=32-V,_+=C>>>x),d[f]=_;return d},originalUnstuff2:function(c,d,u,m){var p=(1<<u)-1,g=0,f,x=0,_=0,C,V,L;for(f=0;f<m;f++)x===0&&(V=c[g++],x=32,_=0),x>=u?(C=V>>>_&p,x-=u,_+=u):(L=u-x,C=V>>>_&p,V=c[g++],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),g=0;p;){var f=p>=359?359:p;p-=f;do d+=c[g++]<<8,u+=d+=c[g++];while(--f);d=(d&65535)+(d>>>16),u=(u&65535)+(u>>>16)}return m&1&&(u+=d+=c[g]<<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 g=new DataView(c,u,8),f=g.getInt32(0,!0);p.fileVersion=f,u+=4,f>=3&&(p.checksum=g.getUint32(4,!0),u+=4),g=new DataView(c,u,12),p.height=g.getUint32(0,!0),p.width=g.getUint32(4,!0),u+=8,f>=4?(p.numDims=g.getUint32(8,!0),u+=4):p.numDims=1,g=new DataView(c,u,40),p.numValidPixel=g.getUint32(0,!0),p.microBlockSize=g.getInt32(4,!0),p.blobSize=g.getInt32(8,!0),p.imageType=g.getInt32(12,!0),p.maxZError=g.getFloat64(16,!0),p.zMin=g.getFloat64(24,!0),p.zMax=g.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),g=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(g[x]!==f[x]){_=!1;break}return u.minValues=g,u.maxValues=f,_},readSubArray:function(c,d,u,m){var p;if(u===Uint8Array)p=new Uint8Array(c,d,m);else{var g=new ArrayBuffer(m),f=new Uint8Array(g);f.set(new Uint8Array(c,d,m)),p=new u(g)}return p},readMask:function(c,d){var u=d.ptr,m=d.headerInfo,p=m.width*m.height,g=m.numValidPixel,f=new DataView(c,u,4),x={};if(x.numBytes=f.getUint32(0,!0),u+=4,(g===0||p===g)&&x.numBytes!==0)throw"invalid mask";var _,C;if(g===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,E=0;do{if(V>0)for(;V--;)_[Z++]=f.getUint8(L++);else for(E=f.getUint8(L++),V=-V;V--;)_[Z++]=E;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 X=0,v=0;for(v=0;v<p;v++)v&7?(X=_[v>>3],X<<=v&7):X=_[v>>3],X&128&&(C[v]=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,g=p.numDims,f=p.width*p.height,x=p.imageType,_=p.numValidPixel*r.getDataTypeSize(x)*g,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*g)d.pixels.resultPixels=C;else{d.pixels.resultPixels=new u(f*g);var E=0,X=0,v=0,P=0;if(g>1)for(v=0;v<g;v++)for(P=v*f,X=0;X<f;X++)V[X]&&(d.pixels.resultPixels[P+X]=C[E++]);else for(X=0;X<f;X++)V[X]&&(d.pixels.resultPixels[X]=C[E++])}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 g=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,E;for(V=f;V<x;V++)L=V-(V<g?0:g),C[L]={first:_[V-f],second:null};var X=c.byteLength-d.ptr,v=Math.ceil(X/4),P=new ArrayBuffer(v*4),A=new Uint8Array(P);A.set(new Uint8Array(c,d.ptr,X));var M=new Uint32Array(P),b=0,R,G=0;for(R=M[0],V=f;V<x;V++)L=V-(V<g?0:g),E=C[L].first,E>0&&(C[L].second=R<<b>>>32-E,32-b>=E?(b+=E,b===32&&(b=0,G++,R=M[G])):(b+=E-32,G++,R=M[G],C[L].second|=R>>>32-b));var I=0,w=0,N=new s;for(V=0;V<C.length;V++)C[V]!==void 0&&(I=Math.max(I,C[V].first));I>=u?w=u:w=I,I>=30&&console.log("WARning, large NUM LUT BITS IS "+I);var B=[],U,O,k,J,H,te;for(V=f;V<x;V++)if(L=V-(V<g?0:g),E=C[L].first,E>0)if(U=[E,L],E<=w)for(O=C[L].second<<w-E,k=1<<w-E,Z=0;Z<k;Z++)B[O|Z]=U;else for(O=C[L].second,te=N,J=E-1;J>=0;J--)H=O>>>J&1,H?(te.right||(te.right=new s),te=te.right):(te.left||(te.left=new s),te=te.left),J===0&&!te.val&&(te.val=U[1]);return{decodeLut:B,numBitsLUTQick:w,numBitsLUT:I,tree:N,stuffedData:M,srcPtr:G,bitPos:b}},readHuffman:function(c,d,u){var m=d.headerInfo,p=m.numDims,g=d.headerInfo.height,f=d.headerInfo.width,x=f*g,_=this.readHuffmanTree(c,d),C=_.decodeLut,V=_.tree,L=_.stuffedData,Z=_.srcPtr,E=_.bitPos,X=_.numBitsLUTQick,v=_.numBitsLUT,P=d.headerInfo.imageType===0?128:0,A,M,b,R=d.pixels.resultMask,G,I,w,N,B,U,O,k=0;E>0&&(Z++,E=0);var J=L[Z],H=d.encodeMode===1,te=new u(x*p),z=te,j;for(j=0;j<m.numDims;j++){if(p>1&&(z=new u(te.buffer,x*j,x),k=0),d.headerInfo.numValidPixel===f*g)for(U=0,N=0;N<g;N++)for(B=0;B<f;B++,U++){if(M=0,G=J<<E>>>32-X,I=G,32-E<X&&(G|=L[Z+1]>>>64-E-X,I=G),C[I])M=C[I][1],E+=C[I][0];else for(G=J<<E>>>32-v,I=G,32-E<v&&(G|=L[Z+1]>>>64-E-v,I=G),A=V,O=0;O<v;O++)if(w=G>>>v-O-1&1,A=w?A.right:A.left,!(A.left||A.right)){M=A.val,E=E+O+1;break}E>=32&&(E-=32,Z++,J=L[Z]),b=M-P,H?(B>0?b+=k:N>0?b+=z[U-f]:b+=k,b&=255,z[U]=b,k=b):z[U]=b}else for(U=0,N=0;N<g;N++)for(B=0;B<f;B++,U++)if(R[U]){if(M=0,G=J<<E>>>32-X,I=G,32-E<X&&(G|=L[Z+1]>>>64-E-X,I=G),C[I])M=C[I][1],E+=C[I][0];else for(G=J<<E>>>32-v,I=G,32-E<v&&(G|=L[Z+1]>>>64-E-v,I=G),A=V,O=0;O<v;O++)if(w=G>>>v-O-1&1,A=w?A.right:A.left,!(A.left||A.right)){M=A.val,E=E+O+1;break}E>=32&&(E-=32,Z++,J=L[Z]),b=M-P,H?(B>0&&R[U-1]?b+=k:N>0&&R[U-f]?b+=z[U-f]:b+=k,b&=255,z[U]=b,k=b):z[U]=b}d.ptr=d.ptr+(Z+1)*4+(E>0?4:0)}d.pixels.resultPixels=te},decodeBits:function(c,d,u,m,p){{var g=d.headerInfo,f=g.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,E=C&31,X=0;if(L===1)X=_.getUint8(x),x++;else if(L===2)X=_.getUint16(x,!0),x+=2;else if(L===4)X=_.getUint32(x,!0),x+=4;else throw"Invalid valid pixel count type";var v=2*g.maxZError,P,A,M,b,R,G,I,w,N,B,U=g.numDims>1?g.maxValues[p]:g.zMax;if(Z){for(d.counter.lut++,w=_.getUint8(x),N=E,x++,b=Math.ceil((w-1)*E/8),R=Math.ceil(b/4),A=new ArrayBuffer(R*4),M=new Uint8Array(A),d.ptr+=x,M.set(new Uint8Array(c,d.ptr,b)),I=new Uint32Array(A),d.ptr+=b,B=0;w-1>>>B;)B++;b=Math.ceil(X*B/8),R=Math.ceil(b/4),A=new ArrayBuffer(R*4),M=new Uint8Array(A),M.set(new Uint8Array(c,d.ptr,b)),P=new Uint32Array(A),d.ptr+=b,f>=3?G=o.unstuffLUT2(I,E,w-1,m,v,U):G=o.unstuffLUT(I,E,w-1,m,v,U),f>=3?o.unstuff2(P,u,B,X,G):o.unstuff(P,u,B,X,G)}else d.counter.bitstuffer++,B=E,d.ptr+=x,B>0&&(b=Math.ceil(X*B/8),R=Math.ceil(b/4),A=new ArrayBuffer(R*4),M=new Uint8Array(A),M.set(new Uint8Array(c,d.ptr,b)),P=new Uint32Array(A),d.ptr+=b,f>=3?m==null?o.originalUnstuff2(P,u,B,X):o.unstuff2(P,u,B,X,!1,m,v,U):m==null?o.originalUnstuff(P,u,B,X):o.unstuff(P,u,B,X,!1,m,v,U))}},readTiles:function(c,d,u){var m=d.headerInfo,p=m.width,g=m.height,f=m.microBlockSize,x=m.imageType,_=r.getDataTypeSize(x),C=Math.ceil(p/f),V=Math.ceil(g/f);d.pixels.numBlocksY=V,d.pixels.numBlocksX=C,d.pixels.ptr=0;var L=0,Z=0,E=0,X=0,v=0,P=0,A=0,M=0,b=0,R=0,G=0,I=0,w=0,N=0,B=0,U=0,O,k,J,H,te,z,j=new u(f*f),ee=g%f||f,fe=p%f||f,_e,le,ge=m.numDims,Se,Ie=d.pixels.resultMask,Le=d.pixels.resultPixels;for(E=0;E<V;E++)for(v=E!==V-1?f:ee,X=0;X<C;X++)for(P=X!==C-1?f:fe,G=E*p*f+X*f,I=p-P,Se=0;Se<ge;Se++){if(ge>1&&(Le=new u(d.pixels.resultPixels.buffer,p*g*Se*_,p*g)),A=c.byteLength-d.ptr,O=new DataView(c,d.ptr,Math.min(10,A)),k={},U=0,M=O.getUint8(0),U++,b=M>>6&255,R=M>>2&15,R!==(X*f>>3&15))throw"integrity issue";if(z=M&3,z>3)throw d.ptr+=U,"Invalid block encoding ("+z+")";if(z===2){d.counter.constant++,d.ptr+=U;continue}else if(z===0){if(d.counter.uncompressed++,d.ptr+=U,w=v*P*_,N=c.byteLength-d.ptr,w=w<N?w:N,J=new ArrayBuffer(w%_===0?w:w+_-w%_),H=new Uint8Array(J),H.set(new Uint8Array(c,d.ptr,w)),te=new u(J),B=0,Ie)for(L=0;L<v;L++){for(Z=0;Z<P;Z++)Ie[G]&&(Le[G]=te[B++]),G++;G+=I}else for(L=0;L<v;L++){for(Z=0;Z<P;Z++)Le[G++]=te[B++];G+=I}d.ptr+=B*_}else if(_e=r.getDataTypeUsed(x,b),le=r.getOnePixel(k,U,_e,O),U+=r.getDataTypeSize(_e),z===3)if(d.ptr+=U,d.counter.constantoffset++,Ie)for(L=0;L<v;L++){for(Z=0;Z<P;Z++)Ie[G]&&(Le[G]=le),G++;G+=I}else for(L=0;L<v;L++){for(Z=0;Z<P;Z++)Le[G++]=le;G+=I}else if(d.ptr+=U,r.decodeBits(c,d,j,le,Se),U=0,Ie)for(L=0;L<v;L++){for(Z=0;Z<P;Z++)Ie[G]&&(Le[G]=j[U++]),G++;G+=I}else for(L=0;L<v;L++){for(Z=0;Z<P;Z++)Le[G++]=j[U++];G+=I}}},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,g=0,f=0,x=0,_=c.pixels.resultMask;if(_)if(u>1)for(g=0;g<u;g++)for(x=g*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 g=p.headerInfo,f=g.fileVersion,x=r.getDataTypeArray(g.imageType);r.readMask(c,p),g.numValidPixel!==g.width*g.height&&!p.pixels.resultMask&&(p.pixels.resultMask=d.maskData);var _=g.width*g.height;if(p.pixels.resultPixels=new x(_*g.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},g.numValidPixel!==0)if(g.zMax===g.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&&g.imageType<=1&&Math.abs(g.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 E={width:g.width,height:g.height,pixelData:p.pixels.resultPixels,minValue:g.zMin,maxValue:g.zMax,validPixelCount:g.numValidPixel,dimCount:g.numDims,dimStats:{minValues:g.minValues,maxValues:g.maxValues},maskData:p.pixels.resultMask};if(p.pixels.resultMask&&r.isValidPixelValue(g.imageType,u)){var X=p.pixels.resultMask;for(m=0;m<_;m++)X[m]||(E.pixelData[m]=u);E.noDataValue=u}return p.noDataValue=u,d.returnFileInfo&&(E.fileInfo=r.formatFileInfo(p)),E}},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,g,f=[],x,_,C={width:0,height:0,pixels:[],pixelType:r.pixelType,mask:null,statistics:[]};s<p;){var V=d.decode(o,{inputOffset:s,encodedMaskData:g,maskData:_,returnMask:m===0,returnEncodedMask:m===0,returnFileInfo:!0,pixelType:r.pixelType||null,noDataValue:r.noDataValue||null});s=V.fileInfo.eofOffset,m===0&&(g=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,E;if(u>1&&f.length>1){for(E=C.width*C.height,C.bandMasks=f,_=new Uint8Array(E),_.set(f[0]),L=1;L<f.length;L++)for(x=f[L],Z=0;Z<E;Z++)_[Z]=_[Z]&x[Z];C.maskData=_}return C}};typeof define=="function"&&define.amd?define([],function(){return i}):typeof f3<"u"&&f3.exports?f3.exports=i:this.Lerc=i})()});var DSe=ed((mVo,USe)=>{var hVo=T(S());USe.exports={webm:"data:video/webm;base64, ",mp4:"data:video/mp4;base64, "}});var YSe=ed((fVo,BSe)=>{var pVo=T(S()),{webm:QSt,mp4:jSt}=DSe(),L6=()=>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,R6=()=>"wakeLock"in navigator,Z6=class{constructor(){if(this.enabled=!1,R6()){this._wakeLock=null;let t=()=>{this._wakeLock!==null&&document.visibilityState==="visible"&&this.enable()};document.addEventListener("visibilitychange",t),document.addEventListener("fullscreenchange",t)}else L6()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",QSt),this._addSourceToVideo(this.noSleepVideo,"mp4",jSt),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 R6()?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}):L6()?(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(){R6()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):L6()?this.noSleepTimer&&(console.warn(`
          NoSleep now disabled for older iOS devices.
        `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}};BSe.exports=Z6});var SCt={};hCe(SCt,{AlphaMode:()=>of,AlphaPipelineStage:()=>KI,Animation:()=>XA,AnimationViewModel:()=>IA,Appearance:()=>ji,ApproximateTerrainHeights:()=>ai,ArcGISTiledElevationTerrainProvider:()=>x4,ArcGisBaseMapType:()=>Ch,ArcGisMapServerImageryProvider:()=>Q0,ArcGisMapService:()=>Yd,ArcType:()=>en,ArticulationStageType:()=>lc,AssociativeArray:()=>Lt,Atmosphere:()=>Mw,AtmospherePipelineStage:()=>GI,AttributeCompression:()=>wn,AttributeType:()=>on,AutoExposure:()=>Nw,AutomaticUniforms:()=>sp,Axis:()=>Xo,AxisAlignedBoundingBox:()=>Pb,B3dmLoader:()=>sI,B3dmParser:()=>iI,BaseLayerPicker:()=>PA,BaseLayerPickerViewModel:()=>WA,BatchTable:()=>ux,BatchTableHierarchy:()=>Mx,BatchTexture:()=>Dc,BatchTexturePipelineStage:()=>JI,Billboard:()=>ro,BillboardCollection:()=>yd,BillboardGraphics:()=>ec,BillboardVisualizer:()=>HG,BingMapsGeocoderService:()=>T4,BingMapsImageryProvider:()=>Uw,BingMapsStyle:()=>DV,BlendEquation:()=>La,BlendFunction:()=>Co,BlendOption:()=>Lo,BlendingState:()=>un,BoundingRectangle:()=>Ke,BoundingSphere:()=>ce,BoundingSphereState:()=>ft,BoundingVolumeSemantics:()=>t_,BoxEmitter:()=>Ij,BoxGeometry:()=>xl,BoxGeometryUpdater:()=>dX,BoxGraphics:()=>Vx,BoxOutlineGeometry:()=>xm,BrdfLutGenerator:()=>Bw,Buffer:()=>yt,BufferLoader:()=>Yx,BufferUsage:()=>Me,CPUStylingPipelineStage:()=>$I,CallbackProperty:()=>Zm,Camera:()=>io,CameraEventAggregator:()=>Kw,CameraEventType:()=>Wi,CameraFlightPath:()=>Ow,Cartesian2:()=>D,Cartesian3:()=>h,Cartesian4:()=>se,Cartographic:()=>he,CartographicGeocoderService:()=>C4,CatmullRomSpline:()=>V4,Cesium3DContentGroup:()=>Ax,Cesium3DTile:()=>Fu,Cesium3DTileBatchTable:()=>vp,Cesium3DTileColorBlendMode:()=>Ll,Cesium3DTileContent:()=>Bj,Cesium3DTileContentFactory:()=>__,Cesium3DTileContentState:()=>Uo,Cesium3DTileContentType:()=>ys,Cesium3DTileFeature:()=>vs,Cesium3DTileFeatureTable:()=>km,Cesium3DTileOptimizationHint:()=>Xu,Cesium3DTileOptimizations:()=>X2,Cesium3DTilePass:()=>vo,Cesium3DTilePassState:()=>em,Cesium3DTilePointFeature:()=>o0,Cesium3DTileRefine:()=>Mo,Cesium3DTileStyle:()=>XT,Cesium3DTileStyleEngine:()=>F2,Cesium3DTilesInspector:()=>NA,Cesium3DTilesInspectorViewModel:()=>MA,Cesium3DTilesVoxelProvider:()=>Qj,Cesium3DTileset:()=>ra,Cesium3DTilesetBaseTraversal:()=>D2,Cesium3DTilesetCache:()=>P2,Cesium3DTilesetGraphics:()=>Ix,Cesium3DTilesetHeatmap:()=>v2,Cesium3DTilesetMetadata:()=>X_,Cesium3DTilesetMostDetailedTraversal:()=>N2,Cesium3DTilesetSkipTraversal:()=>O2,Cesium3DTilesetStatistics:()=>y0,Cesium3DTilesetTraversal:()=>Ns,Cesium3DTilesetVisualizer:()=>H2,CesiumInspector:()=>DA,CesiumInspectorViewModel:()=>UA,CesiumTerrainProvider:()=>gT,CesiumWidget:()=>TA,Check:()=>go,CheckerboardMaterialProperty:()=>u1,CircleEmitter:()=>$w,CircleGeometry:()=>X4,CircleOutlineGeometry:()=>I4,ClassificationModelDrawCommand:()=>SI,ClassificationPipelineStage:()=>QI,ClassificationPrimitive:()=>$S,ClassificationType:()=>kn,ClearCommand:()=>ei,ClippingPlane:()=>n_,ClippingPlaneCollection:()=>as,ClippingPolygon:()=>GC,ClippingPolygonCollection:()=>Am,Clock:()=>eh,ClockRange:()=>Mr,ClockStep:()=>mo,ClockViewModel:()=>RA,CloudCollection:()=>n8,CloudType:()=>zV,Color:()=>Y,ColorBlendMode:()=>cc,ColorGeometryInstanceAttribute:()=>Ht,ColorMaterialProperty:()=>Yt,Command:()=>u6,ComponentDatatype:()=>Q,Composite3DTileContent:()=>fX,CompositeEntityCollection:()=>cK,CompositeMaterialProperty:()=>h1,CompositePositionProperty:()=>sa,CompositeProperty:()=>fc,CompressedTextureBuffer:()=>tR,ComputeCommand:()=>um,ComputeEngine:()=>$L,ConditionsExpression:()=>Jw,ConeEmitter:()=>o8,ConstantPositionProperty:()=>Mc,ConstantProperty:()=>Jn,ConstantSpline:()=>dI,ContentMetadata:()=>T2,Context:()=>NG,ContextLimits:()=>Dt,CoplanarPolygonGeometry:()=>XP,CoplanarPolygonGeometryLibrary:()=>m0,CoplanarPolygonOutlineGeometry:()=>wu,CornerType:()=>Gi,CorridorGeometry:()=>F_,CorridorGeometryLibrary:()=>Ai,CorridorGeometryUpdater:()=>tP,CorridorGraphics:()=>Rx,CorridorOutlineGeometry:()=>eP,Credit:()=>Rt,CreditDisplay:()=>tF,CubeMap:()=>Sa,CubeMapFace:()=>iR,CubicRealPolynomial:()=>lx,CullFace:()=>yi,CullingVolume:()=>rs,CumulusCloud:()=>Hd,CustomDataSource:()=>aP,CustomHeightmapTerrainProvider:()=>W4,CustomShader:()=>sS,CustomShaderMode:()=>n0,CustomShaderPipelineStage:()=>sW,CustomShaderTranslucencyMode:()=>bg,CylinderGeometry:()=>cP,CylinderGeometryLibrary:()=>A_,CylinderGeometryUpdater:()=>dP,CylinderGraphics:()=>Zx,CylinderOutlineGeometry:()=>lP,CzmlDataSource:()=>_P,DataSource:()=>Ar,DataSourceClock:()=>th,DataSourceCollection:()=>TP,DataSourceDisplay:()=>lv,DebugAppearance:()=>r8,DebugCameraPrimitive:()=>Yf,DebugInspector:()=>oF,DebugModelMatrixPrimitive:()=>rF,DefaultProxy:()=>P4,DepthFunction:()=>tc,DepthPlane:()=>cF,DequantizationPipelineStage:()=>cW,DerivedCommand:()=>q0,DeveloperError:()=>pe,DeviceOrientationCameraController:()=>dF,DirectionalLight:()=>a8,DiscardEmptyTileImagePolicy:()=>BV,DiscardMissingTileImagePolicy:()=>Fw,DistanceDisplayCondition:()=>Pt,DistanceDisplayConditionGeometryInstanceAttribute:()=>Nn,DoubleEndedPriorityQueue:()=>yT,DoublyLinkedList:()=>W2,DracoLoader:()=>Up,DrawCommand:()=>tt,DynamicAtmosphereLightingType:()=>GT,DynamicGeometryBatch:()=>O_,DynamicGeometryUpdater:()=>ti,EarthOrientationParameters:()=>OL,EarthOrientationParametersSample:()=>xb,EasingFunction:()=>kr,EllipseGeometry:()=>jc,EllipseGeometryLibrary:()=>Ml,EllipseGeometryUpdater:()=>CP,EllipseGraphics:()=>Gx,EllipseOutlineGeometry:()=>Ed,Ellipsoid:()=>ne,EllipsoidGeodesic:()=>Sp,EllipsoidGeometry:()=>Us,EllipsoidGeometryUpdater:()=>LP,EllipsoidGraphics:()=>Ex,EllipsoidOutlineGeometry:()=>_d,EllipsoidPrimitive:()=>uF,EllipsoidRhumbLine:()=>Ra,EllipsoidSurfaceAppearance:()=>l8,EllipsoidTangentPlane:()=>Br,EllipsoidTerrainProvider:()=>Af,EllipsoidalOccluder:()=>V0,Empty3DTileContent:()=>qC,EncodedCartesian3:()=>Yn,Entity:()=>Jo,EntityCluster:()=>Cd,EntityCollection:()=>ks,EntityView:()=>uv,Event:()=>be,EventHelper:()=>vr,Expression:()=>gu,ExpressionNodeType:()=>gt,ExtrapolationType:()=>Ld,FeatureDetection:()=>Ot,FeatureIdPipelineStage:()=>pg,Fog:()=>fF,ForEach:()=>We,FrameRateMonitor:()=>pF,FrameState:()=>bF,Framebuffer:()=>js,FramebufferManager:()=>hi,FrustumCommands:()=>gF,FrustumGeometry:()=>_T,FrustumOutlineGeometry:()=>qv,Fullscreen:()=>mr,FullscreenButton:()=>YA,FullscreenButtonViewModel:()=>BA,GeoJsonDataSource:()=>fv,GeoJsonLoader:()=>aI,GeocodeType:()=>by,Geocoder:()=>HA,GeocoderService:()=>IV,GeocoderViewModel:()=>OA,GeographicProjection:()=>Li,GeographicTilingScheme:()=>Di,Geometry:()=>ht,Geometry3DTileContent:()=>bX,GeometryAttribute:()=>Ge,GeometryAttributes:()=>mn,GeometryFactory:()=>M4,GeometryInstance:()=>Vt,GeometryInstanceAttribute:()=>nc,GeometryOffsetAttribute:()=>ln,GeometryPipeline:()=>An,GeometryPipelineStage:()=>mW,GeometryType:()=>su,GeometryUpdater:()=>ni,GeometryUpdaterSet:()=>nT,GeometryVisualizer:()=>jP,GetFeatureInfoFormat:()=>vT,Globe:()=>NF,GlobeDepth:()=>kF,GlobeSurfaceShaderSet:()=>yF,GlobeSurfaceTile:()=>tm,GlobeSurfaceTileProvider:()=>EF,GlobeTranslucency:()=>XF,GlobeTranslucencyFramebuffer:()=>UF,GlobeTranslucencyState:()=>DF,GltfBufferViewLoader:()=>mC,GltfDracoLoader:()=>hC,GltfImageLoader:()=>fC,GltfIndexBufferLoader:()=>pC,GltfJsonLoader:()=>gC,GltfLoader:()=>zp,GltfLoaderUtil:()=>El,GltfStructuralMetadataLoader:()=>$X,GltfTextureLoader:()=>yC,GltfVertexBufferLoader:()=>xC,GoogleEarthEnterpriseImageryProvider:()=>w8,GoogleEarthEnterpriseMapsProvider:()=>TF,GoogleEarthEnterpriseMetadata:()=>z0,GoogleEarthEnterpriseTerrainData:()=>WV,GoogleEarthEnterpriseTerrainProvider:()=>H4,GoogleEarthEnterpriseTileInformation:()=>$v,GoogleMaps:()=>ST,GpxDataSource:()=>yv,GregorianDate:()=>cp,GridImageryProvider:()=>F8,GridMaterialProperty:()=>C1,GroundGeometryUpdater:()=>On,GroundPolylineGeometry:()=>_x,GroundPolylinePrimitive:()=>Cm,GroundPrimitive:()=>Fc,GroupMetadata:()=>c1,HeadingPitchRange:()=>Hu,HeadingPitchRoll:()=>_a,Heap:()=>UL,HeightReference:()=>Qe,HeightmapEncoding:()=>Ju,HeightmapTerrainData:()=>Fa,HeightmapTessellator:()=>SV,HermitePolynomialApproximation:()=>uP,HermiteSpline:()=>mg,HilbertOrder:()=>cC,HomeButton:()=>KA,HomeButtonViewModel:()=>zA,HorizontalOrigin:()=>gi,I3SBuildingSceneLayerExplorer:()=>_6,I3SBuildingSceneLayerExplorerViewModel:()=>JA,I3SDataProvider:()=>Ih,I3SDecoder:()=>BF,I3SFeature:()=>YF,I3SField:()=>OF,I3SGeometry:()=>sL,I3SLayer:()=>BT,I3SNode:()=>aL,I3SStatistics:()=>KF,I3SSublayer:()=>QF,I3SSymbology:()=>zF,I3dmLoader:()=>lI,I3dmParser:()=>cI,Iau2000Orientation:()=>tw,Iau2006XysData:()=>HL,Iau2006XysSample:()=>qy,IauOrientationAxes:()=>nw,IauOrientationParameters:()=>ew,ImageBasedLighting:()=>Fx,ImageBasedLightingPipelineStage:()=>XI,ImageMaterialProperty:()=>Mb,Imagery:()=>$V,ImageryLayer:()=>ha,ImageryLayerCollection:()=>IF,ImageryLayerFeatureInfo:()=>Vh,ImageryProvider:()=>il,ImageryState:()=>si,Implicit3DTileContent:()=>SC,ImplicitAvailabilityBitstream:()=>dC,ImplicitMetadataView:()=>uC,ImplicitSubdivisionScheme:()=>Hr,ImplicitSubtree:()=>$x,ImplicitSubtreeCache:()=>jw,ImplicitSubtreeMetadata:()=>gX,ImplicitTileCoordinates:()=>P_,ImplicitTileset:()=>W_,IndexDatatype:()=>Ae,InfoBox:()=>jA,InfoBoxViewModel:()=>QA,InspectorShared:()=>Ua,InstanceAttributeSemantic:()=>Kr,InstancingPipelineStage:()=>YI,InterpolationAlgorithm:()=>K4,InterpolationType:()=>Mm,Intersect:()=>Kt,IntersectionTests:()=>qn,Intersections2D:()=>O0,Interval:()=>Va,InvertClassification:()=>lL,Ion:()=>Em,IonGeocoderService:()=>rw,IonImageryProvider:()=>eb,IonResource:()=>md,IonWorldImageryStyle:()=>tb,Iso8601:()=>De,JobScheduler:()=>jF,JobType:()=>Ea,JsonMetadataTable:()=>Hp,JulianDate:()=>q,KTX2Transcoder:()=>nR,KeyboardEventModifier:()=>Os,KeyframeNode:()=>Ki,KmlCamera:()=>xv,KmlDataSource:()=>Ov,KmlLookAt:()=>Mv,KmlTour:()=>Nv,KmlTourFlyTo:()=>Uv,KmlTourWait:()=>Dv,Label:()=>Sg,LabelCollection:()=>uf,LabelGraphics:()=>Vm,LabelStyle:()=>No,LabelVisualizer:()=>qP,LagrangePolynomialApproximation:()=>mP,LeapSecond:()=>ki,Light:()=>k8,LightingModel:()=>af,LightingPipelineStage:()=>fW,LinearApproximation:()=>N_,LinearSpline:()=>ug,ManagedArray:()=>Uc,MapMode2D:()=>Hl,MapProjection:()=>j4,MapboxImageryProvider:()=>SF,MapboxStyleImageryProvider:()=>U8,Material:()=>Ui,MaterialAppearance:()=>oo,MaterialPipelineStage:()=>bW,MaterialProperty:()=>Ko,Math:()=>W,Matrix2:()=>Qi,Matrix3:()=>$,Matrix4:()=>F,Megatexture:()=>uL,MetadataClass:()=>Pm,MetadataClassProperty:()=>zb,MetadataComponentType:()=>an,MetadataEntity:()=>Mn,MetadataEnum:()=>AX,MetadataEnumValue:()=>FX,MetadataPipelineStage:()=>Tu,MetadataSchema:()=>vm,MetadataSchemaLoader:()=>_C,MetadataSemantic:()=>e_,MetadataTable:()=>Zl,MetadataTableProperty:()=>xX,MetadataType:()=>zt,MipmapHint:()=>Oh,Model:()=>Bm,Model3DTileContent:()=>cf,ModelAlphaOptions:()=>vW,ModelAnimation:()=>fI,ModelAnimationChannel:()=>hI,ModelAnimationCollection:()=>pI,ModelAnimationLoop:()=>Il,ModelAnimationState:()=>Um,ModelArticulation:()=>WI,ModelArticulationStage:()=>II,ModelClippingPlanesPipelineStage:()=>wI,ModelClippingPolygonsPipelineStage:()=>MI,ModelColorPipelineStage:()=>fg,ModelComponents:()=>Tn,ModelDrawCommand:()=>CI,ModelFeature:()=>bI,ModelFeatureTable:()=>yI,ModelGraphics:()=>Gp,ModelLightingOptions:()=>DW,ModelMatrixUpdateStage:()=>OI,ModelNode:()=>NI,ModelRenderResources:()=>wW,ModelRuntimeNode:()=>zI,ModelRuntimePrimitive:()=>WW,ModelSceneGraph:()=>YW,ModelSilhouettePipelineStage:()=>MW,ModelSkin:()=>PW,ModelSplitterPipelineStage:()=>kW,ModelStatistics:()=>OW,ModelType:()=>rr,ModelUtility:()=>jt,ModelVisualizer:()=>$P,Moon:()=>$F,MorphTargetsPipelineStage:()=>yW,MorphWeightSpline:()=>q4,MortonOrder:()=>Gg,Multiple3DTileContent:()=>V2,MultisampleFramebuffer:()=>kG,NavigationHelpButton:()=>$A,NavigationHelpButtonViewModel:()=>qA,NearFarScalar:()=>kt,NeverTileDiscardPolicy:()=>B8,NodeRenderResources:()=>UW,NodeStatisticsPipelineStage:()=>HI,NodeTransformationProperty:()=>Xx,OIT:()=>e9,Occluder:()=>sw,OffsetGeometryInstanceAttribute:()=>zi,OpenCageGeocoderService:()=>tj,OpenStreetMapImageryProvider:()=>sb,OrderedGroundPrimitiveCollection:()=>SP,OrientedBoundingBox:()=>Gn,OrthographicFrustum:()=>sn,OrthographicOffCenterFrustum:()=>Zr,Packable:()=>nj,PackableForInterpolation:()=>ij,Particle:()=>mL,ParticleBurst:()=>K8,ParticleEmitter:()=>J8,ParticleSystem:()=>Q8,Pass:()=>Re,PassState:()=>$a,PathGraphics:()=>Ep,PathVisualizer:()=>tv,PeliasGeocoderService:()=>ow,PerInstanceColorAppearance:()=>dn,PerformanceDisplay:()=>ab,PerformanceWatchdog:()=>tM,PerformanceWatchdogViewModel:()=>eM,PerspectiveFrustum:()=>Vi,PerspectiveOffCenterFrustum:()=>nl,PickDepth:()=>n9,PickDepthFramebuffer:()=>o9,PickFramebuffer:()=>s9,Picking:()=>c9,PickingPipelineStage:()=>xW,PinBuilder:()=>M0,PixelDatatype:()=>nt,PixelFormat:()=>at,Plane:()=>cn,PlaneGeometry:()=>RP,PlaneGeometryUpdater:()=>GP,PlaneGraphics:()=>iX,PlaneOutlineGeometry:()=>ZP,PntsLoader:()=>zW,PntsParser:()=>f_,PointCloud:()=>u9,PointCloudEyeDomeLighting:()=>Kp,PointCloudShading:()=>sf,PointCloudStylingPipelineStage:()=>TW,PointGraphics:()=>Wx,PointPrimitive:()=>_s,PointPrimitiveCollection:()=>y1,PointVisualizer:()=>iv,PolygonGeometry:()=>Op,PolygonGeometryLibrary:()=>Dn,PolygonGeometryUpdater:()=>WP,PolygonGraphics:()=>Lm,PolygonHierarchy:()=>Za,PolygonOutlineGeometry:()=>IP,PolygonPipeline:()=>ri,Polyline:()=>Zu,PolylineArrowMaterialProperty:()=>L1,PolylineCollection:()=>Om,PolylineColorAppearance:()=>Yr,PolylineDashMaterialProperty:()=>Z1,PolylineGeometry:()=>A0,PolylineGeometryUpdater:()=>sv,PolylineGlowMaterialProperty:()=>E1,PolylineGraphics:()=>ic,PolylineMaterialAppearance:()=>ea,PolylineOutlineMaterialProperty:()=>Fg,PolylinePipeline:()=>Zi,PolylineVisualizer:()=>cv,PolylineVolumeGeometry:()=>wP,PolylineVolumeGeometryLibrary:()=>Qm,PolylineVolumeGeometryUpdater:()=>NP,PolylineVolumeGraphics:()=>Px,PolylineVolumeOutlineGeometry:()=>MP,PositionProperty:()=>Rp,PositionPropertyArray:()=>G0,PostProcessStage:()=>co,PostProcessStageCollection:()=>W9,PostProcessStageComposite:()=>rl,PostProcessStageLibrary:()=>jd,PostProcessStageSampleMode:()=>Qd,PostProcessStageTextureCache:()=>qT,Primitive:()=>En,PrimitiveCollection:()=>Al,PrimitiveLoadPlan:()=>l_,PrimitiveOutlineGenerator:()=>c_,PrimitiveOutlinePipelineStage:()=>VW,PrimitivePipeline:()=>gx,PrimitiveRenderResources:()=>BW,PrimitiveState:()=>gr,PrimitiveStatisticsPipelineStage:()=>LW,PrimitiveType:()=>Fe,ProjectionPicker:()=>iM,ProjectionPickerViewModel:()=>nM,Property:()=>K,PropertyArray:()=>I1,PropertyAttribute:()=>a_,PropertyAttributeProperty:()=>JX,PropertyBag:()=>Cl,PropertyTable:()=>Yc,PropertyTexture:()=>s_,PropertyTextureProperty:()=>KX,ProviderViewModel:()=>es,Proxy:()=>oj,QuadraticRealPolynomial:()=>vc,QuadtreeOccluders:()=>WF,QuadtreePrimitive:()=>MF,QuadtreeTile:()=>PF,QuadtreeTileLoadState:()=>Ks,QuadtreeTileProvider:()=>h7,QuantizedMeshTerrainData:()=>bT,QuarticRealPolynomial:()=>ZE,Quaternion:()=>we,QuaternionSpline:()=>mI,Queue:()=>rg,Ray:()=>pn,Rectangle:()=>ae,RectangleCollisionChecker:()=>oT,RectangleGeometry:()=>Q_,RectangleGeometryLibrary:()=>xs,RectangleGeometryUpdater:()=>kP,RectangleGraphics:()=>Rm,RectangleOutlineGeometry:()=>C_,ReferenceFrame:()=>$i,ReferenceProperty:()=>E0,RenderState:()=>Ue,Renderbuffer:()=>rd,RenderbufferFormat:()=>Ic,Request:()=>Oo,RequestErrorEvent:()=>Nh,RequestScheduler:()=>Ja,RequestState:()=>jn,RequestType:()=>is,Resource:()=>Ee,ResourceCache:()=>Bi,ResourceCacheKey:()=>Xl,ResourceCacheStatistics:()=>kX,ResourceLoader:()=>eo,ResourceLoaderState:()=>It,Rotation:()=>ku,RuntimeError:()=>ue,S2Cell:()=>Ap,SDFSettings:()=>As,SampledPositionProperty:()=>ca,SampledProperty:()=>Zd,Sampler:()=>$t,ScaledPositionProperty:()=>Sf,Scene:()=>dA,SceneFramebuffer:()=>OT,SceneMode:()=>oe,SceneMode2DPipelineStage:()=>RW,SceneModePicker:()=>rM,SceneModePickerViewModel:()=>oM,SceneTransforms:()=>Yi,SceneTransitioner:()=>v9,ScreenSpaceCameraController:()=>A9,ScreenSpaceEventHandler:()=>Bd,ScreenSpaceEventType:()=>Sn,SelectedFeatureIdPipelineStage:()=>gg,SelectionIndicator:()=>cM,SelectionIndicatorViewModel:()=>aM,SensorVolumePortionToDisplay:()=>w1,ShaderBuilder:()=>ox,ShaderCache:()=>vG,ShaderDestination:()=>ye,ShaderFunction:()=>BG,ShaderProgram:()=>rn,ShaderSource:()=>Oe,ShaderStruct:()=>DG,ShadowMap:()=>lb,ShadowMapShader:()=>Jf,ShadowMode:()=>_n,ShadowVolumeAppearance:()=>ld,ShowGeometryInstanceAttribute:()=>xn,Simon1994PlanetaryPositions:()=>Eb,SimplePolylineGeometry:()=>hj,SingleTileImageryProvider:()=>CF,SkinningPipelineStage:()=>GW,SkyAtmosphere:()=>uA,SkyBox:()=>mA,SpatialNode:()=>sA,SpecularEnvironmentCubeMap:()=>Gm,SphereEmitter:()=>D7,SphereGeometry:()=>fj,SphereOutlineGeometry:()=>f0,Spherical:()=>hP,Spline:()=>to,SplitDirection:()=>Gr,Splitter:()=>pL,StaticGeometryColorBatch:()=>Bu,StaticGeometryPerMaterialBatch:()=>Yu,StaticGroundGeometryColorBatch:()=>tV,StaticGroundGeometryPerMaterialBatch:()=>QP,StaticGroundPolylinePerMaterialBatch:()=>av,StaticOutlineGeometryBatch:()=>oV,StencilConstants:()=>Bt,StencilFunction:()=>Un,StencilOperation:()=>bt,SteppedSpline:()=>uI,Stereographic:()=>ac,StripeMaterialProperty:()=>P1,StripeOrientation:()=>ih,StructuralMetadata:()=>Xa,StyleCommandsNeeded:()=>Dm,StyleExpression:()=>B7,Sun:()=>bA,SunLight:()=>bp,SunPostProcess:()=>k9,SupportedImageFormats:()=>eI,SvgPathBindingHandler:()=>VA,TaskProcessor:()=>bi,Terrain:()=>gA,TerrainData:()=>gh,TerrainEncoding:()=>xc,TerrainFillMesh:()=>iL,TerrainMesh:()=>ju,TerrainOffsetProperty:()=>vx,TerrainProvider:()=>Qr,TerrainQuantization:()=>Ys,TerrainState:()=>ao,Texture:()=>Ft,TextureAtlas:()=>Tg,TextureCache:()=>wG,TextureMagnificationFilter:()=>ui,TextureManager:()=>aA,TextureMinificationFilter:()=>qt,TextureUniform:()=>s6,TextureWrap:()=>Cn,TileAvailability:()=>yh,TileBoundingRegion:()=>vu,TileBoundingS2Cell:()=>G2,TileBoundingSphere:()=>p0,TileBoundingVolume:()=>Y7,TileCoordinatesImageryProvider:()=>xA,TileDiscardPolicy:()=>H7,TileEdge:()=>gn,TileImagery:()=>eL,TileMapServiceImageryProvider:()=>Vy,TileMetadata:()=>S2,TileOrientedBoundingBox:()=>Td,TileProviderError:()=>Zo,TileReplacementQueue:()=>vF,TileSelectionResult:()=>Kn,TileState:()=>z7,Tileset3DTileContent:()=>QW,TilesetMetadata:()=>E2,TilesetPipelineStage:()=>LI,TilingScheme:()=>pj,TimeConstants:()=>zn,TimeDynamicImagery:()=>FT,TimeDynamicPointCloud:()=>ZL,TimeInterval:()=>Vn,TimeIntervalCollection:()=>Fr,TimeIntervalCollectionPositionProperty:()=>X0,TimeIntervalCollectionProperty:()=>I0,TimeStandard:()=>Hn,Timeline:()=>uM,TimelineHighlightRange:()=>lM,TimelineTrack:()=>dM,Tipsify:()=>WE,ToggleButtonViewModel:()=>vy,Tonemapper:()=>mb,Transforms:()=>wt,TranslationRotationScale:()=>Nb,TranslucentTileClassification:()=>a9,TridiagonalSystemSolver:()=>wC,TrustedServers:()=>vS,TweenCollection:()=>tS,UniformState:()=>MG,UniformType:()=>xL,UrlTemplateImageryProvider:()=>Ma,VERSION:()=>TCt,VRButton:()=>hM,VRButtonViewModel:()=>mM,VRTheWorldTerrainProvider:()=>bj,VaryingType:()=>a6,Vector3DTileBatch:()=>$h,Vector3DTileClampedPolylines:()=>y2,Vector3DTileContent:()=>_2,Vector3DTileGeometry:()=>Fp,Vector3DTilePoints:()=>u2,Vector3DTilePolygons:()=>m2,Vector3DTilePolylines:()=>x_,Vector3DTilePrimitive:()=>Ux,VelocityOrientationProperty:()=>pP,VelocityVectorProperty:()=>B_,VertexArray:()=>mi,VertexArrayFacade:()=>yp,VertexAttributeSemantic:()=>St,VertexFormat:()=>Pe,VerticalExaggeration:()=>br,VerticalExaggerationPipelineStage:()=>XW,VerticalOrigin:()=>Pn,VideoSynchronizer:()=>gj,View:()=>KT,Viewer:()=>E6,ViewportQuad:()=>Q7,Visibility:()=>lr,Visualizer:()=>d4,VoxelBoxShape:()=>Df,VoxelCell:()=>U9,VoxelContent:()=>qw,VoxelCylinderShape:()=>Bf,VoxelEllipsoidShape:()=>IT,VoxelInspector:()=>bM,VoxelInspectorViewModel:()=>pM,VoxelPrimitive:()=>Wy,VoxelProvider:()=>q7,VoxelRenderResources:()=>nA,VoxelShape:()=>$7,VoxelShapeType:()=>Pi,VoxelTraversal:()=>yL,VulkanConstants:()=>yj,WallGeometry:()=>DP,WallGeometryLibrary:()=>j_,WallGeometryUpdater:()=>OP,WallGraphics:()=>Xp,WallOutlineGeometry:()=>YP,WebGLConstants:()=>ie,WebMapServiceImageryProvider:()=>LF,WebMapTileServiceImageryProvider:()=>ZF,WebMercatorProjection:()=>Ri,WebMercatorTilingScheme:()=>jr,WindingOrder:()=>os,WireframeIndexGenerator:()=>OC,WireframePipelineStage:()=>IW,_shadersAcesTonemappingStage:()=>m9,_shadersAdditiveBlend:()=>M9,_shadersAdjustTranslucentFS:()=>wV,_shadersAllMaterialAppearanceFS:()=>JG,_shadersAllMaterialAppearanceVS:()=>QG,_shadersAmbientOcclusionGenerate:()=>h9,_shadersAmbientOcclusionModulate:()=>f9,_shadersAspectRampMaterial:()=>tE,_shadersAtmosphereCommon:()=>J0,_shadersAtmosphereStageFS:()=>RI,_shadersAtmosphereStageVS:()=>ZI,_shadersBasicMaterialAppearanceFS:()=>jG,_shadersBasicMaterialAppearanceVS:()=>qG,_shadersBillboardCollectionFS:()=>jW,_shadersBillboardCollectionVS:()=>qW,_shadersBlackAndWhite:()=>p9,_shadersBloomComposite:()=>b9,_shadersBrdfLutGeneratorFS:()=>fw,_shadersBrightPass:()=>N9,_shadersBrightness:()=>g9,_shadersBumpMapMaterial:()=>nE,_shadersCPUStylingStageFS:()=>qI,_shadersCPUStylingStageVS:()=>jI,_shadersCheckerboardMaterial:()=>iE,_shadersCloudCollectionFS:()=>pw,_shadersCloudCollectionVS:()=>bw,_shadersCloudNoiseFS:()=>gw,_shadersCloudNoiseVS:()=>yw,_shadersCompareAndPackTranslucentDepth:()=>xw,_shadersCompositeOITFS:()=>_w,_shadersCompositeTranslucentClassification:()=>zT,_shadersContrastBias:()=>y9,_shadersCustomShaderStageFS:()=>tW,_shadersCustomShaderStageVS:()=>eW,_shadersCzmBuiltins:()=>tx,_shadersDepthOfField:()=>x9,_shadersDepthPlaneFS:()=>Tw,_shadersDepthPlaneVS:()=>Sw,_shadersDepthView:()=>_9,_shadersDepthViewPacked:()=>r6,_shadersDotMaterial:()=>oE,_shadersEdgeDetection:()=>T9,_shadersElevationBandMaterial:()=>rE,_shadersElevationContourMaterial:()=>sE,_shadersElevationRampMaterial:()=>aE,_shadersEllipsoidFS:()=>FV,_shadersEllipsoidSurfaceAppearanceFS:()=>mF,_shadersEllipsoidSurfaceAppearanceVS:()=>hF,_shadersEllipsoidVS:()=>AV,_shadersFXAA:()=>V9,_shadersFXAA3_11:()=>Cw,_shadersFadeMaterial:()=>cE,_shadersFeatureIdStageFS:()=>nW,_shadersFeatureIdStageVS:()=>iW,_shadersFilmicTonemapping:()=>S9,_shadersGaussianBlur1D:()=>Iy,_shadersGeometryStageFS:()=>lW,_shadersGeometryStageVS:()=>dW,_shadersGlobeFS:()=>Vw,_shadersGlobeVS:()=>Lw,_shadersGridMaterial:()=>lE,_shadersGroundAtmosphere:()=>MV,_shadersHSBToRGB:()=>jR,_shadersHSLToRGB:()=>qR,_shadersImageBasedLightingStageFS:()=>EI,_shadersInstancingStageCommon:()=>kI,_shadersInstancingStageVS:()=>UI,_shadersIntersectBox:()=>K9,_shadersIntersectClippingPlanes:()=>z9,_shadersIntersectCylinder:()=>J9,_shadersIntersectDepth:()=>H9,_shadersIntersectEllipsoid:()=>Q9,_shadersIntersectLongitude:()=>gL,_shadersIntersection:()=>oS,_shadersIntersectionUtils:()=>O9,_shadersLegacyInstancingStageVS:()=>DI,_shadersLensFlare:()=>L9,_shadersLightingStageFS:()=>hW,_shadersMaterialStageFS:()=>pW,_shadersMegatexture:()=>tA,_shadersMetadataStageFS:()=>oW,_shadersMetadataStageVS:()=>rW,_shadersModelClippingPlanesStageFS:()=>vI,_shadersModelClippingPolygonsStageFS:()=>AI,_shadersModelClippingPolygonsStageVS:()=>FI,_shadersModelColorStageFS:()=>PI,_shadersModelFS:()=>xI,_shadersModelSilhouetteStageFS:()=>FW,_shadersModelSilhouetteStageVS:()=>AW,_shadersModelSplitterStageFS:()=>NW,_shadersModelVS:()=>_I,_shadersModifiedReinhardTonemapping:()=>R9,_shadersMorphTargetsStageVS:()=>gW,_shadersNightVision:()=>Z9,_shadersNormalMapMaterial:()=>dE,_shadersOctree:()=>eA,_shadersPassThrough:()=>Ql,_shadersPassThroughDepth:()=>Ry,_shadersPbrNeutralTonemapping:()=>C9,_shadersPerInstanceColorAppearanceFS:()=>TE,_shadersPerInstanceColorAppearanceVS:()=>SE,_shadersPerInstanceFlatColorAppearanceFS:()=>cx,_shadersPerInstanceFlatColorAppearanceVS:()=>CE,_shadersPointCloudEyeDomeLighting:()=>tI,_shadersPointCloudStylingStageVS:()=>_W,_shadersPointPrimitiveCollectionFS:()=>wg,_shadersPointPrimitiveCollectionVS:()=>nP,_shadersPolygonSignedDistanceFS:()=>YX,_shadersPolylineArrowMaterial:()=>uE,_shadersPolylineColorAppearanceVS:()=>YE,_shadersPolylineCommon:()=>dd,_shadersPolylineDashMaterial:()=>mE,_shadersPolylineFS:()=>Sx,_shadersPolylineGlowMaterial:()=>hE,_shadersPolylineMaterialAppearanceVS:()=>OE,_shadersPolylineOutlineMaterial:()=>fE,_shadersPolylineShadowVolumeFS:()=>kE,_shadersPolylineShadowVolumeMorphFS:()=>UE,_shadersPolylineShadowVolumeMorphVS:()=>DE,_shadersPolylineShadowVolumeVS:()=>BE,_shadersPolylineVS:()=>r2,_shadersPrimitiveOutlineStageFS:()=>CW,_shadersPrimitiveOutlineStageVS:()=>SW,_shadersRGBToHSB:()=>$R,_shadersRGBToHSL:()=>eZ,_shadersRGBToXYZ:()=>tZ,_shadersReinhardTonemapping:()=>G9,_shadersReprojectWebMercatorFS:()=>Rw,_shadersReprojectWebMercatorVS:()=>Zw,_shadersRimLightingMaterial:()=>pE,_shadersSelectedFeatureIdStageCommon:()=>YC,_shadersShadowVolumeAppearanceFS:()=>jS,_shadersShadowVolumeAppearanceVS:()=>GE,_shadersShadowVolumeFS:()=>vb,_shadersSilhouette:()=>E9,_shadersSkinningStageVS:()=>ZW,_shadersSkyAtmosphereCommon:()=>NV,_shadersSkyAtmosphereFS:()=>Gw,_shadersSkyAtmosphereVS:()=>Ew,_shadersSkyBoxFS:()=>Xw,_shadersSkyBoxVS:()=>Iw,_shadersSlopeRampMaterial:()=>bE,_shadersStripeMaterial:()=>gE,_shadersSunFS:()=>Ww,_shadersSunTextureFS:()=>Pw,_shadersSunVS:()=>vw,_shadersTexturedMaterialAppearanceFS:()=>$G,_shadersTexturedMaterialAppearanceVS:()=>eE,_shadersVector3DTileClampedPolylinesFS:()=>b2,_shadersVector3DTileClampedPolylinesVS:()=>p2,_shadersVector3DTilePolylinesVS:()=>h2,_shadersVectorTileVS:()=>aC,_shadersVerticalExaggerationStageVS:()=>EW,_shadersViewportQuadFS:()=>ww,_shadersViewportQuadVS:()=>$y,_shadersVoxelFS:()=>B9,_shadersVoxelUtils:()=>D9,_shadersVoxelVS:()=>Y9,_shadersWater:()=>xE,_shadersWaterMaskMaterial:()=>yE,_shadersXYZToRGB:()=>nZ,_shadersacesTonemapping:()=>iZ,_shadersalphaWeight:()=>oZ,_shadersantialias:()=>rZ,_shadersapplyHSBShift:()=>sZ,_shadersapproximateSphericalCoordinates:()=>aZ,_shadersapproximateTanh:()=>cZ,_shadersbackFacing:()=>lZ,_shadersbranchFreeTernary:()=>dZ,_shaderscascadeColor:()=>uZ,_shaderscascadeDistance:()=>mZ,_shaderscascadeMatrix:()=>hZ,_shaderscascadeWeights:()=>fZ,_shadersclipPolygons:()=>pZ,_shaderscolumbusViewMorph:()=>bZ,_shaderscomputeAtmosphereColor:()=>gZ,_shaderscomputeGroundAtmosphereScattering:()=>yZ,_shaderscomputePosition:()=>xZ,_shaderscomputeScattering:()=>_Z,_shadersconvertUvToBox:()=>j9,_shadersconvertUvToCylinder:()=>q9,_shadersconvertUvToEllipsoid:()=>$9,_shaderscosineAndSine:()=>TZ,_shadersdecompressTextureCoordinates:()=>SZ,_shadersdegreesPerRadian:()=>rR,_shadersdepthClamp:()=>CZ,_shadersdepthRange:()=>sR,_shadersdepthRangeStruct:()=>BR,_shaderseastNorthUpToEyeCoordinates:()=>VZ,_shadersellipsoidContainsPoint:()=>LZ,_shadersellipsoidTextureCoordinates:()=>RZ,_shadersepsilon1:()=>aR,_shadersepsilon2:()=>cR,_shadersepsilon3:()=>lR,_shadersepsilon4:()=>dR,_shadersepsilon5:()=>uR,_shadersepsilon6:()=>mR,_shadersepsilon7:()=>hR,_shadersequalsEpsilon:()=>ZZ,_shaderseyeOffset:()=>GZ,_shaderseyeToWindowCoordinates:()=>EZ,_shadersfastApproximateAtan:()=>XZ,_shadersfog:()=>IZ,_shadersgammaCorrect:()=>WZ,_shadersgeodeticSurfaceNormal:()=>PZ,_shadersgetDefaultMaterial:()=>vZ,_shadersgetDynamicAtmosphereLightDirection:()=>wZ,_shadersgetLambertDiffuse:()=>FZ,_shadersgetSpecular:()=>AZ,_shadersgetWaterNoise:()=>MZ,_shadershue:()=>NZ,_shadersinfinity:()=>fR,_shadersinverseGamma:()=>kZ,_shadersisEmpty:()=>UZ,_shadersisFull:()=>DZ,_shaderslatitudeToWebMercatorFraction:()=>BZ,_shaderslineDistance:()=>YZ,_shaderslinearToSrgb:()=>OZ,_shadersluminance:()=>HZ,_shadersmaterial:()=>YR,_shadersmaterialInput:()=>OR,_shadersmaximumComponent:()=>zZ,_shadersmetersPerPixel:()=>KZ,_shadersmodelMaterial:()=>HR,_shadersmodelToWindowCoordinates:()=>JZ,_shadersmodelVertexOutput:()=>zR,_shadersmultiplyWithColorBalance:()=>QZ,_shadersnearFarScalar:()=>jZ,_shadersoctDecode:()=>qZ,_shadersoneOverPi:()=>pR,_shadersoneOverTwoPi:()=>bR,_shaderspackDepth:()=>$Z,_shaderspassCesium3DTile:()=>gR,_shaderspassCesium3DTileClassification:()=>yR,_shaderspassCesium3DTileClassificationIgnoreShow:()=>xR,_shaderspassClassification:()=>_R,_shaderspassCompute:()=>TR,_shaderspassEnvironment:()=>SR,_shaderspassGlobe:()=>CR,_shaderspassOpaque:()=>VR,_shaderspassOverlay:()=>LR,_shaderspassTerrainClassification:()=>RR,_shaderspassTranslucent:()=>ZR,_shaderspassVoxels:()=>GR,_shaderspbrLighting:()=>eG,_shaderspbrNeutralTonemapping:()=>tG,_shadersphong:()=>nG,_shaderspi:()=>ER,_shaderspiOverFour:()=>XR,_shaderspiOverSix:()=>IR,_shaderspiOverThree:()=>WR,_shaderspiOverTwo:()=>PR,_shadersplaneDistance:()=>iG,_shaderspointAlongRay:()=>oG,_shadersradiansPerDegree:()=>vR,_shadersray:()=>KR,_shadersrayEllipsoidIntersectionInterval:()=>rG,_shadersraySegment:()=>JR,_shadersraySphereIntersectionInterval:()=>sG,_shadersreadDepth:()=>aG,_shadersreadNonPerspective:()=>cG,_shadersreverseLogDepth:()=>lG,_shadersround:()=>dG,_shaderssaturation:()=>uG,_shaderssceneMode2D:()=>wR,_shaderssceneMode3D:()=>FR,_shaderssceneModeColumbusView:()=>AR,_shaderssceneModeMorphing:()=>MR,_shadersshadowDepthCompare:()=>mG,_shadersshadowParameters:()=>QR,_shadersshadowVisibility:()=>hG,_shaderssignNotZero:()=>fG,_shaderssolarRadius:()=>NR,_shaderssphericalHarmonics:()=>pG,_shaderssrgbToLinear:()=>bG,_shaderstangentToEyeSpaceMatrix:()=>gG,_shaderstextureCube:()=>yG,_shadersthreePiOver2:()=>kR,_shaderstransformPlane:()=>xG,_shaderstranslateRelativeToEye:()=>_G,_shaderstranslucentPhong:()=>TG,_shaderstranspose:()=>SG,_shaderstwoPi:()=>UR,_shadersunpackClippingExtents:()=>CG,_shadersunpackDepth:()=>VG,_shadersunpackFloat:()=>LG,_shadersunpackUint:()=>RG,_shadersvalueTransform:()=>ZG,_shadersvertexLogDepth:()=>GG,_shaderswebMercatorMaxLatitude:()=>DR,_shaderswindowToEyeCoordinates:()=>EG,_shaderswriteDepthClamp:()=>XG,_shaderswriteLogDepth:()=>IG,_shaderswriteNonPerspective:()=>WG,addBuffer:()=>GX,addDefaults:()=>_X,addExtensionsRequired:()=>LX,addExtensionsUsed:()=>yu,addPipelineExtras:()=>jb,addToArray:()=>ps,appendForwardSlash:()=>AL,arrayRemoveDuplicates:()=>xo,barycentricCoordinates:()=>mx,binarySearch:()=>Go,buildDrawCommand:()=>VI,buildModuleUrl:()=>nn,buildVoxelDrawCommands:()=>oA,clone:()=>Ye,combine:()=>_t,computeFlyToLocationForRectangle:()=>mS,createBillboardPointCallback:()=>p_,createCommand:()=>Ln,createDefaultImageryProviderViewModels:()=>vA,createDefaultTerrainProviderViewModels:()=>wA,createElevationBandMaterial:()=>t6,createGooglePhotorealistic3DTileset:()=>n6,createGuid:()=>Bn,createMaterialPropertyDescriptor:()=>Eo,createOsmBuildingsAsync:()=>i6,createPropertyDescriptor:()=>de,createRawPropertyDescriptor:()=>Sl,createTangentSpaceDebugPrimitive:()=>o6,createTaskProcessorWorker:()=>c6,createUniform:()=>QL,createUniformArray:()=>jL,createWorldBathymetryAsync:()=>lw,createWorldImageryAsync:()=>nb,createWorldTerrainAsync:()=>LT,decodeGoogleEarthEnterpriseData:()=>dw,decodeVectorPolylinePositions:()=>x2,defaultValue:()=>y,defer:()=>fl,defined:()=>l,demodernizeShader:()=>PG,deprecationWarning:()=>Es,destroyObject:()=>me,exportKml:()=>p4,findAccessorMinMax:()=>Jx,findContentMetadata:()=>T_,findGroupMetadata:()=>S_,findTileMetadata:()=>C2,forEachTextureInMaterial:()=>bC,formatError:()=>Ff,freezeRenderState:()=>gY,getAbsoluteUri:()=>Ah,getAccessorByteStride:()=>Gl,getBaseUri:()=>ML,getBinaryAccessor:()=>hd,getClipAndStyleCode:()=>l9,getClippingFunction:()=>$0,getComponentReader:()=>Bp,getElement:()=>In,getExtensionFromUri:()=>Yy,getFilenameFromUri:()=>R0,getImageFromTypedArray:()=>uw,getImagePixels:()=>hm,getJsonFromTypedArray:()=>Io,getMagic:()=>Xm,getStringFromTypedArray:()=>Vl,getTimestamp:()=>_i,hasExtension:()=>ii,heightReferenceOnEntityPropertyChanged:()=>Ip,isBitSet:()=>_c,isBlobUri:()=>Oy,isCrossOriginUrl:()=>Tb,isDataUri:()=>lp,isLeapYear:()=>mm,knockout:()=>Te,knockout_3_5_1:()=>fS,knockout_es5:()=>CA,loadAndExecuteScript:()=>Hy,loadCubeMap:()=>YG,loadImageFromTypedArray:()=>Hx,loadKTX2:()=>bl,mergeSort:()=>K0,moveTechniqueRenderStates:()=>VX,moveTechniquesToExtension:()=>RX,numberOfComponentsForType:()=>pd,objectToQuery:()=>zy,oneTimeWarning:()=>Nt,parseBatchTable:()=>jp,parseFeatureMetadataLegacy:()=>qX,parseGlb:()=>SX,parseResponseHeaders:()=>NL,parseStructuralMetadata:()=>jX,pickModel:()=>zC,pointInsideTriangle:()=>Cj,preprocess3DTileContent:()=>ff,processVoxelProperties:()=>iA,queryToObject:()=>nd,readAccessorPacked:()=>EX,removeExtension:()=>Qx,removeExtensionsRequired:()=>TX,removeExtensionsUsed:()=>Kx,removePipelineExtras:()=>CX,removeUnusedElements:()=>ZX,resizeImageToNextPowerOfTwo:()=>eg,sampleTerrain:()=>mw,sampleTerrainMostDetailed:()=>RT,scaleToGeodeticSurface:()=>By,srgbToLinear:()=>ZT,subdivideArray:()=>EE,subscribeAndEvaluate:()=>ba,updateAccessorComponentTypes:()=>XX,updateVersion:()=>IX,usesExtension:()=>or,viewerCesium3DTilesInspectorMixin:()=>X6,viewerCesiumInspectorMixin:()=>I6,viewerDragDropMixin:()=>P6,viewerPerformanceWatchdogMixin:()=>v6,viewerVoxelInspectorMixin:()=>w6,webGLConstantToGlslType:()=>Rj,wrapFunction:()=>hw,writeTextToCanvas:()=>g_});var XRo=T(S(),1);var Leo=T(S(),1);var S1t=T(S(),1);var HCt=T(S(),1);var vCt=T(S(),1);var ZCt=T(S(),1);function pCe(e){return e!=null}var l=pCe;var XCt=T(S(),1);function Uy(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(Uy.prototype=Object.create(Error.prototype),Uy.prototype.constructor=Uy);Uy.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=`
${this.stack.toString()}`),e};Uy.throwInstantiationError=function(){throw new Uy("This function defines an interface and should not be called directly.")};var pe=Uy;var hs={};hs.typeOf={};function bCe(e){return`${e} is required, actual value was undefined`}function VS(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}hs.defined=function(e,t){if(!l(t))throw new pe(bCe(e))};hs.typeOf.func=function(e,t){if(typeof t!="function")throw new pe(VS(typeof t,"function",e))};hs.typeOf.string=function(e,t){if(typeof t!="string")throw new pe(VS(typeof t,"string",e))};hs.typeOf.number=function(e,t){if(typeof t!="number")throw new pe(VS(typeof t,"number",e))};hs.typeOf.number.lessThan=function(e,t,n){if(hs.typeOf.number(e,t),t>=n)throw new pe(`Expected ${e} to be less than ${n}, actual value was ${t}`)};hs.typeOf.number.lessThanOrEquals=function(e,t,n){if(hs.typeOf.number(e,t),t>n)throw new pe(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};hs.typeOf.number.greaterThan=function(e,t,n){if(hs.typeOf.number(e,t),t<=n)throw new pe(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};hs.typeOf.number.greaterThanOrEquals=function(e,t,n){if(hs.typeOf.number(e,t),t<n)throw new pe(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)};hs.typeOf.object=function(e,t){if(typeof t!="object")throw new pe(VS(typeof t,"object",e))};hs.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new pe(VS(typeof t,"boolean",e))};hs.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new pe(VS(typeof t,"bigint",e))};hs.typeOf.number.equals=function(e,t,n,i){if(hs.typeOf.number(e,n),hs.typeOf.number(t,i),n!==i)throw new pe(`${e} must be equal to ${t}, the actual values are ${n} and ${i}`)};var go=hs;var FCt=T(S(),1);function oq(e,t){return e??t}oq.EMPTY_OBJECT=Object.freeze({});var y=oq;var UCt=T(S(),1),GB=T(VM(),1);var dt={};dt.EPSILON1=.1;dt.EPSILON2=.01;dt.EPSILON3=.001;dt.EPSILON4=1e-4;dt.EPSILON5=1e-5;dt.EPSILON6=1e-6;dt.EPSILON7=1e-7;dt.EPSILON8=1e-8;dt.EPSILON9=1e-9;dt.EPSILON10=1e-10;dt.EPSILON11=1e-11;dt.EPSILON12=1e-12;dt.EPSILON13=1e-13;dt.EPSILON14=1e-14;dt.EPSILON15=1e-15;dt.EPSILON16=1e-16;dt.EPSILON17=1e-17;dt.EPSILON18=1e-18;dt.EPSILON19=1e-19;dt.EPSILON20=1e-20;dt.EPSILON21=1e-21;dt.GRAVITATIONALPARAMETER=3986004418e5;dt.SOLAR_RADIUS=6955e5;dt.LUNAR_RADIUS=1737400;dt.SIXTY_FOUR_KILOBYTES=64*1024;dt.FOUR_GIGABYTES=4*1024*1024*1024;dt.sign=y(Math.sign,function(t){return t=+t,t===0||t!==t?t:t>0?1:-1});dt.signNotZero=function(e){return e<0?-1:1};dt.toSNorm=function(e,t){return t=y(t,255),Math.round((dt.clamp(e,-1,1)*.5+.5)*t)};dt.fromSNorm=function(e,t){return t=y(t,255),dt.clamp(e,0,t)/t*2-1};dt.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:dt.clamp((e-t)/n,0,1)};dt.sinh=y(Math.sinh,function(t){return(Math.exp(t)-Math.exp(-t))/2});dt.cosh=y(Math.cosh,function(t){return(Math.exp(t)+Math.exp(-t))/2});dt.lerp=function(e,t,n){return(1-n)*e+n*t};dt.PI=Math.PI;dt.ONE_OVER_PI=1/Math.PI;dt.PI_OVER_TWO=Math.PI/2;dt.PI_OVER_THREE=Math.PI/3;dt.PI_OVER_FOUR=Math.PI/4;dt.PI_OVER_SIX=Math.PI/6;dt.THREE_PI_OVER_TWO=3*Math.PI/2;dt.TWO_PI=2*Math.PI;dt.ONE_OVER_TWO_PI=1/(2*Math.PI);dt.RADIANS_PER_DEGREE=Math.PI/180;dt.DEGREES_PER_RADIAN=180/Math.PI;dt.RADIANS_PER_ARCSECOND=dt.RADIANS_PER_DEGREE/3600;dt.toRadians=function(e){return e*dt.RADIANS_PER_DEGREE};dt.toDegrees=function(e){return e*dt.DEGREES_PER_RADIAN};dt.convertLongitudeRange=function(e){let t=dt.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};dt.clampToLatitudeRange=function(e){return dt.clamp(e,-1*dt.PI_OVER_TWO,dt.PI_OVER_TWO)};dt.negativePiToPi=function(e){return e>=-dt.PI&&e<=dt.PI?e:dt.zeroToTwoPi(e+dt.PI)-dt.PI};dt.zeroToTwoPi=function(e){if(e>=0&&e<=dt.TWO_PI)return e;let t=dt.mod(e,dt.TWO_PI);return Math.abs(t)<dt.EPSILON14&&Math.abs(e)>dt.EPSILON14?dt.TWO_PI:t};dt.mod=function(e,t){return dt.sign(e)===dt.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t};dt.equalsEpsilon=function(e,t,n,i){n=y(n,0),i=y(i,n);let o=Math.abs(e-t);return o<=i||o<=n*Math.max(Math.abs(e),Math.abs(t))};dt.lessThan=function(e,t,n){return e-t<-n};dt.lessThanOrEquals=function(e,t,n){return e-t<n};dt.greaterThan=function(e,t,n){return e-t>n};dt.greaterThanOrEquals=function(e,t,n){return e-t>-n};var LM=[1];dt.factorial=function(e){let t=LM.length;if(e>=t){let n=LM[t-1];for(let i=t;i<=e;i++){let o=n*i;LM.push(o),n=o}}return LM[e]};dt.incrementWrap=function(e,t,n){return n=y(n,0),++e,e>t&&(e=n),e};dt.isPowerOfTwo=function(e){return e!==0&&(e&e-1)===0};dt.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};dt.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};dt.clamp=function(e,t,n){return e<t?t:e>n?n:e};var sq=new GB.default;dt.setRandomNumberSeed=function(e){sq=new GB.default(e)};dt.nextRandomNumber=function(){return sq.random()};dt.randomBetween=function(e,t){return dt.nextRandomNumber()*(t-e)+e};dt.acosClamped=function(e){return Math.acos(dt.clamp(e,-1,1))};dt.asinClamped=function(e){return Math.asin(dt.clamp(e,-1,1))};dt.chordLength=function(e,t){return 2*t*Math.sin(e*.5)};dt.logBase=function(e,t){return Math.log(e)/Math.log(t)};dt.cbrt=y(Math.cbrt,function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n});dt.log2=y(Math.log2,function(t){return Math.log(t)*Math.LOG2E});dt.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};dt.fastApproximateAtan=function(e){return e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};dt.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=dt.fastApproximateAtan(r),i=Math.abs(t)>Math.abs(e)?dt.PI_OVER_TWO-i:i,i=e<0?dt.PI-i:i,i=t<0?-i:i,i};var W=dt;function et(e,t,n){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0)}et.fromSpherical=function(e,t){l(t)||(t=new et);let n=e.clock,i=e.cone,o=y(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=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t};et.unpack=function(e,t,n){return t=y(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 ZM=new et;et.distance=function(e,t){return et.subtract(e,t,ZM),et.magnitude(ZM)};et.distanceSquared=function(e,t){return et.subtract(e,t,ZM),et.magnitudeSquared(ZM)};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 aq=new et;et.lerp=function(e,t,n,i){return et.multiplyByScalar(t,n,aq),i=et.multiplyByScalar(e,1-n,i),et.add(aq,i,i)};var RM=new et,EB=new et;et.angleBetween=function(e,t){et.normalize(e,RM),et.normalize(t,EB);let n=et.dot(RM,EB),i=et.magnitude(et.cross(RM,EB,RM));return Math.atan2(i,n)};var gCe=new et;et.mostOrthogonalAxis=function(e,t){let n=et.normalize(e,gCe);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 iu=new et,LS=new et;et._ellipsoidRadiiSquared=new et(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);et.fromRadians=function(e,t,n,i,o){n=y(n,0);let r=l(i)?i.radiiSquared:et._ellipsoidRadiiSquared,s=Math.cos(t);iu.x=s*Math.cos(e),iu.y=s*Math.sin(e),iu.z=Math.sin(t),iu=et.normalize(iu,iu),et.multiplyComponents(r,iu,LS);let a=Math.sqrt(et.dot(iu,LS));return LS=et.divideByScalar(LS,a,LS),iu=et.multiplyByScalar(iu,n,iu),l(o)||(o=new et),et.add(LS,iu,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 p1t=T(S(),1);var jCt=T(S(),1);function xt(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0),this.w=y(i,0)}xt.fromElements=function(e,t,n,i,o){return l(o)?(o.x=e,o.y=t,o.z=n,o.w=i,o):new xt(e,t,n,i)};xt.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 xt(e.red,e.green,e.blue,e.alpha)};xt.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 xt(e.x,e.y,e.z,e.w)};xt.packedLength=4;xt.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};xt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new xt),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n};xt.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)xt.pack(e[o],t,o*4);return t};xt.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]=xt.unpack(e,i,t[o])}return t};xt.fromArray=xt.unpack;xt.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)};xt.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)};xt.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};xt.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};xt.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};xt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};xt.magnitude=function(e){return Math.sqrt(xt.magnitudeSquared(e))};var GM=new xt;xt.distance=function(e,t){return xt.subtract(e,t,GM),xt.magnitude(GM)};xt.distanceSquared=function(e,t){return xt.subtract(e,t,GM),xt.magnitudeSquared(GM)};xt.normalize=function(e,t){let n=xt.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t};xt.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};xt.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};xt.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};xt.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};xt.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};xt.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};xt.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};xt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};xt.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 cq=new xt;xt.lerp=function(e,t,n,i){return xt.multiplyByScalar(t,n,cq),i=xt.multiplyByScalar(e,1-n,i),xt.add(cq,i,i)};var yCe=new xt;xt.mostOrthogonalAxis=function(e,t){let n=xt.normalize(e,yCe);return xt.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=xt.clone(xt.UNIT_X,t):t=xt.clone(xt.UNIT_W,t):n.z<=n.w?t=xt.clone(xt.UNIT_Z,t):t=xt.clone(xt.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=xt.clone(xt.UNIT_Y,t):t=xt.clone(xt.UNIT_W,t):n.z<=n.w?t=xt.clone(xt.UNIT_Z,t):t=xt.clone(xt.UNIT_W,t),t};xt.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};xt.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]};xt.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)};xt.ZERO=Object.freeze(new xt(0,0,0,0));xt.ONE=Object.freeze(new xt(1,1,1,1));xt.UNIT_X=Object.freeze(new xt(1,0,0,0));xt.UNIT_Y=Object.freeze(new xt(0,1,0,0));xt.UNIT_Z=Object.freeze(new xt(0,0,1,0));xt.UNIT_W=Object.freeze(new xt(0,0,0,1));xt.prototype.clone=function(e){return xt.clone(this,e)};xt.prototype.equals=function(e){return xt.equals(this,e)};xt.prototype.equalsEpsilon=function(e,t,n){return xt.equalsEpsilon(this,e,t,n)};xt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var XB=new Float32Array(1),Ha=new Uint8Array(XB.buffer),xCe=new Uint32Array([287454020]),_Ce=new Uint8Array(xCe.buffer),lq=_Ce[0]===68;xt.packFloat=function(e,t){return l(t)||(t=new xt),XB[0]=e,lq?(t.x=Ha[0],t.y=Ha[1],t.z=Ha[2],t.w=Ha[3]):(t.x=Ha[3],t.y=Ha[2],t.z=Ha[1],t.w=Ha[0]),t};xt.unpackFloat=function(e){return lq?(Ha[0]=e.x,Ha[1]=e.y,Ha[2]=e.z,Ha[3]=e.w):(Ha[0]=e.w,Ha[1]=e.z,Ha[2]=e.y,Ha[3]=e.x),XB[0]};var se=xt;var i1t=T(S(),1);function ot(e,t,n,i,o,r,s,a,c){this[0]=y(e,0),this[1]=y(i,0),this[2]=y(s,0),this[3]=y(t,0),this[4]=y(o,0),this[5]=y(a,0),this[6]=y(n,0),this[7]=y(r,0),this[8]=y(c,0)}ot.packedLength=9;ot.pack=function(e,t,n){return n=y(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};ot.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new ot),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};ot.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)ot.pack(e[o],t,o*9);return t};ot.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]=ot.unpack(e,i,t[o])}return t};ot.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 ot(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])};ot.fromArray=ot.unpack;ot.fromColumnMajorArray=function(e,t){return ot.clone(e,t)};ot.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 ot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])};ot.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,g=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]=g,t[4]=_,t[5]=L,t[6]=f,t[7]=C,t[8]=Z,t):new ot(p,g,f,x,_,C,V,L,Z)};ot.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,g=-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]=g,t[8]=_,t):new ot(c,d,u,m,p,g,f,x,_)};ot.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 ot(e.x,0,0,0,e.y,0,0,0,e.z)};ot.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 ot(e,0,0,0,e,0,0,0,e)};ot.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 ot(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)};ot.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 ot(1,0,0,0,n,-i,0,i,n)};ot.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 ot(n,0,i,0,1,0,-i,0,n)};ot.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 ot(n,-i,0,i,n,0,0,0,1)};ot.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]]};ot.getElementIndex=function(e,t){return e*3+t};ot.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};ot.setColumn=function(e,t,n,i){i=ot.clone(e,i);let o=t*3;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i};ot.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};ot.setRow=function(e,t,n,i){return i=ot.clone(e,i),i[t]=n.x,i[t+3]=n.y,i[t+6]=n.z,i};var TCe=new h;ot.setScale=function(e,t,n){let i=ot.getScale(e,TCe),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 SCe=new h;ot.setUniformScale=function(e,t,n){let i=ot.getScale(e,SCe),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 IB=new h;ot.getScale=function(e,t){return t.x=h.magnitude(h.fromElements(e[0],e[1],e[2],IB)),t.y=h.magnitude(h.fromElements(e[3],e[4],e[5],IB)),t.z=h.magnitude(h.fromElements(e[6],e[7],e[8],IB)),t};var dq=new h;ot.getMaximumScale=function(e){return ot.getScale(e,dq),h.maximumComponent(dq)};var CCe=new h;ot.setRotation=function(e,t,n){let i=ot.getScale(e,CCe);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 VCe=new h;ot.getRotation=function(e,t){let n=ot.getScale(e,VCe);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};ot.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};ot.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};ot.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};ot.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};ot.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};ot.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};ot.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};ot.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};ot.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 LCe(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var WB=[1,0,0],PB=[2,2,1];function RCe(e){let t=0;for(let n=0;n<3;++n){let i=e[ot.getElementIndex(PB[n],WB[n])];t+=2*i*i}return Math.sqrt(t)}function ZCe(e,t){let n=W.EPSILON15,i=0,o=1;for(let d=0;d<3;++d){let u=Math.abs(e[ot.getElementIndex(PB[d],WB[d])]);u>i&&(o=d,i=u)}let r=1,s=0,a=WB[o],c=PB[o];if(Math.abs(e[ot.getElementIndex(c,a)])>n){let d=e[ot.getElementIndex(c,c)],u=e[ot.getElementIndex(a,a)],m=e[ot.getElementIndex(c,a)],p=(d-u)/2/m,g;p<0?g=-1/(-p+Math.sqrt(1+p*p)):g=1/(p+Math.sqrt(1+p*p)),r=1/Math.sqrt(1+g*g),s=g*r}return t=ot.clone(ot.IDENTITY,t),t[ot.getElementIndex(a,a)]=t[ot.getElementIndex(c,c)]=r,t[ot.getElementIndex(c,a)]=s,t[ot.getElementIndex(a,c)]=-s,t}var EM=new ot,uq=new ot;ot.computeEigenDecomposition=function(e,t){let n=W.EPSILON20,i=10,o=0,r=0;l(t)||(t={});let s=t.unitary=ot.clone(ot.IDENTITY,t.unitary),a=t.diagonal=ot.clone(e,t.diagonal),c=n*LCe(a);for(;r<i&&RCe(a)>c;)ZCe(a,EM),ot.transpose(EM,uq),ot.multiply(a,EM,a),ot.multiply(uq,a,a),ot.multiply(s,EM,s),++o>2&&(++r,o=0);return t};ot.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};ot.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)};ot.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=ot.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 ot.multiplyByScalar(t,p,t)};var GCe=new ot;ot.inverseTranspose=function(e,t){return ot.inverse(ot.transpose(e,GCe),t)};ot.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]};ot.equalsEpsilon=function(e,t,n){return n=y(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};ot.IDENTITY=Object.freeze(new ot(1,0,0,0,1,0,0,0,1));ot.ZERO=Object.freeze(new ot(0,0,0,0,0,0,0,0,0));ot.COLUMN0ROW0=0;ot.COLUMN0ROW1=1;ot.COLUMN0ROW2=2;ot.COLUMN1ROW0=3;ot.COLUMN1ROW1=4;ot.COLUMN1ROW2=5;ot.COLUMN2ROW0=6;ot.COLUMN2ROW1=7;ot.COLUMN2ROW2=8;Object.defineProperties(ot.prototype,{length:{get:function(){return ot.packedLength}}});ot.prototype.clone=function(e){return ot.clone(this,e)};ot.prototype.equals=function(e){return ot.equals(this,e)};ot.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]};ot.prototype.equalsEpsilon=function(e,t){return ot.equalsEpsilon(this,e,t)};ot.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]})
(${this[1]}, ${this[4]}, ${this[7]})
(${this[2]}, ${this[5]}, ${this[8]})`};var $=ot;var s1t=T(S(),1);function vL(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(vL.prototype=Object.create(Error.prototype),vL.prototype.constructor=vL);vL.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=`
${this.stack.toString()}`),e};var ue=vL;function it(e,t,n,i,o,r,s,a,c,d,u,m,p,g,f,x){this[0]=y(e,0),this[1]=y(o,0),this[2]=y(c,0),this[3]=y(p,0),this[4]=y(t,0),this[5]=y(r,0),this[6]=y(d,0),this[7]=y(g,0),this[8]=y(n,0),this[9]=y(s,0),this[10]=y(u,0),this[11]=y(f,0),this[12]=y(i,0),this[13]=y(a,0),this[14]=y(m,0),this[15]=y(x,0)}it.packedLength=16;it.pack=function(e,t,n){return n=y(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};it.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new it),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};it.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)it.pack(e[o],t,o*16);return t};it.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]=it.unpack(e,i,t[o])}return t};it.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 it(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])};it.fromArray=it.unpack;it.fromColumnMajorArray=function(e,t){return it.clone(e,t)};it.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 it(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])};it.fromRotationTranslation=function(e,t,n){return t=y(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 it(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)};it.fromTranslationQuaternionRotationScale=function(e,t,n,i){l(i)||(i=new it);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,g=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+g),Z=2*(c+x),E=-a+m-f+_,X=2*(p-u),v=2*(d-g),P=2*(p+u),A=-a-m+f+_;return i[0]=C*o,i[1]=Z*o,i[2]=v*o,i[3]=0,i[4]=V*r,i[5]=E*r,i[6]=P*r,i[7]=0,i[8]=L*s,i[9]=X*s,i[10]=A*s,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i};it.fromTranslationRotationScale=function(e,t){return it.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};it.fromTranslation=function(e,t){return it.fromRotationTranslation($.IDENTITY,e,t)};it.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 it(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};it.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 it(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};it.fromRotation=function(e,t){return l(t)||(t=new it),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 RS=new h,ZS=new h,wL=new h;it.fromCamera=function(e,t){let n=e.position,i=e.direction,o=e.up;h.normalize(i,RS),h.normalize(h.cross(RS,o,ZS),ZS),h.normalize(h.cross(ZS,RS,wL),wL);let r=ZS.x,s=ZS.y,a=ZS.z,c=RS.x,d=RS.y,u=RS.z,m=wL.x,p=wL.y,g=wL.z,f=n.x,x=n.y,_=n.z,C=r*-f+s*-x+a*-_,V=m*-f+p*-x+g*-_,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]=g,t[10]=-u,t[11]=0,t[12]=C,t[13]=V,t[14]=L,t[15]=1,t):new it(r,s,a,C,m,p,g,V,-c,-d,-u,L,0,0,0,1)};it.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};it.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};it.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,g=-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]=g,s[15]=0,s};it.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};it.computeViewportTransformation=function(e,t,n,i){l(i)||(i=new it),e=y(e,y.EMPTY_OBJECT);let o=y(e.x,0),r=y(e.y,0),s=y(e.width,0),a=y(e.height,0);t=y(t,0),n=y(n,1);let c=s*.5,d=a*.5,u=(n-t)*.5,m=c,p=d,g=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]=g,i[11]=0,i[12]=f,i[13]=x,i[14]=_,i[15]=C,i};it.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};it.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]]};it.getElementIndex=function(e,t){return e*4+t};it.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};it.setColumn=function(e,t,n,i){i=it.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};it.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};it.setRow=function(e,t,n,i){return i=it.clone(e,i),i[t]=n.x,i[t+4]=n.y,i[t+8]=n.z,i[t+12]=n.w,i};it.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 ECe=new h;it.setScale=function(e,t,n){let i=it.getScale(e,ECe),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 XCe=new h;it.setUniformScale=function(e,t,n){let i=it.getScale(e,XCe),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 vB=new h;it.getScale=function(e,t){return t.x=h.magnitude(h.fromElements(e[0],e[1],e[2],vB)),t.y=h.magnitude(h.fromElements(e[4],e[5],e[6],vB)),t.z=h.magnitude(h.fromElements(e[8],e[9],e[10],vB)),t};var mq=new h;it.getMaximumScale=function(e){return it.getScale(e,mq),h.maximumComponent(mq)};var ICe=new h;it.setRotation=function(e,t,n){let i=it.getScale(e,ICe);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 WCe=new h;it.getRotation=function(e,t){let n=it.getScale(e,WCe);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};it.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],g=e[10],f=e[11],x=e[12],_=e[13],C=e[14],V=e[15],L=t[0],Z=t[1],E=t[2],X=t[3],v=t[4],P=t[5],A=t[6],M=t[7],b=t[8],R=t[9],G=t[10],I=t[11],w=t[12],N=t[13],B=t[14],U=t[15],O=i*L+a*Z+m*E+x*X,k=o*L+c*Z+p*E+_*X,J=r*L+d*Z+g*E+C*X,H=s*L+u*Z+f*E+V*X,te=i*v+a*P+m*A+x*M,z=o*v+c*P+p*A+_*M,j=r*v+d*P+g*A+C*M,ee=s*v+u*P+f*A+V*M,fe=i*b+a*R+m*G+x*I,_e=o*b+c*R+p*G+_*I,le=r*b+d*R+g*G+C*I,ge=s*b+u*R+f*G+V*I,Se=i*w+a*N+m*B+x*U,Ie=o*w+c*N+p*B+_*U,Le=r*w+d*N+g*B+C*U,ke=s*w+u*N+f*B+V*U;return n[0]=O,n[1]=k,n[2]=J,n[3]=H,n[4]=te,n[5]=z,n[6]=j,n[7]=ee,n[8]=fe,n[9]=_e,n[10]=le,n[11]=ge,n[12]=Se,n[13]=Ie,n[14]=Le,n[15]=ke,n};it.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};it.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};it.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],g=e[13],f=e[14],x=t[0],_=t[1],C=t[2],V=t[4],L=t[5],Z=t[6],E=t[8],X=t[9],v=t[10],P=t[12],A=t[13],M=t[14],b=i*x+s*_+d*C,R=o*x+a*_+u*C,G=r*x+c*_+m*C,I=i*V+s*L+d*Z,w=o*V+a*L+u*Z,N=r*V+c*L+m*Z,B=i*E+s*X+d*v,U=o*E+a*X+u*v,O=r*E+c*X+m*v,k=i*P+s*A+d*M+p,J=o*P+a*A+u*M+g,H=r*P+c*A+m*M+f;return n[0]=b,n[1]=R,n[2]=G,n[3]=0,n[4]=I,n[5]=w,n[6]=N,n[7]=0,n[8]=B,n[9]=U,n[10]=O,n[11]=0,n[12]=k,n[13]=J,n[14]=H,n[15]=1,n};it.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],g=t[1],f=t[2],x=t[3],_=t[4],C=t[5],V=t[6],L=t[7],Z=t[8],E=i*p+s*g+d*f,X=o*p+a*g+u*f,v=r*p+c*g+m*f,P=i*x+s*_+d*C,A=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,G=r*V+c*L+m*Z;return n[0]=E,n[1]=X,n[2]=v,n[3]=0,n[4]=P,n[5]=A,n[6]=M,n[7]=0,n[8]=b,n[9]=R,n[10]=G,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};it.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};it.multiplyByScale=function(e,t,n){let i=t.x,o=t.y,r=t.z;return i===1&&o===1&&r===1?it.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)};it.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};it.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};it.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};it.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};it.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};it.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};it.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};it.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};it.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]};it.equalsEpsilon=function(e,t,n){return n=y(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};it.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t};it.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 PCe=new $,vCe=new $,wCe=new se,FCe=new se(0,0,0,1);it.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],g=e[14],f=e[3],x=e[7],_=e[11],C=e[15],V=p*C,L=g*_,Z=m*C,E=g*x,X=m*_,v=p*x,P=u*C,A=g*f,M=u*_,b=p*f,R=u*x,G=m*f,I=V*a+E*c+X*d-(L*a+Z*c+v*d),w=L*s+P*c+b*d-(V*s+A*c+M*d),N=Z*s+A*a+R*d-(E*s+P*a+G*d),B=v*s+M*a+G*c-(X*s+b*a+R*c),U=L*i+Z*o+v*r-(V*i+E*o+X*r),O=V*n+A*o+M*r-(L*n+P*o+b*r),k=E*n+P*i+G*r-(Z*n+A*i+R*r),J=X*n+b*i+R*o-(v*n+M*i+G*o);V=o*d,L=r*c,Z=i*d,E=r*a,X=i*c,v=o*a,P=n*d,A=r*s,M=n*c,b=o*s,R=n*a,G=i*s;let H=V*x+E*_+X*C-(L*x+Z*_+v*C),te=L*f+P*_+b*C-(V*f+A*_+M*C),z=Z*f+A*x+R*C-(E*f+P*x+G*C),j=v*f+M*x+G*_-(X*f+b*x+R*_),ee=Z*p+v*g+L*m-(X*g+V*m+E*p),fe=M*g+V*u+A*p-(P*p+b*g+L*u),_e=P*m+G*g+E*u-(R*g+Z*u+A*m),le=R*p+X*u+b*m-(M*m+G*p+v*u),ge=n*I+i*w+o*N+r*B;if(Math.abs(ge)<W.EPSILON21){if($.equalsEpsilon(it.getMatrix3(e,PCe),vCe,W.EPSILON7)&&se.equals(it.getRow(e,3,wCe),FCe))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 ue("matrix is not invertible because its determinate is zero.")}return ge=1/ge,t[0]=I*ge,t[1]=w*ge,t[2]=N*ge,t[3]=B*ge,t[4]=U*ge,t[5]=O*ge,t[6]=k*ge,t[7]=J*ge,t[8]=H*ge,t[9]=te*ge,t[10]=z*ge,t[11]=j*ge,t[12]=ee*ge,t[13]=fe*ge,t[14]=_e*ge,t[15]=le*ge,t};it.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],g=e[14],f=-n*m-i*p-o*g,x=-r*m-s*p-a*g,_=-c*m-d*p-u*g;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 ACe=new it;it.inverseTranspose=function(e,t){return it.inverse(it.transpose(e,ACe),t)};it.IDENTITY=Object.freeze(new it(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));it.ZERO=Object.freeze(new it(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));it.COLUMN0ROW0=0;it.COLUMN0ROW1=1;it.COLUMN0ROW2=2;it.COLUMN0ROW3=3;it.COLUMN1ROW0=4;it.COLUMN1ROW1=5;it.COLUMN1ROW2=6;it.COLUMN1ROW3=7;it.COLUMN2ROW0=8;it.COLUMN2ROW1=9;it.COLUMN2ROW2=10;it.COLUMN2ROW3=11;it.COLUMN3ROW0=12;it.COLUMN3ROW1=13;it.COLUMN3ROW2=14;it.COLUMN3ROW3=15;Object.defineProperties(it.prototype,{length:{get:function(){return it.packedLength}}});it.prototype.clone=function(e){return it.clone(this,e)};it.prototype.equals=function(e){return it.equals(this,e)};it.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]};it.prototype.equalsEpsilon=function(e,t){return it.equalsEpsilon(this,e,t)};it.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 F=it;var g1t=T(S(),1),MCe={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},ie=Object.freeze(MCe);var NCe=new h;function Et(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var Qs={};Qs[ie.FLOAT]="float";Qs[ie.FLOAT_VEC2]="vec2";Qs[ie.FLOAT_VEC3]="vec3";Qs[ie.FLOAT_VEC4]="vec4";Qs[ie.INT]="int";Qs[ie.INT_VEC2]="ivec2";Qs[ie.INT_VEC3]="ivec3";Qs[ie.INT_VEC4]="ivec4";Qs[ie.BOOL]="bool";Qs[ie.BOOL_VEC2]="bvec2";Qs[ie.BOOL_VEC3]="bvec3";Qs[ie.BOOL_VEC4]="bvec4";Qs[ie.FLOAT_MAT2]="mat2";Qs[ie.FLOAT_MAT3]="mat3";Qs[ie.FLOAT_MAT4]="mat4";Qs[ie.SAMPLER_2D]="sampler2D";Qs[ie.SAMPLER_CUBE]="samplerCube";Et.prototype.getDeclaration=function(e){let t=`uniform ${Qs[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var kCe={czm_viewport:new Et({size:1,datatype:ie.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new Et({size:1,datatype:ie.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_model:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new Et({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new Et({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new Et({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new Et({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new Et({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new Et({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new Et({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new Et({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeHeight2D:new Et({size:1,datatype:ie.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_eyeEllipsoidNormalEC:new Et({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.eyeEllipsoidNormalEC}}),czm_eyeEllipsoidCurvature:new Et({size:1,datatype:ie.FLOAT_VEC2,getValue:function(e){return e.eyeEllipsoidCurvature}}),czm_modelToEnu:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelToEnu}}),czm_enuToModel:new Et({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.enuToModel}}),czm_entireFrustum:new Et({size:1,datatype:ie.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new Et({size:1,datatype:ie.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new Et({size:1,datatype:ie.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new Et({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new Et({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new Et({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new Et({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new Et({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new Et({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new Et({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new Et({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new Et({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new Et({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new Et({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new Et({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return F.getTranslation(e.inverseView,NCe)}}),czm_frameNumber:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new Et({size:1,datatype:ie.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new Et({size:1,datatype:ie.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new Et({size:1,datatype:ie.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new Et({size:1,datatype:ie.SAMPLER_2D,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapsMaximumLOD:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new Et({size:9,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new Et({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.fogDensity}}),czm_fogMinimumBrightness:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.fogMinimumBrightness}}),czm_atmosphereHsbShift:new Et({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.atmosphereHsbShift}}),czm_atmosphereLightIntensity:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.atmosphereLightIntensity}}),czm_atmosphereRayleighCoefficient:new Et({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.atmosphereRayleighCoefficient}}),czm_atmosphereRayleighScaleHeight:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.atmosphereRayleighScaleHeight}}),czm_atmosphereMieCoefficient:new Et({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.atmosphereMieCoefficient}}),czm_atmosphereMieScaleHeight:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.atmosphereMieScaleHeight}}),czm_atmosphereMieAnisotropy:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.atmosphereMieAnisotropy}}),czm_atmosphereDynamicLighting:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.atmosphereDynamicLighting}}),czm_splitPosition:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new Et({size:1,datatype:ie.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new Et({size:1,datatype:ie.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new Et({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new Et({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})},sp=kCe;var B1t=T(S(),1);var V1t=T(S(),1);function UCe(){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 Bn=UCe;var Z1t=T(S(),1);function DCe(){return!0}function BCe(e,t){t=y(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=DCe}var me=BCe;var W1t=T(S(),1);var Gs={UNSIGNED_BYTE:ie.UNSIGNED_BYTE,UNSIGNED_SHORT:ie.UNSIGNED_SHORT,UNSIGNED_INT:ie.UNSIGNED_INT};Gs.getSizeInBytes=function(e){switch(e){case Gs.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Gs.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Gs.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}};Gs.fromSizeInBytes=function(e){switch(e){case 2:return Gs.UNSIGNED_SHORT;case 4:return Gs.UNSIGNED_INT;case 1:return Gs.UNSIGNED_BYTE}};Gs.validate=function(e){return l(e)&&(e===Gs.UNSIGNED_BYTE||e===Gs.UNSIGNED_SHORT||e===Gs.UNSIGNED_INT)};Gs.createTypedArray=function(e,t){return e>=W.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};Gs.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=W.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};Gs.fromTypedArray=function(e){if(e instanceof Uint8Array)return Gs.UNSIGNED_BYTE;if(e instanceof Uint16Array)return Gs.UNSIGNED_SHORT;if(e instanceof Uint32Array)return Gs.UNSIGNED_INT};var Ae=Object.freeze(Gs);var w1t=T(S(),1);var XM={STREAM_DRAW:ie.STREAM_DRAW,STATIC_DRAW:ie.STATIC_DRAW,DYNAMIC_DRAW:ie.DYNAMIC_DRAW,validate:function(e){return e===XM.STREAM_DRAW||e===XM.STATIC_DRAW||e===XM.DYNAMIC_DRAW}},Me=Object.freeze(XM);function ou(e){e=y(e,y.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=Bn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=o,this._usage=r,this._buffer=a,this.vertexArrayDestroyable=!0}ou.createVertexBuffer=function(e){return new ou({context:e.context,bufferTarget:ie.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};ou.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=Ae.getSizeInBytes(n),o=new ou({context:t,bufferTarget:ie.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(ou.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});ou.prototype._getBuffer=function(){return this._buffer};ou.prototype.copyFromArrayView=function(e,t){t=y(t,0);let n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)};ou.prototype.copyFromBuffer=function(e,t,n,i){let o=ie.COPY_READ_BUFFER,r=ie.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)};ou.prototype.getBufferData=function(e,t,n,i){t=y(t,0),n=y(n,0);let o=this._gl,r=ie.COPY_READ_BUFFER;o.bindBuffer(r,this._buffer),o.getBufferSubData(r,t,e,n,i),o.bindBuffer(r,null)};ou.prototype.isDestroyed=function(){return!1};ou.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),me(this)};var yt=ou;var aVt=T(S(),1);var iVt=T(S(),1);var j1t=T(S(),1);var H1t=T(S(),1);var yb,Lr={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},hl={};Object.defineProperties(hl,{element:{get:function(){if(hl.supportsFullscreen())return document[Lr.fullscreenElement]}},changeEventName:{get:function(){if(hl.supportsFullscreen())return Lr.fullscreenchange}},errorEventName:{get:function(){if(hl.supportsFullscreen())return Lr.fullscreenerror}},enabled:{get:function(){if(hl.supportsFullscreen())return document[Lr.fullscreenEnabled]}},fullscreen:{get:function(){if(hl.supportsFullscreen())return hl.element!==null}}});hl.supportsFullscreen=function(){if(l(yb))return yb;yb=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return Lr.requestFullscreen="requestFullscreen",Lr.exitFullscreen="exitFullscreen",Lr.fullscreenEnabled="fullscreenEnabled",Lr.fullscreenElement="fullscreenElement",Lr.fullscreenchange="fullscreenchange",Lr.fullscreenerror="fullscreenerror",yb=!0,yb;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"?(Lr.requestFullscreen=n,yb=!0):(n=`${r}RequestFullScreen`,typeof e[n]=="function"&&(Lr.requestFullscreen=n,yb=!0)),n=`${r}ExitFullscreen`,typeof document[n]=="function"?Lr.exitFullscreen=n:(n=`${r}CancelFullScreen`,typeof document[n]=="function"&&(Lr.exitFullscreen=n)),n=`${r}FullscreenEnabled`,document[n]!==void 0?Lr.fullscreenEnabled=n:(n=`${r}FullScreenEnabled`,document[n]!==void 0&&(Lr.fullscreenEnabled=n)),n=`${r}FullscreenElement`,document[n]!==void 0?Lr.fullscreenElement=n:(n=`${r}FullScreenElement`,document[n]!==void 0&&(Lr.fullscreenElement=n)),n=`${r}fullscreenchange`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenChange"),Lr.fullscreenchange=n),n=`${r}fullscreenerror`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenError"),Lr.fullscreenerror=n)}return yb};hl.requestFullscreen=function(e,t){hl.supportsFullscreen()&&e[Lr.requestFullscreen]({vrDisplay:t})};hl.exitFullscreen=function(){hl.supportsFullscreen()&&document[Lr.exitFullscreen]()};hl._names=Lr;var mr=hl;var za;typeof navigator<"u"?za=navigator:za={};function Dy(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,hq;function kB(){if(!l(IM)&&(IM=!1,!AM())){let e=/ Chrome\/([\.0-9]+)/.exec(za.userAgent);e!==null&&(IM=!0,hq=Dy(e[1]))}return IM}function YCe(){return kB()&&hq}var WM,fq;function pq(){if(!l(WM)&&(WM=!1,!kB()&&!AM()&&/ Safari\/[\.0-9]+/.test(za.userAgent))){let e=/ Version\/([\.0-9]+)/.exec(za.userAgent);e!==null&&(WM=!0,fq=Dy(e[1]))}return WM}function OCe(){return pq()&&fq}var PM,MB;function bq(){if(!l(PM)){PM=!1;let e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(za.userAgent);e!==null&&(PM=!0,MB=Dy(e[1]),MB.isNightly=!!e[2])}return PM}function HCe(){return bq()&&MB}var FL,NB;function gq(){if(!l(FL)){FL=!1;let e;za.appName==="Microsoft Internet Explorer"?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(za.userAgent),e!==null&&(FL=!0,NB=Dy(e[1]))):za.appName==="Netscape"&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(za.userAgent),e!==null&&(FL=!0,NB=Dy(e[1])))}return FL}function zCe(){return gq()&&NB}var vM,yq;function AM(){if(!l(vM)){vM=!1;let e=/ Edg\/([\.0-9]+)/.exec(za.userAgent);e!==null&&(vM=!0,yq=Dy(e[1]))}return vM}function KCe(){return AM()&&yq}var wM,UB;function MM(){if(!l(wM)){wM=!1;let e=/Firefox\/([\.0-9]+)/.exec(za.userAgent);e!==null&&(wM=!0,UB=Dy(e[1]))}return wM}var wB;function JCe(){return l(wB)||(wB=/Windows/i.test(za.appVersion)),wB}var FB;function QCe(){return l(FB)||(FB=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),FB}function jCe(){return MM()&&UB}var AB;function qCe(){return l(AB)||(AB=!MM()&&typeof PointerEvent<"u"&&(!l(za.pointerEnabled)||za.pointerEnabled)),AB}var xq,FM;function _q(){if(!l(FM)){let e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let t=e.style.imageRendering;FM=l(t)&&t!=="",FM&&(xq=t)}return FM}function $Ce(){return _q()?xq:void 0}function Xc(){return Xc._result}Xc._promise=void 0;Xc._result=void 0;Xc.initialize=function(){return l(Xc._promise)||(Xc._promise=new Promise(e=>{let t=new Image;t.onload=function(){Xc._result=t.width>0&&t.height>0,e(Xc._result)},t.onerror=function(){Xc._result=!1,e(Xc._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),Xc._promise};Object.defineProperties(Xc,{initialized:{get:function(){return l(Xc._result)}}});var GS=[];typeof ArrayBuffer<"u"&&(GS.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&GS.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&GS.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&GS.push(BigInt64Array),typeof BigUint64Array<"u"&&GS.push(BigUint64Array));var ru={isChrome:kB,chromeVersion:YCe,isSafari:pq,safariVersion:OCe,isWebkit:bq,webkitVersion:HCe,isInternetExplorer:gq,internetExplorerVersion:zCe,isEdge:AM,edgeVersion:KCe,isFirefox:MM,firefoxVersion:jCe,isWindows:JCe,isIPadOrIOS:QCe,hardwareConcurrency:y(za.hardwareConcurrency,3),supportsPointerEvents:qCe,supportsImageRenderingPixelated:_q,supportsWebP:Xc,imageRenderingValue:$Ce,typedArrayTypes:GS};ru.supportsBasis=function(e){return ru.supportsWebAssembly()&&e.context.supportsBasis};ru.supportsFullscreen=function(){return mr.supportsFullscreen()};ru.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};ru.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};ru.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};ru.supportsBigInt=function(){return typeof BigInt<"u"};ru.supportsWebWorkers=function(){return typeof Worker<"u"};ru.supportsWebAssembly=function(){return typeof WebAssembly<"u"};ru.supportsWebgl2=function(e){return e.context.webgl2};ru.supportsEsmWebWorkers=function(){return!MM()||parseInt(UB)>=114};var Ot=ru;function DB(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=y(e,1),this.green=y(t,1),this.blue=y(n,1),this.alpha=y(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(y(e,255)),t=re.byteToFloat(y(t,255)),n=re.byteToFloat(y(n,255)),i=re.byteToFloat(y(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 BB,YB,ap;Ot.supportsTypedArrays()&&(BB=new ArrayBuffer(4),YB=new Uint32Array(BB),ap=new Uint8Array(BB));re.fromRgba=function(e,t){return YB[0]=e,re.fromBytes(ap[0],ap[1],ap[2],ap[3],t)};re.fromHsl=function(e,t,n,i,o){e=y(e,0)%1,t=y(t,0),n=y(n,0),i=y(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=DB(d,c,e+1/3),s=DB(d,c,e),a=DB(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=y(e,y.EMPTY_OBJECT);let n=e.red;if(!l(n)){let s=y(e.minimumRed,0),a=y(e.maximumRed,1);n=s+W.nextRandomNumber()*(a-s)}let i=e.green;if(!l(i)){let s=y(e.minimumGreen,0),a=y(e.maximumGreen,1);i=s+W.nextRandomNumber()*(a-s)}let o=e.blue;if(!l(o)){let s=y(e.minimumBlue,0),a=y(e.maximumBlue,1);o=s+W.nextRandomNumber()*(a-s)}let r=e.alpha;if(!l(r)){let s=y(e.minimumAlpha,0),a=y(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 e1e=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,t1e=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,n1e=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,i1e=/^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=e1e.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(y(i[4],"f"),16)/15,t):(i=t1e.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(y(i[4],"ff"),16)/255,t):(i=n1e.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(y(i[4],"1.0")),t):(i=i1e.exec(e),i!==null?re.fromHsl(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(y(i[4],"1.0")),t):(t=void 0,t))))};re.packedLength=4;re.pack=function(e,t,n){return n=y(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=y(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 ap[0]=re.floatToByte(this.red),ap[1]=re.floatToByte(this.green),ap[2]=re.floatToByte(this.blue),ap[3]=re.floatToByte(this.alpha),YB[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 Y=re;function NM(e){e=y(e,y.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}NM.ALL=Object.freeze(new NM({color:new Y(0,0,0,0),depth:1,stencil:0}));NM.prototype.execute=function(e,t){e.clear(this,t)};var ei=NM;var hVt=T(S(),1);var lVt=T(S(),1),o1e={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},Re=Object.freeze(o1e);function Tq(e){e=y(e,y.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=y(e.persists,!1),this.pass=Re.COMPUTE,this.owner=e.owner}Tq.prototype.execute=function(e){e.execute(this)};var um=Tq;var LXt=T(S(),1);var OGt=T(S(),1);var yVt=T(S(),1);function Mt(e,t){this.x=y(e,0),this.y=y(t,0)}Mt.fromElements=function(e,t,n){return l(n)?(n.x=e,n.y=t,n):new Mt(e,t)};Mt.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t):new Mt(e.x,e.y)};Mt.fromCartesian3=Mt.clone;Mt.fromCartesian4=Mt.clone;Mt.packedLength=2;Mt.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n]=e.y,t};Mt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Mt),n.x=e[t++],n.y=e[t],n};Mt.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)Mt.pack(e[o],t,o*2);return t};Mt.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]=Mt.unpack(e,i,t[o])}return t};Mt.fromArray=Mt.unpack;Mt.maximumComponent=function(e){return Math.max(e.x,e.y)};Mt.minimumComponent=function(e){return Math.min(e.x,e.y)};Mt.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n};Mt.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n};Mt.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};Mt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y};Mt.magnitude=function(e){return Math.sqrt(Mt.magnitudeSquared(e))};var kM=new Mt;Mt.distance=function(e,t){return Mt.subtract(e,t,kM),Mt.magnitude(kM)};Mt.distanceSquared=function(e,t){return Mt.subtract(e,t,kM),Mt.magnitudeSquared(kM)};Mt.normalize=function(e,t){let n=Mt.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t};Mt.dot=function(e,t){return e.x*t.x+e.y*t.y};Mt.cross=function(e,t){return e.x*t.y-e.y*t.x};Mt.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n};Mt.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n};Mt.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n};Mt.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n};Mt.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n};Mt.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n};Mt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t};Mt.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var Sq=new Mt;Mt.lerp=function(e,t,n,i){return Mt.multiplyByScalar(t,n,Sq),i=Mt.multiplyByScalar(e,1-n,i),Mt.add(Sq,i,i)};var Cq=new Mt,Vq=new Mt;Mt.angleBetween=function(e,t){return Mt.normalize(e,Cq),Mt.normalize(t,Vq),W.acosClamped(Mt.dot(Cq,Vq))};var r1e=new Mt;Mt.mostOrthogonalAxis=function(e,t){let n=Mt.normalize(e,r1e);return Mt.abs(n,n),n.x<=n.y?t=Mt.clone(Mt.UNIT_X,t):t=Mt.clone(Mt.UNIT_Y,t),t};Mt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y};Mt.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]};Mt.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)};Mt.ZERO=Object.freeze(new Mt(0,0));Mt.ONE=Object.freeze(new Mt(1,1));Mt.UNIT_X=Object.freeze(new Mt(1,0));Mt.UNIT_Y=Object.freeze(new Mt(0,1));Mt.prototype.clone=function(e){return Mt.clone(this,e)};Mt.prototype.equals=function(e){return Mt.equals(this,e)};Mt.prototype.equalsEpsilon=function(e,t,n){return Mt.equalsEpsilon(this,e,t,n)};Mt.prototype.toString=function(){return`(${this.x}, ${this.y})`};var D=Mt;var XVt=T(S(),1);var CVt=T(S(),1);var s1e=new h,a1e=new h;function c1e(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,g=a*a*u*u,f=m+p+g,x=Math.sqrt(1/f),_=h.multiplyByScalar(e,x,s1e);if(f<i)return isFinite(x)?h.clone(_,o):void 0;let C=n.x,V=n.y,L=n.z,Z=a1e;Z.x=_.x*C*2,Z.y=_.y*V*2,Z.z=_.z*L*2;let E=(1-x)*h.magnitude(e)/(.5*h.magnitude(Z)),X=0,v,P,A,M,b,R,G,I,w,N,B;do{E-=X,A=1/(1+E*C),M=1/(1+E*V),b=1/(1+E*L),R=A*A,G=M*M,I=b*b,w=R*A,N=G*M,B=I*b,v=m*R+p*G+g*I-1,P=m*w*C+p*N*V+g*B*L;let U=-2*P;X=v/U}while(Math.abs(v)>W.EPSILON12);return l(o)?(o.x=r*A,o.y=s*M,o.z=a*b,o):new h(r*A,s*M,a*b)}var By=c1e;function wo(e,t,n){this.longitude=y(e,0),this.latitude=y(t,0),this.height=y(n,0)}wo.fromRadians=function(e,t,n,i){return n=y(n,0),l(i)?(i.longitude=e,i.latitude=t,i.height=n,i):new wo(e,t,n)};wo.fromDegrees=function(e,t,n,i){return e=W.toRadians(e),t=W.toRadians(t),wo.fromRadians(e,t,n,i)};var l1e=new h,d1e=new h,u1e=new h;wo._ellipsoidOneOverRadii=new h(1/6378137,1/6378137,1/6356752314245179e-9);wo._ellipsoidOneOverRadiiSquared=new h(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9));wo._ellipsoidCenterToleranceSquared=W.EPSILON1;wo.fromCartesian=function(e,t,n){let i=l(t)?t.oneOverRadii:wo._ellipsoidOneOverRadii,o=l(t)?t.oneOverRadiiSquared:wo._ellipsoidOneOverRadiiSquared,r=l(t)?t._centerToleranceSquared:wo._ellipsoidCenterToleranceSquared,s=By(e,i,o,r,d1e);if(!l(s))return;let a=h.multiplyComponents(s,o,l1e);a=h.normalize(a,a);let c=h.subtract(e,s,u1e),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 wo(d,u,m)};wo.toCartesian=function(e,t,n){return h.fromRadians(e.longitude,e.latitude,e.height,t,n)};wo.clone=function(e,t){if(l(e))return l(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new wo(e.longitude,e.latitude,e.height)};wo.equals=function(e,t){return e===t||l(e)&&l(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height};wo.equalsEpsilon=function(e,t,n){return n=y(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};wo.ZERO=Object.freeze(new wo(0,0,0));wo.prototype.clone=function(e){return wo.clone(this,e)};wo.prototype.equals=function(e){return wo.equals(this,e)};wo.prototype.equalsEpsilon=function(e,t){return wo.equalsEpsilon(this,e,t)};wo.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var he=wo;var NVt=T(S(),1);function Rq(e,t,n,i){t=y(t,0),n=y(n,0),i=y(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 pi(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,Rq(this,e,t,n)}Object.defineProperties(pi.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}}});pi.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 pi(n.x,n.y,n.z)};pi.fromCartesian3=function(e,t){return l(t)||(t=new pi),l(e)&&Rq(t,e.x,e.y,e.z),t};pi.WGS84=Object.freeze(new pi(6378137,6378137,6356752314245179e-9));pi.UNIT_SPHERE=Object.freeze(new pi(1,1,1));pi.MOON=Object.freeze(new pi(W.LUNAR_RADIUS,W.LUNAR_RADIUS,W.LUNAR_RADIUS));pi._default=pi.WGS84;Object.defineProperties(pi,{default:{get:function(){return pi._default},set:function(e){pi._default=e,h._ellipsoidRadiiSquared=e.radiiSquared,he._ellipsoidOneOverRadii=e.oneOverRadii,he._ellipsoidOneOverRadiiSquared=e.oneOverRadiiSquared,he._ellipsoidCenterToleranceSquared=e._centerToleranceSquared}}});pi.prototype.clone=function(e){return pi.clone(this,e)};pi.packedLength=h.packedLength;pi.pack=function(e,t,n){return n=y(n,0),h.pack(e._radii,t,n),t};pi.unpack=function(e,t,n){t=y(t,0);let i=h.unpack(e,t);return pi.fromCartesian3(i,n)};pi.prototype.geocentricSurfaceNormal=h.normalize;pi.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)};pi.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 m1e=new h,h1e=new h;pi.prototype.cartographicToCartesian=function(e,t){let n=m1e,i=h1e;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)};pi.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 f1e=new h,p1e=new h,b1e=new h;pi.prototype.cartesianToCartographic=function(e,t){let n=this.scaleToGeodeticSurface(e,p1e);if(!l(n))return;let i=this.geodeticSurfaceNormal(n,f1e),o=h.subtract(e,n,b1e),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)};pi.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};pi.prototype.scaleToGeodeticSurface=function(e,t){return By(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)};pi.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)};pi.prototype.transformPositionToScaledSpace=function(e,t){return l(t)||(t=new h),h.multiplyComponents(e,this._oneOverRadii,t)};pi.prototype.transformPositionFromScaledSpace=function(e,t){return l(t)||(t=new h),h.multiplyComponents(e,this._radii,t)};pi.prototype.equals=function(e){return this===e||l(e)&&h.equals(this._radii,e._radii)};pi.prototype.toString=function(){return this._radii.toString()};pi.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,n){t=y(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 g1e=new h;pi.prototype.getLocalCurvature=function(e,t){l(t)||(t=new D);let n=this.getSurfaceNormalIntersectionWithZAxis(e,0,g1e),i=h.distance(e,n),o=this.minimumRadius*i/this.maximumRadius**2,r=i*o**2;return D.fromElements(1/i,1/r,t)};var y1e=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],x1e=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function Lq(e,t,n){let i=.5*(t+e),o=.5*(t-e),r=0;for(let s=0;s<5;s++){let a=o*y1e[s];r+=x1e[s]*(n(i+a)+n(i-a))}return r*=o,r}pi.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 Lq(i,o,function(u){let m=Math.cos(u),p=Math.sin(u);return Math.cos(u)*Lq(t,n,function(g){let f=Math.cos(g),x=Math.sin(g);return Math.sqrt(d*p*p+c*(a*f*f+s*x*x)*m*m)})})};var ne=pi;var HVt=T(S(),1);function UM(e){this._ellipsoid=y(e,ne.default),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(UM.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});UM.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)};UM.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 Li=UM;var KVt=T(S(),1),_1e={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},Kt=Object.freeze(_1e);var wGt=T(S(),1);var LGt=T(S(),1);var GZt=T(S(),1);var QVt=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 Go=T1e;var qVt=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 xb=S1e;var SLt=T(S(),1);var sLt=T(S(),1);var eLt=T(S(),1);function C1e(e){return e%4===0&&e%100!==0||e%400===0}var mm=C1e;var Zq=[31,28,31,30,31,30,31,31,30,31,30,31];function V1e(e,t,n,i,o,r,s,a){e=y(e,1),t=y(t,1),n=y(n,1),i=y(i,0),o=y(o,0),r=y(r,0),s=y(s,0),a=y(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(){go.typeOf.number.greaterThanOrEquals("Year",e,1),go.typeOf.number.lessThanOrEquals("Year",e,9999),go.typeOf.number.greaterThanOrEquals("Month",t,1),go.typeOf.number.lessThanOrEquals("Month",t,12),go.typeOf.number.greaterThanOrEquals("Day",n,1),go.typeOf.number.lessThanOrEquals("Day",n,31),go.typeOf.number.greaterThanOrEquals("Hour",i,0),go.typeOf.number.lessThanOrEquals("Hour",i,23),go.typeOf.number.greaterThanOrEquals("Minute",o,0),go.typeOf.number.lessThanOrEquals("Minute",o,59),go.typeOf.bool("IsLeapSecond",a),go.typeOf.number.greaterThanOrEquals("Second",r,0),go.typeOf.number.lessThanOrEquals("Second",r,a?60:59),go.typeOf.number.greaterThanOrEquals("Millisecond",s,0),go.typeOf.number.lessThan("Millisecond",s,1e3)}function _(){let C=t===2&&mm(e)?Zq[t-1]+1:Zq[t-1];if(n>C)throw new pe("Month and Day represents invalid date")}}var cp=V1e;var cLt=T(S(),1);function L1e(e,t){this.julianDate=e,this.offset=t}var ki=L1e;var dLt=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},zn=Object.freeze(R1e);var mLt=T(S(),1),Z1e={UTC:0,TAI:1},Hn=Object.freeze(Z1e);var Eq=new cp,OB=[31,28,31,30,31,30,31,31,30,31,30,31],HB=29;function zB(e,t){return Xt.compare(e.julianDate,t.julianDate)}var ES=new ki;function BM(e){ES.julianDate=e;let t=Xt.leapSeconds,n=Go(t,ES,zB);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&Xt.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),Xt.addSeconds(e,i,e)}function Gq(e,t){ES.julianDate=e;let n=Xt.leapSeconds,i=Go(n,ES,zB);if(i<0&&(i=~i),i===0)return Xt.addSeconds(e,-n[0].offset,t);if(i>=n.length)return Xt.addSeconds(e,-n[i-1].offset,t);let o=Xt.secondsDifference(n[i].julianDate,e);if(o===0)return Xt.addSeconds(e,-n[i].offset,t);if(!(o<=1))return Xt.addSeconds(e,-n[--i].offset,t)}function _b(e,t,n){let i=t/zn.SECONDS_PER_DAY|0;return e+=i,t-=zn.SECONDS_PER_DAY*i,t<0&&(e--,t+=zn.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function KB(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*zn.SECONDS_PER_HOUR+o*zn.SECONDS_PER_MINUTE+s*zn.SECONDS_PER_MILLISECOND);return u>=43200&&(d-=1),[d,u]}var G1e=/^(\d{4})$/,E1e=/^(\d{4})-(\d{2})$/,X1e=/^(\d{4})-?(\d{3})$/,I1e=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,W1e=/^(\d{4})-?(\d{2})-?(\d{2})$/,JB=/([Z+\-])?(\d{2})?:?(\d{2})?$/,P1e=/^(\d{2})(\.\d+)?/.source+JB.source,v1e=/^(\d{2}):?(\d{2})(\.\d+)?/.source+JB.source,w1e=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+JB.source;function Xt(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=y(e,0),t=y(t,0),n=y(n,Hn.UTC);let i=e|0;t=t+(e-i)*zn.SECONDS_PER_DAY,_b(i,t,this),n===Hn.UTC&&BM(this)}Xt.fromGregorianDate=function(e,t){let n=KB(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return l(t)?(_b(n[0],n[1],t),BM(t),t):new Xt(n[0],n[1],Hn.UTC)};Xt.fromDate=function(e,t){let n=KB(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return l(t)?(_b(n[0],n[1],t),BM(t),t):new Xt(n[0],n[1],Hn.UTC)};Xt.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,g;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(X1e),n!==null)i=+n[1],C=+n[2],g=mm(i);else if(n=u.match(I1e),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()}g=mm(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=g&&o===2?HB:OB[o-1];r>p;)r-=p,o++,o>12&&(o-=12,i++),p=g&&o===2?HB:OB[o-1];for(;a<0;)a+=60,s--;for(;s<0;)s+=24,r--;for(;r<1;)o--,o<1&&(o+=12,i--),p=g&&o===2?HB:OB[o-1],r+=p;let _=KB(i,o,r,s,a,c,d);return l(t)?(_b(_[0],_[1],t),BM(t)):t=new Xt(_[0],_[1],Hn.UTC),x&&Xt.addSeconds(t,1,t),t};Xt.now=function(e){return Xt.fromDate(new Date,e)};var DM=new Xt(0,0,Hn.TAI);Xt.toGregorianDate=function(e,t){let n=!1,i=Gq(e,DM);l(i)||(Xt.addSeconds(e,-1,DM),i=Gq(DM,DM),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,g=r/zn.SECONDS_PER_HOUR|0,f=r-g*zn.SECONDS_PER_HOUR,x=f/zn.SECONDS_PER_MINUTE|0;f=f-x*zn.SECONDS_PER_MINUTE;let _=f|0,C=(f-_)/zn.SECONDS_PER_MILLISECOND;return g+=12,g>23&&(g-=24),n&&(_+=1),l(t)?(t.year=p,t.month=m,t.day=u,t.hour=g,t.minute=x,t.second=_,t.millisecond=C,t.isLeapSecond=n,t):new cp(p,m,u,g,x,_,C,n)};Xt.toDate=function(e){let t=Xt.toGregorianDate(e,Eq),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))};Xt.toIso8601=function(e,t){let n=Xt.toGregorianDate(e,Eq),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`)};Xt.clone=function(e,t){if(l(e))return l(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new Xt(e.dayNumber,e.secondsOfDay,Hn.TAI)};Xt.compare=function(e,t){let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};Xt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};Xt.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(Xt.secondsDifference(e,t))<=n};Xt.totalDays=function(e){return e.dayNumber+e.secondsOfDay/zn.SECONDS_PER_DAY};Xt.secondsDifference=function(e,t){return(e.dayNumber-t.dayNumber)*zn.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};Xt.daysDifference=function(e,t){let n=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/zn.SECONDS_PER_DAY;return n+i};Xt.computeTaiMinusUtc=function(e){ES.julianDate=e;let t=Xt.leapSeconds,n=Go(t,ES,zB);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};Xt.addSeconds=function(e,t,n){return _b(e.dayNumber,e.secondsOfDay+t,n)};Xt.addMinutes=function(e,t,n){let i=e.secondsOfDay+t*zn.SECONDS_PER_MINUTE;return _b(e.dayNumber,i,n)};Xt.addHours=function(e,t,n){let i=e.secondsOfDay+t*zn.SECONDS_PER_HOUR;return _b(e.dayNumber,i,n)};Xt.addDays=function(e,t,n){let i=e.dayNumber+t;return _b(i,e.secondsOfDay,n)};Xt.lessThan=function(e,t){return Xt.compare(e,t)<0};Xt.lessThanOrEquals=function(e,t){return Xt.compare(e,t)<=0};Xt.greaterThan=function(e,t){return Xt.compare(e,t)>0};Xt.greaterThanOrEquals=function(e,t){return Xt.compare(e,t)>=0};Xt.prototype.clone=function(e){return Xt.clone(this,e)};Xt.prototype.equals=function(e){return Xt.equals(this,e)};Xt.prototype.equalsEpsilon=function(e,t){return Xt.equalsEpsilon(this,e,t)};Xt.prototype.toString=function(){return Xt.toIso8601(this)};Xt.leapSeconds=[new ki(new Xt(2441317,43210,Hn.TAI),10),new ki(new Xt(2441499,43211,Hn.TAI),11),new ki(new Xt(2441683,43212,Hn.TAI),12),new ki(new Xt(2442048,43213,Hn.TAI),13),new ki(new Xt(2442413,43214,Hn.TAI),14),new ki(new Xt(2442778,43215,Hn.TAI),15),new ki(new Xt(2443144,43216,Hn.TAI),16),new ki(new Xt(2443509,43217,Hn.TAI),17),new ki(new Xt(2443874,43218,Hn.TAI),18),new ki(new Xt(2444239,43219,Hn.TAI),19),new ki(new Xt(2444786,43220,Hn.TAI),20),new ki(new Xt(2445151,43221,Hn.TAI),21),new ki(new Xt(2445516,43222,Hn.TAI),22),new ki(new Xt(2446247,43223,Hn.TAI),23),new ki(new Xt(2447161,43224,Hn.TAI),24),new ki(new Xt(2447892,43225,Hn.TAI),25),new ki(new Xt(2448257,43226,Hn.TAI),26),new ki(new Xt(2448804,43227,Hn.TAI),27),new ki(new Xt(2449169,43228,Hn.TAI),28),new ki(new Xt(2449534,43229,Hn.TAI),29),new ki(new Xt(2450083,43230,Hn.TAI),30),new ki(new Xt(2450630,43231,Hn.TAI),31),new ki(new Xt(2451179,43232,Hn.TAI),32),new ki(new Xt(2453736,43233,Hn.TAI),33),new ki(new Xt(2454832,43234,Hn.TAI),34),new ki(new Xt(2456109,43235,Hn.TAI),35),new ki(new Xt(2457204,43236,Hn.TAI),36),new ki(new Xt(2457754,43237,Hn.TAI),37)];var q=Xt;var bZt=T(S(),1),Kq=T(td(),1);var GLt=T(S(),1);function F1e(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var AL=F1e;var ILt=T(S(),1);function Fq(e,t){if(e===null||typeof e!="object")return e;t=y(t,!1);let n=new e.constructor;for(let i in e)if(e.hasOwnProperty(i)){let o=e[i];t&&(o=Fq(o,t)),n[i]=o}return n}var Ye=Fq;var wLt=T(S(),1);function Aq(e,t,n){n=y(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]=Aq(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 _t=Aq;var ALt=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 fl=A1e;var ULt=T(S(),1),Mq=T(td(),1);function QB(e,t){let n;return typeof document<"u"&&(n=document),QB._implementation(e,t,n)}QB._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=y(n.baseURI,n.location.href)}let i=new Mq.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var Ah=QB;var BLt=T(S(),1),Nq=T(td(),1);function M1e(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new Nq.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var ML=M1e;var OLt=T(S(),1),kq=T(td(),1);function N1e(e){let t=new kq.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 Yy=N1e;var KLt=T(S(),1);var Uq={};function k1e(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=Uq[t];l(i)||(i={},Uq[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 hm=k1e;var QLt=T(S(),1);var U1e=/^blob:/i;function D1e(e){return U1e.test(e)}var Oy=D1e;var $Lt=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 Tb=B1e;var tRt=T(S(),1);var Y1e=/^data:/i;function O1e(e){return Y1e.test(e)}var lp=O1e;var iRt=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 Hy=H1e;var rRt=T(S(),1);function z1e(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 zy=z1e;var cRt=T(S(),1);function K1e(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 nd=K1e;var yRt=T(S(),1);var dRt=T(S(),1),J1e={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},jn=Object.freeze(J1e);var mRt=T(S(),1),Q1e={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},is=Object.freeze(Q1e);function zM(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.throttleByServer,!1),n=y(e.throttle,!1);this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=y(e.priority,0),this.throttle=n,this.throttleByServer=t,this.type=y(e.type,is.OTHER),this.serverKey=e.serverKey,this.state=jn.UNISSUED,this.deferred=void 0,this.cancelled=!1}zM.prototype.cancel=function(){this.cancelled=!0};zM.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=jn.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new zM(this)};var Oo=zM;var VRt=T(S(),1);var _Rt=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 NL=j1e;function Dq(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=NL(this.responseHeaders))}Dq.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var Nh=Dq;var URt=T(S(),1),KM=T(td(),1);var ZRt=T(S(),1);function kL(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(kL.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});kL.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};kL.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 q1e(e,t){return t-e}kL.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(q1e),e=0;e<i;e++){let r=o[e];t.splice(r,1),n.splice(r,1)}o.length=0}this._insideRaiseEvent=!1};var be=kL;var IRt=T(S(),1);function Ky(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(Ky.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 jB(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}Ky.prototype.reserve=function(e){e=y(e,this._length),this._array.length=e};Ky.prototype.heapify=function(e){e=y(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?(jB(i,o,e),e=o):r=!1}};Ky.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};Ky.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)jB(t,o,s),o=s;else break}let r;return l(i)&&this._length>i&&(r=t[i],this._length=i),r};Ky.prototype.pop=function(e){if(e=y(e,0),this._length===0)return;let t=this._array,n=t[e];return jB(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var UL=Ky;function $1e(e,t){return e.priority-t.priority}var Ji={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},WS=20,Ka=new UL({comparator:$1e});Ka.maximumLength=WS;Ka.reserve(WS);var kh=[],dp={},eVe=typeof document<"u"?new KM.default(document.location.href):new KM.default,JM=new be;function Ho(){}Ho.maximumRequests=50;Ho.maximumRequestsPerServer=18;Ho.requestsByServer={};Ho.throttleRequests=!0;Ho.debugShowStatistics=!1;Ho.requestCompletedEvent=JM;Object.defineProperties(Ho,{statistics:{get:function(){return Ji}},priorityHeapLength:{get:function(){return WS},set:function(e){if(e<WS)for(;Ka.length>e;){let t=Ka.pop();Jy(t)}WS=e,Ka.maximumLength=e,Ka.reserve(e)}}});function Bq(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}Ho.serverHasOpenSlots=function(e,t){t=y(t,1);let n=y(Ho.requestsByServer[e],Ho.maximumRequestsPerServer);return dp[e]+t<=n};Ho.heapHasOpenSlots=function(e){return Ka.length+e<=WS};function Yq(e){return e.state===jn.UNISSUED&&(e.state=jn.ISSUED,e.deferred=fl()),e.deferred.promise}function tVe(e){return function(t){if(e.state===jn.CANCELLED)return;let n=e.deferred;--Ji.numberOfActiveRequests,--dp[e.serverKey],JM.raiseEvent(),e.state=jn.RECEIVED,e.deferred=void 0,n.resolve(t)}}function nVe(e){return function(t){e.state!==jn.CANCELLED&&(++Ji.numberOfFailedRequests,--Ji.numberOfActiveRequests,--dp[e.serverKey],JM.raiseEvent(t),e.state=jn.FAILED,e.deferred.reject(t))}}function Oq(e){let t=Yq(e);return e.state=jn.ACTIVE,kh.push(e),++Ji.numberOfActiveRequests,++Ji.numberOfActiveRequestsEver,++dp[e.serverKey],e.requestFunction().then(tVe(e)).catch(nVe(e)),t}function Jy(e){let t=e.state===jn.ACTIVE;if(e.state=jn.CANCELLED,++Ji.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--Ji.numberOfActiveRequests,--dp[e.serverKey],++Ji.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}Ho.update=function(){let e,t,n=0,i=kh.length;for(e=0;e<i;++e){if(t=kh[e],t.cancelled&&Jy(t),t.state!==jn.ACTIVE){++n;continue}n>0&&(kh[e-n]=t)}kh.length-=n;let o=Ka.internalArray,r=Ka.length;for(e=0;e<r;++e)Bq(o[e]);Ka.resort();let s=Math.max(Ho.maximumRequests-kh.length,0),a=0;for(;a<s&&Ka.length>0;){if(t=Ka.pop(),t.cancelled){Jy(t);continue}if(t.throttleByServer&&!Ho.serverHasOpenSlots(t.serverKey)){Jy(t);continue}Oq(t),++a}iVe()};Ho.getServerKey=function(e){let t=new KM.default(e);t.scheme()===""&&(t=t.absoluteTo(eVe),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)||Oy(e.url))return JM.raiseEvent(),e.state=jn.RECEIVED,e.requestFunction();if(++Ji.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 Oq(e);if(kh.length>=Ho.maximumRequests)return;Bq(e);let t=Ka.insert(e);if(l(t)){if(t===e)return;Jy(t)}return Yq(e)};function iVe(){Ho.debugShowStatistics&&(Ji.numberOfActiveRequests===0&&Ji.lastNumberOfActiveRequests>0&&(Ji.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${Ji.numberOfAttemptedRequests}`),Ji.numberOfAttemptedRequests=0),Ji.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${Ji.numberOfCancelledRequests}`),Ji.numberOfCancelledRequests=0),Ji.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${Ji.numberOfCancelledActiveRequests}`),Ji.numberOfCancelledActiveRequests=0),Ji.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${Ji.numberOfFailedRequests}`),Ji.numberOfFailedRequests=0)),Ji.lastNumberOfActiveRequests=Ji.numberOfActiveRequests)}Ho.clearForSpecs=function(){for(;Ka.length>0;){let t=Ka.pop();Jy(t)}let e=kh.length;for(let t=0;t<e;++t)Jy(kh[t]);kh.length=0,dp={},Ji.numberOfAttemptedRequests=0,Ji.numberOfActiveRequests=0,Ji.numberOfCancelledRequests=0,Ji.numberOfCancelledActiveRequests=0,Ji.numberOfFailedRequests=0,Ji.numberOfActiveRequestsEver=0,Ji.lastNumberOfActiveRequests=0};Ho.numberOfActiveRequestsByServer=function(e){return dp[e]};Ho.requestHeap=Ka;var Ja=Ho;var YRt=T(S(),1),Hq=T(td(),1);var DL={},PS={};DL.add=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(PS[n])||(PS[n]=!0)};DL.remove=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(PS[n])&&delete PS[n]};function oVe(e){let t=new Hq.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}}DL.contains=function(e){let t=oVe(e);return!!(l(t)&&l(PS[t]))};DL.clear=function(){PS={}};var vS=DL;var Jq=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function Gt(e){e=y(e,y.EMPTY_OBJECT),typeof e=="string"&&(e={url:e}),this._url=void 0,this._templateValues=Uh(e.templateValues,{}),this._queryParameters=Uh(e.queryParameters,{}),this.headers=Uh(e.headers,{}),this.request=y(e.request,new Oo),this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=y(e.retryAttempts,0),this._retryCount=0,y(e.parseUrl,!0)?this.parseUrl(e.url,!0,!0):this._url=e.url,this._credits=e.credits}function Uh(e,t){return l(e)?Ye(e):t}Gt.createIfNeeded=function(e){return e instanceof Gt?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new Gt({url:e})};var wS;Gt.supportsImageBitmapOptions=function(){return l(wS)?wS:typeof createImageBitmap!="function"?(wS=Promise.resolve(!1),wS):(wS=Gt.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=hm(t[0]),i=hm(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),wS)};Object.defineProperties(Gt,{isBlobSupported:{get:function(){return Jq}}});Object.defineProperties(Gt.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 Yy(this._url)}},isDataUri:{get:function(){return lp(this._url)}},isBlobUri:{get:function(){return Oy(this._url)}},isCrossOriginUrl:{get:function(){return Tb(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});Gt.prototype.toString=function(){return this.getUrlComponent(!0,!0)};Gt.prototype.parseUrl=function(e,t,n,i){let o=new Kq.default(e),r=rVe(o.query());this._queryParameters=t?jM(r,this.queryParameters,n):r,o.search(""),o.fragment(""),l(i)&&o.scheme()===""&&(o=o.absoluteTo(Ah(i))),this._url=o.toString()};function rVe(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:nd(e)}function jM(e,t,n){if(!n)return _t(e,t);let i=Ye(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}Gt.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${sVe(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 sVe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${zy(e)}`}Gt.prototype.setQueryParameters=function(e,t){t?this._queryParameters=jM(this._queryParameters,e,!1):this._queryParameters=jM(e,this._queryParameters,!1)};Gt.prototype.appendQueryParameters=function(e){this._queryParameters=jM(e,this._queryParameters,!0)};Gt.prototype.setTemplateValues=function(e,t){t?this._templateValues=_t(this._templateValues,e):this._templateValues=_t(e,this._templateValues)};Gt.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,l(e.url)){let n=y(e.preserveQueryParameters,!1);t.parseUrl(e.url,!0,n,this._url)}return l(e.queryParameters)&&(t._queryParameters=_t(e.queryParameters,t.queryParameters)),l(e.templateValues)&&(t._templateValues=_t(e.templateValues,t.templateValues)),l(e.headers)&&(t.headers=_t(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};Gt.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})};Gt.prototype.clone=function(e){return l(e)?(e._url=this._url,e._queryParameters=Ye(this._queryParameters),e._templateValues=Ye(this._templateValues),e.headers=Ye(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new Gt({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})};Gt.prototype.getBaseUri=function(e){return ML(this.getUrlComponent(e),e)};Gt.prototype.appendForwardSlash=function(){this._url=AL(this._url)};Gt.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};Gt.fetchArrayBuffer=function(e){return new Gt(e).fetchArrayBuffer()};Gt.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};Gt.fetchBlob=function(e){return new Gt(e).fetchBlob()};Gt.prototype.fetchImage=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.preferImageBitmap,!1),n=y(e.preferBlob,!1),i=y(e.flipY,!1),o=y(e.skipColorSpaceConversion,!1);if($B(this.request),!Jq||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return qB({resource:this,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:t});let r=this.fetchBlob();if(!l(r))return;let s,a,c,d;return Gt.supportsImageBitmapOptions().then(function(u){return s=u,a=s&&t,r}).then(function(u){if(!l(u))return;if(d=u,a)return Gt.createImageBitmapFromBlob(u,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o});let m=window.URL.createObjectURL(u);return c=new Gt({url:m}),qB({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 qB(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=fl();return Gt._Implementations.createImage(r,a,c,n,i,o),c.promise};let s=Ja.request(r);if(l(s))return s.catch(function(a){return r.state!==jn.FAILED?Promise.reject(a):t.retryOnError(a).then(function(c){return c?(r.state=jn.UNISSUED,r.deferred=void 0,qB({resource:t,flipY:n,skipColorSpaceConversion:i,preferImageBitmap:o})):Promise.reject(a)})})}Gt.fetchImage=function(e){return new Gt(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};Gt.prototype.fetchText=function(){return this.fetch({responseType:"text"})};Gt.fetchText=function(e){return new Gt(e).fetchText()};Gt.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)})};Gt.fetchJson=function(e){return new Gt(e).fetchJson()};Gt.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};Gt.fetchXML=function(e){return new Gt(e).fetchXML()};Gt.prototype.fetchJsonp=function(e){e=y(e,"callback"),$B(this.request);let t;do t=`loadJsonp${W.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return Qq(this,e,t)};function Qq(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=fl();return window[n]=function(c){a.resolve(c);try{delete window[n]}catch{window[n]=void 0}},Gt._Implementations.loadAndExecuteScript(r,n,a),a.promise};let s=Ja.request(o);if(l(s))return s.catch(function(a){return o.state!==jn.FAILED?Promise.reject(a):e.retryOnError(a).then(function(c){return c?(o.state=jn.UNISSUED,o.deferred=void 0,Qq(e,t,n)):Promise.reject(a)})})}Gt.fetchJsonp=function(e){return new Gt(e).fetchJsonp(e.callbackParameterName)};Gt.prototype._makeRequest=function(e){let t=this;$B(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let r=e.responseType,s=_t(e.headers,t.headers),a=e.overrideMimeType,c=e.method,d=e.data,u=fl(),m=Gt._Implementations.loadWithXhr(i,r,c,d,s,u,a);return l(m)&&l(m.abort)&&(n.cancelFunction=function(){m.abort()}),u.promise};let o=Ja.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!==jn.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=jn.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};function $B(e){if(e.state===jn.ISSUED||e.state===jn.ACTIVE)throw new ue("The Resource is already being fetched.");e.state=jn.UNISSUED,e.deferred=void 0}var aVe=/^data:(.*?)(;base64)?,(.*)$/;function QM(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function zq(e,t){let n=QM(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 cVe(e,t){t=y(t,"");let n=e[1],i=!!e[2],o=e[3],r,s;switch(t){case"":case"text":return QM(i,o);case"arraybuffer":return zq(i,o);case"blob":return r=zq(i,o),new Blob([r],{type:n});case"document":return s=new DOMParser,s.parseFromString(QM(i,o),n);case"json":return JSON.parse(QM(i,o));default:}}Gt.prototype.fetch=function(e){return e=Uh(e,{}),e.method="GET",this._makeRequest(e)};Gt.fetch=function(e){return new Gt(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Gt.prototype.delete=function(e){return e=Uh(e,{}),e.method="DELETE",this._makeRequest(e)};Gt.delete=function(e){return new Gt(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};Gt.prototype.head=function(e){return e=Uh(e,{}),e.method="HEAD",this._makeRequest(e)};Gt.head=function(e){return new Gt(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Gt.prototype.options=function(e){return e=Uh(e,{}),e.method="OPTIONS",this._makeRequest(e)};Gt.options=function(e){return new Gt(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Gt.prototype.post=function(e,t){return go.defined("data",e),t=Uh(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};Gt.post=function(e){return new Gt(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Gt.prototype.put=function(e,t){return go.defined("data",e),t=Uh(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};Gt.put=function(e){return new Gt(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Gt.prototype.patch=function(e,t){return go.defined("data",e),t=Uh(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};Gt.patch=function(e){return new Gt(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Gt._Implementations={};Gt._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&&(vS.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e};Gt._Implementations.createImage=function(e,t,n,i,o,r){let s=e.url;Gt.supportsImageBitmapOptions().then(function(a){if(!(a&&r)){Gt._Implementations.loadImageElement(s,t,n);return}let c="blob",d="GET",u=fl(),m=Gt._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 ue(`Successfully retrieved ${s} but it contained no content.`));return}return Gt.createImageBitmapFromBlob(p,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o})}).then(function(p){n.resolve(p)})}).catch(function(a){n.reject(a)})};Gt.createImageBitmapFromBlob=function(e,t){return go.defined("options",t),go.typeOf.bool("options.flipY",t.flipY),go.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),go.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function lVe(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 dVe=typeof XMLHttpRequest>"u";Gt._Implementations.loadWithXhr=function(e,t,n,i,o,r,s){let a=aVe.exec(e);if(a!==null){r.resolve(cVe(a,t));return}if(dVe){lVe(e,t,n,i,o,r,s);return}let c=new XMLHttpRequest;if(vS.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 g=c.getAllResponseHeaders().trim().split(/[\r\n]+/),f={};g.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 ue("Invalid XMLHttpRequest response type."))},c.onerror=function(u){r.reject(new Nh)},c.send(i),c};Gt._Implementations.loadAndExecuteScript=function(e,t,n){return Hy(e,t).catch(function(i){n.reject(i)})};Gt._DefaultImplementations={};Gt._DefaultImplementations.createImage=Gt._Implementations.createImage;Gt._DefaultImplementations.loadWithXhr=Gt._Implementations.loadWithXhr;Gt._DefaultImplementations.loadAndExecuteScript=Gt._Implementations.loadAndExecuteScript;Gt.DEFAULT=Object.freeze(new Gt({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var Ee=Gt;function YL(e){e=y(e,y.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=y(e.addNewLeapSeconds,!0),l(e.data)?jq(this,e.data):jq(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}YL.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Ee.createIfNeeded(e),i;try{i=await n.fetchJson()}catch{throw new ue(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new YL({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};YL.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 xb(0,0,0,0,0),t}});YL.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new xb(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=q.lessThanOrEquals(a,e),u=!l(c),m=u||q.greaterThanOrEquals(c,e);if(d&&m)return o=i,!u&&c.equals(e)&&++o,r=o+1,$q(this,n,this._samples,e,o,r,t),t}let s=Go(n,e,q.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,$q(this,n,this._samples,e,o,r,t),t};function uVe(e,t){return q.compare(e.julianDate,t)}function jq(e,t){if(!l(t.columnNames))throw new ue("Error in loaded EOP data: The columnNames property is required.");if(!l(t.samples))throw new ue("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 ue("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 g=0,f=d.length;g<f;g+=e._columnCount){let x=d[g+n],_=d[g+c],C=x+zn.MODIFIED_JULIAN_DATE_DIFFERENCE,V=new q(C,_,Hn.TAI);if(u.push(V),p){if(_!==m&&l(m)){let L=q.leapSeconds,Z=Go(L,V,uVe);if(Z<0){let E=new ki(V,_);L.splice(~Z,0,E)}}m=_}}}function qq(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 BL(e,t,n){return t+e*(n-t)}function $q(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 qq(e,n,o,a,s),s;if(i.equals(d))return qq(e,n,r,a,s),s;let u=q.secondsDifference(i,c)/q.secondsDifference(d,c),m=o*a,p=r*a,g=n[m+e._ut1MinusUtcSecondsColumn],f=n[p+e._ut1MinusUtcSecondsColumn],x=f-g;if(x>.5||x<-.5){let _=n[m+e._taiMinusUtcSecondsColumn],C=n[p+e._taiMinusUtcSecondsColumn];_!==C&&(d.equals(i)?g=f:f-=C-_)}return s.xPoleWander=BL(u,n[m+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=BL(u,n[m+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=BL(u,n[m+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=BL(u,n[m+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=BL(u,g,f),s}var OL=YL;var PZt=T(S(),1);function Qa(e,t,n){this.heading=y(e,0),this.pitch=y(t,0),this.roll=y(n,0)}Qa.fromQuaternion=function(e,t){l(t)||(t=new Qa);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};Qa.fromDegrees=function(e,t,n,i){return l(i)||(i=new Qa),i.heading=e*W.RADIANS_PER_DEGREE,i.pitch=t*W.RADIANS_PER_DEGREE,i.roll=n*W.RADIANS_PER_DEGREE,i};Qa.clone=function(e,t){if(l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new Qa(e.heading,e.pitch,e.roll)};Qa.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};Qa.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)};Qa.prototype.clone=function(e){return Qa.clone(this,e)};Qa.prototype.equals=function(e){return Qa.equals(this,e)};Qa.prototype.equalsEpsilon=function(e,t,n){return Qa.equalsEpsilon(this,e,t,n)};Qa.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var _a=Qa;var QZt=T(S(),1);var MZt=T(S(),1);var e$={};var t$=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function mVe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let i=e[t].getAttribute("src"),o=t$.exec(i);if(o!==null)return o[1]}}var qM;function n$(e){return typeof document>"u"?e:(l(qM)||(qM=document.createElement("a")),qM.href=e,qM.href)}var Qy;function i$(){if(l(Qy))return Qy;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:l(e$?.url)?e=Ah(".",e$.url):typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(CM.toUrl)?e=Ah("..",jy("Core/buildModuleUrl.js")):e=mVe(),Qy=new Ee({url:n$(e)}),Qy.appendForwardSlash(),Qy}function hVe(e){return n$(CM.toUrl(`../${e}`))}function o$(e){return i$().getDerivedResource({url:e}).url}var $M;function jy(e){return l($M)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(CM.toUrl)?$M=hVe:$M=o$),$M(e)}jy._cesiumScriptRegex=t$;jy._buildModuleUrlFromBaseUrl=o$;jy._clearBaseResource=function(){Qy=void 0};jy.setBaseUrl=function(e){Qy=Ee.DEFAULT.getDerivedResource({url:e})};jy.getCesiumBaseUrl=i$;var nn=jy;var UZt=T(S(),1);function fVe(e,t,n){this.x=e,this.y=t,this.s=n}var qy=fVe;function nY(e){e=y(e,y.EMPTY_OBJECT),this._xysFileUrlTemplate=Ee.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=y(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=y(e.sampleZeroJulianEphemerisDate,24423965e-1),this._sampleZeroDateTT=new q(this._sampleZeroJulianEphemerisDate,0,Hn.TAI),this._stepSizeDays=y(e.stepSizeDays,1),this._samplesPerXysFile=y(e.samplesPerXysFile,1e3),this._totalSamples=y(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 pVe=new q(0,0,Hn.TAI);function eY(e,t,n){let i=pVe;return i.dayNumber=t,i.secondsOfDay=n,q.daysDifference(i,e._sampleZeroDateTT)}nY.prototype.preload=function(e,t,n,i){let o=eY(this,e,t),r=eY(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(tY(this,m));return Promise.all(u)};nY.prototype.computeXysRadians=function(e,t,n){let i=eY(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])||(tY(this,s/this._samplesPerXysFile|0),c=!0),l(d[a*3])||(tY(this,a/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new qy(0,0,0);let u=i-s*this._stepSizeDays,m=this._work,p=this._denominators,g=this._coef,f=this._xTable,x,_;for(x=0;x<=r;++x)m[x]=u-f[x];for(x=0;x<=r;++x){for(g[x]=1,_=0;_<=r;++_)_!==x&&(g[x]*=m[_]);g[x]*=p[x];let C=(s+x)*3;n.x+=g[x]*d[C++],n.y+=g[x]*d[C++],n.s+=g[x]*d[C]}return n};function tY(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 Ee({url:nn(`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 HL=nY;var oGt=T(S(),1);function rt(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0),this.w=y(i,0)}var zL=new h;rt.fromAxisAngle=function(e,t,n){let i=t/2,o=Math.sin(i);zL=h.normalize(e,zL);let r=zL.x*o,s=zL.y*o,a=zL.z*o,c=Math.cos(i);return l(n)?(n.x=r,n.y=s,n.z=a,n.w=c,n):new rt(r,s,a,c)};var bVe=[1,2,0],gVe=new Array(3);rt.fromRotationMatrix=function(e,t){let n,i,o,r,s,a=e[$.COLUMN0ROW0],c=e[$.COLUMN1ROW1],d=e[$.COLUMN2ROW2],u=a+c+d;if(u>0)n=Math.sqrt(u+1),s=.5*n,n=.5/n,i=(e[$.COLUMN1ROW2]-e[$.COLUMN2ROW1])*n,o=(e[$.COLUMN2ROW0]-e[$.COLUMN0ROW2])*n,r=(e[$.COLUMN0ROW1]-e[$.COLUMN1ROW0])*n;else{let m=bVe,p=0;c>a&&(p=1),d>a&&d>c&&(p=2);let g=m[p],f=m[g];n=Math.sqrt(e[$.getElementIndex(p,p)]-e[$.getElementIndex(g,g)]-e[$.getElementIndex(f,f)]+1);let x=gVe;x[p]=.5*n,n=.5/n,s=(e[$.getElementIndex(f,g)]-e[$.getElementIndex(g,f)])*n,x[g]=(e[$.getElementIndex(g,p)]+e[$.getElementIndex(p,g)])*n,x[f]=(e[$.getElementIndex(f,p)]+e[$.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 rt(i,o,r,s)};var r$=new rt,s$=new rt,iY=new rt,a$=new rt;rt.fromHeadingPitchRoll=function(e,t){return a$=rt.fromAxisAngle(h.UNIT_X,e.roll,r$),iY=rt.fromAxisAngle(h.UNIT_Y,-e.pitch,t),t=rt.multiply(iY,a$,iY),s$=rt.fromAxisAngle(h.UNIT_Z,-e.heading,r$),rt.multiply(s$,t,t)};var eN=new h,oY=new h,fm=new rt,c$=new rt,tN=new rt;rt.packedLength=4;rt.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};rt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new rt),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};rt.packedInterpolationLength=3;rt.convertPackedArrayForInterpolation=function(e,t,n,i){rt.unpack(e,n*4,tN),rt.conjugate(tN,tN);for(let o=0,r=n-t+1;o<r;o++){let s=o*3;rt.unpack(e,(t+o)*4,fm),rt.multiply(fm,tN,fm),fm.w<0&&rt.negate(fm,fm),rt.computeAxis(fm,eN);let a=rt.computeAngle(fm);l(i)||(i=[]),i[s]=eN.x*a,i[s+1]=eN.y*a,i[s+2]=eN.z*a}};rt.unpackInterpolationResult=function(e,t,n,i,o){l(o)||(o=new rt),h.fromArray(e,0,oY);let r=h.magnitude(oY);return rt.unpack(t,i*4,c$),r===0?rt.clone(rt.IDENTITY,fm):rt.fromAxisAngle(oY,r,fm),rt.multiply(fm,c$,o)};rt.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 rt(e.x,e.y,e.z,e.w)};rt.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};rt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};rt.magnitude=function(e){return Math.sqrt(rt.magnitudeSquared(e))};rt.normalize=function(e,t){let n=1/rt.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};rt.inverse=function(e,t){let n=rt.magnitudeSquared(e);return t=rt.conjugate(e,t),rt.multiplyByScalar(t,1/n,t)};rt.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};rt.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};rt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};rt.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};rt.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,g=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=g,n.w=f,n};rt.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};rt.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};rt.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};rt.computeAngle=function(e){return Math.abs(e.w-1)<W.EPSILON6?0:2*Math.acos(e.w)};var rY=new rt;rt.lerp=function(e,t,n,i){return rY=rt.multiplyByScalar(t,n,rY),i=rt.multiplyByScalar(e,1-n,i),rt.add(rY,i,i)};var l$=new rt,sY=new rt,aY=new rt;rt.slerp=function(e,t,n,i){let o=rt.dot(e,t),r=t;if(o<0&&(o=-o,r=l$=rt.negate(t,l$)),1-o<W.EPSILON6)return rt.lerp(e,r,n,i);let s=Math.acos(o);return sY=rt.multiplyByScalar(e,Math.sin((1-n)*s),sY),aY=rt.multiplyByScalar(r,Math.sin(n*s),aY),i=rt.add(sY,aY,i),rt.multiplyByScalar(i,1/Math.sin(s),i)};rt.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)};rt.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 yVe=new h,xVe=new h,KL=new rt,FS=new rt;rt.computeInnerQuadrangle=function(e,t,n,i){let o=rt.conjugate(t,KL);rt.multiply(o,n,FS);let r=rt.log(FS,yVe);rt.multiply(o,e,FS);let s=rt.log(FS,xVe);return h.add(r,s,r),h.multiplyByScalar(r,.25,r),h.negate(r,r),rt.exp(r,KL),rt.multiply(t,KL,i)};rt.squad=function(e,t,n,i,o,r){let s=rt.slerp(e,t,o,KL),a=rt.slerp(n,i,o,FS);return rt.slerp(s,a,2*o*(1-o),r)};var _Ve=new rt,d$=1.9011074535173003,nN=Ot.supportsTypedArrays()?new Float32Array(8):[],iN=Ot.supportsTypedArrays()?new Float32Array(8):[],up=Ot.supportsTypedArrays()?new Float32Array(8):[],mp=Ot.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;nN[e]=1/(t*n),iN[e]=t/n}nN[7]=d$/(8*17);iN[7]=d$*8/17;rt.fastSlerp=function(e,t,n,i){let o=rt.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 g=7;g>=0;--g)up[g]=(nN[g]*c-iN[g])*s,mp[g]=(nN[g]*d-iN[g])*s;let u=r*n*(1+up[0]*(1+up[1]*(1+up[2]*(1+up[3]*(1+up[4]*(1+up[5]*(1+up[6]*(1+up[7])))))))),m=a*(1+mp[0]*(1+mp[1]*(1+mp[2]*(1+mp[3]*(1+mp[4]*(1+mp[5]*(1+mp[6]*(1+mp[7])))))))),p=rt.multiplyByScalar(e,m,_Ve);return rt.multiplyByScalar(t,u,i),rt.add(p,i,i)};rt.fastSquad=function(e,t,n,i,o,r){let s=rt.fastSlerp(e,t,o,KL),a=rt.fastSlerp(n,i,o,FS);return rt.fastSlerp(s,a,2*o*(1-o),r)};rt.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};rt.equalsEpsilon=function(e,t,n){return n=y(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};rt.ZERO=Object.freeze(new rt(0,0,0,0));rt.IDENTITY=Object.freeze(new rt(0,0,0,1));rt.prototype.clone=function(e){return rt.clone(this,e)};rt.prototype.equals=function(e){return rt.equals(this,e)};rt.prototype.equalsEpsilon=function(e,t){return rt.equalsEpsilon(this,e,t)};rt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var we=rt;var li={},cY={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"}},AS={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},lY={},pl={east:new h,north:new h,up:new h,west:new h,south:new h,down:new h},Sb=new h,Cb=new h,Vb=new h;li.localFrameToFixedFrameGenerator=function(e,t){if(!cY.hasOwnProperty(e)||!cY[e].hasOwnProperty(t))throw new pe("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=cY[e][t],i,o=e+t;return l(lY[o])?i=lY[o]:(i=function(r,s,a){if(l(a)||(a=new F),h.equalsEpsilon(r,h.ZERO,W.EPSILON14))h.unpack(AS[e],0,Sb),h.unpack(AS[t],0,Cb),h.unpack(AS[n],0,Vb);else if(W.equalsEpsilon(r.x,0,W.EPSILON14)&&W.equalsEpsilon(r.y,0,W.EPSILON14)){let c=W.sign(r.z);h.unpack(AS[e],0,Sb),e!=="east"&&e!=="west"&&h.multiplyByScalar(Sb,c,Sb),h.unpack(AS[t],0,Cb),t!=="east"&&t!=="west"&&h.multiplyByScalar(Cb,c,Cb),h.unpack(AS[n],0,Vb),n!=="east"&&n!=="west"&&h.multiplyByScalar(Vb,c,Vb)}else{s=y(s,ne.default),s.geodeticSurfaceNormal(r,pl.up);let c=pl.up,d=pl.east;d.x=-r.y,d.y=r.x,d.z=0,h.normalize(d,pl.east),h.cross(c,d,pl.north),h.multiplyByScalar(pl.up,-1,pl.down),h.multiplyByScalar(pl.east,-1,pl.west),h.multiplyByScalar(pl.north,-1,pl.south),Sb=pl[e],Cb=pl[t],Vb=pl[n]}return a[0]=Sb.x,a[1]=Sb.y,a[2]=Sb.z,a[3]=0,a[4]=Cb.x,a[5]=Cb.y,a[6]=Cb.z,a[7]=0,a[8]=Vb.x,a[9]=Vb.y,a[10]=Vb.z,a[11]=0,a[12]=r.x,a[13]=r.y,a[14]=r.z,a[15]=1,a},lY[o]=i),i};li.eastNorthUpToFixedFrame=li.localFrameToFixedFrameGenerator("east","north");li.northEastDownToFixedFrame=li.localFrameToFixedFrameGenerator("north","east");li.northUpEastToFixedFrame=li.localFrameToFixedFrameGenerator("north","up");li.northWestUpToFixedFrame=li.localFrameToFixedFrameGenerator("north","west");var TVe=new we,SVe=new h(1,1,1),CVe=new F;li.headingPitchRollToFixedFrame=function(e,t,n,i,o){i=y(i,li.eastNorthUpToFixedFrame);let r=we.fromHeadingPitchRoll(t,TVe),s=F.fromTranslationQuaternionRotationScale(h.ZERO,r,SVe,CVe);return o=i(e,n,o),F.multiply(o,s,o)};var VVe=new F,LVe=new $;li.headingPitchRollQuaternion=function(e,t,n,i,o){let r=li.headingPitchRollToFixedFrame(e,t,n,i,VVe),s=F.getMatrix3(r,LVe);return we.fromRotationMatrix(s,o)};var RVe=new h(1,1,1),ZVe=new h,u$=new F,GVe=new F,EVe=new $,XVe=new we;li.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=y(t,ne.default),n=y(n,li.eastNorthUpToFixedFrame),l(i)||(i=new _a);let o=F.getTranslation(e,ZVe);if(h.equals(o,h.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let r=F.inverseTransformation(n(o,t,u$),u$),s=F.setScale(e,RVe,GVe);s=F.setTranslation(s,h.ZERO,s),r=F.multiply(r,s,r);let a=we.fromRotationMatrix(F.getMatrix3(r,EVe),XVe);return a=we.normalize(a,a),_a.fromQuaternion(a,i)};var IVe=6*3600+41*60+50.54841,WVe=8640184812866e-6,PVe=.093104,vVe=-62e-7,wVe=11772758384668e-32,FVe=72921158553e-15,AVe=W.TWO_PI/86400,oN=new q;li.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=li.computeIcrfToFixedMatrix(e,t);return l(n)||(n=li.computeTemeToPseudoFixedMatrix(e,t)),n};li.computeTemeToPseudoFixedMatrix=function(e,t){oN=q.addSeconds(e,-q.computeTaiMinusUtc(e),oN);let n=oN.dayNumber,i=oN.secondsOfDay,o,r=n-2451545;i>=43200?o=(r+.5)/zn.DAYS_PER_JULIAN_CENTURY:o=(r-.5)/zn.DAYS_PER_JULIAN_CENTURY;let a=(IVe+o*(WVe+o*(PVe+o*vVe)))*AVe%W.TWO_PI,c=FVe+wVe*(n-24515455e-1),d=(i+zn.SECONDS_PER_DAY*.5)%zn.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 $(m,p,0,-p,m,0,0,0,1)};li.iau2006XysData=new HL;li.earthOrientationParameters=OL.NONE;var mY=32.184,MVe=2451545;li.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+mY,i=e.stop.dayNumber,o=e.stop.secondsOfDay+mY;return li.iau2006XysData.preload(t,n,i,o)};li.computeIcrfToFixedMatrix=function(e,t){l(t)||(t=new $);let n=li.computeFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var NVe=32.184,kVe=2451545,rN=new _a,UVe=new $,DVe=new q;li.computeMoonFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=q.addSeconds(e,NVe,DVe),i=q.totalDays(n)-kVe,o=W.toRadians(12.112)-W.toRadians(.052992)*i,r=W.toRadians(24.224)-W.toRadians(.105984)*i,s=W.toRadians(227.645)+W.toRadians(13.012)*i,a=W.toRadians(261.105)+W.toRadians(13.340716)*i,c=W.toRadians(358)+W.toRadians(.9856)*i;return rN.pitch=W.toRadians(180)-W.toRadians(3.878)*Math.sin(o)-W.toRadians(.12)*Math.sin(r)+W.toRadians(.07)*Math.sin(s)-W.toRadians(.017)*Math.sin(a),rN.roll=W.toRadians(66.53-90)+W.toRadians(1.543)*Math.cos(o)+W.toRadians(.24)*Math.cos(r)-W.toRadians(.028)*Math.cos(s)+W.toRadians(.007)*Math.cos(a),rN.heading=W.toRadians(244.375-90)+W.toRadians(13.17635831)*i+W.toRadians(3.558)*Math.sin(o)+W.toRadians(.121)*Math.sin(r)-W.toRadians(.064)*Math.sin(s)+W.toRadians(.016)*Math.sin(a)+W.toRadians(.025)*Math.sin(c),$.fromHeadingPitchRoll(rN,UVe)};li.computeIcrfToMoonFixedMatrix=function(e,t){l(t)||(t=new $);let n=li.computeMoonFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var BVe=new qy(0,0,0),YVe=new xb(0,0,0,0,0,0),dY=new $,uY=new $;li.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=li.earthOrientationParameters.compute(e,YVe);if(!l(n))return;let i=e.dayNumber,o=e.secondsOfDay+mY,r=li.iau2006XysData.computeXysRadians(i,o,BVe);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=dY;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=$.fromRotationZ(-r.s,uY),m=$.multiply(d,u,dY),p=e.dayNumber,g=e.secondsOfDay-q.computeTaiMinusUtc(e)+n.ut1MinusUtc,f=p-2451545,x=g/zn.SECONDS_PER_DAY,_=.779057273264+x+.00273781191135448*(f+x);_=_%1*W.TWO_PI;let C=$.fromRotationZ(_,uY),V=$.multiply(m,C,dY),L=Math.cos(n.xPoleWander),Z=Math.cos(n.yPoleWander),E=Math.sin(n.xPoleWander),X=Math.sin(n.yPoleWander),v=i-MVe+o/zn.SECONDS_PER_DAY;v/=36525;let P=-47e-6*v*W.RADIANS_PER_DEGREE/3600,A=Math.cos(P),M=Math.sin(P),b=uY;return b[0]=L*A,b[1]=L*M,b[2]=E,b[3]=-Z*M+X*E*A,b[4]=Z*A+X*E*M,b[5]=-X*L,b[6]=-X*M-Z*E*A,b[7]=X*A-Z*E*M,b[8]=Z*L,$.multiply(V,b,t)};var OVe=new se;li.pointToWindowCoordinates=function(e,t,n,i){return i=li.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};li.pointToGLWindowCoordinates=function(e,t,n,i){l(i)||(i=new D);let o=OVe;return F.multiplyByVector(e,se.fromElements(n.x,n.y,n.z,1,o),o),se.multiplyByScalar(o,1/o.w,o),F.multiplyByVector(t,o,o),D.fromCartesian4(o,i)};var HVe=new h,zVe=new h,KVe=new h;li.rotationMatrixFromPositionVelocity=function(e,t,n,i){let o=y(n,ne.default).geodeticSurfaceNormal(e,HVe),r=h.cross(t,o,zVe);h.equalsEpsilon(r,h.ZERO,W.EPSILON6)&&(r=h.clone(h.UNIT_X,r));let s=h.cross(r,t,KVe);return h.normalize(s,s),h.cross(t,s,r),h.negate(r,r),h.normalize(r,r),l(i)||(i=new $),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 m$=new F(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),h$=new he,hY=new h,JVe=new h,QVe=new $,fY=new F,f$=new F;li.basisTo2D=function(e,t,n){let i=F.getTranslation(t,JVe),o=e.ellipsoid,r;if(h.equals(i,h.ZERO))r=h.clone(h.ZERO,hY);else{let u=o.cartesianToCartographic(i,h$);r=e.project(u,hY),h.fromElements(r.z,r.x,r.y,r)}let s=li.eastNorthUpToFixedFrame(i,o,fY),a=F.inverseTransformation(s,f$),c=F.getMatrix3(t,QVe),d=F.multiplyByMatrix3(a,c,n);return F.multiply(m$,d,n),F.setTranslation(n,r,n),n};li.ellipsoidTo2DModelMatrix=function(e,t,n){let i=e.ellipsoid,o=li.eastNorthUpToFixedFrame(t,i,fY),r=F.inverseTransformation(o,f$),s=i.cartesianToCartographic(t,h$),a=e.project(s,hY);h.fromElements(a.z,a.x,a.y,a);let c=F.fromTranslation(a,fY);return F.multiply(m$,r,n),F.multiply(c,n,n),n};var wt=li;function Xn(e,t,n,i){this.west=y(e,0),this.south=y(t,0),this.east=y(n,0),this.north=y(i,0)}Object.defineProperties(Xn.prototype,{width:{get:function(){return Xn.computeWidth(this)}},height:{get:function(){return Xn.computeHeight(this)}}});Xn.packedLength=4;Xn.pack=function(e,t,n){return n=y(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t};Xn.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Xn),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};Xn.computeWidth=function(e){let t=e.east,n=e.west;return t<n&&(t+=W.TWO_PI),t-n};Xn.computeHeight=function(e){return e.north-e.south};Xn.fromDegrees=function(e,t,n,i,o){return e=W.toRadians(y(e,0)),t=W.toRadians(y(t,0)),n=W.toRadians(y(n,0)),i=W.toRadians(y(i,0)),l(o)?(o.west=e,o.south=t,o.east=n,o.north=i,o):new Xn(e,t,n,i)};Xn.fromRadians=function(e,t,n,i,o){return l(o)?(o.west=y(e,0),o.south=y(t,0),o.east=y(n,0),o.north=y(i,0),o):new Xn(e,t,n,i)};Xn.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 Xn(n,s,i,a)};Xn.fromCartesianArray=function(e,t,n){t=y(t,ne.default);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 Xn(i,a,o,c)};var jVe=new h,qVe=new h,$Ve=new h,eLe=new h,tLe=new h,pY=new Array(5);for(let e=0;e<pY.length;++e)pY[e]=new h;Xn.fromBoundingSphere=function(e,t,n){let i=e.center,o=e.radius;if(l(t)||(t=ne.default),l(n)||(n=new Xn),h.equals(i,h.ZERO))return Xn.clone(Xn.MAX_VALUE,n),n;let r=wt.eastNorthUpToFixedFrame(i,t,jVe),s=F.multiplyByPointAsVector(r,h.UNIT_X,qVe);h.normalize(s,s);let a=F.multiplyByPointAsVector(r,h.UNIT_Y,$Ve);h.normalize(a,a),h.multiplyByScalar(a,o,a),h.multiplyByScalar(s,o,s);let c=h.negate(a,tLe),d=h.negate(s,eLe),u=pY,m=u[0];return h.add(i,a,m),m=u[1],h.add(i,d,m),m=u[2],h.add(i,c,m),m=u[3],h.add(i,s,m),u[4]=i,Xn.fromCartesianArray(u,t,n)};Xn.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 Xn(e.west,e.south,e.east,e.north)};Xn.equalsEpsilon=function(e,t,n){return n=y(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};Xn.prototype.clone=function(e){return Xn.clone(this,e)};Xn.prototype.equals=function(e){return Xn.equals(this,e)};Xn.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};Xn.prototype.equalsEpsilon=function(e,t){return Xn.equalsEpsilon(this,e,t)};Xn.validate=function(e){};Xn.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)};Xn.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)};Xn.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)};Xn.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)};Xn.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)};Xn.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 Xn(a,d,c,u)};Xn.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 Xn(i,o,r,s)};Xn.union=function(e,t,n){l(n)||(n=new Xn);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};Xn.expand=function(e,t,n){return l(n)||(n=new Xn),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};Xn.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 nLe=new he;Xn.subsample=function(e,t,n,i){t=y(t,ne.default),n=y(n,0),l(i)||(i=[]);let o=0,r=e.north,s=e.south,a=e.east,c=e.west,d=nLe;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,Xn.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};Xn.subsection=function(e,t,n,i,o,r){if(l(r)||(r=new Xn),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};Xn.MAX_VALUE=Object.freeze(new Xn(-Math.PI,-W.PI_OVER_TWO,Math.PI,W.PI_OVER_TWO));var ae=Xn;function Rr(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.width=y(n,0),this.height=y(i,0)}Rr.packedLength=4;Rr.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t};Rr.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Rr),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};Rr.fromPoints=function(e,t){if(l(t)||(t=new Rr),!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 p$=new Li,iLe=new he,oLe=new he;Rr.fromRectangle=function(e,t,n){if(l(n)||(n=new Rr),!l(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;p$._ellipsoid=ne.default,t=y(t,p$);let i=t.project(ae.southwest(e,iLe)),o=t.project(ae.northeast(e,oLe));return D.subtract(o,i,o),n.x=i.x,n.y=i.y,n.width=o.x,n.height=o.y,n};Rr.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 Rr(e.x,e.y,e.width,e.height)};Rr.union=function(e,t,n){l(n)||(n=new Rr);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};Rr.expand=function(e,t,n){n=Rr.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};Rr.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?Kt.OUTSIDE:Kt.INTERSECTING};Rr.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};Rr.prototype.clone=function(e){return Rr.clone(this,e)};Rr.prototype.intersect=function(e){return Rr.intersect(this,e)};Rr.prototype.equals=function(e){return Rr.equals(this,e)};var Ke=Rr;var KGt=T(S(),1);var Ta={POINTS:ie.POINTS,LINES:ie.LINES,LINE_LOOP:ie.LINE_LOOP,LINE_STRIP:ie.LINE_STRIP,TRIANGLES:ie.TRIANGLES,TRIANGLE_STRIP:ie.TRIANGLE_STRIP,TRIANGLE_FAN:ie.TRIANGLE_FAN};Ta.isLines=function(e){return e===Ta.LINES||e===Ta.LINE_LOOP||e===Ta.LINE_STRIP};Ta.isTriangles=function(e){return e===Ta.TRIANGLES||e===Ta.TRIANGLE_STRIP||e===Ta.TRIANGLE_FAN};Ta.validate=function(e){return e===Ta.POINTS||e===Ta.LINES||e===Ta.LINE_LOOP||e===Ta.LINE_STRIP||e===Ta.TRIANGLES||e===Ta.TRIANGLE_STRIP||e===Ta.TRIANGLE_FAN};var Fe=Object.freeze(Ta);var QGt=T(S(),1),$y=`in vec4 position;
in vec2 textureCoordinates;

out vec2 v_textureCoordinates;

void main() 
{
    gl_Position = position;
    v_textureCoordinates = textureCoordinates;
}
`;var tEt=T(S(),1);var hr={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 JL(e){e=y(e,y.EMPTY_OBJECT),this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._modelMatrix=e.modelMatrix,this._primitiveType=y(e.primitiveType,Fe.TRIANGLES),this._vertexArray=e.vertexArray,this._count=e.count,this._offset=y(e.offset,0),this._instanceCount=y(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=y(e.cull,!0),this.occlude=y(e.occlude,!0),this.executeInClosestFrustum=y(e.executeInClosestFrustum,!1),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.castShadows=y(e.castShadows,!1),this.receiveShadows=y(e.receiveShadows,!1),this.pickOnly=y(e.pickOnly,!1),this.depthForTranslucentClassification=y(e.depthForTranslucentClassification,!1),this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}function ja(e,t){return(e._flags&t)===t}function Lb(e,t,n){n?e._flags|=t:e._flags&=~t}Object.defineProperties(JL.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 ja(this,hr.CULL)},set:function(e){ja(this,hr.CULL)!==e&&(Lb(this,hr.CULL,e),this.dirty=!0)}},occlude:{get:function(){return ja(this,hr.OCCLUDE)},set:function(e){ja(this,hr.OCCLUDE)!==e&&(Lb(this,hr.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 ja(this,hr.CAST_SHADOWS)},set:function(e){ja(this,hr.CAST_SHADOWS)!==e&&(Lb(this,hr.CAST_SHADOWS,e),this.dirty=!0)}},receiveShadows:{get:function(){return ja(this,hr.RECEIVE_SHADOWS)},set:function(e){ja(this,hr.RECEIVE_SHADOWS)!==e&&(Lb(this,hr.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 ja(this,hr.EXECUTE_IN_CLOSEST_FRUSTUM)},set:function(e){ja(this,hr.EXECUTE_IN_CLOSEST_FRUSTUM)!==e&&(Lb(this,hr.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 ja(this,hr.DEBUG_SHOW_BOUNDING_VOLUME)},set:function(e){ja(this,hr.DEBUG_SHOW_BOUNDING_VOLUME)!==e&&(Lb(this,hr.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 ja(this,hr.PICK_ONLY)},set:function(e){ja(this,hr.PICK_ONLY)!==e&&(Lb(this,hr.PICK_ONLY,e),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return ja(this,hr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)},set:function(e){ja(this,hr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==e&&(Lb(this,hr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,e),this.dirty=!0)}}});JL.shallowClone=function(e,t){if(l(e))return l(t)||(t=new JL),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};JL.prototype.execute=function(e,t){e.draw(this,t)};var tt=JL;var bEt=T(S(),1);var cEt=T(S(),1);var oEt=T(S(),1);var di={UNSIGNED_BYTE:ie.UNSIGNED_BYTE,UNSIGNED_SHORT:ie.UNSIGNED_SHORT,UNSIGNED_INT:ie.UNSIGNED_INT,FLOAT:ie.FLOAT,HALF_FLOAT:ie.HALF_FLOAT_OES,UNSIGNED_INT_24_8:ie.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:ie.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:ie.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:ie.UNSIGNED_SHORT_5_6_5};di.toWebGLConstant=function(e,t){switch(e){case di.UNSIGNED_BYTE:return ie.UNSIGNED_BYTE;case di.UNSIGNED_SHORT:return ie.UNSIGNED_SHORT;case di.UNSIGNED_INT:return ie.UNSIGNED_INT;case di.FLOAT:return ie.FLOAT;case di.HALF_FLOAT:return t.webgl2?ie.HALF_FLOAT:ie.HALF_FLOAT_OES;case di.UNSIGNED_INT_24_8:return ie.UNSIGNED_INT_24_8;case di.UNSIGNED_SHORT_4_4_4_4:return ie.UNSIGNED_SHORT_4_4_4_4;case di.UNSIGNED_SHORT_5_5_5_1:return ie.UNSIGNED_SHORT_5_5_5_1;case di.UNSIGNED_SHORT_5_6_5:return di.UNSIGNED_SHORT_5_6_5}};di.isPacked=function(e){return e===di.UNSIGNED_INT_24_8||e===di.UNSIGNED_SHORT_4_4_4_4||e===di.UNSIGNED_SHORT_5_5_5_1||e===di.UNSIGNED_SHORT_5_6_5};di.sizeInBytes=function(e){switch(e){case di.UNSIGNED_BYTE:return 1;case di.UNSIGNED_SHORT:case di.UNSIGNED_SHORT_4_4_4_4:case di.UNSIGNED_SHORT_5_5_5_1:case di.UNSIGNED_SHORT_5_6_5:case di.HALF_FLOAT:return 2;case di.UNSIGNED_INT:case di.FLOAT:case di.UNSIGNED_INT_24_8:return 4}};di.validate=function(e){return e===di.UNSIGNED_BYTE||e===di.UNSIGNED_SHORT||e===di.UNSIGNED_INT||e===di.FLOAT||e===di.HALF_FLOAT||e===di.UNSIGNED_INT_24_8||e===di.UNSIGNED_SHORT_4_4_4_4||e===di.UNSIGNED_SHORT_5_5_5_1||e===di.UNSIGNED_SHORT_5_6_5};di.getTypedArrayConstructor=function(e){let t=di.sizeInBytes(e);return t===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:t===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:t===Float32Array.BYTES_PER_ELEMENT&&e===di.FLOAT?Float32Array:Uint32Array};var nt=Object.freeze(di);var lt={DEPTH_COMPONENT:ie.DEPTH_COMPONENT,DEPTH_STENCIL:ie.DEPTH_STENCIL,ALPHA:ie.ALPHA,RED:ie.RED,RG:ie.RG,RGB:ie.RGB,RGBA:ie.RGBA,LUMINANCE:ie.LUMINANCE,LUMINANCE_ALPHA:ie.LUMINANCE_ALPHA,RGB_DXT1:ie.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:ie.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:ie.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:ie.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:ie.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:ie.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:ie.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:ie.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:ie.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:ie.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:ie.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:ie.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:ie.COMPRESSED_RGBA_BPTC_UNORM};lt.componentsLength=function(e){switch(e){case lt.RGB:return 3;case lt.RGBA:return 4;case lt.LUMINANCE_ALPHA:case lt.RG:return 2;case lt.ALPHA:case lt.RED:case lt.LUMINANCE:return 1;default:return 1}};lt.validate=function(e){return e===lt.DEPTH_COMPONENT||e===lt.DEPTH_STENCIL||e===lt.ALPHA||e===lt.RED||e===lt.RG||e===lt.RGB||e===lt.RGBA||e===lt.LUMINANCE||e===lt.LUMINANCE_ALPHA||e===lt.RGB_DXT1||e===lt.RGBA_DXT1||e===lt.RGBA_DXT3||e===lt.RGBA_DXT5||e===lt.RGB_PVRTC_4BPPV1||e===lt.RGB_PVRTC_2BPPV1||e===lt.RGBA_PVRTC_4BPPV1||e===lt.RGBA_PVRTC_2BPPV1||e===lt.RGBA_ASTC||e===lt.RGB_ETC1||e===lt.RGB8_ETC2||e===lt.RGBA8_ETC2_EAC||e===lt.RGBA_BC7};lt.isColorFormat=function(e){return e===lt.RED||e===lt.ALPHA||e===lt.RGB||e===lt.RGBA||e===lt.LUMINANCE||e===lt.LUMINANCE_ALPHA};lt.isDepthFormat=function(e){return e===lt.DEPTH_COMPONENT||e===lt.DEPTH_STENCIL};lt.isCompressedFormat=function(e){return e===lt.RGB_DXT1||e===lt.RGBA_DXT1||e===lt.RGBA_DXT3||e===lt.RGBA_DXT5||e===lt.RGB_PVRTC_4BPPV1||e===lt.RGB_PVRTC_2BPPV1||e===lt.RGBA_PVRTC_4BPPV1||e===lt.RGBA_PVRTC_2BPPV1||e===lt.RGBA_ASTC||e===lt.RGB_ETC1||e===lt.RGB8_ETC2||e===lt.RGBA8_ETC2_EAC||e===lt.RGBA_BC7};lt.isDXTFormat=function(e){return e===lt.RGB_DXT1||e===lt.RGBA_DXT1||e===lt.RGBA_DXT3||e===lt.RGBA_DXT5};lt.isPVRTCFormat=function(e){return e===lt.RGB_PVRTC_4BPPV1||e===lt.RGB_PVRTC_2BPPV1||e===lt.RGBA_PVRTC_4BPPV1||e===lt.RGBA_PVRTC_2BPPV1};lt.isASTCFormat=function(e){return e===lt.RGBA_ASTC};lt.isETC1Format=function(e){return e===lt.RGB_ETC1};lt.isETC2Format=function(e){return e===lt.RGB8_ETC2||e===lt.RGBA8_ETC2_EAC};lt.isBC7Format=function(e){return e===lt.RGBA_BC7};lt.compressedTextureSizeInBytes=function(e,t,n){switch(e){case lt.RGB_DXT1:case lt.RGBA_DXT1:case lt.RGB_ETC1:case lt.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case lt.RGBA_DXT3:case lt.RGBA_DXT5:case lt.RGBA_ASTC:case lt.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case lt.RGB_PVRTC_4BPPV1:case lt.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case lt.RGB_PVRTC_2BPPV1:case lt.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case lt.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};lt.textureSizeInBytes=function(e,t,n,i){let o=lt.componentsLength(e);return nt.isPacked(t)&&(o=1),o*nt.sizeInBytes(t)*n*i};lt.alignmentInBytes=function(e,t,n){let i=lt.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};lt.createTypedArray=function(e,t,n,i){let o=nt.getTypedArrayConstructor(t),r=lt.componentsLength(e)*n*i;return new o(r)};lt.flipY=function(e,t,n,i,o){if(o===1)return e;let r=lt.createTypedArray(t,n,i,o),s=lt.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};lt.toInternalFormat=function(e,t,n){if(!n.webgl2)return e;if(e===lt.DEPTH_STENCIL)return ie.DEPTH24_STENCIL8;if(e===lt.DEPTH_COMPONENT){if(t===nt.UNSIGNED_SHORT)return ie.DEPTH_COMPONENT16;if(t===nt.UNSIGNED_INT)return ie.DEPTH_COMPONENT24}if(t===nt.FLOAT)switch(e){case lt.RGBA:return ie.RGBA32F;case lt.RGB:return ie.RGB32F;case lt.RG:return ie.RG32F;case lt.RED:return ie.R32F}if(t===nt.HALF_FLOAT)switch(e){case lt.RGBA:return ie.RGBA16F;case lt.RGB:return ie.RGB16F;case lt.RG:return ie.RG16F;case lt.RED:return ie.R16F}return e};var at=Object.freeze(lt);var dEt=T(S(),1),fr={_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(fr,{maximumCombinedTextureImageUnits:{get:function(){return fr._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return fr._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return fr._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return fr._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return fr._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return fr._maximumTextureSize}},maximumVaryingVectors:{get:function(){return fr._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return fr._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return fr._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return fr._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return fr._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return fr._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return fr._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return fr._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return fr._maximumViewportWidth}},maximumViewportHeight:{get:function(){return fr._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return fr._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return fr._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return fr._maximumColorAttachments}},maximumSamples:{get:function(){return fr._maximumSamples}},highpFloatSupported:{get:function(){return fr._highpFloatSupported}},highpIntSupported:{get:function(){return fr._highpIntSupported}}});var Dt=fr;function bY(e,t,n){let i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function sN(e,t,n){let i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function pm(e){e=y(e,y.EMPTY_OBJECT);let n=e.context._gl,i=Dt.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=y(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,bY(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,sN(this,u,a),this._activeColorAttachments[c]=u,this._colorRenderbuffers[c]=a}l(e.depthTexture)&&(s=e.depthTexture,bY(this,this._gl.DEPTH_ATTACHMENT,s),this._depthTexture=s),l(e.depthRenderbuffer)&&(a=e.depthRenderbuffer,sN(this,this._gl.DEPTH_ATTACHMENT,a),this._depthRenderbuffer=a),l(e.stencilRenderbuffer)&&(a=e.stencilRenderbuffer,sN(this,this._gl.STENCIL_ATTACHMENT,a),this._stencilRenderbuffer=a),l(e.depthStencilTexture)&&(s=e.depthStencilTexture,bY(this,this._gl.DEPTH_STENCIL_ATTACHMENT,s),this._depthStencilTexture=s),l(e.depthStencilRenderbuffer)&&(a=e.depthStencilRenderbuffer,sN(this,this._gl.DEPTH_STENCIL_ATTACHMENT,a),this._depthStencilRenderbuffer=a),this._unBind()}Object.defineProperties(pm.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)}}});pm.prototype._bind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)};pm.prototype._unBind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)};pm.prototype.bindDraw=function(){let e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)};pm.prototype.bindRead=function(){let e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)};pm.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments};pm.prototype.getColorTexture=function(e){return this._colorTextures[e]};pm.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]};pm.prototype.isDestroyed=function(){return!1};pm.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),me(this)};var js=pm;var EEt=T(S(),1);var xEt=T(S(),1);var aN={CLOCKWISE:ie.CW,COUNTER_CLOCKWISE:ie.CCW};aN.validate=function(e){return e===aN.CLOCKWISE||e===aN.COUNTER_CLOCKWISE};var os=Object.freeze(aN);var TEt=T(S(),1);function b$(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]=b$(e[t]));return Object.freeze(e)}var gY=b$;function Bh(e){let t=y(e,y.EMPTY_OBJECT),n=y(t.cull,y.EMPTY_OBJECT),i=y(t.polygonOffset,y.EMPTY_OBJECT),o=y(t.scissorTest,y.EMPTY_OBJECT),r=y(o.rectangle,y.EMPTY_OBJECT),s=y(t.depthRange,y.EMPTY_OBJECT),a=y(t.depthTest,y.EMPTY_OBJECT),c=y(t.colorMask,y.EMPTY_OBJECT),d=y(t.blending,y.EMPTY_OBJECT),u=y(d.color,y.EMPTY_OBJECT),m=y(t.stencilTest,y.EMPTY_OBJECT),p=y(m.frontOperation,y.EMPTY_OBJECT),g=y(m.backOperation,y.EMPTY_OBJECT),f=y(t.sampleCoverage,y.EMPTY_OBJECT),x=t.viewport;this.frontFace=y(t.frontFace,os.COUNTER_CLOCKWISE),this.cull={enabled:y(n.enabled,!1),face:y(n.face,ie.BACK)},this.lineWidth=y(t.lineWidth,1),this.polygonOffset={enabled:y(i.enabled,!1),factor:y(i.factor,0),units:y(i.units,0)},this.scissorTest={enabled:y(o.enabled,!1),rectangle:Ke.clone(r)},this.depthRange={near:y(s.near,0),far:y(s.far,1)},this.depthTest={enabled:y(a.enabled,!1),func:y(a.func,ie.LESS)},this.colorMask={red:y(c.red,!0),green:y(c.green,!0),blue:y(c.blue,!0),alpha:y(c.alpha,!0)},this.depthMask=y(t.depthMask,!0),this.stencilMask=y(t.stencilMask,-1),this.blending={enabled:y(d.enabled,!1),color:new Y(y(u.red,0),y(u.green,0),y(u.blue,0),y(u.alpha,0)),equationRgb:y(d.equationRgb,ie.FUNC_ADD),equationAlpha:y(d.equationAlpha,ie.FUNC_ADD),functionSourceRgb:y(d.functionSourceRgb,ie.ONE),functionSourceAlpha:y(d.functionSourceAlpha,ie.ONE),functionDestinationRgb:y(d.functionDestinationRgb,ie.ZERO),functionDestinationAlpha:y(d.functionDestinationAlpha,ie.ZERO)},this.stencilTest={enabled:y(m.enabled,!1),frontFunction:y(m.frontFunction,ie.ALWAYS),backFunction:y(m.backFunction,ie.ALWAYS),reference:y(m.reference,0),mask:y(m.mask,-1),frontOperation:{fail:y(p.fail,ie.KEEP),zFail:y(p.zFail,ie.KEEP),zPass:y(p.zPass,ie.KEEP)},backOperation:{fail:y(g.fail,ie.KEEP),zFail:y(g.zFail,ie.KEEP),zPass:y(g.zPass,ie.KEEP)}},this.sampleCoverage={enabled:y(f.enabled,!1),value:y(f.value,1),invert:y(f.invert,!1)},this.viewport=l(x)?new Ke(x.x,x.y,x.width,x.height):void 0,this.id=0,this._applyFunctions=[]}var rLe=0,Dh={};Bh.fromCache=function(e){let t=JSON.stringify(e),n=Dh[t];if(l(n))return++n.referenceCount,n.state;let i=new Bh(e),o=JSON.stringify(i);return n=Dh[o],l(n)||(i.id=rLe++,n={referenceCount:0,state:i},Dh[o]=n),++n.referenceCount,Dh[t]={referenceCount:1,state:n.state},n.state};Bh.removeFromCache=function(e){let t=new Bh(e),n=JSON.stringify(t),i=Dh[n],o=JSON.stringify(e),r=Dh[o];l(r)&&(--r.referenceCount,r.referenceCount===0&&(delete Dh[o],l(i)&&--i.referenceCount)),l(i)&&i.referenceCount===0&&delete Dh[n]};Bh.getCache=function(){return Dh};Bh.clearCache=function(){Dh={}};function ex(e,t,n){n?e.enable(t):e.disable(t)}function g$(e,t){e.frontFace(t.frontFace)}function y$(e,t){let n=t.cull,i=n.enabled;ex(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function x$(e,t){e.lineWidth(t.lineWidth)}function _$(e,t){let n=t.polygonOffset,i=n.enabled;ex(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function T$(e,t,n){let i=t.scissorTest,o=l(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(ex(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 S$(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function C$(e,t){let n=t.depthTest,i=n.enabled;ex(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function V$(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function L$(e,t){e.depthMask(t.depthMask)}function R$(e,t){e.stencilMask(t.stencilMask)}function sLe(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function Z$(e,t,n){let i=t.blending,o=l(n.blendingEnabled)?n.blendingEnabled:i.enabled;ex(e,e.BLEND,o),o&&(sLe(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function G$(e,t){let n=t.stencilTest,i=n.enabled;if(ex(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,g=p.fail,f=p.zFail,x=p.zPass;e.stencilOpSeparate(e.BACK,g,f,x)}}function E$(e,t){let n=t.sampleCoverage,i=n.enabled;ex(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}var aLe=new Ke;function X$(e,t,n){let i=y(t.viewport,n.viewport);l(i)||(i=aLe,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)}Bh.apply=function(e,t,n){g$(e,t),y$(e,t),x$(e,t),_$(e,t),S$(e,t),C$(e,t),V$(e,t),L$(e,t),R$(e,t),G$(e,t),E$(e,t),T$(e,t,n),Z$(e,t,n),X$(e,t,n)};function cLe(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(g$),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(y$),e.lineWidth!==t.lineWidth&&n.push(x$),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(_$),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(S$),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(C$),(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(V$),e.depthMask!==t.depthMask&&n.push(L$),e.stencilMask!==t.stencilMask&&n.push(R$),(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(G$),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(E$),n}Bh.partialApply=function(e,t,n,i,o,r){if(t!==n){let u=n._applyFunctions[t.id];l(u)||(u=cLe(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)&&T$(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)&&Z$(e,n,o),(t!==n||i!==o||i.context!==o.context)&&X$(e,n,o)};Bh.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:Ke.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:Y.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)?Ke.clone(e.viewport):void 0}};var Ue=Bh;var mXt=T(S(),1);var OEt=T(S(),1);var vEt=T(S(),1);function Qt(e,t,n,i){this[0]=y(e,0),this[1]=y(n,0),this[2]=y(t,0),this[3]=y(i,0)}Qt.packedLength=4;Qt.pack=function(e,t,n){return n=y(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t};Qt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Qt),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n};Qt.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)Qt.pack(e[o],t,o*4);return t};Qt.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]=Qt.unpack(e,i,t[o])}return t};Qt.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 Qt(e[0],e[2],e[1],e[3])};Qt.fromArray=Qt.unpack;Qt.fromColumnMajorArray=function(e,t){return Qt.clone(e,t)};Qt.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 Qt(e[0],e[1],e[2],e[3])};Qt.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new Qt(e.x,0,0,e.y)};Qt.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new Qt(e,0,0,e)};Qt.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 Qt(n,-i,i,n)};Qt.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]]};Qt.getElementIndex=function(e,t){return e*2+t};Qt.getColumn=function(e,t,n){let i=t*2,o=e[i],r=e[i+1];return n.x=o,n.y=r,n};Qt.setColumn=function(e,t,n,i){i=Qt.clone(e,i);let o=t*2;return i[o]=n.x,i[o+1]=n.y,i};Qt.getRow=function(e,t,n){let i=e[t],o=e[t+2];return n.x=i,n.y=o,n};Qt.setRow=function(e,t,n,i){return i=Qt.clone(e,i),i[t]=n.x,i[t+2]=n.y,i};var lLe=new D;Qt.setScale=function(e,t,n){let i=Qt.getScale(e,lLe),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 dLe=new D;Qt.setUniformScale=function(e,t,n){let i=Qt.getScale(e,dLe),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 I$=new D;Qt.getScale=function(e,t){return t.x=D.magnitude(D.fromElements(e[0],e[1],I$)),t.y=D.magnitude(D.fromElements(e[2],e[3],I$)),t};var W$=new D;Qt.getMaximumScale=function(e){return Qt.getScale(e,W$),D.maximumComponent(W$)};var uLe=new D;Qt.setRotation=function(e,t,n){let i=Qt.getScale(e,uLe);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 mLe=new D;Qt.getRotation=function(e,t){let n=Qt.getScale(e,mLe);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};Qt.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};Qt.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};Qt.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};Qt.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};Qt.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};Qt.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};Qt.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};Qt.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};Qt.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};Qt.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};Qt.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]};Qt.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]};Qt.equalsEpsilon=function(e,t,n){return n=y(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};Qt.IDENTITY=Object.freeze(new Qt(1,0,0,1));Qt.ZERO=Object.freeze(new Qt(0,0,0,0));Qt.COLUMN0ROW0=0;Qt.COLUMN0ROW1=1;Qt.COLUMN1ROW0=2;Qt.COLUMN1ROW1=3;Object.defineProperties(Qt.prototype,{length:{get:function(){return Qt.packedLength}}});Qt.prototype.clone=function(e){return Qt.clone(this,e)};Qt.prototype.equals=function(e){return Qt.equals(this,e)};Qt.prototype.equalsEpsilon=function(e,t){return Qt.equalsEpsilon(this,e,t)};Qt.prototype.toString=function(){return`(${this[0]}, ${this[2]})
(${this[1]}, ${this[3]})`};var Qi=Qt;function hLe(e,t,n,i){switch(t.type){case e.FLOAT:return new P$(e,t,n,i);case e.FLOAT_VEC2:return new v$(e,t,n,i);case e.FLOAT_VEC3:return new w$(e,t,n,i);case e.FLOAT_VEC4:return new F$(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new yY(e,t,n,i);case e.INT:case e.BOOL:return new A$(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new M$(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new N$(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 U$(e,t,n,i);case e.FLOAT_MAT3:return new D$(e,t,n,i);case e.FLOAT_MAT4:return new B$(e,t,n,i);default:throw new ue(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function P$(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}P$.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 D,this._gl=e,this._location=i}v$.prototype.set=function(){let e=this.value;D.equals(e,this._value)||(D.clone(e,this._value),this._gl.uniform2f(this._location,e.x,e.y))};function w$(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}w$.prototype.set=function(){let e=this.value;l(e.red)?Y.equals(e,this._value)||(this._value=Y.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 F$(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}F$.prototype.set=function(){let e=this.value;l(e.red)?Y.equals(e,this._value)||(this._value=Y.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 yY(e,t,n,i){this.name=n,this.value=void 0,this._gl=e,this._location=i,this.textureUnitIndex=void 0}yY.prototype.set=function(){let e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);let t=this.value;e.bindTexture(t._target,t._texture)};yY.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1};function A$(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}A$.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))};function M$(e,t,n,i){this.name=n,this.value=void 0,this._value=new D,this._gl=e,this._location=i}M$.prototype.set=function(){let e=this.value;D.equals(e,this._value)||(D.clone(e,this._value),this._gl.uniform2i(this._location,e.x,e.y))};function N$(e,t,n,i){this.name=n,this.value=void 0,this._value=new h,this._gl=e,this._location=i}N$.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 k$(e,t,n,i){this.name=n,this.value=void 0,this._value=new se,this._gl=e,this._location=i}k$.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 fLe=new Float32Array(4);function U$(e,t,n,i){this.name=n,this.value=void 0,this._value=new Qi,this._gl=e,this._location=i}U$.prototype.set=function(){if(!Qi.equalsArray(this.value,this._value,0)){Qi.clone(this.value,this._value);let e=Qi.toArray(this.value,fLe);this._gl.uniformMatrix2fv(this._location,!1,e)}};var pLe=new Float32Array(9);function D$(e,t,n,i){this.name=n,this.value=void 0,this._value=new $,this._gl=e,this._location=i}D$.prototype.set=function(){if(!$.equalsArray(this.value,this._value,0)){$.clone(this.value,this._value);let e=$.toArray(this.value,pLe);this._gl.uniformMatrix3fv(this._location,!1,e)}};var bLe=new Float32Array(16);function B$(e,t,n,i){this.name=n,this.value=void 0,this._value=new F,this._gl=e,this._location=i}B$.prototype.set=function(){if(!F.equalsArray(this.value,this._value,0)){F.clone(this.value,this._value);let e=F.toArray(this.value,bLe);this._gl.uniformMatrix4fv(this._location,!1,e)}};var QL=hLe;var nXt=T(S(),1);function gLe(e,t,n,i){switch(t.type){case e.FLOAT:return new Y$(e,t,n,i);case e.FLOAT_VEC2:return new O$(e,t,n,i);case e.FLOAT_VEC3:return new H$(e,t,n,i);case e.FLOAT_VEC4:return new z$(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new xY(e,t,n,i);case e.INT:case e.BOOL:return new K$(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new J$(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new Q$(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new j$(e,t,n,i);case e.FLOAT_MAT2:return new q$(e,t,n,i);case e.FLOAT_MAT3:return new $$(e,t,n,i);case e.FLOAT_MAT4:return new eee(e,t,n,i);default:throw new ue(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function Y$(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]}Y$.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 O$(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]}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];D.equalsArray(s,n,o)||(D.pack(s,n,o),i=!0),o+=2}i&&this._gl.uniform2fv(this._location,n)};function H$(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]}H$.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 z$(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]}z$.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)?Y.equalsArray(s,n,o)||(Y.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 xY(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}xY.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];e.activeTexture(t+o),e.bindTexture(r._target,r._texture)}};xY.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 K$(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]}K$.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 J$(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]}J$.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];D.equalsArray(s,n,o)||(D.pack(s,n,o),i=!0),o+=2}i&&this._gl.uniform2iv(this._location,n)};function Q$(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]}Q$.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 j$(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]}j$.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 q$(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]}q$.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];Qi.equalsArray(s,n,o)||(Qi.pack(s,n,o),i=!0),o+=4}i&&this._gl.uniformMatrix2fv(this._location,!1,n)};function $$(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]}$$.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];$.equalsArray(s,n,o)||($.pack(s,n,o),i=!0),o+=9}i&&this._gl.uniformMatrix3fv(this._location,!1,n)};function eee(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]}eee.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];F.equalsArray(s,n,o)||(F.pack(s,n,o),i=!0),o+=16}i&&this._gl.uniformMatrix4fv(this._location,!1,n)};var jL=gLe;var yLe=0;function hp(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=xLe(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=yLe++}hp.fromCache=function(e){return e=y(e,y.EMPTY_OBJECT),e.context.shaderCache.getShaderProgram(e)};hp.replaceCache=function(e){return e=y(e,y.EMPTY_OBJECT),e.context.shaderCache.replaceShaderProgram(e)};Object.defineProperties(hp.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return cN(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return cN(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return cN(this),this._uniformsByName}}});function tee(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 xLe(e,t){let n={};if(!Dt.highpFloatSupported||!Dt.highpIntSupported){let i,o,r,s,a=tee(e),c=tee(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 Yh="[Cesium WebGL] ";function _Le(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(`${Yh}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(r),l(c)&&c.length>0&&console.log(`${Yh}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(s),l(c)&&c.length>0&&console.log(`${Yh}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(`${Yh}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(`${Yh}Vertex shader compile log: ${c}`),console.error(`${Yh} Vertex shader source:
${n}`),d=`Vertex shader failed to compile.  Compile log: ${c}`):(c=e.getShaderInfoLog(r),console.error(`${Yh}Fragment shader compile log: ${c}`),console.error(`${Yh} Fragment shader source:
${i}`),d=`Fragment shader failed to compile.  Compile log: ${c}`),e.deleteShader(o),e.deleteShader(r),e.deleteProgram(s),new ue(d);function m(p,g){if(!l(u))return;let f=u.getTranslatedShaderSource(p);if(f===""){console.error(`${Yh}${g} shader translation failed.`);return}console.error(`${Yh}Translated ${g} shaderSource:
${f}`)}}function TLe(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 SLe(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=QL(e,a,d,u);n[d]=m,i.push(m),m._setSampler&&o.push(m)}}else{let u,m,p,g,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,g=e.getUniformLocation(t,d),g!==null&&(m.push(g),p.push(e.getUniform(t,g))))}else{m=[];for(let x=0;x<a.size;++x)g=e.getUniformLocation(t,`${d}[${x}]`),g!==null&&m.push(g);u=jL(e,a,d,m),n[d]=u,i.push(u),u._setSampler&&o.push(u)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:o}}function CLe(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=sp[s];l(c)?n.push({uniform:r,automaticUniform:c}):i.push(r)}return{automaticUniforms:n,manualUniforms:i}}function VLe(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 cN(e){l(e._program)||nee(e)}function nee(e){let t=e._program,n=e._gl,i=_Le(n,e,e._debugShaders),o=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),r=SLe(n,i),s=CLe(e,r.uniformsByName);e._program=i,e._numberOfVertexAttributes=o,e._vertexAttributes=TLe(n,i,o),e._uniformsByName=r.uniformsByName,e._uniforms=r.uniforms,e._automaticUniforms=s.automaticUniforms,e._manualUniforms=s.manualUniforms,e.maximumTextureUnitIndex=VLe(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,g=/ ! = /g;e._vertexShaderText=a.replace(g," != "),e._fragmentShaderText=c.replace(g," != ");try{nee(e),d(e._program)}catch(f){e._vertexShaderText=m,e._fragmentShaderText=p;let _=/(?:Compile|Link) error: ([^]*)/.exec(f.message);u(_?_[1]:f.message)}})}hp.prototype._bind=function(){cN(this),this._gl.useProgram(this._program)};hp.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)}};hp.prototype.isDestroyed=function(){return!1};hp.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)};hp.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),me(this)};var rn=hp;function lN(e){this._context=e}var qL,LLe=new tt({primitiveType:Fe.TRIANGLES}),RLe=new ei({color:new Y(0,0,0,0)});function ZLe(e,t){return new js({context:e,colorTextures:[t],destroyAttachments:!1})}function GLe(e,t){return rn.fromCache({context:e,vertexShaderSource:$y,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function ELe(e,t){return(!l(qL)||qL.viewport.width!==e||qL.viewport.height!==t)&&(qL=Ue.fromCache({viewport:new Ke(0,0,e,t)})),qL}lN.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:GLe(o,e.fragmentShaderSource),a=ZLe(o,t),c=ELe(n,i),d=e.uniformMap,u=RLe;u.framebuffer=a,u.renderState=c,u.execute(o);let m=LLe;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)};lN.prototype.isDestroyed=function(){return!1};lN.prototype.destroy=function(){return me(this)};var $L=lN;var G5t=T(S(),1);var XXt=T(S(),1);var Zn={BYTE:ie.BYTE,UNSIGNED_BYTE:ie.UNSIGNED_BYTE,SHORT:ie.SHORT,UNSIGNED_SHORT:ie.UNSIGNED_SHORT,INT:ie.INT,UNSIGNED_INT:ie.UNSIGNED_INT,FLOAT:ie.FLOAT,DOUBLE:ie.DOUBLE};Zn.getSizeInBytes=function(e){switch(e){case Zn.BYTE:return Int8Array.BYTES_PER_ELEMENT;case Zn.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Zn.SHORT:return Int16Array.BYTES_PER_ELEMENT;case Zn.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Zn.INT:return Int32Array.BYTES_PER_ELEMENT;case Zn.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case Zn.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case Zn.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}};Zn.fromTypedArray=function(e){if(e instanceof Int8Array)return Zn.BYTE;if(e instanceof Uint8Array)return Zn.UNSIGNED_BYTE;if(e instanceof Int16Array)return Zn.SHORT;if(e instanceof Uint16Array)return Zn.UNSIGNED_SHORT;if(e instanceof Int32Array)return Zn.INT;if(e instanceof Uint32Array)return Zn.UNSIGNED_INT;if(e instanceof Float32Array)return Zn.FLOAT;if(e instanceof Float64Array)return Zn.DOUBLE};Zn.validate=function(e){return l(e)&&(e===Zn.BYTE||e===Zn.UNSIGNED_BYTE||e===Zn.SHORT||e===Zn.UNSIGNED_SHORT||e===Zn.INT||e===Zn.UNSIGNED_INT||e===Zn.FLOAT||e===Zn.DOUBLE)};Zn.createTypedArray=function(e,t){switch(e){case Zn.BYTE:return new Int8Array(t);case Zn.UNSIGNED_BYTE:return new Uint8Array(t);case Zn.SHORT:return new Int16Array(t);case Zn.UNSIGNED_SHORT:return new Uint16Array(t);case Zn.INT:return new Int32Array(t);case Zn.UNSIGNED_INT:return new Uint32Array(t);case Zn.FLOAT:return new Float32Array(t);case Zn.DOUBLE:return new Float64Array(t)}};Zn.createArrayBufferView=function(e,t,n,i){switch(n=y(n,0),i=y(i,(t.byteLength-n)/Zn.getSizeInBytes(e)),e){case Zn.BYTE:return new Int8Array(t,n,i);case Zn.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case Zn.SHORT:return new Int16Array(t,n,i);case Zn.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case Zn.INT:return new Int32Array(t,n,i);case Zn.UNSIGNED_INT:return new Uint32Array(t,n,i);case Zn.FLOAT:return new Float32Array(t,n,i);case Zn.DOUBLE:return new Float64Array(t,n,i)}};Zn.fromName=function(e){switch(e){case"BYTE":return Zn.BYTE;case"UNSIGNED_BYTE":return Zn.UNSIGNED_BYTE;case"SHORT":return Zn.SHORT;case"UNSIGNED_SHORT":return Zn.UNSIGNED_SHORT;case"INT":return Zn.INT;case"UNSIGNED_INT":return Zn.UNSIGNED_INT;case"FLOAT":return Zn.FLOAT;case"DOUBLE":return Zn.DOUBLE}};var Q=Object.freeze(Zn);var AXt=T(S(),1);var vXt=T(S(),1);var iee={};function eR(e,t){l(iee[e])||(iee[e]=!0,console.warn(y(t,e)))}eR.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.";eR.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined.  zIndex will be ignored";eR.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height.  heightReference will be ignored";eR.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight.  extrudedHeightReference will be ignored";var Nt=eR;function XLe(e,t){Nt(e,t)}var Es=XLe;var eIt=T(S(),1);var NXt=T(S(),1),ILe={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},su=Object.freeze(ILe);function _Y(e){e=y(e,y.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=y(e.primitiveType,Fe.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=y(e.geometryType,su.NONE),this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}_Y.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 WLe=new he,PLe=new h,oee=new F,vLe=[new he,new he,new he],wLe=[new D,new D,new D],FLe=[new D,new D,new D],ALe=new h,MLe=new we,NLe=new F,kLe=new Qi;_Y._textureCoordinateRotationPoints=function(e,t,n,i){let o,r=ae.center(i,WLe),s=he.toCartesian(r,n,PLe),a=wt.eastNorthUpToFixedFrame(s,n,oee),c=F.inverse(a,oee),d=wLe,u=vLe;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=ALe;for(o=0;o<3;o++)he.toCartesian(u[o],n,m),m=F.multiplyByPointAsVector(c,m,m),d[o].x=m.x,d[o].y=m.y;let p=we.fromAxisAngle(h.UNIT_Z,-t,MLe),g=$.fromQuaternion(p,NLe),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=F.multiplyByPointAsVector(c,e[o],m),m=$.multiplyByVector(g,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=Qi.fromRotation(t,kLe),Z=FLe;Z[0].x=x,Z[0].y=_,Z[1].x=x,Z[1].y=V,Z[2].x=C,Z[2].y=_;let E=d[0],X=d[2].x-E.x,v=d[1].y-E.y;for(o=0;o<3;o++){let R=Z[o];Qi.multiplyByVector(L,R,R),R.x=(R.x-E.x)/X,R.y=(R.y-E.y)/v}let P=Z[0],A=Z[1],M=Z[2],b=new Array(6);return D.pack(P,b),D.pack(A,b,2),D.pack(M,b,4),b};var ht=_Y;var iIt=T(S(),1);function ULe(e){e=y(e,y.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=y(e.normalize,!1),this.values=e.values}var Ge=ULe;var GIt=T(S(),1);var VIt=T(S(),1);var sIt=T(S(),1);function MS(e,t,n,i,o){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=o}Object.defineProperties(MS.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}},arrayBufferView:{get:function(){return this._buffer}}});MS.clone=function(e){if(l(e))return new MS(e._format,e._datatype,e._width,e._height,e._buffer)};MS.prototype.clone=function(){return MS.clone(this)};var tR=MS;var yIt=T(S(),1),ree=T(td(),1);function see(){if(!l(qs._canTransferArrayBuffer)){let e=CY("transferTypedArrayTest");e.postMessage=y(e.webkitPostMessage,e.postMessage);let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return qs._canTransferArrayBuffer=!1,qs._canTransferArrayBuffer}qs._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(o){let r=o.data.array,s=l(r)&&r[0]===t;i(s),e.terminate(),qs._canTransferArrayBuffer=s}})}return qs._canTransferArrayBuffer}var SY=new be;function TY(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 CY(e){let t=new ree.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),o={},r,s;if(Tb(e))s=e;else if(!n){let a=nn(`${qs._workerModulePrefix}/${i}.js`);Tb(a)&&(s=a)}if(s){let a=`import "${s}";`;return r=TY(a),o.type="module",new Worker(r,o)}if(!n&&typeof CESIUM_WORKERS<"u"){let a=`
      importScripts("${TY(CESIUM_WORKERS)}");
      CesiumWorkers["${i}"]();
    `;return r=TY(a),new Worker(r,o)}if(r=e,n||(r=nn(`${qs._workerModulePrefix+i}.js`)),!Ot.supportsEsmWebWorkers())throw new ue("This browser is not supported. Please update your browser to continue.");return o.type="module",new Worker(r,o)}async function DLe(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!Ot.supportsWebAssembly()){if(!l(t.fallbackModulePath))throw new ue(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=nn(t.fallbackModulePath),n}n.wasmBinaryFile=nn(t.wasmBinaryFile);let i=await Ee.fetchArrayBuffer({url:n.wasmBinaryFile});return n.wasmBinary=i,n}function qs(e,t){this._workerPath=e,this._maximumActiveTasks=y(t,Number.POSITIVE_INFINITY),this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var BLe=(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 ue(r.error.message),s.stack=r.error.stack):s.name==="DeveloperError"?(s=new pe(r.error.message),s.stack=r.error.stack):s.name==="Error"&&(s=new Error(r.error.message),s.stack=r.error.stack),SY.raiseEvent(s),i(s)}else SY.raiseEvent(),n(r.result);e.removeEventListener("message",o)}};return o},YLe=[];async function OLe(e,t,n){let i=await Promise.resolve(see());l(n)?i||(n.length=0):n=YLe;let o=e._nextID++,r=new Promise((s,a)=>{e._worker.addEventListener("message",BLe(e._worker,o,s,a))});return e._worker.postMessage({id:o,baseUrl:nn.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),r}async function HLe(e,t,n){++e._activeTasks;try{let i=await OLe(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}qs.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=CY(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return HLe(this,e,t)};qs.prototype.initWebAssemblyModule=async function(e){if(l(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=CY(this._workerPath),i=await DLe(this,e),o=await Promise.resolve(see()),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 ue("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:i}},r),a};return this._webAssemblyPromise=t(),this._webAssemblyPromise};qs.prototype.isDestroyed=function(){return!1};qs.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),me(this)};qs.taskCompletedEvent=SY;qs._defaultWorkerModulePrefix="Workers/";qs._workerModulePrefix=qs._defaultWorkerModulePrefix;qs._canTransferArrayBuffer=void 0;var bi=qs;function fp(){}fp._transcodeTaskProcessor=new bi("transcodeKTX2",Number.POSITIVE_INFINITY);fp._readyPromise=void 0;function zLe(){let e=fp._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return fp._transcodeTaskProcessor;throw new ue("KTX2 transcoder could not be initialized.")});fp._readyPromise=e}fp.transcode=function(e,t){return l(fp._readyPromise)||zLe(),fp._readyPromise.then(function(n){let i=e;e instanceof ArrayBuffer&&(i=new Uint8Array(e));let o={supportedTargetFormats:t,ktx2Buffer:i};return n.scheduleTask(o,[i.buffer])}).then(function(n){let i=n.length,o=Object.keys(n[0]);for(let r=0;r<i;r++){let s=n[r];for(let a=0;a<o.length;a++){let c=s[o[a]];s[o[a]]=new tR(c.internalFormat,c.datatype,c.width,c.height,c.levelBuffer)}}if(o.length===1){for(let r=0;r<i;++r)n[r]=n[r][o[0]];i===1&&(n=n[0])}return n}).catch(function(n){throw n})};var nR=fp;var aee;cee.setKTX2SupportedFormats=function(e,t,n,i,o,r){aee={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:o,bc7:r}};function cee(e){let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=Ee.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return nR.transcode(n,aee)})}var bl=cee;var uWt=T(S(),1);var vIt=T(S(),1);function dN(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(dN.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});dN.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e,{width:r,height:s}=i,a=this._context._gl,c=this._textureTarget,d=this._targetFace;a.activeTexture(a.TEXTURE0),a.bindTexture(c,this._texture);let u=i.arrayBufferView,m=this._size,p=this._pixelFormat,g=this._internalFormat,f=this._pixelDatatype,x=this._preMultiplyAlpha,_=this._flipY,C=4;l(u)&&(C=at.alignmentInBytes(p,f,r)),a.pixelStorei(a.UNPACK_ALIGNMENT,C),o?a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.NONE):a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.BROWSER_DEFAULT_WEBGL);let V=!1;if(!this._initialized){let L;t===0&&n===0&&r===m&&s===m?(l(u)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),_&&(u=at.flipY(u,p,f,m,m)),L=u):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,_),L=i),V=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),L=at.createTypedArray(p,f,m,m)),a.texImage2D(d,0,g,m,m,0,p,nt.toWebGLConstant(f,this._context),L),this._initialized=!0}V||(l(u)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),_&&(u=at.flipY(u,p,f,r,s)),a.texSubImage2D(d,0,t,n,r,s,p,nt.toWebGLConstant(f,this._context),u)):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,_),a.texSubImage2D(d,0,t,n,p,nt.toWebGLConstant(f,this._context),i))),a.bindTexture(c,null)};dN.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){e=y(e,0),t=y(t,0),n=y(n,0),i=y(i,0),o=y(o,this._size),r=y(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 iR=dN;var AIt=T(S(),1);var uN={DONT_CARE:ie.DONT_CARE,FASTEST:ie.FASTEST,NICEST:ie.NICEST,validate:function(e){return e===uN.DONT_CARE||e===uN.FASTEST||e===uN.NICEST}},Oh=Object.freeze(uN);var $It=T(S(),1);var kIt=T(S(),1);var mN={NEAREST:ie.NEAREST,LINEAR:ie.LINEAR};mN.validate=function(e){return e===mN.NEAREST||e===mN.LINEAR};var ui=Object.freeze(mN);var BIt=T(S(),1);var Rb={NEAREST:ie.NEAREST,LINEAR:ie.LINEAR,NEAREST_MIPMAP_NEAREST:ie.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:ie.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:ie.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:ie.LINEAR_MIPMAP_LINEAR};Rb.validate=function(e){return e===Rb.NEAREST||e===Rb.LINEAR||e===Rb.NEAREST_MIPMAP_NEAREST||e===Rb.LINEAR_MIPMAP_NEAREST||e===Rb.NEAREST_MIPMAP_LINEAR||e===Rb.LINEAR_MIPMAP_LINEAR};var qt=Object.freeze(Rb);var HIt=T(S(),1);var hN={CLAMP_TO_EDGE:ie.CLAMP_TO_EDGE,REPEAT:ie.REPEAT,MIRRORED_REPEAT:ie.MIRRORED_REPEAT,validate:function(e){return e===hN.CLAMP_TO_EDGE||e===hN.REPEAT||e===hN.MIRRORED_REPEAT}},Cn=Object.freeze(hN);function oR(e){e=y(e,y.EMPTY_OBJECT);let{wrapS:t=Cn.CLAMP_TO_EDGE,wrapT:n=Cn.CLAMP_TO_EDGE,minificationFilter:i=qt.LINEAR,magnificationFilter:o=ui.LINEAR,maximumAnisotropy:r=1}=e;this._wrapS=t,this._wrapT=n,this._minificationFilter=i,this._magnificationFilter=o,this._maximumAnisotropy=r}Object.defineProperties(oR.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}}});oR.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};oR.NEAREST=Object.freeze(new oR({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:qt.NEAREST,magnificationFilter:ui.NEAREST}));var $t=oR;function qa(e){e=y(e,y.EMPTY_OBJECT);let{context:t,source:n,pixelFormat:i=at.RGBA,pixelDatatype:o=nt.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:s=!1,sampler:a=new $t}=e,c=e.preMultiplyAlpha||i===at.RGB||i===at.LUMINANCE,{width:d,height:u}=e;l(n)&&({width:d,height:u}=n.positiveX);let m=d,p=at.textureSizeInBytes(i,o,m,m)*6,g=at.toInternalFormat(i,o,t),f=t._gl,x=f.TEXTURE_CUBE_MAP,_=f.createTexture();this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=x,this._texture=_,this._pixelFormat=i,this._pixelDatatype=o,this._size=m,this._hasMipmap=!1,this._sizeInBytes=p,this._preMultiplyAlpha=c,this._flipY=r;let C=l(n);function V(L){return new iR(t,_,x,L,g,i,o,m,c,r,C)}this._positiveX=V(f.TEXTURE_CUBE_MAP_POSITIVE_X),this._negativeX=V(f.TEXTURE_CUBE_MAP_NEGATIVE_X),this._positiveY=V(f.TEXTURE_CUBE_MAP_POSITIVE_Y),this._negativeY=V(f.TEXTURE_CUBE_MAP_NEGATIVE_Y),this._positiveZ=V(f.TEXTURE_CUBE_MAP_POSITIVE_Z),this._negativeZ=V(f.TEXTURE_CUBE_MAP_NEGATIVE_Z),this._sampler=a,dee(this,a),f.activeTexture(f.TEXTURE0),f.bindTexture(x,_),s?f.pixelStorei(f.UNPACK_COLORSPACE_CONVERSION_WEBGL,f.NONE):f.pixelStorei(f.UNPACK_COLORSPACE_CONVERSION_WEBGL,f.BROWSER_DEFAULT_WEBGL);for(let L of qa.getFaceNames())lee(this[L],n?.[L],0);f.bindTexture(x,null)}qa.FaceName=Object.freeze({POSITIVEX:"positiveX",NEGATIVEX:"negativeX",POSITIVEY:"positiveY",NEGATIVEY:"negativeY",POSITIVEZ:"positiveZ",NEGATIVEZ:"negativeZ"});function*KLe(){yield qa.FaceName.POSITIVEX,yield qa.FaceName.NEGATIVEX,yield qa.FaceName.POSITIVEY,yield qa.FaceName.NEGATIVEY,yield qa.FaceName.POSITIVEZ,yield qa.FaceName.NEGATIVEZ}qa.getFaceNames=function(){return KLe()};function lee(e,t,n){n=y(n,0);let i=e._targetFace,o=Math.max(Math.floor(e._size/2**n),1),r=e._pixelFormat,s=e._pixelDatatype,a=e._internalFormat,c=e._flipY,d=e._preMultiplyAlpha,u=e._context,m=u._gl;if(!l(t)){m.texImage2D(i,n,a,o,o,0,r,nt.toWebGLConstant(s,u),null);return}let{arrayBufferView:p}=t,g=4;l(p)&&(g=at.alignmentInBytes(r,s,o)),m.pixelStorei(m.UNPACK_ALIGNMENT,g),l(p)?(m.pixelStorei(m.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,!1),c&&(p=at.flipY(p,r,s,o,o)),m.texImage2D(i,n,a,o,o,0,r,nt.toWebGLConstant(s,u),p)):(m.pixelStorei(m.UNPACK_PREMULTIPLY_ALPHA_WEBGL,d),m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,c),m.texImage2D(i,n,a,r,nt.toWebGLConstant(s,u),t))}Object.defineProperties(qa.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){dee(this,e),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}}});function dee(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[qt.NEAREST_MIPMAP_NEAREST,qt.NEAREST_MIPMAP_LINEAR,qt.LINEAR_MIPMAP_NEAREST,qt.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,s=e._pixelDatatype;(s===nt.FLOAT&&!r.textureFloatLinear||s===nt.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?qt.NEAREST_MIPMAP_NEAREST:qt.NEAREST,i=ui.NEAREST);let a=r._gl,c=e._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(c,e._texture),a.texParameteri(c,a.TEXTURE_MIN_FILTER,n),a.texParameteri(c,a.TEXTURE_MAG_FILTER,i),a.texParameteri(c,a.TEXTURE_WRAP_S,t.wrapS),a.texParameteri(c,a.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&a.texParameteri(c,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),a.bindTexture(c,null)}qa.prototype.loadMipmaps=function(e,t){t=y(t,!1);let n=this._context._gl,i=this._texture,o=this._textureTarget;n.activeTexture(n.TEXTURE0),n.bindTexture(o,i),t?n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.NONE):n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.BROWSER_DEFAULT_WEBGL);for(let r=0;r<e.length;r++){let s=e[r],a=r+1;for(let c of qa.getFaceNames())lee(this[c],s[c],a)}n.bindTexture(o,null),this._hasMipmap=!0};qa.prototype.generateMipmap=function(e){e=y(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)};qa.prototype.isDestroyed=function(){return!1};qa.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=me(this._positiveX),this._negativeX=me(this._negativeX),this._positiveY=me(this._positiveY),this._negativeY=me(this._negativeY),this._positiveZ=me(this._positiveZ),this._negativeZ=me(this._negativeZ),me(this)};var Sa=qa;var hWt=T(S(),1);function JLe(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var $a=JLe;var sMt=T(S(),1);var eMt=T(S(),1);var OAt=T(S(),1);var pWt=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 gWt=T(S(),1),sR=`/**
 * 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 xWt=T(S(),1),aR=`/**
 * 0.1
 *
 * @name czm_epsilon1
 * @glslConstant
 */
const float czm_epsilon1 = 0.1;
`;var TWt=T(S(),1),cR=`/**
 * 0.01
 *
 * @name czm_epsilon2
 * @glslConstant
 */
const float czm_epsilon2 = 0.01;
`;var CWt=T(S(),1),lR=`/**
 * 0.001
 *
 * @name czm_epsilon3
 * @glslConstant
 */
const float czm_epsilon3 = 0.001;
`;var LWt=T(S(),1),dR=`/**
 * 0.0001
 *
 * @name czm_epsilon4
 * @glslConstant
 */
const float czm_epsilon4 = 0.0001;
`;var ZWt=T(S(),1),uR=`/**
 * 0.00001
 *
 * @name czm_epsilon5
 * @glslConstant
 */
const float czm_epsilon5 = 0.00001;
`;var EWt=T(S(),1),mR=`/**
 * 0.000001
 *
 * @name czm_epsilon6
 * @glslConstant
 */
const float czm_epsilon6 = 0.000001;
`;var IWt=T(S(),1),hR=`/**
 * 0.0000001
 *
 * @name czm_epsilon7
 * @glslConstant
 */
const float czm_epsilon7 = 0.0000001;
`;var PWt=T(S(),1),fR=`/**
 * 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 wWt=T(S(),1),pR=`/**
 * 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 AWt=T(S(),1),bR=`/**
 * 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 NWt=T(S(),1),gR=`/**
 * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE}
 *
 * @name czm_passCesium3DTile
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passCesium3DTile = 4.0;
`;var UWt=T(S(),1),yR=`/**
 * 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 BWt=T(S(),1),xR=`/**
 * 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 OWt=T(S(),1),_R=`/**
 * The automatic GLSL constant for {@link Pass#CLASSIFICATION}
 *
 * @name czm_passClassification
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passClassification = 7.0;
`;var zWt=T(S(),1),TR=`/**
 * The automatic GLSL constant for {@link Pass#COMPUTE}
 *
 * @name czm_passCompute
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passCompute = 1.0;
`;var JWt=T(S(),1),SR=`/**
 * The automatic GLSL constant for {@link Pass#ENVIRONMENT}
 *
 * @name czm_passEnvironment
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passEnvironment = 0.0;
`;var jWt=T(S(),1),CR=`/**
 * The automatic GLSL constant for {@link Pass#GLOBE}
 *
 * @name czm_passGlobe
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passGlobe = 2.0;
`;var $Wt=T(S(),1),VR=`/**
 * The automatic GLSL constant for {@link Pass#OPAQUE}
 *
 * @name czm_passOpaque
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passOpaque = 7.0;
`;var t2t=T(S(),1),LR=`/**
 * The automatic GLSL constant for {@link Pass#OVERLAY}
 *
 * @name czm_passOverlay
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passOverlay = 10.0;
`;var i2t=T(S(),1),RR=`/**
 * The automatic GLSL constant for {@link Pass#TERRAIN_CLASSIFICATION}
 *
 * @name czm_passTerrainClassification
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passTerrainClassification = 3.0;
`;var r2t=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 a2t=T(S(),1),GR=`/**
 * The automatic GLSL constant for {@link Pass#VOXELS}
 *
 * @name czm_passVoxels
 * @glslConstant
 *
 * @see czm_pass
 */
const float czm_passVoxels = 9.0;
`;var l2t=T(S(),1),ER=`/**
 * 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 u2t=T(S(),1),XR=`/**
 * 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 h2t=T(S(),1),IR=`/**
 * 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 p2t=T(S(),1),WR=`/**
 * 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 g2t=T(S(),1),PR=`/**
 * 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 x2t=T(S(),1),vR=`/**
 * 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 T2t=T(S(),1),wR=`/**
 * 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 C2t=T(S(),1),FR=`/**
 * 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 L2t=T(S(),1),AR=`/**
 * 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 Z2t=T(S(),1),MR=`/**
 * 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 E2t=T(S(),1),NR=`/**
 * 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 I2t=T(S(),1),kR=`/**
 * 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 P2t=T(S(),1),UR=`/**
 * 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 w2t=T(S(),1),DR=`/**
 * 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 A2t=T(S(),1),BR=`/**
 * @name czm_depthRangeStruct
 * @glslStruct
 */
struct czm_depthRangeStruct
{
    float near;
    float far;
};
`;var N2t=T(S(),1),YR=`/**
 * 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 U2t=T(S(),1),OR=`/**
 * 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 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.
* @property {float} waterMask The value of the water mask. 0 is land, 1 is water. 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;
    float waterMask;
};
`;var B2t=T(S(),1),HR=`/**
 * 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 {vec4} baseColor The base color of the material.
 * @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 {
    vec4 baseColor;
    vec3 diffuse;
    float alpha;
    vec3 specular;
    float roughness;
    vec3 normalEC;
    float occlusion;
    vec3 emissive;
#ifdef USE_SPECULAR
    float specularWeight;
#endif
#ifdef USE_ANISOTROPY
    vec3 anisotropicT;
    vec3 anisotropicB;
    float anisotropyStrength;
#endif
#ifdef USE_CLEARCOAT
    float clearcoatFactor;
    float clearcoatRoughness;
    vec3 clearcoatNormal;
    // Add clearcoatF0 when KHR_materials_ior is implemented
#endif
};
`;var O2t=T(S(),1),zR=`/**
 * 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 z2t=T(S(),1),KR=`/**
 * DOC_TBA
 *
 * @name czm_ray
 * @glslStruct
 */
struct czm_ray
{
    vec3 origin;
    vec3 direction;
};
`;var J2t=T(S(),1),JR=`/**
 * 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 j2t=T(S(),1),QR=`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 $2t=T(S(),1),jR=`/**
 * 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 tPt=T(S(),1),qR=`/**
 * 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 iPt=T(S(),1),$R=`/**
 * 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 rPt=T(S(),1),eZ=`/**
 * 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 aPt=T(S(),1),tZ=`/**
 * 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 lPt=T(S(),1),nZ=`/**
 * 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 uPt=T(S(),1),iZ=`// 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 hPt=T(S(),1),oZ=`/**
 * @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 pPt=T(S(),1),rZ=`/**
 * 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 gPt=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 xPt=T(S(),1),aZ=`/**
 * 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 TPt=T(S(),1),cZ=`/**
 * 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 CPt=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 LPt=T(S(),1),dZ=`/**
 * 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 ZPt=T(S(),1),uZ=`
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 EPt=T(S(),1),mZ=`
uniform vec4 shadowMap_cascadeDistances;

float czm_cascadeDistance(vec4 weights)
{
    return dot(shadowMap_cascadeDistances, weights);
}
`;var IPt=T(S(),1),hZ=`
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 PPt=T(S(),1),fZ=`
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 wPt=T(S(),1),pZ=`float getSignedDistance(vec2 uv, highp sampler2D clippingDistance) {
    float signedDistance = texture(clippingDistance, uv).r;
    return (signedDistance - 0.5) * 2.0;
}

void czm_clipPolygons(highp sampler2D clippingDistance, int extentsLength, vec2 clippingPosition, int regionIndex) {
    // Position is completely outside of polygons bounds
    vec2 rectUv = clippingPosition;
    if (regionIndex < 0 || rectUv.x <= 0.0 || rectUv.y <= 0.0 || rectUv.x >= 1.0 || rectUv.y >= 1.0) {
        #ifdef CLIPPING_INVERSE 
            discard;
        #endif
        return;
    }

    vec2 clippingDistanceTextureDimensions = vec2(textureSize(clippingDistance, 0));
    vec2 sampleOffset = max(1.0 / clippingDistanceTextureDimensions, vec2(0.005));
    float dimension = float(extentsLength);
    if (extentsLength > 2) {
       dimension = ceil(log2(float(extentsLength)));
    }

    vec2 textureOffset = vec2(mod(float(regionIndex), dimension), floor(float(regionIndex) / dimension)) / dimension;
    vec2 uv = textureOffset + rectUv / dimension;

    float signedDistance = getSignedDistance(uv, clippingDistance);

    #ifdef CLIPPING_INVERSE
    if (signedDistance > 0.0)  {
        discard;
    }
    #else
    if (signedDistance < 0.0)  {
        discard;
    }
    #endif
}
`;var APt=T(S(),1),bZ=`/**
 * 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 NPt=T(S(),1),gZ=`/**
 * 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 UPt=T(S(),1),yZ=`/**
 * 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 BPt=T(S(),1),xZ=`/**
 * 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 OPt=T(S(),1),_Z=`/**
 * 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 zPt=T(S(),1),TZ=`/**
 * @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 JPt=T(S(),1),SZ=`/**
 * 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 jPt=T(S(),1),CZ=`// 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 $Pt=T(S(),1),VZ=`/**
 * 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 tvt=T(S(),1),LZ=`/**
 * 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 ivt=T(S(),1),RZ=`/**
 * Approximate uv coordinates based on the ellipsoid normal.
 *
 * @name czm_ellipsoidTextureCoordinates
 * @glslFunction
 */
vec2 czm_ellipsoidTextureCoordinates(vec3 normal)
{
    return vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5);
}
`;var rvt=T(S(),1),ZZ=`/**
 * 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 avt=T(S(),1),GZ=`/**
 * 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 lvt=T(S(),1),EZ=`/**
 * 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 uvt=T(S(),1),XZ=`/**
 * 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 hvt=T(S(),1),IZ=`/**
 * 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 pvt=T(S(),1),WZ=`/**
 * 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 gvt=T(S(),1),PZ=`/**
 * 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 xvt=T(S(),1),vZ=`/**
 * 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 Tvt=T(S(),1),wZ=`/**
 * 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 Cvt=T(S(),1),FZ=`/**
 * 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 Lvt=T(S(),1),AZ=`/**
 * 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 Zvt=T(S(),1),MZ=`/**
 * @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 Evt=T(S(),1),NZ=`/**
 * 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 Ivt=T(S(),1),kZ=`/**
 * 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 Pvt=T(S(),1),UZ=`/**
 * 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 wvt=T(S(),1),DZ=`/**
 * 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 Avt=T(S(),1),BZ=`/**
 * 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 Nvt=T(S(),1),YZ=`/**
 * 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 Uvt=T(S(),1),OZ=`/**
 * 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 Bvt=T(S(),1),HZ=`/**
 * 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 Ovt=T(S(),1),zZ=`/**
 * Find the maximum component of a vector.
 *
 * @name czm_maximumComponent
 * @glslFunction
 *
 * @param {vec2|vec3|vec4} v The input vector.
 * @returns {float} The value of the largest component.
 */
float czm_maximumComponent(vec2 v)
{
    return max(v.x, v.y);
}
float czm_maximumComponent(vec3 v)
{
    return max(max(v.x, v.y), v.z);
}
float czm_maximumComponent(vec4 v)
{
    return max(max(max(v.x, v.y), v.z), v.w);
}
`;var zvt=T(S(),1),KZ=`/**
 * 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 Jvt=T(S(),1),JZ=`/**
 * 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 jvt=T(S(),1),QZ=`/**
 * 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 $vt=T(S(),1),jZ=`/**
 * 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 twt=T(S(),1),qZ=` /**
  * 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 iwt=T(S(),1),$Z=`/**
 * 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 rwt=T(S(),1),eG=`vec3 lambertianDiffuse(vec3 diffuseColor)
{
    return diffuseColor / czm_pi;
}

vec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH)
{
    float versine = 1.0 - VdotH;
    // pow(versine, 5.0) is slow. See https://stackoverflow.com/a/68793086/10082269
    float versineSquared = versine * versine;
    return f0 + (f90 - f0) * versineSquared * versineSquared * versine;
}

#ifdef USE_ANISOTROPY
/**
 * @param {float} bitangentRoughness Material roughness (along the anisotropy bitangent)
 * @param {float} tangentialRoughness Anisotropic roughness (along the anisotropy tangent)
 * @param {vec3} lightDirection The direction from the fragment to the light source, transformed to tangent-bitangent-normal coordinates
 * @param {vec3} viewDirection The direction from the fragment to the camera, transformed to tangent-bitangent-normal coordinates
 */
float smithVisibilityGGX_anisotropic(float bitangentRoughness, float tangentialRoughness, vec3 lightDirection, vec3 viewDirection)
{
    vec3 roughnessScale = vec3(tangentialRoughness, bitangentRoughness, 1.0);
    float GGXV = lightDirection.z * length(roughnessScale * viewDirection);
    float GGXL = viewDirection.z * length(roughnessScale * lightDirection);
    float v = 0.5 / (GGXV + GGXL);
    return clamp(v, 0.0, 1.0);
}

/**
 * @param {float} bitangentRoughness Material roughness (along the anisotropy bitangent)
 * @param {float} tangentialRoughness Anisotropic roughness (along the anisotropy tangent)
 * @param {vec3} halfwayDirection The unit vector halfway between light and view directions, transformed to tangent-bitangent-normal coordinates
 */
float GGX_anisotropic(float bitangentRoughness, float tangentialRoughness, vec3 halfwayDirection)
{
    float roughnessSquared = bitangentRoughness * tangentialRoughness;
    vec3 f = halfwayDirection * vec3(bitangentRoughness, tangentialRoughness, roughnessSquared);
    float w2 = roughnessSquared / dot(f, f);
    return roughnessSquared * w2 * w2 / czm_pi;
}
#endif

/**
 * Estimate the geometric self-shadowing of the microfacets in a surface,
 * using the Smith Joint GGX visibility function.
 * Note: Vis = G / (4 * NdotL * NdotV)
 * see Eric Heitz. 2014. Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs. Journal of Computer Graphics Techniques, 3
 * see Real-Time Rendering. Page 331 to 336.
 * see https://google.github.io/filament/Filament.md.html#materialsystem/specularbrdf/geometricshadowing(specularg)
 *
 * @param {float} alphaRoughness The roughness of the material, expressed as the square of perceptual roughness.
 * @param {float} NdotL The cosine of the angle between the surface normal and the direction to the light source.
 * @param {float} NdotV The cosine of the angle between the surface normal and the direction to the camera.
 */
float smithVisibilityGGX(float alphaRoughness, float NdotL, float NdotV)
{
    float alphaRoughnessSq = alphaRoughness * alphaRoughness;

    float GGXV = NdotL * sqrt(NdotV * NdotV * (1.0 - alphaRoughnessSq) + alphaRoughnessSq);
    float GGXL = NdotV * sqrt(NdotL * NdotL * (1.0 - alphaRoughnessSq) + alphaRoughnessSq);

    float GGX = GGXV + GGXL;
    if (GGX > 0.0)
    {
        return 0.5 / GGX;
    }
    return 0.0;
}

/**
 * Estimate the fraction of the microfacets in a surface that are aligned with 
 * the halfway vector, which is aligned halfway between the directions from
 * the fragment to the camera and from the fragment to the light source.
 *
 * @param {float} alphaRoughness The roughness of the material, expressed as the square of perceptual roughness.
 * @param {float} NdotH The cosine of the angle between the surface normal and the halfway vector.
 * @return {float} The fraction of microfacets aligned to the halfway vector.
 */
float GGX(float alphaRoughness, float NdotH)
{
    float alphaRoughnessSquared = alphaRoughness * alphaRoughness;
    float f = (NdotH * alphaRoughnessSquared - NdotH) * NdotH + 1.0;
    return alphaRoughnessSquared / (czm_pi * f * f);
}

/**
 * Compute the strength of the specular reflection due to direct lighting.
 *
 * @param {vec3} normal The surface normal.
 * @param {vec3} lightDirection The unit vector pointing from the fragment to the light source.
 * @param {vec3} viewDirection The unit vector pointing from the fragment to the camera.
 * @param {vec3} halfwayDirection The unit vector pointing from the fragment to halfway between the light source and the camera.
 * @param {float} alphaRoughness The roughness of the material, expressed as the square of perceptual roughness.
 * @return {float} The strength of the specular reflection.
 */
float computeDirectSpecularStrength(vec3 normal, vec3 lightDirection, vec3 viewDirection, vec3 halfwayDirection, float alphaRoughness)
{
    float NdotL = clamp(dot(normal, lightDirection), 0.0, 1.0);
    float NdotV = clamp(dot(normal, viewDirection), 0.0, 1.0);
    float G = smithVisibilityGGX(alphaRoughness, NdotL, NdotV);
    float NdotH = clamp(dot(normal, halfwayDirection), 0.0, 1.0);
    float D = GGX(alphaRoughness, NdotH);
    return G * D;
}

/**
 * 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 {@MaterialStageFS}
 * </p>
 *
 * @name czm_pbrLighting
 * @glslFunction
 *
 * @param {vec3} viewDirectionEC Unit vector pointing from the fragment to the eye position
 * @param {vec3} normalEC The surface normal in eye coordinates
 * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.
 * @param {czm_modelMaterial} The material properties.
 * @return {vec3} The computed HDR color
 */
vec3 czm_pbrLighting(vec3 viewDirectionEC, vec3 normalEC, vec3 lightDirectionEC, czm_modelMaterial material)
{
    vec3 halfwayDirectionEC = normalize(viewDirectionEC + lightDirectionEC);
    float VdotH = clamp(dot(viewDirectionEC, halfwayDirectionEC), 0.0, 1.0);
    float NdotL = clamp(dot(normalEC, lightDirectionEC), 0.001, 1.0);

    vec3 f0 = material.specular;
    float reflectance = czm_maximumComponent(f0);
    // Typical dielectrics will have reflectance 0.04, so f90 will be 1.0.
    // In this case, at grazing angle, all incident energy is reflected.
    vec3 f90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0));
    vec3 F = fresnelSchlick2(f0, f90, VdotH);

    #if defined(USE_SPECULAR)
        F *= material.specularWeight;
    #endif

    float alphaRoughness = material.roughness * material.roughness;
    #ifdef USE_ANISOTROPY
        mat3 tbn = mat3(material.anisotropicT, material.anisotropicB, normalEC);
        vec3 lightDirection = lightDirectionEC * tbn;
        vec3 viewDirection = viewDirectionEC * tbn;
        vec3 halfwayDirection = halfwayDirectionEC * tbn;
        float anisotropyStrength = material.anisotropyStrength;
        float tangentialRoughness = mix(alphaRoughness, 1.0, anisotropyStrength * anisotropyStrength);
        float bitangentRoughness = clamp(alphaRoughness, 0.001, 1.0);
        float G = smithVisibilityGGX_anisotropic(bitangentRoughness, tangentialRoughness, lightDirection, viewDirection);
        float D = GGX_anisotropic(bitangentRoughness, tangentialRoughness, halfwayDirection);
        vec3 specularContribution = F * G * D;
    #else
        float specularStrength = computeDirectSpecularStrength(normalEC, lightDirectionEC, viewDirectionEC, halfwayDirectionEC, alphaRoughness);
        vec3 specularContribution = F * specularStrength;
    #endif

    vec3 diffuseColor = material.diffuse;
    // F here represents the specular contribution
    vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor);

    // Lo = (diffuse + specular) * Li * NdotL
    return (diffuseContribution + specularContribution) * NdotL;
}
`;var awt=T(S(),1),tG=`// KhronosGroup https://github.com/KhronosGroup/ToneMapping/tree/main/PBR_Neutral

// Input color is non-negative and resides in the Linear Rec. 709 color space.
// Output color is also Linear Rec. 709, but in the [0, 1] range.

vec3 czm_pbrNeutralTonemapping(vec3 color) {
    const float startCompression = 0.8 - 0.04;
    const float desaturation = 0.15;

    float x = min(color.r, min(color.g, color.b));
    float offset = czm_branchFreeTernary(x < 0.08, x - 6.25 * x * x, 0.04);
    color -= offset;

    float peak = max(color.r, max(color.g, color.b));
    if (peak < startCompression) return color;

    const float d = 1.0 - startCompression;
    float newPeak = 1.0 - d * d / (peak + d - startCompression);
    color *= newPeak / peak;

    float g = 1.0 - 1.0 / (desaturation * (peak - newPeak) + 1.0);
    return mix(color, newPeak * vec3(1.0, 1.0, 1.0), g);
}
`;var lwt=T(S(),1),nG=`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 uwt=T(S(),1),iG=`/**
 * 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 hwt=T(S(),1),oG=`/**
 * 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 pwt=T(S(),1),rG=`/**
 * 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 gwt=T(S(),1),sG=`/**
 * 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 xwt=T(S(),1),aG=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords)
{
    return czm_reverseLogDepth(texture(depthTexture, texCoords).r);
}
`;var Twt=T(S(),1),cG=`/**
 * 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 Cwt=T(S(),1),lG=`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 Lwt=T(S(),1),dG=`/**
 * 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 Zwt=T(S(),1),uG=`/**
 * 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 Ewt=T(S(),1),mG=`
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 Iwt=T(S(),1),hG=`
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 Pwt=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 wwt=T(S(),1),pG=`/**
 * 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 Awt=T(S(),1),bG=`/**
 * 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 Nwt=T(S(),1),gG=`/**
 * 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 Uwt=T(S(),1),yG=`/**
 * 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 coordinate at which to sample the texture.
 */
vec4 czm_textureCube(samplerCube sampler, vec3 p) {
#if __VERSION__ == 300
    return texture(sampler, p);
#else
    return textureCube(sampler, p);
#endif
}

/**
 * A wrapper around the textureLod (WebGL2) / textureCube (WebGL1)
 * function to allow for WebGL 1 support in fragment shaders.
 *
 * @name czm_textureCubeLod
 * @glslFunction
 *
 * @param {samplerCube} sampler The sampler.
 * @param {vec3} p The coordinate at which to sample the texture.
 * @param {float} lod The mipmap level from which to sample.
 */
vec4 czm_textureCube(samplerCube sampler, vec3 p, float lod) {
#if __VERSION__ == 300
    return textureLod(sampler, p, lod);
#elif defined(GL_EXT_shader_texture_lod)
    return textureCubeLodEXT(sampler, p, lod);
#endif
}`;var Bwt=T(S(),1),xG=`/**
 * 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 Owt=T(S(),1),_G=`/**
 * 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 zwt=T(S(),1),TG=`/**
 * @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 Jwt=T(S(),1),SG=`/**
 * 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 jwt=T(S(),1),CG=`vec2 getLookupUv(vec2 dimensions, int i) {
    int pixY = i / int(dimensions.x);
    int pixX = i - (pixY * int(dimensions.x));
    float pixelWidth = 1.0 / dimensions.x;
    float pixelHeight = 1.0 / dimensions.y;
    float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel
    float v = (float(pixY) + 0.5) * pixelHeight;
    return vec2(u, v);
}

vec4 czm_unpackClippingExtents(highp sampler2D extentsTexture, int index) {
    vec2 textureDimensions = vec2(textureSize(extentsTexture, 0));
    return texture(extentsTexture, getLookupUv(textureDimensions, index));
}`;var $wt=T(S(),1),VG=`/**
 * 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 tFt=T(S(),1),LG=`/**
 * 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 iFt=T(S(),1),RG=`/**
 * 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 rFt=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 aFt=T(S(),1),GG=`#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 lFt=T(S(),1),EG=`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 uFt=T(S(),1),XG=`// 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 hFt=T(S(),1),IG=`#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 pFt=T(S(),1),WG=`/**
 * 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 tx={czm_degreesPerRadian:rR,czm_depthRange:sR,czm_epsilon1:aR,czm_epsilon2:cR,czm_epsilon3:lR,czm_epsilon4:dR,czm_epsilon5:uR,czm_epsilon6:mR,czm_epsilon7:hR,czm_infinity:fR,czm_oneOverPi:pR,czm_oneOverTwoPi:bR,czm_passCesium3DTile:gR,czm_passCesium3DTileClassification:yR,czm_passCesium3DTileClassificationIgnoreShow:xR,czm_passClassification:_R,czm_passCompute:TR,czm_passEnvironment:SR,czm_passGlobe:CR,czm_passOpaque:VR,czm_passOverlay:LR,czm_passTerrainClassification:RR,czm_passTranslucent:ZR,czm_passVoxels:GR,czm_pi:ER,czm_piOverFour:XR,czm_piOverSix:IR,czm_piOverThree:WR,czm_piOverTwo:PR,czm_radiansPerDegree:vR,czm_sceneMode2D:wR,czm_sceneMode3D:FR,czm_sceneModeColumbusView:AR,czm_sceneModeMorphing:MR,czm_solarRadius:NR,czm_threePiOver2:kR,czm_twoPi:UR,czm_webMercatorMaxLatitude:DR,czm_depthRangeStruct:BR,czm_material:YR,czm_materialInput:OR,czm_modelMaterial:HR,czm_modelVertexOutput:zR,czm_ray:KR,czm_raySegment:JR,czm_shadowParameters:QR,czm_HSBToRGB:jR,czm_HSLToRGB:qR,czm_RGBToHSB:$R,czm_RGBToHSL:eZ,czm_RGBToXYZ:tZ,czm_XYZToRGB:nZ,czm_acesTonemapping:iZ,czm_alphaWeight:oZ,czm_antialias:rZ,czm_applyHSBShift:sZ,czm_approximateSphericalCoordinates:aZ,czm_approximateTanh:cZ,czm_backFacing:lZ,czm_branchFreeTernary:dZ,czm_cascadeColor:uZ,czm_cascadeDistance:mZ,czm_cascadeMatrix:hZ,czm_cascadeWeights:fZ,czm_clipPolygons:pZ,czm_columbusViewMorph:bZ,czm_computeAtmosphereColor:gZ,czm_computeGroundAtmosphereScattering:yZ,czm_computePosition:xZ,czm_computeScattering:_Z,czm_cosineAndSine:TZ,czm_decompressTextureCoordinates:SZ,czm_depthClamp:CZ,czm_eastNorthUpToEyeCoordinates:VZ,czm_ellipsoidContainsPoint:LZ,czm_ellipsoidTextureCoordinates:RZ,czm_equalsEpsilon:ZZ,czm_eyeOffset:GZ,czm_eyeToWindowCoordinates:EZ,czm_fastApproximateAtan:XZ,czm_fog:IZ,czm_gammaCorrect:WZ,czm_geodeticSurfaceNormal:PZ,czm_getDefaultMaterial:vZ,czm_getDynamicAtmosphereLightDirection:wZ,czm_getLambertDiffuse:FZ,czm_getSpecular:AZ,czm_getWaterNoise:MZ,czm_hue:NZ,czm_inverseGamma:kZ,czm_isEmpty:UZ,czm_isFull:DZ,czm_latitudeToWebMercatorFraction:BZ,czm_lineDistance:YZ,czm_linearToSrgb:OZ,czm_luminance:HZ,czm_maximumComponent:zZ,czm_metersPerPixel:KZ,czm_modelToWindowCoordinates:JZ,czm_multiplyWithColorBalance:QZ,czm_nearFarScalar:jZ,czm_octDecode:qZ,czm_packDepth:$Z,czm_pbrLighting:eG,czm_pbrNeutralTonemapping:tG,czm_phong:nG,czm_planeDistance:iG,czm_pointAlongRay:oG,czm_rayEllipsoidIntersectionInterval:rG,czm_raySphereIntersectionInterval:sG,czm_readDepth:aG,czm_readNonPerspective:cG,czm_reverseLogDepth:lG,czm_round:dG,czm_saturation:uG,czm_shadowDepthCompare:mG,czm_shadowVisibility:hG,czm_signNotZero:fG,czm_sphericalHarmonics:pG,czm_srgbToLinear:bG,czm_tangentToEyeSpaceMatrix:gG,czm_textureCube:yG,czm_transformPlane:xG,czm_translateRelativeToEye:_G,czm_translucentPhong:TG,czm_transpose:SG,czm_unpackClippingExtents:CG,czm_unpackDepth:VG,czm_unpackFloat:LG,czm_unpackUint:RG,czm_valueTransform:ZG,czm_vertexLogDepth:GG,czm_windowToEyeCoordinates:EG,czm_writeDepthClamp:XG,czm_writeLogDepth:IG,czm_writeNonPerspective:WG};var zAt=T(S(),1);function QLe(e,t){let n=e;return n=n.replaceAll("version 300 es",""),n=n.replaceAll(/(texture\()/g,"texture2D("),t?(n=n.replaceAll(/\n\s*(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_EXT_shader_texture_lod
#extension GL_EXT_shader_texture_lod : enable
#endif
${n}`,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 PG=QLe;function uee(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 mee(e,t,n){let i;for(let o=0;o<n.length;++o)n[o].name===e&&(i=n[o]);return l(i)||(t=uee(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function hee(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&&Xs._czmBuiltinsAndUniforms.hasOwnProperty(i)){let o=mee(i,Xs._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(o),o.requiredBy.push(e),hee(o,t)}}))}function jLe(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 qLe(e){let t=[],n=mee("main",e,t);hee(n,t),jLe(t);let i="";for(let o=t.length-1;o>=0;--o)i=`${i+t[o].glslSource}
`;return i.replace(n.glslSource,"")}function fee(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=uee(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=Xs.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 g="";e.includeBuiltIns&&(g=qLe(r)),u+=`
#line 0
`;let f=g+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+=g,u+=r,n.webgl2?u=`#version 300 es
${u}`:u=PG(u,t),u}function Xs(e){e=y(e,y.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=y(e.includeBuiltIns,!0)}Xs.prototype.clone=function(){return new Xs({sources:this.sources,defines:this.defines,pickColorQualifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})};Xs.replaceMain=function(e,t){return t=`void ${t}()`,e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)};Xs.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}`};Xs.prototype.createCombinedVertexShader=function(e){return fee(this,!1,e)};Xs.prototype.createCombinedFragmentShader=function(e){return fee(this,!0,e)};Xs._czmBuiltinsAndUniforms={};for(let e in tx)tx.hasOwnProperty(e)&&(Xs._czmBuiltinsAndUniforms[e]=tx[e]);for(let e in sp)if(sp.hasOwnProperty(e)){let t=sp[e];typeof t.getDeclaration=="function"&&(Xs._czmBuiltinsAndUniforms[e]=t.getDeclaration(e))}Xs.createPickVertexShaderSource=function(e){return`${Xs.replaceMain(e,"czm_old_main")}
in vec4 pickColor; 
out vec4 czm_pickColor; 
void main() 
{ 
    czm_old_main(); 
    czm_pickColor = pickColor; 
}`};Xs.createPickFragmentShaderSource=function(e,t){let n=Xs.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 $Le(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 pee(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 bee(e,t){let n=t.length;for(let i=0;i<n;++i){let o=t[i];if(pee(e,o))return o}}var eRe=["v_normalEC","v_normal"];Xs.findNormalVarying=function(e){return pee(e,"#ifdef HAS_NORMALS")?$Le(e,"HAS_NORMALS")?"v_normalEC":void 0:bee(e,eRe)};var tRe=["v_positionEC"];Xs.findPositionVarying=function(e){return bee(e,tRe)};var Oe=Xs;function bm(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(bm.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});bm.prototype.replaceShaderProgram=function(e){return l(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function nRe(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}bm.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)?nRe(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 rn({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};bm.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=this._shaders[o];if(l(r)){VY(this,r);let s=i.derivedKeywords.indexOf(t);s>-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};bm.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,o=this._shaders[i];if(l(o))return o.shaderProgram};bm.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 rn({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 VY(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];VY(e,s)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}bm.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];VY(this,n),--this._numberOfShaders}this._shadersToRelease={}};bm.prototype.releaseShaderProgram=function(e){if(l(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};bm.prototype.isDestroyed=function(){return!1};bm.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return me(this)};var vG=bm;var xMt=T(S(),1);function gm(e){e=y(e,y.EMPTY_OBJECT);let{context:t,source:n,pixelFormat:i=at.RGBA,pixelDatatype:o=nt.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:s=!1,sampler:a=new $t}=e,{width:c,height:d}=e;l(n)&&(l(c)||(c=y(n.videoWidth,n.width)),l(d)||(d=y(n.videoHeight,n.height)));let u=e.preMultiplyAlpha||i===at.RGB||i===at.LUMINANCE,m=at.toInternalFormat(i,o,t),p=at.isCompressedFormat(m),g=t._gl,f=p?at.compressedTextureSizeInBytes(i,c,d):at.textureSizeInBytes(i,o,c,d);this._id=Bn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=g.TEXTURE_2D,this._texture=g.createTexture(),this._internalFormat=m,this._pixelFormat=i,this._pixelDatatype=o,this._width=c,this._height=d,this._dimensions=new D(c,d),this._hasMipmap=!1,this._sizeInBytes=f,this._preMultiplyAlpha=u,this._flipY=r,this._initialized=!1,this._sampler=void 0,this._sampler=a,gee(this,a),g.activeTexture(g.TEXTURE0),g.bindTexture(this._textureTarget,this._texture),l(n)?(s?g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.NONE):g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.BROWSER_DEFAULT_WEBGL),l(n.arrayBufferView)?at.isCompressedFormat(m)?iRe(this,n):oRe(this,n):l(n.framebuffer)?rRe(this,n):sRe(this,n),this._initialized=!0):aRe(this),g.bindTexture(this._textureTarget,null)}function iRe(e,t){let i=e._context._gl,o=e._textureTarget,r=e._internalFormat,{width:s,height:a}=e;if(i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),i.compressedTexImage2D(o,0,r,s,a,0,t.arrayBufferView),l(t.mipLevels)){let c=s,d=a;for(let u=0;u<t.mipLevels.length;++u)c=fN(c),d=fN(d),i.compressedTexImage2D(o,u+1,r,c,d,0,t.mipLevels[u])}}function oRe(e,t){let n=e._context,i=n._gl,o=e._textureTarget,r=e._internalFormat,{width:s,height:a,pixelFormat:c,pixelDatatype:d,flipY:u}=e,m=at.alignmentInBytes(c,d,s);i.pixelStorei(i.UNPACK_ALIGNMENT,m),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let p=t.arrayBufferView;if(u&&(p=at.flipY(p,c,d,s,a)),i.texImage2D(o,0,r,s,a,0,c,nt.toWebGLConstant(d,n),p),l(t.mipLevels)){let g=s,f=a;for(let x=0;x<t.mipLevels.length;++x)g=fN(g),f=fN(f),i.texImage2D(o,x+1,r,g,f,0,c,nt.toWebGLConstant(d,n),t.mipLevels[x])}}function rRe(e,t){let n=e._context,i=n._gl;i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),t.framebuffer!==n.defaultFramebuffer&&t.framebuffer._bind(),i.copyTexImage2D(e._textureTarget,0,e._internalFormat,t.xOffset,t.yOffset,e.width,e.height,0),t.framebuffer!==n.defaultFramebuffer&&t.framebuffer._unBind()}function sRe(e,t){let n=e._context,i=n._gl;i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.preMultiplyAlpha),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,e.flipY),i.texImage2D(e._textureTarget,0,e._internalFormat,e.pixelFormat,nt.toWebGLConstant(e.pixelDatatype,n),t)}function fN(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function aRe(e){let t=e._context;t._gl.texImage2D(e._textureTarget,0,e._internalFormat,e._width,e._height,0,e._pixelFormat,nt.toWebGLConstant(e._pixelDatatype,t),null)}gm.create=function(e){return new gm(e)};gm.fromFramebuffer=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=t._gl,{pixelFormat:i=at.RGB,framebufferXOffset:o=0,framebufferYOffset:r=0,width:s=n.drawingBufferWidth,height:a=n.drawingBufferHeight,framebuffer:c}=e;return new gm({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(gm.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){gee(this,e),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}}});function gee(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[qt.NEAREST_MIPMAP_NEAREST,qt.NEAREST_MIPMAP_LINEAR,qt.LINEAR_MIPMAP_NEAREST,qt.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,s=e._pixelFormat,a=e._pixelDatatype;(a===nt.FLOAT&&!r.textureFloatLinear||a===nt.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?qt.NEAREST_MIPMAP_NEAREST:qt.NEAREST,i=ui.NEAREST),r.webgl2&&at.isDepthFormat(s)&&(n=qt.NEAREST,i=ui.NEAREST);let c=r._gl,d=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(d,e._texture),c.texParameteri(d,c.TEXTURE_MIN_FILTER,n),c.texParameteri(d,c.TEXTURE_MAG_FILTER,i),c.texParameteri(d,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(d,c.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&c.texParameteri(d,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(d,null)}gm.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e,r=this._context,s=r._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture);let{width:c,height:d,arrayBufferView:u}=i,m=this._width,p=this._height,g=this._internalFormat,f=this._pixelFormat,x=this._pixelDatatype,_=this._preMultiplyAlpha,C=this._flipY,V=4;l(u)&&(V=at.alignmentInBytes(f,x,c)),s.pixelStorei(s.UNPACK_ALIGNMENT,V),o?s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.NONE):s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.BROWSER_DEFAULT_WEBGL);let L=!1;if(!this._initialized){let Z;t===0&&n===0&&c===m&&d===p?(l(u)?(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),C?Z=at.flipY(u,f,x,m,p):Z=u):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,_),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,C),Z=i),L=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),Z=at.createTypedArray(f,x,m,p)),s.texImage2D(a,0,g,m,p,0,f,nt.toWebGLConstant(x,r),Z),this._initialized=!0}if(!L){let Z;l(u)?(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),C?Z=at.flipY(u,f,x,c,d):Z=u):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,_),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,C),Z=i),s.texSubImage2D(a,0,t,n,c,d,f,nt.toWebGLConstant(x,r),Z)}s.bindTexture(a,null)};gm.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){e=y(e,0),t=y(t,0),n=y(n,0),i=y(i,0),o=y(o,this._width),r=y(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};gm.prototype.generateMipmap=function(e){e=y(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)};gm.prototype.isDestroyed=function(){return!1};gm.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),me(this)};var Ft=gm;var CMt=T(S(),1);function nx(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(nx.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});nx.prototype.getTexture=function(e){let t=this._textures[e];if(l(t))return delete this._texturesToRelease[e],++t.count,t.texture};nx.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};nx.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={}};nx.prototype.isDestroyed=function(){return!1};nx.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return me(this)};var wG=nx;var ANt=T(S(),1);var ZMt=T(S(),1);function Hh(){this.high=h.clone(h.ZERO),this.low=h.clone(h.ZERO)}Hh.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};Hh.fromCartesian=function(e,t){l(t)||(t=new Hh);let n=t.high,i=t.low;return Hh.encode(e.x,pp),n.x=pp.high,i.x=pp.low,Hh.encode(e.y,pp),n.y=pp.high,i.y=pp.low,Hh.encode(e.z,pp),n.z=pp.high,i.z=pp.low,t};var LY=new Hh;Hh.writeElements=function(e,t,n){Hh.fromCartesian(e,LY);let i=LY.high,o=LY.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 Yn=Hh;var nNt=T(S(),1);var QMt=T(S(),1);var UMt=T(S(),1);var PMt=T(S(),1);function Is(e,t){this.normal=h.clone(e),this.distance=t}Is.fromPointNormal=function(e,t,n){let i=-h.dot(t,e);return l(n)?(h.clone(t,n.normal),n.distance=i,n):new Is(t,i)};var cRe=new h;Is.fromCartesian4=function(e,t){let n=h.fromCartesian4(e,cRe),i=e.w;return l(t)?(h.clone(n,t.normal),t.distance=i,t):new Is(n,i)};Is.getPointDistance=function(e,t){return h.dot(e.normal,t)+e.distance};var lRe=new h;Is.projectPointOntoPlane=function(e,t,n){l(n)||(n=new h);let i=Is.getPointDistance(e,t),o=h.multiplyByScalar(e.normal,i,lRe);return h.subtract(t,o,n)};var dRe=new F,uRe=new se,mRe=new h;Is.transform=function(e,t,n){let i=e.normal,o=e.distance,r=F.inverseTranspose(t,dRe),s=se.fromElements(i.x,i.y,i.z,o,uRe);s=F.multiplyByVector(r,s,s);let a=h.fromCartesian4(s,mRe);return s=se.divideByScalar(s,h.magnitude(a),s),Is.fromCartesian4(s,n)};Is.clone=function(e,t){return l(t)?(h.clone(e.normal,t.normal),t.distance=e.distance,t):new Is(e.normal,e.distance)};Is.equals=function(e,t){return e.distance===t.distance&&h.equals(e.normal,t.normal)};Is.ORIGIN_XY_PLANE=Object.freeze(new Is(h.UNIT_Z,0));Is.ORIGIN_YZ_PLANE=Object.freeze(new Is(h.UNIT_X,0));Is.ORIGIN_ZX_PLANE=Object.freeze(new Is(h.UNIT_Y,0));var cn=Is;function au(e){this.planes=y(e,[])}var FG=[new h,new h,new h];h.clone(h.UNIT_X,FG[0]);h.clone(h.UNIT_Y,FG[1]);h.clone(h.UNIT_Z,FG[2]);var Zb=new h,hRe=new h,yee=new cn(new h(1,0,0),0);au.fromBoundingSphere=function(e,t){l(t)||(t=new au);let n=FG.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=FG[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,Zb),h.add(o,Zb,Zb),d.x=c.x,d.y=c.y,d.z=c.z,d.w=-h.dot(c,Zb),h.multiplyByScalar(c,r,Zb),h.add(o,Zb,Zb),u.x=-c.x,u.y=-c.y,u.z=-c.z,u.w=-h.dot(h.negate(c,hRe),Zb),s+=2}return t};au.prototype.computeVisibility=function(e){let t=this.planes,n=!1;for(let i=0,o=t.length;i<o;++i){let r=e.intersectPlane(cn.fromCartesian4(t[i],yee));if(r===Kt.OUTSIDE)return Kt.OUTSIDE;r===Kt.INTERSECTING&&(n=!0)}return n?Kt.INTERSECTING:Kt.INSIDE};au.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===au.MASK_OUTSIDE||t===au.MASK_INSIDE)return t;let n=au.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(cn.fromCartesian4(i[o],yee));if(a===Kt.OUTSIDE)return au.MASK_OUTSIDE;a===Kt.INTERSECTING&&(n|=s)}return n};au.MASK_OUTSIDE=4294967295;au.MASK_INSIDE=0;au.MASK_INDETERMINATE=2147483647;var rs=au;function zh(e){e=y(e,y.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=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this._cullingVolume=new rs,this._orthographicMatrix=new F}function xee(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=F.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}Object.defineProperties(zh.prototype,{projectionMatrix:{get:function(){return xee(this),this._orthographicMatrix}}});var fRe=new h,pRe=new h,bRe=new h,RY=new h;zh.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,fRe);h.normalize(u,u);let m=pRe;h.multiplyByScalar(t,c,m),h.add(e,m,m);let p=bRe;h.multiplyByScalar(u,a,p),h.add(m,p,p);let g=i[0];return l(g)||(g=i[0]=new se),g.x=u.x,g.y=u.y,g.z=u.z,g.w=-h.dot(u,p),h.multiplyByScalar(u,s,p),h.add(m,p,p),g=i[1],l(g)||(g=i[1]=new se),g.x=-u.x,g.y=-u.y,g.z=-u.z,g.w=-h.dot(h.negate(u,RY),p),h.multiplyByScalar(n,r,p),h.add(m,p,p),g=i[2],l(g)||(g=i[2]=new se),g.x=n.x,g.y=n.y,g.z=n.z,g.w=-h.dot(n,p),h.multiplyByScalar(n,o,p),h.add(m,p,p),g=i[3],l(g)||(g=i[3]=new se),g.x=-n.x,g.y=-n.y,g.z=-n.z,g.w=-h.dot(h.negate(n,RY),p),g=i[4],l(g)||(g=i[4]=new se),g.x=t.x,g.y=t.y,g.z=t.z,g.w=-h.dot(t,m),h.multiplyByScalar(t,d,p),h.add(e,p,p),g=i[5],l(g)||(g=i[5]=new se),g.x=-t.x,g.y=-t.y,g.z=-t.z,g.w=-h.dot(h.negate(t,RY),p),this._cullingVolume};zh.prototype.getPixelDimensions=function(e,t,n,i,o){xee(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};zh.prototype.clone=function(e){return l(e)||(e=new zh),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};zh.prototype.equals=function(e){return l(e)&&e instanceof zh&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};zh.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof zh&&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 Zr=zh;function gl(e){e=y(e,y.EMPTY_OBJECT),this._offCenterFrustum=new Zr,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far}gl.packedLength=4;gl.pack=function(e,t,n){return n=y(n,0),t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};gl.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new gl),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function Gb(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(gl.prototype,{projectionMatrix:{get:function(){return Gb(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return Gb(this),this._offCenterFrustum}}});gl.prototype.computeCullingVolume=function(e,t,n){return Gb(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};gl.prototype.getPixelDimensions=function(e,t,n,i,o){return Gb(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};gl.prototype.clone=function(e){return l(e)||(e=new gl),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};gl.prototype.equals=function(e){return!l(e)||!(e instanceof gl)?!1:(Gb(this),Gb(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};gl.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof gl)?!1:(Gb(this),Gb(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 sn=gl;var uNt=T(S(),1);var ZY={};function gRe(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var yRe=32.184,xRe=2451545;function Mee(e,t){t=q.addSeconds(e,yRe,t);let n=q.totalDays(t)-xRe;return t=q.addSeconds(t,gRe(n),t),t}var pN=new q(2451545,0,Hn.TAI),_Re=1e3,cu=W.RADIANS_PER_DEGREE,id=W.RADIANS_PER_ARCSECOND,Ca=14959787e4,_ee=new $;function Nee(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=SRe(r-i,t),m=TRe(t,0);ZRe(c,n,d,_ee);let p=a*(1+t),g=Math.cos(u),f=Math.sin(u),x=1+t*g,_=p/x;return l(s)?(s.x=_*g,s.y=_*f,s.z=0):s=new h(_*g,_*f,0),$.multiplyByVector(_ee,s,s)}function TRe(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function SRe(e,t){let n=LRe(e,t);return RRe(n,t)}var CRe=50,VRe=W.EPSILON8;function LRe(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<CRe&&Math.abs(o-i)>VRe;++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 RRe(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 ZRe(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 $(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 GRe=1.0000010178*Ca,ERe=100.46645683*cu,XRe=129597742283429e-5*id,Tee=16002,See=21863,Cee=32004,Vee=10931,Lee=14529,Ree=16368,Zee=15318,Gee=32794,IRe=64*1e-7*Ca,WRe=-152*1e-7*Ca,PRe=62*1e-7*Ca,vRe=-8*1e-7*Ca,wRe=32*1e-7*Ca,FRe=-41*1e-7*Ca,ARe=19*1e-7*Ca,MRe=-11*1e-7*Ca,NRe=-150*1e-7*Ca,kRe=-46*1e-7*Ca,URe=68*1e-7*Ca,DRe=54*1e-7*Ca,BRe=14*1e-7*Ca,YRe=24*1e-7*Ca,ORe=-28*1e-7*Ca,HRe=22*1e-7*Ca,Eee=10,Xee=16002,Iee=21863,Wee=10931,Pee=1473,vee=32004,wee=4387,Fee=73,zRe=-325*1e-7,KRe=-322*1e-7,JRe=-79*1e-7,QRe=232*1e-7,jRe=-52*1e-7,qRe=97*1e-7,$Re=55*1e-7,eZe=-41*1e-7,tZe=-105*1e-7,nZe=-137*1e-7,iZe=258*1e-7,oZe=35*1e-7,rZe=-116*1e-7,sZe=-88*1e-7,aZe=-112*1e-7,cZe=-80*1e-7,NS=new q(0,0,Hn.TAI);function lZe(e,t){Mee(e,NS);let i=(NS.dayNumber-pN.dayNumber+(NS.secondsOfDay-pN.secondsOfDay)/zn.SECONDS_PER_DAY)/(zn.DAYS_PER_JULIAN_CENTURY*10),o=.3595362*i,r=GRe+IRe*Math.cos(Tee*o)+NRe*Math.sin(Tee*o)+WRe*Math.cos(See*o)+kRe*Math.sin(See*o)+PRe*Math.cos(Cee*o)+URe*Math.sin(Cee*o)+vRe*Math.cos(Vee*o)+DRe*Math.sin(Vee*o)+wRe*Math.cos(Lee*o)+BRe*Math.sin(Lee*o)+FRe*Math.cos(Ree*o)+YRe*Math.sin(Ree*o)+ARe*Math.cos(Zee*o)+ORe*Math.sin(Zee*o)+MRe*Math.cos(Gee*o)+HRe*Math.sin(Gee*o),s=ERe+XRe*i+zRe*Math.cos(Eee*o)+tZe*Math.sin(Eee*o)+KRe*Math.cos(Xee*o)+nZe*Math.sin(Xee*o)+JRe*Math.cos(Iee*o)+iZe*Math.sin(Iee*o)+QRe*Math.cos(Wee*o)+oZe*Math.sin(Wee*o)+jRe*Math.cos(Pee*o)+rZe*Math.sin(Pee*o)+qRe*Math.cos(vee*o)+sZe*Math.sin(vee*o)+$Re*Math.cos(wee*o)+aZe*Math.sin(wee*o)+eZe*Math.cos(Fee*o)+cZe*Math.sin(Fee*o),a=.0167086342-.0004203654*i,c=102.93734808*cu+11612.3529*id*i,d=469.97289*id*i,u=174.87317577*cu-8679.27034*id*i;return Nee(r,a,d,c,u,s,t)}function kee(e,t){Mee(e,NS);let i=(NS.dayNumber-pN.dayNumber+(NS.secondsOfDay-pN.secondsOfDay)/zn.SECONDS_PER_DAY)/zn.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*cu,u=-8e-5*i+.02966*o-42e-6*r-13e-8*s,m=83.35324312*cu,p=146434202669e-4*i-38.2702*o-.045047*r+21301e-8*s,g=125.04455501*cu,f=-69679193631e-4*i+6.3602*o+.007625*r-3586e-8*s,x=218.31664563*cu,_=17325593434847e-4*i-6.391*o+.006588*r-3169e-8*s,C=297.85019547*cu+id*(1602961601209e-3*i-6.3706*o+.006593*r-3169e-8*s),V=93.27209062*cu+id*(17395272628478e-4*i-12.7512*o-.001037*r+417e-8*s),L=134.96340251*cu+id*(17179159232178e-4*i+31.8792*o+.051635*r-2447e-7*s),Z=357.52910918*cu+id*(1295965810481e-4*i-.5532*o+136e-6*r-1149e-8*s),E=310.17137918*cu-id*(6967051436e-3*i+6.2068*o+.007618*r-3219e-8*s),X=2*C,v=4*C,P=6*C,A=2*L,M=3*L,b=4*L,R=2*V;a+=3400.4*Math.cos(X)-635.6*Math.cos(X-L)-235.6*Math.cos(L)+218.1*Math.cos(X-Z)+181*Math.cos(X+L),c+=.014216*Math.cos(X-L)+.008551*Math.cos(X-A)-.001383*Math.cos(L)+.001356*Math.cos(X+L)-.001147*Math.cos(v-M)-914e-6*Math.cos(v-A)+869e-6*Math.cos(X-Z-L)-627e-6*Math.cos(X)-394e-6*Math.cos(v-b)+282e-6*Math.cos(X-Z-A)-279e-6*Math.cos(C-L)-236e-6*Math.cos(A)+231e-6*Math.cos(v)+229e-6*Math.cos(P-b)-201e-6*Math.cos(A-R),u+=486.26*Math.cos(X-R)-40.13*Math.cos(X)+37.51*Math.cos(R)+25.73*Math.cos(A-R)+19.97*Math.cos(X-Z-R),p+=-55609*Math.sin(X-L)-34711*Math.sin(X-A)-9792*Math.sin(L)+9385*Math.sin(v-M)+7505*Math.sin(v-A)+5318*Math.sin(X+L)+3484*Math.sin(v-b)-3417*Math.sin(X-Z-L)-2530*Math.sin(P-b)-2376*Math.sin(X)-2075*Math.sin(X-M)-1883*Math.sin(A)-1736*Math.sin(P-5*L)+1626*Math.sin(Z)-1370*Math.sin(P-M),f+=-5392*Math.sin(X-R)-540*Math.sin(Z)-441*Math.sin(X)+423*Math.sin(R)-288*Math.sin(A-R),_+=-3332.9*Math.sin(X)+1197.4*Math.sin(X-L)-662.5*Math.sin(Z)+396.3*Math.sin(L)-218*Math.sin(X-Z);let G=2*E,I=3*E;u+=46.997*Math.cos(E)*i-.614*Math.cos(X-R+E)*i+.614*Math.cos(X-R-E)*i-.0297*Math.cos(G)*o-.0335*Math.cos(E)*o+.0012*Math.cos(X-R+G)*o-16e-5*Math.cos(E)*r+4e-5*Math.cos(I)*r+4e-5*Math.cos(G)*r;let w=2.116*Math.sin(E)*i-.111*Math.sin(X-R-E)*i-.0015*Math.sin(E)*o;p+=w,_+=w,f+=-520.77*Math.sin(E)*i+13.66*Math.sin(X-R+E)*i+1.12*Math.sin(X-E)*i-1.06*Math.sin(R-E)*i+.66*Math.sin(G)*o+.371*Math.sin(E)*o-.035*Math.sin(X-R+G)*o-.015*Math.sin(X-R+E)*o+.0014*Math.sin(E)*r-.0011*Math.sin(I)*r-9e-4*Math.sin(G)*r,a*=_Re;let N=d+u*id,B=m+p*id,U=x+_*id,O=g+f*id;return Nee(a,c,N,B,O,U,t)}var Aee=.012300034,dZe=Aee/(Aee+1)*-1;function uZe(e,t){return t=kee(e,t),h.multiplyByScalar(t,dZe,t)}var Uee=new $(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),AG=new h;ZY.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=q.now()),l(t)||(t=new h),AG=lZe(e,AG),t=h.negate(AG,t),uZe(e,AG),h.subtract(t,AG,t),$.multiplyByVector(Uee,t,t),t};ZY.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=q.now()),t=kee(e,t),$.multiplyByVector(Uee,t,t),t};var Eb=ZY;var hNt=T(S(),1),bN={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};bN.getMorphTime=function(e){return e===bN.SCENE3D?1:e===bN.MORPHING?void 0:0};var oe=Object.freeze(bN);var gNt=T(S(),1);function mZe(e){e=y(e,y.EMPTY_OBJECT),this.color=Y.clone(y(e.color,Y.WHITE)),this.intensity=y(e.intensity,2)}var bp=mZe;function kS(){this.globeDepthTexture=void 0,this.gamma=void 0,this._viewport=new Ke,this._viewportCartesian4=new se,this._viewportDirty=!1,this._viewportOrthographicMatrix=F.clone(F.IDENTITY),this._viewportTransformation=F.clone(F.IDENTITY),this._model=F.clone(F.IDENTITY),this._view=F.clone(F.IDENTITY),this._inverseView=F.clone(F.IDENTITY),this._projection=F.clone(F.IDENTITY),this._infiniteProjection=F.clone(F.IDENTITY),this._entireFrustum=new D,this._currentFrustum=new D,this._frustumPlanes=new se,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=$.clone(F.IDENTITY),this._view3DDirty=!0,this._view3D=new F,this._inverseView3DDirty=!0,this._inverseView3D=new F,this._inverseModelDirty=!0,this._inverseModel=new F,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new $,this._viewRotation=new $,this._inverseViewRotation=new $,this._viewRotation3D=new $,this._inverseViewRotation3D=new $,this._inverseProjectionDirty=!0,this._inverseProjection=new F,this._modelViewDirty=!0,this._modelView=new F,this._modelView3DDirty=!0,this._modelView3D=new F,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new F,this._inverseModelViewDirty=!0,this._inverseModelView=new F,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new F,this._viewProjectionDirty=!0,this._viewProjection=new F,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new F,this._modelViewProjectionDirty=!0,this._modelViewProjection=new F,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new F,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new F,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new F,this._normalDirty=!0,this._normal=new $,this._normal3DDirty=!0,this._normal3D=new $,this._inverseNormalDirty=!0,this._inverseNormal=new $,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new $,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new Yn,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 D,this._eyeEllipsoidNormalEC=new h,this._eyeEllipsoidCurvature=new D,this._modelToEnu=new F,this._enuToModel=new F,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new Y,this._brdfLut=void 0,this._environmentMap=void 0,this._sphericalHarmonicCoefficients=void 0,this._specularEnvironmentMaps=void 0,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(kS.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!Ke.equals(e,this._viewport)){Ke.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 Bee(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return Bee(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){F.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,F.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,F.getMatrix3(this.inverseModel,e),$.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return EY(this),this._view3D}},viewRotation:{get:function(){return EY(this),this._viewRotation}},viewRotation3D:{get:function(){return EY(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return Hee(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return Hee(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return CZe(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return VZe(this),this._modelView}},modelView3D:{get:function(){return LZe(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return IZe(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return RZe(this),this._inverseModelView}},inverseModelView3D:{get:function(){return ZZe(this),this._inverseModelView3D}},viewProjection:{get:function(){return GZe(this),this._viewProjection}},inverseViewProjection:{get:function(){return EZe(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return XZe(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return WZe(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return PZe(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return vZe(this),this._modelViewInfiniteProjection}},normal:{get:function(){return wZe(this),this._normal}},normal3D:{get:function(){return FZe(this),this._normal3D}},inverseNormal:{get:function(){return AZe(this),this._inverseNormal}},inverseNormal3D:{get:function(){return MZe(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 Oee(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return Oee(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}},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 y(this._ellipsoid,ne.default)}}});function hZe(e,t){F.clone(t,e._view),F.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 fZe(e,t){F.clone(t,e._inverseView),F.getMatrix3(t,e._inverseViewRotation)}function pZe(e,t){F.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function bZe(e,t){F.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var Dee=new h,gZe=new F;function yZe(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,Dee)):(e._eyeHeight=-n.maximumRadius,h.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=h.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,Dee)),e._encodedCameraPositionMCDirty=!0,!l(i))return;e._eyeEllipsoidNormalEC=$.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let r=wt.eastNorthUpToFixedFrame(i,n,gZe);e._enuToModel=F.multiplyTransformation(e.inverseModel,r,e._enuToModel),e._modelToEnu=F.inverseTransformation(e._enuToModel,e._modelToEnu),W.equalsEpsilon(n._radii.x,n._radii.y,W.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var GY=new $,xZe=new he;function _Ze(e,t){wt.computeIcrfToCentralBodyFixedMatrix(t.time,GY);let n=Eb.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);$.multiplyByVector(GY,n,n),h.normalize(n,e._sunDirectionWC),n=$.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),h.normalize(n,n),n=Eb.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),$.multiplyByVector(GY,n,n),$.multiplyByVector(e.viewRotation3D,n,n),h.normalize(n,n);let i=t.mapProjection,r=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,xZe);i.project(r,e._sunPositionColumbusView)}kS.prototype.updateCamera=function(e){hZe(this,e.viewMatrix),fZe(this,e.inverseViewMatrix),yZe(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==oe.SCENE2D&&e.frustum instanceof sn};kS.prototype.updateFrustum=function(e){pZe(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&bZe(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};kS.prototype.updatePass=function(e){this._pass=e};var TZe=[],SZe=new bp;kS.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===oe.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),_Ze(this,e);let n=y(e.light,SZe);n instanceof bp?(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=$.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=y(e.environmentMap,e.context.defaultCubeMap),this._sphericalHarmonicCoefficients=y(e.sphericalHarmonicCoefficients,TZe),this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,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=wt.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,Y.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function Bee(e){if(e._viewportDirty){let t=e._viewport;F.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),F.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function CZe(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==oe.SCENE2D&&e._mode!==oe.MORPHING&&!e._orthographicIn3D?F.inverse(e._projection,e._inverseProjection):F.clone(F.ZERO,e._inverseProjection))}function VZe(e){e._modelViewDirty&&(e._modelViewDirty=!1,F.multiplyTransformation(e._view,e._model,e._modelView))}function LZe(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,F.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function RZe(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,F.inverse(e.modelView,e._inverseModelView))}function ZZe(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,F.inverse(e.modelView3D,e._inverseModelView3D))}function GZe(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,F.multiply(e._projection,e._view,e._viewProjection))}function EZe(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,F.inverse(e.viewProjection,e._inverseViewProjection))}function XZe(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,F.multiply(e._projection,e.modelView,e._modelViewProjection))}function IZe(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 WZe(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,F.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function PZe(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,F.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function vZe(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,F.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function wZe(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;F.getMatrix3(e.inverseModelView,t),$.transpose(t,t)}}function FZe(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;F.getMatrix3(e.inverseModelView3D,t),$.transpose(t,t)}}function AZe(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;F.getMatrix3(e.modelView,t),$.transpose(t,t)}}function MZe(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;F.getMatrix3(e.modelView3D,t),$.transpose(t,t)}}var Yee=new h;function Oee(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,F.multiplyByPoint(e.inverseModel,e._cameraPosition,Yee),Yn.fromCartesian(Yee,e._encodedCameraPositionMC))}var NZe=new h,kZe=new h,UZe=new h,DZe=new h,BZe=new he,YZe=new h,OZe=new F;function HZe(e,t,n,i,o,r,s,a){let c=NZe;c.x=e.y,c.y=e.z,c.z=e.x;let d=kZe;d.x=n.y,d.y=n.z,d.z=n.x;let u=UZe;u.x=i.y,u.y=i.z,u.z=i.x;let m=DZe;m.x=t.y,m.y=t.z,m.z=t.x,r===oe.SCENE2D&&(c.z=o*.5);let p=s.unproject(c,BZe);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 g=s.ellipsoid,f=g.cartographicToCartesian(p,YZe),x=wt.eastNorthUpToFixedFrame(f,g,OZe);return F.multiplyByPointAsVector(x,d,d),F.multiplyByPointAsVector(x,u,u),F.multiplyByPointAsVector(x,m,m),l(a)||(a=new F),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 EY(e){e._view3DDirty&&(e._mode===oe.SCENE3D?F.clone(e._view,e._view3D):HZe(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),F.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function Hee(e){e._inverseView3DDirty&&(F.inverseTransformation(e.view3D,e._inverseView3D),F.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var MG=kS;var QNt=T(S(),1);function zZe(e,t,n,i){let o=l(t.vertexBuffer),r=l(t.value),s=t.value?t.value.length:t.componentsPerAttribute,a={index:y(t.index,n),enabled:y(t.enabled,!0),vertexBuffer:t.vertexBuffer,value:r?t.value.slice(0):void 0,componentsPerAttribute:s,componentDatatype:y(t.componentDatatype,Q.FLOAT),normalize:y(t.normalize,!1),offsetInBytes:y(t.offsetInBytes,0),strideInBytes:y(t.strideInBytes,0),instanceDivisor:y(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 Kee(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 gp(e){e=y(e,y.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)zZe(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 g=p.strideInBytes||p.componentsPerAttribute*Q.getSizeInBytes(p.componentDatatype);a=p.vertexBuffer.sizeInBytes/g;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),Kee(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 zee(e){return e.values.length/e.componentsPerAttribute}function KZe(e){return Q.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function JZe(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=zee(e[o[0]]),t=1;t<s;++t){let d=zee(e[o[t]]);if(d!==r)throw new ue(`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+=KZe(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),g={};for(t=0;t<s;++t){n=o[t];let f=Q.getSizeInBytes(e[n].componentDatatype);g[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,_=g[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}}}gp.fromGeometry=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=y(e.geometry,y.EMPTY_OBJECT),i=y(e.bufferUsage,Me.DYNAMIC_DRAW),o=y(e.attributeLocations,y.EMPTY_OBJECT),r=y(e.interleave,!1),s=e.vertexArrayAttributes,a,c,d,u=l(s)?s:[],m=n.attributes;if(r){let f=JZe(m);if(l(f)){d=yt.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=yt.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,g=n.indices;return l(g)&&(ht.computeNumberOfVertices(n)>=W.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=yt.createIndexBuffer({context:t,typedArray:new Uint32Array(g),usage:i,indexDatatype:Ae.UNSIGNED_INT}):p=yt.createIndexBuffer({context:t,typedArray:new Uint16Array(g),usage:i,indexDatatype:Ae.UNSIGNED_SHORT})),new gp({context:t,attributes:u,indexBuffer:p})};Object.defineProperties(gp.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});gp.prototype.getAttribute=function(e){return this._attributes[e]};function QZe(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,o=e._attributes,r=Dt.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 jZe(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)}}gp.prototype._bind=function(){l(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&QZe(this),this._hasConstantAttributes&&jZe(this,this._gl)):Kee(this._gl,this._attributes,this._indexBuffer)};gp.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)}};gp.prototype.isDestroyed=function(){return!1};gp.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),me(this)};var mi=gp;function od(e,t){let{getWebGLStub:n,requestWebgl1:i,webgl:o={},allowTextureFilterAnisotropic:r=!0}=y(t,{});o.alpha=y(o.alpha,!1),o.stencil=y(o.stencil,!0),o.powerPreference=y(o.powerPreference,"high-performance");let s=l(n)?n(e,o):qZe(e,o,i),c=typeof WebGL2RenderingContext<"u"&&s instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=s,this._gl=s,this._webgl2=c,this._id=Bn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new vG(this),this._textureCache=new wG;let d=s;this._stencilBits=d.getParameter(d.STENCIL_BITS),Dt._maximumCombinedTextureImageUnits=d.getParameter(d.MAX_COMBINED_TEXTURE_IMAGE_UNITS),Dt._maximumCubeMapSize=d.getParameter(d.MAX_CUBE_MAP_TEXTURE_SIZE),Dt._maximumFragmentUniformVectors=d.getParameter(d.MAX_FRAGMENT_UNIFORM_VECTORS),Dt._maximumTextureImageUnits=d.getParameter(d.MAX_TEXTURE_IMAGE_UNITS),Dt._maximumRenderbufferSize=d.getParameter(d.MAX_RENDERBUFFER_SIZE),Dt._maximumTextureSize=d.getParameter(d.MAX_TEXTURE_SIZE),Dt._maximumVaryingVectors=d.getParameter(d.MAX_VARYING_VECTORS),Dt._maximumVertexAttributes=d.getParameter(d.MAX_VERTEX_ATTRIBS),Dt._maximumVertexTextureImageUnits=d.getParameter(d.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Dt._maximumVertexUniformVectors=d.getParameter(d.MAX_VERTEX_UNIFORM_VECTORS),Dt._maximumSamples=this._webgl2?d.getParameter(d.MAX_SAMPLES):0;let u=d.getParameter(d.ALIASED_LINE_WIDTH_RANGE);Dt._minimumAliasedLineWidth=u[0],Dt._maximumAliasedLineWidth=u[1];let m=d.getParameter(d.ALIASED_POINT_SIZE_RANGE);Dt._minimumAliasedPointSize=m[0],Dt._maximumAliasedPointSize=m[1];let p=d.getParameter(d.MAX_VIEWPORT_DIMS);Dt._maximumViewportWidth=p[0],Dt._maximumViewportHeight=p[1];let g=d.getShaderPrecisionFormat(d.FRAGMENT_SHADER,d.HIGH_FLOAT);Dt._highpFloatSupported=g.precision!==0;let f=d.getShaderPrecisionFormat(d.FRAGMENT_SHADER,d.HIGH_INT);Dt._highpIntSupported=f.rangeMax!==0,this._antialias=d.getContextAttributes().antialias,this._standardDerivatives=!!pr(d,["OES_standard_derivatives"]),this._blendMinmax=!!pr(d,["EXT_blend_minmax"]),this._elementIndexUint=!!pr(d,["OES_element_index_uint"]),this._depthTexture=!!pr(d,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!pr(d,["EXT_frag_depth"]),this._debugShaders=pr(d,["WEBGL_debug_shaders"]),this._textureFloat=!!pr(d,["OES_texture_float"]),this._textureHalfFloat=!!pr(d,["OES_texture_half_float"]),this._textureFloatLinear=!!pr(d,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!pr(d,["OES_texture_half_float_linear"]),this._supportsTextureLod=!!pr(d,["EXT_shader_texture_lod"]),this._colorBufferFloat=!!pr(d,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!pr(d,["EXT_float_blend"]),this._colorBufferHalfFloat=!!pr(d,["EXT_color_buffer_half_float"]),this._s3tc=!!pr(d,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!pr(d,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!pr(d,["WEBGL_compressed_texture_astc"]),this._etc=!!pr(d,["WEBG_compressed_texture_etc"]),this._etc1=!!pr(d,["WEBGL_compressed_texture_etc1"]),this._bc7=!!pr(d,["EXT_texture_compression_bptc"]),bl.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let x=r?pr(d,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=x,Dt._maximumTextureFilterAnisotropy=l(x)?d.getParameter(x.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let _,C,V,L,Z,E,X,v,P,A;if(c){let G=this;_=function(){return G._gl.createVertexArray()},C=function(I){G._gl.bindVertexArray(I)},V=function(I){G._gl.deleteVertexArray(I)},L=function(I,w,N,B,U){d.drawElementsInstanced(I,w,N,B,U)},Z=function(I,w,N,B){d.drawArraysInstanced(I,w,N,B)},E=function(I,w){d.vertexAttribDivisor(I,w)},X=function(I){d.drawBuffers(I)}}else v=pr(d,["OES_vertex_array_object"]),l(v)&&(_=function(){return v.createVertexArrayOES()},C=function(G){v.bindVertexArrayOES(G)},V=function(G){v.deleteVertexArrayOES(G)}),P=pr(d,["ANGLE_instanced_arrays"]),l(P)&&(L=function(G,I,w,N,B){P.drawElementsInstancedANGLE(G,I,w,N,B)},Z=function(G,I,w,N){P.drawArraysInstancedANGLE(G,I,w,N)},E=function(G,I){P.vertexAttribDivisorANGLE(G,I)}),A=pr(d,["WEBGL_draw_buffers"]),l(A)&&(X=function(G){A.drawBuffersWEBGL(G)});this.glCreateVertexArray=_,this.glBindVertexArray=C,this.glDeleteVertexArray=V,this.glDrawElementsInstanced=L,this.glDrawArraysInstanced=Z,this.glVertexAttribDivisor=E,this.glDrawBuffers=X,this._vertexArrayObject=!!v,this._instancedArrays=!!P,this._drawBuffers=!!A,Dt._maximumDrawBuffers=this.drawBuffers?d.getParameter(ie.MAX_DRAW_BUFFERS):1,Dt._maximumColorAttachments=this.drawBuffers?d.getParameter(ie.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new Y(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let M=new MG,b=new $a(this),R=Ue.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 G=0;G<Dt._maximumVertexAttributes;G++)this._vertexAttribDivisors.push(0);this._pickObjects={},this._nextPickColor=new Uint32Array(1),this.options={getWebGLStub:n,requestWebgl1:i,webgl:o,allowTextureFilterAnisotropic:r},this.cache={},Ue.apply(d,R,b)}function qZe(e,t,n){if(typeof WebGLRenderingContext>"u")throw new ue("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 ue("The browser supports WebGL, but initialization failed.");return r}function $Ze(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 eGe(e,t,n,i){let o=`${$Ze(e,i)}: ${t.name}(`;for(let r=0;r<n.length;++r)r!==0&&(o+=", "),o+=n[r];return o+=");",o}function tGe(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new ue(eGe(e,t,n,i))}function nGe(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 iGe(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,nGe(e,o,t))}return i}function pr(e,t){let n=t.length;for(let i=0;i<n;++i){let o=e.getExtension(t[i]);if(o)return o}}var oGe={};Object.defineProperties(od.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}},supportsTextureLod:{get:function(){return this._webgl2||this._supportsTextureLod}},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=iGe(this._originalGLContext,e?tGe:void 0)}},defaultTexture:{get:function(){return this._defaultTexture===void 0&&(this._defaultTexture=new Ft({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 Ft({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 Ft({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 Sa({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 oGe}}});function Jee(e,t,n,i){let o=e._currentRenderState,r=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,Ue.partialApply(e._gl,o,t,r,n,i)}var XY;typeof WebGLRenderingContext<"u"&&(XY=[ie.BACK]);function IY(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=XY;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var rGe=new ei;od.prototype.clear=function(e,t){e=y(e,rGe),t=y(t,this._defaultPassState);let n=this._gl,i=0,o=e.color,r=e.depth,s=e.stencil;l(o)&&(Y.equals(this._clearColor,o)||(Y.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=y(e.renderState,this._defaultRenderState);Jee(this,a,t,!0);let c=y(e.framebuffer,t.framebuffer);IY(this,c),n.clear(i)};function sGe(e,t,n,i,o){IY(e,t),Jee(e,o,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function aGe(e,t,n,i){let o=t._primitiveType,r=t._vertexArray,s=t._offset,a=t._count,c=t.instanceCount;e._us.model=y(t._modelMatrix,F.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()}od.prototype.draw=function(e,t,n,i){t=y(t,this._defaultPassState);let o=y(e._framebuffer,t.framebuffer),r=y(e._renderState,this._defaultRenderState);n=y(n,e._shaderProgram),i=y(i,e._uniformMap),sGe(this,o,t,n,r),aGe(this,e,n,i)};od.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=XY;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)};od.prototype.readPixels=function(e){let t=this._gl;e=y(e,y.EMPTY_OBJECT);let n=Math.max(y(e.x,0),0),i=Math.max(y(e.y,0),0),o=y(e.width,t.drawingBufferWidth),r=y(e.height,t.drawingBufferHeight),s=e.framebuffer,a=nt.UNSIGNED_BYTE;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype);let c=at.createTypedArray(at.RGBA,a,o,r);return IY(this,s),t.readPixels(n,i,o,r,at.RGBA,nt.toWebGLConstant(a,this),c),c};var Qee={position:0,textureCoordinates:1};od.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!l(e)){let t=new ht({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:Fe.TRIANGLES});e=mi.fromGeometry({context:this,geometry:t,attributeLocations:Qee,bufferUsage:Me.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};od.prototype.createViewportQuadCommand=function(e,t){return t=y(t,y.EMPTY_OBJECT),new tt({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Fe.TRIANGLES,renderState:t.renderState,shaderProgram:rn.fromCache({context:this,vertexShaderSource:$y,fragmentShaderSource:e,attributeLocations:Qee}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};od.prototype.getObjectByPickColor=function(e){return this._pickObjects[e.toRgba()]};function WY(e,t,n){this._pickObjects=e,this.key=t,this.color=n}Object.defineProperties(WY.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}});WY.prototype.destroy=function(){delete this._pickObjects[this.key]};od.prototype.createPickId=function(e){++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new ue("Out of unique Pick IDs.");return this._pickObjects[t]=e,new WY(this._pickObjects,t,Y.fromRgba(t))};od.prototype.isDestroyed=function(){return!1};od.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(),me(this)};od._deprecationWarning=Es;var NG=od;var ikt=T(S(),1);var w5t=T(S(),1);function US(e){e=y(e,y.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 pe("Both color renderbuffer and texture attachments must be provided.");let s=e.depthStencilRenderbuffer,a=e.depthStencilTexture;if(l(s)!==l(a))throw new pe("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new js({context:t,colorRenderbuffers:o,depthStencilRenderbuffer:s,destroyAttachments:e.destroyAttachments}),this._colorFramebuffer=new js({context:t,colorTextures:r,depthStencilTexture:a,destroyAttachments:e.destroyAttachments})}US.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};US.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};US.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)};US.prototype.isDestroyed=function(){return!1};US.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),me(this)};var kG=US;var O5t=T(S(),1);var M5t=T(S(),1);var yl={RGBA4:ie.RGBA4,RGBA8:ie.RGBA8,RGBA16F:ie.RGBA16F,RGBA32F:ie.RGBA32F,RGB5_A1:ie.RGB5_A1,RGB565:ie.RGB565,DEPTH_COMPONENT16:ie.DEPTH_COMPONENT16,STENCIL_INDEX8:ie.STENCIL_INDEX8,DEPTH_STENCIL:ie.DEPTH_STENCIL,DEPTH24_STENCIL8:ie.DEPTH24_STENCIL8,validate:function(e){return e===yl.RGBA4||e===yl.RGBA8||e===yl.RGBA16F||e===yl.RGBA32F||e===yl.RGB5_A1||e===yl.RGB565||e===yl.DEPTH_COMPONENT16||e===yl.STENCIL_INDEX8||e===yl.DEPTH_STENCIL||e===yl.DEPTH24_STENCIL8},getColorFormat:function(e){return e===ie.FLOAT?yl.RGBA32F:e===ie.HALF_FLOAT_OES?yl.RGBA16F:yl.RGBA8}},Ic=Object.freeze(yl);function UG(e){e=y(e,y.EMPTY_OBJECT);let n=e.context._gl,i=Dt.maximumRenderbufferSize,o=y(e.format,Ic.RGBA4),r=l(e.width)?e.width:n.drawingBufferWidth,s=l(e.height)?e.height:n.drawingBufferHeight,a=y(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(UG.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});UG.prototype._getRenderbuffer=function(){return this._renderbuffer};UG.prototype.isDestroyed=function(){return!1};UG.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),me(this)};var rd=UG;function fs(e){e=y(e,y.EMPTY_OBJECT),this._numSamples=y(e.numSamples,1),this._colorAttachmentsLength=y(e.colorAttachmentsLength,1),this._color=y(e.color,!0),this._depth=y(e.depth,!1),this._depthStencil=y(e.depthStencil,!1),this._supportsDepthTexture=y(e.supportsDepthTexture,!1),this._createColorAttachments=y(e.createColorAttachments,!0),this._createDepthAttachments=y(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(fs.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}}});fs.prototype.isDirty=function(e,t,n,i,o){n=y(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])};fs.prototype.update=function(e,t,n,i,o,r){if(i=e.msaa?y(i,1):1,o=y(o,this._color?y(this._pixelDatatype,nt.UNSIGNED_BYTE):void 0),r=y(r,this._color?y(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 Ft({context:e,width:t,height:n,pixelFormat:r,pixelDatatype:o,sampler:$t.NEAREST}),this._numSamples>1){let a=Ic.getColorFormat(o);this._colorRenderbuffers[s]=new rd({context:e,width:t,height:n,format:a,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new Ft({context:e,width:t,height:n,pixelFormat:at.DEPTH_STENCIL,pixelDatatype:nt.UNSIGNED_INT_24_8,sampler:$t.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new rd({context:e,width:t,height:n,format:Ic.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new rd({context:e,width:t,height:n,format:Ic.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new Ft({context:e,width:t,height:n,pixelFormat:at.DEPTH_COMPONENT,pixelDatatype:nt.UNSIGNED_INT,sampler:$t.NEAREST}):this._depthRenderbuffer=new rd({context:e,width:t,height:n,format:Ic.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new kG({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 js({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};fs.prototype.getColorTexture=function(e){return e=y(e,0),this._colorTextures[e]};fs.prototype.setColorTexture=function(e,t){t=y(t,0),this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};fs.prototype.getColorRenderbuffer=function(e){return e=y(e,0),this._colorRenderbuffers[e]};fs.prototype.setColorRenderbuffer=function(e,t){t=y(t,0),this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};fs.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};fs.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};fs.prototype.getDepthTexture=function(){return this._depthTexture};fs.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};fs.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};fs.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};fs.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};fs.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};fs.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};fs.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};fs.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};fs.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 hi=fs;var xkt=T(S(),1);var rkt=T(S(),1);var ix={VERTEX:0,FRAGMENT:1,BOTH:2};ix.includesVertexShader=function(e){return e===ix.VERTEX||e===ix.BOTH};ix.includesFragmentShader=function(e){return e===ix.FRAGMENT||e===ix.BOTH};var ye=Object.freeze(ix);var akt=T(S(),1);function PY(e){this.name=e,this.fields=[]}PY.prototype.addField=function(e,t){let n=`    ${e} ${t};`;this.fields.push(n)};PY.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=["    float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var DG=PY;var lkt=T(S(),1);function vY(e){this.signature=e,this.body=[]}vY.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}`)};vY.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};var BG=vY;function Wc(){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(Wc.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});Wc.prototype.addDefine=function(e,t,n){n=y(n,ye.BOTH);let i=e;l(t)&&(i+=` ${t.toString()}`),ye.includesVertexShader(n)&&this._vertexShaderParts.defineLines.push(i),ye.includesFragmentShader(n)&&this._fragmentShaderParts.defineLines.push(i)};Wc.prototype.addStruct=function(e,t,n){this._structs[e]=new DG(t),ye.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),ye.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};Wc.prototype.addStructField=function(e,t,n){this._structs[e].addField(t,n)};Wc.prototype.addFunction=function(e,t,n){this._functions[e]=new BG(t),ye.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),ye.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};Wc.prototype.addFunctionLines=function(e,t){this._functions[e].addLines(t)};Wc.prototype.addUniform=function(e,t,n){n=y(n,ye.BOTH);let i=`uniform ${e} ${t};`;ye.includesVertexShader(n)&&this._vertexShaderParts.uniformLines.push(i),ye.includesFragmentShader(n)&&this._fragmentShaderParts.uniformLines.push(i)};Wc.prototype.setPositionAttribute=function(e,t){return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0};Wc.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+=lGe(e),i};Wc.prototype.addVarying=function(e,t,n){n=l(n)?`${n} `:"";let i=`${e} ${t};`;this._vertexShaderParts.varyingLines.push(`${n}out ${i}`),this._fragmentShaderParts.varyingLines.push(`${n}in ${i}`)};Wc.prototype.addVertexLines=function(e){let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};Wc.prototype.addFragmentLines=function(e){let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};Wc.prototype.buildShaderProgram=function(e){let t=l(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=cGe(this),i=dGe(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 rn.fromCache({context:e,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:this._attributeLocations})};Wc.prototype.clone=function(){return Ye(this,!0)};function cGe(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 lGe(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function dGe(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 ox=Wc;var Ekt=T(S(),1);function Ws(e,t,n,i){let o=Ws._verifyAttributes(t);n=y(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=Ws._vertexSizeInBytes(a),p=a[0].usage,g={vertexSizeInBytes:m,vertexBuffer:void 0,usage:p,needsCommit:!1,arrayBuffer:void 0,arrayViews:Ws._createArrayViews(a,m)};this._allBuffers.push(g)}this._size=0,this._instanced=y(i,!1),this._precreated=r,this._context=e,this.writers=void 0,this.va=void 0,this.resize(n)}Ws._verifyAttributes=function(e){let t=[];for(let i=0;i<e.length;++i){let o=e[i],r={index:y(o.index,i),enabled:y(o.enabled,!0),componentsPerAttribute:o.componentsPerAttribute,componentDatatype:y(o.componentDatatype,Q.FLOAT),normalize:y(o.normalize,!1),vertexBuffer:o.vertexBuffer,usage:y(o.usage,Me.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};Ws._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};Ws._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};Ws.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];Ws._resize(o,this._size),Ws._appendWriters(this.writers,o)}wY(this)};Ws._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 uGe=[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}}];Ws._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]=uGe[r.componentsPerAttribute-1](t,r.view,r.vertexSizeInComponentType)}};Ws.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=mGe(this,i)||t;if(t||!l(this.va)){wY(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);Ws._appendAttributes(u,i,m,this._instanced)}u=u.concat(this._precreated),s.push({va:new mi({context:this._context,attributes:u,indexBuffer:e}),indicesCount:1.5*(d!==c-1?a:this._size%a)})}}};function mGe(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=yt.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}Ws._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})}};Ws.prototype.subCommit=function(e,t){let n=this._allBuffers;for(let i=0,o=n.length;i<o;++i)hGe(n[i],e,t)};function hGe(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)}}Ws.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function wY(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}Ws.prototype.isDestroyed=function(){return!1};Ws.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 wY(this),me(this)};var yp=Ws;var Pkt=T(S(),1);function fGe(e,t,n){let i={flipY:!0,skipColorSpaceConversion:n,preferImageBitmap:!0},o=[Ee.createIfNeeded(t.positiveX).fetchImage(i),Ee.createIfNeeded(t.negativeX).fetchImage(i),Ee.createIfNeeded(t.positiveY).fetchImage(i),Ee.createIfNeeded(t.negativeY).fetchImage(i),Ee.createIfNeeded(t.positiveZ).fetchImage(i),Ee.createIfNeeded(t.negativeZ).fetchImage(i)];return Promise.all(o).then(function(r){return new Sa({context:e,source:{positiveX:r[0],negativeX:r[1],positiveY:r[2],negativeY:r[3],positiveZ:r[4],negativeZ:r[5]}})})}var YG=fGe;var Kkt=T(S(),1);var Dkt=T(S(),1);var Akt=T(S(),1);function Xb(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new be,this.setValue(e)}Object.defineProperties(Xb.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});Xb.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};Xb.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))}};Xb.prototype.equals=function(e){return this===e||e instanceof Xb&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};Xb.prototype.valueOf=function(){return this._value};Xb.prototype.toString=function(){return String(this._value)};var Jn=Xb;function pGe(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 bGe(e){return new Jn(e)}function gGe(e,t,n){return pGe(e,`_${e.toString()}`,`_${e.toString()}Subscription`,y(t,!1),y(n,bGe))}var de=gGe;function OG(e){this._definitionChanged=new be,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._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(OG.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:de("show"),image:de("image"),scale:de("scale"),pixelOffset:de("pixelOffset"),eyeOffset:de("eyeOffset"),horizontalOrigin:de("horizontalOrigin"),verticalOrigin:de("verticalOrigin"),heightReference:de("heightReference"),color:de("color"),rotation:de("rotation"),alignedAxis:de("alignedAxis"),sizeInMeters:de("sizeInMeters"),width:de("width"),height:de("height"),scaleByDistance:de("scaleByDistance"),translucencyByDistance:de("translucencyByDistance"),pixelOffsetScaleByDistance:de("pixelOffsetScaleByDistance"),imageSubRegion:de("imageSubRegion"),distanceDisplayCondition:de("distanceDisplayCondition"),disableDepthTestDistance:de("disableDepthTestDistance"),splitDirection:de("splitDirection")});OG.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.splitDirection=this._splitDirection,e):new OG(this)};OG.prototype.merge=function(e){this.show=y(this._show,e.show),this.image=y(this._image,e.image),this.scale=y(this._scale,e.scale),this.pixelOffset=y(this._pixelOffset,e.pixelOffset),this.eyeOffset=y(this._eyeOffset,e.eyeOffset),this.horizontalOrigin=y(this._horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=y(this._verticalOrigin,e.verticalOrigin),this.heightReference=y(this._heightReference,e.heightReference),this.color=y(this._color,e.color),this.rotation=y(this._rotation,e.rotation),this.alignedAxis=y(this._alignedAxis,e.alignedAxis),this.sizeInMeters=y(this._sizeInMeters,e.sizeInMeters),this.width=y(this._width,e.width),this.height=y(this._height,e.height),this.scaleByDistance=y(this._scaleByDistance,e.scaleByDistance),this.translucencyByDistance=y(this._translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=y(this._pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.imageSubRegion=y(this._imageSubRegion,e.imageSubRegion),this.distanceDisplayCondition=y(this._distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this._disableDepthTestDistance,e.disableDepthTestDistance),this.splitDirection=y(this.splitDirection,e.splitDirection)};var ec=OG;var AUt=T(S(),1);var jkt=T(S(),1);function rx(){this._array=[],this._hash={}}Object.defineProperties(rx.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}});rx.prototype.contains=function(e){return l(this._hash[e])};rx.prototype.set=function(e,t){let n=this._hash[e];t!==n&&(this.remove(e),this._hash[e]=t,this._array.push(t))};rx.prototype.get=function(e){return this._hash[e]};rx.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};rx.prototype.removeAll=function(){let e=this._array;e.length>0&&(this._hash={},e.length=0)};var Lt=rx;var tUt=T(S(),1);function sd(e,t){e=y(e,0),this._near=e,t=y(t,Number.MAX_VALUE),this._far=t}Object.defineProperties(sd.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}}});sd.packedLength=2;sd.pack=function(e,t,n){return n=y(n,0),t[n++]=e.near,t[n]=e.far,t};sd.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new sd),n.near=e[t++],n.far=e[t],n};sd.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};sd.clone=function(e,t){if(l(e))return l(t)||(t=new sd),t.near=e.near,t.far=e.far,t};sd.prototype.clone=function(e){return sd.clone(this,e)};sd.prototype.equals=function(e){return sd.equals(this,e)};var Pt=sd;var rUt=T(S(),1);function lu(e,t,n,i){this.near=y(e,0),this.nearValue=y(t,0),this.far=y(n,1),this.farValue=y(i,0)}lu.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 lu(e.near,e.nearValue,e.far,e.farValue)};lu.packedLength=4;lu.pack=function(e,t,n){return n=y(n,0),t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t};lu.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new lu),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};lu.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};lu.prototype.clone=function(e){return lu.clone(this,e)};lu.prototype.equals=function(e){return lu.equals(this,e)};var kt=lu;var aUt=T(S(),1),sx={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(sx);function du(e){return e===sx.CLAMP_TO_GROUND||e===sx.CLAMP_TO_3D_TILE||e===sx.CLAMP_TO_TERRAIN}function DS(e){return e===sx.RELATIVE_TO_GROUND||e===sx.RELATIVE_TO_3D_TILE||e===sx.RELATIVE_TO_TERRAIN}var lUt=T(S(),1),yGe={CENTER:0,LEFT:1,RIGHT:-1},gi=Object.freeze(yGe);var uUt=T(S(),1),xGe={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1},Pn=Object.freeze(xGe);var hUt=T(S(),1),_Ge={DONE:0,PENDING:1,FAILED:2},ft=Object.freeze(_Ge);var yUt=T(S(),1);function ym(){pe.throwInstantiationError()}Object.defineProperties(ym.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError}});ym.prototype.getValue=pe.throwInstantiationError;ym.prototype.equals=pe.throwInstantiationError;ym.equals=function(e,t){return e===t||l(e)&&e.equals(t)};ym.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(!ym.equals(e[i],t[i]))return!1;return!0};ym.isConstant=function(e){return!l(e)||e.isConstant};ym.getValueOrUndefined=function(e,t,n){return l(e)?e.getValue(t,n):void 0};ym.getValueOrDefault=function(e,t,n,i){return l(e)?y(e.getValue(t,i),n):n};ym.getValueOrClonedDefault=function(e,t,n,i){let o;return l(e)&&(o=e.getValue(t,i)),l(o)||(o=n.clone(o)),o};var K=ym;var _Ut=T(S(),1),TGe={LEFT:-1,NONE:0,RIGHT:1},Gr=Object.freeze(TGe);var SGe=Y.WHITE,CGe=h.ZERO,VGe=Qe.NONE,LGe=D.ZERO,RGe=1,ZGe=0,GGe=h.ZERO,EGe=gi.CENTER,XGe=Pn.CENTER,IGe=!1,WGe=Gr.NONE,PGe=new h,vGe=new Y,wGe=new h,FGe=new D,AGe=new kt,MGe=new kt,NGe=new kt,kGe=new Ke,UGe=new Pt;function jee(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function Ib(e,t){t.collectionChanged.addEventListener(Ib.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Lt,this._onCollectionChanged(t,t.values,[],[])}Ib.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)&&K.getValueOrDefault(a._show,e,!0),m;if(u&&(m=K.getValueOrUndefined(s._position,e,PGe),c=K.getValueOrUndefined(a._image,e),u=l(m)&&l(c)),!u){FY(r,s,n);continue}K.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=K.getValueOrDefault(a._color,e,SGe,vGe),d.eyeOffset=K.getValueOrDefault(a._eyeOffset,e,CGe,wGe),d.heightReference=K.getValueOrDefault(a._heightReference,e,VGe),d.pixelOffset=K.getValueOrDefault(a._pixelOffset,e,LGe,FGe),d.scale=K.getValueOrDefault(a._scale,e,RGe),d.rotation=K.getValueOrDefault(a._rotation,e,ZGe),d.alignedAxis=K.getValueOrDefault(a._alignedAxis,e,GGe),d.horizontalOrigin=K.getValueOrDefault(a._horizontalOrigin,e,EGe),d.verticalOrigin=K.getValueOrDefault(a._verticalOrigin,e,XGe),d.width=K.getValueOrUndefined(a._width,e),d.height=K.getValueOrUndefined(a._height,e),d.scaleByDistance=K.getValueOrUndefined(a._scaleByDistance,e,AGe),d.translucencyByDistance=K.getValueOrUndefined(a._translucencyByDistance,e,MGe),d.pixelOffsetScaleByDistance=K.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,NGe),d.sizeInMeters=K.getValueOrDefault(a._sizeInMeters,e,IGe),d.distanceDisplayCondition=K.getValueOrUndefined(a._distanceDisplayCondition,e,UGe),d.disableDepthTestDistance=K.getValueOrUndefined(a._disableDepthTestDistance,e),d.splitDirection=K.getValueOrDefault(a._splitDirection,e,WGe);let p=K.getValueOrUndefined(a._imageSubRegion,e,kGe);l(p)&&d.setImageSubRegion(d._imageId,p)}return!0};Ib.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.billboard))return ft.FAILED;let i=n.billboard;if(i.heightReference===Qe.NONE)t.center=h.clone(i.position,t.center);else{if(!l(i._clampedPosition))return ft.PENDING;t.center=h.clone(i._clampedPosition,t.center)}return t.radius=0,ft.DONE};Ib.prototype.isDestroyed=function(){return!1};Ib.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Ib.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return me(this)};Ib.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 jee(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 jee(r)):(FY(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],FY(s.get(r.id),r,a),s.remove(r.id)};function FY(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var HG=Ib;var Ren=T(S(),1);var SDt=T(S(),1);var eDt=T(S(),1);var kUt=T(S(),1);function DGe(e,t){this.start=y(e,0),this.stop=y(t,0)}var Va=DGe;function fn(e,t){this.center=h.clone(y(e,h.ZERO)),this.radius=y(t,0)}var NY=new h,kY=new h,UY=new h,DY=new h,BY=new h,YY=new h,OY=new h,$s=new h,HY=new h,zY=new h,KY=new h,JY=new h,BGe=4/3*W.PI;fn.fromPoints=function(e,t){if(l(t)||(t=new fn),!l(e)||e.length===0)return t.center=h.clone(h.ZERO,t.center),t.radius=0,t;let n=h.clone(e[0],OY),i=h.clone(n,NY),o=h.clone(n,kY),r=h.clone(n,UY),s=h.clone(n,DY),a=h.clone(n,BY),c=h.clone(n,YY),d=e.length,u;for(u=1;u<d;u++){h.clone(e[u],n);let P=n.x,A=n.y,M=n.z;P<i.x&&h.clone(n,i),P>s.x&&h.clone(n,s),A<o.y&&h.clone(n,o),A>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,$s)),p=h.magnitudeSquared(h.subtract(a,o,$s)),g=h.magnitudeSquared(h.subtract(c,r,$s)),f=i,x=s,_=m;p>_&&(_=p,f=o,x=a),g>_&&(_=g,f=r,x=c);let C=HY;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,$s)),L=Math.sqrt(V),Z=zY;Z.x=i.x,Z.y=o.y,Z.z=r.z;let E=KY;E.x=s.x,E.y=a.y,E.z=c.z;let X=h.midpoint(Z,E,JY),v=0;for(u=0;u<d;u++){h.clone(e[u],n);let P=h.magnitude(h.subtract(n,X,$s));P>v&&(v=P);let A=h.magnitudeSquared(h.subtract(n,C,$s));if(A>V){let M=Math.sqrt(A);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<v?(h.clone(C,t.center),t.radius=L):(h.clone(X,t.center),t.radius=v),t};var qee=new Li,YGe=new h,OGe=new h,AY=new he,MY=new he;fn.fromRectangle2D=function(e,t,n){return fn.fromRectangleWithHeights2D(e,t,0,0,n)};fn.fromRectangleWithHeights2D=function(e,t,n,i,o){if(l(o)||(o=new fn),!l(e))return o.center=h.clone(h.ZERO,o.center),o.radius=0,o;qee._ellipsoid=ne.default,t=y(t,qee),ae.southwest(e,AY),AY.height=n,ae.northeast(e,MY),MY.height=i;let r=t.project(AY,YGe),s=t.project(MY,OGe),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 HGe=[];fn.fromRectangle3D=function(e,t,n,i){if(t=y(t,ne.default),n=y(n,0),l(i)||(i=new fn),!l(e))return i.center=h.clone(h.ZERO,i.center),i.radius=0,i;let o=ae.subsample(e,t,n,HGe);return fn.fromPoints(o,i)};fn.fromVertices=function(e,t,n,i){if(l(i)||(i=new fn),!l(e)||e.length===0)return i.center=h.clone(h.ZERO,i.center),i.radius=0,i;t=y(t,h.ZERO),n=y(n,3);let o=OY;o.x=e[0]+t.x,o.y=e[1]+t.y,o.z=e[2]+t.z;let r=h.clone(o,NY),s=h.clone(o,kY),a=h.clone(o,UY),c=h.clone(o,DY),d=h.clone(o,BY),u=h.clone(o,YY),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 g=h.magnitudeSquared(h.subtract(c,r,$s)),f=h.magnitudeSquared(h.subtract(d,s,$s)),x=h.magnitudeSquared(h.subtract(u,a,$s)),_=r,C=c,V=g;f>V&&(V=f,_=s,C=d),x>V&&(V=x,_=a,C=u);let L=HY;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,$s)),E=Math.sqrt(Z),X=zY;X.x=r.x,X.y=s.y,X.z=a.z;let v=KY;v.x=c.x,v.y=d.y,v.z=u.z;let P=h.midpoint(X,v,JY),A=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,P,$s));M>A&&(A=M);let b=h.magnitudeSquared(h.subtract(o,L,$s));if(b>Z){let R=Math.sqrt(b);E=(E+R)*.5,Z=E*E;let G=R-E;L.x=(E*L.x+G*o.x)/R,L.y=(E*L.y+G*o.y)/R,L.z=(E*L.z+G*o.z)/R}}return E<A?(h.clone(L,i.center),i.radius=E):(h.clone(P,i.center),i.radius=A),i};fn.fromEncodedCartesianVertices=function(e,t,n){if(l(n)||(n=new fn),!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=OY;i.x=e[0]+t[0],i.y=e[1]+t[1],i.z=e[2]+t[2];let o=h.clone(i,NY),r=h.clone(i,kY),s=h.clone(i,UY),a=h.clone(i,DY),c=h.clone(i,BY),d=h.clone(i,YY),u=e.length,m;for(m=0;m<u;m+=3){let A=e[m]+t[m],M=e[m+1]+t[m+1],b=e[m+2]+t[m+2];i.x=A,i.y=M,i.z=b,A<o.x&&h.clone(i,o),A>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,$s)),g=h.magnitudeSquared(h.subtract(c,r,$s)),f=h.magnitudeSquared(h.subtract(d,s,$s)),x=o,_=a,C=p;g>C&&(C=g,x=r,_=c),f>C&&(C=f,x=s,_=d);let V=HY;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,$s)),Z=Math.sqrt(L),E=zY;E.x=o.x,E.y=r.y,E.z=s.z;let X=KY;X.x=a.x,X.y=c.y,X.z=d.z;let v=h.midpoint(E,X,JY),P=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 A=h.magnitude(h.subtract(i,v,$s));A>P&&(P=A);let M=h.magnitudeSquared(h.subtract(i,V,$s));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<P?(h.clone(V,n.center),n.radius=Z):(h.clone(v,n.center),n.radius=P),n};fn.fromCornerPoints=function(e,t,n){l(n)||(n=new fn);let i=h.midpoint(e,t,n.center);return n.radius=h.distance(i,t),n};fn.fromEllipsoid=function(e,t){return l(t)||(t=new fn),h.clone(h.ZERO,t.center),t.radius=e.maximumRadius,t};var zGe=new h;fn.fromBoundingSpheres=function(e,t){if(l(t)||(t=new fn),!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 fn.clone(e[0],t);if(n===2)return fn.union(e[0],e[1],t);let i=[],o;for(o=0;o<n;o++)i.push(e[o].center);t=fn.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,zGe)+a.radius)}return t.radius=s,t};var KGe=new h,JGe=new h,QGe=new h;fn.fromOrientedBoundingBox=function(e,t){l(t)||(t=new fn);let n=e.halfAxes,i=$.getColumn(n,0,KGe),o=$.getColumn(n,1,JGe),r=$.getColumn(n,2,QGe);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 jGe=new h,qGe=new h;fn.fromTransformation=function(e,t){l(t)||(t=new fn);let n=F.getTranslation(e,jGe),i=F.getScale(e,qGe),o=.5*h.magnitude(i);return t.center=h.clone(n,t.center),t.radius=o,t};fn.clone=function(e,t){if(l(e))return l(t)?(t.center=h.clone(e.center,t.center),t.radius=e.radius,t):new fn(e.center,e.radius)};fn.packedLength=4;fn.pack=function(e,t,n){n=y(n,0);let i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t};fn.unpack=function(e,t,n){t=y(t,0),l(n)||(n=new fn);let i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var $Ge=new h,eEe=new h;fn.union=function(e,t,n){l(n)||(n=new fn);let i=e.center,o=e.radius,r=t.center,s=t.radius,a=h.subtract(r,i,$Ge),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,eEe);return h.add(u,i,u),h.clone(u,n.center),n.radius=d,n};var tEe=new h;fn.expand=function(e,t,n){n=fn.clone(e,n);let i=h.magnitude(h.subtract(t,n.center,tEe));return i>n.radius&&(n.radius=i),n};fn.intersectPlane=function(e,t){let n=e.center,i=e.radius,o=t.normal,r=h.dot(o,n)+t.distance;return r<-i?Kt.OUTSIDE:r<i?Kt.INTERSECTING:Kt.INSIDE};fn.transform=function(e,t,n){return l(n)||(n=new fn),n.center=F.multiplyByPoint(t,e.center,n.center),n.radius=F.getMaximumScale(t)*e.radius,n};var nEe=new h;fn.distanceSquaredTo=function(e,t){let n=h.subtract(e.center,t,nEe),i=h.magnitude(n)-e.radius;return i<=0?0:i*i};fn.transformWithoutScale=function(e,t,n){return l(n)||(n=new fn),n.center=F.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var iEe=new h;fn.computePlaneDistances=function(e,t,n,i){l(i)||(i=new Va);let o=h.subtract(e.center,t,iEe),r=h.dot(n,o);return i.start=r-e.radius,i.stop=r+e.radius,i};var $ee=new h,oEe=new h,rEe=new h,sEe=new h,aEe=new h,cEe=new he,tte=new Array(8);for(let e=0;e<8;++e)tte[e]=new h;var ete=new Li;fn.projectTo2D=function(e,t,n){ete._ellipsoid=ne.default,t=y(t,ete);let i=t.ellipsoid,o=e.center,r=e.radius,s;h.equals(o,h.ZERO)?s=h.clone(h.UNIT_X,$ee):s=i.geodeticSurfaceNormal(o,$ee);let a=h.cross(h.UNIT_Z,s,oEe);h.normalize(a,a);let c=h.cross(s,a,rEe);h.normalize(c,c),h.multiplyByScalar(s,r,s),h.multiplyByScalar(c,r,c),h.multiplyByScalar(a,r,a);let d=h.negate(c,aEe),u=h.negate(a,sEe),m=tte,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 g=m.length;for(let C=0;C<g;++C){let V=m[C];h.add(o,V,V);let L=i.cartesianToCartographic(V,cEe);t.project(L,V)}n=fn.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};fn.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)};fn.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&e.radius===t.radius};fn.prototype.intersectPlane=function(e){return fn.intersectPlane(this,e)};fn.prototype.distanceSquaredTo=function(e){return fn.distanceSquaredTo(this,e)};fn.prototype.computePlaneDistances=function(e,t,n){return fn.computePlaneDistances(this,e,t,n)};fn.prototype.isOccluded=function(e){return fn.isOccluded(this,e)};fn.prototype.equals=function(e){return fn.equals(this,e)};fn.prototype.clone=function(e){return fn.clone(this,e)};fn.prototype.volume=function(){let e=this.radius;return BGe*e*e*e};var ce=fn;var iDt=T(S(),1);function lEe(e){e=y(e,y.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 mn=lEe;var rDt=T(S(),1),dEe={NONE:0,TOP:1,ALL:2},ln=Object.freeze(dEe);var lDt=T(S(),1);function ss(e){e=y(e,y.EMPTY_OBJECT),this.position=y(e.position,!1),this.normal=y(e.normal,!1),this.st=y(e.st,!1),this.bitangent=y(e.bitangent,!1),this.tangent=y(e.tangent,!1),this.color=y(e.color,!1)}ss.POSITION_ONLY=Object.freeze(new ss({position:!0}));ss.POSITION_AND_NORMAL=Object.freeze(new ss({position:!0,normal:!0}));ss.POSITION_NORMAL_AND_ST=Object.freeze(new ss({position:!0,normal:!0,st:!0}));ss.POSITION_AND_ST=Object.freeze(new ss({position:!0,st:!0}));ss.POSITION_AND_COLOR=Object.freeze(new ss({position:!0,color:!0}));ss.ALL=Object.freeze(new ss({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));ss.DEFAULT=ss.POSITION_NORMAL_AND_ST;ss.packedLength=6;ss.pack=function(e,t,n){return n=y(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};ss.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new ss),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};ss.clone=function(e,t){if(l(e))return l(t)||(t=new ss),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=ss;var uEe=new h;function ad(e){e=y(e,y.EMPTY_OBJECT);let t=e.minimum,n=e.maximum,i=y(e.vertexFormat,Pe.DEFAULT);this._minimum=h.clone(t),this._maximum=h.clone(n),this._vertexFormat=i,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}ad.fromDimensions=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new ad({minimum:h.negate(n,new h),maximum:n,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})};ad.fromAxisAlignedBoundingBox=function(e){return new ad({minimum:e.minimum,maximum:e.maximum})};ad.packedLength=2*h.packedLength+Pe.packedLength+1;ad.pack=function(e,t,n){return n=y(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]=y(e._offsetAttribute,-1),t};var ite=new h,ote=new h,rte=new Pe,nte={minimum:ite,maximum:ote,vertexFormat:rte,offsetAttribute:void 0};ad.unpack=function(e,t,n){t=y(t,0);let i=h.unpack(e,t,ite),o=h.unpack(e,t+h.packedLength,ote),r=Pe.unpack(e,t+2*h.packedLength,rte),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):(nte.offsetAttribute=s===-1?void 0:s,new ad(nte))};ad.createGeometry=function(e){let t=e._minimum,n=e._maximum,i=e._vertexFormat;if(h.equals(t,n))return;let o=new mn,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,uEe),c=h.magnitude(a)*.5;if(l(e._offsetAttribute)){let d=s.length,u=e._offsetAttribute===ln.NONE?0:1,m=new Uint8Array(d/3).fill(u);o.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}return new ht({attributes:o,indices:r,primitiveType:Fe.TRIANGLES,boundingSphere:new ce(h.ZERO,c),offsetAttribute:e._offsetAttribute})};var QY;ad.getUnitBox=function(){return l(QY)||(QY=ad.createGeometry(ad.fromDimensions({dimensions:new h(1,1,1),vertexFormat:Pe.POSITION_ONLY}))),QY};var xl=ad;var vDt=T(S(),1);var mEe=new h;function Kh(e){e=y(e,y.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"}Kh.fromDimensions=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new Kh({minimum:h.negate(n,new h),maximum:n,offsetAttribute:e.offsetAttribute})};Kh.fromAxisAlignedBoundingBox=function(e){return new Kh({minimum:e.minimum,maximum:e.maximum})};Kh.packedLength=2*h.packedLength+1;Kh.pack=function(e,t,n){return n=y(n,0),h.pack(e._min,t,n),h.pack(e._max,t,n+h.packedLength),t[n+h.packedLength*2]=y(e._offsetAttribute,-1),t};var ate=new h,cte=new h,ste={minimum:ate,maximum:cte,offsetAttribute:void 0};Kh.unpack=function(e,t,n){t=y(t,0);let i=h.unpack(e,t,ate),o=h.unpack(e,t+h.packedLength,cte),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):(ste.offsetAttribute=r===-1?void 0:r,new Kh(ste))};Kh.createGeometry=function(e){let t=e._min,n=e._max;if(h.equals(t,n))return;let i=new mn,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,mEe),a=h.magnitude(s)*.5;if(l(e._offsetAttribute)){let c=r.length,d=e._offsetAttribute===ln.NONE?0:1,u=new Uint8Array(c/3).fill(d);i.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})}return new ht({attributes:i,indices:o,primitiveType:Fe.LINES,boundingSphere:new ce(h.ZERO,a),offsetAttribute:e._offsetAttribute})};var xm=Kh;var kDt=T(S(),1);function BS(e,t,n,i){e=y(e,1),t=y(t,1),n=y(n,1),i=y(i,1),this.value=new Uint8Array([Y.floatToByte(e),Y.floatToByte(t),Y.floatToByte(n),Y.floatToByte(i)])}Object.defineProperties(BS.prototype,{componentDatatype:{get:function(){return Q.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});BS.fromColor=function(e){return new BS(e.red,e.green,e.blue,e.alpha)};BS.toValue=function(e,t){return l(t)?e.toBytes(t):new Uint8Array(e.toBytes())};BS.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 Ht=BS;var ODt=T(S(),1);function zG(e,t){e=y(e,0),t=y(t,Number.MAX_VALUE),this.value=new Float32Array([e,t])}Object.defineProperties(zG.prototype,{componentDatatype:{get:function(){return Q.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});zG.fromDistanceDisplayCondition=function(e){return new zG(e.near,e.far)};zG.toValue=function(e,t){return l(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var Nn=zG;var JDt=T(S(),1);function hEe(e){e=y(e,y.EMPTY_OBJECT),this.geometry=e.geometry,this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=y(e.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var Vt=hEe;var r3t=T(S(),1);var t3t=T(S(),1);function zo(e){e=y(e,y.EMPTY_OBJECT),this.start=l(e.start)?q.clone(e.start):new q,this.stop=l(e.stop)?q.clone(e.stop):new q,this.data=e.data,this.isStartIncluded=y(e.isStartIncluded,!0),this.isStopIncluded=y(e.isStopIncluded,!0)}Object.defineProperties(zo.prototype,{isEmpty:{get:function(){let e=q.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var YS={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};zo.fromIso8601=function(e,t){let n=e.iso8601.split("/");if(n.length!==2)throw new pe("options.iso8601 is an invalid ISO 8601 interval.");let i=q.fromIso8601(n[0]),o=q.fromIso8601(n[1]),r=y(e.isStartIncluded,!0),s=y(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):(YS.start=i,YS.stop=o,YS.isStartIncluded=r,YS.isStopIncluded=s,YS.data=a,new zo(YS))};zo.toIso8601=function(e,t){return`${q.toIso8601(e.start,t)}/${q.toIso8601(e.stop,t)}`};zo.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 zo(e)};zo.equals=function(e,t,n){return e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&q.equals(e.start,t.start)&&q.equals(e.stop,t.stop)&&(e.data===t.data||l(n)&&n(e.data,t.data)))};zo.equalsEpsilon=function(e,t,n,i){return n=y(n,0),e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&q.equalsEpsilon(e.start,t.start,n)&&q.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||l(i)&&i(e.data,t.data)))};zo.intersect=function(e,t,n,i){if(!l(t))return zo.clone(zo.EMPTY,n);let o=e.start,r=e.stop,s=t.start,a=t.stop,c=q.greaterThanOrEquals(s,o)&&q.greaterThanOrEquals(r,s),d=!c&&q.lessThanOrEquals(s,o)&&q.lessThanOrEquals(o,a);if(!c&&!d)return zo.clone(zo.EMPTY,n);let u=e.isStartIncluded,m=e.isStopIncluded,p=t.isStartIncluded,g=t.isStopIncluded,f=q.lessThan(r,a);return l(n)||(n=new zo),n.start=c?s:o,n.isStartIncluded=u&&p||!q.equals(s,o)&&(c&&p||d&&u),n.stop=f?r:a,n.isStopIncluded=f?m:m&&g||!q.equals(a,r)&&g,n.data=l(i)?i(e.data,t.data):e.data,n};zo.contains=function(e,t){if(e.isEmpty)return!1;let n=q.compare(e.start,t);if(n===0)return e.isStartIncluded;let i=q.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0};zo.prototype.clone=function(e){return zo.clone(this,e)};zo.prototype.equals=function(e,t){return zo.equals(this,e,t)};zo.prototype.equalsEpsilon=function(e,t,n){return zo.equalsEpsilon(this,e,t,n)};zo.prototype.toString=function(){return zo.toIso8601(this)};zo.EMPTY=Object.freeze(new zo({start:new q,stop:new q,isStartIncluded:!1,isStopIncluded:!1}));var Vn=zo;var lte=Object.freeze(q.fromIso8601("0000-01-01T00:00:00Z")),dte=Object.freeze(q.fromIso8601("9999-12-31T24:00:00Z")),fEe=Object.freeze(new Vn({start:lte,stop:dte})),pEe={MINIMUM_VALUE:lte,MAXIMUM_VALUE:dte,MAXIMUM_INTERVAL:fEe},De=pEe;var d3t=T(S(),1);function KG(e,t,n){e=y(e,0),t=y(t,0),n=y(n,0),this.value=new Float32Array([e,t,n])}Object.defineProperties(KG.prototype,{componentDatatype:{get:function(){return Q.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});KG.fromCartesian3=function(e){return new KG(e.x,e.y,e.z)};KG.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 zi=KG;var p3t=T(S(),1);function gN(e){e=y(e,!0),this.value=gN.toValue(e)}Object.defineProperties(gN.prototype,{componentDatatype:{get:function(){return Q.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});gN.toValue=function(e,t){return l(t)?(t[0]=e,t):new Uint8Array([e])};var xn=gN;var XYt=T(S(),1);var g3t=T(S(),1),JG=`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 x3t=T(S(),1),QG=`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 T3t=T(S(),1),jG=`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 C3t=T(S(),1),qG=`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 L3t=T(S(),1),$G=`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 Z3t=T(S(),1),eE=`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 K3t=T(S(),1);var A3t=T(S(),1);var X3t=T(S(),1);var bEe={ADD:ie.FUNC_ADD,SUBTRACT:ie.FUNC_SUBTRACT,REVERSE_SUBTRACT:ie.FUNC_REVERSE_SUBTRACT,MIN:ie.MIN,MAX:ie.MAX},La=Object.freeze(bEe);var P3t=T(S(),1);var gEe={ZERO:ie.ZERO,ONE:ie.ONE,SOURCE_COLOR:ie.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:ie.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:ie.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:ie.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:ie.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:ie.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:ie.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:ie.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:ie.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:ie.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:ie.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:ie.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:ie.SRC_ALPHA_SATURATE},Co=Object.freeze(gEe);var yEe={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:La.ADD,equationAlpha:La.ADD,functionSourceRgb:Co.SOURCE_ALPHA,functionSourceAlpha:Co.ONE,functionDestinationRgb:Co.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Co.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:La.ADD,equationAlpha:La.ADD,functionSourceRgb:Co.ONE,functionSourceAlpha:Co.ONE,functionDestinationRgb:Co.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Co.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:La.ADD,equationAlpha:La.ADD,functionSourceRgb:Co.SOURCE_ALPHA,functionSourceAlpha:Co.ONE,functionDestinationRgb:Co.ONE,functionDestinationAlpha:Co.ONE})},un=Object.freeze(yEe);var k3t=T(S(),1);var xEe={FRONT:ie.FRONT,BACK:ie.BACK,FRONT_AND_BACK:ie.FRONT_AND_BACK},yi=Object.freeze(xEe);function OS(e){e=y(e,y.EMPTY_OBJECT),this.material=e.material,this.translucent=y(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=y(e.closed,!1)}Object.defineProperties(OS.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}}});OS.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(`
`)};OS.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent};OS.prototype.getRenderState=function(){let e=this.isTranslucent(),t=Ye(this.renderState,!1);return e?(t.depthMask=!1,t.blending=un.ALPHA_BLEND):t.depthMask=!0,t};OS.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=un.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:yi.BACK}),l(n)&&(i=_t(n,i,!0)),i};var ji=OS;var gYt=T(S(),1);var Q3t=T(S(),1),tE=`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 q3t=T(S(),1),nE=`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 eBt=T(S(),1),iE=`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 nBt=T(S(),1),oE=`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 oBt=T(S(),1),rE=`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 sBt=T(S(),1),sE=`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 cBt=T(S(),1),aE=`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 dBt=T(S(),1),cE=`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 mBt=T(S(),1),lE=`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 fBt=T(S(),1),dE=`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 bBt=T(S(),1),uE=`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 yBt=T(S(),1),mE=`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 _Bt=T(S(),1),hE=`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 SBt=T(S(),1),fE=`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 VBt=T(S(),1),pE=`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 RBt=T(S(),1),bE=`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 GBt=T(S(),1),gE=`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 XBt=T(S(),1),yE=`uniform vec4 waterColor;
uniform vec4 landColor;

czm_material czm_getMaterial(czm_materialInput materialInput)
{
    czm_material material = czm_getDefaultMaterial(materialInput);

    vec4 outColor = mix(landColor, waterColor, materialInput.waterMask);
    outColor = czm_gammaCorrect(outColor);

    material.diffuse = outColor.rgb;
    material.alpha = outColor.a;

    return material;
}
`;var WBt=T(S(),1),xE=`// 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 ze(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=y(e.minificationFilter,qt.LINEAR),this._magnificationFilter=y(e.magnificationFilter,ui.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,_Ee(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1}}),l(ze._uniformList[this.type])||(ze._uniformList[this.type]=Object.keys(this._uniforms))}ze._uniformList={};ze.fromType=function(e,t){let n=new ze({fabric:{type:e}});if(l(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};ze.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};ze.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 $t({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter}),p;l(d.internalFormat)?p=new Ft({context:e,pixelFormat:d.internalFormat,width:d.width,height:d.height,source:{arrayBufferView:d.bufferView,mipLevels:u},sampler:m}):p=new Ft({context:e,source:d,sampler:m});let g=this._textures[n];l(g)&&g!==this._defaultTexture&&g.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 Sa({context:e,source:{positiveX:d[0],negativeX:d[1],positiveY:d[2],negativeY:d[3],positiveZ:d[4],negativeZ:d[5]},sampler:new $t({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)};ze.prototype.isDestroyed=function(){return!1};ze.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 me(this)};function _Ee(e,t){e=y(e,y.EMPTY_OBJECT),t._strict=y(e.strict,!1),t._count=y(e.count,0),t._template=Ye(y(e.fabric,y.EMPTY_OBJECT)),t._template.uniforms=Ye(y(t._template.uniforms,y.EMPTY_OBJECT)),t._template.materials=Ye(y(t._template.materials,y.EMPTY_OBJECT)),t.type=l(t._template.type)?t._template.type:Bn(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n,i=ze._materialCache.getMaterial(t.type);if(l(i)){let r=Ye(i.fabric,!0);t._template=_t(t._template,r,!0),n=i.translucent}VEe(t),l(i)||ze._materialCache.addMaterial(t.type,t),REe(t),XEe(t),WEe(t);let o=t._translucentFunctions.length===0?!0:void 0;if(n=y(n,o),n=y(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 jY(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 ute(e,t){}function TEe(e,t){}var SEe=["type","materials","uniforms","components","source"],CEe=["diffuse","specular","shininess","normal","emission","alpha"];function VEe(e){let t=e._template,n=t.uniforms,i=t.materials,o=t.components;jY(t,SEe,ute,!0),jY(o,CEe,ute,!0);let r=[];for(let s in i)i.hasOwnProperty(s)&&r.push(s);jY(n,r,TEe,!1)}function LEe(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 REe(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&&LEe(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 mte={mat2:Qi,mat3:$,mat4:F},ZEe=/\.ktx2$/i;function GEe(e){let t;return function(n,i){let o=n.uniforms,r=o[e],s=t!==r,a=!l(r)||r===ze.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 $t({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new Ft({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 Ft&&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 Ee;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:Ee.createIfNeeded(r),g;ZEe.test(p.url)?g=bl(p.url):g=p.fetchImage(),Promise.resolve(g).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 EEe(e){return function(t,n){let i=t.uniforms[e];if(i instanceof Sa){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===ze.DefaultCubeMapId)return;let o=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(o!==t._texturePaths[e]){let r=[Ee.createIfNeeded(i.positiveX).fetchImage(),Ee.createIfNeeded(i.negativeX).fetchImage(),Ee.createIfNeeded(i.positiveY).fetchImage(),Ee.createIfNeeded(i.negativeY).fetchImage(),Ee.createIfNeeded(i.positiveZ).fetchImage(),Ee.createIfNeeded(i.negativeZ).fetchImage()];Promise.all(r).then(function(s){t._loadedCubeMaps.push({id:e,images:s})}),t._texturePaths[e]=o}}}function XEe(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&hte(e,n)}function hte(e,t){let n=e._strict,i=e._template.uniforms,o=i[t],r=IEe(o),s;if(r==="channels")s=_E(e,t,o,!1);else{if(r==="sampler2D"){let d=`${t}Dimensions`;PEe(e,d)>0&&(i[d]={type:"ivec3",x:1,y:1},hte(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=_E(e,t,c),e.uniforms[t]=o,r==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(GEe(t));else if(r==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(EEe(t));else if(r.indexOf("mat")!==-1){let d=new mte[r];e._uniforms[c]=function(){return mte[r].fromColumnMajorArray(e.uniforms[t],d)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function IEe(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 Ee||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)/^([rgba]){1,4}$/i.test(e)?t="channels":e===ze.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 WEe(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=new ze({strict:t,fabric:n[i],count:e._count});e._count=o._count,e._uniforms=_t(e._uniforms,o._uniforms,!0),e.materials[i]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);let r="czm_getMaterial",s=`${r}_${e._count++}`;_E(o,r,s),e.shaderSource=o.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=_E(e,i,a)}}function _E(e,t,n,i){i=y(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 PEe(e,t,n){return _E(e,t,t,n)}ze._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};ze.DefaultImageId="czm_defaultImage";ze.DefaultCubeMapId="czm_defaultCubeMap";ze.ColorType="Color";ze._materialCache.addMaterial(ze.ColorType,{fabric:{type:ze.ColorType,uniforms:{color:new Y(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});ze.ImageType="Image";ze._materialCache.addMaterial(ze.ImageType,{fabric:{type:ze.ImageType,uniforms:{image:ze.DefaultImageId,repeat:new D(1,1),color:new Y(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}});ze.DiffuseMapType="DiffuseMap";ze._materialCache.addMaterial(ze.DiffuseMapType,{fabric:{type:ze.DiffuseMapType,uniforms:{image:ze.DefaultImageId,channels:"rgb",repeat:new D(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});ze.AlphaMapType="AlphaMap";ze._materialCache.addMaterial(ze.AlphaMapType,{fabric:{type:ze.AlphaMapType,uniforms:{image:ze.DefaultImageId,channel:"a",repeat:new D(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});ze.SpecularMapType="SpecularMap";ze._materialCache.addMaterial(ze.SpecularMapType,{fabric:{type:ze.SpecularMapType,uniforms:{image:ze.DefaultImageId,channel:"r",repeat:new D(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});ze.EmissionMapType="EmissionMap";ze._materialCache.addMaterial(ze.EmissionMapType,{fabric:{type:ze.EmissionMapType,uniforms:{image:ze.DefaultImageId,channels:"rgb",repeat:new D(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});ze.BumpMapType="BumpMap";ze._materialCache.addMaterial(ze.BumpMapType,{fabric:{type:ze.BumpMapType,uniforms:{image:ze.DefaultImageId,channel:"r",strength:.8,repeat:new D(1,1)},source:nE},translucent:!1});ze.NormalMapType="NormalMap";ze._materialCache.addMaterial(ze.NormalMapType,{fabric:{type:ze.NormalMapType,uniforms:{image:ze.DefaultImageId,channels:"rgb",strength:.8,repeat:new D(1,1)},source:dE},translucent:!1});ze.GridType="Grid";ze._materialCache.addMaterial(ze.GridType,{fabric:{type:ze.GridType,uniforms:{color:new Y(0,1,0,1),cellAlpha:.1,lineCount:new D(8,8),lineThickness:new D(1,1),lineOffset:new D(0,0)},source:lE},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});ze.StripeType="Stripe";ze._materialCache.addMaterial(ze.StripeType,{fabric:{type:ze.StripeType,uniforms:{horizontal:!0,evenColor:new Y(1,1,1,.5),oddColor:new Y(0,0,1,.5),offset:0,repeat:5},source:gE},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});ze.CheckerboardType="Checkerboard";ze._materialCache.addMaterial(ze.CheckerboardType,{fabric:{type:ze.CheckerboardType,uniforms:{lightColor:new Y(1,1,1,.5),darkColor:new Y(0,0,0,.5),repeat:new D(5,5)},source:iE},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});ze.DotType="Dot";ze._materialCache.addMaterial(ze.DotType,{fabric:{type:ze.DotType,uniforms:{lightColor:new Y(1,1,0,.75),darkColor:new Y(0,1,1,.75),repeat:new D(5,5)},source:oE},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});ze.WaterType="Water";ze._materialCache.addMaterial(ze.WaterType,{fabric:{type:ze.WaterType,uniforms:{baseWaterColor:new Y(.2,.3,.6,1),blendColor:new Y(0,1,.699,1),specularMap:ze.DefaultImageId,normalMap:ze.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:xE},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});ze.RimLightingType="RimLighting";ze._materialCache.addMaterial(ze.RimLightingType,{fabric:{type:ze.RimLightingType,uniforms:{color:new Y(1,0,0,.7),rimColor:new Y(1,1,1,.4),width:.3},source:pE},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});ze.FadeType="Fade";ze._materialCache.addMaterial(ze.FadeType,{fabric:{type:ze.FadeType,uniforms:{fadeInColor:new Y(1,0,0,1),fadeOutColor:new Y(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new D(.5,.5)},source:cE},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});ze.PolylineArrowType="PolylineArrow";ze._materialCache.addMaterial(ze.PolylineArrowType,{fabric:{type:ze.PolylineArrowType,uniforms:{color:new Y(1,1,1,1)},source:uE},translucent:!0});ze.PolylineDashType="PolylineDash";ze._materialCache.addMaterial(ze.PolylineDashType,{fabric:{type:ze.PolylineDashType,uniforms:{color:new Y(1,0,1,1),gapColor:new Y(0,0,0,0),dashLength:16,dashPattern:255},source:mE},translucent:!0});ze.PolylineGlowType="PolylineGlow";ze._materialCache.addMaterial(ze.PolylineGlowType,{fabric:{type:ze.PolylineGlowType,uniforms:{color:new Y(0,.5,1,1),glowPower:.25,taperPower:1},source:hE},translucent:!0});ze.PolylineOutlineType="PolylineOutline";ze._materialCache.addMaterial(ze.PolylineOutlineType,{fabric:{type:ze.PolylineOutlineType,uniforms:{color:new Y(1,1,1,1),outlineColor:new Y(1,0,0,1),outlineWidth:1},source:fE},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});ze.ElevationContourType="ElevationContour";ze._materialCache.addMaterial(ze.ElevationContourType,{fabric:{type:ze.ElevationContourType,uniforms:{spacing:100,color:new Y(1,0,0,1),width:1},source:sE},translucent:!1});ze.ElevationRampType="ElevationRamp";ze._materialCache.addMaterial(ze.ElevationRampType,{fabric:{type:ze.ElevationRampType,uniforms:{image:ze.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:aE},translucent:!1});ze.SlopeRampMaterialType="SlopeRamp";ze._materialCache.addMaterial(ze.SlopeRampMaterialType,{fabric:{type:ze.SlopeRampMaterialType,uniforms:{image:ze.DefaultImageId},source:bE},translucent:!1});ze.AspectRampMaterialType="AspectRamp";ze._materialCache.addMaterial(ze.AspectRampMaterialType,{fabric:{type:ze.AspectRampMaterialType,uniforms:{image:ze.DefaultImageId},source:tE},translucent:!1});ze.ElevationBandType="ElevationBand";ze._materialCache.addMaterial(ze.ElevationBandType,{fabric:{type:ze.ElevationBandType,uniforms:{heights:ze.DefaultImageId,colors:ze.DefaultImageId},source:rE},translucent:!0});ze.WaterMaskType="WaterMask";ze._materialCache.addMaterial(ze.WaterMaskType,{fabric:{type:ze.WaterMaskType,source:yE,uniforms:{waterColor:new Y(1,1,1,1),landColor:new Y(0,0,0,0)}},translucent:!1});var Ui=ze;function ax(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.closed,!1),i=y(e.materialSupport,ax.MaterialSupport.TEXTURED);this.material=l(e.material)?e.material:Ui.fromType(Ui.ColorType),this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,i.vertexShaderSource),this._fragmentShaderSource=y(e.fragmentShaderSource,i.fragmentShaderSource),this._renderState=ji.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._materialSupport=i,this._vertexFormat=i.vertexFormat,this._flat=y(e.flat,!1),this._faceForward=y(e.faceForward,!n)}Object.defineProperties(ax.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}}});ax.prototype.getFragmentShaderSource=ji.prototype.getFragmentShaderSource;ax.prototype.isTranslucent=ji.prototype.isTranslucent;ax.prototype.getRenderState=ji.prototype.getRenderState;ax.MaterialSupport={BASIC:Object.freeze({vertexFormat:Pe.POSITION_AND_NORMAL,vertexShaderSource:qG,fragmentShaderSource:jG}),TEXTURED:Object.freeze({vertexFormat:Pe.POSITION_NORMAL_AND_ST,vertexShaderSource:eE,fragmentShaderSource:$G}),ALL:Object.freeze({vertexFormat:Pe.ALL,vertexShaderSource:QG,fragmentShaderSource:JG})};var oo=ax;var zYt=T(S(),1);var WYt=T(S(),1),TE=`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 vYt=T(S(),1),SE=`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 FYt=T(S(),1),cx=`in vec4 v_color;

void main()
{
    out_FragColor = czm_gammaCorrect(v_color);
}
`;var MYt=T(S(),1),CE=`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 xp(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.closed,!1),i=y(e.flat,!1),o=i?CE:SE,r=i?cx:TE,s=i?xp.FLAT_VERTEX_FORMAT:xp.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,o),this._fragmentShaderSource=y(e.fragmentShaderSource,r),this._renderState=ji.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=y(e.faceForward,!n)}Object.defineProperties(xp.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}}});xp.VERTEX_FORMAT=Pe.POSITION_AND_NORMAL;xp.FLAT_VERTEX_FORMAT=Pe.POSITION_ONLY;xp.prototype.getFragmentShaderSource=ji.prototype.getFragmentShaderSource;xp.prototype.isTranslucent=ji.prototype.isTranslucent;xp.prototype.getRenderState=ji.prototype.getRenderState;var dn=xp;var tOt=T(S(),1);function HS(e){this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(HS.prototype,{isConstant:{get:function(){return K.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:de("color")});HS.prototype.getType=function(e){return"Color"};var vEe=new q;HS.prototype.getValue=function(e,t){return l(e)||(e=q.now(vEe)),l(t)||(t={}),t.color=K.getValueOrClonedDefault(this._color,e,Y.WHITE,t.color),t};HS.prototype.equals=function(e){return this===e||e instanceof HS&&K.equals(this._color,e._color)};var Yt=HS;var m4t=T(S(),1);var OQt=T(S(),1);var COt=T(S(),1);var dOt=T(S(),1);function Wb(e){e=y(e,y.EMPTY_OBJECT),this._ellipsoid=y(e.ellipsoid,ne.default),this._rectangle=y(e.rectangle,ae.MAX_VALUE),this._projection=new Li(this._ellipsoid),this._numberOfLevelZeroTilesX=y(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=y(e.numberOfLevelZeroTilesY,1)}Object.defineProperties(Wb.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});Wb.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};Wb.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};Wb.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 ae(n,i,o,r)};Wb.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};Wb.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 ae(c,p,d,m)),i.west=c,i.south=p,i.east=d,i.north=m,i};Wb.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!ae.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 D(d,u)};var Di=Wb;var fte=new h,pte=new h,bte=new he,qY=new h,wEe=new h,gte=new ce,FEe=new Di,VE=[new he,new he,new he,new he],LE=new D,Dr={};Dr.initialize=function(){let e=Dr._initPromise;return l(e)||(e=Ee.fetchJson(nn("Assets/approximateTerrainHeights.json")).then(function(t){Dr._terrainHeights=t}),Dr._initPromise=e),e};Dr.getMinimumMaximumHeights=function(e,t){t=y(t,ne.default);let n=yte(e),i=Dr._defaultMinTerrainHeight,o=Dr._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=Dr._terrainHeights[r];l(s)&&(i=s[0],o=s[1]),t.cartographicToCartesian(ae.northeast(e,bte),fte),t.cartographicToCartesian(ae.southwest(e,bte),pte),h.midpoint(pte,fte,qY);let a=t.scaleToGeodeticSurface(qY,wEe);if(l(a)){let c=h.distance(qY,a);i=Math.min(i,-c)}else i=Dr._defaultMinTerrainHeight}return i=Math.max(Dr._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:o}};Dr.getBoundingSphere=function(e,t){t=y(t,ne.default);let n=yte(e),i=Dr._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=Dr._terrainHeights[r];l(s)&&(i=s[1])}let o=ce.fromRectangle3D(e,t,0);return ce.fromRectangle3D(e,t,i,gte),ce.union(o,gte,o)};function yte(e){he.fromRadians(e.east,e.north,0,VE[0]),he.fromRadians(e.west,e.north,0,VE[1]),he.fromRadians(e.east,e.south,0,VE[2]),he.fromRadians(e.west,e.south,0,VE[3]);let t=0,n=0,i=0,o=0,r=Dr._terrainHeightsMaxLevel,s;for(s=0;s<=r;++s){let a=!1;for(let c=0;c<4;++c){let d=VE[c];if(FEe.positionToTileXY(d,s,LE),c===0)i=LE.x,o=LE.y;else if(i!==LE.x||o!==LE.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}}Dr._terrainHeightsMaxLevel=6;Dr._defaultMaxTerrainHeight=9e3;Dr._defaultMinTerrainHeight=-1e5;Dr._terrainHeights=void 0;Dr._initPromise=void 0;Object.defineProperties(Dr,{initialized:{get:function(){return l(Dr._terrainHeights)}}});var ai=Dr;var vHt=T(S(),1);var gHt=T(S(),1);var EOt=T(S(),1);function Pc(e,t,n){this.minimum=h.clone(y(e,h.ZERO)),this.maximum=h.clone(y(t,h.ZERO)),l(n)?n=h.clone(n):n=h.midpoint(this.minimum,this.maximum,new h),this.center=n}Pc.fromCorners=function(e,t,n){return l(n)||(n=new Pc),n.minimum=h.clone(e,n.minimum),n.maximum=h.clone(t,n.maximum),n.center=h.midpoint(e,t,n.center),n};Pc.fromPoints=function(e,t){if(l(t)||(t=new Pc),!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],g=p.x,f=p.y,x=p.z;n=Math.min(g,n),r=Math.max(g,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};Pc.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 Pc(e.minimum,e.maximum,e.center)};Pc.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 yN=new h;Pc.intersectPlane=function(e,t){yN=h.subtract(e.maximum,e.minimum,yN);let n=h.multiplyByScalar(yN,.5,yN),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?Kt.INSIDE:r+o<0?Kt.OUTSIDE:Kt.INTERSECTING};Pc.prototype.clone=function(e){return Pc.clone(this,e)};Pc.prototype.intersectPlane=function(e){return Pc.intersectPlane(this,e)};Pc.prototype.equals=function(e){return Pc.equals(this,e)};var Pb=Pc;var iHt=T(S(),1);var WOt=T(S(),1);var $Y={};$Y.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function xte(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}$Y.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=xte(o,-r,W.EPSILON14);if(s<0)return[];let a=-.5*xte(t,W.sign(t)*Math.sqrt(s),W.EPSILON14);return t>0?[a/e,n/a]:[n/a,a/e]};var vc=$Y;var kOt=T(S(),1);var wOt=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,g=o*a-r*s,f=r*a-m,x=4*p*f-g*g,_,C;if(x<0){let J,H,te;u*d>=c*m?(J=o,H=p,te=-2*r*p+o*g):(J=a,H=f,te=-a*g+2*s*f);let j=-(te<0?-1:1)*Math.abs(J)*Math.sqrt(-x);C=-te+j;let ee=C/2,fe=ee<0?-Math.pow(-ee,1/3):Math.pow(ee,1/3),_e=C===j?-fe:-H/fe;return _=H<=0?fe+_e:-te/(fe*fe+_e*_e+H),u*d>=c*m?[(_-r)/o]:[-a/(_+s)]}let V=p,L=-2*r*p+o*g,Z=f,E=-a*g+2*s*f,X=Math.sqrt(x),v=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*X,-L)/3);_=2*Math.sqrt(-V);let A=Math.cos(P);C=_*A;let M=_*(-A/2-v*Math.sin(P)),b=C+M>2*r?C-r:M-r,R=o,G=b/R;P=Math.abs(Math.atan2(a*X,-E)/3),_=2*Math.sqrt(-Z),A=Math.cos(P),C=_*A,M=_*(-A/2-v*Math.sin(P));let I=-a,w=C+M<2*s?C+s:M+s,N=I/w,B=R*w,U=-b*w-R*I,O=b*I,k=(s*U-r*O)/(-r*U+s*B);return G<=k?G<=N?k<=N?[G,k,N]:[G,N,k]:[N,G,k]:G<=N?[k,G,N]:k<=N?[k,N,G]:[N,k,G]}tO.computeRealRoots=function(e,t,n,i){let o,r;if(e===0)return vc.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=vc.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=vc.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 lx=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,g=o*o,f=g*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)+g*(144*e*a*n-27*a*a-128*r*d-192*r*t*i)};function _m(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=lx.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=vc.computeRealRoots(1,r,a);if(m.length===2){let p=m[0],g=m[1],f;if(p>=0&&g>=0){let x=Math.sqrt(p),_=Math.sqrt(g);return[d-_,d-x,d+x,d+_]}else{if(p>=0&&g<0)return f=Math.sqrt(p),[d-f,d+f];if(p<0&&g>=0)return f=Math.sqrt(g),[d-f,d+f]}}return[]}else if(u>0){let m=Math.sqrt(u),p=(r+u-s/m)/2,g=(r+u+s/m)/2,f=vc.computeRealRoots(1,m,p),x=vc.computeRealRoots(1,-m,g);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 RE(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=lx.computeRealRoots(1,a,c,d);if(u.length>0){let m=u[0],p=t-m,g=p*p,f=e/2,x=p/2,_=g-4*i,C=g+4*Math.abs(i),V=s-4*m,L=s+4*Math.abs(m),Z,E;if(m<0||_*L<V*C){let R=Math.sqrt(V);Z=R/2,E=R===0?0:(e*x-n)/R}else{let R=Math.sqrt(_);Z=R===0?0:(e*x-n)/R,E=R/2}let X,v;f===0&&Z===0?(X=0,v=0):W.sign(f)===W.sign(Z)?(X=f+Z,v=m/X):(v=f-Z,X=m/v);let P,A;x===0&&E===0?(P=0,A=0):W.sign(x)===W.sign(E)?(P=x+E,A=i/P):(A=x-E,P=i/A);let M=vc.computeRealRoots(1,X,P),b=vc.computeRealRoots(1,v,A);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 lx.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 _m(r,s,a,c);case 1:return RE(r,s,a,c);case 2:return RE(r,s,a,c);case 3:return _m(r,s,a,c);case 4:return _m(r,s,a,c);case 5:return RE(r,s,a,c);case 6:return _m(r,s,a,c);case 7:return _m(r,s,a,c);case 8:return RE(r,s,a,c);case 9:return _m(r,s,a,c);case 10:return _m(r,s,a,c);case 11:return RE(r,s,a,c);case 12:return _m(r,s,a,c);case 13:return _m(r,s,a,c);case 14:return _m(r,s,a,c);case 15:return _m(r,s,a,c);default:return}};var ZE=nO;var OOt=T(S(),1);function xN(e,t){t=h.clone(y(t,h.ZERO)),h.equals(t,h.ZERO)||h.normalize(t,t),this.origin=h.clone(y(e,h.ZERO)),this.direction=t}xN.clone=function(e,t){if(l(e))return l(t)?(t.origin=h.clone(e.origin),t.direction=h.clone(e.direction),t):new xN(e.origin,e.direction)};xN.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 pn=xN;var Fo={};Fo.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 AEe=new h,MEe=new h,Zte=new h,_te=new h,Tte=new h;Fo.rayTriangleParametric=function(e,t,n,i,o){o=y(o,!1);let r=e.origin,s=e.direction,a=h.subtract(n,t,AEe),c=h.subtract(i,t,MEe),d=h.cross(s,c,Zte),u=h.dot(a,d),m,p,g,f,x;if(o){if(u<W.EPSILON6||(m=h.subtract(r,t,_te),g=h.dot(m,d),g<0||g>u)||(p=h.cross(m,a,Tte),f=h.dot(s,p),f<0||g+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,_te),g=h.dot(m,d)*_,g<0||g>1||(p=h.cross(m,a,Tte),f=h.dot(s,p)*_,f<0||g+f>1))return;x=h.dot(c,p)*_}return x};Fo.rayTriangle=function(e,t,n,i,o,r){let s=Fo.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 NEe=new pn;Fo.lineSegmentTriangle=function(e,t,n,i,o,r,s){let a=NEe;h.clone(e,a.origin),h.subtract(t,e,a.direction),h.normalize(a.direction,a.direction);let c=Fo.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 kEe(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 UEe={root0:0,root1:0};function Gte(e,t,n){l(n)||(n=new Va);let i=e.origin,o=e.direction,r=t.center,s=t.radius*t.radius,a=h.subtract(i,r,Zte),c=h.dot(o,o),d=2*h.dot(o,a),u=h.magnitudeSquared(a)-s,m=kEe(c,d,u,UEe);if(l(m))return n.start=m.root0,n.stop=m.root1,n}Fo.raySphere=function(e,t,n){if(n=Gte(e,t,n),!(!l(n)||n.stop<0))return n.start=Math.max(n.start,0),n};var DEe=new pn;Fo.lineSegmentSphere=function(e,t,n,i){let o=DEe;h.clone(e,o.origin);let r=h.subtract(t,e,o.direction),s=h.magnitude(r);if(h.normalize(r,r),i=Gte(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 BEe=new h,YEe=new h;Fo.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=h.multiplyComponents(n,e.origin,BEe),o=h.multiplyComponents(n,e.direction,YEe),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 Va(f,x):{start:x,stop:f}}let g=Math.sqrt(a/c);return new Va(g,g)}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 Va(0,m/c);if(s<0)return c=h.magnitudeSquared(o),new Va(0,-s/c)};function dx(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}Fo.quadraticVectorExpression=function(e,t,n,i,o){let r=i*i,s=o*o,a=(e[$.COLUMN1ROW1]-e[$.COLUMN2ROW2])*s,c=o*(i*dx(e[$.COLUMN1ROW0],e[$.COLUMN0ROW1],W.EPSILON15)+t.y),d=e[$.COLUMN0ROW0]*r+e[$.COLUMN2ROW2]*s+i*t.x+n,u=s*dx(e[$.COLUMN2ROW1],e[$.COLUMN1ROW2],W.EPSILON15),m=o*(i*dx(e[$.COLUMN2ROW0],e[$.COLUMN0ROW2])+t.z),p,g=[];if(m===0&&u===0){if(p=vc.computeRealRoots(a,c,d),p.length===0)return g;let P=p[0],A=Math.sqrt(Math.max(1-P*P,0));if(g.push(new h(i,o*P,o*-A)),g.push(new h(i,o*P,o*A)),p.length===2){let M=p[1],b=Math.sqrt(Math.max(1-M*M,0));g.push(new h(i,o*M,o*-b)),g.push(new h(i,o*M,o*b))}return g}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,E=2*(d*c-C),X=d*d-f;if(V===0&&L===0&&Z===0&&E===0)return g;p=ZE.computeRealRoots(V,L,Z,E,X);let v=p.length;if(v===0)return g;for(let P=0;P<v;++P){let A=p[P],M=A*A,b=Math.max(1-M,0),R=Math.sqrt(b),G;W.sign(a)===W.sign(d)?G=dx(a*M+d,c*A,W.EPSILON12):W.sign(d)===W.sign(c*A)?G=dx(a*M,c*A+d,W.EPSILON12):G=dx(a*M+c*A,d,W.EPSILON12);let I=dx(u*A,m,W.EPSILON15),w=G*I;w<0?g.push(new h(i,o*A,o*R)):w>0?g.push(new h(i,o*A,o*-R)):R!==0?(g.push(new h(i,o*A,o*-R)),g.push(new h(i,o*A,o*R)),++P):g.push(new h(i,o*A,o*R))}return g};var iO=new h,Ste=new h,Cte=new h,_N=new h,OEe=new h,HEe=new $,zEe=new $,KEe=new $,JEe=new $,QEe=new $,Vte=new $,Lte=new $,Rte=new h,jEe=new h,qEe=new he;Fo.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!h.equals(n,h.ZERO)){let X=t.geodeticSurfaceNormal(n,iO);if(h.dot(i,X)>=0)return n}let o=l(this.rayEllipsoid(e,t)),r=t.transformPositionToScaledSpace(i,iO),s=h.normalize(r,r),a=h.mostOrthogonalAxis(r,_N),c=h.normalize(h.cross(a,s,Ste),Ste),d=h.normalize(h.cross(s,c,Cte),Cte),u=HEe;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=$.transpose(u,zEe),p=$.fromScale(t.radii,KEe),g=$.fromScale(t.oneOverRadii,JEe),f=QEe;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=$.multiply($.multiply(m,g,Vte),f,Vte),_=$.multiply($.multiply(x,p,Lte),u,Lte),C=$.multiplyByVector(x,n,OEe),V=Fo.quadraticVectorExpression(_,h.negate(C,iO),0,0,1),L,Z,E=V.length;if(E>0){let X=h.clone(h.ZERO,jEe),v=Number.NEGATIVE_INFINITY;for(let A=0;A<E;++A){L=$.multiplyByVector(p,$.multiplyByVector(u,V[A],Rte),Rte);let M=h.normalize(h.subtract(L,n,_N),_N),b=h.dot(M,i);b>v&&(v=b,X=h.clone(L,X))}let P=t.cartesianToCartographic(X,qEe);return v=W.clamp(v,0,1),Z=h.magnitude(h.subtract(X,n,_N))*Math.sqrt(1-v*v),Z=o?-Z:Z,P.height=Z,t.cartographicToCartesian(P,new h)}};var $Ee=new h;Fo.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new h);let o=h.subtract(t,e,$Ee),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};Fo.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 Fo.lineSegmentPlane(e,t,i,u),Fo.lineSegmentPlane(e,n,i,m),{positions:[e,t,n,u,m],indices:[0,3,4,1,2,4,1,4,3]};if(a)return Fo.lineSegmentPlane(t,n,i,u),Fo.lineSegmentPlane(t,e,i,m),{positions:[e,t,n,u,m],indices:[1,3,4,2,0,4,2,4,3]};if(c)return Fo.lineSegmentPlane(n,e,i,u),Fo.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 Fo.lineSegmentPlane(e,n,i,u),Fo.lineSegmentPlane(t,n,i,m),{positions:[e,t,n,u,m],indices:[0,1,4,0,4,3,2,3,4]}}else return Fo.lineSegmentPlane(n,t,i,u),Fo.lineSegmentPlane(e,t,i,m),{positions:[e,t,n,u,m],indices:[2,0,4,2,4,3,1,3,4]};else return Fo.lineSegmentPlane(t,e,i,u),Fo.lineSegmentPlane(n,e,i,m),{positions:[e,t,n,u,m],indices:[1,2,4,1,4,3,0,3,4]}};var qn=Fo;var oO=new se;function Jh(e,t){t=y(t,ne.default),e=t.scaleToGeodeticSurface(e);let n=wt.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=h.fromCartesian4(F.getColumn(n,0,oO)),this._yAxis=h.fromCartesian4(F.getColumn(n,1,oO));let i=h.fromCartesian4(F.getColumn(n,2,oO));this._plane=cn.fromPointNormal(e,i)}Object.defineProperties(Jh.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 eXe=new Pb;Jh.fromPoints=function(e,t){let n=Pb.fromPoints(e,eXe);return new Jh(n.center,t)};var Ete=new pn,TN=new h;Jh.prototype.projectPointOntoPlane=function(e,t){let n=Ete;n.origin=e,h.normalize(e,n.direction);let i=qn.rayPlane(n,this._plane,TN);if(l(i)||(h.negate(n.direction,n.direction),i=qn.rayPlane(n,this._plane,TN)),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 D(r,s)}};Jh.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};Jh.prototype.projectPointToNearestOnPlane=function(e,t){l(t)||(t=new D);let n=Ete;n.origin=e,h.clone(this._plane.normal,n.direction);let i=qn.rayPlane(n,this._plane,TN);l(i)||(h.negate(n.direction,n.direction),i=qn.rayPlane(n,this._plane,TN));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};Jh.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 tXe=new h;Jh.prototype.projectPointOntoEllipsoid=function(e,t){l(t)||(t=new h);let n=this._ellipsoid,i=this._origin,o=this._xAxis,r=this._yAxis,s=tXe;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};Jh.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 Br=Jh;function wi(e,t){this.center=h.clone(y(e,h.ZERO)),this.halfAxes=$.clone(y(t,$.ZERO))}wi.packedLength=h.packedLength+$.packedLength;wi.pack=function(e,t,n){return n=y(n,0),h.pack(e.center,t,n),$.pack(e.halfAxes,t,n+h.packedLength),t};wi.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new wi),h.unpack(e,t,n.center),$.unpack(e,t+h.packedLength,n.halfAxes),n};var nXe=new h,iXe=new h,oXe=new h,rXe=new h,sXe=new h,aXe=new h,cXe=new $,lXe={unitary:new $,diagonal:new $};wi.fromPoints=function(e,t){if(l(t)||(t=new wi),!l(e)||e.length===0)return t.halfAxes=$.ZERO,t.center=h.ZERO,t;let n,i=e.length,o=h.clone(e[0],nXe);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,iXe),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 g=cXe;g[0]=s,g[1]=a,g[2]=c,g[3]=a,g[4]=d,g[5]=u,g[6]=c,g[7]=u,g[8]=m;let f=$.computeEigenDecomposition(g,lXe),x=$.clone(f.unitary,t.halfAxes),_=$.getColumn(x,0,rXe),C=$.getColumn(x,1,sXe),V=$.getColumn(x,2,aXe),L=-Number.MAX_VALUE,Z=-Number.MAX_VALUE,E=-Number.MAX_VALUE,X=Number.MAX_VALUE,v=Number.MAX_VALUE,P=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),E=Math.max(h.dot(V,p),E),X=Math.min(h.dot(_,p),X),v=Math.min(h.dot(C,p),v),P=Math.min(h.dot(V,p),P);_=h.multiplyByScalar(_,.5*(X+L),_),C=h.multiplyByScalar(C,.5*(v+Z),C),V=h.multiplyByScalar(V,.5*(P+E),V);let A=h.add(_,C,t.center);h.add(A,V,A);let M=oXe;return M.x=L-X,M.y=Z-v,M.z=E-P,h.multiplyByScalar(M,.5,M),$.multiplyByScale(t.halfAxes,M,t.halfAxes),t};var wte=new h,dXe=new h;function Xte(e,t,n,i,o,r,s,a,c,d,u){l(u)||(u=new wi);let m=u.halfAxes;$.setColumn(m,0,t,m),$.setColumn(m,1,n,m),$.setColumn(m,2,i,m);let p=wte;p.x=(o+r)/2,p.y=(s+a)/2,p.z=(c+d)/2;let g=dXe;g.x=(r-o)/2,g.y=(a-s)/2,g.z=(d-c)/2;let f=u.center;return p=$.multiplyByVector(m,p,p),h.add(e,p,f),$.multiplyByScale(m,g,m),u}var Ite=new he,uXe=new h,mXe=new he,hXe=new he,fXe=new he,pXe=new he,bXe=new he,gXe=new h,Wte=new h,yXe=new h,Pte=new h,xXe=new h,_Xe=new D,TXe=new D,SXe=new D,CXe=new D,VXe=new D,LXe=new h,RXe=new h,ZXe=new h,GXe=new h,EXe=new D,XXe=new h,IXe=new h,WXe=new h,PXe=new cn(h.UNIT_X,0);wi.fromRectangle=function(e,t,n,i,o){t=y(t,0),n=y(n,0),i=y(i,ne.default);let r,s,a,c,d,u,m;if(e.width<=W.PI){let v=ae.center(e,Ite),P=i.cartographicToCartesian(v,uXe),A=new Br(P,i);m=A.plane;let M=v.longitude,b=e.south<0&&e.north>0?0:v.latitude,R=he.fromRadians(M,e.north,n,mXe),G=he.fromRadians(e.west,e.north,n,hXe),I=he.fromRadians(e.west,b,n,fXe),w=he.fromRadians(e.west,e.south,n,pXe),N=he.fromRadians(M,e.south,n,bXe),B=i.cartographicToCartesian(R,gXe),U=i.cartographicToCartesian(G,Wte),O=i.cartographicToCartesian(I,yXe),k=i.cartographicToCartesian(w,Pte),J=i.cartographicToCartesian(N,xXe),H=A.projectPointToNearestOnPlane(B,_Xe),te=A.projectPointToNearestOnPlane(U,TXe),z=A.projectPointToNearestOnPlane(O,SXe),j=A.projectPointToNearestOnPlane(k,CXe),ee=A.projectPointToNearestOnPlane(J,VXe);return r=Math.min(te.x,z.x,j.x),s=-r,c=Math.max(te.y,H.y),a=Math.min(j.y,ee.y),G.height=w.height=t,U=i.cartographicToCartesian(G,Wte),k=i.cartographicToCartesian(w,Pte),d=Math.min(cn.getPointDistance(m,U),cn.getPointDistance(m,k)),u=n,Xte(A.origin,A.xAxis,A.yAxis,A.zAxis,r,s,a,c,d,u,o)}let p=e.south>0,g=e.north<0,f=p?e.south:g?e.north:0,x=ae.center(e,Ite).longitude,_=h.fromRadians(x,f,n,i,LXe);_.z=0;let V=Math.abs(_.x)<W.EPSILON10&&Math.abs(_.y)<W.EPSILON10?h.UNIT_X:h.normalize(_,RXe),L=h.UNIT_Z,Z=h.cross(V,L,ZXe);m=cn.fromPointNormal(_,V,PXe);let E=h.fromRadians(x+W.PI_OVER_TWO,f,n,i,GXe);s=h.dot(cn.projectPointOntoPlane(m,E,EXe),Z),r=-s,c=h.fromRadians(0,e.north,g?t:n,i,XXe).z,a=h.fromRadians(0,e.south,p?t:n,i,IXe).z;let X=h.fromRadians(e.east,f,n,i,WXe);return d=cn.getPointDistance(m,X),u=0,Xte(_,Z,L,V,r,s,a,c,d,u,o)};wi.fromTransformation=function(e,t){return l(t)||(t=new wi),t.center=F.getTranslation(e,t.center),t.halfAxes=F.getMatrix3(e,t.halfAxes),t.halfAxes=$.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t};wi.clone=function(e,t){if(l(e))return l(t)?(h.clone(e.center,t.center),$.clone(e.halfAxes,t.halfAxes),t):new wi(e.center,e.halfAxes)};wi.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[$.COLUMN0ROW0]+s*o[$.COLUMN0ROW1]+a*o[$.COLUMN0ROW2])+Math.abs(r*o[$.COLUMN1ROW0]+s*o[$.COLUMN1ROW1]+a*o[$.COLUMN1ROW2])+Math.abs(r*o[$.COLUMN2ROW0]+s*o[$.COLUMN2ROW1]+a*o[$.COLUMN2ROW2]),d=h.dot(i,n)+t.distance;return d<=-c?Kt.OUTSIDE:d>=c?Kt.INSIDE:Kt.INTERSECTING};var Fte=new h,Ate=new h,Mte=new h,vXe=new h,vte=new h,wXe=new h;wi.distanceSquaredTo=function(e,t){let n=h.subtract(t,e.center,wte),i=e.halfAxes,o=$.getColumn(i,0,Fte),r=$.getColumn(i,1,Ate),s=$.getColumn(i,2,Mte),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 g=!u+!m+!p,f,x,_;if(g===1){let Z=o;f=r,x=s,m?p||(Z=s,x=o):(Z=r,f=o),_=h.cross(f,x,vte),Z===o?o=_:Z===r?r=_:Z===s&&(s=_)}else if(g===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,vXe),h.normalize(x,x),_=h.cross(f,x,vte),h.normalize(_,_),f===o?(r=x,s=_):f===r?(s=x,o=_):f===s&&(o=x,r=_)}else g===3&&(o=h.UNIT_X,r=h.UNIT_Y,s=h.UNIT_Z);let C=wXe;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 FXe=new h,AXe=new h;wi.computePlaneDistances=function(e,t,n,i){l(i)||(i=new Va);let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,c=$.getColumn(a,0,Fte),d=$.getColumn(a,1,Ate),u=$.getColumn(a,2,Mte),m=h.add(c,d,FXe);h.add(m,u,m),h.add(m,s,m);let p=h.subtract(m,t,AXe),g=h.dot(n,p);return o=Math.min(g,o),r=Math.max(g,r),h.add(s,c,m),h.add(m,d,m),h.subtract(m,u,m),h.subtract(m,t,p),g=h.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),h.add(s,c,m),h.subtract(m,d,m),h.add(m,u,m),h.subtract(m,t,p),g=h.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),h.add(s,c,m),h.subtract(m,d,m),h.subtract(m,u,m),h.subtract(m,t,p),g=h.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),h.subtract(s,c,m),h.add(m,d,m),h.add(m,u,m),h.subtract(m,t,p),g=h.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),h.subtract(s,c,m),h.add(m,d,m),h.subtract(m,u,m),h.subtract(m,t,p),g=h.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),h.subtract(s,c,m),h.subtract(m,d,m),h.add(m,u,m),h.subtract(m,t,p),g=h.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),h.subtract(s,c,m),h.subtract(m,d,m),h.subtract(m,u,m),h.subtract(m,t,p),g=h.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),i.start=o,i.stop=r,i};var MXe=new h,NXe=new h,kXe=new h;wi.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=$.getColumn(i,0,MXe),r=$.getColumn(i,1,NXe),s=$.getColumn(i,2,kXe);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 UXe=new $;wi.computeTransformation=function(e,t){l(t)||(t=new F);let n=e.center,i=$.multiplyByUniformScale(e.halfAxes,2,UXe);return F.fromRotationTranslation(i,n,t)};var DXe=new ce;wi.isOccluded=function(e,t){let n=ce.fromOrientedBoundingBox(e,DXe);return!t.isBoundingSphereVisible(n)};wi.prototype.intersectPlane=function(e){return wi.intersectPlane(this,e)};wi.prototype.distanceSquaredTo=function(e){return wi.distanceSquaredTo(this,e)};wi.prototype.computePlaneDistances=function(e,t,n){return wi.computePlaneDistances(this,e,t,n)};wi.prototype.computeCorners=function(e){return wi.computeCorners(this,e)};wi.prototype.computeTransformation=function(e){return wi.computeTransformation(this,e)};wi.prototype.isOccluded=function(e){return wi.isOccluded(this,e)};wi.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&$.equals(e.halfAxes,t.halfAxes)};wi.prototype.clone=function(e){return wi.clone(this,e)};wi.prototype.equals=function(e){return wi.equals(this,e)};var Gn=wi;var NHt=T(S(),1);var SN={};SN.getHeight=function(e,t,n){return(e-n)*t+n};var BXe=new he;SN.getPosition=function(e,t,n,i,o){let r=t.cartesianToCartographic(e,BXe);if(!l(r))return h.clone(e,o);let s=SN.getHeight(r.height,n,i);return h.fromRadians(r.longitude,r.latitude,s,t,o)};var br=SN;var ZQt=T(S(),1);var UHt=T(S(),1),GE=`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 BHt=T(S(),1),vb=`#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 OHt=T(S(),1),Nte={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};Nte.NUMBER_OF_CLASSIFICATION_TYPES=3;var kn=Object.freeze(Nte);var KHt=T(S(),1);var YXe={NEVER:ie.NEVER,LESS:ie.LESS,EQUAL:ie.EQUAL,LESS_OR_EQUAL:ie.LEQUAL,GREATER:ie.GREATER,NOT_EQUAL:ie.NOTEQUAL,GREATER_OR_EQUAL:ie.GEQUAL,ALWAYS:ie.ALWAYS},tc=Object.freeze(YXe);var CJt=T(S(),1);var QHt=T(S(),1);function OXe(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 EE=OXe;var dzt=T(S(),1);function _p(e,t,n){if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;let i=HXe(t),o=e.floatingPointTexture,r=i===nt.FLOAT&&!o,s=zXe(t,r),a=KXe(s,t,r),c=Math.floor(Dt.maximumTextureSize/a),d=Math.min(n,c),u=a*d,m=Math.ceil(n/d),p=1/u,g=p*.5,f=1/m,x=f*.5;this._textureDimensions=new D(u,m),this._textureStep=new se(p,g,f,x),this._pixelDatatype=r?nt.UNSIGNED_BYTE:i,this._packFloats=r,this._offsets=s,this._stride=a,this._texture=void 0;let _=4*u*m;this._batchValues=i===nt.FLOAT&&!r?new Float32Array(_):new Uint8Array(_),this._batchValuesDirty=!1}Object.defineProperties(_p.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function HXe(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?nt.FLOAT:nt.UNSIGNED_BYTE}function Ute(e,t){let n=e[t].componentsPerAttribute;return n===2?D:n===3?h:n===4?se:Number}function zXe(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 KXe(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 XE=new se;function JXe(e,t,n){let i=se.unpack(e,t,XE),o=se.unpackFloat(i);i=se.unpack(e,t+4,XE);let r=se.unpackFloat(i);i=se.unpack(e,t+8,XE);let s=se.unpackFloat(i);i=se.unpack(e,t+12,XE);let a=se.unpackFloat(i);return se.fromElements(o,r,s,a,n)}function QXe(e,t,n){let i=se.packFloat(e.x,XE);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 kte=new se;_p.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!==nt.UNSIGNED_BYTE?a=JXe(this._batchValues,s,kte):a=se.unpack(this._batchValues,s,kte);let c=Ute(i,t);return l(c.fromCartesian4)?c.fromCartesian4(a,n):l(c.clone)?c.clone(a,n):a.x};var jXe=[void 0,void 0,new D,new h,new se],qXe=new se;_p.prototype.setBatchedAttribute=function(e,t,n){let i=this._attributes,o=jXe[i[t].componentsPerAttribute],r=this.getBatchedAttribute(e,t,o),s=Ute(this._attributes,t);if(l(s.equals)?s.equals(r,n):r===n)return;let c=qXe;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!==nt.UNSIGNED_BYTE?QXe(c,this._batchValues,m):se.pack(c,this._batchValues,m),this._batchValuesDirty=!0};function $Xe(e,t){let n=e._textureDimensions;e._texture=new Ft({context:t,pixelFormat:at.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:$t.NEAREST,flipY:!1})}function eIe(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}_p.prototype.update=function(e){l(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,l(this._texture)||$Xe(this,e.context),eIe(this))};_p.prototype.getUniformMapCallback=function(){let e=this;return function(t){return e._attributes.length===0?t:_t(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}};function tIe(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 nIe(e){return e===1?"float":`vec${e}`}function iIe(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function oIe(e,t){let i=e._attributes[t],o=i.componentsPerAttribute,r=i.functionName,s=nIe(o),a=iIe(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!==nt.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===nt.UNSIGNED_BYTE&&i.componentDatatype===Q.UNSIGNED_BYTE&&!i.normalize?d+=`value *= 255.0; 
`:e._pixelDatatype===nt.FLOAT&&i.componentDatatype===Q.UNSIGNED_BYTE&&i.normalize&&(d+=`value /= 255.0; 
`),d+=`    return value; 
} 
`,d}_p.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture; 
`;t+=`${tIe(this)}
`;let n=e.length;for(let i=0;i<n;++i)t+=oIe(this,i);return function(i){let o=i.indexOf("void main"),r=i.substring(0,o),s=i.substring(o);return`${r}
${t}
${s}`}};_p.prototype.isDestroyed=function(){return!1};_p.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),me(this)};var ux=_p;var WKt=T(S(),1);var cKt=T(S(),1);var Rzt=T(S(),1);var yzt=T(S(),1);var qi={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};qi.getMathType=function(e){switch(e){case qi.SCALAR:return Number;case qi.VEC2:return D;case qi.VEC3:return h;case qi.VEC4:return se;case qi.MAT2:return Qi;case qi.MAT3:return $;case qi.MAT4:return F}};qi.getNumberOfComponents=function(e){switch(e){case qi.SCALAR:return 1;case qi.VEC2:return 2;case qi.VEC3:return 3;case qi.VEC4:case qi.MAT2:return 4;case qi.MAT3:return 9;case qi.MAT4:return 16}};qi.getAttributeLocationCount=function(e){switch(e){case qi.SCALAR:case qi.VEC2:case qi.VEC3:case qi.VEC4:return 1;case qi.MAT2:return 2;case qi.MAT3:return 3;case qi.MAT4:return 4}};qi.getGlslType=function(e){switch(e){case qi.SCALAR:return"float";case qi.VEC2:return"vec2";case qi.VEC3:return"vec3";case qi.VEC4:return"vec4";case qi.MAT2:return"mat2";case qi.MAT3:return"mat3";case qi.MAT4:return"mat4"}};var on=Object.freeze(qi);var Dte=1/256,Bte=256,yo={};yo.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};yo.octEncode=function(e,t){return yo.octEncodeInRange(e,255,t)};var IE=new D,Yte=new Uint8Array(1);function CN(e){return Yte[0]=e,Yte[0]}yo.octEncodeToCartesian4=function(e,t){return yo.octEncodeInRange(e,65535,IE),t.x=CN(IE.x*Dte),t.y=CN(IE.x),t.z=CN(IE.y*Dte),t.w=CN(IE.y),t};yo.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)};yo.octDecode=function(e,t,n){return yo.octDecodeInRange(e,t,255,n)};yo.octDecodeFromCartesian4=function(e,t){let n=e.x,i=e.y,o=e.z,r=e.w,s=n*Bte+i,a=o*Bte+r;return yo.octDecodeInRange(s,a,65535,t)};yo.octPackFloat=function(e){return 256*e.x+e.y};var sO=new D;yo.octEncodeFloat=function(e){return yo.octEncode(e,sO),yo.octPackFloat(sO)};yo.octDecodeFloat=function(e,t){let n=e/256,i=Math.floor(n),o=(n-i)*256;return yo.octDecode(i,o,t)};yo.octPack=function(e,t,n,i){let o=yo.octEncodeFloat(e),r=yo.octEncodeFloat(t),s=yo.octEncode(n,sO);return i.x=65536*s.x+o,i.y=65536*s.y+r,i};yo.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;yo.octDecodeFloat(s,t),yo.octDecodeFloat(c,n),yo.octDecode(r,a,i)};yo.compressTextureCoordinates=function(e){let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};yo.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 rO(e){return e>>1^-(e&1)}yo.zigZagDeltaDecode=function(e,t,n){let i=e.length,o=0,r=0,s=0;for(let a=0;a<i;++a)o+=rO(e[a]),r+=rO(t[a]),e[a]=o,t[a]=r,l(n)&&(s+=rO(n[a]),n[a]=s)};yo.dequantize=function(e,t,n,i){let o=on.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};yo.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 wn=yo;var Wzt=T(S(),1);var Ote=new h,Hte=new h,zte=new h;function rIe(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,Ote),s=h.subtract(i,t,Hte),a=h.subtract(e,t,zte),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(D.equalsEpsilon(e,t,W.EPSILON14))return h.clone(h.UNIT_X,o);if(D.equalsEpsilon(e,n,W.EPSILON14))return h.clone(h.UNIT_Y,o);if(D.equalsEpsilon(e,i,W.EPSILON14))return h.clone(h.UNIT_Z,o);r=D.subtract(n,t,Ote),s=D.subtract(i,t,Hte),a=D.subtract(e,t,zte),c=D.dot(r,r),d=D.dot(r,s),u=D.dot(r,a),m=D.dot(s,s),p=D.dot(s,a)}o.y=m*u-d*p,o.z=c*p-d*u;let g=c*m-d*d;if(g!==0)return o.y/=g,o.z/=g,o.x=1-o.y-o.z,o}var mx=rIe;var Fzt=T(S(),1);var aO={};aO.calculateACMR=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=y(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)};aO.tipsify=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=y(e.cacheSize,24),o;function r(b,R,G,I){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<I;){if(b[o].numLiveTriangles>0)return++o,o-1;++o}return-1}function s(b,R,G,I,w,N,B){let U=-1,O,k=-1,J=0;for(;J<G.length;){let H=G[J];I[H].numLiveTriangles&&(O=0,w-I[H].timeStamp+2*I[H].numLiveTriangles<=R&&(O=w-I[H].timeStamp),(O>k||k===-1)&&(k=O,U=H)),++J}return U===-1?r(I,N,b,B):U}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=[],g;for(g=0;g<c;g++)p[g]={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,E=0,X=[],v=a/3,P=[];for(g=0;g<v;g++)P[g]=!1;let A,M;for(;x!==-1;){C=[],Z=p[x],M=Z.vertexTriangles.length;for(let b=0;b<M;++b)if(f=Z.vertexTriangles[b],!P[f]){P[f]=!0,d=f+f+f;for(let R=0;R<3;++R)A=t[d],C.push(A),V.push(A),X[E]=A,++E,L=p[A],--L.numLiveTriangles,_-L.timeStamp>i&&(L.timeStamp=_,++_),++d}x=s(t,i,C,p,_,V,c)}return X};var WE=aO;var wc={};function XN(e,t,n,i,o){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=o,e[t++]=o,e[t]=n}function sIe(e){let t=e.length,n=t/3*6,i=Ae.createTypedArray(t,n),o=0;for(let r=0;r<t;r+=3,o+=6)XN(i,o,e[r],e[r+1],e[r+2]);return i}function aIe(e){let t=e.length;if(t>=3){let n=(t-2)*6,i=Ae.createTypedArray(t,n);XN(i,0,e[0],e[1],e[2]);let o=6;for(let r=3;r<t;++r,o+=6)XN(i,o,e[r-1],e[r],e[r-2]);return i}return new Uint16Array}function cIe(e){if(e.length>0){let t=e.length-1,n=(t-1)*6,i=Ae.createTypedArray(t,n),o=e[0],r=0;for(let s=1;s<t;++s,r+=6)XN(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 Fe.TRIANGLES:e.indices=sIe(t);break;case Fe.TRIANGLE_STRIP:e.indices=aIe(t);break;case Fe.TRIANGLE_FAN:e.indices=cIe(t);break}e.primitiveType=Fe.LINES}return e};wc.createLineSegmentsForVectors=function(e,t,n){t=y(t,"normal"),n=y(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 ht({attributes:{position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:s})},primitiveType:Fe.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=ht.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=Ae.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 g=m[p],f=g.values,x=0,_=g.componentsPerAttribute,C=Q.createTypedArray(g.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}g.values=C}}return e};wc.reorderForPostVertexCache=function(e,t){let n=e.indices;if(e.primitiveType===Fe.TRIANGLES&&l(n)){let i=n.length,o=0;for(let r=0;r<i;r++)n[r]>o&&(o=n[r]);e.indices=WE.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function Kte(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 lIe(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=ht.computeNumberOfVertices(e);if(l(e.indices)&&n>=W.SIXTY_FOUR_KILOBYTES){let i=[],o=[],r=0,s=Kte(e.attributes),a=e.indices,c=a.length,d;e.primitiveType===Fe.TRIANGLES?d=3:e.primitiveType===Fe.LINES?d=2:e.primitiveType===Fe.POINTS&&(d=1);for(let u=0;u<c;u+=d){for(let m=0;m<d;++m){let p=a[u+m],g=i[p];l(g)||(g=r++,i[p]=g,lIe(s,e.attributes,p)),o.push(g)}r+d>=W.SIXTY_FOUR_KILOBYTES&&(t.push(new ht({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],o=[],r=0,s=Kte(e.attributes))}o.length!==0&&t.push(new ht({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var Jte=new h,dIe=new he;wc.projectTo2D=function(e,t,n,i,o){let r=e.attributes[t];o=l(o)?o:new Li;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,Jte),p=s.cartesianToCartographic(m,dIe),g=o.project(p,Jte);c[d++]=g.x,c[d++]=g.y,c[d++]=g.z}return e.attributes[n]=r,e.attributes[i]=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:c}),delete e.attributes[t],e};var cO={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)Yn.encode(r[u],cO),a[u]=cO.high,c[u]=cO.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 Sm=new h;function lO(e,t){if(l(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)h.unpack(n,o,Sm),F.multiplyByPoint(e,Sm,Sm),h.pack(Sm,n,o)}}function dO(e,t){if(l(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)h.unpack(n,o,Sm),$.multiplyByVector(e,Sm,Sm),Sm=h.normalize(Sm,Sm),h.pack(Sm,n,o)}}var VN=new F,LN=new $;wc.transformToWorldCoordinates=function(e){let t=e.modelMatrix;if(F.equals(t,F.IDENTITY))return e;let n=e.geometry.attributes;lO(t,n.position),lO(t,n.prevPosition),lO(t,n.nextPosition),(l(n.normal)||l(n.tangent)||l(n.bitangent))&&(F.inverse(t,VN),F.transpose(VN,VN),F.getMatrix3(VN,LN),dO(LN,n.normal),dO(LN,n.tangent),dO(LN,n.bitangent));let i=e.geometry.boundingSphere;return l(i)&&(e.geometry.boundingSphere=ce.transform(i,t,i)),e.modelMatrix=F.clone(F.IDENTITY),e};function uIe(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 mIe=new h;function uO(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=uIe(e,t),m,p,g;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,g=p.length,r=0;r<g;++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=ht.computeNumberOfVertices(new ht({attributes:u,primitiveType:Fe.POINTS})),Z=Ae.createTypedArray(L,V),E=0,X=0;for(o=0;o<n;++o){let v=e[o][t].indices,P=v.length;for(s=0;s<P;++s)Z[E++]=X+v[s];X+=ht.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,mIe))+C.radius;V>_&&(_=V)}return new ht({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(uO(t,"geometry")),n.length>0&&(o.push(uO(n,"westHemisphereGeometry")),o.push(uO(n,"eastHemisphereGeometry"))),o};var uu=new h,PE=new h,zS=new h,KS=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;PE.x=i[C],PE.y=i[C+1],PE.z=i[C+2],zS.x=i[V],zS.y=i[V+1],zS.z=i[V+2],KS.x=i[L],KS.y=i[L+1],KS.z=i[L+2],s[f].count++,s[x].count++,s[_].count++,h.subtract(zS,PE,zS),h.subtract(KS,PE,KS),a[u]=h.cross(zS,KS,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 g=new Float32Array(o*3);for(d=0;d<o;d++){let f=d*3;if(p=s[d],h.clone(h.ZERO,uu),p.count>0){for(u=0;u<p.count;u++)h.add(uu,a[c[p.indexOffset+u]],uu);h.equalsEpsilon(h.ZERO,uu,W.EPSILON10)&&h.clone(a[c[p.indexOffset]],uu)}h.equalsEpsilon(h.ZERO,uu,W.EPSILON10)&&(uu.z=1),h.normalize(uu,uu),g[f]=uu.x,g[f+1]=uu.y,g[f+2]=uu.z}return e.attributes.normal=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:g}),e};var hIe=new h,Qte=new h,fIe=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,E=i[u],X=i[u+1],v=i[u+2],P=r[V],A=r[V+1],M=r[L+1]-A,b=r[Z+1]-A,R=1/((r[L]-P)*b-(r[Z]-P)*M),G=(b*(i[m]-E)-M*(i[p]-E))*R,I=(b*(i[m+1]-X)-M*(i[p+1]-X))*R,w=(b*(i[m+2]-v)-M*(i[p+2]-v))*R;c[u]+=G,c[u+1]+=I,c[u+2]+=w,c[m]+=G,c[m+1]+=I,c[m+2]+=w,c[p]+=G,c[p+1]+=I,c[p+2]+=w}let g=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,hIe),_=h.fromArray(c,u,fIe),C=h.dot(x,_);h.multiplyByScalar(x,C,Qte),h.normalize(h.subtract(_,Qte,_),_),g[u]=_.x,g[m]=_.y,g[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:g}),e.attributes.bitangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:f}),e};var vE=new D,Tm=new h,jte=new h,qte=new h,RN=new D;wc.compressVertices=function(e){let t=e.attributes.extrudeDirection,n,i;if(l(t)){let X=t.values;i=X.length/3;let v=new Float32Array(i*2),P=0;for(n=0;n<i;++n){if(h.fromArray(X,n*3,Tm),h.equals(Tm,h.ZERO)){P+=2;continue}RN=wn.octEncodeInRange(Tm,65535,RN),v[P++]=RN.x,v[P++]=RN.y}return e.attributes.compressedAttributes=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:v}),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,g,f,x;s&&(p=o.values),a&&(g=r.values),u&&(f=c.values),m&&(x=d.values),i=(s?p.length:g.length)/(s?3:2);let V=i,L=a&&s?2:1;L+=u||m?1:0,V*=L;let Z=new Float32Array(V),E=0;for(n=0;n<i;++n){a&&(D.fromArray(g,n*2,vE),Z[E++]=wn.compressTextureCoordinates(vE));let X=n*3;s&&l(f)&&l(x)?(h.fromArray(p,X,Tm),h.fromArray(f,X,jte),h.fromArray(x,X,qte),wn.octPack(Tm,jte,qte,vE),Z[E++]=vE.x,Z[E++]=vE.y):(s&&(h.fromArray(p,X,Tm),Z[E++]=wn.octEncodeFloat(Tm)),u&&(h.fromArray(f,X,Tm),Z[E++]=wn.octEncodeFloat(Tm)),m&&(h.fromArray(x,X,Tm),Z[E++]=wn.octEncodeFloat(Tm)))}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 pIe(e){if(l(e.indices))return e;let t=ht.computeNumberOfVertices(e),n=Ae.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function bIe(e){let t=ht.computeNumberOfVertices(e),n=Ae.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=Fe.TRIANGLES,e}function gIe(e){let t=ht.computeNumberOfVertices(e),n=Ae.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=Fe.TRIANGLES,e}function yIe(e){if(l(e.indices))return e;let t=ht.computeNumberOfVertices(e),n=Ae.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function xIe(e){let t=ht.computeNumberOfVertices(e),n=Ae.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=Fe.LINES,e}function _Ie(e){let t=ht.computeNumberOfVertices(e),n=Ae.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=Fe.LINES,e}function TIe(e){switch(e.primitiveType){case Fe.TRIANGLE_FAN:return bIe(e);case Fe.TRIANGLE_STRIP:return gIe(e);case Fe.TRIANGLES:return pIe(e);case Fe.LINE_STRIP:return xIe(e);case Fe.LINE_LOOP:return _Ie(e);case Fe.LINES:return yIe(e)}return e}function wb(e,t){Math.abs(e.y)<W.EPSILON6&&(t?e.y=-W.EPSILON6:e.y=W.EPSILON6)}function SIe(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){wb(e,e.y<0),wb(t,t.y<0),wb(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;wb(e,a),wb(t,a),wb(n,a)}var $te=new h;function mu(e,t,n,i){h.add(e,h.multiplyByScalar(h.subtract(t,e,$te),e.y/(e.y-t.y),$te),n),h.clone(n,i),wb(n,!0),wb(i,!1)}var hx=new h,fx=new h,px=new h,bx=new h,mO={positions:new Array(7),indices:new Array(3*3)};function CIe(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;SIe(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=mO.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(mu(e,t,hx,px),mu(e,n,fx,bx),a[0]=0,a[3]=1,a[4]=2,a[6]=1):o?(mu(t,n,hx,px),mu(t,e,fx,bx),a[0]=1,a[3]=2,a[4]=0,a[6]=2):r&&(mu(n,e,hx,px),mu(n,t,fx,bx),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||(mu(n,e,hx,px),mu(n,t,fx,bx),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(mu(t,n,hx,px),mu(t,e,fx,bx),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(mu(e,t,hx,px),mu(e,n,fx,bx),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=mO.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(s===1||s===2)&&(c[3]=hx,c[4]=fx,c[5]=px,c[6]=bx,c.length=7),mO}function ene(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=ht.computeNumberOfVertices(e);return e.indices=Ae.createTypedArray(i,e.indices),t&&(e.boundingSphere=ce.fromVertices(n.position.values)),e}function QS(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 ht({attributes:n,indices:[],primitiveType:e.primitiveType})}function bO(e,t,n){let i=l(e.geometry.boundingSphere);t=ene(t,i),n=ene(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 gO(e,t){let n=new e,i=new e,o=new e;return function(r,s,a,c,d,u,m,p){let g=e.fromArray(d,r*t,n),f=e.fromArray(d,s*t,i),x=e.fromArray(d,a*t,o);e.multiplyByScalar(g,c.x,g),e.multiplyByScalar(f,c.y,f),e.multiplyByScalar(x,c.z,x);let _=e.add(g,f,g);e.add(_,x,_),p&&e.normalize(_,_),e.pack(_,u,m*t)}}var VIe=gO(se,4),EN=gO(h,3),sne=gO(D,2),LIe=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},wE=new h,hO=new h,fO=new h,RIe=new h;function ZN(e,t,n,i,o,r,s,a,c,d,u,m,p,g,f,x){if(!l(r)&&!l(s)&&!l(a)&&!l(c)&&!l(d)&&g===0)return;let _=h.fromArray(o,e*3,wE),C=h.fromArray(o,t*3,hO),V=h.fromArray(o,n*3,fO),L=mx(i,_,C,V,RIe);if(l(L)){if(l(r)&&EN(e,t,n,L,r,m.normal.values,x,!0),l(d)){let Z=h.fromArray(d,e*3,wE),E=h.fromArray(d,t*3,hO),X=h.fromArray(d,n*3,fO);h.multiplyByScalar(Z,L.x,Z),h.multiplyByScalar(E,L.y,E),h.multiplyByScalar(X,L.z,X);let v;!h.equals(Z,h.ZERO)||!h.equals(E,h.ZERO)||!h.equals(X,h.ZERO)?(v=h.add(Z,E,Z),h.add(v,X,v),h.normalize(v,v)):(v=wE,v.x=0,v.y=0,v.z=0),h.pack(v,m.extrudeDirection.values,x*3)}if(l(u)&&LIe(e,t,n,L,u,m.applyOffset.values,x),l(s)&&EN(e,t,n,L,s,m.tangent.values,x,!0),l(a)&&EN(e,t,n,L,a,m.bitangent.values,x,!0),l(c)&&sne(e,t,n,L,c,m.st.values,x),g>0)for(let Z=0;Z<g;Z++){let E=p[Z];ZIe(e,t,n,L,x,f[E],m[E])}}}function ZIe(e,t,n,i,o,r,s){let a=r.componentsPerAttribute,c=r.values,d=s.values;switch(a){case 4:VIe(e,t,n,i,c,d,o,!1);break;case 3:EN(e,t,n,i,c,d,o,!1);break;case 2:sne(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 GIe={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function tne(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 v in n)n.hasOwnProperty(v)&&!GIe[v]&&l(n[v])&&m.push(v);let p=m.length,g=QS(t),f=QS(t),x,_,C,V,L,Z=[];Z.length=i.length/3;let E=[];for(E.length=i.length/3,L=0;L<Z.length;++L)Z[L]=-1,E[L]=-1;let X=u.length;for(L=0;L<X;L+=3){let v=u[L],P=u[L+1],A=u[L+2],M=h.fromArray(i,v*3),b=h.fromArray(i,P*3),R=h.fromArray(i,A*3),G=CIe(M,b,R);if(l(G)&&G.positions.length>3){let I=G.positions,w=G.indices,N=w.length;for(let B=0;B<N;++B){let U=w[B],O=I[U];O.y<0?(x=f.attributes,_=f.indices,C=Z):(x=g.attributes,_=g.indices,C=E),V=Qh(x,_,C,u,U<3?L+U:-1,O),ZN(v,P,A,O,i,o,s,r,a,c,d,x,m,p,n,V)}}else l(G)&&(M=G.positions[0],b=G.positions[1],R=G.positions[2]),M.y<0?(x=f.attributes,_=f.indices,C=Z):(x=g.attributes,_=g.indices,C=E),V=Qh(x,_,C,u,L,M),ZN(v,P,A,M,i,o,s,r,a,c,d,x,m,p,n,V),V=Qh(x,_,C,u,L+1,b),ZN(v,P,A,b,i,o,s,r,a,c,d,x,m,p,n,V),V=Qh(x,_,C,u,L+2,R),ZN(v,P,A,R,i,o,s,r,a,c,d,x,m,p,n,V)}bO(e,f,g)}var ane=cn.fromPointNormal(h.ZERO,h.UNIT_Y),EIe=new h,XIe=new h;function JS(e,t,n,i,o,r,s){if(!l(s))return;let a=h.fromArray(i,e*3,wE);h.equalsEpsilon(a,n,W.EPSILON10)?r.applyOffset.values[o]=s[e]:r.applyOffset.values[o]=s[t]}function nne(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=QS(t),a=QS(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],g=r[c+1],f=h.fromArray(i,p*3,wE),x=h.fromArray(i,g*3,hO),_;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,E=a.indices,X=u,v=qn.lineSegmentPlane(f,x,ane,fO);if(l(v)){let P=h.multiplyByScalar(h.UNIT_Y,5*W.EPSILON9,EIe);f.y<0&&(h.negate(P,P),C=a.attributes,V=a.indices,L=u,Z=s.attributes,E=s.indices,X=m);let A=h.add(v,P,XIe);_=Qh(C,V,L,r,c,f),JS(p,g,f,i,_,C,o),_=Qh(C,V,L,r,-1,A),JS(p,g,A,i,_,C,o),h.negate(P,P),h.add(v,P,A),_=Qh(Z,E,X,r,-1,A),JS(p,g,A,i,_,Z,o),_=Qh(Z,E,X,r,c+1,x),JS(p,g,x,i,_,Z,o)}else{let P,A,M;f.y<0?(P=a.attributes,A=a.indices,M=u):(P=s.attributes,A=s.indices,M=m),_=Qh(P,A,M,r,c,f),JS(p,g,f,i,_,P,o),_=Qh(P,A,M,r,c+1,x),JS(p,g,x,i,_,P,o)}}bO(e,a,s)}var ine=new D,IIe=new D,cne=new h,lne=new h,pO=new h,WIe=new h,PIe=new h,vIe=new h,one=new se;function rne(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,cne);if(a.x>0)continue;let c=h.unpack(i,s,lne);(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,pO);(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 wIe=5*W.EPSILON9,GN=W.EPSILON6;function FIe(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=QS(t),u=QS(t),m,p,g,f=!1,x=i.length/3;for(m=0;m<x;m+=4){let _=m,C=m+2,V=h.fromArray(i,_*3,cne),L=h.fromArray(i,C*3,lne);if(Math.abs(V.y)<GN)for(V.y=GN*(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)<GN)for(L.y=GN*(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,E=d.indices,X=u.attributes,v=u.indices,P=qn.lineSegmentPlane(V,L,ane,WIe);if(l(P)){f=!0;let A=h.multiplyByScalar(h.UNIT_Y,wIe,PIe);V.y<0&&(h.negate(A,A),Z=u.attributes,E=u.indices,X=d.attributes,v=d.indices);let M=h.add(P,A,vIe);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(A,A),h.add(P,A,M),X.position.values.push(M.x,M.y,M.z),X.position.values.push(M.x,M.y,M.z),X.position.values.push(L.x,L.y,L.z,L.x,L.y,L.z),X.prevPosition.values.push(M.x,M.y,M.z),X.prevPosition.values.push(M.x,M.y,M.z),X.prevPosition.values.push(M.x,M.y,M.z),X.prevPosition.values.push(M.x,M.y,M.z),X.nextPosition.values.push(L.x,L.y,L.z,L.x,L.y,L.z),X.nextPosition.values.push(r[C*3],r[C*3+1],r[C*3+2]),X.nextPosition.values.push(r[C*3+3],r[C*3+4],r[C*3+5]);let b=D.fromArray(s,_*2,ine),R=Math.abs(b.y);Z.expandAndWidth.values.push(-1,R,1,R),Z.expandAndWidth.values.push(-1,-R,1,-R),X.expandAndWidth.values.push(-1,R,1,R),X.expandAndWidth.values.push(-1,-R,1,-R);let G=h.magnitudeSquared(h.subtract(P,V,pO));if(G/=h.magnitudeSquared(h.subtract(L,V,pO)),l(c)){let I=se.fromArray(c,_*4,one),w=se.fromArray(c,C*4,one),N=W.lerp(I.x,w.x,G),B=W.lerp(I.y,w.y,G),U=W.lerp(I.z,w.z,G),O=W.lerp(I.w,w.w,G);for(p=_*4;p<_*4+2*4;++p)Z.color.values.push(c[p]);for(Z.color.values.push(N,B,U,O),Z.color.values.push(N,B,U,O),X.color.values.push(N,B,U,O),X.color.values.push(N,B,U,O),p=C*4;p<C*4+2*4;++p)X.color.values.push(c[p])}if(l(a)){let I=D.fromArray(a,_*2,ine),w=D.fromArray(a,(m+3)*2,IIe),N=W.lerp(I.x,w.x,G);for(p=_*2;p<_*2+2*2;++p)Z.st.values.push(a[p]);for(Z.st.values.push(N,I.y),Z.st.values.push(N,w.y),X.st.values.push(N,I.y),X.st.values.push(N,w.y),p=C*2;p<C*2+2*2;++p)X.st.values.push(a[p])}g=Z.position.values.length/3-4,E.push(g,g+2,g+1),E.push(g+1,g+2,g+3),g=X.position.values.length/3-4,v.push(g,g+2,g+1),v.push(g+1,g+2,g+3)}else{let A,M;for(V.y<0?(A=u.attributes,M=u.indices):(A=d.attributes,M=d.indices),A.position.values.push(V.x,V.y,V.z),A.position.values.push(V.x,V.y,V.z),A.position.values.push(L.x,L.y,L.z),A.position.values.push(L.x,L.y,L.z),p=m*3;p<m*3+4*3;++p)A.prevPosition.values.push(o[p]),A.nextPosition.values.push(r[p]);for(p=m*2;p<m*2+4*2;++p)A.expandAndWidth.values.push(s[p]),l(a)&&A.st.values.push(a[p]);if(l(c))for(p=m*4;p<m*4+4*4;++p)A.color.values.push(c[p]);g=A.position.values.length/3-4,M.push(g,g+2,g+1),M.push(g+1,g+2,g+3)}}f&&(rne(u),rne(d)),bO(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,cn.ORIGIN_ZX_PLANE)!==Kt.INTERSECTING))return e;if(t.geometryType!==su.NONE)switch(t.geometryType){case su.POLYLINES:FIe(e);break;case su.TRIANGLES:tne(e);break;case su.LINES:nne(e);break}else TIe(t),t.primitiveType===Fe.TRIANGLES?tne(e):t.primitiveType===Fe.LINES&&nne(e);return e};var An=wc;var bKt=T(S(),1);function _l(e){this._ellipsoid=y(e,ne.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(_l.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});_l.mercatorAngleToGeodeticLatitude=function(e){return W.PI_OVER_TWO-2*Math.atan(Math.exp(-e))};_l.geodeticLatitudeToMercatorAngle=function(e){e>_l.MaximumLatitude?e=_l.MaximumLatitude:e<-_l.MaximumLatitude&&(e=-_l.MaximumLatitude);let t=Math.sin(e);return .5*Math.log((1+t)/(1-t))};_l.MaximumLatitude=_l.mercatorAngleToGeodeticLatitude(Math.PI);_l.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=_l.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)};_l.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,o=_l.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 Ri=_l;function AIe(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(!F.equals(s,e[r].modelMatrix)){i=!0;break}}if(i)for(r=0;r<o;++r)l(e[r].geometry)&&An.transformToWorldCoordinates(e[r]);else F.multiplyTransformation(t,e[0].modelMatrix,t)}function yO(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 MIe(e){let t=e.length;for(let n=0;n<t;++n){let i=e[n];l(i.geometry)?yO(i.geometry,n):l(i.westHemisphereGeometry)&&l(i.eastHemisphereGeometry)&&(yO(i.westHemisphereGeometry,n),yO(i.eastHemisphereGeometry,n))}}function NIe(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(AIe(t,a,o),!o)for(c=0;c<m;++c)l(t[c].geometry)&&An.splitLongitude(t[c]);if(MIe(t),r)for(c=0;c<m;++c){let g=t[c];l(g.geometry)?(An.reorderForPostVertexCache(g.geometry),An.reorderForPreVertexCache(g.geometry)):l(g.westHemisphereGeometry)&&l(g.eastHemisphereGeometry)&&(An.reorderForPostVertexCache(g.westHemisphereGeometry),An.reorderForPreVertexCache(g.westHemisphereGeometry),An.reorderForPostVertexCache(g.eastHemisphereGeometry),An.reorderForPreVertexCache(g.eastHemisphereGeometry))}let p=An.combineInstances(t);for(m=p.length,c=0;c<m;++c){d=p[c];let g=d.attributes;if(o)for(let f in g)g.hasOwnProperty(f)&&g[f].componentDatatype===Q.DOUBLE&&An.encodeAttribute(d,f,`${f}3DHigh`,`${f}3DLow`);else for(let f in g)if(g.hasOwnProperty(f)&&g[f].componentDatatype===Q.DOUBLE){let x=`${f}3D`,_=`${f}2D`;An.projectTo2D(d,f,x,_,n),l(d.boundingSphere)&&f==="position"&&(d.boundingSphereCV=ce.fromVertices(d.attributes.position2D.values)),An.encodeAttribute(d,x,`${x}High`,`${x}Low`),An.encodeAttribute(d,_,`${_}High`,`${_}Low`)}s&&An.compressVertices(d)}if(!i){let g=[];for(m=p.length,c=0;c<m;++c)d=p[c],g=g.concat(An.fitToUnsignedShortIndices(d));p=g}return p}function xO(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 kIe(e,t){let n=[];return xO(e,"geometry",t,n),xO(e,"westHemisphereGeometry",t,n),xO(e,"eastHemisphereGeometry",t,n),n}var Tp={};Tp.combineGeometry=function(e){let t,n,i=e.instances,o=i.length,r,s,a=!1;o>0&&(t=NIe(e),t.length>0&&(n=An.createAttributeLocations(t[0]),e.createPickOffsets&&(r=kIe(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 g=m.eastHemisphereGeometry,f=m.westHemisphereGeometry;l(g)&&l(f)&&(l(g.boundingSphere)&&l(f.boundingSphere)&&(c[u]=ce.union(g.boundingSphere,f.boundingSphere)),l(g.boundingSphereCV)&&l(f.boundingSphereCV)&&(d[u]=ce.union(g.boundingSphereCV,f.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:r,offsetInstanceExtend:s,boundingSpheres:c,boundingSpheresCV:d}};function UIe(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 DIe(e,t){let n=e.length;for(let i=0;i<n;++i)UIe(e[i],t)}function BIe(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}Tp.packCreateGeometryResults=function(e,t){let n=new Float64Array(BIe(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++]=y(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,g=[];for(let x in p)p.hasOwnProperty(x)&&l(p[x])&&(g.push(x),l(o[x])||(o[x]=i.length,i.push(x)));n[s++]=g.length;for(let x=0;x<g.length;x++){let _=g[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}};Tp.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 mn,L=n[s++];for(i=0;i<L;i++){let E=t[n[s++]],X=n[s++];C=n[s++];let v=n[s++]!==0;x=n[s++],_=Q.createTypedArray(X,x);for(let P=0;P<x;P++)_[P]=n[s++];V[E]=new Ge({componentDatatype:X,componentsPerAttribute:C,normalize:v,values:_})}let Z;if(x=n[s++],x>0){let E=_.length/C;for(Z=Ae.createTypedArray(E,x),i=0;i<x;i++)Z[i]=n[s++]}o[r++]=new ht({primitiveType:c,geometryType:d,boundingSphere:m,boundingSphereCV:p,indices:Z,attributes:V,offsetAttribute:u})}return o};function YIe(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(F.pack(s.modelMatrix,i,o),o+=F.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 OIe(e){let t=e,n=new Array(t[0]),i=0,o=1;for(;o<t.length;){let r=F.unpack(t,o),s;o+=F.packedLength,l(t[o])&&(s={offset:new zi(t[o],t[o+1],t[o+2])}),o+=3,n[i++]={modelMatrix:r,attributes:s}}return n}Tp.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:YIe(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof Li,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};Tp.unpackCombineGeometryParameters=function(e){let t=OIe(e.packedInstances),n=e.createGeometryResults,i=n.length,o=0;for(let a=0;a<i;a++){let c=Tp.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=ne.clone(e.ellipsoid),s=e.isGeographic?new Li(r):new Ri(r);return{instances:t,ellipsoid:r,projection:s,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:F.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function dne(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 une(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}Tp.packCombineGeometryResults=function(e,t){l(e.geometries)&&DIe(e.geometries,t);let n=dne(e.boundingSpheres),i=dne(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}};Tp.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:une(e.boundingSpheres),boundingSpheresCV:une(e.boundingSpheresCV)}};var gx=Tp;var vKt=T(S(),1),HIe={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6},gr=Object.freeze(HIe);var FKt=T(S(),1),cd={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};cd.NUMBER_OF_SHADOW_MODES=4;cd.castShadows=function(e){return e===cd.ENABLED||e===cd.CAST_ONLY};cd.receiveShadows=function(e){return e===cd.ENABLED||e===cd.RECEIVE_ONLY};cd.fromCastReceive=function(e,t){return e&&t?cd.ENABLED:e?cd.CAST_ONLY:t?cd.RECEIVE_ONLY:cd.DISABLED};var _n=Object.freeze(cd);function yr(e){e=y(e,y.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=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=new F,this.show=y(e.show,!0),this._vertexCacheOptimize=y(e.vertexCacheOptimize,!1),this._interleave=y(e.interleave,!1),this._releaseGeometryInstances=y(e.releaseGeometryInstances,!0),this._allowPicking=y(e.allowPicking,!0),this._asynchronous=y(e.asynchronous,!0),this._compressVertices=y(e.compressVertices,!0),this.cull=y(e.cull,!0),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.rtcCenter=e.rtcCenter,this.shadows=y(e.shadows,_n.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(yr.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 zIe(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 KIe=new D,JIe=new h,_ne=new se;function Tne(e){let t=e.length;if(t===1)return e[0];if(t===2)return D.unpack(e,0,KIe);if(t===3)return h.unpack(e,0,JIe);if(t===4)return se.unpack(e,0,_ne)}function QIe(e,t){let n=e.geometryInstances,i=Array.isArray(n)?n:[n],o=i.length;if(o===0)return;let r=zIe(i),s=r.length,a=[],c={},d={},u,p=i[0].attributes,g,f,x;for(g=0;g<s;++g)f=r[g],x=p[f],c[f]=g,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 ux(t,a,o);for(g=0;g<o;++g){let V=i[g];p=V.attributes;for(let v=0;v<s;++v){f=r[v],x=p[f];let P=Tne(x.value),A=c[f];C.setBatchedAttribute(g,A,P)}let L={primitive:y(V.pickPrimitive,e)};l(V.id)&&(L.id=V.id);let Z=t.createPickId(L);e._pickIds.push(Z);let E=Z.color,X=_ne;X.x=Y.floatToByte(E.red),X.y=Y.floatToByte(E.green),X.z=Y.floatToByte(E.blue),X.w=Y.floatToByte(E.alpha),C.setBatchedAttribute(g,_-1,X)}e._batchTable=C,e._batchTableAttributeIndices=c,e._batchTableBoundingSphereAttributeIndices=d,e._batchTableOffsetAttribute2DIndex=u}function jIe(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 qIe(e){let t=e.attributes,n=new mn;for(let o in t)t.hasOwnProperty(o)&&l(t[o])&&(n[o]=jIe(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 ht({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:ce.clone(e.boundingSphere)})}function $Ie(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:F.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var eWe=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;yr._modifyShaderPosition=function(e,t,n){let i,o="",r="",s="";for(;(i=eWe.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(`
`)};yr._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};yr._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 mne(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 hne(e){return`in vec4 v_pickColor;
${e}`}yr._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};yr._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};yr._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 fne(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 g=`void main() 
{ 
${m}    czm_non_compressed_main(); 
}`;return[d,u,p,g].join(`
`)}function tWe(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 nWe(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 pne(e,t){let n=e.vertexAttributes}function iWe(e,t){return function(){return e[t]}}var _O=Math.max(Ot.hardwareConcurrency-1,1),IN,oWe=new bi("combineGeometry");function rWe(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,modulePath:i._workerPath,geometry:i});if(!l(IN))for(IN=new Array(_O),o=0;o<_O;o++)IN[o]=new bi("createGeometry");let u;for(d=EE(d,_O),o=0;o<d.length;o++){let m=0,p=d[o],g=p.length;for(r=0;r<g;++r)u=p[r],i=u.geometry,l(i.constructor.pack)&&(u.offset=m,m+=y(i.constructor.packedLength,i.packedLength));let f;if(m>0){let x=new Float64Array(m);for(f=[x.buffer],r=0;r<g;++r)u=p[r],i=u.geometry,l(i.constructor.pack)&&(i.constructor.pack(i,x,u.offset),u.geometry=x)}c.push(IN[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){AE(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=oWe.scheduleTask(gx.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=gx.unpackCombineGeometryResults(m);e._geometries=p.geometries,e._attributeLocations=p.attributeLocations,e.modelMatrix=F.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):AE(e,t,gr.FAILED,void 0)}).catch(function(m){AE(e,t,gr.FAILED,m)})}}function sWe(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,g;l(p.attributes)&&l(p.primitiveType)?g=qIe(p):g=p.constructor.createGeometry(p),o[c++]=$Ie(s,g),r.push(s.id)}o.length=c;let d=t.scene3DOnly,u=t.mapProjection,m=gx.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=F.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):AE(e,t,gr.FAILED,void 0)}function aWe(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),Lne(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,cn.ORIGIN_ZX_PLANE)!==Kt.INTERSECTING?c.push(x):(d.push(x),u.push(x))}let m=c[0],p=u[0],g=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++)g=ce.union(g,d[i]);let f=[];for(l(m)&&f.push(m),l(p)&&f.push(p),l(g)&&f.push(g),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])}yr._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}var bne=new Yn,Sne=new he,Cne=new h,Vne=new ce;function cWe(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,g=p.length;for(let f=0;f<g;++f){let x=p[f];if(!l(x))continue;let _=e.modelMatrix;l(_)&&(x=ce.transform(x,_,Vne));let C=x.center,V=x.radius,L=Yn.fromCartesian(C,bne);if(m.setBatchedAttribute(f,o,L.high),m.setBatchedAttribute(f,r,L.low),!t.scene3DOnly){let Z=u.cartesianToCartographic(C,Sne),E=d.project(Z,Cne);L=Yn.fromCartesian(E,bne),m.setBatchedAttribute(f,s,L.high),m.setBatchedAttribute(f,a,L.low)}m.setBatchedAttribute(f,c,V)}e._batchTableBoundingSpheresUpdated=!0}var TO=new h,lWe=new h;function gne(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,Vne));let g=u.center;g=r.scaleToGeodeticSurface(g,lWe);let f=r.cartesianToCartographic(g,Sne),x=o.project(f,Cne),_=h.add(m,g,TO);f=r.cartesianToCartographic(_,f);let C=o.project(f,TO),V=h.subtract(C,x,TO),L=V.x;V.x=V.z,V.z=V.y,V.y=L,s.setBatchedAttribute(d,i,V)}e._batchTableOffsetsUpdated=!0}function dWe(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(mi.fromGeometry({context:r,geometry:d,attributeLocations:n,bufferUsage:Me.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,g=u.z;u.x=g,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,AE(e,t,gr.COMPLETE,void 0)}function uWe(e,t,n,i){let o=n.getRenderState(),r;i?(r=Ye(o,!1),r.cull={enabled:!0,face:yi.BACK},e._frontFaceRS=Ue.fromCache(r),r.cull.face=yi.FRONT,e._backFaceRS=Ue.fromCache(r)):(e._frontFaceRS=Ue.fromCache(o),e._backFaceRS=e._frontFaceRS),r=Ye(o,!1),l(e._depthFailAppearance)&&(r.depthTest.enabled=!1),l(e._depthFailAppearance)&&(o=e._depthFailAppearance.getRenderState(),r=Ye(o,!1),r.depthTest.func=tc.GREATER,i?(r.cull={enabled:!0,face:yi.BACK},e._frontFaceDepthFailRS=Ue.fromCache(r),r.cull.face=yi.FRONT,e._backFaceDepthFailRS=Ue.fromCache(r)):(e._frontFaceDepthFailRS=Ue.fromCache(r),e._backFaceDepthFailRS=e._frontFaceRS))}function mWe(e,t,n){let i=t.context,o=e._attributeLocations,r=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);r=yr._appendOffsetToShader(e,r),r=yr._appendShowToShader(e,r),r=yr._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=mne(r),r=yr._updateColorAttribute(e,r,!1),r=fne(e,r),r=yr._modifyShaderPosition(e,r,t.scene3DOnly);let s=n.getFragmentShaderSource();s=hne(s),e._sp=rn.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),pne(e._sp,o),l(e._depthFailAppearance)&&(r=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),r=yr._appendShowToShader(e,r),r=yr._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=mne(r),r=yr._updateColorAttribute(e,r,!0),r=fne(e,r),r=yr._modifyShaderPosition(e,r,t.scene3DOnly),r=tWe(r),s=e._depthFailAppearance.getFragmentShaderSource(),s=hne(s),s=nWe(s),e._spDepthFail=rn.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),pne(e._spDepthFail,o))}var FE=new F,yne=new h;function xne(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]=iWe(s,c));let a=_t(r,o);return a=e._batchTable.getUniformMapCallback()(a),l(e.rtcCenter)&&(a.u_modifiedModelView=function(){let c=i.context.uniformState.view;return F.multiply(c,e._modelMatrix,FE),F.multiplyByPoint(FE,e.rtcCenter,yne),F.setTranslation(FE,yne,FE),FE}),a}function hWe(e,t,n,i,o,r,s,a){let c=xne(e,t,n,a),d;l(e._depthFailAppearance)&&(d=xne(e,e._depthFailAppearance,e._depthFailAppearance.material,a));let u=i?Re.TRANSLUCENT:Re.OPAQUE,m=o?2:1;m*=l(e._depthFailAppearance)?2:1,r.length=e._va.length*m;let p=r.length,g=0;for(let f=0;f<p;++f){let x;o&&(x=r[f],l(x)||(x=r[f]=new tt({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[g],x.renderState=e._backFaceRS,x.shaderProgram=e._sp,x.uniformMap=c,x.pass=u,++f),x=r[f],l(x)||(x=r[f]=new tt({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[g],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 tt({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[g],x.renderState=e._backFaceDepthFailRS,x.shaderProgram=e._spDepthFail,x.uniformMap=d,x.pass=u),++f,x=r[f],l(x)||(x=r[f]=new tt({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[g],x.renderState=e._frontFaceDepthFailRS,x.shaderProgram=e._spDepthFail,x.uniformMap=d,x.pass=u),++g}}yr._updateBoundingVolumes=function(e,t,n,i){let o,r,s;if(i||!F.equals(n,e._modelMatrix))for(F.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 fWe(e,t,n,i,o,r,s,a){yr._updateBoundingVolumes(e,t,o);let c;t.mode===oe.SCENE3D?c=e._boundingSphereWC:t.mode===oe.COLUMBUS_VIEW?c=e._boundingSphereCV:t.mode===oe.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=_n.castShadows(e.shadows),g=_n.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=g,m?V.pickId="v_pickColor":V.pickId=void 0,d.push(V)}}}yr.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!==oe.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)||QIe(this,t),this._batchTable.attributes.length>0){if(Dt.maximumVertexTextureImageUnits===0)throw new ue("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?rWe(this,e):sWe(this,e)),this._state===gr.COMBINED&&(cWe(this,e),gne(this,e),dWe(this,e)),!this.show||this._state!==gr.COMPLETE)return;this._batchTableOffsetsUpdated||gne(this,e),this._recomputeBoundingSpheres&&aWe(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&&y(this._createRenderStatesFunction,uWe)(this,t,n,d),r&&y(this._createShaderProgramFunction,mWe)(this,e,n),(o||r)&&y(this._createCommandsFunction,hWe)(this,n,i,c,d,this._colorCommands,this._pickCommands,e),y(this._updateAndQueueCommandsFunction,fWe)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,d)};var pWe=new ce,bWe=new ce;function Lne(e,t,n){if(n===ln.TOP){let i=ce.clone(e,pWe),o=ce.clone(e,bWe);o.center=h.add(o.center,t,o.center),e=ce.union(i,o,e)}else n===ln.ALL&&(e.center=h.add(e.center,t,e.center));return e}function gWe(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 yWe(e,t,n,i,o){return function(r){let s=Tne(r);e.setBatchedAttribute(t,n,s),o==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var xWe=new h;function _We(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)&&Lne(i,h.fromArray(r.get(),0,xWe),e._offsetInstanceExtend[n]),l(o)&&(i=ce.transform(i,o))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function TWe(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}yr.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:gWe(s,n,u),set:yWe(s,n,u,this,d)}}return _We(this,c,n),TWe(this,c,n),Object.defineProperties(t,c),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t};yr.prototype.isDestroyed=function(){return!1};yr.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,me(this)};function AE(e,t,n,i){e._error=i,e._state=n,t.afterRender.push(function(){e._ready=e._state===gr.COMPLETE||e._state===gr.FAILED})}var En=yr;var OJt=T(S(),1);var RJt=T(S(),1);function SWe(e){e=y(e,y.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=y(e.normalize,!1),this.value=e.value}var nc=SWe;var GJt=T(S(),1),jS=`#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 hu(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new SO;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let o=new SO;if(o.requiresTextureCoordinates=e,n instanceof dn)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}hu.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 dn&&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 dn||(o=t.material.shaderSource),new Oe({defines:i,sources:[o,jS]})};hu.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:[jS],pickColorQualifier:"in"})};hu.prototype.createVertexShader=function(e,t,n,i){return Pne(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};hu.prototype.createPickVertexShader=function(e,t,n,i){return Pne(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var Rne=new h,Zne=new he,Gne={high:0,low:0};function Pne(e,t,n,i,o,r,s,a){let c=i.slice();if(a.eastMostYhighDefine===""){let d=Zne;d.longitude=W.PI,d.latitude=0,d.height=0;let u=s.project(d,Rne),m=Yn.encode(u.x,Gne);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=Zne;p.longitude=-W.PI,p.latitude=0,p.height=0;let g=s.project(p,Rne);m=Yn.encode(g.x,Gne),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 dn&&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 SO(){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(SO.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 Ene(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)/D.distance(t,e)}var CWe=[new D,new D,new D,new D];function vne(e,t){let n=CWe,i=D.unpack(t,0,n[0]),o=D.unpack(t,2,n[1]),r=D.unpack(t,4,n[2]);e.uMaxVmax=new nc({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o.x,o.y,r.x,r.y]});let s=1/Ene(i,o,r),a=1/Ene(i,r,o);e.uvMinAndExtents=new nc({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var wne=new he,Fne=new h,VWe=new h,LWe=new h,WN={high:0,low:0};function Ane(e,t,n){let i=wne;i.height=0,i.longitude=e.west,i.latitude=e.south;let o=t.project(i,Fne);i.latitude=e.north;let r=t.project(i,VWe);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,LWe),a=[0,0,0,0],c=[0,0,0,0],d=Yn.encode(o.x,WN);a[0]=d.high,c[0]=d.low,d=Yn.encode(o.y,WN),a[1]=d.high,c[1]=d.low,d=Yn.encode(r.y,WN),a[2]=d.high,c[2]=d.low,d=Yn.encode(s.x,WN),a[3]=d.high,c[3]=d.low,n.planes2D_HIGH=new nc({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new nc({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var RWe=new F,ZWe=new F,Xne=new h,GWe=new he,EWe=[new he,new he,new he,new he,new he,new he,new he,new he];function XWe(e,t,n,i,o,r){let s=ae.center(e,GWe);s.height=n;let a=he.toCartesian(s,t,Xne),c=wt.eastNorthUpToFixedFrame(a,t,RWe),d=F.inverse(c,ZWe),u=e.west,m=e.east,p=e.north,g=e.south,f=EWe;f[0].latitude=g,f[0].longitude=u,f[1].latitude=p,f[1].longitude=u,f[2].latitude=p,f[2].longitude=m,f[3].latitude=g,f[3].longitude=m;let x=(u+m)*.5,_=(p+g)*.5;f[4].latitude=g,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 P=0;P<8;P++){f[P].height=n;let A=he.toCartesian(f[P],t,Xne);F.multiplyByPoint(d,A,A),A.z=0,C=Math.min(C,A.x),V=Math.max(V,A.x),L=Math.min(L,A.y),Z=Math.max(Z,A.y)}let E=i;E.x=C,E.y=L,E.z=0,F.multiplyByPoint(c,E,E);let X=o;X.x=V,X.y=L,X.z=0,F.multiplyByPoint(c,X,X),h.subtract(X,E,o);let v=r;v.x=C,v.y=Z,v.z=0,F.multiplyByPoint(c,v,v),h.subtract(v,E,r)}var IWe=new h,WWe=new h,PWe=new Yn;hu.getPlanarTextureCoordinateAttributes=function(e,t,n,i,o){let r=Fne,s=IWe,a=WWe;XWe(e,n,y(o,0),r,s,a);let c={};vne(c,t);let d=Yn.fromCartesian(r,PWe);return c.southWest_HIGH=new nc({componentDatatype:Q.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(d.high,[0,0,0])}),c.southWest_LOW=new nc({componentDatatype:Q.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(d.low,[0,0,0])}),c.eastward=new nc({componentDatatype:Q.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(s,[0,0,0])}),c.northward=new nc({componentDatatype:Q.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(a,[0,0,0])}),Ane(e,i,c),c};var vWe=new h;function Ine(e,t,n,i){let o=wne;o.latitude=e,o.longitude=t,o.height=0;let r=he.toCartesian(o,n,vWe),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 Wne=new D;hu.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let o=Ine(e.south,e.west,n,Wne),r=o.x,s=o.y,a=Ine(e.north,e.east,n,Wne),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),g={sphericalExtents:new nc({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r,s,p,m]}),longitudeRotation:new nc({componentDatatype:Q.FLOAT,componentsPerAttribute:1,normalize:!1,value:[u]})};return vne(g,t),Ane(e,i,g),g};hu.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)};hu.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 wWe(e){return Math.max(e.width,e.height)>hu.MAX_WIDTH_FOR_PLANAR_EXTENTS}hu.shouldUseSphericalCoordinates=function(e){return wWe(e)};hu.MAX_WIDTH_FOR_PLANAR_EXTENTS=W.toRadians(1);var ld=hu;var tQt=T(S(),1);var KJt=T(S(),1);var FWe={NEVER:ie.NEVER,LESS:ie.LESS,EQUAL:ie.EQUAL,LESS_OR_EQUAL:ie.LEQUAL,GREATER:ie.GREATER,NOT_EQUAL:ie.NOTEQUAL,GREATER_OR_EQUAL:ie.GEQUAL,ALWAYS:ie.ALWAYS},Un=Object.freeze(FWe);var jJt=T(S(),1);var AWe={ZERO:ie.ZERO,KEEP:ie.KEEP,REPLACE:ie.REPLACE,INCREMENT:ie.INCR,DECREMENT:ie.DECR,INVERT:ie.INVERT,INCREMENT_WRAP:ie.INCR_WRAP,DECREMENT_WRAP:ie.DECR_WRAP},bt=Object.freeze(AWe);var PN={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};PN.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:Un.ALWAYS,frontOperation:{fail:bt.KEEP,zFail:bt.KEEP,zPass:bt.REPLACE},backFunction:Un.ALWAYS,backOperation:{fail:bt.KEEP,zFail:bt.KEEP,zPass:bt.REPLACE},reference:PN.CESIUM_3D_TILE_MASK,mask:PN.CESIUM_3D_TILE_MASK}};var Bt=Object.freeze(PN);function yx(e){e=y(e,y.EMPTY_OBJECT);let t=e.geometryInstances;this.geometryInstances=t,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,kn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._debugShowShadowVolume=!1,this._extruded=y(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:y(e.vertexCacheOptimize,!1),interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:y(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(yx.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}}});yx.isSupported=function(e){return e.context.stencilBuffer};function qS(e,t){let n=t?Un.EQUAL:Un.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:bt.KEEP,zFail:bt.DECREMENT_WRAP,zPass:bt.KEEP},backFunction:n,backOperation:{fail:bt.KEEP,zFail:bt.INCREMENT_WRAP,zPass:bt.KEEP},reference:Bt.CESIUM_3D_TILE_MASK,mask:Bt.CESIUM_3D_TILE_MASK},stencilMask:Bt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:tc.LESS_OR_EQUAL},depthMask:!1}}function VO(e){return{stencilTest:{enabled:e,frontFunction:Un.NOT_EQUAL,frontOperation:{fail:bt.ZERO,zFail:bt.ZERO,zPass:bt.ZERO},backFunction:Un.NOT_EQUAL,backOperation:{fail:bt.ZERO,zFail:bt.ZERO,zPass:bt.ZERO},reference:0,mask:Bt.CLASSIFICATION_MASK},stencilMask:Bt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND}}var MWe={stencilTest:{enabled:!0,frontFunction:Un.NOT_EQUAL,frontOperation:{fail:bt.ZERO,zFail:bt.ZERO,zPass:bt.ZERO},backFunction:Un.NOT_EQUAL,backOperation:{fail:bt.ZERO,zFail:bt.ZERO,zPass:bt.ZERO},reference:0,mask:Bt.CLASSIFICATION_MASK},stencilMask:Bt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function NWe(e,t,n,i){if(l(e._rsStencilDepthPass))return;let o=!e.debugShowShadowVolume;e._rsStencilDepthPass=Ue.fromCache(qS(o,!1)),e._rsStencilDepthPass3DTiles=Ue.fromCache(qS(o,!0)),e._rsColorPass=Ue.fromCache(VO(o,!1)),e._rsPickPass=Ue.fromCache(MWe)}function kWe(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 UWe(e,t){let n=t.context,i=e._primitive,o=GE;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=kWe(i,o));let a=e._extruded?"EXTRUDED_GEOMETRY":"",c=new Oe({defines:[a],sources:[o]}),d=new Oe({sources:[vb]}),u=e._primitive._attributeLocations,m=new ld(s,r,e.appearance);if(e._spStencil=rn.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=rn.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=rn.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:u});o=En._appendShowToShader(i,o),c=new Oe({defines:[a],sources:[o]}),e._sp=rn.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:u});let p=m.createFragmentShader(!1),g=m.createVertexShader([a],o,!1,t.mapProjection);if(e._spColor=rn.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:g,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 DWe(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 g=n._va[a++];r=t[o],l(r)||(r=t[o]=new tt({owner:e,primitiveType:n._primitiveType})),r.vertexArray=g,r.renderState=e._rsStencilDepthPass,r.shaderProgram=e._sp,r.uniformMap=c,r.pass=Re.TERRAIN_CLASSIFICATION,s=tt.shallowClone(r,r.derivedCommands.tileset),s.renderState=e._rsStencilDepthPass3DTiles,s.pass=Re.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,r=t[o+1],l(r)||(r=t[o+1]=new tt({owner:e,primitiveType:n._primitiveType})),r.vertexArray=g,r.renderState=e._rsColorPass,r.shaderProgram=e._spColor,r.pass=Re.TERRAIN_CLASSIFICATION;let x=e.appearance.material;if(l(x)&&(c=_t(c,x._uniforms)),r.uniformMap=c,s=tt.shallowClone(r,r.derivedCommands.tileset),s.pass=Re.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,d){let _=tt.shallowClone(r,r.derivedCommands.appearance2D);_.shaderProgram=e._spColor2D,r.derivedCommands.appearance2D=_,_=tt.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 g=0;g<i;++g){let f=u[g]=tt.shallowClone(t[p],u[g]);f.shaderProgram=m,f.pass=Re.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,p+=2}}function BWe(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),g=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 tt({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),d.vertexArray=f,d.renderState=e._rsStencilDepthPass,d.shaderProgram=e._sp,d.uniformMap=p,d.pass=Re.TERRAIN_CLASSIFICATION,n&&(d.offset=a.offset,d.count=a.count),u=tt.shallowClone(d,d.derivedCommands.tileset),u.renderState=e._rsStencilDepthPass3DTiles,u.pass=Re.CESIUM_3D_TILE_CLASSIFICATION,d.derivedCommands.tileset=u,d=t[c+1],l(d)||(d=t[c+1]=new tt({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),d.vertexArray=f,d.renderState=e._rsPickPass,d.shaderProgram=e._spPick,d.uniformMap=p,d.pass=Re.TERRAIN_CLASSIFICATION,n&&(d.offset=a.offset,d.count=a.count),u=tt.shallowClone(d,d.derivedCommands.tileset),u.pass=Re.CESIUM_3D_TILE_CLASSIFICATION,d.derivedCommands.tileset=u,g){let x=tt.shallowClone(d,d.derivedCommands.pick2D);x.shaderProgram=e._spPick2D,d.derivedCommands.pick2D=x,x=tt.shallowClone(u,u.derivedCommands.pick2D),x.shaderProgram=e._spPick2D,u.derivedCommands.pick2D=x}}}function YWe(e,t,n,i,o,r,s){DWe(e,r),BWe(e,s)}function Mne(e,t){return Math.floor(e%t/2)}function CO(e,t,n,i,o,r){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,e.debugShowBoundingVolume=r,t.commandList.push(e)}function Nne(e,t,n,i,o){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,t.commandList.push(e)}function OWe(e,t,n,i,o,r,s,a){let c=e._primitive;En._updateBoundingVolumes(c,t,o);let d;t.mode===oe.SCENE3D?d=c._boundingSphereWC:t.mode===oe.COLUMBUS_VIEW?d=c._boundingSphereCV:t.mode===oe.SCENE2D&&l(c._boundingSphere2D)?d=c._boundingSphere2D:l(c._boundingSphereMorph)&&(d=c._boundingSphereMorph);let u=e.classificationType,m=u!==kn.CESIUM_3D_TILE,p=u!==kn.TERRAIN,g=t.passes,f,x,_;if(g.render){let C=n.length;for(f=0;f<C;++f)x=d[Mne(f,C)],m&&(_=n[f],CO(_,t,o,r,x,s)),p&&(_=n[f].derivedCommands.tileset,CO(_,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],CO(_,t,o,r,x,s)}}if(g.pick){let C=i.length,V=c._pickOffsets;for(f=0;f<C;++f){let L=V[Mne(f,C)];x=d[L.index],m&&(_=i[f],Nne(_,t,o,r,x)),p&&(_=i[f].derivedCommands.tileset,Nne(_,t,o,r,x))}}}yx.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,g=!1;for(r>0&&(c=o[0].attributes,p=ld.hasAttributesForSphericalExtents(c),g=ld.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)&&Ht.equals(m,x)}if(!u&&!p&&!g)throw new pe("All GeometryInstances must have the same color attribute except via GroundPrimitives");d&&!l(t)&&(t=new dn({flat:!0}),this.appearance=t),this._usePickOffsets=!p&&!g,this._hasSphericalExtentsAttribute=p,this._hasPlanarExtentsAttributes=g,this._hasPerColorAttribute=d;let f=new Array(r);for(s=0;s<r;++s)a=o[s],f[s]=new Vt({geometry:a.geometry,attributes:a.attributes,modelMatrix:a.modelMatrix,id:a.id,pickPrimitive:y(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){NWe(n,_)},i._createShaderProgramFunction=function(x,_,C){UWe(n,_)},i._createCommandsFunction=function(x,_,C,V,L,Z,E){YWe(n,void 0,void 0,!0,!1,Z,E)},l(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(x,_,C,V,L,Z,E,X){n._updateAndQueueCommandsFunction(x,_,C,V,L,Z,E,X)}:i._updateAndQueueCommandsFunction=function(x,_,C,V,L,Z,E,X){OWe(n,_,C,V,L,Z,E,X)},this._primitive=new En(i)}this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=Ue.fromCache(qS(!1,!1)),this._rsStencilDepthPass3DTiles=Ue.fromCache(qS(!1,!0)),this._rsColorPass=Ue.fromCache(VO(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=Ue.fromCache(qS(!0,!1)),this._rsStencilDepthPass3DTiles=Ue.fromCache(qS(!0,!0)),this._rsColorPass=Ue.fromCache(VO(!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))})};yx.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};yx.prototype.isDestroyed=function(){return!1};yx.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,me(this)};var $S=yx;var HWe={u_globeMinimumAltitude:function(){return 55e3}};function Tl(e){e=y(e,y.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 dn({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,kn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1,this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=ai._defaultMaxTerrainHeight,this._minTerrainHeight=ai._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;let i=this;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:y(e.vertexCacheOptimize,!1),interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:y(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:i,_extruded:!0,_uniformMap:HWe}}Object.defineProperties(Tl.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}}});Tl.isSupported=$S.isSupported;function kne(e){return function(t,n){let i=n.maximumRadius,o=i/Math.cos(t*.5)-i;return e._maxHeight+o}}function Une(e){return function(t,n){return e._minHeight}}var zWe=new h,KWe=new h,JWe=new h,QWe=new he,jWe=new ae;function vN(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,zWe),g=h.unpack(o,m,KWe),f=h.add(p,g,JWe),x=n.cartesianToCartographic(f,QWe),_=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=jWe;return u.north=c,u.south=s,u.east=d,u.west=a,u}function qWe(e,t,n){let i=ai.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function $We(e,t,n){let i=t.mapProjection.ellipsoid,o=vN(t,n),r=Gn.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 LO(e,t){return Math.floor(e%t/2)}function RO(e,t,n,i,o,r,s){let a=e._primitive;n.mode!==oe.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 Dne(e,t,n,i,o,r){let s=e._primitive;n.mode!==oe.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 e2e(e,t,n,i,o,r,s,a){let c;t.mode===oe.SCENE3D?c=e._boundingVolumes:c=e._boundingVolumes2D;let d=e.classificationType,u=d!==kn.CESIUM_3D_TILE,m=d!==kn.TERRAIN,p=t.passes,g=e._primitive,f,x,_;if(p.render){let C=n.length;for(f=0;f<C;++f)x=c[LO(f,C)],u&&(_=n[f],RO(e,_,t,o,r,x,s)),m&&(_=n[f].derivedCommands.tileset,RO(e,_,t,o,r,x,s));if(t.invertClassification){let V=g._commandsIgnoreShow,L=V.length;for(f=0;f<L;++f)x=c[f],_=V[f],RO(e,_,t,o,r,x,s)}}if(p.pick){let C=i.length,V;for(e._useFragmentCulling||(V=g._primitive._pickOffsets),f=0;f<C;++f){if(x=c[LO(f,C)],!e._useFragmentCulling){let L=V[LO(f,C)];x=c[L.index]}u&&(_=i[f],Dne(e,_,t,o,r,x)),m&&(_=i[f].derivedCommands.tileset,Dne(e,_,t,o,r,x))}}}Tl.initializeTerrainHeights=function(){return ai.initialize()};Tl.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!ai.initialized){Tl.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=vN(e,r);l(m)?l(x)&&ae.union(m,x,m):m=ae.clone(x);let _=o.id;if(l(_)&&l(x)){let C=ai.getBoundingSphere(x,i);this._boundingSpheresKeys.push(_),this._boundingSpheres.push(C)}s=r.constructor,!l(s)||l(s.createShadowVolume)}qWe(this,m,i);let p=e.verticalExaggeration,g=e.verticalExaggerationRelativeHeight;this._minHeight=br.getHeight(this._minTerrainHeight,p,g),this._maxHeight=br.getHeight(this._maxTerrainHeight,p,g);let f=Tl._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=vN(e,r),ld.shouldUseSphericalCoordinates(m)){_=!1;break}for(u=0;u<c;++u){o=a[u],r=o.geometry,s=r.constructor;let C=vN(e,r),V=r.textureCoordinateRotationPoints;_?x=ld.getPlanarTextureCoordinateAttributes(C,V,i,e.mapProjection,this._maxHeight):x=ld.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 Vt({geometry:s.createShadowVolume(r,Une(this),kne(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 Vt({geometry:s.createShadowVolume(r,Une(this),kne(this)),attributes:o.attributes,id:o.id});n.geometryInstances=d,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(x,_){$We(t,x,_)},n._updateAndQueueCommandsFunction=function(x,_,C,V,L,Z,E,X){e2e(t,_,C,V,L,Z,E,X)},this._primitive=new $S(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))})};Tl.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};Tl.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Tl.prototype.isDestroyed=function(){return!1};Tl.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),me(this)};Tl._supportsMaterials=function(e){return e.depthTexture};Tl.supportsMaterials=function(e){return Tl._supportsMaterials(e.frameState.context)};var Fc=Tl;var qQt=T(S(),1);function eC(){pe.throwInstantiationError()}Object.defineProperties(eC.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError}});eC.prototype.getType=pe.throwInstantiationError;eC.prototype.getValue=pe.throwInstantiationError;eC.prototype.equals=pe.throwInstantiationError;var t2e=new q;eC.getValue=function(e,t,n){let i;return l(e)||(e=q.now(t2e)),l(t)&&(i=t.getType(e),l(i))?((!l(n)||n.type!==i)&&(n=Ui.fromType(i)),t.getValue(e,n.uniforms),n):((!l(n)||n.type!==Ui.ColorType)&&(n=Ui.fromType(Ui.ColorType)),Y.clone(Y.WHITE,n.uniforms.color),n)};var Ko=eC;function xx(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}xx.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!K.getValueOrDefault(t.show,n,!0)};xx.prototype._setOptions=pe.throwInstantiationError;xx.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 Yt,m,p=t._getIsClosed(c);if(u)m=new dn({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let g=Ko.getValue(e,d,this._material);this._material=g,m=new oo({material:g,translucent:g.isTranslucent(),closed:p})}if(n)c.vertexFormat=dn.VERTEX_FORMAT,this._primitive=o.add(new Fc({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:m,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),K.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{c.vertexFormat=m.vertexFormat;let g=this._geometryUpdater.createFillGeometryInstance(e);u&&(m.translucent=g.attributes.color.value[3]!==255),this._primitive=i.add(new En({geometryInstances:g,appearance:m,asynchronous:!1,shadows:a}))}}if(!n&&l(s.outline)&&s.outline.getValue(e)){let d=this._geometryUpdater.createOutlineGeometryInstance(e),u=K.getValueOrDefault(s.outlineWidth,e,1);this._outlinePrimitive=i.add(new En({geometryInstances:d,appearance:new dn({flat:!0,translucent:d.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(u)}}),asynchronous:!1,shadows:a}))}};xx.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),ft.DONE):l(i)&&i.show&&i.ready&&(o=i.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(ce.clone(o.boundingSphere,e),ft.DONE):l(n)&&!n.ready||l(i)&&!i.ready?ft.PENDING:ft.FAILED};xx.prototype.isDestroyed=function(){return!1};xx.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),me(this)};var ti=xx;var w$t=T(S(),1);var y$t=T(S(),1);var y8t=T(S(),1);var sjt=T(S(),1);var f4t=T(S(),1),n2e={NONE:0,GEODESIC:1,RHUMB:2},en=Object.freeze(n2e);var x4t=T(S(),1);var Bne=W.EPSILON10;function i2e(e,t,n,i){if(!l(e))return;n=y(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,Bne)?(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],Bne)&&(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 xo=i2e;var Z4t=T(S(),1);function o2e(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,g=1-p,f=Math.sqrt(g),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,E=1-3*x+35*_/4,X=1-5*x,v=L*u-Z*Math.sin(2*u)*x/2-E*Math.sin(4*u)*_/16-X*Math.sin(6*u)*C/48-Math.sin(8*u)*5*V/512,P=e._constants;P.a=n,P.b=i,P.f=o,P.cosineHeading=r,P.sineHeading=s,P.tanU=a,P.cosineU=c,P.sineU=d,P.sigma=u,P.sineAlpha=m,P.sineSquaredAlpha=p,P.cosineSquaredAlpha=g,P.cosineAlpha=f,P.u2Over4=x,P.u4Over16=_,P.u6Over64=C,P.u8Over256=V,P.a0=L,P.a1=Z,P.a2=E,P.a3=X,P.distanceRatio=v}function r2e(e,t){return e*t*(4+e*(4-3*t))/16}function Yne(e,t,n,i,o,r,s){let a=r2e(e,n);return(1-a)*e*t*(i+a*o*(s+a*r*(2*s*s-1)))}function s2e(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),g=Math.cos(u),f=Math.sin(u),x=m*g,_=m*f,C=p*f,V=p*g,L=c,Z=W.TWO_PI,E=Math.cos(L),X=Math.sin(L),v,P,A,M,b;do{E=Math.cos(L),X=Math.sin(L);let k=_-V*E;A=Math.sqrt(g*g*X*X+k*k),P=C+x*E,v=Math.atan2(A,P);let J;A===0?(J=0,M=1):(J=x*X/A,M=1-J*J),Z=L,b=P-2*C/M,isFinite(b)||(b=0),L=c+Yne(a,J,M,v,A,P,b)}while(Math.abs(L-Z)>W.EPSILON12);let R=M*(t*t-n*n)/(n*n),G=1+R*(4096+R*(R*(320-175*R)-768))/16384,I=R*(256+R*(R*(74-47*R)-128))/1024,w=b*b,N=I*A*(b+I*(P*(2*w-1)-I*b*(4*A*A-3)*(4*w-3)/6)/4),B=n*G*(v-N),U=Math.atan2(g*X,_-V*E),O=Math.atan2(m*X,_*E-V);e._distance=B,e._startHeading=U,e._endHeading=O,e._uSquared=R}var a2e=new h,ZO=new h;function One(e,t,n,i){let o=h.normalize(i.cartographicToCartesian(t,ZO),a2e),r=h.normalize(i.cartographicToCartesian(n,ZO),ZO);s2e(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,o2e(e)}function ME(e,t,n){let i=y(n,ne.default);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)&&One(this,e,t,i)}Object.defineProperties(ME.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}}});ME.prototype.setEndPoints=function(e,t){One(this,e,t,this._ellipsoid)};ME.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};ME.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,g=n.u8Over256,f=n.u2Over4,x=n.u6Over64,_=n.u4Over16,C=2*p*g*o/3+i*(1-f+7*_/4-15*x/4+579*g/64-(_-15*x/4+187*g/16)*o-(5*x/4-115*g/16)*r-29*g*s/16)+(f/2-_+71*x/32-85*g/16)*a+(5*_/16-5*x/4+383*g/96)*c-m*((x-11*g/2)*a+5*g*c/2)+(29*x/96-29*g/16)*d+539*g*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),E=Math.sin(C),X=Math.cos(C),v=n.cosineU*X,P=n.sineU*E,M=Math.atan2(E*n.sineHeading,v-P*n.cosineHeading)-Yne(n.f,n.sineAlpha,n.cosineSquaredAlpha,C,E,X,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 Sp=ME;var w4t=T(S(),1);function EO(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),g=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)*g-(693*a/1310720+6237*c/5242880)*f+1001*c/8388608*x)}function c2e(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,g=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),E=Math.cos(8*i),X=Math.sin(10*i),v=Math.cos(10*i),P=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*g/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)*g/5242880)*x+(21*i*u/256+483*i*m/4096-i*(224*o-1969)*p/16384-i*(33152*o-112599)*g/1048576)*C+(151*i*m/4096+4681*i*p/65536+1479*i*g/16384-453*r*g/32768)*L+(1097*i*p/65536+42783*i*g/1048576)*E+8011*i*g/1048576*v+(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*g/1048576-471*o*g/8192+9*s*g/4096)*f+(21*d/256+21*u/256+533*m/8192-21*o*m/512+197*p/4096-315*o*p/4096+584039*g/16777216-12517*o*g/131072+7*s*g/2048)*_+(151*u/6144+151*m/4096+5019*p/131072-453*o*p/16384+26965*g/786432-8607*o*g/131072)*V+(1097*m/131072+1097*p/65536+225797*g/10485760-1097*o*g/65536)*Z+(8011*p/2621440+8011*g/1048576)*X+293393*g/251658240*P}function tC(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 l2e(e,t,n,i,o){let r=tC(e._ellipticity,n),s=tC(e._ellipticity,o);return Math.atan2(W.negativePiToPi(i-t),s-r)}function d2e(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=EO(e._ellipticity,t,o);d=(EO(e._ellipticity,t,s)-u)/Math.cos(a)}return Math.abs(d)}var u2e=new h,GO=new h;function Hne(e,t,n,i){let o=h.normalize(i.cartographicToCartesian(t,GO),u2e),r=h.normalize(i.cartographicToCartesian(n,GO),GO),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=l2e(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=d2e(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function zne(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=EO(o,i,e.latitude),m=n*Math.cos(t),p=u+m;if(c=c2e(p,o,i),Math.abs(t)<W.EPSILON10)a=W.negativePiToPi(e.longitude);else{let g=tC(o,e.latitude),f=tC(o,c);d=Math.tan(t)*(f-g),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 Cp(e,t,n){let i=y(n,ne.default);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)&&Hne(this,e,t,i)}Object.defineProperties(Cp.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}}});Cp.fromStartHeadingDistance=function(e,t,n,i,o){let r=y(i,ne.default),s=r.maximumRadius,a=r.minimumRadius,c=s*s,d=a*a,u=Math.sqrt((c-d)/c);t=W.negativePiToPi(t);let m=zne(e,t,n,r.maximumRadius,u);return!l(o)||l(i)&&!i.equals(o.ellipsoid)?new Cp(e,m,r):(o.setEndPoints(e,m),o)};Cp.prototype.setEndPoints=function(e,t){Hne(this,e,t,this._ellipsoid)};Cp.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};Cp.prototype.interpolateUsingSurfaceDistance=function(e,t){return zne(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};Cp.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),g=(1+p)/(1-p);u=2*Math.atan(c*Math.pow(g/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};Cp.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=tC(n,o.latitude),s=tC(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 Ra=Cp;var AO=[Li,Ri],m2e=AO.length,hie=Math.cos(W.toRadians(30)),Kne=Math.cos(W.toRadians(150)),fie=0,pie=1e3;function Ab(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions;this.width=y(e.width,1),this._positions=t,this.granularity=y(e.granularity,9999),this.loop=y(e.loop,!1),this.arcType=y(e.arcType,en.GEODESIC),this._ellipsoid=ne.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(Ab.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+ne.packedLength+1+1}}});Ab.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<m2e;i++)if(t instanceof AO[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};var h2e=new h,Jne=new h,Qne=new h;function FO(e,t,n,i,o){let r=Ac(i,e,0,h2e),s=Ac(i,e,n,Jne),a=Ac(i,t,0,Qne),c=Vp(s,r,Jne),d=Vp(a,r,Qne);return h.cross(d,c,o),h.normalize(o,o)}var f2e=new he,p2e=new h,b2e=new h,g2e=new h;function XO(e,t,n,i,o,r,s,a,c,d,u){if(o===0)return;let m;r===en.GEODESIC?m=new Sp(e,t,s):r===en.RHUMB&&(m=new Ra(e,t,s));let p=m.surfaceDistance;if(p<o)return;let g=FO(e,t,i,s,g2e),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(_,f2e),E=Ac(s,Z,n,p2e),X=Ac(s,Z,i,b2e);h.pack(g,a,V),h.pack(E,c,V),h.pack(X,d,V),u.push(Z.latitude),u.push(Z.longitude),V+=3,_+=x}}var IO=new he;function Ac(e,t,n,i){return he.clone(t,IO),IO.height=n,he.toCartesian(IO,e,i)}Ab.pack=function(e,t,n){let i=y(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,ne.pack(e._ellipsoid,t,i),i+=ne.packedLength,t[i++]=e._projectionIndex,t[i++]=e._scene3DOnly?1:0,t};Ab.unpack=function(e,t,n){let i=y(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=ne.unpack(e,i);i+=ne.packedLength;let u=e[i++],m=e[i++]===1;return l(n)||(n=new Ab({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 Vp(e,t,n){return h.subtract(e,t,n),h.normalize(n,n),n}function jne(e,t,n,i){return i=Vp(e,t,i),i=h.cross(i,n,i),i=h.normalize(i,i),i=h.cross(n,i,i),i}var y2e=new h,x2e=new h,_2e=new h,bie=new h,T2e=0,S2e=-1;function WO(e,t,n,i,o){let r=Vp(n,t,bie),s=jne(e,t,r,y2e),a=jne(i,t,r,x2e);if(W.equalsEpsilon(h.dot(s,a),S2e,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,_2e);return h.dot(a,c)<T2e&&(o=h.negate(o,o)),o}var MN=cn.fromPointNormal(h.ZERO,h.UNIT_Y),C2e=new h,V2e=new h,L2e=new h,R2e=new h,Z2e=new h,wN=new h,FN=new he,qne=new he,$ne=new he;Ab.createGeometry=function(e){let t=!e._scene3DOnly,n=e.loop,i=e._ellipsoid,o=e.granularity,r=e.arcType,s=new AO[e._projectionIndex](i),a=fie,c=pie,d,u,m=e._positions,p=m.length;p===2&&(n=!1);let g,f,x,_,C=new Ra(void 0,void 0,i),V,L,Z,E=[m[0]];for(u=0;u<p-1;u++)g=m[u],f=m[u+1],V=qn.lineSegmentPlane(g,f,MN,wN),l(V)&&!h.equalsEpsilon(V,g,W.EPSILON7)&&!h.equalsEpsilon(V,f,W.EPSILON7)&&(e.arcType===en.GEODESIC?E.push(h.clone(V)):e.arcType===en.RHUMB&&(Z=i.cartesianToCartographic(V,FN).longitude,x=i.cartesianToCartographic(g,FN),_=i.cartesianToCartographic(f,qne),C.setEndPoints(x,_),L=C.findIntersectionWithLongitude(Z,$ne),V=i.cartographicToCartesian(L,wN),l(V)&&!h.equalsEpsilon(V,g,W.EPSILON7)&&!h.equalsEpsilon(V,f,W.EPSILON7)&&E.push(h.clone(V)))),E.push(f);n&&(g=m[p-1],f=m[0],V=qn.lineSegmentPlane(g,f,MN,wN),l(V)&&!h.equalsEpsilon(V,g,W.EPSILON7)&&!h.equalsEpsilon(V,f,W.EPSILON7)&&(e.arcType===en.GEODESIC?E.push(h.clone(V)):e.arcType===en.RHUMB&&(Z=i.cartesianToCartographic(V,FN).longitude,x=i.cartesianToCartographic(g,FN),_=i.cartesianToCartographic(f,qne),C.setEndPoints(x,_),L=C.findIntersectionWithLongitude(Z,$ne),V=i.cartographicToCartesian(L,wN),l(V)&&!h.equalsEpsilon(V,g,W.EPSILON7)&&!h.equalsEpsilon(V,f,W.EPSILON7)&&E.push(h.clone(V)))));let X=E.length,v=new Array(X);for(u=0;u<X;u++){let H=he.fromCartesian(E[u],i);H.height=0,v[u]=H}if(v=xo(v,he.equalsEpsilon),X=v.length,X<2)return;let P=[],A=[],M=[],b=[],R=C2e,G=V2e,I=L2e,w=R2e,N=Z2e,B=v[0],U=v[1],O=v[X-1];for(R=Ac(i,O,a,R),w=Ac(i,U,a,w),G=Ac(i,B,a,G),I=Ac(i,B,c,I),n?N=WO(R,G,I,w,N):N=FO(B,U,c,i,N),h.pack(N,A,0),h.pack(G,M,0),h.pack(I,b,0),P.push(B.latitude),P.push(B.longitude),XO(B,U,a,c,o,r,i,A,M,b,P),u=1;u<X-1;++u){R=h.clone(G,R),G=h.clone(w,G);let H=v[u];Ac(i,H,c,I),Ac(i,v[u+1],a,w),WO(R,G,I,w,N),d=A.length,h.pack(N,A,d),h.pack(G,M,d),h.pack(I,b,d),P.push(H.latitude),P.push(H.longitude),XO(v[u],v[u+1],a,c,o,r,i,A,M,b,P)}let k=v[X-1],J=v[X-2];if(G=Ac(i,k,a,G),I=Ac(i,k,c,I),n){let H=v[0];R=Ac(i,J,a,R),w=Ac(i,H,a,w),N=WO(R,G,I,w,N)}else N=FO(J,k,c,i,N);if(d=A.length,h.pack(N,A,d),h.pack(G,M,d),h.pack(I,b,d),P.push(k.latitude),P.push(k.longitude),n){for(XO(k,B,a,c,o,r,i,A,M,b,P),d=A.length,u=0;u<3;++u)A[d+u]=A[u],M[d+u]=M[u],b[d+u]=b[u];P.push(B.latitude),P.push(B.longitude)}return $2e(n,s,M,b,A,P,t)};var G2e=new h,E2e=new $,X2e=new we;function eie(e,t,n,i){let o=Vp(n,t,G2e),r=h.dot(o,e);if(r>hie||r<Kne){let s=Vp(i,n,bie),a=r<Kne?W.PI_OVER_TWO:-W.PI_OVER_TWO,c=we.fromAxisAngle(s,a,X2e),d=$.fromQuaternion(c,E2e);return $.multiplyByVector(d,e,e),!0}return!1}var tie=new he,I2e=new h,nie=new h;function NE(e,t,n,i,o){let r=he.toCartesian(t,e._ellipsoid,I2e),s=h.add(r,n,nie),a=!1,c=e._ellipsoid,d=c.cartesianToCartographic(s,tie);Math.abs(t.longitude-d.longitude)>W.PI_OVER_TWO&&(a=!0,s=h.subtract(r,n,nie),d=c.cartesianToCartographic(s,tie)),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 W2e=new h,iie=new h;function oie(e,t,n,i,o,r){let s=h.subtract(t,e,W2e);h.normalize(s,s);let a=n-fie,c=h.multiplyByScalar(s,a,iie);h.add(e,c,o);let d=i-pie;c=h.multiplyByScalar(s,d,iie),h.add(t,c,r)}var P2e=new h;function AN(e,t){let n=cn.getPointDistance(MN,e),i=cn.getPointDistance(MN,t),o=P2e;W.equalsEpsilon(n,0,W.EPSILON2)?(o=Vp(t,e,o),h.multiplyByScalar(o,W.EPSILON2,o),h.add(e,o,e)):W.equalsEpsilon(i,0,W.EPSILON2)&&(o=Vp(e,t,o),h.multiplyByScalar(o,W.EPSILON2,o),h.add(t,o,t))}function v2e(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 gie=new he,yie=new he,rie=new h,PO=new h,sie=new h,aie=new h,w2e=new h,cie=new h,F2e=[gie,yie],A2e=new ae,M2e=new h,N2e=new h,k2e=new h,U2e=new h,D2e=new h,B2e=new h,vO=new h,wO=new h,Y2e=new h,O2e=new h,H2e=new h,lie=new h,z2e=new h,K2e=new h,J2e=new Yn,Q2e=new Yn,die=new h,j2e=new h,uie=new h,q2e=[new ce,new ce],xie=[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],mie=xie.length;function $2e(e,t,n,i,o,r,s){let a,c,d=t._ellipsoid,u=n.length/3-1,m=u*8,p=m*4,g=u*36,f=m>65535?new Uint32Array(g):new Uint16Array(g),x=new Float64Array(m*3),_=new Float32Array(p),C=new Float32Array(p),V=new Float32Array(p),L=new Float32Array(p),Z=new Float32Array(p),E,X,v,P;s&&(E=new Float32Array(p),X=new Float32Array(p),v=new Float32Array(p),P=new Float32Array(m*2));let A=r.length/2,M=0,b=gie;b.height=0;let R=yie;R.height=0;let G=rie,I=PO;if(s)for(c=0,a=1;a<A;a++)b.latitude=r[c],b.longitude=r[c+1],R.latitude=r[c+2],R.longitude=r[c+3],G=t.project(b,G),I=t.project(R,I),M+=h.distance(G,I),c+=2;let w=i.length/3;I=h.unpack(i,0,I);let N=0;for(c=3,a=1;a<w;a++)G=h.clone(I,G),I=h.unpack(i,c,I),N+=h.distance(G,I),c+=3;let B;c=3;let U=0,O=0,k=0,J=0,H=!1,te=h.unpack(n,0,aie),z=h.unpack(i,0,PO),j=h.unpack(o,0,cie);if(e){let Le=h.unpack(n,n.length-6,sie);eie(j,Le,te,z)&&(j=h.negate(j,j))}let ee=0,fe=0,_e=0;for(a=0;a<u;a++){let Le=h.clone(te,sie),ke=h.clone(z,rie),Be=h.clone(j,w2e);H&&(Be=h.negate(Be,Be)),te=h.unpack(n,c,aie),z=h.unpack(i,c,PO),j=h.unpack(o,c,cie),H=eie(j,Le,te,z),b.latitude=r[U],b.longitude=r[U+1],R.latitude=r[U+2],R.longitude=r[U+3];let st,vt,Ct,Xe;if(s){let Qn=v2e(b,R);st=t.project(b,D2e),vt=t.project(R,B2e);let ms=Vp(vt,st,die);ms.y=Math.abs(ms.y),Ct=vO,Xe=wO,Qn===0||h.dot(ms,h.UNIT_Y)>hie?(Ct=NE(t,b,Be,st,vO),Xe=NE(t,R,j,vt,wO)):Qn===1?(Xe=NE(t,R,j,vt,wO),Ct.x=0,Ct.y=W.sign(b.longitude-Math.abs(R.longitude)),Ct.z=0):(Ct=NE(t,b,Be,st,vO),Xe.x=0,Xe.y=W.sign(b.longitude-R.longitude),Xe.z=0)}let je=h.distance(ke,z),$e=Yn.fromCartesian(Le,J2e),He=h.subtract(te,Le,Y2e),Ut=h.normalize(He,lie),Ce=h.subtract(ke,Le,O2e);Ce=h.normalize(Ce,Ce);let Ve=h.cross(Ut,Ce,lie);Ve=h.normalize(Ve,Ve);let ct=h.cross(Ce,Be,z2e);ct=h.normalize(ct,ct);let Ni=h.subtract(z,te,H2e);Ni=h.normalize(Ni,Ni);let mt=h.cross(j,Ni,K2e);mt=h.normalize(mt,mt);let _o=je/N,ur=ee/N,Zc=0,Sr,ts,Ne,ut=0,Je=0;if(s){Zc=h.distance(st,vt),Sr=Yn.fromCartesian(st,Q2e),ts=h.subtract(vt,st,die),Ne=h.normalize(ts,j2e);let Qn=Ne.x;Ne.x=Ne.y,Ne.y=-Qn,ut=Zc/M,Je=fe/M}for(B=0;B<8;B++){let Qn=J+B*4,ms=O+B*2,Cr=Qn+3,dl=B<4?1:-1,To=B===2||B===3||B===6||B===7?1:-1;h.pack($e.high,_,Qn),_[Cr]=He.x,h.pack($e.low,C,Qn),C[Cr]=He.y,h.pack(ct,V,Qn),V[Cr]=He.z,h.pack(mt,L,Qn),L[Cr]=_o*dl,h.pack(Ve,Z,Qn);let Ur=ur*To;Ur===0&&To<0&&(Ur=9),Z[Cr]=Ur,s&&(E[Qn]=Sr.high.x,E[Qn+1]=Sr.high.y,E[Qn+2]=Sr.low.x,E[Qn+3]=Sr.low.y,v[Qn]=-Ct.y,v[Qn+1]=Ct.x,v[Qn+2]=Xe.y,v[Qn+3]=-Xe.x,X[Qn]=ts.x,X[Qn+1]=ts.y,X[Qn+2]=Ne.x,X[Qn+3]=Ne.y,P[ms]=ut*dl,Ur=Je*To,Ur===0&&To<0&&(Ur=9),P[ms+1]=Ur)}let qe=k2e,pt=U2e,Zt=M2e,yn=N2e,po=ae.fromCartographicArray(F2e,A2e),ir=ai.getMinimumMaximumHeights(po,d),Da=ir.minimumTerrainHeight,Ba=ir.maximumTerrainHeight;_e+=Math.abs(Da),_e+=Math.abs(Ba),oie(Le,ke,Da,Ba,qe,Zt),oie(te,z,Da,Ba,pt,yn);let ns=h.multiplyByScalar(Ve,W.EPSILON5,uie);h.add(qe,ns,qe),h.add(pt,ns,pt),h.add(Zt,ns,Zt),h.add(yn,ns,yn),AN(qe,pt),AN(Zt,yn),h.pack(qe,x,k),h.pack(pt,x,k+3),h.pack(yn,x,k+6),h.pack(Zt,x,k+9),ns=h.multiplyByScalar(Ve,-2*W.EPSILON5,uie),h.add(qe,ns,qe),h.add(pt,ns,pt),h.add(Zt,ns,Zt),h.add(yn,ns,yn),AN(qe,pt),AN(Zt,yn),h.pack(qe,x,k+12),h.pack(pt,x,k+15),h.pack(yn,x,k+18),h.pack(Zt,x,k+21),U+=2,c+=3,O+=16,k+=24,J+=32,ee+=je,fe+=Zc}c=0;let le=0;for(a=0;a<u;a++){for(B=0;B<mie;B++)f[c+B]=xie[B]+le;le+=8,c+=mie}let ge=q2e;ce.fromVertices(n,h.ZERO,3,ge[0]),ce.fromVertices(i,h.ZERO,3,ge[1]);let Se=ce.fromBoundingSpheres(ge);Se.radius+=_e/(u*2);let Ie={position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,normalize:!1,values:x}),startHiAndForwardOffsetX:Fb(_),startLoAndForwardOffsetY:Fb(C),startNormalAndForwardOffsetZ:Fb(V),endNormalAndTextureCoordinateNormalizationX:Fb(L),rightNormalAndTextureCoordinateNormalizationY:Fb(Z)};return s&&(Ie.startHiLo2D=Fb(E),Ie.offsetAndRight2D=Fb(X),Ie.startEndNormals2D=Fb(v),Ie.texcoordNormalization2D=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,normalize:!1,values:P})),new ht({attributes:Ie,indices:f,boundingSphere:Se})}function Fb(e){return new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}Ab._projectNormal=NE;var _x=Ab;var cjt=T(S(),1),kE=`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 djt=T(S(),1),UE=`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 mjt=T(S(),1),DE=`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 fjt=T(S(),1),BE=`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 Zjt=T(S(),1);var bjt=T(S(),1),YE=`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 yjt=T(S(),1),dd=`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 MO=`${dd}
${YE}`,ePe=cx;Ot.isInternetExplorer()||(MO=`#define CLIP_POLYLINE 
${MO}`);function Tx(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=!1,i=Tx.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,MO),this._fragmentShaderSource=y(e.fragmentShaderSource,ePe),this._renderState=ji.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Tx.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}}});Tx.VERTEX_FORMAT=Pe.POSITION_ONLY;Tx.prototype.getFragmentShaderSource=ji.prototype.getFragmentShaderSource;Tx.prototype.isTranslucent=ji.prototype.isTranslucent;Tx.prototype.getRenderState=ji.prototype.getRenderState;var Yr=Tx;var Djt=T(S(),1);var Ejt=T(S(),1),OE=`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 Ijt=T(S(),1),Sx=`#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 NO=`${dd}
${OE}`,tPe=Sx;Ot.isInternetExplorer()||(NO=`#define CLIP_POLYLINE 
${NO}`);function Cx(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=!1,i=Cx.VERTEX_FORMAT;this.material=l(e.material)?e.material:Ui.fromType(Ui.ColorType),this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,NO),this._fragmentShaderSource=y(e.fragmentShaderSource,tPe),this._renderState=ji.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Cx.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}}});Cx.VERTEX_FORMAT=Pe.POSITION_AND_ST;Cx.prototype.getFragmentShaderSource=ji.prototype.getFragmentShaderSource;Cx.prototype.isTranslucent=ji.prototype.isTranslucent;Cx.prototype.getRenderState=ji.prototype.getRenderState;var ea=Cx;function Lp(e){e=y(e,y.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new ea),this.appearance=t,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,kn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(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=_ie(!1),this._renderState3DTiles=_ie(!0),this._renderStateMorph=Ue.fromCache({cull:{enabled:!0,face:yi.FRONT},depthTest:{enabled:!0},blending:un.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(Lp.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}}});Lp.initializeTerrainHeights=function(){return ai.initialize()};function nPe(e,t,n){let i=t.context,o=e._primitive,r=o._attributeLocations,s=o._batchTable.getVertexShaderCallback()(BE);s=En._appendShowToShader(o,s),s=En._appendDistanceDisplayConditionToShader(o,s),s=En._modifyShaderPosition(e,s,t.scene3DOnly);let a=o._batchTable.getVertexShaderCallback()(DE);a=En._appendShowToShader(o,a),a=En._appendDistanceDisplayConditionToShader(o,a),a=En._modifyShaderPosition(e,a,t.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()(kE),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],g=new Oe({defines:d,sources:[s]}),f=new Oe({defines:p,sources:[m,c]});e._sp=rn.replaceCache({context:i,shaderProgram:o._sp,vertexShaderSource:g,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 ${ai._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});c=o._batchTable.getVertexShaderCallback()(UE);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 _ie(e){return Ue.fromCache({cull:{enabled:!0},blending:un.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Un.EQUAL,frontOperation:{fail:bt.KEEP,zFail:bt.KEEP,zPass:bt.KEEP},backFunction:Un.EQUAL,backOperation:{fail:bt.KEEP,zFail:bt.KEEP,zPass:bt.KEEP},reference:Bt.CESIUM_3D_TILE_MASK,mask:Bt.CESIUM_3D_TILE_MASK}})}function iPe(e,t,n,i,o,r){let s=e._primitive,a=s._va.length;o.length=a,r.length=a;let d=t instanceof Yr?{}:n._uniforms,u=s._batchTable.getUniformMapCallback()(d);for(let m=0;m<a;m++){let p=s._va[m],g=o[m];l(g)||(g=o[m]=new tt({owner:e,primitiveType:s._primitiveType})),g.vertexArray=p,g.renderState=e._renderState,g.shaderProgram=e._sp,g.uniformMap=u,g.pass=Re.TERRAIN_CLASSIFICATION,g.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";let f=tt.shallowClone(g,g.derivedCommands.tileset);f.renderState=e._renderState3DTiles,f.pass=Re.CESIUM_3D_TILE_CLASSIFICATION,g.derivedCommands.tileset=f;let x=tt.shallowClone(g,g.derivedCommands.color2D);x.shaderProgram=e._sp2D,g.derivedCommands.color2D=x;let _=tt.shallowClone(f,f.derivedCommands.color2D);_.shaderProgram=e._sp2D,f.derivedCommands.color2D=_;let C=tt.shallowClone(g,g.derivedCommands.colorMorph);C.renderState=e._renderStateMorph,C.shaderProgram=e._spMorph,C.pickId="czm_batchTable_pickColor(v_batchId)",g.derivedCommands.colorMorph=C}}function Tie(e,t,n,i,o,r,s){n.mode===oe.MORPHING?t=t.derivedCommands.colorMorph:n.mode!==oe.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=i,t.boundingVolume=r,t.cull=o,t.debugShowBoundingVolume=s,n.commandList.push(t)}function oPe(e,t,n,i,o,r,s){let a=e._primitive;En._updateBoundingVolumes(a,t,o);let c;t.mode===oe.SCENE3D?c=a._boundingSphereWC:t.mode===oe.COLUMBUS_VIEW?c=a._boundingSphereCV:t.mode===oe.SCENE2D&&l(a._boundingSphere2D)?c=a._boundingSphere2D:l(a._boundingSphereMorph)&&(c=a._boundingSphereMorph);let d=t.mode===oe.MORPHING,u=e.classificationType,m=u!==kn.CESIUM_3D_TILE,p=u!==kn.TERRAIN&&!d,g,f=t.passes;if(f.render||f.pick&&a.allowPicking){let x=n.length;for(let _=0;_<x;++_){let C=c[_];m&&(g=n[_],Tie(e,g,t,o,r,C,s)),p&&(g=n[_].derivedCommands.tileset,Tie(e,g,t,o,r,C,s))}}}Lp.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!ai.initialized){Lp.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 nc({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=e.scene3DOnly,_x.setProjectionAndEllipsoid(c.geometry,e.mapProjection),s[t]=new Vt({geometry:c.geometry,attributes:a,id:c.id,pickPrimitive:n})}i.geometryInstances=s,i.appearance=this.appearance,i._createShaderProgramFunction=function(c,d,u){nPe(n,d,u)},i._createCommandsFunction=function(c,d,u,m,p,g,f){iPe(n,d,u,m,g,f)},i._updateAndQueueCommandsFunction=function(c,d,u,m,p,g,f,x){oPe(n,d,u,m,p,g,f)},this._primitive=new En(i)}if(this.appearance instanceof Yr&&!this._hasPerInstanceColors)throw new pe("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))})};Lp.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Lp.isSupported=function(e){return e.frameState.context.depthTexture};Lp.prototype.isDestroyed=function(){return!1};Lp.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,me(this)};var Cm=Lp;var D8t=T(S(),1);var w8t=T(S(),1);var G8t=T(S(),1);var rPe=new D(1,1),sPe=!1,aPe=Y.WHITE;function nC(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new be,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(nC.prototype,{isConstant:{get:function(){return K.isConstant(this._image)&&K.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:de("image"),repeat:de("repeat"),color:de("color"),transparent:de("transparent")});nC.prototype.getType=function(e){return"Image"};var cPe=new q;nC.prototype.getValue=function(e,t){return l(e)||(e=q.now(cPe)),l(t)||(t={}),t.image=K.getValueOrUndefined(this._image,e),t.repeat=K.getValueOrClonedDefault(this._repeat,e,rPe,t.repeat),t.color=K.getValueOrClonedDefault(this._color,e,aPe,t.color),K.getValueOrDefault(this._transparent,e,sPe)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};nC.prototype.equals=function(e){return this===e||e instanceof nC&&K.equals(this._image,e._image)&&K.equals(this._repeat,e._repeat)&&K.equals(this._color,e._color)&&K.equals(this._transparent,e._transparent)};var Mb=nC;function lPe(e){if(e instanceof Y)return new Yt(e);if(typeof e=="string"||e instanceof Ee||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new Mb;return t.image=e,t}}function dPe(e,t){return de(e,t,lPe)}var Eo=dPe;function HE(e){this._definitionChanged=new be,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(y(e,y.EMPTY_OBJECT))}Object.defineProperties(HE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:de("show"),dimensions:de("dimensions"),heightReference:de("heightReference"),fill:de("fill"),material:Eo("material"),outline:de("outline"),outlineColor:de("outlineColor"),outlineWidth:de("outlineWidth"),shadows:de("shadows"),distanceDisplayCondition:de("distanceDisplayCondition")});HE.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 HE(this)};HE.prototype.merge=function(e){this.show=y(this.show,e.show),this.dimensions=y(this.dimensions,e.dimensions),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var Vx=HE;var a7t=T(S(),1);var Y8t=T(S(),1),uPe={FIXED:0,INERTIAL:1},$i=Object.freeze(uPe);var q8t=T(S(),1);function iC(){pe.throwInstantiationError()}Object.defineProperties(iC.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError},referenceFrame:{get:pe.throwInstantiationError}});iC.prototype.getValue=pe.throwInstantiationError;iC.prototype.getValueInReferenceFrame=pe.throwInstantiationError;iC.prototype.equals=pe.throwInstantiationError;var Sie=new $;iC.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=wt.computeIcrfToCentralBodyFixedMatrix(e,Sie);if(n===$i.INERTIAL)return $.multiplyByVector(r,t,o);if(n===$i.FIXED)return $.multiplyByVector($.transpose(r,Sie),t,o)};var Rp=iC;function Lx(e,t){this._definitionChanged=new be,this._value=h.clone(e),this._referenceFrame=y(t,$i.FIXED)}Object.defineProperties(Lx.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===$i.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var mPe=new q;Lx.prototype.getValue=function(e,t){return l(e)||(e=q.now(mPe)),this.getValueInReferenceFrame(e,$i.FIXED,t)};Lx.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)};Lx.prototype.getValueInReferenceFrame=function(e,t,n){return Rp.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};Lx.prototype.equals=function(e){return this===e||e instanceof Lx&&h.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var Mc=Lx;var f7t=T(S(),1);function zE(e){this._definitionChanged=new be,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(y(e,y.EMPTY_OBJECT))}Object.defineProperties(zE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:de("show"),positions:de("positions"),width:de("width"),height:de("height"),heightReference:de("heightReference"),extrudedHeight:de("extrudedHeight"),extrudedHeightReference:de("extrudedHeightReference"),cornerType:de("cornerType"),granularity:de("granularity"),fill:de("fill"),material:Eo("material"),outline:de("outline"),outlineColor:de("outlineColor"),outlineWidth:de("outlineWidth"),shadows:de("shadows"),distanceDisplayCondition:de("distanceDisplayCondition"),classificationType:de("classificationType"),zIndex:de("zIndex")});zE.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 zE(this)};zE.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.width=y(this.width,e.width),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.cornerType=y(this.cornerType,e.cornerType),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var Rx=zE;var g7t=T(S(),1);function hPe(e){return e}function fPe(e,t){return de(e,t,hPe)}var Sl=fPe;var V7t=T(S(),1);function KE(e){this._definitionChanged=new be,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(y(e,y.EMPTY_OBJECT))}Object.defineProperties(KE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:de("show"),length:de("length"),topRadius:de("topRadius"),bottomRadius:de("bottomRadius"),heightReference:de("heightReference"),fill:de("fill"),material:Eo("material"),outline:de("outline"),outlineColor:de("outlineColor"),outlineWidth:de("outlineWidth"),numberOfVerticalLines:de("numberOfVerticalLines"),slices:de("slices"),shadows:de("shadows"),distanceDisplayCondition:de("distanceDisplayCondition")});KE.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 KE(this)};KE.prototype.merge=function(e){this.show=y(this.show,e.show),this.length=y(this.length,e.length),this.topRadius=y(this.topRadius,e.topRadius),this.bottomRadius=y(this.bottomRadius,e.bottomRadius),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=y(this.numberOfVerticalLines,e.numberOfVerticalLines),this.slices=y(this.slices,e.slices),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var Zx=KE;var I7t=T(S(),1);function JE(e){this._definitionChanged=new be,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(y(e,y.EMPTY_OBJECT))}Object.defineProperties(JE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:de("show"),semiMajorAxis:de("semiMajorAxis"),semiMinorAxis:de("semiMinorAxis"),height:de("height"),heightReference:de("heightReference"),extrudedHeight:de("extrudedHeight"),extrudedHeightReference:de("extrudedHeightReference"),rotation:de("rotation"),stRotation:de("stRotation"),granularity:de("granularity"),fill:de("fill"),material:Eo("material"),outline:de("outline"),outlineColor:de("outlineColor"),outlineWidth:de("outlineWidth"),numberOfVerticalLines:de("numberOfVerticalLines"),shadows:de("shadows"),distanceDisplayCondition:de("distanceDisplayCondition"),classificationType:de("classificationType"),zIndex:de("zIndex")});JE.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 JE(this)};JE.prototype.merge=function(e){this.show=y(this.show,e.show),this.semiMajorAxis=y(this.semiMajorAxis,e.semiMajorAxis),this.semiMinorAxis=y(this.semiMinorAxis,e.semiMinorAxis),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=y(this.rotation,e.rotation),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=y(this.numberOfVerticalLines,e.numberOfVerticalLines),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var Gx=JE;var M7t=T(S(),1);function QE(e){this._definitionChanged=new be,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(y(e,y.EMPTY_OBJECT))}Object.defineProperties(QE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:de("show"),radii:de("radii"),innerRadii:de("innerRadii"),minimumClock:de("minimumClock"),maximumClock:de("maximumClock"),minimumCone:de("minimumCone"),maximumCone:de("maximumCone"),heightReference:de("heightReference"),fill:de("fill"),material:Eo("material"),outline:de("outline"),outlineColor:de("outlineColor"),outlineWidth:de("outlineWidth"),stackPartitions:de("stackPartitions"),slicePartitions:de("slicePartitions"),subdivisions:de("subdivisions"),shadows:de("shadows"),distanceDisplayCondition:de("distanceDisplayCondition")});QE.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 QE(this)};QE.prototype.merge=function(e){this.show=y(this.show,e.show),this.radii=y(this.radii,e.radii),this.innerRadii=y(this.innerRadii,e.innerRadii),this.minimumClock=y(this.minimumClock,e.minimumClock),this.maximumClock=y(this.maximumClock,e.maximumClock),this.minimumCone=y(this.minimumCone,e.minimumCone),this.maximumCone=y(this.maximumCone,e.maximumCone),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.stackPartitions=y(this.stackPartitions,e.stackPartitions),this.slicePartitions=y(this.slicePartitions,e.slicePartitions),this.subdivisions=y(this.subdivisions,e.subdivisions),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var Ex=QE;var Y7t=T(S(),1);function jE(e){this._definitionChanged=new be,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(y(e,y.EMPTY_OBJECT))}Object.defineProperties(jE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:de("show"),text:de("text"),font:de("font"),style:de("style"),scale:de("scale"),showBackground:de("showBackground"),backgroundColor:de("backgroundColor"),backgroundPadding:de("backgroundPadding"),pixelOffset:de("pixelOffset"),eyeOffset:de("eyeOffset"),horizontalOrigin:de("horizontalOrigin"),verticalOrigin:de("verticalOrigin"),heightReference:de("heightReference"),fillColor:de("fillColor"),outlineColor:de("outlineColor"),outlineWidth:de("outlineWidth"),translucencyByDistance:de("translucencyByDistance"),pixelOffsetScaleByDistance:de("pixelOffsetScaleByDistance"),scaleByDistance:de("scaleByDistance"),distanceDisplayCondition:de("distanceDisplayCondition"),disableDepthTestDistance:de("disableDepthTestDistance")});jE.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 jE(this)};jE.prototype.merge=function(e){this.show=y(this.show,e.show),this.text=y(this.text,e.text),this.font=y(this.font,e.font),this.style=y(this.style,e.style),this.scale=y(this.scale,e.scale),this.showBackground=y(this.showBackground,e.showBackground),this.backgroundColor=y(this.backgroundColor,e.backgroundColor),this.backgroundPadding=y(this.backgroundPadding,e.backgroundPadding),this.pixelOffset=y(this.pixelOffset,e.pixelOffset),this.eyeOffset=y(this.eyeOffset,e.eyeOffset),this.horizontalOrigin=y(this.horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=y(this.verticalOrigin,e.verticalOrigin),this.heightReference=y(this.heightReference,e.heightReference),this.fillColor=y(this.fillColor,e.fillColor),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.translucencyByDistance=y(this.translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=y(this.pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.scaleByDistance=y(this.scaleByDistance,e.scaleByDistance),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this.disableDepthTestDistance,e.disableDepthTestDistance)};var Vm=jE;var S6t=T(S(),1);var r6t=T(S(),1);var Q7t=T(S(),1);var pPe=new h(1,1,1),bPe=h.ZERO,gPe=we.IDENTITY;function Cie(e,t,n){this.translation=h.clone(y(e,bPe)),this.rotation=we.clone(y(t,gPe)),this.scale=h.clone(y(n,pPe))}Cie.prototype.equals=function(e){return this===e||l(e)&&h.equals(this.translation,e.translation)&&we.equals(this.rotation,e.rotation)&&h.equals(this.scale,e.scale)};var Nb=Cie;var kO=new Nb;function qE(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new be,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(qE.prototype,{isConstant:{get:function(){return K.isConstant(this._translation)&&K.isConstant(this._rotation)&&K.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:de("translation"),rotation:de("rotation"),scale:de("scale")});var yPe=new q;qE.prototype.getValue=function(e,t){return l(e)||(e=q.now(yPe)),l(t)||(t=new Nb),t.translation=K.getValueOrClonedDefault(this._translation,e,kO.translation,t.translation),t.rotation=K.getValueOrClonedDefault(this._rotation,e,kO.rotation,t.rotation),t.scale=K.getValueOrClonedDefault(this._scale,e,kO.scale,t.scale),t};qE.prototype.equals=function(e){return this===e||e instanceof qE&&K.equals(this._translation,e._translation)&&K.equals(this._rotation,e._rotation)&&K.equals(this._scale,e._scale)};var Xx=qE;var f6t=T(S(),1);function Zp(e,t){this._propertyNames=[],this._definitionChanged=new be,l(e)&&this.merge(e,t)}Object.defineProperties(Zp.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(!K.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});Zp.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function xPe(e){return new Jn(e)}Zp.prototype.addProperty=function(e,t,n){this._propertyNames.push(e),Object.defineProperty(this,e,de(e,!0,y(n,xPe))),l(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)};Zp.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};var _Pe=new q;Zp.prototype.getValue=function(e,t){l(e)||(e=q.now(_Pe)),l(t)||(t={});let n=this._propertyNames;for(let i=0,o=n.length;i<o;i++){let r=n[i];t[r]=K.getValueOrUndefined(this[r],e,t[r])}return t};Zp.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 TPe(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||!K.equals(e[s],t[s]))return!1}return!0}Zp.prototype.equals=function(e){return this===e||e instanceof Zp&&TPe(this,e)};var Cl=Zp;function Vie(e){return new Xx(e)}function SPe(e){return new Cl(e,Vie)}function CPe(e){return new Cl(e)}function $E(e){this._definitionChanged=new be,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.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties($E.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:de("show"),uri:de("uri"),scale:de("scale"),minimumPixelSize:de("minimumPixelSize"),maximumScale:de("maximumScale"),incrementallyLoadTextures:de("incrementallyLoadTextures"),runAnimations:de("runAnimations"),clampAnimations:de("clampAnimations"),shadows:de("shadows"),heightReference:de("heightReference"),silhouetteColor:de("silhouetteColor"),silhouetteSize:de("silhouetteSize"),color:de("color"),colorBlendMode:de("colorBlendMode"),colorBlendAmount:de("colorBlendAmount"),imageBasedLightingFactor:de("imageBasedLightingFactor"),lightColor:de("lightColor"),distanceDisplayCondition:de("distanceDisplayCondition"),nodeTransformations:de("nodeTransformations",void 0,SPe),articulations:de("articulations",void 0,CPe),clippingPlanes:de("clippingPlanes"),customShader:de("customShader")});$E.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 $E(this)};$E.prototype.merge=function(e){this.show=y(this.show,e.show),this.uri=y(this.uri,e.uri),this.scale=y(this.scale,e.scale),this.minimumPixelSize=y(this.minimumPixelSize,e.minimumPixelSize),this.maximumScale=y(this.maximumScale,e.maximumScale),this.incrementallyLoadTextures=y(this.incrementallyLoadTextures,e.incrementallyLoadTextures),this.runAnimations=y(this.runAnimations,e.runAnimations),this.clampAnimations=y(this.clampAnimations,e.clampAnimations),this.shadows=y(this.shadows,e.shadows),this.heightReference=y(this.heightReference,e.heightReference),this.silhouetteColor=y(this.silhouetteColor,e.silhouetteColor),this.silhouetteSize=y(this.silhouetteSize,e.silhouetteSize),this.color=y(this.color,e.color),this.colorBlendMode=y(this.colorBlendMode,e.colorBlendMode),this.colorBlendAmount=y(this.colorBlendAmount,e.colorBlendAmount),this.imageBasedLightingFactor=y(this.imageBasedLightingFactor,e.imageBasedLightingFactor),this.lightColor=y(this.lightColor,e.lightColor),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.clippingPlanes=y(this.clippingPlanes,e.clippingPlanes),this.customShader=y(this.customShader,e.customShader);let t=e.nodeTransformations;if(l(t)){let i=this.nodeTransformations;l(i)?i.merge(t):this.nodeTransformations=new Cl(t,Vie)}let n=e.articulations;if(l(n)){let i=this.articulations;l(i)?i.merge(n):this.articulations=new Cl(n)}};var Gp=$E;var G6t=T(S(),1);function eX(e){this._definitionChanged=new be,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(y(e,y.EMPTY_OBJECT))}Object.defineProperties(eX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:de("show"),uri:de("uri"),maximumScreenSpaceError:de("maximumScreenSpaceError")});eX.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new eX(this)};eX.prototype.merge=function(e){this.show=y(this.show,e.show),this.uri=y(this.uri,e.uri),this.maximumScreenSpaceError=y(this.maximumScreenSpaceError,e.maximumScreenSpaceError)};var Ix=eX;var w6t=T(S(),1);function tX(e){this._definitionChanged=new be,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(y(e,y.EMPTY_OBJECT))}Object.defineProperties(tX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:de("show"),leadTime:de("leadTime"),trailTime:de("trailTime"),width:de("width"),resolution:de("resolution"),material:Eo("material"),distanceDisplayCondition:de("distanceDisplayCondition")});tX.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 tX(this)};tX.prototype.merge=function(e){this.show=y(this.show,e.show),this.leadTime=y(this.leadTime,e.leadTime),this.trailTime=y(this.trailTime,e.trailTime),this.width=y(this.width,e.width),this.resolution=y(this.resolution,e.resolution),this.material=y(this.material,e.material),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var Ep=tX;var D6t=T(S(),1);function nX(e){this._definitionChanged=new be,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(y(e,y.EMPTY_OBJECT))}Object.defineProperties(nX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:de("show"),plane:de("plane"),dimensions:de("dimensions"),fill:de("fill"),material:Eo("material"),outline:de("outline"),outlineColor:de("outlineColor"),outlineWidth:de("outlineWidth"),shadows:de("shadows"),distanceDisplayCondition:de("distanceDisplayCondition")});nX.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 nX(this)};nX.prototype.merge=function(e){this.show=y(this.show,e.show),this.plane=y(this.plane,e.plane),this.dimensions=y(this.dimensions,e.dimensions),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var iX=nX;var K6t=T(S(),1);function oX(e){this._definitionChanged=new be,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._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(oX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:de("show"),pixelSize:de("pixelSize"),heightReference:de("heightReference"),color:de("color"),outlineColor:de("outlineColor"),outlineWidth:de("outlineWidth"),scaleByDistance:de("scaleByDistance"),translucencyByDistance:de("translucencyByDistance"),distanceDisplayCondition:de("distanceDisplayCondition"),disableDepthTestDistance:de("disableDepthTestDistance"),splitDirection:de("splitDirection")});oX.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.splitDirection=this.splitDirection,e):new oX(this)};oX.prototype.merge=function(e){this.show=y(this.show,e.show),this.pixelSize=y(this.pixelSize,e.pixelSize),this.heightReference=y(this.heightReference,e.heightReference),this.color=y(this.color,e.color),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.scaleByDistance=y(this.scaleByDistance,e.scaleByDistance),this.translucencyByDistance=y(this._translucencyByDistance,e.translucencyByDistance),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this.disableDepthTestDistance,e.disableDepthTestDistance),this.splitDirection=y(this.splitDirection,e.splitDirection)};var Wx=oX;var sqt=T(S(),1);var j6t=T(S(),1);function VPe(e,t){this.positions=l(e)?e:[],this.holes=l(t)?t:[]}var Za=VPe;function LPe(e){return Array.isArray(e)&&(e=new Za(e)),new Jn(e)}function rX(e){this._definitionChanged=new be,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(y(e,y.EMPTY_OBJECT))}Object.defineProperties(rX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:de("show"),hierarchy:de("hierarchy",void 0,LPe),height:de("height"),heightReference:de("heightReference"),extrudedHeight:de("extrudedHeight"),extrudedHeightReference:de("extrudedHeightReference"),stRotation:de("stRotation"),granularity:de("granularity"),fill:de("fill"),material:Eo("material"),outline:de("outline"),outlineColor:de("outlineColor"),outlineWidth:de("outlineWidth"),perPositionHeight:de("perPositionHeight"),closeTop:de("closeTop"),closeBottom:de("closeBottom"),arcType:de("arcType"),shadows:de("shadows"),distanceDisplayCondition:de("distanceDisplayCondition"),classificationType:de("classificationType"),zIndex:de("zIndex"),textureCoordinates:de("textureCoordinates")});rX.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 rX(this)};rX.prototype.merge=function(e){this.show=y(this.show,e.show),this.hierarchy=y(this.hierarchy,e.hierarchy),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.perPositionHeight=y(this.perPositionHeight,e.perPositionHeight),this.closeTop=y(this.closeTop,e.closeTop),this.closeBottom=y(this.closeBottom,e.closeBottom),this.arcType=y(this.arcType,e.arcType),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex),this.textureCoordinates=y(this.textureCoordinates,e.textureCoordinates)};var Lm=rX;var hqt=T(S(),1);function sX(e){this._definitionChanged=new be,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(y(e,y.EMPTY_OBJECT))}Object.defineProperties(sX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:de("show"),positions:de("positions"),width:de("width"),granularity:de("granularity"),material:Eo("material"),depthFailMaterial:Eo("depthFailMaterial"),arcType:de("arcType"),clampToGround:de("clampToGround"),shadows:de("shadows"),distanceDisplayCondition:de("distanceDisplayCondition"),classificationType:de("classificationType"),zIndex:de("zIndex")});sX.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 sX(this)};sX.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.width=y(this.width,e.width),this.granularity=y(this.granularity,e.granularity),this.material=y(this.material,e.material),this.depthFailMaterial=y(this.depthFailMaterial,e.depthFailMaterial),this.arcType=y(this.arcType,e.arcType),this.clampToGround=y(this.clampToGround,e.clampToGround),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var ic=sX;var _qt=T(S(),1);function aX(e){this._definitionChanged=new be,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(y(e,y.EMPTY_OBJECT))}Object.defineProperties(aX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:de("show"),positions:de("positions"),shape:de("shape"),cornerType:de("cornerType"),granularity:de("granularity"),fill:de("fill"),material:Eo("material"),outline:de("outline"),outlineColor:de("outlineColor"),outlineWidth:de("outlineWidth"),shadows:de("shadows"),distanceDisplayCondition:de("distanceDisplayCondition")});aX.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 aX(this)};aX.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.shape=y(this.shape,e.shape),this.cornerType=y(this.cornerType,e.cornerType),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var Px=aX;var Zqt=T(S(),1);function cX(e){this._definitionChanged=new be,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(y(e,y.EMPTY_OBJECT))}Object.defineProperties(cX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:de("show"),coordinates:de("coordinates"),height:de("height"),heightReference:de("heightReference"),extrudedHeight:de("extrudedHeight"),extrudedHeightReference:de("extrudedHeightReference"),rotation:de("rotation"),stRotation:de("stRotation"),granularity:de("granularity"),fill:de("fill"),material:Eo("material"),outline:de("outline"),outlineColor:de("outlineColor"),outlineWidth:de("outlineWidth"),shadows:de("shadows"),distanceDisplayCondition:de("distanceDisplayCondition"),classificationType:de("classificationType"),zIndex:de("zIndex")});cX.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 cX(this)};cX.prototype.merge=function(e){this.show=y(this.show,e.show),this.coordinates=y(this.coordinates,e.coordinates),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=y(this.rotation,e.rotation),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var Rm=cX;var vqt=T(S(),1);function lX(e){this._definitionChanged=new be,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(y(e,y.EMPTY_OBJECT))}Object.defineProperties(lX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:de("show"),positions:de("positions"),minimumHeights:de("minimumHeights"),maximumHeights:de("maximumHeights"),granularity:de("granularity"),fill:de("fill"),material:Eo("material"),outline:de("outline"),outlineColor:de("outlineColor"),outlineWidth:de("outlineWidth"),shadows:de("shadows"),distanceDisplayCondition:de("distanceDisplayCondition")});lX.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 lX(this)};lX.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.minimumHeights=y(this.minimumHeights,e.minimumHeights),this.maximumHeights=y(this.maximumHeights,e.maximumHeights),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var Xp=lX;var RPe=new he,UO=[];function ZPe(e){return new Mc(e)}function GPe(e){return de(e,void 0,ZPe)}function Ps(e,t){return de(e,void 0,function(n){return n instanceof t?n:new t(n)})}function fu(e){e=y(e,y.EMPTY_OBJECT);let t=e.id;l(t)||(t=Bn()),this._availability=void 0,this._id=t,this._definitionChanged=new be,this._name=e.name,this._show=y(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",...UO],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 DO(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)&&DO(r,r._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(fu.prototype,{availability:Sl("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:Sl("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&&DO(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&&DO(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:Ps("billboard",ec),box:Ps("box",Vx),corridor:Ps("corridor",Rx),cylinder:Ps("cylinder",Zx),description:de("description"),ellipse:Ps("ellipse",Gx),ellipsoid:Ps("ellipsoid",Ex),label:Ps("label",Vm),model:Ps("model",Gp),tileset:Ps("tileset",Ix),orientation:de("orientation"),path:Ps("path",Ep),plane:Ps("plane",iX),point:Ps("point",Wx),polygon:Ps("polygon",Lm),polyline:Ps("polyline",ic),polylineVolume:Ps("polylineVolume",Px),properties:Ps("properties",Cl),position:GPe("position"),rectangle:Ps("rectangle",Rm),viewFrom:de("viewFrom"),wall:Ps("wall",Xp)});fu.registerEntityType=function(e,t){Object.defineProperties(fu.prototype,{[e]:Ps(e,t)}),UO.includes(e)||UO.push(e)};fu.prototype.isAvailable=function(e){let t=this._availability;return!l(t)||t.contains(e)};fu.prototype.addProperty=function(e){this._propertyNames.push(e),Object.defineProperty(this,e,Sl(e,!0))};fu.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e]};fu.prototype.merge=function(e){this.name=y(this.name,e.name),this.availability=y(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 Lie=new $,Rie=new h,Zie=new we;fu.prototype.computeModelMatrix=function(e,t){let n=K.getValueOrUndefined(this._position,e,Rie);if(!l(n))return;let i=K.getValueOrUndefined(this._orientation,e,Zie);return l(i)?t=F.fromRotationTranslation($.fromQuaternion(i,Lie),n,t):t=wt.eastNorthUpToFixedFrame(n,void 0,t),t};fu.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,o){let r=K.getValueOrDefault(t,e,Qe.NONE),s=K.getValueOrUndefined(this._position,e,Rie);if(r===Qe.NONE||!l(s)||h.equalsEpsilon(s,h.ZERO,W.EPSILON8))return this.computeModelMatrix(e,o);let a=i.cartesianToCartographic(s,RPe);du(r)?a.height=n:a.height+=n,s=i.cartographicToCartesian(a,s);let c=K.getValueOrUndefined(this._orientation,e,Zie);return l(c)?o=F.fromRotationTranslation($.fromQuaternion(c,Lie),s,o):o=wt.eastNorthUpToFixedFrame(s,void 0,o),o};fu.supportsMaterialsforEntitiesOnTerrain=function(e){return Fc.supportsMaterials(e)};fu.supportsPolylinesOnTerrain=function(e){return Cm.isSupported(e)};var Jo=fu;var EPe=new Yt(Y.WHITE),XPe=new Jn(!0),IPe=new Jn(!0),WPe=new Jn(!1),PPe=new Jn(Y.BLACK),vPe=new Jn(_n.DISABLED),wPe=new Jn(new Pt),FPe=new Jn(kn.BOTH);function Nc(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 be,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(Nc.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)&&K.isConstant(this._showProperty)&&K.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)&&K.isConstant(this._showProperty)&&K.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}}});Nc.prototype.isOutlineVisible=function(e){let t=this._entity,n=this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e);return y(n,!1)};Nc.prototype.isFilled=function(e){let t=this._entity,n=this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e);return y(n,!1)};Nc.prototype.createFillGeometryInstance=pe.throwInstantiationError;Nc.prototype.createOutlineGeometryInstance=pe.throwInstantiationError;Nc.prototype.isDestroyed=function(){return!1};Nc.prototype.destroy=function(){me(this)};Nc.prototype._isHidden=function(e,t){let n=t.show;return l(n)&&n.isConstant&&!n.getValue(De.MINIMUM_VALUE)};Nc.prototype._isOnTerrain=function(e,t){return!1};Nc.prototype._getIsClosed=function(e){return!0};Nc.prototype._isDynamic=pe.throwInstantiationError;Nc.prototype._setStaticOptions=pe.throwInstantiationError;Nc.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(De.MINIMUM_VALUE):!0,a=o.outline,c=l(a);if(c&&a.isConstant&&(c=a.getValue(De.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=y(o.material,EPe),this._fillProperty=y(r,IPe),this._showProperty=y(d,XPe),this._showOutlineProperty=y(o.outline,WPe),this._outlineColorProperty=c?y(o.outlineColor,PPe):void 0,this._shadowsProperty=y(o.shadows,vPe),this._distanceDisplayConditionProperty=y(o.distanceDisplayCondition,wPe),this._classificationTypeProperty=y(o.classificationType,FPe),this._fillEnabled=s;let u=this._isOnTerrain(e,o)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof Yt);if(c&&u&&(Nt(Nt.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(De.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Nc.prototype.createDynamicUpdater=function(e,t){return new this.constructor.DynamicGeometryUpdater(this,e,t)};var ni=Nc;var oen=T(S(),1);var k$t=T(S(),1);function oC(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new be,this.setCallback(e,t)}Object.defineProperties(oC.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}});var APe=new q;oC.prototype.getValue=function(e,t){return l(e)||(e=q.now(APe)),this._callback(e,t)};oC.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};oC.prototype.equals=function(e){return this===e||e instanceof oC&&this._callback===e._callback&&this._isConstant===e._isConstant};var Zm=oC;var q$t=T(S(),1);var Gie=new h;function rC(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 be,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(De.MINIMUM_VALUE,Gie);if(!l(r)||h.equals(r,h.ZERO)||!l(e.globe))return;this._position=h.clone(r,this._position),this._updateClamping(),this._normal=e.ellipsoid.geodeticSurfaceNormal(r,this._normal)}}Object.defineProperties(rC.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});rC.prototype._updateClamping=function(){l(this._removeCallbackFunc)&&this._removeCallbackFunc();let e=this._scene,t=this._position;if(h.equals(t,h.ZERO)){this._terrainHeight=0;return}let i=e.ellipsoid.cartesianToCartographic(t,this._cartographicPosition),o=e.getHeight(i,this._heightReference);l(o)?this._terrainHeight=o:this._terrainHeight=0;let r=s=>{this._terrainHeight=s.height,this.definitionChanged.raiseEvent()};this._removeCallbackFunc=e.updateHeight(i,r,this._heightReference)};var MPe=new q;rC.prototype.getValue=function(e,t){l(e)||(e=q.now(MPe));let n=K.getValueOrDefault(this._heightReference,e,Qe.NONE),i=K.getValueOrDefault(this._extrudedHeightReference,e,Qe.NONE);if(n===Qe.NONE&&!DS(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,Gie);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.ellipsoid.geodeticSurfaceNormal(r,this._normal);return h.multiplyByScalar(s,this._terrainHeight,t)};rC.prototype.isDestroyed=function(){return!1};rC.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),me(this)};var vx=rC;function NPe(e,t,n,i){if(ni.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 Zm(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new vx(this._scene,s,r)}}var Ip=NPe;var Eie=h.ZERO,Xie=new h,kPe=new h,Iie=new Y;function UPe(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function ud(e,t){ni.call(this,{entity:e,scene:t,geometryOptions:new UPe(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}l(Object.create)&&(ud.prototype=Object.create(ni.prototype),ud.prototype.constructor=ud);Object.defineProperties(ud.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});ud.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Nn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Yt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Iie)),l(a)||(a=Y.WHITE),s.color=Ht.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=zi.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,Eie,Xie))),new Vt({id:t,geometry:xl.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:s})};ud.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=K.getValueOrDefault(this._outlineColorProperty,e,Y.BLACK,Iie),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ht.fromColor(i),distanceDisplayCondition:Nn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=zi.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,Eie,Xie))),new Vt({id:t,geometry:xm.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:r})};ud.prototype._computeCenter=function(e,t){return K.getValueOrUndefined(this._entity.position,e,t)};ud.prototype._isHidden=function(e,t){return!l(t.dimensions)||!l(e.position)||ni.prototype._isHidden.call(this,e,t)};ud.prototype._isDynamic=function(e,t){return!e.position.isConstant||!K.isConstant(e.orientation)||!t.dimensions.isConstant||!K.isConstant(t.outlineWidth)};ud.prototype._setStaticOptions=function(e,t){let n=K.getValueOrDefault(t.heightReference,De.MINIMUM_VALUE,Qe.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Yt?dn.VERTEX_FORMAT:oo.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(De.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==Qe.NONE?ln.ALL:void 0};ud.prototype._onEntityPropertyChanged=Ip;ud.DynamicGeometryUpdater=sC;function sC(e,t,n){ti.call(this,e,t,n)}l(Object.create)&&(sC.prototype=Object.create(ti.prototype),sC.prototype.constructor=sC);sC.prototype._isHidden=function(e,t,n){let i=K.getValueOrUndefined(e.position,n,kPe),o=this._options.dimensions;return!l(i)||!l(o)||ti.prototype._isHidden.call(this,e,t,n)};sC.prototype._setOptions=function(e,t,n){let i=K.getValueOrDefault(t.heightReference,n,Qe.NONE),o=this._options;o.dimensions=K.getValueOrUndefined(t.dimensions,n,o.dimensions),o.offsetAttribute=i!==Qe.NONE?ln.ALL:void 0};var dX=ud;var JDn=T(S(),1);var MDn=T(S(),1);var Ien=T(S(),1),Pie=T(Wie(),1);var DPe=0,OO={};function jh(e,t){let n,i=e;l(OO[i])?n=OO[i]:(n=DPe++,OO[i]=n),t=y(t,!1),this._id=n,this._html=e,this._showOnScreen=t,this._element=void 0}Object.defineProperties(jh.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=Pie.default.sanitize(this._html),t=document.createElement("div");t.className="cesium-credit-wrapper",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}}});jh.equals=function(e,t){return e===t||l(e)&&l(t)&&e._id===t._id&&e._showOnScreen===t._showOnScreen};jh.prototype.equals=function(e){return jh.equals(this,e)};jh.prototype.isIon=function(){return this.html.indexOf("ion-credit.png")!==-1};jh.getIonCredit=function(e){let t=l(e.collapsible)&&!e.collapsible;return new jh(e.html,t)};jh.clone=function(e){if(l(e))return new jh(e.html,e.showOnScreen)};var Rt=jh;var Jen=T(S(),1);var Den=T(S(),1);function wx(e){this._url=e,this._cubeMapBuffers=void 0,this._texture=void 0,this._maximumMipmapLevel=void 0,this._loading=!1,this._ready=!1,this._errorEvent=new be}Object.defineProperties(wx.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}}});wx.isSupported=function(e){return(e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat)&&e.supportsTextureLod};function HO(e){e._cubeMapBuffers=void 0}wx.prototype.update=function(e){let{context:t}=e;if(!wx.isSupported(t))return;if(l(this._texture)){HO(this);return}if(!l(this._texture)&&!this._loading){let u=t.textureCache.getTexture(this._url);l(u)&&(HO(this),this._texture=u,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0)}let n=this._cubeMapBuffers;if(!l(n)&&!this._loading){let u=this;bl(this._url).then(function(m){u._cubeMapBuffers=m,u._loading=!1}).catch(function(m){u.isDestroyed()||u._errorEvent.raiseEvent(m)}),this._loading=!0}if(!l(this._cubeMapBuffers))return;let{pixelDatatype:i}=n[0].positiveX;l(i)||(i=t.halfFloatingPointTexture?nt.HALF_FLOAT:nt.FLOAT);let o=at.RGBA,r=n.length;this._maximumMipmapLevel=r-1;let s=n[0].positiveX.width,a=Math.log2(s)+1;if(r!==a){let u={};Object.values(Sa.FaceName).forEach(m=>{u[m]=void 0});for(let m=r;m<a;m++)n.push(u)}let c=new $t({minificationFilter:qt.LINEAR_MIPMAP_LINEAR}),d=new Sa({context:t,source:n[0],flipY:!1,pixelDatatype:i,pixelFormat:o,sampler:c});d.loadMipmaps(n.slice(1)),this._texture=d,this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture),this._ready=!0};wx.prototype.isDestroyed=function(){return!1};wx.prototype.destroy=function(){return HO(this),this._texture=this._texture&&this._texture.destroy(),me(this)};var Gm=wx;function uX(e){e=y(e,y.EMPTY_OBJECT);let t=l(e.imageBasedLightingFactor)?D.clone(e.imageBasedLightingFactor):new D(1,1);this._imageBasedLightingFactor=t;let n=y(e.luminanceAtZenith,.2);this._luminanceAtZenith=n;let i=e.sphericalHarmonicCoefficients;this._sphericalHarmonicCoefficients=i,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentCubeMap=void 0,this._specularEnvironmentCubeMapDirty=!0,this._specularEnvironmentMapLoaded=!1,this._previousSpecularEnvironmentMapLoaded=!1,this._useDefaultSpecularMaps=!1,this._useDefaultSphericalHarmonics=!1,this._shouldRegenerateShaders=!1,this._previousFrameNumber=void 0,this._previousImageBasedLightingFactor=D.clone(t),this._previousLuminanceAtZenith=n,this._previousSphericalHarmonicCoefficients=i,this._removeErrorListener=void 0}Object.defineProperties(uX.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){this._previousImageBasedLightingFactor=D.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=D.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._specularEnvironmentCubeMapDirty=this._specularEnvironmentCubeMapDirty||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}},specularEnvironmentCubeMap:{get:function(){return this._specularEnvironmentCubeMap}},useDefaultSpecularMaps:{get:function(){return this._useDefaultSpecularMaps}},useSpecularEnvironmentMaps:{get:function(){return l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready||this._useDefaultSpecularMaps}}});function BPe(e,t){if(Gm.isSupported(t)){if(e._specularEnvironmentCubeMap=e._specularEnvironmentCubeMap&&e._specularEnvironmentCubeMap.destroy(),l(e._specularEnvironmentMaps)){let n=new Gm(e._specularEnvironmentMaps);e._specularEnvironmentCubeMap=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}uX.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;D.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=D.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._specularEnvironmentCubeMapDirty&&(BPe(this,t),this._specularEnvironmentCubeMapDirty=!1),l(this._specularEnvironmentCubeMap)&&(this._specularEnvironmentCubeMap.update(e),this._specularEnvironmentCubeMap.ready&&(this._specularEnvironmentMapLoaded=!0));let o=!l(this._specularEnvironmentCubeMap)&&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._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)};uX.prototype.isDestroyed=function(){return!1};uX.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),me(this)};var Fx=uX;var ctn=T(S(),1),KO=T(td(),1);var etn=T(S(),1);var zO,vie="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIxMjY5YWQzZS04ZGIyLTRlMjEtYjcwNS1iYmY0NDNmN2E3ZjAiLCJpZCI6MjU5LCJpYXQiOjE3MjUzNzYwMzZ9.L0mzOLcquvnxOpG5DnqWQmivpRCwePDt3WAgzb8VlVA",NN={};NN.defaultAccessToken=vie;NN.defaultServer=new Ee({url:"https://api.cesium.com/"});NN.getDefaultTokenCredit=function(e){if(e===vie){if(!l(zO)){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>`;zO=new Rt(t,!0)}return zO}};var Em=NN;function kc(e,t){let n,i=e.externalType,o=l(i);if(!o)n={url:e.url,retryAttempts:1,retryCallback:YPe};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new ue("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");Ee.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=o?void 0:new KO.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)&&(kc.prototype=Object.create(Ee.prototype),kc.prototype.constructor=kc);kc.fromAssetId=function(e,t){let n=kc._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new kc(i,n)})};Object.defineProperties(kc.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=kc.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});kc.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(Rt.getIonCredit),i=Em.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(Rt.clone(i)),n};kc.prototype.clone=function(e){let t=y(this._ionRoot,this);return l(e)||(e=new kc(t._ionEndpoint,t._ionEndpointResource)),e=Ee.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};kc.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},l(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return Ee.prototype.fetchImage.call(this,e)};kc.prototype._makeRequest=function(e){return this._isExternal||new KO.default(this.url).authority()!==this._ionEndpointDomain?Ee.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),Ee.prototype._makeRequest.call(this,e))};kc._createEndpointResource=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=y(t.server,Em.defaultServer),i=y(t.accessToken,Em.defaultAccessToken);n=Ee.createIfNeeded(n);let o={url:`v1/assets/${e}/endpoint`};return l(i)&&(o.queryParameters={access_token:i}),n.getDerivedResource(o)};function YPe(e,t){let n=y(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 md=kc;var utn=T(S(),1);function qh(e){e=y(e,0),this._array=new Array(e),this._length=e}Object.defineProperties(qh.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}}});qh.prototype.get=function(e){return this._array[e]};qh.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};qh.prototype.peek=function(){return this._array[this._length-1]};qh.prototype.push=function(e){let t=this.length++;this._array[t]=e};qh.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};qh.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};qh.prototype.resize=function(e){this.length=e};qh.prototype.trim=function(e){e=y(e,this._length),this._array.length=e};var Uc=qh;var ptn=T(S(),1);var Wp={X:0,Y:1,Z:2};Wp.Y_UP_TO_Z_UP=F.fromRotationTranslation($.fromArray([1,0,0,0,0,1,0,-1,0]));Wp.Z_UP_TO_Y_UP=F.fromRotationTranslation($.fromArray([1,0,0,0,0,-1,0,1,0]));Wp.X_UP_TO_Z_UP=F.fromRotationTranslation($.fromArray([0,0,1,0,1,0,-1,0,0]));Wp.Z_UP_TO_X_UP=F.fromRotationTranslation($.fromArray([0,0,-1,0,1,0,1,0,0]));Wp.X_UP_TO_Y_UP=F.fromRotationTranslation($.fromArray([0,1,0,-1,0,0,0,0,1]));Wp.Y_UP_TO_X_UP=F.fromRotationTranslation($.fromArray([0,-1,0,1,0,0,0,0,1]));Wp.fromName=function(e){return Wp[e]};var Xo=Object.freeze(Wp);var ekn=T(S(),1);var ytn=T(S(),1);function wie(e){e=y(e,y.EMPTY_OBJECT),this._metadata=e.metadata}Object.defineProperties(wie.prototype,{metadata:{get:function(){return this._metadata}}});var Ax=wie;var Z9n=T(S(),1);var vtn=T(S(),1);var Rtn=T(S(),1);var Stn=T(S(),1);function kb(e,t,n){return t=y(t,0),n=y(n,e.byteLength-t),e=e.subarray(t,t+n),kb.decode(e)}kb.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};kb.decodeWithFromCharCode=function(e){let t="",n=OPe(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 mX(e,t,n){return t<=e&&e<=n}function OPe(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(mX(d,0,127)){s.push(d);continue}if(mX(d,194,223)){i=1,t=d&31;continue}if(mX(d,224,239)){d===224&&(o=160),d===237&&(r=159),i=2,t=d&15;continue}if(mX(d,240,244)){d===240&&(o=144),d===244&&(r=143),i=3,t=d&7;continue}throw new ue("String decoding failed.")}if(!mX(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"?kb.decode=kb.decodeWithTextDecoder:kb.decode=kb.decodeWithFromCharCode;var Vl=kb;function HPe(e,t){return t=y(t,0),Vl(e,t,Math.min(4,e.length))}var Xm=HPe;function pu(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(pu.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 hX=Uint32Array.BYTES_PER_ELEMENT;pu.fromTileType=async function(e,t,n,i,o,r){o=y(o,0);let s=new Uint8Array(i),a=new DataView(i);o+=hX;let c=a.getUint32(o,!0);if(c!==1)throw new ue(`Only Composite Tile version 1 is supported. Version ${c} is not.`);o+=hX,o+=hX;let d=a.getUint32(o,!0);o+=hX;let u=n.queryParameters.compositeIndex;l(u)?u=`${u}_`:u="";let m=[];m.length=d;for(let f=0;f<d;++f){let x=Xm(s,o),_=a.getUint32(o+hX*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 ue(`Unknown tile content type, ${x}, inside Composite tile`);o+=_}let p=await Promise.all(m);return new pu(e,t,n,p)};pu.prototype.hasProperty=function(e,t){return!1};pu.prototype.getFeature=function(e){};pu.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};pu.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};pu.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)};pu.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};pu.prototype.isDestroyed=function(){return!1};pu.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return me(this)};var fX=pu;var hon=T(S(),1);var Atn=T(S(),1);function zPe(e,t,n){return JSON.parse(Vl(e,t,n))}var Io=zPe;var Bnn=T(S(),1);var Qtn=T(S(),1);function oc(e){this._id=Bn();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,Dt.maximumTextureSize),r=Math.ceil(t/Dt.maximumTextureSize),s=1/o,a=s*.5,c=1/r,d=c*.5;n=new D(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(oc.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}}});oc.DEFAULT_COLOR_VALUE=Y.WHITE;oc.DEFAULT_SHOW_VALUE=!0;function Fie(e){let t=e._textureDimensions;return t.x*t.y*4}function Aie(e){if(!l(e._batchValues)){let t=Fie(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function Mie(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}oc.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=Mie(this),i=e*2,o=t?255:0;if(n[i]!==o){n[i]=o;let r=Aie(this),s=e*4+3;r[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};oc.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setShow(n,e)};oc.prototype.getShow=function(e){if(!l(this._showAlphaProperties))return!0;let t=e*2;return this._showAlphaProperties[t]===255};var KPe=new Array(4);oc.prototype.setColor=function(e,t){if(Y.equals(t,oc.DEFAULT_COLOR_VALUE)&&!l(this._batchValues))return;let n=t.toBytes(KPe),i=n[3],o=Aie(this),r=e*4,s=Mie(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)}};oc.prototype.setAllColor=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setColor(n,e)};oc.prototype.getColor=function(e,t){if(!l(this._batchValues))return Y.clone(oc.DEFAULT_COLOR_VALUE,t);let n=this._batchValues,i=e*4,o=this._showAlphaProperties,r=e*2;return Y.fromBytes(n[i],n[i+1],n[i+2],o[r+1],t)};oc.prototype.getPickColor=function(e){return this._pickIds[e]};function Nie(e,t,n){let i=e._textureDimensions;return new Ft({context:t,pixelFormat:at.RGBA,pixelDatatype:nt.UNSIGNED_BYTE,source:{width:i.x,height:i.y,arrayBufferView:n},flipY:!1,sampler:$t.NEAREST})}function JPe(e,t){let n=e._featuresLength;if(!l(e._pickTexture)&&n>0){let i=e._pickIds,o=Fie(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]=Y.floatToByte(u.red),r[m+1]=Y.floatToByte(u.green),r[m+2]=Y.floatToByte(u.blue),r[m+3]=Y.floatToByte(u.alpha)}e._pickTexture=Nie(e,t,r),l(a)&&(a.batchTableByteLength+=e._pickTexture.sizeInBytes)}}function QPe(e){let t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}oc.prototype.update=function(e,t){let n=t.context;this._defaultTexture=n.defaultTexture;let i=t.passes;(i.pick||i.postProcess)&&JPe(this,n),this._batchValuesDirty&&(this._batchValuesDirty=!1,l(this._batchTexture)||(this._batchTexture=Nie(this,n,this._batchValues),l(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),QPe(this))};oc.prototype.isDestroyed=function(){return!1};oc.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 me(this)};var Dc=oc;var pnn=T(S(),1);var rnn=T(S(),1);var jPe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},qPe={SCALAR:void 0,VEC2:D,VEC3:h,VEC4:se,MAT2:Qi,MAT3:$,MAT4:F};function $Pe(e){let t=e.componentType,n;typeof t=="string"?n=Q.fromName(t):n=t;let i=jPe[e.type],o=qPe[e.type];return{componentsPerAttribute:i,classType:o,createArrayBufferView:function(r,s,a){return Q.createArrayBufferView(n,r,s,i*a)}}}var hd=$Pe;function Pp(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,eve(this,e.extension,e.binaryBody)}Object.defineProperties(Pp.prototype,{byteLength:{get:function(){return this._byteLength}}});function eve(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=y(c.componentType,Q.UNSIGNED_SHORT),c.type=on.SCALAR,r=hd(c),c=r.createArrayBufferView(n.buffer,n.byteOffset+c.byteOffset,s),p+=c.byteLength);let g;if(l(d)){for(l(d.byteOffset)&&(d.componentType=y(d.componentType,Q.UNSIGNED_SHORT),d.type=on.SCALAR,r=hd(d),d=r.createArrayBufferView(n.buffer,n.byteOffset+d.byteOffset,s),p+=d.byteLength),g=new Uint16Array(s),m=0,i=0;i<s;++i)g[i]=m,m+=d[i];p+=g.byteLength}l(u)&&l(u.byteOffset)&&(u.componentType=y(u.componentType,Q.UNSIGNED_SHORT),u.type=on.SCALAR,r=hd(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=tve(C,V,n);p+=nve(L),a[i].instances=_t(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=g,e._parentIds=u,e._byteLength=p}function tve(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 ue("componentType is required.");if(!l(c))throw new ue("type is required.");if(!l(n))throw new ue(`Property ${o} requires a batch table binary.`);let d=hd(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 nve(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}var ive=[],ove=[],rve=0;function sve(e,t,n){let i=e._classIds,o=e._parentCounts,r=e._parentIds,s=e._parentIndexes,a=i.length,c=ive;c.length=Math.max(c.length,a);let d=++rve,u=ove;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],g=s[t];for(let f=0;f<p;++f){let x=r[g+f];x!==t&&u.push(x)}}}function ave(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 pX(e,t,n){let i=e._parentCounts,o=e._parentIds;if(l(o)){if(l(i))return sve(e,t,n)}else return n(e,t);return ave(e,t,n)}Pp.prototype.hasProperty=function(e,t){let n=pX(this,e,function(i,o){let r=i._classIds[o],s=i._classes[r].instances;if(l(s[t]))return!0});return l(n)};Pp.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};Pp.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,pX(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};Pp.prototype.getProperty=function(e,t){return pX(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)?cve(a,s):Ye(a[s],!0)})};function cve(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}Pp.prototype.setProperty=function(e,t,n){let i=pX(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)?lve(d,c,n):d[c]=Ye(n,!0),!0});return l(i)};function lve(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}Pp.prototype.isClass=function(e,t){let n=pX(this,e,function(i,o){let r=i._classIds[o];if(i._classes[r].name===t)return!0});return l(n)};Pp.prototype.getClassName=function(e){let t=this._classIds[e];return this._classes[t].name};var Mx=Pp;var gnn=T(S(),1),dve={HIGHLIGHT:0,REPLACE:1,MIX:2},Ll=Object.freeze(dve);var JO=Dc.DEFAULT_COLOR_VALUE,QO=Dc.DEFAULT_SHOW_VALUE;function lo(e,t,n,i,o){this.featuresLength=t;let r;l(n)&&(r=n.extensions),this._extensions=y(r,{});let s=uve(n);this._properties=s,this._batchTableHierarchy=mve(this,n,i);let a=Uie(t,s,i);this._binaryPropertiesByteLength=hve(a),this._batchTableBinaryProperties=a,this._content=e,this._batchTexture=new Dc({featuresLength:t,colorChangedCallback:o,owner:e,statistics:e.tileset.statistics})}lo._deprecationWarning=Es;Object.defineProperties(lo.prototype,{batchTableByteLength:{get:function(){let e=this._binaryPropertiesByteLength;return l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e+=this._batchTexture.byteLength,e}}});function uve(e){let t={};if(!l(e))return t;for(let n in e)e.hasOwnProperty(n)&&n!=="HIERARCHY"&&n!=="extensions"&&n!=="extras"&&(t[n]=Ye(e[n],!0));return t}function mve(e,t,n){if(!l(t))return;let i=e._extensions["3DTILES_batch_table_hierarchy"],o=t.HIERARCHY;if(l(o)&&(lo._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 Mx({extension:i,binaryBody:n})}function Uie(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 ue("componentType is required.");if(!l(c))throw new ue("type is required.");if(!l(n))throw new ue(`Property ${o} requires a batch table binary.`);let d=hd(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 hve(e){if(!l(e))return 0;let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}lo.getBinaryProperties=function(e,t,n){return Uie(e,t,n)};lo.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};lo.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};lo.prototype.getShow=function(e){return this._batchTexture.getShow(e)};lo.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};lo.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};lo.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};lo.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};var fve=new Y;lo.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(JO),this.setAllShow(QO);return}let t=this._content,n=this.featuresLength;for(let i=0;i<n;++i){let o=t.getFeature(i),r=l(e.color)?y(e.color.evaluateColor(o,fve),JO):JO,s=l(e.show)?y(e.show.evaluate(o),QO):QO;this.setColor(i,r),this.setShow(i,s)}};function pve(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}function bve(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}lo.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};lo.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};lo.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};lo.prototype.hasProperty=function(e,t){return l(this._properties[t])||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)};lo.prototype.hasPropertyBySemantic=function(){return!1};lo.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};lo.prototype.getPropertyBySemantic=function(e,t){};lo.prototype.getProperty=function(e,t){if(l(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if(l(i))return pve(i,e)}let n=this._properties[t];if(l(n))return Ye(n[e],!0);if(l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getProperty(e,t);if(l(i))return i}};lo.prototype.setProperty=function(e,t,n){let i=this.featuresLength;if(l(this._batchTableBinaryProperties)){let r=this._batchTableBinaryProperties[t];if(l(r)){bve(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]=Ye(n,!0)};function gve(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)); 
} 
`}lo.prototype.getVertexShaderCallback=function(e,t,n){if(this.featuresLength===0)return;let i=this;return function(o){let r=Die(o,n,!1),s;return Dt.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}
${gve(i)}${s}`}};function kie(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 yve(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 Die(e,t,n){if(!l(t))return kie(e,n);let i=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`),o=e.match(i);if(!l(o))return kie(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=yve(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}lo.prototype.getFragmentShaderCallback=function(e,t,n){if(this.featuresLength!==0)return function(i){return i=Die(i,t,!0),Dt.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}};lo.prototype.getClassificationFragmentShaderCallback=function(){if(this.featuresLength!==0)return function(e){return e=Oe.replaceMain(e,"tile_main"),Dt.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 xve(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===Ll.HIGHLIGHT)return 0;if(n===Ll.REPLACE)return 1;if(n===Ll.MIX)return W.clamp(i,W.EPSILON4,1)}lo.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return _t(t,{tile_batchTexture:function(){return y(e._batchTexture.batchTexture,e._batchTexture.defaultTexture)},tile_textureDimensions:function(){return e._batchTexture.textureDimensions},tile_textureStep:function(){return e._batchTexture.textureStep},tile_colorBlend:function(){return xve(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};lo.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var Ub={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};lo.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=_ve(this);for(let d=t;d<i;++d){let u=n[d];if(u.pass===Re.COMPUTE)continue;let m=u.derivedCommands.tileset;(!l(m)||u.dirty)&&(m={},u.derivedCommands.tileset=m,m.originalCommand=Tve(u),u.dirty=!1);let p=m.originalCommand;c!==Ub.ALL_OPAQUE&&u.pass!==Re.TRANSLUCENT&&(l(m.translucent)||(m.translucent=Sve(p))),c!==Ub.ALL_TRANSLUCENT&&u.pass!==Re.TRANSLUCENT&&(l(m.opaque)||(m.opaque=Cve(p)),a&&(r||(l(m.zback)||(m.zback=Lve(e.context,p)),s._backfaceCommands.push(m.zback)),(!l(m.stencil)||o._selectionDepth!==Zve(m.stencil))&&(u.renderState.depthMask?m.stencil=Rve(p,o._selectionDepth):m.stencil=m.opaque)));let g=a?m.stencil:m.opaque,f=m.translucent;u.pass!==Re.TRANSLUCENT?(c===Ub.ALL_OPAQUE&&(n[d]=g),c===Ub.ALL_TRANSLUCENT&&(n[d]=f),c===Ub.OPAQUE_AND_TRANSLUCENT&&(n[d]=g,n.push(f))):n[d]=p}};function _ve(e){let t=e._batchTexture.translucentFeaturesLength;return t===0?Ub.ALL_OPAQUE:t===e.featuresLength?Ub.ALL_TRANSLUCENT:Ub.OPAQUE_AND_TRANSLUCENT}function Tve(e){let t=tt.shallowClone(e),n=t.pass===Re.TRANSLUCENT;return t.uniformMap=l(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return n},t}function Sve(e){let t=tt.shallowClone(e);return t.pass=Re.TRANSLUCENT,t.renderState=Gve(e.renderState),t}function Cve(e){let t=tt.shallowClone(e);return t.renderState=Eve(e.renderState),t}function Vve(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 Lve(e,t){let n=tt.shallowClone(t),i=Ye(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=Bt.setCesium3DTileBit(),i.stencilMask=Bt.CESIUM_3D_TILE_MASK,n.renderState=Ue.fromCache(i),n.castShadows=!1,n.receiveShadows=!1,n.uniformMap=Ye(t.uniformMap);let o=new D(5,5);return n.uniformMap.u_polygonOffset=function(){return o},n.shaderProgram=Vve(e,t.shaderProgram),n}function Rve(e,t){let n=tt.shallowClone(e),i=Ye(n.renderState,!0);return i.stencilTest.enabled=!0,i.stencilTest.mask=Bt.SKIP_LOD_MASK,i.stencilTest.reference=Bt.CESIUM_3D_TILE_MASK|t<<Bt.SKIP_LOD_BIT_SHIFT,i.stencilTest.frontFunction=Un.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=bt.REPLACE,i.stencilTest.backFunction=Un.GREATER_OR_EQUAL,i.stencilTest.backOperation.zPass=bt.REPLACE,i.stencilMask=Bt.CESIUM_3D_TILE_MASK|Bt.SKIP_LOD_MASK,n.renderState=Ue.fromCache(i),n}function Zve(e){return(e.renderState.stencilTest.reference&Bt.SKIP_LOD_MASK)>>>Bt.SKIP_LOD_BIT_SHIFT}function Gve(e){let t=Ye(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=un.ALPHA_BLEND,t.stencilTest=Bt.setCesium3DTileBit(),t.stencilMask=Bt.CESIUM_3D_TILE_MASK,Ue.fromCache(t)}function Eve(e){let t=Ye(e,!0);return t.stencilTest=Bt.setCesium3DTileBit(),t.stencilMask=Bt.CESIUM_3D_TILE_MASK,Ue.fromCache(t)}lo.prototype.update=function(e,t){this._batchTexture.update(e,t)};lo.prototype.isDestroyed=function(){return!1};lo.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),me(this)};var vp=lo;var non=T(S(),1);var Onn=T(S(),1);function Xve(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var $h=Xve;var Bin=T(S(),1);var znn=T(S(),1),aC=`in vec3 position;
in float a_batchId;

uniform mat4 u_modifiedModelViewProjection;

void main()
{
    gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0));
}
`;var jnn=T(S(),1);function bu(e,t){this._content=e,this._batchId=t,this._color=void 0}Object.defineProperties(bu.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 Y),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)}}});bu.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};bu.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};bu.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};bu.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)}};bu.prototype.getPropertyInherited=function(e){return bu.getPropertyInherited(this._content,this._batchId,e)};bu.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};bu.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};bu.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};bu.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var vs=bu;var hin=T(S(),1);var ein=T(S(),1),jO=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)})}},qO=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)})}},Rl=class e{static get version(){return"1.3.9"}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()},t.property||this.throwError('Unexpected "'+this.char+'"'),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)}}},Ive=new jO;Object.assign(Rl,{hooks:Ive,plugins:new qO(Rl),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"});Rl.max_unop_len=Rl.getMaxKeyLen(Rl.unary_ops);Rl.max_binop_len=Rl.getMaxKeyLen(Rl.binary_ops);var Db=e=>new Rl(e).parse(),Wve=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(Rl).filter(e=>!Wve.includes(e)&&Db[e]===void 0).forEach(e=>{Db[e]=Rl[e]});Db.Jsep=Rl;var Pve="ConditionalExpression",vve={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:Pve,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 :")}})}};Db.plugins.register(vve);var nin=T(S(),1),wve={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},gt=Object.freeze(wve);function Im(e,t){this._expression=e,e=Kve(e,t),e=Qve(Jve(e)),Db.addBinaryOp("=~",0),Db.addBinaryOp("!~",0);let n;try{n=Db(e)}catch(i){throw new ue(i)}this._runtimeAst=Si(this,n)}Object.defineProperties(Im.prototype,{expression:{get:function(){return this._expression}}});var vn={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new D],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 D),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++]}};Im.prototype.evaluate=function(e,t){vn.reset();let n=this._runtimeAst.evaluate(e);return t instanceof Y&&n instanceof se?Y.fromCartesian4(n,t):n instanceof D||n instanceof h||n instanceof se?n.clone(t):n};Im.prototype.evaluateColor=function(e,t){vn.reset();let n=this._runtimeAst.evaluate(e);return Y.fromCartesian4(n,t)};Im.prototype.getShaderFunction=function(e,t,n,i){let o=this.getShaderExpression(t,n);return o=`${i} ${e}
{
    return ${o};
}
`,o};Im.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};Im.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var Fve=["!","-","+"],Bie=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],DN=/\${(.*?)}/g,Ave=/\\/g,Mve="@#%",Nve=/@#%/g,BN=new Y,YN={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(Uve),log:ws(Math.log),log2:ws(Dve),fract:ws(kve),length:Bve,normalize:Yve},ON={atan2:kN(Math.atan2,!1),pow:kN(Math.pow,!1),min:kN(Math.min,!0),max:kN(Math.max,!0),distance:Ove,dot:Hve,cross:zve},tH={clamp:Yie(W.clamp,!0),mix:Yie(W.lerp,!0)};function kve(e){return e-Math.floor(e)}function Uve(e){return Math.pow(2,e)}function Dve(e){return W.log2(e)}function ws(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof D)return D.fromElements(e(n.x),e(n.y),vn.getCartesian2());if(n instanceof h)return h.fromElements(e(n.x),e(n.y),e(n.z),vn.getCartesian3());if(n instanceof se)return se.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),vn.getCartesian4());throw new ue(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function kN(e,t){return function(n,i,o){if(t&&typeof o=="number"){if(typeof i=="number")return e(i,o);if(i instanceof D)return D.fromElements(e(i.x,o),e(i.y,o),vn.getCartesian2());if(i instanceof h)return h.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),vn.getCartesian3());if(i instanceof se)return se.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),e(i.w,o),vn.getCartesian4())}if(typeof i=="number"&&typeof o=="number")return e(i,o);if(i instanceof D&&o instanceof D)return D.fromElements(e(i.x,o.x),e(i.y,o.y),vn.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),vn.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),vn.getCartesian4());throw new ue(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${o}.`)}}function Yie(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 D&&o instanceof D)return D.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),vn.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),vn.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),vn.getCartesian4())}if(typeof i=="number"&&typeof o=="number"&&typeof r=="number")return e(i,o,r);if(i instanceof D&&o instanceof D&&r instanceof D)return D.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),vn.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),vn.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),vn.getCartesian4());throw new ue(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${o}, and ${r}.`)}}function Bve(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof D)return D.magnitude(t);if(t instanceof h)return h.magnitude(t);if(t instanceof se)return se.magnitude(t);throw new ue(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function Yve(e,t){if(typeof t=="number")return 1;if(t instanceof D)return D.normalize(t,vn.getCartesian2());if(t instanceof h)return h.normalize(t,vn.getCartesian3());if(t instanceof se)return se.normalize(t,vn.getCartesian4());throw new ue(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function Ove(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof D&&n instanceof D)return D.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 ue(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function Hve(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof D&&n instanceof D)return D.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 ue(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function zve(e,t,n){if(t instanceof h&&n instanceof h)return h.cross(t,n,vn.getCartesian3());throw new ue(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function Tt(e,t,n,i,o){this._type=e,this._value=t,this._left=n,this._right=i,this._test=o,this.evaluate=void 0,swe(this)}function Kve(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 Jve(e){return e.replace(Ave,Mve)}function eH(e){return e.replace(Nve,"\\")}function Qve(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 ue("Unmatched {.");n+=`czm_${t.substr(i+2,a-(i+2))}`,t=t.substr(a+1),i=t.indexOf("${")}}return n+=t,n}function jve(e){let t=typeof e.value;if(e.value===null)return new Tt(gt.LITERAL_NULL,null);if(t==="boolean")return new Tt(gt.LITERAL_BOOLEAN,e.value);if(t==="number")return new Tt(gt.LITERAL_NUMBER,e.value);if(t==="string")return e.value.indexOf("${")>=0?new Tt(gt.VARIABLE_IN_STRING,e.value):new Tt(gt.LITERAL_STRING,eH(e.value))}function qve(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 ue(`${o} is not a function.`);return i===0?o==="test"?new Tt(gt.LITERAL_BOOLEAN,!1):new Tt(gt.LITERAL_NULL,null):(s=Si(e,c),a=Si(e,n[0]),new Tt(gt.FUNCTION_CALL,o,s,a))}else if(o==="toString")return r=Si(e,c),new Tt(gt.FUNCTION_CALL,o,r);throw new ue(`Unexpected function call "${o}".`)}if(o=t.callee.name,o==="color"){if(i===0)return new Tt(gt.LITERAL_COLOR,o);if(r=Si(e,n[0]),l(n[1])){let c=Si(e,n[1]);return new Tt(gt.LITERAL_COLOR,o,[r,c])}return new Tt(gt.LITERAL_COLOR,o,[r])}else if(o==="rgb"||o==="hsl"){if(i<3)throw new ue(`${o} requires three arguments.`);return r=[Si(e,n[0]),Si(e,n[1]),Si(e,n[2])],new Tt(gt.LITERAL_COLOR,o,r)}else if(o==="rgba"||o==="hsla"){if(i<4)throw new ue(`${o} requires four arguments.`);return r=[Si(e,n[0]),Si(e,n[1]),Si(e,n[2]),Si(e,n[3])],new Tt(gt.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 Tt(gt.LITERAL_VECTOR,o,r)}else{if(o==="isNaN"||o==="isFinite")return i===0?o==="isNaN"?new Tt(gt.LITERAL_BOOLEAN,!0):new Tt(gt.LITERAL_BOOLEAN,!1):(r=Si(e,n[0]),new Tt(gt.UNARY,o,r));if(o==="isExactClass"||o==="isClass"){if(i<1||i>1)throw new ue(`${o} requires exactly one argument.`);return r=Si(e,n[0]),new Tt(gt.UNARY,o,r)}else if(o==="getExactClassName"){if(i>0)throw new ue(`${o} does not take any argument.`);return new Tt(gt.UNARY,o)}else if(l(YN[o])){if(i!==1)throw new ue(`${o} requires exactly one argument.`);return r=Si(e,n[0]),new Tt(gt.UNARY,o,r)}else if(l(ON[o])){if(i!==2)throw new ue(`${o} requires exactly two arguments.`);return s=Si(e,n[0]),a=Si(e,n[1]),new Tt(gt.BINARY,o,s,a)}else if(l(tH[o])){if(i!==3)throw new ue(`${o} requires exactly three arguments.`);s=Si(e,n[0]),a=Si(e,n[1]);let c=Si(e,n[2]);return new Tt(gt.TERNARY,o,s,a,c)}else{if(o==="Boolean")return i===0?new Tt(gt.LITERAL_BOOLEAN,!1):(r=Si(e,n[0]),new Tt(gt.UNARY,o,r));if(o==="Number")return i===0?new Tt(gt.LITERAL_NUMBER,0):(r=Si(e,n[0]),new Tt(gt.UNARY,o,r));if(o==="String")return i===0?new Tt(gt.LITERAL_STRING,""):(r=Si(e,n[0]),new Tt(gt.UNARY,o,r));if(o==="regExp")return $ve(e,t)}}throw new ue(`Unexpected function call "${o}".`)}function $ve(e,t){let n=t.arguments;if(n.length===0)return new Tt(gt.LITERAL_REGEX,new RegExp);let i=Si(e,n[0]),o;if(n.length>1){let r=Si(e,n[1]);if($O(i)&&$O(r)){try{o=new RegExp(eH(String(i._value)),r._value)}catch(s){throw new ue(s)}return new Tt(gt.LITERAL_REGEX,o)}return new Tt(gt.REGEX,i,r)}if($O(i)){try{o=new RegExp(eH(String(i._value)))}catch(r){throw new ue(r)}return new Tt(gt.LITERAL_REGEX,o)}return new Tt(gt.REGEX,i)}function ewe(e){if(owe(e.name)){let t=rwe(e.name);return t.substr(0,8)==="tiles3d_"?new Tt(gt.BUILTIN_VARIABLE,t):new Tt(gt.VARIABLE,t)}else{if(e.name==="NaN")return new Tt(gt.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new Tt(gt.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new Tt(gt.LITERAL_UNDEFINED,void 0)}throw new ue(`${e.name} is not defined.`)}function twe(e){let t=e.property.name;if(t==="PI")return new Tt(gt.LITERAL_NUMBER,Math.PI);if(t==="E")return new Tt(gt.LITERAL_NUMBER,Math.E)}function nwe(e){if(e.property.name==="POSITIVE_INFINITY")return new Tt(gt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function iwe(e,t){if(t.object.name==="Math")return twe(t);if(t.object.name==="Number")return nwe(t);let n,i=Si(e,t.object);return t.computed?(n=Si(e,t.property),new Tt(gt.MEMBER,"brackets",i,n)):(n=new Tt(gt.LITERAL_STRING,t.property.name),new Tt(gt.MEMBER,"dot",i,n))}function $O(e){return e._type>=gt.LITERAL_NULL}function owe(e){return e.substr(0,4)==="czm_"}function rwe(e){return e.substr(4)}function Si(e,t){let n,i,o,r;if(t.type==="Literal")n=jve(t);else if(t.type==="CallExpression")n=qve(e,t);else if(t.type==="Identifier")n=ewe(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=Si(e,t.argument);if(Fve.indexOf(i)>-1)n=new Tt(gt.UNARY,i,s);else throw new ue(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,o=Si(e,t.left),r=Si(e,t.right),Bie.indexOf(i)>-1)n=new Tt(gt.BINARY,i,o,r);else throw new ue(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,o=Si(e,t.left),r=Si(e,t.right),Bie.indexOf(i)>-1&&(n=new Tt(gt.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 Tt(gt.CONDITIONAL,"?",o,r,s)}else if(t.type==="MemberExpression")n=iwe(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 Tt(gt.ARRAY,s)}else throw t.type==="Compound"?new ue("Provide exactly one expression."):new ue("Cannot parse expression.");return n}function swe(e){e._type===gt.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===gt.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===gt.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(YN[e._value])&&(e.evaluate=cwe(e._value)):e._type===gt.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(ON[e._value])&&(e.evaluate=lwe(e._value)):e._type===gt.TERNARY?e.evaluate=dwe(e._value):e._type===gt.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===gt.ARRAY?e.evaluate=e._evaluateArray:e._type===gt.VARIABLE?e.evaluate=e._evaluateVariable:e._type===gt.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===gt.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===gt.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===gt.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===gt.REGEX?e.evaluate=e._evaluateRegExp:e._type===gt.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=awe):e.evaluate=e._evaluateLiteral}function awe(e){return l(e)?e.content.tileset.timeSinceLoad:0}function cwe(e){let t=YN[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function lwe(e){let t=ON[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n);return t(e,i,o)}}function dwe(e){let t=tH[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 HN(e,t){if(l(e))return e.getPropertyInherited(t)}Tt.prototype._evaluateLiteral=function(){return this._value};Tt.prototype._evaluateLiteralColor=function(e){let t=BN,n=this._left;if(this._value==="color")l(n)?n.length>1?(Y.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):Y.fromCssColorString(n[0].evaluate(e),t):Y.fromBytes(255,255,255,255,t);else if(this._value==="rgb")Y.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;Y.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?Y.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&Y.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return se.fromColor(t,vn.getCartesian4())};Tt.prototype._evaluateLiteralVector=function(e){let t=vn.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 D)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 ue(`${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 ue(`Invalid ${n} constructor. No valid arguments.`);if(r<s&&r>1)throw new ue(`Invalid ${n} constructor. Not enough arguments.`);if(r>s&&o>1)throw new ue(`Invalid ${n} constructor. Too many arguments.`);if(r===1){let a=t[0];t.push(a,a,a)}if(n==="vec2")return D.fromArray(t,0,vn.getCartesian2());if(n==="vec3")return h.fromArray(t,0,vn.getCartesian3());if(n==="vec4")return se.fromArray(t,0,vn.getCartesian4())};Tt.prototype._evaluateLiteralString=function(){return this._value};Tt.prototype._evaluateVariableString=function(e){let t=this._value,n=DN.exec(t);for(;n!==null;){let i=n[0],o=n[1],r=HN(e,o);l(r)||(r=""),t=t.replace(i,r),n=DN.exec(t)}return t};Tt.prototype._evaluateVariable=function(e){return HN(e,this._value)};function Nx(e){return e._value==="feature"}Tt.prototype._evaluateMemberDot=function(e){if(Nx(this._left))return HN(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof D||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]};Tt.prototype._evaluateMemberBrackets=function(e){if(Nx(this._left))return HN(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof D||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]};Tt.prototype._evaluateArray=function(e){let t=[];for(let n=0;n<this._value.length;n++)t[n]=this._value[n].evaluate(e);return t};Tt.prototype._evaluateNot=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new ue(`Operator "!" requires a boolean argument. Argument is ${t}.`);return!t};Tt.prototype._evaluateNegative=function(e){let t=this._left.evaluate(e);if(t instanceof D)return D.negate(t,vn.getCartesian2());if(t instanceof h)return h.negate(t,vn.getCartesian3());if(t instanceof se)return se.negate(t,vn.getCartesian4());if(typeof t=="number")return-t;throw new ue(`Operator "-" requires a vector or number argument. Argument is ${t}.`)};Tt.prototype._evaluatePositive=function(e){let t=this._left.evaluate(e);if(!(t instanceof D||t instanceof h||t instanceof se||typeof t=="number"))throw new ue(`Operator "+" requires a vector or number argument. Argument is ${t}.`);return t};Tt.prototype._evaluateLessThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new ue(`Operator "<" requires number arguments. Arguments are ${t} and ${n}.`);return t<n};Tt.prototype._evaluateLessThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new ue(`Operator "<=" requires number arguments. Arguments are ${t} and ${n}.`);return t<=n};Tt.prototype._evaluateGreaterThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new ue(`Operator ">" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};Tt.prototype._evaluateGreaterThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new ue(`Operator ">=" requires number arguments. Arguments are ${t} and ${n}.`);return t>=n};Tt.prototype._evaluateOr=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new ue(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new ue(`Operator "||" requires boolean arguments. Second argument is ${n}.`);return t||n};Tt.prototype._evaluateAnd=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new ue(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new ue(`Operator "&&" requires boolean arguments. Second argument is ${n}.`);return t&&n};Tt.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof D&&t instanceof D)return D.add(t,n,vn.getCartesian2());if(n instanceof h&&t instanceof h)return h.add(t,n,vn.getCartesian3());if(n instanceof se&&t instanceof se)return se.add(t,n,vn.getCartesian4());if(typeof t=="string"||typeof n=="string")return t+n;if(typeof t=="number"&&typeof n=="number")return t+n;throw new ue(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${n}.`)};Tt.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof D&&t instanceof D)return D.subtract(t,n,vn.getCartesian2());if(n instanceof h&&t instanceof h)return h.subtract(t,n,vn.getCartesian3());if(n instanceof se&&t instanceof se)return se.subtract(t,n,vn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new ue(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Tt.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof D&&t instanceof D)return D.multiplyComponents(t,n,vn.getCartesian2());if(n instanceof D&&typeof t=="number")return D.multiplyByScalar(n,t,vn.getCartesian2());if(t instanceof D&&typeof n=="number")return D.multiplyByScalar(t,n,vn.getCartesian2());if(n instanceof h&&t instanceof h)return h.multiplyComponents(t,n,vn.getCartesian3());if(n instanceof h&&typeof t=="number")return h.multiplyByScalar(n,t,vn.getCartesian3());if(t instanceof h&&typeof n=="number")return h.multiplyByScalar(t,n,vn.getCartesian3());if(n instanceof se&&t instanceof se)return se.multiplyComponents(t,n,vn.getCartesian4());if(n instanceof se&&typeof t=="number")return se.multiplyByScalar(n,t,vn.getCartesian4());if(t instanceof se&&typeof n=="number")return se.multiplyByScalar(t,n,vn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new ue(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${n}.`)};Tt.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof D&&t instanceof D)return D.divideComponents(t,n,vn.getCartesian2());if(t instanceof D&&typeof n=="number")return D.divideByScalar(t,n,vn.getCartesian2());if(n instanceof h&&t instanceof h)return h.divideComponents(t,n,vn.getCartesian3());if(t instanceof h&&typeof n=="number")return h.divideByScalar(t,n,vn.getCartesian3());if(n instanceof se&&t instanceof se)return se.divideComponents(t,n,vn.getCartesian4());if(t instanceof se&&typeof n=="number")return se.divideByScalar(t,n,vn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new ue(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${n}.`)};Tt.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof D&&t instanceof D)return D.fromElements(t.x%n.x,t.y%n.y,vn.getCartesian2());if(n instanceof h&&t instanceof h)return h.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,vn.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,vn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t%n;throw new ue(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Tt.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof D&&t instanceof D||n instanceof h&&t instanceof h||n instanceof se&&t instanceof se?t.equals(n):t===n};Tt.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof D&&t instanceof D||n instanceof h&&t instanceof h||n instanceof se&&t instanceof se?!t.equals(n):t!==n};Tt.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new ue(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)};Tt.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};Tt.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};Tt.prototype._evaluateIsExactClass=function(e){return l(e)?e.isExactClass(this._left.evaluate(e)):!1};Tt.prototype._evaluateIsClass=function(e){return l(e)?e.isClass(this._left.evaluate(e)):!1};Tt.prototype._evaluateGetExactClassName=function(e){if(l(e))return e.getExactClassName()};Tt.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};Tt.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};Tt.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};Tt.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 ue(o)}return i};Tt.prototype._evaluateRegExpTest=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new ue(`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)};Tt.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 ue(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Tt.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 ue(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Tt.prototype._evaluateRegExpExec=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new ue(`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};Tt.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof D||t instanceof h||t instanceof se)return String(t);throw new ue(`Unexpected function call "${this._value}".`)};function Oie(e){let t=e._left,n=t.length;for(let a=0;a<n;++a)if(t[a]._type!==gt.LITERAL_NUMBER)return;let i=t[0]._value,o=t[1]._value,r=t[2]._value,s=n===4?t[3]._value:1;return Y.fromHsl(i,o,r,s,BN)}function Hie(e){let t=e._left,n=t.length;for(let o=0;o<n;++o)if(t[o]._type!==gt.LITERAL_NUMBER)return;let i=BN;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 Bb(e){return e%1===0?e.toFixed(1):e.toString()}function uwe(e){let t=Bb(e.red),n=Bb(e.green),i=Bb(e.blue);return`vec3(${t}, ${n}, ${i})`}function UN(e){let t=Bb(e.red),n=Bb(e.green),i=Bb(e.blue),o=Bb(e.alpha);return`vec4(${t}, ${n}, ${i}, ${o})`}function zie(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 Kie(e,t){return l(t[e])?t[e]:Im.NULL_SENTINEL}Im.NULL_SENTINEL="czm_infinity";Tt.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=zie(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=zie(this._value,e,t,this));let d,u,m;switch(a){case gt.VARIABLE:return Nx(this)?void 0:Kie(c,e);case gt.UNARY:if(c==="Boolean")return`bool(${o})`;if(c==="Number")return`float(${o})`;if(c==="round")return`floor(${o} + 0.5)`;if(l(YN[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 ue(`Error generating style shader: "${c}" is not supported.`);return c+o;case gt.BINARY:return c==="%"?`mod(${o}, ${r})`:c==="==="?`(${o} == ${r})`:c==="!=="?`(${o} != ${r})`:c==="atan2"?`atan(${o}, ${r})`:l(ON[c])?`${c}(${o}, ${r})`:`(${o} ${c} ${r})`;case gt.TERNARY:if(l(tH[c]))return`${c}(${o}, ${r}, ${s})`;break;case gt.CONDITIONAL:return`(${s} ? ${o} : ${r})`;case gt.MEMBER:return Nx(this._left)?Kie(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 gt.FUNCTION_CALL:throw new ue(`Error generating style shader: "${c}" is not supported.`);case gt.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 ue("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case gt.REGEX:throw new ue("Error generating style shader: Regular expressions are not supported.");case gt.VARIABLE_IN_STRING:throw new ue("Error generating style shader: Converting a variable to a string is not supported.");case gt.LITERAL_NULL:return Im.NULL_SENTINEL;case gt.LITERAL_BOOLEAN:return c?"true":"false";case gt.LITERAL_NUMBER:return Bb(c);case gt.LITERAL_STRING:if(l(n)&&n._type===gt.MEMBER&&(c==="r"||c==="g"||c==="b"||c==="a"||c==="x"||c==="y"||c==="z"||c==="w"||Nx(n._left)))return c;if(i=Y.fromCssColorString(c,BN),l(i))return uwe(i);throw new ue("Error generating style shader: String literals are not supported.");case gt.LITERAL_COLOR:if(d=o,c==="color"){if(l(d)){if(d.length>1){let p=d[0],g=d[1];return g!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${g})`}}else return"vec4(1.0)";return`vec4(${d[0]}, 1.0)`}else{if(c==="rgb")return i=Hie(this),l(i)?UN(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=Hie(this),l(i)?UN(i):`vec4(${d[0]} / 255.0, ${d[1]} / 255.0, ${d[2]} / 255.0, ${d[3]})`;if(c==="hsl")return i=Oie(this),l(i)?UN(i):`vec4(czm_HSLToRGB(vec3(${d[0]}, ${d[1]}, ${d[2]})), 1.0)`;if(c==="hsla")return i=Oie(this),l(i)?(i.alpha!==1&&(t.translucent=!0),UN(i)):(d[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${d[0]}, ${d[1]}, ${d[2]})), ${d[3]})`)}break;case gt.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 gt.LITERAL_REGEX:throw new ue("Error generating style shader: Regular expressions are not supported.");case gt.LITERAL_UNDEFINED:return Im.NULL_SENTINEL;case gt.BUILTIN_VARIABLE:if(c==="tiles3d_tileset_time")return c}};Tt.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 gt.VARIABLE:Nx(this)||e.push(s);break;case gt.VARIABLE_IN_STRING:for(a=DN.exec(s);a!==null;)e.push(a[1]),a=DN.exec(s);break;case gt.LITERAL_STRING:l(t)&&t._type===gt.MEMBER&&Nx(t._left)&&e.push(s);break}};var gu=Im;function wp(e){e=y(e,y.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=y(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=Y.clone(Y.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=y(e.classificationType,kn.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 mwe={position:0,a_batchId:1};function hwe(e,t){if(l(e._va))return;let n=yt.createVertexBuffer({context:t,typedArray:e._positions,usage:Me.STATIC_DRAW}),i=yt.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:Me.STATIC_DRAW}),o=yt.createIndexBuffer({context:t,typedArray:e._indices,usage:Me.DYNAMIC_DRAW,indexDatatype:e._indices.BYTES_PER_ELEMENT===2?Ae.UNSIGNED_SHORT:Ae.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 mi({context:t,attributes:r,indexBuffer:o}),t.webgl2&&(e._vaSwap=new mi({context:t,attributes:r,indexBuffer:yt.createIndexBuffer({context:t,sizeInBytes:o.sizeInBytes,usage:Me.DYNAMIC_DRAW,indexDatatype:o.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0}function fwe(e,t){if(l(e._sp))return;let n=e._batchTable,i=y(e._attributeLocations,mwe),o=e._pickId,r=e._vertexShaderSource,s=e._fragmentShaderSource;if(l(r)){e._sp=rn.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=rn.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i});return}let a=n.getVertexShaderCallback(!1,"a_batchId",void 0)(aC),c=n.getFragmentShaderCallback(!1,void 0,!0)(vb);o=n.getPickId();let d=new Oe({sources:[a]}),u=new Oe({defines:["VECTOR_TILE"],sources:[c]});e._sp=rn.fromCache({context:t,vertexShaderSource:d,fragmentShaderSource:u,attributeLocations:i}),d=new Oe({sources:[aC]}),u=new Oe({defines:["VECTOR_TILE"],sources:[vb]}),e._spStencil=rn.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=rn.fromCache({context:t,vertexShaderSource:m,fragmentShaderSource:p,attributeLocations:i})}function Jie(e){let t=e?Un.EQUAL:Un.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:bt.KEEP,zFail:bt.DECREMENT_WRAP,zPass:bt.KEEP},backFunction:t,backOperation:{fail:bt.KEEP,zFail:bt.INCREMENT_WRAP,zPass:bt.KEEP},reference:Bt.CESIUM_3D_TILE_MASK,mask:Bt.CESIUM_3D_TILE_MASK},stencilMask:Bt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:tc.LESS_OR_EQUAL},depthMask:!1}}var pwe={stencilTest:{enabled:!0,frontFunction:Un.NOT_EQUAL,frontOperation:{fail:bt.ZERO,zFail:bt.ZERO,zPass:bt.ZERO},backFunction:Un.NOT_EQUAL,backOperation:{fail:bt.ZERO,zFail:bt.ZERO,zPass:bt.ZERO},reference:0,mask:Bt.CLASSIFICATION_MASK},stencilMask:Bt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND},bwe={stencilTest:{enabled:!0,frontFunction:Un.NOT_EQUAL,frontOperation:{fail:bt.ZERO,zFail:bt.ZERO,zPass:bt.ZERO},backFunction:Un.NOT_EQUAL,backOperation:{fail:bt.ZERO,zFail:bt.ZERO,zPass:bt.ZERO},reference:0,mask:Bt.CLASSIFICATION_MASK},stencilMask:Bt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function gwe(e){l(e._rsStencilDepthPass)||(e._rsStencilDepthPass=Ue.fromCache(Jie(!1)),e._rsStencilDepthPass3DTiles=Ue.fromCache(Jie(!0)),e._rsColorPass=Ue.fromCache(pwe),e._rsPickPass=Ue.fromCache(bwe))}var kx=new F,Qie=new h;function ywe(e,t){if(l(e._uniformMap))return;let n={u_modifiedModelViewProjection:function(){let i=t.uniformState.view,o=t.uniformState.projection;return F.clone(i,kx),F.multiplyByPoint(kx,e._center,Qie),F.setTranslation(kx,Qie,kx),F.multiply(o,kx,kx),kx},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function nH(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],g=o[m],f=new e.constructor(e.buffer,a*p,g);t.set(f,n),i[m]=n,n+=g}return n}function xwe(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=nH(n,s,0,i,o,a.batchIds,r);for(a.offset=0,a.count=d;t.length>0;){let u=t.pop();if(Y.equals(u.color,a.color))d=nH(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=nH(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 iH(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],g=o[m];t.copyFromBuffer(e,p*a,n*a,g*a),i[m]=n,n+=g}return n}function _we(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=iH(a,c,0,n,i,r.batchIds,o);for(r.offset=0,r.count=d;t.length>0;){let m=t.pop();if(Y.equals(m.color,r.color))d=iH(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=iH(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 Twe(e,t){return t.color.toRgba()-e.color.toRgba()}function Swe(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(Twe),t.webgl2?_we(e,n):xwe(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}function Cwe(e,t){let n=Swe(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=y(e._modelMatrix,F.IDENTITY),u=e._uniformMap,m=e._boundingVolume;for(let p=0;p<r;++p){let g=o[p].offset,f=o[p].count,x=i[p*2];l(x)||(x=i[p*2]=new tt({owner:e})),x.vertexArray=a,x.modelMatrix=d,x.offset=g,x.count=f,x.renderState=e._rsStencilDepthPass,x.shaderProgram=c,x.uniformMap=u,x.boundingVolume=m,x.cull=!1,x.pass=Re.TERRAIN_CLASSIFICATION;let _=tt.shallowClone(x,x.derivedCommands.tileset);_.renderState=e._rsStencilDepthPass3DTiles,_.pass=Re.CESIUM_3D_TILE_CLASSIFICATION,x.derivedCommands.tileset=_;let C=i[p*2+1];l(C)||(C=i[p*2+1]=new tt({owner:e})),C.vertexArray=a,C.modelMatrix=d,C.offset=g,C.count=f,C.renderState=e._rsColorPass,C.shaderProgram=c,C.uniformMap=u,C.boundingVolume=m,C.cull=!1,C.pass=Re.TERRAIN_CLASSIFICATION;let V=tt.shallowClone(C,C.derivedCommands.tileset);V.pass=Re.CESIUM_3D_TILE_CLASSIFICATION,C.derivedCommands.tileset=V}e._commandsDirty=!0}function Vwe(e,t){if(e.classificationType===kn.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]=tt.shallowClone(n[a],i[c]);d.shaderProgram=o,d.pass=Re.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,a+=2}e._commandsDirty=!1}function Lwe(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=y(e._modelMatrix,F.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 tt({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=Re.TERRAIN_CLASSIFICATION;let g=tt.shallowClone(p,p.derivedCommands.tileset);g.renderState=e._rsStencilDepthPass3DTiles,g.pass=Re.CESIUM_3D_TILE_CLASSIFICATION,p.derivedCommands.tileset=g;let f=n[c*2+1];l(f)||(f=n[c*2+1]=new tt({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=Re.TERRAIN_CLASSIFICATION;let x=tt.shallowClone(f,f.derivedCommands.tileset);x.pass=Re.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 Rwe(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=Y.WHITE}let r=e._batchedIndices;for(i=r.length,o=0;o<i;++o)r[o].color=Y.clone(Y.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}var Zwe=new Y,Gwe=Y.WHITE,Ewe=!0,Xwe=/\$/;wp.prototype.applyStyle=function(e,t){if(!l(e)){Rwe(this,t);return}let n=e.color,i=n instanceof gu&&!Xwe.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,Zwe):Gwe,c.show=l(e.show)?e.show.evaluate(c):Ewe}if(i){let a=this._batchedIndices;for(r=a.length,s=0;s<r;++s)a[s].color=Y.clone(Y.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 $h({color:Y.clone(t),offset:s,count:a,batchIds:[e]}));let m=[],p=[],g=c[u].batchIds,f=g.length;for(let x=0;x<f;++x){let _=g[x];if(_===e)continue;let C=n[_];o[C]<s?m.push(_):p.push(_)}p.length!==0&&c.push(new $h({color:Y.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 jie(e,t,n,i){let o=e.classificationType,r=o!==kn.CESIUM_3D_TILE,s=o!==kn.TERRAIN,a=t.commandList,c=n.length,d,u;for(u=0;u<c;++u)r&&(d=n[u],d.pass=Re.TERRAIN_CLASSIFICATION,a.push(d)),s&&(d=n[u].derivedCommands.tileset,d.pass=Re.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 Iwe(e,t){let n=e.commandList,i=t.length;for(let o=0;o<i;o+=2){let r=t[o+1];r.pass=Re.OPAQUE,n.push(r)}}function Wwe(e){let t=e.debugWireframe===e._debugWireframe;if(t=t&&!(e.debugWireframe&&e._wireframeDirty),t)return;l(e._rsWireframe)||(e._rsWireframe=Ue.fromCache({}));let n,i;e.debugWireframe?(n=e._rsWireframe,i=Fe.LINES):(n=e._rsColorPass,i=Fe.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;hwe(this,t),fwe(this,t),gwe(this),ywe(this,t);let n=e.passes;n.render&&(Cwe(this,t),Vwe(this,e),Wwe(this),this._debugWireframe?Iwe(e,this._commands):jie(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&(Lwe(this),jie(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(),me(this)};var Ux=wp;function fd(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=kn.BOTH}Object.defineProperties(fd.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}}});fd.packedBoxLength=F.packedLength+h.packedLength;fd.packedCylinderLength=F.packedLength+2;fd.packedEllipsoidLength=F.packedLength+h.packedLength;fd.packedSphereLength=h.packedLength+1;function Pwe(e){let t=new Float64Array(F.packedLength+h.packedLength),n=0;return h.pack(e._center,t,n),n+=h.packedLength,F.pack(e._modelMatrix,t,n),t}function vwe(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=Y.unpack(t,n);n+=Y.packedLength;let u=t[n++],m=t[n++],p=t[n++],g=new Array(p);for(let f=0;f<p;++f)g[f]=t[n++];a[c]=new $h({color:d,offset:u,count:m,batchIds:g})}return i}var wwe=new bi("createVectorTileGeometries",5),Fwe=new Y;function Awe(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(_,Fwe);d[_]=C.toRgba()}u=e._packedBuffer=Pwe(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},g=e._verticesPromise=wwe.scheduleTask(p,m);return l(g)?g.then(function(f){if(e.isDestroyed())return;let x=new Float64Array(f.packedBuffer);vwe(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),Mwe(e),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)}):void 0}}function Mwe(e){l(e._primitive)||(e._primitive=new Ux({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:y(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)}fd.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};fd.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};fd.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};fd.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};fd.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=Awe(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)};fd.prototype.isDestroyed=function(){return!1};fd.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),me(this)};var Fp=fd;function ef(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,Uwe(this,i,o)}Object.defineProperties(ef.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 Nwe(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function kwe(e,t){let n,i,o,r,s,a=y(e.BOXES_LENGTH,0),c=y(e.CYLINDERS_LENGTH,0),d=y(e.ELLIPSOIDS_LENGTH,0),u=y(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 ue("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 Dx=Uint32Array.BYTES_PER_ELEMENT;function Uwe(e,t,n){n=y(n,0);let i=new Uint8Array(t),o=new DataView(t);n+=Dx;let r=o.getUint32(n,!0);if(r!==1)throw new ue(`Only Geometry tile version 1 is supported.  Version ${r} is not.`);n+=Dx;let s=o.getUint32(n,!0);if(n+=Dx,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=Dx,a===0)throw new ue("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=Dx;let d=o.getUint32(n,!0);n+=Dx;let u=o.getUint32(n,!0);n+=Dx;let m=Io(i,n,a);n+=a;let p=new Uint8Array(t,n,c);n+=c;let g,f;d>0&&(g=Io(i,n,d),n+=d,u>0&&(f=new Uint8Array(t,n,u),f=new Uint8Array(f)));let x=y(m.BOXES_LENGTH,0),_=y(m.CYLINDERS_LENGTH,0),C=y(m.ELLIPSOIDS_LENGTH,0),V=y(m.SPHERES_LENGTH,0),L=x+_+C+V,Z=new vp(e,L,g,f,Nwe(e));if(e._batchTable=Z,L===0)return;let E=e.tile.computedTransform,X;l(m.RTC_CENTER)&&(X=h.unpack(m.RTC_CENTER),F.multiplyByPoint(E,X,X));let v=kwe(m,p);if(x>0||_>0||C>0||V>0){let P,A,M,b;if(x>0){let R=p.byteOffset+m.BOXES.byteOffset;P=new Float32Array(p.buffer,R,Fp.packedBoxLength*x)}if(_>0){let R=p.byteOffset+m.CYLINDERS.byteOffset;A=new Float32Array(p.buffer,R,Fp.packedCylinderLength*_)}if(C>0){let R=p.byteOffset+m.ELLIPSOIDS.byteOffset;M=new Float32Array(p.buffer,R,Fp.packedEllipsoidLength*C)}if(V>0){let R=p.byteOffset+m.SPHERES.byteOffset;b=new Float32Array(p.buffer,R,Fp.packedSphereLength*V)}return e._geometries=new Fp({boxes:P,boxBatchIds:v.boxes,cylinders:A,cylinderBatchIds:v.cylinders,ellipsoids:M,ellipsoidBatchIds:v.ellipsoids,spheres:b,sphereBatchIds:v.spheres,center:X,modelMatrix:E,batchTable:Z,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function qie(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}}ef.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};ef.prototype.getFeature=function(e){return qie(this),this._features[e]};ef.prototype.applyDebugSettings=function(e,t){l(this._geometries)&&this._geometries.applyDebugSettings(e,t)};ef.prototype.applyStyle=function(e){qie(this),l(this._geometries)&&this._geometries.applyStyle(e,this._features)};ef.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)};ef.prototype.pick=function(e,t,n){};ef.prototype.isDestroyed=function(){return!1};ef.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),me(this)};var bX=ef;var zmn=T(S(),1);var pon=T(S(),1);var oH={};oH.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),$ie(i,o,r,s);return c};oH.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)),$ie(s,i,o,r),i.x+=s*o,i.y+=s*r,a/=BigInt(4);return[i.x,i.y]};function $ie(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 cC=oH;var Con=T(S(),1);var Bx=30,Dwe=1<<Bx,Bwe=1<<Bx+1>>>0,rH=2*Bx+1,Yb=4,noe=[],ioe=[],Ywe=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],Ob=1,lC=2,zN=[Ob,0,0,Ob|lC];function Or(e){if(!Ot.supportsBigInt())throw new ue("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(rH)>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(eFe(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 Bx-(t>>1)};Or.prototype.getChild=function(e){let t=soe(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new Or(n)};Or.prototype.getParent=function(){let e=soe(this._cellId)<<BigInt(2);return new Or(this._cellId&~e+BigInt(1)|e)};Or.prototype.getParentAtLevel=function(e){let t=qwe(e);return new Or(this._cellId&-t|t)};Or.prototype.getCenter=function(e){e=y(e,ne.WGS84);let t=Owe(this._cellId,this._level);t=h.normalize(t,t);let n=new he.fromCartesian(t,ne.UNIT_SPHERE);return he.toCartesian(n,e,new h)};Or.prototype.getVertex=function(e,t){t=y(t,ne.WGS84);let n=Hwe(this._cellId,this._level,e);n=h.normalize(n,n);let i=new he.fromCartesian(n,ne.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(rH-2*n).join("0"),a=BigInt(`0b${i}${r}${o}1${s}`);return new Or(a)};function Owe(e,t){let n=zwe(e,t);return Kwe(n[0],n[1],n[2])}function Hwe(e,t,n){let i=ooe(e,t),o=Jwe([i[1],i[2]],t),r=n>>1&1;return roe(i[0],o[0][r^n&1],o[1][r])}function zwe(e,t){let n=ooe(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 ooe(e){noe.length===0&&jwe();let t=Number(e>>BigInt(rH)),n=t&Ob,i=(1<<Yb)-1,o=0,r=0;for(let s=7;s>=0;s--){let c=(1<<2*(s===7?Bx-7*Yb:Yb))-1;n+=Number(e>>BigInt(s*2*Yb+1)&BigInt(c))<<2,n=ioe[n];let d=s*Yb;o+=n>>Yb+2<<d,r+=(n>>2&i)<<d,n&=Ob|lC}return[t,o,r]}function Kwe(e,t,n){let i=eoe(t),o=eoe(n),r=KN(i),s=KN(o);return roe(e,r,s)}function roe(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 KN(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function eoe(e){return 1/Bwe*e}function Jwe(e,t){let n=[[],[]],i=Qwe(t);for(let o=0;o<2;++o){let r=e[o]&-i,s=r+i;n[o][0]=KN(toe(r)),n[o][1]=KN(toe(s))}return n}function Qwe(e){return 1<<Bx-e>>>0}function toe(e){return 1/Dwe*e}function Hb(e,t,n,i,o,r){if(e===Yb){let s=(t<<Yb)+n;noe[(s<<2)+i]=(o<<2)+r,ioe[(o<<2)+i]=(s<<2)+r}else{e++,t<<=1,n<<=1,o<<=2;let s=Ywe[r];Hb(e,t+(s[0]>>1),n+(s[0]&1),i,o,r^zN[0]),Hb(e,t+(s[1]>>1),n+(s[1]&1),i,o+1,r^zN[1]),Hb(e,t+(s[2]>>1),n+(s[2]&1),i,o+2,r^zN[2]),Hb(e,t+(s[3]>>1),n+(s[3]&1),i,o+3,r^zN[3])}}function jwe(){Hb(0,0,0,0,0,0),Hb(0,0,0,Ob,0,Ob),Hb(0,0,0,lC,0,lC),Hb(0,0,0,Ob|lC,0,Ob|lC)}function soe(e){return e&~e+BigInt(1)}function qwe(e){return BigInt(1)<<BigInt(2*(Bx-e))}var $we=[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 eFe(e){return $we[(-e&e)%BigInt(67)]}var Ap=Or;var Lmn=T(S(),1);var Ron=T(S(),1);function tFe(e,t){return l(e)&&l(e.extensions)&&l(e.extensions[t])}var ii=tFe;var Ion=T(S(),1);function sH(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 ue(`Availability bitstream must be exactly ${r} bytes long to store ${t} bits. Actual bitstream was ${o.length} bytes long.`);let s=y(e.computeAvailableCountEnabled,!1);!l(n)&&s&&(n=nFe(o,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=o}function nFe(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(sH.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});sH.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 dC=sH;var von=T(S(),1);function Mp(e){e=y(e,y.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(Mp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Mp.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};Mp.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};Mp.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};Mp.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};Mp.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};Mp.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};Mp.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var uC=Mp;var Fon=T(S(),1);var JN={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};JN.getBranchingFactor=function(e){switch(e){case JN.OCTREE:return 8;case JN.QUADTREE:return 4}};var Hr=Object.freeze(JN);var Hon=T(S(),1);var Uon=T(S(),1);function ta(){}Object.defineProperties(ta.prototype,{class:{get:function(){pe.throwInstantiationError()}}});ta.prototype.hasProperty=function(e){pe.throwInstantiationError()};ta.prototype.hasPropertyBySemantic=function(e){pe.throwInstantiationError()};ta.prototype.getPropertyIds=function(e){pe.throwInstantiationError()};ta.prototype.getProperty=function(e){pe.throwInstantiationError()};ta.prototype.setProperty=function(e,t){pe.throwInstantiationError()};ta.prototype.getPropertyBySemantic=function(e){pe.throwInstantiationError()};ta.prototype.setPropertyBySemantic=function(e,t){pe.throwInstantiationError()};ta.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))};ta.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return!1;let o=i[e];return l(o)};ta.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};ta.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=Ye(i.default,!0),i.unpackVectorAndMatrixTypes(o,r);if(l(o))return o=i.normalize(o),o=i.applyValueTransform(o),i.unpackVectorAndMatrixTypes(o,r)};ta.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};ta.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return;let o=i[e];if(l(o))return ta.getProperty(o.id,t,n)};ta.setPropertyBySemantic=function(e,t,n,i){let o=i.propertiesBySemantic;if(!l(o))return!1;let r=i.propertiesBySemantic[e];return l(r)?ta.setProperty(r.id,t,n,i):!1};var Mn=ta;function Np(e){e=y(e,y.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(Np.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Np.prototype.hasProperty=function(e){return Mn.hasProperty(e,this._properties,this._class)};Np.prototype.hasPropertyBySemantic=function(e){return Mn.hasPropertyBySemantic(e,this._properties,this._class)};Np.prototype.getPropertyIds=function(e){return Mn.getPropertyIds(this._properties,this._class,e)};Np.prototype.getProperty=function(e){return Mn.getProperty(e,this._properties,this._class)};Np.prototype.setProperty=function(e,t){return Mn.setProperty(e,t,this._properties,this._class)};Np.prototype.getPropertyBySemantic=function(e){return Mn.getPropertyBySemantic(e,this._properties,this._class)};Np.prototype.setPropertyBySemantic=function(e,t){return Mn.setPropertyBySemantic(e,t,this._properties,this._class)};var gX=Np;var Arn=T(S(),1);var Xrn=T(S(),1);var jon=T(S(),1);var At={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"};At.getMinimum=function(e){switch(e){case At.INT8:return-128;case At.UINT8:return 0;case At.INT16:return-32768;case At.UINT16:return 0;case At.INT32:return-2147483648;case At.UINT32:return 0;case At.INT64:return Ot.supportsBigInt()?BigInt("-9223372036854775808"):-Math.pow(2,63);case At.UINT64:return Ot.supportsBigInt()?BigInt(0):0;case At.FLOAT32:return-34028234663852886e22;case At.FLOAT64:return-Number.MAX_VALUE}};At.getMaximum=function(e){switch(e){case At.INT8:return 127;case At.UINT8:return 255;case At.INT16:return 32767;case At.UINT16:return 65535;case At.INT32:return 2147483647;case At.UINT32:return 4294967295;case At.INT64:return Ot.supportsBigInt()?BigInt("9223372036854775807"):Math.pow(2,63)-1;case At.UINT64:return Ot.supportsBigInt()?BigInt("18446744073709551615"):Math.pow(2,64)-1;case At.FLOAT32:return 34028234663852886e22;case At.FLOAT64:return Number.MAX_VALUE}};At.isIntegerType=function(e){switch(e){case At.INT8:case At.UINT8:case At.INT16:case At.UINT16:case At.INT32:case At.UINT32:case At.INT64:case At.UINT64:return!0;default:return!1}};At.isUnsignedIntegerType=function(e){switch(e){case At.UINT8:case At.UINT16:case At.UINT32:case At.UINT64:return!0;default:return!1}};At.isVectorCompatible=function(e){switch(e){case At.INT8:case At.UINT8:case At.INT16:case At.UINT16:case At.INT32:case At.UINT32:case At.FLOAT32:case At.FLOAT64:return!0;default:return!1}};At.normalize=function(e,t){return Math.max(Number(e)/Number(At.getMaximum(t)),-1)};At.unnormalize=function(e,t){let n=At.getMaximum(t),i=At.isUnsignedIntegerType(t)?0:-n;return e=W.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===At.INT64||t===At.UINT64)&&Ot.supportsBigInt()&&(e=BigInt(e)),e>n?n:e<i?i:e};At.applyValueTransform=function(e,t,n){return n*e+t};At.unapplyValueTransform=function(e,t,n){return n===0?0:(e-t)/n};At.getSizeInBytes=function(e){switch(e){case At.INT8:case At.UINT8:return 1;case At.INT16:case At.UINT16:return 2;case At.INT32:case At.UINT32:return 4;case At.INT64:case At.UINT64:return 8;case At.FLOAT32:return 4;case At.FLOAT64:return 8}};At.fromComponentDatatype=function(e){switch(e){case Q.BYTE:return At.INT8;case Q.UNSIGNED_BYTE:return At.UINT8;case Q.SHORT:return At.INT16;case Q.UNSIGNED_SHORT:return At.UINT16;case Q.INT:return At.INT32;case Q.UNSIGNED_INT:return At.UINT32;case Q.FLOAT:return At.FLOAT32;case Q.DOUBLE:return At.FLOAT64}};At.toComponentDatatype=function(e){switch(e){case At.INT8:return Q.BYTE;case At.UINT8:return Q.UNSIGNED_BYTE;case At.INT16:return Q.SHORT;case At.UINT16:return Q.UNSIGNED_SHORT;case At.INT32:return Q.INT;case At.UINT32:return Q.UNSIGNED_INT;case At.FLOAT32:return Q.FLOAT;case At.FLOAT64:return Q.DOUBLE}};var an=Object.freeze(At);var yrn=T(S(),1);var rrn=T(S(),1);var Ao={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};Ao.isVectorType=function(e){switch(e){case Ao.VEC2:case Ao.VEC3:case Ao.VEC4:return!0;default:return!1}};Ao.isMatrixType=function(e){switch(e){case Ao.MAT2:case Ao.MAT3:case Ao.MAT4:return!0;default:return!1}};Ao.getComponentCount=function(e){switch(e){case Ao.SCALAR:case Ao.STRING:case Ao.ENUM:case Ao.BOOLEAN:return 1;case Ao.VEC2:return 2;case Ao.VEC3:return 3;case Ao.VEC4:return 4;case Ao.MAT2:return 4;case Ao.MAT3:return 9;case Ao.MAT4:return 16}};Ao.getMathType=function(e){switch(e){case Ao.VEC2:return D;case Ao.VEC3:return h;case Ao.VEC4:return se;case Ao.MAT2:return Qi;case Ao.MAT3:return $;case Ao.MAT4:return F;default:return}};var zt=Object.freeze(Ao);function Ga(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.type,i=e.componentType,o=e.enumType,r=l(i)&&an.isIntegerType(i)&&y(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=y(e.isArray,!1),this._isVariableLengthArray=y(e.isVariableLengthArray,!1),this._arrayLength=e.arrayLength,this._min=Ye(e.min,!0),this._max=Ye(e.max,!0),this._normalized=r;let s=Ye(e.offset,!0),a=Ye(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=Ye(e.noData,!0),this._default=Ye(e.default,!0),this._required=y(e.required,!0),this._extras=Ye(e.extras,!0),this._extensions=Ye(e.extensions,!0)}Ga.fromJson=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.property,i=iFe(n),o=oFe(n,e.enums),r;return l(i)?i?r=l(n.optional)?!n.optional:!0:r=y(n.required,!1):r=!1,new Ga({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(Ga.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 iFe(e){if(e.type==="ARRAY")return!0;let t=e.type;if(t===zt.SCALAR||zt.isMatrixType(t)||zt.isVectorType(t))return!1;if(l(an[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 oFe(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===zt.ENUM)return{type:n,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&i===zt.ENUM)return{type:i,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===zt.SCALAR||zt.isMatrixType(n)||zt.isVectorType(n))return{type:n,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===zt.BOOLEAN||n===zt.STRING)return{type:n,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&(i===zt.BOOLEAN||i===zt.STRING))return{type:i,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(l(i)&&l(an[i]))return{type:zt.SCALAR,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(l(an[n]))return{type:zt.SCALAR,componentType:n,enumType:void 0,valueType:n,isArray:r,isVariableLengthArray:a,arrayLength:s}}Ga.prototype.normalize=function(e){return this._normalized?aH(e,this._valueType,an.normalize):e};Ga.prototype.unnormalize=function(e){return this._normalized?aH(e,this._valueType,an.unnormalize):e};Ga.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Ga.valueTransformInPlace(e,this._offset,this._scale,an.applyValueTransform)};Ga.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Ga.valueTransformInPlace(e,this._offset,this._scale,an.unapplyValueTransform)};Ga.prototype.expandConstant=function(e,t){t=y(t,!1);let n=this._isArray,i=this._arrayLength,o=zt.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)};Ga.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!doe(e,t))return e};function doe(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(!doe(e[n],t[n]))return!1;return!0}Ga.prototype.unpackVectorAndMatrixTypes=function(e,t){t=y(t,!1);let n=zt.getMathType(this._type),i=this._isArray,o=zt.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};Ga.prototype.packVectorAndMatrixTypes=function(e,t){t=y(t,!1);let n=zt.getMathType(this._type),i=this._isArray,o=zt.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};Ga.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?rFe(this,e):uoe(this,e)};function rFe(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=uoe(e,t[i]);if(l(o))return o}}function uoe(e,t){let n=e._type,i=e._componentType,o=e._enumType,r=e._normalized;return zt.isVectorType(n)?sFe(t,n,i):zt.isMatrixType(n)?aFe(t,n,i):n===zt.STRING?cFe(t):n===zt.BOOLEAN?lFe(t):n===zt.ENUM?dFe(t,o):uFe(t,i,r)}function sFe(e,t,n){if(!an.isVectorCompatible(n))return`componentType ${n} is incompatible with vector type ${t}`;if(t===zt.VEC2&&!(e instanceof D))return`vector value ${e} must be a Cartesian2`;if(t===zt.VEC3&&!(e instanceof h))return`vector value ${e} must be a Cartesian3`;if(t===zt.VEC4&&!(e instanceof se))return`vector value ${e} must be a Cartesian4`}function aFe(e,t,n){if(!an.isVectorCompatible(n))return`componentType ${n} is incompatible with matrix type ${t}`;if(t===zt.MAT2&&!(e instanceof Qi))return`matrix value ${e} must be a Matrix2`;if(t===zt.MAT3&&!(e instanceof $))return`matrix value ${e} must be a Matrix3`;if(t===zt.MAT4&&!(e instanceof F))return`matrix value ${e} must be a Matrix4`}function cFe(e){if(typeof e!="string")return QN(e,zt.STRING)}function lFe(e){if(typeof e!="boolean")return QN(e,zt.BOOLEAN)}function dFe(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 uFe(e,t,n){let i=typeof e;switch(t){case an.INT8:case an.UINT8:case an.INT16:case an.UINT16:case an.INT32:case an.UINT32:case an.FLOAT32:case an.FLOAT64:return i!=="number"?QN(e,t):isFinite(e)?coe(e,t,n):loe(e,t);case an.INT64:case an.UINT64:return i!=="number"&&i!=="bigint"?QN(e,t):i==="number"&&!isFinite(e)?loe(e,t):coe(e,t,n)}}function QN(e,t){return`value ${e} does not match type ${t}`}function aoe(e,t,n){let i=`value ${e} is out of range for type ${t}`;return n&&(i+=" (normalized)"),i}function coe(e,t,n){if(n){let i=an.isUnsignedIntegerType(t)?0:-1;return e<i||e>1?aoe(e,t,n):void 0}if(e<an.getMinimum(t)||e>an.getMaximum(t))return aoe(e,t,n)}function loe(e,t){return`value ${e} of type ${t} must be finite`}function aH(e,t,n){if(!Array.isArray(e))return n(e,t);for(let i=0;i<e.length;i++)e[i]=aH(e[i],t,n);return e}Ga.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]=Ga.valueTransformInPlace(e[o],t[o],n[o],i);return e};var zb=Ga;function yX(e){e=y(e,y.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===zt.STRING,m=r===zt.BOOLEAN,p=0,g;if(a){let b=y(n.arrayOffsetType,n.offsetType);b=y(an[b],an.UINT32);let R=y(n.arrayOffsets,n.arrayOffsetBufferView);g=new cH(o[R],b,t+1),p+=g.typedArray.byteLength}let f=zt.getComponentCount(r),x;a?x=g.get(t)-g.get(0):s?x=t*i.arrayLength:x=t;let _=f*x,C;if(u){let b=y(n.stringOffsetType,n.offsetType);b=y(an[b],an.UINT32);let R=y(n.stringOffsets,n.stringOffsetBufferView);C=new cH(o[R],b,_+1),p+=C.typedArray.byteLength}(u||m)&&(c=an.UINT8);let V;u?V=C.get(_)-C.get(0):m?V=Math.ceil(_/8):V=_;let L=y(n.values,n.bufferView),Z=new cH(o[L],c,V);p+=Z.typedArray.byteLength;let E=n.offset,X=n.scale,v=i.hasValueTransform||l(E)||l(X);E=y(E,i.offset),X=y(X,i.scale),E=moe(E),X=moe(X);let P,A,M=this;u?P=function(b){return fFe(b,M._values,M._stringOffsets)}:m?(P=function(b){return pFe(b,M._values)},A=function(b,R){bFe(b,M._values,R)}):l(d)?(P=function(b){let R=M._values.get(b);return d.namesByValue[R]},A=function(b,R){let G=d.valuesByName[R];M._values.set(b,G)}):(P=function(b){return M._values.get(b)},A=function(b,R){M._values.set(b,R)}),this._arrayOffsets=g,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=E,this._scale=X,this._hasValueTransform=v,this._getValue=P,this._setValue=A,this._unpackedValues=void 0,this._extras=n.extras,this._extensions=n.extensions,this._byteLength=p}Object.defineProperties(yX.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}}});yX.prototype.get=function(e){let t=mFe(this,e);return t=this._classProperty.handleNoData(t),l(t)?(t=this._classProperty.normalize(t),t=VFe(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};yX.prototype.set=function(e,t){let n=this._classProperty;t=n.packVectorAndMatrixTypes(t),t=LFe(this,t),t=n.unnormalize(t),hFe(this,e,t)};yX.prototype.getTypedArray=function(){if(l(this._values))return this._values.typedArray};function moe(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 mFe(e,t){foe(e)&&poe(e);let n=e._classProperty,i=n.isArray,o=n.type,r=zt.getComponentCount(o);if(l(e._unpackedValues)){let s=e._unpackedValues[t];return i?Ye(s,!0):s}return!i&&r===1?e._getValue(t):hoe(e,n,t)}function hoe(e,t,n){let i,o;if(t.isVariableLengthArray){i=e._arrayOffsets.get(n),o=e._arrayOffsets.get(n+1)-i;let s=zt.getComponentCount(t.type);i*=s,o*=s}else{let a=y(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 hFe(e,t,n){SFe(e,t,n)&&poe(e);let i=e._classProperty,o=i.isArray,r=i.type,s=zt.getComponentCount(r);if(l(e._unpackedValues)){i.isArray&&(n=Ye(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=y(i.arrayLength,1)*e._vectorComponentCount;a=t*u,c=u}for(let d=0;d<c;++d)e._setValue(a+d,n[d])}function fFe(e,t,n){let i=n.get(e),o=n.get(e+1)-i;return Vl(t.typedArray,i,o)}function pFe(e,t){let n=e>>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function bFe(e,t,n){let i=e>>3,o=e%8;n?t.typedArray[i]|=1<<o:t.typedArray[i]&=~(1<<o)}function gFe(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 yFe(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 xFe(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 _Fe(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 TFe(e){switch(e){case an.INT8:return Q.BYTE;case an.UINT8:return Q.UNSIGNED_BYTE;case an.INT16:return Q.SHORT;case an.UINT16:return Q.UNSIGNED_SHORT;case an.INT32:return Q.INT;case an.UINT32:return Q.UNSIGNED_INT;case an.FLOAT32:return Q.FLOAT;case an.FLOAT64:return Q.DOUBLE}}function foe(e){if(l(e._unpackedValues))return!1;let t=e._classProperty,n=t.type,i=t.valueType;return n===zt.STRING||i===an.INT64&&!Ot.supportsBigInt64Array()||i===an.UINT64&&!Ot.supportsBigUint64Array()}function SFe(e,t,n){if(foe(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 poe(e){e._unpackedValues=CFe(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function CFe(e){let t=e._count,n=new Array(t),i=e._classProperty,o=i.isArray,r=i.type,s=zt.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]=hoe(e,i,a);return n}function VFe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:zb.valueTransformInPlace(t,e._offset,e._scale,an.applyValueTransform)}function LFe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:zb.valueTransformInPlace(t,e._offset,e._scale,an.unapplyValueTransform)}function cH(e,t,n){let i=this,o,r,s;if(t===an.INT64)Ot.supportsBigInt()?Ot.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 yFe(a,i)}):(Nt("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 gFe(a,i)});else if(t===an.UINT64)Ot.supportsBigInt()?Ot.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 _Fe(a,i)}):(Nt("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 xFe(a,i)});else{let a=TFe(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 xX=yX;function Wm(e){e=y(e,y.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 xX({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(Wm.prototype,{count:{get:function(){return this._count}},class:{get:function(){return this._class}},byteLength:{get:function(){return this._byteLength}}});Wm.prototype.hasProperty=function(e){return Mn.hasProperty(e,this._properties,this._class)};Wm.prototype.hasPropertyBySemantic=function(e){return Mn.hasPropertyBySemantic(e,this._properties,this._class)};Wm.prototype.getPropertyIds=function(e){return Mn.getPropertyIds(this._properties,this._class,e)};Wm.prototype.getProperty=function(e,t){let n=this._properties[t],i;return l(n)?i=n.get(e):i=RFe(this._class,t),i};Wm.prototype.setProperty=function(e,t,n){let i=this._properties[t];return l(i)?(i.set(e,n),!0):!1};Wm.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)};Wm.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};Wm.prototype.getPropertyTypedArray=function(e){let t=this._properties[e];if(l(t))return t.getTypedArray()};Wm.prototype.getPropertyTypedArrayBySemantic=function(e){let t,n=this._class.propertiesBySemantic;if(l(n)&&(t=n[e]),l(t))return this.getPropertyTypedArray(t.id)};function RFe(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=Ye(o,!0)),o=i.normalize(o),i.unpackVectorAndMatrixTypes(o)}}var Zl=Wm;var umn=T(S(),1);var jrn=T(S(),1);var Brn=T(S(),1);function Kb(){}Object.defineProperties(Kb.prototype,{cacheKey:{get:function(){pe.throwInstantiationError()}}});Kb.prototype.load=function(){pe.throwInstantiationError()};Kb.prototype.unload=function(){};Kb.prototype.process=function(e){return!1};Kb.prototype.getError=function(e,t){l(t)&&l(t.message)&&(e+=`
${t.message}`);let n=new ue(e);return l(t)&&(n.stack=`Original stack:
${t.stack}
Handler stack:
${n.stack}`),n};Kb.prototype.isDestroyed=function(){return!1};Kb.prototype.destroy=function(){return this.unload(),me(this)};var eo=Kb;var Orn=T(S(),1),ZFe={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5},It=Object.freeze(ZFe);function kp(e){e=y(e,y.EMPTY_OBJECT);let t=e.typedArray,n=e.resource,i=e.cacheKey;this._typedArray=t,this._resource=n,this._cacheKey=i,this._state=It.UNLOADED,this._promise=void 0}l(Object.create)&&(kp.prototype=Object.create(eo.prototype),kp.prototype.constructor=kp);Object.defineProperties(kp.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});kp.prototype.load=async function(){return l(this._promise)?this._promise:l(this._typedArray)?(this._promise=Promise.resolve(this),this._promise):(this._promise=GFe(this),this._promise)};async function GFe(e){let t=e._resource;e._state=It.LOADING;try{let n=await kp._fetchArrayBuffer(t);return e.isDestroyed()?void 0:(e._typedArray=new Uint8Array(n),e._state=It.READY,e)}catch(n){if(e.isDestroyed())return;e._state=It.FAILED;let i=`Failed to load external buffer: ${t.url}`;throw e.getError(i,n)}}kp._fetchArrayBuffer=function(e){return e.fetchArrayBuffer()};kp.prototype.unload=function(){this._typedArray=void 0};var Yx=kp;var ysn=T(S(),1);var asn=T(S());var esn=T(S()),qrn=function(){var e="b9H79TebbbeJq9Geueu9Geub9Gbb9Gvuuuuueu9Gduueu9Gluuuueu9Gvuuuuub9Gouuuuuub9Gluuuub9GiuuueuiKLdilevlevlooroowwvwbDDbelve9Weiiviebeoweuec:G;kekr;RiOo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWVbe8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9c9V919U9KbdE9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949wWV79P9V9UbiY9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWVbl8E9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWV9c9V919U9Kbv8A9TW79O9V9Wt9FW9U9J9V9KW69U9KW949wWV79P9V9UboE9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JWbra9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JW9c9V919U9KbwL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9p9JtbDK9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9r919HtbqL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVT949WbkE9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OWbPa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OW9ttV9P9Wbsa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9WbzK9TW79O9V9Wt9F79W9Ht9P9H29t9VVt9sW9T9H9WbHl79IV9RbODwebcekdQXq;C9oLdbk;GqeKu8Jjjjjbcjo9Rgv8Kjjjjbcbhodnalcefae0mbabcbRbN:kjjbc:GeV86bbavcjdfcbcjdzNjjjb8AdnaiTmbavcjdfadalz:tjjjb8Akabaefhrabcefhwavalfcbcbcjdal9RalcFe0EzNjjjb8Aavavcjdfalz:tjjjbhDcj;abal9Uc;WFbGgecjdaecjd6Ehqcbhkindndnaiak9nmbaDcjlfcbcjdzNjjjb8Aaqaiak9Rakaqfai6Egxcsfgecl4cifcd4hmadakal2fhPdndndnaec9WGgsTmbcbhzaPhHawhOxekdnaxmbalheinaraw9Ram6miawcbamzNjjjbamfhwaecufgembxvkkcbhAaPhOinaDaAfRbbhCaDcjlfheaOhoaxhXinaeaoRbbgQaC9RgCcetaC;acr4786bbaoalfhoaecefheaQhCaXcufgXmbkaraw9Ram6mdaOcefhOawcbamzNjjjbamfhwaAcefgAal9hmbxlkkindnaxTmbaDazfRbbhCaDcjlfheaHhoaxhXinaeaoRbbgQaC9RgCcetaC;acr4786bbaoalfhoaecefheaQhCaXcufgXmbkkaraO9Ram6mearaOcbamzNjjjbgLamfgw9RcK6mecbhKaDcjlfhOinaDcjlfaKfhYcwhAczhQceheindndnaegXce9hmbcuhoaYRbbmecbhodninaogecsSmeaecefhoaOaefcefRbbTmbkkcucbaecs6EhoxekaXcethocuaXtc;:bGcFb7hCcbheinaoaCaOaefRbb9nfhoaecefgecz9hmbkkaoaQaoaQ6geEhQaXaAaeEhAaXcetheaXcl6mbkdndndndnaAcufPdiebkaLaKco4fgeaeRbbcdciaAclSEaKci4coGtV86bbaAcw9hmeawaY8Pbb83bbawcwfaYcwf8Pbb83bbawczfhwxdkaLaKco4fgeaeRbbceaKci4coGtV86bbkdncwaA9Tg8Ambinawcb86bbawcefhwxbkkcuaAtcu7hYcbhEaOh3ina3hea8AhCcbhoinaeRbbgQaYcFeGgXaQaX6EaoaAtVhoaecefheaCcufgCmbkawao86bba3a8Afh3awcefhwaEa8AfgEcz6mbkcbheindnaOaefRbbgoaX6mbawao86bbawcefhwkaecefgecz9hmbkkdnaKczfgKas9pmbaOczfhOaraw9RcL0mekkaKas6meawTmeaHcefhHawhOazcefgzalSmixbkkcbhoxikcbhoaraw9Ralcaalca0E6mddnalc8F0mbawcbcaal9RgezNjjjbaefhwkawaDcjdfalz:tjjjbalfab9RhoxdkaDaPaxcufal2falz:tjjjb8Aaxakfhkawmbkcbhokavcjof8Kjjjjbaok9heeuaecaaeca0Eabcj;abae9Uc;WFbGgdcjdadcjd6Egdfcufad9Uae2adcl4cifcd4adV2fcefkmbcbabBdN:kjjbk:zse5u8Jjjjjbc;ae9Rgl8Kjjjjbcbhvdnaici9UgocHfae0mbabcbyd:e:kjjbgrc;GeV86bbalc;abfcFecjezNjjjb8AalcUfgw9cu83ibalc8WfgD9cu83ibalcyfgq9cu83ibalcafgk9cu83ibalcKfgx9cu83ibalczfgm9cu83ibal9cu83iwal9cu83ibabaefc9WfhPabcefgsaofhednaiTmbcmcsarcb9kgzEhHcbhOcbhAcbhCcbhXcbhQindnaeaP9nmbcbhvxikaQcufhvadaCcdtfgLydbhKaLcwfydbhYaLclfydbh8AcbhEdndndninalc;abfavcsGcitfgoydlh3dndndnaoydbgoaK9hmba3a8ASmekdnaoa8A9hmba3aY9hmbaEcefhExekaoaY9hmea3aK9hmeaEcdfhEkaEc870mdaXcufhvaLaEciGcx2goc:y1jjbfydbcdtfydbh3aLaocN1jjbfydbcdtfydbh8AaLaoc:q1jjbfydbcdtfydbhKcbhodnindnalavcsGcdtfydba39hmbaohYxdkcuhYavcufhvaocefgocz9hmbkkaOa3aOSgvaYce9iaYaH9oVgoGfhOdndndncbcsavEaYaoEgvcs9hmbarce9imba3a3aAa3cefaASgvEgAcefSmecmcsavEhvkasavaEcdtc;WeGV86bbavcs9hmea3aA9Rgvcetavc8F917hvinaeavcFb0crtavcFbGV86bbaecefheavcje6hoavcr4hvaoTmbka3hAxvkcPhvasaEcdtcPV86bba3hAkavTmiavaH9omicdhocehEaQhYxlkavcufhvaEclfgEc;ab9hmbkkdnaLceaYaOSceta8AaOSEcx2gvc:q1jjbfydbcdtfydbgKTaLavcN1jjbfydbcdtfydbg8AceSGaLavc:y1jjbfydbcdtfydbg3cdSGaOcb9hGazGg5ce9hmbaw9cu83ibaD9cu83ibaq9cu83ibak9cu83ibax9cu83ibam9cu83ibal9cu83iwal9cu83ibcbhOkcbhEaXcufgvhodnindnalaocsGcdtfydba8A9hmbaEhYxdkcuhYaocufhoaEcefgEcz9hmbkkcbhodnindnalavcsGcdtfydba39hmbaohExdkcuhEavcufhvaocefgocz9hmbkkaOaKaOSg8EfhLdndnaYcm0mbaYcefhYxekcbcsa8AaLSgvEhYaLavfhLkdndnaEcm0mbaEcefhExekcbcsa3aLSgvEhEaLavfhLkc9:cua8EEh8FcbhvaEaYcltVgacFeGhodndndninavcj1jjbfRbbaoSmeavcefgvcz9hmbxdkka5aKaO9havcm0VVmbasavc;WeV86bbxekasa8F86bbaeaa86bbaecefhekdna8EmbaKaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombkaKhAkdnaYcs9hmba8AaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka8AhAkdnaEcs9hmba3aA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka3hAkalaXcdtfaKBdbaXcefcsGhvdndnaYPzbeeeeeeeeeeeeeebekalavcdtfa8ABdbaXcdfcsGhvkdndnaEPzbeeeeeeeeeeeeeebekalavcdtfa3BdbavcefcsGhvkcihoalc;abfaQcitfgEaKBdlaEa8ABdbaQcefcsGhYcdhEavhXaLhOxekcdhoalaXcdtfa3BdbcehEaXcefcsGhXaQhYkalc;abfaYcitfgva8ABdlava3Bdbalc;abfaQaEfcsGcitfgva3BdlavaKBdbascefhsaQaofcsGhQaCcifgCai6mbkkcbhvaeaP0mbcbhvinaeavfavcj1jjbfRbb86bbavcefgvcz9hmbkaeab9Ravfhvkalc;aef8KjjjjbavkZeeucbhddninadcefgdc8F0meceadtae6mbkkadcrfcFeGcr9Uci2cdfabci9U2cHfkmbcbabBd:e:kjjbk:ydewu8Jjjjjbcz9Rhlcbhvdnaicvfae0mbcbhvabcbRb:e:kjjbc;qeV86bbal9cb83iwabcefhoabaefc98fhrdnaiTmbcbhwcbhDindnaoar6mbcbskadaDcdtfydbgqalcwfawaqav9Rgvavc8F91gv7av9Rc507gwcdtfgkydb9Rgvc8E91c9:Gavcdt7awVhvinaoavcFb0gecrtavcFbGV86bbavcr4hvaocefhoaembkakaqBdbaqhvaDcefgDai9hmbkkcbhvaoar0mbaocbBbbaoab9RclfhvkavkBeeucbhddninadcefgdc8F0meceadtae6mbkkadcwfcFeGcr9Uab2cvfk:bvli99dui99ludnaeTmbcuadcetcuftcu7:Yhvdndncuaicuftcu7:YgoJbbbZMgr:lJbbb9p9DTmbar:Ohwxekcjjjj94hwkcbhicbhDinalclfIdbgrJbbbbJbbjZalIdbgq:lar:lMalcwfIdbgk:lMgr:varJbbbb9BEgrNhxaqarNhrdndnakJbbbb9GTmbaxhqxekJbbjZar:l:tgqaq:maxJbbbb9GEhqJbbjZax:l:tgxax:marJbbbb9GEhrkdndnalcxfIdbgxJbbj:;axJbbj:;9GEgkJbbjZakJbbjZ9FEavNJbbbZJbbb:;axJbbbb9GEMgx:lJbbb9p9DTmbax:Ohmxekcjjjj94hmkdndnaqJbbj:;aqJbbj:;9GEgxJbbjZaxJbbjZ9FEaoNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:OhPxekcjjjj94hPkdndnarJbbj:;arJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;arJbbbb9GEMgr:lJbbb9p9DTmbar:Ohsxekcjjjj94hskdndnadcl9hmbabaifgzas86bbazcifam86bbazcdfaw86bbazcefaP86bbxekabaDfgzas87ebazcofam87ebazclfaw87ebazcdfaP87ebkalczfhlaiclfhiaDcwfhDaecufgembkkk;hlld99eud99eudnaeTmbdndncuaicuftcu7:YgvJbbbZMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikaic;8FiGhrinabcofcicdalclfIdb:lalIdb:l9EgialcwfIdb:lalaicdtfIdb:l9EEgialcxfIdb:lalaicdtfIdb:l9EEgiarV87ebdndnJbbj:;JbbjZalaicdtfIdbJbbbb9DEgoalaicd7cdtfIdbJ;Zl:1ZNNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabcdfaq87ebdndnalaicefciGcdtfIdbJ;Zl:1ZNaoNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabaq87ebdndnaoalaicufciGcdtfIdbJ;Zl:1ZNNgoJbbj:;aoJbbj:;9GEgwJbbjZawJbbjZ9FEavNJbbbZJbbb:;aoJbbbb9GEMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikabclfai87ebabcwfhbalczfhlaecufgembkkk:dvdxue998Jjjjjbcjd9Rgo8Kjjjjbadcd4hrdndndndnavcd9hmbadcl6meaohwarhDinawc:CuBdbawclfhwaDcufgDmbkaeTmiadcl6mdarcdthqalhkcbhxinaohwakhDarhminawawydbgPaDydbgscL4cFeGc:cufcbasEgsaPas9kEBdbaDclfhDawclfhwamcufgmmbkakaqfhkaxcefgxaeSmixbkkaeTmdxekaeTmekavcb9hadcl6gqVhzarcdthxavce9hhHcbhdindndndnaHmbaqmdc:CuhDalhwarhminaDawydbgPcL4cFeGc:cufcbaPEgPaDaP9kEhDawclfhwamcufgmmbxdkkc:CuhDazmbaohwalhmarhPinawamydbgscL4cFeGgkc8Aakc8A9kEc:cufcbasEBdbamclfhmawclfhwaPcufgPmbkkaqmbcbhwarhPinaDhmdnavceSmbaoawfydbhmkdndnalawfIdbgOcjjj;8iamai9RcefgmcLt9R::NJbbbZJbbb:;aOJbbbb9GEMgO:lJbbb9p9DTmbaO:Ohsxekcjjjj94hskabawfascFFFrGamcKtVBdbawclfhwaPcufgPmbkkabaxfhbalaxfhladcefgdae9hmbkkaocjdf8Kjjjjbk;HqdCui998Jjjjjbc:qd9Rgv8Kjjjjbavc:Sefcbc;KbzNjjjb8AcbhodnadTmbcbhoaiTmbdnabae9hmbavcuadcdtgradcFFFFi0Ecbyd:m:kjjbHjjjjbbgeBd:SeavceBd:mdaeabarz:tjjjb8Akavc:GefcwfcbBdbav9cb83i:Geavc:Gefaeadaiavc:Sefz:njjjbavyd:Gehwadci9UgDcbyd:m:kjjbHjjjjbbhravc:Sefavyd:mdgqcdtfarBdbavaqcefgkBd:mdarcbaDzNjjjbhxavc:SefakcdtfcuaicdtaicFFFFi0Ecbyd:m:kjjbHjjjjbbgmBdbavaqcdfgPBd:mdawhramhkinakalIdbalarydbgscwascw6Ecdtfc;ebfIdbMUdbarclfhrakclfhkaicufgimbkavc:SefaPcdtfcuaDcdtadcFFFF970Ecbyd:m:kjjbHjjjjbbgPBdbdnadci6mbaehraPhkaDhiinakamarydbcdtfIdbamarclfydbcdtfIdbMamarcwfydbcdtfIdbMUdbarcxfhrakclfhkaicufgimbkkaqcifhoavc;qbfhzavhravyd:KehHavyd:OehOcbhscbhkcbhAcehCinarhXcihQaeakci2gLcdtfgrydbhdarclfydbhqabaAcx2fgicwfarcwfydbgKBdbaiclfaqBdbaiadBdbaxakfce86bbazaKBdwazaqBdlazadBdbaPakcdtfcbBdbdnasTmbcihQaXhiinazaQcdtfaiydbgrBdbaQaraK9harad9haraq9hGGfhQaiclfhiascufgsmbkkaAcefhAcbhsinaOaHaeasaLfcdtfydbcdtgifydbcdtfgKhrawaifgqydbgdhidnadTmbdninarydbakSmearclfhraicufgiTmdxbkkaraKadcdtfc98fydbBdbaqaqydbcufBdbkascefgsci9hmbkdndnaQTmbcuhkJbbbbhYcbhqavyd:KehKavyd:OehLindndnawazaqcdtfydbcdtgsfydbgrmbaqcefhqxekaqcs0hiamasfgdIdbh8AadalcbaqcefgqaiEcdtfIdbalarcwarcw6Ecdtfc;ebfIdbMgEUdbaEa8A:thEarcdthiaLaKasfydbcdtfhrinaParydbgscdtfgdaEadIdbMg8AUdba8AaYaYa8A9DgdEhYasakadEhkarclfhraic98fgimbkkaqaQ9hmbkakcu9hmekaCaD9pmdindnaxaCfRbbmbaChkxdkaDaCcefgC9hmbxikkaQczaQcz6EhsazhraXhzakcu9hmbkkaocdtavc:Seffc98fhrdninaoTmearydbcbyd1:kjjbH:bjjjbbarc98fhraocufhoxbkkavc:qdf8Kjjjjbk;IlevucuaicdtgvaicFFFFi0Egocbyd:m:kjjbHjjjjbbhralalyd9GgwcdtfarBdbalawcefBd9GabarBdbaocbyd:m:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdlcuadcdtadcFFFFi0Ecbyd:m:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdwabydbcbavzNjjjb8Aadci9UhDdnadTmbabydbhoaehladhrinaoalydbcdtfgvavydbcefBdbalclfhlarcufgrmbkkdnaiTmbabydbhlabydlhrcbhvaihoinaravBdbarclfhralydbavfhvalclfhlaocufgombkkdnadci6mbabydlhrabydwhvcbhlinaecwfydbhoaeclfydbhdaraeydbcdtfgwawydbgwcefBdbavawcdtfalBdbaradcdtfgdadydbgdcefBdbavadcdtfalBdbaraocdtfgoaoydbgocefBdbavaocdtfalBdbaecxfheaDalcefgl9hmbkkdnaiTmbabydlheabydbhlinaeaeydbalydb9RBdbalclfhlaeclfheaicufgimbkkkQbabaeadaic:01jjbz:mjjjbkQbabaeadaic:C:jjjbz:mjjjbk9DeeuabcFeaicdtzNjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk;Wkivuo99lu8Jjjjjbc;W;Gb9Rgl8Kjjjjbcbhvalcj;Gbfcbc;KbzNjjjb8AalcuadcdtadcFFFFi0Egocbyd:m:kjjbHjjjjbbgrBdj9GalceBd;G9GalcFFF;7rBdwal9cFFF;7;3FF:;Fb83dbalcFFF97Bd;S9Gal9cFFF;7FFF:;u83d;K9Gaicd4hwdndnadmbJFFuFhDJFFuuhqJFFuuhkJFFuFhxJFFuuhmJFFuFhPxekawcdthsaehzincbhiinalaifgHazaifIdbgDaHIdbgxaxaD9EEUdbalc;K;GbfaifgHaDaHIdbgxaxaD9DEUdbaiclfgicx9hmbkazasfhzavcefgvad9hmbkalIdwhqalId;S9GhDalIdlhkalId;O9GhxalIdbhmalId;K9GhPkdndnadTmbJbbbbJbbjZJbbbbaPam:tgPaPJbbbb9DEgPaxak: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;Gb9hmbkcbhHalaocbyd:m:kjjbHjjjjbbgiBd:e9GdnadTmbabhzinazaHBdbazclfhzadaHcefgH9hmbkabhHadhzinalaraHydbgecdtfydbcFrGcx2fgvavydbgvcefBdbaiavcdtfaeBdbaHclfhHazcufgzmbkaihHadhzinalaraHydbgecdtfydbcq4cFrGcx2fgvavydlgvcefBdlabavcdtfaeBdbaHclfhHazcufgzmbkabhHadhzinalaraHydbgecdtfydbcC4cFrGcx2fgvavydwgvcefBdwaiavcdtfaeBdbaHclfhHazcufgzmbkcbhHinabaiydbcdtfaHBdbaiclfhiadaHcefgH9hmbkkclhidninaic98Smealcj;Gbfaifydbcbyd1:kjjbH:bjjjbbaic98fhixbkkalc;W;Gbf8Kjjjjbk9teiucbcbyd:q:kjjbgeabcifc98GfgbBd:q:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:q:kjjbgeabcrfc94GfgbBd:q:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd:q:kjjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd:q:kjjbfgdBd:q:kjjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akkk:Iddbcjwk:edb4: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:bc:eqkzebbbebbbdbbbaWbb",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(g){n=g.instance,n.exports.__wasm_call_ctors(),n.exports.meshopt_encodeVertexVersion(0),n.exports.meshopt_encodeIndexVersion(1)});function o(g){for(var f=new Uint8Array(g.length),x=0;x<g.length;++x){var _=g.charCodeAt(x);f[x]=_>96?_-97:_>64?_-39:_+4}for(var C=0,x=0;x<g.length;++x)f[C++]=f[x]<60?t[f[x]]:(f[x]-60)*64+f[++x];return f.buffer.slice(0,C)}function r(g){if(!g)throw new Error("Assertion failed")}function s(g){return new Uint8Array(g.buffer,g.byteOffset,g.byteLength)}function a(g,f,x,_){var C=n.exports.sbrk,V=C(f.length*4),L=C(x*4),Z=new Uint8Array(n.exports.memory.buffer),E=s(f);Z.set(E,V),_&&_(V,V,f.length,x);var X=g(L,V,f.length,x);Z=new Uint8Array(n.exports.memory.buffer);var v=new Uint32Array(x);new Uint8Array(v.buffer).set(Z.subarray(L,L+x*4)),E.set(Z.subarray(V,V+f.length*4)),C(V-C(0));for(var P=0;P<f.length;++P)f[P]=v[f[P]];return[v,X]}function c(g,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),g(V,L,x,_),Z=new Uint8Array(n.exports.memory.buffer);var E=new Uint32Array(x);return new Uint8Array(E.buffer).set(Z.subarray(V,V+x*4)),C(V-C(0)),E}function d(g,f,x,_,C){var V=n.exports.sbrk,L=V(f),Z=V(_*C),E=new Uint8Array(n.exports.memory.buffer);E.set(s(x),Z);var X=g(L,f,Z,_,C),v=new Uint8Array(X);return v.set(E.subarray(L,L+X)),V(L-V(0)),v}function u(g){for(var f=0,x=0;x<g.length;++x){var _=g[x];f=f<_?_:f}return f}function m(g,f){if(r(f==2||f==4),f==4)return new Uint32Array(g.buffer,g.byteOffset,g.byteLength/4);var x=new Uint16Array(g.buffer,g.byteOffset,g.byteLength/2);return new Uint32Array(x)}function p(g,f,x,_,C,V,L){var Z=n.exports.sbrk,E=Z(x*_),X=Z(x*V),v=new Uint8Array(n.exports.memory.buffer);v.set(s(f),X),g(E,x,_,C,X,L);var P=new Uint8Array(x*_);return P.set(v.subarray(E,E+x*_)),Z(E-Z(0)),P}return{ready:i,supported:!0,reorderMesh:function(g,f,x){var _=f?x?n.exports.meshopt_optimizeVertexCacheStrip:n.exports.meshopt_optimizeVertexCache:void 0;return a(n.exports.meshopt_optimizeVertexFetchRemap,g,u(g)+1,_)},reorderPoints:function(g,f){return r(g instanceof Float32Array),r(g.length%f==0),r(f>=3),c(n.exports.meshopt_spatialSortRemap,g,g.length/f,f*4)},encodeVertexBuffer:function(g,f,x){r(x>0&&x<=256),r(x%4==0);var _=n.exports.meshopt_encodeVertexBufferBound(f,x);return d(n.exports.meshopt_encodeVertexBuffer,_,g,f,x)},encodeIndexBuffer:function(g,f,x){r(x==2||x==4),r(f%3==0);var _=m(g,x),C=n.exports.meshopt_encodeIndexBufferBound(f,u(_)+1);return d(n.exports.meshopt_encodeIndexBuffer,C,_,f,4)},encodeIndexSequence:function(g,f,x){r(x==2||x==4);var _=m(g,x),C=n.exports.meshopt_encodeIndexSequenceBound(f,u(_)+1);return d(n.exports.meshopt_encodeIndexSequence,C,_,f,4)},encodeGltfBuffer:function(g,f,x,_){var C={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return r(C[_]),C[_](g,f,x)},encodeFilterOct:function(g,f,x,_){return r(x==4||x==8),r(_>=1&&_<=16),p(n.exports.meshopt_encodeFilterOct,g,f,x,_,16)},encodeFilterQuat:function(g,f,x,_){return r(x==8),r(_>=4&&_<=16),p(n.exports.meshopt_encodeFilterQuat,g,f,x,_,16)},encodeFilterExp:function(g,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,g,f,x,_,x,C?V[C]:1)}}}();var nsn=T(S()),boe=function(){var e="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q;iekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq;w8Wqdbk;esezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9Uc;WFbGgocjdaocjd6EhDaicefhocbhqdnindndndnaeaq9nmbaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxalc9WGgmTmecbhPawcjdfhsaohzinaraz9Rax6mvarazaxfgo9RcK6mvczhlcbhHinalgic9WfgOawcj;cbffhldndndndndnazaOco4fRbbaHcoG4ciGPlbedibkal9cb83ibalcwf9cb83ibxikalaoRblaoRbbgOco4gAaAciSgAE86bbawcj;cbfaifglcGfaoclfaAfgARbbaOcl4ciGgCaCciSgCE86bbalcVfaAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc7faAaCfgARbbaOciGgOaOciSgOE86bbalctfaAaOfgARbbaoRbegOco4gCaCciSgCE86bbalc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc93faAaCfgARbbaOciGgOaOciSgOE86bbalc94faAaOfgARbbaoRbdgOco4gCaCciSgCE86bbalc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc97faAaCfgARbbaOciGgOaOciSgOE86bbalc98faAaOfgORbbaoRbigoco4gAaAciSgAE86bbalc99faOaAfgORbbaocl4ciGgAaAciSgAE86bbalc9:faOaAfgORbbaocd4ciGgAaAciSgAE86bbalcufaOaAfglRbbaociGgoaociSgoE86bbalaofhoxdkalaoRbwaoRbbgOcl4gAaAcsSgAE86bbawcj;cbfaifglcGfaocwfaAfgARbbaOcsGgOaOcsSgOE86bbalcVfaAaOfgORbbaoRbegAcl4gCaCcsSgCE86bbalc7faOaCfgORbbaAcsGgAaAcsSgAE86bbalctfaOaAfgORbbaoRbdgAcl4gCaCcsSgCE86bbalc91faOaCfgORbbaAcsGgAaAcsSgAE86bbalc4faOaAfgORbbaoRbigAcl4gCaCcsSgCE86bbalc93faOaCfgORbbaAcsGgAaAcsSgAE86bbalc94faOaAfgORbbaoRblgAcl4gCaCcsSgCE86bbalc95faOaCfgORbbaAcsGgAaAcsSgAE86bbalc96faOaAfgORbbaoRbvgAcl4gCaCcsSgCE86bbalc97faOaCfgORbbaAcsGgAaAcsSgAE86bbalc98faOaAfgORbbaoRbogAcl4gCaCcsSgCE86bbalc99faOaCfgORbbaAcsGgAaAcsSgAE86bbalc9:faOaAfgORbbaoRbrgocl4gAaAcsSgAE86bbalcufaOaAfglRbbaocsGgoaocsSgoE86bbalaofhoxekalao8Pbb83bbalcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaHcdfhHaiczfhlarao9RcL0mekkaiam6mvaoTmvdnakTmbawaPfRbbhHawcj;cbfhlashiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkkascefhsaohzaPcefgPad9hmbxikkcbc99arao9Radcaadca0ESEhoxlkaoaxad2fhCdnakmbadhlinaoTmlarao9Rax6mlaoaxfhoalcufglmbkaChoxekcbhmawcjdfhAinarao9Rax6miawamfRbbhHawcj;cbfhlaAhiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkaAcefhAaoaxfhoamcefgmad9hmbkaChokabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekc9:hokavcj;ebf8Kjjjjbaok;cseHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;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;oiliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabaiavcefciGfcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavciGfgkcd7cetfaD87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavcufciGfcetfaD87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohvxekcjjjj94hvkabakcetfav87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklz9Kbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q;Aekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq:p9sqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk:N8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhlaicefhodnaeTmbadTmbalc;WFbGglcjdalcjd6EhwcbhDinawaeaD9RaDawfae6Egqcsfglc9WGgkci2hxakcethmalcl4cifcd4hPabaDad2fhsakc;ab6hzcbhHincbhOaohAdndninaraA9RaP6meavcj;cbfaOak2fhCaAaPfhocbhidnazmbarao9Rc;Gb6mbcbhlinaCalfhidndndndndnaAalco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklbaoczfhokdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklzaoczfhokdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklaaoczfhokdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaoclfaYpQbfaXc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaocwfaYpQbfaXc:q:yjjbfRbbfhoxekaiaopbbbpkl8Waoczfhokalc;abfhialcjefak0meaihlarao9Rc;Fb0mbkkdnaiak9pmbaici4hlinarao9RcK6miaCaifhXdndndndndnaAaico4fRbbalcoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpkbbxikaXaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaXaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaXaopbbbpkbbaoczfhokalcdfhlaiczfgiak6mbkkaoTmeaohAaOcefgOclSmdxbkkc9:hoxlkdnakTmbavcjdfaHfhiavaHfpbdbhYcbhXinaiavcj;cbfaXfglpblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLalakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEalamfpblbg3cep9Ta3aQp9op9Hp9rg3alaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfhiaXczfgXak6mbkkaHclfgHad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfgDae6mbkkcbc99arao9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk::seHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;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:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalaeSmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;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;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oaoarpmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalaeSmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oaoarpmbezHdiOAlvCXorQLp9qpklbkalaiad;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:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalaeSmbaiaeciGgvcitgofcbcaao9R;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:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbadczfhdaeclfgeav6mbkkdnavalSmbaialciGgecdtgdVcbc;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)?a(t):a(e),r,s=WebAssembly.instantiate(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 E=0,L=0;L<C.length;++L)V[E++]=V[L]<60?i[V[L]]:(V[L]-60)*64+V[++L];return V.buffer.slice(0,E)}function c(C,V,L,Z,E,X,v){var P=C.exports.sbrk,A=Z+3&-4,M=P(A*E),b=P(X.length),R=new Uint8Array(C.exports.memory.buffer);R.set(X,b);var G=V(M,Z,E,b,X.length);if(G==0&&v&&v(M,A,E),L.set(R.subarray(M,M+Z*E)),P(M-P(0)),G!=0)throw new Error("Malformed buffer data: "+G)}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 g(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(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),E=m.length;E<C;++E)m[E]=g(Z);for(var E=C;E<m.length;++E)m[E].object.postMessage({});m.length=C,URL.revokeObjectURL(Z)}function x(C,V,L,Z,E){for(var X=m[0],v=1;v<m.length;++v)m[v].pending<X.pending&&(X=m[v]);return new Promise(function(P,A){var M=new Uint8Array(L),b=++p;X.pending+=C,X.requests[b]={resolve:P,reject:A},X.object.postMessage({id:b,count:C,size:V,source:M,mode:Z,filter:E},[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(E){self.postMessage({id:V.id,count:V.count,action:"reject",value:E})}})}return{ready:s,supported:!0,useWorkers:function(C){f(C)},decodeVertexBuffer:function(C,V,L,Z,E){c(r,r.exports.meshopt_decodeVertexBuffer,C,V,L,Z,r.exports[d[E]])},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,E,X){c(r,r.exports[u[E]],C,V,L,Z,r.exports[d[X]])},decodeGltfBufferAsync:function(C,V,L,Z,E){return m.length>0?x(C,V,L,u[Z],d[E]):s.then(function(){var X=new Uint8Array(C*V);return c(r,r.exports[u[Z]],X,C,V,L,r.exports[d[E]]),X})}}}();var rsn=T(S()),isn=function(){var e="b9H79Tebbbe9Hk9Geueu9Geub9Gbb9Gsuuuuuuuuuuuu99uueu9Gvuuuuub9Gvuuuuue999Gquuuuuuu99uueu9Gwuuuuuu99ueu9Giuuue999Gluuuueu9GiuuueuizsdilvoirwDbqqbeqlve9Weiiviebeoweuecj;jekr:Tewo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95bl8E9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9OcttV9P9I91tW7bvQ9TW79O9V9Wt9F79P9T9W29P9M959q9V9P9Ut7boX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2Wbra9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbwl79IV9RbDDwebcekdmxq:f97sdbk:39si8Au8A99zu8Jjjjjbc;W;ab9Rgs8Kjjjjbcbhzascxfcbc;Kbz:ljjjb8AdnabaeSmbabaeadcdtz:kjjjb8AkdndnamcdGmbcbhHxekasalcrfci4gecbyd;S1jjbHjjjjbbgOBdxasceBd2aOcbaez:ljjjbhAcbhlcbhednadTmbcbhlabheadhOinaAaeydbgCci4fgXaXRbbgXceaCcrGgCtV86bbaXcu7aC4ceGalfhlaeclfheaOcufgOmbkcualcdtalcFFFFi0Ehekasaecbyd;S1jjbHjjjjbbgHBdzascdBd2alcd4alfhCcehOinaOgecethOaeaC6mbkcdhzcbhQascuaecdtgOaecFFFFi0Ecbyd;S1jjbHjjjjbbgCBdCasciBd2aCcFeaOz:ljjjbhLdnadTmbaecufhXcbhKinabaQcdtfgYydbgAc:v;t;h;Ev2hCcbhedndninaLaCaXGgCcdtfg8AydbgOcuSmeaHaOcdtfydbaASmdaecefgeaCfhCaeaX9nmbxdkkaHaKcdtfaABdba8AaKBdbaKhOaKcefhKkaYaOBdbaQcefgQad9hmbkkaLcbyd;O1jjbH:bjjjbbascdBd2kascxfazcdtfcualcefgecdtaecFFFFi0Ecbyd;S1jjbHjjjjbbgEBdbasaEBdlasazceVgeBd2ascxfaecdtfcuadcitadcFFFFe0Ecbyd;S1jjbHjjjjbbg3Bdbasa3BdwasazcdfgeBd2asclfabadalcbz:cjjjbascxfaecdtfcualcdtg5alcFFFFi0Eg8Ecbyd;S1jjbHjjjjbbgOBdbasazcifgeBd2ascxfaecdtfa8Ecbyd;S1jjbHjjjjbbg8FBdbasazclVgaBd2alcd4alfhXcehCinaCgecethCaeaX6mbkcbhKascxfaacdtfghcuaecdtgCaecFFFFi0Ecbyd;S1jjbHjjjjbbgXBdbasazcvVggBd2aXcFeaCz:ljjjbhQdnalTmbavcd4hAaecufhCinaKhednaHTmbaHaKcdtfydbhekaiaeaA2cdtfgeydlgXcH4aX7c:F:b:DD2aeydbgXcH4aX7c;D;O:B8J27aeydwgecH4ae7c:3F;N8N27aCGheaKcdth8JdndndndndnaHTmbaHa8JfhYcbhXinaQaecdtfgLydbg8AcuSmlaiaHa8AcdtfydbaA2cdtfaiaYydbaA2cdtfcxz:ojjjbTmiaXcefgXaefaCGheaXaC9nmbxdkkaiaKaA2cdtfhYcbhXinaQaecdtfgLydbg8AcuSmiaia8AaA2cdtfaYcxz:ojjjbTmdaXcefgXaefaCGheaXaC9nmbkkcbhLkaLydbgecu9hmekaLaKBdbaKhekaOa8JfaeBdbaKcefgKal9hmbkcbhea8FhCinaCaeBdbaCclfhCalaecefge9hmbkcbheaOhCa8FhXindnaeaCydbgASmbaXa8FaAcdtfgAydbBdbaAaeBdbkaCclfhCaXclfhXalaecefge9hmbkkcbh8KaQcbyd;O1jjbH:bjjjbbasaaBd2ahalcbyd;S1jjbHjjjjbbgABdbasagBd2ascxfagcdtfa8Ecbyd;S1jjbHjjjjbbgeBdbasazcofgCBd2ascxfaCcdtfa8Ecbyd;S1jjbHjjjjbbgCBdbasazcrfg8LBd2aecFea5z:ljjjbh8MaCcFea5z:ljjjbh8NdnalTmba3cwfhyindnaEa8KgXcefg8Kcdtfydbg8AaEaXcdtgefydbgCSmba8AaC9Rh8Ja3aCcitfh5a8Naefhga8MaefhKcbhLindndna5aLcitfydbgQaX9hmbaKaXBdbagaXBdbxekdnaEaQcdtgafgeclfydbgCaeydbgeSmba3aecitg8AfydbaXSmeaCae9Rhhaecu7aCfhYaya8AfhCcbheinaYaeSmeaecefheaCydbh8AaCcwfhCa8AaX9hmbkaeah6meka8NaafgeaXaQaeydbcuSEBdbaKaQaXaKydbcuSEBdbkaLcefgLa8J9hmbkka8Kal9hmbkaOhCaHhLa8FhXa8Nh8Aa8MhQcbheindndnaeaCydbgY9hmbdnaqTmbaehYdnaHTmbaLydbhYkaqaYfRbbTmbaAaefcl86bbxdkdnaeaXydbgY9hmbaQydbhYdna8AydbgKcu9hmbaYcu9hmbaAaefcb86bbxikaAaefh8JdnaeaKSmbaeaYSmba8Jce86bbxika8Jcl86bbxdkdnaea8FaYcdtgKfydb9hmbdna8Aydbg8JcuSmbaea8JSmbaQydbg5cuSmbaea5Smba8NaKfydbgacuSmbaaaYSmba8MaKfydbgKcuSmbaKaYSmbdnaOa8JcdtfydbaOaKcdtfydb9hmbaOa5cdtfydbaOaacdtfydb9hmbaAaefcd86bbxlkaAaefcl86bbxikaAaefcl86bbxdkaAaefcl86bbxekaAaefaAaYfRbb86bbkaCclfhCaLclfhLaXclfhXa8Aclfh8AaQclfhQalaecefge9hmbkamceGTmbaAhealhCindnaeRbbce9hmbaecl86bbkaecefheaCcufgCmbkkascxfa8Lcdtfcualcx2alc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbggBdbasazcwVg8JBd2agaialavaHz:djjjbh8PdndnaDmbcbhvxekascxfa8JcdtfcualaD2gecdtaecFFFFi0Ecbyd;S1jjbHjjjjbbgvBdbasazcDVg8JBd2alTmbarcd4hYdnaHTmbaDcdthKcbhLavhQinaoaHaLcdtfydbaY2cdtfheawhCaQhXaDh8AinaXaeIdbaCIdbNUdbaeclfheaCclfhCaXclfhXa8Acufg8AmbkaQaKfhQaLcefgLal9hmbxdkkaYcdthYaDcdthKcbhQavhLinaoheawhCaLhXaDh8AinaXaeIdbaCIdbNUdbaeclfheaCclfhCaXclfhXa8Acufg8AmbkaoaYfhoaLaKfhLaQcefgQal9hmbkkascxfa8Jcdtfcualc8S2gealc;D;O;f8U0EgXcbyd;S1jjbHjjjjbbgCBdbasa8Jcefg8ABd2aCcbaez:ljjjbh8KdndndnaDTmbascxfa8AcdtfaXcbyd;S1jjbHjjjjbbgqBdbasa8JcdfgCBd2aqcbaez:ljjjb8AascxfaCcdtfcualaD2gecltgCaecFFFFb0Ecbyd;S1jjbHjjjjbbgwBdbasa8JcifBd2awcbaCz:ljjjb8AadmexdkcbhqcbhwadTmekcbhLabhCindnagaCclfydbgQcx2fgeIdbagaCydbgYcx2fgXIdbgI:tg8RagaCcwfydbgKcx2fg8AIdlaXIdlg8S:tgRNa8AIdbaI:tg8UaeIdla8S:tg8VN:tg8Wa8WNa8Va8AIdwaXIdwg8X:tg8YNaRaeIdwa8X:tg8VN:tgRaRNa8Va8UNa8Ya8RN:tg8Ra8RNMM:rg8UJbbbb9ETmba8Wa8U:vh8Wa8Ra8U:vh8RaRa8U:vhRka8KaOaYcdtfydbc8S2fgeaRa8U:rg8UaRNNg8VaeIdbMUdbaea8Ra8Ua8RNg8ZNg8YaeIdlMUdlaea8Wa8Ua8WNg80Ng81aeIdwMUdwaea8ZaRNg8ZaeIdxMUdxaea80aRNgBaeIdzMUdzaea80a8RNg80aeIdCMUdCaeaRa8Ua8Wa8XNaRaINa8Sa8RNMM:mg8SNgINgRaeIdKMUdKaea8RaINg8RaeId3MUd3aea8WaINg8WaeIdaMUdaaeaIa8SNgIaeId8KMUd8Kaea8UaeIdyMUdya8KaOaQcdtfydbc8S2fgea8VaeIdbMUdbaea8YaeIdlMUdlaea81aeIdwMUdwaea8ZaeIdxMUdxaeaBaeIdzMUdzaea80aeIdCMUdCaeaRaeIdKMUdKaea8RaeId3MUd3aea8WaeIdaMUdaaeaIaeId8KMUd8Kaea8UaeIdyMUdya8KaOaKcdtfydbc8S2fgea8VaeIdbMUdbaea8YaeIdlMUdlaea81aeIdwMUdwaea8ZaeIdxMUdxaeaBaeIdzMUdzaea80aeIdCMUdCaeaRaeIdKMUdKaea8RaeId3MUd3aea8WaeIdaMUdaaeaIaeId8KMUd8Kaea8UaeIdyMUdyaCcxfhCaLcifgLad6mbkcbh8JabhYinaba8JcdtfhQcbhCinaAaQaCcj1jjbfydbcdtfydbgXfRbbhedndnaAaYaCfydbg8AfRbbgLc99fcFeGcpe0mbaeceSmbaecd9hmekdnaLcufcFeGce0mba8Ma8AcdtfydbaX9hmekdnaecufcFeGce0mba8NaXcdtfydba8A9hmekdnaLcv2aefc:q1jjbfRbbTmbaOaXcdtfydbaOa8Acdtfydb0mekdnagaXcx2fgKIdwaga8Acx2fgiIdwg8S:tgRaRNaKIdbaiIdbg8X:tg8Ra8RNaKIdlaiIdlg8V:tg8Ua8UNMM:rgIJbbbb9ETmbaRaI:vhRa8UaI:vh8Ua8RaI:vh8RkJbbacJbbacJbbjZaeceSEaLceSEh80dnagaQaCc:e1jjbfydbcdtfydbcx2fgeIdwa8S:tg8WaRa8WaRNaeIdba8X:tg81a8RNa8UaeIdla8V:tg8ZNMMg8YN:tg8Wa8WNa81a8Ra8YN:tgRaRNa8Za8Ua8YN:tg8Ra8RNMM:rg8UJbbbb9ETmba8Wa8U:vh8Wa8Ra8U:vh8RaRa8U:vhRka8KaOa8Acdtfydbc8S2fgeaRa80aINg8UaRNNg8YaeIdbMUdbaea8Ra8Ua8RNg80Ng81aeIdlMUdlaea8Wa8Ua8WNgINg8ZaeIdwMUdwaea80aRNg80aeIdxMUdxaeaIaRNgBaeIdzMUdzaeaIa8RNg83aeIdCMUdCaeaRa8Ua8Wa8SNaRa8XNa8Va8RNMM:mg8SNgINgRaeIdKMUdKaea8RaINg8RaeId3MUd3aea8WaINg8WaeIdaMUdaaeaIa8SNgIaeId8KMUd8Kaea8UaeIdyMUdya8KaOaXcdtfydbc8S2fgea8YaeIdbMUdbaea81aeIdlMUdlaea8ZaeIdwMUdwaea80aeIdxMUdxaeaBaeIdzMUdzaea83aeIdCMUdCaeaRaeIdKMUdKaea8RaeId3MUd3aea8WaeIdaMUdaaeaIaeId8KMUd8Kaea8UaeIdyMUdykaCclfgCcx9hmbkaYcxfhYa8Jcifg8Jad6mbkaDTmbcbhYinJbbbbh8XagabaYcdtfgeclfydbgKcx2fgCIdwagaeydbgicx2fgXIdwg8Z:tg8Ra8RNaCIdbaXIdbgB:tg8Wa8WNaCIdlaXIdlg83:tg8Ua8UNMMg80agaecwfydbg8Jcx2fgeIdwa8Z:tgINa8Ra8RaINa8WaeIdbaB:tg8SNa8UaeIdla83:tg8VNMMgRN:tJbbbbJbbjZa80aIaINa8Sa8SNa8Va8VNMMg81NaRaRN:tg8Y:va8YJbbbb9BEg8YNhUa81a8RNaIaRN:ta8YNh85a80a8VNa8UaRN:ta8YNh86a81a8UNa8VaRN:ta8YNh87a80a8SNa8WaRN:ta8YNh88a81a8WNa8SaRN:ta8YNh89a8Wa8VNa8Sa8UN:tgRaRNa8UaINa8Va8RN:tgRaRNa8Ra8SNaIa8WN:tgRaRNMM:r:rhRavaiaD2cdtfhCava8JaD2cdtfhXavaKaD2cdtfh8Aa8Z:mh8:a83:mhZaB:mhncbhLaDhQJbbbbh8VJbbbbh8YJbbbbh80Jbbbbh81Jbbbbh8ZJbbbbhBJbbbbh83JbbbbhcJbbbbh9cinasc;WbfaLfgecwfaRa85a8AIdbaCIdbgI:tg8UNaUaXIdbaI:tg8SNMg8RNUdbaeclfaRa87a8UNa86a8SNMg8WNUdbaeaRa89a8UNa88a8SNMg8UNUdbaecxfaRa8:a8RNaZa8WNaIana8UNMMMgINUdbaRa8Ra8WNNa81Mh81aRa8Ra8UNNa8ZMh8ZaRa8Wa8UNNaBMhBaRaIaINNa8XMh8XaRa8RaINNa8VMh8VaRa8WaINNa8YMh8YaRa8UaINNa80Mh80aRa8Ra8RNNa83Mh83aRa8Wa8WNNacMhcaRa8Ua8UNNa9cMh9caCclfhCa8Aclfh8AaXclfhXaLczfhLaQcufgQmbkaqaOaicdtfydbgCc8S2fgea9caeIdbMUdbaeacaeIdlMUdlaea83aeIdwMUdwaeaBaeIdxMUdxaea8ZaeIdzMUdzaea81aeIdCMUdCaea80aeIdKMUdKaea8YaeId3MUd3aea8VaeIdaMUdaaea8XaeId8KMUd8KaeaRaeIdyMUdyaqaOaKcdtfydbgKc8S2fgea9caeIdbMUdbaeacaeIdlMUdlaea83aeIdwMUdwaeaBaeIdxMUdxaea8ZaeIdzMUdzaea81aeIdCMUdCaea80aeIdKMUdKaea8YaeId3MUd3aea8VaeIdaMUdaaea8XaeId8KMUd8KaeaRaeIdyMUdyaqaOa8Jcdtfydbgic8S2fgea9caeIdbMUdbaeacaeIdlMUdlaea83aeIdwMUdwaeaBaeIdxMUdxaea8ZaeIdzMUdzaea81aeIdCMUdCaea80aeIdKMUdKaea8YaeId3MUd3aea8VaeIdaMUdaaea8XaeId8KMUd8KaeaRaeIdyMUdyawaCaD2cltfhQcbhCaDh8AinaQaCfgeasc;WbfaCfgXIdbaeIdbMUdbaeclfgLaXclfIdbaLIdbMUdbaecwfgLaXcwfIdbaLIdbMUdbaecxfgeaXcxfIdbaeIdbMUdbaCczfhCa8Acufg8AmbkawaKaD2cltfhQcbhCaDh8AinaQaCfgeasc;WbfaCfgXIdbaeIdbMUdbaeclfgLaXclfIdbaLIdbMUdbaecwfgLaXcwfIdbaLIdbMUdbaecxfgeaXcxfIdbaeIdbMUdbaCczfhCa8Acufg8AmbkawaiaD2cltfhQcbhCaDh8AinaQaCfgeasc;WbfaCfgXIdbaeIdbMUdbaeclfgLaXclfIdbaLIdbMUdbaecwfgLaXcwfIdbaLIdbMUdbaecxfgeaXcxfIdbaeIdbMUdbaCczfhCa8Acufg8AmbkaYcifgYad6mbkkasydlhJcbhednalTmbaJclfheaJydbh8AaAhCalhLcbhXincbaeydbgQa8A9RaCRbbcpeGEaXfhXaCcefhCaeclfheaQh8AaLcufgLmbkaXce4hekcuadae9Rcifg8Lcx2a8Lc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhhascxfasyd2gecdtfahBdbasaecefgCBd2ascxfaCcdtfcua8Lcdta8LcFFFFi0Ecbyd;S1jjbHjjjjbbgzBdbasaecdfgCBd2ascxfaCcdtfa8Ecbyd;S1jjbHjjjjbbg3BdbasaecifgCBd2ascxfaCcdtfalcbyd;S1jjbHjjjjbbg9eBdbasaeclfBd2a8PJbbjZamclGEhcJbbbbh83dnadak9nmbdna8Lci6mbaxaxNacacN:vhBaDclthTahcwfhSJbbbbh83inasclfabadgoalaOz:cjjjbabhicbhEcbhyinabaycdtfh8JcbheindnaOaiaefydbgXcdtgKfydbg8AaOa8Jaec:S1jjbfydbcdtfydbgCcdtfydbgLSmbaAaCfRbbgYcv2aAaXfRbbgQfc;a1jjbfRbbgaaQcv2aYfg5c;a1jjbfRbbgdVcFeGTmbdnaLa8A9nmba5c:q1jjbfRbbcFeGmekdnaQaY9hmbaQcufcFeGce0mba8MaKfydbaC9hmekahaEcx2fg8AaCaXadcFeGgLEBdla8AaXaCaLEBdba8AaLaaGcb9hBdwaEcefhEkaeclfgecx9hmbkdnaycifgyao9pmbaicxfhiaEcifa8L9nmekkdnaEmbaohdxikcbhYinJbbbbJbbjZa8KaOahaYcx2fg8AydlgLa8AydbgQa8AydwgCEgicdtfydbgac8S2gdfgeIdygR:vaRJbbbb9BEaeIdwagaQaLaCEgKcx2fgCIdwg8UNaeIdzaCIdbgINaeIdaMgRaRMMa8UNaeIdlaCIdlg8SNaeIdCa8UNaeId3MgRaRMMa8SNaeIdbaINaeIdxa8SNaeIdKMgRaRMMaINaeId8KMMM:lNh80JbbbbJbbjZa8KaOaQcdtfydbgyc8S2gXfgeIdygR:vaRJbbbb9BEaeIdwagaLcx2fgCIdwg8WNaeIdzaCIdbg8XNaeIdaMgRaRMMa8WNaeIdlaCIdlg8VNaeIdCa8WNaeId3MgRaRMMa8VNaeIdba8XNaeIdxa8VNaeIdKMgRaRMMa8XNaeId8KMMM:lNh81a8Acwfh8Ja8Aclfh5dnaDTmbaqaXfgXIdwa8WNaXIdza8XNaXIdaMgRaRMMa8WNaXIdla8VNaXIdCa8WNaXId3MgRaRMMa8VNaXIdba8XNaXIdxa8VNaXIdKMgRaRMMa8XNaXId8KMMMh8RavaLaD2cdtfhCawayaD2cltfheaXIdyh8YaDhXinaCIdbgRJbbb;aNaecxfIdba8WaecwfIdbNa8XaeIdbNa8VaeclfIdbNMMMNaRaRNa8YNa8RMMh8RaCclfhCaeczfheaXcufgXmbkaqadfgXIdwa8UNaXIdzaINaXIdaMgRaRMMa8UNaXIdla8SNaXIdCa8UNaXId3MgRaRMMa8SNaXIdbaINaXIdxa8SNaXIdKMgRaRMMaINaXId8KMMMh8WavaKaD2cdtfhCawaaaD2cltfheaXIdyh8XaDhXinaCIdbgRJbbb;aNaecxfIdba8UaecwfIdbNaIaeIdbNa8SaeclfIdbNMMMNaRaRNa8XNa8WMMh8WaCclfhCaeczfheaXcufgXmbka80a8W:lMh80a81a8R:lMh81ka5aLaKa81a809FgeEBdba8AaQaiaeEBdba8Ja81a80aeEUdbaYcefgYaE9hmbkasc;Wbfcbcj;abz:ljjjb8AaSheaEhCinasc;WbfaeydbcO4c;8ZGfgXaXydbcefBdbaecxfheaCcufgCmbkcbhecbhCinasc;WbfaefgXydbh8AaXaCBdba8AaCfhCaeclfgecj;ab9hmbkcbheaShCinasc;WbfaCydbcO4c;8ZGfgXaXydbgXcefBdbazaXcdtfaeBdbaCcxfhCaEaecefge9hmbkaoak9RgXci9Uh9hdnalTmbcbhea3hCinaCaeBdbaCclfhCalaecefge9hmbkkcbh9ia9ecbalz:ljjjbh6aXcO9Uh9ka9hce4h0asydwh9mcbhdcbh5dninahaza5cdtfydbcx2fg8JIdwg8RaB9Emeada9h9pmeJFFuuhRdna0aE9pmbahaza0cdtfydbcx2fIdwJbb;aZNhRkdna8RaR9ETmbada9k0mdkdna6aOa8Jydlg9ncdtg9ofydbg8Afg9pRbba6aOa8Jydbgicdtg9qfydbg9rfg9sRbbVmbdnaJa9rcdtfgeclfydbgCaeydbgeSmbaCae9RhQa9maecitfheaga8Acx2fgKcwfhyaKclfh8Eaga9rcx2fgacwfhmaaclfhrcbhCcehYdnindna3aeydbcdtfydbgXa8ASmba3aeclfydbcdtfydbgLa8ASmbaXaLSmbagaLcx2fgLIdbagaXcx2fgXIdbg8W:tgRarIdbaXIdlg8U:tg8XNaaIdba8W:tg8VaLIdla8U:tg8RN:tgIaRa8EIdba8U:tg8YNaKIdba8W:tg80a8RN:tg8UNa8RamIdbaXIdwg8S:tg81Na8XaLIdwa8S:tg8WN:tg8Xa8RayIdba8S:tg8ZNa8Ya8WN:tg8RNa8Wa8VNa81aRN:tg8Sa8Wa80Na8ZaRN:tgRNMMaIaINa8Xa8XNa8Sa8SNMMa8Ua8UNa8Ra8RNaRaRNMMN:rJbbj8:N9FmdkaecwfheaCcefgCaQ6hYaQaC9hmbkkaYceGTmba0cefh0xeka8Ka8Ac8S2gXfgea8Ka9rc8S2gLfgCIdbaeIdbMUdbaeaCIdlaeIdlMUdlaeaCIdwaeIdwMUdwaeaCIdxaeIdxMUdxaeaCIdzaeIdzMUdzaeaCIdCaeIdCMUdCaeaCIdKaeIdKMUdKaeaCId3aeId3MUd3aeaCIdaaeIdaMUdaaeaCId8KaeId8KMUd8KaeaCIdyaeIdyMUdydnaDTmbaqaXfgeaqaLfgCIdbaeIdbMUdbaeaCIdlaeIdlMUdlaeaCIdwaeIdwMUdwaeaCIdxaeIdxMUdxaeaCIdzaeIdzMUdzaeaCIdCaeIdCMUdCaeaCIdKaeIdKMUdKaeaCId3aeId3MUd3aeaCIdaaeIdaMUdaaeaCId8KaeId8KMUd8KaeaCIdyaeIdyMUdyaTa9r2hYaTa8A2hKawhCaDhLinaCaKfgeaCaYfgXIdbaeIdbMUdbaeclfgQaXclfIdbaQIdbMUdbaecwfgQaXcwfIdbaQIdbMUdbaecxfgeaXcxfIdbaeIdbMUdbaCczfhCaLcufgLmbkka8JcwfhCdndndndnaAaifgXRbbc9:fPdebdkaiheina3aecdtgefa8ABdba8Faefydbgeai9hmbxikka8Fa9ofydbhea8Fa9qfydbhia3a9qfa9nBdbaeh9nka3aicdtfa9nBdbka9sce86bba9pce86bbaCIdbgRa83a83aR9DEh83a9icefh9icecdaXRbbceSEadfhdka5cefg5aE9hmbkkdna9imbaohdxikdnalTmbcbhCa8MheindnaeydbgXcuSmbdnaCa3aXcdtg8AfydbgX9hmba8Ma8AfydbhXkaeaXBdbkaeclfhealaCcefgC9hmbkcbhCa8NheindnaeydbgXcuSmbdnaCa3aXcdtg8AfydbgX9hmba8Na8AfydbhXkaeaXBdbkaeclfhealaCcefgC9hmbkkcbhdabhecbhLindna3aeydbcdtfydbgCa3aeclfydbcdtfydbgXSmbaCa3aecwfydbcdtfydbg8ASmbaXa8ASmbabadcdtfgQaCBdbaQcwfa8ABdbaQclfaXBdbadcifhdkaecxfheaLcifgLao6mbkadak9nmdxbkkasclfabadalaOz:cjjjbkdnaHTmbadTmbadheinabaHabydbcdtfydbBdbabclfhbaecufgembkkdnaPTmbaPaca83:rNUdbkasyd2gecdtascxffc98fhOdninaeTmeaOydbcbyd;O1jjbH:bjjjbbaOc98fhOaecufhexbkkasc;W;abf8Kjjjjbadk;Yieouabydlhvabydbclfcbaicdtz:ljjjbhoadci9UhrdnadTmbdnalTmbaehwadhDinaoalawydbcdtfydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbxdkkaehwadhDinaoawydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbkkdnaiTmbcbhDaohwinawydbhqawaDBdbawclfhwaqaDfhDaicufgimbkkdnadci6mbinaecwfydbhwaeclfydbhDaeydbhidnalTmbalawcdtfydbhwalaDcdtfydbhDalaicdtfydbhikavaoaicdtfgqydbcitfaDBdbavaqydbcitfawBdlaqaqydbcefBdbavaoaDcdtfgqydbcitfawBdbavaqydbcitfaiBdlaqaqydbcefBdbavaoawcdtfgwydbcitfaiBdbavawydbcitfaDBdlawawydbcefBdbaecxfhearcufgrmbkkabydbcbBdbk;Podvuv998Jjjjjbca9RgvcFFF;7rBd3av9cFFF;7;3FF:;Fb83dCavcFFF97Bdzav9cFFF;7FFF:;u83dwdnadTmbaicd4hodnabmbdnalTmbcbhrinaealarcdtfydbao2cdtfhwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkarcefgrad9hmbxikkaocdthrcbhwincbhiinavcCfaifgDaeaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkaearfheawcefgwad9hmbxdkkdnalTmbcbhrinabarcx2fgiaealarcdtfydbao2cdtfgwIdbUdbaiawIdlUdlaiawIdwUdwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkarcefgrad9hmbxdkkaocdthlcbhraehwinabarcx2fgiaearao2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkawalfhwarcefgrad9hmbkkJbbbbavIdwavIdCgk:tgqaqJbbbb9DEgqavIdxavIdKgx:tgmamaq9DEgqavIdzavId3gm:tgPaPaq9DEhPdnabTmbadTmbJbbbbJbbjZaP:vaPJbbbb9BEhqinabaqabIdbak:tNUdbabclfgvaqavIdbax:tNUdbabcwfgvaqavIdbam:tNUdbabcxfhbadcufgdmbkkaPk8MbabaeadaialavcbcbcbcbcbaoarawaDz:bjjjbk8MbabaeadaialavaoarawaDaqakaxamaPz:bjjjbk;3Aowud99wue99iul998Jjjjjbc;Wb9Rgw8KjjjjbdndnarmbcbhDxekawcxfcbc;Kbz:ljjjb8Aawcuadcx2adc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbgqBdxawceBd2aqaeadaicbz:djjjb8AawcuadcdtadcFFFFi0Egkcbyd;S1jjbHjjjjbbgxBdzawcdBd2adcd4adfhmceheinaegicetheaiam6mbkcbhmawcuaicdtgPaicFFFFi0Ecbyd;S1jjbHjjjjbbgsBdCawciBd2dndnar: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:Ohexdkcjjjj94hexekamaAfcd9Theka3aQaiEhQaXcefgXcs9hmekkdndnaCmbcihicbhDxekcbhiawakcbyd;S1jjbHjjjjbbg5BdKawclBd2dndnadTmbamcuf:YhHaqhiaxheadhmindndnaiIdbaHNJbbbZMg8A:lJbbb9p9DTmba8A:OhAxekcjjjj94hAkaAcCthAdndnaiclfIdbaHNJbbbZMg8A:lJbbb9p9DTmba8A:OhCxekcjjjj94hCkaCcqtaAVhAdndnaicwfIdbaHNJbbbZMg8A:lJbbb9p9DTmba8A:OhCxekcjjjj94hCkaeaAaCVBdbaicxfhiaeclfheamcufgmmbkascFeaPz:ljjjbhEcbhDcbh3inaxa3cdtgYfydbgAcm4aA7c:v;t;h;Ev2gics4ai7hecbhidndninaEaeaOGgmcdtfgCydbgecuSmednaxaecdtgCfydbaASmbaicefgiamfheaiaO9nmekka5aCfydbhixekaCa3BdbaDhiaDcefhDka5aYfaiBdba3cefg3ad9hmbkcuaDc32giaDc;j:KM;jb0EhexekascFeaPz:ljjjb8AcbhDcbhekawaecbyd;S1jjbHjjjjbbgeBd3awcvBd2aecbaiz:ljjjbhCavcd4hxdnadTmbdnalTmbaxcdthEa5hAalheaqhmadhOinaCaAydbc32fgiamIdbaiIdbMUdbaiamclfIdbaiIdlMUdlaiamcwfIdbaiIdwMUdwaiaeIdbaiIdxMUdxaiaeclfIdbaiIdzMUdzaiaecwfIdbaiIdCMUdCaiaiIdKJbbjZMUdKaAclfhAaeaEfheamcxfhmaOcufgOmbxdkka5hmaqheadhAinaCamydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiaiIdxJbbbbMUdxaiaiIdzJbbbbMUdzaiaiIdCJbbbbMUdCaiaiIdKJbbjZMUdKamclfhmaecxfheaAcufgAmbkkdnaDTmbaChiaDheinaiaiIdbJbbbbJbbjZaicKfIdbgH:vaHJbbbb9BEgHNUdbaiclfgmaHamIdbNUdbaicwfgmaHamIdbNUdbaicxfgmaHamIdbNUdbaiczfgmaHamIdbNUdbaicCfgmaHamIdbNUdbaic3fhiaecufgembkkcbhAawcuaDcdtgYaDcFFFFi0Egicbyd;S1jjbHjjjjbbgeBdaawcoBd2awaicbyd;S1jjbHjjjjbbgEBd8KaecFeaYz:ljjjbh3dnadTmbaoaoNh8Aaxcdthxalheina8Aaec;C1jjbalEgmIdwaCa5ydbgOc32fgiIdC:tgHaHNamIdbaiIdx:tgHaHNamIdlaiIdz:tgHaHNMMNaqcwfIdbaiIdw:tgHaHNaqIdbaiIdb:tgHaHNaqclfIdbaiIdl:tgHaHNMMMhHdndna3aOcdtgifgmydbcuSmbaEaifIdbaH9ETmekamaABdbaEaifaHUdbka5clfh5aeaxfheaqcxfhqadaAcefgA9hmbkkaba3aYz:kjjjb8AcrhikaicdthiinaiTmeaic98fgiawcxffydbcbyd;O1jjbH:bjjjbbxbkkawc;Wbf8KjjjjbaDk:Odieui99iu8Jjjjjbca9RgicFFF;7rBd3ai9cFFF;7;3FF:;Fb83dCaicFFF97Bdzai9cFFF;7FFF:;u83dwdndnaembJbbjFhlJbbjFhvJbbjFhoxekadcd4cdthrcbhwincbhdinaicCfadfgDabadfIdbglaDIdbgvaval9EEUdbaicwfadfgDalaDIdbgvaval9DEUdbadclfgdcx9hmbkabarfhbawcefgwae9hmbkaiIdzaiId3:thoaiIdxaiIdK:thvaiIdwaiIdC:thlkJbbbbalalJbbbb9DEglavaval9DEglaoaoal9DEk9DeeuabcFeaicdtz:ljjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk9teiucbcbyd;W1jjbgeabcifc98GfgbBd;W1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;W1jjbgeabcrfc94GfgbBd;W1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd;W1jjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd;W1jjbfgdBd;W1jjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk6eiucbhidnadTmbdninabRbbglaeRbbgv9hmeaecefheabcefhbadcufgdmbxdkkalav9Rhikaikk:bedbcjwk9Oebbbdbbbbbbbebbbeeebeebebbeeebebbbbbebebbbbbebbbdbbbbbbbbbbbbbbbeeeeebebbbbbebbbbbeebbbbbbbbbbbbbbbbbbbbbc;Owkxebbbdbbbj9Kbb",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),E=s(x);Z.set(E,V);var X=f(L,V,x.length,_);Z=new Uint8Array(n.exports.memory.buffer);var v=new Uint32Array(_);new Uint8Array(v.buffer).set(Z.subarray(L,L+_*4)),E.set(Z.subarray(V,V+x.length*4)),C(V-C(0));for(var P=0;P<x.length;++P)x[P]=v[x[P]];return[v,X]}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,E,X){var v=n.exports.sbrk,P=v(4),A=v(_*4),M=v(V*L),b=v(_*4),R=new Uint8Array(n.exports.memory.buffer);R.set(s(C),M),R.set(s(x),b);var G=f(A,b,_,M,V,L,Z,E,X,P);R=new Uint8Array(n.exports.memory.buffer);var I=new Uint32Array(G);s(I).set(R.subarray(A,A+G*4));var w=new Float32Array(1);return s(w).set(R.subarray(P,P+4)),v(P-v(0)),[I,w[0]]}function u(f,x,_,C,V,L,Z,E,X,v,P,A,M){var b=n.exports.sbrk,R=b(4),G=b(_*4),I=b(V*L),w=b(V*E),N=b(X.length*4),B=b(_*4),U=v?b(V):0,O=new Uint8Array(n.exports.memory.buffer);O.set(s(C),I),O.set(s(Z),w),O.set(s(X),N),O.set(s(x),B),v&&O.set(s(v),U);var k=f(G,B,_,I,V,L,w,E,N,X.length,U,P,A,M,R);O=new Uint8Array(n.exports.memory.buffer);var J=new Uint32Array(k);s(J).set(O.subarray(G,G+k*4));var H=new Float32Array(1);return s(H).set(O.subarray(R,R+4)),b(R-b(0)),[J,H[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 E=f(L,_,C);return V(L-V(0)),E}function p(f,x,_,C,V,L,Z,E){var X=n.exports.sbrk,v=X(E*4),P=X(_*C),A=X(_*L),M=new Uint8Array(n.exports.memory.buffer);M.set(s(x),P),V&&M.set(s(V),A);var b=f(v,P,_,C,A,L,Z,E);M=new Uint8Array(n.exports.memory.buffer);var R=new Uint32Array(b);return s(R).set(M.subarray(v,v+b*4)),X(v-X(0)),R}var g={LockBorder:1,Sparse:2,ErrorAbsolute:4};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);for(var Z=0,E=0;E<(L?L.length:0);++E)r(L[E]in g),Z|=g[L[E]];var X=f.BYTES_PER_ELEMENT==4?f:new Uint32Array(f),v=d(n.exports.meshopt_simplify,X,f.length,x,x.length/_,_*4,C,V,Z);return v[0]=f instanceof Uint32Array?v[0]:new f.constructor(v[0]),v},simplifyWithAttributes:function(f,x,_,C,V,L,Z,E,X,v){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==null||Z.length==x.length),r(E>=0&&E<=f.length),r(E%3==0),r(X>=0),r(Array.isArray(L)),r(V>=L.length),r(L.length<=16);for(var P=0,A=0;A<(v?v.length:0);++A)r(v[A]in g),P|=g[v[A]];var M=f.BYTES_PER_ELEMENT==4?f:new Uint32Array(f),b=u(n.exports.meshopt_simplifyWithAttributes,M,f.length,x,x.length/_,_*4,C,V*4,new Float32Array(L),Z?new Uint8Array(Z):null,E,X,P);return b[0]=f instanceof Uint32Array?b[0]:new f.constructor(b[0]),b},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 Ox(e){e=y(e,y.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,g,f,x;if(ii(a,"EXT_meshopt_compression")){let C=a.extensions.EXT_meshopt_compression;c=C.buffer,d=y(C.byteOffset,0),u=C.byteLength,m=!0,p=C.byteStride,g=C.count,f=C.mode,x=y(C.filter,"NONE")}let _=n.buffers[c];this._hasMeshopt=m,this._meshoptByteStride=p,this._meshoptCount=g,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=It.UNLOADED,this._promise=void 0}l(Object.create)&&(Ox.prototype=Object.create(eo.prototype),Ox.prototype.constructor=Ox);Object.defineProperties(Ox.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});async function EFe(e){try{let t=XFe(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);boe.decodeGltfBuffer(s,o,r,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=s}return e._state=It.READY,e}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=It.FAILED,e.getError("Failed to load buffer view",t)}}Ox.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=It.LOADING,this._promise=EFe(this),this._promise)};function XFe(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})}Ox.prototype.unload=function(){l(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0};var mC=Ox;var Isn=T(S(),1);var Vsn=T(S(),1);function Er(){}Er._maxDecodingConcurrency=Math.max(Ot.hardwareConcurrency-1,1);Er._decoderTaskProcessor=void 0;Er._taskProcessorReady=!1;Er._error=void 0;Er._getDecoderTaskProcessor=function(){if(!l(Er._decoderTaskProcessor)){let e=new bi("decodeDraco",Er._maxDecodingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(t){t?Er._taskProcessorReady=!0:Er._error=new ue("Draco decoder could not be initialized.")}).catch(t=>{Er._error=t}),Er._decoderTaskProcessor=e}return Er._decoderTaskProcessor};Er.decodePointCloud=function(e){let t=Er._getDecoderTaskProcessor();if(l(Er._error))throw Er._error;if(Er._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])};Er.decodeBufferView=function(e){let t=Er._getDecoderTaskProcessor();if(l(Er._error))throw Er._error;if(Er._taskProcessorReady)return t.scheduleTask(e,[e.array.buffer])};var Up=Er;function Jb(e){e=y(e,y.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=It.UNLOADED,this._promise=void 0,this._dracoError=void 0}l(Object.create)&&(Jb.prototype=Object.create(eo.prototype),Jb.prototype.constructor=Jb);Object.defineProperties(Jb.prototype,{cacheKey:{get:function(){return this._cacheKey}},decodedData:{get:function(){return this._decodedData}}});async function IFe(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=It.PROCESSING,e)}catch(n){if(e.isDestroyed())return;goe(e,n)}}Jb.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=It.LOADING,this._promise=IFe(this),this._promise)};function goe(e,t){throw e.unload(),e._state=It.FAILED,e.getError("Failed to load Draco",t)}async function WFe(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=It.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}Jb.prototype.process=function(e){if(this._state===It.READY)return!0;if(this._state!==It.PROCESSING||(l(this._dracoError)&&goe(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=Up.decodeBufferView(a);if(!l(c))return!1;this._decodePromise=WFe(this,c)};Jb.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 hC=Jb;var Osn=T(S(),1);var Fsn=T(S(),1);function PFe(e){let t=e.uint8Array,n=e.format,i=e.request,o=y(e.flipY,!1),r=y(e.skipColorSpaceConversion,!1),s=new Blob([t],{type:n}),a;return Ee.supportsImageBitmapOptions().then(function(c){return c?Promise.resolve(Ee.createImageBitmapFromBlob(s,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:r})):(a=window.URL.createObjectURL(s),new Ee({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 Hx=PFe;function Dp(e){e=y(e,y.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=It.UNLOADED,this._promise=void 0}l(Object.create)&&(Dp.prototype=Object.create(eo.prototype),Dp.prototype.constructor=Dp);Object.defineProperties(Dp.prototype,{cacheKey:{get:function(){return this._cacheKey}},image:{get:function(){return this._image}},mipLevels:{get:function(){return this._mipLevels}}});Dp.prototype.load=function(){return l(this._promise)?this._promise:l(this._bufferViewId)?(this._promise=vFe(this),this._promise):(this._promise=wFe(this),this._promise)};function yoe(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 vFe(e){e._state=It.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 AFe(i);if(e.isDestroyed())return;let r=yoe(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=It.READY,e}catch(n){return e.isDestroyed()?void 0:xoe(e,n,"Failed to load embedded image")}}async function wFe(e){e._state=It.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let o=await NFe(i);if(e.isDestroyed())return;let r=yoe(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=It.READY,e}catch(o){return e.isDestroyed()?void 0:xoe(e,o,`Failed to load image: ${n}`)}}function xoe(e,t,n){return e.unload(),e._state=It.FAILED,Promise.reject(e.getError(n,t))}function FFe(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 ue("Image format is not recognized")}async function AFe(e){let t=FFe(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return bl(n)}return Dp._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var MFe=/(^data:image\/ktx2)|(\.ktx2$)/i;function NFe(e){let t=e.getUrlComponent(!1,!0);return MFe.test(t)?bl(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}Dp.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};Dp._loadImageFromTypedArray=Hx;var fC=Dp;var ran=T(S(),1);var zsn=T(S(),1),kFe={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},Ea=Object.freeze(kFe);function Qb(e){e=y(e,y.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=y(e.asynchronous,!0),d=y(e.loadBuffer,!1),u=y(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=It.UNLOADED,this._promise=void 0}l(Object.create)&&(Qb.prototype=Object.create(eo.prototype),Qb.prototype.constructor=Qb);Object.defineProperties(Qb.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 UFe=new dH;Qb.prototype.load=async function(){return l(this._promise)?this._promise:l(this._draco)?(this._promise=DFe(this),this._promise):(this._promise=BFe(this),this._promise)};async function DFe(e){e._state=It.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=It.LOADED,e)}catch(n){if(e.isDestroyed())return;lH(e,n)}}async function BFe(e){let t=e._gltf,n=e._accessorId,o=t.accessors[n].bufferView;e._state=It.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=YFe(e,a),e._state=It.PROCESSING,e}catch(s){if(e.isDestroyed())return;lH(e,s)}}function YFe(e,t){let n=e._gltf,i=e._accessorId,o=n.accessors[i],r=o.count,s=o.componentType,a=Ae.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,Es("index-buffer-unaligned",`The index array is not aligned to a ${a}-byte boundary.`)}let u;return s===Ae.UNSIGNED_BYTE?u=new Uint8Array(c,d,r):s===Ae.UNSIGNED_SHORT?u=new Uint16Array(c,d,r):s===Ae.UNSIGNED_INT&&(u=new Uint32Array(c,d,r)),u}function lH(e,t){throw e.unload(),e._state=It.FAILED,e.getError("Failed to load index buffer",t)}function dH(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}dH.prototype.set=function(e,t,n){this.typedArray=e,this.indexDatatype=t,this.context=n};dH.prototype.execute=function(){this.buffer=_oe(this.typedArray,this.indexDatatype,this.context)};function _oe(e,t,n){let i=yt.createIndexBuffer({typedArray:e,context:n,usage:Me.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}Qb.prototype.process=function(e){if(this._state===It.READY)return!0;if(this._state!==It.LOADED&&this._state!==It.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){lH(this,o)}if(!l(t))return!1;let i;if(this._loadBuffer&&this._asynchronous){let o=UFe;if(o.set(t,n,e.context),!e.jobScheduler.execute(o,Ea.BUFFER))return!1;i=o.buffer}else this._loadBuffer&&(i=_oe(t,n,e.context));return this.unload(),this._buffer=i,this._typedArray=this._loadTypedArray?t:void 0,this._state=It.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};Qb.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 pC=Qb;var bdn=T(S(),1);var Xan=T(S(),1);var can=T(S(),1);function OFe(e,t,n){if(n=y(n,!1),n){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1}var ps=OFe;var pan=T(S(),1);var uan=T(S(),1);function HFe(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var or=HFe;function Jt(){}Jt.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}}};Jt.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}}};Jt.topLevel=function(e,t,n){let i=e[t];return l(i)&&!Array.isArray(i)?Jt.objectLegacy(i,n):Jt.object(i,n)};Jt.accessor=function(e,t){return Jt.topLevel(e,"accessors",t)};Jt.accessorWithSemantic=function(e,t,n){let i={};return Jt.mesh(e,function(o){return Jt.meshPrimitive(o,function(r){let s=Jt.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:Jt.meshPrimitiveTarget(r,function(a){return Jt.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}})})})})};Jt.accessorContainingVertexAttributeData=function(e,t){let n={};return Jt.mesh(e,function(i){return Jt.meshPrimitive(i,function(o){let r=Jt.meshPrimitiveAttribute(o,function(s){if(!l(n[s])){n[s]=!0;let a=t(s);if(l(a))return a}});return l(r)?r:Jt.meshPrimitiveTarget(o,function(s){return Jt.meshPrimitiveTargetAttribute(s,function(a){if(!l(n[a])){n[a]=!0;let c=t(a);if(l(c))return c}})})})})};Jt.accessorContainingIndexData=function(e,t){let n={};return Jt.mesh(e,function(i){return Jt.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}})})};Jt.animation=function(e,t){return Jt.topLevel(e,"animations",t)};Jt.animationChannel=function(e,t){let n=e.channels;return Jt.object(n,t)};Jt.animationSampler=function(e,t){let n=e.samplers;return Jt.object(n,t)};Jt.buffer=function(e,t){return Jt.topLevel(e,"buffers",t)};Jt.bufferView=function(e,t){return Jt.topLevel(e,"bufferViews",t)};Jt.camera=function(e,t){return Jt.topLevel(e,"cameras",t)};Jt.image=function(e,t){return Jt.topLevel(e,"images",t)};Jt.material=function(e,t){return Jt.topLevel(e,"materials",t)};Jt.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}};Jt.mesh=function(e,t){return Jt.topLevel(e,"meshes",t)};Jt.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}}};Jt.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}};Jt.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}}};Jt.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}};Jt.node=function(e,t){return Jt.topLevel(e,"nodes",t)};Jt.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=Jt.nodeInTree(e,d,n),l(c)))return c}}}};Jt.nodeInScene=function(e,t,n){let i=t.nodes;if(l(i))return Jt.nodeInTree(e,i,n)};Jt.program=function(e,t){return or(e,"KHR_techniques_webgl")?Jt.object(e.extensions.KHR_techniques_webgl.programs,t):Jt.topLevel(e,"programs",t)};Jt.sampler=function(e,t){return Jt.topLevel(e,"samplers",t)};Jt.scene=function(e,t){return Jt.topLevel(e,"scenes",t)};Jt.shader=function(e,t){return or(e,"KHR_techniques_webgl")?Jt.object(e.extensions.KHR_techniques_webgl.shaders,t):Jt.topLevel(e,"shaders",t)};Jt.skin=function(e,t){return Jt.topLevel(e,"skins",t)};Jt.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}}};Jt.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}};Jt.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}};Jt.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}};Jt.technique=function(e,t){return or(e,"KHR_techniques_webgl")?Jt.object(e.extensions.KHR_techniques_webgl.techniques,t):Jt.topLevel(e,"techniques",t)};Jt.texture=function(e,t){return Jt.topLevel(e,"textures",t)};var We=Jt;var San=T(S(),1);var gan=T(S(),1);function zFe(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 pd=zFe;function KFe(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)*pd(t.type)}var Gl=KFe;function JFe(e){We.accessor(e,function(n){l(n.bufferView)&&(n.byteOffset=y(n.byteOffset,0))}),We.bufferView(e,function(n){l(n.buffer)&&(n.byteOffset=y(n.byteOffset,0))}),We.mesh(e,function(n){We.meshPrimitive(n,function(i){if(i.mode=y(i.mode,ie.TRIANGLES),!l(i.material)){l(e.materials)||(e.materials=[]);let o={name:"default"};i.material=ps(e.materials,o)}})}),We.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],o=i.bufferView;if(i.normalized=y(i.normalized,!1),l(o)){let r=e.bufferViews[o];r.byteStride=Gl(e,i),r.target=ie.ARRAY_BUFFER}}),We.accessorContainingIndexData(e,function(n){let o=e.accessors[n].bufferView;if(l(o)){let r=e.bufferViews[o];r.target=ie.ELEMENT_ARRAY_BUFFER}}),We.material(e,function(n){let i=y(n.extensions,y.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=y(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=y(d.shininess,0))),o.transparent=y(o.transparent,!1),o.doubleSided=y(o.doubleSided,!1);return}n.emissiveFactor=y(n.emissiveFactor,[0,0,0]),n.alphaMode=y(n.alphaMode,"OPAQUE"),n.doubleSided=y(n.doubleSided,!1),n.alphaMode==="MASK"&&(n.alphaCutoff=y(n.alphaCutoff,.5));let r=i.KHR_techniques_webgl;l(r)&&We.materialValue(n,function(c){l(c.index)&&zx(c)}),zx(n.emissiveTexture),zx(n.normalTexture),zx(n.occlusionTexture);let s=n.pbrMetallicRoughness;l(s)&&(s.baseColorFactor=y(s.baseColorFactor,[1,1,1,1]),s.metallicFactor=y(s.metallicFactor,1),s.roughnessFactor=y(s.roughnessFactor,1),zx(s.baseColorTexture),zx(s.metallicRoughnessTexture));let a=i.KHR_materials_pbrSpecularGlossiness;l(a)&&(a.diffuseFactor=y(a.diffuseFactor,[1,1,1,1]),a.specularFactor=y(a.specularFactor,[1,1,1]),a.glossinessFactor=y(a.glossinessFactor,1),zx(a.specularGlossinessTexture))}),We.animation(e,function(n){We.animationSampler(n,function(i){i.interpolation=y(i.interpolation,"LINEAR")})});let t=QFe(e);return We.node(e,function(n,i){l(t[i])||l(n.translation)||l(n.rotation)||l(n.scale)?(n.translation=y(n.translation,[0,0,0]),n.rotation=y(n.rotation,[0,0,0,1]),n.scale=y(n.scale,[1,1,1])):n.matrix=y(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=y(n.wrapS,ie.REPEAT),n.wrapT=y(n.wrapT,ie.REPEAT)}),l(e.scenes)&&!l(e.scene)&&(e.scene=0),e}function QFe(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 zx(e){l(e)&&(e.texCoord=y(e.texCoord,0))}var _X=JFe;var van=T(S(),1);function jFe(e){return We.shader(e,function(t){jN(t)}),We.buffer(e,function(t){jN(t)}),We.image(e,function(t){jN(t)}),jN(e),e}function jN(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var jb=jFe;var Qan=T(S(),1);var Uan=T(S(),1);var Aan=T(S(),1);function qFe(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 TX=qFe;function $Fe(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),TX(e,t),n.length===0&&delete e.extensionsUsed}}var Kx=$Fe;var e9e=4;function t9e(e){if(Xm(e)!=="glTF")throw new ue("File is not valid binary glTF");let n=Toe(e,0,5),i=n[1];if(i!==1&&i!==2)throw new ue("Binary glTF version is not 1 or 2");return i===1?n9e(e,n):i9e(e,n)}function Toe(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*e9e,!0);return o}function n9e(e,t){let n=t[2],i=t[3];if(t[4]!==0)throw new ue("Binary glTF scene format is not JSON");let r=20,s=r+i,a=Vl(e,r,i),c=JSON.parse(a);jb(c);let d=e.subarray(s,n),u=c.buffers;if(l(u)&&Object.keys(u).length>0){let m=y(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 i9e(e,t){let n=t[2],i=12,o,r;for(;i<n;){let s=Toe(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=Vl(d);o=JSON.parse(u),jb(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 SX=t9e;var ecn=T(S(),1);function o9e(e){return We.shader(e,function(t){qN(t)}),We.buffer(e,function(t){qN(t)}),We.image(e,function(t){qN(t)}),qN(e),e}function qN(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var CX=o9e;var wln=T(S(),1);var ocn=T(S(),1);function r9e(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),ps(n,t,!0)}var yu=r9e;var fcn=T(S(),1);var acn=T(S(),1);function s9e(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 Bp=s9e;function a9e(e,t){let n=e.bufferViews,i=e.buffers,o=t.bufferView,r=pd(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,g=Gl(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=Bp(x);for(let Z=0;Z<p;Z++){L(C,f,r,_,V);for(let E=0;E<r;E++){let X=V[E];s[E]=Math.min(s[E],X),a[E]=Math.max(a[E],X)}f+=g}return{min:s,max:a}}var Jx=a9e;var Tcn=T(S(),1);var c9e=[ie.FUNC_ADD,ie.FUNC_ADD],l9e=[ie.ONE,ie.ZERO,ie.ONE,ie.ZERO];function Soe(e,t){let n=e.enable;return l(n)?n.indexOf(t)>-1:!1}var d9e=[ie.ZERO,ie.ONE,ie.SRC_COLOR,ie.ONE_MINUS_SRC_COLOR,ie.SRC_ALPHA,ie.ONE_MINUS_SRC_ALPHA,ie.DST_ALPHA,ie.ONE_MINUS_DST_ALPHA,ie.DST_COLOR,ie.ONE_MINUS_DST_COLOR];function u9e(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(d9e.indexOf(e[n])===-1)return t;return e}function m9e(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(Soe(s,ie.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[r]={blendEquation:y(c.blendEquationSeparate,c9e),blendFactors:u9e(c.blendFuncSeparate,l9e)})}Soe(s,ie.CULL_FACE)||(a.doubleSided=!0),delete o.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),yu(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 VX=m9e;var Pcn=T(S(),1);var Rcn=T(S(),1);function h9e(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),ps(n,t,!0),yu(e,t)}var LX=h9e;function f9e(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},g=e.shaders[m.fragmentShader];p.fragmentShader=ps(r.shaders,g,!0);let f=e.shaders[m.vertexShader];p.vertexShader=ps(r.shaders,f,!0),d.program=ps(r.programs,p),o[a.program]=d.program}i[c]=ps(r.techniques,d)}),r.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=r,yu(e,"KHR_techniques_webgl"),LX(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 RX=f9e;var Ocn=T(S(),1);var Mcn=T(S(),1);function p9e(e,t){go.typeOf.object("material",e),go.defined("handler",t);let n=e.pbrMetallicRoughness;if(l(n)){if(l(n.baseColorTexture)){let r=n.baseColorTexture,s=t(r.index,r);if(l(s))return s}if(l(n.metallicRoughnessTexture)){let r=n.metallicRoughnessTexture,s=t(r.index,r);if(l(s))return s}}let{extensions:i}=e;if(l(i)){let r=i.KHR_materials_pbrSpecularGlossiness;if(l(r)){if(l(r.diffuseTexture)){let c=r.diffuseTexture,d=t(c.index,c);if(l(d))return d}if(l(r.specularGlossinessTexture)){let c=r.specularGlossinessTexture,d=t(c.index,c);if(l(d))return d}}let s=i.KHR_materials_specular;if(l(s)){let{specularTexture:c,specularColorTexture:d}=s;if(l(c)){let u=t(c.index,c);if(l(u))return u}if(l(d)){let u=t(d.index,d);if(l(u))return u}}let a=i.KHR_materials_common;if(l(a)&&l(a.values)){let{diffuse:c,ambient:d,emission:u,specular:m}=a.values;if(l(c)&&l(c.index)){let p=t(c.index,c);if(l(p))return p}if(l(d)&&l(d.index)){let p=t(d.index,d);if(l(p))return p}if(l(u)&&l(u.index)){let p=t(u.index,u);if(l(p))return p}if(l(m)&&l(m.index)){let p=t(m.index,m);if(l(p))return p}}}let o=We.materialValue(e,function(r){if(l(r.index)){let s=t(r.index,r);if(l(s))return s}});if(l(o))return o;if(l(e.emissiveTexture)){let r=e.emissiveTexture,s=t(r.index,r);if(l(s))return s}if(l(e.normalTexture)){let r=e.normalTexture,s=t(r.index,r);if(l(s))return s}if(l(e.occlusionTexture)){let r=e.occlusionTexture,s=t(r.index,r);if(l(s))return s}}var bC=p9e;var Coe=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function b9e(e,t){return t=y(t,Coe),Coe.forEach(function(n){t.indexOf(n)>-1&&y9e(e,n)}),e}var g9e={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function y9e(e,t){let n=g9e[t],i=e[n];if(l(i)){let o=0,r=nf[t](e),s=i.length;for(let a=0;a<s;++a)r[a]||(tf[t](e,a-o),o++)}}function tf(){}tf.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--})})};tf.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--})};tf.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--}),or(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--})}),or(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(or(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--}}}}};tf.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})};tf.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)})};tf.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})})};tf.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--})})};tf.sampler=function(e,t){e.samplers.splice(t,1),We.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};tf.texture=function(e,t){if(e.textures.splice(t,1),We.material(e,function(i){bC(i,function(o,r){r.index>t&&--r.index})}),or(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 g=d[m].featureIds.texture;g.index>t&&--g.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(or(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}}}})}),or(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 nf(){}nf.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)})}),or(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})}),or(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};nf.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};nf.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)}),or(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)})}),or(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(or(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};nf.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};nf.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 Voe(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!Voe(e,o,n)}).length===0}nf.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){Voe(e,i,t)||(t[i]=!0)}),t};nf.material=function(e){let t={};return We.mesh(e,function(n){We.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};nf.texture=function(e){let t={};if(We.material(e,function(n){bC(n,function(i){t[i]=!0})}),or(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(or(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)}}}})}),or(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};nf.sampler=function(e){let t={};return We.texture(e,function(n){l(n.sampler)&&(t[n.sampler]=!0)}),t};var ZX=b9e;var cln=T(S(),1);var Kcn=T(S(),1);function x9e(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},o={buffer:ps(e.buffers,n),byteOffset:0,byteLength:t.length};return ps(e.bufferViews,o)}var GX=x9e;var tln=T(S(),1);function _9e(e,t){let n=Gl(e,t),i=Q.getSizeInBytes(t.componentType),o=pd(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=Bp(t.componentType);for(let g=0;g<r;++g){p(u,d,o,i,m);for(let f=0;f<o;++f)s[g*o+f]=m[f];d+=n}return s}var EX=_9e;function T9e(e){let t;return We.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===ie.BYTE?$N(e,i,Q.UNSIGNED_BYTE):t!==ie.UNSIGNED_BYTE&&t!==ie.UNSIGNED_SHORT&&$N(e,i,Q.UNSIGNED_SHORT)}),We.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===ie.BYTE?$N(e,i,Q.UNSIGNED_BYTE):t===ie.SHORT&&$N(e,i,Q.UNSIGNED_SHORT)}),e}function $N(e,t,n){let i=Q.createTypedArray(n,EX(e,t)),o=new Uint8Array(i.buffer);t.bufferView=GX(e,o),t.componentType=n,t.byteOffset=0}var XX=T9e;var hln=T(S(),1);function S9e(e,t){return Kx(e,t),t==="CESIUM_RTC"&&C9e(e),uH(e,t)}function C9e(e){We.technique(e,function(t){We.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function uH(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)uH(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)&&uH(e[o],t);return i}}var Qx=S9e;var e5={.8:E9e,"1.0":Q9e,"2.0":void 0};function V9e(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.targetVersion,i=e.version;e.asset=y(e.asset,{version:"1.0"}),e.asset.version=y(e.asset.version,"1.0"),i=y(i,e.asset.version).toString(),Object.prototype.hasOwnProperty.call(e5,i)||(l(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(e5,i)||(i="1.0"));let o=e5[i];for(;l(o)&&i!==n;)o(e,t),i=e.asset.version,o=e5[i];return t.keepLegacyExtensions||($9e(e,t),eAe(e)),e}function Zoe(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 L9e(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=y(a.primitive,ie.TRIANGLES);a.mode=y(a.mode,c),delete a.primitive}}}}function R9e(e){let t=e.nodes,n=new h,i=new we;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),we.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 Z9e(e){let t=e.animations,n=e.accessors,i=e.bufferViews,o=e.buffers,r={},s=new h,a=new we;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 g=u.length;for(let f=0;f<g;++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,E=Z.byteOffset+V.byteOffset+C.byteOffset,X=C.componentType,v=C.count,P=pd(C.type),A=C.count*P,M=Q.createArrayBufferView(X,Z.buffer,E,A);for(let b=0;b<v;b++){let R=b*P;h.unpack(M,R,s);let G=M[R+3];we.fromAxisAngle(s,G,a),we.pack(a,M,R)}}}}}}function G9e(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=y(i.pass,"defaultPass");if(Object.prototype.hasOwnProperty.call(o,r)){let s=o[r],a=s.instanceProgram;i.attributes=y(i.attributes,a.attributes),i.program=y(i.program,a.program),i.uniforms=y(i.uniforms,a.uniforms),i.states=y(i.states,s.states)}delete i.passes,delete i.pass}}}function E9e(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,Zoe(e),L9e(e),R9e(e),Z9e(e),G9e(e),l(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,delete e.allExtensions),l(e.lights)){let n=y(e.extensions,{});e.extensions=n;let i=y(n.KHR_materials_common,{});n.KHR_materials_common=i,i.lights=e.lights,delete e.lights,yu(e,"KHR_materials_common")}}function X9e(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 Loe(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 I9e(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]=Loe(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=ps(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=Loe(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 W9e(e){We.animation(e,function(t){We.animationSampler(t,function(n){delete n.name})})}function P9e(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 v9e(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var w9e={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function F9e(e){let t=e.extensionsUsed;if(e.extensionsRequired=y(e.extensionsRequired,[]),l(t)){let n=t.length;for(let i=0;i<n;++i){let o=t[i];l(w9e[o])&&e.extensionsRequired.push(o)}}}function A9e(e){We.buffer(e,function(t){delete t.type})}function M9e(e){We.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function N9e(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 k9e={POSITION:!0,NORMAL:!0,TANGENT:!0},U9e={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function D9e(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=U9e[a];l(u)?(d=u+c,t[r]=d):l(k9e[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 B9e(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 hH(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:Gl(e,t)}function Y9e(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=hH(e,t),r=t.byteOffset+t.count*o;i.byteLength=Math.max(y(i.byteLength,0),r)}})}function O9e(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]=y(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,g){return p.byteOffset-g.byteOffset});let d=0,u=0,m=c.length;for(t=0;t<m;++t){let p=c[t],g=hH(e,p),f=p.byteOffset,x=p.count*g;delete p.byteStride;let _=t<m-1,C=_?hH(e,c[t+1]):void 0;if(g!==C){let V=Ye(i,!0);r[a]&&(V.byteStride=g),V.byteOffset+=d,V.byteLength=f+x-d;let L=ps(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}}}ZX(e,["accessor","bufferView","buffer"])}function H9e(e){We.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!l(n.min)||!l(n.max)){let i=Jx(e,n);n.min=i.min,n.max=i.max}})}function Goe(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)||F.fromColumnMajorArray(e.matrix).equals(F.IDENTITY))&&!l(e.extensions)&&!l(e.extras)}function Eoe(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),Goe(n)&&Eoe(e,i))}}),delete e.nodes[t]}function z9e(e){return We.node(e,function(t,n){Goe(t)&&Eoe(e,n)}),e}function K9e(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=Jx(e,i);i.min=o.min,i.max=o.max}})})}function J9e(e){We.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=Jx(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function Q9e(e){e.asset=y(e.asset,{}),e.asset.version="2.0",Zoe(e),X9e(e),z9e(e),I9e(e),W9e(e),v9e(e),F9e(e),Y9e(e),O9e(e),H9e(e),K9e(e),J9e(e),A9e(e),M9e(e),N9e(e),D9e(e),XX(e),B9e(e),VX(e),RX(e),P9e(e)}var j9e=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],q9e=["u_diffuse","u_diffuse_mat"];function fH(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function pH(e){return l(e.index)}function bH(e){return Array.isArray(e)&&e.length===4}function Xoe(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 $9e(e,t){t=y(t,y.EMPTY_OBJECT);let n=y(t.baseColorTextureNames,j9e),i=y(t.baseColorFactorNames,q9e);We.material(e,function(o){We.materialValue(o,function(r,s){n.indexOf(s)!==-1&&pH(r)?(fH(o),o.pbrMetallicRoughness.baseColorTexture=r):i.indexOf(s)!==-1&&bH(r)&&(fH(o),o.pbrMetallicRoughness.baseColorFactor=Xoe(r))})}),Qx(e,"KHR_techniques_webgl"),Qx(e,"KHR_blend")}function mH(e,t){l(t)&&(bH(t)?e.pbrMetallicRoughness.baseColorFactor=Xoe(t):pH(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function Roe(e,t){l(t)&&(bH(t)?e.emissiveFactor=t.slice(0,3):pH(t)&&(e.emissiveTexture=t))}function eAe(e){We.material(e,function(t){let n=y(t.extensions,y.EMPTY_OBJECT).KHR_materials_common;if(!l(n))return;let i=y(n.values,{}),o=i.ambient,r=i.diffuse,s=i.emission,a=i.transparency,c=n.doubleSided,d=n.transparent;fH(t),n.technique==="CONSTANT"?(yu(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},mH(t,s),mH(t,o)):(mH(t,r),Roe(t,o),Roe(t,s)),l(c)&&(t.doubleSided=c),l(a)&&(l(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=a:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,a]),l(d)&&(t.alphaMode=d?"BLEND":"OPAQUE")}),Qx(e,"KHR_materials_common")}var IX=V9e;var jln=T(S(),1);var Mln=T(S(),1);var oi={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID"};function tAe(e){switch(e){case oi.POSITION:return"positionMC";case oi.NORMAL:return"normalMC";case oi.TANGENT:return"tangentMC";case oi.TEXCOORD:return"texCoord";case oi.COLOR:return"color";case oi.JOINTS:return"joints";case oi.WEIGHTS:return"weights";case oi.FEATURE_ID:return"featureId"}}oi.hasSetIndex=function(e){switch(e){case oi.POSITION:case oi.NORMAL:case oi.TANGENT:return!1;case oi.TEXCOORD:case oi.COLOR:case oi.JOINTS:case oi.WEIGHTS:case oi.FEATURE_ID:return!0}};oi.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return oi.POSITION;case"NORMAL":return oi.NORMAL;case"TANGENT":return oi.TANGENT;case"TEXCOORD":return oi.TEXCOORD;case"COLOR":return oi.COLOR;case"JOINTS":return oi.JOINTS;case"WEIGHTS":return oi.WEIGHTS;case"_FEATURE_ID":return oi.FEATURE_ID}};oi.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return oi.POSITION;case"RGBA":case"RGB":case"RGB565":return oi.COLOR;case"NORMAL":case"NORMAL_OCT16P":return oi.NORMAL;case"BATCH_ID":return oi.FEATURE_ID}};oi.getGlslType=function(e){switch(e){case oi.POSITION:case oi.NORMAL:case oi.TANGENT:return"vec3";case oi.TEXCOORD:return"vec2";case oi.COLOR:return"vec4";case oi.JOINTS:return"ivec4";case oi.WEIGHTS:return"vec4";case oi.FEATURE_ID:return"int"}};oi.getVariableName=function(e,t){let n=tAe(e);return l(t)&&(n+=`_${t}`),n};var St=Object.freeze(oi);function rc(){}rc.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;l(n)&&l(n.message)&&(i+=`
${n.message}`);let o=new ue(i);return l(n)&&(o.stack=`Original stack:
${n.stack}
Handler stack:
${o.stack}`),o};rc.getNodeTransform=function(e){return l(e.matrix)?e.matrix:F.fromTranslationQuaternionRotationScale(l(e.translation)?e.translation:h.ZERO,l(e.rotation)?e.rotation:we.IDENTITY,l(e.scale)?e.scale:h.ONE)};rc.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}};rc.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}};rc.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}};rc.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};rc.getAttributeInfo=function(e){let t=e.semantic,n=e.setIndex,i,o=!1;l(t)?(i=St.getVariableName(t,n),o=!0):(i=e.name,i=i.replace(/^_/,""),i=i.toLowerCase());let r=/^color_\d+$/.test(i),s=e.type,a=on.getGlslType(s);r&&(a="vec4");let c=l(e.quantization),d;return c&&(d=r?"vec4":on.getGlslType(e.quantization.type)),{attribute:e,isQuantized:c,variableName:i,hasSemantic:o,glslType:a,quantizedGlslType:d}};var nAe=new h,iAe=new h;rc.getPositionMinMax=function(e,t,n){let i=rc.getAttributeBySemantic(e,"POSITION"),o=i.max,r=i.min;return l(n)&&l(t)&&(r=h.add(r,t,iAe),o=h.add(o,n,nAe)),{min:r,max:o}};rc.getAxisCorrectionMatrix=function(e,t,n){return n=F.clone(F.IDENTITY,n),e===Xo.Y?n=F.clone(Xo.Y_UP_TO_Z_UP,n):e===Xo.X&&(n=F.clone(Xo.X_UP_TO_Z_UP,n)),t===Xo.Z&&(n=F.multiplyTransformation(n,Xo.Z_UP_TO_X_UP,n)),n};var oAe=new $;rc.getCullFace=function(e,t){if(!Fe.isTriangles(t))return yi.BACK;let n=F.getMatrix3(e,oAe);return $.determinant(n)<0?yi.FRONT:yi.BACK};rc.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t=`_${t}`),t};rc.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_specular:!0,KHR_materials_anisotropy:!0,KHR_materials_clearcoat:!0,KHR_materials_unlit:!0,KHR_mesh_quantization:!0,KHR_texture_basisu:!0,KHR_texture_transform:!0,WEB3D_quantized_attributes:!0};rc.checkSupportedExtensions=function(e){let t=e.length;for(let n=0;n<t;n++){let i=e[n];if(!rc.supportedExtensions[i])throw new ue(`Unsupported glTF Extension: ${i}`)}};var jt=rc;function qb(e){e=y(e,y.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=It.UNLOADED,this._promise=void 0}l(Object.create)&&(qb.prototype=Object.create(eo.prototype),qb.prototype.constructor=qb);Object.defineProperties(qb.prototype,{cacheKey:{get:function(){return this._cacheKey}},gltf:{get:function(){return this._gltf}}});qb.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=It.LOADING,l(this._gltfJson)?(this._promise=Ioe(this,this._gltfJson),this._promise):l(this._typedArray)?(this._promise=Woe(this,this._typedArray),this._promise):(this._promise=rAe(this),this._promise))};async function rAe(e){let t;try{let n=await e._fetchGltf();if(e.isDestroyed())return;t=new Uint8Array(n)}catch(n){if(e.isDestroyed())return;gH(e,n)}return Woe(e,t)}function gH(e,t){e.unload(),e._state=It.FAILED;let n=`Failed to load glTF: ${e._gltfResource.url}`;throw e.getError(n,t)}async function sAe(e,t){if(l(t.asset)&&t.asset.version==="2.0"&&!or(t,"KHR_techniques_webgl")&&!or(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),IX(t)}function aAe(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(Ee.fetchArrayBuffer(i).then(function(o){n.extras._pipeline.source=new Uint8Array(o)})))}),Promise.all(t)}function cAe(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 Ioe(e,t){try{jb(t),await aAe(t),await sAe(e,t),_X(t),await cAe(e,t),CX(t);let n=t.asset.version;if(n!=="1.0"&&n!=="2.0")throw new ue(`Unsupported glTF version: ${n}`);let i=t.extensionsRequired;return l(i)&&jt.checkSupportedExtensions(i),e._gltf=t,e._state=It.READY,e}catch(n){if(e.isDestroyed())return;gH(e,n)}}async function Woe(e,t){let n;try{Xm(t)==="glTF"?n=SX(t):n=Io(t)}catch(i){if(e.isDestroyed())return;gH(e,i)}return Ioe(e,n)}qb.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};qb.prototype._fetchGltf=function(){return this._gltfResource.fetchArrayBuffer()};var gC=qb;var $dn=T(S(),1);var Fdn=T(S(),1);var Ldn=T(S(),1);var ydn=T(S(),1),lAe={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"},of=Object.freeze(lAe);var Vo={};function dAe(){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 uAe(){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 mAe(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}function hAe(){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 fAe(){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 pAe(){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 bAe(){this.attributes=[]}function gAe(){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 yAe(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}function xAe(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}function _Ae(){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 TAe(){this.nodes=[]}var SAe={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"};function CAe(){this.input=[],this.interpolation=void 0,this.output=[]}function VAe(){this.node=void 0,this.path=void 0}function LAe(){this.sampler=void 0,this.target=void 0}function RAe(){this.name=void 0,this.samplers=[],this.channels=[]}function ZAe(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}function GAe(){this.name=void 0,this.stages=[]}function Poe(){this.credits=[]}function EAe(){this.asset=new Poe,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=F.clone(F.IDENTITY)}function XAe(){this.texture=void 0,this.index=void 0,this.texCoord=0,this.transform=$.clone($.IDENTITY),this.scale=1,this.channels=void 0}function $b(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=se.clone($b.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=$b.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=$b.DEFAULT_ROUGHNESS_FACTOR}$b.DEFAULT_BASE_COLOR_FACTOR=se.ONE;$b.DEFAULT_METALLIC_FACTOR=1;$b.DEFAULT_ROUGHNESS_FACTOR=1;function jx(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=se.clone(jx.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=h.clone(jx.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=jx.DEFAULT_GLOSSINESS_FACTOR}jx.DEFAULT_DIFFUSE_FACTOR=se.ONE;jx.DEFAULT_SPECULAR_FACTOR=h.ONE;jx.DEFAULT_GLOSSINESS_FACTOR=1;function WX(){this.specularFactor=WX.DEFAULT_SPECULAR_FACTOR,this.specularTexture=void 0,this.specularColorFactor=h.clone(WX.DEFAULT_SPECULAR_COLOR_FACTOR),this.specularColorTexture=void 0}WX.DEFAULT_SPECULAR_FACTOR=1;WX.DEFAULT_SPECULAR_COLOR_FACTOR=h.ONE;function PX(){this.anisotropyStrength=PX.DEFAULT_ANISOTROPY_STRENGTH,this.anisotropyRotation=PX.DEFAULT_ANISOTROPY_ROTATION,this.anisotropyTexture=void 0}PX.DEFAULT_ANISOTROPY_STRENGTH=0;PX.DEFAULT_ANISOTROPY_ROTATION=0;function vX(){this.clearcoatFactor=vX.DEFAULT_CLEARCOAT_FACTOR,this.clearcoatTexture=void 0,this.clearcoatRoughnessFactor=vX.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,this.clearcoatRoughnessTexture=void 0,this.clearcoatNormalTexture=void 0}vX.DEFAULT_CLEARCOAT_FACTOR=0;vX.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR=0;function yH(){this.metallicRoughness=new $b,this.specularGlossiness=void 0,this.specular=void 0,this.anisotropy=void 0,this.clearcoat=void 0,this.emissiveTexture=void 0,this.normalTexture=void 0,this.occlusionTexture=void 0,this.emissiveFactor=h.clone(yH.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=of.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1}yH.DEFAULT_EMISSIVE_FACTOR=h.ZERO;Vo.Quantization=dAe;Vo.Attribute=uAe;Vo.Indices=mAe;Vo.FeatureIdAttribute=hAe;Vo.FeatureIdTexture=pAe;Vo.FeatureIdImplicitRange=fAe;Vo.MorphTarget=bAe;Vo.Primitive=gAe;Vo.Instances=yAe;Vo.Skin=xAe;Vo.Node=_Ae;Vo.Scene=TAe;Vo.AnimatedPropertyType=Object.freeze(SAe);Vo.AnimationSampler=CAe;Vo.AnimationTarget=VAe;Vo.AnimationChannel=LAe;Vo.Animation=RAe;Vo.ArticulationStage=ZAe;Vo.Articulation=GAe;Vo.Asset=Poe;Vo.Components=EAe;Vo.TextureReader=XAe;Vo.MetallicRoughness=$b;Vo.SpecularGlossiness=jx;Vo.Specular=WX;Vo.Anisotropy=PX;Vo.Clearcoat=vX;Vo.Material=yH;var Tn=Vo;var t5={};t5.getImageIdFromTexture=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,textureId:n,supportedImageFormats:i}=e,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};t5.createSampler=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,textureInfo:n,compressedTextureNoMipmap:i=!1}=e,o=Cn.REPEAT,r=Cn.REPEAT,s=qt.LINEAR,a=ui.LINEAR,c=n.index,u=t.textures[c].sampler;if(l(u)){let m=t.samplers[u];o=y(m.wrapS,o),r=y(m.wrapT,r),s=y(m.minFilter,s),a=y(m.magFilter,a)}return i&&s!==qt.LINEAR&&s!==qt.NEAREST&&(s===qt.NEAREST_MIPMAP_NEAREST||s===qt.NEAREST_MIPMAP_LINEAR?s=qt.NEAREST:s=qt.LINEAR),new $t({wrapS:o,wrapT:r,minificationFilter:s,magnificationFilter:a})};var IAe=new D(1,1);t5.createModelTextureReader=function(e){e=y(e,y.EMPTY_OBJECT);let{textureInfo:t,channels:n,texture:i}=e,o=y(t.texCoord,0),r,s=t.extensions?.KHR_texture_transform;if(l(s)){o=y(s.texCoord,o);let c=l(s.offset)?D.unpack(s.offset):D.ZERO,d=y(s.rotation,0),u=l(s.scale)?D.unpack(s.scale):IAe;d=-d,r=new $(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 Tn.TextureReader;return a.index=t.index,a.texture=i,a.texCoord=o,a.scale=t.scale,a.transform=r,a.channels=n,a};var El=t5;var Ndn=T(S(),1);function WAe(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 eg=WAe;function tg(e){e=y(e,y.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=y(e.asynchronous,!0),d=i.index,u=El.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=It.UNLOADED,this._promise=void 0}l(Object.create)&&(tg.prototype=Object.create(eo.prototype),tg.prototype.constructor=tg);Object.defineProperties(tg.prototype,{cacheKey:{get:function(){return this._cacheKey}},texture:{get:function(){return this._texture}}});var PAe=new xH;async function vAe(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=It.LOADED,e)}catch(n){if(e.isDestroyed())return;throw e.unload(),e._state=It.FAILED,e.getError("Failed to load texture",n)}}tg.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=It.LOADING,this._promise=vAe(this),this._promise)};function xH(){this.gltf=void 0,this.textureInfo=void 0,this.image=void 0,this.context=void 0,this.texture=void 0}xH.prototype.set=function(e,t,n,i,o){this.gltf=e,this.textureInfo=t,this.image=n,this.mipLevels=i,this.context=o};xH.prototype.execute=function(){this.texture=voe(this.gltf,this.textureInfo,this.image,this.mipLevels,this.context)};function voe(e,t,n,i,o){let r=n.internalFormat,s=!1;at.isCompressedFormat(r)&&!l(i)&&(s=!0);let a=El.createSampler({gltf:e,textureInfo:t,compressedTextureNoMipmap:s}),c=a.minificationFilter,d=a.wrapS,u=a.wrapT,m=c===qt.NEAREST_MIPMAP_NEAREST||c===qt.NEAREST_MIPMAP_LINEAR||c===qt.LINEAR_MIPMAP_NEAREST||c===qt.LINEAR_MIPMAP_LINEAR,p=!l(r)&&m,g=p||d===Cn.REPEAT||d===Cn.MIRRORED_REPEAT||u===Cn.REPEAT||u===Cn.MIRRORED_REPEAT,f=!W.isPowerOfTwo(n.width)||!W.isPowerOfTwo(n.height),x=g&&f,_;return l(r)?(!o.webgl2&&at.isCompressedFormat(r)&&f&&g&&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."),_=Ft.create({context:o,source:{arrayBufferView:n.bufferView,mipLevels:i},width:n.width,height:n.height,pixelFormat:n.internalFormat,sampler:a})):(x&&(n=eg(n)),_=Ft.create({context:o,source:n,sampler:a,flipY:!1,skipColorSpaceConversion:!0})),p&&_.generateMipmap(),_}tg.prototype.process=function(e){if(this._state===It.READY)return!0;if(this._state!==It.LOADED&&this._state!==It.PROCESSING||l(this._texture)||!l(this._image))return!1;this._state=It.PROCESSING;let t;if(this._asynchronous){let n=PAe;if(n.set(this._gltf,this._textureInfo,this._image,this._mipLevels,e.context),!e.jobScheduler.execute(n,Ea.TEXTURE))return;t=n.texture}else t=voe(this._gltf,this._textureInfo,this._image,this._mipLevels,e.context);return this.unload(),this._texture=t,this._state=It.READY,this._resourceCache.statistics.addTextureLoader(this),!0};tg.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 yC=tg;var dun=T(S(),1);function ng(e){e=y(e,y.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=y(e.asynchronous,!0),m=y(e.loadBuffer,!1),p=y(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=It.UNLOADED,this._promise=void 0}l(Object.create)&&(ng.prototype=Object.create(eo.prototype),ng.prototype.constructor=ng);Object.defineProperties(ng.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 wAe(e,t){return l(e)&&l(e.attributes)&&l(e.attributes[t])}ng.prototype.load=async function(){return l(this._promise)?this._promise:wAe(this._draco,this._attributeSemantic)?(this._promise=AAe(this),this._promise):(this._promise=NAe(this),this._promise)};function FAe(e,t,n,i){let r=(1<<e.quantizationBits)-1,s=1/r,a=new Tn.Quantization;if(a.componentDatatype=t,a.octEncoded=e.octEncoded,a.octEncodedZXY=!0,a.type=i,a.octEncoded)a.type=on.VEC2,a.normalizationRange=r;else{let c=on.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 AAe(e){e._state=It.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=It.LOADED,e)}catch{if(e.isDestroyed())return;_H(e)}}function MAe(e){e._state=It.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=FAe(d,o.data.componentDatatype,o.data.componentsPerAttribute,a)),e._typedArray=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}async function NAe(e){e._state=It.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=It.PROCESSING,e)}catch(n){if(e.isDestroyed())return;_H(e,n)}}function _H(e,t){throw e.unload(),e._state=It.FAILED,e.getError("Failed to load vertex buffer",t)}function TH(){this.typedArray=void 0,this.context=void 0,this.buffer=void 0}TH.prototype.set=function(e,t){this.typedArray=e,this.context=t};TH.prototype.execute=function(){this.buffer=woe(this.typedArray,this.context)};function woe(e,t){let n=yt.createVertexBuffer({typedArray:e,context:t,usage:Me.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}var kAe=new TH;ng.prototype.process=function(e){if(this._state===It.READY)return!0;if(this._state!==It.LOADED&&this._state!==It.PROCESSING)return!1;if(l(this._dracoLoader)){try{if(!this._dracoLoader.process(e))return!1}catch(i){_H(this,i)}MAe(this)}let t,n=this._typedArray;if(this._loadBuffer&&this._asynchronous){let i=kAe;if(i.set(n,e.context),!e.jobScheduler.execute(i,Ea.BUFFER))return!1;t=i.buffer}else this._loadBuffer&&(t=woe(n,e.context));return this.unload(),this._buffer=t,this._typedArray=this._loadTypedArray?n:void 0,this._state=It.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};ng.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 xC=ng;var kun=T(S(),1);var Pun=T(S(),1);var bun=T(S(),1);function wX(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=y(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=Ye(e.extras,!0),this._extensions=Ye(e.extensions,!0)}wX.fromJson=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.class,i={};for(let o in n.properties)if(n.properties.hasOwnProperty(o)){let r=zb.fromJson({id:o,property:n.properties[o],enums:e.enums});i[o]=r}return new wX({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(wX.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}}});wX.BATCH_TABLE_CLASS_NAME="_batchTable";var Pm=wX;var Run=T(S(),1);var _un=T(S(),1);function n5(e){e=y(e,y.EMPTY_OBJECT);let t=e.value,n=e.name;this._value=t,this._name=n,this._description=e.description,this._extras=Ye(e.extras,!0),this._extensions=Ye(e.extensions,!0)}n5.fromJson=function(e){return new n5({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(n5.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 FX=n5;function i5(e){e=y(e,y.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=y(e.valueType,an.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=Ye(e.extras,!0),this._extensions=Ye(e.extensions,!0)}i5.fromJson=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.enum,i=n.values.map(function(o){return FX.fromJson(o)});return new i5({id:t,values:i,valueType:an[n.valueType],name:n.name,description:n.description,extras:n.extras,extensions:n.extensions})};Object.defineProperties(i5.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 AX=i5;function o5(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.classes,{}),n=y(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=Ye(e.extras,!0),this._extensions=Ye(e.extensions,!0)}o5.fromJson=function(e){let t={};if(l(e.enums))for(let i in e.enums)e.enums.hasOwnProperty(i)&&(t[i]=AX.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]=Pm.fromJson({id:i,class:e.classes[i],enums:t}));return new o5({id:e.id,name:e.name,description:e.description,version:e.version,classes:n,enums:t,extras:e.extras,extensions:e.extensions})};Object.defineProperties(o5.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 vm=o5;function qx(e){e=y(e,y.EMPTY_OBJECT);let t=e.schema,n=e.resource,i=e.cacheKey;this._schema=l(t)?vm.fromJson(t):void 0,this._resource=n,this._cacheKey=i,this._state=It.UNLOADED,this._promise=void 0}l(Object.create)&&(qx.prototype=Object.create(eo.prototype),qx.prototype.constructor=qx);Object.defineProperties(qx.prototype,{cacheKey:{get:function(){return this._cacheKey}},schema:{get:function(){return this._schema}}});qx.prototype.load=async function(){return l(this._promise)?this._promise:l(this._schema)?(this._promise=Promise.resolve(this),this._promise):(this._promise=UAe(this),this._promise)};async function UAe(e){let t=e._resource;e._state=It.LOADING;try{let n=await t.fetchJson();return e.isDestroyed()?void 0:(e._schema=vm.fromJson(n),e._state=It.READY,e)}catch(n){if(e.isDestroyed())return;e._state=It.FAILED;let i=`Failed to load schema: ${t.url}`;throw e.getError(i,n)}}qx.prototype.unload=function(){this._schema=void 0};var _C=qx;var zun=T(S(),1);var wm={};function TC(e){return Ah(e.url)}function r5(e){let{byteOffset:t,byteLength:n}=e;if(ii(e,"EXT_meshopt_compression")){let i=e.extensions.EXT_meshopt_compression;t=y(i.byteOffset,0),n=i.byteLength}return`${t}-${t+n}`}function DAe(e,t){let n=t.byteOffset+e.byteOffset,{componentType:i,type:o,count:r}=e;return`${n}-${i}-${o}-${r}`}function Foe(e,t){return`${TC(e)}-buffer-id-${t}`}function MX(e,t,n,i){if(l(e.uri)){let o=i.getDerivedResource({url:e.uri});return TC(o)}return Foe(n,t)}function SH(e,t,n,i){let o=t.bufferView,r=e.bufferViews[o],s=r.buffer,a=e.buffers[s],c=MX(a,s,n,i),d=r5(r);return`${c}-range-${d}`}function Aoe(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 TC(p)}let a=e.bufferViews[r],c=a.buffer,d=e.buffers[c],u=MX(d,c,n,i),m=r5(a);return`${u}-range-${m}`}function BAe(e,t){let n=El.createSampler({gltf:e,textureInfo:t});return`${n.wrapS}-${n.wrapT}-${n.minificationFilter}-${n.magnificationFilter}`}wm.getSchemaCacheKey=function(e){let{schema:t,resource:n}=e;return l(t)?`embedded-schema:${JSON.stringify(t)}`:`external-schema:${TC(n)}`};wm.getExternalBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{resource:t}=e;return`external-buffer:${TC(t)}`};wm.getEmbeddedBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{parentResource:t,bufferId:n}=e;return`embedded-buffer:${Foe(t,n)}`};wm.getGltfCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltfResource:t}=e;return`gltf:${TC(t)}`};wm.getBufferViewCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}=e,r=t.bufferViews[n],s=r.buffer,a=t.buffers[s];ii(r,"EXT_meshopt_compression")&&(s=r.extensions.EXT_meshopt_compression.buffer);let c=MX(a,s,i,o),d=r5(r);return`buffer-view:${c}-range-${d}`};wm.getDracoCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,draco:n,gltfResource:i,baseResource:o}=e;return`draco:${SH(t,n,i,o)}`};wm.getVertexBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:s,attributeSemantic:a,dequantize:c=!1,loadBuffer:d=!1,loadTypedArray:u=!1}=e,m="";if(c&&(m+="-dequantize"),d&&(m+="-buffer",m+=`-context-${o.context.id}`),u&&(m+="-typed-array"),l(s))return`vertex-buffer:${SH(t,s,n,i)}-draco-${a}${m}`;let p=t.bufferViews[r],g=p.buffer,f=t.buffers[g],x=MX(f,g,n,i),_=r5(p);return`vertex-buffer:${x}-range-${_}${m}`};wm.getIndexBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:s,loadBuffer:a=!1,loadTypedArray:c=!1}=e,d="";if(a&&(d+="-buffer",d+=`-context-${r.context.id}`),c&&(d+="-typed-array"),l(s))return`index-buffer:${SH(t,s,i,o)}-draco${d}`;let u=t.accessors[n],m=u.bufferView,p=t.bufferViews[m],g=p.buffer,f=t.buffers[g],x=MX(f,g,i,o),_=DAe(u,p);return`index-buffer:${x}-accessor-${_}${d}`};wm.getImageCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,imageId:n,gltfResource:i,baseResource:o}=e;return`image:${Aoe(t,n,i,o)}`};wm.getTextureCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s}=e,a=n.index,c=El.getImageIdFromTexture({gltf:t,textureId:a,supportedImageFormats:r}),d=Aoe(t,c,i,o),u=BAe(t,n);return`texture:${d}-sampler-${u}-context-${s.context.id}`};var Xl=wm;var Qun=T(S(),1);function NX(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}NX.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}};NX.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};NX.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};NX.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 kX=NX;function Fn(){}Fn.cacheEntries={};Fn.statistics=new kX;function YAe(e){this.referenceCount=1,this.resourceLoader=e,this._statisticsPromise=void 0}Fn.get=function(e){let t=Fn.cacheEntries[e];if(l(t))return++t.referenceCount,t.resourceLoader};Fn.add=function(e){let t=e.cacheKey;return Fn.cacheEntries[t]=new YAe(e),e};Fn.unload=function(e){let t=e.cacheKey,n=Fn.cacheEntries[t];--n.referenceCount,n.referenceCount===0&&(Fn.statistics.removeLoader(e),e.destroy(),delete Fn.cacheEntries[t])};Fn.getSchemaLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{schema:t,resource:n}=e,i=Xl.getSchemaCacheKey({schema:t,resource:n}),o=Fn.get(i);return l(o)?o:(o=new _C({schema:t,resource:n,cacheKey:i}),Fn.add(o))};Fn.getEmbeddedBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{parentResource:t,bufferId:n,typedArray:i}=e,o=Xl.getEmbeddedBufferCacheKey({parentResource:t,bufferId:n}),r=Fn.get(o);return l(r)?r:(r=new Yx({typedArray:i,cacheKey:o}),Fn.add(r))};Fn.getExternalBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{resource:t}=e,n=Xl.getExternalBufferCacheKey({resource:t}),i=Fn.get(n);return l(i)?i:(i=new Yx({resource:t,cacheKey:n}),Fn.add(i))};Fn.getGltfJsonLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltfResource:t,baseResource:n,typedArray:i,gltfJson:o}=e,r=Xl.getGltfCacheKey({gltfResource:t}),s=Fn.get(r);return l(s)?s:(s=new gC({resourceCache:Fn,gltfResource:t,baseResource:n,typedArray:i,gltfJson:o,cacheKey:r}),Fn.add(s))};Fn.getBufferViewLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}=e,r=Xl.getBufferViewCacheKey({gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}),s=Fn.get(r);return l(s)?s:(s=new mC({resourceCache:Fn,gltf:t,bufferViewId:n,gltfResource:i,baseResource:o,cacheKey:r}),Fn.add(s))};Fn.getDracoLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,draco:n,gltfResource:i,baseResource:o}=e,r=Xl.getDracoCacheKey({gltf:t,draco:n,gltfResource:i,baseResource:o}),s=Fn.get(r);return l(s)?s:(s=new hC({resourceCache:Fn,gltf:t,draco:n,gltfResource:i,baseResource:o,cacheKey:r}),Fn.add(s))};Fn.getVertexBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:s,attributeSemantic:a,accessorId:c,asynchronous:d=!0,dequantize:u=!1,loadBuffer:m=!1,loadTypedArray:p=!1}=e,g=Xl.getVertexBufferCacheKey({gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:s,attributeSemantic:a,dequantize:u,loadBuffer:m,loadTypedArray:p}),f=Fn.get(g);return l(f)?f:(f=new xC({resourceCache:Fn,gltf:t,gltfResource:n,baseResource:i,bufferViewId:r,draco:s,attributeSemantic:a,accessorId:c,cacheKey:g,asynchronous:d,dequantize:u,loadBuffer:m,loadTypedArray:p}),Fn.add(f))};Fn.getIndexBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:s,asynchronous:a=!0,loadBuffer:c=!1,loadTypedArray:d=!1}=e,u=Xl.getIndexBufferCacheKey({gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:s,loadBuffer:c,loadTypedArray:d}),m=Fn.get(u);return l(m)?m:(m=new pC({resourceCache:Fn,gltf:t,accessorId:n,gltfResource:i,baseResource:o,draco:s,cacheKey:u,asynchronous:a,loadBuffer:c,loadTypedArray:d}),Fn.add(m))};Fn.getImageLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,imageId:n,gltfResource:i,baseResource:o}=e,r=Xl.getImageCacheKey({gltf:t,imageId:n,gltfResource:i,baseResource:o}),s=Fn.get(r);return l(s)?s:(s=new fC({resourceCache:Fn,gltf:t,imageId:n,gltfResource:i,baseResource:o,cacheKey:r}),Fn.add(s))};Fn.getTextureLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s,asynchronous:a=!0}=e,c=Xl.getTextureCacheKey({gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s}),d=Fn.get(c);return l(d)?d:(d=new yC({resourceCache:Fn,gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,cacheKey:c,asynchronous:a}),Fn.add(d))};Fn.clearForSpecs=function(){let e=[xC,pC,hC,yC,fC,mC,Yx,_C,gC],t,n=Fn.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])}Fn.statistics.clear()};var Bi=Fn;function na(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(na.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}}});na.prototype.tileIsAvailableAtIndex=function(e){return this._tileAvailability.getBit(e)};na.prototype.tileIsAvailableAtCoordinates=function(e){let t=this.getTileIndex(e);return this.tileIsAvailableAtIndex(t)};na.prototype.contentIsAvailableAtIndex=function(e,t){return t=y(t,0),this._contentAvailabilityBitstreams[t].getBit(e)};na.prototype.contentIsAvailableAtCoordinates=function(e,t){let n=this.getTileIndex(e);return this.contentIsAvailableAtIndex(n,t)};na.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)};na.prototype.childSubtreeIsAvailableAtCoordinates=function(e){let t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)};na.prototype.getLevelOffset=function(e){let t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)};na.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===Hr.OCTREE&&(t=3),e>>t};na.fromSubtreeJson=async function(e,t,n,i,o){let r=new na(e,i,o),s;l(t)?s={json:t,binary:void 0}:s=OAe(n);let a=s.json;r._subtreeJson=a;let c;if(ii(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 gX({subtreeMetadata:p,class:L})}r._metadata=u,r._tilePropertyTableJson=c,r._contentPropertyTableJsons=d;let g={constant:0};a.contentAvailabilityHeaders=[],ii(a,"3DTILES_multiple_contents")?a.contentAvailabilityHeaders=a.extensions["3DTILES_multiple_contents"].contentAvailability:Array.isArray(a.contentAvailability)?a.contentAvailabilityHeaders=a.contentAvailability:a.contentAvailabilityHeaders.push(y(a.contentAvailability,g));let f=HAe(a.buffers),x=zAe(a.bufferViews,f);KAe(a,x),l(c)&&Moe(c,x);for(let V=0;V<d.length;V++){let L=d[V];Moe(L,x)}let _=await JAe(r,f,s.binary),C=jAe(x,_);return qAe(r,a,i,C),l(c)&&($Ae(r,i,C),tMe(r)),eMe(r,i,C),nMe(r),r._ready=!0,r};function OAe(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=Io(e,i,o);i+=o;let a=e.subarray(i,i+r);return{json:s,binary:a}}function HAe(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 zAe(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 KAe(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 Moe(e,t){let n=e.properties,i;for(let o in n)if(n.hasOwnProperty(o)){let r=n[o],s=y(r.values,r.bufferView);i=t[s],i.isActive=!0,i.bufferHeader.isActive=!0;let a=y(r.stringOffsets,r.stringOffsetBufferView);l(a)&&(i=t[a],i.isActive=!0,i.bufferHeader.isActive=!0);let c=y(r.arrayOffsets,r.arrayOffsetBufferView);l(c)&&(i=t[c],i.isActive=!0,i.bufferHeader.isActive=!0)}}function JAe(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=QAe(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 QAe(e,t){let i=e._resource.getDerivedResource({url:t.uri}),o=Bi.getExternalBufferLoader({resource:i});e._bufferLoader=o;try{await o.load()}catch(r){if(o.isDestroyed())return;throw r}return o.typedArray}function jAe(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 qAe(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=ii(t,"3DTILES_metadata"),d=l(e._tilePropertyTableJson),u=c||d;e._tileAvailability=CH(t.tileAvailability,i,s,u);let m=e._contentPropertyTableJsons.length>0;u=u||m;for(let p=0;p<t.contentAvailabilityHeaders.length;p++){let g=CH(t.contentAvailabilityHeaders[p],i,s,u);e._contentAvailabilityBitstreams.push(g)}e._childSubtreeAvailability=CH(t.childSubtreeAvailability,i,a)}function CH(e,t,n,i){if(l(e.constant))return new dC({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 dC({bitstream:o,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function $Ae(e,t,n){let i=e._tilePropertyTableJson,o=e._tileAvailability.availableCount,r=t.metadataSchema,s=i.class,a=r.classes[s];e._tileMetadataTable=new Zl({class:a,count:o,properties:i.properties,bufferViews:n})}function eMe(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],g=new Zl({class:p,count:u,properties:c.properties,bufferViews:n});s.push(g)}}function Noe(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 tMe(e){let t=Noe(e._tileAvailability);e._tileJumpBuffer=t}function nMe(e){let t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let i=0;i<n.length;i++){let o=n[i],r=Noe(o);t.push(r)}}na.prototype.getTileIndex=function(e){let t=e.level-this._implicitCoordinates.level;if(t<0||this._subtreeLevels<=t)throw new ue("level is out of bounds for this subtree");return e.getSubtreeCoordinates().getOffsetCoordinates(e).tileIndex};na.prototype.getChildSubtreeIndex=function(e){if(e.level-this._implicitCoordinates.level!==this._implicitCoordinates.subtreeLevels)throw new ue("level is out of bounds for this subtree");return e.getParentSubtreeCoordinates().getOffsetCoordinates(e).mortonIndex};function iMe(e,t){if(!l(e._tileMetadataTable))return;let n=e.getTileIndex(t);if(e._tileAvailability.getBit(n))return e._tileJumpBuffer[n]}function oMe(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]}na.prototype.getTileMetadataView=function(e){let t=iMe(this,e);if(!l(t))return;let n=this._tileMetadataTable;return new uC({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})};na.prototype.getContentMetadataView=function(e,t){let n=oMe(this,e,t);if(!l(n))return;let i=this._contentMetadataTables[t],o=this._contentPropertyTableJsons[t];return new uC({class:i.class,metadataTable:i,entityId:n,contentIndex:t,propertyTableJson:o})};na.prototype.isDestroyed=function(){return!1};na.prototype.destroy=function(){return l(this._bufferLoader)&&Bi.unload(this._bufferLoader),me(this)};var $x=na;var Zmn=T(S(),1),rMe={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"},e_=Object.freeze(rMe);var Xmn=T(S(),1);var Fm={};Fm.parseAllBoundingVolumeSemantics=function(e){return{tile:{boundingVolume:Fm.parseBoundingVolumeSemantic("TILE",e),minimumHeight:Fm._parseMinimumHeight("TILE",e),maximumHeight:Fm._parseMaximumHeight("TILE",e)},content:{boundingVolume:Fm.parseBoundingVolumeSemantic("CONTENT",e),minimumHeight:Fm._parseMinimumHeight("CONTENT",e),maximumHeight:Fm._parseMaximumHeight("CONTENT",e)}}};Fm.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}};Fm._parseMinimumHeight=function(e,t){let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};Fm._parseMaximumHeight=function(e,t){let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};var t_=Fm;function Bc(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(Bc.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}}});Bc.fromSubtreeJson=async function(e,t,n,i,o,r){r=y(r,0);let s;l(o)&&(s=new Uint8Array(o,r));let a=t.implicitTileset,c=t.implicitCoordinates,d=await $x.fromSubtreeJson(n,i,s,a,c),u=new Bc(e,t,n);return u._implicitSubtree=d,sMe(u,d),u._ready=!0,u};function sMe(e,t){let n=e._tile,i=e._implicitCoordinates.childIndex,o=cMe(e,t,n,i),r=e._tileset.statistics;n.children.push(o.rootTile),r.numberOfTilesTotal++;let s=aMe(e,t,o.bottomRow);for(let a=0;a<s.length;a++){let c=s[a],d=c.tile,u=gMe(e,d,c.childIndex);d.children.push(u),r.numberOfTilesTotal++}}function aMe(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 cMe(e,t,n,i){let s=koe(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),g=u.branchingFactor*c.length;for(let f=0;f<g;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=koe(e,t,C,V,x);C.children.push(L),a.numberOfTilesTotal++,d.push(L)}c=d,d=[]}return{rootTile:s,bottomRow:c}}function Uoe(e,t,n){let i=e_.TILE_GEOMETRIC_ERROR;return l(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function koe(e,t,n,i,o,r){let s=e._implicitTileset,a;y(r,!1)?a=n.implicitCoordinates:a=n.implicitCoordinates.getChildCoordinates(i);let c,d,u;if(l(t.tilePropertyTableJson)){c=t.getTileMetadataView(a);let X=t_.parseAllBoundingVolumeSemantics(c);d=X.tile,u=X.content}let p=t.contentPropertyTableJsons.length,g=!1;for(let X=0;X<p;X++)if(t.contentIsAvailableAtCoordinates(a,X)){g=!0;break}let f=uMe(s,a,i,r,n,d),x=[];for(let X=0;X<s.contentCount;X++){if(!t.contentIsAvailableAtIndex(o,X))continue;let A={uri:s.contentUriTemplates[X].getDerivedResource({templateValues:a.getTemplateValues()}).url},M=mMe(f,u);l(M)&&(A.boundingVolume=M),x.push(_t(A,s.contentHeaders[X]))}let _=Uoe(c,s,a),C={boundingVolume:f,geometricError:_,refine:s.refine,contents:x},V=!0,L=Ye(s.tileHeader,V);delete L.boundingVolume,delete L.transform,delete L.metadata;let Z=_t(C,L,V),E=Hoe(e,s.baseResource,Z,n);return E.implicitCoordinates=a,E.implicitSubtree=t,E.metadata=c,E.hasImplicitContentMetadata=g,E}function s5(e,t){return l(e)&&l(t)&&(l(t.minimumHeight)||l(t.maximumHeight))&&(ii(e,"3DTILES_bounding_volume_S2")||l(e.region))}function LH(e,t){l(t)&&(ii(e,"3DTILES_bounding_volume_S2")?dMe(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):l(e.region)&&lMe(e.region,t.minimumHeight,t.maximumHeight))}function lMe(e,t,n){l(t)&&(e[4]=t),l(n)&&(e[5]=n)}function dMe(e,t,n){l(t)&&(e.minimumHeight=t),l(n)&&(e.maximumHeight=n)}function uMe(e,t,n,i,o,r){let s;return!l(r)||!l(r.boundingVolume)||!s5(r.boundingVolume,r)&&s5(e.boundingVolume,r)?s=Doe(e,t,n,y(i,!1),o):s=r.boundingVolume,LH(s,r),s}function mMe(e,t){let n;return l(t)&&(n=t.boundingVolume),s5(n,t)?LH(n,t):s5(e,t)&&(n=Ye(e,!0),LH(n,t)),n}function Doe(e,t,n,i,o){let r=e.boundingVolume;return ii(r,"3DTILES_bounding_volume_S2")?Boe(i,o,n,t.level,t.x,t.y,t.z):l(r.region)?{region:Ooe(r.region,t.level,t.x,t.y,t.z)}:{box:Yoe(r.box,t.level,t.x,t.y,t.z)}}function Boe(e,t,n,i,o,r,s){let a=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:Ap.getTokenFromId(a.s2Cell._cellId),minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight}}};let c=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),d=c%2===0?cC.encode2D(i,o,r):cC.encode2D(i,r,o),u=Ap.fromFacePositionLevel(c,BigInt(d),i),m,p;if(l(s)){let g=(a.maximumHeight+a.minimumHeight)/2;m=n<4?a.minimumHeight:g,p=n<4?g:a.maximumHeight}else m=a.minimumHeight,p=a.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:Ap.getTokenFromId(u._cellId),minimumHeight:m,maximumHeight:p}}}}var hMe=new h,fMe=new h,VH=new h,pMe=new $;function Yoe(e,t,n,i,o){if(t===0)return e;let r=h.unpack(e,0,fMe),s=$.unpack(e,3,pMe),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,hMe);l(o)&&(u=-1+(2*o+1)*a,m.z=a);let p=h.fromElements(c,d,u,VH);p=$.multiplyByVector(s,p,VH),p=h.add(p,r,VH);let g=$.clone(s);g=$.multiplyByScale(g,m,g);let f=new Array(12);return h.pack(p,f),$.pack(g,f,3),f}var bMe=new ae;function Ooe(e,t,n,i,o){if(t===0)return e.slice();let r=ae.unpack(e,0,bMe),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,g=W.negativePiToPi(r.south+i*p),f=W.negativePiToPi(g+p),x=s,_=a;if(l(o)){let C=c*(a-s);x+=o*C,_=x+C}return[u,g,m,f,x,_]}function gMe(e,t,n){let i=e._implicitTileset,o=t.implicitCoordinates.getChildCoordinates(n),r=Doe(i,o,n,!1,t),s=Uoe(void 0,i,o),a=i.subtreeUriTemplate.getDerivedResource({templateValues:o.getTemplateValues()}).url,c={boundingVolume:r,geometricError:s,refine:i.refine,contents:[{uri:a}]},d=Hoe(e,i.baseResource,c,t);return d.implicitTileset=i,d.implicitCoordinates=o,d}function Hoe(e,t,n,i){let o=e._tile.constructor;return new o(e._tileset,t,n,i)}Bc.prototype.hasProperty=function(e,t){return!1};Bc.prototype.getFeature=function(e){};Bc.prototype.applyDebugSettings=function(e,t){};Bc.prototype.applyStyle=function(e){};Bc.prototype.update=function(e,t){};Bc.prototype.pick=function(e,t,n){};Bc.prototype.isDestroyed=function(){return!1};Bc.prototype.destroy=function(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),me(this)};Bc._deriveBoundingBox=Yoe;Bc._deriveBoundingRegion=Ooe;Bc._deriveBoundingVolumeS2=Boe;var SC=Bc;var dWn=T(S(),1);var Jmn=T(S(),1),yMe={NONE:0,REPEAT:1,MIRRORED_REPEAT:2},Il=Object.freeze(yMe);var eWn=T(S(),1);var xhn=T(S(),1);var $mn=T(S(),1);function CC(e,t){this._distance=t,this._normal=new zoe(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(CC.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)}}});CC.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new CC(e.normal,e.distance),t};CC.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new CC(e.normal,e.distance)};function zoe(e,t){this._clippingPlane=t,this._cartesian3=h.clone(e)}Object.defineProperties(zoe.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 n_=CC;function sc(e){e=y(e,y.EMPTY_OBJECT),this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=y(e.enabled,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this.edgeColor=Y.clone(y(e.edgeColor,Y.WHITE)),this.edgeWidth=y(e.edgeWidth,0),this.planeAdded=new be,this.planeRemoved=new be,this._owner=void 0;let t=y(e.unionClippingRegions,!1);this._unionClippingRegions=t,this._testIntersection=t?qoe:$oe,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 qoe(e){return e===Kt.OUTSIDE}function $oe(e){return e===Kt.INSIDE}Object.defineProperties(sc.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?qoe:$oe)}},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 Koe(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}sc.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){Koe(n,i)},e.index=t,Koe(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};sc.prototype.get=function(e){return this._planes[e]};function ere(e,t){let n=e.length;for(let i=0;i<n;++i)if(cn.equals(e[i],t))return i;return-1}sc.prototype.contains=function(e){return ere(this._planes,e)!==-1};sc.prototype.remove=function(e){let t=this._planes,n=ere(t,e);if(n===-1)return!1;e instanceof n_&&(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 n_&&(r.index=o)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};sc.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof n_&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var xMe=new se,_Me=new se;function Joe(e,t,n){let i=e._uint8View,o=e._planes,r=0;for(let s=t;s<n;++s){let a=o[s],c=wn.octEncodeToCartesian4(a.normal,_Me);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,xMe);i[r+4]=d.x,i[r+5]=d.y,i[r+6]=d.z,i[r+7]=d.w,r+=8}}function Qoe(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 tre(e,t){let n=Dt.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var TMe=new D;sc.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=sc.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=tre(o,TMe);s.y*=2,i?(t=new Ft({context:n,width:s.x,height:s.y,pixelFormat:at.RGBA,pixelDatatype:nt.FLOAT,sampler:$t.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4)):(t=new Ft({context:n,width:s.x,height:s.y,pixelFormat:at.RGBA,pixelDatatype:nt.UNSIGNED_BYTE,sampler:$t.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?(Qoe(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(Joe(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),Qoe(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),Joe(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 SMe=new F,joe=new cn(h.UNIT_X,0);sc.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,o=this.modelMatrix;l(t)&&(o=F.multiply(t,o,SMe));let r=Kt.INSIDE;!this.unionClippingRegions&&i>0&&(r=Kt.OUTSIDE);for(let s=0;s<i;++s){let a=n[s];cn.transform(a,o,joe);let c=e.intersectPlane(joe);if(c===Kt.INTERSECTING)r=c;else if(this._testIntersection(c))return c}return r};sc.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};sc.useFloatTexture=function(e){return e.floatingPointTexture};sc.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let o=sc.useFloatTexture(t)?e.length:e.length*2,r=tre(o,n);return r.y*=2,r};sc.prototype.isDestroyed=function(){return!1};sc.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),me(this)};var as=sc;var Ipn=T(S(),1);var apn=T(S(),1);var jfn=T(S(),1);var mfn=T(S(),1);var Ahn=T(S(),1);var Thn=T(S(),1);function GH(e,t,n=2){let i=t&&t.length,o=i?t[0]*n:e.length,r=ire(e,0,o,n,!0),s=[];if(!r||r.next===r.prev)return s;let a,c,d;if(i&&(r=ZMe(e,t,r,n)),e.length>80*n){a=1/0,c=1/0;let u=-1/0,m=-1/0;for(let p=n;p<o;p+=n){let g=e[p],f=e[p+1];g<a&&(a=g),f<c&&(c=f),g>u&&(u=g),f>m&&(m=f)}d=Math.max(u-a,m-c),d=d!==0?32767/d:0}return UX(r,s,n,a,c,d,0),s}function ire(e,t,n,i,o){let r;if(o===MMe(e,t,n,i)>0)for(let s=t;s<n;s+=i)r=nre(s/i|0,e[s],e[s+1],r);else for(let s=n-i;s>=t;s-=i)r=nre(s/i|0,e[s],e[s+1],r);return r&&l5(r,r.next)&&(BX(r),r=r.next),r}function i_(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(l5(n,n.next)||Xr(n.prev,n,n.next)===0)){if(BX(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function UX(e,t,n,i,o,r,s){if(!e)return;!s&&r&&WMe(e,i,o,r);let a=e;for(;e.prev!==e.next;){let c=e.prev,d=e.next;if(r?VMe(e,i,o,r):CMe(e)){t.push(c.i,e.i,d.i),BX(e),e=d.next,a=d.next;continue}if(e=d,e===a){s?s===1?(e=LMe(i_(e),t),UX(e,t,n,i,o,r,2)):s===2&&RMe(e,t,n,i,o,r):UX(i_(e),t,n,i,o,r,1);break}}}function CMe(e){let t=e.prev,n=e,i=e.next;if(Xr(t,n,i)>=0)return!1;let 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,g=a>c?a>d?a:d:c>d?c:d,f=i.next;for(;f!==t;){if(f.x>=u&&f.x<=p&&f.y>=m&&f.y<=g&&VC(o,a,r,c,s,d,f.x,f.y)&&Xr(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function VMe(e,t,n,i){let o=e.prev,r=e,s=e.next;if(Xr(o,r,s)>=0)return!1;let a=o.x,c=r.x,d=s.x,u=o.y,m=r.y,p=s.y,g=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=RH(g,f,t,n,i),V=RH(x,_,t,n,i),L=e.prevZ,Z=e.nextZ;for(;L&&L.z>=C&&Z&&Z.z<=V;){if(L.x>=g&&L.x<=x&&L.y>=f&&L.y<=_&&L!==o&&L!==s&&VC(a,u,c,m,d,p,L.x,L.y)&&Xr(L.prev,L,L.next)>=0||(L=L.prevZ,Z.x>=g&&Z.x<=x&&Z.y>=f&&Z.y<=_&&Z!==o&&Z!==s&&VC(a,u,c,m,d,p,Z.x,Z.y)&&Xr(Z.prev,Z,Z.next)>=0))return!1;Z=Z.nextZ}for(;L&&L.z>=C;){if(L.x>=g&&L.x<=x&&L.y>=f&&L.y<=_&&L!==o&&L!==s&&VC(a,u,c,m,d,p,L.x,L.y)&&Xr(L.prev,L,L.next)>=0)return!1;L=L.prevZ}for(;Z&&Z.z<=V;){if(Z.x>=g&&Z.x<=x&&Z.y>=f&&Z.y<=_&&Z!==o&&Z!==s&&VC(a,u,c,m,d,p,Z.x,Z.y)&&Xr(Z.prev,Z,Z.next)>=0)return!1;Z=Z.nextZ}return!0}function LMe(e,t){let n=e;do{let i=n.prev,o=n.next.next;!l5(i,o)&&ore(i,n,n.next,o)&&DX(i,o)&&DX(o,i)&&(t.push(i.i,n.i,o.i),BX(n),BX(n.next),n=e=o),n=n.next}while(n!==e);return i_(n)}function RMe(e,t,n,i,o,r){let s=e;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&wMe(s,a)){let c=rre(s,a);s=i_(s,s.next),c=i_(c,c.next),UX(s,t,n,i,o,r,0),UX(c,t,n,i,o,r,0);return}a=a.next}s=s.next}while(s!==e)}function ZMe(e,t,n,i){let o=[];for(let r=0,s=t.length;r<s;r++){let a=t[r]*i,c=r<s-1?t[r+1]*i:e.length,d=ire(e,a,c,i,!1);d===d.next&&(d.steiner=!0),o.push(vMe(d))}o.sort(GMe);for(let r=0;r<o.length;r++)n=EMe(o[r],n);return n}function GMe(e,t){return e.x-t.x}function EMe(e,t){let n=XMe(e,t);if(!n)return t;let i=rre(n,e);return i_(i,i.next),i_(n,n.next)}function XMe(e,t){let 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){let m=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(m<=i&&m>r&&(r=m,s=n.x<n.next.x?n:n.next,m===i))return s}n=n.next}while(n!==t);if(!s)return null;let a=s,c=s.x,d=s.y,u=1/0;n=s;do{if(i>=n.x&&n.x>=c&&i!==n.x&&VC(o<d?i:r,o,c,d,o<d?r:i,o,n.x,n.y)){let m=Math.abs(o-n.y)/(i-n.x);DX(n,e)&&(m<u||m===u&&(n.x>s.x||n.x===s.x&&IMe(s,n)))&&(s=n,u=m)}n=n.next}while(n!==a);return s}function IMe(e,t){return Xr(e.prev,e,t.prev)<0&&Xr(t.next,e,e.next)<0}function WMe(e,t,n,i){let o=e;do o.z===0&&(o.z=RH(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,PMe(o)}function PMe(e){let t,n=1;do{let i=e,o;e=null;let r=null;for(t=0;i;){t++;let s=i,a=0;for(let d=0;d<n&&(a++,s=s.nextZ,!!s);d++);let c=n;for(;a>0||c>0&&s;)a!==0&&(c===0||!s||i.z<=s.z)?(o=i,i=i.nextZ,a--):(o=s,s=s.nextZ,c--),r?r.nextZ=o:e=o,o.prevZ=r,r=o;i=s}r.nextZ=null,n*=2}while(t>1);return e}function RH(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 vMe(e){let 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 VC(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 wMe(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!FMe(e,t)&&(DX(e,t)&&DX(t,e)&&AMe(e,t)&&(Xr(e.prev,e,t.prev)||Xr(e,t.prev,t))||l5(e,t)&&Xr(e.prev,e,e.next)>0&&Xr(t.prev,t,t.next)>0)}function Xr(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 ore(e,t,n,i){let o=c5(Xr(e,t,n)),r=c5(Xr(e,t,i)),s=c5(Xr(n,i,e)),a=c5(Xr(n,i,t));return!!(o!==r&&s!==a||o===0&&a5(e,n,t)||r===0&&a5(e,i,t)||s===0&&a5(n,e,i)||a===0&&a5(n,t,i))}function a5(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 c5(e){return e>0?1:e<0?-1:0}function FMe(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&ore(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function DX(e,t){return Xr(e.prev,e,e.next)<0?Xr(e,t,e.next)>=0&&Xr(e,e.prev,t)>=0:Xr(e,t,e.prev)<0||Xr(e,e.next,t)<0}function AMe(e,t){let 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 rre(e,t){let n=ZH(e.i,e.x,e.y),i=ZH(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 nre(e,t,n,i){let o=ZH(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 BX(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 ZH(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function MMe(e,t,n,i){let o=0;for(let r=t,s=n-i;r<n;r+=i)o+=(e[s]-e[r])*(e[r+1]+e[s+1]),s=r;return o}var NMe=new h,kMe=new h,ig={};ig.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};ig.computeWindingOrder2D=function(e){return ig.computeArea2D(e)>0?os.COUNTER_CLOCKWISE:os.CLOCKWISE};ig.triangulate=function(e,t){let n=D.packArray(e);return GH(n,t,2)};var lre=new h,dre=new h,ure=new h,sre=new h,are=new h,cre=new h,Yp=new h,mre=new D,hre=new D,fre=new D,LC=new D;ig.computeSubdivision=function(e,t,n,i,o){o=y(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 g=[],f={},x=e.maximumRadius,_=W.chordLength(o,x),C=_*_;for(;s.length>0;){let L=s.pop(),Z=s.pop(),E=s.pop(),X=h.fromArray(d,E*3,lre),v=h.fromArray(d,Z*3,dre),P=h.fromArray(d,L*3,ure),A,M,b;r&&(A=D.fromArray(u,E*2,mre),M=D.fromArray(u,Z*2,hre),b=D.fromArray(u,L*2,fre));let R=h.multiplyByScalar(h.normalize(X,sre),x,sre),G=h.multiplyByScalar(h.normalize(v,are),x,are),I=h.multiplyByScalar(h.normalize(P,cre),x,cre),w=h.magnitudeSquared(h.subtract(R,G,Yp)),N=h.magnitudeSquared(h.subtract(G,I,Yp)),B=h.magnitudeSquared(h.subtract(I,R,Yp)),U=Math.max(w,N,B),O,k,J;U>C?w===U?(O=`${Math.min(E,Z)} ${Math.max(E,Z)}`,a=f[O],l(a)||(k=h.add(X,v,Yp),h.multiplyByScalar(k,.5,k),d.push(k.x,k.y,k.z),a=d.length/3-1,f[O]=a,r&&(J=D.add(A,M,LC),D.multiplyByScalar(J,.5,J),u.push(J.x,J.y))),s.push(E,a,L),s.push(a,Z,L)):N===U?(O=`${Math.min(Z,L)} ${Math.max(Z,L)}`,a=f[O],l(a)||(k=h.add(v,P,Yp),h.multiplyByScalar(k,.5,k),d.push(k.x,k.y,k.z),a=d.length/3-1,f[O]=a,r&&(J=D.add(M,b,LC),D.multiplyByScalar(J,.5,J),u.push(J.x,J.y))),s.push(Z,a,E),s.push(a,L,E)):B===U&&(O=`${Math.min(L,E)} ${Math.max(L,E)}`,a=f[O],l(a)||(k=h.add(P,X,Yp),h.multiplyByScalar(k,.5,k),d.push(k.x,k.y,k.z),a=d.length/3-1,f[O]=a,r&&(J=D.add(b,A,LC),D.multiplyByScalar(J,.5,J),u.push(J.x,J.y))),s.push(L,a,Z),s.push(a,E,Z)):(g.push(E),g.push(Z),g.push(L))}let V={attributes:{position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:d})},indices:g,primitiveType:Fe.TRIANGLES};return r&&(V.attributes.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:u})),new ht(V)};var UMe=new he,DMe=new he,BMe=new he,EH=new he;ig.computeRhumbLineSubdivision=function(e,t,n,i,o){o=y(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 E=t[a];if(d[m++]=E.x,d[m++]=E.y,d[m++]=E.z,r){let X=i[a];u[p++]=X.x,u[p++]=X.y}}let g=[],f={},x=e.maximumRadius,_=W.chordLength(o,x),C=new Ra(void 0,void 0,e),V=new Ra(void 0,void 0,e),L=new Ra(void 0,void 0,e);for(;s.length>0;){let E=s.pop(),X=s.pop(),v=s.pop(),P=h.fromArray(d,v*3,lre),A=h.fromArray(d,X*3,dre),M=h.fromArray(d,E*3,ure),b,R,G;r&&(b=D.fromArray(u,v*2,mre),R=D.fromArray(u,X*2,hre),G=D.fromArray(u,E*2,fre));let I=e.cartesianToCartographic(P,UMe),w=e.cartesianToCartographic(A,DMe),N=e.cartesianToCartographic(M,BMe);C.setEndPoints(I,w);let B=C.surfaceDistance;V.setEndPoints(w,N);let U=V.surfaceDistance;L.setEndPoints(N,I);let O=L.surfaceDistance,k=Math.max(B,U,O),J,H,te,z,j;k>_?B===k?(J=`${Math.min(v,X)} ${Math.max(v,X)}`,a=f[J],l(a)||(H=C.interpolateUsingFraction(.5,EH),te=(I.height+w.height)*.5,z=h.fromRadians(H.longitude,H.latitude,te,e,Yp),d.push(z.x,z.y,z.z),a=d.length/3-1,f[J]=a,r&&(j=D.add(b,R,LC),D.multiplyByScalar(j,.5,j),u.push(j.x,j.y))),s.push(v,a,E),s.push(a,X,E)):U===k?(J=`${Math.min(X,E)} ${Math.max(X,E)}`,a=f[J],l(a)||(H=V.interpolateUsingFraction(.5,EH),te=(w.height+N.height)*.5,z=h.fromRadians(H.longitude,H.latitude,te,e,Yp),d.push(z.x,z.y,z.z),a=d.length/3-1,f[J]=a,r&&(j=D.add(R,G,LC),D.multiplyByScalar(j,.5,j),u.push(j.x,j.y))),s.push(X,a,v),s.push(a,E,v)):O===k&&(J=`${Math.min(E,v)} ${Math.max(E,v)}`,a=f[J],l(a)||(H=L.interpolateUsingFraction(.5,EH),te=(N.height+I.height)*.5,z=h.fromRadians(H.longitude,H.latitude,te,e,Yp),d.push(z.x,z.y,z.z),a=d.length/3-1,f[J]=a,r&&(j=D.add(G,b,LC),D.multiplyByScalar(j,.5,j),u.push(j.x,j.y))),s.push(E,a,X),s.push(a,v,X)):(g.push(v),g.push(X),g.push(E))}let Z={attributes:{position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:d})},indices:g,primitiveType:Fe.TRIANGLES};return r&&(Z.attributes.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:u})),new ht(Z)};ig.scaleToGeodeticHeight=function(e,t,n,i){n=y(n,ne.default);let o=NMe,r=kMe;if(t=y(t,0),i=y(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 ri=ig;var Nhn=T(S(),1);function og(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(og.prototype,{length:{get:function(){return this._length}}});og.prototype.enqueue=function(e){this._array.push(e),this._length++};og.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};og.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};og.prototype.contains=function(e){return this._array.indexOf(e)!==-1};og.prototype.clear=function(){this._array.length=this._offset=this._length=0};og.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var rg=og;var Qo={};Qo.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};Qo.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};Qo.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]=Qo.unpackPolygonHierarchy(e,t,n),t=s[a].startingIndex,delete s[a].startingIndex;return{positions:r,holes:s,startingIndex:t}};var o_=new D;function gre(e,t,n,i){return D.subtract(t,e,o_),D.multiplyByScalar(o_,n/i,o_),D.add(e,o_,o_),[o_.x,o_.y]}var sg=new h;function YMe(e,t,n,i){return h.subtract(t,e,sg),h.multiplyByScalar(sg,n/i,sg),h.add(e,sg,sg),[sg.x,sg.y,sg.z]}Qo.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 u5=new he,m5=new he,OMe=new he,HMe=new h,d5=new Ra;Qo.subdivideRhumbLineCount=function(e,t,n,i){let o=e.cartesianToCartographic(t,u5),r=e.cartesianToCartographic(n,m5),a=new Ra(o,r,e).surfaceDistance/i,c=Math.max(0,Math.ceil(W.log2(a)));return Math.pow(2,c)};Qo.subdivideTexcoordLine=function(e,t,n,i,o,r){let s=Qo.subdivideLineCount(n,i,o),a=D.distance(e,t),c=a/s,d=r;d.length=s*2;let u=0;for(let m=0;m<s;m++){let p=gre(e,t,m*c,a);d[u++]=p[0],d[u++]=p[1]}return d};Qo.subdivideLine=function(e,t,n,i){let o=Qo.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=YMe(e,t,d*s,r);a[c++]=u[0],a[c++]=u[1],a[c++]=u[2]}return a};Qo.subdivideTexcoordRhumbLine=function(e,t,n,i,o,r,s){let a=n.cartesianToCartographic(i,u5),c=n.cartesianToCartographic(o,m5);d5.setEndPoints(a,c);let d=d5.surfaceDistance/r,u=Math.max(0,Math.ceil(W.log2(d))),m=Math.pow(2,u),p=D.distance(e,t),g=p/m,f=s;f.length=m*2;let x=0;for(let _=0;_<m;_++){let C=gre(e,t,_*g,p);f[x++]=C[0],f[x++]=C[1]}return f};Qo.subdivideRhumbLine=function(e,t,n,i,o){let r=e.cartesianToCartographic(t,u5),s=e.cartesianToCartographic(n,m5),a=new Ra(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 g=0;for(let f=0;f<u;f++){let x=a.interpolateUsingSurfaceDistance(f*m,OMe),_=e.cartographicToCartesian(x,HMe);p[g++]=_.x,p[g++]=_.y,p[g++]=_.z}return p};var zMe=new h,KMe=new h,JMe=new h,QMe=new h;Qo.scaleToGeodeticHeightExtruded=function(e,t,n,i,o){i=y(i,ne.default);let r=zMe,s=KMe,a=JMe,c=QMe;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};Qo.polygonOutlinesFromHierarchy=function(e,t,n){let i=[],o=new rg;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=xo(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=xo(p,h.equalsEpsilon,!0),p.length<3)continue;i.push(p);let g=0;for(l(m.holes)&&(g=m.holes.length),s=0;s<g;s++)o.enqueue(m.holes[s])}i.push(d)}return i};var jMe=new he;function qMe(e,t,n){let i=n.cartesianToCartographic(e,u5),o=n.cartesianToCartographic(t,m5);if(Math.sign(i.latitude)===Math.sign(o.latitude))return;d5.setEndPoints(i,o);let r=d5.findIntersectionWithLatitude(0,jMe);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 $Me(e,t,n,i){if(i===en.RHUMB)return qMe(e,t,n);let o=qn.lineSegmentPlane(e,t,cn.ORIGIN_XY_PLANE);if(l(o))return n.scaleToGeodeticSurface(o,o)}var eNe=new he;function tNe(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,eNe).longitude;if(s===0)i.push({position:d,type:s,visited:!1,next:a,theta:u(o)});else if(a!==0){if(c=$Me(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 yre(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)),g=i[p];if(!l(g)){++c;continue}let{visited:f,type:x,next:_}=g;if(g.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=yre(e,++t,n,i,0,m,!s);return t}Qo.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=tNe(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=yre(i,o,s,a,1,0,c)}return i};Qo.polygonsFromHierarchy=function(e,t,n,i,o,r){let s=[],a=[],c=new rg;c.enqueue(e);let d=l(r);for(;c.length!==0;){let u=c.dequeue(),m=u.positions,p=u.holes,g,f;if(i)for(f=m.length,g=0;g<f;g++)o.scaleToGeodeticSurface(m[g],m[g]);if(t||(m=xo(m,h.equalsEpsilon,!0)),m.length<3)continue;let x=n(m);if(!l(x))continue;let _=[],C=ri.computeWindingOrder2D(x);if(C===os.CLOCKWISE&&(x.reverse(),m=m.slice().reverse()),d){d=!1;let X=[m];if(X=r(X,X),X.length>1){for(let v of X)c.enqueue(new Za(v,p));continue}}let V=m.slice(),L=l(p)?p.length:0,Z=[],E;for(g=0;g<L;g++){let X=p[g],v=X.positions;if(i)for(f=v.length,E=0;E<f;++E)o.scaleToGeodeticSurface(v[E],v[E]);if(t||(v=xo(v,h.equalsEpsilon,!0)),v.length<3)continue;let P=n(v);if(!l(P))continue;C=ri.computeWindingOrder2D(P),C===os.CLOCKWISE&&(P.reverse(),v=v.slice().reverse()),Z.push(v),_.push(V.length),V=V.concat(v),x=x.concat(P);let A=0;for(l(X.holes)&&(A=X.holes.length),E=0;E<A;E++)c.enqueue(X.holes[E])}s.push({outerRing:m,holes:Z}),a.push({positions:V,positions2D:x,holes:_})}return{hierarchy:s,polygons:a}};var nNe=new D,iNe=new h,oNe=new we,rNe=new $;Qo.computeBoundingRectangle=function(e,t,n,i,o){let r=we.fromAxisAngle(e,i,oNe),s=$.fromQuaternion(r,rNe),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 g=h.clone(n[p],iNe);$.multiplyByVector(s,g,g);let f=t(g,nNe);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};Qo.createGeometryFromPositions=function(e,t,n,i,o,r,s){let a=ri.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),g=0;for(let _=0;_<m;_++){let C=c[_];p[g++]=C.x,p[g++]=C.y,p[g++]=C.z}let f={attributes:{position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:p})},indices:a,primitiveType:Fe.TRIANGLES};d&&(f.attributes.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:D.packArray(u)}));let x=new ht(f);return r.normal?An.computeNormal(x):x}if(s===en.GEODESIC)return ri.computeSubdivision(e,c,a,u,i);if(s===en.RHUMB)return ri.computeRhumbLineSubdivision(e,c,a,u,i)};var pre=[],bre=[],sNe=new h,aNe=new h;Qo.computeWallGeometry=function(e,t,n,i,o,r){let s,a,c,d,u,m,p,g,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,g=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],g[C]=g[C+f]=m.x,++C,g[C]=g[C+f]=m.y,++C,g[C]=g[C+f]=p.x,++C,g[C]=g[C+f]=p.y,++C);else{let P=W.chordLength(i,n.maximumRadius),A=0;if(r===en.GEODESIC)for(c=0;c<x;c++)A+=Qo.subdivideLineCount(e[c],e[(c+1)%x],P);else if(r===en.RHUMB)for(c=0;c<x;c++)A+=Qo.subdivideRhumbLineCount(n,e[c],e[(c+1)%x],P);for(a=(A+x)*3,s=new Array(a*2),V&&(f=(A+x)*2,g=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===en.GEODESIC?(M=Qo.subdivideLine(d,u,P,bre),V&&(b=Qo.subdivideTexcoordLine(m,p,d,u,P,pre))):r===en.RHUMB&&(M=Qo.subdivideRhumbLine(n,d,u,P,bre),V&&(b=Qo.subdivideTexcoordRhumbLine(m,p,n,d,u,P,pre)));let R=M.length;for(let G=0;G<R;++G,++_)s[_]=M[G],s[_+a]=M[G];if(s[_]=u.x,s[_+a]=u.x,++_,s[_]=u.y,s[_+a]=u.y,++_,s[_]=u.z,s[_+a]=u.z,++_,V){let G=b.length;for(let I=0;I<G;++I,++C)g[C]=b[I],g[C+f]=b[I];g[C]=p.x,g[C+f]=p.x,++C,g[C]=p.y,g[C+f]=p.y,++C}}}x=s.length;let Z=Ae.createTypedArray(x/3,x-e.length*6),E=0;for(x/=6,c=0;c<x;c++){let P=c,A=P+1,M=P+x,b=M+1;d=h.fromArray(s,P*3,sNe),u=h.fromArray(s,A*3,aNe),!h.equalsEpsilon(d,u,W.EPSILON10,W.EPSILON10)&&(Z[E++]=P,Z[E++]=M,Z[E++]=A,Z[E++]=A,Z[E++]=M,Z[E++]=b)}let X={attributes:new mn({position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:s})}),indices:Z,primitiveType:Fe.TRIANGLES};return V&&(X.attributes.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:g})),new ht(X)};var Dn=Qo;var Cfn=T(S(),1);function Ir(e,t){this.position=e,l(this.position)||(this.position=new D),this.tangentPlane=t,l(this.tangentPlane)||(this.tangentPlane=Ir.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(Ir.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=D.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 RC=new he,cNe=new h;Ir.prototype.getLatitude=function(e){l(e)||(e=ne.default),RC.latitude=this.conformalLatitude,RC.longitude=this.longitude,RC.height=0;let t=this.ellipsoid.cartographicToCartesian(RC,cNe);return e.cartesianToCartographic(t,RC),RC.latitude};var lNe=new pn,dNe=new h,uNe=new h;Ir.fromCartesian=function(e,t){let n=W.signNotZero(e.z),i=Ir.NORTH_POLE_TANGENT_PLANE,o=Ir.SOUTH_POLE;n<0&&(i=Ir.SOUTH_POLE_TANGENT_PLANE,o=Ir.NORTH_POLE);let r=lNe;r.origin=i.ellipsoid.scaleToGeocentricSurface(e,r.origin),r.direction=h.subtract(r.origin,o,dNe),h.normalize(r.direction,r.direction);let s=qn.rayPlane(r,i.plane,uNe),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 D(c,d),t.tangentPlane=i,t):new Ir(new D(c,d),i)};Ir.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]=Ir.fromCartesian(e[i],t[i]);return t};Ir.clone=function(e,t){if(l(e))return l(t)?(t.position=e.position,t.tangentPlane=e.tangentPlane,t):new Ir(e.position,e.tangentPlane)};Ir.HALF_UNIT_SPHERE=Object.freeze(new ne(.5,.5,.5));Ir.NORTH_POLE=Object.freeze(new h(0,0,.5));Ir.SOUTH_POLE=Object.freeze(new h(0,0,-.5));Ir.NORTH_POLE_TANGENT_PLANE=Object.freeze(new Br(Ir.NORTH_POLE,Ir.HALF_UNIT_SPHERE));Ir.SOUTH_POLE_TANGENT_PLANE=Object.freeze(new Br(Ir.SOUTH_POLE,Ir.HALF_UNIT_SPHERE));var ac=Ir;var mNe=new he,xre=new he;function hNe(e,t,n,i){let r=i.cartesianToCartographic(e,mNe).height,s=i.cartesianToCartographic(t,xre);s.height=r,i.cartographicToCartesian(s,t);let a=i.cartesianToCartographic(n,xre);a.height=r-100,i.cartographicToCartesian(a,n)}var _re=new Ke,fNe=new h,pNe=new h,bNe=new h,gNe=new h,yNe=new h,xNe=new h,h5=new h,rf=new h,ZC=new h,_Ne=new D,TNe=new D,SNe=new h,Tre=new we,CNe=new $,VNe=new $;function XH(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,g=e.ellipsoid,f=e.stRotation,x=e.perPositionHeight,_=_Ne;_.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,E=i?new Float32Array(s):void 0,X=0,v=0,P=pNe,A=bNe,M=gNe,b=!0,R=CNe,G=VNe;if(f!==0){let N=we.fromAxisAngle(m,f,Tre);R=$.fromQuaternion(N,R),N=we.fromAxisAngle(m,-f,Tre),G=$.fromQuaternion(N,G)}else R=$.clone($.IDENTITY,R),G=$.clone($.IDENTITY,G);let I=0,w=0;c&&d&&(I=s/2,w=s/3,s/=2);for(let N=0;N<s;N+=3){let B=h.fromArray(o,N,SNe);if(t.st&&!l(r)){let U=$.multiplyByVector(R,B,fNe);U=g.scaleToGeodeticSurface(U,U);let O=p([U],TNe)[0];D.subtract(O,_,O);let k=W.clamp(O.x/u.width,0,1),J=W.clamp(O.y/u.height,0,1);d&&(C[X+w]=k,C[X+1+w]=J),c&&(C[X]=k,C[X+1]=J),X+=2}if(t.normal||t.tangent||t.bitangent||i){let U=v+1,O=v+2;if(a){if(N+3<s){let k=h.fromArray(o,N+3,yNe);if(b){let J=h.fromArray(o,N+s,xNe);x&&hNe(B,k,J,g),h.subtract(k,B,k),h.subtract(J,B,J),P=h.normalize(h.cross(J,k,P),P),b=!1}h.equalsEpsilon(k,B,W.EPSILON10)&&(b=!0)}(t.tangent||t.bitangent)&&(M=g.geodeticSurfaceNormal(B,M),t.tangent&&(A=h.normalize(h.cross(M,P,A),A)))}else P=g.geodeticSurfaceNormal(B,P),(t.tangent||t.bitangent)&&(x&&(h5=h.fromArray(V,v,h5),rf=h.cross(h.UNIT_Z,h5,rf),rf=h.normalize($.multiplyByVector(G,rf,rf),rf),t.bitangent&&(ZC=h.normalize(h.cross(h5,rf,ZC),ZC))),A=h.cross(h.UNIT_Z,P,A),A=h.normalize($.multiplyByVector(G,A,A),A),t.bitangent&&(M=h.normalize(h.cross(P,A,M),M)));t.normal&&(e.wall?(V[v+I]=P.x,V[U+I]=P.y,V[O+I]=P.z):d&&(V[v+I]=-P.x,V[U+I]=-P.y,V[O+I]=-P.z),(c&&!x||a)&&(V[v]=P.x,V[U]=P.y,V[O]=P.z)),i&&(a&&(P=g.geodeticSurfaceNormal(B,P)),E[v+I]=-P.x,E[U+I]=-P.y,E[O+I]=-P.z),t.tangent&&(e.wall?(L[v+I]=A.x,L[U+I]=A.y,L[O+I]=A.z):d&&(L[v+I]=-A.x,L[U+I]=-A.y,L[O+I]=-A.z),c&&(x?(L[v]=rf.x,L[U]=rf.y,L[O]=rf.z):(L[v]=A.x,L[U]=A.y,L[O]=A.z))),t.bitangent&&(d&&(Z[v+I]=M.x,Z[U+I]=M.y,Z[O+I]=M.z),c&&(x?(Z[v]=ZC.x,Z[U]=ZC.y,Z[O]=ZC.z):(Z[v]=M.x,Z[U]=M.y,Z[O]=M.z))),v+=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:E}))}if(e.extrude&&l(e.offsetAttribute)){let u=o.length/3,m=new Uint8Array(u);if(e.offsetAttribute===ln.TOP)c&&d||a?m=m.fill(1,0,u/2):c&&(m=m.fill(1));else{let p=e.offsetAttribute===ln.NONE?0:1;m=m.fill(p)}n.attributes.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}return n}var Sre=[];function LNe(e,t,n,i,o,r,s,a,c,d){let u={walls:[]},m;if(s||a){let V=Dn.createGeometryFromPositions(e,t,n,i,r,c,d),L=V.attributes.position.values,Z=V.indices,E,X;if(s&&a){let v=L.concat(L);E=v.length/3,X=Ae.createTypedArray(E,Z.length*2),X.set(Z);let P=Z.length,A=E/2;for(m=0;m<P;m+=3){let M=X[m]+A,b=X[m+1]+A,R=X[m+2]+A;X[m+P]=R,X[m+1+P]=b,X[m+2+P]=M}if(V.attributes.position.values=v,r&&c.normal){let M=V.attributes.normal.values;V.attributes.normal.values=new Float32Array(v.length),V.attributes.normal.values.set(M)}if(c.st&&l(n)){let M=V.attributes.st.values;V.attributes.st.values=new Float32Array(E*2),V.attributes.st.values=M.concat(M)}V.indices=X}else if(a){for(E=L.length/3,X=Ae.createTypedArray(E,Z.length),m=0;m<Z.length;m+=3)X[m]=Z[m+2],X[m+1]=Z[m+1],X[m+2]=Z[m];V.indices=X}u.topAndBottom=new Vt({geometry:V})}let p=o.outerRing,g=Br.fromPoints(p,e),f=g.projectPointsOntoPlane(p,Sre),x=ri.computeWindingOrder2D(f);x===os.CLOCKWISE&&(p=p.slice().reverse());let _=Dn.computeWallGeometry(p,n,e,i,r,d);u.walls.push(new Vt({geometry:_}));let C=o.holes;for(m=0;m<C.length;m++){let V=C[m];f=g.projectPointsOntoPlane(V,Sre),x=ri.computeWindingOrder2D(f),x===os.COUNTER_CLOCKWISE&&(V=V.slice().reverse()),_=Dn.computeWallGeometry(V,n,e,i,r,d),u.walls.push(new Vt({geometry:_}))}return u}function _u(e){let t=e.polygonHierarchy,n=y(e.vertexFormat,Pe.DEFAULT),i=y(e.ellipsoid,ne.default),o=y(e.granularity,W.RADIANS_PER_DEGREE),r=y(e.stRotation,0),s=e.textureCoordinates,a=y(e.perPositionHeight,!1),c=a&&l(e.extrudedHeight),d=y(e.height,0),u=y(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=ne.clone(i),this._granularity=o,this._stRotation=r,this._height=d,this._extrudedHeight=u,this._closeTop=y(e.closeTop,!0),this._closeBottom=y(e.closeBottom,!0),this._polygonHierarchy=t,this._perPositionHeight=a,this._perPositionHeightExtrude=c,this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=y(e.arcType,en.GEODESIC),this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=s,this.packedLength=Dn.computeHierarchyPackedLength(t,h)+ne.packedLength+Pe.packedLength+(s?Dn.computeHierarchyPackedLength(s,D):1)+12}_u.fromPositions=function(e){e=y(e,y.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 _u(t)};_u.pack=function(e,t,n){return n=y(n,0),n=Dn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),ne.pack(e._ellipsoid,t,n),n+=ne.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++]=y(e._offsetAttribute,-1),t[n++]=e._arcType,l(e._textureCoordinates)?n=Dn.packPolygonHierarchy(e._textureCoordinates,t,n,D):t[n++]=-1,t[n++]=e.packedLength,t};var RNe=ne.clone(ne.UNIT_SPHERE),ZNe=new Pe,GNe={polygonHierarchy:{}};_u.unpack=function(e,t,n){t=y(t,0);let i=Dn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=ne.unpack(e,t,RNe);t+=ne.packedLength;let r=Pe.unpack(e,t,ZNe);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,g=e[t++]===1,f=e[t++]===1,x=e[t++],_=e[t++],C=e[t]===-1?void 0:Dn.unpackPolygonHierarchy(e,t,D);l(C)?(t=C.startingIndex,delete C.startingIndex):t++;let V=e[t++];return l(n)||(n=new _u(GNe)),n._polygonHierarchy=i,n._ellipsoid=ne.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=g,n._shadowVolume=f,n._offsetAttribute=x===-1?void 0:x,n._arcType=_,n._textureCoordinates=C,n.packedLength=V,n};var ENe=new D,XNe=new D,INe=new ac;function Cre(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!==en.RHUMB){let p=D.subtract(t.position,e.position,ENe),g=D.dot(t.position,p)/D.dot(p,p);if(g>0&&g<1){let f=D.add(t.position,D.multiplyByScalar(p,-g,p),XNe),x=ac.clone(t,INe);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*=D.angleBetween(t.position,e.position)),d>=0&&(o.northAngle+=m),d<=0&&(o.southAngle+=m)}var Vre=new ac,WNe=new ac,xu={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};_u.computeRectangleFromPositions=function(e,t,n,i){if(l(i)||(i=new ae),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,xu.northAngle=0,xu.southAngle=0,xu.westOverIdl=Number.POSITIVE_INFINITY,xu.eastOverIdl=Number.NEGATIVE_INFINITY;let o=e.length,r=ac.fromCartesian(e[0],WNe);for(let s=1;s<o;s++){let a=ac.fromCartesian(e[s],Vre);Cre(a,r,t,n,xu,i),r=ac.clone(a,r)}return Cre(ac.fromCartesian(e[0],Vre),r,t,n,xu,i),i.east-i.west>xu.eastOverIdl-xu.westOverIdl&&(i.west=xu.westOverIdl,i.east=xu.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(xu.northAngle),W.TWO_PI,W.EPSILON10)&&(i.north=W.PI_OVER_TWO,i.east=W.PI,i.west=-W.PI),W.equalsEpsilon(Math.abs(xu.southAngle),W.TWO_PI,W.EPSILON10)&&(i.south=-W.PI_OVER_TWO,i.east=W.PI,i.west=-W.PI),i};var PNe=new ac;function vNe(e,t,n){return e.height>=W.PI||e.width>=W.PI?ac.fromCartesian(t[0],PNe).tangentPlane:Br.fromPoints(t,n)}var Lre=new he;function wNe(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],Lre);o[s]=new D(a.longitude/W.PI,a.latitude/W.PI_OVER_TWO)}return o.length=i.length,o}return ac.fromCartesianArray(i,o)}return Br.fromPoints(t,n).projectPointsOntoPlane(i,o)}}function FNe(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,Lre);return l(r)||(r=new D),r.x=s.longitude/W.PI,r.y=s.latitude/W.PI_OVER_TWO,r}return ac.fromCartesian(o,r)};let i=Br.fromPoints(t,n);return(o,r)=>i.projectPointsOntoPlane(o,r)}function ANe(e,t,n,i){return(o,r)=>!i&&(e.height>=W.PI_OVER_TWO||e.width>=2*W.PI_OVER_THREE)?Dn.splitPolygonsOnEquator(o,t,n,r):o}function MNe(e,t,n,i){if(t.height>=W.PI||t.width>=W.PI)return Ke.fromRectangle(t,void 0,_re);let o=e,r=Br.fromPoints(o,n);return Dn.computeBoundingRectangle(r.plane.normal,r.projectPointOntoPlane.bind(r),o,i,_re)}_u.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 g=e.rectangle,f=Dn.polygonsFromHierarchy(r,m,wNe(g,p,n),!s,n,ANe(g,n,d,s)),x=f.hierarchy,_=f.polygons,C=function(I){return I},V=m?Dn.polygonsFromHierarchy(u,!0,C,!1,n).polygons:void 0;if(x.length===0)return;let L=x[0].outerRing,Z=MNe(L,g,n,o),E=[],X=e._height,v=e._extrudedHeight,P=e._perPositionHeightExtrude||!W.equalsEpsilon(X,v,0,W.EPSILON2),A={perPositionHeight:s,vertexFormat:t,geometry:void 0,rotationAxis:vNe(g,L,n).plane.normal,projectTo2d:FNe(g,L,n),boundingRectangle:Z,ellipsoid:n,stRotation:o,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:d},M;if(P)for(A.extrude=!0,A.top=a,A.bottom=c,A.shadowVolume=e._shadowVolume,A.offsetAttribute=e._offsetAttribute,M=0;M<_.length;M++){let I=LNe(n,_[M],m?V[M]:void 0,i,x[M],s,a,c,t,d),w;a&&c?(w=I.topAndBottom,A.geometry=Dn.scaleToGeodeticHeightExtruded(w.geometry,X,v,n,s)):a?(w=I.topAndBottom,w.geometry.attributes.position.values=ri.scaleToGeodeticHeight(w.geometry.attributes.position.values,X,n,!s),A.geometry=w.geometry):c&&(w=I.topAndBottom,w.geometry.attributes.position.values=ri.scaleToGeodeticHeight(w.geometry.attributes.position.values,v,n,!0),A.geometry=w.geometry),(a||c)&&(A.wall=!1,w.geometry=XH(A),E.push(w));let N=I.walls;A.wall=!0;for(let B=0;B<N.length;B++){let U=N[B];A.geometry=Dn.scaleToGeodeticHeightExtruded(U.geometry,X,v,n,s),U.geometry=XH(A),E.push(U)}}else for(M=0;M<_.length;M++){let I=new Vt({geometry:Dn.createGeometryFromPositions(n,_[M],m?V[M]:void 0,i,s,t,d)});if(I.geometry.attributes.position.values=ri.scaleToGeodeticHeight(I.geometry.attributes.position.values,X,n,!s),A.geometry=I.geometry,I.geometry=XH(A),l(e._offsetAttribute)){let w=I.geometry.attributes.position.values.length,N=e._offsetAttribute===ln.NONE?0:1,B=new Uint8Array(w/3).fill(N);I.geometry.attributes.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:B})}E.push(I)}let b=An.combineInstances(E)[0];b.attributes.position.values=new Float64Array(b.attributes.position.values),b.indices=Ae.createTypedArray(b.attributes.position.values.length/3,b.indices);let R=b.attributes,G=ce.fromVertices(R.position.values);return t.position||delete R.position,new ht({attributes:R,indices:b.indices,primitiveType:b.primitiveType,boundingSphere:G,offsetAttribute:e._offsetAttribute})};_u.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new _u({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 NNe(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 ht._textureCoordinateRotationPoints(i,t,n,o)}Object.defineProperties(_u.prototype,{rectangle:{get:function(){if(!l(this._rectangle)){let e=this._polygonHierarchy.positions;this._rectangle=_u.computeRectangleFromPositions(e,this._ellipsoid,this._arcType)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=NNe(this)),this._textureCoordinateRotationPoints}}});var Op=_u;function r_(e){this._ellipsoid=y(e.ellipsoid,ne.default),this._positions=[...e.positions]}Object.defineProperties(r_.prototype,{length:{get:function(){return this._positions.length}},positions:{get:function(){return this._positions}},ellipsoid:{get:function(){return this._ellipsoid}}});r_.clone=function(e,t){return l(t)?(t._ellipsoid=e.ellipsoid,t._positions.length=0,t._positions.push(...e.positions),t):new r_({positions:e.positions,ellipsoid:e.ellipsoid})};r_.equals=function(e,t){return e.ellipsoid.equals(t.ellipsoid)&&e.positions===t.positions};r_.prototype.computeRectangle=function(e){return Op.computeRectangleFromPositions(this.positions,this.ellipsoid,void 0,e)};var kNe=new ae,Rre=new h;r_.prototype.computeSphericalExtents=function(e){l(e)||(e=new ae);let t=this.computeRectangle(kNe),n=he.toCartesian(ae.southwest(t),this.ellipsoid,Rre),i=Math.sqrt(n.x*n.x+n.y*n.y),o=W.fastApproximateAtan2(i,n.z),r=W.fastApproximateAtan2(n.x,n.y);return e.south=o,e.west=r,n=he.toCartesian(ae.northeast(t),this.ellipsoid,Rre),i=Math.sqrt(n.x*n.x+n.y*n.y),o=W.fastApproximateAtan2(i,n.z),r=W.fastApproximateAtan2(n.x,n.y),e.north=o,e.east=r,e};var GC=r_;var lpn=T(S(),1),YX=`in vec2 v_textureCoordinates;

uniform int u_polygonsLength;
uniform int u_extentsLength;
uniform highp sampler2D u_polygonTexture;
uniform highp sampler2D u_extentsTexture;

int getPolygonIndex(float dimension, vec2 coord) {
   vec2 uv = coord.xy * dimension;
   return int(floor(uv.y) * dimension + floor(uv.x));
}

vec2 getLookupUv(ivec2 dimensions, int i) {
    int pixY = i / dimensions.x;
    int pixX = i - (pixY * dimensions.x);
    float pixelWidth = 1.0 / float(dimensions.x);
    float pixelHeight = 1.0 / float(dimensions.y);
    float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel
    float v = (float(pixY) + 0.5) * pixelHeight;
    return vec2(u, v);
}

vec4 getExtents(int i) {
    return texture(u_extentsTexture, getLookupUv(textureSize(u_extentsTexture, 0), i));
}

ivec2 getPositionsLengthAndExtentsIndex(int i) {
    vec2 uv = getLookupUv(textureSize(u_polygonTexture, 0), i);
    vec4 value = texture(u_polygonTexture, uv);
    return ivec2(int(value.x), int(value.y));
}

vec2 getPolygonPosition(int i) {
    vec2 uv = getLookupUv(textureSize(u_polygonTexture, 0), i);
    return texture(u_polygonTexture, uv).xy;
}

vec2 getCoordinates(vec2 textureCoordinates, vec4 extents) {
    float latitude = mix(extents.x, extents.x + 1.0 / extents.z, textureCoordinates.y);
    float longitude = mix(extents.y, extents.y + 1.0 / extents.w, textureCoordinates.x);
    return vec2(latitude, longitude);
}

void main() {
    int lastPolygonIndex = 0;
    out_FragColor = vec4(1.0);

    // Get the relevant region of the texture
    float dimension = float(u_extentsLength);
    if (u_extentsLength > 2) {
        dimension = ceil(log2(float(u_extentsLength)));
    }
    int regionIndex = getPolygonIndex(dimension, v_textureCoordinates);

    for (int polygonIndex = 0; polygonIndex < u_polygonsLength; polygonIndex++) {
        ivec2 positionsLengthAndExtents = getPositionsLengthAndExtentsIndex(lastPolygonIndex);
        int positionsLength = positionsLengthAndExtents.x;
        int polygonExtentsIndex = positionsLengthAndExtents.y;
        lastPolygonIndex += 1;

         // Only compute signed distance for the relevant part of the atlas
         if (polygonExtentsIndex == regionIndex) {
            float clipAmount = czm_infinity;
            vec4 extents = getExtents(polygonExtentsIndex);
            vec2 textureOffset = vec2(mod(float(polygonExtentsIndex), dimension), floor(float(polygonExtentsIndex) / dimension)) / dimension;
            vec2 p = getCoordinates((v_textureCoordinates - textureOffset) * dimension, extents);
            float s = 1.0;

            // Check each edge for absolute distance
            for (int i = 0, j = positionsLength - 1; i < positionsLength; j = i, i++) {
                vec2 a = getPolygonPosition(lastPolygonIndex + i);
                vec2 b = getPolygonPosition(lastPolygonIndex + j);
 
                vec2 ab = b - a;
                vec2 pa = p - a;
                float t = dot(pa, ab) / dot(ab, ab);
                t = clamp(t, 0.0, 1.0);

                vec2 pq = pa - t * ab;
                float d = length(pq);

                // Inside / outside computation to determine sign
                bvec3 cond = bvec3(p.y >= a.y, 
                            p.y < b.y, 
                            ab.x * pa.y > ab.y * pa.x);
                if (all(cond) || all(not(cond))) s = -s;
                if (abs(d) < abs(clipAmount)) {
                    clipAmount = d;
                }
            }

            // Normalize the range to [0,1]
            vec4 result = (s * vec4(clipAmount * length(extents.zw))) / 2.0 + 0.5;
            // In the case where we've iterated through multiple polygons, take the minimum
            out_FragColor = min(out_FragColor, result);
         }

        lastPolygonIndex += positionsLength;
    }
}`;function zr(e){e=y(e,y.EMPTY_OBJECT),this._polygons=[],this._totalPositions=0,this.enabled=y(e.enabled,!0),this.inverse=y(e.inverse,!1),this.polygonAdded=new be,this.polygonRemoved=new be,this._owner=void 0,this._float32View=void 0,this._extentsFloat32View=void 0,this._extentsCount=0,this._polygonsTexture=void 0,this._extentsTexture=void 0,this._signedDistanceTexture=void 0,this._signedDistanceComputeCommand=void 0;let t=e.polygons;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this._polygons.push(t[i])}}Object.defineProperties(zr.prototype,{length:{get:function(){return this._polygons.length}},totalPositions:{get:function(){return this._totalPositions}},extentsTexture:{get:function(){return this._extentsTexture}},extentsCount:{get:function(){return this._extentsCount}},pixelsNeededForExtents:{get:function(){return this.length}},pixelsNeededForPolygonPositions:{get:function(){return this.totalPositions+this.length}},clippingTexture:{get:function(){return this._signedDistanceTexture}},owner:{get:function(){return this._owner}},clippingPolygonsState:{get:function(){return this.inverse?-this.extentsCount:this.extentsCount}}});zr.prototype.add=function(e){let t=this._polygons.length;return this._polygons.push(e),this.polygonAdded.raiseEvent(e,t),e};zr.prototype.get=function(e){return this._polygons[e]};zr.prototype.contains=function(e){return this._polygons.some(t=>GC.equals(t,e))};zr.prototype.remove=function(e){let t=this._polygons,n=t.findIndex(i=>GC.equals(i,e));return n===-1?!1:(t.splice(n,1),this.polygonRemoved.raiseEvent(e,n),!0)};var UNe=new ae;function DNe(e){let t=[],n=[],i=e.length;for(let r=0;r<i;++r){let a=e[r].computeSphericalExtents(),c=Math.max(a.height*2.5,.001),d=Math.max(a.width*2.5,.001),u=ae.clone(a);u.south-=c,u.west-=d,u.north+=c,u.east+=d,u.south=Math.max(u.south,-Math.PI),u.west=Math.max(u.west,-Math.PI),u.north=Math.min(u.north,Math.PI),u.east=Math.min(u.east,Math.PI);let m=[r];for(let p=0;p<t.length;++p){let g=t[p];if(l(g)&&l(ae.simpleIntersection(g,u))&&!ae.equals(g,u)){let f=n[p];m.push(...f),f.reduce((x,_)=>ae.union(e[_].computeSphericalExtents(UNe),x,x),a),t[p]=void 0,n[p]=void 0,c=Math.max(a.height*2.5,.001),d=Math.max(a.width*2.5,.001),u=ae.clone(a,u),u.south-=c,u.west-=d,u.north+=c,u.east+=d,u.south=Math.max(u.south,-Math.PI),u.west=Math.max(u.west,-Math.PI),u.north=Math.min(u.north,Math.PI),u.east=Math.min(u.east,Math.PI),p=-1}}t.push(u),n.push(m)}let o=new Map;return n.filter(l).forEach((r,s)=>r.forEach(a=>o.set(a,s))),{extentsList:t.filter(l),extentsIndexByPolygon:o}}zr.prototype.removeAll=function(){let e=this._polygons,t=e.length;for(let n=0;n<t;++n){let i=e[n];this.polygonRemoved.raiseEvent(i,n)}this._polygons=[]};function BNe(e){let t=e._float32View,n=e._extentsFloat32View,i=e._polygons,{extentsList:o,extentsIndexByPolygon:r}=DNe(i),s=0;for(let[c,d]of i.entries()){let u=d.length;t[s++]=u,t[s++]=r.get(c);for(let m=0;m<u;++m){let p=d.positions[m],g=Math.hypot(p.x,p.y),f=W.fastApproximateAtan2(g,p.z),x=W.fastApproximateAtan2(p.x,p.y);t[s++]=f,t[s++]=x}}let a=0;for(let c of o){let d=1/(c.east-c.west),u=1/(c.north-c.south);n[a++]=c.south,n[a++]=c.west,n[a++]=u,n[a++]=d}e._extentsCount=o.length}var IH=new D;zr.prototype.update=function(e){let t=e.context;if(!zr.isSupported(e))throw new ue("ClippingPolygonCollections are only supported for WebGL 2.");let n=this._polygons.reduce((s,a)=>s+a.length,0);if(n===this.totalPositions||(this._totalPositions=n,this.length===0))return;l(this._signedDistanceComputeCommand)&&(this._signedDistanceComputeCommand.canceled=!0,this._signedDistanceComputeCommand=void 0);let i=this._polygonsTexture,o=this._extentsTexture,r=this._signedDistanceTexture;if(l(i)){let s=i.width*i.height;(s<this.pixelsNeededForPolygonPositions||this.pixelsNeededForPolygonPositions<.25*s)&&(i.destroy(),i=void 0,this._polygonsTexture=void 0)}if(!l(i)){let s=zr.getTextureResolution(i,this.pixelsNeededForPolygonPositions,IH);i=new Ft({context:t,width:s.x,height:s.y,pixelFormat:at.RG,pixelDatatype:nt.FLOAT,sampler:$t.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*2),this._polygonsTexture=i}if(l(o)){let s=o.width*o.height;(s<this.pixelsNeededForExtents||this.pixelsNeededForExtents<.25*s)&&(o.destroy(),o=void 0,this._extentsTexture=void 0)}if(!l(o)){let s=zr.getTextureResolution(o,this.pixelsNeededForExtents,IH);o=new Ft({context:t,width:s.x,height:s.y,pixelFormat:at.RGBA,pixelDatatype:nt.FLOAT,sampler:$t.NEAREST,flipY:!1}),this._extentsFloat32View=new Float32Array(s.x*s.y*4),this._extentsTexture=o}if(BNe(this),o.copyFrom({source:{width:o.width,height:o.height,arrayBufferView:this._extentsFloat32View}}),i.copyFrom({source:{width:i.width,height:i.height,arrayBufferView:this._float32View}}),!l(r)){let s=zr.getClippingDistanceTextureResolution(this,IH);r=new Ft({context:t,width:s.x,height:s.y,pixelFormat:t.webgl2?at.RED:at.LUMINANCE,pixelDatatype:nt.FLOAT,sampler:new $t({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:qt.LINEAR,magnificationFilter:ui.LINEAR}),flipY:!1}),this._signedDistanceTexture=r}this._signedDistanceComputeCommand=YNe(this)};zr.prototype.queueCommands=function(e){l(this._signedDistanceComputeCommand)&&e.commandList.push(this._signedDistanceComputeCommand)};function YNe(e){let t=e._polygonsTexture,n=e._extentsTexture;return new um({fragmentShaderSource:YX,outputTexture:e._signedDistanceTexture,uniformMap:{u_polygonsLength:function(){return e.length},u_extentsLength:function(){return e.extentsCount},u_extentsTexture:function(){return n},u_polygonTexture:function(){return t}},persists:!1,owner:e,postExecute:()=>{e._signedDistanceComputeCommand=void 0}})}var Zre=new ae,ONe=new ae;zr.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._polygons,i=n.length,o=Kt.OUTSIDE;this.inverse&&(o=Kt.INSIDE);for(let r=0;r<i;++r){let a=n[r].computeRectangle(),c=e.rectangle;if(!l(c)&&l(e.boundingVolume?.computeCorners)){let u=e.boundingVolume.computeCorners();c=ae.fromCartesianArray(u,t,Zre)}l(c)||(c=ae.fromBoundingSphere(e.boundingSphere,t,Zre));let d=ae.simpleIntersection(c,a,ONe);l(d)&&(o=Kt.INTERSECTING)}return o};zr.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};zr.isSupported=function(e){return e?.context.webgl2};zr.getTextureResolution=function(e,t,n){if(l(e))return n.x=e.width,n.y=e.height,n;let i=Dt.maximumTextureSize;return n.x=Math.min(t,i),n.y=Math.ceil(t/n.x),n.y*=2,n};zr.getClippingDistanceTextureResolution=function(e,t){let n=e.signedDistanceTexture;return l(n)?(t.x=n.width,t.y=n.height,t):(t.x=Math.min(Dt.maximumTextureSize,4096),t.y=Math.min(Dt.maximumTextureSize,4096),t)};zr.getClippingExtentsTextureResolution=function(e,t){let n=e.extentsTexture;return l(n)?(t.x=n.width,t.y=n.height,t):zr.getTextureResolution(n,e.pixelsNeededForExtents,t)};zr.prototype.isDestroyed=function(){return!1};zr.prototype.destroy=function(){return l(this._signedDistanceComputeCommand)&&(this._signedDistanceComputeCommand.canceled=!0),this._polygonsTexture=this._polygonsTexture&&this._polygonsTexture.destroy(),this._extentsTexture=this._extentsTexture&&this._extentsTexture.destroy(),this._signedDistanceTexture=this._signedDistanceTexture&&this._signedDistanceTexture.destroy(),me(this)};var Am=zr;var vpn=T(S(),1);var OX={HIGHLIGHT:0,REPLACE:1,MIX:2};OX.getColorBlend=function(e,t){if(e===OX.HIGHLIGHT)return 0;if(e===OX.REPLACE)return 1;if(e===OX.MIX)return W.clamp(t,W.EPSILON4,1)};var cc=Object.freeze(OX);var Qbn=T(S(),1);var Fpn=T(S(),1),HNe={XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"},lc=Object.freeze(HNe);var Mpn=T(S(),1),zNe={STEP:0,LINEAR:1,CUBICSPLINE:2},Mm=Object.freeze(zNe);var H0n=T(S(),1);var G0n=T(S(),1);var Kpn=T(S(),1);var Bpn=T(S(),1);var Gre={};function HX(e){this._count=e.count,this._properties=Ye(e.properties,!0)}HX.prototype.hasProperty=function(e){return Mn.hasProperty(e,this._properties,Gre)};HX.prototype.getPropertyIds=function(e){return Mn.getPropertyIds(this._properties,Gre,e)};HX.prototype.getProperty=function(e,t){let n=this._properties[t];if(l(n))return Ye(n[e],!0)};HX.prototype.setProperty=function(e,t,n){let i=this._properties[t];l(i)||(i=new Array(this._count),this._properties[t]=i),i[e]=Ye(n,!0)};var Hp=HX;function dc(e){e=y(e,y.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(dc.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}}});dc.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))};dc.prototype.hasPropertyBySemantic=function(e,t){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};dc.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))};dc.prototype.propertyExistsBySemantic=function(e){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var WH=[];dc.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,l(this._metadataTable)&&t.push.apply(t,this._metadataTable.getPropertyIds(WH)),l(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,WH)),l(this._jsonMetadataTable)&&t.push.apply(t,this._jsonMetadataTable.getPropertyIds(WH)),t};dc.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};dc.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 Hp({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,n))};dc.prototype.getPropertyBySemantic=function(e,t){if(l(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};dc.prototype.setPropertyBySemantic=function(e,t,n){return l(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};dc.prototype.getPropertyTypedArray=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};dc.prototype.getPropertyTypedArrayBySemantic=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};dc.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};dc.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};dc.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};var Yc=dc;var s0n=T(S(),1);var t0n=T(S(),1);function zX(e){e=y(e,y.EMPTY_OBJECT);let t=e.property,n=e.classProperty,i=e.textures,o=l(t.channels)?t.channels:[0],r=t,s=El.createModelTextureReader({textureInfo:r,channels:QNe(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=y(a,n.offset),c=y(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(zX.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}}});zX.prototype.isGpuCompatible=function(){let e=this._classProperty,t=e.type,n=e.componentType;return e.isArray?!e.isVariableLengthArray&&e.arrayLength<=4&&t===zt.SCALAR&&n===an.UINT8:zt.isVectorType(t)||t===zt.SCALAR?n===an.UINT8:!1};var KNe=[void 0,"float","vec2","vec3","vec4"],JNe=[void 0,"int","ivec2","ivec3","ivec4"];zX.prototype.getGlslType=function(){let e=this._classProperty,t=zt.getComponentCount(e.type);return e.isArray&&(t=e.arrayLength),e.normalized?KNe[t]:JNe[t]};zX.prototype.unpackInShader=function(e){return this._classProperty.normalized?e:`${this.getGlslType()}(255.0 * ${e})`};function QNe(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var KX=zX;function PH(e){e=y(e,y.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 KX({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(PH.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}}});PH.prototype.getProperty=function(e){return this._properties[e]};var s_=PH;var p0n=T(S(),1);var d0n=T(S(),1);function Ere(e){e=y(e,y.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=y(i,n.offset),o=y(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(Ere.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 JX=Ere;function vH(e){e=y(e,y.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 JX({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(vH.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}}});vH.prototype.getProperty=function(e){return this._properties[e]};var a_=vH;var x0n=T(S(),1);function QX(e){e=y(e,y.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(QX.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}}});QX.prototype.getPropertyTable=function(e){return this._propertyTables[e]};QX.prototype.getPropertyTexture=function(e){return this._propertyTextures[e]};QX.prototype.getPropertyAttribute=function(e){return this._propertyAttributes[e]};var Xa=QX;function jNe(e){e=y(e,y.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 Zl({count:a.count,properties:a.properties,class:c,bufferViews:e.bufferViews});i.push(new Yc({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 s_({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 a_({id:s,name:a.name,class:n.classes[a.class],propertyAttribute:a}))}return new Xa({schema:n,propertyTables:i,propertyTextures:o,propertyAttributes:r,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}var jX=jNe;var A0n=T(S(),1);function qNe(e){e=y(e,y.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 Zl({count:c.count,properties:c.properties,class:d,bufferViews:e.bufferViews});o.push(new Yc({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 s_({id:a,propertyTexture:$Ne(c),class:n.classes[c.class],textures:e.textures}))}return new Xa({schema:n,propertyTables:o,propertyTextures:s,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function $Ne(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:e5e(o.channels),extras:o.extras,extensions:o.extensions};t.properties[i]=_t(o.texture,r,!0)}return t}function e5e(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 qX=qNe;function ag(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,extension:n,extensionLegacy:i,gltfResource:o,baseResource:r,supportedImageFormats:s,frameState:a,cacheKey:c,asynchronous:d=!0}=e;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=It.UNLOADED,this._promise=void 0}l(Object.create)&&(ag.prototype=Object.create(eo.prototype),ag.prototype.constructor=ag);Object.defineProperties(ag.prototype,{cacheKey:{get:function(){return this._cacheKey}},structuralMetadata:{get:function(){return this._structuralMetadata}}});async function t5e(e){try{let t=s5e(e),n=u5e(e),i=m5e(e);return await Promise.all([t,n,i]),e.isDestroyed()?void 0:(e._gltf=void 0,e._state=It.LOADED,e)}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=It.FAILED,e.getError("Failed to load structural metadata",t)}}ag.prototype.load=function(){return l(this._promise)?this._promise:(this._state=It.LOADING,this._promise=t5e(this),this._promise)};function n5e(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 i5e(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 o5e(e){let t=e.propertyTables,n={};if(l(t))for(let i=0;i<t.length;i++){let o=t[i];n5e(o.properties,n)}return n}function r5e(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)&&i5e(r,n)}}return n}async function s5e(e){let t;l(e._extension)?t=o5e(e._extension):t=r5e(e._extensionLegacy);let n=[];for(let i in t)if(t.hasOwnProperty(i)){let o=Bi.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 a5e(e){let t={},n=e.propertyTextures;if(l(n))for(let i=0;i<n.length;i++){let r=n[i].properties;l(r)&&c5e(r,t)}return t}function c5e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t[i.index]=i}}function l5e(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)&&d5e(r,t)}}return t}function d5e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let o=e[n].texture;t[o.index]=o}}function u5e(e){let t;l(e._extension)?t=a5e(e._extension):t=l5e(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=Bi.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 m5e(e){let t=y(e._extension,e._extensionLegacy),n;if(l(t.schemaUri)){let i=e._baseResource.getDerivedResource({url:t.schemaUri});n=Bi.getSchemaLoader({resource:i})}else n=Bi.getSchemaLoader({schema:t.schema});if(e._schemaLoader=n,await n.load(),!n.isDestroyed())return n.schema}ag.prototype.process=function(e){if(this._state===It.READY)return!0;if(this._state!==It.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=jX({extension:this._extension,schema:o,bufferViews:r,textures:s}):this._structuralMetadata=qX({extension:this._extensionLegacy,schema:o,bufferViews:r,textures:s}),Xre(this),this._state=It.READY,!0};function Xre(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)Bi.unload(t[i]);e._bufferViewLoaders.length=0,e._bufferViewIds.length=0}function h5e(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)Bi.unload(t[i]);e._textureLoaders.length=0,e._textureIds.length=0}ag.prototype.unload=function(){Xre(this),h5e(this),l(this._schemaLoader)&&Bi.unload(this._schemaLoader),this._schemaLoader=void 0,this._structuralMetadata=void 0};var $X=ag;var K0n=T(S(),1);var EC={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};EC.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"TRANSLATION":return EC.TRANSLATION;case"ROTATION":return EC.ROTATION;case"SCALE":return EC.SCALE;case"_FEATURE_ID":return EC.FEATURE_ID}};var Kr=Object.freeze(EC);var pbn=T(S(),1);var rbn=T(S(),1);var f5e=65534,p5e=255;function f5(e){e=y(e,y.EMPTY_OBJECT);let t=e.triangleIndices,n=e.outlineIndices,i=e.originalVertexCount;this._triangleIndices=t,this._originalVertexCount=i,this._edges=new Pre(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],b5e(this)}Object.defineProperties(f5.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}});function b5e(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),g=m||n.hasEdge(d,u),f=m||n.hasEdge(u,c),x=Ire(i,c,d,u,p,g,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]=_}_>f5e&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):_>p5e&&t instanceof Uint8Array&&(t=new Uint16Array(t)),x===c?(c=_,t[a]=_):x===d?(d=_,t[a+1]=_):(u=_,t[a+2]=_),x=Ire(i,c,d,u,p,g,f)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function Ire(e,t,n,i,o,r,s){let a=s?1:0,c=o?1:0,d=0,u=wH(e,t,a,c,d);if(u===0)return t;let m=0,p=o?1:0,g=r?1:0,f=wH(e,n,m,p,g);if(f===0)return n;let x=s?1:0,_=0,C=r?1:0,V=wH(e,i,x,_,C);if(V===0)return i;let L=u&f&V,Z,E,X;if(L&1)Z=0,E=1,X=2;else if(L&2)Z=0,X=1,E=2;else if(L&4)E=0,Z=1,X=2;else if(L&8)E=0,X=1,Z=2;else if(L&16)X=0,Z=1,E=2;else if(L&32)X=0,E=1,Z=2;else{let M=FH(u),b=FH(f),R=FH(V);return M<b&&M<R?t:b<R?n:i}let v=t*3;e[v+Z]=a,e[v+E]=c,e[v+X]=d;let P=n*3;e[P+Z]=m,e[P+E]=p,e[P+X]=g;let A=i*3;e[A+Z]=x,e[A+E]=_,e[A+X]=C}function wH(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 FH(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}f5.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};f5.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,Dt.maximumTextureSize),i=n,o=Wre(i),r=[];for(;i>1;)i>>=1,r.push(Wre(i));let s=new Ft({context:e,source:{arrayBufferView:o,mipLevels:r},width:n,height:1,pixelFormat:at.LUMINANCE,sampler:new $t({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:qt.LINEAR_MIPMAP_LINEAR,magnificationFilter:ui.LINEAR})});return t.outlineTexture=s,s};function Wre(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 Pre(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)}}Pre.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 c_=f5;function vre(e){this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function g5e(e){this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1}function p5(e){this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0}p5.prototype.postProcess=function(e){this.needsOutlines&&(y5e(this),_5e(this,e))};function y5e(e){let t=e.primitive,n=t.indices,i=t.attributes[0].count,o=new c_({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=o.updatedTriangleIndices,n.indexDatatype=Ae.fromTypedArray(n.typedArray);let r=x5e(o.outlineCoordinates),s=new vre(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 x5e(e){let t=new Tn.Attribute;return t.name="_OUTLINE_COORDINATES",t.typedArray=e,t.componentDatatype=Q.FLOAT,t.type=on.VEC3,t.normalized=!1,t.count=e.length/3,t}function _5e(e,t){T5e(e.attributePlans,t),l(e.indicesPlan)&&S5e(e.indicesPlan,t)}function T5e(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=yt.createVertexBuffer({typedArray:s,context:t,usage:Me.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.buffer=a}o.loadTypedArray||(r.typedArray=void 0)}}function S5e(e,t){let n=e.indices;if(e.loadBuffer){let i=yt.createIndexBuffer({typedArray:n.typedArray,context:t,usage:Me.STATIC_DRAW,indexDatatype:n.indexDatatype});n.buffer=i,i.vertexArrayDestroyable=!1}e.loadTypedArray||(n.typedArray=void 0)}p5.AttributeLoadPlan=vre;p5.IndicesLoadPlan=g5e;var l_=p5;var ybn=T(S(),1);function C5e(e){e=y(e,y.EMPTY_OBJECT),this.webp=y(e.webp,!1),this.basis=y(e.basis,!1)}var eI=C5e;var{Attribute:V5e,Indices:L5e,FeatureIdAttribute:wre,FeatureIdTexture:Fre,FeatureIdImplicitRange:Are,MorphTarget:R5e,Primitive:Z5e,Instances:G5e,Skin:E5e,Node:X5e,AnimatedPropertyType:I5e,AnimationSampler:W5e,AnimationTarget:P5e,AnimationChannel:v5e,Animation:w5e,ArticulationStage:F5e,Articulation:A5e,Asset:M5e,Scene:N5e,Components:k5e,MetallicRoughness:U5e,SpecularGlossiness:D5e,Specular:B5e,Anisotropy:AH,Clearcoat:MH,Material:Y5e}=Tn,Wo={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8};function Nm(e){e=y(e,y.EMPTY_OBJECT);let{gltfResource:t,typedArray:n,releaseGltfJson:i=!1,asynchronous:o=!0,incrementallyLoadTextures:r=!0,upAxis:s=Xo.Y,forwardAxis:a=Xo.Z,loadAttributesAsTypedArray:c=!1,loadAttributesFor2D:d=!1,enablePick:u=!1,loadIndicesForWireframe:m=!1,loadPrimitiveOutline:p=!0,loadForClassification:g=!1,renameBatchIdSemantic:f=!1}=e,{baseResource:x=t.clone()}=e;this._gltfJson=e.gltfJson,this._gltfResource=t,this._baseResource=x,this._typedArray=n,this._releaseGltfJson=i,this._asynchronous=o,this._incrementallyLoadTextures=r,this._upAxis=s,this._forwardAxis=a,this._loadAttributesAsTypedArray=c,this._loadAttributesFor2D=d,this._enablePick=u,this._loadIndicesForWireframe=m,this._loadPrimitiveOutline=p,this._loadForClassification=g,this._renameBatchIdSemantic=f,this._sortedPropertyTableIds=void 0,this._sortedFeatureTextureIds=void 0,this._gltfJsonLoader=void 0,this._state=Wo.NOT_LOADED,this._textureState=Wo.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._supportedImageFormats=void 0,this._postProcessBuffers=[],this._components=void 0}l(Object.create)&&(Nm.prototype=Object.create(eo.prototype),Nm.prototype.constructor=Nm);Object.defineProperties(Nm.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 O5e(e){e._state=Wo.LOADING,e._textureState=Wo.LOADING;try{let t=Bi.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=Wo.LOADED,e._textureState=Wo.LOADED,e)}catch(t){if(e.isDestroyed())return;e._state=Wo.FAILED,e._textureState=Wo.FAILED,b5(e,t)}}async function H5e(e,t){Ot.supportsWebP.initialized||await Ot.supportsWebP.initialize(),e._supportedImageFormats=new eI({webp:Ot.supportsWebP(),basis:t.context.supportsBasis});let n=Kke(e,t);return e._state=Wo.PROCESSING,e._textureState=Wo.PROCESSING,l(e._gltfJsonLoader)&&e._releaseGltfJson&&(Bi.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),n}Nm.prototype.load=async function(){return l(this._promise)?this._promise:(this._promise=O5e(this),this._promise)};function b5(e,t){throw e.unload(),e.getError("Failed to load glTF",t)}function z5e(e,t){let n=!0,i=e._geometryLoaders;for(let r=0;r<i.length;++r){let s=i[r].process(t);s&&l(e._geometryCallbacks[r])&&(e._geometryCallbacks[r](),e._geometryCallbacks[r]=void 0),n=n&&s}let o=e._structuralMetadataLoader;if(l(o)){let r=o.process(t);r&&(e._components.structuralMetadata=o.structuralMetadata),n=n&&r}n&&(e._state=Wo.POST_PROCESSING)}function K5e(e,t){let n=e._primitiveLoadPlans;for(let i=0;i<n.length;i++){let o=n[i];o.postProcess(t),o.needsOutlines&&J5e(e,o)}}function J5e(e,t){let n=e._postProcessBuffers,i=t.primitive,o=i.outlineCoordinates;l(o)&&n.push(o.buffer);let r=i.attributes;for(let a=0;a<r.length;a++){let c=r[a];l(c.buffer)&&n.push(c.buffer)}let s=i.indices;l(s)&&l(s.buffer)&&n.push(s.buffer)}Nm.prototype._process=function(e){return this._state===Wo.READY?!0:(this._state===Wo.PROCESSING&&z5e(this,e),this._resourcesLoaded&&this._state===Wo.POST_PROCESSING&&(K5e(this,e.context),this._state=Wo.PROCESSED),this._resourcesLoaded&&this._state===Wo.PROCESSED?(Hre(this),this._typedArray=void 0,this._state=Wo.READY,!0):!1)};Nm.prototype._processTextures=function(e){if(this._textureState===Wo.READY)return!0;if(this._textureState!==Wo.PROCESSING)return!1;let t=!0,n=this._textureLoaders;for(let i=0;i<n.length;++i){let o=n[i].process(e);o&&l(this._textureCallbacks[i])&&(this._textureCallbacks[i](),this._textureCallbacks[i]=void 0),t=t&&o}return t?(this._textureState=Wo.READY,this._texturesLoaded=!0,!0):!1};Nm.prototype.process=function(e){if(this._state===Wo.LOADED&&!l(this._loadResourcesPromise)&&(this._loadResourcesPromise=H5e(this,e).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),l(this._processError)){this._state=Wo.FAILED;let o=this._processError;this._processError=void 0,b5(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===Wo.FAILED)return!1;let n=!1;try{n=this._process(e)}catch(o){this._state=Wo.FAILED,b5(this,o)}let i=!1;try{i=this._processTextures(e)}catch(o){this._textureState=Wo.FAILED,b5(this,o)}return this._incrementallyLoadTextures?n:n&&i};function Q5e(e,t,n,i,o,r,s){let a=e.gltfJson,d=a.accessors[t].bufferView;return Bi.getVertexBufferLoader({gltf:a,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:s,bufferViewId:d,draco:i,attributeSemantic:n,accessorId:t,asynchronous:e._asynchronous,loadBuffer:o,loadTypedArray:r})}function j5e(e,t,n,i,o,r){return Bi.getIndexBufferLoader({gltf:e.gltfJson,accessorId:t,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:r,draco:n,asynchronous:e._asynchronous,loadBuffer:i,loadTypedArray:o})}function q5e(e,t){let n=Bi.getBufferViewLoader({gltf:e.gltfJson,bufferViewId:t,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(n),n}function Mre(e,t,n){let i=t.byteOffset,o=Gl(e,t),r=t.count,s=pd(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),g=new Array(s),f=Bp(t.componentType);i=n.byteOffset+i;for(let x=0;x<r;++x){f(p,i,s,c,g);for(let _=0;_<s;++_)m[x*s+_]=g[_];i+=o}return m}function $5e(e,t){let n=e.type;if(n===on.SCALAR)return t.fill(0);let i=on.getMathType(n);return t.fill(i.clone(i.ZERO))}function eke(e,t,n,i){let o=e.type,r=e.count;if(o===on.SCALAR)for(let s=0;s<r;s++)n[s]=t[s];else if(o===on.VEC4&&i)for(let s=0;s<r;s++)n[s]=we.unpack(t,s*4);else{let s=on.getMathType(o),a=on.getNumberOfComponents(o);for(let c=0;c<r;c++)n[c]=s.unpack(t,c*a)}return n}async function tke(e,t,n,i,o){let{gltfJson:r}=e;if(await t.load(),e.isDestroyed())return;let s=Mre(r,n,t.typedArray);i=y(i,!1),eke(n,s,o,i)}function g5(e,t,n){let i=new Array(t.count),o=t.bufferView;if(l(o)){let r=q5e(e,o),s=tke(e,r,t,n,i);return e._loaderPromises.push(s),i}return $5e(t,i)}function bd(e,t){if(l(t))return e===Number?t[0]:e.unpack(t)}function nke(e){return e===Number?0:new e}function ike(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 oke={VEC2:new D(-1,-1),VEC3:new h(-1,-1,-1),VEC4:new se(-1,-1,-1,-1)};function rke(e,t){let n=ike(e.componentDatatype),i=oke[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 ske(e,t,n){let i=e.decodeMatrix,o=bd(n,e.decodedMin),r=bd(n,e.decodedMax);l(o)&&l(r)&&(t.min=o,t.max=r);let s=new Tn.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 D(i[6],i[7]),s.quantizedVolumeStepSize=new D(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 ake(e,t,n,i,o){let r=e.accessors[t],s=on.getMathType(r.type),a=y(r.normalized,!1),c=new V5e;c.name=n,c.semantic=i,c.setIndex=o,c.constant=nke(s),c.componentDatatype=r.componentType,c.normalized=a,c.count=r.count,c.type=r.type,c.min=bd(s,r.min),c.max=bd(s,r.max),c.byteOffset=r.byteOffset,c.byteStride=Gl(e,r),ii(r,"WEB3D_quantized_attributes")&&ske(r.extensions.WEB3D_quantized_attributes,c,s);let d=c.semantic===St.POSITION||c.semantic===St.NORMAL||c.semantic===St.TANGENT||c.semantic===St.TEXCOORD;return e.extensionsRequired?.includes("KHR_mesh_quantization")&&a&&d&&rke(c,s),c}function Nre(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var cke={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function NH(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let o=t.fromGltfSemantic(i),r=cke;return r.gltfSemantic=n,r.renamedSemantic=i,r.modelSemantic=o,r}function lke(e){let t=e===St.POSITION,n=e===St.FEATURE_ID,i=e===St.TEXCOORD;return t||n||i}function dke(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 uke(e,t,n,i,o,r){if(o&&(n.buffer=i.buffer),r){let s=i.typedArray;n.typedArray=Mre(e,t,s),o||(n.byteOffset=0,n.byteStride=void 0)}}function kre(e,t,n,i,o,r,s){let a=e.gltfJson,c=a.accessors[t],d=c.bufferView,u=n.gltfSemantic,m=n.renamedSemantic,p=n.modelSemantic,g=l(p)?Nre(m):void 0,x=ake(a,t,u,p,g);if(!l(i)&&!l(d))return x;let _=Q5e(e,t,u,i,o,r,s),C=e._geometryLoaders.length;e._geometryLoaders.push(_);let V=_.load();return e._loaderPromises.push(V),e._geometryCallbacks[C]=()=>{l(i)&&l(i.attributes)&&l(i.attributes[u])?dke(x,_,o,r):uke(a,c,x,_,o,r)},x}function Ure(e,t,n,i,o,r,s){let a=n.modelSemantic,c=a===St.POSITION,d=a===St.FEATURE_ID,u=c&&!o&&e._loadAttributesFor2D&&!s.scene3DOnly,m=c&&e._enablePick&&!s.context.webgl2,p=e._loadForClassification&&d,g=e._loadAttributesAsTypedArray,f=!g,x=g||u||m||p,V=kre(e,t,n,i,r?!1:f,r?!0:x,s),L=new l_.AttributeLoadPlan(V);return L.loadBuffer=f,L.loadTypedArray=x,L}function mke(e,t,n,i,o){let r=e.gltfJson.accessors,s=l(n.ROTATION),a=l(n.TRANSLATION)&&l(r[n.TRANSLATION].min)&&l(r[n.TRANSLATION].max),c=NH(e,Kr,i),d=c.modelSemantic,u=d===Kr.TRANSLATION||d===Kr.ROTATION||d===Kr.SCALE,m=d===Kr.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&u||!o.context.instancedArrays,g=e._enablePick&&!o.context.webgl2,f=!p,x=e._loadAttributesFor2D&&!o.scene3DOnly;return kre(e,t,c,void 0,f,p||m&&(!a||x||g),o)}function hke(e,t,n,i,o,r){let s=e.gltfJson.accessors[t],a=s.bufferView;if(!l(n)&&!l(a))return;let c=new L5e;c.count=s.count;let d=e._loadAttributesAsTypedArray,u=(e._loadIndicesForWireframe||e._enablePick)&&!r.context.webgl2,m=e._loadForClassification&&i,g=!d,f=d||u||m,C=j5e(e,t,n,o?!1:g,o?!0:f,r),V=e._geometryLoaders.length;e._geometryLoaders.push(C);let L=C.load();e._loaderPromises.push(L),e._geometryCallbacks[V]=()=>{c.indexDatatype=C.indexDatatype,c.buffer=C.buffer,c.typedArray=C.typedArray};let Z=new l_.IndicesLoadPlan(c);return Z.loadBuffer=g,Z.loadTypedArray=f,Z}function Oc(e,t,n,i){let o=e.gltfJson,r=El.getImageIdFromTexture({gltf:o,textureId:t.index,supportedImageFormats:e._supportedImageFormats});if(!l(r))return;let s=Bi.getTextureLoader({gltf:o,textureInfo:t,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:n,asynchronous:e._asynchronous}),a=El.createModelTextureReader({textureInfo:t}),c=e._textureLoaders.length;e._textureLoaders.push(s);let d=s.load().catch(u=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw u;e._textureState=Wo.FAILED,e._textureErrors.push(u)}});return e._texturesPromises.push(d),e._textureCallbacks[c]=()=>{a.texture=s.texture,l(i)&&(a.texture.sampler=i)},a}function fke(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:o,diffuseFactor:r,specularFactor:s,glossinessFactor:a}=t,c=new D5e;return l(i)&&(c.diffuseTexture=Oc(e,i,n)),l(o)&&(c.specularGlossinessTexture=Oc(e,o,n)),c.diffuseFactor=bd(se,r),c.specularFactor=bd(h,s),c.glossinessFactor=a,c}function pke(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:o,baseColorFactor:r,metallicFactor:s,roughnessFactor:a}=t,c=new U5e;return l(i)&&(c.baseColorTexture=Oc(e,i,n)),l(o)&&(c.metallicRoughnessTexture=Oc(e,o,n)),c.baseColorFactor=bd(se,r),c.metallicFactor=s,c.roughnessFactor=a,c}function bke(e,t,n){let{specularFactor:i,specularTexture:o,specularColorFactor:r,specularColorTexture:s}=t,a=new B5e;return l(o)&&(a.specularTexture=Oc(e,o,n)),l(s)&&(a.specularColorTexture=Oc(e,s,n)),a.specularFactor=i,a.specularColorFactor=bd(h,r),a}function gke(e,t,n){let{anisotropyStrength:i=AH.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=AH.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:r}=t,s=new AH;return l(r)&&(s.anisotropyTexture=Oc(e,r,n)),s.anisotropyStrength=i,s.anisotropyRotation=o,s}function yke(e,t,n){let{clearcoatFactor:i=MH.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:r=MH.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:s,clearcoatNormalTexture:a}=t,c=new MH;return l(o)&&(c.clearcoatTexture=Oc(e,o,n)),l(s)&&(c.clearcoatRoughnessTexture=Oc(e,s,n)),l(a)&&(c.clearcoatNormalTexture=Oc(e,a,n)),c.clearcoatFactor=i,c.clearcoatRoughnessFactor=r,c}function xke(e,t,n){let i=new Y5e,o=y(t.extensions,y.EMPTY_OBJECT),r=o.KHR_materials_pbrSpecularGlossiness,s=o.KHR_materials_specular,a=o.KHR_materials_anisotropy,c=o.KHR_materials_clearcoat,d=t.pbrMetallicRoughness;return i.unlit=l(o.KHR_materials_unlit),l(r)?i.specularGlossiness=fke(e,r,n):(l(d)&&(i.metallicRoughness=pke(e,d,n)),l(s)&&!i.unlit&&(i.specular=bke(e,s,n)),l(a)&&!i.unlit&&(i.anisotropy=gke(e,a,n)),l(c)&&!i.unlit&&(i.clearcoat=yke(e,c,n))),l(t.emissiveTexture)&&(i.emissiveTexture=Oc(e,t.emissiveTexture,n)),l(t.normalTexture)&&!e._loadForClassification&&(i.normalTexture=Oc(e,t.normalTexture,n)),l(t.occlusionTexture)&&(i.occlusionTexture=Oc(e,t.occlusionTexture,n)),i.emissiveFactor=bd(h,t.emissiveFactor),i.alphaMode=t.alphaMode,i.alphaCutoff=t.alphaCutoff,i.doubleSided=t.doubleSided,i}function Dre(e,t){let n=new wre;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 Bre(e,t,n,i){let o=new wre,r=e.featureIds;return o.featureCount=n,o.propertyTableId=t,o.setIndex=Nre(r.attribute),o.positionalLabel=i,o}function Yre(e,t){let n=new Are;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 Ore(e,t,n,i){let o=new Are,r=e.featureIds;o.propertyTableId=t,o.featureCount=n,o.offset=y(r.constant,0);let s=y(r.divisor,0);return o.repeat=s===0?void 0:s,o.positionalLabel=i,o}function _ke(e,t,n,i){let o=new Fre;o.featureCount=t.featureCount,o.nullFeatureId=t.nullFeatureId,o.propertyTableId=t.propertyTable,o.label=t.label,o.positionalLabel=i;let r=t.texture;o.textureReader=Oc(e,r,n,$t.NEAREST);let a=(l(r.channels)?r.channels:[0]).map(function(c){return"rgba".charAt(c)}).join("");return o.textureReader.channels=a,o}function Tke(e,t,n,i,o,r){let s=new Fre,a=t.featureIds,c=a.texture;return s.featureCount=o,s.propertyTableId=n,s.textureReader=Oc(e,c,i,$t.NEAREST),s.textureReader.channels=a.channels,s.positionalLabel=r,s}function Ske(e,t,n,i,o){let r=new R5e,s=void 0,a=!1;for(let c in t){if(!t.hasOwnProperty(c))continue;let d=t[c],u=NH(e,St,c),m=Ure(e,d,u,s,a,n,o);r.attributes.push(m.attribute),i.attributePlans.push(m)}return r}function Cke(e,t,n,i){let o=new Z5e,r=new l_(o);e._primitiveLoadPlans.push(r);let s=t.material;l(s)&&(o.material=xke(e,e.gltfJson.materials[s],i));let a=y(t.extensions,y.EMPTY_OBJECT),c=!1,d=a.CESIUM_primitive_outline;e._loadPrimitiveOutline&&l(d)&&(c=!0,r.needsOutlines=!0,r.outlineIndices=Vke(e,d,r));let u=e._loadForClassification,m=a.KHR_draco_mesh_compression,p=!1,g=t.attributes;if(l(g))for(let E in g){if(!g.hasOwnProperty(E))continue;let X=g[E],v=NH(e,St,E),P=v.modelSemantic;if(u&&!lke(P))continue;P===St.FEATURE_ID&&(p=!0);let A=Ure(e,X,v,m,n,c,i);r.attributePlans.push(A),o.attributes.push(A.attribute)}let f=t.targets;if(l(f)&&!u)for(let E=0;E<f.length;++E)o.morphTargets.push(Ske(e,f[E],c,r,i));let x=t.indices;if(l(x)){let E=hke(e,x,m,p,c,i);l(E)&&(r.indicesPlan=E,o.indices=E.indices)}let _=a.EXT_structural_metadata,C=a.EXT_mesh_features,V=a.EXT_feature_metadata,L=l(V);l(C)?Lke(e,o,C,i):L&&Rke(e,o,V,i),l(_)?Zke(o,_):L&&Gke(e,o,V);let Z=t.mode;if(u&&Z!==Fe.TRIANGLES)throw new ue("Only triangle meshes can be used for classification.");return o.primitiveType=Z,o}function Vke(e,t){let n=t.indices,i=e.gltfJson.accessors[n];return g5(e,i,!1)}function Lke(e,t,n,i){let o;l(n)&&l(n.featureIds)?o=n.featureIds:o=[];for(let r=0;r<o.length;r++){let s=o[r],a=`featureId_${r}`,c;l(s.texture)?c=_ke(e,s,i,a):l(s.attribute)?c=Dre(s,a):c=Yre(s,a),t.featureIds.push(c)}}function Rke(e,t,n,i){let{featureTables:o}=e.gltfJson.extensions.EXT_feature_metadata,r=0,s=n.featureIdAttributes;if(l(s))for(let c=0;c<s.length;++c){let d=s[c],u=d.featureTable,m=e._sortedPropertyTableIds.indexOf(u),p=o[u].count,g=`featureId_${r}`;r++;let f;l(d.featureIds.attribute)?f=Bre(d,m,p,g):f=Ore(d,m,p,g),t.featureIds.push(f)}let a=n.featureIdTextures;if(l(a))for(let c=0;c<a.length;++c){let d=a[c],u=d.featureTable,m=e._sortedPropertyTableIds.indexOf(u),p=o[u].count,g=`featureId_${r}`;r++;let f=Tke(e,d,m,i,p,g);t.featureIds.push(f)}}function Zke(e,t){l(t)&&(l(t.propertyTextures)&&(e.propertyTextureIds=t.propertyTextures),l(t.propertyAttributes)&&(e.propertyAttributeIds=t.propertyAttributes))}function Gke(e,t,n){l(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map(function(i){return e._sortedFeatureTextureIds.indexOf(i)}))}function Eke(e,t,n){let i=t.EXT_mesh_gpu_instancing,o=new G5e,r=i.attributes;if(l(r))for(let d in r){if(!r.hasOwnProperty(d))continue;let u=r[d];o.attributes.push(mke(e,u,r,d,n))}let s=y(i.extensions,y.EMPTY_OBJECT),a=t.EXT_instance_features,c=s.EXT_feature_metadata;return l(a)?Xke(o,a):l(c)&&Ike(e.gltfJson,o,c,e._sortedPropertyTableIds),o}function Xke(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=Dre(o,r):s=Yre(o,r),e.featureIds.push(s)}}function Ike(e,t,n,i){let o=e.extensions.EXT_feature_metadata.featureTables,r=n.featureIdAttributes;if(l(r))for(let s=0;s<r.length;++s){let a=r[s],c=a.featureTable,d=i.indexOf(c),u=o[c].count,m=`instanceFeatureId_${s}`,p;l(a.featureIds.attribute)?p=Bre(a,d,u,m):p=Ore(a,d,u,m),t.featureIds.push(p)}}function Wke(e,t,n){let i=new X5e;i.name=t.name,i.matrix=bd(F,t.matrix),i.translation=bd(h,t.translation),i.rotation=bd(we,t.rotation),i.scale=bd(h,t.scale);let o=y(t.extensions,y.EMPTY_OBJECT),r=o.EXT_mesh_gpu_instancing,s=o.AGI_articulations;if(l(r)){if(e._loadForClassification)throw new ue("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");i.instances=Eke(e,o,n)}l(s)&&(i.articulationName=s.articulationName);let a=t.mesh;if(l(a)){let c=e.gltfJson.meshes[a],d=c.primitives;for(let p=0;p<d.length;++p)i.primitives.push(Cke(e,d[p],l(i.instances),n));let u=y(t.weights,c.weights),m=i.primitives[0].morphTargets;i.morphWeights=l(u)?u.slice():new Array(m.length).fill(0)}return i}function Pke(e,t){let n=e.gltfJson.nodes;if(!l(n))return[];let i=n.map(function(o,r){let s=Wke(e,o,t);return s.index=r,s});for(let o=0;o<i.length;++o){let r=n[o].children;if(l(r))for(let s=0;s<r.length;++s)i[o].children.push(i[r[s]])}return i}function vke(e,t,n){let i=new E5e,o=t.joints;i.joints=o.map(s=>n[s]);let r=t.inverseBindMatrices;if(l(r)){let s=e.gltfJson.accessors[r];i.inverseBindMatrices=g5(e,s)}else i.inverseBindMatrices=new Array(o.length).fill(F.IDENTITY);return i}function wke(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!l(n))return[];let i=n.map(function(r,s){let a=vke(e,r,t);return a.index=s,a}),o=e.gltfJson.nodes;for(let r=0;r<t.length;++r){let s=o[r].skin;l(s)&&(t[r].skin=i[s])}return i}async function Fke(e,t,n,i){let o=new $X({gltf:e.gltfJson,extension:t,extensionLegacy:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:i,asynchronous:e._asynchronous});return e._structuralMetadataLoader=o,o.load()}function Ake(e,t){let n=new W5e,i=e.gltfJson.accessors,o=i[t.input];n.input=g5(e,o);let r=t.interpolation;n.interpolation=y(Mm[r],Mm.LINEAR);let s=i[t.output];return n.output=g5(e,s,!0),n}function Mke(e,t){let n=new P5e,i=e.node;if(!l(i))return;n.node=t[i];let o=e.path.toUpperCase();return n.path=I5e[o],n}function Nke(e,t,n){let i=new v5e,o=e.sampler;return i.sampler=t[o],i.target=Mke(e.target,n),i}function kke(e,t,n){let i=new w5e;i.name=t.name;let o=t.samplers.map(function(s,a){let c=Ake(e,s);return c.index=a,c}),r=t.channels.map(function(s){return Nke(s,o,n)});return i.samplers=o,i.channels=r,i}function Uke(e,t){let n=e.gltfJson.animations;return e._loadForClassification||!l(n)?[]:n.map(function(o,r){let s=kke(e,o,t);return s.index=r,s})}function Dke(e){let t=new F5e;t.name=e.name;let n=e.type.toUpperCase();return t.type=lc[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function Bke(e){let t=new A5e;return t.name=e.name,t.stages=e.stages.map(Dke),t}function Yke(e){let n=y(e.extensions,y.EMPTY_OBJECT).AGI_articulations?.articulations;return l(n)?n.map(Bke):[]}function Oke(e){let t;return l(e.scenes)&&l(e.scene)&&(t=e.scenes[e.scene].nodes),t=y(t,e.nodes),t=l(t)?t:[],t}function Hke(e,t){let n=new N5e,i=Oke(e);return n.nodes=i.map(function(o){return t[o]}),n}var zke=new h;function Kke(e,t){let n=e.gltfJson,i=y(n.extensions,y.EMPTY_OBJECT),o=i.EXT_structural_metadata,r=i.EXT_feature_metadata,s=i.CESIUM_RTC;if(l(r)){let _=r.featureTables,C=r.featureTextures,V=l(_)?_:[],L=l(C)?C:[];e._sortedPropertyTableIds=Object.keys(V).sort(),e._sortedFeatureTextureIds=Object.keys(L).sort()}let a=Pke(e,t),c=wke(e,a),d=Uke(e,a),u=Yke(n),m=Hke(n,a),p=new k5e,g=new M5e,f=n.asset.copyright;if(l(f)){let _=f.split(";").map(function(C){return new Rt(C.trim())});g.credits=_}if(p.asset=g,p.scene=m,p.nodes=a,p.skins=c,p.animations=d,p.articulations=u,p.upAxis=e._upAxis,p.forwardAxis=e._forwardAxis,l(s)){let _=h.fromArray(s.center,0,zke);p.transform=F.fromTranslation(_,p.transform)}if(e._components=p,l(o)||l(r)){let _=Fke(e,o,r,t);e._loaderPromises.push(_)}let x=[];return x.push.apply(x,e._loaderPromises),e._incrementallyLoadTextures||x.push.apply(x,e._texturesPromises),Promise.all(x)}function Jke(e){let t=e._textureLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Bi.unload(t[n]);e._textureLoaders.length=0}function Hre(e){let t=e._bufferViewLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Bi.unload(t[n]);e._bufferViewLoaders.length=0}function Qke(e){let t=e._geometryLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Bi.unload(t[n]);e._geometryLoaders.length=0}function jke(e){let t=e._postProcessBuffers;for(let n=0;n<t.length;n++){let i=t[n];i.isDestroyed()||i.destroy()}t.length=0}function qke(e){l(e._structuralMetadataLoader)&&!e._structuralMetadataLoader.isDestroyed()&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0)}Nm.prototype.isUnloaded=function(){return this._state===Wo.UNLOADED};Nm.prototype.unload=function(){l(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&Bi.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,Jke(this),Hre(this),Qke(this),jke(this),qke(this),this._components=void 0,this._typedArray=void 0,this._state=Wo.UNLOADED};var zp=Nm;var ygn=T(S(),1);var fgn=T(S(),1);var qbn=T(S(),1),tI=`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 XC(){this._framebuffer=new hi({colorAttachmentsLength:2,depth:!0,supportsDepthTexture:!0}),this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}Object.defineProperties(XC.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 $ke(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var kH=new D;function eUe(e,t){let n=new Oe({defines:["LOG_DEPTH_WRITE"],sources:[tI]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return kH.x=e._radius,kH.y=e._strength,kH}},o=Ue.fromCache({blending:un.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:Bt.setCesium3DTileBit(),stencilMask:Bt.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(n,{uniformMap:i,renderState:o,pass:Re.CESIUM_3D_TILE,owner:e}),e._clearCommand=new ei({framebuffer:e.framebuffer,color:new Y(0,0,0,0),depth:1,renderState:Ue.fromCache(),pass:Re.CESIUM_3D_TILE,owner:e})}function tUe(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),eUe(e,t)}function zre(e){return e.drawBuffers&&e.fragmentDepth}XC.isSupported=zre;function nUe(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}XC.prototype.update=function(e,t,n,i){if(!zre(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,tUe(this,e.context);let o,r=e.commandList,s=r.length;for(o=t;o<s;++o){let d=r[o];if(d.primitiveType!==Fe.POINTS||d.pass===Re.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=tt.shallowClone(d,u),u.framebuffer=this.framebuffer,u.shaderProgram=nUe(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)};XC.prototype.isDestroyed=function(){return!1};XC.prototype.destroy=function(){return $ke(this),me(this)};var Kp=XC;function Kre(e){let t=y(e,{});this.attenuation=y(t.attenuation,!1),this.geometricErrorScale=y(t.geometricErrorScale,1),this.maximumAttenuation=t.maximumAttenuation,this.baseResolution=t.baseResolution,this.eyeDomeLighting=y(t.eyeDomeLighting,!0),this.eyeDomeLightingStrength=y(t.eyeDomeLightingStrength,1),this.eyeDomeLightingRadius=y(t.eyeDomeLightingRadius,1),this.backFaceCulling=y(t.backFaceCulling,!1),this.normalShading=y(t.normalShading,!0)}Kre.isSupported=function(e){return Kp.isSupported(e.context)};var sf=Kre;var Wgn=T(S(),1);var Ia={},iUe=new se(0,0,0,1),uc=new se,oUe=new Ke,UH=new D,DH=new D;Ia.worldToWindowCoordinates=function(e,t,n){return Ia.worldWithEyeOffsetToWindowCoordinates(e,t,h.ZERO,n)};var Jre=new se,Qre=new h;function nI(e,t,n,i){let o=n.viewMatrix,r=F.multiplyByVector(o,se.fromElements(e.x,e.y,e.z,1,Jre),Jre),s=h.multiplyComponents(t,h.normalize(r,Qre),Qre);return r.x+=t.x+s.x,r.y+=t.y+s.y,r.z+=s.z,F.multiplyByVector(n.frustum.projectionMatrix,r,i)}var rUe=new he(Math.PI,W.PI_OVER_TWO),sUe=new h,aUe=new h;Ia.worldWithEyeOffsetToWindowCoordinates=function(e,t,n,i){let o=e.frameState,r=Ia.computeActualEllipsoidPosition(o,t,iUe);if(!l(r))return;let s=e.canvas,a=oUe;a.x=0,a.y=0,a.width=s.clientWidth,a.height=s.clientHeight;let c=e.camera,d=!1;if(o.mode===oe.SCENE2D){let u=e.mapProjection,m=rUe,p=u.project(m,sUe),g=h.clone(c.position,aUe),f=c.frustum.clone(),x=F.computeViewportTransformation(a,0,1,new F),_=c.frustum.projectionMatrix,C=c.positionWC.y,V=h.fromElements(W.sign(C)*p.x-C,0,-c.positionWC.x),L=wt.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,uc=nI(r,n,c,uc),Ia.clipToGLWindowCoordinates(a,uc,UH),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,uc=nI(r,n,c,uc),Ia.clipToGLWindowCoordinates(a,uc,DH)}else{a.x+=L.x,a.width-=L.x,c.frustum.left=-p.x-C,uc=nI(r,n,c,uc),Ia.clipToGLWindowCoordinates(a,uc,UH),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,uc=nI(r,n,c,uc),Ia.clipToGLWindowCoordinates(a,uc,DH)}h.clone(g,c.position),c.frustum=f.clone(),i=D.clone(UH,i),(i.x<0||i.x>s.clientWidth)&&(i.x=DH.x)}}if(o.mode!==oe.SCENE2D||d){if(uc=nI(r,n,c,uc),uc.z<0&&!(c.frustum instanceof sn)&&!(c.frustum instanceof Zr))return;i=Ia.clipToGLWindowCoordinates(a,uc,i)}return i.y=s.clientHeight-i.y,i};Ia.worldToDrawingBufferCoordinates=function(e,t,n){if(n=Ia.worldToWindowCoordinates(e,t,n),!!l(n))return Ia.transformWindowToDrawingBuffer(e,n,n)};var Jp=new h,cUe=new he;Ia.computeActualEllipsoidPosition=function(e,t,n){let i=e.mode;if(i===oe.SCENE3D)return h.clone(t,n);let o=e.mapProjection,r=o.ellipsoid.cartesianToCartographic(t,cUe);if(!l(r))return;if(o.project(r,Jp),i===oe.COLUMBUS_VIEW)return h.fromElements(Jp.z,Jp.x,Jp.y,n);if(i===oe.SCENE2D)return h.fromElements(0,Jp.x,Jp.y,n);let s=e.morphTime;return h.fromElements(W.lerp(Jp.z,t.x,s),W.lerp(Jp.x,t.y,s),W.lerp(Jp.y,t.z,s),n)};var jre=new h,qre=new h,$re=new F;Ia.clipToGLWindowCoordinates=function(e,t,n){return h.divideByScalar(t,t.w,jre),F.computeViewportTransformation(e,0,1,$re),F.multiplyByPoint($re,jre,qre),D.fromCartesian3(qre,n)};Ia.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,o=e.drawingBufferWidth/i.clientWidth,r=e.drawingBufferHeight/i.clientHeight;return D.fromElements(t.x*o,t.y*r,n)};var lUe=new se,ese=new se;Ia.drawingBufferToWorldCoordinates=function(e,t,n,i){let r=e.context.uniformState,s=r.currentFrustum,a=s.x,c=s.y;if(e.frameState.useLogDepth){let g=n*r.log2FarDepthFromNearPlusOne,f=Math.pow(2,g)-1;n=c*(1-a/(f+a))/(c-a)}let d=e.view.passState.viewport,u=se.clone(se.UNIT_W,lUe);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=F.multiplyByVector(r.inverseViewProjection,u,ese);let g=1/m.w;h.multiplyByScalar(m,g,m)}else{let g=p.offCenterFrustum;l(g)&&(p=g),m=ese,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=F.multiplyByVector(r.inverseView,m,m)}return h.fromCartesian4(m,i)};var Yi=Ia;var Zyn=T(S(),1);var Mgn=T(S(),1);var IC={};IC._deprecationWarning=Es;var Qp=Uint32Array.BYTES_PER_ELEMENT;IC.parse=function(e,t){let n=y(t,0);t=n;let i=new Uint8Array(e),o=new DataView(e);t+=Qp;let r=o.getUint32(t,!0);if(r!==1)throw new ue(`Only Batched 3D Model version 1 is supported.  Version ${r} is not.`);t+=Qp;let s=o.getUint32(t,!0);t+=Qp;let a=o.getUint32(t,!0);t+=Qp;let c=o.getUint32(t,!0);t+=Qp;let d=o.getUint32(t,!0);t+=Qp;let u=o.getUint32(t,!0);t+=Qp;let m;d>=570425344?(t-=Qp*2,m=a,d=c,u=0,a=0,c=0,IC._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-=Qp,m=d,d=a,u=c,a=0,c=0,IC._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:y(m,0)}:(p=Io(i,t,a),t+=a);let g=new Uint8Array(e,t,c);t+=c;let f,x;d>0&&(f=Io(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 ue("glTF byte length must be greater than 0.");let C;return t%4===0?C=new Uint8Array(e,t,_):(IC._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:g,batchTableJson:f,batchTableBinary:x,gltf:C}};var iI=IC;var Bgn=T(S(),1);function oI(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function tse(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 dUe(e,t,n,i){let o=e._cachedTypedArrays,r=o[t];return l(r)||(r=Q.createTypedArray(n,i),o[t]=r),r}oI.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(t=y(t,Q.UNSIGNED_INT),n=y(n,1),tse(this,e,t,n,1,i.byteOffset)):i};oI.prototype.hasProperty=function(e){return l(this.json[e])};oI.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)),tse(this,e,t,n,this.featuresLength,i.byteOffset)):dUe(this,e,t,i)};oI.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 km=oI;var cyn=T(S(),1);function rI(e){let t=e.count,n=e.batchTable,i=e.binaryBody,o=y(e.parseAsPropertyAttributes,!1),r=e.customAttributeOutput,s=uUe(n),a;l(s.jsonProperties)&&(a=new Hp({count:t,properties:s.jsonProperties}));let c;l(s.hierarchy)&&(c=new Mx({extension:s.hierarchy,binaryBody:i}));let d=Pm.BATCH_TABLE_CLASS_NAME,u=s.binaryProperties,m,p,g;if(o){let _=hUe(t,d,u,i,r);g=_.transcodedSchema,p=[new a_({propertyAttribute:_.propertyAttributeJson,class:_.transcodedClass})]}else{let _=mUe(t,d,u,i);g=_.transcodedSchema;let C=_.featureTableJson;m=new Zl({count:C.count,properties:C.properties,class:_.transcodedClass,bufferViews:_.bufferViewsTypedArrays}),p=[]}let f=[];if(l(m)||l(a)||l(c)){let _=new Yc({id:0,name:"Batch Table",count:t,metadataTable:m,jsonMetadataTable:a,batchTableHierarchy:c});f.push(_)}let x={schema:g,propertyTables:f,propertyAttributes:p,extensions:s.extensions,extras:s.extras};return new Xa(x)}function uUe(e){let t=e.HIERARCHY,n=e.extras,i=e.extensions,o;l(t)?(rI._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 mUe(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 ue(`Property ${m} requires a batch table binary.`);let p=n[m],g=hd(p);r[m]={bufferView:a},o[m]=nse(p),s[a]=g.createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e),a++}let c={classes:{}};c.classes[t]={properties:o};let d=vm.fromJson(c);return{featureTableJson:{class:t,count:e,properties:r},bufferViewsTypedArrays:s,transcodedSchema:d,transcodedClass:d.classes[t]}}function hUe(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 ue(`Property ${m} requires a batch table binary.`);let g=jt.sanitizeGlslIdentifier(m);(g===""||r.hasOwnProperty(g))&&(g=`property_${a}`,a++);let f=nse(p);f.name=m,r[g]=f;let x=g.toUpperCase();x.startsWith("_")||(x=`_${x}`);let _=p.typedArray;l(_)||(_=hd(p).createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e));let C=new Tn.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)&&(rI._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[g]={attribute:x}}let c={classes:{}};c.classes[t]={properties:r};let d=vm.fromJson(c);return{class:t,propertyAttributeJson:{properties:s},transcodedSchema:d,transcodedClass:d.classes[t]}}function nse(e){let t=fUe(e.componentType);return{type:e.type,componentType:t}}function fUe(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"}}rI._deprecationWarning=Es;rI._oneTimeWarning=Nt;var jp=rI;var d_={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},pUe=Tn.FeatureIdAttribute;function cg(e){e=y(e,y.EMPTY_OBJECT);let t=e.b3dmResource,n=e.baseResource,i=e.arrayBuffer,o=y(e.byteOffset,0),r=y(e.releaseGltfJson,!1),s=y(e.asynchronous,!0),a=y(e.incrementallyLoadTextures,!0),c=y(e.upAxis,Xo.Y),d=y(e.forwardAxis,Xo.X),u=y(e.loadAttributesAsTypedArray,!1),m=y(e.loadAttributesFor2D,!1),p=y(e.enablePick,!1),g=y(e.loadIndicesForWireframe,!1),f=y(e.loadPrimitiveOutline,!0),x=y(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=g,this._loadPrimitiveOutline=f,this._loadForClassification=x,this._state=d_.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=F.IDENTITY}l(Object.create)&&(cg.prototype=Object.create(eo.prototype),cg.prototype.constructor=cg);Object.defineProperties(cg.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});cg.prototype.load=function(){if(l(this._promise))return this._promise;let e=iI.parse(this._arrayBuffer,this._byteOffset),t=e.batchLength,n=e.featureTableJson,i=e.featureTableBinary,o=e.batchTableJson,r=e.batchTableBinary,s=new km(n,i);t=s.getGlobalProperty("BATCH_LENGTH"),this._batchLength=t;let a=s.getGlobalProperty("RTC_CENTER",Q.FLOAT,3);l(a)&&(this._transform=F.fromTranslation(h.fromArray(a))),this._batchTable={json:o,binary:r};let c=new zp({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=d_.LOADING;let d=this;return this._promise=c.load().then(function(){if(!d.isDestroyed())return d._state=d_.PROCESSING,d}).catch(function(u){if(!d.isDestroyed())return bUe(d,u)}),this._promise};function bUe(e,t){return e.unload(),e._state=d_.FAILED,t=e.getError("Failed to load b3dm",t),Promise.reject(t)}cg.prototype.process=function(e){if(this._state===d_.READY)return!0;if(this._state!==d_.PROCESSING||!this._gltfLoader.process(e))return!1;let n=this._gltfLoader.components;return n.transform=F.multiplyTransformation(this._transform,n.transform,n.transform),gUe(this,n),this._components=n,this._arrayBuffer=void 0,this._state=d_.READY,!0};function gUe(e,t){let n=e._batchTable,i=e._batchLength;if(i===0)return;let o;if(l(n.json))o=jp({count:i,batchTable:n.json,binaryBody:n.binary});else{let a=new Yc({name:Pm.BATCH_TABLE_CLASS_NAME,count:i});o=new Xa({schema:{},propertyTables:[a]})}let r=t.scene.nodes,s=r.length;for(let a=0;a<s;a++)ise(r[a]);t.structuralMetadata=o}function ise(e){let t=e.children.length;for(let i=0;i<t;i++)ise(e.children[i]);let n=e.primitives.length;for(let i=0;i<n;i++){let o=e.primitives[i],r=jt.getAttributeBySemantic(o,St.FEATURE_ID);if(l(r)){r.setIndex=0;let s=new pUe;s.propertyTableId=0,s.setIndex=0,s.positionalLabel="featureId_0",o.featureIds.push(s)}}}cg.prototype.unload=function(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),this._components=void 0,this._arrayBuffer=void 0};var sI=cg;var Jyn=T(S(),1);function lg(e){e=y(e,y.EMPTY_OBJECT),this._geoJson=e.geoJson,this._components=void 0}l(Object.create)&&(lg.prototype=Object.create(eo.prototype),lg.prototype.constructor=lg);Object.defineProperties(lg.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}}});lg.prototype.load=function(){return Promise.resolve(this)};lg.prototype.process=function(e){return l(this._components)||(this._components=XUe(this._geoJson,e),this._geoJson=void 0),!0};function yUe(){this.lines=void 0,this.points=void 0,this.properties=void 0}function xUe(){this.features=[]}function BH(e){let t=e[0],n=e[1],i=y(e[2],0);return new h(t,n,i)}function YH(e){let t=e.length,n=new Array(t);for(let o=0;o<t;o++)n[o]=BH(e[o]);return[n]}function _Ue(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=YH(e[i])[0];return n}function ose(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=YH(e[i])[0];return n}function TUe(e){let t=e.length,n=[];for(let i=0;i<t;i++)Array.prototype.push.apply(n,ose(e[i]));return n}function SUe(e){return[BH(e)]}function CUe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=BH(e[i]);return n}var VUe={LineString:YH,MultiLineString:_Ue,MultiPolygon:TUe,Polygon:ose,MultiPoint:CUe,Point:SUe},LUe={LineString:Fe.LINES,MultiLineString:Fe.LINES,MultiPolygon:Fe.LINES,Polygon:Fe.LINES,MultiPoint:Fe.POINTS,Point:Fe.POINTS};function rse(e,t){if(!l(e.geometry))return;let n=e.geometry.type,i=VUe[n],o=LUe[n],r=e.geometry.coordinates;if(!l(i)||!l(r))return;let s=new yUe;o===Fe.LINES?s.lines=i(r):o===Fe.POINTS&&(s.points=i(r)),s.properties=e.properties,t.features.push(s)}function RUe(e,t){let n=e.features,i=n.length;for(let o=0;o<i;o++)rse(n[o],t)}var ZUe={FeatureCollection:RUe,Feature:rse},y5=new h;function GUe(e,t,n){let i=0,o=0,r=e.length;for(let A=0;A<r;A++){let M=e[A];if(l(M.lines)){let b=M.lines.length;for(let R=0;R<b;R++){let G=M.lines[R];i+=G.length,o+=(G.length-1)*2}}}let s=new Float32Array(i*3),a=new Float32Array(i),c=Ae.createTypedArray(i,o),d=Ae.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,g=0;for(let A=0;A<r;A++){let M=e[A];if(!l(M.lines))continue;let b=M.lines.length;for(let R=0;R<b;R++){let G=M.lines[R],I=G.length;for(let w=0;w<I;w++){let N=G[w],B=h.fromDegrees(N.x,N.y,N.z,ne.WGS84,y5),U=F.multiplyByPoint(t,B,y5);h.minimumByComponent(u,U,u),h.maximumByComponent(m,U,m),h.pack(U,s,p*3),a[p]=A,w<I-1&&(c[g*2]=p,c[g*2+1]=p+1,g++),p++}}}let f=yt.createVertexBuffer({typedArray:s,context:n.context,usage:Me.STATIC_DRAW});f.vertexArrayDestroyable=!1;let x=yt.createVertexBuffer({typedArray:a,context:n.context,usage:Me.STATIC_DRAW});x.vertexArrayDestroyable=!1;let _=yt.createIndexBuffer({typedArray:c,context:n.context,usage:Me.STATIC_DRAW,indexDatatype:d});_.vertexArrayDestroyable=!1;let C=new Tn.Attribute;C.semantic=St.POSITION,C.componentDatatype=Q.FLOAT,C.type=on.VEC3,C.count=i,C.min=u,C.max=m,C.buffer=f;let V=new Tn.Attribute;V.semantic=St.FEATURE_ID,V.setIndex=0,V.componentDatatype=Q.FLOAT,V.type=on.SCALAR,V.count=i,V.buffer=x;let L=[C,V],Z=new Tn.Material;Z.unlit=!0;let E=new Tn.Indices;E.indexDatatype=d,E.count=c.length,E.buffer=_;let X=new Tn.FeatureIdAttribute;X.featureCount=r,X.propertyTableId=0,X.setIndex=0,X.positionalLabel="featureId_0";let v=[X],P=new Tn.Primitive;return P.attributes=L,P.indices=E,P.featureIds=v,P.primitiveType=Fe.LINES,P.material=Z,P}function EUe(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 E=Z.points.length;for(let X=0;X<E;X++){let v=Z.points[X],P=h.fromDegrees(v.x,v.y,v.z,ne.WGS84,y5),A=F.multiplyByPoint(t,P,y5);h.minimumByComponent(a,A,a),h.maximumByComponent(c,A,c),h.pack(A,r,d*3),s[d]=L,d++}}let u=yt.createVertexBuffer({typedArray:r,context:n.context,usage:Me.STATIC_DRAW});u.vertexArrayDestroyable=!1;let m=yt.createVertexBuffer({typedArray:s,context:n.context,usage:Me.STATIC_DRAW});m.vertexArrayDestroyable=!1;let p=new Tn.Attribute;p.semantic=St.POSITION,p.componentDatatype=Q.FLOAT,p.type=on.VEC3,p.count=i,p.min=a,p.max=c,p.buffer=u;let g=new Tn.Attribute;g.semantic=St.FEATURE_ID,g.setIndex=0,g.componentDatatype=Q.FLOAT,g.type=on.SCALAR,g.count=i,g.buffer=m;let f=[p,g],x=new Tn.Material;x.unlit=!0;let _=new Tn.FeatureIdAttribute;_.featureCount=o,_.propertyTableId=0,_.setIndex=0,_.positionalLabel="featureId_0";let C=[_],V=new Tn.Primitive;return V.attributes=f,V.featureIds=C,V.primitiveType=Fe.POINTS,V.material=x,V}function XUe(e,t){let n=new xUe,i=ZUe[e.type];l(i)&&i(e,n);let o=n.features,r=o.length;if(r===0)throw new ue("GeoJSON must have at least one feature");let s={};for(let A=0;A<r;A++){let M=o[A],b=y(M.properties,y.EMPTY_OBJECT);for(let R in b)b.hasOwnProperty(R)&&(l(s[R])||(s[R]=new Array(r)))}for(let A=0;A<r;A++){let M=o[A];for(let b in s)if(s.hasOwnProperty(b)){let R=y(M.properties[b],"");s[b][A]=R}}let a=new Hp({count:r,properties:s}),d=[new Yc({id:0,count:r,jsonMetadataTable:a})],u=vm.fromJson({}),m=new Xa({schema:u,propertyTables:d}),p=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),g=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),f=!1,x=!1;for(let A=0;A<r;A++){let M=o[A];if(l(M.lines)){f=!0;let b=M.lines.length;for(let R=0;R<b;R++){let G=M.lines[R],I=G.length;for(let w=0;w<I;w++)h.minimumByComponent(p,G[w],p),h.maximumByComponent(g,G[w],g)}}if(l(M.points)){x=!0;let b=M.points.length;for(let R=0;R<b;R++){let G=M.points[R];h.minimumByComponent(p,G,p),h.maximumByComponent(g,G,g)}}}let _=h.midpoint(p,g,new h),C=h.fromDegrees(_.x,_.y,_.z,ne.WGS84,new h),V=wt.eastNorthUpToFixedFrame(C,ne.WGS84,new F),L=F.inverseTransformation(V,new F),Z=[];f&&Z.push(GUe(o,L,t)),x&&Z.push(EUe(o,L,t));let E=new Tn.Node;E.index=0,E.primitives=Z;let X=[E],v=new Tn.Scene;v.nodes=X;let P=new Tn.Components;return P.scene=v,P.nodes=X,P.transform=V,P.structuralMetadata=m,P}lg.prototype.unload=function(){this._components=void 0};var aI=lg;var Ixn=T(S(),1);var txn=T(S(),1);var x5={};x5._deprecationWarning=Es;var dg=Uint32Array.BYTES_PER_ELEMENT;x5.parse=function(e,t){let n=y(t,0);t=n;let i=new Uint8Array(e),o=new DataView(e);t+=dg;let r=o.getUint32(t,!0);if(r!==1)throw new ue(`Only Instanced 3D Model version 1 is supported. Version ${r} is not.`);t+=dg;let s=o.getUint32(t,!0);t+=dg;let a=o.getUint32(t,!0);if(a===0)throw new ue("featureTableJsonByteLength is zero, the feature table must be defined.");t+=dg;let c=o.getUint32(t,!0);t+=dg;let d=o.getUint32(t,!0);t+=dg;let u=o.getUint32(t,!0);t+=dg;let m=o.getUint32(t,!0);if(m!==1&&m!==0)throw new ue(`Only glTF format 0 (uri) or 1 (embedded) are supported. Format ${m} is not.`);t+=dg;let p=Io(i,t,a);t+=a;let g=new Uint8Array(e,t,c);t+=c;let f,x;d>0&&(f=Io(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 ue("glTF byte length must be greater than 0.");let C;return t%4===0?C=new Uint8Array(e,t,_):(x5._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:g,batchTableJson:f,batchTableBinary:x,gltf:C}};var cI=x5;var qp={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},_5=Tn.Attribute,IUe=Tn.FeatureIdAttribute,ase=Tn.Instances;function $p(e){e=y(e,y.EMPTY_OBJECT);let t=e.i3dmResource,n=e.arrayBuffer,i=e.baseResource,o=y(e.byteOffset,0),r=y(e.releaseGltfJson,!1),s=y(e.asynchronous,!0),a=y(e.incrementallyLoadTextures,!0),c=y(e.upAxis,Xo.Y),d=y(e.forwardAxis,Xo.X),u=y(e.loadAttributesAsTypedArray,!1),m=y(e.loadIndicesForWireframe,!1),p=y(e.loadPrimitiveOutline,!0),g=y(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=g,this._state=qp.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=F.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}l(Object.create)&&($p.prototype=Object.create(eo.prototype),$p.prototype.constructor=$p);Object.defineProperties($p.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});$p.prototype.load=function(){if(l(this._promise))return this._promise;let e=cI.parse(this._arrayBuffer,this._byteOffset),t=e.featureTableJson,n=e.featureTableBinary,i=e.batchTableJson,o=e.batchTableBinary,r=e.gltfFormat,s=new km(t,n);this._featureTable=s;let a=s.getGlobalProperty("INSTANCES_LENGTH");if(s.featuresLength=a,!l(a))throw new ue("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=F.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=Vl(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 zp(d);return this._gltfLoader=u,this._state=qp.LOADING,this._promise=u.load().then(()=>{if(!this.isDestroyed())return this._state=qp.PROCESSING,this}).catch(m=>{if(!this.isDestroyed())throw WUe(this,m)}),this._promise};function WUe(e,t){return e.unload(),e._state=qp.FAILED,e.getError("Failed to load i3dm",t)}$p.prototype.process=function(e){if(this._state===qp.READY)return!0;let t=this._gltfLoader,n=!1;if(this._state===qp.PROCESSING&&(n=t.process(e)),!n)return!1;let i=t.components;return i.transform=F.multiplyTransformation(this._transform,i.transform,i.transform),wUe(this,i,e),PUe(this,i),this._components=i,this._arrayBuffer=void 0,this._state=qp.READY,!0};function PUe(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let o;if(l(n.json))o=jp({count:i,batchTable:n.json,binaryBody:n.binary});else{let r=new Yc({name:Pm.BATCH_TABLE_CLASS_NAME,count:i});o=new Xa({schema:{},propertyTables:[r]})}t.structuralMetadata=o}var T5=new h,OH=new Array(4),vUe=new F;function wUe(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=AUe(o,r),m;c&&(m=new Float32Array(4*r));let p;d&&(p=new Float32Array(3*r));let g=new Float32Array(r),f=h.unpackArray(u),x=new h,_=new h,C=new h,V=new h,L=new $,Z=new we,E=new Array(4),X=new h,v=new Array(3),P=new F;if(!l(s)||h.equals(h.unpack(s),h.ZERO)){let U=ce.fromPoints(f);for(i=0;i<f.length;i++)h.subtract(f[i],U.center,T5),u[3*i+0]=T5.x,u[3*i+1]=T5.y,u[3*i+2]=T5.z;let O=F.fromTranslation(U.center,vUe);t.transform=F.multiplyTransformation(O,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&&(MUe(o,a,i,Z,x,C,_,V,L,P),we.pack(Z,E,0),m[4*i+0]=E[0],m[4*i+1]=E[1],m[4*i+2]=E[2],m[4*i+3]=E[3]),d&&(NUe(o,i,X),h.pack(X,v,0),p[3*i+0]=v[0],p[3*i+1]=v[1],p[3*i+2]=v[2]);let U=o.getProperty("BATCH_ID",Q.UNSIGNED_SHORT,1,i);l(U)||(U=i),g[i]=U}let A=new ase;A.transformInWorldSpace=!0;let M=e._buffers,b=new _5;if(b.name="Instance Translation",b.semantic=Kr.TRANSLATION,b.componentDatatype=Q.FLOAT,b.type=on.VEC3,b.count=r,b.typedArray=u,!c){let U=yt.createVertexBuffer({context:n.context,typedArray:u,usage:Me.STATIC_DRAW});U.vertexArrayDestroyable=!1,M.push(U),b.buffer=U}if(A.attributes.push(b),c){let U=new _5;U.name="Instance Rotation",U.semantic=Kr.ROTATION,U.componentDatatype=Q.FLOAT,U.type=on.VEC4,U.count=r,U.typedArray=m,A.attributes.push(U)}if(d){let U=new _5;if(U.name="Instance Scale",U.semantic=Kr.SCALE,U.componentDatatype=Q.FLOAT,U.type=on.VEC3,U.count=r,c)U.typedArray=p;else{let O=yt.createVertexBuffer({context:n.context,typedArray:p,usage:Me.STATIC_DRAW});O.vertexArrayDestroyable=!1,M.push(O),U.buffer=O}A.attributes.push(U)}let R=new _5;R.name="Instance Feature ID",R.setIndex=0,R.semantic=Kr.FEATURE_ID,R.componentDatatype=Q.FLOAT,R.type=on.SCALAR,R.count=r;let G=yt.createVertexBuffer({context:n.context,typedArray:g,usage:Me.STATIC_DRAW});G.vertexArrayDestroyable=!1,M.push(G),R.buffer=G,A.attributes.push(R);let I=new IUe;I.propertyTableId=0,I.setIndex=0,I.positionalLabel="instanceFeatureId_0",A.featureIds.push(I);let w=t.nodes,N=w.length,B=!1;for(i=0;i<N;i++){let U=w[i];U.primitives.length>0&&(U.instances=B?FUe(A):A,B=!0)}}function FUe(e){let t=new ase;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=Ye(n[o],!1);t.attributes.push(r)}return t.featureIds=e.featureIds,t}function AUe(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 ue("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 ue("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 ue("Either POSITION or POSITION_QUANTIZED must be defined for each instance.")}var sse=new Array(4);function MUe(e,t,n,i,o,r,s,a,c,d){let u=e.getProperty("NORMAL_UP",Q.FLOAT,3,n,OH),m=e.getProperty("NORMAL_RIGHT",Q.FLOAT,3,n,sse),p=!1;if(l(u)){if(!l(m))throw new ue("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 g=e.getProperty("NORMAL_UP_OCT32P",Q.UNSIGNED_SHORT,2,n,OH),f=e.getProperty("NORMAL_RIGHT_OCT32P",Q.UNSIGNED_SHORT,2,n,sse);if(l(g)){if(!l(f))throw new ue("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");wn.octDecodeInRange(g[0],g[1],65535,r),wn.octDecodeInRange(f[0],f[1],65535,s),p=!0}else t?(wt.eastNorthUpToFixedFrame(o,ne.WGS84,d),F.getMatrix3(d,c)):$.clone($.IDENTITY,c)}p&&(h.cross(s,r,a),h.normalize(a,a),$.setColumn(c,0,s,c),$.setColumn(c,1,r,c),$.setColumn(c,2,a,c)),we.fromRotationMatrix(c,i)}function NUe(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,OH);l(o)&&(n.x*=o[0],n.y*=o[1],n.z*=o[2])}function kUe(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}$p.prototype.isUnloaded=function(){return this._state===qp.UNLOADED};$p.prototype.unload=function(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),kUe(this),this._components=void 0,this._arrayBuffer=void 0,this._state=qp.UNLOADED};var lI=$p;var j_n=T(S(),1);var U_n=T(S(),1);var Pxn=T(S(),1),UUe={STOPPED:0,ANIMATING:1},Um=Object.freeze(UUe);var W_n=T(S(),1);var Bxn=T(S(),1);var kxn=T(S(),1);function WC(){this.times=void 0,this.points=void 0,pe.throwInstantiationError()}WC.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof h)return h;if(e instanceof we)return we};WC.prototype.evaluate=pe.throwInstantiationError;WC.prototype.findTimeInterval=function(e,t){let n=this.times,i=n.length;if(t=y(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};WC.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};WC.prototype.clampTime=function(e){let t=this.times;return W.clamp(e,t[0],t[t.length-1])};var to=WC;function PC(e){this._value=e,this._valueType=to.getPointType(e)}Object.defineProperties(PC.prototype,{value:{get:function(){return this._value}}});PC.prototype.findTimeInterval=function(e){};PC.prototype.wrapTime=function(e){return 0};PC.prototype.clampTime=function(e){return 0};PC.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var dI=PC;var c_n=T(S(),1);var Jxn=T(S(),1);function vC(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=to.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(vC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});vC.prototype.findTimeInterval=to.prototype.findTimeInterval;vC.prototype.wrapTime=to.prototype.wrapTime;vC.prototype.clampTime=to.prototype.clampTime;vC.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 ug=vC;var qxn=T(S(),1);var cse={};cse.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 wC=cse;var lse=[],dse=[],use=[],mse=[];function DUe(e,t,n){let i=lse,o=use,r=dse,s=mse;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),wC.solve(i,r,o,s)}function BUe(e){let t=lse,n=use,i=dse,o=mse;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),wC.solve(t,i,n,o)}function Wl(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times,i=e.inTangents,o=e.outTangents;this._times=n,this._points=t,this._pointType=to.getPointType(t[0]),this._inTangents=i,this._outTangents=o,this._lastTimeIndex=0}Object.defineProperties(Wl.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}}});Wl.createC1=function(e){e=y(e,y.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 Wl({times:t,points:n,inTangents:r,outTangents:o})};Wl.createNaturalCubic=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.times,n=e.points;if(n.length<3)return new ug({points:n,times:t});let i=BUe(n),o=i.slice(0,i.length-1),r=i.slice(1,i.length);return new Wl({times:t,points:n,inTangents:r,outTangents:o})};Wl.createClampedCubic=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.times,n=e.points,i=e.firstTangent,o=e.lastTangent,r=to.getPointType(n[0]);if(n.length<3)return new ug({points:n,times:t});let s=DUe(n,i,o),a=s.slice(0,s.length-1),c=s.slice(1,s.length);return new Wl({times:t,points:n,inTangents:c,outTangents:a})};Wl.hermiteCoefficientMatrix=new F(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);Wl.prototype.findTimeInterval=to.prototype.findTimeInterval;var YUe=new se,FC=new h;Wl.prototype.wrapTime=to.prototype.wrapTime;Wl.prototype.clampTime=to.prototype.clampTime;Wl.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=YUe;d.z=c,d.y=c*c,d.x=d.y*c,d.w=1;let u=F.multiplyByVector(Wl.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,FC),m.add(t,FC,t),m.multiplyByScalar(r[s],u.z,FC),m.add(t,FC,t),m.multiplyByScalar(o[s],u.w,FC),m.add(t,FC,t))};var mg=Wl;var h_n=T(S(),1);function AC(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=to.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(AC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});AC.prototype.findTimeInterval=to.prototype.findTimeInterval;AC.prototype.wrapTime=to.prototype.wrapTime;AC.prototype.clampTime=to.prototype.clampTime;AC.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=AC;var x_n=T(S(),1);function OUe(e){let t=e.points,n=e.times;return function(i,o){l(o)||(o=new we);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 we.fastSlerp(a,c,s,o)}}function MC(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._evaluateFunction=OUe(this),this._lastTimeIndex=0}Object.defineProperties(MC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});MC.prototype.findTimeInterval=to.prototype.findTimeInterval;MC.prototype.wrapTime=to.prototype.wrapTime;MC.prototype.clampTime=to.prototype.clampTime;MC.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var mI=MC;var NC=Tn.AnimatedPropertyType;function HH(e){e=y(e,y.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,QUe(this)}Object.defineProperties(HH.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 HUe(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 mg({times:e,points:n,inTangents:i,outTangents:o})}function hse(e,t,n,i){if(e.length===1&&t.length===1)return new dI(t[0]);switch(n){case Mm.STEP:return new uI({times:e,points:t});case Mm.CUBICSPLINE:return HUe(e,t);case Mm.LINEAR:return i===NC.ROTATION?new mI({times:e,points:t}):new ug({times:e,points:t})}}function zUe(e,t,n,i,o){let r=[];if(i===NC.WEIGHTS){let a=t.length/o,c,d;for(c=0;c<o;c++){let u=new Array(a),m=c;if(n===Mm.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(hse(e,u,n,i))}}else r.push(hse(e,t,n,i));return r}var KUe=new h,JUe=new we;function QUe(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=zUe(i,o,r,a,d);e._splines=u,e._path=a}HH.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,o=this._runtimeNode;if(n===NC.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===NC.TRANSLATION||n===NC.SCALE?o[n]=r.evaluate(s,KUe):n===NC.ROTATION&&(o[n]=r.evaluate(s,JUe))}}};var hI=HH;function zH(e,t,n){this._animation=t,this._name=t.name,this._runtimeChannels=void 0,this._startTime=q.clone(n.startTime),this._delay=y(n.delay,0),this._stopTime=q.clone(n.stopTime),this.removeOnStop=y(n.removeOnStop,!1),this._multiplier=y(n.multiplier,1),this._reverse=y(n.reverse,!1),this._loop=y(n.loop,Il.NONE),this._animationTime=n.animationTime,this._prevAnimationDelta=void 0,this.start=new be,this.update=new be,this.stop=new be,this._state=Um.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,jUe(this)}Object.defineProperties(zH.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 jUe(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],g=new hI({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(g)}e._runtimeChannels=a,e._localStartTime=t,e._localStopTime=n}zH.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var fI=zH;function e0(e){this.animationAdded=new be,this.animationRemoved=new be,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(e0.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function KH(e,t,n){let i=e._model,o=new fI(i,t,n);return e._runtimeAnimations.push(o),e.animationAdded.raiseEvent(i,o),o}e0.prototype.add=function(e){e=y(e,y.EMPTY_OBJECT);let n=this._model.sceneGraph.components.animations,i=e.index;if(l(i))return KH(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 KH(this,n[i],e)};e0.prototype.addAll=function(e){e=y(e,y.EMPTY_OBJECT);let n=this._model.sceneGraph.components.animations,i=[],o=n.length;for(let r=0;r<o;++r){let s=KH(this,n[r],e);i.push(s)}return i};e0.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};e0.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])};e0.prototype.contains=function(e){return l(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};e0.prototype.get=function(e){return this._runtimeAnimations[e]};var S5=[];function qUe(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}e0.prototype.update=function(e){let t=this._runtimeAnimations,n=t.length;if(n===0)return this._previousTime=void 0,!1;if(!this.animateWhilePaused&&q.equals(e.time,this._previousTime))return!1;this._previousTime=q.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=q.addSeconds(y(a.startTime,o),a.delay,new q)),l(a._duration)||(a._duration=a.localStopTime*(1/a.multiplier));let c=a._computedStartTime,d=a._duration,u=a.stopTime,m=q.lessThanOrEquals(c,o),p=l(u)&&q.greaterThan(o,u),g=0;if(d!==0){let _=q.secondsDifference(p?u:o,c);g=l(a._animationTime)?a._animationTime(d,_):_/d}let f=a.loop===Il.REPEAT||a.loop===Il.MIRRORED_REPEAT,x=(m||f&&!l(a.startTime))&&(g<=1||f)&&!p;if(g===a._prevAnimationDelta){let _=a._state===Um.STOPPED;if(x!==_)continue}if(a._prevAnimationDelta=g,x||a._state===Um.ANIMATING){if(x&&a._state===Um.STOPPED&&(a._state=Um.ANIMATING,a.start.numberOfListeners>0&&e.afterRender.push(a._raiseStartEvent)),a.loop===Il.REPEAT)g=g-Math.floor(g);else if(a.loop===Il.MIRRORED_REPEAT){let C=Math.floor(g),V=g-C;g=C%2===1?1-V:V}a.reverse&&(g=1-g);let _=g*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=Um.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&S5.push(a))}}n=S5.length;for(let s=0;s<n;++s){let a=S5[s];t.splice(t.indexOf(a),1),e.afterRender.push(qUe(this,r,a))}return S5.length=0,i};var pI=e0;var bTn=T(S(),1);var tTn=T(S(),1);function u_(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties(u_.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 Y),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}}});u_.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)};u_.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)};u_.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)};u_.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)};u_.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};var bI=u_;var iTn=T(S(),1),gI={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};gI.getStyleCommandsNeeded=function(e,t){return t===0?gI.ALL_OPAQUE:t===e?gI.ALL_TRANSLUCENT:gI.OPAQUE_AND_TRANSLUCENT};var Dm=Object.freeze(gI);var rTn=T(S(),1);var hg={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};hg.is3DTiles=function(e){switch(e){case hg.TILE_GLTF:case hg.TILE_B3DM:case hg.TILE_I3DM:case hg.TILE_PNTS:case hg.TILE_GEOJSON:return!0;case hg.GLTF:return!1}};var rr=Object.freeze(hg);function Wr(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=Dm.ALL_OPAQUE,$Ue(this)}Object.defineProperties(Wr.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 $Ue(e){let t=e._model,n=rr.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 bI({model:t,featureId:o,featureTable:e});e._features=r,e._featuresLength=i,e._batchTexture=new Dc({featuresLength:i,owner:e,statistics:n?t.content.tileset.statistics:void 0})}Wr.prototype.update=function(e){this._styleCommandsNeededDirty=!1,this._batchTexture.update(void 0,e);let t=Dm.getStyleCommandsNeeded(this._featuresLength,this._batchTexture.translucentFeaturesLength);this._styleCommandsNeeded!==t&&(this._styleCommandsNeededDirty=!0,this._styleCommandsNeeded=t)};Wr.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};Wr.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};Wr.prototype.getShow=function(e){return this._batchTexture.getShow(e)};Wr.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};Wr.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};Wr.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};Wr.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};Wr.prototype.getFeature=function(e){return this._features[e]};Wr.prototype.hasProperty=function(e,t){return this._propertyTable.hasProperty(e,t)};Wr.prototype.hasPropertyBySemantic=function(e,t){return this._propertyTable.hasPropertyBySemantic(e,t)};Wr.prototype.getProperty=function(e,t){return this._propertyTable.getProperty(e,t)};Wr.prototype.getPropertyBySemantic=function(e,t){return this._propertyTable.getPropertyBySemantic(e,t)};Wr.prototype.getPropertyIds=function(e){return this._propertyTable.getPropertyIds(e)};Wr.prototype.setProperty=function(e,t,n){return this._propertyTable.setProperty(e,t,n)};Wr.prototype.isClass=function(e,t){return this._propertyTable.isClass(e,t)};Wr.prototype.isExactClass=function(e,t){return this._propertyTable.isExactClass(e,t)};Wr.prototype.getExactClassName=function(e){return this._propertyTable.getExactClassName(e)};var eDe=new Y;Wr.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(Dc.DEFAULT_COLOR_VALUE),this.setAllShow(Dc.DEFAULT_SHOW_VALUE);return}for(let t=0;t<this._featuresLength;t++){let n=this.getFeature(t),i=l(e.color)?y(e.color.evaluateColor(n,eDe),Dc.DEFAULT_COLOR_VALUE):Dc.DEFAULT_COLOR_VALUE,o=l(e.show)?y(e.show.evaluate(n),Dc.DEFAULT_SHOW_VALUE):Dc.DEFAULT_SHOW_VALUE;this.setColor(t,i),this.setShow(t,o)}};Wr.prototype.isDestroyed=function(){return!1};Wr.prototype.destroy=function(e){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),me(this)};var yI=Wr;var sXn=T(S(),1);var gSn=T(S(),1);var yTn=T(S(),1),xI=`
precision highp float;
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

    #ifdef ENABLE_CLIPPING_POLYGONS
    modelClippingPolygonsStage();
    #endif

    #if defined(HAS_SILHOUETTE) && defined(HAS_NORMALS)
    silhouetteStage(color);
    #endif

    #ifdef HAS_ATMOSPHERE
    atmosphereStage(color, attributes);
    #endif

    out_FragColor = color;
}
`;var _Tn=T(S(),1),_I=`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 ENABLE_CLIPPING_POLYGONS
    modelClippingPolygonsStage(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 vTn=T(S(),1);function QH(e){e=y(e,y.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!==kn.CESIUM_3D_TILE,this._classifies3DTiles=o!==kn.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],oDe(this)}function tDe(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:bt.KEEP,zFail:bt.DECREMENT_WRAP,zPass:bt.KEEP},backFunction:e,backOperation:{fail:bt.KEEP,zFail:bt.INCREMENT_WRAP,zPass:bt.KEEP},reference:Bt.CESIUM_3D_TILE_MASK,mask:Bt.CESIUM_3D_TILE_MASK},stencilMask:Bt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:tc.LESS_OR_EQUAL},depthMask:!1}}var nDe={stencilTest:{enabled:!0,frontFunction:Un.NOT_EQUAL,frontOperation:{fail:bt.ZERO,zFail:bt.ZERO,zPass:bt.ZERO},backFunction:Un.NOT_EQUAL,backOperation:{fail:bt.ZERO,zFail:bt.ZERO,zPass:bt.ZERO},reference:0,mask:Bt.CLASSIFICATION_MASK},stencilMask:Bt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND},iDe={stencilTest:{enabled:!0,frontFunction:Un.NOT_EQUAL,frontOperation:{fail:bt.ZERO,zFail:bt.ZERO,zPass:bt.ZERO},backFunction:Un.NOT_EQUAL,backOperation:{fail:bt.ZERO,zFail:bt.ZERO,zPass:bt.ZERO},reference:0,mask:Bt.CLASSIFICATION_MASK},stencilMask:Bt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},bse=[];function oDe(e){let t=e._command,n=bse;if(e._useDebugWireframe){t.pass=Re.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=TI(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=Re.TERRAIN_CLASSIFICATION,s=JH(t,r),a=fse(t,r);n.length=0,n.push(s,a),e._commandListTerrain=TI(e,n,e._commandListTerrain),o&&(e._commandListTerrainPicking=pse(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let r=Re.CESIUM_3D_TILE_CLASSIFICATION,s=JH(t,r),a=fse(t,r);n.length=0,n.push(s,a),e._commandList3DTiles=TI(e,n,e._commandList3DTiles),o&&(e._commandList3DTilesPicking=pse(e,n,e._commandList3DTilesPicking))}}function TI(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],g=tt.shallowClone(p);g.count=d,g.offset=u,n.push(g)}}return n}function JH(e,t){let n=tt.shallowClone(e);n.cull=!1,n.pass=t;let i=t===Re.TERRAIN_CLASSIFICATION?Un.ALWAYS:Un.EQUAL,o=tDe(i);return n.renderState=Ue.fromCache(o),n}function fse(e,t){let n=tt.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=Ue.fromCache(nDe),n}var rDe=[];function pse(e,t,n){let i=Ue.fromCache(iDe),o=t[0],r=t[1],s=tt.shallowClone(o);s.cull=!0,s.pickOnly=!0;let a=tt.shallowClone(r);a.cull=!0,a.pickOnly=!0,a.renderState=i,a.pickId=e._pickId;let c=rDe;return c.length=0,c.push(s,a),TI(e,c,n)}Object.defineProperties(QH.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=F.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}}});QH.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=Re.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,r=JH(this._command,o),s=bse;s.length=0,s.push(r),this._commandListIgnoreShow=TI(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 SI=QH;var tSn=T(S(),1);function C5(e){e=y(e,y.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===Re.TRANSLUCENT,a=!o.primitive.material.doubleSided&&!r,c=n.hasSilhouette,d=!r&&!c,u=n.hasSkipLevelOfDetail&&!r,m=c;this._command=t,this._modelMatrix=F.clone(t.modelMatrix),this._boundingVolume=ce.clone(t.boundingVolume),this._modelMatrix2D=new F,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,sDe(this)}function t0(e){this.command=e.command,this.updateShadows=e.updateShadows,this.updateBackFaceCulling=e.updateBackFaceCulling,this.updateCullFace=e.updateCullFace,this.updateDebugShowBoundingVolume=e.updateDebugShowBoundingVolume,this.is2D=y(e.is2D,!1),this.derivedCommand2D=void 0}t0.clone=function(e){return new t0({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function sDe(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 t0({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),o.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new t0({command:hDe(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),o.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new t0({command:xDe(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new t0({command:_De(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),o.push(e._skipLodBackfaceCommand),o.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new t0({command:fDe(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new t0({command:pDe(t,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._silhouetteModelCommand),o.push(e._silhouetteColorCommand))}Object.defineProperties(C5.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=F.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,cDe(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,lDe(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,dDe(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,uDe(this))}}});function aDe(e,t){let n=e._modelMatrix;e._modelMatrix2D=F.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 cDe(e){let t=e.shadows,n=_n.castShadows(t),i=_n.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 lDe(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=Ye(r.renderState,!0);s.cull.enabled=t,r.renderState=Ue.fromCache(s)}}}function dDe(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=Ye(r.renderState,!0);s.cull.face=t,r.renderState=Ue.fromCache(s)}}}function uDe(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}}}C5.prototype.pushCommands=function(e,t){let n=gse(this,e);n&&!this._has2DCommands&&(mDe(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(aDe(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&l(i)&&(i!==Dm.ALL_OPAQUE&&UC(t,this._translucentCommand,n),i===Dm.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:o,tile:r}=this._model.content;if(o.hasMixedContent){r._finalResolution||UC(o._backfaceCommands,this._skipLodBackfaceCommand,n),bDe(this,r,n),UC(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){UC(t,this._silhouetteModelCommand,n);return}return UC(t,this._originalCommand,n),t}};C5.prototype.pushSilhouetteCommands=function(e,t){let n=gse(this,e);return UC(t,this._silhouetteColorCommand,n),t};function UC(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function gse(e,t){if(t.mode!==oe.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 kC(e,t){if(!l(t))return;let n=t0.clone(t),i=tt.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 mDe(e){kC(e,e._originalCommand),kC(e,e._translucentCommand),kC(e,e._skipLodBackfaceCommand),kC(e,e._skipLodStencilCommand),kC(e,e._silhouetteModelCommand),kC(e,e._silhouetteColorCommand)}function hDe(e){let t=tt.shallowClone(e);t.pass=Re.TRANSLUCENT;let n=Ye(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=un.ALPHA_BLEND,t.renderState=Ue.fromCache(n),t}function fDe(e,t){let n=t._silhouetteId%255,i=tt.shallowClone(e),o=Ye(e.renderState,!0);return o.stencilTest={enabled:!0,frontFunction:ie.ALWAYS,backFunction:ie.ALWAYS,reference:n,mask:-1,frontOperation:{fail:ie.KEEP,zFail:ie.KEEP,zPass:ie.REPLACE},backOperation:{fail:ie.KEEP,zFail:ie.KEEP,zPass:ie.REPLACE}},t.isInvisible()&&(o.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=Ue.fromCache(o),i}function pDe(e,t){let n=t._silhouetteId%255,i=tt.shallowClone(e),o=Ye(e.renderState,!0);o.cull.enabled=!1,(e.pass===Re.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=Re.TRANSLUCENT,o.depthMask=!1,o.blending=un.ALPHA_BLEND),o.stencilTest={enabled:!0,frontFunction:ie.NOTEQUAL,backFunction:ie.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:ie.KEEP,zFail:ie.KEEP,zPass:ie.KEEP},backOperation:{fail:ie.KEEP,zFail:ie.KEEP,zPass:ie.KEEP}};let s=Ye(e.uniformMap);return s.model_silhouettePass=function(){return!0},i.renderState=Ue.fromCache(o),i.uniformMap=s,i.castShadows=!1,i.receiveShadows=!1,i}function bDe(e,t,n){let i=e._skipLodStencilCommand,o=i.command,r=t._selectionDepth,s=gDe(o);if(r!==s){let a=yDe(r),c=Ye(o.renderState,!0);c.stencilTest.reference=a,o.renderState=Ue.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function gDe(e){return(e.renderState.stencilTest.reference&Bt.SKIP_LOD_MASK)>>>Bt.SKIP_LOD_BIT_SHIFT}function yDe(e){return Bt.CESIUM_3D_TILE_MASK|e<<Bt.SKIP_LOD_BIT_SHIFT}function xDe(e){let t=tt.shallowClone(e),n=Ye(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=Ye(t.uniformMap),o=new D(5,5);return i.u_polygonOffset=function(){return o},t.renderState=Ue.fromCache(n),t.uniformMap=i,t.castShadows=!1,t.receiveShadows=!1,t}function _De(e){let t=tt.shallowClone(e),n=Ye(e.renderState,!0),{stencilTest:i}=n;return i.enabled=!0,i.mask=Bt.SKIP_LOD_MASK,i.reference=Bt.CESIUM_3D_TILE_MASK,i.frontFunction=Un.GREATER_OR_EQUAL,i.frontOperation.zPass=bt.REPLACE,i.backFunction=Un.GREATER_OR_EQUAL,i.backOperation.zPass=bt.REPLACE,n.stencilMask=Bt.CESIUM_3D_TILE_MASK|Bt.SKIP_LOD_MASK,t.renderState=Ue.fromCache(n),t}var CI=C5;function TDe(e,t){let n=e.shaderBuilder;n.addVertexLines(_I),n.addFragmentLines(xI);let i=SDe(e),o=new mi({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===oe.SCENE3D,u,m;if(!d&&!t.scene3DOnly&&r._projectTo2D)u=F.multiplyTransformation(c._computedModelMatrix,e.runtimeNode.computedTransform,new F),m=e.runtimePrimitive.boundingSphere2D;else{let V=d?c._computedModelMatrix:c._computedModelMatrix2D;u=F.multiplyTransformation(V,e.runtimeNode.computedTransform,new F),m=ce.transform(e.boundingSphere,u,e.boundingSphere)}let p=Ye(Ue.fromCache(e.renderStateOptions),!0);p.cull.face=jt.getCullFace(u,e.primitiveType),p=Ue.fromCache(p);let g=l(r.classificationType),f=g?!1:_n.castShadows(r.shadows),x=g?!1:_n.receiveShadows(r.shadows),_=g?void 0:e.pickId,C=new tt({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 g?new SI({primitiveRenderResources:e,command:C}):new CI({primitiveRenderResources:e,command:C})}function SDe(e){let t=e.wireframeIndexBuffer;if(l(t))return t;let n=e.indices;if(l(n))return n.buffer}var VI=TDe;var CSn=T(S(),1);var yse={name:"TilesetPipelineStage"};yse.process=function(e,t,n){if(t.hasSkipLevelOfDetail(n)){e.shaderBuilder.addDefine("POLYGON_OFFSET",void 0,ye.FRAGMENT);let r={u_polygonOffset:function(){return D.ZERO}};e.uniformMap=_t(r,e.uniformMap),e.hasSkipLevelOfDetail=!0}let i=e.renderStateOptions;i.stencilTest=Bt.setCesium3DTileBit(),i.stencilMask=Bt.CESIUM_3D_TILE_MASK};var LI=yse;var vSn=T(S(),1);var LSn=T(S(),1),RI=`// 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_pbrNeutralTonemapping(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 ZSn=T(S(),1),ZI=`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 xse={name:"AtmospherePipelineStage"};xse.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_ATMOSPHERE",void 0,ye.BOTH),i.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,ye.BOTH),i.addVarying("vec3","v_atmosphereRayleighColor"),i.addVarying("vec3","v_atmosphereMieColor"),i.addVarying("float","v_atmosphereOpacity"),i.addVertexLines([ZI]),i.addFragmentLines([RI]),i.addUniform("bool","u_isInFog",ye.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 GI=xse;var BSn=T(S(),1);var FSn=T(S(),1),EI=`/**
 * Compute some metrics for a procedural sky lighting model
 *
 * @param {vec3} positionWC The position of the fragment in world coordinates.
 * @param {vec3} reflectionWC A unit vector in the direction of the reflection, in world coordinates.
 * @return {vec3} The dot products of the horizon and reflection directions with the nadir, and an atmosphere boundary distance.
 */
vec3 getProceduralSkyMetrics(vec3 positionWC, vec3 reflectionWC)
{
    // Figure out if the reflection vector hits the ellipsoid
    float horizonDotNadir = 1.0 - min(1.0, czm_ellipsoidRadii.x / length(positionWC));
    float reflectionDotNadir = dot(reflectionWC, normalize(positionWC));
    float atmosphereHeight = 0.05;
    float smoothstepHeight = smoothstep(0.0, atmosphereHeight, horizonDotNadir);
    return vec3(horizonDotNadir, reflectionDotNadir, smoothstepHeight);
}

/**
 * Compute the diffuse irradiance for a procedural sky lighting model.
 *
 * @param {vec3} skyMetrics The dot products of the horizon and reflection directions with the nadir, and an atmosphere boundary distance.
 * @return {vec3} The computed diffuse irradiance.
 */
vec3 getProceduralDiffuseIrradiance(vec3 skyMetrics)
{
    vec3 blueSkyDiffuseColor = vec3(0.7, 0.85, 0.9); 
    float diffuseIrradianceFromEarth = (1.0 - skyMetrics.x) * (skyMetrics.y * 0.25 + 0.75) * skyMetrics.z;  
    float diffuseIrradianceFromSky = (1.0 - skyMetrics.z) * (1.0 - (skyMetrics.y * 0.25 + 0.25));
    return blueSkyDiffuseColor * clamp(diffuseIrradianceFromEarth + diffuseIrradianceFromSky, 0.0, 1.0);
}

/**
 * Compute the specular irradiance for a procedural sky lighting model.
 *
 * @param {vec3} reflectionWC The reflection vector in world coordinates.
 * @param {vec3} skyMetrics The dot products of the horizon and reflection directions with the nadir, and an atmosphere boundary distance.
 * @param {float} roughness The roughness of the material.
 * @return {vec3} The computed specular irradiance.
 */
vec3 getProceduralSpecularIrradiance(vec3 reflectionWC, vec3 skyMetrics, float roughness)
{
    // Flipping the X vector is a cheap way to get the inverse of czm_temeToPseudoFixed, since that's a rotation about Z.
    reflectionWC.x = -reflectionWC.x;
    reflectionWC = -normalize(czm_temeToPseudoFixed * reflectionWC);
    reflectionWC.x = -reflectionWC.x;

    float inverseRoughness = 1.0 - roughness;
    inverseRoughness *= inverseRoughness;
    vec3 sceneSkyBox = czm_textureCube(czm_environmentMap, reflectionWC).rgb * inverseRoughness;

    // Compute colors at different angles relative to the horizon
    vec3 belowHorizonColor = mix(vec3(0.1, 0.15, 0.25), vec3(0.4, 0.7, 0.9), skyMetrics.z);
    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, skyMetrics.y * inverseRoughness * 0.5 + 0.75);
    vec3 zenithColor = mix(blueSkyColor, sceneSkyBox, skyMetrics.z);

    // Compute blend zones
    float blendRegionSize = 0.1 * ((1.0 - inverseRoughness) * 8.0 + 1.1 - skyMetrics.x);
    float blendRegionOffset = roughness * -1.0;
    float farAboveHorizon = clamp(skyMetrics.x - blendRegionSize * 0.5 + blendRegionOffset, 1.0e-10 - blendRegionSize, 0.99999);
    float aroundHorizon = clamp(skyMetrics.x + blendRegionSize * 0.5, 1.0e-10 - blendRegionSize, 0.99999);
    float farBelowHorizon = clamp(skyMetrics.x + blendRegionSize * 1.5, 1.0e-10 - blendRegionSize, 0.99999);

    // Blend colors
    float notDistantRough = (1.0 - skyMetrics.x * roughness * 0.8);
    vec3 specularIrradiance = mix(zenithColor, aboveHorizonColor, smoothstep(farAboveHorizon, aroundHorizon, skyMetrics.y) * notDistantRough);
    specularIrradiance = mix(specularIrradiance, belowHorizonColor, smoothstep(aroundHorizon, farBelowHorizon, skyMetrics.y) * inverseRoughness);
    specularIrradiance = mix(specularIrradiance, nadirColor, smoothstep(farBelowHorizon, 1.0, skyMetrics.y) * inverseRoughness);

    return specularIrradiance;
}

#ifdef USE_SUN_LUMINANCE
float clampedDot(vec3 x, vec3 y)
{
    return clamp(dot(x, y), 0.001, 1.0);
}
/**
 * Sun luminance following the "CIE Clear Sky Model"
 * See page 40 of https://3dvar.com/Green2003Spherical.pdf
 *
 * @param {vec3} positionWC The position of the fragment in world coordinates.
 * @param {vec3} normalEC The surface normal in eye coordinates.
 * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.
 * @return {float} The computed sun luminance.
 */
float getSunLuminance(vec3 positionWC, vec3 normalEC, vec3 lightDirectionEC)
{
    vec3 normalWC = normalize(czm_inverseViewRotation * normalEC);
    vec3 lightDirectionWC = normalize(czm_inverseViewRotation * lightDirectionEC);
    vec3 vWC = -normalize(positionWC);

    // Angle between sun and zenith.
    float LdotZenith = clampedDot(lightDirectionWC, vWC);
    float S = acos(LdotZenith);
    // Angle between zenith and current pixel
    float NdotZenith = clampedDot(normalWC, vWC);
    // Angle between sun and current pixel
    float NdotL = clampedDot(normalEC, lightDirectionEC);
    float gamma = acos(NdotL);

    float numerator = ((0.91 + 10.0 * exp(-3.0 * gamma) + 0.45 * NdotL * NdotL) * (1.0 - exp(-0.32 / NdotZenith)));
    float denominator = (0.91 + 10.0 * exp(-3.0 * S) + 0.45 * LdotZenith * LdotZenith) * (1.0 - exp(-0.32));
    return model_luminanceAtZenith * (numerator / denominator);
}
#endif

/**
 * Compute the light contribution from a procedural sky model
 *
 * @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 {czm_modelMaterial} The material properties.
 * @return {vec3} The computed HDR color
 */
 vec3 proceduralIBL(
    vec3 positionEC,
    vec3 normalEC,
    vec3 lightDirectionEC,
    czm_modelMaterial material
) {
    vec3 viewDirectionEC = -normalize(positionEC);
    vec3 positionWC = vec3(czm_inverseView * vec4(positionEC, 1.0));
    vec3 reflectionWC = normalize(czm_inverseViewRotation * reflect(viewDirectionEC, normalEC));
    vec3 skyMetrics = getProceduralSkyMetrics(positionWC, reflectionWC);

    float roughness = material.roughness;
    vec3 f0 = material.specular;

    vec3 specularIrradiance = getProceduralSpecularIrradiance(reflectionWC, skyMetrics, roughness);
    float NdotV = abs(dot(normalEC, viewDirectionEC)) + 0.001;
    vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg;
    vec3 specularColor = czm_srgbToLinear(f0 * brdfLut.x + brdfLut.y);
    vec3 specularContribution = specularIrradiance * specularColor * model_iblFactor.y;
    #ifdef USE_SPECULAR
        specularContribution *= material.specularWeight;
    #endif

    vec3 diffuseIrradiance = getProceduralDiffuseIrradiance(skyMetrics);
    vec3 diffuseColor = material.diffuse;
    vec3 diffuseContribution = diffuseIrradiance * diffuseColor * model_iblFactor.x;

    vec3 iblColor = specularContribution + diffuseContribution;

    #ifdef USE_SUN_LUMINANCE
        iblColor *= getSunLuminance(positionWC, normalEC, lightDirectionEC);
    #endif

    return iblColor;
}

#ifdef DIFFUSE_IBL
vec3 sampleDiffuseEnvironment(vec3 cubeDir)
{
    #ifdef CUSTOM_SPHERICAL_HARMONICS
        return czm_sphericalHarmonics(cubeDir, model_sphericalHarmonicCoefficients); 
    #else
        return czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients); 
    #endif
}
#endif

#ifdef SPECULAR_IBL
vec3 sampleSpecularEnvironment(vec3 cubeDir, float roughness)
{
    #ifdef CUSTOM_SPECULAR_IBL
        float lod = roughness * model_specularEnvironmentMapsMaximumLOD;
        return czm_textureCube(model_specularEnvironmentMaps, cubeDir, lod).rgb;
    #else
        float lod = roughness * czm_specularEnvironmentMapsMaximumLOD;
        return czm_textureCube(czm_specularEnvironmentMaps, cubeDir, lod).rgb;
    #endif
}
vec3 computeSpecularIBL(vec3 cubeDir, float NdotV, vec3 f0, float roughness)
{
    // see https://bruop.github.io/ibl/ at Single Scattering Results
    // Roughness dependent fresnel, from Fdez-Aguera
    vec3 f90 = max(vec3(1.0 - roughness), f0);
    vec3 F = fresnelSchlick2(f0, f90, NdotV);

    vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg;
    vec3 specularSample = sampleSpecularEnvironment(cubeDir, roughness);

    return specularSample * (F * brdfLut.x + brdfLut.y);
}
#endif

#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL)
/**
 * Compute the light contributions from environment maps and spherical harmonic coefficients.
 * See Fdez-Aguera, https://www.jcgt.org/published/0008/01/03/paper.pdf, for explanation
 * of the single- and multi-scattering terms.
 *
 * @param {vec3} viewDirectionEC Unit vector pointing from the fragment to the eye position.
 * @param {vec3} normalEC The surface normal in eye coordinates.
 * @param {czm_modelMaterial} The material properties.
 * @return {vec3} The computed HDR color.
 */
vec3 textureIBL(vec3 viewDirectionEC, vec3 normalEC, czm_modelMaterial material) {
    vec3 f0 = material.specular;
    float roughness = material.roughness;
    float specularWeight = 1.0;
    #ifdef USE_SPECULAR
        specularWeight = material.specularWeight;
    #endif
    float NdotV = clamp(dot(normalEC, viewDirectionEC), 0.0, 1.0);

    // see https://bruop.github.io/ibl/ at Single Scattering Results
    // Roughness dependent fresnel, from Fdez-Aguera
    vec3 f90 = max(vec3(1.0 - roughness), f0);
    vec3 singleScatterFresnel = fresnelSchlick2(f0, f90, NdotV);

    vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg;
    vec3 FssEss = specularWeight * (singleScatterFresnel * brdfLut.x + brdfLut.y);

    #ifdef DIFFUSE_IBL
        vec3 normalMC = normalize(model_iblReferenceFrameMatrix * normalEC);
        vec3 irradiance = sampleDiffuseEnvironment(normalMC);

        vec3 averageFresnel = f0 + (1.0 - f0) / 21.0;
        float Ems = specularWeight * (1.0 - brdfLut.x - brdfLut.y);
        vec3 FmsEms = FssEss * averageFresnel * Ems / (1.0 - averageFresnel * Ems);
        vec3 dielectricScattering = (1.0 - FssEss - FmsEms) * material.diffuse;
        vec3 diffuseContribution = irradiance * (FmsEms + dielectricScattering);
    #else
        vec3 diffuseContribution = vec3(0.0);
    #endif

    #ifdef USE_ANISOTROPY
        // Bend normal to account for anisotropic distortion of specular reflection
        vec3 anisotropyDirection = material.anisotropicB;
        vec3 anisotropicTangent = cross(anisotropyDirection, viewDirectionEC);
        vec3 anisotropicNormal = cross(anisotropicTangent, anisotropyDirection);
        float bendFactor = 1.0 - material.anisotropyStrength * (1.0 - roughness);
        float bendFactorPow4 = bendFactor * bendFactor * bendFactor * bendFactor;
        vec3 bentNormal = normalize(mix(anisotropicNormal, normalEC, bendFactorPow4));
        vec3 reflectEC = reflect(-viewDirectionEC, bentNormal);
    #else
        vec3 reflectEC = reflect(-viewDirectionEC, normalEC);
    #endif

    #ifdef SPECULAR_IBL
        vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflectEC);
        vec3 radiance = sampleSpecularEnvironment(reflectMC, roughness);
        vec3 specularContribution = radiance * FssEss;
    #else
        vec3 specularContribution = vec3(0.0);
    #endif

    return diffuseContribution + specularContribution;
}
#endif
`;var _se={name:"ImageBasedLightingPipelineStage"};_se.process=function(e,t,n){let i=t.imageBasedLighting,o=e.shaderBuilder;o.addDefine("USE_IBL_LIGHTING",void 0,ye.FRAGMENT),o.addUniform("vec2","model_iblFactor",ye.FRAGMENT),Gm.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&o.addUniform("mat3","model_iblReferenceFrameMatrix",ye.FRAGMENT),l(i.sphericalHarmonicCoefficients)?(o.addDefine("DIFFUSE_IBL",void 0,ye.FRAGMENT),o.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,ye.FRAGMENT),o.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",ye.FRAGMENT)):i.useDefaultSphericalHarmonics&&o.addDefine("DIFFUSE_IBL",void 0,ye.FRAGMENT),l(i.specularEnvironmentCubeMap)&&i.specularEnvironmentCubeMap.ready?(o.addDefine("SPECULAR_IBL",void 0,ye.FRAGMENT),o.addDefine("CUSTOM_SPECULAR_IBL",void 0,ye.FRAGMENT),o.addUniform("samplerCube","model_specularEnvironmentMaps",ye.FRAGMENT),o.addUniform("float","model_specularEnvironmentMapsMaximumLOD",ye.FRAGMENT)):t.useDefaultSpecularMaps&&o.addDefine("SPECULAR_IBL",void 0,ye.FRAGMENT)),l(i.luminanceAtZenith)&&(o.addDefine("USE_SUN_LUMINANCE",void 0,ye.FRAGMENT),o.addUniform("float","model_luminanceAtZenith",ye.FRAGMENT)),o.addFragmentLines(EI);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.specularEnvironmentCubeMap.texture},model_specularEnvironmentMapsMaximumLOD:function(){return i.specularEnvironmentCubeMap.maximumMipmapLevel}};e.uniformMap=_t(r,e.uniformMap)};var XI=_se;var iCn=T(S(),1);var jSn=T(S(),1);var CDe=W.EPSILON16;function qH(e){e=y(e,y.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(qH.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,CDe)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var VDe=new h,jH=new $;qH.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=VDe,o;switch(t){case lc.XROTATE:o=$.fromRotationX(W.toRadians(n),jH),e=F.multiplyByMatrix3(e,o,e);break;case lc.YROTATE:o=$.fromRotationY(W.toRadians(n),jH),e=F.multiplyByMatrix3(e,o,e);break;case lc.ZROTATE:o=$.fromRotationZ(W.toRadians(n),jH),e=F.multiplyByMatrix3(e,o,e);break;case lc.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=F.multiplyByTranslation(e,i,e);break;case lc.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=F.multiplyByTranslation(e,i,e);break;case lc.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=F.multiplyByTranslation(e,i,e);break;case lc.XSCALE:i.x=n,i.y=1,i.z=1,e=F.multiplyByScale(e,i,e);break;case lc.YSCALE:i.x=1,i.y=n,i.z=1,e=F.multiplyByScale(e,i,e);break;case lc.ZSCALE:i.x=1,i.y=1,i.z=n,e=F.multiplyByScale(e,i,e);break;case lc.UNIFORMSCALE:e=F.multiplyByUniformScale(e,n,e);break;default:break}return e};var II=qH;function V5(e){e=y(e,y.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,LDe(this)}Object.defineProperties(V5.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 LDe(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 II({stage:a,runtimeArticulation:e});o.push(c);let d=a.name;r[d]=c}}V5.prototype.setArticulationStage=function(e,t){let n=this._runtimeStagesByName[e];l(n)&&(n.currentValue=t)};var RDe=new F,ZDe=new F;V5.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e=F.clone(F.IDENTITY,RDe),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=F.multiplyTransformation(s.originalTransform,e,ZDe);s.transform=a}};var WI=V5;var mCn=T(S(),1);var rCn=T(S(),1),PI=`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 DC={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend"};DC.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,ye.FRAGMENT),i.addFragmentLines(PI);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=Re.TRANSLUCENT),i.addUniform("vec4",DC.COLOR_UNIFORM_NAME,ye.FRAGMENT),o[DC.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",DC.COLOR_BLEND_UNIFORM_NAME,ye.FRAGMENT),o[DC.COLOR_BLEND_UNIFORM_NAME]=function(){return cc.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=_t(o,e.uniformMap)};var fg=DC;var SCn=T(S(),1);var fCn=T(S(),1),vI=`#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 Tse={name:"ModelClippingPlanesPipelineStage"},GDe=new D;Tse.process=function(e,t,n){let i=t.clippingPlanes,o=n.context,r=e.shaderBuilder;r.addDefine("HAS_CLIPPING_PLANES",void 0,ye.FRAGMENT),r.addDefine("CLIPPING_PLANES_LENGTH",i.length,ye.FRAGMENT),i.unionClippingRegions&&r.addDefine("UNION_CLIPPING_REGIONS",void 0,ye.FRAGMENT),as.useFloatTexture(o)&&r.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,ye.FRAGMENT);let s=as.getTextureResolution(i,o,GDe);r.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",s.x,ye.FRAGMENT),r.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",s.y,ye.FRAGMENT),r.addUniform("sampler2D","model_clippingPlanes",ye.FRAGMENT),r.addUniform("vec4","model_clippingPlanesEdgeStyle",ye.FRAGMENT),r.addUniform("mat4","model_clippingPlanesMatrix",ye.FRAGMENT),r.addFragmentLines(vI);let a={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let c=Y.clone(i.edgeColor);return c.alpha=i.edgeWidth,c},model_clippingPlanesMatrix:function(){return t._clippingPlanesMatrix}};e.uniformMap=_t(a,e.uniformMap)};var wI=Tse;var WCn=T(S(),1);var VCn=T(S(),1),FI=`void modelClippingPolygonsStage(ProcessedAttributes attributes)
{
    vec2 sphericalLatLong = czm_approximateSphericalCoordinates(v_positionWC);
    sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi);

    vec2 minDistance = vec2(czm_infinity);
    v_regionIndex = -1;
    v_clippingPosition = vec2(czm_infinity);

    for (int regionIndex = 0; regionIndex < CLIPPING_POLYGON_REGIONS_LENGTH; regionIndex++) {
        vec4 extents = czm_unpackClippingExtents(model_clippingExtents, regionIndex);
        vec2 rectUv = (sphericalLatLong.yx - extents.yx) * extents.wz;

        vec2 clamped = clamp(rectUv, vec2(0.0), vec2(1.0));
        vec2 distance = abs(rectUv - clamped) * extents.wz;
        
        if (minDistance.x > distance.x || minDistance.y > distance.y) {
            minDistance = distance;
            v_clippingPosition = rectUv;
        }

        float threshold = 0.01;
        if (rectUv.x > threshold && rectUv.y > threshold && rectUv.x < 1.0 - threshold && rectUv.y < 1.0 - threshold) {
            v_regionIndex = regionIndex;
        }
    }
}
`;var RCn=T(S(),1),AI=`void modelClippingPolygonsStage()
{
    vec2 clippingPosition = v_clippingPosition;
    int regionIndex = v_regionIndex;
    czm_clipPolygons(model_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex);
}
`;var Sse={name:"ModelClippingPolygonsPipelineStage"};Sse.process=function(e,t,n){let i=t.clippingPolygons,o=e.shaderBuilder;o.addDefine("ENABLE_CLIPPING_POLYGONS",void 0,ye.BOTH),i.inverse&&o.addDefine("CLIPPING_INVERSE",void 0,ye.FRAGMENT),o.addDefine("CLIPPING_POLYGON_REGIONS_LENGTH",i.extentsCount,ye.BOTH),o.addUniform("sampler2D","model_clippingDistance",ye.FRAGMENT),o.addUniform("sampler2D","model_clippingExtents",ye.VERTEX),o.addVarying("vec2","v_clippingPosition"),o.addVarying("int","v_regionIndex","flat"),o.addVertexLines(FI),o.addFragmentLines(AI);let r={model_clippingDistance:function(){return i.clippingTexture},model_clippingExtents:function(){return i.extentsTexture}};e.uniformMap=_t(r,e.uniformMap)};var MI=Sse;var wCn=T(S(),1);function Cse(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(Cse.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 NI=Cse;var G1n=T(S(),1);var l1n=T(S(),1);var ACn=T(S(),1),kI=`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 NCn=T(S(),1),UI=`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 UCn=T(S(),1),DI=`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 L5=new F,EDe=new F,XDe=new F,Lse={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:Xse,_transformsToTypedArray:ez};Lse.process=function(e,t,n){let i=t.instances,o=i.attributes[0].count,r=e.shaderBuilder;r.addDefine("HAS_INSTANCING"),r.addVertexLines(kI);let s=e.model,a=s.sceneGraph,c=e.runtimeNode,d=n.mode!==oe.SCENE3D&&!n.scene3DOnly&&s._projectTo2D,u=s._enablePick&&!n.context.webgl2,m=[];ODe(e,n,i,m,d,u),KDe(e,n,i,m);let p={};if(i.transformInWorldSpace?(r.addDefine("USE_LEGACY_INSTANCING",void 0,ye.VERTEX),r.addUniform("mat4","u_instance_modifiedModelView",ye.VERTEX),r.addUniform("mat4","u_instance_nodeTransform",ye.VERTEX),p.u_instance_modifiedModelView=function(){let g=F.multiplyTransformation(s.modelMatrix,a.components.transform,L5);return d?F.multiplyTransformation(n.context.uniformState.view3D,g,L5):(n.mode!==oe.SCENE3D&&(g=wt.basisTo2D(n.mapProjection,g,L5)),F.multiplyTransformation(n.context.uniformState.view,g,L5))},p.u_instance_nodeTransform=function(){return F.multiplyTransformation(a.axisCorrectionMatrix,c.computedTransform,EDe)},r.addVertexLines(DI)):r.addVertexLines(UI),d){r.addDefine("USE_2D_INSTANCING",void 0,ye.VERTEX),r.addUniform("mat4","u_modelView2D",ye.VERTEX);let g=n.context,f=F.fromTranslation(c.instancingReferencePoint2D,new F);p.u_modelView2D=function(){return F.multiplyTransformation(g.uniformState.view,f,XDe)}}e.uniformMap=_t(p,e.uniformMap),e.instanceCount=o,e.attributes.push.apply(e.attributes,m)};var BI=new F,IDe=new h;function WDe(e,t,n,i,o){let r=F.multiplyTransformation(t,e,BI);return r=F.multiplyTransformation(r,n,BI),o=wt.basisTo2D(i.mapProjection,r,o),o}function PDe(e,t,n,i,o){let r=F.fromTranslation(e,BI),s=F.multiplyTransformation(t,r,BI);s=F.multiplyTransformation(s,n,BI);let a=F.getTranslation(s,IDe);return o=Yi.computeActualEllipsoidPosition(i,a,o),o}function Rse(e,t,n){let i=e.model,o=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(t=F.multiplyTransformation(i.modelMatrix,o.components.transform,t),n=F.multiplyTransformation(o.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=F.clone(o.computedModelMatrix,t),t=F.multiplyTransformation(t,e.runtimeNode.computedTransform,t),n=F.clone(F.IDENTITY,n))}var Zse=new F,Gse=new F,vDe=new F,wDe=new h;function FDe(e,t,n,i){let o=Zse,r=Gse;Rse(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let d=0;d<c;d++){let u=e[d],m=WDe(u,o,r,n,vDe),p=F.getTranslation(m,wDe),g=h.subtract(p,a,p);i[d]=F.setTranslation(m,g,i[d])}return i}function ADe(e,t,n,i){let o=Zse,r=Gse;Rse(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let d=0;d<c;d++){let u=e[d],m=PDe(u,o,r,n,u);i[d]=h.subtract(m,a,i[d])}return i}var MDe=new h,NDe=new h;function Ese(e,t){let n=e.runtimeNode,i=e.model.sceneGraph.computedModelMatrix,o=F.multiplyByPoint(i,n.instancingTranslationMin,MDe),r=Yi.computeActualEllipsoidPosition(t,o,o),s=F.multiplyByPoint(i,n.instancingTranslationMax,NDe),a=Yi.computeActualEllipsoidPosition(t,s,s);n.instancingReferencePoint2D=h.lerp(r,a,.5,new h)}function ez(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 kDe(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 UDe=new h,DDe=new we,BDe=new h;function Xse(e,t,n){let i=new Array(t),o=jt.getAttributeBySemantic(e,Kr.TRANSLATION),r=jt.getAttributeBySemantic(e,Kr.ROTATION),s=jt.getAttributeBySemantic(e,Kr.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),g=u?r.typedArray:new Float32Array(t*4);u&&r.normalized&&(g=wn.dequantize(g,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],UDe);h.maximumByComponent(a,C,a),h.minimumByComponent(c,C,c);let V=new we(g[_*4],g[_*4+1],g[_*4+2],u?g[_*4+3]:1,DDe),L=new h(f[_*3],f[_*3+1],f[_*3+2],BDe),Z=F.fromTranslationQuaternionRotationScale(C,V,L,new F);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 YDe(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 tz(e,t){let n=yt.createVertexBuffer({context:t.context,typedArray:e,usage:Me.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function ODe(e,t,n,i,o,r){let s=jt.getAttributeBySemantic(n,Kr.ROTATION);l(s)?HDe(e,n,i,t,o,r):zDe(e,n,i,t,o)}function HDe(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=Xse(t,a,e);let _=ez(m);p=tz(_,i),c._modelResources.push(p),r&&(d.transformsTypedArray=_),d.instancingTransformsBuffer=p}if(Vse(e,p,n,u),!o)return;let g=Ye(i);g.mode=oe.COLUMBUS_VIEW,Ese(e,g);let f=d.instancingTransformsBuffer2D;if(!l(f)){let _=FDe(m,e,g,m),C=ez(_);f=tz(C,i),c._modelResources.push(f),d.instancingTransformsBuffer2D=f}Vse(e,f,n,"Transform2D")}function zDe(e,t,n,i,o,r){let s=e.shaderBuilder,a=e.runtimeNode,c=jt.getAttributeBySemantic(t,Kr.TRANSLATION),d=jt.getAttributeBySemantic(t,Kr.SCALE);if(l(d)&&(s.addDefine("HAS_INSTANCE_SCALE"),$H(e,d.buffer,d.byteOffset,d.byteStride,n,"Scale")),!l(c))return;let u,m=c.typedArray;if(l(m)?u=YDe(c,c.count,e):l(a.instancingTranslationMin)||(a.instancingTranslationMin=c.min,a.instancingTranslationMax=c.max),s.addDefine("HAS_INSTANCE_TRANSLATION"),$H(e,c.buffer,c.byteOffset,c.byteStride,n,"Translation"),!o&&!r)return;let g=Ye(i);g.mode=oe.COLUMBUS_VIEW,Ese(e,g);let f=a.instancingTranslationBuffer2D;if(!l(f)){let V=ADe(u,e,g,u),L=kDe(V);r&&(a.transformsTypedArray=L),f=tz(L,i),e.model._modelResources.push(f),a.instancingTranslationBuffer2D=f}if(!o)return;$H(e,f,0,void 0,n,"Translation2D")}function Vse(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 $H(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 KDe(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===Kr.FEATURE_ID&&(a.setIndex>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:a.buffer,componentsPerAttribute:on.getNumberOfComponents(a.type),componentDatatype:a.componentDatatype,normalize:!1,offsetInBytes:a.byteOffset,strideInBytes:a.byteStride,instanceDivisor:1}),r.addAttribute("float",`a_instanceFeatureId_${a.setIndex}`))}}var YI=Lse;var f1n=T(S(),1);var nz={};nz.name="ModelMatrixUpdateStage";nz.update=function(e,t,n){let i=n.mode!==oe.SCENE3D;if(!(i&&t._model._projectTo2D)&&e._transformDirty){let o=i?t._computedModelMatrix2D:t._computedModelMatrix;Ise(e,t,o,e.transformToRoot),e._transformDirty=!1}};function Ise(e,t,n,i){let o;i=F.multiplyTransformation(i,e.transform,new F),e.updateComputedTransform();let r=e.runtimePrimitives.length;for(o=0;o<r;o++){let c=e.runtimePrimitives[o].drawCommand;c.modelMatrix=F.multiplyTransformation(n,i,c.modelMatrix),c.cullFace=jt.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=F.clone(i,a._transformToRoot),Ise(a,t,n,i),a._transformDirty=!1}}var OI=nz;var g1n=T(S(),1);var Wse={name:"NodeStatisticsPipelineStage",_countInstancingAttributes:Pse,_countGeneratedBuffers:vse};Wse.process=function(e,t,n){let i=e.model.statistics,o=t.instances,r=e.runtimeNode;Pse(i,o),vse(i,r)};function Pse(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 vse(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 HI=Wse;function BC(e){e=y(e,y.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=F.clone(n,this._originalTransform),this._transform=F.clone(n,this._transform),this._transformToRoot=F.clone(i,this._transformToRoot),this._computedTransform=new F,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,JDe(this)}Object.defineProperties(BC.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=F.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),iz(this,t))}},rotation:{get:function(){return l(this._transformParameters)?this._transformParameters.rotation:void 0},set:function(e){let t=this._transformParameters,n=t.rotation;we.equals(n,e)||(t.rotation=we.clone(e,t.rotation),iz(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),iz(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 JDe(e){let t=e.transform,n=e.transformToRoot,i=e._computedTransform;e._computedTransform=F.multiply(n,t,i);let o=e.node;l(o.matrix)||(e._transformParameters=new Nb(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 iz(e,t){e._transformDirty=!0,e._transform=F.fromTranslationRotationScale(t,e._transform)}BC.prototype.getChild=function(e){return this.sceneGraph._runtimeNodes[this.children[e]]};BC.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(YI),t.push(HI),n.push(OI)};BC.prototype.updateComputedTransform=function(){this._computedTransform=F.multiply(this._transformToRoot,this._transform,this._computedTransform)};BC.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 F);let r=F.multiplyTransformation(this.transformToRoot,this.transform,t[o]),s=F.inverseTransformation(r,t[o]);t[o]=F.multiplyTransformation(s,n[o],t[o])}};var zI=BC;var kGn=T(S(),1);var w1n=T(S(),1);var wse={name:"AlphaPipelineStage"};wse.process=function(e,t,n){let i=e.alphaOptions,o=e.model;i.pass=y(i.pass,o.opaquePass);let r=e.renderStateOptions;i.pass===Re.TRANSLUCENT&&(r.cull.enabled=!1,r.depthMask=!1,r.blending=un.ALPHA_BLEND);let s=e.shaderBuilder,a=e.uniformMap;l(i.alphaCutoff)&&(s.addDefine("ALPHA_MODE_MASK",void 0,ye.FRAGMENT),s.addUniform("float","u_alphaCutoff",ye.FRAGMENT),a.u_alphaCutoff=function(){return i.alphaCutoff})};var KI=wse;var N1n=T(S(),1);var Fse={name:"BatchTexturePipelineStage"};Fse.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 y(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=_t(o,e.uniformMap)};var JI=Fse;var H1n=T(S(),1);var Ase={name:"ClassificationPipelineStage"};Ase.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,ye.BOTH);let o=e.runtimePrimitive;l(o.batchLengths)||QDe(t,o)};function QDe(e,t){let n=jt.getAttributeBySemantic(e,St.POSITION);if(!l(n))throw new ue("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=jt.getAttributeBySemantic(e,St.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],g=0;for(let x=1;x<s;x++){let _=r?i[x]:x,C=c[_];if(C!==p){let V=x-g,L=x;d.push(V),u.push(L),g=L,p=C}}let f=s-g;d.push(f),t.batchLengths=d,t.batchOffsets=u}var QI=Ase;var rVn=T(S(),1);var K1n=T(S(),1),jI=`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 Q1n=T(S(),1),qI=`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 Mse={name:"CPUStylingPipelineStage"};Mse.process=function(e,t,n){let i=e.model,o=e.shaderBuilder;o.addVertexLines(jI),o.addFragmentLines(qI),o.addDefine("USE_CPU_STYLING",void 0,ye.BOTH),l(i.color)||(o.addUniform("float",fg.COLOR_BLEND_UNIFORM_NAME,ye.FRAGMENT),e.uniformMap[fg.COLOR_BLEND_UNIFORM_NAME]=function(){return cc.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),o.addUniform("bool","model_commandTranslucent",ye.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===Re.TRANSLUCENT}};var $I=Mse;var aVn=T(S(),1),Nse={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};Nse.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};var n0=Object.freeze(Nse);var oLn=T(S(),1);var lVn=T(S(),1),eW=`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 uVn=T(S(),1),tW=`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 EVn=T(S(),1);var hVn=T(S(),1),nW=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) {
  initializeFeatureIds(featureIds, attributes);
  initializeFeatureIdAliases(featureIds);
}
`;var pVn=T(S(),1),iW=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) 
{
  initializeFeatureIds(featureIds, attributes);
  initializeFeatureIdAliases(featureIds);
  setFeatureIdVaryings();
}
`;var Fi={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()"};Fi.process=function(e,t,n){let i=e.shaderBuilder;jDe(i);let o=e.runtimeNode.node.instances;l(o)&&qDe(e,o,n),$De(e,t,n),i.addVertexLines(iW),i.addFragmentLines(nW)};function jDe(e){e.addStruct(Fi.STRUCT_ID_FEATURE_IDS_VS,Fi.STRUCT_NAME_FEATURE_IDS,ye.VERTEX),e.addStruct(Fi.STRUCT_ID_FEATURE_IDS_FS,Fi.STRUCT_NAME_FEATURE_IDS,ye.FRAGMENT),e.addFunction(Fi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,Fi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,ye.VERTEX),e.addFunction(Fi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,Fi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,ye.FRAGMENT),e.addFunction(Fi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,Fi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,ye.VERTEX),e.addFunction(Fi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,Fi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,ye.FRAGMENT),e.addFunction(Fi.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,Fi.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,ye.VERTEX)}function qDe(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 Tn.FeatureIdAttribute?e3e(e,s,a):kse(e,s,a,o,1,n);let c=s.label;l(c)&&Use(e,a,c,ye.BOTH)}}function $De(e,t,n){let i=t.featureIds,r=jt.getAttributeBySemantic(t,St.POSITION).count;for(let s=0;s<i.length;s++){let a=i[s],c=a.positionalLabel,d=ye.BOTH;a instanceof Tn.FeatureIdAttribute?t3e(e,a,c):a instanceof Tn.FeatureIdImplicitRange?kse(e,a,c,r,void 0,n):(n3e(e,a,c,s,n),d=ye.FRAGMENT);let u=a.label;l(u)&&Use(e,c,u,d)}}function e3e(e,t,n){let i=e.shaderBuilder;i.addStructField(Fi.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Fi.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(Fi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[c]),i.addFunctionLines(Fi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[d]),i.addVarying("float",a),i.addFunctionLines(Fi.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${a} = ${s};`])}function t3e(e,t,n){let i=e.shaderBuilder;i.addStructField(Fi.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Fi.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(Fi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,s),i.addFunctionLines(Fi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,s)}function kse(e,t,n,i,o,r){i3e(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(Fi.STRUCT_ID_FEATURE_IDS_VS,"int",n),s.addStructField(Fi.STRUCT_ID_FEATURE_IDS_FS,"int",n),s.addFunctionLines(Fi.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${c} = ${a};`]),s.addFunctionLines(Fi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${a}));`]),s.addFunctionLines(Fi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${c}));`])}function n3e(e,t,n,i,o){let r=`u_featureIdTexture_${i}`,s=e.uniformMap,a=t.textureReader;s[r]=function(){return y(a.texture,o.context.defaultTexture)};let c=a.channels,d=e.shaderBuilder;d.addStructField(Fi.STRUCT_ID_FEATURE_IDS_FS,"int",n),d.addUniform("sampler2D",r,ye.FRAGMENT);let m=`v_texCoord_${a.texCoord}`,p=m,g=a.transform;if(l(g)&&!$.equals(g,$.IDENTITY)){let _=`${r}Transform`;d.addUniform("mat3",_,ye.FRAGMENT),s[_]=function(){return g},p=`vec2(${_} * vec3(${m}, 1.0))`}let f=`texture(${r}, ${p}).${c}`,x=`featureIds.${n} = czm_unpackUint(${f});`;d.addFunctionLines(Fi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[x])}function Use(e,t,n,i){let o=e.shaderBuilder,r=ye.includesVertexShader(i);r&&o.addStructField(Fi.STRUCT_ID_FEATURE_IDS_VS,"int",n),o.addStructField(Fi.STRUCT_ID_FEATURE_IDS_FS,"int",n);let s=[`featureIds.${n} = featureIds.${t};`];r&&o.addFunctionLines(Fi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,s),o.addFunctionLines(Fi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,s)}function i3e(e,t,n,i,o){let r=e.model,s,a;if(l(t.repeat)){let d=o3e(t,n);s=yt.createVertexBuffer({context:o.context,typedArray:d,usage:Me.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 o3e(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 pg=Fi;var DVn=T(S(),1);var IVn=T(S(),1),oW=`void metadataStage(
  out Metadata metadata,
  out MetadataClass metadataClass,
  out MetadataStatistics metadataStatistics,
  ProcessedAttributes attributes
  )
{
  initializeMetadata(metadata, metadataClass, metadataStatistics, attributes);
}
`;var PVn=T(S(),1),rW=`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=r3e(r.propertyAttributes,t,a),d=a3e(r.propertyTextures,a),u=c.concat(d);l3e(i,u),m3e(i),i.addVertexLines(rW),i.addFragmentLines(oW);for(let m=0;m<c.length;m++){let p=c[m];h3e(e,p)}for(let m=0;m<d.length;m++){let p=d[m];p3e(e,p)}};function r3e(e,t,n){return l(e)?e.flatMap(i=>s3e(i,t,n)):[]}function s3e(e,t,n){let{getAttributeByName:i,getAttributeInfo:o,sanitizeGlslIdentifier:r}=jt,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],g=i(t,p.attribute),{glslType:f,variableName:x}=o(g);d[u]={metadataVariable:r(m),property:p,type:p.classProperty.type,glslType:f,variableName:x,propertyStatistics:a?.properties[m],shaderDestination:ye.BOTH}}return d}function a3e(e,t){return l(e)?e.flatMap(n=>c3e(n,t)):[]}function c3e(e,t){let{sanitizeGlslIdentifier:n}=jt,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:ye.FRAGMENT}}return s}function l3e(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!==zt.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,ye.BOTH);for(let u=0;u<d.length;u++){let{shaderName:m}=d[u],p=d[u].type==="float"?u3e(c):c;e.addStructField(a,p,m)}}}var d3e={int:"float",ivec2:"vec2",ivec3:"vec3",ivec4:"vec4"};function u3e(e){let t=d3e[e];return l(t)?t:e}function m3e(e){e.addStruct(Ci.STRUCT_ID_METADATA_VS,Ci.STRUCT_NAME_METADATA,ye.VERTEX),e.addStruct(Ci.STRUCT_ID_METADATA_FS,Ci.STRUCT_NAME_METADATA,ye.FRAGMENT),e.addStruct(Ci.STRUCT_ID_METADATA_CLASS_VS,Ci.STRUCT_NAME_METADATA_CLASS,ye.VERTEX),e.addStruct(Ci.STRUCT_ID_METADATA_CLASS_FS,Ci.STRUCT_NAME_METADATA_CLASS,ye.FRAGMENT),e.addStruct(Ci.STRUCT_ID_METADATA_STATISTICS_VS,Ci.STRUCT_NAME_METADATA_STATISTICS,ye.VERTEX),e.addStruct(Ci.STRUCT_ID_METADATA_STATISTICS_FS,Ci.STRUCT_NAME_METADATA_STATISTICS,ye.FRAGMENT),e.addFunction(Ci.FUNCTION_ID_INITIALIZE_METADATA_VS,Ci.FUNCTION_SIGNATURE_INITIALIZE_METADATA,ye.VERTEX),e.addFunction(Ci.FUNCTION_ID_INITIALIZE_METADATA_FS,Ci.FUNCTION_SIGNATURE_INITIALIZE_METADATA,ye.FRAGMENT),e.addFunction(Ci.FUNCTION_ID_SET_METADATA_VARYINGS,Ci.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,ye.VERTEX)}function h3e(e,t){f3e(e,t),Dse(e.shaderBuilder,t),Bse(e.shaderBuilder,t)}function f3e(e,t){let{shaderBuilder:n}=e,{metadataVariable:i,property:o,glslType:r}=t,s=Ose({valueExpression:`attributes.${t.variableName}`,renderResources:e,glslType:r,metadataVariable:i,shaderDestination:ye.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 p3e(e,t){b3e(e,t),Dse(e.shaderBuilder,t),Bse(e.shaderBuilder,t)}function b3e(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,ye.FRAGMENT),i[p]=()=>u),n.addStructField(Ci.STRUCT_ID_METADATA_FS,r,o);let g=`attributes.texCoord_${a}`,f=g;if(l(m)&&!$.equals(m,$.IDENTITY)){let L=`${p}Transform`;n.addUniform("mat3",L,ye.FRAGMENT),i[L]=function(){return m},f=`vec2(${L} * vec3(${g}, 1.0))`}let x=`texture(${p}, ${f}).${c}`,_=s.unpackInShader(x),C=Ose({valueExpression:_,renderResources:e,glslType:r,metadataVariable:o,shaderDestination:ye.FRAGMENT,property:s}),V=`metadata.${o} = ${C};`;n.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_FS,[V])}function Dse(e,t){let{classProperty:n}=t.property,{metadataVariable:i,glslType:o,shaderDestination:r}=t,s=Yse(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),ye.includesVertexShader(r)&&(e.addStructField(Ci.STRUCT_ID_METADATA_CLASS_VS,a,i),e.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_VS,s))}function Bse(e,t){let{propertyStatistics:n}=t;if(!l(n))return;let{metadataVariable:i,type:o,glslType:r}=t;if(o===zt.ENUM)return;let s=Ci.METADATA_STATISTICS_FIELDS,a=`metadataStatistics.${i}`,c=Yse(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),ye.includesVertexShader(t.shaderDestination)&&(e.addStructField(Ci.STRUCT_ID_METADATA_STATISTICS_VS,d,i),e.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_VS,c))}function Yse(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 Ose(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 Tu=Ci;var YVn=T(S(),1),g3e={INHERIT:0,OPAQUE:1,TRANSLUCENT:2},bg=Object.freeze(g3e);var ia={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:Nt};ia.process=function(e,t,n){let{shaderBuilder:i,model:o,alphaOptions:r}=e,{customShader:s}=o,{lightingModel:a,translucencyMode:c}=s;l(a)&&(e.lightingOptions.lightingModel=a),c===bg.TRANSLUCENT?r.pass=Re.TRANSLUCENT:c===bg.OPAQUE&&(r.pass=void 0);let d=L3e(s,t);if(!d.customShaderEnabled)return;if(E3e(i,s,d),d.shouldComputePositionWC&&i.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,ye.BOTH),l(s.vertexShaderText)&&i.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,ye.VERTEX),l(s.fragmentShaderText)){i.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,ye.FRAGMENT);let p=n0.getDefineName(s.mode);i.addDefine(p,void 0,ye.FRAGMENT)}let u=s.uniforms;for(let p in u)if(u.hasOwnProperty(p)){let g=u[p];i.addUniform(g.type,p)}let m=s.varyings;for(let p in m)if(m.hasOwnProperty(p)){let g=m[p];i.addVarying(g,p)}e.uniformMap=_t(e.uniformMap,s.uniformMap)};function y3e(e){let t={};for(let n=0;n<e.length;n++){let i=jt.getAttributeInfo(e[n]);t[i.variableName]=i}return t}var x3e={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},_3e={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 Hse(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");let n=x3e[t],i=_3e[t];if(l(n))return{attributeField:[n,e],value:i}}function T3e(e,t){if(!l(e.vertexShaderText))return{enabled:!1};let n=e.usedVariablesVertex.attributeSet,i=zse(t,n,!1),o=Kse(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=Hse(d);if(!l(u))return ia._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 S3e(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 C3e(e,t){if(!l(e.fragmentShaderText))return{enabled:!1};let n=e.usedVariablesFragment.attributeSet,i=zse(t,n,!0),o=Kse(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=Hse(u);if(!l(m))return ia._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=S3e(e);return{enabled:!0,attributeFields:s.concat(c.attributeFields),initializationLines:c.initializationLines.concat(a)}}var V3e={positionWC:!0,positionEC:!0};function zse(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 Kse(e,t,n){let i=[];for(let o in t){if(!t.hasOwnProperty(o)||V3e.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 L3e(e,t){let n=y3e(t.attributes),i=T3e(e,n),o=C3e(e,n),s=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&o.enabled;return{vertexLines:i,fragmentLines:o,customShaderEnabled:i.enabled||o.enabled,shouldComputePositionWC:s}}function R3e(e,t){let n=ia.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(n,ia.STRUCT_NAME_ATTRIBUTES,ye.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=ia.STRUCT_ID_VERTEX_INPUT,e.addStruct(n,ia.STRUCT_NAME_VERTEX_INPUT,ye.VERTEX),e.addStructField(n,ia.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,pg.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Tu.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Tu.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Tu.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=ia.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(r,ia.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,ye.VERTEX),e.addFunctionLines(r,o)}function Z3e(e,t){let n=ia.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(n,ia.STRUCT_NAME_ATTRIBUTES,ye.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=ia.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(n,ia.STRUCT_NAME_FRAGMENT_INPUT,ye.FRAGMENT),e.addStructField(n,ia.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,pg.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Tu.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Tu.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Tu.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=ia.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(r,ia.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,ye.FRAGMENT),e.addFunctionLines(r,o)}var G3e=[];function E3e(e,t,n){let{vertexLines:i,fragmentLines:o}=n,r=G3e;i.enabled&&(R3e(e,i),r.length=0,r.push("#line 0",t.vertexShaderText,eW),e.addVertexLines(r)),o.enabled&&(Z3e(e,o),r.length=0,r.push("#line 0",t.fragmentShaderText,tW),e.addFragmentLines(r))}var sW=ia;var uLn=T(S(),1);var aW={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};aW.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=l(o.classificationType);i.addDefine("USE_DEQUANTIZATION",void 0,ye.VERTEX),i.addFunction(aW.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,aW.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,ye.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===St.POSITION,m=c.semantic===St.TEXCOORD;if(r&&!u&&!m)continue;let p=jt.getAttributeInfo(c);I3e(i,p),X3e(e,p)}};function X3e(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,ye.VERTEX),i[s]=function(){return r.normalizationRange}}else{let s=`model_quantizedVolumeOffset_${o}`,a=`model_quantizedVolumeStepSize_${o}`,c=t.glslType;n.addUniform(c,s,ye.VERTEX),n.addUniform(c,a,ye.VERTEX);let d=r.quantizedVolumeOffset,u=r.quantizedVolumeStepSize;/^color_\d+$/.test(o)&&(d=Jse(d,0),u=Jse(u,1)),i[s]=function(){return d},i[a]=function(){return u}}}function Jse(e,t){return e instanceof se?e:new se(e.x,e.y,e.z,t)}function I3e(e,t){let n=t.variableName,i=t.attribute.quantization,o;i.octEncoded?o=W3e(n,i):o=P3e(n),e.addFunctionLines(aW.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[o])}function W3e(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 P3e(e){let t=`attributes.${e}`,n=`a_quantized_${e}`,i=`model_quantizedVolumeOffset_${e}`,o=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${i} + ${n} * ${o};`}var cW=aW;var NLn=T(S(),1);var hLn=T(S(),1),lW=`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 pLn=T(S(),1),dW=`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) || defined(ENABLE_CLIPPING_POLYGONS)
    // 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 LLn=T(S(),1);var gLn=T(S(),1),YC=`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 uW={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)"};uW.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let o=e.model,r=e.runtimeNode.node,s=v3e(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),w3e(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===ye.BOTH&&i.addVertexLines(YC),i.addFragmentLines(YC)};function Qse(e){return e instanceof Tn.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function jse(e){return e instanceof Tn.FeatureIdTexture?ye.FRAGMENT:ye.BOTH}function v3e(e,t,n){let i,o;return l(t.instances)&&(o=jt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(o))?(i=y(o.label,o.positionalLabel),{featureIds:o,variableName:i,shaderDestination:jse(o),featureIdDefine:Qse(o)}):(o=jt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=y(o.label,o.positionalLabel),{featureIds:o,variableName:i,shaderDestination:jse(o),featureIdDefine:Qse(o)})}function w3e(e){e.addStructField(uW.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(uW.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(uW.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var gg=uW;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{shaderBuilder:i,model:o}=e;i.addStruct(Fs.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",ye.VERTEX),i.addStruct(Fs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",ye.FRAGMENT),i.addStruct(gg.STRUCT_ID_SELECTED_FEATURE,gg.STRUCT_NAME_SELECTED_FEATURE,ye.BOTH),i.addFunction(Fs.FUNCTION_ID_INITIALIZE_ATTRIBUTES,Fs.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,ye.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,ye.VERTEX),i.addFunction(Fs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,Fs.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,ye.FRAGMENT),o.type===rr.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,ye.FRAGMENT);let r=n.mode!==oe.SCENE3D&&!n.scene3DOnly&&o._projectTo2D,s=l(e.runtimeNode.node.instances),a=r&&!s,c=t.attributes.length;for(let d=0;d<c;d++){let u=t.attributes[d],m=on.getAttributeLocationCount(u.type),p=u.semantic===St.POSITION,g;m>1?(g=e.attributeIndex,e.attributeIndex+=m):p&&!a?g=0:g=e.attributeIndex++,F3e(e,u,g,m,r,s)}O3e(i,t.attributes),t.primitiveType===Fe.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(dW),i.addFragmentLines(lW)};function F3e(e,t,n,i,o,r){let s=e.shaderBuilder,a=jt.getAttributeInfo(t),c=o&&!r;i>1?N3e(e,t,n,i):M3e(e,t,n,c),U3e(s,a,c),k3e(s,a),l(t.semantic)&&A3e(s,t),D3e(s,a,o),B3e(s,a,c),Y3e(s,a)}function A3e(e,t){let{semantic:n,setIndex:i}=t;switch(n){case St.NORMAL:e.addDefine("HAS_NORMALS");break;case St.TANGENT:e.addDefine("HAS_TANGENTS");break;case St.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case St.TEXCOORD:case St.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function M3e(e,t,n,i){let{quantization:o,semantic:r,setIndex:s}=t,{type:a,componentDatatype:c}=l(o)?o:t;r===St.FEATURE_ID&&s>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=s+1);let d=r===St.POSITION,u=d?0:n,m=on.getNumberOfComponents(a),p={index:u,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:m,componentDatatype:c,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!d||!i)return;let g=e.runtimePrimitive.positionBuffer2D,f={index:n,vertexBuffer:g,count:t.count,componentsPerAttribute:m,componentDatatype:Q.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(f)}function N3e(e,t,n,i){let{quantization:o,normalized:r}=t,{type:s,componentDatatype:a}=l(o)?o:t,d=on.getNumberOfComponents(s)/i,u=Q.getSizeInBytes(a),m=d*u,p=t.byteStride;for(let g=0;g<i;g++){let f=t.byteOffset+g*m,x={index:n+g,vertexBuffer:t.buffer,componentsPerAttribute:d,componentDatatype:a,offsetInBytes:f,strideInBytes:p,normalize:r};e.attributes.push(x)}}function k3e(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 U3e(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===St.POSITION;a?e.setPositionAttribute(s,r):e.addAttribute(s,r),a&&n&&e.addAttribute("vec3","a_position2D")}function D3e(e,t,n){let i=Fs.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,o=Fs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,{variableName:r,glslType:s}=t;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,s,r),e.addStructField(o,s,r)),r==="positionMC"&&n&&e.addStructField(i,"vec3","position2D")}function B3e(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 Y3e(e,t){let{semantic:n,setIndex:i}=t.attribute;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 O3e(e,t){let n=!1,i=!1;for(let o=0;o<t.length;o++){let r=t[o];r.semantic===St.NORMAL?n=!0:r.semantic===St.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 mW=Fs;var JLn=T(S(),1);var ULn=T(S(),1),hW=`#ifdef USE_IBL_LIGHTING
vec3 computeIBL(vec3 position, vec3 normal, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material)
{
    #if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL)
        // Environment maps were provided, use them for IBL
        vec3 viewDirection = -normalize(position);
        vec3 iblColor = textureIBL(viewDirection, normal, material);
    #else
        // Use procedural IBL if there are no environment maps
        vec3 imageBasedLighting = proceduralIBL(position, normal, lightDirection, material);
        float maximumComponent = czm_maximumComponent(lightColorHdr);
        vec3 clampedLightColor = lightColorHdr / max(maximumComponent, 1.0);
        vec3 iblColor = clampedLightColor * imageBasedLighting;
    #endif
    return iblColor * material.occlusion;
}
#endif

#ifdef USE_CLEARCOAT
vec3 addClearcoatReflection(vec3 baseLayerColor, vec3 position, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material)
{
    vec3 viewDirection = -normalize(position);
    vec3 halfwayDirection = normalize(viewDirection + lightDirection);
    vec3 normal = material.clearcoatNormal;
    float NdotL = clamp(dot(normal, lightDirection), 0.001, 1.0);

    // clearcoatF0 = vec3(pow((ior - 1.0) / (ior + 1.0), 2.0)), but without KHR_materials_ior, ior is a constant 1.5.
    vec3 f0 = vec3(0.04);
    vec3 f90 = vec3(1.0);
    // Note: clearcoat Fresnel computed with dot(n, v) instead of dot(v, h).
    // This is to make it energy conserving with a simple layering function.
    float NdotV = clamp(dot(normal, viewDirection), 0.0, 1.0);
    vec3 F = fresnelSchlick2(f0, f90, NdotV);

    // compute specular reflection from direct lighting
    float roughness = material.clearcoatRoughness;
    float alphaRoughness = roughness * roughness;
    float directStrength = computeDirectSpecularStrength(normal, lightDirection, viewDirection, halfwayDirection, alphaRoughness);
    vec3 directReflection = F * directStrength * NdotL;
    vec3 color = lightColorHdr * directReflection;

    #ifdef SPECULAR_IBL
        // Find the direction in which to sample the environment map
        vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflect(-viewDirection, normal));
        vec3 iblColor = computeSpecularIBL(reflectMC, NdotV, f0, roughness);
        color += iblColor * material.occlusion;
    #elif defined(USE_IBL_LIGHTING)
        vec3 positionWC = vec3(czm_inverseView * vec4(position, 1.0));
        vec3 reflectionWC = normalize(czm_inverseViewRotation * reflect(viewDirection, normal));
        vec3 skyMetrics = getProceduralSkyMetrics(positionWC, reflectionWC);

        vec3 specularIrradiance = getProceduralSpecularIrradiance(reflectionWC, skyMetrics, roughness);
        vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg;
        vec3 specularColor = czm_srgbToLinear(f0 * brdfLut.x + brdfLut.y);
        vec3 iblColor = specularIrradiance * specularColor * model_iblFactor.y;
        #ifdef USE_SUN_LUMINANCE
            iblColor *= getSunLuminance(positionWC, normal, lightDirection);
        #endif
        float maximumComponent = czm_maximumComponent(lightColorHdr);
        vec3 clampedLightColor = lightColorHdr / max(maximumComponent, 1.0);
        color += clampedLightColor * iblColor * material.occlusion;
    #endif

    float clearcoatFactor = material.clearcoatFactor;
    vec3 clearcoatColor = color * clearcoatFactor;

    // Dim base layer based on transmission loss through clearcoat
    return baseLayerColor * (1.0 - clearcoatFactor * F) + clearcoatColor;
}
#endif

#if defined(LIGHTING_PBR) && defined(HAS_NORMALS)
vec3 computePbrLighting(in czm_modelMaterial material, in vec3 position)
{
    #ifdef USE_CUSTOM_LIGHT_COLOR
        vec3 lightColorHdr = model_lightColorHdr;
    #else
        vec3 lightColorHdr = czm_lightColorHdr;
    #endif

    vec3 viewDirection = -normalize(position);
    vec3 normal = material.normalEC;
    vec3 lightDirection = normalize(czm_lightDirectionEC);

    vec3 directLighting = czm_pbrLighting(viewDirection, normal, lightDirection, material);
    vec3 directColor = lightColorHdr * directLighting;

    // Accumulate colors from base layer
    vec3 color = directColor + material.emissive;
    #ifdef USE_IBL_LIGHTING
        color += computeIBL(position, normal, lightDirection, lightColorHdr, material);
    #endif

    #ifdef USE_CLEARCOAT
        color = addClearcoatReflection(color, position, lightDirection, lightColorHdr, material);
    #endif

    return color;
}
#endif

/**
 * Compute the material color under the current lighting conditions.
 * All other material properties are passed through so further stages
 * have access to them.
 *
 * @param {czm_modelMaterial} material The material properties from {@MaterialStageFS}
 * @param {ProcessedAttributes} attributes
 */
void lightingStage(inout czm_modelMaterial material, ProcessedAttributes attributes)
{
    #ifdef LIGHTING_PBR
        #ifdef HAS_NORMALS
            vec3 color = computePbrLighting(material, attributes.positionEC);
        #else
            vec3 color = material.diffuse * material.occlusion + material.emissive;
        #endif
        // 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_pbrNeutralTonemapping(color);
        #endif
    #else // unlit
        vec3 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 BLn=T(S(),1),H3e={UNLIT:0,PBR:1},af=Object.freeze(H3e);var qse={name:"LightingPipelineStage"};qse.process=function(e,t){let{model:n,lightingOptions:i,shaderBuilder:o}=e;if(l(n.lightColor)){o.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,ye.FRAGMENT),o.addUniform("vec3","model_lightColorHdr",ye.FRAGMENT);let s=e.uniformMap;s.model_lightColorHdr=function(){return n.lightColor}}let{lightingModel:r}=i;r===af.PBR?o.addDefine("LIGHTING_PBR",void 0,ye.FRAGMENT):o.addDefine("LIGHTING_UNLIT",void 0,ye.FRAGMENT),o.addFragmentLines(hW)};var fW=qse;var mRn=T(S(),1);var jLn=T(S(),1),pW=`// 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_NORMAL_TEXTURE
vec2 getNormalTexCoords()
{
    vec2 texCoord = TEXCOORD_NORMAL;
    #ifdef HAS_NORMAL_TEXTURE_TRANSFORM
        texCoord = vec2(u_normalTextureTransform * vec3(texCoord, 1.0));
    #endif
    return texCoord;
}
#endif

#if defined(HAS_NORMAL_TEXTURE) || defined(HAS_CLEARCOAT_NORMAL_TEXTURE)
vec3 computeTangent(in vec3 position, in vec2 normalTexCoords)
{
    vec2 tex_dx = dFdx(normalTexCoords);
    vec2 tex_dy = dFdy(normalTexCoords);
    float determinant = tex_dx.x * tex_dy.y - tex_dy.x * tex_dx.y;
    vec3 tangent = tex_dy.t * dFdx(position) - tex_dx.t * dFdy(position);
    return tangent / determinant;
}
#endif

#ifdef USE_ANISOTROPY
struct NormalInfo {
    vec3 tangent;
    vec3 bitangent;
    vec3 normal;
    vec3 geometryNormal;
};

NormalInfo getNormalInfo(ProcessedAttributes attributes)
{
    vec3 geometryNormal = attributes.normalEC;
    #ifdef HAS_NORMAL_TEXTURE
        vec2 normalTexCoords = getNormalTexCoords();
    #endif

    #ifdef HAS_BITANGENTS
        vec3 tangent = attributes.tangentEC;
        vec3 bitangent = attributes.bitangentEC;
    #else // Assume HAS_NORMAL_TEXTURE
        vec3 tangent = computeTangent(attributes.positionEC, normalTexCoords);
        tangent = normalize(tangent - geometryNormal * dot(geometryNormal, tangent));
        vec3 bitangent = normalize(cross(geometryNormal, tangent));
    #endif

    #ifdef HAS_NORMAL_TEXTURE
        mat3 tbn = mat3(tangent, bitangent, geometryNormal);
        vec3 normalSample = texture(u_normalTexture, normalTexCoords).rgb;
        normalSample = 2.0 * normalSample - 1.0;
        #ifdef HAS_NORMAL_TEXTURE_SCALE
            normalSample.xy *= u_normalTextureScale;
        #endif
        vec3 normal = normalize(tbn * normalSample);
    #else
        vec3 normal = geometryNormal;
    #endif

    #ifdef HAS_DOUBLE_SIDED_MATERIAL
        if (czm_backFacing()) {
            tangent *= -1.0;
            bitangent *= -1.0;
            normal *= -1.0;
            geometryNormal *= -1.0;
        }
    #endif

    NormalInfo normalInfo;
    normalInfo.tangent = tangent;
    normalInfo.bitangent = bitangent;
    normalInfo.normal = normal;
    normalInfo.geometryNormal = geometryNormal;

    return normalInfo;
}
#endif

#if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME)
vec3 getNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal)
{
    vec2 normalTexCoords = getNormalTexCoords();

    // If HAS_BITANGENTS is set, then HAS_TANGENTS is also set
    #ifdef HAS_BITANGENTS
        vec3 t = attributes.tangentEC;
        vec3 b = attributes.bitangentEC;
    #else
        vec3 t = computeTangent(attributes.positionEC, normalTexCoords);
        t = normalize(t - geometryNormal * dot(geometryNormal, t));
        vec3 b = normalize(cross(geometryNormal, t));
    #endif

    mat3 tbn = mat3(t, b, geometryNormal);
    vec3 normalSample = texture(u_normalTexture, normalTexCoords).rgb;
    normalSample = 2.0 * normalSample - 1.0;
    #ifdef HAS_NORMAL_TEXTURE_SCALE
        normalSample.xy *= u_normalTextureScale;
    #endif
    return normalize(tbn * normalSample);
}
#endif

#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE
vec3 getClearcoatNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal)
{
    vec2 normalTexCoords = TEXCOORD_CLEARCOAT_NORMAL;
    #ifdef HAS_CLEARCOAT_NORMAL_TEXTURE_TRANSFORM
        normalTexCoords = vec2(u_clearcoatNormalTextureTransform * vec3(normalTexCoords, 1.0));
    #endif

    // If HAS_BITANGENTS is set, then HAS_TANGENTS is also set
    #ifdef HAS_BITANGENTS
        vec3 t = attributes.tangentEC;
        vec3 b = attributes.bitangentEC;
    #else
        vec3 t = computeTangent(attributes.positionEC, normalTexCoords);
        t = normalize(t - geometryNormal * dot(geometryNormal, t));
        vec3 b = normalize(cross(geometryNormal, t));
    #endif

    mat3 tbn = mat3(t, b, geometryNormal);
    vec3 normalSample = texture(u_clearcoatNormalTexture, normalTexCoords).rgb;
    normalSample = 2.0 * normalSample - 1.0;
    #ifdef HAS_CLEARCOAT_NORMAL_TEXTURE_SCALE
        normalSample.xy *= u_clearcoatNormalTextureScale;
    #endif
    return normalize(tbn * normalSample);
}
#endif

#ifdef HAS_NORMALS
vec3 computeNormal(ProcessedAttributes attributes)
{
    // Geometry normal. This is already normalized 
    vec3 normal = attributes.normalEC;

    #if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME)
        normal = getNormalFromTexture(attributes, normal);
    #endif

    #ifdef HAS_DOUBLE_SIDED_MATERIAL
        if (czm_backFacing()) {
            normal = -normal;
        }
    #endif

    return normal;
}
#endif

#ifdef HAS_BASE_COLOR_TEXTURE
vec4 getBaseColorFromTexture()
{
    vec2 baseColorTexCoords = TEXCOORD_BASE_COLOR;
    #ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM
        baseColorTexCoords = computeTextureTransform(baseColorTexCoords, u_baseColorTextureTransform);
    #endif

    vec4 baseColorWithAlpha = czm_srgbToLinear(texture(u_baseColorTexture, baseColorTexCoords));

    #ifdef HAS_BASE_COLOR_FACTOR
        baseColorWithAlpha *= u_baseColorFactor;
    #endif

    return baseColorWithAlpha;
}
#endif

#ifdef HAS_EMISSIVE_TEXTURE
vec3 getEmissiveFromTexture()
{
    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

    return emissive;
}
#endif

#if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS)
void setSpecularGlossiness(inout czm_modelMaterial material)
{
    #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_LEGACY_SPECULAR_FACTOR
            specular *= u_legacySpecularFactor;
        #endif

        #ifdef HAS_GLOSSINESS_FACTOR
            glossiness *= u_glossinessFactor;
        #endif
    #else
        #ifdef HAS_LEGACY_SPECULAR_FACTOR
            vec3 specular = clamp(u_legacySpecularFactor, 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

    material.diffuse = diffuse.rgb * (1.0 - czm_maximumComponent(specular));
    // the specular glossiness extension's alpha overrides anything set
    // by the base material.
    material.alpha = diffuse.a;

    material.specular = specular;

    // glossiness is the opposite of roughness, but easier for artists to use.
    material.roughness = 1.0 - glossiness;
}
#elif defined(LIGHTING_PBR)
float setMetallicRoughness(inout czm_modelMaterial material)
{
    #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.0, 1.0);
        #ifdef HAS_METALLIC_FACTOR
            metalness = clamp(metalness * u_metallicFactor, 0.0, 1.0);
        #endif

        #ifdef HAS_ROUGHNESS_FACTOR
            roughness = clamp(roughness * u_roughnessFactor, 0.0, 1.0);
        #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.0, 1.0);
        #else
            float roughness = 1.0;
        #endif
    #endif

    // dielectrics use f0 = 0.04, metals use albedo as f0
    const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04);
    vec3 f0 = mix(REFLECTANCE_DIELECTRIC, material.baseColor.rgb, metalness);

    material.specular = f0;

    // diffuse only applies to dielectrics.
    material.diffuse = mix(material.baseColor.rgb, vec3(0.0), metalness);

    // This is perceptual roughness. The square of this value is used for direct lighting
    material.roughness = roughness;

    return metalness;
}
#ifdef USE_SPECULAR
void setSpecular(inout czm_modelMaterial material, in float metalness)
{
    #ifdef HAS_SPECULAR_TEXTURE
        vec2 specularTexCoords = TEXCOORD_SPECULAR;
        #ifdef HAS_SPECULAR_TEXTURE_TRANSFORM
            specularTexCoords = computeTextureTransform(specularTexCoords, u_specularTextureTransform);
        #endif
        float specularWeight = texture(u_specularTexture, specularTexCoords).a;
        #ifdef HAS_SPECULAR_FACTOR
            specularWeight *= u_specularFactor;
        #endif
    #else
        #ifdef HAS_SPECULAR_FACTOR
            float specularWeight = u_specularFactor;
        #else
            float specularWeight = 1.0;
        #endif
    #endif

    #ifdef HAS_SPECULAR_COLOR_TEXTURE
        vec2 specularColorTexCoords = TEXCOORD_SPECULAR_COLOR;
        #ifdef HAS_SPECULAR_COLOR_TEXTURE_TRANSFORM
            specularColorTexCoords = computeTextureTransform(specularColorTexCoords, u_specularColorTextureTransform);
        #endif
        vec3 specularColorSample = texture(u_specularColorTexture, specularColorTexCoords).rgb;
        vec3 specularColorFactor = czm_srgbToLinear(specularColorSample);
        #ifdef HAS_SPECULAR_COLOR_FACTOR
            specularColorFactor *= u_specularColorFactor;
        #endif
    #else
        #ifdef HAS_SPECULAR_COLOR_FACTOR
            vec3 specularColorFactor = u_specularColorFactor;
        #else
            vec3 specularColorFactor = vec3(1.0);
        #endif
    #endif
    material.specularWeight = specularWeight;
    vec3 f0 = material.specular;
    vec3 dielectricSpecularF0 = min(f0 * specularColorFactor, vec3(1.0));
    material.specular = mix(dielectricSpecularF0, material.baseColor.rgb, metalness);
}
#endif
#ifdef USE_ANISOTROPY
void setAnisotropy(inout czm_modelMaterial material, in NormalInfo normalInfo)
{
    mat2 rotation = mat2(u_anisotropy.xy, -u_anisotropy.y, u_anisotropy.x);
    float anisotropyStrength = u_anisotropy.z;

    vec2 direction = vec2(1.0, 0.0);
    #ifdef HAS_ANISOTROPY_TEXTURE
        vec2 anisotropyTexCoords = TEXCOORD_ANISOTROPY;
        #ifdef HAS_ANISOTROPY_TEXTURE_TRANSFORM
            anisotropyTexCoords = computeTextureTransform(anisotropyTexCoords, u_anisotropyTextureTransform);
        #endif
        vec3 anisotropySample = texture(u_anisotropyTexture, anisotropyTexCoords).rgb;
        direction = anisotropySample.rg * 2.0 - vec2(1.0);
        anisotropyStrength *= anisotropySample.b;
    #endif

    direction = rotation * direction;
    mat3 tbn = mat3(normalInfo.tangent, normalInfo.bitangent, normalInfo.normal);
    vec3 anisotropicT = tbn * normalize(vec3(direction, 0.0));
    vec3 anisotropicB = cross(normalInfo.geometryNormal, anisotropicT);

    material.anisotropicT = anisotropicT;
    material.anisotropicB = anisotropicB;
    material.anisotropyStrength = anisotropyStrength;
}
#endif
#ifdef USE_CLEARCOAT
void setClearcoat(inout czm_modelMaterial material, in ProcessedAttributes attributes)
{
    #ifdef HAS_CLEARCOAT_TEXTURE
        vec2 clearcoatTexCoords = TEXCOORD_CLEARCOAT;
        #ifdef HAS_CLEARCOAT_TEXTURE_TRANSFORM
            clearcoatTexCoords = computeTextureTransform(clearcoatTexCoords, u_clearcoatTextureTransform);
        #endif
        float clearcoatFactor = texture(u_clearcoatTexture, clearcoatTexCoords).r;
        #ifdef HAS_CLEARCOAT_FACTOR
            clearcoatFactor *= u_clearcoatFactor;
        #endif
    #else
        #ifdef HAS_CLEARCOAT_FACTOR
            float clearcoatFactor = u_clearcoatFactor;
        #else
            // PERFORMANCE_IDEA: this case should turn the whole extension off
            float clearcoatFactor = 0.0;
        #endif
    #endif

    #ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE
        vec2 clearcoatRoughnessTexCoords = TEXCOORD_CLEARCOAT_ROUGHNESS;
        #ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE_TRANSFORM
            clearcoatRoughnessTexCoords = computeTextureTransform(clearcoatRoughnessTexCoords, u_clearcoatRoughnessTextureTransform);
        #endif
        float clearcoatRoughness = texture(u_clearcoatRoughnessTexture, clearcoatRoughnessTexCoords).g;
        #ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR
            clearcoatRoughness *= u_clearcoatRoughnessFactor;
        #endif
    #else
        #ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR
            float clearcoatRoughness = u_clearcoatRoughnessFactor;
        #else
            float clearcoatRoughness = 0.0;
        #endif
    #endif

    material.clearcoatFactor = clearcoatFactor;
    // This is perceptual roughness. The square of this value is used for direct lighting
    material.clearcoatRoughness = clearcoatRoughness;
    #ifdef HAS_CLEARCOAT_NORMAL_TEXTURE
        material.clearcoatNormal = getClearcoatNormalFromTexture(attributes, attributes.normalEC);
    #else
        material.clearcoatNormal = attributes.normalEC;
    #endif
}
#endif
#endif

void materialStage(inout czm_modelMaterial material, ProcessedAttributes attributes, SelectedFeature feature)
{
    #ifdef USE_ANISOTROPY
        NormalInfo normalInfo = getNormalInfo(attributes);
        material.normalEC = normalInfo.normal;
    #elif defined(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
        baseColorWithAlpha = getBaseColorFromTexture();
    #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

    #ifdef USE_CPU_STYLING
        baseColorWithAlpha.rgb = blend(baseColorWithAlpha.rgb, feature.color.rgb, model_colorBlend);
    #endif
    material.baseColor = baseColorWithAlpha;
    material.diffuse = baseColorWithAlpha.rgb;
    material.alpha = baseColorWithAlpha.a;

    #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
        material.emissive = getEmissiveFromTexture();
    #elif defined(HAS_EMISSIVE_FACTOR)
        material.emissive = u_emissiveFactor;
    #endif

    #if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS)
        setSpecularGlossiness(material);
    #elif defined(LIGHTING_PBR)
        float metalness = setMetallicRoughness(material);
        #ifdef USE_SPECULAR
            setSpecular(material, metalness);
        #endif
        #ifdef USE_ANISOTROPY
            setAnisotropy(material, normalInfo);
        #endif
        #ifdef USE_CLEARCOAT
            setClearcoat(material, attributes);
        #endif
    #endif
}
`;var{Material:z3e,MetallicRoughness:oz,SpecularGlossiness:rz,Specular:$se,Clearcoat:eae}=Tn,tae={name:"MaterialPipelineStage",_processTexture:Pl,_processTextureTransform:nae};tae.process=function(e,t,n){let i=t.material,{model:o,uniformMap:r,shaderBuilder:s}=e,a=l(o.classificationType),c=a,{defaultTexture:d,defaultNormalTexture:u,defaultEmissiveTexture:m}=n.context;J3e(i,r,s,d,u,m,c),l(i.specularGlossiness)?Q3e(i.specularGlossiness,r,s,d,c):(l(i.specular)&&jt.supportedExtensions.KHR_materials_specular&&j3e(i.specular,r,s,d,c),l(i.anisotropy)&&jt.supportedExtensions.KHR_materials_anisotropy&&$3e(i.anisotropy,r,s,d,c),l(i.clearcoat)&&jt.supportedExtensions.KHR_materials_clearcoat&&eBe(i.clearcoat,r,s,d,c),tBe(i.metallicRoughness,r,s,d,c));let p=jt.getAttributeBySemantic(t,St.NORMAL),g=e.lightingOptions;i.unlit||!p||a?g.lightingModel=af.UNLIT:g.lightingModel=af.PBR;let f=o.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=f;let x=e.alphaOptions;i.alphaMode===of.BLEND?x.pass=Re.TRANSLUCENT:i.alphaMode===of.MASK&&(x.alphaCutoff=i.alphaCutoff),s.addFragmentLines(pW),i.doubleSided&&s.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,ye.BOTH)};function nae(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_TRANSFORM`;e.addDefine(r,void 0,ye.FRAGMENT);let s=`${i}Transform`;e.addUniform("mat3",s,ye.FRAGMENT),t[s]=function(){return n.transform}}function K3e(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_SCALE`;e.addDefine(r,void 0,ye.FRAGMENT);let s=`${i}Scale`;e.addUniform("float",s,ye.FRAGMENT),t[s]=function(){return n.scale}}function Pl(e,t,n,i,o,r){e.addUniform("sampler2D",i,ye.FRAGMENT),t[i]=function(){return y(n.texture,r)};let s=`HAS_${o}_TEXTURE`;e.addDefine(s,void 0,ye.FRAGMENT);let c=`v_texCoord_${n.texCoord}`,d=`TEXCOORD_${o}`;e.addDefine(d,c,ye.FRAGMENT);let u=n.transform;l(u)&&!$.equals(u,$.IDENTITY)&&nae(e,t,n,i,o);let{scale:m}=n;l(m)&&m!==1&&K3e(e,t,n,i,o)}function J3e(e,t,n,i,o,r,s){let{emissiveFactor:a,emissiveTexture:c,normalTexture:d,occlusionTexture:u}=e;l(a)&&!h.equals(a,z3e.DEFAULT_EMISSIVE_FACTOR)&&(n.addUniform("vec3","u_emissiveFactor",ye.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},n.addDefine("HAS_EMISSIVE_FACTOR",void 0,ye.FRAGMENT),l(c)&&!s&&Pl(n,t,c,"u_emissiveTexture","EMISSIVE",r)),l(d)&&!s&&Pl(n,t,d,"u_normalTexture","NORMAL",o),l(u)&&!s&&Pl(n,t,u,"u_occlusionTexture","OCCLUSION",i)}function Q3e(e,t,n,i,o){let{diffuseTexture:r,diffuseFactor:s,specularGlossinessTexture:a,specularFactor:c,glossinessFactor:d}=e;n.addDefine("USE_SPECULAR_GLOSSINESS",void 0,ye.FRAGMENT),l(r)&&!o&&Pl(n,t,r,"u_diffuseTexture","DIFFUSE",i),l(s)&&!se.equals(s,rz.DEFAULT_DIFFUSE_FACTOR)&&(n.addUniform("vec4","u_diffuseFactor",ye.FRAGMENT),t.u_diffuseFactor=function(){return e.diffuseFactor},n.addDefine("HAS_DIFFUSE_FACTOR",void 0,ye.FRAGMENT)),l(a)&&!o&&Pl(n,t,a,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i),l(c)&&!h.equals(c,rz.DEFAULT_SPECULAR_FACTOR)&&(n.addUniform("vec3","u_legacySpecularFactor",ye.FRAGMENT),t.u_legacySpecularFactor=function(){return e.specularFactor},n.addDefine("HAS_LEGACY_SPECULAR_FACTOR",void 0,ye.FRAGMENT)),l(d)&&d!==rz.DEFAULT_GLOSSINESS_FACTOR&&(n.addUniform("float","u_glossinessFactor",ye.FRAGMENT),t.u_glossinessFactor=function(){return e.glossinessFactor},n.addDefine("HAS_GLOSSINESS_FACTOR",void 0,ye.FRAGMENT))}function j3e(e,t,n,i,o){let{specularTexture:r,specularFactor:s,specularColorTexture:a,specularColorFactor:c}=e;n.addDefine("USE_SPECULAR",void 0,ye.FRAGMENT),l(r)&&!o&&Pl(n,t,r,"u_specularTexture","SPECULAR",i),l(s)&&s!==$se.DEFAULT_SPECULAR_FACTOR&&(n.addUniform("float","u_specularFactor",ye.FRAGMENT),t.u_specularFactor=function(){return e.specularFactor},n.addDefine("HAS_SPECULAR_FACTOR",void 0,ye.FRAGMENT)),l(a)&&!o&&Pl(n,t,a,"u_specularColorTexture","SPECULAR_COLOR",i),l(c)&&!h.equals(c,$se.DEFAULT_SPECULAR_COLOR_FACTOR)&&(n.addUniform("vec3","u_specularColorFactor",ye.FRAGMENT),t.u_specularColorFactor=function(){return e.specularColorFactor},n.addDefine("HAS_SPECULAR_COLOR_FACTOR",void 0,ye.FRAGMENT))}var q3e=new h;function $3e(e,t,n,i,o){let{anisotropyStrength:r,anisotropyRotation:s,anisotropyTexture:a}=e;n.addDefine("USE_ANISOTROPY",void 0,ye.FRAGMENT),l(a)&&!o&&Pl(n,t,a,"u_anisotropyTexture","ANISOTROPY",i);let c=Math.cos(s),d=Math.sin(s);n.addUniform("vec3","u_anisotropy",ye.FRAGMENT),t.u_anisotropy=function(){return h.fromElements(c,d,r,q3e)}}function eBe(e,t,n,i,o){let{clearcoatFactor:r,clearcoatTexture:s,clearcoatRoughnessFactor:a,clearcoatRoughnessTexture:c,clearcoatNormalTexture:d}=e;n.addDefine("USE_CLEARCOAT",void 0,ye.FRAGMENT),l(r)&&r!==eae.DEFAULT_CLEARCOAT_FACTOR&&(n.addUniform("float","u_clearcoatFactor",ye.FRAGMENT),t.u_clearcoatFactor=function(){return e.clearcoatFactor},n.addDefine("HAS_CLEARCOAT_FACTOR",void 0,ye.FRAGMENT)),l(s)&&!o&&Pl(n,t,s,"u_clearcoatTexture","CLEARCOAT",i),l(a)&&r!==eae.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_clearcoatRoughnessFactor",ye.FRAGMENT),t.u_clearcoatRoughnessFactor=function(){return e.clearcoatRoughnessFactor},n.addDefine("HAS_CLEARCOAT_ROUGHNESS_FACTOR",void 0,ye.FRAGMENT)),l(c)&&!o&&Pl(n,t,c,"u_clearcoatRoughnessTexture","CLEARCOAT_ROUGHNESS",i),l(d)&&!o&&Pl(n,t,d,"u_clearcoatNormalTexture","CLEARCOAT_NORMAL",i)}function tBe(e,t,n,i,o){n.addDefine("USE_METALLIC_ROUGHNESS",void 0,ye.FRAGMENT);let r=e.baseColorTexture;l(r)&&!o&&Pl(n,t,r,"u_baseColorTexture","BASE_COLOR",i);let s=e.baseColorFactor;l(s)&&!se.equals(s,oz.DEFAULT_BASE_COLOR_FACTOR)&&(n.addUniform("vec4","u_baseColorFactor",ye.FRAGMENT),t.u_baseColorFactor=function(){return e.baseColorFactor},n.addDefine("HAS_BASE_COLOR_FACTOR",void 0,ye.FRAGMENT));let a=e.metallicRoughnessTexture;l(a)&&!o&&Pl(n,t,a,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let c=e.metallicFactor;l(c)&&c!==oz.DEFAULT_METALLIC_FACTOR&&(n.addUniform("float","u_metallicFactor",ye.FRAGMENT),t.u_metallicFactor=function(){return e.metallicFactor},n.addDefine("HAS_METALLIC_FACTOR",void 0,ye.FRAGMENT));let d=e.roughnessFactor;l(d)&&d!==oz.DEFAULT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_roughnessFactor",ye.FRAGMENT),t.u_roughnessFactor=function(){return e.roughnessFactor},n.addDefine("HAS_ROUGHNESS_FACTOR",void 0,ye.FRAGMENT))}var bW=tae;var SRn=T(S(),1);var fRn=T(S(),1),gW=`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 Wa={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)"};Wa.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,ye.VERTEX),aBe(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!==St.POSITION&&p!==St.NORMAL&&p!==St.TANGENT||(iBe(e,m,e.attributeIndex,a),e.attributeIndex++)}}cBe(n);let r=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${r}]`,ye.VERTEX),n.addVertexLines(gW);let s={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=_t(s,e.uniformMap)};var nBe={attributeString:void 0,functionId:void 0};function iBe(e,t,n,i){let o=e.shaderBuilder;oBe(e,t,n);let r=rBe(t,nBe);sBe(o,r,i)}function oBe(e,t,n){let i={index:n,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,componentsPerAttribute:on.getNumberOfComponents(t.type),componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(i)}function rBe(e,t){switch(e.semantic){case St.POSITION:t.attributeString="Position",t.functionId=Wa.FUNCTION_ID_GET_MORPHED_POSITION;break;case St.NORMAL:t.attributeString="Normal",t.functionId=Wa.FUNCTION_ID_GET_MORPHED_NORMAL;break;case St.TANGENT:t.attributeString="Tangent",t.functionId=Wa.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function sBe(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 aBe(e){e.addFunction(Wa.FUNCTION_ID_GET_MORPHED_POSITION,Wa.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,ye.VERTEX),e.addFunctionLines(Wa.FUNCTION_ID_GET_MORPHED_POSITION,["vec3 morphedPosition = position;"]),e.addFunction(Wa.FUNCTION_ID_GET_MORPHED_NORMAL,Wa.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,ye.VERTEX),e.addFunctionLines(Wa.FUNCTION_ID_GET_MORPHED_NORMAL,["vec3 morphedNormal = normal;"]),e.addFunction(Wa.FUNCTION_ID_GET_MORPHED_TANGENT,Wa.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,ye.VERTEX),e.addFunctionLines(Wa.FUNCTION_ID_GET_MORPHED_TANGENT,["vec3 morphedTangent = tangent;"])}function cBe(e){e.addFunctionLines(Wa.FUNCTION_ID_GET_MORPHED_POSITION,["return morphedPosition;"]),e.addFunctionLines(Wa.FUNCTION_ID_GET_MORPHED_NORMAL,["return morphedNormal;"]),e.addFunctionLines(Wa.FUNCTION_ID_GET_MORPHED_TANGENT,["return morphedTangent;"])}var yW=Wa;var PRn=T(S(),1);var iae={name:"PickingPipelineStage"};iae.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)lBe(e,t,a,i);else if(l(a))dBe(e,i);else{let c=oae(e),d=i.createPickId(c);s._pipelineResources.push(d),s._pickIds.push(d),r.addUniform("vec4","czm_pickColor",ye.FRAGMENT);let u=e.uniformMap;u.czm_pickColor=function(){return d.color},e.pickId="czm_pickColor"}};function oae(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(rr.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 lBe(e,t,n){let i=e.model,o,r,s=i.featureIdLabel,a=i.instanceFeatureIdLabel;l(i.featureTableId)?o=i.featureTableId:l(n)?(r=jt.getFeatureIdsByLabel(n.featureIds,a),o=r.propertyTableId):(r=jt.getFeatureIdsByLabel(t.featureIds,s),o=r.propertyTableId);let c=i.featureTables[o];e.shaderBuilder.addUniform("sampler2D","model_pickTexture",ye.FRAGMENT);let u=c.batchTexture;e.uniformMap.model_pickTexture=function(){return y(u.pickTexture,u.defaultTexture)},e.pickId="((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))"}function dBe(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=oae(e,m),g=t.createPickId(p);s.push(g),i[m]=g;let f=g.color;o[m*4+0]=Y.floatToByte(f.red),o[m*4+1]=Y.floatToByte(f.green),o[m*4+2]=Y.floatToByte(f.blue),o[m*4+3]=Y.floatToByte(f.alpha)}r._pickIds=i;let a=yt.createVertexBuffer({context:t,typedArray:o,usage:Me.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,ye.BOTH),u.addAttribute("vec4","a_pickColor"),u.addVarying("vec4","v_pickColor"),e.pickId="v_pickColor"}var xW=iae;var nZn=T(S(),1);var wRn=T(S(),1),uBe={ADD:0,REPLACE:1},Mo=Object.freeze(uBe);var ARn=T(S(),1),_W=`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 mBe=new se,sae={name:"PointCloudStylingPipelineStage"};sae.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=bBe(a),_=gBe(r,x);yBe(i,_);let V=xBe(_).indexOf("normalMC")>=0,L=jt.getAttributeBySemantic(t,St.NORMAL);if(V&&!L)throw new ue("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,ye.VERTEX),_.styleTranslucent&&(e.alphaOptions.pass=Re.TRANSLUCENT)}let u=o.pointCloudShading;u.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,ye.VERTEX),u.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,ye.VERTEX);let m,p,g;rr.is3DTiles(o.type)&&(p=!0,m=o.content,g=m.tile.refine===Mo.ADD),i.addUniform("vec4","model_pointCloudParameters",ye.VERTEX),i.addVertexLines(_W);let f=e.uniformMap;f.model_pointCloudParameters=function(){let x=mBe,_=1;p&&(_=g?5:m.tileset.memoryAdjustedScreenSpaceError),x.x=y(u.maximumAttenuation,_),x.x*=n.pixelRatio;let C=hBe(e,t,u,m);x.y=C*u.geometricErrorScale;let V=n.context,L=n.camera.frustum,Z;return n.mode===oe.SCENE2D||L instanceof sn?Z=Number.POSITIVE_INFINITY:Z=V.drawingBufferHeight/n.camera.frustum.sseDenominator,x.z=Z,p&&(x.w=m.tileset.timeSinceLoad),x}};var rae=new h;function hBe(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=jt.getAttributeBySemantic(t,St.POSITION),r=o.count,s=e.runtimeNode.transform,a=h.subtract(o.max,o.min,rae);a=F.multiplyByPointAsVector(s,a,rae);let c=a.x*a.y*a.z;return W.cbrt(c/r)}var fBe={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},pBe={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function bBe(e){let t=Ye(pBe);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 sz="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function gBe(e,t){let n=fBe,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${sz})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${sz})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${sz})`,t,i),n.styleTranslucent=l(n.colorStyleFunction)&&i.translucent,n}function yBe(e,t){let n=t.colorStyleFunction;l(n)&&(e.addDefine("HAS_POINT_CLOUD_COLOR_STYLE",void 0,ye.BOTH),e.addVertexLines(n),e.addVarying("vec4","v_pointCloudColor"));let i=t.showStyleFunction;l(i)&&(e.addDefine("HAS_POINT_CLOUD_SHOW_STYLE",void 0,ye.VERTEX),e.addVertexLines(i));let o=t.pointSizeStyleFunction;l(o)&&(e.addDefine("HAS_POINT_CLOUD_POINT_SIZE_STYLE",void 0,ye.VERTEX),e.addVertexLines(o))}function az(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 xBe(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,o=[];return l(t)&&az(t,o),l(n)&&az(n,o),l(i)&&az(i,o),o}var TW=sae;var hZn=T(S(),1);var oZn=T(S(),1),SW=`void primitiveOutlineStage() {
    v_outlineCoordinates = a_outlineCoordinates;
}
`;var sZn=T(S(),1),CW=`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 aae={name:"PrimitiveOutlinePipelineStage"};aae.process=function(e,t,n){let i=e.shaderBuilder,o=e.uniformMap;i.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,ye.BOTH),i.addAttribute("vec3","a_outlineCoordinates"),i.addVarying("vec3","v_outlineCoordinates");let r=t.outlineCoordinates,s={index:e.attributeIndex++,vertexBuffer:r.buffer,componentsPerAttribute:on.getNumberOfComponents(r.type),componentDatatype:r.componentDatatype,offsetInBytes:r.byteOffset,strideInBytes:r.byteStride,normalize:r.normalized};e.attributes.push(s),i.addUniform("sampler2D","model_outlineTexture",ye.FRAGMENT);let a=c_.createTexture(n.context);o.model_outlineTexture=function(){return a};let c=e.model;i.addUniform("vec4","model_outlineColor",ye.FRAGMENT),o.model_outlineColor=function(){return c.outlineColor},i.addUniform("bool","model_showOutline",ye.FRAGMENT),o.model_showOutline=function(){return c.showOutline},i.addVertexLines(SW),i.addFragmentLines(CW)};var VW=aae;var xZn=T(S(),1);var cae={name:"PrimitiveStatisticsPipelineStage",_countGeometry:lae,_count2DPositions:dae,_countMorphTargetAttributes:uae,_countMaterialTextures:mae,_countFeatureIdTextures:hae,_countBinaryMetadata:fae};cae.process=function(e,t,n){let i=e.model,o=i.statistics;lae(o,t),dae(o,e.runtimePrimitive),uae(o,t),mae(o,t.material),hae(o,t.featureIds),fae(o,i)};function lae(e,t){let n=l(t.indices)?t.indices.count:jt.getAttributeBySemantic(t,"POSITION").count,i=t.primitiveType;i===Fe.POINTS?e.pointsLength+=n:Fe.isTriangles(i)&&(e.trianglesLength+=_Be(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 _Be(e,t){switch(e){case Fe.TRIANGLES:return t/3;case Fe.TRIANGLE_STRIP:case Fe.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function dae(e,t){let n=t.positionBuffer2D;l(n)&&e.addBuffer(n,!0)}function uae(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 mae(e,t){let n=TBe(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 TBe(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 hae(e,t){let n=t.length;for(let i=0;i<n;i++){let o=t[i];if(o instanceof Tn.FeatureIdTexture){let r=o.textureReader;l(r.texture)&&e.addTexture(r.texture)}}}function fae(e,t){let n=t.structuralMetadata;l(n)&&(SBe(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 SBe(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 LW=cae;var vZn=T(S(),1);var CBe=new F,VBe=new F,pae={name:"SceneMode2DPipelineStage"};pae.process=function(e,t,n){let i=jt.getAttributeBySemantic(t,St.POSITION),o=e.shaderBuilder,r=e.model,s=r.sceneGraph.computedModelMatrix,a=e.runtimeNode.computedTransform,c=F.multiplyTransformation(s,a,CBe),d=ZBe(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=XBe(i,c,d,n);u.positionBuffer2D=x,r._modelResources.push(x),i.typedArray=void 0}o.addDefine("USE_2D_POSITIONS",void 0,ye.VERTEX),o.addUniform("mat4","u_modelView2D",ye.VERTEX);let p=F.fromTranslation(d.center,new F),g=n.context,f={u_modelView2D:function(){return F.multiplyTransformation(g.uniformState.view,p,VBe)}};e.uniformMap=_t(f,e.uniformMap)};var LBe=new h,RBe=new h;function ZBe(e,t,n){let i=F.multiplyByPoint(t,e.positionMin,LBe),o=Yi.computeActualEllipsoidPosition(n,i,i),r=F.multiplyByPoint(t,e.positionMax,RBe),s=Yi.computeActualEllipsoidPosition(n,r,r);return ce.fromCornerPoints(o,s,new ce)}var bae=new h;function GBe(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,bae),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 EBe(e,t,n,i){let o;l(e.quantization)?o=GBe(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,bae);if(isNaN(d.x)||isNaN(d.y)||isNaN(d.z))continue;let u=F.multiplyByPoint(t,d,d),m=Yi.computeActualEllipsoidPosition(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 XBe(e,t,n,i){let o=Ye(i);o.mode=oe.COLUMBUS_VIEW;let r=n.center,s=EBe(e,t,r,o),a=yt.createVertexBuffer({context:i.context,typedArray:s,usage:Me.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}var RW=pae;var DZn=T(S(),1);var FZn=T(S(),1),ZW=`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 m_={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};m_.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,ye.VERTEX),WBe(n,t);let i=e.runtimeNode,o=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${o.length}]`,ye.VERTEX),n.addVertexLines(ZW);let r={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=_t(r,e.uniformMap)};function IBe(e){let t=-1,n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];(r.semantic===St.JOINTS||r.semantic===St.WEIGHTS)&&(t=Math.max(t,r.setIndex))}return t}function WBe(e,t){e.addFunction(m_.FUNCTION_ID_GET_SKINNING_MATRIX,m_.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,ye.VERTEX),e.addFunctionLines(m_.FUNCTION_ID_GET_SKINNING_MATRIX,["mat4 skinnedMatrix = mat4(0);"]);let i,o,r=["x","y","z","w"],s=IBe(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(m_.FUNCTION_ID_GET_SKINNING_MATRIX,[d])}e.addFunctionLines(m_.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}var GW=m_;var JZn=T(S(),1);var YZn=T(S(),1),EW=`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 gae={name:"VerticalExaggerationPipelineStage"},PBe=new D;gae.process=function(e,t,n){let{shaderBuilder:i,uniformMap:o}=e;i.addVertexLines(EW),i.addDefine("HAS_VERTICAL_EXAGGERATION",void 0,ye.VERTEX),i.addUniform("vec2","u_verticalExaggerationAndRelativeHeight",ye.VERTEX),o.u_verticalExaggerationAndRelativeHeight=function(){return D.fromElements(n.verticalExaggeration,n.verticalExaggerationRelativeHeight,PBe)}};var XW=gae;var uGn=T(S(),1);var eGn=T(S(),1);var cz={};function vBe(e){let t=Ae.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 wBe(e,t){let n=t.length,i=Ae.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 FBe(e){let t=e-2,n=2+t*4,i=Ae.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 ABe(e,t){let i=t.length-2,o=2+i*4,r=Ae.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 MBe(e){let t=e-2,n=2+t*4,i=Ae.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 NBe(e,t){let i=t.length-2,o=2+i*4,r=Ae.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}cz.createWireframeIndices=function(e,t,n){let i=l(n);if(e===Fe.TRIANGLES)return i?wBe(t,n):vBe(t);if(e===Fe.TRIANGLE_STRIP)return i?ABe(t,n):FBe(t);if(e===Fe.TRIANGLE_FAN)return i?NBe(t,n):MBe(t)};cz.getWireframeIndicesCount=function(e,t){return e===Fe.TRIANGLES?t*2:e===Fe.TRIANGLE_STRIP||e===Fe.TRIANGLE_FAN?2+(t-2)*4:t};var OC=cz;var yae={name:"WireframePipelineStage"};yae.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,ye.FRAGMENT);let o=e.model,r=kBe(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=Fe.LINES,e.count=OC.getWireframeIndicesCount(a,c)};function kBe(e,t,n){let o=jt.getAttributeBySemantic(e,St.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):Ae.createTypedArray(o,m),u.getBufferData(s)):s=t.typedArray}let a=e.primitiveType,c=OC.createWireframeIndices(a,o,s),d=Ae.fromSizeInBytes(c.BYTES_PER_ELEMENT);return yt.createIndexBuffer({context:n.context,typedArray:c,usage:Me.STATIC_DRAW,indexDatatype:d})}var IW=yae;function xae(e){e=y(e,y.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=[]}xae.prototype.configurePipeline=function(e){let t=this.pipelineStages;t.length=0;let n=this.primitive,i=this.node,o=this.model,r=o.customShader,s=o.style,a=e.context.webgl2,d=e.mode!==oe.SCENE3D&&!e.scene3DOnly&&o._projectTo2D,u=e.verticalExaggeration!==1,m=l(n.morphTargets)&&n.morphTargets.length>0,p=l(i.skin),g=l(r),x=!(g&&l(r.fragmentShaderText))||r.mode!==n0.REPLACE_MATERIAL,_=jt.hasQuantizedAttributes(n.attributes),C=o.debugWireframe&&Fe.isTriangles(n.primitiveType)&&(o._enableDebugWireframe||a),V=o.pointCloudShading,L=l(V)&&V.attenuation,Z=l(V)&&V.backFaceCulling,E=n.primitiveType===Fe.POINTS&&(l(s)||L||Z),X=o._enableShowOutline&&l(n.outlineCoordinates),v=UBe(o,i,n),P=l(o.classificationType);d&&t.push(RW),t.push(mW),C&&t.push(IW),P&&t.push(QI),m&&t.push(yW),p&&t.push(GW),E&&t.push(TW),_&&t.push(cW),x&&t.push(bW),t.push(pg),t.push(Tu),v.hasPropertyTable&&(t.push(gg),t.push(JI),t.push($I)),u&&t.push(XW),g&&t.push(sW),t.push(fW),o.allowPicking&&t.push(xW),X&&t.push(VW),t.push(KI),t.push(LW)};function UBe(e,t,n){let i;return l(t.instances)&&(i=jt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(i))?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:(i=jt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),l(i)?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var WW=xae;var YGn=T(S(),1);function lz(e){e=y(e,y.EMPTY_OBJECT),this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],DBe(this)}Object.defineProperties(lz.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 DBe(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=_ae(u,m,new F);a.push(p)}}function _ae(e,t,n){let i=F.multiplyTransformation(e.transformToRoot,e.transform,n);return n=F.multiplyTransformation(i,t,n),n}lz.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]=_ae(i,o,e[n])}};var PW=lz;var qGn=T(S(),1);var HGn=T(S(),1);function BBe(){this.pass=void 0,this.alphaCutoff=void 0}var vW=BBe;function YBe(e){this.shaderBuilder=new ox,this.model=e,this.uniformMap={},this.alphaOptions=new vW,this.renderStateOptions=Ue.getState(Ue.fromCache({depthTest:{enabled:!0,func:tc.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1}var wW=YBe;var lEn=T(S(),1);var eEn=T(S(),1),FW=`void silhouetteStage(inout vec4 color) {
    if(model_silhouettePass) {
        color = czm_gammaCorrect(model_silhouetteColor);
    }
}`;var nEn=T(S(),1),AW=`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 R5={name:"ModelSilhouettePipelineStage"};R5.silhouettesLength=0;R5.process=function(e,t,n){l(t._silhouetteId)||(t._silhouetteId=++R5.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,ye.BOTH),i.addVertexLines(AW),i.addFragmentLines(FW),i.addUniform("vec4","model_silhouetteColor",ye.FRAGMENT),i.addUniform("float","model_silhouetteSize",ye.VERTEX),i.addUniform("bool","model_silhouettePass",ye.BOTH);let o={model_silhouetteColor:function(){return t.silhouetteColor},model_silhouetteSize:function(){return t.silhouetteSize},model_silhouettePass:function(){return!1}};e.uniformMap=_t(o,e.uniformMap),e.hasSilhouette=!0};var MW=R5;var bEn=T(S(),1);var uEn=T(S(),1),NW=`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 Z5={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};Z5.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,ye.FRAGMENT),i.addFragmentLines(NW);let o={};i.addUniform("float",Z5.SPLIT_DIRECTION_UNIFORM_NAME,ye.FRAGMENT),o[Z5.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=_t(o,e.uniformMap)};var kW=Z5;var xEn=T(S(),1);function OBe(e,t){this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=Ye(e.uniformMap),this.alphaOptions=Ye(e.alphaOptions),this.renderStateOptions=Ye(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 UW=OBe;var IEn=T(S(),1);var CEn=T(S(),1);function HBe(e){e=y(e,y.EMPTY_OBJECT),this.lightingModel=y(e.lightingModel,af.UNLIT)}var DW=HBe;function zBe(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=Ye(e.uniformMap),this.alphaOptions=Ye(e.alphaOptions),this.renderStateOptions=Ye(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:jt.getAttributeBySemantic(n,"POSITION").count,this.hasPropertyTable=!1,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=jt.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 DW,this.pickId=void 0}var BW=zBe;function gd(e){e=y(e,y.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=F.clone(F.IDENTITY),this._computedModelMatrix2D=F.clone(F.IDENTITY),this._axisCorrectionMatrix=jt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new F),this._runtimeArticulations={},KBe(this)}Object.defineProperties(gd.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 KBe(e){let t=e._components,n=t.scene,o=e._model.modelMatrix;Tae(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 WI({articulation:L,sceneGraph:e}),E=Z.name;a[E]=Z}let c=t.nodes,d=c.length;e._runtimeNodes=new Array(d);let m=n.nodes.length,p=F.IDENTITY;for(let V=0;V<m;V++){let L=n.nodes[V],Z=Sae(e,L,p);e._rootNodes.push(Z)}let g=t.skins,f=e._runtimeSkins,x=g.length;for(let V=0;V<x;V++){let L=g[V];f.push(new PW({skin:L,sceneGraph:e}))}let _=e._skinnedNodes,C=_.length;for(let V=0;V<C;V++){let L=_[V],Z=e._runtimeNodes[L],X=c[L].skin.index;Z._runtimeSkin=f[X],Z.updateJointMatrices()}e.applyArticulations()}function Tae(e,t){let n=e._components,i=e._model;e._computedModelMatrix=F.multiplyTransformation(t,n.transform,e._computedModelMatrix),e._computedModelMatrix=F.multiplyTransformation(e._computedModelMatrix,e._axisCorrectionMatrix,e._computedModelMatrix),e._computedModelMatrix=F.multiplyByUniformScale(e._computedModelMatrix,i.computedScale,e._computedModelMatrix)}var JBe=new h;function QBe(e,t){let n=e._computedModelMatrix,i=F.getTranslation(n,JBe);if(!h.equals(i,h.ZERO))e._computedModelMatrix2D=wt.basisTo2D(t.mapProjection,n,e._computedModelMatrix2D);else{let o=e.boundingSphere.center,r=wt.ellipsoidTo2DModelMatrix(t.mapProjection,o,e._computedModelMatrix2D);e._computedModelMatrix2D=F.multiply(r,n,e._computedModelMatrix2D)}e._boundingSphere2D=ce.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function Sae(e,t,n){let i=[],o=jt.getNodeTransform(t),r=t.children.length;for(let u=0;u<r;u++){let m=t.children[u],p=F.multiplyTransformation(n,o,new F),g=Sae(e,m,p);i.push(g)}let s=new zI({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 WW({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 NI(u,s);u._nodesByName[d]=m}return c}var jBe=new h,qBe=new h,$Be=new h,eYe=new h;gd.prototype.buildDrawCommands=function(e){let t=this._model,n=new wW(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,jBe),c=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,qBe);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 UW(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 g=d.runtimePrimitives[r];g.configurePipeline(e);let f=g.pipelineStages,x=new BW(m,g);for(s=0;s<f.length;s++)f[s].process(x,g.primitive,e);g.boundingSphere=ce.clone(x.boundingSphere,new ce);let _=F.multiplyByPoint(p,x.positionMin,$Be),C=F.multiplyByPoint(p,x.positionMax,eYe);h.minimumByComponent(a,_,a),h.maximumByComponent(c,C,c);let V=VI(x,e);g.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};gd.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(fg),!l(n.classificationType)&&(n.imageBasedLighting.enabled&&t.push(XI),n.isClippingEnabled()&&t.push(wI),n.isClippingPolygonsEnabled()&&t.push(MI),n.hasSilhouette(e)&&t.push(MW),l(n.splitDirection)&&n.splitDirection!==Gr.NONE&&t.push(kW),rr.is3DTiles(n.type)&&t.push(LI),i&&t.push(GI))};gd.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!==oe.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)}}};gd.prototype.updateModelMatrix=function(e,t){Tae(this,e),t.mode!==oe.SCENE3D&&QBe(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let o=this._runtimeNodes[n[i]];o._transformDirty=!0}};gd.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 Cae(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);Cae(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 G5(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];Cae(e,c,t,n,i)}}var tYe={backFaceCulling:void 0};gd.prototype.updateBackFaceCulling=function(e){let t=tYe;t.backFaceCulling=e,G5(this,!1,nYe,t)};function nYe(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var iYe={shadowMode:void 0};gd.prototype.updateShadows=function(e){let t=iYe;t.shadowMode=e,G5(this,!1,oYe,t)};function oYe(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var rYe={debugShowBoundingVolume:void 0};gd.prototype.updateShowBoundingVolume=function(e){let t=rYe;t.debugShowBoundingVolume=e,G5(this,!1,sYe,t)};function sYe(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var Vae=[],aYe={frameState:void 0,hasSilhouette:void 0};gd.prototype.pushDrawCommands=function(e){let t=Vae;t.length=0;let n=aYe;n.hasSilhouette=this._model.hasSilhouette(e),n.frameState=e,G5(this,!0,cYe,n),e.commandList.push.apply(e.commandList,t)};function cYe(e,t){let n=t.frameState,i=t.hasSilhouette,o=n.passes,r=Vae,s=e.drawCommand;s.pushCommands(n,n.commandList),i&&!o.pick&&s.pushSilhouetteCommands(n,r)}gd.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)};gd.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var YW=gd;var lXn=T(S(),1);function HC(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdSet={},this._batchTextureIdMap=new Lt}Object.defineProperties(HC.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}}});HC.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()};HC.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};HC.prototype.addTexture=function(e){this._textureIdSet.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes),this._textureIdSet[e._id]=!0};HC.prototype.addBatchTexture=function(e){this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var OW=HC;var HXn=T(S(),1);var Gae=T(VM(),1);var SXn=T(S(),1);var Lae={},h_=Uint32Array.BYTES_PER_ELEMENT;Lae.parse=function(e,t){t=y(t,0);let n=new Uint8Array(e),i=new DataView(e);t+=h_;let o=i.getUint32(t,!0);if(o!==1)throw new ue(`Only Point Cloud tile version 1 is supported.  Version ${o} is not.`);t+=h_,t+=h_;let r=i.getUint32(t,!0);if(r===0)throw new ue("Feature table must have a byte length greater than zero");t+=h_;let s=i.getUint32(t,!0);t+=h_;let a=i.getUint32(t,!0);t+=h_;let c=i.getUint32(t,!0);t+=h_;let d=Io(n,t,r);t+=r;let u=new Uint8Array(e,t,s);t+=s;let m,p;a>0&&(m=Io(n,t,a),t+=a,c>0&&(p=new Uint8Array(e,t,c),t+=c));let g=new km(d,u),f=g.getGlobalProperty("POINTS_LENGTH");if(g.featuresLength=f,!l(f))throw new ue("Feature table global property: POINTS_LENGTH must be defined");let x=g.getGlobalProperty("RTC_CENTER",Q.FLOAT,3);l(x)&&(x=h.unpack(x));let _=lYe(g,m);if(_.rtcCenter=x,_.pointsLength=f,!_.hasPositions){let C=dYe(g);_.positions=C,_.hasPositions=_.hasPositions||l(C)}if(!_.hasPositions)throw new ue("Either POSITION or POSITION_QUANTIZED must be defined.");if(!_.hasNormals){let C=mYe(g);_.normals=C,_.hasNormals=_.hasNormals||l(C)}if(!_.hasColors){let C=uYe(g);_.colors=C,_.hasColors=_.hasColors||l(C),_.hasConstantColor=l(_.constantColor),_.isTranslucent=l(C)&&C.isTranslucent}if(!_.hasBatchIds){let C=hYe(g);_.batchIds=C,_.hasBatchIds=_.hasBatchIds||l(C)}if(_.hasBatchIds){let C=g.getGlobalProperty("BATCH_LENGTH");if(!l(C))throw new ue("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 lYe(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 ue("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 g;return l(i)&&(g={buffer:i,featureTableProperties:o,batchTableProperties:r,properties:_t(o,r),dequantizeInShader:!0}),{draco:g,hasPositions:c,hasColors:d,isTranslucent:p,hasNormals:u,hasBatchIds:m}}function dYe(e){let t=e.json,n;if(l(t.POSITION))return n=e.getPropertyArray("POSITION",Q.FLOAT,3),{name:St.POSITION,semantic:St.POSITION,typedArray:n,isQuantized:!1,componentDatatype:Q.FLOAT,type:on.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 ue("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 ue("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:St.POSITION,semantic:St.POSITION,typedArray:n,isQuantized:!0,componentDatatype:Q.FLOAT,type:on.VEC3,quantizedRange:o,quantizedVolumeOffset:h.unpack(r),quantizedVolumeScale:h.unpack(i),quantizedComponentDatatype:Q.UNSIGNED_SHORT,quantizedType:on.VEC3}}}function uYe(e){let t=e.json,n;if(l(t.RGBA))return n=e.getPropertyArray("RGBA",Q.UNSIGNED_BYTE,4),{name:St.COLOR,semantic:St.COLOR,setIndex:0,typedArray:n,componentDatatype:Q.UNSIGNED_BYTE,type:on.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(l(t.RGB))return n=e.getPropertyArray("RGB",Q.UNSIGNED_BYTE,3),{name:"COLOR",semantic:St.COLOR,setIndex:0,typedArray:n,componentDatatype:Q.UNSIGNED_BYTE,type:on.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(l(t.RGB565))return n=e.getPropertyArray("RGB565",Q.UNSIGNED_SHORT,1),{name:"COLOR",semantic:St.COLOR,setIndex:0,typedArray:n,componentDatatype:Q.FLOAT,type:on.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=Y.fromBytes(i[0],i[1],i[2],o),s=o<255;return{name:St.COLOR,semantic:St.COLOR,setIndex:0,constantColor:r,componentDatatype:Q.FLOAT,type:on.VEC4,isQuantized:!1,isTranslucent:s}}}function mYe(e){let t=e.json,n;if(l(t.NORMAL))return n=e.getPropertyArray("NORMAL",Q.FLOAT,3),{name:St.NORMAL,semantic:St.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:Q.FLOAT,type:on.VEC3};if(l(t.NORMAL_OCT16P))return n=e.getPropertyArray("NORMAL_OCT16P",Q.UNSIGNED_BYTE,2),{name:St.NORMAL,semantic:St.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<8)-1,quantizedType:on.VEC2,quantizedComponentDatatype:Q.UNSIGNED_BYTE,componentDatatype:Q.FLOAT,type:on.VEC3}}function hYe(e){let t=e.json;if(l(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",Q.UNSIGNED_SHORT,1);return{name:St.FEATURE_ID,semantic:St.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:Q.fromTypedArray(n),type:on.SCALAR}}}var f_=Lae;var fYe=Tn.Components,pYe=Tn.Scene,bYe=Tn.Node,gYe=Tn.Primitive,yYe=Tn.Attribute,Rae=Tn.Quantization,xYe=Tn.FeatureIdAttribute,_Ye=Tn.Material,TYe=Tn.MetallicRoughness;function yg(e){e=y(e,y.EMPTY_OBJECT);let t=e.arrayBuffer,n=y(e.byteOffset,0);this._arrayBuffer=t,this._byteOffset=n,this._loadAttributesFor2D=y(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=It.UNLOADED,this._buffers=[],this._components=void 0,this._transform=F.IDENTITY}l(Object.create)&&(yg.prototype=Object.create(eo.prototype),yg.prototype.constructor=yg);Object.defineProperties(yg.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},transform:{get:function(){return this._transform}}});yg.prototype.load=function(){if(l(this._promise))return this._promise;this._parsedContent=f_.parse(this._arrayBuffer,this._byteOffset),this._state=It.PROCESSING,this._promise=Promise.resolve(this)};yg.prototype.process=function(e){if(l(this._error)){let t=this._error;throw this._error=void 0,t}if(this._state===It.READY)return!0;if(this._state===It.PROCESSING){if(l(this._decodePromise))return!1;this._decodePromise=SYe(this,e.context)}return!1};function SYe(e,t){let i=e._parsedContent.draco,o;if(l(i)?o=Up.decodePointCloud(i,t):o=Promise.resolve(),!!l(o))return e._decodePromise=o,o.then(function(r){if(!e.isDestroyed())return l(r)&&CYe(e,i,r),vYe(e,t),e._state=It.READY,e}).catch(function(r){e.unload(),e._state=It.FAILED;let s="Failed to load Draco pnts";e._error=e.getError(s,r)})}function CYe(e,t,n){e._state=It.READY;let i=e._parsedContent,o;if(l(n.POSITION)){if(o={name:"POSITION",semantic:St.POSITION,typedArray:n.POSITION.array,componentDatatype:Q.FLOAT,type:on.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=on.VEC3}i.positions=o}if(l(n.NORMAL)){if(o={name:"NORMAL",semantic:St.NORMAL,typedArray:n.NORMAL.array,componentDatatype:Q.FLOAT,type:on.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=on.VEC2}i.normals=o}if(l(n.RGBA)?i.colors={name:"COLOR",semantic:St.COLOR,setIndex:0,typedArray:n.RGBA.array,componentDatatype:Q.UNSIGNED_BYTE,type:on.VEC4,normalized:!0,isTranslucent:!0}:l(n.RGB)&&(i.colors={name:"COLOR",semantic:St.COLOR,setIndex:0,typedArray:n.RGB.array,componentDatatype:Q.UNSIGNED_BYTE,type:on.VEC3,normalized:!0,isTranslucent:!1}),l(n.BATCH_ID)){let a=n.BATCH_ID.array;i.batchIds={name:"_FEATURE_ID",semantic:St.FEATURE_ID,setIndex:0,typedArray:a,componentDatatype:Q.fromTypedArray(a),type:on.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:VYe(d.componentsPerAttribute),componentType:LYe(d.componentDatatype),typedArray:c.array}}i.batchTableJson=r}function VYe(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4"}}function LYe(e){switch(e){case ie.BYTE:return"BYTE";case ie.UNSIGNED_BYTE:return"UNSIGNED_BYTE";case ie.SHORT:return"SHORT";case ie.UNSIGNED_SHORT:return"UNSIGNED_SHORT";case ie.INT:return"INT";case ie.UNSIGNED_INT:return"UNSIGNED_INT";case ie.DOUBLE:return"DOUBLE";case ie.FLOAT:return"FLOAT"}}function HW(e,t,n){let i=t.typedArray,o;if(t.octEncoded&&(o=new Rae,o.octEncoded=t.octEncoded,o.octEncodedZXY=t.octEncodedZXY,o.normalizationRange=t.quantizedRange,o.type=t.quantizedType,o.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){o=new Rae;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 yYe;if(r.name=t.name,r.semantic=t.semantic,r.setIndex=t.setIndex,r.componentDatatype=t.componentDatatype,r.type=t.type,r.normalized=y(t.normalized,!1),r.min=t.min,r.max=t.max,r.quantization=o,t.isRGB565&&(i=wn.decodeRGB565(i)),l(t.constantColor)){let a=new Array(4);r.constant=Y.pack(t.constantColor,a)}else{let a=yt.createVertexBuffer({typedArray:i,context:n,usage:Me.STATIC_DRAW});a.vertexArrayDestroyable=!1,e._buffers.push(a),r.buffer=a}let s=e._loadAttributesFor2D;return r.semantic===St.POSITION&&s&&(r.typedArray=i),r}var Zae,E5;function RYe(e){if(!l(E5)){Zae=new Gae.default(0),E5=new Array(e);for(let t=0;t<e;++t)E5[t]=Zae.random()}return E5}var ZYe=new h,GYe=new h,EYe=new h;function XYe(e){let t=e.typedArray,n=20,i=t.length/3,o=Math.min(i,n),r=RYe(n),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=h.fromElements(s,s,s,ZYe),d=h.fromElements(a,a,a,GYe),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,EYe),h.minimumByComponent(c,p,c),h.maximumByComponent(d,p,d);e.min=h.clone(c),e.max=h.clone(d)}var IYe={name:St.COLOR,semantic:St.COLOR,setIndex:0,constantColor:Y.DARKGRAY,componentDatatype:Q.FLOAT,type:on.VEC4,isQuantized:!1,isTranslucent:!1};function WYe(e,t,n){let i=[],o,r=t.positions;return l(r)&&(XYe(r),o=HW(e,r,n),o.count=t.pointsLength,i.push(o)),l(t.normals)&&(o=HW(e,t.normals,n),i.push(o)),l(t.colors)?(o=HW(e,t.colors,n),i.push(o)):(o=HW(e,IYe,n),i.push(o)),l(t.batchIds)&&(o=HW(e,t.batchIds,n),i.push(o)),i}function PYe(e,t){let n=e.batchLength,i=e.pointsLength,o=e.batchTableBinary,r=!l(e.batchIds);if(l(o)||e.hasDracoBatchTable){let s=y(n,i);return jp({count:s,batchTable:e.batchTableJson,binaryBody:o,parseAsPropertyAttributes:r,customAttributeOutput:t})}return new Xa({schema:{},propertyTables:[]})}function vYe(e,t){let n=e._parsedContent,i=new TYe;i.metallicFactor=0,i.roughnessFactor=.9;let o=new _Ye;o.metallicRoughness=i;let r=n.colors;l(r)&&r.isTranslucent&&(o.alphaMode=of.BLEND);let s=!l(n.normals);o.unlit=s;let a=new gYe;if(a.attributes=WYe(e,n,t),a.primitiveType=Fe.POINTS,a.material=o,l(n.batchIds)){let g=new xYe;g.propertyTableId=0,g.setIndex=0,g.positionalLabel="featureId_0",a.featureIds.push(g)}let c=new bYe;c.index=0,c.primitives=[a];let d=new pYe;d.nodes=[c],d.upAxis=Xo.Z,d.forwardAxis=Xo.X;let u=new fYe;u.scene=d,u.nodes=[c];let m=[];u.structuralMetadata=PYe(n,m),m.length>0&&wYe(e,a,m,t),l(n.rtcCenter)&&(u.transform=F.multiplyByTranslation(u.transform,n.rtcCenter,u.transform));let p=n.positions;l(p)&&p.isQuantized&&(u.transform=F.multiplyByTranslation(u.transform,p.quantizedVolumeOffset,u.transform)),e._components=u,e._parsedContent=void 0,e._arrayBuffer=void 0}function wYe(e,t,n,i){let o=t.attributes,r=n.length;for(let s=0;s<r;s++){let a=n[s],c=yt.createVertexBuffer({typedArray:a.typedArray,context:i,usage:Me.STATIC_DRAW});c.vertexArrayDestroyable=!1,e._buffers.push(c),a.buffer=c,a.typedArray=void 0,o.push(a)}t.propertyAttributeIds=[0]}yg.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 zW=yg;var mIn=T(S(),1);var FYe=new h,AYe=new h,MYe=new h,NYe=new F,kYe=new F,UYe=new F,DYe=new he,BYe=new ce;function zC(e,t,n,i,o,r,s){if(!e._ready||n.mode===oe.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,g=F.clone(m.computedTransform,NYe),f=F.clone(c.computedModelMatrix,kYe),x=p.instances;l(x)&&x.transformInWorldSpace&&(f=F.multiplyTransformation(e.modelMatrix,c.components.transform,f),g=F.multiplyTransformation(c.axisCorrectionMatrix,m.computedTransform,g));let _=F.multiplyTransformation(f,g,UYe);n.mode!==oe.SCENE3D&&(_=wt.basisTo2D(n.mapProjection,_,_));let C=[];if(l(x)){let L=x.attributes[0].count,Z=x.attributes[0].componentDatatype,E=12,X=m.transformsTypedArray;if(!l(X)){let v=m.instancingTransformsBuffer;l(v)&&n.context.webgl2&&(X=Q.createTypedArray(Z,L*E),v.getBufferData(X))}if(l(X))for(let v=0;v<L;v++){let P=v*E,A=new F(X[P],X[P+1],X[P+2],X[P+3],X[P+4],X[P+5],X[P+6],X[P+7],X[P+8],X[P+9],X[P+10],X[P+11],0,0,0,1);x.transformInWorldSpace?(F.multiplyTransformation(A,g,A),F.multiplyTransformation(f,A,A)):F.multiplyTransformation(A,_,A),C.push(A)}}C.length===0&&C.push(_);let V=m.runtimePrimitives.length;for(let L=0;L<V;L++){let Z=m.runtimePrimitives[L],E=Z.primitive;if(l(Z.boundingSphere)&&!l(x)){let H=ce.transform(Z.boundingSphere,_,BYe),te=qn.raySphere(t,H);if(!l(te))continue}let X=jt.getAttributeBySemantic(E,St.POSITION),v=X.byteOffset,P=X.byteStride,A=X.count;if(!l(E.indices))continue;let M=E.indices.typedArray;if(!l(M)){let H=E.indices.buffer,te=E.indices.count,z=E.indices.indexDatatype;l(H)&&n.context.webgl2&&(z===Ae.UNSIGNED_BYTE?M=new Uint8Array(te):z===Ae.UNSIGNED_SHORT?M=new Uint16Array(te):z===Ae.UNSIGNED_INT&&(M=new Uint32Array(te)),H.getBufferData(M))}let b=X.typedArray,R=X.componentDatatype,G=X.type,I=X.quantization;l(I)&&(R=X.quantization.componentDatatype,G=X.quantization.type);let w=on.getNumberOfComponents(G),N=Q.getSizeInBytes(R),B=!l(b)&&l(P)&&P!==w*N,U=w,O=0;B&&(U=P/N,O=v/N);let k=A*U;if(!l(b)){let H=X.buffer;l(H)&&n.context.webgl2&&(b=Q.createTypedArray(R,k),H.getBufferData(b,B?0:v,0,k)),I&&X.normalized&&(b=wn.dequantize(b,R,G,A))}if(!l(M)||!l(b))return;r=y(r,ne.default),i=y(i,1),o=y(o,0);let J=M.length;for(let H=0;H<J;H+=3){let te=M[H],z=M[H+1],j=M[H+2];for(let ee of C){let fe=dz(b,te,O,U,I,ee,i,o,r,FYe),_e=dz(b,z,O,U,I,ee,i,o,r,AYe),le=dz(b,j,O,U,I,ee,i,o,r,MYe),ge=qn.rayTriangleParametric(t,fe,_e,le,y(e.backFaceCulling,!0));l(ge)&&ge<a&&ge>=0&&(a=ge)}}}}if(a!==Number.MAX_VALUE){if(s=pn.getPoint(t,a,s),n.mode!==oe.SCENE3D){h.fromElements(s.y,s.z,s.x,s);let u=n.mapProjection,m=u.ellipsoid,p=u.unproject(s,DYe);m.cartographicToCartesian(p,s)}return s}}function dz(e,t,n,i,o,r,s,a,c,d){let u=n+t*i;if(d.x=e[u],d.y=e[u+1],d.z=e[u+2],l(o))if(o.octEncoded){if(d=wn.octDecodeInRange(d,o.normalizationRange,d),o.octEncodedZXY){let m=d.x;d.x=d.z,d.z=d.y,d.y=m}}else d=h.multiplyComponents(d,o.quantizedVolumeStepSize,d),d=h.add(d,o.quantizedVolumeOffset,d);return d=F.multiplyByPoint(r,d,d),s!==1&&br.getPosition(d,c,s,a,d),d}function uo(e){e=y(e,y.EMPTY_OBJECT),this._loader=e.loader,this._resource=e.resource,this.type=y(e.type,rr.GLTF),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=F.clone(this.modelMatrix),this._scale=y(e.scale,1),this._minimumPixelSize=y(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=$.clone($.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 pI(this),this._clampAnimations=y(e.clampAnimations,!0),this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=Y.clone(e.color),this._colorBlendMode=y(e.colorBlendMode,cc.HIGHLIGHT),this._colorBlendAmount=y(e.colorBlendAmount,.5);let t=y(e.silhouetteColor,Y.RED);this._silhouetteColor=Y.clone(t),this._silhouetteSize=y(e.silhouetteSize,0),this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=y(e.cull,!0),this._opaquePass=y(e.opaquePass,Re.OPAQUE),this._allowPicking=y(e.allowPicking,!0),this._show=y(e.show,!0),this._style=void 0,this._styleDirty=!1,this._styleCommandsNeeded=void 0;let n=y(e.featureIdLabel,"featureId_0");typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=y(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=y(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 sf(e.pointCloudShading);this._pointCloudShading=r,this._attenuation=r.attenuation,this._pointCloudBackFaceCulling=r.backFaceCulling;let s=e.clippingPlanes;l(s)&&s.owner===void 0?as.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0,this._clippingPlanesMatrix=F.clone(F.IDENTITY);let a=e.clippingPolygons;l(a)&&a.owner===void 0?Am.setOwner(a,this,"_clippingPolygons"):this._clippingPolygons=a,this._clippingPolygonsState=0,this._lightColor=h.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new Fx,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._backFaceCulling=y(e.backFaceCulling,!0),this._backFaceCullingDirty=!1,this._shadows=y(e.shadows,_n.ENABLED),this._shadowsDirty=!1,this._debugShowBoundingVolumeDirty=!1,this._debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._enableDebugWireframe=y(e.enableDebugWireframe,!1),this._enableShowOutline=y(e.enableShowOutline,!0),this._debugWireframe=y(e.debugWireframe,!1),this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===rr.GLTF&&Nt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.");let c=e.credit;typeof c=="string"&&(c=new Rt(c)),this._credits=[],this._credit=c,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=y(e.showCreditsOnScreen,!1),this._showCreditsOnScreenDirty=!0,this._splitDirection=y(e.splitDirection,Gr.NONE),this._enableShowOutline=y(e.enableShowOutline,!0),this.showOutline=y(e.showOutline,!0),this.outlineColor=y(e.outlineColor,Y.BLACK),this._classificationType=e.classificationType,this._statistics=new OW,this._sceneMode=void 0,this._projectTo2D=y(e.projectTo2D,!1),this._enablePick=y(e.enablePick,!1),this._fogRenderable=void 0,this._skipLevelOfDetail=!1,this._ignoreCommands=y(e.ignoreCommands,!1),this._errorEvent=new be,this._readyEvent=new be,this._texturesReadyEvent=new be,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject}function uz(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function YYe(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 yI({model:e,propertyTable:s});n.push(a)}return n}function OYe(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=jt.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=jt.getFeatureIdsByLabel(c.featureIds,n);if(l(d))return d.propertyTableId}if(t._featureTables.length===1)return 0}function fz(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(uo.prototype,{ready:{get:function(){return this._ready}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},incrementallyLoadTextures:{get:function(){return y(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=Pt.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){fz(e,this._color)&&this.resetDrawCommands(),this._color=Y.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(!Y.equals(e,this._silhouetteColor)){let t=fz(e,this._silhouetteColor);this._silhouetteDirty=this._silhouetteDirty||t}this._silhouetteColor=Y.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 Iae(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===rr.GLTF&&Nt("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&&(as.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(Am.setOwner(e,this,"_clippingPolygons"),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}}});uo.prototype.getNode=function(e){return this._nodesByName[e]};uo.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};uo.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};uo.prototype.makeStyleDirty=function(){this._styleDirty=!0};uo.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var HYe=new F,zYe=new $,KYe=new F;uo.prototype.update=function(e){let t=!1;try{t=JYe(this,e)}catch(n){if(!this._loader.incrementallyLoadTextures&&n.name==="TextureError")uz(this,n);else{let i=jt.getError("model",this._resource,n);uz(this,i)}}if(QYe(this,e),jYe(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let n=this._loader.components;if(!l(n)){if(this._loader.isUnloaded())return;let r=jt.getError("model",this._resource,new ue("Failed to load model."));uz(r),this._rejectLoad=this._rejectLoad&&this._rejectLoad(r)}let i=n.structuralMetadata;l(i)&&i.propertyTableCount>0&&YYe(this,i);let o=new YW({model:this,modelComponents:n});this._sceneGraph=o,this._gltfCredits=o.components.asset.credits}if(!(!this._resourcesLoaded||e.mode===oe.MORPHING)){if(qYe(this),$Ye(this),eOe(this,e),tOe(this),nOe(this,e),iOe(this,e),oOe(this,e),rOe(this,e),sOe(this,e),aOe(this,e),cOe(this,e),this._defaultTexture=e.context.defaultTexture,lOe(this,e),dOe(this,e),uOe(this),mOe(this,e),bOe(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)),fOe(this),gOe(this,e),yOe(this),xOe(this,e)}};function JYe(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function QYe(e,t){l(e._customShader)&&e._customShader.update(t)}function jYe(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function qYe(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=OYe(t,e),e._styleDirty=!0,e.resetDrawCommands())}function $Ye(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function eOe(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&&Xae(e)}function Xae(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=Dm.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function tOe(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 nOe(e,t){e._silhouetteDirty&&(Wae(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function iOe(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function oOe(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 rOe(e,t){let n=0;e.isClippingPolygonsEnabled()&&(e._clippingPolygons.owner===e&&(e._clippingPolygons.update(t),e._clippingPolygons.queueCommands(t)),n=e._clippingPolygons.clippingPolygonsState),n!==e._clippingPolygonsState&&(e.resetDrawCommands(),e._clippingPolygonsState=n)}function sOe(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function aOe(e,t){let n=t.fog.enabled&&t.fog.renderable;n!==e._fogRenderable&&(e.resetDrawCommands(),e._fogRenderable=n)}function cOe(e,t){let n=t.verticalExaggeration!==1;e._verticalExaggerationOn!==n&&(e.resetDrawCommands(),e._verticalExaggerationOn=n)}function lOe(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function dOe(e,t){F.equals(e.modelMatrix,e._modelMatrix)||(e._updateModelMatrix=!0,e._modelMatrix=F.clone(e.modelMatrix,e._modelMatrix))}var xg=new h,mz=new he;function uOe(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=y(t.ellipsoid,ne.default),i=e.modelMatrix;xg.x=i[12],xg.y=i[13],xg.z=i[14];let o=n.cartesianToCartographic(xg);l(e._clampedModelMatrix)||(e._clampedModelMatrix=F.clone(i,new F)),e._removeUpdateHeightCallback=t.updateHeight(o,Eae(e,n,o),e.heightReference);let r=t.getHeight(o,e.heightReference);if(l(r)){let s=Eae(e,n,o);he.clone(o,mz),mz.height=r,s(mz)}e._heightDirty=!1,e._updateModelMatrix=!0}function mOe(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;Iae(e,n),hOe(e,n,t)}function Iae(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 hOe(e,t,n){let i=e.scale;if(e.minimumPixelSize!==0&&!e._projectTo2D){let o=n.context,r=Math.max(o.drawingBufferWidth,o.drawingBufferHeight);F.getTranslation(t,xg),e._sceneMode!==oe.SCENE3D&&Yi.computeActualEllipsoidPosition(n,xg,xg);let s=e._boundingSphere.radius,a=_Oe(xg,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 fOe(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}var pOe=new $(1,0,0,0,0,1,0,-1,0);function bOe(e,t){let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=y(e.referenceMatrix,n),o=t.context,r=e._imageBasedLighting;if(r.useSphericalHarmonicCoefficients||r.useSpecularEnvironmentMaps){let s=zYe,a=HYe;a=F.multiply(o.uniformState.view3D,i,a),s=F.getRotation(a,s),s=$.transpose(s,s),e._iblReferenceFrameMatrix=$.multiply(pOe,s,e._iblReferenceFrameMatrix)}if(e.isClippingEnabled()){let s=KYe;s=F.multiply(o.uniformState.view3D,i,s),s=F.multiply(s,e._clippingPlanes.modelMatrix,s),e._clippingPlanesMatrix=F.inverseTranspose(s,e._clippingPlanesMatrix)}}function gOe(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 yOe(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1,e._credits.length=0;let t=e._showCreditsOnScreen;if(l(e._credit)){let s=Rt.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=Rt.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=Rt.clone(o[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}}function xOe(e,t){let n=SOe(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&&(COe(e,t),e._sceneGraph.pushDrawCommands(t))}var hz=new ce;function _Oe(e,t,n){return hz.center=e,hz.radius=t,n.camera.getPixelSize(hz,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var X5=new h;function Eae(e,t,n){return function(i){DS(e.heightReference)&&(i.height+=n.height),t.cartographicToCartesian(i,X5);let o=e._clampedModelMatrix;F.clone(e.modelMatrix,o),o[12]=X5.x,o[13]=X5.y,o[14]=X5.z,e._heightDirty=!0}}var TOe=new h;function SOe(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===oe.SCENE2D){let a=(t.camera.frustum.right-t.camera.frustum.left)*.5;r=a*a}else{let s=F.getTranslation(e.modelMatrix,TOe);Yi.computeActualEllipsoidPosition(t,s,s),r=h.distanceSquared(s,t.camera.positionWC)}return r>=i&&r<=o}function COe(e,t){let n=t.creditDisplay,i=e._credits,o=i.length;for(let r=0;r<o;r++)n.addCreditToNextFrame(i[r])}uo.prototype.isTranslucent=function(){let e=this.color;return l(e)&&e.alpha>0&&e.alpha<1};uo.prototype.isInvisible=function(){let e=this.color;return l(e)&&e.alpha===0};function Wae(e){return e.context.stencilBuffer}uo.prototype.hasSilhouette=function(e){return Wae(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};uo.prototype.hasSkipLevelOfDetail=function(e){if(!rr.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};uo.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return l(e)&&e.enabled&&e.length!==0};uo.prototype.pick=function(e,t,n,i,o){return zC(this,e,t,n,i,o)};uo.prototype.isClippingPolygonsEnabled=function(){let e=this._clippingPolygons;return l(e)&&e.enabled&&e.length!==0};uo.prototype.isDestroyed=function(){return!1};uo.prototype.destroy=function(){let e=this._loader;l(e)&&e.destroy();let t=this._featureTables;if(l(t)){let o=t.length;for(let r=0;r<o;r++)t[r].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;let i=this._clippingPolygons;l(i)&&!i.isDestroyed()&&i.owner===this&&i.destroy(),this._clippingPolygons=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,me(this)};uo.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};uo.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0};uo.fromGltfAsync=async function(e){e=y(e,y.EMPTY_OBJECT);let t=y(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=y(e.basePath,""),o=Ee.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=Ee.createIfNeeded(t);let r=new zp(n),a=l(e.content)?rr.TILE_GLTF:rr.GLTF,c=n.gltfResource,d=KW(r,a,e);d.resource=c;try{await r.load()}catch(g){throw r.destroy(),jt.getError("model",c,g)}let u=e.gltfCallback;l(u)&&u(r.gltfJson);let m=new uo(d),p=m._resource.credits;if(l(p)){let g=p.length;for(let f=0;f<g;f++)m._resourceCredits.push(Rt.clone(p[f]))}return m};uo.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 sI(t);try{await n.load();let i=KW(n,rr.TILE_B3DM,e);return new uo(i)}catch(i){throw n.destroy(),i}};uo.fromPnts=async function(e){let t={arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D},n=new zW(t);try{await n.load();let i=KW(n,rr.TILE_PNTS,e);return new uo(i)}catch(i){throw n.destroy(),i}};uo.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 lI(t);try{await n.load();let i=KW(n,rr.TILE_I3DM,e);return new uo(i)}catch(i){throw n.destroy(),i}};uo.fromGeoJson=async function(e){let t={geoJson:e.geoJson},n=new aI(t),i=KW(n,rr.TILE_GEOJSON,e);return new uo(i)};var VOe=new Y;uo.prototype.applyColorAndShow=function(e){let t=Y.clone(this._color,VOe),n=l(e)&&l(e.color),i=l(e)&&l(e.show);this._color=n?e.color.evaluateColor(void 0,this._color):Y.clone(Y.WHITE,this._color),this._show=i?e.show.evaluate(void 0):!0,fz(t,this._color)&&this.resetDrawCommands()};uo.prototype.applyStyle=function(e){let t=this.type===rr.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),Xae(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function KW(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,clippingPolygons:n.clippingPolygons,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}}var Bm=uo;function bs(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(bs.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}}});bs.prototype.getFeature=function(e){let t=this._model,n=t.featureTableId;return t.featureTables[n].getFeature(e)};bs.prototype.hasProperty=function(e,t){let n=this._model,i=n.featureTableId;return l(i)?n.featureTables[i].hasProperty(e,t):!1};bs.prototype.applyDebugSettings=function(e,t){t=e?t:Y.WHITE,this.featuresLength===0?this._model.color=t:l(this.batchTable)&&this.batchTable.setAllColor(t)};bs.prototype.applyStyle=function(e){this._model.style=e};bs.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);let r=e.clippingPolygons;l(r)&&i.clippingPolygonsDirty&&(n._clippingPolygons=r.enabled&&i._isClippedByPolygon?r:void 0),l(r)&&l(n._clippingPolygons)&&n._clippingPolygons!==r&&(n._clippingPolygons=r,n._clippingPolygonsState=0),n.update(t),!this._ready&&n.ready&&(n.activeAnimations.addAll({loop:Il.REPEAT}),this._ready=!0)};bs.prototype.isDestroyed=function(){return!1};bs.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),me(this)};bs.fromGltf=async function(e,t,n,i){let o=new bs(e,t,n),s=JW(e,t,o,{gltf:i,basePath:n}),a=e.vectorClassificationOnly?void 0:e.classificationType;s.classificationType=a;let c=await Bm.fromGltfAsync(s);return o._model=c,o};bs.fromB3dm=async function(e,t,n,i,o){let r=new bs(e,t,n),a=JW(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=e.vectorClassificationOnly?void 0:e.classificationType;a.classificationType=c;let d=await Bm.fromB3dm(a);return r._model=d,r};bs.fromI3dm=async function(e,t,n,i,o){let r=new bs(e,t,n),a=JW(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await Bm.fromI3dm(a);return r._model=c,r};bs.fromPnts=async function(e,t,n,i,o){let r=new bs(e,t,n),a=JW(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await Bm.fromPnts(a);return r._model=c,r};bs.fromGeoJson=async function(e,t,n,i){let o=new bs(e,t,n),s=JW(e,t,o,{geoJson:i,resource:n}),a=await Bm.fromGeoJson(s);return o._model=a,o};bs.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,ne.WGS84,n)};function JW(e,t,n,i){let o={cull:!1,releaseGltfJson:!0,opaquePass:Re.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};return _t(i,o)}var cf=bs;var hWn=T(S(),1);function Su(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(Su.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}}});Su.fromJson=function(e,t,n,i){let o=new Su(e,t,n);return o._tileset.loadTileset(o._resource,i,o._tile),o._ready=!0,o};Su.prototype.hasProperty=function(e,t){return!1};Su.prototype.getFeature=function(e){};Su.prototype.applyDebugSettings=function(e,t){};Su.prototype.applyStyle=function(e){};Su.prototype.update=function(e,t){};Su.prototype.pick=function(e,t,n){};Su.prototype.isDestroyed=function(){return!1};Su.prototype.destroy=function(){return me(this)};var QW=Su;var y9n=T(S(),1);var gwn=T(S(),1);var M2n=T(S(),1);var pWn=T(S(),1),jW=`uniform sampler2D u_atlas;

#ifdef VECTOR_TILE
uniform vec4 u_highlightColor;
#endif

in vec2 v_textureCoordinates;
in vec4 v_pickColor;
in vec4 v_color;
in float v_splitDirection;

#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()
{
    if (v_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;
    if (v_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;
    
    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 gWn=T(S(),1),qW=`#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)
in float splitDirection;                            // splitDirection
#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;
out float v_splitDirection;
#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;
    v_splitDirection = splitDirection;
}
`;var NWn=T(S(),1);function xi(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=kt.clone(n)),l(i)&&(i=kt.clone(i)),l(o)&&(o=kt.clone(o)),l(r)&&(r=Pt.clone(r)),this._show=y(e.show,!0),this._position=h.clone(y(e.position,h.ZERO)),this._actualPosition=h.clone(this._position),this._pixelOffset=D.clone(y(e.pixelOffset,D.ZERO)),this._translate=new D(0,0),this._eyeOffset=h.clone(y(e.eyeOffset,h.ZERO)),this._heightReference=y(e.heightReference,Qe.NONE),this._verticalOrigin=y(e.verticalOrigin,Pn.CENTER),this._horizontalOrigin=y(e.horizontalOrigin,gi.CENTER),this._scale=y(e.scale,1),this._color=Y.clone(y(e.color,Y.WHITE)),this._rotation=y(e.rotation,0),this._alignedAxis=h.clone(y(e.alignedAxis,h.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=o,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=y(e.sizeInMeters,!1),this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=y(e.collection,t),this._pickId=void 0,this._pickPrimitive=y(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=Bn()),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=oe.SCENE3D,this._clusterShow=!0,this._outlineColor=Y.clone(y(e.outlineColor,Y.BLACK)),this._outlineWidth=y(e.outlineWidth,0),this._updateClamping(),this._splitDirection=y(e.splitDirection,Gr.NONE)}var Pae=xi.SHOW_INDEX=0,W5=xi.POSITION_INDEX=1,Aae=xi.PIXEL_OFFSET_INDEX=2,LOe=xi.EYE_OFFSET_INDEX=3,ROe=xi.HORIZONTAL_ORIGIN_INDEX=4,ZOe=xi.VERTICAL_ORIGIN_INDEX=5,GOe=xi.SCALE_INDEX=6,P5=xi.IMAGE_INDEX_INDEX=7,vae=xi.COLOR_INDEX=8,EOe=xi.ROTATION_INDEX=9,XOe=xi.ALIGNED_AXIS_INDEX=10,IOe=xi.SCALE_BY_DISTANCE_INDEX=11,WOe=xi.TRANSLUCENCY_BY_DISTANCE_INDEX=12,POe=xi.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,vOe=xi.DISTANCE_DISPLAY_CONDITION=14,wOe=xi.DISABLE_DEPTH_DISTANCE=15;xi.TEXTURE_COORDINATE_BOUNDS=16;var wae=xi.SDF_INDEX=17,FOe=xi.SPLIT_DIRECTION_INDEX=18;xi.NUMBER_OF_PROPERTIES=19;function Po(e,t){let n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(xi.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Po(this,Pae))}},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(),Po(this,W5))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),Po(this,W5))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;D.equals(t,e)||(D.clone(e,t),Po(this,Aae))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;kt.equals(t,e)||(this._scaleByDistance=kt.clone(e,t),Po(this,IOe))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;kt.equals(t,e)||(this._translucencyByDistance=kt.clone(e,t),Po(this,WOe))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;kt.equals(t,e)||(this._pixelOffsetScaleByDistance=kt.clone(e,t),Po(this,POe))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;h.equals(t,e)||(h.clone(e,t),Po(this,LOe))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Po(this,ROe))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,Po(this,ZOe))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,Po(this,GOe))}},color:{get:function(){return this._color},set:function(e){let t=this._color;Y.equals(t,e)||(Y.clone(e,t),Po(this,vae))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,Po(this,EOe))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;h.equals(t,e)||(h.clone(e,t),Po(this,XOe))}},width:{get:function(){return y(this._width,this._imageWidth)},set:function(e){this._width!==e&&(this._width=e,Po(this,P5))}},height:{get:function(){return y(this._height,this._imageHeight)},set:function(e){this._height!==e&&(this._height=e,Po(this,P5))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,Po(this,vae))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Pt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Pt.clone(e,this._distanceDisplayCondition),Po(this,vOe))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Po(this,wOe))}},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 Ee?this.setImage(e.url,e):l(e.src)?this.setImage(e.src,e):this.setImage(Bn(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,Po(this,P5))}},ready:{get:function(){return this._imageIndex!==-1}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=h.clone(e,this._actualClampedPosition),Po(this,W5)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Po(this,Pae))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;Y.equals(t,e)||(Y.clone(e,t),Po(this,wae))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Po(this,wae))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Po(this,FOe))}}});xi.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};xi.prototype._updateClamping=function(){xi._updateClamping(this._billboardCollection,this)};var v5=new he;xi._updateClamping=function(e,t){let n=e._scene;if(!l(n))return;let i=y(n.ellipsoid,ne.default),o=n.frameState.mode,r=o!==t._mode;if(t._mode=o,(t._heightReference===Qe.NONE||r)&&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 s=i.cartesianToCartographic(t._position);if(!l(s)){t._actualClampedPosition=void 0;return}function a(d){let u=i.cartographicToCartesian(d,t._clampedPosition);DS(t._heightReference)&&(t._mode===oe.SCENE3D?(d.height+=s.height,i.cartographicToCartesian(d,u)):u.x+=s.height),t._clampedPosition=u}t._removeCallbackFunc=n.updateHeight(s,a,t._heightReference),he.clone(s,v5);let c=n.getHeight(s,t._heightReference);l(c)&&(v5.height=c),a(v5)};xi.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||!Ke.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,Po(r,P5);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})};xi.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())};xi.prototype.setImageSubRegion=function(e,t){this._imageId===e&&Ke.equals(this._imageSubRegion,t)||(this._imageIndex=-1,this._imageId=e,this._imageSubRegion=Ke.clone(t),l(this._billboardCollection._textureAtlas)&&this._loadImage())};xi.prototype._setTranslate=function(e){let t=this._translate;D.equals(t,e)||(D.clone(e,t),Po(this,Aae))};xi.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition};xi.prototype._setActualPosition=function(e){l(this._clampedPosition)||h.clone(e,this._actualPosition),Po(this,W5)};var Fae=new se;xi._computeActualPosition=function(e,t,n,i){return l(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===oe.SCENE3D?t:(F.multiplyByPoint(i,t,Fae),Yi.computeActualEllipsoidPosition(n,Fae))};var Mae=new h;xi._computeScreenSpacePosition=function(e,t,n,i,o,r){let s=F.multiplyByPoint(e,t,Mae),a=Yi.worldWithEyeOffsetToWindowCoordinates(o,s,n,r);if(l(a))return D.add(a,i,a),a};var I5=new D(0,0);xi.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new D),D.clone(this._pixelOffset,I5),D.add(I5,this._translate,I5);let i=n.modelMatrix,o=this._position;if(l(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==oe.SCENE3D)){let s=e.mapProjection,a=s.ellipsoid,c=s.unproject(o,v5);o=a.cartographicToCartesian(c,Mae),i=F.IDENTITY}return xi._computeScreenSpacePosition(i,o,this._eyeOffset,I5,e,t)};xi.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===gi.RIGHT?s-=i:e.horizontalOrigin===gi.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===Pn.BOTTOM||e.verticalOrigin===Pn.BASELINE?a-=o:e.verticalOrigin===Pn.CENTER&&(a-=o*.5),l(n)||(n=new Ke),n.x=s,n.y=a,n.width=i,n.height=o,n};xi.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&&Ke.equals(this._imageSubRegion,e._imageSubRegion)&&Y.equals(this._color,e._color)&&D.equals(this._pixelOffset,e._pixelOffset)&&D.equals(this._translate,e._translate)&&h.equals(this._eyeOffset,e._eyeOffset)&&kt.equals(this._scaleByDistance,e._scaleByDistance)&&kt.equals(this._translucencyByDistance,e._translucencyByDistance)&&kt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Pt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};xi.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 ro=xi;var UWn=T(S(),1),AOe={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2},Lo=Object.freeze(AOe);var BWn=T(S(),1),MOe={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},As=Object.freeze(MOe);var n2n=T(S(),1);function i0(e,t,n,i,o){this.bottomLeft=y(e,D.ZERO),this.topRight=y(t,D.ZERO),this.childNode1=n,this.childNode2=i,this.imageIndex=o}var NOe=new D(16,16);function _g(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.borderWidthInPixels,1),n=y(e.initialSize,NOe);this._context=e.context,this._pixelFormat=y(e.pixelFormat,at.RGBA),this._borderWidthInPixels=t,this._textureCoordinates=[],this._guid=Bn(),this._idHash={},this._indexHash={},this._initialSize=n,this._root=void 0}Object.defineProperties(_g.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},textureCoordinates:{get:function(){return this._textureCoordinates}},texture:{get:function(){return l(this._texture)||(this._texture=new Ft({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 kOe(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 i0(new D(s+r,r),new D(c,a)),g=new i0(new D,new D(c,a),e._root,p),f=new i0(new D(r,a+r),new D(c,d)),x=new i0(new D,new D(c,d),g,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 Ft({context:e._context,width:c,height:d,pixelFormat:e._pixelFormat}),C=new js({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 Ft({context:e._context,width:s,height:a,pixelFormat:e._pixelFormat}),e._root=new i0(new D(r,r),new D(s,a))}}function w5(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 i0(new D(t.bottomLeft.x,t.bottomLeft.y),new D(t.bottomLeft.x+n.width,t.topRight.y));let a=t.bottomLeft.x+n.width+e._borderWidthInPixels;a<t.topRight.x&&(t.childNode2=new i0(new D(a,t.bottomLeft.y),new D(t.topRight.x,t.topRight.y)))}else{t.childNode1=new i0(new D(t.bottomLeft.x,t.bottomLeft.y),new D(t.topRight.x,t.bottomLeft.y+n.height));let a=t.bottomLeft.y+n.height+e._borderWidthInPixels;a<t.topRight.y&&(t.childNode2=new i0(new D(t.bottomLeft.x,a),new D(t.topRight.x,t.topRight.y)))}return w5(e,t.childNode1,n)}return w5(e,t.childNode1,n)||w5(e,t.childNode2,n)}}function Nae(e,t,n){let i=w5(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 Ke(c,d,u,m),e._texture.copyFrom({source:t,xOffset:i.bottomLeft.x,yOffset:i.bottomLeft.y})}else kOe(e,t),Nae(e,t,n);e._guid=Bn()}function kae(e,t){if(!l(e)||e.isDestroyed())return-1;let n=e.numberOfImages;return Nae(e,t,n),n}_g.prototype.getImageIndex=function(e){return this._indexHash[e]};_g.prototype.addImageSync=function(e,t){let n=this._indexHash[e];return l(n)||(n=kae(this,t),this._idHash[e]=Promise.resolve(n),this._indexHash[e]=n),n};_g.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 Ee)&&(t=Ee.createIfNeeded(t).fetchImage());let i=this;return n=Promise.resolve(t).then(function(o){let r=kae(i,o);return i._indexHash[e]=r,r}),this._idHash[e]=n,n};_g.prototype.addSubRegion=function(e,t){let n=this._idHash[e];if(!l(n))throw new ue(`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 Ke(c,d,u,m))-1;return i._indexHash[e]=p,i._guid=Bn(),p})};_g.prototype.isDestroyed=function(){return!1};_g.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),me(this)};var Tg=_g;var UOe=ro.SHOW_INDEX,e2=ro.POSITION_INDEX,Uae=ro.PIXEL_OFFSET_INDEX,Dae=ro.EYE_OFFSET_INDEX,DOe=ro.HORIZONTAL_ORIGIN_INDEX,BOe=ro.VERTICAL_ORIGIN_INDEX,YOe=ro.SCALE_INDEX,$W=ro.IMAGE_INDEX_INDEX,Bae=ro.COLOR_INDEX,OOe=ro.ROTATION_INDEX,HOe=ro.ALIGNED_AXIS_INDEX,Yae=ro.SCALE_BY_DISTANCE_INDEX,Oae=ro.TRANSLUCENCY_BY_DISTANCE_INDEX,Hae=ro.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,zae=ro.DISTANCE_DISPLAY_CONDITION,zOe=ro.DISABLE_DEPTH_DISTANCE,KOe=ro.TEXTURE_COORDINATE_BOUNDS,Kae=ro.SDF_INDEX,Jae=ro.SPLIT_DIRECTION_INDEX,Tz=ro.NUMBER_OF_PROPERTIES,so,JOe={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,splitDirection:12},QOe={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,splitDirection:13};function Lu(e){e=y(e,y.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(Tz),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=y(e.show,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=F.clone(F.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowTextureAtlas=y(e.debugShowTextureAtlas,!1),this.blendOption=y(e.blendOption,Lo.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=oe.SCENE3D,this._buffersUsage=[Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW],this._highlightColor=Y.clone(Y.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(Lu.prototype,{length:{get:function(){return Sz(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 Qae(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Lu.prototype.add=function(e){let t=new ro(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};Lu.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Lu.prototype.removeAll=function(){Qae(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function Sz(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}}Lu.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};Lu.prototype.contains=function(e){return l(e)&&e._billboardCollection===this};Lu.prototype.get=function(e){return Sz(this),this._billboards[e]};var pz;function jOe(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=yt.createIndexBuffer({context:e,typedArray:o,usage:Me.STATIC_DRAW,indexDatatype:Ae.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=n,n}function qOe(e){let t=e.cache.billboardCollection_indexBufferInstanced;return l(t)||(t=yt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Me.STATIC_DRAW,indexDatatype:Ae.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function $Oe(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return l(t)||(t=yt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Me.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}Lu.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<Tz;++i){let o=n[i]===0?Me.STATIC_DRAW:Me.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function eHe(e,t,n,i,o,r){let s=[{index:so.positionHighAndScale,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[e2]},{index:so.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[e2]},{index:so.compressedAttribute0,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[Uae]},{index:so.compressedAttribute1,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[Oae]},{index:so.compressedAttribute2,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[Bae]},{index:so.eyeOffset,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[Dae]},{index:so.scaleByDistance,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[Yae]},{index:so.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[Hae]},{index:so.compressedAttribute3,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[zae]},{index:so.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[KOe]},{index:so.splitDirection,componentsPerAttribute:1,componentDatatype:Q.FLOAT,usage:n[Jae]}];i&&s.push({index:so.direction,componentsPerAttribute:2,componentDatatype:Q.FLOAT,vertexBuffer:$Oe(e)}),l(o)&&s.push({index:so.a_batchId,componentsPerAttribute:1,componentDatatype:Q.FLOAT,bufferUsage:Me.STATIC_DRAW}),r&&s.push({index:so.sdf,componentsPerAttribute:2,componentDatatype:Q.FLOAT,usage:n[Kae]});let a=i?t:4*t;return new yp(e,s,a,i)}var bz=new Yn;function jae(e,t,n,i,o){let r,s=i[so.positionHighAndScale],a=i[so.positionLowAndRotation],c=o._getActualPosition();e._mode===oe.SCENE3D&&(ce.expand(e._baseVolume,c,e._baseVolume),e._boundingVolumeDirty=!0),Yn.fromCartesian(c,bz);let d=o.scale,u=o.rotation;u!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,d);let m=bz.high,p=bz.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 Vu=new D,Cu=32768,KC=65536,gz=4096,lf=256,tHe=128,nHe=32,iHe=8,qae=4,oHe=1/256,$ae=0,ece=2,tce=3,nce=1;function ice(e,t,n,i,o){let r,s=i[so.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 g=o.horizontalOrigin,f=o._verticalOrigin,x=o.show&&o.clusterShow;o.color.alpha===0&&(x=!1),f===Pn.BASELINE&&(f=Pn.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&g===gi.CENTER,e._allVerticalCenter=e._allVerticalCenter&&f===Pn.CENTER;let _=0,C=0,V=0,L=0,Z=o._imageIndex;if(Z!==-1){let B=n[Z];_=B.x,C=B.y,V=B.width,L=B.height}let E=_+V,X=C+L,v=Math.floor(W.clamp(c,-Cu,Cu)+Cu)*tHe;v+=(g+1)*nHe,v+=(f+1)*iHe,v+=(x?1:0)*qae;let P=Math.floor(W.clamp(d,-Cu,Cu)+Cu)*lf,A=Math.floor(W.clamp(m,-Cu,Cu)+Cu)*lf,M=(W.clamp(p,-Cu,Cu)+Cu)*oHe,b=Math.floor(M),R=Math.floor((M-b)*lf);P+=b,A+=R,Vu.x=_,Vu.y=C;let G=wn.compressTextureCoordinates(Vu);Vu.x=E;let I=wn.compressTextureCoordinates(Vu);Vu.y=X;let w=wn.compressTextureCoordinates(Vu);Vu.x=_;let N=wn.compressTextureCoordinates(Vu);e._instanced?(r=o._index,s(r,v,P,A,G)):(r=o._index*4,s(r+0,v+$ae,P,A,G),s(r+1,v+ece,P,A,I),s(r+2,v+tce,P,A,w),s(r+3,v+nce,P,A,N))}function oce(e,t,n,i,o){let r,s=i[so.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 g=0,f=o._imageIndex;f!==-1&&(g=n[f].width);let x=e._textureAtlas.texture.width,_=Math.round(y(o.width,x*g));e._maxSize=Math.max(e._maxSize,_);let C=W.clamp(_,0,KC),V=0;Math.abs(h.magnitudeSquared(a)-1)<W.EPSILON6&&(V=wn.octEncodeFloat(a)),d=W.clamp(d,0,1),d=d===1?255:d*255|0,C=C*lf+d,m=W.clamp(m,0,1),m=m===1?255:m*255|0,V=V*lf+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 xz(e,t,n,i,o){let r,s=i[so.compressedAttribute2],a=o.color,c=l(e._batchTable)?Y.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 g=e._textureAtlas.texture.dimensions,f=Math.round(y(o.height,g.y*m));e._maxSize=Math.max(e._maxSize,f);let x=y(o._labelHorizontalOrigin,-2);x+=2;let _=f*qae+x,C=Y.floatToByte(a.red),V=Y.floatToByte(a.green),L=Y.floatToByte(a.blue),Z=C*KC+V*lf+L;C=Y.floatToByte(c.red),V=Y.floatToByte(c.green),L=Y.floatToByte(c.blue);let E=C*KC+V*lf+L,X=Y.floatToByte(a.alpha)*KC+Y.floatToByte(c.alpha)*lf;X+=d*2+u,e._instanced?(r=o._index,s(r,Z,E,X,_)):(r=o._index*4,s(r+0,Z,E,X,_),s(r+1,Z,E,X,_),s(r+2,Z,E,X,_),s(r+3,Z,E,X,_))}function _z(e,t,n,i,o){let r,s=i[so.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 g=n[m];d=g.width,u=g.height}Vu.x=d,Vu.y=u;let p=wn.compressTextureCoordinates(Vu);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 rce(e,t,n,i,o){let r,s=i[so.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 sce(e,t,n,i,o){let r,s=i[so.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 ace(e,t,n,i,o){let r,s=i[so.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=du(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,g;if(l(o._labelDimensions))g=o._labelDimensions.x,p=o._labelDimensions.y;else{let C=0,V=0,L=o._imageIndex;if(L!==-1){let E=n[L];C=E.height,V=E.width}p=Math.round(y(o.height,e._textureAtlas.texture.dimensions.y*C));let Z=e._textureAtlas.texture.width;g=Math.round(y(o.width,Z*V))}let f=Math.floor(W.clamp(g,0,gz)),x=Math.floor(W.clamp(p,0,gz)),_=f*gz+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 cce(e,t,n,i,o){if(du(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[so.textureCoordinateBoundsOrLabelTranslate];if(Dt.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,g=c+u;e._instanced?(r=o._index,s(r,a,c,p,g)):(r=o._index*4,s(r+0,a,c,p,g),s(r+1,a,c,p,g),s(r+2,a,c,p,g),s(r+3,a,c,p,g))}function rHe(e,t,n,i,o){if(!l(e._batchTable))return;let r=i[so.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 lce(e,t,n,i,o){if(!e._sdf)return;let r,s=i[so.sdf],a=o.outlineColor,c=o.outlineWidth,d=Y.floatToByte(a.red),u=Y.floatToByte(a.green),m=Y.floatToByte(a.blue),p=d*KC+u*lf+m,g=c/As.RADIUS,f=Y.floatToByte(a.alpha)*KC+Y.floatToByte(g)*lf;e._instanced?(r=o._index,s(r,p,f)):(r=o._index*4,s(r+0,p+$ae,f),s(r+1,p+ece,f),s(r+2,p+tce,f),s(r+3,p+nce,f))}function dce(e,t,n,i,o){let r=i[so.splitDirection],s=0,a=o.splitDirection;l(a)&&(s=a);let c;e._instanced?(c=o._index,r(c,s)):(c=o._index*4,r(c+0,s),r(c+1,s),r(c+2,s),r(c+3,s))}function sHe(e,t,n,i,o){jae(e,t,n,i,o),ice(e,t,n,i,o),oce(e,t,n,i,o),xz(e,t,n,i,o),_z(e,t,n,i,o),rce(e,t,n,i,o),sce(e,t,n,i,o),ace(e,t,n,i,o),cce(e,t,n,i,o),rHe(e,t,n,i,o),lce(e,t,n,i,o),dce(e,t,n,i,o)}function yz(e,t,n,i,o,r){let s;i.mode===oe.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=ro._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 aHe(e,t){let n=t.mode,i=e._billboards,o=e._billboardsToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==oe.SCENE3D&&!F.equals(r,e.modelMatrix)?(e._mode=n,F.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===oe.SCENE3D||n===oe.SCENE2D||n===oe.COLUMBUS_VIEW)&&yz(e,i,i.length,t,r,!0)):n===oe.MORPHING?yz(e,i,i.length,t,r,!0):(n===oe.SCENE2D||n===oe.COLUMBUS_VIEW)&&yz(e,o,e._billboardsToUpdateIndex,t,r,!1)}function cHe(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 lHe(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=Re.OVERLAY,i}var dHe=[];Lu.prototype.update=function(e){if(Sz(this),!this.show)return;let t=this._billboards,n=t.length,i=e.context;this._instanced=i.instancedArrays,so=this._instanced?QOe:JOe,pz=this._instanced?qOe:jOe;let o=this._textureAtlas;if(!l(o)){o=this._textureAtlas=new Tg({context:i});for(let P=0;P<n;++P)t[P]._loadImage()}let r=o.textureCoordinates;if(r.length===0)return;aHe(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,g=p.pick;if(u||!g&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let P=0;P<Tz;++P)c[P]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=eHe(i,n,this._buffersUsage,this._instanced,this._batchTable,this._sdf),m=this._vaf.writers;for(let P=0;P<n;++P){let A=this._billboards[P];A._dirty=!1,sHe(this,e,r,m,A)}this._vaf.commit(pz(i))}this._billboardsToUpdateIndex=0}else if(a>0){let P=dHe;P.length=0,(c[e2]||c[OOe]||c[YOe])&&P.push(jae),(c[$W]||c[Uae]||c[DOe]||c[BOe]||c[UOe])&&(P.push(ice),this._instanced&&P.push(_z)),(c[$W]||c[HOe]||c[Oae])&&(P.push(oce),P.push(xz)),(c[$W]||c[Bae])&&P.push(xz),c[Dae]&&P.push(_z),c[Yae]&&P.push(rce),c[Hae]&&P.push(sce),(c[zae]||c[zOe]||c[$W]||c[e2])&&P.push(ace),(c[$W]||c[e2])&&P.push(cce),c[Kae]&&P.push(lce),c[Jae]&&P.push(dce);let A=P.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<A;++R)P[R](this,e,r,m,b)}this._vaf.commit(pz(i))}else{for(let M=0;M<a;++M){let b=s[M];b._dirty=!1;for(let R=0;R<A;++R)P[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=F.IDENTITY;e.mode===oe.SCENE3D?(x=this.modelMatrix,f=ce.clone(this._baseVolumeWC,this._boundingVolume)):f=ce.clone(this._baseVolume2D,this._boundingVolume),cHe(this,e,f);let _=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,_){this._blendOption===Lo.OPAQUE||this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ue.fromCache({depthTest:{enabled:!0,func:ie.LESS},depthMask:!0}):this._rsOpaque=void 0;let P=this._blendOption===Lo.TRANSLUCENT;this._blendOption===Lo.TRANSLUCENT||this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ue.fromCache({depthTest:{enabled:!0,func:P?ie.LEQUAL:ie.LESS},depthMask:P,blending:un.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let C,V,L,Z,E,X=Dt.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=qW,V=jW,E=[],l(this._batchTable)&&(E.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:E,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&&(X?L.defines.push("VERTEX_DEPTH_CHECK"):L.defines.push("FRAGMENT_DEPTH_CHECK"));let P=1-As.CUTOFF;this._sdf&&L.defines.push("SDF");let A=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT&&(Z=new Oe({defines:["OPAQUE",A],sources:[V]}),this._shaderClampToGround&&(X?Z.defines.push("VERTEX_DEPTH_CHECK"):Z.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(Z.defines.push("SDF"),Z.defines.push(`SDF_EDGE ${P}`)),this._sp=rn.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:L,fragmentShaderSource:Z,attributeLocations:so}),Z=new Oe({defines:["TRANSLUCENT",A],sources:[V]}),this._shaderClampToGround&&(X?Z.defines.push("VERTEX_DEPTH_CHECK"):Z.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(Z.defines.push("SDF"),Z.defines.push(`SDF_EDGE ${P}`)),this._spTranslucent=rn.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:L,fragmentShaderSource:Z,attributeLocations:so})),this._blendOption===Lo.OPAQUE&&(Z=new Oe({defines:[A],sources:[V]}),this._shaderClampToGround&&(X?Z.defines.push("VERTEX_DEPTH_CHECK"):Z.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(Z.defines.push("SDF"),Z.defines.push(`SDF_EDGE ${P}`)),this._sp=rn.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:L,fragmentShaderSource:Z,attributeLocations:so})),this._blendOption===Lo.TRANSLUCENT&&(Z=new Oe({defines:[A],sources:[V]}),this._shaderClampToGround&&(X?Z.defines.push("VERTEX_DEPTH_CHECK"):Z.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(Z.defines.push("SDF"),Z.defines.push(`SDF_EDGE ${P}`)),this._spTranslucent=rn.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:L,fragmentShaderSource:Z,attributeLocations:so})),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 v=e.commandList;if(p.render||p.pick){let P=this._colorCommands,A=this._blendOption===Lo.OPAQUE,M=this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT,b=this._vaf.va,R=b.length,G=this._uniforms,I;l(this._batchTable)?(G=this._batchTable.getUniformMapCallback()(G),I=this._batchTable.getPickId()):I="v_pickColor",P.length=R;let w=M?R*2:R;for(let N=0;N<w;++N){let B=P[N];l(B)||(B=P[N]=new tt);let U=A||M&&N%2===0;B.pass=U||!M?Re.OPAQUE:Re.TRANSLUCENT,B.owner=this;let O=M?Math.floor(N/2):N;B.boundingVolume=f,B.modelMatrix=x,B.count=b[O].indicesCount,B.shaderProgram=U?this._sp:this._spTranslucent,B.uniformMap=G,B.vertexArray=b[O].va,B.renderState=U?this._rsOpaque:this._rsTranslucent,B.debugShowBoundingVolume=this.debugShowBoundingVolume,B.pickId=I,this._instanced&&(B.count=6,B.instanceCount=n),v.push(B)}this.debugShowTextureAtlas&&(l(this.debugCommand)||(this.debugCommand=lHe(this,e.context)),v.push(this.debugCommand))}};Lu.prototype.isDestroyed=function(){return!1};Lu.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(),Qae(this._billboards),me(this)};var yd=Lu;var K2n=T(S(),1);var k2n=T(S(),1);function uHe(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 p_=uHe;function oa(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),JC(this)}var mHe=new he;Object.defineProperties(oa.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=Y.clone(e,this._color),JC(this)}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=e,JC(this)}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=Y.clone(e,this._pointOutlineColor),JC(this)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=e,JC(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=y(this._heightOffset,0),n=this._content.tileset.ellipsoid,i=n.cartesianToCartographic(this._billboard.position,mHe);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=Y.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&&JC(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}}});oa.defaultColor=Y.WHITE;oa.defaultPointOutlineColor=Y.BLACK;oa.defaultPointOutlineWidth=0;oa.defaultPointSize=8;function JC(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=y(e._color,oa.defaultColor),i=y(e._pointOutlineColor,oa.defaultPointOutlineColor),o=y(e._pointOutlineWidth,oa.defaultPointOutlineWidth),r=y(e._pointSize,oa.defaultPointSize),s=e._billboardColor,a=e._billboardOutlineColor,c=e._billboardOutlineWidth,d=e._billboardSize;if(Y.equals(n,s)&&Y.equals(i,a)&&o===c&&r===d)return;e._billboardColor=Y.clone(n,e._billboardColor),e._billboardOutlineColor=Y.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=o,e._billboardSize=r;let u=n.alpha,m=n.toCssColorString(),p=i.toCssColorString(),g=JSON.stringify([m,r,p,o]);t.setImage(g,p_(u,m,p,o,r))}oa.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};oa.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};oa.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};oa.prototype.getPropertyInherited=function(e){return vs.getPropertyInherited(this._content,this._batchId,e)};oa.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};oa.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};oa.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};oa.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var o0=oa;var kPn=T(S(),1);var $2n=T(S(),1);function hHe(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 g=c.getContext("2d");g.font=n,g.fillStyle="white",g.fillRect(0,0,c.width+1,c.height+1),i&&(g.strokeStyle="black",g.lineWidth=e.lineWidth,g.strokeText(t,d/2,p)),o&&(g.fillStyle="black",g.fillText(t,d/2,p));let f=g.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 E=-1;for(C=0;C<u&&E===-1;++C)for(V=0;V<m;++V){let X=C*4+V*_;if(f[X]!==255||f[X+1]!==255||f[X+2]!==255||f[X+3]!==255){E=C;break}}return{width:r.width,height:Z-L,ascent:p-L,descent:Z-p,minx:E-d/2}}return{width:r.width,height:0,ascent:0,descent:0,minx:0}}var b_;function fHe(e,t){if(e==="")return;t=y(t,y.EMPTY_OBJECT);let n=y(t.font,"10px sans-serif"),i=y(t.stroke,!1),o=y(t.fill,!0),r=y(t.strokeWidth,1),s=y(t.backgroundColor,Y.TRANSPARENT),a=y(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(b_)||(l(u.imageSmoothingEnabled)?b_="imageSmoothingEnabled":l(u.mozImageSmoothingEnabled)?b_="mozImageSmoothingEnabled":l(u.webkitImageSmoothingEnabled)?b_="webkitImageSmoothingEnabled":l(u.msImageSmoothingEnabled)&&(b_="msImageSmoothingEnabled")),u.font=n,u.lineJoin="round",u.lineWidth=r,u[b_]=!1,d.style.visibility="hidden",document.body.appendChild(d);let m=hHe(u,e,n,i,o);d.dimensions=m,document.body.removeChild(d),d.style.visibility="";let p=-m.minx,g=Math.ceil(m.width)+p+c,f=m.height+c,x=f-m.ascent+a,_=f-x+c;if(d.width=g,d.height=f,u.font=n,u.lineJoin="round",u.lineWidth=r,u[b_]=!1,s!==Y.TRANSPARENT&&(u.fillStyle=s.toCssColorString(),u.fillRect(0,0,d.width,d.height)),i){let C=y(t.strokeColor,Y.BLACK);u.strokeStyle=C.toCssColorString(),u.strokeText(e,p+a,_)}if(o){let C=y(t.fillColor,Y.WHITE);u.fillStyle=C.toCssColorString(),u.fillText(e,p+a,_)}return d}var g_=fHe;var Tce=T(fce(),1);var xPn=T(S(),1);var iPn=T(S(),1),bHe={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2},No=Object.freeze(bHe);var pce={},bce=0,gHe=256,yHe=new Y(.165,.165,.165,.8),xHe=new D(7,5),cs=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function y_(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function n2(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function i2(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function yce(e){let t=pce[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(i2(n,"line-height"));isNaN(i)&&(i=void 0),t={family:i2(n,"font-family"),size:i2(n,"font-size").replace("px",""),style:i2(n,"font-style"),weight:i2(n,"font-weight"),lineHeight:i},document.body.removeChild(n),bce<gHe&&(pce[e._font]=t,bce++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function r0(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=kt.clone(n)),l(i)&&(i=kt.clone(i)),l(o)&&(o=kt.clone(o)),l(r)&&(r=Pt.clone(r)),this._renderedText=void 0,this._text=void 0,this._show=y(e.show,!0),this._font=y(e.font,"30px sans-serif"),this._fillColor=Y.clone(y(e.fillColor,Y.WHITE)),this._outlineColor=Y.clone(y(e.outlineColor,Y.BLACK)),this._outlineWidth=y(e.outlineWidth,1),this._showBackground=y(e.showBackground,!1),this._backgroundColor=Y.clone(y(e.backgroundColor,yHe)),this._backgroundPadding=D.clone(y(e.backgroundPadding,xHe)),this._style=y(e.style,No.FILL),this._verticalOrigin=y(e.verticalOrigin,Pn.BASELINE),this._horizontalOrigin=y(e.horizontalOrigin,gi.LEFT),this._pixelOffset=D.clone(y(e.pixelOffset,D.ZERO)),this._eyeOffset=h.clone(y(e.eyeOffset,h.ZERO)),this._position=h.clone(y(e.position,h.ZERO)),this._scale=y(e.scale,1),this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=o,this._heightReference=y(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=y(e.text,""),this._relativeSize=1,yce(this),this._updateClamping()}Object.defineProperties(r0.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),n2(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=r0.enableRightToLeftDetection?LHe(t):t,y_(this)}}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,y_(this),yce(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){let t=this._fillColor;Y.equals(t,e)||(Y.clone(e,t),y_(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;Y.equals(t,e)||(Y.clone(e,t),y_(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,y_(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,y_(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){let t=this._backgroundColor;if(!Y.equals(t,e)){Y.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;D.equals(t,e)||(D.clone(e,t),n2(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,y_(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;if(!D.equals(t,e)){D.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(!kt.equals(t,e)){this._translucencyByDistance=kt.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(!kt.equals(t,e)){this._pixelOffsetScaleByDistance=kt.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(!kt.equals(t,e)){this._scaleByDistance=kt.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,n2(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),n2(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),n2(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!Pt.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=Pt.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)}}}});r0.prototype._updateClamping=function(){ro._updateClamping(this._labelCollection,this)};r0.prototype.computeScreenSpacePosition=function(e,t){l(t)||(t=new D);let i=this._labelCollection.modelMatrix,o=l(this._actualClampedPosition)?this._actualClampedPosition:this._position;return ro._computeScreenSpacePosition(i,o,this._eyeOffset,this._pixelOffset,e,t)};r0.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===Pn.BOTTOM||e.verticalOrigin===Pn.BASELINE?o-=s:e.verticalOrigin===Pn.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 g=0;g<p;++g){let f=m[g],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===Pn.BOTTOM||e.verticalOrigin===Pn.BASELINE?C-=L:e.verticalOrigin===Pn.CENTER&&(C-=L*.5),e._verticalOrigin===Pn.TOP?C+=As.PADDING*a:(e._verticalOrigin===Pn.BOTTOM||e._verticalOrigin===Pn.BASELINE)&&(C-=As.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 Ke),n.x=i,n.y=o,n.width=r,n.height=s,n};r0.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)&&Y.equals(this._fillColor,e._fillColor)&&Y.equals(this._outlineColor,e._outlineColor)&&Y.equals(this._backgroundColor,e._backgroundColor)&&D.equals(this._backgroundPadding,e._backgroundPadding)&&D.equals(this._pixelOffset,e._pixelOffset)&&h.equals(this._eyeOffset,e._eyeOffset)&&kt.equals(this._translucencyByDistance,e._translucencyByDistance)&&kt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&kt.equals(this._scaleByDistance,e._scaleByDistance)&&Pt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id};r0.prototype.isDestroyed=function(){return!1};r0.enableRightToLeftDetection=!1;function _He(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,o=[],r="",s=cs.LTR,a="",c=e.length;for(let d=0;d<c;++d){let u=e.charAt(d);t.test(u)?a=cs.RTL:n.test(u)?a=cs.LTR:i.test(u)?a=cs.BRACKETS:a=cs.WEAK,d===0&&(s=a),s===a&&a!==cs.BRACKETS?r+=u:(r!==""&&o.push({Type:s,Word:r}),s=a,r=u)}return o.push({Type:a,Word:r}),o}function THe(e){return e.split("").reverse().join("")}function o2(e,t,n){return e.slice(0,t)+n+e.slice(t)}function SHe(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var CHe="\u05D0-\u05EA",VHe="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",gce=new RegExp(`[${CHe}${VHe}]`);function LHe(e){let t=e.split(`
`),n="";for(let i=0;i<t.length;i++){let o=t[i],r=gce.test(o.charAt(0)),s=_He(o,gce),a=0,c="";for(let d=0;d<s.length;++d){let u=s[d],m=u.Type===cs.BRACKETS?SHe(u.Word):THe(u.Word);r?u.Type===cs.RTL?(c=m+c,a=0):u.Type===cs.LTR?(c=o2(c,a,u.Word),a+=u.Word.length):(u.Type===cs.WEAK||u.Type===cs.BRACKETS)&&(u.Type===cs.WEAK&&s[d-1].Type===cs.BRACKETS?c=m+c:s[d-1].Type===cs.RTL?(c=m+c,a=0):s.length>d+1?s[d+1].Type===cs.RTL?(c=m+c,a=0):(c=o2(c,a,u.Word),a+=u.Word.length):c=o2(c,0,m)):u.Type===cs.RTL?c=o2(c,a,m):u.Type===cs.LTR?(c+=u.Word,a=c.length):(u.Type===cs.WEAK||u.Type===cs.BRACKETS)&&(d>0&&s[d-1].Type===cs.RTL?s.length>d+1?s[d+1].Type===cs.RTL?c=o2(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 Sg=r0;var Sce=T(xce(),1);function ZHe(){this.textureInfo=void 0,this.dimensions=void 0,this.billboard=void 0}function GHe(e,t,n){this.labelCollection=e,this.index=t,this.dimensions=n}var EHe=1.2,Cce="ID_WHITE_PIXEL",Cz=new D(4,4),XHe=new Ke(1,1,1,1);function IHe(e){let t=document.createElement("canvas");t.width=Cz.x,t.height=Cz.y;let n=t.getContext("2d");return n.fillStyle="#fff",n.fillRect(0,0,t.width,t.height),e.addImage(Cce,t)}var Ru={};function WHe(e,t,n,i,o,r,s){return Ru.font=t,Ru.fillColor=n,Ru.strokeColor=i,Ru.strokeWidth=o,Ru.padding=As.PADDING,s===Pn.CENTER?Ru.textBaseline="middle":s===Pn.TOP?Ru.textBaseline="top":Ru.textBaseline="bottom",Ru.fill=r===No.FILL||r===No.FILL_AND_OUTLINE,Ru.stroke=r===No.OUTLINE||r===No.FILL_AND_OUTLINE,Ru.backgroundColor=Y.BLACK,g_(e,Ru)}function Vz(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 PHe(e,t,n,i){i.index=e.addImageSync(t,n)}var vHe=new Sce.default;function wHe(e,t){let n=t._renderedText,i=vHe.splitGraphemes(n),o=i.length,r=t._glyphs,s=r.length,a,c,d;if(t._relativeSize=t._fontSize/As.FONT_SIZE,o<s)for(c=o;c<s;++c)Vz(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:Cce,imageSubRegion:XHe}),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=gi.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 g=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=g[_];if(!l(C)){let V=`${t._fontStyle} ${t._fontWeight} ${As.FONT_SIZE}px ${t._fontFamily}`,L=WHe(f,V,Y.WHITE,Y.WHITE,0,No.FILL,x);if(C=new GHe(e,-1,L.dimensions),g[_]=C,L.width>0&&L.height>0){let Z=(0,Tce.default)(L,{cutoff:As.CUTOFF,radius:As.RADIUS}),E=L.getContext("2d"),X=L.width,v=L.height,P=E.getImageData(0,0,X,v);for(let A=0;A<X;A++)for(let M=0;M<v;M++){let b=M*X+A,R=Z[b]*255,G=b*4;P.data[G+0]=R,P.data[G+1]=R,P.data[G+2]=R,P.data[G+3]=R}E.putImageData(P,0,0),f!==" "&&PHe(e._textureAtlas,_,L,C)}}if(a=r[d],l(a)?C.index===-1?Vz(e,a):l(a.textureInfo)&&(a.textureInfo=void 0):(a=new ZHe,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 D,V._labelTranslate=new D),a.billboard=V),V.show=t._show,V.position=t._position,V.eyeOffset=t._eyeOffset,V.pixelOffset=t._pixelOffset,V.horizontalOrigin=gi.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=Y.TRANSPARENT,V.outlineWidth=t.outlineWidth)}}t._repositionAllGlyphs=!0}function _ce(e,t,n){return t===gi.CENTER?-e/2:t===gi.RIGHT?-(e+n.x):n.x}var sr=new D,FHe=new D;function AHe(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,g=e._backgroundBillboard,f=D.clone(l(g)?e._backgroundPadding:D.ZERO,FHe);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],E=_ce(Z,C,f),X=(l(e._lineHeight)?e._lineHeight:EHe*e._fontSize)/e._relativeSize,v=X*(u-1),P=s,A=x+v;l(g)&&(P+=f.x*2,A+=f.y*2,g._labelHorizontalOrigin=C),sr.x=E*_,sr.y=0;let M=!0,b=0;for(m=0;m<p;++m)if(n.charAt(m)===`
`)++L,b+=X,Z=a[L],E=_ce(Z,C,f),sr.x=E*_,M=!0;else if(i=t[m],o=i.dimensions,V===Pn.TOP?(sr.y=o.height-d-f.y,sr.y+=As.PADDING):V===Pn.CENTER?sr.y=(v+o.height-d)/2:V===Pn.BASELINE?(sr.y=v,sr.y-=As.PADDING):(sr.y=v+c+f.y,sr.y-=As.PADDING),sr.y=(sr.y-o.descent-b)*_,M&&(sr.x-=As.PADDING*_,M=!1),l(i.billboard)&&(i.billboard._setTranslate(sr),i.billboard._labelDimensions.x=P,i.billboard._labelDimensions.y=A,i.billboard._labelHorizontalOrigin=C),m<p-1){let R=t[m+1];sr.x+=(o.width-o.minx+R.dimensions.minx)*_}if(l(g)&&n.split(`
`).join("").length>0&&(C===gi.CENTER?E=-s/2-f.x:C===gi.RIGHT?E=-(s+f.x*2):E=0,sr.x=E*_,V===Pn.TOP?sr.y=x-d-c:V===Pn.CENTER?sr.y=(x-d)/2-c:V===Pn.BASELINE?sr.y=-f.y-c:sr.y=0,sr.y=sr.y*_,g.width=P,g.height=A,g._setTranslate(sr),g._labelTranslate=D.clone(sr,g._labelTranslate)),du(e.heightReference))for(m=0;m<p;++m){i=t[m];let R=i.billboard;l(R)&&(R._labelTranslate=D.clone(sr,R._labelTranslate))}}function Vce(e,t){let n=t._glyphs;for(let i=0,o=n.length;i<o;++i)Vz(e,n[i]);l(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,l(t._removeCallbackFunc)&&t._removeCallbackFunc(),me(t)}function df(e){e=y(e,y.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._backgroundTextureAtlas=void 0,this._backgroundBillboardCollection=new yd({scene:this._scene}),this._backgroundBillboardCollection.destroyTextureAtlas=!1,this._billboardCollection=new yd({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=Y.clone(Y.WHITE),this.show=y(e.show,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.blendOption=y(e.blendOption,Lo.OPAQUE_AND_TRANSLUCENT)}Object.defineProperties(df.prototype,{length:{get:function(){return this._labels.length}}});df.prototype.add=function(e){let t=new Sg(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};df.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),Vce(this,e),!0}return!1};df.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)Vce(this,e[t]);e.length=0};df.prototype.contains=function(e){return l(e)&&e._labelCollection===this};df.prototype.get=function(e){return this._labels[e]};df.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 Tg({context:i}),t.textureAtlas=this._textureAtlas),l(this._backgroundTextureAtlas)||(this._backgroundTextureAtlas=new Tg({context:i,initialSize:Cz}),n.textureAtlas=this._backgroundTextureAtlas,IHe(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&&(wHe(this,a),a._rebindAllGlyphs=!1),a._repositionAllGlyphs&&(AHe(a),a._repositionAllGlyphs=!1);let d=a._glyphs.length-c;this._totalGlyphCount+=d}let r=n.length>0?Lo.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)};df.prototype.isDestroyed=function(){return!1};df.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(),me(this)};var uf=df;var qvn=T(S(),1);var DPn=T(S(),1),r2=`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 hvn=T(S(),1);var tvn=T(S(),1);var Hc={};Hc.numberOfPoints=function(e,t,n){let i=h.distance(e,t);return Math.ceil(i/n)};Hc.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 MHe=new he;Hc.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,MHe).height}return i};var NHe=new F,kHe=new h,Lce=new h,UHe=new cn(h.UNIT_X,0),Rce=new h,DHe=new cn(h.UNIT_X,0),BHe=new h,YHe=new h,Rz=[];function Gce(e,t,n){let i=Rz;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 M5=new he,A5=new he,Cg=new h,Zz=new h,OHe=new h,Lz=new Sp,s2=new Ra;function HHe(e,t,n,i,o,r,s,a){let c=i.scaleToGeodeticSurface(e,Zz),d=i.scaleToGeodeticSurface(t,OHe),u=Hc.numberOfPoints(e,t,n),m=i.cartesianToCartographic(c,M5),p=i.cartesianToCartographic(d,A5),g=Gce(u,o,r);Lz.setEndPoints(m,p);let f=Lz.surfaceDistance/u,x=a;m.height=o;let _=i.cartographicToCartesian(m,Cg);h.pack(_,s,x),x+=3;for(let C=1;C<u;C++){let V=Lz.interpolateUsingSurfaceDistance(C*f,A5);V.height=g[C],_=i.cartographicToCartesian(V,Cg),h.pack(_,s,x),x+=3}return x}function zHe(e,t,n,i,o,r,s,a){let c=i.cartesianToCartographic(e,M5),d=i.cartesianToCartographic(t,A5),u=Hc.numberOfPointsRhumbLine(c,d,n);c.height=0,d.height=0;let m=Gce(u,o,r);s2.ellipsoid.equals(i)||(s2=new Ra(void 0,void 0,i)),s2.setEndPoints(c,d);let p=s2.surfaceDistance/u,g=a;c.height=o;let f=i.cartographicToCartesian(c,Cg);h.pack(f,s,g),g+=3;for(let x=1;x<u;x++){let _=s2.interpolateUsingSurfaceDistance(x*p,A5);_.height=m[x],f=i.cartographicToCartesian(_,Cg),h.pack(f,s,g),g+=3}return g}Hc.wrapLongitude=function(e,t){let n=[],i=[];if(l(e)&&e.length>0){t=y(t,F.IDENTITY);let o=F.inverseTransformation(t,NHe),r=F.multiplyByPoint(o,h.ZERO,kHe),s=h.normalize(F.multiplyByPointAsVector(o,h.UNIT_Y,Lce),Lce),a=cn.fromPointNormal(r,s,UHe),c=h.normalize(F.multiplyByPointAsVector(o,h.UNIT_X,Rce),Rce),d=cn.fromPointNormal(r,c,DHe),u=1;n.push(h.clone(e[0]));let m=n[0],p=e.length;for(let g=1;g<p;++g){let f=e[g];if(cn.getPointDistance(d,m)<0||cn.getPointDistance(d,f)<0){let x=qn.lineSegmentPlane(m,f,a,BHe);if(l(x)){let _=h.multiplyByScalar(s,5e-9,YHe);cn.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[g])),u++,m=f}i.push(u)}return{positions:n,lengths:i}};Hc.generateArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=y(e.ellipsoid,ne.default),o=y(e.height,0),r=Array.isArray(o);if(n<1)return[];if(n===1){let x=i.scaleToGeodeticSurface(t[0],Zz);if(o=r?o[0]:o,o!==0){let _=i.geodeticSurfaceNormal(x,Cg);h.multiplyByScalar(_,o,_),h.add(x,_,x)}return[x.x,x.y,x.z]}let s=e.minDistance;if(!l(s)){let x=y(e.granularity,W.RADIANS_PER_DEGREE);s=W.chordLength(x,i.maximumRadius)}let a=0,c;for(c=0;c<n-1;c++)a+=Hc.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=HHe(x,_,s,i,C,V,u,m)}Rz.length=0;let p=t[n-1],g=i.cartesianToCartographic(p,M5);g.height=r?o[n-1]:o;let f=i.cartographicToCartesian(g,Cg);return h.pack(f,u,d-3),u};var Zce=new he,KHe=new he;Hc.generateRhumbArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=y(e.ellipsoid,ne.default),o=y(e.height,0),r=Array.isArray(o);if(n<1)return[];if(n===1){let C=i.scaleToGeodeticSurface(t[0],Zz);if(o=r?o[0]:o,o!==0){let V=i.geodeticSurfaceNormal(C,Cg);h.multiplyByScalar(V,o,V),h.add(C,V,C)}return[C.x,C.y,C.z]}let s=y(e.granularity,W.RADIANS_PER_DEGREE),a=0,c,d=i.cartesianToCartographic(t[0],Zce),u;for(c=0;c<n-1;c++)u=i.cartesianToCartographic(t[c+1],KHe),a+=Hc.numberOfPointsRhumbLine(d,u,s),d=he.clone(u,Zce);let m=(a+1)*3,p=new Array(m),g=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;g=zHe(C,V,s,i,L,Z,p,g)}Rz.length=0;let f=t[n-1],x=i.cartesianToCartographic(f,M5);x.height=r?o[n-1]:o;let _=i.cartographicToCartesian(x,Cg);return h.pack(_,p,m-3),p};Hc.generateCartesianArc=function(e){let t=Hc.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};Hc.generateCartesianRhumbArc=function(e){let t=Hc.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 Zi=Hc;function xd(e,t){e=y(e,y.EMPTY_OBJECT),this._show=y(e.show,!0),this._width=y(e.width,1),this._loop=y(e.loop,!1),this._distanceDisplayCondition=e.distanceDisplayCondition,this._material=e.material,l(this._material)||(this._material=Ui.fromType(Ui.ColorType,{color:new Y(1,1,1,1)}));let n=e.positions;l(n)||(n=[]),this._positions=n,this._actualPositions=xo(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=F.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=Zi.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(Xce),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 Ece=xd.POSITION_INDEX=0,JHe=xd.SHOW_INDEX=1,QHe=xd.WIDTH_INDEX=2,jHe=xd.MATERIAL_INDEX=3,a2=xd.POSITION_SIZE_INDEX=4,qHe=xd.DISTANCE_DISPLAY_CONDITION=5,Xce=xd.NUMBER_OF_PROPERTIES=6;function s0(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(xd.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,s0(this,JHe))}},positions:{get:function(){return this._positions},set:function(e){let t=xo(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)&&s0(this,a2),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),s0(this,Ece),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,s0(this,jHe))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,s0(this,QHe))}},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,s0(this,a2)}}},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){Pt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Pt.clone(e,this._distanceDisplayCondition),s0(this,qHe))}}});xd.prototype.update=function(){let e=F.IDENTITY;l(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[Ece]>0||this._propertiesChanged[a2]>0;if((!F.equals(e,this._modelMatrix)||i)&&(this._segments=Zi.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=ce.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=F.clone(e,this._modelMatrix),this._segments.positions.length!==t)s0(this,a2);else{let o=n.length;for(let r=0;r<o;++r)if(n[r]!==this._segments.lengths[r]){s0(this,a2);break}}};xd.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};xd.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<Xce-1;++t)e[t]=0};xd.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var Zu=xd;var $He=Zu.SHOW_INDEX,eze=Zu.WIDTH_INDEX,Ez=Zu.POSITION_INDEX,tze=Zu.MATERIAL_INDEX,Ice=Zu.POSITION_SIZE_INDEX,nze=Zu.DISTANCE_DISPLAY_CONDITION,Mce=Zu.NUMBER_OF_PROPERTIES,vl={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 Ym(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=F.clone(F.IDENTITY),this.debugShowBoundingVolume=y(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(Mce),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:Me.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=Y.clone(Y.WHITE);let t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}Object.defineProperties(Ym.prototype,{length:{get:function(){return Xz(this),this._polylines.length}}});Ym.prototype.add=function(e){let t=new Zu(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};Ym.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};Ym.prototype.removeAll=function(){Iz(this),Bce(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};Ym.prototype.contains=function(e){return l(e)&&e._polylineCollection===this};Ym.prototype.get=function(e){return Xz(this),this._polylines[e]};function ize(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 ux(t,n,e._polylines.length)}var Nce=new Yn,kce=new se,Uce=new D;Ym.prototype.update=function(e){if(Xz(this),this._polylines.length===0||!this.show)return;lze(this,e);let t=e.context,n=e.mapProjection,i,o=this._propertiesChanged;if(this._createBatchTable){if(Dt.maximumVertexTextureImageUnits===0)throw new ue("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");ize(this,t),this._createBatchTable=!1}if(this._createVertexArray||rze(this))vce(this,t,n);else if(this._polylinesUpdated){let c=this._polylinesToUpdate;if(this._mode!==oe.SCENE3D){let d=c.length;for(let u=0;u<d;++u)i=c[u],i.update()}if(o[Ice]||o[tze])vce(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,g=0;for(let f in u)if(u.hasOwnProperty(f)){if(u[f]===p){o[Ez]&&p.writeUpdate(g,i,this._positionBuffer,n);break}g+=u[f].lengthOfPositions}if((o[$He]||o[eze])&&this._batchTable.setBatchedAttribute(i._index,0,new D(i._width,i._show)),this._batchTable.attributes.length>2){if(o[Ez]||o[Ice]){let f=e.mode===oe.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,x=Yn.fromCartesian(f.center,Nce),_=se.fromElements(x.low.x,x.low.y,x.low.z,f.radius,kce);this._batchTable.setBatchedAttribute(i._index,2,x.high),this._batchTable.setBatchedAttribute(i._index,3,_)}if(o[nze]){let f=Uce;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<Mce;++c)o[c]=0;let r=F.IDENTITY;e.mode===oe.SCENE3D&&(r=this.modelMatrix);let s=e.passes,a=e.morphTime!==0;if((!l(this._opaqueRS)||this._opaqueRS.depthTest.enabled!==a)&&(this._opaqueRS=Ue.fromCache({depthMask:a,depthTest:{enabled:a}})),(!l(this._translucentRS)||this._translucentRS.depthTest.enabled!==a)&&(this._translucentRS=Ue.fromCache({blending:un.ALPHA_BLEND,depthMask:!a,depthTest:{enabled:a}})),this._batchTable.update(e),s.render||s.pick){let c=this._colorCommands;oze(this,e,c,r)}};var c2=new ce,Wce=new ce;function oze(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(),g=d.length;for(let f=0;f<g;++f){let x=d[f],_=x.buckets,C=_.length;for(let V=0;V<C;++V){let L=_[V],Z=L.offset,E=L.bucket.shaderProgram,X=L.bucket.polylines,v=X.length,P,A,M=0,b,R;for(let G=0;G<v;++G){let I=X[G],w=aze(I._material);if(w!==P){if(l(P)&&M>0){let O=A.isTranslucent();a>=s?(b=new tt({owner:e}),n.push(b)):b=n[a],++a,R=_t(p(A._uniforms),e._uniformMap),b.boundingVolume=ce.clone(c2,b.boundingVolume),b.modelMatrix=i,b.shaderProgram=E,b.vertexArray=x.va,b.renderState=O?e._translucentRS:e._opaqueRS,b.pass=O?Re.TRANSLUCENT:Re.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)}A=I._material,A.update(o),P=w}let N=I._locatorBuckets,B=N.length;for(let O=0;O<B;++O){let k=N[O];k.locator===L&&(M+=k.count)}let U;t.mode===oe.SCENE3D?U=I._boundingVolumeWC:t.mode===oe.COLUMBUS_VIEW?U=I._boundingVolume2D:t.mode===oe.SCENE2D?l(I._boundingVolume2D)&&(U=ce.clone(I._boundingVolume2D,Wce),U.center.x=0):l(I._boundingVolumeWC)&&l(I._boundingVolume2D)&&(U=ce.union(I._boundingVolumeWC,I._boundingVolume2D,Wce)),c?(c=!1,ce.clone(U,c2)):ce.union(U,c2,c2)}l(P)&&M>0&&(a>=s?(b=new tt({owner:e}),n.push(b)):b=n[a],++a,R=_t(p(A._uniforms),e._uniformMap),b.boundingVolume=ce.clone(c2,b.boundingVolume),b.modelMatrix=i,b.shaderProgram=E,b.vertexArray=x.va,b.renderState=A.isTranslucent()?e._translucentRS:e._opaqueRS,b.pass=A.isTranslucent()?Re.TRANSLUCENT:Re.OPAQUE,b.debugShowBoundingVolume=u,b.pickId="v_pickColor",b.uniformMap=R,b.count=M,b.offset=Z,c=!0,r.push(b)),P=void 0}}n.length=a}Ym.prototype.isDestroyed=function(){return!1};Ym.prototype.destroy=function(){return Dce(this),Iz(this),Bce(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),me(this)};function rze(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[Ez]?(i.bufferUsage!==Me.STREAM_DRAW&&(t=!0,i.bufferUsage=Me.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==Me.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=Me.STATIC_DRAW):i.frameCount--),t}var Pce=[0,0,0];function vce(e,t,n){e._createVertexArray=!1,Iz(e),Dce(e),cze(e);let i=[[]],o=i[0],r=e._batchTable,s=e._useHighlightColor,a=[0],c=0,d=[[]],u=0,m=e._polylineBuckets,p,g;for(p in m)m.hasOwnProperty(p)&&(g=m[p],g.updateShader(t,r,s),u+=g.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)){g=m[p],g.write(x,_,V,L,Z,r,t,n),f===oe.MORPHING&&(l(C)||(C=new Float32Array(6*u*3)),g.writeForMorph(C,V));let R=g.lengthOfPositions;V+=6*R*3,L+=R*4,Z+=R*4,c=g.updateIndices(i,a,d,c)}let E=e._positionBufferUsage.bufferUsage,X=Me.STATIC_DRAW;e._positionBuffer=yt.createVertexBuffer({context:t,typedArray:x,usage:E});let v;l(C)&&(v=yt.createVertexBuffer({context:t,typedArray:C,usage:E})),e._texCoordExpandAndBatchIndexBuffer=yt.createVertexBuffer({context:t,typedArray:_,usage:X});let P=3*Float32Array.BYTES_PER_ELEMENT,A=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 G=new Uint16Array(o),I=yt.createIndexBuffer({context:t,typedArray:G,usage:Me.STATIC_DRAW,indexDatatype:Ae.UNSIGNED_SHORT});M+=a[R];let w=6*(R*(P*W.SIXTY_FOUR_KILOBYTES)-M*P),N=P+w,B=P+N,U=P+B,O=P+U,k=P+O,J=R*(A*W.SIXTY_FOUR_KILOBYTES)-M*A,H=[{index:vl.position3DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:w,strideInBytes:6*P},{index:vl.position3DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:N,strideInBytes:6*P},{index:vl.position2DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:w,strideInBytes:6*P},{index:vl.position2DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:N,strideInBytes:6*P},{index:vl.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:B,strideInBytes:6*P},{index:vl.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:U,strideInBytes:6*P},{index:vl.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:B,strideInBytes:6*P},{index:vl.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:U,strideInBytes:6*P},{index:vl.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:O,strideInBytes:6*P},{index:vl.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:k,strideInBytes:6*P},{index:vl.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:O,strideInBytes:6*P},{index:vl.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:k,strideInBytes:6*P},{index:vl.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:Q.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:J}],te,z,j,ee;f===oe.SCENE3D?(z=e._positionBuffer,te="vertexBuffer",j=Pce,ee="value"):f===oe.SCENE2D||f===oe.COLUMBUS_VIEW?(z=Pce,te="value",j=e._positionBuffer,ee="vertexBuffer"):(z=v,te="vertexBuffer",j=e._positionBuffer,ee="vertexBuffer"),H[0][te]=z,H[1][te]=z,H[2][ee]=j,H[3][ee]=j,H[4][te]=z,H[5][te]=z,H[6][ee]=j,H[7][ee]=j,H[8][te]=z,H[9][te]=z,H[10][ee]=j,H[11][ee]=j;let fe=new mi({context:t,attributes:H,indexBuffer:I});e._vertexArrays.push({va:fe,buckets:d[R]})}}}function sze(e,t){return t instanceof Ft?t.id:t}var N5=[];function aze(e){let t=Ui._uniformList[e.type],n=t.length;N5.length=2*n;let i=0;for(let o=0;o<n;++o){let r=t[o];N5[i]=r,N5[i+1]=e._uniforms[r](),i+=2}return`${e.type}:${JSON.stringify(N5,sze)}`}function cze(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 lze(e,t){let n=t.mode;(e._mode!==n||!F.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=F.clone(e.modelMatrix),e._createVertexArray=!0)}function Xz(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 Iz(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 Dce(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}Ym.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function Bce(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function Gz(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"),Ot.isInternetExplorer()||i.push("CLIP_POLYLINE");let o=new Oe({defines:i,sources:[`in vec4 v_pickColor;
`,this.material.shaderSource,Sx]}),r=t.getVertexShaderCallback()(r2),s=new Oe({defines:i,sources:[dd,r]});this.shaderProgram=rn.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:o,attributeLocations:vl})};function Yce(e){return h.dot(h.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(cn.ORIGIN_ZX_PLANE)===Kt.INTERSECTING}mf.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===oe.SCENE3D||!Yce(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 gs=new h,Gu=new h,Eu=new h,k5=new h,dze=new se,uze=new D;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 g=u[p],f=g.width,x=g.show&&f>0,_=g._index,C=this.getSegments(g,a),V=C.positions,L=C.lengths,Z=V.length,E=g.getPickId(s).color,X=0,v=0,P;for(let B=0;B<Z;++B){B===0?g._loop?P=V[Z-2]:(P=k5,h.subtract(V[0],V[1],P),h.add(V[0],P,P)):P=V[B-1],h.clone(P,Gu),h.clone(V[B],gs),B===Z-1?g._loop?P=V[1]:(P=k5,h.subtract(V[Z-1],V[Z-2],P),h.add(V[Z-1],P,P)):P=V[B+1],h.clone(P,Eu);let U=L[X];B===v+U&&(v+=U,++X);let O=B-v===0,k=B===v+L[X]-1;c===oe.SCENE2D&&(Gu.z=0,gs.z=0,Eu.z=0),(c===oe.SCENE2D||c===oe.MORPHING)&&(O||k)&&d-Math.abs(gs.x)<1&&((gs.x<0&&Gu.x>0||gs.x>0&&Gu.x<0)&&h.clone(gs,Gu),(gs.x<0&&Eu.x>0||gs.x>0&&Eu.x<0)&&h.clone(gs,Eu));let J=O?2:0,H=k?2:4;for(let te=J;te<H;++te){Yn.writeElements(gs,e,n),Yn.writeElements(Gu,e,n+6),Yn.writeElements(Eu,e,n+12);let z=te-2<0?-1:1;t[o]=B/(Z-1),t[o+1]=2*(te%2)-1,t[o+2]=z,t[o+3]=_,n+=6*3,o+=4}}let A=dze;A.x=Y.floatToByte(E.red),A.y=Y.floatToByte(E.green),A.z=Y.floatToByte(E.blue),A.w=Y.floatToByte(E.alpha);let M=uze;M.x=f,M.y=x?1:0;let b=c===oe.SCENE2D?g._boundingVolume2D:g._boundingVolumeWC,R=Yn.fromCartesian(b.center,Nce),G=R.high,I=se.fromElements(R.low.x,R.low.y,R.low.z,b.radius,kce),w=Uce;w.x=0,w.y=Number.MAX_VALUE;let N=g.distanceDisplayCondition;l(N)&&(w.x=N.near,w.y=N.far),r.setBatchedAttribute(_,0,M),r.setBatchedAttribute(_,1,A),r.attributes.length>2&&(r.setBatchedAttribute(_,2,G),r.setBatchedAttribute(_,3,I),r.setBatchedAttribute(_,4,w))}};var mze=new h,hze=new h,fze=new h,wce=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 g;p===0?s._loop?g=a[d-2]:(g=wce,h.subtract(a[0],a[1],g),h.add(a[0],g,g)):g=a[p-1],g=F.multiplyByPoint(n,g,hze);let f=F.multiplyByPoint(n,a[p],mze),x;p===d-1?s._loop?x=a[1]:(x=wce,h.subtract(a[d-1],a[d-2],x),h.add(a[d-1],x,x)):x=a[p+1],x=F.multiplyByPoint(n,x,fze);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 E=L;E<Z;++E)Yn.writeElements(f,e,t),Yn.writeElements(g,e,t+6),Yn.writeElements(x,e,t+12),t+=6*3}}};var pze=new Array(1);mf.prototype.updateIndices=function(e,t,n,i){let o=n.length-1,r=new Gz(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 g;if(this.mode===oe.SCENE3D){g=pze;let x=p._actualPositions.length;if(x>0)g[0]=x;else continue}else g=p._segments.lengths;let f=g.length;if(f>0){let x=0;for(let _=0;_<f;++_){let C=g[_]-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 Gz(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 Gz(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 QC={positions:void 0,lengths:void 0},Fce=new Array(1),bze=new h,gze=new he;mf.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===oe.SCENE3D)return Fce[0]=n.length,QC.positions=n,QC.lengths=Fce,QC;Yce(e)&&(n=e._segments.positions);let i=t.ellipsoid,o=[],r=this.modelMatrix,s=n.length,a,c=bze;for(let d=0;d<s;++d)a=n[d],c=F.multiplyByPoint(r,a,c),o.push(t.project(i.cartesianToCartographic(c,gze)));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 QC.positions=o,QC.lengths=e._segments.lengths,QC};var Ace;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=Ace,c=6*s*3;!l(a)||a.length<c?a=Ace=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,g=0,f=0,x;s=u.length;for(let _=0;_<s;++_){_===0?t._loop?x=u[s-2]:(x=k5,h.subtract(u[0],u[1],x),h.add(u[0],x,x)):x=u[_-1],h.clone(x,Gu),h.clone(u[_],gs),_===s-1?t._loop?x=u[1]:(x=k5,h.subtract(u[s-1],u[s-2],x),h.add(u[s-1],x,x)):x=u[_+1],h.clone(x,Eu);let C=m[g];_===f+C&&(f+=C,++g);let V=_-f===0,L=_===f+m[g]-1;o===oe.SCENE2D&&(Gu.z=0,gs.z=0,Eu.z=0),(o===oe.SCENE2D||o===oe.MORPHING)&&(V||L)&&r-Math.abs(gs.x)<1&&((gs.x<0&&Gu.x>0||gs.x>0&&Gu.x<0)&&h.clone(gs,Gu),(gs.x<0&&Eu.x>0||gs.x>0&&Eu.x<0)&&h.clone(gs,Eu));let Z=V?2:0,E=L?2:4;for(let X=Z;X<E;++X)Yn.writeElements(gs,a,p),Yn.writeElements(Gu,a,p+6),Yn.writeElements(Eu,a,p+12),p+=6*3}n.copyFromArrayView(a,6*3*Float32Array.BYTES_PER_ELEMENT*e)}};var Om=Ym;function Vg(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 yd({batchTable:e.batchTable}),this._labelCollection=new uf({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(Vg.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 yze(e,t){let n=e._rectangle,i=e._minHeight,o=e._maxHeight,r=2+ae.packedLength+ne.packedLength,s=new Float64Array(r),a=0;return s[a++]=i,s[a++]=o,ae.pack(n,s,a),a+=ae.packedLength,ne.pack(t,s,a),s}var xze=new bi("createVectorTilePoints",5),_ze=new h;function Tze(e,t){let n=e._positions,i=e._packedBuffer;l(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=yze(e,t));let o=[n.buffer,i.buffer],r={positions:n.buffer,packedBuffer:i.buffer},s=xze.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 g=0;g<p;++g){let f=m[g],x=h.unpack(n,g*3,_ze),_=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)})}Vg.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 o0(e,c,d,u,m)}};Vg.prototype.applyDebugSettings=function(e,t){e?(Y.clone(t,this._billboardCollection._highlightColor),Y.clone(t,this._labelCollection._highlightColor),Y.clone(t,this._polylineCollection._highlightColor)):(Y.clone(Y.WHITE,this._billboardCollection._highlightColor),Y.clone(Y.WHITE,this._labelCollection._highlightColor),Y.clone(Y.WHITE,this._polylineCollection._highlightColor))};function Sze(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=o0.defaultPointSize,s.color=o0.defaultColor,s.pointOutlineColor=o0.defaultPointOutlineColor,s.pointOutlineWidth=o0.defaultPointOutlineWidth,s.labelColor=Y.WHITE,s.labelOutlineColor=Y.WHITE,s.labelOutlineWidth=1,s.font="30px sans-serif",s.labelStyle=No.FILL,s.labelText=void 0,s.backgroundColor=new Y(.165,.165,.165,.8),s.backgroundPadding=new D(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=Y.WHITE,s.image=void 0,s.disableDepthTestDistance=0,s.horizontalOrigin=gi.CENTER,s.verticalOrigin=Pn.CENTER,s.labelHorizontalOrigin=gi.RIGHT,s.labelVerticalOrigin=Pn.BASELINE}}var Cze=new Y,Vze=new Y,Lze=new Y,Rze=new Y,Zze=new Y,Gze=new Y,l2=new kt,d2=new kt,Wz=new Pt;Vg.prototype.applyStyle=function(e,t){if(!l(e)){Sze(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,Cze)),l(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,Vze)),l(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),l(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,Lze)),l(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,Rze)),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,Zze)),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)?(l2.near=a.x,l2.nearValue=a.y,l2.far=a.z,l2.farValue=a.w,s.scaleByDistance=l2):s.scaleByDistance=void 0}else s.scaleByDistance=void 0;if(l(e.translucencyByDistance)){let a=e.translucencyByDistance.evaluate(s);l(a)?(d2.near=a.x,d2.nearValue=a.y,d2.far=a.z,d2.farValue=a.w,s.translucencyByDistance=d2):s.translucencyByDistance=void 0}else s.translucencyByDistance=void 0;if(l(e.distanceDisplayCondition)){let a=e.distanceDisplayCondition.evaluate(s);l(a)?(Wz.near=a.x,Wz.far=a.y,s.distanceDisplayCondition=Wz):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,Gze)),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))}};Vg.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=Tze(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)};Vg.prototype.isDestroyed=function(){return!1};Vg.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(),me(this)};var u2=Vg;var Wwn=T(S(),1);function a0(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=y(e.ellipsoid,ne.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=y(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=kn.BOTH}Object.defineProperties(a0.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 Eze(e){let t=new Float64Array(3+h.packedLength+ne.packedLength+ae.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,ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,ae.pack(e._rectangle,t,n),t}function Xze(e,t){let n=1,i=t[n++],o=e._boundingVolumes=new Array(i);for(let a=0;a<i;++a)o[a]=Gn.unpack(t,n),n+=Gn.packedLength;let r=t[n++],s=e._batchedIndices=new Array(r);for(let a=0;a<r;++a){let c=Y.unpack(t,n);n+=Y.packedLength;let d=t[n++],u=t[n++],m=t[n++],p=new Array(m);for(let g=0;g<m;++g)p[g]=t[n++];s[a]=new $h({color:c,offset:d,count:u,batchIds:p})}}var Ize=new bi("createVectorTilePolygons",5),Wze=new Y;function Pze(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(ae.center(e._rectangle)),r=e._transferrableBatchIds=new Uint32Array(e._batchIds),s=e._batchTableColors=new Uint32Array(r.length);let g=e._batchTable,f=s.length;for(let x=0;x<f;++x){let _=g.getColor(x,Wze);s[x]=_.toRgba()}a=e._packedBuffer=Eze(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=Ize.scheduleTask(d,c);if(l(p))return p.then(g=>{if(e.isDestroyed())return;e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;let f=new Float64Array(g.packedBuffer),x=f[0];Xze(e,f),e._indices=Ae.getSizeInBytes(x)===2?new Uint16Array(g.indices):new Uint32Array(g.indices),e._indexOffsets=new Uint32Array(g.indexOffsets),e._indexCounts=new Uint32Array(g.indexCounts),e._batchedPositions=new Float32Array(g.positions),e._vertexBatchIds=new Uint16Array(g.batchIds),vze(e),e._ready=!0}).catch(g=>{e.isDestroyed()||(e._error=g)})}function vze(e){l(e._primitive)||(e._primitive=new Ux({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)}a0.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};a0.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};a0.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};a0.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};a0.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=Pze(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)};a0.prototype.isDestroyed=function(){return!1};a0.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),me(this)};var m2=a0;var sFn=T(S(),1);var vwn=T(S(),1),h2=`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 Hm(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=y(e.ellipsoid,ne.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=Y.clone(Y.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Hm.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function wze(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+ae.packedLength+ne.packedLength+h.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,ae.pack(t,a,c),c+=ae.packedLength,ne.pack(o,a,c),c+=ne.packedLength,h.pack(r,a,c),a}var Fze=new bi("createVectorTilePolylines",5),jC={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function Aze(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=wze(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=Fze.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===Ae.UNSIGNED_SHORT?new Uint16Array(u.indices):new Uint32Array(u.indices),Mze(e,t),e._ready=!0}).catch(u=>{e.isDestroyed()||(e._error=u)})}function Mze(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=yt.createVertexBuffer({context:t,typedArray:i,usage:Me.STATIC_DRAW}),u=yt.createVertexBuffer({context:t,typedArray:n,usage:Me.STATIC_DRAW}),m=yt.createVertexBuffer({context:t,typedArray:o,usage:Me.STATIC_DRAW}),p=yt.createVertexBuffer({context:t,typedArray:r,usage:Me.STATIC_DRAW}),g=yt.createVertexBuffer({context:t,typedArray:s,usage:Me.STATIC_DRAW}),f=yt.createIndexBuffer({context:t,typedArray:a,usage:Me.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?Ae.UNSIGNED_SHORT:Ae.UNSIGNED_INT}),x=[{index:jC.previousPosition,vertexBuffer:d,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:jC.currentPosition,vertexBuffer:u,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:jC.nextPosition,vertexBuffer:m,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:jC.expandAndWidth,vertexBuffer:p,componentDatatype:Q.FLOAT,componentsPerAttribute:2},{index:jC.a_batchId,vertexBuffer:g,componentDatatype:Q.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new mi({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 f2=new F,Oce=new h;function Nze(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return F.clone(n,f2),F.multiplyByPoint(f2,e._center,Oce),F.setTranslation(f2,Oce,f2),f2},u_highlightColor:function(){return e._highlightColor}})}function kze(e){if(l(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=Ue.fromCache({blending:un.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var Uze=`uniform vec4 u_highlightColor; 
void main()
{
    out_FragColor = u_highlightColor;
}
`;function Dze(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(h2),o=n.getFragmentShaderCallback(!1,void 0,!1)(Uze),r=new Oe({defines:["VECTOR_TILE",Ot.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[dd,i]}),s=new Oe({defines:["VECTOR_TILE"],sources:[o]});e._sp=rn.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:jC})}function Bze(e,t){if(!l(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new tt({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:Re.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}Hm.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 g=(m+s)*3;u[d++]=i[g],u[d++]=i[g+1],u[d++]=i[g+2]}}return u};Hm.prototype.getPositions=function(e){return Hm.getPolylinePositions(this,e)};Hm.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)}};Hm.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function Yze(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=Y.WHITE}}var Oze=new Y,Hze=Y.WHITE,zze=!0;Hm.prototype.applyStyle=function(e,t){if(!l(e)){Yze(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,Oze):Hze,s.show=l(e.show)?e.show.evaluate(s):zze}};Hm.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=Aze(this,t)),l(this._error)){let i=this._error;throw this._error=void 0,i}return}Nze(this,t),Dze(this,t),kze(this);let n=e.passes;(n.render||n.pick)&&Bze(this,e)};Hm.prototype.isDestroyed=function(){return!1};Hm.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),me(this)};var x_=Hm;var HFn=T(S(),1);var cFn=T(S(),1),p2=`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 dFn=T(S(),1),b2=`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 c0(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=y(e.ellipsoid,ne.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 D(ai._defaultMinTerrainHeight,ai._defaultMaxTerrainHeight),this._boundingVolume=Gn.fromRectangle(e.rectangle,ai._defaultMinTerrainHeight,ai._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=Y.clone(Y.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(c0.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function Kze(e,t,n){let i=ai.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;Gn.fromRectangle(c,o,r,n,a)}function Jze(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+ae.packedLength+ne.packedLength+h.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,ae.pack(t,a,c),c+=ae.packedLength,ne.pack(o,a,c),c+=ne.packedLength,h.pack(r,a,c),a}var Qze=new bi("createVectorTileClampedPolylines"),Lg={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function jze(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=Jze(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=Qze.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===Ae.UNSIGNED_SHORT?new Uint16Array(u.indices):new Uint32Array(u.indices),qze(e,t),e._ready=!0}).catch(u=>{e.isDestroyed()||(e._error=u)})}function qze(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=yt.createVertexBuffer({context:t,typedArray:n,usage:Me.STATIC_DRAW}),p=yt.createVertexBuffer({context:t,typedArray:i,usage:Me.STATIC_DRAW}),g=yt.createVertexBuffer({context:t,typedArray:o,usage:Me.STATIC_DRAW}),f=yt.createVertexBuffer({context:t,typedArray:r,usage:Me.STATIC_DRAW}),x=yt.createVertexBuffer({context:t,typedArray:s,usage:Me.STATIC_DRAW}),_=yt.createVertexBuffer({context:t,typedArray:a,usage:Me.STATIC_DRAW}),C=yt.createVertexBuffer({context:t,typedArray:c,usage:Me.STATIC_DRAW}),V=yt.createIndexBuffer({context:t,typedArray:d,usage:Me.STATIC_DRAW,indexDatatype:d.BYTES_PER_ELEMENT===2?Ae.UNSIGNED_SHORT:Ae.UNSIGNED_INT}),L=[{index:Lg.startEllipsoidNormal,vertexBuffer:m,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:Lg.endEllipsoidNormal,vertexBuffer:p,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:Lg.startPositionAndHeight,vertexBuffer:g,componentDatatype:Q.FLOAT,componentsPerAttribute:4},{index:Lg.endPositionAndHeight,vertexBuffer:f,componentDatatype:Q.FLOAT,componentsPerAttribute:4},{index:Lg.startFaceNormalAndVertexCorner,vertexBuffer:x,componentDatatype:Q.FLOAT,componentsPerAttribute:4},{index:Lg.endFaceNormalAndHalfWidth,vertexBuffer:_,componentDatatype:Q.FLOAT,componentsPerAttribute:4},{index:Lg.a_batchId,vertexBuffer:C,componentDatatype:Q.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new mi({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 g2=new F,Hce=new h;function $ze(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return F.clone(n,g2),F.multiplyByPoint(g2,e._center,Hce),F.setTranslation(g2,Hce,g2),g2},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function zce(e){return Ue.fromCache({cull:{enabled:!0,face:yi.FRONT},blending:un.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Un.EQUAL,frontOperation:{fail:bt.KEEP,zFail:bt.KEEP,zPass:bt.KEEP},backFunction:Un.EQUAL,backOperation:{fail:bt.KEEP,zFail:bt.KEEP,zPass:bt.KEEP},reference:Bt.CESIUM_3D_TILE_MASK,mask:Bt.CESIUM_3D_TILE_MASK}})}function eKe(e){l(e._rs)||(e._rs=zce(!1),e._rs3DTiles=zce(!0))}function tKe(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(p2),o=n.getFragmentShaderCallback(!1,void 0,!0)(b2),r=new Oe({defines:["VECTOR_TILE",Ot.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[dd,i]}),s=new Oe({defines:["VECTOR_TILE"],sources:[o]});e._sp=rn.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:Lg})}function nKe(e,t){let n=e._command;if(!l(e._command)){let o=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new tt({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:o,boundingVolume:e._boundingVolume,pass:Re.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let r=tt.shallowClone(n,n.derivedCommands.tileset);r.renderState=e._rs3DTiles,r.pass=Re.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=r}let i=e._classificationType;(i===kn.TERRAIN||i===kn.BOTH)&&t.commandList.push(n),(i===kn.CESIUM_3D_TILE||i===kn.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}c0.prototype.getPositions=function(e){return x_.getPolylinePositions(this,e)};c0.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)}};c0.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function iKe(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=Y.WHITE}}var oKe=new Y,rKe=Y.WHITE,sKe=!0;c0.prototype.applyStyle=function(e,t){if(!l(e)){iKe(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,oKe):rKe,s.show=l(e.show)?e.show.evaluate(s):sKe}};function aKe(e){return ai.initialize().then(function(){Kze(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}c0.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=aKe(this).then(jze(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}$ze(this,t),tKe(this,t),eKe(this);let n=e.passes;(n.render||n.pick)&&nKe(this,e)};c0.prototype.isDestroyed=function(){return!1};c0.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),me(this)};var y2=c0;var qFn=T(S(),1);var Pz=32767,cKe=new he,lKe=new h;function dKe(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);wn.zigZagDeltaDecode(s,a,c);let d=new Float64Array(e.length);for(let u=0;u<r;++u){let m=s[u],p=a[u],g=c[u],f=W.lerp(t.west,t.east,m/Pz),x=W.lerp(t.south,t.north,p/Pz),_=W.lerp(n,i,g/Pz),C=he.fromRadians(f,x,_,cKe),V=o.cartographicToCartesian(C,lKe);h.pack(V,d,u*3)}return d}var x2=dKe;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,pKe(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 uKe(e){return function(t,n){l(e._polygons)&&e._polygons.updateCommands(t,n)}}function mKe(e,t){let n,i,o,r,s=y(e.POLYGONS_LENGTH,0),a=y(e.POLYLINES_LENGTH,0),c=y(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 ue("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 zm=Uint32Array.BYTES_PER_ELEMENT;function hKe(e){return new x_(e)}function fKe(e){return new y2(e)}function pKe(e,t,n){n=y(n,0);let i=new Uint8Array(t),o=new DataView(t);n+=zm;let r=o.getUint32(n,!0);if(r!==1)throw new ue(`Only Vector tile version 1 is supported.  Version ${r} is not.`);n+=zm;let s=o.getUint32(n,!0);if(n+=zm,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=zm,a===0)throw new ue("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=zm;let d=o.getUint32(n,!0);n+=zm;let u=o.getUint32(n,!0);n+=zm;let m=o.getUint32(n,!0);n+=zm;let p=o.getUint32(n,!0);n+=zm;let g=o.getUint32(n,!0);n+=zm;let f=o.getUint32(n,!0);n+=zm;let x=Io(i,n,a);n+=a;let _=new Uint8Array(t,n,c);n+=c;let C,V;d>0&&(C=Io(i,n,d),n+=d,u>0&&(V=new Uint8Array(t,n,u),V=new Uint8Array(V),n+=u));let L=y(x.POLYGONS_LENGTH,0),Z=y(x.POLYLINES_LENGTH,0),E=y(x.POINTS_LENGTH,0),X=L+Z+E,v=new vp(e,X,C,V,uKe(e));if(e._batchTable=v,X===0)return;let P=new km(x,_),A=P.getGlobalProperty("REGION");if(!l(A))throw new ue("Feature table global property: REGION must be defined");let M=ae.unpack(A),b=A[4],R=A[5],G=e._tile.computedTransform,I=P.getGlobalProperty("RTC_CENTER",Q.FLOAT,3);l(I)?(I=h.unpack(I),F.multiplyByPoint(G,I,I)):(I=ae.center(M),I.height=W.lerp(b,R,.5),I=ne.WGS84.cartographicToCartesian(I));let w=mKe(x,_);if(n+=(4-n%4)%4,L>0){P.featuresLength=L;let N=y(P.getPropertyArray("POLYGON_COUNTS",Q.UNSIGNED_INT,1),P.getPropertyArray("POLYGON_COUNT",Q.UNSIGNED_INT,1));if(!l(N))throw new ue("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let B=y(P.getPropertyArray("POLYGON_INDEX_COUNTS",Q.UNSIGNED_INT,1),P.getPropertyArray("POLYGON_INDEX_COUNT",Q.UNSIGNED_INT,1));if(!l(B))throw new ue("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let U=N.reduce(function(z,j){return z+j*2},0),O=B.reduce(function(z,j){return z+j},0),k=new Uint32Array(t,n,O);n+=m;let J=new Uint16Array(t,n,U);n+=p;let H,te;l(x.POLYGON_MINIMUM_HEIGHTS)&&l(x.POLYGON_MAXIMUM_HEIGHTS)&&(H=P.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",Q.FLOAT,1),te=P.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",Q.FLOAT,1)),e._polygons=new m2({positions:J,counts:N,indexCounts:B,indices:k,minimumHeight:b,maximumHeight:R,polygonMinimumHeights:H,polygonMaximumHeights:te,center:I,rectangle:M,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:v,batchIds:w.polygons,modelMatrix:G})}if(Z>0){P.featuresLength=Z;let N=y(P.getPropertyArray("POLYLINE_COUNTS",Q.UNSIGNED_INT,1),P.getPropertyArray("POLYLINE_COUNT",Q.UNSIGNED_INT,1));if(!l(N))throw new ue("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let B=P.getPropertyArray("POLYLINE_WIDTHS",Q.UNSIGNED_SHORT,1);if(!l(B)){B=new Uint16Array(Z);for(let te=0;te<Z;++te)B[te]=2}let U=N.reduce(function(te,z){return te+z*3},0),O=new Uint16Array(t,n,U);n+=g;let k=e._tileset,J=k.examineVectorLinesFunction;if(l(J)){let te=x2(new Uint16Array(O),M,b,R,ne.WGS84);bKe(te,N,w.polylines,v,e.url,J)}let H=hKe;l(k.classificationType)&&(H=fKe),e._polylines=H({positions:O,widths:B,counts:N,batchIds:w.polylines,minimumHeight:b,maximumHeight:R,center:I,rectangle:M,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:v,classificationType:k.classificationType,keepDecodedPositions:k.vectorKeepDecodedPositions})}if(E>0){let N=new Uint16Array(t,n,E*3);n+=f,e._points=new u2({positions:N,batchIds:w.points,minimumHeight:b,maximumHeight:R,rectangle:M,batchTable:v})}}function vz(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)||vz(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)||vz(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)||vz(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(),me(this)};function bKe(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 _2=Km;var Kce={b3dm:function(e,t,n,i,o){return cf.fromB3dm(e,t,n,i,o)},pnts:function(e,t,n,i,o){return cf.fromPnts(e,t,n,i,o)},i3dm:function(e,t,n,i,o){return cf.fromI3dm(e,t,n,i,o)},cmpt:function(e,t,n,i,o){return fX.fromTileType(e,t,n,i,o,Kce)},externalTileset:function(e,t,n,i){return QW.fromJson(e,t,n,i)},geom:function(e,t,n,i,o){return new bX(e,t,n,i,o)},vctr:function(e,t,n,i,o){return new _2(e,t,n,i,o)},subt:function(e,t,n,i,o){return SC.fromSubtreeJson(e,t,n,void 0,i,o)},subtreeJson:function(e,t,n,i){return SC.fromSubtreeJson(e,t,n,i)},glb:function(e,t,n,i,o){if(i.byteLength<12)throw new ue("Invalid glb content");let a=new DataView(i,o).getUint32(8,!0),c=new Uint8Array(i,o,a);return cf.fromGltf(e,t,n,c)},gltf:function(e,t,n,i){return cf.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return cf.fromGeoJson(e,t,n,i)}},__=Kce;var E9n=T(S(),1),gKe={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},Uo=Object.freeze(gKe);var I9n=T(S(),1),Jm={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"};Jm.isBinaryFormat=function(e){switch(e){case Jm.BATCHED_3D_MODEL:case Jm.INSTANCED_3D_MODEL:case Jm.COMPOSITE:case Jm.POINT_CLOUD:case Jm.VECTOR:case Jm.GEOMETRY:case Jm.IMPLICIT_SUBTREE:case Jm.VOXEL_BINARY:case Jm.GLTF_BINARY:return!0;default:return!1}};var ys=Object.freeze(Jm);var P9n=T(S(),1),yKe={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0},Xu=Object.freeze(yKe);var w9n=T(S(),1),Ms={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},l0=new Array(Ms.NUMBER_OF_PASSES);l0[Ms.RENDER]=Object.freeze({pass:Ms.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});l0[Ms.PICK]=Object.freeze({pass:Ms.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});l0[Ms.SHADOW]=Object.freeze({pass:Ms.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});l0[Ms.PRELOAD]=Object.freeze({pass:Ms.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});l0[Ms.PRELOAD_FLIGHT]=Object.freeze({pass:Ms.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});l0[Ms.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:Ms.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});l0[Ms.MOST_DETAILED_PRELOAD]=Object.freeze({pass:Ms.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});l0[Ms.MOST_DETAILED_PICK]=Object.freeze({pass:Ms.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Ms.getPassOptions=function(e){return l0[e]};var vo=Object.freeze(Ms);var M9n=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 me(this)};var qC=hf;var J9n=T(S(),1);var D9n=T(S(),1);function d0(e){e=y(e,y.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(d0.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});d0.prototype.hasProperty=function(e){return Mn.hasProperty(e,this._properties,this._class)};d0.prototype.hasPropertyBySemantic=function(e){return Mn.hasPropertyBySemantic(e,this._properties,this._class)};d0.prototype.getPropertyIds=function(e){return Mn.getPropertyIds(this._properties,this._class,e)};d0.prototype.getProperty=function(e){return Mn.getProperty(e,this._properties,this._class)};d0.prototype.setProperty=function(e,t){return Mn.setProperty(e,t,this._properties,this._class)};d0.prototype.getPropertyBySemantic=function(e){return Mn.getPropertyBySemantic(e,this._properties,this._class)};d0.prototype.setPropertyBySemantic=function(e,t){return Mn.setPropertyBySemantic(e,t,this._properties,this._class)};var T2=d0;function wz(e,t){let n=ii(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){wz._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=y(e.schema.classes,y.EMPTY_OBJECT);if(l(n.class)){let o=i[n.class];return new T2({content:n,class:o})}}wz._oneTimeWarning=Nt;var T_=wz;var $9n=T(S(),1);function xKe(e,t){let n=e.metadataExtension;if(!l(n))return;let i=n.groups,o=ii(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 S_=xKe;var dAn=T(S(),1);var iAn=T(S(),1);function u0(e){e=y(e,y.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(u0.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});u0.prototype.hasProperty=function(e){return Mn.hasProperty(e,this._properties,this._class)};u0.prototype.hasPropertyBySemantic=function(e){return Mn.hasPropertyBySemantic(e,this._properties,this._class)};u0.prototype.getPropertyIds=function(e){return Mn.getPropertyIds(this._properties,this._class,e)};u0.prototype.getProperty=function(e){return Mn.getProperty(e,this._properties,this._class)};u0.prototype.setProperty=function(e,t){return Mn.setProperty(e,t,this._properties,this._class)};u0.prototype.getPropertyBySemantic=function(e){return Mn.getPropertyBySemantic(e,this._properties,this._class)};u0.prototype.setPropertyBySemantic=function(e,t){return Mn.setPropertyBySemantic(e,t,this._properties,this._class)};var S2=u0;function Fz(e,t){let n=ii(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){Fz._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=y(e.schema.classes,y.EMPTY_OBJECT);if(l(n.class)){let o=i[n.class];return new S2({tile:n,class:o})}}Fz._oneTimeWarning=Nt;var C2=Fz;var PAn=T(S(),1);var gAn=T(S(),1);function _Ke(e){let t=new Uint8Array(e),n=Xm(t);if(n==="glTF"&&(n="glb"),ys.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=TKe(t);if(l(i.root))return{contentType:ys.EXTERNAL_TILESET,jsonPayload:i};if(l(i.asset))return{contentType:ys.GLTF,jsonPayload:i};if(l(i.tileAvailability))return{contentType:ys.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(l(i.type))return{contentType:ys.GEOJSON,jsonPayload:i};if(l(i.voxelTable))return{contentType:ys.VOXEL_JSON,jsonPayload:i};throw new ue("Invalid tile content.")}function TKe(e){let t;try{t=Io(e)}catch{throw new ue("Invalid tile content.")}return t}var ff=_Ke;function Iu(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=Ja.getServerKey(a.getUrlComponent());this._innerContentResources[s]=a,this._serverKeys[s]=c}}Object.defineProperties(Iu.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 Az(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function Jce(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)}Iu.prototype.requestInnerContents=function(){if(!SKe(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let e=this._innerContentHeaders;Az(this,e.length);let t=this._cancelCount;for(let n=0;n<e.length;n++)this._arrayFetchPromises[n]=CKe(this,n,t,this._tile._contentState);return VKe(this)};function SKe(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)&&!Ja.serverHasOpenSlots(n,t[n]))return!1;return Ja.heapHasOpenSlots(e.length)}function CKe(e,t,n,i){let o=e._innerContentResources[t].clone(),r=e.tile,s=function(){return r._priority},a=e._serverKeys[t],c=new Oo({throttle:!0,throttleByServer:!0,type:is.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===jn.CANCELLED){Jce(e,i);return}return Az(e,-1),u}}).catch(function(u){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===jn.CANCELLED){Jce(e,i);return}Az(e,-1),Qce(e,t,u)}})}async function VKe(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((r,s)=>LKe(e,r,s)),o=await Promise.all(i);return e._contentsCreated=!0,e._contents=o.filter(l),o}async function LKe(e,t,n){if(l(t))try{let i=ff(t);if(i.contentType===ys.EXTERNAL_TILESET)throw new ue("External tilesets are disallowed inside multiple contents");e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===ys.GEOMETRY||i.contentType===ys.VECTOR;let o=e._tileset,r=e._innerContentResources[n],s=e._tile,a,c=__[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=T_(o,d));let u=S_(o,d);return l(u)&&(a.group=new Ax({metadata:u})),a}catch(i){Qce(e,n,i)}}function Qce(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}`))}Iu.prototype.cancelRequests=function(){for(let e=0;e<this._requests.length;e++){let t=this._requests[e];l(t)&&t.cancel()}};Iu.prototype.hasProperty=function(e,t){return!1};Iu.prototype.getFeature=function(e){};Iu.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};Iu.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};Iu.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)};Iu.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};Iu.prototype.isDestroyed=function(){return!1};Iu.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return me(this)};var V2=Iu;var GMn=T(S(),1);var cMn=T(S(),1);var BAn=T(S(),1);var jce=Math.cos,qce=Math.sin,RKe=Math.sqrt,Mz={};Mz.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=jce(u),p=qce(u),g=a.z*p,f=c.longitude+i*e.granYSin+o*e.granXCos,x=m*jce(f),_=m*qce(f),C=a.x*x,V=a.y*_,L=RKe(C*x+V*_+g*p);if(r.x=C/L,r.y=V/L,r.z=g/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 ZKe=new Qi,Wu=new h,GKe=new he,U5=new h,L2=new Li;function $ce(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;L2._ellipsoid=ne.default,Wu=L2.project(e,Wu),Wu=h.subtract(Wu,U5,Wu);let g=Qi.fromRotation(t,ZKe);Wu=Qi.multiplyByVector(g,Wu,Wu),Wu=h.add(Wu,U5,Wu),e=L2.unproject(Wu,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,E=Z+r*d,X=Z+s*m,v=Z+s*m+r*d,P=Math.max(Z,E,X,v),A=Math.min(Z,E,X,v);return{north:V,south:L,east:P,west:A,granYCos:c,granYSin:m,granXCos:d,granXSin:p,nwCorner:e}}Mz.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 g,f=d-u;c>a?g=W.TWO_PI-c+a:g=a-c;let x=Math.ceil(g/t)+1,_=Math.ceil(f/t)+1,C=g/(x-1),V=f/(_-1),L=ae.northwest(e,r),Z=ae.center(e,GKe);(n!==0||i!==0)&&(Z.longitude<L.longitude&&(Z.longitude+=W.TWO_PI),L2._ellipsoid=ne.default,U5=L2.project(Z,U5));let E=V,X=C,v=0,P=0,A=ae.clone(e,o),M={granYCos:E,granYSin:v,granXCos:X,granXSin:P,nwCorner:L,boundingRectangle:A,width:x,height:_,northCap:m,southCap:p};if(n!==0){let b=$ce(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,A.north=d,A.south=u,A.east=a,A.west=c}if(i!==0){n=n-i;let b=ae.northwest(A,s),R=$ce(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 xs=Mz;var EKe=new ce,XKe=new ce,IKe=new h,WKe=new ae;function ele(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,g=0,f,x=IKe;if(r)xs.computePosition(t,n,!1,g,0,x),m[p++]=x.x,m[p++]=x.y,m[p++]=x.z;else for(f=0;f<o;f++)xs.computePosition(t,n,!1,g,f,x),m[p++]=x.x,m[p++]=x.y,m[p++]=x.z;for(f=o-1,g=1;g<i;g++)xs.computePosition(t,n,!1,g,f,x),m[p++]=x.x,m[p++]=x.y,m[p++]=x.z;if(g=i-1,!s)for(f=o-2;f>=0;f--)xs.computePosition(t,n,!1,g,f,x),m[p++]=x.x,m[p++]=x.y,m[p++]=x.z;for(f=0,g=i-2;g>0;g--)xs.computePosition(t,n,!1,g,f,x),m[p++]=x.x,m[p++]=x.y,m[p++]=x.z;let _=m.length/3*2,C=Ae.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 ht({attributes:new mn,primitiveType:Fe.LINES});return L.attributes.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:m}),L.indices=C,L}function PKe(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,o=e._ellipsoid,r=ele(e,t),s=t.height,a=t.width,c=ri.scaleToGeodeticHeight(r.attributes.position.values,n,o,!1),d=c.length,u=new Float64Array(d*2);u.set(c);let m=ri.scaleToGeodeticHeight(r.attributes.position.values,i,o);u.set(m,d),r.attributes.position.values=u;let p=t.northCap,g=t.southCap,f=4;p&&(f-=1),g&&(f-=1);let x=(u.length/3+f)*2,_=Ae.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,!g){let L=a+V-1;_[C++]=L,_[C]=L+d}return r.indices=_,r}function e1(e){e=y(e,y.EMPTY_OBJECT);let t=e.rectangle,n=y(e.granularity,W.RADIANS_PER_DEGREE),i=y(e.ellipsoid,ne.default),o=y(e.rotation,0),r=y(e.height,0),s=y(e.extrudedHeight,r);this._rectangle=ae.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"}e1.packedLength=ae.packedLength+ne.packedLength+5;e1.pack=function(e,t,n){return n=y(n,0),ae.pack(e._rectangle,t,n),n+=ae.packedLength,ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._extrudedHeight,t[n]=y(e._offsetAttribute,-1),t};var tle=new ae,nle=ne.clone(ne.UNIT_SPHERE),$C={rectangle:tle,ellipsoid:nle,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};e1.unpack=function(e,t,n){t=y(t,0);let i=ae.unpack(e,t,tle);t+=ae.packedLength;let o=ne.unpack(e,t,nle);t+=ne.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],d=e[t];return l(n)?(n._rectangle=ae.clone(i,n._rectangle),n._ellipsoid=ne.clone(o,n._ellipsoid),n._surfaceHeight=s,n._rotation=a,n._extrudedHeight=c,n._offsetAttribute=d===-1?void 0:d,n):($C.granularity=r,$C.height=s,$C.rotation=a,$C.extrudedHeight=c,$C.offsetAttribute=d===-1?void 0:d,new e1($C))};var vKe=new he;e1.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=xs.computeOptions(t,e._granularity,e._rotation,0,WKe,vKe),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=PKe(e,i),l(e._offsetAttribute)){let p=o.attributes.position.values.length/3,g=new Uint8Array(p);e._offsetAttribute===ln.TOP?g=g.fill(1,0,p/2):(d=e._offsetAttribute===ln.NONE?0:1,g=g.fill(d)),o.attributes.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}let u=ce.fromRectangle3D(t,n,s,XKe),m=ce.fromRectangle3D(t,n,a,EKe);r=ce.union(u,m)}else{if(o=ele(e,i),o.attributes.position.values=ri.scaleToGeodeticHeight(o.attributes.position.values,s,n,!1),l(e._offsetAttribute)){let u=o.attributes.position.values.length;d=e._offsetAttribute===ln.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 ht({attributes:o.attributes,indices:o.indices,primitiveType:Fe.LINES,boundingSphere:r,offsetAttribute:e._offsetAttribute})};var C_=e1;function n1(e){this.rectangle=ae.clone(e.rectangle),this.minimumHeight=y(e.minimumHeight,0),this.maximumHeight=y(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=y(e.ellipsoid,ne.WGS84);NKe(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,y(e.computeBoundingVolumes,!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(n1.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});n1.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=Gn.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=ce.fromOrientedBoundingBox(this._orientedBoundingBox)};var ile=new h,D5=new h,ole=new h,wKe=new h,FKe=new h,AKe=new h,MKe=new h,Pu=new he,rle=new cn(h.UNIT_X,0),t1=new pn;function NKe(e,t,n){n.cartographicToCartesian(ae.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(ae.northeast(t),e.northeastCornerCartesian),Pu.longitude=t.west,Pu.latitude=(t.south+t.north)*.5,Pu.height=0;let i=n.cartographicToCartesian(Pu,AKe),o=h.cross(i,h.UNIT_Z,wKe);h.normalize(o,e.westNormal),Pu.longitude=t.east;let r=n.cartographicToCartesian(Pu,MKe),s=h.cross(h.UNIT_Z,r,ile);h.normalize(s,e.eastNormal);let a=h.subtract(i,r,ile);h.magnitude(a)===0&&(a=h.clone(o,a));let c=h.normalize(a,FKe),d=t.south,u;if(d>0){Pu.longitude=(t.west+t.east)*.5,Pu.latitude=d;let x=n.cartographicToCartesian(Pu,t1.origin);h.clone(c,t1.direction);let _=cn.fromPointNormal(e.southwestCornerCartesian,e.westNormal,rle);qn.rayPlane(t1,_,e.southwestCornerCartesian),u=n.geodeticSurfaceNormal(x,D5)}else u=n.geodeticSurfaceNormalCartographic(ae.southeast(t),D5);let m=h.cross(u,a,ole);h.normalize(m,e.southNormal);let p=t.north,g;if(p<0){Pu.longitude=(t.west+t.east)*.5,Pu.latitude=p;let x=n.cartographicToCartesian(Pu,t1.origin);h.negate(c,t1.direction);let _=cn.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,rle);qn.rayPlane(t1,_,e.northeastCornerCartesian),g=n.geodeticSurfaceNormal(x,D5)}else g=n.geodeticSurfaceNormalCartographic(ae.northwest(t),D5);let f=h.cross(a,g,ole);h.normalize(f,e.northNormal)}var kKe=new h,UKe=new h,DKe=new h(0,-1,0),BKe=new h(0,0,-1),sle=new h;function YKe(e,t){let n=t.camera,i=n.positionWC,o=n.positionCartographic,r=0;if(!ae.contains(e.rectangle,o)){let d=e.southwestCornerCartesian,u=e.northeastCornerCartesian,m=e.westNormal,p=e.southNormal,g=e.eastNormal,f=e.northNormal;t.mode!==oe.SCENE3D&&(d=t.mapProjection.project(ae.southwest(e.rectangle),kKe),d.z=d.y,d.y=d.x,d.x=0,u=t.mapProjection.project(ae.northeast(e.rectangle),UKe),u.z=u.y,u.y=u.x,u.x=0,m=DKe,g=h.UNIT_Y,p=BKe,f=h.UNIT_Z);let x=h.subtract(i,d,sle),_=h.dot(x,m),C=h.dot(x,p),V=h.subtract(i,u,sle),L=h.dot(V,g),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===oe.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)}n1.prototype.distanceToCamera=function(e){let t=YKe(this,e);if(e.mode===oe.SCENE3D&&l(this._orientedBoundingBox)){let n=Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC));return Math.max(t,n)}return t};n1.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};n1.prototype.createDebugVolume=function(e){let t=new F.clone(F.IDENTITY),n=new C_({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new Vt({geometry:n,id:"outline",modelMatrix:t,attributes:{color:Ht.fromColor(e)}});return new En({geometryInstances:i,appearance:new dn({translucent:!1,flat:!0}),asynchronous:!1})};var vu=n1;var pNn=T(S(),1);var jMn=T(S(),1);var vMn=T(S(),1);var R2={},OKe=new h,ale=new h,cle=new h,lle=new h,dle=new Gn;R2.validOutline=function(e){let n=Gn.fromPoints(e,dle).halfAxes,i=$.getColumn(n,0,ale),o=$.getColumn(n,1,cle),r=$.getColumn(n,2,lle),s=h.magnitude(i),a=h.magnitude(o),c=h.magnitude(r);return!(s===0&&(a===0||c===0)||a===0&&c===0)};R2.computeProjectTo2DArguments=function(e,t,n,i){let o=Gn.fromPoints(e,dle),r=o.halfAxes,s=$.getColumn(r,0,ale),a=$.getColumn(r,1,cle),c=$.getColumn(r,2,lle),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 g,f;return(p===u||p===m)&&(g=s),p===d?g=a:p===m&&(f=a),(p===d||p===u)&&(f=c),h.normalize(g,n),h.normalize(f,i),h.clone(o.center,t),!0};function ule(e,t,n,i,o){let r=h.subtract(e,t,OKe),s=h.dot(n,r),a=h.dot(i,r);return D.fromElements(s,a,o)}R2.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let o=new Array(i.length);for(let r=0;r<i.length;r++)o[r]=ule(i[r],e,t,n);return o}};R2.createProjectPointTo2DFunction=function(e,t,n){return function(i,o){return ule(i,e,t,n,o)}};var m0=R2;function HKe(e){let t=e.length,n=new Float64Array(t*3),i=Ae.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 mn({position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:n})});return new ht({attributes:s,indices:i,primitiveType:Fe.LINES})}function V_(e){e=y(e,y.EMPTY_OBJECT);let t=e.polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=Dn.computeHierarchyPackedLength(t,h)+1}V_.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions}};return new V_(t)};V_.pack=function(e,t,n){return n=y(n,0),n=Dn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),t[n]=e.packedLength,t};var zKe={polygonHierarchy:{}};V_.unpack=function(e,t,n){t=y(t,0);let i=Dn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=e[t];return l(n)||(n=new V_(zKe)),n._polygonHierarchy=i,n.packedLength=o,n};V_.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=xo(n,h.equalsEpsilon,!0),n.length<3||!m0.validOutline(n))return;let o=Dn.polygonOutlinesFromHierarchy(t,!1);if(o.length===0)return;let r=[];for(let c=0;c<o.length;c++){let d=new Vt({geometry:HKe(o[c])});r.push(d)}let s=An.combineInstances(r)[0],a=ce.fromPoints(t.positions);return new ht({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:a})};var wu=V_;var B5=new he;function Z2(e){let t=Ap.fromToken(e.token),n=y(e.minimumHeight,0),i=y(e.maximumHeight,0),o=y(e.ellipsoid,ne.WGS84);this.s2Cell=t,this.minimumHeight=n,this.maximumHeight=i,this.ellipsoid=o;let r=nJe(t,n,i,o);this._boundingPlanes=r;let s=sJe(r);this._vertices=s,this._edgeNormals=new Array(6),this._edgeNormals[0]=Hz(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]=Hz(r[1],s.slice(4,8)),a=0;a<4;a++)this._edgeNormals[2+a]=Hz(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();B5=o.cartesianToCartographic(c,B5),B5.height=(i+n)/2,this.center=o.cartographicToCartesian(B5,c),this._boundingSphere=ce.fromPoints(s)}var KKe=new h,JKe=new he,QKe=new h,jKe=new he,qKe=new h,$Ke=new h,eJe=new h,tJe=new h;function nJe(e,t,n,i){let o=new Array(6),r=e.getCenter(),s=i.geodeticSurfaceNormal(r,KKe),a=i.cartesianToCartographic(r,JKe);a.height=n;let c=i.cartographicToCartesian(a,QKe),d=cn.fromPointNormal(c,s);o[0]=d;let u=0,m,p=[],g,f;for(m=0;m<4;m++){g=e.getVertex(m),p[m]=g,f=i.cartesianToCartographic(g,jKe),f.height=t;let _=cn.getPointDistance(d,i.cartographicToCartesian(f,qKe));_<u&&(u=_)}let x=cn.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++){g=p[m];let _=p[(m+1)%4],C=i.geodeticSurfaceNormal(g,$Ke),V=h.subtract(_,g,tJe),L=h.cross(V,C,eJe);L=h.normalize(L,L),o[2+m]=cn.fromPointNormal(g,L)}return o}var L_=new h,R_=new h,Z_=new h,Nz=new h,kz=new h,Uz=new h,iJe=new h,oJe=new h,rJe=new h,Dz=new h,Bz=new h,Yz=new h,Rg=new h,pf=new $;function mle(e,t,n){L_=e.normal,R_=t.normal,Z_=n.normal,Nz=h.multiplyByScalar(e.normal,-e.distance,Nz),kz=h.multiplyByScalar(t.normal,-t.distance,kz),Uz=h.multiplyByScalar(n.normal,-n.distance,Uz),Dz=h.multiplyByScalar(h.cross(R_,Z_,iJe),h.dot(Nz,L_),Dz),Bz=h.multiplyByScalar(h.cross(Z_,L_,oJe),h.dot(kz,R_),Bz),Yz=h.multiplyByScalar(h.cross(L_,R_,rJe),h.dot(Uz,Z_),Yz),pf[0]=L_.x,pf[1]=R_.x,pf[2]=Z_.x,pf[3]=L_.y,pf[4]=R_.y,pf[5]=Z_.y,pf[6]=L_.z,pf[7]=R_.z,pf[8]=Z_.z;let i=$.determinant(pf);return Rg=h.add(Dz,Bz,Rg),Rg=h.add(Rg,Yz,Rg),new h(Rg.x/i,Rg.y/i,Rg.z/i)}function sJe(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=mle(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=mle(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var Oz=new h,i1=new h;function Hz(e,t){let n=[];for(let i=0;i<4;i++)Oz=h.subtract(t[(i+1)%4],t[i],Oz),i1=h.cross(e.normal,Oz,i1),i1=h.normalize(i1,i1),n[i]=h.clone(i1);return n}Object.defineProperties(Z2.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var zz=new h;Z2.prototype.distanceToCamera=function(e){let t=e.camera.positionWC,n=[],i=[],o;cn.getPointDistance(this._boundingPlanes[0],t)>0?(n.push(0),i.push(this._planeVertices[0]),o=this._edgeNormals[0]):cn.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,cn.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=Kz(cn.projectPointOntoPlane(c,t,zz),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=hle(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=Kz(cn.projectPointOntoPlane(c,t,zz),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=Kz(cn.projectPointOntoPlane(this._boundingPlanes[1],t,zz),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 aJe=new h,cJe=new h;function hle(e,t,n){let i=h.subtract(n,t,aJe),o=h.subtract(e,t,cJe),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 lJe=new cn(h.UNIT_X,0);function Kz(e,t,n,i){let o=Number.MAX_VALUE,r,s,a;for(let c=0;c<t.length;c++){let d=cn.fromPointNormal(t[c],i[c],lJe);cn.getPointDistance(d,e)<0||(a=hle(e,t[c],t[(c+1)%4]),r=h.distance(e,a),r<o&&(o=r,s=a))}return l(s)?s:e}Z2.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?Kt.INSIDE:n===this._vertices.length?Kt.OUTSIDE:Kt.INTERSECTING};Z2.prototype.createDebugVolume=function(e){let t=new F.clone(F.IDENTITY),n=new wu({polygonHierarchy:{positions:this._planeVertices[0]}}),i=wu.createGeometry(n),o=new Vt({geometry:i,id:"outline",modelMatrix:t,attributes:{color:Ht.fromColor(e)}}),r=new wu({polygonHierarchy:{positions:this._planeVertices[1]}}),s=wu.createGeometry(r),a=new Vt({geometry:s,id:"outline",modelMatrix:t,attributes:{color:Ht.fromColor(e)}}),c=[];for(let d=0;d<4;d++){let u=new wu({polygonHierarchy:{positions:this._planeVertices[2+d]}}),m=wu.createGeometry(u);c[d]=new Vt({geometry:m,id:"outline",modelMatrix:t,attributes:{color:Ht.fromColor(e)}})}return new En({geometryInstances:[c[0],c[1],c[2],c[3],a,o],appearance:new dn({translucent:!1,flat:!0}),asynchronous:!1})};var G2=Z2;var zNn=T(S(),1);var FNn=T(S(),1);var XNn=T(S(),1);var dJe=new h(1,1,1),Y5=Math.cos,O5=Math.sin;function o1(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.radii,dJe),n=y(e.innerRadii,t),i=y(e.minimumClock,0),o=y(e.maximumClock,W.TWO_PI),r=y(e.minimumCone,0),s=y(e.maximumCone,W.PI),a=Math.round(y(e.stackPartitions,10)),c=Math.round(y(e.slicePartitions,8)),d=Math.round(y(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"}o1.packedLength=2*h.packedLength+8;o1.pack=function(e,t,n){return n=y(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]=y(e._offsetAttribute,-1),t};var fle=new h,ple=new h,h0={radii:fle,innerRadii:ple,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};o1.unpack=function(e,t,n){t=y(t,0);let i=h.unpack(e,t,fle);t+=h.packedLength;let o=h.unpack(e,t,ple);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):(h0.minimumClock=r,h0.maximumClock=s,h0.minimumCone=a,h0.maximumCone=c,h0.stackPartitions=d,h0.slicePartitions=u,h0.subdivisions=m,h0.offsetAttribute=p===-1?void 0:p,new o1(h0))};o1.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=ne.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,g=n.x!==t.x||n.y!==t.y||n.z!==t.z,f=!1,x=!1;g&&(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=Ae.createTypedArray(_,V),Z,E,X,v,P=0,A=new Array(u),M=new Array(u);for(Z=0;Z<u;Z++)v=r+Z*(s-r)/(u-1),A[Z]=O5(v),M[Z]=Y5(v);let b=new Array(a),R=new Array(a);for(Z=0;Z<a;Z++)X=i+Z*(o-i)/(a-1),b[Z]=O5(X),R[Z]=Y5(X);for(Z=0;Z<u;Z++)for(E=0;E<a;E++)C[P++]=t.x*A[Z]*R[E],C[P++]=t.y*A[Z]*b[E],C[P++]=t.z*M[Z];if(g)for(Z=0;Z<u;Z++)for(E=0;E<a;E++)C[P++]=n.x*A[Z]*R[E],C[P++]=n.y*A[Z]*b[E],C[P++]=n.z*M[Z];for(A.length=a,M.length=a,Z=0;Z<a;Z++)v=r+Z*(s-r)/(a-1),A[Z]=O5(v),M[Z]=Y5(v);for(b.length=d,R.length=d,Z=0;Z<d;Z++)X=i+Z*(o-i)/(d-1),b[Z]=O5(X),R[Z]=Y5(X);for(Z=0;Z<a;Z++)for(E=0;E<d;E++)C[P++]=t.x*A[Z]*R[E],C[P++]=t.y*A[Z]*b[E],C[P++]=t.z*M[Z];if(g)for(Z=0;Z<a;Z++)for(E=0;E<d;E++)C[P++]=n.x*A[Z]*R[E],C[P++]=n.y*A[Z]*b[E],C[P++]=n.z*M[Z];for(P=0,Z=0;Z<u*p;Z++){let w=Z*a;for(E=0;E<a-1;E++)L[P++]=w+E,L[P++]=w+E+1}let G=u*a*p;for(Z=0;Z<d;Z++)for(E=0;E<a-1;E++)L[P++]=G+Z+E*d,L[P++]=G+Z+(E+1)*d;if(g)for(G=u*a*p+d*a,Z=0;Z<d;Z++)for(E=0;E<a-1;E++)L[P++]=G+Z+E*d,L[P++]=G+Z+(E+1)*d;if(g){let w=u*a*p,N=w+a*d;if(f)for(Z=0;Z<d;Z++)L[P++]=w+Z,L[P++]=N+Z;if(x)for(w+=a*d-d,N+=a*d-d,Z=0;Z<d;Z++)L[P++]=w+Z,L[P++]=N+Z}let I=new mn({position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:C})});if(l(e._offsetAttribute)){let w=C.length,N=e._offsetAttribute===ln.NONE?0:1,B=new Uint8Array(w/3).fill(N);I.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:B})}return new ht({attributes:I,indices:L,primitiveType:Fe.LINES,boundingSphere:ce.fromEllipsoid(c),offsetAttribute:e._offsetAttribute})};var _d=o1;function r1(e){let t=y(e.radius,1),i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new _d(i),this._workerName="createSphereOutlineGeometry"}r1.packedLength=_d.packedLength;r1.pack=function(e,t,n){return _d.pack(e._ellipsoidGeometry,t,n)};var uJe=new _d,G_={radius:void 0,radii:new h,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};r1.unpack=function(e,t,n){let i=_d.unpack(e,t,uJe);return G_.stackPartitions=i._stackPartitions,G_.slicePartitions=i._slicePartitions,G_.subdivisions=i._subdivisions,l(n)?(h.clone(i._radii,G_.radii),n._ellipsoidGeometry=new _d(G_),n):(G_.radius=i._radii.x,new r1(G_))};r1.createGeometry=function(e){return _d.createGeometry(e._ellipsoidGeometry)};var f0=r1;function s1(e,t){t===0&&(t=W.EPSILON7),this._boundingSphere=new ce(e,t)}Object.defineProperties(s1.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}}});s1.prototype.distanceToCamera=function(e){let t=this._boundingSphere;return Math.max(0,h.distance(t.center,e.camera.positionWC)-t.radius)};s1.prototype.intersectPlane=function(e){return ce.intersectPlane(this._boundingSphere,e)};s1.prototype.update=function(e,t){h.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};s1.prototype.createDebugVolume=function(e){let t=new f0({radius:this.radius}),n=F.fromTranslation(this.center,new F.clone(F.IDENTITY)),i=new Vt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Ht.fromColor(e)}});return new En({geometryInstances:i,appearance:new dn({translucent:!1,flat:!0}),asynchronous:!1})};var p0=s1;var s5n=T(S(),1);var mJe=new h,hJe=new h,fJe=new h,pJe=new h;function E_(e,t,n){n=h.cross(e,t,n);let i=h.magnitude(n);return h.multiplyByScalar(n,W.EPSILON7/i,n)}function Jz(e,t){let n=h.normalize(e,pJe),i=h.equalsEpsilon(n,h.UNIT_X,W.EPSILON6)?h.UNIT_Y:h.UNIT_X;return E_(e,i,t)}function ble(e){let t=$.getColumn(e,0,mJe),n=$.getColumn(e,1,hJe),i=$.getColumn(e,2,fJe),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=E_(n,i,t):!o&&r&&!s?n=E_(t,i,n):!o&&!r&&s?i=E_(n,t,i):o?r?s||(t=Jz(i,t),n=E_(i,t,n)):(t=Jz(n,t),i=E_(n,t,i)):(n=Jz(t,n),i=E_(n,t,i)),$.setColumn(e,0,t,e),$.setColumn(e,1,n,e),$.setColumn(e,2,i,e),e)}function a1(e,t){t=ble(t),this._orientedBoundingBox=new Gn(e,t),this._boundingSphere=ce.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(a1.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});a1.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};a1.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};a1.prototype.update=function(e,t){h.clone(e,this._orientedBoundingBox.center),t=ble(t),$.clone(t,this._orientedBoundingBox.halfAxes),ce.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};a1.prototype.createDebugVolume=function(e){let t=new xm({minimum:new h(-1,-1,-1),maximum:new h(1,1,1)}),n=F.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new Vt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Ht.fromColor(e)}});return new En({geometryInstances:i,appearance:new dn({translucent:!1,flat:!0}),asynchronous:!1})};var Td=a1;function jo(e,t,n,i){this._tileset=e,this._header=n;let o=l(n.contents),r=o&&n.contents.length>1||ii(n,"3DTILES_multiple_contents"),s=o&&!r?n.contents[0]:n.content;this._contentHeader=s,this.transform=l(n.transform)?F.unpack(n.transform):F.clone(F.IDENTITY);let a=l(i)?i.computedTransform:e.modelMatrix,c=F.multiply(a,this.transform,new F),d=l(i)?i._initialTransform:F.IDENTITY;this._initialTransform=F.multiply(d,this.transform,new F),this.computedTransform=c,this.metadata=C2(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,jo._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")&&jo._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?Mo.REPLACE:Mo.ADD):l(i)?p=i.refine:p=Mo.REPLACE,this.refine=p,this.children=[],this.parent=i;let g,f=!1,x,_,C;if(t=Ee.createIfNeeded(t),r)x=Uo.UNLOADED,_=t.clone();else if(l(s)){let E=s.uri;l(s.url)&&(jo._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),E=s.url),E===""?(jo._deprecationWarning("contentUriEmpty","content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"),g=new qC(e,this),f=!0,x=Uo.READY):(x=Uo.UNLOADED,_=t.getDerivedResource({url:E}),C=Ja.getServerKey(_.getUrlComponent()))}else g=new qC(e,this),f=!0,x=Uo.READY;this._content=g,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=q.fromIso8601(V.date))),this.expireDuration=L,this.expireDate=Z,this.lastStyleTime=0,this._optimChildrenWithinParent=Xu.NOT_COMPUTED,this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!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._isClippedByPolygon=!1,this._clippingPlanesState=0,this._clippingPolygonsState=0,this._debugBoundingVolume=void 0,this._debugContentBoundingVolume=void 0,this._debugViewerRequestVolume=void 0,this._debugColor=Y.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 q,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}jo._deprecationWarning=Es;Object.defineProperties(jo.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return y(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 Y),Y.clone(this._color)},set:function(e){this._color=Y.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 Zg=new h;function bJe(e,t){let{tileset:n,boundingSphere:i}=e,{radius:o,center:r}=i,{camera:s}=t,a=h.multiplyByScalar(s.directionWC,e._centerZDepth,Zg),c=h.add(s.positionWC,a,Zg),d=h.subtract(c,r,Zg);if(h.magnitude(d)>o){let Z=h.normalize(d,Zg),E=h.multiplyByScalar(Z,o,Zg),X=h.add(r,E,Zg),v=h.subtract(X,s.positionWC,Zg),P=h.normalize(v,Zg);e._foveatedFactor=1-Math.abs(h.dot(s.directionWC,P))}else e._foveatedFactor=0;let p=e.refine===Mo.REPLACE,g=n.isSkippingLevelOfDetail;if(p&&!g||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&g||n._pass===vo.PRELOAD_FLIGHT||n._pass===vo.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 _le=new q;jo.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,o=y(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===oe.SCENE2D||d instanceof sn){let g=d.offCenterFrustum;l(g)&&(d=g);let f=Math.max(d.top-d.bottom,d.right-d.left)/Math.max(u,m);p=s/f}else{let g=Math.max(this._distanceToCamera,W.EPSILON7),f=d.sseDenominator;if(p=s*m/(g*f),i.dynamicScreenSpaceError){let x=i._dynamicScreenSpaceErrorComputedDensity,_=i.dynamicScreenSpaceErrorFactor,C=W.fog(g,x)*_;p-=C}}return p/=e.pixelRatio,p};function gJe(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 yJe(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}jo.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:rs.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!==rs.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=yJe(n,this),this._priorityProgressiveResolution=gJe(n,this),this.priorityDeferred=bJe(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};jo.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=q.now(_le);q.lessThan(this.expireDate,e)&&(this._contentState=Uo.EXPIRED,this._expiredContent=this._content)}};function xJe(e){if(!l(e.expireDuration))return;let t=q.now(_le);q.addSeconds(t,e.expireDuration,t),l(e.expireDate)?q.lessThan(e.expireDate,t)&&q.clone(t,e.expireDate):e.expireDate=q.clone(t)}function _Je(e){return function(){return e._priority}}jo.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?TJe(this):CJe(this)};function TJe(e){let t=e._content,n=e._tileset;if(!l(t)){let o=ii(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new V2(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 SJe(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===jn.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===jn.CANCELLED){e._contentState=r,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let a=await VJe(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 CJe(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new Oo({throttle:!0,throttleByServer:!0,type:is.TILES3D,priorityFunction:_Je(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 SJe(e,o,i,n,r)}async function VJe(e,t){let n=ff(t),i=e._tileset;i._disableSkipLevelOfDetail=i._disableSkipLevelOfDetail||n.contentType===ys.GEOMETRY||n.contentType===ys.VECTOR,(n.contentType===ys.IMPLICIT_SUBTREE||n.contentType===ys.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0),n.contentType===ys.EXTERNAL_TILESET&&(e.hasTilesetContent=!0);let o,r=__[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=T_(i,s));let a=S_(i,s);return l(a)&&(o.group=new Ax({metadata:a})),o}jo.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};jo.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.clippingPolygonsDirty=this._clippingPolygonsState===0,this._clippingPolygonsState=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 Tle=new ce;function jz(e,t){if(t.mode!==oe.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=ce.projectTo2D(n,t.mapProjection,Tle);e._boundingVolume2D=new p0(i.center,i.radius)}return t.mode!==oe.SCENE3D?e._boundingVolume2D:e._boundingVolume}function LJe(e,t){if(t.mode!==oe.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=ce.projectTo2D(n,t.mapProjection,Tle);e._contentBoundingVolume2D=new p0(i.center,i.radius)}return t.mode!==oe.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}jo.prototype.visibility=function(e,t){let n=e.cullingVolume,i=jz(this,e),o=this._tileset,r=o.clippingPlanes;if(l(r)&&r.enabled){let a=r.computeIntersectionWithBoundingVolume(i,o.clippingPlanesOriginMatrix);if(this._isClipped=a!==Kt.INSIDE,a===Kt.OUTSIDE)return rs.MASK_OUTSIDE}let s=o.clippingPolygons;if(l(s)&&s.enabled){let a=s.computeIntersectionWithBoundingVolume(i);this._isClippedByPolygon=a!==Kt.OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};jo.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return Kt.INSIDE;if(this._visibilityPlaneMask===rs.MASK_INSIDE)return Kt.INSIDE;let t=e.cullingVolume,n=LJe(this,e),i=this._tileset,o=i.clippingPlanes;if(l(o)&&o.enabled){let s=o.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=s!==Kt.INSIDE,s===Kt.OUTSIDE)return Kt.OUTSIDE}let r=i.clippingPolygons;if(l(r)&&r.enabled){let s=r.computeIntersectionWithBoundingVolume(n);if(this._isClippedByPolygon=s!==Kt.OUTSIDE,s===Kt.INSIDE)return Kt.OUTSIDE}return t.computeVisibility(n)};jo.prototype.distanceToTile=function(e){return jz(this,e).distanceToCamera(e)};var RJe=new h;jo.prototype.distanceToTileCenter=function(e){let n=jz(this,e).boundingVolume,i=h.subtract(n.center,e.camera.positionWC,RJe);return h.dot(e.camera.directionWC,i)};jo.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var Sle=new $,Cle=new h,ZJe=new $,qz=new h,Vle=new ae,Lle=new Gn,Qz=new F;function GJe(e,t,n){let i=h.fromElements(e[0],e[1],e[2],qz),o=$.fromArray(e,3,ZJe);i=F.multiplyByPoint(t,i,i);let r=F.getMatrix3(t,Sle);return o=$.multiply(r,o,o),l(n)?(n.update(i,o),n):new Td(i,o)}function EJe(e,t,n,i){let o=ae.unpack(e,0,Vle),r=e[4],s=e[5],a=Gn.fromRectangle(o,r,s,ne.WGS84,Lle),c=a.center,d=a.halfAxes;t=F.multiplyTransformation(t,F.inverseTransformation(n,Qz),Qz),c=F.multiplyByPoint(t,c,c);let u=F.getMatrix3(t,Sle);return d=$.multiply(u,d,d),l(i)&&i instanceof Td?(i.update(c,d),i):new Td(c,d)}function XJe(e,t,n,i){if(!F.equalsEpsilon(t,n,W.EPSILON8))return EJe(e,t,n,i);let o=ae.unpack(e,0,Vle);return l(i)?(i.rectangle=ae.clone(o,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(ne.WGS84),i):new vu({rectangle:o,minimumHeight:e[4],maximumHeight:e[5]})}function IJe(e,t,n){let i=h.fromElements(e[0],e[1],e[2],qz),o=e[3];i=F.multiplyByPoint(t,i,i);let r=F.getScale(t,Cle),s=h.maximumComponent(r);return o*=s,l(n)?(n.update(i,o),n):new p0(i,o)}jo.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,o;if(l(i)&&(o=t_.parseBoundingVolumeSemantic("TILE",i)),l(o)&&(e=o),!l(e))throw new ue("boundingVolume must be defined");if(ii(e,"3DTILES_bounding_volume_S2"))return new G2(e.extensions["3DTILES_bounding_volume_S2"]);let{box:r,region:s,sphere:a}=e;if(l(r)){let c=GJe(r,t,n);return this._verticalExaggeration!==1&&gle(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c}if(l(s)){let c=XJe(s,t,this._initialTransform,n);return this._verticalExaggeration===1||(c instanceof Td?gle(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight):(c.minimumHeight=br.getHeight(c.minimumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.maximumHeight=br.getHeight(c.maximumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.computeBoundingVolumes(ne.WGS84))),c}if(l(a)){let c=IJe(a,t,n);if(this._verticalExaggeration!==1){let d=br.getPosition(c.center,ne.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,qz),u=c.radius*this._verticalExaggeration;c.update(d,u)}return c}throw new ue("boundingVolume must contain a sphere, region, or box")};var WJe=h.unpackArray(new Array(8*3).fill(0));function gle(e,t,n){let i=e.boundingVolume.computeCorners(WJe).map(r=>br.getPosition(r,ne.WGS84,t,n,r)),o=Gn.fromPoints(i,Lle);e.update(o.center,o.halfAxes)}jo.prototype.updateTransform=function(e,t){e=y(e,F.IDENTITY);let n=F.multiplyTransformation(e,this.transform,Qz),i=!F.equals(n,this.computedTransform),o=l(t)&&(this._verticalExaggeration!==t.verticalExaggeration||this._verticalExaggerationRelativeHeight!==t.verticalExaggerationRelativeHeight);if(!i&&!o)return;i&&F.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()};jo.prototype.updateGeometricErrorScale=function(){let e=F.getScale(this.computedTransform,Cle),t=h.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function PJe(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=Y.WHITE:c=Y.DARKGRAY:c=Y.YELLOW,l(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(c)),e._debugBoundingVolume.update(n);let d=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");d.color=Ht.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(Y.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(Y.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=Y.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),a&&t.makeStyleDirty()}function vJe(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 wJe(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)}function FJe(e,t){let n=t.clippingPolygons,i=0;l(n)&&e._isClippedByPolygon&&n.enabled&&(i=n.clippingPolygonsState),i!==e._clippingPolygonsState&&(e._clippingPolygonsState=i,e.clippingPolygonsDirty=!0)}jo.prototype.update=function(e,t,n){let{commandList:i}=t,o=i.length;wJe(this,e),FJe(this,e),PJe(this,e,t,n),vJe(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===Re.TRANSLUCENT;a.depthForTranslucentClassification=c}this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1};var yle=[];jo.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(xJe(this),this._selectedFrame=0,this.lastStyleTime=0,q.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=yle;try{this._content.update(e,t)}catch(i){throw this._contentState=Uo.FAILED,i}yle.length=0,t.commandList=n};function xle(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function H5(e,t,n){return Math.max(W.normalize(e,t,n)-W.EPSILON7,0)}jo.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),g=u+m,f=r,x=Math.pow(10,g),_=g+f,C=Math.pow(10,_),V=H5(this._depth,n.depth,i.depth);V=t?1-V:V;let Z=!e.isSkippingLevelOfDetail&&this.refine===Mo.REPLACE?H5(this._priorityHolder._distanceToCamera,n.distance,i.distance):H5(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),E=xle(Z,a,s),X=this._priorityProgressiveResolution?0:p,v=H5(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),P=xle(v,d,c),A=this.priorityDeferred?x:0,M=e._pass===vo.PRELOAD_FLIGHT?0:C;this._priority=V+E+X+P+A+M};jo.prototype.isDestroyed=function(){return!1};jo.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(),me(this)};var Fu=jo;var bkn=T(S(),1);var rkn=T(S(),1);function b0(e){e=y(e,y.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(b0.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}}});b0.prototype.hasProperty=function(e){return Mn.hasProperty(e,this._properties,this._class)};b0.prototype.hasPropertyBySemantic=function(e){return Mn.hasPropertyBySemantic(e,this._properties,this._class)};b0.prototype.getPropertyIds=function(e){return Mn.getPropertyIds(this._properties,this._class,e)};b0.prototype.getProperty=function(e){return Mn.getProperty(e,this._properties,this._class)};b0.prototype.setProperty=function(e,t){return Mn.setProperty(e,t,this._properties,this._class)};b0.prototype.getPropertyBySemantic=function(e){return Mn.getPropertyBySemantic(e,this._properties,this._class)};b0.prototype.setPropertyBySemantic=function(e,t){return Mn.setPropertyBySemantic(e,t,this._properties,this._class)};var c1=b0;var dkn=T(S(),1);function g0(e){e=y(e,y.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(g0.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});g0.prototype.hasProperty=function(e){return Mn.hasProperty(e,this._properties,this._class)};g0.prototype.hasPropertyBySemantic=function(e){return Mn.hasPropertyBySemantic(e,this._properties,this._class)};g0.prototype.getPropertyIds=function(e){return Mn.getPropertyIds(this._properties,this._class,e)};g0.prototype.getProperty=function(e){return Mn.getProperty(e,this._properties,this._class)};g0.prototype.setProperty=function(e,t){return Mn.setProperty(e,t,this._properties,this._class)};g0.prototype.getPropertyBySemantic=function(e){return Mn.getPropertyBySemantic(e,this._properties,this._class)};g0.prototype.setPropertyBySemantic=function(e,t){return Mn.setPropertyBySemantic(e,t,this._properties,this._class)};var E2=g0;function Rle(e){e=y(e,y.EMPTY_OBJECT);let t=e.metadataJson,n=e.schema,i=y(t.metadata,t.tileset),o;l(i)&&(o=new E2({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 c1({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 c1({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(Rle.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 X_=Rle;var Skn=T(S(),1);var Zle={},AJe=new h;Zle.checkChildrenWithinParent=function(e){let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof Td||i instanceof vu){let o=i._orientedBoundingBox;e._optimChildrenWithinParent=Xu.USE_OPTIMIZATION;for(let r=0;r<n;++r){let a=t[r].boundingVolume;if(!(a instanceof Td||a instanceof vu)){e._optimChildrenWithinParent=Xu.SKIP_OPTIMIZATION;break}let c=a._orientedBoundingBox,d=h.subtract(c.center,o.center,AJe),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=Xu.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===Xu.USE_OPTIMIZATION};var X2=Zle;var Ekn=T(S(),1);var Lkn=T(S(),1);function I2(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(I2.prototype,{length:{get:function(){return this._length}}});function MJe(e,t,n){this.item=e,this.previous=t,this.next=n}I2.prototype.add=function(e){let t=new MJe(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 Gle(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}I2.prototype.remove=function(e){l(e)&&(Gle(this,e),--this._length)};I2.prototype.splice=function(e,t){if(e===t)return;Gle(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 W2=I2;function I_(){this._list=new W2,this._sentinel=this._list.add(),this._trimTiles=!1}I_.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};I_.prototype.touch=function(e){let t=e.cacheNode;l(t)&&this._list.splice(this._sentinel,t)};I_.prototype.add=function(e){l(e.cacheNode)||(e.cacheNode=this._list.add(e))};I_.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;l(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};I_.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)}};I_.prototype.trim=function(){this._trimTiles=!0};var P2=I_;var wkn=T(S(),1);function z5(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 eK(e,t){let n;return t==="_loadTimestamp"?n=q.toDate(e).getTime():n=e,n}z5.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=eK(e,n),this._referenceMaximum[n]=eK(t,n)};function NJe(e,t){let n=e.tilePropertyName;if(l(n)){let i=eK(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 $z=[new Y(.1,.1,.1,1),new Y(.153,.278,.878,1),new Y(.827,.231,.49,1),new Y(.827,.188,.22,1),new Y(1,.592,.259,1),new Y(1,.843,0,1)];z5.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=NJe(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=$z.length-1,u=c*d,m=Math.floor(u),p=Math.ceil(u),g=u-m,f=$z[m],x=$z[p],_=Y.clone(Y.WHITE);_.red=W.lerp(f.red,x.red,g),_.green=W.lerp(f.green,x.green,g),_.blue=W.lerp(f.blue,x.blue,g),e._debugColor=_};z5.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 v2=z5;var Mkn=T(S(),1);function l1(){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}l1.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 K5(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)K5(e,o[p],n,i)}}l1.prototype.incrementSelectionCounts=function(e){K5(this,e,!1,!1)};l1.prototype.incrementLoadCounts=function(e){K5(this,e,!1,!0)};l1.prototype.decrementLoadCounts=function(e){K5(this,e,!0,!0)};l1.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 y0=l1;var Ukn=T(S(),1);function w2(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(w2.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});w2.prototype.makeDirty=function(){this._styleDirty=!0};w2.prototype.resetDirty=function(){this._styleDirty=!1};w2.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 F2=w2;var Jkn=T(S(),1);function kJe(e,t,n){let i=ii(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)&&!ii(o,"3DTILES_bounding_volume_S2")&&!ii(o,"3DTILES_bounding_volume_cylinder"))throw new ue("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 Ee({url:i.subtrees.uri}),this.contentUriTemplates=[],this.contentHeaders=[];let r=UJe(t);for(let s=0;s<r.length;s++){let a=r[s];this.contentHeaders.push(Ye(a,!0));let c=new Ee({url:a.uri});this.contentUriTemplates.push(c)}this.contentCount=this.contentHeaders.length,this.tileHeader=DJe(t),this.subdivisionScheme=Hr[i.subdivisionScheme],this.branchingFactor=Hr.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,l(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function UJe(e){if(ii(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 DJe(e){let t=Ye(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 W_=kJe;var iUn=T(S(),1);var qkn=T(S(),1);var A2={};function Ele(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function tK(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function Xle(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 nK(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}A2.encode2D=function(e,t){return(Ele(e)|Ele(t)<<1)>>>0};A2.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=Xle(e),t[1]=Xle(e>>1),t};A2.encode3D=function(e,t,n){return tK(e)|tK(t)<<1|tK(n)<<2};A2.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=nK(e),t[1]=nK(e>>1),t[2]=nK(e>>2),t};var Gg=A2;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===Hr.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===Hr.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===Hr.OCTREE?Gg.encode3D(this.x,this.y,this.z):Gg.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===Hr.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===Hr.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===Hr.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===Hr.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===Hr.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===Hr.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===Hr.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===Hr.OCTREE&&(e.z=this.z),e};var Ile=[0,0,0];Do.fromMortonIndex=function(e,t,n,i){let o;return e===Hr.OCTREE?(o=Gg.decode3D(i,Ile),new Do({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1],z:o[2]})):(o=Gg.decode2D(i,Ile),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===Hr.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 P_=Do;var bUn=T(S(),1);var dUn=T(S(),1);function x0(){}x0.selectTiles=function(e,t){pe.throwInstantiationError()};x0.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};x0.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};x0.selectTile=function(e,t){if(e.contentVisibility(t)===Kt.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)};x0.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};x0.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};x0.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!BJe(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function BJe(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}x0.updateTile=function(e,t){Wle(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,HJe(e),e._shouldSelect=!1,e._finalResolution=!0};function Wle(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];Wle(r,t),e._visible=r._visible;return}if(YJe(e,t)){e._visible=!1;return}let i=e.refine===Mo.REPLACE,o=e._optimChildrenWithinParent===Xu.USE_OPTIMIZATION;if(i&&o&&n&&!OJe(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function YJe(e,t){let{parent:n,tileset:i}=e;return!l(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==Mo.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function OJe(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 HJe(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 Ns=x0;function Ple(){}var M2={stack:new Uc,stackMaximumLength:0};Ple.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}=Ns,s=M2.stack;for(s.push(i);s.length>0;){M2.stackMaximumLength=Math.max(M2.stackMaximumLength,s.length);let a=s.pop(),c=a.refine===Mo.ADD,d=a.refine===Mo.REPLACE,u=zJe(a);u&&KJe(a,s,t),(c||d&&!u)&&(JJe(e,a),o(a,t),QJe(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),r(a,t)}return M2.stack.trim(M2.stackMaximumLength),n};function zJe(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function KJe(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 JJe(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function QJe(e,t){e.contentAvailable&&e.contentVisibility(t)!==Kt.OUTSIDE&&e.tileset._selectedTiles.push(e)}var N2=Ple;var SUn=T(S(),1);function vle(){}var k2={stack:new Uc,stackMaximumLength:0},U2={stack:new Uc,stackMaximumLength:0};vle.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(Ns.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;qJe(n,t),k2.stack.trim(k2.stackMaximumLength),U2.stack.trim(U2.stackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function iK(e,t){e.contentAvailable&&Ns.selectTile(e,t)}function jJe(e,t,n){let i=e.refine===Mo.REPLACE,{tileset:o,children:r}=e,{updateTile:s,loadTile:a,touchTile:c}=Ns;for(let f=0;f<r.length;++f)s(r[f],n);r.sort(Ns.sortChildrenByDistanceToCamera);let d=i&&e.hasRenderableContent,u=!0,m=!1,p=-1,g=Number.MAX_VALUE;for(let f=0;f<r.length;++f){let x=r[f];if(x.isVisible?(t.push(x),x._foveatedFactor<g&&(p=f,g=x._foveatedFactor),m=!0):(d||o.loadSiblings)&&(x._foveatedFactor<g&&(p=f,g=x._foveatedFactor),a(x,n),c(x,n)),d){let _;x._inRequestVolume?x.hasRenderableContent?_=x.contentAvailable:_=$Je(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)&&g<=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 qJe(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:o,visitTile:r,touchTile:s}=Ns,a=k2.stack;for(a.push(e);a.length>0;){k2.stackMaximumLength=Math.max(k2.stackMaximumLength,a.length);let c=a.pop(),d=c.parent,u=!l(d)||d._refines;c._refines=i(c)?jJe(c,a,t)&&u:!1;let m=!c._refines&&u;c.hasRenderableContent?c.refine===Mo.ADD?(iK(c,t),o(c,t)):c.refine===Mo.REPLACE&&(o(c,t),m&&iK(c,t)):(n._emptyTiles.push(c),o(c,t),m&&iK(c,t)),r(c,t),s(c,t)}}function $Je(e,t){let{canTraverse:n,updateTile:i,loadTile:o,touchTile:r}=Ns,s=!0,a=U2.stack;for(a.push(e);a.length>0;){U2.stackMaximumLength=Math.max(U2.stackMaximumLength,a.length);let c=a.pop(),d=c.children,u=d.length,m=!c.hasRenderableContent&&n(c);if(!m&&!c.contentAvailable&&(s=!1),i(c,t),c.isVisible||(o(c,t),r(c,t)),m)for(let p=0;p<u;++p){let g=d[p];a.push(g)}}return e.hasEmptyContent||s}var D2=vle;var GUn=T(S(),1);function wle(){}var B2={stack:new Uc,stackMaximumLength:0},Y2={stack:new Uc,stackMaximumLength:0},_0={stack:new Uc,stackMaximumLength:0,ancestorStack:new Uc,ancestorStackMaximumLength:0},eQe=2;wle.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(Ns.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;sQe(n,t),aQe(n,t),B2.stack.trim(B2.stackMaximumLength),Y2.stack.trim(Y2.stackMaximumLength),_0.stack.trim(_0.stackMaximumLength),_0.ancestorStack.trim(_0.ancestorStackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function tQe(e,t){let{updateTile:n,touchTile:i,selectTile:o}=Ns,r=Y2.stack;for(r.push(e);r.length>0;){Y2.stackMaximumLength=Math.max(Y2.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<eQe&&r.push(d))}}}function J5(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;l(n)?n._shouldSelect=!0:tQe(e,t)}function nQe(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 iQe(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 oQe(e,t,n){let{tileset:i,children:o}=e,{updateTile:r,loadTile:s,touchTile:a}=Ns;for(let d=0;d<o.length;++d)r(o[d],n);o.sort(Ns.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 rQe(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 sQe(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}=Ns,c=B2.stack;for(c.push(e);c.length>0;){B2.stackMaximumLength=Math.max(B2.stackMaximumLength,c.length);let d=c.pop();nQe(d,t);let u=d.parent,m=!l(u)||u._refines;d._refines=o(d)?oQe(d,c,t)&&m:!1;let p=!d._refines&&m;d.hasRenderableContent?d.refine===Mo.ADD?(J5(d,t),r(d,t)):d.refine===Mo.REPLACE&&(rQe(d,i)?(r(d,t),p&&J5(d,t)):p?(J5(d,t),r(d,t)):iQe(n,d)&&r(d,t)):(n._emptyTiles.push(d),r(d,t),p&&J5(d,t)),s(d,t),a(d,t)}}function aQe(e,t){let{selectTile:n,canTraverse:i}=Ns,{stack:o,ancestorStack:r}=_0,s;for(o.push(e);o.length>0||r.length>0;){if(_0.stackMaximumLength=Math.max(_0.stackMaximumLength,o.length),_0.ancestorStackMaximumLength=Math.max(_0.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===Mo.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 O2=wle;function qo(e){e=y(e,y.EMPTY_OBJECT),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 P2,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=y(e.showCreditsOnScreen,!1),this._cullWithChildrenBounds=y(e.cullWithChildrenBounds,!0),this._allTilesAdditive=!0,this._hasMixedContent=!1,this._stencilClearCommand=void 0,this._backfaceCommands=new Uc,this._maximumScreenSpaceError=y(e.maximumScreenSpaceError,16),this._memoryAdjustedScreenSpaceError=this._maximumScreenSpaceError,this._cacheBytes=y(e.cacheBytes,512*1024*1024);let t=y(e.maximumCacheOverflowBytes,512*1024*1024);this._maximumCacheOverflowBytes=t,this._styleEngine=new F2,this._styleApplied=!1,this._modelMatrix=l(e.modelMatrix)?F.clone(e.modelMatrix):F.clone(F.IDENTITY),this._addHeightCallbacks=[],this._statistics=new y0,this._statisticsLast=new y0,this._statisticsPerPass=new Array(vo.NUMBER_OF_PASSES);for(let o=0;o<vo.NUMBER_OF_PASSES;++o)this._statisticsPerPass[o]=new y0;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 v2(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=y(e.cullRequestsWhileMoving,!0),this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=y(e.cullRequestsWhileMovingMultiplier,60),this.progressiveResolutionHeightFraction=W.clamp(y(e.progressiveResolutionHeightFraction,.3),0,.5),this.preferLeaves=y(e.preferLeaves,!1),this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._classificationType=e.classificationType,this._ellipsoid=y(e.ellipsoid,ne.WGS84),this._initialClippingPlanesOriginMatrix=F.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=y(e.vectorClassificationOnly,!1),this._vectorKeepDecodedPositions=y(e.vectorKeepDecodedPositions,!1),this.preloadWhenHidden=y(e.preloadWhenHidden,!1),this.preloadFlightDestinations=y(e.preloadFlightDestinations,!0),this._pass=void 0,this.dynamicScreenSpaceError=y(e.dynamicScreenSpaceError,!0),this.foveatedScreenSpaceError=y(e.foveatedScreenSpaceError,!0),this._foveatedConeSize=y(e.foveatedConeSize,.1),this._foveatedMinimumScreenSpaceErrorRelaxation=y(e.foveatedMinimumScreenSpaceErrorRelaxation,0),this.foveatedInterpolationCallback=y(e.foveatedInterpolationCallback,W.lerp),this.foveatedTimeDelay=y(e.foveatedTimeDelay,.2),this.dynamicScreenSpaceErrorDensity=y(e.dynamicScreenSpaceErrorDensity,2e-4),this.dynamicScreenSpaceErrorFactor=y(e.dynamicScreenSpaceErrorFactor,24),this.dynamicScreenSpaceErrorHeightFalloff=y(e.dynamicScreenSpaceErrorHeightFalloff,.25),this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=y(e.shadows,_n.ENABLED),this.show=y(e.show,!0),this.colorBlendMode=Ll.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new sf(e.pointCloudShading),this._pointCloudEyeDomeLighting=new Kp,this.loadProgress=new be,this.allTilesLoaded=new be,this.initialTilesLoaded=new be,this.tileLoad=new be,this.tileUnload=new be,this.tileFailed=new be,this.tileVisible=new be,this.skipLevelOfDetail=y(e.skipLevelOfDetail,!1),this._disableSkipLevelOfDetail=!1,this.baseScreenSpaceError=y(e.baseScreenSpaceError,1024),this.skipScreenSpaceErrorFactor=y(e.skipScreenSpaceErrorFactor,16),this.skipLevels=y(e.skipLevels,1),this.immediatelyLoadDesiredLevelOfDetail=y(e.immediatelyLoadDesiredLevelOfDetail,!1),this.loadSiblings=y(e.loadSiblings,!1),this._clippingPlanes=void 0,l(e.clippingPlanes)&&as.setOwner(e.clippingPlanes,this,"_clippingPlanes"),this._clippingPolygons=void 0,l(e.clippingPolygons)&&Am.setOwner(e.clippingPolygons,this,"_clippingPolygons"),l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new Fx,this._shouldDestroyImageBasedLighting=!0),this.lightColor=e.lightColor,this.backFaceCulling=y(e.backFaceCulling,!0),this._enableShowOutline=y(e.enableShowOutline,!0),this.showOutline=y(e.showOutline,!0),this.outlineColor=y(e.outlineColor,Y.BLACK),this.splitDirection=y(e.splitDirection,Gr.NONE),this.enableCollision=y(e.enableCollision,!1),this._projectTo2D=y(e.projectTo2D,!1),this._enablePick=y(e.enablePick,!1),this.debugFreezeFrame=y(e.debugFreezeFrame,!1),this.debugColorizeTiles=y(e.debugColorizeTiles,!1),this._enableDebugWireframe=y(e.enableDebugWireframe,!1),this.debugWireframe=y(e.debugWireframe,!1),this.debugWireframe===!0&&this._enableDebugWireframe===!1&&Nt("tileset-debug-wireframe-ignored","enableDebugWireframe must be set to true in the Cesium3DTileset constructor, otherwise debugWireframe will be ignored."),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowContentBoundingVolume=y(e.debugShowContentBoundingVolume,!1),this.debugShowViewerRequestVolume=y(e.debugShowViewerRequestVolume,!1),this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=y(e.debugShowGeometricError,!1),this.debugShowRenderingStatistics=y(e.debugShowRenderingStatistics,!1),this.debugShowMemoryUsage=y(e.debugShowMemoryUsage,!1),this.debugShowUrl=y(e.debugShowUrl,!1),this.examineVectorLinesFunction=void 0,this._metadataExtension=void 0,this._customShader=e.customShader;let n=y(e.featureIdLabel,"featureId_0");typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=y(e.instanceFeatureIdLabel,"instanceFeatureId_0");typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i}Object.defineProperties(qo.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){as.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){Am.setOwner(e,this,"_clippingPolygons")}},properties:{get:function(){return this._properties}},tilesLoaded:{get:function(){return this._tilesLoaded}},resource:{get:function(){return this._resource}},basePath:{get:function(){return Es("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=F.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&&(F.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):F.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,Ble(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}}});qo.fromIonAssetId=async function(e,t){let n=await md.fromAssetId(e);return qo.fromUrl(n,t)};qo.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Ee.createIfNeeded(e),i;n.extension==="json"?i=n.getBaseUri(!0):n.isDataUri&&(i="");let o=await qo.loadJson(n),r=await cQe(n,o),s=new qo(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,Ble(s);let c=l(o.asset.gltfUpAxis)?Xo.fromName(o.asset.gltfUpAxis):Xo.Y,d=y(t.modelUpAxis,c),u=y(t.modelForwardAxis,Xo.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,F.IDENTITY).boundingSphere.center,g=s._ellipsoid.cartesianToCartographic(p);return l(g)&&g.height>ai._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=wt.eastNorthUpToFixedFrame(p)),s._clippingPlanesOriginMatrix=F.clone(s._initialClippingPlanesOriginMatrix),s};qo.loadJson=function(e){return Ee.createIfNeeded(e).fetchJson()};qo.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};qo.prototype.loadTileset=function(e,t,n){let i=t.asset;if(!l(i))throw new ue("Tileset must have an asset property.");if(i.version!=="0.0"&&i.version!=="1.0"&&i.version!=="1.1")throw new ue("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");l(t.extensionsRequired)&&qo.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=Fle(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===Mo.ADD;let d=c._header.children;if(l(d))for(let u=0;u<d.length;++u){let m=d[u],p=Fle(this,e,m,c);c.children.push(p),p._depth=c._depth+1,a.push(p)}this._cullWithChildrenBounds&&X2.checkChildrenWithinParent(c)}return s};function Fle(e,t,n,i){if(!(l(n.implicitTiling)||ii(n,"3DTILES_implicit_tiling")))return new Fu(e,t,n,i);let r=e.schema,s=new W_(t,n,r),a=new P_({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:0,x:0,y:0,z:0}),c=s.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()}).url,u=Ye(n,!0);u.contents=[{uri:c}],delete u.content,delete u.extensions;let m=new Fu(e,t,u,i);return m.implicitTileset=s,m.implicitCoordinates=a,m}async function cQe(e,t){let n=ii(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(l(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=Bi.getSchemaLoader({resource:e});else if(l(n.schema))i=Bi.getSchemaLoader({schema:n.schema});else return;await i.load();let o=new X_({schema:i.schema,metadataJson:n});return Bi.unload(i),o}var Ale=new h,lQe=new he,dQe=new F,uQe=new h,mQe=new h,hQe=new h,fQe=new h;function pQe(e,t){let n,i,o,r,s,a=t.camera,c=e._root,d=c.contentBoundingVolume;if(d instanceof vu)n=h.normalize(a.positionWC,Ale),i=a.directionWC,o=a.positionCartographic.height,r=d.minimumHeight,s=d.maximumHeight;else{let x=F.inverseTransformation(c.computedTransform,dQe),_=t.mapProjection.ellipsoid,C=d.boundingVolume,V=F.multiplyByPoint(x,C.center,uQe);if(h.magnitude(V)>_.minimumRadius){let L=he.fromCartesian(V,_,lQe);n=h.normalize(a.positionWC,Ale),i=a.directionWC,o=a.positionCartographic.height,r=0,s=L.height*2}else{let L=F.multiplyByPoint(x,a.positionWC,mQe);if(n=h.UNIT_Z,i=F.multiplyByPointAsVector(x,a.directionWC,hQe),i=h.normalize(i,i),o=L.z,d instanceof Td){let Z=$.getColumn(C.halfAxes,2,fQe),E=h.magnitude(Z);r=V.z-E,s=V.z+E}else if(d instanceof p0){let Z=C.radius;r=V.z-Z,s=V.z+Z}}}let u=e.dynamicScreenSpaceErrorHeightFalloff,m=r+(s-r)*u,p=s,g=W.clamp((o-m)/(p-m),0,1),f=1-Math.abs(h.dot(i,n));f=f*(1-g),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*f}function bQe(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=>{kle(r,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?XQe(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function Nle(e,t){return e._priority-t._priority}qo.prototype.postPassesUpdate=function(e){l(this._root)&&(gQe(this,e),WQe(this,e),this._cache.unloadTiles(this,Dle),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};qo.prototype.prePassesUpdate=function(e){if(!l(this._root))return;VQe(this,e);let t=this._clippingPlanes;this._clippingPlanesOriginMatrixDirty=!0,l(t)&&t.enabled&&t.update(e);let n=this._clippingPolygons;l(n)&&n.enabled&&n.update(e),l(this._loadTimestamp)||(this._loadTimestamp=q.clone(e.time)),this._timeSinceLoad=Math.max(q.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&pQe(this,e),e.newFrame&&this._cache.reset()};function gQe(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 yQe(e){let t=e._requestedTiles;t.sort(Nle);for(let n=0;n<t.length;++n)bQe(e,t[n])}function kle(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 xQe(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 _Qe=new he,TQe=new he,SQe=new h;function CQe(e,t,n){if(!e.enableCollision||!e.show)return;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,_Qe),c=he.fromCartesian(o.center,s,TQe);l(c)&&(a.height=c.height);let d=he.toCartesian(a,s,SQe);h.distance(d,o.center)<=o.radius&&n.afterRender.push(()=>{l(r.callback)&&r.callback(a),r.invoked=!1})}}function VQe(e,t){xQe(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,kle(u,e,d)}}e.totalMemoryUsageInBytes<i?RQe(e):a&&n.length>0&&LQe(e)}function LQe(e){e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n<t.length;++n)t[n].updatePriority();t.sort(Nle)}function RQe(e){e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError)}var Q5=new h,ZQe={maximumFractionDigits:3};function Mle(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,ZQe):Math.round(t).toLocaleString()}function oK(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,o=h.clone(i,Q5);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,Q5);r=h.multiplyByScalar(r,.75*n,Q5),o=h.add(r,i,Q5)}return o}function rK(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: ${Mle(e.content.texturesByteLength)}`,i+=`
Geometry Memory: ${Mle(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 GQe(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:oK(e.debugPickedTile),a=rK(e.debugPickedTile,e,s);a.pixelOffset=new D(15,-15)}}else{for(let s=0;s<i;++s){let a=n[s];rK(a,e,oK(a))}for(let s=0;s<r;++s){let a=o[s];(a.hasTilesetContent||a.hasImplicitContent)&&rK(a,e,oK(a))}}e._tileDebugLabels.update(t)}function EQe(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 ei({stencil:0,pass:Re.CESIUM_3D_TILE,renderState:Ue.fromCache({stencilMask:Bt.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),CQe(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 g=i.length-m;if(e._backfaceCommands.trim(),a){let f=e._backfaceCommands.values,x=f.length;i.length+=x;for(let _=g-1;_>=0;--_)i[m+x+_]=i[m+_];for(let _=0;_<x;++_)i[m+_]=f[_]}g=i.length-r,c.numberOfCommands=g,u&&(e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&g>0&&e._pointCloudEyeDomeLighting.update(t,r,e.pointCloudShading,e.boundingSphere),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(l(e._tileDebugLabels)||(e._tileDebugLabels=new uf),GQe(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var Ule=[];function XQe(e,t){let n=t,i=Ule;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&&(IQe(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function Dle(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function IQe(e,t){e._cache.unloadTile(e,t,Dle),t.destroy()}qo.prototype.trimLoadedTiles=function(){this._cache.trim()};function WQe(e,t){let n=e._statistics,i=e._statisticsLast,o=n.numberOfPendingRequests,r=n.numberOfTilesProcessing,s=i.numberOfPendingRequests,a=i.numberOfTilesProcessing;y0.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 PQe(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 vQe(e,t){t.frameNumber===e._updatedModelMatrixFrame&&l(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!F.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=F.clone(e.modelMatrix,e._previousModelMatrix)))}function wQe(e,t,n,i){if(t.mode===oe.MORPHING||!l(e._root))return!1;let o=e._statistics;o.clear(),++e._updatedVisibilityFrame,PQe(e),vQe(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let r=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&yQe(e),EQe(e,t,i),y0.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 Ble(e){let t=e._credits;l(t)||(t=[]),t.length=0,l(e.resource.credits)&&e.resource.credits.forEach(i=>{t.push(Rt.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 Rt(r.html))}}t.forEach(i=>i.showOnScreen=i.showOnScreen||e._showCreditsOnScreen),e._credits=t}qo.prototype.getTraversal=function(e){let{pass:t}=e;return t===vo.MOST_DETAILED_PRELOAD||t===vo.MOST_DETAILED_PICK?N2:this.isSkippingLevelOfDetail?O2:D2};qo.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};qo.prototype.updateForPass=function(e,t){let n=t.pass;if(n===vo.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===vo.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===vo.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=vo.getPassOptions(n),a=s.ignoreCommands,c=y(t.commandList,i),d=c.length;e.commandList=c,e.camera=y(t.camera,o),e.cullingVolume=y(t.cullingVolume,r);let u=this._clippingPolygons;l(u)&&u.enabled&&u.queueCommands(e);let m=this._statisticsPerPass[n];(this.show||a)&&(this._pass=n,t.ready=wQe(this,e,m,s)),a&&(c.length=d),e.commandList=i,e.camera=o,e.cullingVolume=r};qo.prototype.hasExtension=function(e){return l(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};qo.prototype.isDestroyed=function(){return!1};qo.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=this._clippingPolygons&&this._clippingPolygons.destroy(),l(this._root)){let e=Ule;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,me(this)};qo.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};qo.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!qo.supportedExtensions[e[t]])throw new ue(`Unsupported 3D Tiles Extension: ${e[t]}`)};var FQe=new pn,AQe=new h,MQe=new he;qo.prototype.getHeight=function(e,t){let n=t.ellipsoid;l(n)||(n=ne.WGS84);let i=FQe,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,AQe);if(l(r))return n.cartesianToCartographic(r,MQe)?.height};qo.prototype.updateHeight=function(e,t,n){n=y(n,ne.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 NQe=new Va,kQe=new h;qo.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=qn.raySphere(e,d.contentBoundingVolume.boundingSphere,NQe);!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,kQe);if(l(u))return a=h.clone(u,n),a}};var ra=qo;var UQe=new F;function Eg(e,t){t.collectionChanged.addEventListener(Eg.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new Lt,this._onCollectionChanged(t,t.values,[],[])}Eg.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)&&K.getValueOrDefault(a._show,e,!0),m;u&&(m=s.computeModelMatrix(e,UQe),c=Ee.createIfNeeded(K.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],DQe(c,n,s,i)),l(p)&&(p.show=!0,l(m)&&(p.modelMatrix=m),p.maximumScreenSpaceError=K.getValueOrDefault(a.maximumScreenSpaceError,e,p.maximumScreenSpaceError))}return!0};Eg.prototype.isDestroyed=function(){return!1};Eg.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Eg.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)sK(this,e[i],t,n);return me(this)};Eg.prototype.getBoundingSphere=function(e,t){let n=this._tilesetHash[e.id];if(!l(n)||n.loadFail)return ft.FAILED;let i=n.tilesetPrimitive;return l(i)?i.show?(ce.clone(i.boundingSphere,t),ft.DONE):ft.FAILED:ft.PENDING};Eg.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):(sK(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],sK(this,r,a,c),s.remove(r.id)};function sK(e,t,n,i){let o=n[t.id];l(o)&&(l(o.tilesetPrimitive)&&i.removeAndDestroy(o.tilesetPrimitive),delete n[t.id])}async function DQe(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let o=await ra.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 H2=Eg;var r3n=T(S(),1);var BQe=Y.WHITE,YQe=Y.BLACK,OQe=new D(2,2);function d1(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new be,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(d1.prototype,{isConstant:{get:function(){return K.isConstant(this._evenColor)&&K.isConstant(this._oddColor)&&K.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:de("evenColor"),oddColor:de("oddColor"),repeat:de("repeat")});d1.prototype.getType=function(e){return"Checkerboard"};var HQe=new q;d1.prototype.getValue=function(e,t){return l(e)||(e=q.now(HQe)),l(t)||(t={}),t.lightColor=K.getValueOrClonedDefault(this._evenColor,e,BQe,t.lightColor),t.darkColor=K.getValueOrClonedDefault(this._oddColor,e,YQe,t.darkColor),t.repeat=K.getValueOrDefault(this._repeat,e,OQe),t};d1.prototype.equals=function(e){return this===e||e instanceof d1&&K.equals(this._evenColor,e._evenColor)&&K.equals(this._oddColor,e._oddColor)&&K.equals(this._repeat,e._repeat)};var u1=d1;var C3n=T(S(),1);var b3n=T(S(),1);var Yle={id:void 0};function z2(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 mc(e){this._owner=e,this._entities=new Lt,this._addedEntities=new Lt,this._removedEntities=new Lt,this._changedEntities=new Lt,this._suspendCount=0,this._collectionChanged=new be,this._id=Bn(),this._show=!0,this._firing=!1,this._refire=!1}mc.prototype.suspendEvents=function(){this._suspendCount++};mc.prototype.resumeEvents=function(){this._suspendCount--,z2(this)};Object.defineProperties(mc.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}}});mc.prototype.computeAvailability=function(){let e=De.MAXIMUM_VALUE,t=De.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;q.lessThan(a,e)&&!a.equals(De.MINIMUM_VALUE)&&(e=a),q.greaterThan(c,t)&&!c.equals(De.MAXIMUM_VALUE)&&(t=c)}}return De.MAXIMUM_VALUE.equals(e)&&(e=De.MINIMUM_VALUE),De.MINIMUM_VALUE.equals(t)&&(t=De.MAXIMUM_VALUE),new Vn({start:e,stop:t})};mc.prototype.add=function(e){e instanceof Jo||(e=new Jo(e));let t=e.id,n=this._entities;if(n.contains(t))throw new pe(`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(mc.prototype._onEntityDefinitionChanged,this),z2(this),e};mc.prototype.remove=function(e){return l(e)?this.removeById(e.id):!1};mc.prototype.contains=function(e){return this._entities.get(e.id)===e};mc.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(mc.prototype._onEntityDefinitionChanged,this),z2(this),!0):!1};mc.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(mc.prototype._onEntityDefinitionChanged,this),o.set(a,s))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),z2(this)};mc.prototype.getById=function(e){return this._entities.get(e)};mc.prototype.getOrCreateEntity=function(e){let t=this._entities.get(e);return l(t)||(Yle.id=e,t=new Jo(Yle),this.add(t)),t};mc.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),z2(this)};var ks=mc;var j5={id:void 0},m1=new Array(2);function aK(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 Ole(e,t,n,i){m1[0]=n,m1[1]=i.id,t[JSON.stringify(m1)]=i.definitionChanged.addEventListener(Pr.prototype._onDefinitionChanged,e)}function Hle(e,t,n,i){m1[0]=n,m1[1]=i.id;let o=JSON.stringify(m1);t[o](),t[o]=void 0}function Xg(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,g;for(r=0;r<o;r++)for(d=i[r],d.collectionChanged.removeEventListener(Pr.prototype._onCollectionChanged,e),a=d.values,g=d.id,c=a.length-1;c>-1;c--)s=a[c],Hle(e,p,g,s);for(r=n-1;r>=0;r--)for(d=t[r],d.collectionChanged.addEventListener(Pr.prototype._onCollectionChanged,e),a=d.values,g=d.id,c=a.length-1;c>-1;c--){s=a[c],Ole(e,p,g,s);let x=m.getById(s.id);l(x)||(x=u.getById(s.id),l(x)?aK(x):(j5.id=s.id,x=new Jo(j5)),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 Pr(e,t){this._owner=t,this._composite=new ks(this),this._suspendCount=0,this._collections=l(e)?e.slice():[],this._collectionsCopy=[],this._id=Bn(),this._eventHash={},Xg(this),this._shouldRecomposite=!1}Object.defineProperties(Pr.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}}});Pr.prototype.addCollection=function(e,t){l(t)?this._collections.splice(t,0,e):(t=this._collections.length,this._collections.push(e)),Xg(this)};Pr.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),Xg(this),!0):!1};Pr.prototype.removeAllCollections=function(){this._collections.length=0,Xg(this)};Pr.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};Pr.prototype.contains=function(e){return this._composite.contains(e)};Pr.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};Pr.prototype.getCollection=function(e){return this._collections[e]};Pr.prototype.getCollectionsLength=function(){return this._collections.length};function q5(e,t){return e.indexOf(t)}function zle(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,Xg(e)}Pr.prototype.raiseCollection=function(e){let t=q5(this._collections,e);zle(this,t,t+1)};Pr.prototype.lowerCollection=function(e){let t=q5(this._collections,e);zle(this,t,t-1)};Pr.prototype.raiseCollectionToTop=function(e){let t=q5(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),Xg(this))};Pr.prototype.lowerCollectionToBottom=function(e){let t=q5(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),Xg(this))};Pr.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};Pr.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(Xg(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};Pr.prototype.computeAvailability=function(){return this._composite.computeAvailability()};Pr.prototype.getById=function(e){return this._composite.getById(e)};Pr.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];Hle(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),aK(d)),d.merge(c));l(d)||r.removeById(x),d=void 0}let g=t.length;for(s=0;s<g;s++){let f=t[s];Ole(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)?aK(d):(j5.id=x,d=new Jo(j5),r.add(d))),d.merge(c));d=void 0}r.resumeEvents()};Pr.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 g=o[p].getById(e.id);if(l(g)){let f=g[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 cK=Pr;var j3n=T(S(),1);var Y3n=T(S(),1);var L3n=T(S(),1);function lK(){this._removalFunctions=[]}lK.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)}};lK.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var vr=lK;var F3n=T(S(),1);function mK(e,t){return q.compare(e.start,t.start)}function wr(e){if(this._intervals=[],this._changedEvent=new be,l(e)){let t=e.length;for(let n=0;n<t;n++)this.addInterval(e[n])}}Object.defineProperties(wr.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}}});wr.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof wr))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(!Vn.equals(n[r],i[r],t))return!1;return!0};wr.prototype.get=function(e){return this._intervals[e]};wr.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};wr.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};wr.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};wr.prototype.contains=function(e){return this.indexOf(e)>=0};var dK=new Vn;wr.prototype.indexOf=function(e){let t=this._intervals;dK.start=e,dK.stop=e;let n=Go(t,dK,mK);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&&Vn.contains(t[n-1],e)?n-1:~n)};wr.prototype.findInterval=function(e){e=y(e,y.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]}};wr.prototype.addInterval=function(e,t){if(e.isEmpty)return;let n=this._intervals;if(n.length===0||q.greaterThan(e.start,n[n.length-1].stop)){n.push(e),this._changedEvent.raiseEvent(this);return}let i=Go(n,e,mK);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=q.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)?(q.greaterThan(e.stop,n[i-1].stop)?e=new Vn({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new Vn({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=q.compare(n[i-1].stop,e.stop),(o>0||o===0&&n[i-1].isStopIncluded&&!e.isStopIncluded)&&n.splice(i,0,new Vn({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 Vn({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=q.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 Vn({start:e.start,stop:q.greaterThan(n[i].stop,e.stop)?n[i].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:q.greaterThan(n[i].stop,e.stop)?n[i].isStopIncluded:e.isStopIncluded,data:e.data}),n.splice(i,1);else if(n[i]=new Vn({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)};wr.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=Go(t,e,mK);n<0&&(n=~n);let i=!1;for(n>0&&(q.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,(q.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 Vn({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 Vn({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 Vn({start:t[n].start,stop:t[n].start,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data})),++n);n<t.length&&q.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 Vn({start:t[n].start,stop:t[n].stop,isStartIncluded:!0,isStopIncluded:t[n].isStopIncluded,data:t[n].data})):t[n]=new Vn({start:e.stop,stop:e.stop,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data}):t.splice(n,1)),n<t.length&&(q.greaterThan(e.stop,t[n].start)||e.stop.equals(t[n].start)&&e.isStopIncluded&&t[n].isStartIncluded)&&(i=!0,t[n]=new Vn({start:e.stop,stop:t[n].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n].isStopIncluded,data:t[n].data})),i&&this._changedEvent.raiseEvent(this),i};wr.prototype.intersect=function(e,t,n){let i=new wr,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(q.lessThan(c.stop,d.start))++o;else if(q.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=Vn.intersect(c,d,new Vn,n);u.isEmpty||i.addInterval(u,t)}q.lessThan(c.stop,d.stop)||c.stop.equals(d.stop)&&!c.isStopIncluded&&d.isStopIncluded?++o:++r}}return i};wr.fromJulianDateArray=function(e,t){l(t)||(t=new wr);let n=e.julianDates,i=n.length,o=e.dataCallback,r=y(e.isStartIncluded,!0),s=y(e.isStopIncluded,!0),a=y(e.leadingInterval,!1),c=y(e.trailingInterval,!1),d,u=0;a&&(++u,d=new Vn({start:De.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],g=n[m+1];d=new Vn({start:p,stop:g,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=g}return c&&(d=new Vn({start:n[i-1],stop:De.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0}),d.data=l(o)?o(d,t.length):t.length,t.addInterval(d)),t};var hc=new cp,K2=[0,31,28,31,30,31,30,31,31,30,31,30,31];function uK(e,t,n){l(n)||(n=new q),q.toGregorianDate(e,hc);let i=hc.millisecond+t.millisecond,o=hc.second+t.second,r=hc.minute+t.minute,s=hc.hour+t.hour,a=hc.day+t.day,c=hc.month+t.month,d=hc.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),K2[2]=mm(d)?29:28;a>K2[c]||c>=13;)a>K2[c]&&(a-=K2[c],++c),c>=13&&(--c,d+=Math.floor(c/12),c=c%12,++c),K2[2]=mm(d)?29:28;return hc.millisecond=i,hc.second=o,hc.minute=r,hc.hour=s,hc.day=a,hc.month=c,hc.year=d,q.fromGregorianDate(hc,n)}var zQe=new q,KQe=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function Kle(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(KQe);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"),q.toGregorianDate(q.fromIso8601(e,zQe),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var J2=new cp;wr.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=q.fromIso8601(n[0]),o=q.fromIso8601(n[1]),r=[];if(!Kle(n[2],J2))r.push(i,o);else{let s=q.clone(i);for(r.push(s);q.compare(s,o)<0;)s=uK(s,J2),q.compare(o,s)<=0&&q.clone(o,s),r.push(s)}return wr.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};wr.fromIso8601DateArray=function(e,t){return wr.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(n){return q.fromIso8601(n)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};wr.fromIso8601DurationArray=function(e,t){let n=e.epoch,i=e.iso8601Durations,o=y(e.relativeToPrevious,!1),r=[],s,a,c=i.length;for(let d=0;d<c;++d)(Kle(i[d],J2)||d===0)&&(o&&l(a)?s=uK(a,J2):s=uK(n,J2),r.push(s),a=s);return wr.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var Fr=wr;function JQe(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 v_(){this._eventHelper=new vr,this._definitionChanged=new be,this._intervals=new Fr,this._intervals.changedEvent.addEventListener(v_.prototype._intervalsChanged,this)}Object.defineProperties(v_.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var QQe=new q;v_.prototype.getValue=function(e,t){l(e)||(e=q.now(QQe));let n=this._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};v_.prototype.equals=function(e){return this===e||e instanceof v_&&this._intervals.equals(e._intervals,K.equals)};v_.prototype._intervalsChanged=function(){JQe(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var fc=v_;function Ig(){this._definitionChanged=new be,this._composite=new fc,this._composite.definitionChanged.addEventListener(Ig.prototype._raiseDefinitionChanged,this)}Object.defineProperties(Ig.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});Ig.prototype.getType=function(e){let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(t))return t.getType(e)};var jQe=new q;Ig.prototype.getValue=function(e,t){l(e)||(e=q.now(jQe));let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};Ig.prototype.equals=function(e){return this===e||e instanceof Ig&&this._composite.equals(e._composite,K.equals)};Ig.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var h1=Ig;var sBn=T(S(),1);function Wg(e){this._referenceFrame=y(e,$i.FIXED),this._definitionChanged=new be,this._composite=new fc,this._composite.definitionChanged.addEventListener(Wg.prototype._raiseDefinitionChanged,this)}Object.defineProperties(Wg.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}}});var qQe=new q;Wg.prototype.getValue=function(e,t){return l(e)||(e=q.now(qQe)),this.getValueInReferenceFrame(e,$i.FIXED,t)};Wg.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(i))return i.getValueInReferenceFrame(e,t,n)};Wg.prototype.equals=function(e){return this===e||e instanceof Wg&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,K.equals)};Wg.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var sa=Wg;var nOn=T(S(),1);var tYn=T(S(),1);var cBn=T(S(),1),$Qe={ROUNDED:0,MITERED:1,BEVELED:2},Gi=Object.freeze($Qe);var PBn=T(S(),1);var CBn=T(S(),1);var aa=[new h,new h],e4e=new h,t4e=new h,n4e=new h,i4e=new h,o4e=new h,r4e=new h,s4e=new h,a4e=new h,c4e=new h,f1=new h,$5=new h,Q2={},hK=new he;function l4e(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let o=e[i];hK=t.cartesianToCartographic(o,hK),n[i]=hK.height,e[i]=t.scaleToGeodeticSurface(o,o)}return n}function fK(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 ek=new h,tk=new h;function d4e(e,t,n,i){let o=new Br(n,i),r=o.projectPointOntoPlane(h.add(n,e,ek),ek),s=o.projectPointOntoPlane(h.add(n,t,tk),tk),a=D.angleBetween(r,s);return s.x*r.y-s.y*r.x>=0?-a:a}var u4e=new h(-1,0,0),w_=new F,m4e=new F,pK=new $,h4e=$.IDENTITY.clone(),f4e=new h,p4e=new se,Jle=new h;function T0(e,t,n,i,o,r,s,a){let c=f4e,d=p4e;w_=wt.eastNorthUpToFixedFrame(e,o,w_),c=F.multiplyByPointAsVector(w_,u4e,c),c=h.normalize(c,c);let u=d4e(c,t,e,o);pK=$.fromRotationZ(u,pK),Jle.z=r,w_=F.multiplyTransformation(w_,F.fromRotationTranslation(pK,Jle,m4e),w_);let m=h4e;m[0]=s;for(let p=0;p<a;p++)for(let g=0;g<n.length;g+=3)d=h.fromArray(n,g,d),d=$.multiplyByVector(m,d,d),d=F.multiplyByPoint(w_,d,d),i.push(d.x,d.y,d.z);return i}var b4e=new h;function bK(e,t,n,i,o,r,s){for(let a=0;a<e.length;a+=3){let c=h.fromArray(e,a,b4e);i=T0(c,t,n,i,o,r[a/3],s,1)}return i}function g4e(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 Qle(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 jle=new we,qle=new h,$le=new $;function ede(e,t,n,i,o,r,s,a,c,d){let u=h.angleBetween(h.subtract(t,e,f1),h.subtract(n,e,$5)),m=i===Gi.BEVELED?0:Math.ceil(u/W.toRadians(5)),p;o?p=$.fromQuaternion(we.fromAxisAngle(h.negate(e,f1),u/(m+1),jle),$le):p=$.fromQuaternion(we.fromAxisAngle(e,u/(m+1),jle),$le);let g,f;if(t=h.clone(t,qle),m>0){let x=d?2:1;for(let _=0;_<m;_++)t=$.multiplyByVector(p,t,t),g=h.subtract(t,e,f1),g=h.normalize(g,g),o||(g=h.negate(g,g)),f=r.scaleToGeodeticSurface(t,$5),s=T0(f,g,a,s,r,c,1,x)}else g=h.subtract(t,e,f1),g=h.normalize(g,g),o||(g=h.negate(g,g)),f=r.scaleToGeodeticSurface(t,$5),s=T0(f,g,a,s,r,c,1,1),n=h.clone(n,qle),g=h.subtract(n,e,f1),g=h.normalize(g,g),o||(g=h.negate(g,g)),f=r.scaleToGeodeticSurface(n,$5),s=T0(f,g,a,s,r,c,1,1);return s}Q2.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];D.equals(r,s)||n.push(s)}return n};Q2.angleIsGreaterThanPi=function(e,t,n,i){let o=new Br(n,i),r=o.projectPointOntoPlane(h.add(n,e,ek),ek),s=o.projectPointOntoPlane(h.add(n,t,tk),tk);return s.x*r.y-s.y*r.x>=0};var y4e=new h,x4e=new h;Q2.computePositions=function(e,t,n,i,o){let r=i._ellipsoid,s=l4e(e,r),a=i._granularity,c=i._cornerType,d=o?g4e(t,n):Qle(t,n),u=o?Qle(t,n):void 0,m=n.height/2,p=n.width/2,g=e.length,f=[],x=o?[]:void 0,_=e4e,C=t4e,V=n4e,L=i4e,Z=o4e,E=r4e,X=s4e,v=a4e,P=c4e,A=e[0],M=e[1];L=r.geodeticSurfaceNormal(A,L),_=h.subtract(M,A,_),_=h.normalize(_,_),v=h.cross(L,_,v),v=h.normalize(v,v);let b=s[0],R=s[1];o&&(x=T0(A,v,u,x,r,b+m,1,1)),P=h.clone(A,P),A=M,C=h.negate(_,C);let G,I;for(let B=1;B<g-1;B++){let U=o?2:1;if(M=e[B+1],A.equals(M)){Nt("Positions are too close and are considered equivalent with rounding error.");continue}_=h.subtract(M,A,_),_=h.normalize(_,_),V=h.add(_,C,V),V=h.normalize(V,V),L=r.geodeticSurfaceNormal(A,L);let O=h.multiplyByScalar(L,h.dot(_,L),y4e);h.subtract(_,O,O),h.normalize(O,O);let k=h.multiplyByScalar(L,h.dot(C,L),x4e);if(h.subtract(C,k,k),h.normalize(k,k),!W.equalsEpsilon(Math.abs(h.dot(O,k)),1,W.EPSILON7)){V=h.cross(V,L,V),V=h.cross(L,V,V),V=h.normalize(V,V);let H=1/Math.max(.25,h.magnitude(h.cross(V,C,f1))),te=Q2.angleIsGreaterThanPi(_,C,A,r);te?(Z=h.add(A,h.multiplyByScalar(V,H*p,V),Z),E=h.add(Z,h.multiplyByScalar(v,p,E),E),aa[0]=h.clone(P,aa[0]),aa[1]=h.clone(E,aa[1]),G=fK(aa,b+m,R+m,a),I=Zi.generateArc({positions:aa,granularity:a,ellipsoid:r}),f=bK(I,v,d,f,r,G,1),v=h.cross(L,_,v),v=h.normalize(v,v),X=h.add(Z,h.multiplyByScalar(v,p,X),X),c===Gi.ROUNDED||c===Gi.BEVELED?ede(Z,E,X,c,te,r,f,d,R+m,o):(V=h.negate(V,V),f=T0(A,V,d,f,r,R+m,H,U)),P=h.clone(X,P)):(Z=h.add(A,h.multiplyByScalar(V,H*p,V),Z),E=h.add(Z,h.multiplyByScalar(v,-p,E),E),aa[0]=h.clone(P,aa[0]),aa[1]=h.clone(E,aa[1]),G=fK(aa,b+m,R+m,a),I=Zi.generateArc({positions:aa,granularity:a,ellipsoid:r}),f=bK(I,v,d,f,r,G,1),v=h.cross(L,_,v),v=h.normalize(v,v),X=h.add(Z,h.multiplyByScalar(v,-p,X),X),c===Gi.ROUNDED||c===Gi.BEVELED?ede(Z,E,X,c,te,r,f,d,R+m,o):f=T0(A,V,d,f,r,R+m,H,U),P=h.clone(X,P)),C=h.negate(_,C)}else f=T0(P,v,d,f,r,b+m,1,1),P=A;b=R,R=s[B+1],A=M}aa[0]=h.clone(P,aa[0]),aa[1]=h.clone(A,aa[1]),G=fK(aa,b+m,R+m,a),I=Zi.generateArc({positions:aa,granularity:a,ellipsoid:r}),f=bK(I,v,d,f,r,G,1),o&&(x=T0(A,v,u,x,r,R+m,1,1)),g=f.length;let w=o?g+x.length:g,N=new Float64Array(w);return N.set(f),o&&N.set(x,g),N};var Qm=Q2;var yK={},p1=new h,rde=new h,_4e=new h,tde=new h,zc=[new h,new h],sde=new h,ade=new h,cde=new h,T4e=new h,S4e=new h,C4e=new h,V4e=new h,L4e=new h,R4e=new h,Z4e=new h,nde=new we,ide=new $;function nk(e,t,n,i,o){let r=h.angleBetween(h.subtract(t,e,p1),h.subtract(n,e,rde)),s=i===Gi.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=$.fromQuaternion(we.fromAxisAngle(h.negate(e,p1),r/s,nde),ide):d=$.fromQuaternion(we.fromAxisAngle(e,r/s,nde),ide);let u=0;t=h.clone(t,p1);for(let m=0;m<s;m++)t=$.multiplyByVector(d,t,t),c[u++]=t.x,c[u++]=t.y,c[u++]=t.z;return c}function G4e(e){let t=sde,n=ade,i=cde,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=nk(t,n,i,Gi.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=nk(t,n,i,Gi.ROUNDED,!1);return[r,c]}function ode(e,t,n,i){let o=p1;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 gK(e,t,n,i){let o=new Array(e.length),r=new Array(e.length),s=h.multiplyByScalar(t,n,p1),a=h.negate(s,rde),c=0,d=e.length-1;for(let u=0;u<e.length;u+=3){let m=h.fromArray(e,u,_4e),p=h.add(m,a,tde);o[c++]=p.x,o[c++]=p.y,o[c++]=p.z;let g=h.add(m,s,tde);r[d--]=g.z,r[d--]=g.y,r[d--]=g.x}return i.push(o,r),i}yK.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 E4e=new h,X4e=new h;yK.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,o=e.width/2,r=e.cornerType,s=e.saveAttributes,a=sde,c=ade,d=cde,u=T4e,m=S4e,p=C4e,g=V4e,f=L4e,x=R4e,_=Z4e,C=[],V=s?[]:void 0,L=s?[]:void 0,Z=n[0],E=n[1];c=h.normalize(h.subtract(E,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)),g=h.clone(Z,g),Z=E,d=h.negate(c,d);let X,v=[],P,A=n.length;for(P=1;P<A-1;P++){a=i.geodeticSurfaceNormal(Z,a),E=n[P+1],c=h.normalize(h.subtract(E,Z,c),c),m=h.normalize(h.add(c,d,m),m);let b=h.multiplyByScalar(a,h.dot(c,a),E4e);h.subtract(c,b,b),h.normalize(b,b);let R=h.multiplyByScalar(a,h.dot(d,a),X4e);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 I=o/Math.max(.25,h.magnitude(h.cross(m,d,p1))),w=Qm.angleIsGreaterThanPi(c,d,Z,i);m=h.multiplyByScalar(m,I,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),zc[0]=h.clone(g,zc[0]),zc[1]=h.clone(_,zc[1]),X=Zi.generateArc({positions:zc,granularity:t,ellipsoid:i}),C=gK(X,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),g=h.add(f,h.multiplyByScalar(u,o,g),g),r===Gi.ROUNDED||r===Gi.BEVELED?v.push({leftPositions:nk(f,p,x,r,w)}):v.push({leftPositions:ode(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),zc[0]=h.clone(g,zc[0]),zc[1]=h.clone(_,zc[1]),X=Zi.generateArc({positions:zc,granularity:t,ellipsoid:i}),C=gK(X,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),g=h.add(x,h.negate(h.multiplyByScalar(u,o,g),g),g),r===Gi.ROUNDED||r===Gi.BEVELED?v.push({rightPositions:nk(x,p,f,r,w)}):v.push({rightPositions:ode(Z,m,f,w)})),d=h.negate(c,d)}Z=E}a=i.geodeticSurfaceNormal(Z,a),zc[0]=h.clone(g,zc[0]),zc[1]=h.clone(Z,zc[1]),X=Zi.generateArc({positions:zc,granularity:t,ellipsoid:i}),C=gK(X,u,o,C),s&&(V.push(u.x,u.y,u.z),L.push(a.x,a.y,a.z));let M;return r===Gi.ROUNDED&&(M=G4e(C)),{positions:C,corners:v,lefts:V,normals:L,endPositions:M}};var Ai=yK;var ude=new h,mde=new h,ik=new h,ok=new h,I4e=new h,hde=new h,Pg=new h,b1=new h;function fde(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function jm(e,t,n,i,o,r){let s=e.normals,a=e.tangents,c=e.bitangents,d=h.normalize(h.cross(n,t,Pg),Pg);r.normal&&Ai.addAttribute(s,t,i,o),r.tangent&&Ai.addAttribute(a,d,i,o),r.bitangent&&Ai.addAttribute(c,n,i,o)}function pde(e,t,n){let i=e.positions,o=e.corners,r=e.endPositions,s=e.lefts,a=e.normals,c=new mn,d,u=0,m=0,p,g=0,f;for(p=0;p<i.length;p+=2)f=i[p].length-3,u+=f,g+=f*2,m+=i[p+1].length-3;for(u+=3,m+=3,p=0;p<o.length;p++){d=o[p];let ee=o[p].leftPositions;l(ee)?(f=ee.length,u+=f,g+=f):(f=o[p].rightPositions.length,m+=f,g+=f)}let x=l(r),_;x&&(_=r[0].length-3,u+=_,m+=_,_/=3,g+=_*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,E=t.bitangent?new Float32Array(C):void 0,X={normals:L,tangents:Z,bitangents:E},v=0,P=C-1,A,M,b,R,G=ude,I=mde,w,N,B=_/2,U=Ae.createTypedArray(C/3,g),O=0;if(x){N=ik,w=ok;let ee=r[0];for(G=h.fromArray(a,0,G),I=h.fromArray(s,0,I),p=0;p<B;p++)N=h.fromArray(ee,(B-1-p)*3,N),w=h.fromArray(ee,(B+p)*3,w),Ai.addAttribute(V,w,v),Ai.addAttribute(V,N,void 0,P),jm(X,G,I,v,P,t),M=v/3,R=M+1,A=(P-2)/3,b=A-1,U[O++]=A,U[O++]=M,U[O++]=b,U[O++]=b,U[O++]=M,U[O++]=R,v+=3,P-=3}let k=0,J=0,H=i[k++],te=i[k++];V.set(H,v),V.set(te,P-te.length+1),I=h.fromArray(s,J,I);let z,j;for(f=te.length-3,p=0;p<f;p+=3)z=n.geodeticSurfaceNormal(h.fromArray(H,p,Pg),Pg),j=n.geodeticSurfaceNormal(h.fromArray(te,f-p,b1),b1),G=h.normalize(h.add(z,j,G),G),jm(X,G,I,v,P,t),M=v/3,R=M+1,A=(P-2)/3,b=A-1,U[O++]=A,U[O++]=M,U[O++]=b,U[O++]=b,U[O++]=M,U[O++]=R,v+=3,P-=3;for(z=n.geodeticSurfaceNormal(h.fromArray(H,f,Pg),Pg),j=n.geodeticSurfaceNormal(h.fromArray(te,f,b1),b1),G=h.normalize(h.add(z,j,G),G),J+=3,p=0;p<o.length;p++){let ee;d=o[p];let fe=d.leftPositions,_e=d.rightPositions,le,ge,Se=hde,Ie=ik,Le=ok;if(G=h.fromArray(a,J,G),l(fe)){for(jm(X,G,I,void 0,P,t),P-=3,le=R,ge=b,ee=0;ee<fe.length/3;ee++)Se=h.fromArray(fe,ee*3,Se),U[O++]=le,U[O++]=ge-ee-1,U[O++]=ge-ee,Ai.addAttribute(V,Se,void 0,P),Ie=h.fromArray(V,(ge-ee-1)*3,Ie),Le=h.fromArray(V,le*3,Le),I=h.normalize(h.subtract(Ie,Le,I),I),jm(X,G,I,void 0,P,t),P-=3;Se=h.fromArray(V,le*3,Se),Ie=h.subtract(h.fromArray(V,ge*3,Ie),Se,Ie),Le=h.subtract(h.fromArray(V,(ge-ee)*3,Le),Se,Le),I=h.normalize(h.add(Ie,Le,I),I),jm(X,G,I,v,void 0,t),v+=3}else{for(jm(X,G,I,v,void 0,t),v+=3,le=b,ge=R,ee=0;ee<_e.length/3;ee++)Se=h.fromArray(_e,ee*3,Se),U[O++]=le,U[O++]=ge+ee,U[O++]=ge+ee+1,Ai.addAttribute(V,Se,v),Ie=h.fromArray(V,le*3,Ie),Le=h.fromArray(V,(ge+ee)*3,Le),I=h.normalize(h.subtract(Ie,Le,I),I),jm(X,G,I,v,void 0,t),v+=3;Se=h.fromArray(V,le*3,Se),Ie=h.subtract(h.fromArray(V,(ge+ee)*3,Ie),Se,Ie),Le=h.subtract(h.fromArray(V,ge*3,Le),Se,Le),I=h.normalize(h.negate(h.add(Le,Ie,I),I),I),jm(X,G,I,void 0,P,t),P-=3}for(H=i[k++],te=i[k++],H.splice(0,3),te.splice(te.length-3,3),V.set(H,v),V.set(te,P-te.length+1),f=te.length-3,J+=3,I=h.fromArray(s,J,I),ee=0;ee<te.length;ee+=3)z=n.geodeticSurfaceNormal(h.fromArray(H,ee,Pg),Pg),j=n.geodeticSurfaceNormal(h.fromArray(te,f-ee,b1),b1),G=h.normalize(h.add(z,j,G),G),jm(X,G,I,v,P,t),R=v/3,M=R-1,b=(P-2)/3,A=b+1,U[O++]=A,U[O++]=M,U[O++]=b,U[O++]=b,U[O++]=M,U[O++]=R,v+=3,P-=3;v-=3,P+=3}if(G=h.fromArray(a,a.length-3,G),jm(X,G,I,v,P,t),x){v+=3,P-=3,N=ik,w=ok;let ee=r[1];for(p=0;p<B;p++)N=h.fromArray(ee,(_-p-1)*3,N),w=h.fromArray(ee,p*3,w),Ai.addAttribute(V,N,void 0,P),Ai.addAttribute(V,w,v),jm(X,G,I,v,P,t),R=v/3,M=R-1,b=(P-2)/3,A=b+1,U[O++]=A,U[O++]=M,U[O++]=b,U[O++]=b,U[O++]=M,U[O++]=R,v+=3,P-=3}if(c.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:V}),t.st){let ee=new Float32Array(C/3*2),fe,_e,le=0;if(x){u/=3,m/=3;let ge=Math.PI/(_+1);_e=1/(u-_+1),fe=1/(m-_+1);let Se,Ie=_/2;for(p=Ie+1;p<_+1;p++)Se=W.PI_OVER_TWO+ge*p,ee[le++]=fe*(1+Math.cos(Se)),ee[le++]=.5*(1+Math.sin(Se));for(p=1;p<m-_+1;p++)ee[le++]=p*fe,ee[le++]=0;for(p=_;p>Ie;p--)Se=W.PI_OVER_TWO-p*ge,ee[le++]=1-fe*(1+Math.cos(Se)),ee[le++]=.5*(1+Math.sin(Se));for(p=Ie;p>0;p--)Se=W.PI_OVER_TWO-ge*p,ee[le++]=1-_e*(1+Math.cos(Se)),ee[le++]=.5*(1+Math.sin(Se));for(p=u-_;p>0;p--)ee[le++]=p*_e,ee[le++]=1;for(p=1;p<Ie+1;p++)Se=W.PI_OVER_TWO+ge*p,ee[le++]=_e*(1+Math.cos(Se)),ee[le++]=.5*(1+Math.sin(Se))}else{for(u/=3,m/=3,_e=1/(u-1),fe=1/(m-1),p=0;p<m;p++)ee[le++]=p*fe,ee[le++]=0;for(p=u;p>0;p--)ee[le++]=(p-1)*_e,ee[le++]=1}c.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:ee})}return t.normal&&(c.normal=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:X.normals})),t.tangent&&(c.tangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:X.tangents})),t.bitangent&&(c.bitangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:X.bitangents})),{attributes:c,indices:U}}function W4e(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,g=ude,f=mde,x=ik,_=ok,C=I4e,V=hde,L=c;for(d=0;d<s;d+=3){let Z=L+c;g=h.fromArray(n,d,g),f=h.fromArray(n,d+s,f),x=h.fromArray(n,(d+3)%s,x),f=h.subtract(f,g,f),x=h.subtract(x,g,x),_=h.normalize(h.cross(f,x,_),_),t.normal&&(Ai.addAttribute(u,_,Z),Ai.addAttribute(u,_,Z+3),Ai.addAttribute(u,_,L),Ai.addAttribute(u,_,L+3)),(t.tangent||t.bitangent)&&(V=h.fromArray(i,d,V),t.bitangent&&(Ai.addAttribute(p,V,Z),Ai.addAttribute(p,V,Z+3),Ai.addAttribute(p,V,L),Ai.addAttribute(p,V,L+3)),t.tangent&&(C=h.normalize(h.cross(V,_,C),C),Ai.addAttribute(m,C,Z),Ai.addAttribute(m,C,Z+3),Ai.addAttribute(m,C,L),Ai.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 g=0;g<2;g++){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 xK(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 P4e(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=Ai.computePositions(e),r=pde(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),g=new Float64Array(m);g.set(u);let f=new Float64Array(m*4);u=ri.scaleToGeodeticHeight(u,s,i),f=xK(u,0,f),g=ri.scaleToGeodeticHeight(g,a,i),f=xK(g,m*2,f),p.set(u),p.set(g,m),p.set(f,m*2),c.position.values=p,c=W4e(c,t);let x,_=m/3;if(e.shadowVolume){let A=c.normal.values;m=A.length;let M=new Float32Array(m*6);for(x=0;x<m;x++)A[x]=-A[x];M.set(A,m),M=xK(A,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 A=new Uint8Array(_*6);if(e.offsetAttribute===ln.TOP)A=A.fill(1,0,_).fill(1,_*2,_*4);else{let M=e.offsetAttribute===ln.NONE?0:1;A=A.fill(M)}c.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}let C=d.length,V=_+_,L=Ae.createTypedArray(p.length/3,C*2+V*3);L.set(d);let Z=C;for(x=0;x<C;x+=3){let A=d[x],M=d[x+1],b=d[x+2];L[Z++]=b+_,L[Z++]=M+_,L[Z++]=A+_}let E,X,v,P;for(x=0;x<V;x+=2)E=x+V,X=E+V,v=E+1,P=X+1,L[Z++]=E,L[Z++]=X,L[Z++]=v,L[Z++]=v,L[Z++]=X,L[Z++]=P;return{attributes:c,indices:L}}var lde=new h,j2=new h,Mu=new he;function dde(e,t,n,i,o,r){let s=h.subtract(t,e,lde);h.normalize(s,s);let a=n.geodeticSurfaceNormal(e,j2),c=h.cross(s,a,lde);h.multiplyByScalar(c,i,c);let d=o.latitude,u=o.longitude,m=r.latitude,p=r.longitude;h.add(e,c,j2),n.cartesianToCartographic(j2,Mu);let g=Mu.latitude,f=Mu.longitude;d=Math.min(d,g),u=Math.min(u,f),m=Math.max(m,g),p=Math.max(p,f),h.subtract(e,c,j2),n.cartesianToCartographic(j2,Mu),g=Mu.latitude,f=Mu.longitude,d=Math.min(d,g),u=Math.min(u,f),m=Math.max(m,g),p=Math.max(p,f),o.latitude=d,o.longitude=u,r.latitude=m,r.longitude=p}var Au=new h,q2=new h,wl=new he,Fl=new he;function bde(e,t,n,i,o){e=fde(e,t);let r=xo(e,h.equalsEpsilon),s=r.length;if(s<2||n<=0)return new ae;let a=n*.5;wl.latitude=Number.POSITIVE_INFINITY,wl.longitude=Number.POSITIVE_INFINITY,Fl.latitude=Number.NEGATIVE_INFINITY,Fl.longitude=Number.NEGATIVE_INFINITY;let c,d;if(i===Gi.ROUNDED){let p=r[0];h.subtract(p,r[1],Au),h.normalize(Au,Au),h.multiplyByScalar(Au,a,Au),h.add(p,Au,q2),t.cartesianToCartographic(q2,Mu),c=Mu.latitude,d=Mu.longitude,wl.latitude=Math.min(wl.latitude,c),wl.longitude=Math.min(wl.longitude,d),Fl.latitude=Math.max(Fl.latitude,c),Fl.longitude=Math.max(Fl.longitude,d)}for(let p=0;p<s-1;++p)dde(r[p],r[p+1],t,a,wl,Fl);let u=r[s-1];h.subtract(u,r[s-2],Au),h.normalize(Au,Au),h.multiplyByScalar(Au,a,Au),h.add(u,Au,q2),dde(u,q2,t,a,wl,Fl),i===Gi.ROUNDED&&(t.cartesianToCartographic(q2,Mu),c=Mu.latitude,d=Mu.longitude,wl.latitude=Math.min(wl.latitude,c),wl.longitude=Math.min(wl.longitude,d),Fl.latitude=Math.max(Fl.latitude,c),Fl.longitude=Math.max(Fl.longitude,d));let m=l(o)?o:new ae;return m.north=Fl.latitude,m.south=wl.latitude,m.east=Fl.longitude,m.west=wl.longitude,m}function C0(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.width,i=y(e.height,0),o=y(e.extrudedHeight,i);this._positions=t,this._ellipsoid=ne.clone(y(e.ellipsoid,ne.default)),this._vertexFormat=Pe.clone(y(e.vertexFormat,Pe.DEFAULT)),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=y(e.cornerType,Gi.ROUNDED),this._granularity=y(e.granularity,W.RADIANS_PER_DEGREE),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*h.packedLength+ne.packedLength+Pe.packedLength+7}C0.pack=function(e,t,n){n=y(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 ne.pack(e._ellipsoid,t,n),n+=ne.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]=y(e._offsetAttribute,-1),t};var gde=ne.clone(ne.UNIT_SPHERE),yde=new Pe,S0={positions:void 0,ellipsoid:gde,vertexFormat:yde,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};C0.unpack=function(e,t,n){t=y(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=ne.unpack(e,t,gde);t+=ne.packedLength;let s=Pe.unpack(e,t,yde);t+=Pe.packedLength;let a=e[t++],c=e[t++],d=e[t++],u=e[t++],m=e[t++],p=e[t++]===1,g=e[t];return l(n)?(n._positions=o,n._ellipsoid=ne.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=g===-1?void 0:g,n):(S0.positions=o,S0.width=a,S0.height=c,S0.extrudedHeight=d,S0.cornerType=u,S0.granularity=m,S0.shadowVolume=p,S0.offsetAttribute=g===-1?void 0:g,new C0(S0))};C0.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.positions,i=e.width,o=y(e.ellipsoid,ne.default),r=y(e.cornerType,Gi.ROUNDED);return bde(n,o,i,r,t)};C0.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=fde(t,i);let o=xo(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=P4e(d,c);else{let g=Ai.computePositions(d);if(u=pde(g,c,i),u.attributes.position.values=ri.scaleToGeodeticHeight(u.attributes.position.values,r,i),l(e._offsetAttribute)){let f=e._offsetAttribute===ln.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 ht({attributes:m,indices:u.indices,primitiveType:Fe.TRIANGLES,boundingSphere:p,offsetAttribute:e._offsetAttribute})};C0.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new C0({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(C0.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=bde(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var F_=C0;var _Yn=T(S(),1);var xde=new h,_de=new h,v4e=new h;function w4e(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function Tde(e,t){let n=[],i=e.positions,o=e.corners,r=e.endPositions,s=new mn,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 g=l(r),f;g&&(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,E,X,v,P,A=f/2,M=Ae.createTypedArray(x/3,m+4),b=0;if(M[b++]=C/3,M[b++]=(V-2)/3,g){n.push(C/3),P=xde,v=_de;let w=r[0];for(u=0;u<A;u++)P=h.fromArray(w,(A-1-u)*3,P),v=h.fromArray(w,(A+u)*3,v),Ai.addAttribute(_,v,C),Ai.addAttribute(_,P,void 0,V),Z=C/3,X=Z+1,L=(V-2)/3,E=L-1,M[b++]=L,M[b++]=E,M[b++]=Z,M[b++]=X,C+=3,V-=3}let R=0,G=i[R++],I=i[R++];for(_.set(G,C),_.set(I,V-I.length+1),p=I.length-3,n.push(C/3,(V-2)/3),u=0;u<p;u+=3)Z=C/3,X=Z+1,L=(V-2)/3,E=L-1,M[b++]=L,M[b++]=E,M[b++]=Z,M[b++]=X,C+=3,V-=3;for(u=0;u<o.length;u++){let w;a=o[u];let N=a.leftPositions,B=a.rightPositions,U,O=v4e;if(l(N)){for(V-=3,U=E,n.push(X),w=0;w<N.length/3;w++)O=h.fromArray(N,w*3,O),M[b++]=U-w-1,M[b++]=U-w,Ai.addAttribute(_,O,void 0,V),V-=3;n.push(U-Math.floor(N.length/6)),t===Gi.BEVELED&&n.push((V-2)/3+1),C+=3}else{for(C+=3,U=X,n.push(E),w=0;w<B.length/3;w++)O=h.fromArray(B,w*3,O),M[b++]=U+w,M[b++]=U+w+1,Ai.addAttribute(_,O,C),C+=3;n.push(U+Math.floor(B.length/6)),t===Gi.BEVELED&&n.push(C/3-1),V-=3}for(G=i[R++],I=i[R++],G.splice(0,3),I.splice(I.length-3,3),_.set(G,C),_.set(I,V-I.length+1),p=I.length-3,w=0;w<I.length;w+=3)X=C/3,Z=X-1,E=(V-2)/3,L=E+1,M[b++]=L,M[b++]=E,M[b++]=Z,M[b++]=X,C+=3,V-=3;C-=3,V+=3,n.push(C/3,(V-2)/3)}if(g){C+=3,V-=3,P=xde,v=_de;let w=r[1];for(u=0;u<A;u++)P=h.fromArray(w,(f-u-1)*3,P),v=h.fromArray(w,u*3,v),Ai.addAttribute(_,P,void 0,V),Ai.addAttribute(_,v,C),X=C/3,Z=X-1,E=(V-2)/3,L=E+1,M[b++]=L,M[b++]=E,M[b++]=Z,M[b++]=X,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 F4e(e){let t=e.ellipsoid,n=Ai.computePositions(e),i=Tde(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=ri.scaleToGeodeticHeight(d,r,t),m=ri.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===ln.TOP)L=L.fill(1,0,u);else{let Z=e.offsetAttribute===ln.NONE?0:1;L=L.fill(Z)}a.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:L})}let g,f=c.length,x=Ae.createTypedArray(p.length/3,(f+o.length)*2);x.set(c);let _=f;for(g=0;g<f;g+=2){let L=c[g],Z=c[g+1];x[_++]=L+u,x[_++]=Z+u}let C,V;for(g=0;g<o.length;g++)C=o[g],V=C+u,x[_++]=C,x[_++]=V;return{attributes:a,indices:x}}function $2(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.width,i=y(e.height,0),o=y(e.extrudedHeight,i);this._positions=t,this._ellipsoid=ne.clone(y(e.ellipsoid,ne.default)),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=y(e.cornerType,Gi.ROUNDED),this._granularity=y(e.granularity,W.RADIANS_PER_DEGREE),this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*h.packedLength+ne.packedLength+6}$2.pack=function(e,t,n){n=y(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 ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n]=y(e._offsetAttribute,-1),t};var Sde=ne.clone(ne.UNIT_SPHERE),vg={positions:void 0,ellipsoid:Sde,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};$2.unpack=function(e,t,n){t=y(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=ne.unpack(e,t,Sde);t+=ne.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=ne.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):(vg.positions=o,vg.width=s,vg.height=a,vg.extrudedHeight=c,vg.cornerType=d,vg.granularity=u,vg.offsetAttribute=m===-1?void 0:m,new $2(vg))};$2.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=w4e(t,i);let o=xo(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=F4e(c);else{let p=Ai.computePositions(c);if(d=Tde(p,c.cornerType),d.attributes.position.values=ri.scaleToGeodeticHeight(d.attributes.position.values,r,i),l(e._offsetAttribute)){let g=d.attributes.position.values.length,f=e._offsetAttribute===ln.NONE?0:1,x=new Uint8Array(g/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 ht({attributes:u,indices:d.indices,primitiveType:Fe.LINES,boundingSphere:m,offsetAttribute:e._offsetAttribute})};var eP=$2;var PYn=T(S(),1);var A4e=new Jn(0);function Kc(e){ni.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}l(Object.create)&&(Kc.prototype=Object.create(ni.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)&&Fc.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=pe.throwInstantiationError;Kc.prototype._onEntityPropertyChanged=function(e,t,n,i){if(ni.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))&&Nt(Nt.geometryZIndex),this._zIndex=y(o.zIndex,A4e),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 Zm(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new vx(this._scene,a,r,s)}};Kc.prototype.destroy=function(){l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),ni.prototype.destroy.call(this)};Kc.getGeometryHeight=function(e,t){if(!l(e)){t!==Qe.NONE&&Nt(Nt.geometryHeightReference);return}return du(t)?0:e};Kc.getGeometryExtrudedHeight=function(e,t){if(!l(e)){t!==Qe.NONE&&Nt(Nt.geometryExtrudedHeightReference);return}return du(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 ln.ALL;if(o===1)return ln.TOP};var On=Kc;var Cde=new Y,Vde=h.ZERO,Lde=new h,Rde=new ae;function M4e(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 qm(e,t){On.call(this,{entity:e,scene:t,geometryOptions:new M4e(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}l(Object.create)&&(qm.prototype=Object.create(On.prototype),qm.prototype.constructor=qm);qm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Nn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Yt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,Cde)),l(o)||(o=Y.WHITE),i.color=Ht.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=zi.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,Vde,Lde))),new Vt({id:t,geometry:new F_(this._options),attributes:i})};qm.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=K.getValueOrDefault(this._outlineColorProperty,e,Y.BLACK,Cde),o={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ht.fromColor(i),distanceDisplayCondition:Nn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=zi.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,Vde,Lde))),new Vt({id:t,geometry:new eP(this._options),attributes:o})};qm.prototype._computeCenter=function(e,t){let n=K.getValueOrUndefined(this._entity.corridor.positions,e);if(!(!l(n)||n.length===0))return h.clone(n[Math.floor(n.length/2)],t)};qm.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.width)||ni.prototype._isHidden.call(this,e,t)};qm.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!K.isConstant(t.height)||!K.isConstant(t.extrudedHeight)||!K.isConstant(t.granularity)||!K.isConstant(t.width)||!K.isConstant(t.outlineWidth)||!K.isConstant(t.cornerType)||!K.isConstant(t.zIndex)||this._onTerrain&&!K.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Yt)};qm.prototype._setStaticOptions=function(e,t){let n=K.getValueOrUndefined(t.height,De.MINIMUM_VALUE),i=K.getValueOrDefault(t.heightReference,De.MINIMUM_VALUE,Qe.NONE),o=K.getValueOrUndefined(t.extrudedHeight,De.MINIMUM_VALUE),r=K.getValueOrDefault(t.extrudedHeightReference,De.MINIMUM_VALUE,Qe.NONE);l(o)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Yt?dn.VERTEX_FORMAT:oo.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(De.MINIMUM_VALUE,s.positions),s.width=t.width.getValue(De.MINIMUM_VALUE),s.granularity=K.getValueOrUndefined(t.granularity,De.MINIMUM_VALUE),s.cornerType=K.getValueOrUndefined(t.cornerType,De.MINIMUM_VALUE),s.offsetAttribute=On.computeGeometryOffsetAttribute(n,i,o,r),s.height=On.getGeometryHeight(n,i),o=On.getGeometryExtrudedHeight(o,r),o===On.CLAMP_TO_GROUND&&(o=ai.getMinimumMaximumHeights(F_.computeRectangle(s,Rde)).minimumTerrainHeight),s.extrudedHeight=o};qm.DynamicGeometryUpdater=g1;function g1(e,t,n){ti.call(this,e,t,n)}l(Object.create)&&(g1.prototype=Object.create(ti.prototype),g1.prototype.constructor=g1);g1.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.positions)||!l(i.width)||ti.prototype._isHidden.call(this,e,t,n)};g1.prototype._setOptions=function(e,t,n){let i=this._options,o=K.getValueOrUndefined(t.height,n),r=K.getValueOrDefault(t.heightReference,n,Qe.NONE),s=K.getValueOrUndefined(t.extrudedHeight,n),a=K.getValueOrDefault(t.extrudedHeightReference,n,Qe.NONE);l(s)&&!l(o)&&(o=0),i.positions=K.getValueOrUndefined(t.positions,n),i.width=K.getValueOrUndefined(t.width,n),i.granularity=K.getValueOrUndefined(t.granularity,n),i.cornerType=K.getValueOrUndefined(t.cornerType,n),i.offsetAttribute=On.computeGeometryOffsetAttribute(o,r,s,a),i.height=On.getGeometryHeight(o,r),s=On.getGeometryExtrudedHeight(s,a),s===On.CLAMP_TO_GROUND&&(s=ai.getMinimumMaximumHeights(F_.computeRectangle(i,Rde)).minimumTerrainHeight),i.extrudedHeight=s};var tP=qm;var IHn=T(S(),1);var rOn=T(S(),1);function rk(){pe.throwInstantiationError()}Object.defineProperties(rk.prototype,{name:{get:pe.throwInstantiationError},clock:{get:pe.throwInstantiationError},entities:{get:pe.throwInstantiationError},isLoading:{get:pe.throwInstantiationError},changedEvent:{get:pe.throwInstantiationError},errorEvent:{get:pe.throwInstantiationError},loadingEvent:{get:pe.throwInstantiationError},show:{get:pe.throwInstantiationError},clustering:{get:pe.throwInstantiationError}});rk.prototype.update=function(e){pe.throwInstantiationError()};rk.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var Ar=rk;var LHn=T(S(),1);var hOn=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 Zde=new h;bf.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,Zde);return TK(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};bf.prototype.isScaledSpacePointVisible=function(e){return TK(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var N4e=new h;bf.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,o;return l(t)&&t<0&&n.minimumRadius>-t?(o=N4e,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),TK(e,o,i)};bf.prototype.computeHorizonCullingPoint=function(e,t,n){return Xde(this._ellipsoid,e,t,n)};var Gde=ne.clone(ne.UNIT_SPHERE);bf.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let o=Ede(this._ellipsoid,n,Gde);return Xde(o,e,t,i)};bf.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,o){return Ide(this._ellipsoid,e,t,n,i,o)};bf.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,o,r){let s=Ede(this._ellipsoid,o,Gde);return Ide(s,e,t,n,i,r)};var k4e=[];bf.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=ae.subsample(e,t,0,k4e),o=ce.fromPoints(i);if(!(h.magnitude(o.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(o.center,i,n)};var U4e=new h;function Ede(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,U4e);e=ne.fromCartesian3(i,n)}return e}function Xde(e,t,n,i){l(i)||(i=new h);let o=vde(e,t),r=0;for(let s=0,a=n.length;s<a;++s){let c=n[s],d=Wde(e,c,o);if(d<0)return;r=Math.max(r,d)}return Pde(o,r,i)}var sk=new h;function Ide(e,t,n,i,o,r){l(r)||(r=new h),i=y(i,3),o=y(o,h.ZERO);let s=vde(e,t),a=0;for(let c=0,d=n.length;c<d;c+=i){sk.x=n[c]+o.x,sk.y=n[c+1]+o.y,sk.z=n[c+2]+o.z;let u=Wde(e,sk,s);if(u<0)return;a=Math.max(a,u)}return Pde(s,a,r)}function TK(e,t,n){let i=t,o=n,r=h.subtract(e,i,Zde),s=-h.dot(r,i);return!(o<0?s>0:s>o&&s*s/h.magnitudeSquared(r)>o)}var D4e=new h,B4e=new h;function Wde(e,t,n){let i=e.transformPositionToScaledSpace(t,D4e),o=h.magnitudeSquared(i),r=Math.sqrt(o),s=h.divideByScalar(i,r,B4e);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 Pde(e,t,n){if(!(t<=0||t===1/0||t!==t))return h.multiplyByScalar(e,t,n)}var _K=new h;function vde(e,t){return h.equals(t,h.ZERO)?t:(e.transformPositionToScaledSpace(t,_K),h.normalize(_K,_K))}var V0=bf;var GOn=T(S(),1);function xr(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=kt.clone(n)),l(i)&&(i=kt.clone(i)),l(o)&&(o=Pt.clone(o)),this._show=y(e.show,!0),this._position=h.clone(y(e.position,h.ZERO)),this._actualPosition=h.clone(this._position),this._color=Y.clone(y(e.color,Y.WHITE)),this._outlineColor=Y.clone(y(e.outlineColor,Y.TRANSPARENT)),this._outlineWidth=y(e.outlineWidth,0),this._pixelSize=y(e.pixelSize,10),this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=o,this._disableDepthTestDistance=y(e.disableDepthTestDistance,0),this._id=e.id,this._collection=y(e.collection,t),this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1,this._splitDirection=y(e.splitDirection,Gr.NONE)}var wde=xr.SHOW_INDEX=0,Mde=xr.POSITION_INDEX=1,Y4e=xr.COLOR_INDEX=2,O4e=xr.OUTLINE_COLOR_INDEX=3,H4e=xr.OUTLINE_WIDTH_INDEX=4,z4e=xr.PIXEL_SIZE_INDEX=5,K4e=xr.SCALE_BY_DISTANCE_INDEX=6,J4e=xr.TRANSLUCENCY_BY_DISTANCE_INDEX=7,Q4e=xr.DISTANCE_DISPLAY_CONDITION_INDEX=8,j4e=xr.DISABLE_DEPTH_DISTANCE_INDEX=9,q4e=xr.SPLIT_DIRECTION_INDEX=10;xr.NUMBER_OF_PROPERTIES=11;function Sd(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(xr.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Sd(this,wde))}},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),Sd(this,Mde))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;kt.equals(t,e)||(this._scaleByDistance=kt.clone(e,t),Sd(this,K4e))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;kt.equals(t,e)||(this._translucencyByDistance=kt.clone(e,t),Sd(this,J4e))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,Sd(this,z4e))}},color:{get:function(){return this._color},set:function(e){let t=this._color;Y.equals(t,e)||(Y.clone(e,t),Sd(this,Y4e))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;Y.equals(t,e)||(Y.clone(e,t),Sd(this,O4e))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Sd(this,H4e))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Pt.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=Pt.clone(e,this._distanceDisplayCondition),Sd(this,Q4e))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Sd(this,j4e))}},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,Sd(this,wde))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Sd(this,q4e))}}});xr.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};xr.prototype._getActualPosition=function(){return this._actualPosition};xr.prototype._setActualPosition=function(e){h.clone(e,this._actualPosition),Sd(this,Mde)};var Fde=new se;xr._computeActualPosition=function(e,t,n){return t.mode===oe.SCENE3D?e:(F.multiplyByPoint(n,e,Fde),Yi.computeActualEllipsoidPosition(t,Fde))};var Ade=new se;xr._computeScreenSpacePosition=function(e,t,n,i){let o=F.multiplyByVector(e,se.fromElements(t.x,t.y,t.z,1,Ade),Ade);return Yi.worldToWindowCoordinates(n,o,i)};xr.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new D);let i=n.modelMatrix,o=xr._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(o))return o.y=e.canvas.clientHeight-o.y,o};xr.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 Ke),n.x=r,n.y=s,n.width=a,n.height=c,n};xr.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&h.equals(this._position,e._position)&&Y.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&Y.equals(this._outlineColor,e._outlineColor)&&kt.equals(this._scaleByDistance,e._scaleByDistance)&&kt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Pt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};xr.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var _s=xr;var rHn=T(S(),1);var XOn=T(S(),1),wg=`in vec4 v_color;
in vec4 v_outlineColor;
in float v_innerPercent;
in float v_pixelDistance;
in vec4 v_pickColor;
in float v_splitDirection;

void main()
{
    if (v_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;
    if (v_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;

    // 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 WOn=T(S(),1),nP=`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 vec4 distanceDisplayConditionAndDisableDepthAndSplitDirection;    // near, far, disableDepthTestDistance, splitDirection

out vec4 v_color;
out vec4 v_outlineColor;
out float v_innerPercent;
out float v_pixelDistance;
out vec4 v_pickColor;
out float v_splitDirection;

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 = distanceDisplayConditionAndDisableDepthAndSplitDirection.x;
    float farSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.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 = distanceDisplayConditionAndDisableDepthAndSplitDirection.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;
    v_splitDirection = distanceDisplayConditionAndDisableDepthAndSplitDirection.w;
}
`;var $4e=_s.SHOW_INDEX,VK=_s.POSITION_INDEX,Nde=_s.COLOR_INDEX,eje=_s.OUTLINE_COLOR_INDEX,tje=_s.OUTLINE_WIDTH_INDEX,nje=_s.PIXEL_SIZE_INDEX,kde=_s.SCALE_BY_DISTANCE_INDEX,Ude=_s.TRANSLUCENCY_BY_DISTANCE_INDEX,Dde=_s.DISTANCE_DISPLAY_CONDITION_INDEX,ije=_s.DISABLE_DEPTH_DISTANCE_INDEX,oje=_s.SPLIT_DIRECTION_INDEX,LK=_s.NUMBER_OF_PROPERTIES,pc={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function Nu(e){e=y(e,y.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(LK),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=y(e.show,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=F.clone(F.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.blendOption=y(e.blendOption,Lo.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=oe.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(Nu.prototype,{length:{get:function(){return RK(this),this._pointPrimitives.length}}});function Bde(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Nu.prototype.add=function(e){let t=new _s(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};Nu.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Nu.prototype.removeAll=function(){Bde(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function RK(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}}Nu.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};Nu.prototype.contains=function(e){return l(e)&&e._pointPrimitiveCollection===this};Nu.prototype.get=function(e){return RK(this),this._pointPrimitives[e]};Nu.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<LK;++i){let o=n[i]===0?Me.STATIC_DRAW:Me.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function rje(e,t,n){return new yp(e,[{index:pc.positionHighAndSize,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[VK]},{index:pc.positionLowAndShow,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[VK]},{index:pc.compressedAttribute0,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[Nde]},{index:pc.compressedAttribute1,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[Ude]},{index:pc.scaleByDistance,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[kde]},{index:pc.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[Dde]}],t)}var SK=new Yn;function Yde(e,t,n,i){let o=i._index,r=i._getActualPosition();e._mode===oe.SCENE3D&&(ce.expand(e._baseVolume,r,e._baseVolume),e._boundingVolumeDirty=!0),Yn.fromCartesian(r,SK);let s=i.pixelSize,a=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,s+a);let c=n[pc.positionHighAndSize],d=SK.high;c(o,d.x,d.y,d.z,s);let u=n[pc.positionLowAndOutline],m=SK.low;u(o,m.x,m.y,m.z,a)}var ak=65536,iP=256;function Ode(e,t,n,i){let o=i._index,r=i.color,s=i.getPickId(t).color,a=i.outlineColor,c=Y.floatToByte(r.red),d=Y.floatToByte(r.green),u=Y.floatToByte(r.blue),m=c*ak+d*iP+u;c=Y.floatToByte(a.red),d=Y.floatToByte(a.green),u=Y.floatToByte(a.blue);let p=c*ak+d*iP+u;c=Y.floatToByte(s.red),d=Y.floatToByte(s.green),u=Y.floatToByte(s.blue);let g=c*ak+d*iP+u,f=Y.floatToByte(r.alpha)*ak+Y.floatToByte(a.alpha)*iP+Y.floatToByte(s.alpha),x=n[pc.compressedAttribute0];x(o,m,p,g,f)}function Hde(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)*iP+s;c=W.clamp(c,0,1),c=c===1?255:c*255|0;let p=c,g=n[pc.compressedAttribute1];g(o,m,p,r,a)}function zde(e,t,n,i){let o=i._index,r=n[pc.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 Kde(e,t,n,i){let o=i._index,r=n[pc.distanceDisplayConditionAndDisableDepthAndSplitDirection],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));let u=0,m=i.splitDirection;l(m)&&(u=m),r(o,s,a,d,u)}function sje(e,t,n,i){Yde(e,t,n,i),Ode(e,t,n,i),Hde(e,t,n,i),zde(e,t,n,i),Kde(e,t,n,i)}function CK(e,t,n,i,o,r){let s;i.mode===oe.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=_s._computeActualPosition(u,i,o);l(m)&&(d._setActualPosition(m),r?a.push(m):ce.expand(s,m,s))}r&&ce.fromPoints(a,s)}function aje(e,t){let n=t.mode,i=e._pointPrimitives,o=e._pointPrimitivesToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==oe.SCENE3D&&!F.equals(r,e.modelMatrix)?(e._mode=n,F.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===oe.SCENE3D||n===oe.SCENE2D||n===oe.COLUMBUS_VIEW)&&CK(e,i,i.length,t,r,!0)):n===oe.MORPHING?CK(e,i,i.length,t,r,!0):(n===oe.SCENE2D||n===oe.COLUMBUS_VIEW)&&CK(e,o,e._pointPrimitivesToUpdateIndex,t,r,!1)}function cje(e,t,n){let o=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=o}var lje=[];Nu.prototype.update=function(e){if(RK(this),!this.show)return;this._maxTotalPointSize=Dt.maximumAliasedPointSize,aje(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 E=0;E<LK;++E)r[E]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=rje(c,n,this._buffersUsage),a=this._vaf.writers;for(let E=0;E<n;++E){let X=this._pointPrimitives[E];X._dirty=!1,sje(this,c,a,X)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(o>0){let E=lje;E.length=0,(r[VK]||r[tje]||r[nje])&&E.push(Yde),(r[Nde]||r[eje])&&E.push(Ode),(r[$4e]||r[Ude])&&E.push(Hde),r[kde]&&E.push(zde),(r[Dde]||r[ije]||r[oje])&&E.push(Kde);let X=E.length;if(a=this._vaf.writers,o/n>.1){for(let v=0;v<o;++v){let P=i[v];P._dirty=!1;for(let A=0;A<X;++A)E[A](this,c,a,P)}this._vaf.commit()}else{for(let v=0;v<o;++v){let P=i[v];P._dirty=!1;for(let A=0;A<X;++A)E[A](this,c,a,P);this._vaf.subCommit(P._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=F.IDENTITY;e.mode===oe.SCENE3D?(p=this.modelMatrix,m=ce.clone(this._baseVolumeWC,this._boundingVolume)):m=ce.clone(this._baseVolume2D,this._boundingVolume),cje(this,e,m);let g=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,g&&(this._blendOption===Lo.OPAQUE||this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ue.fromCache({depthTest:{enabled:!0,func:ie.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===Lo.TRANSLUCENT||this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ue.fromCache({depthTest:{enabled:!0,func:ie.LEQUAL},depthMask:!1,blending:un.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let f,x;(g||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(f=new Oe({sources:[nP]}),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===Lo.OPAQUE_AND_TRANSLUCENT&&(x=new Oe({defines:["OPAQUE"],sources:[wg]}),this._sp=rn.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:f,fragmentShaderSource:x,attributeLocations:pc}),x=new Oe({defines:["TRANSLUCENT"],sources:[wg]}),this._spTranslucent=rn.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:f,fragmentShaderSource:x,attributeLocations:pc})),this._blendOption===Lo.OPAQUE&&(x=new Oe({sources:[wg]}),this._sp=rn.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:f,fragmentShaderSource:x,attributeLocations:pc})),this._blendOption===Lo.TRANSLUCENT&&(x=new Oe({sources:[wg]}),this._spTranslucent=rn.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:f,fragmentShaderSource:x,attributeLocations:pc})),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 E=this._colorCommands,X=this._blendOption===Lo.OPAQUE,v=this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT;_=this._vaf.va,C=_.length,E.length=C;let P=v?C*2:C;for(L=0;L<P;++L){let A=X||v&&L%2===0;V=E[L],l(V)||(V=E[L]=new tt),V.primitiveType=Fe.POINTS,V.pass=A||!v?Re.OPAQUE:Re.TRANSLUCENT,V.owner=this;let M=v?Math.floor(L/2):L;V.boundingVolume=m,V.modelMatrix=p,V.shaderProgram=A?this._sp:this._spTranslucent,V.uniformMap=this._uniforms,V.vertexArray=_[M].va,V.renderState=A?this._rsOpaque:this._rsTranslucent,V.debugShowBoundingVolume=this.debugShowBoundingVolume,V.pickId="v_pickColor",Z.push(V)}}};Nu.prototype.isDestroyed=function(){return!1};Nu.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(),Bde(this._pointPrimitives),me(this)};var y1=Nu;var aHn=T(S(),1),Jde=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],ZK=1,oP=8,sP=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!==ZK)throw new Error(`Got v${o} data when expected v${ZK}.`);let r=Jde[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=Jde.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,oP,t),this.coords=new this.ArrayType(this.data,oP+a+c,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(oP+s+a+c),this.ids=new this.IndexArrayType(this.data,oP,t),this.coords=new this.ArrayType(this.data,oP+a+c,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(ZK<<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 EK(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 g=p+m>>1,f=s[2*g],x=s[2*g+1];f>=t&&f<=i&&x>=n&&x<=o&&d.push(r[g]),(u===0?t<=f:n<=x)&&(c.push(p),c.push(g-1),c.push(1-u)),(u===0?i>=f:o>=x)&&(c.push(g+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;_++)Qde(r[2*_],r[2*_+1],t,n)<=d&&c.push(o[_]);continue}let g=p+m>>1,f=r[2*g],x=r[2*g+1];Qde(f,x,t,n)<=d&&c.push(o[g]),(u===0?t-i<=f:n-i<=x)&&(a.push(p),a.push(g-1),a.push(1-u)),(u===0?t+i>=f:n+i>=x)&&(a.push(g+1),a.push(m),a.push(1-u))}return c}};function EK(e,t,n,i,o,r){if(o-i<=n)return;let s=i+o>>1;jde(e,t,s,i,o,r),EK(e,t,n,i,s-1,1-r),EK(e,t,n,s+1,o,1-r)}function jde(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),g=.5*Math.sqrt(m*p*(d-p)/d)*(u-d/2<0?-1:1),f=Math.max(i,Math.floor(n-u*p/d+g)),x=Math.min(o,Math.floor(n+(d-u)*p/d+g));jde(e,t,n,f,x,r)}let s=t[2*n+r],a=i,c=o;for(rP(e,t,i,n),t[2*o+r]>s&&rP(e,t,i,o);a<c;){for(rP(e,t,a,c),a++,c--;t[2*a+r]<s;)a++;for(;t[2*c+r]>s;)c--}t[2*i+r]===s?rP(e,t,i,c):(c++,rP(e,t,c,o)),c<=n&&(i=c+1),n<=c&&(o=c-1)}}function rP(e,t,n,i){GK(e,n,i),GK(t,2*n,2*i),GK(t,2*n+1,2*i+1)}function GK(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function Qde(e,t,n,i){let o=e-n,r=t-i;return o*o+r*r}function $m(e){e=y(e,y.EMPTY_OBJECT),this._enabled=y(e.enabled,!1),this._pixelRange=y(e.pixelRange,80),this._minimumClusterSize=y(e.minimumClusterSize,2),this._clusterBillboards=y(e.clusterBillboards,!0),this._clusterLabels=y(e.clusterLabels,!0),this._clusterPoints=y(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 be,this.show=y(e.show,!0)}function qde(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var dje=new Ke;function $de(e,t,n,i,o){if(l(e._labelCollection)&&i._clusterLabels?o=Sg.getScreenSpaceBoundingBox(e,t,o):l(e._billboardCollection)&&i._clusterBillboards?o=ro.getScreenSpaceBoundingBox(e,t,o):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=_s.getScreenSpaceBoundingBox(e,t,o)),qde(o,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&tue(i,e.id.id)&&l(e.id._label)){let r=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(r),a=Sg.getScreenSpaceBoundingBox(s,t,dje);qde(a,n),o=Ke.union(o,a,o)}return o}function uje(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&tue(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 eue(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 tue(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function XK(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===oe.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 mje=new Ke,hje=new Ke,fje=new Ke;function pje(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 uf({scene:n}),l(a)?a.removeAll():a=e._clusterBillboardCollection=new yd({scene:n}),l(c)?c.removeAll():c=e._clusterPointCollection=new y1;let d=e._pixelRange,u=e._minimumClusterSize,m=e._previousClusters,p=[],g=e._previousHeight,f=n.camera.positionCartographic.height,x=n.ellipsoid,_=n.camera.positionWC,C=new V0(x,_),V=[];e._clusterLabels&&XK(i,V,n,C,e),e._clusterBillboards&&XK(o,V,n,C,e),e._clusterPoints&&XK(r,V,n,C,e);let L,Z,E,X,v,P,A,M,b,R,G,I;if(V.length>0){let w=new sP(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<g)for(E=m.length,L=0;L<E;++L){let N=m[L];if(!C.isPointVisible(N.position))continue;let B=ro._computeScreenSpacePosition(F.IDENTITY,N.position,h.ZERO,D.ZERO,n);if(!l(B))continue;let U=1-f/g,O=N.width=N.width*U,k=N.height=N.height*U;O=Math.max(O,N.minimumWidth),k=Math.max(k,N.minimumHeight);let J=B.x-O*.5,H=B.y-k*.5,te=B.x+O,z=B.y+k;for(v=w.range(J,H,te,z),P=v.length,R=0,b=[],Z=0;Z<P;++Z)A=v[Z],M=V[A],M.clustered||(++R,G=M.collection,I=M.index,b.push(G.get(I).id));if(R>=u)for(eue(N.position,R,b,e),p.push(N),Z=0;Z<P;++Z)V[v[Z]].clustered=!0}for(E=V.length,L=0;L<E;++L){let N=V[L];if(N.clustered)continue;N.clustered=!0,G=N.collection,I=N.index;let B=G.get(I);X=$de(B,N.coord,d,e,mje);let U=Ke.clone(X,hje);v=w.range(X.x,X.y,X.x+X.width,X.y+X.height),P=v.length;let O=h.clone(B.position);for(R=1,b=[B.id],Z=0;Z<P;++Z)if(A=v[Z],M=V[A],!M.clustered){let k=M.collection.get(M.index),J=$de(k,M.coord,d,e,fje);h.add(k.position,O,O),Ke.union(U,J,U),++R,b.push(k.id)}if(R>=u){let k=h.multiplyByScalar(O,1/R,O);for(eue(k,R,b,e),p.push({position:k,width:U.width,height:U.height,minimumWidth:X.width,minimumHeight:X.height}),Z=0;Z<P;++Z)V[v[Z]].clustered=!0}else uje(B,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=pje(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 WK(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 PK(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}$m.prototype.getLabel=WK("_labelCollection",uf,"_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,PK(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=WK("_billboardCollection",yd,"_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,PK(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=WK("_pointCollection",y1,"_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,PK(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function IK(e){if(!l(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function bje(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,IK(e._labelCollection),IK(e._billboardCollection),IK(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,bje(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 Cd=$m;function vK(e){this._name=e,this._clock=void 0,this._changed=new be,this._error=new be,this._isLoading=!1,this._loading=new be,this._entityCollection=new ks(this),this._entityCluster=new Cd}Object.defineProperties(vK.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){Ar.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}}});vK.prototype.update=function(e){return!0};var aP=vK;var vzn=T(S(),1);var jHn=T(S(),1);var vHn=T(S(),1);var nue={};nue.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,g=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,E=C*t;d[p+g]=V,d[p+g+1]=L,d[p+g+2]=s,d[p+f]=Z,d[p+f+1]=E,d[p+f+2]=r,p+=3,o&&(d[m++]=V,d[m++]=L,d[m++]=s,d[m++]=Z,d[m++]=E,d[m++]=r)}return d};var A_=nue;var wK=new D,gje=new h,yje=new h,xje=new h,_je=new h;function L0(e){e=y(e,y.EMPTY_OBJECT);let t=e.length,n=e.topRadius,i=e.bottomRadius,o=y(e.vertexFormat,Pe.DEFAULT),r=y(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"}L0.packedLength=Pe.packedLength+5;L0.pack=function(e,t,n){return n=y(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]=y(e._offsetAttribute,-1),t};var iue=new Pe,x1={vertexFormat:iue,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};L0.unpack=function(e,t,n){t=y(t,0);let i=Pe.unpack(e,t,iue);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):(x1.length=o,x1.topRadius=r,x1.bottomRadius=s,x1.slices=a,x1.offsetAttribute=c===-1?void 0:c,new L0(x1))};L0.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=A_.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,g=o.bitangent?new Float32Array(c*3):void 0,f,x=o.normal||o.tangent||o.bitangent;if(x){let v=o.tangent||o.bitangent,P=0,A=0,M=0,b=Math.atan2(i-n,t),R=gje;R.z=Math.sin(b);let G=Math.cos(b),I=xje,w=yje;for(f=0;f<r;f++){let N=f/r*W.TWO_PI,B=G*Math.cos(N),U=G*Math.sin(N);x&&(R.x=B,R.y=U,v&&(I=h.normalize(h.cross(h.UNIT_Z,R,I),I)),o.normal&&(m[P++]=R.x,m[P++]=R.y,m[P++]=R.z,m[P++]=R.x,m[P++]=R.y,m[P++]=R.z),o.tangent&&(p[A++]=I.x,p[A++]=I.y,p[A++]=I.z,p[A++]=I.x,p[A++]=I.y,p[A++]=I.z),o.bitangent&&(w=h.normalize(h.cross(R,I,w),w),g[M++]=w.x,g[M++]=w.y,g[M++]=w.z,g[M++]=w.x,g[M++]=w.y,g[M++]=w.z))}for(f=0;f<r;f++)o.normal&&(m[P++]=0,m[P++]=0,m[P++]=-1),o.tangent&&(p[A++]=1,p[A++]=0,p[A++]=0),o.bitangent&&(g[M++]=0,g[M++]=-1,g[M++]=0);for(f=0;f<r;f++)o.normal&&(m[P++]=0,m[P++]=0,m[P++]=1),o.tangent&&(p[A++]=1,p[A++]=0,p[A++]=0),o.bitangent&&(g[M++]=0,g[M++]=1,g[M++]=0)}let _=12*r-12,C=Ae.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 v=Math.max(n,i);for(f=0;f<c;f++){let P=h.fromArray(d,f*3,_je);u[Z++]=(P.x+v)/(2*v),u[Z++]=(P.y+v)/(2*v)}}let E=new mn;o.position&&(E.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:d})),o.normal&&(E.normal=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:m})),o.tangent&&(E.tangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:p})),o.bitangent&&(E.bitangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:g})),o.st&&(E.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:u})),wK.x=t*.5,wK.y=Math.max(i,n);let X=new ce(h.ZERO,D.magnitude(wK));if(l(e._offsetAttribute)){t=d.length;let v=e._offsetAttribute===ln.NONE?0:1,P=new Uint8Array(t/3).fill(v);E.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:P})}return new ht({attributes:E,indices:C,primitiveType:Fe.TRIANGLES,boundingSphere:X,offsetAttribute:e._offsetAttribute})};var FK;L0.getUnitCylinder=function(){return l(FK)||(FK=L0.createGeometry(new L0({topRadius:1,bottomRadius:1,length:1,vertexFormat:Pe.POSITION_ONLY}))),FK};var cP=L0;var mzn=T(S(),1);var AK=new D;function _1(e){e=y(e,y.EMPTY_OBJECT);let t=e.length,n=e.topRadius,i=e.bottomRadius,o=y(e.slices,128),r=Math.max(y(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"}_1.packedLength=6;_1.pack=function(e,t,n){return n=y(n,0),t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n++]=e._numberOfVerticalLines,t[n]=y(e._offsetAttribute,-1),t};var M_={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};_1.unpack=function(e,t,n){t=y(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):(M_.length=i,M_.topRadius=o,M_.bottomRadius=r,M_.slices=s,M_.numberOfVerticalLines=a,M_.offsetAttribute=c===-1?void 0:c,new _1(M_))};_1.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=A_.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=Ae.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 g=new mn;g.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:a}),AK.x=t*.5,AK.y=Math.max(i,n);let f=new ce(h.ZERO,D.magnitude(AK));if(l(e._offsetAttribute)){t=a.length;let x=e._offsetAttribute===ln.NONE?0:1,_=new Uint8Array(t/3).fill(x);g.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:_})}return new ht({attributes:g,indices:u,primitiveType:Fe.LINES,boundingSphere:f,offsetAttribute:e._offsetAttribute})};var lP=_1;var oue=h.ZERO,rue=new h,Tje=new h,sue=new Y;function Sje(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 Vd(e,t){ni.call(this,{entity:e,scene:t,geometryOptions:new Sje(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}l(Object.create)&&(Vd.prototype=Object.create(ni.prototype),Vd.prototype.constructor=Vd);Object.defineProperties(Vd.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Vd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Nn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Yt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,sue)),l(a)||(a=Y.WHITE),s.color=Ht.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=zi.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,oue,rue))),new Vt({id:t,geometry:new cP(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:s})};Vd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=K.getValueOrDefault(this._outlineColorProperty,e,Y.BLACK,sue),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ht.fromColor(i),distanceDisplayCondition:Nn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=zi.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,oue,rue))),new Vt({id:t,geometry:new lP(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:r})};Vd.prototype._computeCenter=function(e,t){return K.getValueOrUndefined(this._entity.position,e,t)};Vd.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.length)||!l(t.topRadius)||!l(t.bottomRadius)||ni.prototype._isHidden.call(this,e,t)};Vd.prototype._isDynamic=function(e,t){return!e.position.isConstant||!K.isConstant(e.orientation)||!t.length.isConstant||!t.topRadius.isConstant||!t.bottomRadius.isConstant||!K.isConstant(t.slices)||!K.isConstant(t.outlineWidth)||!K.isConstant(t.numberOfVerticalLines)};Vd.prototype._setStaticOptions=function(e,t){let n=K.getValueOrDefault(t.heightReference,De.MINIMUM_VALUE,Qe.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Yt?dn.VERTEX_FORMAT:oo.MaterialSupport.TEXTURED.vertexFormat,i.length=t.length.getValue(De.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(De.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(De.MINIMUM_VALUE),i.slices=K.getValueOrUndefined(t.slices,De.MINIMUM_VALUE),i.numberOfVerticalLines=K.getValueOrUndefined(t.numberOfVerticalLines,De.MINIMUM_VALUE),i.offsetAttribute=n!==Qe.NONE?ln.ALL:void 0};Vd.prototype._onEntityPropertyChanged=Ip;Vd.DynamicGeometryUpdater=T1;function T1(e,t,n){ti.call(this,e,t,n)}l(Object.create)&&(T1.prototype=Object.create(ti.prototype),T1.prototype.constructor=T1);T1.prototype._isHidden=function(e,t,n){let i=this._options,o=K.getValueOrUndefined(e.position,n,Tje);return!l(o)||!l(i.length)||!l(i.topRadius)||!l(i.bottomRadius)||ti.prototype._isHidden.call(this,e,t,n)};T1.prototype._setOptions=function(e,t,n){let i=K.getValueOrDefault(t.heightReference,n,Qe.NONE),o=this._options;o.length=K.getValueOrUndefined(t.length,n),o.topRadius=K.getValueOrUndefined(t.topRadius,n),o.bottomRadius=K.getValueOrUndefined(t.bottomRadius,n),o.slices=K.getValueOrUndefined(t.slices,n),o.numberOfVerticalLines=K.getValueOrUndefined(t.numberOfVerticalLines,n),o.offsetAttribute=i!==Qe.NONE?ln.ALL:void 0};var dP=Vd;var Yjn=T(S(),1);var Fzn=T(S(),1),Cje={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2},Mr=Object.freeze(Cje);var Mzn=T(S(),1),Vje={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2},mo=Object.freeze(Vje);var kzn=T(S(),1),Lje={NONE:0,HOLD:1,EXTRAPOLATE:2},Ld=Object.freeze(Lje);var Dzn=T(S(),1),aue=T(td(),1);function Rje(e){let t=new aue.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var R0=Rje;var zzn=T(S(),1);var Zje=W.factorial;function MK(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+=MK(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 ck={type:"Hermite"};ck.getRequiredDataPoints=function(e,t){return t=y(t,0),Math.max(Math.floor((e+1)/(t+1)),2)};ck.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 g=m,f=new Array(g);for(r=0;r<g;r++)f[r]=r;let x=m-1;for(c=0;c<i;c++){for(s=0;s<g;s++)u=f[s]*i+c,p[c][0].push(n[u]);for(r=1;r<g;r++){let _=!1;for(s=0;s<g-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/Zje(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 _=MK(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 Gje=[];ck.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=Gje,g=Eje(p,d,t,n,i,o),f=[],x=m*(m+1)/2,_=Math.min(g,r);for(let C=0;C<=_;C++)for(u=C;u<=g;u++){f.length=0;let V=MK(e,d,t,C,u,f),L=Math.floor(u*(1-u)/2)+m*u;for(let Z=0;Z<i;Z++){let E=Math.floor(Z*x),X=p[E+L];s[Z+C*i]+=X*V}}return s};function Eje(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 g=1;g<d;g++){let f=0,x=Math.floor(g*(1-g)/2)+d*g,_=!1;for(s=0;s<d-g;s++){let C=n[t[s]],V=n[t[s+g]],L,Z;if(V-C<=0)a=t[s]*o*(r+1)+o*g+m,L=i[a],Z=L/W.factorial(g),e[p+x+f]=Z,f++;else{let E=Math.floor((g-1)*(2-g)/2)+d*(g-1);L=e[p+E+s+1]-e[p+E+s],Z=L/(V-C),e[p+x+f]=Z,f++}_=_||L!==0}_&&(c=Math.max(c,g))}}return c}var uP=ck;var Qzn=T(S(),1);var NK={type:"Lagrange"};NK.getRequiredDataPoints=function(e){return Math.max(e+1,2)};NK.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 mP=NK;var $zn=T(S(),1);var kK={type:"Linear"};kK.getRequiredDataPoints=function(e){return 2};kK.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 N_=kK;var iKn=T(S(),1);function bc(e,t,n){this.clock=y(e,0),this.cone=y(t,0),this.magnitude=y(n,1)}bc.fromCartesian3=function(e,t){let n=e.x,i=e.y,o=e.z,r=n*n+i*i;return l(t)||(t=new bc),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(r),o),t.magnitude=Math.sqrt(r+o*o),t};bc.clone=function(e,t){if(l(e))return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new bc(e.clock,e.cone,e.magnitude)};bc.normalize=function(e,t){return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new bc(e.clock,e.cone,1)};bc.equals=function(e,t){return e===t||l(e)&&l(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};bc.equalsEpsilon=function(e,t,n){return n=y(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};bc.prototype.equals=function(e){return bc.equals(this,e)};bc.prototype.clone=function(e){return bc.clone(this,e)};bc.prototype.equalsEpsilon=function(e,t){return bc.equalsEpsilon(this,e,t)};bc.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var hP=bc;var yP=T(td(),1);var SKn=T(S(),1);var fKn=T(S(),1);var rKn=T(S(),1),UK;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?UK=function(){return performance.now()}:UK=function(){return Date.now()};var _i=UK;function DK(e){e=y(e,y.EMPTY_OBJECT);let t=e.currentTime,n=e.startTime,i=e.stopTime;l(t)?t=q.clone(t):l(n)?t=q.clone(n):l(i)?t=q.addDays(i,-1,new q):t=q.now(),l(n)?n=q.clone(n):n=q.clone(t),l(i)?i=q.clone(i):i=q.addDays(n,1,new q),this.startTime=n,this.stopTime=i,this.clockRange=y(e.clockRange,Mr.UNBOUNDED),this.canAnimate=y(e.canAnimate,!0),this.onTick=new be,this.onStop=new be,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=_i(),this.currentTime=t,this.multiplier=y(e.multiplier,1),this.shouldAnimate=y(e.shouldAnimate,!1),this.clockStep=y(e.clockStep,mo.SYSTEM_CLOCK_MULTIPLIER)}Object.defineProperties(DK.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){q.equals(this._currentTime,e)||(this._clockStep===mo.SYSTEM_CLOCK&&(this._clockStep=mo.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===mo.SYSTEM_CLOCK&&(this._clockStep=mo.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===mo.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=q.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===mo.SYSTEM_CLOCK&&(this._clockStep=mo.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});DK.prototype.tick=function(){let e=_i(),t=q.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===mo.SYSTEM_CLOCK)t=q.now(t);else{let i=this._multiplier;if(n===mo.TICK_DEPENDENT)t=q.addSeconds(t,i,t);else{let a=e-this._lastSystemTime;t=q.addSeconds(t,i*(a/1e3),t)}let o=this.clockRange,r=this.startTime,s=this.stopTime;if(o===Mr.CLAMPED)q.lessThan(t,r)?t=q.clone(r,t):q.greaterThan(t,s)&&(t=q.clone(s,t),this.onStop.raiseEvent(this));else if(o===Mr.LOOP_STOP)for(q.lessThan(t,r)&&(t=q.clone(r,t));q.greaterThan(t,s);)t=q.addSeconds(r,q.secondsDifference(t,s),t),this.onStop.raiseEvent(this)}}return this._currentTime=t,this._lastSystemTime=e,this.onTick.raiseEvent(this),t};var eh=DK;function k_(){this._definitionChanged=new be,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(k_.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:Sl("startTime"),stopTime:Sl("stopTime"),currentTime:Sl("currentTime"),clockRange:Sl("clockRange"),clockStep:Sl("clockStep"),multiplier:Sl("multiplier")});k_.prototype.clone=function(e){return l(e)||(e=new k_),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};k_.prototype.equals=function(e){return this===e||l(e)&&q.equals(this.startTime,e.startTime)&&q.equals(this.stopTime,e.stopTime)&&q.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier};k_.prototype.merge=function(e){this.startTime=y(this.startTime,e.startTime),this.stopTime=y(this.stopTime,e.stopTime),this.currentTime=y(this.currentTime,e.currentTime),this.clockRange=y(this.clockRange,e.clockRange),this.clockStep=y(this.clockStep,e.clockStep),this.multiplier=y(this.multiplier,e.multiplier)};k_.prototype.getValue=function(e){return l(e)||(e=new eh),e.startTime=y(this.startTime,e.startTime),e.stopTime=y(this.stopTime,e.stopTime),e.currentTime=y(this.currentTime,e.currentTime),e.clockRange=y(this.clockRange,e.clockRange),e.multiplier=y(this.multiplier,e.multiplier),e.clockStep=y(this.clockStep,e.clockStep),e};var th=k_;var WKn=T(S(),1);var Xje=Y.WHITE,Ije=.1,Wje=new D(8,8),Pje=new D(0,0),vje=new D(1,1);function S1(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new be,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(S1.prototype,{isConstant:{get:function(){return K.isConstant(this._color)&&K.isConstant(this._cellAlpha)&&K.isConstant(this._lineCount)&&K.isConstant(this._lineThickness)&&K.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:de("color"),cellAlpha:de("cellAlpha"),lineCount:de("lineCount"),lineThickness:de("lineThickness"),lineOffset:de("lineOffset")});S1.prototype.getType=function(e){return"Grid"};var wje=new q;S1.prototype.getValue=function(e,t){return l(e)||(e=q.now(wje)),l(t)||(t={}),t.color=K.getValueOrClonedDefault(this._color,e,Xje,t.color),t.cellAlpha=K.getValueOrDefault(this._cellAlpha,e,Ije),t.lineCount=K.getValueOrClonedDefault(this._lineCount,e,Wje,t.lineCount),t.lineThickness=K.getValueOrClonedDefault(this._lineThickness,e,vje,t.lineThickness),t.lineOffset=K.getValueOrClonedDefault(this._lineOffset,e,Pje,t.lineOffset),t};S1.prototype.equals=function(e){return this===e||e instanceof S1&&K.equals(this._color,e._color)&&K.equals(this._cellAlpha,e._cellAlpha)&&K.equals(this._lineCount,e._lineCount)&&K.equals(this._lineThickness,e._lineThickness)&&K.equals(this._lineOffset,e._lineOffset)};var C1=S1;var kKn=T(S(),1);function V1(e){this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(V1.prototype,{isConstant:{get:function(){return K.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:de("color")});V1.prototype.getType=function(e){return"PolylineArrow"};var Fje=new q;V1.prototype.getValue=function(e,t){return l(e)||(e=q.now(Fje)),l(t)||(t={}),t.color=K.getValueOrClonedDefault(this._color,e,Y.WHITE,t.color),t};V1.prototype.equals=function(e){return this===e||e instanceof V1&&K.equals(this._color,e._color)};var L1=V1;var JKn=T(S(),1);var Aje=Y.WHITE,Mje=Y.TRANSPARENT,Nje=16,kje=255;function R1(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new be,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(R1.prototype,{isConstant:{get:function(){return K.isConstant(this._color)&&K.isConstant(this._gapColor)&&K.isConstant(this._dashLength)&&K.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:de("color"),gapColor:de("gapColor"),dashLength:de("dashLength"),dashPattern:de("dashPattern")});R1.prototype.getType=function(e){return"PolylineDash"};var Uje=new q;R1.prototype.getValue=function(e,t){return l(e)||(e=q.now(Uje)),l(t)||(t={}),t.color=K.getValueOrClonedDefault(this._color,e,Aje,t.color),t.gapColor=K.getValueOrClonedDefault(this._gapColor,e,Mje,t.gapColor),t.dashLength=K.getValueOrDefault(this._dashLength,e,Nje,t.dashLength),t.dashPattern=K.getValueOrDefault(this._dashPattern,e,kje,t.dashPattern),t};R1.prototype.equals=function(e){return this===e||e instanceof R1&&K.equals(this._color,e._color)&&K.equals(this._gapColor,e._gapColor)&&K.equals(this._dashLength,e._dashLength)&&K.equals(this._dashPattern,e._dashPattern)};var Z1=R1;var oJn=T(S(),1);var Dje=Y.WHITE,Bje=.25,Yje=1;function G1(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new be,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(G1.prototype,{isConstant:{get:function(){return K.isConstant(this._color)&&K.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:de("color"),glowPower:de("glowPower"),taperPower:de("taperPower")});G1.prototype.getType=function(e){return"PolylineGlow"};var Oje=new q;G1.prototype.getValue=function(e,t){return l(e)||(e=q.now(Oje)),l(t)||(t={}),t.color=K.getValueOrClonedDefault(this._color,e,Dje,t.color),t.glowPower=K.getValueOrDefault(this._glowPower,e,Bje,t.glowPower),t.taperPower=K.getValueOrDefault(this._taperPower,e,Yje,t.taperPower),t};G1.prototype.equals=function(e){return this===e||e instanceof G1&&K.equals(this._color,e._color)&&K.equals(this._glowPower,e._glowPower)&&K.equals(this._taperPower,e._taperPower)};var E1=G1;var hJn=T(S(),1);var Hje=Y.WHITE,zje=Y.BLACK,Kje=1;function X1(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new be,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(X1.prototype,{isConstant:{get:function(){return K.isConstant(this._color)&&K.isConstant(this._outlineColor)&&K.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:de("color"),outlineColor:de("outlineColor"),outlineWidth:de("outlineWidth")});X1.prototype.getType=function(e){return"PolylineOutline"};var Jje=new q;X1.prototype.getValue=function(e,t){return l(e)||(e=q.now(Jje)),l(t)||(t={}),t.color=K.getValueOrClonedDefault(this._color,e,Hje,t.color),t.outlineColor=K.getValueOrClonedDefault(this._outlineColor,e,zje,t.outlineColor),t.outlineWidth=K.getValueOrDefault(this._outlineWidth,e,Kje),t};X1.prototype.equals=function(e){return this===e||e instanceof X1&&K.equals(this._color,e._color)&&K.equals(this._outlineColor,e._outlineColor)&&K.equals(this._outlineWidth,e._outlineWidth)};var Fg=X1;var SJn=T(S(),1);function Z0(e,t){this._value=void 0,this._definitionChanged=new be,this._eventHelper=new vr,this._referenceFrame=y(t,$i.FIXED),this.setValue(e)}Object.defineProperties(Z0.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(!K.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var Qje=new q;Z0.prototype.getValue=function(e,t){return l(e)||(e=q.now(Qje)),this.getValueInReferenceFrame(e,$i.FIXED,t)};Z0.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};Z0.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,Z0.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};Z0.prototype.equals=function(e){return this===e||e instanceof Z0&&this._referenceFrame===e._referenceFrame&&K.arrayEquals(this._value,e._value)};Z0.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var G0=Z0;var EJn=T(S(),1);function Ag(e){this._value=void 0,this._definitionChanged=new be,this._eventHelper=new vr,this.setValue(e)}Object.defineProperties(Ag.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(!K.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});var jje=new q;Ag.prototype.getValue=function(e,t){l(e)||(e=q.now(jje));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};Ag.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,Ag.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};Ag.prototype.equals=function(e){return this===e||e instanceof Ag&&K.arrayEquals(this._value,e._value)};Ag.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var I1=Ag;var wJn=T(S(),1);function U_(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(Rd.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 Rd(e,t,n){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new be,e.collectionChanged.addEventListener(Rd.prototype._onCollectionChanged,this)}Object.defineProperties(Rd.prototype,{isConstant:{get:function(){return K.isConstant(U_(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=U_(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 U_(this)}}});Rd.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 Rd(e,n,i)};var qje=new q;Rd.prototype.getValue=function(e,t){let n=U_(this);return l(e)||(e=q.now(qje)),l(n)?n.getValue(e,t):void 0};Rd.prototype.getValueInReferenceFrame=function(e,t,n){let i=U_(this);return l(i)?i.getValueInReferenceFrame(e,t,n):void 0};Rd.prototype.getType=function(e){let t=U_(this);return l(t)?t.getType(e):void 0};Rd.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};Rd.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){l(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};Rd.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;l(i)&&n.indexOf(i)!==-1?(i.definitionChanged.removeEventListener(Rd.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):l(i)||(i=U_(this),l(i)&&this._definitionChanged.raiseEvent(this))};var E0=Rd;var kJn=T(S(),1);var $je={packedLength:1,pack:function(e,t,n){return n=y(n,0),t[n]=e,t},unpack:function(e,t,n){return t=y(t,0),e[t]},convertPackedArrayForInterpolation:function(e,t,n,i){l(i)||(i=[]),t=y(t,0),n=y(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}},ku=$je;var sQn=T(S(),1);var JJn=T(S(),1);var cue={packedLength:1,pack:function(e,t,n){n=y(n,0),t[n]=e},unpack:function(e,t,n){return t=y(t,0),e[t]}};function lue(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 due(e,t){return e instanceof q?e:typeof e=="string"?q.fromIso8601(e):q.addSeconds(t,e,new q)}var BK=[],YK=[];function lk(e,t,n,i,o){let r=0,s,a,c,d,u,m;for(;r<i.length;){u=due(i[r],e),c=Go(t,u,q.compare);let p=0,g=0;if(c<0){for(c=~c,d=c*o,a=void 0,m=t[c];r<i.length&&(u=due(i[r],e),!(l(a)&&q.compare(a,u)>=0||l(m)&&q.compare(u,m)>=0));){for(BK[p++]=u,r=r+1,s=0;s<o;s++)YK[g++]=i[r],r=r+1;a=u}p>0&&(YK.length=g,lue(n,d,YK),BK.length=p,lue(t,c,BK))}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=cue);let i=n.packedLength,o=y(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=cue);let u=d.packedLength;i+=u,o+=y(d.packedInterpolationLength,u),s[c]=d}r=a}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=N_,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 be,this._derivativeTypes=t,this._innerDerivativeTypes=s,this._inputOrder=r,this._forwardExtrapolationType=Ld.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=Ld.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))}}});var e8e=new q;nh.prototype.getValue=function(e,t){l(e)||(e=q.now(e8e));let n=this._times,i=n.length;if(i===0)return;let o,r=this._innerType,s=this._values,a=Go(n,e,q.compare);if(a<0){if(a=~a,a===0){let Z=n[a];if(o=this._backwardExtrapolationDuration,this._backwardExtrapolationType===Ld.NONE||o!==0&&q.secondsDifference(Z,e)>o)return;if(this._backwardExtrapolationType===Ld.HOLD)return r.unpack(s,0,t)}if(a>=i){a=i-1;let Z=n[a];if(o=this._forwardExtrapolationDuration,this._forwardExtrapolationType===Ld.NONE||o!==0&&q.secondsDifference(e,Z)>o)return;if(this._forwardExtrapolationType===Ld.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 g=this._numberOfPoints-1;if(g<1)return;let f=0,x=i-1;if(x-f+1>=g+1){let Z=a-(g/2|0)-1;Z<f&&(Z=f);let E=Z+g;E>x&&(E=x,Z=E-g,Z<f&&(Z=f)),f=Z,x=E}let C=x-f+1;for(let Z=0;Z<C;++Z)c[Z]=q.secondsDifference(n[f+Z],n[x]);if(l(r.convertPackedArrayForInterpolation))r.convertPackedArrayForInterpolation(s,f,x,d);else{let Z=0,E=this._packedLength,X=f*E,v=(x+1)*E;for(;X<v;)d[Z]=s[X],X++,Z++}let V=q.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)}lk(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)}lk(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};nh.prototype.addSamplesPackedArray=function(e,t){lk(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};nh.prototype.removeSample=function(e){let t=Go(this._times,e,q.compare);return t<0?!1:(uue(this,t,1),!0)};function uue(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=Go(t,e.start,q.compare);n<0?n=~n:e.isStartIncluded||++n;let i=Go(t,e.stop,q.compare);i<0?i=~i:e.isStopIncluded&&++i,uue(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(!q.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=lk;var Zd=nh;function Uu(e,t){t=y(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 Zd(h,n),this._definitionChanged=new be,this._referenceFrame=y(e,$i.FIXED),this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(Uu.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}}});var t8e=new q;Uu.prototype.getValue=function(e,t){return l(e)||(e=q.now(t8e)),this.getValueInReferenceFrame(e,$i.FIXED,t)};Uu.prototype.getValueInReferenceFrame=function(e,t,n){if(n=this._property.getValue(e,n),l(n))return Rp.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};Uu.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};Uu.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;this._property.addSample(e,t,n)};Uu.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};Uu.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};Uu.prototype.removeSample=function(e){return this._property.removeSample(e)};Uu.prototype.removeSamples=function(e){this._property.removeSamples(e)};Uu.prototype.equals=function(e){return this===e||e instanceof Uu&&K.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var ca=Uu;var yQn=T(S(),1);var cQn=T(S(),1),n8e={HORIZONTAL:0,VERTICAL:1},ih=Object.freeze(n8e);var i8e=ih.HORIZONTAL,o8e=Y.WHITE,r8e=Y.BLACK,s8e=0,a8e=1;function W1(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new be,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(W1.prototype,{isConstant:{get:function(){return K.isConstant(this._orientation)&&K.isConstant(this._evenColor)&&K.isConstant(this._oddColor)&&K.isConstant(this._offset)&&K.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:de("orientation"),evenColor:de("evenColor"),oddColor:de("oddColor"),offset:de("offset"),repeat:de("repeat")});W1.prototype.getType=function(e){return"Stripe"};var c8e=new q;W1.prototype.getValue=function(e,t){return l(e)||(e=q.now(c8e)),l(t)||(t={}),t.horizontal=K.getValueOrDefault(this._orientation,e,i8e)===ih.HORIZONTAL,t.evenColor=K.getValueOrClonedDefault(this._evenColor,e,o8e,t.evenColor),t.oddColor=K.getValueOrClonedDefault(this._oddColor,e,r8e,t.oddColor),t.offset=K.getValueOrDefault(this._offset,e,s8e),t.repeat=K.getValueOrDefault(this._repeat,e,a8e),t};W1.prototype.equals=function(e){return this===e||e instanceof W1&&K.equals(this._orientation,e._orientation)&&K.equals(this._evenColor,e._evenColor)&&K.equals(this._oddColor,e._oddColor)&&K.equals(this._offset,e._offset)&&K.equals(this._repeat,e._repeat)};var P1=W1;var GQn=T(S(),1);function Mg(e){this._definitionChanged=new be,this._intervals=new Fr,this._intervals.changedEvent.addEventListener(Mg.prototype._intervalsChanged,this),this._referenceFrame=y(e,$i.FIXED)}Object.defineProperties(Mg.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}}});var l8e=new q;Mg.prototype.getValue=function(e,t){return l(e)||(e=q.now(l8e)),this.getValueInReferenceFrame(e,$i.FIXED,t)};Mg.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._intervals.findDataForIntervalContainingDate(e);if(l(i))return Rp.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};Mg.prototype.equals=function(e){return this===e||e instanceof Mg&&this._intervals.equals(e._intervals,K.equals)&&this._referenceFrame===e._referenceFrame};Mg.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var X0=Mg;var wQn=T(S(),1);function D_(){this._definitionChanged=new be,this._intervals=new Fr,this._intervals.changedEvent.addEventListener(D_.prototype._intervalsChanged,this)}Object.defineProperties(D_.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var d8e=new q;D_.prototype.getValue=function(e,t){l(e)||(e=q.now(d8e));let n=this._intervals.findDataForIntervalContainingDate(e);return l(n)&&typeof n.clone=="function"?n.clone(t):n};D_.prototype.equals=function(e){return this===e||e instanceof D_&&this._intervals.equals(e._intervals,K.equals)};D_.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var I0=D_;var n4n=T(S(),1);var BQn=T(S(),1);function v1(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new be,this._normalize=y(t,!0),this.position=e}Object.defineProperties(v1.prototype,{isConstant:{get:function(){return K.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 u8e=new h,mue=new h,hue=new q,m8e=new q,OK=1/60;v1.prototype.getValue=function(e,t){return this._getValue(e,t)};v1.prototype._getValue=function(e,t,n){l(e)||(e=q.now(m8e)),l(t)||(t=new h);let i=this._position;if(K.isConstant(i))return this._normalize?void 0:h.clone(h.ZERO,t);let o=i.getValue(e,u8e),r=i.getValue(q.addSeconds(e,OK,hue),mue);if(!l(o)||!l(r)&&(r=o,o=i.getValue(q.addSeconds(e,-OK,hue),mue),!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,OK,t)};v1.prototype.equals=function(e){return this===e||e instanceof v1&&K.equals(this._position,e._position)};var B_=v1;function fP(e,t){this._velocityVectorProperty=new B_(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new be,this.ellipsoid=y(t,ne.default);let n=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){n._definitionChanged.raiseEvent(n)})}Object.defineProperties(fP.prototype,{isConstant:{get:function(){return K.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 fue=new h,h8e=new h,pue=new $,f8e=new q;fP.prototype.getValue=function(e,t){l(e)||(e=q.now(f8e));let n=this._velocityVectorProperty._getValue(e,h8e,fue);if(l(n))return wt.rotationMatrixFromPositionVelocity(fue,n,this._ellipsoid,pue),we.fromRotationMatrix(pue,t)};fP.prototype.equals=function(e){return this===e||e instanceof fP&&K.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var pP=fP;var r4n=T(S(),1);var W0={COMPLETE:0,BELOW_ELLIPSOID_HORIZON:1,ABOVE_ELLIPSOID_HORIZON:2};W0.validate=function(e){return e===W0.COMPLETE||e===W0.BELOW_ELLIPSOID_HORIZON||e===W0.ABOVE_ELLIPSOID_HORIZON};W0.toString=function(e){switch(e){case W0.COMPLETE:return"COMPLETE";case W0.BELOW_ELLIPSOID_HORIZON:return"BELOW_ELLIPSOID_HORIZON";case W0.ABOVE_ELLIPSOID_HORIZON:return"ABOVE_ELLIPSOID_HORIZON";default:throw new pe("SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.")}};var w1=W0;function Ng(){}Ng.packedLength=h.packedLength;Ng.unpack=h.unpack;Ng.pack=h.pack;var HK;function bP(e,t){return t[0]==="#"&&(t=HK+t),E0.fromString(e,t)}function bue(e,t,n){if(l(n.reference))return bP(t,n.reference);if(l(n.velocityReference)){let i=bP(t,n.velocityReference);switch(e){case h:case Ng:return new B_(i,e===Ng);case we:return new pP(i)}}throw new ue(`${JSON.stringify(n)} is not valid CZML.`)}function p8e(e,t){return new Zm(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var Mi=new h,Jc=new hP,gc=new he,Y_=new Vn,dk=new we;function b8e(e){let t=e.rgbaf;if(l(t))return t;let n=e.rgba;if(!l(n))return;let i=n.length;if(i===Y.packedLength)return[Y.byteToFloat(n[0]),Y.byteToFloat(n[1]),Y.byteToFloat(n[2]),Y.byteToFloat(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=Y.byteToFloat(n[o+1]),t[o+2]=Y.byteToFloat(n[o+2]),t[o+3]=Y.byteToFloat(n[o+3]),t[o+4]=Y.byteToFloat(n[o+4]);return t}function gue(e,t){let n=y(e.uri,e);return l(t)?t.getDerivedResource({url:n}):Ee.createIfNeeded(n)}function g8e(e){let t=e.wsen;if(l(t))return t;let n=e.wsenDegrees;if(!l(n))return;let i=n.length;if(i===ae.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 y8e(e){let t=e.length;if(Jc.magnitude=1,t===2)return Jc.clock=e[0],Jc.cone=e[1],h.fromSpherical(Jc,Mi),[Mi.x,Mi.y,Mi.z];let n=new Array(t/3*4);for(let i=0,o=0;i<t;i+=3,o+=4)n[o]=e[i],Jc.clock=e[i+1],Jc.cone=e[i+2],h.fromSpherical(Jc,Mi),n[o+1]=Mi.x,n[o+2]=Mi.y,n[o+3]=Mi.z;return n}function x8e(e){let t=e.length;if(t===3)return Jc.clock=e[0],Jc.cone=e[1],Jc.magnitude=e[2],h.fromSpherical(Jc,Mi),[Mi.x,Mi.y,Mi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Jc.clock=e[i+1],Jc.cone=e[i+2],Jc.magnitude=e[i+3],h.fromSpherical(Jc,Mi),n[i+1]=Mi.x,n[i+2]=Mi.y,n[i+3]=Mi.z;return n}function _8e(e){let t=e.length;if(t===3)return gc.longitude=e[0],gc.latitude=e[1],gc.height=e[2],ne.default.cartographicToCartesian(gc,Mi),[Mi.x,Mi.y,Mi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],gc.longitude=e[i+1],gc.latitude=e[i+2],gc.height=e[i+3],ne.default.cartographicToCartesian(gc,Mi),n[i+1]=Mi.x,n[i+2]=Mi.y,n[i+3]=Mi.z;return n}function T8e(e){let t=e.length;if(t===3)return gc.longitude=W.toRadians(e[0]),gc.latitude=W.toRadians(e[1]),gc.height=e[2],ne.default.cartographicToCartesian(gc,Mi),[Mi.x,Mi.y,Mi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],gc.longitude=W.toRadians(e[i+1]),gc.latitude=W.toRadians(e[i+2]),gc.height=e[i+3],ne.default.cartographicToCartesian(gc,Mi),n[i+1]=Mi.x,n[i+2]=Mi.y,n[i+3]=Mi.z;return n}function zK(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 y8e(o);let r=e.spherical;if(l(r))return x8e(r);let s=e.cartographicRadians;if(l(s))return _8e(s);let a=e.cartographicDegrees;if(l(a))return T8e(a);throw new ue(`${JSON.stringify(e)} is not a valid CZML interval.`)}function yue(e,t){h.unpack(e,t,Mi),h.normalize(Mi,Mi),h.pack(Mi,e,t)}function S8e(e){let t=zK(e);if(t.length===3)return yue(t,0),t;for(let n=1;n<t.length;n+=4)yue(t,n);return t}function xue(e,t){we.unpack(e,t,dk),we.normalize(dk,dk),we.pack(dk,e,t)}function C8e(e){let t=e.unitQuaternion;if(l(t)){if(t.length===4)return xue(t,0),t;for(let n=1;n<t.length;n+=5)xue(t,n)}return t}function _ue(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")?Ke:e.hasOwnProperty("cartesian2")?D:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?h:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?Ng:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?Y:e.hasOwnProperty("arcType")?en:e.hasOwnProperty("classificationType")?kn:e.hasOwnProperty("colorBlendMode")?cc:e.hasOwnProperty("cornerType")?Gi:e.hasOwnProperty("heightReference")?Qe:e.hasOwnProperty("horizontalOrigin")?gi:e.hasOwnProperty("date")?q:e.hasOwnProperty("labelStyle")?No:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?kt:e.hasOwnProperty("distanceDisplayCondition")?Pt:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?we:e.hasOwnProperty("shadowMode")?_n:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?ih:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?ae:e.hasOwnProperty("uri")?yP.default:e.hasOwnProperty("verticalOrigin")?Pn:Object}function V8e(e,t,n){switch(e){case en:return en[y(t.arcType,t)];case Array:return t.array;case Boolean:return y(t.boolean,t);case Ke:return t.boundingRectangle;case D:return t.cartesian2;case h:return zK(t);case Ng:return S8e(t);case Y:return b8e(t);case kn:return kn[y(t.classificationType,t)];case cc:return cc[y(t.colorBlendMode,t)];case Gi:return Gi[y(t.cornerType,t)];case Qe:return Qe[y(t.heightReference,t)];case gi:return gi[y(t.horizontalOrigin,t)];case Image:return gue(t,n);case q:return q.fromIso8601(y(t.date,t));case No:return No[y(t.labelStyle,t)];case Number:return y(t.number,t);case kt:return t.nearFarScalar;case Pt:return t.distanceDisplayCondition;case Object:return y(y(t.object,t.value),t);case we:return C8e(t);case ku:return y(t.number,t);case w1:return w1[y(t.portionToDisplay,t)];case _n:return _n[y(y(t.shadowMode,t.shadows),t)];case String:return y(t.string,t);case ih:return ih[y(t.stripeOrientation,t)];case ae:return g8e(t);case yP.default:return gue(t,n);case Pn:return Pn[y(t.verticalOrigin,t)];default:throw new ue(`Unknown CzmlDataSource interval type: ${e}`)}}var L8e={HERMITE:uP,LAGRANGE:mP,LINEAR:N_};function uk(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(l(n)||l(i))&&t.setInterpolationOptions({interpolationAlgorithm:L8e[n],interpolationDegree:i});let o=e.forwardExtrapolationType;l(o)&&(t.forwardExtrapolationType=Ld[o]);let r=e.forwardExtrapolationDuration;l(r)&&(t.forwardExtrapolationDuration=r);let s=e.backwardExtrapolationType;l(s)&&(t.backwardExtrapolationType=Ld[s]);let a=e.backwardExtrapolationDuration;l(a)&&(t.backwardExtrapolationDuration=a)}var Tue={iso8601:void 0};function ar(e){if(l(e))return Tue.iso8601=e,Vn.fromIso8601(Tue)}function KK(e){let t=De.MAXIMUM_INTERVAL.clone();return t.data=e,t}function Sue(e){let t=new fc;return t.intervals.addInterval(KK(e)),t}function Cue(e){let t=new sa(e.referenceFrame);return t.intervals.addInterval(KK(e)),t}function mk(e,t,n,i,o,r,s){let a=ar(i.interval);l(o)&&(l(a)?a=Vn.intersect(a,o,Y_):a=o);let c,d,u,m=!l(i.reference)&&!l(i.velocityReference),p=l(a)&&!a.equals(De.MAXIMUM_INTERVAL);if(i.delete===!0){if(!p){t[n]=void 0;return}return vue(t[n],a)}let g=!1;if(m){if(d=V8e(e,i,r),!l(d))return;c=y(e.packedLength,1),u=y(d.length,1),g=!l(i.array)&&typeof d!="string"&&u>c&&e!==Object}let f=typeof e.unpack=="function"&&e!==ku;if(!g&&!p){m?t[n]=new Jn(f?e.unpack(d,0):d):t[n]=bue(e,s,i);return}let x=t[n],_,C=i.epoch;if(l(C)&&(_=q.fromIso8601(C)),g&&!p){x instanceof Zd||(t[n]=x=new Zd(e)),x.addSamplesPackedArray(d,_),uk(i,x);return}let V;if(!g&&p){a=a.clone(),m?a.data=f?e.unpack(d,0):d:a.data=bue(e,s,i),l(x)||(t[n]=x=m?new I0:new fc),m&&x instanceof I0?x.intervals.addInterval(a):x instanceof fc?(m&&(a.data=new Jn(a.data)),x.intervals.addInterval(a)):(t[n]=x=Sue(x),m&&(a.data=new Jn(a.data)),x.intervals.addInterval(a));return}l(x)||(t[n]=x=new fc),x instanceof fc||(t[n]=x=Sue(x));let L=x.intervals;V=L.findInterval(a),(!l(V)||!(V.data instanceof Zd))&&(V=a.clone(),V.data=new Zd(e),L.addInterval(V)),V.data.addSamplesPackedArray(d,_),uk(i,V.data)}function vue(e,t){if(e instanceof Zd){e.removeSamples(t);return}else if(e instanceof I0){e.intervals.removeInterval(t);return}else if(e instanceof fc){let n=e.intervals;for(let i=0;i<n.length;++i){let o=Vn.intersect(n.get(i),t,Y_);o.isEmpty||vue(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)mk(e,t,n,i[a],o,r,s);else mk(e,t,n,i,o,r,s)}function Vue(e,t,n,i,o,r){let s=ar(n.interval);l(i)&&(l(s)?s=Vn.intersect(s,i,Y_):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(De.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return wue(e[t],s)}let g,f=!1;if(m&&(l(n.referenceFrame)&&(g=$i[n.referenceFrame]),g=y(g,$i.FIXED),d=zK(n),u=y(d.length,1),f=u>c),!f&&!p){m?e[t]=new Mc(h.unpack(d),g):e[t]=bP(r,n.reference);return}let x=e[t],_,C=n.epoch;if(l(C)&&(_=q.fromIso8601(C)),f&&!p){(!(x instanceof ca)||l(g)&&x.referenceFrame!==g)&&(e[t]=x=new ca(g,a)),x.addSamplesPackedArray(d,_),uk(n,x);return}let V;if(!f&&p){s=s.clone(),m?s.data=h.unpack(d):s.data=bP(r,n.reference),l(x)||(m?x=new X0(g):x=new sa(g),e[t]=x),m&&x instanceof X0&&l(g)&&x.referenceFrame===g?x.intervals.addInterval(s):x instanceof sa?(m&&(s.data=new Mc(s.data,g)),x.intervals.addInterval(s)):(e[t]=x=Cue(x),m&&(s.data=new Mc(s.data,g)),x.intervals.addInterval(s));return}l(x)?x instanceof sa||(e[t]=x=Cue(x)):e[t]=x=new sa(g);let L=x.intervals;V=L.findInterval(s),(!l(V)||!(V.data instanceof ca)||l(g)&&V.data.referenceFrame!==g)&&(V=s.clone(),V.data=new ca(g,a),L.addInterval(V)),V.data.addSamplesPackedArray(d,_),uk(n,V.data)}function wue(e,t){if(e instanceof ca){e.removeSamples(t);return}else if(e instanceof X0){e.intervals.removeInterval(t);return}else if(e instanceof sa){let n=e.intervals;for(let i=0;i<n.length;++i){let o=Vn.intersect(n.get(i),t,Y_);o.isEmpty||wue(o.data,t)}n.removeInterval(t);return}}function Fue(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)Vue(e,t,n[s],i,o,r);else Vue(e,t,n,i,o,r)}function Lue(e,t,n,i){l(n.references)?hk(e,t,n.references,n.interval,i,I1,fc):(l(n.cartesian2)?n.array=D.unpackArray(n.cartesian2):l(n.cartesian)&&(n.array=D.unpackArray(n.cartesian)),l(n.array)&&xe(Array,e,t,n,void 0,void 0,i))}function Rue(e,t,n,i,o,r){let s=ar(n.interval);l(i)&&(l(s)?s=Vn.intersect(s,i,Y_):s=i);let a=e[t],c,d;if(l(s)){a instanceof h1||(a=new h1,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 Yt||(c=new Yt),u=n.solidColor,xe(Y,c,"color",u.color,void 0,void 0,r)):l(n.grid)?(c instanceof C1||(c=new C1),u=n.grid,xe(Y,c,"color",u.color,void 0,o,r),xe(Number,c,"cellAlpha",u.cellAlpha,void 0,o,r),xe(D,c,"lineCount",u.lineCount,void 0,o,r),xe(D,c,"lineThickness",u.lineThickness,void 0,o,r),xe(D,c,"lineOffset",u.lineOffset,void 0,o,r)):l(n.image)?(c instanceof Mb||(c=new Mb),u=n.image,xe(Image,c,"image",u.image,void 0,o,r),xe(D,c,"repeat",u.repeat,void 0,o,r),xe(Y,c,"color",u.color,void 0,o,r),xe(Boolean,c,"transparent",u.transparent,void 0,o,r)):l(n.stripe)?(c instanceof P1||(c=new P1),u=n.stripe,xe(ih,c,"orientation",u.orientation,void 0,o,r),xe(Y,c,"evenColor",u.evenColor,void 0,o,r),xe(Y,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 Fg||(c=new Fg),u=n.polylineOutline,xe(Y,c,"color",u.color,void 0,o,r),xe(Y,c,"outlineColor",u.outlineColor,void 0,o,r),xe(Number,c,"outlineWidth",u.outlineWidth,void 0,o,r)):l(n.polylineGlow)?(c instanceof E1||(c=new E1),u=n.polylineGlow,xe(Y,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 L1||(c=new L1),u=n.polylineArrow,xe(Y,c,"color",u.color,void 0,void 0,r)):l(n.polylineDash)?(c instanceof Z1||(c=new Z1),u=n.polylineDash,xe(Y,c,"color",u.color,void 0,void 0,r),xe(Y,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 u1||(c=new u1),u=n.checkerboard,xe(Y,c,"evenColor",u.evenColor,void 0,o,r),xe(Y,c,"oddColor",u.oddColor,void 0,o,r),xe(D,c,"repeat",u.repeat,void 0,o,r)),l(d)?d.data=c:e[t]=c}function Gd(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)Rue(e,t,n[s],i,o,r);else Rue(e,t,n,i,o,r)}function R8e(e,t,n,i){let o=t.name;l(o)&&(e.name=t.name)}function Z8e(e,t,n,i){let o=t.description;l(o)&&xe(String,e,"description",o,void 0,i,n)}function G8e(e,t,n,i){let o=t.position;l(o)&&Fue(e,"position",o,void 0,i,n)}function E8e(e,t,n,i){let o=t.viewFrom;l(o)&&xe(h,e,"viewFrom",o,void 0,i,n)}function X8e(e,t,n,i){let o=t.orientation;l(o)&&xe(we,e,"orientation",o,void 0,i,n)}function I8e(e,t,n,i){let o=t.properties;if(l(o)){l(e.properties)||(e.properties=new Cl);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)mk(_ue(s[a]),e.properties,r,s[a],void 0,i,n);else mk(_ue(s),e.properties,r,s,void 0,i,n)}}}function hk(e,t,n,i,o,r,s){let a=n.map(function(c){return bP(o,c)});if(l(i)){i=ar(i);let c=e[t];if(!(c instanceof s)){let d=new s;d.intervals.addInterval(KK(c)),e[t]=c=d}i.data=new r(a),c.intervals.addInterval(i)}else e[t]=new r(a)}function Zue(e,t,n,i){let o=n.references;l(o)?hk(e,t,o,n.interval,i,I1,fc):xe(Array,e,t,n,void 0,void 0,i)}function Gue(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)Zue(e,t,n[o],i);else Zue(e,t,n,i)}function Eue(e,t,n,i){let o=n.references;l(o)?hk(e,t,o,n.interval,i,G0,sa):(l(n.cartesian)?n.array=h.unpackArray(n.cartesian):l(n.cartographicRadians)?n.array=h.fromRadiansArrayHeights(n.cartographicRadians,ne.default):l(n.cartographicDegrees)&&(n.array=h.fromDegreesArrayHeights(n.cartographicDegrees,ne.default)),l(n.array)&&xe(Array,e,t,n,void 0,void 0,i))}function xP(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)Eue(e,t,n[o],i);else Eue(e,t,n,i)}function W8e(e){return h.unpackArray(e)}function P8e(e){return h.fromRadiansArrayHeights(e,ne.default)}function v8e(e){return h.fromDegreesArrayHeights(e,ne.default)}function Xue(e,t,n,i){let o=n.references;if(l(o)){let r=o.map(function(s){let a={};return hk(a,"positions",s,n.interval,i,G0,sa),a.positions});e[t]=new G0(r)}else l(n.cartesian)?n.array=n.cartesian.map(W8e):l(n.cartographicRadians)?n.array=n.cartographicRadians.map(P8e):l(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(v8e)),l(n.array)&&xe(Array,e,t,n,void 0,void 0,i)}function w8e(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)Xue(e,t,n[o],i);else Xue(e,t,n,i)}function F8e(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;o++)Lue(e,t,n[o],i);else Lue(e,t,n,i)}function A8e(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 Fr),r.addInterval(ar(o[s]));else r=new Fr,r.addInterval(ar(o));e.availability=r}function M8e(e,t,n,i,o){l(t)&&xe(Ng,e,"alignedAxis",t,n,i,o)}function N8e(e,t,n,i){let o=t.billboard;if(!l(o))return;let r=ar(o.interval),s=e.billboard;l(s)||(e.billboard=s=new ec),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(D,s,"pixelOffset",o.pixelOffset,r,i,n),xe(h,s,"eyeOffset",o.eyeOffset,r,i,n),xe(gi,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),xe(Pn,s,"verticalOrigin",o.verticalOrigin,r,i,n),xe(Qe,s,"heightReference",o.heightReference,r,i,n),xe(Y,s,"color",o.color,r,i,n),xe(ku,s,"rotation",o.rotation,r,i,n),M8e(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(kt,s,"scaleByDistance",o.scaleByDistance,r,i,n),xe(kt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),xe(kt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),xe(Ke,s,"imageSubRegion",o.imageSubRegion,r,i,n),xe(Pt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),xe(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function k8e(e,t,n,i){let o=t.box;if(!l(o))return;let r=ar(o.interval),s=e.box;l(s)||(e.box=s=new Vx),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),Gd(s,"material",o.material,r,i,n),xe(Boolean,s,"outline",o.outline,r,i,n),xe(Y,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(_n,s,"shadows",o.shadows,r,i,n),xe(Pt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function U8e(e,t,n,i){let o=t.corridor;if(!l(o))return;let r=ar(o.interval),s=e.corridor;l(s)||(e.corridor=s=new Rx),xe(Boolean,s,"show",o.show,r,i,n),xP(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(Gi,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),Gd(s,"material",o.material,r,i,n),xe(Boolean,s,"outline",o.outline,r,i,n),xe(Y,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(_n,s,"shadows",o.shadows,r,i,n),xe(Pt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),xe(kn,s,"classificationType",o.classificationType,r,i,n),xe(Number,s,"zIndex",o.zIndex,r,i,n)}function D8e(e,t,n,i){let o=t.cylinder;if(!l(o))return;let r=ar(o.interval),s=e.cylinder;l(s)||(e.cylinder=s=new Zx),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),Gd(s,"material",o.material,r,i,n),xe(Boolean,s,"outline",o.outline,r,i,n),xe(Y,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(_n,s,"shadows",o.shadows,r,i,n),xe(Pt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function B8e(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 ue("Cesium only supports CZML version 1.");t._version=n}}if(!l(t._version))throw new ue("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=y(o.interval,r.interval),r.currentTime=y(o.currentTime,r.currentTime),r.range=y(o.range,r.range),r.step=y(o.step,r.step),r.multiplier=y(o.multiplier,r.multiplier)):i.clock={interval:o.interval,currentTime:o.currentTime,range:o.range,step:o.step,multiplier:o.multiplier}}}function Y8e(e,t,n,i){let o=t.ellipse;if(!l(o))return;let r=ar(o.interval),s=e.ellipse;l(s)||(e.ellipse=s=new Gx),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(ku,s,"rotation",o.rotation,r,i,n),xe(ku,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),Gd(s,"material",o.material,r,i,n),xe(Boolean,s,"outline",o.outline,r,i,n),xe(Y,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(_n,s,"shadows",o.shadows,r,i,n),xe(Pt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),xe(kn,s,"classificationType",o.classificationType,r,i,n),xe(Number,s,"zIndex",o.zIndex,r,i,n)}function O8e(e,t,n,i){let o=t.ellipsoid;if(!l(o))return;let r=ar(o.interval),s=e.ellipsoid;l(s)||(e.ellipsoid=s=new Ex),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),Gd(s,"material",o.material,r,i,n),xe(Boolean,s,"outline",o.outline,r,i,n),xe(Y,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(_n,s,"shadows",o.shadows,r,i,n),xe(Pt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function H8e(e,t,n,i){let o=t.label;if(!l(o))return;let r=ar(o.interval),s=e.label;l(s)||(e.label=s=new Vm),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(Y,s,"backgroundColor",o.backgroundColor,r,i,n),xe(D,s,"backgroundPadding",o.backgroundPadding,r,i,n),xe(D,s,"pixelOffset",o.pixelOffset,r,i,n),xe(h,s,"eyeOffset",o.eyeOffset,r,i,n),xe(gi,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),xe(Pn,s,"verticalOrigin",o.verticalOrigin,r,i,n),xe(Qe,s,"heightReference",o.heightReference,r,i,n),xe(Y,s,"fillColor",o.fillColor,r,i,n),xe(Y,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(kt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),xe(kt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),xe(kt,s,"scaleByDistance",o.scaleByDistance,r,i,n),xe(Pt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),xe(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function z8e(e,t,n,i){let o=t.model;if(!l(o))return;let r=ar(o.interval),s=e.model;l(s)||(e.model=s=new Gp),xe(Boolean,s,"show",o.show,r,i,n),xe(yP.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(_n,s,"shadows",o.shadows,r,i,n),xe(Qe,s,"heightReference",o.heightReference,r,i,n),xe(Y,s,"silhouetteColor",o.silhouetteColor,r,i,n),xe(Number,s,"silhouetteSize",o.silhouetteSize,r,i,n),xe(Y,s,"color",o.color,r,i,n),xe(cc,s,"colorBlendMode",o.colorBlendMode,r,i,n),xe(Number,s,"colorBlendAmount",o.colorBlendAmount,r,i,n),xe(Pt,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)Iue(s,d[a],r,i,n);else Iue(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)Wue(s,u[a],r,i,n);else Wue(s,u,r,i,n)}function Iue(e,t,n,i,o){let r=ar(t.interval);l(n)&&(l(r)?r=Vn.intersect(r,n,Y_):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 Cl),s.hasProperty(u)||s.addProperty(u);let p=s[u];l(p)||(s[u]=p=new Xx),xe(h,p,"translation",m.translation,r,i,o),xe(we,p,"rotation",m.rotation,r,i,o),xe(h,p,"scale",m.scale,r,i,o)}}function Wue(e,t,n,i,o){let r=ar(t.interval);l(n)&&(l(r)?r=Vn.intersect(r,n,Y_):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 Cl),s.hasProperty(u)||s.addProperty(u),xe(Number,s,u,m,r,i,o))}}function K8e(e,t,n,i){let o=t.path;if(!l(o))return;let r=ar(o.interval),s=e.path;l(s)||(e.path=s=new Ep),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),Gd(s,"material",o.material,r,i,n),xe(Pt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function J8e(e,t,n,i){let o=t.point;if(!l(o))return;let r=ar(o.interval),s=e.point;l(s)||(e.point=s=new Wx),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(Y,s,"color",o.color,r,i,n),xe(Y,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(kt,s,"scaleByDistance",o.scaleByDistance,r,i,n),xe(kt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),xe(Pt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),xe(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function gP(e){this.polygon=e,this._definitionChanged=new be}Object.defineProperties(gP.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}}});gP.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 Za(o)}))),l(t)?(t.positions=n,t.holes=i,t):new Za(n,i)};gP.prototype.equals=function(e){return this===e||e instanceof gP&&K.equals(this.polygon._positions,e.polygon._positions)&&K.equals(this.polygon._holes,e.polygon._holes)};function Q8e(e,t,n,i){let o=t.polygon;if(!l(o))return;let r=ar(o.interval),s=e.polygon;l(s)||(e.polygon=s=new Lm),xe(Boolean,s,"show",o.show,r,i,n),xP(s,"_positions",o.positions,n),w8e(s,"_holes",o.holes,n),(l(s._positions)||l(s._holes))&&(s.hierarchy=new gP(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(ku,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),Gd(s,"material",o.material,r,i,n),xe(Boolean,s,"outline",o.outline,r,i,n),xe(Y,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(en,s,"arcType",o.arcType,r,i,n),xe(_n,s,"shadows",o.shadows,r,i,n),xe(Pt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),xe(kn,s,"classificationType",o.classificationType,r,i,n),xe(Number,s,"zIndex",o.zIndex,r,i,n)}function j8e(e){return e?en.GEODESIC:en.NONE}function q8e(e,t,n,i){let o=t.polyline;if(!l(o))return;let r=ar(o.interval),s=e.polyline;if(l(s)||(e.polyline=s=new ic),xe(Boolean,s,"show",o.show,r,i,n),xP(s,"positions",o.positions,n),xe(Number,s,"width",o.width,r,i,n),xe(Number,s,"granularity",o.granularity,r,i,n),Gd(s,"material",o.material,r,i,n),Gd(s,"depthFailMaterial",o.depthFailMaterial,r,i,n),xe(en,s,"arcType",o.arcType,r,i,n),xe(Boolean,s,"clampToGround",o.clampToGround,r,i,n),xe(_n,s,"shadows",o.shadows,r,i,n),xe(Pt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),xe(kn,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=p8e(a.followSurface,j8e)}}function $8e(e,t,n,i){let o=t.polylineVolume;if(!l(o))return;let r=ar(o.interval),s=e.polylineVolume;l(s)||(e.polylineVolume=s=new Px),xP(s,"positions",o.positions,n),F8e(s,"shape",o.shape,n),xe(Boolean,s,"show",o.show,r,i,n),xe(Gi,s,"cornerType",o.cornerType,r,i,n),xe(Boolean,s,"fill",o.fill,r,i,n),Gd(s,"material",o.material,r,i,n),xe(Boolean,s,"outline",o.outline,r,i,n),xe(Y,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(_n,s,"shadows",o.shadows,r,i,n),xe(Pt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function e7e(e,t,n,i){let o=t.rectangle;if(!l(o))return;let r=ar(o.interval),s=e.rectangle;l(s)||(e.rectangle=s=new Rm),xe(Boolean,s,"show",o.show,r,i,n),xe(ae,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(ku,s,"rotation",o.rotation,r,i,n),xe(ku,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),Gd(s,"material",o.material,r,i,n),xe(Boolean,s,"outline",o.outline,r,i,n),xe(Y,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(_n,s,"shadows",o.shadows,r,i,n),xe(Pt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),xe(kn,s,"classificationType",o.classificationType,r,i,n),xe(Number,s,"zIndex",o.zIndex,r,i,n)}function t7e(e,t,n,i){let o=t.tileset;if(!l(o))return;let r=ar(o.interval),s=e.tileset;l(s)||(e.tileset=s=new Ix),xe(Boolean,s,"show",o.show,r,i,n),xe(yP.default,s,"uri",o.uri,r,i,n),xe(Number,s,"maximumScreenSpaceError",o.maximumScreenSpaceError,r,i,n)}function n7e(e,t,n,i){let o=t.wall;if(!l(o))return;let r=ar(o.interval),s=e.wall;l(s)||(e.wall=s=new Xp),xe(Boolean,s,"show",o.show,r,i,n),xP(s,"positions",o.positions,n),Gue(s,"minimumHeights",o.minimumHeights,n),Gue(s,"maximumHeights",o.maximumHeights,n),xe(Number,s,"granularity",o.granularity,r,i,n),xe(Boolean,s,"fill",o.fill,r,i,n),Gd(s,"material",o.material,r,i,n),xe(Boolean,s,"outline",o.outline,r,i,n),xe(Y,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(_n,s,"shadows",o.shadows,r,i,n),xe(Pt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function Pue(e,t,n,i,o){let r=e.id;if(l(r)||(r=Bn()),HK=r,!l(o._version)&&r!=="document")throw new ue("The first CZML packet is required to be the document object.");if(e.delete===!0)t.removeById(r);else if(r==="document")B8e(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)}HK=void 0}function i7e(e){let t,n=e._documentPacket.clock;if(!l(n)){if(!l(e._clock)){let o=e._entityCollection.computeAvailability();if(!o.start.equals(De.MINIMUM_VALUE)){let r=o.start,s=o.stop,a=q.secondsDifference(s,r),c=Math.round(a/120);return t=new th,t.startTime=q.clone(r),t.stopTime=q.clone(s),t.clockRange=Mr.LOOP_STOP,t.multiplier=c,t.currentTime=q.clone(r),t.clockStep=mo.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}l(e._clock)?t=e._clock.clone():(t=new th,t.startTime=De.MINIMUM_VALUE.clone(),t.stopTime=De.MAXIMUM_VALUE.clone(),t.currentTime=De.MINIMUM_VALUE.clone(),t.clockRange=Mr.LOOP_STOP,t.clockStep=mo.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=ar(n.interval);return l(i)&&(t.startTime=i.start,t.stopTime=i.stop),l(n.currentTime)&&(t.currentTime=q.fromIso8601(n.currentTime)),l(n.range)&&(t.clockRange=y(Mr[n.range],Mr.LOOP_STOP)),l(n.step)&&(t.clockStep=y(mo[n.step],mo.SYSTEM_CLOCK_MULTIPLIER)),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function Aue(e,t,n,i){n=y(n,y.EMPTY_OBJECT);let o=t,r=n.sourceUri,s=n.credit;if(typeof s=="string"&&(s=new Rt(s)),e._credit=s,typeof t=="string"||t instanceof Ee){t=Ee.createIfNeeded(t),o=t.fetchJson(),r=y(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=Ee.createIfNeeded(r),Ar.setLoading(e,!0),Promise.resolve(o).then(function(a){return o7e(e,a,r,i)}).catch(function(a){return Ar.setLoading(e,!1),e._error.raiseEvent(e,a),console.log(a),Promise.reject(a)})}function o7e(e,t,n,i){Ar.setLoading(e,!0);let o=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new Mue,o.removeAll()),ls._processCzml(t,o,n,void 0,e);let r=i7e(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=R0(n.getUrlComponent()),r=!0),Ar.setLoading(e,!1),r&&e._changed.raiseEvent(e),e}function Mue(){this.name=void 0,this.clock=void 0}function ls(e){this._name=e,this._changed=new be,this._error=new be,this._isLoading=!1,this._loading=new be,this._clock=void 0,this._documentPacket=new Mue,this._version=void 0,this._entityCollection=new ks(this),this._entityCluster=new Cd,this._credit=void 0,this._resourceCredits=[]}ls.load=function(e,t){return new ls().load(e,t)};Object.defineProperties(ls.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}}});ls.updaters=[N8e,k8e,U8e,D8e,Y8e,O8e,H8e,z8e,R8e,Z8e,K8e,J8e,Q8e,q8e,$8e,I8e,e7e,G8e,t7e,E8e,n7e,X8e,A8e];ls.registerUpdater=function(e){ls.updaters.includes(e)||ls.updaters.push(e)};ls.unregisterUpdater=function(e){if(ls.updaters.includes(e)){let t=ls.updaters.indexOf(e);ls.updaters.splice(t,1)}};ls.prototype.process=function(e,t){return Aue(this,e,t,!1)};ls.prototype.load=function(e,t){return Aue(this,e,t,!0)};ls.prototype.update=function(e){return!0};ls.processPacketData=xe;ls.processPositionPacketData=Fue;ls.processMaterialPacketData=Gd;ls._processCzml=function(e,t,n,i,o){if(i=y(i,ls.updaters),Array.isArray(e))for(let r=0,s=e.length;r<s;++r)Pue(e[r],t,i,n,o);else Pue(e,t,i,n,o)};var _P=ls;var Qjn=T(S(),1);function Qc(){this._dataSources=[],this._dataSourceAdded=new be,this._dataSourceRemoved=new be,this._dataSourceMoved=new be}Object.defineProperties(Qc.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}}});Qc.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})};Qc.prototype.remove=function(e,t){t=y(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};Qc.prototype.removeAll=function(e){e=y(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=[]};Qc.prototype.contains=function(e){return this.indexOf(e)!==-1};Qc.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};Qc.prototype.get=function(e){return this._dataSources[e]};Qc.prototype.getByName=function(e){return this._dataSources.filter(function(t){return t.name===e})};function fk(e,t){return e.indexOf(t)}function Nue(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)}Qc.prototype.raise=function(e){let t=fk(this._dataSources,e);Nue(this,t,t+1)};Qc.prototype.lower=function(e){let t=fk(this._dataSources,e);Nue(this,t,t-1)};Qc.prototype.raiseToTop=function(e){let t=fk(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))};Qc.prototype.lowerToBottom=function(e){let t=fk(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};Qc.prototype.isDestroyed=function(){return!1};Qc.prototype.destroy=function(){return this.removeAll(!0),me(this)};var TP=Qc;var Cci=T(S(),1);var l8n=T(S(),1);var i8n=T(S(),1);function la(e){e=y(e,y.EMPTY_OBJECT),this._primitives=[],this._guid=Bn(),this._primitiveAdded=new be,this._primitiveRemoved=new be,this._zIndex=void 0,this.show=y(e.show,!0),this.destroyPrimitives=y(e.destroyPrimitives,!0)}Object.defineProperties(la.prototype,{length:{get:function(){return this._primitives.length}},primitiveAdded:{get:function(){return this._primitiveAdded}},primitiveRemoved:{get:function(){return this._primitiveRemoved}}});la.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};la.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};la.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};la.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=[]};la.prototype.contains=function(e){return!!(l(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function pk(e,t){return e._primitives.indexOf(t)}la.prototype.raise=function(e){if(l(e)){let t=pk(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};la.prototype.raiseToTop=function(e){if(l(e)){let t=pk(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};la.prototype.lower=function(e){if(l(e)){let t=pk(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};la.prototype.lowerToBottom=function(e){if(l(e)){let t=pk(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};la.prototype.get=function(e){return this._primitives[e]};la.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};la.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)}};la.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)}};la.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)}};la.prototype.isDestroyed=function(){return!1};la.prototype.destroy=function(){return this.removeAll(),me(this)};var Al=la;function gf(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(gf.prototype,{length:{get:function(){return this._length}}});gf.prototype.add=function(e,t){t=y(t,0);let n=this._collections[t];if(!l(n)){n=new Al({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};gf.prototype.set=function(e,t){return t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};gf.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};gf.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};gf.prototype.contains=function(e){if(!l(e))return!1;let t=this._collections[e._zIndex];return l(t)&&t.contains(e)};gf.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};gf.prototype.isDestroyed=function(){return!1};gf.prototype.destroy=function(){return this.removeAll(),me(this)};var SP=gf;var Joi=T(S(),1);var f8n=T(S(),1);function F1(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new Lt}F1.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};F1.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);l(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};F1.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};F1.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};F1.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),l(e)&&l(e.getBoundingSphere)?e.getBoundingSphere(t):ft.FAILED};var O_=F1;var eii=T(S(),1);var X7n=T(S(),1);var O8n=T(S(),1);var _8n=T(S(),1);var QK={},bk=new h,kue=new h,Uue=new we,Due=new $;function A1(e,t,n,i,o,r,s,a,c,d){let u=e+t;h.multiplyByScalar(i,Math.cos(u),bk),h.multiplyByScalar(n,Math.sin(u),kue),h.add(bk,kue,bk);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 we.fromAxisAngle(bk,f,Uue),$.fromQuaternion(Uue,Due),$.multiplyByVector(Due,c,d),h.normalize(d,d),h.multiplyByScalar(d,a,d),d}var Bue=new h,Yue=new h,JK=new h,r7e=new h;QK.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,g=h.fromArray(e,u,Bue);i.scaleToGeodeticSurface(g,g);let f=h.clone(g,Yue),x=i.geodeticSurfaceNormal(g,r7e),_=h.multiplyByScalar(x,o,JK);h.add(g,_,g),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]=g.x,a[m]=g.y,a[p]=g.z}return a};var s7e=new h,a7e=new h,c7e=new h;QK.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,s7e),g=h.cross(h.UNIT_Z,s,a7e);g=h.normalize(g,g);let f=h.cross(p,g,c7e),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,E=Bue,X=Yue,v=x*4*3,P=v-1,A=0,M=n?new Array(v):void 0,b,R,G,I,w;for(C=W.PI_OVER_TWO,E=A1(C,r,f,g,c,u,d,m,p,E),t&&(L[Z++]=E.x,L[Z++]=E.y,L[Z++]=E.z),n&&(M[P--]=E.z,M[P--]=E.y,M[P--]=E.x),C=W.PI_OVER_TWO-_,b=1;b<x+1;++b){if(E=A1(C,r,f,g,c,u,d,m,p,E),X=A1(Math.PI-C,r,f,g,c,u,d,m,p,X),t){for(L[Z++]=E.x,L[Z++]=E.y,L[Z++]=E.z,G=2*b+2,R=1;R<G-1;++R)I=R/(G-1),w=h.lerp(E,X,I,JK),L[Z++]=w.x,L[Z++]=w.y,L[Z++]=w.z;L[Z++]=X.x,L[Z++]=X.y,L[Z++]=X.z}n&&(M[P--]=E.z,M[P--]=E.y,M[P--]=E.x,M[A++]=X.x,M[A++]=X.y,M[A++]=X.z),C=W.PI_OVER_TWO-(b+1)*_}for(b=x;b>1;--b){if(C=W.PI_OVER_TWO-(b-1)*_,E=A1(-C,r,f,g,c,u,d,m,p,E),X=A1(C+Math.PI,r,f,g,c,u,d,m,p,X),t){for(L[Z++]=E.x,L[Z++]=E.y,L[Z++]=E.z,G=2*(b-1)+2,R=1;R<G-1;++R)I=R/(G-1),w=h.lerp(E,X,I,JK),L[Z++]=w.x,L[Z++]=w.y,L[Z++]=w.z;L[Z++]=X.x,L[Z++]=X.y,L[Z++]=X.z}n&&(M[P--]=E.z,M[P--]=E.y,M[P--]=E.x,M[A++]=X.x,M[A++]=X.y,M[A++]=X.z)}C=W.PI_OVER_TWO,E=A1(-C,r,f,g,c,u,d,m,p,E);let N={};return t&&(L[Z++]=E.x,L[Z++]=E.y,L[Z++]=E.z,N.positions=L,N.numPts=x),n&&(M[P--]=E.z,M[P--]=E.y,M[P--]=E.x,N.outerPositions=M),N};var Ml=QK;var M1=new h,jK=new h,qK=new h,Oue=new h,Ts=new D,Hue=new $,l7e=new $,$K=new we,zue=new h,Kue=new h,Jue=new h,xk=new he,Que=new h,jue=new D,que=new D;function $ue(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,g=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=zue,V=Kue,L=Jue,Z=new Li(a),E=Z.project(a.cartesianToCartographic(o,xk),Que),X=a.scaleToGeodeticSurface(o,M1);a.geodeticSurfaceNormal(X,X);let v=Hue,P=l7e;if(c!==0){let w=we.fromAxisAngle(X,c,$K);v=$.fromQuaternion(w,v),w=we.fromAxisAngle(X,-c,$K),P=$.fromQuaternion(w,P)}else v=$.clone($.IDENTITY,v),P=$.clone($.IDENTITY,P);let A=D.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,jue),M=D.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,que),b=e.length,R=n?b:0,G=R/3*2;for(let w=0;w<b;w+=3){let N=w+1,B=w+2,U=h.fromArray(e,w,M1);if(i.st){let O=$.multiplyByVector(v,U,jK),k=Z.project(a.cartesianToCartographic(O,xk),qK);h.subtract(k,E,k),Ts.x=(k.x+r)/(2*r),Ts.y=(k.y+s)/(2*s),A.x=Math.min(Ts.x,A.x),A.y=Math.min(Ts.y,A.y),M.x=Math.max(Ts.x,M.x),M.y=Math.max(Ts.y,M.y),n&&(m[_+G]=Ts.x,m[_+1+G]=Ts.y),m[_++]=Ts.x,m[_++]=Ts.y}(i.normal||i.tangent||i.bitangent||u)&&(C=a.geodeticSurfaceNormal(U,C),u&&(x[w+R]=-C.x,x[N+R]=-C.y,x[B+R]=-C.z),(i.normal||i.tangent||i.bitangent)&&((i.tangent||i.bitangent)&&(V=h.normalize(h.cross(h.UNIT_Z,C,V),V),$.multiplyByVector(P,V,V)),i.normal&&(p[w]=C.x,p[N]=C.y,p[B]=C.z,n&&(p[w+R]=-C.x,p[N+R]=-C.y,p[B+R]=-C.z)),i.tangent&&(g[w]=V.x,g[N]=V.y,g[B]=V.z,n&&(g[w+R]=-V.x,g[N+R]=-V.y,g[B+R]=-V.z)),i.bitangent&&(L=h.normalize(h.cross(C,V,L),L),f[w]=L.x,f[N]=L.y,f[B]=L.z,n&&(f[w+R]=L.x,f[N+R]=L.y,f[B+R]=L.z))))}if(i.st){b=m.length;for(let w=0;w<b;w+=2)m[w]=(m[w]-A.x)/(M.x-A.x),m[w+1]=(m[w+1]-A.y)/(M.y-A.y)}let I=new mn;if(i.position){let w=Ml.raisePositionsToHeight(e,t,n);I.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:w})}if(i.st&&(I.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:m})),i.normal&&(I.normal=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(I.tangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:g})),i.bitangent&&(I.bitangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:f})),u&&(I.extrudeDirection=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:x})),n&&l(t.offsetAttribute)){let w=new Uint8Array(d);if(t.offsetAttribute===ln.TOP)w=w.fill(1,0,d/2);else{let N=t.offsetAttribute===ln.NONE?0:1;w=w.fill(N)}I.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:w})}return I}function eme(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 H_=new h;function d7e(e){let t=e.center;H_=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,H_),e.height,H_),H_=h.add(t,H_,H_);let n=new ce(H_,e.semiMajorAxis),i=Ml.computeEllipsePositions(e,!0,!1),o=i.positions,r=i.numPts,s=$ue(o,e,!1),a=eme(r);return a=Ae.createTypedArray(o.length/3,a),{boundingSphere:n,attributes:s,indices:a}}function u7e(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,g=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=zue,Z=Kue,E=Jue,X=new Li(s),v=X.project(s.cartesianToCartographic(i,xk),Que),P=s.scaleToGeodeticSurface(i,M1);s.geodeticSurfaceNormal(P,P);let A=we.fromAxisAngle(P,d,$K),M=$.fromQuaternion(A,Hue),b=D.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,jue),R=D.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,que),G=e.length,I=G/3*2;for(let N=0;N<G;N+=3){let B=N+1,U=N+2,O=h.fromArray(e,N,M1),k;if(n.st){let H=$.multiplyByVector(M,O,jK),te=X.project(s.cartesianToCartographic(H,xk),qK);h.subtract(te,v,te),Ts.x=(te.x+o)/(2*o),Ts.y=(te.y+r)/(2*r),b.x=Math.min(Ts.x,b.x),b.y=Math.min(Ts.y,b.y),R.x=Math.max(Ts.x,R.x),R.y=Math.max(Ts.y,R.y),p[V+I]=Ts.x,p[V+1+I]=Ts.y,p[V++]=Ts.x,p[V++]=Ts.y}O=s.scaleToGeodeticSurface(O,O),k=h.clone(O,jK),L=s.geodeticSurfaceNormal(O,L),_&&(C[N+G]=-L.x,C[B+G]=-L.y,C[U+G]=-L.z);let J=h.multiplyByScalar(L,a,Oue);if(O=h.add(O,J,O),J=h.multiplyByScalar(L,c,J),k=h.add(k,J,k),n.position&&(m[N+G]=k.x,m[B+G]=k.y,m[U+G]=k.z,m[N]=O.x,m[B]=O.y,m[U]=O.z),n.normal||n.tangent||n.bitangent){E=h.clone(L,E);let H=h.fromArray(e,(N+3)%G,Oue);h.subtract(H,O,H);let te=h.subtract(k,O,qK);L=h.normalize(h.cross(te,H,L),L),n.normal&&(g[N]=L.x,g[B]=L.y,g[U]=L.z,g[N+G]=L.x,g[B+G]=L.y,g[U+G]=L.z),n.tangent&&(Z=h.normalize(h.cross(E,L,Z),Z),f[N]=Z.x,f[B]=Z.y,f[U]=Z.z,f[N+G]=Z.x,f[N+1+G]=Z.y,f[N+2+G]=Z.z),n.bitangent&&(x[N]=E.x,x[B]=E.y,x[U]=E.z,x[N+G]=E.x,x[B+G]=E.y,x[U+G]=E.z)}}if(n.st){G=p.length;for(let N=0;N<G;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 mn;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:g})),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===ln.TOP)N=N.fill(1,0,u/2);else{let B=t.offsetAttribute===ln.NONE?0:1;N=N.fill(B)}w.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:N})}return w}function m7e(e){let t=e.length/3,n=Ae.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 gk=new ce,yk=new ce;function h7e(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,M1),e.height,M1);gk.center=h.add(t,o,gk.center),gk.radius=i,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),yk.center=h.add(t,o,yk.center),yk.radius=i;let r=Ml.computeEllipsePositions(e,!0,!0),s=r.positions,a=r.numPts,c=r.outerPositions,d=ce.union(gk,yk),u=$ue(s,e,!0),m=eme(a),p=m.length;m.length=p*2;let g=s.length/3;for(let Z=0;Z<p;Z+=3)m[Z+p]=m[Z+2]+g,m[Z+1+p]=m[Z+1]+g,m[Z+2+p]=m[Z]+g;let f=Ae.createTypedArray(g*2/3,m),x=new ht({attributes:u,indices:f,primitiveType:Fe.TRIANGLES}),_=u7e(c,e);m=m7e(c);let C=Ae.createTypedArray(c.length*2/3,m),V=new ht({attributes:_,indices:C,primitiveType:Fe.TRIANGLES}),L=An.combineInstances([new Vt({geometry:x}),new Vt({geometry:V})]);return{boundingSphere:d,attributes:L[0].attributes,indices:L[0].indices}}function tme(e,t,n,i,o,r,s){let c=Ml.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=ae.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=y(e,y.EMPTY_OBJECT);let t=e.center,n=y(e.ellipsoid,ne.default),i=e.semiMajorAxis,o=e.semiMinorAxis,r=y(e.granularity,W.RADIANS_PER_DEGREE),s=y(e.vertexFormat,Pe.DEFAULT),a=y(e.height,0),c=y(e.extrudedHeight,a);this._center=h.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=ne.clone(n),this._rotation=y(e.rotation,0),this._stRotation=y(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=y(e.shadowVolume,!1),this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}xf.packedLength=h.packedLength+ne.packedLength+Pe.packedLength+9;xf.pack=function(e,t,n){return n=y(n,0),h.pack(e._center,t,n),n+=h.packedLength,ne.pack(e._ellipsoid,t,n),n+=ne.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]=y(e._offsetAttribute,-1),t};var nme=new h,ime=new ne,ome=new Pe,yf={center:nme,ellipsoid:ime,vertexFormat:ome,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=y(t,0);let i=h.unpack(e,t,nme);t+=h.packedLength;let o=ne.unpack(e,t,ime);t+=ne.packedLength;let r=Pe.unpack(e,t,ome);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++],g=e[t++]===1,f=e[t];return l(n)?(n._center=h.clone(i,n._center),n._ellipsoid=ne.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=g,n._offsetAttribute=f===-1?void 0:f,n):(yf.height=u,yf.extrudedHeight=p,yf.granularity=m,yf.stRotation=d,yf.rotation=c,yf.semiMajorAxis=s,yf.semiMinorAxis=a,yf.shadowVolume=g,yf.offsetAttribute=f===-1?void 0:f,new xf(yf))};xf.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.center,i=y(e.ellipsoid,ne.default),o=e.semiMajorAxis,r=e.semiMinorAxis,s=y(e.granularity,W.RADIANS_PER_DEGREE),a=y(e.rotation,0);return tme(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=h7e(o);else if(r=d7e(o),l(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===ln.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 ht({attributes:r.attributes,indices:r.indices,primitiveType:Fe.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 f7e(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=Ml.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 ht._textureCoordinateRotationPoints(r,t,s,a)}Object.defineProperties(xf.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=tme(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=f7e(this)),this._textureCoordinateRotationPoints}}});var jc=xf;var a7n=T(S(),1);var rme=new h,z_=new h;function p7e(e){let t=e.center;z_=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,z_),e.height,z_),z_=h.add(t,z_,z_);let n=new ce(z_,e.semiMajorAxis),i=Ml.computeEllipsePositions(e,!1,!0).outerPositions,o=new mn({position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:Ml.raisePositionsToHeight(i,e,!1)})}),r=i.length/3,s=Ae.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 _k=new ce,Tk=new ce;function b7e(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,rme),e.height,rme);_k.center=h.add(t,o,_k.center),_k.radius=i,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),Tk.center=h.add(t,o,Tk.center),Tk.radius=i;let r=Ml.computeEllipsePositions(e,!1,!0).outerPositions,s=new mn({position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:Ml.raisePositionsToHeight(r,e,!0)})});r=s.position.values;let a=ce.union(_k,Tk),c=r.length/3;if(l(e.offsetAttribute)){let f=new Uint8Array(c);if(e.offsetAttribute===ln.TOP)f=f.fill(1,0,c/2);else{let x=e.offsetAttribute===ln.NONE?0:1;f=f.fill(x)}s.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}let d=y(e.numberOfVerticalLines,16);d=W.clamp(d,0,c/2);let u=Ae.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 g;if(d>0){let f=Math.min(d,c);g=Math.round(c/f);let x=Math.min(g*d,c);for(p=0;p<x;p+=g)u[m++]=p,u[m++]=p+c}return{boundingSphere:a,attributes:s,indices:u}}function N1(e){e=y(e,y.EMPTY_OBJECT);let t=e.center,n=y(e.ellipsoid,ne.default),i=e.semiMajorAxis,o=e.semiMinorAxis,r=y(e.granularity,W.RADIANS_PER_DEGREE),s=y(e.height,0),a=y(e.extrudedHeight,s);this._center=h.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=ne.clone(n),this._rotation=y(e.rotation,0),this._height=Math.max(a,s),this._granularity=r,this._extrudedHeight=Math.min(a,s),this._numberOfVerticalLines=Math.max(y(e.numberOfVerticalLines,16),0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}N1.packedLength=h.packedLength+ne.packedLength+8;N1.pack=function(e,t,n){return n=y(n,0),h.pack(e._center,t,n),n+=h.packedLength,ne.pack(e._ellipsoid,t,n),n+=ne.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]=y(e._offsetAttribute,-1),t};var sme=new h,ame=new ne,P0={center:sme,ellipsoid:ame,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};N1.unpack=function(e,t,n){t=y(t,0);let i=h.unpack(e,t,sme);t+=h.packedLength;let o=ne.unpack(e,t,ame);t+=ne.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=ne.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):(P0.height=c,P0.extrudedHeight=u,P0.granularity=d,P0.rotation=a,P0.semiMajorAxis=r,P0.semiMinorAxis=s,P0.numberOfVerticalLines=m,P0.offsetAttribute=p===-1?void 0:p,new N1(P0))};N1.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=b7e(o);else if(r=p7e(o),l(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===ln.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 ht({attributes:r.attributes,indices:r.indices,primitiveType:Fe.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var Ed=N1;var cme=new Y,lme=h.ZERO,dme=new h,ume=new ae;function g7e(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){On.call(this,{entity:e,scene:t,geometryOptions:new g7e(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}l(Object.create)&&(oh.prototype=Object.create(On.prototype),oh.prototype.constructor=oh);oh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Nn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Yt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,cme)),l(o)||(o=Y.WHITE),i.color=Ht.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=zi.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,lme,dme))),new Vt({id:t,geometry:new jc(this._options),attributes:i})};oh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=K.getValueOrDefault(this._outlineColorProperty,e,Y.BLACK,cme),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ht.fromColor(i),distanceDisplayCondition:Nn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=zi.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,lme,dme))),new Vt({id:t,geometry:new Ed(this._options),attributes:r})};oh.prototype._computeCenter=function(e,t){return K.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)||ni.prototype._isHidden.call(this,e,t)};oh.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!K.isConstant(t.rotation)||!K.isConstant(t.height)||!K.isConstant(t.extrudedHeight)||!K.isConstant(t.granularity)||!K.isConstant(t.stRotation)||!K.isConstant(t.outlineWidth)||!K.isConstant(t.numberOfVerticalLines)||!K.isConstant(t.zIndex)||this._onTerrain&&!K.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Yt)};oh.prototype._setStaticOptions=function(e,t){let n=K.getValueOrUndefined(t.height,De.MINIMUM_VALUE),i=K.getValueOrDefault(t.heightReference,De.MINIMUM_VALUE,Qe.NONE),o=K.getValueOrUndefined(t.extrudedHeight,De.MINIMUM_VALUE),r=K.getValueOrDefault(t.extrudedHeightReference,De.MINIMUM_VALUE,Qe.NONE);l(o)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Yt?dn.VERTEX_FORMAT:oo.MaterialSupport.TEXTURED.vertexFormat,s.center=e.position.getValue(De.MINIMUM_VALUE,s.center),s.semiMajorAxis=t.semiMajorAxis.getValue(De.MINIMUM_VALUE,s.semiMajorAxis),s.semiMinorAxis=t.semiMinorAxis.getValue(De.MINIMUM_VALUE,s.semiMinorAxis),s.rotation=K.getValueOrUndefined(t.rotation,De.MINIMUM_VALUE),s.granularity=K.getValueOrUndefined(t.granularity,De.MINIMUM_VALUE),s.stRotation=K.getValueOrUndefined(t.stRotation,De.MINIMUM_VALUE),s.numberOfVerticalLines=K.getValueOrUndefined(t.numberOfVerticalLines,De.MINIMUM_VALUE),s.offsetAttribute=On.computeGeometryOffsetAttribute(n,i,o,r),s.height=On.getGeometryHeight(n,i),o=On.getGeometryExtrudedHeight(o,r),o===On.CLAMP_TO_GROUND&&(o=ai.getMinimumMaximumHeights(jc.computeRectangle(s,ume)).minimumTerrainHeight),s.extrudedHeight=o};oh.DynamicGeometryUpdater=k1;function k1(e,t,n){ti.call(this,e,t,n)}l(Object.create)&&(k1.prototype=Object.create(ti.prototype),k1.prototype.constructor=k1);k1.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.center)||!l(i.semiMajorAxis)||!l(i.semiMinorAxis)||ti.prototype._isHidden.call(this,e,t,n)};k1.prototype._setOptions=function(e,t,n){let i=this._options,o=K.getValueOrUndefined(t.height,n),r=K.getValueOrDefault(t.heightReference,n,Qe.NONE),s=K.getValueOrUndefined(t.extrudedHeight,n),a=K.getValueOrDefault(t.extrudedHeightReference,n,Qe.NONE);l(s)&&!l(o)&&(o=0),i.center=K.getValueOrUndefined(e.position,n,i.center),i.semiMajorAxis=K.getValueOrUndefined(t.semiMajorAxis,n),i.semiMinorAxis=K.getValueOrUndefined(t.semiMinorAxis,n),i.rotation=K.getValueOrUndefined(t.rotation,n),i.granularity=K.getValueOrUndefined(t.granularity,n),i.stRotation=K.getValueOrUndefined(t.stRotation,n),i.numberOfVerticalLines=K.getValueOrUndefined(t.numberOfVerticalLines,n),i.offsetAttribute=On.computeGeometryOffsetAttribute(o,r,s,a),i.height=On.getGeometryHeight(o,r),s=On.getGeometryExtrudedHeight(s,a),s===On.CLAMP_TO_GROUND&&(s=ai.getMinimumMaximumHeights(jc.computeRectangle(i,ume)).minimumTerrainHeight),i.extrudedHeight=s};var CP=oh;var T6n=T(S(),1);var z7n=T(S(),1);var y7e=new h,x7e=new h,_7e=new h,T7e=new h,S7e=new h,C7e=new h(1,1,1),mme=Math.cos,hme=Math.sin;function v0(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.radii,C7e),n=y(e.innerRadii,t),i=y(e.minimumClock,0),o=y(e.maximumClock,W.TWO_PI),r=y(e.minimumCone,0),s=y(e.maximumCone,W.PI),a=Math.round(y(e.stackPartitions,64)),c=Math.round(y(e.slicePartitions,64)),d=y(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"}v0.packedLength=2*h.packedLength+Pe.packedLength+7;v0.pack=function(e,t,n){return n=y(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]=y(e._offsetAttribute,-1),t};var fme=new h,pme=new h,bme=new Pe,kg={radii:fme,innerRadii:pme,vertexFormat:bme,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};v0.unpack=function(e,t,n){t=y(t,0);let i=h.unpack(e,t,fme);t+=h.packedLength;let o=h.unpack(e,t,pme);t+=h.packedLength;let r=Pe.unpack(e,t,bme);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):(kg.minimumClock=s,kg.maximumClock=a,kg.minimumCone=c,kg.maximumCone=d,kg.stackPartitions=u,kg.slicePartitions=m,kg.offsetAttribute=p===-1?void 0:p,new v0(kg))};v0.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,g=[r],f=[i];for(u=0;u<d;u++)g.push(r+u*(s-r)/(d-1));for(g.push(s),m=0;m<c;m++)f.push(i+m*(o-i)/(c-1));f.push(o);let x=g.length,_=f.length,C=0,V=1,L=n.x!==t.x||n.y!==t.y||n.z!==t.z,Z=!1,E=!1,X=!1;L&&(V=2,r>0&&(Z=!0,C+=c-1),s<Math.PI&&(E=!0,C+=c-1),(o-i)%W.TWO_PI?(X=!0,C+=(d-1)*2+1):C+=1);let v=_*x*V,P=new Float64Array(v*3),A=new Array(v).fill(!1),M=new Array(v).fill(!1),b=c*d*V,R=6*(b+C+1-(c+d)*V),G=Ae.createTypedArray(b,R),I=a.normal?new Float32Array(v*3):void 0,w=a.tangent?new Float32Array(v*3):void 0,N=a.bitangent?new Float32Array(v*3):void 0,B=a.st?new Float32Array(v*2):void 0,U=new Array(x),O=new Array(x);for(u=0;u<x;u++)U[u]=hme(g[u]),O[u]=mme(g[u]);let k=new Array(_),J=new Array(_);for(m=0;m<_;m++)J[m]=mme(f[m]),k[m]=hme(f[m]);for(u=0;u<x;u++)for(m=0;m<_;m++)P[p++]=t.x*U[u]*J[m],P[p++]=t.y*U[u]*k[m],P[p++]=t.z*O[u];let H=v/2;if(L)for(u=0;u<x;u++)for(m=0;m<_;m++)P[p++]=n.x*U[u]*J[m],P[p++]=n.y*U[u]*k[m],P[p++]=n.z*O[u],A[H]=!0,u>0&&u!==x-1&&m!==0&&m!==_-1&&(M[H]=!0),H++;p=0;let te,z;for(u=1;u<x-2;u++)for(te=u*_,z=(u+1)*_,m=1;m<_-2;m++)G[p++]=z+m,G[p++]=z+m+1,G[p++]=te+m+1,G[p++]=z+m,G[p++]=te+m+1,G[p++]=te+m;if(L){let st=x*_;for(u=1;u<x-2;u++)for(te=st+u*_,z=st+(u+1)*_,m=1;m<_-2;m++)G[p++]=z+m,G[p++]=te+m,G[p++]=te+m+1,G[p++]=z+m,G[p++]=te+m+1,G[p++]=z+m+1}let j,ee;if(L){if(Z)for(ee=x*_,u=1;u<_-2;u++)G[p++]=u,G[p++]=u+1,G[p++]=ee+u+1,G[p++]=u,G[p++]=ee+u+1,G[p++]=ee+u;if(E)for(j=x*_-_,ee=x*_*V-_,u=1;u<_-2;u++)G[p++]=j+u+1,G[p++]=j+u,G[p++]=ee+u,G[p++]=j+u+1,G[p++]=ee+u,G[p++]=ee+u+1}if(X){for(u=1;u<x-2;u++)ee=_*x+_*u,j=_*u,G[p++]=ee,G[p++]=j+_,G[p++]=j,G[p++]=ee,G[p++]=ee+_,G[p++]=j+_;for(u=1;u<x-2;u++)ee=_*x+_*(u+1)-1,j=_*(u+1)-1,G[p++]=j+_,G[p++]=ee,G[p++]=j,G[p++]=j+_,G[p++]=ee+_,G[p++]=ee}let fe=new mn;a.position&&(fe.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:P}));let _e=0,le=0,ge=0,Se=0,Ie=v/2,Le,ke=ne.fromCartesian3(t),Be=ne.fromCartesian3(n);if(a.st||a.normal||a.tangent||a.bitangent){for(u=0;u<v;u++){Le=A[u]?Be:ke;let st=h.fromArray(P,u*3,y7e),vt=Le.geodeticSurfaceNormal(st,x7e);if(M[u]&&h.negate(vt,vt),a.st){let Ct=D.negate(vt,S7e);B[_e++]=Math.atan2(Ct.y,Ct.x)/W.TWO_PI+.5,B[_e++]=Math.asin(vt.z)/Math.PI+.5}if(a.normal&&(I[le++]=vt.x,I[le++]=vt.y,I[le++]=vt.z),a.tangent||a.bitangent){let Ct=_7e,Xe=0,je;if(A[u]&&(Xe=Ie),!Z&&u>=Xe&&u<Xe+_*2?je=h.UNIT_X:je=h.UNIT_Z,h.cross(je,vt,Ct),h.normalize(Ct,Ct),a.tangent&&(w[ge++]=Ct.x,w[ge++]=Ct.y,w[ge++]=Ct.z),a.bitangent){let $e=h.cross(vt,Ct,T7e);h.normalize($e,$e),N[Se++]=$e.x,N[Se++]=$e.y,N[Se++]=$e.z}}}a.st&&(fe.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:B})),a.normal&&(fe.normal=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:I})),a.tangent&&(fe.tangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:w})),a.bitangent&&(fe.bitangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:N}))}if(l(e._offsetAttribute)){let st=P.length,vt=e._offsetAttribute===ln.NONE?0:1,Ct=new Uint8Array(st/3).fill(vt);fe.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:Ct})}return new ht({attributes:fe,indices:G,primitiveType:Fe.TRIANGLES,boundingSphere:ce.fromEllipsoid(ke),offsetAttribute:e._offsetAttribute})};var eJ;v0.getUnitEllipsoid=function(){return l(eJ)||(eJ=v0.createGeometry(new v0({radii:new h(1,1,1),vertexFormat:Pe.POSITION_ONLY}))),eJ};var Us=v0;var V7e=new Yt(Y.WHITE),tJ=h.ZERO,nJ=new h,L7e=new h,R7e=new h,iJ=new Y,Z7e=new h(1,1,1);function G7e(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 Xd(e,t){ni.call(this,{entity:e,scene:t,geometryOptions:new G7e(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}l(Object.create)&&(Xd.prototype=Object.create(ni.prototype),Xd.prototype.constructor=Xd);Object.defineProperties(Xd.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Xd.prototype.createFillGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r,s=new xn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),c=Nn.fromDistanceDisplayCondition(a),d={show:s,distanceDisplayCondition:c,color:void 0,offset:void 0};if(this._materialProperty instanceof Yt){let u;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||o)&&(u=this._materialProperty.color.getValue(e,iJ)),l(u)||(u=Y.WHITE),r=Ht.fromColor(u),d.color=r}return l(this._options.offsetAttribute)&&(d.offset=zi.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,tJ,nJ))),new Vt({id:i,geometry:new Us(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:d})};Xd.prototype.createOutlineGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r=K.getValueOrDefault(this._outlineColorProperty,e,Y.BLACK,iJ),s=this._distanceDisplayConditionProperty.getValue(e),a={show:new xn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ht.fromColor(r),distanceDisplayCondition:Nn.fromDistanceDisplayCondition(s),offset:void 0};return l(this._options.offsetAttribute)&&(a.offset=zi.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,tJ,nJ))),new Vt({id:i,geometry:new _d(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:a})};Xd.prototype._computeCenter=function(e,t){return K.getValueOrUndefined(this._entity.position,e,t)};Xd.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.radii)||ni.prototype._isHidden.call(this,e,t)};Xd.prototype._isDynamic=function(e,t){return!e.position.isConstant||!K.isConstant(e.orientation)||!t.radii.isConstant||!K.isConstant(t.innerRadii)||!K.isConstant(t.stackPartitions)||!K.isConstant(t.slicePartitions)||!K.isConstant(t.outlineWidth)||!K.isConstant(t.minimumClock)||!K.isConstant(t.maximumClock)||!K.isConstant(t.minimumCone)||!K.isConstant(t.maximumCone)||!K.isConstant(t.subdivisions)};Xd.prototype._setStaticOptions=function(e,t){let n=K.getValueOrDefault(t.heightReference,De.MINIMUM_VALUE,Qe.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Yt?dn.VERTEX_FORMAT:oo.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(De.MINIMUM_VALUE,i.radii),i.innerRadii=K.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=K.getValueOrUndefined(t.minimumClock,De.MINIMUM_VALUE),i.maximumClock=K.getValueOrUndefined(t.maximumClock,De.MINIMUM_VALUE),i.minimumCone=K.getValueOrUndefined(t.minimumCone,De.MINIMUM_VALUE),i.maximumCone=K.getValueOrUndefined(t.maximumCone,De.MINIMUM_VALUE),i.stackPartitions=K.getValueOrUndefined(t.stackPartitions,De.MINIMUM_VALUE),i.slicePartitions=K.getValueOrUndefined(t.slicePartitions,De.MINIMUM_VALUE),i.subdivisions=K.getValueOrUndefined(t.subdivisions,De.MINIMUM_VALUE),i.offsetAttribute=n!==Qe.NONE?ln.ALL:void 0};Xd.prototype._onEntityPropertyChanged=Ip;Xd.DynamicGeometryUpdater=VP;function VP(e,t,n){ti.call(this,e,t,n),this._scene=e._scene,this._modelMatrix=new F,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)&&(VP.prototype=Object.create(ti.prototype),VP.prototype.constructor=VP);VP.prototype.update=function(e){let t=this._entity,n=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!K.getValueOrDefault(n.show,e,!0)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let i=K.getValueOrUndefined(n.radii,e,L7e),o=l(i)?t.computeModelMatrixForHeightReference(e,n.heightReference,i.z*.5,this._scene.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=K.getValueOrDefault(n.fill,e,!0),s=K.getValueOrDefault(n.outline,e,!1),a=K.getValueOrClonedDefault(n.outlineColor,e,Y.BLACK,iJ),c=Ko.getValue(e,y(n.material,V7e),this._material),d=K.getValueOrUndefined(n.innerRadii,e,R7e),u=K.getValueOrUndefined(n.minimumClock,e),m=K.getValueOrUndefined(n.maximumClock,e),p=K.getValueOrUndefined(n.minimumCone,e),g=K.getValueOrUndefined(n.maximumCone,e),f=K.getValueOrUndefined(n.stackPartitions,e),x=K.getValueOrUndefined(n.slicePartitions,e),_=K.getValueOrUndefined(n.subdivisions,e),C=K.getValueOrDefault(n.outlineWidth,e,1),V=K.getValueOrDefault(n.heightReference,e,Qe.NONE),L=V!==Qe.NONE?ln.ALL:void 0,Z=this._scene.mode,E=Z===oe.SCENE3D&&V===Qe.NONE,X=this._options,v=this._geometryUpdater.shadowsProperty.getValue(e),A=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),M=K.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,tJ,nJ);if(!E||this._lastSceneMode!==Z||!l(this._primitive)||X.stackPartitions!==f||X.slicePartitions!==x||l(d)&&!h.equals(X.innerRadii!==d)||X.minimumClock!==u||X.maximumClock!==m||X.minimumCone!==p||X.maximumCone!==g||X.subdivisions!==_||this._lastOutlineWidth!==C||X.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,X.stackPartitions=f,X.slicePartitions=x,X.subdivisions=_,X.offsetAttribute=L,X.radii=h.clone(E?Z7e:i,X.radii),l(d)?E?X.innerRadii=h.fromElements(d.x/i.x,d.y/i.y,d.z/i.z,X.innerRadii):X.innerRadii=h.clone(d,X.innerRadii):X.innerRadii=void 0,X.minimumClock=u,X.maximumClock=m,X.minimumCone=p,X.maximumCone=g;let G=new oo({material:c,translucent:c.isTranslucent(),closed:!0});X.vertexFormat=G.vertexFormat;let I=this._geometryUpdater.createFillGeometryInstance(e,E,this._modelMatrix);this._primitive=R.add(new En({geometryInstances:I,appearance:G,asynchronous:!1,shadows:v}));let w=this._geometryUpdater.createOutlineGeometryInstance(e,E,this._modelMatrix);this._outlinePrimitive=R.add(new En({geometryInstances:w,appearance:new dn({flat:!0,translucent:w.attributes.color.value[3]!==255,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(C)}}),asynchronous:!1,shadows:v})),this._lastShow=r,this._lastOutlineShow=s,this._lastOutlineColor=Y.clone(a,this._lastOutlineColor),this._lastDistanceDisplayCondition=A,this._lastOffset=h.clone(M,this._lastOffset)}else if(this._primitive.ready){let R=this._primitive,G=this._outlinePrimitive;R.show=!0,G.show=!0,R.appearance.material=c;let I=this._attributes;l(I)||(I=R.getGeometryInstanceAttributes(t),this._attributes=I),r!==this._lastShow&&(I.show=xn.toValue(r,I.show),this._lastShow=r);let w=this._outlineAttributes;l(w)||(w=G.getGeometryInstanceAttributes(t),this._outlineAttributes=w),s!==this._lastOutlineShow&&(w.show=xn.toValue(s,w.show),this._lastOutlineShow=s),Y.equals(a,this._lastOutlineColor)||(w.color=Ht.toValue(a,w.color),Y.clone(a,this._lastOutlineColor)),Pt.equals(A,this._lastDistanceDisplayCondition)||(I.distanceDisplayCondition=Nn.toValue(A,I.distanceDisplayCondition),w.distanceDisplayCondition=Nn.toValue(A,w.distanceDisplayCondition),Pt.clone(A,this._lastDistanceDisplayCondition)),h.equals(M,this._lastOffset)||(I.offset=zi.toValue(M,I.offset),w.offset=zi.toValue(M,I.offset),h.clone(M,this._lastOffset))}E&&(i.x=Math.max(i.x,.001),i.y=Math.max(i.y,.001),i.z=Math.max(i.z,.001),o=F.multiplyByScale(o,i,o),this._primitive.modelMatrix=o,this._outlinePrimitive.modelMatrix=o)};var LP=Xd;var dqn=T(S(),1);var P6n=T(S(),1);function U1(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.vertexFormat,Pe.DEFAULT);this._vertexFormat=t,this._workerName="createPlaneGeometry"}U1.packedLength=Pe.packedLength;U1.pack=function(e,t,n){return n=y(n,0),Pe.pack(e._vertexFormat,t,n),t};var gme=new Pe,E7e={vertexFormat:gme};U1.unpack=function(e,t,n){t=y(t,0);let i=Pe.unpack(e,t,gme);return l(n)?(n._vertexFormat=Pe.clone(i,n._vertexFormat),n):new U1(E7e)};var Sk=new h(-.5,-.5,0),Ck=new h(.5,.5,0);U1.createGeometry=function(e){let t=e._vertexFormat,n=new mn,i,o;if(t.position){if(o=new Float64Array(4*3),o[0]=Sk.x,o[1]=Sk.y,o[2]=0,o[3]=Ck.x,o[4]=Sk.y,o[5]=0,o[6]=Ck.x,o[7]=Ck.y,o[8]=0,o[9]=Sk.x,o[10]=Ck.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 ht({attributes:n,indices:i,primitiveType:Fe.TRIANGLES,boundingSphere:new ce(h.ZERO,Math.sqrt(2))})};var RP=U1;var B6n=T(S(),1);function D1(){this._workerName="createPlaneOutlineGeometry"}D1.packedLength=0;D1.pack=function(e,t){return t};D1.unpack=function(e,t,n){return l(n)?n:new D1};var Ug=new h(-.5,-.5,0),Vk=new h(.5,.5,0);D1.createGeometry=function(){let e=new mn,t=new Uint16Array(4*2),n=new Float64Array(4*3);return n[0]=Ug.x,n[1]=Ug.y,n[2]=Ug.z,n[3]=Vk.x,n[4]=Ug.y,n[5]=Ug.z,n[6]=Vk.x,n[7]=Vk.y,n[8]=Ug.z,n[9]=Ug.x,n[10]=Vk.y,n[11]=Ug.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 ht({attributes:e,indices:t,primitiveType:Fe.LINES,boundingSphere:new ce(h.ZERO,Math.sqrt(2))})};var ZP=D1;var X7e=new h,yme=new Y;function I7e(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function Du(e,t){ni.call(this,{entity:e,scene:t,geometryOptions:new I7e(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}l(Object.create)&&(Du.prototype=Object.create(ni.prototype),Du.prototype.constructor=Du);Du.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Nn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Yt){let g;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(g=this._materialProperty.color.getValue(e,yme)),l(g)||(g=Y.WHITE),o=Ht.fromColor(g),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=K.getValueOrDefault(c.plane,e,d.plane),p=K.getValueOrUndefined(c.dimensions,e,d.dimensions);return d.plane=m,d.dimensions=p,u=oJ(m,p,u,u),new Vt({id:t,geometry:new RP(this._options),modelMatrix:u,attributes:i})};Du.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=K.getValueOrDefault(this._outlineColorProperty,e,Y.BLACK,yme),o=this._distanceDisplayConditionProperty.getValue(e),r=t.plane,s=this._options,a=t.computeModelMatrix(e),c=K.getValueOrDefault(r.plane,e,s.plane),d=K.getValueOrUndefined(r.dimensions,e,s.dimensions);return s.plane=c,s.dimensions=d,a=oJ(c,d,a,a),new Vt({id:t,geometry:new ZP,modelMatrix:a,attributes:{show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ht.fromColor(i),distanceDisplayCondition:Nn.fromDistanceDisplayCondition(o)}})};Du.prototype._isHidden=function(e,t){return!l(t.plane)||!l(t.dimensions)||!l(e.position)||ni.prototype._isHidden.call(this,e,t)};Du.prototype._getIsClosed=function(e){return!1};Du.prototype._isDynamic=function(e,t){return!e.position.isConstant||!K.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!K.isConstant(t.outlineWidth)};Du.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Yt,i=this._options;i.vertexFormat=n?dn.VERTEX_FORMAT:oo.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(De.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(De.MINIMUM_VALUE,i.dimensions)};Du.DynamicGeometryUpdater=B1;function B1(e,t,n){ti.call(this,e,t,n)}l(Object.create)&&(B1.prototype=Object.create(ti.prototype),B1.prototype.constructor=B1);B1.prototype._isHidden=function(e,t,n){let i=this._options,o=K.getValueOrUndefined(e.position,n,X7e);return!l(o)||!l(i.plane)||!l(i.dimensions)||ti.prototype._isHidden.call(this,e,t,n)};B1.prototype._setOptions=function(e,t,n){let i=this._options;i.plane=K.getValueOrDefault(t.plane,n,i.plane),i.dimensions=K.getValueOrUndefined(t.dimensions,n,i.dimensions)};var W7e=new h,P7e=new h,v7e=new h,w7e=new h,F7e=new $,A7e=new $,M7e=new F;function oJ(e,t,n,i){let o=e.normal,r=e.distance,s=h.multiplyByScalar(o,-r,v7e),a=h.clone(h.UNIT_Z,P7e);W.equalsEpsilon(Math.abs(h.dot(a,o)),1,W.EPSILON8)&&(a=h.clone(h.UNIT_Y,a));let c=h.cross(a,o,W7e);a=h.cross(o,c,a),h.normalize(c,c),h.normalize(a,a);let d=F7e;$.setColumn(d,0,c,d),$.setColumn(d,1,a,d),$.setColumn(d,2,o,d);let u=h.fromElements(t.x,t.y,1,w7e),m=$.multiplyByScale(d,u,A7e),p=F.fromRotationTranslation(m,s,M7e);return F.multiplyTransformation(n,p,i)}Du.createPrimitiveMatrix=oJ;var GP=Du;var W$n=T(S(),1);var wqn=T(S(),1);var N7e=new h,k7e=new Ke,U7e=new D,D7e=new D,B7e=new h,Y7e=new h,O7e=new h,EP=new h,H7e=new h,z7e=new h,xme=new we,K7e=new $,J7e=new $,Q7e=new h;function j7e(e,t,n,i,o,r,s,a,c){let d=e.positions,u=ri.triangulate(e.positions2D,e.holes);u.length<3&&(u=[0,1,2]);let m=Ae.createTypedArray(d.length,u.length);m.set(u);let p=K7e;if(i!==0){let b=we.fromAxisAngle(s,i,xme);if(p=$.fromQuaternion(b,p),t.tangent||t.bitangent){b=we.fromAxisAngle(s,-i,xme);let R=$.fromQuaternion(b,J7e);a=h.normalize($.multiplyByVector(R,a,a),a),t.bitangent&&(c=h.normalize(h.cross(s,a,c),c))}}else p=$.clone($.IDENTITY,p);let g=D7e;t.st&&(g.x=n.x,g.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,E=0,X=0,v=0,P=0,A=0;for(let b=0;b<f;b++){let R=d[b];if(_[E++]=R.x,_[E++]=R.y,_[E++]=R.z,t.st)if(l(o)&&o.positions.length===f)Z[A++]=o.positions[b].x,Z[A++]=o.positions[b].y;else{let G=$.multiplyByVector(p,R,N7e),I=r(G,U7e);D.subtract(I,g,I);let w=W.clamp(I.x/n.width,0,1),N=W.clamp(I.y/n.height,0,1);Z[A++]=w,Z[A++]=N}t.normal&&(C[X++]=s.x,C[X++]=s.y,C[X++]=s.z),t.tangent&&(V[P++]=a.x,V[P++]=a.y,V[P++]=a.z),t.bitangent&&(L[v++]=c.x,L[v++]=c.y,L[v++]=c.z)}let M=new mn;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 ht({attributes:M,indices:m,primitiveType:Fe.TRIANGLES})}function K_(e){e=y(e,y.EMPTY_OBJECT);let t=e.polygonHierarchy,n=e.textureCoordinates,i=y(e.vertexFormat,Pe.DEFAULT);this._vertexFormat=Pe.clone(i),this._polygonHierarchy=t,this._stRotation=y(e.stRotation,0),this._ellipsoid=ne.clone(y(e.ellipsoid,ne.default)),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=Dn.computeHierarchyPackedLength(t,h)+Pe.packedLength+ne.packedLength+(l(n)?Dn.computeHierarchyPackedLength(n,D):1)+2}K_.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new K_(t)};K_.pack=function(e,t,n){return n=y(n,0),n=Dn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,Pe.pack(e._vertexFormat,t,n),n+=Pe.packedLength,t[n++]=e._stRotation,l(e._textureCoordinates)?n=Dn.packPolygonHierarchy(e._textureCoordinates,t,n,D):t[n++]=-1,t[n++]=e.packedLength,t};var q7e=ne.clone(ne.UNIT_SPHERE),$7e=new Pe,e6e={polygonHierarchy:{}};K_.unpack=function(e,t,n){t=y(t,0);let i=Dn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=ne.unpack(e,t,q7e);t+=ne.packedLength;let r=Pe.unpack(e,t,$7e);t+=Pe.packedLength;let s=e[t++],a=e[t]===-1?void 0:Dn.unpackPolygonHierarchy(e,t,D);l(a)?(t=a.startingIndex,delete a.startingIndex):t++;let c=e[t++];return l(n)||(n=new K_(e6e)),n._polygonHierarchy=i,n._ellipsoid=ne.clone(o,n._ellipsoid),n._vertexFormat=Pe.clone(r,n._vertexFormat),n._stRotation=s,n._textureCoordinates=a,n.packedLength=c,n};K_.createGeometry=function(e){let t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,o=e._textureCoordinates,r=l(o),s=n.positions;if(s=xo(s,h.equalsEpsilon,!0),s.length<3)return;let a=B7e,c=Y7e,d=O7e,u=H7e,m=z7e;if(!m0.computeProjectTo2DArguments(s,EP,u,m))return;if(a=h.cross(u,m,a),a=h.normalize(a,a),!h.equalsEpsilon(EP,h.ZERO,W.EPSILON6)){let A=e._ellipsoid.geodeticSurfaceNormal(EP,Q7e);h.dot(a,A)<0&&(a=h.negate(a,a),u=h.negate(u,u))}let g=m0.createProjectPointsTo2DFunction(EP,u,m),f=m0.createProjectPointTo2DFunction(EP,u,m);t.tangent&&(c=h.clone(u,c)),t.bitangent&&(d=h.clone(m,d));let x=Dn.polygonsFromHierarchy(n,r,g,!1),_=x.hierarchy,C=x.polygons,V=function(A){return A},L=r?Dn.polygonsFromHierarchy(o,!0,V,!1).polygons:void 0;if(_.length===0)return;s=_[0].outerRing;let Z=ce.fromPoints(s),E=Dn.computeBoundingRectangle(a,f,s,i,k7e),X=[];for(let A=0;A<C.length;A++){let M=new Vt({geometry:j7e(C[A],t,E,i,r?L[A]:void 0,f,a,c,d)});X.push(M)}let v=An.combineInstances(X)[0];v.attributes.position.values=new Float64Array(v.attributes.position.values),v.indices=Ae.createTypedArray(v.attributes.position.values.length/3,v.indices);let P=v.attributes;return t.position||delete P.position,new ht({attributes:P,indices:v.indices,primitiveType:v.primitiveType,boundingSphere:Z})};var XP=K_;var i$n=T(S(),1);var _me=[],Lk=[];function t6e(e,t,n,i,o){let s=Br.fromPoints(t,e).projectPointsOntoPlane(t,_me);ri.computeWindingOrder2D(s)===os.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===en.GEODESIC)for(d=0;d<u;d++)f+=Dn.subdivideLineCount(t[d],t[(d+1)%u],n);else if(o===en.RHUMB)for(d=0;d<u;d++)f+=Dn.subdivideRhumbLineCount(e,t[d],t[(d+1)%u],n);for(c=new Float64Array(f*3),d=0;d<u;d++){let x;o===en.GEODESIC?x=Dn.subdivideLine(t[d],t[(d+1)%u],n,Lk):o===en.RHUMB&&(x=Dn.subdivideRhumbLine(e,t[d],t[(d+1)%u],n,Lk));let _=x.length;for(let C=0;C<_;++C)c[m++]=x[C]}}u=c.length/3;let p=u*2,g=Ae.createTypedArray(u,p);for(m=0,d=0;d<u-1;d++)g[m++]=d,g[m++]=d+1;return g[m++]=u-1,g[m++]=0,new Vt({geometry:new ht({attributes:new mn({position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:c})}),indices:g,primitiveType:Fe.LINES})})}function n6e(e,t,n,i,o){let s=Br.fromPoints(t,e).projectPointsOntoPlane(t,_me);ri.computeWindingOrder2D(s)===os.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===en.GEODESIC)for(d=0;d<u;d++)_+=Dn.subdivideLineCount(t[d],t[(d+1)%u],n);else if(o===en.RHUMB)for(d=0;d<u;d++)_+=Dn.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===en.GEODESIC?C=Dn.subdivideLine(t[d],t[(d+1)%u],n,Lk):o===en.RHUMB&&(C=Dn.subdivideRhumbLine(e,t[d],t[(d+1)%u],n,Lk));let V=C.length;for(let L=0;L<V;++L)c[p++]=C[L]}}u=c.length/(3*2);let g=m.length,f=(u*2+g)*2,x=Ae.createTypedArray(u+g,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<g;d++){let _=m[d];x[p++]=_,x[p++]=_+u}return new Vt({geometry:new ht({attributes:new mn({position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:c})}),indices:x,primitiveType:Fe.LINES})})}function J_(e){let t=e.polygonHierarchy,n=y(e.ellipsoid,ne.default),i=y(e.granularity,W.RADIANS_PER_DEGREE),o=y(e.perPositionHeight,!1),r=o&&l(e.extrudedHeight),s=y(e.arcType,en.GEODESIC),a=y(e.height,0),c=y(e.extrudedHeight,a);if(!r){let d=Math.max(a,c);c=Math.min(a,c),a=d}this._ellipsoid=ne.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=Dn.computeHierarchyPackedLength(t,h)+ne.packedLength+8}J_.pack=function(e,t,n){return n=y(n,0),n=Dn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),ne.pack(e._ellipsoid,t,n),n+=ne.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++]=y(e._offsetAttribute,-1),t[n]=e.packedLength,t};var i6e=ne.clone(ne.UNIT_SPHERE),o6e={polygonHierarchy:{}};J_.unpack=function(e,t,n){t=y(t,0);let i=Dn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=ne.unpack(e,t,i6e);t+=ne.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 J_(o6e)),n._polygonHierarchy=i,n._ellipsoid=ne.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};J_.fromPositions=function(e){e=y(e,y.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 J_(t)};J_.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,o=e._perPositionHeight,r=e._arcType,s=Dn.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),g,f;if(p)for(f=0;f<s.length;f++){if(a=n6e(t,s[f],d,o,r),a.geometry=Dn.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===ln.TOP?V=V.fill(1,0,C/2):(g=e._offsetAttribute===ln.NONE?0:1,V=V.fill(g)),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=t6e(t,s[f],d,o,r),a.geometry.attributes.position.values=ri.scaleToGeodeticHeight(a.geometry.attributes.position.values,u,t,!o),l(e._offsetAttribute)){let C=a.geometry.attributes.position.values.length;g=e._offsetAttribute===ln.NONE?0:1;let V=new Uint8Array(C/3).fill(g);a.geometry.attributes.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:V})}c.push(a)}let x=An.combineInstances(c)[0],_=ce.fromVertices(x.attributes.position.values);return new ht({attributes:x.attributes,indices:x.indices,primitiveType:x.primitiveType,boundingSphere:_,offsetAttribute:e._offsetAttribute})};var IP=J_;var Tme="Entity polygons cannot have both height and perPositionHeight.  height will be ignored",Sme="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",Cme=new Y,Vme=h.ZERO,Lme=new h,Rme=new ae,r6e=[],s6e=new D;function a6e(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 Id(e,t){On.call(this,{entity:e,scene:t,geometryOptions:new a6e(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}l(Object.create)&&(Id.prototype=Object.create(On.prototype),Id.prototype.constructor=Id);Id.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Nn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Yt){let s;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,Cme)),l(s)||(s=Y.WHITE),o.color=Ht.fromColor(s)}l(i.offsetAttribute)&&(o.offset=zi.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,Vme,Lme)));let r;return i.perPositionHeight&&!l(i.extrudedHeight)?r=new XP(i):r=new Op(i),new Vt({id:t,geometry:r,attributes:o})};Id.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o=K.getValueOrDefault(this._outlineColorProperty,e,Y.BLACK,Cme),r=this._distanceDisplayConditionProperty.getValue(e),s={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ht.fromColor(o),distanceDisplayCondition:Nn.fromDistanceDisplayCondition(r),offset:void 0};l(i.offsetAttribute)&&(s.offset=zi.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,Vme,Lme)));let a;return i.perPositionHeight&&!l(i.extrudedHeight)?a=new wu(i):a=new IP(i),new Vt({id:t,geometry:a,attributes:s})};Id.prototype._computeCenter=function(e,t){let n=K.getValueOrUndefined(this._entity.polygon.hierarchy,e);if(!l(n))return;let i=n.positions;if(i.length===0)return;let o=this._scene.ellipsoid,r=Br.fromPoints(i,o),s=r.projectPointsOntoPlane(i,r6e),a=s.length,c=0,d=a-1,u=new D;for(let p=0;p<a;d=p++){let g=s[p],f=s[d],x=g.x*f.y-f.x*g.y,_=D.add(g,f,s6e);_=D.multiplyByScalar(_,x,_),u=D.add(u,_,u),c+=x}let m=1/(c*3);return u=D.multiplyByScalar(u,m,u),r.projectPointOntoEllipsoid(u,t)};Id.prototype._isHidden=function(e,t){return!l(t.hierarchy)||ni.prototype._isHidden.call(this,e,t)};Id.prototype._isOnTerrain=function(e,t){let n=On.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,o=l(i)&&(i.isConstant?i.getValue(De.MINIMUM_VALUE):!0);return n&&!o};Id.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!K.isConstant(t.height)||!K.isConstant(t.extrudedHeight)||!K.isConstant(t.granularity)||!K.isConstant(t.stRotation)||!K.isConstant(t.textureCoordinates)||!K.isConstant(t.outlineWidth)||!K.isConstant(t.perPositionHeight)||!K.isConstant(t.closeTop)||!K.isConstant(t.closeBottom)||!K.isConstant(t.zIndex)||!K.isConstant(t.arcType)||this._onTerrain&&!K.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Yt)};Id.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Yt,i=this._options;i.vertexFormat=n?dn.VERTEX_FORMAT:oo.MaterialSupport.TEXTURED.vertexFormat;let o=t.hierarchy.getValue(De.MINIMUM_VALUE),r=K.getValueOrUndefined(t.height,De.MINIMUM_VALUE),s=K.getValueOrDefault(t.heightReference,De.MINIMUM_VALUE,Qe.NONE),a=K.getValueOrUndefined(t.extrudedHeight,De.MINIMUM_VALUE),c=K.getValueOrDefault(t.extrudedHeightReference,De.MINIMUM_VALUE,Qe.NONE),d=K.getValueOrDefault(t.perPositionHeight,De.MINIMUM_VALUE,!1);r=On.getGeometryHeight(r,s);let u;if(d?(l(r)&&(r=void 0,Nt(Tme)),s!==Qe.NONE&&d&&(r=void 0,Nt(Sme))):(l(a)&&!l(r)&&(r=0),u=On.computeGeometryOffsetAttribute(r,s,a,c)),i.polygonHierarchy=o,i.granularity=K.getValueOrUndefined(t.granularity,De.MINIMUM_VALUE),i.stRotation=K.getValueOrUndefined(t.stRotation,De.MINIMUM_VALUE),i.perPositionHeight=d,i.closeTop=K.getValueOrDefault(t.closeTop,De.MINIMUM_VALUE,!0),i.closeBottom=K.getValueOrDefault(t.closeBottom,De.MINIMUM_VALUE,!0),i.offsetAttribute=u,i.height=r,i.arcType=K.getValueOrDefault(t.arcType,De.MINIMUM_VALUE,en.GEODESIC),i.textureCoordinates=K.getValueOrUndefined(t.textureCoordinates,De.MINIMUM_VALUE),a=On.getGeometryExtrudedHeight(a,c),a===On.CLAMP_TO_GROUND){let m=Op.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,Rme);a=ai.getMinimumMaximumHeights(m).minimumTerrainHeight}i.extrudedHeight=a};Id.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)};Id.DynamicGeometryUpdater=Y1;function Y1(e,t,n){ti.call(this,e,t,n)}l(Object.create)&&(Y1.prototype=Object.create(ti.prototype),Y1.prototype.constructor=Y1);Y1.prototype._isHidden=function(e,t,n){return!l(this._options.polygonHierarchy)||ti.prototype._isHidden.call(this,e,t,n)};Y1.prototype._setOptions=function(e,t,n){let i=this._options;i.polygonHierarchy=K.getValueOrUndefined(t.hierarchy,n);let o=K.getValueOrUndefined(t.height,n),r=K.getValueOrDefault(t.heightReference,n,Qe.NONE),s=K.getValueOrDefault(t.extrudedHeightReference,n,Qe.NONE),a=K.getValueOrUndefined(t.extrudedHeight,n),c=K.getValueOrUndefined(t.perPositionHeight,n);o=On.getGeometryHeight(o,s);let d;if(c?(l(o)&&(o=void 0,Nt(Tme)),r!==Qe.NONE&&c&&(o=void 0,Nt(Sme))):(l(a)&&!l(o)&&(o=0),d=On.computeGeometryOffsetAttribute(o,r,a,s)),i.granularity=K.getValueOrUndefined(t.granularity,n),i.stRotation=K.getValueOrUndefined(t.stRotation,n),i.textureCoordinates=K.getValueOrUndefined(t.textureCoordinates,n),i.perPositionHeight=K.getValueOrUndefined(t.perPositionHeight,n),i.closeTop=K.getValueOrDefault(t.closeTop,n,!0),i.closeBottom=K.getValueOrDefault(t.closeBottom,n,!0),i.offsetAttribute=d,i.height=o,i.arcType=K.getValueOrDefault(t.arcType,n,en.GEODESIC),a=On.getGeometryExtrudedHeight(a,s),a===On.CLAMP_TO_GROUND){let u=Op.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,Rme);a=ai.getMinimumMaximumHeights(u).minimumTerrainHeight}i.extrudedHeight=a};var WP=Id;var kei=T(S(),1);var nei=T(S(),1);function c6e(e,t,n,i){let o=new mn;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=ri.triangulate(t),d=(a-1)*r*6+c.length*2,u=Ae.createTypedArray(s,d),m,p,g,f,x,_,C=r*2,V=0;for(m=0;m<a-1;m++){for(p=0;p<r-1;p++)g=p*2+m*r*2,_=g+C,f=g+1,x=f+C,u[V++]=f,u[V++]=g,u[V++]=x,u[V++]=x,u[V++]=g,u[V++]=_;g=r*2-2+m*r*2,f=g+1,x=f+C,_=g+C,u[V++]=f,u[V++]=g,u[V++]=x,u[V++]=x,u[V++]=g,u[V++]=_}if(i.st||i.tangent||i.bitangent){let E=new Float32Array(s*2),X=1/(a-1),v=1/n.height,P=n.height/2,A,M,b=0;for(m=0;m<a;m++){for(A=m*X,M=v*(t[0].y+P),E[b++]=A,E[b++]=M,p=1;p<r;p++)M=v*(t[p].y+P),E[b++]=A,E[b++]=M,E[b++]=A,E[b++]=M;M=v*(t[0].y+P),E[b++]=A,E[b++]=M}for(p=0;p<r;p++)A=0,M=v*(t[p].y+P),E[b++]=A,E[b++]=M;for(p=0;p<r;p++)A=(a-1)*X,M=v*(t[p].y+P),E[b++]=A,E[b++]=M;o.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:new Float32Array(E)})}let L=s-r*2;for(m=0;m<c.length;m+=3){let E=c[m]+L,X=c[m+1]+L,v=c[m+2]+L;u[V++]=E,u[V++]=X,u[V++]=v,u[V++]=v+r,u[V++]=X+r,u[V++]=E+r}let Z=new ht({attributes:o,indices:u,boundingSphere:ce.fromVertices(e),primitiveType:Fe.TRIANGLES});if(i.normal&&(Z=An.computeNormal(Z)),i.tangent||i.bitangent){try{Z=An.computeTangentAndBitangent(Z)}catch{Nt("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 vP(e){e=y(e,y.EMPTY_OBJECT);let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=ne.clone(y(e.ellipsoid,ne.default)),this._cornerType=y(e.cornerType,Gi.ROUNDED),this._vertexFormat=Pe.clone(y(e.vertexFormat,Pe.DEFAULT)),this._granularity=y(e.granularity,W.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*D.packedLength,this.packedLength=i+ne.packedLength+Pe.packedLength+2}vP.pack=function(e,t,n){n=y(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+=D.packedLength)D.pack(s[i],t,n);return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,Pe.pack(e._vertexFormat,t,n),n+=Pe.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Zme=ne.clone(ne.UNIT_SPHERE),Gme=new Pe,PP={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Zme,vertexFormat:Gme,cornerType:void 0,granularity:void 0};vP.unpack=function(e,t,n){t=y(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+=D.packedLength)s[i]=D.unpack(e,t);let a=ne.unpack(e,t,Zme);t+=ne.packedLength;let c=Pe.unpack(e,t,Gme);t+=Pe.packedLength;let d=e[t++],u=e[t];return l(n)?(n._positions=r,n._shape=s,n._ellipsoid=ne.clone(a,n._ellipsoid),n._vertexFormat=Pe.clone(c,n._vertexFormat),n._cornerType=d,n._granularity=u,n):(PP.polylinePositions=r,PP.shapePositions=s,PP.cornerType=d,PP.granularity=u,new vP(PP))};var l6e=new Ke;vP.createGeometry=function(e){let t=e._positions,n=xo(t,h.equalsEpsilon),i=e._shape;if(i=Qm.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;ri.computeWindingOrder2D(i)===os.CLOCKWISE&&i.reverse();let o=Ke.fromPoints(i,l6e),r=Qm.computePositions(n,i,o,e,!0);return c6e(r,i,o,e._vertexFormat)};var wP=vP;var Cei=T(S(),1);function d6e(e,t){let n=new mn;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=Ae.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 g=i*c,f=g+i;for(d=0;d<i;d++)a[u++]=d+g,a[u++]=d+f}return new ht({attributes:n,indices:Ae.createTypedArray(o,a),boundingSphere:ce.fromVertices(e),primitiveType:Fe.LINES})}function AP(e){e=y(e,y.EMPTY_OBJECT);let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=ne.clone(y(e.ellipsoid,ne.default)),this._cornerType=y(e.cornerType,Gi.ROUNDED),this._granularity=y(e.granularity,W.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*D.packedLength,this.packedLength=i+ne.packedLength+2}AP.pack=function(e,t,n){n=y(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+=D.packedLength)D.pack(s[i],t,n);return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Eme=ne.clone(ne.UNIT_SPHERE),FP={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Eme,height:void 0,cornerType:void 0,granularity:void 0};AP.unpack=function(e,t,n){t=y(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+=D.packedLength)s[i]=D.unpack(e,t);let a=ne.unpack(e,t,Eme);t+=ne.packedLength;let c=e[t++],d=e[t];return l(n)?(n._positions=r,n._shape=s,n._ellipsoid=ne.clone(a,n._ellipsoid),n._cornerType=c,n._granularity=d,n):(FP.polylinePositions=r,FP.shapePositions=s,FP.cornerType=c,FP.granularity=d,new AP(FP))};var u6e=new Ke;AP.createGeometry=function(e){let t=e._positions,n=xo(t,h.equalsEpsilon),i=e._shape;if(i=Qm.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;ri.computeWindingOrder2D(i)===os.CLOCKWISE&&i.reverse();let o=Ke.fromPoints(i,u6e),r=Qm.computePositions(n,i,o,e,!1);return d6e(r,i)};var MP=AP;var Xme=new Y;function m6e(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 _f(e,t){ni.call(this,{entity:e,scene:t,geometryOptions:new m6e(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}l(Object.create)&&(_f.prototype=Object.create(ni.prototype),_f.prototype.constructor=_f);_f.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Nn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Yt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,Xme)),l(c)||(c=Y.WHITE),o=Ht.fromColor(c),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new Vt({id:t,geometry:new wP(this._options),attributes:i})};_f.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=K.getValueOrDefault(this._outlineColorProperty,e,Y.BLACK,Xme),o=this._distanceDisplayConditionProperty.getValue(e);return new Vt({id:t,geometry:new MP(this._options),attributes:{show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ht.fromColor(i),distanceDisplayCondition:Nn.fromDistanceDisplayCondition(o)}})};_f.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.shape)||ni.prototype._isHidden.call(this,e,t)};_f.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!K.isConstant(t.granularity)||!K.isConstant(t.outlineWidth)||!K.isConstant(t.cornerType)};_f.prototype._setStaticOptions=function(e,t){let n=t.granularity,i=t.cornerType,o=this._options,r=this._materialProperty instanceof Yt;o.vertexFormat=r?dn.VERTEX_FORMAT:oo.MaterialSupport.TEXTURED.vertexFormat,o.polylinePositions=t.positions.getValue(De.MINIMUM_VALUE,o.polylinePositions),o.shapePositions=t.shape.getValue(De.MINIMUM_VALUE,o.shape),o.granularity=l(n)?n.getValue(De.MINIMUM_VALUE):void 0,o.cornerType=l(i)?i.getValue(De.MINIMUM_VALUE):void 0};_f.DynamicGeometryUpdater=O1;function O1(e,t,n){ti.call(this,e,t,n)}l(Object.create)&&(O1.prototype=Object.create(ti.prototype),O1.prototype.constructor=O1);O1.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.polylinePositions)||!l(i.shapePositions)||ti.prototype._isHidden.call(this,e,t,n)};O1.prototype._setOptions=function(e,t,n){let i=this._options;i.polylinePositions=K.getValueOrUndefined(t.positions,n,i.polylinePositions),i.shapePositions=K.getValueOrUndefined(t.shape,n),i.granularity=K.getValueOrUndefined(t.granularity,n),i.cornerType=K.getValueOrUndefined(t.cornerType,n)};var NP=_f;var Ati=T(S(),1);var mti=T(S(),1);var rJ=new h,Pme=new h,vme=new h,wme=new h,Fme=new ae,h6e=new D,f6e=new ce,p6e=new ce;function Ame(e,t){let n=new ht({attributes:new mn,primitiveType:Fe.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 b6e(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=wme,u=vme,m=Pme;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<o;p+=3){let g=h.fromArray(e,p,rJ),f=c+1,x=c+2;m=n.geodeticSurfaceNormal(g,m),(t.tangent||t.bitangent)&&(h.cross(h.UNIT_Z,m,u),$.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 Ame(t,{positions:e,normals:r,tangents:s,bitangents:a})}var sJ=new h,Mme=new h;function g6e(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=wme,p=vme,g=Pme;if(t.normal||t.tangent||t.bitangent)for(let f=0;f<i;f+=6){let x=h.fromArray(e,f,rJ),_=h.fromArray(e,(f+6)%i,sJ);if(u){let C=h.fromArray(e,(f+3)%i,Mme);h.subtract(_,x,_),h.subtract(C,x,C),g=h.normalize(h.cross(C,_,g),g),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,g,p),p))),t.normal&&(o[a++]=g.x,o[a++]=g.y,o[a++]=g.z,o[a++]=g.x,o[a++]=g.y,o[a++]=g.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 Ame(t,{positions:e,normals:o,tangents:r,bitangents:s})}function Nme(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,g=n.st?new Float32Array(m*2):void 0,f=0,x=0,_=rJ,C=h6e,V=Number.MAX_VALUE,L=Number.MAX_VALUE,Z=-Number.MAX_VALUE,E=-Number.MAX_VALUE;for(let R=c;R<d;++R)for(let G=0;G<r;++G)xs.computePosition(t,i,n.st,R,G,_,C),p[f++]=_.x,p[f++]=_.y,p[f++]=_.z,n.st&&(g[x++]=C.x,g[x++]=C.y,V=Math.min(V,C.x),L=Math.min(L,C.y),Z=Math.max(Z,C.x),E=Math.max(E,C.y));if(s&&(xs.computePosition(t,i,n.st,0,0,_,C),p[f++]=_.x,p[f++]=_.y,p[f++]=_.z,n.st&&(g[x++]=C.x,g[x++]=C.y,V=C.x,L=C.y,Z=C.x,E=C.y)),a&&(xs.computePosition(t,i,n.st,o-1,0,_,C),p[f++]=_.x,p[f++]=_.y,p[f]=_.z,n.st&&(g[x++]=C.x,g[x]=C.y,V=Math.min(V,C.x),L=Math.min(L,C.y),Z=Math.max(Z,C.x),E=Math.max(E,C.y))),n.st&&(V<0||L<0||Z>1||E>1))for(let R=0;R<g.length;R+=2)g[R]=(g[R]-V)/(Z-V),g[R+1]=(g[R+1]-L)/(E-L);let X=b6e(p,n,i,t.tangentRotationMatrix),v=6*(r-1)*(u-1);s&&(v+=3*(r-1)),a&&(v+=3*(r-1));let P=Ae.createTypedArray(m,v),A=0,M=0,b;for(b=0;b<u-1;++b){for(let R=0;R<r-1;++R){let G=A,I=G+r,w=I+1,N=G+1;P[M++]=G,P[M++]=I,P[M++]=N,P[M++]=N,P[M++]=I,P[M++]=w,++A}++A}if(s||a){let R=m-1,G=m-1;s&&a&&(R=m-2);let I,w;if(A=0,s)for(b=0;b<r-1;b++)I=A,w=I+1,P[M++]=R,P[M++]=I,P[M++]=w,++A;if(a)for(A=(u-1)*r,b=0;b<r-1;b++)I=A,w=I+1,P[M++]=I,P[M++]=G,P[M++]=w,++A}return X.indices=P,n.st&&(X.attributes.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:g})),X}function H1(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 z1(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 aJ=new Pe;function y6e(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 Xe=Pe.clone(o,aJ);Xe.normal=!0,e._vertexFormat=Xe}let m=Nme(e,t);n&&(e._vertexFormat=o);let p=ri.scaleToGeodeticHeight(m.attributes.position.values,s,a,!1);p=new Float64Array(p);let g=p.length,f=g*2,x=new Float64Array(f);x.set(p);let _=ri.scaleToGeodeticHeight(m.attributes.position.values,r,a);x.set(_,g),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,E,X;if(o.normal){for(X=m.attributes.normal.values,C.set(X),u=0;u<g;u++)X[u]=-X[u];C.set(X,g),m.attributes.normal.values=C}if(n){X=m.attributes.normal.values,o.normal||(m.attributes.normal=void 0);let Xe=new Float32Array(f);for(u=0;u<g;u++)X[u]=-X[u];Xe.set(X,g),m.attributes.extrudeDirection=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:Xe})}let v,P=l(i);if(P){let Xe=g/3*2,je=new Uint8Array(Xe);i===ln.TOP?je=je.fill(1,0,Xe/2):(v=i===ln.NONE?0:1,je=je.fill(v)),m.attributes.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:je})}if(o.tangent){let Xe=m.attributes.tangent.values;for(V.set(Xe),u=0;u<g;u++)Xe[u]=-Xe[u];V.set(Xe,g),m.attributes.tangent.values=V}if(o.bitangent){let Xe=m.attributes.bitangent.values;L.set(Xe),L.set(Xe,g),m.attributes.bitangent.values=L}o.st&&(E=m.attributes.st.values,Z.set(E),Z.set(E,g/3*2),m.attributes.st.values=Z);let A=m.indices,M=A.length,b=g/3,R=Ae.createTypedArray(f/3,M*2);for(R.set(A),u=0;u<M;u+=3)R[u+M]=A[u+2]+b,R[u+1+M]=A[u+1]+b,R[u+2+M]=A[u]+b;m.indices=R;let G=t.northCap,I=t.southCap,w=c,N=2,B=0,U=4,O=4;G&&(N-=1,w-=1,B+=1,U-=2,O-=1),I&&(N-=1,w-=1,B+=1,U-=2,O-=1),B+=N*d+2*w-U;let k=(B+O)*2,J=new Float64Array(k*3),H=n?new Float32Array(k*3):void 0,te=P?new Uint8Array(k):void 0,z=o.st?new Float32Array(k*2):void 0,j=i===ln.TOP;P&&!j&&(v=i===ln.ALL?1:0,te=te.fill(v));let ee=0,fe=0,_e=0,le=0,ge=d*w,Se;for(u=0;u<ge;u+=d)Se=u*3,J=H1(J,ee,Se,p,_),ee+=6,o.st&&(z=z1(z,fe,u*2,E),fe+=4),n&&(_e+=3,H[_e++]=X[Se],H[_e++]=X[Se+1],H[_e++]=X[Se+2]),j&&(te[le++]=1,le+=1);if(I){let Xe=G?ge+1:ge;for(Se=Xe*3,u=0;u<2;u++)J=H1(J,ee,Se,p,_),ee+=6,o.st&&(z=z1(z,fe,Xe*2,E),fe+=4),n&&(_e+=3,H[_e++]=X[Se],H[_e++]=X[Se+1],H[_e++]=X[Se+2]),j&&(te[le++]=1,le+=1)}else for(u=ge-d;u<ge;u++)Se=u*3,J=H1(J,ee,Se,p,_),ee+=6,o.st&&(z=z1(z,fe,u*2,E),fe+=4),n&&(_e+=3,H[_e++]=X[Se],H[_e++]=X[Se+1],H[_e++]=X[Se+2]),j&&(te[le++]=1,le+=1);for(u=ge-1;u>0;u-=d)Se=u*3,J=H1(J,ee,Se,p,_),ee+=6,o.st&&(z=z1(z,fe,u*2,E),fe+=4),n&&(_e+=3,H[_e++]=X[Se],H[_e++]=X[Se+1],H[_e++]=X[Se+2]),j&&(te[le++]=1,le+=1);if(G){let Xe=ge;for(Se=Xe*3,u=0;u<2;u++)J=H1(J,ee,Se,p,_),ee+=6,o.st&&(z=z1(z,fe,Xe*2,E),fe+=4),n&&(_e+=3,H[_e++]=X[Se],H[_e++]=X[Se+1],H[_e++]=X[Se+2]),j&&(te[le++]=1,le+=1)}else for(u=d-1;u>=0;u--)Se=u*3,J=H1(J,ee,Se,p,_),ee+=6,o.st&&(z=z1(z,fe,u*2,E),fe+=4),n&&(_e+=3,H[_e++]=X[Se],H[_e++]=X[Se+1],H[_e++]=X[Se+2]),j&&(te[le++]=1,le+=1);let Ie=g6e(J,o,a);o.st&&(Ie.attributes.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:z})),n&&(Ie.attributes.extrudeDirection=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:H})),P&&(Ie.attributes.applyOffset=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:te}));let Le=Ae.createTypedArray(k,B*6),ke,Be,st,vt;g=J.length/3;let Ct=0;for(u=0;u<g-1;u+=2){ke=u,vt=(ke+2)%g;let Xe=h.fromArray(J,ke*3,sJ),je=h.fromArray(J,vt*3,Mme);h.equalsEpsilon(Xe,je,W.EPSILON10)||(Be=(ke+1)%g,st=(Be+2)%g,Le[Ct++]=ke,Le[Ct++]=Be,Le[Ct++]=vt,Le[Ct++]=vt,Le[Ct++]=Be,Le[Ct++]=st)}return Ie.indices=Le,Ie=An.combineInstances([new Vt({geometry:m}),new Vt({geometry:Ie})]),Ie[0]}var x6e=[new h,new h,new h,new h],kme=new he,_6e=new he;function cJ(e,t,n,i,o){if(n===0)return ae.clone(e,o);let r=xs.computeOptions(e,t,n,0,Fme,kme),s=r.height,a=r.width,c=x6e;return xs.computePosition(r,i,!1,0,0,c[0]),xs.computePosition(r,i,!1,0,a-1,c[1]),xs.computePosition(r,i,!1,s-1,0,c[2]),xs.computePosition(r,i,!1,s-1,a-1,c[3]),ae.fromCartesianArray(c,i,o)}function Tf(e){e=y(e,y.EMPTY_OBJECT);let t=e.rectangle,n=y(e.height,0),i=y(e.extrudedHeight,n);this._rectangle=ae.clone(t),this._granularity=y(e.granularity,W.RADIANS_PER_DEGREE),this._ellipsoid=ne.clone(y(e.ellipsoid,ne.default)),this._surfaceHeight=Math.max(n,i),this._rotation=y(e.rotation,0),this._stRotation=y(e.stRotation,0),this._vertexFormat=Pe.clone(y(e.vertexFormat,Pe.DEFAULT)),this._extrudedHeight=Math.min(n,i),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createRectangleGeometry",this._offsetAttribute=e.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}Tf.packedLength=ae.packedLength+ne.packedLength+Pe.packedLength+7;Tf.pack=function(e,t,n){return n=y(n,0),ae.pack(e._rectangle,t,n),n+=ae.packedLength,ne.pack(e._ellipsoid,t,n),n+=ne.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]=y(e._offsetAttribute,-1),t};var Ume=new ae,Dme=ne.clone(ne.UNIT_SPHERE),Dg={rectangle:Ume,ellipsoid:Dme,vertexFormat:aJ,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};Tf.unpack=function(e,t,n){t=y(t,0);let i=ae.unpack(e,t,Ume);t+=ae.packedLength;let o=ne.unpack(e,t,Dme);t+=ne.packedLength;let r=Pe.unpack(e,t,aJ);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=ae.clone(i,n._rectangle),n._ellipsoid=ne.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):(Dg.granularity=s,Dg.height=a,Dg.rotation=c,Dg.stRotation=d,Dg.extrudedHeight=u,Dg.shadowVolume=m,Dg.offsetAttribute=p===-1?void 0:p,new Tf(Dg))};Tf.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.rectangle,i=y(e.granularity,W.RADIANS_PER_DEGREE),o=y(e.ellipsoid,ne.default),r=y(e.rotation,0);return cJ(n,i,r,o,t)};var T6e=new $,Ime=new we,S6e=new he;Tf.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=xs.computeOptions(t,e._granularity,i,o,Fme,kme,_6e),a=T6e;if(o!==0||i!==0){let g=ae.center(t,S6e),f=n.geodeticSurfaceNormalCartographic(g,sJ);we.fromAxisAngle(f,-o,Ime),$.fromQuaternion(Ime,a)}else $.clone($.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=y6e(e,s);let g=ce.fromRectangle3D(t,n,c,p6e),f=ce.fromRectangle3D(t,n,d,f6e);p=ce.union(g,f)}else{if(m=Nme(e,s),m.attributes.position.values=ri.scaleToGeodeticHeight(m.attributes.position.values,c,n,!1),l(e._offsetAttribute)){let g=m.attributes.position.values.length,f=e._offsetAttribute===ln.NONE?0:1,x=new Uint8Array(g/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 ht({attributes:m.attributes,indices:m.indices,primitiveType:m.primitiveType,boundingSphere:p,offsetAttribute:e._offsetAttribute})};Tf.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Tf({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:o,stRotation:e._stRotation,granularity:i,extrudedHeight:s,height:r,vertexFormat:Pe.POSITION_ONLY,shadowVolume:!0})};var Wme=new ae,C6e=[new D,new D,new D],V6e=new Qi,L6e=new he;function R6e(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=ae.clone(e._rectangle,Wme),n=e._granularity,i=e._ellipsoid,o=e._rotation-e._stRotation,r=cJ(t,n,o,i,Wme),s=C6e;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=Qi.fromRotation(e._stRotation,V6e),d=ae.center(a,L6e);for(let f=0;f<3;++f){let x=s[f];x.x-=d.longitude,x.y-=d.latitude,Qi.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],g=new Array(6);return D.pack(u,g),D.pack(m,g,2),D.pack(p,g,4),g}Object.defineProperties(Tf.prototype,{rectangle:{get:function(){return l(this._rotatedRectangle)||(this._rotatedRectangle=cJ(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=R6e(this)),this._textureCoordinateRotationPoints}}});var Q_=Tf;var Bme=new Y,Yme=h.ZERO,Ome=new h,Hme=new ae,Z6e=new ae,G6e=new he;function E6e(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){On.call(this,{entity:e,scene:t,geometryOptions:new E6e(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}l(Object.create)&&(rh.prototype=Object.create(On.prototype),rh.prototype.constructor=rh);rh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Nn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Yt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,Bme)),l(o)||(o=Y.WHITE),i.color=Ht.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=zi.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,Yme,Ome))),new Vt({id:t,geometry:new Q_(this._options),attributes:i})};rh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=K.getValueOrDefault(this._outlineColorProperty,e,Y.BLACK,Bme),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ht.fromColor(i),distanceDisplayCondition:Nn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=zi.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,Yme,Ome))),new Vt({id:t,geometry:new C_(this._options),attributes:r})};rh.prototype._computeCenter=function(e,t){let n=K.getValueOrUndefined(this._entity.rectangle.coordinates,e,Z6e);if(!l(n))return;let i=ae.center(n,G6e);return he.toCartesian(i,ne.default,t)};rh.prototype._isHidden=function(e,t){return!l(t.coordinates)||ni.prototype._isHidden.call(this,e,t)};rh.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!K.isConstant(t.height)||!K.isConstant(t.extrudedHeight)||!K.isConstant(t.granularity)||!K.isConstant(t.stRotation)||!K.isConstant(t.rotation)||!K.isConstant(t.outlineWidth)||!K.isConstant(t.zIndex)||this._onTerrain&&!K.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Yt)};rh.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Yt,i=K.getValueOrUndefined(t.height,De.MINIMUM_VALUE),o=K.getValueOrDefault(t.heightReference,De.MINIMUM_VALUE,Qe.NONE),r=K.getValueOrUndefined(t.extrudedHeight,De.MINIMUM_VALUE),s=K.getValueOrDefault(t.extrudedHeightReference,De.MINIMUM_VALUE,Qe.NONE);l(r)&&!l(i)&&(i=0);let a=this._options;a.vertexFormat=n?dn.VERTEX_FORMAT:oo.MaterialSupport.TEXTURED.vertexFormat,a.rectangle=t.coordinates.getValue(De.MINIMUM_VALUE,a.rectangle),a.granularity=K.getValueOrUndefined(t.granularity,De.MINIMUM_VALUE),a.stRotation=K.getValueOrUndefined(t.stRotation,De.MINIMUM_VALUE),a.rotation=K.getValueOrUndefined(t.rotation,De.MINIMUM_VALUE),a.offsetAttribute=On.computeGeometryOffsetAttribute(i,o,r,s),a.height=On.getGeometryHeight(i,o),r=On.getGeometryExtrudedHeight(r,s),r===On.CLAMP_TO_GROUND&&(r=ai.getMinimumMaximumHeights(Q_.computeRectangle(a,Hme)).minimumTerrainHeight),a.extrudedHeight=r};rh.DynamicGeometryUpdater=K1;function K1(e,t,n){ti.call(this,e,t,n)}l(Object.create)&&(K1.prototype=Object.create(ti.prototype),K1.prototype.constructor=K1);K1.prototype._isHidden=function(e,t,n){return!l(this._options.rectangle)||ti.prototype._isHidden.call(this,e,t,n)};K1.prototype._setOptions=function(e,t,n){let i=this._options,o=K.getValueOrUndefined(t.height,n),r=K.getValueOrDefault(t.heightReference,n,Qe.NONE),s=K.getValueOrUndefined(t.extrudedHeight,n),a=K.getValueOrDefault(t.extrudedHeightReference,n,Qe.NONE);l(s)&&!l(o)&&(o=0),i.rectangle=K.getValueOrUndefined(t.coordinates,n,i.rectangle),i.granularity=K.getValueOrUndefined(t.granularity,n),i.stRotation=K.getValueOrUndefined(t.stRotation,n),i.rotation=K.getValueOrUndefined(t.rotation,n),i.offsetAttribute=On.computeGeometryOffsetAttribute(o,r,s,a),i.height=On.getGeometryHeight(o,r),s=On.getGeometryExtrudedHeight(s,a),s===On.CLAMP_TO_GROUND&&(s=ai.getMinimumMaximumHeights(Q_.computeRectangle(i,Hme)).minimumTerrainHeight),i.extrudedHeight=s};var kP=rh;var Nni=T(S(),1);var ani=T(S(),1);var Oti=T(S(),1);var zme={};function X6e(e,t){return W.equalsEpsilon(e.latitude,t.latitude,W.EPSILON10)&&W.equalsEpsilon(e.longitude,t.longitude,W.EPSILON10)}var I6e=new he,W6e=new he;function P6e(e,t,n,i){t=xo(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,I6e);s&&(m.height=n[0]),c[0]=m.height,r?d[0]=i[0]:d[0]=0;let p=c[0],g=d[0],f=p===g,x=1;for(let _=1;_<o;++_){let C=t[_],V=e.cartesianToCartographic(C,W6e);s&&(V.height=n[_]),f=f&&V.height===0,X6e(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 v6e=new Array(2),w6e=new Array(2),F6e={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};zme.computePositions=function(e,t,n,i,o,r){let s=P6e(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=F6e;if(p.minDistance=m,p.ellipsoid=e,r){let g=0,f;for(f=0;f<a-1;f++)g+=Zi.numberOfPoints(t[f],t[f+1],m)+1;d=new Float64Array(g*3),u=new Float64Array(g*3);let x=v6e,_=w6e;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=Zi.generateArc(p);d.set(V,C),_[0]=i[f],_[1]=i[f+1],u.set(Zi.generateArc(p),C),C+=V.length}}else p.positions=t,p.height=n,d=new Float64Array(Zi.generateArc(p)),p.height=i,u=new Float64Array(Zi.generateArc(p));return{bottomPositions:u,topPositions:d,numCorners:c}};var j_=zme;var lJ=new h,Rk=new h,A6e=new h,Kme=new h,M6e=new h,N6e=new h,k6e=new h;function q_(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=y(e.vertexFormat,Pe.DEFAULT),r=y(e.granularity,W.RADIANS_PER_DEGREE),s=y(e.ellipsoid,ne.default);this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=Pe.clone(o),this._granularity=r,this._ellipsoid=ne.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+ne.packedLength+Pe.packedLength+1}q_.pack=function(e,t,n){n=y(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 ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,Pe.pack(e._vertexFormat,t,n),n+=Pe.packedLength,t[n]=e._granularity,t};var Jme=ne.clone(ne.UNIT_SPHERE),Qme=new Pe,UP={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:Jme,vertexFormat:Qme,granularity:void 0};q_.unpack=function(e,t,n){t=y(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=ne.unpack(e,t,Jme);t+=ne.packedLength;let d=Pe.unpack(e,t,Qme);t+=Pe.packedLength;let u=e[t];return l(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=ne.clone(c,n._ellipsoid),n._vertexFormat=Pe.clone(d,n._vertexFormat),n._granularity=u,n):(UP.positions=r,UP.minimumHeights=s,UP.maximumHeights=a,UP.granularity=u,new q_(UP))};q_.fromConstantHeights=function(e){e=y(e,y.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,g=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,E=0,X=0,v=k6e,P=N6e,A=M6e,M=!0;m/=3;let b,R=0,G=1/(m-u-1);for(b=0;b<m;++b){let U=b*3,O=h.fromArray(d,U,lJ),k=h.fromArray(c,U,Rk);if(o.position&&(g[V++]=k.x,g[V++]=k.y,g[V++]=k.z,g[V++]=O.x,g[V++]=O.y,g[V++]=O.z),o.st&&(C[X++]=R,C[X++]=0,C[X++]=R,C[X++]=1),o.normal||o.tangent||o.bitangent){let J=h.clone(h.ZERO,Kme),H=h.subtract(O,s.geodeticSurfaceNormal(O,Rk),Rk);if(b+1<m&&(J=h.fromArray(d,U+3,Kme)),M){let te=h.subtract(J,O,A6e),z=h.subtract(H,O,lJ);v=h.normalize(h.cross(z,te,v),v),M=!1}h.equalsEpsilon(O,J,W.EPSILON10)?M=!0:(R+=G,o.tangent&&(P=h.normalize(h.subtract(J,O,P),P)),o.bitangent&&(A=h.normalize(h.cross(v,P,A),A))),o.normal&&(f[L++]=v.x,f[L++]=v.y,f[L++]=v.z,f[L++]=v.x,f[L++]=v.y,f[L++]=v.z),o.tangent&&(x[E++]=P.x,x[E++]=P.y,x[E++]=P.z,x[E++]=P.x,x[E++]=P.y,x[E++]=P.z),o.bitangent&&(_[Z++]=A.x,_[Z++]=A.y,_[Z++]=A.z,_[Z++]=A.x,_[Z++]=A.y,_[Z++]=A.z)}}let I=new mn;o.position&&(I.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:g})),o.normal&&(I.normal=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:f})),o.tangent&&(I.tangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:x})),o.bitangent&&(I.bitangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:_})),o.st&&(I.st=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:C}));let w=p/3;p-=6*(u+1);let N=Ae.createTypedArray(w,p),B=0;for(b=0;b<w-2;b+=2){let U=b,O=b+2,k=h.fromArray(g,U*3,lJ),J=h.fromArray(g,O*3,Rk);if(h.equalsEpsilon(k,J,W.EPSILON10))continue;let H=b+1,te=b+3;N[B++]=H,N[B++]=U,N[B++]=te,N[B++]=te,N[B++]=U,N[B++]=O}return new ht({attributes:I,indices:N,primitiveType:Fe.TRIANGLES,boundingSphere:new ce.fromVertices(g)})};var DP=q_;var Sni=T(S(),1);var jme=new h,qme=new h;function $_(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=y(e.granularity,W.RADIANS_PER_DEGREE),r=y(e.ellipsoid,ne.default);this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._granularity=o,this._ellipsoid=ne.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+ne.packedLength+1}$_.pack=function(e,t,n){n=y(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 ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,t[n]=e._granularity,t};var $me=ne.clone(ne.UNIT_SPHERE),BP={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:$me,granularity:void 0};$_.unpack=function(e,t,n){t=y(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=ne.unpack(e,t,$me);t+=ne.packedLength;let d=e[t];return l(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=ne.clone(c,n._ellipsoid),n._granularity=d,n):(BP.positions=r,BP.minimumHeights=s,BP.maximumHeights=a,BP.granularity=d,new $_(BP))};$_.fromConstantHeights=function(e){e=y(e,y.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 $_(c)};$_.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 g;for(g=0;g<d;++g){let V=g*3,L=h.fromArray(c,V,jme),Z=h.fromArray(a,V,qme);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 mn({position:new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:m})}),x=u/3;u=2*x-4+x;let _=Ae.createTypedArray(x,u),C=0;for(g=0;g<x-2;g+=2){let V=g,L=g+2,Z=h.fromArray(m,V*3,jme),E=h.fromArray(m,L*3,qme);if(h.equalsEpsilon(Z,E,W.EPSILON10))continue;let X=g+1,v=g+3;_[C++]=X,_[C++]=V,_[C++]=X,_[C++]=v,_[C++]=V,_[C++]=L}return _[C++]=x-2,_[C++]=x-1,new ht({attributes:f,indices:_,primitiveType:Fe.LINES,boundingSphere:new ce.fromVertices(m)})};var YP=$_;var ehe=new Y;function U6e(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 sh(e,t){ni.call(this,{entity:e,scene:t,geometryOptions:new U6e(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}l(Object.create)&&(sh.prototype=Object.create(ni.prototype),sh.prototype.constructor=sh);sh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Nn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Yt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,ehe)),l(c)||(c=Y.WHITE),o=Ht.fromColor(c),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new Vt({id:t,geometry:new DP(this._options),attributes:i})};sh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=K.getValueOrDefault(this._outlineColorProperty,e,Y.BLACK,ehe),o=this._distanceDisplayConditionProperty.getValue(e);return new Vt({id:t,geometry:new YP(this._options),attributes:{show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Ht.fromColor(i),distanceDisplayCondition:Nn.fromDistanceDisplayCondition(o)}})};sh.prototype._isHidden=function(e,t){return!l(t.positions)||ni.prototype._isHidden.call(this,e,t)};sh.prototype._getIsClosed=function(e){return!1};sh.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!K.isConstant(t.minimumHeights)||!K.isConstant(t.maximumHeights)||!K.isConstant(t.outlineWidth)||!K.isConstant(t.granularity)};sh.prototype._setStaticOptions=function(e,t){let n=t.minimumHeights,i=t.maximumHeights,o=t.granularity,r=this._materialProperty instanceof Yt,s=this._options;s.vertexFormat=r?dn.VERTEX_FORMAT:oo.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(De.MINIMUM_VALUE,s.positions),s.minimumHeights=l(n)?n.getValue(De.MINIMUM_VALUE,s.minimumHeights):void 0,s.maximumHeights=l(i)?i.getValue(De.MINIMUM_VALUE,s.maximumHeights):void 0,s.granularity=l(o)?o.getValue(De.MINIMUM_VALUE):void 0};sh.DynamicGeometryUpdater=J1;function J1(e,t,n){ti.call(this,e,t,n)}l(Object.create)&&(J1.prototype=Object.create(ti.prototype),J1.prototype.constructor=J1);J1.prototype._isHidden=function(e,t,n){return!l(this._options.positions)||ti.prototype._isHidden.call(this,e,t,n)};J1.prototype._setOptions=function(e,t,n){let i=this._options;i.positions=K.getValueOrUndefined(t.positions,n,i.positions),i.minimumHeights=K.getValueOrUndefined(t.minimumHeights,n,i.minimumHeights),i.maximumHeights=K.getValueOrUndefined(t.maximumHeights,n,i.maximumHeights),i.granularity=K.getValueOrUndefined(t.granularity,n)};var OP=sh;var eT=[dX,dP,tP,CP,LP,GP,WP,NP,kP,OP];function tT(e,t){this.entity=e,this.scene=t;let n=new Array(eT.length),i=new be,o=new vr;for(let r=0;r<n.length;r++){let s=new eT[r](e,t);o.add(s.geometryChanged,a=>{i.raiseEvent(a)}),n[r]=s}this.updaters=n,this.geometryChanged=i,this.eventHelper=o,this._removeEntitySubscription=e.definitionChanged.addEventListener(tT.prototype._onEntityPropertyChanged,this)}tT.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)};tT.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};tT.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),me(this)};tT.registerUpdater=function(e){eT.includes(e)||eT.push(e)};tT.unregisterUpdater=function(e){if(eT.includes(e)){let t=eT.indexOf(e);eT.splice(t,1)}};var nT=tT;var bii=T(S(),1);var the=new Y,D6e=new Pt,B6e=new Pt,Y6e=h.ZERO,O6e=new h;function ah(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 Lt,this.updaters=new Lt,this.updatersWithAttributes=new Lt,this.attributes=new Lt,this.subscriptions=new Lt,this.showsUpdated=new Lt,this.itemsToRemove=[],this.invalidated=!1;let a;l(o)&&(a=o.definitionChanged.addEventListener(ah.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=a}ah.prototype.onMaterialChanged=function(){this.invalidated=!0};ah.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:l(t)?t.equals(n):!1};ah.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||!K.isConstant(e.distanceDisplayConditionProperty)||!K.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)}))}};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};ah.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=Ko.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 Yt)&&(this.depthFailMaterial=Ko.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=K.getValueOrDefault(_,e,Y.WHITE,the);Y.equals(m._lastColor,C)||(m._lastColor=Y.clone(C,m._lastColor),m.color=Ht.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 Yt&&(!d.depthFailMaterialProperty.isConstant||c)){let _=d.depthFailMaterialProperty.color,C=K.getValueOrDefault(_,e,Y.WHITE,the);Y.equals(m._lastDepthFailColor,C)||(m._lastDepthFailColor=Y.clone(C,m._lastDepthFailColor),m.depthFailColor=Ht.toValue(C,m.depthFailColor))}let p=d.entity.isShowing&&(d.hasConstantFill||d.isFilled(e)),g=m.show[0]===1;p!==g&&(m.show=xn.toValue(p,m.show));let f=d.distanceDisplayConditionProperty;if(!K.isConstant(f)){let _=K.getValueOrDefault(f,e,B6e,D6e);Pt.equals(_,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=Pt.clone(_,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=Nn.toValue(_,m.distanceDisplayCondition))}let x=d.terrainOffsetProperty;if(!K.isConstant(x)){let _=K.getValueOrDefault(x,e,Y6e,O6e);h.equals(_,m._lastOffset)||(m._lastOffset=h.clone(_,m._lastOffset),m.offset=zi.toValue(_,m.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,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=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=xn.toValue(a,s.show),r.attributes.show.value[0]=s.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 ft.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ft.FAILED:(i.boundingSphere.clone(t),ft.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),l(this.removeMaterialSubscription)&&this.removeMaterialSubscription()};function Q1(e,t,n,i,o){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}Q1.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 ah(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);s.add(t,o),n.push(s)};function nhe(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}Q1.prototype.remove=function(e){nhe(this._solidItems,e)||nhe(this._translucentItems,e)};function ihe(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 Zk(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}Q1.prototype.update=function(e){let t=Zk(this,this._solidItems,e,!0);t=Zk(this,this._translucentItems,e,t)&&t;let n=ihe(this,this._solidItems,e),i=ihe(this,this._translucentItems,e);return(n||i)&&(t=Zk(this,this._solidItems,e,t)&&t,t=Zk(this,this._translucentItems,e,t)&&t),t};function ohe(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 ft.FAILED}Q1.prototype.getBoundingSphere=function(e,t){let n=ohe(this._solidItems,e,t);return n===ft.FAILED?ohe(this._translucentItems,e,t):n};function rhe(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}Q1.prototype.removeAllPrimitives=function(){rhe(this._solidItems),rhe(this._translucentItems)};var Bu=Q1;var Wii=T(S(),1);var H6e=new Pt,z6e=new Pt,K6e=h.ZERO,J6e=new h;function ch(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 Lt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Lt,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new Lt,this.attributes=new Lt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(ch.prototype.onMaterialChanged,this),this.subscriptions=new Lt,this.showsUpdated=new Lt}ch.prototype.onMaterialChanged=function(){this.invalidated=!0};ch.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};ch.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||!K.isConstant(t.distanceDisplayConditionProperty)||!K.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};ch.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 Q6e=new Y;ch.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=Ko.getValue(e,this.materialProperty,this.material);let a;l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=Ko.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=Ko.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Yt)&&(this.depthFailMaterial=Ko.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 Yt&&!c.depthFailMaterialProperty.isConstant){let _=c.depthFailMaterialProperty.color,C=K.getValueOrDefault(_,e,Y.WHITE,Q6e);Y.equals(m._lastDepthFailColor,C)||(m._lastDepthFailColor=Y.clone(C,m._lastDepthFailColor),m.depthFailColor=Ht.toValue(C,m.depthFailColor))}let p=d.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=m.show[0]===1;p!==g&&(m.show=xn.toValue(p,m.show));let f=c.distanceDisplayConditionProperty;if(!K.isConstant(f)){let _=K.getValueOrDefault(f,e,z6e,H6e);Pt.equals(_,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=Pt.clone(_,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=Nn.toValue(_,m.distanceDisplayCondition))}let x=c.terrainOffsetProperty;if(!K.isConstant(x)){let _=K.getValueOrDefault(x,e,K6e,J6e);h.equals(_,m._lastOffset)||(m._lastOffset=h.clone(_,m._lastOffset),m.offset=zi.toValue(_,m.offset))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};ch.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=xn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};ch.prototype.contains=function(e){return this.updaters.contains(e.id)};ch.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ft.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ft.FAILED:(i.boundingSphere.clone(t),ft.DONE)};ch.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 j1(e,t,n,i,o){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}j1.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 ch(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);o.add(e,t),n.push(o)};j1.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}}};j1.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};j1.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 ft.FAILED};j1.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 Yu=j1;var $ii=T(S(),1);var kii=T(S(),1);var Aii=T(S(),1);var vii=T(S(),1);function Gk(e,t,n=0,i=e.length-1,o=j6e){for(;i>n;){if(i-n>600){let c=i-n+1,d=t-n+1,u=Math.log(c),m=.5*Math.exp(2*u/3),p=.5*Math.sqrt(u*m*(c-m)/c)*(d-c/2<0?-1:1),g=Math.max(n,Math.floor(t-d*m/c+p)),f=Math.min(i,Math.floor(t+(c-d)*m/c+p));Gk(e,t,g,f,o)}let r=e[t],s=n,a=i;for(HP(e,n,t),o(e[i],r)>0&&HP(e,n,i);s<a;){for(HP(e,s,a),s++,a--;o(e[s],r)<0;)s++;for(;o(e[a],r)>0;)a--}o(e[n],r)===0?HP(e,n,a):(a++,HP(e,a,i)),a<=t&&(n=a+1),t<=a&&(i=a-1)}}function HP(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function j6e(e,t){return e<t?-1:e>t?1:0}var JP=class{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let n=this.data,i=[];if(!Xk(t,n))return i;let o=this.toBBox,r=[];for(;n;){for(let s=0;s<n.children.length;s++){let a=n.children[s],c=n.leaf?o(a):a;Xk(t,c)&&(n.leaf?i.push(a):uJ(t,c)?this._all(a,i):r.push(a))}n=r.pop()}return i}collides(t){let n=this.data;if(!Xk(t,n))return!1;let i=[];for(;n;){for(let o=0;o<n.children.length;o++){let r=n.children[o],s=n.leaf?this.toBBox(r):r;if(Xk(t,s)){if(n.leaf||uJ(t,s))return!0;i.push(r)}}n=i.pop()}return!1}load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(let i=0;i<t.length;i++)this.insert(t[i]);return this}let n=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=n;else if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){let i=this.data;this.data=n,n=i}this._insert(n,this.data.height-n.height-1,!0)}return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=$1([]),this}remove(t,n){if(!t)return this;let i=this.data,o=this.toBBox(t),r=[],s=[],a,c,d;for(;i||r.length;){if(i||(i=r.pop(),c=r[r.length-1],a=s.pop(),d=!0),i.leaf){let u=q6e(t,i.children,n);if(u!==-1)return i.children.splice(u,1),r.push(i),this._condense(r),this}!d&&!i.leaf&&uJ(i,o)?(r.push(i),s.push(a),a=0,c=i,i=i.children[0]):c?(a++,i=c.children[a],d=!1):i=null}return this}toBBox(t){return t}compareMinX(t,n){return t.minX-n.minX}compareMinY(t,n){return t.minY-n.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,n){let i=[];for(;t;)t.leaf?n.push(...t.children):i.push(...t.children),t=i.pop();return n}_build(t,n,i,o){let r=i-n+1,s=this._maxEntries,a;if(r<=s)return a=$1(t.slice(n,i+1)),q1(a,this.toBBox),a;o||(o=Math.ceil(Math.log(r)/Math.log(s)),s=Math.ceil(r/Math.pow(s,o-1))),a=$1([]),a.leaf=!1,a.height=o;let c=Math.ceil(r/s),d=c*Math.ceil(Math.sqrt(s));she(t,n,i,d,this.compareMinX);for(let u=n;u<=i;u+=d){let m=Math.min(u+d-1,i);she(t,u,m,c,this.compareMinY);for(let p=u;p<=m;p+=c){let g=Math.min(p+c-1,m);a.children.push(this._build(t,p,g,o-1))}}return q1(a,this.toBBox),a}_chooseSubtree(t,n,i,o){for(;o.push(n),!(n.leaf||o.length-1===i);){let r=1/0,s=1/0,a;for(let c=0;c<n.children.length;c++){let d=n.children[c],u=dJ(d),m=tqe(t,d)-u;m<s?(s=m,r=u<r?u:r,a=d):m===s&&u<r&&(r=u,a=d)}n=a||n.children[0]}return n}_insert(t,n,i){let o=i?t:this.toBBox(t),r=[],s=this._chooseSubtree(o,this.data,n,r);for(s.children.push(t),KP(s,o);n>=0&&r[n].children.length>this._maxEntries;)this._split(r,n),n--;this._adjustParentBBoxes(o,r,n)}_split(t,n){let i=t[n],o=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,o);let s=this._chooseSplitIndex(i,r,o),a=$1(i.children.splice(s,i.children.length-s));a.height=i.height,a.leaf=i.leaf,q1(i,this.toBBox),q1(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(i,a)}_splitRoot(t,n){this.data=$1([t,n]),this.data.height=t.height+1,this.data.leaf=!1,q1(this.data,this.toBBox)}_chooseSplitIndex(t,n,i){let o,r=1/0,s=1/0;for(let a=n;a<=i-n;a++){let c=zP(t,0,a,this.toBBox),d=zP(t,a,i,this.toBBox),u=nqe(c,d),m=dJ(c)+dJ(d);u<r?(r=u,o=a,s=m<s?m:s):u===r&&m<s&&(s=m,o=a)}return o||i-n}_chooseSplitAxis(t,n,i){let o=t.leaf?this.compareMinX:$6e,r=t.leaf?this.compareMinY:eqe,s=this._allDistMargin(t,n,i,o),a=this._allDistMargin(t,n,i,r);s<a&&t.children.sort(o)}_allDistMargin(t,n,i,o){t.children.sort(o);let r=this.toBBox,s=zP(t,0,n,r),a=zP(t,i-n,i,r),c=Ek(s)+Ek(a);for(let d=n;d<i-n;d++){let u=t.children[d];KP(s,t.leaf?r(u):u),c+=Ek(s)}for(let d=i-n-1;d>=n;d--){let u=t.children[d];KP(a,t.leaf?r(u):u),c+=Ek(a)}return c}_adjustParentBBoxes(t,n,i){for(let o=i;o>=0;o--)KP(n[o],t)}_condense(t){for(let n=t.length-1,i;n>=0;n--)t[n].children.length===0?n>0?(i=t[n-1].children,i.splice(i.indexOf(t[n]),1)):this.clear():q1(t[n],this.toBBox)}};function q6e(e,t,n){if(!n)return t.indexOf(e);for(let i=0;i<t.length;i++)if(n(e,t[i]))return i;return-1}function q1(e,t){zP(e,0,e.children.length,t,e)}function zP(e,t,n,i,o){o||(o=$1(null)),o.minX=1/0,o.minY=1/0,o.maxX=-1/0,o.maxY=-1/0;for(let r=t;r<n;r++){let s=e.children[r];KP(o,e.leaf?i(s):s)}return o}function KP(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function $6e(e,t){return e.minX-t.minX}function eqe(e,t){return e.minY-t.minY}function dJ(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function Ek(e){return e.maxX-e.minX+(e.maxY-e.minY)}function tqe(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function nqe(e,t){let n=Math.max(e.minX,t.minX),i=Math.max(e.minY,t.minY),o=Math.min(e.maxX,t.maxX),r=Math.min(e.maxY,t.maxY);return Math.max(0,o-n)*Math.max(0,r-i)}function uJ(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function Xk(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function $1(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function she(e,t,n,i,o){let r=[t,n];for(;r.length;){if(n=r.pop(),t=r.pop(),n-t<=i)continue;let s=t+Math.ceil((n-t)/i/2)*i;Gk(e,s,t,n,o),r.push(t,s,s,n)}}function Ik(){this._tree=new JP}function iT(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}iT.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};Ik.prototype.insert=function(e,t){let n=iT.fromRectangleAndId(e,t,new iT);this._tree.insert(n)};function iqe(e,t){return e.id===t.id}var oqe=new iT;Ik.prototype.remove=function(e,t){let n=iT.fromRectangleAndId(e,t,oqe);this._tree.remove(n,iqe)};var rqe=new iT;Ik.prototype.collides=function(e){let t=iT.fromRectangleAndId("",e,rqe);return this._tree.collides(t)};var oT=Ik;var sqe=new Y,aqe=new Pt,cqe=new Pt;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 Lt,this.updaters=new Lt,this.updatersWithAttributes=new Lt,this.attributes=new Lt,this.subscriptions=new Lt,this.showsUpdated=new Lt,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new oT}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||!K.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 Fc({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,_=K.getValueOrDefault(x,e,Y.WHITE,sqe);Y.equals(m._lastColor,_)||(m._lastColor=Y.clone(_,m._lastColor),m.color=Ht.toValue(_,m.color))}let p=d.entity.isShowing&&(d.hasConstantFill||d.isFilled(e)),g=m.show[0]===1;p!==g&&(m.show=xn.toValue(p,m.show));let f=d.distanceDisplayConditionProperty;if(!K.isConstant(f)){let x=K.getValueOrDefault(f,e,cqe,aqe);Pt.equals(x,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=Pt.clone(x,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=Nn.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=xn.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 ft.PENDING;let i=n.getBoundingSphere(e.entity);return l(i)?(i.clone(t),ft.DONE):ft.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 eV(e,t){this._batches=[],this._primitives=e,this._classificationType=t}eV.prototype.add=function(e,t){let n=t.createFillGeometryInstance(e),i=this._batches,o=K.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};eV.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};eV.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};eV.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 ft.FAILED};eV.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var tV=eV;var hoi=T(S(),1);var lqe=new Pt,dqe=new Pt;function Ou(e,t,n,i,o,r){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new Lt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Lt,this.material=void 0,this.updatersWithAttributes=new Lt,this.attributes=new Lt,this.invalidated=!1,this.removeMaterialSubscription=i.definitionChanged.addEventListener(Ou.prototype.onMaterialChanged,this),this.subscriptions=new Lt,this.showsUpdated=new Lt,this.usingSphericalTextureCoordinates=o,this.zIndex=r,this.rectangleCollisionCheck=new oT}Ou.prototype.onMaterialChanged=function(){this.invalidated=!0};Ou.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};Ou.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Yt&&t instanceof Yt?!0:l(t)&&t.equals(n)};Ou.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||!K.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};Ou.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};Ou.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=Ko.getValue(e,this.materialProperty,this.material),n=new Fc({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=Ko.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)),g=m.show[0]===1;p!==g&&(m.show=xn.toValue(p,m.show));let f=c.distanceDisplayConditionProperty;if(!K.isConstant(f)){let x=K.getValueOrDefault(f,e,dqe,lqe);Pt.equals(x,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=Pt.clone(x,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=Nn.toValue(x,m.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Ou.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=xn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Ou.prototype.contains=function(e){return this.updaters.contains(e.id)};Ou.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ft.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ft.FAILED:(i.boundingSphere.clone(t),ft.DONE)};Ou.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 nV(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}nV.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=ld.shouldUseSphericalCoordinates(o.geometry.rectangle),s=K.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 Ou(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,r,s);a.add(e,t,o),n.push(a)};nV.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}}};nV.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};nV.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 ft.FAILED};nV.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 QP=nV;var Goi=T(S(),1);var uqe=new Y,mqe=new Pt,hqe=new Pt,fqe=h.ZERO,pqe=new h;function F0(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 Lt,this.updaters=new Lt,this.updatersWithAttributes=new Lt,this.attributes=new Lt,this.itemsToRemove=[],this.subscriptions=new Lt,this.showsUpdated=new Lt}F0.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||!K.isConstant(e.distanceDisplayConditionProperty)||!K.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)}))}};F0.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};F0.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 dn({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=K.getValueOrDefault(_,e,Y.WHITE,uqe);Y.equals(m._lastColor,C)||(m._lastColor=Y.clone(C,m._lastColor),m.color=Ht.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)),g=m.show[0]===1;p!==g&&(m.show=xn.toValue(p,m.show));let f=d.distanceDisplayConditionProperty;if(!K.isConstant(f)){let _=K.getValueOrDefault(f,e,hqe,mqe);Pt.equals(_,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=Pt.clone(_,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=Nn.toValue(_,m.distanceDisplayCondition))}let x=d.terrainOffsetProperty;if(!K.isConstant(x)){let _=K.getValueOrDefault(x,e,fqe,pqe);h.equals(_,m._lastOffset)||(m._lastOffset=h.clone(_,m._lastOffset),m.offset=zi.toValue(_,m.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};F0.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=xn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};F0.prototype.contains=function(e){return this.updaters.contains(e.id)};F0.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ft.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ft.FAILED:(i.boundingSphere.clone(t),ft.DONE)};F0.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 iV(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new Lt,this._translucentBatches=new Lt}iV.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 F0(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 F0(this._primitives,!0,i,this._shadows),o.set(i,r)),r.add(t,n))};iV.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};iV.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};iV.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 ft.FAILED};iV.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 oV=iV;var bqe=[];function Nl(e,t,n,i){n=y(n,e.primitives),i=y(i,e.groundPrimitives),this._scene=e,this._primitives=n,this._groundPrimitives=i,this._entityCollection=void 0,this._addedObjects=new Lt,this._removedObjects=new Lt,this._changedObjects=new Lt;let o=_n.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 oV(n,e,s,!1),this._outlineBatches[o+s]=new oV(n,e,s,!0),this._closedColorBatches[s]=new Bu(n,dn,void 0,!0,s,!0),this._closedColorBatches[o+s]=new Bu(n,dn,void 0,!0,s,!1),this._closedMaterialBatches[s]=new Yu(n,oo,void 0,!0,s,!0),this._closedMaterialBatches[o+s]=new Yu(n,oo,void 0,!0,s,!1),this._openColorBatches[s]=new Bu(n,dn,void 0,!1,s,!0),this._openColorBatches[o+s]=new Bu(n,dn,void 0,!1,s,!1),this._openMaterialBatches[s]=new Yu(n,oo,void 0,!1,s,!0),this._openMaterialBatches[o+s]=new Yu(n,oo,void 0,!1,s,!1);let a=kn.NUMBER_OF_CLASSIFICATION_TYPES,c=new Array(a),d=[];if(r)for(s=0;s<a;++s)d.push(new QP(i,s,oo)),c[s]=new tV(i,s);else for(s=0;s<a;++s)c[s]=new tV(i,s);this._groundColorBatches=c,this._groundMaterialBatches=d,this._dynamicBatch=new O_(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new Lt,this._updaterSets=new Lt,this._entityCollection=t,t.collectionChanged.addEventListener(Nl.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,bqe)}Nl.registerUpdater=function(e){nT.registerUpdater(e)};Nl.unregisterUpdater=function(e){nT.unregisterUpdater(e)};Nl.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 nT(c,this._scene),this._updaterSets.set(d,u),u.forEach(function(x){m._insertUpdaterIntoBatch(e,x)}),this._subscriptions.set(d,u.geometryChanged.addEventListener(Nl._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let p=!0,g=this._batches,f=g.length;for(a=0;a<f;a++)p=g[a].update(e)&&p;return p};var gqe=[],yqe=new ce;Nl.prototype.getBoundingSphere=function(e,t){let n=gqe,i=yqe,o=0,r=ft.DONE,s=this._batches,a=s.length,c=e.id,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===ft.PENDING)return ft.PENDING;r===ft.DONE&&(n[o]=ce.clone(i,n[o]),o++)}}return o===0?ft.FAILED:(n.length=o,ce.fromBoundingSpheres(n,t),ft.DONE)};Nl.prototype.isDestroyed=function(){return!1};Nl.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Nl.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(),me(this)};Nl.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};Nl.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=_n.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 Yt?this._groundColorBatches[o].add(e,t):this._groundMaterialBatches[o].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof Yt?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 Yt?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)};Nl._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)};Nl.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 jP=Nl;var mri=T(S(),1);var xqe=1,_qe="30px sans-serif",Tqe=No.FILL,Sqe=Y.WHITE,Cqe=Y.BLACK,Vqe=1,Lqe=!1,Rqe=new Y(.165,.165,.165,.8),Zqe=new D(7,5),Gqe=D.ZERO,Eqe=h.ZERO,Xqe=Qe.NONE,Iqe=gi.CENTER,Wqe=Pn.CENTER,Pqe=new h,vqe=new Y,wqe=new Y,Fqe=new Y,Aqe=new D,Mqe=new h,Nqe=new D,kqe=new kt,Uqe=new kt,Dqe=new kt,Bqe=new Pt;function ahe(e){this.entity=e,this.label=void 0,this.index=void 0}function Bg(e,t){t.collectionChanged.addEventListener(Bg.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Lt,this._onCollectionChanged(t,t.values,[],[])}Bg.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)&&K.getValueOrDefault(a._show,e,!0),m;if(u&&(m=K.getValueOrUndefined(s._position,e,Pqe),c=K.getValueOrUndefined(a._text,e),u=l(m)&&l(c)),!u){mJ(r,s,n);continue}K.isConstant(s._position)||(n._clusterDirty=!0);let p=!1,g=K.getValueOrDefault(a._heightReference,e,Xqe);l(d)||(d=n.getLabel(s),d.id=s,r.label=d,p=h.equals(d.position,m)&&d.heightReference===g),d.show=!0,d.position=m,d.text=c,d.scale=K.getValueOrDefault(a._scale,e,xqe),d.font=K.getValueOrDefault(a._font,e,_qe),d.style=K.getValueOrDefault(a._style,e,Tqe),d.fillColor=K.getValueOrDefault(a._fillColor,e,Sqe,vqe),d.outlineColor=K.getValueOrDefault(a._outlineColor,e,Cqe,wqe),d.outlineWidth=K.getValueOrDefault(a._outlineWidth,e,Vqe),d.showBackground=K.getValueOrDefault(a._showBackground,e,Lqe),d.backgroundColor=K.getValueOrDefault(a._backgroundColor,e,Rqe,Fqe),d.backgroundPadding=K.getValueOrDefault(a._backgroundPadding,e,Zqe,Aqe),d.pixelOffset=K.getValueOrDefault(a._pixelOffset,e,Gqe,Nqe),d.eyeOffset=K.getValueOrDefault(a._eyeOffset,e,Eqe,Mqe),d.heightReference=g,d.horizontalOrigin=K.getValueOrDefault(a._horizontalOrigin,e,Iqe),d.verticalOrigin=K.getValueOrDefault(a._verticalOrigin,e,Wqe),d.translucencyByDistance=K.getValueOrUndefined(a._translucencyByDistance,e,kqe),d.pixelOffsetScaleByDistance=K.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,Uqe),d.scaleByDistance=K.getValueOrUndefined(a._scaleByDistance,e,Dqe),d.distanceDisplayCondition=K.getValueOrUndefined(a._distanceDisplayCondition,e,Bqe),d.disableDepthTestDistance=K.getValueOrUndefined(a._disableDepthTestDistance,e),p&&d._updateClamping()}return!0};Bg.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.label))return ft.FAILED;let i=n.label;return t.center=h.clone(y(i._clampedPosition,i.position),t.center),t.radius=0,ft.DONE};Bg.prototype.isDestroyed=function(){return!1};Bg.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Bg.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return me(this)};Bg.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 ahe(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 ahe(r)):(mJ(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],mJ(s.get(r.id),r,a),s.remove(r.id)};function mJ(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var qP=Bg;var Pri=T(S(),1);var Yqe=1,Oqe=0,Hqe=!0,zqe=!0,Kqe=_n.ENABLED,Jqe=Qe.NONE,Qqe=Y.RED,jqe=0,qqe=Y.WHITE,$qe=cc.HIGHLIGHT,e$e=.5,t$e=new D(1,1),n$e=new F,i$e=new F,che=new Y,lhe=new Array(4),o$e=new h;function Yg(e,t){t.collectionChanged.addEventListener(Yg.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new Lt,this._onCollectionChanged(t,t.values,[],[])}async function r$e(e,t,n,i){let o=e._primitives,r=e._modelHash;try{let s=await Bm.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}}Yg.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)&&K.getValueOrDefault(a._show,e,!0),m;if(u&&(m=s.computeModelMatrix(e,n$e),c=Ee.createIfNeeded(K.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=K.getValueOrDefault(a._incrementallyLoadTextures,e,Hqe);r$e(this,s,c,f)}let p=d.modelPrimitive;if(!l(p))continue;p.show=!0,p.scale=K.getValueOrDefault(a._scale,e,Yqe),p.minimumPixelSize=K.getValueOrDefault(a._minimumPixelSize,e,Oqe),p.maximumScale=K.getValueOrUndefined(a._maximumScale,e),p.modelMatrix=F.clone(m,p.modelMatrix),p.shadows=K.getValueOrDefault(a._shadows,e,Kqe),p.heightReference=K.getValueOrDefault(a._heightReference,e,Jqe),p.distanceDisplayCondition=K.getValueOrUndefined(a._distanceDisplayCondition,e),p.silhouetteColor=K.getValueOrDefault(a._silhouetteColor,e,Qqe,che),p.silhouetteSize=K.getValueOrDefault(a._silhouetteSize,e,jqe),p.color=K.getValueOrDefault(a._color,e,qqe,che),p.colorBlendMode=K.getValueOrDefault(a._colorBlendMode,e,$qe),p.colorBlendAmount=K.getValueOrDefault(a._colorBlendAmount,e,e$e),p.clippingPlanes=K.getValueOrUndefined(a._clippingPlanes,e),p.clampAnimations=K.getValueOrDefault(a._clampAnimations,e,zqe),p.imageBasedLighting.imageBasedLightingFactor=K.getValueOrDefault(a._imageBasedLightingFactor,e,t$e);let g=K.getValueOrUndefined(a._lightColor,e);if(l(g)&&(Y.pack(g,lhe,0),g=h.unpack(lhe,0,o$e)),p.lightColor=g,p.customShader=K.getValueOrUndefined(a._customShader,e),n[s.id].modelUpdated=!0,p.ready){let f=K.getValueOrDefault(a._runAnimations,e,!0);d.animationsRunning!==f&&(f?p.activeAnimations.addAll({loop:Il.REPEAT}):p.activeAnimations.removeAll(),d.animationsRunning=f);let x=K.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 E=V[L],X=x[E];if(!l(X))continue;let v=p.getNode(E);if(!l(v))continue;let P=F.fromTranslationRotationScale(X,i$e);v.matrix=F.multiply(v.originalMatrix,P,P)}}let _=!1,C=K.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 E=V[L],X=C[E];l(X)&&(_=!0,p.setArticulationStage(E,X))}}_&&p.applyArticulations()}}return!0};Yg.prototype.isDestroyed=function(){return!1};Yg.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Yg.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)hJ(this,e[i],t,n);return me(this)};var Wk=new h,s$e=new he;Yg.prototype.getBoundingSphere=function(e,t){let n=this._modelHash[e.id];if(!l(n))return ft.FAILED;if(n.loadFailed)return ft.FAILED;let i=n.modelPrimitive;if(!l(i)||!i.show)return ft.PENDING;if(!i.ready||!n.modelUpdated)return ft.PENDING;let o=this._scene,r=y(o.ellipsoid,ne.default);if(i.heightReference!==Qe.NONE){let a=i.modelMatrix;Wk.x=a[12],Wk.y=a[13],Wk.z=a[14];let c=r.cartesianToCartographic(Wk,s$e),d=o.getHeight(c,i.heightReference);return l(d)&&(du(i.heightReference)?c.height=d:c.height+=d),ce.clone(i.boundingSphere,t),t.center=r.cartographicToCartesian(c),ft.DONE}return ce.clone(i.boundingSphere,t),ft.DONE};Yg.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)?(a$e(r,a),s.set(r.id,r)):(hJ(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],hJ(this,r,a,c),s.remove(r.id)};function hJ(e,t,n,i){let o=n[t.id];l(o)&&(i.removeAndDestroy(o.modelPrimitive),delete n[t.id])}function a$e(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var $P=Yg;var lsi=T(S(),1);var Uri=T(S(),1);function Og(e){this._definitionChanged=new be,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(Og.prototype,{isConstant:{get:function(){return K.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return l(this._value)?this._value.referenceFrame:$i.FIXED}}});var c$e=new q;Og.prototype.getValue=function(e,t){return l(e)||(e=q.now(c$e)),this.getValueInReferenceFrame(e,$i.FIXED,t)};Og.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))};Og.prototype.getValueInReferenceFrame=function(e,t,n){if(l(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),l(n)?ne.default.scaleToGeodeticSurface(n,n):void 0};Og.prototype.equals=function(e){return this===e||e instanceof Og&&this._value===e._value};Og.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Sf=Og;var l$e=60,d$e=1,uhe=new Vn,fJ=new Vn,pJ=new Vn;function dhe(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function u$e(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)||q.lessThanOrEquals(o,t)||q.greaterThanOrEquals(o,n),p=0,g=i.length,f=i[p],x=n,_=!1,C,V,L;for(;p<g;){if(!m&&q.greaterThanOrEquals(f,o)&&(u=e.getValueInReferenceFrame(o,r,c[d]),l(u)&&(c[d++]=u),m=!0),q.greaterThan(f,t)&&q.lessThan(f,x)&&!f.equals(o)&&(u=e.getValueInReferenceFrame(f,r,c[d]),l(u)&&(c[d++]=u)),p<g-1){if(s>0&&!_){let Z=i[p+1],E=q.secondsDifference(Z,f);_=E>s,_&&(C=Math.ceil(E/s),V=0,L=E/Math.max(C,2),C=Math.max(C-1,1))}if(_&&V<C){f=q.addSeconds(f,L,new q),V++;continue}}_=!1,p++,f=i[p]}return u=e.getValueInReferenceFrame(n,r,c[d]),l(u)&&(c[d++]=u),d}function m$e(e,t,n,i,o,r,s,a){let c,d=0,u=s,m=t,p=Math.max(r,60),g=!l(i)||q.lessThanOrEquals(i,t)||q.greaterThanOrEquals(i,n);for(;q.lessThan(m,n);)!g&&q.greaterThanOrEquals(m,i)&&(g=!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=q.addSeconds(t,p*d,new q);return c=e.getValueInReferenceFrame(n,o,a[u]),l(c)&&(a[u]=c,u++),u}function h$e(e,t,n,i,o,r,s,a){pJ.start=t,pJ.stop=n;let c=s,d=e.intervals;for(let u=0;u<d.length;u++){let m=d.get(u);if(!Vn.intersect(m,pJ,uhe).isEmpty){let p=m.start;m.isStartIncluded||(m.isStopIncluded?p=m.stop:p=q.addSeconds(m.start,q.secondsDifference(m.stop,m.start)/2,new q));let g=e.getValueInReferenceFrame(p,o,a[c]);l(g)&&(a[c]=g,c++)}}return c}function f$e(e,t,n,i,o,r,s,a){let c=e.getValueInReferenceFrame(t,o,a[s]);return l(c)&&(a[s++]=c),s}function p$e(e,t,n,i,o,r,s,a){fJ.start=t,fJ.stop=n;let c=s,d=e.intervals;for(let u=0;u<d.length;u++){let m=d.get(u);if(!Vn.intersect(m,fJ,uhe).isEmpty){let p=m.start,g=m.stop,f=t;q.greaterThan(p,f)&&(f=p);let x=n;q.lessThan(g,x)&&(x=g),c=mhe(m.data,f,x,i,o,r,c,a)}}return c}function mhe(e,t,n,i,o,r,s,a){for(;e instanceof E0;)e=e.resolvedProperty;if(e instanceof ca){let c=e._property._times;s=u$e(e,t,n,c,i,o,r,s,a)}else e instanceof sa?s=p$e(e,t,n,i,o,r,s,a):e instanceof X0?s=h$e(e,t,n,i,o,r,s,a):e instanceof Mc||e instanceof Sf&&K.isConstant(e)?s=f$e(e,t,n,i,o,r,s,a):s=m$e(e,t,n,i,o,r,s,a);return s}function hhe(e,t,n,i,o,r,s){l(s)||(s=[]);let a=mhe(e,t,n,i,o,r,0,s);return s.length=a,s}var b$e=new $;function ev(e,t){this._unusedIndexes=[],this._polylineCollection=new Om,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}ev.prototype.update=function(e){if(this._referenceFrame===$i.INERTIAL){let t=wt.computeIcrfToCentralBodyFixedMatrix(e,b$e);F.fromRotationTranslation(t,h.ZERO,this._polylineCollection.modelMatrix)}};ev.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=K.getValueOrUndefined(i._leadTime,e),p=K.getValueOrUndefined(i._trailTime,e),g=n._availability,f=l(g),x=l(m),_=l(p);if(d=f||x&&_,d){if(_&&(r=q.addSeconds(e,-p,new q)),x&&(s=q.addSeconds(e,m,new q)),f){let C=g.start,V=g.stop;(!_||q.greaterThan(C,r))&&(r=C),(!x||q.lessThan(V,s))&&(s=V)}d=q.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 g=m.pop();c=this._polylineCollection.get(g),t.index=g}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=n,t.polyline=c}let u=K.getValueOrDefault(i._resolution,e,l$e);c.show=!0,c.positions=hhe(o,r,s,e,this._referenceFrame,u,c.positions.slice()),c.material=Ko.getValue(e,i._material,c.material),c.width=K.getValueOrDefault(i._width,e,d$e),c.distanceDisplayCondition=K.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};ev.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)};ev.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),me(this)};function Hg(e,t){t.collectionChanged.addEventListener(Hg.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new Lt,this._onCollectionChanged(t,t.values,[],[])}Hg.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=$i.FIXED;this._scene.mode===oe.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 ev(this._scene,d),u.update(e),this._updaters[d]=u),r.updater=u,l(u)&&u.updateObject(e,r)}return!0};Hg.prototype.isDestroyed=function(){return!1};Hg.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Hg.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return me(this)};Hg.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 dhe(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 dhe(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))};Hg._subSample=hhe;var tv=Hg;var Csi=T(S(),1);var fhe=Y.WHITE,phe=Y.BLACK,bhe=0,ghe=1,yhe=0,xhe=Gr.NONE,_he=new Y,g$e=new h,The=new Y,She=new kt,Che=new kt,Vhe=new Pt;function Lhe(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 zg(e,t){t.collectionChanged.addEventListener(zg.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Lt,this._onCollectionChanged(t,t.values,[],[])}zg.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=K.getValueOrDefault(a._heightReference,e,Qe.NONE),m=s.isShowing&&s.isAvailable(e)&&K.getValueOrDefault(a._show,e,!0),p;if(m&&(p=K.getValueOrUndefined(s._position,e,g$e),m=l(p)),!m){nv(r,s,n);continue}K.isConstant(s._position)||(n._clusterDirty=!0);let g=!1,f=!1;if(u!==Qe.NONE&&!l(d)?(l(c)&&(nv(r,s,n),c=void 0),d=n.getBillboard(s),d.id=s,d.image=void 0,r.billboard=d,g=!0,f=h.equals(d.position,p)&&d.heightReference===u):u===Qe.NONE&&!l(c)&&(l(d)&&(nv(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=K.getValueOrUndefined(a._scaleByDistance,e,She),c.translucencyByDistance=K.getValueOrUndefined(a._translucencyByDistance,e,Che),c.color=K.getValueOrDefault(a._color,e,fhe,_he),c.outlineColor=K.getValueOrDefault(a._outlineColor,e,phe,The),c.outlineWidth=K.getValueOrDefault(a._outlineWidth,e,bhe),c.pixelSize=K.getValueOrDefault(a._pixelSize,e,ghe),c.distanceDisplayCondition=K.getValueOrUndefined(a._distanceDisplayCondition,e,Vhe),c.disableDepthTestDistance=K.getValueOrDefault(a._disableDepthTestDistance,e,yhe),c.splitDirection=K.getValueOrDefault(a._splitDirection,e,xhe);else if(l(d)){d.show=!0,d.position=p,d.scaleByDistance=K.getValueOrUndefined(a._scaleByDistance,e,She),d.translucencyByDistance=K.getValueOrUndefined(a._translucencyByDistance,e,Che),d.distanceDisplayCondition=K.getValueOrUndefined(a._distanceDisplayCondition,e,Vhe),d.disableDepthTestDistance=K.getValueOrDefault(a._disableDepthTestDistance,e,yhe),d.splitDirection=K.getValueOrDefault(a._splitDirection,e,xhe),d.heightReference=u;let x=K.getValueOrDefault(a._color,e,fhe,_he),_=K.getValueOrDefault(a._outlineColor,e,phe,The),C=Math.round(K.getValueOrDefault(a._outlineWidth,e,bhe)),V=Math.max(1,Math.round(K.getValueOrDefault(a._pixelSize,e,ghe)));if(C>0?(d.scale=1,g=g||C!==r.outlineWidth||V!==r.pixelSize||!Y.equals(x,r.color)||!Y.equals(_,r.outlineColor)):(d.scale=V/50,V=50,g=g||C!==r.outlineWidth||!Y.equals(x,r.color)||!Y.equals(_,r.outlineColor)),g){r.color=Y.clone(x,r.color),r.outlineColor=Y.clone(_,r.outlineColor),r.pixelSize=V,r.outlineWidth=C;let L=x.alpha,Z=x.toCssColorString(),E=_.toCssColorString(),X=JSON.stringify([Z,V,E,C]);d.setImage(X,p_(L,Z,E,C,V))}f&&d._updateClamping()}}return!0};zg.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!(l(n.pointPrimitive)||l(n.billboard)))return ft.FAILED;if(l(n.pointPrimitive))t.center=h.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(!l(i._clampedPosition))return ft.PENDING;t.center=h.clone(i._clampedPosition,t.center)}return t.radius=0,ft.DONE};zg.prototype.isDestroyed=function(){return!1};zg.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(zg.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return me(this)};zg.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 Lhe(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 Lhe(r)):(nv(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],nv(s.get(r.id),r,a),s.remove(r.id)};function nv(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 iv=zg;var tci=T(S(),1);var _ai=T(S(),1);var Bsi=T(S(),1);var Xhe=[];function y$e(e,t,n,i,o){let r=Xhe;r.length=o;let s,a=n.red,c=n.green,d=n.blue,u=n.alpha,m=i.red,p=i.green,g=i.blue,f=i.alpha;if(Y.equals(n,i)){for(s=0;s<o;s++)r[s]=Y.clone(n);return r}let x=(m-a)/o,_=(p-c)/o,C=(g-d)/o,V=(f-u)/o;for(s=0;s<o;s++)r[s]=new Y(a+s*x,c+s*_,d+s*C,u+s*V);return r}function ov(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.colors,i=y(e.width,1),o=y(e.colorsPerVertex,!1);this._positions=t,this._colors=n,this._width=i,this._colorsPerVertex=o,this._vertexFormat=Pe.clone(y(e.vertexFormat,Pe.DEFAULT)),this._arcType=y(e.arcType,en.GEODESIC),this._granularity=y(e.granularity,W.RADIANS_PER_DEGREE),this._ellipsoid=ne.clone(y(e.ellipsoid,ne.default)),this._workerName="createPolylineGeometry";let r=1+t.length*h.packedLength;r+=l(n)?1+n.length*Y.packedLength:1,this.packedLength=r+ne.packedLength+Pe.packedLength+4}ov.pack=function(e,t,n){n=y(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+=Y.packedLength)Y.pack(s[i],t,n);return ne.pack(e._ellipsoid,t,n),n+=ne.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 Ihe=ne.clone(ne.UNIT_SPHERE),Whe=new Pe,rT={positions:void 0,colors:void 0,ellipsoid:Ihe,vertexFormat:Whe,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};ov.unpack=function(e,t,n){t=y(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+=Y.packedLength)s[i]=Y.unpack(e,t);let a=ne.unpack(e,t,Ihe);t+=ne.packedLength;let c=Pe.unpack(e,t,Whe);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=ne.clone(a,n._ellipsoid),n._vertexFormat=Pe.clone(c,n._vertexFormat),n._width=d,n._colorsPerVertex=u,n._arcType=m,n._granularity=p,n):(rT.positions=r,rT.colors=s,rT.width=d,rT.colorsPerVertex=u,rT.arcType=m,rT.granularity=p,new ov(rT))};var Rhe=new h,Zhe=new h,Ghe=new h,Ehe=new h;ov.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=xo(e._positions,h.equalsEpsilon,!1,m);if(l(i)&&m.length>0){let w=0,N=m[0];i=i.filter(function(B,U){let O=!1;return o?O=U===N||U===0&&N===1:O=U+1===N,O?(w++,N=m[w],!1):!0})}let g=p.length;if(g<2||t<=0)return;if(r===en.GEODESIC||r===en.RHUMB){let w,N;r===en.GEODESIC?(w=W.chordLength(s,a.maximumRadius),N=Zi.numberOfPoints):(w=s,N=Zi.numberOfPointsRhumbLine);let B=Zi.extractHeights(p,a);if(l(i)){let U=1;for(c=0;c<g-1;++c)U+=N(p[c],p[c+1],w);let O=new Array(U),k=0;for(c=0;c<g-1;++c){let J=p[c],H=p[c+1],te=i[c],z=N(J,H,w);if(o&&c<U){let j=i[c+1],ee=y$e(J,H,te,j,z),fe=ee.length;for(d=0;d<fe;++d)O[k++]=ee[d]}else for(d=0;d<z;++d)O[k++]=Y.clone(te)}O[k]=Y.clone(i[i.length-1]),i=O,Xhe.length=0}r===en.GEODESIC?p=Zi.generateCartesianArc({positions:p,minDistance:w,ellipsoid:a,height:B}):p=Zi.generateCartesianRhumbArc({positions:p,granularity:w,ellipsoid:a,height:B})}g=p.length;let f=g*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,E=0,X=0,v=0,P=0,A;for(d=0;d<g;++d){d===0?(A=Rhe,h.subtract(p[0],p[1],A),h.add(p[0],A,A)):A=p[d-1],h.clone(A,Ghe),h.clone(p[d],Zhe),d===g-1?(A=Rhe,h.subtract(p[g-1],p[g-2],A),h.add(p[g-1],A,A)):A=p[d+1],h.clone(A,Ehe);let w,N;l(Z)&&(d!==0&&!o?w=i[d-1]:w=i[d],d!==g-1&&(N=i[d]));let B=d===0?2:0,U=d===g-1?2:4;for(u=B;u<U;++u){h.pack(Zhe,x,E),h.pack(Ghe,_,E),h.pack(Ehe,C,E),E+=3;let O=u-2<0?-1:1;if(V[X++]=2*(u%2)-1,V[X++]=O*t,n.st&&(L[v++]=d/(g-1),L[v++]=Math.max(V[X-2],0)),l(Z)){let k=u<2?w:N;Z[P++]=Y.floatToByte(k.red),Z[P++]=Y.floatToByte(k.green),Z[P++]=Y.floatToByte(k.blue),Z[P++]=Y.floatToByte(k.alpha)}}}let M=new mn;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=Ae.createTypedArray(f,g*6-6),R=0,G=0,I=g-1;for(d=0;d<I;++d)b[G++]=R,b[G++]=R+2,b[G++]=R+1,b[G++]=R+1,b[G++]=R+2,b[G++]=R+3,R+=4;return new ht({attributes:M,indices:b,primitiveType:Fe.TRIANGLES,boundingSphere:ce.fromPoints(p),geometryType:su.POLYLINES})};var A0=ov;var x$e=new Jn(0),Pk={},Phe=new Y,_$e=new Yt(Y.WHITE),T$e=new Jn(!0),S$e=new Jn(_n.DISABLED),C$e=new Jn(new Pt),V$e=new Jn(kn.BOTH);function L$e(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function R$e(){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 be,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 L$e,this._groundGeometryOptions=new R$e,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)&&K.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 y(n,!1)};lh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new xn(n&&t.isShowing&&this._showProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Nn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r},a;return this._materialProperty instanceof Yt&&(l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Phe)),l(a)||(a=Y.WHITE),s.color=Ht.fromColor(a)),this.clampToGround?new Vt({id:t,geometry:new _x(this._groundGeometryOptions),attributes:s}):(l(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof Yt&&(l(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||n)&&(a=this._depthFailMaterialProperty.color.getValue(e,Phe)),l(a)||(a=Y.WHITE),s.depthFailColor=Ht.fromColor(a)),new Vt({id:t,geometry:new A0(this._geometryOptions),attributes:s}))};lh.prototype.createOutlineGeometryInstance=function(e){};lh.prototype.isDestroyed=function(){return!1};lh.prototype.destroy=function(){this._entitySubscription(),me(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(De.MINIMUM_VALUE)||!l(r)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let a=o.zIndex,c=y(o.material,_$e),d=c instanceof Yt;this._materialProperty=c,this._depthFailMaterialProperty=o.depthFailMaterial,this._showProperty=y(s,T$e),this._shadowsProperty=y(o.shadows,S$e),this._distanceDisplayConditionProperty=y(o.distanceDisplayCondition,C$e),this._classificationTypeProperty=y(o.classificationType,V$e),this._fillEnabled=!0,this._zIndex=y(a,x$e);let u=o.width,m=o.arcType,p=o.clampToGround,g=o.granularity;if(!r.isConstant||!K.isConstant(u)||!K.isConstant(m)||!K.isConstant(g)||!K.isConstant(p)||!K.isConstant(a))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{let f=this._geometryOptions,x=r.getValue(De.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 Yt)?_=Yr.VERTEX_FORMAT:_=ea.VERTEX_FORMAT,f.vertexFormat=_,f.positions=x,f.width=l(u)?u.getValue(De.MINIMUM_VALUE):void 0,f.arcType=l(m)?m.getValue(De.MINIMUM_VALUE):void 0,f.granularity=l(g)?g.getValue(De.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(De.MINIMUM_VALUE):!1,!this._clampToGround&&l(a)&&Nt("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 rv(e,t,this)};var rV={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function rv(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 vhe(e){if(l(e._line))return e._line;let t=e._primitives,n=e._geometryUpdater._scene.id+t._guid,i=Pk[n];!l(i)||i.isDestroyed()?(i=new Om,Pk[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}rv.prototype.update=function(e){let t=this._geometryUpdater,n=t._entity,i=n.polyline,o=i.positions,r=K.getValueOrUndefined(o,e,this._positions);t._clampToGround=K.getValueOrDefault(i._clampToGround,e,!1),t._groundGeometryOptions.positions=r,t._groundGeometryOptions.width=K.getValueOrDefault(i._width,e,1),t._groundGeometryOptions.arcType=K.getValueOrDefault(i._arcType,e,en.GEODESIC),t._groundGeometryOptions.granularity=K.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)||!K.getValueOrDefault(i._show,e,!0)||!l(r)||r.length<2)return;let m=t.fillMaterialProperty,p;if(m instanceof Yt)p=new Yr;else{let g=Ko.getValue(e,m,this._material);p=new ea({material:g,translucent:g.isTranslucent()}),this._material=g}this._groundPolylinePrimitive=s.add(new Cm({geometryInstances:t.createFillGeometryInstance(e),appearance:p,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),K.getValueOrUndefined(t.zIndex,e)),l(this._line)&&(this._line.show=!1);return}let a=vhe(this);if(!n.isShowing||!n.isAvailable(e)||!K.getValueOrDefault(i._show,e,!0)){a.show=!1;return}if(!l(r)||r.length<2){a.show=!1;return}let c=en.GEODESIC;c=K.getValueOrDefault(i._arcType,e,c);let d=t._scene.globe,u=t._scene.ellipsoid;c!==en.NONE&&l(d)&&(rV.ellipsoid=u,rV.positions=r,rV.granularity=K.getValueOrUndefined(i._granularity,e),rV.height=Zi.extractHeights(r,u),c===en.GEODESIC?r=Zi.generateCartesianArc(rV):r=Zi.generateCartesianRhumbArc(rV)),a.show=!0,a.positions=r.slice(),a.material=Ko.getValue(e,t.fillMaterialProperty,a.material),a.width=K.getValueOrDefault(i._width,e,1),a.distanceDisplayCondition=K.getValueOrUndefined(i._distanceDisplayCondition,e,a.distanceDisplayCondition)};rv.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),ft.DONE}return l(t)&&!t.ready?ft.PENDING:ft.DONE}else{let t=vhe(this);if(t.show&&t.positions.length>0)return ce.fromPoints(t.positions,e),ft.DONE}return ft.FAILED};rv.prototype.isDestroyed=function(){return!1};rv.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=Pk[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete Pk[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),me(this)};var sv=lh;var Aai=T(S(),1);var Z$e=new Y,G$e=new Pt,E$e=new Pt;function dh(e,t,n,i,o){let r;n instanceof Yt?r=Yr:r=ea,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=r,this.materialProperty=n,this.updaters=new Lt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Lt,this.material=void 0,this.updatersWithAttributes=new Lt,this.attributes=new Lt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(dh.prototype.onMaterialChanged,this),this.subscriptions=new Lt,this.showsUpdated=new Lt,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 Yt&&t instanceof Yt?!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||!K.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 Cm({show:!1,asynchronous:this._asynchronous,geometryInstances:o.slice(),appearance:new this.appearanceType,classificationType:this.classificationType}),this.appearanceType===ea&&(this.material=Ko.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===ea&&(this.material=Ko.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,_=K.getValueOrDefault(x,e,Y.WHITE,Z$e);Y.equals(m._lastColor,_)||(m._lastColor=Y.clone(_,m._lastColor),m.color=Ht.toValue(_,m.color))}let p=d.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=m.show[0]===1;p!==g&&(m.show=xn.toValue(p,m.show));let f=c.distanceDisplayConditionProperty;if(!K.isConstant(f)){let x=K.getValueOrDefault(f,e,E$e,G$e);Pt.equals(x,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=Pt.clone(x,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=Nn.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),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=xn.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 ft.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ft.FAILED:(i.boundingSphere.clone(t),ft.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 sV(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=y(n,!0)}sV.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=K.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)};sV.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}}};sV.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};sV.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 ft.FAILED};sV.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 av=sV;var X$e=[];function whe(e,t){let n=e._batches,i=n.length;for(let o=0;o<i;o++)n[o].remove(t)}function Fhe(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 Yt?1:2);let r;l(i)&&(r=i+o*_n.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof Yt?e._colorBatches[r].add(t,n):e._materialBatches[r].add(t,n))}function Cf(e,t,n,i){i=y(i,e.groundPrimitives),n=y(n,e.primitives),this._scene=e,this._primitives=n,this._entityCollection=void 0,this._addedObjects=new Lt,this._removedObjects=new Lt,this._changedObjects=new Lt;let o,r=_n.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 Bu(n,Yr,void 0,!1,o),this._materialBatches[o]=new Yu(n,ea,void 0,!1,o),this._colorBatches[o+r]=new Bu(n,Yr,Yr,!1,o),this._materialBatches[o+r]=new Yu(n,ea,Yr,!1,o),this._colorBatches[o+r*2]=new Bu(n,Yr,ea,!1,o),this._materialBatches[o+r*2]=new Yu(n,ea,ea,!1,o);this._dynamicBatch=new O_(n,i);let s=kn.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(s),o=0;o<s;++o)this._groundBatches[o]=new av(i,o);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new Lt,this._updaters=new Lt,this._entityCollection=t,t.collectionChanged.addEventListener(Cf.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,X$e)}Cf.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?(whe(this,u),Fhe(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),whe(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 sv(c,this._scene),this._updaters.set(d,u),Fhe(this,e,u),this._subscriptions.set(d,u.geometryChanged.addEventListener(Cf._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let m=!0,p=this._batches,g=p.length;for(a=0;a<g;a++)m=p[a].update(e)&&m;return m};var I$e=[],W$e=new ce;Cf.prototype.getBoundingSphere=function(e,t){let n=I$e,i=W$e,o=0,r=ft.DONE,s=this._batches,a=s.length,c=this._updaters.get(e.id);for(let d=0;d<a;d++){if(r=s[d].getBoundingSphere(c,i),r===ft.PENDING)return ft.PENDING;r===ft.DONE&&(n[o]=ce.clone(i,n[o]),o++)}return o===0?ft.FAILED:(n.length=o,ce.fromBoundingSpheres(n,t),ft.DONE)};Cf.prototype.isDestroyed=function(){return!1};Cf.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Cf.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(),me(this)};Cf._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)};Cf.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 cv=Cf;function kl(e){Fc.initializeTerrainHeights(),Cm.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new vr,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=y(e.visualizersCallback,kl.defaultVisualizersCallback);let i=!1,o=new Al,r=new Al;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 aP;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}var aV=[];kl.registerVisualizer=function(e){aV.includes(e)||aV.push(e)};kl.unregisterVisualizer=function(e){if(aV.includes(e)){let t=aV.indexOf(e);aV.splice(t,1)}};kl.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new HG(t,i),new jP(e,i,n._primitives,n._groundPrimitives),new qP(t,i),new $P(e,i),new H2(e,i),new iv(t,i),new tv(e,i),new cv(e,i,n._primitives,n._groundPrimitives),...aV.map(o=>new o(e,i))]};Object.defineProperties(kl.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}}});kl.prototype.isDestroyed=function(){return!1};kl.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)),me(this)};kl.prototype.update=function(e){if(!ai.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&&this._scene.requestRender(),this._ready=t,t};kl.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 P$e=[],v$e=new ce;kl.prototype.getBoundingSphere=function(e,t,n){if(!this._ready)return ft.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 g=p.get(i);if(g.entities.contains(e)){r=g;break}}}if(!l(r))return ft.FAILED;let s=P$e,a=v$e,c=0,d=ft.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===ft.PENDING)return ft.PENDING;d===ft.DONE&&(s[c]=ce.clone(a,s[c]),c++)}}return c===0?ft.FAILED:(s.length=c,ce.fromBoundingSpheres(s,n),ft.DONE)};kl.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,o=this._groundPrimitives,r=i.add(new Al),s=o.add(new SP);t._primitives=r,t._groundPrimitives=s;let a=t.clustering;a._initialize(n),r.add(a),t._visualizers=this._visualizersCallback(n,a,t)};kl.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};kl.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 lv=kl;var kci=T(S(),1);var Zci=T(S(),1);function bJ(e,t,n){this.heading=y(e,0),this.pitch=y(t,0),this.range=y(n,0)}bJ.clone=function(e,t){if(l(e))return l(t)||(t=new bJ),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var Hu=bJ;var Ahe=new $,Mhe=new $,Nhe=new $,w$e=new F,vk=new h,khe=new h,gJ=new h,yJ=new h,Uhe=new h,Dhe=new h,cV=new q,F$e=1.25;function A$e(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,g;if(a===oe.SCENE3D){q.addSeconds(r,.001,cV);let V=o.getValue(cV,vk);if(l(V)||(q.addSeconds(r,-.001,cV),V=o.getValue(cV,vk),u=!0),l(V)){let L=wt.computeFixedToIcrfMatrix(r,Ahe),Z=wt.computeFixedToIcrfMatrix(cV,Mhe),E;!l(L)||!l(Z)?(E=wt.computeTemeToPseudoFixedMatrix(r,Nhe),L=$.transpose(E,Ahe),Z=wt.computeTemeToPseudoFixedMatrix(cV,Mhe),$.transpose(Z,Z)):E=$.transpose(L,Nhe);let X=$.multiplyByVector(L,c,Uhe),v=$.multiplyByVector(Z,V,Dhe);h.subtract(X,v,yJ);let P=h.magnitude(yJ)*1e3,A=W.GRAVITATIONALPARAMETER,M=-A/(P*P-2*A/h.magnitude(X));M<0||M>F$e*s.maximumRadius?(m=khe,h.normalize(c,m),h.negate(m,m),g=h.clone(h.UNIT_Z,gJ),p=h.cross(g,m,vk),h.magnitude(p)>W.EPSILON7&&(h.normalize(m,m),h.normalize(p,p),g=h.cross(m,p,gJ),h.normalize(g,g),d=!0)):h.equalsEpsilon(c,V,W.EPSILON7)||(g=khe,h.normalize(X,g),h.normalize(v,v),p=h.cross(g,v,gJ),u&&(p=h.multiplyByScalar(p,-1,p)),h.equalsEpsilon(p,h.ZERO,W.EPSILON7)||(m=h.cross(p,g,vk),$.multiplyByVector(E,m,m),$.multiplyByVector(E,p,p),$.multiplyByVector(E,g,g),h.normalize(m,m),h.normalize(p,p),h.normalize(g,g),d=!0))}}l(e.boundingSphere)&&(c=e.boundingSphere.center);let f,x,_;i&&(f=h.clone(t.position,yJ),x=h.clone(t.direction,Uhe),_=h.clone(t.up,Dhe));let C=w$e;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]=g.x,C[9]=g.y,C[10]=g.z,C[11]=0,C[12]=c.x,C[13]=c.y,C[14]=c.z,C[15]=0):wt.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===oe.SCENE2D||h.equals(e._offset3D,h.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,d)}}function dv(e,t,n){this.entity=e,this.scene=t,this.ellipsoid=y(n,ne.default),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(dv,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=h.clone(e,new h)}}});dv.defaultOffset3D=new h(-14e3,3500,3500);var wk=new Hu,M$e=new h;dv.prototype.update=function(e,t){let n=this.scene,i=this.ellipsoid,o=n.mode;if(o===oe.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,g=l(p);if(!g&&l(t)){wk.pitch=-W.PI_OVER_FOUR,wk.range=0;let f=s.getValue(e,M$e);if(l(f)){let x=2-1/Math.max(1,h.magnitude(f)/i.maximumRadius);wk.pitch*=x}d.viewBoundingSphere(t,wk),this.boundingSphere=t,u=!1,m=!1}else(!g||!l(p.getValue(e,this._offset3D)))&&h.clone(dv._defaultOffset3D,this._offset3D)}else!c&&this._mode!==oe.SCENE2D&&h.clone(d.position,this._offset3D);this._lastEntity=r,this._mode=o,A$e(this,d,u,m,s,e,i)};var uv=dv;var ydi=T(S(),1);var zci=T(S(),1);function hv(){this._cache={}}hv.prototype.fromColor=function(e,t){return Fk(void 0,void 0,e,t,this._cache)};hv.prototype.fromUrl=function(e,t,n){return Fk(e,void 0,t,n,this._cache)};hv.prototype.fromMakiIconId=function(e,t,n){return Fk(nn(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};hv.prototype.fromText=function(e,t,n){return Fk(void 0,e,t,n,this._cache)};var N$e=new Y;function k$e(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,N$e).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 Bhe(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=Y.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=Y.WHITE.toCssColorString(),e.fillRect(s-1,a-2,o+2,r+2)}var mv=new Array(4);function Fk(e,t,n,i,o){mv[0]=e,mv[1]=t,mv[2]=n,mv[3]=i;let r=JSON.stringify(mv),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(k$e(c,n,i),l(e)){let u=Ee.createIfNeeded(e).fetchImage().then(function(m){return Bhe(c,m,i),o[r]=a,a});return o[r]=u,u}else if(l(t)){let d=g_(t,{font:`bold ${i}px sans-serif`});Bhe(c,d,i)}return o[r]=a,a}var M0=hv;var Ali=T(S());var tli=T(S());var qci=T(S());var Jci=T(S());function xJ(e){return e}function Ak(e){if(e==null)return xJ;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 ali=T(S());var ili=T(S());function Yhe(e,t){for(var n,i=e.length,o=i-t;o<--i;)n=e[o],e[o++]=e[i],e[i]=n}function _J(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return Ohe(e,n)})}:Ohe(e,t)}function Ohe(e,t){var n=t.id,i=t.bbox,o=t.properties==null?{}:t.properties,r=TJ(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 TJ(e,t){var n=Ak(e.transform),i=e.arcs;function o(u,m){m.length&&m.pop();for(var p=i[u<0?~u:u],g=0,f=p.length;g<f;++g)m.push(n(p[g],g));u<0&&Yhe(m,f)}function r(u){return n(u)}function s(u){for(var m=[],p=0,g=u.length;p<g;++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 hli=T(S());var lli=T(S());var gli=T(S());var Cli=T(S());var xli=T(S());var Xli=T(S());var Rli=T(S());function Mk(e){return h.fromDegrees(e[0],e[1],e[2])}var SJ={"urn:ogc:def:crs:OGC:1.3:CRS84":Mk,"EPSG:4326":Mk,"urn:ogc:def:crs:EPSG::4326":Mk},Hhe={},zhe={},CJ=48,VJ,LJ=Y.ROYALBLUE,RJ=Y.YELLOW,ZJ=2,GJ=Y.fromBytes(255,255,0,100),EJ=!1,O$e={small:24,medium:48,large:64},H$e=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function Khe(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||H$e.indexOf(i)!==-1)continue;let o=e[i];l(o)&&(typeof o=="object"?n+=`<tr><th>${i}</th><td>${Khe(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 z$e(e,t,n){let i;return function(o,r){return l(i)||(i=e(t,n)),i}}function K$e(e,t){return new Zm(z$e(Khe,e,t),!0)}function Nk(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=Bn();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 Jn(c):n(r,s))}return o}function XJ(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var Jhe={Feature:jhe,FeatureCollection:J$e,GeometryCollection:qhe,LineString:ife,MultiLineString:ofe,MultiPoint:tfe,MultiPolygon:afe,Point:efe,Polygon:sfe,Topology:cfe},Qhe={GeometryCollection:qhe,LineString:ife,MultiLineString:ofe,MultiPoint:tfe,MultiPolygon:afe,Point:efe,Polygon:sfe,Topology:cfe};function jhe(e,t,n,i,o){if(t.geometry===null){Nk(t,e._entityCollection,o.describe);return}if(!l(t.geometry))throw new ue("feature.geometry is required.");let r=t.geometry.type,s=Qhe[r];if(!l(s))throw new ue(`Unknown geometry type: ${r}`);s(e,t,t.geometry,i,o)}function J$e(e,t,n,i,o){let r=t.features;for(let s=0,a=r.length;s<a;s++)jhe(e,r[s],void 0,i,o)}function qhe(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=Qhe[d];if(!l(u))throw new ue(`Unknown geometry type: ${d}`);u(e,t,c,i,o)}}function $he(e,t,n,i,o){let r=o.markerSymbol,s=o.markerColor,a=o.markerSize,c=t.properties;if(l(c)){let g=c["marker-color"];l(g)&&(s=Y.fromCssColorString(g)),a=y(O$e[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 ec;u.verticalOrigin=new Jn(Pn.BOTTOM),i.length===2&&o.clampToGround&&(u.heightReference=Qe.CLAMP_TO_GROUND);let m=Nk(t,e._entityCollection,o.describe);m.billboard=u,m.position=new Mc(n(i));let p=Promise.resolve(d).then(function(g){u.image=new Jn(g)}).catch(function(){u.image=new Jn(e._pinBuilder.fromColor(s,a))});e._promises.push(p)}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){let r=o.strokeMaterialProperty,s=o.strokeWidthProperty,a=t.properties;if(l(a)){let u=a["stroke-width"];l(u)&&(s=new Jn(u));let m,p=a.stroke;l(p)&&(m=Y.fromCssColorString(p));let g=a["stroke-opacity"];l(g)&&g!==1&&(l(m)||(m=r.color.getValue().clone()),m.alpha=g),l(m)&&(r=new Yt(m))}let c=Nk(t,e._entityCollection,o.describe),d=new ic;c.polyline=d,d.clampToGround=o.clampToGround,d.material=r,d.width=s,d.positions=new Jn(XJ(i,n)),d.arcType=en.RHUMB}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){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 g=c["stroke-width"];l(g)&&(a=new Jn(g));let f,x=c.stroke;l(x)&&(f=Y.fromCssColorString(x));let _=c["stroke-opacity"];l(_)&&_!==1&&(l(f)||(f=r.getValue().clone()),f.alpha=_),l(f)&&(r=new Jn(f));let C,V=c.fill,L=s.color.getValue();l(V)&&(C=Y.fromCssColorString(V),C.alpha=L.alpha),_=c["fill-opacity"],l(_)&&_!==L.alpha&&(l(C)||(C=L.clone()),C.alpha=_),l(C)&&(s=new Yt(C))}let d=new Lm;d.outline=new Jn(!0),d.outlineColor=r,d.outlineWidth=a,d.material=s,d.arcType=en.RHUMB;let u=[];for(let g=1,f=i.length;g<f;g++)u.push(new Za(XJ(i[g],n)));let m=i[0];d.hierarchy=new Jn(new Za(XJ(m,n),u)),m[0].length>2?d.perPositionHeight=new Jn(!0):o.clampToGround||(d.height=0);let p=Nk(t,e._entityCollection,o.describe);p.polygon=d}function sfe(e,t,n,i,o){rfe(e,t,i,n.coordinates,o)}function afe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)rfe(e,t,i,r[s],o)}function cfe(e,t,n,i,o){for(let r in n.objects)if(n.objects.hasOwnProperty(r)){let s=_J(n,n.objects[r]),a=Jhe[s.type];a(e,s,s,i,o)}}function Kg(e){this._name=e,this._changed=new be,this._error=new be,this._isLoading=!1,this._loading=new be,this._entityCollection=new ks(this),this._promises=[],this._pinBuilder=new M0,this._entityCluster=new Cd,this._credit=void 0,this._resourceCredits=[]}Kg.load=function(e,t){return new Kg().load(e,t)};Object.defineProperties(Kg,{markerSize:{get:function(){return CJ},set:function(e){CJ=e}},markerSymbol:{get:function(){return VJ},set:function(e){VJ=e}},markerColor:{get:function(){return LJ},set:function(e){LJ=e}},stroke:{get:function(){return RJ},set:function(e){RJ=e}},strokeWidth:{get:function(){return ZJ},set:function(e){ZJ=e}},fill:{get:function(){return GJ},set:function(e){GJ=e}},clampToGround:{get:function(){return EJ},set:function(e){EJ=e}},crsNames:{get:function(){return SJ}},crsLinkHrefs:{get:function(){return Hhe}},crsLinkTypes:{get:function(){return zhe}}});Object.defineProperties(Kg.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}}});Kg.prototype.load=function(e,t){return lfe(this,e,t,!0)};Kg.prototype.process=function(e,t){return lfe(this,e,t,!1)};function lfe(e,t,n,i){Ar.setLoading(e,!0),n=y(n,y.EMPTY_OBJECT);let o=n.credit;typeof o=="string"&&(o=new Rt(o)),e._credit=o;let r=t,s=n.sourceUri;if(typeof t=="string"||t instanceof Ee){t=Ee.createIfNeeded(t),r=t.fetchJson(),s=y(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:y(n.describe,K$e),markerSize:y(n.markerSize,CJ),markerSymbol:y(n.markerSymbol,VJ),markerColor:y(n.markerColor,LJ),strokeWidthProperty:new Jn(y(n.strokeWidth,ZJ)),strokeMaterialProperty:new Yt(y(n.stroke,RJ)),fillMaterialProperty:new Yt(y(n.fill,GJ)),clampToGround:y(n.clampToGround,EJ)},Promise.resolve(r).then(function(a){return Q$e(e,a,n,s,i)}).catch(function(a){throw Ar.setLoading(e,!1),e._error.raiseEvent(e,a),a})}Kg.prototype.update=function(e){return!0};function Q$e(e,t,n,i,o){let r;l(i)&&(r=R0(i)),l(r)&&e._name!==r&&(e._name=r,e._changed.raiseEvent(e));let s=Jhe[t.type];if(!l(s))throw new ue(`Unsupported GeoJSON object type: ${t.type}`);let a=t.crs,c=a!==null?Mk:null;if(l(a)){if(!l(a.properties))throw new ue("crs.properties is undefined.");let d=a.properties;if(a.type==="name"){if(c=SJ[d.name],!l(c))throw new ue(`Unknown crs name: ${d.name}`)}else if(a.type==="link"){let u=Hhe[d.href];if(l(u)||(u=zhe[d.type]),!l(u))throw new ue(`Unable to resolve crs link: ${JSON.stringify(d)}`);c=u(d)}else if(a.type==="EPSG"){if(c=SJ[`EPSG:${d.code}`],!l(c))throw new ue(`Unknown crs EPSG code: ${d.code}`)}else throw new ue(`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,Ar.setLoading(e,!1),e})})}var fv=Kg;var ahi=T(S(),1);var Tmi=T(S());var rmi=T(S());var _di=T(S()),dfe="4.0.0";var Sdi=T(S());function j$e(e){return e===void 0}function Wd(e){return typeof e=="boolean"}function ufe(e,t){for(var n in t)t.hasOwnProperty(n)&&j$e(e[n])&&(e[n]=t[n]);return e}function mfe(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 Jg(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function Qg(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}var Udi=T(S());var Gdi=T(S());var Ldi=T(S()),jg=/[A-Za-z]/,Ds=/[\d]/;var Pd=/\s/,kk=/['"]/,hfe=/[\x00-\x1F\x7F]/,ffe=/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,q$e=/\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,$$e=/\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,eet=ffe+q$e+$$e,pfe=/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,Cdi=new RegExp("[".concat(ffe+pfe,"]")),IJ=eet+pfe,uh=new RegExp("[".concat(IJ,"]"));var Uk=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(Pd):[],o=t.split(Pd),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(Pd):[],o=t.split(Pd),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 Xdi=T(S());function bfe(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,E=Z.match(/^([a-z]+):\/\//i);return E&&(L.scheme=E[1],Z=Z.substr(E[0].length)),E=Z.match(/^(.*?)(?=(\?|#|\/|$))/i),E&&(L.host=E[1],Z=Z.substr(E[0].length)),E=Z.match(/^\/(.*?)(?=(\?|#|$))/i),E&&(L.path=E[1],Z=Z.substr(E[0].length)),E=Z.match(/^\?(.*?)(?=(#|$))/i),E&&(L.query=E[1],Z=Z.substr(E[0].length)),E=Z.match(/^#(.*?)$/i),E&&(L.fragment=E[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,E=Math.ceil(Z),X=-1*Math.floor(Z),v="";return X<0&&(v=V.substr(X)),V.substr(0,E)+n+v};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 g=c-m.length;return(m+a(p,g)).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 Wdi=T(S());function gfe(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 wdi=T(S());function yfe(e,t,n){return mfe(e,t,n)}var xfe=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 Uk({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"?bfe(t,i):o==="middle"?gfe(t,i):yfe(t,i)},e}();var Yui=T(S());var nui=T(S());var Bdi=T(S(),1),WJ=function(e,t){return WJ=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])},WJ(e,t)};function Vf(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");WJ(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Bs=function(){return Bs=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},Bs.apply(this,arguments)};var Odi=T(S()),Lf=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 jdi=T(S());var zdi=T(S()),tet="(?: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)",_fe=new RegExp("^"+tet+"$");var net=/[\/?#]/,iet=/[-+&@#/%=~_()|'$*\[\]{}\u2713]/,Tfe=/[?!:,.;^]/,PJ=/https?:\/\//i,Sfe=new RegExp("^"+PJ.source,"i"),Cfe=new RegExp(Tfe.source+"$"),oet=/^(javascript|vbscript):/i,ret=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/,set=/^(?:\/\/)?([^/#?:]+)/;function Dk(e){return jg.test(e)}function vJ(e){return jg.test(e)||Ds.test(e)||e==="+"||e==="-"||e==="."}function N0(e){return uh.test(e)}function Bk(e){return e==="_"||N0(e)}function wJ(e){return uh.test(e)||iet.test(e)||Tfe.test(e)}function Yk(e){return net.test(e)}function FJ(e){return _fe.test(e.toLowerCase())}function Vfe(e){if(oet.test(e))return!1;var t=e.match(ret);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!jg.test(i))}function Lfe(e){var t=e.match(set);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var o=i[i.length-1];return!!FJ(o)}var aet=/^(?:(?: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]?)$/,cet=/[:/?#]/;function Rfe(e){var t=e.split(cet,1)[0];return aet.test(t)}var det=/^(https?:\/\/)?(www\.)?/i,uet=/^\/\//,Zfe=function(e){Vf(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=fet(n)),this.stripPrefix.scheme&&(n=met(n)),this.stripPrefix.www&&(n=het(n)),this.stripTrailingSlash&&(n=pet(n)),this.decodePercentEncoding&&(n=bet(n)),n},t}(Lf);function met(e){return e.replace(Sfe,"")}function het(e){return e.replace(det,"$1")}function fet(e){return e.replace(uet,"")}function pet(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function bet(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 sui=T(S());var Gfe=/^mailto:/i,get=new RegExp("[".concat(IJ,"!#$%&'*+/=?^_`{|}~-]"));function Efe(e){return uh.test(e)}function Ok(e){return get.test(e)}function Xfe(e){var t=e.split(".").pop()||"";return FJ(t)}var dui=T(S());var Ife=function(e){Vf(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}(Lf);var hui=T(S());function AJ(e){return e==="_"||uh.test(e)}function Wfe(e){return e.length<=140}var Pfe=["twitter","facebook","instagram","tiktok"];var yui=T(S());var vfe=function(e){Vf(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 Qg(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}(Lf);var _ui=T(S()),yet={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/},xet=/[-\w.]/;function MJ(e){return xet.test(e)}function wfe(e,t){var n=yet[t];return n.test(e)}var Ffe=["twitter","instagram","soundcloud","tiktok"];var Vui=T(S());var Afe=function(e){Vf(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}(Lf);var Rui=T(S()),_et=/[-. ]/,Tet=/[-. ()]/,Cet=/[,;]/,Vet=/(?:(?:(?:(\+)?\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]+#?)*/,Let=/(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})/,Ret=new RegExp("^".concat(Vet.source,"|").concat(Let.source,"$"));function NJ(e){return _et.test(e)}function Hk(e){return Cet.test(e)}function Mfe(e){var t=e.charAt(0)==="+"||Tet.test(e);return t&&Ret.test(e)}var Xui=T(S());var Nfe=function(e){Vf(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}(Lf);function Dfe(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 g=u.length-1;g>=0;g--){var f=u[g];switch(f.state){case 11:X(f,p);break;case 12:v(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:E(f,p);break;case 5:P(f,p);break;case 6:A(f,p);break;case 7:M(f,p);break;case 13:b(f,p);break;case 14:R(f,p);break;case 8:G(f,p);break;case 9:I(f,p);break;case 10:w(f,p);break;case 15:N(f,p);break;case 16:B(f,p);break;case 17:U(f,p);break;case 18:O(f,p);break;case 19:k(f,p);break;case 20:J(f,p);break;case 21:H(f,p);break;case 22:te(f,p);break;case 23:z(f,p);break;case 24:j(f,p);break;case 25:ee(f,p);break;case 26:fe(f,p);break;case 27:_e(f,p);break;case 28:le(f,p);break;case 29:ge(f,p);break;case 30:Se(f,p);break;case 31:Ie(f,p);break;case 32:ke(f,p);break;case 33:Be(f,p);break;case 34:st(f,p);break;case 35:vt(f,p);break;case 36:Ct(f,p);break;case 37:Le(f,p);break;case 38:Xe(f,p);break;case 39:je(f,p);break;case 40:$e(f,p);break;case 41:He(f,p);break;default:Qg(f.state)}}}for(var x=u.length-1;x>=0;x--)u.forEach(function(Ce){return Ut(Ce)});return c;function _(Ce){if(Ce==="#")u.push(Iet(m,28));else if(Ce==="@")u.push(Wet(m,30));else if(Ce==="/")u.push(UJ(m,11));else if(Ce==="+")u.push(DJ(m,37));else if(Ce==="(")u.push(DJ(m,32));else{if(Ds.test(Ce)&&(u.push(DJ(m,38)),u.push(Eet(m,13))),Efe(Ce)){var Ve=Ce.toLowerCase()==="m"?15:22;u.push(Xet(m,Ve))}Dk(Ce)&&u.push(kJ(m,0)),uh.test(Ce)&&u.push(UJ(m,5))}}function C(Ce,Ve){Ve===":"?Ce.state=2:Ve==="-"?Ce.state=1:vJ(Ve)||Bo(u,Ce)}function V(Ce,Ve){Ve==="-"||(Ve==="/"?(Bo(u,Ce),u.push(UJ(m,11))):vJ(Ve)?Ce.state=0:Bo(u,Ce))}function L(Ce,Ve){Ve==="/"?Ce.state=3:Ve==="."?Bo(u,Ce):N0(Ve)?(Ce.state=5,Dk(Ve)&&u.push(kJ(m,0))):Bo(u,Ce)}function Z(Ce,Ve){Ve==="/"?Ce.state=4:wJ(Ve)?(Ce.state=10,Ce.acceptStateReached=!0):Ut(Ce)}function E(Ce,Ve){Ve==="/"?Ce.state=10:N0(Ve)?(Ce.state=5,Ce.acceptStateReached=!0):Bo(u,Ce)}function X(Ce,Ve){Ve==="/"?Ce.state=12:Bo(u,Ce)}function v(Ce,Ve){N0(Ve)?Ce.state=5:Bo(u,Ce)}function P(Ce,Ve){Ve==="."?Ce.state=7:Ve==="-"?Ce.state=6:Ve===":"?Ce.state=8:Yk(Ve)?Ce.state=10:Bk(Ve)||Ut(Ce)}function A(Ce,Ve){Ve==="-"||(Ve==="."?Ut(Ce):N0(Ve)?Ce.state=5:Ut(Ce))}function M(Ce,Ve){Ve==="."?Ut(Ce):N0(Ve)?(Ce.state=5,Ce.acceptStateReached=!0):Ut(Ce)}function b(Ce,Ve){Ve==="."?Ce.state=14:Ve===":"?Ce.state=8:Ds.test(Ve)||(Yk(Ve)?Ce.state=10:uh.test(Ve)?Bo(u,Ce):Ut(Ce))}function R(Ce,Ve){Ds.test(Ve)?(Ce.octetsEncountered++,Ce.octetsEncountered===4&&(Ce.acceptStateReached=!0),Ce.state=13):Ut(Ce)}function G(Ce,Ve){Ds.test(Ve)?Ce.state=9:Ut(Ce)}function I(Ce,Ve){Ds.test(Ve)||(Yk(Ve)?Ce.state=10:Ut(Ce))}function w(Ce,Ve){wJ(Ve)||Ut(Ce)}function N(Ce,Ve){Ve.toLowerCase()==="a"?Ce.state=16:te(Ce,Ve)}function B(Ce,Ve){Ve.toLowerCase()==="i"?Ce.state=17:te(Ce,Ve)}function U(Ce,Ve){Ve.toLowerCase()==="l"?Ce.state=18:te(Ce,Ve)}function O(Ce,Ve){Ve.toLowerCase()==="t"?Ce.state=19:te(Ce,Ve)}function k(Ce,Ve){Ve.toLowerCase()==="o"?Ce.state=20:te(Ce,Ve)}function J(Ce,Ve){Ve.toLowerCase()===":"?Ce.state=21:te(Ce,Ve)}function H(Ce,Ve){Ok(Ve)?Ce.state=22:Bo(u,Ce)}function te(Ce,Ve){Ve==="."?Ce.state=23:Ve==="@"?Ce.state=24:Ok(Ve)?Ce.state=22:Bo(u,Ce)}function z(Ce,Ve){Ve==="."?Bo(u,Ce):Ve==="@"?Bo(u,Ce):Ok(Ve)?Ce.state=22:Bo(u,Ce)}function j(Ce,Ve){N0(Ve)?Ce.state=25:Bo(u,Ce)}function ee(Ce,Ve){Ve==="."?Ce.state=27:Ve==="-"?Ce.state=26:Bk(Ve)||Ut(Ce)}function fe(Ce,Ve){Ve==="-"||Ve==="."?Ut(Ce):Bk(Ve)?Ce.state=25:Ut(Ce)}function _e(Ce,Ve){Ve==="."||Ve==="-"?Ut(Ce):N0(Ve)?(Ce.state=25,Ce.acceptStateReached=!0):Ut(Ce)}function le(Ce,Ve){AJ(Ve)?(Ce.state=29,Ce.acceptStateReached=!0):Bo(u,Ce)}function ge(Ce,Ve){AJ(Ve)||Ut(Ce)}function Se(Ce,Ve){MJ(Ve)?(Ce.state=31,Ce.acceptStateReached=!0):Bo(u,Ce)}function Ie(Ce,Ve){MJ(Ve)||(uh.test(Ve)?Bo(u,Ce):Ut(Ce))}function Le(Ce,Ve){Ds.test(Ve)?Ce.state=38:(Bo(u,Ce),_(Ve))}function ke(Ce,Ve){Ds.test(Ve)?Ce.state=33:Bo(u,Ce),_(Ve)}function Be(Ce,Ve){Ds.test(Ve)?Ce.state=34:Bo(u,Ce)}function st(Ce,Ve){Ds.test(Ve)?Ce.state=35:Bo(u,Ce)}function vt(Ce,Ve){Ve===")"?Ce.state=36:Bo(u,Ce)}function Ct(Ce,Ve){Ds.test(Ve)?Ce.state=38:NJ(Ve)?Ce.state=39:Bo(u,Ce)}function Xe(Ce,Ve){Ce.acceptStateReached=!0,Hk(Ve)?Ce.state=40:Ve==="#"?Ce.state=41:Ds.test(Ve)||(Ve==="("?Ce.state=32:NJ(Ve)?Ce.state=39:(Ut(Ce),Dk(Ve)&&u.push(kJ(m,0))))}function je(Ce,Ve){Ds.test(Ve)?Ce.state=38:Ve==="("?Ce.state=32:(Ut(Ce),_(Ve))}function $e(Ce,Ve){Hk(Ve)||(Ve==="#"?Ce.state=41:Ds.test(Ve)?Ce.state=38:Ut(Ce))}function He(Ce,Ve){Hk(Ve)?Ce.state=40:Ds.test(Ve)?Bo(u,Ce):Ut(Ce)}function Ut(Ce){if(Bo(u,Ce),!!Ce.acceptStateReached){var Ve=Ce.startIdx,ct=e.slice(Ce.startIdx,m);if(ct=Get(ct),Ce.type==="url"){var Ni=e.charAt(Ce.startIdx-1);if(Ni==="@")return;var mt=Ce.matchType;if(mt==="scheme"){var _o=PJ.exec(ct);if(_o&&(Ve=Ve+_o.index,ct=ct.slice(_o.index)),!Vfe(ct))return}else if(mt==="tld"){if(!Lfe(ct))return}else if(mt==="ipV4"){if(!Rfe(ct))return}else Qg(mt);c.push(new Zfe({tagBuilder:n,matchedText:ct,offset:Ve,urlMatchType:mt,url:ct,protocolRelativeMatch:ct.slice(0,2)==="//",stripPrefix:i,stripTrailingSlash:o,decodePercentEncoding:r}))}else if(Ce.type==="email")Xfe(ct)&&c.push(new Ife({tagBuilder:n,matchedText:ct,offset:Ve,email:ct.replace(Gfe,"")}));else if(Ce.type==="hashtag")Wfe(ct)&&c.push(new vfe({tagBuilder:n,matchedText:ct,offset:Ve,serviceName:s,hashtag:ct.slice(1)}));else if(Ce.type==="mention")wfe(ct,a)&&c.push(new Afe({tagBuilder:n,matchedText:ct,offset:Ve,serviceName:a,mention:ct.slice(1)}));else if(Ce.type==="phone"){if(ct=ct.replace(/ +$/g,""),Mfe(ct)){var ur=ct.replace(/[^0-9,;#]/g,"");c.push(new Nfe({tagBuilder:n,matchedText:ct,offset:Ve,number:ur,plusSign:ct.charAt(0)==="+"}))}}else Qg(Ce)}}}var Zet=/[\(\{\[]/,kfe=/[\)\}\]]/,Ufe={")":"(","}":"{","]":"["};function Get(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n);Zet.test(i)?t[i]++:kfe.test(i)&&t[Ufe[i]]--}for(var o=e.length-1,r;o>=0;)if(r=e.charAt(o),kfe.test(r)){var s=Ufe[r];if(t[s]<0)t[s]++,o--;else break}else if(Cfe.test(r))o--;else break;return e.slice(0,o+1)}function kJ(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"scheme"}}function UJ(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"tld"}}function Eet(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"ipV4",octetsEncountered:1}}function Xet(e,t){return{type:"email",startIdx:e,state:t,acceptStateReached:!1}}function Iet(e,t){return{type:"hashtag",startIdx:e,state:t,acceptStateReached:!1}}function Wet(e,t){return{type:"mention",startIdx:e,state:t,acceptStateReached:!1}}function DJ(e,t){return{type:"phone",startIdx:e,state:t,acceptStateReached:!1}}var Jui=T(S());function Bfe(e,t){for(var n=t.onOpenTag,i=t.onCloseTag,o=t.onText,r=t.onComment,s=t.onDoctype,a=new Rf,c=0,d=e.length,u=0,m=0,p=a;c<d;){var g=e.charAt(c);switch(u){case 0:f(g);break;case 1:x(g);break;case 2:C(g);break;case 3:_(g);break;case 4:V(g);break;case 5:L(g);break;case 6:Z(g);break;case 7:E(g);break;case 8:X(g);break;case 9:v(g);break;case 10:P(g);break;case 11:A(g);break;case 12:M(g);break;case 13:b(g);break;case 14:R(g);break;case 15:G(g);break;case 16:I(g);break;case 17:w(g);break;case 18:N(g);break;case 19:B(g);break;case 20:U(g);break;default:Qg(u)}c++}m<c&&H();function f(j){j==="<"&&k()}function x(j){j==="!"?u=13:j==="/"?(u=2,p=new Rf(Bs(Bs({},p),{isClosing:!0}))):j==="<"?k():jg.test(j)?(u=3,p=new Rf(Bs(Bs({},p),{isOpening:!0}))):(u=0,p=a)}function _(j){Pd.test(j)?(p=new Rf(Bs(Bs({},p),{name:te()})),u=4):j==="<"?k():j==="/"?(p=new Rf(Bs(Bs({},p),{name:te()})),u=12):j===">"?(p=new Rf(Bs(Bs({},p),{name:te()})),J()):!jg.test(j)&&!Ds.test(j)&&j!==":"&&O()}function C(j){j===">"?O():jg.test(j)?u=3:O()}function V(j){Pd.test(j)||(j==="/"?u=12:j===">"?J():j==="<"?k():j==="="||kk.test(j)||hfe.test(j)?O():u=5)}function L(j){Pd.test(j)?u=6:j==="/"?u=12:j==="="?u=7:j===">"?J():j==="<"?k():kk.test(j)&&O()}function Z(j){Pd.test(j)||(j==="/"?u=12:j==="="?u=7:j===">"?J():j==="<"?k():kk.test(j)?O():u=5)}function E(j){Pd.test(j)||(j==='"'?u=8:j==="'"?u=9:/[>=`]/.test(j)?O():j==="<"?k():u=10)}function X(j){j==='"'&&(u=11)}function v(j){j==="'"&&(u=11)}function P(j){Pd.test(j)?u=4:j===">"?J():j==="<"&&k()}function A(j){Pd.test(j)?u=4:j==="/"?u=12:j===">"?J():j==="<"?k():(u=4,z())}function M(j){j===">"?(p=new Rf(Bs(Bs({},p),{isClosing:!0})),J()):u=4}function b(j){e.substr(c,2)==="--"?(c+=2,p=new Rf(Bs(Bs({},p),{type:"comment"})),u=14):e.substr(c,7).toUpperCase()==="DOCTYPE"?(c+=7,p=new Rf(Bs(Bs({},p),{type:"doctype"})),u=20):O()}function R(j){j==="-"?u=15:j===">"?O():u=16}function G(j){j==="-"?u=18:j===">"?O():u=16}function I(j){j==="-"&&(u=17)}function w(j){j==="-"?u=18:u=16}function N(j){j===">"?J():j==="!"?u=19:j==="-"||(u=16)}function B(j){j==="-"?u=17:j===">"?J():u=16}function U(j){j===">"?J():j==="<"&&k()}function O(){u=0,p=a}function k(){u=1,p=new Rf({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)),O(),m=c+1}function H(){var j=e.slice(m,c);o(j,m),m=c+1}function te(){var j=p.idx+(p.isClosing?2:1);return e.slice(j,c).toLowerCase()}function z(){c--}}var Rf=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 Pet=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=vet(t.urls),this.email=Wd(t.email)?t.email:this.email,this.phone=Wd(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=Wd(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=wet(t.stripPrefix),this.stripTrailingSlash=Wd(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=Wd(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&Ffe.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&Pfe.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=Fet(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 Bfe(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 g=n.parseText(m,u);r.push.apply(r,g)}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||Jg(t,function(n){return n.getType()==="hashtag"}),this.email||Jg(t,function(n){return n.getType()==="email"}),this.phone||Jg(t,function(n){return n.getType()==="phone"}),this.mention||Jg(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||Jg(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||Jg(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||Jg(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=Dfe(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 Uk)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new xfe({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=dfe,e}(),Yfe=Pet;function vet(e){return e==null&&(e=!0),Wd(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:Wd(e.schemeMatches)?e.schemeMatches:!0,tldMatches:Wd(e.tldMatches)?e.tldMatches:!0,ipV4Matches:Wd(e.ipV4Matches)?e.ipV4Matches:!0}}function wet(e){return e==null&&(e=!0),Wd(e)?{scheme:e,www:e}:{scheme:Wd(e.scheme)?e.scheme:!0,www:Wd(e.www)?e.www:!0}}function Fet(e){return typeof e=="number"?{length:e,location:"end"}:ufe(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})}var cmi=T(S());var smi=T(S());var gmi=T(S());var zk=Yfe;var $fe;typeof DOMParser<"u"&&($fe=new DOMParser);var Aet=new zk({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),Kk=32,Ofe=2414016,Hfe=1,zfe=16093e3,Kfe=.1,Met=[null,void 0,"http://www.topografix.com/GPX/1/1"],Ro={gpx:Met};function Net(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 BJ(e,t){let n=gv(e,"id");return n=l(n)?n:Bn(),t.getOrCreateEntity(n)}function YJ(e){let t=Jfe(e,"lon"),n=Jfe(e,"lat"),i=pv(e,"ele",Ro.gpx);return h.fromDegrees(t,n,i)}function Jfe(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 gv(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function qg(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 OJ(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 pv(e,t,n){let i=qg(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function Ul(e,t,n){let i=qg(e,t,n);if(l(i))return i.textContent.trim()}function epe(e){let t=new ec;return t.width=Kk,t.height=Kk,t.scaleByDistance=new kt(Ofe,Hfe,zfe,Kfe),t.pixelOffsetScaleByDistance=new kt(Ofe,Hfe,zfe,Kfe),t.verticalOrigin=new Jn(Pn.BOTTOM),t.image=e,t}function ket(){let e=new Vm;return e.translucencyByDistance=new kt(3e6,1,5e6,0),e.pixelOffset=new D(17,0),e.horizontalOrigin=gi.LEFT,e.font="16px sans-serif",e.style=No.FILL_AND_OUTLINE,e}function tpe(e){let t=new ic;return t.width=4,t.material=new Fg,t.material.color=l(e)?e:Y.RED,t.material.outlineWidth=2,t.material.outlineColor=Y.BLACK,t}var Qfe={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"}},bv;typeof document<"u"&&(bv=document.createElement("div"));function HJ(e,t){let n,i="",o=Object.keys(Qfe),r=o.length;for(n=0;n<r;n++){let u=o[n],m=Qfe[u];m.value=y(Ul(e,m.tag,Ro.gpx),""),l(m.value)&&m.value!==""&&(i=`${i}<p>${m.text}: ${m.value}</p>`)}if(!l(i)||i==="")return;i=Aet.link(i),bv.innerHTML=i;let s=bv.querySelectorAll("a");for(n=0;n<s.length;n++)s[n].setAttribute("target","_blank");let a=Y.WHITE,c=Y.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+=`${bv.innerHTML}</div>`,bv.innerHTML="",d}function npe(e,t,n,i){let o=YJ(t),r=BJ(t,n);r.position=o;let s=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",Y.RED,Kk);r.billboard=epe(s);let a=Ul(t,"name",Ro.gpx);r.name=a,r.label=ket(),r.label.text=a,r.description=HJ(t,r),i.clampToGround&&(r.billboard.heightReference=Qe.CLAMP_TO_GROUND,r.label.heightReference=Qe.CLAMP_TO_GROUND)}function Uet(e,t,n,i){let o=BJ(t,n);o.description=HJ(t,o);let r=OJ(t,"rtept",Ro.gpx),s=new Array(r.length);for(let a=0;a<r.length;a++)npe(e,r[a],n,i),s[a]=YJ(r[a]);o.polyline=tpe(i.routeColor),i.clampToGround&&(o.polyline.clampToGround=!0),o.polyline.positions=s}function Det(e,t,n,i){let o=BJ(t,n);o.description=HJ(t,o);let r=OJ(t,"trkseg",Ro.gpx),s=[],a=[],c,d=!0,u=new ca;for(let m=0;m<r.length;m++)c=Bet(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",Y.RED,Kk);o.billboard=epe(m),o.position=u,i.clampToGround&&(o.billboard.heightReference=Qe.CLAMP_TO_GROUND),o.availability=new Fr,o.availability.addInterval(new Vn({start:a[0],stop:a[a.length-1]}))}o.polyline=tpe(i.trackColor),o.polyline.positions=s,i.clampToGround&&(o.polyline.clampToGround=!0)}function Bet(e){let t={positions:[],times:[]},n=OJ(e,"trkpt",Ro.gpx),i;for(let o=0;o<n.length;o++){let r=YJ(n[o]);t.positions.push(r),i=Ul(n[o],"time",Ro.gpx),l(i)&&t.times.push(q.fromIso8601(i))}return t}function Yet(e){let t=qg(e,"metadata",Ro.gpx);if(l(t)){let n={name:Ul(t,"name",Ro.gpx),desc:Ul(t,"desc",Ro.gpx),author:Oet(t),copyright:zet(t),link:ipe(t),time:Ul(t,"time",Ro.gpx),keywords:Ul(t,"keywords",Ro.gpx),bounds:Ket(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 Oet(e){let t=qg(e,"author",Ro.gpx);if(l(t)){let n={name:Ul(t,"name",Ro.gpx),email:Het(t),link:ipe(t)};if(l(n.name)||l(n.email)||l(n.link))return n}}function Het(e){let t=qg(e,"email",Ro.gpx);if(l(t)){let n=Ul(t,"id",Ro.gpx),i=Ul(t,"domain",Ro.gpx);return`${n}@${i}`}}function ipe(e){let t=qg(e,"link",Ro.gpx);if(l(t)){let n={href:gv(t,"href"),text:Ul(t,"text",Ro.gpx),mimeType:Ul(t,"type",Ro.gpx)};if(l(n.href)||l(n.text)||l(n.mimeType))return n}}function zet(e){let t=qg(e,"copyright",Ro.gpx);if(l(t)){let n={author:gv(t,"author"),year:Ul(t,"year",Ro.gpx),license:Ul(t,"license",Ro.gpx)};if(l(n.author)||l(n.year)||l(n.license))return n}}function Ket(e){let t=qg(e,"bounds",Ro.gpx);if(l(t)){let n={minLat:pv(t,"minlat",Ro.gpx),maxLat:pv(t,"maxlat",Ro.gpx),minLon:pv(t,"minlon",Ro.gpx),maxLon:pv(t,"maxlon",Ro.gpx)};if(l(n.minLat)||l(n.maxLat)||l(n.minLon)||l(n.maxLon))return n}}var jfe={wpt:npe,rte:Uet,trk:Det};function Jet(e,t,n,i){let o=Object.keys(jfe),r=o.length;for(let s=0;s<r;s++){let a=o[s],c=jfe[a],d=t.childNodes,u=d.length;for(let m=0;m<u;m++){let p=d[m];p.localName===a&&Ro.gpx.indexOf(p.namespaceURI)!==-1&&c(e,p,n,i)}}}function qfe(e,t,n){let i=e._entityCollection;i.removeAll();let o=t.documentElement,r=gv(o,"version"),s=gv(o,"creator"),a,c=Yet(o);l(c)&&(a=c.name),o.localName==="gpx"?Jet(e,o,i,n):console.log(`GPX - Unsupported node: ${o.localName}`);let d,u=i.computeAvailability(),m=u.start,p=u.stop,g=q.equals(m,De.MINIMUM_VALUE),f=q.equals(p,De.MAXIMUM_VALUE);if(!g||!f){let _;g&&(_=new Date,_.setHours(0,0,0,0),m=q.fromDate(_)),f&&(_=new Date,_.setHours(24,0,0,0),p=q.fromDate(_)),d=new th,d.startTime=m,d.stopTime=p,d.currentTime=q.clone(m),d.clockRange=Mr.LOOP_STOP,d.clockStep=mo.SYSTEM_CLOCK_MULTIPLIER,d.multiplier=Math.round(Math.min(Math.max(q.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),Qet(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),Ar.setLoading(e,!1),e}function Qet(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 jet(e,t,n,i){i=y(i,y.EMPTY_OBJECT);let o=n;if(typeof n=="string"||n instanceof Ee){n=Ee.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?Net(r).then(function(s){let a,c;try{a=$fe.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 ue(d)}return qfe(e,a,i)}):qfe(e,r,i)}).catch(function(r){return e._error.raiseEvent(e,r),console.log(r),Promise.reject(r)})}function lV(){this._changed=new be,this._error=new be,this._loading=new be,this._clock=void 0,this._entityCollection=new ks(this),this._entityCluster=new Cd,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new M0}lV.load=function(e,t){return new lV().load(e,t)};Object.defineProperties(lV.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}}});lV.prototype.update=function(e){return!0};lV.prototype.load=function(e,t){if(!l(e))throw new pe("data is required.");t=y(t,y.EMPTY_OBJECT),Ar.setLoading(this,!0);let n=this._name,i=this;return jet(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,c=q.equals(s,De.MINIMUM_VALUE),d=q.equals(a,De.MAXIMUM_VALUE);if(!c||!d){let m;c&&(m=new Date,m.setHours(0,0,0,0),s=q.fromDate(m)),d&&(m=new Date,m.setHours(24,0,0,0),a=q.fromDate(m)),o=new th,o.startTime=s,o.stopTime=a,o.currentTime=q.clone(s),o.clockRange=Mr.LOOP_STOP,o.clockStep=mo.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(q.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),Ar.setLoading(i,!1),i}).catch(function(o){return Ar.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};var yv=lV;var lhi=T(S(),1);function qet(e,t){this.position=e,this.headingPitchRoll=t}var xv=qet;var B0i=T(S(),1);var Bv=T(td(),1);var qfi=T(S(),1);var uhi=T(S(),1);function tU(e){return nU(e.map(([t,n])=>new Array(t).fill(n,0,t)))}function nU(e){return e.reduce((t,n)=>t.concat(Array.isArray(n)?nU(n):n),[])}var ope=[0,1,2,3].concat(...tU([[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 cr(){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,g,f,x,_=0;for(g=0;g<=15;g++)o.bl_count[g]=0;for(r[o.heap[o.heap_max]*2+1]=0,u=o.heap_max+1;u<573;u++)m=o.heap[u],g=r[r[m*2+1]*2+1]+1,g>d&&(g=d,_++),r[m*2+1]=g,!(m>e.max_code)&&(o.bl_count[g]++,f=0,m>=c&&(f=a[m-c]),x=r[m*2],o.opt_len+=x*(g+f),s&&(o.static_len+=x*(s[m*2+1]+f)));if(_!==0){do{for(g=d-1;o.bl_count[g]===0;)g--;o.bl_count[g]--,o.bl_count[g+1]+=2,o.bl_count[d]--,_-=2}while(_>0);for(g=d;g!==0;g--)for(m=o.bl_count[g];m!==0;)p=o.heap[--u],!(p>e.max_code)&&(r[p*2+1]!=g&&(o.opt_len+=(g-r[p*2+1])*r[p*2],r[p*2+1]=g),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)}}cr._length_code=[0,1,2,3,4,5,6,7].concat(...tU([[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]]));cr.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];cr.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];cr.d_code=function(e){return e<256?ope[e]:ope[256+(e>>>7)]};cr.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];cr.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];cr.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];cr.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function Pa(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 $et=[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],ett=tU([[144,8],[112,9],[24,7],[8,8]]);Pa.static_ltree=nU($et.map((e,t)=>[e,ett[t]]));var ttt=[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],ntt=tU([[30,5]]);Pa.static_dtree=nU(ttt.map((e,t)=>[e,ntt[t]]));Pa.static_l_desc=new Pa(Pa.static_ltree,cr.extra_lbits,257,286,15);Pa.static_d_desc=new Pa(Pa.static_dtree,cr.extra_dbits,0,30,15);Pa.static_bl_desc=new Pa(null,cr.extra_blbits,0,19,7);var itt=9,ott=8;function Zf(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 spe=0,$k=1,sT=2,mh=[new Zf(0,0,0,0,spe),new Zf(4,4,8,4,$k),new Zf(4,5,16,8,$k),new Zf(4,6,32,32,$k),new Zf(4,4,16,16,sT),new Zf(8,16,32,32,sT),new Zf(8,16,128,128,sT),new Zf(8,32,128,256,sT),new Zf(32,128,258,1024,sT),new Zf(32,258,258,4096,sT)],Jk=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],zu=0,Qk=1,_v=2,jk=3,rtt=32,zJ=42,qk=113,Tv=666,KJ=8,stt=0,JJ=1,att=2,_r=3,eU=258,vd=eU+_r+1;function rpe(e,t,n,i){let o=e[t*2],r=e[n*2];return o<r||o==r&&i[t]<=i[n]}function ctt(){let e=this,t,n,i,o,r,s,a,c,d,u,m,p,g,f,x,_,C,V,L,Z,E,X,v,P,A,M,b,R,G,I,w,N,B,U=new cr,O=new cr,k=new cr;e.depth=[];let J,H,te,z,j,ee;e.bl_count=[],e.heap=[],w=[],N=[],B=[];function fe(){d=2*r,m[g-1]=0;for(let Ne=0;Ne<g-1;Ne++)m[Ne]=0;M=mh[b].max_lazy,G=mh[b].good_length,I=mh[b].nice_length,A=mh[b].max_chain,E=0,C=0,v=0,V=P=_r-1,Z=0,p=0}function _e(){let Ne;for(Ne=0;Ne<286;Ne++)w[Ne*2]=0;for(Ne=0;Ne<30;Ne++)N[Ne*2]=0;for(Ne=0;Ne<19;Ne++)B[Ne*2]=0;w[256*2]=1,e.opt_len=e.static_len=0,H=te=0}function le(){U.dyn_tree=w,U.stat_desc=Pa.static_l_desc,O.dyn_tree=N,O.stat_desc=Pa.static_d_desc,k.dyn_tree=B,k.stat_desc=Pa.static_bl_desc,j=0,ee=0,z=8,_e()}e.pqdownheap=function(Ne,ut){let Je=e.heap,qe=Je[ut],pt=ut<<1;for(;pt<=e.heap_len&&(pt<e.heap_len&&rpe(Ne,Je[pt+1],Je[pt],e.depth)&&pt++,!rpe(Ne,qe,Je[pt],e.depth));)Je[ut]=Je[pt],ut=pt,pt<<=1;Je[ut]=qe};function ge(Ne,ut){let Je=-1,qe,pt=Ne[0*2+1],Zt=0,yn=7,po=4;pt===0&&(yn=138,po=3),Ne[(ut+1)*2+1]=65535;for(let ir=0;ir<=ut;ir++)qe=pt,pt=Ne[(ir+1)*2+1],!(++Zt<yn&&qe==pt)&&(Zt<po?B[qe*2]+=Zt:qe!==0?(qe!=Je&&B[qe*2]++,B[16*2]++):Zt<=10?B[17*2]++:B[18*2]++,Zt=0,Je=qe,pt===0?(yn=138,po=3):qe==pt?(yn=6,po=3):(yn=7,po=4))}function Se(){let Ne;for(ge(w,U.max_code),ge(N,O.max_code),k.build_tree(e),Ne=18;Ne>=3&&B[cr.bl_order[Ne]*2+1]===0;Ne--);return e.opt_len+=3*(Ne+1)+5+5+4,Ne}function Ie(Ne){e.pending_buf[e.pending++]=Ne}function Le(Ne){Ie(Ne&255),Ie(Ne>>>8&255)}function ke(Ne){Ie(Ne>>8&255),Ie(Ne&255&255)}function Be(Ne,ut){let Je,qe=ut;ee>16-qe?(Je=Ne,j|=Je<<ee&65535,Le(j),j=Je>>>16-ee,ee+=qe-16):(j|=Ne<<ee&65535,ee+=qe)}function st(Ne,ut){let Je=Ne*2;Be(ut[Je]&65535,ut[Je+1]&65535)}function vt(Ne,ut){let Je,qe=-1,pt,Zt=Ne[0*2+1],yn=0,po=7,ir=4;for(Zt===0&&(po=138,ir=3),Je=0;Je<=ut;Je++)if(pt=Zt,Zt=Ne[(Je+1)*2+1],!(++yn<po&&pt==Zt)){if(yn<ir)do st(pt,B);while(--yn!==0);else pt!==0?(pt!=qe&&(st(pt,B),yn--),st(16,B),Be(yn-3,2)):yn<=10?(st(17,B),Be(yn-3,3)):(st(18,B),Be(yn-11,7));yn=0,qe=pt,Zt===0?(po=138,ir=3):pt==Zt?(po=6,ir=3):(po=7,ir=4)}}function Ct(Ne,ut,Je){let qe;for(Be(Ne-257,5),Be(ut-1,5),Be(Je-4,4),qe=0;qe<Je;qe++)Be(B[cr.bl_order[qe]*2+1],3);vt(w,Ne-1),vt(N,ut-1)}function Xe(){ee==16?(Le(j),j=0,ee=0):ee>=8&&(Ie(j&255),j>>>=8,ee-=8)}function je(){Be(JJ<<1,3),st(256,Pa.static_ltree),Xe(),1+z+10-ee<9&&(Be(JJ<<1,3),st(256,Pa.static_ltree),Xe()),z=7}function $e(Ne,ut){let Je,qe,pt;if(e.dist_buf[H]=Ne,e.lc_buf[H]=ut&255,H++,Ne===0?w[ut*2]++:(te++,Ne--,w[(cr._length_code[ut]+256+1)*2]++,N[cr.d_code(Ne)*2]++),!(H&8191)&&b>2){for(Je=H*8,qe=E-C,pt=0;pt<30;pt++)Je+=N[pt*2]*(5+cr.extra_dbits[pt]);if(Je>>>=3,te<Math.floor(H/2)&&Je<Math.floor(qe/2))return!0}return H==J-1}function He(Ne,ut){let Je,qe,pt=0,Zt,yn;if(H!==0)do Je=e.dist_buf[pt],qe=e.lc_buf[pt],pt++,Je===0?st(qe,Ne):(Zt=cr._length_code[qe],st(Zt+256+1,Ne),yn=cr.extra_lbits[Zt],yn!==0&&(qe-=cr.base_length[Zt],Be(qe,yn)),Je--,Zt=cr.d_code(Je),st(Zt,ut),yn=cr.extra_dbits[Zt],yn!==0&&(Je-=cr.base_dist[Zt],Be(Je,yn)));while(pt<H);st(256,Ne),z=Ne[256*2+1]}function Ut(){ee>8?Le(j):ee>0&&Ie(j&255),j=0,ee=0}function Ce(Ne,ut,Je){Ut(),z=8,Je&&(Le(ut),Le(~ut)),e.pending_buf.set(c.subarray(Ne,Ne+ut),e.pending),e.pending+=ut}function Ve(Ne,ut,Je){Be((stt<<1)+(Je?1:0),3),Ce(Ne,ut,!0)}function ct(Ne,ut,Je){let qe,pt,Zt=0;b>0?(U.build_tree(e),O.build_tree(e),Zt=Se(),qe=e.opt_len+3+7>>>3,pt=e.static_len+3+7>>>3,pt<=qe&&(qe=pt)):qe=pt=ut+5,ut+4<=qe&&Ne!=-1?Ve(Ne,ut,Je):pt==qe?(Be((JJ<<1)+(Je?1:0),3),He(Pa.static_ltree,Pa.static_dtree)):(Be((att<<1)+(Je?1:0),3),Ct(U.max_code+1,O.max_code+1,Zt+1),He(w,N)),_e(),Je&&Ut()}function Ni(Ne){ct(C>=0?C:-1,E-C,Ne),C=E,t.flush_pending()}function mt(){let Ne,ut,Je,qe;do{if(qe=d-v-E,qe===0&&E===0&&v===0)qe=r;else if(qe==-1)qe--;else if(E>=r+r-vd){c.set(c.subarray(r,r+r),0),X-=r,E-=r,C-=r,Ne=g,Je=Ne;do ut=m[--Je]&65535,m[Je]=ut>=r?ut-r:0;while(--Ne!==0);Ne=r,Je=Ne;do ut=u[--Je]&65535,u[Je]=ut>=r?ut-r:0;while(--Ne!==0);qe+=r}if(t.avail_in===0)return;Ne=t.read_buf(c,E+v,qe),v+=Ne,v>=_r&&(p=c[E]&255,p=(p<<_^c[E+1]&255)&x)}while(v<vd&&t.avail_in!==0)}function _o(Ne){let ut=65535,Je;for(ut>i-5&&(ut=i-5);;){if(v<=1){if(mt(),v===0&&Ne==0)return zu;if(v===0)break}if(E+=v,v=0,Je=C+ut,(E===0||E>=Je)&&(v=E-Je,E=Je,Ni(!1),t.avail_out===0)||E-C>=r-vd&&(Ni(!1),t.avail_out===0))return zu}return Ni(Ne==4),t.avail_out===0?Ne==4?_v:zu:Ne==4?jk:Qk}function ur(Ne){let ut=A,Je=E,qe,pt,Zt=P,yn=E>r-vd?E-(r-vd):0,po=I,ir=a,Da=E+eU,Ba=c[Je+Zt-1],ns=c[Je+Zt];P>=G&&(ut>>=2),po>v&&(po=v);do if(qe=Ne,!(c[qe+Zt]!=ns||c[qe+Zt-1]!=Ba||c[qe]!=c[Je]||c[++qe]!=c[Je+1])){Je+=2,qe++;do;while(c[++Je]==c[++qe]&&c[++Je]==c[++qe]&&c[++Je]==c[++qe]&&c[++Je]==c[++qe]&&c[++Je]==c[++qe]&&c[++Je]==c[++qe]&&c[++Je]==c[++qe]&&c[++Je]==c[++qe]&&Je<Da);if(pt=eU-(Da-Je),Je=Da-eU,pt>Zt){if(X=Ne,Zt=pt,pt>=po)break;Ba=c[Je+Zt-1],ns=c[Je+Zt]}}while((Ne=u[Ne&ir]&65535)>yn&&--ut!==0);return Zt<=v?Zt:v}function Zc(Ne){let ut=0,Je;for(;;){if(v<vd){if(mt(),v<vd&&Ne==0)return zu;if(v===0)break}if(v>=_r&&(p=(p<<_^c[E+(_r-1)]&255)&x,ut=m[p]&65535,u[E&a]=m[p],m[p]=E),ut!==0&&(E-ut&65535)<=r-vd&&R!=2&&(V=ur(ut)),V>=_r)if(Je=$e(E-X,V-_r),v-=V,V<=M&&v>=_r){V--;do E++,p=(p<<_^c[E+(_r-1)]&255)&x,ut=m[p]&65535,u[E&a]=m[p],m[p]=E;while(--V!==0);E++}else E+=V,V=0,p=c[E]&255,p=(p<<_^c[E+1]&255)&x;else Je=$e(0,c[E]&255),v--,E++;if(Je&&(Ni(!1),t.avail_out===0))return zu}return Ni(Ne==4),t.avail_out===0?Ne==4?_v:zu:Ne==4?jk:Qk}function Sr(Ne){let ut=0,Je,qe;for(;;){if(v<vd){if(mt(),v<vd&&Ne==0)return zu;if(v===0)break}if(v>=_r&&(p=(p<<_^c[E+(_r-1)]&255)&x,ut=m[p]&65535,u[E&a]=m[p],m[p]=E),P=V,L=X,V=_r-1,ut!==0&&P<M&&(E-ut&65535)<=r-vd&&(R!=2&&(V=ur(ut)),V<=5&&(R==1||V==_r&&E-X>4096)&&(V=_r-1)),P>=_r&&V<=P){qe=E+v-_r,Je=$e(E-1-L,P-_r),v-=P-1,P-=2;do++E<=qe&&(p=(p<<_^c[E+(_r-1)]&255)&x,ut=m[p]&65535,u[E&a]=m[p],m[p]=E);while(--P!==0);if(Z=0,V=_r-1,E++,Je&&(Ni(!1),t.avail_out===0))return zu}else if(Z!==0){if(Je=$e(0,c[E-1]&255),Je&&Ni(!1),E++,v--,t.avail_out===0)return zu}else Z=1,E++,v--}return Z!==0&&(Je=$e(0,c[E-1]&255),Z=0),Ni(Ne==4),t.avail_out===0?Ne==4?_v:zu:Ne==4?jk:Qk}function ts(Ne){return Ne.total_in=Ne.total_out=0,Ne.msg=null,e.pending=0,e.pending_out=0,n=qk,o=0,le(),fe(),0}e.deflateInit=function(Ne,ut,Je,qe,pt,Zt){return qe||(qe=KJ),pt||(pt=ott),Zt||(Zt=0),Ne.msg=null,ut==-1&&(ut=6),pt<1||pt>itt||qe!=KJ||Je<9||Je>15||ut<0||ut>9||Zt<0||Zt>2?-2:(Ne.dstate=e,s=Je,r=1<<s,a=r-1,f=pt+7,g=1<<f,x=g-1,_=Math.floor((f+_r-1)/_r),c=new Uint8Array(r*2),u=[],m=[],J=1<<pt+6,e.pending_buf=new Uint8Array(J*4),i=J*4,e.dist_buf=new Uint16Array(J),e.lc_buf=new Uint8Array(J),b=ut,R=Zt,ts(Ne))},e.deflateEnd=function(){return n!=zJ&&n!=qk&&n!=Tv?-2:(e.lc_buf=null,e.dist_buf=null,e.pending_buf=null,m=null,u=null,c=null,e.dstate=null,n==qk?-3:0)},e.deflateParams=function(Ne,ut,Je){let qe=0;return ut==-1&&(ut=6),ut<0||ut>9||Je<0||Je>2?-2:(mh[b].func!=mh[ut].func&&Ne.total_in!==0&&(qe=Ne.deflate(1)),b!=ut&&(b=ut,M=mh[b].max_lazy,G=mh[b].good_length,I=mh[b].nice_length,A=mh[b].max_chain),R=Je,qe)},e.deflateSetDictionary=function(Ne,ut,Je){let qe=Je,pt,Zt=0;if(!ut||n!=zJ)return-2;if(qe<_r)return 0;for(qe>r-vd&&(qe=r-vd,Zt=Je-qe),c.set(ut.subarray(Zt,Zt+qe),0),E=qe,C=qe,p=c[0]&255,p=(p<<_^c[1]&255)&x,pt=0;pt<=qe-_r;pt++)p=(p<<_^c[pt+(_r-1)]&255)&x,u[pt&a]=m[p],m[p]=pt;return 0},e.deflate=function(Ne,ut){let Je,qe,pt,Zt,yn;if(ut>4||ut<0)return-2;if(!Ne.next_out||!Ne.next_in&&Ne.avail_in!==0||n==Tv&&ut!=4)return Ne.msg=Jk[4],-2;if(Ne.avail_out===0)return Ne.msg=Jk[7],-5;if(t=Ne,Zt=o,o=ut,n==zJ&&(qe=KJ+(s-8<<4)<<8,pt=(b-1&255)>>1,pt>3&&(pt=3),qe|=pt<<6,E!==0&&(qe|=rtt),qe+=31-qe%31,n=qk,ke(qe)),e.pending!==0){if(t.flush_pending(),t.avail_out===0)return o=-1,0}else if(t.avail_in===0&&ut<=Zt&&ut!=4)return t.msg=Jk[7],-5;if(n==Tv&&t.avail_in!==0)return Ne.msg=Jk[7],-5;if(t.avail_in!==0||v!==0||ut!=0&&n!=Tv){switch(yn=-1,mh[b].func){case spe:yn=_o(ut);break;case $k:yn=Zc(ut);break;case sT:yn=Sr(ut);break;default:}if((yn==_v||yn==jk)&&(n=Tv),yn==zu||yn==_v)return t.avail_out===0&&(o=-1),0;if(yn==Qk){if(ut==1)je();else if(Ve(0,0,!1),ut==3)for(Je=0;Je<g;Je++)m[Je]=0;if(t.flush_pending(),t.avail_out===0)return o=-1,0}}return ut!=4?0:1}}function ape(){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}ape.prototype={deflateInit(e,t){let n=this;return n.dstate=new ctt,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 cpe(e){let t=this,n=new ape,i=ltt(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,g=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))),g+=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(g),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 ltt(e){return e+5*(Math.floor(e/16383)+1)}var hhi=T(S(),1);var wd=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],Gpe=1440,dtt=0,utt=4,mtt=9,htt=5,ftt=[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],ptt=[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],btt=[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],gtt=[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],ytt=[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],xtt=[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],$g=15;function $J(){let e=this,t,n,i,o,r,s;function a(d,u,m,p,g,f,x,_,C,V,L){let Z,E,X,v,P,A,M,b,R,G,I,w,N,B,U;G=0,P=m;do i[d[u+G]]++,G++,P--;while(P!==0);if(i[0]==m)return x[0]=-1,_[0]=0,0;for(b=_[0],A=1;A<=$g&&i[A]===0;A++);for(M=A,b<A&&(b=A),P=$g;P!==0&&i[P]===0;P--);for(X=P,b>P&&(b=P),_[0]=b,B=1<<A;A<P;A++,B<<=1)if((B-=i[A])<0)return-3;if((B-=i[P])<0)return-3;for(i[P]+=B,s[1]=A=0,G=1,N=2;--P!==0;)s[N]=A+=i[G],N++,G++;P=0,G=0;do(A=d[u+G])!==0&&(L[s[A]++]=P),G++;while(++P<m);for(m=s[X],s[0]=P=0,G=0,v=-1,w=-b,r[0]=0,I=0,U=0;M<=X;M++)for(Z=i[M];Z--!==0;){for(;M>w+b;){if(v++,w+=b,U=X-w,U=U>b?b:U,(E=1<<(A=M-w))>Z+1&&(E-=Z+1,N=M,A<U))for(;++A<U&&!((E<<=1)<=i[++N]);)E-=i[N];if(U=1<<A,V[0]+U>Gpe)return-3;r[v]=I=V[0],V[0]+=U,v!==0?(s[v]=P,o[0]=A,o[1]=b,A=P>>>w-b,o[2]=I-r[v-1]-A,C.set(o,(r[v-1]+A)*3)):x[0]=I}for(o[1]=M-w,G>=m?o[0]=192:L[G]<p?(o[0]=L[G]<256?0:96,o[2]=L[G++]):(o[0]=f[L[G]-p]+16+64,o[2]=g[L[G++]-p]),E=1<<M-w,A=P>>>w;A<U;A+=E)C.set(o,(I+A)*3);for(A=1<<M-1;P&A;A>>>=1)P^=A;for(P^=A,R=(1<<w)-1;(P&R)!=s[v];)v--,w-=b,R=(1<<w)-1}return B!==0&&X!=1?-5:0}function c(d){let u;for(t||(t=[],n=[],i=new Int32Array($g+1),o=[],r=new Int32Array($g),s=new Int32Array($g+1)),n.length<d&&(n=[]),u=0;u<d;u++)n[u]=0;for(u=0;u<$g+1;u++)i[u]=0;for(u=0;u<3;u++)o[u]=0;r.set(i.subarray(0,$g),0),s.set(i.subarray(0,$g+1),0)}e.inflate_trees_bits=function(d,u,m,p,g){let f;return c(19),t[0]=0,f=a(d,0,19,19,null,null,m,u,p,t,n),f==-3?g.msg="oversubscribed dynamic bit lengths tree":(f==-5||u[0]===0)&&(g.msg="incomplete dynamic bit lengths tree",f=-3),f},e.inflate_trees_dynamic=function(d,u,m,p,g,f,x,_,C){let V;return c(288),t[0]=0,V=a(m,0,d,257,btt,gtt,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,ytt,xtt,x,g,_,t,n),V!=0||g[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)}}$J.inflate_trees_fixed=function(e,t,n,i){return e[0]=mtt,t[0]=htt,n[0]=ftt,i[0]=ptt,0};var iU=0,lpe=1,dpe=2,upe=3,mpe=4,hpe=5,fpe=6,QJ=7,ppe=8,oU=9;function _tt(){let e=this,t,n=0,i,o=0,r=0,s=0,a=0,c=0,d=0,u=0,m,p=0,g,f=0;function x(_,C,V,L,Z,E,X,v){let P,A,M,b,R,G,I,w,N,B,U,O,k,J,H,te;I=v.next_in_index,w=v.avail_in,R=X.bitb,G=X.bitk,N=X.write,B=N<X.read?X.read-N-1:X.end-N,U=wd[_],O=wd[C];do{for(;G<20;)w--,R|=(v.read_byte(I++)&255)<<G,G+=8;if(P=R&U,A=V,M=L,te=(M+P)*3,(b=A[te])===0){R>>=A[te+1],G-=A[te+1],X.win[N++]=A[te+2],B--;continue}do{if(R>>=A[te+1],G-=A[te+1],b&16){for(b&=15,k=A[te+2]+(R&wd[b]),R>>=b,G-=b;G<15;)w--,R|=(v.read_byte(I++)&255)<<G,G+=8;P=R&O,A=Z,M=E,te=(M+P)*3,b=A[te];do if(R>>=A[te+1],G-=A[te+1],b&16){for(b&=15;G<b;)w--,R|=(v.read_byte(I++)&255)<<G,G+=8;if(J=A[te+2]+(R&wd[b]),R>>=b,G-=b,B-=k,N>=J)H=N-J,N-H>0&&2>N-H?(X.win[N++]=X.win[H++],X.win[N++]=X.win[H++],k-=2):(X.win.set(X.win.subarray(H,H+2),N),N+=2,H+=2,k-=2);else{H=N-J;do H+=X.end;while(H<0);if(b=X.end-H,k>b){if(k-=b,N-H>0&&b>N-H)do X.win[N++]=X.win[H++];while(--b!==0);else X.win.set(X.win.subarray(H,H+b),N),N+=b,H+=b,b=0;H=0}}if(N-H>0&&k>N-H)do X.win[N++]=X.win[H++];while(--k!==0);else X.win.set(X.win.subarray(H,H+k),N),N+=k,H+=k,k=0;break}else if(!(b&64))P+=A[te+2],P+=R&wd[b],te=(M+P)*3,b=A[te];else return v.msg="invalid distance code",k=v.avail_in-w,k=G>>3<k?G>>3:k,w+=k,I-=k,G-=k<<3,X.bitb=R,X.bitk=G,v.avail_in=w,v.total_in+=I-v.next_in_index,v.next_in_index=I,X.write=N,-3;while(!0);break}if(b&64)return b&32?(k=v.avail_in-w,k=G>>3<k?G>>3:k,w+=k,I-=k,G-=k<<3,X.bitb=R,X.bitk=G,v.avail_in=w,v.total_in+=I-v.next_in_index,v.next_in_index=I,X.write=N,1):(v.msg="invalid literal/length code",k=v.avail_in-w,k=G>>3<k?G>>3:k,w+=k,I-=k,G-=k<<3,X.bitb=R,X.bitk=G,v.avail_in=w,v.total_in+=I-v.next_in_index,v.next_in_index=I,X.write=N,-3);if(P+=A[te+2],P+=R&wd[b],te=(M+P)*3,(b=A[te])===0){R>>=A[te+1],G-=A[te+1],X.win[N++]=A[te+2],B--;break}}while(!0)}while(B>=258&&w>=10);return k=v.avail_in-w,k=G>>3<k?G>>3:k,w+=k,I-=k,G-=k<<3,X.bitb=R,X.bitk=G,v.avail_in=w,v.total_in+=I-v.next_in_index,v.next_in_index=I,X.write=N,0}e.init=function(_,C,V,L,Z,E){t=iU,d=_,u=C,m=V,p=L,g=Z,f=E,i=null},e.proc=function(_,C,V){let L,Z,E,X=0,v=0,P=0,A,M,b,R;for(P=C.next_in_index,A=C.avail_in,X=_.bitb,v=_.bitk,M=_.write,b=M<_.read?_.read-M-1:_.end-M;;)switch(t){case iU:if(b>=258&&A>=10&&(_.bitb=X,_.bitk=v,C.avail_in=A,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=M,V=x(d,u,m,p,g,f,_,C),P=C.next_in_index,A=C.avail_in,X=_.bitb,v=_.bitk,M=_.write,b=M<_.read?_.read-M-1:_.end-M,V!=0)){t=V==1?QJ:oU;break}r=d,i=m,o=p,t=lpe;case lpe:for(L=r;v<L;){if(A!==0)V=0;else return _.bitb=X,_.bitk=v,C.avail_in=A,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=M,_.inflate_flush(C,V);A--,X|=(C.read_byte(P++)&255)<<v,v+=8}if(Z=(o+(X&wd[L]))*3,X>>>=i[Z+1],v-=i[Z+1],E=i[Z],E===0){s=i[Z+2],t=fpe;break}if(E&16){a=E&15,n=i[Z+2],t=dpe;break}if(!(E&64)){r=E,o=Z/3+i[Z+2];break}if(E&32){t=QJ;break}return t=oU,C.msg="invalid literal/length code",V=-3,_.bitb=X,_.bitk=v,C.avail_in=A,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=M,_.inflate_flush(C,V);case dpe:for(L=a;v<L;){if(A!==0)V=0;else return _.bitb=X,_.bitk=v,C.avail_in=A,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=M,_.inflate_flush(C,V);A--,X|=(C.read_byte(P++)&255)<<v,v+=8}n+=X&wd[L],X>>=L,v-=L,r=u,i=g,o=f,t=upe;case upe:for(L=r;v<L;){if(A!==0)V=0;else return _.bitb=X,_.bitk=v,C.avail_in=A,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=M,_.inflate_flush(C,V);A--,X|=(C.read_byte(P++)&255)<<v,v+=8}if(Z=(o+(X&wd[L]))*3,X>>=i[Z+1],v-=i[Z+1],E=i[Z],E&16){a=E&15,c=i[Z+2],t=mpe;break}if(!(E&64)){r=E,o=Z/3+i[Z+2];break}return t=oU,C.msg="invalid distance code",V=-3,_.bitb=X,_.bitk=v,C.avail_in=A,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=M,_.inflate_flush(C,V);case mpe:for(L=a;v<L;){if(A!==0)V=0;else return _.bitb=X,_.bitk=v,C.avail_in=A,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=M,_.inflate_flush(C,V);A--,X|=(C.read_byte(P++)&255)<<v,v+=8}c+=X&wd[L],X>>=L,v-=L,t=hpe;case hpe: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=X,_.bitk=v,C.avail_in=A,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=M,_.inflate_flush(C,V);_.win[M++]=_.win[R++],b--,R==_.end&&(R=0),n--}t=iU;break;case fpe: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=X,_.bitk=v,C.avail_in=A,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=M,_.inflate_flush(C,V);V=0,_.win[M++]=s,b--,t=iU;break;case QJ:if(v>7&&(v-=8,A++,P--),_.write=M,V=_.inflate_flush(C,V),M=_.write,b=M<_.read?_.read-M-1:_.end-M,_.read!=_.write)return _.bitb=X,_.bitk=v,C.avail_in=A,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=M,_.inflate_flush(C,V);t=ppe;case ppe:return V=1,_.bitb=X,_.bitk=v,C.avail_in=A,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=M,_.inflate_flush(C,V);case oU:return V=-3,_.bitb=X,_.bitk=v,C.avail_in=A,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=M,_.inflate_flush(C,V);default:return V=-2,_.bitb=X,_.bitk=v,C.avail_in=A,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=M,_.inflate_flush(C,V)}},e.free=function(){}}var bpe=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],dV=0,jJ=1,gpe=2,ype=3,xpe=4,_pe=5,rU=6,sU=7,Tpe=8,aT=9;function Ttt(e,t){let n=this,i=dV,o=0,r=0,s=0,a,c=[0],d=[0],u=new _tt,m=0,p=new Int32Array(Gpe*3),g=0,f=new $J;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]=g),i==rU&&u.free(x),i=dV,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,E,X,v,P;for(Z=x.next_in_index,E=x.avail_in,V=n.bitb,L=n.bitk,X=n.write,v=X<n.read?n.read-X-1:n.end-X;;){let A,M,b,R,G,I,w,N;switch(i){case dV:for(;L<3;){if(E!==0)_=0;else return n.bitb=V,n.bitk=L,x.avail_in=E,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=X,n.inflate_flush(x,_);E--,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=jJ;break;case 1:A=[],M=[],b=[[]],R=[[]],$J.inflate_trees_fixed(A,M,b,R),u.init(A[0],M[0],b[0],0,R[0],0),V>>>=3,L-=3,i=rU;break;case 2:V>>>=3,L-=3,i=ype;break;case 3:return V>>>=3,L-=3,i=aT,x.msg="invalid block type",_=-3,n.bitb=V,n.bitk=L,x.avail_in=E,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=X,n.inflate_flush(x,_)}break;case jJ:for(;L<32;){if(E!==0)_=0;else return n.bitb=V,n.bitk=L,x.avail_in=E,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=X,n.inflate_flush(x,_);E--,V|=(x.read_byte(Z++)&255)<<L,L+=8}if((~V>>>16&65535)!=(V&65535))return i=aT,x.msg="invalid stored block lengths",_=-3,n.bitb=V,n.bitk=L,x.avail_in=E,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=X,n.inflate_flush(x,_);o=V&65535,V=L=0,i=o!==0?gpe:m!==0?sU:dV;break;case gpe:if(E===0||v===0&&(X==n.end&&n.read!==0&&(X=0,v=X<n.read?n.read-X-1:n.end-X),v===0&&(n.write=X,_=n.inflate_flush(x,_),X=n.write,v=X<n.read?n.read-X-1:n.end-X,X==n.end&&n.read!==0&&(X=0,v=X<n.read?n.read-X-1:n.end-X),v===0)))return n.bitb=V,n.bitk=L,x.avail_in=E,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=X,n.inflate_flush(x,_);if(_=0,C=o,C>E&&(C=E),C>v&&(C=v),n.win.set(x.read_buf(Z,C),X),Z+=C,E-=C,X+=C,v-=C,(o-=C)!==0)break;i=m!==0?sU:dV;break;case ype:for(;L<14;){if(E!==0)_=0;else return n.bitb=V,n.bitk=L,x.avail_in=E,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=X,n.inflate_flush(x,_);E--,V|=(x.read_byte(Z++)&255)<<L,L+=8}if(r=C=V&16383,(C&31)>29||(C>>5&31)>29)return i=aT,x.msg="too many length or distance symbols",_=-3,n.bitb=V,n.bitk=L,x.avail_in=E,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=X,n.inflate_flush(x,_);if(C=258+(C&31)+(C>>5&31),!a||a.length<C)a=[];else for(P=0;P<C;P++)a[P]=0;V>>>=14,L-=14,s=0,i=xpe;case xpe:for(;s<4+(r>>>10);){for(;L<3;){if(E!==0)_=0;else return n.bitb=V,n.bitk=L,x.avail_in=E,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=X,n.inflate_flush(x,_);E--,V|=(x.read_byte(Z++)&255)<<L,L+=8}a[bpe[s++]]=V&7,V>>>=3,L-=3}for(;s<19;)a[bpe[s++]]=0;if(c[0]=7,C=f.inflate_trees_bits(a,c,d,p,x),C!=0)return _=C,_==-3&&(a=null,i=aT),n.bitb=V,n.bitk=L,x.avail_in=E,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=X,n.inflate_flush(x,_);s=0,i=_pe;case _pe:for(;C=r,!(s>=258+(C&31)+(C>>5&31));){let B,U;for(C=c[0];L<C;){if(E!==0)_=0;else return n.bitb=V,n.bitk=L,x.avail_in=E,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=X,n.inflate_flush(x,_);E--,V|=(x.read_byte(Z++)&255)<<L,L+=8}if(C=p[(d[0]+(V&wd[C]))*3+1],U=p[(d[0]+(V&wd[C]))*3+2],U<16)V>>>=C,L-=C,a[s++]=U;else{for(P=U==18?7:U-14,B=U==18?11:3;L<C+P;){if(E!==0)_=0;else return n.bitb=V,n.bitk=L,x.avail_in=E,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=X,n.inflate_flush(x,_);E--,V|=(x.read_byte(Z++)&255)<<L,L+=8}if(V>>>=C,L-=C,B+=V&wd[P],V>>>=P,L-=P,P=s,C=r,P+B>258+(C&31)+(C>>5&31)||U==16&&P<1)return a=null,i=aT,x.msg="invalid bit length repeat",_=-3,n.bitb=V,n.bitk=L,x.avail_in=E,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=X,n.inflate_flush(x,_);U=U==16?a[P-1]:0;do a[P++]=U;while(--B!==0);s=P}}if(d[0]=-1,G=[],I=[],w=[],N=[],G[0]=9,I[0]=6,C=r,C=f.inflate_trees_dynamic(257+(C&31),1+(C>>5&31),a,G,I,w,N,p,x),C!=0)return C==-3&&(a=null,i=aT),_=C,n.bitb=V,n.bitk=L,x.avail_in=E,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=X,n.inflate_flush(x,_);u.init(G[0],I[0],p,w[0],p,N[0]),i=rU;case rU:if(n.bitb=V,n.bitk=L,x.avail_in=E,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=X,(_=u.proc(n,x,_))!=1)return n.inflate_flush(x,_);if(_=0,u.free(x),Z=x.next_in_index,E=x.avail_in,V=n.bitb,L=n.bitk,X=n.write,v=X<n.read?n.read-X-1:n.end-X,m===0){i=dV;break}i=sU;case sU:if(n.write=X,_=n.inflate_flush(x,_),X=n.write,v=X<n.read?n.read-X-1:n.end-X,n.read!=n.write)return n.bitb=V,n.bitk=L,x.avail_in=E,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=X,n.inflate_flush(x,_);i=Tpe;case Tpe:return _=1,n.bitb=V,n.bitk=L,x.avail_in=E,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=X,n.inflate_flush(x,_);case aT:return _=-3,n.bitb=V,n.bitk=L,x.avail_in=E,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=X,n.inflate_flush(x,_);default:return _=-2,n.bitb=V,n.bitk=L,x.avail_in=E,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=X,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==jJ?1:0}}var Stt=32,Ctt=8,Vtt=0,Spe=1,Cpe=2,Vpe=3,Lpe=4,Rpe=5,qJ=6,Sv=7,Zpe=12,ey=13,Ltt=[0,0,255,255];function Rtt(){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=Sv,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 Ttt(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==utt?-5:0,o=-5;;)switch(s.mode){case Vtt: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)!=Ctt){s.mode=ey,n.msg="unknown compression method",s.marker=5;break}if((s.method>>4)+8>s.wbits){s.mode=ey,n.msg="invalid win size",s.marker=5;break}s.mode=Spe;case Spe: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=ey,n.msg="incorrect header check",s.marker=5;break}if(!(r&Stt)){s.mode=Sv;break}s.mode=Cpe;case Cpe: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=Vpe;case Vpe: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=Lpe;case Lpe: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=Rpe;case Rpe: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=qJ,2);case qJ:return s.mode=ey,n.msg="need dictionary",s.marker=0,-2;case Sv:if(o=s.blocks.proc(n,o),o==-3){s.mode=ey,s.marker=0;break}if(o==0&&(o=i),o!=1)return o;o=i,s.blocks.reset(n,s.was),s.mode=Zpe;case Zpe:return n.avail_in=0,1;case ey:return-3;default:return-2}},e.inflateSetDictionary=function(n,i,o){let r=0,s=o;if(!n||!n.istate||n.istate.mode!=qJ)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=Sv,0},e.inflateSync=function(n){let i,o,r,s,a;if(!n||!n.istate)return-2;let c=n.istate;if(c.mode!=ey&&(c.mode=ey,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)==Ltt[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=Sv,0)},e.inflateSyncPoint=function(n){return!n||!n.istate||!n.istate.blocks?-2:n.istate.blocks.sync_point()}}function Epe(){}Epe.prototype={inflateInit(e){let t=this;return t.istate=new Rtt,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 Xpe(e){let t=this,n=new Epe,i=e&&e.chunkSize?Math.floor(e.chunkSize*2):128*1024,o=dtt,r=new Uint8Array(i),s=!1;n.inflateInit(),n.next_out=r,t.append=function(a,c){let d=[],u,m,p=0,g=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,g),g+=x.length})):m=d[0]?new Uint8Array(d[0]):new Uint8Array,m}},t.flush=function(){n.inflateEnd()}}var Shi=T(S(),1);var phi=T(S(),1);var uV="/",eQ=new Date(2107,11,31),tQ=new Date(1980,0,1),Ei=void 0,Fd="undefined",k0="function";var ghi=T(S(),1);var Cv=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 Ztt=64,Ipe=2;try{typeof navigator!=Fd&&navigator.hardwareConcurrency&&(Ipe=navigator.hardwareConcurrency)}catch{}var Gtt={chunkSize:512*1024,maxWorkers:Ipe,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,workerScripts:Ei,CompressionStreamNative:typeof CompressionStream!=Fd&&CompressionStream,DecompressionStreamNative:typeof DecompressionStream!=Fd&&DecompressionStream},ny=Object.assign({},Gtt);function Vv(){return ny}function aU(e){return Math.max(e.chunkSize,Ztt)}function mV(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(ty("baseURL",t),ty("chunkSize",n),ty("maxWorkers",i),ty("terminateWorkerTimeout",o),ty("useCompressionStream",r),ty("useWebWorkers",s),a&&(ny.CompressionStream=new Cv(a)),c&&(ny.DecompressionStream=new Cv(c)),ty("CompressionStream",d),ty("DecompressionStream",u),m!==Ei){let{deflate:p,inflate:g}=m;if((p||g)&&(ny.workerScripts||(ny.workerScripts={})),p){if(!Array.isArray(p))throw new Error("workerScripts.deflate must be an array");ny.workerScripts.deflate=p}if(g){if(!Array.isArray(g))throw new Error("workerScripts.inflate must be an array");ny.workerScripts.inflate=g}}}function ty(e,t){t!==Ei&&(ny[e]=t)}var Vhi=T(S(),1);var bfi=T(S(),1);var afi=T(S(),1);var ofi=T(S(),1);var Ehi=T(S(),1);var Rhi=T(S(),1),Wpe=[];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;Wpe[e]=t}var U0=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^Wpe[(n^t[i])&255];this.crc=n}get(){return~this.crc}};var Lv=class extends TransformStream{constructor(){let t,n=new U0;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 Khi=T(S(),1);var Whi=T(S(),1);function hV(e){if(typeof TextEncoder==Fd){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 vhi=T(S(),1),qc={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=qc.getPartial(n);return i===32?e.concat(t):qc._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+qc.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]=qc.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=qc.getPartial(o);return i.push(qc.partial(t+r&31,t+r>32?n:i.pop(),1)),i}},Rv={bytes:{fromBits(e){let n=qc.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(qc.partial(8*(n&3),i)),t}}},Ppe={};Ppe.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=Rv.utf8String.toBits(e));let n=t._buffer=qc.concat(t._buffer,e),i=t._length,o=t._length=i+qc.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=qc.concat(t,[qc.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 nQ={};nQ.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,g=o[m]*257^m*16843008;for(let f=0;f<4;f++)e[f][u]=g=g<<24^g>>>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],g=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[g>>8&255]^d[f&255]^n[x],C=s[p>>>24]^a[g>>16&255]^c[f>>8&255]^d[m&255]^n[x+1],V=s[g>>>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[g&255]^n[x+3],x+=4,m=_,p=C,g=V;for(let L=0;L<4;L++)o[t?3&-L:L]=u[m>>>24]<<24^u[p>>16&255]<<16^u[g>>8&255]<<8^u[f&255]^n[x++],_=m,m=p,p=g,g=f,f=_;return o}};var vpe={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}},iQ={};iQ.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=qc.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 qc.clamp(t,o)}};var iy={importKey(e){return new iy.hmacSha1(Rv.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,g=qc;for(t=Rv.bytes.toBits(t),d=1;p<(o||1);d++){for(r=s=e.encrypt(g.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)}};iy.hmacSha1=class{constructor(e){let t=this,n=t._hash=Ppe.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 Dhi=T(S(),1);var Ett=typeof crypto!=Fd&&typeof crypto.getRandomValues==k0,oy="Invalid password",cT="Invalid signature",D0="zipjs-abort-check-password";function cU(e){return Ett?crypto.getRandomValues(e):vpe.getRandomValues(e)}var fV=16,Xtt="raw",Ape={name:"PBKDF2"},Itt={name:"HMAC"},Wtt="SHA-1",Ptt=Object.assign({hash:Itt},Ape),oQ=Object.assign({iterations:1e3,hash:{name:Wtt}},Ape),vtt=["deriveBits"],Gv=[8,12,16],Zv=[16,24,32],ry=10,wtt=[0,0,0,0],uU=typeof crypto!=Fd,Iv=uU&&crypto.subtle,Mpe=uU&&typeof Iv!=Fd,Gf=Rv.bytes,Ftt=nQ.aes,Att=iQ.ctrGladman,Mtt=iy.hmacSha1,wpe=uU&&Mpe&&typeof Iv.importKey==k0,Fpe=uU&&Mpe&&typeof Iv.deriveBits==k0,lU=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:Upe(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 Ntt(c,u,d,Ku(s,0,Gv[u]+2)),s=Ku(s,Gv[u]+2),r?a.error(new Error(D0)):m()):await p;let g=new Uint8Array(s.length-ry-(s.length-ry)%fV);a.enqueue(Npe(c,s,g,0,ry,!0))},async flush(s){let{signed:a,ctr:c,hmac:d,pending:u,ready:m}=this;if(d&&c){await m;let p=Ku(u,0,u.length-ry),g=Ku(u,u.length-ry),f=new Uint8Array;if(p.length){let x=Xv(Gf,p);d.update(x);let _=c.update(x);f=Ev(Gf,_)}if(a){let x=Ku(Ev(Gf,d.digest()),0,ry);for(let _=0;_<ry;_++)if(x[_]!=g[_])throw new Error(cT)}s.enqueue(f)}}})}},dU=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:Upe(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 ktt(a,d,c),u()):await m;let g=new Uint8Array(p.length+r.length-r.length%fV);g.set(p,0),s.enqueue(Npe(a,r,g,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(Xv(Gf,c));a.update(m),u=Ev(Gf,m)}o.signature=Ev(Gf,a.digest()).slice(0,ry),r.enqueue(rQ(u,o.signature))}}}),o=this}};function Npe(e,t,n,i,o,r){let{ctr:s,hmac:a,pending:c}=e,d=t.length-o;c.length&&(t=rQ(c,t),n=Btt(n,d-d%fV));let u;for(u=0;u<=d-fV;u+=fV){let m=Xv(Gf,Ku(t,u,u+fV));r&&a.update(m);let p=s.update(m);r||a.update(p),n.set(Ev(Gf,p),u+i)}return e.pending=Ku(t,u),n}async function Ntt(e,t,n,i){let o=await kpe(e,t,n,Ku(i,0,Gv[t])),r=Ku(i,Gv[t]);if(o[0]!=r[0]||o[1]!=r[1])throw new Error(oy)}async function ktt(e,t,n){let i=cU(new Uint8Array(Gv[t])),o=await kpe(e,t,n,i);return rQ(i,o)}async function kpe(e,t,n,i){e.password=null;let o=await Utt(Xtt,n,Ptt,!1,vtt),r=await Dtt(Object.assign({salt:i},oQ),o,8*(Zv[t]*2+2)),s=new Uint8Array(r),a=Xv(Gf,Ku(s,0,Zv[t])),c=Xv(Gf,Ku(s,Zv[t],Zv[t]*2)),d=Ku(s,Zv[t]*2);return Object.assign(e,{keys:{key:a,authentication:c,passwordVerification:d},ctr:new Att(new Ftt(a),Array.from(wtt)),hmac:new Mtt(c)}),d}async function Utt(e,t,n,i,o){if(wpe)try{return await Iv.importKey(e,t,n,i,o)}catch{return wpe=!1,iy.importKey(t)}else return iy.importKey(t)}async function Dtt(e,t,n){if(Fpe)try{return await Iv.deriveBits(e,t,n)}catch{return Fpe=!1,iy.pbkdf2(t,e.salt,oQ.iterations,n)}else return iy.pbkdf2(t,e.salt,oQ.iterations,n)}function Upe(e,t){return t===Ei?hV(e):t}function rQ(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 Btt(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function Ku(e,t,n){return e.subarray(t,n)}function Ev(e,t){return e.fromBits(t)}function Xv(e,t){return e.toBits(t)}var qhi=T(S(),1);var pV=12,mU=class extends TransformStream{constructor({password:t,passwordVerification:n,checkPasswordOnly:i}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),Ope(this,t)},transform(o,r){let s=this;if(s.password){let a=Dpe(s,o.subarray(0,pV));if(s.password=null,a[pV-1]!=s.passwordVerification)throw new Error(oy);o=o.subarray(pV)}i?r.error(new Error(D0)):r.enqueue(Dpe(s,o))}})}},hU=class extends TransformStream{constructor({password:t,passwordVerification:n}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),Ope(this,t)},transform(i,o){let r=this,s,a;if(r.password){r.password=null;let c=cU(new Uint8Array(pV));c[pV-1]=r.passwordVerification,s=new Uint8Array(i.length+c.length),s.set(Bpe(r,c),0),a=pV}else s=new Uint8Array(i.length),a=0;s.set(Bpe(r,i),a),o.enqueue(s)}})}};function Dpe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=Hpe(e)^t[i],sQ(e,n[i]);return n}function Bpe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=Hpe(e)^t[i],sQ(e,t[i]);return n}function Ope(e,t){let n=[305419896,591751049,878082192];Object.assign(e,{keys:n,crcKey0:new U0(n[0]),crcKey2:new U0(n[2])});for(let i=0;i<t.length;i++)sQ(e,t.charCodeAt(i))}function sQ(e,t){let[n,i,o]=e.keys;e.crcKey0.append([t]),n=~e.crcKey0.get(),i=Ype(Math.imul(Ype(i+zpe(n)),134775813)+1),e.crcKey2.append([i>>>24]),o=~e.crcKey2.get(),e.keys=[n,i,o]}function Hpe(e){let t=e.keys[2]|2;return zpe(Math.imul(t,t^1)>>>8)}function zpe(e){return e&255}function Ype(e){return e&4294967295}var Kpe="deflate-raw",fU=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,g,f=Jpe(super.readable);(!s||c)&&d&&(p=new Lv,f=Ef(f,p)),r&&(f=jpe(f,a,{level:u,chunkSize:n},o,i)),s&&(c?f=Ef(f,new hU(t)):(g=new dU(t),f=Ef(f,g))),Qpe(m,f,()=>{let x;s&&!c&&(x=g.signature),(!s||c)&&d&&(x=new DataView(p.value.buffer).getUint32(0)),m.signature=x})}},pU=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,g=Jpe(super.readable);s&&(r?g=Ef(g,new mU(t)):(p=new lU(t),g=Ef(g,p))),d&&(g=jpe(g,u,{chunkSize:n},o,i)),(!s||r)&&a&&(m=new Lv,g=Ef(g,m)),Qpe(this,g,()=>{if((!s||r)&&a){let f=new DataView(m.value.buffer);if(c!=f.getUint32(0,!1))throw new Error(cT)}})}};function Jpe(e){return Ef(e,new TransformStream({transform(t,n){t&&t.length&&n.enqueue(t)}}))}function Qpe(e,t,n){t=Ef(t,new TransformStream({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function jpe(e,t,n,i,o){try{let r=t&&i?i:o;e=Ef(e,new r(Kpe,n))}catch{if(t)try{e=Ef(e,new o(Kpe,n))}catch{return e}else return e}return e}function Ef(e,t){return e.pipeThrough(t)}var qpe="message",$pe="start",e0e="pull",aQ="data",t0e="ack",cQ="close",yU="deflate",xU="inflate";var bU=class extends TransformStream{constructor(t,n){super({});let i=this,{codecType:o}=t,r;o.startsWith(yU)?r=fU:o.startsWith(xU)&&(r=pU);let s=0,a=0,c=new r(t,n),d=super.readable,u=new TransformStream({transform(p,g){p&&p.length&&(a+=p.length,g.enqueue(p))},flush(){Object.assign(i,{inputSize:a})}}),m=new TransformStream({transform(p,g){p&&p.length&&(s+=p.length,g.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 ufi=T(S(),1);var o0e=typeof Worker!=Fd;var bV=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 dQ(n,s),{signal:m}),writable:i,options:Object.assign({},o),scripts:d,transferStreams:c,terminate(){return new Promise(p=>{let{worker:g,busy:f}=t;g?(f?t.resolveTerminated=p:(g.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&&o0e?Ytt:r0e)(t,r)}},dQ=class extends TransformStream{constructor(t,{onstart:n,onprogress:i,size:o,onend:r}){let s=0;super({async start(){n&&await lQ(n,o)},async transform(a,c){s+=a.length,i&&await lQ(i,s,o),c.enqueue(a)},async flush(){t.size=s,r&&await lQ(r,s)}})}};async function lQ(e,...t){try{await e(...t)}catch{}}function r0e(e,t){return{run:()=>Ott(e,t)}}function Ytt(e,t){let{baseURL:n,chunkSize:i}=t;if(!e.interface){let o;try{o=Ktt(e.scripts[0],n,e)}catch{return o0e=!1,r0e(e,t)}Object.assign(e,{worker:o,interface:{run:()=>Htt(e,{chunkSize:i})}})}return e.interface}async function Ott({options:e,readable:t,writable:n,onTaskFinished:i},o){try{let r=new bU(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 Htt(e,t){let n,i,o=new Promise((p,g)=>{n=p,i=g});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}=ztt(e.writable),u=_U({type:$pe,scripts:a.slice(1),options:s,config:t,readable:r,writable:c},e);u||Object.assign(e,{reader:r.getReader(),writer:c.getWriter()});let m=await o;return u||await c.getWriter().close(),await d,m}function ztt(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 n0e=!0,i0e=!0;function Ktt(e,t,n){let i={type:"module"},o,r;typeof e==k0&&(e=e());try{o=new URL(e,t)}catch{o=e}if(n0e)try{r=new Worker(o)}catch{n0e=!1,r=new Worker(o,i)}else r=new Worker(o,i);return r.addEventListener(qpe,s=>Jtt(s,n)),r}function _U(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&&i0e?(s&&c.push(s),a&&c.push(a)):e.readable=e.writable=null,c.length)try{return t.postMessage(e,c),!0}catch{i0e=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(r){throw n&&n.releaseLock(),i(),r}}async function Jtt({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:g,stack:f,code:x,name:_}=s,C=new Error(g);Object.assign(C,{stack:f,code:x,name:_}),p(C)}else{if(n==e0e){let{value:g,done:f}=await a.read();_U({type:aQ,value:g,done:f,messageId:o},t)}n==aQ&&(await c.ready,await c.write(new Uint8Array(i)),_U({type:t0e,messageId:o},t)),n==cQ&&p(null,r)}}catch(g){_U({type:cQ,messageId:o},t),p(g)}function p(g,f){g?u(g):d(f),c&&c.releaseLock(),m()}}var lT=[],uQ=[];var s0e=0;async function TU(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===Ei;let g=!c&&!d&&!u&&!t.transferStreams;return t.useWebWorkers=!g&&(r||r===Ei&&i.useWebWorkers),t.scripts=t.useWebWorkers&&m?m[a]:[],n.useCompressionStream=s||s===Ei&&i.useCompressionStream,(await f()).run();async function f(){let _=lT.find(C=>!C.busy);if(_)return a0e(_),new bV(_,e,t,x);if(lT.length<p){let C={indexWorker:s0e};return s0e++,lT.push(C),new bV(C,e,t,x)}else return new Promise(C=>uQ.push({resolve:C,stream:e,workerOptions:t}))}function x(_){if(uQ.length){let[{resolve:C,stream:V,workerOptions:L}]=uQ.splice(0,1);C(new bV(_,V,L,x))}else _.worker?(a0e(_),Qtt(_,t)):lT=lT.filter(C=>C!=_)}}function Qtt(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{lT=lT.filter(o=>o!=e);try{await e.terminate()}catch{}},i))}function a0e(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var _fi=T(S(),1);var jtt="Writer iterator completed too soon",qtt="text/plain";var $tt="Content-Type";var ent=64*1024,fQ="writable",gV=class{constructor(){this.size=0}init(){this.initialized=!0}},SU=class extends gV{get readable(){let t=this,{chunkSize:n=ent}=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 va(t,r+c,Math.min(n,s-c),a)),c+n>s?o.close():this.chunkOffset+=n}});return i}},mQ=class extends gV{constructor(){super();let t=this,n=new WritableStream({write(i){return t.writeUint8Array(i)}});Object.defineProperty(t,fQ,{get(){return n}})}writeUint8Array(){}};var CU=class extends mQ{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)}},B0=class extends SU{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)}},Wv=class extends gV{constructor(t){super();let n=this,i=new TransformStream,o=[];t&&o.push([$tt,t]),Object.defineProperty(n,fQ,{get(){return i.writable}}),n.blob=new Response(i.readable,{headers:o}).blob()}getData(){return this.blob}},VU=class extends B0{constructor(t){super(new Blob([t],{type:qtt}))}},LU=class extends Wv{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 hQ=class extends SU{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 va(d,c,n);else{let m=u-c;s=new Uint8Array(n),s.set(await va(d,c,m)),s.set(await o.readUint8Array(t+m,n-m,i),m)}return o.lastDiskNumber=Math.max(a,o.lastDiskNumber),s}},RU=class extends gV{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:g}=await t.next();if(g&&!p)throw new Error(jtt);o=p,o.size=0,o.maxSize&&(i.maxSize=o.maxSize),i.availableSize=i.maxSize,await If(o),r=p.writable,s=r.getWriter(),await this.write(u)}},async close(){await s.ready,await d()}});Object.defineProperty(i,fQ,{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 If(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}function ZU(e){return Array.isArray(e)&&(e=new hQ(e)),e instanceof ReadableStream&&(e={readable:e}),e}function GU(e){e.writable===Ei&&typeof e.next==k0&&(e=new RU(e)),e instanceof WritableStream&&(e={writable:e});let{writable:t}=e;return t.size===Ei&&(t.size=0),e instanceof RU||Object.assign(e,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),e}function va(e,t,n,i){return e.readUint8Array(t,n,i)}var Ffi=T(S(),1);var Lfi=T(S(),1);var Sfi=T(S(),1),c0e="\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(""),tnt=c0e.length==256;function l0e(e){if(tnt){let t="";for(let n=0;n<e.length;n++)t+=c0e[e[n]];return t}else return new TextDecoder().decode(e)}function Pv(e,t){return t&&t.trim().toLowerCase()=="cp437"?l0e(e):new TextDecoder(t).decode(e)}var Zfi=T(S(),1),pQ="filename",bQ="rawFilename",gQ="comment",yQ="rawComment",xQ="uncompressedSize",_Q="compressedSize",TQ="offset",EU="diskNumberStart",yV="lastModDate",XU="rawLastModDate",vv="lastAccessDate",d0e="rawLastAccessDate",wv="creationDate",u0e="rawCreationDate",SQ="internalFileAttribute",CQ="externalFileAttribute",VQ="msDosCompatible",IU="zip64",LQ="encrypted",RQ="version",ZQ="versionMadeBy",GQ="zipCrypto",nnt=[pQ,bQ,_Q,xQ,yV,XU,gQ,yQ,vv,wv,TQ,EU,EU,SQ,CQ,VQ,IU,LQ,RQ,ZQ,GQ,"directory","bitFlag","signature","filenameUTF8","commentUTF8","compressionMethod","extraField","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"],sy=class{constructor(t){nnt.forEach(n=>this[n]=t[n])}};var EQ="File format is not recognized",snt="End of central directory not found",ant="End of Zip64 central directory locator not found",cnt="Central directory header not found",lnt="Local file header not found",dnt="Zip64 extra field not found",unt="File contains encrypted entry",mnt="Encryption method not supported",m0e="Compression method not supported",h0e="Split zip file",f0e="utf-8",p0e="cp437",hnt=[[xQ,4294967295],[_Q,4294967295],[TQ,4294967295],[EU,65535]],fnt={[65535]:{getValue:ds,bytes:4},[4294967295]:{getValue:WU,bytes:8}},NU=class{constructor(t,n={}){Object.assign(this,{reader:ZU(t),options:n,config:Vv()})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n,{config:o}=n;if(await If(i),(i.size===Ei||!i.readUint8Array)&&(i=new B0(await new Response(i.readable).blob()),await If(i)),i.size<22)throw new Error(EQ);i.chunkSize=aU(o);let r=await xnt(i,101010256,i.size,22,65535*16);if(!r){let M=await va(i,0,4),b=ua(M);throw ds(b)==134695760?new Error(h0e):new Error(snt)}let s=ua(r),a=ds(s,12),c=ds(s,16),d=r.offset,u=da(s,20),m=d+22+u,p=da(s,4),g=i.lastDiskNumber||0,f=da(s,6),x=da(s,8),_=0,C=0;if(c==4294967295||a==4294967295||x==65535||f==65535){let M=await va(i,r.offset-20,20),b=ua(M);if(ds(b,0)==117853008){c=WU(b,8);let R=await va(i,c,56,-1),G=ua(R),I=r.offset-20-56;if(ds(G,0)!=101075792&&c!=I){let w=c;c=I,_=c-w,R=await va(i,c,56,-1),G=ua(R)}if(ds(G,0)!=101075792)throw new Error(ant);p==65535&&(p=ds(G,16)),f==65535&&(f=ds(G,20)),x==65535&&(x=WU(G,32)),a==4294967295&&(a=WU(G,40)),c-=a}}if(c>=i.size&&(_=i.size-c-a-22,c=i.size-a-22),g!=p)throw new Error(h0e);if(c<0)throw new Error(EQ);let V=0,L=await va(i,c,a,f),Z=ua(L);if(a){let M=r.offset-a;if(ds(Z,V)!=33639248&&c!=M){let b=c;c=M,_+=c-b,L=await va(i,c,a,f),Z=ua(L)}}let E=r.offset-c-(i.lastDiskOffset||0);if(a!=E&&E>=0&&(a=E,L=await va(i,c,a,f),Z=ua(L)),c<0||c>=i.size)throw new Error(EQ);let X=$c(n,t,"filenameEncoding"),v=$c(n,t,"commentEncoding");for(let M=0;M<x;M++){let b=new IQ(i,o,n.options);if(ds(Z,V)!=33639248)throw new Error(cnt);g0e(b,Z,V+6);let R=!!b.bitFlag.languageEncodingFlag,G=V+46,I=G+b.filenameLength,w=I+b.extraFieldLength,N=da(Z,V+4),B=(N&0)==0,U=L.subarray(G,I),O=da(Z,V+32),k=w+O,J=L.subarray(w,k),H=R,te=R,z=B&&(xV(Z,V+38)&16)==16,j=ds(Z,V+42)+_;Object.assign(b,{versionMadeBy:N,msDosCompatible:B,compressedSize:0,uncompressedSize:0,commentLength:O,directory:z,offset:j,diskNumberStart:da(Z,V+34),internalFileAttribute:da(Z,V+36),externalFileAttribute:ds(Z,V+38),rawFilename:U,filenameUTF8:H,commentUTF8:te,rawExtraField:L.subarray(I,w)});let ee=$c(n,t,"decodeText")||Pv,fe=H?f0e:X||p0e,_e=te?f0e:v||p0e,le=ee(U,fe);le===Ei&&(le=Pv(U,fe));let ge=ee(J,_e);ge===Ei&&(ge=Pv(J,_e)),Object.assign(b,{rawComment:J,filename:le,comment:ge,directory:z||le.endsWith(uV)}),C=Math.max(j,C),await y0e(b,b,Z,V+6),b.zipCrypto=b.encrypted&&!b.extraFieldAES;let Se=new sy(b);Se.getData=(Le,ke)=>b.getData(Le,Se,ke),V=k;let{onprogress:Ie}=t;if(Ie)try{await Ie(M+1,x,new sy(b))}catch{}yield Se}let P=$c(n,t,"extractPrependedData"),A=$c(n,t,"extractAppendedData");return P&&(n.prependedData=C>0?await va(i,0,C):new Uint8Array),n.comment=u?await va(i,d+22,u):new Uint8Array,A&&(n.appendedData=m<i.size?await va(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 IQ=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:g,uncompressedSize:f,compressedSize:x}=o,_=n.localDirectory={},C=await va(r,s,30,a),V=ua(C),L=$c(o,i,"password"),Z=$c(o,i,"rawPassword"),E=$c(o,i,"passThrough");if(L=L&&L.length&&L,Z=Z&&Z.length&&Z,c&&c.originalCompressionMethod!=99)throw new Error(m0e);if(d!=0&&d!=8&&!E)throw new Error(m0e);if(ds(V,0)!=67324752)throw new Error(lnt);g0e(_,V,4),_.rawExtraField=_.extraFieldLength?await va(r,s+30+_.filenameLength,_.extraFieldLength,a):new Uint8Array,await y0e(o,_,V,4,!0),Object.assign(n,{lastAccessDate:_.lastAccessDate,creationDate:_.creationDate});let X=o.encrypted&&_.encrypted&&!E,v=X&&!c;if(E||(n.zipCrypto=v),X){if(!v&&c.strength===Ei)throw new Error(mnt);if(!L&&!Z)throw new Error(unt)}let P=s+30+_.filenameLength+_.extraFieldLength,A=x,M=r.readable;Object.assign(M,{diskNumberStart:a,offset:P,size:A});let b=$c(o,i,"signal"),R=$c(o,i,"checkPasswordOnly");R&&(t=new WritableStream),t=GU(t),await If(t,E?x:f);let{writable:G}=t,{onstart:I,onprogress:w,onend:N}=i,B={options:{codecType:xU,password:L,rawPassword:Z,zipCrypto:v,encryptionStrength:c&&c.strength,signed:$c(o,i,"checkSignature")&&!E,passwordVerification:v&&(m.dataDescriptor?g>>>8&255:p>>>24&255),signature:p,compressed:d!=0&&!E,encrypted:o.encrypted&&!E,useWebWorkers:$c(o,i,"useWebWorkers"),useCompressionStream:$c(o,i,"useCompressionStream"),transferStreams:$c(o,i,"transferStreams"),checkPasswordOnly:R},config:u,streamOptions:{signal:b,size:A,onstart:I,onprogress:w,onend:N}},U=0;try{({outputSize:U}=await TU({readable:M,writable:G},B))}catch(O){if(!R||O.message!=D0)throw O}finally{let O=$c(o,i,"preventClose");G.size+=U,!O&&!G.locked&&await G.getWriter().close()}return R?Ei:t.getData?t.getData():G}};function g0e(e,t,n){let i=e.rawBitFlag=da(t,n+2),o=(i&1)==1,r=ds(t,n+6);Object.assign(e,{encrypted:o,version:da(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:r,lastModDate:_nt(r),filenameLength:da(t,n+22),extraFieldLength:da(t,n+24)})}async function y0e(e,t,n,i,o){let{rawExtraField:r}=t,s=t.extraField=new Map,a=ua(new Uint8Array(r)),c=0;try{for(;c<r.length;){let C=da(a,c),V=da(a,c+2);s.set(C,{type:C,data:r.slice(c+4,c+4+V)}),c+=4+V}}catch{}let d=da(n,i+4);Object.assign(t,{signature:ds(n,i+10),uncompressedSize:ds(n,i+18),compressedSize:ds(n,i+14)});let u=s.get(1);u&&(pnt(u,t),t.extraFieldZip64=u);let m=s.get(28789);m&&(await b0e(m,pQ,bQ,t,e),t.extraFieldUnicodePath=m);let p=s.get(25461);p&&(await b0e(p,gQ,yQ,t,e),t.extraFieldUnicodeComment=p);let g=s.get(39169);g?(bnt(g,t,d),t.extraFieldAES=g):t.compressionMethod=d;let f=s.get(10);f&&(gnt(f,t),t.extraFieldNTFS=f);let x=s.get(21589);x&&(ynt(x,t,o),t.extraFieldExtendedTimestamp=x);let _=s.get(6534);_&&(t.extraFieldUSDZ=_)}function pnt(e,t){t.zip64=!0;let n=ua(e.data),i=hnt.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=fnt[a];t[s]=e[s]=c.getValue(n,r),r+=c.bytes}else if(e[s])throw new Error(dnt)}}async function b0e(e,t,n,i,o){let r=ua(e.data),s=new U0;s.append(o[n]);let a=ua(new Uint8Array(4));a.setUint32(0,s.get(),!0);let c=ds(r,1);Object.assign(e,{version:xV(r,0),[t]:Pv(e.data.subarray(5)),valid:!o.bitFlag.languageEncodingFlag&&c==ds(a,0)}),e.valid&&(i[t]=e[t],i[t+"UTF8"]=!0)}function bnt(e,t,n){let i=ua(e.data),o=xV(i,4);Object.assign(e,{vendorVersion:xV(i,0),vendorId:xV(i,2),strength:o,originalCompressionMethod:n,compressionMethod:da(i,5)}),t.compressionMethod=e.compressionMethod}function gnt(e,t){let n=ua(e.data),i=4,o;try{for(;i<e.data.length&&!o;){let r=da(n,i),s=da(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=ua(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=XQ(s),u=XQ(a),m=XQ(c),p={lastModDate:d,lastAccessDate:u,creationDate:m};Object.assign(e,p),Object.assign(t,p)}}catch{}}function ynt(e,t,n){let i=ua(e.data),o=xV(i,0),r=[],s=[];n?((o&1)==1&&(r.push(yV),s.push(XU)),(o&2)==2&&(r.push(vv),s.push(d0e)),(o&4)==4&&(r.push(wv),s.push(u0e))):e.data.length>=5&&(r.push(yV),s.push(XU));let a=1;r.forEach((c,d)=>{if(e.data.length>=a+4){let u=ds(i,a);t[c]=e[c]=new Date(u*1e3);let m=s[d];e[m]=u}a+=4})}async function xnt(e,t,n,i,o){let r=new Uint8Array(4),s=ua(r);Tnt(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 va(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 $c(e,t,n){return t[n]===Ei?e.options[n]:t[n]}function _nt(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 XQ(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function xV(e,t){return e.getUint8(t)}function da(e,t){return e.getUint16(t,!0)}function ds(e,t){return e.getUint32(t,!0)}function WU(e,t){return Number(e.getBigUint64(t,!0))}function Tnt(e,t,n){e.setUint32(t,n,!0)}function ua(e){return new DataView(e.buffer)}var Yfi=T(S(),1);var Lnt="File already exists",Rnt="Zip file comment exceeds 64KB",Znt="File entry comment exceeds 64KB",Gnt="File entry name exceeds 64KB",T0e="Version exceeds 65535",Ent="The strength must equal 1, 2, or 3",Xnt="Extra field type exceeds 65535",Int="Extra field data exceeds 64KB",HQ="Zip64 is not supported (make sure 'keepOrder' is set to 'true')",Wnt="Undefined uncompressed size",S0e=new Uint8Array([7,0,2,0,65,69,3,0,0]),YQ=0,C0e=[],UU=class{constructor(t,n={}){t=GU(t);let i=t.availableSize!==Ei&&t.availableSize>0&&t.availableSize!==1/0&&t.maxSize!==Ei&&t.maxSize>0&&t.maxSize!==1/0;Object.assign(this,{writer:t,addSplitZipSignature:i,options:n,config:Vv(),files:new Map,filenames:new Set,offset:n.offset===Ei?t.writable.size:n.offset,pendingEntriesSize:0,pendingAddFileCalls:new Set,bufferedWrites:0})}async add(t="",n,i={}){let o=this,{pendingAddFileCalls:r,config:s}=o;YQ<s.maxWorkers?YQ++:await new Promise(c=>C0e.push(c));let a;try{if(t=t.trim(),o.filenames.has(t))throw new Error(Lnt);return o.filenames.add(t),a=Pnt(o,t,n,i),r.add(a),await a}catch(c){throw o.filenames.delete(t),c}finally{r.delete(a);let c=C0e.shift();c?c():YQ--}}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 Dnt(this,t,n),ho(i,n,"preventClose")||await s.getWriter().close(),r.getData?r.getData():s}};async function Pnt(e,t,n,i){t=t.trim(),i.directory&&!t.endsWith(uV)?t+=uV:i.directory=t.endsWith(uV);let o=ho(e,i,"encodeText",hV),r=o(t);if(r===Ei&&(r=hV(t)),Hi(r)>65535)throw new Error(Gnt);let s=i.comment||"",a=o(s);if(a===Ei&&(a=hV(s)),Hi(a)>65535)throw new Error(Znt);let c=ho(e,i,RQ,20);if(c>65535)throw new Error(T0e);let d=ho(e,i,ZQ,20);if(d>65535)throw new Error(T0e);let u=ho(e,i,yV,new Date),m=ho(e,i,vv),p=ho(e,i,wv),g=ho(e,i,VQ,!0),f=ho(e,i,SQ,0),x=ho(e,i,CQ,0),_=ho(e,i,"passThrough"),C,V;_||(C=ho(e,i,"password"),V=ho(e,i,"rawPassword"));let L=ho(e,i,"encryptionStrength",3),Z=ho(e,i,GQ),E=ho(e,i,"extendedTimestamp",!0),X=ho(e,i,"keepOrder",!0),v=ho(e,i,"level"),P=ho(e,i,"useWebWorkers"),A=ho(e,i,"bufferedWrite"),M=ho(e,i,"dataDescriptorSignature",!1),b=ho(e,i,"signal"),R=ho(e,i,"useUnicodeFileNames",!0),G=ho(e,i,"useCompressionStream"),I=ho(e,i,"compressionMethod"),w=ho(e,i,"dataDescriptor",!0),N=ho(e,i,IU);if(!Z&&(C!==Ei||V!==Ei)&&!(L>=1&&L<=3))throw new Error(Ent);let B=new Uint8Array,{extraField:U}=i;if(U){let vt=0,Ct=0;U.forEach(Xe=>vt+=4+Hi(Xe)),B=new Uint8Array(vt),U.forEach((Xe,je)=>{if(je>65535)throw new Error(Xnt);if(Hi(Xe)>65535)throw new Error(Int);Ss(B,new Uint16Array([je]),Ct),Ss(B,new Uint16Array([Hi(Xe)]),Ct+2),Ss(B,Xe,Ct+4),Ct+=4+Hi(Xe)})}let O=0,k=0,J=0;if(_&&({uncompressedSize:J}=i,J===Ei))throw new Error(Wnt);let H=N===!0;n&&(n=ZU(n),await If(n),_?O=V0e(J):n.size===Ei?(w=!0,(N||N===Ei)&&(N=!0,J=O=4294967296)):(J=n.size,O=V0e(J)));let{diskOffset:te,diskNumber:z,maxSize:j}=e.writer,ee=H||J>4294967295,fe=H||O>4294967295,_e=H||e.offset+e.pendingEntriesSize-te>4294967295,ge=ho(e,i,"supportZip64SplitFile",!0)&&H||z+Math.ceil(e.pendingEntriesSize/j)>65535;if(_e||ee||fe||ge){if(N===!1||!X)throw new Error(HQ);N=!0}N=N||!1;let Se=ho(e,i,LQ),{signature:Ie}=i;i=Object.assign({},i,{rawFilename:r,rawComment:a,version:c,versionMadeBy:d,lastModDate:u,lastAccessDate:m,creationDate:p,rawExtraField:B,zip64:N,zip64UncompressedSize:ee,zip64CompressedSize:fe,zip64Offset:_e,zip64DiskNumberStart:ge,password:C,rawPassword:V,level:!G&&e.config.CompressionStream===Ei&&e.config.CompressionStreamNative===Ei?0:v,useWebWorkers:P,encryptionStrength:L,extendedTimestamp:E,zipCrypto:Z,bufferedWrite:A,keepOrder:X,useUnicodeFileNames:R,dataDescriptor:w,dataDescriptorSignature:M,signal:b,msDosCompatible:g,internalFileAttribute:f,externalFileAttribute:x,useCompressionStream:G,passThrough:_,encrypted:!!(C&&Hi(C)||V&&Hi(V))||_&&Se,signature:Ie,compressionMethod:I});let Le=Fnt(i),ke=Mnt(i),Be=Hi(Le.localHeaderArray,ke.dataDescriptorArray);k=Be+O,e.options.usdz&&(k+=k+64),e.pendingEntriesSize+=k;let st;try{st=await vnt(e,t,n,{headerInfo:Le,dataDescriptorInfo:ke,metadataSize:Be},i)}finally{e.pendingEntriesSize-=k}return Object.assign(st,{name:t,comment:s,extraField:U}),new sy(st)}async function vnt(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(),g={},f,x,_,C,V,L,Z;r.set(t,g);try{let P;a&&(P=p&&p.lock,E()),(o.bufferedWrite||e.writerLocked||e.bufferedWrites&&a||!c)&&!m?(L=new TransformStream,Z=new Response(L.readable).blob(),L.writable.size=0,f=!0,e.bufferedWrites++,await If(s)):(L=s,await X()),await If(L);let{writable:A}=s,{diskOffset:M}=s;if(e.addSplitZipSignature){delete e.addSplitZipSignature;let R=new Uint8Array(4),G=wa(R);Oi(G,0,134695760),await Wf(A,R),e.offset+=4}m&&Ant(i,e.offset-M),f||(await P,await v(A));let{diskNumber:b}=s;if(V=!0,g.diskNumberStart=b,g=await wnt(n,L,g,i,e.config,o),V=!1,r.set(t,g),g.filename=t,f){await L.writable.getWriter().close();let R=await Z;await P,await X(),C=!0,c||(R=await knt(g,R,A,o)),await v(A),g.diskNumberStart=s.diskNumber,M=s.diskOffset,await R.stream().pipeTo(A,{preventClose:!0,preventAbort:!0,signal:d}),A.size+=R.size,C=!1}if(g.offset=e.offset-M,g.zip64)Unt(g,o);else if(g.offset>4294967295)throw new Error(HQ);return e.offset+=g.size,g}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 E(){g.lock=new Promise(P=>_=P)}async function X(){e.writerLocked=!0;let{lockWriter:P}=e;e.lockWriter=new Promise(A=>x=()=>{e.writerLocked=!1,A()}),await P}async function v(P){Hi(u.localHeaderArray)>s.availableSize&&(s.availableSize=0,await Wf(P,new Uint8Array))}}async function wnt(e,t,{diskNumberStart:n,lock:i},o,r,s){let{headerInfo:a,dataDescriptorInfo:c,metadataSize:d}=o,{localHeaderArray:u,headerArray:m,lastModDate:p,rawLastModDate:g,encrypted:f,compressed:x,version:_,compressionMethod:C,rawExtraFieldExtendedTimestamp:V,extraFieldExtendedTimestampFlag:L,rawExtraFieldNTFS:Z,rawExtraFieldAES:E}=a,{dataDescriptorArray:X}=c,{rawFilename:v,lastAccessDate:P,creationDate:A,password:M,rawPassword:b,level:R,zip64:G,zip64UncompressedSize:I,zip64CompressedSize:w,zip64Offset:N,zip64DiskNumberStart:B,zipCrypto:U,dataDescriptor:O,directory:k,versionMadeBy:J,rawComment:H,rawExtraField:te,useWebWorkers:z,onstart:j,onprogress:ee,onend:fe,signal:_e,encryptionStrength:le,extendedTimestamp:ge,msDosCompatible:Se,internalFileAttribute:Ie,externalFileAttribute:Le,useCompressionStream:ke,passThrough:Be}=s,st={lock:i,versionMadeBy:J,zip64:G,directory:!!k,filenameUTF8:!0,rawFilename:v,commentUTF8:!0,rawComment:H,rawExtraFieldExtendedTimestamp:V,rawExtraFieldNTFS:Z,rawExtraFieldAES:E,rawExtraField:te,extendedTimestamp:ge,msDosCompatible:Se,internalFileAttribute:Ie,externalFileAttribute:Le,diskNumberStart:n},{signature:vt,uncompressedSize:Ct}=s,Xe=0;Be||(Ct=0);let{writable:je}=t;if(e){e.chunkSize=aU(r),await Wf(je,u);let He=e.readable,Ut=He.size=e.size,Ce={options:{codecType:yU,level:R,rawPassword:b,password:M,encryptionStrength:le,zipCrypto:f&&U,passwordVerification:f&&U&&g>>8&255,signed:!Be,compressed:x&&!Be,encrypted:f&&!Be,useWebWorkers:z,useCompressionStream:ke,transferStreams:!1},config:r,streamOptions:{signal:_e,size:Ut,onstart:j,onprogress:ee,onend:fe}},Ve=await TU({readable:He,writable:je},Ce);Xe=Ve.outputSize,Be||(Ct=Ve.inputSize,vt=Ve.signature),je.size+=Ct}else await Wf(je,u);let $e;if(G){let He=4;I&&(He+=8),w&&(He+=8),N&&(He+=8),B&&(He+=4),$e=new Uint8Array(He)}else $e=new Uint8Array;return Nnt({signature:vt,rawExtraFieldZip64:$e,compressedSize:Xe,uncompressedSize:Ct,headerInfo:a,dataDescriptorInfo:c},s),O&&await Wf(je,X),Object.assign(st,{uncompressedSize:Ct,compressedSize:Xe,lastModDate:p,rawLastModDate:g,creationDate:A,lastAccessDate:P,encrypted:f,zipCrypto:U,size:d+Xe,compressionMethod:C,version:_,headerArray:m,signature:vt,rawExtraFieldZip64:$e,extraFieldExtendedTimestampFlag:L,zip64UncompressedSize:I,zip64CompressedSize:w,zip64Offset:N,zip64DiskNumberStart:B}),st}function Fnt(e){let{rawFilename:t,lastModDate:n,lastAccessDate:i,creationDate:o,level:r,zip64:s,zipCrypto:a,useUnicodeFileNames:c,dataDescriptor:d,directory:u,rawExtraField:m,encryptionStrength:p,extendedTimestamp:g,encrypted:f}=e,x=r!==0&&!u,{version:_,compressionMethod:C}=e,V;if(f&&!a){V=new Uint8Array(Hi(S0e)+2);let N=wa(V);no(N,0,39169),Ss(V,S0e,2),DU(N,8,p)}else V=new Uint8Array;let L,Z,E;if(g){Z=new Uint8Array(9+(i?4:0)+(o?4:0));let N=wa(Z);no(N,0,21589),no(N,2,Hi(Z)-4),E=1+(i?2:0)+(o?4:0),DU(N,4,E);let B=5;Oi(N,B,Math.floor(n.getTime()/1e3)),B+=4,i&&(Oi(N,B,Math.floor(i.getTime()/1e3)),B+=4),o&&Oi(N,B,Math.floor(o.getTime()/1e3));try{L=new Uint8Array(36);let U=wa(L),O=OQ(n);no(U,0,10),no(U,2,32),no(U,8,1),no(U,10,24),Dl(U,12,O),Dl(U,20,OQ(i)||O),Dl(U,28,OQ(o)||O)}catch{L=new Uint8Array}}else L=Z=new Uint8Array;let X=0;c&&(X=X|2048),d&&(X=X|8),C===Ei&&(C=x?8:0),x&&(r>=1&&r<3&&(X=X|6),r>=3&&r<5&&(X=X|1),r===9&&(X=X|2)),s&&(_=_>45?_:45),f&&(X=X|1,a||(_=_>51?_:51,V[9]=C,C=99));let v=new Uint8Array(26),P=wa(v);no(P,0,_),no(P,2,X),no(P,4,C);let A=new Uint32Array(1),M=wa(A),b;n<tQ?b=tQ:n>eQ?b=eQ:b=n,no(M,0,(b.getHours()<<6|b.getMinutes())<<5|b.getSeconds()/2),no(M,2,(b.getFullYear()-1980<<4|b.getMonth()+1)<<5|b.getDate());let R=A[0];Oi(P,6,R),no(P,22,Hi(t));let G=Hi(V,Z,L,m);no(P,24,G);let I=new Uint8Array(30+Hi(t)+G),w=wa(I);return Oi(w,0,67324752),Ss(I,v,4),Ss(I,t,30),Ss(I,V,30+Hi(t)),Ss(I,Z,30+Hi(t,V)),Ss(I,L,30+Hi(t,V,Z)),Ss(I,m,30+Hi(t,V,Z,L)),{localHeaderArray:I,headerArray:v,headerView:P,lastModDate:n,rawLastModDate:R,encrypted:f,compressed:x,version:_,compressionMethod:C,extraFieldExtendedTimestampFlag:E,rawExtraFieldExtendedTimestamp:Z,rawExtraFieldNTFS:L,rawExtraFieldAES:V,extraFieldLength:G}}function Ant(e,t){let{headerInfo:n}=e,{localHeaderArray:i,extraFieldLength:o}=n,r=wa(i),s=64-(t+Hi(i))%64;s<4&&(s+=64);let a=new Uint8Array(s),c=wa(a);no(c,0,6534),no(c,2,s-2);let d=i;n.localHeaderArray=i=new Uint8Array(Hi(d)+s),Ss(i,d),Ss(i,a,Hi(d)),r=wa(i),no(r,28,o+s),e.metadataSize+=s}function Mnt(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,Oi(r,0,134695760))),{dataDescriptorArray:o,dataDescriptorView:r,dataDescriptorOffset:s}}function Nnt(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:g,zip64CompressedSize:f,zipCrypto:x,dataDescriptor:_}=t;if((!d||x)&&n!==Ei&&(Oi(c,10,n),_&&Oi(u,m,n)),p){let C=wa(i);no(C,0,1),no(C,2,Hi(i)-4);let V=4;g&&(Oi(c,18,4294967295),Dl(C,V,BigInt(r)),V+=8),f&&(Oi(c,14,4294967295),Dl(C,V,BigInt(o))),_&&(Dl(u,m+4,BigInt(o)),Dl(u,m+12,BigInt(r)))}else Oi(c,14,o),Oi(c,18,r),_&&(Oi(u,m+4,o),Oi(u,m+8,r))}async function knt(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)&&Oi(r,14,e.signature),e.zip64?(Oi(r,18,4294967295),Oi(r,22,4294967295)):(Oi(r,18,e.compressedSize),Oi(r,22,e.uncompressedSize)),await Wf(n,new Uint8Array(o)),t.slice(o.byteLength)}function Unt(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&&(Dl(d,u,BigInt(i)),u+=8),c&&Oi(d,u,o)}async function Dnt(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[,E]of i){let{rawFilename:X,rawExtraFieldZip64:v,rawExtraFieldAES:P,rawComment:A,rawExtraFieldNTFS:M,rawExtraField:b,extendedTimestamp:R,extraFieldExtendedTimestampFlag:G,lastModDate:I}=E,w;if(R){w=new Uint8Array(9);let N=wa(w);no(N,0,21589),no(N,2,5),DU(N,4,G),Oi(N,5,Math.floor(I.getTime()/1e3))}else w=new Uint8Array;E.rawExtraFieldCDExtendedTimestamp=w,d+=46+Hi(X,A,v,P,M,w,b)}let p=new Uint8Array(d),g=wa(p);await If(o);let f=0;for(let[E,X]of Array.from(i.values()).entries()){let{offset:v,rawFilename:P,rawExtraFieldZip64:A,rawExtraFieldAES:M,rawExtraFieldCDExtendedTimestamp:b,rawExtraFieldNTFS:R,rawExtraField:G,rawComment:I,versionMadeBy:w,headerArray:N,directory:B,zip64:U,zip64UncompressedSize:O,zip64CompressedSize:k,zip64DiskNumberStart:J,zip64Offset:H,msDosCompatible:te,internalFileAttribute:z,externalFileAttribute:j,diskNumberStart:ee,uncompressedSize:fe,compressedSize:_e}=X,le=Hi(A,M,b,R,G);Oi(g,c,33639248),no(g,c+4,w);let ge=wa(N);O||Oi(ge,18,fe),k||Oi(ge,14,_e),Ss(p,N,c+6),no(g,c+30,le),no(g,c+32,Hi(I)),no(g,c+34,U&&J?65535:ee),no(g,c+36,z),j?Oi(g,c+38,j):B&&te&&DU(g,c+38,16),Oi(g,c+42,U&&H?4294967295:v),Ss(p,P,c+46),Ss(p,A,c+46+Hi(P)),Ss(p,M,c+46+Hi(P,A)),Ss(p,b,c+46+Hi(P,A,M)),Ss(p,R,c+46+Hi(P,A,M,b)),Ss(p,G,c+46+Hi(P,A,M,b,R)),Ss(p,I,c+46+Hi(P)+le);let Se=46+Hi(P,I)+le;if(c-f>o.availableSize&&(o.availableSize=0,await Wf(s,p.slice(f,c)),f=c),c+=Se,n.onprogress)try{await n.onprogress(E+1,i.size,new sy(X))}catch{}}await Wf(s,f?p.slice(f):p);let x=o.diskNumber,{availableSize:_}=o;_<22&&x++;let C=ho(e,n,IU);if(u>4294967295||d>4294967295||m>65535||x>65535){if(C===!1)throw new Error(HQ);C=!0}let V=new Uint8Array(C?98:22),L=wa(V);c=0,C&&(Oi(L,0,101075792),Dl(L,4,BigInt(44)),no(L,12,45),no(L,14,45),Oi(L,16,x),Oi(L,20,a),Dl(L,24,BigInt(m)),Dl(L,32,BigInt(m)),Dl(L,40,BigInt(d)),Dl(L,48,BigInt(u)),Oi(L,56,117853008),Dl(L,64,BigInt(u)+BigInt(d)),Oi(L,72,x+1),ho(e,n,"supportZip64SplitFile",!0)&&(x=65535,a=65535),m=65535,u=4294967295,d=4294967295,c+=76),Oi(L,c,101010256),no(L,c+4,x),no(L,c+6,a),no(L,c+8,m),no(L,c+10,m),Oi(L,c+12,d),Oi(L,c+16,u);let Z=Hi(t);if(Z)if(Z<=65535)no(L,c+20,Z);else throw new Error(Rnt);await Wf(s,V),Z&&await Wf(s,t)}async function Wf(e,t){let n=e.getWriter();try{await n.ready,e.size+=Hi(t),await n.write(t)}finally{n.releaseLock()}}function OQ(e){if(e)return(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4)}function ho(e,t,n,i){let o=t[n]===Ei?e.options[n]:t[n];return o===Ei?i:o}function V0e(e){return e+5*(Math.floor(e/16383)+1)}function DU(e,t,n){e.setUint8(t,n)}function no(e,t,n){e.setUint16(t,n,!0)}function Oi(e,t,n){e.setUint32(t,n,!0)}function Dl(e,t,n){e.setBigUint64(t,n,!0)}function Ss(e,t,n){e.set(t,n)}function wa(e){return new DataView(e.buffer)}function Hi(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}mV({Deflate:cpe,Inflate:Xpe});var ipi=T(S(),1);function Bnt(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var In=Bnt;var rpi=T(S(),1);function Ynt(e,t){this.position=e,this.headingPitchRange=t}var Mv=Ynt;var lpi=T(S(),1);function BU(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new be,this.tourEnd=new be,this.entryStart=new be,this.entryEnd=new be,this._activeEntries=[]}BU.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};BU.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;Z0e.call(this,e,t,function(i){n.playlistIndex=0,i||R0e(n._activeEntries),n.tourEnd.raiseEvent(i)})};BU.prototype.stop=function(){R0e(this._activeEntries)};function R0e(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function Z0e(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let o=Ont.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 Ont(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++,Z0e.call(this,e,t,n)}}var Nv=BU;var Rpi=T(S(),1);var _pi=T(S(),1);var gpi=T(S(),1),Xi=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return 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}}}}),kv=function(){return performance.now()},Hnt=function(){function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}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(){for(var t,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];for(var o=0,r=n;o<r.length;o++){var s=r[o];(t=s._group)===null||t===void 0||t.remove(s),s._group=this,this._tweens[s.getId()]=s,this._tweensAddedDuringUpdate[s.getId()]=s}},e.prototype.remove=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var i=0,o=t;i<o.length;i++){var r=o[i];r._group=void 0,delete this._tweens[r.getId()],delete this._tweensAddedDuringUpdate[r.getId()]}},e.prototype.allStopped=function(){return this.getAll().every(function(t){return!t.isPlaying()})},e.prototype.update=function(t,n){t===void 0&&(t=kv()),n===void 0&&(n=!0);var i=Object.keys(this._tweens);if(i.length!==0)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&&this.remove(r)}i=Object.keys(this._tweensAddedDuringUpdate)}},e}(),_V={Linear:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=_V.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=_V.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=_V.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=_V.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}}},G0e=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),zQ=new Hnt,E0e=function(){function e(t,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=_V.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=G0e.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=t,typeof n=="object"?(this._group=n,n.add(this)):n===!0&&(this._group=zQ,zQ.add(this))}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=kv()),n===void 0&&(n=!1),this._isPlaying)return this;if(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],g=0,f=m.length;g<f;g+=1){var x=this._handleRelativeValue(a,m[g]);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._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(t){return t===void 0&&(t=kv()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=kv()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,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?(t.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},e.prototype.remove=function(){var t;return(t=this._group)===null||t===void 0||t.remove(this),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=_V.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=kv()),n===void 0&&(n=e.autoStartOnUpdate),this._isPaused)return!0;var r;if(!this._goToEnd&&!this._isPlaying)if(n)this.start(t,!0);else return!1;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 s=t-this._startTime,a=this._duration+((o=this._repeatDelayTime)!==null&&o!==void 0?o:this._delayTime),c=this._duration+this._repeat*a,d=function(){if(i._duration===0||s>c)return 1;var x=Math.trunc(s/a),_=s-x*a,C=Math.min(_/i._duration,1);return C===0&&s===i._duration?1:C},u=d(),m=this._easingFunction(u);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,m),this._onUpdateCallback&&this._onUpdateCallback(this._object,u),this._duration===0||s>=this._duration)if(this._repeat>0){var p=Math.min(Math.trunc((s-this._duration)/a)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=p);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+=a*p,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var g=0,f=this._chainedTweens.length;g<f;g++)this._chainedTweens[g].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.autoStartOnUpdate=!1,e}();var dpi=G0e.nextId,Pf=zQ,upi=Pf.getAll.bind(Pf),mpi=Pf.removeAll.bind(Pf),hpi=Pf.add.bind(Pf),fpi=Pf.remove.bind(Pf),ppi=Pf.update.bind(Pf);var znt={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},kr=Object.freeze(znt);function YU(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}YU.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)}};YU.prototype.stop=function(){l(this.activeCamera)&&this.activeCamera.cancelFlight(),l(this.activeCallback)&&this.activeCallback(!0)};YU.prototype.getCameraOptions=function(e){let t={duration:this.duration};return l(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=kr.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=_t(t,e)),t};var Uv=YU;var Epi=T(S(),1);function KQ(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}KQ.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};KQ.prototype.stop=function(){clearTimeout(this.timeout),l(this.activeCallback)&&this.activeCallback(!0)};var Dv=KQ;var N0e={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=Yy(t),N0e[t]}},t4;typeof DOMParser<"u"&&(t4=new DOMParser);var Knt=new zk({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),ay=32,X0e=2414016,I0e=1,W0e=16093e3,P0e=.1,v0e=[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"],w0e=["http://www.google.com/kml/ext/2.2"],Jnt=["http://www.w3.org/2005/Atom"],ve={kml:v0e,gx:w0e,atom:Jnt,kmlgx:v0e.concat(w0e)},n4={Document:J0e,Folder:fit,Placemark:pit,NetworkLink:Vit,GroundOverlay:Tit,PhotoOverlay:q0e,ScreenOverlay:_it,Tour:git};function vf(e){this._dataSource=e,this._deferred=fl(),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=Nd._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=Nd._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=n4[i.localName];if(l(o)&&(ve.kml.indexOf(i.namespaceURI)!==-1||ve.gx.indexOf(i.namespaceURI)!==-1)&&(o(t,i,n,this),this._timeoutSet||Nd._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}i=this._nextNode()}this._pop()&&e&&this._process(!0)};function Qnt(e){let t=e.slice(0,Math.min(4,e.size)),n=fl(),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 jnt(e){let t=fl(),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 k0e(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 U0e(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 qnt(e,t){return Promise.resolve(e.getData(new LU)).then(function(n){n=k0e(n),n=U0e(n),t.kml=t4.parseFromString(n,"application/xml")})}function JQ(e,t){let n=y(N0e.detectFromFilename(e.filename),"application/octet-stream");return Promise.resolve(e.getData(new CU(n))).then(function(i){t[e.filename]=i})}function Ad(e,t,n,i){let o=i.keys,r=new Bv.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 Bv.default(d).absoluteTo(r).toString(),p=o.indexOf(m);if(p!==-1){let g=o[p];c.setAttribute(n,i[g]),t==="a"&&c.getAttribute("download")===null&&c.setAttribute("download",g)}}}}function Md(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=i4(a,i);l(c)&&s.setAttribute(n,c.url)}}function D0e(e,t,n){let i=Cs(e,"id");i=l(i)&&i.length!==0?i:Bn(),l(n)&&(i=n+i);let o=t.getById(i);return l(o)&&(i=Bn(),l(n)&&(i=n+i)),o=t.add(new Jo({id:i})),l(o.kml)||(o.addProperty("kml"),o.kml=new Git),o}function Yv(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function KU(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 OU(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++]=KU(n[s],t);return o}function cy(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 Cs(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function Ii(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 F0e(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 hh(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 $n(e,t,n){let i=Ii(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function Wn(e,t,n){let i=Ii(e,t,n);if(l(i))return i.textContent.trim()}function fh(e,t,n){let i=Ii(e,t,n);if(l(i)){let o=i.textContent.trim();return o==="1"||/^true$/i.test(o)}}function i4(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 Ee({url:o});else{let r=new Bv.default(t.getUrlComponent()),s=new Bv.default(e);o=n[s.absoluteTo(r)],l(o)&&(i=new Ee({url:o}))}}return l(i)||(i=t.getDerivedResource({url:e})),i}var Bl={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function $Q(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?(Bl.maximumRed=r,Bl.red=void 0):(Bl.maximumRed=void 0,Bl.red=0),o>0?(Bl.maximumGreen=o,Bl.green=void 0):(Bl.maximumGreen=void 0,Bl.green=0),i>0?(Bl.maximumBlue=i,Bl.blue=void 0):(Bl.maximumBlue=void 0,Bl.blue=0),Bl.alpha=n,Y.fromRandom(Bl)):new Y(r,o,i,n)}function dT(e,t,n){let i=Wn(e,t,n);if(l(i))return $Q(i,Wn(e,"colorMode",n)==="random")}function $nt(e){let t=Ii(e,"TimeStamp",ve.kmlgx),n=Wn(t,"when",ve.kmlgx);if(!l(t)||!l(n)||n.length===0)return;let i=q.fromIso8601(n),o=new Fr;return o.addInterval(new Vn({start:i,stop:De.MAXIMUM_VALUE})),o}function eit(e){let t=Ii(e,"TimeSpan",ve.kmlgx);if(!l(t))return;let n,i=Ii(t,"begin",ve.kmlgx),o=l(i)?q.fromIso8601(i.textContent):void 0,r=Ii(t,"end",ve.kmlgx),s=l(r)?q.fromIso8601(r.textContent):void 0;if(l(o)&&l(s)){if(q.lessThan(s,o)){let a=o;o=s,s=a}n=new Fr,n.addInterval(new Vn({start:o,stop:s}))}else l(o)?(n=new Fr,n.addInterval(new Vn({start:o,stop:De.MAXIMUM_VALUE}))):l(s)&&(n=new Fr,n.addInterval(new Vn({start:De.MINIMUM_VALUE,stop:s})));return n}function B0e(){let e=new ec;return e.width=ay,e.height=ay,e.scaleByDistance=new kt(X0e,I0e,W0e,P0e),e.pixelOffsetScaleByDistance=new kt(X0e,I0e,W0e,P0e),e}function o4(){let e=new Lm;return e.outline=!0,e.outlineColor=Y.WHITE,e}function Y0e(){let e=new Vm;return e.translucencyByDistance=new kt(3e6,1,5e6,0),e.pixelOffset=new D(17,0),e.horizontalOrigin=gi.LEFT,e.font="16px sans-serif",e.style=No.FILL_AND_OUTLINE,e}function r4(e,t,n,i,o){let r=Wn(e,"href",ve.kml);if(!l(r)||r.length===0)return;if(r.indexOf("root://icons/palette-")===0){let a=r.charAt(21),c=y($n(e,"x",ve.gx),0),d=y($n(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=i4(r,n,i);if(o){let a=Wn(e,"refreshMode",ve.kml),c=Wn(e,"viewRefreshMode",ve.kml);a==="onInterval"||a==="onExpire"?Nt(`kml-refreshMode-${a}`,`KML - Unsupported Icon refreshMode: ${a}`):(c==="onStop"||c==="onRegion")&&Nt(`kml-refreshMode-${c}`,`KML - Unsupported Icon viewRefreshMode: ${c}`);let d=y(Wn(e,"viewBoundScale",ve.kml),1),u=c==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",m=y(Wn(e,"viewFormat",ve.kml),u),p=Wn(e,"httpQuery",ve.kml);l(m)&&s.setQueryParameters(nd(zU(m))),l(p)&&s.setQueryParameters(nd(zU(p)));let g=t._ellipsoid;return a4(s,t.camera,t.canvas,d,t._lastCameraView.bbox,g),s}return s}function tit(e,t,n,i,o){let r=$n(t,"scale",ve.kml),s=$n(t,"heading",ve.kml),a=dT(t,"color",ve.kml),c=Ii(t,"Icon",ve.kml),d=r4(c,e,i,o,!1);l(c)&&!l(d)&&(d=!1);let u=$n(c,"x",ve.gx),m=$n(c,"y",ve.gx),p=$n(c,"w",ve.gx),g=$n(c,"h",ve.gx),f=Ii(t,"hotSpot",ve.kml),x=cy(f,"x"),_=cy(f,"y"),C=Cs(f,"xunits"),V=Cs(f,"yunits"),L=n.billboard;l(L)||(L=B0e(),n.billboard=L),L.image=d,L.scale=r,L.color=a,(l(u)||l(m)||l(p)||l(g))&&(L.imageSubRegion=new Ke(u,m,p,g)),l(s)&&s!==0&&(L.rotation=W.toRadians(-s),L.alignedAxis=h.UNIT_Z),r=y(r,1);let Z,E;l(x)&&(C==="pixels"?Z=-x*r:C==="insetPixels"?Z=(x-ay)*r:C==="fraction"&&(Z=-x*ay*r),Z+=ay*.5*r),l(_)&&(V==="pixels"?E=_*r:V==="insetPixels"?E=(-_+ay)*r:V==="fraction"&&(E=_*ay*r),E-=ay*.5*r),(l(Z)||l(E))&&(L.pixelOffset=new D(Z,E))}function HU(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")tit(e,a,n,i,o);else if(a.localName==="LabelStyle"){let c=n.label;l(c)||(c=Y0e(),n.label=c),c.scale=y($n(a,"scale",ve.kml),c.scale),c.fillColor=y(dT(a,"color",ve.kml),c.fillColor),c.text=n.name}else if(a.localName==="LineStyle"){let c=n.polyline;l(c)||(c=new ic,n.polyline=c),c.width=$n(a,"width",ve.kml),c.material=dT(a,"color",ve.kml),l(dT(a,"outerColor",ve.gx))&&Nt("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),l($n(a,"outerWidth",ve.gx))&&Nt("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),l($n(a,"physicalWidth",ve.gx))&&Nt("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),l(fh(a,"labelVisibility",ve.gx))&&Nt("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if(a.localName==="PolyStyle"){let c=n.polygon;l(c)||(c=o4(),n.polygon=c),c.material=y(dT(a,"color",ve.kml),c.material),c.fill=y(fh(a,"fill",ve.kml),c.fill),c.outline=y(fh(a,"outline",ve.kml),c.outline)}else if(a.localName==="BalloonStyle"){let c=y($Q(Wn(a,"bgColor",ve.kml)),Y.WHITE),d=y($Q(Wn(a,"textColor",ve.kml)),Y.BLACK),u=Wn(a,"text",ve.kml);n.addProperty("balloonStyle"),n.balloonStyle={bgColor:c,textColor:d,text:u}}else if(a.localName==="ListStyle"){let c=Wn(a,"listItemType",ve.kml);(c==="radioFolder"||c==="checkOffOnly")&&Nt(`kml-listStyle-${c}`,`KML - Unsupported ListStyle with listItemType: ${c}`)}}}function nit(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")HU(e,m,r,i,o);else{let p=hh(m,"Pair",ve.kml);for(let g=0;g<p.length;g++){let f=p[g],x=Wn(f,"key",ve.kml);if(x==="normal"){let _=Wn(f,"styleUrl",ve.kml);if(l(_))s=n.getById(_),l(s)||(s=n.getById(`#${_}`)),l(s)&&r.merge(s);else{let C=Ii(f,"Style",ve.kml);HU(e,C,r,i,o)}}else Nt(`kml-styleMap-${x}`,`KML - Unsupported StyleMap key: ${x}`)}}}let u=Wn(t,"styleUrl",ve.kml);if(l(u)){let m=u;if(u[0]!=="#"&&u.indexOf("#")!==-1){let p=u.split("#"),g=p[0];m=`${i.getDerivedResource({url:g}).getUrlComponent()}#${p[1]}`}s=n.getById(m),l(s)||(s=n.getById(`#${m}`)),l(s)&&r.merge(s)}return r}function iit(e,t,n){return t.fetchXML().then(function(i){return O0e(e,i,n,t,!0)})}function O0e(e,t,n,i,o,r){let s,a,c,d,u=F0e(t,"Style",ve.kml);if(l(u)){let x=u.length;for(s=0;s<x;s++)d=u[s],a=Cs(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),HU(e,d,c,i,r)))}let m=F0e(t,"StyleMap",ve.kml);if(l(m)){let x=m.length;for(s=0;s<x;s++){let _=m[s];if(a=Cs(_,"id"),l(a)){let C=hh(_,"Pair",ve.kml);for(let V=0;V<C.length;V++){let L=C[V],Z=Wn(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 E=Wn(L,"styleUrl",ve.kml);if(l(E)){E[0]!=="#"&&(E=`#${E}`),o&&l(i)&&(E=i.getUrlComponent()+E);let X=n.getById(E);l(X)&&c.merge(X)}else d=Ii(L,"Style",ve.kml),HU(e,d,c,i,r)}}else Nt(`kml-styleMap-${Z}`,`KML - Unsupported StyleMap key: ${Z}`)}}}}let p=[],g=t.getElementsByTagName("styleUrl"),f=g.length;for(s=0;s<f;s++){let x=g[s].textContent;if(x[0]!=="#"){let _=x.split("#");if(_.length===2){let C=_[0],V=i.getDerivedResource({url:C});p.push(iit(e,V,n))}}}return p}function s4(e,t,n){let i=new E0(e,t.id,["position"]),o=new Sf(t.position);t.polyline=l(n.polyline)?n.polyline.clone():new ic,t.polyline.positions=new G0([i,o])}function H0e(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"?(Nt("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),Qe.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(Nt("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),Qe.RELATIVE_TO_GROUND):(l(e)?Nt("kml-altitudeMode-unknown",`KML - Unknown <kml:altitudeMode>:${e}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`):Nt("kml-gx:altitudeMode-unknown",`KML - Unknown <gx:altitudeMode>:${t}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`),Qe.CLAMP_TO_GROUND)}function oit(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&Nt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y(t,n)}`),new Sf(e))}function rit(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")&&Nt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y(t,n)}`);let o=e.length;for(let r=0;r<o;r++){let s=e[r];i.scaleToGeodeticSurface(s,s)}return e}function JU(e,t,n,i){let o=t.label;l(o)||(o=l(n.label)?n.label.clone():Y0e(),t.label=o),o.text=t.name;let r=t.billboard;l(r)||(r=l(n.billboard)?n.billboard.clone():B0e(),t.billboard=r),l(r.image)?r.image.getValue()||(r.image=void 0):r.image=e._pinBuilder.fromColor(Y.YELLOW,64);let s=1;l(r.scale)&&(s=r.scale.getValue(),s!==0?o.pixelOffset=new D(s*16+1,0):(o.pixelOffset=void 0,o.horizontalOrigin=void 0)),l(i)&&e._clampToGround&&(r.heightReference=i,o.heightReference=i)}function z0e(e,t){let n=e.path;l(n)||(n=new Ep,n.leadTime=0,e.path=n);let i=t.polyline;l(i)&&(n.material=i.material,n.width=i.width)}function sit(e,t,n,i,o){let r=Wn(n,"coordinates",ve.kml),s=Wn(n,"altitudeMode",ve.kml),a=Wn(n,"altitudeMode",ve.gx),c=fh(n,"extrude",ve.kml),d=e._ellipsoid,u=KU(r,d);return i.position=u,JU(e,i,o,H0e(s,a)),c&&Yv(s,a)&&s4(t,i,o),!0}function A0e(e,t,n,i,o){let r=Ii(n,"coordinates",ve.kml),s=Wn(n,"altitudeMode",ve.kml),a=Wn(n,"altitudeMode",ve.gx),c=fh(n,"extrude",ve.kml),d=fh(n,"tessellate",ve.kml),u=Yv(s,a),m=$n(n,"drawOrder",ve.gx),p=e._ellipsoid,g=OU(r,p),f=o.polyline;if(u&&c){let x=new Xp;i.wall=x,x.positions=g;let _=o.polygon;l(_)&&(x.fill=_.fill,x.material=_.material),x.outline=!0,l(f)?(x.outlineColor=l(f.material)?f.material.color:Y.WHITE,x.outlineWidth=f.width):l(_)&&(x.outlineColor=l(_.material)?_.material.color:Y.WHITE)}else if(e._clampToGround&&!u&&d){let x=new ic;x.clampToGround=!0,i.polyline=x,x.positions=g,l(f)?(x.material=l(f.material)?f.material.color.getValue(De.MINIMUM_VALUE):Y.WHITE,x.width=y(f.width,1)):(x.material=Y.WHITE,x.width=1),x.zIndex=m}else l(m)&&Nt("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!d&&Nt("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),f=l(f)?f.clone():new ic,i.polyline=f,f.positions=rit(g,s,a,p),(!d||u)&&(f.arcType=en.NONE);return!0}function ait(e,t,n,i,o){let r=Ii(n,"outerBoundaryIs",ve.kml),s=Ii(r,"LinearRing",ve.kml),a=Ii(s,"coordinates",ve.kml),c=e._ellipsoid,d=OU(a,c),u=fh(n,"extrude",ve.kml),m=Wn(n,"altitudeMode",ve.kml),p=Wn(n,"altitudeMode",ve.gx),g=Yv(m,p),f=l(o.polygon)?o.polygon.clone():o4(),x=o.polyline;if(l(x)&&(f.outlineColor=l(x.material)?x.material.color:Y.WHITE,f.outlineWidth=x.width),i.polygon=f,g?(f.perPositionHeight=!0,f.extrudedHeight=u?0:void 0):e._clampToGround||(f.height=0),l(d)){let _=new Za(d),C=hh(n,"innerBoundaryIs",ve.kml);for(let V=0;V<C.length;V++){s=hh(C[V],"LinearRing",ve.kml);for(let L=0;L<s.length;L++)a=Ii(s[L],"coordinates",ve.kml),d=OU(a,c),l(d)&&_.holes.push(new Za(d))}f.hierarchy=_}return!0}function cit(e,t,n,i,o){let r=Wn(n,"altitudeMode",ve.kml),s=Wn(n,"altitudeMode",ve.gx),a=hh(n,"coord",ve.gx),c=hh(n,"angles",ve.gx),d=hh(n,"when",ve.kml),u=fh(n,"extrude",ve.kml),m=Yv(r,s),p=e._ellipsoid;c.length>0&&Nt("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let g=Math.min(a.length,d.length),f=[],x=[];for(let C=0;C<g;C++){let V=KU(a[C].textContent,p);f.push(V),x.push(q.fromIso8601(d[C].textContent))}let _=new ca;return _.addSamples(x,f),i.position=_,JU(e,i,o,H0e(r,s)),z0e(i,o),i.availability=new Fr,d.length>0&&i.availability.addInterval(new Vn({start:x[0],stop:x[x.length-1]})),m&&u&&s4(t,i,o),!0}function M0e(e,t,n,i,o,r,s,a,c){let d=e[0],u=e[e.length-1],m=new ca;m.addSamples(e,t),n.intervals.addInterval(new Vn({start:d,stop:u,isStartIncluded:c,isStopIncluded:c,data:oit(m,s,a)})),i.addInterval(new Vn({start:d,stop:u,isStartIncluded:c,isStopIncluded:c})),o.intervals.addInterval(new Vn({start:d,stop:u,isStartIncluded:c,isStopIncluded:c,data:r}))}function lit(e,t,n,i,o){let r=fh(n,"interpolate",ve.gx),s=hh(n,"Track",ve.gx),a,c,d,u=!1,m=new I0,p=new Fr,g=new sa,f=e._ellipsoid;for(let x=0,_=s.length;x<_;x++){let C=s[x],V=hh(C,"when",ve.kml),L=hh(C,"coord",ve.gx),Z=Wn(C,"altitudeMode",ve.kml),E=Wn(C,"altitudeMode",ve.gx),X=Yv(Z,E),v=fh(C,"extrude",ve.kml),P=Math.min(L.length,V.length),A=[];a=[];for(let M=0;M<P;M++){let b=KU(L[M].textContent,f);A.push(b),a.push(q.fromIso8601(V[M].textContent))}r&&(l(c)&&M0e([c,a[0]],[d,A[0]],g,p,m,!1,"absolute",void 0,!1),c=a[P-1],d=A[A.length-1]),M0e(a,A,g,p,m,X&&v,Z,E,!0),u=u||X&&v}return i.availability=p,i.position=g,JU(e,i,o),z0e(i,o),u&&(s4(t,i,o),i.polyline.show=m),!0}var K0e={Point:sit,LineString:A0e,LinearRing:A0e,Polygon:ait,Track:cit,MultiTrack:lit,MultiGeometry:dit,Model:uit};function dit(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=K0e[u.localName];if(l(m)){let p=D0e(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 uit(e,t,n,i,o){return Nt("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function mit(e,t){let n=Ii(e,"ExtendedData",ve.kml);if(!l(n))return;l(Ii(n,"SchemaData",ve.kml))&&Nt("kml-schemaData","KML - SchemaData is unsupported"),l(Cs(n,"xmlns:prefix"))&&Nt("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");let i={},o=hh(n,"Data",ve.kml);if(l(o)){let r=o.length;for(let s=0;s<r;s++){let a=o[s],c=Cs(a,"name");l(c)&&(i[c]={displayName:Wn(a,"displayName",ve.kml),value:Wn(a,"value",ve.kml)})}}t.kml.extendedData=i}var fo;typeof document<"u"&&(fo=document.createElement("div"));function hit(e,t,n,i,o){let r,s,a,c=t.kml,d=c.extendedData,u=Wn(e,"description",ve.kml),m=y(t.balloonStyle,n.balloonStyle),p=Y.WHITE,g=Y.BLACK,f=u;l(m)&&(p=y(m.bgColor,Y.WHITE),g=y(m.textColor,Y.BLACK),f=y(m.text,u));let x;if(l(f)){if(f=f.replace("$[name]",y(t.name,"")),f=f.replace("$[description]",y(u,"")),f=f.replace("$[address]",y(c.address,"")),f=f.replace("$[Snippet]",y(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),E=/\/displayName$/.test(Z);Z=Z.replace(/\/displayName$/,""),x=d[Z],l(x)&&(x=E?x.displayName:x.value),l(x)&&(f=f.replace(L,y(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>${y(x.displayName,s)}</th><td>${y(x.value,"")}</td></tr>`;f+="</tbody></table>"}if(!l(f))return;f=Knt.link(f),fo.innerHTML=f;let _=fo.querySelectorAll("a");for(r=0;r<_.length;r++)_[r].setAttribute("target","_blank");l(i)&&i.keys.length>1&&(Ad(fo,"a","href",i),Ad(fo,"link","href",i),Ad(fo,"area","href",i),Ad(fo,"img","src",i),Ad(fo,"iframe","src",i),Ad(fo,"video","src",i),Ad(fo,"audio","src",i),Ad(fo,"source","src",i),Ad(fo,"track","src",i),Ad(fo,"input","src",i),Ad(fo,"embed","src",i),Ad(fo,"script","src",i),Ad(fo,"video","poster",i)),Md(fo,"a","href",o),Md(fo,"link","href",o),Md(fo,"area","href",o),Md(fo,"img","src",o),Md(fo,"iframe","src",o),Md(fo,"video","src",o),Md(fo,"audio","src",o),Md(fo,"source","src",o),Md(fo,"track","src",o),Md(fo,"input","src",o),Md(fo,"embed","src",o),Md(fo,"script","src",o),Md(fo,"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:${g.toCssColorString()};`,C+='">',C+=`${fo.innerHTML}</div>`,fo.innerHTML="",t.description=C}function QU(e,t,n){let i=n.entityCollection,o=n.parentEntity,r=n.sourceResource,s=n.uriResolver,a=D0e(t,i,n.context),c=a.kml,d=nit(e,t,n.styleCollection,r,s),u=Wn(t,"name",ve.kml);a.name=u,a.parent=o;let m=eit(t);l(m)||(m=$nt(t)),a.availability=m,l4(a);function p(L){return L?L.show&&p(L.parent):!0}let g=fh(t,"visibility",ve.kml);a.show=p(o)&&y(g,!0);let f=Ii(t,"author",ve.atom),x=c.author;x.name=Wn(f,"name",ve.atom),x.uri=Wn(f,"uri",ve.atom),x.email=Wn(f,"email",ve.atom);let _=Ii(t,"link",ve.atom),C=c.link;C.href=Cs(_,"href"),C.hreflang=Cs(_,"hreflang"),C.rel=Cs(_,"rel"),C.type=Cs(_,"type"),C.title=Cs(_,"title"),C.length=Cs(_,"length"),c.address=Wn(t,"address",ve.kml),c.phoneNumber=Wn(t,"phoneNumber",ve.kml),c.snippet=Wn(t,"Snippet",ve.kml),mit(t,a),hit(t,a,d,s,r);let V=e._ellipsoid;return j0e(t,a,V),Q0e(t,a,V),l(Ii(t,"Region",ve.kml))&&Nt("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:d}}function J0e(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function fit(e,t,n,i){let o=QU(e,t,n),r=Ye(n);r.parentEntity=o.entity,J0e(e,t,r,i)}function pit(e,t,n,i){let o=QU(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=K0e[m.localName];l(p)&&(p(e,n.entityCollection,m,r,s,r.id),a=!0)}a||(r.merge(s),JU(e,r,s))}var bit={FlyTo:xit,Wait:yit,SoundCue:QQ,AnimatedUpdate:QQ,TourControl:QQ};function git(e,t,n,i){let o=Wn(t,"name",ve.kml),r=Cs(t,"id"),s=new Nv(o,r),a=Ii(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=bit[m.localName];p?p(s,m,c):console.log(`Unknown KML Tour playlist entry type ${m.localName}`)}}}e._kmlTours.push(s)}function QQ(e,t){Nt(`KML Tour unsupported node ${t.localName}`)}function yit(e,t){let n=$n(t,"duration",ve.gx);e.addPlaylistEntry(new Dv(n))}function xit(e,t,n){let i=$n(t,"duration",ve.gx),o=Wn(t,"flyToMode",ve.gx),r={kml:{}};j0e(t,r,n),Q0e(t,r,n);let s=r.kml.lookAt||r.kml.camera,a=new Uv(i,o,s);e.addPlaylistEntry(a)}function Q0e(e,t,n){let i=Ii(e,"Camera",ve.kml);if(l(i)){let o=y($n(i,"longitude",ve.kml),0),r=y($n(i,"latitude",ve.kml),0),s=y($n(i,"altitude",ve.kml),0),a=y($n(i,"heading",ve.kml),0),c=y($n(i,"tilt",ve.kml),0),d=y($n(i,"roll",ve.kml),0),u=h.fromDegrees(o,r,s,n),m=_a.fromDegrees(a,c-90,d);t.kml.camera=new xv(u,m)}}function j0e(e,t,n){let i=Ii(e,"LookAt",ve.kml);if(l(i)){let o=y($n(i,"longitude",ve.kml),0),r=y($n(i,"latitude",ve.kml),0),s=y($n(i,"altitude",ve.kml),0),a=$n(i,"heading",ve.kml),c=$n(i,"tilt",ve.kml),d=y($n(i,"range",ve.kml),0);c=W.toRadians(y(c,0)),a=W.toRadians(y(a,0));let u=new Hu(a,c-W.PI_OVER_TWO,d),m=h.fromDegrees(o,r,s,n);t.kml.lookAt=new Mv(m,u)}}function _it(e,t,n,i){let o=n.screenOverlayContainer;if(!l(o))return;let r=n.sourceResource,s=n.uriResolver,a=Ii(t,"Icon",ve.kml),c=r4(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=Ii(t,"screenXY",ve.kml),p=Ii(t,"overlayXY",ve.kml),g=Ii(t,"size",ve.kml),f,x,_,C,V,L;l(g)&&(f=cy(g,"x"),x=cy(g,"y"),_=Cs(g,"xunits"),C=Cs(g,"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,E=d.height;l(p)&&(f=cy(p,"x"),x=cy(p,"y"),_=Cs(p,"xunits"),C=Cs(p,"yunits"),l(f)&&(_==="fraction"?Z=f*d.width:(_==="pixels"||_==="insetPixels")&&(Z=f)),l(x)&&(C==="fraction"?E=x*d.height:(C==="pixels"||C==="insetPixels")&&(E=x))),l(m)&&(f=cy(m,"x"),x=cy(m,"y"),_=Cs(m,"xunits"),C=Cs(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)}% - ${E}px)`:C==="pixels"?L=`bottom: ${x-E}px`:C==="insetPixels"&&(L=`top: ${x-E}px`),u.push(L))),d.style=u.join(";")},o.appendChild(d)}function Tit(e,t,n,i){let r=QU(e,t,n).entity,s,a=!1,c=e._ellipsoid,d=OU(Ii(t,"LatLonQuad",ve.gx),c),u=$n(t,"drawOrder",ve.kml);if(l(d))s=o4(),s.hierarchy=new Za(d),s.zIndex=u,r.polygon=s,a=!0;else{s=new Rm,s.zIndex=u,r.rectangle=s;let f=Ii(t,"LatLonBox",ve.kml);if(l(f)){let x=$n(f,"west",ve.kml),_=$n(f,"south",ve.kml),C=$n(f,"east",ve.kml),V=$n(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 ae(x,_,C,V);let L=$n(f,"rotation",ve.kml);if(l(L)){let Z=W.toRadians(L);s.rotation=Z,s.stRotation=Z}}}let m=Ii(t,"Icon",ve.kml),p=r4(m,e,n.sourceResource,n.uriResolver,!0);if(l(p)){a&&Nt("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");let f=$n(m,"x",ve.gx),x=$n(m,"y",ve.gx),_=$n(m,"w",ve.gx),C=$n(m,"h",ve.gx);(l(f)||l(x)||l(_)||l(C))&&Nt("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),s.material=p,s.material.color=dT(t,"color",ve.kml),s.material.transparent=!0}else s.material=dT(t,"color",ve.kml);let g=Wn(t,"altitudeMode",ve.kml);l(g)?g==="absolute"?(s.height=$n(t,"altitude",ve.kml),s.zIndex=void 0):g!=="clampToGround"&&Nt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`):(g=Wn(t,"altitudeMode",ve.gx),g==="relativeToSeaFloor"?(Nt("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),s.height=$n(t,"altitude",ve.kml),s.zIndex=void 0):g==="clampToSeaFloor"?Nt("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):l(g)&&Nt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`))}function q0e(e,t,n,i){e._unsupportedNode.raiseEvent(e,n.parentEntity,t,n.entityCollection,n.styleCollection,n.sourceResource,n.uriResolver),Nt(`kml-unsupportedFeature-${t.nodeName}`,`KML - Unsupported feature: ${t.nodeName}`)}var ly={INTERVAL:0,EXPIRE:1,STOP:2};function zU(e){if(!l(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var Sit=new ae,TV=new he,jQ=new D,Cit=new h;function a4(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=zy(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==oe.MORPHING){let d,u;if(o=y(o,Sit),l(n)&&(jQ.x=n.clientWidth*.5,jQ.y=n.clientHeight*.5,d=t.pickEllipsoid(jQ,r,Cit)),l(d)?u=r.cartesianToCartographic(d,TV):(u=ae.center(o,TV),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 ae(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,TV),c=c.replace("[cameraLon]",W.toDegrees(TV.longitude).toString()),c=c.replace("[cameraLat]",W.toDegrees(TV.latitude).toString()),c=c.replace("[cameraAlt]",W.toDegrees(TV.height).toString());let g=t.frustum,f=g.aspectRatio,x="",_="";if(l(f)){let C=W.toDegrees(g.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(nd(c))}function Vit(e,t,n,i){let r=QU(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,c=Ii(t,"Link",ve.kml);if(l(c)||(c=Ii(t,"Url",ve.kml)),l(c)){let d=Wn(c,"href",ve.kml),u,m;if(l(d)){let p=d;if(d=i4(d,s,n.uriResolver),/^data:/.test(d.getUrlComponent()))/\.kmz/i.test(s.getUrlComponent())||(p=s.getDerivedResource({url:p}));else{if(p=d.clone(),u=Wn(c,"viewRefreshMode",ve.kml),u==="onRegion"){Nt("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}m=y(Wn(c,"viewBoundScale",ve.kml),1);let _=u==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",C=y(Wn(c,"viewFormat",ve.kml),_),V=Wn(c,"httpQuery",ve.kml);l(C)&&d.setQueryParameters(nd(zU(C))),l(V)&&d.setQueryParameters(nd(zU(V)));let L=e._ellipsoid;a4(d,e.camera,e.canvas,m,e._lastCameraView.bbox,L)}let g={sourceUri:p,uriResolver:a,context:r.id,screenOverlayContainer:n.screenOverlayContainer},f=new ks,x=c4(e,f,d,g).then(function(_){let C=e._entityCollection,V=f.values;C.suspendEvents();for(let E=0;E<V.length;E++){let X=V[E];l(X.parent)||(X.parent=r,l4(X)),C.add(X)}C.resumeEvents();let L=Wn(c,"refreshMode",ve.kml),Z=y($n(c,"refreshInterval",ve.kml),0);if(L==="onInterval"&&Z>0||L==="onExpire"||u==="onStop"){let E=Ii(_,"NetworkLinkControl",ve.kml),X=l(E),v=q.now(),P={id:Bn(),href:d,cookie:{},lastUpdated:v,updating:!1,entity:r,viewBoundScale:m,needsUpdate:!1,cameraUpdateTime:v},A=0;if(X&&(P.cookie=nd(y(Wn(E,"cookie",ve.kml),"")),A=y($n(E,"minRefreshPeriod",ve.kml),0)),L==="onInterval")X&&(Z=Math.max(A,Z)),P.refreshMode=ly.INTERVAL,P.time=Z;else if(L==="onExpire"){let M;if(X&&(M=Wn(E,"expires",ve.kml)),l(M))try{let b=q.fromIso8601(M),R=q.secondsDifference(b,v);R>0&&R<A&&q.addSeconds(v,A,b),P.refreshMode=ly.EXPIRE,P.time=b}catch{Nt("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else Nt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else l(e.camera)?(P.refreshMode=ly.STOP,P.time=y($n(c,"viewRefreshTime",ve.kml),0)):Nt("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.");l(P.refreshMode)&&e._networkLinks.set(P.id,P)}}).catch(function(_){Nt(`An error occured during loading ${d.url}`),e._error.raiseEvent(e,_)});i.addPromise(x)}}}function Lit(e,t,n,i){let o=n4[t.localName];return l(o)?o(e,t,n,i):q0e(e,t,n,i)}function e4(e,t,n,i,o,r,s){t.removeAll();let a=n.documentElement,c=a.localName==="Document"?a:Ii(a,"Document",ve.kml),d=Wn(c,"name",ve.kml);l(d)||(d=R0(i.getUrlComponent())),l(e._name)||(e._name=d);let u=new Nd._DeferredLoading(e),m=new ks(e);return Promise.all(O0e(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(n4[_.localName])){p=_;break}}}let g={parentEntity:void 0,entityCollection:t,styleCollection:m,sourceResource:i,uriResolver:o,context:s,screenOverlayContainer:r};return t.suspendEvents(),Lit(e,p,g,u),t.resumeEvents(),u.wait().then(function(){return n.documentElement})})}function Rit(e,t,n,i,o){let r=nn("ThirdParty/Workers/z-worker-pako.js");mV({workerScripts:{deflate:[r,"./pako_deflate.min.js"],inflate:[r,"./pako_inflate.min.js"]}});let s=new NU(new B0(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(JQ(u,d)),u=p):c.push(JQ(p,d)))}return l(u)&&c.push(qnt(u,d)),Promise.all(c).then(function(){if(s.close(),!l(d.kml))throw new ue("KMZ file does not contain a KML document.");return d.keys=Object.keys(d),e4(e,t,d.kml,i,d,o)})})}function c4(e,t,n,i){i=y(i,y.EMPTY_OBJECT);let o=i.sourceUri,r=i.uriResolver,s=i.context,a=i.screenOverlayContainer,c=n;if(typeof n=="string"||n instanceof Ee){n=Ee.createIfNeeded(n),c=n.fetchBlob(),o=y(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=y(o,Ee.DEFAULT.clone());return o=Ee.createIfNeeded(o),l(a)&&(a=In(a)),Promise.resolve(c).then(function(d){return d instanceof Blob?Qnt(d).then(function(u){return u?Rit(e,t,d,o,a):jnt(d).then(function(m){m=k0e(m),m=U0e(m);let p,g;try{p=t4.parseFromString(m,"application/xml")}catch(f){g=f.toString()}if(l(g)||p.body||p.documentElement.tagName==="parsererror"){let f=l(g)?g:p.documentElement.firstChild.nodeValue;throw f||(f=p.body.innerText),new ue(f)}return e4(e,t,p,o,r,a,s)})}):e4(e,t,d,o,r,a,s)}).catch(function(d){return e._error.raiseEvent(e,d),console.log(d),Promise.reject(d)})}function Nd(e){e=y(e,y.EMPTY_OBJECT);let t=e.camera,n=e.canvas;this._changed=new be,this._error=new be,this._loading=new be,this._refresh=new be,this._unsupportedNode=new be,this._clock=void 0,this._entityCollection=new ks(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new M0,this._networkLinks=new Lt,this._entityCluster=new Cd,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():ae.clone(ae.MAX_VALUE)},this._ellipsoid=y(e.ellipsoid,ne.default);let i=e.credit;typeof i=="string"&&(i=new Rt(i)),this._credit=i,this._resourceCredits=[],this._kmlTours=[],this._screenOverlays=[]}Nd.load=function(e,t){return t=y(t,y.EMPTY_OBJECT),new Nd(t).load(e,t)};Object.defineProperties(Nd.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}}});Nd.prototype.load=function(e,t){t=y(t,y.EMPTY_OBJECT),Ar.setLoading(this,!0);let n=this._name;this._name=void 0,this._clampToGround=y(t.clampToGround,!1);let i=this;return c4(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,c=q.equals(s,De.MINIMUM_VALUE),d=q.equals(a,De.MAXIMUM_VALUE);if(!c||!d){let m;c&&(m=new Date,m.setHours(0,0,0,0),s=q.fromDate(m)),d&&(m=new Date,m.setHours(24,0,0,0),a=q.fromDate(m)),o=new th,o.startTime=s,o.stopTime=a,o.currentTime=q.clone(s),o.clockRange=Mr.LOOP_STOP,o.clockStep=mo.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(q.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),Ar.setLoading(i,!1),i}).catch(function(o){return Ar.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};Nd.prototype.destroy=function(){for(;this._screenOverlays.length>0;)this._screenOverlays.pop().remove()};function l4(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 Zit(e,t,n,i,o){return function(r){if(!i.contains(t.id))return;let s=!1,a=Ii(r,"NetworkLinkControl",ve.kml),c=l(a),d=0;if(c){if(l(Ii(a,"Update",ve.kml))){Nt("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=nd(y(Wn(a,"cookie",ve.kml),"")),d=y($n(a,"minRefreshPeriod",ve.kml),0)}let u=q.now(),m=t.refreshMode;if(m===ly.INTERVAL)l(a)&&(t.time=Math.max(d,t.time));else if(m===ly.EXPIRE){let v;if(l(a)&&(v=Wn(a,"expires",ve.kml)),l(v))try{let P=q.fromIso8601(v),A=q.secondsDifference(P,u);A>0&&A<d&&q.addSeconds(u,d,P),t.time=P}catch{Nt("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),s=!0}else Nt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),s=!0}let p=t.entity,g=e._entityCollection,f=n.values;function x(v){g.remove(v);let P=v._children,A=P.length;for(let M=0;M<A;++M)x(P[M])}g.suspendEvents();let _=g.values.slice(),C;for(C=0;C<_.length;++C){let v=_[C];v.parent===p&&(v.parent=void 0,x(v))}for(g.resumeEvents(),g.suspendEvents(),C=0;C<f.length;C++){let v=f[C];l(v.parent)||(v.parent=p,l4(v)),g.add(v)}g.resumeEvents(),s?i.remove(t.id):t.lastUpdated=u;let V=g.computeAvailability(),L=V.start,Z=V.stop,E=q.equals(L,De.MINIMUM_VALUE),X=q.equals(Z,De.MAXIMUM_VALUE);if(!E||!X){let v=e._clock;(v.startTime!==L||v.stopTime!==Z)&&(v.startTime=L,v.stopTime=Z,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,o.getUrlComponent(!0))}}var qQ=new Lt;Nd.prototype.update=function(e){let t=this._networkLinks;if(t.length===0)return!0;let n=q.now(),i=this;qQ.removeAll();function o(u){let m=u._children,p=m.length;for(let g=0;g<p;++g){let f=m[g];qQ.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 Lt,d=!1;return t.values.forEach(function(u){let m=u.entity;if(!qQ.contains(m.id)){if(!u.updating){let p=!1;if(u.refreshMode===ly.INTERVAL?q.secondsDifference(n,u.lastUpdated)>u.time&&(p=!0):u.refreshMode===ly.EXPIRE?q.greaterThan(n,u.time)&&(p=!0):u.refreshMode===ly.STOP&&(r&&(u.needsUpdate=!0,u.cameraUpdateTime=n),u.needsUpdate&&q.secondsDifference(n,u.cameraUpdateTime)>=u.time&&(p=!0)),p){o(m),u.updating=!0;let g=new ks,f=u.href.clone();f.setQueryParameters(u.cookie);let x=y(i._ellipsoid,ne.default);a4(f,i.camera,i.canvas,u.viewBoundScale,s.bbox,x),c4(i,g,f,{context:m.id}).then(Zit(i,u,g,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 Git(){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}Nd._DeferredLoading=vf;Nd._getTimestamp=_i;var Ov=Nd;var H0i=T(S(),1);function Hv(){pe.throwInstantiationError()}Hv.prototype.update=pe.throwInstantiationError;Hv.prototype.getBoundingSphere=pe.throwInstantiationError;Hv.prototype.isDestroyed=pe.throwInstantiationError;Hv.prototype.destroy=pe.throwInstantiationError;var d4=Hv;var Sbi=T(S(),1);var u4=32,Eit="http://www.opengis.net/kml/2.2",bh="http://www.google.com/kml/ext/2.2",Xit="http://www.w3.org/2000/xmlns/";function jU(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var Iit=/^data:image\/([^,;]+)/;jU.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof Ee){if(e=Ee.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(Iit);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 Wit(e,t){return function(n){e._files[t]=n}}jU.prototype.model=function(e,t){let n=this._modelCallback;if(!l(n))throw new ue("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(Wit(this,r))}return o};Object.defineProperties(jU.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function qU(e){this._time=e}qU.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),y(i,t)};qU.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return mT(n)};qU.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function m4(){this._ids={},this._styles={},this._count=0}m4.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};m4.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 tbe(){this._ids={}}tbe.prototype.get=function(e){if(!l(e))return this.get(Bn());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function h4(e){e=y(e,y.EMPTY_OBJECT);let t=e.entities,n=y(e.kmz,!1),i=h4._createState(e),o=t.values.filter(function(d){return!l(d.parent)}),r=i.kmlDoc,s=r.documentElement;s.setAttributeNS(Xit,"xmlns:gx",bh);let a=r.createElement("Document");s.appendChild(a),ibe(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?Pit(u,c.files):{kml:u,externalFiles:c.files}})}function Pit(e,t){let n=nn("ThirdParty/Workers/z-worker-pako.js");mV({workerScripts:{deflate:[n,"./pako_deflate.min.js"],inflate:[n,"./pako_inflate.min.js"]}});let i=new Wv,o=new UU(i);return o.add("doc.kml",new VU(e)).then(function(){let r=Object.keys(t);return nbe(o,r,t,0)}).then(function(){return o.close()}).then(function(r){return{kmz:r}})}function nbe(e,t,n,i){if(t.length===i)return;let o=t[i];return e.add(o,new B0(n[o])).then(function(){return nbe(e,t,n,i+1)})}h4._createState=function(e){let t=e.entities,n=new m4,i=t.computeAvailability(),o=l(e.time)?e.time:i.start,r=y(e.defaultAvailability,i),s=y(e.sampleDuration,60);r.start===De.MINIMUM_VALUE?r.stop===De.MAXIMUM_VALUE?r=new Vn:q.addSeconds(r.stop,-10*s,r.start):r.stop===De.MAXIMUM_VALUE&&q.addSeconds(r.start,10*s,r.stop);let a=new jU(e.modelCallback);return{kmlDoc:document.implementation.createDocument(Eit,"kml"),ellipsoid:y(e.ellipsoid,ne.default),idManager:new tbe,styleCache:n,externalFileHandler:a,time:o,valueGetter:new qU(o),sampleDuration:s,defaultAvailability:new Fr([r])}};function ibe(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=[],vit(e,p,d,u),wit(e,p.polyline,d,u),ebe(e,p.rectangle,d,u,c),ebe(e,p.polygon,d,u,c),Nit(e,p,p.model,d,u);let g,f=p.availability;l(f)&&(g=i.createElement("TimeSpan"),q.equals(f.start,De.MINIMUM_VALUE)||g.appendChild(hn(i,"begin",q.toIso8601(f.start))),q.equals(f.stop,De.MAXIMUM_VALUE)||g.appendChild(hn(i,"end",q.toIso8601(f.stop))));for(let C=0;C<c.length;++C){let V=c[C];V.setAttribute("id",s.get(p.id)),V.appendChild(hn(i,"name",p.name)),V.appendChild(hn(i,"visibility",p.show)),V.appendChild(hn(i,"description",p.description)),l(g)&&V.appendChild(g),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 E=i.createElement("LabelStyle"),X=r.get(L.text);V=l(X)&&X.length>0?X:V;let v=r.getColor(L.fillColor);l(v)&&(E.appendChild(hn(i,"color",v)),E.appendChild(hn(i,"colorMode","normal")));let P=r.get(L.scale);l(P)&&E.appendChild(hn(i,"scale",P)),u.push(E)}C.appendChild(hn(i,"name",V)),C.appendChild(hn(i,"visibility",p.show)),C.appendChild(hn(i,"description",p.description)),l(g)&&C.appendChild(g),t.appendChild(C);let Z=u.length;if(Z>0){let E=i.createElement("Style");for(let X=0;X<Z;++X)E.appendChild(u[X]);C.appendChild(hn(i,"styleUrl",o.get(E)))}if(d.length===1)C.appendChild(d[0]);else if(d.length>1){let E=i.createElement("MultiGeometry");for(let X=0;X<x;++X)E.appendChild(d[X]);C.appendChild(E)}}let _=p._children;if(_.length>0){let C=i.createElement("Folder");C.setAttribute("id",s.get(p.id)),C.appendChild(hn(i,"name",p.name)),C.appendChild(hn(i,"visibility",p.show)),C.appendChild(hn(i,"description",p.description)),t.appendChild(C),ibe(e,C,_)}}}var Yl=new h,el=new he,ph=new q;function vit(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter,a=y(t.billboard,t.point);if(!l(a)&&!l(t.path))return;let c=t.position;if(!c.isConstant){obe(e,t,a,n,i);return}s.get(c,void 0,Yl);let d=hn(o,"coordinates",uT(Yl,r)),u=o.createElement("Point"),m=o.createElement("altitudeMode");m.appendChild(hT(e,a.heightReference)),u.appendChild(m),u.appendChild(d),n.push(u);let p=a instanceof ec?sbe(e,a):rbe(e,a);i.push(p)}function obe(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,c,d=t.position,u=!0;d instanceof sa?(c=d.intervals,u=!1):c=y(t.availability,e.defaultAvailability);let m=n instanceof Gp,p,g,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 Sf?(V=V._value,L.appendChild(hT(e,Qe.CLAMP_TO_GROUND))):l(n)?L.appendChild(hT(e,n.heightReference)):L.appendChild(hT(e,Qe.NONE));let Z=[],E=[];if(V.isConstant){a.get(V,void 0,Yl);let v=hn(r,"coordinates",uT(Yl,s));Z.push(q.toIso8601(C.start)),E.push(v),Z.push(q.toIso8601(C.stop)),E.push(v)}else if(V instanceof ca)for(f=V._property._times,g=0;g<f.length;++g)Z.push(q.toIso8601(f[g])),V.getValueInReferenceFrame(f[g],$i.FIXED,Yl),E.push(uT(Yl,s));else if(V instanceof Zd){f=V._times;let v=V._values;for(g=0;g<f.length;++g)Z.push(q.toIso8601(f[g])),h.fromArray(v,g*3,Yl),E.push(uT(Yl,s))}else{let v=e.sampleDuration;C.start.clone(ph),C.isStartIncluded||q.addSeconds(ph,v,ph);let P=C.stop;for(;q.lessThan(ph,P);)V.getValue(ph,Yl),Z.push(q.toIso8601(ph)),E.push(uT(Yl,s)),q.addSeconds(ph,v,ph);C.isStopIncluded&&q.equals(ph,P)&&(V.getValue(ph,Yl),Z.push(q.toIso8601(ph)),E.push(uT(Yl,s)))}let X=r.createElementNS(bh,"Track");X.appendChild(L);for(let v=0;v<Z.length;++v){let P=hn(r,"when",Z[v]),A=hn(r,"coord",E[v],bh);X.appendChild(P),X.appendChild(A)}m&&X.appendChild(abe(e,n)),x.push(X)}if(x.length===1)i.push(x[0]);else if(x.length>1){let C=r.createElementNS(bh,"MultiTrack");for(p=0;p<x.length;++p)C.appendChild(x[p]);i.push(C)}if(l(n)&&!m){let C=n instanceof ec?sbe(e,n):rbe(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(hn(r,"width",C)),f4(e,V,L),o.push(L)}}}function rbe(e,t){let n=e.kmlDoc,i=e.valueGetter,o=n.createElement("IconStyle"),r=i.getColor(t.color);l(r)&&(o.appendChild(hn(n,"color",r)),o.appendChild(hn(n,"colorMode","normal")));let s=i.get(t.pixelSize);return l(s)&&o.appendChild(hn(n,"scale",s/u4)),o}function sbe(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(hn(n,"href",s));let g=i.get(t.imageSubRegion);l(g)&&(p.appendChild(hn(n,"x",g.x,bh)),p.appendChild(hn(n,"y",g.y,bh)),p.appendChild(hn(n,"w",g.width,bh)),p.appendChild(hn(n,"h",g.height,bh))),r.appendChild(p)}let a=i.getColor(t.color);l(a)&&(r.appendChild(hn(n,"color",a)),r.appendChild(hn(n,"colorMode","normal")));let c=i.get(t.scale);l(c)&&r.appendChild(hn(n,"scale",c));let d=i.get(t.pixelOffset);if(l(d)){c=y(c,1),D.divideByScalar(d,c,d);let p=i.get(t.width,u4),g=i.get(t.height,u4),f=i.get(t.horizontalOrigin,gi.CENTER);f===gi.CENTER?d.x-=p*.5:f===gi.RIGHT&&(d.x-=p);let x=i.get(t.verticalOrigin,Pn.CENTER);x===Pn.TOP?d.y+=g:x===Pn.CENTER&&(d.y+=g*.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(hn(n,"heading",u))),r}function wit(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(hn(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),g=hn(o,"coordinates",uT(p,r));a.appendChild(g);let f=s.get(t.zIndex);d&&l(f)&&a.appendChild(hn(o,"drawOrder",f,bh)),n.push(a);let x=o.createElement("LineStyle"),_=s.get(t.width);l(_)&&x.appendChild(hn(o,"width",_)),f4(e,t.material,x),i.push(x)}function Fit(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=[ae.northeast,ae.southeast,ae.southwest,ae.northwest];for(let g=0;g<4;++g)d[g](a,el),c.push(`${W.toDegrees(el.longitude)},${W.toDegrees(el.latitude)},${r}`);let u=hn(i,"coordinates",c.join(" ")),m=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(u),m.appendChild(p),[m]}function $0e(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,el),s.push(`${W.toDegrees(el.longitude)},${W.toDegrees(el.latitude)},${i?el.height:n}`);let c=hn(o,"coordinates",s.join(" ")),d=o.createElement("LinearRing");return d.appendChild(c),d}function Ait(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($0e(e,u,r,s)),a.push(m);let p=d.holes;if(l(p)){let g=p.length;for(let f=0;f<g;++f){let x=i.createElement("innerBoundaryIs");x.appendChild($0e(e,p[f].positions,r,s)),a.push(x)}}return a}function ebe(e,t,n,i,o){let r=e.kmlDoc,s=e.valueGetter;if(!l(t))return;let a=t instanceof Rm;if(a&&s.getMaterialType(t.material)==="Image"){Mit(e,t,o);return}let c=r.createElement("Polygon"),d=s.get(t.extrudedHeight,0);d>0&&c.appendChild(hn(r,"extrude",!0));let u=a?Fit(e,t,d):Ait(e,t,d),m=u.length;for(let _=0;_<m;++_)c.appendChild(u[_]);let p=r.createElement("altitudeMode");p.appendChild(hT(e,t.heightReference)),c.appendChild(p),n.push(c);let g=r.createElement("PolyStyle"),f=s.get(t.fill,!1);f&&g.appendChild(hn(r,"fill",f)),f4(e,t.material,g);let x=s.get(t.outline,!1);if(x){g.appendChild(hn(r,"outline",x));let _=r.createElement("LineStyle"),C=s.get(t.outlineWidth,1);_.appendChild(hn(r,"width",C));let V=s.getColor(t.outlineColor,Y.BLACK);_.appendChild(hn(r,"color",V)),_.appendChild(hn(r,"colorMode","normal")),i.push(_)}i.push(g)}function Mit(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=e.externalFileHandler,s=i.createElement("GroundOverlay"),a=i.createElement("altitudeMode");a.appendChild(hT(e,t.heightReference)),s.appendChild(a);let c=o.get(t.height);l(c)&&s.appendChild(hn(i,"altitude",c));let d=o.get(t.coordinates),u=i.createElement("LatLonBox");u.appendChild(hn(i,"north",W.toDegrees(d.north))),u.appendChild(hn(i,"south",W.toDegrees(d.south))),u.appendChild(hn(i,"east",W.toDegrees(d.east))),u.appendChild(hn(i,"west",W.toDegrees(d.west))),s.appendChild(u);let m=o.get(t.material),p=r.texture(m.image),g=i.createElement("Icon");g.appendChild(hn(i,"href",p)),s.appendChild(g);let f=m.color;l(f)&&s.appendChild(hn(i,"color",mT(m.color))),n.push(s)}function abe(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(hn(n,"x",s)),d.appendChild(hn(n,"y",s)),d.appendChild(hn(n,"z",s)),r.appendChild(d)}let a=n.createElement("Link"),c=o.model(t,e.time);return a.appendChild(hn(n,"href",c)),r.appendChild(a),r}function Nit(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){obe(e,t,n,i,o);return}let d=abe(e,n),u=r.createElement("altitudeMode");u.appendChild(hT(e,n.heightReference)),d.appendChild(u),a.get(c,void 0,Yl),he.fromCartesian(Yl,s,el);let m=r.createElement("Location");m.appendChild(hn(r,"longitude",W.toDegrees(el.longitude))),m.appendChild(hn(r,"latitude",W.toDegrees(el.latitude))),m.appendChild(hn(r,"altitude",el.height)),d.appendChild(m),i.push(d)}function f4(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=mT(Y.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":s=mT(r.color);break;case"PolylineOutline":s=mT(r.color),c=mT(r.outlineColor),d=r.outlineWidth,n.appendChild(hn(i,"outerColor",c,bh)),n.appendChild(hn(i,"outerWidth",d,bh));break;case"Stripe":s=mT(r.oddColor);break}l(s)&&(n.appendChild(hn(i,"color",s)),n.appendChild(hn(i,"colorMode","normal")))}function hT(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 uT(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let o=0;o<n;++o)he.fromCartesian(e[o],t,el),i.push(`${W.toDegrees(el.longitude)},${W.toDegrees(el.latitude)},${el.height}`);return i.join(" ")}function hn(e,t,n,i){n=y(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 mT(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 p4=h4;var xyi=T(S(),1);var Vbi=T(S(),1),kit={NONE:0,LERC:1},Ju=Object.freeze(kit);var Xgi=T(S(),1);var tgi=T(S(),1);var Mbi=T(S(),1);var Rbi=T(S(),1),Uit={NONE:0,BITS12:1},Ys=Object.freeze(Uit);var fT=new h,Dit=new h,Qu=new D,$U=new F,Bit=new F,Yit=Math.pow(2,12);function yc(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 g=t.minimum,f=t.maximum,x=h.subtract(f,g,Dit),_=i-n;Math.max(h.maximumComponent(x),_)<Yit-1?u=Ys.BITS12:u=Ys.NONE,m=F.inverseTransformation(o,new F);let V=h.negate(g,fT);F.multiply(F.fromTranslation(V,$U),m,m);let L=fT;L.x=1/x.x,L.y=1/x.y,L.z=1/x.z,F.multiply(F.fromScale(L,$U),m,m),p=F.clone(o),F.setTranslation(p,h.ZERO,p),o=F.clone(o,new F);let Z=F.fromTranslation(g,$U),E=F.fromScale(x,Bit),X=F.multiply(Z,E,$U);F.multiply(o,X,o),F.multiply(p,X,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=y(s,!1),this.hasGeodeticSurfaceNormals=y(a,!1),this.exaggeration=y(c,1),this.exaggerationRelativeHeight=y(d,0),this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}yc.prototype.encode=function(e,t,n,i,o,r,s,a){let c=i.x,d=i.y;if(this.quantization===Ys.BITS12){n=F.multiplyByPoint(this.toScaledENU,n,fT),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);D.fromElements(n.x,n.y,Qu);let p=wn.compressTextureCoordinates(Qu);D.fromElements(n.z,m,Qu);let g=wn.compressTextureCoordinates(Qu);D.fromElements(c,d,Qu);let f=wn.compressTextureCoordinates(Qu);if(e[t++]=p,e[t++]=g,e[t++]=f,this.hasWebMercatorT){D.fromElements(s,0,Qu);let x=wn.compressTextureCoordinates(Qu);e[t++]=x}}else h.subtract(n,this.center,fT),e[t++]=fT.x,e[t++]=fT.y,e[t++]=fT.z,e[t++]=o,e[t++]=c,e[t++]=d,this.hasWebMercatorT&&(e[t++]=s);return this.hasVertexNormals&&(e[t++]=wn.octPackFloat(r)),this.hasGeodeticSurfaceNormals&&(e[t++]=a.x,e[t++]=a.y,e[t++]=a.z),t};var Oit=new h,cbe=new h;yc.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,Oit),c=n.geodeticSurfaceNormal(a,cbe),d=s*r+this._offsetGeodeticSurfaceNormal;t[d]=c.x,t[d+1]=c.y,t[d+2]=c.z}};yc.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]}};yc.prototype.decodePosition=function(e,t,n){if(l(n)||(n=new h),t*=this.stride,this.quantization===Ys.BITS12){let i=wn.decompressTextureCoordinates(e[t],Qu);n.x=i.x,n.y=i.y;let o=wn.decompressTextureCoordinates(e[t+1],Qu);return n.z=o.x,F.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)};yc.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,cbe),a=this.decodeHeight(e,t),c=br.getHeight(a,i,o)-a;n.x+=s.x*c,n.y+=s.y*c,n.z+=s.z*c}return n};yc.prototype.decodeTextureCoordinates=function(e,t,n){return l(n)||(n=new D),t*=this.stride,this.quantization===Ys.BITS12?wn.decompressTextureCoordinates(e[t+2],n):D.fromElements(e[t+4],e[t+5],n)};yc.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===Ys.BITS12?wn.decompressTextureCoordinates(e[t+1],Qu).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};yc.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===Ys.BITS12?wn.decompressTextureCoordinates(e[t+3],Qu).x:e[t+6]};yc.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 D.fromElements(o,r,n)};yc.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};yc.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 eD={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},tD={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};yc.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(eD.position3DAndHeight,4);let a=2;a+=this.hasWebMercatorT?1:0,a+=this.hasVertexNormals?1:0,s(eD.textureCoordAndEncodedNormals,a),this.hasGeodeticSurfaceNormals&&s(eD.geodeticSurfaceNormal,3)}else{let a=this.hasWebMercatorT||this.hasVertexNormals,c=this.hasWebMercatorT&&this.hasVertexNormals;s(tD.compressed0,a?4:3),c&&s(tD.compressed1,1),this.hasGeodeticSurfaceNormals&&s(tD.geodeticSurfaceNormal,3)}return r};yc.prototype.getAttributeLocations=function(){return this.quantization===Ys.NONE?eD:tD};yc.clone=function(e,t){if(l(e))return l(t)||(t=new yc),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=h.clone(e.center),t.toScaledENU=F.clone(e.toScaledENU),t.fromScaledENU=F.clone(e.fromScaledENU),t.matrix=F.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 xc=yc;var wf={};wf.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var b4=new h,Hit=new F,zit=new h,Kit=new h;wf.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,g=y(e.isGeographic,!0),f=y(e.ellipsoid,ne.default),x=1/f.maximumRadius,_=ae.clone(e.nativeRectangle),C=ae.clone(e.rectangle),V,L,Z,E;l(C)?(V=C.west,L=C.south,Z=C.east,E=C.north):g?(V=a(_.west),L=a(_.south),Z=a(_.east),E=a(_.north)):(V=_.west*x,L=s-2*o(r(-_.south*x)),Z=_.east*x,E=s-2*o(r(-_.north*x)));let X=e.relativeToCenter,v=l(X);X=v?X:h.ZERO;let P=y(e.includeWebMercatorT,!1),A=y(e.exaggeration,1),M=y(e.exaggerationRelativeHeight,0),R=A!==1,G=y(e.structure,wf.DEFAULT_STRUCTURE),I=y(G.heightScale,wf.DEFAULT_STRUCTURE.heightScale),w=y(G.heightOffset,wf.DEFAULT_STRUCTURE.heightOffset),N=y(G.elementsPerHeight,wf.DEFAULT_STRUCTURE.elementsPerHeight),B=y(G.stride,wf.DEFAULT_STRUCTURE.stride),U=y(G.elementMultiplier,wf.DEFAULT_STRUCTURE.elementMultiplier),O=y(G.isBigEndian,wf.DEFAULT_STRUCTURE.isBigEndian),k=ae.computeWidth(_),J=ae.computeHeight(_),H=k/(d-1),te=J/(u-1);g||(k*=x,J*=x);let z=f.radiiSquared,j=z.x,ee=z.y,fe=z.z,_e=65536,le=-65536,ge=wt.eastNorthUpToFixedFrame(X,f),Se=F.inverseTransformation(ge,Hit),Ie,Le;P&&(Ie=Ri.geodeticLatitudeToMercatorAngle(L),Le=1/(Ri.geodeticLatitudeToMercatorAngle(E)-Ie));let ke=zit;ke.x=Number.POSITIVE_INFINITY,ke.y=Number.POSITIVE_INFINITY,ke.z=Number.POSITIVE_INFINITY;let Be=Kit;Be.x=Number.NEGATIVE_INFINITY,Be.y=Number.NEGATIVE_INFINITY,Be.z=Number.NEGATIVE_INFINITY;let st=Number.POSITIVE_INFINITY,vt=d*u,Ct=m>0?d*2+u*2:0,Xe=vt+Ct,je=new Array(Xe),$e=new Array(Xe),He=new Array(Xe),Ut=P?new Array(Xe):[],Ce=R?new Array(Xe):[],Ve=0,ct=u,Ni=0,mt=d;p&&(--Ve,++ct,--Ni,++mt);let _o=1e-5;for(let qe=Ve;qe<ct;++qe){let pt=qe;pt<0&&(pt=0),pt>=u&&(pt=u-1);let Zt=_.north-te*pt;g?Zt=a(Zt):Zt=s-2*o(r(-Zt*x));let yn=(Zt-L)/(E-L);yn=W.clamp(yn,0,1);let po=qe===Ve,ir=qe===ct-1;m>0&&(po?Zt+=_o*J:ir&&(Zt-=_o*J));let Da=t(Zt),Ba=n(Zt),ns=fe*Ba,Qn;P&&(Qn=(Ri.geodeticLatitudeToMercatorAngle(Zt)-Ie)*Le);for(let ms=Ni;ms<mt;++ms){let Cr=ms;Cr<0&&(Cr=0),Cr>=d&&(Cr=d-1);let dl=pt*(d*B)+Cr*B,To;if(N===1)To=c[dl];else{To=0;let So;if(O)for(So=0;So<N;++So)To=To*U+c[dl+So];else for(So=N-1;So>=0;--So)To=To*U+c[dl+So]}To=To*I+w,le=Math.max(le,To),_e=Math.min(_e,To);let Ur=_.west+H*Cr;g?Ur=a(Ur):Ur=Ur*x;let tp=(Ur-V)/(Z-V);tp=W.clamp(tp,0,1);let ul=pt*d+Cr;if(m>0){let So=ms===Ni,nu=ms===mt-1,yS=po||ir||So||nu;if((po||ir)&&(So||nu))continue;yS&&(To-=m,So?(ul=vt+(u-pt-1),Ur-=_o*k):ir?ul=vt+u+(d-Cr-1):nu?(ul=vt+u+d+pt,Ur+=_o*k):po&&(ul=vt+u+d+u+Cr))}let np=Da*t(Ur),Ya=Da*n(Ur),Vr=j*np,ya=ee*Ya,gb=1/i(Vr*np+ya*Ya+ns*Ba),ci=Vr*gb,Gc=ya*gb,$l=ns*gb,tu=new h;tu.x=ci+np*To,tu.y=Gc+Ya*To,tu.z=$l+Ba*To,F.multiplyByPoint(Se,tu,b4),h.minimumByComponent(b4,ke,ke),h.maximumByComponent(b4,Be,Be),st=Math.min(st,To),je[ul]=tu,He[ul]=new D(tp,yn),$e[ul]=To,P&&(Ut[ul]=Qn),R&&(Ce[ul]=f.geodeticSurfaceNormal(tu))}}let ur=ce.fromPoints(je),Zc;l(C)&&(Zc=Gn.fromRectangle(C,_e,le,f));let Sr;v&&(Sr=new V0(f).computeHorizonCullingPointPossiblyUnderEllipsoid(X,je,_e));let ts=new Pb(ke,Be,X),Ne=new xc(X,ts,st,le,ge,!1,P,R,A,M),ut=new Float32Array(Xe*Ne.stride),Je=0;for(let qe=0;qe<Xe;++qe)Je=Ne.encode(ut,Je,je[qe],He[qe],$e[qe],void 0,Ut[qe],Ce[qe]);return{vertices:ut,maximumHeight:le,minimumHeight:_e,encoding:Ne,boundingSphere3D:ur,orientedBoundingBox:Zc,occludeePointInScaledSpace:Sr}};var SV=wf;var ogi=T(S(),1);function dy(){pe.throwInstantiationError()}Object.defineProperties(dy.prototype,{credits:{get:pe.throwInstantiationError},waterMask:{get:pe.throwInstantiationError}});dy.prototype.interpolateHeight=pe.throwInstantiationError;dy.prototype.isChildAvailable=pe.throwInstantiationError;dy.prototype.createMesh=pe.throwInstantiationError;dy.prototype.upsample=pe.throwInstantiationError;dy.prototype.wasCreatedByUpsampling=pe.throwInstantiationError;dy.maximumAsynchronousTasks=5;var gh=dy;var agi=T(S(),1);function Jit(e,t,n,i,o,r,s,a,c,d,u,m,p,g,f,x){this.center=e,this.vertices=t,this.stride=y(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=g,this.eastIndicesNorthToSouth=f,this.northIndicesWestToEast=x}var ju=Jit;var hgi=T(S(),1);function tl(){pe.throwInstantiationError()}Object.defineProperties(tl.prototype,{errorEvent:{get:pe.throwInstantiationError},credit:{get:pe.throwInstantiationError},tilingScheme:{get:pe.throwInstantiationError},hasWaterMask:{get:pe.throwInstantiationError},hasVertexNormals:{get:pe.throwInstantiationError},availability:{get:pe.throwInstantiationError}});var lbe=[];tl.getRegularGridIndices=function(e,t){let n=lbe[e];l(n)||(lbe[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),hbe(e,t,i,0)),i};var dbe=[];tl.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=dbe[e];l(n)||(dbe[e]=n=[]);let i=n[t];if(!l(i)){let o=tl.getRegularGridIndices(e,t),r=mbe(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 ube=[];tl.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=ube[e];l(n)||(ube[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=mbe(e,t),m=u.westIndicesSouthToNorth,p=u.southIndicesEastToWest,g=u.eastIndicesNorthToSouth,f=u.northIndicesWestToEast,x=Ae.createTypedArray(c,d);hbe(e,t,x,0),tl.addSkirtIndices(m,p,g,f,o,x,r),i=n[t]={indices:x,westIndicesSouthToNorth:m,southIndicesEastToWest:p,eastIndicesNorthToSouth:g,northIndicesWestToEast:f,indexCountWithoutSkirts:r}}return i};tl.addSkirtIndices=function(e,t,n,i,o,r,s){let a=o;s=nD(e,a,r,s),a+=e.length,s=nD(t,a,r,s),a+=t.length,s=nD(n,a,r,s),a+=n.length,nD(i,a,r,s)};function mbe(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 hbe(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 nD(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}tl.heightmapTerrainQuality=.25;tl.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*tl.heightmapTerrainQuality/(t*n)};tl.prototype.requestTileGeometry=pe.throwInstantiationError;tl.prototype.getLevelMaximumGeometricError=pe.throwInstantiationError;tl.prototype.getTileDataAvailable=pe.throwInstantiationError;tl.prototype.loadTileDataAvailability=pe.throwInstantiationError;var Qr=tl;function Y0(e){this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=y(e.childTileMask,15),this._encoding=y(e.encoding,Ju.NONE);let t=SV.DEFAULT_STRUCTURE,n=e.structure;l(n)?n!==t&&(n.heightScale=y(n.heightScale,t.heightScale),n.heightOffset=y(n.heightOffset,t.heightOffset),n.elementsPerHeight=y(n.elementsPerHeight,t.elementsPerHeight),n.stride=y(n.stride,t.stride),n.elementMultiplier=y(n.elementMultiplier,t.elementMultiplier),n.isBigEndian=y(n.isBigEndian,t.isBigEndian)):n=t,this._structure=n,this._createdByUpsampling=y(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._encoding===Ju.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(Y0.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var fbe="createVerticesFromHeightmap",Qit=new bi(fbe),jit=new bi(fbe,gh.maximumAsynchronousTasks);Y0.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid,d=t.tileXYToNativeRectangle(n,i,o),u=t.tileXYToRectangle(n,i,o),m=c.cartographicToCartesian(ae.center(u)),p=this._structure,f=Qr.getEstimatedLevelZeroGeometricErrorForAHeightmap(c,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(f*4,1e3);let _=(a?jit:Qit).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 Li,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=Qr.getRegularGridAndSkirtIndicesAndEdgeIndices(V.gridWidth,V.gridHeight):L=Qr.getRegularGridIndicesAndEdgeIndices(V.gridWidth,V.gridHeight);let Z=V.gridWidth*V.gridHeight;return C._mesh=new ju(m,new Float32Array(V.vertices),L.indices,L.indexCountWithoutSkirts,Z,V.minimumHeight,V.maximumHeight,ce.clone(V.boundingSphere3D),h.clone(V.occludeePointInScaledSpace),V.numberOfAttributes,Gn.clone(V.orientedBoundingBox),xc.clone(V.encoding),L.westIndicesSouthToNorth,L.southIndicesEastToWest,L.eastIndicesNorthToSouth,L.northIndicesWestToEast),C._buffer=void 0,C._mesh})};Y0.prototype._createMeshSync=function(e){let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=t.ellipsoid,c=t.tileXYToNativeRectangle(n,i,o),d=t.tileXYToRectangle(n,i,o),u=a.cartographicToCartesian(ae.center(d)),m=this._structure,g=Qr.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(g*4,1e3);let f=SV.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 Li,exaggeration:r,exaggerationRelativeHeight:s});this._buffer=void 0;let x;this._skirtHeight>0?x=Qr.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):x=Qr.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let _=f.gridWidth*f.gridHeight;return this._mesh=new ju(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};Y0.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),g=this._encoding===Ju.LERC;if(!p&&g)return;let x;if(p){let _=this._mesh.vertices,C=this._mesh.encoding;x=pbe(_,C,u,m,e,i,o,t,n)}else x=qit(this._buffer,a,c,s,d,e,i,o,t,n),x=x*m+u;return x};Y0.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),g=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,E=u.isBigEndian,X=Math.pow(Z,L-1);for(let v=0;v<d;++v){let P=W.lerp(_.north,_.south,v/(d-1));for(let A=0;A<c;++A){let M=W.lerp(_.west,_.east,A/(c-1)),b=pbe(g,f,C,V,x,c,d,M,P);b=b<u.lowestEncodedHeight?u.lowestEncodedHeight:b,b=b>u.highestEncodedHeight?u.highestEncodedHeight:b,$it(p,L,Z,X,m,E,v*c+A,b)}}return Promise.resolve(new Y0({buffer:p,width:c,height:d,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};Y0.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};Y0.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function qit(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,g=p+1;g>=s&&(g=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=iD(e,t,n,i,o,f*s+p),L=iD(e,t,n,i,o,f*s+g),Z=iD(e,t,n,i,o,x*s+p),E=iD(e,t,n,i,o,x*s+g);return bbe(_,C,V,L,Z,E)}function pbe(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 g=u|0,f=g+1;f>=s&&(f=s-1,g=s-2);let x=d-m,_=u-g;g=s-1-g,f=s-1-f;let C=(t.decodeHeight(e,g*r+m)-n)/i,V=(t.decodeHeight(e,g*r+p)-n)/i,L=(t.decodeHeight(e,f*r+m)-n)/i,Z=(t.decodeHeight(e,f*r+p)-n)/i;return bbe(x,_,C,V,L,Z)}function bbe(e,t,n,i,o,r){return t<e?n+e*(i-n)+t*(r-i):n+e*(r-o)+t*(o-n)}function iD(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 $it(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 Fa=Y0;var Fgi=T(S(),1);function LV(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var pT=new ae;function eot(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}LV.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 g=t;g<=i;++g)eot(e,g,p,s)||s.push(new CV(r,void 0,0,g,p));r.tileXYToRectangle(t,n,e,pT);let a=pT.west,c=pT.north;r.tileXYToRectangle(i,o,e,pT);let d=pT.east,u=pT.south,m=new rot(e,a,u,d,c);for(let p=0;p<s.length;++p){let g=s[p];g4(g.extent,m)&&sot(this._maximumLevel,g,m)}};LV.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(VV(i.extent,e)){t=i;break}}return l(t)?zv(void 0,t,e):-1};var tot=[],not=[],iot=new ae,oot=new ae;LV.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=tot;t.length=0,e.east<e.west?(t.push(ae.fromRadians(-Math.PI,e.south,e.east,e.north,iot)),t.push(ae.fromRadians(e.west,e.south,Math.PI,e.north,oot))):t.push(e);let n=not;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)Kv(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 gbe=new he;LV.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,pT);return ae.center(i,gbe),this.computeMaximumLevelAtPosition(gbe)>=e};LV.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 CV(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(CV.prototype,{nw:{get:function(){return this._nw||(this._nw=new CV(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new CV(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new CV(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new CV(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function rot(e,t,n,i,o){this.level=e,this.west=t,this.south=n,this.east=i,this.north=o}function g4(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 sot(e,t,n){for(;t.level<e;)if(oD(t.nw.extent,n))t=t.nw;else if(oD(t.ne.extent,n))t=t.ne;else if(oD(t.sw.extent,n))t=t.sw;else if(oD(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=Go(t.rectangles,n.level,aot);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function aot(e,t){return e.level-t}function oD(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function VV(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function zv(e,t,n){let i=0,o=!1;for(;!o;){let r=t._nw&&VV(t._nw.extent,n),s=t._ne&&VV(t._ne.extent,n),a=t._sw&&VV(t._sw.extent,n),c=t._se&&VV(t._se.extent,n);if(r+s+a+c>1){r&&(i=Math.max(i,zv(t,t._nw,n))),s&&(i=Math.max(i,zv(t,t._ne,n))),a&&(i=Math.max(i,zv(t,t._sw,n))),c&&(i=Math.max(i,zv(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];VV(a,n)&&(i=a.level)}t=t.parent}return i}function Kv(e,t,n){if(!t)return;let i,o=!1;for(i=0;i<n.length;++i)o=o||g4(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]=cot(e[s.level],s)}Kv(e,t._nw,n),Kv(e,t._ne,n),Kv(e,t._sw,n),Kv(e,t._se,n)}function cot(e,t){let n=[];for(let i=0;i<e.length;++i){let o=e[i];g4(o,t)?(o.west<t.west&&n.push(new ae(o.west,o.south,t.west,o.north)),o.east>t.east&&n.push(new ae(t.east,o.south,o.east,o.north)),o.south<t.south&&n.push(new ae(Math.max(t.west,o.west),o.south,Math.min(t.east,o.east),t.south)),o.north>t.north&&n.push(new ae(Math.max(t.west,o.west),t.north,Math.min(t.east,o.east),o.north))):n.push(o)}return n}var yh=LV;var Ygi=T(S(),1);var Ngi=T(S(),1);function lot(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 Ff=lot;function rD(e,t,n,i,o,r,s){this.provider=e,this.message=t,this.x=n,this.y=i,this.level=o,this.timesRetried=y(r,0),this.retry=!1,this.error=s}rD.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 rD(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}": ${Ff(i)}`),c};rD.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var Zo=rD;var qgi=T(S(),1);function uy(e){if(e=y(e,y.EMPTY_OBJECT),this._ellipsoid=y(e.ellipsoid,ne.default),this._numberOfLevelZeroTilesX=y(e.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=y(e.numberOfLevelZeroTilesY,1),this._projection=new Ri(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 D(-i,-i),this._rectangleNortheastInMeters=new D(i,i)}let t=this._projection.unproject(this._rectangleSouthwestInMeters),n=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new ae(t.longitude,t.latitude,n.longitude,n.latitude)}Object.defineProperties(uy.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});uy.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};uy.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};uy.prototype.rectangleToNativeRectangle=function(e,t){let n=this._projection,i=n.project(ae.southwest(e)),o=n.project(ae.northeast(e));return l(t)?(t.west=i.x,t.south=i.y,t.east=o.x,t.north=o.y,t):new ae(i.x,i.y,o.x,o.y)};uy.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 ae(a,m,c,u)};uy.prototype.tileXYToRectangle=function(e,t,n,i){let o=this.tileXYToNativeRectangle(e,t,n,i),r=this._projection,s=r.unproject(new D(o.west,o.south)),a=r.unproject(new D(o.east,o.north));return o.west=s.longitude,o.south=s.latitude,o.east=a.longitude,o.north=a.latitude,o};uy.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!ae.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,g=this._rectangleNortheastInMeters.y-m.y,f=p/a|0;f>=o&&(f=o-1);let x=g/d|0;return x>=r&&(x=r-1),l(n)?(n.x=f,n.y=x,n):new D(f,x)};var jr=uy;var dot=15;function ybe(e){this.ellipsoid=y(e.ellipsoid,ne.default),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}ybe.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 uot(e,t){let n=t.copyrightText;l(n)&&(e.credit=new Rt(n));let i=t.spatialReference,o=y(i.latestWkid,i.wkid),r=t.extent,s={ellipsoid:e.ellipsoid};if(o===4326)s.rectangle=ae.fromDegrees(r.xmin,r.ymin,r.xmax,r.ymax),e.tilingScheme=new Di(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 D(r.xmin,r.ymin),s.rectangleNortheastInMeters=new D(r.xmax,r.ymax),e.tilingScheme=new jr(s)}else throw new ue("Invalid spatial reference");let a=t.tileInfo;if(!l(a))throw new ue("tileInfo is required");e.width=a.rows+1,e.height=a.cols+1,e.encoding=a.format==="LERC"?Ju.LERC:Ju.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new yh(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new yh(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=Qr.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 mot(e,t,n){try{let i=await t.fetchJson();uot(e,i)}catch(i){let o=`An error occurred while accessing ${t}.`;throw Zo.reportError(void 0,n,l(n)?n._errorEvent:void 0,o),i}}function my(e){e=y(e,y.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 be}Object.defineProperties(my.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}}});my.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT),e=await Promise.resolve(e);let n=Ee.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),o=new ybe(t);await mot(o,i);let r=new my(t);return o.build(r),r._resource=n,r};my.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(y4(this,n+1,e*2,t*2))){let m=xbe(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 Fa({buffer:m[0],width:d._width,height:d._height,childTileMask:r?u.computeChildMaskForTile(n,e,t):dot,structure:d._terrainDataStructure,encoding:d._encoding})}).catch(async function(m){if(l(a)&&a.state===jn.CANCELLED){i.cancel();try{await i.deferred?.promise}catch{}return i.state=jn.CANCELLED,Promise.reject(m)}return Promise.reject(m)})};function y4(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}my.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};my.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=y4(this,n,e,t);if(l(i))return i;xbe(this,n,e,t)};my.prototype.loadTileDataAvailability=function(e,t,n){};function hot(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 D(e.x+1,e.y+1),u=!1,m=!1;for(;!(u&&m);){let p=d.x,g=m?d.y+1:d.y;if(!u){for(let f=e.y;f<g;++f)if(i[f*t+d.x]!==s){u=!0;break}u?(a.push(new D(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 D(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 fot(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 D(0,0)];for(;a.length>0;){let c=a.pop(),d=hot(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 xbe(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 Oo({throttle:!1,throttleByServer:!0,type:is.TERRAIN}),m=e._resource.getDerivedResource({url:a,request:d}).fetchJson();return l(m)?(m=m.then(function(p){let g=fot(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<g.length;++x){let _=g[x];f.addAvailableTileRange(t,_.startX,_.startY,_.endX,_.endY)}return y4(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 x4=my;var Ryi=T(S(),1);var _be="https://dev.virtualearth.net/REST/v1/Locations";function _4(e){e=y(e,y.EMPTY_OBJECT);let t=e.key;this._key=t;let n={key:t};l(e.culture)&&(n.culture=e.culture),this._resource=new Ee({url:_be,queryParameters:n}),this._credit=new Rt('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(_4.prototype,{url:{get:function(){return _be}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});_4.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:ae.fromDegrees(a,s,d,c)}})})};var T4=_4;var Eyi=T(S(),1);function S4(){}Object.defineProperties(S4.prototype,{credit:{get:function(){}}});S4.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 C4=S4;var Myi=T(S(),1);var pot=new se,Tbe=new h,RV=new h;function bot(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=pot;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,Tbe),h.multiplyByScalar(m,.5,m),p=F.multiplyByVector(mg.hermiteCoefficientMatrix,a,a)):r===t.length-2?(c=t[r],d=t[r+1],m=e.lastTangent,u=h.subtract(d,t[r-1],Tbe),h.multiplyByScalar(u,.5,u),p=F.multiplyByVector(mg.hermiteCoefficientMatrix,a,a)):(c=t[r-1],d=t[r],u=t[r+1],m=t[r+2],p=F.multiplyByVector(hy.catmullRomCoefficientMatrix,a,a)),o=h.multiplyByScalar(c,p.x,o),h.multiplyByScalar(d,p.y,RV),h.add(o,RV,o),h.multiplyByScalar(u,p.z,RV),h.add(o,RV,o),h.multiplyByScalar(m,p.w,RV),h.add(o,RV,o)}}var got=new h,yot=new h;function hy(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times,i=e.firstTangent,o=e.lastTangent;if(t.length>2&&(l(i)||(i=got,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=yot,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=bot(this),this._lastTimeIndex=0}Object.defineProperties(hy.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}}});hy.catmullRomCoefficientMatrix=new F(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);hy.prototype.findTimeInterval=to.prototype.findTimeInterval;hy.prototype.wrapTime=to.prototype.wrapTime;hy.prototype.clampTime=to.prototype.clampTime;hy.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var V4=hy;var Exi=T(S(),1);var oxi=T(S(),1);var Byi=T(S(),1);var sD={};sD.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,g,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),g=(e-i)/(n-i),r.push(2),r.push(0),g!==1&&(r.push(-1),r.push(1),r.push(0),r.push(g)),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?(g=(e-i)/(n-i),f=(e-o)/(n-o),r.push(0),r.push(-1),r.push(1),r.push(0),r.push(g),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};sD.computeBarycentricCoordinates=function(e,t,n,i,o,r,s,a,c){let d=n-s,u=s-o,m=r-a,p=i-a,g=1/(m*d+u*p),f=t-a,x=e-s,_=(m*x+u*f)*g,C=(-p*x+d*f)*g,V=1-_-C;return l(c)?(c.x=_,c.y=C,c.z=V,c):new h(_,C,V)};sD.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,g=u/m;if(p>=0&&p<=1&&g>=0&&g<=1)return l(c)||(c=new D),c.x=e+p*(n-e),c.y=t+p*(i-t),c};var O0=sD;function fy(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=cD(e.westIndices,o,t),this._southIndices=cD(e.southIndices,r,t),this._eastIndices=cD(e.eastIndices,o,t),this._northIndices=cD(e.northIndices,r,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=y(e.childTileMask,15),this._createdByUpsampling=y(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._mesh=void 0}Object.defineProperties(fy.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 aD=[];function cD(e,t,n){aD.length=e.length;let i=!1;for(let o=0,r=e.length;o<r;++o)aD[o]=e[o],i=i||o>0&&t(e[o-1],e[o])>0;return i?(aD.sort(t),Ae.createTypedArray(n,aD)):e}var Sbe="createVerticesFromQuantizedTerrainMesh",xot=new bi(Sbe),_ot=new bi(Sbe,gh.maximumAsynchronousTasks);fy.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid,d=t.tileXYToRectangle(n,i,o),m=(a?_ot:xot).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(g){let f=p._quantizedVertices.length/3,x=f+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,_=Ae.createTypedArray(x,g.indices),C=new Float32Array(g.vertices),V=g.center,L=g.minimumHeight,Z=g.maximumHeight,E=p._boundingSphere,X=p._orientedBoundingBox,v=y(h.clone(g.occludeePointInScaledSpace),p._horizonOcclusionPoint),P=g.vertexStride,A=xc.clone(g.encoding);return p._mesh=new ju(V,C,_,g.indexCountWithoutSkirts,f,L,Z,E,v,P,X,A,g.westIndicesSouthToNorth,g.southIndicesEastToWest,g.eastIndicesNorthToSouth,g.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 Tot=new bi("upsampleQuantizedTerrainMesh",gh.maximumAsynchronousTasks);fy.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=Tot.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 g=Math.min(this._westSkirtHeight,this._eastSkirtHeight);g=Math.min(g,this._southSkirtHeight),g=Math.min(g,this._northSkirtHeight);let f=c?g*.5:this._westSkirtHeight,x=d?g*.5:this._southSkirtHeight,_=c?this._eastSkirtHeight:g*.5,C=d?this._northSkirtHeight:g*.5,V=this._credits;return Promise.resolve(p).then(function(L){let Z=new Uint16Array(L.vertices),E=Ae.createTypedArray(Z.length/3,L.indices),X;return l(L.encodedNormals)&&(X=new Uint8Array(L.encodedNormals)),new fy({quantizedVertices:Z,indices:E,encodedNormals:X,minimumHeight:L.minimumHeight,maximumHeight:L.maximumHeight,boundingSphere:ce.clone(L.boundingSphere),orientedBoundingBox:Gn.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 L4=32767,Cbe=new h;fy.prototype.interpolateHeight=function(e,t,n){let i=W.clamp((t-e.west)/e.width,0,1);i*=L4;let o=W.clamp((n-e.south)/e.height,0,1);return o*=L4,l(this._mesh)?Lot(this,i,o):Rot(this,i,o)};function Vbe(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 Sot=new D,Cot=new D,Vot=new D;function Lot(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,Sot),g=r.decodeTextureCoordinates(o,u,Cot),f=r.decodeTextureCoordinates(o,m,Vot);if(Vbe(t,n,p.x,p.y,g.x,g.y,f.x,f.y)){let x=O0.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,f.x,f.y,Cbe);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 Rot(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],g=i[u],f=i[m],x=o[d],_=o[u],C=o[m];if(Vbe(t,n,p,x,g,_,f,C)){let V=O0.computeBarycentricCoordinates(t,n,p,x,g,_,f,C,Cbe);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/L4)}}}}fy.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};fy.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var bT=fy;function Zot(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 Rbe(e){this.requestVertexNormals=y(e.requestVertexNormals,!1),this.requestWaterMask=y(e.requestWaterMask,!1),this.requestMetadata=y(e.requestMetadata,!0),this.ellipsoid=y(e.ellipsoid,ne.default),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=[]}Rbe.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 Zbe(e,t,n){if(!t.format){let x="The tile format is not specified in the layer.json file.";throw e.previousError=Zo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new ue(x)}if(!t.tiles||t.tiles.length===0){let x="The layer.json file does not specify any tile URL templates.";throw e.previousError=Zo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new ue(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=Zo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new ue(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 Di({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=Zo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new ue(x)}if(e.levelZeroMaximumGeometricError=Qr.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=Zo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new ue(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,g;if(l(p)&&!l(m)){g=new yh(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,E=C-L.startY-1;e.overallAvailability[x].push([L.startX,Z,L.endX,E]),g.addAvailableTileRange(x,L.startX,Z,L.endX,E)}}}else l(m)&&(u=new yh(e.tilingScheme,d),g=new yh(e.tilingScheme,d),e.overallAvailability[0]=[[0,0,1,0]],g.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 Zot({resource:e.lastResource,version:t.version,isHeightmap:a,tileUrlTemplates:c,availability:g,hasVertexNormals:i,hasWaterMask:o,hasMetadata:r,availabilityLevels:m,availabilityTilesLoaded:u,littleEndianExtensionSize:s}));let f=t.parentUrl;return l(f)?l(g)?(e.lastResource=e.lastResource.getDerivedResource({url:f}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await G4(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function Got(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(l(t)&&(i+=`
${t.message}`),e.previousError=Zo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,i),e.previousError.retry)return G4(e,n);throw new ue(i)}async function Eot(e,t,n){await Zbe(e,t,n);let i=e.overallAvailability.length;if(i>0){let o=e.availability=new yh(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 Rt(e.attribution);e.tileCredits.push(o)}return!0}async function G4(e,t){try{let n=await e.layerJsonResource.fetchJson();return Eot(e,n,t)}catch(n){return l(n)&&n.statusCode===404?(await Zbe(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):Got(e,n,t)}}function xh(e){e=y(e,y.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=y(e.requestVertexNormals,!1),this._requestWaterMask=y(e.requestWaterMask,!1),this._requestMetadata=y(e.requestMetadata,!0),this._errorEvent=new be;let t=e.credit;typeof t=="string"&&(t=new Rt(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 R4={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function Lbe(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 Xot(e,t,n,i,o){let r=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new Fa({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 Iot(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,g=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 E=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 X=new h(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0));a+=u;let v=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let P=new Uint16Array(t,a,v*3);a+=v*g,v>64*1024&&(x=Uint32Array.BYTES_PER_ELEMENT,_=x*f);let A=P.subarray(0,v),M=P.subarray(v,2*v),b=P.subarray(v*2,3*v);wn.zigZagDeltaDecode(A,M,b),a%x!==0&&(a+=x-a%x);let R=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let G=Ae.createTypedArrayFromArrayBuffer(v,t,a,R*f);a+=R*_;let I=0,w=G.length;for(let le=0;le<w;++le){let ge=G[le];G[le]=I-ge,ge===0&&++I}let N=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let B=Ae.createTypedArrayFromArrayBuffer(v,t,a,N);a+=N*x;let U=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let O=Ae.createTypedArrayFromArrayBuffer(v,t,a,U);a+=U*x;let k=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let J=Ae.createTypedArrayFromArrayBuffer(v,t,a,k);a+=k*x;let H=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let te=Ae.createTypedArrayFromArrayBuffer(v,t,a,H);a+=H*x;let z,j;for(;a<C.byteLength;){let le=C.getUint8(a,!0);a+=Uint8Array.BYTES_PER_ELEMENT;let ge=C.getUint32(a,s);if(a+=Uint32Array.BYTES_PER_ELEMENT,le===R4.OCT_VERTEX_NORMALS&&e._requestVertexNormals)z=new Uint8Array(t,a,v*2);else if(le===R4.WATER_MASK&&e._requestWaterMask)j=new Uint8Array(t,a,ge);else if(le===R4.METADATA&&e._requestMetadata){let Se=C.getUint32(a,!0);if(Se>0){let Le=Io(new Uint8Array(t),a+Uint32Array.BYTES_PER_ELEMENT,Se).available;if(l(Le))for(let ke=0;ke<Le.length;++ke){let Be=n+ke+1,st=Le[ke],vt=e._tilingScheme.getNumberOfYTilesAtLevel(Be);for(let Ct=0;Ct<st.length;++Ct){let Xe=st[Ct],je=vt-Xe.endY-1,$e=vt-Xe.startY-1;e.availability.addAvailableTileRange(Be,Xe.startX,je,Xe.endX,$e),r.availability.addAvailableTileRange(Be,Xe.startX,je,Xe.endX,$e)}}}r.availabilityTilesLoaded.addAvailableTileRange(n,i,o,i,o)}a+=ge}let ee=e.getLevelMaximumGeometricError(n)*5,fe=e._tilingScheme.tileXYToRectangle(i,o,n),_e=Gn.fromRectangle(fe,L,Z,e._tilingScheme.ellipsoid);return new bT({center:V,minimumHeight:L,maximumHeight:Z,boundingSphere:E,orientedBoundingBox:_e,horizonOcclusionPoint:X,quantizedVertices:P,encodedNormals:z,indices:G,westIndices:B,southIndices:O,eastIndices:J,northIndices:te,westSkirtHeight:ee,southSkirtHeight:ee,eastSkirtHeight:ee,northSkirtHeight:ee,childTileMask:e.availability.computeChildMaskForTile(n,i,o),waterMask:j,credits:e._tileCredits})}xh.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=E4(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)})):Gbe(this,e,t,n,r,i)};function Gbe(e,t,n,i,o,r){if(!l(o))return Promise.reject(new ue("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=Lbe(void 0)):d=Lbe(c);let g=p.getDerivedResource({url:m,templateValues:{version:o.version,z:i,x:t,y:a},queryParameters:u,headers:d,request:r}).fetchArrayBuffer();if(l(g))return g.then(function(f){return l(f)?l(e._heightmapStructure)?Xot(e,f,i,t,n):Iot(e,f,i,t,n,o):Promise.reject(new ue("Mesh buffer doesn't exist."))})}Object.defineProperties(xh.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}}});xh.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};xh.fromIonAssetId=async function(e,t){let n=await md.fromAssetId(e);return xh.fromUrl(n,t)};xh.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT),e=await Promise.resolve(e);let n=Ee.createIfNeeded(e);n.appendForwardSlash();let i=new Rbe(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await G4(i);let o=new xh(t);return i.build(o),o};xh.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(E4(this,e,t,n,i[r],r===0).result)return;return!1};xh.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=E4(this,e,t,n,i[r],r===0);if(l(s.promise))return s.promise}};function Z4(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 E4(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=Z4(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 Oo({throttle:!1,throttleByServer:!0,type:is.TERRAIN});m=Gbe(e,u.x,u.y,u.level,o,p),l(m)&&(o.availabilityPromiseCache[s]=m,m.then(a))}return{result:!0,promise:m}}u=Z4(o,u.x,u.y,u.level)}return{result:!1}}xh._getAvailabilityTile=Z4;var gT=xh;var Axi=T(S(),1);function H0(e){e=y(e,y.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 jc(n),this._workerName="createCircleGeometry"}H0.packedLength=jc.packedLength;H0.pack=function(e,t,n){return jc.pack(e._ellipseGeometry,t,n)};var Ebe=new jc({center:new h,semiMajorAxis:1,semiMinorAxis:1}),Aa={center:new h,radius:void 0,ellipsoid:ne.clone(ne.default),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new Pe,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};H0.unpack=function(e,t,n){let i=jc.unpack(e,t,Ebe);return Aa.center=h.clone(i._center,Aa.center),Aa.ellipsoid=ne.clone(i._ellipsoid,Aa.ellipsoid),Aa.ellipsoid=ne.clone(i._ellipsoid,Ebe._ellipsoid),Aa.height=i._height,Aa.extrudedHeight=i._extrudedHeight,Aa.granularity=i._granularity,Aa.vertexFormat=Pe.clone(i._vertexFormat,Aa.vertexFormat),Aa.stRotation=i._stRotation,Aa.shadowVolume=i._shadowVolume,l(n)?(Aa.semiMajorAxis=i._semiMajorAxis,Aa.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new jc(Aa),n):(Aa.radius=i._semiMajorAxis,new H0(Aa))};H0.createGeometry=function(e){return jc.createGeometry(e._ellipseGeometry)};H0.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,o=e._ellipseGeometry._ellipsoid,r=t(i,o),s=n(i,o);return new H0({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(H0.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var X4=H0;var Yxi=T(S(),1);function ZV(e){e=y(e,y.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 Ed(n),this._workerName="createCircleOutlineGeometry"}ZV.packedLength=Ed.packedLength;ZV.pack=function(e,t,n){return Ed.pack(e._ellipseGeometry,t,n)};var Wot=new Ed({center:new h,semiMajorAxis:1,semiMinorAxis:1}),kd={center:new h,radius:void 0,ellipsoid:ne.clone(ne.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};ZV.unpack=function(e,t,n){let i=Ed.unpack(e,t,Wot);return kd.center=h.clone(i._center,kd.center),kd.ellipsoid=ne.clone(i._ellipsoid,kd.ellipsoid),kd.height=i._height,kd.extrudedHeight=i._extrudedHeight,kd.granularity=i._granularity,kd.numberOfVerticalLines=i._numberOfVerticalLines,l(n)?(kd.semiMajorAxis=i._semiMajorAxis,kd.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new Ed(kd),n):(kd.radius=i._semiMajorAxis,new ZV(kd))};ZV.createGeometry=function(e){return Ed.createGeometry(e._ellipseGeometry)};var I4=ZV;var e_i=T(S(),1);function GV(e){e=y(e,y.EMPTY_OBJECT),this._callback=e.callback,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Di({ellipsoid:y(e.ellipsoid,ne.default)})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=Qr.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new be;let n=e.credit;typeof n=="string"&&(n=new Rt(n)),this._credit=n}Object.defineProperties(GV.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(){}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});GV.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 Fa({buffer:c,width:r,height:s})})};GV.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};GV.prototype.getTileDataAvailable=function(e,t,n){};GV.prototype.loadTileDataAvailability=function(e,t,n){};var W4=GV;var n_i=T(S(),1);function Xbe(e){this.proxy=e}Xbe.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var P4=Xbe;var s_i=T(S(),1);function _h(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=l(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(_h.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}}});_h.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,o=new _h({comparator:t,maximumLength:e});o._length=i;for(let r=0;r<i;r++)o._array[r]=n[r];return o};_h.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};_h.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)Ibe(this,t)};_h.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++,Ibe(this,i),t};_h.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],Wbe(this,0)),this._array[e-1]=void 0,t};_h.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=v4(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&Wbe(this,n)}return this._array[e-1]=void 0,t};_h.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};_h.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[v4(this,1,2)?1:2]};function lD(e,t,n){let i=e._array,o=i[t];i[t]=i[n],i[n]=o}function Jv(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function v4(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function Ibe(e,t){if(t===0)return;let n=Math.floor(W.log2(t+1))%2===0,i=Math.floor((t-1)/2),o=Jv(e,t,i);for(o!==n&&(lD(e,t,i),t=i);t>=3;){let r=Math.floor((t-3)/4);if(Jv(e,t,r)!==o)break;lD(e,t,r),t=r}}function Wbe(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){Jv(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;Jv(e,u,r)===i&&(r=u)}}if(Jv(e,r,t)===i&&(lD(e,r,t),r!==o&&r!==s)){let a=Math.floor((r-1)/2);v4(e,r,a)===i&&lD(e,r,a)}t=r}}var yT=_h;var p_i=T(S(),1);function EV(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Di({ellipsoid:y(e.ellipsoid,ne.default)})),this._levelZeroMaximumGeometricError=Qr.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new be}Object.defineProperties(EV.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(){}}});EV.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new Fa({buffer:new Uint8Array(16*16),width:16,height:16}))};EV.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};EV.prototype.getTileDataAvailable=function(e,t,n){};EV.prototype.loadTileDataAvailability=function(e,t,n){};var Af=EV;var K_i=T(S(),1);var X_i=T(S(),1);var V_i=T(S(),1);function Mf(e){e=y(e,y.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=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this._cullingVolume=new rs,this._perspectiveMatrix=new F,this._infinitePerspective=new F}function w4(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=F.computePerspectiveOffCenter(o,i,n,t,r,s,e._perspectiveMatrix),e._infinitePerspective=F.computeInfinitePerspectiveOffCenter(o,i,n,t,r,e._infinitePerspective))}Object.defineProperties(Mf.prototype,{projectionMatrix:{get:function(){return w4(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return w4(this),this._infinitePerspective}}});var Pot=new h,vot=new h,wot=new h,Fot=new h;Mf.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,Pot),m=vot;h.multiplyByScalar(t,c,m),h.add(e,m,m);let p=wot;h.multiplyByScalar(t,d,p),h.add(e,p,p);let g=Fot;h.multiplyByScalar(u,a,g),h.add(m,g,g),h.subtract(g,e,g),h.normalize(g,g),h.cross(g,n,g),h.normalize(g,g);let f=i[0];return l(f)||(f=i[0]=new se),f.x=g.x,f.y=g.y,f.z=g.z,f.w=-h.dot(g,e),h.multiplyByScalar(u,s,g),h.add(m,g,g),h.subtract(g,e,g),h.cross(n,g,g),h.normalize(g,g),f=i[1],l(f)||(f=i[1]=new se),f.x=g.x,f.y=g.y,f.z=g.z,f.w=-h.dot(g,e),h.multiplyByScalar(n,r,g),h.add(m,g,g),h.subtract(g,e,g),h.cross(u,g,g),h.normalize(g,g),f=i[2],l(f)||(f=i[2]=new se),f.x=g.x,f.y=g.y,f.z=g.z,f.w=-h.dot(g,e),h.multiplyByScalar(n,o,g),h.add(m,g,g),h.subtract(g,e,g),h.cross(g,u,g),h.normalize(g,g),f=i[3],l(f)||(f=i[3]=new se),f.x=g.x,f.y=g.y,f.z=g.z,f.w=-h.dot(g,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,g),f=i[5],l(f)||(f=i[5]=new se),f.x=g.x,f.y=g.y,f.z=g.z,f.w=-h.dot(g,p),this._cullingVolume};Mf.prototype.getPixelDimensions=function(e,t,n,i,o){w4(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};Mf.prototype.clone=function(e){return l(e)||(e=new Mf),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};Mf.prototype.equals=function(e){return l(e)&&e instanceof Mf&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};Mf.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof Mf&&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=Mf;function Ol(e){e=y(e,y.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=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this.xOffset=y(e.xOffset,0),this._xOffset=this.xOffset,this.yOffset=y(e.yOffset,0),this._yOffset=this.yOffset}Ol.packedLength=6;Ol.pack=function(e,t,n){return n=y(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};Ol.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Ol),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 Th(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(Ol.prototype,{projectionMatrix:{get:function(){return Th(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return Th(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return Th(this),this._fovy}},sseDenominator:{get:function(){return Th(this),this._sseDenominator}},offCenterFrustum:{get:function(){return Th(this),this._offCenterFrustum}}});Ol.prototype.computeCullingVolume=function(e,t,n){return Th(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};Ol.prototype.getPixelDimensions=function(e,t,n,i,o){return Th(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};Ol.prototype.clone=function(e){return l(e)||(e=new Ol),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};Ol.prototype.equals=function(e){return!l(e)||!(e instanceof Ol)?!1:(Th(this),Th(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};Ol.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof Ol)?!1:(Th(this),Th(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 Vi=Ol;var dD=0,Aot=1;function xT(e){let t=e.frustum,n=e.orientation,i=e.origin,o=y(e.vertexFormat,Pe.DEFAULT),r=y(e._drawNearPlane,!0),s,a;t instanceof Vi?(s=dD,a=Vi.packedLength):t instanceof sn&&(s=Aot,a=sn.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=we.clone(n),this._drawNearPlane=r,this._vertexFormat=o,this._workerName="createFrustumGeometry",this.packedLength=2+a+h.packedLength+we.packedLength+Pe.packedLength}xT.pack=function(e,t,n){n=y(n,0);let i=e._frustumType,o=e._frustum;return t[n++]=i,i===dD?(Vi.pack(o,t,n),n+=Vi.packedLength):(sn.pack(o,t,n),n+=sn.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,we.pack(e._orientation,t,n),n+=we.packedLength,Pe.pack(e._vertexFormat,t,n),n+=Pe.packedLength,t[n]=e._drawNearPlane?1:0,t};var Mot=new Vi,Not=new sn,kot=new we,Uot=new h,Dot=new Pe;xT.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o;i===dD?(o=Vi.unpack(e,t,Mot),t+=Vi.packedLength):(o=sn.unpack(e,t,Not),t+=sn.packedLength);let r=h.unpack(e,t,Uot);t+=h.packedLength;let s=we.unpack(e,t,kot);t+=we.packedLength;let a=Pe.unpack(e,t,Dot);t+=Pe.packedLength;let c=e[t]===1;if(!l(n))return new xT({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=we.clone(s,n._orientation),n._vertexFormat=Pe.clone(a,n._vertexFormat),n._drawNearPlane=c,n};function XV(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 Bot=new $,Yot=new F,F4=new F,Pbe=new h,vbe=new h,wbe=new h,Oot=new h,Hot=new h,zot=new h,py=new Array(3),Qv=new Array(4);Qv[0]=new se(-1,-1,1,1);Qv[1]=new se(1,-1,1,1);Qv[2]=new se(1,1,1,1);Qv[3]=new se(-1,1,1,1);var Fbe=new Array(4);for(let e=0;e<4;++e)Fbe[e]=new se;xT._computeNearFarPlanes=function(e,t,n,i,o,r,s,a){let c=$.fromQuaternion(t,Bot),d=y(r,Pbe),u=y(s,vbe),m=y(a,wbe);d=$.getColumn(c,0,d),u=$.getColumn(c,1,u),m=$.getColumn(c,2,m),h.normalize(d,d),h.normalize(u,u),h.normalize(m,m),h.negate(d,d);let p=F.computeView(e,m,u,d,Yot),g,f,x=i.projectionMatrix;if(n===dD){let _=F.multiply(x,p,F4);f=F.inverse(_,F4)}else g=F.inverseTransformation(p,F4);l(f)?(py[0]=i.near,py[1]=i.far):(py[0]=0,py[1]=i.near,py[2]=i.far);for(let _=0;_<2;++_)for(let C=0;C<4;++C){let V=se.clone(Qv[C],Fbe[C]);if(l(f)){V=F.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,py[_]/Z,V),h.add(V,e,V)}else{let L=i.offCenterFrustum;l(L)&&(i=L);let Z=py[_],E=py[_+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-E)-Z-E)*.5,V.w=1,F.multiplyByVector(g,V,V)}o[12*_+C*3]=V.x,o[12*_+C*3+1]=V.y,o[12*_+C*3+2]=V.z}};xT.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);xT._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 mn({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,g=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,_=Pbe,C=vbe,V=wbe,L=h.negate(_,Oot),Z=h.negate(C,Hot),E=h.negate(V,zot);d=0,r&&(XV(d,p,g,f,x,E,_,C),d+=3*4),XV(d,p,g,f,x,V,L,C),d+=3*4,XV(d,p,g,f,x,L,E,C),d+=3*4,XV(d,p,g,f,x,Z,E,L),d+=3*4,XV(d,p,g,f,x,_,V,C),d+=3*4,XV(d,p,g,f,x,C,V,L),l(p)&&(u.normal=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:p})),l(g)&&(u.tangent=new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:g})),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 g=p*6,f=p*4;m[g]=f,m[g+1]=f+1,m[g+2]=f+2,m[g+3]=f,m[g+4]=f+2,m[g+5]=f+3}return new ht({attributes:u,indices:m,primitiveType:Fe.TRIANGLES,boundingSphere:ce.fromVertices(c)})};var _T=xT;var lTi=T(S(),1);var A4=0,Kot=1;function jv(e){let t=e.frustum,n=e.orientation,i=e.origin,o=y(e._drawNearPlane,!0),r,s;t instanceof Vi?(r=A4,s=Vi.packedLength):t instanceof sn&&(r=Kot,s=sn.packedLength),this._frustumType=r,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=we.clone(n),this._drawNearPlane=o,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+s+h.packedLength+we.packedLength}jv.pack=function(e,t,n){n=y(n,0);let i=e._frustumType,o=e._frustum;return t[n++]=i,i===A4?(Vi.pack(o,t,n),n+=Vi.packedLength):(sn.pack(o,t,n),n+=sn.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,we.pack(e._orientation,t,n),n+=we.packedLength,t[n]=e._drawNearPlane?1:0,t};var Jot=new Vi,Qot=new sn,jot=new we,qot=new h;jv.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o;i===A4?(o=Vi.unpack(e,t,Jot),t+=Vi.packedLength):(o=sn.unpack(e,t,Qot),t+=sn.packedLength);let r=h.unpack(e,t,qot);t+=h.packedLength;let s=we.unpack(e,t,jot);t+=we.packedLength;let a=e[t]===1;if(!l(n))return new jv({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=we.clone(s,n._orientation),n._drawNearPlane=a,n};jv.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);_T._computeNearFarPlanes(i,o,t,n,s);let a=new mn({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 ht({attributes:a,indices:m,primitiveType:Fe.LINES,boundingSphere:ce.fromVertices(s)})};var qv=jv;var uTi=T(S(),1),$ot={SEARCH:0,AUTOCOMPLETE:1},by=Object.freeze($ot);var bTi=T(S(),1);function uD(){pe.throwInstantiationError()}Object.defineProperties(uD.prototype,{credit:{get:pe.throwInstantiationError}});uD.getCreditsFromResult=function(e){if(l(e.attributions))return e.attributions.map(Rt.getIonCredit)};uD.prototype.geocode=pe.throwInstantiationError;var IV=uD;var xTi=T(S(),1);function Abe(){pe.throwInstantiationError()}Abe.createGeometry=function(e){pe.throwInstantiationError()};var M4=Abe;var kTi=T(S(),1),rrt=T(N4(),1);var RTi=T(S(),1);var STi=T(S(),1);function ert(e,t){return(e&t)!==0}var _c=ert;var trt=[1,2,4,8],Mbe=15,nrt=16,irt=64,ort=128;function Nf(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}Nf.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 Nf(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};Nf.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};Nf.prototype.hasSubtree=function(){return _c(this._bits,nrt)};Nf.prototype.hasImagery=function(){return _c(this._bits,irt)};Nf.prototype.hasTerrain=function(){return _c(this._bits,ort)};Nf.prototype.hasChildren=function(){return _c(this._bits,Mbe)};Nf.prototype.hasChild=function(e){return _c(this._bits,trt[e])};Nf.prototype.getChildBitmask=function(){return this._bits&Mbe};var $v=Nf;function srt(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 art=srt(`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\x005\x88"\xCF1\xB2&/\xE7\xC3u-6,rt\xB0#G\xB7\xD3\xD1&\x857r\xE2\0\x8CD\xCF\xDA3-\xDE\`\x86i#i*|\xCDKQ\r\x95T9w.)\xEA\x1B\xA6P\xA2j\x8FoP\x99\\>T\xFB\xEFP[\v\x07E\x89m(w7\xDB\x8EJfJo\x99 \xE5p\xE2\xB9q~\fmI-z\xFEr\xC7\xF2Y0\x8F\xBB]s\xE5\xC9 \xEAx\xEC \x90\xF0\x8A\x7FB|G\`\xB0\xBD&\xB7q\xB6\xC7\x9F\xD13\x82=\xD3\xAB\xEEc\x99\xC8+S\xA0D\\q\xC6\xCCD2O<\xCA\xC0)=R\xD3aX\xA9}e\xB4\xDC\xCF\r\xF4=\xF1\b\xA9B\xDA#	\xD8\xBF^PI\xF8M\xC0\xCBGLO\xF7{+\xD8\xC51\x92;\xB5o\xDCl\r\x92\x88\xD1\x9E\xDB?\xE2\xE9\xDA_\xD4\x84\xE2FaZ\xDEU\xCF\xA4\0\xBE\xFD\xCEg\xF1Ji\x97\xE6 H\xD8]\x7F~\xAEq N\xAE\xC0V\xA9\x91<\x82r\xE7v\xEC)I\xD6]-\x83\xE3\xDB6\xA9;f\x97\x87j\xD5\xB6=P^R\xB9K\xC7sWx\xC9\xF4.Y\x07\x95\x93o\xD0KW>''\xC7\`\xDB;\xED\x9ASD>?\x8D\x92mw\xA2
\xEB?R\xA8\xC6U^1I7\x85\xF4\xC5&-\xA9\xBF\x8B'T\xDA\xC3j \xE5*x\xB0\xD6\x90pr\xAA\x8Bh\xBD\x88\xF7_H\xB1~\xC0XL?f\xF9>\xE1e\xC0p\xA7\xCF8i\xAF\xF0VldI\x9C'\xADxtO\xC2\x87\xDEV9\0\xDAw\v\xCB-\x1B\x89\xFB5O\xF5\bQ\`\xC1
ZGM&30x\xDA\xC0\x9CFG\xE2[y\`In7gS
>\xE9\xECF9\xB2\xF14\r\xC6\x84Sun\xE1\fY\xD9\xDE)\x85{II\xA5wy\xBEIV.6\xE7\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 Ud(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(Ud.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});Ud.fromUrl=async function(e){let t=e;typeof t!="string"&&!(t instanceof Ee)&&(t=e.url);let n=Ee.createIfNeeded(t);n.appendForwardSlash();let i=new Ud;i._resource=n;try{await crt(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(o){let r=`An error occurred while accessing ${kbe(i,"",1).url}: ${o}`;throw new ue(r)}return i};Ud.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;_c(t,r)?_c(e,r)&&(s|=1):(s|=2,_c(e,r)||(s|=1)),i+=s}return i};Ud.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];_c(s,2)?_c(s,1)||(t|=r):(n|=r,_c(s,1)&&(t|=r))}return{x:t,y:n,level:i}};Ud.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 Nbe=new bi("decodeGoogleEarthEnterprisePacket");Ud.prototype.getQuadTreePacket=function(e,t,n){t=y(t,1),e=y(e,"");let o=kbe(this,e,t,n).fetchArrayBuffer();if(!l(o))return;let r=this._tileInfo,s=this.key;return o.then(function(a){return Nbe.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 g=p.length;for(let f=0;f<g;++f){let x=p[f];if(d[x]!==null){let C=$v.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}})})};Ud.prototype.populateSubtree=function(e,t,n,i){let o=Ud.tileXYToQuadKey(e,t,n);return D4(this,o,i)};function D4(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 Oo({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),D4(e,t,s)});if(!l(r)||!r.hasSubtree())return Promise.reject(new ue(`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 Oo({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),D4(e,t,s)}).finally(function(){delete a[o]})}Ud.prototype.getTileInformation=function(e,t,n){let i=Ud.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};Ud.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function kbe(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var k4,U4;function crt(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(U4)){let n=nn("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;U4=Hy(n).then(function(){k4=window.cesiumGoogleEarthDbRootParser(rrt),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return U4.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=k4.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 Nbe.scheduleTask({buffer:c,type:"DbRoot",key:a},[c])}).then(function(n){let i=k4.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=y(i.imageryPresent,e.imageryPresent),e.protoImagery=i.protoImagery,e.terrainPresent=y(i.terrainPresent,e.terrainPresent),l(i.endSnippet)&&l(i.endSnippet.model)){let a=i.endSnippet.model;e.negativeAltitudeExponentBias=y(a.negativeAltitudeExponentBias,e.negativeAltitudeExponentBias),e.negativeAltitudeThreshold=y(a.compressedNegativeAltitudeThreshold,e.negativeAltitudeThreshold)}l(i.databaseVersion)&&(e._quadPacketVersion=y(i.databaseVersion.quadtreeVersion,e._quadPacketVersion));let o=e.providers,r=y(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 Rt(d.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=art})}var z0=Ud;var iSi=T(S(),1);function TT(e){e=y(e,y.EMPTY_OBJECT),this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;let t=y(e.childTileMask,15),n=t&3;n|=t&4?8:0,n|=t&8?4:0,this._childTileMask=n,this._createdByUpsampling=y(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(TT.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var Bbe="createVerticesFromGoogleEarthEnterpriseBuffer",lrt=new bi(Bbe),drt=new bi(Bbe,gh.maximumAsynchronousTasks),Ube=new ae,B4=new ae;TT.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid;t.tileXYToNativeRectangle(n,i,o,Ube),t.tileXYToRectangle(n,i,o,B4);let d=c.cartographicToCartesian(ae.center(B4)),m=40075.16/(1<<o);this._skirtHeight=Math.min(m*8,1e3);let g=(a?drt:lrt).scheduleTask({buffer:this._buffer,nativeRectangle:Ube,rectangle:B4,relativeToCenter:d,ellipsoid:c,skirtHeight:this._skirtHeight,exaggeration:r,exaggerationRelativeHeight:s,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!l(g))return;let f=this;return g.then(function(x){return f._mesh=new ju(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,Gn.clone(x.orientedBoundingBox),xc.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})};TT.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)?prt(this,i,o):yrt(this,i,o,e)};var urt=new bi("upsampleQuantizedTerrainMesh",gh.maximumAsynchronousTasks);TT.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=urt.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 g=this;return p.then(function(f){let x=new Uint16Array(f.vertices),_=Ae.createTypedArray(x.length/3,f.indices),C=g._skirtHeight;return new bT({quantizedVertices:x,indices:_,minimumHeight:f.minimumHeight,maximumHeight:f.maximumHeight,boundingSphere:ce.clone(f.boundingSphere),orientedBoundingBox:Gn.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:g._credits})})};TT.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};TT.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var mrt=new D,hrt=new D,frt=new D,Ybe=new h;function prt(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,mrt),g=r.decodeTextureCoordinates(o,u,hrt),f=r.decodeTextureCoordinates(o,m,frt),x=O0.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,f.x,f.y,Ybe);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 brt=Uint16Array.BYTES_PER_ELEMENT,Dbe=Uint32Array.BYTES_PER_ELEMENT,Y4=Int32Array.BYTES_PER_ELEMENT,grt=Float32Array.BYTES_PER_ELEMENT,O4=Float64Array.BYTES_PER_ELEMENT;function yrt(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 E=0;E<r;++E)d+=c.getUint32(d,!0),d+=Dbe;d+=Dbe,d+=2*O4;let u=W.toRadians(c.getFloat64(d,!0)*180);d+=O4;let m=W.toRadians(c.getFloat64(d,!0)*180);d+=O4;let p=i.width/u/2,g=i.height/m/2,f=c.getInt32(d,!0);d+=Y4;let x=c.getInt32(d,!0)*3;d+=Y4,d+=Y4;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++)*g,V[L]=c.getFloat32(d,!0)*6371010,d+=grt;let Z=new Array(x);for(L=0;L<x;++L)Z[L]=c.getUint16(d,!0),d+=brt;for(L=0;L<x;L+=3){let E=Z[L],X=Z[L+1],v=Z[L+2],P=_[E],A=_[X],M=_[v],b=C[E],R=C[X],G=C[v],I=O0.computeBarycentricCoordinates(t,n,P,b,A,R,M,G,Ybe);if(I.x>=-1e-15&&I.y>=-1e-15&&I.z>=-1e-15)return I.x*V[E]+I.y*V[X]+I.z*V[v]}}var WV=TT;var TSi=T(S(),1);var qu={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},mD=new q;function hD(){this._terrainCache={},this._lastTidy=q.now()}hD.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:q.now()}};hD.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};hD.prototype.tidy=function(){if(q.now(mD),q.secondsDifference(mD,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];q.secondsDifference(mD,r.timestamp)>10&&delete e[o]}q.clone(mD,this._lastTidy)}};function gy(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=new Di({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ae(-W.PI,-W.PI,W.PI,W.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new Rt(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new hD,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new be}Object.defineProperties(gy.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(){}}});gy.fromMetadata=function(e,t){if(!e.terrainPresent)throw new ue(`The server ${e.url} doesn't have terrain`);let n=new gy(t);return n._metadata=e,n};var xrt=new bi("decodeGoogleEarthEnterprisePacket");function Obe(e,t,n){let i=t.getChildBitmask();if(t.terrainState===qu.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}gy.prototype.requestTileGeometry=function(e,t,n,i){let o=z0.tileXYToQuadKey(e,t,n),r=this._terrainCache,s=this._metadata,a=s.getTileInformationFromQuadKey(o);if(!l(a))return Promise.reject(new ue("Terrain tile doesn't exist"));let c=a.terrainState;l(c)||(c=a.terrainState=qu.UNKNOWN);let d=r.get(o);if(l(d)){let C=s.providers[a.terrainProvider];return Promise.resolve(new WV({buffer:d,childTileMask:Obe(o,a,s),credits:l(C)?[C]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(r.tidy(),a.ancestorHasTerrain){if(c===qu.NONE)return Promise.reject(new ue("Terrain tile doesn't exist"))}else return Promise.resolve(new Fa({buffer:new Uint8Array(16*16),width:16,height:16}));let u,m=o,p=-1;switch(c){case qu.SELF:p=a.terrainVersion;break;case qu.PARENT:m=m.substring(0,m.length-1),u=s.getTileInformationFromQuadKey(m),p=u.terrainVersion;break;case qu.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 ue("Terrain tile doesn't exist"));let g=this._terrainPromises,f=this._terrainRequests,x,_;if(l(g[m]))x=g[m],_=f[m];else{_=i;let C=_rt(this,m,p,_).fetchArrayBuffer();if(!l(C))return;x=C.then(function(V){return l(V)?xrt.scheduleTask({buffer:V,type:"Terrain",key:s.key},[V]).then(function(L){let Z=s.getTileInformationFromQuadKey(m);Z.terrainState=qu.SELF,r.add(m,L[0]);let E=Z.terrainProvider,X=L.length-1;for(let v=0;v<X;++v){let P=m+v.toString(),A=s.getTileInformationFromQuadKey(P);l(A)&&(r.add(P,L[v+1]),A.terrainState=qu.PARENT,A.terrainProvider===0&&(A.terrainProvider=E))}}):Promise.reject(new ue("Failed to load terrain."))}),g[m]=x,f[m]=_,x=x.finally(function(){delete g[m],delete f[m]})}return x.then(function(){let C=r.get(o);if(l(C)){let V=s.providers[a.terrainProvider];return new WV({buffer:C,childTileMask:Obe(o,a,s),credits:l(V)?[V]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold})}return Promise.reject(new ue("Failed to load terrain."))}).catch(function(C){return _.state===jn.CANCELLED?(i.state=_.state,Promise.reject(C)):(a.terrainState=qu.NONE,Promise.reject(C))})};gy.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};gy.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,o=z0.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===qu.NONE)return!1;if((!l(s)||s===qu.UNKNOWN)&&(r.terrainState=qu.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 Oo({throttle:!1,throttleByServer:!0,type:is.TERRAIN});i.populateSubtree(e,t,n,s)}return!1};gy.prototype.loadTileDataAvailability=function(e,t,n){};function _rt(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 H4=gy;var LSi=T(S(),1);var fD={};fD.defaultApiKey=void 0;fD.mapTilesApiEndpoint=new Ee({url:"https://tile.googleapis.com/v1/"});fD.getDefaultCredit=function(){return new Rt('<img src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align: -5px" alt="Google">',!0)};var ST=fD;var vSi=T(S(),1);var ZSi=T(S(),1);function Trt(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var ew=Trt;var rge={},Srt=32.184,Crt=2451545,Hbe=-.0529921,zbe=-.1059842,Kbe=13.0120009,Jbe=13.3407154,Qbe=.9856003,jbe=26.4057084,qbe=13.064993,$be=.3287146,ege=1.7484877,tge=-.1589763,nge=.0036096,ige=.1643573,oge=12.9590088,z4=new q;rge.ComputeMoon=function(e,t){l(e)||(e=q.now()),z4=q.addSeconds(e,Srt,z4);let n=q.totalDays(z4)-Crt,i=n/zn.DAYS_PER_JULIAN_CENTURY,o=(125.045+Hbe*n)*W.RADIANS_PER_DEGREE,r=(250.089+zbe*n)*W.RADIANS_PER_DEGREE,s=(260.008+Kbe*n)*W.RADIANS_PER_DEGREE,a=(176.625+Jbe*n)*W.RADIANS_PER_DEGREE,c=(357.529+Qbe*n)*W.RADIANS_PER_DEGREE,d=(311.589+jbe*n)*W.RADIANS_PER_DEGREE,u=(134.963+qbe*n)*W.RADIANS_PER_DEGREE,m=(276.617+$be*n)*W.RADIANS_PER_DEGREE,p=(34.226+ege*n)*W.RADIANS_PER_DEGREE,g=(15.134+tge*n)*W.RADIANS_PER_DEGREE,f=(119.743+nge*n)*W.RADIANS_PER_DEGREE,x=(239.961+ige*n)*W.RADIANS_PER_DEGREE,_=(25.053+oge*n)*W.RADIANS_PER_DEGREE,C=Math.sin(o),V=Math.sin(r),L=Math.sin(s),Z=Math.sin(a),E=Math.sin(c),X=Math.sin(d),v=Math.sin(u),P=Math.sin(m),A=Math.sin(p),M=Math.sin(g),b=Math.sin(f),R=Math.sin(x),G=Math.sin(_),I=Math.cos(o),w=Math.cos(r),N=Math.cos(s),B=Math.cos(a),U=Math.cos(c),O=Math.cos(d),k=Math.cos(u),J=Math.cos(m),H=Math.cos(p),te=Math.cos(g),z=Math.cos(f),j=Math.cos(x),ee=Math.cos(_),fe=(269.9949+.0031*i-3.8787*C-.1204*V+.07*L-.0172*Z+.0072*X-.0052*M+.0043*G)*W.RADIANS_PER_DEGREE,_e=(66.5392+.013*i+1.5419*I+.0239*w-.0278*N+.0068*B-.0029*O+9e-4*k+8e-4*te-9e-4*ee)*W.RADIANS_PER_DEGREE,le=(38.3213+13.17635815*n-14e-13*n*n+3.561*C+.1208*V-.0642*L+.0158*Z+.0252*E-.0066*X-.0047*v-.0046*P+.0028*A+.0052*M+.004*b+.0019*R-.0044*G)*W.RADIANS_PER_DEGREE,ge=(13.17635815-14e-13*(2*n)+3.561*I*Hbe+.1208*w*zbe-.0642*N*Kbe+.0158*B*Jbe+.0252*U*Qbe-.0066*O*jbe-.0047*k*qbe-.0046*J*$be+.0028*H*ege+.0052*te*tge+.004*z*nge+.0019*j*ige-.0044*ee*oge)/86400*W.RADIANS_PER_DEGREE;return l(t)||(t=new ew),t.rightAscension=fe,t.declination=_e,t.rotation=le,t.rotationRate=ge,t};var tw=rge;var BSi=T(S(),1);function sge(e){(!l(e)||typeof e!="function")&&(e=tw.ComputeMoon),this._computeFunction=e}var Vrt=new h,Lrt=new h,Rrt=new h;function Zrt(e,t,n){let i=Vrt;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,Lrt);return l(n)||(n=new $),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 Grt=new $,Ert=new we;sge.prototype.evaluate=function(e,t){l(e)||(e=q.now());let n=this._computeFunction(e),i=Zrt(n.rightAscension,n.declination,t),o=W.zeroToTwoPi(n.rotation),r=we.fromAxisAngle(h.UNIT_Z,o,Ert),s=$.fromQuaternion(we.conjugate(r,r),Grt);return $.multiply(s,i,i)};var nw=sge;var HSi=T(S(),1);var iw={};iw.type=void 0;iw.getRequiredDataPoints=pe.throwInstantiationError;iw.interpolateOrderZero=pe.throwInstantiationError;iw.interpolate=pe.throwInstantiationError;var K4=iw;var aCi=T(S(),1);var $Si=T(S(),1);function J4(e){this._url=Ee.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(J4.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});J4.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===by.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=ae.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 ow=J4;function Q4(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.accessToken,Em.defaultAccessToken),n=Ee.createIfNeeded(y(e.server,Em.defaultServer));n.appendForwardSlash();let i=Em.getDefaultTokenCredit(t);l(i)&&e.scene.frameState.creditDisplay.addStaticCredit(Rt.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 ow(o)}Object.defineProperties(Q4.prototype,{credit:{get:function(){}}});Q4.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var rw=Q4;var lCi=T(S(),1),Xrt={SHIFT:0,CTRL:1,ALT:2},Os=Object.freeze(Xrt);var mCi=T(S(),1);function pD(){pe.throwInstantiationError()}Object.defineProperties(pD.prototype,{ellipsoid:{get:pe.throwInstantiationError}});pD.prototype.project=pe.throwInstantiationError;pD.prototype.unproject=pe.throwInstantiationError;var j4=pD;var gCi=T(S(),1);function PV(e){e=y(e,y.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(PV.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});PV.prototype.findTimeInterval=to.prototype.findTimeInterval;PV.prototype.wrapTime=to.prototype.wrapTime;PV.prototype.clampTime=to.prototype.clampTime;PV.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 q4=PV;var ECi=T(S(),1);var xCi=T(S(),1),Irt={NONE:-1,PARTIAL:0,FULL:1},lr=Object.freeze(Irt);function Tc(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 bD=new h;Object.defineProperties(Tc.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,bD),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,bD);let a=o*o*n;s=h.add(e,h.multiplyByScalar(r,a,bD),bD)}else o=Number.MAX_VALUE;this._horizonDistance=o,this._horizonPlaneNormal=r,this._horizonPlanePosition=s,this._cameraPosition=e}}});Tc.fromBoundingSphere=function(e,t,n){return l(n)?(h.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new Tc(e,t)};var cge=new h;Tc.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=h.subtract(e,this._occluderPosition,cge),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 Wrt=new h;Tc.prototype.isBoundingSphereVisible=function(e){let t=h.clone(e.center,Wrt),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,cge),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;Tc.prototype.computeVisibility=function(e){let t=h.clone(e.center),n=e.radius;if(n>this._occluderRadius)return lr.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?lr.NONE:(o=this._occluderRadius+n,o=r-o*o,o>0?(o=Math.sqrt(o)+this._horizonDistance,s<o*o+n*n?lr.FULL:lr.PARTIAL):(i=h.subtract(t,this._horizonPlanePosition,i),h.dot(i,this._horizonPlaneNormal)>-n?lr.PARTIAL:lr.FULL))}}return lr.NONE};var gD=new h;Tc.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,gD),gD),c=-h.dot(a,o),d=Tc._anyRotationVector(o,a,c),u=Tc._horizonToPlaneNormalDotProduct(e,a,c,d,n[0]);if(!u)return;let m;for(let g=1;g<s;++g){if(m=Tc._horizonToPlaneNormalDotProduct(e,a,c,d,n[g]),!m)return;m<u&&(u=m)}if(u<.0017453283658983088)return;let p=r/u;return h.add(o,h.multiplyByScalar(a,p,gD),gD)};var vrt=[];Tc.computeOccludeePointFromRectangle=function(e,t){t=y(t,ne.default);let n=ae.subsample(e,t,0,vrt),i=ce.fromPoints(n),o=h.ZERO;if(!h.equals(o,i.center))return Tc.computeOccludeePoint(new ce(o,t.minimumRadius),i.center,n)};var wrt=new h;Tc._anyRotationVector=function(e,t,n){let i=h.abs(t,wrt),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 Frt=new h;Tc._rotationVector=function(e,t,n,i,o){let r=h.subtract(i,e,Frt);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 $4=new h,Art=new h,yD=new h,age=new h;Tc._horizonToPlaneNormalDotProduct=function(e,t,n,i,o){let r=h.clone(o,$4),s=h.clone(e.center,Art),a=e.radius,c=h.subtract(s,r,yD),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,_,age),age),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,$4);Z=h.normalize(Z,Z);let E=h.multiplyByScalar(Z,V,$4);L=h.normalize(h.subtract(h.add(C,E,yD),s,yD),yD);let X=h.dot(t,L);L=h.normalize(h.subtract(h.subtract(C,E,L),s,L),L);let v=h.dot(t,L);return X<v?X:v};var sw=Tc;var MCi=T(S(),1);function ej(e,t,n){e=Ee.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=y(n,{}),this._credit=new Rt('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(ej.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});ej.prototype.geocode=async function(e){return this._url.getDerivedResource({url:"json",queryParameters:_t(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let o,r=i.bounds;if(l(r))o=ae.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 tj=ej;var UCi=T(S(),1);var Mrt={packedLength:void 0,pack:pe.throwInstantiationError,unpack:pe.throwInstantiationError},nj=Mrt;var YCi=T(S(),1);var Nrt={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:pe.throwInstantiationError,unpackInterpolationResult:pe.throwInstantiationError},ij=Nrt;var zCi=T(S(),1);function lge(){pe.throwInstantiationError()}lge.prototype.getURL=pe.throwInstantiationError;var oj=lge;var s1i=T(S(),1);var JCi=T(S(),1),krt={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},Sn=Object.freeze(krt);function yy(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,n.y=t.clientY-o.top,n}function dj(e,t){let n=e;return l(t)&&(n+=`+${t}`),n}function CT(e){if(e.shiftKey)return Os.SHIFT;if(e.ctrlKey)return Os.CTRL;if(e.altKey)return Os.ALT}var Vs={LEFT:0,MIDDLE:1,RIGHT:2};function Dd(e,t,n,i){function o(r){i(e,r)}Ot.isInternetExplorer()?n.addEventListener(t,o,!1):n.addEventListener(t,o,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,o,!1)})}function Urt(e){let t=e._element,n=l(t.disableRootEvents)?t:document;Ot.supportsPointerEvents()?(Dd(e,"pointerdown",t,zrt),Dd(e,"pointerup",t,xge),Dd(e,"pointermove",t,Krt),Dd(e,"pointercancel",t,xge)):(Dd(e,"mousedown",t,_ge),Dd(e,"mouseup",n,Tge),Dd(e,"mousemove",n,Sge),Dd(e,"touchstart",t,Ort),Dd(e,"touchend",n,fge),Dd(e,"touchmove",n,Hrt),Dd(e,"touchcancel",n,fge)),Dd(e,"dblclick",t,Brt);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",Dd(e,i,t,Yrt)}function Drt(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var dge={position:new D};function uj(e){e._lastSeenTouchEvent=_i()}function mj(e){return _i()-e._lastSeenTouchEvent>Sh.mouseEmulationIgnoreMilliseconds}function lj(e,t,n){let i=e.x-t.x,o=e.y-t.y;return Math.sqrt(i*i+o*o)<n}function _ge(e,t){if(!mj(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===Vs.LEFT)i=Sn.LEFT_DOWN;else if(n===Vs.MIDDLE)i=Sn.MIDDLE_DOWN;else if(n===Vs.RIGHT)i=Sn.RIGHT_DOWN;else return;let o=yy(e,t,e._primaryPosition);D.clone(o,e._primaryStartPosition),D.clone(o,e._primaryPreviousPosition);let r=CT(t),s=e.getInputAction(i,r);l(s)&&(D.clone(o,dge.position),s(dge),t.preventDefault())}var uge={position:new D},mge={position:new D};function rj(e,t,n,i){let o=CT(i),r=e.getInputAction(t,o),s=e.getInputAction(n,o);if(l(r)||l(s)){let a=yy(e,i,e._primaryPosition);if(l(r)&&(D.clone(a,uge.position),r(uge)),l(s)){let c=e._primaryStartPosition;lj(c,a,e._clickPixelTolerance)&&(D.clone(a,mge.position),s(mge))}}}function Tge(e,t){if(!mj(e))return;let n=t.button;n!==Vs.LEFT&&n!==Vs.MIDDLE&&n!==Vs.RIGHT||(e._buttonDown[Vs.LEFT]&&(rj(e,Sn.LEFT_UP,Sn.LEFT_CLICK,t),e._buttonDown[Vs.LEFT]=!1),e._buttonDown[Vs.MIDDLE]&&(rj(e,Sn.MIDDLE_UP,Sn.MIDDLE_CLICK,t),e._buttonDown[Vs.MIDDLE]=!1),e._buttonDown[Vs.RIGHT]&&(rj(e,Sn.RIGHT_UP,Sn.RIGHT_CLICK,t),e._buttonDown[Vs.RIGHT]=!1))}var sj={startPosition:new D,endPosition:new D};function Sge(e,t){if(!mj(e))return;let n=CT(t),i=yy(e,t,e._primaryPosition),o=e._primaryPreviousPosition,r=e.getInputAction(Sn.MOUSE_MOVE,n);l(r)&&(D.clone(o,sj.startPosition),D.clone(i,sj.endPosition),r(sj)),D.clone(i,o),(e._buttonDown[Vs.LEFT]||e._buttonDown[Vs.MIDDLE]||e._buttonDown[Vs.RIGHT])&&t.preventDefault()}var hge={position:new D};function Brt(e,t){let n=t.button,i;if(n===Vs.LEFT)i=Sn.LEFT_DOUBLE_CLICK;else return;let o=CT(t),r=e.getInputAction(i,o);l(r)&&(yy(e,t,hge.position),r(hge))}function Yrt(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=CT(t),o=e.getInputAction(Sn.WHEEL,i);l(o)&&(o(n),t.preventDefault())}function Ort(e,t){uj(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,yy(e,r,new D));xD(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.set(s,D.clone(a.get(s)))}function fge(e,t){uj(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);xD(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.remove(s)}var pge={position:new D},aj={position1:new D,position2:new D},bge={position:new D},gge={position:new D},yge={position:new D};function xD(e,t){let n=CT(t),i=e._positions,o=i.length,r,s,a=e._isPinching;if(o!==1&&e._buttonDown[Vs.LEFT]){if(e._buttonDown[Vs.LEFT]=!1,l(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),r=e.getInputAction(Sn.LEFT_UP,n),l(r)&&(D.clone(e._primaryPosition,bge.position),r(bge)),o===0&&!e._isTouchHolding&&(s=e.getInputAction(Sn.LEFT_CLICK,n),l(s))){let c=e._primaryStartPosition,d=e._previousPositions.values[0];lj(c,d,e._clickPixelTolerance)&&(D.clone(e._primaryPosition,gge.position),s(gge))}e._isTouchHolding=!1}if(o===0&&a&&(e._isPinching=!1,r=e.getInputAction(Sn.PINCH_END,n),l(r)&&r()),o===1&&!a){let c=i.values[0];D.clone(c,e._primaryPosition),D.clone(c,e._primaryStartPosition),D.clone(c,e._primaryPreviousPosition),e._buttonDown[Vs.LEFT]=!0,r=e.getInputAction(Sn.LEFT_DOWN,n),l(r)&&(D.clone(c,pge.position),r(pge)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,s=e.getInputAction(Sn.RIGHT_CLICK,n),l(s))){let d=e._primaryStartPosition,u=e._previousPositions.values[0];lj(d,u,e._holdPixelTolerance)&&(D.clone(e._primaryPosition,yge.position),s(yge))}},Sh.touchHoldDelayMilliseconds),t.preventDefault()}o===2&&!a&&(e._isPinching=!0,r=e.getInputAction(Sn.PINCH_START,n),l(r)&&(D.clone(i.values[0],aj.position1),D.clone(i.values[1],aj.position2),r(aj),t.preventDefault()))}function Hrt(e,t){uj(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)&&yy(e,r,d)}Cge(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,D.clone(a.get(s),c.get(s))}var cj={startPosition:new D,endPosition:new D},aw={distance:{startPosition:new D,endPosition:new D},angleAndHeight:{startPosition:new D,endPosition:new D}};function Cge(e,t){let n=CT(t),i=e._positions,o=e._previousPositions,r=i.length,s;if(r===1&&e._buttonDown[Vs.LEFT]){let a=i.values[0];D.clone(a,e._primaryPosition);let c=e._primaryPreviousPosition;s=e.getInputAction(Sn.MOUSE_MOVE,n),l(s)&&(D.clone(c,cj.startPosition),D.clone(a,cj.endPosition),s(cj)),D.clone(a,c),t.preventDefault()}else if(r===2&&e._isPinching&&(s=e.getInputAction(Sn.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,g=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);D.fromElements(0,_,aw.distance.startPosition),D.fromElements(0,g,aw.distance.endPosition),D.fromElements(Z,V,aw.angleAndHeight.startPosition),D.fromElements(L,C,aw.angleAndHeight.endPosition),s(aw)}}function zrt(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,yy(e,t,new D)),xD(e,t),e._previousPositions.set(i,D.clone(n.get(i)))}else _ge(e,t)}function xge(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),xD(e,t),e._previousPositions.remove(i)}else Tge(e,t)}function Krt(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,o=n.get(i);if(!l(o))return;yy(e,t,o),Cge(e,t);let r=e._previousPositions;D.clone(n.get(i),r.get(i))}else Sge(e,t)}function Sh(e){this._inputEvents={},this._buttonDown={LEFT:!1,MIDDLE:!1,RIGHT:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-Sh.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new D,this._primaryPosition=new D,this._primaryPreviousPosition=new D,this._positions=new Lt,this._previousPositions=new Lt,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=y(e,document),Urt(this)}Sh.prototype.setInputAction=function(e,t,n){let i=dj(t,n);this._inputEvents[i]=e};Sh.prototype.getInputAction=function(e,t){let n=dj(e,t);return this._inputEvents[n]};Sh.prototype.removeInputAction=function(e,t){let n=dj(e,t);delete this._inputEvents[n]};Sh.prototype.isDestroyed=function(){return!1};Sh.prototype.destroy=function(){return Drt(this),me(this)};Sh.mouseEmulationIgnoreMilliseconds=800;Sh.touchHoldDelayMilliseconds=1500;var Bd=Sh;var C1i=T(S(),1);function Jrt(e,t,n,i,o,r,s){let a=Zi.numberOfPoints(e,t,o),c,d=n.red,u=n.green,m=n.blue,p=n.alpha,g=i.red,f=i.green,x=i.blue,_=i.alpha;if(Y.equals(n,i)){for(c=0;c<a;c++)r[s++]=Y.floatToByte(d),r[s++]=Y.floatToByte(u),r[s++]=Y.floatToByte(m),r[s++]=Y.floatToByte(p);return s}let C=(g-d)/a,V=(f-u)/a,L=(x-m)/a,Z=(_-p)/a,E=s;for(c=0;c<a;c++)r[E++]=Y.floatToByte(d+c*C),r[E++]=Y.floatToByte(u+c*V),r[E++]=Y.floatToByte(m+c*L),r[E++]=Y.floatToByte(p+c*Z);return E}function cw(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.colors,i=y(e.colorsPerVertex,!1);this._positions=t,this._colors=n,this._colorsPerVertex=i,this._arcType=y(e.arcType,en.GEODESIC),this._granularity=y(e.granularity,W.RADIANS_PER_DEGREE),this._ellipsoid=y(e.ellipsoid,ne.default),this._workerName="createSimplePolylineGeometry";let o=1+t.length*h.packedLength;o+=l(n)?1+n.length*Y.packedLength:1,this.packedLength=o+ne.packedLength+3}cw.pack=function(e,t,n){n=y(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+=Y.packedLength)Y.pack(s[i],t,n);return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};cw.unpack=function(e,t,n){t=y(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+=Y.packedLength)s[i]=Y.unpack(e,t);let a=ne.unpack(e,t);t+=ne.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 cw({positions:r,colors:s,ellipsoid:a,colorsPerVertex:c,arcType:d,granularity:u})};var _D=new Array(2),TD=new Array(2),Qrt={positions:_D,height:TD,ellipsoid:void 0,minDistance:void 0,granularity:void 0};cw.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,g,f,x=0;if(o===en.GEODESIC||o===en.RHUMB){let Z,E,X;o===en.GEODESIC?(Z=W.chordLength(r,s.maximumRadius),E=Zi.numberOfPoints,X=Zi.generateArc):(Z=r,E=Zi.numberOfPointsRhumbLine,X=Zi.generateRhumbArc);let v=Zi.extractHeights(t,s),P=Qrt;if(o===en.GEODESIC?P.minDistance=a:P.granularity=r,P.ellipsoid=s,c){let A=0;for(d=0;d<u-1;d++)A+=E(t[d],t[d+1],Z)+1;m=new Float64Array(A*3),g=new Uint8Array(A*4),P.positions=_D,P.height=TD;let M=0;for(d=0;d<u-1;++d){_D[0]=t[d],_D[1]=t[d+1],TD[0]=v[d],TD[1]=v[d+1];let b=X(P);if(l(n)){let R=b.length/3;f=n[d];for(let G=0;G<R;++G)g[M++]=Y.floatToByte(f.red),g[M++]=Y.floatToByte(f.green),g[M++]=Y.floatToByte(f.blue),g[M++]=Y.floatToByte(f.alpha)}m.set(b,x),x+=b.length}}else if(P.positions=t,P.height=v,m=new Float64Array(X(P)),l(n)){for(g=new Uint8Array(m.length/3*4),d=0;d<u-1;++d){let M=t[d],b=t[d+1],R=n[d],G=n[d+1];x=Jrt(M,b,R,G,a,g,x)}let A=n[u-1];g[x++]=Y.floatToByte(A.red),g[x++]=Y.floatToByte(A.green),g[x++]=Y.floatToByte(A.blue),g[x++]=Y.floatToByte(A.alpha)}}else{p=c?u*2-2:u,m=new Float64Array(p*3),g=l(n)?new Uint8Array(p*4):void 0;let Z=0,E=0;for(d=0;d<u;++d){let X=t[d];if(c&&d>0&&(h.pack(X,m,Z),Z+=3,f=n[d-1],g[E++]=Y.floatToByte(f.red),g[E++]=Y.floatToByte(f.green),g[E++]=Y.floatToByte(f.blue),g[E++]=Y.floatToByte(f.alpha)),c&&d===u-1)break;h.pack(X,m,Z),Z+=3,l(n)&&(f=n[d],g[E++]=Y.floatToByte(f.red),g[E++]=Y.floatToByte(f.green),g[E++]=Y.floatToByte(f.blue),g[E++]=Y.floatToByte(f.alpha))}}let _=new mn;_.position=new Ge({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:m}),l(n)&&(_.color=new Ge({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:4,values:g,normalize:!0})),p=m.length/3;let C=(p-1)*2,V=Ae.createTypedArray(p,C),L=0;for(d=0;d<p-1;++d)V[L++]=d,V[L++]=d+1;return new ht({attributes:_,indices:V,primitiveType:Fe.LINES,boundingSphere:ce.fromPoints(t)})};var hj=cw;var X1i=T(S(),1);function vV(e){let t=y(e.radius,1),i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new Us(i),this._workerName="createSphereGeometry"}vV.packedLength=Us.packedLength;vV.pack=function(e,t,n){return Us.pack(e._ellipsoidGeometry,t,n)};var jrt=new Us,xy={radius:void 0,radii:new h,vertexFormat:new Pe,stackPartitions:void 0,slicePartitions:void 0};vV.unpack=function(e,t,n){let i=Us.unpack(e,t,jrt);return xy.vertexFormat=Pe.clone(i._vertexFormat,xy.vertexFormat),xy.stackPartitions=i._stackPartitions,xy.slicePartitions=i._slicePartitions,l(n)?(h.clone(i._radii,xy.radii),n._ellipsoidGeometry=new Us(xy),n):(xy.radius=i._radii.x,new vV(xy))};vV.createGeometry=function(e){return Us.createGeometry(e._ellipsoidGeometry)};var fj=vV;var W1i=T(S(),1),qrt={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},gn=qrt;var w1i=T(S(),1);function _y(e){}Object.defineProperties(_y.prototype,{ellipsoid:{get:pe.throwInstantiationError},rectangle:{get:pe.throwInstantiationError},projection:{get:pe.throwInstantiationError}});_y.prototype.getNumberOfXTilesAtLevel=pe.throwInstantiationError;_y.prototype.getNumberOfYTilesAtLevel=pe.throwInstantiationError;_y.prototype.rectangleToNativeRectangle=pe.throwInstantiationError;_y.prototype.tileXYToNativeRectangle=pe.throwInstantiationError;_y.prototype.tileXYToRectangle=pe.throwInstantiationError;_y.prototype.positionToTileXY=pe.throwInstantiationError;var pj=_y;var j1i=T(S(),1);function $rt(e,t){this.rectangle=e,this.maxLevel=t}function Vge(e){this.ellipsoid=y(e.ellipsoid,ne.default),this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}Vge.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 est(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new Di({ellipsoid:e.ellipsoid});else throw new ue(`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=Qr.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 $rt(new ae(a,c,d,u),m))}}function tst(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i=`${i}: ${t.message}`),Zo.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new ue(i)}async function nst(e,t,n){try{let i=await t.fetchXML();est(e,i)}catch(i){tst(t,i,n)}}function Ty(e){e=y(e,y.EMPTY_OBJECT),this._errorEvent=new be,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 Rt(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[]}Object.defineProperties(Ty.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(){}}});Ty.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=new Vge(t),i=Ee.createIfNeeded(e);await nst(n,i);let o=new Ty(t);return n.build(o),o._resource=i,o};Ty.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 Fa({buffer:hm(c),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:ist(a,e,t,n),structure:a._terrainDataStructure})})};Ty.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var Lge=new ae;function ist(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=ae.intersection(u,s,Lge);l(m)&&(SD(o,u,t*2,n*2,i+1)&&(a|=4),SD(o,u,t*2+1,n*2,i+1)&&(a|=8),SD(o,u,t*2,n*2+1,i+1)&&(a|=1),SD(o,u,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function SD(e,t,n,i,o){let r=e.tileXYToRectangle(n,i,o);return l(ae.intersection(r,t,Lge))}Ty.prototype.getTileDataAvailable=function(e,t,n){};Ty.prototype.loadTileDataAvailability=function(e,t,n){};var bj=Ty;var oVi=T(S(),1);function VT(e){e=y(e,y.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=y(e.epoch,De.MINIMUM_VALUE),this.tolerance=y(e.tolerance,1),this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(VT.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(VT.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=ost(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});VT.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,me(this)};VT.prototype.isDestroyed=function(){return!1};VT.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};VT.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=y(this.epoch,De.MINIMUM_VALUE),s=q.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?y(this.tolerance,1):.001;Math.abs(c-d)>u&&(this._seeking=!0,t.currentTime=c)};function ost(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var gj=VT;var sVi=T(S(),1),rst={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},yj=Object.freeze(rst);var dVi=T(S(),1);function sst(e){return e=y(e,y.EMPTY_OBJECT),gT.fromIonAssetId(2426648,{requestVertexNormals:y(e.requestVertexNormals,!1)})}var lw=sst;var pVi=T(S(),1);function ast(e){return e=y(e,y.EMPTY_OBJECT),gT.fromIonAssetId(1,{requestVertexNormals:y(e.requestVertexNormals,!1),requestWaterMask:y(e.requestWaterMask,!1),ellipsoid:ne.WGS84})}var LT=ast;var yVi=T(S(),1);var cst=1953029805,lst=2917034100;function xj(e,t){if(xj.passThroughDataForTesting)return t;let n=e.byteLength;if(n===0||n%4!==0)throw new ue("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===cst||o===lst)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 dw=xj;var _Vi=T(S(),1);function dst(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 uw=dst;var SVi=T(S(),1);var _j=[],Tj=[];function ust(e,t,n,i,o,r){let s=o-i+1,a=r-o,c=_j,d=Tj,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 g=c[u],f=d[m];u<s&&(m>=a||t(g,f,n)<=0)?(e[p]=g,++u):m<a&&(e[p]=f,++m)}}function Sj(e,t,n,i,o){if(i>=o)return;let r=Math.floor((i+o)*.5);Sj(e,t,n,i,r),Sj(e,t,n,r+1,o),ust(e,t,n,i,r,o)}function mst(e,t,n){let i=e.length,o=Math.ceil(i*.5);_j.length=o,Tj.length=o,Sj(e,t,n,0,i-1),_j.length=0,Tj.length=0}var K0=mst;var ZVi=T(S(),1);var hst=new h;function fst(e,t,n,i){let o=mx(e,t,n,i,hst);return l(o)?o.x>0&&o.y>0&&o.z>0:!1}var Cj=fst;var XVi=T(S(),1);async function pst(e,t,n,i){return l(i)||(i=!1),yst(e,t,n,i)}function bst(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(Zge(i)):r=o.then(Zge(i)).catch(xst(i)),e.shift(),t.push(r),!0}function gst(e){return new Promise(function(t){setTimeout(t,e)})}function Vj(e,t,n){return e.length?bst(e,t,n)?Vj(e,t,n):gst(100).then(()=>Vj(e,t,n)):Promise.resolve()}function yst(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 Vj(s,c,i).then(function(){return Promise.all(c).then(function(){return n})})}function Rge(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function Zge(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(!Rge(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];Rge(s,i,n)}}):Promise.resolve()}}function xst(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var mw=pst;var wVi=T(S(),1);var Lj=new D;async function Gge(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,Lj);let p=e.loadTileDataAvailability(Lj.x,Lj.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 mw(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 Gge(e,a,n),t}var RT=Gge;var AVi=T(S(),1);function _st(e){return e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var ZT=_st;var kVi=T(S(),1);function Tst(e){switch(e){case ie.FLOAT:return"float";case ie.FLOAT_VEC2:return"vec2";case ie.FLOAT_VEC3:return"vec3";case ie.FLOAT_VEC4:return"vec4";case ie.FLOAT_MAT2:return"mat2";case ie.FLOAT_MAT3:return"mat3";case ie.FLOAT_MAT4:return"mat4";case ie.SAMPLER_2D:return"sampler2D";case ie.BOOL:return"bool"}}var Rj=Tst;var DVi=T(S(),1);function Sst(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var hw=Sst;var YVi=T(S(),1),wV=`#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 HVi=T(S(),1),J0=`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 KVi=T(S(),1),fw=`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 alphaRoughness, vec3 N)
{
    float alphaRoughnessSquared = alphaRoughness * alphaRoughness;
    float phi = 2.0 * M_PI * xi.x;
    float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (alphaRoughnessSquared - 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;
}

/**
 * Estimate the geometric self-shadowing of the microfacets in a surface,
 * using the Smith Joint GGX visibility function.
 * Note: Vis = G / (4 * NdotL * NdotV)
 * see Eric Heitz. 2014. Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs. Journal of Computer Graphics Techniques, 3
 * see Real-Time Rendering. Page 331 to 336.
 * see https://google.github.io/filament/Filament.md.html#materialsystem/specularbrdf/geometricshadowing(specularg)
 *
 * @param {float} alphaRoughness The roughness of the material, expressed as the square of perceptual roughness.
 * @param {float} NdotL The cosine of the angle between the surface normal and the direction to the light source.
 * @param {float} NdotV The cosine of the angle between the surface normal and the direction to the camera.
 */
float smithVisibilityGGX(float alphaRoughness, float NdotL, float NdotV)
{
    float alphaRoughnessSq = alphaRoughness * alphaRoughness;

    float GGXV = NdotL * sqrt(NdotV * NdotV * (1.0 - alphaRoughnessSq) + alphaRoughnessSq);
    float GGXL = NdotV * sqrt(NdotL * NdotL * (1.0 - alphaRoughnessSq) + alphaRoughnessSq);

    float GGX = GGXV + GGXL; // 2.0 if NdotL = NdotV = 1.0
    if (GGX > 0.0)
    {
        return 0.5 / GGX; // 1/4 if NdotL = NdotV = 1.0
    }
    return 0.0;
}

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;
    float alphaRoughness = roughness * roughness;
    for (int i = 0; i < NumSamples; i++)
    {
        vec2 xi = hammersley2D(i, NumSamples);
        vec3 H = importanceSampleGGX(xi, alphaRoughness, 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 = smithVisibilityGGX(alphaRoughness, NdotL, NdotV);
            float G_Vis = 4.0 * G * VdotH * NdotL / NdotH;
            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 QVi=T(S(),1),pw=`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 qVi=T(S(),1),bw=`#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 eLi=T(S(),1),gw=`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 nLi=T(S(),1),yw=`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 oLi=T(S(),1),xw=`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 sLi=T(S(),1),_w=`/**
 * 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 cLi=T(S(),1),Tw=`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 dLi=T(S(),1),Sw=`in vec4 position;

out vec4 positionEC;

void main()
{
    positionEC = czm_modelView * position;
    gl_Position = czm_projection * positionEC;

    czm_vertexLogDepth();
}
`;var mLi=T(S(),1),FV=`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_ellipsoidTextureCoordinates(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 fLi=T(S(),1),AV=`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 bLi=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 Cw=`/**
 * @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 yLi=T(S(),1),Vw=`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

#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

#if defined(HAS_WATER_MASK) && (defined(SHOW_REFLECTIVE_OCEAN) || defined(APPLY_MATERIAL))
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

#ifdef ENABLE_CLIPPING_POLYGONS
uniform highp sampler2D u_clippingDistance;
in vec2 v_clippingPosition;
flat in int v_regionIndex;
#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

#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

#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,
    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 = czm_maximumComponent(colorDiff);
    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

    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));
}

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()
{
#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

#if defined(HAS_WATER_MASK) && (defined(SHOW_REFLECTIVE_OCEAN) || defined(APPLY_MATERIAL))
    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;

    #ifdef SHOW_REFLECTIVE_OCEAN
    if (mask > 0.0)
    {
        mat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC);

        vec2 ellipsoidTextureCoordinates = czm_ellipsoidTextureCoordinates(normalMC);
        vec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidTextureCoordinates(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
#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;
    #ifdef HAS_WATER_MASK
        materialInput.waterMask = mask;
    #endif

    czm_material material = czm_getMaterial(materialInput);
    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 ENABLE_CLIPPING_POLYGONS
    vec2 clippingPosition = v_clippingPosition;
    int regionIndex = v_regionIndex;
    clipPolygons(u_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex);
#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_pbrNeutralTonemapping(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

    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 _Li=T(S(),1),Lw=`#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

#ifdef ENABLE_CLIPPING_POLYGONS
uniform highp sampler2D u_clippingExtents;
out vec2 v_clippingPosition;
flat out int v_regionIndex;
#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

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

    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

#ifdef ENABLE_CLIPPING_POLYGONS
    vec2 sphericalLatLong = czm_approximateSphericalCoordinates(position3DWC);
    sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi);
    
    vec2 minDistance = vec2(czm_infinity);
    v_clippingPosition = vec2(czm_infinity);
    v_regionIndex = -1;

    for (int regionIndex = 0; regionIndex < CLIPPING_POLYGON_REGIONS_LENGTH; regionIndex++) {
        vec4 extents = unpackClippingExtents(u_clippingExtents, regionIndex);
        vec2 rectUv = (sphericalLatLong.yx - extents.yx) * extents.wz;

        vec2 clamped = clamp(rectUv, vec2(0.0), vec2(1.0));
        vec2 distance = abs(rectUv - clamped) * extents.wz;

        float threshold = 0.01;
        if (minDistance.x > distance.x || minDistance.y > distance.y) {
            minDistance = distance;
            v_clippingPosition = rectUv;
            if (rectUv.x > threshold && rectUv.y > threshold && rectUv.x < 1.0 - threshold && rectUv.y < 1.0 - threshold) {
                v_regionIndex = regionIndex;
            }
        }
    }
#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 SLi=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 VLi=T(S(),1),Rw=`uniform sampler2D u_texture;

in vec2 v_textureCoordinates;

void main()
{
    out_FragColor = texture(u_texture, v_textureCoordinates);
}
`;var RLi=T(S(),1),Zw=`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 GLi=T(S(),1),NV=`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 XLi=T(S(),1),Gw=`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_pbrNeutralTonemapping(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 WLi=T(S(),1),Ew=`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 vLi=T(S(),1),Xw=`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 FLi=T(S(),1),Iw=`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 MLi=T(S(),1),Ww=`uniform sampler2D u_texture;

in vec2 v_textureCoordinates;

void main()
{
    vec4 color = texture(u_texture, v_textureCoordinates);
    out_FragColor = czm_gammaCorrect(color);
}
`;var kLi=T(S(),1),Pw=`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 DLi=T(S(),1),vw=`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 YLi=T(S(),1),ww=`
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 HLi=T(S(),1),Cst={SATELLITE:1,OCEANS:2,HILLSHADE:3},Ch=Object.freeze(Cst);var vRi=T(S(),1);var jLi=T(S(),1);var Zj,Ege="AAPTxy8BH1VEsoebNVZXo8HurEOF051kAEKlhkOhBEc9BmSXu8_pRnGhnW6yZLct-ukUzbJaZRAVfnmUrxDcAu_FaFDIC3M57EwfRm_DuTw9D5oHdLBTYIMD3tpUeFsNDjHHqar5fb1FGIN9KIV1Gk64dNBmhHhuOHY8cq2IhI0XFLj2qnAlqtKnM-lLsO6JpHuHPVD799V1o9VFm9vMW6a66vEi8-e--2QzKQecPYiaq98.AT1_p4pHwb3n",kV={};kV.defaultAccessToken=Ege;kV.defaultWorldImageryServer=new Ee({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});kV.defaultWorldHillshadeServer=new Ee({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});kV.defaultWorldOceanServer=new Ee({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});kV.getDefaultTokenCredit=function(e){if(e===Ege){if(!l(Zj)){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>';Zj=new Rt(t,!0)}return Zj}};var Yd=kV;var iRi=T(S(),1);function Gj(e){e=y(e,y.EMPTY_OBJECT),this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=Ee.createIfNeeded(e.missingImageUrl),n=this;function i(r){l(r.blob)&&(n._missingImageByteLength=r.blob.size);let s=hm(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],g=p.x*4+p.y*c;s[g+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)}Gj.prototype.isReady=function(){return this._isReady};Gj.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=hm(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 Fw=Gj;var sRi=T(S(),1);function Ej(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}Ej.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])};Ej.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 Vh=Ej;var mRi=T(S(),1);function UV(){pe.throwInstantiationError()}Object.defineProperties(UV.prototype,{rectangle:{get:pe.throwInstantiationError},tileWidth:{get:pe.throwInstantiationError},tileHeight:{get:pe.throwInstantiationError},maximumLevel:{get:pe.throwInstantiationError},minimumLevel:{get:pe.throwInstantiationError},tilingScheme:{get:pe.throwInstantiationError},tileDiscardPolicy:{get:pe.throwInstantiationError},errorEvent:{get:pe.throwInstantiationError},credit:{get:pe.throwInstantiationError},proxy:{get:pe.throwInstantiationError},hasAlphaChannel:{get:pe.throwInstantiationError}});UV.prototype.getTileCredits=function(e,t,n){pe.throwInstantiationError()};UV.prototype.requestImage=function(e,t,n,i){pe.throwInstantiationError()};UV.prototype.pickFeatures=function(e,t,n,i,o){pe.throwInstantiationError()};var Vst=/\.ktx2$/i;UV.loadImage=function(e,t){let n=Ee.createIfNeeded(t);return Vst.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 il=UV;function Xge(e){this.useTiles=y(e.usePreCachedTilesIfAvailable,!0);let t=e.ellipsoid;this.tilingScheme=y(e.tilingScheme,new Di({ellipsoid:t})),this.rectangle=y(e.rectangle,this.tilingScheme.rectangle),this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new Rt(n)),this.credit=n,this.tileCredits=void 0,this.tileDiscardPolicy=e.tileDiscardPolicy,this.tileWidth=y(e.tileWidth,256),this.tileHeight=y(e.tileHeight,256),this.maximumLevel=e.maximumLevel}Xge.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 Fw({missingImageUrl:Ige(e,0,0,this.maximumLevel).url,pixelsToCheck:[new D(0,0),new D(200,20),new D(20,200),new D(80,110),new D(160,130)],disableCheckIfAllPixelsAreTransparent:!0}))};function Lst(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 Di({ellipsoid:t.ellipsoid});else{let i=`Tile spatial reference WKID ${e.tileInfo.spatialReference.wkid} is not supported.`;throw new ue(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 Ri,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 ae(r.longitude,r.latitude,s.longitude,s.latitude)}else if(e.fullExtent.spatialReference.wkid===4326)t.rectangle=ae.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 ue(i)}}else t.rectangle=t.tilingScheme.rectangle;t.useTiles=!0}l(e.copyrightText)&&e.copyrightText.length>0&&(l(t.credit)?t.tileCredits=[new Rt(e.copyrightText)]:t.credit=new Rt(e.copyrightText))}function Rst(e,t){let n=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(n+=`: ${t.message}`),new ue(n)}async function Zst(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();Lst(i,t)}catch(i){Rst(e,i)}}function kf(e){e=y(e,y.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=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._maximumLevel=e.maximumLevel,this._tilingScheme=y(e.tilingScheme,new Di({ellipsoid:e.ellipsoid})),this._useTiles=y(e.usePreCachedTilesIfAvailable,!0),this._rectangle=y(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 Rt(t)),this.enablePickFeatures=y(e.enablePickFeatures,!0),this._errorEvent=new be}kf.fromBasemapType=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n,i,o;switch(e){case Ch.SATELLITE:{n=y(t.token,Yd.defaultAccessToken),i=Ee.createIfNeeded(Yd.defaultWorldImageryServer),i.appendForwardSlash();let r=Yd.getDefaultTokenCredit(n);l(r)&&(o=Rt.clone(r))}break;case Ch.OCEANS:{n=y(t.token,Yd.defaultAccessToken),i=Ee.createIfNeeded(Yd.defaultWorldOceanServer),i.appendForwardSlash();let r=Yd.getDefaultTokenCredit(n);l(r)&&(o=Rt.clone(r))}break;case Ch.HILLSHADE:{n=y(t.token,Yd.defaultAccessToken),i=Ee.createIfNeeded(Yd.defaultWorldHillshadeServer),i.appendForwardSlash();let r=Yd.getDefaultTokenCredit(n);l(r)&&(o=Rt.clone(r))}break;default:}return kf.fromUrl(i,{...t,token:n,credit:o,usePreCachedTilesIfAvailable:!0})};function Ige(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 Li?(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(kf.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}}});kf.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Ee.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&n.setQueryParameters({token:t.token});let i=new kf(t);i._resource=n;let o=new Xge(t);return y(t.usePreCachedTilesIfAvailable,!0)&&await Zst(n,o),o.build(i),i};kf.prototype.getTileCredits=function(e,t,n){return this._tileCredits};kf.prototype.requestImage=function(e,t,n,i){return il.loadImage(this,Ige(this,e,t,n,i))};kf.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 Li)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 g=[],f=p.results;if(!l(f))return g;for(let x=0;x<f.length;++x){let _=f[x],C=new Vh;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 Ri;C.position=L.unproject(new h(_.geometry.x,_.geometry.y,_.geometry.z))}}g.push(C)}return g})};kf._metadataCache={};var Q0=kf;var kRi=T(S(),1);var FRi=T(S(),1),Aw={NONE:0,SCENE_LIGHT:1,SUNLIGHT:2};Aw.fromGlobeFlags=function(e){return e.enableLighting&&e.dynamicAtmosphereLighting?e.dynamicAtmosphereLightingFromSun?Aw.SUNLIGHT:Aw.SCENE_LIGHT:Aw.NONE};var GT=Object.freeze(Aw);function Gst(){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=GT.NONE}var Mw=Gst;var JRi=T(S(),1);function ET(){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 hi,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new D,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(ET.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 Wge(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 Est(e,t){Wge(e);let n=e._width,i=e._height,o=t.halfFloatingPointTexture?nt.HALF_FLOAT:nt.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 hi,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 Pge(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 Xst(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 Ist(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 Wst(e,t){Pge(e);let n=e._framebuffers,i=n.length,o=new Array(i);for(let r=0;r<i;++r)o[r]=t.createViewportQuadCommand(Ist(r,i),{framebuffer:n[r].framebuffer,uniformMap:Xst(e,r)});e._commands=o}ET.prototype.clear=function(e){let t=this._framebuffers;if(!l(t))return;let n=this._clearCommand;l(n)||(n=this._clearCommand=new ei({color:new Y(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let o=0;o<i;++o)t[o].clear(e,n)};ET.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,Est(this,e),Wst(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};ET.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)};ET.prototype.isDestroyed=function(){return!1};ET.prototype.destroy=function(){return Wge(this),Pge(this),me(this)};var Nw=ET;var bZi=T(S(),1);var jRi=T(S(),1),Pst={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"},DV=Object.freeze(Pst);var eZi=T(S(),1);function kw(e){}kw.prototype.isReady=function(){return!0};kw.prototype.shouldDiscardImage=function(e){return kw.EMPTY_IMAGE===e};var CD;Object.defineProperties(kw,{EMPTY_IMAGE:{get:function(){return l(CD)||(CD=new Image,CD.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),CD}}});var BV=kw;function vge(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}vge.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 Rt)break;o.credit=new Rt(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 ae(W.toRadians(d[1]),W.toRadians(d[0]),W.toRadians(d[3]),W.toRadians(d[2]))}}};function vst(e,t){if(e.resourceSets.length!==1)throw new ue("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;let i=n.imageryProviders;l(n.imageryProviders)&&(i=n.imageryProviders.filter(o=>o.coverageAreas?.some(r=>l(r.bbox)))),t.attributionList=i}function wst(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),Zo.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new ue(i)}async function Fst(e,t,n){let i=e.url,o=Ls._metadataCache[i];l(o)||(o=e.fetchJsonp("jsonp"),Ls._metadataCache[i]=o);try{let r=await o;return vst(r,t)}catch(r){wst(e,r,n)}}function Ls(e){e=y(e,y.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=y(e.mapStyle,DV.AERIAL),this._mapLayer=e.mapLayer,this._culture=y(e.culture,""),this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new BV),this._proxy=e.proxy,this._credit=new Rt(`<a href="https://www.microsoft.com/en-us/maps/product/enduserterms"><img src="${Ls.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 be}Object.defineProperties(Ls.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)}}});Ls.fromUrl=async function(e,t){t=y(t,y.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=y(t.mapStyle,DV.AERIAL),o=Ee.createIfNeeded(e);o.appendForwardSlash();let r={incl:"ImageryProviders",key:t.key,uriScheme:n};l(t.mapLayer)&&(r.mapLayer=t.mapLayer),l(t.culture)&&(r.culture=t.culture);let s=o.getDerivedResource({url:`REST/v1/Imagery/Metadata/${i}`,queryParameters:r}),a=new Ls(t);a._resource=o;let c=new vge(t);return await Fst(s,c),c.build(a),a};var Ast=new ae;Ls.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,Ast);return kst(this._attributionList,n,i)};Ls.prototype.requestImage=function(e,t,n,i){let o=il.loadImage(this,Mst(this,e,t,n,i));if(l(o))return o.catch(function(r){return l(r.blob)&&r.blob.size===0?BV.EMPTY_IMAGE:Promise.reject(r)})};Ls.prototype.pickFeatures=function(e,t,n,i,o){};Ls.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};Ls.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}};Ls._logoUrl=void 0;Object.defineProperties(Ls,{logoUrl:{get:function(){return l(Ls._logoUrl)||(Ls._logoUrl=nn("Assets/Images/bing_maps_credit.png")),Ls._logoUrl},set:function(e){Ls._logoUrl=e}}});function Mst(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:Ls.tileXYToQuadKey(t,n,i),subdomain:s[a],culture:e._culture},queryParameters:{n:"z"}})}var Nst=new ae;function kst(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=ae.intersection(n,m.bbox,Nst);l(p)&&(c=!0)}}c&&i.push(s.credit)}return i}Ls._metadataCache={};var Uw=Ls;var TZi=T(S(),1);var Ust=new h(1,1,1);function Xj(e){e=y(e,Ust),this._dimensions=h.clone(e)}Object.defineProperties(Xj.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){h.clone(e,this._dimensions)}}});var Dst=new h;Xj.prototype.emit=function(e){let t=this._dimensions,n=h.multiplyByScalar(t,.5,Dst),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 Ij=Xj;var PZi=T(S(),1);function Dw(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(Dw.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function Bst(e,t,n){let i=t.createViewportQuadCommand(fw,{framebuffer:n,renderState:Ue.fromCache({viewport:new Ke(0,0,256,256)})});e._drawCommand=i}Dw.prototype.update=function(e){if(!l(this._colorTexture)){let t=e.context,n=new Ft({context:t,width:256,height:256,pixelFormat:at.RGBA,pixelDatatype:nt.UNSIGNED_BYTE,sampler:$t.NEAREST});this._colorTexture=n;let i=new js({context:t,colorTextures:[n],destroyAttachments:!1});Bst(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};Dw.prototype.isDestroyed=function(){return!1};Dw.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),me(this)};var Bw=Dw;var CGi=T(S(),1);var OZi=T(S(),1);var Mge={};function Yst(e,t,n){let i,o,r;if(e instanceof Vi){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 Ost=new h,wge=new h;function Nge(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 Pj(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,Ost),g=h.magnitude(h.multiplyByScalar(d,h.dot(p,d),wge)),f=h.magnitude(h.multiplyByScalar(u,h.dot(p,u),wge));r=Math.min(Yst(m,g,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 Yw(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 kge=new h;function Hst(e,t,n,i,o,r,s,a){let c=e.camera,d=h.clone(c.position,kge),u=c.pitch,m=Yw(c.heading,i),p=Yw(c.roll,r),g=Pj(c,n,d.z,n.z,s),f=Nge(u,o,g,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)}}),D.lerp(d,n,C,c.position),c.position.z=g(C)}return x}function zst(e,t){e.longitude<t.longitude?e.longitude+=W.TWO_PI:t.longitude+=W.TWO_PI}function Kst(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 Jst=new he,Qst=new he;function jst(e,t,n,i,o,r,s,a,c,d){let u=e.camera,p=e.mapProjection.ellipsoid,g=he.clone(u.positionCartographic,Jst),f=u.pitch,x=Yw(u.heading,i),_=Yw(u.roll,r),C=p.cartesianToCartographic(n,Qst);g.longitude=W.zeroToTwoPi(g.longitude),C.longitude=W.zeroToTwoPi(C.longitude);let V=!1;if(l(a)){let X=W.zeroToTwoPi(a),v=Math.min(g.longitude,C.longitude),P=Math.max(g.longitude,C.longitude),A=X>=v&&X<=P;if(l(c)){let M=Math.abs(g.longitude-C.longitude),b=W.TWO_PI-M;(A?M:b)<(A?b:M)*c&&!A&&(V=!0)}else A||(V=!0)}V?zst(g,C):Kst(g,C);let L=Pj(u,n,g.height,C.height,s),Z=Nge(f,o,L,d);function E(){let X=g.longitude,v=C.longitude,P=g.latitude,A=C.latitude;return function(b){let R=b.time/t,G=h.fromRadians(W.lerp(X,v,R),W.lerp(P,A,R),L(R),p);u.setView({destination:G,orientation:{heading:W.lerp(x,i,R),pitch:Z(R),roll:W.lerp(_,r,R)}})}}return E()}function qst(e,t,n,i,o,r,s){let a=e.camera,c=h.clone(a.position,kge),d=Yw(a.heading,i),u=a.frustum.right-a.frustum.left,m=Pj(a,n,u,n.z,s);function p(g){let f=g.time/t;a.setView({orientation:{heading:W.lerp(d,i,f)}}),D.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 Fge=new he,$st=new h;function Wj(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function Age(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}Mge.createTween=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.destination,i=e.mode;if(i===oe.MORPHING)return Wj();let o=y(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!==oe.SCENE3D&&(s.cartesianToCartographic(n,Fge),n=r.project(Fge,$st));let p=e.camera,g=t.endTransform;l(g)&&p._setTransform(g);let f=t.duration;l(f)||(f=Math.ceil(h.distance(p.position,n)/1e6)+2,f=Math.min(f,3));let x=y(t.heading,0),_=y(t.pitch,-W.PI_OVER_TWO),C=y(t.roll,0),V=e.screenSpaceCameraController;V.enableInputs=!1;let L=Age(V,t.complete),Z=Age(V,t.cancel),E=p.frustum,X=e.mode===oe.SCENE2D;if(X=X&&D.equalsEpsilon(p.position,n,W.EPSILON6),X=X&&W.equalsEpsilon(Math.max(E.right-E.left,E.top-E.bottom),n.z,W.EPSILON6),X=X||e.mode!==oe.SCENE2D&&h.equalsEpsilon(n,p.position,W.EPSILON10),X=X&&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),X)return Wj(L,Z);let v=new Array(4);if(v[oe.SCENE2D]=qst,v[oe.SCENE3D]=jst,v[oe.COLUMBUS_VIEW]=Hst,f<=0)return Wj(function(){v[i](e,1,n,x,_,C,a,c,d,u)({time:1}),typeof L=="function"&&L()},Z);let P=v[i](e,f,n,x,_,C,a,c,d,u);if(!l(m)){let A=p.positionCartographic.height,M=i===oe.SCENE3D?s.cartesianToCartographic(n).height:n.z;A>M&&A>11500?m=kr.CUBIC_OUT:m=kr.QUINTIC_IN_OUT}return{duration:f,easingFunction:m,startObject:{time:0},stopObject:{time:f},update:P,complete:L,cancel:Z}};var Ow=Mge;var zZi=T(S(),1),eat={ROTATE:0,INFINITE_SCROLL:1},Hl=Object.freeze(eat);function tn(e){this._scene=e,this._transform=F.clone(F.IDENTITY),this._invTransform=F.clone(F.IDENTITY),this._actualTransform=F.clone(F.IDENTITY),this._actualInvTransform=F.clone(F.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 Vi,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 be,this._moveEnd=new be,this._changed=new be,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this._changedHeading=void 0,this._changedRoll=void 0,this.percentageChanged=.5,this._viewMatrix=new F,this._invViewMatrix=new F,Kge(this),this._mode=oe.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,sye(this,tn.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=h.magnitude(this.position);n+=n*tn.DEFAULT_VIEW_FACTOR,h.normalize(this.position,this.position),h.multiplyByScalar(this.position,n,this.position)}tn.TRANSFORM_2D=new F(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);tn.TRANSFORM_2D_INVERSE=F.inverseTransformation(tn.TRANSFORM_2D,new F);tn.DEFAULT_VIEW_RECTANGLE=ae.fromDegrees(-95,-20,-70,90);tn.DEFAULT_VIEW_FACTOR=.5;tn.DEFAULT_OFFSET=new Hu(0,-W.PI_OVER_FOUR,0);function Kge(e){F.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),F.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),F.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function tat(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=_i()):e.timeSinceMoved=Math.max(_i()-e._lastMovedTimestamp,0)/1e3}}tn.prototype.canPreloadFlight=function(){return l(this._currentFlight)&&this._mode!==oe.SCENE2D};tn.prototype._updateCameraChanged=function(){let e=this;if(tat(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;o>t&&(e._changedHeading=n);let r=e.roll;l(e._changedRoll)||(e._changedRoll=r);let s=Math.abs(e._changedRoll-r)%W.TWO_PI;s=s>W.PI?W.TWO_PI-s:s;let a=s/Math.PI;if(a>t&&(e._changedRoll=r),(a>t||o>t)&&e._changed.raiseEvent(Math.max(a,o)),e._mode===oe.SCENE2D){if(!l(e._changedFrustum)){e._changedPosition=h.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let p=e.position,g=e._changedPosition,f=e.frustum,x=e._changedFrustum,_=p.x+f.left,C=p.x+f.right,V=g.x+x.left,L=g.x+x.right,Z=p.y+f.bottom,E=p.y+f.top,X=g.y+x.bottom,v=g.y+x.top,P=Math.max(_,V),A=Math.min(C,L),M=Math.max(Z,X),b=Math.min(E,v),R;if(P>=A||M>=E)R=1;else{let G=x;_<V&&C>L&&Z<X&&E>v&&(G=f),R=1-(A-P)*(b-M)/((G.right-G.left)*(G.top-G.bottom))}R>t&&(e._changed.raiseEvent(R),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 c=W.acosClamped(h.dot(e.directionWC,e._changedDirection)),d;l(e.frustum.fovy)?d=c/(e.frustum.fovy*.5):d=c;let m=h.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(d>t||m>t)&&(e._changed.raiseEvent(Math.max(d,m)),e._changedPosition=h.clone(e.positionWC,e._changedPosition),e._changedDirection=h.clone(e.directionWC,e._changedDirection))};function nat(e){wt.basisTo2D(e._projection,e._transform,e._actualTransform)}var iat=new he,oat=new h,VD=new h,rat=new se,sat=new se,aat=new se,cat=new se,lat=new se;function dat(e){let t=e._projection,n=t.ellipsoid,i=F.getColumn(e._transform,3,rat),o=n.cartesianToCartographic(i,iat),r=t.project(o,oat),s=sat;s.x=r.z,s.y=r.x,s.z=r.y,s.w=1;let a=se.clone(se.UNIT_X,lat),c=se.add(F.getColumn(e._transform,0,VD),i,VD);n.cartesianToCartographic(c,o),t.project(o,r);let d=aat;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=cat;if(h.magnitudeSquared(d)>W.EPSILON10)h.cross(a,d,u);else{let m=se.add(F.getColumn(e._transform,1,VD),i,VD);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),F.setColumn(e._actualTransform,0,d,e._actualTransform),F.setColumn(e._actualTransform,1,u,e._actualTransform),F.setColumn(e._actualTransform,2,a,e._actualTransform),F.setColumn(e._actualTransform,3,s,e._actualTransform)}var vj=new h;function Cc(e){let t=e._mode,n=!1,i=0;t===oe.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&&(F.inverseTransformation(e._transform,e._invTransform),e._mode===oe.COLUMBUS_VIEW||e._mode===oe.SCENE2D?F.equals(F.IDENTITY,e._transform)?F.clone(tn.TRANSFORM_2D,e._actualTransform):e._mode===oe.COLUMBUS_VIEW?nat(e):dat(e):F.clone(e._transform,e._actualTransform),F.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let g=e._actualTransform;if(r||p)if(e._positionWC=F.multiplyByPoint(g,o,e._positionWC),t===oe.SCENE3D||t===oe.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let f=vj;f.x=e._positionWC.y,f.y=e._positionWC.z,f.z=e._positionWC.x,t===oe.SCENE2D&&(f.z=i),e._projection.unproject(f,e._positionCartographic)}if(a||d||m){let f=h.dot(s,h.cross(c,u,vj));if(Math.abs(1-f)>W.EPSILON2){let x=1/h.magnitudeSquared(c),_=h.dot(c,s)*x,C=h.multiplyByScalar(s,_,vj);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=F.multiplyByPointAsVector(g,s,e._directionWC),h.normalize(e._directionWC,e._directionWC)),(d||p)&&(e._upWC=F.multiplyByPointAsVector(g,c,e._upWC),h.normalize(e._upWC,e._upWC)),(m||p)&&(e._rightWC=F.multiplyByPointAsVector(g,u,e._rightWC),h.normalize(e._rightWC,e._rightWC)),(r||a||d||m||p)&&Kge(e)}function Jge(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 Qge(e){return W.PI_OVER_TWO-W.acosClamped(e.z)}function jge(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 ZD=new F,GD=new F;Object.defineProperties(tn.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return Cc(this),this._invTransform}},viewMatrix:{get:function(){return Cc(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return Cc(this),this._invViewMatrix}},positionCartographic:{get:function(){return Cc(this),this._positionCartographic}},positionWC:{get:function(){return Cc(this),this._positionWC}},directionWC:{get:function(){return Cc(this),this._directionWC}},upWC:{get:function(){return Cc(this),this._upWC}},rightWC:{get:function(){return Cc(this),this._rightWC}},heading:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=F.clone(this._transform,ZD),n=wt.eastNorthUpToFixedFrame(this.positionWC,e,GD);this._setTransform(n);let i=Jge(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=F.clone(this._transform,ZD),n=wt.eastNorthUpToFixedFrame(this.positionWC,e,GD);this._setTransform(n);let i=Qge(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=F.clone(this._transform,ZD),n=wt.eastNorthUpToFixedFrame(this.positionWC,e,GD);this._setTransform(n);let i=jge(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}}});tn.prototype.update=function(e){let t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==oe.MORPHING,t=this._mode===oe.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===oe.SCENE2D&&tye(this,this.position)};var uat=new h,mat=new h,hat=new h;tn.prototype._setTransform=function(e){let t=h.clone(this.positionWC,uat),n=h.clone(this.upWC,mat),i=h.clone(this.directionWC,hat);F.clone(e,this._transform),this._transformChanged=!0,Cc(this);let o=this._actualInvTransform;F.multiplyByPoint(o,t,this.position),F.multiplyByPointAsVector(o,i,this.direction),F.multiplyByPointAsVector(o,n,this.up),h.cross(this.direction,this.up,this.right),Cc(this)};var fat=new D,pat=new pn,bat=new h,gat=new h;function qge(e){if(!F.equals(F.IDENTITY,e.transform))return h.magnitude(e.position);let t=e._scene,n=t.globe,i=fat;i.x=t.drawingBufferWidth/2,i.y=t.drawingBufferHeight/2;let o;if(l(n)){let a=e.getPickRay(i,pat);o=n.pickWorldCoordinates(a,t,!0,bat)}let r;t.pickPositionSupported&&(r=t.pickPositionWorldCoordinates(i,gat));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}tn.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof sn&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=qge(this)))};var ED=new h,Nj=new F,yat=new F,kj=new we,Uj=new $,$ge=new he;function xat(e,t,n){let i=F.clone(e.transform,Nj),o=wt.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,yat);e._setTransform(o),h.clone(h.ZERO,e.position),n.heading=n.heading-W.PI_OVER_TWO;let r=we.fromHeadingPitchRoll(n,kj),s=$.fromQuaternion(r,Uj);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function _at(e,t,n,i){let o=F.clone(e.transform,Nj);if(e._setTransform(F.IDENTITY),!h.equals(t,e.positionWC)){if(i){let a=e._projection,c=a.ellipsoid.cartesianToCartographic(t,$ge);t=a.project(c,ED)}h.clone(t,e.position)}n.heading=n.heading-W.PI_OVER_TWO;let r=we.fromHeadingPitchRoll(n,kj),s=$.fromQuaternion(r,Uj);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(o),e._adjustOrthographicFrustum(!0)}function Tat(e,t,n,i){let o=F.clone(e.transform,Nj);if(e._setTransform(F.IDENTITY),!h.equals(t,e.positionWC)){if(i){let c=e._projection,d=c.ellipsoid.cartesianToCartographic(t,$ge);t=c.project(d,ED)}D.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===Hl.ROTATE){n.heading=n.heading-W.PI_OVER_TWO,n.pitch=-W.PI_OVER_TWO,n.roll=0;let r=we.fromHeadingPitchRoll(n,kj),s=$.fromQuaternion(r,Uj);$.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right)}e._setTransform(o)}var Sat=new h,Cat=new h,Vat=new h;function eye(e,t,n,i){let o=h.clone(n.direction,Sat),r=h.clone(n.up,Cat);if(e._scene.mode===oe.SCENE3D){let a=e._projection.ellipsoid,c=wt.eastNorthUpToFixedFrame(t,a,ZD),d=F.inverseTransformation(c,GD);F.multiplyByPointAsVector(d,o,o),F.multiplyByPointAsVector(d,r,r)}let s=h.cross(o,r,Vat);return i.heading=Jge(o,r),i.pitch=Qge(o),i.roll=jge(o,r,s),i}var Mj={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},YV=new _a;tn.prototype.setView=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.orientation,y.EMPTY_OBJECT),n=this._mode;if(n===oe.MORPHING)return;l(e.endTransform)&&this._setTransform(e.endTransform);let i=y(e.convert,!0),o=y(e.destination,h.clone(this.positionWC,ED));l(o)&&l(o.west)&&(o=this.getRectangleCameraCoordinates(o,ED),i=!1),l(t.direction)&&(t=eye(this,o,t,Mj.orientation)),YV.heading=y(t.heading,0),YV.pitch=y(t.pitch,-W.PI_OVER_TWO),YV.roll=y(t.roll,0),n===oe.SCENE3D?xat(this,o,YV):n===oe.SCENE2D?Tat(this,o,YV,i):_at(this,o,YV,i)};var Lat=new h;tn.prototype.flyHome=function(e){let t=this._mode;if(t===oe.MORPHING&&this._scene.completeMorph(),t===oe.SCENE2D)this.flyTo({destination:tn.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:F.IDENTITY});else if(t===oe.SCENE3D){let n=this.getRectangleCameraCoordinates(tn.DEFAULT_VIEW_RECTANGLE),i=h.magnitude(n);i+=i*tn.DEFAULT_VIEW_FACTOR,h.normalize(n,n),h.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:F.IDENTITY})}else if(t===oe.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,Lat).z),roll:0},endTransform:F.IDENTITY,convert:!1})}};tn.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new se),Cc(this),F.multiplyByVector(this._actualInvTransform,e,t)};tn.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new h),Cc(this),F.multiplyByPoint(this._actualInvTransform,e,t)};tn.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new h),Cc(this),F.multiplyByPointAsVector(this._actualInvTransform,e,t)};tn.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new se),Cc(this),F.multiplyByVector(this._actualTransform,e,t)};tn.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new h),Cc(this),F.multiplyByPoint(this._actualTransform,e,t)};tn.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new h),Cc(this),F.multiplyByPointAsVector(this._actualTransform,e,t)};function tye(e,t){let n=e._scene.mapMode2D===Hl.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 Uge=new h;tn.prototype.move=function(e,t){let n=this.position;h.multiplyByScalar(e,t,Uge),h.add(n,Uge,n),this._mode===oe.SCENE2D&&tye(this,n),this._adjustOrthographicFrustum(!0)};tn.prototype.moveForward=function(e){e=y(e,this.defaultMoveAmount),this._mode===oe.SCENE2D?XD(this,e):this.move(this.direction,e)};tn.prototype.moveBackward=function(e){e=y(e,this.defaultMoveAmount),this._mode===oe.SCENE2D?XD(this,-e):this.move(this.direction,-e)};tn.prototype.moveUp=function(e){e=y(e,this.defaultMoveAmount),this.move(this.up,e)};tn.prototype.moveDown=function(e){e=y(e,this.defaultMoveAmount),this.move(this.up,-e)};tn.prototype.moveRight=function(e){e=y(e,this.defaultMoveAmount),this.move(this.right,e)};tn.prototype.moveLeft=function(e){e=y(e,this.defaultMoveAmount),this.move(this.right,-e)};tn.prototype.lookLeft=function(e){e=y(e,this.defaultLookAmount),this._mode!==oe.SCENE2D&&this.look(this.up,-e)};tn.prototype.lookRight=function(e){e=y(e,this.defaultLookAmount),this._mode!==oe.SCENE2D&&this.look(this.up,e)};tn.prototype.lookUp=function(e){e=y(e,this.defaultLookAmount),this._mode!==oe.SCENE2D&&this.look(this.right,-e)};tn.prototype.lookDown=function(e){e=y(e,this.defaultLookAmount),this._mode!==oe.SCENE2D&&this.look(this.right,e)};var Rat=new we,Zat=new $;tn.prototype.look=function(e,t){let n=y(t,this.defaultLookAmount),i=we.fromAxisAngle(e,-n,Rat),o=$.fromQuaternion(i,Zat),r=this.direction,s=this.up,a=this.right;$.multiplyByVector(o,r,r),$.multiplyByVector(o,s,s),$.multiplyByVector(o,a,a)};tn.prototype.twistLeft=function(e){e=y(e,this.defaultLookAmount),this.look(this.direction,e)};tn.prototype.twistRight=function(e){e=y(e,this.defaultLookAmount),this.look(this.direction,-e)};var Gat=new we,Eat=new $;tn.prototype.rotate=function(e,t){let n=y(t,this.defaultRotateAmount),i=we.fromAxisAngle(e,-n,Gat),o=$.fromQuaternion(i,Eat);$.multiplyByVector(o,this.position,this.position),$.multiplyByVector(o,this.direction,this.direction),$.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)};tn.prototype.rotateDown=function(e){e=y(e,this.defaultRotateAmount),nye(this,e)};tn.prototype.rotateUp=function(e){e=y(e,this.defaultRotateAmount),nye(this,-e)};var Xat=new h,Iat=new h,Wat=new h,Dge=new h;function nye(e,t){let n=e.position;if(l(e.constrainedAxis)&&!h.equalsEpsilon(e.position,h.ZERO,W.EPSILON2)){let i=h.normalize(n,Xat),o=h.equalsEpsilon(i,e.constrainedAxis,W.EPSILON2),r=h.equalsEpsilon(i,h.negate(e.constrainedAxis,Dge),W.EPSILON2);if(!o&&!r){let s=h.normalize(e.constrainedAxis,Iat),a=h.dot(i,s),c=W.acosClamped(a);t>0&&t>c&&(t=c-W.EPSILON4),a=h.dot(i,h.negate(s,Dge)),c=W.acosClamped(a),t<0&&-t>c&&(t=-c+W.EPSILON4);let d=h.cross(s,i,Wat);e.rotate(d,t)}else(o&&t<0||r&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}tn.prototype.rotateRight=function(e){e=y(e,this.defaultRotateAmount),iye(this,-e)};tn.prototype.rotateLeft=function(e){e=y(e,this.defaultRotateAmount),iye(this,e)};function iye(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function XD(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===Hl.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===Hl.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 oye(e,t){e.move(e.direction,t)}tn.prototype.zoomIn=function(e){e=y(e,this.defaultZoomAmount),this._mode===oe.SCENE2D?XD(this,e):oye(this,e)};tn.prototype.zoomOut=function(e){e=y(e,this.defaultZoomAmount),this._mode===oe.SCENE2D?XD(this,-e):oye(this,-e)};tn.prototype.getMagnitude=function(){if(this._mode===oe.SCENE3D)return h.magnitude(this.position);if(this._mode===oe.COLUMBUS_VIEW)return Math.abs(this.position.z);if(this._mode===oe.SCENE2D)return Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom)};var Pat=new F;tn.prototype.lookAt=function(e,t){let n=this._scene,i=y(n.ellipsoid,ne.default),o=wt.eastNorthUpToFixedFrame(e,i,Pat);this.lookAtTransform(o,t)};var vat=new h,wat=new we,Fat=new we,Aat=new $;function rye(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=we.fromAxisAngle(h.UNIT_Y,-t,wat),o=we.fromAxisAngle(h.UNIT_Z,-e,Fat),r=we.multiply(o,i,o),s=$.fromQuaternion(r,Aat),a=h.clone(h.UNIT_X,vat);return $.multiplyByVector(s,a,a),h.negate(a,a),h.multiplyByScalar(a,n,a),a}tn.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),!l(t))return;let n;if(l(t.heading)?n=rye(t.heading,t.pitch,t.range):n=t,this._mode===oe.SCENE2D){D.clone(D.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(F.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 Hw=new he,Mat=new he,Nat=new h,kat=new h,Uat=new h,Dat=new h,Bat=new h,Yat=new h,Oat=new h,wj=new h,Hat={direction:new h,right:new h,up:new h},Bge;function Sc(e,t,n,i){return Math.abs(h.dot(t,n))/i-h.dot(e,n)}function sye(e,t,n,i){let o=e._projection.ellipsoid,r=i?e:Hat,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 A=Hw;A.longitude=u,A.latitude=s,A.height=0;let M=Mat;M.longitude=u,M.latitude=a,M.height=0;let b=Bge;(!l(b)||b.ellipsoid!==o)&&(Bge=b=new Sp(void 0,void 0,o)),b.setEndPoints(A,M),m=b.interpolateUsingFraction(.5,Hw).latitude}let p=Hw;p.longitude=u,p.latitude=m,p.height=0;let g=o.cartographicToCartesian(p,Oat),f=Hw;f.longitude=c,f.latitude=s;let x=o.cartographicToCartesian(f,Nat);f.longitude=d;let _=o.cartographicToCartesian(f,Uat);f.longitude=u;let C=o.cartographicToCartesian(f,Bat);f.latitude=a;let V=o.cartographicToCartesian(f,Yat);f.longitude=c;let L=o.cartographicToCartesian(f,Dat);f.longitude=d;let Z=o.cartographicToCartesian(f,kat);h.subtract(_,g,_),h.subtract(L,g,L),h.subtract(x,g,x),h.subtract(Z,g,Z),h.subtract(C,g,C),h.subtract(V,g,V);let E=o.geodeticSurfaceNormal(g,r.direction);h.negate(E,E);let X=h.cross(E,h.UNIT_Z,r.right);h.normalize(X,X);let v=h.cross(X,E,r.up),P;if(e.frustum instanceof sn){let A=Math.max(h.distance(x,_),h.distance(L,Z)),M=Math.max(h.distance(x,L),h.distance(_,Z)),b,R,G=e.frustum._offCenterFrustum,I=G.right/G.top,w=M*I;A>w?(b=A,R=b/I):(R=M,b=w),P=Math.max(b,R)}else{let A=Math.tan(e.frustum.fovy*.5),M=e.frustum.aspectRatio*A;if(P=Math.max(Sc(E,v,_,A),Sc(E,v,L,A),Sc(E,v,x,A),Sc(E,v,Z,A),Sc(E,v,C,A),Sc(E,v,V,A),Sc(E,X,_,M),Sc(E,X,L,M),Sc(E,X,x,M),Sc(E,X,Z,M),Sc(E,X,C,M),Sc(E,X,V,M)),a<0&&s>0){let b=Hw;b.longitude=d,b.latitude=0,b.height=0;let R=o.cartographicToCartesian(b,wj);h.subtract(R,g,R),P=Math.max(P,Sc(E,v,R,A),Sc(E,X,R,M)),b.longitude=c,R=o.cartographicToCartesian(b,wj),h.subtract(R,g,R),P=Math.max(P,Sc(E,v,R,A),Sc(E,X,R,M))}}return h.add(g,h.multiplyByScalar(E,-P,wj),n)}var zat=new he,Kat=new h,Jat=new h;function Qat(e,t,n){let i=e._projection;t.west>t.east&&(t=ae.MAX_VALUE);let o=e._actualTransform,r=e._actualInvTransform,s=zat;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,Kat);F.multiplyByPoint(o,a,a),F.multiplyByPoint(r,a,a),s.longitude=t.west,s.latitude=t.south;let c=i.project(s,Jat);if(F.multiplyByPoint(o,c,c),F.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 jat=new he,qat=new h,$at=new h;function ect(e,t,n){let i=e._projection,o=t.east;t.west>t.east&&(e._scene.mapMode2D===Hl.INFINITE_SCROLL?o+=W.TWO_PI:(t=ae.MAX_VALUE,o=t.east));let r=jat;r.longitude=o,r.latitude=t.north;let s=i.project(r,qat);r.longitude=t.west,r.latitude=t.south;let a=i.project(r,$at),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,g=d*p;return c>g?(u=c,m=u/p):(m=d,u=g),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}tn.prototype.getRectangleCameraCoordinates=function(e,t){let n=this._mode;if(l(t)||(t=new h),n===oe.SCENE3D)return sye(this,e,t);if(n===oe.COLUMBUS_VIEW)return Qat(this,e,t);if(n===oe.SCENE2D)return ect(this,e,t)};var tct=new pn;function nct(e,t,n,i){n=y(n,ne.default);let o=e.getPickRay(t,tct),r=qn.rayEllipsoid(o,n);if(!r)return;let s=r.start>0?r.start:r.stop;return pn.getPoint(o,s,i)}var ict=new pn;function oct(e,t,n,i){let r=e.getPickRay(t,ict).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 rct=new pn;function sct(e,t,n,i){let o=e.getPickRay(t,rct),r=-o.origin.x/o.direction.x;pn.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)}tn.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=y(t,ne.default),this._mode===oe.SCENE3D)n=nct(this,e,t,n);else if(this._mode===oe.SCENE2D)n=oct(this,e,this._projection,n);else if(this._mode===oe.COLUMBUS_VIEW)n=sct(this,e,this._projection,n);else return;return n}};var act=new h,cct=new h,lct=new h;function dct(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,act);h.add(m,p,p);let g=h.multiplyByScalar(e.rightWC,d*c*a,cct),f=h.multiplyByScalar(e.upWC,u*c*s,lct),x=h.add(p,g,n.direction);return h.add(x,f,x),h.subtract(x,m,x),h.normalize(x,x),n}var LD=new h;function uct(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,LD),h.add(LD,u,u),h.multiplyByScalar(e.up,d,LD),h.add(LD,u,u),h.clone(e.directionWC,n.direction),(e._mode===oe.COLUMBUS_VIEW||e._mode===oe.SCENE2D)&&h.fromElements(n.origin.z,n.origin.x,n.origin.y,n.origin),n}tn.prototype.getPickRay=function(e,t){l(t)||(t=new pn);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)?dct(this,e,t):uct(this,e,t)};var mct=new h,hct=new h;tn.prototype.distanceToBoundingSphere=function(e){let t=h.subtract(this.positionWC,e.center,mct),n=h.multiplyByScalar(this.directionWC,h.dot(t,this.directionWC),hct);return Math.max(0,h.magnitude(n)-e.radius)};var fct=new D;tn.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),o=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,fct);return Math.max(o.x,o.y)};function pct(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:kr.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:r,update:a}}var bct=new h,Yge=new h,gct=new h,yct=new h;function xct(e,t){let n=e.position,i=e.direction,o=e.worldToCameraCoordinatesVector(h.UNIT_X,bct),r=-h.dot(o,n)/h.dot(o,i),s=h.add(n,h.multiplyByScalar(i,r,Yge),Yge);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,gct);let a=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*a,d=h.magnitude(h.subtract(n,s,yct)),u=c*d,m=a*d,p=e._maxCoord.x,g=e._maxCoord.y,f=Math.max(u-p,p),x=Math.max(m-g,g);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 pct(e,n,s,f,x,t)}}tn.prototype.createCorrectPositionTween=function(e){if(this._mode===oe.COLUMBUS_VIEW)return xct(this,e)};var _ct=new h,Hs={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};tn.prototype.cancelFlight=function(){l(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};tn.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=Hs.destination,e.orientation.heading=Hs.heading,e.orientation.pitch=Hs.pitch,e.orientation.roll=Hs.roll,this.setView(e),l(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};tn.prototype.flyTo=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.destination;if(this._mode===oe.MORPHING)return;this.cancelFlight();let i=t instanceof ae;i&&(t=this.getRectangleCameraCoordinates(t,_ct));let o=y(e.orientation,y.EMPTY_OBJECT);if(l(o.direction)&&(o=eye(this,t,o,Mj.orientation)),l(e.duration)&&e.duration<=0){let u=Mj;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;Hs.destination=t,Hs.heading=o.heading,Hs.pitch=o.pitch,Hs.roll=o.roll,Hs.duration=e.duration,Hs.complete=function(){s===r._currentFlight&&(r._currentFlight=void 0),l(e.complete)&&e.complete()},Hs.cancel=e.cancel,Hs.endTransform=e.endTransform,Hs.convert=i?!1:e.convert,Hs.maximumHeight=e.maximumHeight,Hs.pitchAdjustHeight=e.pitchAdjustHeight,Hs.flyOverLongitude=e.flyOverLongitude,Hs.flyOverLongitudeWeight=e.flyOverLongitudeWeight,Hs.easingFunction=e.easingFunction;let a=this._scene,c=Ow.createTween(a,Hs);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!==oe.SCENE2D&&(l(d)||(d=tn.clone(this)),d.setView({destination:t,orientation:o}),this._scene.preloadFlightCullingVolume=d.frustum.computeCullingVolume(d.positionWC,d.directionWC,d.upWC))};function Tct(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),o=n.aspectRatio*i;return Math.max(t/o,t/i)}function Sct(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 Cct=100;function aye(e,t,n){n=Hu.clone(l(n)?n:tn.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=Cct:e.frustum instanceof sn||e._mode===oe.SCENE2D?n.range=Sct(e,s):n.range=Tct(e,s),n.range=W.clamp(n.range,i,o)}return n}tn.prototype.viewBoundingSphere=function(e,t){t=aye(this,e,t),this.lookAt(e.center,t)};var Vct=new F,Lct=new h,Rct=new h,Zct=new h,Gct=new h,Ect=new se,Xct=new we,Ict=new $;tn.prototype.flyToBoundingSphere=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=this._mode===oe.SCENE2D||this._mode===oe.COLUMBUS_VIEW;this._setTransform(F.IDENTITY);let i=aye(this,e,t.offset),o;n?o=h.multiplyByScalar(h.UNIT_Z,i.range,Lct):o=rye(i.heading,i.pitch,i.range);let r=this._scene,s=y(r.ellipsoid,ne.default),a=wt.eastNorthUpToFixedFrame(e.center,s,Vct);F.multiplyByPoint(a,o,o);let c,d;if(!n){if(c=h.subtract(e.center,o,Rct),h.normalize(c,c),d=F.multiplyByPointAsVector(a,h.UNIT_Z,Zct),1-Math.abs(h.dot(c,d))<W.EPSILON6){let m=we.fromAxisAngle(c,i.heading,Xct),p=$.fromQuaternion(m,Ict);h.fromCartesian4(F.getColumn(a,1,Ect),d),$.multiplyByVector(p,d,d)}let u=h.cross(c,d,Gct);h.cross(u,c,d),h.normalize(d,d)}this.flyTo({destination:o,orientation:{direction:c,up:d},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 Oge=new h,Hge=new h,Fj=new h,zge=new h,zw=[new h,new h,new h,new h];function Wct(e,t){let n=t.radii,i=e.positionWC,o=h.multiplyComponents(t.oneOverRadii,i,Oge),r=h.magnitude(o),s=h.normalize(o,Hge),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,Fj),Fj),c=h.normalize(h.cross(s,a,zge),zge));let d=Math.sqrt(h.magnitudeSquared(o)-1),u=h.multiplyByScalar(s,1/r,Oge),m=d/r,p=h.multiplyByScalar(a,m,Hge),g=h.multiplyByScalar(c,m,Fj),f=h.add(u,g,zw[0]);h.subtract(f,p,f),h.multiplyComponents(n,f,f);let x=h.subtract(u,g,zw[1]);h.subtract(x,p,x),h.multiplyComponents(n,x,x);let _=h.subtract(u,g,zw[2]);h.add(_,p,_),h.multiplyComponents(n,_,_);let C=h.add(u,g,zw[3]);return h.add(C,p,C),h.multiplyComponents(n,C,C),zw}var Aj=new D,Pct=new h,Sy=[new he,new he,new he,new he];function RD(e,t,n,i,o,r){Aj.x=e,Aj.y=t;let s=i.pickEllipsoid(Aj,o,Pct);return l(s)?(Sy[n]=o.cartesianToCartographic(s,Sy[n]),1):(Sy[n]=o.cartesianToCartographic(r[n],Sy[n]),0)}tn.prototype.computeViewRectangle=function(e,t){e=y(e,ne.default);let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new ce(h.ZERO,e.maximumRadius);if(n.computeVisibility(i)===Kt.OUTSIDE)return;let r=this._scene.canvas,s=r.clientWidth,a=r.clientHeight,c=0,d=Wct(this,e);if(c+=RD(0,0,0,this,e,d),c+=RD(0,a,1,this,e,d),c+=RD(s,a,2,this,e,d),c+=RD(s,0,3,this,e,d),c<2)return ae.MAX_VALUE;t=ae.fromCartographicArray(Sy,t);let u=0,m=Sy[3].longitude;for(let p=0;p<4;++p){let g=Sy[p].longitude,f=Math.abs(g-m);f>W.PI?u+=W.TWO_PI-f:u+=f,m=g}return W.equalsEpsilon(Math.abs(u),W.TWO_PI,W.EPSILON9)&&(t.west=-W.PI,t.east=W.PI,Sy[0].latitude>=0?t.north=W.PI_OVER_TWO:t.south=-W.PI_OVER_TWO),t};tn.prototype.switchToPerspectiveFrustum=function(){if(this._mode===oe.SCENE2D||this.frustum instanceof Vi)return;let e=this._scene;this.frustum=new Vi,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=W.toRadians(60)};tn.prototype.switchToOrthographicFrustum=function(){if(this._mode===oe.SCENE2D||this.frustum instanceof sn)return;let e=qge(this),t=this._scene;this.frustum=new sn,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};tn.clone=function(e,t){return l(t)||(t=new tn(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),F.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var io=tn;var wGi=T(S(),1);var LGi=T(S(),1),vct={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4},Wi=Object.freeze(vct);function zs(e,t){let n=`${e}`;return l(t)&&(n+=`+${t}`),n}function wct(e,t){D.clone(e.distance.startPosition,t.distance.startPosition),D.clone(e.distance.endPosition,t.distance.endPosition),D.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),D.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function cye(e,t,n){let i=zs(Wi.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 D;let d=e._movement[i];l(d)||(d=e._movement[i]={}),d.distance={startPosition:new D,endPosition:new D},d.angleAndHeight={startPosition:new D,endPosition:new D},d.prevAngle=0,e._eventHandler.setInputAction(function(u){e._buttonsDown++,r[i]=!0,a[i]=new Date,D.lerp(u.position1,u.position2,.5,s[i])},Sn.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),r[i]=!1,c[i]=new Date},Sn.PINCH_END,t),e._eventHandler.setInputAction(function(u){if(r[i]){o[i]?(wct(u,d),o[i]=!1,d.prevAngle=d.angleAndHeight.startPosition.x):(D.clone(u.distance.endPosition,d.distance.endPosition),D.clone(u.angleAndHeight.endPosition,d.angleAndHeight.endPosition));let m=d.angleAndHeight.endPosition.x,p=d.prevAngle,g=Math.PI*2;for(;m>=p+Math.PI;)m-=g;for(;m<p-Math.PI;)m+=g;d.angleAndHeight.endPosition.x=-m*n.clientWidth/12,d.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},Sn.PINCH_MOVE,t)}function lye(e,t){let n=zs(Wi.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 D,endPosition:new D,valid:!1}),s.startPosition=new D,D.clone(D.ZERO,s.startPosition),s.endPosition=new D,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,D.clone(s.endPosition,a.endPosition),a.valid=!0,r[n]=!1},Sn.WHEEL,t)}function OV(e,t,n){let i=zs(n,t),o=e._isDown,r=e._eventStartPosition,s=e._pressTime;o[i]=!1,r[i]=new D;let a=e._lastMovement[i];l(a)||(a=e._lastMovement[i]={startPosition:new D,endPosition:new D,valid:!1});let c,d;n===Wi.LEFT_DRAG?(c=Sn.LEFT_DOWN,d=Sn.LEFT_UP):n===Wi.RIGHT_DRAG?(c=Sn.RIGHT_DOWN,d=Sn.RIGHT_UP):n===Wi.MIDDLE_DRAG&&(c=Sn.MIDDLE_DOWN,d=Sn.MIDDLE_UP),e._eventHandler.setInputAction(function(u){e._buttonsDown++,a.valid=!1,o[i]=!0,s[i]=new Date,D.clone(u.position,r[i])},c,t),e._eventHandler.setInputAction(function(){Dj(zs(n,void 0),e);for(let u of Object.values(Os)){let m=zs(n,u);Dj(m,e)}},d,t)}function Dj(e,t){let n=t._releaseTime,i=t._isDown;i[e]&&(t._buttonsDown=Math.max(t._buttonsDown-1,0)),i[e]=!1,n[e]=new Date}function dye(e,t){D.clone(e.startPosition,t.startPosition),D.clone(e.endPosition,t.endPosition)}function Fct(e,t,n){let i=n._isDown,o=!1,r=zs(e,t);for(let[c,d]of Object.entries(i))c.startsWith(e)&&d&&c!==r&&(o=!0,Dj(c,n));if(!o)return;let s=n._pressTime,a=n._lastMovement[r];l(a)||(a=n._lastMovement[r]={startPosition:new D,endPosition:new D,valid:!1}),n._buttonsDown++,a.valid=!1,i[r]=!0,s[r]=new Date}function uye(e,t){let n=e._update,i=e._movement,o=e._lastMovement,r=e._isDown;for(let s in Wi)if(Wi.hasOwnProperty(s)){let a=Wi[s];if(l(a)){let c=zs(a,t);n[c]=!0,l(e._lastMovement[c])||(e._lastMovement[c]={startPosition:new D,endPosition:new D,valid:!1}),l(e._movement[c])||(e._movement[c]={startPosition:new D,endPosition:new D})}}e._eventHandler.setInputAction(function(s){for(let a in Wi)if(Wi.hasOwnProperty(a)){let c=Wi[a];if(l(c)){let d=zs(c,t);Fct(c,t,e),r[d]&&(n[d]?(dye(i[d],o[d]),o[d].valid=!0,dye(s,i[d]),n[d]=!1):D.clone(s.endPosition,i[d].endPosition))}}D.clone(s.endPosition,e._currentMousePosition)},Sn.MOUSE_MOVE,t)}function $u(e){this._eventHandler=new Bd(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new D,lye(this,void 0),cye(this,void 0,e),OV(this,void 0,Wi.LEFT_DRAG),OV(this,void 0,Wi.RIGHT_DRAG),OV(this,void 0,Wi.MIDDLE_DRAG),uye(this,void 0);for(let t in Os)if(Os.hasOwnProperty(t)){let n=Os[t];l(n)&&(lye(this,n),cye(this,n,e),OV(this,n,Wi.LEFT_DRAG),OV(this,n,Wi.RIGHT_DRAG),OV(this,n,Wi.MIDDLE_DRAG),uye(this,n))}}Object.defineProperties($u.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[zs(Wi.WHEEL)]||!this._update[zs(Wi.WHEEL,Os.SHIFT)]||!this._update[zs(Wi.WHEEL,Os.CTRL)]||!this._update[zs(Wi.WHEEL,Os.ALT)];return this._buttonsDown>0||e}}});$u.prototype.isMoving=function(e,t){let n=zs(e,t);return!this._update[n]};$u.prototype.getMovement=function(e,t){let n=zs(e,t);return this._movement[n]};$u.prototype.getLastMovement=function(e,t){let n=zs(e,t),i=this._lastMovement[n];if(i.valid)return i};$u.prototype.isButtonDown=function(e,t){let n=zs(e,t);return this._isDown[n]};$u.prototype.getStartMousePosition=function(e,t){if(e===Wi.WHEEL)return this._currentMousePosition;let n=zs(e,t);return this._eventStartPosition[n]};$u.prototype.getButtonPressTime=function(e,t){let n=zs(e,t);return this._pressTime[n]};$u.prototype.getButtonReleaseTime=function(e,t){let n=zs(e,t);return this._releaseTime[n]};$u.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};$u.prototype.isDestroyed=function(){return!1};$u.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),me(this)};var Kw=$u;var MGi=T(S(),1);function Uf(){this.featurePropertiesDirty=!1}Object.defineProperties(Uf.prototype,{featuresLength:{get:function(){pe.throwInstantiationError()}},pointsLength:{get:function(){pe.throwInstantiationError()}},trianglesLength:{get:function(){pe.throwInstantiationError()}},geometryByteLength:{get:function(){pe.throwInstantiationError()}},texturesByteLength:{get:function(){pe.throwInstantiationError()}},batchTableByteLength:{get:function(){pe.throwInstantiationError()}},innerContents:{get:function(){pe.throwInstantiationError()}},ready:{get:function(){pe.throwInstantiationError()}},tileset:{get:function(){pe.throwInstantiationError()}},tile:{get:function(){pe.throwInstantiationError()}},url:{get:function(){pe.throwInstantiationError()}},batchTable:{get:function(){pe.throwInstantiationError()}},metadata:{get:function(){pe.throwInstantiationError()},set:function(e){pe.throwInstantiationError()}},group:{get:function(){pe.throwInstantiationError()},set:function(e){pe.throwInstantiationError()}}});Uf.prototype.hasProperty=function(e,t){pe.throwInstantiationError()};Uf.prototype.getFeature=function(e){pe.throwInstantiationError()};Uf.prototype.applyDebugSettings=function(e,t){pe.throwInstantiationError()};Uf.prototype.applyStyle=function(e){pe.throwInstantiationError()};Uf.prototype.update=function(e,t){pe.throwInstantiationError()};Uf.prototype.pick=function(e,t,n){pe.throwInstantiationError()};Uf.prototype.isDestroyed=function(){pe.throwInstantiationError()};Uf.prototype.destroy=function(){pe.throwInstantiationError()};var Bj=Uf;var kGi=T(S(),1);function Act(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var em=Act;var $Gi=T(S(),1);var OGi=T(S(),1);function HV(e,t){this._conditionsExpression=Ye(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,Nct(this,t)}Object.defineProperties(HV.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function Mct(e,t){this.condition=e,this.expression=t}function Nct(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 Mct(new gu(a,t),new gu(c,t)))}e._runtimeConditions=n}HV.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)}};HV.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)}};HV.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};HV.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 Jw=HV;function Cy(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,kct(this,e)}function kct(e,t){t=y(Ye(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=y(t.meta,y.EMPTY_OBJECT);for(let r in o)o.hasOwnProperty(r)&&(n[r]=new gu(o[r],i))}e._meta=n,e._ready=!0}function $o(e,t){let n=y(e._style,y.EMPTY_OBJECT).defines;if(l(t)){if(typeof t=="boolean"||typeof t=="number")return new gu(String(t));if(typeof t=="string")return new gu(t,n);if(l(t.conditions))return new Jw(t,n)}else return;return t}function er(e){if(l(e)){if(l(e.expression))return e.expression;if(l(e.conditionsExpression))return Ye(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(Cy.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=$o(this,e),this._style.show=er(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=$o(this,e),this._style.color=er(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=$o(this,e),this._style.pointSize=er(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=$o(this,e),this._style.pointOutlineColor=er(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=$o(this,e),this._style.pointOutlineWidth=er(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=$o(this,e),this._style.labelColor=er(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=$o(this,e),this._style.labelOutlineColor=er(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=$o(this,e),this._style.labelOutlineWidth=er(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=$o(this,e),this._style.font=er(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=$o(this,e),this._style.labelStyle=er(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=$o(this,e),this._style.labelText=er(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=$o(this,e),this._style.backgroundColor=er(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=$o(this,e),this._style.backgroundPadding=er(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=$o(this,e),this._style.backgroundEnabled=er(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=$o(this,e),this._style.scaleByDistance=er(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=$o(this,e),this._style.translucencyByDistance=er(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=$o(this,e),this._style.distanceDisplayCondition=er(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=$o(this,e),this._style.heightOffset=er(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=$o(this,e),this._style.anchorLineEnabled=er(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=$o(this,e),this._style.anchorLineColor=er(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=$o(this,e),this._style.image=er(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=$o(this,e),this._style.disableDepthTestDistance=er(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=$o(this,e),this._style.horizontalOrigin=er(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=$o(this,e),this._style.verticalOrigin=er(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=$o(this,e),this._style.labelHorizontalOrigin=er(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=$o(this,e),this._style.labelVerticalOrigin=er(this._labelVerticalOrigin)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});Cy.fromUrl=function(e){return Ee.createIfNeeded(e).fetchJson(e).then(function(n){return new Cy(n)})};Cy.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)};Cy.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)};Cy.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)};Cy.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 XT=Cy;var pXi=T(S(),1);var iEi=T(S(),1);function Qw(e){e=y(e,y.EMPTY_OBJECT),this._maximumSubtreeCount=y(e.maximumSubtreeCount,0),this._subtreeRequestCounter=0,this._queue=new yT({comparator:Qw.comparator})}Qw.prototype.addSubtree=function(e){let t=new Uct(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()};Qw.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}};Qw.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 Uct(e,t){this.subtree=e,this.stamp=t}var jw=Qw;var mEi=T(S(),1);function zl(){this.orientedBoundingBox=new Gn,this.boundingSphere=new ce,this.boundTransform=new F,this.shapeTransform=new F,this._minBounds=h.clone(zl.DefaultMinBounds,new h),this._maxBounds=h.clone(zl.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 Dct=new h,Yj=new h,Bct=new $,Yct=new h,Oct=new h,Hct=new h,zct=new h,mye=F.fromRotationTranslation($.fromUniformScale(.5,new $),new h(.5,.5,.5),new F);zl.prototype.update=function(e,t,n,i,o){i=y(i,zl.DefaultMinBounds),o=y(o,zl.DefaultMaxBounds);let r=zl.DefaultMinBounds,s=zl.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,Yct),o=h.clamp(o,r,s,Oct);let a=h.clamp(t,i,o,Hct),c=h.clamp(n,i,o,zct),d=F.getScale(e,Yj);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=F.clone(e,this.shapeTransform),this.orientedBoundingBox=Hj(a,c,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=F.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),g=0;if(m.BOX_INTERSECTION_INDEX=g,g+=1,u.renderMinBounds=F.multiplyByPoint(mye,a,u.renderMinBounds),u.renderMaxBounds=F.multiplyByPoint(mye,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=g,!0};var ID=new h,Oj=new h;zl.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),ID),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)),Oj);return Hj(c,d,this.shapeTransform,o)};var hye=new h;zl.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=h.divideComponents(h.ONE,t,hye),s=h.multiplyByScalar(r,o,hye),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,ID),o,ID),c=h.add(a,s,Oj),d=this._minBounds,u=this._maxBounds,m=h.fromElements(W.lerp(d.x,u.x,a.x),W.lerp(d.y,u.y,a.y),W.lerp(d.z,u.z,a.z),ID),p=h.fromElements(W.lerp(d.x,u.x,c.x),W.lerp(d.y,u.y,c.y),W.lerp(d.z,u.z,c.z),Oj);return Hj(m,p,this.shapeTransform,i)};zl.DefaultMinBounds=Object.freeze(new h(-1,-1,-1));zl.DefaultMaxBounds=Object.freeze(new h(1,1,1));function Hj(e,t,n,i){let o=zl.DefaultMinBounds,r=zl.DefaultMaxBounds;if(h.equals(e,o)&&h.equals(t,r))i.center=F.getTranslation(n,i.center),i.halfAxes=F.getMatrix3(n,i.halfAxes);else{let a=F.getScale(n,Yj),c=h.midpoint(e,t,Dct);i.center=F.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),Yj);let d=F.getRotation(n,Bct);i.halfAxes=$.setScale(d,a,i.halfAxes)}return i}var Df=zl;var gEi=T(S(),1);function WD(e){this._resource=e,this._metadataTable=void 0}Object.defineProperties(WD.prototype,{metadataTable:{get:function(){return this._metadataTable}}});WD.fromJson=async function(e,t,n,i){let o;l(t)?o={json:t,binary:void 0}:o=Jct(n);let r=await Kct(e,o.json,o.binary),s={},a=o.json.bufferViews.length;for(let m=0;m<a;++m){let p=o.json.bufferViews[m],g=p.byteOffset,f=g+p.byteLength,_=r[p.buffer].subarray(g,f);s[m]=_}let c=o.json.voxelTable,d=o.json.propertyTables[c],u=new WD(e);return u._metadataTable=new Zl({count:d.count,properties:d.properties,class:i.classes[d.class],bufferViews:s}),u};function Kct(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 Jct(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=Io(e,i,o);i+=o;let a=e.subarray(i,i+r);return{json:s,binary:a}}var qw=WD;var GEi=T(S(),1);function qr(){this.orientedBoundingBox=new Gn,this.boundingSphere=new ce,this.boundTransform=new F,this.shapeTransform=new F,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={cylinderRenderHeightMinMax:new D,cylinderRenderRadiusMinMax:new D,cylinderRenderAngleMinMax:new D,cylinderUvToShapeUvRadius:new D,cylinderUvToShapeUvHeight:new D,cylinderUvToShapeUvAngle:new D,cylinderShapeUvAngleMinMax:new D,cylinderShapeUvAngleRangeZeroMid:0},this.shaderDefines={CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_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_OVER_HALF:void 0,CYLINDER_HAS_SHAPE_BOUNDS_RADIUS:void 0,CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE: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 gye=new h;qr.prototype.update=function(e,t,n,i,o){i=y(i,qr.DefaultMinBounds),o=y(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,g=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),E=Math.min(C,L),X=W.clamp(t.y,a,c),v=W.clamp(n.y,a,c),P=W.clamp(i.y,a,c),A=W.clamp(o.y,a,c),M=Math.max(X,P),b=Math.min(v,A),R=W.negativePiToPi(t.z),G=W.negativePiToPi(n.z),I=W.negativePiToPi(i.z),w=W.negativePiToPi(o.z),N=Math.max(R,I),B=Math.min(G,w),U=F.getScale(e,gye);if(E===0||Z>E||M>b||W.equalsEpsilon(U.x,0,void 0,g)||W.equalsEpsilon(U.y,0,void 0,g)||W.equalsEpsilon(U.z,0,void 0,g))return!1;this._minimumRadius=_,this._maximumRadius=C,this._minimumHeight=X,this._maximumHeight=v,this._minimumAngle=R,this._maximumAngle=G,this.shapeTransform=F.clone(e,this.shapeTransform),this.orientedBoundingBox=Kj(Z,E,M,b,N,B,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=F.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ce.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let J=_===r&&C===s,H=X===a&&v===c,te=G<R,z=G-R+te*m,j=z>p+x&&z<m-x,ee=z<p-x,fe=z>=p-x&&z<=p+x,_e=j||ee||fe,le=W.equalsEpsilon(R,d,void 0,f),ge=W.equalsEpsilon(G,u,void 0,f),Se=Z===r,Ie=B<N,Le=B-N+Ie*m,ke=Le>=p-x&&Le<m-x,Be=Le>x&&Le<p-x,st=Le<=x,vt=ke||Be||st,{shaderUniforms:Ct,shaderDefines:Xe}=this;for(let $e in Xe)Xe.hasOwnProperty($e)&&(Xe[$e]=void 0);let je=0;if(Xe.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=je,je+=1,Se||(Xe.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,Xe.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=je,je+=1),Ct.cylinderRenderRadiusMinMax=D.fromElements(Z,E,Ct.cylinderRenderRadiusMinMax),Z===E&&(Xe.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0),!J){Xe.CYLINDER_HAS_SHAPE_BOUNDS_RADIUS=!0;let $e=C-_,He=0,Ut=1;$e!==0&&(He=1/$e,Ut=-_/$e),Ct.cylinderUvToShapeUvRadius=D.fromElements(He,Ut,Ct.cylinderUvToShapeUvRadius)}if(!H){Xe.CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT=!0;let $e=v-X,He=0,Ut=1;$e!==0&&(He=2/$e,Ut=-(X+1)/$e),Ct.cylinderUvToShapeUvHeight=D.fromElements(He,Ut,Ct.cylinderUvToShapeUvHeight)}if(Ct.cylinderRenderHeightMinMax=D.fromElements(M,b,Ct.cylinderRenderHeightMinMax),te&&(Xe.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED=!0),vt&&(Xe.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,Xe.CYLINDER_INTERSECTION_INDEX_ANGLE=je,ke?(Xe.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,je+=1):Be?(Xe.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,je+=2):st&&(Xe.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,je+=2),Ct.cylinderRenderAngleMinMax=D.fromElements(N,B,Ct.cylinderRenderAngleMinMax)),_e){Xe.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0,le&&(Xe.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY=!0),ge&&(Xe.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY=!0);let $e=(R-d)/m,He=(G-d)/m,Ut=1-z/m;if(Ct.cylinderShapeUvAngleMinMax=D.fromElements($e,He,Ct.cylinderShapeUvAngleMinMax),Ct.cylinderShapeUvAngleRangeZeroMid=(He+.5*Ut)%1,z<=x)Ct.cylinderUvToShapeUvAngle=D.fromElements(0,1,Ct.cylinderUvToShapeUvAngle);else{let Ce=m/z,Ve=-(R-d)/z;Ct.cylinderUvToShapeUvAngle=D.fromElements(Ce,Ve,Ct.cylinderUvToShapeUvAngle)}}return this.shaderMaximumIntersectionsLength=je,!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),g=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 Kj(p,g,f,x,_,C,this.shapeTransform,o)};var fye=new h,pye=new h,Qct=new h;qr.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=h.divideComponents(h.ONE,t,fye),s=h.multiplyByScalar(r,o,fye),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,pye),o,pye),c=h.add(a,s,Qct),d=this._minimumRadius,u=this._maximumRadius,m=this._minimumHeight,p=this._maximumHeight,g=this._minimumAngle,f=this._maximumAngle,x=W.lerp(d,u,a.x),_=W.lerp(d,u,c.x),C=W.lerp(m,p,a.y),V=W.lerp(m,p,c.y),L=W.lerp(g,f,a.z),Z=W.lerp(g,f,c.z);return Kj(x,_,C,V,L,Z,this.shapeTransform,i)};qr.DefaultMinBounds=Object.freeze(new h(0,-1,-W.PI));qr.DefaultMaxBounds=Object.freeze(new h(1,1,+W.PI));var jct=5,qct=new Array(jct),$ct=new h,elt=new $,tlt=new F,nlt=new F,ilt=new F,zj=new F,olt=new h,rlt=new h,slt=new h,yye=new Array(8);for(let e=0;e<8;e++)yye[e]=new h;function bye(e,t,n){return Math.abs(se.dot(e,t))<n}function alt(e){let t=F.getColumn(e,0,olt),n=F.getColumn(e,1,rlt),i=F.getColumn(e,2,slt),o=W.EPSILON4;return bye(t,n,o)&&bye(n,i,o)}function clt(e,t){let n=yye;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)F.multiplyByPoint(e,n[i],n[i]);return Gn.fromPoints(n,t)}function Kj(e,t,n,i,o,r,s,a){let c=qr.DefaultMinBounds,d=qr.DefaultMaxBounds,u=c.x,m=d.x,p=c.y,g=d.y,f=c.z,x=d.z;if(e===u&&t===m&&n===p&&i===g&&o===f&&r===x)return a.center=F.getTranslation(s,a.center),a.halfAxes=F.getMatrix3(s,a.halfAxes),a;r<o&&(r+=W.TWO_PI);let C=r-o,V=o+C*.5,L=qct,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 E=1,X=1,v=-1,P=-1;for(let te=0;te<Z;++te){let z=L[te]-V,j=Math.cos(z),ee=Math.sin(z),fe=j*e,_e=ee*e,le=j*t,ge=ee*t;E=Math.min(E,fe),X=Math.min(X,_e),E=Math.min(E,le),X=Math.min(X,ge),v=Math.max(v,fe),P=Math.max(P,_e),v=Math.max(v,le),P=Math.max(P,ge)}let A=v-E,M=P-X,b=i-n,R=(E+v)*.5,G=(X+P)*.5,I=(n+i)*.5,w=h.fromElements(R,G,I,$ct),N=$.fromRotationZ(V,elt),B=h.fromElements(A,M,b,gye),U=F.fromScale(B,ilt),O=F.fromRotation(N,nlt),k=F.fromTranslation(w,tlt),J=F.multiplyTransformation(O,F.multiplyTransformation(k,U,zj),zj),H=F.multiplyTransformation(s,J,zj);return alt(H)?Gn.fromTransformation(H,a):clt(H,a)}var Bf=qr;var OEi=T(S(),1);var kEi=T(S(),1);function j0(){this.orientedBoundingBox=new Gn,this.boundingSphere=new ce,this.boundTransform=new F,this.shapeTransform=new F,this._rectangle=new ae,this._minimumHeight=j0.DefaultMinBounds.z,this._maximumHeight=j0.DefaultMaxBounds.z,this._ellipsoid=new ne,this._translation=new h,this._rotation=new $,this.shaderUniforms={ellipsoidRadiiUv:new h,eccentricitySquared:0,evoluteScale:new D,ellipsoidInverseRadiiSquaredUv:new h,ellipsoidRenderLongitudeMinMax:new D,ellipsoidShapeUvLongitudeMinMaxMid:new h,ellipsoidUvToShapeUvLongitude:new D,ellipsoidUvToShapeUvLatitude:new D,ellipsoidRenderLatitudeSinMinMax:new D,ellipsoidInverseHeightDifferenceUv:0,clipMinMaxHeight:new D},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_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_MIN_MAX_REVERSED: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_SHAPE_BOUNDS_LATITUDE: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 llt=new h,dlt=new h,ult=new h,mlt=new h,hlt=new h,flt=new h,plt=new h,blt=new h,glt=new $,xye=new h,_ye=new h,ylt=new ae;j0.prototype.update=function(e,t,n,i,o){let{DefaultMinBounds:r,DefaultMaxBounds:s}=j0;i=y(i,r),o=y(o,s);let a=W.EPSILON10,c=W.EPSILON3,d=W.EPSILON10,u=W.EPSILON10,m=W.EPSILON3,p=F.getScale(e,blt),g=h.clone(r,llt);g.z=-h.minimumComponent(p);let f=h.clamp(t,g,s,dlt),x=h.clamp(n,g,s,ult),_=h.clamp(i,g,s,mlt),C=h.clamp(o,g,s,hlt),V=h.maximumByComponent(f,_,flt),L=h.minimumByComponent(x,C,plt),Z=h.add(p,h.fromElements(x.z,x.z,x.z,xye),xye),E=h.maximumComponent(Z),X=h.add(p,h.fromElements(L.z,L.z,L.z,_ye),_ye);if(V.y>L.y||V.y===s.y||L.y===r.y||V.z>L.z||W.equalsEpsilon(X,h.ZERO,void 0,a))return!1;this._rectangle=ae.fromRadians(f.x,f.y,x.x,x.y),this._translation=F.getTranslation(e,this._translation),this._rotation=F.getRotation(e,this._rotation),this._ellipsoid=ne.fromCartesian3(p,this._ellipsoid),this._minimumHeight=f.z,this._maximumHeight=x.z;let v=ae.fromRadians(V.x,V.y,L.x,L.y,ylt);this.orientedBoundingBox=Jj(v,V.z,L.z,this._ellipsoid,this._translation,this._rotation,this.orientedBoundingBox),this.shapeTransform=F.fromRotationTranslation($.setScale(this._rotation,Z,glt),this._translation,this.shapeTransform),this.boundTransform=F.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ce.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let P=s.x-r.x,A=.5*P,M=L.x<V.x,b=L.x-V.x+M*P,R=b<=d,G=b>=A-d&&b<P-d,I=b>d&&b<A-d,w=R||G||I,N=x.x<f.x,B=x.x-f.x+N*P,U=B>A+d&&B<P-d,O=B>=A-d&&B<=A+d,k=B<A-d,J=U||O||k,H=L.y<-m,te=L.y>=-m&&L.y<=+m,z=L.y>+m&&L.y<s.y-u,j=H||te||z,ee=V.y>r.y+u&&V.y<-m,fe=V.y>=-m&&V.y<=+m,_e=V.y>+m,le=ee||fe||_e,ge=j||le,Se=x.y-f.y,Ie=x.y<-m,Le=x.y>=-m&&x.y<=+m,ke=x.y>+m&&x.y<s.y-u,Be=Ie||Le||ke,st=f.y>r.y+u&&f.y<-m,vt=f.y>=-m&&f.y<=+m,Ct=f.y>+m,je=Be||(st||vt||Ct),{shaderUniforms:$e,shaderDefines:He}=this;for(let mt in He)He.hasOwnProperty(mt)&&(He[mt]=void 0);$e.ellipsoidRadiiUv=h.divideByScalar(Z,E,$e.ellipsoidRadiiUv);let{x:Ut,z:Ce}=$e.ellipsoidRadiiUv,Ve=Ce/Ut;$e.eccentricitySquared=1-Ve*Ve,$e.evoluteScale=D.fromElements((Ut*Ut-Ce*Ce)/Ut,(Ce*Ce-Ut*Ut)/Ce,$e.evoluteScale),$e.ellipsoidInverseRadiiSquaredUv=h.divideComponents(h.ONE,h.multiplyComponents($e.ellipsoidRadiiUv,$e.ellipsoidRadiiUv,$e.ellipsoidInverseRadiiSquaredUv),$e.ellipsoidInverseRadiiSquaredUv);let ct=0;He.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=ct,ct+=1,He.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=ct,ct+=1,$e.clipMinMaxHeight=D.fromElements((V.z-x.z)/E,(L.z-x.z)/E,$e.clipMinMaxHeight);let Ni=(x.z-f.z)/E;if($e.ellipsoidInverseHeightDifferenceUv=1/Ni,f.z===x.z&&($e.ellipsoidInverseHeightDifferenceUv=0),w&&(He.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,He.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=ct,G?(He.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,ct+=1):I?(He.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,ct+=2):R&&(He.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,ct+=2),$e.ellipsoidRenderLongitudeMinMax=D.fromElements(V.x,L.x,$e.ellipsoidRenderLongitudeMinMax)),J)if(He.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0,x.x<f.x&&(He.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED=!0),B<=d)$e.ellipsoidUvToShapeUvLongitude=D.fromElements(0,1,$e.ellipsoidUvToShapeUvLongitude);else{let _o=P/B,ur=-(f.x-r.x)/B;$e.ellipsoidUvToShapeUvLongitude=D.fromElements(_o,ur,$e.ellipsoidUvToShapeUvLongitude)}if(w){let mt=W.equalsEpsilon(V.x,r.x,void 0,c),_o=W.equalsEpsilon(L.x,s.x,void 0,c);mt&&(He.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY=!0),_o&&(He.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY=!0);let ur=(f.x-r.x)/P,Zc=(x.x-r.x)/P,Sr=(L.x-r.x)/P,ts=1-b/P,Ne=(Sr+.5*ts)%1;$e.ellipsoidShapeUvLongitudeMinMaxMid=h.fromElements(ur,Zc,Ne,$e.ellipsoidShapeUvLongitudeMinMaxMid)}if(ge&&(le&&(He.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,He.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=ct,ee?(He.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,ct+=1):fe?(He.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,ct+=1):_e&&(He.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,ct+=2)),j&&(He.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,He.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=ct,H?(He.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,ct+=2):te?(He.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,ct+=1):z&&(He.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,ct+=1)),$e.ellipsoidRenderLatitudeSinMinMax=D.fromElements(Math.sin(V.y),Math.sin(L.y),$e.ellipsoidRenderLatitudeSinMinMax)),je)if(He.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,Se<u)$e.ellipsoidUvToShapeUvLatitude=D.fromElements(0,1,$e.ellipsoidUvToShapeUvLatitude);else{let _o=(s.y-r.y)/Se,ur=(r.y-f.y)/Se;$e.ellipsoidUvToShapeUvLatitude=D.fromElements(_o,ur,$e.ellipsoidUvToShapeUvLatitude)}return this.shaderMaximumIntersectionsLength=ct,!0};var Cye=new ae;j0.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=ae.subsection(this._rectangle,s,c,a,d,Cye),g=W.lerp(this._minimumHeight,this._maximumHeight,u),f=W.lerp(this._minimumHeight,this._maximumHeight,m);return Jj(p,g,f,this._ellipsoid,this._translation,this._rotation,o)};var Tye=new h,Sye=new h,xlt=new h;j0.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=h.divideComponents(h.ONE,t,Tye),s=h.multiplyByScalar(r,o,Tye),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,Sye),o,Sye),c=h.add(a,s,xlt),d=ae.subsection(this._rectangle,a.x,a.y,c.x,c.y,Cye),u=W.lerp(this._minimumHeight,this._maximumHeight,a.z),m=W.lerp(this._minimumHeight,this._maximumHeight,c.z);return Jj(d,u,m,this._ellipsoid,this._translation,this._rotation,i)};function Jj(e,t,n,i,o,r,s){return s=Gn.fromRectangle(e,t,n,i,s),s.center=h.add(s.center,o,s.center),s.halfAxes=$.multiply(s.halfAxes,r,s.halfAxes),s}j0.DefaultMinBounds=Object.freeze(new h(-W.PI,-W.PI_OVER_TWO,-ne.WGS84.minimumRadius));j0.DefaultMaxBounds=Object.freeze(new h(W.PI,W.PI_OVER_TWO,10*ne.WGS84.maximumRadius));var IT=j0;var Od={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};Od.getMinBounds=function(e){switch(e){case Od.BOX:return Df.DefaultMinBounds;case Od.ELLIPSOID:return IT.DefaultMinBounds;case Od.CYLINDER:return Bf.DefaultMinBounds}};Od.getMaxBounds=function(e){switch(e){case Od.BOX:return Df.DefaultMaxBounds;case Od.ELLIPSOID:return IT.DefaultMaxBounds;case Od.CYLINDER:return Bf.DefaultMaxBounds}};Od.getShapeConstructor=function(e){switch(e){case Od.BOX:return Df;case Od.ELLIPSOID:return IT;case Od.CYLINDER:return Bf}};var Pi=Object.freeze(Od);function PD(e){e=y(e,y.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 jw}PD.fromUrl=async function(e){let t=Ee.createIfNeeded(e),n=await t.fetchJson();Tlt(n);let i=Rlt(n,t);await i.load();let o=n.root,r=o.content.extensions["3DTILES_content_voxels"],s=r.class,a=ii(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,c=i.schema,d=new X_({metadataJson:a,schema:c}),u=new PD;Zlt(u,d,s);let m=new W_(t,o,c),{shape:p,minBounds:g,maxBounds:f,shapeTransform:x,globalTransform:_}=Slt(o);u.shape=p,u.minBounds=g,u.maxBounds=f,u.dimensions=h.unpack(r.dimensions),u.shapeTransform=x,u.globalTransform=_,u.maximumTileCount=_lt(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,Bi.unload(i),u};function _lt(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(e_.TILESET_TILE_COUNT)}function Tlt(e){let t=e.root;if(!l(t.content))throw new ue("Root must have content");if(!ii(t.content,"3DTILES_content_voxels"))throw new ue("Root tile content must have 3DTILES_content_voxels extension");if(!ii(t,"3DTILES_implicit_tiling")&&!l(t.implicitTiling))throw new ue("Root tile must have implicit tiling");if(!l(e.schema)&&!l(e.schemaUri)&&!ii(e,"3DTILES_metadata"))throw new ue("Tileset must have a metadata schema")}function Slt(e){let t=e.boundingVolume,n;if(l(e.transform)?n=F.unpack(e.transform):n=F.clone(F.IDENTITY),l(t.box))return Vlt(t.box,n);if(l(t.region))return Clt(t.region);if(ii(t,"3DTILES_bounding_volume_cylinder"))return Llt(t.extensions["3DTILES_bounding_volume_cylinder"].cylinder,n);throw new ue("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function Clt(e){let t=e[0],n=e[1],i=e[2],o=e[3],r=e[4],s=e[5],a=F.fromScale(ne.WGS84.radii),c=new h(t,n,r),d=new h(i,o,s);return{shape:Pi.ELLIPSOID,minBounds:c,maxBounds:d,shapeTransform:a,globalTransform:F.clone(F.IDENTITY)}}function Vlt(e,t){let n=Gn.unpack(e),i=F.fromRotationTranslation(n.halfAxes,n.center);return{shape:Pi.BOX,minBounds:h.clone(Df.DefaultMinBounds),maxBounds:h.clone(Df.DefaultMaxBounds),shapeTransform:i,globalTransform:t}}function Llt(e,t){let n=Gn.unpack(e),i=F.fromRotationTranslation(n.halfAxes,n.center);return{shape:Pi.CYLINDER,minBounds:h.clone(Bf.DefaultMinBounds),maxBounds:h.clone(Bf.DefaultMaxBounds),shapeTransform:i,globalTransform:t}}function Rlt(e,t){let{schemaUri:n,schema:i}=e;return l(n)?Bi.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Bi.getSchemaLoader({schema:i})}function Zlt(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:g,componentType:f}=p,x=r?.properties[m].min,_=r?.properties[m].max,C=zt.getComponentCount(g),V=Vye(x,C),L=Vye(_,C);return{id:m,type:g,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 Vye(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,o)=>n[o])}async function Glt(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 qw.fromJson(i,r.jsonPayload,r.binaryPayload,e.metadataSchema)}async function Elt(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 $x.fromSubtreeJson(s,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(o),o}PD.prototype.requestData=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.tileLevel,0),n=y(e.tileX,0),i=y(e.tileY,0),o=y(e.tileZ,0);if(y(e.keyframe,0)!==0)return;let s=this._implicitTileset,a=this.names,c=new P_({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 Elt(this,u).then(function(p){return(d?p.childSubtreeIsAvailableAtCoordinates(c):p.tileIsAvailableAtCoordinates(c))?Glt(s,c):Promise.reject("Tile is not available")}).then(function(p){return a.map(function(g){return p.metadataTable.getPropertyTypedArray(g)})})};var Qj=PD;var _Xi=T(S(),1);function jj(e){e=y(e,1),this._radius=y(e,1)}Object.defineProperties(jj.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});jj.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 $w=jj;var dIi=T(S(),1);var SXi=T(S(),1),qj={CUMULUS:0};qj.validate=function(e){return e===qj.CUMULUS};var zV=Object.freeze(qj);var EXi=T(S(),1);function Lh(e,t){if(e=y(e,y.EMPTY_OBJECT),this._show=y(e.show,!0),this._position=h.clone(y(e.position,h.ZERO)),!l(e.scale)&&l(e.maximumSize))this._maximumSize=h.clone(e.maximumSize),this._scale=new D(this._maximumSize.x,this._maximumSize.y);else{this._scale=D.clone(y(e.scale,new D(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(y(e.maximumSize,n))}this._slice=y(e.slice,-1),this._color=Y.clone(y(e.color,Y.WHITE)),this._brightness=y(e.brightness,1),this._cloudCollection=t,this._index=-1}var Xlt=Lh.SHOW_INDEX=0,Ilt=Lh.POSITION_INDEX=1,Wlt=Lh.SCALE_INDEX=2,Plt=Lh.MAXIMUM_SIZE_INDEX=3,vlt=Lh.SLICE_INDEX=4,wlt=Lh.BRIGHTNESS_INDEX=5,Flt=Lh.COLOR_INDEX=6;Lh.NUMBER_OF_PROPERTIES=7;function WT(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(Lh.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,WT(this,Xlt))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),WT(this,Ilt))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;D.equals(t,e)||(D.clone(e,t),WT(this,Wlt))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;h.equals(t,e)||(h.clone(e,t),WT(this,Plt))}},color:{get:function(){return this._color},set:function(e){let t=this._color;Y.equals(t,e)||(Y.clone(e,t),WT(this,Flt))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,WT(this,vlt))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,WT(this,wlt))}}});Lh.prototype._destroy=function(){this._cloudCollection=void 0};var Hd=Lh;var zd,vD=new h,Alt={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},Mlt={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},Nlt=Hd.SHOW_INDEX,klt=Hd.POSITION_INDEX,Ult=Hd.SCALE_INDEX,Dlt=Hd.MAXIMUM_SIZE_INDEX,Blt=Hd.SLICE_INDEX,Ylt=Hd.BRIGHTNESS_INDEX,Olt=Hd.NUMBER_OF_PROPERTIES,Hlt=Hd.COLOR_INDEX;function Rh(e){e=y(e,y.EMPTY_OBJECT),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(Olt),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=y(e.noiseDetail,16),this.noiseOffset=h.clone(y(e.noiseOffset,h.ZERO)),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:Lye(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=y(e.show,!0),this._colorCommands=[],this.debugBillboards=y(e.debugBillboards,!1),this._compiledDebugBillboards=!1,this.debugEllipsoids=y(e.debugEllipsoids,!1),this._compiledDebugEllipsoids=!1}function Lye(e){return function(){return vD.x=e._textureSliceWidth,vD.y=e._noiseTextureRows,vD.z=1/e._noiseTextureRows,vD}}Object.defineProperties(Rh.prototype,{length:{get:function(){return e8(this),this._clouds.length}}});function Rye(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Rh.prototype.add=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.cloudType,zV.CUMULUS),n;return t===zV.CUMULUS&&(n=new Hd(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};Rh.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Rh.prototype.removeAll=function(){Rye(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function e8(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}}Rh.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};Rh.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};Rh.prototype.get=function(e){return e8(this),this._clouds[e]};var zlt=new Float32Array([-1,-1,1,-1,1,1,-1,1]),Klt=new Uint16Array([0,1,2,0,2,3]);function Jlt(e){let t=yt.createVertexBuffer({context:e,typedArray:zlt,usage:Me.STATIC_DRAW}),n=yt.createIndexBuffer({context:e,typedArray:Klt,usage:Me.STATIC_DRAW,indexDatatype:Ae.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:Q.FLOAT}];return new mi({context:e,attributes:i,indexBuffer:n})}var t8;function Qlt(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=yt.createIndexBuffer({context:e,typedArray:o,usage:Me.STATIC_DRAW,indexDatatype:Ae.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function jlt(e){let t=e.cache.cloudCollection_indexBufferInstanced;return l(t)||(t=yt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Me.STATIC_DRAW,indexDatatype:Ae.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function qlt(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return l(t)||(t=yt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Me.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function $lt(e,t,n){let i=[{index:zd.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:Me.STATIC_DRAW},{index:zd.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:Me.STATIC_DRAW},{index:zd.packedAttribute0,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:Me.STATIC_DRAW},{index:zd.packedAttribute1,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:Me.STATIC_DRAW},{index:zd.color,componentsPerAttribute:4,componentDatatype:Q.UNSIGNED_BYTE,normalize:!0,usage:Me.STATIC_DRAW}];n&&i.push({index:zd.direction,componentsPerAttribute:2,componentDatatype:Q.FLOAT,vertexBuffer:qlt(e)});let o=n?t:4*t;return new yp(e,i,o,n)}var $j=new Yn;function Zye(e,t,n,i){let o,r=n[zd.positionHighAndScaleX],s=n[zd.positionLowAndScaleY],a=i.position;Yn.fromCartesian(a,$j);let c=i.scale,d=$j.high,u=$j.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 Gye(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 Eye(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 Xye(e,t,n,i){let o,r=n[zd.color],s=i.color,a=Y.floatToByte(s.red),c=Y.floatToByte(s.green),d=Y.floatToByte(s.blue),u=Y.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 edt(e,t,n,i){Zye(e,t,n,i),Gye(e,t,n,i),Eye(e,t,n,i),Xye(e,t,n,i)}function tdt(e,t,n,i){let o=e,r=o._textureSliceWidth,s=o._noiseTextureRows,a=t.context;o._vaNoise=Jlt(a),o._spNoise=rn.fromCache({context:a,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let c=o.noiseDetail,d=o.noiseOffset;o._noiseTexture=new Ft({context:a,width:r*r/s,height:r*s,pixelDatatype:nt.UNSIGNED_BYTE,pixelFormat:at.RGBA,sampler:new $t({wrapS:Cn.REPEAT,wrapT:Cn.REPEAT,minificationFilter:qt.NEAREST,magnificationFilter:ui.NEAREST})});let u=new um({vertexArray:o._vaNoise,shaderProgram:o._spNoise,outputTexture:o._noiseTexture,uniformMap:{u_noiseTextureDimensions:Lye(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 ndt(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=$lt(i,r,n._instanced);let s=n._vaf.writers,a;for(a=0;a<r;++a){let c=o[a];edt(e,t,s,c)}n._vaf.commit(t8(i))}}var idt=[];function odt(e,t){let n=t.context,i=e,r=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,c=i._propertiesChanged,d=idt;d.length=0,(c[klt]||c[Ult])&&d.push(Zye),(c[Nlt]||c[Ylt])&&d.push(Gye),(c[Dlt]||c[Blt])&&d.push(Eye),c[Hlt]&&d.push(Xye);let u=d.length,m=i._vaf.writers,p,g,f;if(a/r>.1){for(p=0;p<a;++p)for(g=s[p],g._dirty=!1,f=0;f<u;++f)d[f](e,t,m,g);i._vaf.commit(t8(n))}else{for(p=0;p<a;++p){for(g=s[p],g._dirty=!1,f=0;f<u;++f)d[f](e,t,m,g);i._instanced?i._vaf.subCommit(g._index,1):i._vaf.subCommit(g._index*4,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}function rdt(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=rn.replaceCache({context:o,shaderProgram:r._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:zd}),r._rs=Ue.fromCache({depthTest:{enabled:!0,func:ie.LESS},depthMask:!1,blending:un.ALPHA_BLEND}),r._spCreated=!0,r._compiledDebugBillboards=r.debugBillboards,r._compiledDebugEllipsoids=r.debugEllipsoids}function sdt(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 tt),u.pass=Re.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)}}}Rh.prototype.update=function(e){if(e8(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&tdt(this,e,yw,gw),this._instanced=e.context.instancedArrays,zd=this._instanced?Mlt:Alt,t8=this._instanced?jlt:Qlt;let i=this._clouds.length,o=this._cloudsToUpdate,r=this._cloudsToUpdateIndex;this._createVertexArray?ndt(this,e):r>0&&odt(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)&&rdt(this,e,bw,pw),sdt(this,e))};Rh.prototype.isDestroyed=function(){return!1};Rh.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(),Rye(this._clouds),me(this)};var n8=Rh;var pIi=T(S(),1);var adt=W.toRadians(30);function i8(e){this._angle=y(e,adt)}Object.defineProperties(i8.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});i8.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 o8=i8;var CIi=T(S(),1);var wye=T(td(),1),Iye=576,cdt=100,eF="#ffffff",wD="#48b";function Fye(e,t){this.credit=e,this.count=y(t,1)}function ldt(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i];if(Rt.equals(o,t))return!0}return!1}function ddt(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;Rt.equals(n,t)||(l(t)&&e._cesiumCreditContainer.removeChild(t.element),l(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var Aye="cesium-credit-delimiter";function Wye(e){let t=document.createElement("span");return t.textContent=e,t.className=Aye,t}function Pye(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function vye(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(Wye(n));else{let u=o[d];u.className!==Aye&&e.replaceChild(Wye(n),u)}}let c=a.element;if(o.length<=r)e.appendChild(Pye(c,i));else{let d=o[r];d._creditId!==a._id&&e.replaceChild(Pye(c,i),d)}}}for(++r;r<o.length;)e.removeChild(o[r])}function udt(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 mdt(e){let t=`
.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);
}

.cesium-credit-lightbox {
  background-color: #303336;
  color: ${eF};
  position: relative;
  min-height: ${cdt}px;
  margin: auto;
}
.cesium-credit-lightbox > ul > li a,
.cesium-credit-lightbox > ul > li a:visited,
.cesium-credit-wrapper a,
.cesium-credit-wrapper a:visited {
  color: ${eF};
}
.cesium-credit-lightbox > ul > li a:hover {
  color: ${wD};
}
.cesium-credit-lightbox.cesium-credit-lightbox-expanded {
  border: 1px solid #444;
  border-radius: 5px;
  max-width: 370px;
}
.cesium-credit-lightbox.cesium-credit-lightbox-mobile {
  height: 100%;
  width: 100%;
}
.cesium-credit-lightbox-title {
  padding: 20px 20px 0 20px;
}
.cesium-credit-lightbox-close {
  font-size: 18pt;
  cursor: pointer;
  position: absolute;
  top: 0;
  right: 6px;
  color: ${eF};
}
.cesium-credit-lightbox-close:hover {
  color: ${wD};
}
.cesium-credit-lightbox > ul {
  margin: 0;
  padding: 12px 20px 12px 40px;
  font-size: 13px;
}
.cesium-credit-lightbox > ul > li {
  padding-bottom: 6px;
}
.cesium-credit-lightbox > ul > li * {
  padding: 0;
  margin: 0;
}

.cesium-credit-expand-link {
  padding-left: 5px;
  cursor: pointer;
  text-decoration: underline;
  color: ${eF};
}
.cesium-credit-expand-link:hover {
  color: ${wD};
}

.cesium-credit-text {
  color: ${eF};
}

.cesium-credit-delimiter {
  padding: 0 5px;
}

.cesium-credit-textContainer *,
.cesium-credit-logoContainer * {
  display: inline;
}

.cesium-credit-textContainer a:hover {
  color: ${wD}
}

.cesium-credit-textContainer .cesium-credit-wrapper:first-of-type {
  padding-left: 5px;
}
`;function n(r){if(r.shadowRoot)return r.shadowRoot;if(r.getRootNode){let s=r.getRootNode();if(s instanceof ShadowRoot)return s}}let i=y(n(e),document.head),o=document.createElement("style");o.innerHTML=t,i.appendChild(o)}function dr(e,t,n){let i=this;n=y(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),mdt(e);let g=Rt.clone(dr.cesiumCredit);this._delimiter=y(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=g,this._previousCesiumCredit=void 0,this._currentCesiumCredit=g,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new Lt,lightboxCredits:new Lt},this._defaultCredit=void 0,this.viewport=n,this.container=e}function Mye(e,t,n,i){i=y(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 Fye(n,i),r.push(o)),++e._creditDisplayElementPoolIndex,t.set(n.id,o)}}dr.prototype.addCreditToNextFrame=function(e){if(e.isIon()){l(this._defaultCredit)||(this._defaultCredit=Rt.clone(Nye())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,Mye(this,t,e)};dr.prototype.addStaticCredit=function(e){let t=this._staticCredits;ldt(t,e)||t.push(e)};dr.prototype.removeStaticCredit=function(e){let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};dr.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0};dr.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1};dr.prototype.update=function(){this._expanded&&udt(this)};dr.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()&&Rt.equals(dr.cesiumCredit,this._cesiumCredit)||Mye(this,s,r,Number.MAX_VALUE)}Rt.equals(dr.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=Rt.clone(dr.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};dr.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;vye(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",vye(this._creditList,t,void 0,"li"),ddt(this)};dr.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),me(this)};dr.prototype.isDestroyed=function(){return!1};dr._cesiumCredit=void 0;dr._cesiumCreditInitialized=!1;var FD;function Nye(){if(!l(FD)){let e=nn("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new wye.default(e).path()),FD=new Rt(`<a href="https://cesium.com/" target="_blank"><img src="${e}" style="vertical-align: -7px" title="Cesium ion"/></a>`,!0)}return dr._cesiumCreditInitialized||(dr._cesiumCredit=FD,dr._cesiumCreditInitialized=!0),FD}Object.defineProperties(dr,{cesiumCredit:{get:function(){return Nye(),dr._cesiumCredit},set:function(e){dr._cesiumCredit=e,dr._cesiumCreditInitialized=!0}}});dr.CreditDisplayElement=Fye;var tF=dr;var GIi=T(S(),1);function nF(e){e=y(e,y.EMPTY_OBJECT);let t=e.attributeName,n=e.perInstanceAttribute;l(n)||(n=!1);let i=y(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=y(e.translucent,!1),this._vertexShaderSource=y(e.vertexShaderSource,s),this._fragmentShaderSource=y(e.fragmentShaderSource,a),this._renderState=ji.getDefaultRenderState(!1,!1,e.renderState),this._closed=y(e.closed,!1),this._attributeName=t,this._glslDatatype=i}Object.defineProperties(nF.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}}});nF.prototype.getFragmentShaderSource=ji.prototype.getFragmentShaderSource;nF.prototype.isTranslucent=ji.prototype.isTranslucent;nF.prototype.getRenderState=ji.prototype.getRenderState;var r8=nF;var zIi=T(S(),1);function AD(e){e=y(e,y.EMPTY_OBJECT),this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=y(e.color,Y.CYAN),this._updateOnChange=y(e.updateOnChange,!0),this.show=y(e.show,!0),this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var hdt=new h,fdt=new $,pdt=new we,bdt=new Vi,gdt=new nl,ydt=new sn,xdt=new Zr,_dt=new Y,Tdt=[1,1e5];AD.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 Vi?a=bdt:s instanceof nl?a=gdt:s instanceof sn?a=ydt:a=xdt,a=s.clone(a);let c,d=this._frustumSplits;!l(d)||d.length<=1?(d=Tdt,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,g=r.rightWC;g=h.negate(g,hdt);let f=fdt;$.setColumn(f,0,g,f),$.setColumn(f,1,p,f),$.setColumn(f,2,m,f);let x=we.fromRotationMatrix(f,pdt);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 Vt({geometry:new _T({origin:u,orientation:x,frustum:a,_drawNearPlane:i===0}),attributes:{color:Ht.fromColor(Y.fromAlpha(this._color,.1,_dt))},id:this.id,pickPrimitive:this}),appearance:new dn({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new En({geometryInstances:new Vt({geometry:new qv({origin:u,orientation:x,frustum:a,_drawNearPlane:i===0}),attributes:{color:Ht.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new dn({translucent:!1,flat:!0}),asynchronous:!1})}for(o=t.length,i=0;i<o;++i)n[i].update(e),t[i].update(e)};AD.prototype.isDestroyed=function(){return!1};AD.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 me(this)};var Yf=AD;var eWi=T(S(),1);function kye(){this._cachedShowFrustumsShaders={}}function Sdt(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function Cdt(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=Sdt(i);return rn.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:o,attributeLocations:d})}var iF=new Y;function Vdt(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=Y.fromRandom()),t._debugColor):Y.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(iF.red=t.debugOverlappingFrustums&1?1:0,iF.green=t.debugOverlappingFrustums&2?1:0,iF.blue=t.debugOverlappingFrustums&4?1:0,iF.alpha=1,iF):Y.WHITE}),n}var Ldt=new tt;kye.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,o=this._cachedShowFrustumsShaders[i];l(o)||(o=Cdt(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=o);let r=tt.shallowClone(t,Ldt);r.shaderProgram=o,r.uniformMap=Vdt(e,t),r.execute(e.context,n)};var oF=kye;var hWi=T(S(),1);function MD(e){e=y(e,y.EMPTY_OBJECT),this.length=y(e.length,1e7),this._length=void 0,this.width=y(e.width,2),this._width=void 0,this.show=y(e.show,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=new F,this.id=e.id,this._id=void 0,this._primitive=void 0}MD.prototype.update=function(e){if(this.show){if(!l(this._primitive)||!F.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=F.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 Vt({geometry:new A0({positions:[h.ZERO,h.UNIT_X],width:this.width,vertexFormat:Yr.VERTEX_FORMAT,colors:[Y.RED,Y.RED],arcType:en.NONE}),modelMatrix:F.multiplyByUniformScale(this.modelMatrix,this.length,new F),id:this.id,pickPrimitive:this}),n=new Vt({geometry:new A0({positions:[h.ZERO,h.UNIT_Y],width:this.width,vertexFormat:Yr.VERTEX_FORMAT,colors:[Y.GREEN,Y.GREEN],arcType:en.NONE}),modelMatrix:F.multiplyByUniformScale(this.modelMatrix,this.length,new F),id:this.id,pickPrimitive:this}),i=new Vt({geometry:new A0({positions:[h.ZERO,h.UNIT_Z],width:this.width,vertexFormat:Yr.VERTEX_FORMAT,colors:[Y.BLUE,Y.BLUE],arcType:en.NONE}),modelMatrix:F.multiplyByUniformScale(this.modelMatrix,this.length,new F),id:this.id,pickPrimitive:this});this._primitive=new En({geometryInstances:[t,n,i],appearance:new Yr,asynchronous:!1})}this._primitive.update(e)}};MD.prototype.isDestroyed=function(){return!1};MD.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),me(this)};var rF=MD;var FWi=T(S(),1);function aF(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=y(e,0)}var sF=Ot.supportsTypedArrays()?new Float32Array(12):[],Uye=new h,Dye=new h,s8=new h,Bye=new h,ND=new h;function Rdt(e,t){let n=e.radii,i=t.camera,o,r,s;if(i.frustum instanceof sn)o=h.ZERO,r=i.rightWC,s=i.upWC;else{let m=i.positionWC,p=h.multiplyComponents(e.oneOverRadii,m,Uye),g=h.normalize(p,Dye),f=h.normalize(h.cross(h.UNIT_Z,p,s8),s8),x=h.normalize(h.cross(g,f,Bye),Bye),_=h.magnitude(p),C=Math.sqrt(_*_-1);o=h.multiplyByScalar(g,1/_,Uye);let V=C/_;r=h.multiplyByScalar(f,V,Dye),s=h.multiplyByScalar(x,V,s8)}let a=h.add(o,s,ND);h.subtract(a,r,a),h.multiplyComponents(n,a,a),h.pack(a,sF,0);let c=h.subtract(o,s,ND);h.subtract(c,r,c),h.multiplyComponents(n,c,c),h.pack(c,sF,3);let d=h.add(o,s,ND);h.add(d,r,d),h.multiplyComponents(n,d,d),h.pack(d,sF,6);let u=h.subtract(o,s,ND);return h.add(u,r,u),h.multiplyComponents(n,u,u),h.pack(u,sF,9),sF}aF.prototype.update=function(e){if(this._mode=e.mode,e.mode!==oe.SCENE3D)return;let t=e.context,n=e.mapProjection.ellipsoid.radii,i=new ne(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),o=e.useLogDepth;if(l(this._command)||(this._rs=Ue.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new tt({renderState:this._rs,boundingVolume:new ce(h.ZERO,i.maximumRadius),pass:Re.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==o){this._useLogDepth=o;let s=new Oe({sources:[Sw]}),a=new Oe({sources:[Tw]});o&&(a.defines.push("LOG_DEPTH"),s.defines.push("LOG_DEPTH")),this._sp=rn.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let r=Rdt(i,e);if(l(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(r);else{let s=new ht({attributes:{position:new Ge({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:r})},indices:[0,1,2,2,1,3],primitiveType:Fe.TRIANGLES});this._va=mi.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:Me.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};aF.prototype.execute=function(e,t){this._mode===oe.SCENE3D&&this._command.execute(e,t)};aF.prototype.isDestroyed=function(){return!1};aF.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var cF=aF;var DWi=T(S(),1);function lF(){}var Zdt=/\bgl_FragDepth\b/,Gdt=/\bdiscard\b/;function Edt(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(Zdt.test(a[r])||Gdt.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 Xdt(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(!l(i)){let o=Ue.getState(t);o.depthMask=!0,o.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i=Ue.fromCache(o),n[t.id]=i}return i}lF.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=tt.shallowClone(t,i.depthOnlyCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=Edt(n,t.shaderProgram),i.depthOnlyCommand.renderState=Xdt(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=o,i.depthOnlyCommand.renderState=r),i};var Idt=/\s+czm_writeLogDepth\(/,Wdt=/\s+czm_vertexLogDepth\(/;function Pdt(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(Wdt.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)Idt.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}lF.createLogDepthCommand=function(e,t,n){l(n)||(n={});let i;return l(n.command)&&(i=n.command.shaderProgram),n.command=tt.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=Pdt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function vdt(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,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 wdt(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(!l(i)){let o=Ue.getState(t);o.blending.enabled=!1,o.depthMask=!0,i=Ue.fromCache(o),n[t.id]=i}return i}lF.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=tt.shallowClone(t,i.pickCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=vdt(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=wdt(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=o,i.pickCommand.renderState=r),i};function Fdt(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}lF.createHdrCommand=function(e,t,n){l(n)||(n={});let i;return l(n.command)&&(i=n.command.shaderProgram),n.command=tt.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=Fdt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var q0=lF;var JWi=T(S(),1);function kD(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 Adt=new we,Yye=new we,Mdt=new $;function Ndt(e,t,n,i){let o=e.direction,r=e.right,s=e.up,a=we.fromAxisAngle(o,n,Yye),c=we.fromAxisAngle(r,i,Adt),d=we.multiply(c,a,c),u=we.fromAxisAngle(s,t,Yye);we.multiply(u,d,d);let m=$.fromQuaternion(d,Mdt);$.multiplyByVector(m,r,r),$.multiplyByVector(m,s,s),$.multiplyByVector(m,o,o)}kD.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;Ndt(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};kD.prototype.isDestroyed=function(){return!1};kD.prototype.destroy=function(){return this._removeListener(),me(this)};var dF=kD;var e2i=T(S(),1);function kdt(e){this.direction=h.clone(e.direction),this.color=Y.clone(y(e.color,Y.WHITE)),this.intensity=y(e.intensity,1)}var a8=kdt;var V2i=T(S(),1);var c8={position:0};function UD(e){e=y(e,y.EMPTY_OBJECT),this.center=h.clone(y(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=F.clone(y(e.modelMatrix,F.IDENTITY)),this._modelMatrix=new F,this._computedModelMatrix=new F,this.show=y(e.show,!0),this.material=y(e.material,Ui.fromType(Ui.ColorType)),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.onlySunLighting=y(e.onlySunLighting,!1),this._onlySunLighting=!1,this._depthTestEnabled=y(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 tt({owner:y(e._owner,this)}),this._pickCommand=new tt({owner:y(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 Udt(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=xl.createGeometry(xl.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Pe.POSITION_ONLY}));return t=mi.fromGeometry({context:e,geometry:n,attributeLocations:c8,bufferUsage:Me.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}UD.prototype.update=function(e){if(!this.show||e.mode!==oe.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=Ue.fromCache({cull:{enabled:!0,face:yi.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?un.ALPHA_BLEND:void 0})),l(this._va)||(this._va=Udt(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}(!F.equals(this.modelMatrix,this._modelMatrix)||!h.equals(this.center,this._center))&&(F.clone(this.modelMatrix,this._modelMatrix),h.clone(this.center,this._center),F.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:[AV]}),p=new Oe({sources:[this.material.shaderSource,FV]}),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=rn.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:p,attributeLocations:c8}),u.vertexArray=this._va,u.renderState=this._rs,u.shaderProgram=this._sp,u.uniformMap=_t(this._uniforms,this.material._uniforms),u.executeInClosestFrustum=n);let g=e.commandList,f=e.passes;if(f.render&&(u.boundingVolume=this._boundingSphere,u.debugShowBoundingVolume=this.debugShowBoundingVolume,u.modelMatrix=this._computedModelMatrix,u.pass=n?Re.TRANSLUCENT:Re.OPAQUE,g.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:[AV]}),p=new Oe({sources:[this.material.shaderSource,FV],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=rn.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:m,fragmentShaderSource:p,attributeLocations:c8}),x.vertexArray=this._va,x.renderState=this._rs,x.shaderProgram=this._pickSP,x.uniformMap=_t(_t(this._uniforms,this._pickUniforms),this.material._uniforms),x.executeInClosestFrustum=n),x.boundingVolume=this._boundingSphere,x.modelMatrix=this._computedModelMatrix,x.pass=n?Re.TRANSLUCENT:Re.OPAQUE,g.push(x)}};UD.prototype.isDestroyed=function(){return!1};UD.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(),me(this)};var uF=UD;var A2i=T(S(),1);var R2i=T(S(),1),mF=`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 G2i=T(S(),1),hF=`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 PT(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.aboveGround,!1);this.material=l(e.material)?e.material:Ui.fromType(Ui.ColorType),this.translucent=y(e.translucent,!0),this._vertexShaderSource=y(e.vertexShaderSource,hF),this._fragmentShaderSource=y(e.fragmentShaderSource,mF),this._renderState=ji.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=y(e.flat,!1),this._faceForward=y(e.faceForward,n),this._aboveGround=n}Object.defineProperties(PT.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 PT.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});PT.VERTEX_FORMAT=Pe.POSITION_AND_ST;PT.prototype.getFragmentShaderSource=ji.prototype.getFragmentShaderSource;PT.prototype.isTranslucent=ji.prototype.isTranslucent;PT.prototype.getRenderState=ji.prototype.getRenderState;var l8=PT;var B2i=T(S(),1);function Oye(){this.enabled=!0,this.renderable=!0,this.density=2e-4,this.screenSpaceErrorFactor=2,this.minimumBrightness=.03}var DD=[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],Of=[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<Of.length;++e)Of[e]*=1e6;var Hye=Of[1],d8=Of[Of.length-1];for(let e=0;e<Of.length;++e)Of[e]=(Of[e]-d8)/(Hye-d8);var ma=0;function Ddt(e){let t=DD,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 Bdt=new h;Oye.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!==oe.SCENE3D){e.fog.enabled=!1,e.fog.density=0;return}let o=i.height,r=Ddt(o),s=W.clamp((o-DD[r])/(DD[r+1]-DD[r]),0,1),a=W.lerp(Of[r],Of[r+1],s),c=this.density*1e6,d=c/Hye*d8;a=a*(c-d)*1e-6;let u=h.normalize(n.positionWC,Bdt),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 fF=Oye;var j2i=T(S(),1);function Kl(e){this._scene=e.scene,this.samplingWindow=y(e.samplingWindow,Kl.defaultSettings.samplingWindow),this.quietPeriod=y(e.quietPeriod,Kl.defaultSettings.quietPeriod),this.warmupPeriod=y(e.warmupPeriod,Kl.defaultSettings.warmupPeriod),this.minimumFrameRateDuringWarmup=y(e.minimumFrameRateDuringWarmup,Kl.defaultSettings.minimumFrameRateDuringWarmup),this.minimumFrameRateAfterWarmup=y(e.minimumFrameRateAfterWarmup,Kl.defaultSettings.minimumFrameRateAfterWarmup),this._lowFrameRate=new be,this._nominalFrameRate=new be,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){Ydt(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(){Odt(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}Kl.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};Kl.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new Kl({scene:e})),e._frameRateMonitor};Object.defineProperties(Kl.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}}});Kl.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};Kl.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};Kl.prototype.isDestroyed=function(){return!1};Kl.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),me(this)};function Ydt(e,t){if(e._pauseCount>0)return;let n=_i();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/zn.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/zn.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/zn.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 Odt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var pF=Kl;var ePi=T(S(),1);function Hdt(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=oe.SCENE3D,this.morphTime=oe.getMorphTime(oe.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,pickVoxel:!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 bF=Hdt;var oPi=T(S(),1);function zdt(e,t){this.near=y(e,0),this.far=y(t,0);let n=Re.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 gF=zdt;var dPi=T(S(),1);function Kdt(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=Jdt:e==="xml"?n=$dt:(e==="html"||e==="text")&&(n=zye)),this.callback=n}function Jdt(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let o=n[i],r=new Vh;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 u8="http://www.mapinfo.com/mxp",Qdt="http://www.esri.com/wms",jdt="http://www.opengis.net/wfs",qdt="http://www.opengis.net/gml";function $dt(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===u8)return eut(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===Qdt)return tut(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===jdt)return nut(e);if(t.localName==="ServiceExceptionReport")throw new ue(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?iut(e):out(e)}function eut(e){let t=[],i=e.documentElement.getElementsByTagNameNS(u8,"Feature");for(let o=0;o<i.length;++o){let r=i[o],s={},a=r.getElementsByTagNameNS(u8,"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 Vh;c.data=r,c.properties=s,c.configureNameFromProperties(s),c.configureDescriptionFromProperties(s),t.push(c)}return t}function tut(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(BD(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(BD(a,i))}}return n}function nut(e){let t=[],i=e.documentElement.getElementsByTagNameNS(qdt,"featureMember");for(let o=0;o<i.length;++o){let r=i[o],s={};m8(r,s),t.push(BD(r,s))}return t}function iut(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 ue("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={};m8(s,a),t.push(BD(s,a))}}return t}function m8(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()&&m8(o,t)&&(t[o.localName]=o.textContent)}return n}function BD(e,t){let n=new Vh;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function out(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let o=new Vh;return o.data=e,o.description=n.innerHTML,[o]}var rut=/<body>\s*<\/body>/im,sut=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,aut=/<title>([\s\S]*)<\/title>/im;function zye(e){if(rut.test(e)||sut.test(e))return;let t,n=aut.exec(e);n&&n.length>1&&(t=n[1]);let i=new Vh;return i.name=t,i.description=e,i.data=e,[i]}var vT=Kdt;var oNi=T(S(),1);var SPi=T(S(),1);var fPi=T(S(),1);var cut=new D;function lut(e,t){let n=e.unionClippingRegions,i=e.length,o=as.useFloatTexture(t),r=as.getTextureResolution(e,t,cut),s=r.x,a=r.y,c=o?mut(s,a):hut(s,a);return c+=`
`,c+=n?dut(i):uut(i),c}function dut(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 uut(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 mut(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 hut(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 $0=lut;function fut(e,t,n,i,o,r){this.numberOfDayTextures=e,this.flags=t,this.material=n,this.shaderProgram=i,this.clippingShaderState=o,this.clippingPolygonShaderState=r}function h8(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}function put(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 oe.SCENE3D:o=t;break;case oe.SCENE2D:case oe.COLUMBUS_VIEW:o=n;break;case oe.MORPHING:o=i;break}return o}function but(e){return e.webgl2?`void clipPolygons(highp sampler2D clippingDistance, int regionsLength, vec2 clippingPosition, int regionIndex) {
    czm_clipPolygons(clippingDistance, regionsLength, clippingPosition, regionIndex);
  }`:`void clipPolygons(highp sampler2D clippingDistance, int regionsLength, vec2 clippingPosition, int regionIndex) {
    }`}function gut(e){return e.webgl2?`vec4 unpackClippingExtents(highp sampler2D extentsTexture, int index) {
    return czm_unpackClippingExtents(extentsTexture, index);
  }`:`vec4 unpackClippingExtents(highp sampler2D extentsTexture, int index) {
      return vec4();
    }`}function yut(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}h8.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.hasWaterMask,g=e.showReflectiveOcean,f=e.showOceanWaves,x=e.enableLighting,_=e.dynamicAtmosphereLighting,C=e.dynamicAtmosphereLightingFromSun,V=e.showGroundAtmosphere,L=e.perFragmentGroundAtmosphere,Z=e.hasVertexNormals,E=e.useWebMercatorProjection,X=e.enableFog,v=e.enableClippingPlanes,P=e.clippingPlanes,A=e.enableClippingPolygons,M=e.clippingPolygons,b=e.clippedByBoundaries,R=e.hasImageryLayerCutout,G=e.colorCorrect,I=e.highlightFillTile,w=e.colorToAlpha,N=e.hasGeodeticSurfaceNormals,B=e.hasExaggeration,U=e.showUndergroundColor,O=e.translucent,k=0,J="",te=n.renderedMesh.encoding;te.quantization===Ys.BITS12&&(k=1,J="QUANTIZATION_BITS12");let j=0,ee="";b&&(j=1,ee="TILE_LIMIT_RECTANGLE");let fe=0,_e="";R&&(fe=1,_e="APPLY_IMAGERY_CUTOUT");let le=t.mode,ge=le|o<<2|r<<3|s<<4|a<<5|c<<6|d<<7|p<<8|g<<9|f<<10|x<<11|_<<12|C<<13|V<<14|L<<15|Z<<16|E<<17|X<<18|k<<19|m<<20|v<<21|A<<22|j<<23|fe<<24|G<<25|I<<26|w<<27|N<<28|B<<29|U<<30|O<<31|u<<32,Se=0;l(P)&&P.length>0&&(Se=v?P.clippingPlanesState:0);let Ie=0;l(M)&&M.length>0&&(Ie=A?M.clippingPolygonsState:0);let Le=n.surfaceShader;if(l(Le)&&Le.numberOfDayTextures===i&&Le.flags===ge&&Le.material===this.material&&Le.clippingShaderState===Se&&Le.clippingPolygonShaderState===Ie)return Le.shaderProgram;let ke=this._shadersByTexturesFlags[i];if(l(ke)||(ke=this._shadersByTexturesFlags[i]=[]),Le=ke[ge],!l(Le)||Le.material!==this.material||Le.clippingShaderState!==Se||Le.clippingPolygonShaderState!==Ie){let Be=this.baseVertexShaderSource.clone(),st=this.baseFragmentShaderSource.clone();Se!==0&&st.sources.unshift($0(P,t.context)),Ie!==0&&(st.sources.unshift(but(t.context)),Be.sources.unshift(gut(t.context))),Be.defines.push(J),st.defines.push(`TEXTURE_UNITS ${i}`,ee,_e),o&&st.defines.push("APPLY_BRIGHTNESS"),r&&st.defines.push("APPLY_CONTRAST"),s&&st.defines.push("APPLY_HUE"),a&&st.defines.push("APPLY_SATURATION"),c&&st.defines.push("APPLY_GAMMA"),d&&st.defines.push("APPLY_ALPHA"),u&&st.defines.push("APPLY_DAY_NIGHT_ALPHA"),p&&st.defines.push("HAS_WATER_MASK"),g&&(st.defines.push("SHOW_REFLECTIVE_OCEAN"),Be.defines.push("SHOW_REFLECTIVE_OCEAN")),f&&st.defines.push("SHOW_OCEAN_WAVES"),w&&st.defines.push("APPLY_COLOR_TO_ALPHA"),U&&(Be.defines.push("UNDERGROUND_COLOR"),st.defines.push("UNDERGROUND_COLOR")),O&&(Be.defines.push("TRANSLUCENT"),st.defines.push("TRANSLUCENT")),x&&(Z?(Be.defines.push("ENABLE_VERTEX_LIGHTING"),st.defines.push("ENABLE_VERTEX_LIGHTING")):(Be.defines.push("ENABLE_DAYNIGHT_SHADING"),st.defines.push("ENABLE_DAYNIGHT_SHADING"))),_&&(Be.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),st.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),C&&(Be.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),st.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),V&&(Be.defines.push("GROUND_ATMOSPHERE"),st.defines.push("GROUND_ATMOSPHERE"),L&&(Be.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),st.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),Be.defines.push("INCLUDE_WEB_MERCATOR_Y"),st.defines.push("INCLUDE_WEB_MERCATOR_Y"),X&&(Be.defines.push("FOG"),st.defines.push("FOG")),m&&st.defines.push("APPLY_SPLIT"),v&&st.defines.push("ENABLE_CLIPPING_PLANES"),A&&(st.defines.push("ENABLE_CLIPPING_POLYGONS"),Be.defines.push("ENABLE_CLIPPING_POLYGONS"),M.inverse&&st.defines.push("CLIPPING_INVERSE"),st.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${M.extentsCount}`),Be.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${M.extentsCount}`)),G&&st.defines.push("COLOR_CORRECT"),I&&st.defines.push("HIGHLIGHT_FILL_TILE"),N&&Be.defines.push("GEODETIC_SURFACE_NORMALS"),B&&Be.defines.push("EXAGGERATION");let vt=`    vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend)
    {
        vec4 color = initialColor;
`;R&&(vt+=`        vec4 cutoutAndColorResult;
        bool texelUnclipped;
`);for(let Xe=0;Xe<i;++Xe)R?vt+=`        cutoutAndColorResult = u_dayTextureCutoutRectangles[${Xe}];
        texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y;
        cutoutAndColorResult = sampleAndBlend(
`:vt+=`        color = sampleAndBlend(
`,vt+=`            color,
            u_dayTextures[${Xe}],
            u_dayTextureUseWebMercatorT[${Xe}] ? textureCoordinates.xz : textureCoordinates.xy,
            u_dayTextureTexCoordsRectangle[${Xe}],
            u_dayTextureTranslationAndScale[${Xe}],
            ${d?`u_dayTextureAlpha[${Xe}]`:"1.0"},
            ${u?`u_dayTextureNightAlpha[${Xe}]`:"1.0"},
${u?`u_dayTextureDayAlpha[${Xe}]`:"1.0"},
${o?`u_dayTextureBrightness[${Xe}]`:"0.0"},
            ${r?`u_dayTextureContrast[${Xe}]`:"0.0"},
            ${s?`u_dayTextureHue[${Xe}]`:"0.0"},
            ${a?`u_dayTextureSaturation[${Xe}]`:"0.0"},
            ${c?`u_dayTextureOneOverGamma[${Xe}]`:"0.0"},
            ${m?`u_dayTextureSplit[${Xe}]`:"0.0"},
            ${w?`u_colorsToAlpha[${Xe}]`:"vec4(0.0)"},
        nightBlend        );
`,R&&(vt+=`        color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color);
`);vt+=`        return color;
    }`,st.sources.push(vt),Be.sources.push(put(le)),Be.sources.push(yut(E));let Ct=rn.fromCache({context:t.context,vertexShaderSource:Be,fragmentShaderSource:st,attributeLocations:te.getAttributeLocations()});Le=ke[ge]=new fut(i,ge,this.material,Ct,Se,Ie)}return n.surfaceShader=Le,Le.shaderProgram};h8.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 me(this)};var yF=h8;var WAi=T(S(),1);var ivi=T(S(),1);var VPi=T(S(),1),xut={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7},si=Object.freeze(xut);var RPi=T(S(),1),_ut={START:0,LOADING:1,DONE:2,FAILED:3},Ks=Object.freeze(_ut);var GPi=T(S(),1),Tut={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6},ao=Object.freeze(Tut);function tr(){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=ao.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(tr.prototype,{eligibleForUnloading:{get:function(){let e=this.terrainState,n=!(e===ao.RECEIVING||e===ao.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!==si.TRANSITIONING}return n}},renderedMesh:{get:function(){if(l(this.vertexArray))return this.mesh;if(l(this.fill))return this.fill.mesh}}});var Sut=new he;function f8(e,t,n,i,o,r){let s=e.getExaggeratedPosition(i,o,r);if(l(t)&&t!==oe.SCENE3D){let c=n.ellipsoid.cartesianToCartographic(s,Sut);s=n.project(c,r),s=h.fromElements(s.z,s.x,s.y,r)}return s}var Cut=new h,Vut=new h,Lut=new h;tr.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],g=a[m+1],f=a[m+2],x=f8(c,t,n,s,p,Cut),_=f8(c,t,n,s,g,Vut),C=f8(c,t,n,s,f,Lut),V=qn.rayTriangleParametric(e,x,_,C,i);l(V)&&V<u&&V>=0&&(u=V)}return u!==Number.MAX_VALUE?pn.getPoint(e,u,o):void 0};tr.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=ao.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()};tr.prototype.freeVertexArray=function(){tr._freeVertexArray(this.vertexArray),this.vertexArray=void 0,tr._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0};tr.initialize=function(e,t,n){let i=e.data;l(i)||(i=e.data=new tr),e.state===Ks.START&&(Rut(e,t,n),e.state=Ks.LOADING)};tr.processStateMachine=function(e,t,n,i,o,r,s){tr.initialize(e,n,i);let a=e.data;if(e.state===Ks.LOADING&&Zut(e,t,n,i,o,r),s)return;let c=e.renderable;e.renderable=l(a.vertexArray);let d=a.terrainState===ao.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 g in m)m.hasOwnProperty(g)&&(m[g](e)||(p[g]=m[g]));e._loadedCallbacks=p,e.state=Ks.DONE}c&&(e.renderable=!0)};tr.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===si.PLACEHOLDER){let g=m.loadingImagery.imageryLayer;if(g.ready){m.freeResources(),c.splice(d,1),g._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===si.FAILED||m.loadingImagery.state===si.INVALID)}return e.upsampledFromParent=r,e.renderable=e.renderable&&(s||a),a};function Kye(e,t,n,i){let o=e.renderedMesh,r=o.vertices,s=o.encoding,a=r.length/s.stride,c=xc.clone(s);c.hasGeodeticSurfaceNormals=t,c=xc.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?(tr._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=tr._createVertexArrayForMesh(i.context,o)):(tr._freeVertexArray(e.vertexArray),e.vertexArray=tr._createVertexArrayForMesh(i.context,o)),tr._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}tr.prototype.addGeodeticSurfaceNormals=function(e,t){Kye(this,!0,e,t)};tr.prototype.removeGeodeticSurfaceNormals=function(e){Kye(this,!1,void 0,e)};tr.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 g=0;g<p;g++){let f=m[g];f.level=-1}}}};function Rut(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=ao.FAILED);for(let o=0,r=n.length;o<r;++o){let s=n.get(o);s.show&&s._createTileImagerySkeletons(e,t)}}function Zut(e,t,n,i,o,r){let s=e.data,a=e.parent;if(s.terrainState===ao.FAILED&&a!==void 0&&(a.data!==void 0&&a.data.terrainData!==void 0&&a.data.terrainData.canUpsample!==!1||tr.processStateMachine(a,t,n,i,o,r,!0)),s.terrainState===ao.FAILED&&Gut(s,e,t,n,e.x,e.y,e.level),s.terrainState===ao.UNLOADED&&Eut(s,n,e.x,e.y,e.level),s.terrainState===ao.RECEIVED&&Iut(s,t,n,e.x,e.y,e.level),s.terrainState===ao.TRANSFORMED&&(Wut(s,t.context,n,e.x,e.y,e.level,r),s.updateExaggeration(e,t,o)),s.terrainState>=ao.RECEIVED&&s.waterMaskTexture===void 0&&n.hasWaterMask)if(s.terrainData.waterMask!==void 0)vut(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 Gut(e,t,n,i,o,r,s){let a=t.parent;if(!a){t.state=Ks.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=ao.RECEIVING,Promise.resolve(p).then(function(g){l(g)&&(e.terrainData=g,e.terrainState=ao.RECEIVED)}).catch(function(){e.terrainState=ao.FAILED}))}function Eut(e,t,n,i,o){function r(c){if(!l(c)){e.terrainState=ao.UNLOADED,e.request=void 0;return}e.terrainData=c,e.terrainState=ao.RECEIVED,e.request=void 0}function s(c){if(e.request.state===jn.CANCELLED){e.terrainData=void 0,e.terrainState=ao.UNLOADED,e.request=void 0;return}e.terrainState=ao.FAILED,e.request=void 0;let d=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${o}. Error message: "${c}"`;t._requestError=Zo.reportError(t._requestError,t,t.errorEvent,d,n,i,o),t._requestError.retry&&a()}function a(){let c=new Oo({throttle:!1,throttleByServer:!0,type:is.TERRAIN});e.request=c;let d=t.requestTileGeometry(n,i,o,c);l(d)?(e.terrainState=ao.RECEIVING,Promise.resolve(d).then(function(u){r(u)}).catch(function(u){s(u)})):(e.terrainState=ao.UNLOADED,e.request=void 0)}a()}var Xut={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function Iut(e,t,n,i,o,r){let s=n.tilingScheme,a=Xut;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=ao.TRANSFORMING,Promise.resolve(d).then(function(u){e.mesh=u,e.terrainState=ao.TRANSFORMED}).catch(function(){e.terrainState=ao.FAILED}))}tr._createVertexArrayForMesh=function(e,t){let n=t.vertices,i=yt.createVertexBuffer({context:e,typedArray:n,usage:Me.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=yt.createIndexBuffer({context:e,typedArray:a,usage:Me.STATIC_DRAW,indexDatatype:Ae.fromSizeInBytes(a.BYTES_PER_ELEMENT)}),s.vertexArrayDestroyable=!1,s.referenceCount=1,r[e.id]=s,t.indices.indexBuffers=r}else++s.referenceCount;return new mi({context:e,attributes:o,indexBuffer:s})};tr._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 Wut(e,t,n,i,o,r,s){e.vertexArray=tr._createVertexArrayForMesh(t,e.mesh),e.terrainState=ao.READY,e.fill=e.fill&&e.fill.destroy(s)}function Put(e){let t=e.cache.tile_waterMaskData;if(!l(t)){let n=Ft.create({context:e,pixelFormat:at.LUMINANCE,pixelDatatype:nt.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new $t({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:qt.LINEAR,magnificationFilter:ui.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function vut(e,t){let n=t.terrainData.waterMask,i=Put(e),o,r=n.length;if(r===1)if(n[0]!==0)o=i.allWaterTexture;else return;else{let s=Math.sqrt(r);o=Ft.create({context:e,pixelFormat:at.LUMINANCE,pixelDatatype:nt.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)}tr.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};tr.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 tm=tr;var a9i=T(S(),1);var mFi=T(S(),1);var rFi=T(S(),1);var vvi=T(S(),1);var xvi=T(S(),1);var Jye=/{[^}]+}/g,Qye={x:Mut,y:kut,z:But,s:Yut,reverseX:Nut,reverseY:Uut,reverseZ:Dut,westDegrees:Out,southDegrees:Hut,eastDegrees:zut,northDegrees:Kut,westProjected:Jut,southProjected:Qut,eastProjected:jut,northProjected:qut,width:$ut,height:emt},wut=_t(Qye,{i:tmt,j:nmt,reverseI:imt,reverseJ:omt,longitudeDegrees:smt,latitudeDegrees:amt,longitudeProjected:cmt,latitudeProjected:lmt,format:umt});function xF(e){e=y(e,y.EMPTY_OBJECT),this._errorEvent=new be;let t=Ee.createIfNeeded(e.url),n=Ee.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=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._minimumLevel=y(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._tilingScheme=y(e.tilingScheme,new jr({ellipsoid:e.ellipsoid})),this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._rectangle=ae.intersection(this._rectangle,this._tilingScheme.rectangle),this._tileDiscardPolicy=e.tileDiscardPolicy;let o=e.credit;typeof o=="string"&&(o=new Rt(o)),this._credit=o,this._hasAlphaChannel=y(e.hasAlphaChannel,!0);let r=e.customTags,s=_t(Qye,r),a=_t(wut,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=y(e.enablePickFeatures,!0)}Object.defineProperties(xF.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}}});xF.prototype.getTileCredits=function(e,t,n){};xF.prototype.requestImage=function(e,t,n,i){return il.loadImage(this,Fut(this,e,t,n,i))};xF.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=Aut(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 YD=!1,Kd=new ae,OD=!1,_F=new ae;function Fut(e,t,n,i,o){YD=!1,OD=!1;let r=e._resource,s=r.getUrlComponent(!0),a=e._tags,c={},d=s.match(Jye);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 p8=!1,JV=new D,b8=!1;function Aut(e,t,n,i,o,r,s){YD=!1,OD=!1,p8=!1,b8=!1;let a=e._pickFeaturesResource,c=a.getUrlComponent(!0),d=e._pickFeaturesTags,u={},m=c.match(Jye);return l(m)&&m.forEach(function(p){let g=p.substring(1,p.length-1);l(d[g])&&(u[g]=d[g](e,t,n,i,o,r,s))}),a.getDerivedResource({templateValues:u})}function QV(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 Mut(e,t,n,i){return QV(e,"{x}",t)}function Nut(e,t,n,i){let o=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return QV(e,"{reverseX}",o)}function kut(e,t,n,i){return QV(e,"{y}",n)}function Uut(e,t,n,i){let o=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return QV(e,"{reverseY}",o)}function Dut(e,t,n,i){let o=e.maximumLevel,r=l(o)&&i<o?o-i-1:i;return QV(e,"{reverseZ}",r)}function But(e,t,n,i){return QV(e,"{z}",i)}function Yut(e,t,n,i){let o=(t+n+i)%e._subdomains.length;return e._subdomains[o]}function HD(e,t,n,i){YD||(e.tilingScheme.tileXYToRectangle(t,n,i,Kd),Kd.west=W.toDegrees(Kd.west),Kd.south=W.toDegrees(Kd.south),Kd.east=W.toDegrees(Kd.east),Kd.north=W.toDegrees(Kd.north),YD=!0)}function Out(e,t,n,i){return HD(e,t,n,i),Kd.west}function Hut(e,t,n,i){return HD(e,t,n,i),Kd.south}function zut(e,t,n,i){return HD(e,t,n,i),Kd.east}function Kut(e,t,n,i){return HD(e,t,n,i),Kd.north}function zD(e,t,n,i){OD||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,_F),OD=!0)}function Jut(e,t,n,i){return zD(e,t,n,i),_F.west}function Qut(e,t,n,i){return zD(e,t,n,i),_F.south}function jut(e,t,n,i){return zD(e,t,n,i),_F.east}function qut(e,t,n,i){return zD(e,t,n,i),_F.north}function $ut(e,t,n,i){return e.tileWidth}function emt(e,t,n,i){return e.tileHeight}function tmt(e,t,n,i,o,r,s){return KD(e,t,n,i,o,r),JV.x}function nmt(e,t,n,i,o,r,s){return KD(e,t,n,i,o,r),JV.y}function imt(e,t,n,i,o,r,s){return KD(e,t,n,i,o,r),e.tileWidth-JV.x-1}function omt(e,t,n,i,o,r,s){return KD(e,t,n,i,o,r),e.tileHeight-JV.y-1}var rmt=new ae,KV=new h;function KD(e,t,n,i,o,r,s){if(p8)return;g8(e,t,n,i,o,r);let a=KV,c=e.tilingScheme.tileXYToNativeRectangle(t,n,i,rmt);JV.x=e.tileWidth*(a.x-c.west)/c.width|0,JV.y=e.tileHeight*(c.north-a.y)/c.height|0,p8=!0}function smt(e,t,n,i,o,r,s){return W.toDegrees(o)}function amt(e,t,n,i,o,r,s){return W.toDegrees(r)}function cmt(e,t,n,i,o,r,s){return g8(e,t,n,i,o,r),KV.x}function lmt(e,t,n,i,o,r,s){return g8(e,t,n,i,o,r),KV.y}var dmt=new he;function g8(e,t,n,i,o,r,s){if(!b8){if(e.tilingScheme.projection instanceof Li)KV.x=W.toDegrees(o),KV.y=W.toDegrees(r);else{let a=dmt;a.longitude=o,a.latitude=r,e.tilingScheme.projection.project(a,KV)}b8=!0}}function umt(e,t,n,i,o,r,s){return s}var Ma=xF;function nm(e){Ma.call(this,e)}nm._requestMetadata=async function(e,t,n,i){try{let o=await n.fetchXML();return nm._metadataSuccess(o,e,t,n,i)}catch(o){if(o instanceof Nh)return nm._metadataFailure(e,t);throw o}};nm.fromUrl=async function(e,t){let n=Ee.createIfNeeded(e);n.appendForwardSlash();let i=n,o=n.getDerivedResource({url:"tilemapresource.xml"});t=y(t,y.EMPTY_OBJECT);let r=await nm._requestMetadata(t,i,o);return new nm(r)};l(Object.create)&&(nm.prototype=Object.create(Ma.prototype),nm.prototype.constructor=nm);function jye(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 qye(e,t,n){let i=e.positionToTileXY(ae.southwest(t),n),o=e.positionToTileXY(ae.northeast(t),n);return(Math.abs(o.x-i.x)+1)*(Math.abs(o.y-i.y)+1)>4?0:n}nm._metadataSuccess=function(e,t,n,i,o){let r=/tileformat/i,s=/tileset/i,a=/tilesets/i,c=/boundingbox/i,d,u,m,p=[],g=e.childNodes[0].childNodes;for(let P=0;P<g.length;P++)if(r.test(g.item(P).nodeName))d=g.item(P);else if(a.test(g.item(P).nodeName)){m=g.item(P);let A=g.item(P).childNodes;for(let M=0;M<A.length;M++)s.test(A.item(M).nodeName)&&p.push(A.item(M))}else c.test(g.item(P).nodeName)&&(u=g.item(P));let f;if(!l(m)||!l(u))throw f=`Unable to find expected tilesets or bbox attributes in ${i.url}.`,l(o)&&Zo.reportError(void 0,o,o.errorEvent,f),new ue(f);let x=y(t.fileExtension,d.getAttribute("extension")),_=y(t.tileWidth,parseInt(d.getAttribute("width"),10)),C=y(t.tileHeight,parseInt(d.getAttribute("height"),10)),V=y(t.minimumLevel,parseInt(p[0].getAttribute("order"),10)),L=y(t.maximumLevel,parseInt(p[p.length-1].getAttribute("order"),10)),Z=m.getAttribute("profile"),E=t.tilingScheme;if(!l(E))if(Z==="geodetic"||Z==="global-geodetic")E=new Di({ellipsoid:t.ellipsoid});else if(Z==="mercator"||Z==="global-mercator")E=new jr({ellipsoid:t.ellipsoid});else throw f=`${i.url} specifies an unsupported profile attribute, ${Z}.`,l(o)&&Zo.reportError(void 0,o,o.errorEvent,f),new ue(f);let X=ae.clone(t.rectangle);if(!l(X)){let P,A,M,b;y(t.flipXY,!1)?(M=new D(parseFloat(u.getAttribute("miny")),parseFloat(u.getAttribute("minx"))),b=new D(parseFloat(u.getAttribute("maxy")),parseFloat(u.getAttribute("maxx")))):(M=new D(parseFloat(u.getAttribute("minx")),parseFloat(u.getAttribute("miny"))),b=new D(parseFloat(u.getAttribute("maxx")),parseFloat(u.getAttribute("maxy"))));let G=Z==="geodetic"||Z==="mercator";if(E.projection instanceof Li||G)P=he.fromDegrees(M.x,M.y),A=he.fromDegrees(b.x,b.y);else{let I=E.projection;P=I.unproject(M),A=I.unproject(b)}X=new ae(P.longitude,P.latitude,A.longitude,A.latitude)}return X=jye(X,E),V=qye(E,X,V),{url:n.getDerivedResource({url:`{z}/{x}/{reverseY}.${x}`}),tilingScheme:E,rectangle:X,tileWidth:_,tileHeight:C,minimumLevel:V,maximumLevel:L,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit}};nm._metadataFailure=function(e,t){let n=y(e.fileExtension,"png"),i=y(e.tileWidth,256),o=y(e.tileHeight,256),r=e.maximumLevel,s=l(e.tilingScheme)?e.tilingScheme:new jr({ellipsoid:e.ellipsoid}),a=y(e.rectangle,s.rectangle);a=jye(a,s);let c=qye(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 Vy=nm;var Kvi=T(S(),1);function $ye(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}$ye.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function mmt(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 ue(o)}if(!l(i.version)){let o=`Could not find a version in channel (id) ${t.channel}.`;throw new ue(o)}if(t.version=i.version,l(n.projection)&&n.projection==="flat")t.tilingScheme=new Di({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ae(-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 ue(o)}return!0}function hmt(e,t,n){let i=`An error occurred while accessing ${t.url}.`;throw l(e)&&l(e.message)&&(i+=`: ${e.message}`),Zo.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new ue(i)}async function fmt(e,t,n){try{let i=await e.fetchText();mmt(i,t)}catch(i){hmt(i,e,n)}}function Jl(e){e=y(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 Rt(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${Jl.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 be}Object.defineProperties(Jl.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}}});Jl.fromUrl=async function(e,t,n){n=y(n,{});let i=y(n.path,"/default_map"),o=Ee.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 $ye(n);s.channel=t,await fmt(r,s);let a=new Jl(n);return s.build(a),a._resource=o,a._url=e,a._path=i,a};Jl.prototype.getTileCredits=function(e,t,n){};Jl.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 il.loadImage(this,o)};Jl.prototype.pickFeatures=function(e,t,n,i,o){};Jl._logoUrl=void 0;Object.defineProperties(Jl,{logoUrl:{get:function(){return l(Jl._logoUrl)||(Jl._logoUrl=nn("Assets/Images/google_earth_credit.png")),Jl._logoUrl},set:function(e){Jl._logoUrl=e}}});var TF=Jl;var twi=T(S(),1);var pmt=/\/$/,exe=new Rt('&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 jV(e){e=y(e,y.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=Ee.createIfNeeded(y(e.url,"https://{s}.tiles.mapbox.com/v4/"));this._mapId=t,this._accessToken=n;let o=y(e.format,"png");/\./.test(o)||(o=`.${o}`),this._format=o;let r=i.getUrlComponent();pmt.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 Rt(s))):s=exe,this._resource=i,this._imageryProvider=new Ma({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(jV.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}}});jV.prototype.getTileCredits=function(e,t,n){};jV.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};jV.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};jV._defaultCredit=exe;var SF=jV;var hwi=T(S(),1);function wT(e){e=y(e,y.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=y(e.rectangle,ae.MAX_VALUE),n=new Di({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 be;let i=e.credit;typeof i=="string"&&(i=new Rt(i)),this._credit=i;let o=Ee.createIfNeeded(e.url);this._resource=o,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight}Object.defineProperties(wT.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 bmt(e,t,n,i){let o=`Failed to load image ${e.url}`;l(t)&&l(t.message)&&(o+=`: ${t.message}`);let r=Zo.reportError(i,n,l(n)?n._errorEvent:void 0,o,0,0,0,t);if(r.retry)return y8(e,n,r);throw l(n)&&(n._hasError=!0),new ue(o)}async function y8(e,t,n){try{return await il.loadImage(null,e)}catch(i){return bmt(e,i,t,n)}}wT.fromUrl=async function(e,t){let n=Ee.createIfNeeded(e),i=await y8(n);t=y(t,y.EMPTY_OBJECT);let o=new wT({...t,url:e,tileWidth:i.width,tileHeight:i.height});return o._image=i,o};wT.prototype.getTileCredits=function(e,t,n){};wT.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let o=await y8(this._resource,this);return this._image=o,Zo.reportSuccess(this._errorEvent),o}return this._image};wT.prototype.pickFeatures=function(e,t,n,i,o){};var CF=wT;var Iwi=T(S(),1);var _wi=T(S(),1);function VF(e){e=y(e,y.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(VF.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)}}});VF.prototype.getFromCache=function(e,t,n,i){let o=txe(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};VF.prototype.checkApproachingInterval=function(e,t,n,i){let o=txe(e,t,n),r=this._tilesRequestedForInterval,s=nxe(this),a={key:o,priorityFunction:i.priorityFunction};(!l(s)||!ixe(this,a,s))&&r.push(a),r.length>=512&&r.splice(0,256)};VF.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=nxe(this);if(l(r)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let c=s.pop();a=ixe(this,c,r),a||s.push(c)}}};function txe(e,t,n){return`${e}-${t}-${n}`}function gmt(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function nxe(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=q.secondsDifference(c.stop,i),++a):(s=q.secondsDifference(c.start,i),--a),s/=r,a>=0&&s<=5?t.get(a):void 0}function ixe(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=gmt(s),c=new Oo({throttle:!1,throttleByServer:!0,type:is.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=VF;var ymt=[3034,3035,3042,3043,3044],xmt=[4471,4559];function Zh(e){if(e=y(e,y.EMPTY_OBJECT),l(e.times)&&!l(e.clock))throw new pe("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=y(e.getFeatureInfoUrl,e.url);let t=Ee.createIfNeeded(e.url),n=Ee.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(Zh.DefaultParameters,!0),n.setQueryParameters(Zh.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(oxe(e.parameters)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(oxe(e.getFeatureInfoParameters));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 rxe(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=y(e.crs,e.tilingScheme&&e.tilingScheme.projection instanceof Ri?"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&&!xmt.includes(a)||ymt.includes(a))&&(o.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else o.srs=y(e.srs,e.tilingScheme&&e.tilingScheme.projection instanceof Ri?"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 Ma({url:t,pickFeaturesUrl:n,tilingScheme:y(e.tilingScheme,new Di({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:y(e.getFeatureInfoFormats,Zh.DefaultGetFeatureInfoFormats),enablePickFeatures:e.enablePickFeatures})}function rxe(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 _mt(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(Zh.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}}});Zh.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};Zh.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=rxe(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};Zh.prototype.pickFeatures=function(e,t,n,i,o){let r=this._timeDynamicImagery,s=l(r)?r.currentInterval:void 0;return _mt(this,e,t,n,i,o,s)};Zh.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});Zh.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});Zh.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new vT("json","application/json")),Object.freeze(new vT("xml","text/xml")),Object.freeze(new vT("text","text/html"))]);function oxe(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var LF=Zh;var Bwi=T(S(),1);var Tmt=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});function RF(e){e=y(e,y.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=Ee.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(Tmt),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=y(e.format,"image/jpeg"),this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new jr({ellipsoid:e.ellipsoid}),this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._minimumLevel=y(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=y(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,g,f,x){return sxe(s,m,p,g,f,x)},reloadFunction:function(){l(s._reload)&&s._reload()}}));let a=this._tilingScheme.positionToTileXY(ae.southwest(this._rectangle),this._minimumLevel),c=this._tilingScheme.positionToTileXY(ae.northeast(this._rectangle),this._minimumLevel),d=(Math.abs(c.x-a.x)+1)*(Math.abs(c.y-a.y)+1);this._errorEvent=new be;let u=e.credit;this._credit=typeof u=="string"?new Rt(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 sxe(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 g={};g.tilematrix=a,g.layer=e._layer,g.style=e._style,g.tilerow=n,g.tilecol=t,g.tilematrixset=e._tileMatrixSetID,g.format=e._format,l(d)&&(g=_t(g,d)),l(u)&&(g=_t(g,u)),p={s:c[(t+n+i)%c.length]},m=e._resource.getDerivedResource({queryParameters:g,request:o}),m.setTemplateValues(p)}return il.loadImage(e,m)}Object.defineProperties(RF.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())}}});RF.prototype.getTileCredits=function(e,t,n){};RF.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=sxe(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};RF.prototype.pickFeatures=function(e,t,n,i,o){};var ZF=RF;var Smt={ARCGIS_MAPSERVER:Q0.fromUrl,BING:async(e,t)=>Uw.fromUrl(e,t),GOOGLE_EARTH:async(e,t)=>{let n=t.channel;return delete t.channel,TF.fromUrl(e,n,t)},MAPBOX:(e,t)=>new SF({url:e,...t}),SINGLE_TILE:CF.fromUrl,TMS:Vy.fromUrl,URL_TEMPLATE:(e,t)=>new Ma({url:e,...t}),WMS:(e,t)=>new LF({url:e,...t}),WMTS:(e,t)=>new ZF({url:e,...t})};function Hf(e){e=y(e,y.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 be}Object.defineProperties(Hf.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(){}}});Hf.fromAssetId=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=md._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,o=Hf._endpointCache[i];l(o)||(o=n.fetchJson(),Hf._endpointCache[i]=o);let r=await o;if(r.type!=="IMAGERY")throw new ue(`Cesium ion asset ${e} is not an imagery asset.`);let s,a=r.externalType;if(!l(a))s=await Vy.fromUrl(new md(r,n));else{let d=Smt[a];if(!l(d))throw new ue(`Unrecognized Cesium ion imagery type: ${a}`);let u={...r.options},m=u.url;delete u.url,s=await d(m,u)}let c=new Hf(t);return s.errorEvent.addEventListener(function(d){d.provider=c,c._errorEvent.raiseEvent(d)}),c._tileCredits=md.getCreditsFromEndpoint(r,n),c._imageryProvider=s,c};Hf.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};Hf.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};Hf.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};Hf._endpointCache={};var eb=Hf;var aFi=T(S(),1),Cmt={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4},tb=Object.freeze(Cmt);function Vmt(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.style,tb.AERIAL);return eb.fromAssetId(t)}var nb=Vmt;var gFi=T(S(),1);function qV(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=si.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}qV.createPlaceholder=function(e){let t=new qV(e,0,0,0);return t.addReference(),t.state=si.PLACEHOLDER,t};qV.prototype.addReference=function(){++this.referenceCount};qV.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(),me(this),0):this.referenceCount};qV.prototype.processStateMachine=function(e,t,n){this.state===si.UNLOADED&&!n&&(this.state=si.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===si.RECEIVED&&(this.state=si.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===si.READY&&t&&!this.texture;(this.state===si.TEXTURE_LOADED||i)&&(this.state=si.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var $V=qV;var TFi=T(S(),1);function x8(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}x8.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};x8.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,o=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===si.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!==si.READY||!this.useWebMercatorT&&!l(r.texture));)r.state!==si.FAILED&&r.state!==si.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===si.FAILED||i.state===si.INVALID?l(s)?(s.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var eL=x8;function Ti(e,t){this._imageryProvider=e,this._readyEvent=new be,this._errorEvent=new be,t=y(t,y.EMPTY_OBJECT),e=y(e,y.EMPTY_OBJECT),this.alpha=y(t.alpha,y(e._defaultAlpha,1)),this.nightAlpha=y(t.nightAlpha,y(e._defaultNightAlpha,1)),this.dayAlpha=y(t.dayAlpha,y(e._defaultDayAlpha,1)),this.brightness=y(t.brightness,y(e._defaultBrightness,Ti.DEFAULT_BRIGHTNESS)),this.contrast=y(t.contrast,y(e._defaultContrast,Ti.DEFAULT_CONTRAST)),this.hue=y(t.hue,y(e._defaultHue,Ti.DEFAULT_HUE)),this.saturation=y(t.saturation,y(e._defaultSaturation,Ti.DEFAULT_SATURATION)),this.gamma=y(t.gamma,y(e._defaultGamma,Ti.DEFAULT_GAMMA)),this.splitDirection=y(t.splitDirection,Ti.DEFAULT_SPLIT),this.minificationFilter=y(t.minificationFilter,y(e._defaultMinificationFilter,Ti.DEFAULT_MINIFICATION_FILTER)),this.magnificationFilter=y(t.magnificationFilter,y(e._defaultMagnificationFilter,Ti.DEFAULT_MAGNIFICATION_FILTER)),this.show=y(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=y(t.rectangle,ae.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new eL($V.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=y(t.colorToAlphaThreshold,Ti.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD)}Object.defineProperties(Ti.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}}});Ti.DEFAULT_BRIGHTNESS=1;Ti.DEFAULT_CONTRAST=1;Ti.DEFAULT_HUE=0;Ti.DEFAULT_SATURATION=1;Ti.DEFAULT_GAMMA=1;Ti.DEFAULT_SPLIT=Gr.NONE;Ti.DEFAULT_MINIFICATION_FILTER=qt.LINEAR;Ti.DEFAULT_MAGNIFICATION_FILTER=ui.LINEAR;Ti.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;Ti.fromProviderAsync=function(e,t){let n=new Ti(void 0,t);return Emt(n,Promise.resolve(e)),n};Ti.fromWorldImagery=function(e){return e=y(e,y.EMPTY_OBJECT),Ti.fromProviderAsync(nb({style:e.style}),e)};Ti.prototype.isBaseLayer=function(){return this._isBaseLayer};Ti.prototype.isDestroyed=function(){return!1};Ti.prototype.destroy=function(){return me(this)};var lxe=new ae,axe=new ae,_8=new ae,dxe=new ae;Ti.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return ae.intersection(e.rectangle,t)};Ti.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 Ri&&e.rectangle.north<Ri.MaximumLatitude&&e.rectangle.south>-Ri.MaximumLatitude,s=ae.intersection(o.rectangle,this._rectangle,lxe),a=ae.intersection(e.rectangle,s,axe);if(!l(a)){if(!this.isBaseLayer())return!1;let G=s,I=e.rectangle;a=axe,I.south>=G.north?a.north=a.south=G.north:I.north<=G.south?a.north=a.south=G.south:(a.south=Math.max(I.south,G.south),a.north=Math.min(I.north,G.north)),I.west>=G.east?a.west=a.east=G.east:I.east<=G.west?a.west=a.east=G.west:(a.west=Math.max(I.west,G.west),a.east=Math.min(I.east,G.east))}let c=0;a.south>0?c=a.south:a.north<0&&(c=a.north);let u=1*t.getLevelMaximumGeometricError(e.level),m=Zmt(this,u,c);m=Math.max(0,m);let p=o.maximumLevel;if(m>p&&(m=p),l(o.minimumLevel)){let G=o.minimumLevel;m<G&&(m=G)}let g=o.tilingScheme,f=g.positionToTileXY(ae.northwest(a),m),x=g.positionToTileXY(ae.southeast(a),m),_=e.rectangle.width/512,C=e.rectangle.height/512,V=g.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=g.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=ae.clone(e.rectangle,dxe),E=g.tileXYToRectangle(f.x,f.y,m),X=ae.intersection(E,s,_8),v;r?(g.rectangleToNativeRectangle(Z,Z),g.rectangleToNativeRectangle(E,E),g.rectangleToNativeRectangle(X,X),g.rectangleToNativeRectangle(s,s),v=g.tileXYToNativeRectangle.bind(g),_=Z.width/512,C=Z.height/512):v=g.tileXYToRectangle.bind(g);let P,A=0,M=1,b;!this.isBaseLayer()&&Math.abs(X.west-Z.west)>=_&&(A=Math.min(1,(X.west-Z.west)/Z.width)),!this.isBaseLayer()&&Math.abs(X.north-Z.north)>=C&&(M=Math.max(0,(X.north-Z.south)/Z.height));let R=M;for(let G=f.x;G<=x.x;G++)if(P=A,E=v(G,f.y,m),X=ae.simpleIntersection(E,s,_8),!!l(X)){A=Math.min(1,(X.east-Z.west)/Z.width),G===x.x&&(this.isBaseLayer()||Math.abs(X.east-Z.east)<_)&&(A=1),M=R;for(let I=f.y;I<=x.y;I++){if(b=M,E=v(G,I,m),X=ae.simpleIntersection(E,s,_8),!l(X))continue;M=Math.max(0,(X.south-Z.south)/Z.height),I===x.y&&(this.isBaseLayer()||Math.abs(X.south-Z.south)<C)&&(M=0);let w=new se(P,M,A,b),N=this.getImageryFromCache(G,I,m);i.imagery.splice(n,0,new eL(N,w,r)),++n}}return!0};Ti.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,lxe),i=c.rectangleToNativeRectangle(i,dxe)}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)};Ti.prototype._requestImagery=function(e){let t=this._imageryProvider,n=this;function i(s){if(!l(s))return o();e.image=s,e.state=si.RECEIVED,e.request=void 0,Zo.reportSuccess(n._requestImageError)}function o(s){if(e.request.state===jn.CANCELLED){e.state=si.UNLOADED,e.request=void 0;return}e.state=si.FAILED,e.request=void 0;let a=`Failed to obtain image tile X: ${e.x} Y: ${e.y} Level: ${e.level}.`;n._requestImageError=Zo.reportError(n._requestImageError,t,t.errorEvent,a,e.x,e.y,e.level,s),n._requestImageError.retry&&r()}function r(){let s=new Oo({throttle:!1,throttleByServer:!0,type:is.IMAGERY});e.request=s,e.state=si.TRANSITIONING;let a=t.requestImage(e.x,e.y,e.level,s);if(!l(a)){e.state=si.UNLOADED,e.request=void 0;return}l(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),a.then(function(c){i(c)}).catch(function(c){o(c)})}r()};Ti.prototype._createTextureWebGL=function(e,t){let n=new $t({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return l(i.internalFormat)?new Ft({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new Ft({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?at.RGBA:at.RGB,sampler:n})};Ti.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=si.RECEIVED;return}if(r.shouldDiscardImage(i)){t.state=si.INVALID;return}}}let o=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof Ri?t.textureWebMercator=o:t.texture=o,t.image=void 0,t.state=si.TEXTURE_LOADED};function cxe(e,t,n){return`${e}:${t}:${n}`}Ti.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===qt.LINEAR&&i===ui.LINEAR&&!at.isCompressedFormat(t.pixelFormat)&&W.isPowerOfTwo(t.width)&&W.isPowerOfTwo(t.height)){n=qt.LINEAR_MIPMAP_LINEAR;let r=Dt.maximumTextureFilterAnisotropy,s=Math.min(r,y(this._maximumAnisotropy,r)),a=cxe(n,i,s),c=e.cache.imageryLayerMipmapSamplers;l(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let d=c[a];l(d)||(d=c[a]=new $t({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(Oh.NICEST),t.sampler=d}else{let r=cxe(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;l(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[r];l(a)||(a=s[r]=new $t({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}};Ti.prototype._reprojectTexture=function(e,t,n){let i=t.textureWebMercator||t.texture,o=t.rectangle,r=e.context;if(n=y(n,!0),n&&!(this._imageryProvider.tilingScheme.projection instanceof Li)&&o.width/i.width>1e-5){let s=this;t.addReference();let a=new um({persists:!0,owner:this,preExecute:function(c){Rmt(c,r,i,t.rectangle)},postExecute:function(c){t.texture=c,s._finalizeReprojectTexture(r,c),t.state=si.READY,t.releaseReference()},canceled:function(){t.state=si.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(a)}else n&&(t.texture=i),this._finalizeReprojectTexture(r,i),t.state=si.READY};Ti.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};Ti.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){l(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};Ti.prototype.getImageryFromCache=function(e,t,n,i){let o=uxe(e,t,n),r=this._imageryCache[o];return l(r)||(r=new $V(this,e,t,n,i),this._imageryCache[o]=r),r.addReference(),r};Ti.prototype.removeImageryFromCache=function(e){let t=uxe(e.x,e.y,e.level);delete this._imageryCache[t]};function uxe(e,t,n){return JSON.stringify([e,t,n])}var JD={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new D,texture:void 0},Lmt=Ot.supportsTypedArrays()?new Float32Array(2*64):void 0;function Rmt(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 X=0;X<64;++X){let v=X/63;_[C++]=0,_[C++]=v,_[C++]=1,_[C++]=v}let V={position:0,webMercatorT:1},L=Qr.getRegularGridIndices(2,64),Z=yt.createIndexBuffer({context:t,typedArray:L,usage:Me.STATIC_DRAW,indexDatatype:Ae.UNSIGNED_SHORT});o.vertexArray=new mi({context:t,attributes:[{index:V.position,vertexBuffer:yt.createVertexBuffer({context:t,typedArray:_,usage:Me.STATIC_DRAW}),componentsPerAttribute:2},{index:V.webMercatorT,vertexBuffer:yt.createVertexBuffer({context:t,sizeInBytes:64*2*4,usage:Me.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:Z});let E=new Oe({sources:[Zw]});o.shaderProgram=rn.fromCache({context:t,vertexShaderSource:E,fragmentShaderSource:Rw,attributeLocations:V}),o.sampler=new $t({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:qt.LINEAR,magnificationFilter:ui.LINEAR})}n.sampler=o.sampler;let r=n.width,s=n.height;JD.textureDimensions.x=r,JD.textureDimensions.y=s,JD.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 Ft({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,g=i.north,f=Lmt,x=0;for(let _=0;_<64;++_){let C=_/63,V=W.lerp(p,g,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=JD,e.vertexArray=o.vertexArray}function Zmt(e,t,n){let i=e._imageryProvider,o=i.tilingScheme,r=o.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof Li?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 Gmt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function Emt(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){Gmt(e._errorEvent,i)}}var ha=Ti;var I9i=T(S(),1);var l9i=T(S(),1),mxe={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>=mxe.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},Kn=mxe;function nL(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}nL.prototype.update=function(e,t,n){this.changedThisFrame&&(xxe(e,t,this.tile,n),this.changedThisFrame=!1)};nL.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};nL.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):tm._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var Xmt=new rg;nL.updateFillTiles=function(e,t,n,i){let o=e._quadtree,r=o._levelZeroTiles,s=o._lastSelectionFrameNumber,a=Xmt;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);Rs(e,n,c,d,s,gn.EAST,!1,a,i),Rs(e,n,c,u,s,gn.NORTH,!1,a,i),Rs(e,n,c,m,s,gn.WEST,!1,a,i),Rs(e,n,c,p,s,gn.SOUTH,!1,a,i);let g=d.findTileToNorth(r),f=d.findTileToSouth(r),x=m.findTileToNorth(r),_=m.findTileToSouth(r);Rs(e,n,c,g,s,gn.SOUTHEAST,!1,a,i),Rs(e,n,c,x,s,gn.SOUTHWEST,!1,a,i),Rs(e,n,c,f,s,gn.NORTHEAST,!1,a,i),Rs(e,n,c,_,s,gn.NORTHWEST,!1,a,i),c=a.dequeue()}};function Rs(e,t,n,i,o,r,s,a,c){if(i===void 0)return;let d=i;for(;d&&(d._lastSelectionResultFrame!==o||Kn.wasKicked(d._lastSelectionResult)||Kn.originalResult(d._lastSelectionResult)===Kn.CULLED);){if(s)return;let u=d.parent;if(r>=gn.NORTHWEST&&u!==void 0)switch(r){case gn.NORTHWEST:d=d===u.northwestChild?u:void 0;break;case gn.NORTHEAST:d=d===u.northeastChild?u:void 0;break;case gn.SOUTHWEST:d=d===u.southwestChild?u:void 0;break;case gn.SOUTHEAST:d=d===u.southeastChild?u:void 0;break}else d=u}if(d!==void 0){if(d._lastSelectionResult===Kn.RENDERED){if(l(d.data.vertexArray))return;Imt(e,t,n,d,r,o,a,c);return}if(Kn.originalResult(i._lastSelectionResult)!==Kn.CULLED)switch(r){case gn.WEST:Rs(e,t,n,i.northwestChild,o,r,!0,a,c),Rs(e,t,n,i.southwestChild,o,r,!0,a,c);break;case gn.EAST:Rs(e,t,n,i.southeastChild,o,r,!0,a,c),Rs(e,t,n,i.northeastChild,o,r,!0,a,c);break;case gn.SOUTH:Rs(e,t,n,i.southwestChild,o,r,!0,a,c),Rs(e,t,n,i.southeastChild,o,r,!0,a,c);break;case gn.NORTH:Rs(e,t,n,i.northeastChild,o,r,!0,a,c),Rs(e,t,n,i.northwestChild,o,r,!0,a,c);break;case gn.NORTHWEST:Rs(e,t,n,i.northwestChild,o,r,!0,a,c);break;case gn.NORTHEAST:Rs(e,t,n,i.northeastChild,o,r,!0,a,c);break;case gn.SOUTHWEST:Rs(e,t,n,i.southwestChild,o,r,!0,a,c);break;case gn.SOUTHEAST:Rs(e,t,n,i.southeastChild,o,r,!0,a,c);break;default:throw new pe("Invalid edge")}}}function Imt(e,t,n,i,o,r,s,a){let c=i.data;if(c.fill===void 0)c.fill=new nL(i);else if(c.fill.visitedFrame===r)return;c.fill.enqueuedFrame!==r&&(c.fill.enqueuedFrame=r,c.fill.changedThisFrame=!1,s.enqueue(i)),Wmt(e,t,n,i,o,a)}function Wmt(e,t,n,i,o,r){let s=i.data.fill,a,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(xxe(e,t,n,r),c.changedThisFrame=!1),a=n.data.fill.mesh):a=n.data.mesh;let d,u;switch(o){case gn.WEST:d=s.westMeshes,u=s.westTiles;break;case gn.SOUTH:d=s.southMeshes,u=s.southTiles;break;case gn.EAST:d=s.eastMeshes,u=s.eastTiles;break;case gn.NORTH:d=s.northMeshes,u=s.northTiles;break;case gn.NORTHWEST:s.changedThisFrame=s.changedThisFrame||s.northwestMesh!==a,s.northwestMesh=a,s.northwestTile=n;return;case gn.NORTHEAST:s.changedThisFrame=s.changedThisFrame||s.northeastMesh!==a,s.northeastMesh=a,s.northeastTile=n;return;case gn.SOUTHWEST:s.changedThisFrame=s.changedThisFrame||s.southwestMesh!==a,s.southwestMesh=a,s.southwestTile=n;return;case gn.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,g,f,x=n.rectangle,_,C=i.rectangle;switch(o){case gn.WEST:for(_=(C.north-C.south)*W.EPSILON5,m=0;m<u.length&&(g=u[m],f=g.rectangle,!W.greaterThan(x.north,f.south,_));++m);for(p=m;p<u.length&&(g=u[p],f=g.rectangle,!W.greaterThanOrEquals(x.south,f.north,_));++p);break;case gn.SOUTH:for(_=(C.east-C.west)*W.EPSILON5,m=0;m<u.length&&(g=u[m],f=g.rectangle,!W.lessThan(x.west,f.east,_));++m);for(p=m;p<u.length&&(g=u[p],f=g.rectangle,!W.lessThanOrEquals(x.east,f.west,_));++p);break;case gn.EAST:for(_=(C.north-C.south)*W.EPSILON5,m=0;m<u.length&&(g=u[m],f=g.rectangle,!W.lessThan(x.south,f.north,_));++m);for(p=m;p<u.length&&(g=u[p],f=g.rectangle,!W.lessThanOrEquals(x.north,f.south,_));++p);break;case gn.NORTH:for(_=(C.east-C.west)*W.EPSILON5,m=0;m<u.length&&(g=u[m],f=g.rectangle,!W.greaterThan(x.east,f.west,_));++m);for(p=m;p<u.length&&(g=u[p],f=g.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 AT=new he,Pmt=new he,tL=new h,V8=new h,T8=new D,S8=new D,Jd=new D;function n3(){this.height=0,this.encodedNormal=new D}function QD(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,g=0;l(m)&&(p=m.minimumHeight,g=m.maximumHeight),d=(p+g)*.5}return _xe(e,t,n,i,d,c),c}var vmt={minimumHeight:0,maximumHeight:0},wmt=new h,hxe=new n3,fxe=new n3,pxe=new n3,bxe=new n3,Fmt=typeof Uint8Array<"u"?new Uint8Array(9*9):void 0,Amt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function xxe(e,t,n,i){tm.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=qD(r,u,0,1,r.northwestTile,r.northwestMesh,r.northTiles,r.northMeshes,r.westTiles,r.westMeshes,pxe),p=qD(r,u,0,0,r.southwestTile,r.southwestMesh,r.westTiles,r.westMeshes,r.southTiles,r.southMeshes,hxe),g=qD(r,u,1,0,r.southeastTile,r.southeastMesh,r.southTiles,r.southMeshes,r.eastTiles,r.eastMeshes,fxe),f=qD(r,u,1,1,r.northeastTile,r.northeastMesh,r.eastTiles,r.eastMeshes,r.northTiles,r.northMeshes,bxe);m=QD(r,u,0,1,m,p,f,g,pxe),p=QD(r,u,0,0,p,m,g,f,hxe),g=QD(r,u,1,1,g,p,f,m,fxe),f=QD(r,u,1,1,f,g,m,p,bxe);let x=p.height,_=g.height,C=m.height,V=f.height,L=Math.min(x,_,C,V),Z=Math.max(x,_,C,V),E=(L+Z)*.5,X,v,P=e.getLevelMaximumGeometricError(n.level),A=u.maximumRadius-P,M=Math.acos(A/u.maximumRadius)*4;if(M*=1.5,s.width>M&&Z-L<=P){let G=new Fa({width:9,height:9,buffer:Fmt,structure:{heightOffset:Z}}),I=Amt;I.tilingScheme=n.tilingScheme,I.x=n.x,I.y=n.y,I.level=n.level,I.exaggeration=a,I.exaggerationRelativeHeight=c,r.mesh=G._createMeshSync(I)}else{let G=d,I=ae.center(s,Pmt);I.height=E;let w=u.cartographicToCartesian(I,wmt),N=new xc(w,void 0,void 0,void 0,void 0,!0,!0,G,a,c),B=5,U;for(U=r.westMeshes,X=0,v=U.length;X<v;++X)B+=U[X].eastIndicesNorthToSouth.length;for(U=r.southMeshes,X=0,v=U.length;X<v;++X)B+=U[X].northIndicesWestToEast.length;for(U=r.eastMeshes,X=0,v=U.length;X<v;++X)B+=U[X].westIndicesSouthToNorth.length;for(U=r.northMeshes,X=0,v=U.length;X<v;++X)B+=U[X].southIndicesEastToWest.length;let O=vmt;O.minimumHeight=L,O.maximumHeight=Z;let k=N.stride,J=new Float32Array(B*k),H=0,te=H;H=jD(u,s,N,J,H,0,1,m.height,m.encodedNormal,1,O),H=e3(r,u,N,J,H,r.westTiles,r.westMeshes,gn.EAST,O);let z=H;H=jD(u,s,N,J,H,0,0,p.height,p.encodedNormal,0,O),H=e3(r,u,N,J,H,r.southTiles,r.southMeshes,gn.NORTH,O);let j=H;H=jD(u,s,N,J,H,1,0,g.height,g.encodedNormal,0,O),H=e3(r,u,N,J,H,r.eastTiles,r.eastMeshes,gn.WEST,O);let ee=H;H=jD(u,s,N,J,H,1,1,f.height,f.encodedNormal,1,O),H=e3(r,u,N,J,H,r.northTiles,r.northMeshes,gn.SOUTH,O),L=O.minimumHeight,Z=O.maximumHeight;let fe=Gn.fromRectangle(s,L,Z,n.tilingScheme.ellipsoid),_e=Ri.geodeticLatitudeToMercatorAngle(s.south),le=1/(Ri.geodeticLatitudeToMercatorAngle(s.north)-_e),ge=(Ri.geodeticLatitudeToMercatorAngle(I.latitude)-_e)*le,Se=u.geodeticSurfaceNormalCartographic(AT,V8),Ie=wn.octEncode(Se,T8),Le=H;N.encode(J,H*k,fe.center,D.fromElements(.5,.5,Jd),E,Ie,ge,Se),++H;let ke=H,Be=ke<256?1:2,st=(ke-1)*3,vt=st*Be,Ct=(J.length-ke*k)*Float32Array.BYTES_PER_ELEMENT,Xe;if(Ct>=vt){let Ve=ke*k*Float32Array.BYTES_PER_ELEMENT;Xe=ke<256?new Uint8Array(J.buffer,Ve,st):new Uint16Array(J.buffer,Ve,st)}else Xe=ke<256?new Uint8Array(st):new Uint16Array(st);J=new Float32Array(J.buffer,0,ke*k);let je=0;for(X=0;X<ke-2;++X)Xe[je++]=Le,Xe[je++]=X,Xe[je++]=X+1;Xe[je++]=Le,Xe[je++]=X,Xe[je++]=0;let $e=[];for(X=z;X>=te;--X)$e.push(X);let He=[];for(X=j;X>=z;--X)He.push(X);let Ut=[];for(X=ee;X>=j;--X)Ut.push(X);let Ce=[];for(Ce.push(0),X=Le-1;X>=ee;--X)Ce.push(X);r.mesh=new ju(N.center,J,Xe,st,ke,L,Z,ce.fromOrientedBoundingBox(fe),Ymt(e,fe.center,s,L,Z),N.stride,fe,N,$e,He,Ut,Ce)}let b=t.context;r._destroyVertexArray(i),r.vertexArray=tm._createVertexArrayForMesh(b,r.mesh),o.processImagery(n,e.terrainProvider,t,!0);let R=r.waterMaskTexture;if(r.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let G=o._findAncestorTileWithTerrainData(n);l(G)&&l(G.data.waterMaskTexture)&&(r.waterMaskTexture=G.data.waterMaskTexture,++r.waterMaskTexture.referenceCount,o._computeWaterMaskTranslationAndScale(n,G,r.waterMaskTranslationAndScale))}l(R)&&(--R.referenceCount,R.referenceCount===0&&R.destroy())}function jD(e,t,n,i,o,r,s,a,c,d,u){let m=AT;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,tL),g;n.hasGeodeticSurfaceNormals&&(g=e.geodeticSurfaceNormal(p,V8));let f=S8;return f.x=r,f.y=s,n.encode(i,o*n.stride,p,f,a,c,d,g),u.minimumHeight=Math.min(u.minimumHeight,a),u.maximumHeight=Math.max(u.maximumHeight,a),o+1}var t3=new ae;function GF(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=ae.clone(e.rectangle,t3),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=ae.clone(e.rectangle,t3),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),g=(n.y-u)/(m-u);return Math.abs(p)<Math.EPSILON5?p=0:Math.abs(p-1)<Math.EPSILON5&&(p=1),Math.abs(g)<Math.EPSILON5?g=0:Math.abs(g-1)<Math.EPSILON5&&(g=1),i.x=p,i.y=g,i}var Mmt=new D;function C8(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 Nmt=new D,kmt=new h;function Umt(e,t,n,i,o,r,s,a,c,d){let u=i.encoding,m=i.vertices,p=GF(t,n,u.decodeTextureCoordinates(m,o,Jd),Jd),g=GF(t,n,u.decodeTextureCoordinates(m,r,S8),S8),f;c?f=(s-p.x)/(g.x-p.x):f=(a-p.y)/(g.y-p.y);let x=u.decodeHeight(m,o),_=u.decodeHeight(m,r),C=n.rectangle;AT.longitude=W.lerp(C.west,C.east,s),AT.latitude=W.lerp(C.south,C.north,a),d.height=AT.height=W.lerp(x,_,f);let V;if(u.hasVertexNormals){let L=u.getOctEncodedNormal(m,o,Mmt),Z=u.getOctEncodedNormal(m,r,Nmt),E=wn.octDecode(L.x,L.y,tL),X=wn.octDecode(Z.x,Z.y,kmt);V=h.lerp(E,X,f,tL),h.normalize(V,V),wn.octEncode(V,d.encodedNormal)}else V=e.geodeticSurfaceNormalCartographic(AT,tL),wn.octEncode(V,d.encodedNormal)}function _xe(e,t,n,i,o,r){r.height=o;let s=t.geodeticSurfaceNormalCartographic(AT,tL);wn.octEncode(s,r.encodedNormal)}function qD(e,t,n,i,o,r,s,a,c,d,u){if(yxe(e,t,a,s,!1,n,i,u)||yxe(e,t,d,c,!0,n,i,u))return u;let p;if(L8(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],C8(r,p,n,i,u),u;let g;if(n===0?i===0?g=$D(e.westMeshes,e.westTiles,gn.EAST,e.southMeshes,e.southTiles,gn.NORTH,n,i):g=$D(e.northMeshes,e.northTiles,gn.SOUTH,e.westMeshes,e.westTiles,gn.EAST,n,i):i===0?g=$D(e.southMeshes,e.southTiles,gn.NORTH,e.eastMeshes,e.eastTiles,gn.WEST,n,i):g=$D(e.eastMeshes,e.eastTiles,gn.WEST,e.northMeshes,e.northTiles,gn.SOUTH,n,i),l(g))return _xe(e,t,n,i,g,u),u}function $D(e,t,n,i,o,r,s,a){let c=gxe(e,t,!1,n,s,a),d=gxe(i,o,!0,r,s,a);return l(c)&&l(d)?(c+d)*.5:l(c)?c:d}function e3(e,t,n,i,o,r,s,a,c){for(let d=0;d<r.length;++d)o=Dmt(e,t,n,i,o,r[d],s[d],a,c);return o}function Dmt(e,t,n,i,o,r,s,a,c){let d=r.rectangle;a===gn.EAST&&e.tile.x===0?(d=ae.clone(r.rectangle,t3),d.west-=W.TWO_PI,d.east-=W.TWO_PI):a===gn.WEST&&r.x===0&&(d=ae.clone(r.rectangle,t3),d.west+=W.TWO_PI,d.east+=W.TWO_PI);let u=e.tile.rectangle,m,p;o>0&&(n.decodeTextureCoordinates(i,o-1,Jd),m=Jd.x,p=Jd.y);let g,f;switch(a){case gn.WEST:g=s.westIndicesSouthToNorth,f=!1;break;case gn.NORTH:g=s.northIndicesWestToEast,f=!0;break;case gn.EAST:g=s.eastIndicesNorthToSouth,f=!1;break;case gn.SOUTH:g=s.southIndicesEastToWest,f=!0;break}let x=r,_=e.tile,C=s.encoding,V=s.vertices,L=n.stride,Z,E;C.hasWebMercatorT&&(Z=Ri.geodeticLatitudeToMercatorAngle(u.south),E=1/(Ri.geodeticLatitudeToMercatorAngle(u.north)-Z));for(let X=0;X<g.length;++X){let v=g[X],P=C.decodeTextureCoordinates(V,v,Jd);GF(x,_,P,P);let A=P.x,M=P.y,b=f?A:M;if(b<0||b>1||Math.abs(A-m)<W.EPSILON5&&Math.abs(M-p)<W.EPSILON5)continue;let R=Math.abs(A)<W.EPSILON5||Math.abs(A-1)<W.EPSILON5,G=Math.abs(M)<W.EPSILON5||Math.abs(M-1)<W.EPSILON5;if(R&&G)continue;let I=C.decodePosition(V,v,tL),w=C.decodeHeight(V,v),N;C.hasVertexNormals?N=C.getOctEncodedNormal(V,v,T8):(N=T8,N.x=0,N.y=0);let B=M;if(C.hasWebMercatorT){let O=W.lerp(u.south,u.north,M);B=(Ri.geodeticLatitudeToMercatorAngle(O)-Z)*E}let U;n.hasGeodeticSurfaceNormals&&(U=t.geodeticSurfaceNormal(I,V8)),n.encode(i,o*L,I,P,w,N,B,U),c.minimumHeight=Math.min(c.minimumHeight,w),c.maximumHeight=Math.max(c.maximumHeight,w),++o}return o}function gxe(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(!L8(m,u))continue;let p;switch(i){case gn.WEST:p=u.westIndicesSouthToNorth;break;case gn.SOUTH:p=u.southIndicesEastToWest;break;case gn.EAST:p=u.eastIndicesNorthToSouth;break;case gn.NORTH:p=u.northIndicesWestToEast;break}let g=p[n?0:p.length-1];if(l(g))return u.encoding.decodeHeight(u.vertices,g)}}function L8(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function yxe(e,t,n,i,o,r,s,a){let c,d,u,m,p,g=i[o?0:n.length-1],f=n[o?0:n.length-1];if(L8(g,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,Jd);let x=GF(g,e.tile,Jd,Jd);if(x.x===r&&x.y===s)return C8(f,p,r,s,a),!0;if(m=Go(c,d?r:s,function(_,C){f.encoding.decodeTextureCoordinates(f.vertices,_,Jd);let V=GF(g,e.tile,Jd,Jd);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 Umt(t,g,e.tile,f,c[m-1],c[m],r,s,d,a),!0}else return C8(f,c[m],r,s,a),!0}return!1}var Bmt=[new h,new h,new h,new h];function Ymt(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=Bmt;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 iL=nL;function nr(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.showWaterEffect=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.dynamicAtmosphereLighting=!1,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!1,this.shadows=_n.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 be,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(nr.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(nr.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(nr.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(nr.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new be,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 Y(0,0,.5,1),this._clippingPlanes=void 0,this._clippingPolygons=void 0,this.cartographicLimitRectangle=ae.clone(ae.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldVerticalExaggeration=void 0,this._oldVerticalExaggerationRelativeHeight=void 0}Object.defineProperties(nr.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){as.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){Am.setOwner(e,this,"_clippingPolygons")}}});function Omt(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}nr.prototype.update=function(e){this._imageryLayers._update()};function Hmt(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)}}nr.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(i){i.data.imagery.sort(Omt)})),Hmt(this,e);let t=this._vertexArraysToDestroy,n=t.length;for(let i=0;i<n;++i)tm._freeVertexArray(t[i]);t.length=0};nr.prototype.beginUpdate=function(e){let t=this._tilesToRenderByTextureCount;for(let o=0,r=t.length;o<r;++o){let s=t[o];l(s)&&(s.length=0)}let n=this._clippingPlanes;l(n)&&n.enabled&&n.update(e);let i=this._clippingPolygons;l(i)&&i.enabled&&(i.update(e),i.queueCommands(e)),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1};nr.prototype.endUpdate=function(e){if(!l(this._renderState)){this._renderState=Ue.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:tc.LESS}}),this._blendRenderState=Ue.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:tc.LESS_OR_EQUAL},blending:un.ALPHA_BLEND});let s=Ye(this._renderState,!0);s.cull.enabled=!1,this._disableCullingRenderState=Ue.fromCache(s),s=Ye(this._blendRenderState,!0),s.cull.enabled=!1,this._disableCullingBlendRenderState=Ue.fromCache(s)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&iL.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;bht(this,m,e),e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,p.minimumHeight)}}};function Lxe(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)}nr.prototype.updateForPick=function(e){let t=this._drawCommands;for(let n=0,i=this._usedDrawCommands;n<i;++n)Lxe(t[n],e)};nr.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()};nr.prototype.getLevelMaximumGeometricError=function(e){return l(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(e):0};nr.prototype.loadTile=function(e,t){let n=t.data,i=!0,o;l(n)&&(i=n.boundingVolumeSourceTile!==t||t._lastSelectionResult===Kn.CULLED_BUT_NEEDED,o=n.terrainState),tm.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)!==lr.NONE&&n.boundingVolumeSourceTile===t&&(i=!1,tm.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i))};var zmt=new ce,Rxe=new ae,Kmt=new ae,Jmt=new he;function o3(e,t){if(t.west<t.east)return t;let n=ae.clone(t,Kmt);return ae.center(e,Jmt).longitude>0?n.east=W.PI:n.west=-W.PI,n}function Zxe(e,t){if(t.cameraUnderground||t.globeTranslucencyState.translucent)return!0;if(e.backFaceCulling)return!1;let n=e._clippingPlanes;if(l(n)&&n.enabled)return!0;let i=e._clippingPolygons;return!!(l(i)&&i.enabled||!ae.equals(e.cartographicLimitRectangle,ae.MAX_VALUE))}nr.prototype.computeTileVisibility=function(e,t,n){let i=this.computeDistanceToTile(e,t);e._distance=i;let o=Zxe(this,t);if(t.fog.enabled&&!o&&W.fog(i,t.fog.density)>=1)return lr.NONE;let r=e.data,s=r.tileBoundingRegion;if(r.boundingVolumeSourceTile===void 0)return lr.PARTIAL;let a=t.cullingVolume,c=s.boundingVolume;l(c)||(c=s.boundingSphere),r.clippedByBoundaries=!1;let d=o3(e.rectangle,this.cartographicLimitRectangle),u=ae.simpleIntersection(d,e.rectangle,Rxe);if(!l(u))return lr.NONE;if(ae.equals(u,e.rectangle)||(r.clippedByBoundaries=!0),t.mode!==oe.SCENE3D&&(c=zmt,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===oe.MORPHING&&l(r.renderedMesh)&&(c=ce.union(s.boundingSphere,c,c))),!l(c))return lr.PARTIAL;let m=this._clippingPlanes;if(l(m)&&m.enabled){let _=m.computeIntersectionWithBoundingVolume(c);if(e.isClipped=_!==Kt.INSIDE,_===Kt.OUTSIDE)return lr.NONE}let p=this._clippingPolygons;if(l(p)&&p.enabled){let _=p.computeIntersectionWithBoundingVolume(s);e.isClipped=_!==Kt.OUTSIDE}let g,f=a.computeVisibility(c);if(f===Kt.OUTSIDE?g=lr.NONE:f===Kt.INTERSECTING?g=lr.PARTIAL:f===Kt.INSIDE&&(g=lr.FULL),g===lr.NONE)return g;let x=t.mode===oe.SCENE3D&&t.camera.frustum instanceof sn;if(t.mode===oe.SCENE3D&&!x&&l(n)&&!o){let _=r.occludeePointInScaledSpace;return!l(_)||n.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(_,s.minimumHeight)?g:lr.NONE}return g};nr.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 Qmt=[],jmt=[];nr.prototype.canRenderWithoutLosingDetail=function(e,t){let n=e.data,i=Qmt;i.length=this._imageryLayers.length;let o=!1,r=!1,s;l(n)&&(o=n.terrainState===ao.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,g=!l(p)||p.state===si.FAILED||p.state===si.INVALID,f=(m.loadingImagery||m.readyImagery).imageryLayer._layerIndex;i[f]=g&&i[f]}let d=this.quadtree._lastSelectionFrameNumber,u=jmt;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:Kn.NONE;if(p===Kn.RENDERED){let g=m.data;if(!l(g))continue;if(!o&&m.data.terrainState===ao.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===si.FAILED||_.state===si.INVALID,V=(x.loadingImagery||x.readyImagery).imageryLayer._layerIndex;if(C&&!i[V])return!1}}else p===Kn.REFINED&&u.push(m.southwestChild,m.southeastChild,m.northwestChild,m.northeastChild)}return!0};var qmt=new h;nr.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,qmt),a=h.magnitude(s);return a<W.EPSILON5?0:(h.divideByScalar(s,a,s),(1-h.dot(s,r))*e._distance)};var Txe=new F,i3=new F,$mt=new se,eht=new se,tht=new se,nht=new h,Sxe=new h,iht=new h,oht=new h;nr.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 rht=[new h,new h,new h,new h];function Cxe(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=rht;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)}nr.prototype.computeDistanceToTile=function(e,t){sht(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 sht(e,t,n){let i=e.data;i===void 0&&(i=e.data=new tm);let o=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new vu({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=i.mesh,m=i.terrainData;if(u!==void 0&&u.minimumHeight!==void 0&&u.maximumHeight!==void 0)r.minimumHeight=u.minimumHeight,r.maximumHeight=u.maximumHeight,c=!0;else if(m!==void 0&&m._minimumHeight!==void 0&&m._maximumHeight!==void 0)r.minimumHeight=m._minimumHeight,r.maximumHeight=m._maximumHeight;else{r.minimumHeight=Number.NaN,r.maximumHeight=Number.NaN;let p=e.parent;for(;p!==void 0;){let g=p.data;if(g!==void 0){let f=g.mesh,x=g.terrainData;if(f!==void 0&&f.minimumHeight!==void 0&&f.maximumHeight!==void 0){r.minimumHeight=f.minimumHeight,r.maximumHeight=f.maximumHeight;break}else if(x!==void 0&&x._minimumHeight!==void 0&&x._maximumHeight!==void 0){r.minimumHeight=x._minimumHeight,r.maximumHeight=x._maximumHeight;break}}p=p.parent}d=p}if(d!==void 0){let p=n.verticalExaggeration,g=n.verticalExaggerationRelativeHeight;if(p!==1&&(c=!1,r.minimumHeight=br.getHeight(r.minimumHeight,p,g),r.maximumHeight=br.getHeight(r.maximumHeight,p,g)),c)i.boundingVolumeIsFromMesh||(r._orientedBoundingBox=Gn.clone(u.orientedBoundingBox,r._orientedBoundingBox),r._boundingSphere=ce.clone(u.boundingSphere3D,r._boundingSphere),i.occludeePointInScaledSpace=h.clone(u.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=Cxe(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace)));else{let x=r._orientedBoundingBox===void 0||r._boundingSphere===void 0;(r.minimumHeight!==s||r.maximumHeight!==a||x)&&(r.computeBoundingVolumes(o),i.occludeePointInScaledSpace=Cxe(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}nr.prototype.isDestroyed=function(){return!1};nr.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=this._clippingPolygons&&this._clippingPolygons.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(),me(this)};function aht(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=y(o.readyImagery,o.loadingImagery),r.imageryLayer===t){s=d;break}if(s!==-1){let u=s+e;if(o=a[u],r=l(o)?y(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}}nr.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 g=c[a];if(y(g.readyImagery,g.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]=aht(m,e,n),s.state=Ks.LOADING)})};if(e.ready){let s=e.imageryProvider;s._reload=r}this._quadtree.forEachLoadedTile(function(s){e._createTileImagerySkeletons(s,n)&&(s.state=Ks.LOADING,s.level!==0&&(s._lastSelectionResultFrame!==i.quadtree._lastSelectionFrameNumber||s._lastSelectionResult!==Kn.RENDERED)&&(s.renderable=!1))}),this._layerOrderChanged=!0,o.raiseEvent()}};nr.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()};nr.prototype._onLayerMoved=function(e,t,n){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()};nr.prototype._onLayerShownOrHidden=function(e,t,n){n?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var cht=new F,lht=new F;function Vxe(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=F.multiplyByPoint(i,this.properties.rtc,Sxe);return F.setTranslation(i,o,Txe),Txe},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,o=e.context.uniformState.projection,r=F.multiplyByPoint(i,this.properties.rtc,Sxe);return F.setTranslation(i,r,i3),F.multiply(o,i3,i3),i3},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)?F.multiply(e.context.uniformState.view,i.modelMatrix,cht):F.IDENTITY;return F.inverseTranspose(o,lht)},u_clippingPlanesEdgeStyle:function(){let i=this.properties.clippingPlanesEdgeColor;return i.alpha=this.properties.clippingPlanesEdgeWidth,i},u_clippingDistance:function(){let i=t._clippingPolygons.clippingTexture;return l(i)?i:e.context.defaultTexture},u_clippingExtents:function(){let i=t._clippingPolygons.extentsTexture;return l(i)?i:e.context.defaultTexture},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},properties:{initialColor:new se(0,0,.5,1),fillHighlightColor:new Y(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new D(65e5,9e6),nightFadeDistance:new D(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 F,tileRectangle:new se,verticalExaggerationAndRelativeHeight:new D(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new D,southMercatorYAndOneOverHeight:new D,waterMask:void 0,waterMaskTranslationAndScale:new se,minMaxHeight:new D,scaleAndBias:new F,clippingPlanesEdgeColor:Y.clone(Y.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new se,frontFaceAlphaByDistance:new se,backFaceAlphaByDistance:new se,localizedTranslucencyRectangle:new se,undergroundColor:Y.clone(Y.TRANSPARENT),undergroundColorAlphaByDistance:new se,lambertDiffuseMultiplier:0,vertexShadowDarkness:0}};return l(t.materialUniformMap)?_t(n,t.materialUniformMap):n}function dht(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=uht(e,r,o),i.wireframeVertexArray.mesh=o}}function uht(e,t,n){let o={indices:n.indices,primitiveType:Fe.TRIANGLES};An.toWireframe(o);let r=o.indices,s=yt.createIndexBuffer({context:e,typedArray:r,usage:Me.STATIC_DRAW,indexDatatype:Ae.fromSizeInBytes(r.BYTES_PER_ELEMENT)});return new mi({context:e,attributes:t._attributes,indexBuffer:s})}var Gxe,Exe,r3;(function(){let e=new Vt({geometry:xm.fromDimensions({dimensions:new h(2,2,2)})}),t=new Vt({geometry:new f0({radius:1})}),n=new F,i,o;function r(s){return new En({geometryInstances:s,appearance:new dn({translucent:!1,flat:!0}),asynchronous:!1})}Gxe=function(s,a){return s===i||(r3(),i=s,n=F.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=Ht.fromColor(a),o=r(e)),o},Exe=function(s,a){return s===i||(r3(),i=s,n=F.fromTranslation(s.center,n),n=F.multiplyByUniformScale(n,s.radius,n),t.modelMatrix=n,t.attributes.color=Ht.fromColor(a),o=r(t)),o},r3=function(){l(o)&&(o.destroy(),o=void 0,i=void 0)}})();var mht=new se(0,0,0,0),hht={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,enableClippingPolygons:void 0,clippingPolygons:void 0,clippedByBoundaries:void 0,hasImageryLayerCutout:void 0,colorCorrect:void 0,colorToAlpha:void 0,hasGeodeticSurfaceNormals:void 0,hasExaggeration:void 0},fht=Y.TRANSPARENT,pht=new kt;function bht(e,t,n){let i=t.data;l(i.vertexArray)||(i.fill===void 0&&(i.fill=new iL(t)),i.fill.update(e,n));let o=n.creditDisplay,r=i.terrainData;if(l(r)&&l(r.credits)){let Ve=r.credits;for(let ct=0,Ni=Ve.length;ct<Ni;++ct)o.addCreditToNextFrame(Ve[ct])}let s=Dt.maximumTextureImageUnits,a=i.waterMaskTexture,c=i.waterMaskTranslationAndScale;!l(a)&&l(i.fill)&&(a=i.fill.waterMaskTexture,c=i.fill.waterMaskTranslationAndScale);let d=n.cameraUnderground,u=n.globeTranslucencyState,m=u.translucent,p=u.frontFaceAlphaByDistance,g=u.backFaceAlphaByDistance,f=u.rectangle,x=y(e.undergroundColor,fht),_=y(e.undergroundColorAlphaByDistance,pht),C=Zxe(e,n)&&n.mode===oe.SCENE3D&&x.alpha>0&&(_.nearValue>0||_.farValue>0),V=e.lambertDiffuseMultiplier,L=e.vertexShadowDarkness,Z=e.hasWaterMask&&l(a),E=Z&&e.showWaterEffect,X=e.oceanNormalMap,v=E&&l(X),P=e.terrainProvider,A=l(P)&&e.terrainProvider.hasVertexNormals,M=n.fog.enabled&&n.fog.renderable&&!d,b=e.showGroundAtmosphere&&n.mode===oe.SCENE3D,R=_n.castShadows(e.shadows)&&!m,G=_n.receiveShadows(e.shadows)&&!m,I=e.hueShift,w=e.saturationShift,N=e.brightnessShift,B=!(W.equalsEpsilon(I,0,W.EPSILON7)&&W.equalsEpsilon(w,0,W.EPSILON7)&&W.equalsEpsilon(N,0,W.EPSILON7)),U=!1;if(b){let Ve=h.magnitude(n.camera.positionWC),ct=e.nightFadeOutDistance;U=Ve>ct}Z&&--s,v&&--s,l(n.shadowState)&&n.shadowState.shadowsEnabled&&--s,l(e.clippingPlanes)&&e.clippingPlanes.enabled&&--s,l(e.clippingPolygons)&&e.clippingPolygons.enabled&&(--s,--s),s-=u.numberOfTextureUniforms;let O=i.renderedMesh,k=O.center,J=O.encoding,H=i.tileBoundingRegion,te=n.verticalExaggeration,z=n.verticalExaggerationRelativeHeight,j=te!==1,ee=J.hasGeodeticSurfaceNormals,fe=$mt,_e=0,le=0,ge=0,Se=0,Ie=!1;if(n.mode!==oe.SCENE3D){let Ve=n.mapProjection,ct=Ve.project(ae.southwest(t.rectangle),iht),Ni=Ve.project(ae.northeast(t.rectangle),oht);if(fe.x=ct.x,fe.y=ct.y,fe.z=Ni.x,fe.w=Ni.y,n.mode!==oe.MORPHING&&(k=nht,k.x=0,k.y=(fe.z+fe.x)*.5,k.z=(fe.w+fe.y)*.5,fe.x-=k.y,fe.y-=k.z,fe.z-=k.y,fe.w-=k.z),n.mode===oe.SCENE2D&&J.quantization===Ys.BITS12){let mt=1/(Math.pow(2,12)-1)*.5,_o=(fe.z-fe.x)*mt,ur=(fe.w-fe.y)*mt;fe.x-=_o,fe.y-=ur,fe.z+=_o,fe.w+=ur}Ve instanceof Ri&&(_e=t.rectangle.south,le=t.rectangle.north,ge=Ri.geodeticLatitudeToMercatorAngle(_e),Se=1/(Ri.geodeticLatitudeToMercatorAngle(le)-ge),Ie=!0)}let Le=hht;Le.frameState=n,Le.surfaceTile=i,Le.hasWaterMask=Z,Le.showReflectiveOcean=E,Le.showOceanWaves=v,Le.enableLighting=e.enableLighting,Le.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,Le.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,Le.showGroundAtmosphere=b,Le.atmosphereLightIntensity=e.atmosphereLightIntensity,Le.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Le.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Le.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Le.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Le.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Le.perFragmentGroundAtmosphere=U,Le.hasVertexNormals=A,Le.useWebMercatorProjection=Ie,Le.clippedByBoundaries=i.clippedByBoundaries,Le.hasGeodeticSurfaceNormals=ee,Le.hasExaggeration=j;let ke=i.imagery,Be=0,st=ke.length,vt=e.showSkirts&&!d&&!m,Ct=e.backFaceCulling&&!d&&!m,Xe=Ct?e._renderState:e._disableCullingRenderState,je=Ct?e._blendRenderState:e._disableCullingBlendRenderState,$e=Xe,He=e._firstPassInitialColor,Ut=n.context;if(l(e._debug.boundingSphereTile)||r3(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let Ve=e._drawCommands.length;for(let ct=0;ct<Ve;++ct)e._uniformMaps[ct]=Vxe(n,e)}do{let Ve=0,ct,Ni;if(e._drawCommands.length<=e._usedDrawCommands?(ct=new tt,ct.owner=t,ct.cull=!1,ct.boundingVolume=new ce,ct.orientedBoundingBox=void 0,Ni=Vxe(n,e),e._drawCommands.push(ct),e._uniformMaps.push(Ni)):(ct=e._drawCommands[e._usedDrawCommands],Ni=e._uniformMaps[e._usedDrawCommands]),ct.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let ya=H.boundingVolume,bo=H.boundingSphere;l(ya)?Gxe(ya,Y.RED).update(n):l(bo)&&Exe(bo,Y.RED).update(n)}let mt=Ni.properties;se.clone(He,mt.initialColor),mt.oceanNormalMap=X,mt.lightingFadeDistance.x=e.lightingFadeOutDistance,mt.lightingFadeDistance.y=e.lightingFadeInDistance,mt.nightFadeDistance.x=e.nightFadeOutDistance,mt.nightFadeDistance.y=e.nightFadeInDistance,mt.atmosphereLightIntensity=e.atmosphereLightIntensity,mt.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,mt.atmosphereMieCoefficient=e.atmosphereMieCoefficient,mt.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,mt.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,mt.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,mt.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let _o=d?g:p,ur=d?p:g;l(_o)&&(se.fromElements(_o.near,_o.nearValue,_o.far,_o.farValue,mt.frontFaceAlphaByDistance),se.fromElements(ur.near,ur.nearValue,ur.far,ur.farValue,mt.backFaceAlphaByDistance)),se.fromElements(_.near,_.nearValue,_.far,_.farValue,mt.undergroundColorAlphaByDistance),Y.clone(x,mt.undergroundColor),mt.lambertDiffuseMultiplier=V,mt.vertexShadowDarkness=L;let Zc=!l(i.vertexArray)&&l(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;Zc&&Y.clone(e.fillHighlightColor,mt.fillHighlightColor),mt.verticalExaggerationAndRelativeHeight.x=te,mt.verticalExaggerationAndRelativeHeight.y=z,mt.center3D=O.center,h.clone(k,mt.rtc),se.clone(fe,mt.tileRectangle),mt.southAndNorthLatitude.x=_e,mt.southAndNorthLatitude.y=le,mt.southMercatorYAndOneOverHeight.x=ge,mt.southMercatorYAndOneOverHeight.y=Se;let Sr=eht,ts=o3(t.rectangle,e.cartographicLimitRectangle),Ne=tht,ut=o3(t.rectangle,f);h.fromElements(I,w,N,mt.hsbShift);let Je=t.rectangle,qe=1/Je.width,pt=1/Je.height;Sr.x=(ts.west-Je.west)*qe,Sr.y=(ts.south-Je.south)*pt,Sr.z=(ts.east-Je.west)*qe,Sr.w=(ts.north-Je.south)*pt,se.clone(Sr,mt.localizedCartographicLimitRectangle),Ne.x=(ut.west-Je.west)*qe,Ne.y=(ut.south-Je.south)*pt,Ne.z=(ut.east-Je.west)*qe,Ne.w=(ut.north-Je.south)*pt,se.clone(Ne,mt.localizedTranslucencyRectangle);let Zt=M&&W.fog(t._distance,n.fog.density)>W.EPSILON3;B=B&&(Zt||b);let yn=!1,po=!1,ir=!1,Da=!1,Ba=!1,ns=!1,Qn=!1,ms=!1,Cr=!1,dl=!1;for(;Ve<s&&Be<st;){let ya=ke[Be],bo=ya.readyImagery;if(++Be,!l(bo)||bo.imageryLayer.alpha===0)continue;let gb=ya.useWebMercatorT?bo.textureWebMercator:bo.texture,ci=bo.imageryLayer;l(ya.textureTranslationAndScale)||(ya.textureTranslationAndScale=ci._calculateTextureTranslationAndScale(t,ya)),mt.dayTextures[Ve]=gb,mt.dayTextureTranslationAndScale[Ve]=ya.textureTranslationAndScale,mt.dayTextureTexCoordsRectangle[Ve]=ya.textureCoordinateRectangle,mt.dayTextureUseWebMercatorT[Ve]=ya.useWebMercatorT,mt.dayTextureAlpha[Ve]=ci.alpha,ns=ns||mt.dayTextureAlpha[Ve]!==1,mt.dayTextureNightAlpha[Ve]=ci.nightAlpha,Qn=Qn||mt.dayTextureNightAlpha[Ve]!==1,mt.dayTextureDayAlpha[Ve]=ci.dayAlpha,Qn=Qn||mt.dayTextureDayAlpha[Ve]!==1,mt.dayTextureBrightness[Ve]=ci.brightness,yn=yn||mt.dayTextureBrightness[Ve]!==ha.DEFAULT_BRIGHTNESS,mt.dayTextureContrast[Ve]=ci.contrast,po=po||mt.dayTextureContrast[Ve]!==ha.DEFAULT_CONTRAST,mt.dayTextureHue[Ve]=ci.hue,ir=ir||mt.dayTextureHue[Ve]!==ha.DEFAULT_HUE,mt.dayTextureSaturation[Ve]=ci.saturation,Da=Da||mt.dayTextureSaturation[Ve]!==ha.DEFAULT_SATURATION,mt.dayTextureOneOverGamma[Ve]=1/ci.gamma,Ba=Ba||mt.dayTextureOneOverGamma[Ve]!==1/ha.DEFAULT_GAMMA,mt.dayTextureSplit[Ve]=ci.splitDirection,ms=ms||mt.dayTextureSplit[Ve]!==0;let Gc=mt.dayTextureCutoutRectangles[Ve];if(l(Gc)||(Gc=mt.dayTextureCutoutRectangles[Ve]=new se),se.clone(se.ZERO,Gc),l(ci.cutoutRectangle)){let So=o3(Je,ci.cutoutRectangle),nu=ae.simpleIntersection(So,Je,Rxe);Cr=l(nu)||Cr,Gc.x=(So.west-Je.west)*qe,Gc.y=(So.south-Je.south)*pt,Gc.z=(So.east-Je.west)*qe,Gc.w=(So.north-Je.south)*pt}let $l=mt.colorsToAlpha[Ve];l($l)||($l=mt.colorsToAlpha[Ve]=new se);let tu=l(ci.colorToAlpha)&&ci.colorToAlphaThreshold>0;if(dl=dl||tu,tu){let So=ci.colorToAlpha;$l.x=So.red,$l.y=So.green,$l.z=So.blue,$l.w=ci.colorToAlphaThreshold}else $l.w=-1;if(l(bo.credits)){let So=bo.credits;for(let nu=0,yS=So.length;nu<yS;++nu)o.addCreditToNextFrame(So[nu])}++Ve}mt.dayTextures.length=Ve,mt.waterMask=a,se.clone(c,mt.waterMaskTranslationAndScale),mt.minMaxHeight.x=J.minimumHeight,mt.minMaxHeight.y=J.maximumHeight,F.clone(J.matrix,mt.scaleAndBias);let To=e._clippingPlanes,Ur=l(To)&&To.enabled&&t.isClipped;Ur&&(mt.clippingPlanesEdgeColor=Y.clone(To.edgeColor,mt.clippingPlanesEdgeColor),mt.clippingPlanesEdgeWidth=To.edgeWidth);let tp=e._clippingPolygons,ul=l(tp)&&tp.enabled&&t.isClipped;Le.numberOfDayTextures=Ve,Le.applyBrightness=yn,Le.applyContrast=po,Le.applyHue=ir,Le.applySaturation=Da,Le.applyGamma=Ba,Le.applyAlpha=ns,Le.applyDayNightAlpha=Qn,Le.applySplit=ms,Le.enableFog=Zt,Le.enableClippingPlanes=Ur,Le.clippingPlanes=To,Le.enableClippingPolygons=ul,Le.clippingPolygons=tp,Le.hasImageryLayerCutout=Cr,Le.colorCorrect=B,Le.highlightFillTile=Zc,Le.colorToAlpha=dl,Le.showUndergroundColor=C,Le.translucent=m;let np=i.renderedMesh.indices.length;vt||(np=i.renderedMesh.indexCountWithoutSkirts),ct.shaderProgram=e._surfaceShaderSet.getShaderProgram(Le),ct.castShadows=R,ct.receiveShadows=G,ct.renderState=$e,ct.primitiveType=Fe.TRIANGLES,ct.vertexArray=i.vertexArray||i.fill.vertexArray,ct.count=np,ct.uniformMap=Ni,ct.pass=Re.GLOBE,e._debug.wireframe&&(dht(Ut,e,t),l(i.wireframeVertexArray)&&(ct.vertexArray=i.wireframeVertexArray,ct.primitiveType=Fe.LINES,ct.count=np*2));let Ya=ct.boundingVolume,Vr=ct.orientedBoundingBox;n.mode!==oe.SCENE3D?(ce.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,H.minimumHeight,H.maximumHeight,Ya),h.fromElements(Ya.center.z,Ya.center.x,Ya.center.y,Ya.center),n.mode===oe.MORPHING&&(Ya=ce.union(H.boundingSphere,Ya,Ya))):(ct.boundingVolume=ce.clone(H.boundingSphere,Ya),ct.orientedBoundingBox=Gn.clone(H.boundingVolume,Vr)),ct.dirty=!0,m&&u.updateDerivedCommands(ct,n),Lxe(ct,n),$e=je,He=mht}while(Be<st)}var EF=nr;var AAi=T(S(),1);function Xxe(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=ae.clone(ae.MAX_VALUE)}Object.defineProperties(Xxe.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=kt.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=kt.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){l(e)||(e=ae.clone(ae.MAX_VALUE)),ae.clone(e,this._rectangle)}}});var XF=Xxe;var HAi=T(S(),1);function Zs(){this._layers=[],this.layerAdded=new be,this.layerRemoved=new be,this.layerMoved=new be,this.layerShownOrHidden=new be}Object.defineProperties(Zs.prototype,{length:{get:function(){return this._layers.length}}});Zs.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()})};Zs.prototype.addImageryProvider=function(e,t){let n=new ha(e);return this.add(n,t),n};Zs.prototype.remove=function(e,t){t=y(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};Zs.prototype.removeAll=function(e){e=y(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=[]};Zs.prototype.contains=function(e){return this.indexOf(e)!==-1};Zs.prototype.indexOf=function(e){return this._layers.indexOf(e)};Zs.prototype.get=function(e){return this._layers[e]};function s3(e,t){return e.indexOf(t)}function Ixe(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)}Zs.prototype.raise=function(e){let t=s3(this._layers,e);Ixe(this,t,t+1)};Zs.prototype.lower=function(e){let t=s3(this._layers,e);Ixe(this,t,t-1)};Zs.prototype.raiseToTop=function(e){let t=s3(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))};Zs.prototype.lowerToBottom=function(e){let t=s3(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 ght=new ae;function Wxe(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];ae.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)||!ae.contains(d.rectangle,t))continue;let m=ght,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),ae.contains(m,t)&&i(d)}}Zs.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[];if(Wxe(t,i,!1,function(r){o.push(r.imageryLayer)}),o.length!==0)return o};Zs.prototype.pickImageryLayerFeatures=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[],r=[];if(Wxe(t,i,!0,function(s){if(!s.imageryLayer.ready)return;let c=s.imageryLayer.imageryProvider.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})};Zs.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};Zs.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};Zs.prototype.isDestroyed=function(){return!1};Zs.prototype.destroy=function(){return this.removeAll(!0),me(this)};Zs.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 IF=Zs;var RMi=T(S(),1);var QAi=T(S(),1);function Pxe(e){this._ellipsoid=new V0(e.ellipsoid,h.ZERO)}Object.defineProperties(Pxe.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var WF=Pxe;var nMi=T(S(),1);function ol(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=Kn.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this.state=Ks.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}ol.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 ol({tilingScheme:e,x:s,y:r,level:0});return i};ol.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],ae.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],ae.contains(s,r.positionCartographic)&&i.push(r);this._frameUpdated=a._frameUpdated}}};Object.defineProperties(ol.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 ol({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 ol({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 ol({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 ol({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<Ks.DONE}},eligibleForUnloading:{get:function(){let e=!0;return l(this.data)&&(e=this.data.eligibleForUnloading,l(e)||(e=!0)),e}}});ol.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]};ol.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};ol.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};ol.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};ol.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};ol.prototype.freeResources=function(){this.state=Ks.START,this.renderable=!1,this.upsampledFromParent=!1,l(this.data)&&l(this.data.freeResources)&&this.data.freeResources(),a3(this._southwestChild),this._southwestChild=void 0,a3(this._southeastChild),this._southeastChild=void 0,a3(this._northwestChild),this._northwestChild=void 0,a3(this._northeastChild),this._northeastChild=void 0};function a3(e){l(e)&&e.freeResources()}var PF=ol;var rMi=T(S(),1);function c3(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}c3.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};c3.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(),vxe(this,t)),t=i}};function vxe(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}c3.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))&&vxe(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var vF=c3;function im(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 vF,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=y(e.maximumScreenSpaceError,2),this.tileCacheSize=y(e.tileCacheSize,100),this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new WF({ellipsoid:n}),this._tileLoadProgressEvent=new be,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(im.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});im.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function yht(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,Fxe(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()}im.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==Ks.START&&e(t),t=t.replacementNext};im.prototype.forEachRenderedTile=function(e){let t=this._tilesToRender;for(let n=0,i=t.length;n<i;++n)e(t[n])};im.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};im.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function Fxe(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}im.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(yht(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),Fxe(this),!this._debug.suspendLodUpdate&&this._tileReplacementQueue.markStartOfRenderFrame())};im.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),Sht(this,e),Wht(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function xht(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let o=be.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))}im.prototype.endFrame=function(e){!e.passes.render||e.mode===oe.MORPHING||(Ght(this,e),Iht(this,e),xht(this,e))};im.prototype.isDestroyed=function(){return!1};im.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var FF,wxe=new he;function _ht(e,t){let n=ae.center(e.rectangle,wxe),i=n.longitude-FF.longitude,o=n.latitude-FF.latitude;n=ae.center(t.rectangle,wxe);let r=n.longitude-FF.longitude,s=n.latitude-FF.latitude;return i*i+o*o-(r*r+s*s)}var Tht=new h,wF=[];function Sht(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=PF.createLevelZeroTiles(_);let C=e._levelZeroTiles.length;if(wF.length<C)for(wF=new Array(C),o=0;o<C;++o)wF[o]===void 0&&(wF[o]=new AF)}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let s,a=e._levelZeroTiles,c=a.length>1?e._occluders:void 0;FF=t.camera.positionCartographic,a.sort(_ht);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 g=t.camera;e._cameraPositionCartographic=g.positionCartographic;let f=F.getTranslation(g.transform,Tht);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?Na(e,s,r,t,c,!1,wF[o]):(ib(e,e._tileLoadQueueHigh,s,t),++n.tilesWaitingForChildren);e._lastSelectionFrameNumber=m}function ib(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function AF(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function Axe(){this.southwest=new AF,this.southeast=new AF,this.northwest=new AF,this.northeast=new AF}Axe.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 G8=new Array(31);for(let e=0;e<G8.length;++e)G8[e]=new Axe;function Cht(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=Rht(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:Kn.NONE,g=e.tileProvider;if(s||i){let f=Kn.originalResult(p)===Kn.RENDERED,x=Kn.originalResult(p)===Kn.CULLED||p===Kn.NONE,_=n.state===Ks.DONE,C=f||x||_;if(C||l(g.canRenderWithoutLosingDetail)&&(C=g.canRenderWithoutLosingDetail(n)),C){s&&ib(e,e._tileLoadQueueMedium,n,t),l3(e,n),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Kn.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Kn.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&ib(e,e._tileLoadQueueHigh,n,t)}if(g.canRefine(n)){if(a.upsampledFromParent&&c.upsampledFromParent&&d.upsampledFromParent&&u.upsampledFromParent){l3(e,n),ib(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===Kn.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Kn.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Kn.REFINED;let x=e._tilesToRender.length,_=e._tileLoadQueueLow.length,C=e._tileLoadQueueMedium.length,V=e._tileLoadQueueHigh.length,L=e._tileToUpdateHeights.length;if(Vht(e,a,c,d,u,t,i,o),x!==e._tilesToRender.length){let Z=o.allAreRenderable,E=o.anyWereRenderedLastFrame,X=o.notYetRenderableCount,v=!1;if(!Z&&!E){let P=e._tilesToRender;for(let M=x;M<P.length;++M){let b=P[M];for(;b!==void 0&&b._lastSelectionResult!==Kn.KICKED&&b!==n;)b._lastSelectionResult=Kn.kick(b._lastSelectionResult),b=b.parent}e._tilesToRender.length=x,e._tileToUpdateHeights.length=L,l3(e,n),n._lastSelectionResult=Kn.RENDERED;let A=p===Kn.RENDERED;!A&&X>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=_,e._tileLoadQueueMedium.length=C,e._tileLoadQueueHigh.length=V,ib(e,e._tileLoadQueueMedium,n,t),o.notYetRenderableCount=n.renderable?0:1,v=!0),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=A,A||e._tileToUpdateHeights.push(n),++r.tilesWaitingForChildren}e.preloadAncestors&&!v&&ib(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Kn.RENDERED,l3(e,n),ib(e,e._tileLoadQueueHigh,n,t),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Kn.RENDERED,o.notYetRenderableCount=n.renderable?0:1}function Vht(e,t,n,i,o,r,s,a){let c=r.camera.positionCartographic,d=e._tileProvider,u=e._occluders,m=G8[t.level],p=m.southwest,g=m.southeast,f=m.northwest,x=m.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(Na(e,t,d,r,u,s,p),Na(e,n,d,r,u,s,g),Na(e,i,d,r,u,s,f),Na(e,o,d,r,u,s,x)):(Na(e,i,d,r,u,s,f),Na(e,t,d,r,u,s,p),Na(e,o,d,r,u,s,x),Na(e,n,d,r,u,s,g)):c.latitude<t.rectangle.north?(Na(e,n,d,r,u,s,g),Na(e,t,d,r,u,s,p),Na(e,o,d,r,u,s,x),Na(e,i,d,r,u,s,f)):(Na(e,o,d,r,u,s,x),Na(e,i,d,r,u,s,f),Na(e,n,d,r,u,s,g),Na(e,t,d,r,u,s,p)),m.combine(a)}function Lht(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&ae.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&ae.contains(n,e._cameraReferenceFrameOriginCartographic)}function Na(e,t,n,i,o,r,s){if(n.computeTileVisibility(t,i,o)!==lr.NONE)return Cht(e,i,t,r,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,Lht(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&ib(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===a?t._lastSelectionResult:Kn.NONE;c!==Kn.CULLED_BUT_NEEDED&&c!==Kn.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=Kn.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(ib(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=Kn.CULLED):t._lastSelectionResult=Kn.CULLED;t._lastSelectionResultFrame=i.frameNumber}function Rht(e,t,n){if(t.mode===oe.SCENE2D||t.camera.frustum instanceof sn||t.camera.frustum instanceof Zr)return Zht(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 Zht(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!==oe.SCENE2D&&(m-=W.fog(n._distance,t.fog.density)*t.fog.sse),m/=t.pixelRatio,m}function l3(e,t){e._tilesToRender.push(t)}function Ght(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=_i()+e._loadQueueTimeSlice,s=e._tileProvider,a=R8(e,t,s,r,n,!1);a=R8(e,t,s,r,i,a),R8(e,t,s,r,o,a)}function Eht(e,t){return e._loadPriority-t._loadPriority}function R8(e,t,n,i,o,r){n.computeTileLoadPriority!==void 0&&o.sort(Eht);for(let s=0,a=o.length;s<a&&(_i()<i||!r);++s){let c=o[s];e._tileReplacementQueue.markTileRendered(c),n.loadTile(t,c),r=!0}return r}var oL=new pn,Z8=new he,Ly=new h,Xht=[];function Iht(e,t){if(!l(e.tileProvider.tilingScheme))return;let n=Xht;n.length=0;let i=e._tileToUpdateHeights,o=_i(),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:Kn.NONE;(x===Kn.RENDERED||x===Kn.CULLED_BUT_NEEDED)&&n.push(m),i.shift(),e._lastTileIndex=0;continue}let p=m.customData,g=p.length,f=!1;for(u=e._lastTileIndex;u<g;++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===oe.SCENE3D){let L=d.geodeticSurfaceNormal(x.positionOnEllipsoidSurface,oL.direction),Z=d.getSurfaceNormalIntersectionWithZAxis(x.positionOnEllipsoidSurface,11500,oL.origin);if(!l(Z)){let E=0;l(m.data.tileBoundingRegion)&&(E=m.data.tileBoundingRegion.minimumHeight);let X=Math.min(E,-11500),v=h.multiplyByScalar(L,Math.abs(X)+1,Ly);h.subtract(x.positionOnEllipsoidSurface,v,oL.origin)}}else he.clone(x.positionCartographic,Z8),Z8.height=-11500,c.project(Z8,Ly),h.fromElements(Ly.z,Ly.x,Ly.y,Ly),h.clone(Ly,oL.origin),h.clone(h.UNIT_X,oL.direction);let V=m.data.pick(oL,a,c,!1,Ly);l(V)&&(l(x.callback)&&x.callback(V),x.level=m.level)}if(_i()>=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 Wht(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 MF=im;function Gh(e){e=y(e,ne.default);let t=new Af({ellipsoid:e}),n=new IF;this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new yF,this._material=void 0,this._surface=new MF({tileProvider:new EF({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=t,this._terrainProviderChanged=new be,this._undergroundColor=Y.clone(Y.BLACK),this._undergroundColorAlphaByDistance=new kt(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new XF,X8(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new Ee({url:nn("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=ne.WGS84.equals(e),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=W.PI_OVER_TWO*e.minimumRadius,this.lightingFadeInDistance=W.PI*e.minimumRadius,this.nightFadeOutDistance=W.PI_OVER_TWO*e.minimumRadius,this.nightFadeInDistance=5*W.PI_OVER_TWO*e.minimumRadius,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=_n.RECEIVE_ONLY,this.atmosphereHueShift=0,this.atmosphereSaturationShift=0,this.atmosphereBrightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=void 0,this.vertexShadowDarkness=.3}Object.defineProperties(Gh.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}},clippingPolygons:{get:function(){return this._surface.tileProvider.clippingPolygons},set:function(e){this._surface.tileProvider.clippingPolygons=e}},cartographicLimitRectangle:{get:function(){return this._surface.tileProvider.cartographicLimitRectangle},set:function(e){l(e)||(e=ae.clone(ae.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)&&X8(this))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,X8(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=Y.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){this._undergroundColorAlphaByDistance=kt.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function X8(e){let t=[],n=l(e._material)&&(l(e._material.shaderSource.match(/slope/))||l(e._material.shaderSource.match("normalEC"))),i=[J0,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(Vw),e._surfaceShaderSet.baseVertexShaderSource=new Oe({sources:[J0,MV,Lw],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new Oe({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function Pht(e){return function(t,n){let i=ce.distanceSquaredTo(t.pickBoundingSphere,e),o=ce.distanceSquaredTo(n.pickBoundingSphere,e);return i-o}}var vht=[],wht={start:0,stop:0};Gh.prototype.pickWorldCoordinates=function(e,t,n,i){n=y(n,!0);let o=t.mode,r=t.mapProjection,s=vht;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 g=p.pickBoundingSphere;if(o!==oe.SCENE3D)p.pickBoundingSphere=g=ce.fromRectangleWithHeights2D(d.rectangle,r,p.tileBoundingRegion.minimumHeight,p.tileBoundingRegion.maximumHeight,g),h.fromElements(g.center.z,g.center.x,g.center.y,g.center);else if(l(p.renderedMesh))ce.clone(p.tileBoundingRegion.boundingSphere,g);else continue;let f=qn.raySphere(e,g,wht);l(f)&&s.push(p)}s.sort(Pht(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 Fht=new he;Gh.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),l(n)&&t.mode!==oe.SCENE3D){n=h.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,Fht);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var Aht=new h,Mxe=new h,Mht=new he,Nht=new pn;function E8(e,t){return l(e)&&ae.contains(e.rectangle,t)?e:void 0}Gh.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],!ae.contains(n.rectangle,e));++i);if(i>=o)return;let r=n;for(;l(n);)n=E8(n._southwestChild,e)||E8(n._southeastChild,e)||E8(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,Aht),d=Nht,u=a.geodeticSurfaceNormal(c,d.direction),m=a.getSurfaceNormalIntersectionWithZAxis(c,11500,d.origin);if(!l(m)){let g;l(n.data.tileBoundingRegion)&&(g=n.data.tileBoundingRegion.minimumHeight);let f=Math.min(y(g,0),-11500),x=h.multiplyByScalar(u,Math.abs(f)+1,Mxe);h.subtract(c,x,d.origin)}let p=n.data.pick(d,void 0,s,!1,Mxe);if(l(p))return a.cartesianToCartographic(p,Mht).height};Gh.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};Gh.prototype.beginFrame=function(e){let t=this._surface,n=t.tileProvider,i=this.terrainProvider,o=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 Ft({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===oe.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,n.hasWaterMask=o,n.showWaterEffect=this.showWaterEffect,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))};Gh.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};Gh.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};Gh.prototype.isDestroyed=function(){return!1};Gh.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(),me(this)};var NF=Gh;var VNi=T(S(),1);var sNi=T(S(),1),Ql=`uniform sampler2D colorTexture;

in vec2 v_textureCoordinates;

void main()
{
    out_FragColor = texture(colorTexture, v_textureCoordinates);
}
`;var cNi=T(S(),1),Ry=`uniform highp sampler2D u_depthTexture;

in vec2 v_textureCoordinates;

void main()
{
    out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r);
}
`;function zf(){this._picking=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._outputFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new hi,this._tempCopyDepthFramebuffer=new hi,this._updateDepthFramebuffer=new hi({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 Ke,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(zf.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 kht(e){e._pickColorFramebuffer.destroy(),e._outputFramebuffer.destroy(),e._copyDepthFramebuffer.destroy(),e._tempCopyDepthFramebuffer.destroy(),e._updateDepthFramebuffer.destroy()}function Nxe(e,t,n,i,o){e._viewport.width=n,e._viewport.height=i;let r=!Ke.equals(e._viewport,o.viewport),s=r!==e._useScissorTest;e._useScissorTest=r,Ke.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=Ke.clone(o.viewport,e._scissorRectangle),s=!0),(!l(e._rs)||!Ke.equals(e._viewport,e._rs.viewport)||s)&&(e._rs=Ue.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=Ue.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:un.ALPHA_BLEND}),e._rsUpdate=Ue.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Un.EQUAL,frontOperation:{fail:bt.KEEP,zFail:bt.KEEP,zPass:bt.KEEP},backFunction:Un.NEVER,reference:Bt.CESIUM_3D_TILE_MASK,mask:Bt.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(Ry,{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(Ql,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(Ry,{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(Ql,{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 ei({color:new Y(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}zf.prototype.update=function(e,t,n,i,o,r){let s=n.width,a=n.height,c=o?e.halfFloatingPointTexture?nt.HALF_FLOAT:nt.FLOAT:nt.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),Nxe(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._useHdr=o,this._clearGlobeDepth=r};zf.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};zf.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};zf.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),Nxe(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)};zf.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};zf.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(Y.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};zf.prototype.isDestroyed=function(){return!1};zf.prototype.destroy=function(){return kht(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()),me(this)};var kF=zf;var wNi=T(S(),1);function MT(){this._framebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new hi,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new Ke,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(MT.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 Uht(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function Dht(e,t,n,i,o){let r=o?t.halfFloatingPointTexture?nt.HALF_FLOAT:nt.FLOAT:nt.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,r),e._packedDepthFramebuffer.update(t,n,i)}function Bht(e,t,n,i,o){e._viewport.width=n,e._viewport.height=i;let r=!Ke.equals(e._viewport,o.viewport),s=r!==e._useScissorTest;e._useScissorTest=r,Ke.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=Ke.clone(o.viewport,e._scissorRectangle),s=!0),(!l(e._renderState)||!Ke.equals(e._viewport,e._renderState.viewport)||s)&&(e._renderState=Ue.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(Ry,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),l(e._clearCommand)||(e._clearCommand=new ei({color:new Y(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}MT.prototype.updateAndClear=function(e,t,n,i){let o=t.width,r=t.height;Dht(this,n,o,r,e),Bht(this,n,o,r,i),this._useHdr=e};MT.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};MT.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};MT.prototype.isDestroyed=function(){return!1};MT.prototype.destroy=function(){return Uht(this),me(this)};var UF=MT;var JNi=T(S(),1);var fa={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},NT=fa.DERIVED_COMMANDS_MAXIMUM_LENGTH,Jxe=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function kT(){this._frontFaceAlphaByDistance=new kt(0,1,0,1),this._backFaceAlphaByDistance=new kt(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=ae.clone(ae.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(NT),this._derivedBlendCommandTypes=new Array(NT),this._derivedPickCommandTypes=new Array(NT),this._derivedCommandTypesToUpdate=new Array(NT),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(kT.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}}});kT.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=kxe(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=kxe(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=Uxe(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=Uxe(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=zht(this,e,t),this._sunVisibleThroughGlobe=Yht(this,e),this._environmentVisible=Oht(this,e),this._useDepthPlane=Hht(this,e),this._numberOfTextureUniforms=Kht(this),this._rectangle=ae.clone(t.translucency.rectangle,this._rectangle),Jht(this,e)};function kxe(e,t,n,i){return e?l(n)?(kt.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 Uxe(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function Yht(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function Oht(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function Hht(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function zht(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==oe.SCENE2D&&t.context.depthTexture}function Kht(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function Jht(e,t){e._derivedCommandsLength=I8(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=I8(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=I8(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<NT;++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=dft())}function I8(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?fa.PICK_FRONT_FACE:d?fa.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:fa.TRANSLUCENT_FRONT_FACE,m=i?fa.PICK_BACK_FACE:d?fa.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:fa.TRANSLUCENT_BACK_FACE;return t.mode===oe.SCENE2D?(o[r++]=fa.DEPTH_ONLY_FRONT_FACE,o[r++]=u,r):(a?(n||(o[r++]=fa.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(o[r++]=u,o[r++]=m):(o[r++]=m,o[r++]=u)):c?(n||(o[r++]=fa.DEPTH_ONLY_BACK_FACE),o[r++]=fa.OPAQUE_FRONT_FACE,o[r++]=m):(n||(o[r++]=fa.DEPTH_ONLY_FRONT_FACE),o[r++]=fa.OPAQUE_BACK_FACE,o[r++]=u),r)}function om(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function Dxe(e,t){return e.indexOf(t)>-1}function Qht(e,t){om(e.defines,"TRANSLUCENT"),om(t.defines,"TRANSLUCENT")}function jht(e,t){om(e.defines,"GROUND_ATMOSPHERE"),om(t.defines,"GROUND_ATMOSPHERE"),om(e.defines,"FOG"),om(t.defines,"FOG"),om(e.defines,"TRANSLUCENT"),om(t.defines,"TRANSLUCENT")}function W8(e,t){if(Dxe(t.defines,"TILE_LIMIT_RECTANGLE")||Dxe(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main() 
{ 
    out_FragColor = vec4(1.0); 
} 
`;t.sources=[n]}function P8(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 Qxe(e,t){P8(e,t),om(e.defines,"GROUND_ATMOSPHERE"),om(t.defines,"GROUND_ATMOSPHERE"),om(e.defines,"FOG"),om(t.defines,"FOG")}function qht(e,t){P8(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function $ht(e,t){Qxe(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function Bxe(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 eft(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 tft(e){e.cull.face=yi.BACK,e.cull.enabled=!0}function nft(e){e.cull.face=yi.FRONT,e.cull.enabled=!0}function ift(e){e.cull.face=yi.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function oft(e){e.cull.face=yi.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function rft(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Yxe(e){e.cull.face=yi.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=un.ALPHA_BLEND}function Oxe(e){e.cull.face=yi.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=un.ALPHA_BLEND}function sft(e){e.cull.face=yi.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function aft(e){e.cull.face=yi.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function cft(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=Ue.getState(e);i(s),r=Ue.fromCache(s),o[e.id]=r}return r}function rL(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function lft(e,t,n,i,o){return l(o)?!i&&l(n)?n:_t(t,o(e),!1):t}function Eh(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function dft(){return[new Eh({pass:Re.GLOBE,pickOnly:!1,getShaderProgramFunction:Qht,getRenderStateFunction:tft,getUniformMapFunction:void 0}),new Eh({pass:Re.GLOBE,pickOnly:!1,getShaderProgramFunction:jht,getRenderStateFunction:nft,getUniformMapFunction:void 0}),new Eh({pass:Re.GLOBE,pickOnly:!1,getShaderProgramFunction:W8,getRenderStateFunction:ift,getUniformMapFunction:void 0}),new Eh({pass:Re.GLOBE,pickOnly:!1,getShaderProgramFunction:W8,getRenderStateFunction:oft,getUniformMapFunction:void 0}),new Eh({pass:Re.GLOBE,pickOnly:!1,getShaderProgramFunction:W8,getRenderStateFunction:rft,getUniformMapFunction:void 0}),new Eh({pass:Re.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:P8,getRenderStateFunction:Yxe,getUniformMapFunction:rL}),new Eh({pass:Re.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Qxe,getRenderStateFunction:Oxe,getUniformMapFunction:rL}),new Eh({pass:Re.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:qht,getRenderStateFunction:Yxe,getUniformMapFunction:rL}),new Eh({pass:Re.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:$ht,getRenderStateFunction:Oxe,getUniformMapFunction:rL}),new Eh({pass:Re.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:Bxe,getRenderStateFunction:sft,getUniformMapFunction:rL}),new Eh({pass:Re.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:Bxe,getRenderStateFunction:aft,getUniformMapFunction:rL})]}var Hxe=new Array(NT),zxe=new Array(NT);kT.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let o=0;o<i;++o)zxe[o]=this._derivedCommandPacks[n[o]],Hxe[o]=Jxe[n[o]];uft(this,e,i,n,Hxe,zxe,t)}};function uft(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=y(a.uniformMapDirtyFrame,0),m=y(a.shaderProgramDirtyFrame,0),p=y(a.renderStateDirtyFrame,0),g=a.uniformMap!==t.uniformMap,f=a.shaderProgramId!==t.shaderProgram.id,x=a.renderStateId!==t.renderState.id;g&&(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],E,X,v;l(Z)?(E=Z.uniformMap,X=Z.shaderProgram,v=Z.renderState):(E=void 0,X=void 0,v=void 0),Z=tt.shallowClone(t,Z),a[L]=Z;let P=y(Z.derivedCommands.uniformMapDirtyFrame,0),A=y(Z.derivedCommands.shaderProgramDirtyFrame,0),M=y(Z.derivedCommands.renderStateDirtyFrame,0),b=g||P<u,R=f||A<m,G=x||M<p;b&&(Z.derivedCommands.uniformMapDirtyFrame=d),R&&(Z.derivedCommands.shaderProgramDirtyFrame=d),G&&(Z.derivedCommands.renderStateDirtyFrame=d),Z.derivedCommands.type=V,Z.pass=C.pass,Z.pickOnly=C.pickOnly,Z.uniformMap=lft(e,t.uniformMap,E,b,C.getUniformMapFunction),Z.shaderProgram=eft(s.context,t.shaderProgram,X,R,C.getShaderProgramFunction,L),Z.renderState=cft(t.renderState,v,G,C.getRenderStateFunction,C.renderStateCache)}}}kT.prototype.pushDerivedCommands=function(e,t,n){let i=n.passes.pick||n.passes.pickVoxel;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=Jxe[o[a]];n.commandList.push(s[c])}};function jxe(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 Kxe(e,t,n,i,o,r){for(let s=0;s<t;++s)n(e[s],i,o,r)}var mft=[fa.OPAQUE_FRONT_FACE,fa.OPAQUE_BACK_FACE],hft=[fa.DEPTH_ONLY_FRONT_FACE,fa.DEPTH_ONLY_BACK_FACE,fa.DEPTH_ONLY_FRONT_AND_BACK_FACE];kT.prototype.executeGlobeCommands=function(e,t,n,i,o){let r=i.context,s=e.commands[Re.GLOBE],a=e.indices[Re.GLOBE];a!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(r,o),jxe(s,a,t,i,r,o,mft))};kT.prototype.executeGlobeClassificationCommands=function(e,t,n,i,o){let r=i.context,s=e.commands[Re.GLOBE],a=e.indices[Re.GLOBE],c=e.commands[Re.TERRAIN_CLASSIFICATION],d=e.indices[Re.TERRAIN_CLASSIFICATION];if(a===0||d===0)return;let u=this._frontFaceTranslucent,m=this._backFaceTranslucent;if((!u||!m)&&Kxe(c,d,t,i,r,o),!u&&!m)return;this._globeTranslucencyFramebuffer=n;let p=r.uniformState.globeDepthTexture,g=o.framebuffer;if(o.framebuffer=n.classificationFramebuffer,jxe(s,a,t,i,r,o,hft),r.depthTexture){let f=n.packDepth(r,o);r.uniformState.globeDepthTexture=f}Kxe(c,d,t,i,r,o),r.uniformState.globeDepthTexture=p,o.framebuffer=g};var DF=kT;var l5i=T(S(),1);var qxe=T(N4(),1);function v8(){this._image=new Image}v8.prototype.isReady=function(){return!0};v8.prototype.shouldDiscardImage=function(e){return e===this._image};function UT(e){e=y(e,y.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 Di({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ae(-W.PI,-W.PI,W.PI,W.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new Rt(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new v8),this._errorEvent=new be}Object.defineProperties(UT.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}}});UT.fromMetadata=function(e,t){if(!e.imageryPresent)throw new ue(`The server ${e.url} doesn't have imagery`);let n=new UT(t);return n._metadata=e,n};UT.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]}};UT.prototype.requestImage=function(e,t,n,i){let o=this._tileDiscardPolicy._image,r=this._metadata,s=z0.tileXYToQuadKey(e,t,n),a=r.getTileInformation(e,t,n);if(!l(a)){if(r.isValid(s)){let d=new Oo({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=fft(this,a,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(d){dw(r.key,d);let u=new Uint8Array(d),m,p=r.protoImagery;if((!l(p)||!p)&&(m=pft(u)),!l(m)&&(!l(p)||p)){let g=bft(u);m=g.imageType,u=g.imageData}return!l(m)||!l(u)?o:Hx({uint8Array:u,format:m,flipY:!0})})};UT.prototype.pickFeatures=function(e,t,n,i,o){};function fft(e,t,n,i,o,r){let s=z0.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 pft(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 bft(e){let t=qxe.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 ue("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 w8=UT;var b5i=T(S(),1);var gft=new Y(1,1,1,.4),yft=new Y(0,1,0,.05),xft=new Y(0,.5,0,.2);function DT(e){e=y(e,y.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 Di({ellipsoid:e.ellipsoid}),this._cells=y(e.cells,8),this._color=y(e.color,gft),this._glowColor=y(e.glowColor,yft),this._glowWidth=y(e.glowWidth,6),this._backgroundColor=y(e.backgroundColor,xft),this._errorEvent=new be,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._canvasSize=y(e.canvasSize,256),this._canvas=this._createGridCanvas()}Object.defineProperties(DT.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}}});DT.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()};DT.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};DT.prototype.getTileCredits=function(e,t,n){};DT.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};DT.prototype.pickFeatures=function(e,t,n,i,o){};var F8=DT;var qki=T(S(),1);var Cki=T(S(),1);var rki=T(S(),1);var R5i=T(S(),1);function Xh(){}Xh._maxDecodingConcurrency=Math.max(Ot.hardwareConcurrency-1,1);Xh._decodeTaskProcessor=new bi("decodeI3S",Xh._maxDecodingConcurrency);Xh._promise=void 0;async function _ft(){if(await Xh._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return Xh._decodeTaskProcessor;throw new ue("I3S decoder could not be initialized.")}Xh.decode=async function(e,t,n,i,o){return l(Xh._promise)||(Xh._promise=_ft()),Xh._promise.then(function(r){let s=n._parent._data,a=n._parent._inverseRotationMatrix,c=0,d=0,u=0;l(s.obb)?(c=s.obb.center[0],d=s.obb.center[1],u=s.obb.center[2]):l(s.mbs)&&(c=s.mbs[0],d=s.mbs[1],u=s.mbs[2]);let m=$.fromRotationX(-W.PI_OVER_TWO),p=new $;$.multiply(m,a,p);let g=he.fromDegrees(c,d,u),f=ne.WGS84.cartographicToCartesian(g),x={binaryData:n._data,featureData:l(i)&&l(i[0])?i[0].data:void 0,schema:t,bufferInfo:n._geometryBufferInfo,ellipsoidRadiiSquare:ne.WGS84.radiiSquared,url:e,geoidDataList:n._dataProvider._geoidDataList,cartographicCenter:g,cartesianCenter:f,parentRotation:p,enableFeatures:n._dataProvider.showFeatures,splitGeometryByColorTransparency:n._dataProvider.adjustMaterialAlphaMode,symbologyData:o,calculateNormals:n._dataProvider.calculateNormals};return r.scheduleTask(x)})};var BF=Xh;var X5i=T(S(),1);function A8(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(A8.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});A8.prototype.load=async function(){return this._data=await Ih.loadJson(this._resource),this._data};var YF=A8;var v5i=T(S(),1);function ob(e,t){this._storageInfo=t,this._parent=e,this._dataProvider=e._dataProvider,this._loadPromise=void 0;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(ob.prototype,{resource:{get:function(){return this._resource}},header:{get:function(){return this._header}},values:{get:function(){if(l(this._values)){if(l(this._values.attributeValues))return this._values.attributeValues;if(l(this._values.objectIds))return this._values.objectIds}return[]}},name:{get:function(){return this._storageInfo.name}}});function d3(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}function Tft(e){return e==="String"?1:d3(e)}async function Sft(e){let t=await e._dataProvider._loadBinary(e._resource),n=new DataView(t);e._data=t,e._validateHeader(n);let i=e._parseHeader(n),o=e._getBodyOffset(i);e._validateBody(n,o),e._parseBody(n,o)}ob.prototype.load=function(){return l(this._loadPromise)?this._loadPromise:(this._loadPromise=Sft(this).catch(function(e){console.error(e)}),this._loadPromise)};ob.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}};ob.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};ob.prototype._parseBody=function(e,t){this._values={};for(let n=0;n<this._storageInfo.ordering.length;n++){let i=this._storageInfo.ordering[n],o=i==="ObjectIds"?"objectIds":i,r=this._storageInfo[o];if(l(r)){this._values[o]=[];for(let s=0;s<this._header.count;++s)if(r.valueType!=="String"){let a=this._parseValue(e,r.valueType,t);this._values[o].push(a.value),t=a.offset}else{let a=this._values.attributeByteCounts[s],c="";for(let d=0;d<a;++d){let u=this._parseValue(e,r.valueType,t);u.value.charCodeAt(0)!==0&&(c+=u.value),t=u.offset}this._values[o].push(c)}}}};ob.prototype._getBodyOffset=function(e){let t=0;return l(this._storageInfo.attributeValues)?t=d3(this._storageInfo.attributeValues.valueType):l(this._storageInfo.objectIds)&&(t=d3(this._storageInfo.objectIds.valueType)),t>0?Math.ceil(e/t)*t:e};ob.prototype._validateHeader=function(e){let t=0;for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n];t+=Tft(i.valueType)}if(e.byteLength<t)throw new ue(`Invalid attribute buffer size (field: ${this.name}, header: ${t}, actual: ${e.byteLength})`)};ob.prototype._validateBody=function(e,t){if(!l(this._header.count))throw new ue(`Invalid attribute buffer (field: ${this.name}, count is missing)`);let n;for(let i=0;i<this._storageInfo.ordering.length&&t<e.byteLength;i++){let o=this._storageInfo.ordering[i],r=o==="ObjectIds"?"objectIds":o,s=this._storageInfo[r];if(l(s))if(s.valueType!=="String"){r==="attributeByteCounts"&&(n=t);let a=d3(s.valueType);t+=a*this._header.count}else{if(!l(n))throw new ue(`Invalid attribute buffer (field: ${this.name}, attributeByteCounts is missing)`);for(let a=0;a<this._header.count&&t<e.byteLength;++a){let c=this._parseValue(e,this._storageInfo.attributeByteCounts.valueType,n);t+=c.value,n=c.offset}}else throw new ue(`Invalid attribute buffer (field: ${this.name}, ${r} is missing)`)}if(e.byteLength<t)throw new ue(`Invalid attribute buffer size (field: ${this.name}, expected: ${t}, actual: ${e.byteLength})`)};var OF=ob;var U5i=T(S(),1);function HF(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(HF.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});HF.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var Cft=new h,Vft=new h,Lft=new h,Rft=new h,Zft=new h;function M8(e,t,n,i){let o=h.subtract(i,n,Cft),r=h.cross(o,h.subtract(e,n,Vft),Rft),s=h.cross(o,h.subtract(t,n,Lft),Zft);return h.dot(r,s)>=0}var Gft=new h,Eft=new h,Xft=new h,Ift=new h,Wft=new h,Pft=new h,vft=new h,wft=new h,Fft=new h,Aft=new h;HF.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,$.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 g,f,x;l(u)?(g=u[p],f=u[p+1],x=u[p+2]):(g=p*3,f=p*3+1,x=p*3+2);let _=h.fromElements(d[g*3],d[g*3+1],d[g*3+2],Gft),C=h.fromElements(d[f*3],d[f*3+1],d[f*3+2],Eft),V=new h(d[x*3],d[x*3+1],d[x*3+2],Xft);if(!M8(i,_,C,V)||!M8(i,C,_,V)||!M8(i,V,_,C))continue;let L=h.subtract(C,_,Ift),Z=h.subtract(V,_,Wft),E=h.cross(L,Z,Pft);if(h.magnitude(E)===0)continue;let X=h.normalize(E,vft),v=h.subtract(i,_,wft),P=Math.abs(h.dot(v,X));if(P<o){o=P,r=p;let A=h.magnitudeSquared(h.subtract(i,_,v)),M=h.magnitudeSquared(h.subtract(i,C,Fft)),b=h.magnitudeSquared(h.subtract(i,V,Aft));A<M&&A<b?(a=g,c=_,s=A):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}};function $xe(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push(ZT(e[i])):t.push(e[i]);return t}HF.prototype._generateGltf=function(e,t,n,i,o,r,s,a){let c={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},d=!1,u,m="";if(l(this._parent._data.mesh)&&l(this._layer._data.materialDefinitions)){let L=this._parent._data.mesh.material.definition;if(L>=0&&L<this._layer._data.materialDefinitions.length){if(u=this._layer._data.materialDefinitions[L],c=u,l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorTexture)){d=!0,c.pbrMetallicRoughness.baseColorTexture.index=0;let Z="0";if(l(this._layer._data.textureSetDefinitions))for(let E=0;E<this._layer._data.textureSetDefinitions.length;E++){let X=this._layer._data.textureSetDefinitions[E];for(let v=0;v<X.formats.length;v++){let P=X.formats[v];if(P.format==="jpg"){Z=P.name;break}}}l(this._parent._data.mesh)&&this._parent._data.mesh.material.resource>=0&&(m=this._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.material.resource}/textures/${Z}`}).url)}l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorFactor)&&(c.pbrMetallicRoughness.baseColorFactor=$xe(c.pbrMetallicRoughness.baseColorFactor)),l(c.emissiveFactor)&&(c.emissiveFactor=$xe(c.emissiveFactor))}}else l(this._parent._data.textureData)&&(d=!0,m=this._parent.resource.getDerivedResource({url:`${this._parent._data.textureData[0].href}`}).url,c.pbrMetallicRoughness.baseColorTexture={index:0});l(c.alphaMode)&&(c.alphaMode=c.alphaMode.toUpperCase());let p=[],g=[],f=[];d&&(p=[{sampler:0,source:0}],g=[{uri:m}],f=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]);let x=[],_=n.length;for(let V=0;V<_;V++){let L=n[V].primitives,Z=L.length;for(let E=0;E<Z;E++){let X=L[E];if(l(X.material)){for(;X.material>=x.length;){let P=Ye(c,!0);x.push(P)}let v=x[X.material];l(X.extra)&&X.extra.isTransparent?l(v.alphaMode)||(v.alphaMode="BLEND"):v.alphaMode==="BLEND"&&(v.alphaMode="OPAQUE")}}}return{scene:0,scenes:[{nodes:e}],nodes:t,meshes:n,buffers:i,bufferViews:o,accessors:r,materials:x,textures:p,images:g,samplers:f,asset:{version:"2.0"},extensions:s,extensionsUsed:a}};var sL=HF;function Vc(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,this._symbologyData=void 0}Object.defineProperties(Vc.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}}});Vc.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let o=e._create3DTileDefinition();e._tile=new Fu(e._layer._tileset,e._dataProvider.resource,o,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let o=await Ih.loadJson(this._resource);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()};function e_e(e,t){let n=new OF(e,t);return e._fields[t.name]=n,n.load()}Vc.prototype.loadFields=function(){let e=this._layer._data.attributeStorageInfo,t=[];if(l(e))for(let n=0;n<e.length;n++){let i=e[n],o=this._fields[i.name];l(o)?t.push(o.load()):t.push(e_e(this,i))}return Promise.all(t)};Vc.prototype.loadField=function(e){let t=this._fields[e];if(l(t))return t.load();let n=this._layer._data.attributeStorageInfo;if(l(n))for(let i=0;i<n.length;i++){let o=n[i];if(o.name===e)return e_e(this,o)}return Promise.resolve()};Vc.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)};Vc.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};Vc.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 Vc(e,y(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};Vc.prototype._loadGeometryData=function(){let e=[];if(l(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new sL(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 sL(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};Vc.prototype._loadFeatureData=function(){let e=[];if(l(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new YF(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};Vc.prototype._clearGeometryData=function(){this._geometryData=[]};Vc.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+=Uft(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=ne.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},o=ne.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 _a(0,0,0),d=wt.headingPitchRollQuaternion(o,c);l(this._data.obb)&&(d=new we(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let u=$.fromQuaternion(d),m=$.inverse(u,new $),p=new F(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),g=F.inverse(p,new F),f=F.clone(p);l(this._parent._globalTransform)&&F.multiply(p,this._parent._inverseGlobalTransform,f),this._globalTransform=p,this._inverseGlobalTransform=g,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}};Vc.prototype._loadSymbology=async function(){!l(this._symbologyData)&&l(this._layer._symbology)&&(this._symbologyData=await this._layer._symbology._getSymbology(this))};Vc.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){this._dataProvider._applySymbology&&await this._loadSymbology();let o=this._geometryData[0].resource.url,r=this._layer._data.store.defaultGeometrySchema,s=this._geometryData[0],a=await BF.decode(o,r,s,this._featureData[0],this._symbologyData);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,a.meshData.rootExtensions,a.meshData.extensionsUsed),this._geometryData[0]._customAttributes=a.meshData._customAttributes}let n=this._dataProvider._binarizeGltf(e),i=new Blob([n],{type:"application/binary"});return URL.createObjectURL(i)};async function Mft(e){let t=e._layer._filters,n=[];for(let i=0;i<t.length;i++){let o=e.loadField(t[i].name);n.push(o)}return await Promise.all(n),t}function Nft(e,t,n){if(!l(n.values)||n.values.length===0)return!1;let i=l(t)?t.values:[],o;e<i.length&&(o=i[e]);let r=!1;for(let s=0;s<n.values.length;s++)if(n.values[s]===o){r=!0;break}return r}async function t_e(e,t){let n=e._tile.content.batchTable;if(l(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await Mft(e);if(i.length>0)for(let o=0;o<n.featuresLength;o++)for(let r=0;r<i.length;r++){let s=i[r];if(!Nft(o,e._fields[s.name],s)){n.setShow(o,!1);break}}}t.show=!0}Vc.prototype._filterFeatures=function(){let e=[];for(let n=0;n<this._children.length;n++){let i=this._children[n]._filterFeatures();e.push(i)}let t=this._tile?.content?._model;if(l(this._geometryData)&&this._geometryData.length>0&&l(t)&&t.ready){t.show=!1;let n=t_e(this,t);e.push(n)}return Promise.all(e)};Fu.prototype._hookedRequestContent=Fu.prototype.requestContent;Fu.prototype.requestContent=function(){if(!this.tileset._isI3STileSet)return this._hookedRequestContent();if(!this._isLoading){this._isLoading=!0;let e=this;return this._i3sNode._createContentURL().then(t=>{if(!l(t)){e._isLoading=!1;return}return e._contentResource=new Ee({url:t}),e._hookedRequestContent()}).then(t=>{let n=t?._model;return l(e._i3sNode._geometryData)&&e._i3sNode._geometryData.length>0&&l(n)&&(n.show=!1,n.readyEvent.addEventListener(()=>{t_e(e._i3sNode,n)})),e._isLoading=!1,t})}};function kft(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 u3(e,t,n,i){let o=e+t*n;return i[o]}function Uft(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=u3(s,a,n.width,n.buffer),m=u3(c,a,n.width,n.buffer),p=u3(s,d,n.width,n.buffer),g=u3(c,d,n.width,n.buffer),f=kft(o,r,u,m,p,g);return f=f*n.scale+n.offset,f}Object.defineProperties(Fu.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var aL=Vc;var uki=T(S(),1);function m3(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties(m3.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function N8(e,t){let n=[];for(let i=0;i<e.length;i++){let o=Y.byteToFloat(e[i]);i<3?n.push(ZT(o)):n.push(o)}return n.length===3&&(l(t)?n.push(1-t/100):n.push(1)),n}function cL(e,t){let n={edges:void 0,material:void 0};if(l(e)&&l(e.symbolLayers))for(let i=0;i<e.symbolLayers.length;i++){let o=e.symbolLayers[i];if(o.type==="Fill"){let r=o.edges,s=o.outline;if(l(r)?(n.edges={},l(r.color)&&(n.edges.color=N8(r.color,r.transparency))):l(s)&&(n.edges={},l(s.color)&&(n.edges.color=N8(s.color,s.transparency))),!t){let a=o.material;l(a)&&(n.material={colorMixMode:a.colorMixMode},l(a.color)&&(n.material.color=N8(a.color,a.transparency)))}break}}return n}function Dft(e,t){if(l(e.uniqueValueGroups)){let n={};for(let i=0;i<e.uniqueValueGroups.length;i++){let o=e.uniqueValueGroups[i].classes;if(l(o))for(let r=0;r<o.length;r++){let s=cL(o[r].symbol,t),a=o[r].values;for(let c=0;c<a.length;c++){let d=a[c],u=n;for(let m=0;m<d.length;m++){let p=d[m];m===d.length-1?u[p]=s:(l(u[p])||(u[p]={}),u=u[p])}}}}return n}if(l(e.uniqueValueInfos)){let n={};for(let i=0;i<e.uniqueValueInfos.length;i++){let o=e.uniqueValueInfos[i];n[o.value]=cL(o.symbol,t)}return n}}function Bft(e,t){if(l(e.classBreakInfos)){let n=[...e.classBreakInfos];n.sort(function(o,r){let s=y(o.classMaxValue,o.classMinValue),a=y(r.classMaxValue,r.classMinValue);return s-a});let i={ranges:[],symbols:[]};l(e.minValue)&&(i.ranges.push(e.minValue),i.symbols.push(void 0));for(let o=0;o<n.length;o++){let r=n[o];l(r.classMinValue)&&(i.ranges.length===0||r.classMinValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMinValue),i.symbols.push(void 0)),l(r.classMaxValue)&&(i.ranges.length===0||r.classMaxValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMaxValue),i.symbols.push(cL(r.symbol,t)))}return i.symbols.push(void 0),i}}m3.prototype._parseLayerSymbology=function(){let e=this._layer.data.drawingInfo;if(l(e)&&l(e.renderer)){let t=this._layer.data.cachedDrawingInfo,n=l(t)&&t.color===!0,i=e.renderer;i.type==="simple"?this._defaultSymbology=cL(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=cL(i.defaultSymbol,n),this._valueFields.push(i.field1),l(i.field2)&&this._valueFields.push(i.field2),l(i.field3)&&this._valueFields.push(i.field3),this._uniqueValueHash=Dft(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=cL(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=Bft(i,n))}};function n_e(e,t,n,i){let o=t[n];if(i<o.length){let r=o[i],s=e[r];return l(s)&&++n<t.length?n_e(s,t,n,i):s}}function Yft(e,t){let n=0,i=e.length;if(n<i)do{let o=n+i>>>1;e[o]<t?n=o+1:i=o}while(n<i);return n}function Oft(e,t,n){let i=t[n],o=Yft(e.ranges,i);return e.symbols[o]}m3.prototype._getSymbology=async function(e){let t={default:this._defaultSymbology};if(this._valueFields.length>0){let n=[];for(let r=0;r<this._valueFields.length;r++)n.push(e.loadField(this._valueFields[r]));await Promise.all(n);let i=[];for(let r=0;r<this._valueFields.length;r++)i.push(e.fields[this._valueFields[r]].values);let o;if(l(this._uniqueValueHash)?o=r=>n_e(this._uniqueValueHash,i,0,r):l(this._classBreaksHash)&&(o=r=>Oft(this._classBreaksHash,i[0],r)),l(o)){let r=i[0];for(let s=0;s<r.length;s++){let a=o(s);l(a)&&(t[s]=a)}}}return t};var zF=m3;function jl(e,t,n){this._dataProvider=e,this._parent=n,!l(t.href)&&l(t.id)&&(t.href=`layers/${t.id}`);let i=this._parent.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 Ee({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._filters=[],this._symbology=void 0,this._computeGeometryDefinitions(!0),this._computeExtent()}Object.defineProperties(jl.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}}});jl.prototype.load=async function(e){if(this._data.spatialReference.wkid!==4326)throw new ue(`Unsupported spatial reference: ${this._data.spatialReference.wkid}`);if(this._dataProvider.applySymbology&&(this._symbology=new zF(this)),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()};jl.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)}};jl.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};jl.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 aL(this,t,!0)}else this._rootNode=new aL(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};jl.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]})};jl._fetchJson=function(e){return e.fetchJson()};jl.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=jl._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]};jl.prototype._computeExtent=function(){l(this._data.fullExtent)?this._extent=ae.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):l(this._data.store.extent)&&(this._extent=ae.fromDegrees(this._data.store.extent[0],this._data.store.extent[1],this._data.store.extent[2],this._data.store.extent[3]))};jl.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),o=this._symbology?.defaultSymbology?.edges?.color;l(o)&&!l(e?.outlineColor)&&(e=l(e)?Ye(e):{},e.outlineColor=Y.fromCartesian4(se.fromArray(o))),this._tileset=await ra.fromUrl(i,e),this._tileset.show=this._parent.show,this._tileset._isI3STileSet=!0,this._tileset.tileUnload.addEventListener(function(r){r._i3sNode._clearGeometryData(),URL.revokeObjectURL(r._contentResource._url),r._contentResource=r._i3sNode.resource}),this._tileset.tileVisible.addEventListener(function(r){l(r._i3sNode)&&r._i3sNode._loadChildren()})};jl.prototype._updateVisibility=function(){l(this._tileset)&&(this._tileset.show=this._parent.show)};jl.prototype.filterByAttributes=function(e){this._filters=l(e)?Ye(e,!0):[];let t=this._rootNode;return l(t)?t._filterFeatures():Promise.resolve()};var BT=jl;var Gki=T(S(),1);function h3(e,t){this._dataProvider=e,this._resource=new Ee({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(h3.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},names:{get:function(){let e=[],t=this._data.summary;if(l(t))for(let n=0;n<t.length;++n)e.push(t[n].fieldName);return e}}});h3.prototype.load=async function(){return this._data=await Ih.loadJson(this._resource),this._data};h3.prototype._getValues=function(e){let t=this._data.summary;if(l(t))for(let n=0;n<t.length;++n){let i=t[n];if(i.fieldName===e)return l(i.mostFrequentValues)?[...i.mostFrequentValues]:[]}};var KF=h3;var wki=T(S(),1);function JF(e,t,n){this._dataProvider=e,this._parent=t,this._data=n,this._name=n.name,this._modelName=n.modelName,this._visibility=y(n.visibility,!0),this._resource=void 0,this._sublayers=[],this._i3sLayers=[]}Object.defineProperties(JF.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},name:{get:function(){return this._name}},modelName:{get:function(){return this._modelName}},sublayers:{get:function(){return this._sublayers}},visibility:{get:function(){return this._visibility},set:function(e){if(this._visibility!==e){this._visibility=e;for(let t=0;t<this._i3sLayers.length;t++)this._i3sLayers[t]._updateVisibility()}}},show:{get:function(){return this._visibility&&this._parent.show}}});JF._fromData=async function(e,t,n,i){let o=new JF(e,i,n);if(o._data.layerType==="group"){let r=o._data.sublayers;if(l(r)){let s=[];for(let c=0;c<r.length;c++){let d=JF._fromData(e,t,r[c],o);s.push(d)}let a=await Promise.all(s);for(let c=0;c<a.length;c++){let d=a[c];o._sublayers.push(d),o._i3sLayers.push(...d._i3sLayers)}}}else if(o._data.layerType==="3DObject"){let r=t.concat(`/sublayers/${o._data.id}`),s=new Ee({url:r});s.setQueryParameters(e.resource.queryParameters),s.appendForwardSlash(),o._resource=s;let a=await Ih.loadJson(o._resource),c=new BT(e,a,o);o._i3sLayers.push(c)}else console.log(`${o._data.layerType} layer ${o._data.name} is skipped as not supported.`);return o};var QF=JF;var r_e=T(i_e(),1);function us(e){e=y(e,y.EMPTY_OBJECT),this._name=e.name,this._show=y(e.show,!0),this._geoidTiledTerrainProvider=e.geoidTiledTerrainProvider,this._showFeatures=y(e.showFeatures,!1),this._adjustMaterialAlphaMode=y(e.adjustMaterialAlphaMode,!1),this._applySymbology=y(e.applySymbology,!1),this._calculateNormals=y(e.calculateNormals,!1),this._cesium3dTilesetOptions=y(e.cesium3dTilesetOptions,y.EMPTY_OBJECT),this._layers=[],this._sublayers=[],this._data=void 0,this._extent=void 0,this._geoidDataPromise=void 0,this._geoidDataList=void 0,this._decoderTaskProcessor=void 0,this._taskProcessorReadyPromise=void 0,this._attributeStatistics=[],this._layersExtent=[]}Object.defineProperties(us.prototype,{name:{get:function(){return this._name}},show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;for(let t=0;t<this._layers.length;t++)this._layers[t]._updateVisibility()}}},geoidTiledTerrainProvider:{get:function(){return this._geoidTiledTerrainProvider}},layers:{get:function(){return this._layers}},sublayers:{get:function(){return this._sublayers}},data:{get:function(){return this._data}},extent:{get:function(){return this._extent}},resource:{get:function(){return this._resource}},showFeatures:{get:function(){return this._showFeatures}},adjustMaterialAlphaMode:{get:function(){return this._adjustMaterialAlphaMode}},applySymbology:{get:function(){return this._applySymbology}},calculateNormals:{get:function(){return this._calculateNormals}}});us.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)l(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return me(this)};us.prototype.isDestroyed=function(){return!1};us.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};us.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};us.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};us.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)};function Hft(e,t){let n=e.resource.getUrlComponent(),i="";return n.match(/layers\/\d/)?i=`${n}`.replace(/\/+$/,""):i=`${n}`.replace(/\/?$/,"/").concat(`layers/${t}`),i}async function o_e(e,t,n){if(t.layerType==="Building"){l(n.showFeatures)||(e._showFeatures=!0),l(n.adjustMaterialAlphaMode)||(e._adjustMaterialAlphaMode=!0),l(n.applySymbology)||(e._applySymbology=!0),l(n.calculateNormals)||(e._calculateNormals=!0);let i=Hft(e,t.id);if(l(t.sublayers)){let o=[];for(let s=0;s<t.sublayers.length;s++){let a=QF._fromData(e,i,t.sublayers[s],e);o.push(a)}let r=await Promise.all(o);for(let s=0;s<r.length;s++){let a=r[s];e._sublayers.push(a),e._layers.push(...a._i3sLayers)}}if(l(t.statisticsHRef)){let o=i.concat(`/${t.statisticsHRef}`),r=new KF(e,o);await r.load(),e._attributeStatistics.push(r)}if(l(t.fullExtent)){let o=ae.fromDegrees(t.fullExtent.xmin,t.fullExtent.ymin,t.fullExtent.xmax,t.fullExtent.ymax);e._layersExtent.push(o)}}else if(t.layerType==="3DObject"||t.layerType==="IntegratedMesh"){!l(n.calculateNormals)&&!l(t.textureSetDefinitions)&&(e._calculateNormals=!0);let i=new BT(e,t,e);e._layers.push(i),l(i._extent)&&e._layersExtent.push(i._extent)}else console.log(`${t.layerType} layer ${t.name} is skipped as not supported.`)}us.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Ee.createIfNeeded(e);n.setQueryParameters({f:"pjson"},!0);let i=await us.loadJson(n),o=new us(t);if(o._resource=n,o._data=i,l(i.layers)){let s=[];for(let a=0;a<i.layers.length;a++){let c=o_e(o,i.layers[a],t);s.push(c)}await Promise.all(s)}else await o_e(o,i,t);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};us._fetchJson=function(e){return e.fetchJson()};us.loadJson=async function(e){let t=await us._fetchJson(e);if(l(t.error)){if(console.error("Failed to fetch I3S ",e.url),l(t.error.message)&&console.error(t.error.message),l(t.error.details))for(let n=0;n<t.error.details.length;n++)console.log(t.error.details[n]);throw new ue(t.error)}return t};us.prototype._loadBinary=async function(e){let t=await e.fetchArrayBuffer();if(t.byteLength>0&&new Uint8Array(t)[0]===123&&new TextDecoder().decode(t).includes("404"))throw new ue(`Failed to load binary: ${e.url}`);return t};us.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 zft=new D;function Kft(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 g=D.fromElements(m,p,zft),f=g.toString();if(!o.hasOwnProperty(f)){let x={x:g.x,y:g.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],g=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);u.push(g)}return Promise.all(u).then(function(m){let p=[];for(let g=0;g<m.length;g++){let f={tilingScheme:n,x:i[g].x,y:i[g].y,level:i[g].level},x=m[g],_="Geographic";n._projection instanceof Ri&&(_="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===Ju.LERC){let V=r_e.default.decode(x._buffer);C.buffer=V.pixels[0]}else C.buffer=x._buffer;p.push(C)}return p})}async function Jft(e){let t=e._geoidTiledTerrainProvider;if(l(t))try{let n=await Kft(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}us.prototype.loadGeoidData=async function(){return l(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=Jft(this),this._geoidDataPromise)};us.prototype._computeExtent=function(){let e;for(let t=0;t<this._layersExtent.length;t++){let n=this._layersExtent[t];l(e)?ae.union(e,n,e):e=ae.clone(n)}this._extent=e};us.prototype.getAttributeNames=function(){let e=[];for(let t=0;t<this._attributeStatistics.length;++t)e.push(...this._attributeStatistics[t].names);return e};us.prototype.getAttributeValues=function(e){for(let t=0;t<this._attributeStatistics.length;++t){let n=this._attributeStatistics[t]._getValues(e);if(l(n))return n}return[]};us.prototype.filterByAttributes=function(e){let t=[];for(let n=0;n<this._layers.length;n++){let i=this._layers[n].filterByAttributes(e);t.push(i)}return Promise.all(t)};var Ih=us;var gUi=T(S(),1);function Kf(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new hi({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new hi({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 ei({color:new Y(0,0,0,0),owner:this}),this._clearCommand=new ei({color:new Y(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(Kf.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});Kf.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var Qft={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Un.EQUAL,frontOperation:{fail:bt.KEEP,zFail:bt.KEEP,zPass:bt.KEEP},backFunction:Un.NEVER,reference:0,mask:Bt.CLASSIFICATION_MASK},blending:un.ALPHA_BLEND},jft={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Un.NOT_EQUAL,frontOperation:{fail:bt.KEEP,zFail:bt.KEEP,zPass:bt.KEEP},backFunction:Un.NEVER,reference:0,mask:Bt.CLASSIFICATION_MASK},blending:un.ALPHA_BLEND},qft={depthMask:!0,depthTest:{enabled:!0},stencilTest:Bt.setCesium3DTileBit(),stencilMask:Bt.CESIUM_3D_TILE_MASK,blending:un.ALPHA_BLEND},$ft=`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;
}
`,ept=`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
}
`;Kf.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 Ft({context:e,width:s,height:a,pixelFormat:at.DEPTH_STENCIL,pixelDatatype:nt.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new rd({context:e,width:s,height:a,format:Ic.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=Ue.fromCache(Qft),this._rsClassified=Ue.fromCache(jft),this._rsDefault=Ue.fromCache(qft)),!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)?ept:$ft,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(Ql,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};Kf.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};Kf.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))};Kf.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)};Kf.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};Kf.prototype.isDestroyed=function(){return!1};Kf.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()),me(this)};var lL=Kf;var SUi=T(S(),1);function p3(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(p3.prototype,{total:{get:function(){return this._total}}});function Zy(e){let t=new Array(Ea.NUMBER_OF_JOB_TYPES);t[Ea.TEXTURE]=new p3(l(e)?e[Ea.TEXTURE]:10),t[Ea.PROGRAM]=new p3(l(e)?e[Ea.PROGRAM]:10),t[Ea.BUFFER]=new p3(l(e)?e[Ea.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}Zy.getTimestamp=_i;Object.defineProperties(Zy.prototype,{totalBudget:{get:function(){return this._totalBudget}}});Zy.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};Zy.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};Zy.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=Zy.getTimestamp();e.execute();let a=Zy.getTimestamp()-s;return this._totalUsedThisFrame+=a,r?r.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var jF=Zy;var VUi=T(S(),1),s_e=Object.freeze({UNLOADED:0,RECEIVING:1,RECEIVED:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function b3(e,t){this.spatialNode=e,this.keyframe=t,this.state=s_e.UNLOADED,this.metadata=[],this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}b3.priorityComparator=function(e,t){return e.priority-t.priority};b3.searchComparator=function(e,t){return e.keyframe-t.keyframe};b3.LoadState=s_e;var Ki=b3;var ZUi=T(S(),1);function a_e(){}Object.defineProperties(a_e.prototype,{color:{get:pe.throwInstantiationError},intensity:{get:pe.throwInstantiationError}});var k8=a_e;var vUi=T(S(),1);var tpt=/\/$/,c_e=new Rt('&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 dL(e){e=y(e,y.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=Ee.createIfNeeded(y(e.url,"https://api.mapbox.com/styles/v1/"));this._styleId=t,this._accessToken=n;let o=y(e.tilesize,512);this._tilesize=o;let r=y(e.username,"mapbox");this._username=r;let s=l(e.scaleFactor)?"@2x":"",a=i.getUrlComponent();tpt.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 Rt(c))):c=c_e,this._resource=i,this._imageryProvider=new Ma({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(dL.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}}});dL.prototype.getTileCredits=function(e,t,n){};dL.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};dL.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};dL._defaultCredit=c_e;var U8=dL;var eDi=T(S(),1);function Gy(e,t,n,i,o){i===an.UNSIGNED_SHORT&&(i=an.FLOAT32);let r=e.floatingPointTexture;if(i===an.FLOAT32&&!r)throw new ue("Floating point texture not supported");let s;i===an.FLOAT32||i===an.FLOAT64?s=nt.FLOAT:i===an.UINT8&&(s=nt.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(y(o,d),c);let u=Dt.maximumTextureSize,m=an.getSizeInBytes(i),p=Math.floor(o/(n*m)),g=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(g/_),L=Math.floor(g/C);if(V===0||L===0)throw new ue("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 D(V,L),this.voxelCountPerRegion=new D(_,C),this.sliceCountPerRegion=new D(f,x),this.voxelSizeUv=new D(1/g,1/g),this.sliceSizeUv=new D(t.x/g,t.y/g),this.regionSizeUv=new D(_/g,C/g),this.texture=new Ft({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:g,height:g,sampler:new $t({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:qt.LINEAR,magnificationFilter:ui.LINEAR})});let Z=an.toComponentDatatype(i);this.tileVoxelDataTemp=Q.createTypedArray(Z,_*C*n),this.nodes=new Array(this.maximumTileCount);for(let E=0;E<this.maximumTileCount;E++)this.nodes[E]=new npt(E);for(let E=0;E<this.maximumTileCount;E++){let X=this.nodes[E];X.previousNode=E>0?this.nodes[E-1]:void 0,X.nextNode=E<this.maximumTileCount-1?this.nodes[E+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0}function npt(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}Gy.prototype.add=function(e){if(this.isFull())throw new pe("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};Gy.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new pe("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--};Gy.prototype.isFull=function(){return this.emptyList===void 0};Gy.getApproximateTextureMemoryByteLength=function(e,t,n,i){i===an.UNSIGNED_SHORT&&(i=an.FLOAT32);let o=an.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),g=Math.floor(u/d);if(p*g>=e)break;u*=2}return u*u*n*o};Gy.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,E=(C+V)*r.x+(_+L);for(let X=0;X<s;X++)a[E*s+X]=n[Z*s+X]}}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)};Gy.prototype.isDestroyed=function(){return!1};Gy.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),me(this)};var uL=Gy;var pDi=T(S(),1);function qF(e){e=y(e,y.EMPTY_OBJECT);let t=e.textureUrl;l(t)||(t=nn("Assets/Textures/moonSmall.jpg")),this.show=y(e.show,!0),this.textureUrl=t,this._ellipsoid=y(e.ellipsoid,ne.MOON),this.onlySunLighting=y(e.onlySunLighting,!0),this._ellipsoidPrimitive=new uF({radii:this.ellipsoid.radii,material:Ui.fromType(Ui.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new nw}Object.defineProperties(qF.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var g3=new $,ipt=new $,opt=new h,y3=[];qF.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(wt.computeIcrfToFixedMatrix(n,g3))||wt.computeTemeToPseudoFixedMatrix(n,g3);let i=this._axes.evaluate(n,ipt);$.transpose(i,i),$.multiply(g3,i,i);let o=Eb.computeMoonPositionInEarthInertialFrame(n,opt);$.multiplyByVector(g3,o,o),F.fromRotationTranslation(i,o,t.modelMatrix);let r=e.commandList;return e.commandList=y3,y3.length=0,t.update(e),e.commandList=r,y3.length===1?y3[0]:void 0};qF.prototype.isDestroyed=function(){return!1};qF.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),me(this)};var $F=qF;var gDi=T(S(),1);function D8(e){}D8.prototype.isReady=function(){return!0};D8.prototype.shouldDiscardImage=function(e){return!1};var B8=D8;var FDi=T(S(),1);function rb(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 hi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new hi({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new hi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new hi({createColorAttachments:!1}),this._opaqueClearCommand=new ei({color:new Y(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new ei({color:new Y(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new ei({color:new Y(0,0,0,0),owner:this}),this._alphaClearCommand=new ei({color:new Y(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 Ke,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function l_e(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function Y8(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function d_e(e){l_e(e),Y8(e)}function rpt(e,t,n,i){l_e(e),e._accumulationTexture=new Ft({context:t,width:n,height:i,pixelFormat:at.RGBA,pixelDatatype:nt.FLOAT});let o=new Float32Array(n*i*4);e._revealageTexture=new Ft({context:t,pixelFormat:at.RGBA,pixelDatatype:nt.FLOAT,source:{arrayBufferView:o,width:n,height:i},flipY:!1})}function spt(e,t){Y8(e);let n=ie.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)&&(Y8(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)&&(d_e(e),e._translucentMultipassSupport=!1,i=!1)}return i}rb.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,rpt(this,e,r,s)),(!l(this._translucentFBO.framebuffer)||c||d)&&!spt(this,e))return;this._useHDR=i;let u=this,m,p;l(this._compositeCommand)||(m=new Oe({sources:[_w]}),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:[wV]}),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:[wV]}),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 g=!Ke.equals(this._viewport,t.viewport),f=g!==this._useScissorTest;this._useScissorTest=g,Ke.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=Ke.clone(t.viewport,this._scissorRectangle),f=!0),(!l(this._rs)||!Ke.equals(this._viewport,this._rs.viewport)||f)&&(this._rs=Ue.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 apt={enabled:!0,color:new Y(0,0,0,0),equationRgb:La.ADD,equationAlpha:La.ADD,functionSourceRgb:Co.ONE,functionDestinationRgb:Co.ONE,functionSourceAlpha:Co.ZERO,functionDestinationAlpha:Co.ONE_MINUS_SOURCE_ALPHA},cpt={enabled:!0,color:new Y(0,0,0,0),equationRgb:La.ADD,equationAlpha:La.ADD,functionSourceRgb:Co.ONE,functionDestinationRgb:Co.ONE,functionSourceAlpha:Co.ONE,functionDestinationAlpha:Co.ONE},lpt={enabled:!0,color:new Y(0,0,0,0),equationRgb:La.ADD,equationAlpha:La.ADD,functionSourceRgb:Co.ZERO,functionDestinationRgb:Co.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:Co.ZERO,functionDestinationAlpha:Co.ONE_MINUS_SOURCE_ALPHA};function O8(e,t,n,i){let o=n[i.id];if(!l(o)){let r=Ue.getState(i);r.depthMask=!1,r.blending=t,o=Ue.fromCache(r),n[i.id]=o}return o}function dpt(e,t,n){return O8(t,apt,e._translucentRenderStateCache,n)}function upt(e,t,n){return O8(t,cpt,e._translucentRenderStateCache,n)}function mpt(e,t,n){return O8(t,lpt,e._alphaRenderStateCache,n)}var hpt=`    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);
`,fpt=`    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;
`,ppt=`    float ai = czm_out_FragColor.a;
    out_FragColor = vec4(ai);
`;function H8(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 bpt(e,t){return H8(e,t,"translucentMRT",hpt)}function gpt(e,t){return H8(e,t,"translucentMultipass",fpt)}function ypt(e,t){return H8(e,t,"alphaMultipass",ppt)}rb.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=tt.shallowClone(e,n.translucentCommand),!l(a)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=bpt(t,e.shaderProgram),n.translucentCommand.renderState=dpt(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=tt.shallowClone(e,n.translucentCommand),n.alphaCommand=tt.shallowClone(e,n.alphaCommand),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=gpt(t,e.shaderProgram),n.translucentCommand.renderState=upt(this,t,e.renderState),n.alphaCommand.shaderProgram=ypt(t,e.shaderProgram),n.alphaCommand.renderState=mpt(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 xpt(e,t,n,i,o,r){let s,a,c,{context:d,frameState:u}=t,{useLogDepth:m,shadowState:p}=u,g=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=g?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=g?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 _pt(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 g=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,g);l(r)&&(f=r.unclassifiedCommand,x=p&&f.receiveShadows?f.derivedCommands.oit.shadows.translucentCommand:f.derivedCommands.oit.translucentCommand,n(x,t,s,i,g)),i.framebuffer=m}rb.prototype.executeCommands=function(e,t,n,i,o){if(this._translucentMRTSupport){_pt(this,e,t,n,i,o);return}xpt(this,e,t,n,i,o)};rb.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};rb.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,Y.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};rb.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};rb.prototype.isDestroyed=function(){return!1};rb.prototype.destroy=function(){return d_e(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()),me(this)};var e9=rb;var ODi=T(S(),1);var Tpt=new Rt("MapQuest, Open Street Map and contributors, CC-BY-SA");function x3(e){e=y(e,y.EMPTY_OBJECT);let t=Ee.createIfNeeded(y(e.url,"https://tile.openstreetmap.org/"));t.appendForwardSlash(),t.url+=`{z}/{x}/{y}${e.retinaTiles?"@2x":""}.${y(e.fileExtension,"png")}`;let n=new jr({ellipsoid:e.ellipsoid}),i=256,o=256,r=y(e.minimumLevel,0),s=e.maximumLevel,a=y(e.rectangle,n.rectangle),c=n.positionToTileXY(ae.southwest(a),r),d=n.positionToTileXY(ae.northeast(a),r),u=(Math.abs(d.x-c.x)+1)*(Math.abs(d.y-c.y)+1),m=y(e.credit,Tpt);typeof m=="string"&&(m=new Rt(m)),Ma.call(this,{url:t,credit:m,tilingScheme:n,tileWidth:i,tileHeight:o,minimumLevel:r,maximumLevel:s,rectangle:a})}l(Object.create)&&(x3.prototype=Object.create(Ma.prototype),x3.prototype.constructor=x3);var sb=x3;var qDi=T(S(),1);var Spt=new D(1,1);function z8(e){e=y(e,y.EMPTY_OBJECT),this.mass=y(e.mass,1),this.position=h.clone(y(e.position,h.ZERO)),this.velocity=h.clone(y(e.velocity,h.ZERO)),this.life=y(e.life,Number.MAX_VALUE),this.image=e.image,this.startColor=Y.clone(y(e.startColor,Y.WHITE)),this.endColor=Y.clone(y(e.endColor,Y.WHITE)),this.startScale=y(e.startScale,1),this.endScale=y(e.endScale,1),this.imageSize=D.clone(y(e.imageSize,Spt)),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(z8.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var u_e=new h;z8.prototype.update=function(e,t){return h.multiplyByScalar(this.velocity,e,u_e),h.add(this.position,u_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 mL=z8;var t3i=T(S(),1);function m_e(e){e=y(e,y.EMPTY_OBJECT),this.time=y(e.time,0),this.minimum=y(e.minimum,0),this.maximum=y(e.maximum,50),this._complete=!1}Object.defineProperties(m_e.prototype,{complete:{get:function(){return this._complete}}});var K8=m_e;var o3i=T(S(),1);function h_e(e){}h_e.prototype.emit=function(e){pe.throwInstantiationError()};var J8=h_e;var x3i=T(S(),1);var f_e=new D(1,1);function t9(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.updateCallback=e.updateCallback,this.loop=y(e.loop,!0),this.image=y(e.image,void 0);let t=e.emitter;l(t)||(t=new $w(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this._emitterModelMatrix=F.clone(y(e.emitterModelMatrix,F.IDENTITY)),this._matrixDirty=!0,this._combinedMatrix=new F,this._startColor=Y.clone(y(e.color,y(e.startColor,Y.WHITE))),this._endColor=Y.clone(y(e.color,y(e.endColor,Y.WHITE))),this._startScale=y(e.scale,y(e.startScale,1)),this._endScale=y(e.scale,y(e.endScale,1)),this._emissionRate=y(e.emissionRate,5),this._minimumSpeed=y(e.speed,y(e.minimumSpeed,1)),this._maximumSpeed=y(e.speed,y(e.maximumSpeed,1)),this._minimumParticleLife=y(e.particleLife,y(e.minimumParticleLife,5)),this._maximumParticleLife=y(e.particleLife,y(e.maximumParticleLife,5)),this._minimumMass=y(e.mass,y(e.minimumMass,1)),this._maximumMass=y(e.mass,y(e.maximumMass,1)),this._minimumImageSize=D.clone(y(e.imageSize,y(e.minimumImageSize,f_e))),this._maximumImageSize=D.clone(y(e.imageSize,y(e.maximumImageSize,f_e))),this._sizeInMeters=y(e.sizeInMeters,!1),this._lifetime=y(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 be,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties(t9.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||!F.equals(this._modelMatrix,e),F.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!F.equals(this._emitterModelMatrix,e),F.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){Y.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){Y.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 Cpt(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 mL;p._billboard=r.add({image:s,show:!1}),d.push(p)}e._particleEstimate=a}function Vpt(e){let t=e._particlePool.pop();return l(t)||(t=new mL),t}function Lpt(e,t){e._particlePool.push(t)}function Rpt(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 Zpt(e){l(e._billboard)&&(e._billboard.show=!1)}function p_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 Y(i,o,r,s),n.scale=W.lerp(t.startScale,t.endScale,t.normalizedAge)}function Gpt(e,t){t.startColor=Y.clone(e._startColor,t.startColor),t.endColor=Y.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 Ept(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 _3=new h;t9.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new yd),this._updateParticlePool&&(Cpt(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=q.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)?p_e(this,s):(Zpt(s),Lpt(this,s),n[r]=n[a-1],--r,--a);n.length=a;let c=Ept(this,t);if(c>0&&l(i)){this._matrixDirty&&(this._combinedMatrix=F.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let d=this._combinedMatrix;for(r=0;r<c;r++)s=Vpt(this),this._emitter.emit(s),h.add(s.position,s.velocity,_3),F.multiplyByPoint(d,_3,_3),s.position=F.multiplyByPoint(d,s.position,s.position),h.subtract(_3,s.position,s.velocity),h.normalize(s.velocity,s.velocity),Gpt(this,s),p_e(this,s)}if(this._billboardCollection.update(e),this._previousTime=q.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&&Rpt(this)};t9.prototype.isDestroyed=function(){return!1};t9.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),me(this)};var Q8=t9;var L3i=T(S(),1);function T3(e){e=y(e,y.EMPTY_OBJECT);let t=In(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=_i(),this._lastMsSampleTime=_i(),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(T3.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});T3.prototype.update=function(e){let t=_i(),n=y(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}};T3.prototype.destroy=function(){return me(this)};var ab=T3;var W3i=T(S(),1);function YT(){this._framebuffer=new hi,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(YT.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function Xpt(e,t,n){let i=n.width,o=n.height;e._framebuffer.update(t,i,o)}function Ipt(e,t,n){l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(`uniform highp sampler2D colorTexture;

in vec2 v_textureCoordinates;

void main()
{
  vec4 globeDepthPacked = texture(czm_globeDepthTexture, v_textureCoordinates);
  float globeDepth = czm_unpackDepth(globeDepthPacked);
  float depth = texture(colorTexture, v_textureCoordinates).r;
  out_FragColor = czm_branchFreeTernary(globeDepth <= 0.0 || globeDepth >= 1.0 || depth < globeDepth && depth > 0.0 && depth < 1.0,
    czm_packDepth(depth), globeDepthPacked);
}
`,{renderState:Ue.fromCache(),uniformMap:{colorTexture:function(){return e._textureToCopy}},owner:e})),e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}YT.prototype.update=function(e,t){Xpt(this,e,t),Ipt(this,e,t)};var Wpt=new se,Ppt=new se(1,1/255,1/65025,1/16581375);YT.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,Wpt);return se.divideByScalar(o,255,o),se.dot(o,Ppt)};YT.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};YT.prototype.isDestroyed=function(){return!1};YT.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),me(this)};var n9=YT;var M3i=T(S(),1);function i9(){this._framebuffer=new hi({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(i9.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function vpt(e){e._framebuffer.destroy()}function wpt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let o=new $a(t);o.blendingEnabled=!1,o.scissorTest={enabled:!0,rectangle:new Ke},o.viewport=new Ke,e._passState=o}i9.prototype.update=function(e,t,n){let i=n.width,o=n.height;this._framebuffer.isDirty(i,o)&&wpt(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};i9.prototype.isDestroyed=function(){return!1};i9.prototype.destroy=function(){return vpt(this),me(this)};var o9=i9;var z3i=T(S(),1);function hL(e){let t=new $a(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new Ke},t.viewport=new Ke,this._context=e,this._fb=new hi({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}hL.prototype.begin=function(e,t){let n=this._context,{width:i,height:o}=t;return Ke.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 r9=new Y;hL.prototype.end=function(e){let t=y(e.width,1),n=y(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 g=0;g<s;++g){if(-a<=d&&d<=a&&-c<=u&&u<=c){let f=4*((c-u)*t+d+a);r9.red=Y.byteToFloat(o[f]),r9.green=Y.byteToFloat(o[f+1]),r9.blue=Y.byteToFloat(o[f+2]),r9.alpha=Y.byteToFloat(o[f+3]);let x=i.getObjectByPickColor(r9);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}};hL.prototype.readVoxelInfo=function(e){let t=y(e.width,1),n=y(e.height,1),o=this._context.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),r=Math.floor(t*.5),a=4*(Math.floor(n*.5)*t+r);return o.slice(a,a+4)};hL.prototype.isDestroyed=function(){return!1};hL.prototype.destroy=function(){return this._fb.destroy(),me(this)};var s9=hL;var bOi=T(S(),1);var YYi=T(S(),1);var eBi=T(S(),1);function cb(){this._numSamples=1,this._colorFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new Y(0,0,0,0),this._clearCommand=new ei({color:new Y(0,0,0,0),depth:1,owner:this})}function Fpt(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(cb.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});cb.prototype.update=function(e,t,n,i){let o=t.width,r=t.height,s=n?e.halfFloatingPointTexture?nt.HALF_FLOAT:nt.FLOAT:nt.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,o,r,i,s),this._idFramebuffer.update(e,o,r)};cb.prototype.clear=function(e,t,n){Y.clone(n,this._clearCommand.color),Y.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};cb.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};cb.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};cb.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};cb.prototype.isDestroyed=function(){return!1};cb.prototype.destroy=function(){return Fpt(this),me(this)};var OT=cb;var jBi=T(S(),1);var oBi=T(S(),1);function HT(){}HT.getShadowCastShaderKeyword=function(e,t,n,i){return`castShadow ${e} ${t} ${n} ${i}`};HT.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})};HT.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})};HT.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}`};HT.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})};HT.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,g=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 X=0;X<L;++X)V[X]=Oe.replaceMain(V[X],"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"),g&&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 E;return c?E=`    return vec4(${a}, 1.0); 
`:E=`#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() 
{ 
${E}} 
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); 
`:g?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 Jf=HT;function Qf(e){e=y(e,y.EMPTY_OBJECT);let t=e.context;this._enabled=y(e.enabled,!0),this._softShadows=y(e.softShadows,!1),this._normalOffset=y(e.normalOffset,!0),this.dirty=!0,this.fromLightSource=y(e.fromLightSource,!0),this.darkness=y(e.darkness,.3),this._darkness=this.darkness,this.fadingEnabled=y(e.fadingEnabled,!0),this.maximumDistance=y(e.maximumDistance,5e3),this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let n=!0;(Ot.isInternetExplorer()||Ot.isEdge()||(Ot.isChrome()||Ot.isFirefox())&&Ot.isWindows()&&!t.depthTexture)&&(n=!1),this._polygonOffsetSupported=n,this._terrainBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new F,this._shadowMapTexture=void 0,this._lightDirectionEC=new h,this._lightPositionEC=new se,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new S3,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new ce,this._isPointLight=y(e.isPointLight,!1),this._pointLightRadius=y(e.pointLightRadius,100),this._cascadesEnabled=this._isPointLight?!1:y(e.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?y(e.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new D,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new Zr:l(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new se,new se],this._cascadeMatrices=[new F,new F,new F,new F],this._cascadeDistances=new se;let i;this._isPointLight?i=6:this._cascadesEnabled?i=this._numberOfCascades:i=1,this._passes=new Array(i);for(let o=0;o<i;++o)this._passes[o]=new Apt(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,q8(this),this._clearCommand=new ei({depth:1,color:new Y}),this._clearPassState=new $a(t),this._size=y(e.size,2048),this.size=this._size}Qf.MAXIMUM_DISTANCE=2e4;function Apt(e){this.camera=new S3,this.passState=new $a(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function j8(e,t){return Ue.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 q8(e){let t=!e._usesDepthTexture;e._primitiveRenderState=j8(t,e._primitiveBias),e._terrainRenderState=j8(t,e._terrainBias),e._pointRenderState=j8(t,e._pointBias)}Qf.prototype.debugCreateRenderStates=function(){q8(this)};Object.defineProperties(Qf.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){Bpt(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 $8(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 Mpt(e,t){let n=new rd({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Ic.DEPTH_COMPONENT16}),i=new Ft({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:at.RGBA,pixelDatatype:nt.UNSIGNED_BYTE,sampler:$t.NEAREST}),o=new js({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 Npt(e,t){let n=new Ft({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:at.DEPTH_STENCIL,pixelDatatype:nt.UNSIGNED_INT_24_8,sampler:$t.NEAREST}),i=new js({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 kpt(e,t){let n=new rd({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Ic.DEPTH_COMPONENT16}),i=new Sa({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:at.RGBA,pixelDatatype:nt.UNSIGNED_BYTE,sampler:$t.NEAREST}),o=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let r=0;r<6;++r){let s=new js({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 y_e(e,t){e._isPointLight?kpt(e,t):e._usesDepthTexture?Npt(e,t):Mpt(e,t)}function Upt(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==ie.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,q8(e),$8(e),y_e(e,t))}function Dpt(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&($8(e),y_e(e,t),Upt(e,t),x_e(e,t))}function x_e(e,t,n){n=y(n,0),(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function Bpt(e,t){e._size=t;let n=e._passes,i=n.length,o=e._textureSize;if(e._isPointLight){t=Dt.maximumCubeMapSize>=t?t:Dt.maximumCubeMapSize,o.x=t,o.y=t;let r=new Ke(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=Dt.maximumTextureSize>=t?t:Dt.maximumTextureSize,o.x=t,o.y=t,n[0].passState.viewport=new Ke(0,0,t,t)):i===4&&(t=Dt.maximumTextureSize>=t*2?t:Dt.maximumTextureSize/2,o.x=t*2,o.y=t*2,n[0].passState.viewport=new Ke(0,0,t,t),n[1].passState.viewport=new Ke(t,0,t,t),n[2].passState.viewport=new Ke(0,t,t,t),n[3].passState.viewport=new Ke(t,t,t,t));e._clearPassState.viewport=new Ke(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 F(u,0,0,c,0,m,0,d,0,0,1,0,0,0,0,1)}}var Ypt=new Ke;function Opt(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=Re.OVERLAY,i}function Hpt(e,t){let n=t.context,i=t.context.drawingBufferWidth,o=t.context.drawingBufferHeight,r=Math.min(i,o)*.3,s=Ypt;s.x=i-r,s.y=0,s.width=r,s.height=r;let a=e._debugShadowViewCommand;l(a)||(a=Opt(e,n),e._debugShadowViewCommand=a),(!l(a.renderState)||!Ke.equals(a.renderState.viewport,s))&&(a.renderState=Ue.fromCache({viewport:Ke.clone(s)})),t.commandList.push(e._debugShadowViewCommand)}var jf=new Array(8);jf[0]=new se(-1,-1,-1,1);jf[1]=new se(1,-1,-1,1);jf[2]=new se(1,1,-1,1);jf[3]=new se(-1,1,-1,1);jf[4]=new se(-1,-1,1,1);jf[5]=new se(1,-1,1,1);jf[6]=new se(1,1,1,1);jf[7]=new se(-1,1,1,1);var Ey=new F,e7=new Array(8);for(let e=0;e<8;++e)e7[e]=new se;function zpt(e,t){let n=new Vt({geometry:new xm({minimum:new h(-.5,-.5,-.5),maximum:new h(.5,.5,.5)}),attributes:{color:Ht.fromColor(t)}}),i=new Vt({geometry:new f0({radius:.5}),attributes:{color:Ht.fromColor(t)}});return new En({geometryInstances:[n,i],appearance:new dn({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var Kpt=[Y.RED,Y.GREEN,Y.BLUE,Y.MAGENTA],Jpt=new h;function Qpt(e,t){Hpt(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 Yf({camera:e._sceneCamera,color:Y.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new Yf({camera:e._shadowMapCamera,color:Y.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 Yf({camera:e._passes[i].camera,color:Kpt[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!l(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,o=we.IDENTITY,r=e._pointLightRadius*2,s=h.fromElements(r,r,r,Jpt),a=F.fromTranslationQuaternionRotationScale(i,o,s,Ey);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=zpt(a,Y.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new Yf({camera:e._shadowMapCamera,color:Y.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function S3(){this.viewMatrix=new F,this.inverseViewMatrix=new F,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 F}S3.prototype.clone=function(e){F.clone(e.viewMatrix,this.viewMatrix),F.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 jpt=new F(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);S3.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return F.multiply(t,e,this.viewProjectionMatrix),F.multiply(jpt,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var qpt=new Array(5),$pt=new Vi,e0t=new Array(4),__e=new h,T_e=new h;function t0t(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=e0t,g=qpt;for(g[0]=o,g[s]=r,a=0;a<s;++a){let M=(a+1)/s,b=o*Math.pow(d,M),R=o+c*M,G=W.lerp(R,b,u);g[a+1]=G,p[a]=G-g[a]}if(m){for(a=0;a<s;++a)p[a]=Math.min(p[a],e._maximumCascadeDistances[a]);let M=g[0];for(a=0;a<s-1;++a)M+=p[a],g[a+1]=M}se.unpack(g,0,e._cascadeSplits[0]),se.unpack(g,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,E=n.positionWC,X=n.directionWC,v=n.upWC,P=i.frustum.clone($pt),A=n.getViewProjection();for(a=0;a<s;++a){P.near=g[a],P.far=g[a+1];let M=F.multiply(P.projectionMatrix,i.viewMatrix,Ey),b=F.inverse(M,Ey),R=F.multiply(A,b,Ey),G=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,__e),I=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,T_e);for(let O=0;O<8;++O){let k=se.clone(jf[O],e7[O]);F.multiplyByVector(R,k,k),h.divideByScalar(k,k.w,k),h.minimumByComponent(k,G,G),h.maximumByComponent(k,I,I)}G.x=Math.max(G.x,0),G.y=Math.max(G.y,0),G.z=0,I.x=Math.min(I.x,1),I.y=Math.min(I.y,1),I.z=Math.min(I.z,1);let w=e._passes[a],N=w.camera;N.clone(n);let B=N.frustum;B.left=x+G.x*(_-x),B.right=x+I.x*(_-x),B.bottom=C+G.y*(V-C),B.top=C+I.y*(V-C),B.near=L+G.z*(Z-L),B.far=L+I.z*(Z-L),w.cullingVolume=N.frustum.computeCullingVolume(E,X,v);let U=e._cascadeMatrices[a];F.multiply(N.getViewProjection(),i.inverseViewMatrix,U),F.multiply(w.textureOffsets,U,U)}}var n0t=new F,i0t=new h,o0t=new h,b_e=new h;function r0t(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=F.multiply(i.frustum.projectionMatrix,i.viewMatrix,Ey),r=F.inverse(o,Ey),s=n.directionWC,a=i.directionWC;h.equalsEpsilon(s,a,W.EPSILON10)&&(a=i.upWC);let c=h.cross(s,a,i0t);a=h.cross(c,s,o0t),h.normalize(a,a),h.normalize(c,c);let d=h.fromElements(0,0,0,b_e),u=F.computeView(d,s,a,c,n0t),m=F.multiply(u,r,Ey),p=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,__e),g=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,T_e);for(let Z=0;Z<8;++Z){let E=se.clone(jf[Z],e7[Z]);F.multiplyByVector(m,E,E),h.divideByScalar(E,E.w,E),h.minimumByComponent(E,p,p),h.maximumByComponent(E,g,g)}g.z+=1e3,p.z-=10;let f=b_e;f.x=-(.5*(p.x+g.x)),f.y=-(.5*(p.y+g.y)),f.z=-g.z;let x=F.fromTranslation(f,Ey);u=F.multiply(x,u,u);let _=.5*(g.x-p.x),C=.5*(g.y-p.y),V=g.z-p.z,L=n.frustum;L.left=-_,L.right=_,L.bottom=-C,L.top=C,L.near=.01,L.far=V,F.clone(u,n.viewMatrix),F.inverse(u,n.inverseViewMatrix),F.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 s0t=[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)],a0t=[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)],c0t=[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 l0t(e,t){let n=new Vi;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=s0t[i],o.upWC=a0t[i],o.rightWC=c0t[i],F.computeView(o.positionWC,o.directionWC,o.upWC,o.rightWC,o.viewMatrix),F.inverse(o.viewMatrix,o.inverseViewMatrix),o.frustum=n}}var d0t=new h,u0t=new h,S_e=new ce,g_e=S_e.center;function m0t(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,o=S_e;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let r=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,d0t),s=h.negate(i.directionWC,u0t),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)===Kt.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,g_e),g_e);o.center=s,o.radius=r,e._outOfView=t.cullingVolume.computeVisibility(o)===Kt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),ce.clone(o,e._boundingSphere)}}function h0t(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;F.multiplyByPointAsVector(n.viewMatrix,r.directionWC,s),h.normalize(s,s),h.negate(s,s),F.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=io.clone(n,o),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=c,e._distance=c-a,m0t(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}Qf.prototype.update=function(e){if(h0t(this,e),this._needsUpdate)if(Dpt(this,e.context),this._isPointLight&&l0t(this,e),this._cascadesEnabled&&(r0t(this,e),this._numberOfCascades>1&&t0t(this,e)),this._isPointLight)this._shadowMapCullingVolume=rs.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;F.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&Qpt(this,e)};Qf.prototype.updatePass=function(e,t){x_e(this,e,t)};var f0t=new D;function C_e(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=f0t;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 _t(t,o,!1)}function p0t(e,t,n,i,o,r){let s,a,c;if(l(r)&&(s=r.shaderProgram,a=r.renderState,c=r.uniformMap),r=tt.shallowClone(n,r),r.castShadows=!0,r.receiveShadows=!1,!l(s)||o!==n.shaderProgram.id||t){let d=n.shaderProgram,u=n.pass===Re.GLOBE,m=n.pass!==Re.TRANSLUCENT,p=e._isPointLight,g=e._usesDepthTexture,f=Jf.getShadowCastShaderKeyword(p,u,g,m);if(s=i.shaderCache.getDerivedShaderProgram(d,f),!l(s)){let _=d.vertexShaderSource,C=d.fragmentShaderSource,V=Jf.createShadowCastVertexShader(_,p,u),L=Jf.createShadowCastFragmentShader(C,p,g,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=Ye(a,!1),a.cull=Ye(a.cull,!1),a.cull.enabled=!1,a=Ue.fromCache(a)),c=C_e(e,n.uniformMap,u)}return r.shaderProgram=s,r.renderState=a,r.uniformMap=c,r}Qf.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===Re.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=tt.shallowClone(t,o.receiveCommand),o.castShadows=!1,o.receiveShadows=!0;let g=o.receiveShaderCastShadows!==t.castShadows,f=o.receiveShaderProgramId!==t.shaderProgram.id;if(!l(m)||f||n||g){let x=Jf.getShadowReceiveShaderKeyword(e[0],t.castShadows,d,u);if(m=i.shaderCache.getDerivedShaderProgram(s,x),!l(m)){let _=Jf.createShadowReceiveVertexShader(a,d,u),C=Jf.createShadowReceiveFragmentShader(c,e[0],t.castShadows,d,u);m=i.shaderCache.createDerivedShaderProgram(s,x,{vertexShaderSource:_,fragmentShaderSource:C,attributeLocations:s._attributeLocations})}p=C_e(e[0],t.uniformMap,d)}o.receiveCommand.shaderProgram=m,o.receiveCommand.uniformMap=p,o.receiveShaderProgramId=t.shaderProgram.id,o.receiveShaderCastShadows=t.castShadows}return o};Qf.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]=p0t(e[c],n,t,i,s,r[c]);o.castShaderProgramId=t.shaderProgram.id}return o};Qf.prototype.isDestroyed=function(){return!1};Qf.prototype.destroy=function(){$8(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 me(this)};var lb=Qf;var _Yi=T(S(),1);var $Bi=T(S(),1),zT=`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 b0t=!1;function Xy(e){this._drawClassificationFBO=new hi({createDepthAttachments:!1}),this._accumulationFBO=new hi({createDepthAttachments:!1}),this._packFBO=new hi,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 ei({color:new Y(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new ei({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new Ke,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(Xy.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function V_e(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function L_e(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function g0t(e,t,n,i){V_e(e),e._translucentDepthStencilTexture=new Ft({context:t,width:n,height:i,pixelFormat:at.DEPTH_STENCIL,pixelDatatype:nt.UNSIGNED_INT_24_8,sampler:$t.NEAREST})}function y0t(e,t,n,i){L_e(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 x0t(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)&&(g0t(e,t,o,r),y0t(e,t,o,r));let s,a;if(l(e._packDepthCommand)||(s=new Oe({sources:[xw]}),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:[zT]}),a={colorTexture:function(){return e._textureToComposite}},b0t&&(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}),g=tt.shallowClone(u);g.shaderProgram=p,u.derivedCommands.pick=g}l(e._copyCommand)||(s=new Oe({sources:[zT]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),l(e._accumulateCommand)||(s=new Oe({sources:[zT]}),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=!Ke.equals(e._viewport,n.viewport),d=c!==e._useScissorTest;e._useScissorTest=c,Ke.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=Ke.clone(n.viewport,e._scissorRectangle),d=!0),(!l(e._rsDepth)||!Ke.equals(e._viewport,e._rsDepth.viewport)||d)&&(e._rsDepth=Ue.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!l(e._rsAccumulate)||!Ke.equals(e._viewport,e._rsAccumulate.viewport)||d)&&(e._rsAccumulate=Ue.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Un.EQUAL,reference:Bt.CESIUM_3D_TILE_MASK}})),l(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!l(e._rsComp)||!Ke.equals(e._viewport,e._rsComp.viewport)||d)&&(e._rsComp=Ue.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:un.ALPHA_BLEND})),l(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}Xy.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(x0t(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}};Xy.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(Re.CESIUM_3D_TILE_CLASSIFICATION);let a=r.globeDepthTexture;r.globeDepthTexture=this._packFBO.getColorTexture();let c=i.commands[Re.CESIUM_3D_TILE_CLASSIFICATION],d=i.indices[Re.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)};Xy.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),_0t(this,e,t)};function _0t(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}Xy.prototype.isSupported=function(){return this._supported};Xy.prototype.isDestroyed=function(){return!1};Xy.prototype.destroy=function(){return V_e(this),L_e(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()),me(this)};var a9=Xy;function T0t(){this.command=void 0,this.near=void 0,this.far=void 0}function C3(e,t,n){let i=e.context,o;i.depthTexture&&(o=new kF);let r;e._useOIT&&i.depthTexture&&(r=new e9(i));let s=new $a(i);s.viewport=Ke.clone(n),this.camera=t,this._cameraClone=io.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=s,this.pickFramebuffer=new s9(i),this.pickDepthFramebuffer=new o9,this.sceneFramebuffer=new OT,this.globeDepth=o,this.globeTranslucencyFramebuffer=new UF,this.oit=r,this.translucentTileClassification=new a9(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var R_e=new h,Z_e=new h;function S0t(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 C0t(e,t,n){let i=1/Math.max(1,S0t(e.position,t.position));return h.multiplyByScalar(e.position,i,R_e),h.multiplyByScalar(t.position,i,Z_e),h.equalsEpsilon(R_e,Z_e,n)&&h.equalsEpsilon(e.direction,t.direction,n)&&h.equalsEpsilon(e.up,t.up,n)&&h.equalsEpsilon(e.right,t.right,n)&&F.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}C3.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return C0t(t,n,W.EPSILON15)?(this._cameraStartFired&&_i()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=_i(),io.clone(t,n),!0)};function V0t(e,t,n,i){let o=t.frameState,r=o.camera,s=o.useLogDepth?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,a=t.mode===oe.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);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,g;a?(p=Math.min(i-c,n+m*c),g=Math.min(i,p+c)):(p=Math.max(n,Math.pow(s,m)*n),g=Math.min(i,s*p));let f=u[m];l(f)?(f.near=p,f.far=g):f=u[m]=new gF(p,g)}}function L0t(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 G_e=new rs,R0t=new Va;C3.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=Re.NUMBER_OF_PASSES;for(let R=0;R<d;++R)for(let G=0;G<u;++G)c[R].indices[G]=0;r.length=0,s.length=0;let m=this._commandExtents,p=m.length,g=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===oe.SCENE3D?t.occluder:void 0,E=t.cullingVolume,X=G_e.planes;for(let R=0;R<5;++R)X[R]=E.planes[R];E=G_e;let v=a.length;for(let R=0;R<v;++R){let G=a[R],I=G.pass;if(I===Re.COMPUTE)r.push(G);else if(I===Re.OVERLAY)s.push(G);else{let w,N,B=G.boundingVolume;if(l(B)){if(!e.isVisible(G,E,Z))continue;let O=B.computePlaneDistances(o,i,R0t);if(w=O.start,N=O.stop,f=Math.min(f,w),x=Math.max(x,N),_&&G.receiveShadows&&w<lb.MAXIMUM_DISTANCE&&!(I===Re.GLOBE&&w<-100&&N>100)){let k=N-w;I!==Re.GLOBE&&w<100&&(L=Math.min(L,k)),C=Math.min(C,w),V=Math.max(V,N)}}else G instanceof ei?(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 U=m[g];l(U)||(U=m[g]=new T0t),U.command=G,U.near=w,U.far=N,g++}}_&&(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),V0t(this,e,f,x);let P,A;for(P=0;P<g;P++)A=m[P],L0t(this,e,A.command,A.near,A.far);if(g<p)for(P=g;P<p&&(A=m[P],!!l(A.command));P++)A.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)};C3.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 KT=C3;var X_e=.1,Z0t=new em({pass:vo.MOST_DETAILED_PRELOAD}),G0t=new em({pass:vo.MOST_DETAILED_PICK}),L3=new em({pass:vo.PICK});function pa(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new Ke(0,0,1,1),n=new io(e);n.frustum=new sn({width:X_e,aspectRatio:1,near:.1}),this._pickOffscreenView=new KT(e,n,t)}pa.prototype.update=function(){this._pickPositionCacheDirty=!0};pa.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return l(i)||(i=new n9,n[t]=i),i};var E0t=new Zr,X0t=new h,V3=new h,I0t=new D,W0t=new F;function P0t(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=F.clone(r.transform,W0t);r._setTransform(F.IDENTITY);let m=h.clone(r.position,X0t);h.multiplyByScalar(r.right,c,V3),h.add(V3,m,m),h.multiplyByScalar(r.up,d,V3),h.add(V3,m,m),r._setTransform(u),e.mode===oe.SCENE2D&&h.fromElements(m.z,m.x,m.y,m);let p=s.getPixelDimensions(o.width,o.height,1,1,I0t),g=E0t;return g.right=p.x*.5,g.left=-g.right,g.top=p.y*.5,g.bottom=-g.top,g.near=s.near,g.far=s.far,g.computeCullingVolume(m,r.directionWC,r.upWC)}var v0t=new nl,w0t=new D;function F0t(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,g=m*a*c,f=s.getPixelDimensions(o.width,o.height,1,1,w0t),x=f.x*n*.5,_=f.y*i*.5,C=v0t;return C.top=g+_,C.bottom=g-_,C.right=p+x,C.left=p-x,C.near=a,C.far=s.far,C.computeCullingVolume(r.positionWC,r.directionWC,r.upWC)}function t7(e,t,n,i,o){let r=e.camera.frustum;return r instanceof sn||r instanceof Zr?P0t(e,t,n,i,o):F0t(e,t,n,i,o)}var Wh=3,db=3,Lc=new Ke(0,0,Wh,db),n7=new D,R3=new Y(0,0,0,0);pa.prototype.pick=function(e,t,n,i){Wh=y(n,3),db=y(i,Wh);let{context:o,frameState:r,defaultView:s}=e,{viewport:a,pickFramebuffer:c}=s;e.view=s,a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight;let d=s.passState;d.viewport=Ke.clone(a,d.viewport);let u=Yi.transformWindowToDrawingBuffer(e,t,n7);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=t7(e,u,Wh,db,a),r.invertClassification=!1,r.passes.pick=!0,r.tilesetPassState=L3,o.uniformState.update(r),e.updateEnvironment(),Lc.x=u.x-(Wh-1)*.5,Lc.y=e.drawingBufferHeight-u.y-(db-1)*.5,Lc.width=Wh,Lc.height=db,d=c.begin(Lc,a),e.updateAndExecuteCommands(d,R3),e.resolveFramebuffers(d);let m=c.end(Lc);return o.endFrame(),m};pa.prototype.pickVoxelCoordinate=function(e,t,n,i){Wh=y(n,3),db=y(i,Wh);let{context:o,frameState:r,defaultView:s}=e,{viewport:a,pickFramebuffer:c}=s;e.view=s,a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight;let d=s.passState;d.viewport=Ke.clone(a,d.viewport);let u=Yi.transformWindowToDrawingBuffer(e,t,n7);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=t7(e,u,Wh,db,a),r.invertClassification=!1,r.passes.pickVoxel=!0,r.tilesetPassState=L3,o.uniformState.update(r),e.updateEnvironment(),Lc.x=u.x-(Wh-1)*.5,Lc.y=e.drawingBufferHeight-u.y-(db-1)*.5,Lc.width=Wh,Lc.height=db,d=c.begin(Lc,a),e.updateAndExecuteCommands(d,R3),e.resolveFramebuffers(d);let m=c.readVoxelInfo(Lc);return o.endFrame(),m};function A0t(e,t){let{defaultView:n,context:i,frameState:o,environmentState:r}=e,{viewport:s,pickDepthFramebuffer:a}=n;e.view=n,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let c=n.passState;c.viewport=Ke.clone(s,c.viewport),e.clearPasses(o.passes),o.passes.pick=!0,o.passes.depth=!0,o.cullingVolume=t7(e,t,1,1,s),o.tilesetPassState=L3,e.updateEnvironment(),r.renderTranslucentDepthForPick=!0,c=a.update(i,t,s),e.updateAndExecuteCommands(c,R3),e.resolveFramebuffers(c),i.endFrame()}var M0t=new Vi,N0t=new nl,k0t=new sn,U0t=new Zr;pa.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{context:o,frameState:r,camera:s,defaultView:a}=e,{uniformState:c}=o;e.view=a;let d=Yi.transformWindowToDrawingBuffer(e,t,n7);e.pickTranslucentDepth?A0t(e,d):(e.updateFrameState(),c.update(r),e.updateEnvironment()),d.y=e.drawingBufferHeight-d.y;let u;l(s.frustum.fov)?u=s.frustum.clone(M0t):l(s.frustum.infiniteProjectionMatrix)?u=s.frustum.clone(N0t):l(s.frustum.width)?u=s.frustum.clone(k0t):u=s.frustum.clone(U0t);let m=a.frustumCommandsList,p=m.length;for(let g=0;g<p;++g){let x=this.getPickDepth(e,g).getDepth(o,d.x,d.y);if(l(x)&&x>0&&x<1){let _=m[g],C;return e.mode===oe.SCENE2D?(C=s.position.z,s.position.z=C-_.near+1,u.far=Math.max(1,_.far-_.near),u.near=1,c.update(r),c.updateFrustum(u)):(u.near=_.near*(g!==0?e.opaqueFrustumNearOffset:1),u.far=_.far,c.updateFrustum(u)),n=Yi.drawingBufferToWorldCoordinates(e,d,x,n),e.mode===oe.SCENE2D&&(s.position.z=C,c.update(r)),this._pickPositionCache[i]=h.clone(n),n}}this._pickPositionCache[i]=void 0};var D0t=new he;pa.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),l(n)&&e.mode!==oe.SCENE3D){h.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,o=i.ellipsoid,r=i.unproject(n,D0t);o.cartographicToCartesian(r,n)}return n};function I_e(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,g=!1;typeof p.getGeometryInstanceAttributes=="function"&&l(d.id)&&(i=p.getGeometryInstanceAttributes(d.id),l(i)&&l(i.show)&&(g=!0,i.show=xn.toValue(!1,i.show),s.push(i))),d instanceof vs&&(g=!0,d.show=!1,a.push(d)),g||(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=xn.toValue(!0,i.show);for(n=0;n<a.length;++n)a[n].show=!0;return o}pa.prototype.drillPick=function(e,t,n,i,o){let r=this;return I_e(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 E_e=new h,B0t=new h;function Y0t(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 W_e(e,t,n,i){let o=t.direction,r=h.mostOrthogonalAxis(o,E_e),s=h.cross(o,r,E_e),a=h.cross(o,s,B0t);return i.position=t.origin,i.direction=o,i.up=a,i.right=s,i.frustum.width=y(n,X_e),i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function O0t(e,t,n){let i=t.frameState,{ray:o,width:r,tilesets:s}=n,a=e._pickOffscreenView.camera,c=W_e(e,o,r,a),d=Z0t;d.camera=a,d.cullingVolume=c;let u=!0,m=s.length;for(let p=0;p<m;++p){let g=s[p];g.show&&t.primitives.contains(g)&&(g.updateForPass(i,d),u=u&&d.ready)}return u&&n._completePick(),u}pa.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)O0t(this,e,t[n])&&t.splice(n--,1)};function P_e(e,t,n){for(let i=0;i<e.length;++i){let o=e.get(i);o.show&&(l(o.isCesium3DTileset)?(!l(t)||t.indexOf(o)===-1)&&n.push(o):o instanceof Al&&P_e(o,t,n))}}function Z3(e,t,n,i,o,r){let s=[];if(P_e(t.primitives,i,s),s.length===0)return Promise.resolve(r());let a=new Y0t(n,o,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return r()})}function H0t(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 z0t(e,t,n,i,o,r,s){let{context:a,frameState:c}=t,d=a.uniformState,u=e._pickOffscreenView;t.view=u,W_e(e,n,o,u.camera),Lc=Ke.clone(u.viewport,Lc);let m=u.pickFramebuffer.begin(Lc,u.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),c.invertClassification=!1,c.passes.pick=!0,c.passes.offscreen=!0,s?c.tilesetPassState=G0t:c.tilesetPassState=L3,d.update(c),t.updateEnvironment(),t.updateAndExecuteCommands(m,R3),t.resolveFramebuffers(m);let p,g=u.pickFramebuffer.end(Lc);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,E=L+C*(Z-L);p=pn.getPoint(n,E);break}}}if(t.view=t.defaultView,a.endFrame(),l(g)||l(p))return{object:g,position:p,exclude:!l(p)&&r||H0t(g,i)}}function v_e(e,t,n,i,o,r,s,a){return I_e(i,function(){return z0t(e,t,n,o,r,s,a)})}function fL(e,t,n,i,o,r,s){let a=v_e(e,t,n,1,i,o,r,s);if(a.length>0)return a[0]}function w_e(e,t,n,i,o,r,s,a){return v_e(e,t,n,i,o,r,s,a)}function G3(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)})})}pa.prototype.pickFromRay=function(e,t,n,i){return fL(this,e,t,n,i,!1,!1)};pa.prototype.drillPickFromRay=function(e,t,n,i,o){return w_e(this,e,t,n,i,o,!1,!1)};pa.prototype.pickFromRayMostDetailed=function(e,t,n,i){let o=this;return t=pn.clone(t),n=l(n)?n.slice():n,G3(e,Z3(o,e,t,n,i,function(){return fL(o,e,t,n,i,!1,!0)}))};pa.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,o){let r=this;return t=pn.clone(t),i=l(i)?i.slice():i,G3(e,Z3(r,e,t,i,o,function(){return w_e(r,e,t,n,i,o,!1,!0)}))};var K0t=new h,J0t=new h,Q0t=new pn,F_e=new he;function i7(e,t){let n=e.ellipsoid,i=ai._defaultMaxTerrainHeight,o=n.geodeticSurfaceNormalCartographic(t,J0t),r=he.toCartesian(t,n,K0t),s=Q0t;s.origin=r,s.direction=o;let a=new pn;return pn.getPoint(s,i,a.origin),h.negate(o,a.direction),a}function A_e(e,t){let n=e.ellipsoid,i=he.fromCartesian(t,n,F_e);return i7(e,i)}function M_e(e,t){let n=e.ellipsoid;return he.fromCartesian(t,n,F_e).height}function j0t(e,t,n,i,o){let r=i7(t,n);return Z3(e,t,r,i,o,function(){let s=fL(e,t,r,i,o,!0,!0);if(l(s))return M_e(t,s.position)})}function q0t(e,t,n,i,o,r){let s=A_e(t,n);return Z3(e,t,s,i,o,function(){let a=fL(e,t,s,i,o,!0,!0);if(l(a))return h.clone(a.position,r)})}pa.prototype.sampleHeight=function(e,t,n,i){let o=i7(e,t),r=fL(this,e,o,n,i,!0,!1);if(l(r))return M_e(e,r.position)};pa.prototype.clampToHeight=function(e,t,n,i,o){let r=A_e(e,t),s=fL(this,e,r,n,i,!0,!1);if(l(s))return h.clone(s.position,o)};pa.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]=j0t(this,e,t[s],n,i);return G3(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}))};pa.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]=q0t(this,e,t[s],n,i,t[s]);return G3(e,Promise.all(r).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c]=s[c];return t}))};pa.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var c9=pa;var oHi=T(S(),1);var U_e=T(VM(),1);var yOi=T(S(),1);function $0t(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 l9=$0t;var TOi=T(S(),1);var ebt={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}}},pL=ebt;var JT={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=Y.clone(Y.DARKGRAY),this._highlightColor=Y.clone(Y.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=JT.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=y(e.opaquePass,Re.OPAQUE),this._cull=y(e.cull,!0),this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=F.clone(F.IDENTITY),this._modelMatrix=F.clone(F.IDENTITY),this.time=0,this.shadows=_n.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=y(e.splitDirection,Gr.NONE),this._splittingEnabled=!1,this._error=void 0,tbt(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 Y.clone(this._highlightColor)},set:function(e){this._highlightColor=Y.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 tbt(e,t){let n=f_.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=vp.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let a=n.draco;e._decodingState=JT.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=Y.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 nbt=new h,ibt=new h,obt=new h,N_e,E3;function rbt(e){if(!l(E3)){N_e=new U_e.default(0),E3=new Array(e);for(let t=0;t<e;++t)E3[t]=N_e.random()}return E3}function sbt(e){let n=e.length/3,i=Math.min(n,20),o=rbt(20),r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=h.fromElements(r,r,r,nbt),c=h.fromElements(s,s,s,ibt);for(let u=0;u<i;++u){let m=Math.floor(o[u]*n),p=h.unpack(e,m*3,obt);h.minimumByComponent(a,p,a),h.maximumByComponent(c,p,c)}let d=ce.fromCornerPoints(a,c);return d.radius+=W.EPSILON2,d}function k_e(e,t){let n=Q.fromTypedArray(e);return n===Q.INT||n===Q.UNSIGNED_INT||n===Q.DOUBLE?(Nt("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 abt=new se,cbt=new se,lbt=new Y,D_e=0,X3=1,c7=2,B_e=3,dbt=4,o7=new F,ubt=new F;function mbt(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,g=e._isOctEncoded16P,f=e._isOctEncodedDraco,x=e._quantizedRange,_=e._octEncodedRange,C=e._isRGB565,V=e._isTranslucent,L=e._hasColors,Z=e._hasNormals,E=e._hasBatchIds,X,v,P=[],A={};if(e._styleableShaderAttributes=A,u){let U=dbt;for(let O in d)if(d.hasOwnProperty(O)){let k=d[O],J=k_e(k.typedArray,O);X=k.componentCount,v=Q.fromTypedArray(J);let H=yt.createVertexBuffer({context:n,typedArray:J,usage:Me.STATIC_DRAW});e._geometryByteLength+=H.sizeInBytes;let te={index:U,vertexBuffer:H,componentsPerAttribute:X,componentDatatype:v,normalize:!1,offsetInBytes:0,strideInBytes:0};P.push(te),A[O]={location:U,componentCount:X},++U}}let M=yt.createVertexBuffer({context:n,typedArray:r.typedArray,usage:Me.STATIC_DRAW});e._geometryByteLength+=M.sizeInBytes;let b;L&&(b=yt.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=b.sizeInBytes);let R;Z&&(R=yt.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=R.sizeInBytes);let G;E&&(c.typedArray=k_e(c.typedArray,"batchIds"),G=yt.createVertexBuffer({context:n,typedArray:c.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=G.sizeInBytes);let I=[];if(m?v=Q.UNSIGNED_SHORT:p?v=x<=255?Q.UNSIGNED_BYTE:Q.UNSIGNED_SHORT:v=Q.FLOAT,I.push({index:D_e,vertexBuffer:M,componentsPerAttribute:3,componentDatatype:v,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(m||p?e._boundingSphere=ce.fromCornerPoints(h.ZERO,e._quantizedVolumeScale):e._boundingSphere=sbt(r.typedArray)),L)if(C)I.push({index:X3,vertexBuffer:b,componentsPerAttribute:1,componentDatatype:Q.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let U=V?4:3;I.push({index:X3,vertexBuffer:b,componentsPerAttribute:U,componentDatatype:Q.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}Z&&(g?(X=2,v=Q.UNSIGNED_BYTE):f?(X=2,v=_<=255?Q.UNSIGNED_BYTE:Q.UNSIGNED_SHORT):(X=3,v=Q.FLOAT),I.push({index:c7,vertexBuffer:R,componentsPerAttribute:X,componentDatatype:v,normalize:!1,offsetInBytes:0,strideInBytes:0})),E&&I.push({index:B_e,vertexBuffer:G,componentsPerAttribute:1,componentDatatype:Q.fromTypedArray(c.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),u&&(I=I.concat(P));let w=new mi({context:n,attributes:I}),N={depthTest:{enabled:!0}},B={depthTest:{enabled:!0},depthMask:!1,blending:un.ALPHA_BLEND};e._opaquePass===Re.CESIUM_3D_TILE&&(N.stencilTest=Bt.setCesium3DTileBit(),N.stencilMask=Bt.CESIUM_3D_TILE_MASK,B.stencilTest=Bt.setCesium3DTileBit(),B.stencilMask=Bt.CESIUM_3D_TILE_MASK),e._opaqueRenderState=Ue.fromCache(N),e._translucentRenderState=Ue.fromCache(B),e._drawCommand=new tt({boundingVolume:new ce,cull:e._cull,modelMatrix:new F,primitiveType:Fe.POINTS,vertexArray:w,count:o,shaderProgram:void 0,uniformMap:void 0,renderState:V?e._translucentRenderState:e._opaqueRenderState,pass:V?Re.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function hbt(e,t){let n=t.context,i=e._isQuantized,o=e._isQuantizedDraco,r=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=abt;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===oe.SCENE2D||c instanceof sn?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 Y.TRANSPARENT;let c=Y.clone(a.edgeColor,lbt);return c.alpha=a.edgeWidth,c},u_clippingPlanesMatrix:function(){let a=e.clippingPlanes;if(!l(a))return F.IDENTITY;let c=y(e.clippingPlanesOriginMatrix,e._modelMatrix);F.multiply(n.uniformState.view3D,c,o7);let d=F.multiply(o7,a.modelMatrix,o7);return F.inverseTranspose(d,ubt)}};pL.addUniforms(e,s),(i||o||r)&&(s=_t(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=cbt;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 r7(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 s7(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 a7(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 fbt={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 pbt(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,g=e._isTranslucent,f=e._hasColors,x=e._hasNormals,_=e._hasBatchIds,C=e._backFaceCulling,V=e._normalShading,L=e._drawCommand.vertexArray,Z=e.clippingPlanes,E=e._attenuation,X,v,P,A=g,M=Ye(fbt),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 le={translucent:!1},ge="(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)";X=n.getColorShaderFunction(`getColorFromStyle${ge}`,M,le),v=n.getShowShaderFunction(`getShowFromStyle${ge}`,M,le),P=n.getPointSizeShaderFunction(`getPointSizeFromStyle${ge}`,M,le),l(X)&&le.translucent&&(A=!0)}e._styleTranslucent=A;let G=l(X),I=l(v),w=l(P),N=e.isClipped,B=[],U=[];G&&(r7(X,B),s7(X,U)),I&&(r7(v,B),s7(v,U)),w&&(r7(P,B),s7(P,U));let O=U.indexOf("COLOR")>=0,k=U.indexOf("NORMAL")>=0;if(k&&!x)throw new ue("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 le=B.indexOf(r.location)>=0,ge=a7(L,r.location);ge.enabled=le}let J=f&&(!G||O);if(f){let le=a7(L,X3);le.enabled=J}let H=x&&(V||C||k);if(x){let le=a7(L,c7);le.enabled=H}let te={a_position:D_e};J&&(te.a_color=X3),H&&(te.a_normal=c7),_&&(te.a_batchId=B_e);let z="",j=B.length;for(i=0;i<j;++i){let le=B[i];r=b[le];let ge=r.componentCount,Se=`czm_3dtiles_property_${le}`,Ie;ge===1?Ie="float":Ie=`vec${ge}`,z+=`in ${Ie} ${Se}; 
`,te[Se]=r.location}hbt(e,t);let ee=`in vec3 a_position; 
out vec4 v_color; 
uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier; 
uniform vec4 u_constantColor; 
uniform vec4 u_highlightColor; 
`;ee+=`float u_pointSize; 
float tiles3d_tileset_time; 
`,E&&(ee+=`float u_geometricError; 
float u_depthMultiplier; 
`),ee+=z,J&&(g?ee+=`in vec4 a_color; 
`:p?ee+=`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; 
`:ee+=`in vec3 a_color; 
`),H&&(u||m?ee+=`in vec2 a_normal; 
`:ee+=`in vec3 a_normal; 
`),_&&(ee+=`in float a_batchId; 
`),(c||d||m)&&(ee+=`uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange; 
`),G&&(ee+=X),I&&(ee+=v),w&&(ee+=P),ee+=`void main() 
{ 
    u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x; 
    tiles3d_tileset_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y; 
`,E&&(ee+=`    u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z; 
    u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w; 
`),J?g?ee+=`    vec4 color = a_color; 
`:p?ee+=`    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); 
`:ee+=`    vec4 color = vec4(a_color, 1.0); 
`:ee+=`    vec4 color = u_constantColor; 
`,c||d?ee+=`    vec3 position = a_position * u_quantizedVolumeScaleAndOctEncodedRange.xyz; 
`:ee+=`    vec3 position = a_position; 
`,ee+=`    vec3 position_absolute = vec3(czm_model * vec4(position, 1.0)); 
`,H?(u?ee+=`    vec3 normal = czm_octDecode(a_normal); 
`:m?ee+=`    vec3 normal = czm_octDecode(a_normal, u_quantizedVolumeScaleAndOctEncodedRange.w).zxy; 
`:ee+=`    vec3 normal = a_normal; 
`,ee+=`    vec3 normalEC = czm_normal * normal; 
`):ee+=`    vec3 normal = vec3(1.0); 
`,G&&(ee+=`    color = getColorFromStyle(position, position_absolute, color, normal); 
`),I&&(ee+=`    float show = float(getShowFromStyle(position, position_absolute, color, normal)); 
`),w?ee+=`    gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal) * czm_pixelRatio; 
`:E?ee+=`    vec4 positionEC = czm_modelView * vec4(position, 1.0); 
    float depth = -positionEC.z; 
    gl_PointSize = min((u_geometricError / depth) * u_depthMultiplier, u_pointSize); 
`:ee+=`    gl_PointSize = u_pointSize; 
`,ee+=`    color = color * u_highlightColor; 
`,H&&V&&(ee+=`    float diffuseStrength = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC); 
    diffuseStrength = max(diffuseStrength, 0.4); 
    color.xyz *= diffuseStrength * czm_lightColor; 
`),ee+=`    v_color = color; 
    gl_Position = czm_modelViewProjection * vec4(position, 1.0); 
`,H&&C&&(ee+=`    float visible = step(-normalEC.z, 0.0); 
    gl_Position *= visible; 
    gl_PointSize *= visible; 
`),I&&(ee+=`    gl_Position.w *= float(show); 
    gl_PointSize *= float(show); 
`),ee+=`} 
`;let fe=`in vec4 v_color; 
`;N&&(fe+=`uniform highp sampler2D u_clippingPlanes; 
uniform mat4 u_clippingPlanesMatrix; 
uniform vec4 u_clippingPlanesEdgeStyle; 
`,fe+=`
`,fe+=$0(Z,s),fe+=`
`),fe+=`void main() 
{ 
    out_FragColor = czm_gammaCorrect(v_color); 
`,N&&(fe+=l9("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),fe+=`} 
`,e.splitDirection!==Gr.NONE&&(fe=pL.modifyFragmentShader(fe)),l(e._vertexShaderLoaded)&&(ee=e._vertexShaderLoaded(ee)),l(e._fragmentShaderLoaded)&&(fe=e._fragmentShaderLoaded(fe));let _e=e._drawCommand;l(_e.shaderProgram)&&_e.shaderProgram.destroy(),_e.shaderProgram=rn.fromCache({context:s,vertexShaderSource:ee,fragmentShaderSource:fe,attributeLocations:te});try{_e.shaderProgram._bind()}catch{throw new ue("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function bbt(e,t){if(e._decodingState===JT.READY)return!1;if(e._decodingState===JT.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,o=Up.decodePointCloud(i,t);l(o)&&(e._decodingState=JT.DECODING,o.then(function(r){e._decodingState=JT.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 g=n.styleableProperties,f=i.batchTableProperties;for(let _ in f)if(f.hasOwnProperty(_)){let C=r[_];l(g)||(g={}),g[_]={typedArray:C.array,componentCount:C.data.componentsPerAttribute}}l(s)&&(n.positions={typedArray:s});let x=y(c,a);l(x)&&(n.colors={typedArray:x}),l(d)&&(n.normals={typedArray:d}),l(u)&&(n.batchIds={typedArray:u}),n.styleableProperties=g}).catch(function(r){e._decodingState=JT.FAILED,e._error=r}))}return!0}var gbt=new se,ybt=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(bbt(this,t))return;let i=!1,o=!F.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,o=!0),l(this._drawCommand)||(mbt(this,e),o=!0,i=!0,this._ready=!0,this._parsedContent=void 0),o){F.clone(this.modelMatrix,this._modelMatrix);let d=this._drawCommand.modelMatrix;if(F.clone(this._modelMatrix,d),l(this._rtcCenter)&&F.multiplyByTranslation(d,this._rtcCenter,d),l(this._quantizedVolumeOffset)&&F.multiplyByTranslation(d,this._quantizedVolumeOffset,d),e.mode!==oe.SCENE3D){let m=e.mapProjection,p=F.getColumn(d,3,gbt);se.equals(p,se.UNIT_W)||wt.basisTo2D(m,d,d)}let u=this._drawCommand.boundingVolume;if(ce.clone(this._boundingSphere,u),this._cull){let m=u.center;F.multiplyByPoint(d,m,m);let p=F.getScale(d,ybt);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!==Gr.NONE;this._splittingEnabled!==r&&(this._splittingEnabled=r,i=!0),i&&pbt(this,e,this._style),this._drawCommand.castShadows=_n.castShadows(this.shadows),this._drawCommand.receiveShadows=_n.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?Re.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()),me(this)};var u9=d9;var ZHi=T(S(),1);var sHi=T(S(),1),xbt={NEAREST:0,LINEAR:1},Qd=xbt;function QT(e){e=y(e,y.EMPTY_OBJECT);let t=e.fragmentShader,n=y(e.textureScale,1),i=y(e.pixelFormat,at.RGBA);this._fragmentShader=t,this._uniforms=e.uniforms,this._textureScale=n,this._forcePowerOfTwo=y(e.forcePowerOfTwo,!1),this._sampleMode=y(e.sampleMode,Qd.NEAREST),this._pixelFormat=i,this._pixelDatatype=y(e.pixelDatatype,nt.UNSIGNED_BYTE),this._clearColor=y(e.clearColor,Y.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 $a;o.scissorTest={enabled:!0,rectangle:l(e.scissorRectangle)?Ke.clone(e.scissorRectangle):new Ke},this._passState=o,this._ready=!1;let r=e.name;l(r)||(r=Bn()),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(QT.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 _bt=/uniform\s+sampler2D\s+depthTexture/g;QT.prototype._isSupported=function(e){return!_bt.test(this._fragmentShader)||e.depthTexture};function Tbt(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 Ft&&!l(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(a),delete s[n],delete s[`${n}Dimensions`]),r instanceof Ft&&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 Sbt(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function Cbt(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function Vbt(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]=Sbt(e,r),n[r]=Tbt(e,i,r)):(t[r]=i[r],n[r]=i[r]),o[r]=i[r];let s=t[r]();(typeof s=="string"||s instanceof Ft||s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement)&&(t[`${r}Dimensions`]=Cbt(t,r))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=_t(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 Lbt(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 Rbt(e){let t=e._sampleMode,n,i;t===Qd.LINEAR?(n=qt.LINEAR,i=ui.LINEAR):(n=qt.NEAREST,i=ui.NEAREST);let o=e._sampler;(!l(o)||o.minificationFilter!==n||o.magnificationFilter!==i)&&(e._sampler=new $t({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function Zbt(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function Gbt(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function Ebt(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 Ft({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]=Gbt(e,m);else if(typeof m=="string"){let g=new Ee({url:m});u.push(g.fetchImage().then(Zbt(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 Y_e(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 Ft&&(l(t.getStageByName(n[o]))||i[o].destroy(),e._dirtyUniforms.push(o))}function Xbt(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 Ibt(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 Ft({context:t,pixelFormat:at.RGBA,pixelDatatype:nt.UNSIGNED_BYTE,source:{arrayBufferView:u,width:1,height:1},sampler:$t.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]=Y.floatToByte(a.red),d[c+1]=Y.floatToByte(a.green),d[c+2]=Y.floatToByte(a.blue),d[c+3]=Y.floatToByte(a.alpha),c+=4}else l(o.pickId)&&(a=o.pickId.color,d[c]=Y.floatToByte(a.red),d[c+1]=Y.floatToByte(a.green),d[c+2]=Y.floatToByte(a.blue),d[c+3]=Y.floatToByte(a.alpha),c+=4);e._selectedIdTexture=new Ft({context:t,pixelFormat:at.RGBA,pixelDatatype:nt.UNSIGNED_BYTE,source:{arrayBufferView:d,width:r,height:1},sampler:$t.NEAREST})}QT.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&Y_e(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=Xbt(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,Ibt(this,e),Vbt(this),Ebt(this,e),Lbt(this,e),Rbt(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=Ue.fromCache({viewport:new Ke(0,0,i.width,i.height)}))),this._command.renderState=o};QT.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,$t.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)};QT.prototype.isDestroyed=function(){return!1};QT.prototype.destroy=function(){return Y_e(this),me(this)};var co=QT;var _Ki=T(S(),1);var Kzi=T(S(),1);var EHi=T(S(),1),m9=`uniform sampler2D colorTexture;

in vec2 v_textureCoordinates;

#ifdef AUTO_EXPOSURE
uniform sampler2D autoExposure;
#else
uniform float exposure;
#endif

void main()
{
    vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);
    vec3 color = fragmentColor.rgb;

#ifdef AUTO_EXPOSURE
    color /= texture(autoExposure, vec2(0.5)).r;
#else
    color *= vec3(exposure);
#endif
    color = czm_acesTonemapping(color);
    color = czm_inverseGamma(color);

    out_FragColor = vec4(color, fragmentColor.a);
}
`;var IHi=T(S(),1),h9=`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 PHi=T(S(),1),f9=`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 wHi=T(S(),1),p9=`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 AHi=T(S(),1),b9=`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 NHi=T(S(),1),g9=`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 UHi=T(S(),1),y9=`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 BHi=T(S(),1),x9=`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 OHi=T(S(),1),_9=`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 zHi=T(S(),1),T9=`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 JHi=T(S(),1),S9=`uniform sampler2D colorTexture;

in vec2 v_textureCoordinates;

#ifdef AUTO_EXPOSURE
uniform sampler2D autoExposure;
#else
uniform float exposure;
#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;
#else
    color *= vec3(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 jHi=T(S(),1),C9=`uniform sampler2D colorTexture;

in vec2 v_textureCoordinates;

#ifdef AUTO_EXPOSURE
uniform sampler2D autoExposure;
#else
uniform float exposure;
#endif

void main()
{
    vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);
    vec3 color = fragmentColor.rgb;

#ifdef AUTO_EXPOSURE
    color /= texture(autoExposure, vec2(0.5)).r;
#else
    color *= vec3(exposure);
#endif
    color = czm_pbrNeutralTonemapping(color);
    color = czm_inverseGamma(color);

    out_FragColor = vec4(color, fragmentColor.a);
}
`;var $Hi=T(S(),1),V9=`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 tzi=T(S(),1),Iy=`#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 izi=T(S(),1),L9=`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 rzi=T(S(),1),R9=`uniform sampler2D colorTexture;
uniform vec3 white;

in vec2 v_textureCoordinates;

#ifdef AUTO_EXPOSURE
uniform sampler2D autoExposure;
#else
uniform float exposure;
#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;
#else
    color *= vec3(exposure);
#endif
    color = (color * (1.0 + color / white)) / (1.0 + color);
    color = czm_inverseGamma(color);
    out_FragColor = vec4(color, fragmentColor.a);
}
`;var azi=T(S(),1),Z9=`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 lzi=T(S(),1),G9=`uniform sampler2D colorTexture;

in vec2 v_textureCoordinates;

#ifdef AUTO_EXPOSURE
uniform sampler2D autoExposure;
#else
uniform float exposure;
#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;
#else
    color *= vec3(exposure);
#endif
    color = color / (1.0 + color);
    color = czm_inverseGamma(color);
    out_FragColor = vec4(color, fragmentColor.a);
}
`;var uzi=T(S(),1),E9=`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 gzi=T(S(),1);function jT(e){e=y(e,y.EMPTY_OBJECT),this._stages=e.stages,this._inputPreviousStageTexture=y(e.inputPreviousStageTexture,!0);let t=e.name;l(t)||(t=Bn()),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(jT.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}}});jT.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};jT.prototype.get=function(e){return this._stages[e]};function Wbt(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}jT.prototype.update=function(e,t){this._selectedDirty=Wbt(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)}};jT.prototype.isDestroyed=function(){return!1};jT.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return me(this)};var rl=jT;var Tr={};function I3(e){let o=`#define USE_STEP_SIZE
${Iy}`,r=new co({name:`${e}_x_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:Qd.LINEAR}),s=new co({name:`${e}_y_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:Qd.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 rl({name:e,stages:[r,s],uniforms:a})}Tr.createBlurStage=function(){return I3("czm_blur")};Tr.createDepthOfFieldStage=function(){let e=I3("czm_depth_of_field_blur"),t=new co({name:"czm_depth_of_field_composite",fragmentShader:x9,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 rl({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Tr.isDepthOfFieldSupported=function(e){return e.context.depthTexture};Tr.createEdgeDetectionStage=function(){let e=Bn();return new co({name:`czm_edge_detection_${e}`,fragmentShader:T9,uniforms:{length:.25,color:Y.clone(Y.BLACK)}})};Tr.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function Pbt(e){if(!l(e))return Tr.createEdgeDetectionStage();let t=new rl({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 co({name:"czm_edge_detection_combine",fragmentShader:r,uniforms:n});return new rl({name:"czm_edge_detection_composite",stages:[t,s]})}Tr.createSilhouetteStage=function(e){let t=Pbt(e),n=new co({name:"czm_silhouette_color_edges",fragmentShader:E9,uniforms:{silhouetteTexture:t.name}});return new rl({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};Tr.isSilhouetteSupported=function(e){return e.context.depthTexture};Tr.createBloomStage=function(){let e=new co({name:"czm_bloom_contrast_bias",fragmentShader:y9,uniforms:{contrast:128,brightness:-.3}}),t=I3("czm_bloom_blur"),n=new rl({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new co({name:"czm_bloom_generate_composite",fragmentShader:b9,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 rl({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};Tr.createAmbientOcclusionStage=function(){let e=new co({name:"czm_ambient_occlusion_generate",fragmentShader:h9,uniforms:{intensity:3,bias:.1,lengthCap:.26,stepSize:1.95,frustumLength:1e3,randomTexture:void 0}}),t=I3("czm_ambient_occlusion_blur");t.uniforms.stepSize=.86;let n=new rl({name:"czm_ambient_occlusion_generate_blur",stages:[e,t]}),i=new co({name:"czm_ambient_occlusion_composite",fragmentShader:f9,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 rl({name:"czm_ambient_occlusion",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};Tr.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var vbt=`#define FXAA_QUALITY_PRESET 39 
${Cw}
${V9}`;Tr.createFXAAStage=function(){return new co({name:"czm_FXAA",fragmentShader:vbt,sampleMode:Qd.LINEAR})};Tr.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=m9,new co({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Tr.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=S9,new co({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Tr.createPbrNeutralTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=C9,new co({name:"czm_pbr_neutral",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Tr.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=G9,new co({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Tr.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=R9,new co({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:Y.WHITE,autoExposure:void 0,exposure:1}})};Tr.createAutoExposureStage=function(){return new Nw};Tr.createBlackAndWhiteStage=function(){return new co({name:"czm_black_and_white",fragmentShader:p9,uniforms:{gradations:5}})};Tr.createBrightnessStage=function(){return new co({name:"czm_brightness",fragmentShader:g9,uniforms:{brightness:.5}})};Tr.createNightVisionStage=function(){return new co({name:"czm_night_vision",fragmentShader:Z9})};Tr.createDepthViewStage=function(){return new co({name:"czm_depth_view",fragmentShader:_9})};Tr.createLensFlareStage=function(){return new co({name:"czm_lens_flare",fragmentShader:L9,uniforms:{dirtTexture:nn("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:nn("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:ne.WGS84.maximumRadius}})};var jd=Tr;var nKi=T(S(),1);function ub(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function I9(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function l7(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[I9(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[I9(m)]=!0)}}}return i.name}function X9(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=X9(e,t,n,p,o):a=l7(e,t,n,p,o),s&&(o=a)}let d,u;if(s)for(d=1;d<c;++d)u=I9(i.get(d)),l(n[u])||(n[u]={}),n[u][r]=!0;else for(d=1;d<c;++d){u=I9(i.get(d));let m=n[u];for(let p=0;p<d;++p)m[I9(i.get(p))]=!0}return a}function wbt(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,o=e.bloom,r=e._tonemapping,s=e.fxaa,a=X9(e,t,n,i,void 0);a=X9(e,t,n,o,a),a=l7(e,t,n,r,a),a=X9(e,t,n,e,a),l7(e,t,n,s,a)}else X9(e,t,n,e,void 0);return n}function Fbt(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,g=p.length;for(u=0;u<g;++u){if(m=p[u],r!==m.textureScale||s!==m.forcePowerOfTwo||a!==m.pixelFormat||c!==m.pixelDatatype||!Y.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<g?(m.stages.push(t),m):(m={textureScale:r,forcePowerOfTwo:s,pixelFormat:a,pixelDatatype:c,clearColor:d,stages:[t],buffer:new hi({pixelFormat:a,pixelDatatype:c}),clear:void 0},p.push(m),m)}function Abt(e,t){let n=wbt(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=Fbt(e,i,n[i]))}function d7(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function Mbt(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 ei({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}ub.prototype.updateDependencies=function(){this._updateDependencies=!0};ub.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)&&(d7(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&Abt(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,d7(this),Mbt(this,e))};ub.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};ub.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};ub.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};ub.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};ub.prototype.isDestroyed=function(){return!1};ub.prototype.destroy=function(){return d7(this),me(this)};var qT=ub;var oKi=T(S(),1),Nbt={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};var mb=Object.freeze(Nbt);var u7=[];function sl(){let e=jd.createFXAAStage(),t=jd.createAmbientOcclusionStage(),n=jd.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=jd.createAutoExposureStage(),this._exposure=1,this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=mb.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let o=new qT(this),r={},s=u7;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(sl.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 m7(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 mb.REINHARD:n=jd.createReinhardTonemappingStage(t);break;case mb.MODIFIED_REINHARD:n=jd.createModifiedReinhardTonemappingStage(t);break;case mb.FILMIC:n=jd.createFilmicTonemappingStage(t);break;case mb.PBR_NEUTRAL:n=jd.createPbrNeutralTonemappingStage(t);break;default:n=jd.createAcesTonemappingStage(t);break}if(t){let i=this._autoExposure;n.uniforms.autoExposure=function(){return i.outputTexture}}else n.uniforms.exposure=this._exposure;this._tonemapper=e,this._tonemapping=n,l(this._stageNames)&&(this._stageNames[n.name]=n,n._textureCache=this._textureCache),this._textureCacheDirty=!0}},exposure:{get:function(){return this._exposure},set:function(e){this._tonemapping.uniforms.exposure=e,this._exposure=e}}});function m7(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}sl.prototype.add=function(e){let t=this._stageNames,n=u7;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};sl.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=u7;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};sl.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};sl.prototype.get=function(e){return m7(this),this._stages[e]};sl.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};sl.prototype.getStageByName=function(e){return this._stageNames[e]};sl.prototype.update=function(e,t,n){m7(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,g=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 Ft({context:e,pixelFormat:at.RGB,pixelDatatype:nt.UNSIGNED_BYTE,source:{arrayBufferView:Z,width:256,height:256},sampler:new $t({wrapS:Cn.REPEAT,wrapT:Cn.REPEAT,minificationFilter:qt.NEAREST,magnificationFilter:ui.NEAREST})})}for(this._textureCache.update(e),x.update(e,t),m.update(e,t),p.update(e,t),f.update(e,t),this._autoExposureEnabled&&g.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)};sl.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function $T(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}sl.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return $T(t)};function qf(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(qf(e.get(0),t,n,i,o),s=1;s<r;++s)qf(e.get(s),t,$T(e.get(s-1)),i,o);else for(s=0;s<r;++s)qf(e.get(s),t,n,i,o)}sl.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),g=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&&(qf(a,e,_,n,i),_=$T(a)),p&&c.ready&&(qf(c,e,_,n,i),_=$T(c)),g&&d.ready&&qf(d,e,_,n,i),f&&u.ready&&(qf(u,e,_,n,i),_=$T(u));let C=_;if(r>0){qf(o[0],e,_,n,i);for(let V=1;V<r;++V)qf(o[V],e,$T(o[V-1]),n,i);C=$T(o[r-1])}x&&s.ready&&qf(s,e,C,n,i)};sl.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Ql,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};sl.prototype.isDestroyed=function(){return!1};sl.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(),me(this)};var W9=sl;var CKi=T(S(),1);function qd(){pe.throwInstantiationError()}qd.computeDefaultLevelZeroMaximumGeometricError=function(e){return e.ellipsoid.maximumRadius*2*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))};Object.defineProperties(qd.prototype,{quadtree:{get:pe.throwInstantiationError,set:pe.throwInstantiationError},tilingScheme:{get:pe.throwInstantiationError},errorEvent:{get:pe.throwInstantiationError}});qd.prototype.update=pe.throwInstantiationError;qd.prototype.beginUpdate=pe.throwInstantiationError;qd.prototype.endUpdate=pe.throwInstantiationError;qd.prototype.getLevelMaximumGeometricError=pe.throwInstantiationError;qd.prototype.loadTile=pe.throwInstantiationError;qd.prototype.computeTileVisibility=pe.throwInstantiationError;qd.prototype.showTileThisFrame=pe.throwInstantiationError;qd.prototype.computeDistanceToTile=pe.throwInstantiationError;qd.prototype.isDestroyed=pe.throwInstantiationError;qd.prototype.destroy=pe.throwInstantiationError;var h7=qd;var f7i=T(S(),1);var UKi=T(S(),1);function eS(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}eS.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};eS.prototype.morphTo2D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof sn,!(this._previousMode===oe.SCENE2D||this._previousMode===oe.MORPHING)&&(this._scene.morphStart.raiseEvent(this,this._previousMode,oe.SCENE2D,!0),n._mode=oe.MORPHING,n.camera._setTransform(F.IDENTITY),this._previousMode===oe.COLUMBUS_VIEW?ygt(this,e):Lgt(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var kbt=new h,Ubt=new h,Dbt=new h,Bbt=new h,Ybt=new h,Obt=new h,Hbt=new h,zbt=new he,Kbt=new F,Jbt=new Vi,Qbt=new sn,jbt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};eS.prototype.morphToColumbusView=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,this._previousMode===oe.COLUMBUS_VIEW||this._previousMode===oe.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,oe.COLUMBUS_VIEW,!0),n.camera._setTransform(F.IDENTITY);let i=kbt,o=Ubt,r=Dbt;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===oe.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,Hbt),m=wt.eastNorthUpToFixedFrame(u,t,Kbt);F.inverseTransformation(m,m),n.mapProjection.project(t.cartesianToCartographic(i,zbt),i),F.multiplyByPointAsVector(m,o,o),F.multiplyByPointAsVector(m,r,r)}}let s;this._morphToOrthographic?(s=Qbt,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=Jbt,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=W.toRadians(60));let a=jbt;a.position=i,a.direction=o,a.up=r,a.frustum=s;let c=Zgt(a);P9(this,c),this._previousMode===oe.SCENE2D?Rgt(this,e,a,c):(a.position2D=F.multiplyByPoint(io.TRANSFORM_2D,i,Bbt),a.direction2D=F.multiplyByPointAsVector(io.TRANSFORM_2D,o,Ybt),a.up2D=F.multiplyByPointAsVector(io.TRANSFORM_2D,r,Obt),n._mode=oe.MORPHING,tTe(this,e,a,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var b7={position:new h,direction:new h,up:new h,frustum:void 0},H_e=new Vi;eS.prototype.morphTo3D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,!(this._previousMode===oe.SCENE3D||this._previousMode===oe.MORPHING)){if(this._scene.morphStart.raiseEvent(this,this._previousMode,oe.SCENE3D,!0),n._mode=oe.MORPHING,n.camera._setTransform(F.IDENTITY),this._previousMode===oe.SCENE2D)cgt(this,e,t);else{let i;e>0?(i=b7,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=z_e(this,t);let o,r=n.camera;r.frustum instanceof sn?o=r.frustum.clone():(o=H_e,o.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,o.fov=W.toRadians(60)),i.frustum=o;let s=iTe(i);P9(this,s),p7(this,e,i,s)}e===0&&l(this._completeMorph)&&this._completeMorph()}};eS.prototype.isDestroyed=function(){return!1};eS.prototype.destroy=function(){return W3(this),me(this)};function P9(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new Bd(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,Sn.LEFT_DOWN),e._morphHandler.setInputAction(n,Sn.MIDDLE_DOWN),e._morphHandler.setInputAction(n,Sn.RIGHT_DOWN),e._morphHandler.setInputAction(n,Sn.WHEEL)}}function W3(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 qbt=new he,$bt=new h,egt=new F;function z_e(e,t){let n=e._scene,i=n.camera,o=b7,r=o.position,s=o.direction,a=o.up,c=n.mapProjection.unproject(i.position,qbt);t.cartographicToCartesian(c,r);let d=t.scaleToGeodeticSurface(r,$bt),u=wt.eastNorthUpToFixedFrame(d,t,egt);return F.multiplyByPointAsVector(u,i.direction,s),F.multiplyByPointAsVector(u,i.up,a),o}var tgt=new h,ngt=new h,igt=new h,ogt=new h,rgt=new h,sgt=new h;function p7(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=h.clone(r.position,tgt),a=h.clone(r.direction,ngt),c=h.clone(r.up,igt),d=F.multiplyByPoint(io.TRANSFORM_2D_INVERSE,n.position,ogt),u=F.multiplyByPointAsVector(io.TRANSFORM_2D_INVERSE,n.direction,rgt),m=F.multiplyByPointAsVector(io.TRANSFORM_2D_INVERSE,n.up,sgt);function p(f){rm(s,d,f.time,r.position),rm(a,u,f.time,r.direction),rm(c,m,f.time,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.right,r.right)}let g=o.tweens.add({duration:t,easingFunction:kr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){nTe(e,o,0,1,t,i)}});e._currentTweens.push(g)}var agt=new sn,K_e=new h,J_e=new h,Q_e=new h,g7=new h,j_e=new h,q_e=new h;function cgt(e,t,n){t/=3;let i=e._scene,o=i.camera,r;t>0?(r=b7,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=z_e(e,n));let s;e._morphToOrthographic?(s=agt,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=o.frustum.right-o.frustum.left):(s=H_e,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=W.toRadians(60)),r.frustum=s;let a=iTe(r);P9(e,a);let c;e._morphToOrthographic?c=function(){p7(e,t,r,a)}:c=function(){eTe(e,t,r,function(){p7(e,t,r,a)})},t>0?(i._mode=oe.SCENE2D,o.flyTo({duration:t,destination:h.fromDegrees(0,0,5*n.maximumRadius,n,g7),complete:function(){i._mode=oe.MORPHING,c()}})):c()}function rm(e,t,n,i){return h.lerp(e,t,n,i)}function $_e(e,t,n,i,o){let r=e._scene,s=r.camera;if(s.frustum instanceof sn)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 g=d/Math.tan(s.frustum.fov*.5);i(s,g)}let m=r.tweens.add({duration:t,easingFunction:kr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:u,complete:function(){s.frustum=n.frustum.clone(),o(e)}});e._currentTweens.push(m)}var lgt=new h,dgt=new h,ugt=new h,f7=new h,mgt=new h,hgt=new h,fgt=new Zr,pgt=new pn,bgt=new h,ggt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function ygt(e,t){t*=.5;let n=e._scene,i=n.camera,o=h.clone(i.position,lgt),r=h.clone(i.direction,dgt),s=h.clone(i.up,ugt),a=h.negate(h.UNIT_Z,mgt),c=h.clone(h.UNIT_Y,hgt),d=f7;if(t>0)h.clone(h.ZERO,f7),d.z=5*n.ellipsoid.maximumRadius;else{h.clone(o,f7);let _=pgt;F.multiplyByPoint(io.TRANSFORM_2D,o,_.origin),F.multiplyByPointAsVector(io.TRANSFORM_2D,r,_.direction);let C=n.globe;if(l(C)){let V=C.pickWorldCoordinates(_,n,!0,bgt);l(V)&&(F.multiplyByPoint(io.TRANSFORM_2D_INVERSE,V,d),d.z+=h.distance(o,d))}}let u=fgt;u.right=d.z*.5,u.left=-u.right,u.top=u.right*(n.drawingBufferHeight/n.drawingBufferWidth),u.bottom=-u.top;let m=ggt;m.position=d,m.direction=a,m.up=c,m.frustum=u;let p=oTe(m);P9(e,p);function g(_){rm(o,d,_.time,i.position),rm(r,a,_.time,i.direction),rm(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:kr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){$_e(e,t,m,f,p)}});e._currentTweens.push(x)}var O_e=new he,xgt={position:new h,direction:new h,up:new h,position2D:new h,direction2D:new h,up2D:new h,frustum:new Zr},_gt={position:new h,direction:new h,up:new h,frustum:void 0},Tgt=new h,Sgt=new pn,Cgt=new F,Vgt=new h;function Lgt(e,t,n){t*=.5;let i=e._scene,o=i.camera,r=xgt;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,O_e),i.mapProjection.project(O_e,r.position),h.negate(h.UNIT_Z,r.direction),h.clone(h.UNIT_Y,r.up);let m=Sgt;h.clone(r.position2D,m.origin);let p=h.clone(o.directionWC,m.direction),g=n.scaleToGeodeticSurface(o.positionWC,Vgt),f=wt.eastNorthUpToFixedFrame(g,n,Cgt);F.inverseTransformation(f,f),F.multiplyByPointAsVector(f,p,p),F.multiplyByPointAsVector(io.TRANSFORM_2D,p,p);let x=i.globe;if(l(x)){let _=x.pickWorldCoordinates(m,i,!0,Tgt);if(l(_)){let C=h.distance(r.position2D,_);_.x+=C,h.clone(_,r.position2D)}}}function s(m,p){m.position.x=p}F.multiplyByPoint(io.TRANSFORM_2D,r.position,r.position2D),F.multiplyByPointAsVector(io.TRANSFORM_2D,r.direction,r.direction2D),F.multiplyByPointAsVector(io.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=_gt;F.multiplyByPoint(io.TRANSFORM_2D_INVERSE,r.position2D,c.position),h.clone(r.direction,c.direction),h.clone(r.up,c.up),c.frustum=a;let d=oTe(c);P9(e,d);function u(){$_e(e,t,r,s,d)}tTe(e,t,r,u)}function eTe(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:kr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:u,complete:function(){i(e)}});e._currentTweens.push(m)}function Rgt(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=h.clone(n.position,g7),a=h.clone(n.direction,j_e),c=h.clone(n.up,q_e);o._mode=oe.MORPHING;function d(){r.frustum=n.frustum.clone();let u=h.clone(r.position,K_e),m=h.clone(r.direction,J_e),p=h.clone(r.up,Q_e);u.z=s.z;function g(x){rm(u,s,x.time,r.position),rm(m,a,x.time,r.direction),rm(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:kr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){i(e)}});e._currentTweens.push(f)}e._morphToOrthographic?d():eTe(e,0,n,d)}function tTe(e,t,n,i){let o=e._scene,r=o.camera,s=h.clone(r.position,K_e),a=h.clone(r.direction,J_e),c=h.clone(r.up,Q_e),d=h.clone(n.position2D,g7),u=h.clone(n.direction2D,j_e),m=h.clone(n.up2D,q_e);function p(f){rm(s,d,f.time,r.position),rm(a,u,f.time,r.direction),rm(c,m,f.time,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.right,r.right),r._adjustOrthographicFrustum(!0)}let g=o.tweens.add({duration:t,easingFunction:kr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){nTe(e,o,1,0,t,i)}});e._currentTweens.push(g)}function nTe(e,t,n,i,o,r){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:o,easingFunction:kr.QUARTIC_OUT};l(r)&&(s.complete=function(){r(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function iTe(e){return function(t){let n=t._scene;n._mode=oe.SCENE3D,n.morphTime=oe.getMorphTime(oe.SCENE3D),W3(t);let i=n.camera;(t._previousMode!==oe.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,oe.SCENE3D,r)}}function oTe(e){return function(t){let n=t._scene;n._mode=oe.SCENE2D,n.morphTime=oe.getMorphTime(oe.SCENE2D),W3(t);let i=n.camera;h.clone(e.position,i.position),i.position.z=n.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,oe.SCENE2D,o)}}function Zgt(e){return function(t){let n=t._scene;n._mode=oe.COLUMBUS_VIEW,n.morphTime=oe.getMorphTime(oe.COLUMBUS_VIEW),W3(t);let i=n.camera;(t._previousModeMode!==oe.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,oe.COLUMBUS_VIEW,r)}}var v9=eS;var VJi=T(S(),1);var QKi=T(S(),1);function P3(e,t,n,i,o,r,s,a,c,d){this._tweens=e,this._tweenjs=t,this._startObject=Ye(n),this._stopObject=Ye(i),this._duration=o,this._delay=r,this._easingFunction=s,this._update=a,this._complete=c,this.cancel=d,this.needsStart=!0}Object.defineProperties(P3.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}}});P3.prototype.cancelTween=function(){this._tweens.remove(this)};function Ph(){this._tweens=[]}Object.defineProperties(Ph.prototype,{length:{get:function(){return this._tweens.length}}});Ph.prototype.add=function(e){if(e=y(e,y.EMPTY_OBJECT),e.duration===0)return l(e.complete)&&e.complete(),new P3(this);let t=e.duration/zn.SECONDS_PER_MILLISECOND,n=y(e.delay,0),i=n/zn.SECONDS_PER_MILLISECOND,o=y(e.easingFunction,kr.LINEAR_NONE),r=e.startObject,s=new E0e(r);s.to(Ye(e.stopObject),t),s.delay(i),s.easing(o),l(e.update)&&s.onUpdate(function(){e.update(r)}),s.onComplete(y(e.complete,null)),s.repeat(y(e._repeat,0));let a=new P3(this,s,e.startObject,e.stopObject,e.duration,n,o,e.update,e.complete,e.cancel);return this._tweens.push(a),a};Ph.prototype.addProperty=function(e){e=y(e,y.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:y(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:r,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})};Ph.prototype.addAlpha=function(e){e=y(e,y.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:y(e.startValue,0)},stopObject:{alpha:y(e.stopValue,1)},duration:y(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel})};Ph.prototype.addOffsetIncrement=function(e){e=y(e,y.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})};Ph.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};Ph.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};Ph.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};Ph.prototype.get=function(e){return this._tweens[e]};Ph.prototype.update=function(e){let t=this._tweens,n=0;for(e=l(e)?e/zn.SECONDS_PER_MILLISECOND:_i();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 tS=Ph;function F9(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.zoomFactor=5,this.translateEventTypes=Wi.LEFT_DRAG,this.zoomEventTypes=[Wi.RIGHT_DRAG,Wi.WHEEL,Wi.PINCH],this.rotateEventTypes=Wi.LEFT_DRAG,this.tiltEventTypes=[Wi.MIDDLE_DRAG,Wi.PINCH,{eventType:Wi.LEFT_DRAG,modifier:Os.CTRL},{eventType:Wi.RIGHT_DRAG,modifier:Os.CTRL}],this.lookEventTypes={eventType:Wi.LEFT_DRAG,modifier:Os.SHIFT};let t=y(e.ellipsoid,ne.default);this.minimumPickingTerrainHeight=ne.WGS84.equals(t)?15e4:t.minimumRadius*.025,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=ne.WGS84.equals(t)?4e3:t.minimumRadius*63e-5,this.minimumCollisionTerrainHeight=ne.WGS84.equals(t)?15e3:t.minimumRadius*.0025,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=ne.WGS84.equals(t)?75e5:t.minimumRadius*1.175,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this._scene=e,this._globe=void 0,this._ellipsoid=t,this._lastGlobeHeight=0,this._aggregator=new Kw(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 tS,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new D(-1,-1),this._tiltCenter=new h,this._rotateMousePosition=new D(-1,-1),this._rotateStartPosition=new h,this._strafeStartPosition=new h,this._strafeMousePosition=new D,this._strafeEndMousePosition=new D,this._zoomMouseStart=new D(-1,-1),this._zoomWorldPosition=new h,this._useZoomWorldPosition=!1,this._panLastMousePosition=new D,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 n=e.mapProjection;this._maxCoord=n.project(new he(Math.PI,W.PI_OVER_TWO)),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 Ggt(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function Egt(e){return D.equalsEpsilon(e.startPosition,e.endPosition,W.EPSILON14)}var Xgt=.4;function Igt(e,t,n,i,o,r,s){let a=r[s];l(a)||(a=r[s]={startPosition:new D,endPosition:new D,motion:new D,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<Xgt){let g=Ggt(p,i),f=e.getLastMovement(t,n);if(!l(f)||Egt(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=D.clone(f.startPosition,a.startPosition),a.endPosition=D.multiplyByScalar(a.motion,g,a.endPosition),a.endPosition=D.add(a.startPosition,a.endPosition,a.endPosition),isNaN(a.endPosition.x)||isNaN(a.endPosition.y)||D.distance(a.startPosition,a.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let x=e.getStartMousePosition(t,n);o(r,x,a)}}}function Wgt(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 rTe=[];function al(e,t,n,i,o,r){if(!l(n))return;let s=e._aggregator;Array.isArray(n)||(rTe[0]=n,n=rTe);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),g=s.getStartMousePosition(u,m);e.enableInputs&&t&&(p?(i(e,g,p),Wgt(e,r)):o<1&&Igt(s,u,m,o,i,e,r))}}var v3=new pn,Pgt=new h,vgt=new D,wgt=new h,Fgt=new D,Agt=new h,Mgt=new h,Ngt=new h,kgt=new h,gTe=new h,Ugt=new h,Dgt=new h,Bgt=new h,Ygt=new h,Ogt=new h,Hgt=new h,zgt=new h,Kgt=new h,Jgt=new h,Qgt=new h,nS=new h,sTe=new h,aTe=new h,y7={orientation:new _a};function R7(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 g=a/e._scene.canvas.clientHeight;g=Math.min(g,e.maximumMovementRatio);let f=p*g;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=y7.orientation;if(V.heading=_.heading,V.pitch=_.pitch,V.roll=_.roll,_.frustum instanceof sn){Math.abs(f)>0&&(_.zoomIn(f),_._adjustOrthographicFrustum(!0));return}let L=y(n.inertiaEnabled,D.equals(t,e._zoomMouseStart)),Z=e._zoomingOnVector,E=e._rotatingZoom,X;if(L||(e._zoomMouseStart=D.clone(t,e._zoomMouseStart),l(e._globe)&&C===oe.SCENE2D?(X=_.getPickRay(t,v3).origin,X=h.fromElements(X.y,X.z,X.x)):l(e._globe)&&(X=hb(e,t,Pgt)),l(X)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=h.clone(X,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,Z=e._zoomingOnVector=!1,E=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){_.zoomIn(f);return}let v=C===oe.COLUMBUS_VIEW;if(_.positionCartographic.height<2e6&&(E=!0),!L||E){if(C===oe.SCENE2D){let P=e._zoomWorldPosition,A=_.position;if(!h.equals(P,A)&&_.positionCartographic.height<e._maxCoord.x*2){let M=_.position.x,b=h.subtract(P,A,wgt);h.normalize(b,b);let R=h.distance(P,A)*f/(_.getMagnitude()*.5);_.move(b,R*.5),(_.position.x<0&&M>0||_.position.x>0&&M<0)&&(X=_.getPickRay(t,v3).origin,X=h.fromElements(X.y,X.z,X.x),e._zoomWorldPosition=h.clone(X,e._zoomWorldPosition))}}else if(C===oe.SCENE3D){let P=h.normalize(_.position,gTe);if(e._cameraUnderground||e._zoomingUnderground||_.positionCartographic.height<3e3&&Math.abs(h.dot(_.direction,P))<.6)v=!0;else{let A=x.canvas,M=Fgt;M.x=A.clientWidth/2,M.y=A.clientHeight/2;let b=hb(e,M,Agt);if(!l(b))v=!0;else if(_.positionCartographic.height<1e6)if(h.dot(_.direction,P)>=-.5)v=!0;else{let R=Dgt;h.clone(_.position,R);let G=e._zoomWorldPosition,I=Ugt;if(I=h.normalize(G,I),h.dot(I,P)<0)return;let w=Qgt,N=Ogt;h.clone(_.direction,N),h.add(R,h.multiplyByScalar(N,1e3,nS),w);let B=Hgt,U=zgt;h.subtract(G,R,B),h.normalize(B,U);let O=h.dot(P,U);if(O>=0){e._zoomMouseStart.x=-1;return}let k=Math.acos(-O),J=h.magnitude(R),H=h.magnitude(G),te=J-f,z=h.magnitude(B),j=Math.asin(W.clamp(z/H*Math.sin(k),-1,1)),ee=Math.asin(W.clamp(te/H*Math.sin(k),-1,1)),fe=j-ee+k,_e=Bgt;h.normalize(R,_e);let le=Ygt;le=h.cross(U,_e,le),le=h.normalize(le,le),h.normalize(h.cross(_e,le,nS),N),h.multiplyByScalar(h.normalize(w,nS),h.magnitude(w)-f,w),h.normalize(R,R),h.multiplyByScalar(R,te,R);let ge=Kgt;h.multiplyByScalar(h.add(h.multiplyByScalar(_e,Math.cos(fe)-1,sTe),h.multiplyByScalar(N,Math.sin(fe),aTe),nS),te,ge),h.add(R,ge,R),h.normalize(w,_e),h.normalize(h.cross(_e,le,nS),N);let Se=Jgt;h.multiplyByScalar(h.add(h.multiplyByScalar(_e,Math.cos(fe)-1,sTe),h.multiplyByScalar(N,Math.sin(fe),aTe),nS),h.magnitude(w),Se),h.add(w,Se,w),h.clone(R,_.position),h.normalize(h.subtract(w,R,nS),_.direction),h.clone(_.direction,_.direction),h.cross(_.direction,_.up,_.right),h.cross(_.right,_.direction,_.up),_.setView(y7);return}else{let R=h.normalize(b,Mgt),G=h.normalize(e._zoomWorldPosition,Ngt),I=h.dot(G,R);if(I>0&&I<1){let w=W.acosClamped(I),N=h.cross(G,R,kgt),B=Math.abs(w)>W.toRadians(20)?_.positionCartographic.height*.75:_.positionCartographic.height-f,U=f/B;_.rotate(N,w*U)}}}}e._rotatingZoom=!v}if(!L&&v||Z){let P,A=Yi.worldToWindowCoordinates(x,e._zoomWorldPosition,vgt);C!==oe.COLUMBUS_VIEW&&D.equals(t,e._zoomMouseStart)&&l(A)?P=_.getPickRay(A,v3):P=_.getPickRay(t,v3);let M=P.direction;(C===oe.COLUMBUS_VIEW||C===oe.SCENE2D)&&h.fromElements(M.y,M.z,M.x,M),_.move(M,f),e._zoomingOnVector=!0}else _.zoomIn(f);e._cameraUnderground||_.setView(y7)}var jgt=new pn,qgt=new pn,$gt=new h;function eyt(e,t,n){let o=e._scene.camera,r=o.getPickRay(n.startPosition,jgt).origin,s=o.getPickRay(n.endPosition,qgt).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,$gt),c=h.magnitude(a);c>0&&(h.normalize(a,a),o.move(a,c))}function cTe(e,t,n){l(n.distance)&&(n=n.distance);let o=e._scene.camera;R7(e,t,n,e.zoomFactor,o.getMagnitude())}var tyt=new D,nyt=new D;function lTe(e,t,n){if(l(n.angleAndHeight)){iyt(e,t,n.angleAndHeight);return}let i=e._scene,o=i.camera,r=i.canvas,s=r.clientWidth,a=r.clientHeight,c=tyt;c.x=2/s*n.startPosition.x-1,c.y=2/a*(a-n.startPosition.y)-1,c=D.normalize(c,c);let d=nyt;d.x=2/s*n.endPosition.x-1,d.y=2/a*(a-n.endPosition.y)-1,d=D.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 iyt(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 oyt(e){let t=e._scene.mapMode2D===Hl.ROTATE;F.equals(F.IDENTITY,e._scene.camera.transform)?(al(e,e.enableTranslate,e.translateEventTypes,eyt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),al(e,e.enableZoom,e.zoomEventTypes,cTe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&al(e,e.enableRotate,e.tiltEventTypes,lTe,e.inertiaSpin,"_lastInertiaTiltMovement")):(al(e,e.enableZoom,e.zoomEventTypes,cTe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&al(e,e.enableRotate,e.translateEventTypes,lTe,e.inertiaSpin,"_lastInertiaSpinMovement"))}var yTe=new pn,ryt=new h,syt=new h;function hb(e,t,n){let i=e._scene,o=e._globe,r=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,ryt)),!l(o))return h.clone(s,n);let a=!e._cameraUnderground,c=r.getPickRay(t,yTe),d=o.pickWorldCoordinates(c,i,a,syt),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 ayt=new he;function U3(e){let t=e._ellipsoid,n=e._scene,i=n.camera,o=n.mode,r=0;if(o===oe.SCENE3D){let c=t.cartesianToCartographic(i.position,ayt);l(c)&&(r=c.height)}else r=i.position.z;let s=y(e._scene.globeHeight,0);return Math.abs(s-r)}var cyt=new h;function xTe(e,t){let n=t.origin,i=t.direction,o=U3(e),r=h.normalize(n,cyt),s=Math.abs(h.dot(r,i));return s=Math.max(s,.5)*2,o*s}function _Te(e,t,n,i){let o=h.distance(t.origin,n),r=U3(e),s=W.clamp(r*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return o>s&&(o=Math.min(o,r/5),o=Math.max(o,100)),pn.getPoint(t,o,i)}function TTe(e,t,n,i){let o;return l(n)?(o=h.distance(t.origin,n),o>e._maximumUndergroundPickDistance&&(o=U3(e))):o=U3(e),pn.getPoint(t,o,i)}var lyt=new D;function STe(e,t){let n=t.endPosition,i=D.subtract(t.endPosition,t.startPosition,lyt),o=e._strafeEndMousePosition;D.add(o,i,o),t.endPosition=o,Z7(e,t,e._strafeStartPosition),t.endPosition=n}var dTe=new pn,dyt=new pn,x7=new h,uyt=new h,myt=new h,hyt=new h,fyt=new cn(h.UNIT_X,0),pyt=new D,byt=new D;function gyt(e,t,n){if(h.equals(t,e._translateMousePosition)||(e._looking=!1),h.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){eu(e,t,n);return}if(e._strafing){STe(e,n);return}let o=e._scene.camera,r=e._cameraUnderground,s=D.clone(n.startPosition,pyt),a=D.clone(n.endPosition,byt),c=o.getPickRay(s,dTe),d=h.clone(h.ZERO,hyt),u=h.UNIT_X,m;if(o.position.z<e._minimumPickingTerrainHeight&&(m=hb(e,s,x7),l(m)&&(d.x=m.x)),r||d.x>o.position.z&&l(m)){let L=m;r&&(L=TTe(e,c,m,x7)),D.clone(t,e._strafeMousePosition),D.clone(t,e._strafeEndMousePosition),h.clone(L,e._strafeStartPosition),e._strafing=!0,Z7(e,n,e._strafeStartPosition);return}let p=cn.fromPointNormal(d,u,fyt);c=o.getPickRay(s,dTe);let g=qn.rayPlane(c,p,x7),f=o.getPickRay(a,dyt),x=qn.rayPlane(f,p,uyt);if(!l(g)||!l(x)){e._looking=!0,eu(e,t,n),D.clone(t,e._translateMousePosition);return}let _=h.subtract(g,x,myt),C=_.x;_.x=_.y,_.y=_.z,_.z=C;let V=h.magnitude(_);V>W.EPSILON6&&(h.normalize(_,_),o.move(_,V))}var CTe=new D,A3=new pn,M3=new h,yyt=new h,VTe=new F,xyt=new F,_yt=new h,Tyt=new cn(h.UNIT_X,0),_7=new h,C7=new he,LTe=new F,Syt=new we,Cyt=new $,N3=new h;function Vyt(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),D.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){eu(e,t,n);return}let o=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(o.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,Lyt(e,t,n)):Ryt(e,t,n)}function Lyt(e,t,n){let i=e._scene,o=i.camera,r=i.canvas,s=CTe;s.x=r.clientWidth/2,s.y=r.clientHeight/2;let a=o.getPickRay(s,A3),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,eu(e,t,n),D.clone(t,e._tiltCenterMousePosition);return}let g=h.multiplyByScalar(u,m,M3);h.add(d,g,g);let f=i.mapProjection,x=f.ellipsoid;h.fromElements(g.y,g.z,g.x,g);let _=f.unproject(g,C7);x.cartographicToCartesian(_,g);let C=wt.eastNorthUpToFixedFrame(g,x,VTe),V=e._globe,L=e._ellipsoid;e._globe=void 0,e._ellipsoid=ne.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let Z=F.clone(o.transform,LTe);o._setTransform(C),$d(e,t,n,h.UNIT_Z),o._setTransform(Z),e._globe=V,e._ellipsoid=L;let E=L.maximumRadius;e._rotateFactor=1/E,e._rotateRateRangeAdjustment=E}function Ryt(e,t,n){let i=e._scene,o=i.camera,r=e._cameraUnderground,s,a,c=h.UNIT_X;if(D.equals(t,e._tiltCenterMousePosition))s=h.clone(e._tiltCenter,M3);else{if(o.position.z<e._minimumPickingTerrainHeight&&(s=hb(e,t,M3)),!l(s)){a=o.getPickRay(t,A3);let b=a.origin,R=a.direction,G,I=h.dot(c,R);if(Math.abs(I)>W.EPSILON6&&(G=-h.dot(c,b)/I),!l(G)||G<=0){e._looking=!0,eu(e,t,n),D.clone(t,e._tiltCenterMousePosition);return}s=h.multiplyByScalar(R,G,M3),h.add(b,s,s)}r&&(l(a)||(a=o.getPickRay(t,A3)),_Te(e,a,s,s)),D.clone(t,e._tiltCenterMousePosition),h.clone(s,e._tiltCenter)}let d=i.canvas,u=CTe;u.x=d.clientWidth/2,u.y=e._tiltCenterMousePosition.y,a=o.getPickRay(u,A3);let m=h.clone(h.ZERO,_yt);m.x=s.x;let p=cn.fromPointNormal(m,c,Tyt),g=qn.rayPlane(a,p,yyt),f=o._projection,x=f.ellipsoid;h.fromElements(s.y,s.z,s.x,s);let _=f.unproject(s,C7);x.cartographicToCartesian(_,s);let C=wt.eastNorthUpToFixedFrame(s,x,VTe),V;l(g)?(h.fromElements(g.y,g.z,g.x,g),_=f.unproject(g,C7),x.cartographicToCartesian(_,g),V=wt.eastNorthUpToFixedFrame(g,x,xyt)):V=C;let L=e._globe,Z=e._ellipsoid;e._globe=void 0,e._ellipsoid=ne.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let E=h.UNIT_Z,X=F.clone(o.transform,LTe);o._setTransform(C);let v=h.cross(h.UNIT_Z,h.normalize(o.position,_7),_7),P=h.dot(o.right,v);if($d(e,t,n,E,!1,!0),o._setTransform(V),P<0){let b=n.startPosition.y-n.endPosition.y;(r&&b<0||!r&&b>0)&&(E=void 0);let R=o.constrainedAxis;o.constrainedAxis=void 0,$d(e,t,n,E,!0,!1),o.constrainedAxis=R}else $d(e,t,n,E,!0,!1);if(l(o.constrainedAxis)){let b=h.cross(o.direction,o.constrainedAxis,N3);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(X),e._globe=L,e._ellipsoid=Z;let A=Z.maximumRadius;e._rotateFactor=1/A,e._rotateRateRangeAdjustment=A;let M=h.clone(o.positionWC,_7);if(e.enableCollisionDetection&&X7(e,!0),!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),G=h.cross(M,o.position,M);h.normalize(G,G);let I=we.fromAxisAngle(G,R,Syt),w=$.fromQuaternion(I,Cyt);$.multiplyByVector(w,o.direction,o.direction),$.multiplyByVector(w,o.up,o.up),h.cross(o.direction,o.up,o.right),h.cross(o.right,o.direction,o.up),o._setTransform(X)}}var RTe=new D,ZTe=new pn,GTe=new h;function Zyt(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=RTe,a.x=r.clientWidth/2,a.y=r.clientHeight/2);let c=o.getPickRay(a,ZTe),d=c.origin,u=c.direction,m=o.position.z,p;m<e._minimumPickingTerrainHeight&&(p=hb(e,a,GTe));let g;if(l(p)&&(g=h.distance(d,p)),s){let f=xTe(e,c,m);l(g)?g=Math.min(g,f):g=f}if(!l(g)){let f=h.UNIT_X;g=-h.dot(f,d)/h.dot(f,u)}R7(e,t,n,e.zoomFactor,g)}function Gyt(e){let n=e._scene.camera;if(!F.equals(F.IDENTITY,n.transform))al(e,e.enableRotate,e.rotateEventTypes,$d,e.inertiaSpin,"_lastInertiaSpinMovement"),al(e,e.enableZoom,e.zoomEventTypes,XTe,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),al(e,e.enableTilt,e.tiltEventTypes,Vyt,e.inertiaSpin,"_lastInertiaTiltMovement"),al(e,e.enableTranslate,e.translateEventTypes,gyt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),al(e,e.enableZoom,e.zoomEventTypes,Zyt,e.inertiaZoom,"_lastInertiaZoomMovement"),al(e,e.enableLook,e.lookEventTypes,eu),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let o=n.createCorrectPositionTween(e.bounceAnimationTime);l(o)&&(e._tween=i.add(o))}i.update()}}var Eyt=new pn,Xyt=new cn(h.UNIT_X,0),Iyt=new h,Wyt=new h;function Z7(e,t,n){let i=e._scene,o=i.camera,r=o.getPickRay(t.endPosition,Eyt),s=h.clone(o.direction,Wyt);i.mode===oe.COLUMBUS_VIEW&&h.fromElements(s.z,s.x,s.y,s);let a=cn.fromPointNormal(n,s,Xyt),c=qn.rayPlane(r,a,Iyt);l(c)&&(s=h.subtract(n,c,s),i.mode===oe.COLUMBUS_VIEW&&h.fromElements(s.y,s.z,s.x,s),h.add(o.position,s,o.position))}var uTe=new h,ETe=new he,V7=new h,L7=new ne,Pyt=new h,vyt=new h,wyt=new h;function Fyt(e,t,n){let o=e._scene.camera,r=e._cameraUnderground,s=e._ellipsoid;if(!F.equals(o.transform,F.IDENTITY)){$d(e,t,n);return}let a,c,d=s.geodeticSurfaceNormal(o.position,Pyt);if(D.equals(t,e._rotateMousePosition)){if(e._looking)eu(e,t,n,d);else if(e._rotating)$d(e,t,n);else if(e._strafing)STe(e,n);else{if(h.magnitude(o.position)<h.magnitude(e._rotateStartPosition))return;a=h.magnitude(e._rotateStartPosition),c=V7,c.x=c.y=c.z=a,s=ne.fromCartesian3(c,L7),S7(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let u=s.cartesianToCartographic(o.positionWC,ETe).height,m=e._globe;if(l(m)&&u<e._minimumPickingTerrainHeight){let p=hb(e,n.startPosition,wyt);if(l(p)){let g=!1,f=o.getPickRay(n.startPosition,yTe);if(r)g=!0,TTe(e,f,p,p);else{let x=s.geodeticSurfaceNormal(p,vyt);Math.abs(h.dot(f.direction,x))<.05?g=!0:g=h.magnitude(o.position)<h.magnitude(p)}g?(D.clone(t,e._strafeEndMousePosition),h.clone(p,e._strafeStartPosition),e._strafing=!0,Z7(e,n,e._strafeStartPosition)):(a=h.magnitude(p),c=V7,c.x=c.y=c.z=a,s=ne.fromCartesian3(c,L7),S7(e,t,n,s),h.clone(p,e._rotateStartPosition))}else e._looking=!0,eu(e,t,n,d)}else l(o.pickEllipsoid(n.startPosition,e._ellipsoid,uTe))?(S7(e,t,n,e._ellipsoid),h.clone(uTe,e._rotateStartPosition)):u>e._minimumTrackBallHeight?(e._rotating=!0,$d(e,t,n)):(e._looking=!0,eu(e,t,n,d));D.clone(t,e._rotateMousePosition)}function $d(e,t,n,i,o,r){o=y(o,!1),r=y(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,g=(n.startPosition.y-n.endPosition.y)/c.clientHeight;p=Math.min(p,e.maximumMovementRatio),g=Math.min(g,e.maximumMovementRatio);let f=m*p*Math.PI*2,x=m*g*Math.PI;o||a.rotateRight(f),r||a.rotateUp(x),a.constrainedAxis=d}var T7=se.clone(se.UNIT_W),mTe=se.clone(se.UNIT_W),w3=new h,bL=new h,F3=new h,hTe=new h,Ayt=new D,Myt=new D,Nyt=new D,kyt=new D,Uyt=new pn;function S7(e,t,n,i){let o=e._scene,r=o.camera,s=D.clone(n.startPosition,Ayt),a=D.clone(n.endPosition,Myt),c=i.cartesianToCartographic(r.positionWC,ETe).height,d,u;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(d=h.clone(e._panLastWorldPosition,T7),!l(e._globe)&&!D.equalsEpsilon(s,e._panLastMousePosition)&&(d=hb(e,s,T7)),!l(e._globe)&&l(d))){let m=h.subtract(d,r.positionWC,bL),p=h.multiplyByScalar(r.directionWC,h.dot(r.directionWC,m),bL),g=h.magnitude(p),f=r.frustum.getPixelDimensions(o.drawingBufferWidth,o.drawingBufferHeight,g,o.pixelRatio,kyt),x=D.subtract(a,s,Nyt),_=h.multiplyByScalar(r.rightWC,x.x*f.x,bL),C=h.normalize(r.positionWC,gTe),V=r.getPickRay(a,Uyt).direction,L=h.subtract(V,h.projectVector(V,r.rightWC,F3),F3),Z=h.angleBetween(L,r.directionWC),E=1;l(r.frustum.fov)&&(E=Math.max(Math.tan(Z),.1));let X=Math.abs(h.dot(r.directionWC,C)),v=-x.y*f.y*2/Math.sqrt(E)*(1-X),P=h.multiplyByScalar(V,v,F3);X=Math.abs(h.dot(r.upWC,C));let A=h.multiplyByScalar(r.upWC,-x.y*(1-X)*f.y,hTe);u=h.add(d,_,mTe),u=h.add(u,P,u),u=h.add(u,A,u),h.clone(u,e._panLastWorldPosition),D.clone(a,e._panLastMousePosition)}if((!l(d)||!l(u))&&(d=r.pickEllipsoid(s,i,T7),u=r.pickEllipsoid(a,i,mTe)),!l(d)||!l(u)){e._rotating=!0,$d(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,w3);h.cross(p,m,p),h.normalize(p,p);let g=h.cross(m,p,bL),f=h.magnitude(d),x=h.dot(m,d),_=Math.acos(x/f),C=h.multiplyByScalar(m,x,F3);h.subtract(d,C,C),h.normalize(C,C);let V=h.magnitude(u),L=h.dot(m,u),Z=Math.acos(L/V),E=h.multiplyByScalar(m,L,hTe);h.subtract(u,E,E),h.normalize(E,E);let X=Math.acos(h.dot(C,p));h.dot(C,g)<0&&(X=W.TWO_PI-X);let v=Math.acos(h.dot(E,p));h.dot(E,g)<0&&(v=W.TWO_PI-v);let P=X-v,A;h.equalsEpsilon(m,r.position,W.EPSILON2)?A=r.right:A=h.cross(m,r.position,w3);let M=h.cross(m,A,w3),b=h.dot(M,h.subtract(d,m,bL)),R=h.dot(M,h.subtract(u,m,bL)),G;b>0&&R>0?G=Z-_:b>0&&R<=0?h.dot(r.position,m)>0?G=-_-Z:G=_+Z:G=_-Z,r.rotateRight(P),r.rotateUp(G)}else{h.normalize(d,d),h.normalize(u,u);let m=h.dot(d,u),p=h.cross(d,u,w3);if(m<1&&!h.equalsEpsilon(p,h.ZERO,W.EPSILON14)){let g=Math.acos(m);r.rotate(p,g)}}}var Dyt=new h,Byt=new he,fTe=0;function XTe(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=RTe,d.x=a.clientWidth/2,d.y=a.clientHeight/2);let u=s.getPickRay(d,ZTe),m,p=o.cartesianToCartographic(s.position,Byt).height,g=Math.abs(fTe)<e.minimumPickingTerrainDistanceWithInertia;(i?g:p<e._minimumPickingTerrainHeight)&&(m=hb(e,d,GTe));let x;if(l(m)&&(x=h.distance(u.origin,m),fTe=x),c){let C=xTe(e,u,p);l(x)?x=Math.min(x,C):x=C}l(x)||(x=p);let _=h.normalize(s.position,Dyt);R7(e,t,n,e.zoomFactor,x,h.dot(_,s.direction))}var ITe=new D,k3=new pn,w9=new h,Yyt=new h,WTe=new F,Oyt=new F,PTe=new F,Hyt=new we,zyt=new $,G7=new he,E7=new h;function Kyt(e,t,n){let o=e._scene.camera;if(!F.equals(o.transform,F.IDENTITY))return;if(l(n.angleAndHeight)&&(n=n.angleAndHeight),D.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let a=e._ellipsoid.geodeticSurfaceNormal(o.position,E7);eu(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(o.position,G7);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,Qyt(e,t,n)):jyt(e,t,n)}var Jyt=new he;function Qyt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(r.positionWC,Jyt).height;if(a-s-1<W.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=o.canvas,d=ITe;d.x=c.clientWidth/2,d.y=c.clientHeight/2;let u=r.getPickRay(d,k3),m,p=qn.rayEllipsoid(u,i);if(l(p))m=pn.getPoint(u,p.start,w9);else if(a>e._minimumTrackBallHeight){let V=qn.grazingAltitudeLocation(u,i);if(!l(V))return;let L=i.cartesianToCartographic(V,G7);L.height=0,m=i.cartographicToCartesian(L,w9)}else{e._looking=!0;let V=e._ellipsoid.geodeticSurfaceNormal(r.position,E7);eu(e,t,n,V),D.clone(t,e._tiltCenterMousePosition);return}let g=wt.eastNorthUpToFixedFrame(m,i,WTe),f=e._globe,x=e._ellipsoid;e._globe=void 0,e._ellipsoid=ne.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let _=F.clone(r.transform,PTe);r._setTransform(g),$d(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 jyt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e._cameraUnderground,a,c,d;if(D.equals(t,e._tiltCenterMousePosition))a=h.clone(e._tiltCenter,w9);else{if(a=hb(e,t,w9),!l(a)){if(c=r.getPickRay(t,k3),d=qn.rayEllipsoid(c,i),!l(d)){if(i.cartesianToCartographic(r.position,G7).height<=e._minimumTrackBallHeight){e._looking=!0;let R=e._ellipsoid.geodeticSurfaceNormal(r.position,E7);eu(e,t,n,R),D.clone(t,e._tiltCenterMousePosition)}return}a=pn.getPoint(c,d.start,w9)}s&&(l(c)||(c=r.getPickRay(t,k3)),_Te(e,c,a,a)),D.clone(t,e._tiltCenterMousePosition),h.clone(a,e._tiltCenter)}let u=o.canvas,m=ITe;m.x=u.clientWidth/2,m.y=e._tiltCenterMousePosition.y,c=r.getPickRay(m,k3);let p=h.magnitude(a),g=h.fromElements(p,p,p,V7),f=ne.fromCartesian3(g,L7);if(d=qn.rayEllipsoid(c,f),!l(d))return;let x=h.magnitude(c.origin)>p?d.start:d.stop,_=pn.getPoint(c,x,Yyt),C=wt.eastNorthUpToFixedFrame(a,i,WTe),V=wt.eastNorthUpToFixedFrame(_,f,Oyt),L=e._globe,Z=e._ellipsoid;e._globe=void 0,e._ellipsoid=ne.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let E=h.UNIT_Z,X=F.clone(r.transform,PTe);r._setTransform(V);let v=h.cross(_,r.positionWC,N3);if(h.dot(r.rightWC,v)<0){let b=n.startPosition.y-n.endPosition.y;(s&&b<0||!s&&b>0)&&(E=void 0);let R=r.constrainedAxis;r.constrainedAxis=void 0,$d(e,t,n,E,!0,!1),r.constrainedAxis=R}else $d(e,t,n,E,!0,!1);if(r._setTransform(C),$d(e,t,n,E,!1,!0),l(r.constrainedAxis)){let b=h.cross(r.direction,r.constrainedAxis,N3);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(X),e._globe=L,e._ellipsoid=Z;let A=Z.maximumRadius;e._rotateFactor=1/A,e._rotateRateRangeAdjustment=A;let M=h.clone(r.positionWC,N3);if(e.enableCollisionDetection&&X7(e,!0),!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),G=h.cross(M,r.position,M);h.normalize(G,G);let I=we.fromAxisAngle(G,R,Hyt),w=$.fromQuaternion(I,zyt);$.multiplyByVector(w,r.direction,r.direction),$.multiplyByVector(w,r.up,r.up),h.cross(r.direction,r.up,r.right),h.cross(r.right,r.direction,r.up),r._setTransform(X)}}var qyt=new D,$yt=new D,pTe=new pn,bTe=new pn,ext=new h,txt=new h;function eu(e,t,n,i){let r=e._scene.camera,s=qyt;s.x=n.startPosition.x,s.y=0;let a=$yt;a.x=n.endPosition.x,a.y=0;let c=r.getPickRay(s,pTe),d=r.getPickRay(a,bTe),u=0,m,p;r.frustum instanceof sn?(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 g=h.dot(m,p);g<1&&(u=Math.acos(g)),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,pTe),d=r.getPickRay(a,bTe),u=0,r.frustum instanceof sn?(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),g=h.dot(m,p),g<1&&(u=Math.acos(g)),u=n.startPosition.y>n.endPosition.y?-u:u,i=y(i,f),l(i)){let x=r.direction,_=h.negate(i,ext),C=h.equalsEpsilon(x,i,W.EPSILON2),V=h.equalsEpsilon(x,_,W.EPSILON2);if(!C&&!V){g=h.dot(x,i);let L=W.acosClamped(g);u>0&&u>L&&(u=L-W.EPSILON4),g=h.dot(x,_),L=W.acosClamped(g),u<0&&-u>L&&(u=-L+W.EPSILON4);let Z=h.cross(i,x,txt);r.look(Z,u)}else(C&&u<0||V&&u>0)&&r.look(r.right,-u)}else r.lookUp(u)}function nxt(e){al(e,e.enableRotate,e.rotateEventTypes,Fyt,e.inertiaSpin,"_lastInertiaSpinMovement"),al(e,e.enableZoom,e.zoomEventTypes,XTe,e.inertiaZoom,"_lastInertiaZoomMovement"),al(e,e.enableTilt,e.tiltEventTypes,Kyt,e.inertiaSpin,"_lastInertiaTiltMovement"),al(e,e.enableLook,e.lookEventTypes,eu)}var ixt=new F,oxt=new he;function X7(e,t){e._adjustedHeightForTerrain=!0;let n=e._scene,i=n.mode;if(i===oe.SCENE2D||i===oe.MORPHING)return;let o=n.camera,r=y(n.ellipsoid,ne.WGS84),s=n.mapProjection,a,c;F.equals(o.transform,F.IDENTITY)||(a=F.clone(o.transform,ixt),c=h.magnitude(o.position),o._setTransform(F.IDENTITY));let d=oxt;i===oe.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,g=m-e._lastGlobeHeight,f=g/e._lastGlobeHeight;d.height<p&&(t||Math.abs(f)<=.1)&&(d.height=p,i===oe.SCENE3D?r.cartographicToCartesian(d,o.position):s.project(d,o.position),u=!0),t||Math.abs(f)<=.1?e._lastGlobeHeight=m:e._lastGlobeHeight+=g*.1}}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)))}F9.prototype.onMap=function(){let e=this._scene,t=e.mode,n=e.camera;return t===oe.COLUMBUS_VIEW?Math.abs(n.position.x)-this._maxCoord.x<0&&Math.abs(n.position.y)-this._maxCoord.y<0:!0};var rxt=new h,sxt=new h;F9.prototype.update=function(){let e=this._scene,{camera:t,globe:n,mode:i}=e;F.equals(t.transform,F.IDENTITY)?(this._globe=n,this._ellipsoid=y(e.ellipsoid,ne.default)):(this._globe=void 0,this._ellipsoid=ne.UNIT_SPHERE);let{verticalExaggeration:o,verticalExaggerationRelativeHeight:r}=e;this._minimumCollisionTerrainHeight=br.getHeight(this.minimumCollisionTerrainHeight,o,r),this._minimumPickingTerrainHeight=br.getHeight(this.minimumPickingTerrainHeight,o,r),this._minimumTrackBallHeight=br.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,rxt),c=h.clone(t.directionWC,sxt);if(i===oe.SCENE2D?oyt(this):i===oe.COLUMBUS_VIEW?(this._horizontalRotationAxis=h.UNIT_Z,Gyt(this)):i===oe.SCENE3D&&(this._horizontalRotationAxis=void 0,nxt(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let d=!h.equals(a,t.positionWC)||!h.equals(c,t.directionWC);X7(this,d)}this._aggregator.reset()};F9.prototype.isDestroyed=function(){return!1};F9.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),me(this)};var A9=F9;var zJi=T(S(),1);var RJi=T(S(),1),M9=`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 GJi=T(S(),1),N9=`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 fb(){this._sceneFramebuffer=new OT;let e=.125,t=new Array(6);t[0]=new co({fragmentShader:Ql,textureScale:e,forcePowerOfTwo:!0,sampleMode:Qd.LINEAR});let n=t[1]=new co({fragmentShader:N9,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new D,t[2]=new co({fragmentShader:Iy,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 co({fragmentShader:Iy,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 co({fragmentShader:Ql,sampleMode:Qd.LINEAR}),this._uCenter=new D,this._uRadius=void 0,t[5]=new co({fragmentShader:M9,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new rl({stages:t});let o=new qT(this),r=t.length;for(let s=0;s<r;++s)t[s]._textureCache=o;this._textureCache=o,this.length=t.length}fb.prototype.get=function(e){return this._stages.get(e)};fb.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 axt=new se,vTe=new D,cxt=new D,wTe=new F;function lxt(e,t,n){let i=t.uniformState,o=i.sunPositionWC,r=i.view,s=i.viewProjection,a=i.projection,c=F.computeViewportTransformation(n,0,1,wTe),d=F.multiplyByPoint(r,o,axt),u=wt.pointToGLWindowCoordinates(s,c,o,vTe);d.x+=W.SOLAR_RADIUS;let m=wt.pointToGLWindowCoordinates(a,c,d,d),p=D.magnitude(D.subtract(m,u,m))*30*2,g=cxt;g.x=p,g.y=p,e._uCenter=D.clone(u,e._uCenter),e._uRadius=Math.max(g.x,g.y)*.15;let f=t.drawingBufferWidth,x=t.drawingBufferHeight,_=e._stages,C=_.get(0),V=C.outputTexture.width,L=C.outputTexture.height,Z=new Ke;Z.width=V,Z.height=L,c=F.computeViewportTransformation(Z,0,1,wTe),u=wt.pointToGLWindowCoordinates(s,c,o,vTe),g.x*=V/f,g.y*=L/x;let E=C.scissorRectangle;E.x=Math.max(u.x-g.x*.5,0),E.y=Math.max(u.y-g.y*.5,0),E.width=Math.min(g.x,f),E.height=Math.min(g.y,x);for(let X=1;X<4;++X)Ke.clone(E,_.get(X).scissorRectangle)}fb.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};fb.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),lxt(this,t,n),o};fb.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)};fb.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Ql,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};fb.prototype.isDestroyed=function(){return!1};fb.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),me(this)};var k9=fb;var $Ji=T(S(),1);function iS(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new Gn}iS.fromKeyframeNode=function(e,t,n,i){let o=new iS(e,t,n),{spatialNode:r,metadata:s}=i;return o._metadata=dxt(e,s,n),o._orientedBoundingBox=mxt(e,r,n,o._orientedBoundingBox),o};function dxt(e,t,n){if(!l(t))return;let{names:i,types:o}=e.provider,r={};for(let s=0;s<i.length;s++){let a=i[s],c=zt.getComponentCount(o[s]),d=t[s].slice(n*c,(n+1)*c);r[a]=d}return r}var FTe=new h,uxt=new h;function mxt(e,t,n,i){let o=t.dimensions,r=o.x*o.y,s=Math.floor(n/r),a=n-s*r,c=Math.floor(a/o.x),d=a-c*o.x,u=h.fromElements(d,c,s,FTe),m=h.divideComponents(h.subtract(u,e._paddingBefore,FTe),e.dimensions,uxt);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,m,i)}Object.defineProperties(iS.prototype,{metadata:{get:function(){return this._metadata}},primitive:{get:function(){return this._primitive}},sampleIndex:{get:function(){return this._sampleIndex}},tileIndex:{get:function(){return this._tileIndex}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox.clone()}}});iS.prototype.hasProperty=function(e){return l(this._metadata[e])};iS.prototype.getNames=function(){return Object.keys(this._metadata)};iS.prototype.getProperty=function(e){return this._metadata[e]};var U9=iS;var Bji=T(S(),1);var y4i=T(S(),1);var e4i=T(S(),1);var tQi=T(S(),1),D9=`struct Ray {
    vec3 pos;
    vec3 dir;
    vec3 rawDir;
};

#if defined(JITTER)
/**
 * Generate a pseudo-random value for a given 2D screen coordinate.
 * Similar to https://www.shadertoy.com/view/4djSRW with a modified hashscale.
 */
float hash(vec2 p)
{
    vec3 p3 = fract(vec3(p.xyx) * 50.0);
    p3 += dot(p3, p3.yzx + 19.19);
    return fract((p3.x + p3.y) * p3.z);
}
#endif

float minComponent(in vec3 v) {
    return min(min(v.x, v.y), v.z);
}

float maxComponent(in vec3 v) {
    return max(max(v.x, v.y), v.z);
}

struct PointJacobianT {
    vec3 point;
    mat3 jacobianT;
};
`;var iQi=T(S(),1),B9=`// 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
#if defined(PICKING_VOXEL)
    #define ALPHA_ACCUM_MAX 0.1
#else
    #define ALPHA_ACCUM_MAX 0.98 // Must be > 0.0 and <= 1.0
#endif

uniform mat3 u_transformDirectionViewToLocal;
uniform vec3 u_cameraPositionUv;
uniform float u_stepSize;

#if defined(PICKING)
    uniform vec4 u_pickColor;
#endif

vec3 getSampleSize(in int level) {
    vec3 sampleCount = exp2(float(level)) * vec3(u_dimensions);
    vec3 sampleSizeUv = 1.0 / sampleCount;
    return scaleShapeUvToShapeSpace(sampleSizeUv);
}

#define MINIMUM_STEP_SCALAR (0.02)
#define SHIFT_FRACTION (0.001)

/**
 * Given a coordinate within a tile, and sample spacings along a ray through
 * the coordinate, find the distance to the points where the ray entered and
 * exited the voxel cell, along with the surface normals at those points.
 * The surface normals are returned in shape space coordinates.
 */
RayShapeIntersection getVoxelIntersection(in vec3 tileUv, in vec3 sampleSizeAlongRay) {
    vec3 voxelCoord = tileUv * vec3(u_dimensions);
    vec3 directions = sign(sampleSizeAlongRay);
    vec3 positiveDirections = max(directions, 0.0);
    vec3 entryCoord = mix(ceil(voxelCoord), floor(voxelCoord), positiveDirections);
    vec3 exitCoord = entryCoord + directions;

    vec3 distanceFromEntry = -abs((entryCoord - voxelCoord) * sampleSizeAlongRay);
    float lastEntry = maxComponent(distanceFromEntry);
    bvec3 isLastEntry = equal(distanceFromEntry, vec3(lastEntry));
    vec3 entryNormal = -1.0 * vec3(isLastEntry) * directions;
    vec4 entry = vec4(entryNormal, lastEntry);

    vec3 distanceToExit = abs((exitCoord - voxelCoord) * sampleSizeAlongRay);
    float firstExit = minComponent(distanceToExit);
    bvec3 isFirstExit = equal(distanceToExit, vec3(firstExit));
    vec3 exitNormal = vec3(isFirstExit) * directions;
    vec4 exit = vec4(exitNormal, firstExit);

    return RayShapeIntersection(entry, exit);
}

vec4 getStepSize(in SampleData sampleData, in Ray viewRay, in RayShapeIntersection shapeIntersection, in mat3 jacobianT, in float currentT) {
    // The Jacobian is computed in a space where the shape spans [-1, 1].
    // But the ray is marched in a space where the shape fills [0, 1].
    // So we need to scale the Jacobian by 2.
    vec3 gradient = 2.0 * viewRay.rawDir * jacobianT;
    vec3 sampleSizeAlongRay = getSampleSize(sampleData.tileCoords.w) / gradient;

    RayShapeIntersection voxelIntersection = getVoxelIntersection(sampleData.tileUv, sampleSizeAlongRay);

    // Transform normal from shape space to Cartesian space
    vec3 voxelNormal = normalize(jacobianT * voxelIntersection.entry.xyz);
    // Compare with the shape intersection, to choose the appropriate normal
    vec4 voxelEntry = vec4(voxelNormal, currentT + voxelIntersection.entry.w);
    vec4 entry = intersectionMax(shapeIntersection.entry, voxelEntry);

    float fixedStep = minComponent(abs(sampleSizeAlongRay)) * u_stepSize;
    float shift = fixedStep * SHIFT_FRACTION;
    float dt = voxelIntersection.exit.w + shift;
    if ((currentT + dt) > shapeIntersection.exit.w) {
        // Stop at end of shape
        dt = shapeIntersection.exit.w - currentT + shift;
    }
    float stepSize = clamp(dt, fixedStep * MINIMUM_STEP_SCALAR, fixedStep + shift);

    return vec4(entry.xyz, stepSize);
}

vec2 packIntToVec2(int value) {
    float shifted = float(value) / 255.0;
    float lowBits = fract(shifted);
    float highBits = floor(shifted) / 255.0;
    return vec2(highBits, lowBits);
}

vec2 packFloatToVec2(float value) {
    float lowBits = fract(value);
    float highBits = floor(value) / 255.0;
    return vec2(highBits, lowBits);
}

int getSampleIndex(in vec3 tileUv) {
    ivec3 voxelDimensions = u_dimensions;
    vec3 sampleCoordinate = tileUv * vec3(voxelDimensions);
    // tileUv = 1.0 is a valid coordinate but sampleIndex = voxelDimensions is not.
    // (tileUv = 1.0 corresponds to the last sample, at index = voxelDimensions - 1).
    // Clamp to [0, voxelDimensions - 0.5) to avoid numerical error before flooring
    vec3 maxCoordinate = vec3(voxelDimensions) - vec3(0.5);
    sampleCoordinate = clamp(sampleCoordinate, vec3(0.0), maxCoordinate);
    ivec3 sampleIndex = ivec3(floor(sampleCoordinate));
    #if defined(PADDING)
        voxelDimensions += u_paddingBefore + u_paddingAfter;
        sampleIndex += u_paddingBefore;
    #endif
    // Convert to a 1D index for lookup in a 1D data array
    return sampleIndex.x + voxelDimensions.x * (sampleIndex.y + voxelDimensions.y * sampleIndex.z);
}

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_ELLIPSOID)
        // viewDirUv has been scaled to a space where the ellipsoid is a sphere.
        // Undo this scaling to get the raw direction.
        vec3 rawDir = viewDirUv * u_ellipsoidRadiiUv;
        Ray viewRayUv = Ray(viewPosUv, viewDirUv, rawDir);
    #else
        Ray viewRayUv = Ray(viewPosUv, viewDirUv, 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 currentT = shapeIntersection.entry.w;
    float endT = shapeIntersection.exit.w;
    vec3 positionUv = viewPosUv + currentT * viewDirUv;
    PointJacobianT pointJacobian = convertUvToShapeUvSpaceDerivative(positionUv);

    // Traverse the tree from the start position
    TraversalData traversalData;
    SampleData sampleDatas[SAMPLE_COUNT];
    traverseOctreeFromBeginning(pointJacobian.point, traversalData, sampleDatas);
    vec4 step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection, pointJacobian.jacobianT, currentT);

    #if defined(JITTER)
        float noise = hash(screenCoord); // [0,1]
        currentT += 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 = pointJacobian.point;
        fragmentInput.voxel.positionUvLocal = sampleDatas[0].tileUv;
        fragmentInput.voxel.viewDirUv = viewDirUv;
        fragmentInput.voxel.viewDirWorld = viewDirWorld;
        fragmentInput.voxel.surfaceNormal = step.xyz;
        fragmentInput.voxel.travelDistance = step.w;
        fragmentInput.voxel.stepCount = stepCount;
        fragmentInput.voxel.tileIndex = sampleDatas[0].megatextureIndex;
        fragmentInput.voxel.sampleIndex = getSampleIndex(sampleDatas[0].tileUv);

        // 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
        currentT += step.w;
        positionUv = viewPosUv + currentT * viewDirUv;

        // Check if there's more intersections.
        if (currentT > endT) {
            #if (INTERSECTION_COUNT == 1)
                break;
            #else
                shapeIntersection = nextIntersection(ix);
                if (shapeIntersection.entry.w == NO_HIT) {
                    break;
                } else {
                    // Found another intersection. Resume raymarching there
                    currentT = shapeIntersection.entry.w;
                    endT = shapeIntersection.exit.w;
                    positionUv = viewPosUv + currentT * 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.
        pointJacobian = convertUvToShapeUvSpaceDerivative(positionUv);
        traverseOctreeFromExisting(pointJacobian.point, traversalData, sampleDatas);
        step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection, pointJacobian.jacobianT, currentT);
    }

    // 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;
    #elif defined(PICKING_VOXEL)
        // If alpha is 0.0 there is nothing to pick
        if (colorAccum.a == 0.0) {
            discard;
        }
        vec2 megatextureId = packIntToVec2(sampleDatas[0].megatextureIndex);
        vec2 sampleIndex = packIntToVec2(getSampleIndex(sampleDatas[0].tileUv));
        out_FragColor = vec4(megatextureId, sampleIndex);
    #else
        out_FragColor = colorAccum;
    #endif
}
`;var rQi=T(S(),1),Y9=`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 aQi=T(S(),1),O9=`/* Intersection defines
#define INTERSECTION_COUNT ###
*/

#define NO_HIT (-czm_infinity)
#define INF_HIT (czm_infinity * 0.5)

struct RayShapeIntersection {
    vec4 entry;
    vec4 exit;
};

vec4 intersectionMin(in vec4 intersect0, in vec4 intersect1)
{
    if (intersect0.w == NO_HIT) {
        return intersect1;
    } else if (intersect1.w == NO_HIT) {
        return intersect0;
    }
    return (intersect0.w <= intersect1.w) ? intersect0 : intersect1;
}

vec4 intersectionMax(in vec4 intersect0, in vec4 intersect1)
{
    return (intersect0.w >= intersect1.w) ? intersect0 : intersect1;
}

RayShapeIntersection intersectIntersections(in Ray ray, in RayShapeIntersection intersect0, in RayShapeIntersection intersect1)
{
    bool missed = (intersect0.entry.w == NO_HIT) ||
        (intersect1.entry.w == NO_HIT) ||
        (intersect0.exit.w < intersect1.entry.w) ||
        (intersect0.entry.w > intersect1.exit.w);
    if (missed) {
        vec4 miss = vec4(normalize(ray.dir), NO_HIT);
        return RayShapeIntersection(miss, miss);
    }

    vec4 entry = intersectionMax(intersect0.entry, intersect1.entry);
    vec4 exit = intersectionMin(intersect0.exit, intersect1.exit);

    return RayShapeIntersection(entry, 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, /*bool*/ positive, /*bool*/ enter) (ix).intersections[(index)] = encodeIntersectionType((intersection), int(!positive), (enter))
#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 lQi=T(S(),1),H9=`// 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 uQi=T(S(),1),z9=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, INF_HIT,
// NO_HIT, setShapeIntersection

/* 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 hQi=T(S(),1),gL=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, INF_HIT,
// RayShapeIntersection

vec4 intersectLongitude(in Ray ray, in float angle, in bool positiveNormal) {
    float normalSign = positiveNormal ? 1.0 : -1.0;
    vec2 planeNormal = vec2(-sin(angle), cos(angle)) * normalSign;

    vec2 position = ray.pos.xy;
    vec2 direction = ray.dir.xy;
    float approachRate = dot(direction, planeNormal);
    float distance = -dot(position, planeNormal);

    float t = (approachRate == 0.0)
        ? NO_HIT
        : distance / approachRate;

    return vec4(planeNormal, 0.0, t);
}

RayShapeIntersection intersectHalfSpace(in Ray ray, in float angle, in bool positiveNormal)
{
    vec4 intersection = intersectLongitude(ray, angle, positiveNormal);
    vec4 farSide = vec4(normalize(ray.dir), INF_HIT);

    bool hitFront = (intersection.w > 0.0) == (dot(ray.pos.xy, intersection.xy) > 0.0);
    if (!hitFront) {
        return RayShapeIntersection(intersection, farSide);
    } else {
        return RayShapeIntersection(-1.0 * farSide, intersection);
    }
}

void intersectFlippedWedge(in Ray ray, in vec2 minMaxAngle, out RayShapeIntersection intersections[2])
{
    intersections[0] = intersectHalfSpace(ray, minMaxAngle.x, false);
    intersections[1] = intersectHalfSpace(ray, minMaxAngle.y, true);
}

bool hitPositiveHalfPlane(in Ray ray, in vec4 intersection, in bool positiveNormal) {
    float normalSign = positiveNormal ? 1.0 : -1.0;
    vec2 planeDirection = vec2(intersection.y, -intersection.x) * normalSign;
    vec2 hit = ray.pos.xy + intersection.w * ray.dir.xy;
    return dot(hit, planeDirection) > 0.0;
}

void intersectHalfPlane(in Ray ray, in float angle, out RayShapeIntersection intersections[2]) {
    vec4 intersection = intersectLongitude(ray, angle, true);
    vec4 farSide = vec4(normalize(ray.dir), INF_HIT);

    if (hitPositiveHalfPlane(ray, intersection, true)) {
        intersections[0].entry = -1.0 * farSide;
        intersections[0].exit = vec4(-1.0 * intersection.xy, 0.0, intersection.w);
        intersections[1].entry = intersection;
        intersections[1].exit = farSide;
    } else {
        vec4 miss = vec4(normalize(ray.dir), NO_HIT);
        intersections[0].entry = -1.0 * farSide;
        intersections[0].exit = farSide;
        intersections[1].entry = miss;
        intersections[1].exit = miss;
    }
}

RayShapeIntersection intersectRegularWedge(in Ray ray, in vec2 minMaxAngle)
{
    // Note: works for maxAngle > minAngle + pi, where the "regular wedge"
    // is actually a negative volume.
    // Compute intersections with the two planes.
    // Normals will point toward the "outside" (negative space)
    vec4 intersect1 = intersectLongitude(ray, minMaxAngle.x, false);
    vec4 intersect2 = intersectLongitude(ray, minMaxAngle.y, true);

    // Choose intersection with smallest T as the "first", the other as "last"
    // Note: first or last could be in the "shadow" wedge, beyond the tip
    bool inOrder = intersect1.w <= intersect2.w;
    vec4 first = inOrder ? intersect1 : intersect2;
    vec4 last = inOrder ? intersect2 : intersect1;

    bool firstIsAhead = first.w >= 0.0;
    bool startedInsideFirst = dot(ray.pos.xy, first.xy) < 0.0;
    bool exitFromInside = firstIsAhead == startedInsideFirst;
    bool lastIsAhead = last.w > 0.0;
    bool startedOutsideLast = dot(ray.pos.xy, last.xy) >= 0.0;
    bool enterFromOutside = lastIsAhead == startedOutsideLast;

    vec4 farSide = vec4(normalize(ray.dir), INF_HIT);
    vec4 miss = vec4(normalize(ray.dir), NO_HIT);

    if (exitFromInside && enterFromOutside) {
        // Ray crosses both faces of negative wedge, exiting then entering the positive shape
        return RayShapeIntersection(first, last);
    } else if (!exitFromInside && enterFromOutside) {
        // Ray starts inside wedge. last is in shadow wedge, and first is actually the entry
        return RayShapeIntersection(-1.0 * farSide, first);
    } else if (exitFromInside && !enterFromOutside) {
        // First intersection was in the shadow wedge, so last is actually the exit
        return RayShapeIntersection(last, farSide);
    } else { // !exitFromInside && !enterFromOutside
        // Both intersections were in the shadow wedge
        return RayShapeIntersection(miss, miss);
    }
}
`;var pQi=T(S(),1),K9=`// See IntersectionUtils.glsl for the definitions of Ray, RayShapeIntersection,
// NO_HIT, Intersections

/* Box defines (set in Scene/VoxelBoxShape.js)
#define BOX_INTERSECTION_INDEX ### // always 0
*/

uniform vec3 u_renderMinBounds;
uniform vec3 u_renderMaxBounds;

RayShapeIntersection intersectBox(in Ray ray, in vec3 minBound, in vec3 maxBound)
{
    // 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 = (minBound - ray.pos) / ray.dir;
    vec3 t1 = (maxBound - ray.pos) / ray.dir;

    // Identify candidate entries/exits based on distance from ray.pos
    vec3 entries = min(t0, t1);
    vec3 exits = max(t0, t1);

    vec3 directions = sign(ray.dir);

    // The actual intersection points are the furthest entry and the closest exit
    float lastEntry = maxComponent(entries);
    bvec3 isLastEntry = equal(entries, vec3(lastEntry));
    vec3 entryNormal = -1.0 * vec3(isLastEntry) * directions;
    vec4 entry = vec4(entryNormal, lastEntry);

    float firstExit = minComponent(exits);
    bvec3 isFirstExit = equal(exits, vec3(firstExit));
    vec3 exitNormal = vec3(isLastEntry) * directions;
    vec4 exit = vec4(exitNormal, firstExit);

    if (entry.w > exit.w) {
        entry.w = NO_HIT;
        exit.w = NO_HIT;
    }

    return RayShapeIntersection(entry, exit);
}

void intersectShape(in Ray ray, inout Intersections ix)
{
    RayShapeIntersection intersection = intersectBox(ray, u_renderMinBounds, u_renderMaxBounds);
    setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection);
}
`;var gQi=T(S(),1),J9=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, Intersections,
// RayShapeIntersection, setSurfaceIntersection, setShapeIntersection,
// intersectIntersections
// See IntersectLongitude.glsl for the definitions of intersectHalfPlane,
// intersectFlippedWedge, intersectRegularWedge

/* Cylinder defines (set in Scene/VoxelCylinderShape.js)
#define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN
#define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_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_ZERO

#define CYLINDER_INTERSECTION_INDEX_RADIUS_MAX
#define CYLINDER_INTERSECTION_INDEX_RADIUS_MIN
#define CYLINDER_INTERSECTION_INDEX_ANGLE
*/

// Cylinder uniforms
uniform vec2 u_cylinderRenderRadiusMinMax;
uniform vec2 u_cylinderRenderHeightMinMax;
#if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE)
    uniform vec2 u_cylinderRenderAngleMinMax;
#endif

/**
 * Find the intersection of a ray with the volume defined by two planes of constant z
 */
RayShapeIntersection intersectHeightBounds(in Ray ray, in vec2 minMaxHeight, in bool convex)
{
    float zPosition = ray.pos.z;
    float zDirection = ray.dir.z;

    float tmin = (minMaxHeight.x - zPosition) / zDirection;
    float tmax = (minMaxHeight.y - zPosition) / zDirection;

    // Normals point outside the volume
    float signFlip = convex ? 1.0 : -1.0;
    vec4 intersectMin = vec4(0.0, 0.0, -1.0 * signFlip, tmin);
    vec4 intersectMax = vec4(0.0, 0.0, 1.0 * signFlip, tmax);

    bool topEntry = zDirection < 0.0;
    vec4 entry = topEntry ? intersectMax : intersectMin;
    vec4 exit = topEntry ? intersectMin : intersectMax;

    return RayShapeIntersection(entry, exit);
}

/**
 * Find the intersection of a ray with a right cylindrical surface of a given radius
 * about the z-axis.
 */
RayShapeIntersection intersectCylinder(in Ray ray, in float radius, in bool convex)
{
    vec2 position = ray.pos.xy;
    vec2 direction = ray.dir.xy;

    float a = dot(direction, direction);
    float b = dot(position, direction);
    float c = dot(position, position) - radius * radius;
    float determinant = b * b - a * c;

    if (determinant < 0.0) {
        vec4 miss = vec4(normalize(ray.dir), NO_HIT);
        return RayShapeIntersection(miss, miss);
    }

    determinant = sqrt(determinant);
    float t1 = (-b - determinant) / a;
    float t2 = (-b + determinant) / a;
    float signFlip = convex ? 1.0 : -1.0;
    vec4 intersect1 = vec4(normalize(position + t1 * direction) * signFlip, 0.0, t1);
    vec4 intersect2 = vec4(normalize(position + t2 * direction) * signFlip, 0.0, t2);

    return RayShapeIntersection(intersect1, intersect2);
}

/**
 * Find the intersection of a ray with a right cylindrical solid of given
 * radius and height bounds. NOTE: The shape is assumed to be convex.
 */
RayShapeIntersection intersectBoundedCylinder(in Ray ray, in float radius, in vec2 minMaxHeight)
{
    RayShapeIntersection cylinderIntersection = intersectCylinder(ray, radius, true);
    RayShapeIntersection heightBoundsIntersection = intersectHeightBounds(ray, minMaxHeight, true);
    return intersectIntersections(ray, cylinderIntersection, heightBoundsIntersection);
}

void intersectShape(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;

    RayShapeIntersection outerIntersect = intersectBoundedCylinder(ray, u_cylinderRenderRadiusMinMax.y, u_cylinderRenderHeightMinMax);

    setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MAX, outerIntersect);

    if (outerIntersect.entry.w == 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.
        RayShapeIntersection innerIntersect = intersectCylinder(ray, 1.0, false);
        setSurfaceIntersection(ix, 0, outerIntersect.entry, true, true);  // positive, enter
        setSurfaceIntersection(ix, 1, innerIntersect.entry, false, true); // negative, enter
        setSurfaceIntersection(ix, 2, innerIntersect.exit, false, false); // negative, exit
        setSurfaceIntersection(ix, 3, outerIntersect.exit, true, false);  // positive, exit
    #elif defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN)
        RayShapeIntersection innerIntersect = intersectCylinder(ray, u_cylinderRenderRadiusMinMax.x, false);
        setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MIN, innerIntersect);
    #endif

    #if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF)
        RayShapeIntersection wedgeIntersect = intersectRegularWedge(ray, u_cylinderRenderAngleMinMax);
        setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE, wedgeIntersect);
    #elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF)
        RayShapeIntersection wedgeIntersects[2];
        intersectFlippedWedge(ray, u_cylinderRenderAngleMinMax, wedgeIntersects);
        setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersects[0]);
        setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersects[1]);
    #elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO)
        RayShapeIntersection wedgeIntersects[2];
        intersectHalfPlane(ray, u_cylinderRenderAngleMinMax.x, wedgeIntersects);
        setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersects[0]);
        setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersects[1]);
    #endif
}
`;var xQi=T(S(),1),Q9=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, INF_HIT, Intersections,
// RayShapeIntersection, setSurfaceIntersection, setShapeIntersection
// See IntersectLongitude.glsl for the definitions of intersectHalfPlane,
// intersectFlippedWedge, intersectRegularWedge

/* 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_OVER_HALF
#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_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
uniform float u_eccentricitySquared;
uniform vec2 u_ellipsoidRenderLatitudeSinMinMax;
uniform vec2 u_clipMinMaxHeight;

RayShapeIntersection intersectZPlane(in Ray ray, in float z) {
    float t = -ray.pos.z / ray.dir.z;

    bool startsOutside = sign(ray.pos.z) == sign(z);
    bool entry = (t >= 0.0) != startsOutside;

    vec4 intersect = vec4(0.0, 0.0, z, t);
    vec4 farSide = vec4(normalize(ray.dir), INF_HIT);

    if (entry) {
        return RayShapeIntersection(intersect, farSide);
    } else {
        return RayShapeIntersection(-1.0 * farSide, intersect);
    }
}

RayShapeIntersection intersectHeight(in Ray ray, in float relativeHeight, in bool convex)
{
    // Scale the ray by the ellipsoid axes to make it a unit sphere
    // Note: approximating ellipsoid + height as an ellipsoid
    vec3 radiiCorrection = u_ellipsoidRadiiUv / (u_ellipsoidRadiiUv + relativeHeight);
    vec3 position = ray.pos * radiiCorrection;
    vec3 direction = ray.dir * radiiCorrection;

    float a = dot(direction, direction); // ~ 1.0 (or maybe 4.0 if ray is scaled)
    float b = dot(direction, position); // roughly inside [-1.0, 1.0] when zoomed in
    float c = dot(position, position) - 1.0; // ~ 0.0 when zoomed in.
    float determinant = b * b - a * c; // ~ b * b when zoomed in

    if (determinant < 0.0) {
        vec4 miss = vec4(normalize(direction), NO_HIT);
        return RayShapeIntersection(miss, miss);
    }

    determinant = sqrt(determinant);

    // Compute larger root using standard formula
    float signB = b < 0.0 ? -1.0 : 1.0;
    // The other root may suffer from subtractive cancellation in the standard formula.
    // Compute it from the first root instead.
    float t1 = (-b - signB * determinant) / a;
    float t2 = c / (a * t1);
    float tmin = min(t1, t2);
    float tmax = max(t1, t2);

    float directionScale = convex ? 1.0 : -1.0;
    vec3 d1 = directionScale * normalize(position + tmin * direction);
    vec3 d2 = directionScale * normalize(position + tmax * direction);

    return RayShapeIntersection(vec4(d1, tmin), vec4(d2, tmax));
}

/**
 * Given a circular cone around the z-axis, with apex at the origin,
 * find the parametric distance(s) along a ray where that ray intersects
 * the cone.
 * The cone opening angle is described by the squared cosine of
 * its half-angle (the angle between the Z-axis and the surface)
 */
vec2 intersectDoubleEndedCone(in Ray ray, in float cosSqrHalfAngle)
{
    vec3 o = ray.pos;
    vec3 d = ray.dir;
    float sinSqrHalfAngle = 1.0 - cosSqrHalfAngle;

    float aSin = d.z * d.z * sinSqrHalfAngle;
    float aCos = -dot(d.xy, d.xy) * cosSqrHalfAngle;
    float a = aSin + aCos;

    float bSin = d.z * o.z * sinSqrHalfAngle;
    float bCos = -dot(o.xy, d.xy) * cosSqrHalfAngle;
    float b = bSin + bCos;

    float cSin = o.z * o.z * sinSqrHalfAngle;
    float cCos = -dot(o.xy, o.xy) * cosSqrHalfAngle;
    float c = cSin + cCos;
    // determinant = b * b - a * c. But bSin * bSin = aSin * cSin.
    // Avoid subtractive cancellation by expanding to eliminate these terms
    float determinant = 2.0 * bSin * bCos + bCos * bCos - aSin * cCos - aCos * cSin - aCos * cCos;

    if (determinant < 0.0) {
        return vec2(NO_HIT);
    } else if (a == 0.0) {
        // Ray is parallel to cone surface
        return (b == 0.0)
            ? vec2(NO_HIT) // Ray is on cone surface
            : vec2(-0.5 * c / b, NO_HIT);
    }

    determinant = sqrt(determinant);

    // Compute larger root using standard formula
    float signB = b < 0.0 ? -1.0 : 1.0;
    float t1 = (-b - signB * determinant) / a;
    // The other root may suffer from subtractive cancellation in the standard formula.
    // Compute it from the first root instead.
    float t2 = c / (a * t1);
    float tmin = min(t1, t2);
    float tmax = max(t1, t2);
    return vec2(tmin, tmax);
}

/**
 * Given a point on a conical surface, find the surface normal at that point.
 */
vec3 getConeNormal(in vec3 p, in bool convex) {
    // Start with radial component pointing toward z-axis
    vec2 radial = -abs(p.z) * normalize(p.xy);
    // Z component points toward opening of cone
    float zSign = (p.z < 0.0) ? -1.0 : 1.0;
    float z = length(p.xy) * zSign;
    // Flip normal if shape is convex
    float flip = (convex) ? -1.0 : 1.0;
    return normalize(vec3(radial, z) * flip);
}

/**
 * Compute the shift between the ellipsoid origin and the apex of a cone of latitude
 */
float getLatitudeConeShift(in float sinLatitude) {
    // Find prime vertical radius of curvature: 
    // the distance along the ellipsoid normal to the intersection with the z-axis
    float x2 = u_eccentricitySquared * sinLatitude * sinLatitude;
    float primeVerticalRadius = inversesqrt(1.0 - x2);

    // Compute a shift from the origin to the intersection of the cone with the z-axis
    return primeVerticalRadius * u_eccentricitySquared * sinLatitude;
}

void intersectFlippedCone(in Ray ray, in float cosHalfAngle, out RayShapeIntersection intersections[2]) {
    // Undo the scaling from ellipsoid to sphere
    ray.pos = ray.pos * u_ellipsoidRadiiUv;
    ray.dir = ray.dir * u_ellipsoidRadiiUv;
    // Shift the ray to account for the latitude cone not being centered at the Earth center
    ray.pos.z += getLatitudeConeShift(cosHalfAngle);

    float cosSqrHalfAngle = cosHalfAngle * cosHalfAngle;
    vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle);

    vec4 miss = vec4(normalize(ray.dir), NO_HIT);
    vec4 farSide = vec4(normalize(ray.dir), INF_HIT);

    // Initialize output with no intersections
    intersections[0].entry = -1.0 * farSide;
    intersections[0].exit = farSide;
    intersections[1].entry = miss;
    intersections[1].exit = miss;

    if (intersect.x == NO_HIT) {
        return;
    }

    // Find the points of intersection
    float tmin = intersect.x;
    float tmax = intersect.y;
    vec3 p0 = ray.pos + tmin * ray.dir;
    vec3 p1 = ray.pos + tmax * ray.dir;

    vec4 intersect0 = vec4(getConeNormal(p0, true), tmin);
    vec4 intersect1 = vec4(getConeNormal(p1, true), tmax);

    bool p0InShadowCone = sign(p0.z) != sign(cosHalfAngle);
    bool p1InShadowCone = sign(p1.z) != sign(cosHalfAngle);

    if (p0InShadowCone && p1InShadowCone) {
        // no valid intersections
    } else if (p0InShadowCone) {
        intersections[0].exit = intersect1;
    } else if (p1InShadowCone) {
        intersections[0].entry = intersect0;
    } else {
        intersections[0].exit = intersect0;
        intersections[1].entry = intersect1;
        intersections[1].exit = farSide;
    }
}

RayShapeIntersection intersectRegularCone(in Ray ray, in float cosHalfAngle, in bool convex) {
    // Undo the scaling from ellipsoid to sphere
    ray.pos = ray.pos * u_ellipsoidRadiiUv;
    ray.dir = ray.dir * u_ellipsoidRadiiUv;
    // Shift the ray to account for the latitude cone not being centered at the Earth center
    ray.pos.z += getLatitudeConeShift(cosHalfAngle);

    float cosSqrHalfAngle = cosHalfAngle * cosHalfAngle;
    vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle);

    vec4 miss = vec4(normalize(ray.dir), NO_HIT);
    vec4 farSide = vec4(normalize(ray.dir), INF_HIT);

    if (intersect.x == NO_HIT) {
        return RayShapeIntersection(miss, miss);
    }

    // Find the points of intersection
    float tmin = intersect.x;
    float tmax = intersect.y;
    vec3 p0 = ray.pos + tmin * ray.dir;
    vec3 p1 = ray.pos + tmax * ray.dir;

    vec4 intersect0 = vec4(getConeNormal(p0, convex), tmin);
    vec4 intersect1 = vec4(getConeNormal(p1, convex), tmax);

    bool p0InShadowCone = sign(p0.z) != sign(cosHalfAngle);
    bool p1InShadowCone = sign(p1.z) != sign(cosHalfAngle);

    if (p0InShadowCone && p1InShadowCone) {
        return RayShapeIntersection(miss, miss);
    } else if (p0InShadowCone) {
        return RayShapeIntersection(intersect1, farSide);
    } else if (p1InShadowCone) {
        return RayShapeIntersection(-1.0 * farSide, intersect0);
    } else {
        return RayShapeIntersection(intersect0, intersect1);
    }
}

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;

    // Outer ellipsoid
    RayShapeIntersection outerIntersect = intersectHeight(ray, u_clipMinMaxHeight.y, true);
    setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX, outerIntersect);

    // Exit early if the outer ellipsoid was missed.
    if (outerIntersect.entry.w == NO_HIT) {
        return;
    }

    // Inner ellipsoid
    RayShapeIntersection innerIntersect = intersectHeight(ray, u_clipMinMaxHeight.x, false);

    if (innerIntersect.entry.w == NO_HIT) {
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN, innerIntersect);
    } else {
        // When the ellipsoid is 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
        // 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.
        innerIntersect.entry.w = max(innerIntersect.entry.w, outerIntersect.entry.w);
        innerIntersect.exit.w = min(innerIntersect.exit.w, outerIntersect.exit.w);
        setSurfaceIntersection(ix, 0, outerIntersect.entry, true, true);  // positive, enter
        setSurfaceIntersection(ix, 1, innerIntersect.entry, false, true); // negative, enter
        setSurfaceIntersection(ix, 2, innerIntersect.exit, false, false); // negative, exit
        setSurfaceIntersection(ix, 3, outerIntersect.exit, true, false);  // positive, exit
    }

    // Bottom cone
    #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF)
        RayShapeIntersection bottomConeIntersection = intersectRegularCone(ray, u_ellipsoidRenderLatitudeSinMinMax.x, false);
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection);
    #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF)
        RayShapeIntersection bottomConeIntersection = intersectZPlane(ray, -1.0);
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection);
    #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF)
        RayShapeIntersection bottomConeIntersections[2];
        intersectFlippedCone(ray, u_ellipsoidRenderLatitudeSinMinMax.x, bottomConeIntersections);
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 0, bottomConeIntersections[0]);
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 1, bottomConeIntersections[1]);
    #endif

    // Top cone
    #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF)
        RayShapeIntersection topConeIntersections[2];
        intersectFlippedCone(ray, u_ellipsoidRenderLatitudeSinMinMax.y, topConeIntersections);
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 0, topConeIntersections[0]);
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 1, topConeIntersections[1]);
    #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF)
        RayShapeIntersection topConeIntersection = intersectZPlane(ray, 1.0);
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection);
    #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF)
        RayShapeIntersection topConeIntersection = intersectRegularCone(ray, u_ellipsoidRenderLatitudeSinMinMax.y, false);
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection);
    #endif

    // Wedge
    #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO)
        RayShapeIntersection wedgeIntersects[2];
        intersectHalfPlane(ray, u_ellipsoidRenderLongitudeMinMax.x, wedgeIntersects);
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersects[0]);
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersects[1]);
    #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF)
        RayShapeIntersection wedgeIntersect = intersectRegularWedge(ray, u_ellipsoidRenderLongitudeMinMax);
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE, wedgeIntersect);
    #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF)
        RayShapeIntersection wedgeIntersects[2];
        intersectFlippedWedge(ray, u_ellipsoidRenderLongitudeMinMax, wedgeIntersects);
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersects[0]);
        setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersects[1]);
    #endif
}
`;var TQi=T(S(),1),oS=`// 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 CQi=T(S(),1),j9=`/* 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

PointJacobianT convertUvToShapeSpaceDerivative(in vec3 positionUv) {
    // For BOX, UV space = shape space, so we can use positionUv as-is,
    // and the Jacobian is the identity matrix, except that a step of 1
    // only spans half the shape space [-1, 1], so the identity is scaled.
    return PointJacobianT(positionUv, mat3(0.5));
}

vec3 convertShapeToShapeUvSpace(in vec3 positionShape) {
#if defined(BOX_HAS_SHAPE_BOUNDS)
    return positionShape * u_boxUvToShapeUvScale + u_boxUvToShapeUvTranslate;
#else
    return positionShape;
#endif
}

PointJacobianT convertUvToShapeUvSpaceDerivative(in vec3 positionUv) {
    PointJacobianT pointJacobian = convertUvToShapeSpaceDerivative(positionUv);
    pointJacobian.point = convertShapeToShapeUvSpace(pointJacobian.point);
    return pointJacobian;
}

vec3 convertShapeUvToUvSpace(in vec3 shapeUv) {
#if defined(BOX_HAS_SHAPE_BOUNDS)
    return (shapeUv - u_boxUvToShapeUvTranslate) / u_boxUvToShapeUvScale;
#else
    return shapeUv;
#endif
}

vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) {
#if defined(BOX_HAS_SHAPE_BOUNDS)
    return shapeUv / u_boxUvToShapeUvScale;
#else
    return shapeUv;
#endif
}`;var LQi=T(S(),1),q9=`/* Cylinder defines (set in Scene/VoxelCylinderShape.js)
#define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS
#define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT
#define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE
#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

PointJacobianT convertUvToShapeSpaceDerivative(in vec3 positionUv) {
    // Convert from Cartesian UV space [0, 1] to Cartesian local space [-1, 1]
    vec3 position = positionUv * 2.0 - 1.0;

    float radius = length(position.xy); // [0, 1]
    vec3 radial = normalize(vec3(position.xy, 0.0));

    // Shape space height is defined within [0, 1]
    float height = positionUv.z; // [0, 1]
    vec3 z = vec3(0.0, 0.0, 1.0);

    float angle = atan(position.y, position.x);
    vec3 east = normalize(vec3(-position.y, position.x, 0.0));

    vec3 point = vec3(radius, height, angle);
    mat3 jacobianT = mat3(radial, z, east / length(position.xy));
    return PointJacobianT(point, jacobianT);
}

vec3 convertShapeToShapeUvSpace(in vec3 positionShape) {
    float radius = positionShape.x;
    #if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS)
        radius = radius * u_cylinderUvToShapeUvRadius.x + u_cylinderUvToShapeUvRadius.y;
    #endif

    float height = positionShape.y;
    #if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT)
        height = height * u_cylinderUvToShapeUvHeight.x + u_cylinderUvToShapeUvHeight.y;
    #endif

    float angle = (positionShape.z + czm_pi) / czm_twoPi;
    #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;
    #endif

    return vec3(radius, height, angle);
}

PointJacobianT convertUvToShapeUvSpaceDerivative(in vec3 positionUv) {
    PointJacobianT pointJacobian = convertUvToShapeSpaceDerivative(positionUv);
    pointJacobian.point = convertShapeToShapeUvSpace(pointJacobian.point);
    return pointJacobian;
}

vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) {
    float radius = shapeUv.x;
    #if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS)
        radius /= u_cylinderUvToShapeUvRadius.x;
    #endif

    float height = shapeUv.y;
    #if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT)
        height /= u_cylinderUvToShapeUvHeight.x;
    #endif

    float angle = shapeUv.z * czm_twoPi;
    #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)
        angle /= u_cylinderUvToShapeUvAngle.x;
    #endif

    return vec3(radius, height, angle);
}
`;var ZQi=T(S(),1),$9=`/* 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_MIN_MAX_REVERSED
#define ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE
*/

uniform vec3 u_ellipsoidRadiiUv; // [0,1]
uniform vec2 u_evoluteScale; // (radiiUv.x ^ 2 - radiiUv.z ^ 2) * vec2(1.0, -1.0) / radiiUv;
uniform vec3 u_ellipsoidInverseRadiiSquaredUv;
#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
uniform float u_ellipsoidInverseHeightDifferenceUv;

// 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
// Extended to return radius of curvature along with the point
vec3 nearestPointAndRadiusOnEllipse(vec2 pos, vec2 radii) {
    vec2 p = abs(pos);
    vec2 inverseRadii = 1.0 / radii;

    // 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 = pi/4
    vec2 tTrigs = vec2(0.7071067811865476);
    // Initial guess of point on ellipsoid
    vec2 v = radii * tTrigs;
    // Center of curvature of the ellipse at v
    vec2 evolute = u_evoluteScale * tTrigs * tTrigs * tTrigs;

    const int iterations = 3;
    for (int i = 0; i < iterations; ++i) {
        // 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;
        evolute = u_evoluteScale * tTrigs * tTrigs * tTrigs;
    }

    return vec3(v * sign(pos), length(v - evolute));
}

PointJacobianT convertUvToShapeSpaceDerivative(in vec3 positionUv) {
    // Convert from UV space [0, 1] to local space [-1, 1]
    vec3 position = positionUv * 2.0 - 1.0;
    // Undo the scaling from ellipsoid to sphere
    position = position * u_ellipsoidRadiiUv;

    float longitude = atan(position.y, position.x);
    vec3 east = normalize(vec3(-position.y, position.x, 0.0));

    // Convert the 3D position to a 2D position relative to the ellipse (radii.x, radii.z)
    // (assume radii.y == radii.x) and find the nearest point on the ellipse and its normal
    float distanceFromZAxis = length(position.xy);
    vec2 posEllipse = vec2(distanceFromZAxis, position.z);
    vec3 surfacePointAndRadius = nearestPointAndRadiusOnEllipse(posEllipse, u_ellipsoidRadiiUv.xz);
    vec2 surfacePoint = surfacePointAndRadius.xy;

    vec2 normal2d = normalize(surfacePoint * u_ellipsoidInverseRadiiSquaredUv.xz);
    float latitude = atan(normal2d.y, normal2d.x);
    vec3 north = vec3(-normal2d.y * normalize(position.xy), abs(normal2d.x));

    float heightSign = length(posEllipse) < length(surfacePoint) ? -1.0 : 1.0;
    float height = heightSign * length(posEllipse - surfacePoint);
    vec3 up = normalize(cross(east, north));

    vec3 point = vec3(longitude, latitude, height);
    mat3 jacobianT = mat3(east / distanceFromZAxis, north / (surfacePointAndRadius.z + height), up);
    return PointJacobianT(point, jacobianT);
}

vec3 convertShapeToShapeUvSpace(in vec3 positionShape) {
    // Longitude: shift & scale to [0, 1]
    float longitude = (positionShape.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

    // Latitude: shift and scale to [0, 1]
    float latitude = (positionShape.y + czm_piOverTwo) / czm_pi;
    #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)
        latitude = latitude * u_ellipsoidUvToShapeUvLatitude.x + u_ellipsoidUvToShapeUvLatitude.y;
    #endif

    // Height: scale to the range [0, 1]
    float height = 1.0 + positionShape.z * u_ellipsoidInverseHeightDifferenceUv;

    return vec3(longitude, latitude, height);
}

PointJacobianT convertUvToShapeUvSpaceDerivative(in vec3 positionUv) {
    PointJacobianT pointJacobian = convertUvToShapeSpaceDerivative(positionUv);
    pointJacobian.point = convertShapeToShapeUvSpace(pointJacobian.point);
    return pointJacobian;
}

vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) {
    // Convert from [0, 1] to radians [-pi, pi]
    float longitude = shapeUv.x * czm_twoPi;
    #if defined (ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)
        longitude /= u_ellipsoidUvToShapeUvLongitude.x;
    #endif

    // Convert from [0, 1] to radians [-pi/2, pi/2]
    float latitude = shapeUv.y * czm_pi;
    #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)
        latitude /= u_ellipsoidUvToShapeUvLatitude.x;
    #endif
    
    float height = shapeUv.z / u_ellipsoidInverseHeightDifferenceUv;

    return vec3(longitude, latitude, height);
}
`;var EQi=T(S(),1),eA=`// 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 = exp2(float(octreeCoords.w));
    return shapePosition * dimAtLevel - vec3(octreeCoords.xyz);
}

vec3 getClampedTileUv(in vec3 shapePosition, in ivec4 octreeCoords) {
    vec3 tileUv = getTileUv(shapePosition, octreeCoords);
    return clamp(tileUv, vec3(0.0), vec3(1.0));
}

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 = exp2(-1.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 = getClampedTileUv(shapePosition, sampleDatas[0].tileCoords);
    #else
        getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas);
        sampleDatas[0].tileUv = getClampedTileUv(shapePosition, sampleDatas[0].tileCoords);
        sampleDatas[1].tileUv = getClampedTileUv(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 = getClampedTileUv(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 = getClampedTileUv(shapePosition, sampleDatas[0].tileCoords);
    #else
        getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas);
        sampleDatas[0].tileUv = getClampedTileUv(shapePosition, sampleDatas[0].tileCoords);
        sampleDatas[1].tileUv = getClampedTileUv(shapePosition, sampleDatas[1].tileCoords);
    #endif
}
`;var IQi=T(S(),1),tA=`// 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) {
    int tileIndex = sampleData.megatextureIndex;
    vec3 voxelCoord = sampleData.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 hxt(e){let t=new ox;this.shaderBuilder=t;let n=e._customShader,i=_t(e._uniformMap,n.uniformMap);e._uniformMap=i;let o=n.uniforms;for(let p in o)if(o.hasOwnProperty(p)){let g=o[p];t.addUniform(g.type,p,ye.FRAGMENT)}t.addUniform("sampler2D","u_megatextureTextures[METADATA_COUNT]",ye.FRAGMENT),this.uniformMap=i;let r=e._clippingPlanes,s=l(r)&&r.enabled?r.length:0;this.clippingPlanes=r,this.clippingPlanesLength=s,t.addVertexLines([Y9]),t.addFragmentLines([n.fragmentShaderText,"#line 0",eA,D9,O9,tA]),s>0&&(t.addDefine("CLIPPING_PLANES",void 0,ye.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",s,ye.FRAGMENT),r.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,ye.FRAGMENT),t.addFragmentLines([z9])),e._depthTest&&(t.addDefine("DEPTH_TEST",void 0,ye.FRAGMENT),t.addFragmentLines([H9]));let a=e._provider.shape;a==="BOX"?t.addFragmentLines([j9,K9,oS]):a==="CYLINDER"?t.addFragmentLines([q9,gL,J9,oS]):a==="ELLIPSOID"&&(t.addDefine("SHAPE_ELLIPSOID",void 0,ye.FRAGMENT),t.addFragmentLines([$9,gL,Q9,oS])),t.addFragmentLines([B9]);let c=e._shape,d=c.shaderDefines;for(let p in d)if(d.hasOwnProperty(p)){let g=d[p];l(g)&&(g=g===!0?void 0:g,t.addDefine(p,g,ye.FRAGMENT))}let u=c.shaderMaximumIntersectionsLength;s>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",u,ye.FRAGMENT),s===1?u+=1:r.unionClippingRegions?u+=2:u+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",u,ye.FRAGMENT),u+=1),t.addDefine("INTERSECTION_COUNT",u,ye.FRAGMENT),(!h.equals(e.paddingBefore,h.ZERO)||!h.equals(e.paddingAfter,h.ZERO))&&t.addDefine("PADDING",void 0,ye.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,ye.FRAGMENT),e._nearestSampling&&t.addDefine("NEAREST_SAMPLING",void 0,ye.FRAGMENT);let m=e._traversal;t.addDefine("SAMPLE_COUNT",`${m._sampleCount}`,ye.FRAGMENT)}var nA=hxt;var r4i=T(S(),1);function fxt(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,ye.FRAGMENT),d&&n.addDefine("STATISTICS",void 0,ye.FRAGMENT);for(let P=0;P<c;P++){let A=i[P],M=o[P],b=`PropertyStatistics_${A}`,R=`PropertyStatistics_${A}`;n.addStruct(b,R,ye.FRAGMENT);let G=D3(M);n.addStructField(b,G,"min"),n.addStructField(b,G,"max")}let u="Statistics",m="Statistics",p="statistics";n.addStruct(u,m,ye.FRAGMENT);for(let P=0;P<c;P++){let A=i[P],M=`PropertyStatistics_${A}`,b=A;n.addStructField(u,M,b)}let g="Metadata",f="Metadata",x="metadata";n.addStruct(g,f,ye.FRAGMENT),n.addStructField(g,m,p);for(let P=0;P<c;P++){let A=i[P],M=o[P],b=D3(M);n.addStructField(g,b,A)}for(let P=0;P<c;P++){let A=i[P],M=o[P],b=bxt(M),R=`VoxelProperty_${A}`,G=`VoxelProperty_${A}`;n.addStruct(R,G,ye.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,ye.FRAGMENT);for(let P=0;P<c;P++){let A=i[P],M=`VoxelProperty_${A}`;n.addStructField(_,M,A)}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"),n.addStructField(_,"int","stepCount"),n.addStructField(_,"int","tileIndex"),n.addStructField(_,"int","sampleIndex");let L="FragmentInput";n.addStruct(L,"FragmentInput",ye.FRAGMENT),n.addStructField(L,f,x),n.addStructField(L,C,V);let E="Properties",X="Properties",v="properties";n.addStruct(E,X,ye.FRAGMENT);for(let P=0;P<c;P++){let A=i[P],M=o[P],b=D3(M);n.addStructField(E,b,A)}{let P="clearProperties";n.addFunction(P,`${X} clearProperties()`,ye.FRAGMENT),n.addFunctionLines(P,[`${X} ${v};`]);for(let A=0;A<c;A++){let M=i[A],b=o[A],R=r[A],G=D3(b,R);n.addFunctionLines(P,[`${v}.${M} = ${G}(0.0);`])}n.addFunctionLines(P,[`return ${v};`])}{let P="sumProperties";n.addFunction(P,`${X} sumProperties(${X} propertiesA, ${X} propertiesB)`,ye.FRAGMENT),n.addFunctionLines(P,[`${X} ${v};`]);for(let A=0;A<c;A++){let M=i[A];n.addFunctionLines(P,[`${v}.${M} = propertiesA.${M} + propertiesB.${M};`])}n.addFunctionLines(P,[`return ${v};`])}{let P="scaleProperties";n.addFunction(P,`${X} scaleProperties(${X} ${v}, float scale)`,ye.FRAGMENT),n.addFunctionLines(P,[`${X} scaledProperties = ${v};`]);for(let A=0;A<c;A++){let M=i[A];n.addFunctionLines(P,[`scaledProperties.${M} *= scale;`])}n.addFunctionLines(P,["return scaledProperties;"])}{let P="mixProperties";n.addFunction(P,`${X} mixProperties(${X} propertiesA, ${X} propertiesB, float mixFactor)`,ye.FRAGMENT),n.addFunctionLines(P,[`${X} ${v};`]);for(let A=0;A<c;A++){let M=i[A];n.addFunctionLines(P,[`${v}.${M} = mix(propertiesA.${M}, propertiesB.${M}, mixFactor);`])}n.addFunctionLines(P,[`return ${v};`])}{let P="copyPropertiesToMetadata";n.addFunction(P,`void copyPropertiesToMetadata(in ${X} ${v}, inout ${f} ${x})`,ye.FRAGMENT);for(let A=0;A<c;A++){let M=i[A];n.addFunctionLines(P,[`${x}.${M} = ${v}.${M};`])}}if(d){let P="setStatistics";n.addFunction(P,`void setStatistics(inout ${m} ${p})`,ye.FRAGMENT);for(let A=0;A<c;A++){let M=i[A],b=o[A],R=zt.getComponentCount(b);for(let G=0;G<R;G++){let I=gxt(b,G),w=s[A][G],N=a[A][G];n.addFunctionLines(P,[`${p}.${M}.min${I} = ${ATe(w)};`,`${p}.${M}.max${I} = ${ATe(N)};`])}}}{let P="getPropertiesFromMegatextureAtUv";n.addFunction(P,`${X} getPropertiesFromMegatextureAtUv(vec2 texcoord)`,ye.FRAGMENT),n.addFunctionLines(P,[`${X} ${v};`]);for(let A=0;A<c;A++){let M=i[A],b=o[A],R=r[A],G=pxt(b,R);n.addFunctionLines(P,[`properties.${M} = texture(u_megatextureTextures[${A}], texcoord)${G};`])}n.addFunctionLines(P,[`return ${v};`])}}function D3(e){if(e===zt.SCALAR)return"float";if(e===zt.VEC2)return"vec2";if(e===zt.VEC3)return"vec3";if(e===zt.VEC4)return"vec4"}function pxt(e){if(e===zt.SCALAR)return".r";if(e===zt.VEC2)return".ra";if(e===zt.VEC3)return".rgb";if(e===zt.VEC4)return""}function bxt(e){if(e===zt.SCALAR)return"vec3";if(e===zt.VEC2)return"mat2";if(e===zt.VEC3)return"mat3";if(e===zt.VEC4)return"mat4"}function ATe(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function gxt(e,t){return e===zt.SCALAR?"":`[${t}]`}var iA=fxt;function yxt(e,t){let n=new nA(e);iA(n,e);let{shaderBuilder:i,clippingPlanes:o,clippingPlanesLength:r}=n;if(r>0){let C="getClippingPlane",V=$0(o,t),L=0,Z=V.indexOf(")")+1,E=V.indexOf("{",Z)+1,X=V.indexOf("}",E),v=V.slice(L,Z),P=V.slice(E,X);i.addFunction(C,v,ye.FRAGMENT),i.addFunctionLines(C,[P])}let s=i.clone();s.addDefine("PICKING",void 0,ye.FRAGMENT);let a=i.clone();a.addDefine("PICKING_VOXEL",void 0,ye.FRAGMENT);let c=i.buildShaderProgram(t),d=s.buildShaderProgram(t),u=a.buildShaderProgram(t),m=Ue.fromCache({cull:{enabled:!0,face:yi.BACK},depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND}),p=t.getViewportQuadVertexArray(),g=e._depthTest,f=new tt({vertexArray:p,primitiveType:Fe.TRIANGLES,renderState:m,shaderProgram:c,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:Re.VOXELS,executeInClosestFrustum:!0,owner:this,cull:g,occlude:g}),x=tt.shallowClone(f,new tt);x.shaderProgram=d,x.pickOnly=!0;let _=tt.shallowClone(f,new tt);if(_.shaderProgram=u,_.pickOnly=!0,l(e._drawCommand)){let C=e._drawCommand;C.shaderProgram=C.shaderProgram&&C.shaderProgram.destroy()}if(l(e._drawCommandPick)){let C=e._drawCommandPick;C.shaderProgram=C.shaderProgram&&C.shaderProgram.destroy()}if(l(e._drawCommandPickVoxel)){let C=e._drawCommandPickVoxel;C.shaderProgram=C.shaderProgram&&C.shaderProgram.destroy()}e._drawCommand=f,e._drawCommandPick=x,e._drawCommandPickVoxel=_}var oA=yxt;var z4i=T(S(),1);var G4i=T(S(),1);function sm(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.dimensions=h.clone(s),this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new Gn,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(r)}var xxt=new h;sm.prototype.computeBoundingVolumes=function(e){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let t=$.getScale(this.orientedBoundingBox.halfAxes,xxt),n=2*h.maximumComponent(t);this.approximateVoxelSize=n/h.minimumComponent(this.dimensions)};sm.prototype.constructChildNodes=function(e){let{level:t,x:n,y:i,z:o}=this,r=n*2,s=i*2,a=o*2,c=s+1,d=r+1,u=a+1,m=t+1,p=[[m,r,s,a],[m,d,s,a],[m,r,c,a],[m,d,c,a],[m,r,s,u],[m,d,s,u],[m,r,c,u],[m,d,c,u]];this.children=p.map(([g,f,x,_])=>new sm(g,f,x,_,this,e,this.dimensions))};sm.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};sm.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 MTe={keyframe:0};function rA(e,t){return MTe.keyframe=e,Go(t,MTe,Ki.searchComparator)}sm.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=_xt(i,m),g=m[p],f=o===i||i<g.keyframe?p:Math.min(p+1,m.length-1),x=m[f],_=i-g.keyframe,C=NTe(n-t.level,_);C<a&&(a=C,r=g);let V=x.keyframe-o,L=NTe(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 _xt(e,t){let n=rA(e,t);return n<0?W.clamp(~n-1,0,t.length-1):n}function NTe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}sm.prototype.isVisited=function(e){return this.visitedFrameNumber===e};sm.prototype.createKeyframeNode=function(e){let t=rA(e,this.keyframeNodes);if(t<0){t=~t;let n=new Ki(this,e);this.keyframeNodes.splice(t,0,n)}};sm.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=rA(n,this.keyframeNodes);if(i<0)throw new pe("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=rA(n,this.renderableKeyframeNodes);if(o<0)throw new pe("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(o,1)}e.spatialNode=void 0,e.state=Ki.LoadState.UNLOADED,e.metadata={},e.megatextureIndex=-1,e.priority=-Number.MAX_VALUE,e.highPriorityFrameNumber=-1};sm.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.state!==Ki.LoadState.RECEIVED||e.megatextureIndex!==-1||e.metadata.length!==t.length)throw new pe("Keyframe node cannot be added to megatexture");for(let o=0;o<t.length;o++){let r=t[o];e.megatextureIndex=r.add(e.metadata[o])}e.state=Ki.LoadState.LOADED;let n=this.renderableKeyframeNodes,i=rA(e.keyframe,n);if(i>=0)throw new pe("Keyframe already renderable");i=~i,n.splice(i,0,e)};sm.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 sA=sm;function pb(e,t,n,i,o,r,s){this._primitive=e,this.megatextures=new Array(i.length);for(let f=0;f<i.length;f++){let x=i[f],_=zt.getComponentCount(x),C=o[f];this.megatextures[f]=new uL(t,n,_,C,s)}let a=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._frameNumber=0;let c=e._shape;this.rootNode=new sA(0,0,0,0,void 0,c,n),this._priorityQueue=new yT({maximumLength:a,comparator:Ki.priorityComparator}),this._highPriorityKeyframeNodes=new Array(a),this._keyframeNodesInMegatexture=new Array(a),this._keyframeCount=r,this._sampleCount=void 0,this._keyframeLocation=0,this._binaryTreeKeyframeWeighting=new Array(r);let d=this._binaryTreeKeyframeWeighting;d[0]=0,d[r-1]=0,I7(d,1,r-2,0);let u=9,m=2048,p=Math.floor(m/u),g=Math.ceil(a/p);this.internalNodeTexture=new Ft({context:t,pixelFormat:at.RGBA,pixelDatatype:nt.UNSIGNED_BYTE,flipY:!1,width:m,height:g,sampler:new $t({minificationFilter:qt.NEAREST,magnificationFilter:ui.NEAREST})}),this.internalNodeTilesPerRow=p,this.internalNodeTexelSizeUv=new D(1/m,1/g),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new D}pb.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function I7(e,t,n,i){if(t>n)return;let o=Math.floor((t+n)/2);e[o]=i,I7(e,t,o-1,i+1),I7(e,o+1,n,i+1)}pb.simultaneousRequestCountMaximum=50;pb.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 Ft({context:r,pixelFormat:at.RGBA,pixelDatatype:nt.UNSIGNED_BYTE,flipY:!1,width:1024,height:L,sampler:new $t({minificationFilter:qt.NEAREST,magnificationFilter:ui.NEAREST})}),this.leafNodeTexelSizeUv=D.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&&kTe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let g=_i();Cxt(this,e);let f=_i();Rxt(this,m,c);let x=_i();if(this._debugPrint){let _=f-g,C=x-f,V=x-g;Lxt(this,_,C,V)}};pb.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};pb.prototype.isDestroyed=function(){return!1};pb.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(),me(this)};function kTe(e,t){if(t.computeBoundingVolumes(e._primitive._shape),l(t.children))for(let n=0;n<8;n++){let i=t.children[n];kTe(e,i)}}function Txt(e,t){if(e._simultaneousRequestCount>=pb.simultaneousRequestCountMaximum)return;let n=e._primitive._provider;function i(c){e._simultaneousRequestCount--;let d=n.types.length;if(!l(c))t.state=Ki.LoadState.UNAVAILABLE;else if(c===Ki.LoadState.FAILED)t.state=Ki.LoadState.FAILED;else if(!Array.isArray(c)||c.length!==d)t.state=Ki.LoadState.FAILED;else{let u=e.megatextures;for(let m=0;m<d;m++){let{voxelCountPerTile:p,channelCount:g}=u[m],{x:f,y:x,z:_}=p,C=f*x*_,V=c[m],L=C*g;if(V.length===L)t.metadata[m]=V,t.state=Ki.LoadState.RECEIVED;else{t.state=Ki.LoadState.FAILED;break}}}}function o(){e._simultaneousRequestCount--,t.state=Ki.LoadState.FAILED}let{keyframe:r,spatialNode:s}=t,a=n.requestData({tileLevel:s.level,tileX:s.x,tileY:s.y,tileZ:s.z,keyframe:r});l(a)?(e._simultaneousRequestCount++,t.state=Ki.LoadState.RECEIVING,a.then(i).catch(o)):t.state=Ki.LoadState.FAILED}function Sxt(e){return e/(1+e)}function Cxt(e,t){let n=e._frameNumber,i=e._primitive,o=i._shape,r=i.screenSpaceError,s=e._priorityQueue,a=e._keyframeCount,c=W.clamp(Math.floor(e._keyframeLocation),0,a-2),d=c+1,{camera:u,context:m,pixelRatio:p}=t,{positionWC:g,frustum:f}=u,_=m.drawingBufferHeight/p/f.sseDenominator;function C(M,b){if(M.computeScreenSpaceError(g,_),b=M.visibility(t,b),b===rs.MASK_OUTSIDE)return;if(M.visitedFrameNumber=n,a===1)M.createKeyframeNode(0);else if(M.keyframeNodes.length!==a)for(let N=0;N<a;N++)M.createKeyframeNode(N);let{screenSpaceError:R,keyframeNodes:G}=M,I=Sxt(R),w=!1;for(let N=0;N<G.length;N++){let B=G[N];B.priority=10*I+Vxt(c,B.keyframe,d,e),B.state!==Ki.LoadState.UNAVAILABLE&&B.state!==Ki.LoadState.FAILED&&B.priority!==-Number.MAX_VALUE&&s.insert(B),B.state===Ki.LoadState.LOADED&&(w=!0)}if(R<r||!w){M.children=void 0;return}l(M.children)||M.constructChildNodes(o);for(let N=0;N<8;N++){let B=M.children[N];C(B,b)}}s.reset(),C(e.rootNode,rs.MASK_INDETERMINATE);let V=e._highPriorityKeyframeNodes,L=0,Z;for(;s.length>0;)Z=s.removeMaximum(),Z.highPriorityFrameNumber=n,V[L]=Z,L++;let E=e._keyframeNodesInMegatexture,X=e.megatextures[0],v=X.occupiedCount;E.length=v,E.sort(function(M,b){return M.highPriorityFrameNumber===b.highPriorityFrameNumber?b.priority-M.priority:b.highPriorityFrameNumber-M.highPriorityFrameNumber});let P=0,A=0;for(let M=0;M<L;M++)if(Z=V[M],!(Z.state===Ki.LoadState.LOADED||Z.spatialNode===void 0)&&(Z.state===Ki.LoadState.UNLOADED&&Txt(e,Z),Z.state===Ki.LoadState.RECEIVED)){let b=0;if(X.isFull()){b=v-1-P,P++;let R=E[b];R.spatialNode.destroyKeyframeNode(R,e.megatextures)}else b=v+A,A++;Z.spatialNode.addKeyframeNodeToMegatextures(Z,e.megatextures),E[b]=Z}}function Vxt(e,t,n,i){let o=Math.min(Math.abs(t-e),Math.abs(t-n)),r=Math.max(e,i._keyframeCount-n-1,1),s=Math.pow(1-o/r,4),a=Math.exp(-i._binaryTreeKeyframeWeighting[t]);return W.lerp(a,s,.15+.85*s)}function Lxt(e,t,n,i){let o=e._keyframeCount,r=e.rootNode,s=Object.keys(Ki.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],E=Z.keyframe,X=Z.state;a[X][E]+=1,c[X]+=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[Ki.LoadState.LOADED]}`,p=`UNLOADED: ${c[Ki.LoadState.UNLOADED]} | RECEIVING: ${c[Ki.LoadState.RECEIVING]} | RECEIVED: ${c[Ki.LoadState.RECEIVED]} | LOADED: ${c[Ki.LoadState.LOADED]} | FAILED: ${c[Ki.LoadState.FAILED]} | UNAVAILABLE: ${c[Ki.LoadState.UNAVAILABLE]} | TOTAL: ${d}`,g=Math.round(t*100)/100,f=Math.round(n*100)/100,x=Math.round(i*100)/100,_=`LOAD: ${g} | OCT: ${f} | ALL: ${x}`;console.log(`${m} || ${p} || ${_}`)}var B3={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function Rxt(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(g,f,x,_,C){let V=!1;if(l(g.children))for(let L=0;L<8;L++){let Z=g.children[L];Z.computeSurroundingRenderableKeyframeNodes(o),Z.isRenderable(r)&&(V=!0)}if(V){d[C]=B3.INTERNAL<<16|f,d[x]=_,a++,_=f,C=_*9+1;for(let L=0;L<8;L++){let Z=g.children[L];f=a,x=f*9+0,m(Z,f,x,_,C+L)}}else{if(s){let L=c*5,Z=g.renderableKeyframeNodePrevious,E=g.level-Z.spatialNode.level,X=Z.spatialNode.parent,v=l(X)?X.renderableKeyframeNodePrevious:Z,P=Zxt(g,i,n),A=E,M=1,b=Z.megatextureIndex,R=v.megatextureIndex;u[L+0]=P,u[L+1]=A,u[L+2]=M,u[L+3]=b,u[L+4]=R,d[C]=B3.LEAF<<16|c}else{let L=g.renderableKeyframeNodePrevious,E=g.level-L.spatialNode.level===0?B3.LEAF:B3.PACKED_LEAF_FROM_PARENT;d[C]=E<<16|L.megatextureIndex}c++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(o),p.isRenderable(r)&&m(p,0,0,0,0),Gxt(d,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&Ext(u,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function Zxt(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 Gxt(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],g=m*o;for(let f=0;f<o;f++)c[g+f]=p>>>f*8&255}let u={source:{arrayBufferView:c,width:s,height:a},xOffset:0,yOffset:0};i.copyFrom(u)}function Ext(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 g=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*g),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)}pb.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=zt.getComponentCount(a);o+=uL.getApproximateTextureMemoryByteLength(e,t,d,c)}return o};var yL=pb;var bji=T(S(),1);var J4i=T(S(),1),Xxt={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"},xL=Object.freeze(Xxt);var sji=T(S(),1);function _L(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}_L.prototype.getTexture=function(e){return this._textures[e]};function Ixt(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})}_L.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):Ixt(this,e,t)};function Wxt(e,t,n){let{id:i,textureUniform:o,image:r}=t,s=n.webgl2?Y3(o,r,n):Pxt(o,r,n),a=e._textures[i];l(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function Y3(e,t,n){let{typedArray:i,sampler:o}=e,r=l(i)?DTe(e,n):new Ft({context:n,source:t,sampler:o});return UTe(o)&&r.generateMipmap(),r}function Pxt(e,t,n){let{typedArray:i,sampler:o}=e,r=UTe(o),s=o.wrapS===Cn.REPEAT||o.wrapS===Cn.MIRRORED_REPEAT||o.wrapT===Cn.REPEAT||o.wrapT===Cn.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===nt.UNSIGNED_BYTE){let m=uw(i,a,c),p=eg(m);return Y3({sampler:o},p,n)}}else{let m=eg(t);return Y3(e,m,n)}else return Y3(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."),DTe(e,n)}function UTe(e){return[qt.NEAREST_MIPMAP_NEAREST,qt.NEAREST_MIPMAP_LINEAR,qt.LINEAR_MIPMAP_NEAREST,qt.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function DTe(e,t){let{pixelFormat:n,pixelDatatype:i,width:o,height:r,typedArray:s,sampler:a}=e;return new Ft({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:s,width:o,height:r},sampler:a,flipY:!1})}_L.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];Wxt(this,o,t)}n.length=0};_L.prototype.isDestroyed=function(){return!1};_L.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 me(this)};var aA=_L;function cA(e){e=y(e,y.EMPTY_OBJECT),this.mode=y(e.mode,n0.MODIFY_MATERIAL),this.lightingModel=e.lightingModel,this.uniforms=y(e.uniforms,y.EMPTY_OBJECT),this.varyings=y(e.varyings,y.EMPTY_OBJECT),this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=y(e.translucencyMode,bg.INHERIT),this._textureManager=new aA,this._defaultTexture=void 0,this.uniformMap=vxt(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},Axt(this),Mxt(this)}function vxt(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let o=t[i];o.type===xL.SAMPLER_2D?(e._textureManager.loadTexture2D(i,o.value),n[i]=wxt(e,i)):n[i]=Fxt(e,i)}return n}function wxt(e,t){return function(){return y(e._textureManager.getTexture(t),e._defaultTexture)}}function Fxt(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 Axt(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 BTe(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 Rc(e,t,n,i){if(e.hasOwnProperty(t)){let o=`${BTe(t)} is not available in the ${i} shader. Did you mean ${BTe(n)} instead?`;throw new pe(o)}}function Mxt(e){let t=e.usedVariablesVertex.attributeSet;Rc(t,"position","positionMC","vertex"),Rc(t,"normal","normalMC","vertex"),Rc(t,"tangent","tangentMC","vertex"),Rc(t,"bitangent","bitangentMC","vertex"),Rc(t,"positionWC","positionMC","vertex"),Rc(t,"positionEC","positionMC","vertex"),Rc(t,"normalEC","normalMC","vertex"),Rc(t,"tangentEC","tangentMC","vertex"),Rc(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;Rc(n,"position","positionEC","fragment"),Rc(n,"normal","normalEC","fragment"),Rc(n,"tangent","tangentEC","fragment"),Rc(n,"bitangent","bitangentEC","fragment"),Rc(n,"normalMC","normalEC","fragment"),Rc(n,"tangentMC","tangentEC","fragment"),Rc(n,"bitangentMC","bitangentEC","fragment")}cA.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===xL.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};cA.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};cA.prototype.isDestroyed=function(){return!1};cA.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),me(this)};var sS=cA;function $f(e){e=y(e,y.EMPTY_OBJECT),this._ready=!1,this._provider=y(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=F.clone(y(e.modelMatrix,F.IDENTITY)),this._exaggeratedModelMatrix=F.clone(this._modelMatrix),this._compoundModelMatrix=new F,this._compoundModelMatrixOld=new F,this._customShader=y(e.customShader,$f.DefaultCustomShader),this._customShaderCompilationEvent=new be,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=e.clock,this._transformPositionWorldToUv=new F,this._transformPositionUvToWorld=new F,this._transformDirectionWorldToLocal=new $,this._transformNormalLocalToWorld=new $,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 D,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new D,megatextureTextures:[],megatextureSliceDimensions:new D,megatextureTileDimensions:new D,megatextureVoxelSizeUv:new D,megatextureSliceSizeUv:new D,megatextureTileSizeUv:new D,dimensions:new h,paddingBefore:new h,paddingAfter:new h,transformPositionViewToUv:new F,transformPositionUvToView:new F,transformDirectionViewToLocal:new $,transformNormalLocalToWorld:new $,cameraPositionUv:new h,ndcSpaceAxisAlignedBoundingBox:new se,clippingPlanesTexture:void 0,clippingPlanesMatrix:new F,stepSize:0,pickColor:new Y},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;Nxt(this,i)}function Nxt(e,t){let{shape:n,minBounds:i=Pi.getMinBounds(n),maxBounds:o=Pi.getMaxBounds(n)}=t;e.minBounds=i,e.maxBounds=o,e.minClippingBounds=Pi.getMinBounds(n),e.maxClippingBounds=Pi.getMaxBounds(n),e._exaggeratedMinBounds=h.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=h.clone(e._maxBounds,e._exaggeratedMaxBounds),e._exaggeratedModelMatrix=F.clone(e._modelMatrix,e._exaggeratedModelMatrix),OTe(e,t);let r=Pi.getShapeConstructor(n);e._shape=new r,e._shapeVisible=HTe(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=F.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)}},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){as.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 kxt=new h,Uxt=new se,Dxt=new se,Bxt=new h,Yxt=new h,Oxt=new $,Hxt=new $,zxt=new F,Kxt=new F,Jxt=new F,Qxt=F.fromRotationTranslation($.fromUniformScale(.5,new $),new h(.5,.5,.5),new F),jxt=F.fromRotationTranslation($.fromUniformScale(2,new $),new h(-1,-1,-1),new F);$f.prototype.update=function(e){let t=this._provider;this._customShader.update(e);let n=e.context;if(!this._ready){i_t(this,t,n),e.afterRender.push(()=>(this._ready=!0,!0));return}t_t(this,e);let i=OTe(this,t),o=this._shape;if(i&&(this._shapeVisible=HTe(this,o,t),s_t(this,o)&&(this._shaderDirty=!0)),!this._shapeVisible)return;let r=a_t(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&&p_t(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),c_t(this,e)&&(this._shaderDirty=!0);let d=s.leafNodeTexture,u=this._uniforms;l(d)&&(u.octreeLeafNodeTexture=s.leafNodeTexture,u.octreeLeafNodeTexelSizeUv=D.clone(s.leafNodeTexelSizeUv,u.octreeLeafNodeTexelSizeUv),u.octreeLeafNodeTilesPerRow=s.leafNodeTilesPerRow),this._shaderDirty&&(oA(this,n),this._shaderDirty=!1);let m=n.uniformState.viewProjection,p=o.orientedBoundingBox,g=u_t(p,m,Dxt);if(g.x===1||g.y===1||g.z===-1||g.w===-1)return;u.ndcSpaceAxisAlignedBoundingBox=se.clone(g,u.ndcSpaceAxisAlignedBoundingBox);let x=n.uniformState.inverseView;u.transformPositionViewToUv=F.multiplyTransformation(this._transformPositionWorldToUv,x,u.transformPositionViewToUv);let _=n.uniformState.view;u.transformPositionUvToView=F.multiplyTransformation(_,this._transformPositionUvToWorld,u.transformPositionUvToView);let C=n.uniformState.inverseViewRotation;u.transformDirectionViewToLocal=$.multiply(this._transformDirectionWorldToLocal,C,u.transformDirectionViewToLocal),u.transformNormalLocalToWorld=$.clone(this._transformNormalLocalToWorld,u.transformNormalLocalToWorld);let V=e.camera.positionWC;u.cameraPositionUv=F.multiplyByPoint(this._transformPositionWorldToUv,V,u.cameraPositionUv),u.stepSize=this._stepSizeMultiplier;let L=e.passes.pick?this._drawCommandPick:e.passes.pickVoxel?this._drawCommandPickVoxel:this._drawCommand;L.boundingVolume=o.boundingSphere,e.commandList.push(L)};var qxt=new h,W7=new h,$xt=new he,e_t=new h;function t_t(e,t){if(e._exaggeratedMinBounds=h.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=h.clone(e._maxBounds,e._exaggeratedMaxBounds),e.shape===Pi.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}else if(e.shape===Pi.BOX){let n=h.fromElements(1,1,t.verticalExaggeration,qxt);e._exaggeratedModelMatrix=F.multiplyByScale(e._modelMatrix,n,e._exaggeratedModelMatrix),e._exaggeratedModelMatrix=F.multiplyByTranslation(e._exaggeratedModelMatrix,n_t(e,t),e._exaggeratedModelMatrix)}}function n_t(e,t){let{shapeTransform:n=F.IDENTITY,globalTransform:i=F.IDENTITY}=e._provider,o=F.getTranslation(n,W7),r=F.multiplyByPoint(e._modelMatrix,o,W7),s=F.multiplyByPoint(i,r,W7),c=ne.WGS84.cartesianToCartographic(s,$xt),d=0;l(c)&&(d=c.height);let u=br.getHeight(d,t.verticalExaggeration,t.verticalExaggerationRelativeHeight);return h.fromElements(0,0,(u-d)/t.verticalExaggeration,e_t)}function i_t(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=Y.clone(e._pickId.color,i.pickColor);let{shaderDefines:o,shaderUniforms:r}=e._shape;e._shapeDefinesOld=Ye(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(y(t.paddingBefore,h.ZERO),e._paddingBefore),i.paddingBefore=h.clone(e._paddingBefore,i.paddingBefore),e._paddingAfter=h.clone(y(t.paddingAfter,h.ZERO),e._paddingBefore),i.paddingAfter=h.clone(e._paddingAfter,i.paddingAfter),e._traversal=o_t(e,t,n),r_t(e._traversal,i)}function OTe(e,t){let n=y(t.shapeTransform,F.IDENTITY),i=y(t.globalTransform,F.IDENTITY);return F.multiplyTransformation(i,e._exaggeratedModelMatrix,e._compoundModelMatrix),F.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 HTe(e,t,n){if(!t.update(e._compoundModelMatrix,e._exaggeratedMinBounds,e._exaggeratedMaxBounds,e.minClippingBounds,e.maxClippingBounds))return!1;let o=t.shapeTransform,r=F.inverse(o,zxt),s=F.getRotation(o,Oxt),a=F.getScale(o,Bxt),c=h.maximumComponent(a),d=h.divideByScalar(a,c,Yxt),u=$.multiplyByScale(s,d,Hxt);return e._transformPositionWorldToUv=F.multiplyTransformation(Qxt,r,e._transformPositionWorldToUv),e._transformPositionUvToWorld=F.multiplyTransformation(o,jxt,e._transformPositionUvToWorld),e._transformDirectionWorldToLocal=F.getMatrix3(r,e._transformDirectionWorldToLocal),e._transformNormalLocalToWorld=$.inverseTranspose(u,e._transformNormalLocalToWorld),!0}function o_t(e,t,n){let i=h.clone(t.dimensions,kxt);h.add(i,e._paddingBefore,i),h.add(i,e._paddingAfter,i);let o=t.maximumTileCount,r=l(o)?yL.getApproximateTextureMemoryByteLength(o,i,t.types,t.componentTypes):void 0,s=y(t.keyframeCount,1);return new yL(e,n,i,t.types,t.componentTypes,s,r)}function r_t(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=D.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=D.clone(i.sliceCountPerRegion,t.megatextureSliceDimensions),t.megatextureTileDimensions=D.clone(i.regionCountPerMegatexture,t.megatextureTileDimensions),t.megatextureVoxelSizeUv=D.clone(i.voxelSizeUv,t.megatextureVoxelSizeUv),t.megatextureSliceSizeUv=D.clone(i.sliceSizeUv,t.megatextureSliceSizeUv),t.megatextureTileSizeUv=D.clone(i.regionSizeUv,t.megatextureTileSizeUv)}function s_t(e,t){let n=t.shaderDefines,i=Object.keys(n).some(o=>n[o]!==e._shapeDefinesOld[o]);return i&&(e._shapeDefinesOld=Ye(n,!0)),i}function a_t(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=q.secondsDifference(i.stop,i.start),a=q.secondsDifference(n,i.start)/r;return o+a}function c_t(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=F.transpose(F.multiplyTransformation(F.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(),me(this)};var YTe=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)),l_t=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),d_t=new Array(new se,new se,new se,new se,new se,new se,new se,new se);function u_t(e,t,n){let i=F.fromRotationTranslation(e.halfAxes,e.center,Kxt),o=F.multiply(t,i,Jxt),r=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,c=-Number.MAX_VALUE,d,u=d_t,m=YTe.length;for(d=0;d<m;d++)F.multiplyByVector(o,YTe[d],u[d]);for(d=0;d<m;d++){let p=u[d];if(p.z>=-p.w){let g=p.x/p.w,f=p.y/p.w;r=Math.min(r,g),s=Math.max(s,g),a=Math.min(a,f),c=Math.max(c,f)}else for(let g=0;g<3;g++){let f=l_t[d*3+g],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,Uxt),Z=L.x/L.w,E=L.y/L.w;r=Math.min(r,Z),s=Math.max(s,Z),a=Math.min(a,E),c=Math.max(c,E)}}}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 P7=3e7,m_t=new h(P7,0,0),h_t=new h(0,P7,0),f_t=new h(0,0,P7);function p_t(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:Ui.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)),g=[Y.RED,Y.LIME,Y.BLUE][d%3];if(r(c.orientedBoundingBox,g,m),l(c.children))for(let f=0;f<8;f++)s(c.children[f])}r(e._shape.orientedBoundingBox,Y.WHITE,5),s(n.rootNode);let a=10;o(h.ZERO,m_t,Y.RED,a),o(h.ZERO,h_t,Y.LIME,a),o(h.ZERO,f_t,Y.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 zTe(){this.ready=!0,this.shape=Pi.BOX,this.dimensions=new h(1,1,1),this.names=["data"],this.types=[zt.SCALAR],this.componentTypes=[an.FLOAT32],this.maximumTileCount=1}zTe.prototype.requestData=function(e){if(!((l(e)?y(e.tileLevel,0):0)>=1))return Promise.resolve([new Float32Array(1)])};$f.DefaultProvider=new zTe;var Wy=$f;var H3=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function fi(e){e=y(e,y.EMPTY_OBJECT);let t=e.canvas,n=e.creditContainer,i=e.creditViewport,o=Ye(e.contextOptions),r=l(n),s=new NG(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=Bn(),this._jobScheduler=new jF,this._frameState=new bF(s,new tF(n,"\u2022",i),this._jobScheduler),this._frameState.scene3DOnly=y(e.scene3DOnly,!1),this._removeCreditContainer=!r,this._creditContainer=n,this._canvas=t,this._context=s,this._computeEngine=new $L(s),this._ellipsoid=y(e.ellipsoid,ne.default),this._globe=void 0,this._globeTranslucencyState=new DF,this._primitives=new Al,this._groundPrimitives=new Al,this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=fi.defaultLogDepthBuffer&&s.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new tS,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=y(e.orderIndependentTranslucency,!0),this._executeOITFunction=void 0,this._depthPlane=new cF(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new ei({color:new Y,stencil:0,owner:this}),this._depthClearCommand=new ei({depth:1,owner:this}),this._stencilClearCommand=new ei({stencil:0}),this._classificationStencilClearCommand=new ei({stencil:0,renderState:Ue.fromCache({stencilMask:Bt.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new v9(this),this._preUpdate=new be,this._postUpdate=new be,this._renderError=new be,this._preRender=new be,this._postRender=new be,this._minimumDisableDepthTestDistance=0,this._debugInspector=new oF,this._msaaSamples=y(e.msaaSamples,4),this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new be,this.morphComplete=new be,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=Y.clone(Y.BLACK),this._mode=oe.SCENE3D,this._mapProjection=l(e.mapProjection)?e.mapProjection:new Li(this._ellipsoid),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 Mw,this.fog=new fF,this.fog.enabled=ne.WGS84.equals(this._ellipsoid),ne.WGS84.equals(this._ellipsoid)||(io.DEFAULT_VIEW_RECTANGLE=ae.fromDegrees(-45,-45,45,45)),this._shadowMapCamera=new io(this),this.shadowMap=new lb({context:s,lightCamera:this._shadowMapCamera,enabled:y(e.shadows,!1)}),this.invertClassification=!1,this.invertClassificationColor=Y.clone(Y.WHITE),this._actualInvertClassificationColor=Y.clone(this._invertClassificationColor),this._invertClassification=new lL,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new W9,this._brdfLutGenerator=new Bw,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new A9(this),this._cameraUnderground=!1,this._mapMode2D=y(e.mapMode2D,Hl.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=y(e.requestRenderMode,!1),this._renderRequested=!0,this.maximumRenderTimeChange=y(e.maximumRenderTimeChange,0),this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=Ja.requestCompletedEvent.addEventListener(H3(this)),this._removeTaskProcessorListenerCallback=bi.taskCompletedEvent.addEventListener(H3(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new Ke(0,0,s.drawingBufferWidth,s.drawingBufferHeight),c=new io(this);this._logDepthBuffer&&(c.frustum.near=.1,c.frustum.far=1e10),this.preloadFlightCamera=new io(this),this.preloadFlightCullingVolume=void 0,this._picking=new c9(this),this._defaultView=new KT(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._specularEnvironmentCubeMap=void 0,this.light=new bp,jTe(this,0,q.now()),this.updateFrameState(),this.initializeFrame()}fi.defaultLogDepthBuffer=!0;function b_t(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(H3(e))),n.push(t.terrainProviderChanged.addEventListener(H3(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(fi.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 Dt.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return Dt.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 Gm.isSupported(this._context)}},ellipsoid:{get:function(){return this._ellipsoid}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e,b_t(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===oe.SCENE2D?this.morphTo2D(0):e===oe.SCENE3D?this.morphTo3D(0):e===oe.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 io(this),l(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new dF(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,Dt.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}}});fi.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 KTe(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=lb.createReceiveDerivedCommand(s,t,n,o,c.shadows)),t.pass===Re.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))}fi.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,g=(!r||!s)&&!u;if(e.dirty=e.dirty||m||p||g,e.dirty){e.dirty=!1;let f=t.shadowState.shadowMaps;t.shadowState.shadowsEnabled&&e.castShadows&&(a.shadows=lb.createCastDerivedCommand(f,e,i,n,a.shadows)),(c||m)&&(a.logDepth=q0.createLogDepthCommand(e,n,a.logDepth),KTe(this,a.logDepth.command,i)),(u||g)&&KTe(this,e,i)}};var g_t=new em({pass:vo.RENDER}),v7=new em({pass:vo.PRELOAD}),w7=new em({pass:vo.PRELOAD_FLIGHT}),y_t=new em({pass:vo.REQUEST_RENDER_MODE_DEFER_CHECK}),JTe=new ce,F7;function x_t(e){let t=e.globe;if(e._mode===oe.SCENE3D&&l(t)&&t.show&&!e._cameraUnderground&&!e._globeTranslucencyState.translucent){let n=e.ellipsoid,i=e.frameState.minimumTerrainHeight;return JTe.radius=n.minimumRadius+i,F7=sw.fromBoundingSphere(JTe,e.camera.positionWC,F7),F7}}fi.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.pickVoxel=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function jTe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=q.clone(n,i.time)}fi.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=x_t(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof sn||this.camera.frustum instanceof Zr),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._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready?(t.specularEnvironmentMaps=this._specularEnvironmentCubeMap.texture,t.specularEnvironmentMapsMaximumLOD=this._specularEnvironmentCubeMap.maximumMipmapLevel):(t.specularEnvironmentMaps=void 0,t.specularEnvironmentMapsMaximumLOD=void 0),t.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,this._actualInvertClassificationColor=Y.clone(this.invertClassificationColor,this._actualInvertClassificationColor),lL.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};fi.prototype.isVisible=function(e,t,n){return l(e)&&(!l(e.boundingVolume)||!e.cull||t.computeVisibility(e.boundingVolume)!==Kt.OUTSIDE&&(!l(n)||!e.occlude||!e.boundingVolume.isOccluded(n)))};var O3=new F(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);O3=F.inverseTransformation(O3,O3);function __t(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!==oe.SCENE3D){c=F.multiplyByPoint(O3,c,c);let p=o.mapProjection,g=p.unproject(c);c=p.ellipsoid.cartographicToCartesian(g)}if(l(s.radius)){let p=s.radius;a=An.toWireframe(Us.createGeometry(new Us({radii:new h(p,p,p),vertexFormat:dn.FLAT_VERTEX_FORMAT}))),t._debugVolume=new En({geometryInstances:new Vt({geometry:a,modelMatrix:F.fromTranslation(c),attributes:{color:new Ht(1,0,0,1)}}),appearance:new dn({flat:!0,translucent:!1}),asynchronous:!1})}else{let p=s.halfAxes;a=An.toWireframe(xl.createGeometry(xl.fromDimensions({dimensions:new h(2,2,2),vertexFormat:dn.FLAT_VERTEX_FORMAT}))),t._debugVolume=new En({geometryInstances:new Vt({geometry:a,modelMatrix:F.fromRotationTranslation(p,c,new F),attributes:{color:new Ht(1,0,0,1)}}),appearance:new dn({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 ka(e,t,n,i,o){let r=t._frameState;if(l(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof ei){e.execute(n,i);return}e.debugShowBoundingVolume&&l(e.boundingVolume)&&__t(e,t,i,o),r.useLogDepth&&l(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let s=r.passes;if(!s.pick&&!s.pickVoxel&&!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 lA(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 qTe(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}function T_t(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+W.EPSILON12}function S_t(e,t,n,i,o){let r=e.context;K0(i,qTe,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 C_t(e,t,n,i,o){let r=e.context;K0(i,T_t,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 V_t(e,t,n,i){let o=e.context;K0(i,qTe,e.camera.positionWC);let r=i.length;for(let s=0;s<r;++s)t(i[s],e,o,n)}var L_t=new Vi,R_t=new nl,Z_t=new sn,G_t=new Zr;function M7(e,t){let{camera:n,context:i,frameState:o}=e,{uniformState:r}=i;r.updateCamera(n);let s;l(n.frustum.fov)?s=n.frustum.clone(L_t):l(n.frustum.infiniteProjectionMatrix)?s=n.frustum.clone(R_t):l(n.frustum.width)?s=n.frustum.clone(Z_t):s=n.frustum.clone(G_t),s.near=n.frustum.near,s.far=n.frustum.far,r.updateFrustum(s),r.updatePass(Re.ENVIRONMENT);let a=o.passes,c=a.pick||a.pickVoxel,d=e._environmentState,u=e._view,m=d.renderTranslucentDepthForPick,p=d.useWebVR;if(!c){let R=d.skyBoxCommand;if(l(R)&&ka(R,e,i,t),d.isSkyAtmosphereVisible&&ka(d.skyAtmosphereCommand,e,i,t),d.isSunVisible&&(d.sunDrawCommand.execute(i,t),e.sunBloom&&!p)){let G;d.useGlobeDepthFramebuffer?G=u.globeDepth.framebuffer:d.usePostProcess?G=u.sceneFramebuffer.framebuffer:G=d.originalFramebuffer,e._sunPostProcess.execute(i),e._sunPostProcess.copy(i,G),t.framebuffer=G}d.isMoonVisible&&d.moonCommand.execute(i,t)}let g;d.useOIT?(l(e._executeOITFunction)||(e._executeOITFunction=function(R,G,I,w,N){u.globeDepth.prepareColorTextures(i),u.oit.executeCommands(R,G,I,w,N)}),g=e._executeOITFunction):a.render?g=S_t:g=C_t;let f=u.frustumCommandsList,x=f.length,_=d.clearGlobeDepth,C=d.useDepthPlane,V=e._globeTranslucencyState,L=V.translucent,Z=e._view.globeTranslucencyFramebuffer,E=e._depthClearCommand,X=e._stencilClearCommand,v=e._classificationStencilClearCommand,P=e._depthPlane,A=d.usePostProcessSelected,M=n.position.z,b;for(let R=0;R<x;++R){let G=x-R-1,I=f[G];e.mode===oe.SCENE2D?(n.position.z=M-I.near+1,s.far=Math.max(1,I.far-I.near),s.near=1,r.update(o),r.updateFrustum(s)):(s.near=G!==0?I.near*e.opaqueFrustumNearOffset:I.near,s.far=I.far,r.updateFrustum(s)),E.execute(i,t),i.stencilBuffer&&X.execute(i,t),r.updatePass(Re.GLOBE);let w=I.commands[Re.GLOBE],N=I.indices[Re.GLOBE];if(L)V.executeGlobeCommands(I,ka,Z,e,t);else for(b=0;b<N;++b)ka(w[b],e,i,t);let B=u.globeDepth;if(l(B)&&d.useGlobeDepthFramebuffer&&B.executeCopyDepth(i,t),!d.renderTranslucentDepthForPick)if(r.updatePass(Re.TERRAIN_CLASSIFICATION),w=I.commands[Re.TERRAIN_CLASSIFICATION],N=I.indices[Re.TERRAIN_CLASSIFICATION],L)V.executeGlobeClassificationCommands(I,ka,Z,e,t);else for(b=0;b<N;++b)ka(w[b],e,i,t);if(_&&(E.execute(i,t),C&&P.execute(i,t)),!d.useInvertClassification||c||d.renderTranslucentDepthForPick){for(r.updatePass(Re.CESIUM_3D_TILE),w=I.commands[Re.CESIUM_3D_TILE],N=I.indices[Re.CESIUM_3D_TILE],b=0;b<N;++b)ka(w[b],e,i,t);if(N>0&&(l(B)&&d.useGlobeDepthFramebuffer&&(B.prepareColorTextures(i,_),B.executeUpdateDepth(i,t,_,B.depthStencilTexture)),!d.renderTranslucentDepthForPick))for(r.updatePass(Re.CESIUM_3D_TILE_CLASSIFICATION),w=I.commands[Re.CESIUM_3D_TILE_CLASSIFICATION],N=I.indices[Re.CESIUM_3D_TILE_CLASSIFICATION],b=0;b<N;++b)ka(w[b],e,i,t)}else{e._invertClassification.clear(i,t);let J=t.framebuffer;for(t.framebuffer=e._invertClassification._fbo.framebuffer,r.updatePass(Re.CESIUM_3D_TILE),w=I.commands[Re.CESIUM_3D_TILE],N=I.indices[Re.CESIUM_3D_TILE],b=0;b<N;++b)ka(w[b],e,i,t);for(l(B)&&d.useGlobeDepthFramebuffer&&(e._invertClassification.prepareTextures(i),B.executeUpdateDepth(i,t,_,e._invertClassification._fbo.getDepthStencilTexture())),r.updatePass(Re.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),w=I.commands[Re.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],N=I.indices[Re.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],b=0;b<N;++b)ka(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&&v.execute(i,t),r.updatePass(Re.CESIUM_3D_TILE_CLASSIFICATION),w=I.commands[Re.CESIUM_3D_TILE_CLASSIFICATION],N=I.indices[Re.CESIUM_3D_TILE_CLASSIFICATION],b=0;b<N;++b)ka(w[b],e,i,t)}for(N>0&&i.stencilBuffer&&X.execute(i,t),r.updatePass(Re.VOXELS),w=I.commands[Re.VOXELS],N=I.indices[Re.VOXELS],w.length=N,V_t(e,ka,t,w),r.updatePass(Re.OPAQUE),w=I.commands[Re.OPAQUE],N=I.indices[Re.OPAQUE],b=0;b<N;++b)ka(w[b],e,i,t);G!==0&&e.mode!==oe.SCENE2D&&(s.near=I.near,r.updateFrustum(s));let U;if(!c&&d.useInvertClassification&&o.invertClassificationColor.alpha<1&&(U=e._invertClassification),r.updatePass(Re.TRANSLUCENT),w=I.commands[Re.TRANSLUCENT],w.length=I.indices[Re.TRANSLUCENT],g(e,ka,t,w,U),I.indices[Re.CESIUM_3D_TILE_CLASSIFICATION]>0&&u.translucentTileClassification.isSupported()&&(u.translucentTileClassification.executeTranslucentCommands(e,ka,t,w,B.depthStencilTexture),u.translucentTileClassification.executeClassificationCommands(e,ka,t,I)),i.depthTexture&&e.useDepthPicking&&(d.useGlobeDepthFramebuffer||m)){let J=B.depthStencilTexture,H=e._picking.getPickDepth(e,G);H.update(i,J),H.executeCopyDepth(i,t)}if(c||!A)continue;let k=t.framebuffer;if(t.framebuffer=u.sceneFramebuffer.getIdFramebuffer(),s.near=G!==0?I.near*e.opaqueFrustumNearOffset:I.near,s.far=I.far,r.updateFrustum(s),r.updatePass(Re.GLOBE),w=I.commands[Re.GLOBE],N=I.indices[Re.GLOBE],L)V.executeGlobeCommands(I,lA,Z,e,t);else for(b=0;b<N;++b)lA(w[b],e,i,t);for(_&&(E.framebuffer=t.framebuffer,E.execute(i,t),E.framebuffer=void 0),_&&C&&P.execute(i,t),r.updatePass(Re.CESIUM_3D_TILE),w=I.commands[Re.CESIUM_3D_TILE],N=I.indices[Re.CESIUM_3D_TILE],b=0;b<N;++b)lA(w[b],e,i,t);for(r.updatePass(Re.OPAQUE),w=I.commands[Re.OPAQUE],N=I.indices[Re.OPAQUE],b=0;b<N;++b)lA(w[b],e,i,t);for(r.updatePass(Re.TRANSLUCENT),w=I.commands[Re.TRANSLUCENT],N=I.indices[Re.TRANSLUCENT],b=0;b<N;++b)lA(w[b],e,i,t);t.framebuffer=k}}function $Te(e){e.context.uniformState.updatePass(Re.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 E_t(e,t){e.context.uniformState.updatePass(Re.OVERLAY);let i=e.context,o=e._overlayCommandList,r=o.length;for(let s=0;s<r;++s)o[s].execute(i,t)}function X_t(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===Re.GLOBE||d.pass===Re.CESIUM_3D_TILE||d.pass===Re.OPAQUE||d.pass===Re.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 eSe(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;X_t(e,u,a);for(let m=0;m<d;++m){let p=a.passes[m];r.updateCamera(p.camera),a.updatePass(o,m);let g=p.commandList.length;for(let f=0;f<g;++f){let x=p.commandList[f];r.updatePass(x.pass),ka(x.derivedCommands.shadows.castCommands[s],e,o,p.passState)}}}}var I_t=new h;fi.prototype.updateAndExecuteCommands=function(e,t){let i=this._frameState.mode;this._environmentState.useWebVR?W_t(this,e,t):i!==oe.SCENE2D||this._mapMode2D===Hl.ROTATE?Py(!0,this,e,t):(N7(this,e,t),U_t(this,e))};function W_t(e,t,n){let i=e._view,o=i.camera,s=e._environmentState.renderTranslucentDepthForPick;N7(e,t,n),tSe(e),i.createPotentiallyVisibleSet(e),$Te(e),s||eSe(e);let a=t.viewport;a.x=0,a.y=0,a.width=a.width*.5;let c=io.clone(o,e._cameraVR);c.frustum=o.frustum;let d=o.frustum.near,u=d*y(e.focalLength,5),m=y(e.eyeSeparation,u/30),p=h.multiplyByScalar(c.right,m*.5,I_t);o.frustum.aspectRatio=a.width/a.height;let g=.5*m*d/u;h.add(c.position,p,o.position),o.frustum.xOffset=g,M7(e,t),a.x=a.width,h.subtract(c.position,p,o.position),o.frustum.xOffset=-g,M7(e,t),io.clone(c,o)}var P_t=new he(Math.PI,W.PI_OVER_TWO),v_t=new h,w_t=new h,F_t=new F,A_t=new F,M_t=new h,N_t=new h,k_t=new Ke;function U_t(e,t){let n=e.context,i=e.frameState,o=e.camera,r=t.viewport,s=Ke.clone(r,k_t);t.viewport=s;let a=P_t,c=v_t;e.mapProjection.project(a,c);let u=h.clone(o.position,w_t),m=F.clone(o.transform,A_t),p=o.frustum.clone();o._setTransform(F.IDENTITY);let g=F.computeViewportTransformation(s,0,1,F_t),f=o.frustum.projectionMatrix,x=o.positionWC.y,_=h.fromElements(W.sign(x)*c.x-x,0,-o.positionWC.x,M_t),C=wt.pointToGLWindowCoordinates(f,g,_,N_t);C.x=Math.floor(C.x);let V=s.x,L=s.width;if(x===0||C.x<=V||C.x>=V+L)Py(!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),Py(!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),Py(!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),Py(!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),Py(!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),Py(!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),Py(!1,e,t)}o._setTransform(m),h.clone(u,o.position),o.frustum=p.clone(),t.viewport=r}function Py(e,t,n,i){let o=t._environmentState,r=t._view,s=o.renderTranslucentDepthForPick;e||(t.frameState.commandList.length=0),tSe(t),r.createPotentiallyVisibleSet(t),e&&(l(i)&&N7(t,n,i),$Te(t),s||eSe(t)),M7(t,n)}var QTe=new rs;fi.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!==oe.SCENE2D&&t.camera.frustum instanceof sn||!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(GT.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===oe.SCENE2D);(n.useDepthPlane=d&&this.mode===oe.SCENE3D&&c.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==oe.SCENE2D&&!o;let m=e.mode===oe.SCENE3D&&!c.sunVisibleThroughGlobe?e.occluder:void 0,p=e.cullingVolume,g=QTe.planes;for(let _=0;_<5;++_)g[_]=p.planes[_];p=QTe,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._specularEnvironmentCubeMap;l(f)&&x?.url!==f?(x=x&&x.destroy(),this._specularEnvironmentCubeMap=new Gm(f)):!l(f)&&l(x)&&(x.destroy(),this._specularEnvironmentCubeMap=void 0),l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.update(e)};function D_t(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new Yf({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 B_t(e){let t=e._frameState,n=t.shadowMaps,i=n.length,o=i>0&&!t.passes.pick&&!t.passes.pickVoxel&&e.mode===oe.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 tSe(e){let t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),D_t(e),B_t(e),e._globe&&e._globe.render(t)}function N7(e,t,n){let i=e._context,o=e._frameState,r=e._environmentState,s=e._view,a=e._frameState.passes,c=a.pick||a.pickVoxel;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 k9: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;Y.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,g=r.useOIT=!c&&l(p)&&p.isSupported();g&&(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&&g){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)}fi.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 g=u;s&&!r&&(g=d);let f=this.postProcessStages,x=g.getColorTexture(0),_=m.getColorTexture(0),C=y(d,u).getDepthStencilTexture();f.execute(t,x,C,_),f.copy(t,c)}!r&&!a&&s&&(e.framebuffer=c,o.executeCopyColor(t,e))};function Y_t(e){let t=e._frameState.afterRender;for(let n=0,i=t.length;n<i;++n)t[n]()&&e.requestRender();t.length=0}function O_t(e){if(e.mode===oe.MORPHING)return;let n=e.camera.positionCartographic;return e.getHeight(n)}fi.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.enableCollision)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 A7=new he;fi.prototype.updateHeight=function(e,t,n){let i=()=>{he.clone(e,A7);let g=this.getHeight(e,n);l(g)&&(A7.height=g,t(A7))},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._ellipsoid,d=g=>{if(o||g.isDestroyed()||!g.isCesium3DTileset)return;let f=g.updateHeight(e,i,c);a[g.id]=f};if(!o){let g=this.primitives.length;for(let f=0;f<g;++f){let x=this.primitives.get(f);d(x)}}let u=this.primitives.primitiveAdded.addEventListener(d),m=this.primitives.primitiveRemoved.addEventListener(g=>{g.isDestroyed()||!g.isCesium3DTileset||(l(a[g.id])&&a[g.id](),delete a[g.id])});return()=>{s=s&&s(),Object.values(a).forEach(g=>g()),a={},u(),m()}};function H_t(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===oe.SCENE2D||n===oe.MORPHING)return!1;let r=e._globeHeight;return l(r)&&o.height<r}fi.prototype.initializeFrame=function(){if(this._shaderFrameCount++===120&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._globeHeightDirty){l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),this._globeHeight=O_t(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=H_t(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function z_t(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 ab({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 K_t(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 J_t(e){let t=e._frameState;e.primitives.postPassesUpdate(t),Ja.update()}var Q_t=new Y;function j_t(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=g_t;let r=y(e.backgroundColor,Y.BLACK);e._hdr&&(r=Y.clone(r,Q_t),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 bp?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=Ke.clone(a,c.viewport),l(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(c,r),e.resolveFramebuffers(c),c.framebuffer=void 0,E_t(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function cS(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function q_t(e){return e._picking.updateMostDetailedRayPicks(e)}fi.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,l(e)||(e=q.now());let n=this._view.checkForCameraUpdates(this);n&&(this._globeHeightDirty=!0);let i=!this.requestRenderMode||this._renderRequested||n||this._logDepthBufferDirty||this._hdrDirty||this.mode===oe.MORPHING;if(!i&&l(this.maximumRenderTimeChange)&&l(this._lastRenderTime)){let o=Math.abs(q.secondsDifference(this._lastRenderTime,e));i=i||o>this.maximumRenderTimeChange}if(i){this._lastRenderTime=q.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let o=W.incrementWrap(t.frameNumber,15e6,1);jTe(this,o,e),t.newFrame=!0}cS(this,K_t),this.primitives.show&&(cS(this,q_t),cS(this,$_t),cS(this,eTt),i||cS(this,tTt)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),cS(this,j_t)),z_t(this,i),cS(this,J_t),Y_t(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};fi.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};fi.prototype.requestRender=function(){this._renderRequested=!0};fi.prototype.clampLineWidth=function(e){return Math.max(Dt.minimumAliasedLineWidth,Math.min(e,Dt.maximumAliasedLineWidth))};fi.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n)};fi.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!l(i))return;let o=i.primitive;if(!(o instanceof Wy))return;let r=this._picking.pickVoxelCoordinate(this,e,t,n),s=255*r[0]+r[1],a=o._traversal.findKeyframeNode(s);if(!l(a))return;let c=255*r[2]+r[3];return U9.fromKeyframeNode(o,s,c,a)};fi.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};fi.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};fi.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function $_t(e){let t=e._frameState;v7.camera=t.camera,v7.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,v7)}function eTt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;w7.camera=e.preloadFlightCamera,w7.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,w7)}function tTt(e){e.primitives.updateForPass(e._frameState,y_t)}fi.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};fi.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};fi.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};fi.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};fi.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};fi.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};fi.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};fi.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};fi.prototype.cartesianToCanvasCoordinates=function(e,t){return Yi.worldToWindowCoordinates(this,e,t)};fi.prototype.completeMorph=function(){this._transitioner.completeMorph()};fi.prototype.morphTo2D=function(e){e=y(e,2),this._transitioner.morphTo2D(e,this._ellipsoid)};fi.prototype.morphToColumbusView=function(e){e=y(e,2),this._transitioner.morphToColumbusView(e,this._ellipsoid)};fi.prototype.morphTo3D=function(e){e=y(e,2),this._transitioner.morphTo3D(e,this._ellipsoid)};function nTt(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()})}fi.prototype.setTerrain=function(e){return nTt(this,e),e};fi.prototype.isDestroyed=function(){return!1};fi.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,l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),me(this)};var dA=fi;var k7i=T(S(),1);function TL(e){e=y(e,ne.WGS84),this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=h.multiplyByScalar(e.radii,t,new h);this._scaleMatrix=F.fromScale(n),this._modelMatrix=new F,this._command=new tt({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(TL.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});TL.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var k7=new F;TL.prototype.update=function(e,t){if(!this.show)return;let n=e.mode;if(n!==oe.SCENE3D&&n!==oe.MORPHING||!e.passes.render)return;let i=F.fromRotationTranslation(e.context.uniformState.inverseViewRotation,h.ZERO,k7),o=F.multiplyTransformation(i,Xo.Y_UP_TO_Z_UP,k7),r=F.multiply(this._scaleMatrix,o,k7);F.clone(r,this._modelMatrix);let s=e.context,a=iTt(this),c=e.globeTranslucencyState.translucent,d=this.perFragmentAtmosphere||c||!l(t)||!t.show,u=this._command;if(!l(u.vertexArray)){let p=Us.createGeometry(new Us({radii:new h(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:Pe.POSITION_ONLY}));u.vertexArray=mi.fromGeometry({context:s,geometry:p,attributeLocations:An.createAttributeLocations(p),bufferUsage:Me.STATIC_DRAW}),u.renderState=Ue.fromCache({cull:{enabled:!0,face:yi.FRONT},blending:un.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 g=new Oe({defines:p,sources:[J0,NV,Ew]}),f=new Oe({defines:p,sources:[J0,NV,Gw]});this._spSkyAtmosphere=rn.fromCache({context:s,vertexShaderSource:g,fragmentShaderSource:f}),u.shaderProgram=this._spSkyAtmosphere}return u};function iTt(e){return!(W.equalsEpsilon(e.hueShift,0,W.EPSILON7)&&W.equalsEpsilon(e.saturationShift,0,W.EPSILON7)&&W.equalsEpsilon(e.brightnessShift,0,W.EPSILON7))}TL.prototype.isDestroyed=function(){return!1};TL.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),me(this)};var uA=TL;var l6i=T(S(),1);function CL(e){this.sources=e.sources,this._sources=void 0,this.show=y(e.show,!0),this._command=new tt({modelMatrix:F.clone(F.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0}CL.prototype.update=function(e,t){let n=this,{mode:i,passes:o,context:r}=e;if(!this.show||i!==oe.SCENE3D&&i!==oe.MORPHING||!o.render)return;if(this._sources!==this.sources){this._sources=this.sources;let a=this.sources;typeof a.positiveX=="string"?YG(r,this._sources).then(function(c){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=c}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new Sa({context:r,source:a}))}let s=this._command;if(!l(s.vertexArray)){s.uniformMap={u_cubeMap:function(){return n._cubeMap}};let a=xl.createGeometry(xl.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Pe.POSITION_ONLY})),c=this._attributeLocations=An.createAttributeLocations(a);s.vertexArray=mi.fromGeometry({context:r,geometry:a,attributeLocations:c,bufferUsage:Me.STATIC_DRAW}),s.renderState=Ue.fromCache({blending:un.ALPHA_BLEND})}if(!l(s.shaderProgram)||this._useHdr!==t){let a=new Oe({defines:[t?"HDR":""],sources:[Xw]});s.shaderProgram=rn.fromCache({context:r,vertexShaderSource:Iw,fragmentShaderSource:a,attributeLocations:this._attributeLocations}),this._useHdr=t}if(l(this._cubeMap))return s};CL.prototype.isDestroyed=function(){return!1};CL.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(),me(this)};function SL(e){return nn(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}CL.createEarthSkyBox=function(){return new CL({sources:{positiveX:SL("px"),negativeX:SL("mx"),positiveY:SL("py"),negativeY:SL("my"),positiveZ:SL("pz"),negativeZ:SL("mz")}})};var mA=CL;var f6i=T(S(),1);function U7(e){e=y(e,1),this._radius=y(e,1)}Object.defineProperties(U7.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});U7.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 D7=U7;var g6i=T(S(),1);function hA(){}hA.prototype.evaluate=function(e,t){pe.throwInstantiationError()};hA.prototype.evaluateColor=function(e,t){pe.throwInstantiationError()};hA.prototype.getShaderFunction=function(e,t,n,i){pe.throwInstantiationError()};hA.prototype.getVariables=function(){pe.throwInstantiationError()};var B7=hA;var H6i=T(S(),1);function pA(){this.show=!0,this._drawCommand=new tt({primitiveType:Fe.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(pA.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var oTt=new D,rTt=new D,sTt=new se,fA=new se;pA.prototype.update=function(e,t,n){if(!this.show)return;let i=e.mode;if(i===oe.SCENE2D||i===oe.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 E=n?o.halfFloatingPointTexture?nt.HALF_FLOAT:nt.FLOAT:nt.UNSIGNED_BYTE;this._texture=new Ft({context:o,width:Z,height:Z,pixelFormat:at.RGBA,pixelDatatype:E}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let X=this,v={u_radiusTS:function(){return X._radiusTS}};this._commands.computeCommand=new um({fragmentShaderSource:Pw,outputTexture:this._texture,uniformMap:v,persists:!1,owner:this,postExecute:function(){X._commands.computeCommand=void 0}})}let a=this._drawCommand;if(!l(a.vertexArray)){let Z={direction:0},E=new Uint8Array(4*2);E[0]=0,E[1]=0,E[2]=255,E[3]=0,E[4]=255,E[5]=255,E[6]=0,E[7]=255;let X=yt.createVertexBuffer({context:o,typedArray:E,usage:Me.STATIC_DRAW}),v=[{index:Z.direction,vertexBuffer:X,componentsPerAttribute:2,normalize:!0,componentDatatype:Q.UNSIGNED_BYTE}],P=yt.createIndexBuffer({context:o,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Me.STATIC_DRAW,indexDatatype:Ae.UNSIGNED_SHORT});a.vertexArray=new mi({context:o,attributes:v,indexBuffer:P}),a.shaderProgram=rn.fromCache({context:o,vertexShaderSource:vw,fragmentShaderSource:Ww,attributeLocations:Z}),a.renderState=Ue.fromCache({blending:un.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===oe.SCENE3D?ce.clone(u,a.boundingVolume):i===oe.COLUMBUS_VIEW&&ce.clone(m,a.boundingVolume);let p=Yi.computeActualEllipsoidPosition(e,c,fA),g=h.magnitude(h.subtract(p,e.camera.position,fA)),f=o.uniformState.projection,x=sTt;x.x=0,x.y=0,x.z=-g,x.w=1;let _=F.multiplyByVector(f,x,fA),C=Yi.clipToGLWindowCoordinates(t.viewport,_,oTt);x.x=W.SOLAR_RADIUS;let V=F.multiplyByVector(f,x,fA),L=Yi.clipToGLWindowCoordinates(t.viewport,V,rTt);return this._size=D.magnitude(D.subtract(L,C,fA)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};pA.prototype.isDestroyed=function(){return!1};pA.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(),me(this)};var bA=pA;var j6i=T(S(),1);function VL(e){this._ready=!1,this._provider=void 0,this._errorEvent=new be,this._readyEvent=new be,cTt(this,e)}Object.defineProperties(VL.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}}});VL.fromWorldTerrain=function(e){return new VL(LT(e))};VL.fromWorldBathymetry=function(e){return new VL(lw(e))};function aTt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function cTt(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){aTt(e._errorEvent,i)}}var gA=VL;var eqi=T(S(),1);function LL(){}LL.prototype.boundingVolume=void 0;LL.prototype.boundingSphere=void 0;LL.prototype.distanceToCamera=function(e){pe.throwInstantiationError()};LL.prototype.intersectPlane=function(e){pe.throwInstantiationError()};LL.prototype.createDebugVolume=function(e){pe.throwInstantiationError()};var Y7=LL;var aqi=T(S(),1);function yA(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Di({ellipsoid:e.ellipsoid}),this._color=y(e.color,Y.YELLOW),this._errorEvent=new be,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(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(yA.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}}});yA.prototype.getTileCredits=function(e,t,n){};yA.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)};yA.prototype.pickFeatures=function(e,t,n,i,o){};var xA=yA;var dqi=T(S(),1);function O7(e){pe.throwInstantiationError()}O7.prototype.isReady=pe.throwInstantiationError;O7.prototype.shouldDiscardImage=pe.throwInstantiationError;var H7=O7;var mqi=T(S(),1),lTt={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3},z7=Object.freeze(lTt);var Xqi=T(S(),1);function dS(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.modelMatrix=F.clone(y(e.modelMatrix,F.IDENTITY)),this.shadows=y(e.shadows,_n.ENABLED),this.maximumMemoryUsage=y(e.maximumMemoryUsage,256),this.shading=new sf(e.shading),this.style=e.style,this.frameFailed=new be,this.frameChanged=new be,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new Kp,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(dS.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){as.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function dTt(e){return`uniform vec4 czm_pickColor;
${e}`}function uTt(e){return function(t){return _t(t,{czm_pickColor:function(){return e._pickId.color}})}}function mTt(){return"czm_pickColor"}dS.prototype.makeStyleDirty=function(){this._styleDirty=!0};dS.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var hTt=new q;function J7(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function lS(e,t){return e._intervals.indexOf(t.start)}function fTt(e,t){let n=e._intervals,i=e._clock,o=J7(e);if(o===0)return;let r=e._getAverageLoadTime(),s=q.addSeconds(i.currentTime,r*o,hTt),a=n.indexOf(s),c=lS(e,t);return a===c&&(o>=0?++a:--a),n.get(a)}function pTt(e){let t=e._intervals,i=e._clock.currentTime,o=t.indexOf(i);return t.get(o)}function bTt(e,t,n){let i=J7(e),o=lS(e,t),r=lS(e,n);return i>=0?o>=r:o<=r}function iSe(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 gTt(e,t,n){let i=lS(e,t),o=e._frames,r=o[i];if(!l(r)){let s=t.data.transform,a=l(s)?F.fromArray(s):void 0,c=t.data.uri;r={pointCloud:void 0,transform:a,timestamp:_i(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:c},o[i]=r,Ee.fetchArrayBuffer({url:c}).then(function(d){r.pointCloud=new u9({arrayBuffer:d,cull:!0,fragmentShaderLoaded:dTt,uniformMapLoaded:uTt(e),pickIdLoaded:mTt})}).catch(iSe(e,c))}return r}function yTt(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 xTt(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(oSe(e,t,n,i),o.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=o.geometryByteLength,r.length=s,t.sequential)){let a=(_i()-t.timestamp)/1e3;yTt(e,a)}}t.touchedFrameNumber=i.frameNumber}var _Tt=new F;function TTt(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 STt(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var CTt=new sf;function oSe(e,t,n,i){let o=y(e.shading,CTt),r=t.pointCloud,s=y(t.transform,F.IDENTITY);r.modelMatrix=F.multiplyTransformation(e.modelMatrix,s,_Tt),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=TTt(e,r),r.geometricErrorScale=o.geometricErrorScale,r.maximumAttenuation=STt(e);try{r.update(i)}catch(a){iSe(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function K7(e,t,n,i){let o=gTt(e,t,i);xTt(e,o,n,i)}function VTt(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function rSe(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 LTt(e,t){let n=lS(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function nSe(e,t,n,i,o){return l(n)?n.ready?!0:(K7(e,t,i,o),n.ready):!1}function RTt(e,t,n,i,o){let r,s,a,c=e._intervals,d=e._frames,u=lS(e,n),m=lS(e,t);if(u>=m){for(r=u;r>=m;--r)if(s=c.get(r),a=d[r],nSe(e,s,a,i,o))return s}else for(r=u;r<=m;++r)if(s=c.get(r),a=d[r],nSe(e,s,a,i,o))return s;return t}function ZTt(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 RL={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};dS.prototype.update=function(e){if(e.mode===oe.MORPHING||!this.show)return;l(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),l(this._loadTimestamp)||(this._loadTimestamp=q.clone(e.time));let t=Math.max(q.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)&&ZTt(this,o,s),RL.timeSinceLoad=t,RL.isClipped=r;let a=this.shading,c=this._pointCloudEyeDomeLighting,d=e.commandList,u=d.length,m=this._previousInterval,p=this._nextInterval,g=pTt(this);if(!l(g))return;let f=!1,x=J7(this),_=x===0;x!==this._clockMultiplier&&(f=!0,this._clockMultiplier=x),(!l(m)||_)&&(m=g),(!l(p)||f||bTt(this,g,p))&&(p=fTt(this,g)),m=RTt(this,m,g,RL,e);let C=LTt(this,m);l(C)||(K7(this,m,RL,e),C=this._lastRenderedFrame),l(C)&&oSe(this,C,RL,e),l(p)&&K7(this,p,RL,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&&rSe(this,VTt(e));let X=d.length-u;l(a)&&a.attenuation&&a.eyeDomeLighting&&X>0&&c.update(e,u,a,this.boundingSphere)};dS.prototype.isDestroyed=function(){return!1};dS.prototype.destroy=function(){return rSe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),me(this)};var ZL=dS;var Dqi=T(S(),1);function z3(e,t){this.show=!0,l(e)||(e=new Ke),this.rectangle=Ke.clone(e),l(t)||(t=Ui.fromType(Ui.ColorType,{color:new Y(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}z3.prototype.update=function(e){if(!this.show)return;let t=this._rs;if((!l(t)||!Ke.equals(t.viewport,this.rectangle))&&(this._rs=Ue.fromCache({blending:un.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,ww]});this._overlayCommand=i.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=Re.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};z3.prototype.isDestroyed=function(){return!1};z3.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),me(this)};var Q7=z3;var Oqi=T(S(),1);function j7(){pe.throwInstantiationError()}Object.defineProperties(j7.prototype,{globalTransform:{get:pe.throwInstantiationError},shapeTransform:{get:pe.throwInstantiationError},shape:{get:pe.throwInstantiationError},minBounds:{get:pe.throwInstantiationError},maxBounds:{get:pe.throwInstantiationError},dimensions:{get:pe.throwInstantiationError},paddingBefore:{get:pe.throwInstantiationError},paddingAfter:{get:pe.throwInstantiationError},names:{get:pe.throwInstantiationError},types:{get:pe.throwInstantiationError},componentTypes:{get:pe.throwInstantiationError},minimumValues:{get:pe.throwInstantiationError},maximumValues:{get:pe.throwInstantiationError},maximumTileCount:{get:pe.throwInstantiationError},keyframeCount:{get:pe.throwInstantiationError},timeIntervalCollection:{get:pe.throwInstantiationError}});j7.prototype.requestData=pe.throwInstantiationError;var q7=j7;var Kqi=T(S(),1);function uS(){pe.throwInstantiationError()}Object.defineProperties(uS.prototype,{orientedBoundingBox:{get:pe.throwInstantiationError},boundingSphere:{get:pe.throwInstantiationError},boundTransform:{get:pe.throwInstantiationError},shapeTransform:{get:pe.throwInstantiationError},shaderUniforms:{get:pe.throwInstantiationError},shaderDefines:{get:pe.throwInstantiationError},shaderMaximumIntersectionsLength:{get:pe.throwInstantiationError}});uS.prototype.update=pe.throwInstantiationError;uS.prototype.computeOrientedBoundingBoxForTile=pe.throwInstantiationError;uS.prototype.computeOrientedBoundingBoxForSample=pe.throwInstantiationError;uS.DefaultMinBounds=pe.throwInstantiationError;uS.DefaultMaxBounds=pe.throwInstantiationError;var $7=uS;var e$i=T(S(),1);async function e6(e,t){let n=t.terrainProvider,i=t.mapProjection,o=i.ellipsoid,r,s=t.camera.getRectangleCameraCoordinates(e);if(t.mode===oe.SCENE3D?r=o.cartesianToCartographic(s):r=i.unproject(s),!l(n))return r;let a=n.availability;if(!l(a)||t.mode===oe.SCENE2D)return r;let c=[ae.center(e),ae.southeast(e),ae.southwest(e),ae.northeast(e),ae.northwest(e)],d=await e6._sampleTerrainMostDetailed(n,c),u=!1,m=d.reduce(function(g,f){return l(f.height)?(u=!0,Math.max(f.height,g)):g},-Number.MAX_VALUE),p=r;return u&&(p.height+=m),p}e6._sampleTerrainMostDetailed=RT;var mS=e6;var b$i=T(S(),1);var GTt=new Y,ETt=new Y,XTt=new Y,ITt=new Y,sSe=new se,_A=new Uint8Array(4);function aSe(e,t,n,i){let o=t.height===n.height?0:(e-t.height)/(n.height-t.height);return Y.lerp(t.color,n.color,o,i)}function K3(e,t){return{height:e,color:Y.clone(t)}}function cSe(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?Y.equals(t.color,i[n-1].color):!1,a=r?Y.equals(t.color,i[n+1].color):!1;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=o?Y.equals(t.color,i[n-1].color):!1,s=o?t.height===i[n-1].height:!0;return!r||!s}),e}function WTt(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 g=s[n],f=W.clamp(g.height,ql._minimumHeight,ql._maximumHeight),x=Y.clone(g.color,GTt);x.red*=x.alpha,x.green*=x.alpha,x.blue*=x.alpha,c.push(K3(f,x))}let d=!0,u=!0;for(n=0;n<a-1;n++){let g=c[n+0],f=c[n+1];d=d&&g.height<=f.height,u=u&&g.height>=f.height}u?c=c.reverse():d||K0(c,function(g,f){return W.sign(g.height-f.height)});let m=y(r.extendDownwards,!1),p=y(r.extendUpwards,!1);c.length===1&&!m&&!p&&(m=!0,p=!0),m&&c.splice(0,0,K3(ql._minimumHeight,c[0].color)),p&&c.splice(c.length,0,K3(ql._maximumHeight,c[c.length-1].color)),c=cSe(c),i.push(c)}return i}function PTt(e){let t=WTt(e),n=[],i=[],o;function r(d,u){n.push(K3(d,u))}function s(d,u,m){let p=Y.multiplyByScalar(m,1-u.alpha,ITt);p=Y.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,g=i.length;for(;u<p||m<g;){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<g?i[m]:void 0,V=m>0?i[m-1]:void 0,L=m<g-1?i[m+1]:void 0;if(l(f)&&l(C)&&f.height===C.height){let Z=l(L)&&C.height===L.height,E=!l(V),X=!l(L),v=l(_)&&f.height===_.height,P=!l(x),A=!l(_);Z?v?(s(f.height,f.color,C.color),s(f.height,_.color,L.color)):P?(r(f.height,C.color),s(f.height,f.color,L.color)):A?(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)):E?v?(r(f.height,f.color),s(f.height,_.color,C.color)):A?(r(f.height,f.color),r(f.height,C.color)):(P||r(f.height,f.color),s(f.height,f.color,C.color)):X?v?(s(f.height,f.color,C.color),r(f.height,_.color)):P?(r(f.height,C.color),r(f.height,f.color)):A?s(f.height,f.color,C.color):(s(f.height,f.color,C.color),r(f.height,f.color)):v?(s(f.height,f.color,C.color),s(f.height,_.color,C.color)):P?(r(f.height,C.color),s(f.height,f.color,C.color)):A?(s(f.height,f.color,C.color),r(f.height,C.color)):s(f.height,f.color,C.color),u+=v?2:1,m+=Z?2:1}else if(l(f)&&l(C)&&l(V)&&f.height<C.height){let Z=aSe(f.height,V,C,XTt);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=aSe(C.height,x,f,ETt);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,ql._emptyColor),r(C.height,ql._emptyColor)):(!l(C)&&l(V)&&!l(x)&&(r(V.height,ql._emptyColor),r(f.height,ql._emptyColor)),r(f.height,f.color)),u++):l(C)&&(!l(f)||C.height<f.height)&&(r(C.height,C.color),m++)}}return cSe(n)}function ql(e){let{scene:t,layers:n}=y(e,y.EMPTY_OBJECT),{context:i}=t,o=PTt(n),r=o.length,s,a,c;if(!ql._useFloatTexture(i)){a=nt.UNSIGNED_BYTE,c=at.RGBA,s=new Uint8Array(r*4);for(let g=0;g<r;g++)se.packFloat(o[g].height,sSe),se.pack(sSe,s,g*4)}else{a=nt.FLOAT,c=i.webgl2?at.RED:at.LUMINANCE,s=new Float32Array(r);for(let g=0;g<r;g++)s[g]=o[g].height}let u=Ft.create({context:i,pixelFormat:c,pixelDatatype:a,source:{arrayBufferView:s,width:r,height:1},sampler:new $t({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:qt.NEAREST,magnificationFilter:ui.NEAREST})}),m=new Uint8Array(r*4);for(let g=0;g<r;g++)o[g].color.toBytes(_A),m[g*4+0]=_A[0],m[g*4+1]=_A[1],m[g*4+2]=_A[2],m[g*4+3]=_A[3];let p=Ft.create({context:i,pixelFormat:at.RGBA,pixelDatatype:nt.UNSIGNED_BYTE,source:{arrayBufferView:m,width:r,height:1},sampler:new $t({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:qt.LINEAR,magnificationFilter:ui.LINEAR})});return Ui.fromType("ElevationBand",{heights:u,colors:p})}ql._useFloatTexture=function(e){return e.floatingPointTexture};ql._maximumHeight=5906376425472;ql._minimumHeight=-5906376425472;ql._emptyColor=new Y(0,0,0,0);var t6=ql;var V$i=T(S(),1);async function vTt(e,t){if(t=y(t,{}),t.cacheBytes=y(t.cacheBytes,1536*1024*1024),t.maximumCacheOverflowBytes=y(t.maximumCacheOverflowBytes,1024*1024*1024),t.enableCollision=y(t.enableCollision,!0),e=y(e,ST.defaultApiKey),!l(e))return wTt(t);let n,i=ST.getDefaultCredit();l(i)&&(n=[i]);let o=new Ee({url:`${ST.mapTilesApiEndpoint}3dtiles/root.json`,queryParameters:{key:e},credits:n});return ra.fromUrl(o,t)}var lSe={};async function wTt(e){let i=lSe[2275207];l(i)||(i=md.fromAssetId(2275207),lSe[2275207]=i);let o=await i;return ra.fromUrl(o,e)}var n6=vTt;var I$i=T(S(),1);async function FTt(e){let t=await ra.fromIonAssetId(96188,e);e=y(e,y.EMPTY_OBJECT);let n=e.style;if(!l(n)){let i=y(e.defaultColor,Y.WHITE).toCssColorString();n=new XT({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var i6=FTt;var U$i=T(S(),1);function ATt(e){e=y(e,y.EMPTY_OBJECT);let t=[],n=e.geometry;(!l(n.attributes)||!l(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,o=F.clone(y(e.modelMatrix,F.IDENTITY)),r=y(e.length,1e4);if(l(i.normal)&&t.push(new Vt({geometry:An.createLineSegmentsForVectors(n,"normal",r),attributes:{color:new Ht(1,0,0,1)},modelMatrix:o})),l(i.tangent)&&t.push(new Vt({geometry:An.createLineSegmentsForVectors(n,"tangent",r),attributes:{color:new Ht(0,1,0,1)},modelMatrix:o})),l(i.bitangent)&&t.push(new Vt({geometry:An.createLineSegmentsForVectors(n,"bitangent",r),attributes:{color:new Ht(0,0,1,1)},modelMatrix:o})),t.length>0)return new En({asynchronous:!1,geometryInstances:t,appearance:new dn({flat:!0,translucent:!1})})}var o6=ATt;var ceo=T(S(),1);function MTt(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 dSe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function uSe(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,o=dSe(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 mSe(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 hS(e,t){e=In(e),t=y(t,y.EMPTY_OBJECT);let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),o=Ot.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=o,o&&(i.style.imageRendering=Ot.imageRenderingValue()),i.oncontextmenu=function(){return!1},i.onselectstart=function(){return!1};function r(){i!==i.ownerDocument.activeElement&&i.ownerDocument.activeElement.blur()}y(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)?In(t.creditContainer):n;c.appendChild(a);let d=l(t.creditViewport)?In(t.creditViewport):n,u=y(t.showRenderLoopErrors,!0),m=y(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,uSe(this);try{let p=y(t.ellipsoid,ne.default),g=new dA({canvas:i,contextOptions:t.contextOptions,creditContainer:a,creditViewport:d,ellipsoid:p,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:y(t.scene3DOnly,!1),shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples});this._scene=g,g.camera.constrainedAxis=h.UNIT_Z,dSe(this),mSe(this);let f=t.globe;l(f)||(f=new NF(p)),f!==!1&&(g.globe=f,g.globe.shadows=y(t.terrainShadows,_n.RECEIVE_ONLY));let x=t.skyBox;!l(x)&&ne.WGS84.equals(p)&&(x=mA.createEarthSkyBox()),x!==!1&&(g.skyBox=x,g.sun=new bA,ne.WGS84.equals(p)&&(g.moon=new $F));let _=t.skyAtmosphere;!l(_)&&ne.WGS84.equals(p)&&(_=new uA(p),_.show=t.globe!==!1&&f.show),_!==!1&&(g.skyAtmosphere=_);let C=t.baseLayer;t.globe!==!1&&C!==!1&&(l(C)||(C=ha.fromWorldImagery()),g.imageryLayers.add(C)),l(t.terrainProvider)&&t.globe!==!1&&(g.terrainProvider=t.terrainProvider),l(t.terrain)&&t.globe!==!1&&g.setTerrain(t.terrain),this._screenSpaceEventHandler=new Bd(i),l(t.sceneMode)&&(t.sceneMode===oe.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===oe.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=y(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)},g.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(hS.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}},ellipsoid:{get:function(){return this._scene.ellipsoid}},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&&MTt(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)}}});hS.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 g=document.createElement("div");if(g.className="cesium-widget-errorPanel-message",a.appendChild(g),u){let f=Ff(n);d||(typeof n=="string"&&(n=new Error(n)),t=Ff({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)}g.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)};hS.prototype.isDestroyed=function(){return!1};hS.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),me(this)};hS.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,uSe(this),mSe(this),this._scene.requestRender())};hS.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};var TA=hS;var deo=T(S(),1),r6=`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 yeo=T(S(),1);function NTt(e){e=y(e,y.EMPTY_OBJECT),this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=y(e.pixelFormat,at.RGBA),this.pixelDatatype=y(e.pixelDatatype,nt.UNSIGNED_BYTE);let t=e.url;typeof t=="string"&&(t=Ee.createIfNeeded(t)),this.resource=t;let i=y(e.repeat,!0)?Cn.REPEAT:Cn.CLAMP_TO_EDGE;this.sampler=new $t({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var s6=NTt;var _eo=T(S(),1),kTt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat2",MAT4:"mat4"},a6=Object.freeze(kTt);var Ceo=T(S(),1);function UTt(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: ${Ff(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 c6=UTt;globalThis.CESIUM_VERSION="1.121.1";var ELo=T(S(),1);var rTo=T(S(),1);var tTo=T(S(),1);var H_o=T(S(),1),SA;typeof ko<"u"&&(SA=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 G;return function(){G||(G=f.a.setTimeout(function(){G=e,b()},R))}}function u(b,R){var G;return function(){clearTimeout(G),G=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 g(b,R){var G=this.qd,I=G[Z];I.ra||(this.Qb&&this.mb[R]?(G.uc(R,b,this.mb[R]),this.mb[R]=null,--this.Qb):I.I[R]||G.uc(R,b,I.J?{da:b}:G.$c(b)),b.Ja&&b.gd())}var f=typeof s<"u"?s:{};f.b=function(b,R){for(var G=b.split("."),I=f,w=0;w<G.length-1;w++)I=I[G[w]];I[G[G.length-1]]=R},f.L=function(b,R,G){b[R]=G},f.version="3.5.1",f.b("version",f.version),f.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},f.a=function(){function b(z,j){for(var ee in z)w.call(z,ee)&&j(ee,z[ee])}function R(z,j){if(j)for(var ee in j)w.call(j,ee)&&(z[ee]=j[ee]);return z}function G(z,j){return z.__proto__=j,z}function I(z,j,ee,fe){var _e=z[j].match(H)||[];f.a.D(ee.match(H),function(le){f.a.Na(_e,le,fe)}),z[j]=_e.join(" ")}var w=Object.prototype.hasOwnProperty,N={__proto__:[]}instanceof Array,B=typeof Symbol=="function",U={},O={};U[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],U.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),b(U,function(z,j){if(j.length)for(var ee=0,fe=j.length;ee<fe;ee++)O[j[ee]]=z});var k={propertychange:!0},J=n&&function(){for(var z=3,j=n.createElement("div"),ee=j.getElementsByTagName("i");j.innerHTML="<!--[if gt IE "+ ++z+"]><i></i><![endif]-->",ee[0];);return 4<z?z:e}(),H=/\S+/g,te;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(z,j,ee){for(var fe=0,_e=z.length;fe<_e;fe++)j.call(ee,z[fe],fe,z)},A:typeof Array.prototype.indexOf=="function"?function(z,j){return Array.prototype.indexOf.call(z,j)}:function(z,j){for(var ee=0,fe=z.length;ee<fe;ee++)if(z[ee]===j)return ee;return-1},Lb:function(z,j,ee){for(var fe=0,_e=z.length;fe<_e;fe++)if(j.call(ee,z[fe],fe,z))return z[fe];return e},Pa:function(z,j){var ee=f.a.A(z,j);0<ee?z.splice(ee,1):ee===0&&z.shift()},wc:function(z){var j=[];return z&&f.a.D(z,function(ee){0>f.a.A(j,ee)&&j.push(ee)}),j},Mb:function(z,j,ee){var fe=[];if(z)for(var _e=0,le=z.length;_e<le;_e++)fe.push(j.call(ee,z[_e],_e));return fe},jb:function(z,j,ee){var fe=[];if(z)for(var _e=0,le=z.length;_e<le;_e++)j.call(ee,z[_e],_e)&&fe.push(z[_e]);return fe},Nb:function(z,j){if(j instanceof Array)z.push.apply(z,j);else for(var ee=0,fe=j.length;ee<fe;ee++)z.push(j[ee]);return z},Na:function(z,j,ee){var fe=f.a.A(f.a.bc(z),j);0>fe?ee&&z.push(j):ee||z.splice(fe,1)},Ba:N,extend:R,setPrototypeOf:G,Ab:N?G:R,P:b,Ga:function(z,j,ee){if(!z)return z;var fe={},_e;for(_e in z)w.call(z,_e)&&(fe[_e]=j.call(ee,z[_e],_e,z));return fe},Tb:function(z){for(;z.firstChild;)f.removeNode(z.firstChild)},Yb:function(z){z=f.a.la(z);for(var j=(z[0]&&z[0].ownerDocument||n).createElement("div"),ee=0,fe=z.length;ee<fe;ee++)j.appendChild(f.oa(z[ee]));return j},Ca:function(z,j){for(var ee=0,fe=z.length,_e=[];ee<fe;ee++){var le=z[ee].cloneNode(!0);_e.push(j?f.oa(le):le)}return _e},va:function(z,j){if(f.a.Tb(z),j)for(var ee=0,fe=j.length;ee<fe;ee++)z.appendChild(j[ee])},Xc:function(z,j){var ee=z.nodeType?[z]:z;if(0<ee.length){for(var fe=ee[0],_e=fe.parentNode,le=0,ge=j.length;le<ge;le++)_e.insertBefore(j[le],fe);for(le=0,ge=ee.length;le<ge;le++)f.removeNode(ee[le])}},Ua:function(z,j){if(z.length){for(j=j.nodeType===8&&j.parentNode||j;z.length&&z[0].parentNode!==j;)z.splice(0,1);for(;1<z.length&&z[z.length-1].parentNode!==j;)z.length--;if(1<z.length){var ee=z[0],fe=z[z.length-1];for(z.length=0;ee!==fe;)z.push(ee),ee=ee.nextSibling;z.push(fe)}}return z},Zc:function(z,j){7>J?z.setAttribute("selected",j):z.selected=j},Db:function(z){return z===null||z===e?"":z.trim?z.trim():z.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(z,j){return z=z||"",j.length>z.length?!1:z.substring(0,j.length)===j},vd:function(z,j){if(z===j)return!0;if(z.nodeType===11)return!1;if(j.contains)return j.contains(z.nodeType!==1?z.parentNode:z);if(j.compareDocumentPosition)return(j.compareDocumentPosition(z)&16)==16;for(;z&&z!=j;)z=z.parentNode;return!!z},Sb:function(z){return f.a.vd(z,z.ownerDocument.documentElement)},kd:function(z){return!!f.a.Lb(z,f.a.Sb)},R:function(z){return z&&z.tagName&&z.tagName.toLowerCase()},Ac:function(z){return f.onError?function(){try{return z.apply(this,arguments)}catch(j){throw f.onError&&f.onError(j),j}}:z},setTimeout:function(z,j){return setTimeout(f.a.Ac(z),j)},Gc:function(z){setTimeout(function(){throw f.onError&&f.onError(z),z},0)},B:function(z,j,ee){var fe=f.a.Ac(ee);if(ee=k[j],f.options.useOnlyNativeEvents||ee||!o)if(ee||typeof z.addEventListener!="function")if(typeof z.attachEvent<"u"){var _e=function(ge){fe.call(z,ge)},le="on"+j;z.attachEvent(le,_e),f.a.K.za(z,function(){z.detachEvent(le,_e)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else z.addEventListener(j,fe,!1);else te||(te=typeof o(z).on=="function"?"on":"bind"),o(z)[te](j,fe)},Fb:function(z,j){if(!z||!z.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var ee;if(f.a.R(z)==="input"&&z.type&&j.toLowerCase()=="click"?(ee=z.type,ee=ee=="checkbox"||ee=="radio"):ee=!1,f.options.useOnlyNativeEvents||!o||ee)if(typeof n.createEvent=="function")if(typeof z.dispatchEvent=="function")ee=n.createEvent(O[j]||"HTMLEvents"),ee.initEvent(j,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,z),z.dispatchEvent(ee);else throw Error("The supplied element doesn't support dispatchEvent");else if(ee&&z.click)z.click();else if(typeof z.fireEvent<"u")z.fireEvent("on"+j);else throw Error("Browser doesn't support triggering events");else o(z).trigger(j)},f:function(z){return f.O(z)?z():z},bc:function(z){return f.O(z)?z.v():z},Eb:function(z,j,ee){var fe;j&&(typeof z.classList=="object"?(fe=z.classList[ee?"add":"remove"],f.a.D(j.match(H),function(_e){fe.call(z.classList,_e)})):typeof z.className.baseVal=="string"?I(z.className,"baseVal",j,ee):I(z,"className",j,ee))},Bb:function(z,j){var ee=f.a.f(j);(ee===null||ee===e)&&(ee="");var fe=f.h.firstChild(z);!fe||fe.nodeType!=3||f.h.nextSibling(fe)?f.h.va(z,[z.ownerDocument.createTextNode(ee)]):fe.data=ee,f.a.Ad(z)},Yc:function(z,j){if(z.name=j,7>=J)try{var ee=z.name.replace(/[&<>'"]/g,function(fe){return"&#"+fe.charCodeAt(0)+";"});z.mergeAttributes(n.createElement("<input name='"+ee+"'/>"),!1)}catch{}},Ad:function(z){9<=J&&(z=z.nodeType==1?z:z.parentNode,z.style&&(z.style.zoom=z.style.zoom))},wd:function(z){if(J){var j=z.style.width;z.style.width=0,z.style.width=j}},Pd:function(z,j){z=f.a.f(z),j=f.a.f(j);for(var ee=[],fe=z;fe<=j;fe++)ee.push(fe);return ee},la:function(z){for(var j=[],ee=0,fe=z.length;ee<fe;ee++)j.push(z[ee]);return j},Da:function(z){return B?Symbol(z):z},Zd:J===6,$d:J===7,W:J,Lc:function(z,j){for(var ee=f.a.la(z.getElementsByTagName("input")).concat(f.a.la(z.getElementsByTagName("textarea"))),fe=typeof j=="string"?function(ge){return ge.name===j}:function(ge){return j.test(ge.name)},_e=[],le=ee.length-1;0<=le;le--)fe(ee[le])&&_e.push(ee[le]);return _e},Nd:function(z){return typeof z=="string"&&(z=f.a.Db(z))?r&&r.parse?r.parse(z):new Function("return "+z)():null},hc:function(z,j,ee){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(z),j,ee)},Od:function(z,j,ee){ee=ee||{};var fe=ee.params||{},_e=ee.includeFields||this.Jc,le=z;if(typeof z=="object"&&f.a.R(z)==="form")for(var le=z.action,ge=_e.length-1;0<=ge;ge--)for(var Se=f.a.Lc(z,_e[ge]),Ie=Se.length-1;0<=Ie;Ie--)fe[Se[Ie].name]=Se[Ie].value;j=f.a.f(j);var Le=n.createElement("form");Le.style.display="none",Le.action=le,Le.method="post";for(var ke in j)z=n.createElement("input"),z.type="hidden",z.name=ke,z.value=f.a.hc(f.a.f(j[ke])),Le.appendChild(z);b(fe,function(Be,st){var vt=n.createElement("input");vt.type="hidden",vt.name=Be,vt.value=st,Le.appendChild(vt)}),n.body.appendChild(Le),ee.submitter?ee.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 G=Array.prototype.slice.call(arguments,1);return function(){var I=G.slice(0);return I.push.apply(I,arguments),R.apply(b,I)}}),f.a.g=new function(){var b=0,R="__ko__"+new Date().getTime(),G={},I,w;return f.a.W?(I=function(N,B){var U=N[R];if(!U||U==="null"||!G[U]){if(!B)return e;U=N[R]="ko"+b++,G[U]={}}return G[U]},w=function(N){var B=N[R];return B?(delete G[B],N[R]=null,!0):!1}):(I=function(N,B){var U=N[R];return!U&&B&&(U=N[R]={}),U},w=function(N){return N[R]?(delete N[R],!0):!1}),{get:function(N,B){var U=I(N,!1);return U&&U[B]},set:function(N,B,U){(N=I(N,U!==e))&&(N[B]=U)},Ub:function(N,B,U){return N=I(N,!0),N[B]||(N[B]=U)},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(B,U){var O=f.a.g.get(B,I);return O===e&&U&&(O=[],f.a.g.set(B,I,O)),O}function R(B){var U=b(B,!1);if(U)for(var U=U.slice(0),O=0;O<U.length;O++)U[O](B);f.a.g.clear(B),f.a.K.cleanExternalData(B),N[B.nodeType]&&G(B.childNodes,!0)}function G(B,U){for(var O=[],k,J=0;J<B.length;J++)if((!U||B[J].nodeType===8)&&(R(O[O.length]=k=B[J]),B[J]!==k))for(;J--&&f.a.A(O,B[J])==-1;);}var I=f.a.g.Z(),w={1:!0,8:!0,9:!0},N={1:!0,9:!0};return{za:function(B,U){if(typeof U!="function")throw Error("Callback must be a function");b(B,!0).push(U)},yb:function(B,U){var O=b(B,!1);O&&(f.a.Pa(O,U),O.length==0&&f.a.g.set(B,I,e))},oa:function(B){return f.u.G(function(){w[B.nodeType]&&(R(B),N[B.nodeType]&&G(B.getElementsByTagName("*")))}),B},removeNode:function(B){f.oa(B),B.parentNode&&B.parentNode.removeChild(B)},cleanExternalData:function(B){o&&typeof o.cleanData=="function"&&o.cleanData([B])}}},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>"],G=[3,"<table><tbody><tr>","</tr></tbody></table>"],I=[1,"<select multiple='multiple'>","</select>"],w={thead:R,tbody:R,tfoot:R,tr:[2,"<table><tbody>","</tbody></table>"],td:G,th:G,option:I,optgroup:I},N=8>=f.a.W;f.a.ua=function(B,U){var O;if(o){if(o.parseHTML)O=o.parseHTML(B,U)||[];else if((O=o.clean([B],U))&&O[0]){for(var k=O[0];k.parentNode&&k.parentNode.nodeType!==11;)k=k.parentNode;k.parentNode&&k.parentNode.removeChild(k)}}else{(O=U)||(O=n);var k=O.parentWindow||O.defaultView||t,J=f.a.Db(B).toLowerCase(),H=O.createElement("div"),te;for(te=(J=J.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&w[J[1]]||b,J=te[0],te="ignored<div>"+te[1]+B+te[2]+"</div>",typeof k.innerShiv=="function"?H.appendChild(k.innerShiv(te)):(N&&O.body.appendChild(H),H.innerHTML=te,N&&H.parentNode.removeChild(H));J--;)H=H.lastChild;O=f.a.la(H.lastChild.childNodes)}return O},f.a.Md=function(B,U){var O=f.a.ua(B,U);return O.length&&O[0].parentElement||f.a.Yb(O)},f.a.fc=function(B,U){if(f.a.Tb(B),U=f.a.f(U),U!==null&&U!==e)if(typeof U!="string"&&(U=U.toString()),o)o(B).html(U);else for(var O=f.a.ua(U,B.ownerDocument),k=0;k<O.length;k++)B.appendChild(O[k])}}(),f.b("utils.parseHtmlFragment",f.a.ua),f.b("utils.setHtml",f.a.fc),f.aa=function(){function b(G,I){if(G){if(G.nodeType==8){var w=f.aa.Uc(G.nodeValue);w!=null&&I.push({ud:G,Kd:w})}else if(G.nodeType==1)for(var w=0,N=G.childNodes,B=N.length;w<B;w++)b(N[w],I)}}var R={};return{Xb:function(G){if(typeof G!="function")throw Error("You can only pass a function to ko.memoization.memoize()");var I=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return R[I]=G,"<!--[ko_memo:"+I+"]-->"},bd:function(G,I){var w=R[G];if(w===e)throw Error("Couldn't find any memo with ID "+G+". Perhaps it's already been unmemoized.");try{return w.apply(null,I||[]),!0}finally{delete R[G]}},cd:function(G,I){var w=[];b(G,w);for(var N=0,B=w.length;N<B;N++){var U=w[N].ud,O=[U];I&&f.a.Nb(O,I),f.aa.bd(w[N].Kd,O),U.nodeValue="",U.parentNode&&U.parentNode.removeChild(U)}},Uc:function(G){return(G=G.match(/^\[ko_memo\:(.*?)\]$/))?G[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 U=w,O=0,k;B<w;)if(k=I[B++]){if(B>U){if(5e3<=++O){B=w,f.a.Gc(Error("'Too much recursion' after processing "+O+" task groups."));break}U=w}try{k()}catch(J){f.a.Gc(J)}}}}function R(){b(),B=w=I.length=0}var G,I=[],w=0,N=1,B=0;return t.MutationObserver?G=function(U){var O=n.createElement("div");return new MutationObserver(U).observe(O,{attributes:!0}),function(){O.classList.toggle("foo")}}(R):G=n&&"onreadystatechange"in n.createElement("script")?function(U){var O=n.createElement("script");O.onreadystatechange=function(){O.onreadystatechange=null,n.documentElement.removeChild(O),O=null,U()},n.documentElement.appendChild(O)}:function(U){setTimeout(U,0)},{scheduler:G,zb:function(U){return w||f.na.scheduler(R),I[w++]=U,N++},cancel:function(U){U=U-(N-w),U>=B&&U<w&&(I[U]=null)},resetForTesting:function(){var U=w-B;return B=w=I.length=0,U},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 G=null;return f.$({read:b,write:function(I){clearTimeout(G),G=f.a.setTimeout(function(){b(I)},R)}})},rateLimit:function(b,R){var G,I,w;typeof R=="number"?G=R:(G=R.timeout,I=R.method),b.Hb=!1,w=typeof I=="function"?I:I=="notifyWhenChangesStop"?u:d,b.ub(function(N){return w(N,G,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(G){var I,w=!1;return function(){if(!w){f.na.cancel(I),I=f.na.zb(G);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,G){this.da=b,this.lc=R,this.mc=G,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,G){var I=this;G=G||"change";var w=new f.ic(I,R?b.bind(R):b,function(){f.a.Pa(I.U[G],w),I.hb&&I.hb(G)});return I.Qa&&I.Qa(G),I.U[G]||(I.U[G]=[]),I.U[G].push(w),w},notifySubscribers:function(b,R){if(R=R||"change",R==="change"&&this.Gb(),this.Wa(R)){var G=R==="change"&&this.ed||this.U[R].slice(0);try{f.u.xc();for(var I=0,w;w=G[I];++I)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,G=f.O(R),I,w,N,B,U;R.gb||(R.gb=R.notifySubscribers,R.notifySubscribers=m);var O=b(function(){R.Ja=!1,G&&B===R&&(B=R.nc?R.nc():R());var k=w||U&&R.sb(N,B);U=w=I=!1,k&&R.gb(N=B)});R.qc=function(k,J){J&&R.Ja||(U=!J),R.ed=R.U.change.slice(0),R.Ja=I=!0,B=k,O()},R.pc=function(k){I||(N=k,R.gb(k,"beforeChange"))},R.rc=function(){U=!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(G,I){G!=="dirty"&&(R+=I.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(G,I){var w=f.Ta[G];typeof w=="function"&&(R=w(R,I)||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){G.push(I),I=N}function R(){I=G.pop()}var G=[],I,w=0;return{xc:b,end:R,cc:function(N){if(I){if(!f.Qc(N))throw Error("Only subscribable things can act as dependencies");I.od.call(I.pd,N,N.fd||(N.fd=++w))}},G:function(N,B,U){try{return b(),N.apply(B,U||[])}finally{R()}},qa:function(){if(I)return I.o.qa()},Va:function(){if(I)return I.o.Va()},Ya:function(){if(I)return I.Ya},o:function(){if(I)return I.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(),G=[],I=typeof b!="function"||f.O(b)?function(B){return B===b}:b,w=0;w<R.length;w++){var N=R[w];if(I(N)){if(G.length===0&&this.ya(),R[w]!==N)throw Error("Array modified during remove; cannot remove item");G.push(N),R.splice(w,1),w--}}return G.length&&this.xa(),G},removeAll:function(b){if(b===e){var R=this.v(),G=R.slice(0);return this.ya(),R.splice(0,R.length),this.xa(),G}return b?this.remove(function(I){return 0<=f.a.A(b,I)}):[]},destroy:function(b){var R=this.v(),G=typeof b!="function"||f.O(b)?function(N){return N===b}:b;this.ya();for(var I=R.length-1;0<=I;I--){var w=R[I];G(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 G=this.indexOf(b);0<=G&&(this.ya(),this.v()[G]=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 G=R[b].apply(R,arguments);return this.xa(),G===R?this:G}}),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 G(){function H(){if(U){var te=[].concat(b.v()||[]),z;b.Wa("arrayChange")&&((!w||1<U)&&(w=f.a.Pb(O,te,b.Ob)),z=w),O=te,w=null,U=0,z&&z.length&&b.notifySubscribers(z,"arrayChange")}}I?H():(I=!0,B=b.subscribe(function(){++U},null,"spectate"),O=[].concat(b.v()||[]),w=null,N=b.subscribe(H))}if(b.Ob={},R&&typeof R=="object"&&f.a.extend(b.Ob,R),b.Ob.sparse=!0,!b.zc){var I=!1,w=null,N,B,U=0,O,k=b.Qa,J=b.hb;b.Qa=function(H){k&&k.call(b,H),H==="arrayChange"&&G()},b.hb=function(H){J&&J.call(b,H),H!=="arrayChange"||b.Wa("arrayChange")||(N&&N.s(),B&&B.s(),B=N=null,I=!1,O=e)},b.zc=function(H,te,z){function j(Le,ke,Be){return ee[ee.length]={status:Le,value:ke,index:Be}}if(I&&!U){var ee=[],fe=H.length,_e=z.length,le=0;switch(te){case"push":le=fe;case"unshift":for(te=0;te<_e;te++)j("added",z[te],le+te);break;case"pop":le=fe-1;case"shift":fe&&j("deleted",H[le],le);break;case"splice":te=Math.min(Math.max(0,0>z[0]?fe+z[0]:z[0]),fe);for(var fe=_e===1?fe:Math.min(te+(z[1]||0),fe),_e=te+_e-2,le=Math.max(fe,_e),ge=[],Se=[],Ie=2;te<le;++te,++Ie)te<fe&&Se.push(j("deleted",H[te],te)),te<_e&&ge.push(j("added",z[Ie],te));f.a.Kc(Se,ge);break;default:return}w=ee}}}};var Z=f.a.Da("_state");f.o=f.$=function(b,R,G){function I(){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(I),(N.ka||N.J&&I.Xa())&&I.ha(),N.X}if(typeof b=="object"?G=b:(G=G||{},b&&(G.read=b)),typeof G.read!="function")throw Error("Pass a function that returns the value of the ko.computed");var w=G.write,N={X:e,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:G.read,nb:R||G.owner,l:G.disposeWhenNodeIsRemoved||G.l||null,Sa:G.disposeWhen||G.Sa,Rb:null,I:{},V:0,Ic:null};return I[Z]=N,I.Nc=typeof w=="function",f.a.Ba||f.a.extend(I,f.T.fn),f.T.fn.qb(I),f.a.Ab(I,E),G.pure?(N.wb=!0,N.J=!0,f.a.extend(I,X)):G.deferEvaluation&&f.a.extend(I,v),f.options.deferUpdates&&f.Ta.deferred(I,!0),N.l&&(N.jc=!0,N.l.nodeType||(N.l=null)),N.J||G.deferEvaluation||I.ha(),N.l&&I.ja()&&f.a.K.za(N.l,N.Rb=function(){I.s()}),I};var E={equalityComparer:c,qa:function(){return this[Z].V},Va:function(){var b=[];return f.a.P(this[Z].I,function(R,G){b[G.Ka]=G.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(G){return G.Vb&&G.Vb(b)})},uc:function(b,R,G){if(this[Z].wb&&R===this)throw Error("A 'pure' computed must not be called recursively");this[Z].I[b]=G,G.Ka=this[Z].V++,G.La=R.ob()},Xa:function(){var b,R,G=this[Z].I;for(b in G)if(Object.prototype.hasOwnProperty.call(G,b)&&(R=G[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"),G=b.subscribe(this.Rd,this);return{da:b,s:function(){R.s(),G.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],G=R.Sa,I=!1;if(!R.rb&&!R.ra){if(R.l&&!f.a.Sb(R.l)||G&&G()){if(!R.jc){this.s();return}}else R.jc=!1;R.rb=!0;try{I=this.zd(b)}finally{R.rb=!1}return I}},zd:function(b){var R=this[Z],I=!1,G=R.wb?e:!R.V,I={qd:this,mb:R.I,Qb:R.V};f.u.xc({pd:I,od:g,o:this,Ya:G}),R.I={},R.V=0;var w=this.yd(R,I);return R.V?I=this.sb(R.X,w):(this.s(),I=!0),I&&(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()),G&&this.notifySubscribers(R.X,"awake"),I},yd:function(b,R){try{var G=b.Wc;return b.nb?G.call(b.nb):G()}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,G){G.s&&G.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)}},X={Qa:function(b){var R=this,G=R[Z];if(!G.ra&&G.J&&b=="change"){if(G.J=!1,G.sa||R.Xa())G.I=null,G.V=0,R.ha()&&R.Gb();else{var I=[];f.a.P(G.I,function(w,N){I[N.Ka]=w}),f.a.D(I,function(w,N){var B=G.I[w],U=R.$c(B.da);U.Ka=N,U.La=B.La,G.I[w]=U}),R.Xa()&&R.ha()&&R.Gb()}G.ra||R.notifySubscribers(G.X,"awake")}},hb:function(b){var R=this[Z];R.ra||b!="change"||this.Wa("change")||(f.a.P(R.I,function(G,I){I.s&&(R.I[G]={da:I.da,Ka:I.Ka,La:I.La},I.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)}},v={Qa:function(b){b!="change"&&b!="beforeChange"||this.v()}};f.a.Ba&&f.a.setPrototypeOf(E,f.T.fn);var P=f.ta.Ma;E[P]=f.o,f.Oc=function(b){return typeof b=="function"&&b[P]===E[P]},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",E),f.L(E,"peek",E.v),f.L(E,"dispose",E.s),f.L(E,"isActive",E.ja),f.L(E,"getDependenciesCount",E.qa),f.L(E,"getDependencies",E.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(I,w,N){if(N=N||new G,I=w(I),typeof I!="object"||I===null||I===e||I instanceof RegExp||I instanceof Date||I instanceof String||I instanceof Number||I instanceof Boolean)return I;var B=I instanceof Array?[]:{};return N.save(I,B),R(I,function(U){var O=w(I[U]);switch(typeof O){case"boolean":case"number":case"string":case"function":B[U]=O;break;case"object":case"undefined":var k=N.get(O);B[U]=k!==e?k:b(O,w,N)}}),B}function R(I,w){if(I instanceof Array){for(var N=0;N<I.length;N++)w(N);typeof I.toJSON=="function"&&w("toJSON")}else for(N in I)w(N)}function G(){this.keys=[],this.values=[]}f.ad=function(I){if(arguments.length==0)throw Error("When calling ko.toJS, pass the object you want to convert.");return b(I,function(w){for(var N=0;f.O(w)&&10>N;N++)w=w();return w})},f.toJSON=function(I,w,N){return I=f.ad(I),f.a.hc(I,w,N)},G.prototype={constructor:G,save:function(I,w){var N=f.a.A(this.keys,I);0<=N?this.values[N]=w:(this.keys.push(I),this.values.push(w))},get:function(I){return I=f.a.A(this.keys,I),0<=I?this.values[I]:e}}}(),f.b("toJS",f.ad),f.b("toJSON",f.toJSON),f.Wd=function(b,R,G){function I(w){var N=f.xb(b,G).extend({ma:"always"}),B=N.subscribe(function(U){U&&(B.s(),w(U))});return N.notifySubscribers(N.v()),B}return typeof Promise!="function"||R?I(R.bind(G)):new Promise(I)},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,G){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 I=-1,w=0,N=b.options.length,B;w<N;++w)if(B=f.w.M(b.options[w]),B==R||B===""&&R===e){I=w;break}(G||0<=I||R===e&&1<b.size)&&(b.selectedIndex=I,f.a.W===6&&f.a.setTimeout(function(){b.selectedIndex=I},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(U){U=f.a.Db(U),U.charCodeAt(0)===123&&(U=U.slice(1,-1)),U+=`
,`;var O=[],k=U.match(I),J,H=[],te=0;if(1<k.length){for(var z=0,j;j=k[z];++z){var ee=j.charCodeAt(0);if(ee===44){if(0>=te){O.push(J&&H.length?{key:J,value:H.join("")}:{unknown:J||H.join("")}),J=te=0,H=[];continue}}else if(ee===58){if(!te&&!J&&H.length===1){J=H.pop();continue}}else{if(ee===47&&1<j.length&&(j.charCodeAt(1)===47||j.charCodeAt(1)===42))continue;ee===47&&z&&1<j.length?(ee=k[z-1].match(w))&&!N[ee[0]]&&(U=U.substr(U.indexOf(j)+1),k=U.match(I),z=-1,j="/"):ee===40||ee===123||ee===91?++te:ee===41||ee===125||ee===93?--te:J||H.length||ee!==34&&ee!==39||(j=j.slice(1,-1))}H.push(j)}if(0<te)throw Error("Unbalanced parentheses, braces, or brackets")}return O}var R=["true","false","null","undefined"],G=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,I=RegExp(`"(?:\\\\.|[^"])*"|'(?:\\\\.|[^'])*'|\`(?:\\\\.|[^\`])*\`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.*
|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),w=/[\])"'A-Za-z0-9_$]+$/,N={in:1,return:1,typeof:1},B={};return{Ra:[],wa:B,ac:b,vb:function(U,O){function k(ee,fe){var _e;if(!z){var le=f.getBindingHandler(ee);if(le&&le.preprocess&&!(fe=le.preprocess(fe,ee,k)))return;(le=B[ee])&&(_e=fe,0<=f.a.A(R,_e)?_e=!1:(le=_e.match(G),_e=le===null?!1:le[1]?"Object("+le[1]+")"+le[2]:_e),le=_e),le&&H.push("'"+(typeof B[ee]=="string"?B[ee]:ee)+"':function(_z){"+_e+"=_z}")}te&&(fe="function(){return "+fe+" }"),J.push("'"+ee+"':"+fe)}O=O||{};var J=[],H=[],te=O.valueAccessors,z=O.bindingParams,j=typeof U=="string"?b(U):U;return f.a.D(j,function(ee){k(ee.key||ee.unknown,ee.value)}),H.length&&k("_ko_property_writers","{"+H.join(",")+" }"),J.join(",")},Id:function(U,O){for(var k=0;k<U.length;k++)if(U[k].key==O)return!0;return!1},eb:function(U,O,k,J,H){U&&f.O(U)?!f.Za(U)||H&&U.v()===J||U(J):(U=O.get("_ko_property_writers"))&&U[k]&&U[k](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(k){return k.nodeType==8&&N.test(w?k.text:k.nodeValue)}function R(k){return k.nodeType==8&&B.test(w?k.text:k.nodeValue)}function G(k,J){for(var H=k,te=1,z=[];H=H.nextSibling;){if(R(H)&&(f.a.g.set(H,O,!0),te--,te===0))return z;z.push(H),b(H)&&te++}if(!J)throw Error("Cannot find closing comment tag to match: "+k.nodeValue);return null}function I(k,J){var H=G(k,J);return H?0<H.length?H[H.length-1].nextSibling:k.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*$/,B=w?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,U={ul:!0,ol:!0},O="__ko_matchedEndComment__";f.h={ea:{},childNodes:function(k){return b(k)?G(k):k.childNodes},Ea:function(k){if(b(k)){k=f.h.childNodes(k);for(var J=0,H=k.length;J<H;J++)f.removeNode(k[J])}else f.a.Tb(k)},va:function(k,J){if(b(k)){f.h.Ea(k);for(var H=k.nextSibling,te=0,z=J.length;te<z;te++)H.parentNode.insertBefore(J[te],H)}else f.a.va(k,J)},Vc:function(k,J){var H;b(k)?(H=k.nextSibling,k=k.parentNode):H=k.firstChild,H?J!==H&&k.insertBefore(J,H):k.appendChild(J)},Wb:function(k,J,H){H?(H=H.nextSibling,b(k)&&(k=k.parentNode),H?J!==H&&k.insertBefore(J,H):k.appendChild(J)):f.h.Vc(k,J)},firstChild:function(k){if(b(k))return!k.nextSibling||R(k.nextSibling)?null:k.nextSibling;if(k.firstChild&&R(k.firstChild))throw Error("Found invalid end comment, as the first child of "+k);return k.firstChild},nextSibling:function(k){if(b(k)&&(k=I(k)),k.nextSibling&&R(k.nextSibling)){var J=k.nextSibling;if(R(J)&&!f.a.g.get(J,O))throw Error("Found end comment without a matching opening comment, as child of "+k);return null}return k.nextSibling},Cd:b,Vd:function(k){return(k=(w?k.text:k.nodeValue).match(N))?k[1]:null},Sc:function(k){if(U[f.a.R(k)]){var J=k.firstChild;if(J)do if(J.nodeType===1){var H;H=J.firstChild;var te=null;if(H)do if(te)te.push(H);else if(b(H)){var z=I(H,!0);z?H=z:te=[H]}else R(H)&&(te=[H]);while(H=H.nextSibling);if(H=te)for(te=J.nextSibling,z=0;z<H.length;z++)te?k.insertBefore(H[z],te):k.appendChild(H[z])}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 G=this.getBindingsString(b,R),G=G?this.parseBindingsString(G,R,b):null;return f.j.tc(G,b,R,!1)},getBindingAccessors:function(b,R){var G=this.getBindingsString(b,R),G=G?this.parseBindingsString(G,R,b,{valueAccessors:!0}):null;return f.j.tc(G,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,G,I){try{var w=this.nd,N=b+(I&&I.valueAccessors||""),B;if(!(B=w[N])){var U,O="with($context){with($data||{}){return{"+f.m.vb(b,I)+"}}}";U=new Function("$context","$element",O),B=w[N]=U}return B(R,G)}catch(k){throw k.message=`Unable to parse bindings.
Bindings value: `+b+`
Message: `+k.message,k}}}),f.ga.instance=new f.ga}(),f.b("bindingProvider",f.ga),function(){function b(le){var ge=(le=f.a.g.get(le,_e))&&le.N;ge&&(le.N=null,ge.Tc())}function R(le,ge,Se){this.node=le,this.yc=ge,this.kb=[],this.H=!1,ge.N||f.a.K.za(le,b),Se&&Se.N&&(Se.N.kb.push(le),this.Kb=Se)}function G(le){return function(){return le}}function I(le){return le()}function w(le){return f.a.Ga(f.u.G(le),function(ge,Se){return function(){return le()[Se]}})}function N(le,ge,Se){return typeof le=="function"?w(le.bind(null,ge,Se)):f.a.Ga(le,G)}function B(le,ge){return w(this.getBindings.bind(this,le,ge))}function U(le,ge){var Se=f.h.firstChild(ge);if(Se){var Ie,Le=f.ga.instance,ke=Le.preprocessNode;if(ke){for(;Ie=Se;)Se=f.h.nextSibling(Ie),ke.call(Le,Ie);Se=f.h.firstChild(ge)}for(;Ie=Se;)Se=f.h.nextSibling(Ie),O(le,Ie)}f.i.ma(ge,f.i.H)}function O(le,ge){var Se=le,Ie=ge.nodeType===1;Ie&&f.h.Sc(ge),(Ie||f.ga.instance.nodeHasBindings(ge))&&(Se=J(ge,null,le).bindingContextForDescendants),Se&&!ee[f.a.R(ge)]&&U(Se,ge)}function k(le){var ge=[],Se={},Ie=[];return f.a.P(le,function Le(ke){if(!Se[ke]){var Be=f.getBindingHandler(ke);Be&&(Be.after&&(Ie.push(ke),f.a.D(Be.after,function(st){if(le[st]){if(f.a.A(Ie,st)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+Ie.join(", "));Le(st)}}),Ie.length--),ge.push({key:ke,Mc:Be})),Se[ke]=!0}}),ge}function J(le,ge,Se){var Ie=f.a.g.Ub(le,_e,{}),Le=Ie.hd;if(!ge){if(Le)throw Error("You cannot apply bindings multiple times to the same element.");Ie.hd=!0}Le||(Ie.context=Se),Ie.Zb||(Ie.Zb={});var ke;if(ge&&typeof ge!="function")ke=ge;else{var Be=f.ga.instance,st=Be.getBindingAccessors||B,vt=f.$(function(){return(ke=ge?ge(Se,le):st.call(Be,le,Se))&&(Se[te]&&Se[te](),Se[j]&&Se[j]()),ke},null,{l:le});ke&&vt.ja()||(vt=null)}var Ct=Se,Xe;if(ke){var je=function(){return f.a.Ga(vt?vt():ke,I)},$e=vt?function(He){return function(){return I(vt()[He])}}:function(He){return ke[He]};je.get=function(He){return ke[He]&&I($e(He))},je.has=function(He){return He in ke},f.i.H in ke&&f.i.subscribe(le,f.i.H,function(){var He=(0,ke[f.i.H])();if(He){var Ut=f.h.childNodes(le);Ut.length&&He(Ut,f.Ec(Ut[0]))}}),f.i.pa in ke&&(Ct=f.i.Cb(le,Se),f.i.subscribe(le,f.i.pa,function(){var He=(0,ke[f.i.pa])();He&&f.h.firstChild(le)&&He(le)})),Ie=k(ke),f.a.D(Ie,function(He){var Ut=He.Mc.init,Ce=He.Mc.update,Ve=He.key;if(le.nodeType===8&&!f.h.ea[Ve])throw Error("The binding '"+Ve+"' cannot be used with virtual elements");try{typeof Ut=="function"&&f.u.G(function(){var ct=Ut(le,$e(Ve),je,Ct.$data,Ct);if(ct&&ct.controlsDescendantBindings){if(Xe!==e)throw Error("Multiple bindings ("+Xe+" and "+Ve+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");Xe=Ve}}),typeof Ce=="function"&&f.$(function(){Ce(le,$e(Ve),je,Ct.$data,Ct)},null,{l:le})}catch(ct){throw ct.message='Unable to process binding "'+Ve+": "+ke[Ve]+`"
Message: `+ct.message,ct}})}return Ie=Xe===e,{shouldBindDescendants:Ie,bindingContextForDescendants:Ie&&Ct}}function H(le,ge){return le&&le instanceof f.fa?le:new f.fa(le,e,e,ge)}var te=f.a.Da("_subscribable"),z=f.a.Da("_ancestorBindingInfo"),j=f.a.Da("_dataDependency");f.c={};var ee={script:!0,textarea:!0,template:!0};f.getBindingHandler=function(le){return f.c[le]};var fe={};f.fa=function(le,ge,Se,Ie,Le){function ke(){var $e=Ct?vt():vt,He=f.a.f($e);return ge?(f.a.extend(Be,ge),z in ge&&(Be[z]=ge[z])):(Be.$parents=[],Be.$root=He,Be.ko=f),Be[te]=Xe,st?He=Be.$data:(Be.$rawData=$e,Be.$data=He),Se&&(Be[Se]=He),Ie&&Ie(Be,ge,He),ge&&ge[te]&&!f.S.o().Vb(ge[te])&&ge[te](),je&&(Be[j]=je),Be.$data}var Be=this,st=le===fe,vt=st?e:le,Ct=typeof vt=="function"&&!f.O(vt),Xe,je=Le&&Le.dataDependency;Le&&Le.exportDependencies?ke():(Xe=f.xb(ke),Xe.v(),Xe.ja()?Xe.equalityComparer=null:Be[te]=e)},f.fa.prototype.createChildContext=function(le,ge,Se,Ie){if(!Ie&&ge&&typeof ge=="object"&&(Ie=ge,ge=Ie.as,Se=Ie.extend),ge&&Ie&&Ie.noChildContext){var Le=typeof le=="function"&&!f.O(le);return new f.fa(fe,this,null,function(ke){Se&&Se(ke),ke[ge]=Le?le():le},Ie)}return new f.fa(le,this,ge,function(ke,Be){ke.$parentContext=Be,ke.$parent=Be.$data,ke.$parents=(Be.$parents||[]).slice(0),ke.$parents.unshift(ke.$parent),Se&&Se(ke)},Ie)},f.fa.prototype.extend=function(le,ge){return new f.fa(fe,this,null,function(Se){f.a.extend(Se,typeof le=="function"?le(Se):le)},ge)};var _e=f.a.g.Z();R.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},R.prototype.sd=function(le){f.a.Pa(this.kb,le),!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(le,ge,Se,Ie,Le){var ke=f.a.g.Ub(le,_e,{});return ke.Fa||(ke.Fa=new f.T),Le&&Le.notifyImmediately&&ke.Zb[ge]&&f.u.G(Se,Ie,[le]),ke.Fa.subscribe(Se,Ie,ge)},ma:function(le,ge){var Se=f.a.g.get(le,_e);if(Se&&(Se.Zb[ge]=!0,Se.Fa&&Se.Fa.notifySubscribers(le,ge),ge==f.i.H)){if(Se.N)Se.N.Cc();else if(Se.N===e&&Se.Fa&&Se.Fa.Wa(f.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(le,ge){var Se=f.a.g.Ub(le,_e,{});return Se.N||(Se.N=new R(le,Se,ge[z])),ge[z]==Se?ge:ge.extend(function(Ie){Ie[z]=Se})}},f.Td=function(le){return(le=f.a.g.get(le,_e))&&le.context},f.ib=function(le,ge,Se){return le.nodeType===1&&f.h.Sc(le),J(le,ge,H(Se))},f.ld=function(le,ge,Se){return Se=H(Se),f.ib(le,N(ge,Se,le),Se)},f.Oa=function(le,ge){ge.nodeType!==1&&ge.nodeType!==8||U(H(le),ge)},f.vc=function(le,ge,Se){if(!o&&t.jQuery&&(o=t.jQuery),2>arguments.length){if(ge=n.body,!ge)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!ge||ge.nodeType!==1&&ge.nodeType!==8)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");O(H(le,Se),ge)},f.Dc=function(le){return!le||le.nodeType!==1&&le.nodeType!==8?e:f.Td(le)},f.Ec=function(le){return(le=f.Dc(le))?le.$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(B,U){var O=Object.prototype.hasOwnProperty.call(w,B)?w[B]:b,k;O?O.subscribe(U):(O=w[B]=new f.T,O.subscribe(U),G(B,function(J,H){var te=!(!H||!H.synchronous);N[B]={definition:J,Gd:te},delete w[B],k||te?O.notifySubscribers(J):f.na.zb(function(){O.notifySubscribers(J)})}),k=!0)}function G(B,U){I("getConfig",[B],function(O){O?I("loadComponent",[B,O],function(k){U(k,O)}):U(null,null)})}function I(B,U,O,k){k||(k=f.j.loaders.slice(0));var J=k.shift();if(J){var H=J[B];if(H){var te=!1;if(H.apply(J,U.concat(function(z){te?O(null):z!==null?O(z):I(B,U,O,k)}))!==b&&(te=!0,!J.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else I(B,U,O,k)}else O(null)}var w={},N={};f.j={get:function(B,U){var O=Object.prototype.hasOwnProperty.call(N,B)?N[B]:b;O?O.Gd?f.u.G(function(){U(O.definition)}):f.na.zb(function(){U(O.definition)}):R(B,U)},Bc:function(B){delete N[B]},oc:I},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(O,k,J,H){function te(){--j===0&&H(z)}var z={},j=2,ee=J.template;J=J.viewModel,ee?w(k,ee,function(fe){f.j.oc("loadTemplate",[O,fe],function(_e){z.template=_e,te()})}):te(),J?w(k,J,function(fe){f.j.oc("loadViewModel",[O,fe],function(_e){z[U]=_e,te()})}):te()}function R(O,k,J){if(typeof k=="function")J(function(te){return new k(te)});else if(typeof k[U]=="function")J(k[U]);else if("instance"in k){var H=k.instance;J(function(){return H})}else"viewModel"in k?R(O,k.viewModel,J):O("Unknown viewModel value: "+k)}function G(O){switch(f.a.R(O)){case"script":return f.a.ua(O.text);case"textarea":return f.a.ua(O.value);case"template":if(I(O.content))return f.a.Ca(O.content.childNodes)}return f.a.Ca(O.childNodes)}function I(O){return t.DocumentFragment?O instanceof DocumentFragment:O&&O.nodeType===11}function w(O,k,J){typeof k.require=="string"?a||t.require?(a||t.require)([k.require],function(H){H&&typeof H=="object"&&H.Xd&&H.default&&(H=H.default),J(H)}):O("Uses require, but no AMD loader is present"):J(k)}function N(O){return function(k){throw Error("Component '"+O+"': "+k)}}var B={};f.j.register=function(O,k){if(!k)throw Error("Invalid configuration for "+O);if(f.j.tb(O))throw Error("Component "+O+" is already registered");B[O]=k},f.j.tb=function(O){return Object.prototype.hasOwnProperty.call(B,O)},f.j.unregister=function(O){delete B[O],f.j.Bc(O)},f.j.Fc={getConfig:function(O,k){k(f.j.tb(O)?B[O]:null)},loadComponent:function(O,k,J){var H=N(O);w(H,k,function(te){b(O,H,te,J)})},loadTemplate:function(O,k,J){if(O=N(O),typeof k=="string")J(f.a.ua(k));else if(k instanceof Array)J(k);else if(I(k))J(f.a.la(k.childNodes));else if(k.element)if(k=k.element,t.HTMLElement?k instanceof HTMLElement:k&&k.tagName&&k.nodeType===1)J(G(k));else if(typeof k=="string"){var H=n.getElementById(k);H?J(G(H)):O("Cannot find element with ID "+k)}else O("Unknown element type: "+k);else O("Unknown template value: "+k)},loadViewModel:function(O,k,J){R(N(O),k,J)}};var U="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=B}(),function(){function b(G,I){var w=G.getAttribute("params");if(w){var w=R.parseBindingsString(w,I,G,{valueAccessors:!0,bindingParams:!0}),w=f.a.Ga(w,function(U){return f.o(U,null,{l:G})}),N=f.a.Ga(w,function(U){var O=U.v();return U.ja()?f.o({read:function(){return f.a.f(U())},write:f.Za(O)&&function(k){U()(k)},l:G}):O});return Object.prototype.hasOwnProperty.call(N,"$raw")||(N.$raw=w),N}return{$raw:{}}}f.j.getComponentNameForNode=function(G){var I=f.a.R(G);if(f.j.tb(I)&&(I.indexOf("-")!=-1||""+G=="[object HTMLUnknownElement]"||8>=f.a.W&&G.tagName===I))return I},f.j.tc=function(G,I,w,N){if(I.nodeType===1){var B=f.j.getComponentNameForNode(I);if(B){if(G=G||{},G.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var U={name:B,params:b(I,w)};G.component=N?function(){return U}:U}}return G};var R=new f.ga;9>f.a.W&&(f.j.register=function(G){return function(I){return G.apply(this,arguments)}}(f.j.register),n.createDocumentFragment=function(G){return function(){var I=G(),w=f.j.dd,N;for(N in w);return I}}(n.createDocumentFragment))}(),function(){function b(I,w,N){if(w=w.template,!w)throw Error("Component '"+I+"' has no template");I=f.a.Ca(w),f.h.va(N,I)}function R(I,w,N){var B=I.createViewModel;return B?B.call(I,w,N):w}var G=0;f.c.component={init:function(I,w,N,B,U){function O(){var z=k&&k.dispose;typeof z=="function"&&z.call(k),H&&H.s(),J=k=H=null}var k,J,H,te=f.a.la(f.h.childNodes(I));return f.h.Ea(I),f.a.K.za(I,O),f.o(function(){var z=f.a.f(w()),j,ee;if(typeof z=="string"?j=z:(j=f.a.f(z.name),ee=f.a.f(z.params)),!j)throw Error("No component name specified");var fe=f.i.Cb(I,U),_e=J=++G;f.j.get(j,function(le){if(J===_e){if(O(),!le)throw Error("Unknown component '"+j+"'");b(j,le,I);var ge=R(le,ee,{element:I,templateNodes:te});le=fe.createChildContext(ge,{extend:function(Se){Se.$component=ge,Se.$componentTemplateNodes=te}}),ge&&ge.koDescendantsComplete&&(H=f.i.subscribe(I,f.i.pa,ge.koDescendantsComplete,ge)),k=ge,f.Oa(le,I)}})},null,{l:I}),{controlsDescendantBindings:!0}}},f.h.ea.component=!0}();var A={class:"className",for:"htmlFor"};f.c.attr={update:function(b,R){var G=f.a.f(R())||{};f.a.P(G,function(I,w){w=f.a.f(w);var N=I.indexOf(":"),N="lookupNamespaceURI"in b&&0<N&&b.lookupNamespaceURI(I.substr(0,N)),B=w===!1||w===null||w===e;B?N?b.removeAttributeNS(N,I):b.removeAttribute(I):w=w.toString(),8>=f.a.W&&I in A?(I=A[I],B?b.removeAttribute(I):b[I]=w):B||(N?b.setAttributeNS(N,I,w):b.setAttribute(I,w)),I==="name"&&f.a.Yc(b,B?"":w)})}},function(){f.c.checked={after:["value","attr"],init:function(b,R,G){function I(){var z=b.checked,j=N();if(!f.S.Ya()&&(z||!U&&!f.S.qa())){var ee=f.u.G(R);if(k){var fe=J?ee.v():ee,_e=te;te=j,_e!==j?z&&(f.a.Na(fe,j,!0),f.a.Na(fe,_e,!1)):f.a.Na(fe,j,z),J&&f.Za(ee)&&ee(fe)}else B&&(j===e?j=z:z||(j=e)),f.m.eb(ee,G,"checked",j,!0)}}function w(){var z=f.a.f(R()),j=N();k?(b.checked=0<=f.a.A(z,j),te=j):b.checked=B&&j===e?!!z:N()===z}var N=f.xb(function(){if(G.has("checkedValue"))return f.a.f(G.get("checkedValue"));if(H)return G.has("value")?f.a.f(G.get("value")):b.value}),B=b.type=="checkbox",U=b.type=="radio";if(B||U){var O=R(),k=B&&f.a.f(O)instanceof Array,J=!(k&&O.push&&O.splice),H=U||k,te=k?N():e;U&&!b.name&&f.c.uniqueName.init(b,function(){return!0}),f.o(I,null,{l:b}),f.a.B(b,"click",I),f.o(w,null,{l:b}),O=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 G=f.a.Db(f.a.f(R()));f.a.Eb(b,b.__ko__cssValue,!1),b.__ko__cssValue=G,f.a.Eb(b,G,!0)}},f.c.css={update:function(b,R){var G=f.a.f(R());G!==null&&typeof G=="object"?f.a.P(G,function(I,w){w=f.a.f(w),f.a.Eb(b,I,w)}):f.c.class.update(b,R)}},f.c.enable={update:function(b,R){var G=f.a.f(R());G&&b.disabled?b.removeAttribute("disabled"):G||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,G,I,w){var N=R()||{};f.a.P(N,function(B){typeof B=="string"&&f.a.B(b,B,function(U){var O,k=R()[B];if(k){try{var J=f.a.la(arguments);I=w.$data,J.unshift(I),O=k.apply(I,J)}finally{O!==!0&&(U.preventDefault?U.preventDefault():U.returnValue=!1)}G.get(B+"Bubble")===!1&&(U.cancelBubble=!0,U.stopPropagation&&U.stopPropagation())}})})}},f.c.foreach={Rc:function(b){return function(){var R=b(),G=f.a.bc(R);return!G||typeof G.length=="number"?{foreach:R,templateEngine:f.ba.Ma}:(f.a.f(R),{foreach:G.data,as:G.as,noChildContext:G.noChildContext,includeDestroyed:G.includeDestroyed,afterAdd:G.afterAdd,beforeRemove:G.beforeRemove,afterRender:G.afterRender,beforeMove:G.beforeMove,afterMove:G.afterMove,templateEngine:f.ba.Ma})}},init:function(b,R){return f.c.template.init(b,f.c.foreach.Rc(R))},update:function(b,R,G,I,w){return f.c.template.update(b,f.c.foreach.Rc(R),G,I,w)}},f.m.Ra.foreach=!1,f.h.ea.foreach=!0,f.c.hasfocus={init:function(b,R,G){function I(B){b.__ko_hasfocusUpdating=!0;var U=b.ownerDocument;if("activeElement"in U){var O;try{O=U.activeElement}catch{O=U.body}B=O===b}U=R(),f.m.eb(U,G,"hasfocus",B,!0),b.__ko_hasfocusLastValue=B,b.__ko_hasfocusUpdating=!1}var w=I.bind(null,!0),N=I.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 G=!!f.a.f(R());b.__ko_hasfocusUpdating||b.__ko_hasfocusLastValue===G||(G?b.focus():b.blur(),!G&&b.__ko_hasfocusLastValue&&b.ownerDocument.body.focus(),f.u.G(f.a.Fb,null,[b,G?"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,G,I){f.c[R]={init:function(w,N,B,U,O){var k,J,H={},te,z,j;if(G){U=B.get("as");var ee=B.get("noChildContext");j=!(U&&ee),H={as:U,noChildContext:ee,exportDependencies:j}}return z=(te=B.get("completeOn")=="render")||B.has(f.i.pa),f.o(function(){var fe=f.a.f(N()),_e=!I!=!fe,le=!J,ge;(j||_e!==k)&&(z&&(O=f.i.Cb(w,O)),_e&&((!G||j)&&(H.dataDependency=f.S.o()),ge=G?O.createChildContext(typeof fe=="function"?fe:N,H):f.S.qa()?O.extend(null,H):O),le&&f.S.qa()&&(J=f.a.Ca(f.h.childNodes(w),!0)),_e?(le||f.h.va(w,f.a.Ca(J)),f.Oa(ge,w)):(f.h.Ea(w),te||f.i.ma(w,f.i.H)),k=_e)},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,G,I,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,G){function I(){return f.a.jb(b.options,function(ee){return ee.selected})}function w(ee,fe,_e){var le=typeof fe;return le=="function"?fe(ee):le=="string"?ee[fe]:_e}function N(ee,fe){if(z&&k)f.i.ma(b,f.i.H);else if(te.length){var _e=0<=f.a.A(te,f.w.M(fe[0]));f.a.Zc(fe[0],_e),z&&!_e&&f.u.G(f.a.Fb,null,[b,"change"])}}var B=b.multiple,U=b.length!=0&&B?b.scrollTop:null,O=f.a.f(R()),k=G.get("valueAllowUnset")&&G.has("value"),J=G.get("optionsIncludeDestroyed");R={};var H,te=[];k||(B?te=f.a.Mb(I(),f.w.M):0<=b.selectedIndex&&te.push(f.w.M(b.options[b.selectedIndex]))),O&&(typeof O.length>"u"&&(O=[O]),H=f.a.jb(O,function(ee){return J||ee===e||ee===null||!f.a.f(ee._destroy)}),G.has("optionsCaption")&&(O=f.a.f(G.get("optionsCaption")),O!==null&&O!==e&&H.unshift(M)));var z=!1;if(R.beforeRemove=function(ee){b.removeChild(ee)},O=N,G.has("optionsAfterRender")&&typeof G.get("optionsAfterRender")=="function"&&(O=function(ee,fe){N(0,fe),f.u.G(G.get("optionsAfterRender"),null,[fe[0],ee!==M?ee:e])}),f.a.ec(b,H,function(ee,fe,_e){return _e.length&&(te=!k&&_e[0].selected?[f.w.M(_e[0])]:[],z=!0),fe=b.ownerDocument.createElement("option"),ee===M?(f.a.Bb(fe,G.get("optionsCaption")),f.w.cb(fe,e)):(_e=w(ee,G.get("optionsValue"),ee),f.w.cb(fe,f.a.f(_e)),ee=w(ee,G.get("optionsText"),_e),f.a.Bb(fe,ee)),[fe]},R,O),!k){var j;B?j=te.length&&I().length<te.length:j=te.length&&0<=b.selectedIndex?f.w.M(b.options[b.selectedIndex])!==te[0]:te.length||0<=b.selectedIndex,j&&f.u.G(f.a.Fb,null,[b,"change"])}(k||f.S.Ya())&&f.i.ma(b,f.i.H),f.a.wd(b),U&&20<Math.abs(U-b.scrollTop)&&(b.scrollTop=U)}},f.c.options.$b=f.a.g.Z(),f.c.selectedOptions={init:function(b,R,G){function I(){var B=R(),U=[];f.a.D(b.getElementsByTagName("option"),function(O){O.selected&&U.push(f.w.M(O))}),f.m.eb(B,G,"selectedOptions",U)}function w(){var B=f.a.f(R()),U=b.scrollTop;B&&typeof B.length=="number"&&f.a.D(b.getElementsByTagName("option"),function(O){var k=0<=f.a.A(B,f.w.M(O));O.selected!=k&&f.a.Zc(O,k)}),b.scrollTop=U}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?I():(f.a.B(b,"change",I),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 G=f.a.f(R()||{});f.a.P(G,function(I,w){if(w=f.a.f(w),(w===null||w===e||w===!1)&&(w=""),o)o(b).css(I,w);else if(/^--/.test(I))b.style.setProperty(I,w);else{I=I.replace(/-(\w)/g,function(B,U){return U.toUpperCase()});var N=b.style[I];b.style[I]=w,w===N||b.style[I]!=N||isNaN(w)||(b.style[I]=w+"px")}})}},f.c.submit={init:function(b,R,G,I,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 B,U=R();try{B=U.call(w.$data,b)}finally{B!==!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(H){if(H)return parseFloat(H[1])},R=t.navigator.userAgent,G,I,w,N,B;(G=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(B=b(R.match(/Edge\/([^ ]+)$/)))||b(R.match(/Chrome\/([^ ]+)/))||(I=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 U=f.a.g.Z(),O=f.a.g.Z(),k=function(H){var te=this.activeElement;(te=te&&f.a.g.get(te,O))&&te(H)},J=function(H,te){var z=H.ownerDocument;f.a.g.get(z,U)||(f.a.g.set(z,U,!0),f.a.B(z,"selectionchange",k)),f.a.g.set(H,O,te)};f.c.textInput={init:function(H,te,z){function j(ke,Be){f.a.B(H,ke,Be)}function ee(){var ke=f.a.f(te());(ke===null||ke===e)&&(ke=""),Se!==e&&ke===Se?f.a.setTimeout(ee,4):H.value!==ke&&(Le=!0,H.value=ke,Le=!1,le=H.value)}function fe(){ge||(Se=H.value,ge=f.a.setTimeout(_e,4))}function _e(){clearTimeout(ge),Se=ge=e;var ke=H.value;le!==ke&&(le=ke,f.m.eb(te(),z,"textInput",ke))}var le=H.value,ge,Se,Ie=f.a.W==9?fe:_e,Le=!1;N&&j("keypress",_e),11>N&&j("propertychange",function(ke){Le||ke.propertyName!=="value"||Ie(ke)}),N==8&&(j("keyup",_e),j("keydown",_e)),J&&(J(H,Ie),j("dragend",fe)),(!N||9<=N)&&j("input",Ie),5>I&&f.a.R(H)==="textarea"?(j("keydown",fe),j("paste",fe),j("cut",fe)):11>G?j("keydown",fe):4>w?(j("DOMAutoComplete",_e),j("dragdrop",_e),j("drop",_e)):B&&H.type==="number"&&j("keydown",fe),j("change",_e),j("blur",_e),f.o(ee,null,{l:H})}},f.m.wa.textInput=!0,f.c.textinput={preprocess:function(H,te,z){z("textInput",H)}}}(),f.c.uniqueName={init:function(b,R){if(R()){var G="ko_unique_"+ ++f.c.uniqueName.rd;f.a.Yc(b,G)}}},f.c.uniqueName.rd=0,f.c.using={init:function(b,R,G,I,w){var N;return G.has("as")&&(N={as:G.get("as"),noChildContext:G.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,G){var I=f.a.R(b),w=I=="input";if(!w||b.type!="checkbox"&&b.type!="radio"){var N=[],B=G.get("valueUpdate"),U=!1,O=null;B&&(typeof B=="string"?N=[B]:N=f.a.wc(B),f.a.Pa(N,"change"));var k=function(){O=null,U=!1;var te=R(),z=f.w.M(b);f.m.eb(te,G,"value",z)};!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(){U=!0}),f.a.B(b,"focus",function(){U=!1}),f.a.B(b,"blur",function(){U&&k()})),f.a.D(N,function(te){var z=k;f.a.Ud(te,"after")&&(z=function(){O=f.w.M(b),f.a.setTimeout(k,0)},te=te.substring(5)),f.a.B(b,te,z)});var J;if(J=w&&b.type=="file"?function(){var te=f.a.f(R());te===null||te===e||te===""?b.value="":f.u.G(k)}:function(){var te=f.a.f(R()),z=f.w.M(b);O!==null&&te===O?f.a.setTimeout(J,0):(te!==z||z===e)&&(I==="select"?(z=G.get("valueAllowUnset"),f.w.cb(b,te,z),z||te===f.w.M(b)||f.u.G(k)):f.w.cb(b,te))},I==="select"){var H;f.i.subscribe(b,f.i.H,function(){H?G.get("valueAllowUnset")?J():k():(f.a.B(b,"change",k),H=f.o(J,null,{l:b}))},null,{notifyImmediately:!0})}else f.a.B(b,"change",k),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 G=f.a.f(R()),I=b.style.display!="none";G&&!I?b.style.display="":!G&&I&&(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,G,I,w,N){return f.c.event.init.call(this,R,function(){var B={};return B[b]=G(),B},I,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 G=R.getElementById(b);if(!G)throw Error("Cannot find template with ID "+b);return new f.C.F(G)}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,G,I){return b=this.makeTemplateSource(b,I),this.renderTemplateSource(b,R,G,I)},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,G){b=this.makeTemplateSource(b,G),R=R(b.text()),b.text(R),b.data("isRewritten",!0)},f.b("templateEngine",f.ca),f.kc=function(){function b(I,w,N,B){I=f.m.ac(I);for(var U=f.m.Ra,O=0;O<I.length;O++){var k=I[O].key;if(Object.prototype.hasOwnProperty.call(U,k)){var J=U[k];if(typeof J=="function"){if(k=J(I[O].value))throw Error(k)}else if(!J)throw Error("This template engine does not support the '"+k+"' binding within its templates")}}return N="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+f.m.vb(I,{valueAccessors:!0})+" } })()},'"+N.toLowerCase()+"')",B.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,G=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(I,w,N){w.isTemplateRewritten(I,N)||w.rewriteTemplate(I,function(B){return f.kc.Ld(B,w)},N)},Ld:function(I,w){return I.replace(R,function(N,B,U,O,k){return b(k,B,U,w)}).replace(G,function(N,B){return b(B,"<!-- ko -->","#comment",w)})},md:function(I,w){return f.aa.Xb(function(N,B){var U=N.nextSibling;U&&U.nodeName.toLowerCase()===w&&f.ib(U,I,B)})}}}(),f.b("__tr_ambtns",f.kc.md),function(){f.C={},f.C.F=function(G){if(this.F=G){var I=f.a.R(G);this.ab=I==="script"?1:I==="textarea"?2:I=="template"&&G.content&&G.content.nodeType===11?3:4}},f.C.F.prototype.text=function(){var G=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[G];var I=arguments[0];G==="innerHTML"?f.a.fc(this.F,I):this.F[G]=I};var b=f.a.g.Z()+"_";f.C.F.prototype.data=function(G){if(arguments.length===1)return f.a.g.get(this.F,b+G);f.a.g.set(this.F,b+G,arguments[1])};var R=f.a.g.Z();f.C.F.prototype.nodes=function(){var G=this.F;if(arguments.length==0){var I=f.a.g.get(G,R)||{},w=I.lb||(this.ab===3?G.content:this.ab===4?G:e);if(!w||I.jd){var N=this.text();N&&N!==I.bb&&(w=f.a.Md(N,G.ownerDocument),f.a.g.set(G,R,{lb:w,bb:N,jd:!0}))}return w}I=arguments[0],this.ab!==e&&this.text(""),f.a.g.set(G,R,{lb:I})},f.C.ia=function(G){this.F=G},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 G=f.a.g.get(this.F,R)||{};return G.bb===e&&G.lb&&(G.bb=G.lb.innerHTML),G.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(O,k,J){var H;for(k=f.h.nextSibling(k);O&&(H=O)!==k;)O=f.h.nextSibling(H),J(H,O)}function R(O,k){if(O.length){var J=O[0],H=O[O.length-1],te=J.parentNode,z=f.ga.instance,j=z.preprocessNode;if(j){if(b(J,H,function(ee,fe){var _e=ee.previousSibling,le=j.call(z,ee);le&&(ee===J&&(J=le[0]||fe),ee===H&&(H=le[le.length-1]||_e))}),O.length=0,!J)return;J===H?O.push(J):(O.push(J,H),f.a.Ua(O,te))}b(J,H,function(ee){ee.nodeType!==1&&ee.nodeType!==8||f.vc(k,ee)}),b(J,H,function(ee){ee.nodeType!==1&&ee.nodeType!==8||f.aa.cd(ee,[k])}),f.a.Ua(O,te)}}function G(O){return O.nodeType?O:0<O.length?O[0]:null}function I(O,k,J,H,te){te=te||{};var z=(O&&G(O)||J||{}).ownerDocument,j=te.templateEngine||N;if(f.kc.xd(J,j,z),J=j.renderTemplate(J,H,te,z),typeof J.length!="number"||0<J.length&&typeof J[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(z=!1,k){case"replaceChildren":f.h.va(O,J),z=!0;break;case"replaceNode":f.a.Xc(O,J),z=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+k)}return z&&(R(J,H),te.afterRender&&f.u.G(te.afterRender,null,[J,H[te.as||"$data"]]),k=="replaceChildren"&&f.i.ma(O,f.i.H)),J}function w(O,k,J){return f.O(O)?O():typeof O=="function"?O(k,J):O}var N;f.gc=function(O){if(O!=e&&!(O instanceof f.ca))throw Error("templateEngine must inherit from ko.templateEngine");N=O},f.dc=function(O,k,J,H,te){if(J=J||{},(J.templateEngine||N)==e)throw Error("Set a template engine before calling renderTemplate");if(te=te||"replaceChildren",H){var z=G(H);return f.$(function(){var ee=k&&k instanceof f.fa?k:new f.fa(k,null,null,null,{exportDependencies:!0}),j=w(O,ee.$data,ee),ee=I(H,te,j,ee,J);te=="replaceNode"&&(H=ee,z=G(H))},null,{Sa:function(){return!z||!f.a.Sb(z)},l:z&&te=="replaceNode"?z.parentNode:z})}return f.aa.Xb(function(j){f.dc(O,k,J,j,"replaceNode")})},f.Qd=function(O,k,J,H,te){function z(Se,Ie){f.u.G(f.a.ec,null,[H,Se,ee,J,j,Ie]),f.i.ma(H,f.i.H)}function j(Se,Ie){R(Ie,fe),J.afterRender&&J.afterRender(Ie,Se),fe=null}function ee(Se,Ie){fe=te.createChildContext(Se,{as:_e,noChildContext:J.noChildContext,extend:function(ke){ke.$index=Ie,_e&&(ke[_e+"Index"]=Ie)}});var Le=w(O,Se,fe);return I(H,"ignoreTargetNode",Le,fe,J)}var fe,_e=J.as,le=J.includeDestroyed===!1||f.options.foreachHidesDestroyed&&!J.includeDestroyed;if(le||J.beforeRemove||!f.Pc(k))return f.$(function(){var Se=f.a.f(k)||[];typeof Se.length>"u"&&(Se=[Se]),le&&(Se=f.a.jb(Se,function(Ie){return Ie===e||Ie===null||!f.a.f(Ie._destroy)})),z(Se)},null,{l:H});z(k.v());var ge=k.subscribe(function(Se){z(k(),Se)},null,"arrayChange");return ge.l(H),ge};var B=f.a.g.Z(),U=f.a.g.Z();f.c.template={init:function(O,k){var J=f.a.f(k());if(typeof J=="string"||"name"in J)f.h.Ea(O);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 H=J[0]&&J[0].parentNode;H&&f.a.g.get(H,U)||(H=f.a.Yb(J),f.a.g.set(H,U,!0)),new f.C.ia(O).nodes(H)}else if(J=f.h.childNodes(O),0<J.length)H=f.a.Yb(J),new f.C.ia(O).nodes(H);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(O,k,J,H,te){var z=k();k=f.a.f(z),J=!0,H=null,typeof k=="string"?k={}:(z="name"in k?k.name:O,"if"in k&&(J=f.a.f(k.if)),J&&"ifnot"in k&&(J=!f.a.f(k.ifnot)),J&&!z&&(J=!1)),"foreach"in k?H=f.Qd(z,J&&k.foreach||[],k,O,te):J?(J=te,"data"in k&&(J=te.createChildContext(k.data,{as:k.as,noChildContext:k.noChildContext,exportDependencies:!0})),H=f.dc(z,J,k,O)):f.h.Ea(O),te=H,(k=f.a.g.get(O,B))&&typeof k.s=="function"&&k.s(),f.a.g.set(O,B,!te||te.ja&&!te.ja()?e:te)}},f.m.Ra.template=function(O){return O=f.m.ac(O),O.length==1&&O[0].unknown||f.m.Id(O,"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,G){if(b.length&&R.length){var I,w,N,B,U;for(I=w=0;(!G||I<G)&&(B=b[w]);++w){for(N=0;U=R[N];++N)if(B.value===U.value){B.moved=U.index,U.moved=B.index,R.splice(N,1),I=N=0;break}I+=N}}},f.a.Pb=function(){function b(R,G,I,w,N){var B=Math.min,U=Math.max,O=[],k,J=R.length,H,te=G.length,z=te-J||1,j=J+te+1,ee,fe,_e;for(k=0;k<=J;k++)for(fe=ee,O.push(ee=[]),_e=B(te,k+z),H=U(0,k-1);H<=_e;H++)ee[H]=H?k?R[k-1]===G[H-1]?fe[H-1]:B(fe[H]||j,ee[H-1]||j)+1:H+1:k+1;for(B=[],U=[],z=[],k=J,H=te;k||H;)te=O[k][H]-1,H&&te===O[k][H-1]?U.push(B[B.length]={status:I,value:G[--H],index:H}):k&&te===O[k-1][H]?z.push(B[B.length]={status:w,value:R[--k],index:k}):(--H,--k,N.sparse||B.push({status:"retained",value:G[H]}));return f.a.Kc(z,U,!N.dontLimitMoves&&10*J),B.reverse()}return function(R,G,I){return I=typeof I=="boolean"?{dontLimitMoves:I}:I||{},R=R||[],G=G||[],R.length<G.length?b(R,G,"added","deleted",I):b(G,R,"deleted","added",I)}}(),f.b("utils.compareArrays",f.a.Pb),function(){function b(I,w,N,B,U){var O=[],k=f.$(function(){var J=w(N,U,f.a.Ua(O,I))||[];0<O.length&&(f.a.Xc(O,J),B&&f.u.G(B,null,[N,J,U])),O.length=0,f.a.Nb(O,J)},null,{l:I,Sa:function(){return!f.a.kd(O)}});return{Y:O,$:k.ja()?k:e}}var R=f.a.g.Z(),G=f.a.g.Z();f.a.ec=function(I,w,N,B,U,O){function k(He){Le={Aa:He,pb:f.ta(fe++)},j.push(Le),z||Ie.push(Le)}function J(He){Le=te[He],fe!==Le.pb.v()&&Se.push(Le),Le.pb(fe++),f.a.Ua(Le.Y,I),j.push(Le)}function H(He,Ut){if(He)for(var Ce=0,Ve=Ut.length;Ce<Ve;Ce++)f.a.D(Ut[Ce].Y,function(ct){He(ct,Ce,Ut[Ce].Aa)})}w=w||[],typeof w.length>"u"&&(w=[w]),B=B||{};var te=f.a.g.get(I,R),z=!te,j=[],ee=0,fe=0,_e=[],le=[],ge=[],Se=[],Ie=[],Le,ke=0;if(z)f.a.D(w,k);else{if(!O||te&&te._countWaitingForRemove){var Be=f.a.Mb(te,function(He){return He.Aa});O=f.a.Pb(Be,w,{dontLimitMoves:B.dontLimitMoves,sparse:!0})}for(var Be=0,st,vt,Ct;st=O[Be];Be++)switch(vt=st.moved,Ct=st.index,st.status){case"deleted":for(;ee<Ct;)J(ee++);vt===e&&(Le=te[ee],Le.$&&(Le.$.s(),Le.$=e),f.a.Ua(Le.Y,I).length&&(B.beforeRemove&&(j.push(Le),ke++,Le.Aa===G?Le=null:ge.push(Le)),Le&&_e.push.apply(_e,Le.Y))),ee++;break;case"added":for(;fe<Ct;)J(ee++);vt!==e?(le.push(j.length),J(vt)):k(st.value)}for(;fe<w.length;)J(ee++);j._countWaitingForRemove=ke}f.a.g.set(I,R,j),H(B.beforeMove,Se),f.a.D(_e,B.beforeRemove?f.oa:f.removeNode);var Xe,je,$e;try{$e=I.ownerDocument.activeElement}catch{}if(le.length)for(;(Be=le.shift())!=e;){for(Le=j[Be],Xe=e;Be;)if((je=j[--Be].Y)&&je.length){Xe=je[je.length-1];break}for(w=0;ee=Le.Y[w];Xe=ee,w++)f.h.Wb(I,ee,Xe)}for(Be=0;Le=j[Be];Be++){for(Le.Y||f.a.extend(Le,b(I,N,Le.Aa,U,Le.pb)),w=0;ee=Le.Y[w];Xe=ee,w++)f.h.Wb(I,ee,Xe);!Le.Ed&&U&&(U(Le.Aa,Le.Y,Le.pb),Le.Ed=!0,Xe=Le.Y[Le.Y.length-1])}for($e&&I.ownerDocument.activeElement!=$e&&$e.focus(),H(B.beforeRemove,ge),Be=0;Be<ge.length;++Be)ge[Be].Aa=G;H(B.afterMove,Se),H(B.afterAdd,Ie)}}(),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,G,I){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,I))},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(G,I,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 B=G.data("precompiled");return B||(B=G.text()||"",B=o.template(null,"{{ko_with $item.koBindingContext}}"+B+"{{/ko_with}}"),G.data("precompiled",B)),G=[I.$data],I=o.extend({koBindingContext:I},w.templateOptions),I=o.tmpl(B,G,I),I.appendTo(N.createElement("div")),o.fragments={},I},this.createJavaScriptEvaluatorBlock=function(G){return"{{ko_code ((function() { return "+G+" })()) }}"},this.addTemplate=function(G,I){n.write("<script type='text/html' id='"+G+"'>"+I+"<\/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 DTt=ko;typeof window<"u"?(ko=window.ko,typeof SA<"u"?window.ko=SA:delete window.ko):(ko=global.ko,typeof SA<"u"?global.ko=SA:delete global.ko);var fS=DTt;var K_o=T(S(),1);/**
 * @license
 * Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5
 * Copyright (c) Steve Sanderson
 * MIT license
 */var l6="__knockoutObservables",d6="__knockoutSubscribable";function hSe(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=fSe(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(o){if(!(o===l6||o===d6)&&!(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&&YTt(n,a)}}),e}function fSe(e,t){var n=e[l6];return!n&&t&&(n={},Object.defineProperty(e,l6,{value:n})),n}function BTt(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),hSe.call(i,e,[t]),e}function YTt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=OTt(e,t,i))})}function OTt(e,t,n){var i=HTt(e,n);return i.subscribe(t)}function HTt(e,t){var n=t[d6];if(!n){n=new e.subscribable,Object.defineProperty(t,d6,{value:n});var i={};zTt(t,n,i),KTt(e,t,n,i)}return n}function zTt(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 KTt(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 pSe(e,t){if(!e)return null;var n=fSe(e,!1);return n&&n[t]||null}function JTt(e,t){var n=pSe(e,t);n&&n.valueHasMutated()}function QTt(e){e.track=hSe,e.getObservable=pSe,e.valueHasMutated=JTt,e.defineProperty=BTt}var CA={attachToKo:QTt};var Q_o=T(S(),1),bSe="http://www.w3.org/2000/svg",gSe="cesium-svgPath-svg",jTt={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(bSe,"svg:svg");i.setAttribute("class",gSe);let o=document.createElementNS(bSe,"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",`${gSe} ${e.unwrap(r.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},VA=jTt;CA.attachToKo(fS);VA.register(fS);var Te=fS;function LA(e){l(e)||(e=new eh),this._clock=e,this._eventHelper=new vr,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=Te.observable(q.now()),this.systemTime.equalityComparer=q.equals,this.startTime=Te.observable(e.startTime),this.startTime.equalityComparer=q.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=Te.observable(e.stopTime),this.stopTime.equalityComparer=q.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=Te.observable(e.currentTime),this.currentTime.equalityComparer=q.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=Te.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=Te.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=Te.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=Te.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=Te.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),Te.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(LA.prototype,{clock:{get:function(){return this._clock}}});LA.prototype.synchronize=function(){let e=this._clock;this.systemTime=q.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};LA.prototype.isDestroyed=function(){return!1};LA.prototype.destroy=function(){this._eventHelper.removeAll(),me(this)};var RA=LA;var cTo=T(S(),1);function qTt(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,pe.throwInstantiationError()}var u6=qTt;var mTo=T(S(),1);var ZA={};ZA.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};ZA.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};ZA.createRangeInput=function(e,t,n,i,o,r){r=y(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=y(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};ZA.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 Ua=ZA;var yTo=T(S(),1);function ySe(e,t){this._command=e,t=y(t,y.EMPTY_OBJECT),this.toggled=y(t.toggled,!1),this.tooltip=y(t.tooltip,""),Te.track(this,["toggled","tooltip"])}Object.defineProperties(ySe.prototype,{command:{get:function(){return this._command}}});var vy=ySe;var VTo=T(S(),1);function $Tt(e,t){t=y(t,!0);let n=new be,i=new be;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,Te.track(o,["canExecute"]),Object.defineProperties(o,{beforeExecute:{value:n},afterExecute:{value:i}}),o}var Ln=$Tt;var ZTo=T(S(),1);function eSt(e,t,n,i,o){return n.call(i,e[t]),Te.getObservable(e,t).subscribe(n,i,o)}var ba=eSt;var WTo=T(S(),1);var pS="http://www.w3.org/2000/svg",TSe="http://www.w3.org/1999/xlink",J3,GA=Y.fromCssColorString("rgba(247,250,255,0.384)"),Q3=Y.fromCssColorString("rgba(143,191,255,0.216)"),m6=Y.fromCssColorString("rgba(153,197,255,0.098)"),j3=Y.fromCssColorString("rgba(255,255,255,0.086)"),tSt=Y.fromCssColorString("rgba(255,255,255,0.267)"),nSt=Y.fromCssColorString("rgba(255,255,255,0)"),xSe=Y.fromCssColorString("rgba(66,67,68,0.3)"),_Se=Y.fromCssColorString("rgba(0,0,0,0.5)");function wy(e){return Y.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var EA={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(pS,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(TSe,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function h6(e,t,n){let i=document.createElementNS(pS,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let o=document.createElementNS(pS,"tspan");return o.textContent=n,i.appendChild(o),i}function iSt(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var q3=new Y;function $r(e,t){let n=t.alpha,i=1-n;return q3.red=e.red*i+t.red*n,q3.green=e.green*i+t.green*n,q3.blue=e.blue*i+t.blue*n,q3.toCssColorString()}function f6(e,t,n){let i=EA[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 oSt(e,t,n){let i=EA[n],o=EA.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 rSt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&J3!==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,g=Math.atan2(p,m)*180/Math.PI+90;g>180&&(g-=360);let f=n.shuttleRingAngle;i||c<u.right&&c>u.left&&d>u.top&&d<u.bottom?(J3=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=g):g<f?n.slower():g>f&&n.faster(),t.preventDefault()}else e===J3&&(J3=void 0),n.shuttleRingDragging=!1}function bb(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)]}bb.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();me(this)};bb.prototype.isDestroyed=function(){return!1};bb.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")}};bb.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")))};bb.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function GL(e,t){e=In(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(pS,"svg:svg");this._svgNode=r,r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",TSe);let s=document.createElementNS(pS,"g");this._topG=s,this._realtimeSVG=new bb(oSt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new bb(f6(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new bb(f6(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new bb(f6(84,99,"animation_pathPause"),t.pauseViewModel);let a=document.createElementNS(pS,"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=EA.animation_pathSwooshFX,u=EA.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 g=61,f=vh({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:g});this._knobDate=h6(0,-24,""),this._knobTime=h6(0,-7,""),this._knobStatus=h6(0,-41,"");let x=vh({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:g}),_=document.createElementNS(pS,"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(v){rSt(C,v)}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],E=this._knobStatus.childNodes[0],X;this._subscriptions=[ba(t.pauseViewModel,"toggled",function(v){X!==v&&(X=v,X?C._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):C._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),ba(t,"shuttleRingAngle",function(v){iSt(C._shuttleRingPointer,C._knobOuter,v)}),ba(t,"dateLabel",function(v){Z.textContent!==v&&(Z.textContent=v)}),ba(t,"timeLabel",function(v){L.textContent!==v&&(L.textContent=v)}),ba(t,"multiplierLabel",function(v){E.textContent!==v&&(E.textContent=v)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(GL.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});GL.prototype.isDestroyed=function(){return!1};GL.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 me(this)};GL.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};GL.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=wy(this._themeNormal),n=wy(this._themeHover),i=wy(this._themeSelect),o=wy(this._themeDisabled),r=wy(this._themeKnob),s=wy(this._themePointer),a=wy(this._themeSwoosh),c=wy(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":$r(t,GA)},{tagName:"stop",offset:"12%","stop-color":$r(t,Q3)},{tagName:"stop",offset:"46%","stop-color":$r(t,m6)},{tagName:"stop",offset:"81%","stop-color":$r(t,j3)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":$r(n,GA)},{tagName:"stop",offset:"12%","stop-color":$r(n,Q3)},{tagName:"stop",offset:"46%","stop-color":$r(n,m6)},{tagName:"stop",offset:"81%","stop-color":$r(n,j3)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":$r(i,GA)},{tagName:"stop",offset:"12%","stop-color":$r(i,Q3)},{tagName:"stop",offset:"46%","stop-color":$r(i,m6)},{tagName:"stop",offset:"81%","stop-color":$r(i,j3)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":$r(o,tSt)},{tagName:"stop",offset:"75%","stop-color":$r(o,nSt)}]},{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":$r(s,_Se)},{tagName:"stop",offset:"100%","stop-color":$r(s,_Se)}]},{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":$r(r,GA)},{tagName:"stop",offset:"60%","stop-color":$r(r,xSe)},{tagName:"stop",offset:"85%","stop-color":$r(r,Q3)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":$r(r,xSe)},{tagName:"stop",offset:"60%","stop-color":$r(r,GA)},{tagName:"stop",offset:"85%","stop-color":$r(r,j3)}]}]});l(this._defsElement)?this._svgNode.replaceChild(d,this._defsElement):this._svgNode.appendChild(d),this._defsElement=d};var XA=GL;var kTo=T(S(),1);var sSt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Fy=15,EL=105;function SSe(e,t){return e-t}function p6(e,t){let n=Go(t,e,SSe);return n<0?~n:n}function aSt(e,t){if(Math.abs(e)<=Fy)return e/Fy;let n=Fy,i=EL,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 cSt(e,t,n){if(n.clockStep===mo.SYSTEM_CLOCK)return Fy;if(Math.abs(e)<=1)return e*Fy;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let o=Fy,r=EL,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 am(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=am.defaultDateFormatter,this._timeFormatter=am.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,Te.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(am.defaultTicks),this.timeLabel=void 0,Te.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,Te.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,Te.defineProperty(this,"multiplierLabel",function(){let s=t._clockViewModel;if(s.clockStep===mo.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,Te.defineProperty(this,"shuttleRingAngle",{get:function(){return cSt(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,EL),-EL);let a=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=mo.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===EL){c.multiplier=s>0?a[a.length-1]:a[0];return}let d=aSt(s,a);if(t.snapToTicks)d=a[p6(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>Fy?d=Math.round(d):u>1?d=+d.toFixed(1):u>0&&(d=+d.toFixed(2))}c.multiplier=d}}),this._canAnimate=void 0,Te.defineProperty(this,"_canAnimate",function(){let s=t._clockViewModel,a=s.clockRange;if(t.shuttleRingDragging||a===Mr.UNBOUNDED)return!0;let c=s.multiplier,d=s.currentTime,u=s.startTime,m=!1;if(a===Mr.LOOP_STOP)m=q.greaterThan(d,u)||d.equals(u)&&c>0;else{let p=s.stopTime;m=q.greaterThan(d,u)&&q.lessThan(d,p)||d.equals(u)&&c>0||d.equals(p)&&c<0}return m||(s.shouldAnimate=!1),m}),this._isSystemTimeAvailable=void 0,Te.defineProperty(this,"_isSystemTimeAvailable",function(){let s=t._clockViewModel;if(s.clockRange===Mr.UNBOUNDED)return!0;let c=s.systemTime;return q.greaterThanOrEquals(c,s.startTime)&&q.lessThanOrEquals(c,s.stopTime)}),this._isAnimating=void 0,Te.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=Ln(function(){let s=t._clockViewModel;s.shouldAnimate?s.shouldAnimate=!1:t._canAnimate&&(s.shouldAnimate=!0)});this._pauseViewModel=new vy(n,{toggled:Te.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=Ln(function(){let s=t._clockViewModel,a=s.multiplier;a>0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playReverseViewModel=new vy(i,{toggled:Te.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let o=Ln(function(){let s=t._clockViewModel,a=s.multiplier;a<0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playForwardViewModel=new vy(o,{toggled:Te.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==mo.SYSTEM_CLOCK}),tooltip:"Play Forward"});let r=Ln(function(){t._clockViewModel.clockStep=mo.SYSTEM_CLOCK},Te.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new vy(r,{toggled:Te.computed(function(){return e.clockStep===mo.SYSTEM_CLOCK}),tooltip:Te.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=Ln(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,d=p6(c,a)-1;d>=0&&(s.multiplier=a[d])}),this._faster=Ln(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,d=p6(c,a)+1;d<a.length&&(s.multiplier=a[d])})}am.defaultDateFormatter=function(e,t){let n=q.toGregorianDate(e);return`${sSt[n.month-1]} ${n.day} ${n.year}`};am.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];am.defaultTimeFormatter=function(e,t){let n=q.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`};am.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};am.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(SSe);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(am.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}}});am._maxShuttleRingAngle=EL;am._realtimeShuttleRingAngle=Fy;var IA=am;var $To=T(S(),1);var HTo=T(S(),1);function CSe(e){e=y(e,y.EMPTY_OBJECT);let t=e.globe,n=y(e.imageryProviderViewModels,[]),i=y(e.terrainProviderViewModels,[]);this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,Te.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let o=Te.getObservable(this,"imageryProviderViewModels"),r=Te.pureComputed(function(){let m=o(),p={},g;for(g=0;g<m.length;g++){let _=m[g],C=_.category;l(p[C])?p[C].push(_):p[C]=[_]}let f=Object.keys(p),x=[];for(g=0;g<f.length;g++){let _=f[g];x.push({name:_,providers:p[_]})}return x});this._imageryProviders=r;let s=Te.getObservable(this,"terrainProviderViewModels"),a=Te.pureComputed(function(){let m=s(),p={},g;for(g=0;g<m.length;g++){let _=m[g],C=_.category;l(p[C])?p[C].push(_):p[C]=[_]}let f=Object.keys(p),x=[];for(g=0;g<f.length;g++){let _=f[g];x.push({name:_,providers:p[_]})}return x});this._terrainProviders=a,this.buttonTooltip=void 0,Te.defineProperty(this,"buttonTooltip",function(){let m=this.selectedImagery,p=this.selectedTerrain,g=l(m)?m.name:void 0,f=l(p)?p.name:void 0;return l(g)&&l(f)?`${g}
${f}`:l(g)?g:f}),this.buttonImageUrl=void 0,Te.defineProperty(this,"buttonImageUrl",function(){let m=this.selectedImagery;if(l(m))return m.iconUrl}),this.selectedImagery=void 0;let c=Te.observable();this._currentImageryLayers=[],Te.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(m){if(c()===m){this.dropDownVisible=!1;return}let p,g=this._currentImageryLayers,f=g.length,x=this._globe.imageryLayers,_=!1;for(p=0;p<f;p++){let C=x.length;for(let V=0;V<C;V++){let L=x.get(V);if(L===g[p]){x.remove(L),_=!0;break}}}if(l(m)){let C=m.creationCommand();if(Array.isArray(C)){let V=C.length;for(this._currentImageryLayers=[],p=V-1;p>=0;p--){let L=ha.fromProviderAsync(C[p]);x.add(L,0),this._currentImageryLayers.push(L)}}else{this._currentImageryLayers=[];let V=ha.fromProviderAsync(C);if(V.name=m.name,_)x.add(V,0);else{let L=x.get(0);l(L)&&x.remove(L),x.add(V,0)}this._currentImageryLayers.push(V)}}c(m),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let d=Te.observable();Te.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))this._globe.depthTestAgainstTerrain=!(p instanceof Af),this._globe.terrainProvider=p;else if(l(p)){let g=!1,f=this._globe.terrainProviderChanged.addEventListener(()=>{g=!0,f()}),_=new gA(p).readyEvent.addEventListener(C=>{g||(this._globe.depthTestAgainstTerrain=!(C instanceof Af),this._globe.terrainProvider=C,_())})}d(m),this.dropDownVisible=!1}});let u=this;this._toggleDropDown=Ln(function(){u.dropDownVisible=!u.dropDownVisible}),this.selectedImagery=y(e.selectedImageryProviderViewModel,n[0]),this.selectedTerrain=e.selectedTerrainProviderViewModel}Object.defineProperties(CSe.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var WA=CSe;function $3(e,t){e=In(e);let n=new WA(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 g=document.createElement("div");g.className="cesium-baseLayerPicker-itemLabel",g.setAttribute("data-bind","text: name"),m.appendChild(g);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 E=document.createElement("div");E.className="cesium-baseLayerPicker-itemLabel",E.setAttribute("data-bind","text: name"),L.appendChild(E),Te.applyBindings(n,i),Te.applyBindings(n,r),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=r,this._closeDropDown=function(X){i.contains(X.target)||r.contains(X.target)||(n.dropDownVisible=!1)},Ot.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties($3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});$3.prototype.isDestroyed=function(){return!1};$3.prototype.destroy=function(){return Ot.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Te.cleanNode(this._element),Te.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),me(this)};var PA=$3;var rSo=T(S(),1);function VSe(e){let t=e.creationFunction;l(t.canExecute)||(t=Ln(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=y(e.category,""),Te.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(VSe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var es=VSe;var lSo=T(S(),1);function lSt(){let e=[],t=devicePixelRatio>=2;return e.push(new es({name:"Bing Maps Aerial",iconUrl:nn("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return nb({style:tb.AERIAL})}})),e.push(new es({name:"Bing Maps Aerial with Labels",iconUrl:nn("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return nb({style:tb.AERIAL_WITH_LABELS})}})),e.push(new es({name:"Bing Maps Roads",iconUrl:nn("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return nb({style:tb.ROAD})}})),e.push(new es({name:"ArcGIS World Imagery",iconUrl:nn("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 Q0.fromBasemapType(Ch.SATELLITE,{enablePickFeatures:!1})}})),e.push(new es({name:"ArcGIS World Hillshade",iconUrl:nn("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 Q0.fromBasemapType(Ch.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new es({name:"Esri World Ocean",iconUrl:nn("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 Q0.fromBasemapType(Ch.OCEANS,{enablePickFeatures:!1})}})),e.push(new es({name:"Open\xADStreet\xADMap",iconUrl:nn("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 sb({url:"https://tile.openstreetmap.org/"})}})),e.push(new es({name:"Stadia x Stamen Watercolor",iconUrl:nn("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 sb({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 es({name:"Stadia x Stamen Toner",iconUrl:nn("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 sb({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 es({name:"Stadia Alidade Smooth",iconUrl:nn("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 sb({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 es({name:"Stadia Alidade Smooth Dark",iconUrl:nn("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 sb({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 es({name:"Sentinel-2",iconUrl:nn("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 eb.fromAssetId(3954)}})),e.push(new es({name:"Blue Marble",iconUrl:nn("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return eb.fromAssetId(3845)}})),e.push(new es({name:"Earth at night",iconUrl:nn("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 eb.fromAssetId(3812)}})),e.push(new es({name:"Natural Earth\xA0II",iconUrl:nn("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast.
http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return Vy.fromUrl(nn("Assets/Textures/NaturalEarthII"))}})),e}var vA=lSt;var hSo=T(S(),1);function dSt(){let e=[];return e.push(new es({name:"WGS84 Ellipsoid",iconUrl:nn("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new Af({ellipsoid:ne.WGS84})}})),e.push(new es({name:"Cesium World Terrain",iconUrl:nn("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 LT({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var wA=dSt;var LSo=T(S(),1);var ySo=T(S(),1);function uSt(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof ra&&(e.tileset=n.primitive),e.pickActive=!1}}function RSe(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof ra&&(e.tileset=i.primitive)},Sn.MOUSE_MOVE):(e._eventHandler.removeInputAction(Sn.MOUSE_MOVE),e.picking=e.picking)}var mSt={maximumFractionDigits:3};function FA(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,mSt):Math.round(t).toLocaleString()}function AA(e,t){if(!l(e))return"";let n=t?e._statisticsPerPass[vo.PICK]:e._statisticsPerPass[vo.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>${FA(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${FA(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${FA(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function ZSe(){let e=Bi.statistics;return`
  <ul class="cesium-cesiumInspector-statistics">
    <li><strong>Geometry Memory (MB): </strong>${FA(e.geometryByteLength)}</li>
    <li><strong>Texture Memory (MB): </strong>${FA(e.texturesByteLength)}</li>
  </ul>
  `}var hSt=[{text:"Highlight",value:Ll.HIGHLIGHT},{text:"Replace",value:Ll.REPLACE},{text:"Mix",value:Ll.MIX}],LSe=new Y(1,1,0,.4),fSt=new Y,eB=new Y;function ga(e,t){let n=this,i=e.canvas;this._eventHandler=new Bd(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new ab({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,Te.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=Te.observable({}),this.properties=[],Te.defineProperty(this,"properties",function(){let k=[],J=n._properties();for(let H in J)J.hasOwnProperty(H)&&k.push(H);return k});let o=Te.observable();Te.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return o()},set:function(k){o(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceError=k)}}),this.dynamicScreenSpaceError=!1;let r=Te.observable();Te.defineProperty(this,"colorBlendMode",{get:function(){return r()},set:function(k){r(k),l(n._tileset)&&(n._tileset.colorBlendMode=k,n._scene.requestRender())}}),this.colorBlendMode=Ll.HIGHLIGHT;let s=Te.observable(),a=Te.observable();Te.defineProperty(this,"picking",{get:function(){return a()},set:function(k){a(k),k?n._eventHandler.setInputAction(function(J){let H=e.pick(J.endPosition);if(H instanceof vs?(n.feature=H,n.tile=H.content.tile):l(H)&&l(H.content)?(n.feature=void 0,n.tile=H.content.tile):(n.feature=void 0,n.tile=void 0),!!l(n._tileset)){if(s&&l(H)&&l(H.content)){let te;e.pickPositionSupported&&(te=e.pickPosition(J.endPosition),l(te)&&(n._tileset.debugPickPosition=te)),n._tileset.debugPickedTile=H.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},Sn.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(Sn.MOUSE_MOVE))}}),this.picking=!0;let c=Te.observable();Te.defineProperty(this,"colorize",{get:function(){return c()},set:function(k){c(k),l(n._tileset)&&(n._tileset.debugColorizeTiles=k,n._scene.requestRender())}}),this.colorize=!1;let d=Te.observable();Te.defineProperty(this,"wireframe",{get:function(){return d()},set:function(k){d(k),l(n._tileset)&&(n._tileset.debugWireframe=k,n._scene.requestRender())}}),this.wireframe=!1;let u=Te.observable();Te.defineProperty(this,"showBoundingVolumes",{get:function(){return u()},set:function(k){u(k),l(n._tileset)&&(n._tileset.debugShowBoundingVolume=k,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let m=Te.observable();Te.defineProperty(this,"showContentBoundingVolumes",{get:function(){return m()},set:function(k){m(k),l(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=k,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=Te.observable();Te.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(k){p(k),l(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=k,n._scene.requestRender())}}),this.showRequestVolumes=!1;let g=Te.observable();Te.defineProperty(this,"freezeFrame",{get:function(){return g()},set:function(k){g(k),l(n._tileset)&&(n._tileset.debugFreezeFrame=k,n._scene.debugShowFrustumPlanes=k,n._scene.requestRender())}}),this.freezeFrame=!1,Te.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return s()},set:function(k){s(k),l(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=k,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let f=Te.observable();Te.defineProperty(this,"showGeometricError",{get:function(){return f()},set:function(k){f(k),l(n._tileset)&&(n._tileset.debugShowGeometricError=k,n._scene.requestRender())}}),this.showGeometricError=!1;let x=Te.observable();Te.defineProperty(this,"showRenderingStatistics",{get:function(){return x()},set:function(k){x(k),l(n._tileset)&&(n._tileset.debugShowRenderingStatistics=k,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let _=Te.observable();Te.defineProperty(this,"showMemoryUsage",{get:function(){return _()},set:function(k){_(k),l(n._tileset)&&(n._tileset.debugShowMemoryUsage=k,n._scene.requestRender())}}),this.showMemoryUsage=!1;let C=Te.observable();Te.defineProperty(this,"showUrl",{get:function(){return C()},set:function(k){C(k),l(n._tileset)&&(n._tileset.debugShowUrl=k,n._scene.requestRender())}}),this.showUrl=!1;let V=Te.observable();Te.defineProperty(this,"maximumScreenSpaceError",{get:function(){return V()},set:function(k){k=Number(k),isNaN(k)||(V(k),l(n._tileset)&&(n._tileset.maximumScreenSpaceError=k))}}),this.maximumScreenSpaceError=16;let L=Te.observable();Te.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return L()},set:function(k){k=Number(k),isNaN(k)||(L(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=k))}}),this.dynamicScreenSpaceErrorDensity=2e-4,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,Te.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(L(),1/6)},set:function(k){let J=Math.pow(k,6);L(J),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=J)}});let Z=Te.observable();Te.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return Z()},set:function(k){k=Number(k),isNaN(k)||(Z(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=k))}}),this.dynamicScreenSpaceErrorFactor=24;let E=uSt(this),X=Te.observable();Te.defineProperty(this,"pickActive",{get:function(){return X()},set:function(k){X(k),k?n._eventHandler.setInputAction(E,Sn.LEFT_CLICK):n._eventHandler.removeInputAction(Sn.LEFT_CLICK)}});let v=Te.observable();Te.defineProperty(this,"pointCloudShading",{get:function(){return v()},set:function(k){v(k),l(n._tileset)&&(n._tileset.pointCloudShading.attenuation=k)}}),this.pointCloudShading=!1;let P=Te.observable();Te.defineProperty(this,"geometricErrorScale",{get:function(){return P()},set:function(k){k=Number(k),isNaN(k)||(P(k),l(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=k))}}),this.geometricErrorScale=1;let A=Te.observable();Te.defineProperty(this,"maximumAttenuation",{get:function(){return A()},set:function(k){k=Number(k),isNaN(k)||(A(k),l(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=k===0?void 0:k))}}),this.maximumAttenuation=0;let M=Te.observable();Te.defineProperty(this,"baseResolution",{get:function(){return M()},set:function(k){k=Number(k),isNaN(k)||(M(k),l(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=k===0?void 0:k))}}),this.baseResolution=0;let b=Te.observable();Te.defineProperty(this,"eyeDomeLighting",{get:function(){return b()},set:function(k){b(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=k)}}),this.eyeDomeLighting=!1;let R=Te.observable();Te.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return R()},set:function(k){k=Number(k),isNaN(k)||(R(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=k))}}),this.eyeDomeLightingStrength=1;let G=Te.observable();Te.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return G()},set:function(k){k=Number(k),isNaN(k)||(G(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=k))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let I=Te.observable();Te.defineProperty(this,"skipLevelOfDetail",{get:function(){return I()},set:function(k){I(k),l(n._tileset)&&(n._tileset.skipLevelOfDetail=k)}}),this.skipLevelOfDetail=!0;let w=Te.observable();Te.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return w()},set:function(k){k=Number(k),isNaN(k)||(w(k),l(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=k))}}),this.skipScreenSpaceErrorFactor=16;let N=Te.observable();Te.defineProperty(this,"baseScreenSpaceError",{get:function(){return N()},set:function(k){k=Number(k),isNaN(k)||(N(k),l(n._tileset)&&(n._tileset.baseScreenSpaceError=k))}}),this.baseScreenSpaceError=1024;let B=Te.observable();Te.defineProperty(this,"skipLevels",{get:function(){return B()},set:function(k){k=Number(k),isNaN(k)||(B(k),l(n._tileset)&&(n._tileset.skipLevels=k))}}),this.skipLevels=1;let U=Te.observable();Te.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return U()},set:function(k){U(k),l(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=k)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let O=Te.observable();Te.defineProperty(this,"loadSiblings",{get:function(){return O()},set:function(k){O(k),l(n._tileset)&&(n._tileset.loadSiblings=k)}}),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)||RSe(this,!0)}Object.defineProperties(ga.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 hSt}},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=AA(e,!1),this._pickStatisticsText=AA(e,!0),this._resourceCacheStatisticsText=ZSe(),RSe(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,fSt):Y.WHITE:t.color=eB,this._scene.requestRender()),l(e)&&(Y.clone(e.color,eB),e.color=LSe,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()&&!b6(t.content)&&(t.color=eB,this._scene.requestRender()),l(e)&&!b6(e.content)&&(Y.clone(e.color,eB),e.color=LSe,this._scene.requestRender()),this._tile=e}}});function b6(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(!b6(t[i]))return!1;return!0}return!1}ga.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};ga.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};ga.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};ga.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};ga.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};ga.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};ga.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};ga.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};ga.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};ga.prototype.trimTilesCache=function(){l(this._tileset)&&this._tileset.trimLoadedTiles()};ga.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 XT(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};ga.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};ga.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=AA(e,!1),this._pickStatisticsText=AA(e,!0),this._resourceCacheStatisticsText=ZSe())};ga.prototype.isDestroyed=function(){return!1};ga.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){Te.getObservable(e,t).dispose()}),me(this)};ga.getStatistics=AA;var MA=ga;function tB(e,t){e=In(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let o=new MA(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=Ua.createSection,c=Ua.createCheckbox,d=Ua.createRangeInput,u=Ua.createButton,m=a(s,"Tileset","tilesetVisible","toggleTileset"),p=a(s,"Display","displayVisible","toggleDisplay"),g=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 E=p.appendChild(c("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),X=document.createElement("p");X.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),X.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),X.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",E.appendChild(X),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 v=document.createElement("div");v.setAttribute("data-bind","visible: pointCloudShading"),v.appendChild(d("Geometric Error Scale","geometricErrorScale",0,2,.01)),v.appendChild(d("Maximum Attenuation","maximumAttenuation",0,32,1)),v.appendChild(d("Base Resolution","baseResolution",0,1,.01)),v.appendChild(c("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(v);let P=document.createElement("div");P.setAttribute("data-bind","visible: eyeDomeLighting"),P.appendChild(d("EDL Strength","eyeDomeLightingStrength",0,2,.1)),P.appendChild(d("EDL Radius","eyeDomeLightingRadius",0,4,.1)),v.appendChild(P),g.appendChild(c("Freeze Frame","freezeFrame")),g.appendChild(c("Dynamic Screen Space Error","dynamicScreenSpaceError"));let A=document.createElement("div");A.appendChild(d("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),g.appendChild(A);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)),g.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 G=document.createElement("div");G.className="cesium-3dTilesInspector-statistics",G.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),f.appendChild(G);let I=document.createElement("div");_.appendChild(I),I.appendChild(document.createTextNode("Color Blend Mode: "));let w=document.createElement("select");w.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),I.appendChild(w);let N=document.createElement("textarea");N.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),I.className="cesium-cesiumInspector-styleEditor",I.appendChild(N);let B=u("Compile (Ctrl+Enter)","compileStyle");I.appendChild(B);let U=document.createElement("div");U.className="cesium-cesiumInspector-error",U.setAttribute("data-bind","text: editorError"),I.appendChild(U),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 O=document.createElement("div");O.appendChild(d("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),C.appendChild(O);let k=document.createElement("div");k.appendChild(d("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),C.appendChild(k);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")),Te.applyBindings(o,n)}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 Te.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),me(this)};var NA=tB;var NSo=T(S(),1);var ISo=T(S(),1);function pSt(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 g6(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var bSt=new pn,gSt=new h;function kA(e,t){let n=this,i=e.canvas,o=new Bd(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="",Te.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=Ln(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=Ln(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=Ln(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=Ln(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=Te.getObservable(this,"frustums").subscribe(function(d){n._scene.debugShowFrustums=d,n._scene.requestRender()}),this._frustumPlanesSubscription=Te.getObservable(this,"frustumPlanes").subscribe(function(d){n._scene.debugShowFrustumPlanes=d,n._scene.requestRender()}),this._performanceSubscription=Te.getObservable(this,"performance").subscribe(function(d){d?n._performanceDisplay=new ab({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=Ln(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=Te.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=Ln(function(){if(n.primitiveReferenceFrame){let d=n._primitive.modelMatrix;n._modelMatrixPrimitive=new rF({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=Te.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=Ln(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=Te.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=Te.getObservable(this,"wireframe").subscribe(function(d){r._surface.tileProvider._debug.wireframe=d,n._scene.requestRender()}),this._depthFrustumSubscription=Te.getObservable(this,"depthFrustum").subscribe(function(d){n._scene.debugShowDepthFrustum=d,n._scene.requestRender()}),this._incrementDepthFrustum=Ln(function(){let d=n.depthFrustum+1;return n.depthFrustum=g6(1,n._numberOfFrustums,d),n._scene.requestRender(),!0}),this._decrementDepthFrustum=Ln(function(){let d=n.depthFrustum-1;return n.depthFrustum=g6(1,n._numberOfFrustums,d),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=Te.getObservable(this,"suspendUpdates").subscribe(function(d){r._surface._debug.suspendLodUpdate=d,d||(n.filterTile=!1)});let s;this._showTileCoordinates=Ln(function(){return n.tileCoordinates&&!l(s)?s=e.imageryLayers.addImageryProvider(new xA({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&l(s)&&(e.imageryLayers.remove(s),s=void 0),!0}),this._tileCoordinatesSubscription=Te.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=Te.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=Ln(function(){return n.tileBoundingSphere?r._surface.tileProvider._debug.boundingSphereTile=n._tile:r._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=Ln(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=Te.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=Ln(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=Te.getObservable(this,"pickPrimitiveActive").subscribe(function(d){d?o.setInputAction(a,Sn.LEFT_CLICK):o.removeInputAction(Sn.LEFT_CLICK)});function c(d){let u,m=r.ellipsoid,p=n._scene.camera.getPickRay(d.position,bSt),g=r.pick(p,n._scene,gSt);if(l(g)){let f=m.cartesianToCartographic(g),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];ae.contains(L.rectangle,f)&&(u=L)}}}n.tile=u,n.pickTileActive=!1}this._pickTile=Ln(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=Te.getObservable(this,"pickTileActive").subscribe(function(d){d?o.setInputAction(c,Sn.LEFT_CLICK):o.removeInputAction(Sn.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(kA.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 Ln(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return Ln(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return Ln(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return Ln(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return Ln(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}}});kA.prototype._update=function(){this.frustums&&(this.frustumStatisticText=pSt(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=g6(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}`};kA.prototype.isDestroyed=function(){return!1};kA.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(),me(this)};var UA=kA;function nB(e,t){e=In(e);let n=document.createElement("div"),i=new UA(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=Ua.createSection,c=Ua.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 g=document.createElement("div");d.appendChild(g);let f=document.createElement("span");f.setAttribute("data-bind",'html: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Frustum:"'),g.appendChild(f);let x=document.createElement("span");x.setAttribute("data-bind","text: depthFrustumText"),g.appendChild(x);let _=document.createElement("input");_.type="button",_.value="-",_.className="cesium-cesiumInspector-pickButton",_.setAttribute("data-bind","click: decrementDepthFrustum"),g.appendChild(_);let C=document.createElement("input");C.type="button",C.value="+",C.className="cesium-cesiumInspector-pickButton",C.setAttribute("data-bind","click: incrementDepthFrustum"),g.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 E=document.createElement("div");E.className="cesium-cesiumInspector-center",E.appendChild(Z),L.appendChild(E),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 X=a(s,"Terrain","terrainVisible","toggleTerrain"),v=document.createElement("div");v.className="cesium-cesiumInspector-pickSection",X.appendChild(v);let P=document.createElement("input");P.type="button",P.value="Pick a tile",P.className="cesium-cesiumInspector-pickButton",P.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),E=document.createElement("div"),E.appendChild(P),E.className="cesium-cesiumInspector-center",v.appendChild(E);let A=document.createElement("div");v.appendChild(A);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 G=document.createElement("input");G.type="button",G.value="SW",G.className="cesium-cesiumInspector-pickButton",G.setAttribute("data-bind","click: selectSW");let I=document.createElement("input");I.type="button",I.value="SE",I.className="cesium-cesiumInspector-pickButton",I.setAttribute("data-bind","click: selectSE");let w=document.createElement("div");w.className="cesium-cesiumInspector-tileText",A.className="cesium-cesiumInspector-frustumStatistics",A.appendChild(w),A.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:",A.appendChild(N);let B=document.createElement("table"),U=document.createElement("tr"),O=document.createElement("tr"),k=document.createElement("td");k.appendChild(M);let J=document.createElement("td");J.appendChild(b);let H=document.createElement("td");H.appendChild(R),U.appendChild(k),U.appendChild(J),U.appendChild(H);let te=document.createElement("td"),z=document.createElement("td");z.appendChild(G);let j=document.createElement("td");j.appendChild(I),O.appendChild(te),O.appendChild(z),O.appendChild(j),B.appendChild(U),B.appendChild(O),A.appendChild(B),v.appendChild(c("Show bounding volume","tileBoundingSphere","hasPickedTile")),v.appendChild(c("Show only selected","filterTile","hasPickedTile")),X.appendChild(c("Wireframe","wireframe")),X.appendChild(c("Suspend LOD update","suspendUpdates")),X.appendChild(c("Show tile coordinates","tileCoordinates")),Te.applyBindings(i,this._element)}Object.defineProperties(nB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});nB.prototype.isDestroyed=function(){return!1};nB.prototype.destroy=function(){return Te.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),me(this)};var DA=nB;var qSo=T(S(),1);var OSo=T(S(),1);function iB(e,t){l(t)||(t=document.body),t=In(t);let n=this,i=Te.observable(mr.fullscreen),o=Te.observable(mr.enabled),r=t.ownerDocument;this.isFullscreen=void 0,Te.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,Te.defineProperty(this,"isFullscreenEnabled",{get:function(){return o()},set:function(s){o(s&&mr.enabled)}}),this.tooltip=void 0,Te.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=Ln(function(){mr.fullscreen?mr.exitFullscreen():mr.requestFullscreen(n._fullscreenElement)},Te.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=y(In(e),r.body),this._callback=function(){i(mr.fullscreen)},r.addEventListener(mr.changeEventName,this._callback)}Object.defineProperties(iB.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});iB.prototype.isDestroyed=function(){return!1};iB.prototype.destroy=function(){document.removeEventListener(mr.changeEventName,this._callback),me(this)};var BA=iB;var ySt="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",xSt="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 oB(e,t){e=In(e);let n=new BA(t,e);n._exitFullScreenPath=xSt,n._enterFullScreenPath=ySt;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),Te.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties(oB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});oB.prototype.isDestroyed=function(){return!1};oB.prototype.destroy=function(){return this._viewModel.destroy(),Te.cleanNode(this._element),this._container.removeChild(this._element),me(this)};var YA=oB;var uCo=T(S(),1);var oCo=T(S(),1);var GSe=1e3;function cm(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new rw({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 be,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=XSe,this._handleArrowUp=ESe;let t=this;this._suggestionsVisible=Te.pureComputed(function(){let o=Te.getObservable(t,"_suggestions")().length>0,r=Te.getObservable(t,"_showSuggestions")();return o&&r}),this._searchCommand=Ln(function(i){if(i=y(i,by.SEARCH),t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)LSt(t);else return CSt(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?ESe(t):r?XSe(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let o=i.destination;PSe(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=y(e.autocomplete,!0),this.destinationFound=y(e.destinationFound,cm.flyToDestination),this._focusTextbox=!1,Te.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=Te.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){cm._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,Te.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,Te.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){this._searchText=i}}),this.flightDuration=void 0,Te.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){this._flightDuration=i}})}Object.defineProperties(cm.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}}});cm.prototype.destroy=function(){this._suggestionSubscription.dispose()};function ESe(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],cm._adjustSuggestionsScroll(e,n)}function XSe(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],cm._adjustSuggestionsScroll(e,i)}function _St(e,t){let n=l(t)?t.availability:void 0;return l(n)?RT(t,[e]).then(function(i){return e=i[0],e.height+=GSe,e}):(e.height+=GSe,Promise.resolve(e))}function TSt(e,t){let n=e._scene,i=n.ellipsoid,o=n.camera,r=n.terrainProvider,s=t,a;return t instanceof ae?W.equalsEpsilon(t.south,t.north,W.EPSILON7)&&W.equalsEpsilon(t.east,t.west,W.EPSILON7)?t=ae.center(t):a=mS(t,n):t=i.cartesianToCartographic(t),l(a)||(a=_St(t,r)),a.then(function(c){s=i.cartographicToCartesian(c)}).finally(function(){o.flyTo({destination:s,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:F.IDENTITY})})}async function SSt(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 CSt(e,t,n){let i=e._searchText;if(WSe(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 SSt(t[o],i,n),l(r)&&r.state==="fulfilled"&&r.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,x6(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=ISe(e,IV.getCreditsFromResult(s[0]));l(a)||y6(e,t[o].credit);return}e._searchText=`${i} (not found)`}function y6(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function ISe(e,t){return l(t)&&t.forEach(n=>y6(e,n)),t}function x6(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function VSt(e,t){let n=In(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 LSt(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function WSe(e){return/^\s*$/.test(e)}function PSe(e){Te.getObservable(e,"_suggestions").removeAll()}async function RSt(e){if(!e.autoComplete)return;let t=e._searchText;if(PSe(e),x6(e),!WSe(t))for(let n of e._geocoderServices){let i=await n.geocode(t,by.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let o=!0;i.forEach(r=>{let s=IV.getCreditsFromResult(r);o=o&&!l(s),ISe(e,s)}),o&&y6(e,n.credit)}if(e._suggestions.length>=5)return}}cm.flyToDestination=TSt;cm._updateSearchSuggestions=RSt;cm._adjustSuggestionsScroll=VSt;cm.prototype.isDestroyed=function(){return!1};cm.prototype.destroy=function(){return x6(this),me(this)};var OA=cm;var ZSt="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",GSt="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 rB(e){let t=In(e.container),n=new OA(e);n._startSearchPath=ZSt,n._stopSearchPath=GSt;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),Te.applyBindings(n,i),Te.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()},Ot.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(rB.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});rB.prototype.isDestroyed=function(){return!1};rB.prototype.destroy=function(){let e=this._container;return Ot.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(),Te.cleanNode(this._form),Te.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),me(this)};var HA=rB;var SCo=T(S(),1);var pCo=T(S(),1);function vSe(e,t){this._scene=e,this._duration=t;let n=this;this._command=Ln(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",Te.track(this,["tooltip"])}Object.defineProperties(vSe.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 zA=vSe;function sB(e,t,n){e=In(e);let i=new zA(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),Te.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}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 Te.cleanNode(this._element),this._container.removeChild(this._element),me(this)};var KA=sB;var WCo=T(S(),1);var RCo=T(S(),1);function ESt(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function FSe(e,t){Te.track(e);for(let n=0;n<e.sublayers.length;n++)FSe(e.sublayers[n],t)}function aB(e){return e.modelName==="FullModel"}function ASe(e){return e.modelName==="Overview"}function MSe(e){return ASe(e)||aB(e)}function wSe(e,t){if(MSe(e)){e.visibility=!1;for(let i=0;i<e.sublayers.length;i++)e.sublayers[i].visibility=!0;let n={name:e.name,modelName:e.modelName,disable:Te.observable(!1),index:t.sublayers.length};return t.topLayers.push(n),t.sublayers.push(e),n}}function XSt(e,t){if(MSe(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");aB(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function ISt(e,t){try{let n=e.getAttributeNames();for(let i=0;i<n.length;i++)if(n[i]==="BldgLevel"){let o=e.getAttributeValues(n[i]);for(let r=0;r<o.length;r++)t.push(o[r])}t.sort((i,o)=>i-o),t.unshift("All")}catch(n){console.log(`There was an error getting attributes: ${n}`)}}function WSt(e){let t=this;this.levels=[],this.viewModel={sublayers:[],levels:this.levels,currentLevel:Te.observable(),selectedLevel:"All",topLayers:[{name:"Select a layer to explore...",disable:Te.observable(!0),index:-1}],currentLayer:Te.observable(),expandClickHandler:ESt,setOptionDisable:function(i,o){Te.applyBindingsToNode(i,{disable:o.disable},o)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){XSt(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){FSe(n[i],this.viewModel);let o=wSe(n[i],this.viewModel);l(o)&&(ASe(o)||!l(this.viewModel.defaultLayer)&&aB(o))&&(this.viewModel.defaultLayer=o)}if(this.viewModel.topLayers.length===1&&n.length>0){e.show=!1;let i={name:"Full Model",modelName:"FullModel",visibility:e.show,sublayers:e.sublayers};this.viewModel.defaultLayer=wSe(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(o){e.show=aB(o)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return ISt(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var JA=WSt;function PSt(e,t){let n=document.getElementById(e),i=document.createElement("div");i.classList.add("cesium-viewer-i3s-explorer"),i.innerHTML=`
        <h3>Building explorer</h3>
        <select
          data-bind="options: topLayers, optionsText: 'name', optionsAfterRender: setOptionDisable, value: currentLayer"
        ></select>
        <div id="bsl-wrapper">
          <h3>Select Level</h3>
          <select data-bind="options: levels, value: currentLevel"></select>
          <h3>Disciplines & Categories</h3>
          <ul class="layersList" data-bind="foreach: sublayers">
            <ul class="layersList" data-bind="foreach: sublayers.sort(function (l, r) { return l.name.localeCompare(r.name) })">
              <li>
                <div class="li-wrapper">
                  <span
                    class="expandItem"
                    data-bind="click: $root.expandClickHandler"
                    >+</span
                  >
                  <input
                    type="checkbox"
                    data-bind="checked: visibility, valueUpdate: 'input', attr: { id: name}"
                  />
                  <label data-bind="attr: { for: name}">
                    <span data-bind="text: name"></span>
                  </label>
                </div>
                <ul class="nested" data-bind="attr: { id: name + '-expander'}">
                  <li data-bind="foreach: sublayers.sort(function (l, r) { return l.name.localeCompare(r.name) })">
                    <div class="li-wrapper">
                      <input
                        type="checkbox"
                        data-bind="checked: visibility, valueUpdate: 'input', attr: { id: name}"
                      />
                      <label data-bind="attr: { for: name}">
                        <span data-bind="text: name"></span>
                      </label>
                    </div>
                  </li>
                </ul>
              </li>
            </ul>
          </ul>
        </div>`,n.appendChild(i);let o=new JA(t);Te.track(o),Te.applyBindings(o,n),l(o.defaultLayer)&&(o.currentLayer=o.defaultLayer)}var _6=PSt;var BCo=T(S(),1);var FCo=T(S(),1);var vSt="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",wSt="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 T6(){this._cameraClicked=new be,this._closeClicked=new be,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",Te.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,Te.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?wSt:vSt}}),Te.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}T6.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(T6.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var QA=T6;function cB(e){e=In(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 QA;Te.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=nn("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,g=u.firstElementChild;if(g!==null&&u.childNodes.length===1){let x=window.getComputedStyle(g);if(x!==null){let _=x["background-color"],C=Y.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(cB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});cB.prototype.isDestroyed=function(){return!1};cB.prototype.destroy=function(){let e=this._container;return Te.cleanNode(this._element),e.removeChild(this._element),l(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),me(this)};var jA=cB;var e1o=T(S(),1);var zCo=T(S(),1);function NSe(){this.showInstructions=!1;let e=this;this._command=Ln(function(){e.showInstructions=!e.showInstructions}),this._showClick=Ln(function(){e._touch=!1}),this._showTouch=Ln(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",Te.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(NSe.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var qA=NSe;function lB(e){let t=In(e.container),n=new qA,i=y(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=nn("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=nn("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="${nn("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="${nn("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="${nn("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="${nn("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="${nn("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="${nn("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="${nn("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),Te.applyBindings(n,o),this._container=t,this._viewModel=n,this._wrapper=o,this._closeInstructions=function(g){o.contains(g.target)||(n.showInstructions=!1)},Ot.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(lB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});lB.prototype.isDestroyed=function(){return!1};lB.prototype.destroy=function(){return Ot.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),Te.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),me(this)};var $A=lB;var f1o=T(S(),1);var a1o=T(S(),1);function S6(e){this._scene=e.scene,this.lowFrameRateMessage=y(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,Te.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=Ln(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=pF.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(S6.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});S6.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),me(this)};var eM=S6;function dB(e){let t=In(e.container),n=new eM(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),Te.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(dB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});dB.prototype.isDestroyed=function(){return!1};dB.prototype.destroy=function(){return this._viewModel.destroy(),Te.cleanNode(this._element),this._container.removeChild(this._element),me(this)};var tM=dB;var Z1o=T(S(),1);var _1o=T(S(),1);function uB(e){this._scene=e,this._orthographic=e.camera.frustum instanceof sn,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,Te.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;Te.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=Ln(function(){t.sceneMode===oe.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new vr,this._eventHelper.add(e.morphComplete,function(n,i,o,r){t.sceneMode=o,t._orthographic=o===oe.SCENE2D||t._scene.camera.frustum instanceof sn}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=l(e.camera._currentFlight)}),this._switchToPerspective=Ln(function(){t.sceneMode!==oe.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=Ln(function(){t.sceneMode!==oe.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=oe}Object.defineProperties(uB.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}}});uB.prototype.isDestroyed=function(){return!1};uB.prototype.destroy=function(){this._eventHelper.removeAll(),me(this)};var nM=uB;var FSt="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",ASt="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 mB(e,t){e=In(e);let n=new nM(t);n._perspectivePath=FSt,n._orthographicPath=ASt;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),Te.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(a){i.contains(a.target)||(n.dropDownVisible=!1)},Ot.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}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(),Ot.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Te.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),me(this)};var iM=mB;var U1o=T(S(),1);var v1o=T(S(),1);function hB(e,t){this._scene=e;let n=this,i=function(o,r,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new vr,this._eventHelper.add(e.morphStart,i),this._duration=y(t,2),this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",Te.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,Te.defineProperty(this,"selectedTooltip",function(){let o=n.sceneMode;return o===oe.SCENE2D?n.tooltip2D:o===oe.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=Ln(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=Ln(function(){e.morphTo2D(n._duration)}),this._morphTo3D=Ln(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=Ln(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=oe}Object.defineProperties(hB.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}}});hB.prototype.isDestroyed=function(){return!1};hB.prototype.destroy=function(){this._eventHelper.removeAll(),me(this)};var oM=hB;var MSt="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",NSt="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",kSt="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 fB(e,t,n){e=In(e);let i=new oM(t,n);i._globePath=MSt,i._flatMapPath=NSt,i._columbusViewPath=kSt;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),Te.applyBindings(i,o),this._viewModel=i,this._container=e,this._wrapper=o,this._closeDropDown=function(d){o.contains(d.target)||(i.dropDownVisible=!1)},Ot.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}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 this._viewModel.destroy(),Ot.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Te.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),me(this)};var rM=fB;var $1o=T(S(),1);var H1o=T(S(),1);var USt=new D,pB="-1000px";function sM(e,t,n){this._scene=e,this._screenPositionX=pB,this._screenPositionY=pB,this._tweens=e.tweens,this._container=y(n,document.body),this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,Te.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,Te.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&l(this.position)}}),Te.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,o){return Yi.worldToWindowCoordinates(e,i,o)}}sM.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,USt);if(!l(e))this._screenPositionX=pB,this._screenPositionY=pB;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`}}};sM.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:kr.EXPONENTIAL_OUT})};sM.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:kr.EXPONENTIAL_OUT})};Object.defineProperties(sM.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var aM=sM;function bB(e,t){e=In(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 aM(t,this._element,this._container);this._viewModel=c,Te.applyBindings(this._viewModel,this._element)}Object.defineProperties(bB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});bB.prototype.isDestroyed=function(){return!1};bB.prototype.destroy=function(){let e=this._container;return Te.cleanNode(this._element),e.removeChild(this._element),me(this)};var cM=bB;var uVo=T(S(),1);var nVo=T(S(),1);function bS(e,t,n){this._color=e,this._height=t,this._base=y(n,0)}bS.prototype.getHeight=function(){return this._height};bS.prototype.getBase=function(){return this._base};bS.prototype.getStartTime=function(){return this._start};bS.prototype.getStopTime=function(){return this._stop};bS.prototype.setRange=function(e,t){this._start=e,this._stop=t};bS.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){let n=q.secondsDifference(this._start,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(n)),o=q.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 lM=bS;var rVo=T(S(),1);function kSe(e,t,n,i){this.interval=e,this.height=t,this.color=n||new Y(.5,.5,.5,1),this.backgroundColor=i||new Y(0,0,0,0)}kSe.prototype.render=function(e,t){let n=this.interval.start,i=this.interval.stop,o=t.startJulian,r=q.addSeconds(t.startJulian,t.duration,new q);if(q.lessThan(n,o)&&q.greaterThan(i,r))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(q.lessThanOrEquals(n,r)&&q.greaterThanOrEquals(i,o)){let s,a,c;for(s=0;s<t.timeBarWidth;++s){let d=q.addSeconds(t.startJulian,s/t.timeBarWidth*t.duration,new q);!l(a)&&q.greaterThanOrEquals(d,n)?a=s:!l(c)&&q.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 dM=kSe;var C6=1e12,lm={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},cl={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},Ay=[.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],DSt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function ll(e,t){e=In(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=lm.none,this._touchMode=cl.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=BSt(this),this._onMouseUp=YSt(this),this._onMouseMove=OSt(this),this._onMouseWheel=HSt(this),this._onTouchStart=zSt(this),this._onTouchMove=JSt(this),this._onTouchEnd=KSt(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()}ll.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};ll.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};ll.prototype.isDestroyed=function(){return!1};ll.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),me(this)};ll.prototype.addHighlightRange=function(e,t,n){let i=new lM(e,t,n);return this._highlightRanges.push(i),this.resize(),i};ll.prototype.addTrack=function(e,t,n,i){let o=new dM(e,t,n,i);return this._trackList.push(o),this._lastHeight=void 0,this.resize(),o};ll.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=q.secondsDifference(t,e),this._clock&&this._clock.clockRange!==Mr.UNBOUNDED){let i=this._clock.startTime,o=this._clock.stopTime,r=q.secondsDifference(o,i),s=q.secondsDifference(i,this._startJulian),a=q.secondsDifference(o,this._endJulian);this._timeBarSecondsSpan>=r?(this._timeBarSecondsSpan=r,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=q.addSeconds(this._endJulian,s,new q),this._startJulian=i,this._timeBarSecondsSpan=q.secondsDifference(this._endJulian,this._startJulian)):a<0&&(this._startJulian=q.addSeconds(this._startJulian,a,new q),this._endJulian=o,this._timeBarSecondsSpan=q.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)};ll.prototype.zoomFrom=function(e){let t=q.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(q.addSeconds(this._startJulian,t-t*e,new q),q.addSeconds(this._endJulian,n*e-n,new q))};function V6(e){return e<10?`0${e.toString()}`:e.toString()}ll.prototype.makeLabel=function(e){let t=q.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`${DSt[t.month-1]} ${t.day} ${t.year} ${V6(t.hour)}:${V6(t.minute)}:${V6(t.second)}${i}`};ll.prototype.smallestTicInPixels=7;ll.prototype._makeTics=function(){let e=this._timeBarEle,t=q.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=q.addSeconds(this._startJulian,a,new q)):m>c&&(m=c,this._timeBarSecondsSpan=c,this._endJulian=q.addSeconds(this._startJulian,c,new q));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let g=this._startJulian,f=Math.min(m/p*1e-5,.4),x,_=q.toGregorianDate(g);m>31536e4?x=q.fromDate(new Date(Date.UTC(Math.floor(_.year/100)*100,0))):m>31536e3?x=q.fromDate(new Date(Date.UTC(Math.floor(_.year/10)*10,0))):m>86400?x=q.fromDate(new Date(Date.UTC(_.year,0))):x=q.fromDate(new Date(Date.UTC(_.year,_.month,_.day)));let C=q.secondsDifference(this._startJulian,q.addSeconds(x,f,new q)),V=C+m;this._epochJulian=x;function L(k){return Math.floor(C/k)*k}function Z(k,J){return Math.ceil(k/J+.5)*J}function E(k){return(k-C)/m}function X(k,J){return k-J*Math.round(k/J)}this._rulerEle.innerHTML=this.makeLabel(q.addSeconds(this._endJulian,-a,new q));let v=this._rulerEle.offsetWidth+20;v<30&&(v=180);let P=u;u-=d;let A={startTime:C,startJulian:g,epochJulian:x,duration:m,timeBarWidth:p,getAlpha:E};this._highlightRanges.forEach(function(k){s+=k.render(A)});let M=0,b=0,R=0,G=v/p;G>1&&(G=1),G*=this._timeBarSecondsSpan;let I=-1,w=-1,N=Ay.length,B;for(B=0;B<N;++B){let k=Ay[B];if(++I,M=k,k>G&&k>u)break;w<0&&p*(k/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(w=I)}if(I>0){for(;I>0;)if(--I,Math.abs(X(M,Ay[I]))<1e-5){Ay[I]>=u&&(b=Ay[I]);break}if(w>=0)for(;w<I;){if(Math.abs(X(b,Ay[w]))<1e-5&&Ay[w]>=u){R=Ay[w];break}++w}}u=P,u>d&&R<1e-5&&Math.abs(u-M)>d&&(R=u,u<=M+d&&(b=0));let U=-999999,O;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*E(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*E(o)).toString()}px;"></span>`;if(p*(M/this._timeBarSecondsSpan)>=2){this._mainTicSpan=M,V+=M,o=L(M);let k=q.computeTaiMinusUtc(x);for(;o<=V;){let J=q.addSeconds(g,o-C,new q);if(M>2.1){let j=q.computeTaiMinusUtc(J);Math.abs(j-k)>.1&&(o+=j-k,J=q.addSeconds(g,o-C,new q))}let H=Math.round(p*E(o)),te=this.makeLabel(J);this._rulerEle.innerHTML=te,O=this._rulerEle.offsetWidth,O<10&&(O=v);let z=H-(O/2-1);z>U?(U=z+O+5,s+=`<span class="cesium-timeline-ticMain" style="left: ${H.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${z.toString()}px;">${te}</span>`):s+=`<span class="cesium-timeline-ticSub" style="left: ${H.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),A.y=0,this._trackList.forEach(function(k){k.render(r._context,A),A.y+=k.height})};ll.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(l(this._scrubElement)){let t=q.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(q.addSeconds(this._startJulian,this._timelineDrag,new q),q.addSeconds(this._endJulian,this._timelineDrag,new q)))};ll.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=q.addSeconds(this._startJulian,t,new q),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 BSt(e){return function(t){e._mouseMode!==lm.touchOnly&&(t.button===0?(e._mouseMode=lm.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=lm.zoom:e._mouseMode=lm.slide)),t.preventDefault()}}function YSt(e){return function(t){e._mouseMode=lm.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function OSt(e){return function(t){let n;if(e._mouseMode===lm.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===lm.slide){if(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0){let i=n*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(q.addSeconds(e._startJulian,i,new q),q.addSeconds(e._endJulian,i,new q))}}else e._mouseMode===lm.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function HSt(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;C6=Math.max(Math.min(Math.abs(n),C6),1),n/=C6,e.zoomFrom(Math.pow(1.05,-n))}}function zSt(e){return function(t){let n=t.touches.length,i,o,r=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=lm.touchOnly,n===1?(i=q.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=cl.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=cl.singleTap,e._touchState.centerX=t.touches[0].clientX-r)):n===2?(e._touchMode=cl.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=cl.ignore}}function KSt(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===cl.singleTap?(e._touchMode=cl.scrub,e._onTouchMove(t)):e._touchMode===cl.scrub&&e._onTouchMove(t),e._mouseMode=lm.touchOnly,n!==1?e._touchMode=n>0?cl.ignore:cl.none:e._touchMode===cl.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function JSt(e){return function(t){let n,i,o,r,s,a,c=1,d=e._topDiv.getBoundingClientRect().left;e._touchMode===cl.singleTap&&(e._touchMode=cl.slideZoom),e._mouseMode=lm.touchOnly,e._touchMode===cl.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===cl.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=q.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-r*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new q)):(n=e._touchState.centerX-r,a=q.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new q)),e.zoomTo(a,q.addSeconds(a,e._timeBarSecondsSpan*c,new q)),e._touchState.centerX=r,e._touchState.spanX=s))}}ll.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 uM=ll;var GVo=T(S(),1);var TVo=T(S(),1);var OSe=T(YSe(),1);function qSt(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 HSe(){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 $St(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(HSe(),e._locked=!1),e._noSleep.disable(),mr.exitFullscreen(),n(!1)):(mr.fullscreen||mr.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=qSt("landscape")),t.useWebVR=!0,n(!0)))}function gB(e,t){let n=this,i=Te.observable(mr.enabled),o=Te.observable(!1);this.isVRMode=void 0,Te.defineProperty(this,"isVRMode",{get:function(){return o()}}),this.isVREnabled=void 0,Te.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(s){i(s&&mr.enabled)}}),this.tooltip=void 0,Te.defineProperty(this,"tooltip",function(){return i()?o()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let r=Te.observable(!1);this._isOrthographic=void 0,Te.defineProperty(this,"_isOrthographic",{get:function(){return r()}}),this._eventHelper=new vr,this._eventHelper.add(e.preRender,function(){r(e.camera.frustum instanceof sn)}),this._locked=!1,this._noSleep=new OSe.default,this._command=Ln(function(){$St(n,e,o,r)},Te.getObservable(this,"isVREnabled")),this._vrElement=y(In(t),document.body),this._callback=function(){!mr.fullscreen&&o()&&(e.useWebVR=!1,n._locked&&(HSe(),n._locked=!1),n._noSleep.disable(),o(!1))},document.addEventListener(mr.changeEventName,this._callback)}Object.defineProperties(gB.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});gB.prototype.isDestroyed=function(){return!1};gB.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(mr.changeEventName,this._callback),me(this)};var mM=gB;var eCt="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",tCt="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 yB(e,t,n){e=In(e);let i=new mM(t,n);i._exitVRPath=tCt,i._enterVRPath=eCt;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),Te.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(yB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});yB.prototype.isDestroyed=function(){return!1};yB.prototype.destroy=function(){return this._viewModel.destroy(),Te.cleanNode(this._element),this._container.removeChild(this._element),me(this)};var hM=yB;var QVo=T(S(),1);var My=new ce;function JSe(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function nCt(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 iCt(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 zSe(e,t){let n=e.scene.pick(t.position);if(l(n)){let i=y(n.id,n.primitive.id);if(i instanceof Jo)return i;if(n instanceof vs)return new Jo({name:iCt(n),description:nCt(n),feature:n})}if(l(e.scene.globe))return sCt(e,t.position)}var oCt=new q;function QSe(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;q.equals(o,r)&&(r=q.addSeconds(o,W.EPSILON2,oCt)),e.updateFromClock(),e.zoomTo(o,r)}}}var rCt=new h;function sCt(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=KSe();return}let a=s[0],c=new Jo({id:a.name,description:a.description});if(l(a.position)){let d=e.scene.ellipsoid.cartographicToCartesian(a.position,rCt);c.position=new Mc(d)}e.selectedEntity=c},function(){e.selectedEntity===r&&(e.selectedEntity=KSe())}),r}function KSe(){return new Jo({id:"None",description:"No features found."})}function aCt(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 g=t||!l(d)?0:d.container.clientWidth;e._vrButton.container.style.right=`${g}px`,e.forceResize()}}function vi(e,t){e=In(e),t=y(t,y.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=y(t.scene3DOnly,!1),c,d,u=!1;l(t.clockViewModel)?(d=t.clockViewModel,c=d.clock):(c=new eh,d=new RA(c),u=!0),l(t.shouldAnimate)&&(c.shouldAnimate=t.shouldAnimate);let m=new TA(r,{baseLayer:n&&l(t.selectedImageryProviderViewModel)||l(t.baseLayer)||l(t.imageryProvider)?!1:void 0,clock:c,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,ellipsoid:t.ellipsoid,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,g=!1;l(p)||(p=new TP,g=!0);let f=m.scene,x=new lv({scene:f,dataSourceCollection:p}),_=new vr;_.add(c.onTick,vi.prototype._onTick,this),_.add(f.morphStart,vi.prototype._clearTrackedObject,this);let C;if(!l(t.selectionIndicator)||t.selectionIndicator!==!1){let H=document.createElement("div");H.className="cesium-viewer-selectionIndicatorContainer",o.appendChild(H),C=new cM(H,f)}let V;if(!l(t.infoBox)||t.infoBox!==!1){let H=document.createElement("div");H.className="cesium-viewer-infoBoxContainer",o.appendChild(H),V=new jA(H);let te=V.viewModel;_.add(te.cameraClicked,vi.prototype._onInfoBoxCameraClicked,this),_.add(te.closeClicked,vi.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 H=document.createElement("div");H.className="cesium-viewer-geocoderContainer",L.appendChild(H);let te;l(t.geocoder)&&typeof t.geocoder!="boolean"&&(te=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),Z=new HA({container:H,geocoderServices:te,scene:f}),_.add(Z.viewModel.search.beforeExecute,vi.prototype._clearObjects,this)}let E;(!l(t.homeButton)||t.homeButton!==!1)&&(E=new KA(L,f),l(Z)&&_.add(E.viewModel.command.afterExecute,function(){let H=Z.viewModel;H.searchText="",H.isSearchInProgress&&H.search()}),_.add(E.viewModel.command.beforeExecute,vi.prototype._clearTrackedObject,this));let X;!a&&(!l(t.sceneModePicker)||t.sceneModePicker!==!1)&&(X=new rM(L,f));let v;t.projectionPicker&&(v=new iM(L,f));let P,A;if(n){let H=y(t.imageryProviderViewModels,vA()),te=y(t.terrainProviderViewModels,wA());P=new PA(L,{globe:f.globe,imageryProviderViewModels:H,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:te,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),A=L.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}l(t.baseLayer)&&t.baseLayer!==!1&&(n&&(P.viewModel.selectedImagery=void 0),f.imageryLayers.removeAll(),f.imageryLayers.add(t.baseLayer)),l(t.terrainProvider)&&(n&&(P.viewModel.selectedTerrain=void 0),f.terrainProvider=t.terrainProvider),l(t.terrain)&&(n&&(f.globe.depthTestAgainstTerrain=!0),f.setTerrain(t.terrain));let M;if(!l(t.navigationHelpButton)||t.navigationHelpButton!==!1){let H=!0;try{if(l(window.localStorage)){let te=window.localStorage.getItem("cesium-hasSeenNavHelp");l(te)&&te?H=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}M=new $A({container:L,instructionsInitiallyVisible:y(t.navigationInstructionsInitiallyVisible,H)})}let b;if(!l(t.animation)||t.animation!==!1){let H=document.createElement("div");H.className="cesium-viewer-animationContainer",o.appendChild(H),b=new XA(H,new IA(d))}let R;if(!l(t.timeline)||t.timeline!==!1){let H=document.createElement("div");H.className="cesium-viewer-timelineContainer",o.appendChild(H),R=new uM(H,c),R.addEventListener("settime",JSe,!1),R.zoomTo(c.startTime,c.stopTime)}let G,I,w;(!l(t.fullscreenButton)||t.fullscreenButton!==!1)&&(w=document.createElement("div"),w.className="cesium-viewer-fullscreenContainer",o.appendChild(w),G=new YA(w,t.fullscreenElement),I=ba(G.viewModel,"isFullscreenEnabled",function(H){w.style.display=H?"block":"none",l(R)&&(R.container.style.right=`${w.clientWidth}px`,R.resize())}));let N,B,U;if(t.vrButton){let H=document.createElement("div");H.className="cesium-viewer-vrContainer",o.appendChild(H),N=new hM(H,f,t.fullScreenElement),B=ba(N.viewModel,"isVREnabled",function(te){H.style.display=te?"block":"none",l(G)&&(H.style.right=`${w.clientWidth}px`),l(R)&&(R.container.style.right=`${H.clientWidth}px`,R.resize())}),U=ba(N.viewModel,"isVRMode",function(te){aCt(i,te)})}this._baseLayerPickerDropDown=A,this._fullscreenSubscription=I,this._vrSubscription=B,this._vrModeSubscription=U,this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=y(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=g,this._dataSourceDisplay=x,this._clockViewModel=d,this._destroyClockViewModel=u,this._toolbar=L,this._homeButton=E,this._sceneModePicker=X,this._projectionPicker=v,this._baseLayerPicker=P,this._navigationHelpButton=M,this._animation=b,this._timeline=R,this._fullscreenButton=G,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 be,this._trackedEntityChanged=new be,Te.track(this,["_trackedEntity","_selectedEntity","_clockTrackedDataSource"]),_.add(p.dataSourceAdded,vi.prototype._onDataSourceAdded,this),_.add(p.dataSourceRemoved,vi.prototype._onDataSourceRemoved,this),_.add(f.postUpdate,vi.prototype.resize,this),_.add(f.postRender,vi.prototype._postRender,this);let O=p.length;for(let H=0;H<O;H++)this._dataSourceAdded(p,p.get(H));this._dataSourceAdded(void 0,x.defaultDataSource),_.add(p.dataSourceAdded,vi.prototype._dataSourceAdded,this),_.add(p.dataSourceRemoved,vi.prototype._dataSourceRemoved,this);function k(H){let te=zSe(i,H);l(te)?K.getValueOrUndefined(te.position,i.clock.currentTime)?i.trackedEntity=te:i.zoomTo(te):l(i.trackedEntity)&&(i.trackedEntity=void 0)}function J(H){i.selectedEntity=zSe(i,H)}m.screenSpaceEventHandler.setInputAction(J,Sn.LEFT_CLICK),m.screenSpaceEventHandler.setInputAction(k,Sn.LEFT_DOUBLE_CLICK)}Object.defineProperties(vi.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}},ellipsoid:{get:function(){return this._scene.ellipsoid}},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,G6(this);let t=this.scene,n=t.mode;!l(e)||!l(e.position)?(this._needTrackedEntityUpdate=!1,(n===oe.COLUMBUS_VIEW||n===oe.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(n===oe.COLUMBUS_VIEW||n===oe.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(F.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,QSe(this._timeline,this.clock,e))}}});vi.prototype.extend=function(e,t){e(this,t)};vi.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 f=this._geocoder.searchSuggestionsContainer;f.style.maxHeight=`${s}px`}l(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);let c=this._timeline,d,u=0,m=5,p=3,g=0;if(o&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let f=this._lastWidth;d=this._animation.container,n>900?(u=169,f<=900&&(d.style.width="169px",d.style.height="112px",this._animation.resize())):n>=600?(u=136,(f<600||f>900)&&(d.style.width="136px",d.style.height="90px",this._animation.resize())):(u=106,(f>600||f===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 f=this._fullscreenButton,x=this._vrButton,_=c.container,C=_.style;p=_.clientHeight+3,C.left=`${u}px`;let V=0;l(f)&&(V+=f.container.clientWidth),l(x)&&(V+=x.container.clientWidth),C.right=`${V}px`,c.resize()}!r&&l(this._fullscreenButton)&&(g=this._fullscreenButton.container.clientWidth),this._bottomContainer.style.left=`${m}px`,this._bottomContainer.style.bottom=`${p}px`,this._bottomContainer.style.right=`${g}px`,this._lastWidth=n,this._lastHeight=i};vi.prototype.forceResize=function(){this._lastWidth=0,this.resize()};vi.prototype.render=function(){this._cesiumWidget.render()};vi.prototype.isDestroyed=function(){return!1};vi.prototype.destroy=function(){let e;l(this.screenSpaceEventHandler)&&!this.screenSpaceEventHandler.isDestroyed()&&(this.screenSpaceEventHandler.removeInputAction(Sn.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(Sn.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",JSe,!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()),me(this)};vi.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(vi.prototype._onEntityCollectionChanged,this)};vi.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(vi.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)};vi.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,My)===ft.DONE&&i.update(t,My)}let o,r=!1,s=this.selectedEntity,a=l(s)&&this._enableInfoOrSelection;a&&s.isShowing&&s.isAvailable(t)&&(this._dataSourceDisplay.getBoundingSphere(s,!0,My)!==ft.FAILED?o=My.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=y(s.name,s.id),d.description=K.getValueOrDefault(s.description,t,"")):(d.titleText="",d.description=""))};vi.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)}};vi.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)}};vi.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};vi.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};vi.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};vi.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&QSe(this.timeline,this.clock,e)};vi.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,vi.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};vi.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}};vi.prototype.zoomTo=function(e,t){return jSe(this,e,{offset:t},!1)};vi.prototype.flyTo=function(e,t){return jSe(this,e,t,!0)};function jSe(e,t,n,i){G6(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 ha){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 mS(a,e.scene)}).then(function(a){e._zoomPromise===o&&(e._zoomTarget=a)});return}if(r instanceof ra||r instanceof ZL||r instanceof Wy){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=y(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 fM(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function G6(e){let t=e._zoomPromise;l(t)&&(fM(e),e._completeZoom(!1))}vi.prototype._postRender=function(){cCt(this),lCt(this)};function cCt(e){let t=e._zoomTarget;if(!l(t)||e.scene.mode===oe.MORPHING)return;let n=e.scene,i=n.camera,o=y(e._zoomOptions,{}),r;function s(u){l(o.offset)||(o.offset=new Hu(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(F.IDENTITY),e._completeZoom(!0)),fM(e)}if(t instanceof ZL){if(l(t.boundingSphere)){s(t.boundingSphere);return}let u=t.frameChanged.addEventListener(function(m){s(m.boundingSphere),u()});return}if(t instanceof ra||t instanceof Wy){s(t.boundingSphere);return}if(t instanceof he){r={destination:n.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)),fM(e);return}let a=t,c=[];for(let u=0,m=a.length;u<m;u++){let p=e._dataSourceDisplay.getBoundingSphere(a[u],!1,My);if(p===ft.PENDING)return;p!==ft.FAILED&&c.push(ce.clone(My))}if(c.length===0){G6(e);return}e.trackedEntity=void 0;let d=ce.fromBoundingSpheres(c);e._zoomIsFlight?(fM(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(F.IDENTITY),fM(e),e._completeZoom(!0))}function lCt(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=K.getValueOrUndefined(t.position,n);if(!l(i))return;let o=e.scene,r=e._dataSourceDisplay.getBoundingSphere(t,!1,My);if(r===ft.PENDING)return;let s=o.mode;(s===oe.COLUMBUS_VIEW||s===oe.SCENE2D)&&(o.screenSpaceCameraController.enableTranslate=!1),(s===oe.COLUMBUS_VIEW||s===oe.SCENE3D)&&(o.screenSpaceCameraController.enableTilt=!1);let a=r!==ft.FAILED?My:void 0;e._entityView=new uv(t,o,o.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var E6=vi;var $Vo=T(S(),1);function dCt(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new NA(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var X6=dCt;var nLo=T(S(),1);function uCt(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new DA(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var I6=uCt;var sLo=T(S(),1);function mCt(e,t){t=y(t,y.EMPTY_OBJECT);let n=!0,i=y(t.flyToOnDrop,!0),o=new be,r=y(t.clearOnDrop,!0),s=y(t.dropTarget,e.container),a=y(t.clampToGround,!0),c=t.proxy;s=In(s),Object.defineProperties(e,{dropTarget:{get:function(){return s},set:function(u){qSe(s,d),s=u,W6(s,d)}},dropEnabled:{get:function(){return n},set:function(u){u!==n&&(u?W6(s,d):qSe(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){gS(u),r&&(e.entities.removeAll(),e.dataSources.removeAll());let m=u.dataTransfer.files,p=m.length;for(let g=0;g<p;g++){let f=m[g],x=new FileReader;x.onload=hCt(e,f,c,a),x.onerror=fCt(e,f),x.readAsText(f)}}W6(s,d),e.destroy=hw(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=d}function gS(e){e.stopPropagation(),e.preventDefault()}function qSe(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",gS,!1),n.removeEventListener("dragover",gS,!1),n.removeEventListener("dragexit",gS,!1))}function W6(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",gS,!1),e.addEventListener("dragover",gS,!1),e.addEventListener("dragexit",gS,!1)}function hCt(e,t,n,i){let o=e.scene;return function(r){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=_P.load(JSON.parse(r.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=fv.load(JSON.parse(r.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=Ov.load(t,{sourceUri:s,proxy:n,camera:o.camera,canvas:o.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=yv.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 fCt(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var P6=mCt;var mLo=T(S(),1);function pCt(e,t){t=y(t,y.EMPTY_OBJECT);let n=new tM({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var v6=pCt;var ZLo=T(S(),1);var VLo=T(S(),1);var gLo=T(S(),1);function $Se(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 dm(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=Te.observable();return Te.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=$Se(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===Pi.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsEllipsoid=o===Pi.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsCylinder=o===Pi.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=F.getTranslation(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&ep(t)},getPrimitiveFunction:function(){t.translationY=F.getTranslation(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&ep(t)},getPrimitiveFunction:function(){t.translationZ=F.getTranslation(t._voxelPrimitive.modelMatrix,new h).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&ep(t)},getPrimitiveFunction:function(){t.scaleX=F.getScale(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&ep(t)},getPrimitiveFunction:function(){t.scaleY=F.getScale(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&ep(t)},getPrimitiveFunction:function(){t.scaleZ=F.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 bCt=new h,gCt=new h,yCt=new _a,xCt=new $;function ep(e){let t=h.fromElements(e.translationX,e.translationY,e.translationZ,bCt),n=h.fromElements(e.scaleX,e.scaleY,e.scaleZ,gCt),i=yCt;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let o=$.fromHeadingPitchRoll(i,xCt),r=$.multiplyByScale(o,n,o);e._voxelPrimitive.modelMatrix=F.fromRotationTranslation(r,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(dm.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=$Se(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)}}}});dm.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};dm.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};dm.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};dm.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};dm.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};dm.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};dm.prototype.compileShader=function(){l(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new sS({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};dm.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};dm.prototype.isDestroyed=function(){return!1};dm.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){Te.getObservable(e,t).dispose()}),me(this)};var pM=dm;function xB(e,t){e=In(e);let n=document.createElement("div"),i=new pM(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=Ua.createSection,a=Ua.createCheckbox,c=Ua.createRangeInput,d=Ua.createButton,u=s(r,"Display","displayVisible","toggleDisplay"),m=s(r,"Transform","transformVisible","toggleTransform"),p=s(r,"Bounds","boundsVisible","toggleBounds"),g=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=Pi.getMinBounds(Pi.BOX),L=Pi.getMaxBounds(Pi.BOX),Z=h.fromElements(Pi.getMinBounds(Pi.ELLIPSOID).x,Pi.getMinBounds(Pi.ELLIPSOID).y,-ne.WGS84.maximumRadius,new h),E=h.fromElements(Pi.getMaxBounds(Pi.ELLIPSOID).x,Pi.getMaxBounds(Pi.ELLIPSOID).y,1e7,new h),X=Pi.getMinBounds(Pi.CYLINDER),v=Pi.getMaxBounds(Pi.CYLINDER);XL("Max X","Min X","Max Y","Min Y","Max Z","Min Z","boundsBoxMaxX","boundsBoxMinX","boundsBoxMaxY","boundsBoxMinY","boundsBoxMaxZ","boundsBoxMinZ",V,L,"shapeIsBox",p),XL("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","boundsEllipsoidMaxLongitude","boundsEllipsoidMinLongitude","boundsEllipsoidMaxLatitude","boundsEllipsoidMinLatitude","boundsEllipsoidMaxHeight","boundsEllipsoidMinHeight",Z,E,"shapeIsEllipsoid",p),XL("Max Radius","Min Radius","Max Height","Min Height","Max Angle","Min Angle","boundsCylinderMaxRadius","boundsCylinderMinRadius","boundsCylinderMaxHeight","boundsCylinderMinHeight","boundsCylinderMaxAngle","boundsCylinderMinAngle",X,v,"shapeIsCylinder",p),XL("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ",V,L,"shapeIsBox",g),XL("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight",Z,E,"shapeIsEllipsoid",g),XL("Max Radius","Min Radius","Max Height","Min Height","Max Angle","Min Angle","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxHeight","clippingCylinderMinHeight","clippingCylinderMaxAngle","clippingCylinderMinAngle",X,v,"shapeIsCylinder",g);let P=document.createElement("div");f.appendChild(P);let A=document.createElement("textarea");A.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),P.className="cesium-cesiumInspector-styleEditor",P.appendChild(A);let M=d("Compile (Ctrl+Enter)","compileShader");P.appendChild(M);let b=document.createElement("label");b.style.display="block",b.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),P.appendChild(b),Te.applyBindings(i,n)}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 Te.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),me(this)};function XL(e,t,n,i,o,r,s,a,c,d,u,m,p,g,f,x){let _=Ua.createRangeInput,C=p,V=g,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 bM=xB;function _Ct(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new bM(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var w6=_Ct;globalThis.CESIUM_VERSION="1.121.1";var TCt="1.121.1";return fCe(SCt);})();
