园林绿化
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

17126 lines
4.4 MiB

/**
* @license
* Cesium - https://github.com/CesiumGS/cesium
* Version 1.140.0
*
* 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.
*/
"use strict";var nPe=Object.create;var QB=Object.defineProperty;var iPe=Object.getOwnPropertyDescriptor;var oPe=Object.getOwnPropertyNames;var rPe=Object.getPrototypeOf,aPe=Object.prototype.hasOwnProperty;var sPe=(e,t,n)=>t in e?QB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var cPe=(e,t)=>()=>(e&&(t=e(e=0)),t);var ki=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Yie=(e,t)=>{for(var n in t)QB(e,n,{get:t[n],enumerable:!0})},qie=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of oPe(t))!aPe.call(e,o)&&o!==n&&QB(e,o,{get:()=>t[o],enumerable:!(i=iPe(t,o))||i.enumerable});return e};var Wr=(e,t,n)=>(n=e!=null?nPe(rPe(e)):{},qie(t||!e||!e.__esModule?QB(n,"default",{value:e,enumerable:!0}):n,e)),Jm=e=>qie(QB({},"__esModule",{value:!0}),e);var Rn=(e,t,n)=>sPe(e,typeof t!="symbol"?t+"":t,n);var rG=ki((O1t,Zie)=>{var IA=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)};IA.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}};IA.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};IA.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};IA.prototype.random_int31=function(){return this.random_int()>>>1};IA.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};IA.prototype.random=function(){return this.random_int()*(1/4294967296)};IA.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};IA.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};Zie.exports=IA});var boe=ki((mx,px)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof mx=="object"&&mx&&!mx.nodeType&&mx,n=typeof px=="object"&&px&&!px.nodeType&&px,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var o,r=2147483647,a=36,s=1,c=26,u=38,f=700,h=72,p=128,A="-",m=/^xn--/,_=/[^\x20-\x7E]/,y=/[\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"},E=a-s,b=Math.floor,x=String.fromCharCode,S;function B(F){throw new RangeError(C[F])}function v(F,U){for(var Q=F.length,H=[];Q--;)H[Q]=U(F[Q]);return H}function P(F,U){var Q=F.split("@"),H="";Q.length>1&&(H=Q[0]+"@",F=Q[1]),F=F.replace(y,".");var Y=F.split("."),$=v(Y,U).join(".");return H+$}function N(F){for(var U=[],Q=0,H=F.length,Y,$;Q<H;)Y=F.charCodeAt(Q++),Y>=55296&&Y<=56319&&Q<H?($=F.charCodeAt(Q++),($&64512)==56320?U.push(((Y&1023)<<10)+($&1023)+65536):(U.push(Y),Q--)):U.push(Y);return U}function L(F){return v(F,function(U){var Q="";return U>65535&&(U-=65536,Q+=x(U>>>10&1023|55296),U=56320|U&1023),Q+=x(U),Q}).join("")}function g(F){return F-48<10?F-22:F-65<26?F-65:F-97<26?F-97:a}function I(F,U){return F+22+75*(F<26)-((U!=0)<<5)}function T(F,U,Q){var H=0;for(F=Q?b(F/f):F>>1,F+=b(F/U);F>E*c>>1;H+=a)F=b(F/E);return b(H+(E+1)*F/(F+u))}function w(F){var U=[],Q=F.length,H,Y=0,$=p,W=h,K,Z,pe,ge,re,ye,Ce,Pe,Ne;for(K=F.lastIndexOf(A),K<0&&(K=0),Z=0;Z<K;++Z)F.charCodeAt(Z)>=128&&B("not-basic"),U.push(F.charCodeAt(Z));for(pe=K>0?K+1:0;pe<Q;){for(ge=Y,re=1,ye=a;pe>=Q&&B("invalid-input"),Ce=g(F.charCodeAt(pe++)),(Ce>=a||Ce>b((r-Y)/re))&&B("overflow"),Y+=Ce*re,Pe=ye<=W?s:ye>=W+c?c:ye-W,!(Ce<Pe);ye+=a)Ne=a-Pe,re>b(r/Ne)&&B("overflow"),re*=Ne;H=U.length+1,W=T(Y-ge,H,ge==0),b(Y/H)>r-$&&B("overflow"),$+=b(Y/H),Y%=H,U.splice(Y++,0,$)}return L(U)}function R(F){var U,Q,H,Y,$,W,K,Z,pe,ge,re,ye=[],Ce,Pe,Ne,Le;for(F=N(F),Ce=F.length,U=p,Q=0,$=h,W=0;W<Ce;++W)re=F[W],re<128&&ye.push(x(re));for(H=Y=ye.length,Y&&ye.push(A);H<Ce;){for(K=r,W=0;W<Ce;++W)re=F[W],re>=U&&re<K&&(K=re);for(Pe=H+1,K-U>b((r-Q)/Pe)&&B("overflow"),Q+=(K-U)*Pe,U=K,W=0;W<Ce;++W)if(re=F[W],re<U&&++Q>r&&B("overflow"),re==U){for(Z=Q,pe=a;ge=pe<=$?s:pe>=$+c?c:pe-$,!(Z<ge);pe+=a)Le=Z-ge,Ne=a-ge,ye.push(x(I(ge+Le%Ne,0))),Z=b(Le/Ne);ye.push(x(I(Z,0))),$=T(Q,Pe,H==Y),Q=0,++H}++Q,++U}return ye.join("")}function O(F){return P(F,function(U){return m.test(U)?w(U.slice(4).toLowerCase()):U})}function G(F){return P(F,function(U){return _.test(U)?"xn--"+R(U):U})}if(o={version:"1.3.2",ucs2:{decode:N,encode:L},decode:w,encode:R,toASCII:G,toUnicode:O},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return o});else if(t&&n)if(px.exports==t)n.exports=o;else for(S in o)o.hasOwnProperty(S)&&(t[S]=o[S]);else e.punycode=o})(mx)});var xoe=ki((Ioe,xG)=>{/*!
* 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 xG=="object"&&xG.exports?xG.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(Ioe,function(e){"use strict";var t=e&&e.IPv6;function n(o){var r=o.toLowerCase(),a=r.split(":"),s=a.length,c=8;a[0]===""&&a[1]===""&&a[2]===""?(a.shift(),a.shift()):a[0]===""&&a[1]===""?a.shift():a[s-1]===""&&a[s-2]===""&&a.pop(),s=a.length,a[s-1].indexOf(".")!==-1&&(c=7);var u;for(u=0;u<s&&a[u]!=="";u++);if(u<c)for(a.splice(u,1,"0000");a.length<c;)a.splice(u,0,"0000");for(var f,h=0;h<c;h++){f=a[h].split("");for(var p=0;p<3&&(f[0]==="0"&&f.length>1);p++)f.splice(0,1);a[h]=f.join("")}var A=-1,m=0,_=0,y=-1,C=!1;for(h=0;h<c;h++)C?a[h]==="0"?_+=1:(C=!1,_>m&&(A=y,m=_)):a[h]==="0"&&(C=!0,y=h,_=1);_>m&&(A=y,m=_),m>1&&a.splice(A,m,""),s=a.length;var E="";for(a[0]===""&&(E=":"),h=0;h<s&&(E+=a[h],h!==s-1);h++)E+=":";return a[s-1]===""&&(E+=":"),E}function i(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:i}})});var Soe=ki((Toe,TG)=>{/*!
* 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 TG=="object"&&TG.exports?TG.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(Toe,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 a=n.list[i.slice(o+1)];return a?a.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 a=n.list[i.slice(o+1)];return a?a.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 a=n.list[i.slice(o+1)];return!a||a.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 rf=ki((woe,SG)=>{/*!
* 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 SG=="object"&&SG.exports?SG.exports=t(boe(),xoe(),Soe()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(woe,function(e,t,n,i){"use strict";var o=i&&i.URI;function r(I,T){var w=arguments.length>=1,R=arguments.length>=2;if(!(this instanceof r))return w?R?new r(I,T):new r(I):new r;if(I===void 0){if(w)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?I=location.href+"":I=""}if(I===null&&w)throw new TypeError("null is not a valid argument for URI");return this.href(I),T!==void 0?this.absoluteTo(T):this}function a(I){return/^[0-9]+$/.test(I)}r.version="1.19.11";var s=r.prototype,c=Object.prototype.hasOwnProperty;function u(I){return I.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function f(I){return I===void 0?"Undefined":String(Object.prototype.toString.call(I)).slice(8,-1)}function h(I){return f(I)==="Array"}function p(I,T){var w={},R,O;if(f(T)==="RegExp")w=null;else if(h(T))for(R=0,O=T.length;R<O;R++)w[T[R]]=!0;else w[T]=!0;for(R=0,O=I.length;R<O;R++){var G=w&&w[I[R]]!==void 0||!w&&T.test(I[R]);G&&(I.splice(R,1),O--,R--)}return I}function A(I,T){var w,R;if(h(T)){for(w=0,R=T.length;w<R;w++)if(!A(I,T[w]))return!1;return!0}var O=f(T);for(w=0,R=I.length;w<R;w++)if(O==="RegExp"){if(typeof I[w]=="string"&&I[w].match(T))return!0}else if(I[w]===T)return!0;return!1}function m(I,T){if(!h(I)||!h(T)||I.length!==T.length)return!1;I.sort(),T.sort();for(var w=0,R=I.length;w<R;w++)if(I[w]!==T[w])return!1;return!0}function _(I){var T=/^\/+|\/+$/g;return I.replace(T,"")}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(I){if(!(!I||!I.nodeName)){var T=I.nodeName.toLowerCase();if(!(T==="input"&&I.type!=="image"))return r.domAttributes[T]}};function y(I){return escape(I)}function C(I){return encodeURIComponent(I).replace(/[!'()*]/g,y).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(I,T){var w=r.encode(I+"");return T===void 0&&(T=r.escapeQuerySpace),T?w.replace(/%20/g,"+"):w},r.decodeQuery=function(I,T){I+="",T===void 0&&(T=r.escapeQuerySpace);try{return r.decode(T?I.replace(/\+/g,"%20"):I)}catch{return I}};var E={encode:"encode",decode:"decode"},b,x=function(I,T){return function(w){try{return r[T](w+"").replace(r.characters[I][T].expression,function(R){return r.characters[I][T].map[R]})}catch{return w}}};for(b in E)r[b+"PathSegment"]=x("pathname",E[b]),r[b+"UrnPathSegment"]=x("urnpath",E[b]);var S=function(I,T,w){return function(R){var O;w?O=function(Q){return r[T](r[w](Q))}:O=r[T];for(var G=(R+"").split(I),F=0,U=G.length;F<U;F++)G[F]=O(G[F]);return G.join(I)}};r.decodePath=S("/","decodePathSegment"),r.decodeUrnPath=S(":","decodeUrnPathSegment"),r.recodePath=S("/","encodePathSegment","decode"),r.recodeUrnPath=S(":","encodeUrnPathSegment","decode"),r.encodeReserved=x("reserved","encode"),r.parse=function(I,T){var w;return T||(T={preventInvalidHostname:r.preventInvalidHostname}),I=I.replace(r.leading_whitespace_expression,""),I=I.replace(r.ascii_tab_whitespace,""),w=I.indexOf("#"),w>-1&&(T.fragment=I.substring(w+1)||null,I=I.substring(0,w)),w=I.indexOf("?"),w>-1&&(T.query=I.substring(w+1)||null,I=I.substring(0,w)),I=I.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),I=I.replace(/^[/\\]{2,}/i,"//"),I.substring(0,2)==="//"?(T.protocol=null,I=I.substring(2),I=r.parseAuthority(I,T)):(w=I.indexOf(":"),w>-1&&(T.protocol=I.substring(0,w)||null,T.protocol&&!T.protocol.match(r.protocol_expression)?T.protocol=void 0:I.substring(w+1,w+3).replace(/\\/g,"/")==="//"?(I=I.substring(w+3),I=r.parseAuthority(I,T)):(I=I.substring(w+1),T.urn=!0))),T.path=I,T},r.parseHost=function(I,T){I||(I=""),I=I.replace(/\\/g,"/");var w=I.indexOf("/"),R,O;if(w===-1&&(w=I.length),I.charAt(0)==="[")R=I.indexOf("]"),T.hostname=I.substring(1,R)||null,T.port=I.substring(R+2,w)||null,T.port==="/"&&(T.port=null);else{var G=I.indexOf(":"),F=I.indexOf("/"),U=I.indexOf(":",G+1);U!==-1&&(F===-1||U<F)?(T.hostname=I.substring(0,w)||null,T.port=null):(O=I.substring(0,w).split(":"),T.hostname=O[0]||null,T.port=O[1]||null)}return T.hostname&&I.substring(w).charAt(0)!=="/"&&(w++,I="/"+I),T.preventInvalidHostname&&r.ensureValidHostname(T.hostname,T.protocol),T.port&&r.ensureValidPort(T.port),I.substring(w)||"/"},r.parseAuthority=function(I,T){return I=r.parseUserinfo(I,T),r.parseHost(I,T)},r.parseUserinfo=function(I,T){var w=I,R=I.indexOf("\\");R!==-1&&(I=I.replace(/\\/g,"/"));var O=I.indexOf("/"),G=I.lastIndexOf("@",O>-1?O:I.length-1),F;return G>-1&&(O===-1||G<O)?(F=I.substring(0,G).split(":"),T.username=F[0]?r.decode(F[0]):null,F.shift(),T.password=F[0]?r.decode(F.join(":")):null,I=w.substring(G+1)):(T.username=null,T.password=null),I},r.parseQuery=function(I,T){if(!I)return{};if(I=I.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!I)return{};for(var w={},R=I.split("&"),O=R.length,G,F,U,Q=0;Q<O;Q++)G=R[Q].split("="),F=r.decodeQuery(G.shift(),T),U=G.length?r.decodeQuery(G.join("="),T):null,F!=="__proto__"&&(c.call(w,F)?((typeof w[F]=="string"||w[F]===null)&&(w[F]=[w[F]]),w[F].push(U)):w[F]=U);return w},r.build=function(I){var T="",w=!1;return I.protocol&&(T+=I.protocol+":"),!I.urn&&(T||I.hostname)&&(T+="//",w=!0),T+=r.buildAuthority(I)||"",typeof I.path=="string"&&(I.path.charAt(0)!=="/"&&w&&(T+="/"),T+=I.path),typeof I.query=="string"&&I.query&&(T+="?"+I.query),typeof I.fragment=="string"&&I.fragment&&(T+="#"+I.fragment),T},r.buildHost=function(I){var T="";if(I.hostname)r.ip6_expression.test(I.hostname)?T+="["+I.hostname+"]":T+=I.hostname;else return"";return I.port&&(T+=":"+I.port),T},r.buildAuthority=function(I){return r.buildUserinfo(I)+r.buildHost(I)},r.buildUserinfo=function(I){var T="";return I.username&&(T+=r.encode(I.username)),I.password&&(T+=":"+r.encode(I.password)),T&&(T+="@"),T},r.buildQuery=function(I,T,w){var R="",O,G,F,U;for(G in I)if(G!=="__proto__"&&c.call(I,G))if(h(I[G]))for(O={},F=0,U=I[G].length;F<U;F++)I[G][F]!==void 0&&O[I[G][F]+""]===void 0&&(R+="&"+r.buildQueryParameter(G,I[G][F],w),T!==!0&&(O[I[G][F]+""]=!0));else I[G]!==void 0&&(R+="&"+r.buildQueryParameter(G,I[G],w));return R.substring(1)},r.buildQueryParameter=function(I,T,w){return r.encodeQuery(I,w)+(T!==null?"="+r.encodeQuery(T,w):"")},r.addQuery=function(I,T,w){if(typeof T=="object")for(var R in T)c.call(T,R)&&r.addQuery(I,R,T[R]);else if(typeof T=="string"){if(I[T]===void 0){I[T]=w;return}else typeof I[T]=="string"&&(I[T]=[I[T]]);h(w)||(w=[w]),I[T]=(I[T]||[]).concat(w)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(I,T,w){if(typeof T=="object")for(var R in T)c.call(T,R)&&r.setQuery(I,R,T[R]);else if(typeof T=="string")I[T]=w===void 0?null:w;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(I,T,w){var R,O,G;if(h(T))for(R=0,O=T.length;R<O;R++)I[T[R]]=void 0;else if(f(T)==="RegExp")for(G in I)T.test(G)&&(I[G]=void 0);else if(typeof T=="object")for(G in T)c.call(T,G)&&r.removeQuery(I,G,T[G]);else if(typeof T=="string")w!==void 0?f(w)==="RegExp"?!h(I[T])&&w.test(I[T])?I[T]=void 0:I[T]=p(I[T],w):I[T]===String(w)&&(!h(w)||w.length===1)?I[T]=void 0:h(I[T])&&(I[T]=p(I[T],w)):I[T]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(I,T,w,R){switch(f(T)){case"String":break;case"RegExp":for(var O in I)if(c.call(I,O)&&T.test(O)&&(w===void 0||r.hasQuery(I,O,w)))return!0;return!1;case"Object":for(var G in T)if(c.call(T,G)&&!r.hasQuery(I,G,T[G]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(f(w)){case"Undefined":return T in I;case"Boolean":var F=!!(h(I[T])?I[T].length:I[T]);return w===F;case"Function":return!!w(I[T],T,I);case"Array":if(!h(I[T]))return!1;var U=R?A:m;return U(I[T],w);case"RegExp":return h(I[T])?R?A(I[T],w):!1:!!(I[T]&&I[T].match(w));case"Number":w=String(w);case"String":return h(I[T])?R?A(I[T],w):!1:I[T]===w;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var I=[],T=[],w=0,R=0;R<arguments.length;R++){var O=new r(arguments[R]);I.push(O);for(var G=O.segment(),F=0;F<G.length;F++)typeof G[F]=="string"&&T.push(G[F]),G[F]&&w++}if(!T.length||!w)return new r("");var U=new r("").segment(T);return(I[0].path()===""||I[0].path().slice(0,1)==="/")&&U.path("/"+U.path()),U.normalize()},r.commonPath=function(I,T){var w=Math.min(I.length,T.length),R;for(R=0;R<w;R++)if(I.charAt(R)!==T.charAt(R)){R--;break}return R<1?I.charAt(0)===T.charAt(0)&&I.charAt(0)==="/"?"/":"":((I.charAt(R)!=="/"||T.charAt(R)!=="/")&&(R=I.substring(0,R).lastIndexOf("/")),I.substring(0,R+1))},r.withinString=function(I,T,w){w||(w={});var R=w.start||r.findUri.start,O=w.end||r.findUri.end,G=w.trim||r.findUri.trim,F=w.parens||r.findUri.parens,U=/[a-z0-9-]=["']?$/i;for(R.lastIndex=0;;){var Q=R.exec(I);if(!Q)break;var H=Q.index;if(w.ignoreHtml){var Y=I.slice(Math.max(H-3,0),H);if(Y&&U.test(Y))continue}for(var $=H+I.slice(H).search(O),W=I.slice(H,$),K=-1;;){var Z=F.exec(W);if(!Z)break;var pe=Z.index+Z[0].length;K=Math.max(K,pe)}if(K>-1?W=W.slice(0,K)+W.slice(K).replace(G,""):W=W.replace(G,""),!(W.length<=Q[0].length)&&!(w.ignore&&w.ignore.test(W))){$=H+W.length;var ge=T(W,H,$,I);if(ge===void 0){R.lastIndex=$;continue}ge=String(ge),I=I.slice(0,H)+ge+I.slice($),R.lastIndex=H+ge.length}}return R.lastIndex=0,I},r.ensureValidHostname=function(I,T){var w=!!I,R=!!T,O=!1;if(R&&(O=A(r.hostProtocols,T)),O&&!w)throw new TypeError("Hostname cannot be empty, if protocol is "+T);if(I&&I.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+I+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(I).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+I+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(I){if(I){var T=Number(I);if(!(a(T)&&T>0&&T<65536))throw new TypeError('Port "'+I+'" is not a valid port')}},r.noConflict=function(I){if(I){var T={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(T.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(T.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(T.SecondLevelDomains=i.SecondLevelDomains.noConflict()),T}else i.URI===this&&(i.URI=o);return this},s.build=function(I){return I===!0?this._deferred_build=!0:(I===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},s.clone=function(){return new r(this)},s.valueOf=s.toString=function(){return this.build(!1)._string};function B(I){return function(T,w){return T===void 0?this._parts[I]||"":(this._parts[I]=T||null,this.build(!w),this)}}function v(I,T){return function(w,R){return w===void 0?this._parts[I]||"":(w!==null&&(w=w+"",w.charAt(0)===T&&(w=w.substring(1))),this._parts[I]=w,this.build(!R),this)}}s.protocol=B("protocol"),s.username=B("username"),s.password=B("password"),s.hostname=B("hostname"),s.port=B("port"),s.query=v("query","?"),s.fragment=v("fragment","#"),s.search=function(I,T){var w=this.query(I,T);return typeof w=="string"&&w.length?"?"+w:w},s.hash=function(I,T){var w=this.fragment(I,T);return typeof w=="string"&&w.length?"#"+w:w},s.pathname=function(I,T){if(I===void 0||I===!0){var w=this._parts.path||(this._parts.hostname?"/":"");return I?(this._parts.urn?r.decodeUrnPath:r.decodePath)(w):w}else return this._parts.urn?this._parts.path=I?r.recodeUrnPath(I):"":this._parts.path=I?r.recodePath(I):"/",this.build(!T),this},s.path=s.pathname,s.href=function(I,T){var w;if(I===void 0)return this.toString();this._string="",this._parts=r._parts();var R=I instanceof r,O=typeof I=="object"&&(I.hostname||I.path||I.pathname);if(I.nodeName){var G=r.getDomAttribute(I);I=I[G]||"",O=!1}if(!R&&O&&I.pathname!==void 0&&(I=I.toString()),typeof I=="string"||I instanceof String)this._parts=r.parse(String(I),this._parts);else if(R||O){var F=R?I._parts:I;for(w in F)w!=="query"&&c.call(this._parts,w)&&(this._parts[w]=F[w]);F.query&&this.query(F.query,!1)}else throw new TypeError("invalid input");return this.build(!T),this},s.is=function(I){var T=!1,w=!1,R=!1,O=!1,G=!1,F=!1,U=!1,Q=!this._parts.urn;switch(this._parts.hostname&&(Q=!1,w=r.ip4_expression.test(this._parts.hostname),R=r.ip6_expression.test(this._parts.hostname),T=w||R,O=!T,G=O&&n&&n.has(this._parts.hostname),F=O&&r.idn_expression.test(this._parts.hostname),U=O&&r.punycode_expression.test(this._parts.hostname)),I.toLowerCase()){case"relative":return Q;case"absolute":return!Q;case"domain":case"name":return O;case"sld":return G;case"ip":return T;case"ip4":case"ipv4":case"inet4":return w;case"ip6":case"ipv6":case"inet6":return R;case"idn":return F;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return U}return null};var P=s.protocol,N=s.port,L=s.hostname;s.protocol=function(I,T){if(I&&(I=I.replace(/:(\/\/)?$/,""),!I.match(r.protocol_expression)))throw new TypeError('Protocol "'+I+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return P.call(this,I,T)},s.scheme=s.protocol,s.port=function(I,T){return this._parts.urn?I===void 0?"":this:(I!==void 0&&(I===0&&(I=null),I&&(I+="",I.charAt(0)===":"&&(I=I.substring(1)),r.ensureValidPort(I))),N.call(this,I,T))},s.hostname=function(I,T){if(this._parts.urn)return I===void 0?"":this;if(I!==void 0){var w={preventInvalidHostname:this._parts.preventInvalidHostname},R=r.parseHost(I,w);if(R!=="/")throw new TypeError('Hostname "'+I+'" contains characters other than [A-Z0-9.-]');I=w.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(I,this._parts.protocol)}return L.call(this,I,T)},s.origin=function(I,T){if(this._parts.urn)return I===void 0?"":this;if(I===void 0){var w=this.protocol(),R=this.authority();return R?(w?w+"://":"")+this.authority():""}else{var O=r(I);return this.protocol(O.protocol()).authority(O.authority()).build(!T),this}},s.host=function(I,T){if(this._parts.urn)return I===void 0?"":this;if(I===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var w=r.parseHost(I,this._parts);if(w!=="/")throw new TypeError('Hostname "'+I+'" contains characters other than [A-Z0-9.-]');return this.build(!T),this},s.authority=function(I,T){if(this._parts.urn)return I===void 0?"":this;if(I===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var w=r.parseAuthority(I,this._parts);if(w!=="/")throw new TypeError('Hostname "'+I+'" contains characters other than [A-Z0-9.-]');return this.build(!T),this},s.userinfo=function(I,T){if(this._parts.urn)return I===void 0?"":this;if(I===void 0){var w=r.buildUserinfo(this._parts);return w&&w.substring(0,w.length-1)}else return I[I.length-1]!=="@"&&(I+="@"),r.parseUserinfo(I,this._parts),this.build(!T),this},s.resource=function(I,T){var w;return I===void 0?this.path()+this.search()+this.hash():(w=r.parse(I),this._parts.path=w.path,this._parts.query=w.query,this._parts.fragment=w.fragment,this.build(!T),this)},s.subdomain=function(I,T){if(this._parts.urn)return I===void 0?"":this;if(I===void 0){if(!this._parts.hostname||this.is("IP"))return"";var w=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,w)||""}else{var R=this._parts.hostname.length-this.domain().length,O=this._parts.hostname.substring(0,R),G=new RegExp("^"+u(O));if(I&&I.charAt(I.length-1)!=="."&&(I+="."),I.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return I&&r.ensureValidHostname(I,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(G,I),this.build(!T),this}},s.domain=function(I,T){if(this._parts.urn)return I===void 0?"":this;if(typeof I=="boolean"&&(T=I,I=void 0),I===void 0){if(!this._parts.hostname||this.is("IP"))return"";var w=this._parts.hostname.match(/\./g);if(w&&w.length<2)return this._parts.hostname;var R=this._parts.hostname.length-this.tld(T).length-1;return R=this._parts.hostname.lastIndexOf(".",R-1)+1,this._parts.hostname.substring(R)||""}else{if(!I)throw new TypeError("cannot set domain empty");if(I.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(I,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=I;else{var O=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(O,I)}return this.build(!T),this}},s.tld=function(I,T){if(this._parts.urn)return I===void 0?"":this;if(typeof I=="boolean"&&(T=I,I=void 0),I===void 0){if(!this._parts.hostname||this.is("IP"))return"";var w=this._parts.hostname.lastIndexOf("."),R=this._parts.hostname.substring(w+1);return T!==!0&&n&&n.list[R.toLowerCase()]&&n.get(this._parts.hostname)||R}else{var O;if(I)if(I.match(/[^a-zA-Z0-9-]/))if(n&&n.is(I))O=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(O,I);else throw new TypeError('TLD "'+I+'" 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");O=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(O,I)}else throw new TypeError("cannot set TLD empty");return this.build(!T),this}},s.directory=function(I,T){if(this._parts.urn)return I===void 0?"":this;if(I===void 0||I===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var w=this._parts.path.length-this.filename().length-1,R=this._parts.path.substring(0,w)||(this._parts.hostname?"/":"");return I?r.decodePath(R):R}else{var O=this._parts.path.length-this.filename().length,G=this._parts.path.substring(0,O),F=new RegExp("^"+u(G));return this.is("relative")||(I||(I="/"),I.charAt(0)!=="/"&&(I="/"+I)),I&&I.charAt(I.length-1)!=="/"&&(I+="/"),I=r.recodePath(I),this._parts.path=this._parts.path.replace(F,I),this.build(!T),this}},s.filename=function(I,T){if(this._parts.urn)return I===void 0?"":this;if(typeof I!="string"){if(!this._parts.path||this._parts.path==="/")return"";var w=this._parts.path.lastIndexOf("/"),R=this._parts.path.substring(w+1);return I?r.decodePathSegment(R):R}else{var O=!1;I.charAt(0)==="/"&&(I=I.substring(1)),I.match(/\.?\//)&&(O=!0);var G=new RegExp(u(this.filename())+"$");return I=r.recodePath(I),this._parts.path=this._parts.path.replace(G,I),O?this.normalizePath(T):this.build(!T),this}},s.suffix=function(I,T){if(this._parts.urn)return I===void 0?"":this;if(I===void 0||I===!0){if(!this._parts.path||this._parts.path==="/")return"";var w=this.filename(),R=w.lastIndexOf("."),O,G;return R===-1?"":(O=w.substring(R+1),G=/^[a-z0-9%]+$/i.test(O)?O:"",I?r.decodePathSegment(G):G)}else{I.charAt(0)==="."&&(I=I.substring(1));var F=this.suffix(),U;if(F)I?U=new RegExp(u(F)+"$"):U=new RegExp(u("."+F)+"$");else{if(!I)return this;this._parts.path+="."+r.recodePath(I)}return U&&(I=r.recodePath(I),this._parts.path=this._parts.path.replace(U,I)),this.build(!T),this}},s.segment=function(I,T,w){var R=this._parts.urn?":":"/",O=this.path(),G=O.substring(0,1)==="/",F=O.split(R);if(I!==void 0&&typeof I!="number"&&(w=T,T=I,I=void 0),I!==void 0&&typeof I!="number")throw new Error('Bad segment "'+I+'", must be 0-based integer');if(G&&F.shift(),I<0&&(I=Math.max(F.length+I,0)),T===void 0)return I===void 0?F:F[I];if(I===null||F[I]===void 0)if(h(T)){F=[];for(var U=0,Q=T.length;U<Q;U++)!T[U].length&&(!F.length||!F[F.length-1].length)||(F.length&&!F[F.length-1].length&&F.pop(),F.push(_(T[U])))}else(T||typeof T=="string")&&(T=_(T),F[F.length-1]===""?F[F.length-1]=T:F.push(T));else T?F[I]=_(T):F.splice(I,1);return G&&F.unshift(""),this.path(F.join(R),w)},s.segmentCoded=function(I,T,w){var R,O,G;if(typeof I!="number"&&(w=T,T=I,I=void 0),T===void 0){if(R=this.segment(I,T,w),!h(R))R=R!==void 0?r.decode(R):void 0;else for(O=0,G=R.length;O<G;O++)R[O]=r.decode(R[O]);return R}if(!h(T))T=typeof T=="string"||T instanceof String?r.encode(T):T;else for(O=0,G=T.length;O<G;O++)T[O]=r.encode(T[O]);return this.segment(I,T,w)};var g=s.query;return s.query=function(I,T){if(I===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof I=="function"){var w=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),R=I.call(this,w);return this._parts.query=r.buildQuery(R||w,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!T),this}else return I!==void 0&&typeof I!="string"?(this._parts.query=r.buildQuery(I,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!T),this):g.call(this,I,T)},s.setQuery=function(I,T,w){var R=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof I=="string"||I instanceof String)R[I]=T!==void 0?T:null;else if(typeof I=="object")for(var O in I)c.call(I,O)&&(R[O]=I[O]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(R,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof I!="string"&&(w=T),this.build(!w),this},s.addQuery=function(I,T,w){var R=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(R,I,T===void 0?null:T),this._parts.query=r.buildQuery(R,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof I!="string"&&(w=T),this.build(!w),this},s.removeQuery=function(I,T,w){var R=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(R,I,T),this._parts.query=r.buildQuery(R,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof I!="string"&&(w=T),this.build(!w),this},s.hasQuery=function(I,T,w){var R=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(R,I,T,w)},s.setSearch=s.setQuery,s.addSearch=s.addQuery,s.removeSearch=s.removeQuery,s.hasSearch=s.hasQuery,s.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()},s.normalizeProtocol=function(I){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!I)),this},s.normalizeHostname=function(I){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(!I)),this},s.normalizePort=function(I){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!I)),this},s.normalizePath=function(I){var T=this._parts.path;if(!T)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!I),this;if(this._parts.path==="/")return this;T=r.recodePath(T);var w,R="",O,G;for(T.charAt(0)!=="/"&&(w=!0,T="/"+T),(T.slice(-3)==="/.."||T.slice(-2)==="/.")&&(T+="/"),T=T.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),w&&(R=T.substring(1).match(/^(\.\.\/)+/)||"",R&&(R=R[0]));O=T.search(/\/\.\.(\/|$)/),O!==-1;){if(O===0){T=T.substring(3);continue}G=T.substring(0,O).lastIndexOf("/"),G===-1&&(G=O),T=T.substring(0,G)+T.substring(O+3)}return w&&this.is("relative")&&(T=R+T.substring(1)),this._parts.path=T,this.build(!I),this},s.normalizePathname=s.normalizePath,s.normalizeQuery=function(I){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(!I)),this},s.normalizeFragment=function(I){return this._parts.fragment||(this._parts.fragment=null,this.build(!I)),this},s.normalizeSearch=s.normalizeQuery,s.normalizeHash=s.normalizeFragment,s.iso8859=function(){var I=r.encode,T=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=I,r.decode=T}return this},s.unicode=function(){var I=r.encode,T=r.decode;r.encode=C,r.decode=unescape;try{this.normalize()}finally{r.encode=I,r.decode=T}return this},s.readable=function(){var I=this.clone();I.username("").password("").normalize();var T="";if(I._parts.protocol&&(T+=I._parts.protocol+"://"),I._parts.hostname&&(I.is("punycode")&&e?(T+=e.toUnicode(I._parts.hostname),I._parts.port&&(T+=":"+I._parts.port)):T+=I.host()),I._parts.hostname&&I._parts.path&&I._parts.path.charAt(0)!=="/"&&(T+="/"),T+=I.path(!0),I._parts.query){for(var w="",R=0,O=I._parts.query.split("&"),G=O.length;R<G;R++){var F=(O[R]||"").split("=");w+="&"+r.decodeQuery(F[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),F[1]!==void 0&&(w+="="+r.decodeQuery(F[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}T+="?"+w.substring(1)}return T+=r.decodeQuery(I.hash(),!0),T},s.absoluteTo=function(I){var T=this.clone(),w=["protocol","username","password","hostname","port"],R,O,G;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(I instanceof r||(I=new r(I)),T._parts.protocol||(T._parts.protocol=I._parts.protocol,this._parts.hostname))return T;for(O=0;G=w[O];O++)T._parts[G]=I._parts[G];return T._parts.path?(T._parts.path.substring(-2)===".."&&(T._parts.path+="/"),T.path().charAt(0)!=="/"&&(R=I.directory(),R=R||(I.path().indexOf("/")===0?"/":""),T._parts.path=(R?R+"/":"")+T._parts.path,T.normalizePath())):(T._parts.path=I._parts.path,T._parts.query||(T._parts.query=I._parts.query)),T.build(),T},s.relativeTo=function(I){var T=this.clone().normalize(),w,R,O,G,F;if(T._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(I=new r(I).normalize(),w=T._parts,R=I._parts,G=T.path(),F=I.path(),G.charAt(0)!=="/")throw new Error("URI is already relative");if(F.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(w.protocol===R.protocol&&(w.protocol=null),w.username!==R.username||w.password!==R.password||w.protocol!==null||w.username!==null||w.password!==null)return T.build();if(w.hostname===R.hostname&&w.port===R.port)w.hostname=null,w.port=null;else return T.build();if(G===F)return w.path="",T.build();if(O=r.commonPath(G,F),!O)return T.build();var U=R.path.substring(O.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return w.path=U+w.path.substring(O.length)||"./",T.build()},s.equals=function(I){var T=this.clone(),w=new r(I),R={},O={},G={},F,U,Q;if(T.normalize(),w.normalize(),T.toString()===w.toString())return!0;if(F=T.query(),U=w.query(),T.query(""),w.query(""),T.toString()!==w.toString()||F.length!==U.length)return!1;R=r.parseQuery(F,this._parts.escapeQuerySpace),O=r.parseQuery(U,this._parts.escapeQuerySpace);for(Q in R)if(c.call(R,Q)){if(h(R[Q])){if(!m(R[Q],O[Q]))return!1}else if(R[Q]!==O[Q])return!1;G[Q]=!0}for(Q in O)if(c.call(O,Q)&&!G[Q])return!1;return!0},s.preventInvalidHostname=function(I){return this._parts.preventInvalidHostname=!!I,this},s.duplicateQueryParameters=function(I){return this._parts.duplicateQueryParameters=!!I,this},s.escapeQuerySpace=function(I){return this._parts.escapeQuerySpace=!!I,this},r})});var Cpe=ki((eGn,ype)=>{"use strict";ype.exports=F$e;var f1=1e20;function F$e(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,o=t.channel||0,r,a,s,c,u,f,h,p,A,m,_;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,a=t.height,c=e,t.stride?f=t.stride:f=Math.floor(e.length/r/a)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(p=e,h=p.getContext("2d"),r=p.width,a=p.height,A=h.getImageData(0,0,r,a),c=A.data,f=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,h=e,r=p.width,a=p.height,A=h.getImageData(0,0,r,a),c=A.data,f=4):window.ImageData&&e instanceof window.ImageData&&(A=e,r=e.width,a=e.height,c=A.data,f=4);if(s=Math.max(r,a),window.Uint8ClampedArray&&c instanceof window.Uint8ClampedArray||window.Uint8Array&&c instanceof window.Uint8Array)for(u=c,c=Array(r*a),m=0,_=Math.floor(u.length/f);m<_;m++)c[m]=u[m*f+o]/255;else if(f!==1)throw Error("Raw data can have only 1 value per pixel");var y=Array(r*a),C=Array(r*a),E=Array(s),b=Array(s),x=Array(s+1),S=Array(s);for(m=0,_=r*a;m<_;m++){var B=c[m];y[m]=B===1?0:B===0?f1:Math.pow(Math.max(0,.5-B),2),C[m]=B===1?f1:B===0?0:Math.pow(Math.max(0,B-.5),2)}gpe(y,r,a,E,b,S,x),gpe(C,r,a,E,b,S,x);var v=window.Float32Array?new Float32Array(r*a):new Array(r*a);for(m=0,_=r*a;m<_;m++)v[m]=Math.min(Math.max(1-((y[m]-C[m])/i+n),0),1);return v}function gpe(e,t,n,i,o,r,a){for(var s=0;s<t;s++){for(var c=0;c<n;c++)i[c]=e[c*t+s];for(_pe(i,o,r,a,n),c=0;c<n;c++)e[c*t+s]=o[c]}for(c=0;c<n;c++){for(s=0;s<t;s++)i[s]=e[c*t+s];for(_pe(i,o,r,a,t),s=0;s<t;s++)e[c*t+s]=Math.sqrt(o[s])}}function _pe(e,t,n,i,o){n[0]=0,i[0]=-f1,i[1]=+f1;for(var r=1,a=0;r<o;r++){for(var s=(e[r]+r*r-(e[n[a]]+n[a]*n[a]))/(2*r-2*n[a]);s<=i[a];)a--,s=(e[r]+r*r-(e[n[a]]+n[a]*n[a]))/(2*r-2*n[a]);a++,n[a]=r,i[a]=s,i[a+1]=+f1}for(r=0,a=0;r<o;r++){for(;i[a+1]<r;)a++;t[r]=(r-n[a])*(r-n[a])+e[n[a]]}}});var Tpe=ki((gGn,R8)=>{function q$e(){var e=0,t=1,n=2,i=3,o=4,r=5,a=6,s=7,c=8,u=9,f=10,h=11,p=12,A=13,m=14,_=15,y=16,C=17,E=0,b=1,x=2,S=3,B=4;function v(g,I){return 55296<=g.charCodeAt(I)&&g.charCodeAt(I)<=56319&&56320<=g.charCodeAt(I+1)&&g.charCodeAt(I+1)<=57343}function P(g,I){I===void 0&&(I=0);var T=g.charCodeAt(I);if(55296<=T&&T<=56319&&I<g.length-1){var w=T,R=g.charCodeAt(I+1);return 56320<=R&&R<=57343?(w-55296)*1024+(R-56320)+65536:w}if(56320<=T&&T<=57343&&I>=1){var w=g.charCodeAt(I-1),R=T;return 55296<=w&&w<=56319?(w-55296)*1024+(R-56320)+65536:R}return T}function N(g,I,T){var w=[g].concat(I).concat([T]),R=w[w.length-2],O=T,G=w.lastIndexOf(m);if(G>1&&w.slice(1,G).every(function(Q){return Q==i})&&[i,A,C].indexOf(g)==-1)return x;var F=w.lastIndexOf(o);if(F>0&&w.slice(1,F).every(function(Q){return Q==o})&&[p,o].indexOf(R)==-1)return w.filter(function(Q){return Q==o}).length%2==1?S:B;if(R==e&&O==t)return E;if(R==n||R==e||R==t)return O==m&&I.every(function(Q){return Q==i})?x:b;if(O==n||O==e||O==t)return b;if(R==a&&(O==a||O==s||O==u||O==f))return E;if((R==u||R==s)&&(O==s||O==c))return E;if((R==f||R==c)&&O==c)return E;if(O==i||O==_)return E;if(O==r)return E;if(R==p)return E;var U=w.indexOf(i)!=-1?w.lastIndexOf(i)-1:w.length-2;return[A,C].indexOf(w[U])!=-1&&w.slice(U+1,-1).every(function(Q){return Q==i})&&O==m||R==_&&[y,C].indexOf(O)!=-1?E:I.indexOf(o)!=-1?x:R==o&&O==o?E:b}this.nextBreak=function(g,I){if(I===void 0&&(I=0),I<0)return 0;if(I>=g.length-1)return g.length;for(var T=L(P(g,I)),w=[],R=I+1;R<g.length;R++)if(!v(g,R-1)){var O=L(P(g,R));if(N(T,w,O))return R;w.push(O)}return g.length},this.splitGraphemes=function(g){for(var I=[],T=0,w;(w=this.nextBreak(g,T))<g.length;)I.push(g.slice(T,w)),T=w;return T<g.length&&I.push(g.slice(T)),I},this.iterateGraphemes=function(g){var I=0,T={next:(function(){var w,R;return(R=this.nextBreak(g,I))<g.length?(w=g.slice(I,R),I=R,{value:w,done:!1}):I<g.length?(w=g.slice(I),I=g.length,{value:w,done:!1}):{value:void 0,done:!0}}).bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(T[Symbol.iterator]=function(){return T}),T},this.countGraphemes=function(g){for(var I=0,T=0,w;(w=this.nextBreak(g,T))<g.length;)T=w,I++;return T<g.length&&I++,I};function L(g){return 1536<=g&&g<=1541||g==1757||g==1807||g==2274||g==3406||g==69821||70082<=g&&g<=70083||g==72250||72326<=g&&g<=72329||g==73030?p:g==13?e:g==10?t:0<=g&&g<=9||11<=g&&g<=12||14<=g&&g<=31||127<=g&&g<=159||g==173||g==1564||g==6158||g==8203||8206<=g&&g<=8207||g==8232||g==8233||8234<=g&&g<=8238||8288<=g&&g<=8292||g==8293||8294<=g&&g<=8303||55296<=g&&g<=57343||g==65279||65520<=g&&g<=65528||65529<=g&&g<=65531||113824<=g&&g<=113827||119155<=g&&g<=119162||g==917504||g==917505||917506<=g&&g<=917535||917632<=g&&g<=917759||918e3<=g&&g<=921599?n:768<=g&&g<=879||1155<=g&&g<=1159||1160<=g&&g<=1161||1425<=g&&g<=1469||g==1471||1473<=g&&g<=1474||1476<=g&&g<=1477||g==1479||1552<=g&&g<=1562||1611<=g&&g<=1631||g==1648||1750<=g&&g<=1756||1759<=g&&g<=1764||1767<=g&&g<=1768||1770<=g&&g<=1773||g==1809||1840<=g&&g<=1866||1958<=g&&g<=1968||2027<=g&&g<=2035||2070<=g&&g<=2073||2075<=g&&g<=2083||2085<=g&&g<=2087||2089<=g&&g<=2093||2137<=g&&g<=2139||2260<=g&&g<=2273||2275<=g&&g<=2306||g==2362||g==2364||2369<=g&&g<=2376||g==2381||2385<=g&&g<=2391||2402<=g&&g<=2403||g==2433||g==2492||g==2494||2497<=g&&g<=2500||g==2509||g==2519||2530<=g&&g<=2531||2561<=g&&g<=2562||g==2620||2625<=g&&g<=2626||2631<=g&&g<=2632||2635<=g&&g<=2637||g==2641||2672<=g&&g<=2673||g==2677||2689<=g&&g<=2690||g==2748||2753<=g&&g<=2757||2759<=g&&g<=2760||g==2765||2786<=g&&g<=2787||2810<=g&&g<=2815||g==2817||g==2876||g==2878||g==2879||2881<=g&&g<=2884||g==2893||g==2902||g==2903||2914<=g&&g<=2915||g==2946||g==3006||g==3008||g==3021||g==3031||g==3072||3134<=g&&g<=3136||3142<=g&&g<=3144||3146<=g&&g<=3149||3157<=g&&g<=3158||3170<=g&&g<=3171||g==3201||g==3260||g==3263||g==3266||g==3270||3276<=g&&g<=3277||3285<=g&&g<=3286||3298<=g&&g<=3299||3328<=g&&g<=3329||3387<=g&&g<=3388||g==3390||3393<=g&&g<=3396||g==3405||g==3415||3426<=g&&g<=3427||g==3530||g==3535||3538<=g&&g<=3540||g==3542||g==3551||g==3633||3636<=g&&g<=3642||3655<=g&&g<=3662||g==3761||3764<=g&&g<=3769||3771<=g&&g<=3772||3784<=g&&g<=3789||3864<=g&&g<=3865||g==3893||g==3895||g==3897||3953<=g&&g<=3966||3968<=g&&g<=3972||3974<=g&&g<=3975||3981<=g&&g<=3991||3993<=g&&g<=4028||g==4038||4141<=g&&g<=4144||4146<=g&&g<=4151||4153<=g&&g<=4154||4157<=g&&g<=4158||4184<=g&&g<=4185||4190<=g&&g<=4192||4209<=g&&g<=4212||g==4226||4229<=g&&g<=4230||g==4237||g==4253||4957<=g&&g<=4959||5906<=g&&g<=5908||5938<=g&&g<=5940||5970<=g&&g<=5971||6002<=g&&g<=6003||6068<=g&&g<=6069||6071<=g&&g<=6077||g==6086||6089<=g&&g<=6099||g==6109||6155<=g&&g<=6157||6277<=g&&g<=6278||g==6313||6432<=g&&g<=6434||6439<=g&&g<=6440||g==6450||6457<=g&&g<=6459||6679<=g&&g<=6680||g==6683||g==6742||6744<=g&&g<=6750||g==6752||g==6754||6757<=g&&g<=6764||6771<=g&&g<=6780||g==6783||6832<=g&&g<=6845||g==6846||6912<=g&&g<=6915||g==6964||6966<=g&&g<=6970||g==6972||g==6978||7019<=g&&g<=7027||7040<=g&&g<=7041||7074<=g&&g<=7077||7080<=g&&g<=7081||7083<=g&&g<=7085||g==7142||7144<=g&&g<=7145||g==7149||7151<=g&&g<=7153||7212<=g&&g<=7219||7222<=g&&g<=7223||7376<=g&&g<=7378||7380<=g&&g<=7392||7394<=g&&g<=7400||g==7405||g==7412||7416<=g&&g<=7417||7616<=g&&g<=7673||7675<=g&&g<=7679||g==8204||8400<=g&&g<=8412||8413<=g&&g<=8416||g==8417||8418<=g&&g<=8420||8421<=g&&g<=8432||11503<=g&&g<=11505||g==11647||11744<=g&&g<=11775||12330<=g&&g<=12333||12334<=g&&g<=12335||12441<=g&&g<=12442||g==42607||42608<=g&&g<=42610||42612<=g&&g<=42621||42654<=g&&g<=42655||42736<=g&&g<=42737||g==43010||g==43014||g==43019||43045<=g&&g<=43046||43204<=g&&g<=43205||43232<=g&&g<=43249||43302<=g&&g<=43309||43335<=g&&g<=43345||43392<=g&&g<=43394||g==43443||43446<=g&&g<=43449||g==43452||g==43493||43561<=g&&g<=43566||43569<=g&&g<=43570||43573<=g&&g<=43574||g==43587||g==43596||g==43644||g==43696||43698<=g&&g<=43700||43703<=g&&g<=43704||43710<=g&&g<=43711||g==43713||43756<=g&&g<=43757||g==43766||g==44005||g==44008||g==44013||g==64286||65024<=g&&g<=65039||65056<=g&&g<=65071||65438<=g&&g<=65439||g==66045||g==66272||66422<=g&&g<=66426||68097<=g&&g<=68099||68101<=g&&g<=68102||68108<=g&&g<=68111||68152<=g&&g<=68154||g==68159||68325<=g&&g<=68326||g==69633||69688<=g&&g<=69702||69759<=g&&g<=69761||69811<=g&&g<=69814||69817<=g&&g<=69818||69888<=g&&g<=69890||69927<=g&&g<=69931||69933<=g&&g<=69940||g==70003||70016<=g&&g<=70017||70070<=g&&g<=70078||70090<=g&&g<=70092||70191<=g&&g<=70193||g==70196||70198<=g&&g<=70199||g==70206||g==70367||70371<=g&&g<=70378||70400<=g&&g<=70401||g==70460||g==70462||g==70464||g==70487||70502<=g&&g<=70508||70512<=g&&g<=70516||70712<=g&&g<=70719||70722<=g&&g<=70724||g==70726||g==70832||70835<=g&&g<=70840||g==70842||g==70845||70847<=g&&g<=70848||70850<=g&&g<=70851||g==71087||71090<=g&&g<=71093||71100<=g&&g<=71101||71103<=g&&g<=71104||71132<=g&&g<=71133||71219<=g&&g<=71226||g==71229||71231<=g&&g<=71232||g==71339||g==71341||71344<=g&&g<=71349||g==71351||71453<=g&&g<=71455||71458<=g&&g<=71461||71463<=g&&g<=71467||72193<=g&&g<=72198||72201<=g&&g<=72202||72243<=g&&g<=72248||72251<=g&&g<=72254||g==72263||72273<=g&&g<=72278||72281<=g&&g<=72283||72330<=g&&g<=72342||72344<=g&&g<=72345||72752<=g&&g<=72758||72760<=g&&g<=72765||g==72767||72850<=g&&g<=72871||72874<=g&&g<=72880||72882<=g&&g<=72883||72885<=g&&g<=72886||73009<=g&&g<=73014||g==73018||73020<=g&&g<=73021||73023<=g&&g<=73029||g==73031||92912<=g&&g<=92916||92976<=g&&g<=92982||94095<=g&&g<=94098||113821<=g&&g<=113822||g==119141||119143<=g&&g<=119145||119150<=g&&g<=119154||119163<=g&&g<=119170||119173<=g&&g<=119179||119210<=g&&g<=119213||119362<=g&&g<=119364||121344<=g&&g<=121398||121403<=g&&g<=121452||g==121461||g==121476||121499<=g&&g<=121503||121505<=g&&g<=121519||122880<=g&&g<=122886||122888<=g&&g<=122904||122907<=g&&g<=122913||122915<=g&&g<=122916||122918<=g&&g<=122922||125136<=g&&g<=125142||125252<=g&&g<=125258||917536<=g&&g<=917631||917760<=g&&g<=917999?i:127462<=g&&g<=127487?o:g==2307||g==2363||2366<=g&&g<=2368||2377<=g&&g<=2380||2382<=g&&g<=2383||2434<=g&&g<=2435||2495<=g&&g<=2496||2503<=g&&g<=2504||2507<=g&&g<=2508||g==2563||2622<=g&&g<=2624||g==2691||2750<=g&&g<=2752||g==2761||2763<=g&&g<=2764||2818<=g&&g<=2819||g==2880||2887<=g&&g<=2888||2891<=g&&g<=2892||g==3007||3009<=g&&g<=3010||3014<=g&&g<=3016||3018<=g&&g<=3020||3073<=g&&g<=3075||3137<=g&&g<=3140||3202<=g&&g<=3203||g==3262||3264<=g&&g<=3265||3267<=g&&g<=3268||3271<=g&&g<=3272||3274<=g&&g<=3275||3330<=g&&g<=3331||3391<=g&&g<=3392||3398<=g&&g<=3400||3402<=g&&g<=3404||3458<=g&&g<=3459||3536<=g&&g<=3537||3544<=g&&g<=3550||3570<=g&&g<=3571||g==3635||g==3763||3902<=g&&g<=3903||g==3967||g==4145||4155<=g&&g<=4156||4182<=g&&g<=4183||g==4228||g==6070||6078<=g&&g<=6085||6087<=g&&g<=6088||6435<=g&&g<=6438||6441<=g&&g<=6443||6448<=g&&g<=6449||6451<=g&&g<=6456||6681<=g&&g<=6682||g==6741||g==6743||6765<=g&&g<=6770||g==6916||g==6965||g==6971||6973<=g&&g<=6977||6979<=g&&g<=6980||g==7042||g==7073||7078<=g&&g<=7079||g==7082||g==7143||7146<=g&&g<=7148||g==7150||7154<=g&&g<=7155||7204<=g&&g<=7211||7220<=g&&g<=7221||g==7393||7410<=g&&g<=7411||g==7415||43043<=g&&g<=43044||g==43047||43136<=g&&g<=43137||43188<=g&&g<=43203||43346<=g&&g<=43347||g==43395||43444<=g&&g<=43445||43450<=g&&g<=43451||43453<=g&&g<=43456||43567<=g&&g<=43568||43571<=g&&g<=43572||g==43597||g==43755||43758<=g&&g<=43759||g==43765||44003<=g&&g<=44004||44006<=g&&g<=44007||44009<=g&&g<=44010||g==44012||g==69632||g==69634||g==69762||69808<=g&&g<=69810||69815<=g&&g<=69816||g==69932||g==70018||70067<=g&&g<=70069||70079<=g&&g<=70080||70188<=g&&g<=70190||70194<=g&&g<=70195||g==70197||70368<=g&&g<=70370||70402<=g&&g<=70403||g==70463||70465<=g&&g<=70468||70471<=g&&g<=70472||70475<=g&&g<=70477||70498<=g&&g<=70499||70709<=g&&g<=70711||70720<=g&&g<=70721||g==70725||70833<=g&&g<=70834||g==70841||70843<=g&&g<=70844||g==70846||g==70849||71088<=g&&g<=71089||71096<=g&&g<=71099||g==71102||71216<=g&&g<=71218||71227<=g&&g<=71228||g==71230||g==71340||71342<=g&&g<=71343||g==71350||71456<=g&&g<=71457||g==71462||72199<=g&&g<=72200||g==72249||72279<=g&&g<=72280||g==72343||g==72751||g==72766||g==72873||g==72881||g==72884||94033<=g&&g<=94078||g==119142||g==119149?r:4352<=g&&g<=4447||43360<=g&&g<=43388?a:4448<=g&&g<=4519||55216<=g&&g<=55238?s:4520<=g&&g<=4607||55243<=g&&g<=55291?c:g==44032||g==44060||g==44088||g==44116||g==44144||g==44172||g==44200||g==44228||g==44256||g==44284||g==44312||g==44340||g==44368||g==44396||g==44424||g==44452||g==44480||g==44508||g==44536||g==44564||g==44592||g==44620||g==44648||g==44676||g==44704||g==44732||g==44760||g==44788||g==44816||g==44844||g==44872||g==44900||g==44928||g==44956||g==44984||g==45012||g==45040||g==45068||g==45096||g==45124||g==45152||g==45180||g==45208||g==45236||g==45264||g==45292||g==45320||g==45348||g==45376||g==45404||g==45432||g==45460||g==45488||g==45516||g==45544||g==45572||g==45600||g==45628||g==45656||g==45684||g==45712||g==45740||g==45768||g==45796||g==45824||g==45852||g==45880||g==45908||g==45936||g==45964||g==45992||g==46020||g==46048||g==46076||g==46104||g==46132||g==46160||g==46188||g==46216||g==46244||g==46272||g==46300||g==46328||g==46356||g==46384||g==46412||g==46440||g==46468||g==46496||g==46524||g==46552||g==46580||g==46608||g==46636||g==46664||g==46692||g==46720||g==46748||g==46776||g==46804||g==46832||g==46860||g==46888||g==46916||g==46944||g==46972||g==47e3||g==47028||g==47056||g==47084||g==47112||g==47140||g==47168||g==47196||g==47224||g==47252||g==47280||g==47308||g==47336||g==47364||g==47392||g==47420||g==47448||g==47476||g==47504||g==47532||g==47560||g==47588||g==47616||g==47644||g==47672||g==47700||g==47728||g==47756||g==47784||g==47812||g==47840||g==47868||g==47896||g==47924||g==47952||g==47980||g==48008||g==48036||g==48064||g==48092||g==48120||g==48148||g==48176||g==48204||g==48232||g==48260||g==48288||g==48316||g==48344||g==48372||g==48400||g==48428||g==48456||g==48484||g==48512||g==48540||g==48568||g==48596||g==48624||g==48652||g==48680||g==48708||g==48736||g==48764||g==48792||g==48820||g==48848||g==48876||g==48904||g==48932||g==48960||g==48988||g==49016||g==49044||g==49072||g==49100||g==49128||g==49156||g==49184||g==49212||g==49240||g==49268||g==49296||g==49324||g==49352||g==49380||g==49408||g==49436||g==49464||g==49492||g==49520||g==49548||g==49576||g==49604||g==49632||g==49660||g==49688||g==49716||g==49744||g==49772||g==49800||g==49828||g==49856||g==49884||g==49912||g==49940||g==49968||g==49996||g==50024||g==50052||g==50080||g==50108||g==50136||g==50164||g==50192||g==50220||g==50248||g==50276||g==50304||g==50332||g==50360||g==50388||g==50416||g==50444||g==50472||g==50500||g==50528||g==50556||g==50584||g==50612||g==50640||g==50668||g==50696||g==50724||g==50752||g==50780||g==50808||g==50836||g==50864||g==50892||g==50920||g==50948||g==50976||g==51004||g==51032||g==51060||g==51088||g==51116||g==51144||g==51172||g==51200||g==51228||g==51256||g==51284||g==51312||g==51340||g==51368||g==51396||g==51424||g==51452||g==51480||g==51508||g==51536||g==51564||g==51592||g==51620||g==51648||g==51676||g==51704||g==51732||g==51760||g==51788||g==51816||g==51844||g==51872||g==51900||g==51928||g==51956||g==51984||g==52012||g==52040||g==52068||g==52096||g==52124||g==52152||g==52180||g==52208||g==52236||g==52264||g==52292||g==52320||g==52348||g==52376||g==52404||g==52432||g==52460||g==52488||g==52516||g==52544||g==52572||g==52600||g==52628||g==52656||g==52684||g==52712||g==52740||g==52768||g==52796||g==52824||g==52852||g==52880||g==52908||g==52936||g==52964||g==52992||g==53020||g==53048||g==53076||g==53104||g==53132||g==53160||g==53188||g==53216||g==53244||g==53272||g==53300||g==53328||g==53356||g==53384||g==53412||g==53440||g==53468||g==53496||g==53524||g==53552||g==53580||g==53608||g==53636||g==53664||g==53692||g==53720||g==53748||g==53776||g==53804||g==53832||g==53860||g==53888||g==53916||g==53944||g==53972||g==54e3||g==54028||g==54056||g==54084||g==54112||g==54140||g==54168||g==54196||g==54224||g==54252||g==54280||g==54308||g==54336||g==54364||g==54392||g==54420||g==54448||g==54476||g==54504||g==54532||g==54560||g==54588||g==54616||g==54644||g==54672||g==54700||g==54728||g==54756||g==54784||g==54812||g==54840||g==54868||g==54896||g==54924||g==54952||g==54980||g==55008||g==55036||g==55064||g==55092||g==55120||g==55148||g==55176?u:44033<=g&&g<=44059||44061<=g&&g<=44087||44089<=g&&g<=44115||44117<=g&&g<=44143||44145<=g&&g<=44171||44173<=g&&g<=44199||44201<=g&&g<=44227||44229<=g&&g<=44255||44257<=g&&g<=44283||44285<=g&&g<=44311||44313<=g&&g<=44339||44341<=g&&g<=44367||44369<=g&&g<=44395||44397<=g&&g<=44423||44425<=g&&g<=44451||44453<=g&&g<=44479||44481<=g&&g<=44507||44509<=g&&g<=44535||44537<=g&&g<=44563||44565<=g&&g<=44591||44593<=g&&g<=44619||44621<=g&&g<=44647||44649<=g&&g<=44675||44677<=g&&g<=44703||44705<=g&&g<=44731||44733<=g&&g<=44759||44761<=g&&g<=44787||44789<=g&&g<=44815||44817<=g&&g<=44843||44845<=g&&g<=44871||44873<=g&&g<=44899||44901<=g&&g<=44927||44929<=g&&g<=44955||44957<=g&&g<=44983||44985<=g&&g<=45011||45013<=g&&g<=45039||45041<=g&&g<=45067||45069<=g&&g<=45095||45097<=g&&g<=45123||45125<=g&&g<=45151||45153<=g&&g<=45179||45181<=g&&g<=45207||45209<=g&&g<=45235||45237<=g&&g<=45263||45265<=g&&g<=45291||45293<=g&&g<=45319||45321<=g&&g<=45347||45349<=g&&g<=45375||45377<=g&&g<=45403||45405<=g&&g<=45431||45433<=g&&g<=45459||45461<=g&&g<=45487||45489<=g&&g<=45515||45517<=g&&g<=45543||45545<=g&&g<=45571||45573<=g&&g<=45599||45601<=g&&g<=45627||45629<=g&&g<=45655||45657<=g&&g<=45683||45685<=g&&g<=45711||45713<=g&&g<=45739||45741<=g&&g<=45767||45769<=g&&g<=45795||45797<=g&&g<=45823||45825<=g&&g<=45851||45853<=g&&g<=45879||45881<=g&&g<=45907||45909<=g&&g<=45935||45937<=g&&g<=45963||45965<=g&&g<=45991||45993<=g&&g<=46019||46021<=g&&g<=46047||46049<=g&&g<=46075||46077<=g&&g<=46103||46105<=g&&g<=46131||46133<=g&&g<=46159||46161<=g&&g<=46187||46189<=g&&g<=46215||46217<=g&&g<=46243||46245<=g&&g<=46271||46273<=g&&g<=46299||46301<=g&&g<=46327||46329<=g&&g<=46355||46357<=g&&g<=46383||46385<=g&&g<=46411||46413<=g&&g<=46439||46441<=g&&g<=46467||46469<=g&&g<=46495||46497<=g&&g<=46523||46525<=g&&g<=46551||46553<=g&&g<=46579||46581<=g&&g<=46607||46609<=g&&g<=46635||46637<=g&&g<=46663||46665<=g&&g<=46691||46693<=g&&g<=46719||46721<=g&&g<=46747||46749<=g&&g<=46775||46777<=g&&g<=46803||46805<=g&&g<=46831||46833<=g&&g<=46859||46861<=g&&g<=46887||46889<=g&&g<=46915||46917<=g&&g<=46943||46945<=g&&g<=46971||46973<=g&&g<=46999||47001<=g&&g<=47027||47029<=g&&g<=47055||47057<=g&&g<=47083||47085<=g&&g<=47111||47113<=g&&g<=47139||47141<=g&&g<=47167||47169<=g&&g<=47195||47197<=g&&g<=47223||47225<=g&&g<=47251||47253<=g&&g<=47279||47281<=g&&g<=47307||47309<=g&&g<=47335||47337<=g&&g<=47363||47365<=g&&g<=47391||47393<=g&&g<=47419||47421<=g&&g<=47447||47449<=g&&g<=47475||47477<=g&&g<=47503||47505<=g&&g<=47531||47533<=g&&g<=47559||47561<=g&&g<=47587||47589<=g&&g<=47615||47617<=g&&g<=47643||47645<=g&&g<=47671||47673<=g&&g<=47699||47701<=g&&g<=47727||47729<=g&&g<=47755||47757<=g&&g<=47783||47785<=g&&g<=47811||47813<=g&&g<=47839||47841<=g&&g<=47867||47869<=g&&g<=47895||47897<=g&&g<=47923||47925<=g&&g<=47951||47953<=g&&g<=47979||47981<=g&&g<=48007||48009<=g&&g<=48035||48037<=g&&g<=48063||48065<=g&&g<=48091||48093<=g&&g<=48119||48121<=g&&g<=48147||48149<=g&&g<=48175||48177<=g&&g<=48203||48205<=g&&g<=48231||48233<=g&&g<=48259||48261<=g&&g<=48287||48289<=g&&g<=48315||48317<=g&&g<=48343||48345<=g&&g<=48371||48373<=g&&g<=48399||48401<=g&&g<=48427||48429<=g&&g<=48455||48457<=g&&g<=48483||48485<=g&&g<=48511||48513<=g&&g<=48539||48541<=g&&g<=48567||48569<=g&&g<=48595||48597<=g&&g<=48623||48625<=g&&g<=48651||48653<=g&&g<=48679||48681<=g&&g<=48707||48709<=g&&g<=48735||48737<=g&&g<=48763||48765<=g&&g<=48791||48793<=g&&g<=48819||48821<=g&&g<=48847||48849<=g&&g<=48875||48877<=g&&g<=48903||48905<=g&&g<=48931||48933<=g&&g<=48959||48961<=g&&g<=48987||48989<=g&&g<=49015||49017<=g&&g<=49043||49045<=g&&g<=49071||49073<=g&&g<=49099||49101<=g&&g<=49127||49129<=g&&g<=49155||49157<=g&&g<=49183||49185<=g&&g<=49211||49213<=g&&g<=49239||49241<=g&&g<=49267||49269<=g&&g<=49295||49297<=g&&g<=49323||49325<=g&&g<=49351||49353<=g&&g<=49379||49381<=g&&g<=49407||49409<=g&&g<=49435||49437<=g&&g<=49463||49465<=g&&g<=49491||49493<=g&&g<=49519||49521<=g&&g<=49547||49549<=g&&g<=49575||49577<=g&&g<=49603||49605<=g&&g<=49631||49633<=g&&g<=49659||49661<=g&&g<=49687||49689<=g&&g<=49715||49717<=g&&g<=49743||49745<=g&&g<=49771||49773<=g&&g<=49799||49801<=g&&g<=49827||49829<=g&&g<=49855||49857<=g&&g<=49883||49885<=g&&g<=49911||49913<=g&&g<=49939||49941<=g&&g<=49967||49969<=g&&g<=49995||49997<=g&&g<=50023||50025<=g&&g<=50051||50053<=g&&g<=50079||50081<=g&&g<=50107||50109<=g&&g<=50135||50137<=g&&g<=50163||50165<=g&&g<=50191||50193<=g&&g<=50219||50221<=g&&g<=50247||50249<=g&&g<=50275||50277<=g&&g<=50303||50305<=g&&g<=50331||50333<=g&&g<=50359||50361<=g&&g<=50387||50389<=g&&g<=50415||50417<=g&&g<=50443||50445<=g&&g<=50471||50473<=g&&g<=50499||50501<=g&&g<=50527||50529<=g&&g<=50555||50557<=g&&g<=50583||50585<=g&&g<=50611||50613<=g&&g<=50639||50641<=g&&g<=50667||50669<=g&&g<=50695||50697<=g&&g<=50723||50725<=g&&g<=50751||50753<=g&&g<=50779||50781<=g&&g<=50807||50809<=g&&g<=50835||50837<=g&&g<=50863||50865<=g&&g<=50891||50893<=g&&g<=50919||50921<=g&&g<=50947||50949<=g&&g<=50975||50977<=g&&g<=51003||51005<=g&&g<=51031||51033<=g&&g<=51059||51061<=g&&g<=51087||51089<=g&&g<=51115||51117<=g&&g<=51143||51145<=g&&g<=51171||51173<=g&&g<=51199||51201<=g&&g<=51227||51229<=g&&g<=51255||51257<=g&&g<=51283||51285<=g&&g<=51311||51313<=g&&g<=51339||51341<=g&&g<=51367||51369<=g&&g<=51395||51397<=g&&g<=51423||51425<=g&&g<=51451||51453<=g&&g<=51479||51481<=g&&g<=51507||51509<=g&&g<=51535||51537<=g&&g<=51563||51565<=g&&g<=51591||51593<=g&&g<=51619||51621<=g&&g<=51647||51649<=g&&g<=51675||51677<=g&&g<=51703||51705<=g&&g<=51731||51733<=g&&g<=51759||51761<=g&&g<=51787||51789<=g&&g<=51815||51817<=g&&g<=51843||51845<=g&&g<=51871||51873<=g&&g<=51899||51901<=g&&g<=51927||51929<=g&&g<=51955||51957<=g&&g<=51983||51985<=g&&g<=52011||52013<=g&&g<=52039||52041<=g&&g<=52067||52069<=g&&g<=52095||52097<=g&&g<=52123||52125<=g&&g<=52151||52153<=g&&g<=52179||52181<=g&&g<=52207||52209<=g&&g<=52235||52237<=g&&g<=52263||52265<=g&&g<=52291||52293<=g&&g<=52319||52321<=g&&g<=52347||52349<=g&&g<=52375||52377<=g&&g<=52403||52405<=g&&g<=52431||52433<=g&&g<=52459||52461<=g&&g<=52487||52489<=g&&g<=52515||52517<=g&&g<=52543||52545<=g&&g<=52571||52573<=g&&g<=52599||52601<=g&&g<=52627||52629<=g&&g<=52655||52657<=g&&g<=52683||52685<=g&&g<=52711||52713<=g&&g<=52739||52741<=g&&g<=52767||52769<=g&&g<=52795||52797<=g&&g<=52823||52825<=g&&g<=52851||52853<=g&&g<=52879||52881<=g&&g<=52907||52909<=g&&g<=52935||52937<=g&&g<=52963||52965<=g&&g<=52991||52993<=g&&g<=53019||53021<=g&&g<=53047||53049<=g&&g<=53075||53077<=g&&g<=53103||53105<=g&&g<=53131||53133<=g&&g<=53159||53161<=g&&g<=53187||53189<=g&&g<=53215||53217<=g&&g<=53243||53245<=g&&g<=53271||53273<=g&&g<=53299||53301<=g&&g<=53327||53329<=g&&g<=53355||53357<=g&&g<=53383||53385<=g&&g<=53411||53413<=g&&g<=53439||53441<=g&&g<=53467||53469<=g&&g<=53495||53497<=g&&g<=53523||53525<=g&&g<=53551||53553<=g&&g<=53579||53581<=g&&g<=53607||53609<=g&&g<=53635||53637<=g&&g<=53663||53665<=g&&g<=53691||53693<=g&&g<=53719||53721<=g&&g<=53747||53749<=g&&g<=53775||53777<=g&&g<=53803||53805<=g&&g<=53831||53833<=g&&g<=53859||53861<=g&&g<=53887||53889<=g&&g<=53915||53917<=g&&g<=53943||53945<=g&&g<=53971||53973<=g&&g<=53999||54001<=g&&g<=54027||54029<=g&&g<=54055||54057<=g&&g<=54083||54085<=g&&g<=54111||54113<=g&&g<=54139||54141<=g&&g<=54167||54169<=g&&g<=54195||54197<=g&&g<=54223||54225<=g&&g<=54251||54253<=g&&g<=54279||54281<=g&&g<=54307||54309<=g&&g<=54335||54337<=g&&g<=54363||54365<=g&&g<=54391||54393<=g&&g<=54419||54421<=g&&g<=54447||54449<=g&&g<=54475||54477<=g&&g<=54503||54505<=g&&g<=54531||54533<=g&&g<=54559||54561<=g&&g<=54587||54589<=g&&g<=54615||54617<=g&&g<=54643||54645<=g&&g<=54671||54673<=g&&g<=54699||54701<=g&&g<=54727||54729<=g&&g<=54755||54757<=g&&g<=54783||54785<=g&&g<=54811||54813<=g&&g<=54839||54841<=g&&g<=54867||54869<=g&&g<=54895||54897<=g&&g<=54923||54925<=g&&g<=54951||54953<=g&&g<=54979||54981<=g&&g<=55007||55009<=g&&g<=55035||55037<=g&&g<=55063||55065<=g&&g<=55091||55093<=g&&g<=55119||55121<=g&&g<=55147||55149<=g&&g<=55175||55177<=g&&g<=55203?f:g==9757||g==9977||9994<=g&&g<=9997||g==127877||127938<=g&&g<=127940||g==127943||127946<=g&&g<=127948||128066<=g&&g<=128067||128070<=g&&g<=128080||g==128110||128112<=g&&g<=128120||g==128124||128129<=g&&g<=128131||128133<=g&&g<=128135||g==128170||128372<=g&&g<=128373||g==128378||g==128400||128405<=g&&g<=128406||128581<=g&&g<=128583||128587<=g&&g<=128591||g==128675||128692<=g&&g<=128694||g==128704||g==128716||129304<=g&&g<=129308||129310<=g&&g<=129311||g==129318||129328<=g&&g<=129337||129341<=g&&g<=129342||129489<=g&&g<=129501?A:127995<=g&&g<=127999?m:g==8205?_:g==9792||g==9794||9877<=g&&g<=9878||g==9992||g==10084||g==127752||g==127806||g==127859||g==127891||g==127908||g==127912||g==127979||g==127981||g==128139||128187<=g&&g<=128188||g==128295||g==128300||g==128488||g==128640||g==128658?y:128102<=g&&g<=128105?C:h}return this}typeof R8<"u"&&R8.exports&&(R8.exports=q$e)});var cbe=ki((D4,sbe)=>{(function(e,t){typeof D4=="object"&&typeof sbe<"u"?t(D4):typeof define=="function"&&define.amd?define(["exports"],t):(e=e||self,t(e.topojson=e.topojson||{}))})(D4,function(e){"use strict";function t(b){return b}function n(b){if(b==null)return t;var x,S,B=b.scale[0],v=b.scale[1],P=b.translate[0],N=b.translate[1];return function(L,g){g||(x=S=0);var I=2,T=L.length,w=new Array(T);for(w[0]=(x+=L[0])*B+P,w[1]=(S+=L[1])*v+N;I<T;)w[I]=L[I],++I;return w}}function i(b){var x=n(b.transform),S,B=1/0,v=B,P=-B,N=-B;function L(I){I=x(I),I[0]<B&&(B=I[0]),I[0]>P&&(P=I[0]),I[1]<v&&(v=I[1]),I[1]>N&&(N=I[1])}function g(I){switch(I.type){case"GeometryCollection":I.geometries.forEach(g);break;case"Point":L(I.coordinates);break;case"MultiPoint":I.coordinates.forEach(L);break}}b.arcs.forEach(function(I){for(var T=-1,w=I.length,R;++T<w;)R=x(I[T],T),R[0]<B&&(B=R[0]),R[0]>P&&(P=R[0]),R[1]<v&&(v=R[1]),R[1]>N&&(N=R[1])});for(S in b.objects)g(b.objects[S]);return[B,v,P,N]}function o(b,x){for(var S,B=b.length,v=B-x;v<--B;)S=b[v],b[v++]=b[B],b[B]=S}function r(b,x){return typeof x=="string"&&(x=b.objects[x]),x.type==="GeometryCollection"?{type:"FeatureCollection",features:x.geometries.map(function(S){return a(b,S)})}:a(b,x)}function a(b,x){var S=x.id,B=x.bbox,v=x.properties==null?{}:x.properties,P=s(b,x);return S==null&&B==null?{type:"Feature",properties:v,geometry:P}:B==null?{type:"Feature",id:S,properties:v,geometry:P}:{type:"Feature",id:S,bbox:B,properties:v,geometry:P}}function s(b,x){var S=n(b.transform),B=b.arcs;function v(T,w){w.length&&w.pop();for(var R=B[T<0?~T:T],O=0,G=R.length;O<G;++O)w.push(S(R[O],O));T<0&&o(w,G)}function P(T){return S(T)}function N(T){for(var w=[],R=0,O=T.length;R<O;++R)v(T[R],w);return w.length<2&&w.push(w[0]),w}function L(T){for(var w=N(T);w.length<4;)w.push(w[0]);return w}function g(T){return T.map(L)}function I(T){var w=T.type,R;switch(w){case"GeometryCollection":return{type:w,geometries:T.geometries.map(I)};case"Point":R=P(T.coordinates);break;case"MultiPoint":R=T.coordinates.map(P);break;case"LineString":R=N(T.arcs);break;case"MultiLineString":R=T.arcs.map(N);break;case"Polygon":R=g(T.arcs);break;case"MultiPolygon":R=T.arcs.map(g);break;default:return null}return{type:w,coordinates:R}}return I(x)}function c(b,x){var S={},B={},v={},P=[],N=-1;x.forEach(function(I,T){var w=b.arcs[I<0?~I:I],R;w.length<3&&!w[1][0]&&!w[1][1]&&(R=x[++N],x[N]=I,x[T]=R)}),x.forEach(function(I){var T=L(I),w=T[0],R=T[1],O,G;if(O=v[w])if(delete v[O.end],O.push(I),O.end=R,G=B[R]){delete B[G.start];var F=G===O?O:O.concat(G);B[F.start=O.start]=v[F.end=G.end]=F}else B[O.start]=v[O.end]=O;else if(O=B[R])if(delete B[O.start],O.unshift(I),O.start=w,G=v[w]){delete v[G.end];var U=G===O?O:G.concat(O);B[U.start=G.start]=v[U.end=O.end]=U}else B[O.start]=v[O.end]=O;else O=[I],B[O.start=w]=v[O.end=R]=O});function L(I){var T=b.arcs[I<0?~I:I],w=T[0],R;return b.transform?(R=[0,0],T.forEach(function(O){R[0]+=O[0],R[1]+=O[1]})):R=T[T.length-1],I<0?[R,w]:[w,R]}function g(I,T){for(var w in I){var R=I[w];delete T[R.start],delete R.start,delete R.end,R.forEach(function(O){S[O<0?~O:O]=1}),P.push(R)}}return g(v,B),g(B,v),x.forEach(function(I){S[I<0?~I:I]||P.push([I])}),P}function u(b){return s(b,f.apply(this,arguments))}function f(b,x,S){var B,v,P;if(arguments.length>1)B=h(b,x,S);else for(v=0,B=new Array(P=b.arcs.length);v<P;++v)B[v]=v;return{type:"MultiLineString",arcs:c(b,B)}}function h(b,x,S){var B=[],v=[],P;function N(w){var R=w<0?~w:w;(v[R]||(v[R]=[])).push({i:w,g:P})}function L(w){w.forEach(N)}function g(w){w.forEach(L)}function I(w){w.forEach(g)}function T(w){switch(P=w,w.type){case"GeometryCollection":w.geometries.forEach(T);break;case"LineString":L(w.arcs);break;case"MultiLineString":case"Polygon":g(w.arcs);break;case"MultiPolygon":I(w.arcs);break}}return T(x),v.forEach(S==null?function(w){B.push(w[0].i)}:function(w){S(w[0].g,w[w.length-1].g)&&B.push(w[0].i)}),B}function p(b){for(var x=-1,S=b.length,B,v=b[S-1],P=0;++x<S;)B=v,v=b[x],P+=B[0]*v[1]-B[1]*v[0];return Math.abs(P)}function A(b){return s(b,m.apply(this,arguments))}function m(b,x){var S={},B=[],v=[];x.forEach(P);function P(g){switch(g.type){case"GeometryCollection":g.geometries.forEach(P);break;case"Polygon":N(g.arcs);break;case"MultiPolygon":g.arcs.forEach(N);break}}function N(g){g.forEach(function(I){I.forEach(function(T){(S[T=T<0?~T:T]||(S[T]=[])).push(g)})}),B.push(g)}function L(g){return p(s(b,{type:"Polygon",arcs:[g]}).coordinates[0])}return B.forEach(function(g){if(!g._){var I=[],T=[g];for(g._=1,v.push(I);g=T.pop();)I.push(g),g.forEach(function(w){w.forEach(function(R){S[R<0?~R:R].forEach(function(O){O._||(O._=1,T.push(O))})})})}}),B.forEach(function(g){delete g._}),{type:"MultiPolygon",arcs:v.map(function(g){var I=[],T;if(g.forEach(function(F){F.forEach(function(U){U.forEach(function(Q){S[Q<0?~Q:Q].length<2&&I.push(Q)})})}),I=c(b,I),(T=I.length)>1)for(var w=1,R=L(I[0]),O,G;w<T;++w)(O=L(I[w]))>R&&(G=I[0],I[0]=I[w],I[w]=G,R=O);return I}).filter(function(g){return g.length>0})}}function _(b,x){for(var S=0,B=b.length;S<B;){var v=S+B>>>1;b[v]<x?S=v+1:B=v}return S}function y(b){var x={},S=b.map(function(){return[]});function B(F,U){F.forEach(function(Q){Q<0&&(Q=~Q);var H=x[Q];H?H.push(U):x[Q]=[U]})}function v(F,U){F.forEach(function(Q){B(Q,U)})}function P(F,U){F.type==="GeometryCollection"?F.geometries.forEach(function(Q){P(Q,U)}):F.type in N&&N[F.type](F.arcs,U)}var N={LineString:B,MultiLineString:v,Polygon:v,MultiPolygon:function(F,U){F.forEach(function(Q){v(Q,U)})}};b.forEach(P);for(var L in x)for(var g=x[L],I=g.length,T=0;T<I;++T)for(var w=T+1;w<I;++w){var R=g[T],O=g[w],G;(G=S[R])[L=_(G,O)]!==O&&G.splice(L,0,O),(G=S[O])[L=_(G,R)]!==R&&G.splice(L,0,R)}return S}function C(b){if(b==null)return t;var x,S,B=b.scale[0],v=b.scale[1],P=b.translate[0],N=b.translate[1];return function(L,g){g||(x=S=0);var I=2,T=L.length,w=new Array(T),R=Math.round((L[0]-P)/B),O=Math.round((L[1]-N)/v);for(w[0]=R-x,x=R,w[1]=O-S,S=O;I<T;)w[I]=L[I],++I;return w}}function E(b,x){if(b.transform)throw new Error("already quantized");if(!x||!x.scale){if(!((N=Math.floor(x))>=2))throw new Error("n must be \u22652");g=b.bbox||i(b);var S=g[0],B=g[1],v=g[2],P=g[3],N;x={scale:[v-S?(v-S)/(N-1):1,P-B?(P-B)/(N-1):1],translate:[S,B]}}else g=b.bbox;var L=C(x),g,I,T=b.objects,w={};function R(F){return L(F)}function O(F){var U;switch(F.type){case"GeometryCollection":U={type:"GeometryCollection",geometries:F.geometries.map(O)};break;case"Point":U={type:"Point",coordinates:R(F.coordinates)};break;case"MultiPoint":U={type:"MultiPoint",coordinates:F.coordinates.map(R)};break;default:return F}return F.id!=null&&(U.id=F.id),F.bbox!=null&&(U.bbox=F.bbox),F.properties!=null&&(U.properties=F.properties),U}function G(F){var U=0,Q=1,H=F.length,Y,$=new Array(H);for($[0]=L(F[0],0);++U<H;)((Y=L(F[U],U))[0]||Y[1])&&($[Q++]=Y);return Q===1&&($[Q++]=[0,0]),$.length=Q,$}for(I in T)w[I]=O(T[I]);return{type:"Topology",bbox:g,transform:x,objects:w,arcs:b.arcs.map(G)}}e.bbox=i,e.feature=r,e.merge=A,e.mergeArcs=m,e.mesh=u,e.meshArcs=f,e.neighbors=y,e.quantize=E,e.transform=n,e.untransform=C,Object.defineProperty(e,"__esModule",{value:!0})})});var Bbe=ki(R4=>{"use strict";Object.defineProperty(R4,"__esModule",{value:!0});R4.version=void 0;R4.version="4.0.0"});var vw=ki(fl=>{"use strict";Object.defineProperty(fl,"__esModule",{value:!0});fl.assertNever=fl.removeWithPredicate=fl.remove=fl.ellipsis=fl.defaults=fl.isBoolean=fl.isUndefined=void 0;function Dbe(e){return e===void 0}fl.isUndefined=Dbe;function zht(e){return typeof e=="boolean"}fl.isBoolean=zht;function Ght(e,t){for(var n in t)t.hasOwnProperty(n)&&Dbe(e[n])&&(e[n]=t[n]);return e}fl.defaults=Ght;function Vht(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}fl.ellipsis=Vht;function Hht(e,t){for(var n=e.length-1;n>=0;n--)e[n]===t&&e.splice(n,1)}fl.remove=Hht;function Wht(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}fl.removeWithPredicate=Wht;function jht(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}fl.assertNever=jht});var Xb=ki(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.alphaNumericAndMarksRe=Gi.alphaNumericAndMarksCharsStr=Gi.alphaNumericCharsRe=Gi.decimalNumbersStr=Gi.alphaCharsAndMarksStr=Gi.marksStr=Gi.emojiStr=Gi.alphaCharsStr=Gi.controlCharsRe=Gi.quoteRe=Gi.whitespaceRe=Gi.nonDigitRe=Gi.digitRe=Gi.letterRe=void 0;Gi.letterRe=/[A-Za-z]/;Gi.digitRe=/[\d]/;Gi.nonDigitRe=/[\D]/;Gi.whitespaceRe=/\s/;Gi.quoteRe=/['"]/;Gi.controlCharsRe=/[\x00-\x1F\x7F]/;Gi.alphaCharsStr=/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;Gi.emojiStr=/\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;Gi.marksStr=/\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;Gi.alphaCharsAndMarksStr=Gi.alphaCharsStr+Gi.emojiStr+Gi.marksStr;Gi.decimalNumbersStr=/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;Gi.alphaNumericCharsRe=new RegExp("[".concat(Gi.alphaCharsStr+Gi.decimalNumbersStr,"]"));Gi.alphaNumericAndMarksCharsStr=Gi.alphaCharsAndMarksStr+Gi.decimalNumbersStr;Gi.alphaNumericAndMarksRe=new RegExp("[".concat(Gi.alphaNumericAndMarksCharsStr,"]"))});var L4=ki(N4=>{"use strict";Object.defineProperty(N4,"__esModule",{value:!0});N4.HtmlTag=void 0;var M4=Xb(),Yht=(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(M4.whitespaceRe):[],o=t.split(M4.whitespaceRe),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(M4.whitespaceRe):[],o=t.split(M4.whitespaceRe),r;i.length&&(r=o.shift());){var a=i.indexOf(r);a!==-1&&i.splice(a,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})();N4.HtmlTag=Yht});var vbe=ki(O4=>{"use strict";Object.defineProperty(O4,"__esModule",{value:!0});O4.truncateSmart=void 0;function qht(e,t,n){var i,o;n==null?(n="&hellip;",o=3,i=8):(o=n.length,i=n.length);var r=function(E){var b={},x=E,S=x.match(/^([a-z]+):\/\//i);return S&&(b.scheme=S[1],x=x.substr(S[0].length)),S=x.match(/^(.*?)(?=(\?|#|\/|$))/i),S&&(b.host=S[1],x=x.substr(S[0].length)),S=x.match(/^\/(.*?)(?=(\?|#|$))/i),S&&(b.path=S[1],x=x.substr(S[0].length)),S=x.match(/^\?(.*?)(?=(#|$))/i),S&&(b.query=S[1],x=x.substr(S[0].length)),S=x.match(/^#(.*?)$/i),S&&(b.fragment=S[1]),b},a=function(E){var b="";return E.scheme&&E.host&&(b+=E.scheme+"://"),E.host&&(b+=E.host),E.path&&(b+="/"+E.path),E.query&&(b+="?"+E.query),E.fragment&&(b+="#"+E.fragment),b},s=function(E,b){var x=b/2,S=Math.ceil(x),B=-1*Math.floor(x),v="";return B<0&&(v=E.substr(B)),E.substr(0,S)+n+v};if(e.length<=t)return e;var c=t-o,u=r(e);if(u.query){var f=u.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);f&&(u.query=u.query.substr(0,f[1].length),e=a(u))}if(e.length<=t||(u.host&&(u.host=u.host.replace(/^www\./,""),e=a(u)),e.length<=t))return e;var h="";if(u.host&&(h+=u.host),h.length>=c)return u.host.length==t?(u.host.substr(0,t-o)+n).substr(0,c+i):s(h,c).substr(0,c+i);var p="";if(u.path&&(p+="/"+u.path),u.query&&(p+="?"+u.query),p)if((h+p).length>=c){if((h+p).length==t)return(h+p).substr(0,t);var A=c-h.length;return(h+s(p,A)).substr(0,c+i)}else h+=p;if(u.fragment){var m="#"+u.fragment;if((h+m).length>=c){if((h+m).length==t)return(h+m).substr(0,t);var _=c-h.length;return(h+s(m,_)).substr(0,c+i)}else h+=m}if(u.scheme&&u.host){var y=u.scheme+"://";if((h+y).length<c)return(y+h).substr(0,t)}if(h.length<=t)return h;var C="";return c>0&&(C=h.substr(-1*Math.floor(c/2))),(h.substr(0,Math.ceil(c/2))+n+C).substr(0,c+i)}O4.truncateSmart=qht});var Pbe=ki(F4=>{"use strict";Object.defineProperty(F4,"__esModule",{value:!0});F4.truncateMiddle=void 0;function Kht(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,a="";return r>0&&(a=e.substr(-1*Math.floor(r/2))),(e.substr(0,Math.ceil(r/2))+n+a).substr(0,r+i)}F4.truncateMiddle=Kht});var Rbe=ki(Q4=>{"use strict";Object.defineProperty(Q4,"__esModule",{value:!0});Q4.truncateEnd=void 0;var Xht=vw();function Jht(e,t,n){return(0,Xht.ellipsis)(e,t,n)}Q4.truncateEnd=Jht});var SZ=ki(k4=>{"use strict";Object.defineProperty(k4,"__esModule",{value:!0});k4.AnchorTagBuilder=void 0;var Zht=L4(),$ht=vbe(),emt=Pbe(),tmt=Rbe(),nmt=(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 Zht.HtmlTag({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,a=o.length;r<a;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"?(0,$ht.truncateSmart)(t,i):o==="middle"?(0,emt.truncateMiddle)(t,i):(0,tmt.truncateEnd)(t,i)},e})();k4.AnchorTagBuilder=nmt});var Kp={};Yie(Kp,{__addDisposableResource:()=>$be,__assign:()=>U4,__asyncDelegator:()=>Wbe,__asyncGenerator:()=>Hbe,__asyncValues:()=>jbe,__await:()=>Pw,__awaiter:()=>Qbe,__classPrivateFieldGet:()=>Xbe,__classPrivateFieldIn:()=>Zbe,__classPrivateFieldSet:()=>Jbe,__createBinding:()=>G4,__decorate:()=>Lbe,__disposeResources:()=>eIe,__esDecorate:()=>imt,__exportStar:()=>Ube,__extends:()=>Mbe,__generator:()=>kbe,__importDefault:()=>Kbe,__importStar:()=>qbe,__makeTemplateObject:()=>Ybe,__metadata:()=>Fbe,__param:()=>Obe,__propKey:()=>rmt,__read:()=>BZ,__rest:()=>Nbe,__runInitializers:()=>omt,__setFunctionName:()=>amt,__spread:()=>zbe,__spreadArray:()=>Vbe,__spreadArrays:()=>Gbe,__values:()=>z4,default:()=>lmt});function Mbe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");wZ(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function Nbe(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]]);return n}function Lbe(e,t,n,i){var o=arguments.length,r=o<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(r=(o<3?a(r):o>3?a(t,n,r):a(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}function Obe(e,t){return function(n,i){t(n,i,e)}}function imt(e,t,n,i,o,r){function a(C){if(C!==void 0&&typeof C!="function")throw new TypeError("Function expected");return C}for(var s=i.kind,c=s==="getter"?"get":s==="setter"?"set":"value",u=!t&&e?i.static?e:e.prototype:null,f=t||(u?Object.getOwnPropertyDescriptor(u,i.name):{}),h,p=!1,A=n.length-1;A>=0;A--){var m={};for(var _ in i)m[_]=_==="access"?{}:i[_];for(var _ in i.access)m.access[_]=i.access[_];m.addInitializer=function(C){if(p)throw new TypeError("Cannot add initializers after decoration has completed");r.push(a(C||null))};var y=(0,n[A])(s==="accessor"?{get:f.get,set:f.set}:f[c],m);if(s==="accessor"){if(y===void 0)continue;if(y===null||typeof y!="object")throw new TypeError("Object expected");(h=a(y.get))&&(f.get=h),(h=a(y.set))&&(f.set=h),(h=a(y.init))&&o.unshift(h)}else(h=a(y))&&(s==="field"?o.unshift(h):f[c]=h)}u&&Object.defineProperty(u,i.name,f),p=!0}function omt(e,t,n){for(var i=arguments.length>2,o=0;o<t.length;o++)n=i?t[o].call(e,n):t[o].call(e);return i?n:void 0}function rmt(e){return typeof e=="symbol"?e:"".concat(e)}function amt(e,t,n){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function Fbe(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function Qbe(e,t,n,i){function o(r){return r instanceof n?r:new n(function(a){a(r)})}return new(n||(n=Promise))(function(r,a){function s(f){try{u(i.next(f))}catch(h){a(h)}}function c(f){try{u(i.throw(f))}catch(h){a(h)}}function u(f){f.done?r(f.value):o(f.value).then(s,c)}u((i=i.apply(e,t||[])).next())})}function kbe(e,t){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,o,r,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(f){return c([u,f])}}function c(u){if(i)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(n=0)),n;)try{if(i=1,o&&(r=u[0]&2?o.return:u[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,u[1])).done)return r;switch(o=0,r&&(u=[u[0]&2,r.value]),u[0]){case 0:case 1:r=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,o=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(r=n.trys,!(r=r.length>0&&r[r.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!r||u[1]>r[0]&&u[1]<r[3])){n.label=u[1];break}if(u[0]===6&&n.label<r[1]){n.label=r[1],r=u;break}if(r&&n.label<r[2]){n.label=r[2],n.ops.push(u);break}r[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(f){u=[6,f],o=0}finally{i=r=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Ube(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&G4(t,e,n)}function z4(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function BZ(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var i=n.call(e),o,r=[],a;try{for(;(t===void 0||t-- >0)&&!(o=i.next()).done;)r.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return r}function zbe(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(BZ(arguments[t]));return e}function Gbe(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var i=Array(e),o=0,t=0;t<n;t++)for(var r=arguments[t],a=0,s=r.length;a<s;a++,o++)i[o]=r[a];return i}function Vbe(e,t,n){if(n||arguments.length===2)for(var i=0,o=t.length,r;i<o;i++)(r||!(i in t))&&(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function Pw(e){return this instanceof Pw?(this.v=e,this):new Pw(e)}function Hbe(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n.apply(e,t||[]),o,r=[];return o={},s("next"),s("throw"),s("return",a),o[Symbol.asyncIterator]=function(){return this},o;function a(A){return function(m){return Promise.resolve(m).then(A,h)}}function s(A,m){i[A]&&(o[A]=function(_){return new Promise(function(y,C){r.push([A,_,y,C])>1||c(A,_)})},m&&(o[A]=m(o[A])))}function c(A,m){try{u(i[A](m))}catch(_){p(r[0][3],_)}}function u(A){A.value instanceof Pw?Promise.resolve(A.value.v).then(f,h):p(r[0][2],A)}function f(A){c("next",A)}function h(A){c("throw",A)}function p(A,m){A(m),r.shift(),r.length&&c(r[0][0],r[0][1])}}function Wbe(e){var t,n;return t={},i("next"),i("throw",function(o){throw o}),i("return"),t[Symbol.iterator]=function(){return this},t;function i(o,r){t[o]=e[o]?function(a){return(n=!n)?{value:Pw(e[o](a)),done:!1}:r?r(a):a}:r}}function jbe(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof z4=="function"?z4(e):e[Symbol.iterator](),n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n);function i(r){n[r]=e[r]&&function(a){return new Promise(function(s,c){a=e[r](a),o(s,c,a.done,a.value)})}}function o(r,a,s,c){Promise.resolve(c).then(function(u){r({value:u,done:s})},a)}}function Ybe(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function qbe(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&G4(t,e,n);return smt(t,e),t}function Kbe(e){return e&&e.__esModule?e:{default:e}}function Xbe(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)}function Jbe(e,t,n,i,o){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?o.call(e,n):o?o.value=n:t.set(e,n),n}function Zbe(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function $be(e,t,n){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var i,o;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=t[Symbol.asyncDispose]}if(i===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=t[Symbol.dispose],n&&(o=i)}if(typeof i!="function")throw new TypeError("Object not disposable.");o&&(i=function(){try{o.call(this)}catch(r){return Promise.reject(r)}}),e.stack.push({value:t,dispose:i,async:n})}else n&&e.stack.push({async:!0});return t}function eIe(e){function t(i){e.error=e.hasError?new cmt(i,e.error,"An error was suppressed during disposal."):i,e.hasError=!0}function n(){for(;e.stack.length;){var i=e.stack.pop();try{var o=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(o).then(n,function(r){return t(r),n()})}catch(r){t(r)}}if(e.hasError)throw e.error}return n()}var wZ,U4,G4,smt,cmt,lmt,Xp=cPe(()=>{wZ=function(e,t){return wZ=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])},wZ(e,t)};U4=function(){return U4=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},U4.apply(this,arguments)};G4=Object.create?(function(e,t,n,i){i===void 0&&(i=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,o)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]});smt=Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t};cmt=typeof SuppressedError=="function"?SuppressedError:function(e,t,n){var i=new Error(n);return i.name="SuppressedError",i.error=e,i.suppressed=t,i};lmt={__extends:Mbe,__assign:U4,__rest:Nbe,__decorate:Lbe,__param:Obe,__metadata:Fbe,__awaiter:Qbe,__generator:kbe,__createBinding:G4,__exportStar:Ube,__values:z4,__read:BZ,__spread:zbe,__spreadArrays:Gbe,__spreadArray:Vbe,__await:Pw,__asyncGenerator:Hbe,__asyncDelegator:Wbe,__asyncValues:jbe,__makeTemplateObject:Ybe,__importStar:qbe,__importDefault:Kbe,__classPrivateFieldGet:Xbe,__classPrivateFieldSet:Jbe,__classPrivateFieldIn:Zbe,__addDisposableResource:$be,__disposeResources:eIe}});var Jb=ki(V4=>{"use strict";Object.defineProperty(V4,"__esModule",{value:!0});V4.AbstractMatch=void 0;var umt=(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})();V4.AbstractMatch=umt});var tIe=ki(Zb=>{"use strict";Object.defineProperty(Zb,"__esModule",{value:!0});Zb.tldRegex=Zb.tldRegexStr=void 0;Zb.tldRegexStr="(?: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)";Zb.tldRegex=new RegExp("^"+Zb.tldRegexStr+"$")});var H4=ki(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.isValidIpV4Address=Kn.isValidTldMatch=Kn.isValidSchemeUrl=Kn.isKnownTld=Kn.isUrlSuffixStartChar=Kn.isPathChar=Kn.isDomainLabelChar=Kn.isDomainLabelStartChar=Kn.isSchemeChar=Kn.isSchemeStartChar=Kn.tldUrlHostRe=Kn.schemeUrlRe=Kn.invalidSchemeRe=Kn.urlSuffixedCharsNotAllowedAtEndRe=Kn.httpSchemePrefixRe=Kn.httpSchemeRe=Kn.urlSuffixNotAllowedAsLastCharRe=Kn.urlSuffixAllowedSpecialCharsRe=Kn.urlSuffixStartCharsRe=Kn.domainNameCharRegex=void 0;var $b=Xb(),fmt=tIe();Kn.domainNameCharRegex=$b.alphaNumericAndMarksRe;Kn.urlSuffixStartCharsRe=/[\/?#]/;Kn.urlSuffixAllowedSpecialCharsRe=/[-+&@#/%=~_()|'$*\[\]{}\u2713]/;Kn.urlSuffixNotAllowedAsLastCharRe=/[?!:,.;^]/;Kn.httpSchemeRe=/https?:\/\//i;Kn.httpSchemePrefixRe=new RegExp("^"+Kn.httpSchemeRe.source,"i");Kn.urlSuffixedCharsNotAllowedAtEndRe=new RegExp(Kn.urlSuffixNotAllowedAsLastCharRe.source+"$");Kn.invalidSchemeRe=/^(javascript|vbscript):/i;Kn.schemeUrlRe=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/;Kn.tldUrlHostRe=/^(?:\/\/)?([^/#?:]+)/;function dmt(e){return $b.letterRe.test(e)}Kn.isSchemeStartChar=dmt;function hmt(e){return $b.letterRe.test(e)||$b.digitRe.test(e)||e==="+"||e==="-"||e==="."}Kn.isSchemeChar=hmt;function nIe(e){return $b.alphaNumericAndMarksRe.test(e)}Kn.isDomainLabelStartChar=nIe;function mmt(e){return e==="_"||nIe(e)}Kn.isDomainLabelChar=mmt;function pmt(e){return $b.alphaNumericAndMarksRe.test(e)||Kn.urlSuffixAllowedSpecialCharsRe.test(e)||Kn.urlSuffixNotAllowedAsLastCharRe.test(e)}Kn.isPathChar=pmt;function Amt(e){return Kn.urlSuffixStartCharsRe.test(e)}Kn.isUrlSuffixStartChar=Amt;function iIe(e){return fmt.tldRegex.test(e.toLowerCase())}Kn.isKnownTld=iIe;function gmt(e){if(Kn.invalidSchemeRe.test(e))return!1;var t=e.match(Kn.schemeUrlRe);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!$b.letterRe.test(i))}Kn.isValidSchemeUrl=gmt;function _mt(e){var t=e.match(Kn.tldUrlHostRe);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var o=i[i.length-1];return!!iIe(o)}Kn.isValidTldMatch=_mt;var ymt=/^(?:(?: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]?)$/,Cmt=/[:/?#]/;function Emt(e){var t=e.split(Cmt,1)[0];return ymt.test(t)}Kn.isValidIpV4Address=Emt});var DZ=ki(W4=>{"use strict";Object.defineProperty(W4,"__esModule",{value:!0});W4.UrlMatch=void 0;var bmt=(Xp(),Jm(Kp)),Imt=Jb(),xmt=H4(),Tmt=/^(https?:\/\/)?(www\.)?/i,Smt=/^\/\//,wmt=(function(e){(0,bmt.__extends)(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=vmt(n)),this.stripPrefix.scheme&&(n=Bmt(n)),this.stripPrefix.www&&(n=Dmt(n)),this.stripTrailingSlash&&(n=Pmt(n)),this.decodePercentEncoding&&(n=Rmt(n)),n},t})(Imt.AbstractMatch);W4.UrlMatch=wmt;function Bmt(e){return e.replace(xmt.httpSchemePrefixRe,"")}function Dmt(e){return e.replace(Tmt,"$1")}function vmt(e){return e.replace(Smt,"")}function Pmt(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function Rmt(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 rIe=ki(Jp=>{"use strict";Object.defineProperty(Jp,"__esModule",{value:!0});Jp.isValidEmail=Jp.isEmailLocalPartChar=Jp.isEmailLocalPartStartChar=Jp.mailtoSchemePrefixRe=void 0;var oIe=Xb(),Mmt=H4();Jp.mailtoSchemePrefixRe=/^mailto:/i;var Nmt=new RegExp("[".concat(oIe.alphaNumericAndMarksCharsStr,"!#$%&'*+/=?^_`{|}~-]"));function Lmt(e){return oIe.alphaNumericAndMarksRe.test(e)}Jp.isEmailLocalPartStartChar=Lmt;function Omt(e){return Nmt.test(e)}Jp.isEmailLocalPartChar=Omt;function Fmt(e){var t=e.split(".").pop()||"";return(0,Mmt.isKnownTld)(t)}Jp.isValidEmail=Fmt});var vZ=ki(j4=>{"use strict";Object.defineProperty(j4,"__esModule",{value:!0});j4.EmailMatch=void 0;var Qmt=(Xp(),Jm(Kp)),kmt=Jb(),Umt=(function(e){(0,Qmt.__extends)(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})(kmt.AbstractMatch);j4.EmailMatch=Umt});var PZ=ki(vC=>{"use strict";Object.defineProperty(vC,"__esModule",{value:!0});vC.hashtagServices=vC.isValidHashtag=vC.isHashtagTextChar=void 0;var zmt=Xb();function Gmt(e){return e==="_"||zmt.alphaNumericAndMarksRe.test(e)}vC.isHashtagTextChar=Gmt;function Vmt(e){return e.length<=140}vC.isValidHashtag=Vmt;vC.hashtagServices=["twitter","facebook","instagram","tiktok"]});var RZ=ki(Y4=>{"use strict";Object.defineProperty(Y4,"__esModule",{value:!0});Y4.HashtagMatch=void 0;var Hmt=(Xp(),Jm(Kp)),Wmt=vw(),jmt=Jb(),Ymt=(function(e){(0,Hmt.__extends)(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(0,Wmt.assertNever)(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})(jmt.AbstractMatch);Y4.HashtagMatch=Ymt});var MZ=ki(PC=>{"use strict";Object.defineProperty(PC,"__esModule",{value:!0});PC.mentionServices=PC.isValidMention=PC.isMentionTextChar=void 0;var qmt={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/},Kmt=/[-\w.]/;function Xmt(e){return Kmt.test(e)}PC.isMentionTextChar=Xmt;function Jmt(e,t){var n=qmt[t];return n.test(e)}PC.isValidMention=Jmt;PC.mentionServices=["twitter","instagram","soundcloud","tiktok"]});var NZ=ki(q4=>{"use strict";Object.defineProperty(q4,"__esModule",{value:!0});q4.MentionMatch=void 0;var Zmt=(Xp(),Jm(Kp)),$mt=Jb(),ept=(function(e){(0,Zmt.__extends)(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})($mt.AbstractMatch);q4.MentionMatch=ept});var aIe=ki(RC=>{"use strict";Object.defineProperty(RC,"__esModule",{value:!0});RC.isValidPhoneNumber=RC.isPhoneNumberControlChar=RC.isPhoneNumberSeparatorChar=void 0;var tpt=/[-. ]/,npt=/[-. ()]/,ipt=/[,;]/,opt=/(?:(?:(?:(\+)?\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]+#?)*/,rpt=/(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})/,apt=new RegExp("^".concat(opt.source,"|").concat(rpt.source,"$"));function spt(e){return tpt.test(e)}RC.isPhoneNumberSeparatorChar=spt;function cpt(e){return ipt.test(e)}RC.isPhoneNumberControlChar=cpt;function lpt(e){var t=e.charAt(0)==="+"||npt.test(e);return t&&apt.test(e)}RC.isValidPhoneNumber=lpt});var LZ=ki(K4=>{"use strict";Object.defineProperty(K4,"__esModule",{value:!0});K4.PhoneMatch=void 0;var upt=(Xp(),Jm(Kp)),fpt=Jb(),dpt=(function(e){(0,upt.__extends)(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})(fpt.AbstractMatch);K4.PhoneMatch=dpt});var zZ=ki(Nw=>{"use strict";Object.defineProperty(Nw,"__esModule",{value:!0});Nw.excludeUnbalancedTrailingBracesAndPunctuation=Nw.parseMatches=void 0;var Nc=Xb(),hpt=DZ(),tr=vw(),Gr=H4(),Rw=rIe(),mpt=vZ(),OZ=PZ(),ppt=RZ(),FZ=MZ(),Apt=NZ(),Mw=aIe(),gpt=LZ();function _pt(e,t){for(var n=t.tagBuilder,i=t.stripPrefix,o=t.stripTrailingSlash,r=t.decodePercentEncoding,a=t.hashtagServiceName,s=t.mentionServiceName,c=[],u=e.length,f=[],h=0;h<u;h++){var p=e.charAt(h);if(f.length===0)y(p);else for(var A=f.length-1;A>=0;A--){var m=f[A];switch(m.state){case 11:B(m,p);break;case 12:v(m,p);break;case 0:C(m,p);break;case 1:E(m,p);break;case 2:b(m,p);break;case 3:x(m,p);break;case 4:S(m,p);break;case 5:P(m,p);break;case 6:N(m,p);break;case 7:L(m,p);break;case 13:g(m,p);break;case 14:I(m,p);break;case 8:T(m,p);break;case 9:w(m,p);break;case 10:R(m,p);break;case 15:O(m,p);break;case 16:G(m,p);break;case 17:F(m,p);break;case 18:U(m,p);break;case 19:Q(m,p);break;case 20:H(m,p);break;case 21:Y(m,p);break;case 22:$(m,p);break;case 23:W(m,p);break;case 24:K(m,p);break;case 25:Z(m,p);break;case 26:pe(m,p);break;case 27:ge(m,p);break;case 28:re(m,p);break;case 29:ye(m,p);break;case 30:Ce(m,p);break;case 31:Pe(m,p);break;case 32:Le(m,p);break;case 33:Oe(m,p);break;case 34:ot(m,p);break;case 35:Fe(m,p);break;case 36:_t(m,p);break;case 37:Ne(m,p);break;case 38:rt(m,p);break;case 39:Ye(m,p);break;case 40:st(m,p);break;case 41:ft(m,p);break;default:(0,tr.assertNever)(m.state)}}}for(var _=f.length-1;_>=0;_--)f.forEach(function(Ie){return St(Ie)});return c;function y(Ie){if(Ie==="#")f.push(bpt(h,28));else if(Ie==="@")f.push(Ipt(h,30));else if(Ie==="/")f.push(kZ(h,11));else if(Ie==="+")f.push(UZ(h,37));else if(Ie==="(")f.push(UZ(h,32));else{if(Nc.digitRe.test(Ie)&&(f.push(UZ(h,38)),f.push(Cpt(h,13))),(0,Rw.isEmailLocalPartStartChar)(Ie)){var Se=Ie.toLowerCase()==="m"?15:22;f.push(Ept(h,Se))}(0,Gr.isSchemeStartChar)(Ie)&&f.push(QZ(h,0)),Nc.alphaNumericAndMarksRe.test(Ie)&&f.push(kZ(h,5))}}function C(Ie,Se){Se===":"?Ie.state=2:Se==="-"?Ie.state=1:(0,Gr.isSchemeChar)(Se)||(0,tr.remove)(f,Ie)}function E(Ie,Se){Se==="-"||(Se==="/"?((0,tr.remove)(f,Ie),f.push(kZ(h,11))):(0,Gr.isSchemeChar)(Se)?Ie.state=0:(0,tr.remove)(f,Ie))}function b(Ie,Se){Se==="/"?Ie.state=3:Se==="."?(0,tr.remove)(f,Ie):(0,Gr.isDomainLabelStartChar)(Se)?(Ie.state=5,(0,Gr.isSchemeStartChar)(Se)&&f.push(QZ(h,0))):(0,tr.remove)(f,Ie)}function x(Ie,Se){Se==="/"?Ie.state=4:(0,Gr.isPathChar)(Se)?(Ie.state=10,Ie.acceptStateReached=!0):St(Ie)}function S(Ie,Se){Se==="/"?Ie.state=10:(0,Gr.isDomainLabelStartChar)(Se)?(Ie.state=5,Ie.acceptStateReached=!0):(0,tr.remove)(f,Ie)}function B(Ie,Se){Se==="/"?Ie.state=12:(0,tr.remove)(f,Ie)}function v(Ie,Se){(0,Gr.isDomainLabelStartChar)(Se)?Ie.state=5:(0,tr.remove)(f,Ie)}function P(Ie,Se){Se==="."?Ie.state=7:Se==="-"?Ie.state=6:Se===":"?Ie.state=8:(0,Gr.isUrlSuffixStartChar)(Se)?Ie.state=10:(0,Gr.isDomainLabelChar)(Se)||St(Ie)}function N(Ie,Se){Se==="-"||(Se==="."?St(Ie):(0,Gr.isDomainLabelStartChar)(Se)?Ie.state=5:St(Ie))}function L(Ie,Se){Se==="."?St(Ie):(0,Gr.isDomainLabelStartChar)(Se)?(Ie.state=5,Ie.acceptStateReached=!0):St(Ie)}function g(Ie,Se){Se==="."?Ie.state=14:Se===":"?Ie.state=8:Nc.digitRe.test(Se)||((0,Gr.isUrlSuffixStartChar)(Se)?Ie.state=10:Nc.alphaNumericAndMarksRe.test(Se)?(0,tr.remove)(f,Ie):St(Ie))}function I(Ie,Se){Nc.digitRe.test(Se)?(Ie.octetsEncountered++,Ie.octetsEncountered===4&&(Ie.acceptStateReached=!0),Ie.state=13):St(Ie)}function T(Ie,Se){Nc.digitRe.test(Se)?Ie.state=9:St(Ie)}function w(Ie,Se){Nc.digitRe.test(Se)||((0,Gr.isUrlSuffixStartChar)(Se)?Ie.state=10:St(Ie))}function R(Ie,Se){(0,Gr.isPathChar)(Se)||St(Ie)}function O(Ie,Se){Se.toLowerCase()==="a"?Ie.state=16:$(Ie,Se)}function G(Ie,Se){Se.toLowerCase()==="i"?Ie.state=17:$(Ie,Se)}function F(Ie,Se){Se.toLowerCase()==="l"?Ie.state=18:$(Ie,Se)}function U(Ie,Se){Se.toLowerCase()==="t"?Ie.state=19:$(Ie,Se)}function Q(Ie,Se){Se.toLowerCase()==="o"?Ie.state=20:$(Ie,Se)}function H(Ie,Se){Se.toLowerCase()===":"?Ie.state=21:$(Ie,Se)}function Y(Ie,Se){(0,Rw.isEmailLocalPartChar)(Se)?Ie.state=22:(0,tr.remove)(f,Ie)}function $(Ie,Se){Se==="."?Ie.state=23:Se==="@"?Ie.state=24:(0,Rw.isEmailLocalPartChar)(Se)?Ie.state=22:(0,tr.remove)(f,Ie)}function W(Ie,Se){Se==="."||Se==="@"?(0,tr.remove)(f,Ie):(0,Rw.isEmailLocalPartChar)(Se)?Ie.state=22:(0,tr.remove)(f,Ie)}function K(Ie,Se){(0,Gr.isDomainLabelStartChar)(Se)?Ie.state=25:(0,tr.remove)(f,Ie)}function Z(Ie,Se){Se==="."?Ie.state=27:Se==="-"?Ie.state=26:(0,Gr.isDomainLabelChar)(Se)||St(Ie)}function pe(Ie,Se){Se==="-"||Se==="."?St(Ie):(0,Gr.isDomainLabelChar)(Se)?Ie.state=25:St(Ie)}function ge(Ie,Se){Se==="."||Se==="-"?St(Ie):(0,Gr.isDomainLabelStartChar)(Se)?(Ie.state=25,Ie.acceptStateReached=!0):St(Ie)}function re(Ie,Se){(0,OZ.isHashtagTextChar)(Se)?(Ie.state=29,Ie.acceptStateReached=!0):(0,tr.remove)(f,Ie)}function ye(Ie,Se){(0,OZ.isHashtagTextChar)(Se)||St(Ie)}function Ce(Ie,Se){(0,FZ.isMentionTextChar)(Se)?(Ie.state=31,Ie.acceptStateReached=!0):(0,tr.remove)(f,Ie)}function Pe(Ie,Se){(0,FZ.isMentionTextChar)(Se)||(Nc.alphaNumericAndMarksRe.test(Se)?(0,tr.remove)(f,Ie):St(Ie))}function Ne(Ie,Se){Nc.digitRe.test(Se)?Ie.state=38:((0,tr.remove)(f,Ie),y(Se))}function Le(Ie,Se){Nc.digitRe.test(Se)?Ie.state=33:(0,tr.remove)(f,Ie),y(Se)}function Oe(Ie,Se){Nc.digitRe.test(Se)?Ie.state=34:(0,tr.remove)(f,Ie)}function ot(Ie,Se){Nc.digitRe.test(Se)?Ie.state=35:(0,tr.remove)(f,Ie)}function Fe(Ie,Se){Se===")"?Ie.state=36:(0,tr.remove)(f,Ie)}function _t(Ie,Se){Nc.digitRe.test(Se)?Ie.state=38:(0,Mw.isPhoneNumberSeparatorChar)(Se)?Ie.state=39:(0,tr.remove)(f,Ie)}function rt(Ie,Se){Ie.acceptStateReached=!0,(0,Mw.isPhoneNumberControlChar)(Se)?Ie.state=40:Se==="#"?Ie.state=41:Nc.digitRe.test(Se)||(Se==="("?Ie.state=32:(0,Mw.isPhoneNumberSeparatorChar)(Se)?Ie.state=39:(St(Ie),(0,Gr.isSchemeStartChar)(Se)&&f.push(QZ(h,0))))}function Ye(Ie,Se){Nc.digitRe.test(Se)?Ie.state=38:Se==="("?Ie.state=32:(St(Ie),y(Se))}function st(Ie,Se){(0,Mw.isPhoneNumberControlChar)(Se)||(Se==="#"?Ie.state=41:Nc.digitRe.test(Se)?Ie.state=38:St(Ie))}function ft(Ie,Se){(0,Mw.isPhoneNumberControlChar)(Se)?Ie.state=40:Nc.digitRe.test(Se)?(0,tr.remove)(f,Ie):St(Ie)}function St(Ie){if((0,tr.remove)(f,Ie),!!Ie.acceptStateReached){var Se=Ie.startIdx,Kt=e.slice(Ie.startIdx,h);if(Kt=lIe(Kt),Ie.type==="url"){var mt=e.charAt(Ie.startIdx-1);if(mt==="@")return;var Gt=Ie.matchType;if(Gt==="scheme"){var Hn=Gr.httpSchemeRe.exec(Kt);if(Hn&&(Se=Se+Hn.index,Kt=Kt.slice(Hn.index)),!(0,Gr.isValidSchemeUrl)(Kt))return}else if(Gt==="tld"){if(!(0,Gr.isValidTldMatch)(Kt))return}else if(Gt==="ipV4"){if(!(0,Gr.isValidIpV4Address)(Kt))return}else(0,tr.assertNever)(Gt);c.push(new hpt.UrlMatch({tagBuilder:n,matchedText:Kt,offset:Se,urlMatchType:Gt,url:Kt,protocolRelativeMatch:Kt.slice(0,2)==="//",stripPrefix:i,stripTrailingSlash:o,decodePercentEncoding:r}))}else if(Ie.type==="email")(0,Rw.isValidEmail)(Kt)&&c.push(new mpt.EmailMatch({tagBuilder:n,matchedText:Kt,offset:Se,email:Kt.replace(Rw.mailtoSchemePrefixRe,"")}));else if(Ie.type==="hashtag")(0,OZ.isValidHashtag)(Kt)&&c.push(new ppt.HashtagMatch({tagBuilder:n,matchedText:Kt,offset:Se,serviceName:a,hashtag:Kt.slice(1)}));else if(Ie.type==="mention")(0,FZ.isValidMention)(Kt,s)&&c.push(new Apt.MentionMatch({tagBuilder:n,matchedText:Kt,offset:Se,serviceName:s,mention:Kt.slice(1)}));else if(Ie.type==="phone"){if(Kt=Kt.replace(/ +$/g,""),(0,Mw.isValidPhoneNumber)(Kt)){var Je=Kt.replace(/[^0-9,;#]/g,"");c.push(new gpt.PhoneMatch({tagBuilder:n,matchedText:Kt,offset:Se,number:Je,plusSign:Kt.charAt(0)==="+"}))}}else(0,tr.assertNever)(Ie)}}}Nw.parseMatches=_pt;var ypt=/[\(\{\[]/,sIe=/[\)\}\]]/,cIe={")":"(","}":"{","]":"["};function lIe(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n);ypt.test(i)?t[i]++:sIe.test(i)&&t[cIe[i]]--}for(var o=e.length-1,r;o>=0;)if(r=e.charAt(o),sIe.test(r)){var a=cIe[r];if(t[a]<0)t[a]++,o--;else break}else if(Gr.urlSuffixedCharsNotAllowedAtEndRe.test(r))o--;else break;return e.slice(0,o+1)}Nw.excludeUnbalancedTrailingBracesAndPunctuation=lIe;function QZ(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"scheme"}}function kZ(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"tld"}}function Cpt(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"ipV4",octetsEncountered:1}}function Ept(e,t){return{type:"email",startIdx:e,state:t,acceptStateReached:!1}}function bpt(e,t){return{type:"hashtag",startIdx:e,state:t,acceptStateReached:!1}}function Ipt(e,t){return{type:"mention",startIdx:e,state:t,acceptStateReached:!1}}function UZ(e,t){return{type:"phone",startIdx:e,state:t,acceptStateReached:!1}}});var uIe=ki(X4=>{"use strict";Object.defineProperty(X4,"__esModule",{value:!0});X4.parseHtml=void 0;var dl=(Xp(),Jm(Kp)),cu=Xb(),xpt=vw();function Tpt(e,t){for(var n=t.onOpenTag,i=t.onCloseTag,o=t.onText,r=t.onComment,a=t.onDoctype,s=new Zp,c=0,u=e.length,f=0,h=0,p=s;c<u;){var A=e.charAt(c);switch(f){case 0:m(A);break;case 1:_(A);break;case 2:C(A);break;case 3:y(A);break;case 4:E(A);break;case 5:b(A);break;case 6:x(A);break;case 7:S(A);break;case 8:B(A);break;case 9:v(A);break;case 10:P(A);break;case 11:N(A);break;case 12:L(A);break;case 13:g(A);break;case 14:I(A);break;case 15:T(A);break;case 16:w(A);break;case 17:R(A);break;case 18:O(A);break;case 19:G(A);break;case 20:F(A);break;default:(0,xpt.assertNever)(f)}c++}h<c&&Y();function m(K){K==="<"&&Q()}function _(K){K==="!"?f=13:K==="/"?(f=2,p=new Zp((0,dl.__assign)((0,dl.__assign)({},p),{isClosing:!0}))):K==="<"?Q():cu.letterRe.test(K)?(f=3,p=new Zp((0,dl.__assign)((0,dl.__assign)({},p),{isOpening:!0}))):(f=0,p=s)}function y(K){cu.whitespaceRe.test(K)?(p=new Zp((0,dl.__assign)((0,dl.__assign)({},p),{name:$()})),f=4):K==="<"?Q():K==="/"?(p=new Zp((0,dl.__assign)((0,dl.__assign)({},p),{name:$()})),f=12):K===">"?(p=new Zp((0,dl.__assign)((0,dl.__assign)({},p),{name:$()})),H()):!cu.letterRe.test(K)&&!cu.digitRe.test(K)&&K!==":"&&U()}function C(K){K===">"?U():cu.letterRe.test(K)?f=3:U()}function E(K){cu.whitespaceRe.test(K)||(K==="/"?f=12:K===">"?H():K==="<"?Q():K==="="||cu.quoteRe.test(K)||cu.controlCharsRe.test(K)?U():f=5)}function b(K){cu.whitespaceRe.test(K)?f=6:K==="/"?f=12:K==="="?f=7:K===">"?H():K==="<"?Q():cu.quoteRe.test(K)&&U()}function x(K){cu.whitespaceRe.test(K)||(K==="/"?f=12:K==="="?f=7:K===">"?H():K==="<"?Q():cu.quoteRe.test(K)?U():f=5)}function S(K){cu.whitespaceRe.test(K)||(K==='"'?f=8:K==="'"?f=9:/[>=`]/.test(K)?U():K==="<"?Q():f=10)}function B(K){K==='"'&&(f=11)}function v(K){K==="'"&&(f=11)}function P(K){cu.whitespaceRe.test(K)?f=4:K===">"?H():K==="<"&&Q()}function N(K){cu.whitespaceRe.test(K)?f=4:K==="/"?f=12:K===">"?H():K==="<"?Q():(f=4,W())}function L(K){K===">"?(p=new Zp((0,dl.__assign)((0,dl.__assign)({},p),{isClosing:!0})),H()):f=4}function g(K){e.substr(c,2)==="--"?(c+=2,p=new Zp((0,dl.__assign)((0,dl.__assign)({},p),{type:"comment"})),f=14):e.substr(c,7).toUpperCase()==="DOCTYPE"?(c+=7,p=new Zp((0,dl.__assign)((0,dl.__assign)({},p),{type:"doctype"})),f=20):U()}function I(K){K==="-"?f=15:K===">"?U():f=16}function T(K){K==="-"?f=18:K===">"?U():f=16}function w(K){K==="-"&&(f=17)}function R(K){K==="-"?f=18:f=16}function O(K){K===">"?H():K==="!"?f=19:K==="-"||(f=16)}function G(K){K==="-"?f=17:K===">"?H():f=16}function F(K){K===">"?H():K==="<"&&Q()}function U(){f=0,p=s}function Q(){f=1,p=new Zp({idx:c})}function H(){var K=e.slice(h,p.idx);K&&o(K,h),p.type==="comment"?r(p.idx):p.type==="doctype"?a(p.idx):(p.isOpening&&n(p.name,p.idx),p.isClosing&&i(p.name,p.idx)),U(),h=c+1}function Y(){var K=e.slice(h,c);o(K,h),h=c+1}function $(){var K=p.idx+(p.isClosing?2:1);return e.slice(K,c).toLowerCase()}function W(){c--}}X4.parseHtml=Tpt;var Zp=(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 J4=ki(GZ=>{"use strict";Object.defineProperty(GZ,"__esModule",{value:!0});var Spt=Bbe(),Es=vw(),wpt=SZ(),Bpt=L4(),Dpt=zZ(),vpt=uIe(),Ppt=MZ(),Rpt=PZ(),Mpt=(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=Npt(t.urls),this.email=(0,Es.isBoolean)(t.email)?t.email:this.email,this.phone=(0,Es.isBoolean)(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=(0,Es.isBoolean)(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=Lpt(t.stripPrefix),this.stripTrailingSlash=(0,Es.isBoolean)(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=(0,Es.isBoolean)(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&Ppt.mentionServices.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&Rpt.hashtagServices.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=Opt(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(0,vpt.parseHtml)(t,{onOpenTag:function(a){i.indexOf(a)>=0&&o++},onText:function(a,s){if(o===0){var c=/(&nbsp;|&#160;|&lt;|&#60;|&gt;|&#62;|&quot;|&#34;|&#39;)/gi,u=a.split(c),f=s;u.forEach(function(h,p){if(p%2===0){var A=n.parseText(h,f);r.push.apply(r,A)}f+=h.length})}},onCloseTag:function(a){i.indexOf(a)>=0&&(o=Math.max(o-1,0))},onComment:function(a){},onDoctype:function(a){}}),r=this.compactMatches(r),r=this.removeUnwantedMatches(r),r},e.prototype.compactMatches=function(t){t.sort(function(c,u){return c.getOffset()-u.getOffset()});for(var n=0;n<t.length-1;){var i=t[n],o=i.getOffset(),r=i.getMatchedText().length,a=o+r;if(n+1<t.length){if(t[n+1].getOffset()===o){var s=t[n+1].getMatchedText().length>r?n:n+1;t.splice(s,1);continue}if(t[n+1].getOffset()<a){t.splice(n+1,1);continue}}n++}return t},e.prototype.removeUnwantedMatches=function(t){return this.hashtag||(0,Es.removeWithPredicate)(t,function(n){return n.getType()==="hashtag"}),this.email||(0,Es.removeWithPredicate)(t,function(n){return n.getType()==="email"}),this.phone||(0,Es.removeWithPredicate)(t,function(n){return n.getType()==="phone"}),this.mention||(0,Es.removeWithPredicate)(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||(0,Es.removeWithPredicate)(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||(0,Es.removeWithPredicate)(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||(0,Es.removeWithPredicate)(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=(0,Dpt.parseMatches)(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,a=n.length;r<a;r++){var s=n[r];i.push(t.substring(o,s.getOffset())),i.push(this.createMatchReturnVal(s)),o=s.getOffset()+s.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 Bpt.HtmlTag)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new wpt.AnchorTagBuilder({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=Spt.version,e})();GZ.default=Mpt;function Npt(e){return e==null&&(e=!0),(0,Es.isBoolean)(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:(0,Es.isBoolean)(e.schemeMatches)?e.schemeMatches:!0,tldMatches:(0,Es.isBoolean)(e.tldMatches)?e.tldMatches:!0,ipV4Matches:(0,Es.isBoolean)(e.ipV4Matches)?e.ipV4Matches:!0}}function Lpt(e){return e==null&&(e=!0),(0,Es.isBoolean)(e)?{scheme:e,www:e}:{scheme:(0,Es.isBoolean)(e.scheme)?e.scheme:!0,www:(0,Es.isBoolean)(e.www)?e.www:!0}}function Opt(e){return typeof e=="number"?{length:e,location:"end"}:(0,Es.defaults)(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})}});var dIe=ki(fIe=>{"use strict";Object.defineProperty(fIe,"__esModule",{value:!0})});var hIe=ki(__=>{"use strict";Object.defineProperty(__,"__esModule",{value:!0});var eI=(Xp(),Jm(Kp));(0,eI.__exportStar)(dIe(),__);(0,eI.__exportStar)(vZ(),__);(0,eI.__exportStar)(RZ(),__);(0,eI.__exportStar)(Jb(),__);(0,eI.__exportStar)(NZ(),__);(0,eI.__exportStar)(LZ(),__);(0,eI.__exportStar)(DZ(),__)});var mIe=ki(VZ=>{"use strict";Object.defineProperty(VZ,"__esModule",{value:!0});var Fpt=(Xp(),Jm(Kp));(0,Fpt.__exportStar)(zZ(),VZ)});var HZ=ki((Rm,AIe)=>{"use strict";Rm=AIe.exports=J4().default;Object.defineProperty(Rm,"__esModule",{value:!0});Rm.Autolinker=void 0;var Lw=(Xp(),Jm(Kp)),pIe=(0,Lw.__importDefault)(J4());Rm.Autolinker=pIe.default;Rm.default=pIe.default;(0,Lw.__exportStar)(J4(),Rm);(0,Lw.__exportStar)(SZ(),Rm);(0,Lw.__exportStar)(L4(),Rm);(0,Lw.__exportStar)(hIe(),Rm);(0,Lw.__exportStar)(mIe(),Rm)});var Y$=ki((exports,module)=>{/*!
* protobuf.js v8.0.1 (c) 2016, daniel wirtz
* compiled sat, 04 apr 2026 19:23:15 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(a){var s=n[a];return s||t[a][0].call(s=n[a]={exports:{}},o,s,s.exports),s.exports}var r=o(i[0]);r.util.global.protobuf=r,typeof define=="function"&&define.amd&&define(["long"],function(a){return a&&a.isLong&&(r.util.Long=a,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 a=new Array(arguments.length-1),s=0,c=2,u=!0;c<arguments.length;)a[s++]=arguments[c++];return new Promise(function(h,p){a[s]=function(m){if(u)if(u=!1,m)p(m);else{for(var _=new Array(arguments.length-1),y=0;y<_.length;)_[y++]=arguments[y];h.apply(null,_)}};try{o.apply(r||null,a)}catch(A){u&&(u=!1,p(A))}})}},{}],2:[function(e,t,n){"use strict";var i=n;i.length=function(u){var f=u.length;if(!f)return 0;for(var h=0;--f%4>1&&u.charAt(f)==="=";)++h;return Math.ceil(u.length*3)/4-h};for(var o=new Array(64),r=new Array(123),a=0;a<64;)r[o[a]=a<26?a+65:a<52?a+71:a<62?a-4:a-59|43]=a++;i.encode=function(u,f,h){for(var p=null,A=[],m=0,_=0,y;f<h;){var C=u[f++];switch(_){case 0:A[m++]=o[C>>2],y=(C&3)<<4,_=1;break;case 1:A[m++]=o[y|C>>4],y=(C&15)<<2,_=2;break;case 2:A[m++]=o[y|C>>6],A[m++]=o[C&63],_=0;break}m>8191&&((p||(p=[])).push(String.fromCharCode.apply(String,A)),m=0)}return _&&(A[m++]=o[y],A[m++]=61,_===1&&(A[m++]=61)),p?(m&&p.push(String.fromCharCode.apply(String,A.slice(0,m))),p.join("")):String.fromCharCode.apply(String,A.slice(0,m))};var s="invalid encoding";i.decode=function(u,f,h){for(var p=h,A=0,m,_=0;_<u.length;){var y=u.charCodeAt(_++);if(y===61&&A>1)break;if((y=r[y])===undefined)throw Error(s);switch(A){case 0:m=y,A=1;break;case 1:f[h++]=m<<2|(y&48)>>4,m=y,A=2;break;case 2:f[h++]=(m&15)<<4|(y&60)>>2,m=y,A=3;break;case 3:f[h++]=(m&3)<<6|y,A=0;break}}if(A===1)throw Error(s);return h-p},i.test=function(u){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(u)}},{}],3:[function(e,t,n){"use strict";t.exports=i;function i(){this._listeners={}}i.prototype.on=function(r,a,s){return(this._listeners[r]||(this._listeners[r]=[])).push({fn:a,ctx:s||this}),this},i.prototype.off=function(r,a){if(r===undefined)this._listeners={};else if(a===undefined)this._listeners[r]=[];else for(var s=this._listeners[r],c=0;c<s.length;)s[c].fn===a?s.splice(c,1):++c;return this},i.prototype.emit=function(r){var a=this._listeners[r];if(a){for(var s=[],c=1;c<arguments.length;)s.push(arguments[c++]);for(c=0;c<a.length;)a[c].fn.apply(a[c++].ctx,s)}return this}},{}],4:[function(e,t,n){"use strict";t.exports=i(i);function i(c){return typeof Float32Array<"u"?(function(){var u=new Float32Array([-0]),f=new Uint8Array(u.buffer),h=f[3]===128;function p(y,C,E){u[0]=y,C[E]=f[0],C[E+1]=f[1],C[E+2]=f[2],C[E+3]=f[3]}function A(y,C,E){u[0]=y,C[E]=f[3],C[E+1]=f[2],C[E+2]=f[1],C[E+3]=f[0]}c.writeFloatLE=h?p:A,c.writeFloatBE=h?A:p;function m(y,C){return f[0]=y[C],f[1]=y[C+1],f[2]=y[C+2],f[3]=y[C+3],u[0]}function _(y,C){return f[3]=y[C],f[2]=y[C+1],f[1]=y[C+2],f[0]=y[C+3],u[0]}c.readFloatLE=h?m:_,c.readFloatBE=h?_:m})():(function(){function u(h,p,A,m){var _=p<0?1:0;if(_&&(p=-p),p===0)h(1/p>0?0:2147483648,A,m);else if(isNaN(p))h(2143289344,A,m);else if(p>34028234663852886e22)h((_<<31|2139095040)>>>0,A,m);else if(p<11754943508222875e-54)h((_<<31|Math.round(p/1401298464324817e-60))>>>0,A,m);else{var y=Math.floor(Math.log(p)/Math.LN2),C=Math.round(p*Math.pow(2,-y)*8388608)&8388607;h((_<<31|y+127<<23|C)>>>0,A,m)}}c.writeFloatLE=u.bind(null,o),c.writeFloatBE=u.bind(null,r);function f(h,p,A){var m=h(p,A),_=(m>>31)*2+1,y=m>>>23&255,C=m&8388607;return y===255?C?NaN:_*(1/0):y===0?_*1401298464324817e-60*C:_*Math.pow(2,y-150)*(C+8388608)}c.readFloatLE=f.bind(null,a),c.readFloatBE=f.bind(null,s)})(),typeof Float64Array<"u"?(function(){var u=new Float64Array([-0]),f=new Uint8Array(u.buffer),h=f[7]===128;function p(y,C,E){u[0]=y,C[E]=f[0],C[E+1]=f[1],C[E+2]=f[2],C[E+3]=f[3],C[E+4]=f[4],C[E+5]=f[5],C[E+6]=f[6],C[E+7]=f[7]}function A(y,C,E){u[0]=y,C[E]=f[7],C[E+1]=f[6],C[E+2]=f[5],C[E+3]=f[4],C[E+4]=f[3],C[E+5]=f[2],C[E+6]=f[1],C[E+7]=f[0]}c.writeDoubleLE=h?p:A,c.writeDoubleBE=h?A:p;function m(y,C){return f[0]=y[C],f[1]=y[C+1],f[2]=y[C+2],f[3]=y[C+3],f[4]=y[C+4],f[5]=y[C+5],f[6]=y[C+6],f[7]=y[C+7],u[0]}function _(y,C){return f[7]=y[C],f[6]=y[C+1],f[5]=y[C+2],f[4]=y[C+3],f[3]=y[C+4],f[2]=y[C+5],f[1]=y[C+6],f[0]=y[C+7],u[0]}c.readDoubleLE=h?m:_,c.readDoubleBE=h?_:m})():(function(){function u(h,p,A,m,_,y){var C=m<0?1:0;if(C&&(m=-m),m===0)h(0,_,y+p),h(1/m>0?0:2147483648,_,y+A);else if(isNaN(m))h(0,_,y+p),h(2146959360,_,y+A);else if(m>17976931348623157e292)h(0,_,y+p),h((C<<31|2146435072)>>>0,_,y+A);else{var E;if(m<22250738585072014e-324)E=m/5e-324,h(E>>>0,_,y+p),h((C<<31|E/4294967296)>>>0,_,y+A);else{var b=Math.floor(Math.log(m)/Math.LN2);b===1024&&(b=1023),E=m*Math.pow(2,-b),h(E*4503599627370496>>>0,_,y+p),h((C<<31|b+1023<<20|E*1048576&1048575)>>>0,_,y+A)}}}c.writeDoubleLE=u.bind(null,o,0,4),c.writeDoubleBE=u.bind(null,r,4,0);function f(h,p,A,m,_){var y=h(m,_+p),C=h(m,_+A),E=(C>>31)*2+1,b=C>>>20&2047,x=4294967296*(C&1048575)+y;return b===2047?x?NaN:E*(1/0):b===0?E*5e-324*x:E*Math.pow(2,b-1075)*(x+4503599627370496)}c.readDoubleLE=f.bind(null,a,0,4),c.readDoubleBE=f.bind(null,s,4,0)})(),c}function o(c,u,f){u[f]=c&255,u[f+1]=c>>>8&255,u[f+2]=c>>>16&255,u[f+3]=c>>>24}function r(c,u,f){u[f]=c>>>24,u[f+1]=c>>>16&255,u[f+2]=c>>>8&255,u[f+3]=c&255}function a(c,u){return(c[u]|c[u+1]<<8|c[u+2]<<16|c[u+3]<<24)>>>0}function s(c,u){return(c[u]<<24|c[u+1]<<16|c[u+2]<<8|c[u+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,a){var s=a||8192,c=s>>>1,u=null,f=s;return function(p){if(p<1||p>c)return o(p);f+p>s&&(u=o(s),f=0);var A=r.call(u,f,f+=p);return f&7&&(f=(f|7)+1),A}}},{}],7:[function(e,t,n){"use strict";var i=n;i.length=function(r){for(var a=0,s=0,c=0;c<r.length;++c)s=r.charCodeAt(c),s<128?a+=1:s<2048?a+=2:(s&64512)===55296&&(r.charCodeAt(c+1)&64512)===56320?(++c,a+=4):a+=3;return a},i.read=function(r,a,s){var c=s-a;if(c<1)return"";for(var u=null,f=[],h=0,p;a<s;)p=r[a++],p<128?f[h++]=p:p>191&&p<224?f[h++]=(p&31)<<6|r[a++]&63:p>239&&p<365?(p=((p&7)<<18|(r[a++]&63)<<12|(r[a++]&63)<<6|r[a++]&63)-65536,f[h++]=55296+(p>>10),f[h++]=56320+(p&1023)):f[h++]=(p&15)<<12|(r[a++]&63)<<6|r[a++]&63,h>8191&&((u||(u=[])).push(String.fromCharCode.apply(String,f)),h=0);return u?(h&&u.push(String.fromCharCode.apply(String,f.slice(0,h))),u.join("")):String.fromCharCode.apply(String,f.slice(0,h))},i.write=function(r,a,s){for(var c=s,u,f,h=0;h<r.length;++h)u=r.charCodeAt(h),u<128?a[s++]=u:u<2048?(a[s++]=u>>6|192,a[s++]=u&63|128):(u&64512)===55296&&((f=r.charCodeAt(h+1))&64512)===56320?(u=65536+((u&1023)<<10)+(f&1023),++h,a[s++]=u>>18|240,a[s++]=u>>12&63|128,a[s++]=u>>6&63|128,a[s++]=u&63|128):(a[s++]=u>>12|224,a[s++]=u>>6&63|128,a[s++]=u&63|128);return s-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,a=i.utf8;function s(m,_){return RangeError("index out of range: "+m.pos+" + "+(_||1)+" > "+m.len)}function c(m){this.buf=m,this.pos=0,this.len=m.length}var u=typeof Uint8Array<"u"?function(_){if(_ instanceof Uint8Array||Array.isArray(_))return new c(_);throw Error("illegal buffer")}:function(_){if(Array.isArray(_))return new c(_);throw Error("illegal buffer")},f=function(){return i.Buffer?function(y){return(c.create=function(E){return i.Buffer.isBuffer(E)?new o(E):u(E)})(y)}:u};c.create=f(),c.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,c.prototype.uint32=(function(){var _=4294967295;return function(){if(_=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(_=(_|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(_=(_|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(_=(_|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(_=(_|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return _;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return _}})(),c.prototype.int32=function(){return this.uint32()|0},c.prototype.sint32=function(){var _=this.uint32();return _>>>1^-(_&1)|0};function h(){var m=new r(0,0),_=0;if(this.len-this.pos>4){for(;_<4;++_)if(m.lo=(m.lo|(this.buf[this.pos]&127)<<_*7)>>>0,this.buf[this.pos++]<128)return m;if(m.lo=(m.lo|(this.buf[this.pos]&127)<<28)>>>0,m.hi=(m.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return m;_=0}else{for(;_<3;++_){if(this.pos>=this.len)throw s(this);if(m.lo=(m.lo|(this.buf[this.pos]&127)<<_*7)>>>0,this.buf[this.pos++]<128)return m}return m.lo=(m.lo|(this.buf[this.pos++]&127)<<_*7)>>>0,m}if(this.len-this.pos>4){for(;_<5;++_)if(m.hi=(m.hi|(this.buf[this.pos]&127)<<_*7+3)>>>0,this.buf[this.pos++]<128)return m}else for(;_<5;++_){if(this.pos>=this.len)throw s(this);if(m.hi=(m.hi|(this.buf[this.pos]&127)<<_*7+3)>>>0,this.buf[this.pos++]<128)return m}throw Error("invalid varint encoding")}c.prototype.bool=function(){return this.uint32()!==0};function p(m,_){return(m[_-4]|m[_-3]<<8|m[_-2]<<16|m[_-1]<<24)>>>0}c.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return p(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return p(this.buf,this.pos+=4)|0};function A(){if(this.pos+8>this.len)throw s(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 s(this,4);var _=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,_},c.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var _=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,_},c.prototype.bytes=function(){var _=this.uint32(),y=this.pos,C=this.pos+_;if(C>this.len)throw s(this,_);if(this.pos+=_,Array.isArray(this.buf))return this.buf.slice(y,C);if(y===C){var E=i.Buffer;return E?E.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,y,C)},c.prototype.string=function(){var _=this.bytes();return a.read(_,0,_.length)},c.prototype.skip=function(_){if(typeof _=="number"){if(this.pos+_>this.len)throw s(this,_);this.pos+=_}else do if(this.pos>=this.len)throw s(this);while(this.buf[this.pos++]&128);return this},c.prototype.skipType=function(m){switch(m){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(m=this.uint32()&7)!==4;)this.skipType(m);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+m+" at offset "+this.pos)}return this},c._configure=function(m){o=m,c.create=f(),o._configure();var _=i.Long?"toLong":"toNumber";i.merge(c.prototype,{int64:function(){return h.call(this)[_](!1)},uint64:function(){return h.call(this)[_](!0)},sint64:function(){return h.call(this).zzDecode()[_](!1)},fixed64:function(){return A.call(this)[_](!0)},sfixed64:function(){return A.call(this)[_](!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(a){i.call(this,a)}r._configure=function(){o.Buffer&&(r.prototype._slice=o.Buffer.prototype.slice)},r.prototype.string=function(){var s=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+s,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+s,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,a,s){if(typeof r!="function")throw TypeError("rpcImpl must be a function");i.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=!!a,this.responseDelimited=!!s}o.prototype.rpcCall=function r(a,s,c,u,f){if(!u)throw TypeError("request must be specified");var h=this;if(!f)return i.asPromise(r,h,a,s,c,u);if(!h.rpcImpl)return setTimeout(function(){f(Error("already ended"))},0),undefined;try{return h.rpcImpl(a,s[h.requestDelimited?"encodeDelimited":"encode"](u).finish(),function(A,m){if(A)return h.emit("error",A,a),f(A);if(m===null)return h.end(!0),undefined;if(!(m instanceof c))try{m=c[h.responseDelimited?"decodeDelimited":"decode"](m)}catch(_){return h.emit("error",_,a),f(_)}return h.emit("data",m,a),f(null,m)})}catch(p){return h.emit("error",p,a),setTimeout(function(){f(p)},0),undefined}},o.prototype.end=function(a){return this.rpcImpl&&(a||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,u){this.lo=c>>>0,this.hi=u>>>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 a=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(u){if(u===0)return r;var f=u<0;f&&(u=-u);var h=u>>>0,p=(u-h)/4294967296>>>0;return f&&(p=~p>>>0,h=~h>>>0,++h>4294967295&&(h=0,++p>4294967295&&(p=0))),new o(h,p)},o.from=function(u){if(typeof u=="number")return o.fromNumber(u);if(i.isString(u))if(i.Long)u=i.Long.fromString(u);else return o.fromNumber(parseInt(u,10));return u.low||u.high?new o(u.low>>>0,u.high>>>0):r},o.prototype.toNumber=function(u){if(!u&&this.hi>>>31){var f=~this.lo+1>>>0,h=~this.hi>>>0;return f||(h=h+1>>>0),-(f+h*4294967296)}return this.lo+this.hi*4294967296},o.prototype.toLong=function(u){return i.Long?new i.Long(this.lo|0,this.hi|0,!!u):{low:this.lo|0,high:this.hi|0,unsigned:!!u}};var s=String.prototype.charCodeAt;o.fromHash=function(u){return u===a?r:new o((s.call(u,0)|s.call(u,1)<<8|s.call(u,2)<<16|s.call(u,3)<<24)>>>0,(s.call(u,4)|s.call(u,5)<<8|s.call(u,6)<<16|s.call(u,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 u=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^u)>>>0,this.lo=(this.lo<<1^u)>>>0,this},o.prototype.zzDecode=function(){var u=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^u)>>>0,this.hi=(this.hi>>>1^u)>>>0,this},o.prototype.length=function(){var u=this.lo,f=(this.lo>>>28|this.hi<<4)>>>0,h=this.hi>>>24;return h===0?f===0?u<16384?u<128?1:2:u<2097152?3:4:f<16384?f<128?5:6:f<2097152?7:8:h<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(s){return typeof s=="number"&&isFinite(s)&&Math.floor(s)===s},i.isString=function(s){return typeof s=="string"||s instanceof String},i.isObject=function(s){return s&&typeof s=="object"},i.isset=i.isSet=function(s,c){var u=s[c];return u!=null&&s.hasOwnProperty(c)?typeof u!="object"||(Array.isArray(u)?u.length:Object.keys(u).length)>0:!1},i.Buffer=(function(){try{var a=i.inquire("buffer").Buffer;return a.prototype.utf8Write?a:null}catch{return null}})(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(s){return typeof s=="number"?i.Buffer?i._Buffer_allocUnsafe(s):new i.Array(s):i.Buffer?i._Buffer_from(s):typeof Uint8Array>"u"?s:new Uint8Array(s)},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(s){return s?i.LongBits.from(s).toHash():i.LongBits.zeroHash},i.longFromHash=function(s,c){var u=i.LongBits.fromHash(s);return i.Long?i.Long.fromBits(u.lo,u.hi,c):u.toNumber(!!c)};function o(a,s,c){for(var u=Object.keys(s),f=0;f<u.length;++f)(a[u[f]]===undefined||!c)&&(a[u[f]]=s[u[f]]);return a}i.merge=o,i.lcFirst=function(s){return s.charAt(0).toLowerCase()+s.substring(1)};function r(a){function s(c,u){if(!(this instanceof s))return new s(c,u);Object.defineProperty(this,"message",{get:function(){return c}}),Error.captureStackTrace?Error.captureStackTrace(this,s):Object.defineProperty(this,"stack",{value:new Error().stack||""}),u&&o(this,u)}return s.prototype=Object.create(Error.prototype,{constructor:{value:s,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return a},set:undefined,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),s}i.newError=r,i.ProtocolError=r("ProtocolError"),i.oneOfGetter=function(s){for(var c={},u=0;u<s.length;++u)c[s[u]]=1;return function(){for(var f=Object.keys(this),h=f.length-1;h>-1;--h)if(c[f[h]]===1&&this[f[h]]!==undefined&&this[f[h]]!==null)return f[h]}},i.oneOfSetter=function(s){return function(c){for(var u=0;u<s.length;++u)s[u]!==c&&delete this[s[u]]}},i.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},i._configure=function(){var a=i.Buffer;if(!a){i._Buffer_from=i._Buffer_allocUnsafe=null;return}i._Buffer_from=a.from!==Uint8Array.from&&a.from||function(c,u){return new a(c,u)},i._Buffer_allocUnsafe=a.allocUnsafe||function(c){return new a(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=h;var i=e(15),o,r=i.LongBits,a=i.base64,s=i.utf8;function c(b,x,S){this.fn=b,this.len=x,this.next=undefined,this.val=S}function u(){}function f(b){this.head=b.head,this.tail=b.tail,this.len=b.len,this.next=b.states}function h(){this.len=0,this.head=new c(u,0,0),this.tail=this.head,this.states=null}var p=function(){return i.Buffer?function(){return(h.create=function(){return new o})()}:function(){return new h}};h.create=p(),h.alloc=function(x){return new i.Array(x)},i.Array!==Array&&(h.alloc=i.pool(h.alloc,i.Array.prototype.subarray)),h.prototype._push=function(x,S,B){return this.tail=this.tail.next=new c(x,S,B),this.len+=S,this};function A(b,x,S){x[S]=b&255}function m(b,x,S){for(;b>127;)x[S++]=b&127|128,b>>>=7;x[S]=b}function _(b,x){this.len=b,this.next=undefined,this.val=x}_.prototype=Object.create(c.prototype),_.prototype.fn=m,h.prototype.uint32=function(x){return this.len+=(this.tail=this.tail.next=new _((x=x>>>0)<128?1:x<16384?2:x<2097152?3:x<268435456?4:5,x)).len,this},h.prototype.int32=function(x){return x<0?this._push(y,10,r.fromNumber(x)):this.uint32(x)},h.prototype.sint32=function(x){return this.uint32((x<<1^x>>31)>>>0)};function y(b,x,S){for(;b.hi;)x[S++]=b.lo&127|128,b.lo=(b.lo>>>7|b.hi<<25)>>>0,b.hi>>>=7;for(;b.lo>127;)x[S++]=b.lo&127|128,b.lo=b.lo>>>7;x[S++]=b.lo}h.prototype.uint64=function(x){var S=r.from(x);return this._push(y,S.length(),S)},h.prototype.int64=h.prototype.uint64,h.prototype.sint64=function(x){var S=r.from(x).zzEncode();return this._push(y,S.length(),S)},h.prototype.bool=function(x){return this._push(A,1,x?1:0)};function C(b,x,S){x[S]=b&255,x[S+1]=b>>>8&255,x[S+2]=b>>>16&255,x[S+3]=b>>>24}h.prototype.fixed32=function(x){return this._push(C,4,x>>>0)},h.prototype.sfixed32=h.prototype.fixed32,h.prototype.fixed64=function(x){var S=r.from(x);return this._push(C,4,S.lo)._push(C,4,S.hi)},h.prototype.sfixed64=h.prototype.fixed64,h.prototype.float=function(x){return this._push(i.float.writeFloatLE,4,x)},h.prototype.double=function(x){return this._push(i.float.writeDoubleLE,8,x)};var E=i.Array.prototype.set?function(x,S,B){S.set(x,B)}:function(x,S,B){for(var v=0;v<x.length;++v)S[B+v]=x[v]};h.prototype.bytes=function(x){var S=x.length>>>0;if(!S)return this._push(A,1,0);if(i.isString(x)){var B=h.alloc(S=a.length(x));a.decode(x,B,0),x=B}return this.uint32(S)._push(E,S,x)},h.prototype.string=function(x){var S=s.length(x);return S?this.uint32(S)._push(s.write,S,x):this._push(A,1,0)},h.prototype.fork=function(){return this.states=new f(this),this.head=this.tail=new c(u,0,0),this.len=0,this},h.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(u,0,0),this.len=0),this},h.prototype.ldelim=function(){var x=this.head,S=this.tail,B=this.len;return this.reset().uint32(B),B&&(this.tail.next=x.next,this.tail=S,this.len+=B),this},h.prototype.finish=function(){for(var x=this.head.next,S=this.constructor.alloc(this.len),B=0;x;)x.fn(x.val,S,B),B+=x.len,x=x.next;return S},h._configure=function(b){o=b,h.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,u,f){u.set(c,f)}:function(c,u,f){if(c.copy)c.copy(u,f,0,c.length);else for(var h=0;h<c.length;)u[f++]=c[h++]}},r.prototype.bytes=function(c){o.isString(c)&&(c=o._Buffer_from(c,"base64"));var u=c.length>>>0;return this.uint32(u),u&&this._push(r.writeBytesBuffer,u,c),this};function a(s,c,u){s.length<40?o.utf8.write(s,c,u):c.utf8Write?c.utf8Write(s,u):c.write(s,u)}r.prototype.string=function(c){var u=o.Buffer.byteLength(c);return this.uint32(u),u&&this._push(a,u,c),this},r._configure()},{15:15,16:16}]},{},[8])})()});var ave=ki((H$i,V5)=>{/* 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(f,h){h=h||{};var p=h.encodedMaskData||h.encodedMaskData===null,A=c(f,h.inputOffset||0,p),m=h.noDataValue!==null?h.noDataValue:o.defaultNoDataValue,_=r(A,h.pixelType||Float32Array,h.encodedMaskData,m,h.returnMask),y={width:A.width,height:A.height,pixelData:_.resultPixels,minValue:_.minValue,maxValue:A.pixels.maxValue,noDataValue:m};return _.resultMask&&(y.maskData=_.resultMask),h.returnEncodedMask&&A.mask&&(y.encodedMaskData=A.mask.bitset?A.mask.bitset:null),h.returnFileInfo&&(y.fileInfo=a(A),h.computeUsedBitDepths&&(y.fileInfo.bitDepths=s(A))),y};var r=function(f,h,p,A,m){var _=0,y=f.pixels.numBlocksX,C=f.pixels.numBlocksY,E=Math.floor(f.width/y),b=Math.floor(f.height/C),x=2*f.maxZError,S=Number.MAX_VALUE,B;p=p||(f.mask?f.mask.bitset:null);var v,P;v=new h(f.width*f.height),m&&p&&(P=new Uint8Array(f.width*f.height));for(var N=new Float32Array(E*b),L,g,I=0;I<=C;I++){var T=I!==C?b:f.height%C;if(T!==0)for(var w=0;w<=y;w++){var R=w!==y?E:f.width%y;if(R!==0){var O=I*f.width*b+w*E,G=f.width-R,F=f.pixels.blocks[_],U,Q,H;F.encoding<2?(F.encoding===0?U=F.rawData:(u(F.stuffedData,F.bitsPerPixel,F.numValidPixels,F.offset,x,N,f.pixels.maxValue),U=N),Q=0):F.encoding===2?H=0:H=F.offset;var Y;if(p)for(g=0;g<T;g++){for(O&7&&(Y=p[O>>3],Y<<=O&7),L=0;L<R;L++)O&7||(Y=p[O>>3]),Y&128?(P&&(P[O]=1),B=F.encoding<2?U[Q++]:H,S=S>B?B:S,v[O++]=B):(P&&(P[O]=0),v[O++]=A),Y<<=1;O+=G}else if(F.encoding<2)for(g=0;g<T;g++){for(L=0;L<R;L++)B=U[Q++],S=S>B?B:S,v[O++]=B;O+=G}else for(S=S>H?H:S,g=0;g<T;g++){for(L=0;L<R;L++)v[O++]=H;O+=G}if(F.encoding===1&&Q!==F.numValidPixels)throw"Block and Mask do not match";_++}}}return{resultPixels:v,resultMask:P,minValue:S}},a=function(f){return{fileIdentifierString:f.fileIdentifierString,fileVersion:f.fileVersion,imageType:f.imageType,height:f.height,width:f.width,maxZError:f.maxZError,eofOffset:f.eofOffset,mask:f.mask?{numBlocksX:f.mask.numBlocksX,numBlocksY:f.mask.numBlocksY,numBytes:f.mask.numBytes,maxValue:f.mask.maxValue}:null,pixels:{numBlocksX:f.pixels.numBlocksX,numBlocksY:f.pixels.numBlocksY,numBytes:f.pixels.numBytes,maxValue:f.pixels.maxValue,noDataValue:f.noDataValue}}},s=function(f){for(var h=f.pixels.numBlocksX*f.pixels.numBlocksY,p={},A=0;A<h;A++){var m=f.pixels.blocks[A];m.encoding===0?p.float32=!0:m.encoding===1?p[m.bitsPerPixel]=!0:p[0]=!0}return Object.keys(p)},c=function(f,h,p){var A={},m=new Uint8Array(f,h,10);if(A.fileIdentifierString=String.fromCharCode.apply(null,m),A.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+A.fileIdentifierString;h+=10;var _=new DataView(f,h,24);if(A.fileVersion=_.getInt32(0,!0),A.imageType=_.getInt32(4,!0),A.height=_.getUint32(8,!0),A.width=_.getUint32(12,!0),A.maxZError=_.getFloat64(16,!0),h+=24,!p)if(_=new DataView(f,h,16),A.mask={},A.mask.numBlocksY=_.getUint32(0,!0),A.mask.numBlocksX=_.getUint32(4,!0),A.mask.numBytes=_.getUint32(8,!0),A.mask.maxValue=_.getFloat32(12,!0),h+=16,A.mask.numBytes>0){var y=new Uint8Array(Math.ceil(A.width*A.height/8));_=new DataView(f,h,A.mask.numBytes);var C=_.getInt16(0,!0),E=2,b=0;do{if(C>0)for(;C--;)y[b++]=_.getUint8(E++);else{var x=_.getUint8(E++);for(C=-C;C--;)y[b++]=x}C=_.getInt16(E,!0),E+=2}while(E<A.mask.numBytes);if(C!==-32768||b<y.length)throw"Unexpected end of mask RLE encoding";A.mask.bitset=y,h+=A.mask.numBytes}else(A.mask.numBytes|A.mask.numBlocksY|A.mask.maxValue)===0&&(A.mask.bitset=new Uint8Array(Math.ceil(A.width*A.height/8)));_=new DataView(f,h,16),A.pixels={},A.pixels.numBlocksY=_.getUint32(0,!0),A.pixels.numBlocksX=_.getUint32(4,!0),A.pixels.numBytes=_.getUint32(8,!0),A.pixels.maxValue=_.getFloat32(12,!0),h+=16;var S=A.pixels.numBlocksX,B=A.pixels.numBlocksY,v=S+(A.width%S>0?1:0),P=B+(A.height%B>0?1:0);A.pixels.blocks=new Array(v*P);for(var N=0,L=0;L<P;L++)for(var g=0;g<v;g++){var I=0,T=f.byteLength-h;_=new DataView(f,h,Math.min(10,T));var w={};A.pixels.blocks[N++]=w;var R=_.getUint8(0);if(I++,w.encoding=R&63,w.encoding>3)throw"Invalid block encoding ("+w.encoding+")";if(w.encoding===2){h++;continue}if(R!==0&&R!==2){if(R>>=6,w.offsetType=R,R===2)w.offset=_.getInt8(1),I++;else if(R===1)w.offset=_.getInt16(1,!0),I+=2;else if(R===0)w.offset=_.getFloat32(1,!0),I+=4;else throw"Invalid block offset type";if(w.encoding===1)if(R=_.getUint8(I),I++,w.bitsPerPixel=R&63,R>>=6,w.numValidPixelsType=R,R===2)w.numValidPixels=_.getUint8(I),I++;else if(R===1)w.numValidPixels=_.getUint16(I,!0),I+=2;else if(R===0)w.numValidPixels=_.getUint32(I,!0),I+=4;else throw"Invalid valid pixel count type"}if(h+=I,w.encoding!==3){var O,G;if(w.encoding===0){var F=(A.pixels.numBytes-1)/4;if(F!==Math.floor(F))throw"uncompressed block has invalid length";O=new ArrayBuffer(F*4),G=new Uint8Array(O),G.set(new Uint8Array(f,h,F*4));var U=new Float32Array(O);w.rawData=U,h+=F*4}else if(w.encoding===1){var Q=Math.ceil(w.numValidPixels*w.bitsPerPixel/8),H=Math.ceil(Q/4);O=new ArrayBuffer(H*4),G=new Uint8Array(O),G.set(new Uint8Array(f,h,Q)),w.stuffedData=new Uint32Array(O),h+=Q}}}return A.eofOffset=h,A},u=function(f,h,p,A,m,_,y){var C=(1<<h)-1,E=0,b,x=0,S,B,v=Math.ceil((y-A)/m),P=f.length*4-Math.ceil(h*p/8);for(f[f.length-1]<<=8*P,b=0;b<p;b++){if(x===0&&(B=f[E++],x=32),x>=h)S=B>>>x-h&C,x-=h;else{var N=h-x;S=(B&C)<<N&C,B=f[E++],x=32-N,S+=B>>>x}_[b]=S<v?A+S*m:y}return _};return o})(),t=(function(){"use strict";var o={unstuff:function(c,u,f,h,p,A,m,_){var y=(1<<f)-1,C=0,E,b=0,x,S,B,v,P=c.length*4-Math.ceil(f*h/8);if(c[c.length-1]<<=8*P,p)for(E=0;E<h;E++)b===0&&(S=c[C++],b=32),b>=f?(x=S>>>b-f&y,b-=f):(B=f-b,x=(S&y)<<B&y,S=c[C++],b=32-B,x+=S>>>b),u[E]=p[x];else for(v=Math.ceil((_-A)/m),E=0;E<h;E++)b===0&&(S=c[C++],b=32),b>=f?(x=S>>>b-f&y,b-=f):(B=f-b,x=(S&y)<<B&y,S=c[C++],b=32-B,x+=S>>>b),u[E]=x<v?A+x*m:_},unstuffLUT:function(c,u,f,h,p,A){var m=(1<<u)-1,_=0,y=0,C=0,E=0,b=0,x,S=[],B=c.length*4-Math.ceil(u*f/8);c[c.length-1]<<=8*B;var v=Math.ceil((A-h)/p);for(y=0;y<f;y++)E===0&&(x=c[_++],E=32),E>=u?(b=x>>>E-u&m,E-=u):(C=u-E,b=(x&m)<<C&m,x=c[_++],E=32-C,b+=x>>>E),S[y]=b<v?h+b*p:A;return S.unshift(h),S},unstuff2:function(c,u,f,h,p,A,m,_){var y=(1<<f)-1,C=0,E,b=0,x=0,S,B,v;if(p)for(E=0;E<h;E++)b===0&&(B=c[C++],b=32,x=0),b>=f?(S=B>>>x&y,b-=f,x+=f):(v=f-b,S=B>>>x&y,B=c[C++],b=32-v,S|=(B&(1<<v)-1)<<f-v,x=v),u[E]=p[S];else{var P=Math.ceil((_-A)/m);for(E=0;E<h;E++)b===0&&(B=c[C++],b=32,x=0),b>=f?(S=B>>>x&y,b-=f,x+=f):(v=f-b,S=B>>>x&y,B=c[C++],b=32-v,S|=(B&(1<<v)-1)<<f-v,x=v),u[E]=S<P?A+S*m:_}return u},unstuffLUT2:function(c,u,f,h,p,A){var m=(1<<u)-1,_=0,y=0,C=0,E=0,b=0,x=0,S,B=[],v=Math.ceil((A-h)/p);for(y=0;y<f;y++)E===0&&(S=c[_++],E=32,x=0),E>=u?(b=S>>>x&m,E-=u,x+=u):(C=u-E,b=S>>>x&m,S=c[_++],E=32-C,b|=(S&(1<<C)-1)<<u-C,x=C),B[y]=b<v?h+b*p:A;return B.unshift(h),B},originalUnstuff:function(c,u,f,h){var p=(1<<f)-1,A=0,m,_=0,y,C,E,b=c.length*4-Math.ceil(f*h/8);for(c[c.length-1]<<=8*b,m=0;m<h;m++)_===0&&(C=c[A++],_=32),_>=f?(y=C>>>_-f&p,_-=f):(E=f-_,y=(C&p)<<E&p,C=c[A++],_=32-E,y+=C>>>_),u[m]=y;return u},originalUnstuff2:function(c,u,f,h){var p=(1<<f)-1,A=0,m,_=0,y=0,C,E,b;for(m=0;m<h;m++)_===0&&(E=c[A++],_=32,y=0),_>=f?(C=E>>>y&p,_-=f,y+=f):(b=f-_,C=E>>>y&p,E=c[A++],_=32-b,C|=(E&(1<<b)-1)<<f-b,y=b),u[m]=C;return u}},r={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(c){for(var u=65535,f=65535,h=c.length,p=Math.floor(h/2),A=0;p;){var m=p>=359?359:p;p-=m;do u+=c[A++]<<8,f+=u+=c[A++];while(--m);u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16)}return h&1&&(f+=u+=c[A]<<8),u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16),(f<<16|u)>>>0},readHeaderInfo:function(c,u){var f=u.ptr,h=new Uint8Array(c,f,6),p={};if(p.fileIdentifierString=String.fromCharCode.apply(null,h),p.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+p.fileIdentifierString;f+=6;var A=new DataView(c,f,8),m=A.getInt32(0,!0);p.fileVersion=m,f+=4,m>=3&&(p.checksum=A.getUint32(4,!0),f+=4),A=new DataView(c,f,12),p.height=A.getUint32(0,!0),p.width=A.getUint32(4,!0),f+=8,m>=4?(p.numDims=A.getUint32(8,!0),f+=4):p.numDims=1,A=new DataView(c,f,40),p.numValidPixel=A.getUint32(0,!0),p.microBlockSize=A.getInt32(4,!0),p.blobSize=A.getInt32(8,!0),p.imageType=A.getInt32(12,!0),p.maxZError=A.getFloat64(16,!0),p.zMin=A.getFloat64(24,!0),p.zMax=A.getFloat64(32,!0),f+=40,u.headerInfo=p,u.ptr=f;var _,y;if(m>=3&&(y=m>=4?52:48,_=this.computeChecksumFletcher32(new Uint8Array(c,f-y,p.blobSize-14)),_!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(c,u){var f=u.headerInfo,h=this.getDataTypeArray(f.imageType),p=f.numDims*this.getDataTypeSize(f.imageType),A=this.readSubArray(c,u.ptr,h,p),m=this.readSubArray(c,u.ptr+p,h,p);u.ptr+=2*p;var _,y=!0;for(_=0;_<f.numDims;_++)if(A[_]!==m[_]){y=!1;break}return f.minValues=A,f.maxValues=m,y},readSubArray:function(c,u,f,h){var p;if(f===Uint8Array)p=new Uint8Array(c,u,h);else{var A=new ArrayBuffer(h),m=new Uint8Array(A);m.set(new Uint8Array(c,u,h)),p=new f(A)}return p},readMask:function(c,u){var f=u.ptr,h=u.headerInfo,p=h.width*h.height,A=h.numValidPixel,m=new DataView(c,f,4),_={};if(_.numBytes=m.getUint32(0,!0),f+=4,(A===0||p===A)&&_.numBytes!==0)throw"invalid mask";var y,C;if(A===0)y=new Uint8Array(Math.ceil(p/8)),_.bitset=y,C=new Uint8Array(p),u.pixels.resultMask=C,f+=_.numBytes;else if(_.numBytes>0){y=new Uint8Array(Math.ceil(p/8)),m=new DataView(c,f,_.numBytes);var E=m.getInt16(0,!0),b=2,x=0,S=0;do{if(E>0)for(;E--;)y[x++]=m.getUint8(b++);else for(S=m.getUint8(b++),E=-E;E--;)y[x++]=S;E=m.getInt16(b,!0),b+=2}while(b<_.numBytes);if(E!==-32768||x<y.length)throw"Unexpected end of mask RLE encoding";C=new Uint8Array(p);var B=0,v=0;for(v=0;v<p;v++)v&7?(B=y[v>>3],B<<=v&7):B=y[v>>3],B&128&&(C[v]=1);u.pixels.resultMask=C,_.bitset=y,f+=_.numBytes}return u.ptr=f,u.mask=_,!0},readDataOneSweep:function(c,u,f){var h=u.ptr,p=u.headerInfo,A=p.numDims,m=p.width*p.height,_=p.imageType,y=p.numValidPixel*r.getDataTypeSize(_)*A,C,E=u.pixels.resultMask;if(f===Uint8Array)C=new Uint8Array(c,h,y);else{var b=new ArrayBuffer(y),x=new Uint8Array(b);x.set(new Uint8Array(c,h,y)),C=new f(b)}if(C.length===m*A)u.pixels.resultPixels=C;else{u.pixels.resultPixels=new f(m*A);var S=0,B=0,v=0,P=0;if(A>1)for(v=0;v<A;v++)for(P=v*m,B=0;B<m;B++)E[B]&&(u.pixels.resultPixels[P+B]=C[S++]);else for(B=0;B<m;B++)E[B]&&(u.pixels.resultPixels[B]=C[S++])}return h+=y,u.ptr=h,!0},readHuffmanTree:function(c,u){var f=this.HUFFMAN_LUT_BITS_MAX,h=new DataView(c,u.ptr,16);u.ptr+=16;var p=h.getInt32(0,!0);if(p<2)throw"unsupported Huffman version";var A=h.getInt32(4,!0),m=h.getInt32(8,!0),_=h.getInt32(12,!0);if(m>=_)return!1;var y=new Uint32Array(_-m);r.decodeBits(c,u,y);var C=[],E,b,x,S;for(E=m;E<_;E++)b=E-(E<A?0:A),C[b]={first:y[E-m],second:null};var B=c.byteLength-u.ptr,v=Math.ceil(B/4),P=new ArrayBuffer(v*4),N=new Uint8Array(P);N.set(new Uint8Array(c,u.ptr,B));var L=new Uint32Array(P),g=0,I,T=0;for(I=L[0],E=m;E<_;E++)b=E-(E<A?0:A),S=C[b].first,S>0&&(C[b].second=I<<g>>>32-S,32-g>=S?(g+=S,g===32&&(g=0,T++,I=L[T])):(g+=S-32,T++,I=L[T],C[b].second|=I>>>32-g));var w=0,R=0,O=new a;for(E=0;E<C.length;E++)C[E]!==void 0&&(w=Math.max(w,C[E].first));w>=f?R=f:R=w,w>=30&&console.log("WARning, large NUM LUT BITS IS "+w);var G=[],F,U,Q,H,Y,$;for(E=m;E<_;E++)if(b=E-(E<A?0:A),S=C[b].first,S>0)if(F=[S,b],S<=R)for(U=C[b].second<<R-S,Q=1<<R-S,x=0;x<Q;x++)G[U|x]=F;else for(U=C[b].second,$=O,H=S-1;H>=0;H--)Y=U>>>H&1,Y?($.right||($.right=new a),$=$.right):($.left||($.left=new a),$=$.left),H===0&&!$.val&&($.val=F[1]);return{decodeLut:G,numBitsLUTQick:R,numBitsLUT:w,tree:O,stuffedData:L,srcPtr:T,bitPos:g}},readHuffman:function(c,u,f){var h=u.headerInfo,p=h.numDims,A=u.headerInfo.height,m=u.headerInfo.width,_=m*A,y=this.readHuffmanTree(c,u),C=y.decodeLut,E=y.tree,b=y.stuffedData,x=y.srcPtr,S=y.bitPos,B=y.numBitsLUTQick,v=y.numBitsLUT,P=u.headerInfo.imageType===0?128:0,N,L,g,I=u.pixels.resultMask,T,w,R,O,G,F,U,Q=0;S>0&&(x++,S=0);var H=b[x],Y=u.encodeMode===1,$=new f(_*p),W=$,K;for(K=0;K<h.numDims;K++){if(p>1&&(W=new f($.buffer,_*K,_),Q=0),u.headerInfo.numValidPixel===m*A)for(F=0,O=0;O<A;O++)for(G=0;G<m;G++,F++){if(L=0,T=H<<S>>>32-B,w=T,32-S<B&&(T|=b[x+1]>>>64-S-B,w=T),C[w])L=C[w][1],S+=C[w][0];else for(T=H<<S>>>32-v,w=T,32-S<v&&(T|=b[x+1]>>>64-S-v,w=T),N=E,U=0;U<v;U++)if(R=T>>>v-U-1&1,N=R?N.right:N.left,!(N.left||N.right)){L=N.val,S=S+U+1;break}S>=32&&(S-=32,x++,H=b[x]),g=L-P,Y?(G>0?g+=Q:O>0?g+=W[F-m]:g+=Q,g&=255,W[F]=g,Q=g):W[F]=g}else for(F=0,O=0;O<A;O++)for(G=0;G<m;G++,F++)if(I[F]){if(L=0,T=H<<S>>>32-B,w=T,32-S<B&&(T|=b[x+1]>>>64-S-B,w=T),C[w])L=C[w][1],S+=C[w][0];else for(T=H<<S>>>32-v,w=T,32-S<v&&(T|=b[x+1]>>>64-S-v,w=T),N=E,U=0;U<v;U++)if(R=T>>>v-U-1&1,N=R?N.right:N.left,!(N.left||N.right)){L=N.val,S=S+U+1;break}S>=32&&(S-=32,x++,H=b[x]),g=L-P,Y?(G>0&&I[F-1]?g+=Q:O>0&&I[F-m]?g+=W[F-m]:g+=Q,g&=255,W[F]=g,Q=g):W[F]=g}u.ptr=u.ptr+(x+1)*4+(S>0?4:0)}u.pixels.resultPixels=$},decodeBits:function(c,u,f,h,p){{var A=u.headerInfo,m=A.fileVersion,_=0,y=new DataView(c,u.ptr,5),C=y.getUint8(0);_++;var E=C>>6,b=E===0?4:3-E,x=(C&32)>0,S=C&31,B=0;if(b===1)B=y.getUint8(_),_++;else if(b===2)B=y.getUint16(_,!0),_+=2;else if(b===4)B=y.getUint32(_,!0),_+=4;else throw"Invalid valid pixel count type";var v=2*A.maxZError,P,N,L,g,I,T,w,R,O,G,F=A.numDims>1?A.maxValues[p]:A.zMax;if(x){for(u.counter.lut++,R=y.getUint8(_),O=S,_++,g=Math.ceil((R-1)*S/8),I=Math.ceil(g/4),N=new ArrayBuffer(I*4),L=new Uint8Array(N),u.ptr+=_,L.set(new Uint8Array(c,u.ptr,g)),w=new Uint32Array(N),u.ptr+=g,G=0;R-1>>>G;)G++;g=Math.ceil(B*G/8),I=Math.ceil(g/4),N=new ArrayBuffer(I*4),L=new Uint8Array(N),L.set(new Uint8Array(c,u.ptr,g)),P=new Uint32Array(N),u.ptr+=g,m>=3?T=o.unstuffLUT2(w,S,R-1,h,v,F):T=o.unstuffLUT(w,S,R-1,h,v,F),m>=3?o.unstuff2(P,f,G,B,T):o.unstuff(P,f,G,B,T)}else u.counter.bitstuffer++,G=S,u.ptr+=_,G>0&&(g=Math.ceil(B*G/8),I=Math.ceil(g/4),N=new ArrayBuffer(I*4),L=new Uint8Array(N),L.set(new Uint8Array(c,u.ptr,g)),P=new Uint32Array(N),u.ptr+=g,m>=3?h==null?o.originalUnstuff2(P,f,G,B):o.unstuff2(P,f,G,B,!1,h,v,F):h==null?o.originalUnstuff(P,f,G,B):o.unstuff(P,f,G,B,!1,h,v,F))}},readTiles:function(c,u,f){var h=u.headerInfo,p=h.width,A=h.height,m=h.microBlockSize,_=h.imageType,y=r.getDataTypeSize(_),C=Math.ceil(p/m),E=Math.ceil(A/m);u.pixels.numBlocksY=E,u.pixels.numBlocksX=C,u.pixels.ptr=0;var b=0,x=0,S=0,B=0,v=0,P=0,N=0,L=0,g=0,I=0,T=0,w=0,R=0,O=0,G=0,F=0,U,Q,H,Y,$,W,K=new f(m*m),Z=A%m||m,pe=p%m||m,ge,re,ye=h.numDims,Ce,Pe=u.pixels.resultMask,Ne=u.pixels.resultPixels;for(S=0;S<E;S++)for(v=S!==E-1?m:Z,B=0;B<C;B++)for(P=B!==C-1?m:pe,T=S*p*m+B*m,w=p-P,Ce=0;Ce<ye;Ce++){if(ye>1&&(Ne=new f(u.pixels.resultPixels.buffer,p*A*Ce*y,p*A)),N=c.byteLength-u.ptr,U=new DataView(c,u.ptr,Math.min(10,N)),Q={},F=0,L=U.getUint8(0),F++,g=L>>6&255,I=L>>2&15,I!==(B*m>>3&15))throw"integrity issue";if(W=L&3,W>3)throw u.ptr+=F,"Invalid block encoding ("+W+")";if(W===2){u.counter.constant++,u.ptr+=F;continue}else if(W===0){if(u.counter.uncompressed++,u.ptr+=F,R=v*P*y,O=c.byteLength-u.ptr,R=R<O?R:O,H=new ArrayBuffer(R%y===0?R:R+y-R%y),Y=new Uint8Array(H),Y.set(new Uint8Array(c,u.ptr,R)),$=new f(H),G=0,Pe)for(b=0;b<v;b++){for(x=0;x<P;x++)Pe[T]&&(Ne[T]=$[G++]),T++;T+=w}else for(b=0;b<v;b++){for(x=0;x<P;x++)Ne[T++]=$[G++];T+=w}u.ptr+=G*y}else if(ge=r.getDataTypeUsed(_,g),re=r.getOnePixel(Q,F,ge,U),F+=r.getDataTypeSize(ge),W===3)if(u.ptr+=F,u.counter.constantoffset++,Pe)for(b=0;b<v;b++){for(x=0;x<P;x++)Pe[T]&&(Ne[T]=re),T++;T+=w}else for(b=0;b<v;b++){for(x=0;x<P;x++)Ne[T++]=re;T+=w}else if(u.ptr+=F,r.decodeBits(c,u,K,re,Ce),F=0,Pe)for(b=0;b<v;b++){for(x=0;x<P;x++)Pe[T]&&(Ne[T]=K[F++]),T++;T+=w}else for(b=0;b<v;b++){for(x=0;x<P;x++)Ne[T++]=K[F++];T+=w}}},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 u=c.headerInfo.zMax,f=c.headerInfo.numDims,h=c.headerInfo.height*c.headerInfo.width,p=h*f,A=0,m=0,_=0,y=c.pixels.resultMask;if(y)if(f>1)for(A=0;A<f;A++)for(_=A*h,m=0;m<h;m++)y[m]&&(c.pixels.resultPixels[_+m]=u);else for(m=0;m<h;m++)y[m]&&(c.pixels.resultPixels[m]=u);else if(c.pixels.resultPixels.fill)c.pixels.resultPixels.fill(u);else for(m=0;m<p;m++)c.pixels.resultPixels[m]=u},getDataTypeArray:function(c){var u;switch(c){case 0:u=Int8Array;break;case 1:u=Uint8Array;break;case 2:u=Int16Array;break;case 3:u=Uint16Array;break;case 4:u=Int32Array;break;case 5:u=Uint32Array;break;case 6:u=Float32Array;break;case 7:u=Float64Array;break;default:u=Float32Array}return u},getPixelType:function(c){var u;switch(c){case 0:u="S8";break;case 1:u="U8";break;case 2:u="S16";break;case 3:u="U16";break;case 4:u="S32";break;case 5:u="U32";break;case 6:u="F32";break;case 7:u="F64";break;default:u="F32"}return u},isValidPixelValue:function(c,u){if(u==null)return!1;var f;switch(c){case 0:f=u>=-128&&u<=127;break;case 1:f=u>=0&&u<=255;break;case 2:f=u>=-32768&&u<=32767;break;case 3:f=u>=0&&u<=65536;break;case 4:f=u>=-2147483648&&u<=2147483647;break;case 5:f=u>=0&&u<=4294967296;break;case 6:f=u>=-34027999387901484e22&&u<=34027999387901484e22;break;case 7:f=u>=5e-324&&u<=17976931348623157e292;break;default:f=!1}return f},getDataTypeSize:function(c){var u=0;switch(c){case 0:case 1:u=1;break;case 2:case 3:u=2;break;case 4:case 5:case 6:u=4;break;case 7:u=8;break;default:u=c}return u},getDataTypeUsed:function(c,u){var f=c;switch(c){case 2:case 4:f=c-u;break;case 3:case 5:f=c-2*u;break;case 6:u===0?f=c:u===1?f=2:f=1;break;case 7:u===0?f=c:f=c-2*u+1;break;default:f=c;break}return f},getOnePixel:function(c,u,f,h){var p=0;switch(f){case 0:p=h.getInt8(u);break;case 1:p=h.getUint8(u);break;case 2:p=h.getInt16(u,!0);break;case 3:p=h.getUint16(u,!0);break;case 4:p=h.getInt32(u,!0);break;case 5:p=h.getUInt32(u,!0);break;case 6:p=h.getFloat32(u,!0);break;case 7:p=h.getFloat64(u,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},a=function(c,u,f){this.val=c,this.left=u,this.right=f},s={decode:function(c,u){u=u||{};var f=u.noDataValue,h=0,p={};if(p.ptr=u.inputOffset||0,p.pixels={},!!r.readHeaderInfo(c,p)){var A=p.headerInfo,m=A.fileVersion,_=r.getDataTypeArray(A.imageType);r.readMask(c,p),A.numValidPixel!==A.width*A.height&&!p.pixels.resultMask&&(p.pixels.resultMask=u.maskData);var y=A.width*A.height;if(p.pixels.resultPixels=new _(y*A.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},A.numValidPixel!==0)if(A.zMax===A.zMin)r.constructConstantSurface(p);else if(m>=4&&r.checkMinMaxRanges(c,p))r.constructConstantSurface(p);else{var C=new DataView(c,p.ptr,2),E=C.getUint8(0);if(p.ptr++,E)r.readDataOneSweep(c,p,_);else if(m>1&&A.imageType<=1&&Math.abs(A.maxZError-.5)<1e-5){var b=C.getUint8(1);if(p.ptr++,p.encodeMode=b,b>2||m<4&&b>1)throw"Invalid Huffman flag "+b;b?r.readHuffman(c,p,_):r.readTiles(c,p,_)}else r.readTiles(c,p,_)}p.eofOffset=p.ptr;var x;u.inputOffset?(x=p.headerInfo.blobSize+u.inputOffset-p.ptr,Math.abs(x)>=1&&(p.eofOffset=u.inputOffset+p.headerInfo.blobSize)):(x=p.headerInfo.blobSize-p.ptr,Math.abs(x)>=1&&(p.eofOffset=p.headerInfo.blobSize));var S={width:A.width,height:A.height,pixelData:p.pixels.resultPixels,minValue:A.zMin,maxValue:A.zMax,validPixelCount:A.numValidPixel,dimCount:A.numDims,dimStats:{minValues:A.minValues,maxValues:A.maxValues},maskData:p.pixels.resultMask};if(p.pixels.resultMask&&r.isValidPixelValue(A.imageType,f)){var B=p.pixels.resultMask;for(h=0;h<y;h++)B[h]||(S.pixelData[h]=f);S.noDataValue=f}return p.noDataValue=f,u.returnFileInfo&&(S.fileInfo=r.formatFileInfo(p)),S}},getBandCount:function(c){var u=0,f=0,h={};for(h.ptr=0,h.pixels={};f<c.byteLength-58;)r.readHeaderInfo(c,h),f+=h.headerInfo.blobSize,u++,h.ptr=f;return u}};return s})(),n=(function(){var o=new ArrayBuffer(4),r=new Uint8Array(o),a=new Uint32Array(o);return a[0]=1,r[0]===1})(),i={decode:function(o,r){if(!n)throw"Big endian system is not supported.";r=r||{};var a=r.inputOffset||0,s=new Uint8Array(o,a,10),c=String.fromCharCode.apply(null,s),u,f;if(c.trim()==="CntZImage")u=e,f=1;else if(c.substring(0,5)==="Lerc2")u=t,f=2;else throw"Unexpected file identifier string: "+c;for(var h=0,p=o.byteLength-10,A,m=[],_,y,C={width:0,height:0,pixels:[],pixelType:r.pixelType,mask:null,statistics:[]};a<p;){var E=u.decode(o,{inputOffset:a,encodedMaskData:A,maskData:y,returnMask:h===0,returnEncodedMask:h===0,returnFileInfo:!0,pixelType:r.pixelType||null,noDataValue:r.noDataValue||null});a=E.fileInfo.eofOffset,h===0&&(A=E.encodedMaskData,y=E.maskData,C.width=E.width,C.height=E.height,C.dimCount=E.dimCount||1,C.pixelType=E.pixelType||E.fileInfo.pixelType,C.mask=E.maskData),f>1&&E.fileInfo.mask&&E.fileInfo.mask.numBytes>0&&m.push(E.maskData),h++,C.pixels.push(E.pixelData),C.statistics.push({minValue:E.minValue,maxValue:E.maxValue,noDataValue:E.noDataValue,dimStats:E.dimStats})}var b,x,S;if(f>1&&m.length>1){for(S=C.width*C.height,C.bandMasks=m,y=new Uint8Array(S),y.set(m[0]),b=1;b<m.length;b++)for(_=m[b],x=0;x<S;x++)y[x]=y[x]&_[x];C.maskData=y}return C}};typeof define=="function"&&define.amd?define([],function(){return i}):typeof V5<"u"&&V5.exports?V5.exports=i:this.Lerc=i})()});var Wve=ki((Zz,Nie)=>{/*! NoSleep.min.js v0.12.0 - git.io/vfn01 - Rich Tibbett - MIT license */(function(e,t){typeof Zz=="object"&&typeof Nie=="object"?Nie.exports=t():typeof define=="function"&&define.amd?define([],t):typeof Zz=="object"?Zz.NoSleep=t():e.NoSleep=t()})(Zz,(function(){return(function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(i,o,r){n.o(i,o)||Object.defineProperty(i,o,{enumerable:!0,get:r})},n.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},n.t=function(i,o){if(1&o&&(i=n(i)),8&o||4&o&&typeof i=="object"&&i&&i.__esModule)return i;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:i}),2&o&&typeof i!="string")for(var a in i)n.d(r,a,function(s){return i[s]}.bind(null,a));return r},n.n=function(i){var o=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(o,"a",o),o},n.o=function(i,o){return Object.prototype.hasOwnProperty.call(i,o)},n.p="",n(n.s=0)})([function(e,t,n){"use strict";var i=(function(){function f(h,p){for(var A=0;A<p.length;A++){var m=p[A];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(h,m.key,m)}}return function(h,p,A){return p&&f(h.prototype,p),A&&f(h,A),h}})(),o=n(1),r=o.webm,a=o.mp4,s=function(){return 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},c=function(){return"wakeLock"in navigator},u=(function(){function f(){var h=this;if((function(A,m){if(!(A instanceof m))throw new TypeError("Cannot call a class as a function")})(this,f),this.enabled=!1,c()){this._wakeLock=null;var p=function(){h._wakeLock!==null&&document.visibilityState==="visible"&&h.enable()};document.addEventListener("visibilitychange",p),document.addEventListener("fullscreenchange",p)}else s()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",r),this._addSourceToVideo(this.noSleepVideo,"mp4",a),this.noSleepVideo.addEventListener("loadedmetadata",(function(){h.noSleepVideo.duration<=1?h.noSleepVideo.setAttribute("loop",""):h.noSleepVideo.addEventListener("timeupdate",(function(){h.noSleepVideo.currentTime>.5&&(h.noSleepVideo.currentTime=Math.random())}))})))}return i(f,[{key:"_addSourceToVideo",value:function(h,p,A){var m=document.createElement("source");m.src=A,m.type="video/"+p,h.appendChild(m)}},{key:"enable",value:function(){var h=this;return c()?navigator.wakeLock.request("screen").then((function(p){h._wakeLock=p,h.enabled=!0,console.log("Wake Lock active."),h._wakeLock.addEventListener("release",(function(){console.log("Wake Lock released.")}))})).catch((function(p){throw h.enabled=!1,console.error(p.name+", "+p.message),p})):s()?(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((function(){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((function(p){return h.enabled=!0,p})).catch((function(p){throw h.enabled=!1,p}))}},{key:"disable",value:function(){c()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):s()?this.noSleepTimer&&(console.warn(`
NoSleep now disabled for older iOS devices.
`),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}},{key:"isEnabled",get:function(){return this.enabled}}]),f})();e.exports=u},function(e,t,n){"use strict";e.exports={webm:"data:video/webm;base64,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",mp4:"data:video/mp4;base64,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"}}])}))});var T1t={};Yie(T1t,{AlphaMode:()=>yp,AlphaPipelineStage:()=>TL,AnchorPointDirect:()=>BN,AnchorPointIndirect:()=>DN,Animation:()=>Az,AnimationViewModel:()=>gz,Appearance:()=>Io,ApproximateTerrainHeights:()=>Di,ArcGISTiledElevationTerrainProvider:()=>C$,ArcGisBaseMapType:()=>$h,ArcGisMapServerImageryProvider:()=>Cg,ArcGisMapService:()=>yf,ArcType:()=>ln,ArticulationStageType:()=>tl,AssociativeArray:()=>Ot,Atmosphere:()=>S0,AtmospherePipelineStage:()=>rL,AttributeCompression:()=>tn,AttributeType:()=>Ut,AutoExposure:()=>L3,AutomaticUniforms:()=>xA,Axis:()=>ao,AxisAlignedBoundingBox:()=>ff,Azure2DImageryProvider:()=>sO,B3dmLoader:()=>VN,B3dmParser:()=>UN,BaseLayerPicker:()=>Iz,BaseLayerPickerViewModel:()=>bz,BatchTable:()=>UE,BatchTableHierarchy:()=>l0,BatchTexture:()=>Gl,BatchTexturePipelineStage:()=>SL,Billboard:()=>Ro,BillboardCollection:()=>Sf,BillboardGraphics:()=>jc,BillboardLoadState:()=>Ua,BillboardTexture:()=>xg,BillboardVisualizer:()=>AR,BingMapsGeocoderService:()=>b$,BingMapsImageryProvider:()=>JL,BingMapsStyle:()=>FT,BlendEquation:()=>Tc,BlendFunction:()=>Jo,BlendOption:()=>er,BlendingState:()=>sn,BoundingRectangle:()=>et,BoundingSphere:()=>le,BoundingSphereState:()=>Ct,BoundingVolumeSemantics:()=>wy,BoxEmitter:()=>_ne,BoxGeometry:()=>Ic,BoxGeometryUpdater:()=>BM,BoxGraphics:()=>qE,BoxOutlineGeometry:()=>Rh,BrdfLutGenerator:()=>zk,Buffer:()=>tt,BufferLoader:()=>p0,BufferPoint:()=>Lu,BufferPointCollection:()=>Mg,BufferPointMaterial:()=>vg,BufferPolygon:()=>ks,BufferPolygonCollection:()=>Lg,BufferPolygonMaterial:()=>Ng,BufferPolyline:()=>Zl,BufferPolylineCollection:()=>$y,BufferPolylineMaterial:()=>Og,BufferPrimitive:()=>ta,BufferPrimitiveCollection:()=>Za,BufferPrimitiveMaterial:()=>Jl,BufferUsage:()=>Re,CPUStylingPipelineStage:()=>vL,CallbackPositionProperty:()=>DM,CallbackProperty:()=>Qh,Camera:()=>Bo,CameraEventAggregator:()=>z3,CameraEventType:()=>no,CameraFlightPath:()=>Vk,Cartesian2:()=>k,Cartesian3:()=>d,Cartesian4:()=>ie,CartesianRectangle:()=>KT,Cartographic:()=>me,CartographicGeocoderService:()=>x$,CatmullRomSpline:()=>T$,Cesium3DContentGroup:()=>c0,Cesium3DTile:()=>Wd,Cesium3DTileBatchTable:()=>Gh,Cesium3DTileColorBlendMode:()=>Tu,Cesium3DTileContent:()=>yne,Cesium3DTileContentFactory:()=>ib,Cesium3DTileContentState:()=>_r,Cesium3DTileContentType:()=>As,Cesium3DTileFeature:()=>Ns,Cesium3DTileFeatureTable:()=>Kh,Cesium3DTileOptimizationHint:()=>Ud,Cesium3DTileOptimizations:()=>dF,Cesium3DTilePass:()=>cr,Cesium3DTilePassState:()=>lh,Cesium3DTilePointFeature:()=>Tg,Cesium3DTileRefine:()=>mr,Cesium3DTileStyle:()=>Fg,Cesium3DTileStyleEngine:()=>_F,Cesium3DTilesInspector:()=>Ez,Cesium3DTilesInspectorViewModel:()=>Cz,Cesium3DTilesTerrainData:()=>Q2,Cesium3DTilesTerrainGeometryProcessor:()=>Hw,Cesium3DTilesTerrainProvider:()=>R$,Cesium3DTilesVoxelProvider:()=>Cne,Cesium3DTileset:()=>es,Cesium3DTilesetBaseTraversal:()=>xF,Cesium3DTilesetCache:()=>pF,Cesium3DTilesetGraphics:()=>t0,Cesium3DTilesetHeatmap:()=>AF,Cesium3DTilesetMetadata:()=>hb,Cesium3DTilesetMostDetailedTraversal:()=>EF,Cesium3DTilesetSkipTraversal:()=>wF,Cesium3DTilesetStatistics:()=>dm,Cesium3DTilesetTraversal:()=>Gs,Cesium3DTilesetVisualizer:()=>BF,CesiumInspector:()=>Bz,CesiumInspectorViewModel:()=>wz,CesiumTerrainProvider:()=>aI,CesiumWidget:()=>FU,Check:()=>Vo,CheckerboardMaterialProperty:()=>CS,CircleEmitter:()=>zU,CircleGeometry:()=>Q$,CircleOutlineGeometry:()=>k$,ClassificationModelDrawCommand:()=>YO,ClassificationPipelineStage:()=>wL,ClassificationPrimitive:()=>Qx,ClassificationType:()=>ei,ClearCommand:()=>fi,ClippingPlane:()=>Xa,ClippingPlaneCollection:()=>da,ClippingPolygon:()=>gT,ClippingPolygonCollection:()=>jh,Clock:()=>_m,ClockRange:()=>Ia,ClockStep:()=>Uo,ClockViewModel:()=>hz,CloudCollection:()=>Sne,CloudType:()=>xB,Color:()=>z,ColorBlendMode:()=>el,ColorGeometryInstanceAttribute:()=>Jt,ColorMaterialProperty:()=>qt,Command:()=>Cie,ComponentDatatype:()=>j,Composite3DTileContent:()=>QM,CompositeEntityCollection:()=>$X,CompositeMaterialProperty:()=>bS,CompositePositionProperty:()=>lc,CompositeProperty:()=>sl,CompressedTextureBuffer:()=>cD,ComputeCommand:()=>xl,ComputeEngine:()=>sD,ConditionsExpression:()=>Y1,ConeEmitter:()=>Bne,ConstantPositionProperty:()=>Ml,ConstantProperty:()=>hi,ConstantSpline:()=>YN,ContentMetadata:()=>iF,Context:()=>RE,ContextLimits:()=>Rt,CoplanarPolygonGeometry:()=>cQ,CoplanarPolygonGeometryLibrary:()=>Gg,CoplanarPolygonOutlineGeometry:()=>Hd,CornerType:()=>Ji,CorrelationGroup:()=>vN,CorridorGeometry:()=>_b,CorridorGeometryLibrary:()=>lo,CorridorGeometryUpdater:()=>FF,CorridorGraphics:()=>XE,CorridorOutlineGeometry:()=>OF,Credit:()=>Et,CreditDisplay:()=>Yk,CubeMap:()=>Kr,CubeMapFace:()=>_D,CubeMapPanorama:()=>jI,CubicRealPolynomial:()=>xE,CullFace:()=>Ni,CullingVolume:()=>Ka,CumulusCloud:()=>id,CustomDataSource:()=>kF,CustomHeightmapTerrainProvider:()=>U$,CustomShader:()=>UI,CustomShaderMode:()=>yg,CustomShaderPipelineStage:()=>FL,CustomShaderTranslucencyMode:()=>Uy,CylinderGeometry:()=>UF,CylinderGeometryLibrary:()=>yb,CylinderGeometryUpdater:()=>GF,CylinderGraphics:()=>JE,CylinderOutlineGeometry:()=>zF,CzmlDataSource:()=>ZF,DataSource:()=>ba,DataSourceClock:()=>ym,DataSourceCollection:()=>$F,DataSourceDisplay:()=>GQ,DebugAppearance:()=>Mne,DebugCameraPrimitive:()=>aA,DebugInspector:()=>q3,DebugModelMatrixPrimitive:()=>HU,DefaultProxy:()=>G$,DepthFunction:()=>nc,DepthPlane:()=>Xk,DequantizationPipelineStage:()=>kL,DerivedCommand:()=>sA,DeveloperError:()=>de,DeviceOrientationCameraController:()=>Jk,DirectionalLight:()=>Nne,DiscardEmptyTileImagePolicy:()=>QT,DiscardMissingTileImagePolicy:()=>KL,DistanceDisplayCondition:()=>zt,DistanceDisplayConditionGeometryInstanceAttribute:()=>$n,DoubleEndedPriorityQueue:()=>b_,DoublyLinkedList:()=>mF,DracoLoader:()=>ig,DrawCommand:()=>nt,DynamicAtmosphereLightingType:()=>lg,DynamicEnvironmentMapManager:()=>ug,DynamicGeometryBatch:()=>Sb,DynamicGeometryUpdater:()=>bi,EarthOrientationParameters:()=>$B,EarthOrientationParametersSample:()=>j_,EasingFunction:()=>Ta,EdgeDetectionPipelineStage:()=>zL,EdgeFramebuffer:()=>o3,EdgeVisibilityPipelineStage:()=>HL,EllipseGeometry:()=>ru,EllipseGeometryLibrary:()=>ku,EllipseGeometryUpdater:()=>tQ,EllipseGraphics:()=>ZE,EllipseOutlineGeometry:()=>Qf,Ellipsoid:()=>te,EllipsoidGeodesic:()=>zA,EllipsoidGeometry:()=>Hs,EllipsoidGeometryUpdater:()=>iQ,EllipsoidGraphics:()=>$E,EllipsoidOutlineGeometry:()=>vf,EllipsoidPrimitive:()=>Fk,EllipsoidRhumbLine:()=>Sc,EllipsoidSurfaceAppearance:()=>Lne,EllipsoidTangentPlane:()=>Pa,EllipsoidTerrainProvider:()=>cI,EllipsoidalOccluder:()=>Am,Empty3DTileContent:()=>sS,EncodedCartesian3:()=>xn,Entity:()=>Zo,EntityCluster:()=>Rf,EntityCollection:()=>Vs,EntityView:()=>HQ,EquirectangularPanorama:()=>One,Event:()=>_e,EventHelper:()=>kr,Expression:()=>Id,ExpressionNodeType:()=>Bt,ExtrapolationType:()=>Nf,FeatureDetection:()=>fn,FeatureIdPipelineStage:()=>ky,Fog:()=>Zk,ForEach:()=>ze,FrameRateMonitor:()=>qU,FrameState:()=>$k,Framebuffer:()=>la,FramebufferManager:()=>Ei,Frozen:()=>V,FrustumCommands:()=>r3,FrustumGeometry:()=>uI,FrustumOutlineGeometry:()=>H2,Fullscreen:()=>jr,FullscreenButton:()=>vz,FullscreenButtonViewModel:()=>Dz,GaussianSplat3DTileContent:()=>tC,GaussianSplatPrimitive:()=>nF,GaussianSplatRenderResources:()=>J1,GaussianSplatSorter:()=>tb,GaussianSplatTextureGenerator:()=>X1,GeoJsonDataSource:()=>DC,GeoJsonLoader:()=>HN,GeocodeType:()=>GC,Geocoder:()=>Rz,GeocoderService:()=>Kw,GeocoderViewModel:()=>Pz,GeographicProjection:()=>Wi,GeographicTilingScheme:()=>qi,Geometry:()=>yt,Geometry3DTileContent:()=>zM,GeometryAttribute:()=>Me,GeometryAttributes:()=>_n,GeometryFactory:()=>j$,GeometryInstance:()=>Mt,GeometryInstanceAttribute:()=>Yc,GeometryOffsetAttribute:()=>mn,GeometryPipeline:()=>Wn,GeometryPipelineStage:()=>qL,GeometryType:()=>ud,GeometryUpdater:()=>Ii,GeometryUpdaterSet:()=>Fb,GeometryVisualizer:()=>DQ,GetFeatureInfoFormat:()=>em,Globe:()=>Ok,GlobeDepth:()=>a3,GlobeSurfaceShaderSet:()=>Tk,GlobeSurfaceTile:()=>sh,GlobeSurfaceTileProvider:()=>wk,GlobeTranslucency:()=>Bk,GlobeTranslucencyFramebuffer:()=>s3,GlobeTranslucencyState:()=>e3,GltfBufferViewLoader:()=>Jx,GltfDracoLoader:()=>Zx,GltfGpmLoader:()=>RN,GltfGpmLocal:()=>CT,GltfImageLoader:()=>$x,GltfIndexBufferLoader:()=>eT,GltfJsonLoader:()=>nT,GltfLoader:()=>_f,GltfLoaderUtil:()=>Bu,GltfMeshPrimitiveGpmLoader:()=>ON,GltfSpzLoader:()=>iN,GltfStructuralMetadataLoader:()=>SN,GltfTextureLoader:()=>aT,GltfVertexBufferLoader:()=>sT,Google2DImageryProvider:()=>aO,GoogleEarthEnterpriseImageryProvider:()=>Qne,GoogleEarthEnterpriseMapsProvider:()=>eO,GoogleEarthEnterpriseMetadata:()=>x_,GoogleEarthEnterpriseTerrainData:()=>Xw,GoogleEarthEnterpriseTerrainProvider:()=>$$,GoogleEarthEnterpriseTileInformation:()=>j2,GoogleGeocoderService:()=>tee,GoogleMaps:()=>ms,GoogleStreetViewCubeMapPanoramaProvider:()=>kne,GpxDataSource:()=>b2,GregorianDate:()=>SA,GridImageryProvider:()=>Une,GridMaterialProperty:()=>RS,GroundGeometryUpdater:()=>ri,GroundPolylineGeometry:()=>HE,GroundPolylinePrimitive:()=>Mh,GroundPrimitive:()=>vl,GroupMetadata:()=>gS,HeadingPitchRange:()=>th,HeadingPitchRoll:()=>Ec,Heap:()=>KB,HeightReference:()=>it,HeightmapEncoding:()=>oh,HeightmapTerrainData:()=>Oc,HeightmapTessellator:()=>kw,HermitePolynomialApproximation:()=>VF,HermiteSpline:()=>Oy,HilbertOrder:()=>Yx,HomeButton:()=>Nz,HomeButtonViewModel:()=>Mz,HorizontalOrigin:()=>Mi,I3SBuildingSceneLayerExplorer:()=>Die,I3SBuildingSceneLayerExplorerViewModel:()=>Lz,I3SDataProvider:()=>qm,I3SDecoder:()=>KU,I3SFeature:()=>XU,I3SField:()=>JU,I3SGeometry:()=>TB,I3SLayer:()=>tx,I3SNode:()=>SB,I3SStatistics:()=>ez,I3SSublayer:()=>nz,I3SSymbology:()=>$U,I3dmLoader:()=>jN,I3dmParser:()=>WN,ITwinData:()=>Hne,ITwinPlatform:()=>rs,Iau2000Orientation:()=>q2,Iau2006XysData:()=>eD,Iau2006XysSample:()=>CE,IauOrientationAxes:()=>K2,IauOrientationParameters:()=>Y2,ImageBasedLighting:()=>s0,ImageBasedLightingPipelineStage:()=>sL,ImageMaterialProperty:()=>fy,Imagery:()=>YT,ImageryConfiguration:()=>i1,ImageryCoverage:()=>XT,ImageryFlags:()=>uO,ImageryInput:()=>dO,ImageryLayer:()=>ga,ImageryLayerCollection:()=>pb,ImageryLayerFeatureInfo:()=>Zh,ImageryPipelineStage:()=>hO,ImageryProvider:()=>Cf,ImageryState:()=>Vn,Implicit3DTileContent:()=>fT,ImplicitAvailabilityBitstream:()=>Kx,ImplicitMetadataView:()=>Xx,ImplicitSubdivisionScheme:()=>Na,ImplicitSubtree:()=>ag,ImplicitSubtreeCache:()=>kU,ImplicitSubtreeMetadata:()=>GM,ImplicitTileCoordinates:()=>Mp,ImplicitTileset:()=>Rp,IndexDatatype:()=>Ue,InfoBox:()=>Fz,InfoBoxViewModel:()=>Oz,InspectorShared:()=>Zu,InstanceAttributeSemantic:()=>Oa,InstancingPipelineStage:()=>EL,InterpolationAlgorithm:()=>iee,InterpolationType:()=>qh,Intersect:()=>Xt,IntersectionTests:()=>di,Intersections2D:()=>Om,Interval:()=>qr,InvertClassification:()=>dB,Ion:()=>Uh,IonGeocodeProviderType:()=>T_,IonGeocoderService:()=>dI,IonImageryProvider:()=>ql,IonImageryProviderFactory:()=>WT,IonResource:()=>fa,IonWorldImageryStyle:()=>bg,Iso8601:()=>Xe,JobScheduler:()=>t3,JobType:()=>Bc,JsonMetadataTable:()=>fg,JulianDate:()=>X,KTX2Transcoder:()=>lD,KeyboardEventModifier:()=>js,KeyframeNode:()=>Go,KmlCamera:()=>I2,KmlDataSource:()=>nI,KmlLookAt:()=>x2,KmlTour:()=>T2,KmlTourFlyTo:()=>w2,KmlTourWait:()=>B2,Label:()=>qy,LabelCollection:()=>Bp,LabelGraphics:()=>Lh,LabelStyle:()=>pr,LabelVisualizer:()=>vQ,LagrangePolynomialApproximation:()=>HF,LeapSecond:()=>mo,Light:()=>Wne,LightingModel:()=>Tp,LightingPipelineStage:()=>pO,LinearApproximation:()=>Eb,LinearSpline:()=>Ly,ManagedArray:()=>zl,MapMode2D:()=>uu,MapProjection:()=>aee,MapboxImageryProvider:()=>tO,MapboxStyleImageryProvider:()=>jne,MappedPositions:()=>fO,Mars3DEx:()=>bA,Material:()=>Yi,MaterialAppearance:()=>_o,MaterialPipelineStage:()=>yO,MaterialProperty:()=>wr,Math:()=>D,Matrix2:()=>ji,Matrix3:()=>J,Matrix4:()=>M,Megatexture:()=>_U,MeshPrimitiveGpmLocal:()=>LN,MetadataClass:()=>Wh,MetadataClassProperty:()=>Ap,MetadataComponentType:()=>Ft,MetadataEntity:()=>qn,MetadataEnum:()=>aN,MetadataEnumValue:()=>rN,MetadataPicking:()=>n3,MetadataPickingPipelineStage:()=>If,MetadataPipelineStage:()=>vd,MetadataSchema:()=>Vl,MetadataSchemaLoader:()=>Ty,MetadataSemantic:()=>wd,MetadataTable:()=>xd,MetadataTableProperty:()=>HM,MetadataType:()=>bt,MipmapHint:()=>hd,Model:()=>xf,Model3DTileContent:()=>Tf,ModelAlphaOptions:()=>F0,ModelAnimation:()=>JN,ModelAnimationChannel:()=>XN,ModelAnimationCollection:()=>ZN,ModelAnimationLoop:()=>Du,ModelAnimationState:()=>Xh,ModelArticulation:()=>lL,ModelArticulationStage:()=>cL,ModelClippingPlanesPipelineStage:()=>dL,ModelClippingPolygonsPipelineStage:()=>pL,ModelColorPipelineStage:()=>Qy,ModelComponents:()=>Cn,ModelDrawCommand:()=>KO,ModelDrawCommands:()=>ZO,ModelFeature:()=>$N,ModelFeatureTable:()=>tL,ModelGraphics:()=>jA,ModelImagery:()=>o1,ModelImageryMapping:()=>N0,ModelLightingOptions:()=>HO,ModelMatrixUpdateStage:()=>bL,ModelNode:()=>AL,ModelPrimitiveImagery:()=>L0,ModelReader:()=>il,ModelRenderResources:()=>FO,ModelRuntimeNode:()=>xL,ModelRuntimePrimitive:()=>LO,ModelSceneGraph:()=>$O,ModelSilhouettePipelineStage:()=>UO,ModelSkin:()=>OO,ModelSplitterPipelineStage:()=>GO,ModelStatistics:()=>e1,ModelType:()=>Fr,ModelUtility:()=>xt,ModelVisualizer:()=>PQ,Moon:()=>kk,MorphTargetsPipelineStage:()=>EO,MorphWeightSpline:()=>uee,MortonOrder:()=>oC,Multiple3DTileContent:()=>aF,MultisampleFramebuffer:()=>aR,NavigationHelpButton:()=>kz,NavigationHelpButtonViewModel:()=>Qz,NearFarScalar:()=>Ht,NeverTileDiscardPolicy:()=>qne,NodeRenderResources:()=>VO,NodeStatisticsPipelineStage:()=>IL,NodeTransformationProperty:()=>e0,OIT:()=>c3,Occluder:()=>Z2,OffsetGeometryInstanceAttribute:()=>go,OpenCageGeocoderService:()=>hee,OpenStreetMapImageryProvider:()=>Q_,OrderedGroundPrimitiveCollection:()=>eQ,OrientedBoundingBox:()=>en,OrthographicFrustum:()=>An,OrthographicOffCenterFrustum:()=>ua,Packable:()=>mee,PackableForInterpolation:()=>pee,Panorama:()=>Kne,PanoramaProvider:()=>Xne,Particle:()=>DB,ParticleBurst:()=>Zne,ParticleEmitter:()=>$ne,ParticleSystem:()=>eie,Pass:()=>Be,PassState:()=>Wc,PathGraphics:()=>YA,PathVisualizer:()=>NQ,PeliasGeocoderService:()=>J2,PerInstanceColorAppearance:()=>gn,PerformanceDisplay:()=>w_,PerformanceWatchdog:()=>zz,PerformanceWatchdogViewModel:()=>Uz,PerspectiveFrustum:()=>Vi,PerspectiveOffCenterFrustum:()=>lu,PickDepth:()=>i3,PickDepthFramebuffer:()=>u3,PickFramebuffer:()=>f3,PickId:()=>CD,PickedMetadataInfo:()=>xU,Picking:()=>A3,PickingPipelineStage:()=>bO,PinBuilder:()=>g_,PixelDatatype:()=>He,PixelFormat:()=>qe,Plane:()=>cn,PlaneGeometry:()=>oQ,PlaneGeometryUpdater:()=>aQ,PlaneGraphics:()=>EM,PlaneOutlineGeometry:()=>rQ,PntsLoader:()=>n1,PntsParser:()=>U0,PointCloud:()=>LU,PointCloudEyeDomeLighting:()=>hg,PointCloudShading:()=>Ep,PointCloudStylingPipelineStage:()=>xO,PointGraphics:()=>n0,PointPrimitive:()=>_s,PointPrimitiveCollection:()=>wS,PointVisualizer:()=>OQ,PolygonGeometry:()=>cg,PolygonGeometryLibrary:()=>ni,PolygonGeometryUpdater:()=>uQ,PolygonGraphics:()=>Oh,PolygonHierarchy:()=>wc,PolygonOutlineGeometry:()=>lQ,PolygonPipeline:()=>Ti,Polyline:()=>Ld,PolylineArrowMaterialProperty:()=>NS,PolylineCollection:()=>am,PolylineColorAppearance:()=>Ra,PolylineDashMaterialProperty:()=>OS,PolylineGeometry:()=>d_,PolylineGeometryUpdater:()=>kQ,PolylineGlowMaterialProperty:()=>QS,PolylineGraphics:()=>qc,PolylineMaterialAppearance:()=>ic,PolylineOutlineMaterialProperty:()=>dC,PolylinePipeline:()=>Xi,PolylineVisualizer:()=>zQ,PolylineVolumeGeometry:()=>hQ,PolylineVolumeGeometryLibrary:()=>hm,PolylineVolumeGeometryUpdater:()=>gQ,PolylineVolumeGraphics:()=>i0,PolylineVolumeOutlineGeometry:()=>AQ,PositionProperty:()=>Nh,PositionPropertyArray:()=>n_,PostProcessStage:()=>No,PostProcessStageCollection:()=>Q3,PostProcessStageComposite:()=>qu,PostProcessStageLibrary:()=>Jf,PostProcessStageSampleMode:()=>Xf,PostProcessStageTextureCache:()=>RI,PpeMetadata:()=>NN,PpeSource:()=>Aie,PpeTexture:()=>MN,Primitive:()=>Nn,PrimitiveCollection:()=>ou,PrimitiveLoadPlan:()=>D0,PrimitiveOutlineGenerator:()=>B0,PrimitiveOutlinePipelineStage:()=>wO,PrimitivePipeline:()=>zE,PrimitiveRenderResources:()=>WO,PrimitiveState:()=>Jr,PrimitiveStatisticsPipelineStage:()=>BO,PrimitiveType:()=>ve,ProjectionPicker:()=>Vz,ProjectionPickerViewModel:()=>Gz,Property:()=>q,PropertyArray:()=>US,PropertyAttribute:()=>w0,PropertyAttributeProperty:()=>bN,PropertyBag:()=>Ll,PropertyTable:()=>jl,PropertyTexture:()=>dg,PropertyTextureProperty:()=>EN,ProviderViewModel:()=>ur,Proxy:()=>gee,QuadraticRealPolynomial:()=>Tl,QuadtreeOccluders:()=>Dk,QuadtreePrimitive:()=>Lk,QuadtreeTile:()=>vk,QuadtreeTileLoadState:()=>Ys,QuadtreeTileProvider:()=>tie,QuantizedMeshTerrainData:()=>rI,QuarticRealPolynomial:()=>dD,Quaternion:()=>Qe,QuaternionSpline:()=>KN,Queue:()=>vy,Ray:()=>yn,Rectangle:()=>ce,RectangleCollisionChecker:()=>kb,RectangleGeometry:()=>Pb,RectangleGeometryLibrary:()=>gs,RectangleGeometryUpdater:()=>_Q,RectangleGraphics:()=>Fh,RectangleOutlineGeometry:()=>ab,ReferenceFrame:()=>Li,ReferenceProperty:()=>i_,RenderState:()=>Ve,Renderbuffer:()=>lf,RenderbufferFormat:()=>wl,Request:()=>Ir,RequestErrorEvent:()=>ep,RequestScheduler:()=>Gc,RequestState:()=>pi,RequestType:()=>ja,Resource:()=>De,ResourceCache:()=>Ri,ResourceCacheKey:()=>Hl,ResourceCacheStatistics:()=>lN,ResourceLoader:()=>Ki,ResourceLoaderState:()=>gt,Rotation:()=>Kd,RuntimeError:()=>ue,S2Cell:()=>eg,SDFSettings:()=>Qs,SampledPositionProperty:()=>fc,SampledProperty:()=>Of,Sampler:()=>jt,ScaledPositionProperty:()=>zp,Scene:()=>SU,SceneFramebuffer:()=>TI,SceneMode:()=>oe,SceneMode2DPipelineStage:()=>DO,SceneModePicker:()=>Wz,SceneModePickerViewModel:()=>Hz,SceneTransforms:()=>so,SceneTransitioner:()=>U3,ScreenSpaceCameraController:()=>V3,ScreenSpaceEventHandler:()=>qf,ScreenSpaceEventType:()=>Bn,SelectedFeatureIdPipelineStage:()=>zy,SelectionIndicator:()=>qz,SelectionIndicatorViewModel:()=>Yz,SensorVolumePortionToDisplay:()=>HS,ShaderBuilder:()=>LA,ShaderCache:()=>tR,ShaderDestination:()=>he,ShaderFunction:()=>uR,ShaderProgram:()=>$t,ShaderSource:()=>We,ShaderStruct:()=>lR,ShadowMap:()=>v_,ShadowMapShader:()=>uA,ShadowMode:()=>wn,ShadowVolumeAppearance:()=>hf,SharedContext:()=>fR,ShowGeometryInstanceAttribute:()=>Sn,Simon1994PlanetaryPositions:()=>iy,SimplePolylineGeometry:()=>Bee,SingleTileImageryProvider:()=>nO,SkinningPipelineStage:()=>PO,SkyAtmosphere:()=>wU,SkyBox:()=>DU,SpatialNode:()=>CU,Spdcf:()=>PN,SpecularEnvironmentCubeMap:()=>kh,SphereEmitter:()=>iie,SphereGeometry:()=>nk,SphereOutlineGeometry:()=>Hg,Spherical:()=>WF,Spline:()=>To,SplitDirection:()=>Lr,Splitter:()=>EB,StaticGeometryColorBatch:()=>$d,StaticGeometryPerMaterialBatch:()=>eh,StaticGroundGeometryColorBatch:()=>uw,StaticGroundGeometryPerMaterialBatch:()=>BQ,StaticGroundPolylinePerMaterialBatch:()=>UQ,StaticOutlineGeometryBatch:()=>hw,StencilConstants:()=>Yt,StencilFunction:()=>ti,StencilOperation:()=>wt,SteppedSpline:()=>qN,Stereographic:()=>$c,StorageType:()=>Ry,StripeMaterialProperty:()=>GS,StripeOrientation:()=>Cm,StructuralMetadata:()=>Os,StyleCommandsNeeded:()=>Jh,StyleExpression:()=>oie,Sun:()=>RU,SunLight:()=>NA,SunPostProcess:()=>j3,SupportedImageFormats:()=>wN,SvgPathBindingHandler:()=>fz,Sync:()=>dR,TaskProcessor:()=>Zn,Terrain:()=>az,TerrainData:()=>Wu,TerrainEncoding:()=>Cr,TerrainFillMesh:()=>aB,TerrainMesh:()=>pc,TerrainOffsetProperty:()=>o0,TerrainPicker:()=>M2,TerrainProvider:()=>jo,TerrainQuantization:()=>Ws,TerrainState:()=>Mo,Texture:()=>Dt,Texture3D:()=>hR,TextureAtlas:()=>LE,TextureCache:()=>nR,TextureMagnificationFilter:()=>ci,TextureManager:()=>hU,TextureMinificationFilter:()=>Wt,TexturePacker:()=>vx,TextureUniform:()=>mie,TextureWrap:()=>pn,TileAvailability:()=>Lm,TileBoundingRegion:()=>Df,TileBoundingS2Cell:()=>uF,TileBoundingSphere:()=>Wg,TileBoundingVolume:()=>rie,TileCoordinatesImageryProvider:()=>cz,TileDiscardPolicy:()=>sie,TileEdge:()=>Tn,TileImagery:()=>qT,TileMapServiceImageryProvider:()=>Vy,TileMetadata:()=>oF,TileOrientedBoundingBox:()=>Ou,TileProviderError:()=>$o,TileReplacementQueue:()=>Pk,TileSelectionResult:()=>ui,TileState:()=>cie,Tileset3DTileContent:()=>s1,TilesetMetadata:()=>fF,TilesetPipelineStage:()=>nL,TilingScheme:()=>Dee,TimeConstants:()=>li,TimeDynamicImagery:()=>M0,TimeDynamicPointCloud:()=>IB,TimeInterval:()=>vn,TimeIntervalCollection:()=>Ea,TimeIntervalCollectionPositionProperty:()=>o_,TimeIntervalCollectionProperty:()=>r_,TimeStandard:()=>si,Timeline:()=>Jz,TimelineHighlightRange:()=>Kz,TimelineTrack:()=>Xz,Tipsify:()=>hD,ToggleButtonViewModel:()=>aE,Tonemapper:()=>R_,TrackingReferenceFrame:()=>UA,Transforms:()=>At,TranslationRotationScale:()=>dy,TranslucentTileClassification:()=>d3,TridiagonalSystemSolver:()=>wT,TrustedServers:()=>_x,TweenCollection:()=>LI,UniformState:()=>rR,UniformType:()=>gB,UrlTemplateImageryProvider:()=>Aa,VERSION:()=>x1t,VRButton:()=>eG,VRButtonViewModel:()=>$z,VRTheWorldTerrainProvider:()=>Pee,VaryingType:()=>pie,Vector3DTileBatch:()=>mp,Vector3DTileClampedPolylines:()=>B1,Vector3DTileContent:()=>v1,Vector3DTileGeometry:()=>$A,Vector3DTilePoints:()=>E1,Vector3DTilePolygons:()=>b1,Vector3DTilePolylines:()=>Y0,Vector3DTilePrimitive:()=>d0,VectorGltf3DTileContent:()=>aS,VelocityOrientationProperty:()=>YF,VelocityVectorProperty:()=>a_,VertexArray:()=>Gn,VertexArrayFacade:()=>OA,VertexAttributeSemantic:()=>at,VertexFormat:()=>ke,VerticalExaggeration:()=>xo,VerticalExaggerationPipelineStage:()=>MO,VerticalOrigin:()=>jn,VideoSynchronizer:()=>vee,View:()=>BI,Viewer:()=>Oie,ViewportQuad:()=>lie,Visibility:()=>Vr,Visualizer:()=>d$,VoxelBoundsCollection:()=>L_,VoxelBoxShape:()=>GI,VoxelCell:()=>K3,VoxelContent:()=>zI,VoxelCylinderShape:()=>VI,VoxelEllipsoidShape:()=>HI,VoxelInspector:()=>nG,VoxelInspectorViewModel:()=>tG,VoxelMetadataOrder:()=>mA,VoxelPrimitive:()=>oE,VoxelProvider:()=>fie,VoxelRenderResources:()=>fU,VoxelShape:()=>die,VoxelShapeType:()=>_c,VoxelTraversal:()=>EU,VulkanConstants:()=>Ree,WallGeometry:()=>CQ,WallGeometryLibrary:()=>Rb,WallGeometryUpdater:()=>IQ,WallGraphics:()=>qA,WallOutlineGeometry:()=>bQ,WebGLConstants:()=>ee,WebMapServiceImageryProvider:()=>oO,WebMapTileServiceImageryProvider:()=>rO,WebMercatorProjection:()=>mi,WebMercatorTilingScheme:()=>Qa,WindingOrder:()=>Ya,WireframeIndexGenerator:()=>JT,WireframePipelineStage:()=>NO,_shadersAcesTonemappingStage:()=>g3,_shadersAdditiveBlend:()=>H3,_shadersAdjustTranslucentFS:()=>$w,_shadersAllMaterialAppearanceFS:()=>yR,_shadersAllMaterialAppearanceVS:()=>CR,_shadersAmbientOcclusionGenerate:()=>_3,_shadersAmbientOcclusionModulate:()=>y3,_shadersAspectRampMaterial:()=>TR,_shadersAtmosphereCommon:()=>Yh,_shadersAtmosphereStageFS:()=>iL,_shadersAtmosphereStageVS:()=>oL,_shadersBasicMaterialAppearanceFS:()=>ER,_shadersBasicMaterialAppearanceVS:()=>bR,_shadersBillboardCollectionFS:()=>c1,_shadersBillboardCollectionVS:()=>l1,_shadersBlackAndWhite:()=>C3,_shadersBloomComposite:()=>E3,_shadersBrdfLutGeneratorFS:()=>ok,_shadersBrightPass:()=>W3,_shadersBrightness:()=>b3,_shadersBufferPointMaterialFS:()=>R1,_shadersBufferPointMaterialVS:()=>P1,_shadersBufferPolygonMaterialFS:()=>k1,_shadersBufferPolygonMaterialVS:()=>Q1,_shadersBufferPolylineMaterialFS:()=>V1,_shadersBufferPolylineMaterialVS:()=>G1,_shadersBumpMapMaterial:()=>SR,_shadersCPUStylingStageFS:()=>DL,_shadersCPUStylingStageVS:()=>BL,_shadersCheckerboardMaterial:()=>wR,_shadersCloudCollectionFS:()=>rk,_shadersCloudCollectionVS:()=>ak,_shadersCloudNoiseFS:()=>sk,_shadersCloudNoiseVS:()=>ck,_shadersCompareAndPackTranslucentDepth:()=>lk,_shadersCompositeOITFS:()=>uk,_shadersCompositeTranslucentClassification:()=>wI,_shadersComputeIrradianceFS:()=>pN,_shadersComputeRadianceMapFS:()=>AN,_shadersConstantLodStageFS:()=>_O,_shadersConstantLodStageVS:()=>gO,_shadersContrastBias:()=>I3,_shadersConvolveSpecularMapFS:()=>gN,_shadersConvolveSpecularMapVS:()=>_N,_shadersCubeMapPanoramaVS:()=>fk,_shadersCustomShaderStageFS:()=>RL,_shadersCustomShaderStageVS:()=>PL,_shadersCzmBuiltins:()=>vE,_shadersDepthOfField:()=>x3,_shadersDepthPlaneFS:()=>dk,_shadersDepthPlaneVS:()=>hk,_shadersDepthView:()=>T3,_shadersDepthViewPacked:()=>hie,_shadersDotMaterial:()=>BR,_shadersEdgeDetection:()=>S3,_shadersEdgeDetectionStageFS:()=>UL,_shadersEdgeVisibilityStageFS:()=>GL,_shadersEdgeVisibilityStageVS:()=>VL,_shadersElevationBandMaterial:()=>DR,_shadersElevationContourMaterial:()=>vR,_shadersElevationRampMaterial:()=>PR,_shadersEllipsoidFS:()=>eB,_shadersEllipsoidSurfaceAppearanceFS:()=>WU,_shadersEllipsoidSurfaceAppearanceVS:()=>jU,_shadersEllipsoidVS:()=>tB,_shadersFXAA:()=>D3,_shadersFXAA3_11:()=>mk,_shadersFadeMaterial:()=>RR,_shadersFeatureIdStageFS:()=>ML,_shadersFeatureIdStageVS:()=>NL,_shadersFilmicTonemapping:()=>w3,_shadersGaussianBlur1D:()=>tE,_shadersGeometryStageFS:()=>WL,_shadersGeometryStageVS:()=>jL,_shadersGlobeFS:()=>pk,_shadersGlobeVS:()=>Ak,_shadersGridMaterial:()=>MR,_shadersGroundAtmosphere:()=>nB,_shadersHSBToRGB:()=>$v,_shadersHSLToRGB:()=>eP,_shadersImageBasedLightingStageFS:()=>aL,_shadersInstancingStageCommon:()=>gL,_shadersInstancingStageVS:()=>_L,_shadersIntersectBox:()=>iU,_shadersIntersectCylinder:()=>oU,_shadersIntersectDepth:()=>tU,_shadersIntersectEllipsoid:()=>rU,_shadersIntersectLongitude:()=>AB,_shadersIntersectPlane:()=>nU,_shadersIntersection:()=>QI,_shadersIntersectionUtils:()=>eU,_shadersLegacyInstancingStageVS:()=>yL,_shadersLensFlare:()=>v3,_shadersLightingStageFS:()=>mO,_shadersMaterialStageFS:()=>AO,_shadersMegatexture:()=>uU,_shadersMetadataStageFS:()=>LL,_shadersMetadataStageVS:()=>OL,_shadersModelClippingPlanesStageFS:()=>fL,_shadersModelClippingPolygonsStageFS:()=>mL,_shadersModelClippingPolygonsStageVS:()=>hL,_shadersModelColorStageFS:()=>uL,_shadersModelFS:()=>JO,_shadersModelSilhouetteStageFS:()=>QO,_shadersModelSilhouetteStageVS:()=>kO,_shadersModelSplitterStageFS:()=>zO,_shadersModelVS:()=>XO,_shadersModifiedReinhardTonemapping:()=>P3,_shadersMorphTargetsStageVS:()=>CO,_shadersNightVision:()=>R3,_shadersNormalMapMaterial:()=>NR,_shadersOctree:()=>lU,_shadersPassThrough:()=>Yu,_shadersPassThroughDepth:()=>ZC,_shadersPbrNeutralTonemapping:()=>B3,_shadersPerInstanceColorAppearanceFS:()=>WR,_shadersPerInstanceColorAppearanceVS:()=>jR,_shadersPerInstanceFlatColorAppearanceFS:()=>kE,_shadersPerInstanceFlatColorAppearanceVS:()=>YR,_shadersPointCloudEyeDomeLighting:()=>QN,_shadersPointCloudStylingStageVS:()=>IO,_shadersPointPrimitiveCollectionFS:()=>fC,_shadersPointPrimitiveCollectionVS:()=>QF,_shadersPolygonSignedDistanceFS:()=>hN,_shadersPolylineArrowMaterial:()=>LR,_shadersPolylineColorAppearanceVS:()=>cM,_shadersPolylineCommon:()=>Rl,_shadersPolylineDashMaterial:()=>OR,_shadersPolylineFS:()=>jE,_shadersPolylineGlowMaterial:()=>FR,_shadersPolylineMaterialAppearanceVS:()=>lM,_shadersPolylineOutlineMaterial:()=>QR,_shadersPolylineShadowVolumeFS:()=>oM,_shadersPolylineShadowVolumeMorphFS:()=>rM,_shadersPolylineShadowVolumeMorphVS:()=>aM,_shadersPolylineShadowVolumeVS:()=>sM,_shadersPolylineVS:()=>p1,_shadersPrimitiveGaussianSplatFS:()=>$1,_shadersPrimitiveGaussianSplatVS:()=>Z1,_shadersPrimitiveOutlineStageFS:()=>SO,_shadersPrimitiveOutlineStageVS:()=>TO,_shadersRGBToHSB:()=>SP,_shadersRGBToHSL:()=>wP,_shadersRGBToXYZ:()=>BP,_shadersReinhardTonemapping:()=>M3,_shadersReprojectWebMercatorFS:()=>cO,_shadersReprojectWebMercatorVS:()=>lO,_shadersRimLightingMaterial:()=>kR,_shadersSelectedFeatureIdStageCommon:()=>NT,_shadersShadowVolumeAppearanceFS:()=>Ox,_shadersShadowVolumeAppearanceVS:()=>XR,_shadersShadowVolumeFS:()=>cy,_shadersSilhouette:()=>N3,_shadersSkinningStageVS:()=>vO,_shadersSkyAtmosphereCommon:()=>iB,_shadersSkyAtmosphereFS:()=>gk,_shadersSkyAtmosphereVS:()=>_k,_shadersSkyBoxFS:()=>yk,_shadersSkyBoxVS:()=>Ck,_shadersSlopeRampMaterial:()=>UR,_shadersStripeMaterial:()=>zR,_shadersSunFS:()=>Ek,_shadersSunTextureFS:()=>bk,_shadersSunVS:()=>Ik,_shadersTexturedMaterialAppearanceFS:()=>IR,_shadersTexturedMaterialAppearanceVS:()=>xR,_shadersVector3DTileClampedPolylinesFS:()=>S1,_shadersVector3DTileClampedPolylinesVS:()=>T1,_shadersVector3DTilePolylinesVS:()=>I1,_shadersVectorTileVS:()=>jx,_shadersVerticalExaggerationStageVS:()=>RO,_shadersViewportQuadFS:()=>xk,_shadersViewportQuadVS:()=>EE,_shadersVoxelFS:()=>Z3,_shadersVoxelUtils:()=>J3,_shadersVoxelVS:()=>$3,_shadersWater:()=>VR,_shadersWaterMaskMaterial:()=>GR,_shadersXYZToRGB:()=>$P,_shadersacesTonemapping:()=>pv,_shadersalphaWeight:()=>Av,_shadersantialias:()=>gv,_shadersapplyHSBShift:()=>_v,_shadersapproximateSphericalCoordinates:()=>yv,_shadersapproximateTanh:()=>Cv,_shadersbackFacing:()=>Ev,_shadersbranchFreeTernary:()=>bv,_shaderscascadeColor:()=>Iv,_shaderscascadeDistance:()=>xv,_shaderscascadeMatrix:()=>Tv,_shaderscascadeWeights:()=>Sv,_shadersclipPolygons:()=>wv,_shaderscolumbusViewMorph:()=>Bv,_shaderscomputeAtmosphereColor:()=>Dv,_shaderscomputeGroundAtmosphereScattering:()=>vv,_shaderscomputePosition:()=>Pv,_shaderscomputeScattering:()=>Rv,_shaderscomputeTextureTransform:()=>Mv,_shadersconvertLocalToBoxUv:()=>aU,_shadersconvertLocalToCylinderUv:()=>sU,_shadersconvertLocalToEllipsoidUv:()=>cU,_shaderscosineAndSine:()=>Nv,_shadersdecodeRGB8:()=>Lv,_shadersdecompressTextureCoordinates:()=>Ov,_shadersdegreesPerRadian:()=>ED,_shadersdepthClamp:()=>Fv,_shadersdepthRange:()=>bD,_shadersdepthRangeStruct:()=>sv,_shaderseastNorthUpToEyeCoordinates:()=>Qv,_shadersellipsoidContainsPoint:()=>kv,_shadersellipsoidTextureCoordinates:()=>Uv,_shadersepsilon1:()=>ID,_shadersepsilon2:()=>xD,_shadersepsilon3:()=>TD,_shadersepsilon4:()=>SD,_shadersepsilon5:()=>wD,_shadersepsilon6:()=>BD,_shadersepsilon7:()=>DD,_shadersequalsEpsilon:()=>zv,_shaderseyeOffset:()=>Gv,_shaderseyeToWindowCoordinates:()=>Vv,_shadersfastApproximateAtan:()=>Hv,_shadersfog:()=>Wv,_shadersgammaCorrect:()=>jv,_shadersgeodeticSurfaceNormal:()=>Yv,_shadersgetDefaultMaterial:()=>qv,_shadersgetDynamicAtmosphereLightDirection:()=>Kv,_shadersgetLambertDiffuse:()=>Xv,_shadersgetSpecular:()=>Jv,_shadersgetWaterNoise:()=>Zv,_shadershue:()=>tP,_shadersinfinity:()=>vD,_shadersinverseGamma:()=>nP,_shadersisEmpty:()=>iP,_shadersisFull:()=>oP,_shaderslatitudeToWebMercatorFraction:()=>rP,_shaderslineDistance:()=>sP,_shaderslinearToSrgb:()=>aP,_shadersluminance:()=>cP,_shadersmaterial:()=>cv,_shadersmaterialInput:()=>lv,_shadersmaximumComponent:()=>lP,_shadersmetersPerPixel:()=>uP,_shadersmodelMaterial:()=>uv,_shadersmodelToWindowCoordinates:()=>fP,_shadersmodelVertexOutput:()=>fv,_shadersmultiplyWithColorBalance:()=>dP,_shadersnearFarScalar:()=>hP,_shadersoctDecode:()=>mP,_shadersoneOverPi:()=>PD,_shadersoneOverTwoPi:()=>RD,_shaderspackDepth:()=>pP,_shaderspassCesium3DTile:()=>MD,_shaderspassCesium3DTileClassification:()=>ND,_shaderspassCesium3DTileClassificationIgnoreShow:()=>LD,_shaderspassCesium3DTileEdges:()=>OD,_shaderspassClassification:()=>FD,_shaderspassCompute:()=>QD,_shaderspassEnvironment:()=>kD,_shaderspassGaussianSplats:()=>UD,_shaderspassGlobe:()=>zD,_shaderspassOpaque:()=>GD,_shaderspassOverlay:()=>VD,_shaderspassTerrainClassification:()=>HD,_shaderspassTranslucent:()=>WD,_shaderspassVoxels:()=>jD,_shaderspbrLighting:()=>AP,_shaderspbrNeutralTonemapping:()=>gP,_shadersphong:()=>_P,_shaderspi:()=>YD,_shaderspiOverFour:()=>qD,_shaderspiOverSix:()=>KD,_shaderspiOverThree:()=>XD,_shaderspiOverTwo:()=>JD,_shadersplaneDistance:()=>yP,_shaderspointAlongRay:()=>CP,_shadersradiansPerDegree:()=>ZD,_shadersray:()=>dv,_shadersrayEllipsoidIntersectionInterval:()=>EP,_shadersraySegment:()=>hv,_shadersraySphereIntersectionInterval:()=>bP,_shadersreadDepth:()=>IP,_shadersreadNonPerspective:()=>xP,_shadersreverseLogDepth:()=>TP,_shadersround:()=>DP,_shaderssaturation:()=>vP,_shaderssceneMode2D:()=>$D,_shaderssceneMode3D:()=>ev,_shaderssceneModeColumbusView:()=>tv,_shaderssceneModeMorphing:()=>nv,_shadersshadowDepthCompare:()=>PP,_shadersshadowParameters:()=>mv,_shadersshadowVisibility:()=>RP,_shaderssignNotZero:()=>MP,_shaderssolarRadius:()=>iv,_shaderssphericalHarmonics:()=>NP,_shaderssrgbToLinear:()=>LP,_shaderstangentToEyeSpaceMatrix:()=>OP,_shaderstextureCube:()=>FP,_shadersthreePiOver2:()=>ov,_shaderstransformPlane:()=>QP,_shaderstranslateRelativeToEye:()=>kP,_shaderstranslucentPhong:()=>UP,_shaderstranspose:()=>zP,_shaderstwoPi:()=>rv,_shadersunpackClippingExtents:()=>GP,_shadersunpackDepth:()=>VP,_shadersunpackFloat:()=>HP,_shadersunpackTexture:()=>WP,_shadersunpackUint:()=>jP,_shadersvalueTransform:()=>YP,_shadersvertexLogDepth:()=>qP,_shaderswebMercatorMaxLatitude:()=>av,_shaderswindowToEyeCoordinates:()=>KP,_shaderswriteDepthClamp:()=>XP,_shaderswriteLogDepth:()=>JP,_shaderswriteNonPerspective:()=>ZP,addAllToArray:()=>oi,addBuffer:()=>$M,addDefaults:()=>jM,addExtensionsRequired:()=>XM,addExtensionsUsed:()=>Td,addPipelineExtras:()=>Ey,addToArray:()=>ds,appendForwardSlash:()=>WB,arrayRemoveDuplicates:()=>Ho,assert:()=>o6,barycentricCoordinates:()=>IE,binarySearch:()=>Co,buildModuleUrl:()=>Zt,buildVoxelDrawCommands:()=>dU,clone:()=>je,combine:()=>Pt,computeFlyToLocationForRectangle:()=>gI,createBillboardPointCallback:()=>V0,createCommand:()=>Pn,createDefaultImageryProviderViewModels:()=>xz,createDefaultTerrainProviderViewModels:()=>Tz,createElevationBandMaterial:()=>Dne,createGooglePhotorealistic3DTileset:()=>vne,createGuid:()=>Jn,createMaterialPropertyDescriptor:()=>ar,createOsmBuildingsAsync:()=>Pne,createPropertyDescriptor:()=>Ae,createRawPropertyDescriptor:()=>Nl,createTangentSpaceDebugPrimitive:()=>Rne,createTaskProcessorWorker:()=>gie,createUniform:()=>oD,createUniformArray:()=>rD,createVectorTileBuffersFromModelComponents:()=>q1,createWorldBathymetryAsync:()=>U2,createWorldImageryAsync:()=>Ig,createWorldTerrainAsync:()=>sI,decodeGoogleEarthEnterpriseData:()=>z2,decodeVectorPolylinePositions:()=>D1,defer:()=>Au,defined:()=>l,demodernizeShader:()=>eR,deprecationWarning:()=>Ms,destroyObject:()=>fe,exportKml:()=>AZ,findAccessorMinMax:()=>E0,findContentMetadata:()=>ob,findGroupMetadata:()=>rb,findTileMetadata:()=>rF,forEachTextureInMaterial:()=>tT,formatError:()=>Ip,freezeRenderState:()=>gj,getAbsoluteUri:()=>Zm,getAccessorByteStride:()=>wu,getBaseUri:()=>jB,getBinaryAccessor:()=>bd,getClipAndStyleCode:()=>MU,getClippingFunction:()=>_I,getComponentReader:()=>rg,getElement:()=>kn,getExtensionFromUri:()=>wA,getFilenameFromUri:()=>e_,getImageFromTypedArray:()=>W2,getImagePixels:()=>Eh,getJsonFromTypedArray:()=>Br,getMagic:()=>zh,getMeshPrimitives:()=>FN,getMetadataClassProperty:()=>IU,getMetadataProperty:()=>TU,getStringFromTypedArray:()=>xu,getTimestamp:()=>Fi,hasExtension:()=>xi,heightReferenceOnEntityPropertyChanged:()=>KA,isBitSet:()=>hl,isBlobUri:()=>hE,isCrossOriginUrl:()=>q_,isDataUri:()=>bh,isLeapYear:()=>Ch,knockout:()=>xe,knockout_3_5_1:()=>nx,knockout_es5:()=>uz,loadAndExecuteScript:()=>mE,loadCubeMap:()=>cR,loadImageFromTypedArray:()=>og,loadKTX2:()=>_u,mergeSort:()=>rA,moveTechniqueRenderStates:()=>KM,moveTechniquesToExtension:()=>JM,numberOfComponentsForType:()=>gf,objectToQuery:()=>pE,oneTimeWarning:()=>It,parseBatchTable:()=>Ag,parseFeatureMetadataLegacy:()=>TN,parseGlb:()=>C0,parseResponseHeaders:()=>YB,parseStructuralMetadata:()=>xN,pickModel:()=>ZT,pointInsideTriangle:()=>Aee,preprocess3DTileContent:()=>zg,processVoxelProperties:()=>X3,queryToObject:()=>af,readAccessorPacked:()=>eN,removeExtension:()=>b0,removeExtensionsRequired:()=>YM,removeExtensionsUsed:()=>y0,removePipelineExtras:()=>qM,removeUnusedElements:()=>ZM,renderBufferPointCollection:()=>F1,renderBufferPolygonCollection:()=>z1,renderBufferPolylineCollection:()=>j1,resizeImageToNextPowerOfTwo:()=>xy,sampleTerrain:()=>$2,sampleTerrainMostDetailed:()=>hI,scaleToGeodeticSurface:()=>dE,srgbToLinear:()=>pI,subdivideArray:()=>JR,subscribeAndEvaluate:()=>yc,updateAccessorComponentTypes:()=>tN,updateVersion:()=>nN,usesExtension:()=>Or,viewerCesium3DTilesInspectorMixin:()=>Fie,viewerCesiumInspectorMixin:()=>Qie,viewerDragDropMixin:()=>Uie,viewerPerformanceWatchdogMixin:()=>zie,viewerVoxelInspectorMixin:()=>Vie,webGLConstantToGlslType:()=>Mee,wrapFunction:()=>ik,writeTextToCanvas:()=>W0});module.exports=Jm(T1t);var Kie=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],xW=1,kB=8,uE=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!==xW)throw new Error(`Got v${o} data when expected v${xW}.`);let r=Kie[i&15];if(!r)throw new Error("Unrecognized array type.");let[a]=new Uint16Array(t,2,1),[s]=new Uint32Array(t,4,1);return new e(s,a,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=Kie.indexOf(this.ArrayType),a=t*2*this.ArrayType.BYTES_PER_ELEMENT,s=t*this.IndexArrayType.BYTES_PER_ELEMENT,c=(8-s%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,kB,t),this.coords=new this.ArrayType(this.data,kB+s+c,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(kB+a+s+c),this.ids=new this.IndexArrayType(this.data,kB,t),this.coords=new this.ArrayType(this.data,kB+s+c,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(xW<<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 SW(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:a,nodeSize:s}=this,c=[0,r.length-1,0],u=[];for(;c.length;){let f=c.pop()||0,h=c.pop()||0,p=c.pop()||0;if(h-p<=s){for(let y=p;y<=h;y++){let C=a[2*y],E=a[2*y+1];C>=t&&C<=i&&E>=n&&E<=o&&u.push(r[y])}continue}let A=p+h>>1,m=a[2*A],_=a[2*A+1];m>=t&&m<=i&&_>=n&&_<=o&&u.push(r[A]),(f===0?t<=m:n<=_)&&(c.push(p),c.push(A-1),c.push(1-f)),(f===0?i>=m:o>=_)&&(c.push(A+1),c.push(h),c.push(1-f))}return u}within(t,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:r,nodeSize:a}=this,s=[0,o.length-1,0],c=[],u=i*i;for(;s.length;){let f=s.pop()||0,h=s.pop()||0,p=s.pop()||0;if(h-p<=a){for(let y=p;y<=h;y++)Xie(r[2*y],r[2*y+1],t,n)<=u&&c.push(o[y]);continue}let A=p+h>>1,m=r[2*A],_=r[2*A+1];Xie(m,_,t,n)<=u&&c.push(o[A]),(f===0?t-i<=m:n-i<=_)&&(s.push(p),s.push(A-1),s.push(1-f)),(f===0?t+i>=m:n+i>=_)&&(s.push(A+1),s.push(h),s.push(1-f))}return c}};function SW(e,t,n,i,o,r){if(o-i<=n)return;let a=i+o>>1;Jie(e,t,a,i,o,r),SW(e,t,n,i,a-1,1-r),SW(e,t,n,a+1,o,1-r)}function Jie(e,t,n,i,o,r){for(;o>i;){if(o-i>600){let u=o-i+1,f=n-i+1,h=Math.log(u),p=.5*Math.exp(2*h/3),A=.5*Math.sqrt(h*p*(u-p)/u)*(f-u/2<0?-1:1),m=Math.max(i,Math.floor(n-f*p/u+A)),_=Math.min(o,Math.floor(n+(u-f)*p/u+A));Jie(e,t,n,m,_,r)}let a=t[2*n+r],s=i,c=o;for(UB(e,t,i,n),t[2*o+r]>a&&UB(e,t,i,o);s<c;){for(UB(e,t,s,c),s++,c--;t[2*s+r]<a;)s++;for(;t[2*c+r]>a;)c--}t[2*i+r]===a?UB(e,t,i,c):(c++,UB(e,t,c,o)),c<=n&&(i=c+1),n<=c&&(o=c-1)}}function UB(e,t,n,i){TW(e,n,i),TW(t,2*n,2*i),TW(t,2*n+1,2*i+1)}function TW(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function Xie(e,t,n,i){let o=e-n,r=t-i;return o*o+r*r}var sx={},lPe={KDBush:uE,addCache:function(e,t){return sx[e]=t,t},removeCache:function(e){delete sx[e]},getCache:function(e){return sx[e]},getCacheOrAdd:function(e){return sx[e]||(sx[e]={}),sx[e]}},bA=lPe;function uPe(e){return e!=null}var l=uPe;function fE(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(fE.prototype=Object.create(Error.prototype),fE.prototype.constructor=fE);fE.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=`
${this.stack.toString()}`),e};fE.throwInstantiationError=function(){throw new fE("This function defines an interface and should not be called directly.")};var de=fE;var us={};us.typeOf={};function fPe(e){return`${e} is required, actual value was undefined`}function cx(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}us.defined=function(e,t){if(!l(t))throw new de(fPe(e))};us.typeOf.func=function(e,t){if(typeof t!="function")throw new de(cx(typeof t,"function",e))};us.typeOf.string=function(e,t){if(typeof t!="string")throw new de(cx(typeof t,"string",e))};us.typeOf.number=function(e,t){if(typeof t!="number")throw new de(cx(typeof t,"number",e))};us.typeOf.number.lessThan=function(e,t,n){if(us.typeOf.number(e,t),t>=n)throw new de(`Expected ${e} to be less than ${n}, actual value was ${t}`)};us.typeOf.number.lessThanOrEquals=function(e,t,n){if(us.typeOf.number(e,t),t>n)throw new de(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};us.typeOf.number.greaterThan=function(e,t,n){if(us.typeOf.number(e,t),t<=n)throw new de(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};us.typeOf.number.greaterThanOrEquals=function(e,t,n){if(us.typeOf.number(e,t),t<n)throw new de(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)};us.typeOf.object=function(e,t){if(typeof t!="object")throw new de(cx(typeof t,"object",e))};us.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new de(cx(typeof t,"boolean",e))};us.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new de(cx(typeof t,"bigint",e))};us.typeOf.number.equals=function(e,t,n,i){if(us.typeOf.number(e,n),us.typeOf.number(t,i),n!==i)throw new de(`${e} must be equal to ${t}, the actual values are ${n} and ${i}`)};var Vo=us;var wW=Wr(rG(),1);var pt={};pt.EPSILON1=.1;pt.EPSILON2=.01;pt.EPSILON3=.001;pt.EPSILON4=1e-4;pt.EPSILON5=1e-5;pt.EPSILON6=1e-6;pt.EPSILON7=1e-7;pt.EPSILON8=1e-8;pt.EPSILON9=1e-9;pt.EPSILON10=1e-10;pt.EPSILON11=1e-11;pt.EPSILON12=1e-12;pt.EPSILON13=1e-13;pt.EPSILON14=1e-14;pt.EPSILON15=1e-15;pt.EPSILON16=1e-16;pt.EPSILON17=1e-17;pt.EPSILON18=1e-18;pt.EPSILON19=1e-19;pt.EPSILON20=1e-20;pt.EPSILON21=1e-21;pt.GRAVITATIONALPARAMETER=3986004418e5;pt.SOLAR_RADIUS=6955e5;pt.LUNAR_RADIUS=1737400;pt.SIXTY_FOUR_KILOBYTES=64*1024;pt.FOUR_GIGABYTES=4*1024*1024*1024;pt.sign=Math.sign??function(t){return t=+t,t===0||t!==t?t:t>0?1:-1};pt.signNotZero=function(e){return e<0?-1:1};pt.toSNorm=function(e,t){return t=t??255,Math.round((pt.clamp(e,-1,1)*.5+.5)*t)};pt.fromSNorm=function(e,t){return t=t??255,pt.clamp(e,0,t)/t*2-1};pt.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:pt.clamp((e-t)/n,0,1)};pt.sinh=Math.sinh??function(t){return(Math.exp(t)-Math.exp(-t))/2};pt.cosh=Math.cosh??function(t){return(Math.exp(t)+Math.exp(-t))/2};pt.lerp=function(e,t,n){return(1-n)*e+n*t};pt.PI=Math.PI;pt.ONE_OVER_PI=1/Math.PI;pt.PI_OVER_TWO=Math.PI/2;pt.PI_OVER_THREE=Math.PI/3;pt.PI_OVER_FOUR=Math.PI/4;pt.PI_OVER_SIX=Math.PI/6;pt.THREE_PI_OVER_TWO=3*Math.PI/2;pt.TWO_PI=2*Math.PI;pt.ONE_OVER_TWO_PI=1/(2*Math.PI);pt.RADIANS_PER_DEGREE=Math.PI/180;pt.DEGREES_PER_RADIAN=180/Math.PI;pt.RADIANS_PER_ARCSECOND=pt.RADIANS_PER_DEGREE/3600;pt.toRadians=function(e){return e*pt.RADIANS_PER_DEGREE};pt.toDegrees=function(e){return e*pt.DEGREES_PER_RADIAN};pt.convertLongitudeRange=function(e){let t=pt.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};pt.clampToLatitudeRange=function(e){return pt.clamp(e,-1*pt.PI_OVER_TWO,pt.PI_OVER_TWO)};pt.negativePiToPi=function(e){return e>=-pt.PI&&e<=pt.PI?e:pt.zeroToTwoPi(e+pt.PI)-pt.PI};pt.zeroToTwoPi=function(e){if(e>=0&&e<=pt.TWO_PI)return e;let t=pt.mod(e,pt.TWO_PI);return Math.abs(t)<pt.EPSILON14&&Math.abs(e)>pt.EPSILON14?pt.TWO_PI:t};pt.mod=function(e,t){return pt.sign(e)===pt.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t};pt.equalsEpsilon=function(e,t,n,i){n=n??0,i=i??n;let o=Math.abs(e-t);return o<=i||o<=n*Math.max(Math.abs(e),Math.abs(t))};pt.lessThan=function(e,t,n){return e-t<-n};pt.lessThanOrEquals=function(e,t,n){return e-t<n};pt.greaterThan=function(e,t,n){return e-t>n};pt.greaterThanOrEquals=function(e,t,n){return e-t>-n};var aG=[1];pt.factorial=function(e){let t=aG.length;if(e>=t){let n=aG[t-1];for(let i=t;i<=e;i++){let o=n*i;aG.push(o),n=o}}return aG[e]};pt.incrementWrap=function(e,t,n){return n=n??0,++e,e>t&&(e=n),e};pt.isPowerOfTwo=function(e){return e!==0&&(e&e-1)===0};pt.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};pt.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};pt.clamp=function(e,t,n){return e<t?t:e>n?n:e};var $ie=new wW.default;pt.setRandomNumberSeed=function(e){$ie=new wW.default(e)};pt.nextRandomNumber=function(){return $ie.random()};pt.randomBetween=function(e,t){return pt.nextRandomNumber()*(t-e)+e};pt.acosClamped=function(e){return Math.acos(pt.clamp(e,-1,1))};pt.asinClamped=function(e){return Math.asin(pt.clamp(e,-1,1))};pt.chordLength=function(e,t){return 2*t*Math.sin(e*.5)};pt.logBase=function(e,t){return Math.log(e)/Math.log(t)};pt.cbrt=Math.cbrt??function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n};pt.log2=Math.log2??function(t){return Math.log(t)*Math.LOG2E};pt.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};pt.fastApproximateAtan=function(e){return e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};pt.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=pt.fastApproximateAtan(r),i=Math.abs(t)>Math.abs(e)?pt.PI_OVER_TWO-i:i,i=e<0?pt.PI-i:i,i=t<0?-i:i,i};var D=pt;var fr=class e{constructor(t,n,i){this.x=t??0,this.y=n??0,this.z=i??0}static fromSpherical(t,n){l(n)||(n=new e);let i=t.clock,o=t.cone,r=t.magnitude??1,a=r*Math.sin(o);return n.x=a*Math.cos(i),n.y=a*Math.sin(i),n.z=r*Math.cos(o),n}static fromElements(t,n,i,o){return l(o)?(o.x=t,o.y=n,o.z=i,o):new e(t,n,i)}static clone(t,n){if(l(t))return l(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n):new e(t.x,t.y,t.z)}static pack(t,n,i){return i=i??0,n[i++]=t.x,n[i++]=t.y,n[i]=t.z,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.x=t[n++],i.y=t[n++],i.z=t[n],i}static packArray(t,n){let i=t.length,o=i*3;l(n)?!Array.isArray(n)&&n.length!==o||n.length!==o&&(n.length=o):n=new Array(o);for(let r=0;r<i;++r)e.pack(t[r],n,r*3);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/3:n=new Array(i/3);for(let o=0;o<i;o+=3){let r=o/3;n[r]=e.unpack(t,o,n[r])}return n}static maximumComponent(t){return Math.max(t.x,t.y,t.z)}static minimumComponent(t){return Math.min(t.x,t.y,t.z)}static minimumByComponent(t,n,i){return i.x=Math.min(t.x,n.x),i.y=Math.min(t.y,n.y),i.z=Math.min(t.z,n.z),i}static maximumByComponent(t,n,i){return i.x=Math.max(t.x,n.x),i.y=Math.max(t.y,n.y),i.z=Math.max(t.z,n.z),i}static clamp(t,n,i,o){let r=D.clamp(t.x,n.x,i.x),a=D.clamp(t.y,n.y,i.y),s=D.clamp(t.z,n.z,i.z);return o.x=r,o.y=a,o.z=s,o}static magnitudeSquared(t){return t.x*t.x+t.y*t.y+t.z*t.z}static magnitude(t){return Math.sqrt(e.magnitudeSquared(t))}static distance(t,n){return e.subtract(t,n,sG),e.magnitude(sG)}static distanceSquared(t,n){return e.subtract(t,n,sG),e.magnitudeSquared(sG)}static normalize(t,n){let i=e.magnitude(t);return n.x=t.x/i,n.y=t.y/i,n.z=t.z/i,n}static dot(t,n){return t.x*n.x+t.y*n.y+t.z*n.z}static multiplyComponents(t,n,i){return i.x=t.x*n.x,i.y=t.y*n.y,i.z=t.z*n.z,i}static divideComponents(t,n,i){return i.x=t.x/n.x,i.y=t.y/n.y,i.z=t.z/n.z,i}static add(t,n,i){return i.x=t.x+n.x,i.y=t.y+n.y,i.z=t.z+n.z,i}static subtract(t,n,i){return i.x=t.x-n.x,i.y=t.y-n.y,i.z=t.z-n.z,i}static multiplyByScalar(t,n,i){return i.x=t.x*n,i.y=t.y*n,i.z=t.z*n,i}static divideByScalar(t,n,i){return i.x=t.x/n,i.y=t.y/n,i.z=t.z/n,i}static negate(t,n){return n.x=-t.x,n.y=-t.y,n.z=-t.z,n}static abs(t,n){return n.x=Math.abs(t.x),n.y=Math.abs(t.y),n.z=Math.abs(t.z),n}static lerp(t,n,i,o){return e.multiplyByScalar(n,i,eoe),o=e.multiplyByScalar(t,1-i,o),e.add(eoe,o,o)}static angleBetween(t,n){e.normalize(t,cG),e.normalize(n,BW);let i=e.dot(cG,BW),o=e.magnitude(e.cross(cG,BW,cG));return Math.atan2(o,i)}static mostOrthogonalAxis(t,n){let i=e.normalize(t,dPe);return e.abs(i,i),i.x<=i.y?i.x<=i.z?n=e.clone(e.UNIT_X,n):n=e.clone(e.UNIT_Z,n):i.y<=i.z?n=e.clone(e.UNIT_Y,n):n=e.clone(e.UNIT_Z,n),n}static projectVector(t,n,i){let o=e.dot(t,n)/e.dot(n,n);return e.multiplyByScalar(n,o,i)}static equals(t,n){return t===n||l(t)&&l(n)&&t.x===n.x&&t.y===n.y&&t.z===n.z}static equalsArray(t,n,i){return t.x===n[i]&&t.y===n[i+1]&&t.z===n[i+2]}static equalsEpsilon(t,n,i,o){return t===n||l(t)&&l(n)&&D.equalsEpsilon(t.x,n.x,i,o)&&D.equalsEpsilon(t.y,n.y,i,o)&&D.equalsEpsilon(t.z,n.z,i,o)}static cross(t,n,i){let o=t.x,r=t.y,a=t.z,s=n.x,c=n.y,u=n.z,f=r*u-a*c,h=a*s-o*u,p=o*c-r*s;return i.x=f,i.y=h,i.z=p,i}static midpoint(t,n,i){return i.x=(t.x+n.x)*.5,i.y=(t.y+n.y)*.5,i.z=(t.z+n.z)*.5,i}static fromDegrees(t,n,i,o,r){return t=D.toRadians(t),n=D.toRadians(n),e.fromRadians(t,n,i,o,r)}static fromRadians(t,n,i,o,r){i=i??0;let a=l(o)?o.radiiSquared:e._ellipsoidRadiiSquared,s=Math.cos(n);sd.x=s*Math.cos(t),sd.y=s*Math.sin(t),sd.z=Math.sin(n),sd=e.normalize(sd,sd),e.multiplyComponents(a,sd,lx);let c=Math.sqrt(e.dot(sd,lx));return lx=e.divideByScalar(lx,c,lx),sd=e.multiplyByScalar(sd,i,sd),l(r)||(r=new e),e.add(lx,sd,r)}static fromDegreesArray(t,n,i){let o=t.length;l(i)?i.length=o/2:i=new Array(o/2);for(let r=0;r<o;r+=2){let a=t[r],s=t[r+1],c=r/2;i[c]=e.fromDegrees(a,s,0,n,i[c])}return i}static fromRadiansArray(t,n,i){let o=t.length;l(i)?i.length=o/2:i=new Array(o/2);for(let r=0;r<o;r+=2){let a=t[r],s=t[r+1],c=r/2;i[c]=e.fromRadians(a,s,0,n,i[c])}return i}static fromDegreesArrayHeights(t,n,i){let o=t.length;l(i)?i.length=o/3:i=new Array(o/3);for(let r=0;r<o;r+=3){let a=t[r],s=t[r+1],c=t[r+2],u=r/3;i[u]=e.fromDegrees(a,s,c,n,i[u])}return i}static fromRadiansArrayHeights(t,n,i){let o=t.length;l(i)?i.length=o/3:i=new Array(o/3);for(let r=0;r<o;r+=3){let a=t[r],s=t[r+1],c=t[r+2],u=r/3;i[u]=e.fromRadians(a,s,c,n,i[u])}return i}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n,i){return e.equalsEpsilon(this,t,n,i)}toString(){return`(${this.x}, ${this.y}, ${this.z})`}};fr.fromCartesian4=fr.clone;fr.packedLength=3;fr.fromArray=fr.unpack;var sG=new fr,eoe=new fr,cG=new fr,BW=new fr,dPe=new fr,sd=new fr,lx=new fr;fr._ellipsoidRadiiSquared=new fr(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);fr.ZERO=Object.freeze(new fr(0,0,0));fr.ONE=Object.freeze(new fr(1,1,1));fr.UNIT_X=Object.freeze(new fr(1,0,0));fr.UNIT_Y=Object.freeze(new fr(0,1,0));fr.UNIT_Z=Object.freeze(new fr(0,0,1));var d=fr;var Wa=class e{constructor(t,n,i,o){this.x=t??0,this.y=n??0,this.z=i??0,this.w=o??0}static fromElements(t,n,i,o,r){return l(r)?(r.x=t,r.y=n,r.z=i,r.w=o,r):new e(t,n,i,o)}static fromColor(t,n){return l(n)?(n.x=t.red,n.y=t.green,n.z=t.blue,n.w=t.alpha,n):new e(t.red,t.green,t.blue,t.alpha)}static clone(t,n){if(l(t))return l(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w,n):new e(t.x,t.y,t.z,t.w)}static pack(t,n,i){return i=i??0,n[i++]=t.x,n[i++]=t.y,n[i++]=t.z,n[i]=t.w,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.x=t[n++],i.y=t[n++],i.z=t[n++],i.w=t[n],i}static packArray(t,n){let i=t.length,o=i*4;l(n)?!Array.isArray(n)&&n.length!==o||n.length!==o&&(n.length=o):n=new Array(o);for(let r=0;r<i;++r)e.pack(t[r],n,r*4);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/4:n=new Array(i/4);for(let o=0;o<i;o+=4){let r=o/4;n[r]=e.unpack(t,o,n[r])}return n}static maximumComponent(t){return Math.max(t.x,t.y,t.z,t.w)}static minimumComponent(t){return Math.min(t.x,t.y,t.z,t.w)}static minimumByComponent(t,n,i){return i.x=Math.min(t.x,n.x),i.y=Math.min(t.y,n.y),i.z=Math.min(t.z,n.z),i.w=Math.min(t.w,n.w),i}static maximumByComponent(t,n,i){return i.x=Math.max(t.x,n.x),i.y=Math.max(t.y,n.y),i.z=Math.max(t.z,n.z),i.w=Math.max(t.w,n.w),i}static clamp(t,n,i,o){let r=D.clamp(t.x,n.x,i.x),a=D.clamp(t.y,n.y,i.y),s=D.clamp(t.z,n.z,i.z),c=D.clamp(t.w,n.w,i.w);return o.x=r,o.y=a,o.z=s,o.w=c,o}static magnitudeSquared(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w}static magnitude(t){return Math.sqrt(e.magnitudeSquared(t))}static distance(t,n){return e.subtract(t,n,lG),e.magnitude(lG)}static distanceSquared(t,n){return e.subtract(t,n,lG),e.magnitudeSquared(lG)}static normalize(t,n){let i=e.magnitude(t);return n.x=t.x/i,n.y=t.y/i,n.z=t.z/i,n.w=t.w/i,n}static dot(t,n){return t.x*n.x+t.y*n.y+t.z*n.z+t.w*n.w}static multiplyComponents(t,n,i){return i.x=t.x*n.x,i.y=t.y*n.y,i.z=t.z*n.z,i.w=t.w*n.w,i}static divideComponents(t,n,i){return i.x=t.x/n.x,i.y=t.y/n.y,i.z=t.z/n.z,i.w=t.w/n.w,i}static add(t,n,i){return i.x=t.x+n.x,i.y=t.y+n.y,i.z=t.z+n.z,i.w=t.w+n.w,i}static subtract(t,n,i){return i.x=t.x-n.x,i.y=t.y-n.y,i.z=t.z-n.z,i.w=t.w-n.w,i}static multiplyByScalar(t,n,i){return i.x=t.x*n,i.y=t.y*n,i.z=t.z*n,i.w=t.w*n,i}static divideByScalar(t,n,i){return i.x=t.x/n,i.y=t.y/n,i.z=t.z/n,i.w=t.w/n,i}static negate(t,n){return n.x=-t.x,n.y=-t.y,n.z=-t.z,n.w=-t.w,n}static abs(t,n){return n.x=Math.abs(t.x),n.y=Math.abs(t.y),n.z=Math.abs(t.z),n.w=Math.abs(t.w),n}static lerp(t,n,i,o){return e.multiplyByScalar(n,i,toe),o=e.multiplyByScalar(t,1-i,o),e.add(toe,o,o)}static mostOrthogonalAxis(t,n){let i=e.normalize(t,hPe);return e.abs(i,i),i.x<=i.y?i.x<=i.z?i.x<=i.w?n=e.clone(e.UNIT_X,n):n=e.clone(e.UNIT_W,n):i.z<=i.w?n=e.clone(e.UNIT_Z,n):n=e.clone(e.UNIT_W,n):i.y<=i.z?i.y<=i.w?n=e.clone(e.UNIT_Y,n):n=e.clone(e.UNIT_W,n):i.z<=i.w?n=e.clone(e.UNIT_Z,n):n=e.clone(e.UNIT_W,n),n}static equals(t,n){return t===n||l(t)&&l(n)&&t.x===n.x&&t.y===n.y&&t.z===n.z&&t.w===n.w}static equalsArray(t,n,i){return t.x===n[i]&&t.y===n[i+1]&&t.z===n[i+2]&&t.w===n[i+3]}static equalsEpsilon(t,n,i,o){return t===n||l(t)&&l(n)&&D.equalsEpsilon(t.x,n.x,i,o)&&D.equalsEpsilon(t.y,n.y,i,o)&&D.equalsEpsilon(t.z,n.z,i,o)&&D.equalsEpsilon(t.w,n.w,i,o)}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n,i){return e.equalsEpsilon(this,t,n,i)}toString(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`}static packFloat(t,n){return l(n)||(n=new e),DW[0]=t,noe?(n.x=kc[0],n.y=kc[1],n.z=kc[2],n.w=kc[3]):(n.x=kc[3],n.y=kc[2],n.z=kc[1],n.w=kc[0]),n}static unpackFloat(t){return noe?(kc[0]=t.x,kc[1]=t.y,kc[2]=t.z,kc[3]=t.w):(kc[0]=t.w,kc[1]=t.z,kc[2]=t.y,kc[3]=t.x),DW[0]}};Wa.packedLength=4;Wa.fromArray=Wa.unpack;var lG=new Wa,toe=new Wa,hPe=new Wa;Wa.ZERO=Object.freeze(new Wa(0,0,0,0));Wa.ONE=Object.freeze(new Wa(1,1,1,1));Wa.UNIT_X=Object.freeze(new Wa(1,0,0,0));Wa.UNIT_Y=Object.freeze(new Wa(0,1,0,0));Wa.UNIT_Z=Object.freeze(new Wa(0,0,1,0));Wa.UNIT_W=Object.freeze(new Wa(0,0,0,1));var DW=new Float32Array(1),kc=new Uint8Array(DW.buffer),mPe=new Uint32Array([287454020]),pPe=new Uint8Array(mPe.buffer),noe=pPe[0]===68,ie=Wa;var vW={};vW.EMPTY_OBJECT=Object.freeze({});vW.EMPTY_ARRAY=Object.freeze([]);var V=vW;function ut(e,t,n,i,o,r,a,s,c){this[0]=e??0,this[1]=i??0,this[2]=a??0,this[3]=t??0,this[4]=o??0,this[5]=s??0,this[6]=n??0,this[7]=r??0,this[8]=c??0}ut.packedLength=9;ut.pack=function(e,t,n){return n=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};ut.unpack=function(e,t,n){return t=t??0,l(n)||(n=new ut),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};ut.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)ut.pack(e[o],t,o*9);return t};ut.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]=ut.unpack(e,i,t[o])}return t};ut.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 ut(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])};ut.fromArray=ut.unpack;ut.fromColumnMajorArray=function(e,t){return ut.clone(e,t)};ut.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 ut(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])};ut.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,a=e.y*e.y,s=e.y*e.z,c=e.y*e.w,u=e.z*e.z,f=e.z*e.w,h=e.w*e.w,p=n-a-u+h,A=2*(i-f),m=2*(o+c),_=2*(i+f),y=-n+a-u+h,C=2*(s-r),E=2*(o-c),b=2*(s+r),x=-n-a+u+h;return l(t)?(t[0]=p,t[1]=_,t[2]=E,t[3]=A,t[4]=y,t[5]=b,t[6]=m,t[7]=C,t[8]=x,t):new ut(p,A,m,_,y,C,E,b,x)};ut.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),a=Math.sin(-e.heading),s=Math.sin(e.roll),c=n*i,u=-o*a+s*r*i,f=s*a+o*r*i,h=n*a,p=o*i+s*r*a,A=-s*i+o*r*a,m=-r,_=s*n,y=o*n;return l(t)?(t[0]=c,t[1]=h,t[2]=m,t[3]=u,t[4]=p,t[5]=_,t[6]=f,t[7]=A,t[8]=y,t):new ut(c,u,f,h,p,A,m,_,y)};ut.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 ut(e.x,0,0,0,e.y,0,0,0,e.z)};ut.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 ut(e,0,0,0,e,0,0,0,e)};ut.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 ut(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)};ut.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 ut(1,0,0,0,n,-i,0,i,n)};ut.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 ut(n,0,i,0,1,0,-i,0,n)};ut.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 ut(n,-i,0,i,n,0,0,0,1)};ut.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]]};ut.getElementIndex=function(e,t){return e*3+t};ut.getColumn=function(e,t,n){let i=t*3,o=e[i],r=e[i+1],a=e[i+2];return n.x=o,n.y=r,n.z=a,n};ut.setColumn=function(e,t,n,i){i=ut.clone(e,i);let o=t*3;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i};ut.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};ut.setRow=function(e,t,n,i){return i=ut.clone(e,i),i[t]=n.x,i[t+3]=n.y,i[t+6]=n.z,i};var APe=new d;ut.setScale=function(e,t,n){let i=ut.getScale(e,APe),o=t.x/i.x,r=t.y/i.y,a=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]*a,n[7]=e[7]*a,n[8]=e[8]*a,n};var gPe=new d;ut.setUniformScale=function(e,t,n){let i=ut.getScale(e,gPe),o=t/i.x,r=t/i.y,a=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]*a,n[7]=e[7]*a,n[8]=e[8]*a,n};var PW=new d;ut.getScale=function(e,t){return t.x=d.magnitude(d.fromElements(e[0],e[1],e[2],PW)),t.y=d.magnitude(d.fromElements(e[3],e[4],e[5],PW)),t.z=d.magnitude(d.fromElements(e[6],e[7],e[8],PW)),t};var ioe=new d;ut.getMaximumScale=function(e){return ut.getScale(e,ioe),d.maximumComponent(ioe)};var _Pe=new d;ut.setRotation=function(e,t,n){let i=ut.getScale(e,_Pe);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 yPe=new d;ut.getRotation=function(e,t){let n=ut.getScale(e,yPe);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};ut.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],a=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],s=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],c=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],u=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],f=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],h=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=i,n[1]=o,n[2]=r,n[3]=a,n[4]=s,n[5]=c,n[6]=u,n[7]=f,n[8]=h,n};ut.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};ut.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};ut.multiplyByVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,a=e[0]*i+e[3]*o+e[6]*r,s=e[1]*i+e[4]*o+e[7]*r,c=e[2]*i+e[5]*o+e[8]*r;return n.x=a,n.y=s,n.z=c,n};ut.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};ut.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};ut.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};ut.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};ut.transpose=function(e,t){let n=e[0],i=e[3],o=e[6],r=e[1],a=e[4],s=e[7],c=e[2],u=e[5],f=e[8];return t[0]=n,t[1]=i,t[2]=o,t[3]=r,t[4]=a,t[5]=s,t[6]=c,t[7]=u,t[8]=f,t};function CPe(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var RW=[1,0,0],MW=[2,2,1];function EPe(e){let t=0;for(let n=0;n<3;++n){let i=e[ut.getElementIndex(MW[n],RW[n])];t+=2*i*i}return Math.sqrt(t)}function bPe(e,t){let n=D.EPSILON15,i=0,o=1;for(let u=0;u<3;++u){let f=Math.abs(e[ut.getElementIndex(MW[u],RW[u])]);f>i&&(o=u,i=f)}let r=1,a=0,s=RW[o],c=MW[o];if(Math.abs(e[ut.getElementIndex(c,s)])>n){let u=e[ut.getElementIndex(c,c)],f=e[ut.getElementIndex(s,s)],h=e[ut.getElementIndex(c,s)],p=(u-f)/2/h,A;p<0?A=-1/(-p+Math.sqrt(1+p*p)):A=1/(p+Math.sqrt(1+p*p)),r=1/Math.sqrt(1+A*A),a=A*r}return t=ut.clone(ut.IDENTITY,t),t[ut.getElementIndex(s,s)]=t[ut.getElementIndex(c,c)]=r,t[ut.getElementIndex(c,s)]=a,t[ut.getElementIndex(s,c)]=-a,t}var uG=new ut,ooe=new ut;ut.computeEigenDecomposition=function(e,t){let n=D.EPSILON20,i=10,o=0,r=0;l(t)||(t={});let a=t.unitary=ut.clone(ut.IDENTITY,t.unitary),s=t.diagonal=ut.clone(e,t.diagonal),c=n*CPe(s);for(;r<i&&EPe(s)>c;)bPe(s,uG),ut.transpose(uG,ooe),ut.multiply(s,uG,s),ut.multiply(ooe,s,s),ut.multiply(a,uG,a),++o>2&&(++r,o=0);return t};ut.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};ut.determinant=function(e){let t=e[0],n=e[3],i=e[6],o=e[1],r=e[4],a=e[7],s=e[2],c=e[5],u=e[8];return t*(r*u-c*a)+o*(c*i-n*u)+s*(n*a-r*i)};ut.inverse=function(e,t){let n=e[0],i=e[1],o=e[2],r=e[3],a=e[4],s=e[5],c=e[6],u=e[7],f=e[8],h=ut.determinant(e);t[0]=a*f-u*s,t[1]=u*o-i*f,t[2]=i*s-a*o,t[3]=c*s-r*f,t[4]=n*f-c*o,t[5]=r*o-n*s,t[6]=r*u-c*a,t[7]=c*i-n*u,t[8]=n*a-r*i;let p=1/h;return ut.multiplyByScalar(t,p,t)};var IPe=new ut;ut.inverseTranspose=function(e,t){return ut.inverse(ut.transpose(e,IPe),t)};ut.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]};ut.equalsEpsilon=function(e,t,n){return n=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};ut.IDENTITY=Object.freeze(new ut(1,0,0,0,1,0,0,0,1));ut.ZERO=Object.freeze(new ut(0,0,0,0,0,0,0,0,0));ut.COLUMN0ROW0=0;ut.COLUMN0ROW1=1;ut.COLUMN0ROW2=2;ut.COLUMN1ROW0=3;ut.COLUMN1ROW1=4;ut.COLUMN1ROW2=5;ut.COLUMN2ROW0=6;ut.COLUMN2ROW1=7;ut.COLUMN2ROW2=8;Object.defineProperties(ut.prototype,{length:{get:function(){return ut.packedLength}}});ut.prototype.clone=function(e){return ut.clone(this,e)};ut.prototype.equals=function(e){return ut.equals(this,e)};ut.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]};ut.prototype.equalsEpsilon=function(e,t){return ut.equalsEpsilon(this,e,t)};ut.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]})
(${this[1]}, ${this[4]}, ${this[7]})
(${this[2]}, ${this[5]}, ${this[8]})`};var J=ut;function zB(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(zB.prototype=Object.create(Error.prototype),zB.prototype.constructor=zB);zB.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=`
${this.stack.toString()}`),e};var ue=zB;function ct(e,t,n,i,o,r,a,s,c,u,f,h,p,A,m,_){this[0]=e??0,this[1]=o??0,this[2]=c??0,this[3]=p??0,this[4]=t??0,this[5]=r??0,this[6]=u??0,this[7]=A??0,this[8]=n??0,this[9]=a??0,this[10]=f??0,this[11]=m??0,this[12]=i??0,this[13]=s??0,this[14]=h??0,this[15]=_??0}ct.packedLength=16;ct.pack=function(e,t,n){return n=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};ct.unpack=function(e,t,n){return t=t??0,l(n)||(n=new ct),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};ct.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)ct.pack(e[o],t,o*16);return t};ct.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]=ct.unpack(e,i,t[o])}return t};ct.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 ct(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])};ct.fromArray=ct.unpack;ct.fromColumnMajorArray=function(e,t){return ct.clone(e,t)};ct.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 ct(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])};ct.fromRotationTranslation=function(e,t,n){return t=t??d.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 ct(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)};ct.fromTranslationQuaternionRotationScale=function(e,t,n,i){l(i)||(i=new ct);let o=n.x,r=n.y,a=n.z,s=t.x*t.x,c=t.x*t.y,u=t.x*t.z,f=t.x*t.w,h=t.y*t.y,p=t.y*t.z,A=t.y*t.w,m=t.z*t.z,_=t.z*t.w,y=t.w*t.w,C=s-h-m+y,E=2*(c-_),b=2*(u+A),x=2*(c+_),S=-s+h-m+y,B=2*(p-f),v=2*(u-A),P=2*(p+f),N=-s-h+m+y;return i[0]=C*o,i[1]=x*o,i[2]=v*o,i[3]=0,i[4]=E*r,i[5]=S*r,i[6]=P*r,i[7]=0,i[8]=b*a,i[9]=B*a,i[10]=N*a,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i};ct.fromTranslationRotationScale=function(e,t){return ct.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};ct.fromTranslation=function(e,t){return ct.fromRotationTranslation(J.IDENTITY,e,t)};ct.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 ct(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};ct.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 ct(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};ct.fromRotation=function(e,t){return l(t)||(t=new ct),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 ux=new d,fx=new d,GB=new d;ct.fromCamera=function(e,t){let n=e.position,i=e.direction,o=e.up;d.normalize(i,ux),d.normalize(d.cross(ux,o,fx),fx),d.normalize(d.cross(fx,ux,GB),GB);let r=fx.x,a=fx.y,s=fx.z,c=ux.x,u=ux.y,f=ux.z,h=GB.x,p=GB.y,A=GB.z,m=n.x,_=n.y,y=n.z,C=r*-m+a*-_+s*-y,E=h*-m+p*-_+A*-y,b=c*m+u*_+f*y;return l(t)?(t[0]=r,t[1]=h,t[2]=-c,t[3]=0,t[4]=a,t[5]=p,t[6]=-u,t[7]=0,t[8]=s,t[9]=A,t[10]=-f,t[11]=0,t[12]=C,t[13]=E,t[14]=b,t[15]=1,t):new ct(r,a,s,C,h,p,A,E,-c,-u,-f,b,0,0,0,1)};ct.computePerspectiveFieldOfView=function(e,t,n,i,o){let a=1/Math.tan(e*.5),s=a/t,c=(i+n)/(n-i),u=2*i*n/(n-i);return o[0]=s,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=a,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]=u,o[15]=0,o};ct.computeOrthographicOffCenter=function(e,t,n,i,o,r,a){let s=1/(t-e),c=1/(i-n),u=1/(r-o),f=-(t+e)*s,h=-(i+n)*c,p=-(r+o)*u;return s*=2,c*=2,u*=-2,a[0]=s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=c,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=u,a[11]=0,a[12]=f,a[13]=h,a[14]=p,a[15]=1,a};ct.computePerspectiveOffCenter=function(e,t,n,i,o,r,a){let s=2*o/(t-e),c=2*o/(i-n),u=(t+e)/(t-e),f=(i+n)/(i-n),h=-(r+o)/(r-o),p=-1,A=-2*r*o/(r-o);return a[0]=s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=c,a[6]=0,a[7]=0,a[8]=u,a[9]=f,a[10]=h,a[11]=p,a[12]=0,a[13]=0,a[14]=A,a[15]=0,a};ct.computeInfinitePerspectiveOffCenter=function(e,t,n,i,o,r){let a=2*o/(t-e),s=2*o/(i-n),c=(t+e)/(t-e),u=(i+n)/(i-n),f=-1,h=-1,p=-2*o;return r[0]=a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=s,r[6]=0,r[7]=0,r[8]=c,r[9]=u,r[10]=f,r[11]=h,r[12]=0,r[13]=0,r[14]=p,r[15]=0,r};ct.computeViewportTransformation=function(e,t,n,i){l(i)||(i=new ct),e=e??V.EMPTY_OBJECT;let o=e.x??0,r=e.y??0,a=e.width??0,s=e.height??0;t=t??0,n=n??1;let c=a*.5,u=s*.5,f=(n-t)*.5,h=c,p=u,A=f,m=o+c,_=r+u,y=t+f,C=1;return i[0]=h,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]=A,i[11]=0,i[12]=m,i[13]=_,i[14]=y,i[15]=C,i};ct.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]=-d.dot(i,e),o[13]=-d.dot(n,e),o[14]=d.dot(t,e),o[15]=1,o};ct.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]]};ct.getElementIndex=function(e,t){return e*4+t};ct.getColumn=function(e,t,n){let i=t*4,o=e[i],r=e[i+1],a=e[i+2],s=e[i+3];return n.x=o,n.y=r,n.z=a,n.w=s,n};ct.setColumn=function(e,t,n,i){i=ct.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};ct.getRow=function(e,t,n){let i=e[t],o=e[t+4],r=e[t+8],a=e[t+12];return n.x=i,n.y=o,n.z=r,n.w=a,n};ct.setRow=function(e,t,n,i){return i=ct.clone(e,i),i[t]=n.x,i[t+4]=n.y,i[t+8]=n.z,i[t+12]=n.w,i};ct.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 xPe=new d;ct.setScale=function(e,t,n){let i=ct.getScale(e,xPe),o=t.x/i.x,r=t.y/i.y,a=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]*a,n[9]=e[9]*a,n[10]=e[10]*a,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var TPe=new d;ct.setUniformScale=function(e,t,n){let i=ct.getScale(e,TPe),o=t/i.x,r=t/i.y,a=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]*a,n[9]=e[9]*a,n[10]=e[10]*a,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var NW=new d;ct.getScale=function(e,t){return t.x=d.magnitude(d.fromElements(e[0],e[1],e[2],NW)),t.y=d.magnitude(d.fromElements(e[4],e[5],e[6],NW)),t.z=d.magnitude(d.fromElements(e[8],e[9],e[10],NW)),t};var roe=new d;ct.getMaximumScale=function(e){return ct.getScale(e,roe),d.maximumComponent(roe)};var SPe=new d;ct.setRotation=function(e,t,n){let i=ct.getScale(e,SPe);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 wPe=new d;ct.getRotation=function(e,t){let n=ct.getScale(e,wPe);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};ct.multiply=function(e,t,n){let i=e[0],o=e[1],r=e[2],a=e[3],s=e[4],c=e[5],u=e[6],f=e[7],h=e[8],p=e[9],A=e[10],m=e[11],_=e[12],y=e[13],C=e[14],E=e[15],b=t[0],x=t[1],S=t[2],B=t[3],v=t[4],P=t[5],N=t[6],L=t[7],g=t[8],I=t[9],T=t[10],w=t[11],R=t[12],O=t[13],G=t[14],F=t[15],U=i*b+s*x+h*S+_*B,Q=o*b+c*x+p*S+y*B,H=r*b+u*x+A*S+C*B,Y=a*b+f*x+m*S+E*B,$=i*v+s*P+h*N+_*L,W=o*v+c*P+p*N+y*L,K=r*v+u*P+A*N+C*L,Z=a*v+f*P+m*N+E*L,pe=i*g+s*I+h*T+_*w,ge=o*g+c*I+p*T+y*w,re=r*g+u*I+A*T+C*w,ye=a*g+f*I+m*T+E*w,Ce=i*R+s*O+h*G+_*F,Pe=o*R+c*O+p*G+y*F,Ne=r*R+u*O+A*G+C*F,Le=a*R+f*O+m*G+E*F;return n[0]=U,n[1]=Q,n[2]=H,n[3]=Y,n[4]=$,n[5]=W,n[6]=K,n[7]=Z,n[8]=pe,n[9]=ge,n[10]=re,n[11]=ye,n[12]=Ce,n[13]=Pe,n[14]=Ne,n[15]=Le,n};ct.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};ct.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};ct.multiplyTransformation=function(e,t,n){let i=e[0],o=e[1],r=e[2],a=e[4],s=e[5],c=e[6],u=e[8],f=e[9],h=e[10],p=e[12],A=e[13],m=e[14],_=t[0],y=t[1],C=t[2],E=t[4],b=t[5],x=t[6],S=t[8],B=t[9],v=t[10],P=t[12],N=t[13],L=t[14],g=i*_+a*y+u*C,I=o*_+s*y+f*C,T=r*_+c*y+h*C,w=i*E+a*b+u*x,R=o*E+s*b+f*x,O=r*E+c*b+h*x,G=i*S+a*B+u*v,F=o*S+s*B+f*v,U=r*S+c*B+h*v,Q=i*P+a*N+u*L+p,H=o*P+s*N+f*L+A,Y=r*P+c*N+h*L+m;return n[0]=g,n[1]=I,n[2]=T,n[3]=0,n[4]=w,n[5]=R,n[6]=O,n[7]=0,n[8]=G,n[9]=F,n[10]=U,n[11]=0,n[12]=Q,n[13]=H,n[14]=Y,n[15]=1,n};ct.multiplyByMatrix3=function(e,t,n){let i=e[0],o=e[1],r=e[2],a=e[4],s=e[5],c=e[6],u=e[8],f=e[9],h=e[10],p=t[0],A=t[1],m=t[2],_=t[3],y=t[4],C=t[5],E=t[6],b=t[7],x=t[8],S=i*p+a*A+u*m,B=o*p+s*A+f*m,v=r*p+c*A+h*m,P=i*_+a*y+u*C,N=o*_+s*y+f*C,L=r*_+c*y+h*C,g=i*E+a*b+u*x,I=o*E+s*b+f*x,T=r*E+c*b+h*x;return n[0]=S,n[1]=B,n[2]=v,n[3]=0,n[4]=P,n[5]=N,n[6]=L,n[7]=0,n[8]=g,n[9]=I,n[10]=T,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};ct.multiplyByTranslation=function(e,t,n){let i=t.x,o=t.y,r=t.z,a=i*e[0]+o*e[4]+r*e[8]+e[12],s=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]=a,n[13]=s,n[14]=c,n[15]=e[15],n};ct.multiplyByScale=function(e,t,n){let i=t.x,o=t.y,r=t.z;return i===1&&o===1&&r===1?ct.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)};ct.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};ct.multiplyByVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,a=t.w,s=e[0]*i+e[4]*o+e[8]*r+e[12]*a,c=e[1]*i+e[5]*o+e[9]*r+e[13]*a,u=e[2]*i+e[6]*o+e[10]*r+e[14]*a,f=e[3]*i+e[7]*o+e[11]*r+e[15]*a;return n.x=s,n.y=c,n.z=u,n.w=f,n};ct.multiplyByPointAsVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,a=e[0]*i+e[4]*o+e[8]*r,s=e[1]*i+e[5]*o+e[9]*r,c=e[2]*i+e[6]*o+e[10]*r;return n.x=a,n.y=s,n.z=c,n};ct.multiplyByPoint=function(e,t,n){let i=t.x,o=t.y,r=t.z,a=e[0]*i+e[4]*o+e[8]*r+e[12],s=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=a,n.y=s,n.z=c,n};ct.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};ct.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};ct.transpose=function(e,t){let n=e[1],i=e[2],o=e[3],r=e[6],a=e[7],s=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=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]=a,t[14]=s,t[15]=e[15],t};ct.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};ct.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]};ct.equalsEpsilon=function(e,t,n){return n=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};ct.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t};ct.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 BPe=new J,DPe=new J,vPe=new ie,PPe=new ie(0,0,0,1);ct.inverse=function(e,t){let n=e[0],i=e[4],o=e[8],r=e[12],a=e[1],s=e[5],c=e[9],u=e[13],f=e[2],h=e[6],p=e[10],A=e[14],m=e[3],_=e[7],y=e[11],C=e[15],E=p*C,b=A*y,x=h*C,S=A*_,B=h*y,v=p*_,P=f*C,N=A*m,L=f*y,g=p*m,I=f*_,T=h*m,w=E*s+S*c+B*u-(b*s+x*c+v*u),R=b*a+P*c+g*u-(E*a+N*c+L*u),O=x*a+N*s+I*u-(S*a+P*s+T*u),G=v*a+L*s+T*c-(B*a+g*s+I*c),F=b*i+x*o+v*r-(E*i+S*o+B*r),U=E*n+N*o+L*r-(b*n+P*o+g*r),Q=S*n+P*i+T*r-(x*n+N*i+I*r),H=B*n+g*i+I*o-(v*n+L*i+T*o);E=o*u,b=r*c,x=i*u,S=r*s,B=i*c,v=o*s,P=n*u,N=r*a,L=n*c,g=o*a,I=n*s,T=i*a;let Y=E*_+S*y+B*C-(b*_+x*y+v*C),$=b*m+P*y+g*C-(E*m+N*y+L*C),W=x*m+N*_+I*C-(S*m+P*_+T*C),K=v*m+L*_+T*y-(B*m+g*_+I*y),Z=x*p+v*A+b*h-(B*A+E*h+S*p),pe=L*A+E*f+N*p-(P*p+g*A+b*f),ge=P*h+T*A+S*f-(I*A+x*f+N*h),re=I*p+B*f+g*h-(L*h+T*p+v*f),ye=n*w+i*R+o*O+r*G;if(Math.abs(ye)<D.EPSILON21){if(J.equalsEpsilon(ct.getMatrix3(e,BPe),DPe,D.EPSILON7)&&ie.equals(ct.getRow(e,3,vPe),PPe))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 ye=1/ye,t[0]=w*ye,t[1]=R*ye,t[2]=O*ye,t[3]=G*ye,t[4]=F*ye,t[5]=U*ye,t[6]=Q*ye,t[7]=H*ye,t[8]=Y*ye,t[9]=$*ye,t[10]=W*ye,t[11]=K*ye,t[12]=Z*ye,t[13]=pe*ye,t[14]=ge*ye,t[15]=re*ye,t};ct.inverseTransformation=function(e,t){let n=e[0],i=e[1],o=e[2],r=e[4],a=e[5],s=e[6],c=e[8],u=e[9],f=e[10],h=e[12],p=e[13],A=e[14],m=-n*h-i*p-o*A,_=-r*h-a*p-s*A,y=-c*h-u*p-f*A;return t[0]=n,t[1]=r,t[2]=c,t[3]=0,t[4]=i,t[5]=a,t[6]=u,t[7]=0,t[8]=o,t[9]=s,t[10]=f,t[11]=0,t[12]=m,t[13]=_,t[14]=y,t[15]=1,t};var RPe=new ct;ct.inverseTranspose=function(e,t){return ct.inverse(ct.transpose(e,RPe),t)};ct.IDENTITY=Object.freeze(new ct(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));ct.ZERO=Object.freeze(new ct(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));ct.COLUMN0ROW0=0;ct.COLUMN0ROW1=1;ct.COLUMN0ROW2=2;ct.COLUMN0ROW3=3;ct.COLUMN1ROW0=4;ct.COLUMN1ROW1=5;ct.COLUMN1ROW2=6;ct.COLUMN1ROW3=7;ct.COLUMN2ROW0=8;ct.COLUMN2ROW1=9;ct.COLUMN2ROW2=10;ct.COLUMN2ROW3=11;ct.COLUMN3ROW0=12;ct.COLUMN3ROW1=13;ct.COLUMN3ROW2=14;ct.COLUMN3ROW3=15;Object.defineProperties(ct.prototype,{length:{get:function(){return ct.packedLength}}});ct.prototype.clone=function(e){return ct.clone(this,e)};ct.prototype.equals=function(e){return ct.equals(this,e)};ct.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]};ct.prototype.equalsEpsilon=function(e,t){return ct.equalsEpsilon(this,e,t)};ct.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 M=ct;var MPe={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},ee=Object.freeze(MPe);var NPe=new d;function Lt(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var Zs={};Zs[ee.FLOAT]="float";Zs[ee.FLOAT_VEC2]="vec2";Zs[ee.FLOAT_VEC3]="vec3";Zs[ee.FLOAT_VEC4]="vec4";Zs[ee.INT]="int";Zs[ee.INT_VEC2]="ivec2";Zs[ee.INT_VEC3]="ivec3";Zs[ee.INT_VEC4]="ivec4";Zs[ee.BOOL]="bool";Zs[ee.BOOL_VEC2]="bvec2";Zs[ee.BOOL_VEC3]="bvec3";Zs[ee.BOOL_VEC4]="bvec4";Zs[ee.FLOAT_MAT2]="mat2";Zs[ee.FLOAT_MAT3]="mat3";Zs[ee.FLOAT_MAT4]="mat4";Zs[ee.SAMPLER_2D]="sampler2D";Zs[ee.SAMPLER_CUBE]="samplerCube";Lt.prototype.getDeclaration=function(e){let t=`uniform ${Zs[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var LPe={czm_viewport:new Lt({size:1,datatype:ee.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new Lt({size:1,datatype:ee.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_edgeIdTexture:new Lt({size:1,datatype:ee.SAMPLER_2D,getValue:function(e){return e.edgeIdTexture}}),czm_edgeColorTexture:new Lt({size:1,datatype:ee.SAMPLER_2D,getValue:function(e){return e.edgeColorTexture}}),czm_edgeDepthTexture:new Lt({size:1,datatype:ee.SAMPLER_2D,getValue:function(e){return e.edgeDepthTexture}}),czm_model:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new Lt({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new Lt({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new Lt({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new Lt({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new Lt({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new Lt({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new Lt({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new Lt({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeHeight2D:new Lt({size:1,datatype:ee.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_eyeEllipsoidNormalEC:new Lt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.eyeEllipsoidNormalEC}}),czm_eyeEllipsoidCurvature:new Lt({size:1,datatype:ee.FLOAT_VEC2,getValue:function(e){return e.eyeEllipsoidCurvature}}),czm_modelToEnu:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelToEnu}}),czm_enuToModel:new Lt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.enuToModel}}),czm_entireFrustum:new Lt({size:1,datatype:ee.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new Lt({size:1,datatype:ee.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new Lt({size:1,datatype:ee.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new Lt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new Lt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new Lt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new Lt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new Lt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new Lt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new Lt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new Lt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new Lt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new Lt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new Lt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new Lt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return M.getTranslation(e.inverseView,NPe)}}),czm_frameNumber:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new Lt({size:1,datatype:ee.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new Lt({size:1,datatype:ee.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new Lt({size:1,datatype:ee.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new Lt({size:1,datatype:ee.SAMPLER_CUBE,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapsMaximumLOD:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new Lt({size:9,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new Lt({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.fogDensity}}),czm_fogVisualDensityScalar:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.fogVisualDensityScalar}}),czm_fogMinimumBrightness:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.fogMinimumBrightness}}),czm_atmosphereHsbShift:new Lt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.atmosphereHsbShift}}),czm_atmosphereLightIntensity:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.atmosphereLightIntensity}}),czm_atmosphereRayleighCoefficient:new Lt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.atmosphereRayleighCoefficient}}),czm_atmosphereRayleighScaleHeight:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.atmosphereRayleighScaleHeight}}),czm_atmosphereMieCoefficient:new Lt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.atmosphereMieCoefficient}}),czm_atmosphereMieScaleHeight:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.atmosphereMieScaleHeight}}),czm_atmosphereMieAnisotropy:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.atmosphereMieAnisotropy}}),czm_atmosphereDynamicLighting:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.atmosphereDynamicLighting}}),czm_splitPosition:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new Lt({size:1,datatype:ee.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new Lt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new Lt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new Lt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})},xA=LPe;function OPe(){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 Jn=OPe;function FPe(){return!0}function QPe(e,t){t=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=FPe}var fe=QPe;var Bs={UNSIGNED_BYTE:ee.UNSIGNED_BYTE,UNSIGNED_SHORT:ee.UNSIGNED_SHORT,UNSIGNED_INT:ee.UNSIGNED_INT};Bs.getSizeInBytes=function(e){switch(e){case Bs.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Bs.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Bs.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}};Bs.fromSizeInBytes=function(e){switch(e){case 2:return Bs.UNSIGNED_SHORT;case 4:return Bs.UNSIGNED_INT;case 1:return Bs.UNSIGNED_BYTE}};Bs.validate=function(e){return l(e)&&(e===Bs.UNSIGNED_BYTE||e===Bs.UNSIGNED_SHORT||e===Bs.UNSIGNED_INT)};Bs.createTypedArray=function(e,t){return e>=D.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};Bs.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=D.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};Bs.fromTypedArray=function(e){if(e instanceof Uint8Array)return Bs.UNSIGNED_BYTE;if(e instanceof Uint16Array)return Bs.UNSIGNED_SHORT;if(e instanceof Uint32Array)return Bs.UNSIGNED_INT};var Ue=Object.freeze(Bs);var VB={STREAM_DRAW:ee.STREAM_DRAW,STATIC_DRAW:ee.STATIC_DRAW,DYNAMIC_DRAW:ee.DYNAMIC_DRAW,DYNAMIC_READ:ee.DYNAMIC_READ,validate:function(e){return e===VB.STREAM_DRAW||e===VB.STATIC_DRAW||e===VB.DYNAMIC_DRAW||e===VB.DYNAMIC_READ}},Re=Object.freeze(VB);function Uc(e){e=e??V.EMPTY_OBJECT;let t=e.context._gl,n=e.bufferTarget,i=e.typedArray,o=e.sizeInBytes,r=e.usage,a=l(i);a&&(o=i.byteLength);let s=t.createBuffer();t.bindBuffer(n,s),t.bufferData(n,a?i:o,r),t.bindBuffer(n,null),this._id=Jn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=o,this._usage=r,this._buffer=s,this.vertexArrayDestroyable=!0}Uc.createPixelBuffer=function(e){if(!e.context._webgl2)throw new de("A WebGL 2 context is required to create PixelBuffers.");return new Uc({context:e.context,bufferTarget:ee.PIXEL_PACK_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Uc.createVertexBuffer=function(e){return new Uc({context:e.context,bufferTarget:ee.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Uc.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=Ue.getSizeInBytes(n),o=new Uc({context:t,bufferTarget:ee.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(Uc.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});Uc.prototype._getBuffer=function(){return this._buffer};Uc.prototype._bind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,this._buffer)};Uc.prototype._unBind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,null)};Uc.prototype.copyFromArrayView=function(e,t){t=t??0;let n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)};Uc.prototype.copyFromBuffer=function(e,t,n,i){let o=ee.COPY_READ_BUFFER,r=ee.COPY_WRITE_BUFFER,a=this._gl;a.bindBuffer(r,this._buffer),a.bindBuffer(o,e._buffer),a.copyBufferSubData(o,r,t,n,i),a.bindBuffer(r,null),a.bindBuffer(o,null)};Uc.prototype.getBufferData=function(e,t,n,i){t=t??0,n=n??0;let o=this._gl,r=ee.COPY_READ_BUFFER;o.bindBuffer(r,this._buffer),o.getBufferSubData(r,t,e,n,i),o.bindBuffer(r,null)};Uc.prototype.isDestroyed=function(){return!1};Uc.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),fe(this)};var tt=Uc;var W_,aa={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},pu={};Object.defineProperties(pu,{element:{get:function(){if(pu.supportsFullscreen())return document[aa.fullscreenElement]}},changeEventName:{get:function(){if(pu.supportsFullscreen())return aa.fullscreenchange}},errorEventName:{get:function(){if(pu.supportsFullscreen())return aa.fullscreenerror}},enabled:{get:function(){if(pu.supportsFullscreen())return document[aa.fullscreenEnabled]}},fullscreen:{get:function(){if(pu.supportsFullscreen())return pu.element!==null}}});pu.supportsFullscreen=function(){if(l(W_))return W_;W_=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return aa.requestFullscreen="requestFullscreen",aa.exitFullscreen="exitFullscreen",aa.fullscreenEnabled="fullscreenEnabled",aa.fullscreenElement="fullscreenElement",aa.fullscreenchange="fullscreenchange",aa.fullscreenerror="fullscreenerror",W_=!0,W_;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"?(aa.requestFullscreen=n,W_=!0):(n=`${r}RequestFullScreen`,typeof e[n]=="function"&&(aa.requestFullscreen=n,W_=!0)),n=`${r}ExitFullscreen`,typeof document[n]=="function"?aa.exitFullscreen=n:(n=`${r}CancelFullScreen`,typeof document[n]=="function"&&(aa.exitFullscreen=n)),n=`${r}FullscreenEnabled`,document[n]!==void 0?aa.fullscreenEnabled=n:(n=`${r}FullScreenEnabled`,document[n]!==void 0&&(aa.fullscreenEnabled=n)),n=`${r}FullscreenElement`,document[n]!==void 0?aa.fullscreenElement=n:(n=`${r}FullScreenElement`,document[n]!==void 0&&(aa.fullscreenElement=n)),n=`${r}fullscreenchange`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenChange"),aa.fullscreenchange=n),n=`${r}fullscreenerror`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenError"),aa.fullscreenerror=n)}return W_};pu.requestFullscreen=function(e,t){pu.supportsFullscreen()&&e[aa.requestFullscreen]({vrDisplay:t})};pu.exitFullscreen=function(){pu.supportsFullscreen()&&document[aa.exitFullscreen]()};pu._names=aa;var jr=pu;var cd;typeof navigator<"u"?cd=navigator:cd={};function HB(e){let t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}var fG,aoe;function kW(){if(!l(fG)&&(fG=!1,!gG())){let e=/ Chrome\/([\.0-9]+)/.exec(cd.userAgent);e!==null&&(fG=!0,aoe=HB(e[1]))}return fG}function kPe(){return kW()&&aoe}var dG,soe;function coe(){if(!l(dG)&&(dG=!1,!kW()&&!gG()&&/ Safari\/[\.0-9]+/.test(cd.userAgent))){let e=/ Version\/([\.0-9]+)/.exec(cd.userAgent);e!==null&&(dG=!0,soe=HB(e[1]))}return dG}function UPe(){return coe()&&soe}var hG,QW;function loe(){if(!l(hG)){hG=!1;let e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(cd.userAgent);e!==null&&(hG=!0,QW=HB(e[1]),QW.isNightly=!!e[2])}return hG}function zPe(){return loe()&&QW}var mG,uoe;function gG(){if(!l(mG)){mG=!1;let e=/ Edg\/([\.0-9]+)/.exec(cd.userAgent);e!==null&&(mG=!0,uoe=HB(e[1]))}return mG}function GPe(){return gG()&&uoe}var pG,UW;function _G(){if(!l(pG)){pG=!1;let e=/Firefox\/([\.0-9]+)/.exec(cd.userAgent);e!==null&&(pG=!0,UW=HB(e[1]))}return pG}var LW;function VPe(){return l(LW)||(LW=/Windows/i.test(cd.appVersion)),LW}var OW;function HPe(){return l(OW)||(OW=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),OW}function WPe(){return _G()&&UW}var FW;function jPe(){return l(FW)||(FW=!_G()&&typeof PointerEvent<"u"&&(!l(cd.pointerEnabled)||cd.pointerEnabled)),FW}var foe,AG;function doe(){if(!l(AG)){let e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let t=e.style.imageRendering;AG=l(t)&&t!=="",AG&&(foe=t)}return AG}function YPe(){return doe()?foe:void 0}function Il(){return Il._result}Il._promise=void 0;Il._result=void 0;Il.initialize=function(){return l(Il._promise)||(Il._promise=new Promise(e=>{let t=new Image;t.onload=function(){Il._result=t.width>0&&t.height>0,e(Il._result)},t.onerror=function(){Il._result=!1,e(Il._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),Il._promise};Object.defineProperties(Il,{initialized:{get:function(){return l(Il._result)}}});var dx=[];typeof ArrayBuffer<"u"&&(dx.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&dx.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&dx.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&dx.push(BigInt64Array),typeof BigUint64Array<"u"&&dx.push(BigUint64Array));var ld={isChrome:kW,chromeVersion:kPe,isSafari:coe,safariVersion:UPe,isWebkit:loe,webkitVersion:zPe,isEdge:gG,edgeVersion:GPe,isFirefox:_G,firefoxVersion:WPe,isWindows:VPe,isIPadOrIOS:HPe,hardwareConcurrency:cd.hardwareConcurrency??3,supportsPointerEvents:jPe,supportsImageRenderingPixelated:doe,supportsWebP:Il,imageRenderingValue:YPe,typedArrayTypes:dx};ld.supportsBasis=function(e){return ld.supportsWebAssembly()&&e.context.supportsBasis};ld.supportsFullscreen=function(){return jr.supportsFullscreen()};ld.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};ld.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};ld.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};ld.supportsBigInt=function(){return typeof BigInt<"u"};ld.supportsWebWorkers=function(){return typeof Worker<"u"};ld.supportsWebAssembly=function(){return typeof WebAssembly<"u"};ld.supportsWebgl2=function(e){return e.context.webgl2};ld.supportsEsmWebWorkers=function(){return!_G()||parseInt(UW)>=114};var fn=ld;function zW(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 se(e,t,n,i){this.red=e??1,this.green=t??1,this.blue=n??1,this.alpha=i??1}se.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 se(e.x,e.y,e.z,e.w)};se.fromBytes=function(e,t,n,i,o){return e=se.byteToFloat(e??255),t=se.byteToFloat(t??255),n=se.byteToFloat(n??255),i=se.byteToFloat(i??255),l(o)?(o.red=e,o.green=t,o.blue=n,o.alpha=i,o):new se(e,t,n,i)};se.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 se(e.red,e.green,e.blue,t)};var GW,VW,TA;fn.supportsTypedArrays()&&(GW=new ArrayBuffer(4),VW=new Uint32Array(GW),TA=new Uint8Array(GW));se.fromRgba=function(e,t){return VW[0]=e,se.fromBytes(TA[0],TA[1],TA[2],TA[3],t)};se.fromHsl=function(e,t,n,i,o){e=(e??0)%1,t=t??0,n=n??0,i=i??1;let r=n,a=n,s=n;if(t!==0){let c;n<.5?c=n*(1+t):c=n+t-n*t;let u=2*n-c;r=zW(u,c,e+1/3),a=zW(u,c,e),s=zW(u,c,e-1/3)}return l(o)?(o.red=r,o.green=a,o.blue=s,o.alpha=i,o):new se(r,a,s,i)};se.fromRandom=function(e,t){e=e??V.EMPTY_OBJECT;let n=e.red;if(!l(n)){let a=e.minimumRed??0,s=e.maximumRed??1;n=a+D.nextRandomNumber()*(s-a)}let i=e.green;if(!l(i)){let a=e.minimumGreen??0,s=e.maximumGreen??1;i=a+D.nextRandomNumber()*(s-a)}let o=e.blue;if(!l(o)){let a=e.minimumBlue??0,s=e.maximumBlue??1;o=a+D.nextRandomNumber()*(s-a)}let r=e.alpha;if(!l(r)){let a=e.minimumAlpha??0,s=e.maximumAlpha??1;r=a+D.nextRandomNumber()*(s-a)}return l(t)?(t.red=n,t.green=i,t.blue=o,t.alpha=r,t):new se(n,i,o,r)};var qPe=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,KPe=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,XPe=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,JPe=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;se.fromCssColorString=function(e,t){l(t)||(t=new se),e=e.trim();let n=se[e.toUpperCase()];if(l(n))return se.clone(n,t),t;let i=qPe.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(i[4]??"f",16)/15,t):(i=KPe.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(i[4]??"ff",16)/255,t):(i=XPe.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(i[4]??"1.0"),t):(i=JPe.exec(e),i!==null?se.fromHsl(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(i[4]??"1.0"),t):(t=void 0,t))))};se.packedLength=4;se.pack=function(e,t,n){return n=n??0,t[n++]=e.red,t[n++]=e.green,t[n++]=e.blue,t[n]=e.alpha,t};se.unpack=function(e,t,n){return t=t??0,l(n)||(n=new se),n.red=e[t++],n.green=e[t++],n.blue=e[t++],n.alpha=e[t],n};se.byteToFloat=function(e){return e/255};se.floatToByte=function(e){return e===1?255:e*256|0};se.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 se(e.red,e.green,e.blue,e.alpha)};se.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};se.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]};se.prototype.clone=function(e){return se.clone(this,e)};se.prototype.equals=function(e){return se.equals(this,e)};se.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};se.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`};se.prototype.toCssColorString=function(){let e=se.floatToByte(this.red),t=se.floatToByte(this.green),n=se.floatToByte(this.blue);return this.alpha===1?`rgb(${e},${t},${n})`:`rgba(${e},${t},${n},${this.alpha})`};se.prototype.toCssHexString=function(){let e=se.floatToByte(this.red).toString(16);e.length<2&&(e=`0${e}`);let t=se.floatToByte(this.green).toString(16);t.length<2&&(t=`0${t}`);let n=se.floatToByte(this.blue).toString(16);if(n.length<2&&(n=`0${n}`),this.alpha<1){let i=se.floatToByte(this.alpha).toString(16);return i.length<2&&(i=`0${i}`),`#${e}${t}${n}${i}`}return`#${e}${t}${n}`};se.prototype.toBytes=function(e){let t=se.floatToByte(this.red),n=se.floatToByte(this.green),i=se.floatToByte(this.blue),o=se.floatToByte(this.alpha);return l(e)?(e[0]=t,e[1]=n,e[2]=i,e[3]=o,e):[t,n,i,o]};se.bytesToRgba=function(e,t,n,i){return TA[0]=e,TA[1]=t,TA[2]=n,TA[3]=i,VW[0]};se.prototype.toRgba=function(){return se.bytesToRgba(se.floatToByte(this.red),se.floatToByte(this.green),se.floatToByte(this.blue),se.floatToByte(this.alpha))};se.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};se.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};se.prototype.withAlpha=function(e,t){return se.fromAlpha(this,e,t)};se.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};se.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};se.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};se.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};se.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};se.lerp=function(e,t,n,i){return i.red=D.lerp(e.red,t.red,n),i.green=D.lerp(e.green,t.green,n),i.blue=D.lerp(e.blue,t.blue,n),i.alpha=D.lerp(e.alpha,t.alpha,n),i};se.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};se.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};se.ALICEBLUE=Object.freeze(se.fromCssColorString("#F0F8FF"));se.ANTIQUEWHITE=Object.freeze(se.fromCssColorString("#FAEBD7"));se.AQUA=Object.freeze(se.fromCssColorString("#00FFFF"));se.AQUAMARINE=Object.freeze(se.fromCssColorString("#7FFFD4"));se.AZURE=Object.freeze(se.fromCssColorString("#F0FFFF"));se.BEIGE=Object.freeze(se.fromCssColorString("#F5F5DC"));se.BISQUE=Object.freeze(se.fromCssColorString("#FFE4C4"));se.BLACK=Object.freeze(se.fromCssColorString("#000000"));se.BLANCHEDALMOND=Object.freeze(se.fromCssColorString("#FFEBCD"));se.BLUE=Object.freeze(se.fromCssColorString("#0000FF"));se.BLUEVIOLET=Object.freeze(se.fromCssColorString("#8A2BE2"));se.BROWN=Object.freeze(se.fromCssColorString("#A52A2A"));se.BURLYWOOD=Object.freeze(se.fromCssColorString("#DEB887"));se.CADETBLUE=Object.freeze(se.fromCssColorString("#5F9EA0"));se.CHARTREUSE=Object.freeze(se.fromCssColorString("#7FFF00"));se.CHOCOLATE=Object.freeze(se.fromCssColorString("#D2691E"));se.CORAL=Object.freeze(se.fromCssColorString("#FF7F50"));se.CORNFLOWERBLUE=Object.freeze(se.fromCssColorString("#6495ED"));se.CORNSILK=Object.freeze(se.fromCssColorString("#FFF8DC"));se.CRIMSON=Object.freeze(se.fromCssColorString("#DC143C"));se.CYAN=Object.freeze(se.fromCssColorString("#00FFFF"));se.DARKBLUE=Object.freeze(se.fromCssColorString("#00008B"));se.DARKCYAN=Object.freeze(se.fromCssColorString("#008B8B"));se.DARKGOLDENROD=Object.freeze(se.fromCssColorString("#B8860B"));se.DARKGRAY=Object.freeze(se.fromCssColorString("#A9A9A9"));se.DARKGREEN=Object.freeze(se.fromCssColorString("#006400"));se.DARKGREY=se.DARKGRAY;se.DARKKHAKI=Object.freeze(se.fromCssColorString("#BDB76B"));se.DARKMAGENTA=Object.freeze(se.fromCssColorString("#8B008B"));se.DARKOLIVEGREEN=Object.freeze(se.fromCssColorString("#556B2F"));se.DARKORANGE=Object.freeze(se.fromCssColorString("#FF8C00"));se.DARKORCHID=Object.freeze(se.fromCssColorString("#9932CC"));se.DARKRED=Object.freeze(se.fromCssColorString("#8B0000"));se.DARKSALMON=Object.freeze(se.fromCssColorString("#E9967A"));se.DARKSEAGREEN=Object.freeze(se.fromCssColorString("#8FBC8F"));se.DARKSLATEBLUE=Object.freeze(se.fromCssColorString("#483D8B"));se.DARKSLATEGRAY=Object.freeze(se.fromCssColorString("#2F4F4F"));se.DARKSLATEGREY=se.DARKSLATEGRAY;se.DARKTURQUOISE=Object.freeze(se.fromCssColorString("#00CED1"));se.DARKVIOLET=Object.freeze(se.fromCssColorString("#9400D3"));se.DEEPPINK=Object.freeze(se.fromCssColorString("#FF1493"));se.DEEPSKYBLUE=Object.freeze(se.fromCssColorString("#00BFFF"));se.DIMGRAY=Object.freeze(se.fromCssColorString("#696969"));se.DIMGREY=se.DIMGRAY;se.DODGERBLUE=Object.freeze(se.fromCssColorString("#1E90FF"));se.FIREBRICK=Object.freeze(se.fromCssColorString("#B22222"));se.FLORALWHITE=Object.freeze(se.fromCssColorString("#FFFAF0"));se.FORESTGREEN=Object.freeze(se.fromCssColorString("#228B22"));se.FUCHSIA=Object.freeze(se.fromCssColorString("#FF00FF"));se.GAINSBORO=Object.freeze(se.fromCssColorString("#DCDCDC"));se.GHOSTWHITE=Object.freeze(se.fromCssColorString("#F8F8FF"));se.GOLD=Object.freeze(se.fromCssColorString("#FFD700"));se.GOLDENROD=Object.freeze(se.fromCssColorString("#DAA520"));se.GRAY=Object.freeze(se.fromCssColorString("#808080"));se.GREEN=Object.freeze(se.fromCssColorString("#008000"));se.GREENYELLOW=Object.freeze(se.fromCssColorString("#ADFF2F"));se.GREY=se.GRAY;se.HONEYDEW=Object.freeze(se.fromCssColorString("#F0FFF0"));se.HOTPINK=Object.freeze(se.fromCssColorString("#FF69B4"));se.INDIANRED=Object.freeze(se.fromCssColorString("#CD5C5C"));se.INDIGO=Object.freeze(se.fromCssColorString("#4B0082"));se.IVORY=Object.freeze(se.fromCssColorString("#FFFFF0"));se.KHAKI=Object.freeze(se.fromCssColorString("#F0E68C"));se.LAVENDER=Object.freeze(se.fromCssColorString("#E6E6FA"));se.LAVENDAR_BLUSH=Object.freeze(se.fromCssColorString("#FFF0F5"));se.LAWNGREEN=Object.freeze(se.fromCssColorString("#7CFC00"));se.LEMONCHIFFON=Object.freeze(se.fromCssColorString("#FFFACD"));se.LIGHTBLUE=Object.freeze(se.fromCssColorString("#ADD8E6"));se.LIGHTCORAL=Object.freeze(se.fromCssColorString("#F08080"));se.LIGHTCYAN=Object.freeze(se.fromCssColorString("#E0FFFF"));se.LIGHTGOLDENRODYELLOW=Object.freeze(se.fromCssColorString("#FAFAD2"));se.LIGHTGRAY=Object.freeze(se.fromCssColorString("#D3D3D3"));se.LIGHTGREEN=Object.freeze(se.fromCssColorString("#90EE90"));se.LIGHTGREY=se.LIGHTGRAY;se.LIGHTPINK=Object.freeze(se.fromCssColorString("#FFB6C1"));se.LIGHTSEAGREEN=Object.freeze(se.fromCssColorString("#20B2AA"));se.LIGHTSKYBLUE=Object.freeze(se.fromCssColorString("#87CEFA"));se.LIGHTSLATEGRAY=Object.freeze(se.fromCssColorString("#778899"));se.LIGHTSLATEGREY=se.LIGHTSLATEGRAY;se.LIGHTSTEELBLUE=Object.freeze(se.fromCssColorString("#B0C4DE"));se.LIGHTYELLOW=Object.freeze(se.fromCssColorString("#FFFFE0"));se.LIME=Object.freeze(se.fromCssColorString("#00FF00"));se.LIMEGREEN=Object.freeze(se.fromCssColorString("#32CD32"));se.LINEN=Object.freeze(se.fromCssColorString("#FAF0E6"));se.MAGENTA=Object.freeze(se.fromCssColorString("#FF00FF"));se.MAROON=Object.freeze(se.fromCssColorString("#800000"));se.MEDIUMAQUAMARINE=Object.freeze(se.fromCssColorString("#66CDAA"));se.MEDIUMBLUE=Object.freeze(se.fromCssColorString("#0000CD"));se.MEDIUMORCHID=Object.freeze(se.fromCssColorString("#BA55D3"));se.MEDIUMPURPLE=Object.freeze(se.fromCssColorString("#9370DB"));se.MEDIUMSEAGREEN=Object.freeze(se.fromCssColorString("#3CB371"));se.MEDIUMSLATEBLUE=Object.freeze(se.fromCssColorString("#7B68EE"));se.MEDIUMSPRINGGREEN=Object.freeze(se.fromCssColorString("#00FA9A"));se.MEDIUMTURQUOISE=Object.freeze(se.fromCssColorString("#48D1CC"));se.MEDIUMVIOLETRED=Object.freeze(se.fromCssColorString("#C71585"));se.MIDNIGHTBLUE=Object.freeze(se.fromCssColorString("#191970"));se.MINTCREAM=Object.freeze(se.fromCssColorString("#F5FFFA"));se.MISTYROSE=Object.freeze(se.fromCssColorString("#FFE4E1"));se.MOCCASIN=Object.freeze(se.fromCssColorString("#FFE4B5"));se.NAVAJOWHITE=Object.freeze(se.fromCssColorString("#FFDEAD"));se.NAVY=Object.freeze(se.fromCssColorString("#000080"));se.OLDLACE=Object.freeze(se.fromCssColorString("#FDF5E6"));se.OLIVE=Object.freeze(se.fromCssColorString("#808000"));se.OLIVEDRAB=Object.freeze(se.fromCssColorString("#6B8E23"));se.ORANGE=Object.freeze(se.fromCssColorString("#FFA500"));se.ORANGERED=Object.freeze(se.fromCssColorString("#FF4500"));se.ORCHID=Object.freeze(se.fromCssColorString("#DA70D6"));se.PALEGOLDENROD=Object.freeze(se.fromCssColorString("#EEE8AA"));se.PALEGREEN=Object.freeze(se.fromCssColorString("#98FB98"));se.PALETURQUOISE=Object.freeze(se.fromCssColorString("#AFEEEE"));se.PALEVIOLETRED=Object.freeze(se.fromCssColorString("#DB7093"));se.PAPAYAWHIP=Object.freeze(se.fromCssColorString("#FFEFD5"));se.PEACHPUFF=Object.freeze(se.fromCssColorString("#FFDAB9"));se.PERU=Object.freeze(se.fromCssColorString("#CD853F"));se.PINK=Object.freeze(se.fromCssColorString("#FFC0CB"));se.PLUM=Object.freeze(se.fromCssColorString("#DDA0DD"));se.POWDERBLUE=Object.freeze(se.fromCssColorString("#B0E0E6"));se.PURPLE=Object.freeze(se.fromCssColorString("#800080"));se.RED=Object.freeze(se.fromCssColorString("#FF0000"));se.ROSYBROWN=Object.freeze(se.fromCssColorString("#BC8F8F"));se.ROYALBLUE=Object.freeze(se.fromCssColorString("#4169E1"));se.SADDLEBROWN=Object.freeze(se.fromCssColorString("#8B4513"));se.SALMON=Object.freeze(se.fromCssColorString("#FA8072"));se.SANDYBROWN=Object.freeze(se.fromCssColorString("#F4A460"));se.SEAGREEN=Object.freeze(se.fromCssColorString("#2E8B57"));se.SEASHELL=Object.freeze(se.fromCssColorString("#FFF5EE"));se.SIENNA=Object.freeze(se.fromCssColorString("#A0522D"));se.SILVER=Object.freeze(se.fromCssColorString("#C0C0C0"));se.SKYBLUE=Object.freeze(se.fromCssColorString("#87CEEB"));se.SLATEBLUE=Object.freeze(se.fromCssColorString("#6A5ACD"));se.SLATEGRAY=Object.freeze(se.fromCssColorString("#708090"));se.SLATEGREY=se.SLATEGRAY;se.SNOW=Object.freeze(se.fromCssColorString("#FFFAFA"));se.SPRINGGREEN=Object.freeze(se.fromCssColorString("#00FF7F"));se.STEELBLUE=Object.freeze(se.fromCssColorString("#4682B4"));se.TAN=Object.freeze(se.fromCssColorString("#D2B48C"));se.TEAL=Object.freeze(se.fromCssColorString("#008080"));se.THISTLE=Object.freeze(se.fromCssColorString("#D8BFD8"));se.TOMATO=Object.freeze(se.fromCssColorString("#FF6347"));se.TURQUOISE=Object.freeze(se.fromCssColorString("#40E0D0"));se.VIOLET=Object.freeze(se.fromCssColorString("#EE82EE"));se.WHEAT=Object.freeze(se.fromCssColorString("#F5DEB3"));se.WHITE=Object.freeze(se.fromCssColorString("#FFFFFF"));se.WHITESMOKE=Object.freeze(se.fromCssColorString("#F5F5F5"));se.YELLOW=Object.freeze(se.fromCssColorString("#FFFF00"));se.YELLOWGREEN=Object.freeze(se.fromCssColorString("#9ACD32"));se.TRANSPARENT=Object.freeze(new se(0,0,0,0));var z=se;function yG(e){e=e??V.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}yG.ALL=Object.freeze(new yG({color:new z(0,0,0,0),depth:1,stencil:0}));yG.prototype.execute=function(e,t){e.clear(this,t)};var fi=yG;var ZPe={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE_EDGES:4,CESIUM_3D_TILE:5,CESIUM_3D_TILE_CLASSIFICATION:6,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:7,OPAQUE:8,TRANSLUCENT:9,VOXELS:10,GAUSSIAN_SPLATS:11,OVERLAY:12,NUMBER_OF_PASSES:13},Be=Object.freeze(ZPe);function hoe(e){e=e??V.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=e.persists??!1,this.pass=Be.COMPUTE,this.owner=e.owner}hoe.prototype.execute=function(e){e.execute(this)};var xl=hoe;var sa=class e{constructor(t,n){this.x=t??0,this.y=n??0}static fromElements(t,n,i){return l(i)?(i.x=t,i.y=n,i):new e(t,n)}static clone(t,n){if(l(t))return l(n)?(n.x=t.x,n.y=t.y,n):new e(t.x,t.y)}static pack(t,n,i){return i=i??0,n[i++]=t.x,n[i]=t.y,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.x=t[n++],i.y=t[n],i}static packArray(t,n){let i=t.length,o=i*2;l(n)?!Array.isArray(n)&&n.length!==o||n.length!==o&&(n.length=o):n=new Array(o);for(let r=0;r<i;++r)e.pack(t[r],n,r*2);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/2:n=new Array(i/2);for(let o=0;o<i;o+=2){let r=o/2;n[r]=e.unpack(t,o,n[r])}return n}static maximumComponent(t){return Math.max(t.x,t.y)}static minimumComponent(t){return Math.min(t.x,t.y)}static minimumByComponent(t,n,i){return i.x=Math.min(t.x,n.x),i.y=Math.min(t.y,n.y),i}static maximumByComponent(t,n,i){return i.x=Math.max(t.x,n.x),i.y=Math.max(t.y,n.y),i}static clamp(t,n,i,o){let r=D.clamp(t.x,n.x,i.x),a=D.clamp(t.y,n.y,i.y);return o.x=r,o.y=a,o}static magnitudeSquared(t){return t.x*t.x+t.y*t.y}static magnitude(t){return Math.sqrt(e.magnitudeSquared(t))}static distance(t,n){return e.subtract(t,n,CG),e.magnitude(CG)}static distanceSquared(t,n){return e.subtract(t,n,CG),e.magnitudeSquared(CG)}static normalize(t,n){let i=e.magnitude(t);return n.x=t.x/i,n.y=t.y/i,n}static dot(t,n){return t.x*n.x+t.y*n.y}static cross(t,n){return t.x*n.y-t.y*n.x}static multiplyComponents(t,n,i){return i.x=t.x*n.x,i.y=t.y*n.y,i}static divideComponents(t,n,i){return i.x=t.x/n.x,i.y=t.y/n.y,i}static add(t,n,i){return i.x=t.x+n.x,i.y=t.y+n.y,i}static subtract(t,n,i){return i.x=t.x-n.x,i.y=t.y-n.y,i}static multiplyByScalar(t,n,i){return i.x=t.x*n,i.y=t.y*n,i}static divideByScalar(t,n,i){return i.x=t.x/n,i.y=t.y/n,i}static negate(t,n){return n.x=-t.x,n.y=-t.y,n}static abs(t,n){return n.x=Math.abs(t.x),n.y=Math.abs(t.y),n}static lerp(t,n,i,o){return e.multiplyByScalar(n,i,moe),o=e.multiplyByScalar(t,1-i,o),e.add(moe,o,o)}static angleBetween(t,n){return e.normalize(t,poe),e.normalize(n,Aoe),D.acosClamped(e.dot(poe,Aoe))}static mostOrthogonalAxis(t,n){let i=e.normalize(t,$Pe);return e.abs(i,i),i.x<=i.y?n=e.clone(e.UNIT_X,n):n=e.clone(e.UNIT_Y,n),n}static equals(t,n){return t===n||l(t)&&l(n)&&t.x===n.x&&t.y===n.y}static equalsArray(t,n,i){return t.x===n[i]&&t.y===n[i+1]}static equalsEpsilon(t,n,i,o){return t===n||l(t)&&l(n)&&D.equalsEpsilon(t.x,n.x,i,o)&&D.equalsEpsilon(t.y,n.y,i,o)}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n,i){return e.equalsEpsilon(this,t,n,i)}toString(){return`(${this.x}, ${this.y})`}};sa.fromCartesian3=sa.clone;sa.fromCartesian4=sa.clone;sa.packedLength=2;sa.fromArray=sa.unpack;var CG=new sa,moe=new sa,poe=new sa,Aoe=new sa,$Pe=new sa;sa.ZERO=Object.freeze(new sa(0,0));sa.ONE=Object.freeze(new sa(1,1));sa.UNIT_X=Object.freeze(new sa(1,0));sa.UNIT_Y=Object.freeze(new sa(0,1));var k=sa;var eRe=new d,tRe=new d;function nRe(e,t,n,i,o){let r=e.x,a=e.y,s=e.z,c=t.x,u=t.y,f=t.z,h=r*r*c*c,p=a*a*u*u,A=s*s*f*f,m=h+p+A,_=Math.sqrt(1/m),y=d.multiplyByScalar(e,_,eRe);if(m<i)return isFinite(_)?d.clone(y,o):void 0;let C=n.x,E=n.y,b=n.z,x=tRe;x.x=y.x*C*2,x.y=y.y*E*2,x.z=y.z*b*2;let S=(1-_)*d.magnitude(e)/(.5*d.magnitude(x)),B=0,v,P,N,L,g,I,T,w,R,O,G;do{S-=B,N=1/(1+S*C),L=1/(1+S*E),g=1/(1+S*b),I=N*N,T=L*L,w=g*g,R=I*N,O=T*L,G=w*g,v=h*I+p*T+A*w-1,P=h*R*C+p*O*E+A*G*b;let F=-2*P;B=v/F}while(Math.abs(v)>D.EPSILON12);return l(o)?(o.x=r*N,o.y=a*L,o.z=s*g,o):new d(r*N,a*L,s*g)}var dE=nRe;function dr(e,t,n){this.longitude=e??0,this.latitude=t??0,this.height=n??0}dr.fromRadians=function(e,t,n,i){return n=n??0,l(i)?(i.longitude=e,i.latitude=t,i.height=n,i):new dr(e,t,n)};dr.fromDegrees=function(e,t,n,i){return e=D.toRadians(e),t=D.toRadians(t),dr.fromRadians(e,t,n,i)};var iRe=new d,oRe=new d,rRe=new d;dr._ellipsoidOneOverRadii=new d(1/6378137,1/6378137,1/6356752314245179e-9);dr._ellipsoidOneOverRadiiSquared=new d(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9));dr._ellipsoidCenterToleranceSquared=D.EPSILON1;dr.fromCartesian=function(e,t,n){let i=l(t)?t.oneOverRadii:dr._ellipsoidOneOverRadii,o=l(t)?t.oneOverRadiiSquared:dr._ellipsoidOneOverRadiiSquared,r=l(t)?t._centerToleranceSquared:dr._ellipsoidCenterToleranceSquared,a=dE(e,i,o,r,oRe);if(!l(a))return;let s=d.multiplyComponents(a,o,iRe);s=d.normalize(s,s);let c=d.subtract(e,a,rRe),u=Math.atan2(s.y,s.x),f=Math.asin(s.z),h=D.sign(d.dot(c,e))*d.magnitude(c);return l(n)?(n.longitude=u,n.latitude=f,n.height=h,n):new dr(u,f,h)};dr.toCartesian=function(e,t,n){return d.fromRadians(e.longitude,e.latitude,e.height,t,n)};dr.clone=function(e,t){if(l(e))return l(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new dr(e.longitude,e.latitude,e.height)};dr.equals=function(e,t){return e===t||l(e)&&l(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height};dr.equalsEpsilon=function(e,t,n){return n=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};dr.ZERO=Object.freeze(new dr(0,0,0));dr.prototype.clone=function(e){return dr.clone(this,e)};dr.prototype.equals=function(e){return dr.equals(this,e)};dr.prototype.equalsEpsilon=function(e,t){return dr.equalsEpsilon(this,e,t)};dr.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var me=dr;function _oe(e,t,n,i){t=t??0,n=n??0,i=i??0,e._radii=new d(t,n,i),e._radiiSquared=new d(t*t,n*n,i*i),e._radiiToTheFourth=new d(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new d(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new d(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=D.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function Bi(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,_oe(this,e,t,n)}Object.defineProperties(Bi.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}}});Bi.clone=function(e,t){if(!l(e))return;let n=e._radii;return l(t)?(d.clone(n,t._radii),d.clone(e._radiiSquared,t._radiiSquared),d.clone(e._radiiToTheFourth,t._radiiToTheFourth),d.clone(e._oneOverRadii,t._oneOverRadii),d.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new Bi(n.x,n.y,n.z)};Bi.fromCartesian3=function(e,t){return l(t)||(t=new Bi),l(e)&&_oe(t,e.x,e.y,e.z),t};Bi.WGS84=Object.freeze(new Bi(6378137,6378137,6356752314245179e-9));Bi.UNIT_SPHERE=Object.freeze(new Bi(1,1,1));Bi.MOON=Object.freeze(new Bi(D.LUNAR_RADIUS,D.LUNAR_RADIUS,D.LUNAR_RADIUS));Bi.MARS=Object.freeze(new Bi(3396190,3396190,3376200));Bi._default=Bi.WGS84;Object.defineProperties(Bi,{default:{get:function(){return Bi._default},set:function(e){Bi._default=e,d._ellipsoidRadiiSquared=e.radiiSquared,me._ellipsoidOneOverRadii=e.oneOverRadii,me._ellipsoidOneOverRadiiSquared=e.oneOverRadiiSquared,me._ellipsoidCenterToleranceSquared=e._centerToleranceSquared}}});Bi.prototype.clone=function(e){return Bi.clone(this,e)};Bi.packedLength=d.packedLength;Bi.pack=function(e,t,n){return n=n??0,d.pack(e._radii,t,n),t};Bi.unpack=function(e,t,n){t=t??0;let i=d.unpack(e,t);return Bi.fromCartesian3(i,n)};Bi.prototype.geocentricSurfaceNormal=d.normalize;Bi.prototype.geodeticSurfaceNormalCartographic=function(e,t){let n=e.longitude,i=e.latitude,o=Math.cos(i),r=o*Math.cos(n),a=o*Math.sin(n),s=Math.sin(i);return l(t)||(t=new d),t.x=r,t.y=a,t.z=s,d.normalize(t,t)};Bi.prototype.geodeticSurfaceNormal=function(e,t){if(!d.equalsEpsilon(e,d.ZERO,D.EPSILON14))return l(t)||(t=new d),t=d.multiplyComponents(e,this._oneOverRadiiSquared,t),d.normalize(t,t)};var aRe=new d,sRe=new d;Bi.prototype.cartographicToCartesian=function(e,t){let n=aRe,i=sRe;this.geodeticSurfaceNormalCartographic(e,n),d.multiplyComponents(this._radiiSquared,n,i);let o=Math.sqrt(d.dot(n,i));return d.divideByScalar(i,o,i),d.multiplyByScalar(n,e.height,n),l(t)||(t=new d),d.add(i,n,t)};Bi.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 cRe=new d,lRe=new d,uRe=new d;Bi.prototype.cartesianToCartographic=function(e,t){let n=this.scaleToGeodeticSurface(e,lRe);if(!l(n))return;let i=this.geodeticSurfaceNormal(n,cRe),o=d.subtract(e,n,uRe),r=Math.atan2(i.y,i.x),a=Math.asin(i.z),s=D.sign(d.dot(o,e))*d.magnitude(o);return l(t)?(t.longitude=r,t.latitude=a,t.height=s,t):new me(r,a,s)};Bi.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};Bi.prototype.scaleToGeodeticSurface=function(e,t){return dE(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)};Bi.prototype.scaleToGeocentricSurface=function(e,t){l(t)||(t=new d);let n=e.x,i=e.y,o=e.z,r=this._oneOverRadiiSquared,a=1/Math.sqrt(n*n*r.x+i*i*r.y+o*o*r.z);return d.multiplyByScalar(e,a,t)};Bi.prototype.transformPositionToScaledSpace=function(e,t){return l(t)||(t=new d),d.multiplyComponents(e,this._oneOverRadii,t)};Bi.prototype.transformPositionFromScaledSpace=function(e,t){return l(t)||(t=new d),d.multiplyComponents(e,this._radii,t)};Bi.prototype.equals=function(e){return this===e||l(e)&&d.equals(this._radii,e._radii)};Bi.prototype.toString=function(){return this._radii.toString()};Bi.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,n){t=t??0;let i=this._squaredXOverSquaredZ;if(l(n)||(n=new d),n.x=0,n.y=0,n.z=e.z*(1-i),!(Math.abs(n.z)>=this._radii.z-t))return n};var fRe=new d;Bi.prototype.getLocalCurvature=function(e,t){l(t)||(t=new k);let n=this.getSurfaceNormalIntersectionWithZAxis(e,0,fRe),i=d.distance(e,n),o=this.minimumRadius*i/this.maximumRadius**2,r=i*o**2;return k.fromElements(1/i,1/r,t)};var dRe=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],hRe=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function goe(e,t,n){let i=.5*(t+e),o=.5*(t-e),r=0;for(let a=0;a<5;a++){let s=o*dRe[a];r+=hRe[a]*(n(i+s)+n(i-s))}return r*=o,r}Bi.prototype.surfaceArea=function(e){let t=e.west,n=e.east,i=e.south,o=e.north;for(;n<t;)n+=D.TWO_PI;let r=this._radiiSquared,a=r.x,s=r.y,c=r.z,u=a*s;return goe(i,o,function(f){let h=Math.cos(f),p=Math.sin(f);return Math.cos(f)*goe(t,n,function(A){let m=Math.cos(A),_=Math.sin(A);return Math.sqrt(u*p*p+c*(s*m*m+a*_*_)*h*h)})})};var te=Bi;function EG(e){this._ellipsoid=e??te.default,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(EG.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});EG.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 d(i,o,r)};EG.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 me(i,o,r)};var Wi=EG;var mRe={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},Xt=Object.freeze(mRe);function pRe(e,t,n){let i=0,o=e.length-1,r,a;for(;i<=o;){if(r=~~((i+o)/2),a=n(e[r],t),a<0){i=r+1;continue}if(a>0){o=r-1;continue}return r}return~(o+1)}var Co=pRe;function ARe(e,t,n,i,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=o}var j_=ARe;function gRe(e){return e%4===0&&e%100!==0||e%400===0}var Ch=gRe;var yoe=[31,28,31,30,31,30,31,31,30,31,30,31];function _Re(e,t,n,i,o,r,a,s){e=e??1,t=t??1,n=n??1,i=i??0,o=o??0,r=r??0,a=a??0,s=s??!1,this.year=e,this.month=t,this.day=n,this.hour=i,this.minute=o,this.second=r,this.millisecond=a,this.isLeapSecond=s;function _(){Vo.typeOf.number.greaterThanOrEquals("Year",e,1),Vo.typeOf.number.lessThanOrEquals("Year",e,9999),Vo.typeOf.number.greaterThanOrEquals("Month",t,1),Vo.typeOf.number.lessThanOrEquals("Month",t,12),Vo.typeOf.number.greaterThanOrEquals("Day",n,1),Vo.typeOf.number.lessThanOrEquals("Day",n,31),Vo.typeOf.number.greaterThanOrEquals("Hour",i,0),Vo.typeOf.number.lessThanOrEquals("Hour",i,23),Vo.typeOf.number.greaterThanOrEquals("Minute",o,0),Vo.typeOf.number.lessThanOrEquals("Minute",o,59),Vo.typeOf.bool("IsLeapSecond",s),Vo.typeOf.number.greaterThanOrEquals("Second",r,0),Vo.typeOf.number.lessThanOrEquals("Second",r,s?60:59),Vo.typeOf.number.greaterThanOrEquals("Millisecond",a,0),Vo.typeOf.number.lessThan("Millisecond",a,1e3)}function y(){let C=t===2&&Ch(e)?yoe[t-1]+1:yoe[t-1];if(n>C)throw new de("Month and Day represents invalid date")}}var SA=_Re;function yRe(e,t){this.julianDate=e,this.offset=t}var mo=yRe;var CRe={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},li=Object.freeze(CRe);var ERe={UTC:0,TAI:1},si=Object.freeze(ERe);var Eoe=new SA,HW=[31,28,31,30,31,30,31,31,30,31,30,31],WW=29;function jW(e,t){return kt.compare(e.julianDate,t.julianDate)}var hx=new mo;function IG(e){hx.julianDate=e;let t=kt.leapSeconds,n=Co(t,hx,jW);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&kt.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),kt.addSeconds(e,i,e)}function Coe(e,t){hx.julianDate=e;let n=kt.leapSeconds,i=Co(n,hx,jW);if(i<0&&(i=~i),i===0)return kt.addSeconds(e,-n[0].offset,t);if(i>=n.length)return kt.addSeconds(e,-n[i-1].offset,t);let o=kt.secondsDifference(n[i].julianDate,e);if(o===0)return kt.addSeconds(e,-n[i].offset,t);if(!(o<=1))return kt.addSeconds(e,-n[--i].offset,t)}function Y_(e,t,n){let i=t/li.SECONDS_PER_DAY|0;return e+=i,t-=li.SECONDS_PER_DAY*i,t<0&&(e--,t+=li.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function YW(e,t,n,i,o,r,a){let s=(t-14)/12|0,c=e+4800+s,u=(1461*c/4|0)+(367*(t-2-12*s)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);let f=r+(i*li.SECONDS_PER_HOUR+o*li.SECONDS_PER_MINUTE+a*li.SECONDS_PER_MILLISECOND);return f>=43200&&(u-=1),[u,f]}var bRe=/^(\d{4})$/,IRe=/^(\d{4})-(\d{2})$/,xRe=/^(\d{4})-?(\d{3})$/,TRe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,SRe=/^(\d{4})-?(\d{2})-?(\d{2})$/,qW=/([Z+\-])?(\d{2})?:?(\d{2})?$/,wRe=/^(\d{2})(\.\d+)?/.source+qW.source,BRe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+qW.source,DRe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+qW.source;function kt(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=e??0,t=t??0,n=n??si.UTC;let i=e|0;t=t+(e-i)*li.SECONDS_PER_DAY,Y_(i,t,this),n===si.UTC&&IG(this)}kt.fromGregorianDate=function(e,t){let n=YW(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return l(t)?(Y_(n[0],n[1],t),IG(t),t):new kt(n[0],n[1],si.UTC)};kt.fromDate=function(e,t){let n=YW(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return l(t)?(Y_(n[0],n[1],t),IG(t),t):new kt(n[0],n[1],si.UTC)};kt.fromIso8601=function(e,t){e=e.replace(",",".");let n=e.split("T"),i,o=1,r=1,a=0,s=0,c=0,u=0,f=n[0],h=n[1],p,A;if(n=f.match(SRe),n!==null)i=+n[1],o=+n[2],r=+n[3];else if(n=f.match(IRe),n!==null)i=+n[1],o=+n[2];else if(n=f.match(bRe),n!==null)i=+n[1];else{let C;if(n=f.match(xRe),n!==null)i=+n[1],C=+n[2],A=Ch(i);else if(n=f.match(TRe),n!==null){i=+n[1];let E=+n[2],b=+n[3]||0,x=new Date(Date.UTC(i,0,4));C=E*7+b-x.getUTCDay()-3}p=new Date(Date.UTC(i,0,1)),p.setUTCDate(C),o=p.getUTCMonth()+1,r=p.getUTCDate()}A=Ch(i);let m;if(l(h)){n=h.match(DRe),n!==null?(a=+n[1],s=+n[2],c=+n[3],u=+(n[4]||0)*1e3,m=5):(n=h.match(BRe),n!==null?(a=+n[1],s=+n[2],c=+(n[3]||0)*60,m=4):(n=h.match(wRe),n!==null&&(a=+n[1],s=+(n[2]||0)*60,m=3)));let C=n[m],E=+n[m+1],b=+(n[m+2]||0);switch(C){case"+":a=a-E,s=s-b;break;case"-":a=a+E,s=s+b;break;case"Z":break;default:s=s+new Date(Date.UTC(i,o-1,r,a,s)).getTimezoneOffset();break}}let _=c===60;for(_&&c--;s>=60;)s-=60,a++;for(;a>=24;)a-=24,r++;for(p=A&&o===2?WW:HW[o-1];r>p;)r-=p,o++,o>12&&(o-=12,i++),p=A&&o===2?WW:HW[o-1];for(;s<0;)s+=60,a--;for(;a<0;)a+=24,r--;for(;r<1;)o--,o<1&&(o+=12,i--),p=A&&o===2?WW:HW[o-1],r+=p;let y=YW(i,o,r,a,s,c,u);return l(t)?(Y_(y[0],y[1],t),IG(t)):t=new kt(y[0],y[1],si.UTC),_&&kt.addSeconds(t,1,t),t};kt.now=function(e){return kt.fromDate(new Date,e)};var bG=new kt(0,0,si.TAI);kt.toGregorianDate=function(e,t){let n=!1,i=Coe(e,bG);l(i)||(kt.addSeconds(e,-1,bG),i=Coe(bG,bG),n=!0);let o=i.dayNumber,r=i.secondsOfDay;r>=43200&&(o+=1);let a=o+68569|0,s=4*a/146097|0;a=a-((146097*s+3)/4|0)|0;let c=4e3*(a+1)/1461001|0;a=a-(1461*c/4|0)+31|0;let u=80*a/2447|0,f=a-(2447*u/80|0)|0;a=u/11|0;let h=u+2-12*a|0,p=100*(s-49)+c+a|0,A=r/li.SECONDS_PER_HOUR|0,m=r-A*li.SECONDS_PER_HOUR,_=m/li.SECONDS_PER_MINUTE|0;m=m-_*li.SECONDS_PER_MINUTE;let y=m|0,C=(m-y)/li.SECONDS_PER_MILLISECOND;return A+=12,A>23&&(A-=24),n&&(y+=1),l(t)?(t.year=p,t.month=h,t.day=f,t.hour=A,t.minute=_,t.second=y,t.millisecond=C,t.isLeapSecond=n,t):new SA(p,h,f,A,_,y,C,n)};kt.toDate=function(e){let t=kt.toGregorianDate(e,Eoe),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))};kt.toIso8601=function(e,t){let n=kt.toGregorianDate(e,Eoe),i=n.year,o=n.month,r=n.day,a=n.hour,s=n.minute,c=n.second,u=n.millisecond;i===1e4&&o===1&&r===1&&a===0&&s===0&&c===0&&u===0&&(i=9999,o=12,r=31,a=24);let f;if(!l(t)&&u!==0){let h=u*.01;return f=h<1e-6?h.toFixed(20).replace(".","").replace(/0+$/,""):h.toString().replace(".",""),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${f}Z`}return!l(t)||t===0?`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}Z`:(f=(u*.01).toFixed(t).replace(".","").slice(0,t),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${f}Z`)};kt.clone=function(e,t){if(l(e))return l(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new kt(e.dayNumber,e.secondsOfDay,si.TAI)};kt.compare=function(e,t){let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};kt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};kt.equalsEpsilon=function(e,t,n){return n=n??0,e===t||l(e)&&l(t)&&Math.abs(kt.secondsDifference(e,t))<=n};kt.totalDays=function(e){return e.dayNumber+e.secondsOfDay/li.SECONDS_PER_DAY};kt.secondsDifference=function(e,t){return(e.dayNumber-t.dayNumber)*li.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};kt.daysDifference=function(e,t){let n=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/li.SECONDS_PER_DAY;return n+i};kt.computeTaiMinusUtc=function(e){hx.julianDate=e;let t=kt.leapSeconds,n=Co(t,hx,jW);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};kt.addSeconds=function(e,t,n){return Y_(e.dayNumber,e.secondsOfDay+t,n)};kt.addMinutes=function(e,t,n){let i=e.secondsOfDay+t*li.SECONDS_PER_MINUTE;return Y_(e.dayNumber,i,n)};kt.addHours=function(e,t,n){let i=e.secondsOfDay+t*li.SECONDS_PER_HOUR;return Y_(e.dayNumber,i,n)};kt.addDays=function(e,t,n){let i=e.dayNumber+t;return Y_(i,e.secondsOfDay,n)};kt.lessThan=function(e,t){return kt.compare(e,t)<0};kt.lessThanOrEquals=function(e,t){return kt.compare(e,t)<=0};kt.greaterThan=function(e,t){return kt.compare(e,t)>0};kt.greaterThanOrEquals=function(e,t){return kt.compare(e,t)>=0};kt.prototype.clone=function(e){return kt.clone(this,e)};kt.prototype.equals=function(e){return kt.equals(this,e)};kt.prototype.equalsEpsilon=function(e,t){return kt.equalsEpsilon(this,e,t)};kt.prototype.toString=function(){return kt.toIso8601(this)};kt.leapSeconds=[new mo(new kt(2441317,43210,si.TAI),10),new mo(new kt(2441499,43211,si.TAI),11),new mo(new kt(2441683,43212,si.TAI),12),new mo(new kt(2442048,43213,si.TAI),13),new mo(new kt(2442413,43214,si.TAI),14),new mo(new kt(2442778,43215,si.TAI),15),new mo(new kt(2443144,43216,si.TAI),16),new mo(new kt(2443509,43217,si.TAI),17),new mo(new kt(2443874,43218,si.TAI),18),new mo(new kt(2444239,43219,si.TAI),19),new mo(new kt(2444786,43220,si.TAI),20),new mo(new kt(2445151,43221,si.TAI),21),new mo(new kt(2445516,43222,si.TAI),22),new mo(new kt(2446247,43223,si.TAI),23),new mo(new kt(2447161,43224,si.TAI),24),new mo(new kt(2447892,43225,si.TAI),25),new mo(new kt(2448257,43226,si.TAI),26),new mo(new kt(2448804,43227,si.TAI),27),new mo(new kt(2449169,43228,si.TAI),28),new mo(new kt(2449534,43229,si.TAI),29),new mo(new kt(2450083,43230,si.TAI),30),new mo(new kt(2450630,43231,si.TAI),31),new mo(new kt(2451179,43232,si.TAI),32),new mo(new kt(2453736,43233,si.TAI),33),new mo(new kt(2454832,43234,si.TAI),34),new mo(new kt(2456109,43235,si.TAI),35),new mo(new kt(2457204,43236,si.TAI),36),new mo(new kt(2457754,43237,si.TAI),37)];var X=kt;var Uoe=Wr(rf(),1);function vRe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var WB=vRe;function Boe(e,t){if(e===null||typeof e!="object")return e;t=t??!1;let n=new e.constructor;for(let i in e)if(e.hasOwnProperty(i)){let o=e[i];t&&(o=Boe(o,t)),n[i]=o}return n}var je=Boe;function Doe(e,t,n){n=n??!1;let i={},o=l(e),r=l(t),a,s,c;if(o)for(a in e)e.hasOwnProperty(a)&&(s=e[a],r&&n&&typeof s=="object"&&t.hasOwnProperty(a)?(c=t[a],typeof c=="object"?i[a]=Doe(s,c,n):i[a]=s):i[a]=s);if(r)for(a in t)t.hasOwnProperty(a)&&!i.hasOwnProperty(a)&&(c=t[a],i[a]=c);return i}var Pt=Doe;function PRe(){let e,t,n=new Promise(function(i,o){e=i,t=o});return{resolve:e,reject:t,promise:n}}var Au=PRe;var voe=Wr(rf(),1);function KW(e,t){let n;return typeof document<"u"&&(n=document),KW._implementation(e,t,n)}KW._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let i=new voe.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var Zm=KW;var Poe=Wr(rf(),1);function RRe(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new Poe.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var jB=RRe;var Roe=Wr(rf(),1);function MRe(e){let t=new Roe.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 wA=MRe;var Moe={};function NRe(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=Moe[t];l(i)||(i={},Moe[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 Eh=NRe;var LRe=/^blob:/i;function ORe(e){return LRe.test(e)}var hE=ORe;var $m;function FRe(e){l($m)||($m=document.createElement("a")),$m.href=window.location.href;let t=$m.host,n=$m.protocol;return $m.href=e,$m.href=$m.href,n!==$m.protocol||t!==$m.host}var q_=FRe;var QRe=/^data:/i;function kRe(e){return QRe.test(e)}var bh=kRe;function URe(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 mE=URe;function zRe(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,a=i.length;r<a;++r)t+=`${o+encodeURIComponent(i[r])}&`;else t+=`${o+encodeURIComponent(i)}&`}return t=t.slice(0,-1),t}var pE=zRe;function GRe(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("="),a=decodeURIComponent(r[0]),s=r[1];l(s)?s=decodeURIComponent(s):s="";let c=t[a];typeof c=="string"?t[a]=[c,s]:Array.isArray(c)?c.push(s):t[a]=s}return t}var af=GRe;var VRe={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},pi=Object.freeze(VRe);var HRe={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},ja=Object.freeze(HRe);function wG(e){e=e??V.EMPTY_OBJECT;let t=e.throttleByServer??!1,n=e.throttle??!1;this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=e.priority??0,this.throttle=n,this.throttleByServer=t,this.type=e.type??ja.OTHER,this.serverKey=e.serverKey,this.state=pi.UNISSUED,this.deferred=void 0,this.cancelled=!1}wG.prototype.cancel=function(){this.cancelled=!0};wG.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=pi.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new wG(this)};var Ir=wG;function WRe(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 a=o.substring(0,r),s=o.substring(r+2);t[a]=s}}return t}var YB=WRe;function Noe(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=YB(this.responseHeaders))}Noe.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var ep=Noe;var BG=Wr(rf(),1);function qB(){this._listeners=new Map,this._toRemove=new Map,this._toAdd=new Map,this._invokingListeners=!1,this._listenerCount=0}Object.defineProperties(qB.prototype,{numberOfListeners:{get:function(){return this._listenerCount}}});qB.prototype.addEventListener=function(e,t){let n=this,i=n._invokingListeners?n._toAdd:n._listeners;return JW(this,i,e,t)&&n._listenerCount++,function(){n.removeEventListener(e,t)}};function JW(e,t,n,i){t.has(n)||t.set(n,new Set);let o=t.get(n);return o.has(i)?!1:(o.add(i),!0)}qB.prototype.removeEventListener=function(e,t){let n=XW(this,this._listeners,e,t),i=XW(this,this._toAdd,e,t),o=n||i;return o&&this._listenerCount--,o};function XW(e,t,n,i){let o=t.get(n);if(!o||!o.has(i))return!1;if(e._invokingListeners){if(!JW(e,e._toRemove,n,i))return!1}else o.delete(i),o.size===0&&t.delete(n);return!0}qB.prototype.raiseEvent=function(){this._invokingListeners=!0;for(let[e,t]of this._listeners.entries())if(l(e))for(let n of t)e.apply(n,arguments);this._invokingListeners=!1;for(let[e,t]of this._toAdd.entries())for(let n of t)JW(this,this._listeners,e,n);this._toAdd.clear();for(let[e,t]of this._toRemove.entries())for(let n of t)XW(this,this._listeners,e,n);this._toRemove.clear()};var _e=qB;function AE(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(AE.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 ZW(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}AE.prototype.reserve=function(e){e=e??this._length,this._array.length=e};AE.prototype.heapify=function(e){e=e??0;let t=this._length,n=this._comparator,i=this._array,o=-1,r=!0;for(;r;){let a=2*(e+1),s=a-1;s<t&&n(i[s],i[e])<0?o=s:o=e,a<t&&n(i[a],i[o])<0&&(o=a),o!==e?(ZW(i,o,e),e=o):r=!1}};AE.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};AE.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 a=Math.floor((o-1)/2);if(n(t[o],t[a])<0)ZW(t,o,a),o=a;else break}let r;return l(i)&&this._length>i&&(r=t[i],this._length=i),r};AE.prototype.pop=function(e){if(e=e??0,this._length===0)return;let t=this._array,n=t[e];return ZW(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var KB=AE;function jRe(e,t){return e.priority-t.priority}var Eo={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},Ax=20,zc=new KB({comparator:jRe});zc.maximumLength=Ax;zc.reserve(Ax);var tp=[],BA={},YRe=typeof document<"u"?new BG.default(document.location.href):new BG.default,DG=new _e;function xr(){}xr.maximumRequests=50;xr.maximumRequestsPerServer=18;xr.requestsByServer={};xr.throttleRequests=!0;xr.debugShowStatistics=!1;xr.requestCompletedEvent=DG;Object.defineProperties(xr,{statistics:{get:function(){return Eo}},priorityHeapLength:{get:function(){return Ax},set:function(e){if(e<Ax)for(;zc.length>e;){let t=zc.pop();gE(t)}Ax=e,zc.maximumLength=e,zc.reserve(e)}}});function Loe(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}xr.serverHasOpenSlots=function(e,t){t=t??1;let n=xr.requestsByServer[e]??xr.maximumRequestsPerServer;return BA[e]+t<=n};xr.heapHasOpenSlots=function(e){return zc.length+e<=Ax};function Ooe(e){return e.state===pi.UNISSUED&&(e.state=pi.ISSUED,e.deferred=Au()),e.deferred.promise}function qRe(e){return function(t){if(e.state===pi.CANCELLED)return;let n=e.deferred;--Eo.numberOfActiveRequests,--BA[e.serverKey],DG.raiseEvent(),e.state=pi.RECEIVED,e.deferred=void 0,n.resolve(t)}}function KRe(e){return function(t){e.state!==pi.CANCELLED&&(++Eo.numberOfFailedRequests,--Eo.numberOfActiveRequests,--BA[e.serverKey],DG.raiseEvent(t),e.state=pi.FAILED,e.deferred.reject(t))}}function Foe(e){let t=Ooe(e);return e.state=pi.ACTIVE,tp.push(e),++Eo.numberOfActiveRequests,++Eo.numberOfActiveRequestsEver,++BA[e.serverKey],e.requestFunction().then(qRe(e)).catch(KRe(e)),t}function gE(e){let t=e.state===pi.ACTIVE;if(e.state=pi.CANCELLED,++Eo.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--Eo.numberOfActiveRequests,--BA[e.serverKey],++Eo.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}xr.update=function(){let e,t,n=0,i=tp.length;for(e=0;e<i;++e){if(t=tp[e],t.cancelled&&gE(t),t.state!==pi.ACTIVE){++n;continue}n>0&&(tp[e-n]=t)}tp.length-=n;let o=zc.internalArray,r=zc.length;for(e=0;e<r;++e)Loe(o[e]);zc.resort();let a=Math.max(xr.maximumRequests-tp.length,0),s=0;for(;s<a&&zc.length>0;){if(t=zc.pop(),t.cancelled){gE(t);continue}if(t.throttleByServer&&!xr.serverHasOpenSlots(t.serverKey)){gE(t);continue}Foe(t),++s}XRe()};xr.getServerKey=function(e){let t=new BG.default(e);t.scheme()===""&&(t=t.absoluteTo(YRe),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=BA[n];return l(i)||(BA[n]=0),n};xr.request=function(e){if(bh(e.url)||hE(e.url))return DG.raiseEvent(),e.state=pi.RECEIVED,e.requestFunction();if(++Eo.numberOfAttemptedRequests,l(e.serverKey)||(e.serverKey=xr.getServerKey(e.url)),xr.throttleRequests&&e.throttleByServer&&!xr.serverHasOpenSlots(e.serverKey))return;if(!xr.throttleRequests||!e.throttle)return Foe(e);if(tp.length>=xr.maximumRequests)return;Loe(e);let t=zc.insert(e);if(l(t)){if(t===e)return;gE(t)}return Ooe(e)};function XRe(){xr.debugShowStatistics&&(Eo.numberOfActiveRequests===0&&Eo.lastNumberOfActiveRequests>0&&(Eo.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${Eo.numberOfAttemptedRequests}`),Eo.numberOfAttemptedRequests=0),Eo.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${Eo.numberOfCancelledRequests}`),Eo.numberOfCancelledRequests=0),Eo.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${Eo.numberOfCancelledActiveRequests}`),Eo.numberOfCancelledActiveRequests=0),Eo.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${Eo.numberOfFailedRequests}`),Eo.numberOfFailedRequests=0)),Eo.lastNumberOfActiveRequests=Eo.numberOfActiveRequests)}xr.clearForSpecs=function(){for(;zc.length>0;){let t=zc.pop();gE(t)}let e=tp.length;for(let t=0;t<e;++t)gE(tp[t]);tp.length=0,BA={},Eo.numberOfAttemptedRequests=0,Eo.numberOfActiveRequests=0,Eo.numberOfCancelledRequests=0,Eo.numberOfCancelledActiveRequests=0,Eo.numberOfFailedRequests=0,Eo.numberOfActiveRequestsEver=0,Eo.lastNumberOfActiveRequests=0};xr.numberOfActiveRequestsByServer=function(e){return BA[e]};xr.requestHeap=zc;var Gc=xr;var Qoe=Wr(rf(),1);var XB={},gx={};XB.add=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(gx[n])||(gx[n]=!0)};XB.remove=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(gx[n])&&delete gx[n]};function JRe(e){let t=new Qoe.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}}XB.contains=function(e){let t=JRe(e);return!!(l(t)&&l(gx[t]))};XB.clear=function(){gx={}};var _x=XB;var zoe=(function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}})();function Qt(e){e=e??V.EMPTY_OBJECT,typeof e=="string"&&(e={url:e}),this._url=void 0,this._templateValues=np(e.templateValues,{}),this._queryParameters=np(e.queryParameters,{}),this.headers=np(e.headers,{}),this.request=e.request??new Ir,this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=e.retryAttempts??0,this._retryCount=0,e.parseUrl??!0?this.parseUrl(e.url,!0,!0):this._url=e.url,this._credits=e.credits}function np(e,t){return l(e)?je(e):t}Qt.createIfNeeded=function(e){return e instanceof Qt?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new Qt({url:e})};var yx;Qt.supportsImageBitmapOptions=function(){return l(yx)?yx:typeof createImageBitmap!="function"?(yx=Promise.resolve(!1),yx):(yx=Qt.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=Eh(t[0]),i=Eh(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),yx)};Object.defineProperties(Qt,{isBlobSupported:{get:function(){return zoe}}});Object.defineProperties(Qt.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 wA(this._url)}},isDataUri:{get:function(){return bh(this._url)}},isBlobUri:{get:function(){return hE(this._url)}},isCrossOriginUrl:{get:function(){return q_(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});Qt.prototype.toString=function(){return this.getUrlComponent(!0,!0)};Qt.prototype.parseUrl=function(e,t,n,i){let o=new Uoe.default(e),r=ZRe(o.query());this._queryParameters=t?PG(r,this.queryParameters,n):r,o.search(""),o.fragment(""),l(i)&&o.scheme()===""&&(o=o.absoluteTo(Zm(i))),this._url=o.toString()};function ZRe(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:af(e)}function PG(e,t,n){if(!n)return Pt(e,t);let i=je(e,!0);for(let o in t)if(t.hasOwnProperty(o)){let r=i[o],a=t[o];l(r)?(Array.isArray(r)||(r=i[o]=[r]),i[o]=r.concat(a)):i[o]=Array.isArray(a)?a.slice():a}return i}Qt.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${$Re(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 a=i[r];return l(a)?encodeURIComponent(a):o})),t&&l(this.proxy)&&(n=this.proxy.getURL(n)),n};function $Re(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${pE(e)}`}Qt.prototype.setQueryParameters=function(e,t){t?this._queryParameters=PG(this._queryParameters,e,!1):this._queryParameters=PG(e,this._queryParameters,!1)};Qt.prototype.appendQueryParameters=function(e){this._queryParameters=PG(e,this._queryParameters,!0)};Qt.prototype.setTemplateValues=function(e,t){t?this._templateValues=Pt(this._templateValues,e):this._templateValues=Pt(e,this._templateValues)};Qt.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,l(e.url)){let n=e.preserveQueryParameters??!1;t.parseUrl(e.url,!0,n,this._url)}return l(e.queryParameters)&&(t._queryParameters=Pt(e.queryParameters,t.queryParameters)),l(e.templateValues)&&(t._templateValues=Pt(e.templateValues,t.templateValues)),l(e.headers)&&(t.headers=Pt(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};Qt.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})};Qt.prototype.clone=function(e){return l(e)?(e._url=this._url,e._queryParameters=je(this._queryParameters),e._templateValues=je(this._templateValues),e.headers=je(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new Qt({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})};Qt.prototype.getBaseUri=function(e){return jB(this.getUrlComponent(e),e)};Qt.prototype.appendForwardSlash=function(){this._url=WB(this._url)};Qt.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};Qt.fetchArrayBuffer=function(e){return new Qt(e).fetchArrayBuffer()};Qt.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};Qt.fetchBlob=function(e){return new Qt(e).fetchBlob()};Qt.prototype.fetchImage=function(e){e=e??V.EMPTY_OBJECT;let t=e.preferImageBitmap??!1,n=e.preferBlob??!1,i=e.flipY??!1,o=e.skipColorSpaceConversion??!1;if($W(this.request),!zoe||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return this._fetchImage({resource:this,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:t});let r=this.fetchBlob();if(!l(r))return;let a,s,c,u;return Qt.supportsImageBitmapOptions().then(function(f){return a=f,s=a&&t,r}).then(function(f){if(!l(f))return;if(u=f,s)return Qt.createImageBitmapFromBlob(f,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o});let h=window.URL.createObjectURL(f);return c=new Qt({url:h}),c._fetchImage({flipY:i,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(f){if(l(f))return f.blob=u,s||window.URL.revokeObjectURL(c.url),f}).catch(function(f){return l(c)&&window.URL.revokeObjectURL(c.url),f.blob=u,Promise.reject(f)})};Qt.prototype._fetchImage=function(e){let t=this,n=e.flipY,i=e.skipColorSpaceConversion,o=e.preferImageBitmap,r=t.request;r.url=t.url,r.requestFunction=function(){let s=!1;!t.isDataUri&&!t.isBlobUri&&(s=t.isCrossOriginUrl);let c=Au();return Qt._Implementations.createImage(r,s,c,n,i,o),c.promise};let a=Gc.request(r);if(l(a))return a.catch(function(s){return r.state!==pi.FAILED?Promise.reject(s):t.retryOnError(s).then(function(c){return c?(r.state=pi.UNISSUED,r.deferred=void 0,t._fetchImage({flipY:n,skipColorSpaceConversion:i,preferImageBitmap:o})):Promise.reject(s)})})};Qt.fetchImage=function(e){return new Qt(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};Qt.prototype.fetchText=function(){return this.fetch({responseType:"text"})};Qt.fetchText=function(e){return new Qt(e).fetchText()};Qt.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)})};Qt.fetchJson=function(e){return new Qt(e).fetchJson()};Qt.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};Qt.fetchXML=function(e){return new Qt(e).fetchXML()};Qt.prototype.fetchJsonp=function(e){e=e??"callback",$W(this.request);let t;do t=`loadJsonp${D.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return Goe(this,e,t)};function Goe(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 s=Au();return window[n]=function(c){s.resolve(c);try{delete window[n]}catch{window[n]=void 0}},Qt._Implementations.loadAndExecuteScript(r,n,s),s.promise};let a=Gc.request(o);if(l(a))return a.catch(function(s){return o.state!==pi.FAILED?Promise.reject(s):e.retryOnError(s).then(function(c){return c?(o.state=pi.UNISSUED,o.deferred=void 0,Goe(e,t,n)):Promise.reject(s)})})}Qt.fetchJsonp=function(e){return new Qt(e).fetchJsonp(e.callbackParameterName)};Qt.prototype._makeRequest=function(e){let t=this;$W(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let r=e.responseType,a=Pt(e.headers,t.headers),s=e.overrideMimeType,c=e.method,u=e.data,f=Au(),h=Qt._Implementations.loadWithXhr(i,r,c,u,a,f,s);return l(h)&&l(h.abort)&&(n.cancelFunction=function(){h.abort()}),f.promise};let o=Gc.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!==pi.FAILED?Promise.reject(r):t.retryOnError(r).then(function(a){return a?(n.state=pi.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};function $W(e){if(e.state===pi.ISSUED||e.state===pi.ACTIVE)throw new ue("The Resource is already being fetched.");e.state=pi.UNISSUED,e.deferred=void 0}var eMe=/^data:(.*?)(;base64)?,(.*)$/;function vG(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function koe(e,t){let n=vG(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 tMe(e,t){t=t??"";let n=e[1],i=!!e[2],o=e[3],r,a;switch(t){case"":case"text":return vG(i,o);case"arraybuffer":return koe(i,o);case"blob":return r=koe(i,o),new Blob([r],{type:n});case"document":return a=new DOMParser,a.parseFromString(vG(i,o),n);case"json":return JSON.parse(vG(i,o));default:}}Qt.prototype.fetch=function(e){return e=np(e,{}),e.method="GET",this._makeRequest(e)};Qt.fetch=function(e){return new Qt(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Qt.prototype.delete=function(e){return e=np(e,{}),e.method="DELETE",this._makeRequest(e)};Qt.delete=function(e){return new Qt(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};Qt.prototype.head=function(e){return e=np(e,{}),e.method="HEAD",this._makeRequest(e)};Qt.head=function(e){return new Qt(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Qt.prototype.options=function(e){return e=np(e,{}),e.method="OPTIONS",this._makeRequest(e)};Qt.options=function(e){return new Qt(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Qt.prototype.post=function(e,t){return Vo.defined("data",e),t=np(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};Qt.post=function(e){return new Qt(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Qt.prototype.put=function(e,t){return Vo.defined("data",e),t=np(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};Qt.put=function(e){return new Qt(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Qt.prototype.patch=function(e,t){return Vo.defined("data",e),t=np(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};Qt.patch=function(e){return new Qt(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Qt._Implementations={};Qt._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&&(_x.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e};Qt._Implementations.createImage=function(e,t,n,i,o,r,a){let s=e.url;Qt.supportsImageBitmapOptions().then(function(c){if(!(c&&r)){Qt._Implementations.loadImageElement(s,t,n);return}let u="blob",f="GET",h=Au(),p=Qt._Implementations.loadWithXhr(s,u,f,void 0,a,h,void 0,void 0,void 0);return l(p)&&l(p.abort)&&(e.cancelFunction=function(){p.abort()}),h.promise.then(function(A){if(!l(A)){n.reject(new ue(`Successfully retrieved ${s} but it contained no content.`));return}return Qt.createImageBitmapFromBlob(A,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o})}).then(function(A){n.resolve(A)})}).catch(function(c){n.reject(c)})};Qt.createImageBitmapFromBlob=function(e,t){return Vo.defined("options",t),Vo.typeOf.bool("options.flipY",t.flipY),Vo.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),Vo.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function nMe(e,t,n,i,o,r,a){fetch(e,{method:n,headers:o}).then(async s=>{if(!s.ok){let c={};s.headers.forEach((u,f)=>{c[f]=u}),r.reject(new ep(s.status,s,c));return}switch(t){case"text":r.resolve(s.text());break;case"json":r.resolve(s.json());break;default:r.resolve(new Uint8Array(await s.arrayBuffer()).buffer);break}}).catch(()=>{r.reject(new ep)})}var iMe=typeof XMLHttpRequest>"u";Qt._Implementations.loadWithXhr=function(e,t,n,i,o,r,a){let s=eMe.exec(e);if(s!==null){r.resolve(tMe(s,t));return}if(iMe){nMe(e,t,n,i,o,r,a);return}let c=new XMLHttpRequest;if(_x.contains(e)&&(c.withCredentials=!0),c.open(n,e,!0),l(a)&&l(c.overrideMimeType)&&c.overrideMimeType(a),l(o))for(let f in o)o.hasOwnProperty(f)&&c.setRequestHeader(f,o[f]);l(t)&&(c.responseType=t);let u=!1;return typeof e=="string"&&(u=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(u&&c.status===0)){r.reject(new ep(c.status,c.response,c.getAllResponseHeaders()));return}let f=c.response,h=c.responseType;if(n==="HEAD"||n==="OPTIONS"){let A=c.getAllResponseHeaders().trim().split(/[\r\n]+/),m={};A.forEach(function(_){let y=_.split(": "),C=y.shift();m[C]=y.join(": ")}),r.resolve(m);return}if(c.status===204)r.resolve(void 0);else if(l(f)&&(!l(t)||h===t))r.resolve(f);else if(t==="json"&&typeof f=="string")try{r.resolve(JSON.parse(f))}catch(p){r.reject(p)}else(h===""||h==="document")&&l(c.responseXML)&&c.responseXML.hasChildNodes()?r.resolve(c.responseXML):(h===""||h==="text")&&l(c.responseText)?r.resolve(c.responseText):r.reject(new ue("Invalid XMLHttpRequest response type."))},c.onerror=function(f){r.reject(new ep)},c.send(i),c};Qt._Implementations.loadAndExecuteScript=function(e,t,n){return mE(e,t).catch(function(i){n.reject(i)})};Qt._DefaultImplementations={};Qt._DefaultImplementations.createImage=Qt._Implementations.createImage;Qt._DefaultImplementations.loadWithXhr=Qt._Implementations.loadWithXhr;Qt._DefaultImplementations.loadAndExecuteScript=Qt._Implementations.loadAndExecuteScript;Qt.DEFAULT=Object.freeze(new Qt({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var De=Qt;function ZB(e){e=e??V.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=e.addNewLeapSeconds??!0,l(e.data)?Voe(this,e.data):Voe(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}ZB.fromUrl=async function(e,t){t=t??V.EMPTY_OBJECT;let n=De.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 ZB({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};ZB.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 j_(0,0,0,0,0),t}});ZB.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new j_(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 s=n[i],c=n[i+1],u=X.lessThanOrEquals(s,e),f=!l(c),h=f||X.greaterThanOrEquals(c,e);if(u&&h)return o=i,!f&&c.equals(e)&&++o,r=o+1,Woe(this,n,this._samples,e,o,r,t),t}let a=Co(n,e,X.compare,this._dateColumn);return a>=0?(a<n.length-1&&n[a+1].equals(e)&&++a,o=a,r=a):(r=~a,o=r-1,o<0&&(o=0)),this._lastIndex=o,Woe(this,n,this._samples,e,o,r,t),t};function oMe(e,t){return X.compare(e.julianDate,t)}function Voe(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"),a=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),s=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),c=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||i<0||o<0||r<0||a<0||s<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 u=e._samples=t.samples,f=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=o,e._ut1MinusUtcSecondsColumn=r,e._xCelestialPoleOffsetRadiansColumn=a,e._yCelestialPoleOffsetRadiansColumn=s,e._taiMinusUtcSecondsColumn=c,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let h,p=e._addNewLeapSeconds;for(let A=0,m=u.length;A<m;A+=e._columnCount){let _=u[A+n],y=u[A+c],C=_+li.MODIFIED_JULIAN_DATE_DIFFERENCE,E=new X(C,y,si.TAI);if(f.push(E),p){if(y!==h&&l(h)){let b=X.leapSeconds,x=Co(b,E,oMe);if(x<0){let S=new mo(E,y);b.splice(~x,0,S)}}h=y}}}function Hoe(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 JB(e,t,n){return t+e*(n-t)}function Woe(e,t,n,i,o,r,a){let s=e._columnCount;if(r>t.length-1)return a.xPoleWander=0,a.yPoleWander=0,a.xPoleOffset=0,a.yPoleOffset=0,a.ut1MinusUtc=0,a;let c=t[o],u=t[r];if(c.equals(u)||i.equals(c))return Hoe(e,n,o,s,a),a;if(i.equals(u))return Hoe(e,n,r,s,a),a;let f=X.secondsDifference(i,c)/X.secondsDifference(u,c),h=o*s,p=r*s,A=n[h+e._ut1MinusUtcSecondsColumn],m=n[p+e._ut1MinusUtcSecondsColumn],_=m-A;if(_>.5||_<-.5){let y=n[h+e._taiMinusUtcSecondsColumn],C=n[p+e._taiMinusUtcSecondsColumn];y!==C&&(u.equals(i)?A=m:m-=C-y)}return a.xPoleWander=JB(f,n[h+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),a.yPoleWander=JB(f,n[h+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),a.xPoleOffset=JB(f,n[h+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),a.yPoleOffset=JB(f,n[h+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),a.ut1MinusUtc=JB(f,A,m),a}var $B=ZB;function Vc(e,t,n){this.heading=e??0,this.pitch=t??0,this.roll=n??0}Vc.fromQuaternion=function(e,t){l(t)||(t=new Vc);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),a=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(a,r),t.roll=Math.atan2(o,i),t.pitch=-D.asinClamped(n),t};Vc.fromDegrees=function(e,t,n,i){return l(i)||(i=new Vc),i.heading=e*D.RADIANS_PER_DEGREE,i.pitch=t*D.RADIANS_PER_DEGREE,i.roll=n*D.RADIANS_PER_DEGREE,i};Vc.clone=function(e,t){if(l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new Vc(e.heading,e.pitch,e.roll)};Vc.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};Vc.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&D.equalsEpsilon(e.heading,t.heading,n,i)&&D.equalsEpsilon(e.pitch,t.pitch,n,i)&&D.equalsEpsilon(e.roll,t.roll,n,i)};Vc.prototype.clone=function(e){return Vc.clone(this,e)};Vc.prototype.equals=function(e){return Vc.equals(this,e)};Vc.prototype.equalsEpsilon=function(e,t,n){return Vc.equalsEpsilon(this,e,t,n)};Vc.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Ec=Vc;var joe={},Yoe=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function rMe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let i=e[t].getAttribute("src"),o=Yoe.exec(i);if(o!==null)return o[1]}}var RG;function qoe(e){return typeof document>"u"?e:(l(RG)||(RG=document.createElement("a")),RG.href=e,RG.href)}var _E;function Koe(){if(l(_E))return _E;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:l(joe?.url)?e=Zm(".",joe.url):typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(require.toUrl)?e=Zm("..",yE("Core/buildModuleUrl.js")):e=rMe(),_E=new De({url:qoe(e)}),_E.appendForwardSlash(),_E}function aMe(e){return qoe(require.toUrl(`../${e}`))}function Xoe(e){return Koe().getDerivedResource({url:e}).url}var MG;function yE(e){return l(MG)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(require.toUrl)?MG=aMe:MG=Xoe),MG(e)}yE._cesiumScriptRegex=Yoe;yE._buildModuleUrlFromBaseUrl=Xoe;yE._clearBaseResource=function(){_E=void 0};yE.setBaseUrl=function(e){_E=De.DEFAULT.getDerivedResource({url:e})};yE.getCesiumBaseUrl=Koe;var Zt=yE;function sMe(e,t,n){this.x=e,this.y=t,this.s=n}var CE=sMe;function nj(e){e=e??V.EMPTY_OBJECT,this._xysFileUrlTemplate=De.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=e.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=e.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new X(this._sampleZeroJulianEphemerisDate,0,si.TAI),this._stepSizeDays=e.stepSizeDays??1,this._samplesPerXysFile=e.samplesPerXysFile??1e3,this._totalSamples=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 a=0;a<=t;++a)a!==r&&(n[r]*=r-a);n[r]=1/n[r]}this._work=new Array(t+1),this._coef=new Array(t+1)}var cMe=new X(0,0,si.TAI);function ej(e,t,n){let i=cMe;return i.dayNumber=t,i.secondsOfDay=n,X.daysDifference(i,e._sampleZeroDateTT)}nj.prototype.preload=function(e,t,n,i){let o=ej(this,e,t),r=ej(this,n,i),a=o/this._stepSizeDays-this._interpolationOrder/2|0;a<0&&(a=0);let s=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);let c=a/this._samplesPerXysFile|0,u=s/this._samplesPerXysFile|0,f=[];for(let h=c;h<=u;++h)f.push(tj(this,h));return Promise.all(f)};nj.prototype.computeXysRadians=function(e,t,n){let i=ej(this,e,t);if(i<0)return;let o=i/this._stepSizeDays|0;if(o>=this._totalSamples)return;let r=this._interpolationOrder,a=o-(r/2|0);a<0&&(a=0);let s=a+r;s>=this._totalSamples&&(s=this._totalSamples-1,a=s-r,a<0&&(a=0));let c=!1,u=this._samples;if(l(u[a*3])||(tj(this,a/this._samplesPerXysFile|0),c=!0),l(u[s*3])||(tj(this,s/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new CE(0,0,0);let f=i-a*this._stepSizeDays,h=this._work,p=this._denominators,A=this._coef,m=this._xTable,_,y;for(_=0;_<=r;++_)h[_]=f-m[_];for(_=0;_<=r;++_){for(A[_]=1,y=0;y<=r;++y)y!==_&&(A[_]*=h[y]);A[_]*=p[_];let C=(a+_)*3;n.x+=A[_]*u[C++],n.y+=A[_]*u[C++],n.s+=A[_]*u[C]}return n};function tj(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 De({url:Zt(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let o=n.fetchJson().then(function(r){e._chunkDownloadsInProgress[t]=!1;let a=e._samples,s=r.samples,c=t*e._samplesPerXysFile*3;for(let u=0,f=s.length;u<f;++u)a[c+u]=s[u]});return e._chunkDownloadsInProgress[t]=o,o}var eD=nj;function dt(e,t,n,i){this.x=e??0,this.y=t??0,this.z=n??0,this.w=i??0}var tD=new d;dt.fromAxisAngle=function(e,t,n){let i=t/2,o=Math.sin(i);tD=d.normalize(e,tD);let r=tD.x*o,a=tD.y*o,s=tD.z*o,c=Math.cos(i);return l(n)?(n.x=r,n.y=a,n.z=s,n.w=c,n):new dt(r,a,s,c)};var lMe=[1,2,0],uMe=new Array(3);dt.fromRotationMatrix=function(e,t){let n,i,o,r,a,s=e[J.COLUMN0ROW0],c=e[J.COLUMN1ROW1],u=e[J.COLUMN2ROW2],f=s+c+u;if(f>0)n=Math.sqrt(f+1),a=.5*n,n=.5/n,i=(e[J.COLUMN1ROW2]-e[J.COLUMN2ROW1])*n,o=(e[J.COLUMN2ROW0]-e[J.COLUMN0ROW2])*n,r=(e[J.COLUMN0ROW1]-e[J.COLUMN1ROW0])*n;else{let h=lMe,p=0;c>s&&(p=1),u>s&&u>c&&(p=2);let A=h[p],m=h[A];n=Math.sqrt(e[J.getElementIndex(p,p)]-e[J.getElementIndex(A,A)]-e[J.getElementIndex(m,m)]+1);let _=uMe;_[p]=.5*n,n=.5/n,a=(e[J.getElementIndex(m,A)]-e[J.getElementIndex(A,m)])*n,_[A]=(e[J.getElementIndex(A,p)]+e[J.getElementIndex(p,A)])*n,_[m]=(e[J.getElementIndex(m,p)]+e[J.getElementIndex(p,m)])*n,i=-_[0],o=-_[1],r=-_[2]}return l(t)?(t.x=i,t.y=o,t.z=r,t.w=a,t):new dt(i,o,r,a)};var Joe=new dt,Zoe=new dt,ij=new dt,$oe=new dt;dt.fromHeadingPitchRoll=function(e,t){return $oe=dt.fromAxisAngle(d.UNIT_X,e.roll,Joe),ij=dt.fromAxisAngle(d.UNIT_Y,-e.pitch,t),t=dt.multiply(ij,$oe,ij),Zoe=dt.fromAxisAngle(d.UNIT_Z,-e.heading,Joe),dt.multiply(Zoe,t,t)};var NG=new d,oj=new d,Ih=new dt,ere=new dt,LG=new dt;dt.packedLength=4;dt.pack=function(e,t,n){return n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};dt.unpack=function(e,t,n){return t=t??0,l(n)||(n=new dt),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};dt.packedInterpolationLength=3;dt.convertPackedArrayForInterpolation=function(e,t,n,i){dt.unpack(e,n*4,LG),dt.conjugate(LG,LG);for(let o=0,r=n-t+1;o<r;o++){let a=o*3;dt.unpack(e,(t+o)*4,Ih),dt.multiply(Ih,LG,Ih),Ih.w<0&&dt.negate(Ih,Ih),dt.computeAxis(Ih,NG);let s=dt.computeAngle(Ih);l(i)||(i=[]),i[a]=NG.x*s,i[a+1]=NG.y*s,i[a+2]=NG.z*s}};dt.unpackInterpolationResult=function(e,t,n,i,o){l(o)||(o=new dt),d.fromArray(e,0,oj);let r=d.magnitude(oj);return dt.unpack(t,i*4,ere),r===0?dt.clone(dt.IDENTITY,Ih):dt.fromAxisAngle(oj,r,Ih),dt.multiply(Ih,ere,o)};dt.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 dt(e.x,e.y,e.z,e.w)};dt.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};dt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};dt.magnitude=function(e){return Math.sqrt(dt.magnitudeSquared(e))};dt.normalize=function(e,t){let n=1/dt.magnitude(e),i=e.x*n,o=e.y*n,r=e.z*n,a=e.w*n;return t.x=i,t.y=o,t.z=r,t.w=a,t};dt.inverse=function(e,t){let n=dt.magnitudeSquared(e);return t=dt.conjugate(e,t),dt.multiplyByScalar(t,1/n,t)};dt.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};dt.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};dt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};dt.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};dt.multiply=function(e,t,n){let i=e.x,o=e.y,r=e.z,a=e.w,s=t.x,c=t.y,u=t.z,f=t.w,h=a*s+i*f+o*u-r*c,p=a*c-i*u+o*f+r*s,A=a*u+i*c-o*s+r*f,m=a*f-i*s-o*c-r*u;return n.x=h,n.y=p,n.z=A,n.w=m,n};dt.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};dt.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};dt.computeAxis=function(e,t){let n=e.w;if(Math.abs(n-1)<D.EPSILON6||Math.abs(n+1)<D.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};dt.computeAngle=function(e){return Math.abs(e.w-1)<D.EPSILON6?0:2*Math.acos(e.w)};var rj=new dt;dt.lerp=function(e,t,n,i){return rj=dt.multiplyByScalar(t,n,rj),i=dt.multiplyByScalar(e,1-n,i),dt.add(rj,i,i)};var tre=new dt,aj=new dt,sj=new dt;dt.slerp=function(e,t,n,i){let o=dt.dot(e,t),r=t;if(o<0&&(o=-o,r=tre=dt.negate(t,tre)),1-o<D.EPSILON6)return dt.lerp(e,r,n,i);let a=Math.acos(o);return aj=dt.multiplyByScalar(e,Math.sin((1-n)*a),aj),sj=dt.multiplyByScalar(r,Math.sin(n*a),sj),i=dt.add(aj,sj,i),dt.multiplyByScalar(i,1/Math.sin(a),i)};dt.log=function(e,t){let n=D.acosClamped(e.w),i=0;return n!==0&&(i=n/Math.sin(n)),d.multiplyByScalar(e,i,t)};dt.exp=function(e,t){let n=d.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 fMe=new d,dMe=new d,nD=new dt,Cx=new dt;dt.computeInnerQuadrangle=function(e,t,n,i){let o=dt.conjugate(t,nD);dt.multiply(o,n,Cx);let r=dt.log(Cx,fMe);dt.multiply(o,e,Cx);let a=dt.log(Cx,dMe);return d.add(r,a,r),d.multiplyByScalar(r,.25,r),d.negate(r,r),dt.exp(r,nD),dt.multiply(t,nD,i)};dt.squad=function(e,t,n,i,o,r){let a=dt.slerp(e,t,o,nD),s=dt.slerp(n,i,o,Cx);return dt.slerp(a,s,2*o*(1-o),r)};var hMe=new dt,nre=1.9011074535173003,OG=fn.supportsTypedArrays()?new Float32Array(8):[],FG=fn.supportsTypedArrays()?new Float32Array(8):[],DA=fn.supportsTypedArrays()?new Float32Array(8):[],vA=fn.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;OG[e]=1/(t*n),FG[e]=t/n}OG[7]=nre/136;FG[7]=nre*8/17;dt.fastSlerp=function(e,t,n,i){let o=dt.dot(e,t),r;o>=0?r=1:(r=-1,o=-o);let a=o-1,s=1-n,c=n*n,u=s*s;for(let A=7;A>=0;--A)DA[A]=(OG[A]*c-FG[A])*a,vA[A]=(OG[A]*u-FG[A])*a;let f=r*n*(1+DA[0]*(1+DA[1]*(1+DA[2]*(1+DA[3]*(1+DA[4]*(1+DA[5]*(1+DA[6]*(1+DA[7])))))))),h=s*(1+vA[0]*(1+vA[1]*(1+vA[2]*(1+vA[3]*(1+vA[4]*(1+vA[5]*(1+vA[6]*(1+vA[7])))))))),p=dt.multiplyByScalar(e,h,hMe);return dt.multiplyByScalar(t,f,i),dt.add(p,i,i)};dt.fastSquad=function(e,t,n,i,o,r){let a=dt.fastSlerp(e,t,o,nD),s=dt.fastSlerp(n,i,o,Cx);return dt.fastSlerp(a,s,2*o*(1-o),r)};dt.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};dt.equalsEpsilon=function(e,t,n){return n=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};dt.ZERO=Object.freeze(new dt(0,0,0,0));dt.IDENTITY=Object.freeze(new dt(0,0,0,1));dt.prototype.clone=function(e){return dt.clone(this,e)};dt.prototype.equals=function(e){return dt.equals(this,e)};dt.prototype.equalsEpsilon=function(e,t){return dt.equalsEpsilon(this,e,t)};dt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Qe=dt;var Ai={},cj={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"}},Ex={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},lj={},gu={east:new d,north:new d,up:new d,west:new d,south:new d,down:new d},K_=new d,X_=new d,J_=new d;Ai.localFrameToFixedFrameGenerator=function(e,t){if(!cj.hasOwnProperty(e)||!cj[e].hasOwnProperty(t))throw new de("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=cj[e][t],i,o=e+t;return l(lj[o])?i=lj[o]:(i=function(r,a,s){if(l(s)||(s=new M),d.equalsEpsilon(r,d.ZERO,D.EPSILON14))d.unpack(Ex[e],0,K_),d.unpack(Ex[t],0,X_),d.unpack(Ex[n],0,J_);else if(D.equalsEpsilon(r.x,0,D.EPSILON14)&&D.equalsEpsilon(r.y,0,D.EPSILON14)){let c=D.sign(r.z);d.unpack(Ex[e],0,K_),e!=="east"&&e!=="west"&&d.multiplyByScalar(K_,c,K_),d.unpack(Ex[t],0,X_),t!=="east"&&t!=="west"&&d.multiplyByScalar(X_,c,X_),d.unpack(Ex[n],0,J_),n!=="east"&&n!=="west"&&d.multiplyByScalar(J_,c,J_)}else{a=a??te.default,a.geodeticSurfaceNormal(r,gu.up);let c=gu.up,u=gu.east;u.x=-r.y,u.y=r.x,u.z=0,d.normalize(u,gu.east),d.cross(c,u,gu.north),d.multiplyByScalar(gu.up,-1,gu.down),d.multiplyByScalar(gu.east,-1,gu.west),d.multiplyByScalar(gu.north,-1,gu.south),K_=gu[e],X_=gu[t],J_=gu[n]}return s[0]=K_.x,s[1]=K_.y,s[2]=K_.z,s[3]=0,s[4]=X_.x,s[5]=X_.y,s[6]=X_.z,s[7]=0,s[8]=J_.x,s[9]=J_.y,s[10]=J_.z,s[11]=0,s[12]=r.x,s[13]=r.y,s[14]=r.z,s[15]=1,s},lj[o]=i),i};Ai.eastNorthUpToFixedFrame=Ai.localFrameToFixedFrameGenerator("east","north");Ai.northEastDownToFixedFrame=Ai.localFrameToFixedFrameGenerator("north","east");Ai.northUpEastToFixedFrame=Ai.localFrameToFixedFrameGenerator("north","up");Ai.northWestUpToFixedFrame=Ai.localFrameToFixedFrameGenerator("north","west");var mMe=new Qe,pMe=new d(1,1,1),AMe=new M;Ai.headingPitchRollToFixedFrame=function(e,t,n,i,o){i=i??Ai.eastNorthUpToFixedFrame;let r=Qe.fromHeadingPitchRoll(t,mMe),a=M.fromTranslationQuaternionRotationScale(d.ZERO,r,pMe,AMe);return o=i(e,n,o),M.multiply(o,a,o)};var gMe=new M,_Me=new J;Ai.headingPitchRollQuaternion=function(e,t,n,i,o){let r=Ai.headingPitchRollToFixedFrame(e,t,n,i,gMe),a=M.getMatrix3(r,_Me);return Qe.fromRotationMatrix(a,o)};var yMe=new d(1,1,1),CMe=new d,ire=new M,EMe=new M,bMe=new J,IMe=new Qe;Ai.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=t??te.default,n=n??Ai.eastNorthUpToFixedFrame,l(i)||(i=new Ec);let o=M.getTranslation(e,CMe);if(d.equals(o,d.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let r=M.inverseTransformation(n(o,t,ire),ire),a=M.setScale(e,yMe,EMe);a=M.setTranslation(a,d.ZERO,a),r=M.multiply(r,a,r);let s=Qe.fromRotationMatrix(M.getMatrix3(r,bMe),IMe);return s=Qe.normalize(s,s),Ec.fromQuaternion(s,i)};var xMe=6*3600+2460+50.54841,TMe=8640184812866e-6,SMe=.093104,wMe=-62e-7,BMe=11772758384668e-32,DMe=72921158553e-15,vMe=D.TWO_PI/86400,QG=new X;Ai.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=Ai.computeIcrfToFixedMatrix(e,t);return l(n)||(n=Ai.computeTemeToPseudoFixedMatrix(e,t)),n};Ai.computeTemeToPseudoFixedMatrix=function(e,t){QG=X.addSeconds(e,-X.computeTaiMinusUtc(e),QG);let n=QG.dayNumber,i=QG.secondsOfDay,o,r=n-2451545;i>=43200?o=(r+.5)/li.DAYS_PER_JULIAN_CENTURY:o=(r-.5)/li.DAYS_PER_JULIAN_CENTURY;let s=(xMe+o*(TMe+o*(SMe+o*wMe)))*vMe%D.TWO_PI,c=DMe+BMe*(n-24515455e-1),u=(i+li.SECONDS_PER_DAY*.5)%li.SECONDS_PER_DAY,f=s+c*u,h=Math.cos(f),p=Math.sin(f);return l(t)?(t[0]=h,t[1]=-p,t[2]=0,t[3]=p,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new J(h,p,0,-p,h,0,0,0,1)};Ai.iau2006XysData=new eD;Ai.earthOrientationParameters=$B.NONE;var dj=32.184,PMe=2451545;Ai.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+dj,i=e.stop.dayNumber,o=e.stop.secondsOfDay+dj;return Ai.iau2006XysData.preload(t,n,i,o)};Ai.computeIcrfToFixedMatrix=function(e,t){l(t)||(t=new J);let n=Ai.computeFixedToIcrfMatrix(e,t);if(l(n))return J.transpose(n,t)};var RMe=32.184,MMe=2451545,kG=new Ec,NMe=new J,LMe=new X;Ai.computeMoonFixedToIcrfMatrix=function(e,t){l(t)||(t=new J);let n=X.addSeconds(e,RMe,LMe),i=X.totalDays(n)-MMe,o=D.toRadians(12.112)-D.toRadians(.052992)*i,r=D.toRadians(24.224)-D.toRadians(.105984)*i,a=D.toRadians(227.645)+D.toRadians(13.012)*i,s=D.toRadians(261.105)+D.toRadians(13.340716)*i,c=D.toRadians(358)+D.toRadians(.9856)*i;return kG.pitch=D.toRadians(180)-D.toRadians(3.878)*Math.sin(o)-D.toRadians(.12)*Math.sin(r)+D.toRadians(.07)*Math.sin(a)-D.toRadians(.017)*Math.sin(s),kG.roll=D.toRadians(66.53-90)+D.toRadians(1.543)*Math.cos(o)+D.toRadians(.24)*Math.cos(r)-D.toRadians(.028)*Math.cos(a)+D.toRadians(.007)*Math.cos(s),kG.heading=D.toRadians(244.375-90)+D.toRadians(13.17635831)*i+D.toRadians(3.558)*Math.sin(o)+D.toRadians(.121)*Math.sin(r)-D.toRadians(.064)*Math.sin(a)+D.toRadians(.016)*Math.sin(s)+D.toRadians(.025)*Math.sin(c),J.fromHeadingPitchRoll(kG,NMe)};Ai.computeIcrfToMoonFixedMatrix=function(e,t){l(t)||(t=new J);let n=Ai.computeMoonFixedToIcrfMatrix(e,t);if(l(n))return J.transpose(n,t)};var OMe=new CE(0,0,0),FMe=new j_(0,0,0,0,0,0),uj=new J,fj=new J;Ai.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new J);let n=Ai.earthOrientationParameters.compute(e,FMe);if(!l(n))return;let i=e.dayNumber,o=e.secondsOfDay+dj,r=Ai.iau2006XysData.computeXysRadians(i,o,OMe);if(!l(r))return;let a=r.x+n.xPoleOffset,s=r.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-a*a-s*s)),u=uj;u[0]=1-c*a*a,u[3]=-c*a*s,u[6]=a,u[1]=-c*a*s,u[4]=1-c*s*s,u[7]=s,u[2]=-a,u[5]=-s,u[8]=1-c*(a*a+s*s);let f=J.fromRotationZ(-r.s,fj),h=J.multiply(u,f,uj),p=e.dayNumber,A=e.secondsOfDay-X.computeTaiMinusUtc(e)+n.ut1MinusUtc,m=p-2451545,_=A/li.SECONDS_PER_DAY,y=.779057273264+_+.00273781191135448*(m+_);y=y%1*D.TWO_PI;let C=J.fromRotationZ(y,fj),E=J.multiply(h,C,uj),b=Math.cos(n.xPoleWander),x=Math.cos(n.yPoleWander),S=Math.sin(n.xPoleWander),B=Math.sin(n.yPoleWander),v=i-PMe+o/li.SECONDS_PER_DAY;v/=36525;let P=-47e-6*v*D.RADIANS_PER_DEGREE/3600,N=Math.cos(P),L=Math.sin(P),g=fj;return g[0]=b*N,g[1]=b*L,g[2]=S,g[3]=-x*L+B*S*N,g[4]=x*N+B*S*L,g[5]=-B*b,g[6]=-B*L-x*S*N,g[7]=B*N-x*S*L,g[8]=x*b,J.multiply(E,g,t)};var QMe=new ie;Ai.pointToWindowCoordinates=function(e,t,n,i){return i=Ai.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};Ai.pointToGLWindowCoordinates=function(e,t,n,i){l(i)||(i=new k);let o=QMe;return M.multiplyByVector(e,ie.fromElements(n.x,n.y,n.z,1,o),o),ie.multiplyByScalar(o,1/o.w,o),M.multiplyByVector(t,o,o),k.fromCartesian4(o,i)};var kMe=new d,UMe=new d,zMe=new d;Ai.rotationMatrixFromPositionVelocity=function(e,t,n,i){let o=(n??te.default).geodeticSurfaceNormal(e,kMe),r=d.cross(t,o,UMe);d.equalsEpsilon(r,d.ZERO,D.EPSILON6)&&(r=d.clone(d.UNIT_X,r));let a=d.cross(r,t,zMe);return d.normalize(a,a),d.cross(t,a,r),d.negate(r,r),d.normalize(r,r),l(i)||(i=new J),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]=a.x,i[7]=a.y,i[8]=a.z,i};Ai.SWIZZLE_3D_TO_2D_MATRIX=Object.freeze(new M(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1));var ore=new me,hj=new d,GMe=new d,VMe=new J,mj=new M,rre=new M;Ai.basisTo2D=function(e,t,n){let i=M.getTranslation(t,GMe),o=e.ellipsoid,r;if(d.equals(i,d.ZERO))r=d.clone(d.ZERO,hj);else{let f=o.cartesianToCartographic(i,ore);r=e.project(f,hj),d.fromElements(r.z,r.x,r.y,r)}let a=Ai.eastNorthUpToFixedFrame(i,o,mj),s=M.inverseTransformation(a,rre),c=M.getMatrix3(t,VMe),u=M.multiplyByMatrix3(s,c,n);return M.multiply(Ai.SWIZZLE_3D_TO_2D_MATRIX,u,n),M.setTranslation(n,r,n),n};Ai.ellipsoidTo2DModelMatrix=function(e,t,n){let i=e.ellipsoid,o=Ai.eastNorthUpToFixedFrame(t,i,mj),r=M.inverseTransformation(o,rre),a=i.cartesianToCartographic(t,ore),s=e.project(a,hj);d.fromElements(s.z,s.x,s.y,s);let c=M.fromTranslation(s,mj);return M.multiply(Ai.SWIZZLE_3D_TO_2D_MATRIX,r,n),M.multiply(c,n,n),n};var At=Ai;function Qn(e,t,n,i){this.west=e??0,this.south=t??0,this.east=n??0,this.north=i??0}Object.defineProperties(Qn.prototype,{width:{get:function(){return Qn.computeWidth(this)}},height:{get:function(){return Qn.computeHeight(this)}}});Qn.packedLength=4;Qn.pack=function(e,t,n){return n=n??0,t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t};Qn.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Qn),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};Qn.computeWidth=function(e){let t=e.east,n=e.west;return t<n&&(t+=D.TWO_PI),t-n};Qn.computeHeight=function(e){return e.north-e.south};Qn.fromDegrees=function(e,t,n,i,o){return e=D.toRadians(e??0),t=D.toRadians(t??0),n=D.toRadians(n??0),i=D.toRadians(i??0),l(o)?(o.west=e,o.south=t,o.east=n,o.north=i,o):new Qn(e,t,n,i)};Qn.fromRadians=function(e,t,n,i,o){return l(o)?(o.west=e??0,o.south=t??0,o.east=n??0,o.north=i??0,o):new Qn(e,t,n,i)};Qn.fromCartographicArray=function(e,t){let n=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,r=-Number.MAX_VALUE,a=Number.MAX_VALUE,s=-Number.MAX_VALUE;for(let c=0,u=e.length;c<u;c++){let f=e[c];n=Math.min(n,f.longitude),i=Math.max(i,f.longitude),a=Math.min(a,f.latitude),s=Math.max(s,f.latitude);let h=f.longitude>=0?f.longitude:f.longitude+D.TWO_PI;o=Math.min(o,h),r=Math.max(r,h)}return i-n>r-o&&(n=o,i=r,i>D.PI&&(i=i-D.TWO_PI),n>D.PI&&(n=n-D.TWO_PI)),l(t)?(t.west=n,t.south=a,t.east=i,t.north=s,t):new Qn(n,a,i,s)};Qn.fromCartesianArray=function(e,t,n){t=t??te.default;let i=Number.MAX_VALUE,o=-Number.MAX_VALUE,r=Number.MAX_VALUE,a=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let u=0,f=e.length;u<f;u++){let h=t.cartesianToCartographic(e[u]);i=Math.min(i,h.longitude),o=Math.max(o,h.longitude),s=Math.min(s,h.latitude),c=Math.max(c,h.latitude);let p=h.longitude>=0?h.longitude:h.longitude+D.TWO_PI;r=Math.min(r,p),a=Math.max(a,p)}return o-i>a-r&&(i=r,o=a,o>D.PI&&(o=o-D.TWO_PI),i>D.PI&&(i=i-D.TWO_PI)),l(n)?(n.west=i,n.south=s,n.east=o,n.north=c,n):new Qn(i,s,o,c)};var HMe=new d,WMe=new d,jMe=new d,YMe=new d,qMe=new d,pj=new Array(5);for(let e=0;e<pj.length;++e)pj[e]=new d;Qn.fromBoundingSphere=function(e,t,n){let i=e.center,o=e.radius;if(l(t)||(t=te.default),l(n)||(n=new Qn),d.equals(i,d.ZERO))return Qn.clone(Qn.MAX_VALUE,n),n;let r=At.eastNorthUpToFixedFrame(i,t,HMe),a=M.multiplyByPointAsVector(r,d.UNIT_X,WMe);d.normalize(a,a);let s=M.multiplyByPointAsVector(r,d.UNIT_Y,jMe);d.normalize(s,s),d.multiplyByScalar(s,o,s),d.multiplyByScalar(a,o,a);let c=d.negate(s,qMe),u=d.negate(a,YMe),f=pj,h=f[0];return d.add(i,s,h),h=f[1],d.add(i,u,h),h=f[2],d.add(i,c,h),h=f[3],d.add(i,a,h),f[4]=i,Qn.fromCartesianArray(f,t,n)};Qn.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 Qn(e.west,e.south,e.east,e.north)};Qn.equalsEpsilon=function(e,t,n){return n=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};Qn.prototype.clone=function(e){return Qn.clone(this,e)};Qn.prototype.equals=function(e){return Qn.equals(this,e)};Qn.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};Qn.prototype.equalsEpsilon=function(e,t){return Qn.equalsEpsilon(this,e,t)};Qn._validate=function(e){};Qn.southwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new me(e.west,e.south)};Qn.northwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new me(e.west,e.north)};Qn.northeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new me(e.east,e.north)};Qn.southeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new me(e.east,e.south)};Qn.center=function(e,t){let n=e.east,i=e.west;n<i&&(n+=D.TWO_PI);let o=D.negativePiToPi((i+n)*.5),r=(e.south+e.north)*.5;return l(t)?(t.longitude=o,t.latitude=r,t.height=0,t):new me(o,r)};Qn.intersection=function(e,t,n){let i=e.east,o=e.west,r=t.east,a=t.west;i<o&&r>0?i+=D.TWO_PI:r<a&&i>0&&(r+=D.TWO_PI),i<o&&a<0?a+=D.TWO_PI:r<a&&o<0&&(o+=D.TWO_PI);let s=D.negativePiToPi(Math.max(o,a)),c=D.negativePiToPi(Math.min(i,r));if((e.west<e.east||t.west<t.east)&&c<=s)return;let u=Math.max(e.south,t.south),f=Math.min(e.north,t.north);if(!(u>=f))return l(n)?(n.west=s,n.south=u,n.east=c,n.north=f,n):new Qn(s,u,c,f)};Qn.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),a=Math.min(e.north,t.north);if(!(o>=a||i>=r))return l(n)?(n.west=i,n.south=o,n.east=r,n.north=a,n):new Qn(i,o,r,a)};Qn.union=function(e,t,n){l(n)||(n=new Qn);let i=e.east,o=e.west,r=t.east,a=t.west;i<o&&r>0?i+=D.TWO_PI:r<a&&i>0&&(r+=D.TWO_PI),i<o&&a<0?a+=D.TWO_PI:r<a&&o<0&&(o+=D.TWO_PI);let s=D.negativePiToPi(Math.min(o,a)),c=D.negativePiToPi(Math.max(i,r));return n.west=s,n.south=Math.min(e.south,t.south),n.east=c,n.north=Math.max(e.north,t.north),n};Qn.expand=function(e,t,n){return l(n)||(n=new Qn),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};Qn.contains=function(e,t){let n=t.longitude,i=t.latitude,o=e.west,r=e.east;return r<o&&(r+=D.TWO_PI,n<0&&(n+=D.TWO_PI)),(n>o||D.equalsEpsilon(n,o,D.EPSILON14))&&(n<r||D.equalsEpsilon(n,r,D.EPSILON14))&&i>=e.south&&i<=e.north};var KMe=new me;Qn.subsample=function(e,t,n,i){t=t??te.default,n=n??0,l(i)||(i=[]);let o=0,r=e.north,a=e.south,s=e.east,c=e.west,u=KMe;u.height=n,u.longitude=c,u.latitude=r,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=s,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.latitude=a,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=c,i[o]=t.cartographicToCartesian(u,i[o]),o++,r<0?u.latitude=r:a>0?u.latitude=a:u.latitude=0;for(let f=1;f<8;++f)u.longitude=-Math.PI+f*D.PI_OVER_TWO,Qn.contains(e,u)&&(i[o]=t.cartographicToCartesian(u,i[o]),o++);return u.latitude===0&&(u.longitude=c,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=s,i[o]=t.cartographicToCartesian(u,i[o]),o++),i.length=o,i};Qn.subsection=function(e,t,n,i,o,r){if(l(r)||(r=new Qn),e.west<=e.east){let s=e.east-e.west;r.west=e.west+t*s,r.east=e.west+i*s}else{let s=D.TWO_PI+e.east-e.west;r.west=D.negativePiToPi(e.west+t*s),r.east=D.negativePiToPi(e.west+i*s)}let a=e.north-e.south;return r.south=e.south+n*a,r.north=e.south+o*a,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};Qn.MAX_VALUE=Object.freeze(new Qn(-Math.PI,-D.PI_OVER_TWO,Math.PI,D.PI_OVER_TWO));var ce=Qn;function ca(e,t,n,i){this.x=e??0,this.y=t??0,this.width=n??0,this.height=i??0}ca.packedLength=4;ca.pack=function(e,t,n){return n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t};ca.unpack=function(e,t,n){return t=t??0,l(n)||(n=new ca),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};ca.fromPoints=function(e,t){if(l(t)||(t=new ca),!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,a=e[0].y;for(let s=1;s<n;s++){let c=e[s],u=c.x,f=c.y;i=Math.min(u,i),r=Math.max(u,r),o=Math.min(f,o),a=Math.max(f,a)}return t.x=i,t.y=o,t.width=r-i,t.height=a-o,t};var are=new Wi,XMe=new me,JMe=new me;ca.fromRectangle=function(e,t,n){if(l(n)||(n=new ca),!l(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;are._ellipsoid=te.default,t=t??are;let i=t.project(ce.southwest(e,XMe)),o=t.project(ce.northeast(e,JMe));return k.subtract(o,i,o),n.x=i.x,n.y=i.y,n.width=o.x,n.height=o.y,n};ca.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 ca(e.x,e.y,e.width,e.height)};ca.union=function(e,t,n){l(n)||(n=new ca);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),a=Math.max(e.y+e.height,t.y+t.height);return n.x=i,n.y=o,n.width=r-i,n.height=a-o,n};ca.expand=function(e,t,n){n=ca.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};ca.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?Xt.OUTSIDE:Xt.INTERSECTING};ca.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};ca.prototype.clone=function(e){return ca.clone(this,e)};ca.prototype.intersect=function(e){return ca.intersect(this,e)};ca.prototype.equals=function(e){return ca.equals(this,e)};var et=ca;var bc={POINTS:ee.POINTS,LINES:ee.LINES,LINE_LOOP:ee.LINE_LOOP,LINE_STRIP:ee.LINE_STRIP,TRIANGLES:ee.TRIANGLES,TRIANGLE_STRIP:ee.TRIANGLE_STRIP,TRIANGLE_FAN:ee.TRIANGLE_FAN};bc.isLines=function(e){return e===bc.LINES||e===bc.LINE_LOOP||e===bc.LINE_STRIP};bc.isTriangles=function(e){return e===bc.TRIANGLES||e===bc.TRIANGLE_STRIP||e===bc.TRIANGLE_FAN};bc.validate=function(e){return e===bc.POINTS||e===bc.LINES||e===bc.LINE_LOOP||e===bc.LINE_STRIP||e===bc.TRIANGLES||e===bc.TRIANGLE_STRIP||e===bc.TRIANGLE_FAN};var ve=Object.freeze(bc);var EE=`in vec4 position;
in vec2 textureCoordinates;
out vec2 v_textureCoordinates;
void main()
{
gl_Position = position;
v_textureCoordinates = textureCoordinates;
}
`;var Yr={CULL:1,OCCLUDE:2,EXECUTE_IN_CLOSEST_FRUSTUM:4,DEBUG_SHOW_BOUNDING_VOLUME:8,CAST_SHADOWS:16,RECEIVE_SHADOWS:32,PICK_ONLY:64,DEPTH_FOR_TRANSLUCENT_CLASSIFICATION:128};function iD(e){e=e??V.EMPTY_OBJECT,this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._modelMatrix=e.modelMatrix,this._primitiveType=e.primitiveType??ve.TRIANGLES,this._vertexArray=e.vertexArray,this._count=e.count,this._offset=e.offset??0,this._instanceCount=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._pickMetadataAllowed=e.pickMetadataAllowed===!0,this._pickedMetadataInfo=void 0,this._flags=0,this.cull=e.cull??!0,this.occlude=e.occlude??!0,this.executeInClosestFrustum=e.executeInClosestFrustum??!1,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.castShadows=e.castShadows??!1,this.receiveShadows=e.receiveShadows??!1,this.pickOnly=e.pickOnly??!1,this.depthForTranslucentClassification=e.depthForTranslucentClassification??!1,this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}function Hc(e,t){return(e._flags&t)===t}function Z_(e,t,n){n?e._flags|=t:e._flags&=~t}Object.defineProperties(iD.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 Hc(this,Yr.CULL)},set:function(e){Hc(this,Yr.CULL)!==e&&(Z_(this,Yr.CULL,e),this.dirty=!0)}},occlude:{get:function(){return Hc(this,Yr.OCCLUDE)},set:function(e){Hc(this,Yr.OCCLUDE)!==e&&(Z_(this,Yr.OCCLUDE,e),this.dirty=!0)}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix!==e&&(this._modelMatrix=e,this.dirty=!0)}},primitiveType:{get:function(){return this._primitiveType},set:function(e){this._primitiveType!==e&&(this._primitiveType=e,this.dirty=!0)}},vertexArray:{get:function(){return this._vertexArray},set:function(e){this._vertexArray!==e&&(this._vertexArray=e,this.dirty=!0)}},count:{get:function(){return this._count},set:function(e){this._count!==e&&(this._count=e,this.dirty=!0)}},offset:{get:function(){return this._offset},set:function(e){this._offset!==e&&(this._offset=e,this.dirty=!0)}},instanceCount:{get:function(){return this._instanceCount},set:function(e){this._instanceCount!==e&&(this._instanceCount=e,this.dirty=!0)}},shaderProgram:{get:function(){return this._shaderProgram},set:function(e){this._shaderProgram!==e&&(this._shaderProgram=e,this.dirty=!0)}},castShadows:{get:function(){return Hc(this,Yr.CAST_SHADOWS)},set:function(e){Hc(this,Yr.CAST_SHADOWS)!==e&&(Z_(this,Yr.CAST_SHADOWS,e),this.dirty=!0)}},receiveShadows:{get:function(){return Hc(this,Yr.RECEIVE_SHADOWS)},set:function(e){Hc(this,Yr.RECEIVE_SHADOWS)!==e&&(Z_(this,Yr.RECEIVE_SHADOWS,e),this.dirty=!0)}},uniformMap:{get:function(){return this._uniformMap},set:function(e){this._uniformMap!==e&&(this._uniformMap=e,this.dirty=!0)}},renderState:{get:function(){return this._renderState},set:function(e){this._renderState!==e&&(this._renderState=e,this.dirty=!0)}},framebuffer:{get:function(){return this._framebuffer},set:function(e){this._framebuffer!==e&&(this._framebuffer=e,this.dirty=!0)}},pass:{get:function(){return this._pass},set:function(e){this._pass!==e&&(this._pass=e,this.dirty=!0)}},executeInClosestFrustum:{get:function(){return Hc(this,Yr.EXECUTE_IN_CLOSEST_FRUSTUM)},set:function(e){Hc(this,Yr.EXECUTE_IN_CLOSEST_FRUSTUM)!==e&&(Z_(this,Yr.EXECUTE_IN_CLOSEST_FRUSTUM,e),this.dirty=!0)}},owner:{get:function(){return this._owner},set:function(e){this._owner!==e&&(this._owner=e,this.dirty=!0)}},debugShowBoundingVolume:{get:function(){return Hc(this,Yr.DEBUG_SHOW_BOUNDING_VOLUME)},set:function(e){Hc(this,Yr.DEBUG_SHOW_BOUNDING_VOLUME)!==e&&(Z_(this,Yr.DEBUG_SHOW_BOUNDING_VOLUME,e),this.dirty=!0)}},debugOverlappingFrustums:{get:function(){return this._debugOverlappingFrustums},set:function(e){this._debugOverlappingFrustums!==e&&(this._debugOverlappingFrustums=e,this.dirty=!0)}},pickId:{get:function(){return this._pickId},set:function(e){this._pickId!==e&&(this._pickId=e,this.dirty=!0)}},pickMetadataAllowed:{get:function(){return this._pickMetadataAllowed}},pickedMetadataInfo:{get:function(){return this._pickedMetadataInfo},set:function(e){this._pickedMetadataInfo!==e&&(this._pickedMetadataInfo=e,this.dirty=!0)}},pickOnly:{get:function(){return Hc(this,Yr.PICK_ONLY)},set:function(e){Hc(this,Yr.PICK_ONLY)!==e&&(Z_(this,Yr.PICK_ONLY,e),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return Hc(this,Yr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)},set:function(e){Hc(this,Yr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==e&&(Z_(this,Yr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,e),this.dirty=!0)}}});iD.shallowClone=function(e,t){if(l(e))return l(t)||(t=new iD),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._pickMetadataAllowed=e._pickMetadataAllowed,t._pickedMetadataInfo=e._pickedMetadataInfo,t._flags=e._flags,t.dirty=!0,t.lastDirtyTime=0,t};iD.prototype.execute=function(e,t){e.draw(this,t)};var nt=iD;var Pi={UNSIGNED_BYTE:ee.UNSIGNED_BYTE,UNSIGNED_SHORT:ee.UNSIGNED_SHORT,UNSIGNED_INT:ee.UNSIGNED_INT,FLOAT:ee.FLOAT,HALF_FLOAT:ee.HALF_FLOAT_OES,UNSIGNED_INT_24_8:ee.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:ee.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:ee.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:ee.UNSIGNED_SHORT_5_6_5};Pi.toWebGLConstant=function(e,t){switch(e){case Pi.UNSIGNED_BYTE:return ee.UNSIGNED_BYTE;case Pi.UNSIGNED_SHORT:return ee.UNSIGNED_SHORT;case Pi.UNSIGNED_INT:return ee.UNSIGNED_INT;case Pi.FLOAT:return ee.FLOAT;case Pi.HALF_FLOAT:return t.webgl2?ee.HALF_FLOAT:ee.HALF_FLOAT_OES;case Pi.UNSIGNED_INT_24_8:return ee.UNSIGNED_INT_24_8;case Pi.UNSIGNED_SHORT_4_4_4_4:return ee.UNSIGNED_SHORT_4_4_4_4;case Pi.UNSIGNED_SHORT_5_5_5_1:return ee.UNSIGNED_SHORT_5_5_5_1;case Pi.UNSIGNED_SHORT_5_6_5:return Pi.UNSIGNED_SHORT_5_6_5}};Pi.isPacked=function(e){return e===Pi.UNSIGNED_INT_24_8||e===Pi.UNSIGNED_SHORT_4_4_4_4||e===Pi.UNSIGNED_SHORT_5_5_5_1||e===Pi.UNSIGNED_SHORT_5_6_5};Pi.sizeInBytes=function(e){switch(e){case Pi.UNSIGNED_BYTE:return 1;case Pi.UNSIGNED_SHORT:case Pi.UNSIGNED_SHORT_4_4_4_4:case Pi.UNSIGNED_SHORT_5_5_5_1:case Pi.UNSIGNED_SHORT_5_6_5:case Pi.HALF_FLOAT:return 2;case Pi.UNSIGNED_INT:case Pi.FLOAT:case Pi.UNSIGNED_INT_24_8:return 4}};Pi.validate=function(e){return e===Pi.UNSIGNED_BYTE||e===Pi.UNSIGNED_SHORT||e===Pi.UNSIGNED_INT||e===Pi.FLOAT||e===Pi.HALF_FLOAT||e===Pi.UNSIGNED_INT_24_8||e===Pi.UNSIGNED_SHORT_4_4_4_4||e===Pi.UNSIGNED_SHORT_5_5_5_1||e===Pi.UNSIGNED_SHORT_5_6_5};Pi.getTypedArrayConstructor=function(e){let t=Pi.sizeInBytes(e);return t===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:t===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:t===Float32Array.BYTES_PER_ELEMENT&&e===Pi.FLOAT?Float32Array:Uint32Array};var He=Object.freeze(Pi);var Ze={DEPTH_COMPONENT:ee.DEPTH_COMPONENT,DEPTH_STENCIL:ee.DEPTH_STENCIL,ALPHA:ee.ALPHA,RED:ee.RED,R:ee.RED,RG:ee.RG,RGB:ee.RGB,RGBA:ee.RGBA,RED_INTEGER:ee.RED_INTEGER,RG_INTEGER:ee.RG_INTEGER,RGB_INTEGER:ee.RGB_INTEGER,RGBA_INTEGER:ee.RGBA_INTEGER,LUMINANCE:ee.LUMINANCE,LUMINANCE_ALPHA:ee.LUMINANCE_ALPHA,RGB_DXT1:ee.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:ee.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:ee.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:ee.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:ee.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:ee.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:ee.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:ee.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:ee.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:ee.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:ee.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:ee.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:ee.COMPRESSED_RGBA_BPTC_UNORM};Ze.componentsLength=function(e){switch(e){case Ze.RGB:case Ze.RGB_INTEGER:return 3;case Ze.RGBA:case Ze.RGBA_INTEGER:return 4;case Ze.LUMINANCE_ALPHA:case Ze.RG:case Ze.RG_INTEGER:return 2;case Ze.ALPHA:case Ze.RED:case Ze.RED_INTEGER:case Ze.LUMINANCE:return 1;case Ze.R:return 4;default:return 1}};Ze.validate=function(e){return e===Ze.DEPTH_COMPONENT||e===Ze.DEPTH_STENCIL||e===Ze.ALPHA||e===Ze.RED||e===Ze.RG||e===Ze.RGB||e===Ze.RGBA||e===Ze.RED_INTEGER||e===Ze.RG_INTEGER||e===Ze.RGB_INTEGER||e===Ze.RGBA_INTEGER||e===Ze.LUMINANCE||e===Ze.LUMINANCE_ALPHA||e===Ze.RGB_DXT1||e===Ze.RGBA_DXT1||e===Ze.RGBA_DXT3||e===Ze.RGBA_DXT5||e===Ze.RGB_PVRTC_4BPPV1||e===Ze.RGB_PVRTC_2BPPV1||e===Ze.RGBA_PVRTC_4BPPV1||e===Ze.RGBA_PVRTC_2BPPV1||e===Ze.RGBA_ASTC||e===Ze.RGB_ETC1||e===Ze.RGB8_ETC2||e===Ze.RGBA8_ETC2_EAC||e===Ze.RGBA_BC7||e===Ze.R};Ze.isColorFormat=function(e){return e===Ze.RED||e===Ze.ALPHA||e===Ze.RGB||e===Ze.RGBA||e===Ze.LUMINANCE||e===Ze.LUMINANCE_ALPHA||e===Ze.R};Ze.isDepthFormat=function(e){return e===Ze.DEPTH_COMPONENT||e===Ze.DEPTH_STENCIL};Ze.isCompressedFormat=function(e){return e===Ze.RGB_DXT1||e===Ze.RGBA_DXT1||e===Ze.RGBA_DXT3||e===Ze.RGBA_DXT5||e===Ze.RGB_PVRTC_4BPPV1||e===Ze.RGB_PVRTC_2BPPV1||e===Ze.RGBA_PVRTC_4BPPV1||e===Ze.RGBA_PVRTC_2BPPV1||e===Ze.RGBA_ASTC||e===Ze.RGB_ETC1||e===Ze.RGB8_ETC2||e===Ze.RGBA8_ETC2_EAC||e===Ze.RGBA_BC7};Ze.isDXTFormat=function(e){return e===Ze.RGB_DXT1||e===Ze.RGBA_DXT1||e===Ze.RGBA_DXT3||e===Ze.RGBA_DXT5};Ze.isPVRTCFormat=function(e){return e===Ze.RGB_PVRTC_4BPPV1||e===Ze.RGB_PVRTC_2BPPV1||e===Ze.RGBA_PVRTC_4BPPV1||e===Ze.RGBA_PVRTC_2BPPV1};Ze.isASTCFormat=function(e){return e===Ze.RGBA_ASTC};Ze.isETC1Format=function(e){return e===Ze.RGB_ETC1};Ze.isETC2Format=function(e){return e===Ze.RGB8_ETC2||e===Ze.RGBA8_ETC2_EAC};Ze.isBC7Format=function(e){return e===Ze.RGBA_BC7};Ze.compressedTextureSizeInBytes=function(e,t,n){switch(e){case Ze.RGB_DXT1:case Ze.RGBA_DXT1:case Ze.RGB_ETC1:case Ze.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case Ze.RGBA_DXT3:case Ze.RGBA_DXT5:case Ze.RGBA_ASTC:case Ze.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case Ze.RGB_PVRTC_4BPPV1:case Ze.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case Ze.RGB_PVRTC_2BPPV1:case Ze.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case Ze.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};Ze.textureSizeInBytes=function(e,t,n,i){let o=Ze.componentsLength(e);return He.isPacked(t)&&(o=1),o*He.sizeInBytes(t)*n*i};Ze.texture3DSizeInBytes=function(e,t,n,i,o){let r=Ze.componentsLength(e);return He.isPacked(t)&&(r=1),r*He.sizeInBytes(t)*n*i*o};Ze.alignmentInBytes=function(e,t,n){let i=Ze.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};Ze.createTypedArray=function(e,t,n,i){let o=He.getTypedArrayConstructor(t),r=Ze.componentsLength(e)*n*i;return new o(r)};Ze.flipY=function(e,t,n,i,o){if(o===1)return e;let r=Ze.createTypedArray(t,n,i,o),a=Ze.componentsLength(t),s=i*a;for(let c=0;c<o;++c){let u=c*i*a,f=(o-c-1)*i*a;for(let h=0;h<s;++h)r[f+h]=e[u+h]}return r};Ze.toInternalFormat=function(e,t,n){if(!n.webgl2)return e;if(e===Ze.DEPTH_STENCIL)return ee.DEPTH24_STENCIL8;if(e===Ze.DEPTH_COMPONENT){if(t===He.UNSIGNED_SHORT)return ee.DEPTH_COMPONENT16;if(t===He.UNSIGNED_INT)return ee.DEPTH_COMPONENT24}if(t===He.FLOAT)switch(e){case Ze.RGBA:return ee.RGBA32F;case Ze.RGB:return ee.RGB32F;case Ze.RG:return ee.RG32F;case Ze.RED:case Ze.R:return ee.R32F}if(t===He.HALF_FLOAT)switch(e){case Ze.RGBA:return ee.RGBA16F;case Ze.RGB:return ee.RGB16F;case Ze.RG:return ee.RG16F;case Ze.RED:case Ze.R:return ee.R16F}if(t===He.UNSIGNED_BYTE)switch(e){case Ze.RGBA:return ee.RGBA8;case Ze.RGB:return ee.RGB8;case Ze.RG:return ee.RG8;case Ze.RED:return ee.R8}if(t===He.INT)switch(e){case Ze.RGBA_INTEGER:return ee.RGBA32I;case Ze.RGB_INTEGER:return ee.RGB32I;case Ze.RG_INTEGER:return ee.RG32I;case Ze.RED_INTEGER:return ee.R32I}if(t===He.UNSIGNED_INT)switch(e){case Ze.RGBA_INTEGER:return ee.RGBA32UI;case Ze.RGB_INTEGER:return ee.RGB32UI;case Ze.RG_INTEGER:return ee.RG32UI;case Ze.RED_INTEGER:return ee.R32UI}return e};var qe=Object.freeze(Ze);var Nr={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximum3DTextureSize: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(Nr,{maximumCombinedTextureImageUnits:{get:function(){return Nr._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return Nr._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return Nr._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return Nr._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return Nr._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return Nr._maximumTextureSize}},maximum3DTextureSize:{get:function(){return Nr._maximum3DTextureSize}},maximumVaryingVectors:{get:function(){return Nr._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return Nr._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return Nr._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return Nr._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return Nr._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return Nr._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return Nr._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return Nr._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return Nr._maximumViewportWidth}},maximumViewportHeight:{get:function(){return Nr._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return Nr._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return Nr._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return Nr._maximumColorAttachments}},maximumSamples:{get:function(){return Nr._maximumSamples}},highpFloatSupported:{get:function(){return Nr._highpFloatSupported}},highpIntSupported:{get:function(){return Nr._highpIntSupported}}});var Rt=Nr;function Aj(e,t,n){let i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function UG(e,t,n){let i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function xh(e){e=e??V.EMPTY_OBJECT;let n=e.context._gl,i=Rt.maximumColorAttachments;if(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=e.destroyAttachments??!0,this._bind(),l(e.colorTextures)){let o=e.colorTextures,r=this._colorTextures.length=this._activeColorAttachments.length=o.length;for(let a=0;a<r;++a){let s=o[a],c=this._gl.COLOR_ATTACHMENT0+a;Aj(this,c,s),this._activeColorAttachments[a]=c,this._colorTextures[a]=s}}if(l(e.colorRenderbuffers)){let o=e.colorRenderbuffers,r=this._colorRenderbuffers.length=this._activeColorAttachments.length=o.length;for(let a=0;a<r;++a){let s=o[a],c=this._gl.COLOR_ATTACHMENT0+a;UG(this,c,s),this._activeColorAttachments[a]=c,this._colorRenderbuffers[a]=s}}if(l(e.depthTexture)){let o=e.depthTexture;Aj(this,this._gl.DEPTH_ATTACHMENT,o),this._depthTexture=o}if(l(e.depthRenderbuffer)){let o=e.depthRenderbuffer;UG(this,this._gl.DEPTH_ATTACHMENT,o),this._depthRenderbuffer=o}if(l(e.stencilRenderbuffer)){let o=e.stencilRenderbuffer;UG(this,this._gl.STENCIL_ATTACHMENT,o),this._stencilRenderbuffer=o}if(l(e.depthStencilTexture)){let o=e.depthStencilTexture;Aj(this,this._gl.DEPTH_STENCIL_ATTACHMENT,o),this._depthStencilTexture=o}if(l(e.depthStencilRenderbuffer)){let o=e.depthStencilRenderbuffer;UG(this,this._gl.DEPTH_STENCIL_ATTACHMENT,o),this._depthStencilRenderbuffer=o}this._unBind()}Object.defineProperties(xh.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)}}});xh.prototype._bind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)};xh.prototype._unBind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)};xh.prototype.bindDraw=function(){let e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)};xh.prototype.bindRead=function(){let e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)};xh.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments};xh.prototype.getColorTexture=function(e){return this._colorTextures[e]};xh.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]};xh.prototype.isDestroyed=function(){return!1};xh.prototype.destroy=function(){if(this.destroyAttachments){let e=this._colorTextures;for(let n=0;n<e.length;++n){let i=e[n];l(i)&&i.destroy()}let t=this._colorRenderbuffers;for(let n=0;n<t.length;++n){let i=t[n];l(i)&&i.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),fe(this)};var la=xh;var zG={CLOCKWISE:ee.CW,COUNTER_CLOCKWISE:ee.CCW};zG.validate=function(e){return e===zG.CLOCKWISE||e===zG.COUNTER_CLOCKWISE};var Ya=Object.freeze(zG);function sre(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]=sre(e[t]));return Object.freeze(e)}var gj=sre;function op(e){let t=e??V.EMPTY_OBJECT,n=t.cull??V.EMPTY_OBJECT,i=t.polygonOffset??V.EMPTY_OBJECT,o=t.scissorTest??V.EMPTY_OBJECT,r=o.rectangle??V.EMPTY_OBJECT,a=t.depthRange??V.EMPTY_OBJECT,s=t.depthTest??V.EMPTY_OBJECT,c=t.colorMask??V.EMPTY_OBJECT,u=t.blending??V.EMPTY_OBJECT,f=u.color??V.EMPTY_OBJECT,h=t.stencilTest??V.EMPTY_OBJECT,p=h.frontOperation??V.EMPTY_OBJECT,A=h.backOperation??V.EMPTY_OBJECT,m=t.sampleCoverage??V.EMPTY_OBJECT,_=t.viewport;this.frontFace=t.frontFace??Ya.COUNTER_CLOCKWISE,this.cull={enabled:n.enabled??!1,face:n.face??ee.BACK},this.lineWidth=t.lineWidth??1,this.polygonOffset={enabled:i.enabled??!1,factor:i.factor??0,units:i.units??0},this.scissorTest={enabled:o.enabled??!1,rectangle:et.clone(r)},this.depthRange={near:a.near??0,far:a.far??1},this.depthTest={enabled:s.enabled??!1,func:s.func??ee.LESS},this.colorMask={red:c.red??!0,green:c.green??!0,blue:c.blue??!0,alpha:c.alpha??!0},this.depthMask=t.depthMask??!0,this.stencilMask=t.stencilMask??-1,this.blending={enabled:u.enabled??!1,color:new z(f.red??0,f.green??0,f.blue??0,f.alpha??0),equationRgb:u.equationRgb??ee.FUNC_ADD,equationAlpha:u.equationAlpha??ee.FUNC_ADD,functionSourceRgb:u.functionSourceRgb??ee.ONE,functionSourceAlpha:u.functionSourceAlpha??ee.ONE,functionDestinationRgb:u.functionDestinationRgb??ee.ZERO,functionDestinationAlpha:u.functionDestinationAlpha??ee.ZERO},this.stencilTest={enabled:h.enabled??!1,frontFunction:h.frontFunction??ee.ALWAYS,backFunction:h.backFunction??ee.ALWAYS,reference:h.reference??0,mask:h.mask??-1,frontOperation:{fail:p.fail??ee.KEEP,zFail:p.zFail??ee.KEEP,zPass:p.zPass??ee.KEEP},backOperation:{fail:A.fail??ee.KEEP,zFail:A.zFail??ee.KEEP,zPass:A.zPass??ee.KEEP}},this.sampleCoverage={enabled:m.enabled??!1,value:m.value??1,invert:m.invert??!1},this.viewport=l(_)?new et(_.x,_.y,_.width,_.height):void 0,this.id=0,this._applyFunctions=[]}var ZMe=0,ip={};op.fromCache=function(e){let t=JSON.stringify(e),n=ip[t];if(l(n))return++n.referenceCount,n.state;let i=new op(e),o=JSON.stringify(i);return n=ip[o],l(n)||(i.id=ZMe++,n={referenceCount:0,state:i},ip[o]=n),++n.referenceCount,ip[t]={referenceCount:1,state:n.state},n.state};op.removeFromCache=function(e){let t=new op(e),n=JSON.stringify(t),i=ip[n],o=JSON.stringify(e),r=ip[o];l(r)&&(--r.referenceCount,r.referenceCount===0&&(delete ip[o],l(i)&&--i.referenceCount)),l(i)&&i.referenceCount===0&&delete ip[n]};op.getCache=function(){return ip};op.clearCache=function(){ip={}};function bE(e,t,n){n?e.enable(t):e.disable(t)}function cre(e,t){e.frontFace(t.frontFace)}function lre(e,t){let n=t.cull,i=n.enabled;bE(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function ure(e,t){e.lineWidth(t.lineWidth)}function fre(e,t){let n=t.polygonOffset,i=n.enabled;bE(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function dre(e,t,n){let i=t.scissorTest,o=l(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(bE(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 hre(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function mre(e,t){let n=t.depthTest,i=n.enabled;bE(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function pre(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function Are(e,t){e.depthMask(t.depthMask)}function gre(e,t){e.stencilMask(t.stencilMask)}function $Me(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function _re(e,t,n){let i=t.blending,o=l(n.blendingEnabled)?n.blendingEnabled:i.enabled;bE(e,e.BLEND,o),o&&($Me(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function yre(e,t){let n=t.stencilTest,i=n.enabled;if(bE(e,e.STENCIL_TEST,i),i){let o=n.frontFunction,r=n.backFunction,a=n.reference,s=n.mask;e.stencilFunc(o,a,s),e.stencilFuncSeparate(e.BACK,r,a,s),e.stencilFuncSeparate(e.FRONT,o,a,s);let c=n.frontOperation,u=c.fail,f=c.zFail,h=c.zPass;e.stencilOpSeparate(e.FRONT,u,f,h);let p=n.backOperation,A=p.fail,m=p.zFail,_=p.zPass;e.stencilOpSeparate(e.BACK,A,m,_)}}function Cre(e,t){let n=t.sampleCoverage,i=n.enabled;bE(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}var eNe=new et;function Ere(e,t,n){let i=t.viewport??n.viewport;l(i)||(i=eNe,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)}op.apply=function(e,t,n){cre(e,t),lre(e,t),ure(e,t),fre(e,t),hre(e,t),mre(e,t),pre(e,t),Are(e,t),gre(e,t),yre(e,t),Cre(e,t),dre(e,t,n),_re(e,t,n),Ere(e,t,n)};function tNe(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(cre),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(lre),e.lineWidth!==t.lineWidth&&n.push(ure),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(fre),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(hre),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(mre),(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(pre),e.depthMask!==t.depthMask&&n.push(Are),e.stencilMask!==t.stencilMask&&n.push(gre),(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(yre),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(Cre),n}op.partialApply=function(e,t,n,i,o,r){if(t!==n){let f=n._applyFunctions[t.id];l(f)||(f=tNe(t,n),n._applyFunctions[t.id]=f);let h=f.length;for(let p=0;p<h;++p)f[p](e,n)}let a=l(i.scissorTest)?i.scissorTest:t.scissorTest,s=l(o.scissorTest)?o.scissorTest:n.scissorTest;(a!==s||r)&&dre(e,n,o);let c=l(i.blendingEnabled)?i.blendingEnabled:t.blending.enabled,u=l(o.blendingEnabled)?o.blendingEnabled:n.blending.enabled;(c!==u||u&&t.blending!==n.blending)&&_re(e,n,o),(t!==n||i!==o||i.context!==o.context)&&Ere(e,n,o)};op.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:et.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:z.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)?et.clone(e.viewport):void 0}};var Ve=op;function rn(e,t,n,i){this[0]=e??0,this[1]=n??0,this[2]=t??0,this[3]=i??0}rn.packedLength=4;rn.pack=function(e,t,n){return n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t};rn.unpack=function(e,t,n){return t=t??0,l(n)||(n=new rn),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n};rn.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)rn.pack(e[o],t,o*4);return t};rn.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]=rn.unpack(e,i,t[o])}return t};rn.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 rn(e[0],e[2],e[1],e[3])};rn.fromArray=rn.unpack;rn.fromColumnMajorArray=function(e,t){return rn.clone(e,t)};rn.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 rn(e[0],e[1],e[2],e[3])};rn.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new rn(e.x,0,0,e.y)};rn.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new rn(e,0,0,e)};rn.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 rn(n,-i,i,n)};rn.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]]};rn.getElementIndex=function(e,t){return e*2+t};rn.getColumn=function(e,t,n){let i=t*2,o=e[i],r=e[i+1];return n.x=o,n.y=r,n};rn.setColumn=function(e,t,n,i){i=rn.clone(e,i);let o=t*2;return i[o]=n.x,i[o+1]=n.y,i};rn.getRow=function(e,t,n){let i=e[t],o=e[t+2];return n.x=i,n.y=o,n};rn.setRow=function(e,t,n,i){return i=rn.clone(e,i),i[t]=n.x,i[t+2]=n.y,i};var nNe=new k;rn.setScale=function(e,t,n){let i=rn.getScale(e,nNe),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 iNe=new k;rn.setUniformScale=function(e,t,n){let i=rn.getScale(e,iNe),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 bre=new k;rn.getScale=function(e,t){return t.x=k.magnitude(k.fromElements(e[0],e[1],bre)),t.y=k.magnitude(k.fromElements(e[2],e[3],bre)),t};var Ire=new k;rn.getMaximumScale=function(e){return rn.getScale(e,Ire),k.maximumComponent(Ire)};var oNe=new k;rn.setRotation=function(e,t,n){let i=rn.getScale(e,oNe);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 rNe=new k;rn.getRotation=function(e,t){let n=rn.getScale(e,rNe);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};rn.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],a=e[1]*t[2]+e[3]*t[3];return n[0]=i,n[1]=r,n[2]=o,n[3]=a,n};rn.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};rn.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};rn.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};rn.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};rn.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};rn.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};rn.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};rn.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};rn.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};rn.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]};rn.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]};rn.equalsEpsilon=function(e,t,n){return n=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};rn.IDENTITY=Object.freeze(new rn(1,0,0,1));rn.ZERO=Object.freeze(new rn(0,0,0,0));rn.COLUMN0ROW0=0;rn.COLUMN0ROW1=1;rn.COLUMN1ROW0=2;rn.COLUMN1ROW1=3;Object.defineProperties(rn.prototype,{length:{get:function(){return rn.packedLength}}});rn.prototype.clone=function(e){return rn.clone(this,e)};rn.prototype.equals=function(e){return rn.equals(this,e)};rn.prototype.equalsEpsilon=function(e,t){return rn.equalsEpsilon(this,e,t)};rn.prototype.toString=function(){return`(${this[0]}, ${this[2]})
(${this[1]}, ${this[3]})`};var ji=rn;function aNe(e,t,n,i){switch(t.type){case e.FLOAT:return new xre(e,t,n,i);case e.FLOAT_VEC2:return new Tre(e,t,n,i);case e.FLOAT_VEC3:return new Sre(e,t,n,i);case e.FLOAT_VEC4:return new wre(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_3D:case e.SAMPLER_CUBE:case e.SAMPLER_2D_ARRAY:return new GG(e,t,n,i);case e.UNSIGNED_INT_SAMPLER_2D:return new GG(e,t,n,i);case e.INT:case e.BOOL:return new Bre(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new Dre(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new vre(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new Pre(e,t,n,i);case e.FLOAT_MAT2:return new Rre(e,t,n,i);case e.FLOAT_MAT3:return new Mre(e,t,n,i);case e.FLOAT_MAT4:return new Nre(e,t,n,i);default:throw new ue(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function xre(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}xre.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))};function Tre(e,t,n,i){this.name=n,this.value=void 0,this._value=new k,this._gl=e,this._location=i}Tre.prototype.set=function(){let e=this.value;k.equals(e,this._value)||(k.clone(e,this._value),this._gl.uniform2f(this._location,e.x,e.y))};function Sre(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}Sre.prototype.set=function(){let e=this.value;e&&(l(e.red)?z.equals(e,this._value)||(this._value=z.clone(e,this._value),this._gl.uniform3f(this._location,e.red,e.green,e.blue)):l(e.x)&&(d.equals(e,this._value)||(this._value=d.clone(e,this._value),this._gl.uniform3f(this._location,e.x,e.y,e.z))))};function wre(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}wre.prototype.set=function(){let e=this.value;l(e.red)?z.equals(e,this._value)||(this._value=z.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha)):l(e.x)&&(ie.equals(e,this._value)||(this._value=ie.clone(e,this._value),this._gl.uniform4f(this._location,e.x,e.y,e.z,e.w)))};function GG(e,t,n,i){this.name=n,this.value=void 0,this._gl=e,this._location=i,this.textureUnitIndex=void 0}GG.prototype.set=function(){let e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);let t=this.value;t&&e.bindTexture(t._target,t._texture)};GG.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1};function Bre(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}Bre.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))};function Dre(e,t,n,i){this.name=n,this.value=void 0,this._value=new k,this._gl=e,this._location=i}Dre.prototype.set=function(){let e=this.value;k.equals(e,this._value)||(k.clone(e,this._value),this._gl.uniform2i(this._location,e.x,e.y))};function vre(e,t,n,i){this.name=n,this.value=void 0,this._value=new d,this._gl=e,this._location=i}vre.prototype.set=function(){let e=this.value;d.equals(e,this._value)||(d.clone(e,this._value),this._gl.uniform3i(this._location,e.x,e.y,e.z))};function Pre(e,t,n,i){this.name=n,this.value=void 0,this._value=new ie,this._gl=e,this._location=i}Pre.prototype.set=function(){let e=this.value;ie.equals(e,this._value)||(ie.clone(e,this._value),this._gl.uniform4i(this._location,e.x,e.y,e.z,e.w))};var sNe=new Float32Array(4);function Rre(e,t,n,i){this.name=n,this.value=void 0,this._value=new ji,this._gl=e,this._location=i}Rre.prototype.set=function(){if(!ji.equalsArray(this.value,this._value,0)){ji.clone(this.value,this._value);let e=ji.toArray(this.value,sNe);this._gl.uniformMatrix2fv(this._location,!1,e)}};var cNe=new Float32Array(9);function Mre(e,t,n,i){this.name=n,this.value=void 0,this._value=new J,this._gl=e,this._location=i}Mre.prototype.set=function(){if(!J.equalsArray(this.value,this._value,0)){J.clone(this.value,this._value);let e=J.toArray(this.value,cNe);this._gl.uniformMatrix3fv(this._location,!1,e)}};var lNe=new Float32Array(16);function Nre(e,t,n,i){this.name=n,this.value=void 0,this._value=new M,this._gl=e,this._location=i}Nre.prototype.set=function(){if(!M.equalsArray(this.value,this._value,0)){M.clone(this.value,this._value);let e=M.toArray(this.value,lNe);this._gl.uniformMatrix4fv(this._location,!1,e)}};var oD=aNe;function uNe(e,t,n,i){switch(t.type){case e.FLOAT:return new Lre(e,t,n,i);case e.FLOAT_VEC2:return new Ore(e,t,n,i);case e.FLOAT_VEC3:return new Fre(e,t,n,i);case e.FLOAT_VEC4:return new Qre(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_3D:case e.SAMPLER_CUBE:return new _j(e,t,n,i);case e.INT:case e.BOOL:return new kre(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new Ure(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new zre(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new Gre(e,t,n,i);case e.FLOAT_MAT2:return new Vre(e,t,n,i);case e.FLOAT_MAT3:return new Hre(e,t,n,i);case e.FLOAT_MAT4:return new Wre(e,t,n,i);default:throw new ue(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function Lre(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]}Lre.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 Ore(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]}Ore.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 a=e[r];k.equalsArray(a,n,o)||(k.pack(a,n,o),i=!0),o+=2}i&&this._gl.uniform2fv(this._location,n)};function Fre(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]}Fre.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 a=e[r];l(a.red)?(a.red!==n[o]||a.green!==n[o+1]||a.blue!==n[o+2])&&(n[o]=a.red,n[o+1]=a.green,n[o+2]=a.blue,i=!0):l(a.x)&&(d.equalsArray(a,n,o)||(d.pack(a,n,o),i=!0)),o+=3}i&&this._gl.uniform3fv(this._location,n)};function Qre(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]}Qre.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 a=e[r];l(a.red)?z.equalsArray(a,n,o)||(z.pack(a,n,o),i=!0):l(a.x)&&(ie.equalsArray(a,n,o)||(ie.pack(a,n,o),i=!0)),o+=4}i&&this._gl.uniform4fv(this._location,n)};function _j(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}_j.prototype.set=function(){let e=this._gl,t=e.TEXTURE0+this.textureUnitIndex,n=this.value,i=n.length;for(let o=0;o<i;++o){let r=n[o];r&&(e.activeTexture(t+o),e.bindTexture(r._target,r._texture))}};_j.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 kre(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]}kre.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 Ure(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]}Ure.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 a=e[r];k.equalsArray(a,n,o)||(k.pack(a,n,o),i=!0),o+=2}i&&this._gl.uniform2iv(this._location,n)};function zre(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]}zre.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 a=e[r];d.equalsArray(a,n,o)||(d.pack(a,n,o),i=!0),o+=3}i&&this._gl.uniform3iv(this._location,n)};function Gre(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]}Gre.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 a=e[r];ie.equalsArray(a,n,o)||(ie.pack(a,n,o),i=!0),o+=4}i&&this._gl.uniform4iv(this._location,n)};function Vre(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]}Vre.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 a=e[r];ji.equalsArray(a,n,o)||(ji.pack(a,n,o),i=!0),o+=4}i&&this._gl.uniformMatrix2fv(this._location,!1,n)};function Hre(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]}Hre.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 a=e[r];J.equalsArray(a,n,o)||(J.pack(a,n,o),i=!0),o+=9}i&&this._gl.uniformMatrix3fv(this._location,!1,n)};function Wre(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]}Wre.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 a=e[r];M.equalsArray(a,n,o)||(M.pack(a,n,o),i=!0),o+=16}i&&this._gl.uniformMatrix4fv(this._location,!1,n)};var rD=uNe;var fNe=0;function PA(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=dNe(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=fNe++}PA.fromCache=function(e){return e=e??V.EMPTY_OBJECT,e.context.shaderCache.getShaderProgram(e)};PA.replaceCache=function(e){return e=e??V.EMPTY_OBJECT,e.context.shaderCache.replaceShaderProgram(e)};Object.defineProperties(PA.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return VG(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return VG(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return VG(this),this._uniformsByName}}});function jre(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(),a=r.slice(r.lastIndexOf(" ")+1);t.push(a)}}return t}function dNe(e,t){let n={};if(!Rt.highpFloatSupported||!Rt.highpIntSupported){let i,o,r,a,s=jre(e),c=jre(t),u=s.length,f=c.length;for(i=0;i<u;i++)for(o=0;o<f;o++)if(s[i]===c[o]){r=s[i],a=`czm_mediump_${r}`;let h=new RegExp(`${r}\\b`,"g");t=t.replace(h,a),n[a]=r}}return{fragmentShaderText:t,duplicateUniformNames:n}}var rp="[Cesium WebGL] ";function hNe(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 a=e.createProgram();e.attachShader(a,o),e.attachShader(a,r);let s=t._attributeLocations;if(l(s))for(let p in s)s.hasOwnProperty(p)&&e.bindAttribLocation(a,s[p],p);e.linkProgram(a);let c;if(e.getProgramParameter(a,e.LINK_STATUS))return t._logShaderCompilation&&(c=e.getShaderInfoLog(o),l(c)&&c.length>0&&console.log(`${rp}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(r),l(c)&&c.length>0&&console.log(`${rp}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(a),l(c)&&c.length>0&&console.log(`${rp}Shader program link log: ${c}`)),e.deleteShader(o),e.deleteShader(r),a;let u,f=t._debugShaders;throw e.getShaderParameter(r,e.COMPILE_STATUS)?e.getShaderParameter(o,e.COMPILE_STATUS)?(c=e.getProgramInfoLog(a),console.error(`${rp}Shader program link log: ${c}`),h(o,"vertex"),h(r,"fragment"),u=`Program failed to link. Link log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${rp}Vertex shader compile log: ${c}`),console.error(`${rp} Vertex shader source:
${n}`),u=`Vertex shader failed to compile. Compile log: ${c}`):(c=e.getShaderInfoLog(r),console.error(`${rp}Fragment shader compile log: ${c}`),console.error(`${rp} Fragment shader source:
${i}`),u=`Fragment shader failed to compile. Compile log: ${c}`),e.deleteShader(o),e.deleteShader(r),e.deleteProgram(a),new ue(u);function h(p,A){if(!l(f))return;let m=f.getTranslatedShaderSource(p);if(m===""){console.error(`${rp}${A} shader translation failed.`);return}console.error(`${rp}Translated ${A} shaderSource:
${m}`)}}function mNe(e,t,n){let i={};for(let o=0;o<n;++o){let r=e.getActiveAttrib(t,o),a=e.getAttribLocation(t,r.name);i[r.name]={name:r.name,type:r.type,index:a}}return i}function pNe(e,t){let n={},i=[],o=[],r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let a=0;a<r;++a){let s=e.getActiveUniform(t,a),c="[0]",u=s.name.indexOf(c,s.name.length-c.length)!==-1?s.name.slice(0,s.name.length-3):s.name;if(u.indexOf("gl_")!==0)if(s.name.indexOf("[")<0){let f=e.getUniformLocation(t,u);if(f!==null){let h=oD(e,s,u,f);n[u]=h,i.push(h),h._setSampler&&o.push(h)}}else{let f,h,p,A,m=u.indexOf("[");if(m>=0){if(f=n[u.slice(0,m)],!l(f))continue;h=f._locations,h.length<=1&&(p=f.value,A=e.getUniformLocation(t,u),A!==null&&(h.push(A),p.push(e.getUniform(t,A))))}else{h=[];for(let _=0;_<s.size;++_)A=e.getUniformLocation(t,`${u}[${_}]`),A!==null&&h.push(A);f=rD(e,s,u,h),n[u]=f,i.push(f),f._setSampler&&o.push(f)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:o}}function ANe(e,t){let n=[],i=[];for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],a=o,s=e._duplicateUniformNames[a];l(s)&&(r.name=s,a=s);let c=xA[a];l(c)?n.push({uniform:r,automaticUniform:c}):i.push(r)}return{automaticUniforms:n,manualUniforms:i}}function gNe(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 VG(e){l(e._program)||Yre(e)}function Yre(e){let t=e._program,n=e._gl,i=hNe(n,e,e._debugShaders),o=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),r=pNe(n,i),a=ANe(e,r.uniformsByName);e._program=i,e._numberOfVertexAttributes=o,e._vertexAttributes=mNe(n,i,o),e._uniformsByName=r.uniformsByName,e._uniforms=r.uniforms,e._automaticUniforms=a.automaticUniforms,e._manualUniforms=a.manualUniforms,e.maximumTextureUnitIndex=gNe(n,i,r.samplerUniforms),t&&e._gl.deleteProgram(t),typeof spector<"u"&&(e._program.__SPECTOR_rebuildProgram=function(s,c,u,f){let h=e._vertexShaderText,p=e._fragmentShaderText,A=/ ! = /g;e._vertexShaderText=s.replace(A," != "),e._fragmentShaderText=c.replace(A," != ");try{Yre(e),u(e._program)}catch(m){e._vertexShaderText=h,e._fragmentShaderText=p;let y=/(?:Compile|Link) error: ([^]*)/.exec(m.message);f(y?y[1]:m.message)}})}PA.prototype._bind=function(){VG(this),this._gl.useProgram(this._program)};PA.prototype._setUniforms=function(e,t,n){let i,o;if(l(e)){let s=this._manualUniforms;for(i=s.length,o=0;o<i;++o){let c=s[o];c.value=e[c.name]()}}let r=this._automaticUniforms;for(i=r.length,o=0;o<i;++o){let s=r[o];s.uniform.value=s.automaticUniform.getValue(t)}let a=this._uniforms;for(i=a.length,o=0;o<i;++o)a[o].set();if(n){let s=this._gl,c=this._program;s.validateProgram(c)}};PA.prototype.isDestroyed=function(){return!1};PA.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)};PA.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),fe(this)};var $t=PA;function HG(e){this._context=e}var aD,_Ne=new nt({primitiveType:ve.TRIANGLES}),yNe=new fi({color:new z(0,0,0,0)});function CNe(e,t){return new la({context:e,colorTextures:[t],destroyAttachments:!1})}function ENe(e,t){return $t.fromCache({context:e,vertexShaderSource:EE,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function bNe(e,t){return(!l(aD)||aD.viewport.width!==e||aD.viewport.height!==t)&&(aD=Ve.fromCache({viewport:new et(0,0,e,t)})),aD}HG.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(),a=l(e.shaderProgram)?e.shaderProgram:ENe(o,e.fragmentShaderSource),s=CNe(o,t),c=bNe(n,i),u=e.uniformMap,f=yNe;f.framebuffer=s,f.renderState=c,f.execute(o);let h=_Ne;h.vertexArray=r,h.renderState=c,h.shaderProgram=a,h.uniformMap=u,h.framebuffer=s,h.execute(o),s.destroy(),e.persists||(a.destroy(),l(e.vertexArray)&&r.destroy()),l(e.postExecute)&&e.postExecute(t)};HG.prototype.isDestroyed=function(){return!1};HG.prototype.destroy=function(){return fe(this)};var sD=HG;var Mn={BYTE:ee.BYTE,UNSIGNED_BYTE:ee.UNSIGNED_BYTE,SHORT:ee.SHORT,UNSIGNED_SHORT:ee.UNSIGNED_SHORT,INT:ee.INT,UNSIGNED_INT:ee.UNSIGNED_INT,FLOAT:ee.FLOAT,DOUBLE:ee.DOUBLE};Mn.getSizeInBytes=function(e){switch(e){case Mn.BYTE:return Int8Array.BYTES_PER_ELEMENT;case Mn.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Mn.SHORT:return Int16Array.BYTES_PER_ELEMENT;case Mn.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Mn.INT:return Int32Array.BYTES_PER_ELEMENT;case Mn.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case Mn.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case Mn.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}};Mn.fromTypedArray=function(e){if(e instanceof Int8Array)return Mn.BYTE;if(e instanceof Uint8Array)return Mn.UNSIGNED_BYTE;if(e instanceof Int16Array)return Mn.SHORT;if(e instanceof Uint16Array)return Mn.UNSIGNED_SHORT;if(e instanceof Int32Array)return Mn.INT;if(e instanceof Uint32Array)return Mn.UNSIGNED_INT;if(e instanceof Float32Array)return Mn.FLOAT;if(e instanceof Float64Array)return Mn.DOUBLE};Mn.validate=function(e){return l(e)&&(e===Mn.BYTE||e===Mn.UNSIGNED_BYTE||e===Mn.SHORT||e===Mn.UNSIGNED_SHORT||e===Mn.INT||e===Mn.UNSIGNED_INT||e===Mn.FLOAT||e===Mn.DOUBLE)};Mn.createTypedArray=function(e,t){switch(e){case Mn.BYTE:return new Int8Array(t);case Mn.UNSIGNED_BYTE:return new Uint8Array(t);case Mn.SHORT:return new Int16Array(t);case Mn.UNSIGNED_SHORT:return new Uint16Array(t);case Mn.INT:return new Int32Array(t);case Mn.UNSIGNED_INT:return new Uint32Array(t);case Mn.FLOAT:return new Float32Array(t);case Mn.DOUBLE:return new Float64Array(t)}};Mn.createArrayBufferView=function(e,t,n,i){switch(n=n??0,i=i??(t.byteLength-n)/Mn.getSizeInBytes(e),e){case Mn.BYTE:return new Int8Array(t,n,i);case Mn.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case Mn.SHORT:return new Int16Array(t,n,i);case Mn.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case Mn.INT:return new Int32Array(t,n,i);case Mn.UNSIGNED_INT:return new Uint32Array(t,n,i);case Mn.FLOAT:return new Float32Array(t,n,i);case Mn.DOUBLE:return new Float64Array(t,n,i)}};Mn.fromName=function(e){switch(e){case"BYTE":return Mn.BYTE;case"UNSIGNED_BYTE":return Mn.UNSIGNED_BYTE;case"SHORT":return Mn.SHORT;case"UNSIGNED_SHORT":return Mn.UNSIGNED_SHORT;case"INT":return Mn.INT;case"UNSIGNED_INT":return Mn.UNSIGNED_INT;case"FLOAT":return Mn.FLOAT;case"DOUBLE":return Mn.DOUBLE}};var j=Object.freeze(Mn);var INe={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},ud=Object.freeze(INe);function yj(e){e=e??V.EMPTY_OBJECT,this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=e.primitiveType??ve.TRIANGLES,this.boundingSphere=e.boundingSphere,this.geometryType=e.geometryType??ud.NONE,this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}yj.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 xNe=new me,TNe=new d,qre=new M,SNe=[new me,new me,new me],wNe=[new k,new k,new k],BNe=[new k,new k,new k],DNe=new d,vNe=new Qe,PNe=new M,RNe=new ji;yj._textureCoordinateRotationPoints=function(e,t,n,i){let o,r=ce.center(i,xNe),a=me.toCartesian(r,n,TNe),s=At.eastNorthUpToFixedFrame(a,n,qre),c=M.inverse(s,qre),u=wNe,f=SNe;f[0].longitude=i.west,f[0].latitude=i.south,f[1].longitude=i.west,f[1].latitude=i.north,f[2].longitude=i.east,f[2].latitude=i.south;let h=DNe;for(o=0;o<3;o++)me.toCartesian(f[o],n,h),h=M.multiplyByPointAsVector(c,h,h),u[o].x=h.x,u[o].y=h.y;let p=Qe.fromAxisAngle(d.UNIT_Z,-t,vNe),A=J.fromQuaternion(p,PNe),m=e.length,_=Number.POSITIVE_INFINITY,y=Number.POSITIVE_INFINITY,C=Number.NEGATIVE_INFINITY,E=Number.NEGATIVE_INFINITY;for(o=0;o<m;o++)h=M.multiplyByPointAsVector(c,e[o],h),h=J.multiplyByVector(A,h,h),_=Math.min(_,h.x),y=Math.min(y,h.y),C=Math.max(C,h.x),E=Math.max(E,h.y);let b=ji.fromRotation(t,RNe),x=BNe;x[0].x=_,x[0].y=y,x[1].x=_,x[1].y=E,x[2].x=C,x[2].y=y;let S=u[0],B=u[2].x-S.x,v=u[1].y-S.y;for(o=0;o<3;o++){let I=x[o];ji.multiplyByVector(b,I,I),I.x=(I.x-S.x)/B,I.y=(I.y-S.y)/v}let P=x[0],N=x[1],L=x[2],g=new Array(6);return k.pack(P,g),k.pack(N,g,2),k.pack(L,g,4),g};var yt=yj;function MNe(e){e=e??V.EMPTY_OBJECT,this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.values=e.values}var Me=MNe;function bx(e,t,n,i,o){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=o}Object.defineProperties(bx.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}}});bx.clone=function(e){if(l(e))return new bx(e._format,e._datatype,e._width,e._height,e._buffer)};bx.prototype.clone=function(){return bx.clone(this)};var cD=bx;var Kre=Wr(rf(),1);function Xre(){if(!l($s._canTransferArrayBuffer)){let e=bj("transferTypedArrayTest");e.postMessage=e.webkitPostMessage??e.postMessage;let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return $s._canTransferArrayBuffer=!1,$s._canTransferArrayBuffer}$s._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(o){let r=o.data.array,a=l(r)&&r[0]===t;i(a),e.terminate(),$s._canTransferArrayBuffer=a}})}return $s._canTransferArrayBuffer}var Ej=new _e;function Cj(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 bj(e){let t=new Kre.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),o={},r,a;if(q_(e))a=e;else if(!n){let s=Zt(`${$s._workerModulePrefix}/${i}.js`);q_(s)&&(a=s)}if(a){let s=`import "${a}";`;return r=Cj(s),o.type="module",new Worker(r,o)}if(!n&&typeof CESIUM_WORKERS<"u"){let s=`
importScripts("${Cj(CESIUM_WORKERS)}");
CesiumWorkers["${i}"]();
`;return r=Cj(s),new Worker(r,o)}if(r=e,n||(r=Zt(`${$s._workerModulePrefix+i}.js`)),!fn.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 NNe(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!fn.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=Zt(t.fallbackModulePath),n}n.wasmBinaryFile=Zt(t.wasmBinaryFile);let i=await De.fetchArrayBuffer({url:n.wasmBinaryFile});return n.wasmBinary=i,n}function $s(e,t){this._workerPath=e,this._maximumActiveTasks=t??Number.POSITIVE_INFINITY,this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var LNe=(e,t,n,i)=>{let o=({data:r})=>{if(r.id===t){if(l(r.error)){let a=r.error;a.name==="RuntimeError"?(a=new ue(r.error.message),a.stack=r.error.stack):a.name==="DeveloperError"?(a=new de(r.error.message),a.stack=r.error.stack):a.name==="Error"&&(a=new Error(r.error.message),a.stack=r.error.stack),Ej.raiseEvent(a),i(a)}else Ej.raiseEvent(),n(r.result);e.removeEventListener("message",o)}};return o},ONe=[];async function FNe(e,t,n){let i=await Promise.resolve(Xre());l(n)?i||(n.length=0):n=ONe;let o=e._nextID++,r=new Promise((a,s)=>{e._worker.addEventListener("message",LNe(e._worker,o,a,s))});return e._worker.postMessage({id:o,baseUrl:Zt.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),r}async function QNe(e,t,n){++e._activeTasks;try{let i=await FNe(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}$s.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=bj(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return QNe(this,e,t)};$s.prototype.initWebAssemblyModule=async function(e){if(l(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=bj(this._workerPath),i=await NNe(this,e),o=await Promise.resolve(Xre()),r,a=i.wasmBinary;l(a)&&o&&(r=[a]);let s=new Promise((c,u)=>{n.onmessage=function({data:f}){l(f)?c(f.result):u(new ue("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:i}},r),s};return this._webAssemblyPromise=t(),this._webAssemblyPromise};$s.prototype.isDestroyed=function(){return!1};$s.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),fe(this)};$s.taskCompletedEvent=Ej;$s._defaultWorkerModulePrefix="Workers/";$s._workerModulePrefix=$s._defaultWorkerModulePrefix;$s._canTransferArrayBuffer=void 0;var Zn=$s;function RA(){}RA._transcodeTaskProcessor=new Zn("transcodeKTX2",Number.POSITIVE_INFINITY);RA._readyPromise=void 0;function kNe(){let e=RA._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return RA._transcodeTaskProcessor;throw new ue("KTX2 transcoder could not be initialized.")});RA._readyPromise=e}RA.transcode=function(e,t){return l(RA._readyPromise)||kNe(),RA._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 a=n[r];for(let s=0;s<o.length;s++){let c=a[o[s]];a[o[s]]=new cD(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 lD=RA;var Jre;Zre.setKTX2SupportedFormats=function(e,t,n,i,o,r){Jre={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:o,bc7:r}};function Zre(e){let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=De.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return lD.transcode(n,Jre)})}var _u=Zre;function UNe(e,t){this.start=e??0,this.stop=t??0}var qr=UNe;function In(e,t){this.center=d.clone(e??d.ZERO),this.radius=t??0}var Tj=new d,Sj=new d,wj=new d,Bj=new d,Dj=new d,vj=new d,Pj=new d,ec=new d,Rj=new d,Mj=new d,Nj=new d,Lj=new d,zNe=4/3*D.PI;In.fromPoints=function(e,t){if(l(t)||(t=new In),!l(e)||e.length===0)return t.center=d.clone(d.ZERO,t.center),t.radius=0,t;let n=d.clone(e[0],Pj),i=d.clone(n,Tj),o=d.clone(n,Sj),r=d.clone(n,wj),a=d.clone(n,Bj),s=d.clone(n,Dj),c=d.clone(n,vj),u=e.length,f;for(f=1;f<u;f++){d.clone(e[f],n);let P=n.x,N=n.y,L=n.z;P<i.x&&d.clone(n,i),P>a.x&&d.clone(n,a),N<o.y&&d.clone(n,o),N>s.y&&d.clone(n,s),L<r.z&&d.clone(n,r),L>c.z&&d.clone(n,c)}let h=d.magnitudeSquared(d.subtract(a,i,ec)),p=d.magnitudeSquared(d.subtract(s,o,ec)),A=d.magnitudeSquared(d.subtract(c,r,ec)),m=i,_=a,y=h;p>y&&(y=p,m=o,_=s),A>y&&(y=A,m=r,_=c);let C=Rj;C.x=(m.x+_.x)*.5,C.y=(m.y+_.y)*.5,C.z=(m.z+_.z)*.5;let E=d.magnitudeSquared(d.subtract(_,C,ec)),b=Math.sqrt(E),x=Mj;x.x=i.x,x.y=o.y,x.z=r.z;let S=Nj;S.x=a.x,S.y=s.y,S.z=c.z;let B=d.midpoint(x,S,Lj),v=0;for(f=0;f<u;f++){d.clone(e[f],n);let P=d.magnitude(d.subtract(n,B,ec));P>v&&(v=P);let N=d.magnitudeSquared(d.subtract(n,C,ec));if(N>E){let L=Math.sqrt(N);b=(b+L)*.5,E=b*b;let g=L-b;C.x=(b*C.x+g*n.x)/L,C.y=(b*C.y+g*n.y)/L,C.z=(b*C.z+g*n.z)/L}}return b<v?(d.clone(C,t.center),t.radius=b):(d.clone(B,t.center),t.radius=v),t};var $re=new Wi,GNe=new d,VNe=new d,Ij=new me,xj=new me;In.fromRectangle2D=function(e,t,n){return In.fromRectangleWithHeights2D(e,t,0,0,n)};In.fromRectangleWithHeights2D=function(e,t,n,i,o){if(l(o)||(o=new In),!l(e))return o.center=d.clone(d.ZERO,o.center),o.radius=0,o;$re._ellipsoid=te.default,t=t??$re,ce.southwest(e,Ij),Ij.height=n,ce.northeast(e,xj),xj.height=i;let r=t.project(Ij,GNe),a=t.project(xj,VNe),s=a.x-r.x,c=a.y-r.y,u=a.z-r.z;o.radius=Math.sqrt(s*s+c*c+u*u)*.5;let f=o.center;return f.x=r.x+s*.5,f.y=r.y+c*.5,f.z=r.z+u*.5,o};var HNe=[];In.fromRectangle3D=function(e,t,n,i){if(t=t??te.default,n=n??0,l(i)||(i=new In),!l(e))return i.center=d.clone(d.ZERO,i.center),i.radius=0,i;let o=ce.subsample(e,t,n,HNe);return In.fromPoints(o,i)};In.fromVertices=function(e,t,n,i){if(l(i)||(i=new In),!l(e)||e.length===0)return i.center=d.clone(d.ZERO,i.center),i.radius=0,i;t=t??d.ZERO,n=n??3;let o=Pj;o.x=e[0]+t.x,o.y=e[1]+t.y,o.z=e[2]+t.z;let r=d.clone(o,Tj),a=d.clone(o,Sj),s=d.clone(o,wj),c=d.clone(o,Bj),u=d.clone(o,Dj),f=d.clone(o,vj),h=e.length,p;for(p=0;p<h;p+=n){let L=e[p]+t.x,g=e[p+1]+t.y,I=e[p+2]+t.z;o.x=L,o.y=g,o.z=I,L<r.x&&d.clone(o,r),L>c.x&&d.clone(o,c),g<a.y&&d.clone(o,a),g>u.y&&d.clone(o,u),I<s.z&&d.clone(o,s),I>f.z&&d.clone(o,f)}let A=d.magnitudeSquared(d.subtract(c,r,ec)),m=d.magnitudeSquared(d.subtract(u,a,ec)),_=d.magnitudeSquared(d.subtract(f,s,ec)),y=r,C=c,E=A;m>E&&(E=m,y=a,C=u),_>E&&(E=_,y=s,C=f);let b=Rj;b.x=(y.x+C.x)*.5,b.y=(y.y+C.y)*.5,b.z=(y.z+C.z)*.5;let x=d.magnitudeSquared(d.subtract(C,b,ec)),S=Math.sqrt(x),B=Mj;B.x=r.x,B.y=a.y,B.z=s.z;let v=Nj;v.x=c.x,v.y=u.y,v.z=f.z;let P=d.midpoint(B,v,Lj),N=0;for(p=0;p<h;p+=n){o.x=e[p]+t.x,o.y=e[p+1]+t.y,o.z=e[p+2]+t.z;let L=d.magnitude(d.subtract(o,P,ec));L>N&&(N=L);let g=d.magnitudeSquared(d.subtract(o,b,ec));if(g>x){let I=Math.sqrt(g);S=(S+I)*.5,x=S*S;let T=I-S;b.x=(S*b.x+T*o.x)/I,b.y=(S*b.y+T*o.y)/I,b.z=(S*b.z+T*o.z)/I}}return S<N?(d.clone(b,i.center),i.radius=S):(d.clone(P,i.center),i.radius=N),i};In.fromEncodedCartesianVertices=function(e,t,n){if(l(n)||(n=new In),!l(e)||!l(t)||e.length!==t.length||e.length===0)return n.center=d.clone(d.ZERO,n.center),n.radius=0,n;let i=Pj;i.x=e[0]+t[0],i.y=e[1]+t[1],i.z=e[2]+t[2];let o=d.clone(i,Tj),r=d.clone(i,Sj),a=d.clone(i,wj),s=d.clone(i,Bj),c=d.clone(i,Dj),u=d.clone(i,vj),f=e.length,h;for(h=0;h<f;h+=3){let N=e[h]+t[h],L=e[h+1]+t[h+1],g=e[h+2]+t[h+2];i.x=N,i.y=L,i.z=g,N<o.x&&d.clone(i,o),N>s.x&&d.clone(i,s),L<r.y&&d.clone(i,r),L>c.y&&d.clone(i,c),g<a.z&&d.clone(i,a),g>u.z&&d.clone(i,u)}let p=d.magnitudeSquared(d.subtract(s,o,ec)),A=d.magnitudeSquared(d.subtract(c,r,ec)),m=d.magnitudeSquared(d.subtract(u,a,ec)),_=o,y=s,C=p;A>C&&(C=A,_=r,y=c),m>C&&(C=m,_=a,y=u);let E=Rj;E.x=(_.x+y.x)*.5,E.y=(_.y+y.y)*.5,E.z=(_.z+y.z)*.5;let b=d.magnitudeSquared(d.subtract(y,E,ec)),x=Math.sqrt(b),S=Mj;S.x=o.x,S.y=r.y,S.z=a.z;let B=Nj;B.x=s.x,B.y=c.y,B.z=u.z;let v=d.midpoint(S,B,Lj),P=0;for(h=0;h<f;h+=3){i.x=e[h]+t[h],i.y=e[h+1]+t[h+1],i.z=e[h+2]+t[h+2];let N=d.magnitude(d.subtract(i,v,ec));N>P&&(P=N);let L=d.magnitudeSquared(d.subtract(i,E,ec));if(L>b){let g=Math.sqrt(L);x=(x+g)*.5,b=x*x;let I=g-x;E.x=(x*E.x+I*i.x)/g,E.y=(x*E.y+I*i.y)/g,E.z=(x*E.z+I*i.z)/g}}return x<P?(d.clone(E,n.center),n.radius=x):(d.clone(v,n.center),n.radius=P),n};In.fromCornerPoints=function(e,t,n){l(n)||(n=new In);let i=d.midpoint(e,t,n.center);return n.radius=d.distance(i,t),n};In.fromEllipsoid=function(e,t){return l(t)||(t=new In),d.clone(d.ZERO,t.center),t.radius=e.maximumRadius,t};var WNe=new d;In.fromBoundingSpheres=function(e,t){if(l(t)||(t=new In),!l(e)||e.length===0)return t.center=d.clone(d.ZERO,t.center),t.radius=0,t;let n=e.length;if(n===1)return In.clone(e[0],t);if(n===2)return In.union(e[0],e[1],t);let i=[],o;for(o=0;o<n;o++)i.push(e[o].center);t=In.fromPoints(i,t);let r=t.center,a=t.radius;for(o=0;o<n;o++){let s=e[o];a=Math.max(a,d.distance(r,s.center,WNe)+s.radius)}return t.radius=a,t};var jNe=new d,YNe=new d,qNe=new d;In.fromOrientedBoundingBox=function(e,t){l(t)||(t=new In);let n=e.halfAxes,i=J.getColumn(n,0,jNe),o=J.getColumn(n,1,YNe),r=J.getColumn(n,2,qNe);return d.add(i,o,i),d.add(i,r,i),t.center=d.clone(e.center,t.center),t.radius=d.magnitude(i),t};var KNe=new d,XNe=new d;In.fromTransformation=function(e,t){l(t)||(t=new In);let n=M.getTranslation(e,KNe),i=M.getScale(e,XNe),o=.5*d.magnitude(i);return t.center=d.clone(n,t.center),t.radius=o,t};In.clone=function(e,t){if(l(e))return l(t)?(t.center=d.clone(e.center,t.center),t.radius=e.radius,t):new In(e.center,e.radius)};In.packedLength=4;In.pack=function(e,t,n){n=n??0;let i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t};In.unpack=function(e,t,n){t=t??0,l(n)||(n=new In);let i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var JNe=new d,ZNe=new d;In.union=function(e,t,n){l(n)||(n=new In);let i=e.center,o=e.radius,r=t.center,a=t.radius,s=d.subtract(r,i,JNe),c=d.magnitude(s);if(o>=c+a)return e.clone(n),n;if(a>=c+o)return t.clone(n),n;let u=(o+c+a)*.5,f=d.multiplyByScalar(s,(-o+u)/c,ZNe);return d.add(f,i,f),d.clone(f,n.center),n.radius=u,n};var $Ne=new d;In.expand=function(e,t,n){n=In.clone(e,n);let i=d.magnitude(d.subtract(t,n.center,$Ne));return i>n.radius&&(n.radius=i),n};In.intersectPlane=function(e,t){let n=e.center,i=e.radius,o=t.normal,r=d.dot(o,n)+t.distance;return r<-i?Xt.OUTSIDE:r<i?Xt.INTERSECTING:Xt.INSIDE};In.transform=function(e,t,n){return l(n)||(n=new In),n.center=M.multiplyByPoint(t,e.center,n.center),n.radius=M.getMaximumScale(t)*e.radius,n};var eLe=new d;In.distanceSquaredTo=function(e,t){let n=d.subtract(e.center,t,eLe),i=d.magnitude(n)-e.radius;return i<=0?0:i*i};In.transformWithoutScale=function(e,t,n){return l(n)||(n=new In),n.center=M.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var tLe=new d;In.computePlaneDistances=function(e,t,n,i){l(i)||(i=new qr);let o=d.subtract(e.center,t,tLe),r=d.dot(n,o);return i.start=r-e.radius,i.stop=r+e.radius,i};var eae=new d,nLe=new d,iLe=new d,oLe=new d,rLe=new d,aLe=new me,nae=new Array(8);for(let e=0;e<8;++e)nae[e]=new d;var tae=new Wi;In.projectTo2D=function(e,t,n){tae._ellipsoid=te.default,t=t??tae;let i=t.ellipsoid,o=e.center,r=e.radius,a;d.equals(o,d.ZERO)?a=d.clone(d.UNIT_X,eae):a=i.geodeticSurfaceNormal(o,eae);let s=d.cross(d.UNIT_Z,a,nLe);d.normalize(s,s);let c=d.cross(a,s,iLe);d.normalize(c,c),d.multiplyByScalar(a,r,a),d.multiplyByScalar(c,r,c),d.multiplyByScalar(s,r,s);let u=d.negate(c,rLe),f=d.negate(s,oLe),h=nae,p=h[0];d.add(a,c,p),d.add(p,s,p),p=h[1],d.add(a,c,p),d.add(p,f,p),p=h[2],d.add(a,u,p),d.add(p,f,p),p=h[3],d.add(a,u,p),d.add(p,s,p),d.negate(a,a),p=h[4],d.add(a,c,p),d.add(p,s,p),p=h[5],d.add(a,c,p),d.add(p,f,p),p=h[6],d.add(a,u,p),d.add(p,f,p),p=h[7],d.add(a,u,p),d.add(p,s,p);let A=h.length;for(let C=0;C<A;++C){let E=h[C];d.add(o,E,E);let b=i.cartesianToCartographic(E,aLe);t.project(b,E)}n=In.fromPoints(h,n),o=n.center;let m=o.x,_=o.y,y=o.z;return o.x=y,o.y=m,o.z=_,n};In.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)};In.equals=function(e,t){return e===t||l(e)&&l(t)&&d.equals(e.center,t.center)&&e.radius===t.radius};In.prototype.intersectPlane=function(e){return In.intersectPlane(this,e)};In.prototype.distanceSquaredTo=function(e){return In.distanceSquaredTo(this,e)};In.prototype.computePlaneDistances=function(e,t,n){return In.computePlaneDistances(this,e,t,n)};In.prototype.isOccluded=function(e){return In.isOccluded(this,e)};In.prototype.equals=function(e){return In.equals(this,e)};In.prototype.clone=function(e){return In.clone(this,e)};In.prototype.volume=function(){let e=this.radius;return zNe*e*e*e};var le=In;function sLe(e){e=e??V.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 _n=sLe;var cLe={NONE:0,TOP:1,ALL:2},mn=Object.freeze(cLe);function qa(e){e=e??V.EMPTY_OBJECT,this.position=e.position??!1,this.normal=e.normal??!1,this.st=e.st??!1,this.bitangent=e.bitangent??!1,this.tangent=e.tangent??!1,this.color=e.color??!1}qa.POSITION_ONLY=Object.freeze(new qa({position:!0}));qa.POSITION_AND_NORMAL=Object.freeze(new qa({position:!0,normal:!0}));qa.POSITION_NORMAL_AND_ST=Object.freeze(new qa({position:!0,normal:!0,st:!0}));qa.POSITION_AND_ST=Object.freeze(new qa({position:!0,st:!0}));qa.POSITION_AND_COLOR=Object.freeze(new qa({position:!0,color:!0}));qa.ALL=Object.freeze(new qa({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));qa.DEFAULT=qa.POSITION_NORMAL_AND_ST;qa.packedLength=6;qa.pack=function(e,t,n){return n=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};qa.unpack=function(e,t,n){return t=t??0,l(n)||(n=new qa),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};qa.clone=function(e,t){if(l(e))return l(t)||(t=new qa),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 ke=qa;var lLe=new d;function sf(e){e=e??V.EMPTY_OBJECT;let t=e.minimum,n=e.maximum,i=e.vertexFormat??ke.DEFAULT;this._minimum=d.clone(t),this._maximum=d.clone(n),this._vertexFormat=i,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}sf.fromDimensions=function(e){e=e??V.EMPTY_OBJECT;let t=e.dimensions,n=d.multiplyByScalar(t,.5,new d);return new sf({minimum:d.negate(n,new d),maximum:n,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})};sf.fromAxisAlignedBoundingBox=function(e){return new sf({minimum:e.minimum,maximum:e.maximum})};sf.packedLength=2*d.packedLength+ke.packedLength+1;sf.pack=function(e,t,n){return n=n??0,d.pack(e._minimum,t,n),d.pack(e._maximum,t,n+d.packedLength),ke.pack(e._vertexFormat,t,n+2*d.packedLength),t[n+2*d.packedLength+ke.packedLength]=e._offsetAttribute??-1,t};var oae=new d,rae=new d,aae=new ke,iae={minimum:oae,maximum:rae,vertexFormat:aae,offsetAttribute:void 0};sf.unpack=function(e,t,n){t=t??0;let i=d.unpack(e,t,oae),o=d.unpack(e,t+d.packedLength,rae),r=ke.unpack(e,t+2*d.packedLength,aae),a=e[t+2*d.packedLength+ke.packedLength];return l(n)?(n._minimum=d.clone(i,n._minimum),n._maximum=d.clone(o,n._maximum),n._vertexFormat=ke.clone(r,n._vertexFormat),n._offsetAttribute=a===-1?void 0:a,n):(iae.offsetAttribute=a===-1?void 0:a,new sf(iae))};sf.createGeometry=function(e){let t=e._minimum,n=e._maximum,i=e._vertexFormat;if(d.equals(t,n))return;let o=new _n,r,a;if(i.position&&(i.st||i.normal||i.tangent||i.bitangent)){if(i.position&&(a=new Float64Array(72),a[0]=t.x,a[1]=t.y,a[2]=n.z,a[3]=n.x,a[4]=t.y,a[5]=n.z,a[6]=n.x,a[7]=n.y,a[8]=n.z,a[9]=t.x,a[10]=n.y,a[11]=n.z,a[12]=t.x,a[13]=t.y,a[14]=t.z,a[15]=n.x,a[16]=t.y,a[17]=t.z,a[18]=n.x,a[19]=n.y,a[20]=t.z,a[21]=t.x,a[22]=n.y,a[23]=t.z,a[24]=n.x,a[25]=t.y,a[26]=t.z,a[27]=n.x,a[28]=n.y,a[29]=t.z,a[30]=n.x,a[31]=n.y,a[32]=n.z,a[33]=n.x,a[34]=t.y,a[35]=n.z,a[36]=t.x,a[37]=t.y,a[38]=t.z,a[39]=t.x,a[40]=n.y,a[41]=t.z,a[42]=t.x,a[43]=n.y,a[44]=n.z,a[45]=t.x,a[46]=t.y,a[47]=n.z,a[48]=t.x,a[49]=n.y,a[50]=t.z,a[51]=n.x,a[52]=n.y,a[53]=t.z,a[54]=n.x,a[55]=n.y,a[56]=n.z,a[57]=t.x,a[58]=n.y,a[59]=n.z,a[60]=t.x,a[61]=t.y,a[62]=t.z,a[63]=n.x,a[64]=t.y,a[65]=t.z,a[66]=n.x,a[67]=t.y,a[68]=n.z,a[69]=t.x,a[70]=t.y,a[71]=n.z,o.position=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:a})),i.normal){let u=new Float32Array(72);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=0,u[5]=1,u[6]=0,u[7]=0,u[8]=1,u[9]=0,u[10]=0,u[11]=1,u[12]=0,u[13]=0,u[14]=-1,u[15]=0,u[16]=0,u[17]=-1,u[18]=0,u[19]=0,u[20]=-1,u[21]=0,u[22]=0,u[23]=-1,u[24]=1,u[25]=0,u[26]=0,u[27]=1,u[28]=0,u[29]=0,u[30]=1,u[31]=0,u[32]=0,u[33]=1,u[34]=0,u[35]=0,u[36]=-1,u[37]=0,u[38]=0,u[39]=-1,u[40]=0,u[41]=0,u[42]=-1,u[43]=0,u[44]=0,u[45]=-1,u[46]=0,u[47]=0,u[48]=0,u[49]=1,u[50]=0,u[51]=0,u[52]=1,u[53]=0,u[54]=0,u[55]=1,u[56]=0,u[57]=0,u[58]=1,u[59]=0,u[60]=0,u[61]=-1,u[62]=0,u[63]=0,u[64]=-1,u[65]=0,u[66]=0,u[67]=-1,u[68]=0,u[69]=0,u[70]=-1,u[71]=0,o.normal=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:u})}if(i.st){let u=new Float32Array(48);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=1,u[5]=1,u[6]=0,u[7]=1,u[8]=1,u[9]=0,u[10]=0,u[11]=0,u[12]=0,u[13]=1,u[14]=1,u[15]=1,u[16]=0,u[17]=0,u[18]=1,u[19]=0,u[20]=1,u[21]=1,u[22]=0,u[23]=1,u[24]=1,u[25]=0,u[26]=0,u[27]=0,u[28]=0,u[29]=1,u[30]=1,u[31]=1,u[32]=1,u[33]=0,u[34]=0,u[35]=0,u[36]=0,u[37]=1,u[38]=1,u[39]=1,u[40]=0,u[41]=0,u[42]=1,u[43]=0,u[44]=1,u[45]=1,u[46]=0,u[47]=1,o.st=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:u})}if(i.tangent){let u=new Float32Array(72);u[0]=1,u[1]=0,u[2]=0,u[3]=1,u[4]=0,u[5]=0,u[6]=1,u[7]=0,u[8]=0,u[9]=1,u[10]=0,u[11]=0,u[12]=-1,u[13]=0,u[14]=0,u[15]=-1,u[16]=0,u[17]=0,u[18]=-1,u[19]=0,u[20]=0,u[21]=-1,u[22]=0,u[23]=0,u[24]=0,u[25]=1,u[26]=0,u[27]=0,u[28]=1,u[29]=0,u[30]=0,u[31]=1,u[32]=0,u[33]=0,u[34]=1,u[35]=0,u[36]=0,u[37]=-1,u[38]=0,u[39]=0,u[40]=-1,u[41]=0,u[42]=0,u[43]=-1,u[44]=0,u[45]=0,u[46]=-1,u[47]=0,u[48]=-1,u[49]=0,u[50]=0,u[51]=-1,u[52]=0,u[53]=0,u[54]=-1,u[55]=0,u[56]=0,u[57]=-1,u[58]=0,u[59]=0,u[60]=1,u[61]=0,u[62]=0,u[63]=1,u[64]=0,u[65]=0,u[66]=1,u[67]=0,u[68]=0,u[69]=1,u[70]=0,u[71]=0,o.tangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:u})}if(i.bitangent){let u=new Float32Array(72);u[0]=0,u[1]=1,u[2]=0,u[3]=0,u[4]=1,u[5]=0,u[6]=0,u[7]=1,u[8]=0,u[9]=0,u[10]=1,u[11]=0,u[12]=0,u[13]=1,u[14]=0,u[15]=0,u[16]=1,u[17]=0,u[18]=0,u[19]=1,u[20]=0,u[21]=0,u[22]=1,u[23]=0,u[24]=0,u[25]=0,u[26]=1,u[27]=0,u[28]=0,u[29]=1,u[30]=0,u[31]=0,u[32]=1,u[33]=0,u[34]=0,u[35]=1,u[36]=0,u[37]=0,u[38]=1,u[39]=0,u[40]=0,u[41]=1,u[42]=0,u[43]=0,u[44]=1,u[45]=0,u[46]=0,u[47]=1,u[48]=0,u[49]=0,u[50]=1,u[51]=0,u[52]=0,u[53]=1,u[54]=0,u[55]=0,u[56]=1,u[57]=0,u[58]=0,u[59]=1,u[60]=0,u[61]=0,u[62]=1,u[63]=0,u[64]=0,u[65]=1,u[66]=0,u[67]=0,u[68]=1,u[69]=0,u[70]=0,u[71]=1,o.bitangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:u})}r=new Uint16Array(36),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 a=new Float64Array(24),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=n.x,a[4]=t.y,a[5]=t.z,a[6]=n.x,a[7]=n.y,a[8]=t.z,a[9]=t.x,a[10]=n.y,a[11]=t.z,a[12]=t.x,a[13]=t.y,a[14]=n.z,a[15]=n.x,a[16]=t.y,a[17]=n.z,a[18]=n.x,a[19]=n.y,a[20]=n.z,a[21]=t.x,a[22]=n.y,a[23]=n.z,o.position=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:a}),r=new Uint16Array(36),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 s=d.subtract(n,t,lLe),c=d.magnitude(s)*.5;if(l(e._offsetAttribute)){let u=a.length,f=e._offsetAttribute===mn.NONE?0:1,h=new Uint8Array(u/3).fill(f);o.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return new yt({attributes:o,indices:r,primitiveType:ve.TRIANGLES,boundingSphere:new le(d.ZERO,c),offsetAttribute:e._offsetAttribute})};var Oj;sf.getUnitBox=function(){return l(Oj)||(Oj=sf.createGeometry(sf.fromDimensions({dimensions:new d(1,1,1),vertexFormat:ke.POSITION_ONLY}))),Oj};var Ic=sf;var bo={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};bo.getMathType=function(e){switch(e){case bo.SCALAR:return Number;case bo.VEC2:return k;case bo.VEC3:return d;case bo.VEC4:return ie;case bo.MAT2:return ji;case bo.MAT3:return J;case bo.MAT4:return M}};bo.getNumberOfComponents=function(e){switch(e){case bo.SCALAR:return 1;case bo.VEC2:return 2;case bo.VEC3:return 3;case bo.VEC4:case bo.MAT2:return 4;case bo.MAT3:return 9;case bo.MAT4:return 16}};bo.getAttributeLocationCount=function(e){switch(e){case bo.SCALAR:case bo.VEC2:case bo.VEC3:case bo.VEC4:return 1;case bo.MAT2:return 2;case bo.MAT3:return 3;case bo.MAT4:return 4}};bo.getGlslType=function(e){switch(e){case bo.SCALAR:return"float";case bo.VEC2:return"vec2";case bo.VEC3:return"vec3";case bo.VEC4:return"vec4";case bo.MAT2:return"mat2";case bo.MAT3:return"mat3";case bo.MAT4:return"mat4"}};var Ut=Object.freeze(bo);var sae=1/256,uLe=65536,Qj=256,vo={};vo.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))*D.signNotZero(i),n.y=(1-Math.abs(i))*D.signNotZero(o)}return n.x=D.toSNorm(n.x,t),n.y=D.toSNorm(n.y,t),n};vo.octEncode=function(e,t){return vo.octEncodeInRange(e,255,t)};var uD=new k,cae=new Uint8Array(1);function WG(e){return cae[0]=e,cae[0]}vo.octEncodeToCartesian4=function(e,t){return vo.octEncodeInRange(e,65535,uD),t.x=WG(uD.x*sae),t.y=WG(uD.x),t.z=WG(uD.y*sae),t.w=WG(uD.y),t};vo.octDecodeInRange=function(e,t,n,i){if(i.x=D.fromSNorm(e,n),i.y=D.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))*D.signNotZero(o),i.y=(1-Math.abs(o))*D.signNotZero(i.y)}return d.normalize(i,i)};vo.octDecode=function(e,t,n){return vo.octDecodeInRange(e,t,255,n)};vo.octDecodeFromCartesian4=function(e,t){let n=e.x,i=e.y,o=e.z,r=e.w,a=n*Qj+i,s=o*Qj+r;return vo.octDecodeInRange(a,s,65535,t)};vo.octPackFloat=function(e){return 256*e.x+e.y};var kj=new k;vo.octEncodeFloat=function(e){return vo.octEncode(e,kj),vo.octPackFloat(kj)};vo.octDecodeFloat=function(e,t){let n=e/256,i=Math.floor(n),o=(n-i)*256;return vo.octDecode(i,o,t)};vo.octPack=function(e,t,n,i){let o=vo.octEncodeFloat(e),r=vo.octEncodeFloat(t),a=vo.octEncode(n,kj);return i.x=65536*a.x+o,i.y=65536*a.y+r,i};vo.octUnpack=function(e,t,n,i){let o=e.x/65536,r=Math.floor(o),a=(o-r)*65536;o=e.y/65536;let s=Math.floor(o),c=(o-s)*65536;vo.octDecodeFloat(a,t),vo.octDecodeFloat(c,n),vo.octDecode(r,s,i)};vo.compressTextureCoordinates=function(e){let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};vo.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 Fj(e){return e>>1^-(e&1)}vo.zigZagDeltaDecode=function(e,t,n){let i=e.length,o=0,r=0,a=0;for(let s=0;s<i;++s)o+=Fj(e[s]),r+=Fj(t[s]),e[s]=o,t[s]=r,l(n)&&(a+=Fj(n[s]),n[s]=a)};vo.dequantize=function(e,t,n,i){let o=Ut.getNumberOfComponents(n),r;switch(t){case j.BYTE:r=127;break;case j.UNSIGNED_BYTE:r=255;break;case j.SHORT:r=32767;break;case j.UNSIGNED_SHORT:r=65535;break;case j.INT:r=2147483647;break;case j.UNSIGNED_INT:r=4294967295;break}let a=new Float32Array(i*o);for(let s=0;s<i;s++)for(let c=0;c<o;c++){let u=s*o+c;a[u]=Math.max(e[u]/r,-1)}return a};vo.encodeRGB8=function(e){return Math.round(D.clamp(e.red*255,0,255))*uLe+Math.round(D.clamp(e.green*255,0,255))*Qj+Math.round(D.clamp(e.blue*255,0,255))};vo.decodeRGB8=function(e,t){return e=Math.floor(e),t.red=(e>>16&255)/255,t.green=(e>>8&255)/255,t.blue=(e&255)/255,t};vo.decodeRGB565=function(e,t){let n=e.length;l(t)||(t=new Float32Array(n*3));let i=31,o=63,r=1/31,a=1/63;for(let s=0;s<n;s++){let c=e[s],u=c>>11,f=c>>5&o,h=c&i,p=3*s;t[p]=u*r,t[p+1]=f*a,t[p+2]=h*r}return t};var tn=vo;var lae=new d,uae=new d,fae=new d;function fLe(e,t,n,i,o){l(o)||(o=new d);let r,a,s,c,u,f,h,p;if(l(t.z)){if(d.equalsEpsilon(e,t,D.EPSILON14))return d.clone(d.UNIT_X,o);if(d.equalsEpsilon(e,n,D.EPSILON14))return d.clone(d.UNIT_Y,o);if(d.equalsEpsilon(e,i,D.EPSILON14))return d.clone(d.UNIT_Z,o);r=d.subtract(n,t,lae),a=d.subtract(i,t,uae),s=d.subtract(e,t,fae),c=d.dot(r,r),u=d.dot(r,a),f=d.dot(r,s),h=d.dot(a,a),p=d.dot(a,s)}else{if(k.equalsEpsilon(e,t,D.EPSILON14))return d.clone(d.UNIT_X,o);if(k.equalsEpsilon(e,n,D.EPSILON14))return d.clone(d.UNIT_Y,o);if(k.equalsEpsilon(e,i,D.EPSILON14))return d.clone(d.UNIT_Z,o);r=k.subtract(n,t,lae),a=k.subtract(i,t,uae),s=k.subtract(e,t,fae),c=k.dot(r,r),u=k.dot(r,a),f=k.dot(r,s),h=k.dot(a,a),p=k.dot(a,s)}o.y=h*f-u*p,o.z=c*p-u*f;let A=c*h-u*u;if(A!==0)return o.y/=A,o.z/=A,o.x=1-o.y-o.z,o}var IE=fLe;function ap(){this.high=d.clone(d.ZERO),this.low=d.clone(d.ZERO)}ap.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 MA={high:0,low:0};ap.fromCartesian=function(e,t){l(t)||(t=new ap);let n=t.high,i=t.low;return ap.encode(e.x,MA),n.x=MA.high,i.x=MA.low,ap.encode(e.y,MA),n.y=MA.high,i.y=MA.low,ap.encode(e.z,MA),n.z=MA.high,i.z=MA.low,t};var Uj=new ap;ap.writeElements=function(e,t,n){ap.fromCartesian(e,Uj);let i=Uj.high,o=Uj.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 xn=ap;var zj={};zj.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function dae(e,t,n){let i=e+t;return D.sign(e)!==D.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}zj.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),u=Math.abs(e);if(c<u&&c/u<D.EPSILON14)return[0,0];if(c>u&&u/c<D.EPSILON14)return[];if(i=-n/e,i<0)return[];let f=Math.sqrt(i);return[-f,f]}else if(n===0)return i=-t/e,i<0?[i,0]:[0,i];let o=t*t,r=4*e*n,a=dae(o,-r,D.EPSILON14);if(a<0)return[];let s=-.5*dae(t,D.sign(t)*Math.sqrt(a),D.EPSILON14);return t>0?[s/e,n/s]:[n/s,s/e]};var Tl=zj;var Vj={};Vj.computeDiscriminant=function(e,t,n,i){let o=e*e,r=t*t,a=n*n,s=i*i;return 18*e*t*n*i+r*a-27*o*s-4*(e*a*n+r*t*i)};function Gj(e,t,n,i){let o=e,r=t/3,a=n/3,s=i,c=o*a,u=r*s,f=r*r,h=a*a,p=o*a-f,A=o*s-r*a,m=r*s-h,_=4*p*m-A*A,y,C;if(_<0){let H,Y,$;f*u>=c*h?(H=o,Y=p,$=-2*r*p+o*A):(H=s,Y=m,$=-s*A+2*a*m);let K=-($<0?-1:1)*Math.abs(H)*Math.sqrt(-_);C=-$+K;let Z=C/2,pe=Z<0?-Math.pow(-Z,1/3):Math.pow(Z,1/3),ge=C===K?-pe:-Y/pe;return y=Y<=0?pe+ge:-$/(pe*pe+ge*ge+Y),f*u>=c*h?[(y-r)/o]:[-s/(y+a)]}let E=p,b=-2*r*p+o*A,x=m,S=-s*A+2*a*m,B=Math.sqrt(_),v=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*B,-b)/3);y=2*Math.sqrt(-E);let N=Math.cos(P);C=y*N;let L=y*(-N/2-v*Math.sin(P)),g=C+L>2*r?C-r:L-r,I=o,T=g/I;P=Math.abs(Math.atan2(s*B,-S)/3),y=2*Math.sqrt(-x),N=Math.cos(P),C=y*N,L=y*(-N/2-v*Math.sin(P));let w=-s,R=C+L<2*a?C+a:L+a,O=w/R,G=I*R,F=-g*R-I*w,U=g*w,Q=(a*F-r*U)/(-r*F+a*G);return T<=Q?T<=O?Q<=O?[T,Q,O]:[T,O,Q]:[O,T,Q]:T<=O?[Q,T,O]:Q<=O?[Q,O,T]:[O,Q,T]}Vj.computeRealRoots=function(e,t,n,i){let o,r;if(e===0)return Tl.computeRealRoots(t,n,i);if(t===0){if(n===0){if(i===0)return[0,0,0];r=-i/e;let a=r<0?-Math.pow(-r,1/3):Math.pow(r,1/3);return[a,a,a]}else if(i===0)return o=Tl.computeRealRoots(e,0,n),o.Length===0?[0]:[o[0],0,o[1]];return Gj(e,0,n,i)}else{if(n===0)return i===0?(r=-t/e,r<0?[r,0,0]:[0,0,r]):Gj(e,t,0,i);if(i===0)return o=Tl.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 Gj(e,t,n,i)};var xE=Vj;var Hj={};Hj.computeDiscriminant=function(e,t,n,i,o){let r=e*e,a=r*e,s=t*t,c=s*t,u=n*n,f=u*n,h=i*i,p=h*i,A=o*o,m=A*o;return s*u*h-4*c*p-4*e*f*h+18*e*t*n*p-27*r*h*h+256*a*m+o*(18*c*n*i-4*s*f+16*e*u*u-80*e*t*u*i-6*e*s*h+144*r*n*h)+A*(144*e*s*n-27*s*s-128*r*u-192*r*t*i)};function Th(e,t,n,i){let o=e*e,r=t-3*o/8,a=n-t*e/2+o*e/8,s=i-n*e/4+t*o/16-3*o*o/256,c=xE.computeRealRoots(1,2*r,r*r-4*s,-a*a);if(c.length>0){let u=-e/4,f=c[c.length-1];if(Math.abs(f)<D.EPSILON14){let h=Tl.computeRealRoots(1,r,s);if(h.length===2){let p=h[0],A=h[1],m;if(p>=0&&A>=0){let _=Math.sqrt(p),y=Math.sqrt(A);return[u-y,u-_,u+_,u+y]}else{if(p>=0&&A<0)return m=Math.sqrt(p),[u-m,u+m];if(p<0&&A>=0)return m=Math.sqrt(A),[u-m,u+m]}}return[]}else if(f>0){let h=Math.sqrt(f),p=(r+f-a/h)/2,A=(r+f+a/h)/2,m=Tl.computeRealRoots(1,h,p),_=Tl.computeRealRoots(1,-h,A);return m.length!==0?(m[0]+=u,m[1]+=u,_.length!==0?(_[0]+=u,_[1]+=u,m[1]<=_[0]?[m[0],m[1],_[0],_[1]]:_[1]<=m[0]?[_[0],_[1],m[0],m[1]]:m[0]>=_[0]&&m[1]<=_[1]?[_[0],m[0],m[1],_[1]]:_[0]>=m[0]&&_[1]<=m[1]?[m[0],_[0],_[1],m[1]]:m[0]>_[0]&&m[0]<_[1]?[_[0],m[0],_[1],m[1]]:[m[0],_[0],m[1],_[1]]):m):_.length!==0?(_[0]+=u,_[1]+=u,_):[]}}return[]}function fD(e,t,n,i){let o=n*n,r=t*t,a=e*e,s=-2*t,c=n*e+r-4*i,u=a*i-n*t*e+o,f=xE.computeRealRoots(1,s,c,u);if(f.length>0){let h=f[0],p=t-h,A=p*p,m=e/2,_=p/2,y=A-4*i,C=A+4*Math.abs(i),E=a-4*h,b=a+4*Math.abs(h),x,S;if(h<0||y*b<E*C){let I=Math.sqrt(E);x=I/2,S=I===0?0:(e*_-n)/I}else{let I=Math.sqrt(y);x=I===0?0:(e*_-n)/I,S=I/2}let B,v;m===0&&x===0?(B=0,v=0):D.sign(m)===D.sign(x)?(B=m+x,v=h/B):(v=m-x,B=h/v);let P,N;_===0&&S===0?(P=0,N=0):D.sign(_)===D.sign(S)?(P=_+S,N=i/P):(N=_-S,P=i/N);let L=Tl.computeRealRoots(1,B,P),g=Tl.computeRealRoots(1,v,N);if(L.length!==0)return g.length!==0?L[1]<=g[0]?[L[0],L[1],g[0],g[1]]:g[1]<=L[0]?[g[0],g[1],L[0],L[1]]:L[0]>=g[0]&&L[1]<=g[1]?[g[0],L[0],L[1],g[1]]:g[0]>=L[0]&&g[1]<=L[1]?[L[0],g[0],g[1],L[1]]:L[0]>g[0]&&L[0]<g[1]?[g[0],L[0],g[1],L[1]]:[L[0],g[0],L[1],g[1]]:L;if(g.length!==0)return g}return[]}Hj.computeRealRoots=function(e,t,n,i,o){if(Math.abs(e)<D.EPSILON15)return xE.computeRealRoots(t,n,i,o);let r=t/e,a=n/e,s=i/e,c=o/e,u=r<0?1:0;switch(u+=a<0?u+1:u,u+=s<0?u+1:u,u+=c<0?u+1:u,u){case 0:return Th(r,a,s,c);case 1:return fD(r,a,s,c);case 2:return fD(r,a,s,c);case 3:return Th(r,a,s,c);case 4:return Th(r,a,s,c);case 5:return fD(r,a,s,c);case 6:return Th(r,a,s,c);case 7:return Th(r,a,s,c);case 8:return fD(r,a,s,c);case 9:return Th(r,a,s,c);case 10:return Th(r,a,s,c);case 11:return fD(r,a,s,c);case 12:return Th(r,a,s,c);case 13:return Th(r,a,s,c);case 14:return Th(r,a,s,c);case 15:return Th(r,a,s,c);default:return}};var dD=Hj;function jG(e,t){t=d.clone(t??d.ZERO),d.equals(t,d.ZERO)||d.normalize(t,t),this.origin=d.clone(e??d.ZERO),this.direction=t}jG.clone=function(e,t){if(l(e))return l(t)?(t.origin=d.clone(e.origin),t.direction=d.clone(e.direction),t):new jG(e.origin,e.direction)};jG.getPoint=function(e,t,n){return l(n)||(n=new d),n=d.multiplyByScalar(e.direction,t,n),d.add(e.origin,n,n)};var yn=jG;var rr={};rr.rayPlane=function(e,t,n){l(n)||(n=new d);let i=e.origin,o=e.direction,r=t.normal,a=d.dot(r,o);if(Math.abs(a)<D.EPSILON15)return;let s=(-t.distance-d.dot(r,i))/a;if(!(s<0))return n=d.multiplyByScalar(o,s,n),d.add(i,n,n)};var dLe=new d,hLe=new d,Cae=new d,hae=new d,mae=new d;rr.rayTriangleParametric=function(e,t,n,i,o){o=o??!1;let r=e.origin,a=e.direction,s=d.subtract(n,t,dLe),c=d.subtract(i,t,hLe),u=d.cross(a,c,Cae),f=d.dot(s,u),h,p,A,m,_;if(o){if(f<D.EPSILON6||(h=d.subtract(r,t,hae),A=d.dot(h,u),A<0||A>f)||(p=d.cross(h,s,mae),m=d.dot(a,p),m<0||A+m>f))return;_=d.dot(c,p)/f}else{if(Math.abs(f)<D.EPSILON6)return;let y=1/f;if(h=d.subtract(r,t,hae),A=d.dot(h,u)*y,A<0||A>1||(p=d.cross(h,s,mae),m=d.dot(a,p)*y,m<0||A+m>1))return;_=d.dot(c,p)*y}return _};rr.rayTriangle=function(e,t,n,i,o,r){let a=rr.rayTriangleParametric(e,t,n,i,o);if(!(!l(a)||a<0))return l(r)||(r=new d),d.multiplyByScalar(e.direction,a,r),d.add(e.origin,r,r)};var mLe=new yn;rr.lineSegmentTriangle=function(e,t,n,i,o,r,a){let s=mLe;d.clone(e,s.origin),d.subtract(t,e,s.direction),d.normalize(s.direction,s.direction);let c=rr.rayTriangleParametric(s,n,i,o,r);if(!(!l(c)||c<0||c>d.distance(e,t)))return l(a)||(a=new d),d.multiplyByScalar(s.direction,c,a),d.add(s.origin,a,a)};function pLe(e,t,n,i){let o=t*t-4*e*n;if(o<0)return;if(o>0){let a=1/(2*e),s=Math.sqrt(o),c=(-t+s)*a,u=(-t-s)*a;return c<u?(i.root0=c,i.root1=u):(i.root0=u,i.root1=c),i}let r=-t/(2*e);if(r!==0)return i.root0=i.root1=r,i}var ALe={root0:0,root1:0};function Eae(e,t,n){l(n)||(n=new qr);let i=e.origin,o=e.direction,r=t.center,a=t.radius*t.radius,s=d.subtract(i,r,Cae),c=d.dot(o,o),u=2*d.dot(o,s),f=d.magnitudeSquared(s)-a,h=pLe(c,u,f,ALe);if(l(h))return n.start=h.root0,n.stop=h.root1,n}rr.raySphere=function(e,t,n){if(n=Eae(e,t,n),!(!l(n)||n.stop<0))return n.start=Math.max(n.start,0),n};var gLe=new yn;rr.lineSegmentSphere=function(e,t,n,i){let o=gLe;d.clone(e,o.origin);let r=d.subtract(t,e,o.direction),a=d.magnitude(r);if(d.normalize(r,r),i=Eae(o,n,i),!(!l(i)||i.stop<0||i.start>a))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,a),i};var _Le=new d,yLe=new d;rr.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=d.multiplyComponents(n,e.origin,_Le),o=d.multiplyComponents(n,e.direction,yLe),r=d.magnitudeSquared(i),a=d.dot(i,o),s,c,u,f,h;if(r>1){if(a>=0)return;let p=a*a;if(s=r-1,c=d.magnitudeSquared(o),u=c*s,p<u)return;if(p>u){f=a*a-u,h=-a+Math.sqrt(f);let m=h/c,_=s/h;return m<_?new qr(m,_):{start:_,stop:m}}let A=Math.sqrt(s/c);return new qr(A,A)}else if(r<1)return s=r-1,c=d.magnitudeSquared(o),u=c*s,f=a*a-u,h=-a+Math.sqrt(f),new qr(0,h/c);if(a<0)return c=d.magnitudeSquared(o),new qr(0,-a/c)};var CLe=new qr,ELe=new qr,bLe=new qr;rr.rayAxisAlignedBoundingBox=function(e,t,n){l(n)||(n=new qr);let i=Wj(e.origin.x,e.direction.x,t.minimum.x,t.maximum.x,CLe),o=Wj(e.origin.y,e.direction.y,t.minimum.y,t.maximum.y,ELe),r=Wj(e.origin.z,e.direction.z,t.minimum.z,t.maximum.z,bLe);if(n.start=i.start>o.start?i.start:o.start,n.stop=i.stop<o.stop?i.stop:o.stop,!(i.start>o.stop||o.start>i.stop)&&!(n.start>r.stop||r.start>n.stop))return r.start>n.start&&(n.start=r.start),r.stop<n.stop&&(n.stop=r.stop),n};function Wj(e,t,n,i,o){if(o.start=(n-e)/t,o.stop=(i-e)/t,o.stop<o.start){let r=o.stop;o.stop=o.start,o.start=r}return o}function TE(e,t,n){let i=e+t;return D.sign(e)!==D.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}rr.quadraticVectorExpression=function(e,t,n,i,o){let r=i*i,a=o*o,s=(e[J.COLUMN1ROW1]-e[J.COLUMN2ROW2])*a,c=o*(i*TE(e[J.COLUMN1ROW0],e[J.COLUMN0ROW1],D.EPSILON15)+t.y),u=e[J.COLUMN0ROW0]*r+e[J.COLUMN2ROW2]*a+i*t.x+n,f=a*TE(e[J.COLUMN2ROW1],e[J.COLUMN1ROW2],D.EPSILON15),h=o*(i*TE(e[J.COLUMN2ROW0],e[J.COLUMN0ROW2])+t.z),p,A=[];if(h===0&&f===0){if(p=Tl.computeRealRoots(s,c,u),p.length===0)return A;let P=p[0],N=Math.sqrt(Math.max(1-P*P,0));if(A.push(new d(i,o*P,o*-N)),A.push(new d(i,o*P,o*N)),p.length===2){let L=p[1],g=Math.sqrt(Math.max(1-L*L,0));A.push(new d(i,o*L,o*-g)),A.push(new d(i,o*L,o*g))}return A}let m=h*h,_=f*f,y=s*s,C=h*f,E=y+_,b=2*(c*s+C),x=2*u*s+c*c-_+m,S=2*(u*c-C),B=u*u-m;if(E===0&&b===0&&x===0&&S===0)return A;p=dD.computeRealRoots(E,b,x,S,B);let v=p.length;if(v===0)return A;for(let P=0;P<v;++P){let N=p[P],L=N*N,g=Math.max(1-L,0),I=Math.sqrt(g),T;D.sign(s)===D.sign(u)?T=TE(s*L+u,c*N,D.EPSILON12):D.sign(u)===D.sign(c*N)?T=TE(s*L,c*N+u,D.EPSILON12):T=TE(s*L+c*N,u,D.EPSILON12);let w=TE(f*N,h,D.EPSILON15),R=T*w;R<0?A.push(new d(i,o*N,o*I)):R>0?A.push(new d(i,o*N,o*-I)):I!==0?(A.push(new d(i,o*N,o*-I)),A.push(new d(i,o*N,o*I)),++P):A.push(new d(i,o*N,o*I))}return A};var jj=new d,pae=new d,Aae=new d,YG=new d,ILe=new d,xLe=new J,TLe=new J,SLe=new J,wLe=new J,BLe=new J,gae=new J,_ae=new J,yae=new d,DLe=new d,vLe=new me;rr.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!d.equals(n,d.ZERO)){let B=t.geodeticSurfaceNormal(n,jj);if(d.dot(i,B)>=0)return n}let o=l(this.rayEllipsoid(e,t)),r=t.transformPositionToScaledSpace(i,jj),a=d.normalize(r,r),s=d.mostOrthogonalAxis(r,YG),c=d.normalize(d.cross(s,a,pae),pae),u=d.normalize(d.cross(a,c,Aae),Aae),f=xLe;f[0]=a.x,f[1]=a.y,f[2]=a.z,f[3]=c.x,f[4]=c.y,f[5]=c.z,f[6]=u.x,f[7]=u.y,f[8]=u.z;let h=J.transpose(f,TLe),p=J.fromScale(t.radii,SLe),A=J.fromScale(t.oneOverRadii,wLe),m=BLe;m[0]=0,m[1]=-i.z,m[2]=i.y,m[3]=i.z,m[4]=0,m[5]=-i.x,m[6]=-i.y,m[7]=i.x,m[8]=0;let _=J.multiply(J.multiply(h,A,gae),m,gae),y=J.multiply(J.multiply(_,p,_ae),f,_ae),C=J.multiplyByVector(_,n,ILe),E=rr.quadraticVectorExpression(y,d.negate(C,jj),0,0,1),b,x,S=E.length;if(S>0){let B=d.clone(d.ZERO,DLe),v=Number.NEGATIVE_INFINITY;for(let N=0;N<S;++N){b=J.multiplyByVector(p,J.multiplyByVector(f,E[N],yae),yae);let L=d.normalize(d.subtract(b,n,YG),YG),g=d.dot(L,i);g>v&&(v=g,B=d.clone(b,B))}let P=t.cartesianToCartographic(B,vLe);return v=D.clamp(v,0,1),x=d.magnitude(d.subtract(B,n,YG))*Math.sqrt(1-v*v),x=o?-x:x,P.height=x,t.cartographicToCartesian(P,new d)}};var PLe=new d;rr.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new d);let o=d.subtract(t,e,PLe),r=n.normal,a=d.dot(r,o);if(Math.abs(a)<D.EPSILON6)return;let s=d.dot(r,e),c=-(n.distance+s)/a;if(!(c<0||c>1))return d.multiplyByScalar(o,c,i),d.add(e,i,i),i};rr.trianglePlaneIntersection=function(e,t,n,i){let o=i.normal,r=i.distance,a=d.dot(o,e)+r<0,s=d.dot(o,t)+r<0,c=d.dot(o,n)+r<0,u=0;u+=a?1:0,u+=s?1:0,u+=c?1:0;let f,h;if((u===1||u===2)&&(f=new d,h=new d),u===1){if(a)return rr.lineSegmentPlane(e,t,i,f),rr.lineSegmentPlane(e,n,i,h),{positions:[e,t,n,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(s)return rr.lineSegmentPlane(t,n,i,f),rr.lineSegmentPlane(t,e,i,h),{positions:[e,t,n,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return rr.lineSegmentPlane(n,e,i,f),rr.lineSegmentPlane(n,t,i,h),{positions:[e,t,n,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(u===2)if(a)if(s){if(!c)return rr.lineSegmentPlane(e,n,i,f),rr.lineSegmentPlane(t,n,i,h),{positions:[e,t,n,f,h],indices:[0,1,4,0,4,3,2,3,4]}}else return rr.lineSegmentPlane(n,t,i,f),rr.lineSegmentPlane(e,t,i,h),{positions:[e,t,n,f,h],indices:[2,0,4,2,4,3,1,3,4]};else return rr.lineSegmentPlane(t,e,i,f),rr.lineSegmentPlane(n,e,i,h),{positions:[e,t,n,f,h],indices:[1,2,4,1,4,3,0,3,4]}};var di=rr;function Ds(e,t){this.normal=d.clone(e),this.distance=t}Ds.fromPointNormal=function(e,t,n){let i=-d.dot(t,e);return l(n)?(d.clone(t,n.normal),n.distance=i,n):new Ds(t,i)};var RLe=new d;Ds.fromCartesian4=function(e,t){let n=d.fromCartesian4(e,RLe),i=e.w;return l(t)?(d.clone(n,t.normal),t.distance=i,t):new Ds(n,i)};Ds.getPointDistance=function(e,t){return d.dot(e.normal,t)+e.distance};var MLe=new d;Ds.projectPointOntoPlane=function(e,t,n){l(n)||(n=new d);let i=Ds.getPointDistance(e,t),o=d.multiplyByScalar(e.normal,i,MLe);return d.subtract(t,o,n)};var NLe=new M,LLe=new ie,OLe=new d;Ds.transform=function(e,t,n){let i=e.normal,o=e.distance,r=M.inverseTranspose(t,NLe),a=ie.fromElements(i.x,i.y,i.z,o,LLe);a=M.multiplyByVector(r,a,a);let s=d.fromCartesian4(a,OLe);return a=ie.divideByScalar(a,d.magnitude(s),a),Ds.fromCartesian4(a,n)};Ds.clone=function(e,t){return l(t)?(d.clone(e.normal,t.normal),t.distance=e.distance,t):new Ds(e.normal,e.distance)};Ds.equals=function(e,t){return e.distance===t.distance&&d.equals(e.normal,t.normal)};Ds.ORIGIN_XY_PLANE=Object.freeze(new Ds(d.UNIT_Z,0));Ds.ORIGIN_YZ_PLANE=Object.freeze(new Ds(d.UNIT_X,0));Ds.ORIGIN_ZX_PLANE=Object.freeze(new Ds(d.UNIT_Y,0));var cn=Ds;var Yj={};Yj.calculateACMR=function(e){e=e??V.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,o=t.length;if(!l(n)){n=0;let s=0,c=t[s];for(;s<o;)c>n&&(n=c),++s,c=t[s]}let r=[];for(let s=0;s<n+1;s++)r[s]=0;let a=i+1;for(let s=0;s<o;++s)a-r[t[s]]>i&&(r[t[s]]=a,++a);return(a-i+1)/(o/3)};Yj.tipsify=function(e){e=e??V.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,o;function r(g,I,T,w){for(;I.length>=1;){let R=I[I.length-1];if(I.splice(I.length-1,1),g[R].numLiveTriangles>0)return R}for(;o<w;){if(g[o].numLiveTriangles>0)return++o,o-1;++o}return-1}function a(g,I,T,w,R,O,G){let F=-1,U,Q=-1,H=0;for(;H<T.length;){let Y=T[H];w[Y].numLiveTriangles&&(U=0,R-w[Y].timeStamp+2*w[Y].numLiveTriangles<=I&&(U=R-w[Y].timeStamp),(U>Q||Q===-1)&&(Q=U,F=Y)),++H}return F===-1?r(w,O,g,G):F}let s=t.length,c=0,u=0,f=t[u],h=s;if(l(n))c=n+1;else{for(;u<h;)f>c&&(c=f),++u,f=t[u];if(c===-1)return 0;++c}let p=[],A;for(A=0;A<c;A++)p[A]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let m=0;for(;u<h;)p[t[u]].vertexTriangles.push(m),++p[t[u]].numLiveTriangles,p[t[u+1]].vertexTriangles.push(m),++p[t[u+1]].numLiveTriangles,p[t[u+2]].vertexTriangles.push(m),++p[t[u+2]].numLiveTriangles,++m,u+=3;let _=0,y=i+1;o=1;let C=[],E=[],b,x,S=0,B=[],v=s/3,P=[];for(A=0;A<v;A++)P[A]=!1;let N,L;for(;_!==-1;){C=[],x=p[_],L=x.vertexTriangles.length;for(let g=0;g<L;++g)if(m=x.vertexTriangles[g],!P[m]){P[m]=!0,u=m+m+m;for(let I=0;I<3;++I)N=t[u],C.push(N),E.push(N),B[S]=N,++S,b=p[N],--b.numLiveTriangles,y-b.timeStamp>i&&(b.timeStamp=y,++y),++u}_=a(t,i,C,p,y,E,c)}return B};var hD=Yj;var Sl={};function eV(e,t,n,i,o){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=o,e[t++]=o,e[t]=n}function FLe(e){let t=e.length,n=t/3*6,i=Ue.createTypedArray(t,n),o=0;for(let r=0;r<t;r+=3,o+=6)eV(i,o,e[r],e[r+1],e[r+2]);return i}function QLe(e){let t=e.length;if(t>=3){let n=(t-2)*6,i=Ue.createTypedArray(t,n);eV(i,0,e[0],e[1],e[2]);let o=6;for(let r=3;r<t;++r,o+=6)eV(i,o,e[r-1],e[r],e[r-2]);return i}return new Uint16Array}function kLe(e){if(e.length>0){let t=e.length-1,n=(t-1)*6,i=Ue.createTypedArray(t,n),o=e[0],r=0;for(let a=1;a<t;++a,r+=6)eV(i,r,o,e[a],e[a+1]);return i}return new Uint16Array}Sl.toWireframe=function(e){let t=e.indices;if(l(t)){switch(e.primitiveType){case ve.TRIANGLES:e.indices=FLe(t);break;case ve.TRIANGLE_STRIP:e.indices=QLe(t);break;case ve.TRIANGLE_FAN:e.indices=kLe(t);break}e.primitiveType=ve.LINES}return e};Sl.createLineSegmentsForVectors=function(e,t,n){t=t??"normal",n=n??1e4;let i=e.attributes.position.values,o=e.attributes[t].values,r=i.length,a=new Float64Array(2*r),s=0;for(let f=0;f<r;f+=3)a[s++]=i[f],a[s++]=i[f+1],a[s++]=i[f+2],a[s++]=i[f]+o[f]*n,a[s++]=i[f+1]+o[f+1]*n,a[s++]=i[f+2]+o[f+2]*n;let c,u=e.boundingSphere;return l(u)&&(c=new le(u.center,u.radius+n)),new yt({attributes:{position:new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:a})},primitiveType:ve.LINES,boundingSphere:c})};Sl.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,a=t.length;for(r=0;r<a;++r){let s=t[r];l(n[s])&&(i[s]=o++)}for(let s in n)n.hasOwnProperty(s)&&!l(i[s])&&(i[s]=o++);return i};Sl.reorderForPreVertexCache=function(e){let t=yt.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,a=Ue.createTypedArray(t,r),s=0,c=0,u=0,f;for(;s<r;)f=i[o[s]],f!==-1?a[c]=f:(f=o[s],i[f]=u,a[c]=u,++u),++s,++c;e.indices=a;let h=e.attributes;for(let p in h)if(h.hasOwnProperty(p)&&l(h[p])&&l(h[p].values)){let A=h[p],m=A.values,_=0,y=A.componentsPerAttribute,C=j.createTypedArray(A.componentDatatype,u*y);for(;_<t;){let E=i[_];if(E!==-1)for(let b=0;b<y;b++)C[y*E+b]=m[y*_+b];++_}A.values=C}}return e};Sl.reorderForPostVertexCache=function(e,t){let n=e.indices;if(e.primitiveType===ve.TRIANGLES&&l(n)){let i=n.length,o=0;for(let r=0;r<i;r++)n[r]>o&&(o=n[r]);e.indices=hD.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function bae(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 Me({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function ULe(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])}}Sl.fitToUnsignedShortIndices=function(e){let t=[],n=yt.computeNumberOfVertices(e);if(l(e.indices)&&n>=D.SIXTY_FOUR_KILOBYTES){let i=[],o=[],r=0,a=bae(e.attributes),s=e.indices,c=s.length,u;e.primitiveType===ve.TRIANGLES?u=3:e.primitiveType===ve.LINES?u=2:e.primitiveType===ve.POINTS&&(u=1);for(let f=0;f<c;f+=u){for(let h=0;h<u;++h){let p=s[f+h],A=i[p];l(A)||(A=r++,i[p]=A,ULe(a,e.attributes,p)),o.push(A)}r+u>=D.SIXTY_FOUR_KILOBYTES&&(t.push(new yt({attributes:a,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],o=[],r=0,a=bae(e.attributes))}o.length!==0&&t.push(new yt({attributes:a,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var Iae=new d,zLe=new me;Sl.projectTo2D=function(e,t,n,i,o){let r=e.attributes[t];o=l(o)?o:new Wi;let a=o.ellipsoid,s=r.values,c=new Float64Array(s.length),u=0;for(let f=0;f<s.length;f+=3){let h=d.fromArray(s,f,Iae),p=a.cartesianToCartographic(h,zLe),A=o.project(p,Iae);c[u++]=A.x,c[u++]=A.y,c[u++]=A.z}return e.attributes[n]=r,e.attributes[i]=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:c}),delete e.attributes[t],e};var qj={high:0,low:0};Sl.encodeAttribute=function(e,t,n,i){let o=e.attributes[t],r=o.values,a=r.length,s=new Float32Array(a),c=new Float32Array(a);for(let f=0;f<a;++f)xn.encode(r[f],qj),s[f]=qj.high,c[f]=qj.low;let u=o.componentsPerAttribute;return e.attributes[n]=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:u,values:s}),e.attributes[i]=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:u,values:c}),delete e.attributes[t],e};var wh=new d;function Kj(e,t){if(l(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)d.unpack(n,o,wh),M.multiplyByPoint(e,wh,wh),d.pack(wh,n,o)}}function Xj(e,t){if(l(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)d.unpack(n,o,wh),J.multiplyByVector(e,wh,wh),wh=d.normalize(wh,wh),d.pack(wh,n,o)}}var qG=new M,KG=new J;Sl.transformToWorldCoordinates=function(e){let t=e.modelMatrix;if(M.equals(t,M.IDENTITY))return e;let n=e.geometry.attributes;Kj(t,n.position),Kj(t,n.prevPosition),Kj(t,n.nextPosition),(l(n.normal)||l(n.tangent)||l(n.bitangent))&&(M.inverse(t,qG),M.transpose(qG,qG),M.getMatrix3(qG,KG),Xj(KG,n.normal),Xj(KG,n.tangent),Xj(KG,n.bitangent));let i=e.geometry.boundingSphere;return l(i)&&(e.geometry.boundingSphere=le.transform(i,t,i)),e.modelMatrix=M.clone(M.IDENTITY),e};function GLe(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 a=o[r],s=a.values.length,c=!0;for(let u=1;u<n;++u){let f=e[u][t].attributes[r];if(!l(f)||a.componentDatatype!==f.componentDatatype||a.componentsPerAttribute!==f.componentsPerAttribute||a.normalize!==f.normalize){c=!1;break}s+=f.values.length}c&&(i[r]=new Me({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:j.createTypedArray(a.componentDatatype,s)}))}return i}var VLe=new d;function Jj(e,t){let n=e.length,i,o,r,a,s=e[0].modelMatrix,c=l(e[0][t].indices),u=e[0][t].primitiveType,f=GLe(e,t),h,p,A;for(i in f)if(f.hasOwnProperty(i))for(h=f[i].values,a=0,o=0;o<n;++o)for(p=e[o][t].attributes[i].values,A=p.length,r=0;r<A;++r)h[a++]=p[r];let m;if(c){let E=0;for(o=0;o<n;++o)E+=e[o][t].indices.length;let b=yt.computeNumberOfVertices(new yt({attributes:f,primitiveType:ve.POINTS})),x=Ue.createTypedArray(b,E),S=0,B=0;for(o=0;o<n;++o){let v=e[o][t].indices,P=v.length;for(a=0;a<P;++a)x[S++]=B+v[a];B+=yt.computeNumberOfVertices(e[o][t])}m=x}let _=new d,y=0,C;for(o=0;o<n;++o){if(C=e[o][t].boundingSphere,!l(C)){_=void 0;break}d.add(C.center,_,_)}if(l(_))for(d.divideByScalar(_,n,_),o=0;o<n;++o){C=e[o][t].boundingSphere;let E=d.magnitude(d.subtract(C.center,_,VLe))+C.radius;E>y&&(y=E)}return new yt({attributes:f,indices:m,primitiveType:u,boundingSphere:l(_)?new le(_,y):void 0})}Sl.combineInstances=function(e){let t=[],n=[],i=e.length;for(let r=0;r<i;++r){let a=e[r];l(a.geometry)?t.push(a):l(a.westHemisphereGeometry)&&l(a.eastHemisphereGeometry)&&n.push(a)}let o=[];return t.length>0&&o.push(Jj(t,"geometry")),n.length>0&&(o.push(Jj(n,"westHemisphereGeometry")),o.push(Jj(n,"eastHemisphereGeometry"))),o};var fd=new d,mD=new d,Ix=new d,xx=new d;Sl.computeNormal=function(e){let t=e.indices,n=e.attributes,i=n.position.values,o=n.position.values.length/3,r=t.length,a=new Array(o),s=new Array(r/3),c=new Array(r),u;for(u=0;u<o;u++)a[u]={indexOffset:0,count:0,currentCount:0};let f=0;for(u=0;u<r;u+=3){let m=t[u],_=t[u+1],y=t[u+2],C=m*3,E=_*3,b=y*3;mD.x=i[C],mD.y=i[C+1],mD.z=i[C+2],Ix.x=i[E],Ix.y=i[E+1],Ix.z=i[E+2],xx.x=i[b],xx.y=i[b+1],xx.z=i[b+2],a[m].count++,a[_].count++,a[y].count++,d.subtract(Ix,mD,Ix),d.subtract(xx,mD,xx),s[f]=d.cross(Ix,xx,new d),f++}let h=0;for(u=0;u<o;u++)a[u].indexOffset+=h,h+=a[u].count;f=0;let p;for(u=0;u<r;u+=3){p=a[t[u]];let m=p.indexOffset+p.currentCount;c[m]=f,p.currentCount++,p=a[t[u+1]],m=p.indexOffset+p.currentCount,c[m]=f,p.currentCount++,p=a[t[u+2]],m=p.indexOffset+p.currentCount,c[m]=f,p.currentCount++,f++}let A=new Float32Array(o*3);for(u=0;u<o;u++){let m=u*3;if(p=a[u],d.clone(d.ZERO,fd),p.count>0){for(f=0;f<p.count;f++)d.add(fd,s[c[p.indexOffset+f]],fd);d.equalsEpsilon(d.ZERO,fd,D.EPSILON10)&&d.clone(s[c[p.indexOffset]],fd)}d.equalsEpsilon(d.ZERO,fd,D.EPSILON10)&&(fd.z=1),d.normalize(fd,fd),A[m]=fd.x,A[m+1]=fd.y,A[m+2]=fd.z}return e.attributes.normal=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:A}),e};var HLe=new d,xae=new d,WLe=new d;Sl.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,a=e.attributes.position.values.length/3,s=n.length,c=new Array(a*3),u;for(u=0;u<c.length;u++)c[u]=0;let f,h,p;for(u=0;u<s;u+=3){let _=n[u],y=n[u+1],C=n[u+2];f=_*3,h=y*3,p=C*3;let E=_*2,b=y*2,x=C*2,S=i[f],B=i[f+1],v=i[f+2],P=r[E],N=r[E+1],L=r[b+1]-N,g=r[x+1]-N,I=1/((r[b]-P)*g-(r[x]-P)*L),T=(g*(i[h]-S)-L*(i[p]-S))*I,w=(g*(i[h+1]-B)-L*(i[p+1]-B))*I,R=(g*(i[h+2]-v)-L*(i[p+2]-v))*I;c[f]+=T,c[f+1]+=w,c[f+2]+=R,c[h]+=T,c[h+1]+=w,c[h+2]+=R,c[p]+=T,c[p+1]+=w,c[p+2]+=R}let A=new Float32Array(a*3),m=new Float32Array(a*3);for(u=0;u<a;u++){f=u*3,h=f+1,p=f+2;let _=d.fromArray(o,f,HLe),y=d.fromArray(c,f,WLe),C=d.dot(_,y);d.multiplyByScalar(_,C,xae),d.normalize(d.subtract(y,xae,y),y),A[f]=y.x,A[h]=y.y,A[p]=y.z,d.normalize(d.cross(_,y,y),y),m[f]=y.x,m[h]=y.y,m[p]=y.z}return e.attributes.tangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:A}),e.attributes.bitangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:m}),e};var pD=new k,Sh=new d,Tae=new d,Sae=new d,XG=new k;Sl.compressVertices=function(e){let t=e.attributes.extrudeDirection,n,i;if(l(t)){let B=t.values;i=B.length/3;let v=new Float32Array(i*2),P=0;for(n=0;n<i;++n){if(d.fromArray(B,n*3,Sh),d.equals(Sh,d.ZERO)){P+=2;continue}XG=tn.octEncodeInRange(Sh,65535,XG),v[P++]=XG.x,v[P++]=XG.y}return e.attributes.compressedAttributes=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:v}),delete e.attributes.extrudeDirection,e}let o=e.attributes.normal,r=e.attributes.st,a=l(o),s=l(r);if(!a&&!s)return e;let c=e.attributes.tangent,u=e.attributes.bitangent,f=l(c),h=l(u),p,A,m,_;a&&(p=o.values),s&&(A=r.values),f&&(m=c.values),h&&(_=u.values),i=(a?p.length:A.length)/(a?3:2);let E=i,b=s&&a?2:1;b+=f||h?1:0,E*=b;let x=new Float32Array(E),S=0;for(n=0;n<i;++n){s&&(k.fromArray(A,n*2,pD),x[S++]=tn.compressTextureCoordinates(pD));let B=n*3;a&&l(m)&&l(_)?(d.fromArray(p,B,Sh),d.fromArray(m,B,Tae),d.fromArray(_,B,Sae),tn.octPack(Sh,Tae,Sae,pD),x[S++]=pD.x,x[S++]=pD.y):(a&&(d.fromArray(p,B,Sh),x[S++]=tn.octEncodeFloat(Sh)),f&&(d.fromArray(m,B,Sh),x[S++]=tn.octEncodeFloat(Sh)),h&&(d.fromArray(_,B,Sh),x[S++]=tn.octEncodeFloat(Sh)))}return e.attributes.compressedAttributes=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:b,values:x}),a&&delete e.attributes.normal,s&&delete e.attributes.st,h&&delete e.attributes.bitangent,f&&delete e.attributes.tangent,e};function jLe(e){if(l(e.indices))return e;let t=yt.computeNumberOfVertices(e),n=Ue.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function YLe(e){let t=yt.computeNumberOfVertices(e),n=Ue.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=ve.TRIANGLES,e}function qLe(e){let t=yt.computeNumberOfVertices(e),n=Ue.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=ve.TRIANGLES,e}function KLe(e){if(l(e.indices))return e;let t=yt.computeNumberOfVertices(e),n=Ue.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function XLe(e){let t=yt.computeNumberOfVertices(e),n=Ue.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=ve.LINES,e}function JLe(e){let t=yt.computeNumberOfVertices(e),n=Ue.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=ve.LINES,e}function ZLe(e){switch(e.primitiveType){case ve.TRIANGLE_FAN:return YLe(e);case ve.TRIANGLE_STRIP:return qLe(e);case ve.TRIANGLES:return jLe(e);case ve.LINE_STRIP:return XLe(e);case ve.LINE_LOOP:return JLe(e);case ve.LINES:return KLe(e)}return e}function $_(e,t){Math.abs(e.y)<D.EPSILON6&&(t?e.y=-D.EPSILON6:e.y=D.EPSILON6)}function $Le(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){$_(e,e.y<0),$_(t,t.y<0),$_(n,n.y<0);return}let i=Math.abs(e.y),o=Math.abs(t.y),r=Math.abs(n.y),a;i>o?i>r?a=D.sign(e.y):a=D.sign(n.y):o>r?a=D.sign(t.y):a=D.sign(n.y);let s=a<0;$_(e,s),$_(t,s),$_(n,s)}var wae=new d;function dd(e,t,n,i){d.add(e,d.multiplyByScalar(d.subtract(t,e,wae),e.y/(e.y-t.y),wae),n),d.clone(n,i),$_(n,!0),$_(i,!1)}var SE=new d,wE=new d,BE=new d,DE=new d,Zj={positions:new Array(7),indices:new Array(9)};function eOe(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;$Le(e,t,n);let i=e.y<0,o=t.y<0,r=n.y<0,a=0;a+=i?1:0,a+=o?1:0,a+=r?1:0;let s=Zj.indices;a===1?(s[1]=3,s[2]=4,s[5]=6,s[7]=6,s[8]=5,i?(dd(e,t,SE,BE),dd(e,n,wE,DE),s[0]=0,s[3]=1,s[4]=2,s[6]=1):o?(dd(t,n,SE,BE),dd(t,e,wE,DE),s[0]=1,s[3]=2,s[4]=0,s[6]=2):r&&(dd(n,e,SE,BE),dd(n,t,wE,DE),s[0]=2,s[3]=0,s[4]=1,s[6]=0)):a===2&&(s[2]=4,s[4]=4,s[5]=3,s[7]=5,s[8]=6,i?o?r||(dd(n,e,SE,BE),dd(n,t,wE,DE),s[0]=0,s[1]=1,s[3]=0,s[6]=2):(dd(t,n,SE,BE),dd(t,e,wE,DE),s[0]=2,s[1]=0,s[3]=2,s[6]=1):(dd(e,t,SE,BE),dd(e,n,wE,DE),s[0]=1,s[1]=2,s[3]=1,s[6]=0));let c=Zj.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(a===1||a===2)&&(c[3]=SE,c[4]=wE,c[5]=BE,c[6]=DE,c.length=7),Zj}function Bae(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=j.createTypedArray(r.componentDatatype,r.values)}let i=yt.computeNumberOfVertices(e);return e.indices=Ue.createTypedArray(i,e.indices),t&&(e.boundingSphere=le.fromVertices(n.position.values)),e}function Sx(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 Me({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new yt({attributes:n,indices:[],primitiveType:e.primitiveType})}function n6(e,t,n){let i=l(e.geometry.boundingSphere);t=Bae(t,i),n=Bae(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 i6(e,t){let n=new e,i=new e,o=new e;return function(r,a,s,c,u,f,h,p){let A=e.fromArray(u,r*t,n),m=e.fromArray(u,a*t,i),_=e.fromArray(u,s*t,o);e.multiplyByScalar(A,c.x,A),e.multiplyByScalar(m,c.y,m),e.multiplyByScalar(_,c.z,_);let y=e.add(A,m,A);e.add(y,_,y),p&&e.normalize(y,y),e.pack(y,f,h*t)}}var tOe=i6(ie,4),$G=i6(d,3),Nae=i6(k,2),nOe=function(e,t,n,i,o,r,a){let s=o[e]*i.x,c=o[t]*i.y,u=o[n]*i.z;r[a]=s+c+u>D.EPSILON6?1:0},AD=new d,$j=new d,e6=new d,iOe=new d;function JG(e,t,n,i,o,r,a,s,c,u,f,h,p,A,m,_){if(!l(r)&&!l(a)&&!l(s)&&!l(c)&&!l(u)&&A===0)return;let y=d.fromArray(o,e*3,AD),C=d.fromArray(o,t*3,$j),E=d.fromArray(o,n*3,e6),b=IE(i,y,C,E,iOe);if(l(b)){if(l(r)&&$G(e,t,n,b,r,h.normal.values,_,!0),l(u)){let x=d.fromArray(u,e*3,AD),S=d.fromArray(u,t*3,$j),B=d.fromArray(u,n*3,e6);d.multiplyByScalar(x,b.x,x),d.multiplyByScalar(S,b.y,S),d.multiplyByScalar(B,b.z,B);let v;!d.equals(x,d.ZERO)||!d.equals(S,d.ZERO)||!d.equals(B,d.ZERO)?(v=d.add(x,S,x),d.add(v,B,v),d.normalize(v,v)):(v=AD,v.x=0,v.y=0,v.z=0),d.pack(v,h.extrudeDirection.values,_*3)}if(l(f)&&nOe(e,t,n,b,f,h.applyOffset.values,_),l(a)&&$G(e,t,n,b,a,h.tangent.values,_,!0),l(s)&&$G(e,t,n,b,s,h.bitangent.values,_,!0),l(c)&&Nae(e,t,n,b,c,h.st.values,_),A>0)for(let x=0;x<A;x++){let S=p[x];oOe(e,t,n,b,_,m[S],h[S])}}}function oOe(e,t,n,i,o,r,a){let s=r.componentsPerAttribute,c=r.values,u=a.values;switch(s){case 4:tOe(e,t,n,i,c,u,o,!1);break;case 3:$G(e,t,n,i,c,u,o,!1);break;case 2:Nae(e,t,n,i,c,u,o,!1);break;default:u[o]=c[e]*i.x+c[t]*i.y+c[n]*i.z}}function sp(e,t,n,i,o,r){let a=e.position.values.length/3;if(o!==-1){let s=i[o],c=n[s];return c===-1?(n[s]=a,e.position.values.push(r.x,r.y,r.z),t.push(a),a):(t.push(c),c)}return e.position.values.push(r.x,r.y,r.z),t.push(a),a}var rOe={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function Dae(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,a=l(n.tangent)?n.tangent.values:void 0,s=l(n.st)?n.st.values:void 0,c=l(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=l(n.applyOffset)?n.applyOffset.values:void 0,f=t.indices,h=[];for(let v in n)n.hasOwnProperty(v)&&!rOe[v]&&l(n[v])&&h.push(v);let p=h.length,A=Sx(t),m=Sx(t),_,y,C,E,b,x=[];x.length=i.length/3;let S=[];for(S.length=i.length/3,b=0;b<x.length;++b)x[b]=-1,S[b]=-1;let B=f.length;for(b=0;b<B;b+=3){let v=f[b],P=f[b+1],N=f[b+2],L=d.fromArray(i,v*3),g=d.fromArray(i,P*3),I=d.fromArray(i,N*3),T=eOe(L,g,I);if(l(T)&&T.positions.length>3){let w=T.positions,R=T.indices,O=R.length;for(let G=0;G<O;++G){let F=R[G],U=w[F];U.y<0?(_=m.attributes,y=m.indices,C=x):(_=A.attributes,y=A.indices,C=S),E=sp(_,y,C,f,F<3?b+F:-1,U),JG(v,P,N,U,i,o,a,r,s,c,u,_,h,p,n,E)}}else l(T)&&(L=T.positions[0],g=T.positions[1],I=T.positions[2]),L.y<0?(_=m.attributes,y=m.indices,C=x):(_=A.attributes,y=A.indices,C=S),E=sp(_,y,C,f,b,L),JG(v,P,N,L,i,o,a,r,s,c,u,_,h,p,n,E),E=sp(_,y,C,f,b+1,g),JG(v,P,N,g,i,o,a,r,s,c,u,_,h,p,n,E),E=sp(_,y,C,f,b+2,I),JG(v,P,N,I,i,o,a,r,s,c,u,_,h,p,n,E)}n6(e,m,A)}var Lae=cn.fromPointNormal(d.ZERO,d.UNIT_Y),aOe=new d,sOe=new d;function Tx(e,t,n,i,o,r,a){if(!l(a))return;let s=d.fromArray(i,e*3,AD);d.equalsEpsilon(s,n,D.EPSILON10)?r.applyOffset.values[o]=a[e]:r.applyOffset.values[o]=a[t]}function vae(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=l(n.applyOffset)?n.applyOffset.values:void 0,r=t.indices,a=Sx(t),s=Sx(t),c,u=r.length,f=[];f.length=i.length/3;let h=[];for(h.length=i.length/3,c=0;c<f.length;++c)f[c]=-1,h[c]=-1;for(c=0;c<u;c+=2){let p=r[c],A=r[c+1],m=d.fromArray(i,p*3,AD),_=d.fromArray(i,A*3,$j),y;Math.abs(m.y)<D.EPSILON6&&(m.y<0?m.y=-D.EPSILON6:m.y=D.EPSILON6),Math.abs(_.y)<D.EPSILON6&&(_.y<0?_.y=-D.EPSILON6:_.y=D.EPSILON6);let C=a.attributes,E=a.indices,b=h,x=s.attributes,S=s.indices,B=f,v=di.lineSegmentPlane(m,_,Lae,e6);if(l(v)){let P=d.multiplyByScalar(d.UNIT_Y,5*D.EPSILON9,aOe);m.y<0&&(d.negate(P,P),C=s.attributes,E=s.indices,b=f,x=a.attributes,S=a.indices,B=h);let N=d.add(v,P,sOe);y=sp(C,E,b,r,c,m),Tx(p,A,m,i,y,C,o),y=sp(C,E,b,r,-1,N),Tx(p,A,N,i,y,C,o),d.negate(P,P),d.add(v,P,N),y=sp(x,S,B,r,-1,N),Tx(p,A,N,i,y,x,o),y=sp(x,S,B,r,c+1,_),Tx(p,A,_,i,y,x,o)}else{let P,N,L;m.y<0?(P=s.attributes,N=s.indices,L=f):(P=a.attributes,N=a.indices,L=h),y=sp(P,N,L,r,c,m),Tx(p,A,m,i,y,P,o),y=sp(P,N,L,r,c+1,_),Tx(p,A,_,i,y,P,o)}}n6(e,s,a)}var Pae=new k,cOe=new k,Oae=new d,Fae=new d,t6=new d,lOe=new d,uOe=new d,fOe=new d,Rae=new ie;function Mae(e){let t=e.attributes,n=t.position.values,i=t.prevPosition.values,o=t.nextPosition.values,r=n.length;for(let a=0;a<r;a+=3){let s=d.unpack(n,a,Oae);if(s.x>0)continue;let c=d.unpack(i,a,Fae);(s.y<0&&c.y>0||s.y>0&&c.y<0)&&(a-3>0?(i[a]=n[a-3],i[a+1]=n[a-2],i[a+2]=n[a-1]):d.pack(s,i,a));let u=d.unpack(o,a,t6);(s.y<0&&u.y>0||s.y>0&&u.y<0)&&(a+3<r?(o[a]=n[a+3],o[a+1]=n[a+4],o[a+2]=n[a+5]):d.pack(s,o,a))}}var dOe=5*D.EPSILON9,ZG=D.EPSILON6;function hOe(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=n.prevPosition.values,r=n.nextPosition.values,a=n.expandAndWidth.values,s=l(n.st)?n.st.values:void 0,c=l(n.color)?n.color.values:void 0,u=Sx(t),f=Sx(t),h,p,A,m=!1,_=i.length/3;for(h=0;h<_;h+=4){let y=h,C=h+2,E=d.fromArray(i,y*3,Oae),b=d.fromArray(i,C*3,Fae);if(Math.abs(E.y)<ZG)for(E.y=ZG*(b.y<0?-1:1),i[h*3+1]=E.y,i[(h+1)*3+1]=E.y,p=y*3;p<y*3+12;p+=3)o[p]=i[h*3],o[p+1]=i[h*3+1],o[p+2]=i[h*3+2];if(Math.abs(b.y)<ZG)for(b.y=ZG*(E.y<0?-1:1),i[(h+2)*3+1]=b.y,i[(h+3)*3+1]=b.y,p=y*3;p<y*3+12;p+=3)r[p]=i[(h+2)*3],r[p+1]=i[(h+2)*3+1],r[p+2]=i[(h+2)*3+2];let x=u.attributes,S=u.indices,B=f.attributes,v=f.indices,P=di.lineSegmentPlane(E,b,Lae,lOe);if(l(P)){m=!0;let N=d.multiplyByScalar(d.UNIT_Y,dOe,uOe);E.y<0&&(d.negate(N,N),x=f.attributes,S=f.indices,B=u.attributes,v=u.indices);let L=d.add(P,N,fOe);x.position.values.push(E.x,E.y,E.z,E.x,E.y,E.z),x.position.values.push(L.x,L.y,L.z),x.position.values.push(L.x,L.y,L.z),x.prevPosition.values.push(o[y*3],o[y*3+1],o[y*3+2]),x.prevPosition.values.push(o[y*3+3],o[y*3+4],o[y*3+5]),x.prevPosition.values.push(E.x,E.y,E.z,E.x,E.y,E.z),x.nextPosition.values.push(L.x,L.y,L.z),x.nextPosition.values.push(L.x,L.y,L.z),x.nextPosition.values.push(L.x,L.y,L.z),x.nextPosition.values.push(L.x,L.y,L.z),d.negate(N,N),d.add(P,N,L),B.position.values.push(L.x,L.y,L.z),B.position.values.push(L.x,L.y,L.z),B.position.values.push(b.x,b.y,b.z,b.x,b.y,b.z),B.prevPosition.values.push(L.x,L.y,L.z),B.prevPosition.values.push(L.x,L.y,L.z),B.prevPosition.values.push(L.x,L.y,L.z),B.prevPosition.values.push(L.x,L.y,L.z),B.nextPosition.values.push(b.x,b.y,b.z,b.x,b.y,b.z),B.nextPosition.values.push(r[C*3],r[C*3+1],r[C*3+2]),B.nextPosition.values.push(r[C*3+3],r[C*3+4],r[C*3+5]);let g=k.fromArray(a,y*2,Pae),I=Math.abs(g.y);x.expandAndWidth.values.push(-1,I,1,I),x.expandAndWidth.values.push(-1,-I,1,-I),B.expandAndWidth.values.push(-1,I,1,I),B.expandAndWidth.values.push(-1,-I,1,-I);let T=d.magnitudeSquared(d.subtract(P,E,t6));if(T/=d.magnitudeSquared(d.subtract(b,E,t6)),l(c)){let w=ie.fromArray(c,y*4,Rae),R=ie.fromArray(c,C*4,Rae),O=D.lerp(w.x,R.x,T),G=D.lerp(w.y,R.y,T),F=D.lerp(w.z,R.z,T),U=D.lerp(w.w,R.w,T);for(p=y*4;p<y*4+8;++p)x.color.values.push(c[p]);for(x.color.values.push(O,G,F,U),x.color.values.push(O,G,F,U),B.color.values.push(O,G,F,U),B.color.values.push(O,G,F,U),p=C*4;p<C*4+8;++p)B.color.values.push(c[p])}if(l(s)){let w=k.fromArray(s,y*2,Pae),R=k.fromArray(s,(h+3)*2,cOe),O=D.lerp(w.x,R.x,T);for(p=y*2;p<y*2+4;++p)x.st.values.push(s[p]);for(x.st.values.push(O,w.y),x.st.values.push(O,R.y),B.st.values.push(O,w.y),B.st.values.push(O,R.y),p=C*2;p<C*2+4;++p)B.st.values.push(s[p])}A=x.position.values.length/3-4,S.push(A,A+2,A+1),S.push(A+1,A+2,A+3),A=B.position.values.length/3-4,v.push(A,A+2,A+1),v.push(A+1,A+2,A+3)}else{let N,L;for(E.y<0?(N=f.attributes,L=f.indices):(N=u.attributes,L=u.indices),N.position.values.push(E.x,E.y,E.z),N.position.values.push(E.x,E.y,E.z),N.position.values.push(b.x,b.y,b.z),N.position.values.push(b.x,b.y,b.z),p=h*3;p<h*3+12;++p)N.prevPosition.values.push(o[p]),N.nextPosition.values.push(r[p]);for(p=h*2;p<h*2+8;++p)N.expandAndWidth.values.push(a[p]),l(s)&&N.st.values.push(s[p]);if(l(c))for(p=h*4;p<h*4+16;++p)N.color.values.push(c[p]);A=N.position.values.length/3-4,L.push(A,A+2,A+1),L.push(A+1,A+2,A+3)}}m&&(Mae(f),Mae(u)),n6(e,f,u)}Sl.splitLongitude=function(e){let t=e.geometry,n=t.boundingSphere;if(l(n)&&(n.center.x-n.radius>0||le.intersectPlane(n,cn.ORIGIN_ZX_PLANE)!==Xt.INTERSECTING))return e;if(t.geometryType!==ud.NONE)switch(t.geometryType){case ud.POLYLINES:hOe(e);break;case ud.TRIANGLES:Dae(e);break;case ud.LINES:vae(e);break}else ZLe(t),t.primitiveType===ve.TRIANGLES?Dae(e):t.primitiveType===ve.LINES&&vae(e);return e};var Wn=Sl;function gD(e,t,n,i,o,r,a,s,c,u,f){this._context=e,this._texture=t,this._textureTarget=n,this._targetFace=i,this._pixelDatatype=a,this._internalFormat=o,this._pixelFormat=r,this._size=s,this._preMultiplyAlpha=c,this._flipY=u,this._initialized=f}Object.defineProperties(gD.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});gD.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e,{width:r,height:a}=i,s=this._context._gl,c=this._textureTarget,u=this._targetFace;s.activeTexture(s.TEXTURE0),s.bindTexture(c,this._texture);let f=i.arrayBufferView,h=this._size,p=this._pixelFormat,A=this._internalFormat,m=this._pixelDatatype,_=this._preMultiplyAlpha,y=this._flipY,C=4;l(f)&&(C=qe.alignmentInBytes(p,m,r)),s.pixelStorei(s.UNPACK_ALIGNMENT,C),o?s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.NONE):s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.BROWSER_DEFAULT_WEBGL);let E=!1;if(!this._initialized){let b;t===0&&n===0&&r===h&&a===h?(l(f)?(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),y&&(f=qe.flipY(f,p,m,h,h)),b=f):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,_),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,y),b=i),E=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),b=qe.createTypedArray(p,m,h,h)),s.texImage2D(u,0,A,h,h,0,p,He.toWebGLConstant(m,this._context),b),this._initialized=!0}E||(l(f)?(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),y&&(f=qe.flipY(f,p,m,r,a)),s.texSubImage2D(u,0,t,n,r,a,p,He.toWebGLConstant(m,this._context),f)):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,_),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,y),s.texSubImage2D(u,0,t,n,p,He.toWebGLConstant(m,this._context),i))),s.bindTexture(c,null)};gD.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){e=e??0,t=t??0,n=n??0,i=i??0,o=o??this._size,r=r??this._size;let a=this._context._gl,s=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(s,this._texture),a.copyTexSubImage2D(this._targetFace,0,e,t,n,i,o,r),a.bindTexture(s,null),this._initialized=!0};gD.prototype.copyMipmapFromFramebuffer=function(e,t,n,i,o){e=e??0,t=t??0,n=n??this._size,i=i??this._size,o=o??0;let r=this._context._gl,a=this._textureTarget;r.activeTexture(r.TEXTURE0),r.bindTexture(a,this._texture),r.copyTexImage2D(this._targetFace,o,this._internalFormat,e,t,n,i,0),r.bindTexture(a,null),this._initialized=!0};var _D=gD;var tV={DONT_CARE:ee.DONT_CARE,FASTEST:ee.FASTEST,NICEST:ee.NICEST,validate:function(e){return e===tV.DONT_CARE||e===tV.FASTEST||e===tV.NICEST}},hd=Object.freeze(tV);var nV={NEAREST:ee.NEAREST,LINEAR:ee.LINEAR};nV.validate=function(e){return e===nV.NEAREST||e===nV.LINEAR};var ci=Object.freeze(nV);var ey={NEAREST:ee.NEAREST,LINEAR:ee.LINEAR,NEAREST_MIPMAP_NEAREST:ee.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:ee.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:ee.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:ee.LINEAR_MIPMAP_LINEAR};ey.validate=function(e){return e===ey.NEAREST||e===ey.LINEAR||e===ey.NEAREST_MIPMAP_NEAREST||e===ey.LINEAR_MIPMAP_NEAREST||e===ey.NEAREST_MIPMAP_LINEAR||e===ey.LINEAR_MIPMAP_LINEAR};var Wt=Object.freeze(ey);var iV={CLAMP_TO_EDGE:ee.CLAMP_TO_EDGE,REPEAT:ee.REPEAT,MIRRORED_REPEAT:ee.MIRRORED_REPEAT,validate:function(e){return e===iV.CLAMP_TO_EDGE||e===iV.REPEAT||e===iV.MIRRORED_REPEAT}},pn=Object.freeze(iV);function yD(e){e=e??V.EMPTY_OBJECT;let{wrapR:t=pn.CLAMP_TO_EDGE,wrapS:n=pn.CLAMP_TO_EDGE,wrapT:i=pn.CLAMP_TO_EDGE,minificationFilter:o=Wt.LINEAR,magnificationFilter:r=ci.LINEAR,maximumAnisotropy:a=1}=e;this._wrapR=t,this._wrapS=n,this._wrapT=i,this._minificationFilter=o,this._magnificationFilter=r,this._maximumAnisotropy=a}Object.defineProperties(yD.prototype,{wrapR:{get:function(){return this._wrapR}},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}}});yD.equals=function(e,t){return e===t||l(e)&&l(t)&&e._wrapR===t._wrapR&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy};yD.NEAREST=Object.freeze(new yD({wrapR:pn.CLAMP_TO_EDGE,wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Wt.NEAREST,magnificationFilter:ci.NEAREST}));var jt=yD;function mOe(e,t){if(!e)throw new de(t)}var o6=mOe;function pOe(e,t,n,i){let o=l(t.vertexBuffer),r=l(t.value),a=t.value?t.value.length:t.componentsPerAttribute,s={index:t.index??n,enabled:t.enabled??!0,vertexBuffer:t.vertexBuffer,value:r?t.value.slice(0):void 0,componentsPerAttribute:a,componentDatatype:t.componentDatatype??j.FLOAT,normalize:t.normalize??!1,offsetInBytes:t.offsetInBytes??0,strideInBytes:t.strideInBytes??0,instanceDivisor:t.instanceDivisor??0};if(o)s.vertexAttrib=function(c){let u=this.index;c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),c.vertexAttribPointer(u,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),c.enableVertexAttribArray(u),this.instanceDivisor>0&&(i.glVertexAttribDivisor(u,this.instanceDivisor),i._vertexAttribDivisors[u]=this.instanceDivisor,i._previousDrawInstanced=!0)},s.disableVertexAttribArray=function(c){c.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(s.componentsPerAttribute){case 1:s.vertexAttrib=function(c){c.vertexAttrib1fv(this.index,this.value)};break;case 2:s.vertexAttrib=function(c){c.vertexAttrib2fv(this.index,this.value)};break;case 3:s.vertexAttrib=function(c){c.vertexAttrib3fv(this.index,this.value)};break;case 4:s.vertexAttrib=function(c){c.vertexAttrib4fv(this.index,this.value)};break}s.disableVertexAttribArray=function(c){}}e.push(s)}function kae(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 Bh(e){e=e??V.EMPTY_OBJECT;let t=e.context,n=t._gl,i=e.attributes,o=e.indexBuffer,r,a=[],s=1,c=!1,u=!1,f=i.length;for(r=0;r<f;++r)pOe(a,i[r],r,t);for(f=a.length,r=0;r<f;++r){let p=a[r];if(l(p.vertexBuffer)&&p.instanceDivisor===0){let A=p.strideInBytes||p.componentsPerAttribute*j.getSizeInBytes(p.componentDatatype);s=p.vertexBuffer.sizeInBytes/A;break}}for(r=0;r<f;++r)a[r].instanceDivisor>0&&(c=!0),l(a[r].value)&&(u=!0);let h;t.vertexArrayObject&&(h=t.glCreateVertexArray(),t.glBindVertexArray(h),kae(n,a,o),t.glBindVertexArray(null)),this._numberOfVertices=s,this._hasInstancedAttributes=c,this._hasConstantAttributes=u,this._context=t,this._gl=n,this._vao=h,this._attributes=a,this._indexBuffer=o}function Qae(e){return e.values.length/e.componentsPerAttribute}function AOe(e){return j.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function gOe(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===j.DOUBLE&&(e[n].componentDatatype=j.FLOAT,e[n].values=j.createTypedArray(j.FLOAT,e[n].values)));let r,a=o.length;if(a>0)for(r=Qae(e[o[0]]),t=1;t<a;++t){let u=Qae(e[o[t]]);if(u!==r)throw new ue(`Each attribute list must have the same number of vertices. Attribute ${o[t]} has a different number of vertices (${u.toString()}) than attribute ${o[0]} (${r.toString()}).`)}o.sort(function(u,f){return j.getSizeInBytes(e[f].componentDatatype)-j.getSizeInBytes(e[u].componentDatatype)});let s=0,c={};for(t=0;t<a;++t)n=o[t],i=e[n],c[n]=s,s+=AOe(i);if(s>0){let u=j.getSizeInBytes(e[o[0]].componentDatatype),f=s%u;f!==0&&(s+=u-f);let h=r*s,p=new ArrayBuffer(h),A={};for(t=0;t<a;++t){n=o[t];let m=j.getSizeInBytes(e[n].componentDatatype);A[n]={pointer:j.createTypedArray(e[n].componentDatatype,p),index:c[n]/m,strideInComponentType:s/m}}for(t=0;t<r;++t)for(let m=0;m<a;++m){n=o[m],i=e[n];let _=i.values,y=A[n],C=y.pointer,E=i.componentsPerAttribute;for(let b=0;b<E;++b)C[y.index+b]=_[t*E+b];y.index+=y.strideInComponentType}return{buffer:p,offsetsInBytes:c,vertexSizeInBytes:s}}}Bh.fromGeometry=function(e){e=e??V.EMPTY_OBJECT;let t=e.context,n=e.geometry??V.EMPTY_OBJECT,i=e.bufferUsage??Re.DYNAMIC_DRAW,o=e.attributeLocations??V.EMPTY_OBJECT,r=e.interleave??!1,a=e.vertexArrayAttributes,s,c,u,f=l(a)?a:[],h=n.attributes;if(r){let m=gOe(h);if(l(m)){u=tt.createVertexBuffer({context:t,typedArray:m.buffer,usage:i});let _=m.offsetsInBytes,y=m.vertexSizeInBytes;for(s in h)h.hasOwnProperty(s)&&l(h[s])&&(c=h[s],l(c.values)?f.push({index:o[s],vertexBuffer:u,componentDatatype:c.componentDatatype,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,offsetInBytes:_[s],strideInBytes:y}):f.push({index:o[s],value:c.value,componentDatatype:c.componentDatatype,normalize:c.normalize}))}}else for(s in h)if(h.hasOwnProperty(s)&&l(h[s])){c=h[s];let m=c.componentDatatype;m===j.DOUBLE&&(m=j.FLOAT);let _={};u=void 0,l(c.values)&&(u=tt.createVertexBuffer({context:t,typedArray:j.createTypedArray(m,c.values),usage:i}),_={index:o[s],vertexBuffer:u,value:c.value,componentDatatype:m,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize}),l(c.typedArray)&&(u=tt.createVertexBuffer({context:t,typedArray:c.typedArray,usage:i}),_={index:o[s],vertexBuffer:u,value:void 0,componentDatatype:m,componentsPerAttribute:Ut.getNumberOfComponents(c.type),normalize:c.normalized,instanceDivisor:c.instanceDivisor}),f.push(_)}let p,A=n.indices;return l(A)&&(yt.computeNumberOfVertices(n)>=D.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=tt.createIndexBuffer({context:t,typedArray:new Uint32Array(A),usage:i,indexDatatype:Ue.UNSIGNED_INT}):p=tt.createIndexBuffer({context:t,typedArray:new Uint16Array(A),usage:i,indexDatatype:Ue.UNSIGNED_SHORT})),new Bh({context:t,attributes:f,indexBuffer:p})};Object.defineProperties(Bh.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});Bh.prototype.getAttribute=function(e){return this._attributes[e]};function _Oe(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,o=e._attributes,r=Rt.maximumVertexAttributes,a;if(n){let s=o.length;for(a=0;a<s;++a){let c=o[a];if(c.enabled){let u=c.instanceDivisor,f=c.index;u!==i[f]&&(t.glVertexAttribDivisor(f,u),i[f]=u)}}}else for(a=0;a<r;++a)i[a]>0&&(t.glVertexAttribDivisor(a,0),i[a]=0)}function yOe(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)}}Bh.prototype.copyAttributeFromRange=function(e,t,n,i){let o=this.getAttribute(e),r=o.vertexBuffer,a=o.componentsPerAttribute,s=t.constructor,c=n*a*s.BYTES_PER_ELEMENT,u=new s(t.buffer,t.byteOffset+c,i*a);r.copyFromArrayView(u,c)};Bh.prototype.copyIndexFromRange=function(e,t,n){let i=this._indexBuffer,o=e.constructor,r=t*o.BYTES_PER_ELEMENT,a=new o(e.buffer,e.byteOffset+r,n);i.copyFromArrayView(a,r)};Bh.prototype._bind=function(){l(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&_Oe(this),this._hasConstantAttributes&&yOe(this,this._gl)):kae(this._gl,this._attributes,this._indexBuffer)};Bh.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)}};Bh.prototype.isDestroyed=function(){return!1};Bh.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),fe(this)};var Gn=Bh;function Tr(e){e=e??V.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=qe.RGBA,pixelDatatype:o=He.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:a=!1,sampler:s=new jt}=e,c=e.preMultiplyAlpha||i===qe.RGB||i===qe.LUMINANCE,{width:u,height:f}=e;l(n)&&({width:u,height:f}=n.positiveX);let h=u,p=qe.textureSizeInBytes(i,o,h,h)*6,A=qe.toInternalFormat(i,o,t),m=t._gl,_=m.TEXTURE_CUBE_MAP,y=m.createTexture();this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=_,this._texture=y,this._pixelFormat=i,this._pixelDatatype=o,this._size=h,this._hasMipmap=!1,this._sizeInBytes=p,this._preMultiplyAlpha=c,this._flipY=r;let C=l(n);function E(b){return new _D(t,y,_,b,A,i,o,h,c,r,C)}this._positiveX=E(m.TEXTURE_CUBE_MAP_POSITIVE_X),this._negativeX=E(m.TEXTURE_CUBE_MAP_NEGATIVE_X),this._positiveY=E(m.TEXTURE_CUBE_MAP_POSITIVE_Y),this._negativeY=E(m.TEXTURE_CUBE_MAP_NEGATIVE_Y),this._positiveZ=E(m.TEXTURE_CUBE_MAP_POSITIVE_Z),this._negativeZ=E(m.TEXTURE_CUBE_MAP_NEGATIVE_Z),this._sampler=s,Uae(this,s),m.activeTexture(m.TEXTURE0),m.bindTexture(_,y),a?m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.NONE):m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.BROWSER_DEFAULT_WEBGL);for(let b of Tr.faceNames())r6(this[b],n?.[b],0);m.bindTexture(_,null)}Tr.prototype.copyFace=function(e,t,n,i){let o=e.context,r=new la({context:o,colorTextures:[t],destroyAttachments:!1});r._bind(),this[n].copyMipmapFromFramebuffer(0,0,t.width,t.height,i??0),r._unBind(),r.destroy()};Tr.FaceName=Object.freeze({POSITIVEX:"positiveX",NEGATIVEX:"negativeX",POSITIVEY:"positiveY",NEGATIVEY:"negativeY",POSITIVEZ:"positiveZ",NEGATIVEZ:"negativeZ"});function*COe(){yield Tr.FaceName.POSITIVEX,yield Tr.FaceName.NEGATIVEX,yield Tr.FaceName.POSITIVEY,yield Tr.FaceName.NEGATIVEY,yield Tr.FaceName.POSITIVEZ,yield Tr.FaceName.NEGATIVEZ}Tr.faceNames=function(){return COe()};function r6(e,t,n){n=n??0;let i=e._targetFace,o=Math.max(Math.floor(e._size/2**n),1),r=e._pixelFormat,a=e._pixelDatatype,s=e._internalFormat,c=e._flipY,u=e._preMultiplyAlpha,f=e._context,h=f._gl;if(!l(t)){h.texImage2D(i,n,s,o,o,0,r,He.toWebGLConstant(a,f),null);return}let{arrayBufferView:p}=t,A=4;l(p)&&(A=qe.alignmentInBytes(r,a,o)),h.pixelStorei(h.UNPACK_ALIGNMENT,A),l(p)?(h.pixelStorei(h.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),h.pixelStorei(h.UNPACK_FLIP_Y_WEBGL,!1),c&&(p=qe.flipY(p,r,a,o,o)),h.texImage2D(i,n,s,o,o,0,r,He.toWebGLConstant(a,f),p)):(h.pixelStorei(h.UNPACK_PREMULTIPLY_ALPHA_WEBGL,u),h.pixelStorei(h.UNPACK_FLIP_Y_WEBGL,c),h.texImage2D(i,n,s,r,He.toWebGLConstant(a,f),t))}Tr.loadFace=r6;Object.defineProperties(Tr.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){Uae(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}}});Tr.getDirection=function(e,t){switch(e){case Tr.FaceName.POSITIVEX:return d.clone(d.UNIT_X,t);case Tr.FaceName.NEGATIVEX:return d.negate(d.UNIT_X,t);case Tr.FaceName.POSITIVEY:return d.clone(d.UNIT_Y,t);case Tr.FaceName.NEGATIVEY:return d.negate(d.UNIT_Y,t);case Tr.FaceName.POSITIVEZ:return d.clone(d.UNIT_Z,t);case Tr.FaceName.NEGATIVEZ:return d.negate(d.UNIT_Z,t)}};function Uae(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[Wt.NEAREST_MIPMAP_NEAREST,Wt.NEAREST_MIPMAP_LINEAR,Wt.LINEAR_MIPMAP_NEAREST,Wt.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,a=e._pixelDatatype;(a===He.FLOAT&&!r.textureFloatLinear||a===He.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?Wt.NEAREST_MIPMAP_NEAREST:Wt.NEAREST,i=ci.NEAREST);let s=r._gl,c=e._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(c,e._texture),s.texParameteri(c,s.TEXTURE_MIN_FILTER,n),s.texParameteri(c,s.TEXTURE_MAG_FILTER,i),s.texParameteri(c,s.TEXTURE_WRAP_S,t.wrapS),s.texParameteri(c,s.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&s.texParameteri(c,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),s.bindTexture(c,null)}Tr.prototype.loadMipmaps=function(e,t){t=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 a=e[r],s=r+1;for(let c of Tr.faceNames())r6(this[c],a[c],s)}n.bindTexture(o,null),this._hasMipmap=!0};Tr.prototype.generateMipmap=function(e){e=e??hd.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)};Tr.createVertexArray=function(e){let t=Ic.createGeometry(Ic.fromDimensions({dimensions:new d(2,2,2),vertexFormat:ke.POSITION_ONLY})),n=this._attributeLocations=Wn.createAttributeLocations(t);return Gn.fromGeometry({context:e,geometry:t,attributeLocations:n,bufferUsage:Re.STATIC_DRAW})};Tr.prototype.isDestroyed=function(){return!1};Tr.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=fe(this._positiveX),this._negativeX=fe(this._negativeX),this._positiveY=fe(this._positiveY),this._negativeY=fe(this._negativeY),this._positiveZ=fe(this._positiveZ),this._negativeZ=fe(this._negativeZ),fe(this)};var Kr=Tr;function EOe(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var Wc=EOe;var a6=class{constructor(t,n,i){this._pickObjects=t,this.key=n,this.color=i}get object(){return this._pickObjects.get(this.key)}set object(t){this._pickObjects.set(this.key,t)}destroy(){this._pickObjects.delete(this.key)}},CD=a6;var ED=`/**
* 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 bD=`/**
* 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 ID=`/**
* 0.1
*
* @name czm_epsilon1
* @glslConstant
*/
const float czm_epsilon1 = 0.1;
`;var xD=`/**
* 0.01
*
* @name czm_epsilon2
* @glslConstant
*/
const float czm_epsilon2 = 0.01;
`;var TD=`/**
* 0.001
*
* @name czm_epsilon3
* @glslConstant
*/
const float czm_epsilon3 = 0.001;
`;var SD=`/**
* 0.0001
*
* @name czm_epsilon4
* @glslConstant
*/
const float czm_epsilon4 = 0.0001;
`;var wD=`/**
* 0.00001
*
* @name czm_epsilon5
* @glslConstant
*/
const float czm_epsilon5 = 0.00001;
`;var BD=`/**
* 0.000001
*
* @name czm_epsilon6
* @glslConstant
*/
const float czm_epsilon6 = 0.000001;
`;var DD=`/**
* 0.0000001
*
* @name czm_epsilon7
* @glslConstant
*/
const float czm_epsilon7 = 0.0000001;
`;var vD=`/**
* 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 PD=`/**
* 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 RD=`/**
* 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 MD=`/**
* The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE}
*
* @name czm_passCesium3DTile
* @glslConstant
*
* @see czm_pass
*/
const float czm_passCesium3DTile = 5.0;
`;var ND=`/**
* The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION}
*
* @name czm_passCesium3DTileClassification
* @glslConstant
*
* @see czm_pass
*/
const float czm_passCesium3DTileClassification = 6.0;
`;var LD=`/**
* The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW}
*
* @name czm_passCesium3DTileClassificationIgnoreShow
* @glslConstant
*
* @see czm_pass
*/
const float czm_passCesium3DTileClassificationIgnoreShow = 7.0;
`;var OD=`/**
* The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_EDGES}
*
* @name czm_passCesium3DTileEdges
* @glslConstant
*
* @see czm_pass
*/
const float czm_passCesium3DTileEdges = 4.0;
`;var FD=`/**
* The automatic GLSL constant for {@link Pass#CLASSIFICATION}
*
* @name czm_passClassification
* @glslConstant
*
* @see czm_pass
*/
const float czm_passClassification = 7.0;
`;var QD=`/**
* The automatic GLSL constant for {@link Pass#COMPUTE}
*
* @name czm_passCompute
* @glslConstant
*
* @see czm_pass
*/
const float czm_passCompute = 1.0;
`;var kD=`/**
* The automatic GLSL constant for {@link Pass#ENVIRONMENT}
*
* @name czm_passEnvironment
* @glslConstant
*
* @see czm_pass
*/
const float czm_passEnvironment = 0.0;
`;var UD=`/**
* The automatic GLSL constant for {@link Pass#GAUSSIAN_SPLATS}
*
* @name czm_passGaussianSplats
* @glslConstant
*
* @see czm_pass
*/
const float czm_passGaussianSplats = 11.0;
`;var zD=`/**
* The automatic GLSL constant for {@link Pass#GLOBE}
*
* @name czm_passGlobe
* @glslConstant
*
* @see czm_pass
*/
const float czm_passGlobe = 2.0;
`;var GD=`/**
* The automatic GLSL constant for {@link Pass#OPAQUE}
*
* @name czm_passOpaque
* @glslConstant
*
* @see czm_pass
*/
const float czm_passOpaque = 8.0;
`;var VD=`/**
* The automatic GLSL constant for {@link Pass#OVERLAY}
*
* @name czm_passOverlay
* @glslConstant
*
* @see czm_pass
*/
const float czm_passOverlay = 12.0;
`;var HD=`/**
* The automatic GLSL constant for {@link Pass#TERRAIN_CLASSIFICATION}
*
* @name czm_passTerrainClassification
* @glslConstant
*
* @see czm_pass
*/
const float czm_passTerrainClassification = 3.0;
`;var WD=`/**
* The automatic GLSL constant for {@link Pass#TRANSLUCENT}
*
* @name czm_passTranslucent
* @glslConstant
*
* @see czm_pass
*/
const float czm_passTranslucent = 9.0;
`;var jD=`/**
* The automatic GLSL constant for {@link Pass#VOXELS}
*
* @name czm_passVoxels
* @glslConstant
*
* @see czm_pass
*/
const float czm_passVoxels = 10.0;
`;var YD=`/**
* 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 qD=`/**
* 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 KD=`/**
* 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 XD=`/**
* 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 JD=`/**
* 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 ZD=`/**
* 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 $D=`/**
* 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 ev=`/**
* 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 tv=`/**
* 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 nv=`/**
* 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 iv=`/**
* 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 ov=`/**
* 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 rv=`/**
* 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 av=`/**
* 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 sv=`/**
* @name czm_depthRangeStruct
* @glslStruct
*/
struct czm_depthRangeStruct
{
float near;
float far;
};
`;var cv=`/**
* 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 lv=`/**
* 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 uv=`/**
* 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 fv=`/**
* 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 dv=`/**
* DOC_TBA
*
* @name czm_ray
* @glslStruct
*/
struct czm_ray
{
vec3 origin;
vec3 direction;
};
`;var hv=`/**
* 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 mv=`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 pv=`// 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 Av=`/**
* @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 gv=`/**
* 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 _v=`/**
* 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 yv=`/**
* 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 Cv=`/**
* 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 Ev=`/**
* 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 bv=`/**
* 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 Iv=`
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 xv=`
uniform vec4 shadowMap_cascadeDistances;
float czm_cascadeDistance(vec4 weights)
{
return dot(shadowMap_cascadeDistances, weights);
}
`;var Tv=`
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 Sv=`
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 wv=`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 Bv=`/**
* DOC_TBA
*
* @name czm_columbusViewMorph
* @glslFunction
*/
vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time)
{
// Just linear for now.
// We're manually doing the equivalent of a \`mix\` here because, some GPUs
// (NVidia GeForce 3070 Ti and Intel Arc A750, to name two), \`mix\` seems to
// use an alternate formulation that introduces jitter even when \`time\` is
// 0.0 or 1.0. That is, the value of \`p\` won't be exactly \`position2D.xyz\`
// when \`time\` is 0.0 and it won't be exactly \`position3D.xyz\` when \`time\` is
// 1.0. The "textbook" formulation here, while probably a bit slower,
// does not have this problem.
vec3 p = position2D.xyz * (1.0 - time) + position3D.xyz * time;
return vec4(p, 1.0);
}
`;var Dv=`/**
* 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);
}
/**
* 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 {czm_ray} primaryRay Ray from the origin to sky fragment to 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(
czm_ray primaryRay,
vec3 lightDirection,
vec3 rayleighColor,
vec3 mieColor,
float opacity
) {
vec3 direction = normalize(primaryRay.direction);
float cosAngle = dot(direction, 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 vv=`/**
* 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 Pv=`/**
* 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 Rv=`/**
* 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) {
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 Mv=`/**
* Applies a 2D texture transformation matrix to texture coordinates.
* This function applies translation, rotation, and scaling transformations
* as specified by the KHR_texture_transform glTF extension.
*
* @name czm_computeTextureTransform
* @glslFunction
*
* @param {vec2} texCoord The texture coordinates to transform.
* @param {mat3} textureTransform The 3x3 transformation matrix.
*
* @returns {vec2} The transformed texture coordinates.
*
* @example
* // GLSL declaration
* vec2 czm_computeTextureTransform(vec2 texCoord, mat3 textureTransform);
*
* // Apply texture transform to UV coordinates
* vec2 transformedUV = czm_computeTextureTransform(uv, u_textureTransform);
*/
vec2 czm_computeTextureTransform(vec2 texCoord, mat3 textureTransform)
{
return vec2(textureTransform * vec3(texCoord, 1.0));
}`;var Nv=`/**
* @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 Lv=`/**
* Decodes RGB values packed into a single float at 8-bit precision. Encoded
* representation is equivalent to 0xFFFFFF in JavaScript.
*
* @name czm_decodeRGB8
* @glslFunction
*
* @param {float} encoded Float-encoded RGB values.
* @returns {vec4} Decoded RGB values.
*/
vec4 czm_decodeRGB8(float encoded) {
const float SHIFT_RIGHT16 = 1.0 / 65536.0;
const float SHIFT_RIGHT8 = 1.0 / 256.0;
const float SHIFT_LEFT16 = 65536.0;
const float SHIFT_LEFT8 = 256.0;
vec4 color = vec4(255.0);
color.r = floor(encoded * SHIFT_RIGHT16);
color.g = floor((encoded - color.r * SHIFT_LEFT16) * SHIFT_RIGHT8);
color.b = floor(encoded - color.r * SHIFT_LEFT16 - color.g * SHIFT_LEFT8);
return color / 255.0;
}
`;var Ov=`/**
* 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 Fv=`// 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 Qv=`/**
* 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 kv=`/**
* 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 Uv=`/**
* 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 zv=`/**
* 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 Gv=`/**
* 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 Vv=`/**
* 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 Hv=`/**
* 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 Wv=`/**
* 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 jv=`/**
* 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 Yv=`/**
* 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 qv=`/**
* 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 Kv=`/**
* 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 Xv=`/**
* 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 Jv=`/**
* 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 Zv=`/**
* @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 $v=`/**
* 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 eP=`/**
* 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 tP=`/**
* 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 nP=`/**
* 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 iP=`/**
* 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 oP=`/**
* 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 rP=`/**
* 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 aP=`/**
* 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 sP=`/**
* 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 cP=`/**
* 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 lP=`/**
* 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 uP=`/**
* 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 fP=`/**
* 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 positionEC = czm_modelView * position;
vec4 q = czm_projection * positionEC;
q.xyz /= q.w; // normalized device coordinates
q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates
return q;
}
`;var dP=`/**
* 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 hP=`/**
* 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 mP=` /**
* 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 pP=`/**
* Packs a depth value into a vec4 that can be represented by unsigned bytes.
*
* @name czm_packDepth
* @glslFunction
*
* @param {float} depth The floating-point depth.
* @returns {vec4} 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 AP=`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 gP=`// 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 _P=`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 yP=`/**
* 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 CP=`/**
* 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 EP=`/**
* 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 bP=`/**
* 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 IP=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords)
{
return czm_reverseLogDepth(texture(depthTexture, texCoords).r);
}
`;var xP=`/**
* 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 TP=`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 = exp2(log2Depth) - 1.0;
return far * (1.0 - near / (depthFromNear + near)) / (far - near);
#endif
return logZ;
}
`;var SP=`/**
* 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 wP=`/**
* 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 BP=`/**
* 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 DP=`/**
* 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 vP=`/**
* 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 PP=`
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 RP=`
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 MP=`/**
* 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 NP=`/**
* 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;
vec3 L =
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);
return max(L, vec3(0.0));
}
`;var LP=`/**
* 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 OP=`/**
* 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 FP=`/**
* 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 QP=`/**
* 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 kP=`/**
* 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 UP=`/**
* @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 zP=`/**
* 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 GP=`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 VP=`/**
* 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 HP=`/**
* 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 WP=`/**
* Useful for reinterpreting texture data as higher-precision values.
* Only works correctly in WebGL 2, which supports the uint type and bitwise operations.
*
* @param {float|vec2|vec3|vec4} 1-4 values from a texture lookup (RGBA channels), normalized to [0.0, 1.0].
* @return {uint} Raw bits as an unsigned integer.
*/
uint czm_unpackTexture(float packedValue) {
float rounded = czm_round(packedValue * 255.0);
return uint(rounded);
}
uint czm_unpackTexture(vec2 packedValue) {
vec2 rounded = czm_round(packedValue * 255.0);
uint byte0 = uint(rounded.x);
uint byte1 = uint(rounded.y);
return byte0 | (byte1 << 8);
}
uint czm_unpackTexture(vec3 packedValue) {
vec3 rounded = czm_round(packedValue * 255.0);
uint byte0 = uint(rounded.x);
uint byte1 = uint(rounded.y);
uint byte2 = uint(rounded.z);
return byte0 | (byte1 << 8) | (byte2 << 16);
}
uint czm_unpackTexture(vec4 packedValue) {
vec4 rounded = czm_round(packedValue * 255.0);
uint byte0 = uint(rounded.x);
uint byte1 = uint(rounded.y);
uint byte2 = uint(rounded.z);
uint byte3 = uint(rounded.w);
return byte0 | (byte1 << 8) | (byte2 << 16) | (byte3 << 24);
}
`;var jP=`/**
* 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 YP=`/**
* 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 qP=`#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 KP=`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 = exp2(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
#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 XP=`// 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 JP=`#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 ZP=`/**
* 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 $P=`/**
* 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 vE={czm_degreesPerRadian:ED,czm_depthRange:bD,czm_epsilon1:ID,czm_epsilon2:xD,czm_epsilon3:TD,czm_epsilon4:SD,czm_epsilon5:wD,czm_epsilon6:BD,czm_epsilon7:DD,czm_infinity:vD,czm_oneOverPi:PD,czm_oneOverTwoPi:RD,czm_passCesium3DTile:MD,czm_passCesium3DTileClassification:ND,czm_passCesium3DTileClassificationIgnoreShow:LD,czm_passCesium3DTileEdges:OD,czm_passClassification:FD,czm_passCompute:QD,czm_passEnvironment:kD,czm_passGaussianSplats:UD,czm_passGlobe:zD,czm_passOpaque:GD,czm_passOverlay:VD,czm_passTerrainClassification:HD,czm_passTranslucent:WD,czm_passVoxels:jD,czm_pi:YD,czm_piOverFour:qD,czm_piOverSix:KD,czm_piOverThree:XD,czm_piOverTwo:JD,czm_radiansPerDegree:ZD,czm_sceneMode2D:$D,czm_sceneMode3D:ev,czm_sceneModeColumbusView:tv,czm_sceneModeMorphing:nv,czm_solarRadius:iv,czm_threePiOver2:ov,czm_twoPi:rv,czm_webMercatorMaxLatitude:av,czm_depthRangeStruct:sv,czm_material:cv,czm_materialInput:lv,czm_modelMaterial:uv,czm_modelVertexOutput:fv,czm_ray:dv,czm_raySegment:hv,czm_shadowParameters:mv,czm_acesTonemapping:pv,czm_alphaWeight:Av,czm_antialias:gv,czm_applyHSBShift:_v,czm_approximateSphericalCoordinates:yv,czm_approximateTanh:Cv,czm_backFacing:Ev,czm_branchFreeTernary:bv,czm_cascadeColor:Iv,czm_cascadeDistance:xv,czm_cascadeMatrix:Tv,czm_cascadeWeights:Sv,czm_clipPolygons:wv,czm_columbusViewMorph:Bv,czm_computeAtmosphereColor:Dv,czm_computeGroundAtmosphereScattering:vv,czm_computePosition:Pv,czm_computeScattering:Rv,czm_computeTextureTransform:Mv,czm_cosineAndSine:Nv,czm_decodeRGB8:Lv,czm_decompressTextureCoordinates:Ov,czm_depthClamp:Fv,czm_eastNorthUpToEyeCoordinates:Qv,czm_ellipsoidContainsPoint:kv,czm_ellipsoidTextureCoordinates:Uv,czm_equalsEpsilon:zv,czm_eyeOffset:Gv,czm_eyeToWindowCoordinates:Vv,czm_fastApproximateAtan:Hv,czm_fog:Wv,czm_gammaCorrect:jv,czm_geodeticSurfaceNormal:Yv,czm_getDefaultMaterial:qv,czm_getDynamicAtmosphereLightDirection:Kv,czm_getLambertDiffuse:Xv,czm_getSpecular:Jv,czm_getWaterNoise:Zv,czm_HSBToRGB:$v,czm_HSLToRGB:eP,czm_hue:tP,czm_inverseGamma:nP,czm_isEmpty:iP,czm_isFull:oP,czm_latitudeToWebMercatorFraction:rP,czm_linearToSrgb:aP,czm_lineDistance:sP,czm_luminance:cP,czm_maximumComponent:lP,czm_metersPerPixel:uP,czm_modelToWindowCoordinates:fP,czm_multiplyWithColorBalance:dP,czm_nearFarScalar:hP,czm_octDecode:mP,czm_packDepth:pP,czm_pbrLighting:AP,czm_pbrNeutralTonemapping:gP,czm_phong:_P,czm_planeDistance:yP,czm_pointAlongRay:CP,czm_rayEllipsoidIntersectionInterval:EP,czm_raySphereIntersectionInterval:bP,czm_readDepth:IP,czm_readNonPerspective:xP,czm_reverseLogDepth:TP,czm_RGBToHSB:SP,czm_RGBToHSL:wP,czm_RGBToXYZ:BP,czm_round:DP,czm_saturation:vP,czm_shadowDepthCompare:PP,czm_shadowVisibility:RP,czm_signNotZero:MP,czm_sphericalHarmonics:NP,czm_srgbToLinear:LP,czm_tangentToEyeSpaceMatrix:OP,czm_textureCube:FP,czm_transformPlane:QP,czm_translateRelativeToEye:kP,czm_translucentPhong:UP,czm_transpose:zP,czm_unpackClippingExtents:GP,czm_unpackDepth:VP,czm_unpackFloat:HP,czm_unpackTexture:WP,czm_unpackUint:jP,czm_valueTransform:YP,czm_vertexLogDepth:qP,czm_windowToEyeCoordinates:KP,czm_writeDepthClamp:XP,czm_writeLogDepth:JP,czm_writeNonPerspective:ZP,czm_XYZToRGB:$P};function bOe(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 eR=bOe;function zae(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 Gae(e,t,n){let i;for(let o=0;o<n.length;++o)n[o].name===e&&(i=n[o]);return l(i)||(t=zae(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function Vae(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&&vs._czmBuiltinsAndUniforms.hasOwnProperty(i)){let o=Gae(i,vs._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(o),o.requiredBy.push(e),Vae(o,t)}}))}function IOe(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 a=o.dependsOn[r],s=a.requiredBy.indexOf(o);a.requiredBy.splice(s,1),a.requiredBy.length===0&&t.push(a)}}let i=[];for(let o=0;o<n.length;++o)n[o].requiredBy.length!==0&&i.push(n[o])}function xOe(e){let t=[],n=Gae("main",e,t);Vae(n,t),IOe(t);let i="";for(let o=t.length-1;o>=0;--o)i=`${i+t[o].glslSource}
`;return i.replace(n.glslSource,"")}function Hae(e,t,n){let i="",o=e.sources;if(l(o))for(let A=0;A<o.length;++A)i+=`
#line 0
${o[A]}`;i=zae(i);let r;i=i.replace(/#version\s+(.*?)\n/gm,function(A,m){return r=m,`
`});let a=[];i=i.replace(/#extension.*\n/gm,function(A){return a.push(A),`
`}),i=i.replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");let s=e.pickColorQualifier;l(s)&&(i=vs.createPickFragmentShaderSource(i,s));let c="",u=a.length;for(let A=0;A<u;A++)c+=a[A];t&&(c+=`
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
precision highp int;
#else
precision mediump float;
precision mediump int;
#define highp mediump
#endif
`),n.webgl2&&(c+=`precision highp sampler3D;
`);let f=e.defines;if(l(f))for(let A=0,m=f.length;A<m;++A){let _=f[A];_.length!==0&&(c+=`#define ${_}
`)}n.textureFloatLinear&&(c+=`#define OES_texture_float_linear
`),n.floatingPointTexture&&(c+=`#define OES_texture_float
`);let h="";e.includeBuiltIns&&(h=xOe(i)),c+=`
#line 0
`;let p=h+i;return n.webgl2&&t&&!/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g.test(p)&&!/czm_out_FragColor/g.test(p)&&/out_FragColor/g.test(p)&&(c+=`layout(location = 0) out vec4 out_FragColor;
`),c+=h,c+=i,n.webgl2?c=`#version 300 es
${c}`:c=eR(c,t),c}function vs(e){e=e??V.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=e.includeBuiltIns??!0}vs.prototype.clone=function(){return new vs({sources:this.sources,defines:this.defines,pickColorQualifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})};vs.replaceMain=function(e,t){return t=`void ${t}()`,e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)};vs.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}`};vs.prototype.createCombinedVertexShader=function(e){return Hae(this,!1,e)};vs.prototype.createCombinedFragmentShader=function(e){return Hae(this,!0,e)};vs._czmBuiltinsAndUniforms={};for(let e in vE)vE.hasOwnProperty(e)&&(vs._czmBuiltinsAndUniforms[e]=vE[e]);for(let e in xA)if(xA.hasOwnProperty(e)){let t=xA[e];typeof t.getDeclaration=="function"&&(vs._czmBuiltinsAndUniforms[e]=t.getDeclaration(e))}vs.createPickVertexShaderSource=function(e){return`${vs.replaceMain(e,"czm_old_main")}
in vec4 pickColor;
out vec4 czm_pickColor;
void main()
{
czm_old_main();
czm_pickColor = pickColor;
}`};vs.createPickFragmentShaderSource=function(e,t){let n=vs.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 TOe(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 Wae(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 jae(e,t){let n=t.length;for(let i=0;i<n;++i){let o=t[i];if(Wae(e,o))return o}}var SOe=["v_normalEC","v_normal"];vs.findNormalVarying=function(e){return Wae(e,"#ifdef HAS_NORMALS")?TOe(e,"HAS_NORMALS")?"v_normalEC":void 0:jae(e,SOe)};var wOe=["v_positionEC"];vs.findPositionVarying=function(e){return jae(e,wOe)};var We=vs;function Dh(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(Dh.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});Dh.prototype.replaceShaderProgram=function(e){return l(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function BOe(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}Dh.prototype.getShaderProgram=function(e){let t=e.vertexShaderSource,n=e.fragmentShaderSource,i=e.attributeLocations;typeof t=="string"&&(t=new We({sources:[t]})),typeof n=="string"&&(n=new We({sources:[n]}));let o=t.getCacheKey(),r=n.getCacheKey(),a=l(i)?BOe(i):"",s=`${o}:${r}:${a}`,c;if(l(this._shaders[s]))c=this._shaders[s],delete this._shadersToRelease[s];else{let u=this._context,f=t.createCombinedVertexShader(u),h=n.createCombinedFragmentShader(u),p=new $t({gl:u._gl,logShaderCompilation:u.logShaderCompilation,debugShaders:u.debugShaders,vertexShaderSource:t,vertexShaderText:f,fragmentShaderSource:n,fragmentShaderText:h,attributeLocations:i});c={cache:this,shaderProgram:p,keyword:s,derivedKeywords:[],count:0},p._cachedShader=c,this._shaders[s]=c,++this._numberOfShaders}return++c.count,c.shaderProgram};Dh.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=this._shaders[o];if(l(r)){s6(this,r);let a=i.derivedKeywords.indexOf(t);a>-1&&i.derivedKeywords.splice(a,1)}return this.createDerivedShaderProgram(e,t,n)};Dh.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,o=this._shaders[i];if(l(o))return o.shaderProgram};Dh.prototype.createDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=n.vertexShaderSource,a=n.fragmentShaderSource,s=n.attributeLocations;typeof r=="string"&&(r=new We({sources:[r]})),typeof a=="string"&&(a=new We({sources:[a]}));let c=this._context,u=r.createCombinedVertexShader(c),f=a.createCombinedFragmentShader(c),h=new $t({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:r,vertexShaderText:u,fragmentShaderSource:a,fragmentShaderText:f,attributeLocations:s}),p={cache:this,shaderProgram:h,keyword:o,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),h._cachedShader=p,this._shaders[o]=p,h};function s6(e,t){let n=t.derivedKeywords,i=n.length;for(let o=0;o<i;++o){let r=n[o]+t.keyword,a=e._shaders[r];s6(e,a)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}Dh.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];s6(this,n),--this._numberOfShaders}this._shadersToRelease={}};Dh.prototype.releaseShaderProgram=function(e){if(l(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};Dh.prototype.isDestroyed=function(){return!1};Dh.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return fe(this)};var tR=Dh;function vh(e){e=e??V.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=qe.RGBA,pixelDatatype:o=He.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:a=!1,sampler:s=new jt}=e,{width:c,height:u}=e;l(n)&&(l(c)||(c=n.videoWidth??n.naturalWidth??n.width),l(u)||(u=n.videoHeight??n.naturalHeight??n.height));let f=e.preMultiplyAlpha||i===qe.RGB||i===qe.LUMINANCE,h=qe.toInternalFormat(i,o,t),p=qe.isCompressedFormat(h),A=t._gl,m=p?qe.compressedTextureSizeInBytes(i,c,u):qe.textureSizeInBytes(i,o,c,u);this._id=e.id??Jn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=A.TEXTURE_2D,this._texture=A.createTexture(),this._internalFormat=h,this._pixelFormat=i,this._pixelDatatype=o,this._width=c,this._height=u,this._dimensions=new k(c,u),this._hasMipmap=!1,this._sizeInBytes=m,this._preMultiplyAlpha=f,this._flipY=r,this._initialized=!1,this._sampler=void 0,this._sampler=s,Xae(this,s),A.activeTexture(A.TEXTURE0),A.bindTexture(this._textureTarget,this._texture),l(n)?(a?A.pixelStorei(A.UNPACK_COLORSPACE_CONVERSION_WEBGL,A.NONE):A.pixelStorei(A.UNPACK_COLORSPACE_CONVERSION_WEBGL,A.BROWSER_DEFAULT_WEBGL),l(n.arrayBufferView)?qe.isCompressedFormat(h)?DOe(this,n):Yae(this,n):l(n.framebuffer)?POe(this,n):qae(this,n),this._initialized=!0):Kae(this),A.bindTexture(this._textureTarget,null)}function DOe(e,t){let i=e._context._gl,o=e._textureTarget,r=e._internalFormat,{width:a,height:s}=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,a,s,0,t.arrayBufferView),l(t.mipLevels)){let c=a,u=s;for(let f=0;f<t.mipLevels.length;++f)c=oV(c),u=oV(u),i.compressedTexImage2D(o,f+1,r,c,u,0,t.mipLevels[f])}}function Yae(e,t){let n=e._context,i=n._gl,o=e._textureTarget,r=e._internalFormat,{width:a,height:s,pixelFormat:c,pixelDatatype:u,flipY:f}=e,h=qe.alignmentInBytes(c,u,a);i.pixelStorei(i.UNPACK_ALIGNMENT,h),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let{arrayBufferView:p}=t;if(f&&(p=qe.flipY(p,c,u,a,s)),i.texImage2D(o,0,r,a,s,0,c,He.toWebGLConstant(u,n),p),l(t.mipLevels)){let A=a,m=s;for(let _=0;_<t.mipLevels.length;++_)A=oV(A),m=oV(m),i.texImage2D(o,_+1,r,A,m,0,c,He.toWebGLConstant(u,n),t.mipLevels[_])}}function vOe(e,t,n,i,o,r){let a=e._context,s=a._gl,{pixelFormat:c,pixelDatatype:u}=e,f=qe.alignmentInBytes(c,u,o);s.pixelStorei(s.UNPACK_ALIGNMENT,f),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),e.flipY&&(t=qe.flipY(t,c,u,o,r)),s.texSubImage2D(e._textureTarget,0,n,i,o,r,c,He.toWebGLConstant(u,a),t)}function POe(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 qae(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,He.toWebGLConstant(e.pixelDatatype,n),t)}function ROe(e,t,n,i){let o=e._context,r=o._gl;r.pixelStorei(r.UNPACK_ALIGNMENT,4),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.preMultiplyAlpha),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,e.flipY),r.texSubImage2D(e._textureTarget,0,n,i,e.pixelFormat,He.toWebGLConstant(e.pixelDatatype,o),t)}function oV(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function Kae(e){let t=e._context;t._gl.texImage2D(e._textureTarget,0,e._internalFormat,e._width,e._height,0,e._pixelFormat,He.toWebGLConstant(e._pixelDatatype,t),null)}vh.create=function(e){return new vh(e)};vh.fromFramebuffer=function(e){e=e??V.EMPTY_OBJECT;let t=e.context,{pixelFormat:n=qe.RGB,framebufferXOffset:i=0,framebufferYOffset:o=0,width:r=t.drawingBufferWidth,height:a=t.drawingBufferHeight,framebuffer:s}=e;return new vh({context:t,width:r,height:a,pixelFormat:n,source:{framebuffer:l(s)?s:t.defaultFramebuffer,xOffset:i,yOffset:o,width:r,height:a}})};Object.defineProperties(vh.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){Xae(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 Xae(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[Wt.NEAREST_MIPMAP_NEAREST,Wt.NEAREST_MIPMAP_LINEAR,Wt.LINEAR_MIPMAP_NEAREST,Wt.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,a=e._pixelFormat,s=e._pixelDatatype;(s===He.FLOAT&&!r.textureFloatLinear||s===He.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?Wt.NEAREST_MIPMAP_NEAREST:Wt.NEAREST,i=ci.NEAREST),r.webgl2&&qe.isDepthFormat(a)&&(n=Wt.NEAREST,i=ci.NEAREST);let c=r._gl,u=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(u,e._texture),c.texParameteri(u,c.TEXTURE_MIN_FILTER,n),c.texParameteri(u,c.TEXTURE_MAG_FILTER,i),c.texParameteri(u,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(u,c.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&c.texParameteri(u,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(u,null)}vh.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e,a=this._context._gl,s=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(s,this._texture);let{width:c,height:u}=i;l(i.videoWidth)&&l(i.videoHeight)?(c=i.videoWidth,u=i.videoHeight):l(i.naturalWidth)&&l(i.naturalHeight)&&(c=i.naturalWidth,u=i.naturalHeight),o?a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.NONE):a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.BROWSER_DEFAULT_WEBGL);let f=!1;this._initialized||(t===0&&n===0&&c===this._width&&u===this._height?(l(i.arrayBufferView)?Yae(this,i):qae(this,i),f=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),Kae(this)),this._initialized=!0),f||(l(i.arrayBufferView)?vOe(this,i.arrayBufferView,t,n,c,u):ROe(this,i,t,n)),a.bindTexture(s,null)};vh.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){e=e??0,t=t??0,n=n??0,i=i??0,o=o??this._width,r=r??this._height;let a=this._context._gl,s=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(s,this._texture),a.copyTexSubImage2D(s,0,e,t,n,i,o,r),a.bindTexture(s,null),this._initialized=!0};vh.prototype.generateMipmap=function(e){e=e??hd.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)};vh.prototype.isDestroyed=function(){return!1};vh.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),fe(this)};var Dt=vh;function PE(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(PE.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});PE.prototype.getTexture=function(e){let t=this._textures[e];if(l(t))return delete this._texturesToRelease[e],++t.count,t.texture};PE.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};PE.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={}};PE.prototype.isDestroyed=function(){return!1};PE.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return fe(this)};var nR=PE;function md(e){this.planes=e??[]}var iR=[new d,new d,new d];d.clone(d.UNIT_X,iR[0]);d.clone(d.UNIT_Y,iR[1]);d.clone(d.UNIT_Z,iR[2]);var ty=new d,MOe=new d,Jae=new cn(new d(1,0,0),0);md.fromBoundingSphere=function(e,t){l(t)||(t=new md);let n=iR.length,i=t.planes;i.length=2*n;let o=e.center,r=e.radius,a=0;for(let s=0;s<n;++s){let c=iR[s],u=i[a],f=i[a+1];l(u)||(u=i[a]=new ie),l(f)||(f=i[a+1]=new ie),d.multiplyByScalar(c,-r,ty),d.add(o,ty,ty),u.x=c.x,u.y=c.y,u.z=c.z,u.w=-d.dot(c,ty),d.multiplyByScalar(c,r,ty),d.add(o,ty,ty),f.x=-c.x,f.y=-c.y,f.z=-c.z,f.w=-d.dot(d.negate(c,MOe),ty),a+=2}return t};md.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],Jae));if(r===Xt.OUTSIDE)return Xt.OUTSIDE;r===Xt.INTERSECTING&&(n=!0)}return n?Xt.INTERSECTING:Xt.INSIDE};md.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===md.MASK_OUTSIDE||t===md.MASK_INSIDE)return t;let n=md.MASK_INSIDE,i=this.planes;for(let o=0,r=i.length;o<r;++o){let a=o<31?1<<o:0;if(o<31&&(t&a)===0)continue;let s=e.intersectPlane(cn.fromCartesian4(i[o],Jae));if(s===Xt.OUTSIDE)return md.MASK_OUTSIDE;s===Xt.INTERSECTING&&(n|=a)}return n};md.MASK_OUTSIDE=4294967295;md.MASK_INSIDE=0;md.MASK_INDETERMINATE=2147483647;var Ka=md;function cp(e){e=e??V.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=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this._cullingVolume=new Ka,this._orthographicMatrix=new M}function Zae(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=M.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}Object.defineProperties(cp.prototype,{projectionMatrix:{get:function(){return Zae(this),this._orthographicMatrix}}});var NOe=new d,LOe=new d,OOe=new d,c6=new d;cp.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,o=this.top,r=this.bottom,a=this.right,s=this.left,c=this.near,u=this.far,f=d.cross(t,n,NOe);d.normalize(f,f);let h=LOe;d.multiplyByScalar(t,c,h),d.add(e,h,h);let p=OOe;d.multiplyByScalar(f,s,p),d.add(h,p,p);let A=i[0];return l(A)||(A=i[0]=new ie),A.x=f.x,A.y=f.y,A.z=f.z,A.w=-d.dot(f,p),d.multiplyByScalar(f,a,p),d.add(h,p,p),A=i[1],l(A)||(A=i[1]=new ie),A.x=-f.x,A.y=-f.y,A.z=-f.z,A.w=-d.dot(d.negate(f,c6),p),d.multiplyByScalar(n,r,p),d.add(h,p,p),A=i[2],l(A)||(A=i[2]=new ie),A.x=n.x,A.y=n.y,A.z=n.z,A.w=-d.dot(n,p),d.multiplyByScalar(n,o,p),d.add(h,p,p),A=i[3],l(A)||(A=i[3]=new ie),A.x=-n.x,A.y=-n.y,A.z=-n.z,A.w=-d.dot(d.negate(n,c6),p),A=i[4],l(A)||(A=i[4]=new ie),A.x=t.x,A.y=t.y,A.z=t.z,A.w=-d.dot(t,h),d.multiplyByScalar(t,u,p),d.add(e,p,p),A=i[5],l(A)||(A=i[5]=new ie),A.x=-t.x,A.y=-t.y,A.z=-t.z,A.w=-d.dot(d.negate(t,c6),p),this._cullingVolume};cp.prototype.getPixelDimensions=function(e,t,n,i,o){Zae(this);let r=this.right-this.left,a=this.top-this.bottom,s=i*r/e,c=i*a/t;return o.x=s,o.y=c,o};cp.prototype.clone=function(e){return l(e)||(e=new cp),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};cp.prototype.equals=function(e){return l(e)&&e instanceof cp&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};cp.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof cp&&D.equalsEpsilon(this.right,e.right,t,n)&&D.equalsEpsilon(this.left,e.left,t,n)&&D.equalsEpsilon(this.top,e.top,t,n)&&D.equalsEpsilon(this.bottom,e.bottom,t,n)&&D.equalsEpsilon(this.near,e.near,t,n)&&D.equalsEpsilon(this.far,e.far,t,n)};var ua=cp;function yu(e){e=e??V.EMPTY_OBJECT,this._offCenterFrustum=new ua,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far}yu.packedLength=4;yu.pack=function(e,t,n){return n=n??0,t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};yu.unpack=function(e,t,n){return t=t??0,l(n)||(n=new yu),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function ny(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(yu.prototype,{projectionMatrix:{get:function(){return ny(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return ny(this),this._offCenterFrustum}}});yu.prototype.computeCullingVolume=function(e,t,n){return ny(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};yu.prototype.getPixelDimensions=function(e,t,n,i,o){return ny(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};yu.prototype.clone=function(e){return l(e)||(e=new yu),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};yu.prototype.equals=function(e){return!l(e)||!(e instanceof yu)?!1:(ny(this),ny(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};yu.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof yu)?!1:(ny(this),ny(e),D.equalsEpsilon(this.width,e.width,t,n)&&D.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var An=yu;var l6={};function FOe(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var QOe=32.184,kOe=2451545;function gse(e,t){t=X.addSeconds(e,QOe,t);let n=X.totalDays(t)-kOe;return t=X.addSeconds(t,FOe(n),t),t}var rV=new X(2451545,0,si.TAI),UOe=1e3,pd=D.RADIANS_PER_DEGREE,cf=D.RADIANS_PER_ARCSECOND,xc=14959787e4,$ae=new J;function _se(e,t,n,i,o,r,a){n<0&&(n=-n,o+=D.PI);let s=e*(1-t),c=i-o,u=o,f=GOe(r-i,t),h=zOe(t,0);YOe(c,n,u,$ae);let p=s*(1+t),A=Math.cos(f),m=Math.sin(f),_=1+t*A,y=p/_;return l(a)?(a.x=y*A,a.y=y*m,a.z=0):a=new d(y*A,y*m,0),J.multiplyByVector($ae,a,a)}function zOe(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function GOe(e,t){let n=WOe(e,t);return jOe(n,t)}var VOe=50,HOe=D.EPSILON8;function WOe(e,t){let n=Math.floor(e/D.TWO_PI);e-=n*D.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<VOe&&Math.abs(o-i)>HOe;++r){o=i;let a=o-t*Math.sin(o)-e,s=1-t*Math.cos(o);i=o-a/s}return o=i+n*D.TWO_PI,o}function jOe(e,t){let n=Math.floor(e/D.TWO_PI);e-=n*D.TWO_PI;let i=Math.cos(e)-t,o=Math.sin(e)*Math.sqrt(1-t*t),r=Math.atan2(o,i);return r=D.zeroToTwoPi(r),e<0&&(r-=D.TWO_PI),r+=n*D.TWO_PI,r}function YOe(e,t,n,i){let o=Math.cos(e),r=Math.sin(e),a=Math.cos(t),s=Math.sin(t),c=Math.cos(n),u=Math.sin(n);return l(i)?(i[0]=c*o-u*r*a,i[1]=u*o+c*r*a,i[2]=r*s,i[3]=-c*r-u*o*a,i[4]=-u*r+c*o*a,i[5]=o*s,i[6]=u*s,i[7]=-c*s,i[8]=a):i=new J(c*o-u*r*a,-c*r-u*o*a,u*s,u*o+c*r*a,-u*r+c*o*a,-c*s,r*s,o*s,a),i}var qOe=1.0000010178*xc,KOe=100.46645683*pd,XOe=129597742283429e-5*cf,ese=16002,tse=21863,nse=32004,ise=10931,ose=14529,rse=16368,ase=15318,sse=32794,JOe=64*1e-7*xc,ZOe=-152*1e-7*xc,$Oe=62*1e-7*xc,e1e=-8*1e-7*xc,t1e=32*1e-7*xc,n1e=-41*1e-7*xc,i1e=19*1e-7*xc,o1e=-11*1e-7*xc,r1e=-150*1e-7*xc,a1e=-46*1e-7*xc,s1e=68*1e-7*xc,c1e=54*1e-7*xc,l1e=14*1e-7*xc,u1e=24*1e-7*xc,f1e=-28*1e-7*xc,d1e=22*1e-7*xc,cse=10,lse=16002,use=21863,fse=10931,dse=1473,hse=32004,mse=4387,pse=73,h1e=-325*1e-7,m1e=-322*1e-7,p1e=-79*1e-7,A1e=232*1e-7,g1e=-52*1e-7,_1e=97*1e-7,y1e=55*1e-7,C1e=-41*1e-7,E1e=-105*1e-7,b1e=-137*1e-7,I1e=258*1e-7,x1e=35*1e-7,T1e=-116*1e-7,S1e=-88*1e-7,w1e=-112*1e-7,B1e=-80*1e-7,wx=new X(0,0,si.TAI);function D1e(e,t){gse(e,wx);let i=(wx.dayNumber-rV.dayNumber+(wx.secondsOfDay-rV.secondsOfDay)/li.SECONDS_PER_DAY)/(li.DAYS_PER_JULIAN_CENTURY*10),o=.3595362*i,r=qOe+JOe*Math.cos(ese*o)+r1e*Math.sin(ese*o)+ZOe*Math.cos(tse*o)+a1e*Math.sin(tse*o)+$Oe*Math.cos(nse*o)+s1e*Math.sin(nse*o)+e1e*Math.cos(ise*o)+c1e*Math.sin(ise*o)+t1e*Math.cos(ose*o)+l1e*Math.sin(ose*o)+n1e*Math.cos(rse*o)+u1e*Math.sin(rse*o)+i1e*Math.cos(ase*o)+f1e*Math.sin(ase*o)+o1e*Math.cos(sse*o)+d1e*Math.sin(sse*o),a=KOe+XOe*i+h1e*Math.cos(cse*o)+E1e*Math.sin(cse*o)+m1e*Math.cos(lse*o)+b1e*Math.sin(lse*o)+p1e*Math.cos(use*o)+I1e*Math.sin(use*o)+A1e*Math.cos(fse*o)+x1e*Math.sin(fse*o)+g1e*Math.cos(dse*o)+T1e*Math.sin(dse*o)+_1e*Math.cos(hse*o)+S1e*Math.sin(hse*o)+y1e*Math.cos(mse*o)+w1e*Math.sin(mse*o)+C1e*Math.cos(pse*o)+B1e*Math.sin(pse*o),s=.0167086342-.0004203654*i,c=102.93734808*pd+11612.3529*cf*i,u=469.97289*cf*i,f=174.87317577*pd-8679.27034*cf*i;return _se(r,s,u,c,f,a,t)}function yse(e,t){gse(e,wx);let i=(wx.dayNumber-rV.dayNumber+(wx.secondsOfDay-rV.secondsOfDay)/li.SECONDS_PER_DAY)/li.DAYS_PER_JULIAN_CENTURY,o=i*i,r=o*i,a=r*i,s=383397.7725+.004*i,c=.055545526-16e-9*i,u=5.15668983*pd,f=-8e-5*i+.02966*o-42e-6*r-13e-8*a,h=83.35324312*pd,p=146434202669e-4*i-38.2702*o-.045047*r+21301e-8*a,A=125.04455501*pd,m=-69679193631e-4*i+6.3602*o+.007625*r-3586e-8*a,_=218.31664563*pd,y=17325593434847e-4*i-6.391*o+.006588*r-3169e-8*a,C=297.85019547*pd+cf*(1602961601209e-3*i-6.3706*o+.006593*r-3169e-8*a),E=93.27209062*pd+cf*(17395272628478e-4*i-12.7512*o-.001037*r+417e-8*a),b=134.96340251*pd+cf*(17179159232178e-4*i+31.8792*o+.051635*r-2447e-7*a),x=357.52910918*pd+cf*(1295965810481e-4*i-.5532*o+136e-6*r-1149e-8*a),S=310.17137918*pd-cf*(6967051436e-3*i+6.2068*o+.007618*r-3219e-8*a),B=2*C,v=4*C,P=6*C,N=2*b,L=3*b,g=4*b,I=2*E;s+=3400.4*Math.cos(B)-635.6*Math.cos(B-b)-235.6*Math.cos(b)+218.1*Math.cos(B-x)+181*Math.cos(B+b),c+=.014216*Math.cos(B-b)+.008551*Math.cos(B-N)-.001383*Math.cos(b)+.001356*Math.cos(B+b)-.001147*Math.cos(v-L)-914e-6*Math.cos(v-N)+869e-6*Math.cos(B-x-b)-627e-6*Math.cos(B)-394e-6*Math.cos(v-g)+282e-6*Math.cos(B-x-N)-279e-6*Math.cos(C-b)-236e-6*Math.cos(N)+231e-6*Math.cos(v)+229e-6*Math.cos(P-g)-201e-6*Math.cos(N-I),f+=486.26*Math.cos(B-I)-40.13*Math.cos(B)+37.51*Math.cos(I)+25.73*Math.cos(N-I)+19.97*Math.cos(B-x-I),p+=-55609*Math.sin(B-b)-34711*Math.sin(B-N)-9792*Math.sin(b)+9385*Math.sin(v-L)+7505*Math.sin(v-N)+5318*Math.sin(B+b)+3484*Math.sin(v-g)-3417*Math.sin(B-x-b)-2530*Math.sin(P-g)-2376*Math.sin(B)-2075*Math.sin(B-L)-1883*Math.sin(N)-1736*Math.sin(P-5*b)+1626*Math.sin(x)-1370*Math.sin(P-L),m+=-5392*Math.sin(B-I)-540*Math.sin(x)-441*Math.sin(B)+423*Math.sin(I)-288*Math.sin(N-I),y+=-3332.9*Math.sin(B)+1197.4*Math.sin(B-b)-662.5*Math.sin(x)+396.3*Math.sin(b)-218*Math.sin(B-x);let T=2*S,w=3*S;f+=46.997*Math.cos(S)*i-.614*Math.cos(B-I+S)*i+.614*Math.cos(B-I-S)*i-.0297*Math.cos(T)*o-.0335*Math.cos(S)*o+.0012*Math.cos(B-I+T)*o-16e-5*Math.cos(S)*r+4e-5*Math.cos(w)*r+4e-5*Math.cos(T)*r;let R=2.116*Math.sin(S)*i-.111*Math.sin(B-I-S)*i-.0015*Math.sin(S)*o;p+=R,y+=R,m+=-520.77*Math.sin(S)*i+13.66*Math.sin(B-I+S)*i+1.12*Math.sin(B-S)*i-1.06*Math.sin(I-S)*i+.66*Math.sin(T)*o+.371*Math.sin(S)*o-.035*Math.sin(B-I+T)*o-.015*Math.sin(B-I+S)*o+.0014*Math.sin(S)*r-.0011*Math.sin(w)*r-9e-4*Math.sin(T)*r,s*=UOe;let O=u+f*cf,G=h+p*cf,F=_+y*cf,U=A+m*cf;return _se(s,c,O,G,U,F,t)}var Ase=.012300034,v1e=Ase/(Ase+1)*-1;function P1e(e,t){return t=yse(e,t),d.multiplyByScalar(t,v1e,t)}var Cse=new J(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),oR=new d;l6.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=X.now()),l(t)||(t=new d),oR=D1e(e,oR),t=d.negate(oR,t),P1e(e,oR),d.subtract(t,oR,t),J.multiplyByVector(Cse,t,t),t};l6.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=X.now()),t=yse(e,t),J.multiplyByVector(Cse,t,t),t};var iy=l6;var aV={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};aV.getMorphTime=function(e){return e===aV.SCENE3D?1:e===aV.MORPHING?void 0:0};var oe=Object.freeze(aV);function R1e(e){e=e??V.EMPTY_OBJECT,this.color=z.clone(e.color??z.WHITE),this.intensity=e.intensity??2}var NA=R1e;function Bx(){this.globeDepthTexture=void 0,this.edgeIdTexture=void 0,this.edgeColorTexture=void 0,this.edgeDepthTexture=void 0,this.gamma=void 0,this._viewport=new et,this._viewportCartesian4=new ie,this._viewportDirty=!1,this._viewportOrthographicMatrix=M.clone(M.IDENTITY),this._viewportTransformation=M.clone(M.IDENTITY),this._model=M.clone(M.IDENTITY),this._view=M.clone(M.IDENTITY),this._inverseView=M.clone(M.IDENTITY),this._projection=M.clone(M.IDENTITY),this._infiniteProjection=M.clone(M.IDENTITY),this._entireFrustum=new k,this._currentFrustum=new k,this._frustumPlanes=new ie,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=J.clone(M.IDENTITY),this._view3DDirty=!0,this._view3D=new M,this._inverseView3DDirty=!0,this._inverseView3D=new M,this._inverseModelDirty=!0,this._inverseModel=new M,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new J,this._viewRotation=new J,this._inverseViewRotation=new J,this._viewRotation3D=new J,this._inverseViewRotation3D=new J,this._inverseProjectionDirty=!0,this._inverseProjection=new M,this._modelViewDirty=!0,this._modelView=new M,this._modelView3DDirty=!0,this._modelView3D=new M,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new M,this._inverseModelViewDirty=!0,this._inverseModelView=new M,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new M,this._viewProjectionDirty=!0,this._viewProjection=new M,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new M,this._modelViewProjectionDirty=!0,this._modelViewProjection=new M,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new M,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new M,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new M,this._normalDirty=!0,this._normal=new J,this._normal3DDirty=!0,this._normal3D=new J,this._inverseNormalDirty=!0,this._inverseNormal=new J,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new J,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new xn,this._cameraPosition=new d,this._sunPositionWC=new d,this._sunPositionColumbusView=new d,this._sunDirectionWC=new d,this._sunDirectionEC=new d,this._moonDirectionEC=new d,this._lightDirectionWC=new d,this._lightDirectionEC=new d,this._lightColor=new d,this._lightColorHdr=new d,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new d,this._cameraRight=new d,this._cameraUp=new d,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new k,this._eyeEllipsoidNormalEC=new d,this._eyeEllipsoidCurvature=new k,this._modelToEnu=new M,this._enuToModel=new M,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new z,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._fogVisualDensityScalar=void 0,this._fogMinimumBrightness=void 0,this._atmosphereHsbShift=void 0,this._atmosphereLightIntensity=void 0,this._atmosphereRayleighCoefficient=new d,this._atmosphereRayleighScaleHeight=new d,this._atmosphereMieCoefficient=new d,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(Bx.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!et.equals(e,this._viewport)){et.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 bse(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return bse(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){M.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,M.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,M.getMatrix3(this.inverseModel,e),J.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return f6(this),this._view3D}},viewRotation:{get:function(){return f6(this),this._viewRotation}},viewRotation3D:{get:function(){return f6(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return Tse(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return Tse(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return V1e(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return H1e(this),this._modelView}},modelView3D:{get:function(){return W1e(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return J1e(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return j1e(this),this._inverseModelView}},inverseModelView3D:{get:function(){return Y1e(this),this._inverseModelView3D}},viewProjection:{get:function(){return q1e(this),this._viewProjection}},inverseViewProjection:{get:function(){return K1e(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return X1e(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return Z1e(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return $1e(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return eFe(this),this._modelViewInfiniteProjection}},normal:{get:function(){return tFe(this),this._normal}},normal3D:{get:function(){return nFe(this),this._normal3D}},inverseNormal:{get:function(){return iFe(this),this._inverseNormal}},inverseNormal3D:{get:function(){return oFe(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 xse(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return xse(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},pixelRatio:{get:function(){return this._pixelRatio}},fogDensity:{get:function(){return this._fogDensity}},fogVisualDensityScalar:{get:function(){return this._fogVisualDensityScalar}},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 this._ellipsoid??te.default}}});function M1e(e,t){M.clone(t,e._view),M.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 N1e(e,t){M.clone(t,e._inverseView),M.getMatrix3(t,e._inverseViewRotation)}function L1e(e,t){M.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function O1e(e,t){M.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var Ese=new d,F1e=new M;function Q1e(e,t){d.clone(t.positionWC,e._cameraPosition),d.clone(t.directionWC,e._cameraDirection),d.clone(t.rightWC,e._cameraRight),d.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=d.fromRadians(o.longitude,o.latitude,0,n,Ese)):(e._eyeHeight=-n.maximumRadius,d.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=d.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,Ese)),e._encodedCameraPositionMCDirty=!0,!l(i))return;e._eyeEllipsoidNormalEC=J.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let r=At.eastNorthUpToFixedFrame(i,n,F1e);e._enuToModel=M.multiplyTransformation(e.inverseModel,r,e._enuToModel),e._modelToEnu=M.inverseTransformation(e._enuToModel,e._modelToEnu),D.equalsEpsilon(n._radii.x,n._radii.y,D.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var u6=new J,k1e=new me;function U1e(e,t){At.computeIcrfToCentralBodyFixedMatrix(t.time,u6);let n=iy.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);J.multiplyByVector(u6,n,n),d.normalize(n,e._sunDirectionWC),n=J.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),d.normalize(n,n),n=iy.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),J.multiplyByVector(u6,n,n),J.multiplyByVector(e.viewRotation3D,n,n),d.normalize(n,n);let i=t.mapProjection,r=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,k1e);i.project(r,e._sunPositionColumbusView)}Bx.prototype.updateCamera=function(e){M1e(this,e.viewMatrix),N1e(this,e.inverseViewMatrix),Q1e(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 An};Bx.prototype.updateFrustum=function(e){L1e(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&O1e(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=D.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};Bx.prototype.updatePass=function(e){this._pass=e};var z1e=[],G1e=new NA;Bx.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),U1e(this,e);let n=e.light??G1e;n instanceof NA?(this._lightDirectionWC=d.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=d.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=d.normalize(d.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=J.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let i=n.color,o=d.fromElements(i.red,i.green,i.blue,this._lightColorHdr);o=d.multiplyByScalar(o,n.intensity,o);let r=d.maximumComponent(o);r>1?d.divideByScalar(o,r,this._lightColor):d.clone(o,this._lightColor);let a=e.brdfLutGenerator,s=l(a)?a.colorTexture:void 0;this._brdfLut=s,this._environmentMap=e.environmentMap??e.context.defaultCubeMap,this._sphericalHarmonicCoefficients=e.sphericalHarmonicCoefficients??z1e,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,this._fogDensity=e.fog.density,this._fogVisualDensityScalar=e.fog.visualDensityScalar,this._fogMinimumBrightness=e.fog.minimumBrightness;let c=e.atmosphere;l(c)&&(this._atmosphereHsbShift=d.fromElements(c.hueShift,c.saturationShift,c.brightnessShift,this._atmosphereHsbShift),this._atmosphereLightIntensity=c.lightIntensity,this._atmosphereRayleighCoefficient=d.clone(c.rayleighCoefficient,this._atmosphereRayleighCoefficient),this._atmosphereRayleighScaleHeight=c.rayleighScaleHeight,this._atmosphereMieCoefficient=d.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=At.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let u=t.frustum.fov,f=this._viewport,h;l(u)?f.height>f.width?h=Math.tan(.5*u)*2/f.height:h=Math.tan(.5*u)*2/f.width:h=1/Math.max(f.width,f.height),this._geometricToleranceOverMeter=h*e.maximumScreenSpaceError,z.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function bse(e){if(e._viewportDirty){let t=e._viewport;M.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),M.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function V1e(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==oe.SCENE2D&&e._mode!==oe.MORPHING&&!e._orthographicIn3D?M.inverse(e._projection,e._inverseProjection):M.clone(M.ZERO,e._inverseProjection))}function H1e(e){e._modelViewDirty&&(e._modelViewDirty=!1,M.multiplyTransformation(e._view,e._model,e._modelView))}function W1e(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,M.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function j1e(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,M.inverse(e.modelView,e._inverseModelView))}function Y1e(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,M.inverse(e.modelView3D,e._inverseModelView3D))}function q1e(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,M.multiply(e._projection,e._view,e._viewProjection))}function K1e(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,M.inverse(e.viewProjection,e._inverseViewProjection))}function X1e(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,M.multiply(e._projection,e.modelView,e._modelViewProjection))}function J1e(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 Z1e(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,M.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function $1e(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,M.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function eFe(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,M.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function tFe(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;M.getMatrix3(e.inverseModelView,t),J.transpose(t,t)}}function nFe(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;M.getMatrix3(e.inverseModelView3D,t),J.transpose(t,t)}}function iFe(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;M.getMatrix3(e.modelView,t),J.transpose(t,t)}}function oFe(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;M.getMatrix3(e.modelView3D,t),J.transpose(t,t)}}var Ise=new d;function xse(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,M.multiplyByPoint(e.inverseModel,e._cameraPosition,Ise),xn.fromCartesian(Ise,e._encodedCameraPositionMC))}var rFe=new d,aFe=new d,sFe=new d,cFe=new d,lFe=new me,uFe=new d,fFe=new M;function dFe(e,t,n,i,o,r,a,s){let c=rFe;c.x=e.y,c.y=e.z,c.z=e.x;let u=aFe;u.x=n.y,u.y=n.z,u.z=n.x;let f=sFe;f.x=i.y,f.y=i.z,f.z=i.x;let h=cFe;h.x=t.y,h.y=t.z,h.z=t.x,r===oe.SCENE2D&&(c.z=o*.5);let p=a.unproject(c,lFe);p.longitude=D.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=D.clamp(p.latitude,-D.PI_OVER_TWO,D.PI_OVER_TWO);let A=a.ellipsoid,m=A.cartographicToCartesian(p,uFe),_=At.eastNorthUpToFixedFrame(m,A,fFe);return M.multiplyByPointAsVector(_,u,u),M.multiplyByPointAsVector(_,f,f),M.multiplyByPointAsVector(_,h,h),l(s)||(s=new M),s[0]=u.x,s[1]=f.x,s[2]=-h.x,s[3]=0,s[4]=u.y,s[5]=f.y,s[6]=-h.y,s[7]=0,s[8]=u.z,s[9]=f.z,s[10]=-h.z,s[11]=0,s[12]=-d.dot(u,m),s[13]=-d.dot(f,m),s[14]=d.dot(h,m),s[15]=1,s}function f6(e){e._view3DDirty&&(e._mode===oe.SCENE3D?M.clone(e._view,e._view3D):dFe(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),M.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function Tse(e){e._inverseView3DDirty&&(M.inverseTransformation(e.view3D,e._inverseView3D),M.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var rR=Bx;function Cu(e,t){let{getWebGLStub:n,requestWebgl1:i,webgl:o={},allowTextureFilterAnisotropic:r=!0}=t??{};o.alpha=o.alpha??!1,o.stencil=o.stencil??!0,o.powerPreference=o.powerPreference??"high-performance";let a=l(n)?n(e,o):hFe(e,o,i),c=typeof WebGL2RenderingContext<"u"&&a instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=a,this._gl=a,this._webgl2=c,this._id=Jn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new tR(this),this._textureCache=new nR;let u=a;this._stencilBits=u.getParameter(u.STENCIL_BITS),Rt._maximumCombinedTextureImageUnits=u.getParameter(u.MAX_COMBINED_TEXTURE_IMAGE_UNITS),Rt._maximumCubeMapSize=u.getParameter(u.MAX_CUBE_MAP_TEXTURE_SIZE),Rt._maximumFragmentUniformVectors=u.getParameter(u.MAX_FRAGMENT_UNIFORM_VECTORS),Rt._maximumTextureImageUnits=u.getParameter(u.MAX_TEXTURE_IMAGE_UNITS),Rt._maximumRenderbufferSize=u.getParameter(u.MAX_RENDERBUFFER_SIZE),Rt._maximumTextureSize=u.getParameter(u.MAX_TEXTURE_SIZE),Rt._maximum3DTextureSize=u.getParameter(u.MAX_3D_TEXTURE_SIZE),Rt._maximumVaryingVectors=u.getParameter(u.MAX_VARYING_VECTORS),Rt._maximumVertexAttributes=u.getParameter(u.MAX_VERTEX_ATTRIBS),Rt._maximumVertexTextureImageUnits=u.getParameter(u.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Rt._maximumVertexUniformVectors=u.getParameter(u.MAX_VERTEX_UNIFORM_VECTORS),Rt._maximumSamples=this._webgl2?u.getParameter(u.MAX_SAMPLES):0;let f=u.getParameter(u.ALIASED_LINE_WIDTH_RANGE);Rt._minimumAliasedLineWidth=f[0],Rt._maximumAliasedLineWidth=f[1];let h=u.getParameter(u.ALIASED_POINT_SIZE_RANGE);Rt._minimumAliasedPointSize=h[0],Rt._maximumAliasedPointSize=h[1];let p=u.getParameter(u.MAX_VIEWPORT_DIMS);Rt._maximumViewportWidth=p[0],Rt._maximumViewportHeight=p[1];let A=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_FLOAT);Rt._highpFloatSupported=A.precision!==0;let m=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_INT);Rt._highpIntSupported=m.rangeMax!==0,this._antialias=u.getContextAttributes().antialias,this._standardDerivatives=!!Xr(u,["OES_standard_derivatives"]),this._blendMinmax=!!Xr(u,["EXT_blend_minmax"]),this._elementIndexUint=!!Xr(u,["OES_element_index_uint"]),this._depthTexture=!!Xr(u,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!Xr(u,["EXT_frag_depth"]),this._debugShaders=Xr(u,["WEBGL_debug_shaders"]),this._textureFloat=!!Xr(u,["OES_texture_float"]),this._textureHalfFloat=!!Xr(u,["OES_texture_half_float"]),this._textureFloatLinear=!!Xr(u,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!Xr(u,["OES_texture_half_float_linear"]),this._supportsTextureLod=!!Xr(u,["EXT_shader_texture_lod"]),this._colorBufferFloat=!!Xr(u,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!Xr(u,["EXT_float_blend"]),this._colorBufferHalfFloat=!!Xr(u,["EXT_color_buffer_half_float"]),this._s3tc=!!Xr(u,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!Xr(u,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!Xr(u,["WEBGL_compressed_texture_astc"]),this._etc=!!Xr(u,["WEBG_compressed_texture_etc"]),this._etc1=!!Xr(u,["WEBGL_compressed_texture_etc1"]),this._bc7=!!Xr(u,["EXT_texture_compression_bptc"]),_u.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let _=r?Xr(u,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=_,Rt._maximumTextureFilterAnisotropy=l(_)?u.getParameter(_.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let y,C,E,b,x,S,B,v,P,N;if(c){let T=this;y=function(){return T._gl.createVertexArray()},C=function(w){T._gl.bindVertexArray(w)},E=function(w){T._gl.deleteVertexArray(w)},b=function(w,R,O,G,F){u.drawElementsInstanced(w,R,O,G,F)},x=function(w,R,O,G){u.drawArraysInstanced(w,R,O,G)},S=function(w,R){u.vertexAttribDivisor(w,R)},B=function(w){u.drawBuffers(w)}}else v=Xr(u,["OES_vertex_array_object"]),l(v)&&(y=function(){return v.createVertexArrayOES()},C=function(T){v.bindVertexArrayOES(T)},E=function(T){v.deleteVertexArrayOES(T)}),P=Xr(u,["ANGLE_instanced_arrays"]),l(P)&&(b=function(T,w,R,O,G){P.drawElementsInstancedANGLE(T,w,R,O,G)},x=function(T,w,R,O){P.drawArraysInstancedANGLE(T,w,R,O)},S=function(T,w){P.vertexAttribDivisorANGLE(T,w)}),N=Xr(u,["WEBGL_draw_buffers"]),l(N)&&(B=function(T){N.drawBuffersWEBGL(T)});this.glCreateVertexArray=y,this.glBindVertexArray=C,this.glDeleteVertexArray=E,this.glDrawElementsInstanced=b,this.glDrawArraysInstanced=x,this.glVertexAttribDivisor=S,this.glDrawBuffers=B,this._vertexArrayObject=!!v,this._instancedArrays=!!P,this._drawBuffers=!!N,Rt._maximumDrawBuffers=this.drawBuffers?u.getParameter(ee.MAX_DRAW_BUFFERS):1,Rt._maximumColorAttachments=this.drawBuffers?u.getParameter(ee.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new z(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let L=new rR,g=new Wc(this),I=Ve.fromCache();this._defaultPassState=g,this._defaultRenderState=I,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=L,this._currentRenderState=I,this._currentPassState=g,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let T=0;T<Rt._maximumVertexAttributes;T++)this._vertexAttribDivisors.push(0);this._pickObjects=new Map,this._nextPickColor=new Uint32Array(1),this.options={getWebGLStub:n,requestWebgl1:i,webgl:o,allowTextureFilterAnisotropic:r},this.cache={},Ve.apply(u,I,g)}function hFe(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 mFe(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 pFe(e,t,n,i){let o=`${mFe(e,i)}: ${t.name}(`;for(let r=0;r<n.length;++r)r!==0&&(o+=", "),o+=n[r];return o+=");",o}function AFe(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new ue(pFe(e,t,n,i))}function gFe(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 _Fe(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,gFe(e,o,t))}return i}function Xr(e,t){let n=t.length;for(let i=0;i<n;++i){let o=e.getExtension(t[i]);if(o)return o}}var yFe={};Object.defineProperties(Cu.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=_Fe(this._originalGLContext,e?AFe:void 0)}},defaultTexture:{get:function(){return this._defaultTexture===void 0&&(this._defaultTexture=new Dt({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 Dt({context:this,pixelFormat:qe.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 Dt({context:this,pixelFormat:qe.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 Kr({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 yFe}}});function Sse(e,t,n,i){let o=e._currentRenderState,r=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,Ve.partialApply(e._gl,o,t,r,n,i)}var d6;typeof WebGLRenderingContext<"u"&&(d6=[ee.BACK]);function sV(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=d6;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var CFe=new fi;Cu.prototype.clear=function(e,t){e=e??CFe,t=t??this._defaultPassState;let n=this._gl,i=0,o=e.color,r=e.depth,a=e.stencil;l(o)&&(z.equals(this._clearColor,o)||(z.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(a)&&(a!==this._clearStencil&&(this._clearStencil=a,n.clearStencil(a)),i|=n.STENCIL_BUFFER_BIT);let s=e.renderState??this._defaultRenderState;Sse(this,s,t,!0);let c=e.framebuffer??t.framebuffer;sV(this,c),n.clear(i)};function EFe(e,t,n,i,o){sV(e,t),Sse(e,o,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function bFe(e,t,n,i){let o=t._primitiveType,r=t._vertexArray,a=t._offset,s=t._count,c=t.instanceCount;e._us.model=t._modelMatrix??M.IDENTITY,n._setUniforms(i,e._us,e.validateShaderProgram),r._bind();let u=r.indexBuffer;l(u)?(a=a*u.bytesPerIndex,l(s)?s=Math.min(s,u.numberOfIndices):s=u.numberOfIndices,c===0?e._gl.drawElements(o,s,u.indexDatatype,a):e.glDrawElementsInstanced(o,s,u.indexDatatype,a,c)):(l(s)?s=Math.min(s,r.numberOfVertices):s=r.numberOfVertices,c===0?e._gl.drawArrays(o,a,s):e.glDrawArraysInstanced(o,a,s,c)),r._unBind()}Cu.prototype.draw=function(e,t,n,i){t=t??this._defaultPassState;let o=e._framebuffer??t.framebuffer,r=e._renderState??this._defaultRenderState;n=n??e._shaderProgram,i=i??e._uniformMap,EFe(this,o,t,n,r),bFe(this,e,n,i)};Cu.prototype.beginFrame=function(){};Cu.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=d6;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)};Cu.prototype.readPixelsToPBO=function(e){let t=this._gl;e=e??V.EMPTY_OBJECT;let n=Math.max(e.x??0,0),i=Math.max(e.y??0,0),o=e.width??this.drawingBufferWidth,r=e.height??this.drawingBufferHeight,a=e.framebuffer;if(!this._webgl2)throw new de("A WebGL 2 context is required to read pixels using a PBO.");let s=He.UNSIGNED_BYTE,c=qe.RGBA;l(a)&&a.numberOfColorAttachments>0&&(s=a.getColorTexture(0).pixelDatatype,c=a.getColorTexture(0).pixelFormat);let u=tt.createPixelBuffer({context:this,sizeInBytes:qe.textureSizeInBytes(c,s,o,r),usage:Re.DYNAMIC_READ});return sV(this,a),u._bind(),t.readPixels(n,i,o,r,c,He.toWebGLConstant(s,this),0),u._unBind(),u};Cu.prototype.readPixels=function(e){let t=this._gl;e=e??V.EMPTY_OBJECT;let n=Math.max(e.x??0,0),i=Math.max(e.y??0,0),o=e.width??this.drawingBufferWidth,r=e.height??this.drawingBufferHeight,a=e.framebuffer,s=He.UNSIGNED_BYTE,c=qe.RGBA;l(a)&&a.numberOfColorAttachments>0&&(s=a.getColorTexture(0).pixelDatatype,c=a.getColorTexture(0).pixelFormat);let u=qe.createTypedArray(c,s,o,r);return sV(this,a),t.readPixels(n,i,o,r,qe.RGBA,He.toWebGLConstant(s,this),u),u};var wse={position:0,textureCoordinates:1};Cu.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!l(e)){let t=new yt({attributes:{position:new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:ve.TRIANGLES});e=Gn.fromGeometry({context:this,geometry:t,attributeLocations:wse,bufferUsage:Re.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};Cu.prototype.createViewportQuadCommand=function(e,t){return t=t??V.EMPTY_OBJECT,new nt({vertexArray:this.getViewportQuadVertexArray(),primitiveType:ve.TRIANGLES,renderState:t.renderState,shaderProgram:$t.fromCache({context:this,vertexShaderSource:EE,fragmentShaderSource:e,attributeLocations:wse}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};Cu.prototype.getObjectByPickColor=function(e){return this._pickObjects.get(e)};Cu.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.set(t,e),new CD(this._pickObjects,t,z.fromRgba(t))};Cu.prototype.isDestroyed=function(){return!1};Cu.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(),fe(this)};var RE=Cu;function Dx(e){e=e??V.EMPTY_OBJECT;let{context:t,width:n,height:i,colorRenderbuffers:o,colorTextures:r,depthStencilRenderbuffer:a,depthStencilTexture:s,destroyAttachments:c}=e;if(this._width=n,this._height=i,l(o)!==l(r))throw new de("Both color renderbuffer and texture attachments must be provided.");if(l(a)!==l(s))throw new de("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new la({context:t,colorRenderbuffers:o,depthStencilRenderbuffer:a,destroyAttachments:c}),this._colorFramebuffer=new la({context:t,colorTextures:r,depthStencilTexture:s,destroyAttachments:c})}Dx.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};Dx.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};Dx.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)};Dx.prototype.isDestroyed=function(){return!1};Dx.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),fe(this)};var aR=Dx;var Eu={RGBA4:ee.RGBA4,RGBA8:ee.RGBA8,RGBA16F:ee.RGBA16F,RGBA32F:ee.RGBA32F,RGB5_A1:ee.RGB5_A1,RGB565:ee.RGB565,DEPTH_COMPONENT16:ee.DEPTH_COMPONENT16,STENCIL_INDEX8:ee.STENCIL_INDEX8,DEPTH_STENCIL:ee.DEPTH_STENCIL,DEPTH24_STENCIL8:ee.DEPTH24_STENCIL8,validate:function(e){return e===Eu.RGBA4||e===Eu.RGBA8||e===Eu.RGBA16F||e===Eu.RGBA32F||e===Eu.RGB5_A1||e===Eu.RGB565||e===Eu.DEPTH_COMPONENT16||e===Eu.STENCIL_INDEX8||e===Eu.DEPTH_STENCIL||e===Eu.DEPTH24_STENCIL8},getColorFormat:function(e){return e===ee.FLOAT?Eu.RGBA32F:e===ee.HALF_FLOAT_OES?Eu.RGBA16F:Eu.RGBA8}},wl=Object.freeze(Eu);function sR(e){e=e??V.EMPTY_OBJECT;let t=e.context,n=t._gl,i=Rt.maximumRenderbufferSize,o=e.format??wl.RGBA4,r=l(e.width)?e.width:t.drawingBufferWidth,a=l(e.height)?e.height:t.drawingBufferHeight,s=e.numSamples??1;this._gl=n,this._format=o,this._width=r,this._height=a,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),s>1?n.renderbufferStorageMultisample(n.RENDERBUFFER,s,o,r,a):n.renderbufferStorage(n.RENDERBUFFER,o,r,a),n.bindRenderbuffer(n.RENDERBUFFER,null)}Object.defineProperties(sR.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});sR.prototype._getRenderbuffer=function(){return this._renderbuffer};sR.prototype.isDestroyed=function(){return!1};sR.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),fe(this)};var lf=sR;function fs(e){e=e??V.EMPTY_OBJECT,this._numSamples=e.numSamples??1,this._colorAttachmentsLength=e.colorAttachmentsLength??1,this._color=e.color??!0,this._depth=e.depth??!1,this._depthStencil=e.depthStencil??!1,this._supportsDepthTexture=e.supportsDepthTexture??!1,this._createColorAttachments=e.createColorAttachments??!0,this._createDepthAttachments=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=n??1;let r=this._width!==e||this._height!==t,a=this._numSamples!==n,s=l(i)&&this._pixelDatatype!==i||l(o)&&this._pixelFormat!==o,c=n===1?l(this._framebuffer):l(this._multisampleFramebuffer);return this._attachmentsDirty||r||a||s||!c||this._color&&!l(this._colorTextures[0])};fs.prototype.update=function(e,t,n,i,o,r){if(i=e.msaa?i??1:1,o=o??(this._color?this._pixelDatatype??He.UNSIGNED_BYTE:void 0),r=r??(this._color?this._pixelFormat??qe.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 a=0;a<this._colorAttachmentsLength;++a)if(this._colorTextures[a]=new Dt({context:e,width:t,height:n,pixelFormat:r,pixelDatatype:o,sampler:jt.NEAREST}),this._numSamples>1){let s=wl.getColorFormat(o);this._colorRenderbuffers[a]=new lf({context:e,width:t,height:n,format:s,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new Dt({context:e,width:t,height:n,pixelFormat:qe.DEPTH_STENCIL,pixelDatatype:He.UNSIGNED_INT_24_8,sampler:jt.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new lf({context:e,width:t,height:n,format:wl.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new lf({context:e,width:t,height:n,format:wl.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new Dt({context:e,width:t,height:n,pixelFormat:qe.DEPTH_COMPONENT,pixelDatatype:He.UNSIGNED_INT,sampler:jt.NEAREST}):this._depthRenderbuffer=new lf({context:e,width:t,height:n,format:wl.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new aR({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 la({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=e??0,this._colorTextures[e]};fs.prototype.setColorTexture=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};fs.prototype.getColorRenderbuffer=function(e){return e=e??0,this._colorRenderbuffers[e]};fs.prototype.setColorRenderbuffer=function(e,t){t=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=this._colorTextures,t=this._colorRenderbuffers;for(let n=0;n<e.length;++n){let i=e[n];this._createColorAttachments&&l(i)&&!i.isDestroyed()&&i.destroy(),l(i)&&i.isDestroyed()&&(e[n]=void 0);let o=t[n];this._createColorAttachments&&l(o)&&!o.isDestroyed()&&o.destroy(),l(o)&&o.isDestroyed()&&(t[n]=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 Ei=fs;function IFe(e,t,n){let i={flipY:!0,skipColorSpaceConversion:n,preferImageBitmap:!0},o=[De.createIfNeeded(t.positiveX).fetchImage(i),De.createIfNeeded(t.negativeX).fetchImage(i),De.createIfNeeded(t.positiveY).fetchImage(i),De.createIfNeeded(t.negativeY).fetchImage(i),De.createIfNeeded(t.positiveZ).fetchImage(i),De.createIfNeeded(t.negativeZ).fetchImage(i)];return Promise.all(o).then(function(r){return new Kr({context:e,source:{positiveX:r[0],negativeX:r[1],positiveY:r[2],negativeY:r[3],positiveZ:r[4],negativeZ:r[5]}})})}var cR=IFe;var ME={NONE:0,VERTEX:1,FRAGMENT:2,BOTH:3};ME.includesVertexShader=function(e){return(e&ME.VERTEX)!==0};ME.includesFragmentShader=function(e){return(e&ME.FRAGMENT)!==0};ME.union=function(...e){let t=0;for(let n=0;n<e.length;n++)t|=e[n];return t};ME.intersection=function(...e){let t=e[0];for(let n=1;n<e.length;n++)t&=e[n];return t};var he=Object.freeze(ME);function h6(e){this.name=e,this.fields=[]}h6.prototype.addField=function(e,t){let n=` ${e} ${t};`;this.fields.push(n)};h6.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=[" float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var lR=h6;function m6(e){this.signature=e,this.body=[]}m6.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}`)};m6.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};var uR=m6;function xFe(e,t){if(!l(t))return;let n=t.length;if(n===0)return;let i=e.length;e.length+=n;for(let o=0;o<n;o++)e[i+o]=t[o]}var oi=xFe;function Bl(){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(Bl.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});Bl.prototype.addDefine=function(e,t,n){n=n??he.BOTH;let i=e;l(t)&&(i+=` ${t.toString()}`),he.includesVertexShader(n)&&this._vertexShaderParts.defineLines.push(i),he.includesFragmentShader(n)&&this._fragmentShaderParts.defineLines.push(i)};Bl.prototype.addStruct=function(e,t,n){this._structs[e]=new lR(t),he.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),he.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};Bl.prototype.addStructField=function(e,t,n){this._structs[e].addField(t,n)};Bl.prototype.addFunction=function(e,t,n){this._functions[e]=new uR(t),he.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),he.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};Bl.prototype.addFunctionLines=function(e,t){this._functions[e].addLines(t)};Bl.prototype.addUniform=function(e,t,n){n=n??he.BOTH;let i=`uniform ${e} ${t};`;he.includesVertexShader(n)&&this._vertexShaderParts.uniformLines.push(i),he.includesFragmentShader(n)&&this._fragmentShaderParts.uniformLines.push(i)};Bl.prototype.setPositionAttribute=function(e,t){return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0};Bl.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+=SFe(e),i};Bl.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}`)};Bl.prototype.addVertexLines=function(e){let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?oi(t,e):t.push(e)};Bl.prototype.addFragmentLines=function(e){let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?oi(t,e):t.push(e)};Bl.prototype.buildShaderProgram=function(e){let t=l(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=TFe(this),i=wFe(this),o=t.concat(this._attributeLines,this._vertexShaderParts.uniformLines,this._vertexShaderParts.varyingLines,n.vertexLines,i.vertexLines,this._vertexShaderParts.shaderLines).join(`
`),r=new We({defines:this._vertexShaderParts.defineLines,sources:[o]}),a=this._fragmentShaderParts.uniformLines.concat(this._fragmentShaderParts.varyingLines,n.fragmentLines,i.fragmentLines,this._fragmentShaderParts.shaderLines).join(`
`),s=new We({defines:this._fragmentShaderParts.defineLines,sources:[a]});return $t.fromCache({context:e,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:this._attributeLocations})};Bl.prototype.clone=function(){return je(this,!0)};function TFe(e){let t=[],n=[],i,o=e._vertexShaderParts.structIds,r,a,s;for(i=0;i<o.length;i++)r=o[i],a=e._structs[r],s=a.generateGlslLines(),oi(t,s);for(o=e._fragmentShaderParts.structIds,i=0;i<o.length;i++)r=o[i],a=e._structs[r],s=a.generateGlslLines(),oi(n,s);return{vertexLines:t,fragmentLines:n}}function SFe(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function wFe(e){let t=[],n=[],i,o=e._vertexShaderParts.functionIds,r,a,s;for(i=0;i<o.length;i++)r=o[i],a=e._functions[r],s=a.generateGlslLines(),oi(t,s);for(o=e._fragmentShaderParts.functionIds,i=0;i<o.length;i++)r=o[i],a=e._functions[r],s=a.generateGlslLines(),oi(n,s);return{vertexLines:t,fragmentLines:n}}var LA=Bl;function cV(e){this._autoDestroy=e?.autoDestroy??!0,this._canvas=document.createElement("canvas"),this._context=new RE(this._canvas,je(e?.contextOptions)),this._canvases=[]}cV.prototype.createSceneContext=function(e){let t=e.getContext("2d",{alpha:!0}),n=this;n._canvases.push(e);let i=!1,o=function(){i=!0;let c=n._canvases.indexOf(e);c!==-1&&(n._canvases.splice(c,1),n._autoDestroy&&n._canvases.length===0&&n.destroy())},r=function(){let c=n._context.canvas,u=this.drawingBufferWidth;c.width<u&&(c.width=u);let f=this.drawingBufferHeight;c.height<f&&(c.height=f)},a=function(){let c=this.drawingBufferWidth,u=this.drawingBufferHeight,f=n._context.canvas.height-u;t.drawImage(n._context.canvas,0,f,c,u,0,0,c,u),n._context.endFrame()};return new Proxy(this._context,{get(c,u,f){if(u==="isDestroyed")return function(){return i};switch(u){case"_canvas":return e;case"destroy":return o;case"drawingBufferWidth":return e.width;case"drawingBufferHeight":return e.height;case"beginFrame":return r;case"endFrame":return a;default:return Reflect.get(c,u,f)}}})};cV.prototype.destroy=function(){this._context.destroy(),fe(this)};cV.prototype.isDestroyed=function(){return!1};var fR=cV;function NE(e){e=e??V.EMPTY_OBJECT;let t=e.context;if(!t._webgl2)throw new de("A WebGL 2 context is required to use Sync operations.");let n=t._gl,i=n.fenceSync(ee.SYNC_GPU_COMMANDS_COMPLETE,0);this._gl=n,this._sync=i}NE.create=function(e){return new NE(e)};NE.prototype.getStatus=function(){return this._gl.getSyncParameter(this._sync,ee.SYNC_STATUS)};NE.prototype.isDestroyed=function(){return!1};NE.prototype.destroy=function(){return this._gl.deleteSync(this._sync),fe(this)};NE.prototype.waitForSignal=async function(e,t){let n=this;t=t??10;function i(o,r,a){return()=>{n.getStatus()===ee.SIGNALED?o():a<=0?r(new ue("Wait for signal timeout")):e(i(o,r,a-1))}}return new Promise((o,r)=>{e(i(o,r,t))})};var dR=NE;function oy(e){e=e??V.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=qe.RGBA,pixelDatatype:o=He.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:a=!1,sampler:s=new jt}=e;if(!t.webgl2&&!l(t.options.getWebGLStub))throw new de("WebGL1 does not support texture3D. Please use a WebGL2 context.");let{width:c,height:u,depth:f}=e;l(n)&&(l(c)||(c=n.width),l(u)||(u=n.height),l(f)||(f=n.depth));let h=e.preMultiplyAlpha||i===qe.RGB||i===qe.LUMINANCE,p=qe.toInternalFormat(i,o,t),A=qe.isCompressedFormat(p),m=t._gl,_=qe.texture3DSizeInBytes(i,o,c,u,f);if(this._id=e.id??Jn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=m.TEXTURE_3D,this._texture=m.createTexture(),this._internalFormat=p,this._pixelFormat=i,this._pixelDatatype=o,this._width=c,this._height=u,this._depth=f,this._dimensions=new d(c,u,f),this._hasMipmap=!1,this._sizeInBytes=_,this._preMultiplyAlpha=h,this._flipY=r,this._initialized=!1,this._sampler=void 0,this._sampler=s,vse(this,s),m.activeTexture(m.TEXTURE0),m.bindTexture(this._textureTarget,this._texture),l(n)){if(a?m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.NONE):m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.BROWSER_DEFAULT_WEBGL),!l(n.arrayBufferView))throw new de("For Texture3D, options.source.arrayBufferView must be defined");Bse(this,n),this._initialized=!0}else Dse(this);m.bindTexture(this._textureTarget,null)}function Bse(e,t){let n=e._context,i=n._gl,o=e._textureTarget,r=e._internalFormat,{width:a,height:s,depth:c,pixelFormat:u,pixelDatatype:f,flipY:h}=e,p=qe.alignmentInBytes(u,f,a);i.pixelStorei(i.UNPACK_ALIGNMENT,p),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let{arrayBufferView:A}=t;h&&console.warn("texture3D.flipY is not supported.");let m=1;if(t.mipLevels&&t.mipLevels.length&&(m=t.mipLevels.length+1),i.texStorage3D(o,m,r,a,s,c),i.texSubImage3D(o,0,0,0,0,a,s,c,u,He.toWebGLConstant(f,n),A),m>1){let _=a,y=s,C=c;for(let E=0;E<t.mipLevels.length;++E)_=p6(_),y=p6(y),C=p6(C),i.texSubImage3D(o,E+1,0,0,0,_,y,C,u,He.toWebGLConstant(f,n),t.mipLevels[E])}}oy.prototype.copyFrom=function(e){e=e??V.EMPTY_OBJECT;let{source:t,xOffset:n=0,yOffset:i=0,zOffset:o=0}=e,a=this._context._gl,s=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(s,this._texture);let{width:c,height:u,depth:f}=t,h=!1;this._initialized||(n===0&&i===0&&o===0&&c===this._width&&u===this._height&&f===this._depth?(Bse(this,t),h=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),Dse(this)),this._initialized=!0),h||BFe(this,t.arrayBufferView,n,i,o,c,u,f),a.bindTexture(s,null)};function BFe(e,t,n,i,o,r,a,s){let c=e._context,u=c._gl,{pixelFormat:f,pixelDatatype:h}=e,p=qe.alignmentInBytes(f,h,r);u.pixelStorei(u.UNPACK_ALIGNMENT,p),u.pixelStorei(u.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),u.pixelStorei(u.UNPACK_FLIP_Y_WEBGL,!1),u.texSubImage3D(e._textureTarget,0,n,i,o,r,a,s,f,He.toWebGLConstant(h,c),t)}function p6(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function Dse(e){let t=e._context;t._gl.texImage3D(e._textureTarget,0,e._internalFormat,e._width,e._height,e._depth,0,e._pixelFormat,He.toWebGLConstant(e._pixelDatatype,t),null)}oy.create=function(e){return new oy(e)};Object.defineProperties(oy.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){vse(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}},depth:{get:function(){return this._depth}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*8/7):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}});function vse(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[Wt.NEAREST_MIPMAP_NEAREST,Wt.NEAREST_MIPMAP_LINEAR,Wt.LINEAR_MIPMAP_NEAREST,Wt.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,a=e._pixelFormat,s=e._pixelDatatype;(s===He.FLOAT&&!r.textureFloatLinear||s===He.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?Wt.NEAREST_MIPMAP_NEAREST:Wt.NEAREST,i=ci.NEAREST),qe.isDepthFormat(a)&&(n=Wt.NEAREST,i=ci.NEAREST);let c=r._gl,u=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(u,e._texture),c.texParameteri(u,c.TEXTURE_MIN_FILTER,n),c.texParameteri(u,c.TEXTURE_MAG_FILTER,i),c.texParameteri(u,c.TEXTURE_WRAP_R,t.wrapR),c.texParameteri(u,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(u,c.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&c.texParameteri(u,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(u,null)}oy.prototype.generateMipmap=function(e){e=e??hd.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)};oy.prototype.isDestroyed=function(){return!1};oy.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),fe(this)};var hR=oy;function mR({x:e,y:t,width:n,height:i}){this.rectangle=new et(e,t,n,i),this.childNode1=void 0,this.childNode2=void 0,this.index=void 0}function A6({width:e,height:t,borderPadding:n}){this._width=e,this._height=t,this._borderPadding=n,this._root=new mR({x:n,y:n,width:e-2*n,height:t-2*n})}A6.prototype.pack=function(e,{width:t,height:n}){let i=this._findNode(this._root,{width:t,height:n});if(l(i))return i.index=e,i};A6.prototype._findNode=function(e,{width:t,height:n}){if(l(e)){if(!l(e.childNode1)&&!l(e.childNode2)){if(l(e.index))return;let{rectangle:i}=e,o=i.width,r=i.height,a=o-t,s=r-n;if(a<0||s<0)return;if(a===0&&s===0)return e;let c=this._borderPadding;if(a>s){e.childNode1=new mR({x:i.x,y:i.y,width:t,height:r});let f=a-c;return f>0&&(e.childNode2=new mR({x:i.x+t+c,y:i.y,width:f,height:r})),this._findNode(e.childNode1,{width:t,height:n})}e.childNode1=new mR({x:i.x,y:i.y,width:o,height:n});let u=s-c;return u>0&&(e.childNode2=new mR({x:i.x,y:i.y+n+c,width:o,height:u})),this._findNode(e.childNode1,{width:t,height:n})}return this._findNode(e.childNode1,{width:t,height:n})||this._findNode(e.childNode2,{width:t,height:n})}};var vx=A6;var Pse=16;function Dl(e){e=e??V.EMPTY_OBJECT;let t=e.borderWidthInPixels??1,n=e.initialSize??new k(Pse,Pse);this._pixelFormat=e.pixelFormat??qe.RGBA,this._sampler=e.sampler,this._borderWidthInPixels=t,this._initialSize=n,this._texturePacker=void 0,this._rectangles=[],this._subRegions=new Map,this._guid=Jn(),this._imagesToAddQueue=[],this._indexById=new Map,this._indexPromiseById=new Map,this._nextIndex=0}Object.defineProperties(Dl.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},rectangles:{get:function(){return this._rectangles}},texture:{get:function(){return this._texture}},pixelFormat:{get:function(){return this._pixelFormat}},sampler:{get:function(){return this._sampler}},numberOfImages:{get:function(){return this._nextIndex}},guid:{get:function(){return this._guid}},sizeInBytes:{get:function(){return l(this._texture)?this._texture.sizeInBytes:0}}});Dl.prototype.computeTextureCoordinates=function(e,t){let n=this._texture,i=this._rectangles[e];if(l(t)||(t=new et),!l(i))return t.x=0,t.y=0,t.width=0,t.height=0,t;let o=n.width,r=n.height,a=i.width,s=i.height,c=i.x,u=i.y,f=this._subRegions.get(e);if(l(f)){let h=this._rectangles[f];c+=h.x,u+=h.y}return t.x=c/o,t.y=u/r,t.width=a/o,t.height=s/r,t};Dl.prototype._copyFromTexture=function(e,t,n,i){let o=this._pixelFormat,r=this._sampler,a=new Dt({context:e,height:n,width:t,pixelFormat:o,sampler:r}),s=e._gl,c=a._textureTarget,u=this._texture,f=new la({context:e,colorTextures:[u],destroyAttachments:!1});s.activeTexture(s.TEXTURE0),s.bindTexture(c,a._texture),f._bind();let h=this.rectangles,p=this._subRegions;for(let A=0;A<h.length;++A){let m=i[A],_=h[A];if(!l(m)||!l(_)||l(p.get(A)))continue;let{x:y,y:C,width:E,height:b}=m;s.copyTexSubImage2D(c,0,y,C,_.x,_.y,E,b)}return s.bindTexture(c,null),a._initialized=!0,f._unBind(),f.destroy(),a};Dl.prototype._resize=function(e,t=0){let n=this._borderWidthInPixels,i=this._rectangles,o=this._imagesToAddQueue,r=this._texture,a=r.width,s=r.height,c=this._subRegions,u=i.map((y,C)=>new Rse({index:C,image:y})).filter((y,C)=>l(y.image)&&!l(c.get(C))),f=0,h=0,p=0;for(let y=t;y<o.length;++y){let{width:C,height:E}=o[y].image;f=Math.max(f,C),h=Math.max(h,E),p+=C*E,u.push(o[y])}for(a=D.nextPowerOfTwo(Math.max(f,a)),s=D.nextPowerOfTwo(Math.max(h,s));p>=a*s;)a>s?s*=2:a*=2;u.sort(({image:y},{image:C})=>C.height*C.width-y.height*y.width);let A=new Array(this._nextIndex);for(let y of this._subRegions.keys())l(c.get(y))&&(A[y]=i[y]);let m,_=!1;for(;!_;){m=new vx({height:s,width:a,borderPadding:n});let y;for(y=0;y<u.length;++y){let{index:C,image:E}=u[y];if(!l(E))continue;let b=m.pack(C,E);if(!l(b)){a>s?s*=2:a*=2;break}A[C]=b.rectangle}_=y===u.length}this._texturePacker=m,this._texture=this._copyFromTexture(e,a,s,A),r.destroy(),this._rectangles=A,this._guid=Jn()};Dl.prototype.getImageIndex=function(e){return this._indexById.get(e)};Dl.prototype._copyImageToTexture=function({index:e,image:t,resolve:n,reject:i}){let o=this._texture,r=this._rectangles[e];try{o.copyFrom({source:t,xOffset:r.x,yOffset:r.y}),l(n)&&n(e)}catch(a){if(l(i)){i(a);return}}};function Rse({index:e,image:t,resolve:n,reject:i}){this.index=e,this.image=t,this.resolve=n,this.reject=i,this.rectangle=void 0}Dl.prototype._addImage=function(e,t){return new Promise((n,i)=>{this._imagesToAddQueue.push(new Rse({index:e,image:t,resolve:n,reject:i})),this._imagesToAddQueue.sort(({image:o},{image:r})=>r.height*r.width-o.height*o.width)})};Dl.prototype._processImageQueue=function(e){let t=this._imagesToAddQueue;if(t.length===0)return!1;this._rectangles.length=this._nextIndex;let n,i;for(n=0;n<t.length;++n){let o=t[n],{image:r,index:a}=o,s=this._texturePacker.pack(a,r);if(!l(s)){try{this._resize(e,n)}catch(c){i=c,l(o.reject)&&o.reject(i)}break}this._rectangles[a]=s.rectangle}if(l(i)){for(n=n+1;n<t.length;++n){let{resolve:o}=t[n];l(o)&&o(-1)}return t.length=0,!1}for(let o=0;o<t.length;++o)this._copyImageToTexture(t[o]);return t.length=0,!0};Dl.prototype.update=function(e){if(!l(this._texture)){let t=this._initialSize.x,n=this._initialSize.y,i=this._pixelFormat,o=this._sampler,r=this._borderWidthInPixels;this._texture=new Dt({context:e,width:t,height:n,pixelFormat:i,sampler:o}),this._texturePacker=new vx({height:n,width:t,borderPadding:r})}return this._processImageQueue(e)};async function DFe(e,t){return typeof e=="function"&&(e=e(t)),(typeof e=="string"||e instanceof De)&&(e=De.createIfNeeded(e).fetchImage()),e}Dl.prototype.addImage=function(e,t,n,i){let o=this._indexPromiseById.get(e),r=this._indexById.get(e);return l(o)?o:l(r)?r:(r=this._nextIndex++,this._indexById.set(e,r),o=(async()=>{let s=await DFe(t,e);if(this.isDestroyed()||!l(s))return this._indexPromiseById.delete(e),-1;l(n)&&(s.width=n),l(i)&&(s.height=i);let c=await this._addImage(r,s);return this._indexPromiseById.delete(e),c})(),this._indexPromiseById.set(e,o),o)};Dl.prototype.getCachedImageSubRegion=function(e,t,n){let i=this._indexPromiseById.get(e);for(let[o,r]of this._subRegions.entries())if(n===r&&this._rectangles[o].equals(t))return i?i.then(s=>s===-1?-1:o):o};Dl.prototype.addImageSubRegion=function(e,t){let n=this._indexById.get(e);if(!l(n))throw new ue(`image with id "${e}" not found in the atlas.`);let i=this.getCachedImageSubRegion(e,t,n);return l(i)?i:(i=this._nextIndex++,this._subRegions.set(i,n),this._rectangles[i]=t.clone(),(this._indexPromiseById.get(e)??Promise.resolve(n)).then(r=>{if(r===-1)return-1;let a=this._rectangles[r];return i}))};Dl.prototype.isDestroyed=function(){return!1};Dl.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),this._imagesToAddQueue.forEach(({resolve:e})=>{l(e)&&e(-1)}),fe(this)};var LE=Dl;function Ps(e,t,n,i){let o=Ps._verifyAttributes(t);n=n??0;let r=[],a={},s,c,u=o.length;for(let h=0;h<u;++h){let p=o[h];if(p.vertexBuffer){r.push(p);continue}c=p.usage,s=a[c],l(s)||(s=a[c]=[]),s.push(p)}function f(h,p){return j.getSizeInBytes(p.componentDatatype)-j.getSizeInBytes(h.componentDatatype)}this._allBuffers=[];for(c in a)if(a.hasOwnProperty(c)){s=a[c],s.sort(f);let h=Ps._vertexSizeInBytes(s),p=s[0].usage,A={vertexSizeInBytes:h,vertexBuffer:void 0,usage:p,needsCommit:!1,arrayBuffer:void 0,arrayViews:Ps._createArrayViews(s,h)};this._allBuffers.push(A)}this._size=0,this._instanced=i??!1,this._precreated=r,this._context=e,this.writers=void 0,this.va=void 0,this.resize(n)}Ps._verifyAttributes=function(e){let t=[];for(let i=0;i<e.length;++i){let o=e[i],r={index:o.index??i,enabled:o.enabled??!0,componentsPerAttribute:o.componentsPerAttribute,componentDatatype:o.componentDatatype??j.FLOAT,normalize:o.normalize??!1,vertexBuffer:o.vertexBuffer,usage:o.usage??Re.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};Ps._vertexSizeInBytes=function(e){let t=0,n=e.length;for(let a=0;a<n;++a){let s=e[a];t+=s.componentsPerAttribute*j.getSizeInBytes(s.componentDatatype)}let i=n>0?j.getSizeInBytes(e[0].componentDatatype):0,o=i>0?t%i:0,r=o===0?0:i-o;return t+=r,t};Ps._createArrayViews=function(e,t){let n=[],i=0,o=e.length;for(let r=0;r<o;++r){let a=e[r],s=a.componentDatatype;n.push({index:a.index,enabled:a.enabled,componentsPerAttribute:a.componentsPerAttribute,componentDatatype:s,normalize:a.normalize,offsetInBytes:i,vertexSizeInComponentType:t/j.getSizeInBytes(s),view:void 0}),i+=a.componentsPerAttribute*j.getSizeInBytes(s)}return n};Ps.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];Ps._resize(o,this._size),Ps._appendWriters(this.writers,o)}g6(this)};Ps._resize=function(e,t){if(e.vertexSizeInBytes>0){let n=new ArrayBuffer(t*e.vertexSizeInBytes);if(l(e.arrayBuffer)){let r=new Uint8Array(n),a=new Uint8Array(e.arrayBuffer),s=a.length;for(let c=0;c<s;++c)r[c]=a[c]}let i=e.arrayViews,o=i.length;for(let r=0;r<o;++r){let a=i[r];a.view=j.createArrayBufferView(a.componentDatatype,n,a.offsetInBytes)}e.arrayBuffer=n}};var vFe=[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 a=i*n;t[a]=o,t[a+1]=r,e.needsCommit=!0}},function(e,t,n){return function(i,o,r,a){let s=i*n;t[s]=o,t[s+1]=r,t[s+2]=a,e.needsCommit=!0}},function(e,t,n){return function(i,o,r,a,s){let c=i*n;t[c]=o,t[c+1]=r,t[c+2]=a,t[c+3]=s,e.needsCommit=!0}}];Ps._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]=vFe[r.componentsPerAttribute-1](t,r.view,r.vertexSizeInComponentType)}};Ps.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=PFe(this,i)||t;if(t||!l(this.va)){g6(this);let a=this.va=[],s=D.SIXTY_FOUR_KILOBYTES-4,c=l(e)&&!this._instanced?Math.ceil(this._size/s):1;for(let u=0;u<c;++u){let f=[];for(o=0,r=n.length;o<r;++o){i=n[o];let h=u*(i.vertexSizeInBytes*s);Ps._appendAttributes(f,i,h,this._instanced)}f=f.concat(this._precreated),a.push({va:new Gn({context:this._context,attributes:f,indexBuffer:e}),indicesCount:1.5*(u!==c-1?s:this._size%s)})}}};function PFe(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=tt.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}Ps._appendAttributes=function(e,t,n,i){let o=t.arrayViews,r=o.length;for(let a=0;a<r;++a){let s=o[a];e.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:s.componentDatatype,normalize:s.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:n+s.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:i?1:0})}};Ps.prototype.subCommit=function(e,t){let n=this._allBuffers;for(let i=0,o=n.length;i<o;++i)RFe(n[i],e,t)};function RFe(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)}}Ps.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function g6(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}Ps.prototype.isDestroyed=function(){return!1};Ps.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 g6(this),fe(this)};var OA=Ps;function ry(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new _e,this.setValue(e)}Object.defineProperties(ry.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});ry.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};ry.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))}};ry.prototype.equals=function(e){return this===e||e instanceof ry&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};ry.prototype.valueOf=function(){return this._value};ry.prototype.toString=function(){return String(this._value)};var hi=ry;function MFe(e,t,n,i,o){return{configurable:i,get:function(){return this[t]},set:function(r){let a=this[t],s=this[n];l(s)&&(s(),this[n]=void 0),r!==void 0&&(!l(r)||!l(r.getValue))&&l(o)&&(r=o(r)),a!==r&&(this[t]=r,this._definitionChanged.raiseEvent(this,e,r,a)),l(r)&&l(r.definitionChanged)&&(this[n]=r.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,r,r)},this))}}}function NFe(e){return new hi(e)}function LFe(e,t,n){return MFe(e,`_${e.toString()}`,`_${e.toString()}Subscription`,t??!1,n??NFe)}var Ae=LFe;function pR(e){this._definitionChanged=new _e,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(e??V.EMPTY_OBJECT)}Object.defineProperties(pR.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Ae("show"),image:Ae("image"),scale:Ae("scale"),pixelOffset:Ae("pixelOffset"),eyeOffset:Ae("eyeOffset"),horizontalOrigin:Ae("horizontalOrigin"),verticalOrigin:Ae("verticalOrigin"),heightReference:Ae("heightReference"),color:Ae("color"),rotation:Ae("rotation"),alignedAxis:Ae("alignedAxis"),sizeInMeters:Ae("sizeInMeters"),width:Ae("width"),height:Ae("height"),scaleByDistance:Ae("scaleByDistance"),translucencyByDistance:Ae("translucencyByDistance"),pixelOffsetScaleByDistance:Ae("pixelOffsetScaleByDistance"),imageSubRegion:Ae("imageSubRegion"),distanceDisplayCondition:Ae("distanceDisplayCondition"),disableDepthTestDistance:Ae("disableDepthTestDistance"),splitDirection:Ae("splitDirection")});pR.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 pR(this)};pR.prototype.merge=function(e){this.show=this._show??e.show,this.image=this._image??e.image,this.scale=this._scale??e.scale,this.pixelOffset=this._pixelOffset??e.pixelOffset,this.eyeOffset=this._eyeOffset??e.eyeOffset,this.horizontalOrigin=this._horizontalOrigin??e.horizontalOrigin,this.verticalOrigin=this._verticalOrigin??e.verticalOrigin,this.heightReference=this._heightReference??e.heightReference,this.color=this._color??e.color,this.rotation=this._rotation??e.rotation,this.alignedAxis=this._alignedAxis??e.alignedAxis,this.sizeInMeters=this._sizeInMeters??e.sizeInMeters,this.width=this._width??e.width,this.height=this._height??e.height,this.scaleByDistance=this._scaleByDistance??e.scaleByDistance,this.translucencyByDistance=this._translucencyByDistance??e.translucencyByDistance,this.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance??e.pixelOffsetScaleByDistance,this.imageSubRegion=this._imageSubRegion??e.imageSubRegion,this.distanceDisplayCondition=this._distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this._disableDepthTestDistance??e.disableDepthTestDistance,this.splitDirection=this.splitDirection??e.splitDirection};var jc=pR;function OE(){this._array=[],this._hash={}}Object.defineProperties(OE.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}});OE.prototype.contains=function(e){return l(this._hash[e])};OE.prototype.set=function(e,t){let n=this._hash[e];t!==n&&(this.remove(e),this._hash[e]=t,this._array.push(t))};OE.prototype.get=function(e){return this._hash[e]};OE.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};OE.prototype.removeAll=function(){let e=this._array;e.length>0&&(this._hash={},e.length=0)};var Ot=OE;function uf(e,t){e=e??0,this._near=e,t=t??Number.MAX_VALUE,this._far=t}Object.defineProperties(uf.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}}});uf.packedLength=2;uf.pack=function(e,t,n){return n=n??0,t[n++]=e.near,t[n]=e.far,t};uf.unpack=function(e,t,n){return t=t??0,l(n)||(n=new uf),n.near=e[t++],n.far=e[t],n};uf.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};uf.clone=function(e,t){if(l(e))return l(t)||(t=new uf),t.near=e.near,t.far=e.far,t};uf.prototype.clone=function(e){return uf.clone(this,e)};uf.prototype.equals=function(e){return uf.equals(this,e)};var zt=uf;function Ad(e,t,n,i){this.near=e??0,this.nearValue=t??0,this.far=n??1,this.farValue=i??0}Ad.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 Ad(e.near,e.nearValue,e.far,e.farValue)};Ad.packedLength=4;Ad.pack=function(e,t,n){return n=n??0,t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t};Ad.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Ad),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};Ad.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};Ad.prototype.clone=function(e){return Ad.clone(this,e)};Ad.prototype.equals=function(e){return Ad.equals(this,e)};var Ht=Ad;var FE={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},it=Object.freeze(FE);function gd(e){return e===FE.CLAMP_TO_GROUND||e===FE.CLAMP_TO_3D_TILE||e===FE.CLAMP_TO_TERRAIN}function Px(e){return e===FE.RELATIVE_TO_GROUND||e===FE.RELATIVE_TO_3D_TILE||e===FE.RELATIVE_TO_TERRAIN}var OFe={CENTER:0,LEFT:1,RIGHT:-1},Mi=Object.freeze(OFe);var FFe={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1},jn=Object.freeze(FFe);var QFe=Object.freeze({DONE:0,PENDING:1,FAILED:2}),Ct=QFe;function Ph(){de.throwInstantiationError()}Object.defineProperties(Ph.prototype,{isConstant:{get:de.throwInstantiationError},definitionChanged:{get:de.throwInstantiationError}});Ph.prototype.getValue=de.throwInstantiationError;Ph.prototype.equals=de.throwInstantiationError;Ph.equals=function(e,t){return e===t||l(e)&&e.equals(t)};Ph.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(!Ph.equals(e[i],t[i]))return!1;return!0};Ph.isConstant=function(e){return!l(e)||e.isConstant};Ph.getValueOrUndefined=function(e,t,n){return l(e)?e.getValue(t,n):void 0};Ph.getValueOrDefault=function(e,t,n,i){return l(e)?e.getValue(t,i)??n:n};Ph.getValueOrClonedDefault=function(e,t,n,i){let o;return l(e)&&(o=e.getValue(t,i)),l(o)||(o=n.clone(o)),o};var q=Ph;var kFe={LEFT:-1,NONE:0,RIGHT:1},Lr=Object.freeze(kFe);var UFe=z.WHITE,zFe=d.ZERO,GFe=it.NONE,VFe=k.ZERO,HFe=1,WFe=0,jFe=d.ZERO,YFe=Mi.CENTER,qFe=jn.CENTER,KFe=!1,XFe=Lr.NONE,JFe=new d,ZFe=new z,$Fe=new d,eQe=new k,tQe=new Ht,nQe=new Ht,iQe=new Ht,oQe=new et,rQe=new zt;function Mse(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function ay(e,t){t.collectionChanged.addEventListener(ay.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Ot,this._onCollectionChanged(t,t.values,[],[])}ay.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],a=r.entity,s=a._billboard,c,u=r.billboard,f=a.isShowing&&a.isAvailable(e)&&q.getValueOrDefault(s._show,e,!0),h;if(f&&(h=q.getValueOrUndefined(a._position,e,JFe),c=q.getValueOrUndefined(s._image,e),f=l(h)&&l(c)),!f){_6(r,a,n);continue}q.isConstant(a._position)||(n._clusterDirty=!0),l(u)||(u=n.getBillboard(a),u.id=a,r.billboard=u,r.textureValue=void 0),u.show=f,u.position=h,u.color=q.getValueOrDefault(s._color,e,UFe,ZFe),u.eyeOffset=q.getValueOrDefault(s._eyeOffset,e,zFe,$Fe),u.heightReference=q.getValueOrDefault(s._heightReference,e,GFe),u.pixelOffset=q.getValueOrDefault(s._pixelOffset,e,VFe,eQe),u.scale=q.getValueOrDefault(s._scale,e,HFe),u.rotation=q.getValueOrDefault(s._rotation,e,WFe),u.alignedAxis=q.getValueOrDefault(s._alignedAxis,e,jFe),u.horizontalOrigin=q.getValueOrDefault(s._horizontalOrigin,e,YFe),u.verticalOrigin=q.getValueOrDefault(s._verticalOrigin,e,qFe),u.width=q.getValueOrUndefined(s._width,e),u.height=q.getValueOrUndefined(s._height,e),u.scaleByDistance=q.getValueOrUndefined(s._scaleByDistance,e,tQe),u.translucencyByDistance=q.getValueOrUndefined(s._translucencyByDistance,e,nQe),u.pixelOffsetScaleByDistance=q.getValueOrUndefined(s._pixelOffsetScaleByDistance,e,iQe),u.sizeInMeters=q.getValueOrDefault(s._sizeInMeters,e,KFe),u.distanceDisplayCondition=q.getValueOrUndefined(s._distanceDisplayCondition,e,rQe),u.disableDepthTestDistance=q.getValueOrUndefined(s._disableDepthTestDistance,e),u.splitDirection=q.getValueOrDefault(s._splitDirection,e,XFe),r.textureValue!==c&&(u.image=c,r.textureValue=c);let p=q.getValueOrUndefined(s._imageSubRegion,e,oQe);l(p)&&u.setImageSubRegion(u.image,p)}return!0};ay.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.billboard))return Ct.FAILED;let i=n.billboard;if(i.heightReference===it.NONE)t.center=d.clone(i.position,t.center);else{if(!l(i._clampedPosition))return Ct.PENDING;t.center=d.clone(i._clampedPosition,t.center)}return t.radius=0,Ct.DONE};ay.prototype.isDestroyed=function(){return!1};ay.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(ay.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return fe(this)};ay.prototype._onCollectionChanged=function(e,t,n,i){let o,r,a=this._items,s=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._billboard)&&l(r._position)&&a.set(r.id,new Mse(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._billboard)&&l(r._position)?a.contains(r.id)||a.set(r.id,new Mse(r)):(_6(a.get(r.id),r,s),a.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],_6(a.get(r.id),r,s),a.remove(r.id)};function _6(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var AR=ay;var aQe=new d;function lp(e){e=e??V.EMPTY_OBJECT;let t=e.minimum,n=e.maximum;this._min=d.clone(t),this._max=d.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}lp.fromDimensions=function(e){e=e??V.EMPTY_OBJECT;let t=e.dimensions,n=d.multiplyByScalar(t,.5,new d);return new lp({minimum:d.negate(n,new d),maximum:n,offsetAttribute:e.offsetAttribute})};lp.fromAxisAlignedBoundingBox=function(e){return new lp({minimum:e.minimum,maximum:e.maximum})};lp.packedLength=2*d.packedLength+1;lp.pack=function(e,t,n){return n=n??0,d.pack(e._min,t,n),d.pack(e._max,t,n+d.packedLength),t[n+d.packedLength*2]=e._offsetAttribute??-1,t};var Lse=new d,Ose=new d,Nse={minimum:Lse,maximum:Ose,offsetAttribute:void 0};lp.unpack=function(e,t,n){t=t??0;let i=d.unpack(e,t,Lse),o=d.unpack(e,t+d.packedLength,Ose),r=e[t+d.packedLength*2];return l(n)?(n._min=d.clone(i,n._min),n._max=d.clone(o,n._max),n._offsetAttribute=r===-1?void 0:r,n):(Nse.offsetAttribute=r===-1?void 0:r,new lp(Nse))};lp.createGeometry=function(e){let t=e._min,n=e._max;if(d.equals(t,n))return;let i=new _n,o=new Uint16Array(24),r=new Float64Array(24);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 Me({componentDatatype:j.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 a=d.subtract(n,t,aQe),s=d.magnitude(a)*.5;if(l(e._offsetAttribute)){let c=r.length,u=e._offsetAttribute===mn.NONE?0:1,f=new Uint8Array(c/3).fill(u);i.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new yt({attributes:i,indices:o,primitiveType:ve.LINES,boundingSphere:new le(d.ZERO,s),offsetAttribute:e._offsetAttribute})};var Rh=lp;function Rx(e,t,n,i){e=e??1,t=t??1,n=n??1,i=i??1,this.value=new Uint8Array([z.floatToByte(e),z.floatToByte(t),z.floatToByte(n),z.floatToByte(i)])}Object.defineProperties(Rx.prototype,{componentDatatype:{get:function(){return j.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});Rx.fromColor=function(e){return new Rx(e.red,e.green,e.blue,e.alpha)};Rx.toValue=function(e,t){return l(t)?e.toBytes(t):new Uint8Array(e.toBytes())};Rx.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 Jt=Rx;function gR(e,t){e=e??0,t=t??Number.MAX_VALUE,this.value=new Float32Array([e,t])}Object.defineProperties(gR.prototype,{componentDatatype:{get:function(){return j.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});gR.fromDistanceDisplayCondition=function(e){return new gR(e.near,e.far)};gR.toValue=function(e,t){return l(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var $n=gR;function sQe(e){e=e??V.EMPTY_OBJECT,this.geometry=e.geometry,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var Mt=sQe;function Sr(e){e=e??V.EMPTY_OBJECT,this.start=l(e.start)?X.clone(e.start):new X,this.stop=l(e.stop)?X.clone(e.stop):new X,this.data=e.data,this.isStartIncluded=e.isStartIncluded??!0,this.isStopIncluded=e.isStopIncluded??!0}Object.defineProperties(Sr.prototype,{isEmpty:{get:function(){let e=X.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var Mx={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};Sr.fromIso8601=function(e,t){let n=e.iso8601.split("/");if(n.length!==2)throw new de("options.iso8601 is an invalid ISO 8601 interval.");let i=X.fromIso8601(n[0]),o=X.fromIso8601(n[1]),r=e.isStartIncluded??!0,a=e.isStopIncluded??!0,s=e.data;return l(t)?(t.start=i,t.stop=o,t.isStartIncluded=r,t.isStopIncluded=a,t.data=s,t):(Mx.start=i,Mx.stop=o,Mx.isStartIncluded=r,Mx.isStopIncluded=a,Mx.data=s,new Sr(Mx))};Sr.toIso8601=function(e,t){return`${X.toIso8601(e.start,t)}/${X.toIso8601(e.stop,t)}`};Sr.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 Sr(e)};Sr.equals=function(e,t,n){return e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&X.equals(e.start,t.start)&&X.equals(e.stop,t.stop)&&(e.data===t.data||l(n)&&n(e.data,t.data)))};Sr.equalsEpsilon=function(e,t,n,i){return n=n??0,e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&X.equalsEpsilon(e.start,t.start,n)&&X.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||l(i)&&i(e.data,t.data)))};Sr.intersect=function(e,t,n,i){if(!l(t))return Sr.clone(Sr.EMPTY,n);let o=e.start,r=e.stop,a=t.start,s=t.stop,c=X.greaterThanOrEquals(a,o)&&X.greaterThanOrEquals(r,a),u=!c&&X.lessThanOrEquals(a,o)&&X.lessThanOrEquals(o,s);if(!c&&!u)return Sr.clone(Sr.EMPTY,n);let f=e.isStartIncluded,h=e.isStopIncluded,p=t.isStartIncluded,A=t.isStopIncluded,m=X.lessThan(r,s);return l(n)||(n=new Sr),n.start=c?a:o,n.isStartIncluded=f&&p||!X.equals(a,o)&&(c&&p||u&&f),n.stop=m?r:s,n.isStopIncluded=m?h:h&&A||!X.equals(s,r)&&A,n.data=l(i)?i(e.data,t.data):e.data,n};Sr.contains=function(e,t){if(e.isEmpty)return!1;let n=X.compare(e.start,t);if(n===0)return e.isStartIncluded;let i=X.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0};Sr.prototype.clone=function(e){return Sr.clone(this,e)};Sr.prototype.equals=function(e,t){return Sr.equals(this,e,t)};Sr.prototype.equalsEpsilon=function(e,t,n){return Sr.equalsEpsilon(this,e,t,n)};Sr.prototype.toString=function(){return Sr.toIso8601(this)};Sr.EMPTY=Object.freeze(new Sr({start:new X,stop:new X,isStartIncluded:!1,isStopIncluded:!1}));var vn=Sr;var Fse=Object.freeze(X.fromIso8601("0000-01-01T00:00:00Z")),Qse=Object.freeze(X.fromIso8601("9999-12-31T24:00:00Z")),cQe=Object.freeze(new vn({start:Fse,stop:Qse})),lQe={MINIMUM_VALUE:Fse,MAXIMUM_VALUE:Qse,MAXIMUM_INTERVAL:cQe},Xe=lQe;function _R(e,t,n){e=e??0,t=t??0,n=n??0,this.value=new Float32Array([e,t,n])}Object.defineProperties(_R.prototype,{componentDatatype:{get:function(){return j.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});_R.fromCartesian3=function(e){return new _R(e.x,e.y,e.z)};_R.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 go=_R;function lV(e){e=e??!0,this.value=lV.toValue(e)}Object.defineProperties(lV.prototype,{componentDatatype:{get:function(){return j.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});lV.toValue=function(e,t){return l(t)?(t[0]=e,t):new Uint8Array([e])};var Sn=lV;var yR=`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 CR=`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 ER=`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 bR=`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 IR=`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 xR=`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 uQe={ADD:ee.FUNC_ADD,SUBTRACT:ee.FUNC_SUBTRACT,REVERSE_SUBTRACT:ee.FUNC_REVERSE_SUBTRACT,MIN:ee.MIN,MAX:ee.MAX},Tc=Object.freeze(uQe);var fQe={ZERO:ee.ZERO,ONE:ee.ONE,SOURCE_COLOR:ee.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:ee.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:ee.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:ee.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:ee.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:ee.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:ee.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:ee.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:ee.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:ee.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:ee.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:ee.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:ee.SRC_ALPHA_SATURATE},Jo=Object.freeze(fQe);var dQe={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Tc.ADD,equationAlpha:Tc.ADD,functionSourceRgb:Jo.SOURCE_ALPHA,functionSourceAlpha:Jo.ONE,functionDestinationRgb:Jo.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Jo.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Tc.ADD,equationAlpha:Tc.ADD,functionSourceRgb:Jo.ONE,functionSourceAlpha:Jo.ONE,functionDestinationRgb:Jo.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Jo.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:Tc.ADD,equationAlpha:Tc.ADD,functionSourceRgb:Jo.SOURCE_ALPHA,functionSourceAlpha:Jo.ONE,functionDestinationRgb:Jo.ONE,functionDestinationAlpha:Jo.ONE})},sn=Object.freeze(dQe);var hQe={FRONT:ee.FRONT,BACK:ee.BACK,FRONT_AND_BACK:ee.FRONT_AND_BACK},Ni=Object.freeze(hQe);function Nx(e){e=e??V.EMPTY_OBJECT,this.material=e.material,this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=e.closed??!1}Object.defineProperties(Nx.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}}});Nx.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(`
`)};Nx.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent};Nx.prototype.getRenderState=function(){let e=this.isTranslucent(),t=je(this.renderState,!1);return e?(t.depthMask=!1,t.blending=sn.ALPHA_BLEND):t.depthMask=!0,t};Nx.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=sn.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:Ni.BACK}),l(n)&&(i=Pt(n,i,!0)),i};var Io=Nx;var TR=`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 SR=`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 wR=`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 BR=`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 DR=`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 vR=`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 PR=`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 RR=`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 MR=`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 NR=`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 LR=`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 OR=`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 FR=`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 QR=`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 kR=`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 UR=`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 zR=`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 GR=`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 VR=`// 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 $e(e){this.type=void 0,this.autoDestroyOldTexture=e.autoDestroyOldTexture??!0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._minificationFilter=e.minificationFilter??Wt.LINEAR,this._magnificationFilter=e.magnificationFilter??ci.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,this._initializationPromises=[],this._initializationError=void 0,mQe(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1},minificationFilter:{get:function(){return this._minificationFilter},set:function(t){this._minificationFilter=t}},magnificationFilter:{get:function(){return this._magnificationFilter},set:function(t){this._magnificationFilter=t}}}),l($e._uniformList[this.type])||($e._uniformList[this.type]=Object.keys(this._uniforms))}$e._uniformList={};$e.fromType=function(e,t){let n=new $e({fabric:{type:e}});if(l(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};$e.fromTypeAsync=async function(e,t){let n=[],i=new $e({fabric:{type:e,uniforms:t}});if(zse(i,n),await Promise.all(n),n.length=0,l(i._initializationError))throw i._initializationError;return i};function zse(e,t){t.push(...e._initializationPromises);let n=e.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];zse(o,t)}}$e.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};$e.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 u=c.image,f;Array.isArray(u)&&(f=u.slice(1,u.length).map(function(_){return _.bufferView}),u=u[0]);let h=new jt({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter}),p;l(u.internalFormat)?p=new Dt({context:e,pixelFormat:u.internalFormat,width:u.width,height:u.height,source:{arrayBufferView:u.bufferView,mipLevels:f},sampler:h}):p=new Dt({context:e,source:u,sampler:h});let A=this._textures[n];l(A)&&A!==this._defaultTexture&&A.destroy(),this._textures[n]=p;let m=`${n}Dimensions`;if(this.uniforms.hasOwnProperty(m)){let _=this.uniforms[m];_.x=p._width,_.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 u=c.images,f=new Kr({context:e,source:{positiveX:u[0],negativeX:u[1],positiveY:u[2],negativeY:u[3],positiveZ:u[4],negativeZ:u[5]},sampler:new jt({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[n]=f}r.length=0;let a=this._updateFunctions;for(o=a.length,t=0;t<o;++t)a[t](this,e);let s=this.materials;for(let c in s)s.hasOwnProperty(c)&&s[c].update(e)};$e.prototype.isDestroyed=function(){return!1};$e.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 fe(this)};function mQe(e,t){e=e??V.EMPTY_OBJECT,t._strict=e.strict??!1,t._count=e.count??0,t._template=je(e.fabric??V.EMPTY_OBJECT),t.fabric=je(e.fabric??V.EMPTY_OBJECT),t._template.uniforms=je(t._template.uniforms??V.EMPTY_OBJECT),t._template.materials=je(t._template.materials??V.EMPTY_OBJECT),t.type=l(t._template.type)?t._template.type:Jn(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n,i=$e._materialCache.getMaterial(t.type);if(l(i)){let r=je(i.fabric,!0);t._template=Pt(t._template,r,!0),n=i.translucent}_Qe(t),CQe(t),xQe(t),SQe(t),l(i)||$e._materialCache.addMaterial(t.type,t);let o=t._translucentFunctions.length===0?!0:void 0;if(n=n??o,n=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 y6(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 kse(e,t){}function pQe(e,t){}var AQe=["type","materials","uniforms","components","source"],gQe=["diffuse","specular","shininess","normal","emission","alpha"];function _Qe(e){let t=e._template,n=t.uniforms,i=t.materials,o=t.components;y6(t,AQe,kse,!0),y6(o,gQe,kse,!0);let r=[];for(let a in i)i.hasOwnProperty(a)&&r.push(a);y6(n,r,pQe,!1)}function yQe(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 CQe(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 a=i&&yQe(t[o],e)?t[o]:`czm_gammaCorrect(${t[o]})`;e.shaderSource+=`material.${o} = ${a};
`}else o==="alpha"?e.shaderSource+=`material.alpha = ${t.alpha};
`:e.shaderSource+=`material.${o} = ${t[o]};
`}e.shaderSource+=`return material;
}
`}}var Use={mat2:ji,mat3:J,mat4:M},EQe=/\.ktx2$/i;function bQe(e){let t;return function(n,i){let o=n.uniforms,r=o[e],a=t!==r,s=!l(r)||r===$e.DefaultImageId;t=r;let c=n._textures[e],u,f;if(r instanceof HTMLVideoElement){if(r.readyState>=2){if(a&&l(c)&&(c!==i.defaultTexture&&c.destroy(),c=void 0),!l(c)||c===i.defaultTexture){let h=new jt({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new Dt({context:i,source:r,sampler:h}),n._textures[e]=c;return}c.copyFrom({source:r})}else l(c)||(n._textures[e]=i.defaultTexture);return}if(r instanceof Dt&&r!==c){n._texturePaths[e]=void 0;let h=n._textures[e];l(h)&&h!==n._defaultTexture&&!h.isDestroyed()&&n.autoDestroyOldTexture&&h.destroy(),n._textures[e]=r,u=`${e}Dimensions`,o.hasOwnProperty(u)&&(f=o[u],f.x=r._width,f.y=r._height);return}if(a&&l(c)&&s&&(c!==n._defaultTexture&&c.destroy(),c=void 0,n._texturePaths[e]=void 0),l(c)||(c=n._textures[e]=n._defaultTexture,u=`${e}Dimensions`,o.hasOwnProperty(u)&&(f=o[u],f.x=c._width,f.y=c._height)),!s){if((r instanceof HTMLCanvasElement||r instanceof HTMLImageElement||r instanceof ImageBitmap||r instanceof OffscreenCanvas)&&r!==n._texturePaths[e]){n._loadedImages.push({id:e,image:r}),n._texturePaths[e]=r;return}Gse(n,e)}}}function Gse(e,t){let i=e.uniforms[t];if(i===$e.DefaultImageId)return Promise.resolve();let o=De.createIfNeeded(i);if(!(o instanceof De))return Promise.resolve();let r=De.createIfNeeded(e._texturePaths[t]);if(!(!l(r)||r.url!==o.url))return Promise.resolve();let s;return EQe.test(o.url)?s=_u(o.url):s=o.fetchImage(),Promise.resolve(s).then(function(c){e._loadedImages.push({id:t,image:c})}).catch(function(c){e._initializationError=c;let u=e._textures[t];l(u)&&u!==e._defaultTexture&&u.destroy(),e._textures[t]=e._defaultTexture}),e._texturePaths[t]=i,s}function IQe(e){return function(t,n){let i=t.uniforms[e];if(i instanceof Kr){let o=t._textures[e];o!==t._defaultTexture&&o.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}l(t._textures[e])||(t._textures[e]=n.defaultCubeMap),Vse(t,e)}}function Vse(e,t){let i=e.uniforms[t];if(i===$e.DefaultCubeMapId)return Promise.resolve();let o=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(o===e._texturePaths[t])return Promise.resolve();let r=[De.createIfNeeded(i.positiveX).fetchImage(),De.createIfNeeded(i.negativeX).fetchImage(),De.createIfNeeded(i.positiveY).fetchImage(),De.createIfNeeded(i.negativeY).fetchImage(),De.createIfNeeded(i.positiveZ).fetchImage(),De.createIfNeeded(i.negativeZ).fetchImage()],a=Promise.all(r);return a.then(function(s){e._loadedCubeMaps.push({id:t,images:s})}).catch(function(s){e._initializationError=s}),e._texturePaths[t]=o,a}function xQe(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&Hse(e,n)}function Hse(e,t){let n=e._strict,i=e._template.uniforms,o=i[t],r=TQe(o),a;if(r==="channels")a=HR(e,t,o,!1);else{if(r==="sampler2D"){let u=`${t}Dimensions`;wQe(e,u)>0&&(i[u]={type:"ivec3",x:1,y:1},Hse(e,u))}if(!new RegExp(`uniform\\s+${r}\\s+${t}\\s*;`).test(e.shaderSource)){let u=`uniform ${r} ${t};`;e.shaderSource=u+e.shaderSource}let c=`${t}_${e._count++}`;if(a=HR(e,t,c),e.uniforms[t]=o,r==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(bQe(t)),e._initializationPromises.push(Gse(e,t));else if(r==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(IQe(t)),e._initializationPromises.push(Vse(e,t));else if(r.indexOf("mat")!==-1){let u=new Use[r];e._uniforms[c]=function(){return Use[r].fromColumnMajorArray(e.uniforms[t],u)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function TQe(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 De||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof ImageBitmap||e instanceof OffscreenCanvas||e instanceof Dt)/^([rgba]){1,4}$/i.test(e)?t="channels":e===$e.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 SQe(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=new $e({strict:t,fabric:n[i],count:e._count});e._count=o._count,e._uniforms=Pt(e._uniforms,o._uniforms,!0),e.materials[i]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);let r="czm_getMaterial",a=`${r}_${e._count++}`;HR(o,r,a),e.shaderSource=o.shaderSource+e.shaderSource;let s=`${a}(materialInput)`,c=HR(e,i,s)}}function HR(e,t,n,i){i=i??!0;let o=0,r="([\\w])?",a=`([\\w${i?".":""}])?`,s=new RegExp(a+t+r,"g");return e.shaderSource=e.shaderSource.replace(s,function(c,u,f){return u||f?c:(o+=1,n)}),o}function wQe(e,t,n){return HR(e,t,t,n)}$e._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};$e.DefaultImageId="czm_defaultImage";$e.DefaultCubeMapId="czm_defaultCubeMap";$e.ColorType="Color";$e._materialCache.addMaterial($e.ColorType,{fabric:{type:$e.ColorType,uniforms:{color:new z(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});$e.ImageType="Image";$e._materialCache.addMaterial($e.ImageType,{fabric:{type:$e.ImageType,uniforms:{image:$e.DefaultImageId,repeat:new k(1,1),color:new z(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}});$e.DiffuseMapType="DiffuseMap";$e._materialCache.addMaterial($e.DiffuseMapType,{fabric:{type:$e.DiffuseMapType,uniforms:{image:$e.DefaultImageId,channels:"rgb",repeat:new k(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});$e.AlphaMapType="AlphaMap";$e._materialCache.addMaterial($e.AlphaMapType,{fabric:{type:$e.AlphaMapType,uniforms:{image:$e.DefaultImageId,channel:"a",repeat:new k(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});$e.SpecularMapType="SpecularMap";$e._materialCache.addMaterial($e.SpecularMapType,{fabric:{type:$e.SpecularMapType,uniforms:{image:$e.DefaultImageId,channel:"r",repeat:new k(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});$e.EmissionMapType="EmissionMap";$e._materialCache.addMaterial($e.EmissionMapType,{fabric:{type:$e.EmissionMapType,uniforms:{image:$e.DefaultImageId,channels:"rgb",repeat:new k(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});$e.BumpMapType="BumpMap";$e._materialCache.addMaterial($e.BumpMapType,{fabric:{type:$e.BumpMapType,uniforms:{image:$e.DefaultImageId,channel:"r",strength:.8,repeat:new k(1,1)},source:SR},translucent:!1});$e.NormalMapType="NormalMap";$e._materialCache.addMaterial($e.NormalMapType,{fabric:{type:$e.NormalMapType,uniforms:{image:$e.DefaultImageId,channels:"rgb",strength:.8,repeat:new k(1,1)},source:NR},translucent:!1});$e.GridType="Grid";$e._materialCache.addMaterial($e.GridType,{fabric:{type:$e.GridType,uniforms:{color:new z(0,1,0,1),cellAlpha:.1,lineCount:new k(8,8),lineThickness:new k(1,1),lineOffset:new k(0,0)},source:MR},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});$e.StripeType="Stripe";$e._materialCache.addMaterial($e.StripeType,{fabric:{type:$e.StripeType,uniforms:{horizontal:!0,evenColor:new z(1,1,1,.5),oddColor:new z(0,0,1,.5),offset:0,repeat:5},source:zR},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});$e.CheckerboardType="Checkerboard";$e._materialCache.addMaterial($e.CheckerboardType,{fabric:{type:$e.CheckerboardType,uniforms:{lightColor:new z(1,1,1,.5),darkColor:new z(0,0,0,.5),repeat:new k(5,5)},source:wR},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});$e.DotType="Dot";$e._materialCache.addMaterial($e.DotType,{fabric:{type:$e.DotType,uniforms:{lightColor:new z(1,1,0,.75),darkColor:new z(0,1,1,.75),repeat:new k(5,5)},source:BR},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});$e.WaterType="Water";$e._materialCache.addMaterial($e.WaterType,{fabric:{type:$e.WaterType,uniforms:{baseWaterColor:new z(.2,.3,.6,1),blendColor:new z(0,1,.699,1),specularMap:$e.DefaultImageId,normalMap:$e.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:VR},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});$e.RimLightingType="RimLighting";$e._materialCache.addMaterial($e.RimLightingType,{fabric:{type:$e.RimLightingType,uniforms:{color:new z(1,0,0,.7),rimColor:new z(1,1,1,.4),width:.3},source:kR},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});$e.FadeType="Fade";$e._materialCache.addMaterial($e.FadeType,{fabric:{type:$e.FadeType,uniforms:{fadeInColor:new z(1,0,0,1),fadeOutColor:new z(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new k(.5,.5)},source:RR},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});$e.PolylineArrowType="PolylineArrow";$e._materialCache.addMaterial($e.PolylineArrowType,{fabric:{type:$e.PolylineArrowType,uniforms:{color:new z(1,1,1,1)},source:LR},translucent:!0});$e.PolylineDashType="PolylineDash";$e._materialCache.addMaterial($e.PolylineDashType,{fabric:{type:$e.PolylineDashType,uniforms:{color:new z(1,0,1,1),gapColor:new z(0,0,0,0),dashLength:16,dashPattern:255},source:OR},translucent:!0});$e.PolylineGlowType="PolylineGlow";$e._materialCache.addMaterial($e.PolylineGlowType,{fabric:{type:$e.PolylineGlowType,uniforms:{color:new z(0,.5,1,1),glowPower:.25,taperPower:1},source:FR},translucent:!0});$e.PolylineOutlineType="PolylineOutline";$e._materialCache.addMaterial($e.PolylineOutlineType,{fabric:{type:$e.PolylineOutlineType,uniforms:{color:new z(1,1,1,1),outlineColor:new z(1,0,0,1),outlineWidth:1},source:QR},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});$e.ElevationContourType="ElevationContour";$e._materialCache.addMaterial($e.ElevationContourType,{fabric:{type:$e.ElevationContourType,uniforms:{spacing:100,color:new z(1,0,0,1),width:1},source:vR},translucent:!1});$e.ElevationRampType="ElevationRamp";$e._materialCache.addMaterial($e.ElevationRampType,{fabric:{type:$e.ElevationRampType,uniforms:{image:$e.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:PR},translucent:!1});$e.SlopeRampMaterialType="SlopeRamp";$e._materialCache.addMaterial($e.SlopeRampMaterialType,{fabric:{type:$e.SlopeRampMaterialType,uniforms:{image:$e.DefaultImageId},source:UR},translucent:!1});$e.AspectRampMaterialType="AspectRamp";$e._materialCache.addMaterial($e.AspectRampMaterialType,{fabric:{type:$e.AspectRampMaterialType,uniforms:{image:$e.DefaultImageId},source:TR},translucent:!1});$e.ElevationBandType="ElevationBand";$e._materialCache.addMaterial($e.ElevationBandType,{fabric:{type:$e.ElevationBandType,uniforms:{heights:$e.DefaultImageId,colors:$e.DefaultImageId},source:DR},translucent:!0});$e.WaterMaskType="WaterMask";$e._materialCache.addMaterial($e.WaterMaskType,{fabric:{type:$e.WaterMaskType,source:GR,uniforms:{waterColor:new z(1,1,1,1),landColor:new z(0,0,0,0)}},translucent:!1});var Yi=$e;function QE(e){e=e??V.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.materialSupport??QE.MaterialSupport.TEXTURED;this.material=l(e.material)?e.material:Yi.fromType(Yi.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??i.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource??i.fragmentShaderSource,this._renderState=Io.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._materialSupport=i,this._vertexFormat=i.vertexFormat,this._flat=e.flat??!1,this._faceForward=e.faceForward??!n}Object.defineProperties(QE.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}}});QE.prototype.getFragmentShaderSource=Io.prototype.getFragmentShaderSource;QE.prototype.isTranslucent=Io.prototype.isTranslucent;QE.prototype.getRenderState=Io.prototype.getRenderState;QE.MaterialSupport={BASIC:Object.freeze({vertexFormat:ke.POSITION_AND_NORMAL,vertexShaderSource:bR,fragmentShaderSource:ER}),TEXTURED:Object.freeze({vertexFormat:ke.POSITION_NORMAL_AND_ST,vertexShaderSource:xR,fragmentShaderSource:IR}),ALL:Object.freeze({vertexFormat:ke.ALL,vertexShaderSource:CR,fragmentShaderSource:yR})};var _o=QE;var WR=`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 jR=`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 kE=`in vec4 v_color;
void main()
{
out_FragColor = czm_gammaCorrect(v_color);
}
`;var YR=`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 FA(e){e=e??V.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.flat??!1,o=i?YR:jR,r=i?kE:WR,a=i?FA.FLAT_VERTEX_FORMAT:FA.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??o,this._fragmentShaderSource=e.fragmentShaderSource??r,this._renderState=Io.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=a,this._flat=i,this._faceForward=e.faceForward??!n}Object.defineProperties(FA.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}}});FA.VERTEX_FORMAT=ke.POSITION_AND_NORMAL;FA.FLAT_VERTEX_FORMAT=ke.POSITION_ONLY;FA.prototype.getFragmentShaderSource=Io.prototype.getFragmentShaderSource;FA.prototype.isTranslucent=Io.prototype.isTranslucent;FA.prototype.getRenderState=Io.prototype.getRenderState;var gn=FA;function Lx(e){this._definitionChanged=new _e,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(Lx.prototype,{isConstant:{get:function(){return q.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:Ae("color")});Lx.prototype.getType=function(e){return"Color"};var BQe=new X;Lx.prototype.getValue=function(e,t){return l(e)||(e=X.now(BQe)),l(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,z.WHITE,t.color),t};Lx.prototype.equals=function(e){return this===e||e instanceof Lx&&q.equals(this._color,e._color)};var qt=Lx;function sy(e){e=e??V.EMPTY_OBJECT,this._ellipsoid=e.ellipsoid??te.default,this._rectangle=e.rectangle??ce.MAX_VALUE,this._projection=new Wi(this._ellipsoid),this._numberOfLevelZeroTilesX=e.numberOfLevelZeroTilesX??2,this._numberOfLevelZeroTilesY=e.numberOfLevelZeroTilesY??1}Object.defineProperties(sy.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});sy.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};sy.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};sy.prototype.rectangleToNativeRectangle=function(e,t){let n=D.toDegrees(e.west),i=D.toDegrees(e.south),o=D.toDegrees(e.east),r=D.toDegrees(e.north);return l(t)?(t.west=n,t.south=i,t.east=o,t.north=r,t):new ce(n,i,o,r)};sy.prototype.tileXYToNativeRectangle=function(e,t,n,i){let o=this.tileXYToRectangle(e,t,n,i);return o.west=D.toDegrees(o.west),o.south=D.toDegrees(o.south),o.east=D.toDegrees(o.east),o.north=D.toDegrees(o.north),o};sy.prototype.tileXYToRectangle=function(e,t,n,i){let o=this._rectangle,r=this.getNumberOfXTilesAtLevel(n),a=this.getNumberOfYTilesAtLevel(n),s=o.width/r,c=e*s+o.west,u=(e+1)*s+o.west,f=o.height/a,h=o.north-t*f,p=o.north-(t+1)*f;return l(i)||(i=new ce(c,p,u,h)),i.west=c,i.south=p,i.east=u,i.north=h,i};sy.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!ce.contains(i,e))return;let o=this.getNumberOfXTilesAtLevel(t),r=this.getNumberOfYTilesAtLevel(t),a=i.width/o,s=i.height/r,c=e.longitude;i.east<i.west&&(c+=D.TWO_PI);let u=(c-i.west)/a|0;u>=o&&(u=o-1);let f=(i.north-e.latitude)/s|0;return f>=r&&(f=r-1),l(n)?(n.x=u,n.y=f,n):new k(u,f)};var qi=sy;var Wse=new d,jse=new d,Yse=new me,C6=new d,DQe=new d,qse=new le,vQe=new qi,qR=[new me,new me,new me,new me],KR=new k,va={};va.initialize=function(){let e=va._initPromise;return l(e)||(e=De.fetchJson(Zt("Assets/approximateTerrainHeights.json")).then(function(t){va._terrainHeights=t}),va._initPromise=e),e};va.getMinimumMaximumHeights=function(e,t){t=t??te.default;let n=Kse(e),i=va._defaultMinTerrainHeight,o=va._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,a=va._terrainHeights[r];l(a)&&(i=a[0],o=a[1]),t.cartographicToCartesian(ce.northeast(e,Yse),Wse),t.cartographicToCartesian(ce.southwest(e,Yse),jse),d.midpoint(jse,Wse,C6);let s=t.scaleToGeodeticSurface(C6,DQe);if(l(s)){let c=d.distance(C6,s);i=Math.min(i,-c)}else i=va._defaultMinTerrainHeight}return i=Math.max(va._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:o}};va.getBoundingSphere=function(e,t){t=t??te.default;let n=Kse(e),i=va._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,a=va._terrainHeights[r];l(a)&&(i=a[1])}let o=le.fromRectangle3D(e,t,0);return le.fromRectangle3D(e,t,i,qse),le.union(o,qse,o)};function Kse(e){me.fromRadians(e.east,e.north,0,qR[0]),me.fromRadians(e.west,e.north,0,qR[1]),me.fromRadians(e.east,e.south,0,qR[2]),me.fromRadians(e.west,e.south,0,qR[3]);let t=0,n=0,i=0,o=0,r=va._terrainHeightsMaxLevel,a;for(a=0;a<=r;++a){let s=!1;for(let c=0;c<4;++c){let u=qR[c];if(vQe.positionToTileXY(u,a,KR),c===0)i=KR.x,o=KR.y;else if(i!==KR.x||o!==KR.y){s=!0;break}}if(s)break;t=i,n=o}if(a!==0)return{x:t,y:n,level:a>r?r:a-1}}va._terrainHeightsMaxLevel=6;va._defaultMaxTerrainHeight=9e3;va._defaultMinTerrainHeight=-1e5;va._terrainHeights=void 0;va._initPromise=void 0;Object.defineProperties(va,{initialized:{get:function(){return l(va._terrainHeights)}}});var Di=va;function tc(e,t,n){this.minimum=d.clone(e??d.ZERO),this.maximum=d.clone(t??d.ZERO),l(n)?n=d.clone(n):n=d.midpoint(this.minimum,this.maximum,new d),this.center=n}tc.fromCorners=function(e,t,n){return l(n)||(n=new tc),n.minimum=d.clone(e,n.minimum),n.maximum=d.clone(t,n.maximum),n.center=d.midpoint(e,t,n.center),n};tc.fromPoints=function(e,t){if(l(t)||(t=new tc),!l(e)||e.length===0)return t.minimum=d.clone(d.ZERO,t.minimum),t.maximum=d.clone(d.ZERO,t.maximum),t.center=d.clone(d.ZERO,t.center),t;let n=e[0].x,i=e[0].y,o=e[0].z,r=e[0].x,a=e[0].y,s=e[0].z,c=e.length;for(let h=1;h<c;h++){let p=e[h],A=p.x,m=p.y,_=p.z;n=Math.min(A,n),r=Math.max(A,r),i=Math.min(m,i),a=Math.max(m,a),o=Math.min(_,o),s=Math.max(_,s)}let u=t.minimum;u.x=n,u.y=i,u.z=o;let f=t.maximum;return f.x=r,f.y=a,f.z=s,t.center=d.midpoint(u,f,t.center),t};tc.clone=function(e,t){if(l(e))return l(t)?(t.minimum=d.clone(e.minimum,t.minimum),t.maximum=d.clone(e.maximum,t.maximum),t.center=d.clone(e.center,t.center),t):new tc(e.minimum,e.maximum,e.center)};tc.equals=function(e,t){return e===t||l(e)&&l(t)&&d.equals(e.center,t.center)&&d.equals(e.minimum,t.minimum)&&d.equals(e.maximum,t.maximum)};var uV=new d;tc.intersectPlane=function(e,t){uV=d.subtract(e.maximum,e.minimum,uV);let n=d.multiplyByScalar(uV,.5,uV),i=t.normal,o=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),r=d.dot(e.center,i)+t.distance;return r-o>0?Xt.INSIDE:r+o<0?Xt.OUTSIDE:Xt.INTERSECTING};tc.intersectAxisAlignedBoundingBox=function(e,t){return e.minimum.x<=t.maximum.x&&e.maximum.x>=t.minimum.x&&e.minimum.y<=t.maximum.y&&e.maximum.y>=t.minimum.y&&e.minimum.z<=t.maximum.z&&e.maximum.z>=t.minimum.z};tc.prototype.clone=function(e){return tc.clone(this,e)};tc.prototype.intersectPlane=function(e){return tc.intersectPlane(this,e)};tc.prototype.intersectAxisAlignedBoundingBox=function(e){return tc.intersectAxisAlignedBoundingBox(this,e)};tc.prototype.equals=function(e){return tc.equals(this,e)};var ff=tc;var E6=new ie;function up(e,t){t=t??te.default,e=t.scaleToGeodeticSurface(e);let n=At.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=d.fromCartesian4(M.getColumn(n,0,E6)),this._yAxis=d.fromCartesian4(M.getColumn(n,1,E6));let i=d.fromCartesian4(M.getColumn(n,2,E6));this._plane=cn.fromPointNormal(e,i)}Object.defineProperties(up.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 PQe=new ff;up.fromPoints=function(e,t){let n=ff.fromPoints(e,PQe);return new up(n.center,t)};var Xse=new yn,fV=new d;up.prototype.projectPointOntoPlane=function(e,t){let n=Xse;n.origin=e,d.normalize(e,n.direction);let i=di.rayPlane(n,this._plane,fV);if(l(i)||(d.negate(n.direction,n.direction),i=di.rayPlane(n,this._plane,fV)),l(i)){let o=d.subtract(i,this._origin,i),r=d.dot(this._xAxis,o),a=d.dot(this._yAxis,o);return l(t)?(t.x=r,t.y=a,t):new k(r,a)}};up.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};up.prototype.projectPointToNearestOnPlane=function(e,t){l(t)||(t=new k);let n=Xse;n.origin=e,d.clone(this._plane.normal,n.direction);let i=di.rayPlane(n,this._plane,fV);l(i)||(d.negate(n.direction,n.direction),i=di.rayPlane(n,this._plane,fV));let o=d.subtract(i,this._origin,i),r=d.dot(this._xAxis,o),a=d.dot(this._yAxis,o);return t.x=r,t.y=a,t};up.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 RQe=new d;up.prototype.projectPointOntoEllipsoid=function(e,t){l(t)||(t=new d);let n=this._ellipsoid,i=this._origin,o=this._xAxis,r=this._yAxis,a=RQe;return d.multiplyByScalar(o,e.x,a),t=d.add(i,a,t),d.multiplyByScalar(r,e.y,a),d.add(t,a,t),n.scaleToGeocentricSurface(t,t),t};up.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 Pa=up;function ro(e,t){this.center=d.clone(e??d.ZERO),this.halfAxes=J.clone(t??J.ZERO)}ro.packedLength=d.packedLength+J.packedLength;ro.pack=function(e,t,n){return n=n??0,d.pack(e.center,t,n),J.pack(e.halfAxes,t,n+d.packedLength),t};ro.unpack=function(e,t,n){return t=t??0,l(n)||(n=new ro),d.unpack(e,t,n.center),J.unpack(e,t+d.packedLength,n.halfAxes),n};var MQe=new d,NQe=new d,LQe=new d,OQe=new d,FQe=new d,QQe=new d,kQe=new J,UQe={unitary:new J,diagonal:new J};ro.fromPoints=function(e,t){if(l(t)||(t=new ro),!l(e)||e.length===0)return t.halfAxes=J.ZERO,t.center=d.ZERO,t;let n,i=e.length,o=d.clone(e[0],MQe);for(n=1;n<i;n++)d.add(o,e[n],o);let r=1/i;d.multiplyByScalar(o,r,o);let a=0,s=0,c=0,u=0,f=0,h=0,p;for(n=0;n<i;n++)p=d.subtract(e[n],o,NQe),a+=p.x*p.x,s+=p.x*p.y,c+=p.x*p.z,u+=p.y*p.y,f+=p.y*p.z,h+=p.z*p.z;a*=r,s*=r,c*=r,u*=r,f*=r,h*=r;let A=kQe;A[0]=a,A[1]=s,A[2]=c,A[3]=s,A[4]=u,A[5]=f,A[6]=c,A[7]=f,A[8]=h;let m=J.computeEigenDecomposition(A,UQe),_=J.clone(m.unitary,t.halfAxes),y=J.getColumn(_,0,OQe),C=J.getColumn(_,1,FQe),E=J.getColumn(_,2,QQe),b=-Number.MAX_VALUE,x=-Number.MAX_VALUE,S=-Number.MAX_VALUE,B=Number.MAX_VALUE,v=Number.MAX_VALUE,P=Number.MAX_VALUE;for(n=0;n<i;n++)p=e[n],b=Math.max(d.dot(y,p),b),x=Math.max(d.dot(C,p),x),S=Math.max(d.dot(E,p),S),B=Math.min(d.dot(y,p),B),v=Math.min(d.dot(C,p),v),P=Math.min(d.dot(E,p),P);y=d.multiplyByScalar(y,.5*(B+b),y),C=d.multiplyByScalar(C,.5*(v+x),C),E=d.multiplyByScalar(E,.5*(P+S),E);let N=d.add(y,C,t.center);d.add(N,E,N);let L=LQe;return L.x=b-B,L.y=x-v,L.z=S-P,d.multiplyByScalar(L,.5,L),J.multiplyByScale(t.halfAxes,L,t.halfAxes),t};var nce=new d,zQe=new d;function Jse(e,t,n,i,o,r,a,s,c,u,f){l(f)||(f=new ro);let h=f.halfAxes;J.setColumn(h,0,t,h),J.setColumn(h,1,n,h),J.setColumn(h,2,i,h);let p=nce;p.x=(o+r)/2,p.y=(a+s)/2,p.z=(c+u)/2;let A=zQe;A.x=(r-o)/2,A.y=(s-a)/2,A.z=(u-c)/2;let m=f.center;return p=J.multiplyByVector(h,p,p),d.add(e,p,m),J.multiplyByScale(h,A,h),f}var Zse=new me,GQe=new d,VQe=new me,HQe=new me,WQe=new me,jQe=new me,YQe=new me,qQe=new d,$se=new d,KQe=new d,ece=new d,XQe=new d,JQe=new k,ZQe=new k,$Qe=new k,e2e=new k,t2e=new k,n2e=new d,i2e=new d,o2e=new d,r2e=new d,a2e=new k,s2e=new d,c2e=new d,l2e=new d,u2e=new cn(d.UNIT_X,0);ro.fromRectangle=function(e,t,n,i,o){t=t??0,n=n??0,i=i??te.default;let r,a,s,c,u,f,h;if(e.width<=D.PI){let v=ce.center(e,Zse),P=i.cartographicToCartesian(v,GQe),N=new Pa(P,i);h=N.plane;let L=v.longitude,g=e.south<0&&e.north>0?0:v.latitude,I=me.fromRadians(L,e.north,n,VQe),T=me.fromRadians(e.west,e.north,n,HQe),w=me.fromRadians(e.west,g,n,WQe),R=me.fromRadians(e.west,e.south,n,jQe),O=me.fromRadians(L,e.south,n,YQe),G=i.cartographicToCartesian(I,qQe),F=i.cartographicToCartesian(T,$se),U=i.cartographicToCartesian(w,KQe),Q=i.cartographicToCartesian(R,ece),H=i.cartographicToCartesian(O,XQe),Y=N.projectPointToNearestOnPlane(G,JQe),$=N.projectPointToNearestOnPlane(F,ZQe),W=N.projectPointToNearestOnPlane(U,$Qe),K=N.projectPointToNearestOnPlane(Q,e2e),Z=N.projectPointToNearestOnPlane(H,t2e);return r=Math.min($.x,W.x,K.x),a=-r,c=Math.max($.y,Y.y),s=Math.min(K.y,Z.y),T.height=R.height=t,F=i.cartographicToCartesian(T,$se),Q=i.cartographicToCartesian(R,ece),u=Math.min(cn.getPointDistance(h,F),cn.getPointDistance(h,Q)),f=n,Jse(N.origin,N.xAxis,N.yAxis,N.zAxis,r,a,s,c,u,f,o)}let p=e.south>0,A=e.north<0,m=p?e.south:A?e.north:0,_=ce.center(e,Zse).longitude,y=d.fromRadians(_,m,n,i,n2e);y.z=0;let E=Math.abs(y.x)<D.EPSILON10&&Math.abs(y.y)<D.EPSILON10?d.UNIT_X:d.normalize(y,i2e),b=d.UNIT_Z,x=d.cross(E,b,o2e);h=cn.fromPointNormal(y,E,u2e);let S=d.fromRadians(_+D.PI_OVER_TWO,m,n,i,r2e);a=d.dot(cn.projectPointOntoPlane(h,S,a2e),x),r=-a,c=d.fromRadians(0,e.north,A?t:n,i,s2e).z,s=d.fromRadians(0,e.south,p?t:n,i,c2e).z;let B=d.fromRadians(e.east,m,n,i,l2e);return u=cn.getPointDistance(h,B),f=0,Jse(y,x,b,E,r,a,s,c,u,f,o)};ro.fromTransformation=function(e,t){return l(t)||(t=new ro),t.center=M.getTranslation(e,t.center),t.halfAxes=M.getMatrix3(e,t.halfAxes),t.halfAxes=J.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t};ro.clone=function(e,t){if(l(e))return l(t)?(d.clone(e.center,t.center),J.clone(e.halfAxes,t.halfAxes),t):new ro(e.center,e.halfAxes)};ro.intersectPlane=function(e,t){let n=e.center,i=t.normal,o=e.halfAxes,r=i.x,a=i.y,s=i.z,c=Math.abs(r*o[J.COLUMN0ROW0]+a*o[J.COLUMN0ROW1]+s*o[J.COLUMN0ROW2])+Math.abs(r*o[J.COLUMN1ROW0]+a*o[J.COLUMN1ROW1]+s*o[J.COLUMN1ROW2])+Math.abs(r*o[J.COLUMN2ROW0]+a*o[J.COLUMN2ROW1]+s*o[J.COLUMN2ROW2]),u=d.dot(i,n)+t.distance;return u<=-c?Xt.OUTSIDE:u>=c?Xt.INSIDE:Xt.INTERSECTING};var ice=new d,oce=new d,rce=new d,f2e=new d,tce=new d,d2e=new d;ro.distanceSquaredTo=function(e,t){let n=d.subtract(t,e.center,nce),i=e.halfAxes,o=J.getColumn(i,0,ice),r=J.getColumn(i,1,oce),a=J.getColumn(i,2,rce),s=d.magnitude(o),c=d.magnitude(r),u=d.magnitude(a),f=!0,h=!0,p=!0;s>0?d.divideByScalar(o,s,o):f=!1,c>0?d.divideByScalar(r,c,r):h=!1,u>0?d.divideByScalar(a,u,a):p=!1;let A=!f+!h+!p,m,_,y;if(A===1){let x=o;m=r,_=a,h?p||(x=a,_=o):(x=r,m=o),y=d.cross(m,_,tce),x===o?o=y:x===r?r=y:x===a&&(a=y)}else if(A===2){m=o,h?m=r:p&&(m=a);let x=d.UNIT_Y;x.equalsEpsilon(m,D.EPSILON3)&&(x=d.UNIT_X),_=d.cross(m,x,f2e),d.normalize(_,_),y=d.cross(m,_,tce),d.normalize(y,y),m===o?(r=_,a=y):m===r?(a=_,o=y):m===a&&(o=_,r=y)}else A===3&&(o=d.UNIT_X,r=d.UNIT_Y,a=d.UNIT_Z);let C=d2e;C.x=d.dot(n,o),C.y=d.dot(n,r),C.z=d.dot(n,a);let E=0,b;return C.x<-s?(b=C.x+s,E+=b*b):C.x>s&&(b=C.x-s,E+=b*b),C.y<-c?(b=C.y+c,E+=b*b):C.y>c&&(b=C.y-c,E+=b*b),C.z<-u?(b=C.z+u,E+=b*b):C.z>u&&(b=C.z-u,E+=b*b),E};var h2e=new d,m2e=new d;ro.computePlaneDistances=function(e,t,n,i){l(i)||(i=new qr);let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=e.center,s=e.halfAxes,c=J.getColumn(s,0,ice),u=J.getColumn(s,1,oce),f=J.getColumn(s,2,rce),h=d.add(c,u,h2e);d.add(h,f,h),d.add(h,a,h);let p=d.subtract(h,t,m2e),A=d.dot(n,p);return o=Math.min(A,o),r=Math.max(A,r),d.add(a,c,h),d.add(h,u,h),d.subtract(h,f,h),d.subtract(h,t,p),A=d.dot(n,p),o=Math.min(A,o),r=Math.max(A,r),d.add(a,c,h),d.subtract(h,u,h),d.add(h,f,h),d.subtract(h,t,p),A=d.dot(n,p),o=Math.min(A,o),r=Math.max(A,r),d.add(a,c,h),d.subtract(h,u,h),d.subtract(h,f,h),d.subtract(h,t,p),A=d.dot(n,p),o=Math.min(A,o),r=Math.max(A,r),d.subtract(a,c,h),d.add(h,u,h),d.add(h,f,h),d.subtract(h,t,p),A=d.dot(n,p),o=Math.min(A,o),r=Math.max(A,r),d.subtract(a,c,h),d.add(h,u,h),d.subtract(h,f,h),d.subtract(h,t,p),A=d.dot(n,p),o=Math.min(A,o),r=Math.max(A,r),d.subtract(a,c,h),d.subtract(h,u,h),d.add(h,f,h),d.subtract(h,t,p),A=d.dot(n,p),o=Math.min(A,o),r=Math.max(A,r),d.subtract(a,c,h),d.subtract(h,u,h),d.subtract(h,f,h),d.subtract(h,t,p),A=d.dot(n,p),o=Math.min(A,o),r=Math.max(A,r),i.start=o,i.stop=r,i};var p2e=new d,A2e=new d,g2e=new d;ro.computeCorners=function(e,t){l(t)||(t=[new d,new d,new d,new d,new d,new d,new d,new d]);let n=e.center,i=e.halfAxes,o=J.getColumn(i,0,p2e),r=J.getColumn(i,1,A2e),a=J.getColumn(i,2,g2e);return d.clone(n,t[0]),d.subtract(t[0],o,t[0]),d.subtract(t[0],r,t[0]),d.subtract(t[0],a,t[0]),d.clone(n,t[1]),d.subtract(t[1],o,t[1]),d.subtract(t[1],r,t[1]),d.add(t[1],a,t[1]),d.clone(n,t[2]),d.subtract(t[2],o,t[2]),d.add(t[2],r,t[2]),d.subtract(t[2],a,t[2]),d.clone(n,t[3]),d.subtract(t[3],o,t[3]),d.add(t[3],r,t[3]),d.add(t[3],a,t[3]),d.clone(n,t[4]),d.add(t[4],o,t[4]),d.subtract(t[4],r,t[4]),d.subtract(t[4],a,t[4]),d.clone(n,t[5]),d.add(t[5],o,t[5]),d.subtract(t[5],r,t[5]),d.add(t[5],a,t[5]),d.clone(n,t[6]),d.add(t[6],o,t[6]),d.add(t[6],r,t[6]),d.subtract(t[6],a,t[6]),d.clone(n,t[7]),d.add(t[7],o,t[7]),d.add(t[7],r,t[7]),d.add(t[7],a,t[7]),t};var _2e=new J;ro.computeTransformation=function(e,t){l(t)||(t=new M);let n=e.center,i=J.multiplyByUniformScale(e.halfAxes,2,_2e);return M.fromRotationTranslation(i,n,t)};var y2e=new le;ro.isOccluded=function(e,t){let n=le.fromOrientedBoundingBox(e,y2e);return!t.isBoundingSphereVisible(n)};ro.prototype.intersectPlane=function(e){return ro.intersectPlane(this,e)};ro.prototype.distanceSquaredTo=function(e){return ro.distanceSquaredTo(this,e)};ro.prototype.computePlaneDistances=function(e,t,n){return ro.computePlaneDistances(this,e,t,n)};ro.prototype.computeCorners=function(e){return ro.computeCorners(this,e)};ro.prototype.computeTransformation=function(e){return ro.computeTransformation(this,e)};ro.prototype.isOccluded=function(e){return ro.isOccluded(this,e)};ro.equals=function(e,t){return e===t||l(e)&&l(t)&&d.equals(e.center,t.center)&&J.equals(e.halfAxes,t.halfAxes)};ro.prototype.clone=function(e){return ro.clone(this,e)};ro.prototype.equals=function(e){return ro.equals(this,e)};var en=ro;var dV={};dV.getHeight=function(e,t,n){return(e-n)*t+n};var C2e=new me;dV.getPosition=function(e,t,n,i,o){let r=t.cartesianToCartographic(e,C2e);if(!l(r))return d.clone(e,o);let a=dV.getHeight(r.height,n,i);return d.fromRadians(r.longitude,r.latitude,a,t,o)};var xo=dV;var XR=`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 cy=`#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 ace={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};ace.NUMBER_OF_CLASSIFICATION_TYPES=3;var ei=Object.freeze(ace);var E2e={NEVER:ee.NEVER,LESS:ee.LESS,EQUAL:ee.EQUAL,LESS_OR_EQUAL:ee.LEQUAL,GREATER:ee.GREATER,NOT_EQUAL:ee.NOTEQUAL,GREATER_OR_EQUAL:ee.GEQUAL,ALWAYS:ee.ALWAYS},nc=Object.freeze(E2e);function b2e(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 JR=b2e;function QA(e,t,n){if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;let i=I2e(t),o=e.floatingPointTexture,r=i===He.FLOAT&&!o,a=x2e(t,r),s=T2e(a,t,r),c=Math.floor(Rt.maximumTextureSize/s),u=Math.min(n,c),f=s*u,h=Math.ceil(n/u),p=1/f,A=p*.5,m=1/h,_=m*.5;this._textureDimensions=new k(f,h),this._textureStep=new ie(p,A,m,_),this._pixelDatatype=r?He.UNSIGNED_BYTE:i,this._packFloats=r,this._offsets=a,this._stride=s,this._texture=void 0;let y=4*f*h;this._batchValues=i===He.FLOAT&&!r?new Float32Array(y):new Uint8Array(y),this._batchValuesDirty=!1}Object.defineProperties(QA.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function I2e(e){let t=!1,n=e.length;for(let i=0;i<n;++i)if(e[i].componentDatatype!==j.UNSIGNED_BYTE){t=!0;break}return t?He.FLOAT:He.UNSIGNED_BYTE}function cce(e,t){let n=e[t].componentsPerAttribute;return n===2?k:n===3?d:n===4?ie:Number}function x2e(e,t){let n=new Array(e.length),i=0,o=e.length;for(let r=0;r<o;++r){let s=e[r].componentDatatype;n[r]=i,s!==j.UNSIGNED_BYTE&&t?i+=4:++i}return n}function T2e(e,t,n){let i=e.length,o=e[i-1];return t[i-1].componentDatatype!==j.UNSIGNED_BYTE&&n?o+4:o+1}var ZR=new ie;function S2e(e,t,n){let i=ie.unpack(e,t,ZR),o=ie.unpackFloat(i);i=ie.unpack(e,t+4,ZR);let r=ie.unpackFloat(i);i=ie.unpack(e,t+8,ZR);let a=ie.unpackFloat(i);i=ie.unpack(e,t+12,ZR);let s=ie.unpackFloat(i);return ie.fromElements(o,r,a,s,n)}function w2e(e,t,n){let i=ie.packFloat(e.x,ZR);ie.pack(i,t,n),i=ie.packFloat(e.y,i),ie.pack(i,t,n+4),i=ie.packFloat(e.z,i),ie.pack(i,t,n+8),i=ie.packFloat(e.w,i),ie.pack(i,t,n+12)}var sce=new ie;QA.prototype.getBatchedAttribute=function(e,t,n){let i=this._attributes,o=this._offsets[t],a=4*this._stride*e+4*o,s;this._packFloats&&i[t].componentDatatype!==He.UNSIGNED_BYTE?s=S2e(this._batchValues,a,sce):s=ie.unpack(this._batchValues,a,sce);let c=cce(i,t);return l(c.fromCartesian4)?c.fromCartesian4(s,n):l(c.clone)?c.clone(s,n):s.x};var B2e=[void 0,void 0,new k,new d,new ie],D2e=new ie;QA.prototype.setBatchedAttribute=function(e,t,n){let i=this._attributes,o=B2e[i[t].componentsPerAttribute],r=this.getBatchedAttribute(e,t,o),a=cce(this._attributes,t);if(l(a.equals)?a.equals(r,n):r===n)return;let c=D2e;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 u=this._offsets[t],h=4*this._stride*e+4*u;this._packFloats&&i[t].componentDatatype!==He.UNSIGNED_BYTE?w2e(c,this._batchValues,h):ie.pack(c,this._batchValues,h),this._batchValuesDirty=!0};function v2e(e,t){let n=e._textureDimensions;e._texture=new Dt({context:t,pixelFormat:qe.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:jt.NEAREST,flipY:!1})}function P2e(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}QA.prototype.update=function(e){l(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,l(this._texture)||v2e(this,e.context),P2e(this))};QA.prototype.getUniformMapCallback=function(){let e=this;return function(t){return e._attributes.length===0?t:Pt(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}};function R2e(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 M2e(e){return e===1?"float":`vec${e}`}function N2e(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function L2e(e,t){let i=e._attributes[t],o=i.componentsPerAttribute,r=i.functionName,a=M2e(o),s=N2e(o),c=e._offsets[t],u=`${a} ${r}(float batchId)
{
vec2 st = computeSt(batchId);
st.x += batchTextureStep.x * float(${c});
`;return e._packFloats&&i.componentDatatype!==He.UNSIGNED_BYTE?u+=`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)));
`:u+=` vec4 textureValue = texture(batchTexture, st);
`,u+=` ${a} value = textureValue${s};
`,e._pixelDatatype===He.UNSIGNED_BYTE&&i.componentDatatype===j.UNSIGNED_BYTE&&!i.normalize?u+=`value *= 255.0;
`:e._pixelDatatype===He.FLOAT&&i.componentDatatype===j.UNSIGNED_BYTE&&i.normalize&&(u+=`value /= 255.0;
`),u+=` return value;
}
`,u}QA.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture;
`;t+=`${R2e(this)}
`;let n=e.length;for(let i=0;i<n;++i)t+=L2e(this,i);return function(i){let o=i.indexOf("void main"),r=i.substring(0,o),a=i.substring(o);return`${r}
${t}
${a}`}};QA.prototype.isDestroyed=function(){return!1};QA.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),fe(this)};var UE=QA;function bu(e){this._ellipsoid=e??te.WGS84,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(bu.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});bu.mercatorAngleToGeodeticLatitude=function(e){return D.PI_OVER_TWO-2*Math.atan(Math.exp(-e))};bu.geodeticLatitudeToMercatorAngle=function(e){e>bu.MaximumLatitude?e=bu.MaximumLatitude:e<-bu.MaximumLatitude&&(e=-bu.MaximumLatitude);let t=Math.sin(e);return .5*Math.log((1+t)/(1-t))};bu.MaximumLatitude=bu.mercatorAngleToGeodeticLatitude(Math.PI);bu.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=bu.geodeticLatitudeToMercatorAngle(e.latitude)*n,r=e.height;return l(t)?(t.x=i,t.y=o,t.z=r,t):new d(i,o,r)};bu.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,o=bu.mercatorAngleToGeodeticLatitude(e.y*n),r=e.z;return l(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new me(i,o,r)};var mi=bu;function O2e(e,t,n){let i=!n,o=e.length,r;if(!i&&o>1){let a=e[0].modelMatrix;for(r=1;r<o;++r)if(!M.equals(a,e[r].modelMatrix)){i=!0;break}}if(i)for(r=0;r<o;++r)l(e[r].geometry)&&Wn.transformToWorldCoordinates(e[r]);else M.multiplyTransformation(t,e[0].modelMatrix,t)}function b6(e,t){let n=e.attributes,i=n.position,o=i.values.length/i.componentsPerAttribute;n.batchId=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:1,values:new Float32Array(o)});let r=n.batchId.values;for(let a=0;a<o;++a)r[a]=t}function F2e(e){let t=e.length;for(let n=0;n<t;++n){let i=e[n];l(i.geometry)?b6(i.geometry,n):l(i.westHemisphereGeometry)&&l(i.eastHemisphereGeometry)&&(b6(i.westHemisphereGeometry,n),b6(i.eastHemisphereGeometry,n))}}function Q2e(e){let t=e.instances,n=e.projection,i=e.elementIndexUintSupported,o=e.scene3DOnly,r=e.vertexCacheOptimize,a=e.compressVertices,s=e.modelMatrix,c,u,f,h=t.length;for(c=0;c<h;++c)if(l(t[c].geometry)){f=t[c].geometry.primitiveType;break}if(O2e(t,s,o),!o)for(c=0;c<h;++c)l(t[c].geometry)&&Wn.splitLongitude(t[c]);if(F2e(t),r)for(c=0;c<h;++c){let A=t[c];l(A.geometry)?(Wn.reorderForPostVertexCache(A.geometry),Wn.reorderForPreVertexCache(A.geometry)):l(A.westHemisphereGeometry)&&l(A.eastHemisphereGeometry)&&(Wn.reorderForPostVertexCache(A.westHemisphereGeometry),Wn.reorderForPreVertexCache(A.westHemisphereGeometry),Wn.reorderForPostVertexCache(A.eastHemisphereGeometry),Wn.reorderForPreVertexCache(A.eastHemisphereGeometry))}let p=Wn.combineInstances(t);for(h=p.length,c=0;c<h;++c){u=p[c];let A=u.attributes;if(o)for(let m in A)A.hasOwnProperty(m)&&A[m].componentDatatype===j.DOUBLE&&Wn.encodeAttribute(u,m,`${m}3DHigh`,`${m}3DLow`);else for(let m in A)if(A.hasOwnProperty(m)&&A[m].componentDatatype===j.DOUBLE){let _=`${m}3D`,y=`${m}2D`;Wn.projectTo2D(u,m,_,y,n),l(u.boundingSphere)&&m==="position"&&(u.boundingSphereCV=le.fromVertices(u.attributes.position2D.values)),Wn.encodeAttribute(u,_,`${_}High`,`${_}Low`),Wn.encodeAttribute(u,y,`${y}High`,`${y}Low`)}a&&Wn.compressVertices(u)}if(!i){let A=[];for(h=p.length,c=0;c<h;++c)u=p[c],A=A.concat(Wn.fitToUnsignedShortIndices(u));p=A}return p}function I6(e,t,n,i){let o,r,a,s=i.length-1;if(s>=0){let u=i[s];o=u.offset+u.count,a=u.index,r=n[a].indices.length}else o=0,a=0,r=n[a].indices.length;let c=e.length;for(let u=0;u<c;++u){let h=e[u][t];if(!l(h))continue;let p=h.indices.length;o+p>r&&(o=0,r=n[++a].indices.length),i.push({index:a,offset:o,count:p}),o+=p}}function k2e(e,t){let n=[];return I6(e,"geometry",t,n),I6(e,"westHemisphereGeometry",t,n),I6(e,"eastHemisphereGeometry",t,n),n}var kA={};kA.combineGeometry=function(e){let t,n,i=e.instances,o=i.length,r,a,s=!1;o>0&&(t=Q2e(e),t.length>0&&(n=Wn.createAttributeLocations(t[0]),e.createPickOffsets&&(r=k2e(i,t))),l(i[0].attributes)&&l(i[0].attributes.offset)&&(a=new Array(o),s=!0));let c=new Array(o),u=new Array(o);for(let f=0;f<o;++f){let h=i[f],p=h.geometry;l(p)&&(c[f]=p.boundingSphere,u[f]=p.boundingSphereCV,s&&(a[f]=h.geometry.offsetAttribute));let A=h.eastHemisphereGeometry,m=h.westHemisphereGeometry;l(A)&&l(m)&&(l(A.boundingSphere)&&l(m.boundingSphere)&&(c[f]=le.union(A.boundingSphere,m.boundingSphere)),l(A.boundingSphereCV)&&l(m.boundingSphereCV)&&(u[f]=le.union(A.boundingSphereCV,m.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:r,offsetInstanceExtend:a,boundingSpheres:c,boundingSpheresCV:u}};function U2e(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 z2e(e,t){let n=e.length;for(let i=0;i<n;++i)U2e(e[i],t)}function G2e(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*le.packedLength+(l(o.indices)?o.indices.length:0);for(let a in r)if(r.hasOwnProperty(a)&&l(r[a])){let s=r[a];t+=5+s.values.length}}return t}kA.packCreateGeometryResults=function(e,t){let n=new Float64Array(G2e(e)),i=[],o={},r=e.length,a=0;n[a++]=r;for(let s=0;s<r;s++){let c=e[s],u=l(c);if(n[a++]=u?1:0,!u)continue;n[a++]=c.primitiveType,n[a++]=c.geometryType,n[a++]=c.offsetAttribute??-1;let f=l(c.boundingSphere)?1:0;n[a++]=f,f&&le.pack(c.boundingSphere,n,a),a+=le.packedLength;let h=l(c.boundingSphereCV)?1:0;n[a++]=h,h&&le.pack(c.boundingSphereCV,n,a),a+=le.packedLength;let p=c.attributes,A=[];for(let _ in p)p.hasOwnProperty(_)&&l(p[_])&&(A.push(_),l(o[_])||(o[_]=i.length,i.push(_)));n[a++]=A.length;for(let _=0;_<A.length;_++){let y=A[_],C=p[y];n[a++]=o[y],n[a++]=C.componentDatatype,n[a++]=C.componentsPerAttribute,n[a++]=C.normalize?1:0,n[a++]=C.values.length,n.set(C.values,a),a+=C.values.length}let m=l(c.indices)?c.indices.length:0;n[a++]=m,m>0&&(n.set(c.indices,a),a+=m)}return t.push(n.buffer),{stringTable:i,packedData:n}};kA.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,o=new Array(n[0]),r=0,a=1;for(;a<n.length;){if(!(n[a++]===1)){o[r++]=void 0;continue}let c=n[a++],u=n[a++],f=n[a++];f===-1&&(f=void 0);let h,p;n[a++]===1&&(h=le.unpack(n,a)),a+=le.packedLength,n[a++]===1&&(p=le.unpack(n,a)),a+=le.packedLength;let _,y,C,E=new _n,b=n[a++];for(i=0;i<b;i++){let S=t[n[a++]],B=n[a++];C=n[a++];let v=n[a++]!==0;_=n[a++],y=j.createTypedArray(B,_);for(let P=0;P<_;P++)y[P]=n[a++];E[S]=new Me({componentDatatype:B,componentsPerAttribute:C,normalize:v,values:y})}let x;if(_=n[a++],_>0){let S=y.length/C;for(x=Ue.createTypedArray(S,_),i=0;i<_;i++)x[i]=n[a++]}o[r++]=new yt({primitiveType:c,geometryType:u,boundingSphere:h,boundingSphereCV:p,indices:x,attributes:E,offsetAttribute:f})}return o};function V2e(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 a=e[r];if(M.pack(a.modelMatrix,i,o),o+=M.packedLength,l(a.attributes)&&l(a.attributes.offset)){let s=a.attributes.offset.value;i[o]=s[0],i[o+1]=s[1],i[o+2]=s[2]}o+=3}return t.push(i.buffer),i}function H2e(e){let t=e,n=new Array(t[0]),i=0,o=1;for(;o<t.length;){let r=M.unpack(t,o),a;o+=M.packedLength,l(t[o])&&(a={offset:new go(t[o],t[o+1],t[o+2])}),o+=3,n[i++]={modelMatrix:r,attributes:a}}return n}kA.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:V2e(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof Wi,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};kA.unpackCombineGeometryParameters=function(e){let t=H2e(e.packedInstances),n=e.createGeometryResults,i=n.length,o=0;for(let s=0;s<i;s++){let c=kA.unpackCreateGeometryResults(n[s]),u=c.length;for(let f=0;f<u;f++){let h=c[f],p=t[o];p.geometry=h,++o}}let r=te.clone(e.ellipsoid),a=e.isGeographic?new Wi(r):new mi(r);return{instances:t,ellipsoid:r,projection:a,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:M.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function lce(e){let t=e.length,n=1+(le.packedLength+1)*t,i=new Float32Array(n),o=0;i[o++]=t;for(let r=0;r<t;++r){let a=e[r];l(a)?(i[o++]=1,le.pack(e[r],i,o)):i[o++]=0,o+=le.packedLength}return i}function uce(e){let t=new Array(e[0]),n=0,i=1;for(;i<e.length;)e[i++]===1&&(t[n]=le.unpack(e,i)),++n,i+=le.packedLength;return t}kA.packCombineGeometryResults=function(e,t){l(e.geometries)&&z2e(e.geometries,t);let n=lce(e.boundingSpheres),i=lce(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}};kA.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:uce(e.boundingSpheres),boundingSpheresCV:uce(e.boundingSpheresCV)}};var zE=kA;var W2e={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6},Jr=Object.freeze(W2e);var df={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};df.NUMBER_OF_SHADOW_MODES=4;df.castShadows=function(e){return e===df.ENABLED||e===df.CAST_ONLY};df.receiveShadows=function(e){return e===df.ENABLED||e===df.RECEIVE_ONLY};df.fromCastReceive=function(e,t){return e&&t?df.ENABLED:e?df.CAST_ONLY:t?df.RECEIVE_ONLY:df.DISABLED};var wn=Object.freeze(df);function Zr(e){e=e??V.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=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=new M,this.show=e.show??!0,this._vertexCacheOptimize=e.vertexCacheOptimize??!1,this._interleave=e.interleave??!1,this._releaseGeometryInstances=e.releaseGeometryInstances??!0,this._allowPicking=e.allowPicking??!0,this._asynchronous=e.asynchronous??!0,this._compressVertices=e.compressVertices??!0,this.cull=e.cull??!0,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.rtcCenter=e.rtcCenter,this.shadows=e.shadows??wn.DISABLED,this._translucent=void 0,this._state=Jr.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(Zr.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 j2e(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],a=!0;for(let s=1;s<t;++s){let c=e[s].attributes[o];if(!l(c)||r.componentDatatype!==c.componentDatatype||r.componentsPerAttribute!==c.componentsPerAttribute||r.normalize!==c.normalize){a=!1;break}}a&&n.push(o)}return n}var Y2e=new k,q2e=new d,yce=new ie;function Cce(e){let t=e.length;if(t===1)return e[0];if(t===2)return k.unpack(e,0,Y2e);if(t===3)return d.unpack(e,0,q2e);if(t===4)return ie.unpack(e,0,yce)}function K2e(e,t){let n=e.geometryInstances,i=Array.isArray(n)?n:[n],o=i.length;if(o===0)return;let r=j2e(i),a=r.length,s=[],c={},u={},f,p=i[0].attributes,A,m,_;for(A=0;A<a;++A)m=r[A],_=p[m],c[m]=A,s.push({functionName:`czm_batchTable_${m}`,componentDatatype:_.componentDatatype,componentsPerAttribute:_.componentsPerAttribute,normalize:_.normalize});r.indexOf("distanceDisplayCondition")!==-1&&(s.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:j.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:j.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:j.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:j.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:j.FLOAT,componentsPerAttribute:1}),u.center3DHigh=s.length-5,u.center3DLow=s.length-4,u.center2DHigh=s.length-3,u.center2DLow=s.length-2,u.radius=s.length-1),r.indexOf("offset")!==-1&&(s.push({functionName:"czm_batchTable_offset2D",componentDatatype:j.FLOAT,componentsPerAttribute:3}),f=s.length-1),s.push({functionName:"czm_batchTable_pickColor",componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});let y=s.length,C=new UE(t,s,o);for(A=0;A<o;++A){let E=i[A];p=E.attributes;for(let v=0;v<a;++v){m=r[v],_=p[m];let P=Cce(_.value),N=c[m];C.setBatchedAttribute(A,N,P)}let b={primitive:E.pickPrimitive??e};l(E.id)&&(b.id=E.id);let x=t.createPickId(b);e._pickIds.push(x);let S=x.color,B=yce;B.x=z.floatToByte(S.red),B.y=z.floatToByte(S.green),B.z=z.floatToByte(S.blue),B.w=z.floatToByte(S.alpha),C.setBatchedAttribute(A,y-1,B)}e._batchTable=C,e._batchTableAttributeIndices=c,e._batchTableBoundingSphereAttributeIndices=u,e._batchTableOffsetAttribute2DIndex=f}function X2e(e){let t;return Array.isArray(e.values)?t=e.values.slice(0):t=new e.values.constructor(e.values),new Me({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function J2e(e){let t=e.attributes,n=new _n;for(let o in t)t.hasOwnProperty(o)&&l(t[o])&&(n[o]=X2e(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 yt({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:le.clone(e.boundingSphere)})}function Z2e(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:M.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var $2e=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;Zr._modifyShaderPosition=function(e,t,n){let i,o="",r="",a="";for(;(i=$2e.exec(t))!==null;){let s=i[1],c=`vec4 czm_compute${s[0].toUpperCase()}${s.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;
`,a+=`${c}
{
return u_modifiedModelView * position;
}
`,t=t.replace(/czm_modelViewRelativeToEye\s+\*\s+/g,""),t=t.replace(/czm_modelViewProjectionRelativeToEye/g,"czm_projection")):n?a+=`${c}
{
return czm_translateRelativeToEye(${s}3DHigh, ${s}3DLow);
}
`:(r+=`in vec3 ${s}2DHigh;
in vec3 ${s}2DLow;
`,a+=`${c}
{
vec4 p;
if (czm_morphTime == 1.0)
{
p = czm_translateRelativeToEye(${s}3DHigh, ${s}3DLow);
}
else if (czm_morphTime == 0.0)
{
p = czm_translateRelativeToEye(${s}2DHigh.zxy, ${s}2DLow.zxy);
}
else
{
p = czm_columbusViewMorph(
czm_translateRelativeToEye(${s}2DHigh.zxy, ${s}2DLow.zxy),
czm_translateRelativeToEye(${s}3DHigh, ${s}3DLow),
czm_morphTime);
}
return p;
}
`)}return[o,r,t,a].join(`
`)};Zr._appendShowToShader=function(e,t){return l(e._batchTableAttributeIndices.show)?`${We.replaceMain(t,"czm_non_show_main")}
void main()
{
czm_non_show_main();
gl_Position *= czm_batchTable_show(batchId);
}`:t};Zr._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 fce(e){return`${We.replaceMain(e,"czm_non_pick_main")}
out vec4 v_pickColor;
void main()
{
czm_non_pick_main();
v_pickColor = czm_batchTable_pickColor(batchId);
}`}function dce(e){return`in vec4 v_pickColor;
${e}`}Zr._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};Zr._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};Zr._appendDistanceDisplayConditionToShader=function(e,t,n){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition))return t;let i=We.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 hce(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,a=i&&n?2:1;a+=o||r?1:0;let s=a>1?`vec${a}`:"float",c="compressedAttributes",u=`in ${s} ${c};`,f="",h="";if(i){f+=`vec2 st;
`;let m=a>1?`${c}.x`:c;h+=` st = czm_decompressTextureCoordinates(${m});
`}n&&o&&r?(f+=`vec3 normal;
vec3 tangent;
vec3 bitangent;
`,h+=` czm_octDecode(${c}.${i?"yz":"xy"}, normal, tangent, bitangent);
`):(n&&(f+=`vec3 normal;
`,h+=` normal = czm_octDecode(${c}${a>1?`.${i?"y":"x"}`:""});
`),o&&(f+=`vec3 tangent;
`,h+=` tangent = czm_octDecode(${c}.${i&&n?"z":"y"});
`),r&&(f+=`vec3 bitangent;
`,h+=` 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=We.replaceMain(p,"czm_non_compressed_main");let A=`void main()
{
${h} czm_non_compressed_main();
}`;return[u,f,p,A].join(`
`)}function eke(e){let t=We.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() {
czm_non_depth_clamp_main();
gl_Position = czm_depthClamp(gl_Position);}
`,t}function tke(e){let t=We.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 mce(e,t){let n=e.vertexAttributes}function nke(e,t){return function(){return e[t]}}var x6=Math.max(fn.hardwareConcurrency-1,1),hV,ike=new Zn("combineGeometry");function oke(e,t){let n,i,o,r,a=e._instanceIds;if(e._state===Jr.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let s=e._numberOfInstances=n.length,c=[],u=[];for(o=0;o<s;++o)i=n[o].geometry,a.push(n[o].id),u.push({moduleName:i._workerName,modulePath:i._workerPath,geometry:i});if(!l(hV))for(hV=new Array(x6),o=0;o<x6;o++)hV[o]=new Zn("createGeometry");let f;for(u=JR(u,x6),o=0;o<u.length;o++){let h=0,p=u[o],A=p.length;for(r=0;r<A;++r)f=p[r],i=f.geometry,l(i.constructor.pack)&&(f.offset=h,h+=i.constructor.packedLength??i.packedLength);let m;if(h>0){let _=new Float64Array(h);for(m=[_.buffer],r=0;r<A;++r)f=p[r],i=f.geometry,l(i.constructor.pack)&&(i.constructor.pack(i,_,f.offset),f.geometry=_)}c.push(hV[o].scheduleTask({subTasks:u[o]},m))}e._state=Jr.CREATING,Promise.all(c).then(function(h){e._createGeometryResults=h,e._state=Jr.CREATED}).catch(function(h){eM(e,t,Jr.FAILED,h)})}else if(e._state===Jr.CREATED){let s=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let c=t.scene3DOnly,u=t.mapProjection,f=ike.scheduleTask(zE.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:n,ellipsoid:u.ellipsoid,projection:u,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:c,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},s),s);e._createGeometryResults=void 0,e._state=Jr.COMBINING,Promise.resolve(f).then(function(h){let p=zE.unpackCombineGeometryResults(h);e._geometries=p.geometries,e._attributeLocations=p.attributeLocations,e.modelMatrix=M.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=Jr.COMBINED):eM(e,t,Jr.FAILED,void 0)}).catch(function(h){eM(e,t,Jr.FAILED,h)})}}function rke(e,t){let n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,o=new Array(i),r=e._instanceIds,a,s,c=0;for(s=0;s<i;s++){a=n[s];let p=a.geometry,A;l(p.attributes)&&l(p.primitiveType)?A=J2e(p):A=p.constructor.createGeometry(p),o[c++]=Z2e(a,A),r.push(a.id)}o.length=c;let u=t.scene3DOnly,f=t.mapProjection,h=zE.combineGeometry({instances:o,ellipsoid:f.ellipsoid,projection:f,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:u,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=h.geometries,e._attributeLocations=h.attributeLocations,e.modelMatrix=M.clone(h.modelMatrix,e.modelMatrix),e._pickOffsets=h.pickOffsets,e._offsetInstanceExtend=h.offsetInstanceExtend,e._instanceBoundingSpheres=h.boundingSpheres,e._instanceBoundingSpheresCV=h.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=Jr.COMBINED):eM(e,t,Jr.FAILED,void 0)}function ake(e,t){let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!l(n)){e._recomputeBoundingSpheres=!1;return}let i,o=e._offsetInstanceExtend,r=e._instanceBoundingSpheres,a=r.length,s=e._tempBoundingSpheres;if(!l(s)){for(s=new Array(a),i=0;i<a;i++)s[i]=new le;e._tempBoundingSpheres=s}for(i=0;i<a;++i){let _=s[i],y=e._batchTable.getBatchedAttribute(i,n,new d);_=r[i].clone(_),xce(_,y,o[i])}let c=[],u=[],f=[];for(i=0;i<a;++i){let _=s[i];_.center.x-_.radius>0||le.intersectPlane(_,cn.ORIGIN_ZX_PLANE)!==Xt.INTERSECTING?c.push(_):(u.push(_),f.push(_))}let h=c[0],p=f[0],A=u[0];for(i=1;i<c.length;i++)h=le.union(h,c[i]);for(i=1;i<f.length;i++)p=le.union(p,f[i]);for(i=1;i<u.length;i++)A=le.union(A,u[i]);let m=[];for(l(h)&&m.push(h),l(p)&&m.push(p),l(A)&&m.push(A),i=0;i<m.length;i++){let _=m[i].clone(e._boundingSpheres[i]);e._boundingSpheres[i]=_,e._boundingSphereCV[i]=le.projectTo2D(_,t.mapProjection,e._boundingSphereCV[i])}Zr._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}var pce=new xn,Ece=new me,bce=new d,Ice=new le;function ske(e,t){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition)||e._batchTableBoundingSpheresUpdated)return;let i=e._batchTableBoundingSphereAttributeIndices,o=i.center3DHigh,r=i.center3DLow,a=i.center2DHigh,s=i.center2DLow,c=i.radius,u=t.mapProjection,f=u.ellipsoid,h=e._batchTable,p=e._instanceBoundingSpheres,A=p.length;for(let m=0;m<A;++m){let _=p[m];if(!l(_))continue;let y=e.modelMatrix;l(y)&&(_=le.transform(_,y,Ice));let C=_.center,E=_.radius,b=xn.fromCartesian(C,pce);if(h.setBatchedAttribute(m,o,b.high),h.setBatchedAttribute(m,r,b.low),!t.scene3DOnly){let x=f.cartesianToCartographic(C,Ece),S=u.project(x,bce);b=xn.fromCartesian(S,pce),h.setBatchedAttribute(m,a,b.high),h.setBatchedAttribute(m,s,b.low)}h.setBatchedAttribute(m,c,E)}e._batchTableBoundingSpheresUpdated=!0}var T6=new d,cke=new d;function Ace(e,t){if(!l(e._batchTableAttributeIndices.offset)||e._batchTableOffsetsUpdated||t.scene3DOnly)return;let i=e._batchTableOffsetAttribute2DIndex,o=t.mapProjection,r=o.ellipsoid,a=e._batchTable,s=e._instanceBoundingSpheres,c=s.length;for(let u=0;u<c;++u){let f=s[u];if(!l(f))continue;let h=a.getBatchedAttribute(u,e._batchTableAttributeIndices.offset);if(d.equals(h,d.ZERO)){a.setBatchedAttribute(u,i,d.ZERO);continue}let p=e.modelMatrix;l(p)&&(f=le.transform(f,p,Ice));let A=f.center;A=r.scaleToGeodeticSurface(A,cke);let m=r.cartesianToCartographic(A,Ece),_=o.project(m,bce),y=d.add(h,A,T6);m=r.cartesianToCartographic(y,m);let C=o.project(m,T6),E=d.subtract(C,_,T6),b=E.x;E.x=E.z,E.z=E.y,E.y=b,a.setBatchedAttribute(u,i,E)}e._batchTableOffsetsUpdated=!0}function lke(e,t){let n=e._attributeLocations,i=e._geometries,o=t.scene3DOnly,r=t.context,a=[],s=i.length;for(let c=0;c<s;++c){let u=i[c];if(a.push(Gn.fromGeometry({context:r,geometry:u,attributeLocations:n,bufferUsage:Re.STATIC_DRAW,interleave:e._interleave})),l(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,u);else if(e._boundingSpheres.push(le.clone(u.boundingSphere)),e._boundingSphereWC.push(new le),!o){let f=u.boundingSphereCV.center,h=f.x,p=f.y,A=f.z;f.x=A,f.y=h,f.z=p,e._boundingSphereCV.push(le.clone(u.boundingSphereCV)),e._boundingSphere2D.push(new le),e._boundingSphereMorph.push(new le)}}e._va=a,e._primitiveType=i[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,eM(e,t,Jr.COMPLETE,void 0)}function uke(e,t,n,i){let o=n.getRenderState(),r;i?(r=je(o,!1),r.cull={enabled:!0,face:Ni.BACK},e._frontFaceRS=Ve.fromCache(r),r.cull.face=Ni.FRONT,e._backFaceRS=Ve.fromCache(r)):(e._frontFaceRS=Ve.fromCache(o),e._backFaceRS=e._frontFaceRS),r=je(o,!1),l(e._depthFailAppearance)&&(r.depthTest.enabled=!1),l(e._depthFailAppearance)&&(o=e._depthFailAppearance.getRenderState(),r=je(o,!1),r.depthTest.func=nc.GREATER,i?(r.cull={enabled:!0,face:Ni.BACK},e._frontFaceDepthFailRS=Ve.fromCache(r),r.cull.face=Ni.FRONT,e._backFaceDepthFailRS=Ve.fromCache(r)):(e._frontFaceDepthFailRS=Ve.fromCache(r),e._backFaceDepthFailRS=e._frontFaceRS))}function fke(e,t,n){let i=t.context,o=e._attributeLocations,r=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);r=Zr._appendOffsetToShader(e,r),r=Zr._appendShowToShader(e,r),r=Zr._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=fce(r),r=Zr._updateColorAttribute(e,r,!1),r=hce(e,r),r=Zr._modifyShaderPosition(e,r,t.scene3DOnly);let a=n.getFragmentShaderSource();a=dce(a),e._sp=$t.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:o}),mce(e._sp,o),l(e._depthFailAppearance)&&(r=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),r=Zr._appendShowToShader(e,r),r=Zr._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=fce(r),r=Zr._updateColorAttribute(e,r,!0),r=hce(e,r),r=Zr._modifyShaderPosition(e,r,t.scene3DOnly),r=eke(r),a=e._depthFailAppearance.getFragmentShaderSource(),a=dce(a),a=tke(a),e._spDepthFail=$t.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:o}),mce(e._spDepthFail,o))}var $R=new M,gce=new d;function _ce(e,t,n,i){let o=l(n)?n._uniforms:void 0,r={},a=t.uniforms;if(l(a))for(let c in a)a.hasOwnProperty(c)&&(r[c]=nke(a,c));let s=Pt(r,o);return s=e._batchTable.getUniformMapCallback()(s),l(e.rtcCenter)&&(s.u_modifiedModelView=function(){let c=i.context.uniformState.view;return M.multiply(c,e._modelMatrix,$R),M.multiplyByPoint($R,e.rtcCenter,gce),M.setTranslation($R,gce,$R),$R}),s}function dke(e,t,n,i,o,r,a,s){let c=_ce(e,t,n,s),u;l(e._depthFailAppearance)&&(u=_ce(e,e._depthFailAppearance,e._depthFailAppearance.material,s));let f=i?Be.TRANSLUCENT:Be.OPAQUE,h=o?2:1;h*=l(e._depthFailAppearance)?2:1,r.length=e._va.length*h;let p=r.length,A=0;for(let m=0;m<p;++m){let _;o&&(_=r[m],l(_)||(_=r[m]=new nt({owner:e,primitiveType:e._primitiveType})),_.vertexArray=e._va[A],_.renderState=e._backFaceRS,_.shaderProgram=e._sp,_.uniformMap=c,_.pass=f,++m),_=r[m],l(_)||(_=r[m]=new nt({owner:e,primitiveType:e._primitiveType})),_.vertexArray=e._va[A],_.renderState=e._frontFaceRS,_.shaderProgram=e._sp,_.uniformMap=c,_.pass=f,l(e._depthFailAppearance)&&(o&&(++m,_=r[m],l(_)||(_=r[m]=new nt({owner:e,primitiveType:e._primitiveType})),_.vertexArray=e._va[A],_.renderState=e._backFaceDepthFailRS,_.shaderProgram=e._spDepthFail,_.uniformMap=u,_.pass=f),++m,_=r[m],l(_)||(_=r[m]=new nt({owner:e,primitiveType:e._primitiveType})),_.vertexArray=e._va[A],_.renderState=e._frontFaceDepthFailRS,_.shaderProgram=e._spDepthFail,_.uniformMap=u,_.pass=f),++A}}Zr._updateBoundingVolumes=function(e,t,n,i){let o,r,a;if(i||!M.equals(n,e._modelMatrix))for(M.clone(n,e._modelMatrix),r=e._boundingSpheres.length,o=0;o<r;++o)a=e._boundingSpheres[o],l(a)&&(e._boundingSphereWC[o]=le.transform(a,n,e._boundingSphereWC[o]),t.scene3DOnly||(e._boundingSphere2D[o]=le.clone(e._boundingSphereCV[o],e._boundingSphere2D[o]),e._boundingSphereMorph[o]=le.union(e._boundingSphereWC[o],e._boundingSphereCV[o])));let s=e.appearance.pixelSize;if(l(s))for(r=e._boundingSpheres.length,o=0;o<r;++o){a=e._boundingSpheres[o];let c=e._boundingSphereWC[o],f=t.camera.getPixelSize(a,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*s;c.radius=a.radius+f}};function hke(e,t,n,i,o,r,a,s){Zr._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 u=t.commandList,f=t.passes;if(f.render||f.pick){let h=e.allowPicking,p=wn.castShadows(e.shadows),A=wn.receiveShadows(e.shadows),m=n.length,_=s?2:1;_*=l(e._depthFailAppearance)?2:1;for(let y=0;y<m;++y){let C=Math.floor(y/_),E=n[y];E.modelMatrix=o,E.boundingVolume=c[C],E.cull=r,E.debugShowBoundingVolume=a,E.castShadows=p,E.receiveShadows=A,h?E.pickId="v_pickColor":E.pickId=void 0,u.push(E)}}}Zr.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===Jr.FAILED)return;let t=e.context;if(l(this._batchTable)||K2e(this,t),this._batchTable.attributes.length>0){if(Rt.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!==Jr.COMPLETE&&this._state!==Jr.COMBINED&&(this.asynchronous?oke(this,e):rke(this,e)),this._state===Jr.COMBINED&&(ske(this,e),Ace(this,e),lke(this,e)),!this.show||this._state!==Jr.COMPLETE)return;this._batchTableOffsetsUpdated||Ace(this,e),this._recomputeBoundingSpheres&&ake(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 a=this.depthFailAppearance,s=l(a)?a.material:void 0;this._depthFailAppearance!==a?(this._depthFailAppearance=a,this._depthFailMaterial=s,o=!0,r=!0):this._depthFailMaterial!==s&&(this._depthFailMaterial=s,r=!0);let c=this._appearance.isTranslucent();this._translucent!==c&&(this._translucent=c,o=!0),l(this._material)&&this._material.update(t);let u=n.closed&&c;o&&(this._createRenderStatesFunction??uke)(this,t,n,u),r&&(this._createShaderProgramFunction??fke)(this,e,n),(o||r)&&(this._createCommandsFunction??dke)(this,n,i,c,u,this._colorCommands,this._pickCommands,e),(this._updateAndQueueCommandsFunction??hke)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,u)};var mke=new le,pke=new le;function xce(e,t,n){if(n===mn.TOP){let i=le.clone(e,mke),o=le.clone(e,pke);o.center=d.add(o.center,t,o.center),e=le.union(i,o,e)}else n===mn.ALL&&(e.center=d.add(e.center,t,e.center));return e}function Ake(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),o=e.attributes[n],r=o.componentsPerAttribute,a=j.createTypedArray(o.componentDatatype,r);return l(i.constructor.pack)?i.constructor.pack(i,a,0):a[0]=i,a}}function gke(e,t,n,i,o){return function(r){let a=Cce(r);e.setBatchedAttribute(t,n,a),o==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var _ke=new d;function yke(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)&&xce(i,d.fromArray(r.get(),0,_ke),e._offsetInstanceExtend[n]),l(o)&&(i=le.transform(i,o))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function Cke(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}Zr.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 u=0;u<r;++u){let f=(i+u)%r;if(e===o[f]){n=f;break}}if(n===-1)return;let a=this._batchTable,s=this._batchTableAttributeIndices;t={};let c={};for(let u in s)if(s.hasOwnProperty(u)){let f=s[u];c[u]={get:Ake(a,n,f),set:gke(a,n,f,this,u)}}return yke(this,c,n),Cke(this,c,n),Object.defineProperties(t,c),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t};Zr.prototype.isDestroyed=function(){return!1};Zr.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,fe(this)};function eM(e,t,n,i){e._error=i,e._state=n,t.afterRender.push(function(){return e._ready=e._state===Jr.COMPLETE||e._state===Jr.FAILED,!0})}var Nn=Zr;function Eke(e){e=e??V.EMPTY_OBJECT,this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.value=e.value}var Yc=Eke;var Ox=`#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 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 PICK
out_FragColor.a = 1.0; // Explicitly set the alpha, otherwise this may be discarded by ShaderSource.createPickFragmentShaderSource
#ifdef CULL_FRAGMENTS
czm_writeDepthClamp();
#endif // CULL_FRAGMENTS
#else // PICK
#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 _d(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new S6;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let o=new S6;if(o.requiresTextureCoordinates=e,n instanceof gn)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}_d.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 gn&&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 gn||(o=t.material.shaderSource),new We({defines:i,sources:[o,Ox]})};_d.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 We({defines:n,sources:[Ox],pickColorQualifier:"in"})};_d.prototype.createVertexShader=function(e,t,n,i){return Rce(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};_d.prototype.createPickVertexShader=function(e,t,n,i){return Rce(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var Tce=new d,Sce=new me,wce={high:0,low:0};function Rce(e,t,n,i,o,r,a,s){let c=i.slice();if(s.eastMostYhighDefine===""){let u=Sce;u.longitude=D.PI,u.latitude=0,u.height=0;let f=a.project(u,Tce),h=xn.encode(f.x,wce);s.eastMostYhighDefine=`EAST_MOST_X_HIGH ${h.high.toFixed(`${h.high}`.length+1)}`,s.eastMostYlowDefine=`EAST_MOST_X_LOW ${h.low.toFixed(`${h.low}`.length+1)}`;let p=Sce;p.longitude=-D.PI,p.latitude=0,p.height=0;let A=a.project(p,Tce);h=xn.encode(A.x,wce),s.westMostYhighDefine=`WEST_MOST_X_HIGH ${h.high.toFixed(`${h.high}`.length+1)}`,s.westMostYlowDefine=`WEST_MOST_X_LOW ${h.low.toFixed(`${h.low}`.length+1)}`}return n&&(c.push(s.eastMostYhighDefine),c.push(s.eastMostYlowDefine),c.push(s.westMostYhighDefine),c.push(s.westMostYlowDefine)),l(r)&&r instanceof gn&&c.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(c.push("TEXTURE_COORDINATES"),t||n||c.push("SPHERICAL"),n&&c.push("COLUMBUS_VIEW_2D")),new We({defines:c,sources:[o]})}function S6(){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(S6.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 Bce(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)/k.distance(t,e)}var bke=[new k,new k,new k,new k];function Mce(e,t){let n=bke,i=k.unpack(t,0,n[0]),o=k.unpack(t,2,n[1]),r=k.unpack(t,4,n[2]);e.uMaxVmax=new Yc({componentDatatype:j.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o.x,o.y,r.x,r.y]});let a=1/Bce(i,o,r),s=1/Bce(i,r,o);e.uvMinAndExtents=new Yc({componentDatatype:j.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,a,s]})}var Nce=new me,Lce=new d,Ike=new d,xke=new d,mV={high:0,low:0};function Oce(e,t,n){let i=Nce;i.height=0,i.longitude=e.west,i.latitude=e.south;let o=t.project(i,Lce);i.latitude=e.north;let r=t.project(i,Ike);i.longitude=e.east,i.latitude=e.south;let a=t.project(i,xke),s=[0,0,0,0],c=[0,0,0,0],u=xn.encode(o.x,mV);s[0]=u.high,c[0]=u.low,u=xn.encode(o.y,mV),s[1]=u.high,c[1]=u.low,u=xn.encode(r.y,mV),s[2]=u.high,c[2]=u.low,u=xn.encode(a.x,mV),s[3]=u.high,c[3]=u.low,n.planes2D_HIGH=new Yc({componentDatatype:j.FLOAT,componentsPerAttribute:4,normalize:!1,value:s}),n.planes2D_LOW=new Yc({componentDatatype:j.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var Tke=new M,Ske=new M,Dce=new d,wke=new me,Bke=[new me,new me,new me,new me,new me,new me,new me,new me];function Dke(e,t,n,i,o,r){let a=ce.center(e,wke);a.height=n;let s=me.toCartesian(a,t,Dce),c=At.eastNorthUpToFixedFrame(s,t,Tke),u=M.inverse(c,Ske),f=e.west,h=e.east,p=e.north,A=e.south,m=Bke;m[0].latitude=A,m[0].longitude=f,m[1].latitude=p,m[1].longitude=f,m[2].latitude=p,m[2].longitude=h,m[3].latitude=A,m[3].longitude=h;let _=(f+h)*.5,y=(p+A)*.5;m[4].latitude=A,m[4].longitude=_,m[5].latitude=p,m[5].longitude=_,m[6].latitude=y,m[6].longitude=f,m[7].latitude=y,m[7].longitude=h;let C=Number.POSITIVE_INFINITY,E=Number.NEGATIVE_INFINITY,b=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY;for(let P=0;P<8;P++){m[P].height=n;let N=me.toCartesian(m[P],t,Dce);M.multiplyByPoint(u,N,N),N.z=0,C=Math.min(C,N.x),E=Math.max(E,N.x),b=Math.min(b,N.y),x=Math.max(x,N.y)}let S=i;S.x=C,S.y=b,S.z=0,M.multiplyByPoint(c,S,S);let B=o;B.x=E,B.y=b,B.z=0,M.multiplyByPoint(c,B,B),d.subtract(B,S,o);let v=r;v.x=C,v.y=x,v.z=0,M.multiplyByPoint(c,v,v),d.subtract(v,S,r)}var vke=new d,Pke=new d,Rke=new xn;_d.getPlanarTextureCoordinateAttributes=function(e,t,n,i,o){let r=Lce,a=vke,s=Pke;Dke(e,n,o??0,r,a,s);let c={};Mce(c,t);let u=xn.fromCartesian(r,Rke);return c.southWest_HIGH=new Yc({componentDatatype:j.FLOAT,componentsPerAttribute:3,normalize:!1,value:d.pack(u.high,[0,0,0])}),c.southWest_LOW=new Yc({componentDatatype:j.FLOAT,componentsPerAttribute:3,normalize:!1,value:d.pack(u.low,[0,0,0])}),c.eastward=new Yc({componentDatatype:j.FLOAT,componentsPerAttribute:3,normalize:!1,value:d.pack(a,[0,0,0])}),c.northward=new Yc({componentDatatype:j.FLOAT,componentsPerAttribute:3,normalize:!1,value:d.pack(s,[0,0,0])}),Oce(e,i,c),c};var Mke=new d;function vce(e,t,n,i){let o=Nce;o.latitude=e,o.longitude=t,o.height=0;let r=me.toCartesian(o,n,Mke),a=Math.sqrt(r.x*r.x+r.y*r.y),s=D.fastApproximateAtan2(a,r.z),c=D.fastApproximateAtan2(r.x,r.y);return i.x=s,i.y=c,i}var Pce=new k;_d.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let o=vce(e.south,e.west,n,Pce),r=o.x,a=o.y,s=vce(e.north,e.east,n,Pce),c=s.x,u=s.y,f=0;a>u&&(f=D.PI-a,a=-D.PI,u+=f),r-=D.EPSILON5,a-=D.EPSILON5,c+=D.EPSILON5,u+=D.EPSILON5;let h=1/(u-a),p=1/(c-r),A={sphericalExtents:new Yc({componentDatatype:j.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r,a,p,h]}),longitudeRotation:new Yc({componentDatatype:j.FLOAT,componentsPerAttribute:1,normalize:!1,value:[f]})};return Mce(A,t),Oce(e,i,A),A};_d.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)};_d.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 Nke(e){return Math.max(e.width,e.height)>_d.MAX_WIDTH_FOR_PLANAR_EXTENTS}_d.shouldUseSphericalCoordinates=function(e){return Nke(e)};_d.MAX_WIDTH_FOR_PLANAR_EXTENTS=D.toRadians(1);var hf=_d;var Lke={NEVER:ee.NEVER,LESS:ee.LESS,EQUAL:ee.EQUAL,LESS_OR_EQUAL:ee.LEQUAL,GREATER:ee.GREATER,NOT_EQUAL:ee.NOTEQUAL,GREATER_OR_EQUAL:ee.GEQUAL,ALWAYS:ee.ALWAYS},ti=Object.freeze(Lke);var Oke={ZERO:ee.ZERO,KEEP:ee.KEEP,REPLACE:ee.REPLACE,INCREMENT:ee.INCR,DECREMENT:ee.DECR,INVERT:ee.INVERT,INCREMENT_WRAP:ee.INCR_WRAP,DECREMENT_WRAP:ee.DECR_WRAP},wt=Object.freeze(Oke);var pV={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};pV.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:ti.ALWAYS,frontOperation:{fail:wt.KEEP,zFail:wt.KEEP,zPass:wt.REPLACE},backFunction:ti.ALWAYS,backOperation:{fail:wt.KEEP,zFail:wt.KEEP,zPass:wt.REPLACE},reference:pV.CESIUM_3D_TILE_MASK,mask:pV.CESIUM_3D_TILE_MASK}};var Yt=Object.freeze(pV);function GE(e){e=e??V.EMPTY_OBJECT;let t=e.geometryInstances;this.geometryInstances=t,this.show=e.show??!0,this.classificationType=e.classificationType??ei.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowShadowVolume=e.debugShowShadowVolume??!1,this._debugShowShadowVolume=!1,this._extruded=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:e.vertexCacheOptimize??!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous:e.asynchronous??!0,compressVertices:e.compressVertices??!0,_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(GE.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}}});GE.isSupported=function(e){return e.context.stencilBuffer};function Fx(e,t){let n=t?ti.EQUAL:ti.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:wt.KEEP,zFail:wt.DECREMENT_WRAP,zPass:wt.KEEP},backFunction:n,backOperation:{fail:wt.KEEP,zFail:wt.INCREMENT_WRAP,zPass:wt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:nc.LESS_OR_EQUAL},depthMask:!1}}function B6(e){return{stencilTest:{enabled:e,frontFunction:ti.NOT_EQUAL,frontOperation:{fail:wt.ZERO,zFail:wt.ZERO,zPass:wt.ZERO},backFunction:ti.NOT_EQUAL,backOperation:{fail:wt.ZERO,zFail:wt.ZERO,zPass:wt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:sn.PRE_MULTIPLIED_ALPHA_BLEND}}var Fke={stencilTest:{enabled:!0,frontFunction:ti.NOT_EQUAL,frontOperation:{fail:wt.ZERO,zFail:wt.ZERO,zPass:wt.ZERO},backFunction:ti.NOT_EQUAL,backOperation:{fail:wt.ZERO,zFail:wt.ZERO,zPass:wt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function Qke(e,t,n,i){if(l(e._rsStencilDepthPass))return;let o=!e.debugShowShadowVolume;e._rsStencilDepthPass=Ve.fromCache(Fx(o,!1)),e._rsStencilDepthPass3DTiles=Ve.fromCache(Fx(o,!0)),e._rsColorPass=Ve.fromCache(B6(o,!1)),e._rsPickPass=Ve.fromCache(Fke)}function kke(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);
`,a=t;a=a.replace(/in\s+vec3\s+extrudeDirection;/g,""),a=We.replaceMain(a,"czm_non_compressed_main");let s=`void main()
{
${r} czm_non_compressed_main();
}`;return[i,o,a,s].join(`
`)}}function Uke(e,t){let n=t.context,i=e._primitive,o=XR;o=e._primitive._batchTable.getVertexShaderCallback()(o),o=Nn._appendDistanceDisplayConditionToShader(i,o),o=Nn._modifyShaderPosition(e,o,t.scene3DOnly),o=Nn._updateColorAttribute(i,o);let r=e._hasPlanarExtentsAttributes,a=r||e._hasSphericalExtentsAttribute;e._extruded&&(o=kke(i,o));let s=e._extruded?"EXTRUDED_GEOMETRY":"",c=new We({defines:[s],sources:[o]}),u=new We({sources:[cy]}),f=e._primitive._attributeLocations,h=new hf(a,r,e.appearance);if(e._spStencil=$t.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f}),e._primitive.allowPicking){let m=We.createPickVertexShaderSource(o);m=Nn._appendShowToShader(i,m),m=Nn._updatePickColorAttribute(m);let _=h.createPickFragmentShader(!1),y=h.createPickVertexShader([s],m,!1,t.mapProjection);if(e._spPick=$t.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:y,fragmentShaderSource:_,attributeLocations:f}),a){let C=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!l(C)){let E=h.createPickFragmentShader(!0),b=h.createPickVertexShader([s],m,!0,t.mapProjection);C=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:b,fragmentShaderSource:E,attributeLocations:f})}e._spPick2D=C}}else e._spPick=$t.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});o=Nn._appendShowToShader(i,o),c=new We({defines:[s],sources:[o]}),e._sp=$t.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});let p=h.createFragmentShader(!1),A=h.createVertexShader([s],o,!1,t.mapProjection);if(e._spColor=$t.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:A,fragmentShaderSource:p,attributeLocations:f}),a){let m=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!l(m)){let _=h.createFragmentShader(!0),y=h.createVertexShader([s],o,!0,t.mapProjection);m=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:y,fragmentShaderSource:_,attributeLocations:f})}e._spColor2D=m}}function zke(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let o,r,a,s=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap),u=e._needs2DShader;for(o=0;o<i;o+=2){let A=n._va[s++];r=t[o],l(r)||(r=t[o]=new nt({owner:e,primitiveType:n._primitiveType})),r.vertexArray=A,r.renderState=e._rsStencilDepthPass,r.shaderProgram=e._sp,r.uniformMap=c,r.pass=Be.TERRAIN_CLASSIFICATION,a=nt.shallowClone(r,r.derivedCommands.tileset),a.renderState=e._rsStencilDepthPass3DTiles,a.pass=Be.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=a,r=t[o+1],l(r)||(r=t[o+1]=new nt({owner:e,primitiveType:n._primitiveType})),r.vertexArray=A,r.renderState=e._rsColorPass,r.shaderProgram=e._spColor,r.pass=Be.TERRAIN_CLASSIFICATION;let _=e.appearance.material;if(l(_)&&(c=Pt(c,_._uniforms)),r.uniformMap=c,a=nt.shallowClone(r,r.derivedCommands.tileset),a.pass=Be.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=a,u){let y=nt.shallowClone(r,r.derivedCommands.appearance2D);y.shaderProgram=e._spColor2D,r.derivedCommands.appearance2D=y,y=nt.shallowClone(a,a.derivedCommands.appearance2D),y.shaderProgram=e._spColor2D,a.derivedCommands.appearance2D=y}}let f=e._commandsIgnoreShow,h=e._spStencil,p=0;i=f.length=i/2;for(let A=0;A<i;++A){let m=f[A]=nt.shallowClone(t[p],f[A]);m.shaderProgram=h,m.pass=Be.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,p+=2}}function Gke(e,t){let n=e._usePickOffsets,i=e._primitive,o=i._va.length*2,r,a=0,s;n&&(r=i._pickOffsets,o=r.length*2),t.length=o;let c,u,f,h=0,p=i._batchTable.getUniformMapCallback()(e._uniformMap),A=e._needs2DShader;for(c=0;c<o;c+=2){let m=i._va[h++];if(n&&(s=r[a++],m=i._va[s.index]),u=t[c],l(u)||(u=t[c]=new nt({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsStencilDepthPass,u.shaderProgram=e._sp,u.uniformMap=p,u.pass=Be.TERRAIN_CLASSIFICATION,n&&(u.offset=s.offset,u.count=s.count),f=nt.shallowClone(u,u.derivedCommands.tileset),f.renderState=e._rsStencilDepthPass3DTiles,f.pass=Be.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,u=t[c+1],l(u)||(u=t[c+1]=new nt({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsPickPass,u.shaderProgram=e._spPick,u.uniformMap=p,u.pass=Be.TERRAIN_CLASSIFICATION,n&&(u.offset=s.offset,u.count=s.count),f=nt.shallowClone(u,u.derivedCommands.tileset),f.pass=Be.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,A){let _=nt.shallowClone(u,u.derivedCommands.pick2D);_.shaderProgram=e._spPick2D,u.derivedCommands.pick2D=_,_=nt.shallowClone(f,f.derivedCommands.pick2D),_.shaderProgram=e._spPick2D,f.derivedCommands.pick2D=_}}}function Vke(e,t,n,i,o,r,a){zke(e,r),Gke(e,a)}function Fce(e,t){return Math.floor(e%t/2)}function w6(e,t,n,i,o,r){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,e.debugShowBoundingVolume=r,t.commandList.push(e)}function Qce(e,t,n,i,o){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,t.commandList.push(e)}function Hke(e,t,n,i,o,r,a,s){let c=e._primitive;Nn._updateBoundingVolumes(c,t,o);let u;t.mode===oe.SCENE3D?u=c._boundingSphereWC:t.mode===oe.COLUMBUS_VIEW?u=c._boundingSphereCV:t.mode===oe.SCENE2D&&l(c._boundingSphere2D)?u=c._boundingSphere2D:l(c._boundingSphereMorph)&&(u=c._boundingSphereMorph);let f=e.classificationType,h=f!==ei.CESIUM_3D_TILE,p=f!==ei.TERRAIN,A=t.passes,m,_,y;if(A.render){let C=n.length;for(m=0;m<C;++m)_=u[Fce(m,C)],h&&(y=n[m],w6(y,t,o,r,_,a)),p&&(y=n[m].derivedCommands.tileset,w6(y,t,o,r,_,a));if(t.invertClassification){let E=e._commandsIgnoreShow,b=E.length;for(m=0;m<b;++m)_=u[m],y=E[m],w6(y,t,o,r,_,a)}}if(A.pick){let C=i.length,E=c._pickOffsets;for(m=0;m<C;++m){let b=E[Fce(m,C)];_=u[b.index],h&&(y=i[m],Qce(y,t,o,r,_)),p&&(y=i[m].derivedCommands.tileset,Qce(y,t,o,r,_))}}}GE.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,a,s,c,u=!1,f=!0,h,p=!1,A=!1;for(r>0&&(c=o[0].attributes,p=hf.hasAttributesForSphericalExtents(c),A=hf.hasAttributesForTextureCoordinatePlanes(c),h=c.color),a=0;a<r;a++){s=o[a];let _=s.attributes.color;l(_)&&(u=!0),f=f&&l(_)&&Jt.equals(h,_)}if(!f&&!p&&!A)throw new de("All GeometryInstances must have the same color attribute except via GroundPrimitives");u&&!l(t)&&(t=new gn({flat:!0}),this.appearance=t),this._usePickOffsets=!p&&!A,this._hasSphericalExtentsAttribute=p,this._hasPlanarExtentsAttributes=A,this._hasPerColorAttribute=u;let m=new Array(r);for(a=0;a<r;++a)s=o[a],m[a]=new Mt({geometry:s.geometry,attributes:s.attributes,modelMatrix:s.modelMatrix,id:s.id,pickPrimitive:this._pickPrimitive??n});i.appearance=t,i.geometryInstances=m,l(this._createBoundingVolumeFunction)&&(i._createBoundingVolumeFunction=function(_,y){n._createBoundingVolumeFunction(_,y)}),i._createRenderStatesFunction=function(_,y,C,E){Qke(n,y)},i._createShaderProgramFunction=function(_,y,C){Uke(n,y)},i._createCommandsFunction=function(_,y,C,E,b,x,S){Vke(n,void 0,void 0,!0,!1,x,S)},l(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(_,y,C,E,b,x,S,B){n._updateAndQueueCommandsFunction(_,y,C,E,b,x,S,B)}:i._updateAndQueueCommandsFunction=function(_,y,C,E,b,x,S,B){Hke(n,y,C,E,b,x,S,B)},this._primitive=new Nn(i)}this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=Ve.fromCache(Fx(!1,!1)),this._rsStencilDepthPass3DTiles=Ve.fromCache(Fx(!1,!0)),this._rsColorPass=Ve.fromCache(B6(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=Ve.fromCache(Fx(!0,!1)),this._rsStencilDepthPass3DTiles=Ve.fromCache(Fx(!0,!0)),this._rsColorPass=Ve.fromCache(B6(!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))})};GE.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};GE.prototype.isDestroyed=function(){return!1};GE.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,fe(this)};var Qx=GE;var Wke={u_globeMinimumAltitude:function(){return 55e3}};function Iu(e){e=e??V.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 a=0;a<r;a++){let s=o[a].attributes;if(l(s)&&l(s.color)){t=new gn({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=e.show??!0,this.classificationType=e.classificationType??ei.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowShadowVolume=e.debugShowShadowVolume??!1,this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1,this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=Di._defaultMaxTerrainHeight,this._minTerrainHeight=Di._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;let i=this;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:e.vertexCacheOptimize??!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous:e.asynchronous??!0,compressVertices:e.compressVertices??!0,_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:i,_extruded:!0,_uniformMap:Wke}}Object.defineProperties(Iu.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}}});Iu.isSupported=Qx.isSupported;function kce(e){return function(t,n){let i=n.maximumRadius,o=i/Math.cos(t*.5)-i;return e._maxHeight+o}}function Uce(e){return function(t,n){return e._minHeight}}var jke=new d,Yke=new d,qke=new d,Kke=new me,Xke=new ce;function AV(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,a=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let h=0;h<r;h+=3){let p=d.unpack(i,h,jke),A=d.unpack(o,h,Yke),m=d.add(p,A,qke),_=n.cartesianToCartographic(m,Kke),y=_.latitude,C=_.longitude;a=Math.min(a,y),s=Math.min(s,C),c=Math.max(c,y),u=Math.max(u,C)}let f=Xke;return f.north=c,f.south=a,f.east=u,f.west=s,f}function Jke(e,t,n){let i=Di.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function Zke(e,t,n){let i=t.mapProjection.ellipsoid,o=AV(t,n),r=en.fromRectangle(o,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(r),!t.scene3DOnly){let a=t.mapProjection,s=le.fromRectangleWithHeights2D(o,a,e._maxHeight,e._minHeight);d.fromElements(s.center.z,s.center.x,s.center.y,s.center),e._boundingVolumes2D.push(s)}}function D6(e,t){return Math.floor(e%t/2)}function v6(e,t,n,i,o,r,a){let s=e._primitive;n.mode!==oe.SCENE3D&&t.shaderProgram===s._spColor&&s._needs2DShader&&(t=t.derivedCommands.appearance2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=r,t.cull=o,t.debugShowBoundingVolume=a,n.commandList.push(t)}function zce(e,t,n,i,o,r){let a=e._primitive;n.mode!==oe.SCENE3D&&t.shaderProgram===a._spPick&&a._needs2DShader&&(t=t.derivedCommands.pick2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=r,t.cull=o,n.commandList.push(t)}function $ke(e,t,n,i,o,r,a,s){let c;t.mode===oe.SCENE3D?c=e._boundingVolumes:c=e._boundingVolumes2D;let u=e.classificationType,f=u!==ei.CESIUM_3D_TILE,h=u!==ei.TERRAIN,p=t.passes,A=e._primitive,m,_,y;if(p.render){let C=n.length;for(m=0;m<C;++m)_=c[D6(m,C)],f&&(y=n[m],v6(e,y,t,o,r,_,a)),h&&(y=n[m].derivedCommands.tileset,v6(e,y,t,o,r,_,a));if(t.invertClassification){let E=A._commandsIgnoreShow,b=E.length;for(m=0;m<b;++m)_=c[m],y=E[m],v6(e,y,t,o,r,_,a)}}if(p.pick){let C=i.length,E;for(e._useFragmentCulling||(E=A._primitive._pickOffsets),m=0;m<C;++m){if(_=c[D6(m,C)],!e._useFragmentCulling){let b=E[D6(m,C)];_=c[b.index]}f&&(y=i[m],zce(e,y,t,o,r,_)),h&&(y=i[m].derivedCommands.tileset,zce(e,y,t,o,r,_))}}}Iu.initializeTerrainHeights=function(){return Di.initialize()};Iu.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!Di.initialized){Iu.initializeTerrainHeights();return}let t=this,n=this._classificationPrimitiveOptions;if(!l(this._primitive)){let i=e.mapProjection.ellipsoid,o,r,a,s=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],c=s.length,u=new Array(c),f,h;for(f=0;f<c;++f){o=s[f],r=o.geometry;let _=AV(e,r);l(h)?l(_)&&ce.union(h,_,h):h=ce.clone(_);let y=o.id;if(l(y)&&l(_)){let C=Di.getBoundingSphere(_,i);this._boundingSpheresKeys.push(y),this._boundingSpheres.push(C)}a=r.constructor,!l(a)||l(a.createShadowVolume)}Jke(this,h,i);let p=e.verticalExaggeration,A=e.verticalExaggerationRelativeHeight;this._minHeight=xo.getHeight(this._minTerrainHeight,p,A),this._maxHeight=xo.getHeight(this._maxTerrainHeight,p,A);let m=Iu._supportsMaterials(e.context);if(this._useFragmentCulling=m,m){let _,y=!0;for(f=0;f<c;++f)if(o=s[f],r=o.geometry,h=AV(e,r),hf.shouldUseSphericalCoordinates(h)){y=!1;break}for(f=0;f<c;++f){o=s[f],r=o.geometry,a=r.constructor;let C=AV(e,r),E=r.textureCoordinateRotationPoints;y?_=hf.getPlanarTextureCoordinateAttributes(C,E,i,e.mapProjection,this._maxHeight):_=hf.getSphericalExtentGeometryInstanceAttributes(C,E,i,e.mapProjection);let b=o.attributes;for(let x in b)b.hasOwnProperty(x)&&(_[x]=b[x]);u[f]=new Mt({geometry:a.createShadowVolume(r,Uce(this),kce(this)),attributes:_,id:o.id})}}else for(f=0;f<c;++f)o=s[f],r=o.geometry,a=r.constructor,u[f]=new Mt({geometry:a.createShadowVolume(r,Uce(this),kce(this)),attributes:o.attributes,id:o.id});n.geometryInstances=u,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(_,y){Zke(t,_,y)},n._updateAndQueueCommandsFunction=function(_,y,C,E,b,x,S,B){$ke(t,y,C,E,b,x,S,B)},this._primitive=new Qx(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))})};Iu.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};Iu.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Iu.prototype.isDestroyed=function(){return!1};Iu.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),fe(this)};Iu._supportsMaterials=function(e){return e.depthTexture};Iu.supportsMaterials=function(e){return Iu._supportsMaterials(e.frameState.context)};var vl=Iu;function kx(){de.throwInstantiationError()}Object.defineProperties(kx.prototype,{isConstant:{get:de.throwInstantiationError},definitionChanged:{get:de.throwInstantiationError}});kx.prototype.getType=de.throwInstantiationError;kx.prototype.getValue=de.throwInstantiationError;kx.prototype.equals=de.throwInstantiationError;var e3e=new X;kx.getValue=function(e,t,n){let i;return l(e)||(e=X.now(e3e)),l(t)&&(i=t.getType(e),l(i))?((!l(n)||n.type!==i)&&(n=Yi.fromType(i)),t.getValue(e,n.uniforms),n):((!l(n)||n.type!==Yi.ColorType)&&(n=Yi.fromType(Yi.ColorType)),z.clone(z.WHITE,n.uniforms.color),n)};var wr=kx;function VE(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}VE.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!q.getValueOrDefault(t.show,n,!0)};VE.prototype._setOptions=de.throwInstantiationError;VE.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,a=r[this._geometryUpdater._geometryPropertyName];if(this._setOptions(r,a,e),this._isHidden(r,a,e))return;let s=this._geometryUpdater.shadowsProperty.getValue(e),c=this._options;if(!l(a.fill)||a.fill.getValue(e)){let u=t.fillMaterialProperty,f=u instanceof qt,h,p=t._getIsClosed(c);if(f)h=new gn({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let A=wr.getValue(e,u,this._material);this._material=A,h=new _o({material:A,translucent:A.isTranslucent(),closed:p})}if(n)c.vertexFormat=gn.VERTEX_FORMAT,this._primitive=o.add(new vl({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:h,asynchronous:!1,shadows:s,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),q.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{c.vertexFormat=h.vertexFormat;let A=this._geometryUpdater.createFillGeometryInstance(e);f&&(h.translucent=A.attributes.color.value[3]!==255),this._primitive=i.add(new Nn({geometryInstances:A,appearance:h,asynchronous:!1,shadows:s}))}}if(!n&&l(a.outline)&&a.outline.getValue(e)){let u=this._geometryUpdater.createOutlineGeometryInstance(e),f=q.getValueOrDefault(a.outlineWidth,e,1);this._outlinePrimitive=i.add(new Nn({geometryInstances:u,appearance:new gn({flat:!0,translucent:u.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(f)}}),asynchronous:!1,shadows:s}))}};VE.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))?(le.clone(o.boundingSphere,e),Ct.DONE):l(i)&&i.show&&i.ready&&(o=i.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(le.clone(o.boundingSphere,e),Ct.DONE):l(n)&&!n.ready||l(i)&&!i.ready?Ct.PENDING:Ct.FAILED};VE.prototype.isDestroyed=function(){return!1};VE.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),fe(this)};var bi=VE;var Gce={};function tM(e,t){l(Gce[e])||(Gce[e]=!0,console.warn(t??e))}tM.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.";tM.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";tM.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";tM.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var It=tM;var t3e={AUTODETECT:0,ENU:1,INERTIAL:2,VELOCITY:3},UA=Object.freeze(t3e);var n3e={NONE:0,GEODESIC:1,RHUMB:2},ln=Object.freeze(n3e);var Vce=D.EPSILON10;function i3e(e,t,n,i){if(!l(e))return;n=n??!1;let o=l(i),r=e.length;if(r<2)return e;let a,s=e[0],c,u,f=0,h=-1;for(a=1;a<r;++a)c=e[a],t(s,c,Vce)?(l(u)||(u=e.slice(0,a),f=a-1,h=0),o&&i.push(a)):(l(u)&&(u.push(c),f=a,o&&(h=i.length)),s=c);return n&&t(e[0],e[r-1],Vce)&&(o&&(l(u)?i.splice(h,0,f):i.push(r-1)),l(u)?u.length-=1:u=e.slice(0,-1)),l(u)?u:e}var Ho=i3e;function o3e(e){let t=e._uSquared,n=e._ellipsoid.maximumRadius,i=e._ellipsoid.minimumRadius,o=(n-i)/n,r=Math.cos(e._startHeading),a=Math.sin(e._startHeading),s=(1-o)*Math.tan(e._start.latitude),c=1/Math.sqrt(1+s*s),u=c*s,f=Math.atan2(s,r),h=c*a,p=h*h,A=1-p,m=Math.sqrt(A),_=t/4,y=_*_,C=y*_,E=y*y,b=1+_-3*y/4+5*C/4-175*E/64,x=1-_+15*y/8-35*C/8,S=1-3*_+35*y/4,B=1-5*_,v=b*f-x*Math.sin(2*f)*_/2-S*Math.sin(4*f)*y/16-B*Math.sin(6*f)*C/48-Math.sin(8*f)*5*E/512,P=e._constants;P.a=n,P.b=i,P.f=o,P.cosineHeading=r,P.sineHeading=a,P.tanU=s,P.cosineU=c,P.sineU=u,P.sigma=f,P.sineAlpha=h,P.sineSquaredAlpha=p,P.cosineSquaredAlpha=A,P.cosineAlpha=m,P.u2Over4=_,P.u4Over16=y,P.u6Over64=C,P.u8Over256=E,P.a0=b,P.a1=x,P.a2=S,P.a3=B,P.distanceRatio=v}function r3e(e,t){return e*t*(4+e*(4-3*t))/16}function Hce(e,t,n,i,o,r,a){let s=r3e(e,n);return(1-s)*e*t*(i+s*o*(a+s*r*(2*a*a-1)))}function a3e(e,t,n,i,o,r,a){let s=(t-n)/t,c=r-i,u=Math.atan((1-s)*Math.tan(o)),f=Math.atan((1-s)*Math.tan(a)),h=Math.cos(u),p=Math.sin(u),A=Math.cos(f),m=Math.sin(f),_=h*A,y=h*m,C=p*m,E=p*A,b=c,x=D.TWO_PI,S=Math.cos(b),B=Math.sin(b),v,P,N,L,g;do{S=Math.cos(b),B=Math.sin(b);let Q=y-E*S;N=Math.sqrt(A*A*B*B+Q*Q),P=C+_*S,v=Math.atan2(N,P);let H;N===0?(H=0,L=1):(H=_*B/N,L=1-H*H),x=b,g=P-2*C/L,isFinite(g)||(g=0),b=c+Hce(s,H,L,v,N,P,g)}while(Math.abs(b-x)>D.EPSILON12);let I=L*(t*t-n*n)/(n*n),T=1+I*(4096+I*(I*(320-175*I)-768))/16384,w=I*(256+I*(I*(74-47*I)-128))/1024,R=g*g,O=w*N*(g+w*(P*(2*R-1)-w*g*(4*N*N-3)*(4*R-3)/6)/4),G=n*T*(v-O),F=Math.atan2(A*B,y-E*S),U=Math.atan2(h*B,y*S-E);e._distance=G,e._startHeading=F,e._endHeading=U,e._uSquared=I}var s3e=new d,P6=new d;function Wce(e,t,n,i){let o=d.normalize(i.cartographicToCartesian(t,P6),s3e),r=d.normalize(i.cartographicToCartesian(n,P6),P6);a3e(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=me.clone(t,e._start),e._end=me.clone(n,e._end),e._start.height=0,e._end.height=0,o3e(e)}function nM(e,t,n){let i=n??te.default;this._ellipsoid=i,this._start=new me,this._end=new me,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,l(e)&&l(t)&&Wce(this,e,t,i)}Object.defineProperties(nM.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}}});nM.prototype.setEndPoints=function(e,t){Wce(this,e,t,this._ellipsoid)};nM.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};nM.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),a=Math.cos(6*i),s=Math.sin(2*i),c=Math.sin(4*i),u=Math.sin(6*i),f=Math.sin(8*i),h=i*i,p=i*h,A=n.u8Over256,m=n.u2Over4,_=n.u6Over64,y=n.u4Over16,C=2*p*A*o/3+i*(1-m+7*y/4-15*_/4+579*A/64-(y-15*_/4+187*A/16)*o-(5*_/4-115*A/16)*r-29*A*a/16)+(m/2-y+71*_/32-85*A/16)*s+(5*y/16-5*_/4+383*A/96)*c-h*((_-11*A/2)*s+5*A*c/2)+(29*_/96-29*A/16)*u+539*A*f/1536,E=Math.asin(Math.sin(C)*n.cosineAlpha),b=Math.atan(n.a/n.b*Math.tan(E));C=C-n.sigma;let x=Math.cos(2*n.sigma+C),S=Math.sin(C),B=Math.cos(C),v=n.cosineU*B,P=n.sineU*S,L=Math.atan2(S*n.sineHeading,v-P*n.cosineHeading)-Hce(n.f,n.sineAlpha,n.cosineSquaredAlpha,C,S,B,x);return l(t)?(t.longitude=this._start.longitude+L,t.latitude=b,t.height=0,t):new me(this._start.longitude+L,b,0)};var zA=nM;function M6(e,t,n){if(e===0)return t*n;let i=e*e,o=i*i,r=o*i,a=r*i,s=a*i,c=s*i,u=n,f=Math.sin(2*u),h=Math.sin(4*u),p=Math.sin(6*u),A=Math.sin(8*u),m=Math.sin(10*u),_=Math.sin(12*u);return t*((1-i/4-3*o/64-5*r/256-175*a/16384-441*s/65536-4851*c/1048576)*u-(3*i/8+3*o/32+45*r/1024+105*a/4096+2205*s/131072+6237*c/524288)*f+(15*o/256+45*r/1024+525*a/16384+1575*s/65536+155925*c/8388608)*h-(35*r/3072+175*a/12288+3675*s/262144+13475*c/1048576)*p+(315*a/131072+2205*s/524288+43659*c/8388608)*A-(693*s/1310720+6237*c/5242880)*m+1001*c/8388608*_)}function c3e(e,t,n){let i=e/n;if(t===0)return i;let o=i*i,r=o*i,a=r*i,s=t,c=s*s,u=c*c,f=u*c,h=f*c,p=h*c,A=p*c,m=Math.sin(2*i),_=Math.cos(2*i),y=Math.sin(4*i),C=Math.cos(4*i),E=Math.sin(6*i),b=Math.cos(6*i),x=Math.sin(8*i),S=Math.cos(8*i),B=Math.sin(10*i),v=Math.cos(10*i),P=Math.sin(12*i);return i+i*c/4+7*i*u/64+15*i*f/256+579*i*h/16384+1515*i*p/65536+16837*i*A/1048576+(3*i*u/16+45*i*f/256-i*(32*o-561)*h/4096-i*(232*o-1677)*p/16384+i*(399985-90560*o+512*a)*A/5242880)*_+(21*i*f/256+483*i*h/4096-i*(224*o-1969)*p/16384-i*(33152*o-112599)*A/1048576)*C+(151*i*h/4096+4681*i*p/65536+1479*i*A/16384-453*r*A/32768)*b+(1097*i*p/65536+42783*i*A/1048576)*S+8011*i*A/1048576*v+(3*c/8+3*u/16+213*f/2048-3*o*f/64+255*h/4096-33*o*h/512+20861*p/524288-33*o*p/512+a*p/1024+28273*A/1048576-471*o*A/8192+9*a*A/4096)*m+(21*u/256+21*f/256+533*h/8192-21*o*h/512+197*p/4096-315*o*p/4096+584039*A/16777216-12517*o*A/131072+7*a*A/2048)*y+(151*f/6144+151*h/4096+5019*p/131072-453*o*p/16384+26965*A/786432-8607*o*A/131072)*E+(1097*h/131072+1097*p/65536+225797*A/10485760-1097*o*A/65536)*x+(8011*p/2621440+8011*A/1048576)*B+293393*A/251658240*P}function Ux(e,t){if(e===0)return Math.log(Math.tan(.5*(D.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(D.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function l3e(e,t,n,i,o){let r=Ux(e._ellipticity,n),a=Ux(e._ellipticity,o);return Math.atan2(D.negativePiToPi(i-t),a-r)}function u3e(e,t,n,i,o,r,a){let s=e._heading,c=r-i,u=0;if(D.equalsEpsilon(Math.abs(s),D.PI_OVER_TWO,D.EPSILON8))if(t===n)u=t*Math.cos(o)*D.negativePiToPi(c);else{let f=Math.sin(o);u=t*Math.cos(o)*D.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*f*f)}else{let f=M6(e._ellipticity,t,o);u=(M6(e._ellipticity,t,a)-f)/Math.cos(s)}return Math.abs(u)}var f3e=new d,R6=new d;function jce(e,t,n,i){let o=d.normalize(i.cartographicToCartesian(t,R6),f3e),r=d.normalize(i.cartographicToCartesian(n,R6),R6),a=i.maximumRadius,s=i.minimumRadius,c=a*a,u=s*s;e._ellipticitySquared=(c-u)/c,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=me.clone(t,e._start),e._start.height=0,e._end=me.clone(n,e._end),e._end.height=0,e._heading=l3e(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=u3e(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function Yce(e,t,n,i,o,r){if(n===0)return me.clone(e,r);let a=o*o,s,c,u;if(Math.abs(D.PI_OVER_TWO-Math.abs(t))>D.EPSILON8){let f=M6(o,i,e.latitude),h=n*Math.cos(t),p=f+h;if(c=c3e(p,o,i),Math.abs(t)<D.EPSILON10)s=D.negativePiToPi(e.longitude);else{let A=Ux(o,e.latitude),m=Ux(o,c);u=Math.tan(t)*(m-A),s=D.negativePiToPi(e.longitude+u)}}else{c=e.latitude;let f;if(o===0)f=i*Math.cos(e.latitude);else{let h=Math.sin(e.latitude);f=i*Math.cos(e.latitude)/Math.sqrt(1-a*h*h)}u=n/f,t>0?s=D.negativePiToPi(e.longitude+u):s=D.negativePiToPi(e.longitude-u)}return l(r)?(r.longitude=s,r.latitude=c,r.height=0,r):new me(s,c,0)}function GA(e,t,n){let i=n??te.default;this._ellipsoid=i,this._start=new me,this._end=new me,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(e)&&l(t)&&jce(this,e,t,i)}Object.defineProperties(GA.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}}});GA.fromStartHeadingDistance=function(e,t,n,i,o){let r=i??te.default,a=r.maximumRadius,s=r.minimumRadius,c=a*a,u=s*s,f=Math.sqrt((c-u)/c);t=D.negativePiToPi(t);let h=Yce(e,t,n,r.maximumRadius,f);return!l(o)||l(i)&&!i.equals(o.ellipsoid)?new GA(e,h,r):(o.setEndPoints(e,h),o)};GA.prototype.setEndPoints=function(e,t){jce(this,e,t,this._ellipsoid)};GA.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};GA.prototype.interpolateUsingSurfaceDistance=function(e,t){return Yce(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};GA.prototype.findIntersectionWithLongitude=function(e,t){let n=this._ellipticity,i=this._heading,o=Math.abs(i),r=this._start;if(e=D.negativePiToPi(e),D.equalsEpsilon(Math.abs(e),Math.PI,D.EPSILON14)&&(e=D.sign(r.longitude)*Math.PI),l(t)||(t=new me),Math.abs(D.PI_OVER_TWO-o)<=D.EPSILON8)return t.longitude=e,t.latitude=r.latitude,t.height=0,t;if(D.equalsEpsilon(Math.abs(D.PI_OVER_TWO-o),D.PI_OVER_TWO,D.EPSILON8))return D.equalsEpsilon(e,r.longitude,D.EPSILON12)?void 0:(t.longitude=e,t.latitude=D.PI_OVER_TWO*D.sign(D.PI_OVER_TWO-i),t.height=0,t);let a=r.latitude,s=n*Math.sin(a),c=Math.tan(.5*(D.PI_OVER_TWO+a))*Math.exp((e-r.longitude)/Math.tan(i)),u=(1+s)/(1-s),f=r.latitude,h;do{h=f;let p=n*Math.sin(h),A=(1+p)/(1-p);f=2*Math.atan(c*Math.pow(A/u,n/2))-D.PI_OVER_TWO}while(!D.equalsEpsilon(f,h,D.EPSILON12));return t.longitude=e,t.latitude=f,t.height=0,t};GA.prototype.findIntersectionWithLatitude=function(e,t){let n=this._ellipticity,i=this._heading,o=this._start;if(D.equalsEpsilon(Math.abs(i),D.PI_OVER_TWO,D.EPSILON8))return;let r=Ux(n,o.latitude),a=Ux(n,e),s=Math.tan(i)*(a-r),c=D.negativePiToPi(o.longitude+s);return l(t)?(t.longitude=c,t.latitude=e,t.height=0,t):new me(c,e,0)};var Sc=GA;var z6=[Wi,mi],d3e=z6.length,hle=Math.cos(D.toRadians(30)),qce=Math.cos(D.toRadians(150)),mle=0,ple=1e3;function uy(e){e=e??V.EMPTY_OBJECT;let t=e.positions;this.width=e.width??1,this._positions=t,this.granularity=e.granularity??9999,this.loop=e.loop??!1,this.arcType=e.arcType??ln.GEODESIC,this._ellipsoid=te.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(uy.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+te.packedLength+1+1}}});uy.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<d3e;i++)if(t instanceof z6[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};var h3e=new d,Kce=new d,Xce=new d;function U6(e,t,n,i,o){let r=Pl(i,e,0,h3e),a=Pl(i,e,n,Kce),s=Pl(i,t,0,Xce),c=VA(a,r,Kce),u=VA(s,r,Xce);return d.cross(u,c,o),d.normalize(o,o)}var m3e=new me,p3e=new d,A3e=new d,g3e=new d;function N6(e,t,n,i,o,r,a,s,c,u,f){if(o===0)return;let h;r===ln.GEODESIC?h=new zA(e,t,a):r===ln.RHUMB&&(h=new Sc(e,t,a));let p=h.surfaceDistance;if(p<o)return;let A=U6(e,t,i,a,g3e),m=Math.ceil(p/o),_=p/m,y=_,C=m-1,E=s.length;for(let b=0;b<C;b++){let x=h.interpolateUsingSurfaceDistance(y,m3e),S=Pl(a,x,n,p3e),B=Pl(a,x,i,A3e);d.pack(A,s,E),d.pack(S,c,E),d.pack(B,u,E),f.push(x.latitude),f.push(x.longitude),E+=3,y+=_}}var L6=new me;function Pl(e,t,n,i){return me.clone(t,L6),L6.height=n,me.toCartesian(L6,e,i)}uy.pack=function(e,t,n){let i=n??0,o=e._positions,r=o.length;t[i++]=r;for(let a=0;a<r;++a){let s=o[a];d.pack(s,t,i),i+=3}return t[i++]=e.granularity,t[i++]=e.loop?1:0,t[i++]=e.arcType,te.pack(e._ellipsoid,t,i),i+=te.packedLength,t[i++]=e._projectionIndex,t[i++]=e._scene3DOnly?1:0,t};uy.unpack=function(e,t,n){let i=t??0,o=e[i++],r=new Array(o);for(let p=0;p<o;p++)r[p]=d.unpack(e,i),i+=3;let a=e[i++],s=e[i++]===1,c=e[i++],u=te.unpack(e,i);i+=te.packedLength;let f=e[i++],h=e[i++]===1;return l(n)||(n=new uy({positions:r})),n._positions=r,n.granularity=a,n.loop=s,n.arcType=c,n._ellipsoid=u,n._projectionIndex=f,n._scene3DOnly=h,n};function VA(e,t,n){return d.subtract(e,t,n),d.normalize(n,n),n}function Jce(e,t,n,i){return i=VA(e,t,i),i=d.cross(i,n,i),i=d.normalize(i,i),i=d.cross(n,i,i),i}var _3e=new d,y3e=new d,C3e=new d,Ale=new d,E3e=0,b3e=-1;function O6(e,t,n,i,o){let r=VA(n,t,Ale),a=Jce(e,t,r,_3e),s=Jce(i,t,r,y3e);if(D.equalsEpsilon(d.dot(a,s),b3e,D.EPSILON5))return o=d.cross(r,a,o),o=d.normalize(o,o),o;o=d.add(s,a,o),o=d.normalize(o,o);let c=d.cross(r,o,C3e);return d.dot(s,c)<E3e&&(o=d.negate(o,o)),o}var CV=cn.fromPointNormal(d.ZERO,d.UNIT_Y),I3e=new d,x3e=new d,T3e=new d,S3e=new d,w3e=new d,gV=new d,_V=new me,Zce=new me,$ce=new me;uy.createGeometry=function(e){let t=!e._scene3DOnly,n=e.loop,i=e._ellipsoid,o=e.granularity,r=e.arcType,a=new z6[e._projectionIndex](i),s=mle,c=ple,u,f,h=e._positions,p=h.length;p===2&&(n=!1);let A,m,_,y,C=new Sc(void 0,void 0,i),E,b,x,S=[h[0]];for(f=0;f<p-1;f++)A=h[f],m=h[f+1],E=di.lineSegmentPlane(A,m,CV,gV),l(E)&&!d.equalsEpsilon(E,A,D.EPSILON7)&&!d.equalsEpsilon(E,m,D.EPSILON7)&&(e.arcType===ln.GEODESIC?S.push(d.clone(E)):e.arcType===ln.RHUMB&&(x=i.cartesianToCartographic(E,_V).longitude,_=i.cartesianToCartographic(A,_V),y=i.cartesianToCartographic(m,Zce),C.setEndPoints(_,y),b=C.findIntersectionWithLongitude(x,$ce),E=i.cartographicToCartesian(b,gV),l(E)&&!d.equalsEpsilon(E,A,D.EPSILON7)&&!d.equalsEpsilon(E,m,D.EPSILON7)&&S.push(d.clone(E)))),S.push(m);n&&(A=h[p-1],m=h[0],E=di.lineSegmentPlane(A,m,CV,gV),l(E)&&!d.equalsEpsilon(E,A,D.EPSILON7)&&!d.equalsEpsilon(E,m,D.EPSILON7)&&(e.arcType===ln.GEODESIC?S.push(d.clone(E)):e.arcType===ln.RHUMB&&(x=i.cartesianToCartographic(E,_V).longitude,_=i.cartesianToCartographic(A,_V),y=i.cartesianToCartographic(m,Zce),C.setEndPoints(_,y),b=C.findIntersectionWithLongitude(x,$ce),E=i.cartographicToCartesian(b,gV),l(E)&&!d.equalsEpsilon(E,A,D.EPSILON7)&&!d.equalsEpsilon(E,m,D.EPSILON7)&&S.push(d.clone(E)))));let B=S.length,v=new Array(B);for(f=0;f<B;f++){let Y=me.fromCartesian(S[f],i);Y.height=0,v[f]=Y}if(v=Ho(v,me.equalsEpsilon),B=v.length,B<2)return;let P=[],N=[],L=[],g=[],I=I3e,T=x3e,w=T3e,R=S3e,O=w3e,G=v[0],F=v[1],U=v[B-1];for(I=Pl(i,U,s,I),R=Pl(i,F,s,R),T=Pl(i,G,s,T),w=Pl(i,G,c,w),n?O=O6(I,T,w,R,O):O=U6(G,F,c,i,O),d.pack(O,N,0),d.pack(T,L,0),d.pack(w,g,0),P.push(G.latitude),P.push(G.longitude),N6(G,F,s,c,o,r,i,N,L,g,P),f=1;f<B-1;++f){I=d.clone(T,I),T=d.clone(R,T);let Y=v[f];Pl(i,Y,c,w),Pl(i,v[f+1],s,R),O6(I,T,w,R,O),u=N.length,d.pack(O,N,u),d.pack(T,L,u),d.pack(w,g,u),P.push(Y.latitude),P.push(Y.longitude),N6(v[f],v[f+1],s,c,o,r,i,N,L,g,P)}let Q=v[B-1],H=v[B-2];if(T=Pl(i,Q,s,T),w=Pl(i,Q,c,w),n){let Y=v[0];I=Pl(i,H,s,I),R=Pl(i,Y,s,R),O=O6(I,T,w,R,O)}else O=U6(H,Q,c,i,O);if(u=N.length,d.pack(O,N,u),d.pack(T,L,u),d.pack(w,g,u),P.push(Q.latitude),P.push(Q.longitude),n){for(N6(Q,G,s,c,o,r,i,N,L,g,P),u=N.length,f=0;f<3;++f)N[u+f]=N[f],L[u+f]=L[f],g[u+f]=g[f];P.push(G.latitude),P.push(G.longitude)}return $3e(n,a,L,g,N,P,t)};var B3e=new d,D3e=new J,v3e=new Qe;function ele(e,t,n,i){let o=VA(n,t,B3e),r=d.dot(o,e);if(r>hle||r<qce){let a=VA(i,n,Ale),s=r<qce?D.PI_OVER_TWO:-D.PI_OVER_TWO,c=Qe.fromAxisAngle(a,s,v3e),u=J.fromQuaternion(c,D3e);return J.multiplyByVector(u,e,e),!0}return!1}var tle=new me,P3e=new d,nle=new d;function iM(e,t,n,i,o){let r=me.toCartesian(t,e._ellipsoid,P3e),a=d.add(r,n,nle),s=!1,c=e._ellipsoid,u=c.cartesianToCartographic(a,tle);Math.abs(t.longitude-u.longitude)>D.PI_OVER_TWO&&(s=!0,a=d.subtract(r,n,nle),u=c.cartesianToCartographic(a,tle)),u.height=0;let f=e.project(u,o);return o=d.subtract(f,i,o),o.z=0,o=d.normalize(o,o),s&&d.negate(o,o),o}var R3e=new d,ile=new d;function ole(e,t,n,i,o,r){let a=d.subtract(t,e,R3e);d.normalize(a,a);let s=n-mle,c=d.multiplyByScalar(a,s,ile);d.add(e,c,o);let u=i-ple;c=d.multiplyByScalar(a,u,ile),d.add(t,c,r)}var M3e=new d;function yV(e,t){let n=cn.getPointDistance(CV,e),i=cn.getPointDistance(CV,t),o=M3e;D.equalsEpsilon(n,0,D.EPSILON2)?(o=VA(t,e,o),d.multiplyByScalar(o,D.EPSILON2,o),d.add(e,o,e)):D.equalsEpsilon(i,0,D.EPSILON2)&&(o=VA(e,t,o),d.multiplyByScalar(o,D.EPSILON2,o),d.add(t,o,t))}function N3e(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(D.equalsEpsilon(n,D.PI,D.EPSILON11)){let o=D.sign(t.longitude);return e.longitude=o*(n-D.EPSILON11),1}else if(D.equalsEpsilon(i,D.PI,D.EPSILON11)){let o=D.sign(e.longitude);return t.longitude=o*(i-D.EPSILON11),2}return 0}var gle=new me,_le=new me,rle=new d,F6=new d,ale=new d,sle=new d,L3e=new d,cle=new d,O3e=[gle,_le],F3e=new ce,Q3e=new d,k3e=new d,U3e=new d,z3e=new d,G3e=new d,V3e=new d,Q6=new d,k6=new d,H3e=new d,W3e=new d,j3e=new d,lle=new d,Y3e=new d,q3e=new d,K3e=new xn,X3e=new xn,ule=new d,J3e=new d,fle=new d,Z3e=[new le,new le],yle=[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],dle=yle.length;function $3e(e,t,n,i,o,r,a){let s,c,u=t._ellipsoid,f=n.length/3-1,h=f*8,p=h*4,A=f*36,m=h>65535?new Uint32Array(A):new Uint16Array(A),_=new Float64Array(h*3),y=new Float32Array(p),C=new Float32Array(p),E=new Float32Array(p),b=new Float32Array(p),x=new Float32Array(p),S,B,v,P;a&&(S=new Float32Array(p),B=new Float32Array(p),v=new Float32Array(p),P=new Float32Array(h*2));let N=r.length/2,L=0,g=gle;g.height=0;let I=_le;I.height=0;let T=rle,w=F6;if(a)for(c=0,s=1;s<N;s++)g.latitude=r[c],g.longitude=r[c+1],I.latitude=r[c+2],I.longitude=r[c+3],T=t.project(g,T),w=t.project(I,w),L+=d.distance(T,w),c+=2;let R=i.length/3;w=d.unpack(i,0,w);let O=0;for(c=3,s=1;s<R;s++)T=d.clone(w,T),w=d.unpack(i,c,w),O+=d.distance(T,w),c+=3;let G;c=3;let F=0,U=0,Q=0,H=0,Y=!1,$=d.unpack(n,0,sle),W=d.unpack(i,0,F6),K=d.unpack(o,0,cle);if(e){let Ne=d.unpack(n,n.length-6,ale);ele(K,Ne,$,W)&&(K=d.negate(K,K))}let Z=0,pe=0,ge=0;for(s=0;s<f;s++){let Ne=d.clone($,ale),Le=d.clone(W,rle),Oe=d.clone(K,L3e);Y&&(Oe=d.negate(Oe,Oe)),$=d.unpack(n,c,sle),W=d.unpack(i,c,F6),K=d.unpack(o,c,cle),Y=ele(K,Ne,$,W),g.latitude=r[F],g.longitude=r[F+1],I.latitude=r[F+2],I.longitude=r[F+3];let ot,Fe,_t,rt;if(a){let Ln=N3e(g,I);ot=t.project(g,G3e),Fe=t.project(I,V3e);let Ko=VA(Fe,ot,ule);Ko.y=Math.abs(Ko.y),_t=Q6,rt=k6,Ln===0||d.dot(Ko,d.UNIT_Y)>hle?(_t=iM(t,g,Oe,ot,Q6),rt=iM(t,I,K,Fe,k6)):Ln===1?(rt=iM(t,I,K,Fe,k6),_t.x=0,_t.y=D.sign(g.longitude-Math.abs(I.longitude)),_t.z=0):(_t=iM(t,g,Oe,ot,Q6),rt.x=0,rt.y=D.sign(g.longitude-I.longitude),rt.z=0)}let Ye=d.distance(Le,W),st=xn.fromCartesian(Ne,K3e),ft=d.subtract($,Ne,H3e),St=d.normalize(ft,lle),Ie=d.subtract(Le,Ne,W3e);Ie=d.normalize(Ie,Ie);let Se=d.cross(St,Ie,lle);Se=d.normalize(Se,Se);let Kt=d.cross(Ie,Oe,Y3e);Kt=d.normalize(Kt,Kt);let mt=d.subtract(W,$,j3e);mt=d.normalize(mt,mt);let Gt=d.cross(K,mt,q3e);Gt=d.normalize(Gt,Gt);let Hn=Ye/O,Je=Z/O,fo=0,Vt,Lo,io,Qi=0,Yo=0;if(a){fo=d.distance(ot,Fe),Vt=xn.fromCartesian(ot,X3e),Lo=d.subtract(Fe,ot,ule),io=d.normalize(Lo,J3e);let Ln=io.x;io.x=io.y,io.y=-Ln,Qi=fo/L,Yo=pe/L}for(G=0;G<8;G++){let Ln=H+G*4,Ko=U+G*2,Xo=Ln+3,ss=G<4?1:-1,Hi=G===2||G===3||G===6||G===7?1:-1;d.pack(st.high,y,Ln),y[Xo]=ft.x,d.pack(st.low,C,Ln),C[Xo]=ft.y,d.pack(Kt,E,Ln),E[Xo]=ft.z,d.pack(Gt,b,Ln),b[Xo]=Hn*ss,d.pack(Se,x,Ln);let Do=Je*Hi;Do===0&&Hi<0&&(Do=9),x[Xo]=Do,a&&(S[Ln]=Vt.high.x,S[Ln+1]=Vt.high.y,S[Ln+2]=Vt.low.x,S[Ln+3]=Vt.low.y,v[Ln]=-_t.y,v[Ln+1]=_t.x,v[Ln+2]=rt.y,v[Ln+3]=-rt.x,B[Ln]=Lo.x,B[Ln+1]=Lo.y,B[Ln+2]=io.x,B[Ln+3]=io.y,P[Ko]=Qi*ss,Do=Yo*Hi,Do===0&&Hi<0&&(Do=9),P[Ko+1]=Do)}let ai=U3e,Xn=z3e,oo=Q3e,Oo=k3e,yo=ce.fromCartographicArray(O3e,F3e),or=Di.getMinimumMaximumHeights(yo,u),qo=or.minimumTerrainHeight,bn=or.maximumTerrainHeight;ge+=Math.abs(qo),ge+=Math.abs(bn),ole(Ne,Le,qo,bn,ai,oo),ole($,W,qo,bn,Xn,Oo);let wi=d.multiplyByScalar(Se,D.EPSILON5,fle);d.add(ai,wi,ai),d.add(Xn,wi,Xn),d.add(oo,wi,oo),d.add(Oo,wi,Oo),yV(ai,Xn),yV(oo,Oo),d.pack(ai,_,Q),d.pack(Xn,_,Q+3),d.pack(Oo,_,Q+6),d.pack(oo,_,Q+9),wi=d.multiplyByScalar(Se,-2*D.EPSILON5,fle),d.add(ai,wi,ai),d.add(Xn,wi,Xn),d.add(oo,wi,oo),d.add(Oo,wi,Oo),yV(ai,Xn),yV(oo,Oo),d.pack(ai,_,Q+12),d.pack(Xn,_,Q+15),d.pack(Oo,_,Q+18),d.pack(oo,_,Q+21),F+=2,c+=3,U+=16,Q+=24,H+=32,Z+=Ye,pe+=fo}c=0;let re=0;for(s=0;s<f;s++){for(G=0;G<dle;G++)m[c+G]=yle[G]+re;re+=8,c+=dle}let ye=Z3e;le.fromVertices(n,d.ZERO,3,ye[0]),le.fromVertices(i,d.ZERO,3,ye[1]);let Ce=le.fromBoundingSpheres(ye);Ce.radius+=ge/(f*2);let Pe={position:new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,normalize:!1,values:_}),startHiAndForwardOffsetX:ly(y),startLoAndForwardOffsetY:ly(C),startNormalAndForwardOffsetZ:ly(E),endNormalAndTextureCoordinateNormalizationX:ly(b),rightNormalAndTextureCoordinateNormalizationY:ly(x)};return a&&(Pe.startHiLo2D=ly(S),Pe.offsetAndRight2D=ly(B),Pe.startEndNormals2D=ly(v),Pe.texcoordNormalization2D=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,normalize:!1,values:P})),new yt({attributes:Pe,indices:m,boundingSphere:Ce})}function ly(e){return new Me({componentDatatype:j.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}uy._projectNormal=iM;var HE=uy;var oM=`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 rM=`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 aM=`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 sM=`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 cM=`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 Rl=`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 eUe=`#define CLIP_POLYLINE
${Rl}
${cM}`,tUe=kE;function WE(e){e=e??V.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=WE.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??eUe,this._fragmentShaderSource=e.fragmentShaderSource??tUe,this._renderState=Io.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(WE.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}}});WE.VERTEX_FORMAT=ke.POSITION_ONLY;WE.prototype.getFragmentShaderSource=Io.prototype.getFragmentShaderSource;WE.prototype.isTranslucent=Io.prototype.isTranslucent;WE.prototype.getRenderState=Io.prototype.getRenderState;var Ra=WE;var lM=`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 jE=`#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 nUe=`#define CLIP_POLYLINE
${Rl}
${lM}`,iUe=jE;function YE(e){e=e??V.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=YE.VERTEX_FORMAT;this.material=l(e.material)?e.material:Yi.fromType(Yi.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??nUe,this._fragmentShaderSource=e.fragmentShaderSource??iUe,this._renderState=Io.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(YE.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}}});YE.VERTEX_FORMAT=ke.POSITION_AND_ST;YE.prototype.getFragmentShaderSource=Io.prototype.getFragmentShaderSource;YE.prototype.isTranslucent=Io.prototype.isTranslucent;YE.prototype.getRenderState=Io.prototype.getRenderState;var ic=YE;function HA(e){e=e??V.EMPTY_OBJECT,this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new ic),this.appearance=t,this.show=e.show??!0,this.classificationType=e.classificationType??ei.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._debugShowShadowVolume=e.debugShowShadowVolume??!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous: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=Cle(!1),this._renderState3DTiles=Cle(!0),this._renderStateMorph=Ve.fromCache({cull:{enabled:!0,face:Ni.FRONT},depthTest:{enabled:!0},blending:sn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(HA.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}}});HA.initializeTerrainHeights=function(){return Di.initialize()};function oUe(e,t,n){let i=t.context,o=e._primitive,r=o._attributeLocations,a=o._batchTable.getVertexShaderCallback()(sM);a=Nn._appendShowToShader(o,a),a=Nn._appendDistanceDisplayConditionToShader(o,a),a=Nn._modifyShaderPosition(e,a,t.scene3DOnly);let s=o._batchTable.getVertexShaderCallback()(aM);s=Nn._appendShowToShader(o,s),s=Nn._appendDistanceDisplayConditionToShader(o,s),s=Nn._modifyShaderPosition(e,s,t.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()(oM),u=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],f="",h="";l(n.material)?(h=l(n.material)?n.material.shaderSource:"",h.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&u.push("ANGLE_VARYING"),h.search(/in\s+float\s+v_width;/g)!==-1&&u.push("WIDTH_VARYING")):f="PER_INSTANCE_COLOR",u.push(f);let p=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",f]:[f],A=new We({defines:u,sources:[a]}),m=new We({defines:p,sources:[h,c]});e._sp=$t.replaceCache({context:i,shaderProgram:o._sp,vertexShaderSource:A,fragmentShaderSource:m,attributeLocations:r});let _=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!l(_)){let C=new We({defines:u.concat(["COLUMBUS_VIEW_2D"]),sources:[a]});_=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:C,fragmentShaderSource:m,attributeLocations:r})}e._sp2D=_;let y=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!l(y)){let C=new We({defines:u.concat([`MAX_TERRAIN_HEIGHT ${Di._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[s]});c=o._batchTable.getVertexShaderCallback()(rM);let E=new We({defines:p,sources:[h,c]});y=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:C,fragmentShaderSource:E,attributeLocations:r})}e._spMorph=y}function Cle(e){return Ve.fromCache({cull:{enabled:!0},blending:sn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:ti.EQUAL,frontOperation:{fail:wt.KEEP,zFail:wt.KEEP,zPass:wt.KEEP},backFunction:ti.EQUAL,backOperation:{fail:wt.KEEP,zFail:wt.KEEP,zPass:wt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK}})}function rUe(e,t,n,i,o,r){let a=e._primitive,s=a._va.length;o.length=s,r.length=s;let u=t instanceof Ra?{}:n._uniforms,f=a._batchTable.getUniformMapCallback()(u);for(let h=0;h<s;h++){let p=a._va[h],A=o[h];l(A)||(A=o[h]=new nt({owner:e,primitiveType:a._primitiveType})),A.vertexArray=p,A.renderState=e._renderState,A.shaderProgram=e._sp,A.uniformMap=f,A.pass=Be.TERRAIN_CLASSIFICATION,A.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";let m=nt.shallowClone(A,A.derivedCommands.tileset);m.renderState=e._renderState3DTiles,m.pass=Be.CESIUM_3D_TILE_CLASSIFICATION,A.derivedCommands.tileset=m;let _=nt.shallowClone(A,A.derivedCommands.color2D);_.shaderProgram=e._sp2D,A.derivedCommands.color2D=_;let y=nt.shallowClone(m,m.derivedCommands.color2D);y.shaderProgram=e._sp2D,m.derivedCommands.color2D=y;let C=nt.shallowClone(A,A.derivedCommands.colorMorph);C.renderState=e._renderStateMorph,C.shaderProgram=e._spMorph,C.pickId="czm_batchTable_pickColor(v_batchId)",A.derivedCommands.colorMorph=C}}function Ele(e,t,n,i,o,r,a){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=a,n.commandList.push(t)}function aUe(e,t,n,i,o,r,a){let s=e._primitive;Nn._updateBoundingVolumes(s,t,o);let c;t.mode===oe.SCENE3D?c=s._boundingSphereWC:t.mode===oe.COLUMBUS_VIEW?c=s._boundingSphereCV:t.mode===oe.SCENE2D&&l(s._boundingSphere2D)?c=s._boundingSphere2D:l(s._boundingSphereMorph)&&(c=s._boundingSphereMorph);let u=t.mode===oe.MORPHING,f=e.classificationType,h=f!==ei.CESIUM_3D_TILE,p=f!==ei.TERRAIN&&!u,A,m=t.passes;if(m.render||m.pick&&s.allowPicking){let _=n.length;for(let y=0;y<_;++y){let C=c[y];h&&(A=n[y],Ele(e,A,t,o,r,C,a)),p&&(A=n[y].derivedCommands.tileset,Ele(e,A,t,o,r,C,a))}}}HA.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!Di.initialized){HA.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,a=new Array(r),s;for(t=0;t<r;++t)if(s=o[t].attributes,!l(s)||!l(s.color)){this._hasPerInstanceColors=!1;break}for(t=0;t<r;++t){let c=o[t];s={};let u=c.attributes;for(let f in u)u.hasOwnProperty(f)&&(s[f]=u[f]);l(s.width)||(s.width=new Yc({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=e.scene3DOnly,HE.setProjectionAndEllipsoid(c.geometry,e.mapProjection),a[t]=new Mt({geometry:c.geometry,attributes:s,id:c.id,pickPrimitive:n})}i.geometryInstances=a,i.appearance=this.appearance,i._createShaderProgramFunction=function(c,u,f){oUe(n,u,f)},i._createCommandsFunction=function(c,u,f,h,p,A,m){rUe(n,u,f,h,A,m)},i._updateAndQueueCommandsFunction=function(c,u,f,h,p,A,m,_){aUe(n,u,f,h,p,A,m)},this._primitive=new Nn(i)}if(this.appearance instanceof Ra&&!this._hasPerInstanceColors)throw new de("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))})};HA.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};HA.isSupported=function(e){return e.frameState.context.depthTexture};HA.prototype.isDestroyed=function(){return!1};HA.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,fe(this)};var Mh=HA;var sUe=new k(1,1),cUe=!1,lUe=z.WHITE;function zx(e){e=e??V.EMPTY_OBJECT,this._definitionChanged=new _e,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(zx.prototype,{isConstant:{get:function(){return q.isConstant(this._image)&&q.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:Ae("image"),repeat:Ae("repeat"),color:Ae("color"),transparent:Ae("transparent")});zx.prototype.getType=function(e){return"Image"};var uUe=new X;zx.prototype.getValue=function(e,t){return l(e)||(e=X.now(uUe)),l(t)||(t={}),t.image=q.getValueOrUndefined(this._image,e),t.repeat=q.getValueOrClonedDefault(this._repeat,e,sUe,t.repeat),t.color=q.getValueOrClonedDefault(this._color,e,lUe,t.color),q.getValueOrDefault(this._transparent,e,cUe)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};zx.prototype.equals=function(e){return this===e||e instanceof zx&&q.equals(this._image,e._image)&&q.equals(this._repeat,e._repeat)&&q.equals(this._color,e._color)&&q.equals(this._transparent,e._transparent)};var fy=zx;function fUe(e){if(e instanceof z)return new qt(e);if(typeof e=="string"||e instanceof De||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new fy;return t.image=e,t}}function dUe(e,t){return Ae(e,t,fUe)}var ar=dUe;function uM(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??V.EMPTY_OBJECT)}Object.defineProperties(uM.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Ae("show"),dimensions:Ae("dimensions"),heightReference:Ae("heightReference"),fill:Ae("fill"),material:ar("material"),outline:Ae("outline"),outlineColor:Ae("outlineColor"),outlineWidth:Ae("outlineWidth"),shadows:Ae("shadows"),distanceDisplayCondition:Ae("distanceDisplayCondition")});uM.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 uM(this)};uM.prototype.merge=function(e){this.show=this.show??e.show,this.dimensions=this.dimensions??e.dimensions,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var qE=uM;var hUe={FIXED:0,INERTIAL:1},Li=Object.freeze(hUe);function Gx(){de.throwInstantiationError()}Object.defineProperties(Gx.prototype,{isConstant:{get:de.throwInstantiationError},definitionChanged:{get:de.throwInstantiationError},referenceFrame:{get:de.throwInstantiationError}});Gx.prototype.getValue=de.throwInstantiationError;Gx.prototype.getValueInReferenceFrame=de.throwInstantiationError;Gx.prototype.equals=de.throwInstantiationError;var ble=new J;Gx.convertToReferenceFrame=function(e,t,n,i,o){if(!l(t))return t;if(l(o)||(o=new d),n===i)return d.clone(t,o);let r=At.computeIcrfToCentralBodyFixedMatrix(e,ble);if(n===Li.INERTIAL)return J.multiplyByVector(r,t,o);if(n===Li.FIXED)return J.multiplyByVector(J.transpose(r,ble),t,o)};var Nh=Gx;function KE(e,t){this._definitionChanged=new _e,this._value=d.clone(e),this._referenceFrame=t??Li.FIXED}Object.defineProperties(KE.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===Li.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var mUe=new X;KE.prototype.getValue=function(e,t){return l(e)||(e=X.now(mUe)),this.getValueInReferenceFrame(e,Li.FIXED,t)};KE.prototype.setValue=function(e,t){let n=!1;d.equals(this._value,e)||(n=!0,this._value=d.clone(e)),l(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};KE.prototype.getValueInReferenceFrame=function(e,t,n){return Nh.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};KE.prototype.equals=function(e){return this===e||e instanceof KE&&d.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var Ml=KE;function fM(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(e??V.EMPTY_OBJECT)}Object.defineProperties(fM.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Ae("show"),positions:Ae("positions"),width:Ae("width"),height:Ae("height"),heightReference:Ae("heightReference"),extrudedHeight:Ae("extrudedHeight"),extrudedHeightReference:Ae("extrudedHeightReference"),cornerType:Ae("cornerType"),granularity:Ae("granularity"),fill:Ae("fill"),material:ar("material"),outline:Ae("outline"),outlineColor:Ae("outlineColor"),outlineWidth:Ae("outlineWidth"),shadows:Ae("shadows"),distanceDisplayCondition:Ae("distanceDisplayCondition"),classificationType:Ae("classificationType"),zIndex:Ae("zIndex")});fM.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 fM(this)};fM.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.width=this.width??e.width,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.cornerType=this.cornerType??e.cornerType,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var XE=fM;function pUe(e){return e}function AUe(e,t){return Ae(e,t,pUe)}var Nl=AUe;function dM(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??V.EMPTY_OBJECT)}Object.defineProperties(dM.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Ae("show"),length:Ae("length"),topRadius:Ae("topRadius"),bottomRadius:Ae("bottomRadius"),heightReference:Ae("heightReference"),fill:Ae("fill"),material:ar("material"),outline:Ae("outline"),outlineColor:Ae("outlineColor"),outlineWidth:Ae("outlineWidth"),numberOfVerticalLines:Ae("numberOfVerticalLines"),slices:Ae("slices"),shadows:Ae("shadows"),distanceDisplayCondition:Ae("distanceDisplayCondition")});dM.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 dM(this)};dM.prototype.merge=function(e){this.show=this.show??e.show,this.length=this.length??e.length,this.topRadius=this.topRadius??e.topRadius,this.bottomRadius=this.bottomRadius??e.bottomRadius,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.numberOfVerticalLines=this.numberOfVerticalLines??e.numberOfVerticalLines,this.slices=this.slices??e.slices,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var JE=dM;function hM(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(e??V.EMPTY_OBJECT)}Object.defineProperties(hM.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Ae("show"),semiMajorAxis:Ae("semiMajorAxis"),semiMinorAxis:Ae("semiMinorAxis"),height:Ae("height"),heightReference:Ae("heightReference"),extrudedHeight:Ae("extrudedHeight"),extrudedHeightReference:Ae("extrudedHeightReference"),rotation:Ae("rotation"),stRotation:Ae("stRotation"),granularity:Ae("granularity"),fill:Ae("fill"),material:ar("material"),outline:Ae("outline"),outlineColor:Ae("outlineColor"),outlineWidth:Ae("outlineWidth"),numberOfVerticalLines:Ae("numberOfVerticalLines"),shadows:Ae("shadows"),distanceDisplayCondition:Ae("distanceDisplayCondition"),classificationType:Ae("classificationType"),zIndex:Ae("zIndex")});hM.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 hM(this)};hM.prototype.merge=function(e){this.show=this.show??e.show,this.semiMajorAxis=this.semiMajorAxis??e.semiMajorAxis,this.semiMinorAxis=this.semiMinorAxis??e.semiMinorAxis,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.rotation=this.rotation??e.rotation,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.numberOfVerticalLines=this.numberOfVerticalLines??e.numberOfVerticalLines,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var ZE=hM;function mM(e){this._definitionChanged=new _e,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(e??V.EMPTY_OBJECT)}Object.defineProperties(mM.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Ae("show"),radii:Ae("radii"),innerRadii:Ae("innerRadii"),minimumClock:Ae("minimumClock"),maximumClock:Ae("maximumClock"),minimumCone:Ae("minimumCone"),maximumCone:Ae("maximumCone"),heightReference:Ae("heightReference"),fill:Ae("fill"),material:ar("material"),outline:Ae("outline"),outlineColor:Ae("outlineColor"),outlineWidth:Ae("outlineWidth"),stackPartitions:Ae("stackPartitions"),slicePartitions:Ae("slicePartitions"),subdivisions:Ae("subdivisions"),shadows:Ae("shadows"),distanceDisplayCondition:Ae("distanceDisplayCondition")});mM.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 mM(this)};mM.prototype.merge=function(e){this.show=this.show??e.show,this.radii=this.radii??e.radii,this.innerRadii=this.innerRadii??e.innerRadii,this.minimumClock=this.minimumClock??e.minimumClock,this.maximumClock=this.maximumClock??e.maximumClock,this.minimumCone=this.minimumCone??e.minimumCone,this.maximumCone=this.maximumCone??e.maximumCone,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.stackPartitions=this.stackPartitions??e.stackPartitions,this.slicePartitions=this.slicePartitions??e.slicePartitions,this.subdivisions=this.subdivisions??e.subdivisions,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var $E=mM;function pM(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(e??V.EMPTY_OBJECT)}Object.defineProperties(pM.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Ae("show"),text:Ae("text"),font:Ae("font"),style:Ae("style"),scale:Ae("scale"),showBackground:Ae("showBackground"),backgroundColor:Ae("backgroundColor"),backgroundPadding:Ae("backgroundPadding"),pixelOffset:Ae("pixelOffset"),eyeOffset:Ae("eyeOffset"),horizontalOrigin:Ae("horizontalOrigin"),verticalOrigin:Ae("verticalOrigin"),heightReference:Ae("heightReference"),fillColor:Ae("fillColor"),outlineColor:Ae("outlineColor"),outlineWidth:Ae("outlineWidth"),translucencyByDistance:Ae("translucencyByDistance"),pixelOffsetScaleByDistance:Ae("pixelOffsetScaleByDistance"),scaleByDistance:Ae("scaleByDistance"),distanceDisplayCondition:Ae("distanceDisplayCondition"),disableDepthTestDistance:Ae("disableDepthTestDistance")});pM.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 pM(this)};pM.prototype.merge=function(e){this.show=this.show??e.show,this.text=this.text??e.text,this.font=this.font??e.font,this.style=this.style??e.style,this.scale=this.scale??e.scale,this.showBackground=this.showBackground??e.showBackground,this.backgroundColor=this.backgroundColor??e.backgroundColor,this.backgroundPadding=this.backgroundPadding??e.backgroundPadding,this.pixelOffset=this.pixelOffset??e.pixelOffset,this.eyeOffset=this.eyeOffset??e.eyeOffset,this.horizontalOrigin=this.horizontalOrigin??e.horizontalOrigin,this.verticalOrigin=this.verticalOrigin??e.verticalOrigin,this.heightReference=this.heightReference??e.heightReference,this.fillColor=this.fillColor??e.fillColor,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.translucencyByDistance=this.translucencyByDistance??e.translucencyByDistance,this.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance??e.pixelOffsetScaleByDistance,this.scaleByDistance=this.scaleByDistance??e.scaleByDistance,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this.disableDepthTestDistance??e.disableDepthTestDistance};var Lh=pM;var gUe=new d(1,1,1),_Ue=d.ZERO,yUe=Qe.IDENTITY;function Ile(e,t,n){this.translation=d.clone(e??_Ue),this.rotation=Qe.clone(t??yUe),this.scale=d.clone(n??gUe)}Ile.prototype.equals=function(e){return this===e||l(e)&&d.equals(this.translation,e.translation)&&Qe.equals(this.rotation,e.rotation)&&d.equals(this.scale,e.scale)};var dy=Ile;var G6=new dy;function AM(e){e=e??V.EMPTY_OBJECT,this._definitionChanged=new _e,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(AM.prototype,{isConstant:{get:function(){return q.isConstant(this._translation)&&q.isConstant(this._rotation)&&q.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:Ae("translation"),rotation:Ae("rotation"),scale:Ae("scale")});var CUe=new X;AM.prototype.getValue=function(e,t){return l(e)||(e=X.now(CUe)),l(t)||(t=new dy),t.translation=q.getValueOrClonedDefault(this._translation,e,G6.translation,t.translation),t.rotation=q.getValueOrClonedDefault(this._rotation,e,G6.rotation,t.rotation),t.scale=q.getValueOrClonedDefault(this._scale,e,G6.scale,t.scale),t};AM.prototype.equals=function(e){return this===e||e instanceof AM&&q.equals(this._translation,e._translation)&&q.equals(this._rotation,e._rotation)&&q.equals(this._scale,e._scale)};var e0=AM;function WA(e,t){this._propertyNames=[],this._definitionChanged=new _e,l(e)&&this.merge(e,t)}Object.defineProperties(WA.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(!q.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});WA.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function EUe(e){return new hi(e)}WA.prototype.addProperty=function(e,t,n){this._propertyNames.push(e),Object.defineProperty(this,e,Ae(e,!0,n??EUe)),l(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)};WA.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};var bUe=new X;WA.prototype.getValue=function(e,t){l(e)||(e=X.now(bUe)),l(t)||(t={});let n=this._propertyNames;for(let i=0,o=n.length;i<o;i++){let r=n[i];t[r]=q.getValueOrUndefined(this[r],e,t[r])}return t};WA.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 a=i[o],s=this[a],c=e[a];s===void 0&&n.indexOf(a)===-1&&this.addProperty(a,void 0,t),c!==void 0&&(s!==void 0?l(s)&&l(s.merge)&&s.merge(c):l(c)&&l(c.merge)&&l(c.clone)?this[a]=c.clone():this[a]=c)}};function IUe(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 a=n[r];if(i.indexOf(a)===-1||!q.equals(e[a],t[a]))return!1}return!0}WA.prototype.equals=function(e){return this===e||e instanceof WA&&IUe(this,e)};var Ll=WA;function xle(e){return new e0(e)}function xUe(e){return new Ll(e,xle)}function TUe(e){return new Ll(e)}function SUe(e){return new Ll(e)}function gM(e){this._definitionChanged=new _e,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._hasVerticalExaggeration=void 0,this._hasVerticalExaggerationSubscription=void 0,this._enableVerticalExaggeration=void 0,this._enableVerticalExaggerationSubscription=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._environmentMapOptions=void 0,this._environmentMapOptionsSubscription=void 0,this._lightColor=void 0,this._lightColorSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._articulations=void 0,this._articulationsSubscription=void 0,this._clippingPlanes=void 0,this._clippingPlanesSubscription=void 0,this._customShader=void 0,this._customShaderSubscription=void 0,this._marsOptions=e&&e.marsOptions||{},this.merge(e??V.EMPTY_OBJECT)}Object.defineProperties(gM.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Ae("show"),uri:Ae("uri"),scale:Ae("scale"),enableVerticalExaggeration:Ae("enableVerticalExaggeration"),minimumPixelSize:Ae("minimumPixelSize"),maximumScale:Ae("maximumScale"),incrementallyLoadTextures:Ae("incrementallyLoadTextures"),runAnimations:Ae("runAnimations"),clampAnimations:Ae("clampAnimations"),shadows:Ae("shadows"),heightReference:Ae("heightReference"),silhouetteColor:Ae("silhouetteColor"),silhouetteSize:Ae("silhouetteSize"),color:Ae("color"),colorBlendMode:Ae("colorBlendMode"),colorBlendAmount:Ae("colorBlendAmount"),imageBasedLightingFactor:Ae("imageBasedLightingFactor"),environmentMapOptions:Ae("environmentMapOptions",void 0,SUe),lightColor:Ae("lightColor"),distanceDisplayCondition:Ae("distanceDisplayCondition"),nodeTransformations:Ae("nodeTransformations",void 0,xUe),articulations:Ae("articulations",void 0,TUe),clippingPlanes:Ae("clippingPlanes"),customShader:Ae("customShader")});gM.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.scale=this.scale,e.enableVerticalExaggeration=this.enableVerticalExaggeration,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.environmentMapOptions=this.environmentMapOptions,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 gM(this)};gM.prototype.merge=function(e){this.show=this.show??e.show,this.uri=this.uri??e.uri,this.scale=this.scale??e.scale,this.enableVerticalExaggeration=this.enableVerticalExaggeration??e.enableVerticalExaggeration,this.minimumPixelSize=this.minimumPixelSize??e.minimumPixelSize,this.maximumScale=this.maximumScale??e.maximumScale,this.incrementallyLoadTextures=this.incrementallyLoadTextures??e.incrementallyLoadTextures,this.runAnimations=this.runAnimations??e.runAnimations,this.clampAnimations=this.clampAnimations??e.clampAnimations,this.shadows=this.shadows??e.shadows,this.heightReference=this.heightReference??e.heightReference,this.silhouetteColor=this.silhouetteColor??e.silhouetteColor,this.silhouetteSize=this.silhouetteSize??e.silhouetteSize,this.color=this.color??e.color,this.colorBlendMode=this.colorBlendMode??e.colorBlendMode,this.colorBlendAmount=this.colorBlendAmount??e.colorBlendAmount,this.imageBasedLightingFactor=this.imageBasedLightingFactor??e.imageBasedLightingFactor,this.environmentMapOptions=this.environmentMapOptions??e.environmentMapOptions,this.lightColor=this.lightColor??e.lightColor,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.clippingPlanes=this.clippingPlanes??e.clippingPlanes,this.customShader=this.customShader??e.customShader;let t=e.nodeTransformations;if(l(t)){let i=this.nodeTransformations;l(i)?i.merge(t):this.nodeTransformations=new Ll(t,xle)}let n=e.articulations;if(l(n)){let i=this.articulations;l(i)?i.merge(n):this.articulations=new Ll(n)}};var jA=gM;function _M(e){this._definitionChanged=new _e,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(e??V.EMPTY_OBJECT)}Object.defineProperties(_M.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Ae("show"),uri:Ae("uri"),maximumScreenSpaceError:Ae("maximumScreenSpaceError")});_M.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new _M(this)};_M.prototype.merge=function(e){this.show=this.show??e.show,this.uri=this.uri??e.uri,this.maximumScreenSpaceError=this.maximumScreenSpaceError??e.maximumScreenSpaceError};var t0=_M;function yM(e){this._definitionChanged=new _e,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._relativeTo=void 0,this._relativeToSubscription=void 0,this.merge(e??V.EMPTY_OBJECT)}Object.defineProperties(yM.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Ae("show"),leadTime:Ae("leadTime"),trailTime:Ae("trailTime"),width:Ae("width"),resolution:Ae("resolution"),material:ar("material"),distanceDisplayCondition:Ae("distanceDisplayCondition"),relativeTo:Ae("relativeTo")});yM.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.relativeTo=this.relativeTo,e):new yM(this)};yM.prototype.merge=function(e){this.show=this.show??e.show,this.leadTime=this.leadTime??e.leadTime,this.trailTime=this.trailTime??e.trailTime,this.width=this.width??e.width,this.resolution=this.resolution??e.resolution,this.material=this.material??e.material,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.relativeTo=this.relativeTo??e.relativeTo};var YA=yM;function CM(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??V.EMPTY_OBJECT)}Object.defineProperties(CM.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Ae("show"),plane:Ae("plane"),dimensions:Ae("dimensions"),fill:Ae("fill"),material:ar("material"),outline:Ae("outline"),outlineColor:Ae("outlineColor"),outlineWidth:Ae("outlineWidth"),shadows:Ae("shadows"),distanceDisplayCondition:Ae("distanceDisplayCondition")});CM.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 CM(this)};CM.prototype.merge=function(e){this.show=this.show??e.show,this.plane=this.plane??e.plane,this.dimensions=this.dimensions??e.dimensions,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var EM=CM;function bM(e){this._definitionChanged=new _e,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(e??V.EMPTY_OBJECT)}Object.defineProperties(bM.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Ae("show"),pixelSize:Ae("pixelSize"),heightReference:Ae("heightReference"),color:Ae("color"),outlineColor:Ae("outlineColor"),outlineWidth:Ae("outlineWidth"),scaleByDistance:Ae("scaleByDistance"),translucencyByDistance:Ae("translucencyByDistance"),distanceDisplayCondition:Ae("distanceDisplayCondition"),disableDepthTestDistance:Ae("disableDepthTestDistance"),splitDirection:Ae("splitDirection")});bM.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 bM(this)};bM.prototype.merge=function(e){this.show=this.show??e.show,this.pixelSize=this.pixelSize??e.pixelSize,this.heightReference=this.heightReference??e.heightReference,this.color=this.color??e.color,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.scaleByDistance=this.scaleByDistance??e.scaleByDistance,this.translucencyByDistance=this._translucencyByDistance??e.translucencyByDistance,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this.disableDepthTestDistance??e.disableDepthTestDistance,this.splitDirection=this.splitDirection??e.splitDirection};var n0=bM;function wUe(e,t){this.positions=l(e)?e:[],this.holes=l(t)?t:[]}var wc=wUe;function BUe(e){return Array.isArray(e)&&(e=new wc(e)),new hi(e)}function IM(e){this._definitionChanged=new _e,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(e??V.EMPTY_OBJECT)}Object.defineProperties(IM.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Ae("show"),hierarchy:Ae("hierarchy",void 0,BUe),height:Ae("height"),heightReference:Ae("heightReference"),extrudedHeight:Ae("extrudedHeight"),extrudedHeightReference:Ae("extrudedHeightReference"),stRotation:Ae("stRotation"),granularity:Ae("granularity"),fill:Ae("fill"),material:ar("material"),outline:Ae("outline"),outlineColor:Ae("outlineColor"),outlineWidth:Ae("outlineWidth"),perPositionHeight:Ae("perPositionHeight"),closeTop:Ae("closeTop"),closeBottom:Ae("closeBottom"),arcType:Ae("arcType"),shadows:Ae("shadows"),distanceDisplayCondition:Ae("distanceDisplayCondition"),classificationType:Ae("classificationType"),zIndex:Ae("zIndex"),textureCoordinates:Ae("textureCoordinates")});IM.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 IM(this)};IM.prototype.merge=function(e){this.show=this.show??e.show,this.hierarchy=this.hierarchy??e.hierarchy,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.perPositionHeight=this.perPositionHeight??e.perPositionHeight,this.closeTop=this.closeTop??e.closeTop,this.closeBottom=this.closeBottom??e.closeBottom,this.arcType=this.arcType??e.arcType,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex,this.textureCoordinates=this.textureCoordinates??e.textureCoordinates};var Oh=IM;function xM(e){this._definitionChanged=new _e,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(e??V.EMPTY_OBJECT)}Object.defineProperties(xM.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Ae("show"),positions:Ae("positions"),width:Ae("width"),granularity:Ae("granularity"),material:ar("material"),depthFailMaterial:ar("depthFailMaterial"),arcType:Ae("arcType"),clampToGround:Ae("clampToGround"),shadows:Ae("shadows"),distanceDisplayCondition:Ae("distanceDisplayCondition"),classificationType:Ae("classificationType"),zIndex:Ae("zIndex")});xM.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 xM(this)};xM.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.width=this.width??e.width,this.granularity=this.granularity??e.granularity,this.material=this.material??e.material,this.depthFailMaterial=this.depthFailMaterial??e.depthFailMaterial,this.arcType=this.arcType??e.arcType,this.clampToGround=this.clampToGround??e.clampToGround,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var qc=xM;function TM(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._shape=void 0,this._shapeSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubsription=void 0,this.merge(e??V.EMPTY_OBJECT)}Object.defineProperties(TM.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Ae("show"),positions:Ae("positions"),shape:Ae("shape"),cornerType:Ae("cornerType"),granularity:Ae("granularity"),fill:Ae("fill"),material:ar("material"),outline:Ae("outline"),outlineColor:Ae("outlineColor"),outlineWidth:Ae("outlineWidth"),shadows:Ae("shadows"),distanceDisplayCondition:Ae("distanceDisplayCondition")});TM.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 TM(this)};TM.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.shape=this.shape??e.shape,this.cornerType=this.cornerType??e.cornerType,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var i0=TM;function SM(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._coordinates=void 0,this._coordinatesSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distancedisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(e??V.EMPTY_OBJECT)}Object.defineProperties(SM.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Ae("show"),coordinates:Ae("coordinates"),height:Ae("height"),heightReference:Ae("heightReference"),extrudedHeight:Ae("extrudedHeight"),extrudedHeightReference:Ae("extrudedHeightReference"),rotation:Ae("rotation"),stRotation:Ae("stRotation"),granularity:Ae("granularity"),fill:Ae("fill"),material:ar("material"),outline:Ae("outline"),outlineColor:Ae("outlineColor"),outlineWidth:Ae("outlineWidth"),shadows:Ae("shadows"),distanceDisplayCondition:Ae("distanceDisplayCondition"),classificationType:Ae("classificationType"),zIndex:Ae("zIndex")});SM.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 SM(this)};SM.prototype.merge=function(e){this.show=this.show??e.show,this.coordinates=this.coordinates??e.coordinates,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.rotation=this.rotation??e.rotation,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var Fh=SM;function wM(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._minimumHeights=void 0,this._minimumHeightsSubscription=void 0,this._maximumHeights=void 0,this._maximumHeightsSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??V.EMPTY_OBJECT)}Object.defineProperties(wM.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Ae("show"),positions:Ae("positions"),minimumHeights:Ae("minimumHeights"),maximumHeights:Ae("maximumHeights"),granularity:Ae("granularity"),fill:Ae("fill"),material:ar("material"),outline:Ae("outline"),outlineColor:Ae("outlineColor"),outlineWidth:Ae("outlineWidth"),shadows:Ae("shadows"),distanceDisplayCondition:Ae("distanceDisplayCondition")});wM.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 wM(this)};wM.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.minimumHeights=this.minimumHeights??e.minimumHeights,this.maximumHeights=this.maximumHeights??e.maximumHeights,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var qA=wM;var DUe=new me,V6=[];function vUe(e){return new Ml(e)}function PUe(e){return Ae(e,void 0,vUe)}function Rs(e,t){return Ae(e,void 0,function(n){return n instanceof t?n:new t(n)})}function yd(e){e=e??V.EMPTY_OBJECT;let t=e.id;l(t)||(t=Jn()),this._availability=void 0,this._id=t,this._definitionChanged=new _e,this._name=e.name,this._show=e.show??!0,this._trackingReferenceFrame=e.trackingReferenceFrame??UA.AUTODETECT,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",...V6],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 H6(e,t,n){let i=t.length;for(let o=0;o<i;o++){let r=t[o],a=r._show;(!n&&a)!==(n&&a)&&H6(r,r._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(yd.prototype,{availability:Nl("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:Nl("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&&H6(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},trackingReferenceFrame:Nl("trackingReferenceFrame"),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&&H6(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:Rs("billboard",jc),box:Rs("box",qE),corridor:Rs("corridor",XE),cylinder:Rs("cylinder",JE),description:Ae("description"),ellipse:Rs("ellipse",ZE),ellipsoid:Rs("ellipsoid",$E),label:Rs("label",Lh),model:Rs("model",jA),tileset:Rs("tileset",t0),orientation:Ae("orientation"),path:Rs("path",YA),plane:Rs("plane",EM),point:Rs("point",n0),polygon:Rs("polygon",Oh),polyline:Rs("polyline",qc),polylineVolume:Rs("polylineVolume",i0),properties:Rs("properties",Ll),position:PUe("position"),rectangle:Rs("rectangle",Fh),viewFrom:Ae("viewFrom"),wall:Rs("wall",qA)});yd.registerEntityType=function(e,t){Object.defineProperties(yd.prototype,{[e]:Rs(e,t)}),V6.includes(e)||V6.push(e)};yd.prototype.isAvailable=function(e){let t=this._availability;return!l(t)||t.contains(e)};yd.prototype.addProperty=function(e){this._propertyNames.push(e),Object.defineProperty(this,e,Nl(e,!0))};yd.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e]};yd.prototype.merge=function(e){this.name=this.name??e.name,this.availability=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 a=this[r],s=e[r];!l(a)&&t.indexOf(r)===-1&&this.addProperty(r),l(s)&&(l(a)?l(a.merge)&&a.merge(s):l(s.merge)&&l(s.clone)?this[r]=s.clone():this[r]=s)}};var Tle=new J,Sle=new d,wle=new Qe;yd.prototype.computeModelMatrix=function(e,t){let n=q.getValueOrUndefined(this._position,e,Sle);if(!l(n))return;let i=q.getValueOrUndefined(this._orientation,e,wle);return l(i)?t=M.fromRotationTranslation(J.fromQuaternion(i,Tle),n,t):t=At.eastNorthUpToFixedFrame(n,void 0,t),t};yd.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,o){let r=q.getValueOrDefault(t,e,it.NONE),a=q.getValueOrUndefined(this._position,e,Sle);if(r===it.NONE||!l(a)||d.equalsEpsilon(a,d.ZERO,D.EPSILON8))return this.computeModelMatrix(e,o);let s=i.cartesianToCartographic(a,DUe);gd(r)?s.height=n:s.height+=n,a=i.cartographicToCartesian(s,a);let c=q.getValueOrUndefined(this._orientation,e,wle);return l(c)?o=M.fromRotationTranslation(J.fromQuaternion(c,Tle),a,o):o=At.eastNorthUpToFixedFrame(a,void 0,o),o};yd.supportsMaterialsforEntitiesOnTerrain=function(e){return vl.supportsMaterials(e)};yd.supportsPolylinesOnTerrain=function(e){return Mh.isSupported(e)};var Zo=yd;var RUe=new qt(z.WHITE),MUe=new hi(!0),NUe=new hi(!0),LUe=new hi(!1),OUe=new hi(z.BLACK),FUe=new hi(wn.DISABLED),QUe=new hi(new zt),kUe=new hi(ei.BOTH);function Ol(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 _e,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=Zo.supportsMaterialsforEntitiesOnTerrain(e.scene)}Object.defineProperties(Ol.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)&&q.isConstant(this._showProperty)&&q.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)&&q.isConstant(this._showProperty)&&q.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}}});Ol.prototype.isOutlineVisible=function(e){let t=this._entity;return(this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e))??!1};Ol.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e))??!1};Ol.prototype.createFillGeometryInstance=de.throwInstantiationError;Ol.prototype.createOutlineGeometryInstance=de.throwInstantiationError;Ol.prototype.isDestroyed=function(){return!1};Ol.prototype.destroy=function(){fe(this)};Ol.prototype._isHidden=function(e,t){let n=t.show;return l(n)&&n.isConstant&&!n.getValue(Xe.MINIMUM_VALUE)};Ol.prototype._isOnTerrain=function(e,t){return!1};Ol.prototype._getIsClosed=function(e){return!0};Ol.prototype._isDynamic=de.throwInstantiationError;Ol.prototype._setStaticOptions=de.throwInstantiationError;Ol.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,a=l(r)&&r.isConstant?r.getValue(Xe.MINIMUM_VALUE):!0,s=o.outline,c=l(s);if(c&&s.isConstant&&(c=s.getValue(Xe.MINIMUM_VALUE)),!a&&!c){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let u=o.show;if(this._isHidden(e,o)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}this._materialProperty=o.material??RUe,this._fillProperty=r??NUe,this._showProperty=u??MUe,this._showOutlineProperty=o.outline??LUe,this._outlineColorProperty=c?o.outlineColor??OUe:void 0,this._shadowsProperty=o.shadows??FUe,this._distanceDisplayConditionProperty=o.distanceDisplayCondition??QUe,this._classificationTypeProperty=o.classificationType??kUe,this._fillEnabled=a;let f=this._isOnTerrain(e,o)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof qt);if(c&&f&&(It(It.geometryOutlines),c=!1),this._onTerrain=f,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 h=o.outlineWidth;this._outlineWidth=l(h)?h.getValue(Xe.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Ol.prototype.createDynamicUpdater=function(e,t){return new this.constructor.DynamicGeometryUpdater(this,e,t)};var Ii=Ol;function Vx(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new _e,this.setCallback(e,t)}Object.defineProperties(Vx.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}});var UUe=new X;Vx.prototype.getValue=function(e,t){return l(e)||(e=X.now(UUe)),this._callback(e,t)};Vx.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};Vx.prototype.equals=function(e){return this===e||e instanceof Vx&&this._callback===e._callback&&this._isConstant===e._isConstant};var Qh=Vx;var Ble=new d;function Hx(e,t,n,i){this._scene=e,this._heightReference=n,this._extrudedHeightReference=i,this._positionProperty=t,this._position=new d,this._cartographicPosition=new me,this._normal=new d,this._definitionChanged=new _e,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(Xe.MINIMUM_VALUE,Ble);if(!l(r)||d.equals(r,d.ZERO)||!l(e.globe))return;this._position=d.clone(r,this._position),this._updateClamping(),this._normal=e.ellipsoid.geodeticSurfaceNormal(r,this._normal)}}Object.defineProperties(Hx.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});Hx.prototype._updateClamping=function(){l(this._removeCallbackFunc)&&this._removeCallbackFunc();let e=this._scene,t=this._position;if(d.equals(t,d.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=a=>{this._terrainHeight=a.height,this.definitionChanged.raiseEvent()};this._removeCallbackFunc=e.updateHeight(i,r,this._heightReference)};var zUe=new X;Hx.prototype.getValue=function(e,t){l(e)||(e=X.now(zUe));let n=q.getValueOrDefault(this._heightReference,e,it.NONE),i=q.getValueOrDefault(this._extrudedHeightReference,e,it.NONE);if(n===it.NONE&&!Px(i))return this._position=d.clone(d.ZERO,this._position),d.clone(d.ZERO,t);if(this._positionProperty.isConstant)return d.multiplyByScalar(this._normal,this._terrainHeight,t);let o=this._scene,r=this._positionProperty.getValue(e,Ble);if(!l(r)||d.equals(r,d.ZERO)||!l(o.globe))return d.clone(d.ZERO,t);if(d.equalsEpsilon(this._position,r,D.EPSILON10))return d.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=d.clone(r,this._position),this._updateClamping();let a=o.ellipsoid.geodeticSurfaceNormal(r,this._normal);return d.multiplyByScalar(a,this._terrainHeight,t)};Hx.prototype.isDestroyed=function(){return!1};Hx.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),fe(this)};var o0=Hx;function GUe(e,t,n,i){if(Ii.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 a=new Qh(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new o0(this._scene,a,r)}}var KA=GUe;var Dle=d.ZERO,vle=new d,VUe=new d,Ple=new z;function HUe(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function mf(e,t){Ii.call(this,{entity:e,scene:t,geometryOptions:new HUe(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}l(Object.create)&&(mf.prototype=Object.create(Ii.prototype),mf.prototype.constructor=mf);Object.defineProperties(mf.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});mf.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=$n.fromDistanceDisplayCondition(o),a={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof qt){let s;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,Ple)),l(s)||(s=z.WHITE),a.color=Jt.fromColor(s)}return l(this._options.offsetAttribute)&&(a.offset=go.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Dle,vle))),new Mt({id:t,geometry:Ic.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:a})};mf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Ple),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:$n.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=go.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Dle,vle))),new Mt({id:t,geometry:Rh.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:r})};mf.prototype._computeCenter=function(e,t){return q.getValueOrUndefined(this._entity.position,e,t)};mf.prototype._isHidden=function(e,t){return!l(t.dimensions)||!l(e.position)||Ii.prototype._isHidden.call(this,e,t)};mf.prototype._isDynamic=function(e,t){return!e.position.isConstant||!q.isConstant(e.orientation)||!t.dimensions.isConstant||!q.isConstant(t.outlineWidth)};mf.prototype._setStaticOptions=function(e,t){let n=q.getValueOrDefault(t.heightReference,Xe.MINIMUM_VALUE,it.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof qt?gn.VERTEX_FORMAT:_o.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(Xe.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==it.NONE?mn.ALL:void 0};mf.prototype._onEntityPropertyChanged=KA;mf.DynamicGeometryUpdater=Wx;function Wx(e,t,n){bi.call(this,e,t,n)}l(Object.create)&&(Wx.prototype=Object.create(bi.prototype),Wx.prototype.constructor=Wx);Wx.prototype._isHidden=function(e,t,n){let i=q.getValueOrUndefined(e.position,n,VUe),o=this._options.dimensions;return!l(i)||!l(o)||bi.prototype._isHidden.call(this,e,t,n)};Wx.prototype._setOptions=function(e,t,n){let i=q.getValueOrDefault(t.heightReference,n,it.NONE),o=this._options;o.dimensions=q.getValueOrUndefined(t.dimensions,n,o.dimensions),o.offsetAttribute=i!==it.NONE?mn.ALL:void 0};var BM=mf;function r0(e,t,n){this._callback=void 0,this._isConstant=void 0,this._referenceFrame=n??Li.FIXED,this._definitionChanged=new _e,this.setCallback(e,t)}Object.defineProperties(r0.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var WUe=new X;r0.prototype.getValue=function(e,t){return l(e)||(e=X.now(WUe)),this.getValueInReferenceFrame(e,Li.FIXED,t)};r0.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};r0.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._callback(e,n);return Nh.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};r0.prototype.equals=function(e){return this===e||e instanceof r0&&this._callback===e._callback&&this._isConstant===e._isConstant&&this._referenceFrame===e._referenceFrame};var DM=r0;/*! @license DOMPurify 3.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.3/LICENSE */var{entries:Ule,setPrototypeOf:Rle,isFrozen:jUe,getPrototypeOf:YUe,getOwnPropertyDescriptor:qUe}=Object,{freeze:Ql,seal:Cd,create:IV}=Object,{apply:J6,construct:Z6}=typeof Reflect<"u"&&Reflect;Ql||(Ql=function(t){return t});Cd||(Cd=function(t){return t});J6||(J6=function(t,n){for(var i=arguments.length,o=new Array(i>2?i-2:0),r=2;r<i;r++)o[r-2]=arguments[r];return t.apply(n,o)});Z6||(Z6=function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return new t(...i)});var EV=kl(Array.prototype.forEach),KUe=kl(Array.prototype.lastIndexOf),Mle=kl(Array.prototype.pop),vM=kl(Array.prototype.push),XUe=kl(Array.prototype.splice),xV=kl(String.prototype.toLowerCase),W6=kl(String.prototype.toString),j6=kl(String.prototype.match),PM=kl(String.prototype.replace),JUe=kl(String.prototype.indexOf),ZUe=kl(String.prototype.trim),pf=kl(Object.prototype.hasOwnProperty),Fl=kl(RegExp.prototype.test),RM=$Ue(TypeError);function kl(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return J6(e,t,i)}}function $Ue(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return Z6(e,n)}}function Ui(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:xV;Rle&&Rle(e,null);let i=t.length;for(;i--;){let o=t[i];if(typeof o=="string"){let r=n(o);r!==o&&(jUe(t)||(t[i]=r),o=r)}e[o]=!0}return e}function eze(e){for(let t=0;t<e.length;t++)pf(e,t)||(e[t]=null);return e}function fp(e){let t=IV(null);for(let[n,i]of Ule(e))pf(e,n)&&(Array.isArray(i)?t[n]=eze(i):i&&typeof i=="object"&&i.constructor===Object?t[n]=fp(i):t[n]=i);return t}function MM(e,t){for(;e!==null;){let i=qUe(e,t);if(i){if(i.get)return kl(i.get);if(typeof i.value=="function")return kl(i.value)}e=YUe(e)}function n(){return null}return n}var Nle=Ql(["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","search","section","select","shadow","slot","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"]),Y6=Ql(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),q6=Ql(["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"]),tze=Ql(["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"]),K6=Ql(["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"]),nze=Ql(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Lle=Ql(["#text"]),Ole=Ql(["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","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","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","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),X6=Ql(["accent-height","accumulate","additive","alignment-baseline","amplitude","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","exponent","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","intercept","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","mask-type","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","slope","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","tablevalues","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"]),Fle=Ql(["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"]),bV=Ql(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ize=Cd(/\{\{[\w\W]*|[\w\W]*\}\}/gm),oze=Cd(/<%[\w\W]*|[\w\W]*%>/gm),rze=Cd(/\$\{[\w\W]*/gm),aze=Cd(/^data-[\-\w.\u00B7-\uFFFF]+$/),sze=Cd(/^aria-[\-\w]+$/),zle=Cd(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),cze=Cd(/^(?:\w+script|data):/i),lze=Cd(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Gle=Cd(/^html$/i),uze=Cd(/^[a-z][.\w]*(-[.\w]+)+$/i),Qle=Object.freeze({__proto__:null,ARIA_ATTR:sze,ATTR_WHITESPACE:lze,CUSTOM_ELEMENT:uze,DATA_ATTR:aze,DOCTYPE_NAME:Gle,ERB_EXPR:oze,IS_ALLOWED_URI:zle,IS_SCRIPT_OR_DATA:cze,MUSTACHE_EXPR:ize,TMPLIT_EXPR:rze}),NM={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},fze=function(){return typeof window>"u"?null:window},dze=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null,o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(i=n.getAttribute(o));let r="dompurify"+(i?"#"+i:"");try{return t.createPolicy(r,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},kle=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Vle(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:fze(),t=on=>Vle(on);if(t.version="3.3.3",t.removed=[],!e||!e.document||e.document.nodeType!==NM.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e,i=n,o=i.currentScript,{DocumentFragment:r,HTMLTemplateElement:a,Node:s,Element:c,NodeFilter:u,NamedNodeMap:f=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:h,DOMParser:p,trustedTypes:A}=e,m=c.prototype,_=MM(m,"cloneNode"),y=MM(m,"remove"),C=MM(m,"nextSibling"),E=MM(m,"childNodes"),b=MM(m,"parentNode");if(typeof a=="function"){let on=n.createElement("template");on.content&&on.content.ownerDocument&&(n=on.content.ownerDocument)}let x,S="",{implementation:B,createNodeIterator:v,createDocumentFragment:P,getElementsByTagName:N}=n,{importNode:L}=i,g=kle();t.isSupported=typeof Ule=="function"&&typeof b=="function"&&B&&B.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:I,ERB_EXPR:T,TMPLIT_EXPR:w,DATA_ATTR:R,ARIA_ATTR:O,IS_SCRIPT_OR_DATA:G,ATTR_WHITESPACE:F,CUSTOM_ELEMENT:U}=Qle,{IS_ALLOWED_URI:Q}=Qle,H=null,Y=Ui({},[...Nle,...Y6,...q6,...K6,...Lle]),$=null,W=Ui({},[...Ole,...X6,...Fle,...bV]),K=Object.seal(IV(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}})),Z=null,pe=null,ge=Object.seal(IV(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),re=!0,ye=!0,Ce=!1,Pe=!0,Ne=!1,Le=!0,Oe=!1,ot=!1,Fe=!1,_t=!1,rt=!1,Ye=!1,st=!0,ft=!1,St="user-content-",Ie=!0,Se=!1,Kt={},mt=null,Gt=Ui({},["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"]),Hn=null,Je=Ui({},["audio","video","img","source","image","track"]),fo=null,Vt=Ui({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Lo="http://www.w3.org/1998/Math/MathML",io="http://www.w3.org/2000/svg",Qi="http://www.w3.org/1999/xhtml",Yo=Qi,ai=!1,Xn=null,oo=Ui({},[Lo,io,Qi],W6),Oo=Ui({},["mi","mo","mn","ms","mtext"]),yo=Ui({},["annotation-xml"]),or=Ui({},["title","style","font","a","script"]),qo=null,bn=["application/xhtml+xml","text/html"],wi="text/html",Ln=null,Ko=null,Xo=n.createElement("form"),ss=function(we){return we instanceof RegExp||we instanceof Function},Hi=function(){let we=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Ko&&Ko===we)){if((!we||typeof we!="object")&&(we={}),we=fp(we),qo=bn.indexOf(we.PARSER_MEDIA_TYPE)===-1?wi:we.PARSER_MEDIA_TYPE,Ln=qo==="application/xhtml+xml"?W6:xV,H=pf(we,"ALLOWED_TAGS")?Ui({},we.ALLOWED_TAGS,Ln):Y,$=pf(we,"ALLOWED_ATTR")?Ui({},we.ALLOWED_ATTR,Ln):W,Xn=pf(we,"ALLOWED_NAMESPACES")?Ui({},we.ALLOWED_NAMESPACES,W6):oo,fo=pf(we,"ADD_URI_SAFE_ATTR")?Ui(fp(Vt),we.ADD_URI_SAFE_ATTR,Ln):Vt,Hn=pf(we,"ADD_DATA_URI_TAGS")?Ui(fp(Je),we.ADD_DATA_URI_TAGS,Ln):Je,mt=pf(we,"FORBID_CONTENTS")?Ui({},we.FORBID_CONTENTS,Ln):Gt,Z=pf(we,"FORBID_TAGS")?Ui({},we.FORBID_TAGS,Ln):fp({}),pe=pf(we,"FORBID_ATTR")?Ui({},we.FORBID_ATTR,Ln):fp({}),Kt=pf(we,"USE_PROFILES")?we.USE_PROFILES:!1,re=we.ALLOW_ARIA_ATTR!==!1,ye=we.ALLOW_DATA_ATTR!==!1,Ce=we.ALLOW_UNKNOWN_PROTOCOLS||!1,Pe=we.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ne=we.SAFE_FOR_TEMPLATES||!1,Le=we.SAFE_FOR_XML!==!1,Oe=we.WHOLE_DOCUMENT||!1,_t=we.RETURN_DOM||!1,rt=we.RETURN_DOM_FRAGMENT||!1,Ye=we.RETURN_TRUSTED_TYPE||!1,Fe=we.FORCE_BODY||!1,st=we.SANITIZE_DOM!==!1,ft=we.SANITIZE_NAMED_PROPS||!1,Ie=we.KEEP_CONTENT!==!1,Se=we.IN_PLACE||!1,Q=we.ALLOWED_URI_REGEXP||zle,Yo=we.NAMESPACE||Qi,Oo=we.MATHML_TEXT_INTEGRATION_POINTS||Oo,yo=we.HTML_INTEGRATION_POINTS||yo,K=we.CUSTOM_ELEMENT_HANDLING||{},we.CUSTOM_ELEMENT_HANDLING&&ss(we.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(K.tagNameCheck=we.CUSTOM_ELEMENT_HANDLING.tagNameCheck),we.CUSTOM_ELEMENT_HANDLING&&ss(we.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(K.attributeNameCheck=we.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),we.CUSTOM_ELEMENT_HANDLING&&typeof we.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(K.allowCustomizedBuiltInElements=we.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ne&&(ye=!1),rt&&(_t=!0),Kt&&(H=Ui({},Lle),$=IV(null),Kt.html===!0&&(Ui(H,Nle),Ui($,Ole)),Kt.svg===!0&&(Ui(H,Y6),Ui($,X6),Ui($,bV)),Kt.svgFilters===!0&&(Ui(H,q6),Ui($,X6),Ui($,bV)),Kt.mathMl===!0&&(Ui(H,K6),Ui($,Fle),Ui($,bV))),pf(we,"ADD_TAGS")||(ge.tagCheck=null),pf(we,"ADD_ATTR")||(ge.attributeCheck=null),we.ADD_TAGS&&(typeof we.ADD_TAGS=="function"?ge.tagCheck=we.ADD_TAGS:(H===Y&&(H=fp(H)),Ui(H,we.ADD_TAGS,Ln))),we.ADD_ATTR&&(typeof we.ADD_ATTR=="function"?ge.attributeCheck=we.ADD_ATTR:($===W&&($=fp($)),Ui($,we.ADD_ATTR,Ln))),we.ADD_URI_SAFE_ATTR&&Ui(fo,we.ADD_URI_SAFE_ATTR,Ln),we.FORBID_CONTENTS&&(mt===Gt&&(mt=fp(mt)),Ui(mt,we.FORBID_CONTENTS,Ln)),we.ADD_FORBID_CONTENTS&&(mt===Gt&&(mt=fp(mt)),Ui(mt,we.ADD_FORBID_CONTENTS,Ln)),Ie&&(H["#text"]=!0),Oe&&Ui(H,["html","head","body"]),H.table&&(Ui(H,["tbody"]),delete Z.tbody),we.TRUSTED_TYPES_POLICY){if(typeof we.TRUSTED_TYPES_POLICY.createHTML!="function")throw RM('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof we.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw RM('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');x=we.TRUSTED_TYPES_POLICY,S=x.createHTML("")}else x===void 0&&(x=dze(A,o)),x!==null&&typeof S=="string"&&(S=x.createHTML(""));Ql&&Ql(we),Ko=we}},Do=Ui({},[...Y6,...q6,...tze]),Ts=Ui({},[...K6,...nze]),wa=function(we){let lt=b(we);(!lt||!lt.tagName)&&(lt={namespaceURI:Yo,tagName:"template"});let an=xV(we.tagName),Ao=xV(lt.tagName);return Xn[we.namespaceURI]?we.namespaceURI===io?lt.namespaceURI===Qi?an==="svg":lt.namespaceURI===Lo?an==="svg"&&(Ao==="annotation-xml"||Oo[Ao]):!!Do[an]:we.namespaceURI===Lo?lt.namespaceURI===Qi?an==="math":lt.namespaceURI===io?an==="math"&&yo[Ao]:!!Ts[an]:we.namespaceURI===Qi?lt.namespaceURI===io&&!yo[Ao]||lt.namespaceURI===Lo&&!Oo[Ao]?!1:!Ts[an]&&(or[an]||!Do[an]):!!(qo==="application/xhtml+xml"&&Xn[we.namespaceURI]):!1},Mr=function(we){vM(t.removed,{element:we});try{b(we).removeChild(we)}catch{y(we)}},Ss=function(we,lt){try{vM(t.removed,{attribute:lt.getAttributeNode(we),from:lt})}catch{vM(t.removed,{attribute:null,from:lt})}if(lt.removeAttribute(we),we==="is")if(_t||rt)try{Mr(lt)}catch{}else try{lt.setAttribute(we,"")}catch{}},$u=function(we){let lt=null,an=null;if(Fe)we="<remove></remove>"+we;else{let ho=j6(we,/^[\r\n\t ]+/);an=ho&&ho[0]}qo==="application/xhtml+xml"&&Yo===Qi&&(we='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+we+"</body></html>");let Ao=x?x.createHTML(we):we;if(Yo===Qi)try{lt=new p().parseFromString(Ao,qo)}catch{}if(!lt||!lt.documentElement){lt=B.createDocument(Yo,"template",null);try{lt.documentElement.innerHTML=ai?S:Ao}catch{}}let Ha=lt.body||lt.documentElement;return we&&an&&Ha.insertBefore(n.createTextNode(an),Ha.childNodes[0]||null),Yo===Qi?N.call(lt,Oe?"html":"body")[0]:Oe?lt.documentElement:Ha},ef=function(we){return v.call(we.ownerDocument||we,we,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},tf=function(we){return we instanceof h&&(typeof we.nodeName!="string"||typeof we.textContent!="string"||typeof we.removeChild!="function"||!(we.attributes instanceof f)||typeof we.removeAttribute!="function"||typeof we.setAttribute!="function"||typeof we.namespaceURI!="string"||typeof we.insertBefore!="function"||typeof we.hasChildNodes!="function")},yh=function(we){return typeof s=="function"&&we instanceof s};function Js(on,we,lt){EV(on,an=>{an.call(t,we,lt,Ko)})}let z_=function(we){let lt=null;if(Js(g.beforeSanitizeElements,we,null),tf(we))return Mr(we),!0;let an=Ln(we.nodeName);if(Js(g.uponSanitizeElement,we,{tagName:an,allowedTags:H}),Le&&we.hasChildNodes()&&!yh(we.firstElementChild)&&Fl(/<[/\w!]/g,we.innerHTML)&&Fl(/<[/\w!]/g,we.textContent)||we.nodeType===NM.progressingInstruction||Le&&we.nodeType===NM.comment&&Fl(/<[/\w]/g,we.data))return Mr(we),!0;if(!(ge.tagCheck instanceof Function&&ge.tagCheck(an))&&(!H[an]||Z[an])){if(!Z[an]&&br(an)&&(K.tagNameCheck instanceof RegExp&&Fl(K.tagNameCheck,an)||K.tagNameCheck instanceof Function&&K.tagNameCheck(an)))return!1;if(Ie&&!mt[an]){let Ao=b(we)||we.parentNode,Ha=E(we)||we.childNodes;if(Ha&&Ao){let ho=Ha.length;for(let Ba=ho-1;Ba>=0;--Ba){let Cl=_(Ha[Ba],!0);Cl.__removalCount=(we.__removalCount||0)+1,Ao.insertBefore(Cl,C(we))}}}return Mr(we),!0}return we instanceof c&&!wa(we)||(an==="noscript"||an==="noembed"||an==="noframes")&&Fl(/<\/no(script|embed|frames)/i,we.innerHTML)?(Mr(we),!0):(Ne&&we.nodeType===NM.text&&(lt=we.textContent,EV([I,T,w],Ao=>{lt=PM(lt,Ao," ")}),we.textContent!==lt&&(vM(t.removed,{element:we.cloneNode()}),we.textContent=lt)),Js(g.afterSanitizeElements,we,null),!1)},Xm=function(we,lt,an){if(pe[lt]||st&&(lt==="id"||lt==="name")&&(an in n||an in Xo))return!1;if(!(ye&&!pe[lt]&&Fl(R,lt))){if(!(re&&Fl(O,lt))){if(!(ge.attributeCheck instanceof Function&&ge.attributeCheck(lt,we))){if(!$[lt]||pe[lt]){if(!(br(we)&&(K.tagNameCheck instanceof RegExp&&Fl(K.tagNameCheck,we)||K.tagNameCheck instanceof Function&&K.tagNameCheck(we))&&(K.attributeNameCheck instanceof RegExp&&Fl(K.attributeNameCheck,lt)||K.attributeNameCheck instanceof Function&&K.attributeNameCheck(lt,we))||lt==="is"&&K.allowCustomizedBuiltInElements&&(K.tagNameCheck instanceof RegExp&&Fl(K.tagNameCheck,an)||K.tagNameCheck instanceof Function&&K.tagNameCheck(an))))return!1}else if(!fo[lt]){if(!Fl(Q,PM(an,F,""))){if(!((lt==="src"||lt==="xlink:href"||lt==="href")&&we!=="script"&&JUe(an,"data:")===0&&Hn[we])){if(!(Ce&&!Fl(G,PM(an,F,"")))){if(an)return!1}}}}}}}return!0},br=function(we){return we!=="annotation-xml"&&j6(we,U)},cs=function(we){Js(g.beforeSanitizeAttributes,we,null);let{attributes:lt}=we;if(!lt||tf(we))return;let an={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:$,forceKeepAttr:void 0},Ao=lt.length;for(;Ao--;){let Ha=lt[Ao],{name:ho,namespaceURI:Ba,value:Cl}=Ha,G_=Ln(ho),LB=Cl,ws=ho==="value"?LB:ZUe(LB);if(an.attrName=G_,an.attrValue=ws,an.keepAttr=!0,an.forceKeepAttr=void 0,Js(g.uponSanitizeAttribute,we,an),ws=an.attrValue,ft&&(G_==="id"||G_==="name")&&(Ss(ho,we),ws=St+ws),Le&&Fl(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,ws)){Ss(ho,we);continue}if(G_==="attributename"&&j6(ws,"href")){Ss(ho,we);continue}if(an.forceKeepAttr)continue;if(!an.keepAttr){Ss(ho,we);continue}if(!Pe&&Fl(/\/>/i,ws)){Ss(ho,we);continue}Ne&&EV([I,T,w],oG=>{ws=PM(ws,oG," ")});let iG=Ln(we.nodeName);if(!Xm(iG,G_,ws)){Ss(ho,we);continue}if(x&&typeof A=="object"&&typeof A.getAttributeType=="function"&&!Ba)switch(A.getAttributeType(iG,G_)){case"TrustedHTML":{ws=x.createHTML(ws);break}case"TrustedScriptURL":{ws=x.createScriptURL(ws);break}}if(ws!==LB)try{Ba?we.setAttributeNS(Ba,ho,ws):we.setAttribute(ho,ws),tf(we)?Mr(we):Mle(t.removed)}catch{Ss(ho,we)}}Js(g.afterSanitizeAttributes,we,null)},ls=function on(we){let lt=null,an=ef(we);for(Js(g.beforeSanitizeShadowDOM,we,null);lt=an.nextNode();)Js(g.uponSanitizeShadowNode,lt,null),z_(lt),cs(lt),lt.content instanceof r&&on(lt.content);Js(g.afterSanitizeShadowDOM,we,null)};return t.sanitize=function(on){let we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},lt=null,an=null,Ao=null,Ha=null;if(ai=!on,ai&&(on="<!-->"),typeof on!="string"&&!yh(on))if(typeof on.toString=="function"){if(on=on.toString(),typeof on!="string")throw RM("dirty is not a string, aborting")}else throw RM("toString is not a function");if(!t.isSupported)return on;if(ot||Hi(we),t.removed=[],typeof on=="string"&&(Se=!1),Se){if(on.nodeName){let Cl=Ln(on.nodeName);if(!H[Cl]||Z[Cl])throw RM("root node is forbidden and cannot be sanitized in-place")}}else if(on instanceof s)lt=$u("<!---->"),an=lt.ownerDocument.importNode(on,!0),an.nodeType===NM.element&&an.nodeName==="BODY"||an.nodeName==="HTML"?lt=an:lt.appendChild(an);else{if(!_t&&!Ne&&!Oe&&on.indexOf("<")===-1)return x&&Ye?x.createHTML(on):on;if(lt=$u(on),!lt)return _t?null:Ye?S:""}lt&&Fe&&Mr(lt.firstChild);let ho=ef(Se?on:lt);for(;Ao=ho.nextNode();)z_(Ao),cs(Ao),Ao.content instanceof r&&ls(Ao.content);if(Se)return on;if(_t){if(rt)for(Ha=P.call(lt.ownerDocument);lt.firstChild;)Ha.appendChild(lt.firstChild);else Ha=lt;return($.shadowroot||$.shadowrootmode)&&(Ha=L.call(i,Ha,!0)),Ha}let Ba=Oe?lt.outerHTML:lt.innerHTML;return Oe&&H["!doctype"]&&lt.ownerDocument&&lt.ownerDocument.doctype&&lt.ownerDocument.doctype.name&&Fl(Gle,lt.ownerDocument.doctype.name)&&(Ba="<!DOCTYPE "+lt.ownerDocument.doctype.name+`>
`+Ba),Ne&&EV([I,T,w],Cl=>{Ba=PM(Ba,Cl," ")}),x&&Ye?x.createHTML(Ba):Ba},t.setConfig=function(){let on=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Hi(on),ot=!0},t.clearConfig=function(){Ko=null,ot=!1},t.isValidAttribute=function(on,we,lt){Ko||Hi({});let an=Ln(on),Ao=Ln(we);return Xm(an,Ao,lt)},t.addHook=function(on,we){typeof we=="function"&&vM(g[on],we)},t.removeHook=function(on,we){if(we!==void 0){let lt=KUe(g[on],we);return lt===-1?void 0:XUe(g[on],lt,1)[0]}return Mle(g[on])},t.removeHooks=function(on){g[on]=[]},t.removeAllHooks=function(){g=kle()},t}var Hle=Vle();var hze=0,$6={};function dp(e,t){let n,i=e;l($6[i])?n=$6[i]:(n=hze++,$6[i]=n),t=t??!1,this._id=n,this._html=e,this._showOnScreen=t,this._element=void 0}Object.defineProperties(dp.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=Hle.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}}});dp.equals=function(e,t){return e===t||l(e)&&l(t)&&e._id===t._id&&e._showOnScreen===t._showOnScreen};dp.prototype.equals=function(e){return dp.equals(this,e)};dp.prototype.isIon=function(){return this.html.indexOf("ion-credit.png")!==-1};dp.getIonCredit=function(e){let t=l(e.collapsible)&&!e.collapsible;return new dp(e.html,t)};dp.clone=function(e){if(l(e))return new dp(e.html,e.showOnScreen)};var Et=dp;function mze(e,t){It(e,t)}var Ms=mze;function a0(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 _e}Object.defineProperties(a0.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}}});a0.isSupported=function(e){return(e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat)&&e.supportsTextureLod};function eY(e){e._cubeMapBuffers=void 0}a0.prototype.update=function(e){let{context:t}=e;if(!a0.isSupported(t))return;if(l(this._texture)){eY(this);return}if(!l(this._texture)&&!this._loading){let f=t.textureCache.getTexture(this._url);l(f)&&(eY(this),this._texture=f,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0)}let n=this._cubeMapBuffers;if(!l(n)&&!this._loading){let f=this;_u(this._url).then(function(h){f._cubeMapBuffers=h,f._loading=!1}).catch(function(h){f.isDestroyed()||f._errorEvent.raiseEvent(h)}),this._loading=!0}if(!l(this._cubeMapBuffers))return;let{pixelDatatype:i}=n[0].positiveX;l(i)||(i=t.halfFloatingPointTexture?He.HALF_FLOAT:He.FLOAT);let o=qe.RGBA,r=n.length;this._maximumMipmapLevel=r-1;let a=n[0].positiveX.width,s=Math.log2(a)+1;if(r!==s){let f={};Object.values(Kr.FaceName).forEach(h=>{f[h]=void 0});for(let h=r;h<s;h++)n.push(f)}let c=new jt({minificationFilter:Wt.LINEAR_MIPMAP_LINEAR}),u=new Kr({context:t,source:n[0],flipY:!1,pixelDatatype:i,pixelFormat:o,sampler:c});u.loadMipmaps(n.slice(1)),this._texture=u,this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture),this._ready=!0};a0.prototype.isDestroyed=function(){return!1};a0.prototype.destroy=function(){return eY(this),this._texture=this._texture&&this._texture.destroy(),fe(this)};var kh=a0;function LM(e){e=e??V.EMPTY_OBJECT;let t=l(e.imageBasedLightingFactor)?k.clone(e.imageBasedLightingFactor):new k(1,1);this._imageBasedLightingFactor=t;let n=e.sphericalHarmonicCoefficients;this._sphericalHarmonicCoefficients=n,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._previousFrameContext=void 0,this._previousImageBasedLightingFactor=k.clone(t),this._previousSphericalHarmonicCoefficients=n,this._removeErrorListener=void 0}Object.defineProperties(LM.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){this._previousImageBasedLightingFactor=k.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=k.clone(e,this._imageBasedLightingFactor)}},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}},specularEnvironmentCubeMap:{get:function(){return this._specularEnvironmentCubeMap}},useDefaultSphericalHarmonics:{get:function(){return this._useDefaultSphericalHarmonics}},useDefaultSpecularMaps:{get:function(){return this._useDefaultSpecularMaps}},useSpecularEnvironmentMaps:{get:function(){return l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready||this._useDefaultSpecularMaps}}});function pze(e,t){if(kh.isSupported(t)){if(e._specularEnvironmentCubeMap=e._specularEnvironmentCubeMap&&e._specularEnvironmentCubeMap.destroy(),l(e._specularEnvironmentMaps)){let n=new kh(e._specularEnvironmentMaps);e._specularEnvironmentCubeMap=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}LM.prototype.update=function(e){if(e.frameNumber===this._previousFrameNumber&&e.context===this._previousFrameContext)return;this._previousFrameNumber=e.frameNumber;let t=this._previousFrameContext=e.context;e.brdfLutGenerator.update(e),this._shouldRegenerateShaders=!1;let n=this._imageBasedLightingFactor,i=this._previousImageBasedLightingFactor;k.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=k.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),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&&(pze(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,a=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,s=!l(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||o||r||a||s,this._useDefaultSpecularMaps=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)};LM.prototype.isDestroyed=function(){return!1};LM.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),fe(this)};var s0=LM;var nY=Wr(rf(),1);var tY,Wle="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJhMzVlNTU2ZC1lYmM1LTQ2OWEtODRhOS0wYTFkODZmZTQ0OTgiLCJpZCI6MjU5LCJpYXQiOjE3NzI0ODIxOTR9.1oVHvVA9yr1C3CbLjlzcQQUyBuUuNaNCcc9_Giy8t7U",TV={};TV.defaultAccessToken=Wle;TV.defaultServer=new De({url:"https://api.cesium.com/"});TV.getDefaultTokenCredit=function(e){if(e===Wle){if(!l(tY)){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>`;tY=new Et(t,!0)}return tY}};var Uh=TV;function Ul(e,t){let n,i=e.externalType,o=l(i);if(!o)n={url:e.url,retryAttempts:1,retryCallback:Aze};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.");De.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=o?void 0:new nY.default(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=o,this.refreshCallback=void 0}l(Object.create)&&(Ul.prototype=Object.create(De.prototype),Ul.prototype.constructor=Ul);Ul.fromAssetId=function(e,t){let n=Ul._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new Ul(i,n)})};Object.defineProperties(Ul.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=Ul.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});Ul.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(Et.getIonCredit),i=Uh.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(Et.clone(i)),n};Ul.prototype.clone=function(e){let t=this._ionRoot??this;return l(e)||(e=new Ul(t._ionEndpoint,t._ionEndpointResource)),e=De.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};Ul.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},l(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return De.prototype.fetchImage.call(this,e)};Ul.prototype._makeRequest=function(e){return this._isExternal||new nY.default(this.url).authority()!==this._ionEndpointDomain?De.prototype._makeRequest.call(this,e):(e.headers=jle(e.headers),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,De.prototype._makeRequest.call(this,e))};Ul._createEndpointResource=function(e,t){t=t??V.EMPTY_OBJECT;let n=t.server??Uh.defaultServer,i=t.accessToken??Uh.defaultAccessToken;n=De.createIfNeeded(n);let o={url:`v1/assets/${e}/endpoint`};return l(i)&&(o.queryParameters={access_token:i}),l(t.queryParameters)&&(o.queryParameters={...o.queryParameters,...t.queryParameters}),o.headers=jle(o.headers),n.getDerivedResource(o)};function jle(e={}){return e["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e["X-Cesium-Client-Version"]=CESIUM_VERSION),e}function Aze(e,t){let n=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){let a=e.refreshCallback??n.refreshCallback;return l(a)&&a(n,r),n._ionEndpoint=r,n._ionEndpoint}).finally(function(r){return n._pendingPromise=void 0,r})),n._pendingPromise.then(function(r){return e._ionEndpoint=r,!0}))}var fa=Ul;function hp(e){e=e??0,this._array=new Array(e),this._length=e}Object.defineProperties(hp.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}}});hp.prototype.get=function(e){return this._array[e]};hp.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};hp.prototype.peek=function(){return this._array[this._length-1]};hp.prototype.push=function(e){let t=this.length++;this._array[t]=e};hp.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};hp.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};hp.prototype.resize=function(e){this.length=e};hp.prototype.trim=function(e){e=e??this._length,this._array.length=e};var zl=hp;var XA={X:0,Y:1,Z:2};XA.Y_UP_TO_Z_UP=M.fromRotationTranslation(J.fromArray([1,0,0,0,0,1,0,-1,0]));XA.Z_UP_TO_Y_UP=M.fromRotationTranslation(J.fromArray([1,0,0,0,0,-1,0,1,0]));XA.X_UP_TO_Z_UP=M.fromRotationTranslation(J.fromArray([0,0,1,0,1,0,-1,0,0]));XA.Z_UP_TO_X_UP=M.fromRotationTranslation(J.fromArray([0,0,-1,0,1,0,1,0,0]));XA.X_UP_TO_Y_UP=M.fromRotationTranslation(J.fromArray([0,1,0,-1,0,0,0,0,1]));XA.Y_UP_TO_X_UP=M.fromRotationTranslation(J.fromArray([0,-1,0,1,0,0,0,0,1]));XA.fromName=function(e){return XA[e]};var ao=Object.freeze(XA);function Yle(e){e=e??V.EMPTY_OBJECT,this._metadata=e.metadata}Object.defineProperties(Yle.prototype,{metadata:{get:function(){return this._metadata}}});var c0=Yle;function hy(e,t,n){return t=t??0,n=n??e.byteLength-t,e=e.subarray(t,t+n),hy.decode(e)}hy.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};hy.decodeWithFromCharCode=function(e){let t="",n=gze(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 OM(e,t,n){return t<=e&&e<=n}function gze(e){let t=0,n=0,i=0,o=128,r=191,a=[],s=e.length;for(let c=0;c<s;++c){let u=e[c];if(i===0){if(OM(u,0,127)){a.push(u);continue}if(OM(u,194,223)){i=1,t=u&31;continue}if(OM(u,224,239)){u===224&&(o=160),u===237&&(r=159),i=2,t=u&15;continue}if(OM(u,240,244)){u===240&&(o=144),u===244&&(r=143),i=3,t=u&7;continue}throw new ue("String decoding failed.")}if(!OM(u,o,r)){t=i=n=0,o=128,r=191,--c;continue}o=128,r=191,t=t<<6|u&63,++n,n===i&&(a.push(t),t=i=n=0)}return a}typeof TextDecoder<"u"?hy.decode=hy.decodeWithTextDecoder:hy.decode=hy.decodeWithFromCharCode;var xu=hy;function _ze(e,t){return t=t??0,xu(e,t,Math.min(4,e.length))}var zh=_ze;function Ed(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(Ed.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 FM=Uint32Array.BYTES_PER_ELEMENT;Ed.fromTileType=async function(e,t,n,i,o,r){o=o??0;let a=new Uint8Array(i),s=new DataView(i);o+=FM;let c=s.getUint32(o,!0);if(c!==1)throw new ue(`Only Composite Tile version 1 is supported. Version ${c} is not.`);o+=FM,o+=FM;let u=s.getUint32(o,!0);o+=FM;let f=n.queryParameters.compositeIndex;l(f)?f=`${f}_`:f="";let h=[];h.length=u;for(let m=0;m<u;++m){let _=zh(a,o),y=s.getUint32(o+FM*2,!0),C=r[_],E=`${f}${m}`,b=n.getDerivedResource({queryParameters:{compositeIndex:E}});if(l(C))h[m]=Promise.resolve(C(e,t,b,i,o));else throw new ue(`Unknown tile content type, ${_}, inside Composite tile`);o+=y}let p=await Promise.all(h);return new Ed(e,t,n,p)};Ed.prototype.hasProperty=function(e,t){return!1};Ed.prototype.getFeature=function(e){};Ed.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};Ed.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};Ed.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)};Ed.prototype.pick=function(e,t,n){if(!this._ready)return;let i,o=Number.POSITIVE_INFINITY,r=this._contents,a=r.length;for(let s=0;s<a;++s){let c=r[s].pick(e,t,n);if(!l(c))continue;let u=d.distance(e.origin,c);u<o&&(i=c,o=u)}if(l(i))return n};Ed.prototype.isDestroyed=function(){return!1};Ed.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return fe(this)};var QM=Ed;function yze(e,t,n){return JSON.parse(xu(e,t,n))}var Br=yze;function Kc(e){this._id=Jn();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,Rt.maximumTextureSize),r=Math.ceil(t/Rt.maximumTextureSize),a=1/o,s=a*.5,c=1/r,u=c*.5;n=new k(o,r),i=new ie(a,s,c,u)}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(Kc.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}}});Kc.DEFAULT_COLOR_VALUE=z.WHITE;Kc.DEFAULT_SHOW_VALUE=!0;function qle(e){let t=e._textureDimensions;return t.x*t.y*4}function Kle(e){if(!l(e._batchValues)){let t=qle(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function Xle(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}Kc.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=Xle(this),i=e*2,o=t?255:0;if(n[i]!==o){n[i]=o;let r=Kle(this),a=e*4+3;r[a]=t?n[i+1]:0,this._batchValuesDirty=!0}};Kc.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setShow(n,e)};Kc.prototype.getShow=function(e){if(!l(this._showAlphaProperties))return!0;let t=e*2;return this._showAlphaProperties[t]===255};var Cze=new Array(4);Kc.prototype.setColor=function(e,t){if(z.equals(t,Kc.DEFAULT_COLOR_VALUE)&&!l(this._batchValues))return;let n=t.toBytes(Cze),i=n[3],o=Kle(this),r=e*4,a=Xle(this),s=e*2;if(o[r]!==n[0]||o[r+1]!==n[1]||o[r+2]!==n[2]||a[s+1]!==i){o[r]=n[0],o[r+1]=n[1],o[r+2]=n[2];let c=a[s+1]!==255,u=a[s]!==0;o[r+3]=u?i:0,a[s+1]=i;let f=i!==255;f&&!c?++this._translucentFeaturesLength:!f&&c&&--this._translucentFeaturesLength,this._batchValuesDirty=!0,l(this._colorChangedCallback)&&this._colorChangedCallback(e,t)}};Kc.prototype.setAllColor=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setColor(n,e)};Kc.prototype.getColor=function(e,t){if(!l(this._batchValues))return z.clone(Kc.DEFAULT_COLOR_VALUE,t);let n=this._batchValues,i=e*4,o=this._showAlphaProperties,r=e*2;return z.fromBytes(n[i],n[i+1],n[i+2],o[r+1],t)};Kc.prototype.getPickColor=function(e){return this._pickIds[e]};function Jle(e,t,n){let i=e._textureDimensions;return new Dt({context:t,pixelFormat:qe.RGBA,pixelDatatype:He.UNSIGNED_BYTE,source:{width:i.x,height:i.y,arrayBufferView:n},flipY:!1,sampler:jt.NEAREST})}function Eze(e,t){let n=e._featuresLength;if(!l(e._pickTexture)&&n>0){let i=e._pickIds,o=qle(e),r=new Uint8Array(o),a=e._owner,s=e._statistics;for(let c=0;c<n;++c){let u=t.createPickId(a.getFeature(c));i.push(u);let f=u.color,h=c*4;r[h]=z.floatToByte(f.red),r[h+1]=z.floatToByte(f.green),r[h+2]=z.floatToByte(f.blue),r[h+3]=z.floatToByte(f.alpha)}e._pickTexture=Jle(e,t,r),l(s)&&(s.batchTableByteLength+=e._pickTexture.sizeInBytes)}}function bze(e){let t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}Kc.prototype.update=function(e,t){let n=t.context;this._defaultTexture=n.defaultTexture;let i=t.passes;(i.pick||i.postProcess)&&Eze(this,n),this._batchValuesDirty&&(this._batchValuesDirty=!1,l(this._batchTexture)||(this._batchTexture=Jle(this,n,this._batchValues),l(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),bze(this))};Kc.prototype.isDestroyed=function(){return!1};Kc.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 fe(this)};var Gl=Kc;var Ize={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},xze={SCALAR:void 0,VEC2:k,VEC3:d,VEC4:ie,MAT2:ji,MAT3:J,MAT4:M};function Tze(e){let t=e.componentType,n;typeof t=="string"?n=j.fromName(t):n=t;let i=Ize[e.type],o=xze[e.type];return{componentsPerAttribute:i,classType:o,createArrayBufferView:function(r,a,s){return j.createArrayBufferView(n,r,a,i*s)}}}var bd=Tze;function JA(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,Sze(this,e.extension,e.binaryBody)}Object.defineProperties(JA.prototype,{byteLength:{get:function(){return this._byteLength}}});function Sze(e,t,n){let i,o,r,a=t.instancesLength,s=t.classes,c=t.classIds,u=t.parentCounts,f=t.parentIds,h=a,p=0;l(c.byteOffset)&&(c.componentType=c.componentType??j.UNSIGNED_SHORT,c.type=Ut.SCALAR,r=bd(c),c=r.createArrayBufferView(n.buffer,n.byteOffset+c.byteOffset,a),p+=c.byteLength);let A;if(l(u)){for(l(u.byteOffset)&&(u.componentType=u.componentType??j.UNSIGNED_SHORT,u.type=Ut.SCALAR,r=bd(u),u=r.createArrayBufferView(n.buffer,n.byteOffset+u.byteOffset,a),p+=u.byteLength),A=new Uint16Array(a),h=0,i=0;i<a;++i)A[i]=h,h+=u[i];p+=A.byteLength}l(f)&&l(f.byteOffset)&&(f.componentType=f.componentType??j.UNSIGNED_SHORT,f.type=Ut.SCALAR,r=bd(f),f=r.createArrayBufferView(n.buffer,n.byteOffset+f.byteOffset,h),p+=f.byteLength);let m=s.length;for(i=0;i<m;++i){let C=s[i].length,E=s[i].instances,b=Gh.getBinaryProperties(C,E,n);p+=wze(b),s[i].instances=Pt(b,E)}let _=new Array(m).fill(0),y=new Uint16Array(a);for(i=0;i<a;++i)o=c[i],y[i]=_[o],++_[o];p+=y.byteLength,e._classes=s,e._classIds=c,e._classIndexes=y,e._parentCounts=u,e._parentIndexes=A,e._parentIds=f,e._byteLength=p}function wze(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}var Bze=[],Dze=[],vze=0;function Pze(e,t,n){let i=e._classIds,o=e._parentCounts,r=e._parentIds,a=e._parentIndexes,s=i.length,c=Bze;c.length=Math.max(c.length,s);let u=++vze,f=Dze;for(f.length=0,f.push(t);f.length>0;){if(t=f.pop(),c[t]===u)continue;c[t]=u;let h=n(e,t);if(l(h))return h;let p=o[t],A=a[t];for(let m=0;m<p;++m){let _=r[A+m];_!==t&&f.push(_)}}}function Rze(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 kM(e,t,n){let i=e._parentCounts,o=e._parentIds;if(l(o)){if(l(i))return Pze(e,t,n)}else return n(e,t);return Rze(e,t,n)}JA.prototype.hasProperty=function(e,t){let n=kM(this,e,function(i,o){let r=i._classIds[o],a=i._classes[r].instances;if(l(a[t]))return!0});return l(n)};JA.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};JA.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,kM(this,e,function(n,i){let o=n._classIds[i],r=n._classes[o].instances;for(let a in r)r.hasOwnProperty(a)&&t.indexOf(a)===-1&&t.push(a)}),t};JA.prototype.getProperty=function(e,t){return kM(this,e,function(n,i){let o=n._classIds[i],r=n._classes[o],a=n._classIndexes[i],s=r.instances[t];if(l(s))return l(s.typedArray)?Mze(s,a):je(s[a],!0)})};function Mze(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}JA.prototype.setProperty=function(e,t,n){let i=kM(this,e,function(o,r){let a=o._classIds[r],s=o._classes[a],c=o._classIndexes[r],u=s.instances[t];if(l(u))return l(u.typedArray)?Nze(u,c,n):u[c]=je(n,!0),!0});return l(i)};function Nze(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}JA.prototype.isClass=function(e,t){let n=kM(this,e,function(i,o){let r=i._classIds[o];if(i._classes[r].name===t)return!0});return l(n)};JA.prototype.getClassName=function(e){let t=this._classIds[e];return this._classes[t].name};var l0=JA;var Lze={HIGHLIGHT:0,REPLACE:1,MIX:2},Tu=Object.freeze(Lze);var iY=Gl.DEFAULT_COLOR_VALUE,oY=Gl.DEFAULT_SHOW_VALUE;function Wo(e,t,n,i,o){this.featuresLength=t;let r;l(n)&&(r=n.extensions),this._extensions=r??{};let a=Oze(n);this._properties=a,this._batchTableHierarchy=Fze(this,n,i);let s=$le(t,a,i);this._binaryPropertiesByteLength=Qze(s),this._batchTableBinaryProperties=s,this._content=e,this._batchTexture=new Gl({featuresLength:t,colorChangedCallback:o,owner:e,statistics:e.tileset.statistics})}Wo._deprecationWarning=Ms;Object.defineProperties(Wo.prototype,{batchTableByteLength:{get:function(){let e=this._binaryPropertiesByteLength;return l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e+=this._batchTexture.byteLength,e}}});function Oze(e){let t={};if(!l(e))return t;for(let n in e)e.hasOwnProperty(n)&&n!=="HIERARCHY"&&n!=="extensions"&&n!=="extras"&&(t[n]=je(e[n],!0));return t}function Fze(e,t,n){if(!l(t))return;let i=e._extensions["3DTILES_batch_table_hierarchy"],o=t.HIERARCHY;if(l(o)&&(Wo._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 l0({extension:i,binaryBody:n})}function $le(e,t,n){let i;for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],a=r.byteOffset;if(l(a)){let s=r.componentType,c=r.type;if(!l(s))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 u=bd(r),f=u.componentsPerAttribute,h=u.classType,p=u.createArrayBufferView(n.buffer,n.byteOffset+a,e);l(i)||(i={}),i[o]={typedArray:p,componentCount:f,type:h}}}return i}function Qze(e){if(!l(e))return 0;let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}Wo.getBinaryProperties=function(e,t,n){return $le(e,t,n)};Wo.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};Wo.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};Wo.prototype.getShow=function(e){return this._batchTexture.getShow(e)};Wo.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};Wo.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};Wo.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};Wo.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};var kze=new z;Wo.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(iY),this.setAllShow(oY);return}let t=this._content,n=this.featuresLength;for(let i=0;i<n;++i){let o=t.getFeature(i),r=l(e.color)?e.color.evaluateColor(o,kze)??iY:iY,a=l(e.show)?e.show.evaluate(o)??oY:oY;this.setColor(i,r),this.setShow(i,a)}};function Uze(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}function zze(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}Wo.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};Wo.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};Wo.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};Wo.prototype.hasProperty=function(e,t){return l(this._properties[t])||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)};Wo.prototype.hasPropertyBySemantic=function(){return!1};Wo.prototype.getPropertyIds=function(e,t){t=l(t)?t:[],t.length=0;let n=Object.keys(this._properties);if(oi(t,n),l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getPropertyIds(e,n);oi(t,i)}return t};Wo.prototype.getPropertyBySemantic=function(e,t){};Wo.prototype.getProperty=function(e,t){if(l(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if(l(i))return Uze(i,e)}let n=this._properties[t];if(l(n))return je(n[e],!0);if(l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getProperty(e,t);if(l(i))return i}};Wo.prototype.setProperty=function(e,t,n){let i=this.featuresLength;if(l(this._batchTableBinaryProperties)){let r=this._batchTableBinaryProperties[t];if(l(r)){zze(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]=je(n,!0)};function Gze(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));
}
`}Wo.prototype.getVertexShaderCallback=function(e,t,n){if(this.featuresLength===0)return;let i=this;return function(o){let r=eue(o,n,!1),a;return Rt.maximumVertexTextureImageUnits>0?(a="",e&&(a+=`uniform bool tile_translucentCommand;
`),a+=`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&&(a+=` 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;
}
}
`),a+=` tile_featureColor = featureProperties;
tile_featureSt = st;
}`):a=`out vec2 tile_featureSt;
void main()
{
tile_color(vec4(1.0));
tile_featureSt = computeSt(${t});
}`,`${r}
${Gze(i)}${a}`}};function Zle(e,t){return e=We.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 Vze(e,t){let n=`texture(${t}`,i=0,o=e.indexOf(n,i),r;for(;o>-1;){let a=0;for(let u=o;u<e.length;++u){let f=e.charAt(u);if(f==="(")++a;else if(f===")"&&(--a,a===0)){r=u+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 eue(e,t,n){if(!l(t))return Zle(e,n);let i=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`),o=e.match(i);if(!l(o))return Zle(e,n);let r=o[0],a=o[2];e=We.replaceMain(e,"tile_main"),e=e.replace(r,"");let s=`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);
`,u;if(a==="vec3"||a==="vec4"){let f=a==="vec3"?`vec4(${t}, 1.0)`:t,h=a==="vec3"?"tile_diffuse.xyz":"tile_diffuse";i=new RegExp(t,"g"),e=e.replace(i,h),u=` vec4 source = ${f};
tile_diffuse = tile_diffuse_final(source, tile_featureColor);
tile_main();
`}else a==="sampler2D"&&(e=Vze(e,t),u=` tile_diffuse = tile_featureColor;
tile_main();
`);return e=`uniform float tile_colorBlend;
vec4 tile_diffuse = vec4(1.0);
${s}${r}
${e}
void tile_color(vec4 tile_featureColor)
{
${u}`,n&&(e+=c),e+=`}
`,e}Wo.prototype.getFragmentShaderCallback=function(e,t,n){if(this.featuresLength!==0)return function(i){return i=eue(i,t,!0),Rt.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}};function Hze(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===Tu.HIGHLIGHT)return 0;if(n===Tu.REPLACE)return 1;if(n===Tu.MIX)return D.clamp(i,D.EPSILON4,1)}Wo.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return Pt(t,{tile_batchTexture:function(){return e._batchTexture.batchTexture??e._batchTexture.defaultTexture},tile_textureDimensions:function(){return e._batchTexture.textureDimensions},tile_textureStep:function(){return e._batchTexture.textureStep},tile_colorBlend:function(){return Hze(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};Wo.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var my={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};Wo.prototype.addDerivedCommands=function(e,t){let n=e.commandList,i=n.length,o=this._content._tile,r=o._finalResolution,a=o.tileset,s=a.isSkippingLevelOfDetail&&a.hasMixedContent&&e.context.stencilBuffer,c=Wze(this);for(let u=t;u<i;++u){let f=n[u];if(f.pass===Be.COMPUTE)continue;let h=f.derivedCommands.tileset;(!l(h)||f.dirty)&&(h={},f.derivedCommands.tileset=h,h.originalCommand=jze(f),f.dirty=!1);let p=h.originalCommand;c!==my.ALL_OPAQUE&&f.pass!==Be.TRANSLUCENT&&(l(h.translucent)||(h.translucent=Yze(p))),c!==my.ALL_TRANSLUCENT&&f.pass!==Be.TRANSLUCENT&&(l(h.opaque)||(h.opaque=qze(p)),s&&(r||(l(h.zback)||(h.zback=Xze(e.context,p)),a._backfaceCommands.push(h.zback)),(!l(h.stencil)||o._selectionDepth!==Zze(h.stencil))&&(f.renderState.depthMask?h.stencil=Jze(p,o._selectionDepth):h.stencil=h.opaque)));let A=s?h.stencil:h.opaque,m=h.translucent;f.pass!==Be.TRANSLUCENT?(c===my.ALL_OPAQUE&&(n[u]=A),c===my.ALL_TRANSLUCENT&&(n[u]=m),c===my.OPAQUE_AND_TRANSLUCENT&&(n[u]=A,n.push(m))):n[u]=p}};function Wze(e){let t=e._batchTexture.translucentFeaturesLength;return t===0?my.ALL_OPAQUE:t===e.featuresLength?my.ALL_TRANSLUCENT:my.OPAQUE_AND_TRANSLUCENT}function jze(e){let t=nt.shallowClone(e),n=t.pass===Be.TRANSLUCENT;return t.uniformMap=l(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return n},t}function Yze(e){let t=nt.shallowClone(e);return t.pass=Be.TRANSLUCENT,t.renderState=$ze(e.renderState),t}function qze(e){let t=nt.shallowClone(e);return t.renderState=eGe(e.renderState),t}function Kze(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 Xze(e,t){let n=nt.shallowClone(t),i=je(n.renderState,!0);i.cull.enabled=!0,i.cull.face=Ni.FRONT,i.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i.polygonOffset={enabled:!0,factor:5,units:5},i.stencilTest=Yt.setCesium3DTileBit(),i.stencilMask=Yt.CESIUM_3D_TILE_MASK,n.renderState=Ve.fromCache(i),n.castShadows=!1,n.receiveShadows=!1,n.uniformMap=je(t.uniformMap);let o=new k(5,5);return n.uniformMap.u_polygonOffset=function(){return o},n.shaderProgram=Kze(e,t.shaderProgram),n}function Jze(e,t){let n=nt.shallowClone(e),i=je(n.renderState,!0);return i.stencilTest.enabled=!0,i.stencilTest.mask=Yt.SKIP_LOD_MASK,i.stencilTest.reference=Yt.CESIUM_3D_TILE_MASK|t<<Yt.SKIP_LOD_BIT_SHIFT,i.stencilTest.frontFunction=ti.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=wt.REPLACE,i.stencilTest.backFunction=ti.GREATER_OR_EQUAL,i.stencilTest.backOperation.zPass=wt.REPLACE,i.stencilMask=Yt.CESIUM_3D_TILE_MASK|Yt.SKIP_LOD_MASK,n.renderState=Ve.fromCache(i),n}function Zze(e){return(e.renderState.stencilTest.reference&Yt.SKIP_LOD_MASK)>>>Yt.SKIP_LOD_BIT_SHIFT}function $ze(e){let t=je(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=sn.ALPHA_BLEND,t.stencilTest=Yt.setCesium3DTileBit(),t.stencilMask=Yt.CESIUM_3D_TILE_MASK,Ve.fromCache(t)}function eGe(e){let t=je(e,!0);return t.stencilTest=Yt.setCesium3DTileBit(),t.stencilMask=Yt.CESIUM_3D_TILE_MASK,Ve.fromCache(t)}Wo.prototype.update=function(e,t){this._batchTexture.update(e,t)};Wo.prototype.isDestroyed=function(){return!1};Wo.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),fe(this)};var Gh=Wo;function tGe(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var mp=tGe;var jx=`in vec3 position;
in float a_batchId;
uniform mat4 u_modifiedModelViewProjection;
void main()
{
gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0));
}
`;var rY=class e{constructor(t,n){this._content=t,this._batchId=n,this._color=void 0}get show(){return this._content.batchTable.getShow(this._batchId)}set show(t){this._content.batchTable.setShow(this._batchId,t)}get color(){return l(this._color)||(this._color=new z),this._content.batchTable.getColor(this._batchId,this._color)}set color(t){this._content.batchTable.setColor(this._batchId,t)}get polylinePositions(){if(l(this._content.getPolylinePositions))return this._content.getPolylinePositions(this._batchId)}get content(){return this._content}get tileset(){return this._content.tileset}get primitive(){return this._content.tileset}get featureId(){return this._batchId}get pickId(){return this._content.batchTable.getPickColor(this._batchId)}hasProperty(t){return this._content.batchTable.hasProperty(this._batchId,t)}getPropertyIds(t){return this._content.batchTable.getPropertyIds(this._batchId,t)}getProperty(t){return this._content.batchTable.getProperty(this._batchId,t)}static getPropertyInherited(t,n,i){let o=t.batchTable;if(l(o)){if(o.hasPropertyBySemantic(n,i))return o.getPropertyBySemantic(n,i);if(o.hasProperty(n,i))return o.getProperty(n,i)}let r=t.metadata;if(l(r)){if(r.hasPropertyBySemantic(i))return r.getPropertyBySemantic(i);if(r.hasProperty(i))return r.getProperty(i)}let a=t.tile,s=a.metadata;if(l(s)){if(s.hasPropertyBySemantic(i))return s.getPropertyBySemantic(i);if(s.hasProperty(i))return s.getProperty(i)}let c;if(l(a.implicitSubtree)&&(c=a.implicitSubtree.metadata),l(c)){if(c.hasPropertyBySemantic(i))return c.getPropertyBySemantic(i);if(c.hasProperty(i))return c.getProperty(i)}let u=l(t.group)?t.group.metadata:void 0;if(l(u)){if(u.hasPropertyBySemantic(i))return u.getPropertyBySemantic(i);if(u.hasProperty(i))return u.getProperty(i)}let f=t.tileset.metadata;if(l(f)){if(f.hasPropertyBySemantic(i))return f.getPropertyBySemantic(i);if(f.hasProperty(i))return f.getProperty(i)}}getPropertyInherited(t){return e.getPropertyInherited(this._content,this._batchId,t)}setProperty(t,n){this._content.batchTable.setProperty(this._batchId,t,n),this._content.featurePropertiesDirty=!0}isExactClass(t){return this._content.batchTable.isExactClass(this._batchId,t)}isClass(t){return this._content.batchTable.isClass(this._batchId,t)}getExactClassName(){return this._content.batchTable.getExactClassName(this._batchId)}},Ns=rY;var aY=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)})}},sY=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)})}},Su=class e{static get version(){return"1.3.8"}static toString(){return"JavaScript Expression Parser (JSEP) v"+e.version}static addUnaryOp(t){return e.max_unop_len=Math.max(t.length,e.max_unop_len),e.unary_ops[t]=1,e}static addBinaryOp(t,n,i){return e.max_binop_len=Math.max(t.length,e.max_binop_len),e.binary_ops[t]=n,i?e.right_associative.add(t):e.right_associative.delete(t),e}static addIdentifierChar(t){return e.additional_identifier_chars.add(t),e}static addLiteral(t,n){return e.literals[t]=n,e}static removeUnaryOp(t){return delete e.unary_ops[t],t.length===e.max_unop_len&&(e.max_unop_len=e.getMaxKeyLen(e.unary_ops)),e}static removeAllUnaryOps(){return e.unary_ops={},e.max_unop_len=0,e}static removeIdentifierChar(t){return e.additional_identifier_chars.delete(t),e}static removeBinaryOp(t){return delete e.binary_ops[t],t.length===e.max_binop_len&&(e.max_binop_len=e.getMaxKeyLen(e.binary_ops)),e.right_associative.delete(t),e}static removeAllBinaryOps(){return e.binary_ops={},e.max_binop_len=0,e}static removeLiteral(t){return delete e.literals[t],e}static removeAllLiterals(){return e.literals={},e}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new e(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(n=>n.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return e.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!e.binary_ops[String.fromCharCode(t)]||e.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return e.isIdentifierStart(t)||e.isDecimalDigit(t)}throwError(t){let n=new Error(t+" at character "+this.index);throw n.index=this.index,n.description=t,n}runHook(t,n){if(e.hooks[t]){let i={context:this,node:n};return e.hooks.run(t,i),i.node}return n}searchHook(t){if(e.hooks[t]){let n={context:this};return e.hooks[t].find(function(i){return i.call(n.context,n),n.node}),n.node}}gobbleSpaces(){let t=this.code;for(;t===e.SPACE_CODE||t===e.TAB_CODE||t===e.LF_CODE||t===e.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let t=this.gobbleExpressions(),n=t.length===1?t[0]:{type:e.COMPOUND,body:t};return this.runHook("after-all",n)}gobbleExpressions(t){let n=[],i,o;for(;this.index<this.expr.length;)if(i=this.code,i===e.SEMCOL_CODE||i===e.COMMA_CODE)this.index++;else if(o=this.gobbleExpression())n.push(o);else if(this.index<this.expr.length){if(i===t)break;this.throwError('Unexpected "'+this.char+'"')}return n}gobbleExpression(){let t=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",t)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,e.max_binop_len),n=t.length;for(;n>0;){if(e.binary_ops.hasOwnProperty(t)&&(!e.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=n,t;t=t.substr(0,--n)}return!1}gobbleBinaryExpression(){let t,n,i,o,r,a,s,c,u;if(a=this.gobbleToken(),!a||(n=this.gobbleBinaryOp(),!n))return a;for(r={value:n,prec:e.binaryPrecedence(n),right_a:e.right_associative.has(n)},s=this.gobbleToken(),s||this.throwError("Expected expression after "+n),o=[a,r,s];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)},u=n;let f=h=>r.right_a&&h.right_a?i>h.prec:i<=h.prec;for(;o.length>2&&f(o[o.length-2]);)s=o.pop(),n=o.pop().value,a=o.pop(),t={type:e.BINARY_EXP,operator:n,left:a,right:s},o.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+u),o.push(r,t)}for(c=o.length-1,t=o[c];c>1;)t={type:e.BINARY_EXP,operator:o[c-1].value,left:o[c-2],right:t},c-=2;return t}gobbleToken(){let t,n,i,o;if(this.gobbleSpaces(),o=this.searchHook("gobble-token"),o)return this.runHook("after-token",o);if(t=this.code,e.isDecimalDigit(t)||t===e.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===e.SQUOTE_CODE||t===e.DQUOTE_CODE)o=this.gobbleStringLiteral();else if(t===e.OBRACK_CODE)o=this.gobbleArray();else{for(n=this.expr.substr(this.index,e.max_unop_len),i=n.length;i>0;){if(e.unary_ops.hasOwnProperty(n)&&(!e.isIdentifierStart(this.code)||this.index+n.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+n.length)))){this.index+=i;let r=this.gobbleToken();return r||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:e.UNARY_EXP,operator:n,argument:r,prefix:!0})}n=n.substr(0,--i)}e.isIdentifierStart(t)?(o=this.gobbleIdentifier(),e.literals.hasOwnProperty(o.name)?o={type:e.LITERAL,value:e.literals[o.name],raw:o.name}:o.name===e.this_str&&(o={type:e.THIS_EXP})):t===e.OPAREN_CODE&&(o=this.gobbleGroup())}return o?(o=this.gobbleTokenProperty(o),this.runHook("after-token",o)):this.runHook("after-token",!1)}gobbleTokenProperty(t){this.gobbleSpaces();let n=this.code;for(;n===e.PERIOD_CODE||n===e.OBRACK_CODE||n===e.OPAREN_CODE||n===e.QUMARK_CODE;){let i;if(n===e.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==e.PERIOD_CODE)break;i=!0,this.index+=2,this.gobbleSpaces(),n=this.code}this.index++,n===e.OBRACK_CODE?(t={type:e.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},this.gobbleSpaces(),n=this.code,n!==e.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):n===e.OPAREN_CODE?t={type:e.CALL_EXP,arguments:this.gobbleArguments(e.CPAREN_CODE),callee:t}:(n===e.PERIOD_CODE||i)&&(i&&this.index--,this.gobbleSpaces(),t={type:e.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),i&&(t.optional=!0),this.gobbleSpaces(),n=this.code}return t}gobbleNumericLiteral(){let t="",n,i;for(;e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(this.code===e.PERIOD_CODE)for(t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(n=this.char,n==="e"||n==="E"){for(t+=this.expr.charAt(this.index++),n=this.char,(n==="+"||n==="-")&&(t+=this.expr.charAt(this.index++));e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+t+this.char+")")}return i=this.code,e.isIdentifierStart(i)?this.throwError("Variable names cannot start with a number ("+t+this.char+")"):(i===e.PERIOD_CODE||t.length===1&&t.charCodeAt(0)===e.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:e.LITERAL,value:parseFloat(t),raw:t}}gobbleStringLiteral(){let t="",n=this.index,i=this.expr.charAt(this.index++),o=!1;for(;this.index<this.expr.length;){let r=this.expr.charAt(this.index++);if(r===i){o=!0;break}else if(r==="\\")switch(r=this.expr.charAt(this.index++),r){case"n":t+=`
`;break;case"r":t+="\r";break;case"t":t+=" ";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:t+=r}else t+=r}return o||this.throwError('Unclosed quote after "'+t+'"'),{type:e.LITERAL,value:t,raw:this.expr.substring(n,this.index)}}gobbleIdentifier(){let t=this.code,n=this.index;for(e.isIdentifierStart(t)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(t=this.code,e.isIdentifierPart(t));)this.index++;return{type:e.IDENTIFIER,name:this.expr.slice(n,this.index)}}gobbleArguments(t){let n=[],i=!1,o=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let r=this.code;if(r===t){i=!0,this.index++,t===e.CPAREN_CODE&&o&&o>=n.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(r===e.COMMA_CODE){if(this.index++,o++,o!==n.length){if(t===e.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===e.CBRACK_CODE)for(let a=n.length;a<o;a++)n.push(null)}}else if(n.length!==o&&o!==0)this.throwError("Expected comma");else{let a=this.gobbleExpression();(!a||a.type===e.COMPOUND)&&this.throwError("Expected comma"),n.push(a)}}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)}}},nGe=new aY;Object.assign(Su,{hooks:nGe,plugins:new sY(Su),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"});Su.max_unop_len=Su.getMaxKeyLen(Su.unary_ops);Su.max_binop_len=Su.getMaxKeyLen(Su.binary_ops);var py=e=>new Su(e).parse(),iGe=Object.getOwnPropertyNames(Su);iGe.forEach(e=>{py[e]===void 0&&e!=="prototype"&&(py[e]=Su[e])});py.Jsep=Su;var oGe="ConditionalExpression",rGe={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:oGe,test:i,consequent:o,alternate:r},i.operator&&e.binary_ops[i.operator]<=.9){let a=i;for(;a.right.operator&&e.binary_ops[a.right.operator]<=.9;)a=a.right;n.node.test=a.right,a.right=n.node,n.node=i}}else this.throwError("Expected :")}})}};py.plugins.register(rGe);var aGe={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},Bt=Object.freeze(aGe);function Vh(e,t){this._expression=e,e=yGe(e,t),e=EGe(CGe(e)),py.addBinaryOp("=~",0),py.addBinaryOp("!~",0);let n;try{n=py(e)}catch(i){throw new ue(i)}this._runtimeAst=zi(this,n)}Object.defineProperties(Vh.prototype,{expression:{get:function(){return this._expression}}});var zn={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new k],cartesian3Array:[new d],cartesian4Array:[new ie],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 k),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new d),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new ie),this.cartesian4Array[this.cartesian4Index++]}};Vh.prototype.evaluate=function(e,t){zn.reset();let n=this._runtimeAst.evaluate(e);return t instanceof z&&n instanceof ie?z.fromCartesian4(n,t):n instanceof k||n instanceof d||n instanceof ie?n.clone(t):n};Vh.prototype.evaluateColor=function(e,t){zn.reset();let n=this._runtimeAst.evaluate(e);return z.fromCartesian4(n,t)};Vh.prototype.getShaderFunction=function(e,t,n,i){let o=this.getShaderExpression(t,n);return o=`${i} ${e}
{
return ${o};
}
`,o};Vh.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};Vh.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var sGe=["!","-","+"],tue=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],UM=/\${(.*?)}/g,cGe=/\\/g,lGe="@#%",uGe=/@#%/g,BV=new z,DV={abs:Ls(Math.abs),sqrt:Ls(Math.sqrt),cos:Ls(Math.cos),sin:Ls(Math.sin),tan:Ls(Math.tan),acos:Ls(Math.acos),asin:Ls(Math.asin),atan:Ls(Math.atan),radians:Ls(D.toRadians),degrees:Ls(D.toDegrees),sign:Ls(D.sign),floor:Ls(Math.floor),ceil:Ls(Math.ceil),round:Ls(Math.round),exp:Ls(Math.exp),exp2:Ls(dGe),log:Ls(Math.log),log2:Ls(hGe),fract:Ls(fGe),length:mGe,normalize:pGe},vV={atan2:SV(Math.atan2,!1),pow:SV(Math.pow,!1),min:SV(Math.min,!0),max:SV(Math.max,!0),distance:AGe,dot:gGe,cross:_Ge},uY={clamp:nue(D.clamp,!0),mix:nue(D.lerp,!0)};function fGe(e){return e-Math.floor(e)}function dGe(e){return Math.pow(2,e)}function hGe(e){return D.log2(e)}function Ls(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof k)return k.fromElements(e(n.x),e(n.y),zn.getCartesian2());if(n instanceof d)return d.fromElements(e(n.x),e(n.y),e(n.z),zn.getCartesian3());if(n instanceof ie)return ie.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),zn.getCartesian4());throw new ue(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function SV(e,t){return function(n,i,o){if(t&&typeof o=="number"){if(typeof i=="number")return e(i,o);if(i instanceof k)return k.fromElements(e(i.x,o),e(i.y,o),zn.getCartesian2());if(i instanceof d)return d.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),zn.getCartesian3());if(i instanceof ie)return ie.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),e(i.w,o),zn.getCartesian4())}if(typeof i=="number"&&typeof o=="number")return e(i,o);if(i instanceof k&&o instanceof k)return k.fromElements(e(i.x,o.x),e(i.y,o.y),zn.getCartesian2());if(i instanceof d&&o instanceof d)return d.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),zn.getCartesian3());if(i instanceof ie&&o instanceof ie)return ie.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),e(i.w,o.w),zn.getCartesian4());throw new ue(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${o}.`)}}function nue(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 k&&o instanceof k)return k.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),zn.getCartesian2());if(i instanceof d&&o instanceof d)return d.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),zn.getCartesian3());if(i instanceof ie&&o instanceof ie)return ie.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),zn.getCartesian4())}if(typeof i=="number"&&typeof o=="number"&&typeof r=="number")return e(i,o,r);if(i instanceof k&&o instanceof k&&r instanceof k)return k.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),zn.getCartesian2());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),e(i.z,o.z,r.z),zn.getCartesian3());if(i instanceof ie&&o instanceof ie&&r instanceof ie)return ie.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),zn.getCartesian4());throw new ue(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${o}, and ${r}.`)}}function mGe(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof k)return k.magnitude(t);if(t instanceof d)return d.magnitude(t);if(t instanceof ie)return ie.magnitude(t);throw new ue(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function pGe(e,t){if(typeof t=="number")return 1;if(t instanceof k)return k.normalize(t,zn.getCartesian2());if(t instanceof d)return d.normalize(t,zn.getCartesian3());if(t instanceof ie)return ie.normalize(t,zn.getCartesian4());throw new ue(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function AGe(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof k&&n instanceof k)return k.distance(t,n);if(t instanceof d&&n instanceof d)return d.distance(t,n);if(t instanceof ie&&n instanceof ie)return ie.distance(t,n);throw new ue(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function gGe(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof k&&n instanceof k)return k.dot(t,n);if(t instanceof d&&n instanceof d)return d.dot(t,n);if(t instanceof ie&&n instanceof ie)return ie.dot(t,n);throw new ue(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function _Ge(e,t,n){if(t instanceof d&&n instanceof d)return d.cross(t,n,zn.getCartesian3());throw new ue(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function Nt(e,t,n,i,o){this._type=e,this._value=t,this._left=n,this._right=i,this._test=o,this.evaluate=void 0,PGe(this)}function yGe(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 CGe(e){return e.replace(cGe,lGe)}function lY(e){return e.replace(uGe,"\\")}function EGe(e){let t=e,n="",i=t.indexOf("${");for(;i>=0;){let o=t.indexOf("'"),r=t.indexOf('"'),a;if(o>=0&&o<i)a=t.indexOf("'",o+1),n+=t.substr(0,a+1),t=t.substr(a+1),i=t.indexOf("${");else if(r>=0&&r<i)a=t.indexOf('"',r+1),n+=t.substr(0,a+1),t=t.substr(a+1),i=t.indexOf("${");else{n+=t.substr(0,i);let s=t.indexOf("}");if(s<0)throw new ue("Unmatched {.");n+=`czm_${t.substr(i+2,s-(i+2))}`,t=t.substr(s+1),i=t.indexOf("${")}}return n+=t,n}function bGe(e){let t=typeof e.value;if(e.value===null)return new Nt(Bt.LITERAL_NULL,null);if(t==="boolean")return new Nt(Bt.LITERAL_BOOLEAN,e.value);if(t==="number")return new Nt(Bt.LITERAL_NUMBER,e.value);if(t==="string")return e.value.indexOf("${")>=0?new Nt(Bt.VARIABLE_IN_STRING,e.value):new Nt(Bt.LITERAL_STRING,lY(e.value))}function IGe(e,t){let n=t.arguments,i=n.length,o,r,a,s;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 Nt(Bt.LITERAL_BOOLEAN,!1):new Nt(Bt.LITERAL_NULL,null):(a=zi(e,c),s=zi(e,n[0]),new Nt(Bt.FUNCTION_CALL,o,a,s))}else if(o==="toString")return r=zi(e,c),new Nt(Bt.FUNCTION_CALL,o,r);throw new ue(`Unexpected function call "${o}".`)}if(o=t.callee.name,o==="color"){if(i===0)return new Nt(Bt.LITERAL_COLOR,o);if(r=zi(e,n[0]),l(n[1])){let c=zi(e,n[1]);return new Nt(Bt.LITERAL_COLOR,o,[r,c])}return new Nt(Bt.LITERAL_COLOR,o,[r])}else if(o==="rgb"||o==="hsl"){if(i<3)throw new ue(`${o} requires three arguments.`);return r=[zi(e,n[0]),zi(e,n[1]),zi(e,n[2])],new Nt(Bt.LITERAL_COLOR,o,r)}else if(o==="rgba"||o==="hsla"){if(i<4)throw new ue(`${o} requires four arguments.`);return r=[zi(e,n[0]),zi(e,n[1]),zi(e,n[2]),zi(e,n[3])],new Nt(Bt.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]=zi(e,n[c]);return new Nt(Bt.LITERAL_VECTOR,o,r)}else{if(o==="isNaN"||o==="isFinite")return i===0?o==="isNaN"?new Nt(Bt.LITERAL_BOOLEAN,!0):new Nt(Bt.LITERAL_BOOLEAN,!1):(r=zi(e,n[0]),new Nt(Bt.UNARY,o,r));if(o==="isExactClass"||o==="isClass"){if(i<1||i>1)throw new ue(`${o} requires exactly one argument.`);return r=zi(e,n[0]),new Nt(Bt.UNARY,o,r)}else if(o==="getExactClassName"){if(i>0)throw new ue(`${o} does not take any argument.`);return new Nt(Bt.UNARY,o)}else if(l(DV[o])){if(i!==1)throw new ue(`${o} requires exactly one argument.`);return r=zi(e,n[0]),new Nt(Bt.UNARY,o,r)}else if(l(vV[o])){if(i!==2)throw new ue(`${o} requires exactly two arguments.`);return a=zi(e,n[0]),s=zi(e,n[1]),new Nt(Bt.BINARY,o,a,s)}else if(l(uY[o])){if(i!==3)throw new ue(`${o} requires exactly three arguments.`);a=zi(e,n[0]),s=zi(e,n[1]);let c=zi(e,n[2]);return new Nt(Bt.TERNARY,o,a,s,c)}else{if(o==="Boolean")return i===0?new Nt(Bt.LITERAL_BOOLEAN,!1):(r=zi(e,n[0]),new Nt(Bt.UNARY,o,r));if(o==="Number")return i===0?new Nt(Bt.LITERAL_NUMBER,0):(r=zi(e,n[0]),new Nt(Bt.UNARY,o,r));if(o==="String")return i===0?new Nt(Bt.LITERAL_STRING,""):(r=zi(e,n[0]),new Nt(Bt.UNARY,o,r));if(o==="regExp")return xGe(e,t)}}throw new ue(`Unexpected function call "${o}".`)}function xGe(e,t){let n=t.arguments;if(n.length===0)return new Nt(Bt.LITERAL_REGEX,new RegExp);let i=zi(e,n[0]),o;if(n.length>1){let r=zi(e,n[1]);if(cY(i)&&cY(r)){try{o=new RegExp(lY(String(i._value)),r._value)}catch(a){throw new ue(a)}return new Nt(Bt.LITERAL_REGEX,o)}return new Nt(Bt.REGEX,i,r)}if(cY(i)){try{o=new RegExp(lY(String(i._value)))}catch(r){throw new ue(r)}return new Nt(Bt.LITERAL_REGEX,o)}return new Nt(Bt.REGEX,i)}function TGe(e){if(DGe(e.name)){let t=vGe(e.name);return t.substr(0,8)==="tiles3d_"?new Nt(Bt.BUILTIN_VARIABLE,t):new Nt(Bt.VARIABLE,t)}else{if(e.name==="NaN")return new Nt(Bt.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new Nt(Bt.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new Nt(Bt.LITERAL_UNDEFINED,void 0)}throw new ue(`${e.name} is not defined.`)}function SGe(e){let t=e.property.name;if(t==="PI")return new Nt(Bt.LITERAL_NUMBER,Math.PI);if(t==="E")return new Nt(Bt.LITERAL_NUMBER,Math.E)}function wGe(e){if(e.property.name==="POSITIVE_INFINITY")return new Nt(Bt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function BGe(e,t){if(t.object.name==="Math")return SGe(t);if(t.object.name==="Number")return wGe(t);let n,i=zi(e,t.object);return t.computed?(n=zi(e,t.property),new Nt(Bt.MEMBER,"brackets",i,n)):(n=new Nt(Bt.LITERAL_STRING,t.property.name),new Nt(Bt.MEMBER,"dot",i,n))}function cY(e){return e._type>=Bt.LITERAL_NULL}function DGe(e){return e.substr(0,4)==="czm_"}function vGe(e){return e.substr(4)}function zi(e,t){let n,i,o,r;if(t.type==="Literal")n=bGe(t);else if(t.type==="CallExpression")n=IGe(e,t);else if(t.type==="Identifier")n=TGe(t);else if(t.type==="UnaryExpression"){i=t.operator;let a=zi(e,t.argument);if(sGe.indexOf(i)>-1)n=new Nt(Bt.UNARY,i,a);else throw new ue(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,o=zi(e,t.left),r=zi(e,t.right),tue.indexOf(i)>-1)n=new Nt(Bt.BINARY,i,o,r);else throw new ue(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,o=zi(e,t.left),r=zi(e,t.right),tue.indexOf(i)>-1&&(n=new Nt(Bt.BINARY,i,o,r));else if(t.type==="ConditionalExpression"){let a=zi(e,t.test);o=zi(e,t.consequent),r=zi(e,t.alternate),n=new Nt(Bt.CONDITIONAL,"?",o,r,a)}else if(t.type==="MemberExpression")n=BGe(e,t);else if(t.type==="ArrayExpression"){let a=[];for(let s=0;s<t.elements.length;s++)a[s]=zi(e,t.elements[s]);n=new Nt(Bt.ARRAY,a)}else throw t.type==="Compound"?new ue("Provide exactly one expression."):new ue("Cannot parse expression.");return n}function PGe(e){e._type===Bt.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===Bt.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===Bt.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(DV[e._value])&&(e.evaluate=MGe(e._value)):e._type===Bt.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(vV[e._value])&&(e.evaluate=NGe(e._value)):e._type===Bt.TERNARY?e.evaluate=LGe(e._value):e._type===Bt.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===Bt.ARRAY?e.evaluate=e._evaluateArray:e._type===Bt.VARIABLE?e.evaluate=e._evaluateVariable:e._type===Bt.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===Bt.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===Bt.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===Bt.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===Bt.REGEX?e.evaluate=e._evaluateRegExp:e._type===Bt.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=RGe):e.evaluate=e._evaluateLiteral}function RGe(e){return l(e)?e.content.tileset.timeSinceLoad:0}function MGe(e){let t=DV[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function NGe(e){let t=vV[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n);return t(e,i,o)}}function LGe(e){let t=uY[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 PV(e,t){if(l(e))return e.getPropertyInherited(t)}Nt.prototype._evaluateLiteral=function(){return this._value};Nt.prototype._evaluateLiteralColor=function(e){let t=BV,n=this._left;if(this._value==="color")l(n)?n.length>1?(z.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):z.fromCssColorString(n[0].evaluate(e),t):z.fromBytes(255,255,255,255,t);else if(this._value==="rgb")z.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;z.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?z.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&z.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return ie.fromColor(t,zn.getCartesian4())};Nt.prototype._evaluateLiteralVector=function(e){let t=zn.getArray(),n=this._value,i=this._left,o=i.length;for(let s=0;s<o;++s){let c=i[s].evaluate(e);if(typeof c=="number")t.push(c);else if(c instanceof k)t.push(c.x,c.y);else if(c instanceof d)t.push(c.x,c.y,c.z);else if(c instanceof ie)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,a=parseInt(n.charAt(3));if(r===0)throw new ue(`Invalid ${n} constructor. No valid arguments.`);if(r<a&&r>1)throw new ue(`Invalid ${n} constructor. Not enough arguments.`);if(r>a&&o>1)throw new ue(`Invalid ${n} constructor. Too many arguments.`);if(r===1){let s=t[0];t.push(s,s,s)}if(n==="vec2")return k.fromArray(t,0,zn.getCartesian2());if(n==="vec3")return d.fromArray(t,0,zn.getCartesian3());if(n==="vec4")return ie.fromArray(t,0,zn.getCartesian4())};Nt.prototype._evaluateLiteralString=function(){return this._value};Nt.prototype._evaluateVariableString=function(e){let t=this._value,n=UM.exec(t);for(;n!==null;){let i=n[0],o=n[1],r=PV(e,o);l(r)||(r=""),t=t.replace(i,r),UM.lastIndex+=r.length-i.length,n=UM.exec(t)}return t};Nt.prototype._evaluateVariable=function(e){return PV(e,this._value)};function u0(e){return e._value==="feature"}Nt.prototype._evaluateMemberDot=function(e){if(u0(this._left))return PV(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof k||t instanceof d||t instanceof ie){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]};Nt.prototype._evaluateMemberBrackets=function(e){if(u0(this._left))return PV(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof k||t instanceof d||t instanceof ie){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]};Nt.prototype._evaluateArray=function(e){let t=[];for(let n=0;n<this._value.length;n++)t[n]=this._value[n].evaluate(e);return t};Nt.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};Nt.prototype._evaluateNegative=function(e){let t=this._left.evaluate(e);if(t instanceof k)return k.negate(t,zn.getCartesian2());if(t instanceof d)return d.negate(t,zn.getCartesian3());if(t instanceof ie)return ie.negate(t,zn.getCartesian4());if(typeof t=="number")return-t;throw new ue(`Operator "-" requires a vector or number argument. Argument is ${t}.`)};Nt.prototype._evaluatePositive=function(e){let t=this._left.evaluate(e);if(!(t instanceof k||t instanceof d||t instanceof ie||typeof t=="number"))throw new ue(`Operator "+" requires a vector or number argument. Argument is ${t}.`);return t};Nt.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};Nt.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};Nt.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};Nt.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};Nt.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};Nt.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};Nt.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof k&&t instanceof k)return k.add(t,n,zn.getCartesian2());if(n instanceof d&&t instanceof d)return d.add(t,n,zn.getCartesian3());if(n instanceof ie&&t instanceof ie)return ie.add(t,n,zn.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}.`)};Nt.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof k&&t instanceof k)return k.subtract(t,n,zn.getCartesian2());if(n instanceof d&&t instanceof d)return d.subtract(t,n,zn.getCartesian3());if(n instanceof ie&&t instanceof ie)return ie.subtract(t,n,zn.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}.`)};Nt.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof k&&t instanceof k)return k.multiplyComponents(t,n,zn.getCartesian2());if(n instanceof k&&typeof t=="number")return k.multiplyByScalar(n,t,zn.getCartesian2());if(t instanceof k&&typeof n=="number")return k.multiplyByScalar(t,n,zn.getCartesian2());if(n instanceof d&&t instanceof d)return d.multiplyComponents(t,n,zn.getCartesian3());if(n instanceof d&&typeof t=="number")return d.multiplyByScalar(n,t,zn.getCartesian3());if(t instanceof d&&typeof n=="number")return d.multiplyByScalar(t,n,zn.getCartesian3());if(n instanceof ie&&t instanceof ie)return ie.multiplyComponents(t,n,zn.getCartesian4());if(n instanceof ie&&typeof t=="number")return ie.multiplyByScalar(n,t,zn.getCartesian4());if(t instanceof ie&&typeof n=="number")return ie.multiplyByScalar(t,n,zn.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}.`)};Nt.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof k&&t instanceof k)return k.divideComponents(t,n,zn.getCartesian2());if(t instanceof k&&typeof n=="number")return k.divideByScalar(t,n,zn.getCartesian2());if(n instanceof d&&t instanceof d)return d.divideComponents(t,n,zn.getCartesian3());if(t instanceof d&&typeof n=="number")return d.divideByScalar(t,n,zn.getCartesian3());if(n instanceof ie&&t instanceof ie)return ie.divideComponents(t,n,zn.getCartesian4());if(t instanceof ie&&typeof n=="number")return ie.divideByScalar(t,n,zn.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}.`)};Nt.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof k&&t instanceof k)return k.fromElements(t.x%n.x,t.y%n.y,zn.getCartesian2());if(n instanceof d&&t instanceof d)return d.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,zn.getCartesian3());if(n instanceof ie&&t instanceof ie)return ie.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,t.w%n.w,zn.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}.`)};Nt.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof k&&t instanceof k||n instanceof d&&t instanceof d||n instanceof ie&&t instanceof ie?t.equals(n):t===n};Nt.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof k&&t instanceof k||n instanceof d&&t instanceof d||n instanceof ie&&t instanceof ie?!t.equals(n):t!==n};Nt.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)};Nt.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};Nt.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};Nt.prototype._evaluateIsExactClass=function(e){return l(e)?e.isExactClass(this._left.evaluate(e)):!1};Nt.prototype._evaluateIsClass=function(e){return l(e)?e.isClass(this._left.evaluate(e)):!1};Nt.prototype._evaluateGetExactClassName=function(e){if(l(e))return e.getExactClassName()};Nt.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};Nt.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};Nt.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};Nt.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};Nt.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)};Nt.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}.`)};Nt.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}.`)};Nt.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};Nt.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof k||t instanceof d||t instanceof ie)return String(t);throw new ue(`Unexpected function call "${this._value}".`)};function iue(e){let t=e._left,n=t.length;for(let s=0;s<n;++s)if(t[s]._type!==Bt.LITERAL_NUMBER)return;let i=t[0]._value,o=t[1]._value,r=t[2]._value,a=n===4?t[3]._value:1;return z.fromHsl(i,o,r,a,BV)}function oue(e){let t=e._left,n=t.length;for(let o=0;o<n;++o)if(t[o]._type!==Bt.LITERAL_NUMBER)return;let i=BV;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 Ay(e){return e%1===0?e.toFixed(1):e.toString()}function OGe(e){let t=Ay(e.red),n=Ay(e.green),i=Ay(e.blue);return`vec3(${t}, ${n}, ${i})`}function wV(e){let t=Ay(e.red),n=Ay(e.green),i=Ay(e.blue),o=Ay(e.alpha);return`vec4(${t}, ${n}, ${i}, ${o})`}function rue(e,t,n,i){let o=e.length,r=new Array(o);for(let a=0;a<o;++a)r[a]=e[a].getShaderExpression(t,n,i);return r}function aue(e,t){return l(t[e])?t[e]:Vh.NULL_SENTINEL}Vh.NULL_SENTINEL="czm_infinity";Nt.prototype.getShaderExpression=function(e,t,n){let i,o,r,a,s=this._type,c=this._value;l(this._left)&&(Array.isArray(this._left)?o=rue(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)&&(a=this._test.getShaderExpression(e,t,this)),Array.isArray(this._value)&&(c=rue(this._value,e,t,this));let u,f,h;switch(s){case Bt.VARIABLE:return u0(this)?void 0:aue(c,e);case Bt.UNARY:if(c==="Boolean")return`bool(${o})`;if(c==="Number")return`float(${o})`;if(c==="round")return`floor(${o} + 0.5)`;if(l(DV[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 Bt.BINARY:return c==="%"?`mod(${o}, ${r})`:c==="==="?`(${o} == ${r})`:c==="!=="?`(${o} != ${r})`:c==="atan2"?`atan(${o}, ${r})`:l(vV[c])?`${c}(${o}, ${r})`:`(${o} ${c} ${r})`;case Bt.TERNARY:if(l(uY[c]))return`${c}(${o}, ${r}, ${a})`;break;case Bt.CONDITIONAL:return`(${a} ? ${o} : ${r})`;case Bt.MEMBER:return u0(this._left)?aue(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 Bt.FUNCTION_CALL:throw new ue(`Error generating style shader: "${c}" is not supported.`);case Bt.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 Bt.REGEX:throw new ue("Error generating style shader: Regular expressions are not supported.");case Bt.VARIABLE_IN_STRING:throw new ue("Error generating style shader: Converting a variable to a string is not supported.");case Bt.LITERAL_NULL:return Vh.NULL_SENTINEL;case Bt.LITERAL_BOOLEAN:return c?"true":"false";case Bt.LITERAL_NUMBER:return Ay(c);case Bt.LITERAL_STRING:if(l(n)&&n._type===Bt.MEMBER&&(c==="r"||c==="g"||c==="b"||c==="a"||c==="x"||c==="y"||c==="z"||c==="w"||u0(n._left)))return c;if(i=z.fromCssColorString(c,BV),l(i))return OGe(i);throw new ue("Error generating style shader: String literals are not supported.");case Bt.LITERAL_COLOR:if(u=o,c==="color"){if(l(u)){if(u.length>1){let p=u[0],A=u[1];return A!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${A})`}}else return"vec4(1.0)";return`vec4(${u[0]}, 1.0)`}else{if(c==="rgb")return i=oue(this),l(i)?wV(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, 1.0)`;if(c==="rgba")return u[3]!=="1.0"&&(t.translucent=!0),i=oue(this),l(i)?wV(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, ${u[3]})`;if(c==="hsl")return i=iue(this),l(i)?wV(i):`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), 1.0)`;if(c==="hsla")return i=iue(this),l(i)?(i.alpha!==1&&(t.translucent=!0),wV(i)):(u[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), ${u[3]})`)}break;case Bt.LITERAL_VECTOR:f=o.length,h=`${c}(`;for(let p=0;p<f;++p)h+=o[p],p<f-1&&(h+=", ");return h+=")",h;case Bt.LITERAL_REGEX:throw new ue("Error generating style shader: Regular expressions are not supported.");case Bt.LITERAL_UNDEFINED:return Vh.NULL_SENTINEL;case Bt.BUILTIN_VARIABLE:if(c==="tiles3d_tileset_time")return c}};Nt.prototype.getVariables=function(e,t){let n,i,o,r=this._type,a=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 s;switch(r){case Bt.VARIABLE:u0(this)||e.push(a);break;case Bt.VARIABLE_IN_STRING:for(s=UM.exec(a);s!==null;)e.push(s[1]),s=UM.exec(a);break;case Bt.LITERAL_STRING:l(t)&&t._type===Bt.MEMBER&&u0(t._left)&&e.push(a);break}};var Id=Vh;function ZA(e){e=e??V.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=e.center??d.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=z.clone(z.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=e.classificationType??ei.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(ZA.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var FGe={position:0,a_batchId:1};function QGe(e,t){if(l(e._va))return;let n=tt.createVertexBuffer({context:t,typedArray:e._positions,usage:Re.STATIC_DRAW}),i=tt.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:Re.STATIC_DRAW}),o=tt.createIndexBuffer({context:t,typedArray:e._indices,usage:Re.DYNAMIC_DRAW,indexDatatype:e._indices.BYTES_PER_ELEMENT===2?Ue.UNSIGNED_SHORT:Ue.UNSIGNED_INT}),r=[{index:0,vertexBuffer:n,componentDatatype:j.fromTypedArray(e._positions),componentsPerAttribute:3},{index:1,vertexBuffer:i,componentDatatype:j.fromTypedArray(e._vertexBatchIds),componentsPerAttribute:1}];e._va=new Gn({context:t,attributes:r,indexBuffer:o}),t.webgl2&&(e._vaSwap=new Gn({context:t,attributes:r,indexBuffer:tt.createIndexBuffer({context:t,sizeInBytes:o.sizeInBytes,usage:Re.DYNAMIC_DRAW,indexDatatype:o.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0}function kGe(e,t){if(l(e._sp))return;let n=e._batchTable,i=e._attributeLocations??FGe,o=e._pickId,r=e._vertexShaderSource,a=e._fragmentShaderSource;if(l(r)){e._sp=$t.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:i}),e._spStencil=e._sp,a=We.replaceMain(a,"czm_non_pick_main"),a=`${a}void main()
{
czm_non_pick_main();
out_FragColor = ${o};
}
`,e._spPick=$t.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:i});return}let s=n.getVertexShaderCallback(!1,"a_batchId",void 0)(jx),c=n.getFragmentShaderCallback(!1,void 0,!0)(cy);o=n.getPickId();let u=new We({sources:[s]}),f=new We({defines:["VECTOR_TILE"],sources:[c]});e._sp=$t.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),u=new We({sources:[jx]}),f=new We({defines:["VECTOR_TILE"],sources:[cy]}),e._spStencil=$t.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),c=We.replaceMain(c,"czm_non_pick_main"),c=`${c}
void main()
{
czm_non_pick_main();
out_FragColor = ${o};
}
`;let h=new We({sources:[s]}),p=new We({defines:["VECTOR_TILE"],sources:[c]});e._spPick=$t.fromCache({context:t,vertexShaderSource:h,fragmentShaderSource:p,attributeLocations:i})}function sue(e){let t=e?ti.EQUAL:ti.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:wt.KEEP,zFail:wt.DECREMENT_WRAP,zPass:wt.KEEP},backFunction:t,backOperation:{fail:wt.KEEP,zFail:wt.INCREMENT_WRAP,zPass:wt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:nc.LESS_OR_EQUAL},depthMask:!1}}var UGe={stencilTest:{enabled:!0,frontFunction:ti.NOT_EQUAL,frontOperation:{fail:wt.ZERO,zFail:wt.ZERO,zPass:wt.ZERO},backFunction:ti.NOT_EQUAL,backOperation:{fail:wt.ZERO,zFail:wt.ZERO,zPass:wt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:sn.PRE_MULTIPLIED_ALPHA_BLEND},zGe={stencilTest:{enabled:!0,frontFunction:ti.NOT_EQUAL,frontOperation:{fail:wt.ZERO,zFail:wt.ZERO,zPass:wt.ZERO},backFunction:ti.NOT_EQUAL,backOperation:{fail:wt.ZERO,zFail:wt.ZERO,zPass:wt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function GGe(e){l(e._rsStencilDepthPass)||(e._rsStencilDepthPass=Ve.fromCache(sue(!1)),e._rsStencilDepthPass3DTiles=Ve.fromCache(sue(!0)),e._rsColorPass=Ve.fromCache(UGe),e._rsPickPass=Ve.fromCache(zGe))}var f0=new M,cue=new d;function VGe(e,t){if(l(e._uniformMap))return;let n={u_modifiedModelViewProjection:function(){let i=t.uniformState.view,o=t.uniformState.projection;return M.clone(i,f0),M.multiplyByPoint(f0,e._center,cue),M.setTranslation(f0,cue,f0),M.multiply(o,f0,f0),f0},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function fY(e,t,n,i,o,r,a){let s=e.constructor.BYTES_PER_ELEMENT,c=r.length;for(let u=0;u<c;++u){let f=r[u],h=a[f],p=i[h],A=o[h],m=new e.constructor(e.buffer,s*p,A);t.set(m,n),i[h]=n,n+=A}return n}function HGe(e,t){let n=e._indices,i=e._indexOffsets,o=e._indexCounts,r=e._batchIdLookUp,a=new n.constructor(n.length),s=t.pop(),c=[s],u=fY(n,a,0,i,o,s.batchIds,r);for(s.offset=0,s.count=u;t.length>0;){let f=t.pop();if(z.equals(f.color,s.color))u=fY(n,a,u,i,o,f.batchIds,r),s.batchIds=s.batchIds.concat(f.batchIds),s.count=u-s.offset;else{let h=u;u=fY(n,a,u,i,o,f.batchIds,r),f.offset=h,f.count=u-h,c.push(f),s=f}}e._va.indexBuffer.copyFromArrayView(a),e._indices=a,e._batchedIndices=c}function dY(e,t,n,i,o,r,a){let s=e.bytesPerIndex,c=r.length;for(let u=0;u<c;++u){let f=r[u],h=a[f],p=i[h],A=o[h];t.copyFromBuffer(e,p*s,n*s,A*s),i[h]=n,n+=A}return n}function WGe(e,t){let n=e._indexOffsets,i=e._indexCounts,o=e._batchIdLookUp,r=t.pop(),a=[r],s=e._va.indexBuffer,c=e._vaSwap.indexBuffer,u=dY(s,c,0,n,i,r.batchIds,o);for(r.offset=0,r.count=u;t.length>0;){let h=t.pop();if(z.equals(h.color,r.color))u=dY(s,c,u,n,i,h.batchIds,o),r.batchIds=r.batchIds.concat(h.batchIds),r.count=u-r.offset;else{let p=u;u=dY(s,c,u,n,i,h.batchIds,o),h.offset=p,h.count=u-p,a.push(h),r=h}}let f=e._va;e._va=e._vaSwap,e._vaSwap=f,e._batchedIndices=a}function jGe(e,t){return t.color.toRgba()-e.color.toRgba()}function YGe(e,t){if(!e._batchDirty)return!1;let n=e._batchedIndices,i=n.length,o=!1,r={};for(let a=0;a<i;++a){let c=n[a].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(jGe),t.webgl2?WGe(e,n):HGe(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}function qGe(e,t){let n=YGe(e,t),i=e._commands,o=e._batchedIndices,r=o.length,a=r*2;if(l(i)&&!n&&i.length===a)return;i.length=a;let s=e._va,c=e._sp,u=e._modelMatrix??M.IDENTITY,f=e._uniformMap,h=e._boundingVolume;for(let p=0;p<r;++p){let A=o[p].offset,m=o[p].count,_=i[p*2];l(_)||(_=i[p*2]=new nt({owner:e})),_.vertexArray=s,_.modelMatrix=u,_.offset=A,_.count=m,_.renderState=e._rsStencilDepthPass,_.shaderProgram=c,_.uniformMap=f,_.boundingVolume=h,_.cull=!1,_.pass=Be.TERRAIN_CLASSIFICATION;let y=nt.shallowClone(_,_.derivedCommands.tileset);y.renderState=e._rsStencilDepthPass3DTiles,y.pass=Be.CESIUM_3D_TILE_CLASSIFICATION,_.derivedCommands.tileset=y;let C=i[p*2+1];l(C)||(C=i[p*2+1]=new nt({owner:e})),C.vertexArray=s,C.modelMatrix=u,C.offset=A,C.count=m,C.renderState=e._rsColorPass,C.shaderProgram=c,C.uniformMap=f,C.boundingVolume=h,C.cull=!1,C.pass=Be.TERRAIN_CLASSIFICATION;let E=nt.shallowClone(C,C.derivedCommands.tileset);E.pass=Be.CESIUM_3D_TILE_CLASSIFICATION,C.derivedCommands.tileset=E}e._commandsDirty=!0}function KGe(e,t){if(e.classificationType===ei.TERRAIN||!t.invertClassification||l(e._commandsIgnoreShow)&&!e._commandsDirty)return;let n=e._commands,i=e._commandsIgnoreShow,o=e._spStencil,r=n.length,a=i.length=r/2,s=0;for(let c=0;c<a;++c){let u=i[c]=nt.shallowClone(n[s],i[c]);u.shaderProgram=o,u.pass=Be.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,s+=2}e._commandsDirty=!1}function XGe(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,a=e._modelMatrix??M.IDENTITY,s=e._uniformMap;for(let c=0;c<t;++c){let u=e._indexOffsets[c],f=e._indexCounts[c],h=l(e._boundingVolumes)?e._boundingVolumes[c]:e.boundingVolume,p=n[c*2];l(p)||(p=n[c*2]=new nt({owner:e,pickOnly:!0})),p.vertexArray=i,p.modelMatrix=a,p.offset=u,p.count=f,p.renderState=e._rsStencilDepthPass,p.shaderProgram=o,p.uniformMap=s,p.boundingVolume=h,p.pass=Be.TERRAIN_CLASSIFICATION;let A=nt.shallowClone(p,p.derivedCommands.tileset);A.renderState=e._rsStencilDepthPass3DTiles,A.pass=Be.CESIUM_3D_TILE_CLASSIFICATION,p.derivedCommands.tileset=A;let m=n[c*2+1];l(m)||(m=n[c*2+1]=new nt({owner:e,pickOnly:!0})),m.vertexArray=i,m.modelMatrix=a,m.offset=u,m.count=f,m.renderState=e._rsPickPass,m.shaderProgram=r,m.uniformMap=s,m.boundingVolume=h,m.pass=Be.TERRAIN_CLASSIFICATION;let _=nt.shallowClone(m,m.derivedCommands.tileset);_.pass=Be.CESIUM_3D_TILE_CLASSIFICATION,m.derivedCommands.tileset=_}e._pickCommandsDirty=!1}ZA.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 Ns(e,r)}};ZA.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function JGe(e,t){e._updatingAllCommands=!0;let n=e._batchIds,i=n.length,o;for(o=0;o<i;++o){let a=n[o],s=t[a];s.show=!0,s.color=z.WHITE}let r=e._batchedIndices;for(i=r.length,o=0;o<i;++o)r[o].color=z.clone(z.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}var ZGe=new z,$Ge=z.WHITE,eVe=!0,tVe=/\$/;ZA.prototype.applyStyle=function(e,t){if(!l(e)){JGe(this,t);return}let n=e.color,i=n instanceof Id&&!tVe.test(n.expression);this._updatingAllCommands=i;let o=this._batchIds,r=o.length,a;for(a=0;a<r;++a){let s=o[a],c=t[s];c.color=l(e.color)?e.color.evaluateColor(c,ZGe):$Ge,c.show=l(e.show)?e.show.evaluate(c):eVe}if(i){let s=this._batchedIndices;for(r=s.length,a=0;a<r;++a)s[a].color=z.clone(z.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}};ZA.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,a=o[i],s=r[i],c=this._batchedIndices,u=c.length,f;for(f=0;f<u;++f){let _=c[f].offset,y=c[f].count;if(a>=_&&a<_+y)break}c.push(new mp({color:z.clone(t),offset:a,count:s,batchIds:[e]}));let h=[],p=[],A=c[f].batchIds,m=A.length;for(let _=0;_<m;++_){let y=A[_];if(y===e)continue;let C=n[y];o[C]<a?h.push(y):p.push(y)}p.length!==0&&c.push(new mp({color:z.clone(c[f].color),offset:a+s,count:c[f].offset+c[f].count-(a+s),batchIds:p})),h.length!==0?(c[f].count=a-c[f].offset,c[f].batchIds=h):c.splice(f,1),this._batchDirty=!0};function lue(e,t,n,i){let o=e.classificationType,r=o!==ei.CESIUM_3D_TILE,a=o!==ei.TERRAIN,s=t.commandList,c=n.length,u,f;for(f=0;f<c;++f)r&&(u=n[f],u.pass=Be.TERRAIN_CLASSIFICATION,s.push(u)),a&&(u=n[f].derivedCommands.tileset,u.pass=Be.CESIUM_3D_TILE_CLASSIFICATION,s.push(u));if(!(!t.invertClassification||!l(i)))for(c=i.length,f=0;f<c;++f)s.push(i[f])}function nVe(e,t){let n=e.commandList,i=t.length;for(let o=0;o<i;o+=2){let r=t[o+1];r.pass=Be.OPAQUE,n.push(r)}}function iVe(e){let t=e.debugWireframe===e._debugWireframe;if(t=t&&!(e.debugWireframe&&e._wireframeDirty),t)return;l(e._rsWireframe)||(e._rsWireframe=Ve.fromCache({}));let n,i;e.debugWireframe?(n=e._rsWireframe,i=ve.LINES):(n=e._rsColorPass,i=ve.TRIANGLES);let o=e._commands,r=o.length;for(let a=0;a<r;a+=2){let s=o[a+1];s.renderState=n,s.primitiveType=i}e._debugWireframe=e.debugWireframe,e._wireframeDirty=!1}ZA.prototype.update=function(e){let t=e.context;QGe(this,t),kGe(this,t),GGe(this),VGe(this,t);let n=e.passes;n.render&&(qGe(this,t),KGe(this,e),iVe(this),this._debugWireframe?nVe(e,this._commands):lue(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&(XGe(this),lue(this,e,this._pickCommands))};ZA.prototype.isDestroyed=function(){return!1};ZA.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(),fe(this)};var d0=ZA;function Af(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=d.clone(this._boundingVolume.center):this._center=d.clone(d.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=ei.BOTH}Object.defineProperties(Af.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}}});Af.packedBoxLength=M.packedLength+d.packedLength;Af.packedCylinderLength=M.packedLength+2;Af.packedEllipsoidLength=M.packedLength+d.packedLength;Af.packedSphereLength=d.packedLength+1;function oVe(e){let t=new Float64Array(M.packedLength+d.packedLength),n=0;return d.pack(e._center,t,n),n+=d.packedLength,M.pack(e._modelMatrix,t,n),t}function rVe(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]=le.unpack(t,n),n+=le.packedLength;let a=t[n++],s=e._batchedIndices=new Array(a);for(let c=0;c<a;++c){let u=z.unpack(t,n);n+=z.packedLength;let f=t[n++],h=t[n++],p=t[n++],A=new Array(p);for(let m=0;m<p;++m)A[m]=t[n++];s[c]=new mp({color:u,offset:f,count:h,batchIds:A})}return i}var aVe=new Zn("createVectorTileGeometries",5),sVe=new z;function cVe(e){if(!l(e._primitive)&&!l(e._verticesPromise)){let t=e._boxes,n=e._boxBatchIds,i=e._cylinders,o=e._cylinderBatchIds,r=e._ellipsoids,a=e._ellipsoidBatchIds,s=e._spheres,c=e._sphereBatchIds,u=e._batchTableColors,f=e._packedBuffer;if(!l(u)){let m=0;l(e._boxes)&&(t=e._boxes=t.slice(),n=e._boxBatchIds=n.slice(),m+=n.length),l(e._cylinders)&&(i=e._cylinders=i.slice(),o=e._cylinderBatchIds=o.slice(),m+=o.length),l(e._ellipsoids)&&(r=e._ellipsoids=r.slice(),a=e._ellipsoidBatchIds=a.slice(),m+=a.length),l(e._spheres)&&(s=e._sphere=s.slice(),c=e._sphereBatchIds=c.slice(),m+=c.length),u=e._batchTableColors=new Uint32Array(m);let _=e._batchTable;for(let y=0;y<m;++y){let C=_.getColor(y,sVe);u[y]=C.toRgba()}f=e._packedBuffer=oVe(e)}let h=[];l(t)&&h.push(t.buffer,n.buffer),l(i)&&h.push(i.buffer,o.buffer),l(r)&&h.push(r.buffer,a.buffer),l(s)&&h.push(s.buffer,c.buffer),h.push(u.buffer,f.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)?a.buffer:void 0,spheres:l(s)?s.buffer:void 0,sphereBatchIds:l(s)?c.buffer:void 0,batchTableColors:u.buffer,packedBuffer:f.buffer},A=e._verticesPromise=aVe.scheduleTask(p,h);return l(A)?A.then(function(m){if(e.isDestroyed())return;let _=new Float64Array(m.packedBuffer);rVe(e,_)===2?e._indices=new Uint16Array(m.indices):e._indices=new Uint32Array(m.indices),e._indexOffsets=new Uint32Array(m.indexOffsets),e._indexCounts=new Uint32Array(m.indexCounts),e._positions=new Float32Array(m.positions),e._vertexBatchIds=new Uint16Array(m.vertexBatchIds),e._batchIds=new Uint16Array(m.batchIds),lVe(e),e._ready=!0}).catch(m=>{e.isDestroyed()||(e._error=m)}):void 0}}function lVe(e){l(e._primitive)||(e._primitive=new d0({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: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)}Af.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Af.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Af.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Af.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Af.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=cVe(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)};Af.prototype.isDestroyed=function(){return!1};Af.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),fe(this)};var $A=Af;function pp(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,dVe(this,i,o)}Object.defineProperties(pp.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 uVe(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function fVe(e,t){let n,i,o,r,a,s=e.BOXES_LENGTH??0,c=e.CYLINDERS_LENGTH??0,u=e.ELLIPSOIDS_LENGTH??0,f=e.SPHERES_LENGTH??0;if(s>0&&l(e.BOX_BATCH_IDS)){let m=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,m,s)}if(c>0&&l(e.CYLINDER_BATCH_IDS)){let m=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,m,c)}if(u>0&&l(e.ELLIPSOID_BATCH_IDS)){let m=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,m,u)}if(f>0&&l(e.SPHERE_BATCH_IDS)){let m=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,m,f)}let h=l(n)||l(i)||l(o)||l(r),p=s>0&&!l(n)||c>0&&!l(i)||u>0&&!l(o)||f>0&&!l(r);if(h&&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 m=0;if(!l(n)&&s>0)for(n=new Uint16Array(s),a=0;a<s;++a)n[a]=m++;if(!l(i)&&c>0)for(i=new Uint16Array(c),a=0;a<c;++a)i[a]=m++;if(!l(o)&&u>0)for(o=new Uint16Array(u),a=0;a<u;++a)o[a]=m++;if(!l(r)&&f>0)for(r=new Uint16Array(f),a=0;a<f;++a)r[a]=m++}return{boxes:n,cylinders:i,ellipsoids:o,spheres:r}}var h0=Uint32Array.BYTES_PER_ELEMENT;function dVe(e,t,n){n=n??0;let i=new Uint8Array(t),o=new DataView(t);n+=h0;let r=o.getUint32(n,!0);if(r!==1)throw new ue(`Only Geometry tile version 1 is supported. Version ${r} is not.`);n+=h0;let a=o.getUint32(n,!0);if(n+=h0,a===0){e._ready=!0;return}let s=o.getUint32(n,!0);if(n+=h0,s===0)throw new ue("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=h0;let u=o.getUint32(n,!0);n+=h0;let f=o.getUint32(n,!0);n+=h0;let h=Br(i,n,s);n+=s;let p=new Uint8Array(t,n,c);n+=c;let A,m;u>0&&(A=Br(i,n,u),n+=u,f>0&&(m=new Uint8Array(t,n,f),m=new Uint8Array(m)));let _=h.BOXES_LENGTH??0,y=h.CYLINDERS_LENGTH??0,C=h.ELLIPSOIDS_LENGTH??0,E=h.SPHERES_LENGTH??0,b=_+y+C+E,x=new Gh(e,b,A,m,uVe(e));if(e._batchTable=x,b===0)return;let S=e.tile.computedTransform,B;l(h.RTC_CENTER)&&(B=d.unpack(h.RTC_CENTER),M.multiplyByPoint(S,B,B));let v=fVe(h,p);if(_>0||y>0||C>0||E>0){let P,N,L,g;if(_>0){let I=p.byteOffset+h.BOXES.byteOffset;P=new Float32Array(p.buffer,I,$A.packedBoxLength*_)}if(y>0){let I=p.byteOffset+h.CYLINDERS.byteOffset;N=new Float32Array(p.buffer,I,$A.packedCylinderLength*y)}if(C>0){let I=p.byteOffset+h.ELLIPSOIDS.byteOffset;L=new Float32Array(p.buffer,I,$A.packedEllipsoidLength*C)}if(E>0){let I=p.byteOffset+h.SPHERES.byteOffset;g=new Float32Array(p.buffer,I,$A.packedSphereLength*E)}return e._geometries=new $A({boxes:P,boxBatchIds:v.boxes,cylinders:N,cylinderBatchIds:v.cylinders,ellipsoids:L,ellipsoidBatchIds:v.ellipsoids,spheres:g,sphereBatchIds:v.spheres,center:B,modelMatrix:S,batchTable:x,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function uue(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}}pp.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};pp.prototype.getFeature=function(e){return uue(this),this._features[e]};pp.prototype.applyDebugSettings=function(e,t){l(this._geometries)&&this._geometries.applyDebugSettings(e,t)};pp.prototype.applyStyle=function(e){uue(this),l(this._geometries)&&this._geometries.applyStyle(e,this._features)};pp.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)};pp.prototype.pick=function(e,t,n){};pp.prototype.isDestroyed=function(){return!1};pp.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),fe(this)};var zM=pp;var hY={};hY.encode2D=function(e,t,n){let i=Math.pow(2,e),o={x:t,y:n},r,a,s,c=BigInt(0);for(s=i/2;s>0;s/=2)r=(o.x&s)>0?1:0,a=(o.y&s)>0?1:0,c+=BigInt((3*r^a)*s*s),fue(i,o,r,a);return c};hY.decode2D=function(e,t){let n=Math.pow(2,e),i={x:0,y:0},o,r,a,s;for(a=1,s=t;a<n;a*=2)o=1&Number(s/BigInt(2)),r=1&Number(s^BigInt(o)),fue(a,i,o,r),i.x+=a*o,i.y+=a*r,s/=BigInt(4);return[i.x,i.y]};function fue(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 Yx=hY;var m0=30,hVe=1<<m0,mVe=1<<m0+1>>>0,mY=2*m0+1,gy=4,mue=[],pue=[],pVe=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],_y=1,qx=2,RV=[_y,0,0,_y|qx];function Ma(e){if(!fn.supportsBigInt())throw new ue("S2 required BigInt support");this._cellId=e,this._level=Ma.getLevel(e)}Ma.fromToken=function(e){return new Ma(Ma.getIdFromToken(e))};Ma.isValidId=function(e){return!(e<=0||e>>BigInt(mY)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};Ma.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?Ma.isValidId(Ma.getIdFromToken(e)):!1};Ma.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};Ma.getTokenFromId=function(e){let t=Math.floor(TVe(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};Ma.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return m0-(t>>1)};Ma.prototype.getChild=function(e){let t=_ue(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new Ma(n)};Ma.prototype.getParent=function(){let e=_ue(this._cellId)<<BigInt(2);return new Ma(this._cellId&~e+BigInt(1)|e)};Ma.prototype.getParentAtLevel=function(e){let t=IVe(e);return new Ma(this._cellId&-t|t)};Ma.prototype.getCenter=function(e){e=e??te.WGS84;let t=AVe(this._cellId,this._level);t=d.normalize(t,t);let n=me.fromCartesian(t,te.UNIT_SPHERE);return me.toCartesian(n,e,new d)};Ma.prototype.getVertex=function(e,t){t=t??te.WGS84;let n=gVe(this._cellId,this._level,e);n=d.normalize(n,n);let i=me.fromCartesian(n,te.UNIT_SPHERE);return me.toCartesian(i,t,new d)};Ma.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"),a=Array(mY-2*n).join("0"),s=BigInt(`0b${i}${r}${o}1${a}`);return new Ma(s)};function AVe(e,t){let n=_Ve(e,t);return yVe(n[0],n[1],n[2])}function gVe(e,t,n){let i=Aue(e,t),o=CVe([i[1],i[2]],t),r=n>>1&1;return gue(i[0],o[0][r^n&1],o[1][r])}function _Ve(e,t){let n=Aue(e),i=n[0],o=n[1],r=n[2],a=t===30,s=!a&&(BigInt(o)^e>>BigInt(2))&BigInt(1),c=a?1:s?2:0,u=(o<<1)+c,f=(r<<1)+c;return[i,u,f]}function Aue(e){mue.length===0&&bVe();let t=Number(e>>BigInt(mY)),n=t&_y,i=(1<<gy)-1,o=0,r=0;for(let a=7;a>=0;a--){let c=(1<<2*(a===7?m0-7*gy:gy))-1;n+=Number(e>>BigInt(a*2*gy+1)&BigInt(c))<<2,n=pue[n];let u=a*gy;o+=n>>gy+2<<u,r+=(n>>2&i)<<u,n&=_y|qx}return[t,o,r]}function yVe(e,t,n){let i=due(t),o=due(n),r=MV(i),a=MV(o);return gue(e,r,a)}function gue(e,t,n){switch(e){case 0:return new d(1,t,n);case 1:return new d(-t,1,n);case 2:return new d(-t,-n,1);case 3:return new d(-1,-n,-t);case 4:return new d(n,-1,-t);default:return new d(n,t,-1)}}function MV(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function due(e){return 1/mVe*e}function CVe(e,t){let n=[[],[]],i=EVe(t);for(let o=0;o<2;++o){let r=e[o]&-i,a=r+i;n[o][0]=MV(hue(r)),n[o][1]=MV(hue(a))}return n}function EVe(e){return 1<<m0-e>>>0}function hue(e){return 1/hVe*e}function yy(e,t,n,i,o,r){if(e===gy){let a=(t<<gy)+n;mue[(a<<2)+i]=(o<<2)+r,pue[(o<<2)+i]=(a<<2)+r}else{e++,t<<=1,n<<=1,o<<=2;let a=pVe[r];yy(e,t+(a[0]>>1),n+(a[0]&1),i,o,r^RV[0]),yy(e,t+(a[1]>>1),n+(a[1]&1),i,o+1,r^RV[1]),yy(e,t+(a[2]>>1),n+(a[2]&1),i,o+2,r^RV[2]),yy(e,t+(a[3]>>1),n+(a[3]&1),i,o+3,r^RV[3])}}function bVe(){yy(0,0,0,0,0,0),yy(0,0,0,_y,0,_y),yy(0,0,0,qx,0,qx),yy(0,0,0,_y|qx,0,_y|qx)}function _ue(e){return e&~e+BigInt(1)}function IVe(e){return BigInt(1)<<BigInt(2*(m0-e))}var xVe=[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 TVe(e){return xVe[(-e&e)%BigInt(67)]}var eg=Ma;function SVe(e,t){return l(e)&&l(e.extensions)&&l(e.extensions[t])}var xi=SVe;function pY(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 a=e.computeAvailableCountEnabled??!1;!l(n)&&a&&(n=wVe(o,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=o}function wVe(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(pY.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});pY.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 Kx=pY;function tg(e){e=e??V.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(tg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});tg.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};tg.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};tg.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};tg.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};tg.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};tg.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};tg.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var Xx=tg;var NV={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};NV.getBranchingFactor=function(e){switch(e){case NV.OCTREE:return 8;case NV.QUADTREE:return 4}};var Na=Object.freeze(NV);function oc(){}Object.defineProperties(oc.prototype,{class:{get:function(){de.throwInstantiationError()}}});oc.prototype.hasProperty=function(e){de.throwInstantiationError()};oc.prototype.hasPropertyBySemantic=function(e){de.throwInstantiationError()};oc.prototype.getPropertyIds=function(e){de.throwInstantiationError()};oc.prototype.getProperty=function(e){de.throwInstantiationError()};oc.prototype.setProperty=function(e,t){de.throwInstantiationError()};oc.prototype.getPropertyBySemantic=function(e){de.throwInstantiationError()};oc.prototype.setPropertyBySemantic=function(e,t){de.throwInstantiationError()};oc.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))};oc.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return!1;let o=i[e];return l(o)};oc.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};oc.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=je(i.default,!0),i.unpackVectorAndMatrixTypes(o,r);if(l(o))return o=i.normalize(o),o=i.applyValueTransform(o),i.unpackVectorAndMatrixTypes(o,r)};oc.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};oc.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return;let o=i[e];if(l(o))return oc.getProperty(o.id,t,n)};oc.setPropertyBySemantic=function(e,t,n,i){let o=i.propertiesBySemantic;if(!l(o))return!1;let r=i.propertiesBySemantic[e];return l(r)?oc.setProperty(r.id,t,n,i):!1};var qn=oc;function ng(e){e=e??V.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(ng.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});ng.prototype.hasProperty=function(e){return qn.hasProperty(e,this._properties,this._class)};ng.prototype.hasPropertyBySemantic=function(e){return qn.hasPropertyBySemantic(e,this._properties,this._class)};ng.prototype.getPropertyIds=function(e){return qn.getPropertyIds(this._properties,this._class,e)};ng.prototype.getProperty=function(e){return qn.getProperty(e,this._properties,this._class)};ng.prototype.setProperty=function(e,t){return qn.setProperty(e,t,this._properties,this._class)};ng.prototype.getPropertyBySemantic=function(e){return qn.getPropertyBySemantic(e,this._properties,this._class)};ng.prototype.setPropertyBySemantic=function(e,t){return qn.setPropertyBySemantic(e,t,this._properties,this._class)};var GM=ng;var dn={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"},Xc={INTEGER:"int",UNSIGNED_INTEGER:"uint",FLOAT:"float"};dn.typeInfo={INT8:{vectorCompatible:!0,size:1,maximumValue:127,minimumValue:-128,category:Xc.INTEGER},UINT8:{vectorCompatible:!0,size:1,maximumValue:255,minimumValue:0,category:Xc.UNSIGNED_INTEGER},INT16:{vectorCompatible:!0,size:2,maximumValue:32767,minimumValue:-32768,category:Xc.INTEGER},UINT16:{vectorCompatible:!0,size:2,maximumValue:65535,minimumValue:0,category:Xc.UNSIGNED_INTEGER},INT32:{vectorCompatible:!0,size:4,maximumValue:2147483647,minimumValue:-2147483648,category:Xc.INTEGER},UINT32:{vectorCompatible:!0,size:4,maximumValue:4294967295,minimumValue:0,category:Xc.UNSIGNED_INTEGER},INT64:{vectorCompatible:!1,size:8,maximumValue:BigInt("9223372036854775807"),minimumValue:BigInt("-9223372036854775808"),category:Xc.INTEGER,downcastFunction:e=>dn.clampToLimits(e,dn.INT32)},UINT64:{vectorCompatible:!1,size:8,maximumValue:BigInt("18446744073709551615"),minimumValue:BigInt(0),category:Xc.UNSIGNED_INTEGER,downcastFunction:e=>dn.clampToLimits(e,dn.UINT32)},FLOAT32:{vectorCompatible:!0,size:4,maximumValue:34028234663852886e22,minimumValue:-34028234663852886e22,category:Xc.FLOAT},FLOAT64:{vectorCompatible:!0,size:8,maximumValue:Number.MAX_VALUE,minimumValue:-Number.MAX_VALUE,category:Xc.FLOAT,downcastFunction:e=>Math.fround(e)}};dn.getMinimum=function(e){return dn.typeInfo[e].minimumValue};dn.getMaximum=function(e){return dn.typeInfo[e].maximumValue};dn.isIntegerType=function(e){return dn.typeInfo[e].category!==Xc.FLOAT};dn.isUnsignedIntegerType=function(e){return dn.typeInfo[e].category===Xc.UNSIGNED_INTEGER};dn.isVectorCompatible=function(e){return dn.typeInfo[e].vectorCompatible};dn.category=function(e){return dn.typeInfo[e].category};dn.gpuComponentType=function(e){switch(e){case dn.INT64:return"INT32";case dn.UINT64:return"UINT32";case dn.FLOAT64:return"FLOAT32";default:return e}};dn.normalize=function(e,t){return Math.max(Number(e)/Number(dn.getMaximum(t)),-1)};dn.unnormalize=function(e,t){let n=dn.getMaximum(t),i=dn.isUnsignedIntegerType(t)?0:-n;return e=D.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===dn.INT64||t===dn.UINT64)&&fn.supportsBigInt()&&(e=BigInt(e)),e>n?n:e<i?i:e};dn.applyValueTransform=function(e,t,n){return n*e+t};dn.unapplyValueTransform=function(e,t,n){return n===0?0:(e-t)/n};dn.getSizeInBytes=function(e){return dn.typeInfo[e].size};dn.clampToLimits=function(e,t){let n=dn.getMinimum(t),i=dn.getMaximum(t);if(typeof e=="bigint"){let o=BigInt(n),r=BigInt(i);return e<o?n:e>r?i:Number(e)}return Math.max(n,Math.min(i,e))};dn.downcastFunction=function(e){let n=dn.typeInfo[e].downcastFunction;return l(n)?n:i=>i};dn.fromComponentDatatype=function(e){switch(e){case j.BYTE:return dn.INT8;case j.UNSIGNED_BYTE:return dn.UINT8;case j.SHORT:return dn.INT16;case j.UNSIGNED_SHORT:return dn.UINT16;case j.INT:return dn.INT32;case j.UNSIGNED_INT:return dn.UINT32;case j.FLOAT:return dn.FLOAT32;case j.DOUBLE:return dn.FLOAT64}};dn.toComponentDatatype=function(e){switch(e){case dn.INT8:return j.BYTE;case dn.UINT8:return j.UNSIGNED_BYTE;case dn.INT16:return j.SHORT;case dn.UINT16:return j.UNSIGNED_SHORT;case dn.INT32:return j.INT;case dn.UINT32:return j.UNSIGNED_INT;case dn.FLOAT32:return j.FLOAT;case dn.FLOAT64:return j.DOUBLE}};dn.getDataViewAccessors=function(e,t){return{[dn.UINT8]:{get:e.getUint8.bind(e),set:e.setUint8.bind(e)},[dn.INT8]:{get:e.getInt8.bind(e),set:e.setInt8.bind(e)},[dn.UINT16]:{get:i=>e.getUint16(i,!0),set:(i,o)=>e.setUint16(i,o,!0)},[dn.INT16]:{get:i=>e.getInt16(i,!0),set:(i,o)=>e.setInt16(i,o,!0)},[dn.UINT32]:{get:i=>e.getUint32(i,!0),set:(i,o)=>e.setUint32(i,o,!0)},[dn.INT32]:{get:i=>e.getInt32(i,!0),set:(i,o)=>e.setInt32(i,o,!0)},[dn.FLOAT32]:{get:i=>e.getFloat32(i,!0),set:(i,o)=>e.setFloat32(i,o,!0)},[dn.FLOAT64]:{get:i=>e.getFloat64(i,!0),set:(i,o)=>e.setFloat64(i,o,!0)},[dn.UINT64]:{get:i=>e.getBigUint64(i,!0),set:(i,o)=>e.setBigUint64(i,BigInt(o),!0)},[dn.INT64]:{get:i=>e.getBigInt64(i,!0),set:(i,o)=>e.setBigInt64(i,BigInt(o),!0)}}[t]};var Ft=Object.freeze(dn);var hr={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};hr.isVectorType=function(e){switch(e){case hr.VEC2:case hr.VEC3:case hr.VEC4:return!0;default:return!1}};hr.isMatrixType=function(e){switch(e){case hr.MAT2:case hr.MAT3:case hr.MAT4:return!0;default:return!1}};hr.getComponentCount=function(e){switch(e){case hr.SCALAR:case hr.STRING:case hr.ENUM:case hr.BOOLEAN:return 1;case hr.VEC2:return 2;case hr.VEC3:return 3;case hr.VEC4:return 4;case hr.MAT2:return 4;case hr.MAT3:return 9;case hr.MAT4:return 16}};hr.getMathType=function(e){switch(e){case hr.VEC2:return k;case hr.VEC3:return d;case hr.VEC4:return ie;case hr.MAT2:return ji;case hr.MAT3:return J;case hr.MAT4:return M;default:return}};var bt=Object.freeze(hr);function $r(e){e=e??V.EMPTY_OBJECT;let t=e.id,n=e.type,i=e.componentType,o=e.enumType,r=l(i)&&(e.normalized??!1)&&Ft.isIntegerType(i);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=e.isArray??!1,this._isVariableLengthArray=e.isVariableLengthArray??!1,this._arrayLength=e.arrayLength,this._min=je(e.min,!0),this._max=je(e.max,!0),this._normalized=r;let a=je(e.offset,!0),s=je(e.scale,!0),c=l(a)||l(s),u=!0;l(a)||(a=this.expandConstant(0,u)),l(s)||(s=this.expandConstant(1,u)),this._offset=a,this._scale=s,this._hasValueTransform=c,this._noData=je(e.noData,!0),this._default=je(e.default,!0),this._required=e.required??!0,this._extras=je(e.extras,!0),this._extensions=je(e.extensions,!0)}$r.fromJson=function(e){e=e??V.EMPTY_OBJECT;let t=e.id,n=e.property,i=BVe(n),o=DVe(n,e.enums),r;return l(i)?i?r=l(n.optional)?!n.optional:!0:r=n.required??!1:r=!1,new $r({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($r.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 BVe(e){if(e.type==="ARRAY")return!0;let t=e.type;if(t===bt.SCALAR||bt.isMatrixType(t)||bt.isVectorType(t))return!1;if(l(Ft[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 DVe(e,t){let n=e.type,i=e.componentType,o=n==="ARRAY",r,a,s;o?(r=!0,a=e.componentCount,s=!l(a)):e.array?(r=!0,a=e.count,s=!l(e.count)):(r=!1,a=void 0,s=!1);let c;if(l(e.enumType)&&(c=t[e.enumType]),n===bt.ENUM)return{type:n,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:s,arrayLength:a};if(o&&i===bt.ENUM)return{type:i,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:s,arrayLength:a};if(n===bt.SCALAR||bt.isMatrixType(n)||bt.isVectorType(n))return{type:n,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:s,arrayLength:a};if(n===bt.BOOLEAN||n===bt.STRING)return{type:n,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:s,arrayLength:a};if(o&&(i===bt.BOOLEAN||i===bt.STRING))return{type:i,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:s,arrayLength:a};if(l(i)&&l(Ft[i]))return{type:bt.SCALAR,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:s,arrayLength:a};if(l(Ft[n]))return{type:bt.SCALAR,componentType:n,enumType:void 0,valueType:n,isArray:r,isVariableLengthArray:s,arrayLength:a}}$r.prototype.normalize=function(e){return this._normalized?AY(e,this._valueType,Ft.normalize):e};$r.prototype.unnormalize=function(e){return this._normalized?AY(e,this._valueType,Ft.unnormalize):e};$r.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:$r.valueTransformInPlace(e,this._offset,this._scale,Ft.applyValueTransform)};$r.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:$r.valueTransformInPlace(e,this._offset,this._scale,Ft.unapplyValueTransform)};$r.prototype.expandConstant=function(e,t){t=t??!1;let n=this._isArray,i=this._arrayLength,o=bt.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 a=new Array(o).fill(e);return new Array(this._arrayLength).fill(a)};$r.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!bue(e,t))return e};function bue(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(!bue(e[n],t[n]))return!1;return!0}$r.prototype.unpackVectorAndMatrixTypes=function(e,t){t=t??!1;let n=bt.getMathType(this._type),i=this._isArray,o=bt.getComponentCount(this._type),r=i&&o>1;return l(n)?t&&r?e.map(function(a){return n.unpack(a)}):i?n.unpackArray(e):n.unpack(e):e};$r.prototype.packVectorAndMatrixTypes=function(e,t){t=t??!1;let n=bt.getMathType(this._type),i=this._isArray,o=bt.getComponentCount(this._type),r=i&&o>1;return l(n)?t&&r?e.map(function(a){return n.pack(a,[])}):i?n.packArray(e,[]):n.pack(e,[]):e};$r.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?vVe(this,e):Iue(this,e)};function vVe(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=Iue(e,t[i]);if(l(o))return o}}function Iue(e,t){let n=e._type,i=e._componentType,o=e._enumType,r=e._normalized;return bt.isVectorType(n)?PVe(t,n,i):bt.isMatrixType(n)?RVe(t,n,i):n===bt.STRING?MVe(t):n===bt.BOOLEAN?NVe(t):n===bt.ENUM?LVe(t,o):OVe(t,i,r)}function PVe(e,t,n){if(!Ft.isVectorCompatible(n))return`componentType ${n} is incompatible with vector type ${t}`;if(t===bt.VEC2&&!(e instanceof k))return`vector value ${e} must be a Cartesian2`;if(t===bt.VEC3&&!(e instanceof d))return`vector value ${e} must be a Cartesian3`;if(t===bt.VEC4&&!(e instanceof ie))return`vector value ${e} must be a Cartesian4`}function RVe(e,t,n){if(!Ft.isVectorCompatible(n))return`componentType ${n} is incompatible with matrix type ${t}`;if(t===bt.MAT2&&!(e instanceof ji))return`matrix value ${e} must be a Matrix2`;if(t===bt.MAT3&&!(e instanceof J))return`matrix value ${e} must be a Matrix3`;if(t===bt.MAT4&&!(e instanceof M))return`matrix value ${e} must be a Matrix4`}function MVe(e){if(typeof e!="string")return LV(e,bt.STRING)}function NVe(e){if(typeof e!="boolean")return LV(e,bt.BOOLEAN)}function LVe(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 OVe(e,t,n){let i=typeof e;switch(t){case Ft.INT8:case Ft.UINT8:case Ft.INT16:case Ft.UINT16:case Ft.INT32:case Ft.UINT32:case Ft.FLOAT32:case Ft.FLOAT64:return i!=="number"?LV(e,t):isFinite(e)?Cue(e,t,n):Eue(e,t);case Ft.INT64:case Ft.UINT64:return i!=="number"&&i!=="bigint"?LV(e,t):i==="number"&&!isFinite(e)?Eue(e,t):Cue(e,t,n)}}function LV(e,t){return`value ${e} does not match type ${t}`}function yue(e,t,n){let i=`value ${e} is out of range for type ${t}`;return n&&(i+=" (normalized)"),i}function Cue(e,t,n){if(n){let i=Ft.isUnsignedIntegerType(t)?0:-1;return e<i||e>1?yue(e,t,n):void 0}if(e<Ft.getMinimum(t)||e>Ft.getMaximum(t))return yue(e,t,n)}function Eue(e,t){return`value ${e} of type ${t} must be finite`}function AY(e,t,n){if(!Array.isArray(e))return n(e,t);for(let i=0;i<e.length;i++)e[i]=AY(e[i],t,n);return e}$r.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]=$r.valueTransformInPlace(e[o],t[o],n[o],i);return e};$r.prototype.cpuBytesPerElement=function(){return xue(this,this.valueType)};$r.prototype.gpuBytesPerElement=function(){let e=Ft.gpuComponentType(this.valueType);return xue(this,e)};function xue(e,t){let n=e.type,i=bt.getComponentCount(n),o=e.isArray?e.arrayLength:1,r=Ft.getSizeInBytes(t);return i*o*r}$r.prototype.isGpuCompatible=function(e){let t=this.type;return!(this.isVariableLengthArray||t===bt.STRING||t===bt.BOOLEAN||this.gpuBytesPerElement()>e)};var gY=[void 0,"float","vec2","vec3","vec4"],Tue=[void 0,"int","ivec2","ivec3","ivec4"],FVe=[void 0,"uint","uvec2","uvec3","uvec4"],QVe={[Xc.FLOAT]:"uintBitsToFloat",[Xc.INTEGER]:"int",[Xc.UNSIGNED_INTEGER]:""};$r.prototype.getGlslTypeWebGL1=function(){let e=bt.getComponentCount(this.type);return this.isArray&&(e=this.arrayLength),this.normalized?gY[e]:Tue[e]};$r.prototype.getGlslType=function(){let e=this.valueType,t=bt.getComponentCount(this.type),n=this.isArray?this.arrayLength:1;return t*=n,!Ft.isIntegerType(e)||this.normalized?gY[t]:Ft.isUnsignedIntegerType(e)?FVe[t]:Tue[t]};$r.prototype.unpackTextureInShader=function(e,t,n,i){let o=this.getGlslType(),r=Ft.gpuComponentType(this.valueType),a=t.length,s=this.type,c=bt.getComponentCount(s)*(this.isArray?this.arrayLength:1),u=Math.floor(a/c),f=`${n}_rawChannels`,h=`${n}_rawBits`,p=`${n}_unpackedValue`,A=`${o} ${p};`,m=`uint ${h};`;i.push(A),i.push(m);let _=`${gY[a]} ${f} = ${e};`;i.push(_);let y=QVe[Ft.category(r)],C=c>1;for(let E=0;E<c;E++){let b="rgba".slice(E*u,(E+1)*u),x=a>1?`.${b}`:"",S=`${h} = czm_unpackTexture(${f}${x});`,B="";C&&(B=`[${E}]`);let v="",P="";if(this.normalized){let L=Ft.getMaximum(r);v=` * ${1/Number(L)}`,P="float"}let N=`${p}${B} = ${P}(${y}(${h}))${v};`;i.push(S),i.push(N)}return p};$r.prototype.unpackTextureInShaderWebGL1=function(e){return this.normalized?e:`${this.getGlslTypeWebGL1()}(255.0 * ${e})`};var Ap=$r;function VM(e){e=e??V.EMPTY_OBJECT;let t=e.count,n=e.property,i=e.classProperty,o=e.bufferViews,r=i.type,a=i.isArray,s=i.isVariableLengthArray,c=i.valueType,u=i.enumType,f=r===bt.STRING,h=r===bt.BOOLEAN,p=0,A;if(s){let g=n.arrayOffsetType??n.offsetType;g=Ft[g]??Ft.UINT32;let I=n.arrayOffsets??n.arrayOffsetBufferView;A=new _Y(o[I],g,t+1),p+=A.typedArray.byteLength}let m=bt.getComponentCount(r),_;s?_=A.get(t)-A.get(0):a?_=t*i.arrayLength:_=t;let y=m*_,C;if(f){let g=n.stringOffsetType??n.offsetType;g=Ft[g]??Ft.UINT32;let I=n.stringOffsets??n.stringOffsetBufferView;C=new _Y(o[I],g,y+1),p+=C.typedArray.byteLength}(f||h)&&(c=Ft.UINT8);let E;f?E=C.get(y)-C.get(0):h?E=Math.ceil(y/8):E=y;let b=n.values??n.bufferView,x=new _Y(o[b],c,E);p+=x.typedArray.byteLength;let S=n.offset,B=n.scale,v=i.hasValueTransform||l(S)||l(B);S=S??i.offset,B=B??i.scale,S=Sue(S),B=Sue(B);let P,N,L=this;f?P=function(g){return zVe(g,L._values,L._stringOffsets)}:h?(P=function(g){return GVe(g,L._values)},N=function(g,I){VVe(g,L._values,I)}):l(u)?(P=function(g){let I=L._values.get(g);return u.namesByValue[I]},N=function(g,I){let T=u.valuesByName[I];L._values.set(g,T)}):(P=function(g){return L._values.get(g)},N=function(g,I){L._values.set(g,I)}),this._arrayOffsets=A,this._stringOffsets=C,this._values=x,this._classProperty=i,this._count=t,this._vectorComponentCount=m,this._min=n.min,this._max=n.max,this._offset=S,this._scale=B,this._hasValueTransform=v,this._getValue=P,this._setValue=N,this._unpackedValues=void 0,this._extras=n.extras,this._extensions=n.extensions,this._byteLength=p}Object.defineProperties(VM.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}},classProperty:{get:function(){return this._classProperty}}});VM.prototype.get=function(e){let t=kVe(this,e);return t=this._classProperty.handleNoData(t),l(t)?(t=this._classProperty.normalize(t),t=JVe(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};VM.prototype.set=function(e,t){let n=this._classProperty;t=n.packVectorAndMatrixTypes(t),t=ZVe(this,t),t=n.unnormalize(t),UVe(this,e,t)};VM.prototype.getTypedArray=function(){if(l(this._values))return this._values.typedArray};function Sue(e){if(!Array.isArray(e))return e;let t=[];for(let n=0;n<e.length;n++){let i=e[n];Array.isArray(i)?oi(t,i):t.push(i)}return t}function kVe(e,t){Bue(e)&&Due(e);let n=e._classProperty,i=n.isArray,o=n.type,r=bt.getComponentCount(o);if(l(e._unpackedValues)){let a=e._unpackedValues[t];return i?je(a,!0):a}return!i&&r===1?e._getValue(t):wue(e,n,t)}function wue(e,t,n){let i,o;if(t.isVariableLengthArray){i=e._arrayOffsets.get(n),o=e._arrayOffsets.get(n+1)-i;let a=bt.getComponentCount(t.type);i*=a,o*=a}else{let s=(t.arrayLength??1)*e._vectorComponentCount;i=n*s,o=s}let r=new Array(o);for(let a=0;a<o;a++)r[a]=e._getValue(i+a);return r}function UVe(e,t,n){KVe(e,t,n)&&Due(e);let i=e._classProperty,o=i.isArray,r=i.type,a=bt.getComponentCount(r);if(l(e._unpackedValues)){i.isArray&&(n=je(n,!0)),e._unpackedValues[t]=n;return}if(!o&&a===1){e._setValue(t,n);return}let s,c;if(i.isVariableLengthArray)s=e._arrayOffsets.get(t),c=e._arrayOffsets.get(t+1)-s;else{let f=(i.arrayLength??1)*e._vectorComponentCount;s=t*f,c=f}for(let u=0;u<c;++u)e._setValue(s+u,n[u])}function zVe(e,t,n){let i=n.get(e),o=n.get(e+1)-i;return xu(t.typedArray,i,o)}function GVe(e,t){let n=e>>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function VVe(e,t,n){let i=e>>3,o=e%8;n?t.typedArray[i]|=1<<o:t.typedArray[i]&=~(1<<o)}function HVe(e,t){let n=t.dataView,i=e*8,o=0,r=(n.getUint8(i+7)&128)>0,a=!0;for(let s=0;s<8;++s){let c=n.getUint8(i+s);r&&(a?c!==0&&(c=~(c-1)&255,a=!1):c=~c&255),o+=c*Math.pow(256,s)}return r&&(o=-o),o}function WVe(e,t){let n=t.dataView,i=e*8,o=BigInt(0),r=(n.getUint8(i+7)&128)>0,a=!0;for(let s=0;s<8;++s){let c=n.getUint8(i+s);r&&(a?c!==0&&(c=~(c-1)&255,a=!1):c=~c&255),o+=BigInt(c)*(BigInt(1)<<BigInt(s*8))}return r&&(o=-o),o}function jVe(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 YVe(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 qVe(e){switch(e){case Ft.INT8:return j.BYTE;case Ft.UINT8:return j.UNSIGNED_BYTE;case Ft.INT16:return j.SHORT;case Ft.UINT16:return j.UNSIGNED_SHORT;case Ft.INT32:return j.INT;case Ft.UINT32:return j.UNSIGNED_INT;case Ft.FLOAT32:return j.FLOAT;case Ft.FLOAT64:return j.DOUBLE}}function Bue(e){if(l(e._unpackedValues))return!1;let t=e._classProperty,n=t.type,i=t.valueType;return n===bt.STRING||i===Ft.INT64&&!fn.supportsBigInt64Array()||i===Ft.UINT64&&!fn.supportsBigUint64Array()}function KVe(e,t,n){if(Bue(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 Due(e){e._unpackedValues=XVe(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function XVe(e){let t=e._count,n=new Array(t),i=e._classProperty,o=i.isArray,r=i.type,a=bt.getComponentCount(r);if(!o&&a===1){for(let s=0;s<t;++s)n[s]=e._getValue(s);return n}for(let s=0;s<t;s++)n[s]=wue(e,i,s);return n}function JVe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:Ap.valueTransformInPlace(t,e._offset,e._scale,Ft.applyValueTransform)}function ZVe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:Ap.valueTransformInPlace(t,e._offset,e._scale,Ft.unapplyValueTransform)}function _Y(e,t,n){let i=this,o,r,a;if(t===Ft.INT64)fn.supportsBigInt()?fn.supportsBigInt64Array()?(o=new BigInt64Array(e.buffer,e.byteOffset,n),a=function(s,c){i.typedArray[s]=BigInt(c)}):(o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(s){return WVe(s,i)}):(It("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(s){return HVe(s,i)});else if(t===Ft.UINT64)fn.supportsBigInt()?fn.supportsBigUint64Array()?(o=new BigUint64Array(e.buffer,e.byteOffset,n),a=function(s,c){i.typedArray[s]=BigInt(c)}):(o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(s){return YVe(s,i)}):(It("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(s){return jVe(s,i)});else{let s=qVe(t);o=j.createArrayBufferView(s,e.buffer,e.byteOffset,n),a=function(c,u){i.typedArray[c]=u}}l(r)||(r=function(s){return i.typedArray[s]}),this.typedArray=o,this.dataView=new DataView(o.buffer,o.byteOffset),this.get=r,this.set=a,this._componentType=t}var HM=VM;function Hh(e){e=e??V.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 a=new HM({count:t,property:e.properties[r],classProperty:n.properties[r],bufferViews:e.bufferViews});o[r]=a,i+=a.byteLength}}this._count=t,this._class=n,this._properties=o,this._byteLength=i}Object.defineProperties(Hh.prototype,{count:{get:function(){return this._count}},class:{get:function(){return this._class}},byteLength:{get:function(){return this._byteLength}},properties:{get:function(){return this._properties}}});Hh.prototype.hasProperty=function(e){return qn.hasProperty(e,this._properties,this._class)};Hh.prototype.hasPropertyBySemantic=function(e){return qn.hasPropertyBySemantic(e,this._properties,this._class)};Hh.prototype.getPropertyIds=function(e){return qn.getPropertyIds(this._properties,this._class,e)};Hh.prototype.getProperty=function(e,t){let n=this._properties[t],i;return l(n)?i=n.get(e):i=$Ve(this._class,t),i};Hh.prototype.setProperty=function(e,t,n){let i=this._properties[t];return l(i)?(i.set(e,n),!0):!1};Hh.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)};Hh.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};Hh.prototype.getPropertyTypedArray=function(e){let t=this._properties[e];if(l(t))return t.getTypedArray()};Hh.prototype.getPropertyTypedArrayBySemantic=function(e){let t,n=this._class.propertiesBySemantic;if(l(n)&&(t=n[e]),l(t))return this.getPropertyTypedArray(t.id)};function $Ve(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=je(o,!0)),o=i.normalize(o),i.unpackVectorAndMatrixTypes(o)}}var xd=Hh;var yY=class{get cacheKey(){de.throwInstantiationError()}load(){de.throwInstantiationError()}unload(){}process(t){return!1}getError(t,n){l(n)&&l(n.message)&&(t+=`
${n.message}`);let i=new ue(t);return l(n)&&(i.stack=`Original stack:
${n.stack}
Handler stack:
${i.stack}`),i}isDestroyed(){return!1}destroy(){return this.unload(),fe(this)}},Ki=yY;var e8e={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5},gt=Object.freeze(e8e);var OV=class extends Ki{constructor(t){super(),t=t??V.EMPTY_OBJECT;let n=t.typedArray,i=t.resource,o=t.cacheKey;this._typedArray=n,this._resource=i,this._cacheKey=o,this._state=gt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get typedArray(){return this._typedArray}async load(){return l(this._promise)?this._promise:l(this._typedArray)?(this._promise=Promise.resolve(this),this._promise):(this._promise=t8e(this),this._promise)}static _fetchArrayBuffer(t){return t.fetchArrayBuffer()}unload(){this._typedArray=void 0}};async function t8e(e){let t=e._resource;e._state=gt.LOADING;try{let n=await OV._fetchArrayBuffer(t);return e.isDestroyed()?void 0:(e._typedArray=new Uint8Array(n),e._state=gt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=gt.FAILED;let i=`Failed to load external buffer: ${t.url}`;throw e.getError(i,n)}}var p0=OV;var Pfn=(function(){var e="b9H79Tebbbe9ok9Geueu9Geub9Gbb9Gruuuuuuueu9Gvuuuuueu9Gduueu9Gluuuueu9Gvuuuuub9Gouuuuuub9Gluuuub9GiuuueuiE8AdilveoveovrrwrrrDDoDrbqqbelve9Weiiviebeoweuecj:Gdkr:PlCo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9mW4W2be8A9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWVbd8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9c9V919U9KbiE9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949wWV79P9V9UblY9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWVbv8E9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWV9c9V919U9Kbo8A9TW79O9V9Wt9FW9U9J9V9KW69U9KW949wWV79P9V9UbrE9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JWbwa9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JW9c9V919U9KbDL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9p9JtbqK9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9r919HtbkL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVT949WbxY9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVJ9V29VVbmE9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OWbza9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OW9ttV9P9WbHa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9WbOK9TW79O9V9Wt9F79W9Ht9P9H29t9VVt9sW9T9H9WbAl79IV9RbXDwebcekdKYq:8f8Adbk;wadhud9:8Jjjjjbc;qw9Rgr8KjjjjbcbhwdnaeTmbabcbyd;i:I:cjbaoaocb9iEgDc:GeV86bbarc;adfcbcjdz:xjjjb8AdnaiTmbarc;adfadalz:wjjjb8Akarc;abfalfcbcbcjdal9RalcFe0Ez:xjjjb8Aarc;abfarc;adfalz:wjjjb8Aar9cb83iUar9cb83i8War9cb83iyar9cb83iaar9cb83iKar9cb83izar9cb83iwar9cb83ibcj;abal9Uc;WFbGcjdalca0Ehqdnaicd6mbavcd9imbaDTmbadcefhkaqci2gxal2hmarc;alfclfhParc;qlfceVhsarc;qofclVhzcbhHincdhOcbhAdnavci6mbar9cb83i;Ooar9cb83i;Goar9cb83i;yoar9cb83i;qoadaHfgoybbhCcbhXincbhwcbhQdninaoalfhLaoybbgKaC7aQVhQawcP0meaLhoaKhCawcefgwaXfai6mbkkcbhCarc;qofhwincwhYcwh8AdnaQaC93gocFeGgEcs0mbclh8AaEci0mbcdcbaEEh8Akdnaocw4cFeGgEcs0mbclhYaEci0mbcdcbaEEhYkaYa8AfhEawydbh3cwhYcwh8Adnaocz4cFeGg5cs0mbclh8Aa5ci0mbcdcba5Eh8AkaEa3fhEdnaocFFFFb0mbclhYaocFFF8F0mbcbcdaocjjjw6EhYkawaEa8AfaYfBdbawclfhwaCcefgCcw9hmbkaLhoaKhCaXczfgXai6mbkcbhocehwazhQinawaoaQydbarc;qofaocdtfydb6EhoaQclfhQawcefgwcw9hmbkaoclthAcihOkcbhEarc;qlfcbcjdz:xjjjb8AarcbBd;ilar9cb83i;aladh8Eaqh8Fakh3inarc;qlfadaEaEcb9h9Ral2falz:wjjjb8Aaia8Faia8F6EhadnaqaiaE9RaEaqfai6EgKcsfc9WGgoaK9nmbarc;qofaKfcbaoaK9Rz:xjjjb8AkadaEal2fhhcbhginagaAVcl4hXarc;alfagcdtfh8JaHh8Kcbh8Lina8LaHfhwdndndndndndndnagPlbedibkaKTmvahawfhoarc;qlfawfRbbhQarc;qofhwaahCinawaoRbbgYaQ9RgQcetaQcKtc8F91786bbawcefhwaoalfhoaYhQaEaCcufgC9hmbxvkkaKTmla8Kc9:Ghoa8LcitcwGh8Aarc;qlfawceVfRbbcwtarc;qlfawc9:GfRbbVhQarc;qofhwaahCinawa3aofRbbcwta8EaofRbbVgYaQ9RgQcetaQcztc8F917cFFiGa8A486bbaoalfhoawcefhwaYhQaEaCcufgC9hmbxlkkasa8Kc98GgQfhoa3aQfhYarc;qlfawc98GgQfRbbhCcwhwinaoRbbawtaCVhCaocefhoawcwfgwca9hmbxdkkaKTmdxekaKTmea8Lcith5ahaQfh8AcbhLina8ARbbhQcwhoaYhwinawRbbaotaQVhQawcefhwaocwfgoca9hmbkarc;qofaLfaQaC7aX93a5486bbaYalfhYa8Aalfh8AaQhCaLcefgLaK9hmbkka8Jydbh8AcbhLarc;qofhoincdhQcbhwinaQaoawfRbbcb9hfhQawcefgwcz9hmbkclhCcbhwinaCaoawfRbbcd0fhCawcefgwcz9hmbkcwhYcbhwinaYaoawfRbbcP0fhYawcefgwcz9hmbkaQaCaQaC6EgwaYawaY6Egwczawcz6Ea8Afh8AaoczfhoaLczfgLaK6mbka8Ja8ABdbka8Kcefh8Ka8Lcefg8Lcl9hmbkagcefggaO9hmbka8Eamfh8Ea8Faxfh8Fa3amfh3aEaxfgEai6mbkcbhocehwaPhQinawaoaQydbarc;alfaocdtfydb6EhoaQclfhQaOawcefgw9hmbkaraHcd4faAcdVaoaocdSE86bbaHclfgHal6mbkkabaefhgabcefhoalcd4g8McbaDEhkadcefh8Narc;abfceVhecbhmdndninaiam9nmearc;qofcbcjdz:xjjjb8Aagao9Rak6mdadamal2gwfhxcbhHa8Nawfhzaocbakz:xjjjbg8Fakfh3aqaiam9Ramaqfai6Egscsfgocl4cifcd4hOaoc9WGg8JThPindndndndndndndndndndnaDTmbaraHcd4fRbbgQciGPlbedlbkasTmdaxaHfhoarc;abfaHfRbbhQarc;qofhwashCinawaoRbbgYaQ9RgQcetaQcKtc8F91786bbawcefhwaoalfhoaYhQaCcufgCmbxikkasTmiaHcitcwGh8Aarc;abfaHceVfRbbcwtarc;abfaHc9:GgofRbbVhQaxaofhoarc;qofhwashCinawao8VbbgYaQ9RgQcetaQcztc8F917cFFiGa8A486bbawcefhwaoalfhoaYhQaCcufgCmbxikkaeaHc98Gg8Afhoaza8AfhYarc;abfa8AfRbbhCcwhwinaoRbbawtaCVhCaocefhoawcwfgwca9hmbkasTmdaQcl4hKaHcitcKGhEaxa8Afh8AcbhLina8ARbbhQcwhoaYhwinawRbbaotaQVhQawcefhwaocwfgoca9hmbkarc;qofaLfaQaC7aK93aE486bbaYalfhYa8Aalfh8AaQhCaLcefgLas9hmbkkaDmbcbhoxlka8JTmbcbhodninarc;qofaofgwcwf8Pibaw8Pib:e9qTmeaoczfgoa8J9pmdxbkkdnavmbcehoxikcbh8AaOhLaOhKinarc;qofa8Afgocwf8Pibhyao8Pibh8PcdhQcbhwinaQaoawfRbbcb9hfhQawcefgwcz9hmbkclhCcbhwinaCaoawfRbbcd0fhCawcefgwcz9hmbkcwhYcbhwinaYaoawfRbbcP0fhYawcefgwcz9hmbkaQaCaQaC6EgoaYaoaY6Egoczaocz6EaKfhKaocucbaya8P:e9cb9sEgwaoaw6EaLfhLa8Aczfg8Aa8J9pmdxbkka8FaHcd4fgoaoRbbcdaHcetcoGtV86bbxikdnaLas6mbaKas6mba8FaHcd4fgoaoRbbciaHcetcoGtV86bbaga39Ras6mra3arc;qofasz:wjjjbasfh3xikaLaK9phoka8FaHcd4fgwawRbbaoaHcetcoGtV86bbkaga39RaO6mla3cbaOz:xjjjbgaaOfhKdndna8JmbaPhoxekdnagaK9RcK9pmbaPhoxekaocdtc:q:G:cjbfcj:G:cjbaDEg3ydxghcetc;:FFFeGhAcuhEcuahtcu7cFeGh8Ecbh8Karc;qofhQinarc;qofa8KfhXczh8AdndndnahPDbeeeeeeedekcucbaXcwf8PibaX8Pib:e9cb9sEh8AxekcbhoaAh8Aina8Aa8EaQaofRbb9nfh8Aaocefgocz9hmbkkcih5cbhYinczhwdndndna3aYcdtfydbgLPDbeeeeeeedekcucbaXcwf8PibaX8Pib:e9cb9sEhwxekaLcetc;:FFFeGhwcuaLtcu7cFeGhCcbhoinawaCaQaofRbb9nfhwaocefgocz9hmbkkdndnawa8A6mbaLaE9hmeawa8A9hmea3a5cdtfydbcwSmekaYh5awh8AkaYcefgYci9hmbkaaa8Kco4fgoaoRbba5a8Kci4coGtV86bbdndndna3a5cdtfydbgEPDdbbbbbbbebkdncwaE9Tg5TmbcuaEtcu7hwdndnaEceSmbcbh8LaQhXinaXhoa5hYcbhCinaoRbbg8AawcFeGgLa8AaL6EaCaEtVhCaocefhoaYcufgYmbkaKaC86bbaXa5fhXaKcefhKa8La5fg8Lcz6mbxdkkcbh8LaQhXinaXhoa5hYcbhCinaoRbbg8AawcFeGgLa8AaL6EaCcetVhCaocefhoaYcufgYmbkaKaC:T9cFe:d9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:9ca188bbaXa5fhXaKcefhKa8La5fg8Lcz6mbkkcbhoinaKaQaofRbbgC86bbaKaCawcFeG9pfhKaocefgocz9hmbxikkdnaEceSmbinaKcb86bbaKcefhKxbkkinaKcb86bbaKcefhKxbkkaKaX8Pbw83bwaKaX8Pbb83bbaKczfhKka8Kczfg8Ka8J9pgomeaQczfhQagaK9RcK9pmbkkaoTmlaKh3aKTmlkaHcefgHal9hmbkarc;abfaxascufal2falz:wjjjb8Aasamfhma3hoa3mbkcbhwxdkdnagao9RakalfgwcKcaaDEgQawaQ0EgC9pmbcbhwxdkdnawaQ9pmbaocbaCaw9Rgwz:xjjjbawfhokaoarc;adfalz:wjjjbalfhodnaDTmbaoara8Mz:wjjjba8Mfhokaoab9Rhwxekcbhwkarc;qwf8Kjjjjbawk5babaeadaialcdcbyd;i:I:cjbz:bjjjbk9reduaecd4gdaefgicaaica0Eabcj;abae9Uc;WFbGcjdaeca0Egifcufai9Uae2aiadfaicl4cifcd4f2fcefkmbcbabBd;i:I:cjbk;HPeLu8Jjjjjbc;ae9Rgl8Kjjjjbcbhvdnaeaici9UgocHf6mbabcbyd;m:I:cjbgrc;GeV86bbalc;abfcFecjez:xjjjb8Aal9cu83iUal9cu83i8Wal9cu83iyal9cu83iaal9cu83iKal9cu83izal9cu83iwal9cu83ibabaefc9WfhwabcefgDaofhednaiTmbcmcsarcb9kgqEhkcbhxcbhmcbhPcbhscbhzindnaeaw9nmbcbhvxikazcufhvadaPcdtfgHydbhOaHcwfydbhAaHclfydbhCcbhXdndndninalc;abfavcsGcitfgoydlhQdndndnaoydbgoaO9hmbaQaCSmekdnaoaC9hmbaQaA9hmbaXcefhXxekaoaA9hmeaQaO9hmeaXcdfhXkaXc870mdascufhvaHaXcdtgAcxGgoyd:4:G:cjbcdtfydbhQaHaoyd:0:G:cjbcdtfydbhCaHaoyd:W:G:cjbcdtfydbhOcbhodnindnalavcsGcdtfydbaQ9hmbaohXxdkcuhXavcufhvaocefgocz9hmbkkaxaQaxSgvaXce9iaXak9oVgoGfhxdndndncbcsavEaXaoEgvcs9hmbarce9imbaQaQamaQcefamSgvEgmcefSmecmcsavEhvkaDavaAc;WeGV86bbavcs9hmeaQam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaQhmxvkcPhvaDaAcPV86bbaQhmkavTmiavak9omicdhocehXazhAxlkavcufhvaXclfgXc;ab9hmbkkdnaHcecdcbaAaxSEaCaxSEcdtgvyd:W:G:cjbcdtfydbgOTaHavyd:0:G:cjbcdtfydbgCceSGaHavyd:4:G:cjbcdtfydbgQcdSGaxcb9hGaqGgLce9hmbal9cu83iUal9cu83i8Wal9cu83iyal9cu83iaal9cu83iKal9cu83izal9cu83iwal9cu83ibcbhxkcbhXascufgvhodnindnalaocsGcdtfydbaC9hmbaXhAxdkcuhAaocufhoaXcefgXcz9hmbkkcbhodnindnalavcsGcdtfydbaQ9hmbaohXxdkcuhXavcufhvaocefgocz9hmbkkaxaOaxSgKfhHdndnaAcm0mbaAcefhAxekcbcsaCaHSgvEhAaHavfhHkdndnaXcm0mbaXcefhXxekcbcsaQaHSgvEhXaHavfhHkc9:cuaKEhYcbhvaXaAcltVg8AcFeGhodndndninavc;q:G:cjbfRbbaoSmeavcefgvcz9hmbxdkkaLaOax9havcm0VVmbaDavc;WeV86bbxekaDaY86bbaea8A86bbaecefhekdnaKmbaOam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaOhmkdnaAcs9hmbaCam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaChmkdnaXcs9hmbaQam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaQhmkalascdtfaOBdbascefcsGhvdndnaAPzbeeeeeeeeeeeeeebekalavcdtfaCBdbascdfcsGhvkdndnaXPzbeeeeeeeeeeeeeebekalavcdtfaQBdbavcefcsGhvkcihoalc;abfazcitfgXaOBdlaXaCBdbazcefcsGhAcdhXavhsaHhxxekcdhoalascdtfaQBdbcehXascefcsGhsazhAkalc;abfaAcitfgvaCBdlavaQBdbalc;abfazaXfcsGcitfgvaQBdlavaOBdbaDcefhDazaofcsGhzaPcifgPai6mbkkdnaeaw9nmbcbhvxekcbhvinaeavfavc;q:G:cjbfRbb86bbavcefgvcz9hmbkaeab9Ravfhvkalc;aef8KjjjjbavkZeeucbhddninadcefgdc8F0meaeceadt0mbkkadcrfcFeGcr9Uci2cdfabci9U2cHfkmbcbabBd;m:I:cjbk:zderu8Jjjjjbcz9Rhlcbhvdnaeaicvf6mbabcbRb;m:I:cjbc;qeV86bbal9cb83iwabcefhvabaefc98fhodnaiTmbcbhecbhrcbhwindnavao6mbcbskadawcdtfydbgDalcwfaraDae9Rgeaec8F91ge7ae9Rc507grcdtfgqydb9Rgec8E91c9:Gaecdt7arVheinavcbcjeaecje6EaecFbGV86bbavcefhvaecr4gembkaqaDBdbaDheawcefgwai9hmbkkdnavao9nmbcbskavcbBbbavab9RclfhvkavkBeeucbhddninadcefgdc8F0meaeceadt0mbkkabadcwfcFeGcr9U2cvfk:dvli99dui99ludnaeTmbcuadcetcuftcu7:Zhvdndncuaicuftcu7:ZgoJbbbZMgr:lJbbb9p9DTmbar:Ohwxekcjjjj94hwkcbhicbhDinalclfIdbgrJbbbbJbbjZalIdbgq:lar:lMalcwfIdbgk:lMgr:varJbbbb9BEgrNhxaqarNhralcxfIdbhqdndnakJbbbb9GTmbaxhkxekJbbjZar:l:tgkak:maxJbbbb9GEhkJbbjZax:l:tgxax:marJbbbb9GEhrkdndnaqJbbj:;aqJbbj:;9GEgxJbbjZaxJbbjZ9FEavNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohmxekcjjjj94hmkdndnakJbbj:;akJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;akJbbbb9GEMgq:lJbbb9p9DTmbaq:OhPxekcjjjj94hPkdndnarJbbj:;arJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;arJbbbb9GEMgr:lJbbb9p9DTmbar:Ohsxekcjjjj94hskdndnadcl9hmbabaDfgzas86bbazcifam86bbazcdfaw86bbazcefaP86bbxekabaifgzas87ebazcofam87ebazclfaw87ebazcdfaP87ebkaicwfhiaDclfhDalczfhlaecufgembkkk;hlld99eud99eudnaeTmbdndncuaicuftcu7:ZgvJbbbZMgo: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;Pviwue99eu8Jjjjjbcjd9Rgo8Kjjjjbadcd4hrdndndnavcd9hmbarTmbaohdarhwinadc:CuBdbadclfhdawcufgwmbkaeTmdarcdthDalhqcbhkinaohdaqhwarhxinadadydbgmcbawIdbgP:8cL4cFeGc:cufaPJbbbb9BEgsamas9kEBdbawclfhwadclfhdaxcufgxmbkaqaDfhqakcefgkae9hmbxdkkaeTmekarcdthqavce9hhDcbhkindndndnaDmbarTmdc:CuhwalhdarhxinawcbadIdbgP:8cL4cFeGc:cufaPJbbbb9BEgmawam9kEhwadclfhdaxcufgxmbxdkkdndndndnavPleddbdkarTmlaohdalhwarhxinadcbcbawIdbgP:8cL4cFeGgmc:cufgsasam0EaPJbbbb9BEBdbadclfhdawclfhwaxcufgxmbxikkarTmicbhdarhwinaoadfcbaladfIdbgP:8cL4cFeGgxc8Aaxc8A0Ec:cufaPJbbbb9BEBdbadclfhdawcufgwmbxdkkarTmdkc:CuhwkcbhdarhminawhxdnavceSmbaoadfydbhxkdndnaladfIdbgPcjjj;8iaxai9RcefgxcLt9R::NJbbbZJbbb:;aPJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohsxekcjjjj94hskabadfascFFFrGaxcKtVBdbadclfhdamcufgmmbkkabaqfhbalaqfhlakcefgkae9hmbkkaocjdf8Kjjjjbk:Olveue99iue99iudnaeTmbceaicufthvcuaitcu7:Zhocbhradcl9hhwcbhDindndnalcwfIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohixekcjjjj94hikdndnalIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkadai9Rcd9TgkaifhidndnalclfIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkadai9Rcd9ThddndnalcxfIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohxxekcjjjj94hxkadaifhiaxce91avVhxdndnawmbabaDfgmai86bbamcifax86bbamcdfad86bbamcefak86bbxekabarfgmai87ebamcofax87ebamclfad87ebamcdfak87ebkarcwfhraDclfhDalczfhlaecufgembkkk;mqdQui998Jjjjjbc:qd9Rgv8Kjjjjbavc:Sefcbc;Kbz:xjjjb8AdnadTmbaiTmbdndnabaeSmbaehoxekavcuadcdtgradcFFFFi0Ecbyd;q:I:cjbHjjjjbbgoBd:SeavceBd:mdaoaearz:wjjjb8AkavcbBd:Oeav9cb83i:Geavc:Gefaoadaiavc:Sefz:pjjjbavyd:Gehwadci9UgDcbyd;q:I:cjbHjjjjbbheavc:Sefavyd:mdgqcdtfaeBdbavaqcefgrBd:mdaecbaDz:xjjjbhkavc:SefarcdtfcuaicdtaicFFFFi0Ecbyd;q:I:cjbHjjjjbbgxBdbavaqcdfgmBd:mdalc;ebfhPawheaxhrinaralIdbaPaeydbgscwascw6EcdtfIdbMUdbaeclfhearclfhraicufgimbkavc:SefamcdtfcuaDcdtadcFFFF970Ecbyd;q:I:cjbHjjjjbbgmBdbdnadci6mbaoheamhraDhiinaraxaeydbcdtfIdbaxaeclfydbcdtfIdbMaxaecwfydbcdtfIdbMUdbaecxfhearclfhraicufgimbkkaqcifhzalc;ebfhHavc;qbfhOavheavyd:KehAavyd:OehCcbhscbhrcbhXcehQinaehLaoarcx2fgKydbhPaKclfydbhdabaXcx2fgecwfaKcwfydbgYBdbaeclfadBdbaeaPBdbakarfce86bbaOaYBdwaOadBdlaOaPBdbamarcdtfcbBdbcih8AdnasTmbaLhiinaOa8AcdtfaiydbgeBdba8AaeaY9haeaP9haead9hGGfh8AaiclfhiascufgsmbkkaXcefhXcbhsinaCaAaKascdtfydbcdtgifydbcdtfgYheawaifgdydbgPhidnaPTmbdninaeydbarSmeaeclfheaicufgiTmdxbkkaeaYaPcdtfc98fydbBdbadadydbcufBdbkascefgsci9hmbkdndndna8ATmbcuhrJbbbbhEcbhdavyd:KehYavyd:OehKindnawaOadcdtfydbcdtgsfydbgeTmbaxasfgiIdbh3aialcuadadcs0EcdtfclfIdbaHaecwaecw6EcdtfIdbMg5Udba5a3:th5aecdthiaKaYasfydbcdtfheinamaeydbgscdtfgPa5aPIdbMg3Udba3aEaEa39DgPEhEasaraPEhraeclfheaic98fgimbkkadcefgda8A9hmbkarcu9hmekaQaD9pmeindnakaQfRbbmbaQhrxdkaDaQcefgQ9hmbxdkka8Acza8Acz6EhsaOheaLhOarcu9hmekkazTmbaqcdtavc:Seffcwfheinaeydbcbyd;u:I:cjbH:bjjjbbaec98fheazcufgzmbkkavc:qdf8Kjjjjbk:0leoucuaicdtgvaicFFFFi0Egocbyd;q:I:cjbHjjjjbbhralalyd9GgwcdtfarBdbalawcefBd9GabarBdbaocbyd;q:I:cjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdlcuadcdtadcFFFFi0Ecbyd;q:I:cjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdwabydbcbavz:xjjjb8AabydbhraehladhvinaralydbcdtfgoaoydbcefBdbalclfhlavcufgvmbkcbhvabydlglhoarhwaihDinaoavBdbaoclfhoawydbavfhvawclfhwaDcufgDmbkadci9Uhqdnadcd9nmbabydwhocbhvinaecwfydbhwaeclfydbhDalaeydbcdtfgbabydbgbcefBdbaoabcdtfavBdbalaDcdtfgDaDydbgDcefBdbaoaDcdtfavBdbalawcdtfgwawydbgwcefBdbaoawcdtfavBdbaecxfheaqavcefgv9hmbkkinalalydbarydb9RBdbarclfhralclfhlaicufgimbkkQbabaeadaic;G:G:cjbz:ojjjbkQbabaeadaic;i:H:cjbz:ojjjbk9DeeuabcFeaicdtz:xjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk:3vioud9:du8Jjjjjbc;Wa9Rgl8Kjjjjbcbhvalcxfcbc;Kbz:xjjjb8AalcuadcitgoadcFFFFe0Ecbyd;q:I:cjbHjjjjbbgrBdxalceBd2araeadaicezNjjjbalcuaoadcjjjjoGEcbyd;q:I:cjbHjjjjbbgwBdzadcdthednadTmbabhiinaiavBdbaiclfhiadavcefgv9hmbkkawaefhDalabBdwalawBdl9cbhqindnadTmbaq9cq9:hkarhvaDhiadheinaiav8Pibak1:NcFrG87ebavcwfhvaicdfhiaecufgembkkalclfaq:NceGcdtfydbhxalclfaq9ce98gq:NceGcdtfydbhmalc;Wbfcbcjaz:xjjjb8AaDhvadhidnadTmbinalc;Wbfav8VebcdtfgeaeydbcefBdbavcdfhvaicufgimbkkcbhvcbhiinalc;WbfavfgeydbhoaeaiBdbaoaifhiavclfgvcja9hmbkadhvdndnadTmbinalc;WbfaDamydbgicetf8VebcdtfgeaeydbgecefBdbaxaecdtfaiBdbamclfhmavcufgvmbkaq9cv9smdcbhvinabawydbcdtfavBdbawclfhwadavcefgv9hmbxdkkaq9cv9smekkcwhvcbhiinalcxfavfc98fydbcbyd;u:I:cjbH:bjjjbbaiceGheclhvcehiaeTmbkalc;Waf8Kjjjjbk:Awliuo99iud9:cbhv8Jjjjjbca9Rgocbyd:4:I:cjbBdKaocb8Pd:W:I:cjb83izaocbyd;e:I:cjbBdwaocb8Pd:8:I:cjb83ibaicd4hrdndnadmbJFFuFhwJFFuuhDJFFuuhqJFFuFhkJFFuuhxJFFuFhmxekarcdthPaehsincbhiinaoczfaifgzasaifIdbgwazIdbgDaDaw9EEUdbaoaifgzawazIdbgDaDaw9DEUdbaiclfgicx9hmbkasaPfhsavcefgvad9hmbkaoIdKhDaoIdwhwaoIdChqaoIdlhkaoIdzhxaoIdbhmkdnadTmbJbbbbJbFu9hJbbbbamax:tgmamJbbbb9DEgmakaq:tgkakam9DEgkawaD:tgwawak9DEgw:vawJbbbb9BEhwdnalmbarcdthoindndnaeclfIdbaq:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:S9cC:ghHdndnaeIdbax:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikaHai:S:ehHdndnaecwfIdbaD:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabaHai:T9cy:g:e83ibaeaofheabcwfhbadcufgdmbxdkkarcdthoindndnaeIdbax:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cv9:9c;j:KM;j:KM;j:Kd:dhOdndnaeclfIdbaq:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cq9:9cM;j:KM;j:KM;jl:daO:ehOdndnaecwfIdbaD:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabaOai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cC9:9c:KM;j:KM;j:KMD:d:e83ibaeaofheabcwfhbadcufgdmbkkk9teiucbcbyd;y:I:cjbgeabcifc98GfgbBd;y:I:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;y:I:cjbgeabcrfc94GfgbBd;y:I:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd;y:I:cjbge9Rcifc98GaefgbBd;y:I:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk;Sddbcj:Gdk;idbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbbbbbbbbbbbbbbbbebbbdbbbbbbbebbbbbbbbbbbbbbbb4:h9w9N94:P:gW:j9O:ye9Pbbbbbb:l29hZ;69:9kZ;N;76Z;rg97Z;z;o9xZ8J;B85Z;:;u9yZ;b;k9HZ:2;Z9DZ9e:l9mZ59A8KZ:r;T3Z:A:zYZ79OHZ;j4::8::Y:D9V8:bbbb9s:49:Z8R:hBZ9M9M;M8:L;z;o8:;8:PG89q;x:J878R:hQ8::M:B;e87bbbbbbjZbbjZbbjZ:E;V;N8::Y:DsZ9i;H;68:xd;R8:;h0838:;W:NoZbbbb:WV9O8:uf888:9i;H;68:9c9G;L89;n;m9m89;D8Ko8:bbbbf:8tZ9m836ZS:2AZL;zPZZ818EZ9e:lxZ;U98F8:819E;68:FFuuFFuuFFuuFFuFFFuFFFuFbc;i:IdkCebbbebbbebbbdbbb9G:rbb",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(A){n=A.instance,n.exports.__wasm_call_ctors(),n.exports.meshopt_encodeVertexVersion(1),n.exports.meshopt_encodeIndexVersion(1)});function o(A){for(var m=new Uint8Array(A.length),_=0;_<A.length;++_){var y=A.charCodeAt(_);m[_]=y>96?y-97:y>64?y-39:y+4}for(var C=0,_=0;_<A.length;++_)m[C++]=m[_]<60?t[m[_]]:(m[_]-60)*64+m[++_];return m.buffer.slice(0,C)}function r(A){if(!A)throw new Error("Assertion failed")}function a(A){return new Uint8Array(A.buffer,A.byteOffset,A.byteLength)}function s(A,m,_,y){var C=n.exports.sbrk,E=C(m.length*4),b=C(_*4),x=new Uint8Array(n.exports.memory.buffer),S=a(m);x.set(S,E),y&&y(E,E,m.length,_);var B=A(b,E,m.length,_);x=new Uint8Array(n.exports.memory.buffer);var v=new Uint32Array(_);new Uint8Array(v.buffer).set(x.subarray(b,b+_*4)),S.set(x.subarray(E,E+m.length*4)),C(E-C(0));for(var P=0;P<m.length;++P)m[P]=v[m[P]];return[v,B]}function c(A,m,_,y){var C=n.exports.sbrk,E=C(_*4),b=C(_*y),x=new Uint8Array(n.exports.memory.buffer);x.set(a(m),b),A(E,b,_,y),x=new Uint8Array(n.exports.memory.buffer);var S=new Uint32Array(_);return new Uint8Array(S.buffer).set(x.subarray(E,E+_*4)),C(E-C(0)),S}function u(A,m,_,y,C,E,b){var x=n.exports.sbrk,S=x(m),B=x(y*C),v=new Uint8Array(n.exports.memory.buffer);v.set(a(_),B);var P=A(S,m,B,y,C,E,b),N=new Uint8Array(P);return N.set(v.subarray(S,S+P)),x(S-x(0)),N}function f(A){for(var m=0,_=0;_<A.length;++_){var y=A[_];m=m<y?y:m}return m}function h(A,m){if(r(m==2||m==4),m==4)return new Uint32Array(A.buffer,A.byteOffset,A.byteLength/4);var _=new Uint16Array(A.buffer,A.byteOffset,A.byteLength/2);return new Uint32Array(_)}function p(A,m,_,y,C,E,b){var x=n.exports.sbrk,S=x(_*y),B=x(_*E),v=new Uint8Array(n.exports.memory.buffer);v.set(a(m),B),A(S,_,y,C,B,b);var P=new Uint8Array(_*y);return P.set(v.subarray(S,S+_*y)),x(S-x(0)),P}return{ready:i,supported:!0,reorderMesh:function(A,m,_){var y=m?_?n.exports.meshopt_optimizeVertexCacheStrip:n.exports.meshopt_optimizeVertexCache:void 0;return s(n.exports.meshopt_optimizeVertexFetchRemap,A,f(A)+1,y)},reorderPoints:function(A,m){return r(A instanceof Float32Array),r(A.length%m==0),r(m>=3),c(n.exports.meshopt_spatialSortRemap,A,A.length/m,m*4)},encodeVertexBuffer:function(A,m,_){r(_>0&&_<=256),r(_%4==0);var y=n.exports.meshopt_encodeVertexBufferBound(m,_);return u(n.exports.meshopt_encodeVertexBuffer,y,A,m,_)},encodeVertexBufferLevel:function(A,m,_,y,C){r(_>0&&_<=256),r(_%4==0),r(y>=0&&y<=3),r(C===void 0||C==0||C==1);var E=n.exports.meshopt_encodeVertexBufferBound(m,_);return u(n.exports.meshopt_encodeVertexBufferLevel,E,A,m,_,y,C===void 0?-1:C)},encodeIndexBuffer:function(A,m,_){r(_==2||_==4),r(m%3==0);var y=h(A,_),C=n.exports.meshopt_encodeIndexBufferBound(m,f(y)+1);return u(n.exports.meshopt_encodeIndexBuffer,C,y,m,4)},encodeIndexSequence:function(A,m,_){r(_==2||_==4);var y=h(A,_),C=n.exports.meshopt_encodeIndexSequenceBound(m,f(y)+1);return u(n.exports.meshopt_encodeIndexSequence,C,y,m,4)},encodeGltfBuffer:function(A,m,_,y,C){var E={ATTRIBUTES:this.encodeVertexBufferLevel,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return r(E[y]),E[y](A,m,_,2,C===void 0?0:C)},encodeFilterOct:function(A,m,_,y){return r(_==4||_==8),r(y>=2&&y<=16),p(n.exports.meshopt_encodeFilterOct,A,m,_,y,16)},encodeFilterQuat:function(A,m,_,y){return r(_==8),r(y>=4&&y<=16),p(n.exports.meshopt_encodeFilterQuat,A,m,_,y,16)},encodeFilterExp:function(A,m,_,y,C){r(_>0&&_%4==0),r(y>=1&&y<=24);var E={Separate:0,SharedVector:1,SharedComponent:2,Clamped:3};return p(n.exports.meshopt_encodeFilterExp,A,m,_,y,_,C?E[C]:1)},encodeFilterColor:function(A,m,_,y){return r(_==4||_==8),r(y>=2&&y<=16),p(n.exports.meshopt_encodeFilterColor,A,m,_,y,16)}}})();var Cy=(function(){var e="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuixkbeeeddddillviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WboY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbrl79IV9Rbwq:VZkdbk:XYi5ud9:du8Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaicefhxcj;abad9Uc;WFbGcjdadca0EhmaialfgPar9Rgoadfhsavaoadz:jjjjbgzceVhHcbhOdndninaeaO9nmeaPax9RaD6mdamaeaO9RaOamfgoae6EgAcsfglc9WGhCabaOad2fhXaAcethQaxaDfhiaOaeaoaeao6E9RhLalcl4cifcd4hKazcj;cbfaAfhYcbh8AazcjdfhEaHh3incbh5dnawTmbaxa8Acd4fRbbh5kcbh8Eazcj;cbfhqinaih8Fdndndndna5a8Ecet4ciGgoc9:fPdebdkaPa8F9RaA6mrazcj;cbfa8EaA2fa8FaAz:jjjjb8Aa8FaAfhixdkazcj;cbfa8EaA2fcbaAz:kjjjb8Aa8FhixekaPa8F9RaK6mva8FaKfhidnaCTmbaPai9RcK6mbaocdtc:q:G:cjbfcj:G:cjbawEhaczhrcbhlinargoc9Wfghaqfhrdndndndndndnaaa8Fahco4fRbbalcoG4ciGcdtfydbPDbedvivvvlvkar9cb83bwar9cb83bbxlkarcbaiRbdai8Xbb9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbaqaofgrcGfcbaicdfa8J9c8N1:NfghRbbag9cjjjjjw:dg8J9qE86bbarcVfcbaha8J9c8M1:NfghRbbag9cjjjjjl:dg8J9qE86bbarc7fcbaha8J9c8L1:NfghRbbag9cjjjjjd:dg8J9qE86bbarctfcbaha8J9c8K1:NfghRbbag9cjjjjje:dg8J9qE86bbarc91fcbaha8J9c8J1:NfghRbbag9cjjjj;ab:dg8J9qE86bbarc4fcbaha8J9cg1:NfghRbbag9cjjjja:dg8J9qE86bbarc93fcbaha8J9ch1:NfghRbbag9cjjjjz:dgg9qE86bbarc94fcbahag9ca1:NfghRbbai8Xbe9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbarc95fcbaha8J9c8N1:NfgiRbbag9cjjjjjw:dg8J9qE86bbarc96fcbaia8J9c8M1:NfgiRbbag9cjjjjjl:dg8J9qE86bbarc97fcbaia8J9c8L1:NfgiRbbag9cjjjjjd:dg8J9qE86bbarc98fcbaia8J9c8K1:NfgiRbbag9cjjjjje:dg8J9qE86bbarc99fcbaia8J9c8J1:NfgiRbbag9cjjjj;ab:dg8J9qE86bbarc9:fcbaia8J9cg1:NfgiRbbag9cjjjja:dg8J9qE86bbarcufcbaia8J9ch1:NfgiRbbag9cjjjjz:dgg9qE86bbaiag9ca1:NfhixikaraiRblaiRbbghco4g8Ka8KciSg8KE86bbaqaofgrcGfaiclfa8Kfg8KRbbahcl4ciGg8La8LciSg8LE86bbarcVfa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc7fa8Ka8Lfg8KRbbahciGghahciSghE86bbarctfa8Kahfg8KRbbaiRbeghco4g8La8LciSg8LE86bbarc91fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc4fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc93fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc94fa8Kahfg8KRbbaiRbdghco4g8La8LciSg8LE86bbarc95fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc96fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc97fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc98fa8KahfghRbbaiRbigico4g8Ka8KciSg8KE86bbarc99faha8KfghRbbaicl4ciGg8Ka8KciSg8KE86bbarc9:faha8KfghRbbaicd4ciGg8Ka8KciSg8KE86bbarcufaha8KfgrRbbaiciGgiaiciSgiE86bbaraifhixdkaraiRbwaiRbbghcl4g8Ka8KcsSg8KE86bbaqaofgrcGfaicwfa8Kfg8KRbbahcsGghahcsSghE86bbarcVfa8KahfghRbbaiRbeg8Kcl4g8La8LcsSg8LE86bbarc7faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarctfaha8KfghRbbaiRbdg8Kcl4g8La8LcsSg8LE86bbarc91faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc4faha8KfghRbbaiRbig8Kcl4g8La8LcsSg8LE86bbarc93faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc94faha8KfghRbbaiRblg8Kcl4g8La8LcsSg8LE86bbarc95faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc96faha8KfghRbbaiRbvg8Kcl4g8La8LcsSg8LE86bbarc97faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc98faha8KfghRbbaiRbog8Kcl4g8La8LcsSg8LE86bbarc99faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc9:faha8KfghRbbaiRbrgicl4g8Ka8KcsSg8KE86bbarcufaha8KfgrRbbaicsGgiaicsSgiE86bbaraifhixekarai8Pbw83bwarai8Pbb83bbaiczfhikdnaoaC9pmbalcdfhlaoczfhraPai9RcL0mekkaoaC6moaimexokaCmva8FTmvkaqaAfhqa8Ecefg8Ecl9hmbkdndndndnawTmbasa8Acd4fRbbgociGPlbedrbkaATmdaza8Afh8Fazcj;cbfhhcbh8EaEhaina8FRbbhraahocbhlinaoahalfRbbgqce4cbaqceG9R7arfgr86bbaoadfhoaAalcefgl9hmbkaacefhaa8Fcefh8FahaAfhha8Ecefg8Ecl9hmbxikkaATmeaza8Afhaazcj;cbfhhcbhoceh8EaYh8FinaEaofhlaa8Vbbhrcbhoinala8FaofRbbcwtahaofRbbgqVc;:FiGce4cbaqceG9R7arfgr87bbaladfhlaLaocefgofmbka8FaQfh8FcdhoaacdfhaahaQfhha8EceGhlcbh8EalmbxdkkaATmbaocl4h8Eaza8AfRbbhqcwhoa3hlinalRbbaotaqVhqalcefhlaocwfgoca9hmbkcbhhaEh8FaYhainazcj;cbfahfRbbhrcwhoaahlinalRbbaotarVhralaAfhlaocwfgoca9hmbkara8E94aq7hqcbhoa8Fhlinalaqao486bbalcefhlaocwfgoca9hmbka8Fadfh8FaacefhaahcefghaA9hmbkkaEclfhEa3clfh3a8Aclfg8Aad6mbkaXazcjdfaAad2z:jjjjb8AazazcjdfaAcufad2fadz:jjjjb8AaAaOfhOaihxaimbkc9:hoxdkcbc99aPax9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaok:ysezu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:kjjjb8Aav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbavaiaqaDcsGfRbbgscl4gP9RcsGcdtfydbaxcefgOaPEhDavaias9RcsGcdtfydbaOaPTgzfgOascsGgPEhsaPThPdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiazfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaPfhiaOaPfhxxekaxcbalRbbgsEgHaDc;:eSgDfhOascsGhAdndnascl4gCmbaOcefhzxekaOhzavaiaC9RcsGcdtfydbhOkdndnaAmbazcefhxxekazhxavaias9RcsGcdtfydbhzkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhHascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaHhDxekaDcefhDkasce4cbasceG9R7amfgmhHkdndnaCcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhOaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkaOhsxekascefhskaPce4cbaPceG9R7amfgmhOkdndnaAcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhzaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkazhlxekalcefhlkaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabarcetfgDaH87ebaDclfaz87ebaDcdfaO87ebxekabarcdtfgDaHBdbaDcwfazBdbaDclfaOBdbkavc;abfaocitfgDaOBdbaDaHBdlavaicdtfaHBdbavc;abfaocefcsGcitfgDazBdbaDaOBdlavaicefgicsGcdtfaOBdbavc;abfaocdfcsGcitfgDaHBdbaDazBdlavaiaCTaCcsSVfgicsGcdtfazBdbaiaATaAcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk: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:4ioiue99dud99dud99dnaeTmbcbhiabhlindndnal8Uebgv:YgoJ:ji:1Salcof8UebgrciVgw:Y:vgDNJbbbZJbbb:;avcu9kEMgq:lJbbb9p9DTmbaq:Ohkxekcjjjj94hkkalclf8Uebhvalcdf8UebhxalarcefciGcetfak87ebdndnax:YgqaDNJbbbZJbbb:;axcu9kEMgm:lJbbb9p9DTmbam:Ohxxekcjjjj94hxkabaiarciGgkfcd7cetfax87ebdndnav:YgmaDNJbbbZJbbb:;avcu9kEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkalarcufciGcetfav87ebdndnawaw2:ZgPaPMaoaoN:taqaqN:tamamN:tgoJbbbbaoJbbbb9GE:raDNJbbbZMgD:lJbbb9p9DTmbaD:Ohrxekcjjjj94hrkalakcetfar87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk:Tvirud99eudndnadcl9hmbaeTmeindndnabRbbgiabcefgl8Sbbgvabcdfgo8Sbbgrf9R:YJbbuJabcifgwRbbgdce4adVgDcd4aDVgDcl4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax86bbdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao86bbdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai86bbdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad86bbabclfhbaecufgembxdkkaeTmbindndnab8Vebgiabcdfgl8Uebgvabclfgo8Uebgrf9R:YJbFu9habcofgw8Vebgdce4adVgDcd4aDVgDcl4aDVgDcw4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax87ebdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao87ebdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai87ebdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad87ebabcwfhbaecufgembkkk9teiucbcbyd:K:G:cjbgeabcifc98GfgbBd:K:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkk83dbcj:Gdk8Kbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbc:K:Gdkl8W:qbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuixkbbebeeddddilve9Weeeviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WbwY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbDl79IV9Rbqq:W9Dklbzik94evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaeai86b:q:W:cjbaecitab8Piw83i:q:G:cjbaecefgecjd9hmbkk:JBl8Aud97dur978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaialfgxar9RhodnadTgmmbavaoad;8qbbkaicefhPcj;abad9Uc;WFbGcjdadca0EhsdndndnadTmbaoadfhzcbhHinaeaH9nmdaxaP9RaD6miabaHad2fhOaPaDfhAasaeaH9RaHasfae6EgCcsfgocl4cifcd4hXavcj;cbfaoc9WGgQcetfhLavcj;cbfaQci2fhKavcj;cbfaQfhYcbh8Aaoc;ab6hEincbh3dnawTmbaPa8Acd4fRbbh3kcbh5avcj;cbfh8Eindndndndna3a5cet4ciGgoc9:fPdebdkaxaA9RaQ6mwdnaQTmbavcj;cbfa5aQ2faAaQ;8qbbkaAaCfhAxdkaQTmeavcj;cbfa5aQ2fcbaQ;8kbxekaxaA9RaX6moaoclVcbawEhraAaXfhocbhidnaEmbaxao9Rc;Gb6mbcbhlina8EalfhidndndndndndnaAalco4fRbbgqciGarfPDbedibledibkaipxbbbbbbbbbbbbbbbbpklbxlkaiaopbblaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLg8Fcdp:mea8FpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogapxiiiiiiiiiiiiiiiip8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbahaoclffagRb:q:W:cjbfhoxikaiaopbbwaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogapxssssssssssssssssp8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbahaocwffagRb:q:W:cjbfhoxdkaiaopbbbpklbaoczfhoxekaiaopbbdaoRbbghcitpbi:q:G:cjbahRb:q:W:cjbghpsaoRbeggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbahaocdffagRb:q:W:cjbfhokdndndndndndnaqcd4ciGarfPDbedibledibkaiczfpxbbbbbbbbbbbbbbbbpklbxlkaiczfaopbblaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLg8Fcdp:mea8FpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogapxiiiiiiiiiiiiiiiip8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbahaoclffagRb:q:W:cjbfhoxikaiczfaopbbwaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogapxssssssssssssssssp8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbahaocwffagRb:q:W:cjbfhoxdkaiczfaopbbbpklbaoczfhoxekaiczfaopbbdaoRbbghcitpbi:q:G:cjbahRb:q:W:cjbghpsaoRbeggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbahaocdffagRb:q:W:cjbfhokdndndndndndnaqcl4ciGarfPDbedibledibkaicafpxbbbbbbbbbbbbbbbbpklbxlkaicafaopbblaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLg8Fcdp:mea8FpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogapxiiiiiiiiiiiiiiiip8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbahaoclffagRb:q:W:cjbfhoxikaicafaopbbwaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogapxssssssssssssssssp8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbahaocwffagRb:q:W:cjbfhoxdkaicafaopbbbpklbaoczfhoxekaicafaopbbdaoRbbghcitpbi:q:G:cjbahRb:q:W:cjbghpsaoRbeggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbahaocdffagRb:q:W:cjbfhokdndndndndndnaqco4arfPDbedibledibkaic8Wfpxbbbbbbbbbbbbbbbbpklbxlkaic8Wfaopbblaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLg8Fcdp:mea8FpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogapxiiiiiiiiiiiiiiiip8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbaiaoclffaqRb:q:W:cjbfhoxikaic8Wfaopbbwaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogapxssssssssssssssssp8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbaiaocwffaqRb:q:W:cjbfhoxdkaic8Wfaopbbbpklbaoczfhoxekaic8WfaopbbdaoRbbgicitpbi:q:G:cjbaiRb:q:W:cjbgipsaoRbegqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbaiaocdffaqRb:q:W:cjbfhokalc;abfhialcjefaQ0meaihlaxao9Rc;Fb0mbkkdnaiaQ9pmbaici4hlinaxao9RcK6mwa8EaifhqdndndndndndnaAaico4fRbbalcoG4ciGarfPDbedibledibkaqpxbbbbbbbbbbbbbbbbpkbbxlkaqaopbblaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLg8Fcdp:mea8FpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogapxiiiiiiiiiiiiiiiip8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spkbbahaoclffagRb:q:W:cjbfhoxikaqaopbbwaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogapxssssssssssssssssp8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spkbbahaocwffagRb:q:W:cjbfhoxdkaqaopbbbpkbbaoczfhoxekaqaopbbdaoRbbghcitpbi:q:G:cjbahRb:q:W:cjbghpsaoRbeggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpkbbahaocdffagRb:q:W:cjbfhokalcdfhlaiczfgiaQ6mbkkaohAaoTmoka8EaQfh8Ea5cefg5cl9hmbkdndndndnawTmbaza8Acd4fRbbglciGPlbedwbkaQTmdavcjdfa8Afhlava8Afpbdbh8Jcbhoinalavcj;cbfaofpblbg8KaYaofpblbg8LpmbzeHdOiAlCvXoQrLg8MaLaofpblbg8NaKaofpblbgypmbzeHdOiAlCvXoQrLg8PpmbezHdiOAlvCXorQLg8Fcep9Ta8Fpxeeeeeeeeeeeeeeeegap9op9Hp9rg8Fa8Jp9Ug8Jp9Abbbaladfgla8Ja8Fa8Fpmlvorlvorlvorlvorp9Ug8Jp9Abbbaladfgla8Ja8Fa8FpmwDqkwDqkwDqkwDqkp9Ug8Jp9Abbbaladfgla8Ja8Fa8FpmxmPsxmPsxmPsxmPsp9Ug8Jp9Abbbaladfgla8Ja8Ma8PpmwDKYqk8AExm35Ps8E8Fg8Fcep9Ta8Faap9op9Hp9rg8Fp9Ug8Jp9Abbbaladfgla8Ja8Fa8Fpmlvorlvorlvorlvorp9Ug8Jp9Abbbaladfgla8Ja8Fa8FpmwDqkwDqkwDqkwDqkp9Ug8Jp9Abbbaladfgla8Ja8Fa8FpmxmPsxmPsxmPsxmPsp9Ug8Jp9Abbbaladfgla8Ja8Ka8LpmwKDYq8AkEx3m5P8Es8Fg8Ka8NaypmwKDYq8AkEx3m5P8Es8Fg8LpmbezHdiOAlvCXorQLg8Fcep9Ta8Faap9op9Hp9rg8Fp9Ug8Jp9Abbbaladfgla8Ja8Fa8Fpmlvorlvorlvorlvorp9Ug8Jp9Abbbaladfgla8Ja8Fa8FpmwDqkwDqkwDqkwDqkp9Ug8Jp9Abbbaladfgla8Ja8Fa8FpmxmPsxmPsxmPsxmPsp9Ug8Jp9Abbbaladfgla8Ja8Ka8LpmwDKYqk8AExm35Ps8E8Fg8Fcep9Ta8Faap9op9Hp9rg8Fp9Ugap9Abbbaladfglaaa8Fa8Fpmlvorlvorlvorlvorp9Ugap9Abbbaladfglaaa8Fa8FpmwDqkwDqkwDqkwDqkp9Ugap9Abbbaladfglaaa8Fa8FpmxmPsxmPsxmPsxmPsp9Ug8Jp9AbbbaladfhlaoczfgoaQ6mbxikkaQTmeavcjdfa8Afhlava8Afpbdbh8Jcbhoinalavcj;cbfaofpblbg8KaYaofpblbg8LpmbzeHdOiAlCvXoQrLg8MaLaofpblbg8NaKaofpblbgypmbzeHdOiAlCvXoQrLg8PpmbezHdiOAlvCXorQLg8Fcep:nea8Fpxebebebebebebebebgap9op:bep9rg8Fa8Jp:oeg8Jp9Abbbaladfgla8Ja8Fa8Fpmlvorlvorlvorlvorp:oeg8Jp9Abbbaladfgla8Ja8Fa8FpmwDqkwDqkwDqkwDqkp:oeg8Jp9Abbbaladfgla8Ja8Fa8FpmxmPsxmPsxmPsxmPsp:oeg8Jp9Abbbaladfgla8Ja8Ma8PpmwDKYqk8AExm35Ps8E8Fg8Fcep:nea8Faap9op:bep9rg8Fp:oeg8Jp9Abbbaladfgla8Ja8Fa8Fpmlvorlvorlvorlvorp:oeg8Jp9Abbbaladfgla8Ja8Fa8FpmwDqkwDqkwDqkwDqkp:oeg8Jp9Abbbaladfgla8Ja8Fa8FpmxmPsxmPsxmPsxmPsp:oeg8Jp9Abbbaladfgla8Ja8Ka8LpmwKDYq8AkEx3m5P8Es8Fg8Ka8NaypmwKDYq8AkEx3m5P8Es8Fg8LpmbezHdiOAlvCXorQLg8Fcep:nea8Faap9op:bep9rg8Fp:oeg8Jp9Abbbaladfgla8Ja8Fa8Fpmlvorlvorlvorlvorp:oeg8Jp9Abbbaladfgla8Ja8Fa8FpmwDqkwDqkwDqkwDqkp:oeg8Jp9Abbbaladfgla8Ja8Fa8FpmxmPsxmPsxmPsxmPsp:oeg8Jp9Abbbaladfgla8Ja8Ka8LpmwDKYqk8AExm35Ps8E8Fg8Fcep:nea8Faap9op:bep9rg8Fp:oegap9Abbbaladfglaaa8Fa8Fpmlvorlvorlvorlvorp:oegap9Abbbaladfglaaa8Fa8FpmwDqkwDqkwDqkwDqkp:oegap9Abbbaladfglaaa8Fa8FpmxmPsxmPsxmPsxmPsp:oeg8Jp9AbbbaladfhlaoczfgoaQ6mbxdkkaQTmbcbhocbalcl4gl9Rc8FGhiavcjdfa8Afhrava8Afpbdbhainaravcj;cbfaofpblbg8JaYaofpblbg8KpmbzeHdOiAlCvXoQrLg8LaLaofpblbg8MaKaofpblbg8NpmbzeHdOiAlCvXoQrLgypmbezHdiOAlvCXorQLg8Faip:Rea8Falp:Sep9qg8Faap9rgap9Abbbaradfgraaa8Fa8Fpmlvorlvorlvorlvorp9rgap9Abbbaradfgraaa8Fa8FpmwDqkwDqkwDqkwDqkp9rgap9Abbbaradfgraaa8Fa8FpmxmPsxmPsxmPsxmPsp9rgap9Abbbaradfgraaa8LaypmwDKYqk8AExm35Ps8E8Fg8Faip:Rea8Falp:Sep9qg8Fp9rgap9Abbbaradfgraaa8Fa8Fpmlvorlvorlvorlvorp9rgap9Abbbaradfgraaa8Fa8FpmwDqkwDqkwDqkwDqkp9rgap9Abbbaradfgraaa8Fa8FpmxmPsxmPsxmPsxmPsp9rgap9Abbbaradfgraaa8Ja8KpmwKDYq8AkEx3m5P8Es8Fg8Ja8Ma8NpmwKDYq8AkEx3m5P8Es8Fg8KpmbezHdiOAlvCXorQLg8Faip:Rea8Falp:Sep9qg8Fp9rgap9Abbbaradfgraaa8Fa8Fpmlvorlvorlvorlvorp9rgap9Abbbaradfgraaa8Fa8FpmwDqkwDqkwDqkwDqkp9rgap9Abbbaradfgraaa8Fa8FpmxmPsxmPsxmPsxmPsp9rgap9Abbbaradfgraaa8Ja8KpmwDKYqk8AExm35Ps8E8Fg8Faip:Rea8Falp:Sep9qg8Fp9rgap9Abbbaradfgraaa8Fa8Fpmlvorlvorlvorlvorp9rgap9Abbbaradfgraaa8Fa8FpmwDqkwDqkwDqkwDqkp9rgap9Abbbaradfgraaa8Fa8FpmxmPsxmPsxmPsxmPsp9rgap9AbbbaradfhraoczfgoaQ6mbkka8Aclfg8Aad6mbkdnaCad2goTmbaOavcjdfao;8qbbkdnammbavavcjdfaCcufad2fad;8qbbkaCaHfhHc9:hoaAhPaAmbxlkkaeTmbaDalfhrcbhocuhlinaralaD9RglfaD6mdasaeao9Raoasfae6Eaofgoae6mbkaial9RhPkcbc99axaP9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaokwbz:bjjjbkNsezu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbavaiaqaDcsGfRbbgscl4gP9RcsGcdtfydbaxcefgOaPEhDavaias9RcsGcdtfydbaOaPTgzfgOascsGgPEhsaPThPdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiazfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaPfhiaOaPfhxxekaxcbalRbbgsEgHaDc;:eSgDfhOascsGhAdndnascl4gCmbaOcefhzxekaOhzavaiaC9RcsGcdtfydbhOkdndnaAmbazcefhxxekazhxavaias9RcsGcdtfydbhzkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhHascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaHhDxekaDcefhDkasce4cbasceG9R7amfgmhHkdndnaCcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhOaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkaOhsxekascefhskaPce4cbaPceG9R7amfgmhOkdndnaAcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhzaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkazhlxekalcefhlkaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabarcetfgDaH87ebaDclfaz87ebaDcdfaO87ebxekabarcdtfgDaHBdbaDcwfazBdbaDclfaOBdbkavc;abfaocitfgDaOBdbaDaHBdlavaicdtfaHBdbavc;abfaocefcsGcitfgDazBdbaDaOBdlavaicefgicsGcdtfaOBdbavc;abfaocdfcsGcitfgDaHBdbaDazBdlavaiaCTaCcsSVfgicsGcdtfazBdbaiaATaAcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk;Toio97eue97aec98Ghedndnadcl9hmbaeTmecbhdinababpbbbgicKp:RecKp:Sep;6eglaicwp:RecKp:Sep;6ealp;Geaiczp:RecKp:Sep;6egvp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgwp9op9rp;Keglpxbb;:9cbb;:9cbb;:9cbb;:9calalp;Meaoaop;Meavaravawp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFbbbFbbbFbbbFbbbp9oaipxbbbFbbbFbbbFbbbFp9op9qalavp;Mearp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaoavp;Mearp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgDaDpbbbgipxbbbbbbFFbbbbbbFFgwp9oabpbbbgoaipmbediwDqkzHOAKY8AEgvczp:Reczp:Sep;6eglaoaipmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eavczp:Sep;6egvp;Gealp;Gep;Kep;Legipxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgqp9op9rp;Keglpxb;:FSb;:FSb;:FSb;:FSalalp;Meaiaip;Meavaravaqp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbp9oaiavp;Mearp;Keczp:Rep9qgialavp;Mearp;KepxFFbbFFbbFFbbFFbbp9oglpmwDKYqk8AExm35Ps8E8Fp9qpkbbabaoawp9oaialpmbezHdiOAlvCXorQLp9qpkbbabcafhbadclfgdae6mbkkk;2ileue97euo97dnaec98GgiTmbcbheinabcKfpx:ji:1S:ji:1S:ji:1S:ji:1SabpbbbglabczfgvpbbbgopmlvorxmPsCXQL358E8Fgrczp:Segwpxibbbibbbibbbibbbp9qp;6egDp;NegqaDaDp;MegDaDp;KealaopmbediwDqkzHOAKY8AEgDczp:Reczp:Sep;6eglalp;MeaDczp:Sep;6egoaop;Mearczp:Reczp:Sep;6egrarp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jep;Mepxbbn0bbn0bbn0bbn0gDp;KepxFFbbFFbbFFbbFFbbgkp9oaqaop;MeaDp;Keczp:Rep9qgoaqalp;MeaDp;Keakp9oaqarp;MeaDp;Keczp:Rep9qgDpmwDKYqk8AExm35Ps8E8Fglp5eawclp:RegqpEi:T:j83ibavalp5baqpEd:T:j83ibabcwfaoaDpmbezHdiOAlvCXorQLgDp5eaqpEe:T:j83ibabaDp5baqpEb:T:j83ibabcafhbaeclfgeai6mbkkkuee97dnadcd4ae2c98GgeTmbcbhdinababpbbbgicwp:Recwp:Sep;6eaicep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbabczfhbadclfgdae6mbkkk:Sodw97euaec98Ghedndnadcl9hmbaeTmecbhdinabpxbbuJbbuJbbuJbbuJabpbbbgicKp:TeglaicYp:Tep9qgvcdp:Teavp9qgvclp:Teavp9qgop;6ep;Negvaicwp:RecKp:SegraipxFbbbFbbbFbbbFbbbgwp9ogDp:Uep;6ep;Mepxbbn0bbn0bbn0bbn0gqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9oavaDarp:Xeaiczp:RecKp:Segip:Uep;6ep;Meaqp;Keawp9op9qavaDaraip:Uep:Xep;6ep;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qavaoalcep:Rep9oalpxebbbebbbebbbebbbp9op9qp;6ep;Meaqp;KecKp:Rep9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgkpxbFu9hbFu9hbFu9hbFu9habpbbbglakpbbbgrpmlvorxmPsCXQL358E8Fgvczp:TegqavcHp:Tep9qgicdp:Teaip9qgiclp:Teaip9qgicwp:Teaip9qgop;6ep;NegialarpmbediwDqkzHOAKY8AEgDpxFFbbFFbbFFbbFFbbglp9ograDczp:Segwp:Ueavczp:Reczp:SegDp:Xep;6ep;Mepxbbn0bbn0bbn0bbn0gvp;Kealp9oaiarawaDp:Uep:Xep;6ep;Meavp;Keczp:Rep9qgwaiaoaqcep:Rep9oaqpxebbbebbbebbbebbbp9op9qp;6ep;Meavp;Keczp:ReaiaDarp:Uep;6ep;Meavp;Kealp9op9qgipmwDKYqk8AExm35Ps8E8FpkbbabawaipmbezHdiOAlvCXorQLpkbbabcafhbadclfgdae6mbkkk9teiucbcbydj:G:cjbgeabcifc98GfgbBdj:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkxebcj:Gdklz:zbb",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)?s(t):s(e),r,a=WebAssembly.instantiate(o,{}).then(function(C){r=C.instance,r.exports.__wasm_call_ctors()});function s(C){for(var E=new Uint8Array(C.length),b=0;b<C.length;++b){var x=C.charCodeAt(b);E[b]=x>96?x-97:x>64?x-39:x+4}for(var S=0,b=0;b<C.length;++b)E[S++]=E[b]<60?i[E[b]]:(E[b]-60)*64+E[++b];return E.buffer.slice(0,S)}function c(C,E,b,x,S,B,v){var P=C.exports.sbrk,N=x+3&-4,L=P(N*S),g=P(B.length),I=new Uint8Array(C.exports.memory.buffer);I.set(B,g);var T=E(L,x,S,g,B.length);if(T==0&&v&&v(L,N,S),b.set(I.subarray(L,L+x*S)),P(L-P(0)),T!=0)throw new Error("Malformed buffer data: "+T)}var u={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp",COLOR:"meshopt_decodeFilterColor"},f={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},h=[],p=0;function A(C){var E={object:new Worker(C),pending:0,requests:{}};return E.object.onmessage=function(b){var x=b.data;E.pending-=x.count,E.requests[x.id][x.action](x.value),delete E.requests[x.id]},E}function m(C){for(var E="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(o)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+y.name+";"+c.toString()+y.toString(),b=new Blob([E],{type:"text/javascript"}),x=URL.createObjectURL(b),S=h.length;S<C;++S)h[S]=A(x);for(var S=C;S<h.length;++S)h[S].object.postMessage({});h.length=C,URL.revokeObjectURL(x)}function _(C,E,b,x,S){for(var B=h[0],v=1;v<h.length;++v)h[v].pending<B.pending&&(B=h[v]);return new Promise(function(P,N){var L=new Uint8Array(b),g=++p;B.pending+=C,B.requests[g]={resolve:P,reject:N},B.object.postMessage({id:g,count:C,size:E,source:L,mode:x,filter:S},[L.buffer])})}function y(C){var E=C.data;if(!E.id)return self.close();self.ready.then(function(b){try{var x=new Uint8Array(E.count*E.size);c(b,b.exports[E.mode],x,E.count,E.size,E.source,b.exports[E.filter]),self.postMessage({id:E.id,count:E.count,action:"resolve",value:x},[x.buffer])}catch(S){self.postMessage({id:E.id,count:E.count,action:"reject",value:S})}})}return{ready:a,supported:!0,useWorkers:function(C){m(C)},decodeVertexBuffer:function(C,E,b,x,S){c(r,r.exports.meshopt_decodeVertexBuffer,C,E,b,x,r.exports[u[S]])},decodeIndexBuffer:function(C,E,b,x){c(r,r.exports.meshopt_decodeIndexBuffer,C,E,b,x)},decodeIndexSequence:function(C,E,b,x){c(r,r.exports.meshopt_decodeIndexSequence,C,E,b,x)},decodeGltfBuffer:function(C,E,b,x,S,B){c(r,r.exports[f[S]],C,E,b,x,r.exports[u[B]])},decodeGltfBufferAsync:function(C,E,b,x,S){return h.length>0?_(C,E,b,f[x],u[S]):a.then(function(){var B=new Uint8Array(C*E);return c(r,r.exports[f[x]],B,C,E,b,r.exports[u[S]]),B})}}})();var Nfn=(function(){var e="b9H79Tebbbe:6eO9Geueu9Geub9Gbb9Gsuuuuuuuuuuuu99uueu9Gvuuuuub9Gruuuuuuub9Gouuuuuue999Gvuuuuueu9Gzuuuuuuuuuuu99uuuub9Gquuuuuuu99uueu9GPuuuuuuuuuuu99uueu9Gquuuuuuuu99ueu9Gruuuuuu99eu9Gwuuuuuu99ueu9Giuuue999Gluuuueu9Gluuuub9GiuuueuiLQdilvorlwDiqkxmPszbHHbelve9Weiiviebeoweuecj:Gdkr:Bdxo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95bw8E9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9OcttV9P9I91tW7bD8A9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9O9v9W9K9HtWbqQ9TW79O9V9Wt9F79P9T9W29P9M959t29V9W9W95bkX9TW79O9V9Wt9F79P9T9W29P9M959qV919UWbxQ9TW79O9V9Wt9F79P9T9W29P9M959q9V9P9Ut7bmX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2WbPa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbs59TW79O9V9Wt9F9NW9UWV9HtW9q9V79Pt9P9V9U9sW9T9H9Wbzl79IV9RbHDwebcekdCXq;y;WeQdbk;r:herYue99iuY99Xue9:D998Jjjjjbcj;sb9Rgs8Kjjjjbcbhzasc:Cefcbc;Kbz:tjjjb8AdnabaeSmbabaeadcdtzMjjjb8AkdnamcdGTmbalcrfci4cbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egecdtfaHBdbasaecefBd;8ecbhlcbhednadTmbabheadhOinaHaeydbci4fcb86bbaeclfheaOcufgOmbkcbhlabheadhOinaHaeydbgAci4fgCaCRbbgCceaAcrGgAtV86bbaCcu7aA4ceGalfhlaeclfheaOcufgOmbkcualcdtalcFFFFi0Ehekaecbyd1:H:cjbHjjjjbbhzasc:Cefasyd;8egecdtfazBdbasaecefBd;8ealcd4alfhOcehHinaHgecethHaeaO6mbkcbhXcuaecdtgOaecFFFFi0Ecbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egAcdtfaHBdbasaAcefBd;8eaHcFeaOz:tjjjbhQdnadTmbaecufhLcbhKindndnaQabaKcdtfgYydbgAc:v;t;h;Ev2aLGgOcdtfgCydbgHcuSmbceheinazaHcdtfydbaASmdaOaefhHaecefheaQaHaLGgOcdtfgCydbgHcu9hmbkkazaXcdtfaABdbaCaXBdbaXhHaXcefhXkaYaHBdbaKcefgKad9hmbkkaQcbyd:m:H:cjbH:bjjjbbasasyd;8ecufBd;8ekcbh8AcualcefgecdtaecFFFFi0Ecbyd1:H:cjbHjjjjbbhLasc:Cefasyd;8egecdtfaLBdbasaLBdNeasaecefBd;8ecuadcitadcFFFFe0Ecbyd1:H:cjbHjjjjbbhEasc:Cefasyd;8egecdtfaEBdbasaEBd:yeasaecefBd;8eascNefabadalcbz:cjjjbcualcdtgealcFFFFi0Eg3cbyd1:H:cjbHjjjjbbhOasc:Cefasyd;8egHcdtfaOBdbasaHcefBd;8ea3cbyd1:H:cjbHjjjjbbhQasc:Cefasyd;8egHcdtfaQBdbasaHcefBd;8eaOaQaialavazasc:Cefz:djjjbalcbyd1:H:cjbHjjjjbbhYasc:Cefasyd;8egHcdtfaYBdbasaHcefBd;8ea3cbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egAcdtfaHBdbasaAcefBd;8ea3cbyd1:H:cjbHjjjjbbhAasc:Cefasyd;8egCcdtfaABdbasaCcefBd;8eaHcFeaez:tjjjbh5aAcFeaez:tjjjbh8EdnalTmbindnaLa8AgAcefg8AcdtfydbgCaLaAcdtgefydbgHSmbaCaH9Rh8FaEaHcitfhaa8Eaefhha5aefhKcbhCindndnaaaCcitfydbgXaA9hmbaKaABdbahaABdbxekdnaLaXcdtggfgeclfydbgHaeydbgeSmbaHae9RhHaEaecitfheinaeydbaASmdaecwfheaHcufgHmbkka8EagfgeaAaXaeydbcuSEBdbaKaXaAaKydbcuSEBdbkaCcefgCa8F9hmbkka8Aal9hmbkaOhHaQhAa5hXa8EhCcbheindndnaeaHydbgK9hmbdnaeaAydbgK9hmbaXydbhKdnaCydbg8Fcu9hmbaKcu9hmbaYaefcb86bbxikdna8FcuSmbaKcuSmbaea8FSmbaOa8FcdtfydbaOaKcdtfydb9hmbaYaefcd86bbxikaYaefhadnaea8FSmbaeaKSmbaace86bbxikaacl86bbxdkdnaeaQaKcdtg8Ffydb9hmbdnaCydbgacuSmbaeaaSmbaXydbggcuSmbaeagSmba8Ea8FfydbghcuSmbahaKSmba5a8Ffydbg8FcuSmba8FaKSmbdnaOaacdtfydbgKaOa8Fcdtfydb9hmbaKaOagcdtfydbg8FSmba8FaOahcdtfydb9hmbaYaefcd86bbxlkaYaefcl86bbxikaYaefcl86bbxdkaYaefcl86bbxekaYaefaYaKfRbb86bbkaHclfhHaAclfhAaXclfhXaCclfhCalaecefge9hmbkdnamcaGTmbcbh8JindndnaYa8Jfg8KRbbg8Lc9:fPibebekdndndnaOa8Jcdtfydbgea8J9hmbdnaqmbcbh8FxdkdnazTmbcbh8Fa8JheinaqazaecdtgefydbfRbbce4a8FVceGh8FaQaefydbgea8J9hmbxikkcbh8Fa8JheinaqaefRbbce4a8FVceGh8FaQaecdtfydbgea8J9hmbxdkkaYaefRbbhexeka8JheindnaLaecdtg8AfgeclfydbgHaeydbgeSmbaHae9RhgaEaecitfhhaOa8AfhacbhKinahaKcitfydbgXhednindnaLaecdtgCfgeclfydbgHaeydbgeSmbaHae9RhHaEaecitfheaaydbhAdninaOaeydbcdtfydbaASmeaecwfheaHcufgHTmdxbkkcbhexdkaQaCfydbgeaX9hmbkceheka8FaeVh8FaKcefgKag9hmbkkaQa8Afydbgea8J9hmbka8Lcia8FceGEheka8Kae86bbka8Jcefg8Jal9hmbkkdnaqTmbdndnazTmbazheaOhHalhAindnaqaeydbfRbbceGTmbaYaHydbfcl86bbkaeclfheaHclfhHaAcufgAmbxdkkaqheaOhHalhAindnaeRbbceGTmbaYaHydbfcl86bbkaecefheaHclfhHaAcufgAmbkkaOhealhAaYhHindnaYaeydbfRbbcl9hmbaHcl86bbkaeclfheaHcefhHaAcufgAmbkkamceGTmbaYhealhHindnaeRbbce9hmbaecl86bbkaecefheaHcufgHmbkkcbh8Mcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbh8Nasc:Cefasyd;8egecdtfa8NBdbasaecefBd;8eascbBd:qeas9cb83i1ea8Naialavazasc1efz:ejjjbhydndnaDmbcbh8PcbhCxekcbhCawhecbhHindnaeIdbJbbbb9ETmbasaCcdtfaHBdbaCcefhCkaeclfheaDaHcefgH9hmbkcuaCal2gecdtaecFFFFi0Ecbyd1:H:cjbHjjjjbbh8Pasc:Cefasyd;8egecdtfa8PBdbasaecefBd;8ealTmbdnaCmbcbhCxekarcd4hgdnazTmbaCcdthhcbh8Fa8Phainaoaza8Fcdtfydbag2cdtfhKasheaahHaChAinaHaKaeydbcdtgXfIdbawaXfIdbNUdbaeclfheaHclfhHaAcufgAmbkaaahfhaa8Fcefg8Fal9hmbxdkkaCcdthhcbh8Fa8Phainaoa8Fag2cdtfhKasheaahHaChAinaHaKaeydbcdtgXfIdbawaXfIdbNUdbaeclfheaHclfhHaAcufgAmbkaaahfhaa8Fcefg8Fal9hmbkkcualc8S2gHalc;D;O;f8U0EgXcbyd1:H:cjbHjjjjbbheasc:Cefasyd;8egAcdtfaeBdbasaAcefBd;8eaecbaHz:tjjjbhIcbh8RcbhgdnaCTmbcbh8MaXcbyd1:H:cjbHjjjjbbhgasc:Cefasyd;8egecdtfagBdbasaecefBd;8eagcbaHz:tjjjb8AcuaCal2gecltgHaecFFFFb0Ecbyd1:H:cjbHjjjjbbh8Rasc:Cefasyd;8egecdtfa8RBdbasaecefBd;8ea8RcbaHz:tjjjb8AamcjjjjdGTmbcualcltgealcFFFFb0Ecbyd1:H:cjbHjjjjbbh8Masc:Cefasyd;8egHcdtfa8MBdbasaHcefBd;8ea8Mcbaez:tjjjb8AkdnadTmbcbhKabhHina8NaHclfydbg8Fcx2fgeIdba8NaHydbgacx2fgAIdbg8S:tgRa8NaHcwfydbghcx2fgXIdlaAIdlg8U:tg8VNaeIdla8U:tg8WaXIdba8S:tg8XN:tg8Ya8YNa8WaXIdwaAIdwg8Z:tg80NaeIdwa8Z:tg8Wa8VN:tg81a81Na8Wa8XNaRa80N:tg80a80NMMg8V:rhBa8Yh8Xa80h8Wa81hRdna8VJbbbb9EgATmba8YaB:vh8Xa80aB:vh8Wa81aB:vhRkaIaOaacdtfydbgXc8S2fgeaRaB:rg8VaRNNg83aeIdbMUdbaea8Wa8Va8WNgUNg85aeIdlMUdlaea8Xa8Va8XNg86Ng87aeIdwMUdwaeaRaUNgUaeIdxMUdxaea86aRNg88aeIdzMUdzaea8Wa86Ng89aeIdCMUdCaeaRa8Va8Xa8ZNaRa8SNa8Ua8WNMM:mg8:Ng86NgRaeIdKMUdKaea8Wa86Ng8WaeId3MUd3aea8Xa86Ng8XaeIdaMUdaaea86a8:Ng86aeId8KMUd8Kaea8VaeIdyMUdyaIaOa8Fcdtfydbg8Fc8S2fgea83aeIdbMUdbaea85aeIdlMUdlaea87aeIdwMUdwaeaUaeIdxMUdxaea88aeIdzMUdzaea89aeIdCMUdCaeaRaeIdKMUdKaea8WaeId3MUd3aea8XaeIdaMUdaaea86aeId8KMUd8Kaea8VaeIdyMUdyaIaOahcdtfydbgac8S2fgea83aeIdbMUdbaea85aeIdlMUdlaea87aeIdwMUdwaeaUaeIdxMUdxaea88aeIdzMUdzaea89aeIdCMUdCaeaRaeIdKMUdKaea8WaeId3MUd3aea8XaeIdaMUdaaea86aeId8KMUd8Kaea8VaeIdyMUdydna8MTmbdnaATmba8YaB:vh8Ya80aB:vh80a81aB:vh81ka8MaXcltfgeaBJbbbZNgRa80Ng8VaeIdlMUdlaeaRa8YNg8WaeIdwMUdwaeaRa81Ng8XaeIdbMUdbaeaRa8S:ma81Na8Ua80N:ta8Za8YN:tNgRaeIdxMUdxa8Ma8Fcltfgea8VaeIdlMUdlaea8WaeIdwMUdwaea8XaeIdbMUdbaeaRaeIdxMUdxa8Maacltfgea8VaeIdlMUdlaea8WaeIdwMUdwaea8XaeIdbMUdbaeaRaeIdxMUdxkaHcxfhHaKcifgKad6mbkkdnalTmbJq;x8J88J;n;m;m89J:v:;;w8ZamczGEamc;abGEh80cbhHaOhXazhKaIhea8NhAindnaHaXydb9hmbaHh8FdnazTmbaKydbh8Fka80hRdnaqTmbJbbjZa80aqa8FfRbbclGEhRkaecxfg8Fa8FIdbJbbbbMUdbaeczfg8Fa8FIdbJbbbbMUdbaecCfg8Fa8FIdbJbbbbMUdbaeaRaecyfg8FIdbg8YNgRaeIdbMUdbaeclfgaaRaaIdbMUdbaecwfgaaRaaIdbMUdbaecKfgaaaIdbaAIdbg8WaRN:tUdbaAcwfIdbh8Vaec3fgaaaIdbaRaAclfIdbg8XN:tUdbaecafgaaaIdbaRa8VN:tUdbaec8KfgaIdbh81a8Fa8YaRMUdbaaa81aRa8Va8VNa8Wa8WNa8Xa8XNMMNMUdbkaXclfhXaKclfhKaec8SfheaAcxfhAalaHcefgH9hmbkkdnadTmbcbh8Aabhainaba8Acdtfh8FcbhHinaYa8FaHc:G:G:cjbfydbcdtfydbgAfRbbhedndnaYaaaHfydbgXfRbbgKc99fcFeGcpe0mbaec99fcFeGc;:e6mekdnaKcufcFeGce0mba5aXcdtfydbaA9hmekdnaecufcFeGce0mba8EaAcdtfydbaX9hmekJbbacJbbacJbbbZaecFeGceSEaKcFeGceSEhUdna8Na8FaHc:K:G:cjbfydbcdtfydbcx2fgeIdwa8NaXcx2fgKIdwg86:tg8Sa8NaAcx2fghIdwa86:tg8Xa8XNahIdbaKIdbg8U:tg80a80NahIdlaKIdlg8Z:tg8Va8VNMMg81Na8Xa8Sa8XNaeIdba8U:tg83a80Na8VaeIdla8Z:tg85NMMg8WN:tg8Ya8YNa83a81Na80a8WN:tgRaRNa85a81Na8Va8WN:tg8Wa8WNMMgBJbbbb9ETmba8YaB:rgB:vh8Ya8WaB:vh8WaRaB:vhRkaUa81:rNgBa8Ya86NaRa8UNa8Za8WNMM:mg81Ng87a81Nh88a80a85Na8Va83N:tg81a81Na8Va8SNa8Xa85N:tg8Va8VNa8Xa83Na80a8SN:tg8Xa8XNMMg83:rh80a8Ya87Nh85a8Wa87Nh89aRa87Nh87a8WaBa8YNg8SNh8:a8SaRNhZaRaBa8WNgnNhca8Ya8SNh8Ya8WanNh8WaRaBaRNNh8Sdna83Jbbbb9ETmba81a80:vh81a8Xa80:vh8Xa8Va80:vh8VkaIaOaXcdtfydbc8S2fgeaeIdba8Sa8VaUa80:rNgRa8VNNMg80MUdbaea8Wa8XaRa8XNg8SNMg83aeIdlMUdlaea8Ya81aRa81Ng8WNMg8YaeIdwMUdwaeaca8Va8SNMg8SaeIdxMUdxaeaZa8Wa8VNMgUaeIdzMUdzaea8:a8Xa8WNMg8WaeIdCMUdCaea87a8VaRa81a86Na8Va8UNa8Za8XNMMg86:mNgRNMg8VaeIdKMUdKaea89a8XaRNMg8XaeId3MUd3aea85a81aRNMg81aeIdaMUdaaea88a86aRN:tgRaeId8KMUd8KaeaBaeIdyMUdyaIaOaAcdtfydbc8S2fgea80aeIdbMUdbaea83aeIdlMUdlaea8YaeIdwMUdwaea8SaeIdxMUdxaeaUaeIdzMUdzaea8WaeIdCMUdCaea8VaeIdKMUdKaea8XaeId3MUd3aea81aeIdaMUdaaeaRaeId8KMUd8KaeaBaeIdyMUdykaHclfgHcx9hmbkaacxfhaa8Acifg8Aad6mbkaCTmbcbhainJbbbbh80a8Nabaacdtfgeclfydbg8Fcx2fgHIdwa8Naeydbghcx2fgAIdwg8Z:tg8Va8VNaHIdbaAIdbg83:tg8Wa8WNaHIdlaAIdlg85:tg8Xa8XNMMg8Sa8Naecwfydbg8Acx2fgeIdwa8Z:tg8YNa8Va8YNa8WaeIdba83:tg81Na8XaeIdla85:tgBNMMgRa8VN:tJbbbbJbbjZa8Sa8Ya8YNa81a81NaBaBNMMg8UNaRaRN:tg86:va86Jbbbb9BEg86Nh88a8Ua8VNaRa8YN:ta86Nh89a8SaBNaRa8XN:ta86Nh8:a8Ua8XNaRaBN:ta86NhZa8Sa81NaRa8WN:ta86Nhna8Ua8WNaRa81N:ta86Nhca8WaBNa8Xa81N:tgRaRNa8Xa8YNa8VaBN:tgRaRNa8Va81Na8Wa8YN:tgRaRNMM:rJbbbZNhRa8PahaC2g8JcdtfhHa8Pa8AaC2gDcdtfhAa8Pa8FaC2g8KcdtfhXa8Z:mh9ca85:mhJa83:mh9eascjdfheaChKJbbbbhBJbbbbh86Jbbbbh8SJbbbbh8UJbbbbh8ZJbbbbh83Jbbbbh85Jbbbbh87JbbbbhUinaecwfaRa89aXIdbaHIdbg8Y:tg8XNa88aAIdba8Y:tg81NMg8VNUdbaeclfaRaZa8XNa8:a81NMg8WNUdbaeaRaca8XNana81NMg8XNUdbaecxfaRa9ca8VNaJa8WNa8Ya9ea8XNMMMg8YNUdbaRa8Va8WNNa8ZMh8ZaRa8Va8XNNa8UMh8UaRa8Wa8XNNa8SMh8SaRa8Ya8YNNaUMhUaRa8Va8YNNa87Mh87aRa8Wa8YNNa85Mh85aRa8Xa8YNNa83Mh83aRa8Va8VNNa86Mh86aRa8Wa8WNNaBMhBaRa8Xa8XNNa80Mh80aHclfhHaXclfhXaAclfhAaeczfheaKcufgKmbkagahc8S2fgea80aeIdbMUdbaeaBaeIdlMUdlaea86aeIdwMUdwaea8SaeIdxMUdxaea8UaeIdzMUdzaea8ZaeIdCMUdCaea83aeIdKMUdKaea85aeId3MUd3aea87aeIdaMUdaaeaUaeId8KMUd8KaeaRaeIdyMUdyaga8Fc8S2fgea80aeIdbMUdbaeaBaeIdlMUdlaea86aeIdwMUdwaea8SaeIdxMUdxaea8UaeIdzMUdzaea8ZaeIdCMUdCaea83aeIdKMUdKaea85aeId3MUd3aea87aeIdaMUdaaeaUaeId8KMUd8KaeaRaeIdyMUdyaga8Ac8S2fgea80aeIdbMUdbaeaBaeIdlMUdlaea86aeIdwMUdwaea8SaeIdxMUdxaea8UaeIdzMUdzaea8ZaeIdCMUdCaea83aeIdKMUdKaea85aeId3MUd3aea87aeIdaMUdaaeaUaeId8KMUd8KaeaRaeIdyMUdya8Ra8Jcltfh8FcbhHaChXina8FaHfgeascjdfaHfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbka8Ra8Kcltfh8FcbhHaChXina8FaHfgeascjdfaHfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbka8RaDcltfh8FcbhHaChXina8FaHfgeascjdfaHfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbkaacifgaad6mbkkcbhAdndnamcwGgTmbJbbbbh8ScbhScbh9hcbh9ixekcbhSa3cbyd1:H:cjbHjjjjbbh9iasc:Cefasyd;8egecdtfa9iBdbasaecefBd;8ecua9ialabadaOz:fjjjbgXcltaXcjjjjiGEcbyd1:H:cjbHjjjjbbh9hasc:Cefasyd;8egecdtfa9hBdbasaecefBd;8ea9haXa9ia8Nalz:gjjjbJFFuuh8SaXTmba9hheaXhHinaeIdbgRa8Sa8SaR9EEh8SaeclfheaHcufgHmbkaXhSkdnalTmbaLclfheaLydbhXaYhHalhKcbhAincbaeydbg8FaX9RaHRbbcpeGEaAfhAaHcefhHaeclfhea8FhXaKcufgKmbkaAce4hAkcuadaA9Rcifg6cx2a6c;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbh9kasc:Cefasyd;8egecdtfa9kBdbasaecefBd;8ecua6cdta6cFFFFi0Ecbyd1:H:cjbHjjjjbbh0asc:Cefasyd;8egecdtfa0BdbasaecefBd;8ea3cbyd1:H:cjbHjjjjbbh9masc:Cefasyd;8egecdtfa9mBdbasaecefBd;8ealcbyd1:H:cjbHjjjjbbh9nasc:Cefasyd;8egecdtfa9nBdbasaecefBd;8eaxaxNayJbbjZamclGEgZaZN:vh87JbbbbhUdnadak9nmbdna6ci6mbaCclth9oa9kcwfh9pJbbbbh85JbbbbhUinascNefabadalaOz:cjjjbabh8Acbh9qcbh9rinaba9rcdtfhDcbheindnaOa8AaefydbgAcdtghfydbgXaOaDaec:W:G:cjbfydbcdtfydbgHcdtg8JfydbgKSmbaYaHfRbbgacv2aYaAfRbbg8FfRb;a:G:cjbg8La8Fcv2aafg8KRb;a:G:cjbg3VcFeGTmbdnaKaX9nmba8KRb;G:G:cjbcFeGmekdna8FcufcFeGce0mbaaTmba5ahfydbaH9hmekdna8FTmbaacufcFeGce0mba8Ea8JfydbaA9hmeka9ka9qcx2fgXaHaAa3cFeGgKEBdlaXaAaHaKEBdbaXaKa8LGcb9hBdwa9qcefh9qkaeclfgecx9hmbkdna9rcifg9rad9pmba8Acxfh8Aa9qcifa69nmekka9qTmdcbh8KinaIaOa9ka8Kcx2fghydbgKcdtgXfydbg8Ac8S2fgeIdwa8Nahydlg8Fcx2fgHIdwg8WNaeIdzaHIdbg8XNaeIdaMgRaRMMa8WNaeIdlaHIdlg8YNaeIdCa8WNaeId3MgRaRMMa8YNaeIdba8XNaeIdxa8YNaeIdKMgRaRMMa8XNaeId8KMMM:lhRJbbbbJbbjZaeIdyg8V:va8VJbbbb9BEh8VdndnahydwgDmbJFFuuh86xekJbbbbJbbjZaIaOa8Fcdtfydbc8S2fgeIdyg81:va81Jbbbb9BEaeIdwa8NaKcx2fgHIdwg81NaeIdzaHIdbg80NaeIdaMgBaBMMa81NaeIdlaHIdlgBNaeIdCa81NaeId3Mg81a81MMaBNaeIdba80NaeIdxaBNaeIdKMg81a81MMa80NaeId8KMMM:lNh86ka8VaRNhBdnaCTmbagaKc8S2fgAIdwa8WNaAIdza8XNaAIdaMgRaRMMa8WNaAIdla8YNaAIdCa8WNaAId3MgRaRMMa8YNaAIdba8XNaAIdxa8YNaAIdKMgRaRMMa8XNaAId8KMMMhRa8Pa8FaC2gacdtfhHa8RaKaC2g8JcltfheaAIdyh81aChAinaHIdbg8Va8Va81NaecxfIdba8WaecwfIdbNa8XaeIdbNa8YaeclfIdbNMMMg8Va8VM:tNaRMhRaHclfhHaeczfheaAcufgAmbkdndnaDmbJbbbbh8Vxekaga8Fc8S2fgAIdwa8NaKcx2fgeIdwg8XNaAIdzaeIdbg8YNaAIdaMg8Va8VMMa8XNaAIdlaeIdlg81NaAIdCa8XNaAId3Mg8Va8VMMa81NaAIdba8YNaAIdxa81NaAIdKMg8Va8VMMa8YNaAId8KMMMh8Va8Pa8JcdtfhHa8RaacltfheaAIdyh80aChAinaHIdbg8Wa8Wa80NaecxfIdba8XaecwfIdbNa8YaeIdbNa81aeclfIdbNMMMg8Wa8WM:tNa8VMh8VaHclfhHaeczfheaAcufgAmbka8V:lh8VkaBaR:lMhBa86a8VMh86dndndnaYaKfRbbc9:fPddbekaQaXfydbgXaKSmbaOa8Fcdtfydbh8Jindndna5aXcdtgafydbgecuSmbaOaecdtfydba8JSmekdna8EaafydbgecuSmbaOaecdtfydba8JSmeka8FhekagaXc8S2fgAIdwa8Naecx2fgHIdwg8WNaAIdzaHIdbg8XNaAIdaMgRaRMMa8WNaAIdlaHIdlg8YNaAIdCa8WNaAId3MgRaRMMa8YNaAIdba8XNaAIdxa8YNaAIdKMgRaRMMa8XNaAId8KMMMhRa8PaeaC2cdtfhHa8RaXaC2cltfheaAIdyh81aChAinaHIdbg8Va8Va81NaecxfIdba8WaecwfIdbNa8XaeIdbNa8YaeclfIdbNMMMg8Va8VM:tNaRMhRaHclfhHaeczfheaAcufgAmbkaBaR:lMhBaQaafydbgXaK9hmbkkaYa8FfRbbci9hmeaDTmeaQa8FcdtfydbgXa8FSmeindndna5aXcdtgafydbgecuSmbaOaecdtfydba8ASmekdna8EaafydbgecuSmbaOaecdtfydba8ASmekaKhekagaXc8S2fgAIdwa8Naecx2fgHIdwg8WNaAIdzaHIdbg8XNaAIdaMgRaRMMa8WNaAIdlaHIdlg8YNaAIdCa8WNaAId3MgRaRMMa8YNaAIdba8XNaAIdxa8YNaAIdKMgRaRMMa8XNaAId8KMMMhRa8PaeaC2cdtfhHa8RaXaC2cltfheaAIdyh81aChAinaHIdbg8Va8Va81NaecxfIdba8WaecwfIdbNa8XaeIdbNa8YaeclfIdbNMMMg8Va8VM:tNaRMhRaHclfhHaeczfheaAcufgAmbka86aR:lMh86aQaafydbgXa8F9hmbxdkkdna8Ea5a5aXfydba8FSEaQaXfydbgacdtfydbgXcu9hmbaQa8FcdtfydbhXkagaac8S2fgAIdwa8NaXcx2fgeIdwg8WNaAIdzaeIdbg8XNaAIdaMgRaRMMa8WNaAIdlaeIdlg8YNaAIdCa8WNaAId3MgRaRMMa8YNaAIdba8XNaAIdxa8YNaAIdKMgRaRMMa8XNaAId8KMMMhRa8PaXaC2g8AcdtfhHa8RaaaC2g8JcltfheaAIdyh81aChAinaHIdbg8Va8Va81NaecxfIdba8WaecwfIdbNa8XaeIdbNa8YaeclfIdbNMMMg8Va8VM:tNaRMhRaHclfhHaeczfheaAcufgAmbkdndnaDmbJbbbbh8VxekagaXc8S2fgAIdwa8Naacx2fgeIdwg8XNaAIdzaeIdbg8YNaAIdaMg8Va8VMMa8XNaAIdlaeIdlg81NaAIdCa8XNaAId3Mg8Va8VMMa81NaAIdba8YNaAIdxa81NaAIdKMg8Va8VMMa8YNaAId8KMMMh8Va8Pa8JcdtfhHa8Ra8AcltfheaAIdyh80aChAinaHIdbg8Wa8Wa80NaecxfIdba8XaecwfIdbNa8YaeIdbNa81aeclfIdbNMMMg8Wa8WM:tNa8VMh8VaHclfhHaeczfheaAcufgAmbka8V:lh8VkaBaR:lMhBa86a8VMh86kaha86aBa86aB9DgeEUdwahaKa8FaeaDcb9hGgeEBdlaha8FaKaeEBdba8Kcefg8Ka9q9hmbkascjdfcbcj;qbz:tjjjb8Aa9phea9qhHinascjdfaeydbcA4cF8FGgAcFAaAcFA6EcdtfgAaAydbcefBdbaecxfheaHcufgHmbkcbhecbhHinascjdfaefgAydbhXaAaHBdbaXaHfhHaeclfgecj;qb9hmbkcbhea9phHinascjdfaHydbcA4cF8FGgAcFAaAcFA6EcdtfgAaAydbgAcefBdba0aAcdtfaeBdbaHcxfhHa9qaecefge9hmbkadak9RgAci9Uh9sdnalTmbcbhea9mhHinaHaeBdbaHclfhHalaecefge9hmbkkcbh9ta9ncbalz:tjjjbh3aAcO9Uh9ua9sce4h9rcbh8Lcbh8Kdnina9ka0a8Kcdtfydbcx2fg8JIdwgRa879Emea8La9s9pmeJFFuuh8Vdna9ra9q9pmba9ka0a9rcdtfydbcx2fIdwJbb;aZNh8VkdnaRa8V9ETmbaRaU9ETmba8La9u0mdkdna3aOa8JydlgDcdtg9vfg8AydbgAfg9wRbba3aOa8Jydbghcdtg9xfydbgefg9yRbbVmbaYahfRbbh9zdndnaLaecdtfgHclfydbgXaHydbgHSmbaXaH9RhXa8NaAcx2fh8Fa8Naecx2fhaaEaHcitfheindna9maeydbcdtfydbgHaASmba9maeclfydbcdtfydbgKaASmbaHaKSmba8NaKcx2fgKIdba8NaHcx2fgHIdbg8W:tgRaaIdlaHIdlg8X:tg80NaKIdla8X:tg8VaaIdba8W:tgBN:tg8YaRa8FIdla8X:tg86Na8Va8FIdba8W:tg8UN:tg8XNa8VaaIdwaHIdwg81:tg8ZNaKIdwa81:tg8Wa80N:tg80a8Va8FIdwa81:tg83Na8Wa86N:tg8VNa8WaBNaRa8ZN:tg81a8Wa8UNaRa83N:tgRNMMa8Ya8YNa80a80Na81a81NMMa8Xa8XNa8Va8VNaRaRNMMN:rJbbj8:N9FmikaecwfheaXcufgXmbkkdndndndna9zc9:fPdebdkahheina8AydbhAdndna5aecdtgHfydbgecuSmbaOaecdtfydbaASmekdna8EaHfydbgecuSmbaOaecdtfydbaASmekaDheka9maHfaeBdbaQaHfydbgeah9hmbxikkdna8Ea5a5a9xfydbaDSEaQa9xfydbghcdtfydbgecu9hmbaQa9vfydbheka9ma9xfaDBdbaehDka9mahcdtfaDBdbka9yce86bba9wce86bba8JIdwgRaUaUaR9DEhUa9tcefh9tcecda9zceSEa8Lfh8Lxeka9rcefh9rka8Kcefg8Ka9q9hmbkka9tTmddnalTmbcbh8Fcbhhindna9mahcdtgefydbgAahSmbaOaAcdtfydbh8AdnahaOaefydb9hg8JmbaIa8Ac8S2fgeaIahc8S2fgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxaeaHIdzaeIdzMUdzaeaHIdCaeIdCMUdCaeaHIdKaeIdKMUdKaeaHId3aeId3MUd3aeaHIdaaeIdaMUdaaeaHId8KaeId8KMUd8KaeaHIdyaeIdyMUdya8MTmba8Ma8Acltfgea8MahcltfgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxkaCTmbagaAc8S2fgeagahc8S2gDfgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxaeaHIdzaeIdzMUdzaeaHIdCaeIdCMUdCaeaHIdKaeIdKMUdKaeaHId3aeId3MUd3aeaHIdaaeIdaMUdaaeaHId8KaeId8KMUd8KaeaHIdyaeIdyMUdya9oaA2haa8RhHaChXinaHaafgeaHa8FfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbka8JmbJbbbbJbbjZaIaDfgeIdygR:vaRJbbbb9BEaeIdwa8Na8Acx2fgHIdwgRNaeIdzaHIdbg8VNaeIdaMg8Wa8WMMaRNaeIdlaHIdlg8WNaeIdCaRNaeId3MgRaRMMa8WNaeIdba8VNaeIdxa8WNaeIdKMgRaRMMa8VNaeId8KMMM:lNgRa85a85aR9DEh85ka8Fa9ofh8Fahcefghal9hmbkcbhHa5heindnaeydbgAcuSmbdnaHa9maAcdtgXfydbgA9hmbcuhAa5aXfydbgXcuSmba9maXcdtfydbhAkaeaABdbkaeclfhealaHcefgH9hmbkcbhHa8EheindnaeydbgAcuSmbdnaHa9maAcdtgXfydbgA9hmbcuhAa8EaXfydbgXcuSmba9maXcdtfydbhAkaeaABdbkaeclfhealaHcefgH9hmbkka85aUaCEh85cbhHabhecbhAindnaOa9maeydbcdtfydbg8FcdtfydbgXaOa9maeclfydbcdtfydbgacdtfydbgKSmbaXaOa9maecwfydbcdtfydbg8AcdtfydbghSmbaKahSmbabaHcdtfgXa8FBdbaXcwfa8ABdbaXclfaaBdbaHcifhHkaecxfheaAcifgAad6mbkdndnaTmbaHhdxekdnaHak0mbaHhdxekdna8Sa859FmbaHhdxekJFFuuh8ScbhdabhecbhAindna9ha9iaeydbgXcdtfydbcdtfIdbgRa859ETmbaeclf8Pdbh9AabadcdtfgKaXBdbaKclfa9A83dbaRa8Sa8SaR9EEh8SadcifhdkaecxfheaAcifgAaH6mbkkadak0mbxdkkascNefabadalaOz:cjjjbkdndnadak0mbadhaxekdnaTmbadhaxekdna8Sa879FmbadhaxekcehKina8SJbb;aZNgRa87aRa879DEh8WJbbbbhRdnaSTmba9hheaShHinaeIdbg8VaRa8Va8W9FEaRa8VaR9EEhRaeclfheaHcufgHmbkkJFFuuh8ScbhaabhecbhHindna9ha9iaeydbgAcdtfydbcdtfIdbg8Va8W9ETmbaeclf8Pdbh9AabaacdtfgXaABdbaXclfa9A83dba8Va8Sa8Sa8V9EEh8SaacifhakaecxfheaHcifgHad6mbkdnaKaaad9hVceGmbadhaxdkaRaUaUaR9DEhUaaak9nmecbhKaahda8Sa879FmbkkdnamcjjjjdGTmba9ncbalz:tjjjbh8AdnaaTmbabheaahHina8AaeydbgAfce86bba8AaOaAcdtfydbfce86bbaeclfheaHcufgHmbkkascNefabaaalaOz:cjjjbdndnalTmbcbhXindna8AaXfRbbTmbdnaYaXfRbbgecl0mbceaetcQGmekdnaOaXcdtg8FfydbgeaXSmba8NaXcx2fgHa8Naecx2fgeydwBdwaHae8Pdb83dbxekaIaXc8S2fgKIdygcacJL:3;rUNgRMh87aKIdwg9BaRMh8SaKIdlg9CaRMh8UaKIdbg9DaRMh81aKIdag9EaRa8NaXcx2fg8JIdwg88N:th8ZaKId3g9FaRa8JIdlg89N:th83aKIdKg9Ga8JIdbg8:aRN:th80JbbbbhnaKIdCg9HJbbbbMh85aKIdzg9IJbbbbMhBaKIdxg9JJbbbbMh86dndnaCTmbaXhAinJbbbba87agaAc8S2fgHIdygR:vaRJbbbb9BEhRa8RaAaC2cltfheaHIdaa87Na8ZMh8ZaHId3a87Na83Mh83aHIdKa87Na80Mh80aHIdCa87Na85Mh85aHIdza87NaBMhBaHIdxa87Na86Mh86aHIdwa87Na8SMh8SaHIdla87Na8UMh8UaHIdba87Na81Mh81aChHina8ZaecwfIdbg8VaecxfIdbg8YNaRN:th8Za83aeclfIdbg8Wa8YNaRN:th83a85a8Wa8VNaRN:th85a81aeIdbg8Xa8XNaRN:th81a80a8Xa8YNaRN:th80aBa8Xa8VNaRN:thBa86a8Xa8WNaRN:th86a8Sa8Va8VNaRN:th8Sa8Ua8Wa8WNaRN:th8UaeczfheaHcufgHmbkaQaAcdtfydbgAaX9hmbka8MTmba8MaXcltfgeIdxhxaeIdwh9caeIdlhJaeIdbhRxekJbbbbhxJbbbbh9cJbbbbhJJbbbbhRkaBa81:vg8Wa80Na8Z:ta85aBa86a81:vg8VN:tg8Za8Ua86a8VN:tg8Y:vg8Xa8Va80Na83:tg8UN:th83a9caRa8WN:taJaRa8VN:tg86a8XN:tg85a8SaBa8WN:ta8Za8XN:tgB:vg8S:mh8Za86a8Y:vg9c:mhJdnJbbbbaRaRa81:vg9eN:ta86a9cN:ta85a8SN:tg86:la87J:983:g81NgR9ETmba8Za83NaJa8UNa9ea80Nax:tMMa86:vhnka81:laR9ETmba8Y:laR9ETmbaB:laR9ETmba9e:manNa8W:ma8ZanNa83aB:vMgBNa8V:maJanNa8X:maBNa8Ua8Y:vMMg85Na80:ma81:vMMMh87aLa8FfgeclfydbgHaeydbge9RhhaEaecitfh8FJbbbbhRdnaHaeSgDmbJbbbbhRa8FheahhAina8Naeclfydbcx2fgHIdwa88:tg8Va8VNaHIdba8::tg8Va8VNaHIdla89:tg8Va8VNMMg8Va8Naeydbcx2fgHIdwa88:tg8Wa8WNaHIdba8::tg8Wa8WNaHIdla89:tg8Wa8WNMMg8WaRaRa8W9DEgRaRa8V9DEhRaecwfheaAcufgAmbkaR:rgRaRNhRkaBa88:tg8Va8VNa87a8::tg8Va8VNa85a89:tg8Va8VNMMaR9EmbaKId8KhndnaDmbina8Na8Fclfydbcx2fgeIdba8Na8Fydbcx2fgHIdbg8W:tgRa89aHIdlg8X:tg80NaeIdla8X:tg8Va8:a8W:tg86N:tg8YaRa85a8X:tg8SNa8Va87a8W:tg8UN:tg8XNa8Va88aHIdwg81:tg8ZNaeIdwa81:tg8Wa80N:tg80a8VaBa81:tg83Na8Wa8SN:tg8VNa8Wa86NaRa8ZN:tg81a8Wa8UNaRa83N:tgRNMMa8Ya8YNa80a80Na81a81NMMa8Xa8XNa8Va8VNaRaRNMMN:rJbbj8:N9Fmda8Fcwfh8FahcufghmbkkJbbbbJbbjZac:vacJbbbb9BEgRa9BaBNa9Ia87Na9EMg8Va8VMMaBNa9Ca85Na9HaBNa9FMg8Va8VMMa85Na9Da87Na9Ja85Na9GMg8Va8VMMa87NanMMM:lNaRa9Ba88Na9Ia8:Na9EMg8Va8VMMa88Na9Ca89Na9Ha88Na9FMg8Va8VMMa89Na9Da8:Na9Ja89Na9GMg8Va8VMMa8:NanMMM:lNJbb;aZNJ:983:g81M9Emba8JaBUdwa8Ja85Udla8Ja87UdbkaXcefgXal9hmbkdnaCmbcbhCxdkcbhXindna8AaXfRbbTmbaOaXcdtgefydbaX9hmbaYaXfhhaQaefh8Ja8NaXcx2fhAa8PaXaC2cdtfhDcbhEincuhLdnahRbbci9hmbaXhLa8JydbgeaXSmba8PaEcdtgHfhKaDaHfIdbhRaXhLinaLhHcuhLdnaKaeaC2cdtfIdbaR9CmbaHcuSmbaHhLagaec8S2fIdyagaHc8S2fIdy9ETmbaehLkaQaecdtfydbgeaX9hmbkka8PaEcdtfhKa8RaEcltfh8FaXheinaKaeaC2cdtfJbbbbJbbjZagaeaLaLcuSEgHc8S2fIdygR:vaRJbbbb9BEa8FaHaC2cltfgHIdwaAIdwNaHIdbaAIdbNaHIdlaAIdlNMMaHIdxMNUdbaQaecdtfydbgeaX9hmbkaEcefgEaC9hmbkkaXcefgXal9hmbxdkkaCmbcbhCkaiavaoarawaCala8Na8Pazasayasc1efaYa8Aaqz:hjjjbkdnamcjjjjlGTmbazmbaaTmbabhecbhLinaYaeydbgAfRbbc3thQaecwfgXydbhHcjjjj94hCdna5aAcdtgEfydbaeclfgKydbgOSmbcjjjj94cba8EaOcdtfydbaASEhCkaeaQaCVaAVBdbaYaOfRbbc3th8Fcjjjj94hCcjjjj94hQdna5aOcdtfydbaHSmbcjjjj94cba8EaHcdtfydbaOSEhQkaKa8FaQVaOVBdbaYaHfRbbc3thOdna5aHcdtfydbaASmbcjjjj94cba8EaEfydbaHSEhCkaXaOaCVaHVBdbaecxfheaLcifgLaa6mbkkdnazTmbaaTmbaaheinabazabydbcdtfydbBdbabclfhbaecufgembkkdnaPTmbaPaZaU:rNUdbkdnasyd;8egHTmbaHcdtasc:Ceffc98fheinaeydbcbyd:m:H:cjbH:bjjjbbaec98fheaHcufgHmbkkascj;sbf8Kjjjjbaak;Yieouabydlhvabydbclfcbaicdtz:tjjjbhoadci9UhrdnadTmbdnalTmbaehwadhDinaoalawydbcdtfydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbxdkkaehwadhDinaoawydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbkkdnaiTmbcbhDaohwinawydbhqawaDBdbawclfhwaqaDfhDaicufgimbkkdnadci6mbinaecwfydbhwaeclfydbhDaeydbhidnalTmbalawcdtfydbhwalaDcdtfydbhDalaicdtfydbhikavaoaicdtfgqydbcitfaDBdbavaqydbcitfawBdlaqaqydbcefBdbavaoaDcdtfgqydbcitfawBdbavaqydbcitfaiBdlaqaqydbcefBdbavaoawcdtfgwydbcitfaiBdbavawydbcitfaDBdlawawydbcefBdbaecxfhearcufgrmbkkabydbcbBdbk:todDue99aicd4aifhrcehwinawgDcethwaDar6mbkcuaDcdtgraDcFFFFi0Ecbyd1:H:cjbHjjjjbbhwaoaoyd9GgqcefBd9GaoaqcdtfawBdbawcFearz:tjjjbhkdnaiTmbalcd4hlaDcufhxcbhminamhDdnavTmbavamcdtfydbhDkcbadaDal2cdtfgDydlgwawcjjjj94SEgwcH4aw7c:F:b:DD2cbaDydbgwawcjjjj94SEgwcH4aw7c;D;O:B8J27cbaDydwgDaDcjjjj94SEgDcH4aD7c:3F;N8N27axGhwamcdthPdndndnavTmbakawcdtfgrydbgDcuSmeadavaPfydbal2cdtfgsIdbhzcehqinaqhrdnadavaDcdtfydbal2cdtfgqIdbaz9CmbaqIdlasIdl9CmbaqIdwasIdw9BmlkarcefhqakawarfaxGgwcdtfgrydbgDcu9hmbxdkkakawcdtfgrydbgDcuSmbadamal2cdtfgsIdbhzcehqinaqhrdnadaDal2cdtfgqIdbaz9CmbaqIdlasIdl9CmbaqIdwasIdw9BmikarcefhqakawarfaxGgwcdtfgrydbgDcu9hmbkkaramBdbamhDkabaPfaDBdbamcefgmai9hmbkkakcbyd:m:H:cjbH:bjjjbbaoaoyd9GcufBd9GdnaeTmbaiTmbcbhDaehwinawaDBdbawclfhwaiaDcefgD9hmbkcbhDaehwindnaDabydbgrSmbawaearcdtfgrydbBdbaraDBdbkabclfhbawclfhwaiaDcefgD9hmbkkk;:odvuv998Jjjjjbca9Rgocbyd1:G:cjbBdKaocb8Pdj:G:cjb83izaocbydN:G:cjbBdwaocb8Pd:m:G:cjb83ibdnadTmbaicd4hrdnabmbdnalTmbcbhwinaealawcdtfydbar2cdtfhDcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkawcefgwad9hmbxikkarcdthwcbhDincbhiinaoczfaifgqaeaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkaeawfheaDcefgDad9hmbxdkkdnalTmbcbhwinabawcx2fgiaealawcdtfydbar2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkawcefgwad9hmbxdkkarcdthlcbhwaehDinabawcx2fgiaeawar2cdtfgqIdbUdbaiaqIdlUdlaiaqIdwUdwcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkaDalfhDawcefgwad9hmbkkJbbbbaoIdbaoIdzgx:tgkakJbbbb9DEgkaoIdlaoIdCgm:tgPaPak9DEgkaoIdwaoIdKgP:tgsasak9DEhsdnabTmbadTmbJbbbbJbbjZas:vasJbbbb9BEhkinabakabIdbax:tNUdbabclfgoakaoIdbam:tNUdbabcwfgoakaoIdbaP:tNUdbabcxfhbadcufgdmbkkdnavTmbavaPUdwavamUdlavaxUdbkask:WlewudnaeTmbcbhvabhoinaoavBdbaoclfhoaeavcefgv9hmbkkdnaiTmbcbhrinadarcdtfhwcbhDinalawaDcdtgvyd:G:G:cjbcdtfydbcdtfydbhodnalawavfydbcdtfydbgqabaqcdtfgkydbgvSmbinakabavgqcdtfgxydbgvBdbaxhkaqav9hmbkkdnaoabaocdtfgkydbgvSmbinakabavgocdtfgxydbgvBdbaxhkaoav9hmbkkdnaqaoSmbabaqaoaqao0Ecdtfaqaoaqao6EBdbkaDcefgDci9hmbkarcifgrai6mbkkdnaembcbskcbhxindnalaxcdtgvfydbax9hmbaxhodnaxabavfgDydbgvSmbaDhqinaqabavgocdtfgkydbgvBdbakhqaoav9hmbkkaDaoBdbkaxcefgxae9hmbkcbhkabhvcbhoindndnaoalydbgq9hmbdnaoavydbgq9hmbavakBdbakcefhkxdkavabaqcdtfydbBdbxekavabaqcdtfydbBdbkalclfhlavclfhvaeaocefgo9hmbkakk;jiilud99euabcbaecltz:tjjjbhvdnalTmbadhoaihralhwinarcwfIdbhDarclfIdbhqavaoydbcltfgkarIdbakIdbMUdbakaqakIdlMUdlakaDakIdwMUdwakakIdxJbbjZMUdxaoclfhoarcxfhrawcufgwmbkkdnaeTmbavhkaehrinakcxfgoIdbhDaocbBdbakakIdbJbbbbJbbjZaD:vaDJbbbb9BEgDNUdbakclfgoaDaoIdbNUdbakcwfgoaDaoIdbNUdbakczfhkarcufgrmbkkdnalTmbinavadydbcltfgkaicwfIdbakIdw:tgDaDNaiIdbakIdb:tgDaDNaiclfIdbakIdl:tgDaDNMMgDakIdxgqaqaD9DEUdxadclfhdaicxfhialcufglmbkkdnaeTmbavcxfhkinabakIdbUdbakczfhkabclfhbaecufgembkkk:moerudnaoTmbaecd4hzdnavTmbaicd4hHavcdthOcbhAindnaPaAfRbbTmbaAhednaDTmbaDaAcdtfydbhekdnasTmbasaefRbbceGmekdnamaAfRbbclSmbabaeaz2cdtfgiaraAcx2fgCIdbakNaxIdbMUdbaiaCIdlakNaxIdlMUdlaiaCIdwakNaxIdwMUdwkadaeaH2cdtfhXaqheawhiavhCinaXaeydbcdtgQfaiIdbalaQfIdb:vUdbaeclfheaiclfhiaCcufgCmbkkawaOfhwaAcefgAao9hmbxdkkdnasmbcbheaDhiindnaPaefRbbTmbaehCdnaDTmbaiydbhCkamaefRbbclSmbabaCaz2cdtfgCarIdbakNaxIdbMUdbaCarclfIdbakNaxIdlMUdlaCarcwfIdbakNaxIdwMUdwkaiclfhiarcxfhraoaecefge9hmbxdkkdnaDTmbindnaPRbbTmbasaDydbgefRbbceGmbamRbbclSmbabaeaz2cdtfgearIdbakNaxIdbMUdbaearclfIdbakNaxIdlMUdlaearcwfIdbakNaxIdwMUdwkaPcefhPaDclfhDamcefhmarcxfhraocufgombxdkkazcdthicbheindnaPaefRbbTmbasaefRbbceGmbamaefRbbclSmbabarIdbakNaxIdbMUdbabclfarclfIdbakNaxIdlMUdbabcwfarcwfIdbakNaxIdwMUdbkarcxfhrabaifhbaoaecefge9hmbkkk8MbabaeadaialavcbcbcbcbcbaoarawaDz:bjjjbk8MbabaeadaialavaoarawaDaqakaxamaPz:bjjjbkRbababaeadaialavaoarawaDaqakaxcjjjjdVamz:bjjjbk:g8Koque99due99duq998Jjjjjbc;Wb9Rgq8Kjjjjbcbhkaqcxfcbc;Kbz:tjjjb8Aaqcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbgxBdxaqceBd2axaialavcbcbz:ejjjb8AaqcualcdtalcFFFFi0Egmcbyd1:H:cjbHjjjjbbgiBdzaqcdBd2dndnJFF959eJbbjZawJbbjZawJbbjZ9DE:vawJ9VO:d869DEgw:lJbbb9p9DTmbaw:OhPxekcjjjj94hPkadci9Uhsarco9UhzdndnaombaPcd9imekdnalTmbaPcuf:YhwdnaoTmbcbhvaihHaxhOindndnaoavfRbbceGTmbavcjjjjlVhAxekdndnaOclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcqthAdndnaOcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXVhAdndnaOIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXcCtVhAkaHaABdbaHclfhHaOcxfhOalavcefgv9hmbxdkkaxhvaihOalhHindndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcCthAdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcqtaAVhAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaOaAaXVBdbavcxfhvaOclfhOaHcufgHmbkkadTmbcbhkaehvcbhOinakaiavclfydbcdtfydbgHaiavcwfydbcdtfydbgA9haiavydbcdtfydbgXaH9haXaA9hGGfhkavcxfhvaOcifgOad6mbkkarci9UhQdndnaz:Z:rJbbbZMgw:lJbbb9p9DTmbaw:Ohvxekcjjjj94hvkaQ:ZhLcbhKc:bwhzdninakaQ9pmeazaP9Rcd9imeavazcufgOavaO9iEaPcefavaP9kEhYdnalTmbaYcuf:YhwdnaoTmbcbhOaihHaxhvindndnaoaOfRbbceGTmbaOcjjjjlVhAxekdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcqthAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXVhAdndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXcCtVhAkaHaABdbaHclfhHavcxfhvalaOcefgO9hmbxdkkaxhvaihOalhHindndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcCthAdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcqtaAVhAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaOaAaXVBdbavcxfhvaOclfhOaHcufgHmbkkcbhOdnadTmbaehvcbhHinaOaiavclfydbcdtfydbgAaiavcwfydbcdtfydbgX9haiavydbcdtfydbgraA9haraX9hGGfhOavcxfhvaHcifgHad6mbkkdnas:ZgCaL:taY:Ygwaz:Y:tg8ANak:ZgEaO:Zg3:tNaEaL:tawaP:Y:tg5Na3aC:tNMg8EJbbbb9BmbaCaE:ta5a8Aa3aL:tNNNa8E:vawMhwkdndnaOaQ0mbaOhkaYhPxekaOhsaYhzkdndnaKcl0mbdnawJbbbZMgw:lJbbb9p9DTmbaw:Ohvxdkcjjjj94hvxekaPazfcd9ThvkaKcefgKcs9hmbkkdndndnakmbJbbjZhwcbhOcdhvaDmexdkalcd4alfhHcehOinaOgvcethOavaH6mbkcbhOaqcuavcdtgYavcFFFFi0Ecbyd1:H:cjbHjjjjbbgKBdCaqciBd2aqamcbyd1:H:cjbHjjjjbbgzBdKaqclBd2dndndndnalTmbaPcuf:YhwaoTmecbhOaihAaxhHindndnaoaOfRbbceGTmbaOcjjjjlVhXxekdndnaHclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcqthXdndnaHcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohrxekcjjjj94hrkaXarVhXdndnaHIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohrxekcjjjj94hrkaXarcCtVhXkaAaXBdbaAclfhAaHcxfhHalaOcefgO9hmbxikkaKcFeaYz:tjjjb8AcbhPcbhvxdkaxhOaihHalhAindndnaOIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcCthXdndnaOclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohrxekcjjjj94hrkarcqtaXVhXdndnaOcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohrxekcjjjj94hrkaHaXarVBdbaOcxfhOaHclfhHaAcufgAmbkkaKcFeaYz:tjjjbhravcufhocbhPcbhYindndndnaraiaYcdtgKfydbgAcm4aA7c:v;t;h;Ev2gvcs4av7aoGgHcdtfgXydbgOcuSmbcehvinaiaOcdtgOfydbaASmdaHavfhOavcefhvaraOaoGgHcdtfgXydbgOcu9hmbkkaXaYBdbaPhvaPcefhPxekazaOfydbhvkazaKfavBdbaYcefgYal9hmbkcuaPc8S2gOaPc;D;O;f8U0EhvkcbhXaqavcbyd1:H:cjbHjjjjbbgvBd3aqcvBd2avcbaOz:tjjjbhOdnadTmbaehiinaxaiclfydbgrcx2fgvIdbaxaiydbgocx2fgHIdbg3:tgCaxaicwfydbgYcx2fgAIdlaHIdlg8A:tgwNavIdla8A:tgEaAIdba3:tg8EN:tgLaLNaEaAIdwaHIdwg5:tg8FNavIdwa5:tgEawN:tgwawNaEa8ENaCa8FN:tgCaCNMMg8E:rhEJbbnnJbbjZazaocdtfydbgvazarcdtfydbgASavazaYcdtfydbgrSGgHEh8Fdna8EJbbbb9ETmbaLaE:vhLaCaE:vhCawaE:vhwkaOavc8S2fgvavIdbawa8FaE:rNgEawNNg8FMUdbavaCaEaCNgaNghavIdlMUdlavaLaEaLNg8ENggavIdwMUdwavawaaNgaavIdxMUdxava8EawNg8JavIdzMUdzavaCa8ENg8EavIdCMUdCavawaEaLa5Nawa3Na8AaCNMM:mg8ANg3NgwavIdKMUdKavaCa3NgCavId3MUd3avaLa3NgLavIdaMUdaava3a8ANg3avId8KMUd8KavaEavIdyMUdydnaHmbaOaAc8S2fgva8FavIdbMUdbavahavIdlMUdlavagavIdwMUdwavaaavIdxMUdxava8JavIdzMUdzava8EavIdCMUdCavawavIdKMUdKavaCavId3MUd3avaLavIdaMUdaava3avId8KMUd8KavaEavIdyMUdyaOarc8S2fgva8FavIdbMUdbavahavIdlMUdlavagavIdwMUdwavaaavIdxMUdxava8JavIdzMUdzava8EavIdCMUdCavawavIdKMUdKavaCavId3MUd3avaLavIdaMUdaava3avId8KMUd8KavaEavIdyMUdykaicxfhiaXcifgXad6mbkkcbhAaqcuaPcdtgvaPcFFFFi0Egicbyd1:H:cjbHjjjjbbgHBdaaqcoBd2aqaicbyd1:H:cjbHjjjjbbgiBd8KaqcrBd2aHcFeavz:tjjjbhYdnalTmbazhHinJbbbbJbbjZaOaHydbgXc8S2fgvIdygw:vawJbbbb9BEavIdwaxcwfIdbgwNavIdzaxIdbgCNavIdaMgLaLMMawNavIdlaxclfIdbgLNavIdCawNavId3MgwawMMaLNavIdbaCNavIdxaLNavIdKMgwawMMaCNavId8KMMM:lNhwdndnaYaXcdtgvfgXydbcuSmbaiavfIdbaw9ETmekaXaABdbaiavfawUdbkaHclfhHaxcxfhxalaAcefgA9hmbkkdndnaPmbJbbbbhwxekJbbbbhwinaiIdbgCawawaC9DEhwaiclfhiaPcufgPmbkaw:rhwkakcd4akfhOcehiinaigvcethiavaO6mbkcbhOaqcuavcdtgiavcFFFFi0Ecbyd1:H:cjbHjjjjbbgHBdyaHcFeaiz:tjjjbhXdnadTmbavcufhrcbhPcbhxindnazaeaxcdtfgvydbcdtfydbgiazavclfydbcdtfydbgOSmbaiazavcwfydbcdtfydbgvSmbaOavSmbaYavcdtfydbhAdndnaYaOcdtfydbgvaYaicdtfydbgi9pmbavaA9pmbaAhlaihoavhAxekdnaAai9pmbaAav9pmbaihlavhoxekavhlaAhoaihAkabaPcx2fgvaABdbavcwfaoBdbavclfalBdbdnaXaoc:3F;N8N2alc:F:b:DD27aAc;D;O:B8J27arGgOcdtfgvydbgicuSmbcehHinaHhvdnabaicx2fgiydbaA9hmbaiydlal9hmbaiydwaoSmikavcefhHaXaOavfarGgOcdtfgvydbgicu9hmbkkavaPBdbaPcefhPkaxcifgxad6mbkaPci2hOkcwhvaDTmekaDawUdbkavcdthvaqcxfc98fhiinaiavfydbcbyd:m:H:cjbH:bjjjbbavc98fgvmbkaqc;Wbf8KjjjjbaOk:3ldrue9:8Jjjjjbc;Wb9Rgr8Kjjjjbcbhwarcxfcbc;Kbz:tjjjb8AdnabaeSmbabaeadcdtzMjjjb8AkarcualcdtalcFFFFi0EgDcbyd1:H:cjbHjjjjbbgqBdxarceBd2aqcbaialavcbarcxfz:djjjbcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbhkarcxfaryd2gxcdtfakBdbaraxcefgmBd2akaialavcbcbz:ejjjb8AarcxfamcdtfaDcbyd1:H:cjbHjjjjbbgiBdbaraxcdfgvBd2arcxfavcdtfcuaialaeadaqz:fjjjbgecltaecjjjjiGEcbyd1:H:cjbHjjjjbbgqBdbaqaeaiakalz:gjjjbaxcifhkdnadTmbaoaoNhocbhwabhlcbheindnaqaialydbgvcdtfydbcdtfIdbao9ETmbalclf8PdbhPabawcdtfgDavBdbaDclfaP83dbawcifhwkalcxfhlaecifgead6mbkkdnakTmbaxcdtarcxffcwfhlinalydbcbyd:m:H:cjbH:bjjjbbalc98fhlakcufgkmbkkarc;Wbf8Kjjjjbawk:WCoDud99vue99vuv998Jjjjjbc;Wb9Rgw8KjjjjbdndnarmbcbhDxekawcxfcbc;Kbz:tjjjb8Aawcuadcx2adc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbgqBdxawceBd2aqaeadaicbcbz:ejjjb8AawcuadcdtadcFFFFi0Egkcbyd1:H:cjbHjjjjbbgxBdzawcdBd2adcd4adfhmceheinaegicetheaiam6mbkcbhPawcuaicdtgsaicFFFFi0Ecbyd1:H:cjbHjjjjbbgzBdCawciBd2dndnar:ZgH:rJbbbZMgO:lJbbb9p9DTmbaO:Ohexekcjjjj94hekaicufhAc:bwhCcbhXadhQcbhLinaeaCcufgiaeai9iEaPcefaeaP9kEhDdndnadTmbaDcuf:YhOaqhiaxheadhmindndnaiIdbaONJbbbZMgK:lJbbb9p9DTmbaK:OhYxekcjjjj94hYkaYcCthYdndnaiclfIdbaONJbbbZMgK:lJbbb9p9DTmbaK:Oh8Axekcjjjj94h8Aka8AcqtaYVhYdndnaicwfIdbaONJbbbZMgK:lJbbb9p9DTmbaK:Oh8Axekcjjjj94h8AkaeaYa8AVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:tjjjbhEcbh3cbh5indnaEaxa5cdtfydbgYcm4aY7c:v;t;h;Ev2gics4ai7aAGgmcdtfg8AydbgecuSmbaeaYSmbcehiinaEamaifaAGgmcdtfg8AydbgecuSmeaicefhiaeaY9hmbkka8AaYBdba3aecuSfh3a5cefg5ad9hmbxdkkazcFeasz:tjjjb8Acbh3kdnaQ:ZgKaH:taD:YgOaC:Y:tg8ENaX:Zg8Fa3:Zga:tNa8FaH:taOaP:Y:tghNaaaK:tNMggJbbbb9BmbaKa8F:taha8EaaaH:tNNNag:vaOMhOkaPaDa3ar0giEhPaXa3aiEhXdna3arSmbaDaCaiEgCaP9Rcd9imbdndnaLcl0mbdnaOJbbbZMgO:lJbbb9p9DTmbaO:Ohexdkcjjjj94hexekaPaCfcd9Theka3aQaiEhQaLcefgLcs9hmekkdndnaXmbcihicbhDxekcbhiawakcbyd1:H:cjbHjjjjbbg5BdKawclBd2aPcuf:YhKdndnadTmbaqhiaxheadhmindndnaiIdbaKNJbbbZMgO:lJbbb9p9DTmbaO:OhYxekcjjjj94hYkaYcCthYdndnaiclfIdbaKNJbbbZMgO:lJbbb9p9DTmbaO:Oh8Axekcjjjj94h8Aka8AcqtaYVhYdndnaicwfIdbaKNJbbbZMgO:lJbbb9p9DTmbaO:Oh8Axekcjjjj94h8AkaeaYa8AVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:tjjjbhEcbhDcbh3indndndnaEaxa3cdtgCfydbgYcm4aY7c:v;t;h;Ev2gics4ai7aAGgmcdtfg8AydbgecuSmbcehiinaxaecdtgefydbaYSmdamaifheaicefhiaEaeaAGgmcdtfg8Aydbgecu9hmbkka8Aa3BdbaDhiaDcefhDxeka5aefydbhika5aCfaiBdba3cefg3ad9hmbkcuaDc32giaDc;j:KM;jb0EhexekazcFeasz:tjjjb8AcbhDcbhekawaecbyd1:H:cjbHjjjjbbgeBd3awcvBd2aecbaiz:tjjjbh8Aavcd4hxdnadTmbdnalTmbaxcdthEa5hYaqhealhmadhAina8AaYydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiamIdbaiIdxMUdxaiamclfIdbaiIdzMUdzaiamcwfIdbaiIdCMUdCaiaiIdKJbbjZMUdKaYclfhYaecxfheamaEfhmaAcufgAmbxdkka5hmaqheadhYina8Aamydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiaiIdxJbbbbMUdxaiaiIdzJbbbbMUdzaiaiIdCJbbbbMUdCaiaiIdKJbbjZMUdKamclfhmaecxfheaYcufgYmbkkdnaDTmba8AhiaDheinaiaiIdbJbbbbJbbjZaicKfIdbgO:vaOJbbbb9BEgONUdbaiclfgmaOamIdbNUdbaicwfgmaOamIdbNUdbaicxfgmaOamIdbNUdbaiczfgmaOamIdbNUdbaicCfgmaOamIdbNUdbaic3fhiaecufgembkkcbhYawcuaDcdtgCaDcFFFFi0Egicbyd1:H:cjbHjjjjbbgeBdaawcoBd2awaicbyd1:H:cjbHjjjjbbgEBd8KaecFeaCz:tjjjbh3dnadTmbaoJbbjZJbbjZaK:vaPceSENgOaONhKaxcdthxalheinaKaec;8:G:cjbalEgmIdwa8Aa5ydbgAc32fgiIdC:tgOaONamIdbaiIdx:tgOaONamIdlaiIdz:tgOaONMMNaqcwfIdbaiIdw:tgOaONaqIdbaiIdb:tgOaONaqclfIdbaiIdl:tgOaONMMMhOdndna3aAcdtgifgmydbcuSmbaEaifIdbaO9ETmekamaYBdbaEaifaOUdbka5clfh5aqcxfhqaeaxfheadaYcefgY9hmbkkaba3aCzMjjjb8Acrhikaicdthiawcxfc98fheinaeaifydbcbyd:m:H:cjbH:bjjjbbaic98fgimbkkawc;Wbf8KjjjjbaDk:Pdidui99ducbhi8Jjjjjbca9Rglcbyd1:G:cjbBdKalcb8Pdj:G:cjb83izalcbydN:G:cjbBdwalcb8Pd:m:G:cjb83ibdndnaembJbbjFhvJbbjFhoJbbjFhrxekadcd4cdthwincbhdinalczfadfgDabadfIdbgvaDIdbgoaoav9EEUdbaladfgDavaDIdbgoaoav9DEUdbadclfgdcx9hmbkabawfhbaicefgiae9hmbkalIdwalIdK:thralIdlalIdC:thoalIdbalIdz:thvkJbbbbavavJbbbb9DEgvaoaoav9DEgvararav9DEk9DeeuabcFeaicdtz:tjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk;Bidqui998Jjjjjbc;Wb9Rgl8Kjjjjbalcxfcbc;Kbz:tjjjb8Aadcd4adfhvcehoinaogrcethoarav6mbkalcuarcdtgoarcFFFFi0Ecbyd1:H:cjbHjjjjbbgvBdxavcFeaoz:tjjjbhwdnadTmbaicd4hDarcufhqcbhkindndnawcbaeakaD2cdtfgrydlgiaicjjjj94SEgocH4ao7c:F:b:DD2cbarydbgxaxcjjjj94SEgocH4ao7c;D;O:B8J27cbarydwgmamcjjjj94SEgrcH4ar7c:3F;N8N27aqGgvcdtfgrydbgocuSmbam::hPai::hsax::hzcehiinaihrdnaeaoaD2cdtfgiIdbaz9CmbaiIdlas9CmbaiIdwaP9BmikarcefhiawavarfaqGgvcdtfgrydbgocu9hmbkkarakBdbakhokabakcdtfaoBdbakcefgkad9hmbkkalydxcbyd:m:H:cjbH:bjjjbbalc;Wbf8Kjjjjbk9teiucbcbyd:q:H:cjbgeabcifc98GfgbBd:q:H:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:q:H:cjbgeabcrfc94GfgbBd:q:H:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd:q:H:cjbge9Rcifc98GaefgbBd:q:H:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk:Kedbcj:Gdk1eFFuuFFuuFFuuFFuFFFuFFFuFbbbbbbbbebbbdbbbbbbbebbbebbbdbbbbbbbbbbbeeeeebebbebbebebbbeebbbbbbbbbbbbeeeeeebebbeeebeebbbbebebbbbbbbbbbbbbbbbbbc1:Hdkxebbbdbbb:G:qbb",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(E){n=E.instance,n.exports.__wasm_call_ctors()});function o(E){for(var b=new Uint8Array(E.length),x=0;x<E.length;++x){var S=E.charCodeAt(x);b[x]=S>96?S-97:S>64?S-39:S+4}for(var B=0,x=0;x<E.length;++x)b[B++]=b[x]<60?t[b[x]]:(b[x]-60)*64+b[++x];return b.buffer.slice(0,B)}function r(E){if(!E)throw new Error("Assertion failed")}function a(E){return new Uint8Array(E.buffer,E.byteOffset,E.byteLength)}function s(E,b,x,S){var B=n.exports.sbrk,v=B(x*4),P=B(x*S*4),N=new Uint8Array(n.exports.memory.buffer);N.set(a(b),P),E(v,P,x,S*4),N=new Uint8Array(n.exports.memory.buffer);var L=new Uint32Array(x);return new Uint8Array(L.buffer).set(N.subarray(v,v+x*4)),B(v-B(0)),L}function c(E,b,x){var S=n.exports.sbrk,B=S(b.length*4),v=S(x*4),P=new Uint8Array(n.exports.memory.buffer),N=a(b);P.set(N,B);var L=E(v,B,b.length,x);P=new Uint8Array(n.exports.memory.buffer);var g=new Uint32Array(x);new Uint8Array(g.buffer).set(P.subarray(v,v+x*4)),N.set(P.subarray(B,B+b.length*4)),S(B-S(0));for(var I=0;I<b.length;++I)b[I]=g[b[I]];return[g,L]}function u(E){for(var b=0,x=0;x<E.length;++x){var S=E[x];b=b<S?S:b}return b}function f(E,b,x,S,B,v,P,N,L){var g=n.exports.sbrk,I=g(4),T=g(x*4),w=g(B*v),R=g(x*4),O=new Uint8Array(n.exports.memory.buffer);O.set(a(S),w),O.set(a(b),R);var G=E(T,R,x,w,B,v,P,N,L,I);O=new Uint8Array(n.exports.memory.buffer);var F=new Uint32Array(G);a(F).set(O.subarray(T,T+G*4));var U=new Float32Array(1);return a(U).set(O.subarray(I,I+4)),g(I-g(0)),[F,U[0]]}function h(E,b,x,S,B,v,P,N,L,g,I,T,w){var R=n.exports.sbrk,O=R(4),G=R(x*4),F=R(B*v),U=R(B*N),Q=R(L.length*4),H=R(x*4),Y=g?R(B):0,$=new Uint8Array(n.exports.memory.buffer);$.set(a(S),F),$.set(a(P),U),$.set(a(L),Q),$.set(a(b),H),g&&$.set(a(g),Y);var W=E(G,H,x,F,B,v,U,N,Q,L.length,Y,I,T,w,O);$=new Uint8Array(n.exports.memory.buffer);var K=new Uint32Array(W);a(K).set($.subarray(G,G+W*4));var Z=new Float32Array(1);return a(Z).set($.subarray(O,O+4)),R(O-R(0)),[K,Z[0]]}function p(E,b,x,S,B,v,P,N,L,g,I,T,w){var R=n.exports.sbrk,O=R(4),G=R(B*v),F=R(B*N),U=R(L.length*4),Q=R(x*4),H=g?R(B):0,Y=new Uint8Array(n.exports.memory.buffer);Y.set(a(S),G),Y.set(a(P),F),Y.set(a(L),U),Y.set(a(b),Q),g&&Y.set(a(g),H);var $=E(Q,x,G,B,v,F,N,U,L.length,H,I,T,w,O);Y=new Uint8Array(n.exports.memory.buffer),a(b).set(Y.subarray(Q,Q+$*4)),a(S).set(Y.subarray(G,G+B*v)),a(P).set(Y.subarray(F,F+B*N));var W=new Float32Array(1);return a(W).set(Y.subarray(O,O+4)),R(O-R(0)),[$,W[0]]}function A(E,b,x,S){var B=n.exports.sbrk,v=B(x*S),P=new Uint8Array(n.exports.memory.buffer);P.set(a(b),v);var N=E(v,x,S);return B(v-B(0)),N}function m(E,b,x,S,B,v,P,N){var L=n.exports.sbrk,g=L(N*4),I=L(x*S),T=L(x*v),w=new Uint8Array(n.exports.memory.buffer);w.set(a(b),I),B&&w.set(a(B),T);var R=E(g,I,x,S,T,v,P,N);w=new Uint8Array(n.exports.memory.buffer);var O=new Uint32Array(R);return a(O).set(w.subarray(g,g+R*4)),L(g-L(0)),O}function _(E,b,x,S,B,v,P,N,L){var g=n.exports.sbrk,I=g(4),T=g(x*4),w=g(B*v),R=g(x*4),O=P?g(B):0,G=new Uint8Array(n.exports.memory.buffer);G.set(a(S),w),G.set(a(b),R),P&&G.set(a(P),O);var F=E(T,R,x,w,B,v,O,N,L,I);G=new Uint8Array(n.exports.memory.buffer);var U=new Uint32Array(F);a(U).set(G.subarray(T,T+F*4));var Q=new Float32Array(1);return a(Q).set(G.subarray(I,I+4)),g(I-g(0)),[U,Q[0]]}function y(E,b,x,S,B,v,P){var N=n.exports.sbrk,L=N(x*4),g=N(B*v),I=N(x*4),T=new Uint8Array(n.exports.memory.buffer);T.set(a(S),g),T.set(a(b),I);var w=E(L,I,x,g,B,v,P);T=new Uint8Array(n.exports.memory.buffer);var R=new Uint32Array(w);return a(R).set(T.subarray(L,L+w*4)),N(L-N(0)),R}var C={LockBorder:1,Sparse:2,ErrorAbsolute:4,Prune:8,Regularize:16,Permissive:32,_InternalDebug:1<<30};return{ready:i,supported:!0,compactMesh:function(E){r(E instanceof Uint32Array||E instanceof Int32Array||E instanceof Uint16Array||E instanceof Int16Array),r(E.length%3==0);var b=E.BYTES_PER_ELEMENT==4?E:new Uint32Array(E);return c(n.exports.meshopt_optimizeVertexFetchRemap,b,u(E)+1)},generatePositionRemap:function(E,b){return r(E instanceof Float32Array),r(E.length%b==0),r(b>=3),s(n.exports.meshopt_generatePositionRemap,E,E.length/b,b)},simplify:function(E,b,x,S,B,v){r(E instanceof Uint32Array||E instanceof Int32Array||E instanceof Uint16Array||E instanceof Int16Array),r(E.length%3==0),r(b instanceof Float32Array),r(b.length%x==0),r(x>=3),r(S>=0&&S<=E.length),r(S%3==0),r(B>=0);for(var P=0,N=0;N<(v?v.length:0);++N)r(v[N]in C),P|=C[v[N]];var L=E.BYTES_PER_ELEMENT==4?E:new Uint32Array(E),g=f(n.exports.meshopt_simplify,L,E.length,b,b.length/x,x*4,S,B,P);return g[0]=E instanceof Uint32Array?g[0]:new E.constructor(g[0]),g},simplifyWithAttributes:function(E,b,x,S,B,v,P,N,L,g){r(E instanceof Uint32Array||E instanceof Int32Array||E instanceof Uint16Array||E instanceof Int16Array),r(E.length%3==0),r(b instanceof Float32Array),r(b.length%x==0),r(x>=3),r(S instanceof Float32Array),r(S.length==B*(b.length/x)),r(B>=0),r(P==null||P instanceof Uint8Array),r(P==null||P.length==b.length/x),r(N>=0&&N<=E.length),r(N%3==0),r(L>=0),r(Array.isArray(v)),r(B>=v.length),r(v.length<=32);for(var I=0;I<v.length;++I)r(v[I]>=0);for(var T=0,I=0;I<(g?g.length:0);++I)r(g[I]in C),T|=C[g[I]];var w=E.BYTES_PER_ELEMENT==4?E:new Uint32Array(E),R=h(n.exports.meshopt_simplifyWithAttributes,w,E.length,b,b.length/x,x*4,S,B*4,new Float32Array(v),P,N,L,T);return R[0]=E instanceof Uint32Array?R[0]:new E.constructor(R[0]),R},simplifyWithUpdate:function(E,b,x,S,B,v,P,N,L,g){r(E instanceof Uint32Array||E instanceof Int32Array||E instanceof Uint16Array||E instanceof Int16Array),r(E.length%3==0),r(b instanceof Float32Array),r(b.length%x==0),r(x>=3),r(S instanceof Float32Array),r(S.length==B*(b.length/x)),r(B>=0),r(P==null||P instanceof Uint8Array),r(P==null||P.length==b.length/x),r(N>=0&&N<=E.length),r(N%3==0),r(L>=0),r(Array.isArray(v)),r(B>=v.length),r(v.length<=32);for(var I=0;I<v.length;++I)r(v[I]>=0);for(var T=0,I=0;I<(g?g.length:0);++I)r(g[I]in C),T|=C[g[I]];var w=E.BYTES_PER_ELEMENT==4?E:new Uint32Array(E),R=p(n.exports.meshopt_simplifyWithUpdate,w,E.length,b,b.length/x,x*4,S,B*4,new Float32Array(v),P,N,L,T);if(E!==w)for(var I=0;I<R[0];++I)E[I]=w[I];return R},getScale:function(E,b){return r(E instanceof Float32Array),r(E.length%b==0),r(b>=3),A(n.exports.meshopt_simplifyScale,E,E.length/b,b*4)},simplifyPoints:function(E,b,x,S,B,v){return r(E instanceof Float32Array),r(E.length%b==0),r(b>=3),r(x>=0&&x<=E.length/b),S?(r(S instanceof Float32Array),r(S.length%B==0),r(B>=3),r(E.length/b==S.length/B),m(n.exports.meshopt_simplifyPoints,E,E.length/b,b*4,S,B*4,v,x)):m(n.exports.meshopt_simplifyPoints,E,E.length/b,b*4,void 0,0,0,x)},simplifySloppy:function(E,b,x,S,B,v){r(E instanceof Uint32Array||E instanceof Int32Array||E instanceof Uint16Array||E instanceof Int16Array),r(E.length%3==0),r(b instanceof Float32Array),r(b.length%x==0),r(x>=3),r(S==null||S instanceof Uint8Array),r(S==null||S.length==b.length/x),r(B>=0&&B<=E.length),r(B%3==0),r(v>=0);var P=E.BYTES_PER_ELEMENT==4?E:new Uint32Array(E),N=_(n.exports.meshopt_simplifySloppy,P,E.length,b,b.length/x,x*4,S,B,v);return N[0]=E instanceof Uint32Array?N[0]:new E.constructor(N[0]),N},simplifyPrune:function(E,b,x,S){r(E instanceof Uint32Array||E instanceof Int32Array||E instanceof Uint16Array||E instanceof Int16Array),r(E.length%3==0),r(b instanceof Float32Array),r(b.length%x==0),r(x>=3),r(S>=0);var B=E.BYTES_PER_ELEMENT==4?E:new Uint32Array(E),v=y(n.exports.meshopt_simplifyPrune,B,E.length,b,b.length/x,x*4,S);return v=E instanceof Uint32Array?v:new E.constructor(v),v}}})();var Ofn=(function(){var e="b9H79Tebbbe:neP9Geueu9Geub9Gbb9Giuuueu9Gmuuuuuuuuuuu9999eu9Gouuuuuueu9Gruuuuuuub9Gxuuuuuuuuuuuueu9Gxuuuuuuuuuuu99eu9GPuuuuuuuuuuuuu99b9Gouuuuuub9Gwuuuuuuuub9Gvuuuuub9GluuuubiQXdilvorwDqokoqxmbiibeilve9Weiiviebeoweuecj:Gdkr;Zeqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9I919P29K9nW79O2Wt79c9V919U9KbeY9TW79O9V9Wt9F9I919P29K9nW79O2Wt7S2W94bd39TW79O9V9Wt9F9I919P29K9nW79O2Wt79t9W9Ht9P9H2bo39TW79O9V9Wt9F9J9V9T9W91tWJ2917tWV9c9V919U9K7bw39TW79O9V9Wt9F9J9V9T9W91tW9nW79O2Wt9c9V919U9K7bkE9TW79O9V9Wt9F9J9V9T9W91tW9t9W9OWVW9c9V919U9K7bxL9TW79O9V9Wt9F9V9Wt9P9T9P96W9nW79O2WtbPl79IV9RbsDwebcekdOAq;E:leXdbkIbabaec9:fgefcufae9Ugeabci9Uadfcufad9Ugbaeab0Ek:88JDPue99eux99due99euo99iu8Jjjjjbc:WD9Rgm8KjjjjbdndnalmbcbhPxekamc:Cwfcbc;Kbz:rjjjb8AcuaocdtgsaocFFFFi0Ehzcbyd;0:G:cjbhHdndnalcb9imbaoal9nmbamazaHHjjjjbbgHBd:CwamceBd;8wamazcbyd;0:G:cjbHjjjjbbgOBd:GwamcdBd;8wamcualcdtalcFFFFi0Ecbyd;0:G:cjbHjjjjbbgABd:KwamciBd;8waihzalhsinaHazydbcdtfcbBdbazclfhzascufgsmbkaihzalhsinaHazydbcdtfgCaCydbcefBdbazclfhzascufgsmbkaihzalhCcbhXindnaHazydbcdtgQfgsydbcb9imbaOaQfaXBdbasasydbgQcjjjj94VBdbaQaXfhXkazclfhzaCcufgCmbkalci9UhLdnalci6mbcbhzaihsinascwfydbhCasclfydbhXaOasydbcdtfgQaQydbgQcefBdbaAaQcdtfazBdbaOaXcdtfgXaXydbgXcefBdbaAaXcdtfazBdbaOaCcdtfgCaCydbgCcefBdbaAaCcdtfazBdbascxfhsaLazcefgz9hmbkkaihzalhsindnaHazydbcdtgCfgXydbgQcu9kmbaXaQcFFFFrGgQBdbaOaCfgCaCydbaQ9RBdbkazclfhzascufgsmbxdkkamazaHHjjjjbbgHBd:CwamceBd;8wamazcbyd;0:G:cjbHjjjjbbgOBd:GwamcdBd;8wamcualcdtalcFFFFi0Ecbyd;0:G:cjbHjjjjbbgABd:KwamciBd;8waHcbasz:rjjjbhXaihzalhsinaXazydbcdtfgCaCydbcefBdbazclfhzascufgsmbkalci9UhLdnaoTmbcbhzaOhsaXhCaohQinasazBdbasclfhsaCydbazfhzaCclfhCaQcufgQmbkkdnalci6mbcbhzaihsinascwfydbhCasclfydbhQaOasydbcdtfgKaKydbgKcefBdbaAaKcdtfazBdbaOaQcdtfgQaQydbgQcefBdbaAaQcdtfazBdbaOaCcdtfgCaCydbgCcefBdbaAaCcdtfazBdbascxfhsaLazcefgz9hmbkkaoTmbcbhzaohsinaOazfgCaCydbaXazfydb9RBdbazclfhzascufgsmbkkamaLcbyd;0:G:cjbHjjjjbbgzBd:OwamclBd;8wazcbaLz:rjjjbhYamcuaLcK2alcjjjjd0Ecbyd;0:G:cjbHjjjjbbg8ABd:SwamcvBd;8wJbbbbhEdnalci6g3mbarcd4hKaihsa8AhzaLhrJbbbbh5inavasclfydbaK2cdtfgCIdlh8EavasydbaK2cdtfgXIdlhEavascwfydbaK2cdtfgQIdlh8FaCIdwhaaXIdwhhaQIdwhgazaCIdbg8JaXIdbg8KMaQIdbg8LMJbbnn:vUdbazclfaXIdlaCIdlMaQIdlMJbbnn:vUdbaQIdwh8MaCIdwh8NaXIdwhyazcxfa8EaE:tg8Eagah:tggNaaah:tgaa8FaE:tghN:tgEJbbbbJbbjZa8Ja8K:tg8FahNa8Ea8La8K:tg8KN:tghahNaEaENaaa8KNa8FagN:tgEaENMMg8K:rg8E:va8KJbbbb9BEg8KNUdbazczfaEa8KNUdbazcCfaha8KNUdbazcwfa8Maya8NMMJbbnn:vUdba5a8EMh5ascxfhsazcKfhzarcufgrmbka5aL:Z:vJbbbZNhEkamcuaLcdtalcFFFF970Ecbyd;0:G:cjbHjjjjbbgCBd:WwamcoBd;8waq:Zhhdna3mbcbhzaChsinasazBdbasclfhsaLazcefgz9hmbkkaEahNhhamcuaLcltalcFFFFd0Ecbyd;0:G:cjbHjjjjbbg8PBd:0wamcrBd;8wcba8Pa8AaCaLcbz:djjjb8AJFFuuh8MJFFuuh8NJFFuuhydnalci6mbJFFuuhya8AhzaLhsJFFuuh8NJFFuuh8MinazcwfIdbgEa8Ma8MaE9EEh8MazclfIdbgEa8Na8NaE9EEh8NazIdbgEayayaE9EEhyazcKfhzascufgsmbkkah:rhEamaocetgzcuaocu9kEcbyd;0:G:cjbHjjjjbbgCBd:4wdndnaoal9nmbaihzalhsinaCazydbcetfcFFi87ebazclfhzascufgsmbxdkkaCcFeazz:rjjjb8AkaEJbbbZNh8JcuhIdnalci6mbcbhsJFFuuhEa8AhzcuhIinazcwfIdba8M:tghahNazIdbay:tghahNazclfIdba8N:tghahNMM:rghaEaIcuSahaE9DVgXEhEasaIaXEhIazcKfhzaLascefgs9hmbkkamczfcbcjwz:rjjjb8Aam9cb83iwam9cb83ibaxa8JNh8RJbbjZak:th8Lcbh8SJbbbbhRJbbbbh8UJbbbbh8VJbbbbh8WJbbbbh8XJbbbbh8Ycbh8ZcbhPinJbbbbhEdna8STmbJbbjZa8S:Z:vhEkJbbbbhhdna8Ya8YNa8Wa8WNa8Xa8XNMMg8KJbbbb9BmbJbbjZa8K:r:vhhka8VaENh8Ka8UaENh5aRaENh8EaIhLdndndndndna8SaPVTmbamydwg80Tmea8YahNh8Fa8XahNhaa8WahNhgaeamydbcdtfh81cbh3JFFuuhEcvhQcuhLindnaHa81a3cdtfydbcdtgzfydbgvTmbaAaOazfydbcdtfhsindndnaCaiasydbgKcx2fgzclfydbgrcetf8Vebcs4aCazydbgXcetf8Vebcs4faCazcwfydbglcetf8Vebcs4fgombcbhzxekcehzaHaXcdtfydbgXceSmbcehzaHarcdtfydbgrceSmbcehzaHalcdtfydbglceSmbdnarcdSaXcdSfalcdSfcd6mbaocefhzxekaocdfhzkdnazaQ9kmba8AaKcK2fgXIdwa8K:tghahNaXIdba8E:tghahNaXIdla5:tghahNMM:ra8J:va8LNJbbjZMJ9VO:d86JbbjZaXIdCa8FNaXIdxagNaaaXIdzNMMakN:tghahJ9VO:d869DENghaEazaQ6ahaE9DVgXEhEaKaLaXEhLazaQaXEhQkasclfhsavcufgvmbkka3cefg3a809hmbkkaLcu9hmekama8KUd:ODama5Ud:KDama8EUd:GDamcuBd:qDamcFFF;7rBdjDa8Pcba8AaYamc:GDfamc:qDfamcjDfz:ejjjbamyd:qDhLdndnaxJbbbb9ETmba8SaD6mbaLcuSmeceh3amIdjDa8R9EmixdkaLcu9hmekdna8STmbabaPcltfgHam8Piw83dwaHam8Pib83dbaPcefhPkc3hHinamc:CwfaHfydbcbyd;4:G:cjbH:bjjjbbaHc98fgHc989hmbxvkkcbh3a8Saq9pmbamydwaCaiaLcx2fgzydbcetf8Vebcs4aCazcwfydbcetf8Vebcs4faCazclfydbcetf8Vebcs4ffaw9nmekcbhzcbhsdna8ZTmbcbhsamczfhXinamczfascdtfaXydbgQBdbaXclfhXasaYaQfRbbTfhsa8Zcufg8ZmbkkamydwhlamydbhXam9cu83i:GDam9cu83i:ODam9cu83i:qDam9cu83i:yDinamcjDfazfcFFF;7rBdbazclfgzcz9hmbkasc;8easclfc:bd6Eg8Zcdth80dnalTmbaeaXcdtfhocbhrindnaHaoarcdtfydbcdtgzfydbgvTmbaAaOazfydbcdtfhscuhQcuhzinaHaiasydbgKcx2fgXclfydbcdtfydbaHaXydbcdtfydbfaHaXcwfydbcdtfydbfgXazaXaz6gXEhzaKaQaXEhQasclfhsavcufgvmbkaQcuSmba8AaQcK2fgsIdwa8M:tgEaENasIdbay:tgEaENasIdla8N:tgEaENMM:rhEcbhsindndnazamc:qDfasfgvydbgX6mbazaX9hmeaEamcjDfasfIdb9FTmekavazBdbamc:GDfasfaQBdbamcjDfasfaEUdbxdkasclfgscz9hmbkkarcefgral9hmbkkamczfa80fhQcbhzcbhsindnamc:GDfazfydbgXcuSmbaQascdtfaXBdbascefhskazclfgzcz9hmbkasa8Zfg8ZTmbJFFuuhhcuhKamczfhza8ZhvcuhQina8AazydbgXcK2fgsIdwa8M:tgEaENasIdbay:tgEaENasIdla8N:tgEaENMM:rhEdndnaHaiaXcx2fgsclfydbcdtfydbaHasydbcdtfydbfaHascwfydbcdtfydbfgsaQ6mbasaQ9hmeaEah9DTmekaEhhashQaXhKkazclfhzavcufgvmbkaKcuSmbaKhLkdnamaiaLcx2fgrydbarclfydbarcwfydbaCabaeadaPawaqa3z:fjjjbTmbaPcefhPJbbbbhRJbbbbh8UJbbbbh8VJbbbbh8WJbbbbh8XJbbbbh8YkcbhXinaAaOaraXcdtfydbcdtgsfydbcdtfgKhzaHasfgvydbgQhsdnaQTmbdninazydbaLSmeazclfhzascufgsTmdxbkkazaKaQcdtfc98fydbBdbavavydbcufBdbkaXcefgXci9hmbka8AaLcK2fgzIdbhEazIdlhhazIdwh8KazIdxh5azIdzh8EazIdCh8FaYaLfce86bba8Ya8FMh8Ya8Xa8EMh8Xa8Wa5Mh8Wa8Va8KMh8Va8UahMh8UaRaEMhRamydxh8Sxbkkamc:WDf8KjjjjbaPkjoivuv99lu8Jjjjjbca9Rgo8Kjjjjbdndnalcw0mbaiydbhraeabcitfgwalcdtciVBdlawarBdbdnalcd6mbaiclfhralcufhDawcxfhwinarydbhqawcuBdbawc98faqBdbawcwfhwarclfhraDcufgDmbkkalabfhwxekcbhqaocbBdKao9cb83izaocbBdwao9cb83ibJbbjZhkJbbjZhxinadaiaqcdtfydbcK2fhDcbhwinaoczfawfgraDawfIdbgmarIdbgP:tgsaxNaPMgPUdbaoawfgrasamaP:tNarIdbMUdbawclfgwcx9hmbkJbbjZakJbbjZMgk:vhxaqcefgqal9hmbkcbhradcbcecdaoIdlgmaoIdwgP9GEgwaoIdbgsaP9GEawasam9GEgzcdtgwfhHaoczfawfIdbhmaihwalhDinaiarcdtfgqydbhOaqawydbgABdbawaOBdbawclfhwaraHaAcK2fIdbam9DfhraDcufgDmbkdndnarcv6mbavc8X9kmbaralc98f6mekaiydbhraeabcitfgwalcdtciVBdlawarBdbaiclfhralcufhDawcxfhwinarydbhqawcuBdbawc98faqBdbawcwfhwarclfhraDcufgDmbkalabfhwxekaeabcitfgwamUdbawawydlc98GazVBdlabcefaeadaiaravcefgqz:djjjbhDawawydlciGaDabcu7fcdtVBdlaDaeadaiarcdtfalar9Raqz:djjjbhwkaocaf8Kjjjjbawk;Oddvue99dninabaecitfgrydlgwcd4gDTmednawciGgqci9hmbcihqdnawcl6mbabaecitfhbcbheawhqcehkindnaiabydbgDfRbbmbcbhkadaDcK2fgwIdwalIdw:tgxaxNawIdbalIdb:tgxaxNawIdlalIdl:tgxaxNMM:rgxaoIdb9DTmbaoaxUdbavaDBdbarydlhqkabcwfhbaecefgeaqcd46mbkakceGTmikaraqciGBdlskdnabcbaDalaqcdtfIdbarIdb:tgxJbbbb9FEgwaD7aecefgDfgecitfydlabawaDfgDcitfydlVci0mbaraqBdlkabaDadaialavaoz:ejjjbax:laoIdb9Fmbkkkjlevudndnabydwgxaladcetfgm8Vebcs4alaecetfgP8Vebgscs4falaicetfgz8Vebcs4ffaD0mbakmbcbhDabydxaq6mekavawcltfgxab8Pdw83dwaxab8Pdb83dbabydbhDdnabydwgwTmbaoaDcdtfhxawhsinalaxydbcetfcFFi87ebaxclfhxascufgsmbkkabaDawfBdbabydxhxab9cb83dwababydlaxci2fBdlaP8VebhscehDcbhxkdnascztcz91cu9kmbabaxcefBdwaPax87ebaoabydbcdtfaxcdtfaeBdbkdnam8Uebcu9kmbababydwgxcefBdwamax87ebaoabydbcdtfaxcdtfadBdbkdnaz8Uebcu9kmbababydwgxcefBdwazax87ebaoabydbcdtfaxcdtfaiBdbkarabydlfabydxci2faPRbb86bbarabydlfabydxci2fcefamRbb86bbarabydlfabydxci2fcdfazRbb86bbababydxcefBdxaDk:mPrHue99eue99eue99iu8Jjjjjbc;W;Gb9Rgx8KjjjjbdndnalmbcbhmxekcbhPaxc:m;Gbfcbc;Kbz:rjjjb8Aaxcualci9UgscltascjjjjiGEcbyd;0:G:cjbHjjjjbbgzBd:m9GaxceBd;S9GaxcuascK2gHcKfalcpFFFe0Ecbyd;0:G:cjbHjjjjbbgOBd:q9GaxcdBd;S9Gdnalci6gAmbarcd4hCascdthXaOhQazhLinavaiaPcx2fgrydwaC2cdtfhKavarydlaC2cdtfhYavarydbaC2cdtfh8AcbhraLhEinaQarfgma8Aarfg3Idbg5aYarfg8EIdbg8Fa5a8F9DEg5UdbamaKarfgaIdbg8Fa5a8Fa59DEg8FUdbamcxfgma3Idbg5a8EIdbgha5ah9EEg5UdbamaaIdbgha5aha59EEg5UdbaEa8Fa5MJbbbZNUdbaEaXfhEarclfgrcx9hmbkaQcKfhQaLclfhLaPcefgPas9hmbkkaOaHfgr9cb83dbar9cb83dzar9cb83dwaxcuascx2gralc:bjjjl0Ecbyd;0:G:cjbHjjjjbbgHBdN9GaxciBd;S9GascdthgazarfhvaxcwVhPaxclVhCaHh8Jazh8KcbhLinaxcbcj;Gbz:rjjjbhEaLas2cdthadnaAmba8Khrash3inaEarydbgmc8F91cjjjj94Vam7gmcQ4cx2fg8Ea8EydwcefBdwaEamcd4cFrGcx2fg8Ea8EydbcefBdbaEamcx4cFrGcx2fgmamydlcefBdlarclfhra3cufg3mbkkazaafh8AaHaafhXcbhmcbh3cbh8EcbhainaEamfgrydbhQara3BdbarcwfgKydbhYaKaaBdbarclfgrydbhKara8EBdbaQa3fh3aYaafhaaKa8Efh8Eamcxfgmcj;Gb9hmbkdnaAmbcbhravhminamarBdbamclfhmasarcefgr9hmbkavhrashminaEa8Aarydbg3cdtfydbg8Ec8F91a8E7cd4cFrGcx2fg8Ea8Eydbg8EcefBdbaXa8Ecdtfa3Bdbarclfhramcufgmmbka8JhrashminaCa8Aarydbg3cdtfydbg8Ec8F91a8E7cx4cFrGcx2fg8Ea8Eydbg8EcefBdbava8Ecdtfa3BdbarclfhramcufgmmbkavhrashminaPa8Aarydbg3cdtfydbg8Ec8F91cjjjj94Va8E7cQ4cx2fg8Ea8Eydbg8EcefBdbaXa8Ecdtfa3Bdbarclfhramcufgmmbkka8Jagfh8Ja8Kagfh8KaLcefgLci9hmbkaEaocetgrcuaocu9kEcbyd;0:G:cjbHjjjjbbgKBd:y9GaEclBd;S9Gdndnaoal9nmbaihralhminaKarydbcetfcFFi87ebarclfhramcufgmmbxdkkaKcFearz:rjjjb8Akcbh8EaEascbyd;0:G:cjbHjjjjbbg8ABd:C9GaOaHaHascdtfaHascitfa8AascbazaKaiawaDaqakz:hjjjbdndnalci6mba8Ahrashmina8EarRbbfh8EarcefhramcufgmmbkaE9cb83iwaE9cb83ibalawc9:fgrfcufar9UgrasaDfcufaD9Ugmaram0EhYcbhmcbhra8Ehaincbh3dnarTmba8AarfRbbceSh3kamaEaiaHydbcx2fgQydbaQclfydbaQcwfydbaKabaeadamawaqa3a3ce7a8EaY9nVaaamfaY6VGz:fjjjbfhmaHclfhHaaa8AarfRbb9Rhaasarcefgr9hmbkaEydxTmeabamcltfgraE8Piw83dwaraE8Pib83dbamcefhmxekaE9cb83iwaE9cb83ibcbhmkczhrinaEc:m;Gbfarfydbcbyd;4:G:cjbH:bjjjbbarc98fgrc989hmbkkaxc;W;Gbf8Kjjjjbamk:wKDQue99iue99iul9:euw99iu8Jjjjjbc;qb9RgP8Kjjjjbaxhsaxhzdndnavax0gHmbdnavTmbcbhOaehzavhAinawaDazydbcx2fgCcwfydbcetfgX8VebhQawaCclfydbcetfgL8VebhKawaCydbcetfgC8VebhYaXce87ebaLce87ebaCce87ebaOaKcs4aYcs4faQcs4ffhOazclfhzaAcufgAmbkaehzavhAinawaDazydbcx2fgCcwfydbcetfcFFi87ebawaCclfydbcetfcFFi87ebawaCydbcetfcFFi87ebazclfhzaAcufgAmbkcehzaqhsaOaq0mekalce86bbalcefcbavcufz:rjjjb8AxekaPaiBdxaPadBdwaPaeBdlavakaqci9Ug8Aaka8Aak6EaHEgK9RhEaxaK9Rh3aKcufh5aKceth8EaKcdtgCc98fh8FavcitgOaC9Rarfc98fhaascufhhavcufhgaraOfh8JJbbjZas:Y:vh8KcbazceakaxSEg8Lcdtg8M9Rh8NJFFuuhycuh8PcbhIcbh8RinaPclfa8RcdtfydbhQaPcb8Pd:y:G:cjbg8S83i9iaPcb8Pd:q:G:cjbgR83inaPcb8Pd1:G:cjbg8U83iUaPcb8Pdj:G:cjbg8V83i8WaPa8S83iyaPaR83iaaPa8U83iKaPa8V83izaQavcdtgYfh8WcbhXinabaQaXcdtgLfydbcK2fhAcbhzinaPc8WfazfgCaAazfgOIdbg8XaCIdbg8Ya8Xa8Y9DEUdbaCczfgCaOcxfIdbg8XaCIdbg8Ya8Xa8Y9EEUdbazclfgzcx9hmbkaba8WaXcu7cdtfydbcK2fhAcbhzaPIdUh8ZaPId9ih80aPId80h81aPId9ehBaPId8Wh83aPIdnhUinaPczfazfgCaAazfgOIdbg8XaCIdbg8Ya8Xa8Y9DEUdbaCczfgCaOcxfIdbg8XaCIdbg8Ya8Xa8Y9EEUdbazclfgzcx9hmbkaraLfgzaBa81:tg8Xa80a8Z:tg8YNaUa83:tg8Za8XNa8Za8YNMMUdbazaYfaPId8KaPIdC:tg8XaPIdyaPIdK:tg8YNaPIdaaPIdz:tg8Za8XNa8Za8YNMMUdbaXcefgXav9hmbkcbh85dnaHmbcbhAaQhza8JhCavhXinawaDazydbcx2fgOcwfydbcetfgL8Vebh8WawaOclfydbcetfg858Vebh86awaOydbcetfgO8Vebh87aLce87eba85ce87ebaOce87ebaCaAa86cs4a87cs4fa8Wcs4ffgABdbazclfhzaCclfhCaXcufgXmbkavhCinawaDaQydbcx2fgzcwfydbcetfcFFi87ebawazclfydbcetfcFFi87ebawazydbcetfcFFi87ebaQclfhQaCcufgCmbka8Jh85kdndndndndndndndndndndnava8E6mba8Eax9nmeavavaK9UgzaK29Raza320mda5aE9pmqa85Th87ceh8WaEhQxwka5ag9pmDa8Eax9nmixokavaK6mea5aE9pmwcehQaEhXa85Tmixlka5ag6mlxrka5ag9pmokcbhQaghXa85mekJFFuuh8XcbhLa5hzindnazcefgCaK6mbaQavaC9RgOaK6GmbarazcdtfIdbg8YaC:YNaravaz9RcdtfaYfc94fIdbg8ZaO:YNMg80a8X9Embdndna8KaOahf:YNg81:lJbbb9p9DTmba81:OhAxekcjjjj94hAka8ZasaA2aO9R:YNh8Zdndna8Kazasf:YNg81:lJbbb9p9DTmba81:OhOxekcjjjj94hOkamasaO2aC9R:Ya8YNa8ZMNa80Mg8Ya8Xa8Ya8X9DgOEh8XaCaLaOEhLkaza8LfgzaX6mbxlkkJFFuuh8XcbhLaEhCaahAa8FhOaKhzindnazaK6mbaQaCaK6GmbaraOfIdbg8Yaz:YNaAIdbg8ZaC:YNMg80a8X9Embdndna8Ka85aOfydbgYahf:YNg81:lJbbb9p9DTmba81:Oh8Wxekcjjjj94h8Wkamasa8W2aY9R:Yg81a8YNa8Za81NMNa80Mg8Ya8Xa8Ya8X9DgYEh8XazaLaYEhLkaCa8L9RhCaAa8NfhAaOa8MfhOaza8LfgzcufaX6mbxikka85Th87cbh8WaghQkJFFuuh8XcbhLaEhCaahAa8FhOaKhzindnazazaK9UgXaK29RaXa320mbdna8WTmbaCaCaK9UgXaK29RaXa320mekaraOfIdbg8Yaz:YNaAIdbg8ZaC:YNMg80a8X9EmbazhXaChYdna87mba85aOfydbgXhYkdndna8KaYahf:YNg81:lJbbb9p9DTmba81:Oh86xekcjjjj94h86ka8Zasa862aY9R:YNh8Zdndna8KaXahf:YNg81:lJbbb9p9DTmba81:OhYxekcjjjj94hYkamasaY2aX9R:Ya8YNa8ZMNa80Mg8Ya8Xa8Ya8X9DgXEh8XazaLaXEhLkaCa8L9RhCaAa8NfhAaOa8MfhOaza8LfgzcufaQ6mbkkaLTmba8Xay9DTmba8XhyaLhIa8Rh8Pka8Rcefg8Rci9hmbkdndnaoc8X9kmba8Pcb9omeka8Acufh85cbhYindndndnavaY9RaxaYaxfav0Eg8WTmbcbhAaeaYcdtfgzhCa8WhXinawaDaCydbcx2fgOcwfydbcetfgQ8VebhbawaOclfydbcetfgL8VebhrawaOydbcetfgO8VebhKaQce87ebaLce87ebaOce87ebaAarcs4aKcs4fabcs4ffhAaCclfhCaXcufgXmbka8WhOinawaDazydbcx2fgCcwfydbcetfcFFi87ebawaCclfydbcetfcFFi87ebawaCydbcetfcFFi87ebazclfhzaOcufgOmbkaAaq0mekalaYfgzce86bbazcefcba8Wcufz:rjjjb8AxekalaYfgzce86bbazcefcba85z:rjjjb8Aa8Ah8Wka8WaYfgYav9pmdxbkkaravcdtg8WfhLdnaITmbaPclfa8PcdtfydbhzaIhCinaLazydbfcb86bbazclfhzaCcufgCmbkkdnavaI9nmbaPclfa8PcdtfydbaIcdtfhzavaI9RhCinaLazydbfce86bbazclfhzaCcufgCmbkkcbhYindnaYa8PSmbcbhzaraPclfaYcdtfydbgKa8Wz:qjjjbhCavhXaIhOinaKaOazaLaCydbgQfRbbgAEcdtfaQBdbaCclfhCaOaAfhOazaA9RcefhzaXcufgXmbkkaYcefgYci9hmbkabaeadaialaIaocefgCarawaDaqakaxamz:hjjjbabaeaIcdtgzfadazfaiazfalaIfavaI9RaCarawaDaqakaxamz:hjjjbkaPc;qbf8Kjjjjbk:Seeru8Jjjjjbc:q;ab9Rgo8Kjjjjbaoc:q8WfcFecjzz:rjjjb8AcbhrdnadTmbaehwadhDinaoarcdtfawydbgqBdbaoc:q8WfaqcFiGcdtfgkydbhxakaqBdbawclfhwaraxaq9hfhraDcufgDmbkkabaeadaoaraiavz:jjjjbaoc:q;abf8Kjjjjbk;Sqloud99euD998Jjjjjbc:W;ab9Rgr8KjjjjbdndnadTmbaocd4hwcbhDcbhqindnavaeclfydbaw2cdtfgkIdbavaeydbaw2cdtfgxIdbgm:tgPavaecwfydbaw2cdtfgsIdlaxIdlgz:tgHNakIdlaz:tgOasIdbam:tgAN:tgCaCNaOasIdwaxIdwgX:tgQNakIdwaX:tgOaHN:tgHaHNaOaANaPaQN:tgPaPNMMgOJbbbb9Bmbarc8WfaDcltfgkaCaO:rgO:vgCUdwakaPaO:vgPUdlakaHaO:vgHUdbakaCaXNaHamNazaPNMM:mUdxaDcefhDkaecxfheaqcifgqad6mbkab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbaDTmearcbBd8Sar9cb83iKar9cb83izarczfavalaoarc8Sfcbcraiz:kjjjbarIdKhQarIdChLarIdzhKar9cb83iwar9cb83ibararc8WfaDczarc8Sfcbcicbz:kjjjbJbbbbhmdnarIdwgzazNarIdbgHaHNarIdlgXaXNMMgCJbbbb9BmbJbbjZaC:r:vhmkazamNhCaXamNhXaHamNhHJbbjZhmarc8WfheaDhvinaecwfIdbaCNaeIdbaHNaXaeclfIdbNMMgzamazam9DEhmaeczfheavcufgvmbkabaQUdwabaLUdlabaKUdbabarId3UdxdndnamJ;n;m;m899FmbJbbbbhzarc8WfheinaecxfIdbaQaecwfIdbgPNaKaeIdbgONaLaeclfIdbgANMMMaCaPNaHaONaXaANMM:vgPazaPaz9EEhzaeczfheaDcufgDmbkabaCUd8KabaXUdaabaHUd3abaQaCazN:tUdKabaLaXazN:tUdCabaKaHazN:tUdzabJbbjZamamN:t:rgmUdydndnaCJbbj:;aCJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aCJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohexekcjjjj94hekabae86b8UdndnaXJbbj:;aXJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aXJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohvxekcjjjj94hvkabav86bRdndnaHJbbj:;aHJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aHJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohwxekcjjjj94hwkabaw86b8SdndnaecKtcK91:YJbb;:9c:vaC:t:lavcKtcK91:YJbb;:9c:vaX:t:lawcKtcK91:YJbb;:9c:vaH:t:lamMMMJbb;:9cNJbbjZMgm:lJbbb9p9DTmbam:Ohexekcjjjj94hekaecFbaecFb9iEhexekabcjjj;8iBdycFbhekabae86b8Vxekab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbkarc:W;abf8Kjjjjbk;7woDuo99eue99euv998Jjjjjbcje9Rgw8Kjjjjbawc;abfcbaocdtgDz:rjjjb8Aawc;GbfcbaDz:rjjjb8AawcafhDawhqaohkinaqcFFF97BdbaDcFFF;7rBdbaqclfhqaDclfhDakcufgkmbkavcd4hxaicd4hmdnadTmbaocx2hPcbhsinashzdnarTmbarascdtfydbhzkaeazam2cdtfgDIdwhHaDIdlhOaDIdbhAalazax2cdtfIdbhCcbhDawcafhqawc;Gbfhvawhkawc;abfhiinaCaDc:O:G:cjbfIdbaHNaDc:G:G:cjbfIdbaANaDc:K:G:cjbfIdbaONMMgXMhQazhLdnaXaC:tgXaqIdbgK9DgYmbavydbhLkavaLBdbazhLdnaQakIdbg8A9EmbaiydbhLa8AhQkaiaLBdbakaQUdbaqaXaKaYEUdbaiclfhiakclfhkavclfhvaqclfhqaPaDcxfgD9hmbkascefgsad9hmbkkJbbbbhQcbhLawc;GbfhDawc;abfhqcbhkinalaqydbgvax2cdtfIdbalaDydbgiax2cdtfIdbaeavam2cdtfgvIdwaeaiam2cdtfgiIdw:tgCaCNavIdbaiIdb:tgCaCNavIdlaiIdl:tgCaCNMM:rMMgCaQaCaQ9EgvEhQakaLavEhLaqclfhqaDclfhDaoakcefgk9hmbkJbbbbhCdnaeawc;abfaLcdtgqfydbgkam2cdtfgDIdwaeawc;Gbfaqfydbgvam2cdtfgqIdwgH:tgXaXNaDIdbaqIdbgA:tg8Aa8ANaDIdlaqIdlgE:tgOaONMMgKJbbbb9ETmbaK:rgCalakax2cdtfIdbMalavax2cdtfIdb:taCaCM:vhCkaQJbbbZNhKaXaCNaHMhHaOaCNaEMhOa8AaCNaAMhAdnadTmbcbhqarhkinaqhDdnarTmbakydbhDkdnalaDax2cdtfIdbg3aeaDam2cdtfgDIdwaH:tgQaQNaDIdbaA:tgCaCNaDIdlaO:tgXaXNMMg5:rgEMg8EaK9ETmbJbbbbh8Adna5Jbbbb9ETmba8EaK:taEaEM:vh8Aka8AaQNaHMhHa8AaXNaOMhOa8AaCNaAMhAa3aKaEMMJbbbZNhKkakclfhkadaqcefgq9hmbkkabaKUdxabaHUdwabaOUdlabaAUdbawcjef8Kjjjjbk:reevu8Jjjjjbcj8W9Rgr8Kjjjjbaici2hwcbhDdnaiTmbarhiawhqinaiaeadRbbgkcdtfydbBdbaDakcefgkaDak0EhDaiclfhiadcefhdaqcufgqmbkkabarawaeaDalaoz:jjjjbarcj8Wf8Kjjjjbk:Eeeeu8Jjjjjbca9Rgo8Kjjjjbab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbdnadTmbaocbBd3ao9cb83iwao9cb83ibaoaeadaialaoc3falEavcbalEcrcbz:kjjjbabao8Pib83dbabao8Piw83dwkaocaf8Kjjjjbk:SmeQu8Jjjjjbcjz9Rgv8KjjjjbcbhoavcjPfcbaez:rjjjb8Aavcjxfcbaez:rjjjb8AdnaiTmbadhoaihrinavcjxfaoRbbfgwawRbbcef86bbavcjxfaocefRbbfgwawRbbcef86bbavcjxfaocdfRbbfgwawRbbcef86bbaocifhoarcufgrmbkcbhDcjehoadhqcehkindndnalTmbcbhxcuhmaqhrakhwcuhPinawcufamaoavcjPfarcefRbbgsfRbb9RcFeGgzci6aoavcjPfarRbbgHfRbb9RcFeGgOci6faoavcjPfarcdfRbbgAfRbb9RcFeGgCci6fgXcOtaOcFr7azaCf9RcwtVavcjxfaAfRbbgzavcjxfaHfRbbgHavcjxfasfRbbgsaHas6Egsazas6EcFe7VgsaP9kgzEhmaXcd6gHaxcefgOal9iVce9hmdasaPazEhPaxaOaHEhxarcifhrawai6hsawcefhwasmbxdkkcuhmaqhrakhwcuhxinawcufamaoavcjPfarcefRbbfRbb9RcFeGci6aoavcjPfarRbbfRbb9RcFeGci6faoavcjPfarcdfRbbfRbb9RcFeGci6fgPax9kgsEhmaPce0meaPaxasEhxarcifhrawai6hPawcefhwaPmbkkadamci2fgrcdfRbbhwarcefRbbhxarRbbhPadaDci2fgrcifaramaD9Rci2zNjjjb8AaPavcjPffaocefgo86bbaPavcjxffgmamRbbcuf86bbaxavcjPffao86bbaxavcjxffgmamRbbcuf86bbarcdfaw86bbarcefax86bbaraP86bbawavcjPffao86bbawavcjxffgrarRbbcuf86bbaqcifhqakcefhkaDcefgDai9hmbkcbhzdnalcb9mmbcbhsavcjPfcbaez:rjjjb8Aadcvfhlinadasci2fgxcefgDRbbhoaxcdfgqRbbhrdndnavcjPfaxRbbgmfRbbmbavcjPfarfRbbhwdndndnavcjPfaofRbbTmbawcFeGTmexikawcFeGmdascefgAai9pmdasc980mdascifhQcbhLarcFeGhCamcFeGhXalhwcbhKcbhYinawcufRbbhPawRbbhOcehkdndnawc9:fRbbgHao9hmbaPcFeGamSmekdnaPcFeGao9hmbaOcFeGamSmekaHamSaOcFeGaoSGhkkceh8AaYceGhYdndnaHar9hmbaPcFeGaoSmekdnaPcFeGar9hmbaOcFeGaoSmekaHaoSaOcFeGarSGh8AkakaYVhYaLaHcFeGgHaXSaPcFeGgPaCSGaPaXSaOcFeGgPaCSGVaHaCSaPaXSGVVhLa8AaKceGVhKdnaAcefgPai9pmbawcifhwaAaQ6hHaPhAaHmekkaYTmeaKmekarhwaohPaohHarhOamhrxdkaYTaLVceGmbamhwarhParhHamhOaohrxekaohwamhPamhHaohOkavcjPfarfce86bbavcjPfawfce86bbaxaH86bbaqar86bbaDaO86bbavcjPfaPfce86bbalcifhlascefgsai9hmbkkavcFeaecetz:rjjjbhwaici2hrindnawadRbbgmcetfgx8Uebgocu9kmbaxaz87ebawcjlfazcdtfabamcdtfydbBdbazhoazcefhzkadao86bbadcefhdarcufgrmbkazcdthokabavcjlfaoz:qjjjb8Aavcjzf8KjjjjbkObabaiaeadcbz:njjjbk9teiucbcbyd;8:G:cjbgeabcifc98GfgbBd;8:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;8:G:cjbgeabcrfc94GfgbBd;8:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd;8:G:cjbge9Rcifc98GaefgbBd;8:G:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akk:3qeludndnadch6mbadTmeabaead;8qbbabskabaeSmbdnaeadabfgi9Rcbadcet9R0mbadTmeabaead;8qbbabskaeab7ciGhldndndnabae9pmbdnalTmbadhvabhixikdnabciGmbadhvabhixdkadTmiabaeRbb86bbadcufhvdnabcefgiciGmbaecefhexdkavTmiabaeRbe86beadc9:fhvdnabcdfgiciGmbaecdfhexdkavTmiabaeRbd86bdadc99fhvdnabcifgiciGmbaecifhexdkavTmiabaeRbi86biabclfhiaeclfheadc98fhvxekdnalmbdnaiciGTmbadTmlabadcufgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc9:fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc99fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc98fgdfaeadfRbb86bbkadcl6mbdnadc98fgocxGcxSmbaocd4cefciGhiaec98fhlabc98fhvinavadfaladfydbBdbadc98fhdaicufgimbkkaocx6mbaec9Wfhvabc9WfhoinaoadfgicxfavadfglcxfydbBdbaicwfalcwfydbBdbaiclfalclfydbBdbaialydbBdbadc9Wfgdci0mbkkadTmdadhidnadciGglTmbaecufhvabcufhoadhiinaoaifavaifRbb86bbaicufhialcufglmbkkadcl6mdaec98fhlabc98fhvinavaifgecifalaifgdcifRbb86bbaecdfadcdfRbb86bbaecefadcefRbb86bbaeadRbb86bbaic98fgimbxikkavcl6mbdnavc98fglc3Gc3Smbavalcd4cefcrGgdcdt9RhvinaiaeydbBdbaeclfheaiclfhiadcufgdmbkkalc36mbinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaiczfaeczfydbBdbaicCfaecCfydbBdbaicKfaecKfydbBdbaic3faec3fydbBdbaecafheaicafhiavc9Gfgvci0mbkkavTmbdndnavcrGgdmbavhlxekavc94GhlinaiaeRbb86bbaicefhiaecefheadcufgdmbkkavcw6mbinaiaeRbb86bbaicefaecefRbb86bbaicdfaecdfRbb86bbaicifaecifRbb86bbaiclfaeclfRbb86bbaicvfaecvfRbb86bbaicofaecofRbb86bbaicrfaecrfRbb86bbaicwfhiaecwfhealc94fglmbkkabkk:pedbcj:GdktFFuuFFuuFFuubbbbFFuFFFuFFFuFbbbbbbjZbbbbbbbbbbbbbbjZbbbbbbbbbbbbbbjZ86;nAZ86;nAZ86;nAZ86;nA:;86;nAZ86;nAZ86;nAZ86;nA:;86;nAZ86;nAZ86;nAZ86;nA:;bc;0:Gdkxebbbdbbbj:qbb",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(_){n=_.instance,n.exports.__wasm_call_ctors()});function o(_){for(var y=new Uint8Array(_.length),C=0;C<_.length;++C){var E=_.charCodeAt(C);y[C]=E>96?E-97:E>64?E-39:E+4}for(var b=0,C=0;C<_.length;++C)y[b++]=y[C]<60?t[y[C]]:(y[C]-60)*64+y[++C];return y.buffer.slice(0,b)}function r(_){if(!_)throw new Error("Assertion failed")}function a(_){return new Uint8Array(_.buffer,_.byteOffset,_.byteLength)}var s=48,c=16;function u(_,y){var C=_.meshlets[y*4+0],E=_.meshlets[y*4+1],b=_.meshlets[y*4+2],x=_.meshlets[y*4+3];return{vertices:_.vertices.subarray(C,C+b),triangles:_.triangles.subarray(E,E+x*3)}}function f(_,y,C,E,b,x,S,B,v,P){var N=n.exports.sbrk,L=n.exports.meshopt_buildMeshletsBound(y.length,x,S),g=N(L*c),I=N(y.length*4),T=N(y.length),w=N(y.byteLength),R=N(C.byteLength),O=new Uint8Array(n.exports.memory.buffer);O.set(a(y),w),O.set(a(C),R);var G=_(g,I,T,w,y.length,R,E,b,x,S,B,v,P);O=new Uint8Array(n.exports.memory.buffer);for(var F=O.subarray(g,g+G*c),U=new Uint32Array(F.buffer,F.byteOffset,F.byteLength/4).slice(),Q=0;Q<G;++Q){var H=U[Q*4+0],Y=U[Q*4+1],E=U[Q*4+2],$=U[Q*4+3];n.exports.meshopt_optimizeMeshlet(I+H*4,T+Y,$,E)}var W=U[(G-1)*4+0],K=U[(G-1)*4+1],Z=U[(G-1)*4+2],pe=U[(G-1)*4+3],ge=W+Z,re=K+pe*3,ye={meshlets:U,vertices:new Uint32Array(O.buffer,I,ge).slice(),triangles:new Uint8Array(O.buffer,T,re).slice(),meshletCount:G};return N(g-N(0)),ye}function h(_){var y=new Float32Array(n.exports.memory.buffer,_,s/4);return{centerX:y[0],centerY:y[1],centerZ:y[2],radius:y[3],coneApexX:y[4],coneApexY:y[5],coneApexZ:y[6],coneAxisX:y[7],coneAxisY:y[8],coneAxisZ:y[9],coneCutoff:y[10]}}function p(_,y,C,E){var b=n.exports.sbrk,x=[],S=b(y.byteLength),B=b(_.vertices.byteLength),v=b(_.triangles.byteLength),P=b(s),N=new Uint8Array(n.exports.memory.buffer);N.set(a(y),S),N.set(a(_.vertices),B),N.set(a(_.triangles),v);for(var L=0;L<_.meshletCount;++L){var g=_.meshlets[L*4+0],I=_.meshlets[L*4+0+1],T=_.meshlets[L*4+0+3];n.exports.meshopt_computeMeshletBounds(P,B+g*4,v+I,T,S,C,E),x.push(h(P))}return b(S-b(0)),x}function A(_,y,C,E){var b=n.exports.sbrk,x=b(s),S=b(_.byteLength),B=b(y.byteLength),v=new Uint8Array(n.exports.memory.buffer);v.set(a(_),S),v.set(a(y),B),n.exports.meshopt_computeClusterBounds(x,S,_.length,B,C,E);var P=h(x);return b(x-b(0)),P}function m(_,y,C,E,b){var x=n.exports.sbrk,S=x(s),B=x(_.byteLength),v=E?x(E.byteLength):0,P=new Uint8Array(n.exports.memory.buffer);P.set(a(_),B),E&&P.set(a(E),v),n.exports.meshopt_computeSphereBounds(S,B,y,C,v,E?b:0);var N=h(S);return x(S-x(0)),N}return{ready:i,supported:!0,buildMeshlets:function(_,y,C,E,b,x){r(_.length%3==0),r(y instanceof Float32Array),r(y.length%C==0),r(C>=3),r(E>=3&&E<=256),r(b>=1&&b<=512),x=x||0;var S=_.BYTES_PER_ELEMENT==4?_:new Uint32Array(_);return f(n.exports.meshopt_buildMeshletsFlex,S,y,y.length/C,C*4,E,b,b,x,0)},buildMeshletsFlex:function(_,y,C,E,b,x,S,B){r(_.length%3==0),r(y instanceof Float32Array),r(y.length%C==0),r(C>=3),r(E>=3&&E<=256),r(b>=1&&x<=512),r(b<=x),S=S||0,B=B||0;var v=_.BYTES_PER_ELEMENT==4?_:new Uint32Array(_);return f(n.exports.meshopt_buildMeshletsFlex,v,y,y.length/C,C*4,E,b,x,S,B)},buildMeshletsSpatial:function(_,y,C,E,b,x,S){r(_.length%3==0),r(y instanceof Float32Array),r(y.length%C==0),r(C>=3),r(E>=3&&E<=256),r(b>=1&&x<=512),r(b<=x),S=S||0;var B=_.BYTES_PER_ELEMENT==4?_:new Uint32Array(_);return f(n.exports.meshopt_buildMeshletsSpatial,B,y,y.length/C,C*4,E,b,x,S)},extractMeshlet:function(_,y){return r(y>=0&&y<_.meshletCount),u(_,y)},computeClusterBounds:function(_,y,C){r(_.length%3==0),r(_.length/3<=512),r(y instanceof Float32Array),r(y.length%C==0),r(C>=3);var E=_.BYTES_PER_ELEMENT==4?_:new Uint32Array(_);return A(E,y,y.length/C,C*4)},computeMeshletBounds:function(_,y,C){return r(_.meshletCount!=0),r(y instanceof Float32Array),r(y.length%C==0),r(C>=3),p(_,y,y.length/C,C*4)},computeSphereBounds:function(_,y,C,E){return r(_ instanceof Float32Array),r(_.length%y==0),r(y>=3),r(!C||C instanceof Float32Array),r(!C||C.length%E==0),r(!C||E>=1),r(!C||_.length/y==C.length/E),E=E||0,m(_,_.length/y,y*4,C,E*4)}}})();var CY=class extends Ki{constructor(t){super(),t=t??V.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,o=t.bufferViewId,r=t.gltfResource,a=t.baseResource,s=t.cacheKey,c=i.bufferViews[o],u=c.buffer,f=c.byteOffset,h=c.byteLength,p=!1,A,m,_,y;if(xi(c,"EXT_meshopt_compression")){let E=c.extensions.EXT_meshopt_compression;u=E.buffer,f=E.byteOffset??0,h=E.byteLength,p=!0,A=E.byteStride,m=E.count,_=E.mode,y=E.filter??"NONE"}let C=i.buffers[u];this._hasMeshopt=p,this._meshoptByteStride=A,this._meshoptCount=m,this._meshoptMode=_,this._meshoptFilter=y,this._resourceCache=n,this._gltfResource=r,this._baseResource=a,this._buffer=C,this._bufferId=u,this._byteOffset=f,this._byteLength=h,this._cacheKey=s,this._bufferLoader=void 0,this._typedArray=void 0,this._state=gt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get typedArray(){return this._typedArray}async load(){return l(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=n8e(this),this._promise)}unload(){l(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0}};async function n8e(e){try{let t=i8e(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,a=new Uint8Array(o*r);Cy.decodeGltfBuffer(a,o,r,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=a}return e._state=gt.READY,e}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load buffer view",t)}}function i8e(e){let t=e._resourceCache,n=e._buffer;if(l(n.uri)){let r=e._baseResource.getDerivedResource({url:n.uri});return t.getExternalBufferLoader({resource:r})}let i=n.extras?._pipeline?.source;return t.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:e._bufferId,typedArray:i})}var Jx=CY;var A0=class e{static _getDecoderTaskProcessor(){if(!l(e._decoderTaskProcessor)){let t=new Zn("decodeDraco",e._maxDecodingConcurrency);t.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(n){n?e._taskProcessorReady=!0:e._error=new ue("Draco decoder could not be initialized.")}).catch(n=>{e._error=n}),e._decoderTaskProcessor=t}return e._decoderTaskProcessor}static decodePointCloud(t){let n=e._getDecoderTaskProcessor();if(l(e._error))throw e._error;if(e._taskProcessorReady)return n.scheduleTask(t,[t.buffer.buffer])}static decodeBufferView(t){let n=e._getDecoderTaskProcessor();if(l(e._error))throw e._error;if(e._taskProcessorReady)return n.scheduleTask(t,[t.array.buffer])}};A0._maxDecodingConcurrency=Math.max(fn.hardwareConcurrency-1,1);A0._decoderTaskProcessor=void 0;A0._taskProcessorReady=!1;A0._error=void 0;var ig=A0;var On={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID",SCALE:"KHR_gaussian_splatting:SCALE",ROTATION:"KHR_gaussian_splatting:ROTATION",CUMULATIVE_DISTANCE:"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE"};function o8e(e){switch(e){case On.POSITION:return"positionMC";case On.NORMAL:return"normalMC";case On.TANGENT:return"tangentMC";case On.TEXCOORD:return"texCoord";case On.COLOR:return"color";case On.JOINTS:return"joints";case On.WEIGHTS:return"weights";case On.FEATURE_ID:return"featureId";case On.SCALE:return"scale";case On.ROTATION:return"rotation";case On.CUMULATIVE_DISTANCE:return"cumulativeDistance"}}On.hasSetIndex=function(e){switch(e){case On.POSITION:case On.NORMAL:case On.TANGENT:case On.CUMULATIVE_DISTANCE:return!1;case On.TEXCOORD:case On.COLOR:case On.JOINTS:case On.WEIGHTS:case On.FEATURE_ID:case On.SCALE:case On.ROTATION:return!0}};On.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return On.POSITION;case"NORMAL":return On.NORMAL;case"TANGENT":return On.TANGENT;case"TEXCOORD":return On.TEXCOORD;case"COLOR":return On.COLOR;case"JOINTS":return On.JOINTS;case"WEIGHTS":return On.WEIGHTS;case"_FEATURE_ID":return On.FEATURE_ID;case"KHR_gaussian_splatting:SCALE":case"_SCALE":return On.SCALE;case"KHR_gaussian_splatting:ROTATION":case"_ROTATION":return On.ROTATION;case"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE":return On.CUMULATIVE_DISTANCE}};On.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return On.POSITION;case"RGBA":case"RGB":case"RGB565":return On.COLOR;case"NORMAL":case"NORMAL_OCT16P":return On.NORMAL;case"BATCH_ID":return On.FEATURE_ID}};On.getGlslType=function(e){switch(e){case On.POSITION:case On.NORMAL:case On.TANGENT:return"vec3";case On.TEXCOORD:return"vec2";case On.COLOR:return"vec4";case On.JOINTS:return"ivec4";case On.WEIGHTS:return"vec4";case On.FEATURE_ID:return"int";case On.SCALE:return"vec3";case On.ROTATION:return"vec4";case On.CUMULATIVE_DISTANCE:return"float";case On.OPACITY:return"float"}};On.getVariableName=function(e,t){let n=o8e(e);return l(t)&&(n+=`_${t}`),n};var at=Object.freeze(On);var EY=class extends Ki{constructor(t){super(),t=t??V.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,o=t.primitive,r=t.draco,a=t.gltfResource,s=t.baseResource,c=t.cacheKey;this._resourceCache=n,this._gltfResource=a,this._baseResource=s,this._gltf=i,this._primitive=o,this._draco=r,this._cacheKey=c,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=gt.UNLOADED,this._promise=void 0,this._dracoError=void 0}get cacheKey(){return this._cacheKey}get decodedData(){return this._decodedData}async load(){return l(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=r8e(this),this._promise)}process(t){if(this._state===gt.READY)return!0;if(this._state!==gt.PROCESSING||(l(this._dracoError)&&vue(this,this._dracoError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let n=this._draco,i=this._primitive,o=this._gltf,r=o.bufferViews,a=n.bufferView,s=r[a],c=n.attributes,u=[];for(let p in i.attributes)if(i.attributes.hasOwnProperty(p)){let A=s8e(p);l(A)&&o.accessors[i.attributes[p]].componentType===j.FLOAT&&(u.includes(A)||u.push(A))}let f={array:new Uint8Array(this._bufferViewTypedArray),bufferView:s,compressedAttributes:c,dequantizeInShader:!0,attributesToSkipTransform:u},h=ig.decodeBufferView(f);if(!l(h))return!1;this._decodePromise=a8e(this,h)}unload(){l(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0,this._primitive=void 0}};async function r8e(e){let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._draco.bufferView,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._bufferViewTypedArray=n.typedArray,e._state=gt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;vue(e,n)}}function vue(e,t){throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load Draco",t)}async function a8e(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=gt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}var g0={};g0[at.POSITION]="POSITION";g0[at.NORMAL]="NORMAL";g0[at.COLOR]="COLOR";g0[at.TEXCOORD]="TEX_COORD";function s8e(e){for(let t in g0)if(g0.hasOwnProperty(t)&&e.startsWith(t))return g0[t]}var Zx=EY;function c8e(e){let{uint8Array:t,format:n,request:i}=e,o=e.flipY??!1,r=e.skipColorSpaceConversion??!1,a=new Blob([t],{type:n}),s;return De.supportsImageBitmapOptions().then(function(c){return c?Promise.resolve(De.createImageBitmapFromBlob(a,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:r})):(s=window.URL.createObjectURL(a),new De({url:s,request:i}).fetchImage({flipY:o,skipColorSpaceConversion:r}))}).then(function(c){return l(s)&&window.URL.revokeObjectURL(s),c}).catch(function(c){return l(s)&&window.URL.revokeObjectURL(s),Promise.reject(c)})}var og=c8e;var WM=class extends Ki{constructor(t){super(),t=t??V.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,o=t.imageId,r=t.gltfResource,a=t.baseResource,s=t.cacheKey,c=i.images[o],u=c.bufferView,f=c.uri;this._resourceCache=n,this._gltfResource=r,this._baseResource=a,this._gltf=i,this._bufferViewId=u,this._uri=f,this._cacheKey=s,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=gt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get image(){return this._image}get mipLevels(){return this._mipLevels}load(){return l(this._promise)?this._promise:l(this._bufferViewId)?(this._promise=l8e(this),this._promise):(this._promise=u8e(this),this._promise)}unload(){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}};function Pue(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 l8e(e){e._state=gt.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=n,await n.load(),e.isDestroyed())return;let i=n.typedArray,o=await d8e(i);if(e.isDestroyed())return;let r=Pue(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=gt.READY,e}catch(n){return e.isDestroyed()?void 0:Rue(e,n,"Failed to load embedded image")}}async function u8e(e){e._state=gt.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let o=await m8e(i);if(e.isDestroyed())return;let r=Pue(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=gt.READY,e}catch(o){return e.isDestroyed()?void 0:Rue(e,o,`Failed to load image: ${n}`)}}function Rue(e,t,n){return e.unload(),e._state=gt.FAILED,Promise.reject(e.getError(n,t))}function f8e(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 d8e(e){let t=f8e(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return _u(n)}return WM._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var h8e=/(^data:image\/ktx2)|(\.ktx2$)/i;function m8e(e){let t=e.getUrlComponent(!1,!0);return h8e.test(t)?_u(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}WM._loadImageFromTypedArray=og;var $x=WM;var p8e={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},Bc=Object.freeze(p8e);var bY=class extends Ki{constructor(t){super(),t=t??V.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,o=t.accessorId,r=t.gltfResource,a=t.baseResource,s=t.primitive,c=t.draco,u=t.cacheKey,f=t.asynchronous??!0,h=t.loadBuffer??!1,p=t.loadTypedArray??!1,A=i.accessors[o].componentType;this._resourceCache=n,this._gltfResource=r,this._baseResource=a,this._gltf=i,this._accessorId=o,this._indexDatatype=A,this._primitive=s,this._draco=c,this._cacheKey=u,this._asynchronous=f,this._loadBuffer=h,this._loadTypedArray=p,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=gt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get buffer(){return this._buffer}get typedArray(){return this._typedArray}get indexDatatype(){return this._indexDatatype}async load(){return l(this._promise)?this._promise:l(this._draco)?(this._promise=g8e(this),this._promise):(this._promise=_8e(this),this._promise)}process(t){if(this._state===gt.READY)return!0;if(this._state!==gt.LOADED&&this._state!==gt.PROCESSING)return!1;let n=this._typedArray,i=this._indexDatatype;if(l(this._dracoLoader))try{this._dracoLoader.process(t)&&(n=this._dracoLoader.decodedData.indices.typedArray,this._typedArray=n,i=j.fromTypedArray(n),this._indexDatatype=i)}catch(r){xY(this,r)}if(!l(n))return!1;let o;if(this._loadBuffer&&this._asynchronous){let r=A8e;if(r.set(n,i,t.context),!t.jobScheduler.execute(r,Bc.BUFFER))return!1;o=r.buffer}else this._loadBuffer&&(o=Mue(n,i,t.context));return this.unload(),this._buffer=o,this._typedArray=this._loadTypedArray?n:void 0,this._state=gt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0}unload(){l(this._buffer)&&this._buffer.destroy();let t=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&t.unload(this._bufferViewLoader),l(this._dracoLoader)&&t.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0,this._primitive=void 0}},IY=class{constructor(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}set(t,n,i){this.typedArray=t,this.indexDatatype=n,this.context=i}execute(){this.buffer=Mue(this.typedArray,this.indexDatatype,this.context)}};function Mue(e,t,n){let i=tt.createIndexBuffer({typedArray:e,context:n,usage:Re.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}var A8e=new IY;async function g8e(e){e._state=gt.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,primitive:e._primitive,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=gt.LOADED,e)}catch(n){if(e.isDestroyed())return;xY(e,n)}}async function _8e(e){let t=e._gltf,n=e._accessorId,o=t.accessors[n].bufferView;e._state=gt.LOADING;let r=e._resourceCache;try{let a=r.getBufferViewLoader({gltf:t,bufferViewId:o,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=a,await a.load(),e.isDestroyed())return;let s=a.typedArray;return e._typedArray=y8e(e,s),e._state=gt.PROCESSING,e}catch(a){if(e.isDestroyed())return;xY(e,a)}}function y8e(e,t){let n=e._gltf,i=e._accessorId,o=n.accessors[i],r=o.count,a=o.componentType,s=Ue.getSizeInBytes(a),c=t.buffer,u=t.byteOffset+o.byteOffset;if(u%s!==0){let h=r*s,p=new Uint8Array(c,u,h);c=new Uint8Array(p).buffer,u=0,Ms("index-buffer-unaligned",`The index array is not aligned to a ${s}-byte boundary.`)}let f;return a===Ue.UNSIGNED_BYTE?f=new Uint8Array(c,u,r):a===Ue.UNSIGNED_SHORT?f=new Uint16Array(c,u,r):a===Ue.UNSIGNED_INT&&(f=new Uint32Array(c,u,r)),f}function xY(e,t){throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load index buffer",t)}var eT=bY;function C8e(e,t,n){if(n=n??!1,n){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1}var ds=C8e;function E8e(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var Or=E8e;function nn(){}nn.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}}};nn.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}}};nn.topLevel=function(e,t,n){let i=e[t];return l(i)&&!Array.isArray(i)?nn.objectLegacy(i,n):nn.object(i,n)};nn.accessor=function(e,t){return nn.topLevel(e,"accessors",t)};nn.accessorWithSemantic=function(e,t,n){let i={};return nn.mesh(e,function(o){return nn.meshPrimitive(o,function(r){let a=nn.meshPrimitiveAttribute(r,function(s,c){if(c.indexOf(t)===0&&!l(i[s])){i[s]=!0;let u=n(s);if(l(u))return u}});return l(a)?a:nn.meshPrimitiveTarget(r,function(s){return nn.meshPrimitiveTargetAttribute(s,function(c,u){if(u.indexOf(t)===0&&!l(i[c])){i[c]=!0;let f=n(c);if(l(f))return f}})})})})};nn.accessorContainingVertexAttributeData=function(e,t){let n={};return nn.mesh(e,function(i){return nn.meshPrimitive(i,function(o){let r=nn.meshPrimitiveAttribute(o,function(a){if(!l(n[a])){n[a]=!0;let s=t(a);if(l(s))return s}});return l(r)?r:nn.meshPrimitiveTarget(o,function(a){return nn.meshPrimitiveTargetAttribute(a,function(s){if(!l(n[s])){n[s]=!0;let c=t(s);if(l(c))return c}})})})})};nn.accessorContainingIndexData=function(e,t){let n={};return nn.mesh(e,function(i){return nn.meshPrimitive(i,function(o){let r=o.indices;if(l(r)&&!l(n[r])){n[r]=!0;let a=t(r);if(l(a))return a}})})};nn.animation=function(e,t){return nn.topLevel(e,"animations",t)};nn.animationChannel=function(e,t){let n=e.channels;return nn.object(n,t)};nn.animationSampler=function(e,t){let n=e.samplers;return nn.object(n,t)};nn.buffer=function(e,t){return nn.topLevel(e,"buffers",t)};nn.bufferView=function(e,t){return nn.topLevel(e,"bufferViews",t)};nn.camera=function(e,t){return nn.topLevel(e,"cameras",t)};nn.image=function(e,t){return nn.topLevel(e,"images",t)};nn.material=function(e,t){return nn.topLevel(e,"materials",t)};nn.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}};nn.mesh=function(e,t){return nn.topLevel(e,"meshes",t)};nn.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],a=t(r,o);if(l(a))return a}}};nn.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}};nn.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}}};nn.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}};nn.node=function(e,t){return nn.topLevel(e,"nodes",t)};nn.nodeInTree=function(e,t,n){let i=e.nodes;if(l(i)){let o=t.length;for(let r=0;r<o;r++){let a=t[r],s=i[a];if(l(s)){let c=n(s,a);if(l(c))return c;let u=s.children;if(l(u)&&(c=nn.nodeInTree(e,u,n),l(c)))return c}}}};nn.nodeInScene=function(e,t,n){let i=t.nodes;if(l(i))return nn.nodeInTree(e,i,n)};nn.program=function(e,t){return Or(e,"KHR_techniques_webgl")?nn.object(e.extensions.KHR_techniques_webgl.programs,t):nn.topLevel(e,"programs",t)};nn.sampler=function(e,t){return nn.topLevel(e,"samplers",t)};nn.scene=function(e,t){return nn.topLevel(e,"scenes",t)};nn.shader=function(e,t){return Or(e,"KHR_techniques_webgl")?nn.object(e.extensions.KHR_techniques_webgl.shaders,t):nn.topLevel(e,"shaders",t)};nn.skin=function(e,t){return nn.topLevel(e,"skins",t)};nn.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],a=t(r);if(l(a))return a}}};nn.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}};nn.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}};nn.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}};nn.technique=function(e,t){return Or(e,"KHR_techniques_webgl")?nn.object(e.extensions.KHR_techniques_webgl.techniques,t):nn.topLevel(e,"techniques",t)};nn.texture=function(e,t){return nn.topLevel(e,"textures",t)};var ze=nn;function b8e(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 gf=b8e;function I8e(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 j.getSizeInBytes(t.componentType)*gf(t.type)}var wu=I8e;function x8e(e){ze.accessor(e,function(n){l(n.bufferView)&&(n.byteOffset=n.byteOffset??0)}),ze.bufferView(e,function(n){l(n.buffer)&&(n.byteOffset=n.byteOffset??0)}),ze.mesh(e,function(n){ze.meshPrimitive(n,function(i){if(i.mode=i.mode??ee.TRIANGLES,!l(i.material)){l(e.materials)||(e.materials=[]);let o={name:"default"};i.material=ds(e.materials,o)}})}),ze.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],o=i.bufferView;if(i.normalized=i.normalized??!1,l(o)){let r=e.bufferViews[o];r.byteStride=wu(e,i),r.target=ee.ARRAY_BUFFER}}),ze.accessorContainingIndexData(e,function(n){let o=e.accessors[n].bufferView;if(l(o)){let r=e.bufferViews[o];r.target=ee.ELEMENT_ARRAY_BUFFER}}),ze.material(e,function(n){let i=n.extensions??{},o=i.KHR_materials_common;if(l(o)){let c=o.technique,u=l(o.values)?o.values:{};o.values=u,u.ambient=l(u.ambient)?u.ambient:[0,0,0,1],u.emission=l(u.emission)?u.emission:[0,0,0,1],u.transparency=u.transparency??1,c!=="CONSTANT"&&(u.diffuse=l(u.diffuse)?u.diffuse:[0,0,0,1],c!=="LAMBERT"&&(u.specular=l(u.specular)?u.specular:[0,0,0,1],u.shininess=u.shininess??0)),o.transparent=o.transparent??!1,o.doubleSided=o.doubleSided??!1;return}n.emissiveFactor=n.emissiveFactor??[0,0,0],n.alphaMode=n.alphaMode??"OPAQUE",n.doubleSided=n.doubleSided??!1,n.alphaMode==="MASK"&&(n.alphaCutoff=n.alphaCutoff??.5);let r=i.KHR_techniques_webgl;l(r)&&ze.materialValue(n,function(c){l(c.index)&&_0(c)}),_0(n.emissiveTexture),_0(n.normalTexture),_0(n.occlusionTexture);let a=n.pbrMetallicRoughness;l(a)&&(a.baseColorFactor=a.baseColorFactor??[1,1,1,1],a.metallicFactor=a.metallicFactor??1,a.roughnessFactor=a.roughnessFactor??1,_0(a.baseColorTexture),_0(a.metallicRoughnessTexture));let s=i.KHR_materials_pbrSpecularGlossiness;l(s)&&(s.diffuseFactor=s.diffuseFactor??[1,1,1,1],s.specularFactor=s.specularFactor??[1,1,1],s.glossinessFactor=s.glossinessFactor??1,_0(s.specularGlossinessTexture))}),ze.animation(e,function(n){ze.animationSampler(n,function(i){i.interpolation=i.interpolation??"LINEAR"})});let t=T8e(e);return ze.node(e,function(n,i){l(t[i])||l(n.translation)||l(n.rotation)||l(n.scale)?(n.translation=n.translation??[0,0,0],n.rotation=n.rotation??[0,0,0,1],n.scale=n.scale??[1,1,1]):n.matrix=n.matrix??[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}),ze.sampler(e,function(n){n.wrapS=n.wrapS??ee.REPEAT,n.wrapT=n.wrapT??ee.REPEAT}),l(e.scenes)&&!l(e.scene)&&(e.scene=0),e}function T8e(e){let t={};return ze.animation(e,function(n){ze.animationChannel(n,function(i){let o=i.target,r=o.node,a=o.path;(a==="translation"||a==="rotation"||a==="scale")&&(t[r]=!0)})}),t}function _0(e){l(e)&&(e.texCoord=e.texCoord??0)}var jM=x8e;function S8e(e){return ze.shader(e,function(t){FV(t)}),ze.buffer(e,function(t){FV(t)}),ze.image(e,function(t){FV(t)}),FV(e),e}function FV(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var Ey=S8e;function w8e(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 YM=w8e;function B8e(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),YM(e,t),n.length===0&&delete e.extensionsUsed}}var y0=B8e;var D8e=4;function v8e(e){if(zh(e)!=="glTF")throw new ue("File is not valid binary glTF");let n=Nue(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?P8e(e,n):R8e(e,n)}function Nue(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*D8e,!0);return o}function P8e(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,a=r+i,s=xu(e,r,i),c=JSON.parse(s);Ey(c);let u=e.subarray(a,n),f=c.buffers;if(l(f)&&Object.keys(f).length>0){let h=f.binary_glTF??f.KHR_binary_glTF;l(h)&&(h.extras._pipeline.source=u,delete h.uri)}return y0(c,"KHR_binary_glTF"),c}function R8e(e,t){let n=t[2],i=12,o,r;for(;i<n;){let a=Nue(e,i,2),s=a[0],c=a[1];i+=8;let u=e.subarray(i,i+s);if(i+=s,c===1313821514){let f=xu(u);o=JSON.parse(f),Ey(o)}else c===5130562&&(r=u)}if(l(o)&&l(r)){let a=o.buffers;if(l(a)&&a.length>0){let s=a[0];s.extras._pipeline.source=r}}return o}var C0=v8e;function M8e(e){return ze.shader(e,function(t){QV(t)}),ze.buffer(e,function(t){QV(t)}),ze.image(e,function(t){QV(t)}),QV(e),e}function QV(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var qM=M8e;function N8e(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),ds(n,t,!0)}var Td=N8e;function L8e(e){switch(e){case j.BYTE:return function(t,n,i,o,r){for(let a=0;a<i;++a)r[a]=t.getInt8(n+a*o)};case j.UNSIGNED_BYTE:return function(t,n,i,o,r){for(let a=0;a<i;++a)r[a]=t.getUint8(n+a*o)};case j.SHORT:return function(t,n,i,o,r){for(let a=0;a<i;++a)r[a]=t.getInt16(n+a*o,!0)};case j.UNSIGNED_SHORT:return function(t,n,i,o,r){for(let a=0;a<i;++a)r[a]=t.getUint16(n+a*o,!0)};case j.INT:return function(t,n,i,o,r){for(let a=0;a<i;++a)r[a]=t.getInt32(n+a*o,!0)};case j.UNSIGNED_INT:return function(t,n,i,o,r){for(let a=0;a<i;++a)r[a]=t.getUint32(n+a*o,!0)};case j.FLOAT:return function(t,n,i,o,r){for(let a=0;a<i;++a)r[a]=t.getFloat32(n+a*o,!0)};case j.DOUBLE:return function(t,n,i,o,r){for(let a=0;a<i;++a)r[a]=t.getFloat64(n+a*o,!0)}}}var rg=L8e;function O8e(e,t){let n=e.bufferViews,i=e.buffers,o=t.bufferView,r=gf(t.type);if(!l(t.bufferView))return{min:new Array(r).fill(0),max:new Array(r).fill(0)};let a=new Array(r).fill(Number.POSITIVE_INFINITY),s=new Array(r).fill(Number.NEGATIVE_INFINITY),c=n[o],u=c.buffer,h=i[u].extras._pipeline.source,p=t.count,A=wu(e,t),m=t.byteOffset+c.byteOffset+h.byteOffset,_=t.componentType,y=j.getSizeInBytes(_),C=new DataView(h.buffer),E=new Array(r),b=rg(_);for(let x=0;x<p;x++){b(C,m,r,y,E);for(let S=0;S<r;S++){let B=E[S];a[S]=Math.min(a[S],B),s[S]=Math.max(s[S],B)}m+=A}return{min:a,max:s}}var E0=O8e;var F8e=[ee.FUNC_ADD,ee.FUNC_ADD],Q8e=[ee.ONE,ee.ZERO,ee.ONE,ee.ZERO];function Lue(e,t){let n=e.enable;return l(n)?n.indexOf(t)>-1:!1}var k8e=[ee.ZERO,ee.ONE,ee.SRC_COLOR,ee.ONE_MINUS_SRC_COLOR,ee.SRC_ALPHA,ee.ONE_MINUS_SRC_ALPHA,ee.DST_ALPHA,ee.ONE_MINUS_DST_ALPHA,ee.DST_COLOR,ee.ONE_MINUS_DST_COLOR];function U8e(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(k8e.indexOf(e[n])===-1)return t;return e}function z8e(e){let t={},n={},i=e.techniques;return l(i)&&(ze.technique(e,function(o,r){let a=o.states;if(l(a)){let s=n[r]={};if(Lue(a,ee.BLEND)){s.alphaMode="BLEND";let c=a.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[r]={blendEquation:c.blendEquationSeparate??F8e,blendFactors:U8e(c.blendFuncSeparate,Q8e)})}Lue(a,ee.CULL_FACE)||(s.doubleSided=!0),delete o.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),Td(e,"KHR_blend")),ze.material(e,function(o){if(l(o.technique)){let r=n[o.technique];ze.objectLegacy(r,function(s,c){o[c]=s});let a=t[o.technique];l(a)&&(l(o.extensions)||(o.extensions={}),o.extensions.KHR_blend=a)}})),e}var KM=z8e;function G8e(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),ds(n,t,!0),Td(e,t)}var XM=G8e;function V8e(e){let t=e.techniques,n={},i={},o={};if(l(t)){let r={programs:[],shaders:[],techniques:[]},a=e.glExtensionsUsed;delete e.glExtensionsUsed,ze.technique(e,function(s,c){let u={name:s.name,program:void 0,attributes:{},uniforms:{}},f;if(ze.techniqueAttribute(s,function(h,p){f=s.parameters[h],u.attributes[p]={semantic:f.semantic}}),ze.techniqueUniform(s,function(h,p){f=s.parameters[h],u.uniforms[p]={count:f.count,node:f.node,type:f.type,semantic:f.semantic,value:f.value},l(n[c])||(n[c]={}),n[c][h]=p}),l(o[s.program]))u.program=o[s.program];else{let h=e.programs[s.program],p={name:h.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:a},A=e.shaders[h.fragmentShader];p.fragmentShader=ds(r.shaders,A,!0);let m=e.shaders[h.vertexShader];p.vertexShader=ds(r.shaders,m,!0),u.program=ds(r.programs,p),o[s.program]=u.program}i[c]=ds(r.techniques,u)}),r.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=r,Td(e,"KHR_techniques_webgl"),XM(e,"KHR_techniques_webgl"))}return ze.material(e,function(r){if(l(r.technique)){let a={technique:i[r.technique]};ze.objectLegacy(r.values,function(s,c){l(a.values)||(a.values={});let u=n[r.technique][c];l(u)&&(a.values[u]=s)}),l(r.extensions)||(r.extensions={}),r.extensions.KHR_techniques_webgl=a}delete r.technique,delete r.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var JM=V8e;function H8e(e,t){Vo.typeOf.object("material",e),Vo.defined("handler",t);let n=e.pbrMetallicRoughness;if(l(n)){if(l(n.baseColorTexture)){let r=n.baseColorTexture,a=t(r.index,r);if(l(a))return a}if(l(n.metallicRoughnessTexture)){let r=n.metallicRoughnessTexture,a=t(r.index,r);if(l(a))return a}}let{extensions:i}=e;if(l(i)){let r=i.KHR_materials_pbrSpecularGlossiness;if(l(r)){if(l(r.diffuseTexture)){let c=r.diffuseTexture,u=t(c.index,c);if(l(u))return u}if(l(r.specularGlossinessTexture)){let c=r.specularGlossinessTexture,u=t(c.index,c);if(l(u))return u}}let a=i.KHR_materials_specular;if(l(a)){let{specularTexture:c,specularColorTexture:u}=a;if(l(c)){let f=t(c.index,c);if(l(f))return f}if(l(u)){let f=t(u.index,u);if(l(f))return f}}let s=i.KHR_materials_common;if(l(s)&&l(s.values)){let{diffuse:c,ambient:u,emission:f,specular:h}=s.values;if(l(c)&&l(c.index)){let p=t(c.index,c);if(l(p))return p}if(l(u)&&l(u.index)){let p=t(u.index,u);if(l(p))return p}if(l(f)&&l(f.index)){let p=t(f.index,f);if(l(p))return p}if(l(h)&&l(h.index)){let p=t(h.index,h);if(l(p))return p}}}let o=ze.materialValue(e,function(r){if(l(r.index)){let a=t(r.index,r);if(l(a))return a}});if(l(o))return o;if(l(e.emissiveTexture)){let r=e.emissiveTexture,a=t(r.index,r);if(l(a))return a}if(l(e.normalTexture)){let r=e.normalTexture,a=t(r.index,r);if(l(a))return a}if(l(e.occlusionTexture)){let r=e.occlusionTexture,a=t(r.index,r);if(l(a))return a}}var tT=H8e;var Oue=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function W8e(e,t){return t=t??Oue,Oue.forEach(function(n){t.indexOf(n)>-1&&Y8e(e,n)}),e}var j8e={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function Y8e(e,t){let n=j8e[t],i=e[n];if(l(i)){let o=0,r=_p[t](e),a=i.length;for(let s=0;s<a;++s)r[s]||(gp[t](e,s-o),o++)}}function gp(){}gp.accessor=function(e,t){e.accessors.splice(t,1),ze.mesh(e,function(i){ze.meshPrimitive(i,function(o){ze.meshPrimitiveAttribute(o,function(s,c){s>t&&o.attributes[c]--}),ze.meshPrimitiveTarget(o,function(s){ze.meshPrimitiveTargetAttribute(s,function(c,u){c>t&&s[u]--})});let r=o.indices;l(r)&&r>t&&o.indices--;let a=o.extensions;l(a)&&l(a.CESIUM_primitive_outline)&&a.CESIUM_primitive_outline.indices>t&&--a.CESIUM_primitive_outline.indices})}),ze.skin(e,function(i){l(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),ze.animation(e,function(i){ze.animationSampler(i,function(o){l(o.input)&&o.input>t&&o.input--,l(o.output)&&o.output>t&&o.output--})})};gp.buffer=function(e,t){e.buffers.splice(t,1),ze.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--})};gp.bufferView=function(e,t){if(e.bufferViews.splice(t,1),ze.accessor(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),ze.shader(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),ze.image(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Or(e,"KHR_draco_mesh_compression")&&ze.mesh(e,function(i){ze.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 s=o[r].properties;if(l(s)){for(let c in s)if(s.hasOwnProperty(c)){let u=s[c];l(u.bufferView)&&u.bufferView>t&&u.bufferView--,l(u.arrayOffsetBufferView)&&u.arrayOffsetBufferView>t&&u.arrayOffsetBufferView--,l(u.stringOffsetBufferView)&&u.stringOffsetBufferView>t&&u.stringOffsetBufferView--}}}}if(Or(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTables;if(l(o)){let r=o.length;for(let a=0;a<r;++a){let c=o[a].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];l(f.values)&&f.values>t&&f.values--,l(f.arrayOffsets)&&f.arrayOffsets>t&&f.arrayOffsets--,l(f.stringOffsets)&&f.stringOffsets>t&&f.stringOffsets--}}}}};gp.image=function(e,t){e.images.splice(t,1),ze.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})};gp.mesh=function(e,t){e.meshes.splice(t,1),ze.node(e,function(i){l(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};gp.node=function(e,t){e.nodes.splice(t,1),ze.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})}),ze.animation(e,function(i){ze.animationChannel(i,function(o){l(o.target)&&l(o.target.node)&&o.target.node>t&&o.target.node--})}),ze.technique(e,function(i){ze.techniqueUniform(i,function(o){l(o.node)&&o.node>t&&o.node--})}),ze.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}))}),ze.scene(e,function(i){i.nodes=i.nodes.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o})})};gp.material=function(e,t){e.materials.splice(t,1),ze.mesh(e,function(i){ze.meshPrimitive(i,function(o){l(o.material)&&o.material>t&&o.material--})})};gp.sampler=function(e,t){e.samplers.splice(t,1),ze.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};gp.texture=function(e,t){if(e.textures.splice(t,1),ze.material(e,function(i){tT(i,function(o,r){r.index>t&&--r.index})}),Or(e,"EXT_feature_metadata")){ze.mesh(e,function(r){ze.meshPrimitive(r,function(a){let s=a.extensions;if(l(s)&&l(s.EXT_feature_metadata)){let u=s.EXT_feature_metadata.featureIdTextures;if(l(u)){let f=u.length;for(let h=0;h<f;++h){let A=u[h].featureIds.texture;A.index>t&&--A.index}}}})});let o=e.extensions.EXT_feature_metadata.featureTextures;for(let r in o)if(o.hasOwnProperty(r)){let s=o[r].properties;if(l(s)){for(let c in s)if(s.hasOwnProperty(c)){let f=s[c].texture;f.index>t&&--f.index}}}}if(Or(e,"EXT_mesh_features")&&ze.mesh(e,function(i){ze.meshPrimitive(i,function(o){let r=o.extensions;if(l(r)&&l(r.EXT_mesh_features)){let s=r.EXT_mesh_features.featureIds;if(l(s)){let c=s.length;for(let u=0;u<c;++u){let f=s[u];l(f.texture)&&f.texture.index>t&&--f.texture.index}}}})}),Or(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTextures;if(l(o)){let r=o.length;for(let a=0;a<r;++a){let c=o[a].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];f.index>t&&--f.index}}}}};function _p(){}_p.accessor=function(e){let t={};return ze.mesh(e,function(n){ze.meshPrimitive(n,function(i){ze.meshPrimitiveAttribute(i,function(r){t[r]=!0}),ze.meshPrimitiveTarget(i,function(r){ze.meshPrimitiveTargetAttribute(r,function(a){t[a]=!0})});let o=i.indices;l(o)&&(t[o]=!0)})}),ze.skin(e,function(n){l(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),ze.animation(e,function(n){ze.animationSampler(n,function(i){l(i.input)&&(t[i.input]=!0),l(i.output)&&(t[i.output]=!0)})}),Or(e,"EXT_mesh_gpu_instancing")&&ze.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")&&ze.mesh(e,function(n){ze.meshPrimitive(n,function(i){let o=i.extensions;if(l(o)&&l(o.CESIUM_primitive_outline)){let a=o.CESIUM_primitive_outline.indices;l(a)&&(t[a]=!0)}})}),t};_p.buffer=function(e){let t={};return ze.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};_p.bufferView=function(e){let t={};if(ze.accessor(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),ze.shader(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),ze.image(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Or(e,"KHR_draco_mesh_compression")&&ze.mesh(e,function(n){ze.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 a=i[o].properties;if(l(a)){for(let s in a)if(a.hasOwnProperty(s)){let c=a[s];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 s=i[r].properties;for(let c in s)if(s.hasOwnProperty(c)){let u=s[c];l(u.values)&&(t[u.values]=!0),l(u.arrayOffsets)&&(t[u.arrayOffsets]=!0),l(u.stringOffsets)&&(t[u.stringOffsets]=!0)}}}}return t};_p.image=function(e){let t={};return ze.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};_p.mesh=function(e){let t={};return ze.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 Fue(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!Fue(e,o,n)}).length===0}_p.node=function(e){let t={};return ze.skin(e,function(n){l(n.skeleton)&&(t[n.skeleton]=!0),ze.skinJoint(n,function(i){t[i]=!0})}),ze.animation(e,function(n){ze.animationChannel(n,function(i){l(i.target)&&l(i.target.node)&&(t[i.target.node]=!0)})}),ze.technique(e,function(n){ze.techniqueUniform(n,function(i){l(i.node)&&(t[i.node]=!0)})}),ze.node(e,function(n,i){Fue(e,i,t)||(t[i]=!0)}),t};_p.material=function(e){let t={};return ze.mesh(e,function(n){ze.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};_p.texture=function(e){let t={};if(ze.material(e,function(n){tT(n,function(i){t[i]=!0})}),Or(e,"EXT_feature_metadata")){ze.mesh(e,function(o){ze.meshPrimitive(o,function(r){let a=r.extensions;if(l(a)&&l(a.EXT_feature_metadata)){let c=a.EXT_feature_metadata.featureIdTextures;if(l(c)){let u=c.length;for(let f=0;f<u;++f){let p=c[f].featureIds.texture;t[p.index]=!0}}}})});let i=e.extensions.EXT_feature_metadata.featureTextures;for(let o in i)if(i.hasOwnProperty(o)){let a=i[o].properties;if(l(a)){for(let s in a)if(a.hasOwnProperty(s)){let u=a[s].texture;t[u.index]=!0}}}}if(Or(e,"EXT_mesh_features")&&ze.mesh(e,function(n){ze.meshPrimitive(n,function(i){let o=i.extensions;if(l(o)&&l(o.EXT_mesh_features)){let a=o.EXT_mesh_features.featureIds;if(l(a)){let s=a.length;for(let c=0;c<s;++c){let u=a[c];l(u.texture)&&(t[u.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 s=i[r].properties;for(let c in s)if(s.hasOwnProperty(c)){let u=s[c];t[u.index]=!0}}}}return t};_p.sampler=function(e){let t={};return ze.texture(e,function(n){l(n.sampler)&&(t[n.sampler]=!0)}),t};var ZM=W8e;function q8e(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},o={buffer:ds(e.buffers,n),byteOffset:0,byteLength:t.length};return ds(e.bufferViews,o)}var $M=q8e;function K8e(e,t){let n=wu(e,t),i=j.getSizeInBytes(t.componentType),o=gf(t.type),r=t.count,a=new Array(o*r);if(!l(t.bufferView))return a.fill(0);let s=e.bufferViews[t.bufferView],c=e.buffers[s.buffer].extras._pipeline.source,u=t.byteOffset+s.byteOffset+c.byteOffset,f=new DataView(c.buffer),h=new Array(o),p=rg(t.componentType);for(let A=0;A<r;++A){p(f,u,o,i,h);for(let m=0;m<o;++m)a[A*o+m]=h[m];u+=n}return a}var eN=K8e;function X8e(e){let t;return ze.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===ee.BYTE?kV(e,i,j.UNSIGNED_BYTE):t!==ee.UNSIGNED_BYTE&&t!==ee.UNSIGNED_SHORT&&kV(e,i,j.UNSIGNED_SHORT)}),ze.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===ee.BYTE?kV(e,i,j.UNSIGNED_BYTE):t===ee.SHORT&&kV(e,i,j.UNSIGNED_SHORT)}),e}function kV(e,t,n){let i=j.createTypedArray(n,eN(e,t)),o=new Uint8Array(i.buffer);t.bufferView=$M(e,o),t.componentType=n,t.byteOffset=0}var tN=X8e;function J8e(e,t){return y0(e,t),t==="CESIUM_RTC"&&Z8e(e),TY(e,t)}function Z8e(e){ze.technique(e,function(t){ze.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function TY(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)TY(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)&&TY(e[o],t);return i}}var b0=J8e;var UV={.8:oHe,"1.0":THe,"2.0":void 0};function $8e(e,t){t=t??{};let n=t.targetVersion,i=e.version;e.asset=e.asset??{version:"1.0"},e.asset.version=e.asset.version??"1.0",i=(i??e.asset.version).toString(),Object.prototype.hasOwnProperty.call(UV,i)||(l(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(UV,i)||(i="1.0"));let o=UV[i];for(;l(o)&&i!==n;)o(e,t),i=e.asset.version,o=UV[i];return t.keepLegacyExtensions||(BHe(e,t),DHe(e)),e}function Uue(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 eHe(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 a=0;a<r;++a){let s=o[a],c=s.primitive??ee.TRIANGLES;s.mode=s.mode??c,delete s.primitive}}}}function tHe(e){let t=e.nodes,n=new d,i=new Qe;for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o];if(l(r.rotation)){let s=r.rotation;d.fromArray(s,0,n),Qe.fromAxisAngle(n,s[3],i),r.rotation=[i.x,i.y,i.z,i.w]}let a=r.instanceSkin;l(a)&&(r.skeletons=a.skeletons,r.skin=a.skin,r.meshes=a.meshes,delete r.instanceSkin)}}function nHe(e){let t=e.animations,n=e.accessors,i=e.bufferViews,o=e.buffers,r={},a=new d,s=new Qe;for(let c in t)if(Object.prototype.hasOwnProperty.call(t,c)){let u=t[c],f=u.channels,h=u.parameters,p=u.samplers;if(l(f)){let A=f.length;for(let m=0;m<A;++m){let _=f[m];if(_.target.path==="rotation"){let y=h[p[_.sampler].output];if(l(r[y]))continue;r[y]=!0;let C=n[y],E=i[C.bufferView],x=o[E.buffer].extras._pipeline.source,S=x.byteOffset+E.byteOffset+C.byteOffset,B=C.componentType,v=C.count,P=gf(C.type),N=C.count*P,L=j.createArrayBufferView(B,x.buffer,S,N);for(let g=0;g<v;g++){let I=g*P;d.unpack(L,I,a);let T=L[I+3];Qe.fromAxisAngle(a,T,s),Qe.pack(s,L,I)}}}}}}function iHe(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=i.pass??"defaultPass";if(Object.prototype.hasOwnProperty.call(o,r)){let a=o[r],s=a.instanceProgram;i.attributes=i.attributes??s.attributes,i.program=i.program??s.program,i.uniforms=i.uniforms??s.uniforms,i.states=i.states??a.states}delete i.passes,delete i.pass}}}function oHe(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,Uue(e),eHe(e),tHe(e),nHe(e),iHe(e),l(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,delete e.allExtensions),l(e.lights)){let n=e.extensions??{};e.extensions=n;let i=n.KHR_materials_common??{};n.KHR_materials_common=i,i.lights=e.lights,delete e.lights,Td(e,"KHR_materials_common")}}function rHe(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 a in r)if(Object.prototype.hasOwnProperty.call(r,a)){let s=r[a];s.input=o[s.input],s.output=o[s.output]}delete i.parameters}}}function Que(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 aHe(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 a in r)Object.prototype.hasOwnProperty.call(r,a)&&(i=r[a].jointName,l(i)&&(o[i]=a));for(let a in e)if(Object.prototype.hasOwnProperty.call(e,a)&&l(n[a])){let s={},c=e[a];e[a]=Que(c,s),n[a]=s}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]),ze.bufferView(e,function(a){l(a.buffer)&&(a.buffer=n.buffers[a.buffer])}),ze.accessor(e,function(a){l(a.bufferView)&&(a.bufferView=n.bufferViews[a.bufferView])}),ze.shader(e,function(a){let s=a.extensions;if(l(s)){let c=s.KHR_binary_glTF;l(c)&&(a.bufferView=n.bufferViews[c.bufferView],delete s.KHR_binary_glTF),Object.keys(s).length===0&&delete a.extensions}}),ze.program(e,function(a){l(a.vertexShader)&&(a.vertexShader=n.shaders[a.vertexShader]),l(a.fragmentShader)&&(a.fragmentShader=n.shaders[a.fragmentShader])}),ze.technique(e,function(a){l(a.program)&&(a.program=n.programs[a.program]),ze.techniqueParameter(a,function(s){l(s.node)&&(s.node=n.nodes[s.node]);let c=s.value;typeof c=="string"&&(s.value={index:n.textures[c]})})}),ze.mesh(e,function(a){ze.meshPrimitive(a,function(s){l(s.indices)&&(s.indices=n.accessors[s.indices]),ze.meshPrimitiveAttribute(s,function(c,u){s.attributes[u]=n.accessors[c]}),l(s.material)&&(s.material=n.materials[s.material])})}),ze.node(e,function(a){let s=a.children;if(l(s)){let c=s.length;for(t=0;t<c;++t)s[t]=n.nodes[s[t]]}if(l(a.meshes)){let c=a.meshes,u=c.length;if(u>0)for(a.mesh=n.meshes[c[0]],t=1;t<u;++t){let f={mesh:n.meshes[c[t]]},h=ds(e.nodes,f);l(s)||(s=[],a.children=s),s.push(h)}delete a.meshes}if(l(a.camera)&&(a.camera=n.cameras[a.camera]),l(a.skin)&&(a.skin=n.skins[a.skin]),l(a.skeletons)){let c=a.skeletons;if(c.length>0&&l(a.skin)){let f=e.skins[a.skin];f.skeleton=n.nodes[c[0]]}delete a.skeletons}l(a.jointName)&&delete a.jointName}),ze.skin(e,function(a){l(a.inverseBindMatrices)&&(a.inverseBindMatrices=n.accessors[a.inverseBindMatrices]);let s=a.jointNames;if(l(s)){let c=[],u=s.length;for(t=0;t<u;++t)c[t]=o[s[t]];a.joints=c,delete a.jointNames}}),ze.scene(e,function(a){let s=a.nodes;if(l(s)){let c=s.length;for(t=0;t<c;++t)s[t]=n.nodes[s[t]]}}),ze.animation(e,function(a){let s={};a.samplers=Que(a.samplers,s),ze.animationSampler(a,function(c){c.input=n.accessors[c.input],c.output=n.accessors[c.output]}),ze.animationChannel(a,function(c){c.sampler=s[c.sampler];let u=c.target;l(u)&&(u.node=n.nodes[u.id],delete u.id)})}),ze.material(e,function(a){l(a.technique)&&(a.technique=n.techniques[a.technique]),ze.materialValue(a,function(c,u){typeof c=="string"&&(a.values[u]={index:n.textures[c]})});let s=a.extensions;if(l(s)){let c=s.KHR_materials_common;l(c)&&l(c.values)&&ze.materialValue(c,function(u,f){typeof u=="string"&&(c.values[f]={index:n.textures[u]})})}}),ze.image(e,function(a){let s=a.extensions;if(l(s)){let c=s.KHR_binary_glTF;l(c)&&(a.bufferView=n.bufferViews[c.bufferView],a.mimeType=c.mimeType,delete s.KHR_binary_glTF),Object.keys(s).length===0&&delete a.extensions}}),ze.texture(e,function(a){l(a.sampler)&&(a.sampler=n.samplers[a.sampler]),l(a.source)&&(a.source=n.images[a.source])})}function sHe(e){ze.animation(e,function(t){ze.animationSampler(t,function(n){delete n.name})})}function cHe(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]}ze.node(e,function(t){l(t.children)&&t.children.length===0&&delete t.children})}function lHe(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var uHe={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function fHe(e){let t=e.extensionsUsed;if(e.extensionsRequired=e.extensionsRequired??[],l(t)){let n=t.length;for(let i=0;i<n;++i){let o=t[i];l(uHe[o])&&e.extensionsRequired.push(o)}}}function dHe(e){ze.buffer(e,function(t){delete t.type})}function hHe(e){ze.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function mHe(e){ze.mesh(e,function(t){ze.meshPrimitive(t,function(n){ze.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})}),ze.technique(e,function(t){ze.techniqueParameter(t,function(n){let i=n.semantic;l(i)&&(i==="TEXCOORD"?n.semantic="TEXCOORD_0":i==="COLOR"&&(n.semantic="COLOR_0"))})})}var pHe={POSITION:!0,NORMAL:!0,TANGENT:!0},AHe={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function gHe(e){let t={};ze.mesh(e,function(n){ze.meshPrimitive(n,function(i){ze.meshPrimitiveAttribute(i,function(o,r){if(r.charAt(0)!=="_"){let a=r.search(/_[0-9]+/g),s=r,c="_0";a>=0&&(s=r.substring(0,a),c=r.substring(a));let u,f=AHe[s];l(f)?(u=f+c,t[r]=u):l(pHe[s])||(u=`_${r}`,t[r]=u)}});for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o],a=i.attributes[o];l(a)&&(delete i.attributes[o],i.attributes[r]=a)}})}),ze.technique(e,function(n){ze.techniqueParameter(n,function(i){let o=t[i.semantic];l(o)&&(i.semantic=o)})})}function _He(e){ze.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 wY(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:wu(e,t)}function yHe(e){ze.buffer(e,function(t){l(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),ze.accessor(e,function(t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n],o=wY(e,t),r=t.byteOffset+t.count*o;i.byteLength=Math.max(i.byteLength??0,r)}})}function CHe(e){let t,n,i,o=e.bufferViews,r={};ze.accessorContainingVertexAttributeData(e,function(s){let c=e.accessors[s];l(c.bufferView)&&(r[c.bufferView]=!0)});let a={};ze.accessor(e,function(s){l(s.bufferView)&&(a[s.bufferView]=a[s.bufferView]??[],a[s.bufferView].push(s))});for(let s in a)if(Object.prototype.hasOwnProperty.call(a,s)){i=o[s];let c=a[s];c.sort(function(p,A){return p.byteOffset-A.byteOffset});let u=0,f=0,h=c.length;for(t=0;t<h;++t){let p=c[t],A=wY(e,p),m=p.byteOffset,_=p.count*A;delete p.byteStride;let y=t<h-1,C=y?wY(e,c[t+1]):void 0;if(A!==C){let E=je(i,!0);r[s]&&(E.byteStride=A),E.byteOffset+=u,E.byteLength=m+_-u;let b=ds(o,E);for(n=f;n<=t;++n)p=c[n],p.bufferView=b,p.byteOffset=p.byteOffset-u;u=y?c[t+1].byteOffset:void 0,f=t+1}}}ZM(e,["accessor","bufferView","buffer"])}function EHe(e){ze.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!l(n.min)||!l(n.max)){let i=E0(e,n);n.min=i.min,n.max=i.max}})}function zue(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)||d.fromArray(e.translation).equals(d.ZERO))&&(!l(e.scale)||d.fromArray(e.scale).equals(new d(1,1,1)))&&(!l(e.rotation)||ie.fromArray(e.rotation).equals(new ie(0,0,0,1)))&&(!l(e.matrix)||M.fromColumnMajorArray(e.matrix).equals(M.IDENTITY))&&!l(e.extensions)&&!l(e.extras)}function Gue(e,t){ze.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}}}),ze.node(e,function(n,i){if(l(n.children)){let o=n.children.indexOf(t);o>-1&&(n.children.splice(o,1),zue(n)&&Gue(e,i))}}),delete e.nodes[t]}function bHe(e){return ze.node(e,function(t,n){zue(t)&&Gue(e,n)}),e}function IHe(e){ze.animation(e,function(t){ze.animationSampler(t,function(n){let i=e.accessors[n.input];if(!l(i.min)||!l(i.max)){let o=E0(e,i);i.min=o.min,i.max=o.max}})})}function xHe(e){ze.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=E0(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function THe(e){e.asset=e.asset??{},e.asset.version="2.0",Uue(e),rHe(e),bHe(e),aHe(e),sHe(e),lHe(e),fHe(e),yHe(e),CHe(e),EHe(e),IHe(e),xHe(e),dHe(e),hHe(e),mHe(e),gHe(e),tN(e),_He(e),KM(e),JM(e),cHe(e)}var SHe=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],wHe=["u_diffuse","u_diffuse_mat"];function BY(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function DY(e){return l(e.index)}function vY(e){return Array.isArray(e)&&e.length===4}function Vue(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 BHe(e,t){t=t??{};let n=t.baseColorTextureNames??SHe,i=t.baseColorFactorNames??wHe;ze.material(e,function(o){ze.materialValue(o,function(r,a){n.indexOf(a)!==-1&&DY(r)?(BY(o),o.pbrMetallicRoughness.baseColorTexture=r):i.indexOf(a)!==-1&&vY(r)&&(BY(o),o.pbrMetallicRoughness.baseColorFactor=Vue(r))})}),b0(e,"KHR_techniques_webgl"),b0(e,"KHR_blend")}function SY(e,t){l(t)&&(vY(t)?e.pbrMetallicRoughness.baseColorFactor=Vue(t):DY(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function kue(e,t){l(t)&&(vY(t)?e.emissiveFactor=t.slice(0,3):DY(t)&&(e.emissiveTexture=t))}function DHe(e){ze.material(e,function(t){let n=(t.extensions??{}).KHR_materials_common;if(!l(n))return;let i=n.values??{},o=i.ambient,r=i.diffuse,a=i.emission,s=i.transparency,c=n.doubleSided,u=n.transparent;BY(t),n.technique==="CONSTANT"?(Td(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},SY(t,a),SY(t,o)):(SY(t,r),kue(t,o),kue(t,a)),l(c)&&(t.doubleSided=c),l(s)&&(l(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=s:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,s]),l(u)&&(t.alphaMode=u?"BLEND":"OPAQUE")}),b0(e,"KHR_materials_common")}var nN=$8e;function Jc(){}Jc.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};Jc.getNodeTransform=function(e){return l(e.matrix)?e.matrix:M.fromTranslationQuaternionRotationScale(l(e.translation)?e.translation:d.ZERO,l(e.rotation)?e.rotation:Qe.IDENTITY,l(e.scale)?e.scale:d.ONE)};Jc.getAttributeBySemantic=function(e,t,n){let i=e.attributes,o=i.length;for(let r=0;r<o;++r){let a=i[r],s=l(n)?a.setIndex===n:!0;if(a.semantic===t&&s)return a}};Jc.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}};Jc.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}};Jc.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};Jc.getAttributeInfo=function(e){let t=e.semantic,n=e.setIndex,i,o=!1;l(t)?(i=at.getVariableName(t,n),o=!0):(i=e.name,i=i.replace(/^_/,""),i=i.toLowerCase());let r=/^color_\d+$/.test(i),a=e.type,s=Ut.getGlslType(a);r&&(s="vec4");let c=l(e.quantization),u;return c&&(u=r?"vec4":Ut.getGlslType(e.quantization.type)),{attribute:e,isQuantized:c,variableName:i,hasSemantic:o,glslType:s,quantizedGlslType:u}};var vHe=new d,PHe=new d;Jc.getPositionMinMax=function(e,t,n){let i=Jc.getAttributeBySemantic(e,"POSITION"),o=i.max,r=i.min;return l(n)&&l(t)&&(r=d.add(r,t,PHe),o=d.add(o,n,vHe)),{min:r,max:o}};Jc.getAxisCorrectionMatrix=function(e,t,n){return n=M.clone(M.IDENTITY,n),e===ao.Y?n=M.clone(ao.Y_UP_TO_Z_UP,n):e===ao.X&&(n=M.clone(ao.X_UP_TO_Z_UP,n)),t===ao.Z&&(n=M.multiplyTransformation(n,ao.Z_UP_TO_X_UP,n)),n};var RHe=new J;Jc.getCullFace=function(e,t){if(!ve.isTriangles(t))return Ni.BACK;let n=M.getMatrix3(e,RHe);return J.determinant(n)<0?Ni.FRONT:Ni.BACK};Jc.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t=`_${t}`),t};Jc.supportedExtensions={AGI_articulations:!0,CESIUM_primitive_outline:!0,CESIUM_RTC:!0,EXT_feature_metadata:!0,EXT_implicit_cylinder_region:!0,EXT_implicit_ellipsoid_region:!0,EXT_instance_features:!0,EXT_mesh_features:!0,EXT_mesh_gpu_instancing:!0,EXT_meshopt_compression:!0,EXT_primitive_voxels:!0,EXT_structural_metadata:!0,EXT_texture_webp:!0,KHR_blend:!0,KHR_draco_mesh_compression:!0,KHR_implicit_shapes:!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_techniques_webgl:!0,KHR_texture_basisu:!0,KHR_texture_transform:!0,KHR_gaussian_splatting:!0,KHR_gaussian_splatting_compression_spz_2:!0,WEB3D_quantized_attributes:!0};Jc.checkSupportedExtensions=function(e){let t=e.length;for(let n=0;n<t;n++){let i=e[n];if(!Jc.supportedExtensions[i])throw new ue(`Unsupported glTF Extension: ${i}`)}};var xt=Jc;var PY=class extends Ki{constructor(t){super(),t=t??V.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltfResource,o=t.baseResource,r=t.typedArray,a=t.gltfJson,s=t.cacheKey;this._resourceCache=n,this._gltfResource=i,this._baseResource=o,this._typedArray=r,this._gltfJson=a,this._cacheKey=s,this._gltf=void 0,this._bufferLoaders=[],this._state=gt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get gltf(){return this._gltf}async load(){return l(this._promise)?this._promise:(this._state=gt.LOADING,l(this._gltfJson)?(this._promise=Hue(this,this._gltfJson),this._promise):l(this._typedArray)?(this._promise=Wue(this,this._typedArray),this._promise):(this._promise=MHe(this),this._promise))}unload(){let t=this._bufferLoaders,n=t.length;for(let i=0;i<n;++i)t[i]=!t[i].isDestroyed()&&this._resourceCache.unload(t[i]);this._bufferLoaders.length=0,this._gltf=void 0}_fetchGltf(){return this._gltfResource.fetchArrayBuffer()}};async function MHe(e){let t;try{let n=await e._fetchGltf();if(e.isDestroyed())return;t=new Uint8Array(n)}catch(n){if(e.isDestroyed())return;RY(e,n)}return Wue(e,t)}function RY(e,t){e.unload(),e._state=gt.FAILED;let n=`Failed to load glTF: ${e._gltfResource.url}`;throw e.getError(n,t)}async function NHe(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=[];ze.buffer(t,function(i){if(!l(i.extras._pipeline.source)&&l(i.uri)){let o=e._baseResource.getDerivedResource({url:i.uri}),a=e._resourceCache.getExternalBufferLoader({resource:o});e._bufferLoaders.push(a),n.push(a.load().then(function(){a.isDestroyed()||(i.extras._pipeline.source=a.typedArray)}))}}),await Promise.all(n),nN(t)}function LHe(e){let t=[];return ze.buffer(e,function(n){let i=n.uri;!l(n.extras._pipeline.source)&&l(i)&&bh(i)&&(delete n.uri,t.push(De.fetchArrayBuffer(i).then(function(o){n.extras._pipeline.source=new Uint8Array(o)})))}),Promise.all(t)}function OHe(e,t){let n=[];return ze.buffer(t,function(i,o){let r=i.extras._pipeline.source;if(l(r)&&!l(i.uri)){let s=e._resourceCache.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:o,typedArray:r});e._bufferLoaders.push(s),n.push(s.load())}}),Promise.all(n)}async function Hue(e,t){try{Ey(t),await LHe(t),await NHe(e,t),jM(t),await OHe(e,t),qM(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)&&xt.checkSupportedExtensions(i),e._gltf=t,e._state=gt.READY,e}catch(n){if(e.isDestroyed())return;RY(e,n)}}async function Wue(e,t){let n;try{zh(t)==="glTF"?n=C0(t):n=Br(t)}catch(i){if(e.isDestroyed())return;RY(e,i)}return Hue(e,n)}var nT=PY;var FHe={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"},yp=Object.freeze(FHe);var Fo={},MY=class{constructor(){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}},NY=class{constructor(){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}},LY=class{constructor(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}},OY=class{constructor(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.setIndex=void 0,this.label=void 0,this.positionalLabel=void 0}},FY=class{constructor(){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}},QY=class{constructor(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.textureReader=void 0,this.label=void 0,this.positionalLabel=void 0}},kY=class{constructor(){this.attributes=[]}},UY=class{constructor(){this.attributes=[],this.morphTargets=[],this.indices=void 0,this.material=void 0,this.primitiveType=void 0,this.vector=void 0,this.featureIds=[],this.propertyTextureIds=[],this.propertyAttributeIds=[],this.outlineCoordinates=void 0,this.modelPrimitiveImagery=void 0,this.edgeVisibility=void 0}},zY=class{constructor(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}},GY=class{constructor(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}},VY=class{constructor(){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,this.meshVector=void 0}},HY=class{constructor(){this.nodes=[]}},QHe={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"},WY=class{constructor(){this.input=[],this.interpolation=void 0,this.output=[]}},jY=class{constructor(){this.node=void 0,this.path=void 0}},YY=class{constructor(){this.sampler=void 0,this.target=void 0}},qY=class{constructor(){this.name=void 0,this.samplers=[],this.channels=[]}},KY=class{constructor(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}},XY=class{constructor(){this.name=void 0,this.stages=[]}},zV=class{constructor(){this.credits=[]}},JY=class{constructor(){this.asset=new zV,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=M.clone(M.IDENTITY),this.extensions={}}},ZY=class{constructor(){this.texture=void 0,this.index=void 0,this.texCoord=0,this.transform=J.clone(J.IDENTITY),this.scale=1,this.channels=void 0,this.constantLod=void 0}},by=class by{constructor(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=ie.clone(by.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=by.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=by.DEFAULT_ROUGHNESS_FACTOR}};Rn(by,"DEFAULT_BASE_COLOR_FACTOR",ie.ONE),Rn(by,"DEFAULT_METALLIC_FACTOR",1),Rn(by,"DEFAULT_ROUGHNESS_FACTOR",1);var GV=by,Iy=class Iy{constructor(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=ie.clone(Iy.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=d.clone(Iy.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=Iy.DEFAULT_GLOSSINESS_FACTOR}};Rn(Iy,"DEFAULT_DIFFUSE_FACTOR",ie.ONE),Rn(Iy,"DEFAULT_SPECULAR_FACTOR",d.ONE),Rn(Iy,"DEFAULT_GLOSSINESS_FACTOR",1);var $Y=Iy,iT=class iT{constructor(){this.specularFactor=iT.DEFAULT_SPECULAR_FACTOR,this.specularTexture=void 0,this.specularColorFactor=d.clone(iT.DEFAULT_SPECULAR_COLOR_FACTOR),this.specularColorTexture=void 0}};Rn(iT,"DEFAULT_SPECULAR_FACTOR",1),Rn(iT,"DEFAULT_SPECULAR_COLOR_FACTOR",d.ONE);var eq=iT,oT=class oT{constructor(){this.anisotropyStrength=oT.DEFAULT_ANISOTROPY_STRENGTH,this.anisotropyRotation=oT.DEFAULT_ANISOTROPY_ROTATION,this.anisotropyTexture=void 0}};Rn(oT,"DEFAULT_ANISOTROPY_STRENGTH",0),Rn(oT,"DEFAULT_ANISOTROPY_ROTATION",0);var tq=oT,rT=class rT{constructor(){this.clearcoatFactor=rT.DEFAULT_CLEARCOAT_FACTOR,this.clearcoatTexture=void 0,this.clearcoatRoughnessFactor=rT.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,this.clearcoatRoughnessTexture=void 0,this.clearcoatNormalTexture=void 0}};Rn(rT,"DEFAULT_CLEARCOAT_FACTOR",0),Rn(rT,"DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR",0);var nq=rT,iq=class{constructor(){Rn(this,"width");Rn(this,"pattern")}},VV=class VV{constructor(){this.metallicRoughness=new GV,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=d.clone(VV.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=yp.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1,this.pointDiameter=void 0,this.lineStyle=void 0}};Rn(VV,"DEFAULT_EMISSIVE_FACTOR",d.ZERO);var oq=VV,rq=class{constructor(){Rn(this,"vector",!0);Rn(this,"count",0);Rn(this,"polygonAttributeOffsets");Rn(this,"polygonHoleCounts");Rn(this,"polygonHoleOffsets");Rn(this,"polygonIndicesOffsets")}};Fo.Quantization=MY;Fo.Attribute=NY;Fo.Indices=LY;Fo.FeatureIdAttribute=OY;Fo.FeatureIdTexture=QY;Fo.FeatureIdImplicitRange=FY;Fo.MorphTarget=kY;Fo.Primitive=UY;Fo.Instances=zY;Fo.Skin=GY;Fo.Node=VY;Fo.Scene=HY;Fo.AnimatedPropertyType=Object.freeze(QHe);Fo.AnimationSampler=WY;Fo.AnimationTarget=jY;Fo.AnimationChannel=YY;Fo.Animation=qY;Fo.ArticulationStage=KY;Fo.Articulation=XY;Fo.Asset=zV;Fo.Components=JY;Fo.TextureReader=ZY;Fo.MetallicRoughness=GV;Fo.SpecularGlossiness=$Y;Fo.Specular=eq;Fo.Anisotropy=tq;Fo.Clearcoat=nq;Fo.LineStyle=iq;Fo.Material=oq;Fo.Vector=rq;var Cn=Fo;var HV={};HV.getImageIdFromTexture=function(e){e=e??V.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};HV.createSampler=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,textureInfo:n,compressedTextureNoMipmap:i=!1}=e,o=pn.REPEAT,r=pn.REPEAT,a=Wt.LINEAR,s=ci.LINEAR,c=n.index,f=t.textures[c].sampler;if(l(f)){let h=t.samplers[f];o=h.wrapS??o,r=h.wrapT??r,a=h.minFilter??a,s=h.magFilter??s}return i&&a!==Wt.LINEAR&&a!==Wt.NEAREST&&(a===Wt.NEAREST_MIPMAP_NEAREST||a===Wt.NEAREST_MIPMAP_LINEAR?a=Wt.NEAREST:a=Wt.LINEAR),new jt({wrapS:o,wrapT:r,minificationFilter:a,magnificationFilter:s})};var kHe=new k(1,1);HV.createModelTextureReader=function(e){e=e??V.EMPTY_OBJECT;let{textureInfo:t,channels:n,texture:i}=e,o=t.texCoord??0,r,a=t.extensions?.KHR_texture_transform;if(l(a)){o=a.texCoord??o;let u=l(a.offset)?k.unpack(a.offset):k.ZERO,f=a.rotation??0,h=l(a.scale)?k.unpack(a.scale):kHe;f=-f,r=new J(Math.cos(f)*h.x,-Math.sin(f)*h.y,u.x,Math.sin(f)*h.x,Math.cos(f)*h.y,u.y,0,0,1)}let s=new Cn.TextureReader;s.index=t.index,s.texture=i,s.texCoord=o,s.scale=t.scale,s.transform=r,s.channels=n;let c=t.extensions?.EXT_textureInfo_constant_lod;return l(c)&&(s.constantLod={repetitions:c.repetitions??1,offset:l(c.offset)?k.unpack(c.offset):k.ZERO,minClampDistance:c.minClampDistance??1,maxClampDistance:c.maxClampDistance??4294967296}),s};var Bu=HV;function UHe(e){let t=document.createElement("canvas");return t.width=D.nextPowerOfTwo(e.width),t.height=D.nextPowerOfTwo(e.height),t.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),t}var xy=UHe;var aq=class extends Ki{constructor(t){super(),t=t??V.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,o=t.textureInfo,r=t.gltfResource,a=t.baseResource,s=t.supportedImageFormats,c=t.cacheKey,u=t.asynchronous??!0,f=o.index,h=Bu.getImageIdFromTexture({gltf:i,textureId:f,supportedImageFormats:s});this._resourceCache=n,this._gltf=i,this._textureInfo=o,this._imageId=h,this._gltfResource=r,this._baseResource=a,this._cacheKey=c,this._asynchronous=u,this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._state=gt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get texture(){return this._texture}async load(){return l(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=GHe(this),this._promise)}process(t){if(this._state===gt.READY)return!0;if(this._state!==gt.LOADED&&this._state!==gt.PROCESSING||l(this._texture)||!l(this._image))return!1;this._state=gt.PROCESSING;let n;if(this._asynchronous){let i=zHe;if(i.set(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,t.context),!t.jobScheduler.execute(i,Bc.TEXTURE))return!1;n=i.texture}else n=jue(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,t.context);return this.unload(),this._texture=n,this._state=gt.READY,this._resourceCache.statistics.addTextureLoader(this),!0}unload(){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}},sq=class{constructor(){this.gltf=void 0,this.textureInfo=void 0,this.textureId=void 0,this.image=void 0,this.context=void 0,this.texture=void 0}set(t,n,i,o,r,a){this.gltf=t,this.textureInfo=n,this.textureId=i,this.image=o,this.mipLevels=r,this.context=a}execute(){this.texture=jue(this.gltf,this.textureInfo,this.textureId,this.image,this.mipLevels,this.context)}};function jue(e,t,n,i,o,r){let a=i.internalFormat,s=!1;qe.isCompressedFormat(a)&&!l(o)&&(s=!0);let c=Bu.createSampler({gltf:e,textureInfo:t,compressedTextureNoMipmap:s}),u=c.minificationFilter,f=c.wrapS,h=c.wrapT,p=u===Wt.NEAREST_MIPMAP_NEAREST||u===Wt.NEAREST_MIPMAP_LINEAR||u===Wt.LINEAR_MIPMAP_NEAREST||u===Wt.LINEAR_MIPMAP_LINEAR,A=!l(a)&&p,m=A||f===pn.REPEAT||f===pn.MIRRORED_REPEAT||h===pn.REPEAT||h===pn.MIRRORED_REPEAT,_=!D.isPowerOfTwo(i.width)||!D.isPowerOfTwo(i.height),y=m&&_,C;return l(a)?(!r.webgl2&&qe.isCompressedFormat(a)&&_&&m&&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."),C=Dt.create({id:n,context:r,source:{arrayBufferView:i.bufferView,mipLevels:o},width:i.width,height:i.height,pixelFormat:i.internalFormat,sampler:c})):(y&&(i=xy(i)),C=Dt.create({id:n,context:r,source:i,sampler:c,flipY:!1,skipColorSpaceConversion:!0})),A&&C.generateMipmap(),C}var zHe=new sq;async function GHe(e){let t=e._resourceCache;try{let n=t.getImageLoader({gltf:e._gltf,imageId:e._imageId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._imageLoader=n,await n.load(),e.isDestroyed()?void 0:(e._image=n.image,e._mipLevels=n.mipLevels,e._state=gt.LOADED,e)}catch(n){if(e.isDestroyed())return;throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load texture",n)}}var aT=aq;var cq=class extends Ki{constructor(t){super(),t=t??V.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,o=t.gltfResource,r=t.baseResource,a=t.bufferViewId,s=t.primitive,c=t.draco,u=t.attributeSemantic,f=t.accessorId,h=t.cacheKey,p=t.spz,A=t.asynchronous??!0,m=t.loadBuffer??!1,_=t.loadTypedArray??!1;this._resourceCache=n,this._gltfResource=o,this._baseResource=r,this._gltf=i,this._bufferViewId=a,this._primitive=s,this._draco=c,this._spz=p,this._attributeSemantic=u,this._accessorId=f,this._cacheKey=h,this._asynchronous=A,this._loadBuffer=m,this._loadTypedArray=_,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._quantization=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=gt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get buffer(){return this._buffer}get typedArray(){return this._typedArray}get quantization(){return this._quantization}async load(){return l(this._promise)?this._promise:l(this._spz)?(this._promise=WHe(this),this._promise):VHe(this._draco,this._attributeSemantic)?(this._promise=KHe(this),this._promise):(this._promise=JHe(this),this._promise)}process(t){if(this._state===gt.READY)return!0;if(this._state!==gt.LOADED&&this._state!==gt.PROCESSING)return!1;if(l(this._dracoLoader)){try{if(!this._dracoLoader.process(t))return!1}catch(o){WV(this,o)}XHe(this)}if(l(this._spzLoader)){try{if(!this._spzLoader.process(t))return!1}catch(o){WV(this,o)}qHe(this)}let n,i=this._typedArray;if(this._loadBuffer&&this._asynchronous){let o=ZHe;if(o.set(i,t.context),!t.jobScheduler.execute(o,Bc.BUFFER))return!1;n=o.buffer}else this._loadBuffer&&(n=Yue(i,t.context));return this.unload(),this._buffer=n,this._typedArray=this._loadTypedArray?i:void 0,this._state=gt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0}unload(){l(this._buffer)&&this._buffer.destroy();let t=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&t.unload(this._bufferViewLoader),l(this._dracoLoader)&&t.unload(this._dracoLoader),l(this._spzLoader)&&t.unload(this._spzLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._spzLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0,this._primitive=void 0}};function VHe(e,t){return l(e)&&l(e.attributes)&&l(e.attributes[t])}function HHe(e,t,n,i){let r=(1<<e.quantizationBits)-1,a=1/r,s=new Cn.Quantization;if(s.componentDatatype=t,s.octEncoded=e.octEncoded,s.octEncodedZXY=!0,s.type=i,s.octEncoded)s.type=Ut.VEC2,s.normalizationRange=r;else{let c=Ut.getMathType(i);if(c===Number){let u=e.range;s.quantizedVolumeOffset=e.minValues[0],s.quantizedVolumeDimensions=u,s.normalizationRange=r,s.quantizedVolumeStepSize=u*a}else{s.quantizedVolumeOffset=c.unpack(e.minValues),s.normalizationRange=c.unpack(new Array(n).fill(r));let u=new Array(n).fill(e.range);s.quantizedVolumeDimensions=c.unpack(u);let f=u.map(function(h){return h*a});s.quantizedVolumeStepSize=c.unpack(f)}}return s}async function WHe(e){e._state=gt.LOADING;let t=e._resourceCache;try{let n=t.getSpzLoader({gltf:e._gltf,primitive:e._primitive,spz:e._spz,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._spzLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=gt.LOADED,e)}catch{if(e.isDestroyed())return}}function jHe(e){return`${e.startsWith("KHR_gaussian_splatting:")?"KHR_gaussian_splatting:":"_"}SH_DEGREE_`}function YHe(e){let t=jHe(e),n="_COEF_",i=t.length,o=e.indexOf(n,i),r=parseInt(e.slice(i,o),10),a=parseInt(e.slice(o+n.length),10);return{l:r,n:a}}function qHe(e){e._state=gt.PROCESSING;let n=e._spzLoader.decodedData.gcloud;if(e._attributeSemantic==="POSITION")e._typedArray=n.positions;else if(e._attributeSemantic==="KHR_gaussian_splatting:SCALE"||e._attributeSemantic==="_SCALE")e._typedArray=n.scales;else if(e._attributeSemantic==="KHR_gaussian_splatting:ROTATION"||e._attributeSemantic==="_ROTATION")e._typedArray=n.rotations;else if(e._attributeSemantic==="COLOR_0"){let i=n.colors,o=n.alphas;e._typedArray=new Uint8Array(i.length/3*4);for(let r=0;r<i.length/3;r++)e._typedArray[r*4]=D.clamp(i[r*3]*255,0,255),e._typedArray[r*4+1]=D.clamp(i[r*3+1]*255,0,255),e._typedArray[r*4+2]=D.clamp(i[r*3+2]*255,0,255),e._typedArray[r*4+3]=D.clamp(o[r]*255,0,255)}else if(e._attributeSemantic.includes("SH_DEGREE_")){let{l:i,n:o}=YHe(e._attributeSemantic),r=n.shDegree,a=0,s=[0,9,24];switch(r){case 1:a=9;break;case 2:a=24;break;case 3:a=45;break}let c=n.numPoints,u=n.sh;e._typedArray=new Float32Array(c*3);for(let f=0;f<c;f++){let h=f*a+s[i-1]+o*3;e._typedArray[f*3]=u[h],e._typedArray[f*3+1]=u[h+1],e._typedArray[f*3+2]=u[h+2]}}}async function KHe(e){e._state=gt.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,primitive:e._primitive,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=gt.LOADED,e)}catch{if(e.isDestroyed())return;WV(e)}}function XHe(e){e._state=gt.PROCESSING;let n=e._dracoLoader.decodedData.vertexAttributes,i=e._attributeSemantic,o=n[i],r=e._accessorId,s=e._gltf.accessors[r].type,c=o.array,u=o.data.quantization;l(u)&&(e._quantization=HHe(u,o.data.componentDatatype,o.data.componentsPerAttribute,s)),e._typedArray=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}async function JHe(e){e._state=gt.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._typedArray=n.typedArray,e._state=gt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;WV(e,n)}}function WV(e,t){throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load vertex buffer",t)}var lq=class{constructor(){this.typedArray=void 0,this.context=void 0,this.buffer=void 0}set(t,n){this.typedArray=t,this.context=n}execute(){this.buffer=Yue(this.typedArray,this.context)}};function Yue(e,t){let n=tt.createVertexBuffer({typedArray:e,context:t,usage:Re.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}var ZHe=new lq,sT=cq;var que={};async function $He(e={}){var t,n,i=e,o=typeof window=="object",r=typeof WorkerGlobalScope<"u",a=typeof process=="object"&&((t=process.versions)==null?void 0:t.node)&&process.type!="renderer";if(a){let{createRequire:ae}=await Promise.resolve().then(()=>o4e);var s=ae(que.url)}var c="./this.program",u=que.url,f;if(a){var h=s("fs");u.startsWith("file:")&&s("path").dirname(s("url").fileURLToPath(u)),f=ae=>(ae=y(ae)?new URL(ae):ae,h.readFileSync(ae)),1<process.argv.length&&(c=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2)}else if(o||r){try{new URL(".",u)}catch{}r&&(f=ae=>{var ne=new XMLHttpRequest;return ne.open("GET",ae,!1),ne.responseType="arraybuffer",ne.send(null),new Uint8Array(ne.response)})}var p=console.log.bind(console),A=console.error.bind(console),m,_=!1,y=ae=>ae.startsWith("file://"),C,E,b,x,S,B,v,P,N,L,g,I,T,w=!1;function R(){var ae=b.buffer;x=new Int8Array(ae),B=new Int16Array(ae),i.HEAPU8=S=new Uint8Array(ae),v=new Uint16Array(ae),P=new Int32Array(ae),N=new Uint32Array(ae),i.HEAPF32=L=new Float32Array(ae),g=new Float64Array(ae),I=new BigInt64Array(ae),T=new BigUint64Array(ae)}var O=0,G=null;function F(ae){var ne;throw(ne=i.onAbort)==null||ne.call(i,ae),ae="Aborted("+ae+")",A(ae),_=!0,ae=new WebAssembly.RuntimeError(ae+". Build with -sASSERTIONS for more info."),E?.(ae),ae}var U;async function Q(ae){if(!ArrayBuffer.isView(ae))if(ae==U&&m)ae=new Uint8Array(m);else if(f)ae=f(ae);else throw"both async and sync fetching of the wasm failed";return ae}async function H(ae){var ne=U;try{var be=await Q(ne);return await WebAssembly.instantiate(be,ae)}catch(Te){A(`failed to asynchronously prepare wasm: ${Te}`),F(Te)}}async function Y(ae){return H(ae)}var $=ae=>{for(;0<ae.length;)ae.shift()(i)},W=[],K=[],Z=()=>{var ae=i.preRun.shift();K.push(ae)},pe=ae=>{if(a)return ae=Buffer.from(ae,"base64"),new Uint8Array(ae.buffer,ae.byteOffset,ae.length);for(var ne,be,Te=0,Ke=0,Tt=ae.length,ht=new Uint8Array((3*Tt>>2)-(ae[Tt-2]=="=")-(ae[Tt-1]=="="));Te<Tt;Te+=4,Ke+=3)ne=CA[ae.charCodeAt(Te+1)],be=CA[ae.charCodeAt(Te+2)],ht[Ke]=CA[ae.charCodeAt(Te)]<<2|ne>>4,ht[Ke+1]=ne<<4|be>>2,ht[Ke+2]=be<<6|CA[ae.charCodeAt(Te+3)];return ht},ge={},re=ae=>{for(;ae.length;){var ne=ae.pop();ae.pop()(ne)}};function ye(ae){return this.N(N[ae>>2])}var Ce={},Pe={},Ne={},Le=class extends Error{constructor(ae){super(ae),this.name="InternalError"}},Oe=(ae,ne,be)=>{function Te(vt){if(vt=be(vt),vt.length!==ae.length)throw new Le("Mismatched type converter count");for(var Dn=0;Dn<ae.length;++Dn)Ye(ae[Dn],vt[Dn])}ae.forEach(vt=>Ne[vt]=ne);var Ke=Array(ne.length),Tt=[],ht=0;ne.forEach((vt,Dn)=>{Pe.hasOwnProperty(vt)?Ke[Dn]=Pe[vt]:(Tt.push(vt),Ce.hasOwnProperty(vt)||(Ce[vt]=[]),Ce[vt].push(()=>{Ke[Dn]=Pe[vt],++ht,ht===Tt.length&&Te(Ke)}))}),Tt.length===0&&Te(Ke)},ot=ae=>{for(var ne="";;){var be=S[ae++];if(!be)return ne;ne+=String.fromCharCode(be)}},Fe=class extends Error{constructor(ae){super(ae),this.name="BindingError"}},_t=ae=>{throw new Fe(ae)};function rt(ae,ne,be={}){var Te=ne.name;if(!ae)throw new Fe(`type "${Te}" must have a positive integer typeid pointer`);if(Pe.hasOwnProperty(ae)){if(be.wa)return;throw new Fe(`Cannot register type '${Te}' twice`)}Pe[ae]=ne,delete Ne[ae],Ce.hasOwnProperty(ae)&&(ne=Ce[ae],delete Ce[ae],ne.forEach(Ke=>Ke()))}function Ye(ae,ne,be={}){return rt(ae,ne,be)}var st=(ae,ne,be)=>{switch(ne){case 1:return be?Te=>x[Te]:Te=>S[Te];case 2:return be?Te=>B[Te>>1]:Te=>v[Te>>1];case 4:return be?Te=>P[Te>>2]:Te=>N[Te>>2];case 8:return be?Te=>I[Te>>3]:Te=>T[Te>>3];default:throw new TypeError(`invalid integer width (${ne}): ${ae}`)}},ft=ae=>{throw new Fe(ae.L.P.M.name+" instance already deleted")},St=!1,Ie=()=>{},Se=ae=>typeof FinalizationRegistry>"u"?(Se=ne=>ne,ae):(St=new FinalizationRegistry(ne=>{ne=ne.L,--ne.count.value,ne.count.value===0&&(ne.S?ne.W.Y(ne.S):ne.P.M.Y(ne.O))}),Se=ne=>{var be=ne.L;return be.S&&St.register(ne,{L:be},ne),ne},Ie=ne=>{St.unregister(ne)},Se(ae));function Kt(){}var mt=(ae,ne)=>Object.defineProperty(ne,"name",{value:ae}),Gt={},Hn=(ae,ne,be)=>{if(ae[ne].R===void 0){var Te=ae[ne];ae[ne]=function(...Ke){if(!ae[ne].R.hasOwnProperty(Ke.length))throw new Fe(`Function '${be}' called with an invalid number of arguments (${Ke.length}) - expects one of (${ae[ne].R})!`);return ae[ne].R[Ke.length].apply(this,Ke)},ae[ne].R=[],ae[ne].R[Te.aa]=Te}},Je=(ae,ne,be)=>{if(i.hasOwnProperty(ae)){if(be===void 0||i[ae].R!==void 0&&i[ae].R[be]!==void 0)throw new Fe(`Cannot register public name '${ae}' twice`);if(Hn(i,ae,ae),i[ae].R.hasOwnProperty(be))throw new Fe(`Cannot register multiple overloads of a function with the same number of arguments (${be})!`);i[ae].R[be]=ne}else i[ae]=ne,i[ae].aa=be},fo=ae=>{ae=ae.replace(/[^a-zA-Z0-9_]/g,"$");var ne=ae.charCodeAt(0);return 48<=ne&&57>=ne?`_${ae}`:ae};function Vt(ae,ne,be,Te,Ke,Tt,ht,vt){this.name=ae,this.constructor=ne,this.$=be,this.Y=Te,this.U=Ke,this.ra=Tt,this.ea=ht,this.pa=vt,this.ya=[]}var Lo=(ae,ne,be)=>{for(;ne!==be;){if(!ne.ea)throw new Fe(`Expected null or instance of ${be.name}, got an instance of ${ne.name}`);ae=ne.ea(ae),ne=ne.U}return ae},io=ae=>{if(ae===null)return"null";var ne=typeof ae;return ne==="object"||ne==="array"||ne==="function"?ae.toString():""+ae};function Qi(ae,ne){if(ne===null){if(this.ha)throw new Fe(`null is not a valid ${this.name}`);return 0}if(!ne.L)throw new Fe(`Cannot pass "${io(ne)}" as a ${this.name}`);if(!ne.L.O)throw new Fe(`Cannot pass deleted object as a pointer of type ${this.name}`);return Lo(ne.L.O,ne.L.P.M,this.M)}function Yo(ae,ne){if(ne===null){if(this.ha)throw new Fe(`null is not a valid ${this.name}`);if(this.ga){var be=this.ia();return ae!==null&&ae.push(this.Y,be),be}return 0}if(!ne||!ne.L)throw new Fe(`Cannot pass "${io(ne)}" as a ${this.name}`);if(!ne.L.O)throw new Fe(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.fa&&ne.L.P.fa)throw new Fe(`Cannot convert argument of type ${ne.L.W?ne.L.W.name:ne.L.P.name} to parameter type ${this.name}`);if(be=Lo(ne.L.O,ne.L.P.M,this.M),this.ga){if(ne.L.S===void 0)throw new Fe("Passing raw pointer to smart pointer is illegal");switch(this.Da){case 0:if(ne.L.W===this)be=ne.L.S;else throw new Fe(`Cannot convert argument of type ${ne.L.W?ne.L.W.name:ne.L.P.name} to parameter type ${this.name}`);break;case 1:be=ne.L.S;break;case 2:if(ne.L.W===this)be=ne.L.S;else{var Te=ne.clone();be=this.za(be,ef(()=>Te.delete())),ae!==null&&ae.push(this.Y,be)}break;default:throw new Fe("Unsupporting sharing policy")}}return be}function ai(ae,ne){if(ne===null){if(this.ha)throw new Fe(`null is not a valid ${this.name}`);return 0}if(!ne.L)throw new Fe(`Cannot pass "${io(ne)}" as a ${this.name}`);if(!ne.L.O)throw new Fe(`Cannot pass deleted object as a pointer of type ${this.name}`);if(ne.L.P.fa)throw new Fe(`Cannot convert argument of type ${ne.L.P.name} to parameter type ${this.name}`);return Lo(ne.L.O,ne.L.P.M,this.M)}var Xn=(ae,ne,be)=>ne===be?ae:be.U===void 0?null:(ae=Xn(ae,ne,be.U),ae===null?null:be.pa(ae)),oo={},Oo=(ae,ne)=>{if(ne===void 0)throw new Fe("ptr should not be undefined");for(;ae.U;)ne=ae.ea(ne),ae=ae.U;return oo[ne]},yo=(ae,ne)=>{if(!ne.P||!ne.O)throw new Le("makeClassHandle requires ptr and ptrType");if(!!ne.W!=!!ne.S)throw new Le("Both smartPtrType and smartPtr must be specified");return ne.count={value:1},Se(Object.create(ae,{L:{value:ne,writable:!0}}))};function or(ae,ne,be,Te,Ke,Tt,ht,vt,Dn,Yn,hn){this.name=ae,this.M=ne,this.ha=be,this.fa=Te,this.ga=Ke,this.xa=Tt,this.Da=ht,this.na=vt,this.ia=Dn,this.za=Yn,this.Y=hn,Ke||ne.U!==void 0?this.T=Yo:(this.T=Te?Qi:ai,this.V=null)}var qo=(ae,ne,be)=>{if(!i.hasOwnProperty(ae))throw new Le("Replacing nonexistent public symbol");i[ae].R!==void 0&&be!==void 0?i[ae].R[be]=ne:(i[ae]=ne,i[ae].aa=be)},bn,wi=(ae,ne)=>{ae=ot(ae);var be=bn.get(ne);if(typeof be!="function")throw new Fe(`unknown function pointer with signature ${ae}: ${ne}`);return be};class Ln extends Error{}var Ko=ae=>{ae=Wie(ae);var ne=ot(ae);return H_(ae),ne},Xo=(ae,ne)=>{function be(Tt){Ke[Tt]||Pe[Tt]||(Ne[Tt]?Ne[Tt].forEach(be):(Te.push(Tt),Ke[Tt]=!0))}var Te=[],Ke={};throw ne.forEach(be),new Ln(`${ae}: `+Te.map(Ko).join([", "]))},ss=(ae,ne)=>{for(var be=[],Te=0;Te<ae;Te++)be.push(N[ne+4*Te>>2]);return be};function Hi(ae){for(var ne=1;ne<ae.length;++ne)if(ae[ne]!==null&&ae[ne].V===void 0)return!0;return!1}function Do(ae,ne,be,Te,Ke,Tt){var ht=ne.length;if(2>ht)throw new Fe("argTypes array size mismatch! Must at least get return value and 'this' types!");var vt=ne[1]!==null&&be!==null,Dn=Hi(ne);be=!ne[0].ma;var Yn=ne[0],hn=ne[1];for(Te=[ae,_t,Te,Ke,re,Yn.N.bind(Yn),hn?.T.bind(hn)],Ke=2;Ke<ht;++Ke)Yn=ne[Ke],Te.push(Yn.T.bind(Yn));if(!Dn)for(Ke=vt?1:2;Ke<ne.length;++Ke)ne[Ke].V!==null&&Te.push(ne[Ke].V);for(Dn=Hi(ne),Ke=ne.length-2,hn=[],Yn=["fn"],vt&&Yn.push("thisWired"),ht=0;ht<Ke;++ht)hn.push(`arg${ht}`),Yn.push(`arg${ht}Wired`);hn=hn.join(","),Yn=Yn.join(","),hn=`return function (${hn}) {
`,Dn&&(hn+=`var destructors = [];
`);var Da=Dn?"destructors":"null",nf="humanName throwBindingError invoker fn runDestructors fromRetWire toClassParamWire".split(" ");for(vt&&(hn+=`var thisWired = toClassParamWire(${Da}, this);
`),ht=0;ht<Ke;++ht){var El=`toArg${ht}Wire`;hn+=`var arg${ht}Wired = ${El}(${Da}, arg${ht});
`,nf.push(El)}if(hn+=(be||Tt?"var rv = ":"")+`invoker(${Yn});
`,Dn)hn+=`runDestructors(destructors);
`;else for(ht=vt?1:2;ht<ne.length;++ht)Tt=ht===1?"thisWired":"arg"+(ht-2)+"Wired",ne[ht].V!==null&&(hn+=`${Tt}_dtor(${Tt});
`,nf.push(`${Tt}_dtor`));return be&&(hn+=`var ret = fromRetWire(rv);
return ret;
`),ne=new Function(nf,hn+`}
`)(...Te),mt(ae,ne)}for(var Ts=ae=>{ae=ae.trim();let ne=ae.indexOf("(");return ne===-1?ae:ae.slice(0,ne)},wa=[],Mr=[0,1,,1,null,1,!0,1,!1,1],Ss=ae=>{9<ae&&--Mr[ae+1]===0&&(Mr[ae]=void 0,wa.push(ae))},$u=ae=>{if(!ae)throw new Fe(`Cannot use deleted val. handle = ${ae}`);return Mr[ae]},ef=ae=>{switch(ae){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let ne=wa.pop()||Mr.length;return Mr[ne]=ae,Mr[ne+1]=1,ne}},tf={name:"emscripten::val",N:ae=>{var ne=$u(ae);return Ss(ae),ne},T:(ae,ne)=>ef(ne),X:ye,V:null},yh=(ae,ne,be)=>{switch(ne){case 1:return be?function(Te){return this.N(x[Te])}:function(Te){return this.N(S[Te])};case 2:return be?function(Te){return this.N(B[Te>>1])}:function(Te){return this.N(v[Te>>1])};case 4:return be?function(Te){return this.N(P[Te>>2])}:function(Te){return this.N(N[Te>>2])};default:throw new TypeError(`invalid integer width (${ne}): ${ae}`)}},Js=(ae,ne)=>{var be=Pe[ae];if(be===void 0)throw ae=`${ne} has unknown type ${Ko(ae)}`,new Fe(ae);return be},z_=(ae,ne)=>{switch(ne){case 4:return function(be){return this.N(L[be>>2])};case 8:return function(be){return this.N(g[be>>3])};default:throw new TypeError(`invalid float width (${ne}): ${ae}`)}},Xm=Object.assign({optional:!0},tf),br=(ae,ne,be)=>{var Te=S;if(!(0<be))return 0;var Ke=ne;be=ne+be-1;for(var Tt=0;Tt<ae.length;++Tt){var ht=ae.codePointAt(Tt);if(127>=ht){if(ne>=be)break;Te[ne++]=ht}else if(2047>=ht){if(ne+1>=be)break;Te[ne++]=192|ht>>6,Te[ne++]=128|ht&63}else if(65535>=ht){if(ne+2>=be)break;Te[ne++]=224|ht>>12,Te[ne++]=128|ht>>6&63,Te[ne++]=128|ht&63}else{if(ne+3>=be)break;Te[ne++]=240|ht>>18,Te[ne++]=128|ht>>12&63,Te[ne++]=128|ht>>6&63,Te[ne++]=128|ht&63,Tt++}}return Te[ne]=0,ne-Ke},cs=ae=>{for(var ne=0,be=0;be<ae.length;++be){var Te=ae.charCodeAt(be);127>=Te?ne++:2047>=Te?ne+=2:55296<=Te&&57343>=Te?(ne+=4,++be):ne+=3}return ne},ls=new TextDecoder,on=(ae,ne,be,Te)=>{if(be=ne+be,Te)return be;for(;ae[ne]&&!(ne>=be);)++ne;return ne},we=new TextDecoder("utf-16le"),lt=(ae,ne,be)=>(ae>>=1,we.decode(v.subarray(ae,on(v,ae,ne/2,be)))),an=(ae,ne,be)=>{if(be??(be=2147483647),2>be)return 0;be-=2;var Te=ne;be=be<2*ae.length?be/2:ae.length;for(var Ke=0;Ke<be;++Ke)B[ne>>1]=ae.charCodeAt(Ke),ne+=2;return B[ne>>1]=0,ne-Te},Ao=ae=>2*ae.length,Ha=(ae,ne,be)=>{var Te="";ae>>=2;for(var Ke=0;!(Ke>=ne/4);Ke++){var Tt=N[ae+Ke];if(!Tt&&!be)break;Te+=String.fromCodePoint(Tt)}return Te},ho=(ae,ne,be)=>{if(be??(be=2147483647),4>be)return 0;var Te=ne;be=Te+be-4;for(var Ke=0;Ke<ae.length;++Ke){var Tt=ae.codePointAt(Ke);if(65535<Tt&&Ke++,P[ne>>2]=Tt,ne+=4,ne+4>be)break}return P[ne>>2]=0,ne-Te},Ba=ae=>{for(var ne=0,be=0;be<ae.length;++be)65535<ae.codePointAt(be)&&be++,ne+=4;return ne},Cl=[],G_=ae=>{var ne=Cl.length;return Cl.push(ae),ne},LB=(ae,ne)=>{for(var be=Array(ae),Te=0;Te<ae;++Te)be[Te]=Js(N[ne+4*Te>>2],`parameter ${Te}`);return be},ws=(ae,ne,be)=>{var Te=[];return ae=ae(Te,be),Te.length&&(N[ne>>2]=ef(Te)),ae},iG={},oG=ae=>{var ne=iG[ae];return ne===void 0?ot(ae):ne},yW={},Hie=()=>{if(!CW){var ae={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.language||"C").replace("-","_")+".UTF-8",_:c||"./this.program"},ne;for(ne in yW)yW[ne]===void 0?delete ae[ne]:ae[ne]=yW[ne];var be=[];for(ne in ae)be.push(`${ne}=${ae[ne]}`);CW=be}return CW},CW,ePe=[null,[],[]],CA=new Uint8Array(123),V_=25;0<=V_;--V_)CA[48+V_]=52+V_,CA[65+V_]=V_,CA[97+V_]=26+V_;CA[43]=62,CA[47]=63,(()=>{let ae=Kt.prototype;Object.assign(ae,{isAliasOf:function(be){if(!(this instanceof Kt&&be instanceof Kt))return!1;var Te=this.L.P.M,Ke=this.L.O;be.L=be.L;var Tt=be.L.P.M;for(be=be.L.O;Te.U;)Ke=Te.ea(Ke),Te=Te.U;for(;Tt.U;)be=Tt.ea(be),Tt=Tt.U;return Te===Tt&&Ke===be},clone:function(){if(this.L.O||ft(this),this.L.da)return this.L.count.value+=1,this;var be=Se,Te=Object,Ke=Te.create,Tt=Object.getPrototypeOf(this),ht=this.L;return be=be(Ke.call(Te,Tt,{L:{value:{count:ht.count,ba:ht.ba,da:ht.da,O:ht.O,P:ht.P,S:ht.S,W:ht.W}}})),be.L.count.value+=1,be.L.ba=!1,be},delete(){if(this.L.O||ft(this),this.L.ba&&!this.L.da)throw new Fe("Object already scheduled for deletion");Ie(this);var be=this.L;--be.count.value,be.count.value===0&&(be.S?be.W.Y(be.S):be.P.M.Y(be.O)),this.L.da||(this.L.S=void 0,this.L.O=void 0)},isDeleted:function(){return!this.L.O},deleteLater:function(){if(this.L.O||ft(this),this.L.ba&&!this.L.da)throw new Fe("Object already scheduled for deletion");return this.L.ba=!0,this}});let ne=Symbol.dispose;ne&&(ae[ne]=ae.delete)})(),Object.assign(or.prototype,{sa(ae){return this.na&&(ae=this.na(ae)),ae},ka(ae){var ne;(ne=this.Y)==null||ne.call(this,ae)},X:ye,N:function(ae){function ne(){return this.ga?yo(this.M.$,{P:this.xa,O:be,W:this,S:ae}):yo(this.M.$,{P:this,O:ae})}var be=this.sa(ae);if(!be)return this.ka(ae),null;var Te=Oo(this.M,be);if(Te!==void 0)return Te.L.count.value===0?(Te.L.O=be,Te.L.S=ae,Te.clone()):(Te=Te.clone(),this.ka(ae),Te);if(Te=this.M.ra(be),Te=Gt[Te],!Te)return ne.call(this);Te=this.fa?Te.oa:Te.pointerType;var Ke=Xn(be,this.M,Te.M);return Ke===null?ne.call(this):this.ga?yo(Te.M.$,{P:Te,O:Ke,W:this,S:ae}):yo(Te.M.$,{P:Te,O:Ke})}}),i.print&&(p=i.print),i.printErr&&(A=i.printErr),i.wasmBinary&&(m=i.wasmBinary),i.thisProgram&&(c=i.thisProgram);var Wie,EW,H_,tPe={x:()=>F(""),q:ae=>{var ne=ge[ae];delete ge[ae];var be=ne.ia,Te=ne.Y,Ke=ne.la,Tt=Ke.map(ht=>ht.va).concat(Ke.map(ht=>ht.Ba));Oe([ae],Tt,ht=>{var vt={};return Ke.forEach((Dn,Yn)=>{var hn=ht[Yn],Da=Dn.ta,nf=Dn.ua,El=ht[Yn+Ke.length],bl=Dn.Aa,ad=Dn.Ca;vt[Dn.qa]={read:EA=>hn.N(Da(nf,EA)),write:(EA,OB)=>{var of=[];bl(ad,EA,El.T(of,OB)),re(of)},optional:ht[Yn].optional}}),[{name:ne.name,N:Dn=>{var Yn={},hn;for(hn in vt)Yn[hn]=vt[hn].read(Dn);return Te(Dn),Yn},T:(Dn,Yn)=>{for(var hn in vt)if(!(hn in Yn||vt[hn].optional))throw new TypeError(`Missing field: "${hn}"`);var Da=be();for(hn in vt)vt[hn].write(Da,Yn[hn]);return Dn!==null&&Dn.push(Te,Da),Da},X:ye,V:Te}]})},n:(ae,ne,be,Te,Ke)=>{ne=ot(ne),Te=Te===0n;let Tt=ht=>ht;if(Te){let ht=8*be;Tt=vt=>BigInt.asUintN(ht,vt),Ke=Tt(Ke)}Ye(ae,{name:ne,N:Tt,T:(ht,vt)=>(typeof vt=="number"&&(vt=BigInt(vt)),vt),X:st(ne,be,!Te),V:null})},B:(ae,ne,be,Te)=>{ne=ot(ne),Ye(ae,{name:ne,N:function(Ke){return!!Ke},T:function(Ke,Tt){return Tt?be:Te},X:function(Ke){return this.N(S[Ke])},V:null})},j:(ae,ne,be,Te,Ke,Tt,ht,vt,Dn,Yn,hn,Da,nf)=>{hn=ot(hn),Tt=wi(Ke,Tt),vt&&(vt=wi(ht,vt)),Yn&&(Yn=wi(Dn,Yn)),nf=wi(Da,nf);var El=fo(hn);Je(El,function(){Xo(`Cannot construct ${hn} due to unbound types`,[Te])}),Oe([ae,ne,be],Te?[Te]:[],bl=>{if(bl=bl[0],Te)var ad=bl.M,EA=ad.$;else EA=Kt.prototype;bl=mt(hn,function(...IW){if(Object.getPrototypeOf(this)!==OB)throw new Fe(`Use 'new' to construct ${hn}`);if(of.Z===void 0)throw new Fe(`${hn} has no accessible constructor`);var jie=of.Z[IW.length];if(jie===void 0)throw new Fe(`Tried to invoke ctor of ${hn} with invalid number of parameters (${IW.length}) - expected (${Object.keys(of.Z).toString()}) parameters instead!`);return jie.apply(this,IW)});var OB=Object.create(EA,{constructor:{value:bl}});bl.prototype=OB;var of=new Vt(hn,bl,OB,nf,ad,Tt,vt,Yn);if(of.U){var FB;(FB=of.U).ja??(FB.ja=[]),of.U.ja.push(of)}return ad=new or(hn,of,!0,!1,!1),FB=new or(hn+"*",of,!1,!1,!1),EA=new or(hn+" const*",of,!1,!0,!1),Gt[ae]={pointerType:FB,oa:EA},qo(El,bl),[ad,FB,EA]})},g:(ae,ne,be,Te,Ke,Tt)=>{var ht=ss(ne,be);Ke=wi(Te,Ke),Oe([],[ae],vt=>{vt=vt[0];var Dn=`constructor ${vt.name}`;if(vt.M.Z===void 0&&(vt.M.Z=[]),vt.M.Z[ne-1]!==void 0)throw new Fe(`Cannot register multiple constructors with identical number of parameters (${ne-1}) for class '${vt.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return vt.M.Z[ne-1]=()=>{Xo(`Cannot construct ${vt.name} due to unbound types`,ht)},Oe([],ht,Yn=>(Yn.splice(1,0,null),vt.M.Z[ne-1]=Do(Dn,Yn,null,Ke,Tt),[])),[]})},b:(ae,ne,be,Te,Ke,Tt,ht,vt,Dn)=>{var Yn=ss(be,Te);ne=ot(ne),ne=Ts(ne),Tt=wi(Ke,Tt),Oe([],[ae],hn=>{function Da(){Xo(`Cannot call ${nf} due to unbound types`,Yn)}hn=hn[0];var nf=`${hn.name}.${ne}`;ne.startsWith("@@")&&(ne=Symbol[ne.substring(2)]),vt&&hn.M.ya.push(ne);var El=hn.M.$,bl=El[ne];return bl===void 0||bl.R===void 0&&bl.className!==hn.name&&bl.aa===be-2?(Da.aa=be-2,Da.className=hn.name,El[ne]=Da):(Hn(El,ne,nf),El[ne].R[be-2]=Da),Oe([],Yn,ad=>(ad=Do(nf,ad,hn,Tt,ht,Dn),El[ne].R===void 0?(ad.aa=be-2,El[ne]=ad):El[ne].R[be-2]=ad,[])),[]})},z:ae=>Ye(ae,tf),r:(ae,ne,be,Te)=>{function Ke(){}ne=ot(ne),Ke.values={},Ye(ae,{name:ne,constructor:Ke,N:function(Tt){return this.constructor.values[Tt]},T:(Tt,ht)=>ht.value,X:yh(ne,be,Te),V:null}),Je(ne,Ke)},d:(ae,ne,be)=>{var Te=Js(ae,"enum");ne=ot(ne),ae=Te.constructor,Te=Object.create(Te.constructor.prototype,{value:{value:be},constructor:{value:mt(`${Te.name}_${ne}`,function(){})}}),ae.values[be]=Te,ae[ne]=Te},m:(ae,ne,be)=>{ne=ot(ne),Ye(ae,{name:ne,N:Te=>Te,T:(Te,Ke)=>Ke,X:z_(ne,be),V:null})},l:(ae,ne,be,Te,Ke,Tt,ht)=>{var vt=ss(ne,be);ae=ot(ae),ae=Ts(ae),Ke=wi(Te,Ke),Je(ae,function(){Xo(`Cannot call ${ae} due to unbound types`,vt)},ne-1),Oe([],vt,Dn=>(Dn=[Dn[0],null].concat(Dn.slice(1)),qo(ae,Do(ae,Dn,null,Ke,Tt,ht),ne-1),[]))},c:(ae,ne,be,Te,Ke)=>{ne=ot(ne);let Tt=vt=>vt;if(Te===0){var ht=32-8*be;Tt=vt=>vt<<ht>>>ht,Ke=Tt(Ke)}Ye(ae,{name:ne,N:Tt,T:(vt,Dn)=>Dn,X:st(ne,be,Te!==0),V:null})},a:(ae,ne,be)=>{function Te(Tt){return new Ke(x.buffer,N[Tt+4>>2],N[Tt>>2])}var Ke=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][ne];be=ot(be),Ye(ae,{name:be,N:Te,X:Te},{wa:!0})},h:ae=>{Ye(ae,Xm)},A:(ae,ne)=>{ne=ot(ne),Ye(ae,{name:ne,N(be){var Te=(Te=be+4)?ls.decode(S.subarray(Te,on(S,Te,N[be>>2],!0))):"";return H_(be),Te},T(be,Te){Te instanceof ArrayBuffer&&(Te=new Uint8Array(Te));var Ke=typeof Te=="string";if(!(Ke||ArrayBuffer.isView(Te)&&Te.BYTES_PER_ELEMENT==1))throw new Fe("Cannot pass non-string to std::string");var Tt=Ke?cs(Te):Te.length,ht=EW(4+Tt+1),vt=ht+4;return N[ht>>2]=Tt,Ke?br(Te,vt,Tt+1):S.set(Te,vt),be!==null&&be.push(H_,ht),ht},X:ye,V(be){H_(be)}})},f:(ae,ne,be)=>{if(be=ot(be),ne===2)var Te=lt,Ke=an,Tt=Ao;else Te=Ha,Ke=ho,Tt=Ba;Ye(ae,{name:be,N:ht=>{var vt=Te(ht+4,N[ht>>2]*ne,!0);return H_(ht),vt},T:(ht,vt)=>{if(typeof vt!="string")throw new Fe(`Cannot pass non-string to C++ string type ${be}`);var Dn=Tt(vt),Yn=EW(4+Dn+ne);return N[Yn>>2]=Dn/ne,Ke(vt,Yn+4,Dn+ne),ht!==null&&ht.push(H_,Yn),Yn},X:ye,V(ht){H_(ht)}})},i:(ae,ne,be,Te,Ke,Tt)=>{ge[ae]={name:ot(ne),ia:wi(be,Te),Y:wi(Ke,Tt),la:[]}},e:(ae,ne,be,Te,Ke,Tt,ht,vt,Dn,Yn)=>{ge[ae].la.push({qa:ot(ne),va:be,ta:wi(Te,Ke),ua:Tt,Ba:ht,Aa:wi(vt,Dn),Ca:Yn})},C:(ae,ne)=>{ne=ot(ne),Ye(ae,{ma:!0,name:ne,N:()=>{},T:()=>{}})},p:(ae,ne,be)=>{var[Te,...Ke]=LB(ae,ne);ne=Te.T.bind(Te);var Tt=Ke.map(Dn=>Dn.X.bind(Dn));ae--;var ht={toValue:$u};switch(ae=Tt.map((Dn,Yn)=>{var hn=`argFromPtr${Yn}`;return ht[hn]=Dn,`${hn}(args${Yn?"+"+8*Yn:""})`}),be){case 0:var vt="toValue(handle)";break;case 2:vt="new (toValue(handle))";break;case 3:vt="";break;case 1:ht.getStringOrSymbol=oG,vt="toValue(handle)[getStringOrSymbol(methodName)]"}return vt+=`(${ae})`,Te.ma||(ht.toReturnWire=ne,ht.emval_returnValue=ws,vt=`return emval_returnValue(toReturnWire, destructorsRef, ${vt})`),vt=`return function (handle, methodName, destructorsRef, args) {
${vt}
}`,be=new Function(Object.keys(ht),vt)(...Object.values(ht)),vt=`methodCaller<(${Ke.map(Dn=>Dn.name)}) => ${Te.name}>`,G_(mt(vt,be))},E:Ss,o:(ae,ne,be,Te,Ke)=>Cl[ae](ne,be,Te,Ke),D:ae=>{var ne=$u(ae);re(ne),Ss(ae)},s:(ae,ne,be,Te)=>{var Ke=new Date().getFullYear(),Tt=new Date(Ke,0,1).getTimezoneOffset();Ke=new Date(Ke,6,1).getTimezoneOffset(),N[ae>>2]=60*Math.max(Tt,Ke),P[ne>>2]=+(Tt!=Ke),ne=ht=>{var vt=Math.abs(ht);return`UTC${0<=ht?"-":"+"}${String(Math.floor(vt/60)).padStart(2,"0")}${String(vt%60).padStart(2,"0")}`},ae=ne(Tt),ne=ne(Ke),Ke<Tt?(br(ae,be,17),br(ne,Te,17)):(br(ae,Te,17),br(ne,be,17))},y:ae=>{var ne=S.length;if(ae>>>=0,2147483648<ae)return!1;for(var be=1;4>=be;be*=2){var Te=ne*(1+.2/be);Te=Math.min(Te,ae+100663296);e:{Te=(Math.min(2147483648,65536*Math.ceil(Math.max(ae,Te)/65536))-b.buffer.byteLength+65535)/65536|0;try{b.grow(Te),R();var Ke=1;break e}catch{}Ke=void 0}if(Ke)return!0}return!1},t:(ae,ne)=>{var be=0,Te=0,Ke;for(Ke of Hie()){var Tt=ne+be;N[ae+Te>>2]=Tt,be+=br(Ke,Tt,1/0)+1,Te+=4}return 0},u:(ae,ne)=>{var be=Hie();N[ae>>2]=be.length,ae=0;for(var Te of be)ae+=cs(Te)+1;return N[ne>>2]=ae,0},v:()=>52,w:function(){return 70},k:(ae,ne,be,Te)=>{for(var Ke=0,Tt=0;Tt<be;Tt++){var ht=N[ne>>2],vt=N[ne+4>>2];ne+=8;for(var Dn=0;Dn<vt;Dn++){var Yn=ae,hn=S[ht+Dn],Da=ePe[Yn];hn===0||hn===10?(Yn=Yn===1?p:A,hn=on(Da,0),hn=ls.decode(Da.buffer?Da.subarray(0,hn):new Uint8Array(Da.slice(0,hn))),Yn(hn),Da.length=0):Da.push(hn)}Ke+=vt}return N[Te>>2]=Ke,0}},ax=await(async function(){var ae;function ne(Te){var Ke;return ax=Te.exports,b=ax.F,R(),bn=ax.H,Te=ax,Wie=Te.I,i._malloc=EW=Te.J,i._free=H_=Te.K,O--,(Ke=i.monitorRunDependencies)==null||Ke.call(i,O),O==0&&G&&(Te=G,G=null,Te()),ax}O++,(ae=i.monitorRunDependencies)==null||ae.call(i,O);var be={a:tPe};return i.instantiateWasm?new Promise(Te=>{i.instantiateWasm(be,(Ke,Tt)=>{Te(ne(Ke))})}):(U??(U=pe("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C0EAEKEDRQRAQZiDASEBIARBmIMBQRgQiwFFDQJBsIMBIQEgBEGwgwFBGBCLAUUNAkEAIQBBvO4BLQAARQRAA0AgAEECdCAAQcYfEKIDNgKM7gEgAEEBaiIAQQZHDQALQbzuAUEBOgAAQaTuAUGM7gEoAgA2AgALQYzuASEBIAJBCGoiAEGM7gFBGBCLAUUNAkGk7gEhASAAQaTuAUEYEIsBRQ0CQRgQNCIBRQ0BCyABIAIpAgg3AgAgASACKQIYNwIQIAEgAikCEDcCCAwBC0EAIQELIAJBIGokAEGc8QFBAToAAEGY8QEgATYCACABC80KAgV/CX4jAEHgAGsiBSQAIARC////////P4MhCiACIASFQoCAgICAgICAgH+DIQsgAkL///////8/gyIMQiCIIQ8gBEIwiKdB//8BcSEHAkACQCACQjCIp0H//wFxIglB//8Ba0GCgH5PBEAgB0H//wFrQYGAfksNAQsgAVAgAkL///////////8AgyINQoCAgICAgMD//wBUIA1CgICAgICAwP//AFEbRQRAIAJCgICAgICAIIQhCwwCCyADUCAEQv///////////wCDIgJCgICAgICAwP//AFQgAkKAgICAgIDA//8AURtFBEAgBEKAgICAgIAghCELIAMhAQwCCyABIA1CgICAgICAwP//AIWEUARAIAIgA4RQBEBCgICAgICA4P//ACELQgAhAQwDCyALQoCAgICAgMD//wCEIQtCACEBDAILIAMgAkKAgICAgIDA//8AhYRQBEAgASANhEIAIQFQBEBCgICAgICA4P//ACELDAMLIAtCgICAgICAwP//AIQhCwwCCyABIA2EUARAQgAhAQwCCyACIAOEUARAQgAhAQwCCyANQv///////z9YBEAgBUHQAGogASAMIAEgDCAMUCIGG3lCwABCACAGG3ynIgZBD2sQREEQIAZrIQYgBSkDWCIMQiCIIQ8gBSkDUCEBCyACQv///////z9WDQAgBUFAayADIAogAyAKIApQIggbeULAAEIAIAgbfKciCEEPaxBEIAYgCGtBEGohBiAFKQNIIQogBSkDQCEDCyAHIAlqIAZqQf//AGshBgJAIApCD4YiDkIgiEKAgICACIQiAiABQiCIIgR+IhAgA0IPhiIRQiCIIgogD0KAgASEIg1+fCIPIBBUrSAPIANCMYggDoRC/////w+DIgMgDEL/////D4MiDH58Ig4gD1StfCACIA1+fCAOIA4gEUKAgP7/D4MiDyAMfiIRIAQgCn58IhAgEVStIBAgECADIAFC/////w+DIgF+fCIQVq18fCIOVq18IAMgDX4iEiACIAx+fCIRIBJUrUIghiARQiCIhHwgDiAOIBFCIIZ8Ig5WrXwgDiANIA9+Ig0gCiAMfnwiDCABIAJ+fCICIAMgBH58IgNCIIggAiADVq0gDCANVK0gAiAMVK18fEIghoR8IgIgDlStfCACIBAgBCAPfiIMIAEgCn58IgRCIIggBCAMVK1CIIaEfCIKIBBUrSAKIANCIIZ8IgMgClStfHwiCiACVK18IAogAyAEQiCGIgIgASAPfnwiASACVK18IgIgA1StfCIEIApUrXwiA0KAgICAgIDAAINQRQRAIAZBAWohBgwBCyABQj+IIANCAYYgBEI/iIQhAyAEQgGGIAJCP4iEIQQgAUIBhiEBIAJCAYaEIQILIAZB//8BTgRAIAtCgICAgICAwP//AIQhC0IAIQEMAQsCfiAGQQBMBEBBASAGayIHQf8ATQRAIAVBMGogASACIAZB/wBqIgYQRCAFQSBqIAQgAyAGEEQgBUEQaiABIAIgBxCKASAFIAQgAyAHEIoBIAUpAzAgBSkDOIRCAFKtIAUpAyAgBSkDEISEIQEgBSkDKCAFKQMYhCECIAUpAwAhBCAFKQMIDAILQgAhAQwCCyADQv///////z+DIAatQjCGhAsgC4QhCyABUCACQgBZIAJCgICAgICAgICAf1EbRQRAIAsgBEIBfCIBUK18IQsMAQsgASACQoCAgICAgICAgH+FhFBFBEAgBCEBDAELIAsgBCAEQgGDfCIBIARUrXwhCwsgACABNwMAIAAgCzcDCCAFQeAAaiQACwYAIAAQLQt8AQN/IwBBEGsiASQAIAEgADYCDCMAQRBrIgIkACAAKAIAQX9HBEAgAkEIaiACQQxqIAFBDGoQVRBVIQMDQCAAKAIAQQFGDQALIAAoAgBFBEAgAEEBNgIAIAMQ0gIgAEF/NgIACwsgAkEQaiQAIAAoAgQgAUEQaiQAQQFrCyAAIAAgAUEBazYCBCAAQeDVATYCACAAQZCtATYCACAAC/cFAQl/IwBBEGsiCSQAIAEQ1wIgCUEMaiABEFUhCCAAQQhqIgMQayACTQRAAkAgAkEBaiIAIAMQayIBSwRAIwBBIGsiCiQAAkAgACABayIHIAMoAgggAygCBGtBAnVNBEAgAyAHENkCDAELIApBDGohAQJ/IAMQayAHaiEFIwBBEGsiACQAIAAgBTYCDCAFELwCIgRNBEAgAxC5AiIFIARBAXZJBEAgACAFQQF0NgIIIABBCGogAEEMahCgASgCACEECyAAQRBqJAAgBAwBCxCMAQALIQQgAxBrIQUjAEEQayIAJAAgASADQQxqIgs2AhAgAUEANgIMIAQEfyAAQQhqIAsgBBC7AiAAKAIIIQYgACgCDAVBAAshBCABIAY2AgAgASAGIAVBAnRqIgU2AgggASAGIARBAnRqNgIMIAEgBTYCBCAAQRBqJAAjAEEQayIGJAAgASgCCCEEIAZBBGoiACABQQhqNgIIIAAgBDYCACAAIAQgB0ECdGo2AgQgACgCACEEA0AgACgCBCAERwRAIAEoAhAaIAQQugIgACAAKAIAQQRqIgQ2AgAMAQsLIAAoAgggACgCADYCACAGQRBqJAAgASgCBCADKAIAIgAgAygCBGtqIQQgAygCBCAAayIHBEAgBCAAIAf8CgAACyABIAQ2AgQgAyADKAIANgIEIAMgAUEEahDXASADQQRqIAFBCGoQ1wEgA0EIaiABQQxqENcBIAEgASgCBDYCACADEGsaIAEoAgQhAANAIAEoAggiBCAARwRAIAEgBEEEazYCCCABKAIQGgwBCwsgASgCACIABEAgASgCECAAIAEoAgwgASgCAGtBAnUQuAILCyAKQSBqJAAMAQsgACABSQRAIAMoAgAgAEECdGohACADEGsaIAMgABDYAgsLCyADIAIQggEoAgAEQCADIAIQggEoAgAQvwELIAgQrAEhACADIAIQggEgADYCACAIKAIAIQAgCEEANgIAIAAEQCAAEL8BCyAJQRBqJAALySgBC38jAEEQayIKJAACQAJAAkACQAJAAkACQAJAAkACQCAAQfQBTQRAQYzqASgCACIEQRAgAEELakH4A3EgAEELSRsiBkEDdiIAdiIBQQNxBEACQCABQX9zQQFxIABqIgJBA3QiAUG06gFqIgAgASgCvOoBIgEoAggiBUYEQEGM6gEgBEF+IAJ3cTYCAAwBCyAFIAA2AgwgACAFNgIICyABQQhqIQAgASACQQN0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KAIAKAIcEQQAC8EBAQN/IAAtAABBIHFFBEACQCAAKAIQIgMEfyADBSAAEN8BDQEgACgCEAsgACgCFCIEayACSQRAIAAgASACIAAoAiQRAwAaDAELAkACQCACRSAAKAJQQQBIcg0AIAIhAwNAIAEgA2oiBUEBay0AAEEKRwRAIANBAWsiAw0BDAILCyAAIAEgAyAAKAIkEQMAIANJDQIgAiADayECIAAoAhQhBAwBCyABIQULIAQgBSACEHEaIAAgACgCFCACajYCFAsLC6EBAQJ/AkAgABAfRSACIAFrQQVIcg0AIAEgAhDHASACQQRrIQQgABAjIgIgABAfaiEFAkADQAJAIAIsAAAhACABIARPDQAgAEEATCAAQf8ATnJFBEAgASgCACACLAAARw0DCyABQQRqIQEgAiAFIAJrQQFKaiECDAELCyAAQQBMIABB/wBOcg0BIAIsAAAgBCgCAEEBa0sNAQsgA0EENgIACwtQAQF+AkAgA0HAAHEEQCABIANBQGqthiECQgAhAQwBCyADRQ0AIAIgA60iBIYgAUHAACADa62IhCECIAEgBIYhAQsgACABNwMAIAAgAjcDCAtpAQF/IwBBgAJrIgUkACAEQYDABHEgAiADTHJFBEAgBSABIAIgA2siA0GAAiADQYACSSIBGxCYAiABRQRAA0AgACAFQYACEEIgA0GAAmsiA0H/AUsNAAsLIAAgBSADEEILIAVBgAJqJAALBABBAAsKACAALQALQQd2CwoAIABB0PIBEHoLCgAgAEHY8gEQegvPCQIEfwR+IwBB8ABrIgYkACAEQv///////////wCDIQkCQAJAIAFQIgUgAkL///////////8AgyIKQoCAgICAgMD//wB9QoCAgICAgMCAgH9UIApQG0UEQCADQgBSIAlCgICAgICAwP//AH0iC0KAgICAgIDAgIB/ViALQoCAgICAgMCAgH9RGw0BCyAFIApCgICAgICAwP//AFQgCkKAgICAgIDA//8AURtFBEAgAkKAgICAgIAghCEEIAEhAwwCCyADUCAJQoCAgICAgMD//wBUIAlCgICAgICAwP//AFEbRQRAIARCgICAgICAIIQhBAwCCyABIApCgICAgICAwP//AIWEUARAQoCAgICAgOD//wAgAiABIAOFIAIgBIVCgICAgICAgICAf4WEUCIFGyEEQgAgASAFGyEDDAILIAMgCUKAgICAgIDA//8AhYRQDQEgASAKhFAEQCADIAmEQgBSDQIgASADgyEDIAIgBIMhBAwCCyADIAmEUEUNACABIQMgAiEEDAELIAMgASABIANUIAkgClYgCSAKURsiCBshCiAEIAIgCBsiDEL///////8/gyEJIAIgBCAIGyILQjCIp0H//wFxIQcgDEIwiKdB//8BcSIFRQRAIAZB4ABqIAogCSAKIAkgCVAiBRt5QsAAQgAgBRt8pyIFQQ9rEEQgBikDaCEJIAYpA2AhCkEQIAVrIQULIAEgAyAIGyEDIAtC////////P4MhASAHBH4gAQUgBkHQAGogAyABIAMgASABUCIHG3lCwABCACAHG3ynIgdBD2sQREEQIAdrIQcgBikDUCEDIAYpA1gLQgOGIANCPYiEQoCAgICAgIAEhCEBIAlCA4YgCkI9iIQgAiAEhSEEAn4gA0IDhiICIAUgB0YNABogBSAHayIHQf8ASwRAQgAhAUIBDAELIAZBQGsgAiABQYABIAdrEEQgBkEwaiACIAEgBxCKASAGKQM4IQEgBikDMCAGKQNAIAYpA0iEQgBSrYQLIQlCgICAgICAgASEIQsgCkIDhiEKAkAgBEIAUwRAQgAhA0IAIQQgCSAKhSABIAuFhFANAiAKIAl9IQIgCyABfSAJIApWrX0iBEL/////////A1YNASAGQSBqIAIgBCACIAQgBFAiBxt5QsAAQgAgBxt8p0EMayIHEEQgBSAHayEFIAYpAyghBCAGKQMgIQIMAQsgCSAKfCICIAlUrSABIAt8fCIEQoCAgICAgIAIg1ANACAJQgGDIARCP4YgAkIBiISEIQIgBUEBaiEFIARCAYghBAsgDEKAgICAgICAgIB/gyEDIAVB//8BTgRAIANCgICAgICAwP//AIQhBEIAIQMMAQtBACEHAkAgBUEASgRAIAUhBwwBCyAGQRBqIAIgBCAFQf8AahBEIAYgAiAEQQEgBWsQigEgBikDACAGKQMQIAYpAxiEQgBSrYQhAiAGKQMIIQQLIARCPYYgAkIDiIQhASAEQgOIQv///////z+DIAetQjCGhCADhCEEAkACQCACp0EHcSIFQQRHBEAgBCABIAEgBUEES618IgNWrXwhBAwBCyAEIAEgASABQgGDfCIDVq18IQQMAQsgBUUNAQsLIAAgAzcDACAAIAQ3AwggBkHwAGokAAsRACAAIAEgACgCACgCLBEEAAsIACAAQYABSQsRACACBEAgACABIAL8CgAACwsJACAAECMQ9wELhAECAn8BfiMAQRBrIgMkACAAAn4gAUUEQEIADAELIAMgASABQR91IgJzIAJrIgKtQgAgAmciAkHRAGoQRCADKQMIQoCAgICAgMAAhUGegAEgAmutQjCGfEKAgICAgICAgIB/QgAgAUEASBuEIQQgAykDAAs3AwAgACAENwMIIANBEGokAAsNACAAIAFB/wBxOgALC6oMAQh/An9BACABRQ0AGiAAQX9zIQMgAkEXTwRAAkAgAUEDcUUNACABLQAAIANzQf8BcUECdCgC0DMgA0EIdnMhAyACQQFrIgBFIAFBAWoiBEEDcUVyRQRAIAEtAAEgA3NB/wFxQQJ0KALQMyADQQh2cyEDIAJBAmsiAEUgAUECaiIEQQNxRXJFBEAgAS0AAiADc0H/AXFBAnQoAtAzIANBCHZzIQMgAkEDayIARSABQQNqIgRBA3FFckUEQCABLQADIANzQf8BcUECdCgC0DMgA0EIdnMhAyABQQRqIQEgAkEEayECDAMLIAAhAiAEIQEMAgsgACECIAQhAQwBCyAAIQIgBCEBCyACQRRuIghBbGwhCgJAIAhBAWsiCUUEQEEAIQQMAQsgASEAQQAhBANAIAAoAhAgB3MiB0EWdkH8B3EoAtBTIAdBDnZB/AdxKALQSyAHQQZ2QfwHcSgC0EMgB0H/AXFBAnQoAtA7c3NzIQcgACgCDCAGcyIGQRZ2QfwHcSgC0FMgBkEOdkH8B3EoAtBLIAZBBnZB/AdxKALQQyAGQf8BcUECdCgC0Dtzc3MhBiAAKAIIIARzIgRBFnZB/AdxKALQUyAEQQ52QfwHcSgC0EsgBEEGdkH8B3EoAtBDIARB/wFxQQJ0KALQO3NzcyEEIAAoAgQgBXMiBUEWdkH8B3EoAtBTIAVBDnZB/AdxKALQSyAFQQZ2QfwHcSgC0EMgBUH/AXFBAnQoAtA7c3NzIQUgACgCACADcyIDQRZ2QfwHcSgC0FMgA0EOdkH8B3EoAtBLIANBBnZB/AdxKALQQyADQf8BcUECdCgC0Dtzc3MhAyAAQRRqIQAgCUEBayIJDQALIAEgCEEUbGpBFGshAQsgAiAKaiECIAEoAhAgASgCDCABKAIIIAEoAgQgASgCACADcyIAQQh2IABB/wFxQQJ0KALQM3MiAEEIdiAAQf8BcUECdCgC0DNzIgBBCHYgAEH/AXFBAnQoAtAzcyIAQf8BcUECdCgC0DMgBXNzIABBCHZzIgBBCHYgAEH/AXFBAnQoAtAzcyIAQQh2IABB/wFxQQJ0KALQM3MiAEEIdiAAQf8BcUECdCgC0DNzIgBB/wFxQQJ0KALQMyAEc3MgAEEIdnMiAEEIdiAAQf8BcUECdCgC0DNzIgBBCHYgAEH/AXFBAnQoAtAzcyIAQQh2IABB/wFxQQJ0KALQM3MiAEH/AXFBAnQoAtAzIAZzcyAAQQh2cyIAQQh2IABB/wFxQQJ0KALQM3MiAEEIdiAAQf8BcUECdCgC0DNzIgBBCHYgAEH/AXFBAnQoAtAzcyIAQf8BcUECdCgC0DMgB3NzIABBCHZzIgBBCHYgAEH/AXFBAnQoAtAzcyIAQQh2IABB/wFxQQJ0KALQM3MiAEEIdiAAQf8BcUECdCgC0DNzIgBBCHYgAEH/AXFBAnQoAtAzcyEDIAFBFGohAQsgAkEHSwRAA0AgAS0AACADc0H/AXFBAnQoAtAzIANBCHZzIgBBCHYgAS0AASAAc0H/AXFBAnQoAtAzcyIAQQh2IAEtAAIgAHNB/wFxQQJ0KALQM3MiAEEIdiABLQADIABzQf8BcUECdCgC0DNzIgBBCHYgAS0ABCAAc0H/AXFBAnQoAtAzcyIAQQh2IAEtAAUgAHNB/wFxQQJ0KALQM3MiAEEIdiABLQAGIABzQf8BcUECdCgC0DNzIgBBCHYgAS0AByAAc0H/AXFBAnQoAtAzcyEDIAFBCGohASACQQhrIgJBB0sNAAsLAkAgAkUNACABLQAAIANzQf8BcUECdCgC0DMgA0EIdnMhAyACQQFGDQAgAS0AASADc0H/AXFBAnQoAtAzIANBCHZzIQMgAkECRg0AIAEtAAIgA3NB/wFxQQJ0KALQMyADQQh2cyEDIAJBA0YNACABLQADIANzQf8BcUECdCgC0DMgA0EIdnMhAyACQQRGDQAgAS0ABCADc0H/AXFBAnQoAtAzIANBCHZzIQMgAkEFRg0AIAEtAAUgA3NB/wFxQQJ0KALQMyADQQh2cyEDIAJBBkYNACABLQAGIANzQf8BcUECdCgC0DMgA0EIdnMhAwsgA0F/cwsL5QMBBX8jAEEQayIDJAAgAyAAKAIAIgRBCGsoAgAiAjYCDCADIAAgAmo2AgQgAyAEQQRrKAIANgIIIAMoAggiBCABQQAQOyECIAMoAgQhBQJAIAIEQCADKAIMIQAjAEFAaiIBJAAgAUFAayQAQQAgBSAAGyECDAELIwBBQGoiAiQAIAAgBU4EQCACQgA3AhwgAkIANwIkIAJCADcCLCACQgA3AhQgAkEANgIQIAIgATYCDCACIAQ2AgQgAkEANgI8IAJCgYCAgICAgIABNwI0IAIgADYCCCAEIAJBBGogBSAFQQFBACAEKAIAKAIUEQoAIABBACACKAIcGyEGCyACQUBrJAAgBiICDQAjAEFAaiICJAAgAkEANgIQIAJBlNYBNgIMIAIgADYCCCACIAE2AgRBACEAIAJBFGpBAEEn/AsAIAJBADYCPCACQQE6ADsgBCACQQRqIAVBAUEAIAQoAgAoAhgRCwACQAJAAkAgAigCKA4CAAECCyACKAIYQQAgAigCJEEBRhtBACACKAIgQQFGG0EAIAIoAixBAUYbIQAMAQsgAigCHEEBRwRAIAIoAiwNASACKAIgQQFHDQEgAigCJEEBRw0BCyACKAIUIQALIAJBQGskACAAIQILIANBEGokACACCzwBAn9BASAAIABBAU0bIQEDQAJAIAEQNCIADQBB5P4BKAIAIgJFDQAgAhEMAAwBCwsgAEUEQBDrAQsgAAsUAQF/QQQQUyIBIAAoAgA2AgAgAQsLACAAIAE2AgAgAAsMACAAIAEoAgA2AgALBwAgABAkGgsRACAAIAEgASgCACgCFBEBAAsPACAAIAAoAgAoAhARAAALBwAgABAfRQsJAEGFEBCuAgALEAAgACABQYCAgIB4cjYCCAsMACAAIAEtAAA6AAALCwAgAC0AC0H/AHELEwAgACABIAIgACgCACgCDBEDAAsiAQF/IAIQTAR/IAAoAgggAkECdGooAgAgAXFBAEcFQQALC+wBAQN/IABFBEBB0N4BKAIABEBB0N4BKAIAEGEhAQtBgOABKAIABEBBgOABKAIAEGEgAXIhAQtBwOABKAIAIgAEQANAIAAoAkwaIAAoAhQgACgCHEcEQCAAEGEgAXIhAQsgACgCOCIADQALCyABDwsgACgCTEEASCECAkACQCAAKAIUIAAoAhxGDQAgAEEAQQAgACgCJBEDABogACgCFA0AQX8hAQwBCyAAKAIEIgEgACgCCCIDRwRAIAAgASADa6xBASAAKAIoERYAGgtBACEBIABBADYCHCAAQgA3AxAgAEIANwIEIAINAAsgAQsSACAAKAIAIgAEQCAAEJwDGgsLEQAgACABKAIAEJwDNgIAIAALQQEBfyAAIAE3A3AgACAAKAIsIAAoAgQiAmusNwN4IAAgAVAgASAAKAIIIgAgAmusWXIEfyAABSACIAGnags2AmgLHgACQCACRQ0AIAJBAnQiAkUNACAAIAEgAvwKAAALCxYAIAAgASgCADYCACAAIAIoAgA2AgQLtQEBAn8jAEEQayIFJAAgBSABNgIMQQAhAQJAIAICf0EGIAAgBUEMahArDQAaQQQgA0HAACAAEDciBhBfRQ0AGiADIAYQlAEhAQNAAkAgABA+GiABQTBrIQEgACAFQQxqECsgBEECSHINACADQcAAIAAQNyIGEF9FDQMgBEEBayEEIAMgBhCUASABQQpsaiEBDAELCyAAIAVBDGoQK0UNAUECCyACKAIAcjYCAAsgBUEQaiQAIAELtQEBAn8jAEEQayIFJAAgBSABNgIMQQAhAQJAIAICf0EGIAAgBUEMahAsDQAaQQQgA0HAACAAEDgiBhBgRQ0AGiADIAYQlQEhAQNAAkAgABA/GiABQTBrIQEgACAFQQxqECwgBEECSHINACADQcAAIAAQOCIGEGBFDQMgBEEBayEEIAMgBhCVASABQQpsaiEBDAELCyAAIAVBDGoQLEUNAUECCyACKAIAcjYCAAsgBUEQaiQAIAELYwAgAigCBEGwAXEiAkEgRgRAIAEPCwJAIAJBEEcNAAJAAkAgAC0AACICQStrDgMAAQABCyAAQQFqDwsgAkEwRyABIABrQQJIcg0AIAAtAAFBIHJB+ABHDQAgAEECaiEACyAACy4AAkAgACgCBEHKAHEiAARAIABBwABGBEBBCA8LIABBCEcNAUEQDwtBAA8LQQoLEAAgACgCBCAAKAIAa0ECdQvOAQIEfgJ/IwBBEGsiBiQAIAG9IgVC/////////weDIQIgAAJ+IAVCNIhC/w+DIgNQRQRAIANC/w9SBEAgAkIEiCEEIANCgPgAfCEDIAJCPIYMAgsgAkIEiCEEQv//ASEDIAJCPIYMAQsgAlAEQEIAIQNCAAwBCyAGIAJCACACeaciB0ExahBEIAYpAwhCgICAgICAwACFIQRBjPgAIAdrrSEDIAYpAwALNwMAIAAgBUKAgICAgICAgIB/gyADQjCGhCAEhDcDCCAGQRBqJAALsgMBA38jAEEQayIIJAAgCCACNgIIIAggATYCDCAIQQRqIgEgAxAnIAEQSCEJIAEQJSAEQQA2AgBBACEBAkADQCAGIAdGIAFyDQECQCAIQQxqIAhBCGoQKw0AAkAgCSAGKAIAEJQBQSVGBEAgBkEEaiAHRg0CQQAhAgJ/AkAgCSAGKAIEEJQBIgFBxQBGDQBBBCEKIAFB/wFxQTBGDQAgAQwBCyAGQQhqIAdGDQNBCCEKIAEhAiAJIAYoAggQlAELIQEgCCAAIAgoAgwgCCgCCCADIAQgBSABIAIgACgCACgCJBENADYCDCAGIApqQQRqIQYMAQsgCUEBIAYoAgAQXwRAA0AgByAGQQRqIgZHBEAgCUEBIAYoAgAQXw0BCwsDQCAIQQxqIgEgCEEIahArDQIgCUEBIAEQNxBfRQ0CIAEQPhoMAAsACyAJIAhBDGoiARA3EEEgCSAGKAIAEEFGBEAgBkEEaiEGIAEQPhoMAQsgBEEENgIACyAEKAIAIQEMAQsLIARBBDYCAAsgCEEMaiAIQQhqECsEQCAEIAQoAgBBAnI2AgALIAgoAgwgCEEQaiQAC7QDAQN/IwBBEGsiCCQAIAggAjYCCCAIIAE2AgwgCEEEaiIBIAMQJyABEEkhCSABECUgBEEANgIAQQAhAQJAA0AgBiAHRiABcg0BAkAgCEEMaiAIQQhqECwNAAJAIAkgBiwAABCVAUElRgRAIAZBAWogB0YNAkEAIQICfwJAIAkgBiwAARCVASIBQcUARg0AQQEhCiABQf8BcUEwRg0AIAEMAQsgBkECaiAHRg0DQQIhCiABIQIgCSAGLAACEJUBCyEBIAggACAIKAIMIAgoAgggAyAEIAUgASACIAAoAgAoAiQRDQA2AgwgBiAKakEBaiEGDAELIAlBASAGLAAAEGAEQANAIAcgBkEBaiIGRwRAIAlBASAGLAAAEGANAQsLA0AgCEEMaiIBIAhBCGoQLA0CIAlBASABEDgQYEUNAiABED8aDAALAAsgCSAIQQxqIgEQOBDOASAJIAYsAAAQzgFGBEAgBkEBaiEGIAEQPxoMAQsgBEEENgIACyAEKAIAIQEMAQsLIARBBDYCAAsgCEEMaiAIQQhqECwEQCAEIAQoAgBBAnI2AgALIAgoAgwgCEEQaiQACxYAIAAgASACIAMgACgCACgCMBEJABoLPAAgACwAC0EASARAIAAoAggaIAAoAgAQLQsgACABKQIANwIAIAAgASgCCDYCCCABQQA6AAsgAUEAOgAACxMAIAIEQCAAIAEgAvwKAAALIAALKwEBfyMAQRBrIgIkACACIAE2AgxBwN0BIAAgAUEAQQAQ0QMaIAJBEGokAAsjAQF/IwBBEGsiASQAIAEgADYCDCABQQxqEOwBIAFBEGokAAsMACAAQYKGgCA2AAALEQAgABAjIAAQH0ECdGoQ9wELDQAgACgCACABKAIARgsOACAAECMgABAfahD3AQsPACAAIAAoAgAoAgwRAAALFgAgACABIAIgAyAAKAIAKAIgEQkAGgtEAQF/IAAoAgAhAiABEDEhACACQQhqIgEQayAASwR/IAEgABCCASgCAEEARwVBAAtFBEAQPQALIAJBCGogABCCASgCAAsRACAAIAEgASgCACgCHBEBAAsRACAAIAEgASgCACgCGBEBAAsQACAAQSBGIABBCWtBBUlyCw4AIAAoAghB/////wdxC9cBAQF/AkBBjN4BKAIAIgBBAE4EQCAARQ0BQZThASgCACAAQf////8DcUcNAQsCQEGQ3gEoAgBBCkYNAEHU3QEoAgAiAEHQ3QEoAgBGDQBB1N0BIABBAWo2AgAgAEEKOgAADwtBwN0BEN4BDwtBjN4BQYzeASgCACIAQf////8DIAAbNgIAAkACQEGQ3gEoAgBBCkYNAEHU3QEoAgAiAEHQ3QEoAgBGDQBB1N0BIABBAWo2AgAgAEEKOgAADAELQcDdARDeAQtBjN4BKAIAGkGM3gFBADYCAAvDAQEEfyMAQRBrIgckAAJAIABFDQAgBCgCDCEJIAIgAWsiBkEASgRAIAAgASAGIAAoAgAoAjARAwAgBkcNAQsgAyABayIBIAlIBEAgB0EEaiIGIAkgAWsiASAFELACIAAgBygCBCAGIAcsAA9BAEgbIAEgACgCACgCMBEDACEFIAYQIBogASAFRw0BCyADIAJrIgFBAEoEQCAAIAIgASAAKAIAKAIwEQMAIAFHDQELIARBADYCDCAAIQgLIAdBEGokACAIC14BA38gAEEANgIIIABCADcCACABKAIAIQMgASgCBCIBIANrIgRBAnUiAgRAIAAgAhCuAyAAKAIEIQIgBEUgASADRnJFBEAgAiADIAT8CgAACyAAIAIgBGo2AgQLIAALDQAgACgCACABQQJ0agsXACAAEEcEQCAAIAE2AgQPCyAAIAEQUAthAQF/IwBBEGsiAiQAIAIgADYCDAJAIAAgAUYNAANAIAIgAUEBayIBNgIIIAAgAU8NASACKAIMIAIoAggQ8wIgAiACKAIMQQFqIgA2AgwgAigCCCEBDAALAAsgAkEQaiQAC6wBAQR/IwBBEGsiByQAAkAgAEUNACAEKAIMIQYgAiABa0ECdSIIQQBKBEAgACABIAgQjQIgCEcNAQsgAyABa0ECdSIBIAZIBEAgACAHQQRqIAYgAWsiASAFEP0CIgUQIyABEI0CIQYgBRA5GiABIAZHDQELIAMgAmtBAnUiAUEASgRAIAAgAiABEI0CIAFHDQELIAQoAgwaIARBADYCDCAAIQkLIAdBEGokACAJCycBAX8jAEEQayIDJAAgAyACNgIMIABB5AAgASACENEBIANBEGokAAvbAQIBfwJ+QQEhBAJAIABCAFIgAUL///////////8AgyIFQoCAgICAgMD//wBWIAVCgICAgICAwP//AFEbDQAgAkIAUiADQv///////////wCDIgZCgICAgICAwP//AFYgBkKAgICAgIDA//8AURsNACAAIAKEIAUgBoSEUARAQQAPCyABIAODQgBZBEAgACACVCABIANTIAEgA1EbBEBBfw8LIAAgAoUgASADhYRCAFIPCyAAIAJWIAEgA1UgASADURsEQEF/DwsgACAChSABIAOFhEIAUiEECyAEC+wBAQR/IwBBEGsiBCQAIABBADYCBCMAQRBrIgUkACAEQQA6AA8gACAAKAIAQQxrKAIAahDZASEGIAAgACgCAEEMaygCAGohAwJAIAYEQCADKAJIBEAgACAAKAIAQQxrKAIAaigCSBDFAwsgBCAAIAAoAgBBDGsoAgBqENkBOgAPDAELIANBBBDVAQsgBUEQaiQAQQQhAyAELQAPBEAgACAAIAAoAgBBDGsoAgBqKAIYIgMgASACIAMoAgAoAiARAwAiATYCBEEGQQAgASACRxshAwsgACAAKAIAQQxrKAIAaiADENUBIARB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AxsLPAAgAEEANgIIIABCADcCACAAIAEoAgA2AgAgACABKAIENgIEIAAgASgCCDYCCCABQQA2AgggAUIANwIACywBAX8gAEEANgIIIABCADcCACAAIAEoAgAiAiABKAIEIgEgASACaxDAAyAACwgAIABB/wFxC/wBAQN/IAAoAgQgACgCACIDa0ECdSICIAFJBEAjAEEgayIDJAACQCABIAJrIgIgACgCCCAAKAIEIgFrQQJ1TQRAIAAoAgQiASACQQJ0aiECA0AgASACRgRAIAAgAjYCBAUgAUEANgIAIAFBBGohAQwBCwsMAQsgA0EMaiAAIAEgACgCAGtBAnUgAmoQtgEgACgCBCAAKAIAa0ECdSAAEIcCIgQoAggiASACQQJ0aiECA0AgASACRwRAIAFBADYCACABQQRqIQEMAQsLIAQgAjYCCCAAIAQQhQIgBBCBAgsgA0EgaiQADwsgASACSQRAIAAgAyABQQJ0ajYCBAsLUgECf0HU3gEoAgAiASAAQQdqQXhxIgJqIQACQCACQQAgACABTRtFBEAgAD8AQRB0TQ0BIAAQGA0BC0GI6gFBMDYCAEF/DwtB1N4BIAA2AgAgAQt/AgF+A38CQCAAQoCAgIAQVARAIAAhAgwBCwNAIAFBAWsiASAAIABCCoAiAkIKfn2nQTByOgAAIABC/////58BViACIQANAAsLIAJQRQRAIAKnIQMDQCABQQFrIgEgAyADQQpuIgRBCmxrQTByOgAAIANBCUsgBCEDDQALCyABC78BAQN/IAAoAgQgACgCACIDayICIAFJBEAjAEEgayIDJAACQCABIAJrIgIgACgCCCAAKAIEIgFrTQRAIAAgAhCYAwwBCyACIANBDGogACABIAJqIAAoAgBrELQBIAAoAgQgACgCAGsgABDGASIEKAIIIgFqIQIDQCABIAJHBEAgAUEAOgAAIAFBAWohAQwBCwsgBCACNgIIIAAgBBDvASAEELoBCyADQSBqJAAPCyABIAJJBEAgACABIANqNgIECwt9AQN/AkACQCAAIgFBA3FFDQAgAS0AAEUEQEEADwsDQCABQQFqIgFBA3FFDQEgAS0AAA0ACwwBCwNAIAEiAkEEaiEBQYCChAggAigCACIDayADckGAgYKEeHFBgIGChHhGDQALA0AgAiIBQQFqIQIgAS0AAA0ACwsgASAA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BEBBCiEBIAAQXgwBCyAAEH5BAWshASAAKAIECyIDIAFGBEAgACABQQEgASABEPQBIAAQIxoMAQsgABAjGiAEDQAgACIBIANBAWoQUAwBCyAAKAIAIQEgACADQQFqNgIECyABIANqIgAgAkEPahBdIAJBADoADiAAQQFqIAJBDmoQXSACQRBqJAALoQIBA38jAEEgayIIJABB9////wciCSABQX9zaiACTwRAIAAQIyEKIAFB8////wNJBEAgCCABQQF0NgIcIAggASACajYCECAIQRBqIAhBHGoQoAEoAgAQnwFBAWohCQsgCEEcaiAIQRhqIAAQVSgCABC8ASAIQRBqIAkQngEgCCgCECECIAgoAhQaIAQEQCACIAogBBBNCyAGBEAgAiAEaiAHIAYQTQsgAyAEIAVqIglrIQcgAyAJRwRAIAIgBGogBmogBCAKaiAFaiAHEE0LIAFBCkcEQCAKEIsCCyAAIAI2AgAgACAIKAIUEFwgACAEIAZqIAdqIgA2AgQgCEEAOgAPIAAgAmogCEEPahBdIAhBHGoQuwEgCEEgaiQADwsQWwALCQAgAEEBEKgCCwoAIAAoAgAQHxoLCQAgACABEFUaCwcAIABBAkkLBABBBAsoAQF/IAAgACgCBEEBayIBNgIEIAFBf0YEQCAAIAAoAgAoAggRAgALC5UBAQN/IwBBEGsiBCQAIAQgATYCDCAEIAM2AgggBEEEaiAEQQxqEGMgBCgCCCEDIwBBEGsiASQAIAEgAzYCDCABIAM2AghBfyEFAkBBAEEAIAIgAxDRASIDQQBIDQAgACADQQFqIgMQNCIANgIAIABFDQAgACADIAIgASgCDBDRASEFCyABQRBqJAAQYiAEQRBqJAAgBQsPACAAIAAoAgAoAiQRAAALEQAgACABIAEoAgAoAiARAQALDgAgACABKAIANgIAIAALCABB/////wcLBQBB/wALOwAgACADNgIQIAAgAQR/IAEQUwVBAAsiAzYCACAAIAIgA2oiAjYCCCAAIAEgA2o2AgwgACACNgIEIAALYQEBfyMAQRBrIgIkACACIAA2AgwCQCAAIAFGDQADQCACIAFBBGsiATYCCCAAIAFPDQEgAigCDCACKAIIENcBIAIgAigCDEEEaiIANgIMIAIoAgghAQwACwALIAJBEGokAAs5AgF/AX4jAEEQayIEJAAgAykDACEFIAQgAykDCDcDCCAEIAU3AwAgACABIAIgBBDAASAEQRBqJAAL0AEBAn8gAkGAEHEEQCAAQSs6AAAgAEEBaiEACyACQYAIcQRAIABBIzoAACAAQQFqIQALIAJBhAJxIgNBhAJHBEAgAEGu1AA7AAAgAEECaiEACyACQYCAAXEhAgNAIAEtAAAiBARAIAAgBDoAACAAQQFqIQAgAUEBaiEBDAELCyAAAn8CQCADQYACRwRAIANBBEcNAUHGAEHmACACGwwCC0HFAEHlACACGwwBC0HBAEHhACACGyADQYQCRg0AGkHHAEHnACACGws6AAAgA0GEAkcLKwEBfyMAQRBrIgUkACAFIAQoAgA2AgAgACABIAIgAyAFEJYBIAVBEGokAAuqAQEBfwJAIANBgBBxRSACRXINACADQcoAcSIEQQhGIARBwABGcg0AIABBKzoAACAAQQFqIQALIANBgARxBEAgAEEjOgAAIABBAWohAAsDQCABLQAAIgQEQCAAIAQ6AAAgAEEBaiEAIAFBAWohAQwBCwsgAAJ/Qe8AIANBygBxIgFBwABGDQAaQdgAQfgAIANBgIABcRsgAUEIRg0AGkHkAEH1ACACGws6AAALDAAgABAjIAFBAnRqC5IEAQt/IwBBgAFrIgokACAKIAE2AnwgAiADELUCIQggCkHjADYCECAKQQhqQQAgCkEQaiIJEDYhDwJAAkACQCAIQeUATwRAIAgQNCIJRQ0BIA8gCRA8CyAJIQcgAiEBA0AgASADRgRAA0AgACAKQfwAaiIBECtBASAIGwRAIAAgARArBEAgBSAFKAIAQQJyNgIACwNAIAIgA0YNBiAJLQAAQQJGDQcgCUEBaiEJIAJBDGohAgwACwALIAAQNyEOIAZFBEAgBCAOEEEhDgsgDUEBaiEMQQAhECAJIQcgAiEBA0AgASADRgRAIAwhDSAQRQ0CIAAQPhogCSEHIAIhASAIIAtqQQJJDQIDQCABIANGBEAMBAUCQCAHLQAAQQJHDQAgARAfIA1GDQAgB0EAOgAAIAtBAWshCwsgB0EBaiEHIAFBDGohAQwBCwALAAUCQCAHLQAAQQFHDQAgASANEMwBKAIAIRECQCAGBH8gEQUgBCAREEELIA5GBEBBASEQIAEQHyAMRw0CIAdBAjoAACALQQFqIQsMAQsgB0EAOgAACyAIQQFrIQgLIAdBAWohByABQQxqIQEMAQsACwALAAUgB0ECQQEgARBaIgwbOgAAIAdBAWohByABQQxqIQEgCyAMaiELIAggDGshCAwBCwALAAsQPQALIAUgBSgCAEEEcjYCAAsgDxA1IApBgAFqJAAgAgsRACAAIAEgACgCACgCDBEEAAuTBAELfyMAQYABayIKJAAgCiABNgJ8IAIgAxC1AiEIIApB4wA2AhAgCkEIakEAIApBEGoiCRA2IQ8CQAJAAkAgCEHlAE8EQCAIEDQiCUUNASAPIAkQPAsgCSEHIAIhAQNAIAEgA0YEQANAIAAgCkH8AGoiARAsQQEgCBsEQCAAIAEQLARAIAUgBSgCAEECcjYCAAsDQCACIANGDQYgCS0AAEECRg0HIAlBAWohCSACQQxqIQIMAAsACyAAEDghDiAGRQRAIAQgDhDOASEOCyANQQFqIQxBACEQIAkhByACIQEDQCABIANGBEAgDCENIBBFDQIgABA/GiAJIQcgAiEBIAggC2pBAkkNAgNAIAEgA0YEQAwEBQJAIActAABBAkcNACABEB8gDUYNACAHQQA6AAAgC0EBayELCyAHQQFqIQcgAUEMaiEBDAELAAsABQJAIActAABBAUcNACABIA0QIiwAACERAkAgBgR/IBEFIAQgERDOAQsgDkYEQEEBIRAgARAfIAxHDQIgB0ECOgAAIAtBAWohCwwBCyAHQQA6AAALIAhBAWshCAsgB0EBaiEHIAFBDGohAQwBCwALAAsABSAHQQJBASABEFoiDBs6AAAgB0EBaiEHIAFBDGohASALIAxqIQsgCCAMayEIDAELAAsACxA9AAsgBSAFKAIAQQRyNgIACyAPEDUgCkGAAWokACACC0oBAn8CQCAALQAAIgJFIAIgAS0AACIDR3INAANAIAEtAAEhAyAALQABIgJFDQEgAUEBaiEBIABBAWohACACIANGDQALCyACIANrC4QBAQJ/IwBBoAFrIgQkACAEIAAgBEGeAWogARsiADYClAEgBCABQQFrIgVBACABIAVPGzYCmAEgBEEAQZAB/AsAIARBfzYCTCAEQeIANgIkIARBfzYCUCAEIARBnwFqNgIsIAQgBEGUAWo2AlQgAEEAOgAAIAQgAiADEM0DIARBoAFqJAALuwIBBH8gA0H87QEgAxsiBSgCACEDAkAC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IBAtIAAoAiQQLSAAKAIwEC0gACgCPBAtCyAACwcAIAEgAGsLDABBARDWARogABAtCwkAIAAQsQEQLQsTACAAIAEgAiAAKAIAKAIwEQMACwkAIAAQ2AEQLQsMACAAQQRqENoBIAALDAAgAEEIahDaASAACygBAn8jAEEQayICJAAgASgCACAAKAIASCEDIAJBEGokACABIAAgAxsLEAAgACABNwMIIABCADcDAAsCAAsUACAAQZj1ADYCACAAQQRqECUgAAvyAwICfgV/IwBBIGsiBSQAIAFC////////P4MhAgJ+IAFCMIhC//8BgyIDpyIEQYH4AGtB/Q9NBEAgAkIEhiAAQjyIhCECIARBgPgAa60hAwJAIABC//////////8PgyIAQoGAgICAgICACFoEQCACQgF8IQIMAQsgAEKAgICAgICAgAhSDQAgAkIBgyACfCECC0IAIAIgAkL/////////B1YiBBshACAErSADfAwBCyAAIAKEUCADQv//AVJyRQRAIAJCBIYgAEI8iIRCgICAgICAgASEIQBC/w8MAQsgBEH+hwFLBEBCACEAQv8PDAELQYD4AEGB+AAgA1AiBxsiCCAEayIGQfAASgRAQgAhAEIADAELIAVBEGogACACIAJCgICAgICAwACEIAcbIgJBgAEgBmsQRCAFIAAgAiAGEIoBIAUpAwhCBIYgBSkDACICQjyIhCEAAkAgBCAIRyAFKQMQIAUpAxiEQgBSca0gAkL//////////w+DhCICQoGAgICAgICACFoEQCAAQgF8IQAMAQsgAkKAgICAgICAgAhSDQAgAEIBgyAAfCEACyAAQoCAgICAgIAIhSAAIABC/////////wdWIgQbIQAgBK0LIQIgBUEgaiQAIAFCgICAgICAgICAf4MgAkI0hoQgAIS/C4kCAAJAIAAEfyABQf8ATQ0BAkBB3OEBKAIAKAIARQRAIAFBgH9xQYC/A0YNAwwBCyABQf8PTQRAIAAgAUE/cUGAAXI6AAEgACABQQZ2QcABcjoAAEECDwsgAUGAQHFBgMADRyABQYCwA09xRQRAIAAgAUE/cUGAAXI6AAIgACABQQx2QeABcjoAACAAIAFBBnZBP3FBgAFyOgABQQMPCyABQYCABGtB//8/TQRAIAAgAUE/cUGAAXI6AAMgACABQRJ2QfABcjoAACAA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AXI2AgQgCSAGIAkoAgBBAXFyQQJyNgIAIAEgBmoiAiACKAIEQQFyNgIEIAEgBhDbAQsCQCAAKAIEIgJBA3FFDQAgAkF4cSIBIAVBEGpNDQAgACAFIAJBAXFyQQJyNgIEIAAgBWoiBCABIAVrIgJBA3I2AgQgACABaiIBIAEoAgRBAXI2AgQgBCACENsBCyAAQQhqCwsiAEUNARogCCAANgIMQQAhAQsgAQshAEEAIAgoAgwgABshAQsgCEEQaiQAIAENAEHk/gEoAgAiAEUNACAAEQwADAELCyABRQRAEOsBCyABCwoAIAEgAGtBDG0LCQAgABAuNgIACyMBAn8gACEBA0AgASICQQRqIQEgAigCAA0ACyACIABrQQJ1Cy8BAX8jAEEQayIDJAACQCAAIAFGBEAgAEEAOgB4DAELIAEgAhCpAQsgA0EQaiQACxAAIAAoAgggACgCAGtBAnULCQAgAEEANgIAC0kBAX8jAEEQayIDJAACQAJAIAJBHksNACABLQB4QQFxDQAgAUEBOgB4DAELIAIQwQIhAQsgA0EQaiQAIAAgAjYCBCAAIAE2AgALOgECfyMAQRBrIgAkACAAQf////8DNgIMIABB/////wc2AgggAEEMaiAAQQhqELUDKAIAIABBEGokAAs0AQF/IwBBEGsiAyQAIAMgARBzNgIMIAMgAhBzNgIIIAAgA0EMaiADQQhqEGYgA0EQaiQAC04BAX8jAEEQayIDJAAgAyABNgIIIAMgADYCDCADIAI2AgRBACEBIANBBGoiACADQQxqENMBRQRAIAAgA0EIahDTASEBCyADQRBqJAAgAQswAQF/IwBBEGsiAyQAIAMgATYCDCADIAI2AgggACADQQxqIANBCGoQZiADQRBqJAALMwEBfyMAQRBrIgMkACAAEB8aIAAgAhCDASADQQA6AA8gASACaiADQQ9qEF0gA0EQaiQACzEAIABB/////wNLBEAQqgIACwJ/IABBAnQhAEEEENYBBEAgAEEEELQCDAELIAAQUwsLCQAgABDtARAtCxUAIABB8KoBNgIAIABBEGoQIBogAAsVACAAQciqATYCACAAQQxqECAaIAALgAMBBH8gAiEAA0ACQCAEIAdNIAAgA09yDQAgACwAACIBQf8BcSEFAn9BASABQQBODQAaIAFBQkkNASABQV9NBEAgAyAA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ZEYNAEEAIQAgC0EANgIQIBEgDygCACALKAJkIAtBEGoQQyALKAIQBEAgBSAFKAIAQQRyNgIADAELQQEhAAsgEBAgGiANECAaIA4QIBogDBAgGiARECAaIA8QNQwDCyACIQELIANBAWohAwwACwALIAtBkARqJAAgAAsMACAAQQFBLRD9AhoLCwAgAEEBQS0QsAILHAEBfyAALQAAIQIgACABLQAAOgAAIAEgAjoAAAtlAQF/IwBBEGsiBiQAIAZBADoADyAGIAU6AA4gBiAEOgANIAZBJToADCAFBEAgBkENaiAGQQ5qEPMCCyACIAEgASACKAIAEIoCIAZBDGogAyAAKAIAEJ4DIAFqNgIAIAZBEGokAAtBACABIAIgAyAEQQQQZyEBIAMtAABBBHFFBEAgACABQdAPaiABQewOaiABIAFB5ABJGyABQcUASBtB7A5rNgIACwtAACACIAMgAEEIaiAAKAIIKAIEEQAAIgAgAEGgAmogBSAEQQAQzQEgAGsiAEGfAkwEQCABIABBDG1BDG82AgALC0AAIAIgAyAAQQhqIAAoAggoAgARAAAiACAAQagBaiAFIARBABDNASAAayIAQacBTARAIAEgAEEMbUEHbzYCAAsLQQAgASACIAMgBEEEEGghASADLQAAQQRxRQRAIAAgAUHQD2ogAUHsDmogASABQeQASRsgAUHFAEgbQewOazYCAAsLQAAgAiADIABBCGogACgCCCgCBBEAACIAIABBoAJqIAUgBEEAEM8BIABrIgBBnwJMBEAgASAAQQxtQQxvNgIACwtAACACIAMgAEEIaiAAKAIIKAIAEQAAIgAgAEGoAWogBSAEQQAQzwEgAGsiAEGnAUwEQCABIABBDG1BB282AgALCxgBAX9BDBBTIgBBADYCCCAAQgA3AgAgAAsEAEECC8oBAQR/IwBBEGsiAyQAAkAgAUH3////A00EQAJAIAEQvQEEQCAAIAEQUCAAIQQMAQsgA0EIaiABEJABQQFqEI8BIAMoAgwaIAAgAygCCCIENgIAIAAgAygCDBBcIAAgATYCBAsjAEEQayIFJAAgBSACNgIMIAQhBiABIQIDQCACBEAgBiAFKAIMNgIAIAJBAWshAiAGQQRqIQYMAQsLIAVBEGokACADQQA2AgQgBCABQQJ0aiADQQRqEFYgA0EQaiQADAELEFsA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hoRCAEKAgICAgIDAwz8QLyAFKQNIIQIgBSkDQCEEDAELIAlC////////P4MgBiAHcq1CMIaEIQILIAAgBDcDACAAIAI3AwggBUGAAWokAAuIEAIFfw9+IwBB0AJrIgUkACAEQv///////z+DIQsgAkL///////8/gyEKIAIgBIVCgICAgICAgICAf4MhDCAEQjCIp0H//wFxIQcCQAJAIAJCMIinQf//AXEiCEH//wFrQYKAfk8EQCAHQf//AWtBgYB+Sw0BCyABUCACQv///////////wCDIg5CgICAgICAwP//AFQgDkKAgICAgIDA//8AURtFBEAgAkKAgICAgIAghCEMDAILIANQIARC////////////AIMiAkKAgICAgIDA//8AVCACQoCAgICAgMD//wBRG0UEQCAEQoCAgICAgCCEIQwgAyEBDAILIAEgDkKAgICAgIDA//8AhYRQBEAgAyACQoCAgICAgMD//wCFhFAEQEIAIQFCgICAgICA4P//ACEMDAMLIAxCgICAgICAwP//AIQhDEIAIQEMAgsgAyACQoCAgICAgMD//wCFhFAEQEIAIQEMAgsgASAOhFAEQEKAgICAgIDg//8AIAwgAiADhFAbIQxCACEBDAILIAIgA4RQBEAgDEKAgICAgIDA//8AhCEMQgAhAQwCCyAOQv///////z9YBEAgBUHAAmogASAKIAEgCiAKUCIGG3lCwABCACAGG3ynIgZBD2sQREEQIAZrIQYgBSkDyAIhCiAFKQPAAiEBCyACQv///////z9WDQAgBUGwAmogAyALIAMgCyALUCIJG3lCwABCACAJG3ynIglBD2sQRCAGIAlqQRBrIQYgBSkDuAIhCyAFKQOwAiEDCyAFQaACaiALQoCAgICAgMAAhCISQg+GIANCMYiEIgJCAEKAgICAsOa8gvUAIAJ9IgRCABBAIAVBkAJqQgAgBSkDqAJ9QgAgBEIAEEAgBUGAAmogBSkDmAJCAYYgBSkDkAJCP4iEIgRCACACQgAQQCAFQfABaiAEQgBCACAFKQOIAn1CABBAIAVB4AFqIAUpA/gBQgGGIAUpA/ABQj+IhCIEQgAgAkIAEEAgBUHQAWogBEIAQgAgBSkD6AF9QgAQQCAFQcABaiAFKQPYAUIBhiAFKQPQAUI/iIQiBEIAIAJCABBAIAVBsAFqIARCAEIAIAUpA8gBfUIAEEAgBUGgAWogAkIAIAUpA7gBQgGGIAUpA7ABQj+IhEIBfSICQgAQQCAFQZABaiADQg+GQgAgAkIAEEAgBUHwAGogAkIAQgAgBSkDqAEgBSkDoAEiDiAFKQOYAXwiBCAOVK18IARCAVatfH1CABBAIAVBgAFqQgEgBH1CACACQgAQQCAGIAggB2tqIghB//8AaiEGAn4gBSkDcCITQgGGIg0gBSkDiAEiD0IBhiAFKQOAAUI/iIR8IhBC5+wAfSIUQiCIIgIgCkKAgICAgIDAAIQiFUIBhiIWQiCIIgR+IhEgAUIBhiIOQiCIIgsgECAUVq0gDSAQVq0gBSkDeEIBhiATQj+IhCAPQj+IfHx8QgF9IhNCIIgiEH58Ig0gEVStIA0gDSATQv////8PgyITIAFCP4giFyAKQgGGhEL/////D4MiCn58Ig1WrXwgBCAQfnwgBCATfiIRIAogEH58Ig8gEVStQiCGIA9CIIiEfCANIA9CIIZ8Ig8gDVStfCAPIA8gFEL/////D4MiFCAKfiINIAIgC358IhEgDVStIBEgESATIA5C/v///w+DIg1+fCIRVq18fCIPVq18IA8gBCAUfiIYIA0gEH58IgQgAiAKfnwiCiALIBN+fCIQQiCIIAogEFatIAQgGFStIAQgClatfHxCIIaEfCIEIA9UrXwgBCAEIBEgAiANfiIKIAsgFH58IgJCIIggAiAKVK1CIIaEfCIKIBFUrSAKIAogEEIghnwiClatfHwiBFatfCAEIAQgCiACQiCGIgIgDSAUfnwgAlStQn+FIgJWIAIgClJxrXwiBFatfCICQv////////8AWARAIBYgF4QhFSAFQdAAaiAEIAJCgICAgICAwABUIgetIguGIgogAiALhiAEQgGIIAdBP3OtiIQiBCADIBIQQCAIQf7/AGogBiAHG0EBayEGIAFCMYYgBSkDWH0gBSkDUCIBQgBSrX0hC0IAIAF9DAELIAVB4ABqIAJCP4YgBEIBiIQiCiACQgGIIgQgAyASEEAgAUIwhiAFKQNofSAFKQNgIgJCAFKtfSELIAEhDkIAIAJ9CyECIAZB//8BTgRAIAxCgICAgICAwP//AIQhDEIAIQEMAQsCfiAGQQBKBEAgC0IBhiACQj+IhCEBIARC////////P4MgBq1CMIaEIQsgAkIBhgwBCyAGQY9/TARAQgAhAQwCCyAFQUBrIAogBEEBIAZrEIoBIAVBMGogDiAVIAZB8ABqEEQgBUEgaiADIBIgBSkDQCIKIAUpA0giCxBAIAUpAzggBSkDKEIBhiAFKQMgIgFCP4iEfSAFKQMwIgIgAUIBhiIEVK19IQEgAiAEfQshAiAFQRBqIAMgEkIDQgAQQCAFIAMgEkIFQgAQQCALIAogAyAKQgGDIgMgAnwiAlQgASACIANUrXwiASASViABIBJRG618IgMgClStfCIEIAMgAyAEQoCAgICAgMD//wBUIAIgBSkDEFYgASAFKQMYIgRWIAEgBFEbca18IgNWrXwiBCADIARCgICAgICAwP//AFQgAiAFKQMAViABIAUpAwgiAlYgASACURtxrXwiASADVK18IAyEIQwLIAAgATcDACAAIAw3AwggBUHQAmokAAu/AgEBfyMAQdAAayIEJAACQCADQYCAAU4EQCAEQSBqIAEgAkIAQoCAgICAgID//wAQLyAEKQMoIQIgBCkDICEBIANB//8BSQRAIANB//8AayEDDAILIARBEGogASACQgBCgICAgICAgP//ABAvQf3/AiADIANB/f8CTxtB/v8BayEDIAQpAxghAiAEKQMQIQEMAQsgA0GBgH9KDQAgBEFAayABIAJCAEKAgICAgICAORAvIAQpA0ghAiAEKQNAIQEgA0H0gH5LBEAgA0GN/wBqIQMMAQsgBEEwaiABIAJCAEKAgICAgICAORAvQeiBfSADIANB6IF9TRtBmv4BaiEDIAQpAzghAiAEKQMwIQELIAQgASACQgAgA0H//wBqrUIwhhAvIAAgBCkDCDcDCCAAIAQpAwA3AwAgBEHQAGokAAs8ACAAIAE3AwAgACACQv///////z+DIAJCgICAgICAwP//AINCMIinIANCMIinQYCAAnFyrUIwhoQ3AwgLwAECAX8CfkF/IQMCQCAAQgBSIAFC////////////AIMiBEKAgICAgIDA//8AViAEQoCAgICAgMD//wBRGw0AIAJC////////////AIMiBUKAgICAgIDA//8AViAFQoCAgICAgMD//wBScQ0AIAAgBCAFhIRQBEBBAA8LIAEgAoNCAFkEQCABIAJSIAEgAlNxDQEgACABIAKFhEIAUg8LIABCAFIgASACVSABIAJRGw0AIAAg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EKYCCyEAIAEQTAR/QZiEASgCACABQf8BcUECdGooAgAFIAELwAsJACAAENACEC0LOwADQCABIAJGRQRAIAMhACAEIAEoAgAQTAR/IAEoAgAFIAALOgAAIARBAWohBCABQQRqIQEMAQsLIAELDAAgASACIAEQTBvACyoAA0AgASACRkUEQCADIAEsAAA2AgAgA0EEaiEDIAFBAWohAQwBCwsgAQsPACAAIAEgAkGgkAEQpwILHAAgARBMBH9BoJABKAIAIAFBAnRqKAIABSABCwsPACAAIAEgAkGYhAEQpwILHAAgARBMBH9BmIQBKAIAIAFBAnRqKAIABSABCwsQACAABEAgABDHAwsgABAtCzoAA0ACQCACIANGDQAgAigCABBMRQ0AIAIoAgBBAnRBkKIBaigCACABcUUNACACQQRqIQIMAQsLIAILOQADQAJAIAIgA0YNACACKAIAEEwEQCACKAIAQQJ0QZCiAWooAgAgAXENAQsgAkEEaiECDAELCyACC0YAA0AgASACRkUEQEEAIQAgAyABKAIAEEwEfyABKAIAQQJ0QZCiAWooAgAFQQALNgIAIANBBGohAyABQQRqIQEMAQsLIAELIwBBACEAIAIQTAR/IAJBAnRBkKIBaigCACABcUEARwVBAAsLDwAgACAAKAIAKAIEEQIACwkAIAAQ1gIQLQsVAQF/QdQAEFMiAEEAQdQA/AsAIAALFAAgACgCACABaiACLQAAOgAAQQELrgEAAkAgBRBHRQRAIAAgBSkCADcCACAAIAUoAgg2AgggABBeGgwBCyAFKAIAIQQgBSgCBCECIwBBEGsiAyQAAkACQAJAIAIQvQEEQCAAIgEgAhBQDAELIAJB9////wNLDQEgA0EIaiACEJABQQFqEI8BIAMoAgwaIAAgAygCCCIBNgIAIAAgAygCDBBcIAAgAjYCBAsgASAEIAJBAWoQZSADQRBqJAAMAQsQWwALCwsJACAAIAUQ5AELhAMBCH8jAEHgA2siACQAIABB3ANqIgYgAxAnIAYQSCEKIAUQHwRAIAVBABDMASgCACAKQS0QS0YhCwsgAiALIABB3ANqIABB2ANqIABB1ANqIABB0ANqIABBxANqECQiDCAAQbgDahAkIgYgAEGsA2oQJCIHIABBqANqEN8CIABB4wA2AhAgAEEIakEAIABBEGoiAhA2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KAK8ASAEEI8DOQMAIABBzAFqIABBEGogACgCDCAEEEMgAEHcAmogAEHYAmoQKwRAIAQgBCgCAEECcjYCAAsgACgC3AIgARAgGiAAQcwBahAgGiAAQeACaiQADAMLQQEhAwsgAEHcAmoQPhoMAAsACwvKBAEDfwJ/IwBB4AJrIgAkACAAIAI2AtgCIAAgATYC3AIgAEHMAWogAyAAQeABaiAAQdwBaiAAQdgBahD7ASAAQcABahAkIgEgARAoECEgACABQQAQIiICNgK8ASAAIABBEGo2AgwgAEEANgIIIABBAToAByAAQcUAOgAGQQAhAwNAAkACQAJAIABB3AJqIABB2AJqECsNACAAKAK8ASABEB8gAmpGBEAgARAfIQYgASABEB9BAXQQISABIAEQKBAhIAAgBiABQQAQIiICajYCvAELIABB3AJqEDcgAEEHaiAAQQZqIAIgAEG8AWogACgC3AEgACgC2AEgAEHMAWogAEEQaiAAQQxqIABBCGogAEHgAWoQ+gENACADDQFBACEDIAAoArwBIAJrIgdBAEwNAgJAAkAgAi0AACIGQStrIggOAwEAAQALIAZBLkYNAkEBIQMgBkEwa0H/AXFBCkkNAwwBCyAHQQFGDQICQCAIDgMAAwADCyACLQABIgZBLkYNAUEBIQMgBkEwa0H/AXFBCU0NAgsCQCAAQcwBahAfRQ0AIAAtAAdBAXFFDQAgACgCDCIDIABBEGprQZ8BSg0AIAAgA0EEajYCDCADIAAoAgg2AgALIAUgAiAAKAK8ASAEEJEDOAIAIABBzAFqIABBEGogACgCDCAEEEMgAEHcAmogAEHYAmoQKwRAIAQgBCgCAEECcjYCAAsgACgC3AIgARAgGiAAQcwBahAgGiAAQeACaiQADAMLQQEhAwsgAEHcAmoQPhoMAAsACwuWAwECfyMAQdACayIAJAAgACACNgLIAiAAIAE2AswCIAMQaiEGIAMgAEHQAWoQrgEhByAAQcQBaiADIABBxAJqEK0BIABBuAFqECQiASABECgQISAAIAFBABAiIgI2ArQBIAAgAEEQajYCDCAAQQA2AggDQAJAIABBzAJqIABByAJqECsNACAAKAK0ASABEB8gAmpGBEAgARAfIQMgASABEB9BAXQQISABIAEQKBAhIAAgAyABQQAQIiICajYCtAELIABBzAJqIgMQNyAGIAIgAEG0AWogAEEIaiAAKALEAiAAQcQBaiAAQRBqIABBDGogBxCYAQ0AIAMQPhoMAQsLAkAgAEHEAWoQH0UNACAAKAIMIgMgAEEQamtBnwFKDQAgACADQQRqNgIMIAMgACgCCDYCAAsgBSACIAAoArQBIAQgBhCSAzcDACAAQcQBaiAAQRBqIAAoAgwgBBBDIABBzAJqIABByAJqECsEQCAEIAQoAgBBAnI2AgALIAAoAswCIAEQIBogAEHEAWoQIBogAEHQAmokAAuWAwECfyMAQdACayIAJAAgACACNgLIAiAAIAE2AswCIAMQaiEGIAMgAEHQAWoQrgEhByAAQcQBaiADIABBxAJqEK0BIABBuAFqECQiASABECgQISAAIAFBABAiIgI2ArQBIAAgAEEQajYCDCAAQQA2AggDQAJAIABBzAJqIABByAJqECsNACAAKAK0ASABEB8gAmpGBEAgARAfIQMgASABEB9BAXQQISABIAEQKBAhIAAgAyABQQAQIiICajYCtAELIABBzAJqIgMQNyAGIAIgAEG0AWogAEEIaiAAKALEAiAAQcQBaiAAQRBqIABBDGogBxCYAQ0AIAMQPhoMAQsLAkAgAEHEAWoQH0UNACAAKAIMIgMgAEEQamtBnwFKDQAgACADQQRqNgIMIAMgACgCCDYCAAsgBSACIAAoArQBIAQgBhCVAzsBACAAQcQBaiAAQRBqIAAoAgwgBBBDIABBzAJqIABByAJqECsEQCAEIAQoAgBBAnI2AgALIAAoAswCIAEQIBogAEHEAWoQIBogAEHQAmokAAuWAwECfyMAQdACayIAJAAgACACNgLIAiAAIAE2AswCIAMQaiEGIAMgAEHQAWoQrgEhByAAQcQBaiADIABBxAJqEK0BIABBuAFqECQiASABECgQISAAIAFBABAiIgI2ArQBIAAgAEEQajYCDCAAQQA2AggDQAJAIABBzAJqIABByAJqECsNACAAKAK0ASABEB8gAmpGBEAgARAfIQMgASABEB9BAXQQISABIAEQKBAhIAAgAyABQQAQIiICajYCtAELIABBzAJqIgMQNyAGIAIgAEG0AWogAEEIaiAAKALEAiAAQcQBaiAAQRBqIABBDGogBxCYAQ0AIAMQPhoMAQsLAkAgAEHEAWoQH0UNACAAKAIMIgMgAEEQamtB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DCECDAYLIANBIHIhAyABQQRqIQIgBEEEayEEIAEtAAMgCHQgB2ohBwsCQCAFQQRxRQ0AIAcgBigCIEYNACAKQd4ONgIYIAZB0f4ANgIEIAIhASAGKAIEIQUMAQsLIAIhAUEAIQdBACEDCyAGQdD+ADYCBAtBASECDAELQQAhBCAMIQILIAogDzYCECAKIBA2AgwgCiAENgIEIAogATYCACAGIAM2AkAgBiAHNgI8AkACQCAGKAIsRQRAIA8gFUYNASAGKAIEQdD+AEsNAQsCfyAVIA9rIQMCQAJAIAooAhwiASgCOCIMRQRAQQEhBSABIAooAihBASABKAIodEEBIAooAiARAwAiDDYCOCAMRQ0BCyABKAIsIgRFBEAgAUIANwIwIAFBASABKAIodCIENgIsCyADIARPBEAgBARAIAwgECAEayAE/AoAAAsgAUEANgI0DAILIAQgASgCNCIIayIFIAMgAyAFSxsiBARAIAggDGogECADayAE/AoAAAsgAyAFSwRAIAMgBGsiAwRAIAEoAjggECADayAD/AoAAAsgASADNgI0DAILQQAhBSABIAEoAjQgBGoiA0EAIAMgASgCLCIMRxs2AjQgDCABKAIwIgNNDQAgASADIARqNgIwCyAFDAELIAEgASgCLDYCMEEACw0BIAooAhAhDyAKKAIEIQQLIAogCigCCCAkIARrajYCCCAKIBUgD2siASAKKAIUajYCFCAGIAYoAiAgAWo2AiAgBi0ADEEEcUUgDyAVRnJFBEAgCigCDCABayEDIAYoAhwhBSAGAn8gBigCFARAIAUgAyABEFEMAQsgBSADIAEQswELIgE2AhwgCiABNgIwCyAKIAYoAkBBwABBACAGKAIIG2pBgAFBACAGKAIEIgFBv/4ARhtqQYACQYACQQAgAUHC/gBGGyABQcf+AEYbajYCLCACQXsgAhsgAiAPIBVGGyACIAQgJEYbIRwMAgsgBkHS/gA2AgQLQXwhHAsgF0EQaiQAIBxBAUsNASATQagBaiEBIBMoAqwBIQMgGigCACEJIBooAgQgEygCFGshDCMAQSBrIggkAAJAIAwgCWsiBUEATA0AIAEoAgggASgCBCICayAFTgRAIAIgA2siBCAFSARAIAwgBCAJaiIHayILRSAHIAxGckUEQCACIAcgC/wKAAALIAEgAiALajYCBCAE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eQAtKyAgIDBYMHgALTBYKzBYIDBYLTB4KzB4IDB4AE5vdgBUaHUAQXVndXN0AHVuc2lnbmVkIHNob3J0AHVuc2lnbmVkIGludABpbnZhbGlkIGxpdGVyYWwvbGVuZ3RocyBzZXQAaW52YWxpZCBjb2RlIGxlbmd0aHMgc2V0AHVua25vd24gaGVhZGVyIGZsYWdzIHNldABpbnZhbGlkIGRpc3RhbmNlcyBzZXQAZ2V0AE9jdABmbG9hdABpbnZhbGlkIGJpdCBsZW5ndGggcmVwZWF0AFNhdABudW1Qb2ludHMAY29sb3JzAFVucGFja09wdGlvbnMAcG9zaXRpb25zAHJvdGF0aW9ucwB0b28gbWFueSBsZW5ndGggb3IgZGlzdGFuY2Ugc3ltYm9scwBpbnZhbGlkIHN0b3JlZCBibG9jayBsZW5ndGhzAHNjYWxlcwBhbHBoYXMAW1NQWjogRVJST1JdIENoZWNrIGZhaWxlZDogJXM6JWQ6ICVzAHZmMzJfcHRyAEFwcgB2ZWN0b3IAbW9uZXlfZ2V0IGVycm9yAFtTUFogRVJST1JdIGRlc2VyaWFsaXplUGFja2VkR2F1c3NpYW5zOiByZWFkIGVycm9yAE9jdG9iZXIATm92ZW1iZXIAU2VwdGVtYmVyAERlY2VtYmVyAHVuc2lnbmVkIGNoYXIAaW9zX2Jhc2U6OmNsZWFyAE1hcgAvZW1zZGsvZW1zY3JpcHRlbi9zeXN0ZW0vbGliL2xpYmN4eGFiaS9zcmMvcHJpdmF0ZV90eXBlaW5mby5jcHAAU2VwACVJOiVNOiVTICVwAFN1bgBKdW4ATW9uAG5hbgBKYW4AY29vcmRpbmF0ZVN5c3RlbQBDb29yZGluYXRlU3lzdGVtAEp1bABib29sAGxsAEFwcmlsAGludmFsaWQgY29kZSAtLSBtaXNzaW5nIGVuZC1vZi1ibG9jawBpbmNvcnJlY3QgaGVhZGVyIGNoZWNrAGluY29ycmVjdCBsZW5ndGggY2hlY2sAaW5jb3JyZWN0IGRhdGEgY2hlY2sAcHVzaF9iYWNrAGludmFsaWQgZGlzdGFuY2UgdG9vIGZhciBiYWNrAEZyaQBzaABoZWFkZXIgY3JjIG1pc21hdGNoAE1hcmNoAEF1ZwB1bnNpZ25lZCBsb25nIGxvbmcAdW5zaWduZWQgbG9uZwBzdGQ6OndzdHJpbmcAYmFzaWNfc3RyaW5nAHN0ZDo6c3RyaW5nAHN0ZDo6dTE2c3RyaW5nAHN0ZDo6dTMyc3RyaW5nAGluZgAlLjBMZgAlTGYAcmVzaXplAGludmFsaWQgd2luZG93IHNpemUAdHJ1ZQBUdWUAZmFsc2UAaW52YWxpZCBibG9jayB0eXBlAEp1bmUAZG91YmxlAHNoRGVncmVlAGJhZF9hcnJheV9uZXdfbGVuZ3RoIHdhcyB0aHJvd24gaW4gLWZuby1leGNlcHRpb25zIG1vZGUAaW52YWxpZCBsaXRlcmFsL2xlbmd0aCBjb2RlAGludmFsaWQgZGlzdGFuY2UgY29kZQBSYXdHYXVzc2lhbkNsb3VkAHVua25vd24gY29tcHJlc3Npb24gbWV0aG9kAFtTUFogRVJST1JdIGRlc2VyaWFsaXplUGFja2VkR2F1c3NpYW5zOiBoZWFkZXIgbm90IGZvdW5kACUwKmxsZAAlKmxsZAArJWxsZAAlKy40bGQAdm9pZABsb2NhbGUgbm90IHN1cHBvcnRlZABhbnRpYWxpYXNlZABXZWQAJVktJW0tJWQAW1NQWiBFUlJPUl0gZGVzZXJpYWxpemVQYWNrZWRHYXVzc2lhbnM6IFRvbyBtYW55IHBvaW50czogJWQAW1NQWiBFUlJPUl0gZGVzZXJpYWxpemVQYWNrZWRHYXVzc2lhbnM6IFVuc3VwcG9ydGVkIFNIIGRlZ3JlZTogJWQAW1NQWiBFUlJPUl0gZGVzZXJpYWxpemVQYWNrZWRHYXVzc2lhbnM6IHZlcnNpb24gbm90IHN1cHBvcnRlZDogJWQARGVjAC4vc3B6L3NyYy9jYy9sb2FkLXNwei5jYwBGZWIAJWEgJWIgJWQgJUg6JU06JVMgJVkAUE9TSVgAVmVjdG9yVUludDhUACVIOiVNOiVTAE5BTgBQTQBBTQAlSDolTQBMQ19BTEwAQVNDSUkATEFORwBSVUYATFVGAElORgBSREYATERGAFVOU1BFQ0lGSUVEAEMAUlVCAExVQgBSREIATERCAGNhdGNoaW5nIGEgY2xhc3Mgd2l0aG91dCBhbiBvYmplY3Q/AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHNob3J0PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1bnNpZ25lZCBzaG9ydD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8aW50PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1bnNpZ25lZCBpbnQ+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PGZsb2F0PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1aW50OF90PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxpbnQ4X3Q+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHVpbnQxNl90PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxpbnQxNl90PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1aW50NjRfdD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8aW50NjRfdD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8dWludDMyX3Q+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PGludDMyX3Q+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PGNoYXI+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHVuc2lnbmVkIGNoYXI+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHNpZ25lZCBjaGFyPgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxsb25nPgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1bnNpZ25lZCBsb25nPgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxkb3VibGU+ADAxMjM0NTY3ODkAQy5VVEYtOABWZWN0b3JGbG9hdDMyADEuMy4xAC4ALQAocGFja2VkLmFscGhhcy5zaXplKCkpID09IChudW1Qb2ludHMpAChudWxsKQAocGFja2VkLmNvbG9ycy5zaXplKCkpID09IChudW1Qb2ludHMgKiAzKQAocGFja2VkLnNjYWxlcy5zaXplKCkpID09IChudW1Qb2ludHMgKiAzKQAocGFja2VkLnNoLnNpemUoKSkgPT0gKG51bVBvaW50cyAqIHNoRGltICogMykAKHBhY2tlZC5yb3RhdGlvbnMuc2l6ZSgpKSA9PSAobnVtUG9pbnRzICogKHBhY2tlZC51c2VzUXVhdGVybmlvblNtYWxsZXN0VGhyZWUgPyA0IDogMykpAChwYWNrZWQucG9zaXRpb25zLnNpemUoKSkgPT0gKG51bVBvaW50cyAqIDMgKiAodXNlc0Zsb2F0MTYgPyAyIDogMykpACUAbGVuZ3RoX2Vycm9yIHdhcyB0aHJvd24gaW4gLWZuby1leGNlcHRpb25zIG1vZGUgd2l0aCBtZXNzYWdlICIlcyIAUHVyZSB2aXJ0dWFsIGZ1bmN0aW9uIGNhbGxlZCEAW1NQWjogRVJST1JdIFVuc3VwcG9ydGVkIFNIIGRlZ3JlZTogJWQKAAkAAAAAgD8AAIA/AACAPwAAgD8AAIA/AACAPwAAgD8AAIA/AACAPwAAgD8AAIA/AACAPwAAgD8AAIA/AACAPwBBkCALthMgEAAA9GwAAPRsAABAEAAAqG0AACgQAABOM3NwejEzR2F1c3NpYW5DbG91ZEUAAACobQAASBAAAE4zc3B6MTNVbnBhY2tPcHRpb25zRQBwcGlpcAD0bAAAbBAAAKhtAAB0EAAATlN0M19fMjZ2ZWN0b3JJZk5TXzlhbGxvY2F0b3JJZkVFRUUAaXBwACxuAADEEAAAAAAAAAMAAADcEAAAAAAAACgSAAAAAAAAWBIAAAAAAABOU3QzX18yOG9wdGlvbmFsSWZFRQAAAADQbQAA6BAAABgRAABOU3QzX18yMjdfX29wdGlvbmFsX21vdmVfYXNzaWduX2Jhc2VJZkxiMUVFRQAAAADQbQAAJBEAAFQRAABOU3QzX18yMjdfX29wdGlvbmFsX2NvcHlfYXNzaWduX2Jhc2VJZkxiMUVFRQAAAADQbQAAYBEAAIgRAABOU3QzX18yMjBfX29wdGlvbmFsX21vdmVfYmFzZUlmTGIxRUVFAAAA0G0AAJQRAAC8EQAATlN0M19fMjIwX19vcHRpb25hbF9jb3B5X2Jhc2VJZkxiMUVFRQAAANBtAADIEQAA9BEAAE5TdDNfXzIyM19fb3B0aW9uYWxfc3RvcmFnZV9iYXNlSWZMYjBFRUUAAAAAqG0AAPwRAABOU3QzX18yMjRfX29wdGlvbmFsX2Rlc3RydWN0X2Jhc2VJZkxiMUVFRQAAAKhtAAAwEgAATlN0M19fMjE4X19zZmluYWVfY3Rvcl9iYXNlSUxiMUVMYjFFRUUAAKhtAABgEgAATlN0M19fMjIwX19zZmluYWVfYXNzaWduX2Jhc2VJTGIxRUxiMUVFRQAAAACIbgAAnBIAAAAAAABsEAAAUE5TdDNfXzI2dmVjdG9ySWZOU185YWxsb2NhdG9ySWZFRUVFAAAAAIhuAADUEgAAAQAAAGwQAABQS05TdDNfXzI2dmVjdG9ySWZOU185YWxsb2NhdG9ySWZFRUVFAHBwAHYAdnAAAACMEgAAcHAAAJRsAACMEgAAPG0AAHZwcGQAAAAAlGwAAIwSAAAYbQAAPG0AAHZwcHBkAAAAGG0AAMQSAABwcHAATBMAADxtAACobQAAVBMAAE4xMGVtc2NyaXB0ZW4zdmFsRQAAnBAAAGwQAAAYbQAAcHBwcAAAAAAAAAAArGwAAGwQAAAYbQAAPG0AAGlwcHBkAAAALG4AAMATAAAAAAAAAwAAANgTAAAAAAAAKBIAAAAAAABYEgAAAAAAAE5TdDNfXzI4b3B0aW9uYWxJaEVFAAAAANBtAADkEwAAFBQAAE5TdDNfXzIyN19fb3B0aW9uYWxfbW92ZV9hc3NpZ25fYmFzZUloTGIxRUVFAAAAANBtAAAgFAAAUBQAAE5TdDNfXzIyN19fb3B0aW9uYWxfY29weV9hc3NpZ25fYmFzZUloTGIxRUVFAAAAANBtAABcFAAAhBQAAE5TdDNfXzIyMF9fb3B0aW9uYWxfbW92ZV9iYXNlSWhMYjFFRUUAAADQbQAAkBQAALgUAABOU3QzX18yMjBfX29wdGlvbmFsX2NvcHlfYmFzZUloTGIxRUVFAAAA0G0AAMQUAADwFAAATlN0M19fMjIzX19vcHRpb25hbF9zdG9yYWdlX2Jhc2VJaExiMEVFRQAAAACobQAA+BQAAE5TdDNfXzIyNF9fb3B0aW9uYWxfZGVzdHJ1Y3RfYmFzZUloTGIxRUVFAAAAqG0AACwVAABOU3QzX18yNnZlY3RvckloTlNfOWFsbG9jYXRvckloRUVFRQCIbgAAYBUAAAAAAAAkFQAAUE5TdDNfXzI2dmVjdG9ySWhOU185YWxsb2NhdG9ySWhFRUVFAAAAAIhuAACYFQAAAQAAACQVAABQS05TdDNfXzI2dmVjdG9ySWhOU185YWxsb2NhdG9ySWhFRUVFAHBwAHZwAFAVAABwcAAAlGwAAFAVAADEbAAAdnBwaQAAAACUbAAAUBUAABhtAADEbAAAdnBwcGkAAAAYbQAAiBUAAHBwcABMEwAAxGwAAJgTAAAkFQAAGG0AAHBwcHAAAAAArGwAACQVAAAYbQAAxGwAAGlwcHBpAHAAdnAAaXBwAHZwcGkAaXBwAHZwcGkAcHBwAHZwcHAAAABcbQAAYBYAAE4zc3B6MTZDb29yZGluYXRlU3lzdGVtRQBwAHZwAGlwcAB2cHBpAAAAAAAAAwAAAAgAAAAPAAAAqG0AAKAWAABOU3QzX18yMTJiYXNpY19zdHJpbmdJY05TXzExY2hhcl90cmFpdHNJY0VFTlNfOWFsbG9jYXRvckljRUVFRQAAqG0AAOgWAABOU3QzX18yMTJiYXNpY19zdHJpbmdJd05TXzExY2hhcl90cmFpdHNJd0VFTlNfOWFsbG9jYXRvckl3RUVFRQAAqG0AADAXAABOU3QzX18yMTJiYXNpY19zdHJpbmdJRHNOU18xMWNoYXJfdHJhaXRzSURzRUVOU185YWxsb2NhdG9ySURzRUVFRQAAAKhtAAB8FwAATlN0M19fMjEyYmFzaWNfc3RyaW5nSURpTlNfMTFjaGFyX3RyYWl0c0lEaUVFTlNfOWFsbG9jYXRvcklEaUVFRUUAAACobQAAyBcAAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SWNFRQAAqG0AAPAXAABOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0lhRUUAAKhtAAAYGAAATjEwZW1zY3JpcHRlbjExbWVtb3J5X3ZpZXdJaEVFAACobQAAQBgAAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SXNFRQAAqG0AAGgYAABOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0l0RUUAAKhtAACQGAAATjEwZW1zY3JpcHRlbjExbWVtb3J5X3ZpZXdJaUVFAACobQAAuBgAAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SWpFRQAAqG0AAOAYAABOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0lsRUUAAKhtAAAIGQAATjEwZW1zY3JpcHRlbjExbWVtb3J5X3ZpZXdJbUVFAACobQAAMBkAAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SXhFRQAAqG0AAFgZAABOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0l5RUUAAKhtAACAGQAATjEwZW1zY3Jp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AAAJqAAACAQAAAiEAAAIRAAACegAEAcIAAAIXAAACBwAAAmYABQHUwAACHwAAAg8AAAJ2AASBxcAAAhsAAAILAAACbgAAAgMAAAIjAAACEwAAAn4ABAHAwAACFIAAAgSABUIowATByMAAAhyAAAIMgAACcQAEQcLAAAIYgAACCIAAAmkAAAIAgAACIIAAAhCAAAJ5AAQBwcAAAhaAAAIGgAACZQAFAdDAAAIegAACDoAAAnUABIHEwAACGoAAAgqAAAJtAAACAoAAAiKAAAISgAACfQAEAcFAAAIVgAACBYAQAgAABMHMwAACHYAAAg2AAAJzAARBw8AAAhmAAAIJgAACawAAAgGAAAIhgAACEYAAAnsABAHCQAACF4AAAgeAAAJnAAUB2MAAAh+AAAIPgAACdwAEgcbAAAIbgAACC4AAAm8AAAIDgAACI4AAAhOAAAJ/ABgBwAAAAhRAAAIEQAVCIMAEgcfAAAIcQAACDEAAAnCABAHCgAACGEAAAghAAAJogAACAEAAAiBAAAIQQAACeIAEAcGAAAIWQAACBkAAAmSABMHOwAACHkAAAg5AAAJ0gARBxEAAAhpAAAIKQAACbIAAAgJAAAIiQAACEkAAAnyABAHBAAACFUAAAgVABAIAgETBysAAAh1AAAINQAACcoAEQcNAAAIZQAACCUAAAmqAAAIBQAACIUAAAhFAAAJ6gAQBwgAAAhdAAAIHQAACZoAFAdTAAAIfQAACD0AAAnaABIHFwAACG0AAAgtAAAJugAACA0AAAiNAAAITQAACfoAEAcDAAAIUwAACBMAFQjDABMHIwAACHMAAAgzAAAJxgARBwsAAAhjAAAIIwAACaYAAAgDAAAIgwAACEMAAAnmABAHBwAACFsAAAgbAAAJlgAUB0MAAAh7AAAIOwAACdYAEgcTAAAIawAACCsAAAm2AAAICwAACIsAAAhLAAAJ9gAQBwUAAAhXAAAIFwBACAAAEwczAAAIdwAACDcAAAnOABEHDwAACGcAAAgnAAAJrgAACAcAAAiHAAAIRwAACe4AEAcJAAAIXwAACB8AAAmeABQHYwAACH8AAAg/AAAJ3gASBxsAAAhvAAAILwAACb4AAAgPAAAIjwAACE8AAAn+AGAHAAAACFAAAAgQABQIcwASBx8AAAhwAAAIMAAACcEAEAcKAAAIYAAACCAAAAmhAAAIAAAACIAAAAhAAAAJ4QAQBwYAAAhYAAAIGAAACZEAEwc7AAAIeAAACDgAAAnRABEHEQAACGgAAAgoAAAJsQAACAgAAAiIAAAISAAACfEAEAcEAAAIVAAACBQAFQjjABMHKwAACHQAAAg0AAAJyQARBw0AAAhkAAAIJAAACakAAAgEAAAIhAAACEQAAAnpABAHCAAACFwAAAgcAAAJmQAUB1MAAAh8AAAIPAAACdkAEgcXAAAIbAAACCwAAAm5AAAIDAAACIwAAAhMAAAJ+QAQBwMAAAhSAAAIEgAVCKMAEwcjAAAIcgAACDIAAAnFABEHCwAACGIAAAgiAAAJpQAACAIAAAiCAAAIQgAACeUAEAcHAAAIWgAACBoAAAmVABQHQwAACHoAAAg6AAAJ1QASBxMAAAhqAAAIKgAACbUAAAgKAAAIigAACEoAAAn1ABAHBQAACFYAAAgWAEAIAAATBzMAAAh2AAAINgAACc0AEQcPAAAIZgAACCYAAAmtAAAIBgAACIYAAAhGAAAJ7QAQBwkAAAheAAAIHgAACZ0AFAdjAAAIfgAACD4AAAndABIHGwAACG4AAAguAAAJvQAACA4AAAiOAAAITgAACf0AYAcAAAAIUQAACBEAFQiDABIHHwAACHEAAAgxAAAJwwAQBwoAAAhhAAAIIQAACaMAAAgBAAAIgQAACEEAAAnjABAHBgAACFkAAAgZAAAJkwATBzsAAAh5AAAIOQAACdMAEQcRAAAIaQAACCkAAAmzAAAICQAACIkAAAhJAAAJ8wAQBwQAAAhVAAAIFQAQCAIBEwcrAAAIdQAACDUAAAnLABEHDQAACGUAAAglAAAJqwAACAUAAAiFAAAIRQAACesAEAcIAAAIXQAACB0AAAmbABQHUwAACH0AAAg9AAAJ2wASBxcAAAhtAAAILQAACbsAAAgNAAAIjQAACE0AAAn7ABAHAwAACFMAAAgTABUIwwATByMAAAhzAAAIMwAACccAEQcLAAAIYwAACCMAAAmnAAAIAwAACIMAAAhDAAAJ5wAQBwcAAAhbAAAIGwAACZcAFAdDAAAIewAACDsAAAnXABIHEwAACGsAAAgrAAAJtwAACAsAAAiLAAAISwAACfcAEAcFAAAIVwAACBcAQAgAABMHMwAACHcAAAg3AAAJzwARBw8AAAhnAAAIJwAACa8AAAgH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Y05TXzExY2hhcl90cmFpdHNJY0VFRUUA0G0AAHg9AAAAPAAATlN0M19fMjE1YmFzaWNfc3RyaW5nYnVmSWNOU18xMWNoYXJfdHJhaXRzSWNFRU5TXzlhbGxvY2F0b3JJY0VFRUUAAABAAAAAAAAAAKw+AABZAAAAWgAAADgAAAD4////rD4AAFsAAABcAAAAwP///8D///+sPgAAXQAAAF4AAADIPQAALD4AAGg+AAB8PgAAkD4AAKQ+AABUPgAAQD4AAPA9AADcPQAAQAAAAAAAAAAcPQAATAAAAE0AAAA4AAAA+P///xw9AABOAAAATwAAAMD////A////HD0AAFAAAABRAAAAQAAAAAAAAAA8PAAARAAAAEUAAADA////wP///zw8AABGAAAARwAAADgAAAAAAAAAhDwAAEgAAABJAAAAyP///8j///+EPAAASgAAAEsAAADQbQAAuD4AABw9AABOU3QzX18yMThiYXNpY19zdHJpbmdzdHJlYW1JY05TXzExY2hhcl90cmFpdHNJY0VFTlNfOWFsbG9jYXRvckljRUVFRQAAAAAAAAAAED8AAF8AAABgAAAAqG0AABg/AABOU3QzX18yOGlvc19iYXNlRQAAAAAAAADRdJ4AV529KoBwUg///z4nCgAAAGQAAADoAwAAECcAAKCGAQBAQg8AgJaYAADh9QUYAAAANQAAAHEAAABr////zvv//5K///8AAAAAAAAAAP////////////////////////////////////////////////////////////////8AAQIDBAUGBwgJ/////////woLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIj////////CgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiP/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAECBAcDBgUAAAAAAAAAAgAAwAMAAMAEAADABQAAwAYAAMAHAADACAAAwAkAAMAKAADACwAAwAwAAMANAADADgAAwA8AAMAQAADAEQAAwBIAAMATAADA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")),ne((await Y(be)).instance))})();function bW(){function ae(){var ne;if(i.calledRun=!0,!_){if(w=!0,ax.G(),C?.(i),(ne=i.onRuntimeInitialized)==null||ne.call(i),i.postRun)for(typeof i.postRun=="function"&&(i.postRun=[i.postRun]);i.postRun.length;){var be=i.postRun.shift();W.push(be)}$(W)}}if(0<O)G=bW;else{if(i.preRun)for(typeof i.preRun=="function"&&(i.preRun=[i.preRun]);i.preRun.length;)Z();$(K),0<O?G=bW:i.setStatus?(i.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>i.setStatus(""),1),ae()},1)):ae()}}if(i.preInit)for(typeof i.preInit=="function"&&(i.preInit=[i.preInit]);0<i.preInit.length;)i.preInit.shift()();return bW(),w?n=i:n=new Promise((ae,ne)=>{C=ae,E=ne}),n}var cT=(e,t,n=i=>i)=>{let i=e.vf32_ptr(t),o=t.size();return new Float32Array(e.HEAPF32.buffer,i,o).map(n)},e4e=e=>1/(1+Math.exp(-e)),t4e=e=>t=>t*e+.5,n4e=(e,t,n)=>{let i=n?.colorScaleFactor??.282;return{numPoints:t.numPoints,shDegree:t.shDegree,antialiased:t.antialiased,positions:cT(e,t.positions),scales:cT(e,t.scales,Math.exp),rotations:cT(e,t.rotations),alphas:cT(e,t.alphas,e4e),colors:cT(e,t.colors,t4e(i)),sh:cT(e,t.sh)}},i4e=(e,t)=>{e._free(e.vf32_ptr(t.positions)),e._free(e.vf32_ptr(t.scales)),e._free(e.vf32_ptr(t.rotations)),e._free(e.vf32_ptr(t.alphas)),e._free(e.vf32_ptr(t.colors)),e._free(e.vf32_ptr(t.sh))},Kue=async(e,t)=>{var n;let i=await $He(),o=e instanceof Uint8Array?e:new Uint8Array(e),r=null;try{if(r=i._malloc(Uint8Array.BYTES_PER_ELEMENT*o.length),r===null)throw new Error("couldn't allocate memory");i.HEAPU8.set(o,r/Uint8Array.BYTES_PER_ELEMENT);let a=i.CoordinateSystem[((n=t?.unpackOptions)==null?void 0:n.coordinateSystem)??"UNSPECIFIED"],s=i.load_spz(r,o.length,{coordinateSystem:a}),c=n4e(i,s,t);return i4e(i,s),c}catch(a){throw a}finally{r!==null&&i._free(r)}};var o4e=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var r4e=[0,9,24,45],a4e=14,s4e=1.6*1024*1024*1024;function c4e(e,t){let n=t?.attributes;if(!l(n))return;let i=n.POSITION;if(!l(i))return;let o=e?.accessors?.[i];if(!l(o)||o.count<=0)return;let r=0;for(let a in n)if(Object.prototype.hasOwnProperty.call(n,a)){let s=/SH_DEGREE_(\d+)_COEF_/.exec(a);s&&(r=Math.max(r,parseInt(s[1],10)))}return{numPoints:o.count,shDegree:r}}function l4e(e,t){let n=a4e+(r4e[t]??0);return e*n*Float32Array.BYTES_PER_ELEMENT*2}var uq=class extends Ki{constructor(t){super(),t=t??V.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,o=t.primitive,r=t.spz,a=t.gltfResource,s=t.baseResource,c=t.cacheKey;this._resourceCache=n,this._gltfResource=a,this._baseResource=s,this._gltf=i,this._primitive=o,this._spz=r,this._cacheKey=c,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=gt.UNLOADED,this._promise=void 0,this._spzError=void 0}get cacheKey(){return this._cacheKey}get decodedData(){return this._decodedData}async load(){return l(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=u4e(this),this._promise)}process(t){if(this._state===gt.READY)return!0;if(this._state!==gt.PROCESSING||(l(this._spzError)&&fq(this,this._spzError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let n=c4e(this._gltf,this._primitive);if(l(n)){let o=l4e(n.numPoints,n.shDegree);if(o>s4e){let r=Math.round(o/1048576);return fq(this,new ue(`SPZ data too large to decode: ${n.numPoints.toLocaleString()} splats with spherical harmonics degree ${n.shDegree} would require approximately ${r} MB, which exceeds the WASM memory limit. Consider using a lower spherical harmonics degree or splitting the dataset into smaller tiles.`)),!1}}let i=Kue(this._bufferViewTypedArray,{unpackOptions:{coordinateSystem:"UNSPECIFIED"}});if(!l(i))return!1;this._decodePromise=f4e(this,i)}unload(){l(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0,this._primitive=void 0}};async function u4e(e){let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:0,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._bufferViewTypedArray=n.typedArray,e._state=gt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;fq(e,n)}}function fq(e,t){throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load SPZ",t)}async function f4e(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={gcloud:n},e._state=gt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._spzError=n}}var iN=uq;function oN(e){e=e??V.EMPTY_OBJECT;let t=e.id,n=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=je(e.extras,!0),this._extensions=je(e.extensions,!0)}oN.fromJson=function(e){e=e??V.EMPTY_OBJECT;let t=e.id,n=e.class,i={};for(let o in n.properties)if(n.properties.hasOwnProperty(o)){let r=Ap.fromJson({id:o,property:n.properties[o],enums:e.enums});i[o]=r}return new oN({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(oN.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}}});oN.BATCH_TABLE_CLASS_NAME="_batchTable";var Wh=oN;function jV(e){e=e??V.EMPTY_OBJECT;let t=e.value,n=e.name;this._value=t,this._name=n,this._description=e.description,this._extras=je(e.extras,!0),this._extensions=je(e.extensions,!0)}jV.fromJson=function(e){return new jV({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(jV.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 rN=jV;function YV(e){e=e??V.EMPTY_OBJECT;let t=e.id,n=e.values,i={},o={},r=n.length;for(let s=0;s<r;++s){let c=n[s];i[c.value]=c.name,o[c.name]=c.value}let a=e.valueType??Ft.UINT16;this._values=n,this._namesByValue=i,this._valuesByName=o,this._valueType=a,this._id=t,this._name=e.name,this._description=e.description,this._extras=je(e.extras,!0),this._extensions=je(e.extensions,!0)}YV.fromJson=function(e){e=e??V.EMPTY_OBJECT;let t=e.id,n=e.enum,i=n.values.map(function(o){return rN.fromJson(o)});return new YV({id:t,values:i,valueType:Ft[n.valueType],name:n.name,description:n.description,extras:n.extras,extensions:n.extensions})};Object.defineProperties(YV.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 aN=YV;function qV(e){e=e??V.EMPTY_OBJECT;let t=e.classes??{},n=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=je(e.extras,!0),this._extensions=je(e.extensions,!0)}qV.fromJson=function(e){let t={};if(l(e.enums))for(let i in e.enums)e.enums.hasOwnProperty(i)&&(t[i]=aN.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]=Wh.fromJson({id:i,class:e.classes[i],enums:t}));return new qV({id:e.id,name:e.name,description:e.description,version:e.version,classes:n,enums:t,extras:e.extras,extensions:e.extensions})};Object.defineProperties(qV.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 Vl=qV;var dq=class extends Ki{constructor(t){super(),t=t??V.EMPTY_OBJECT;let n=t.schema,i=t.resource,o=t.cacheKey;this._schema=l(n)?Vl.fromJson(n):void 0,this._resource=i,this._cacheKey=o,this._state=gt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get schema(){return this._schema}async load(){return l(this._promise)?this._promise:l(this._schema)?(this._promise=Promise.resolve(this),this._promise):(this._promise=d4e(this),this._promise)}unload(){this._schema=void 0}};async function d4e(e){let t=e._resource;e._state=gt.LOADING;try{let n=await t.fetchJson();return e.isDestroyed()?void 0:(e._schema=Vl.fromJson(n),e._state=gt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=gt.FAILED;let i=`Failed to load schema: ${t.url}`;throw e.getError(i,n)}}var Ty=dq;var Sd={};function lT(e){return Zm(e.url)}function sN(e){let{byteOffset:t,byteLength:n}=e;if(xi(e,"EXT_meshopt_compression")){let i=e.extensions.EXT_meshopt_compression;t=i.byteOffset??0,n=i.byteLength}return`${t}-${t+n}`}function h4e(e,t){let n=t.byteOffset+e.byteOffset,{componentType:i,type:o,count:r}=e;return`${n}-${i}-${o}-${r}`}function Xue(e,t){return`${lT(e)}-buffer-id-${t}`}function uT(e,t,n,i){if(l(e.uri)){let o=i.getDerivedResource({url:e.uri});return lT(o)}return Xue(n,t)}function hq(e,t,n,i){let o=t.bufferView,r=e.bufferViews[o],a=r.buffer,s=e.buffers[a],c=uT(s,a,n,i),u=sN(r);return`${c}-range-${u}`}function Jue(e,t,n,i){let r=e.bufferViews[0],a=r.buffer,s=e.buffers[a],c=uT(s,a,n,i),u=sN(r);return`${c}-range-${u}`}function Zue(e,t,n,i){let o=e.images[t],r=o.bufferView,a=o.uri;if(l(a)){let p=i.getDerivedResource({url:a});return lT(p)}let s=e.bufferViews[r],c=s.buffer,u=e.buffers[c],f=uT(u,c,n,i),h=sN(s);return`${f}-range-${h}`}function m4e(e,t){let n=Bu.createSampler({gltf:e,textureInfo:t});return`${n.wrapS}-${n.wrapT}-${n.minificationFilter}-${n.magnificationFilter}`}Sd.getSchemaCacheKey=function(e){let{schema:t,resource:n}=e;return l(t)?`embedded-schema:${JSON.stringify(t)}`:`external-schema:${lT(n)}`};Sd.getExternalBufferCacheKey=function(e){e=e??V.EMPTY_OBJECT;let{resource:t}=e;return`external-buffer:${lT(t)}`};Sd.getEmbeddedBufferCacheKey=function(e){e=e??V.EMPTY_OBJECT;let{parentResource:t,bufferId:n}=e;return`embedded-buffer:${Xue(t,n)}`};Sd.getGltfCacheKey=function(e){e=e??V.EMPTY_OBJECT;let{gltfResource:t}=e;return`gltf:${lT(t)}`};Sd.getBufferViewCacheKey=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}=e,r=t.bufferViews[n],a=r.buffer,s=t.buffers[a];xi(r,"EXT_meshopt_compression")&&(a=r.extensions.EXT_meshopt_compression.buffer);let c=uT(s,a,i,o),u=sN(r);return`buffer-view:${c}-range-${u}`};Sd.getDracoCacheKey=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,draco:n,gltfResource:i,baseResource:o}=e;return`draco:${hq(t,n,i,o)}`};Sd.getSpzCacheKey=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,primitive:n,gltfResource:i,baseResource:o}=e;return`spz:${Jue(t,n,i,o)}`};Sd.getVertexBufferCacheKey=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:a,spz:s,attributeSemantic:c,dequantize:u=!1,loadBuffer:f=!1,loadTypedArray:h=!1}=e,p="";if(u&&(p+="-dequantize"),f&&(p+="-buffer",p+=`-context-${o.context.id}`),h&&(p+="-typed-array"),l(a))return`vertex-buffer:${hq(t,a,n,i)}-draco-${c}${p}`;if(s)return`vertex-buffer:${Jue(t,s,n,i)}-spz-${c}${p}`;let A=t.bufferViews[r],m=A.buffer,_=t.buffers[m],y=uT(_,m,n,i),C=sN(A);return`vertex-buffer:${y}-range-${C}${p}`};Sd.getIndexBufferCacheKey=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:a,loadBuffer:s=!1,loadTypedArray:c=!1}=e,u="";if(s&&(u+="-buffer",u+=`-context-${r.context.id}`),c&&(u+="-typed-array"),l(a))return`index-buffer:${hq(t,a,i,o)}-draco${u}`;let f=t.accessors[n],h=f.bufferView,p=t.bufferViews[h],A=p.buffer,m=t.buffers[A],_=uT(m,A,i,o),y=h4e(f,p);return`index-buffer:${_}-accessor-${y}${u}`};Sd.getImageCacheKey=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:o}=e;return`image:${Zue(t,n,i,o)}`};Sd.getTextureCacheKey=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:a}=e,s=n.index,c=Bu.getImageIdFromTexture({gltf:t,textureId:s,supportedImageFormats:r}),u=Zue(t,c,i,o),f=m4e(t,n);return`texture:${u}-sampler-${f}-context-${a.context.id}`};var Hl=Sd;function cN(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}cN.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}};cN.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};cN.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};cN.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 lN=cN;function Fn(){}Fn.cacheEntries={};Fn.statistics=new lN;function p4e(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 p4e(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=e??V.EMPTY_OBJECT;let{schema:t,resource:n}=e,i=Hl.getSchemaCacheKey({schema:t,resource:n}),o=Fn.get(i);return l(o)?o:(o=new Ty({schema:t,resource:n,cacheKey:i}),Fn.add(o))};Fn.getEmbeddedBufferLoader=function(e){e=e??V.EMPTY_OBJECT;let{parentResource:t,bufferId:n,typedArray:i}=e,o=Hl.getEmbeddedBufferCacheKey({parentResource:t,bufferId:n}),r=Fn.get(o);return l(r)?r:(r=new p0({typedArray:i,cacheKey:o}),Fn.add(r))};Fn.getExternalBufferLoader=function(e){e=e??V.EMPTY_OBJECT;let{resource:t}=e,n=Hl.getExternalBufferCacheKey({resource:t}),i=Fn.get(n);return l(i)?i:(i=new p0({resource:t,cacheKey:n}),Fn.add(i))};Fn.getGltfJsonLoader=function(e){e=e??V.EMPTY_OBJECT;let{gltfResource:t,baseResource:n,typedArray:i,gltfJson:o}=e,r=Hl.getGltfCacheKey({gltfResource:t}),a=Fn.get(r);return l(a)?a:(a=new nT({resourceCache:Fn,gltfResource:t,baseResource:n,typedArray:i,gltfJson:o,cacheKey:r}),Fn.add(a))};Fn.getBufferViewLoader=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}=e,r=Hl.getBufferViewCacheKey({gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}),a=Fn.get(r);return l(a)?a:(a=new Jx({resourceCache:Fn,gltf:t,bufferViewId:n,gltfResource:i,baseResource:o,cacheKey:r}),Fn.add(a))};Fn.getDracoLoader=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,primitive:n,draco:i,gltfResource:o,baseResource:r}=e,a=Hl.getDracoCacheKey({gltf:t,draco:i,gltfResource:o,baseResource:r}),s=Fn.get(a);return l(s)?s:(s=new Zx({resourceCache:Fn,gltf:t,primitive:n,draco:i,gltfResource:o,baseResource:r,cacheKey:a}),Fn.add(s))};Fn.getSpzLoader=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,primitive:n,spz:i,gltfResource:o,baseResource:r}=e,a=Hl.getSpzCacheKey({gltf:t,primitive:n,gltfResource:o,baseResource:r}),s=Fn.get(a);return l(s)?s:(s=new iN({resourceCache:Fn,gltf:t,primitive:n,spz:i,gltfResource:o,baseResource:r,cacheKey:a}),Fn.add(s))};Fn.getVertexBufferLoader=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,primitive:a,draco:s,spz:c,attributeSemantic:u,accessorId:f,asynchronous:h=!0,dequantize:p=!1,loadBuffer:A=!1,loadTypedArray:m=!1}=e,_=Hl.getVertexBufferCacheKey({gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:s,spz:c,attributeSemantic:u,dequantize:p,loadBuffer:A,loadTypedArray:m}),y=Fn.get(_);return l(y)?y:(y=new sT({resourceCache:Fn,gltf:t,gltfResource:n,baseResource:i,bufferViewId:r,primitive:a,draco:s,spz:c,attributeSemantic:u,accessorId:f,cacheKey:_,asynchronous:h,dequantize:p,loadBuffer:A,loadTypedArray:m}),Fn.add(y))};Fn.getIndexBufferLoader=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,primitive:a,draco:s,asynchronous:c=!0,loadBuffer:u=!1,loadTypedArray:f=!1}=e,h=Hl.getIndexBufferCacheKey({gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:s,loadBuffer:u,loadTypedArray:f}),p=Fn.get(h);return l(p)?p:(p=new eT({resourceCache:Fn,gltf:t,accessorId:n,gltfResource:i,baseResource:o,primitive:a,draco:s,cacheKey:h,asynchronous:c,loadBuffer:u,loadTypedArray:f}),Fn.add(p))};Fn.getImageLoader=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:o}=e,r=Hl.getImageCacheKey({gltf:t,imageId:n,gltfResource:i,baseResource:o}),a=Fn.get(r);return l(a)?a:(a=new $x({resourceCache:Fn,gltf:t,imageId:n,gltfResource:i,baseResource:o,cacheKey:r}),Fn.add(a))};Fn.getTextureLoader=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:a,asynchronous:s=!0}=e,c=Hl.getTextureCacheKey({gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:a}),u=Fn.get(c);return l(u)?u:(u=new aT({resourceCache:Fn,gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,cacheKey:c,asynchronous:s}),Fn.add(u))};Fn.clearForSpecs=function(){let e=[sT,eT,Zx,aT,$x,Jx,p0,Ty,nT],t,n=Fn.cacheEntries,i=[];for(t in n)n.hasOwnProperty(t)&&i.push(n[t]);i.sort(function(r,a){let s=e.indexOf(r.resourceLoader.constructor),c=e.indexOf(a.resourceLoader.constructor);return s-c});let o=i.length;for(let r=0;r<o;++r){let a=i[r];t=a.resourceLoader.cacheKey,l(n[t])&&(a.resourceLoader.destroy(),delete n[t])}Fn.statistics.clear()};var Ri=Fn;function rc(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(rc.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}}});rc.prototype.tileIsAvailableAtIndex=function(e){return this._tileAvailability.getBit(e)};rc.prototype.tileIsAvailableAtCoordinates=function(e){let t=this.getTileIndex(e);return this.tileIsAvailableAtIndex(t)};rc.prototype.contentIsAvailableAtIndex=function(e,t){return t=t??0,this._contentAvailabilityBitstreams[t].getBit(e)};rc.prototype.contentIsAvailableAtCoordinates=function(e,t){let n=this.getTileIndex(e);return this.contentIsAvailableAtIndex(n,t)};rc.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)};rc.prototype.childSubtreeIsAvailableAtCoordinates=function(e){let t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)};rc.prototype.getLevelOffset=function(e){let t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)};rc.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===Na.OCTREE&&(t=3),e>>t};rc.fromSubtreeJson=async function(e,t,n,i,o){let r=new rc(e,i,o),a;l(t)?a={json:t,binary:void 0}:a=A4e(n);let s=a.json;r._subtreeJson=s;let c;if(xi(s,"3DTILES_metadata"))c=s.extensions["3DTILES_metadata"];else if(l(s.tileMetadata)){let E=s.tileMetadata;c=s.propertyTables[E]}let u=[];if(l(s.contentMetadata)){let E=s.contentMetadata.length;for(let b=0;b<E;b++){let x=s.contentMetadata[b];u.push(s.propertyTables[x])}}let f,h=i.metadataSchema,p=s.subtreeMetadata;if(l(p)){let E=p.class,b=h.classes[E];f=new GM({subtreeMetadata:p,class:b})}r._metadata=f,r._tilePropertyTableJson=c,r._contentPropertyTableJsons=u;let A={constant:0};s.contentAvailabilityHeaders=[],xi(s,"3DTILES_multiple_contents")?s.contentAvailabilityHeaders=s.extensions["3DTILES_multiple_contents"].contentAvailability:Array.isArray(s.contentAvailability)?s.contentAvailabilityHeaders=s.contentAvailability:s.contentAvailabilityHeaders.push(s.contentAvailability??A);let m=g4e(s.buffers),_=_4e(s.bufferViews,m);y4e(s,_),l(c)&&$ue(c,_);for(let E=0;E<u.length;E++){let b=u[E];$ue(b,_)}let y=await C4e(r,m,a.binary),C=b4e(_,y);return I4e(r,s,i,C),l(c)&&(x4e(r,i,C),S4e(r)),T4e(r,i,C),w4e(r),r._ready=!0,r};function A4e(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 a=Br(e,i,o);i+=o;let s=e.subarray(i,i+r);return{json:a,binary:s}}function g4e(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 _4e(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 y4e(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 a=0;a<o.length;a++)n=void 0,l(o[a].bitstream)?n=t[o[a].bitstream]:l(o[a].bufferView)&&(n=t[o[a].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 $ue(e,t){let n=e.properties,i;for(let o in n)if(n.hasOwnProperty(o)){let r=n[o],a=r.values??r.bufferView;i=t[a],i.isActive=!0,i.bufferHeader.isActive=!0;let s=r.stringOffsets??r.stringOffsetBufferView;l(s)&&(i=t[s],i.isActive=!0,i.bufferHeader.isActive=!0);let c=r.arrayOffsets??r.arrayOffsetBufferView;l(c)&&(i=t[c],i.isActive=!0,i.bufferHeader.isActive=!0)}}function C4e(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 a=E4e(e,r);i.push(a)}else i.push(Promise.resolve(n))}return Promise.all(i).then(function(o){let r={};for(let a=0;a<o.length;a++){let s=o[a];l(s)&&(r[a]=s)}return r})}async function E4e(e,t){let i=e._resource.getDerivedResource({url:t.uri}),o=Ri.getExternalBufferLoader({resource:i});e._bufferLoader=o;try{await o.load()}catch(r){if(o.isDestroyed())return;throw r}return o.typedArray}function b4e(e,t){let n={};for(let i=0;i<e.length;i++){let o=e[i];if(!o.isActive)continue;let r=o.byteOffset,a=r+o.byteLength,c=t[o.buffer].subarray(r,a);n[i]=c}return n}function I4e(e,t,n,i){let o=n.branchingFactor,r=n.subtreeLevels,a=(Math.pow(o,r)-1)/(o-1),s=Math.pow(o,r),c=xi(t,"3DTILES_metadata"),u=l(e._tilePropertyTableJson),f=c||u;e._tileAvailability=mq(t.tileAvailability,i,a,f);let h=e._contentPropertyTableJsons.length>0;f=f||h;for(let p=0;p<t.contentAvailabilityHeaders.length;p++){let A=mq(t.contentAvailabilityHeaders[p],i,a,f);e._contentAvailabilityBitstreams.push(A)}e._childSubtreeAvailability=mq(t.childSubtreeAvailability,i,s)}function mq(e,t,n,i){if(l(e.constant))return new Kx({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 Kx({bitstream:o,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function x4e(e,t,n){let i=e._tilePropertyTableJson,o=e._tileAvailability.availableCount,r=t.metadataSchema,a=i.class,s=r.classes[a];e._tileMetadataTable=new xd({class:s,count:o,properties:i.properties,bufferViews:n})}function T4e(e,t,n){let i=e._contentPropertyTableJsons,o=e._contentAvailabilityBitstreams,r=t.metadataSchema,a=e._contentMetadataTables;for(let s=0;s<i.length;s++){let c=i[s],f=o[s].availableCount,h=c.class,p=r.classes[h],A=new xd({class:p,count:f,properties:c.properties,bufferViews:n});a.push(A)}}function efe(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 S4e(e){let t=efe(e._tileAvailability);e._tileJumpBuffer=t}function w4e(e){let t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let i=0;i<n.length;i++){let o=n[i],r=efe(o);t.push(r)}}rc.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};rc.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 B4e(e,t){if(!l(e._tileMetadataTable))return;let n=e.getTileIndex(t);if(e._tileAvailability.getBit(n))return e._tileJumpBuffer[n]}function D4e(e,t,n){let i=e._contentMetadataTables;if(!l(i))return;let o=i[n];if(!l(o))return;let r=e._contentAvailabilityBitstreams[n],a=e.getTileIndex(t);if(r.getBit(a))return e._contentJumpBuffers[n][a]}rc.prototype.getTileMetadataView=function(e){let t=B4e(this,e);if(!l(t))return;let n=this._tileMetadataTable;return new Xx({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})};rc.prototype.getContentMetadataView=function(e,t){let n=D4e(this,e,t);if(!l(n))return;let i=this._contentMetadataTables[t],o=this._contentPropertyTableJsons[t];return new Xx({class:i.class,metadataTable:i,entityId:n,contentIndex:t,propertyTableJson:o})};rc.prototype.isDestroyed=function(){return!1};rc.prototype.destroy=function(){return l(this._bufferLoader)&&Ri.unload(this._bufferLoader),fe(this)};var ag=rc;var v4e={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"},wd=Object.freeze(v4e);var Sy={};Sy.parseAllBoundingVolumeSemantics=function(e,t){return{boundingVolume:Sy.parseBoundingVolumeSemantic(e,t),minimumHeight:Sy._parseMinimumHeight(e,t),maximumHeight:Sy._parseMaximumHeight(e,t)}};Sy.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 a=`${e}_BOUNDING_SPHERE`,s=t.getPropertyBySemantic(a);if(l(s))return{sphere:s}};Sy._parseMinimumHeight=function(e,t){let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};Sy._parseMaximumHeight=function(e,t){let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};var wy=Sy;function Wl(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(),a=i.subtreeUriTemplate.getDerivedResource({templateValues:r});this._url=a.getUrlComponent(!0),this._ready=!1}Object.defineProperties(Wl.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}}});Wl.fromSubtreeJson=async function(e,t,n,i,o,r){r=r??0;let a;l(o)&&(a=new Uint8Array(o,r));let s=t.implicitTileset,c=t.implicitCoordinates,u=await ag.fromSubtreeJson(n,i,a,s,c),f=new Wl(e,t,n);return f._implicitSubtree=u,P4e(f,u),f._ready=!0,f};function P4e(e,t){let n=e._tile,i=e._implicitCoordinates.childIndex,o=M4e(e,t,n,i),r=e._tileset.statistics;n.children.push(o.rootTile),r.numberOfTilesTotal++;let a=R4e(e,t,o.bottomRow);for(let s=0;s<a.length;s++){let c=a[s],u=c.tile,f=G4e(e,u,c.childIndex);u.children.push(f),r.numberOfTilesTotal++}}function R4e(e,t,n){let i=[],o=e._implicitTileset.branchingFactor;for(let r=0;r<n.length;r++){let a=n[r];if(l(a))for(let s=0;s<o;s++){let c=r*o+s;t.childSubtreeIsAvailableAtIndex(c)&&i.push({tile:a,childIndex:s})}}return i}function M4e(e,t,n,i){let a=tfe(e,t,n,i,0,!0),s=e._tileset.statistics,c=[a],u=[],f=e._implicitTileset;for(let h=1;h<f.subtreeLevels;h++){let p=t.getLevelOffset(h),A=f.branchingFactor*c.length;for(let m=0;m<A;m++){let _=p+m;if(!t.tileIsAvailableAtIndex(_)){u.push(void 0);continue}let y=t.getParentMortonIndex(m),C=c[y],E=m%f.branchingFactor,b=tfe(e,t,C,E,_);C.children.push(b),s.numberOfTilesTotal++,u.push(b)}c=u,u=[]}return{rootTile:a,bottomRow:c}}function nfe(e,t,n){let i=wd.TILE_GEOMETRIC_ERROR;return l(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function tfe(e,t,n,i,o,r){let a=e._implicitTileset,s;r??!1?s=n.implicitCoordinates:s=n.implicitCoordinates.getChildCoordinates(i);let c,u;l(t.tilePropertyTableJson)&&(c=t.getTileMetadataView(s),u=wy.parseAllBoundingVolumeSemantics("TILE",c));let h=t.contentPropertyTableJsons.length,p=!1;for(let S=0;S<h;S++)if(t.contentIsAvailableAtCoordinates(s,S)){p=!0;break}let A=O4e(a,s,i,r,n,u),m=[];for(let S=0;S<a.contentCount;S++){if(!t.contentIsAvailableAtIndex(o,S))continue;let P={uri:a.contentUriTemplates[S].getDerivedResource({templateValues:s.getTemplateValues()}).url},N;if(t.contentPropertyTableJsons.length>0){let g=t.getContentMetadataView(s,S);N=wy.parseAllBoundingVolumeSemantics("CONTENT",g)}let L=F4e(A,N);l(L)&&(P.boundingVolume=L),m.push(Pt(P,a.contentHeaders[S]))}let _=nfe(c,a,s),y={boundingVolume:A,geometricError:_,refine:a.refine,contents:m},C=!0,E=je(a.tileHeader,C);delete E.boundingVolume,delete E.transform,delete E.metadata;let b=Pt(y,E,C),x=sfe(e,a.baseResource,b,n);return x.implicitCoordinates=s,x.implicitSubtree=t,x.metadata=c,x.hasImplicitContentMetadata=p,x}function KV(e,t){return l(e)&&l(t)&&(l(t.minimumHeight)||l(t.maximumHeight))&&(xi(e,"3DTILES_bounding_volume_S2")||l(e.region))}function Aq(e,t){l(t)&&(xi(e,"3DTILES_bounding_volume_S2")?L4e(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):l(e.region)&&N4e(e.region,t.minimumHeight,t.maximumHeight))}function N4e(e,t,n){l(t)&&(e[4]=t),l(n)&&(e[5]=n)}function L4e(e,t,n){l(t)&&(e.minimumHeight=t),l(n)&&(e.maximumHeight=n)}function O4e(e,t,n,i,o,r){let a;return!l(r)||!l(r.boundingVolume)||!KV(r.boundingVolume,r)&&KV(e.boundingVolume,r)?a=ife(e,t,n,i??!1,o):a=r.boundingVolume,Aq(a,r),a}function F4e(e,t){let n;return l(t)&&(n=t.boundingVolume),KV(n,t)?Aq(n,t):KV(e,t)&&(n=je(e,!0),Aq(n,t)),n}function ife(e,t,n,i,o){let r=e.boundingVolume;return xi(r,"3DTILES_bounding_volume_S2")?ofe(i,o,n,t.level,t.x,t.y,t.z):l(r.region)?{region:afe(r.region,t.level,t.x,t.y,t.z)}:{box:rfe(r.box,t.level,t.x,t.y,t.z)}}function ofe(e,t,n,i,o,r,a){let s=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:eg.getTokenFromId(s.s2Cell._cellId),minimumHeight:s.minimumHeight,maximumHeight:s.maximumHeight}}};let c=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),u=c%2===0?Yx.encode2D(i,o,r):Yx.encode2D(i,r,o),f=eg.fromFacePositionLevel(c,BigInt(u),i),h,p;if(l(a)){let A=(s.maximumHeight+s.minimumHeight)/2;h=n<4?s.minimumHeight:A,p=n<4?A:s.maximumHeight}else h=s.minimumHeight,p=s.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:eg.getTokenFromId(f._cellId),minimumHeight:h,maximumHeight:p}}}}var Q4e=new d,k4e=new d,pq=new d,U4e=new J;function rfe(e,t,n,i,o){if(t===0)return e;let r=d.unpack(e,0,k4e),a=J.unpack(e,3,U4e),s=Math.pow(2,-t),c=-1+(2*n+1)*s,u=-1+(2*i+1)*s,f=0,h=d.fromElements(s,s,1,Q4e);l(o)&&(f=-1+(2*o+1)*s,h.z=s);let p=d.fromElements(c,u,f,pq);p=J.multiplyByVector(a,p,pq),p=d.add(p,r,pq);let A=J.clone(a);A=J.multiplyByScale(A,h,A);let m=new Array(12);return d.pack(p,m),J.pack(A,m,3),m}var z4e=new ce;function afe(e,t,n,i,o){if(t===0)return e.slice();let r=ce.unpack(e,0,z4e),a=e[4],s=e[5],c=Math.pow(2,-t),u=c*r.width,f=D.negativePiToPi(r.west+n*u),h=D.negativePiToPi(f+u),p=c*r.height,A=D.negativePiToPi(r.south+i*p),m=D.negativePiToPi(A+p),_=a,y=s;if(l(o)){let C=c*(s-a);_+=o*C,y=_+C}return[f,A,h,m,_,y]}function G4e(e,t,n){let i=e._implicitTileset,o=t.implicitCoordinates.getChildCoordinates(n),r=ife(i,o,n,!1,t),a=nfe(void 0,i,o),s=i.subtreeUriTemplate.getDerivedResource({templateValues:o.getTemplateValues()}).url,c={boundingVolume:r,geometricError:a,refine:i.refine,contents:[{uri:s}]},u=sfe(e,i.baseResource,c,t);return u.implicitTileset=i,u.implicitCoordinates=o,u}function sfe(e,t,n,i){let o=e._tile.constructor;return new o(e._tileset,t,n,i)}Wl.prototype.hasProperty=function(e,t){return!1};Wl.prototype.getFeature=function(e){};Wl.prototype.applyDebugSettings=function(e,t){};Wl.prototype.applyStyle=function(e){};Wl.prototype.update=function(e,t){};Wl.prototype.pick=function(e,t,n){};Wl.prototype.isDestroyed=function(){return!1};Wl.prototype.destroy=function(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),fe(this)};Wl._deriveBoundingBox=rfe;Wl._deriveBoundingRegion=afe;Wl._deriveBoundingVolumeS2=ofe;var fT=Wl;var V4e={NONE:0,REPEAT:1,MIRRORED_REPEAT:2},Du=Object.freeze(V4e);function dT(e,t){this._distance=t,this._normal=new cfe(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(dT.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)&&!d.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),d.clone(e,this._normal._cartesian3)}}});dT.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new dT(e.normal,e.distance),t};dT.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new dT(e.normal,e.distance)};function cfe(e,t){this._clippingPlane=t,this._cartesian3=d.clone(e)}Object.defineProperties(cfe.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 Xa=dT;function Zc(e){e=e??V.EMPTY_OBJECT,this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=e.enabled??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this.edgeColor=z.clone(e.edgeColor??z.WHITE),this.edgeWidth=e.edgeWidth??0,this.planeAdded=new _e,this.planeRemoved=new _e,this._owner=void 0;let t=e.unionClippingRegions??!1;this._unionClippingRegions=t,this._testIntersection=t?hfe:mfe,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 hfe(e){return e===Xt.OUTSIDE}function mfe(e){return e===Xt.INSIDE}Object.defineProperties(Zc.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?hfe:mfe)}},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 lfe(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}Zc.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){lfe(n,i)},e.index=t,lfe(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};Zc.prototype.get=function(e){return this._planes[e]};function pfe(e,t){let n=e.length;for(let i=0;i<n;++i)if(cn.equals(e[i],t))return i;return-1}Zc.prototype.contains=function(e){return pfe(this._planes,e)!==-1};Zc.prototype.remove=function(e){let t=this._planes,n=pfe(t,e);if(n===-1)return!1;e instanceof Xa&&(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 Xa&&(r.index=o)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};Zc.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof Xa&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var H4e=new ie,W4e=new ie;function ufe(e,t,n){let i=e._uint8View,o=e._planes,r=0;for(let a=t;a<n;++a){let s=o[a],c=tn.octEncodeToCartesian4(s.normal,W4e);i[r]=c.x,i[r+1]=c.y,i[r+2]=c.z,i[r+3]=c.w;let u=ie.packFloat(s.distance,H4e);i[r+4]=u.x,i[r+5]=u.y,i[r+6]=u.z,i[r+7]=u.w,r+=8}}function ffe(e,t,n){let i=e._float32View,o=e._planes,r=0;for(let a=t;a<n;++a){let s=o[a],c=s.normal;i[r]=c.x,i[r+1]=c.y,i[r+2]=c.z,i[r+3]=s.distance,r+=4}}function Afe(e,t){let n=Rt.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var j4e=new k;Zc.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=Zc.useFloatTexture(n),o=i?this.length:this.length*2;if(l(t)){let a=t.width*t.height;(a<o||o<.25*a)&&(t.destroy(),t=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!l(t)){let a=Afe(o,j4e);a.y*=2,i?(t=new Dt({context:n,width:a.x,height:a.y,pixelFormat:qe.RGBA,pixelDatatype:He.FLOAT,sampler:jt.NEAREST,flipY:!1}),this._float32View=new Float32Array(a.x*a.y*4)):(t=new Dt({context:n,width:a.x,height:a.y,pixelFormat:qe.RGBA,pixelDatatype:He.UNSIGNED_BYTE,sampler:jt.NEAREST,flipY:!1}),this._uint8View=new Uint8Array(a.x*a.y*4)),this._clippingPlanesTexture=t,this._multipleDirtyPlanes=!0}let r=this._dirtyIndex;if(!(!this._multipleDirtyPlanes&&r===-1)){if(this._multipleDirtyPlanes)i?(ffe(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(ufe(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._uint8View}}));else{let a=0,s=0;i?(s=Math.floor(r/t.width),a=Math.floor(r-s*t.width),ffe(this,r,r+1),t.copyFrom({source:{width:1,height:1,arrayBufferView:this._float32View},xOffset:a,yOffset:s})):(s=Math.floor(r*2/t.width),a=Math.floor(r*2-s*t.width),ufe(this,r,r+1),t.copyFrom({source:{width:2,height:1,arrayBufferView:this._uint8View},xOffset:a,yOffset:s}))}this._multipleDirtyPlanes=!1,this._dirtyIndex=-1}};var Y4e=new M,dfe=new cn(d.UNIT_X,0);Zc.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,o=this.modelMatrix;l(t)&&(o=M.multiply(t,o,Y4e));let r=Xt.INSIDE;!this.unionClippingRegions&&i>0&&(r=Xt.OUTSIDE);for(let a=0;a<i;++a){let s=n[a];cn.transform(s,o,dfe);let c=e.intersectPlane(dfe);if(c===Xt.INTERSECTING)r=c;else if(this._testIntersection(c))return c}return r};Zc.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};Zc.useFloatTexture=function(e){return e.floatingPointTexture};Zc.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let o=Zc.useFloatTexture(t)?e.length:e.length*2,r=Afe(o,n);return r.y*=2,r};Zc.prototype.isDestroyed=function(){return!1};Zc.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),fe(this)};var da=Zc;function yq(e,t,n=2){let i=t&&t.length,o=i?t[0]*n:e.length,r=_fe(e,0,o,n,!0),a=[];if(!r||r.next===r.prev)return a;let s,c,u;if(i&&(r=Z4e(e,t,r,n)),e.length>80*n){s=1/0,c=1/0;let f=-1/0,h=-1/0;for(let p=n;p<o;p+=n){let A=e[p],m=e[p+1];A<s&&(s=A),m<c&&(c=m),A>f&&(f=A),m>h&&(h=m)}u=Math.max(f-s,h-c),u=u!==0?32767/u:0}return uN(r,a,n,s,c,u,0),a}function _fe(e,t,n,i,o){let r;if(o===l9e(e,t,n,i)>0)for(let a=t;a<n;a+=i)r=gfe(a/i|0,e[a],e[a+1],r);else for(let a=n-i;a>=t;a-=i)r=gfe(a/i|0,e[a],e[a+1],r);return r&&ZV(r,r.next)&&(dN(r),r=r.next),r}function I0(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(ZV(n,n.next)||ha(n.prev,n,n.next)===0)){if(dN(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function uN(e,t,n,i,o,r,a){if(!e)return;!a&&r&&i9e(e,i,o,r);let s=e;for(;e.prev!==e.next;){let c=e.prev,u=e.next;if(r?K4e(e,i,o,r):q4e(e)){t.push(c.i,e.i,u.i),dN(e),e=u.next,s=u.next;continue}if(e=u,e===s){a?a===1?(e=X4e(I0(e),t),uN(e,t,n,i,o,r,2)):a===2&&J4e(e,t,n,i,o,r):uN(I0(e),t,n,i,o,r,1);break}}}function q4e(e){let t=e.prev,n=e,i=e.next;if(ha(t,n,i)>=0)return!1;let o=t.x,r=n.x,a=i.x,s=t.y,c=n.y,u=i.y,f=o<r?o<a?o:a:r<a?r:a,h=s<c?s<u?s:u:c<u?c:u,p=o>r?o>a?o:a:r>a?r:a,A=s>c?s>u?s:u:c>u?c:u,m=i.next;for(;m!==t;){if(m.x>=f&&m.x<=p&&m.y>=h&&m.y<=A&&hT(o,s,r,c,a,u,m.x,m.y)&&ha(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function K4e(e,t,n,i){let o=e.prev,r=e,a=e.next;if(ha(o,r,a)>=0)return!1;let s=o.x,c=r.x,u=a.x,f=o.y,h=r.y,p=a.y,A=s<c?s<u?s:u:c<u?c:u,m=f<h?f<p?f:p:h<p?h:p,_=s>c?s>u?s:u:c>u?c:u,y=f>h?f>p?f:p:h>p?h:p,C=gq(A,m,t,n,i),E=gq(_,y,t,n,i),b=e.prevZ,x=e.nextZ;for(;b&&b.z>=C&&x&&x.z<=E;){if(b.x>=A&&b.x<=_&&b.y>=m&&b.y<=y&&b!==o&&b!==a&&hT(s,f,c,h,u,p,b.x,b.y)&&ha(b.prev,b,b.next)>=0||(b=b.prevZ,x.x>=A&&x.x<=_&&x.y>=m&&x.y<=y&&x!==o&&x!==a&&hT(s,f,c,h,u,p,x.x,x.y)&&ha(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;b&&b.z>=C;){if(b.x>=A&&b.x<=_&&b.y>=m&&b.y<=y&&b!==o&&b!==a&&hT(s,f,c,h,u,p,b.x,b.y)&&ha(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;x&&x.z<=E;){if(x.x>=A&&x.x<=_&&x.y>=m&&x.y<=y&&x!==o&&x!==a&&hT(s,f,c,h,u,p,x.x,x.y)&&ha(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function X4e(e,t){let n=e;do{let i=n.prev,o=n.next.next;!ZV(i,o)&&yfe(i,n,n.next,o)&&fN(i,o)&&fN(o,i)&&(t.push(i.i,n.i,o.i),dN(n),dN(n.next),n=e=o),n=n.next}while(n!==e);return I0(n)}function J4e(e,t,n,i,o,r){let a=e;do{let s=a.next.next;for(;s!==a.prev;){if(a.i!==s.i&&a9e(a,s)){let c=Cfe(a,s);a=I0(a,a.next),c=I0(c,c.next),uN(a,t,n,i,o,r,0),uN(c,t,n,i,o,r,0);return}s=s.next}a=a.next}while(a!==e)}function Z4e(e,t,n,i){let o=[];for(let r=0,a=t.length;r<a;r++){let s=t[r]*i,c=r<a-1?t[r+1]*i:e.length,u=_fe(e,s,c,i,!1);u===u.next&&(u.steiner=!0),o.push(r9e(u))}o.sort($4e);for(let r=0;r<o.length;r++)n=e9e(o[r],n);return n}function $4e(e,t){return e.x-t.x}function e9e(e,t){let n=t9e(e,t);if(!n)return t;let i=Cfe(n,e);return I0(i,i.next),I0(n,n.next)}function t9e(e,t){let n=t,i=e.x,o=e.y,r=-1/0,a;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){let h=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(h<=i&&h>r&&(r=h,a=n.x<n.next.x?n:n.next,h===i))return a}n=n.next}while(n!==t);if(!a)return null;let s=a,c=a.x,u=a.y,f=1/0;n=a;do{if(i>=n.x&&n.x>=c&&i!==n.x&&hT(o<u?i:r,o,c,u,o<u?r:i,o,n.x,n.y)){let h=Math.abs(o-n.y)/(i-n.x);fN(n,e)&&(h<f||h===f&&(n.x>a.x||n.x===a.x&&n9e(a,n)))&&(a=n,f=h)}n=n.next}while(n!==s);return a}function n9e(e,t){return ha(e.prev,e,t.prev)<0&&ha(t.next,e,e.next)<0}function i9e(e,t,n,i){let o=e;do o.z===0&&(o.z=gq(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,o9e(o)}function o9e(e){let t,n=1;do{let i=e,o;e=null;let r=null;for(t=0;i;){t++;let a=i,s=0;for(let u=0;u<n&&(s++,a=a.nextZ,!!a);u++);let c=n;for(;s>0||c>0&&a;)s!==0&&(c===0||!a||i.z<=a.z)?(o=i,i=i.nextZ,s--):(o=a,a=a.nextZ,c--),r?r.nextZ=o:e=o,o.prevZ=r,r=o;i=a}r.nextZ=null,n*=2}while(t>1);return e}function gq(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 r9e(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 hT(e,t,n,i,o,r,a,s){return(o-a)*(t-s)>=(e-a)*(r-s)&&(e-a)*(i-s)>=(n-a)*(t-s)&&(n-a)*(r-s)>=(o-a)*(i-s)}function a9e(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!s9e(e,t)&&(fN(e,t)&&fN(t,e)&&c9e(e,t)&&(ha(e.prev,e,t.prev)||ha(e,t.prev,t))||ZV(e,t)&&ha(e.prev,e,e.next)>0&&ha(t.prev,t,t.next)>0)}function ha(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function ZV(e,t){return e.x===t.x&&e.y===t.y}function yfe(e,t,n,i){let o=JV(ha(e,t,n)),r=JV(ha(e,t,i)),a=JV(ha(n,i,e)),s=JV(ha(n,i,t));return!!(o!==r&&a!==s||o===0&&XV(e,n,t)||r===0&&XV(e,i,t)||a===0&&XV(n,e,i)||s===0&&XV(n,t,i))}function XV(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 JV(e){return e>0?1:e<0?-1:0}function s9e(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&&yfe(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function fN(e,t){return ha(e.prev,e,e.next)<0?ha(e,t,e.next)>=0&&ha(e,e.prev,t)>=0:ha(e,t,e.prev)<0||ha(e,e.next,t)<0}function c9e(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 Cfe(e,t){let n=_q(e.i,e.x,e.y),i=_q(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 gfe(e,t,n,i){let o=_q(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 dN(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 _q(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function l9e(e,t,n,i){let o=0;for(let r=t,a=n-i;r<n;r+=i)o+=(e[a]-e[r])*(e[r+1]+e[a+1]),a=r;return o}var u9e=new d,f9e=new d,By={};By.computeArea2D=function(e){let t=e.length,n=0;for(let i=t-1,o=0;o<t;i=o++){let r=e[i],a=e[o];n+=r.x*a.y-a.x*r.y}return n*.5};By.computeWindingOrder2D=function(e){return By.computeArea2D(e)>0?Ya.COUNTER_CLOCKWISE:Ya.CLOCKWISE};By.triangulate=function(e,t){let n=k.packArray(e);return yq(n,t,2)};var xfe=new d,Tfe=new d,Sfe=new d,Efe=new d,bfe=new d,Ife=new d,sg=new d,wfe=new k,Bfe=new k,Dfe=new k,mT=new k;By.computeSubdivision=function(e,t,n,i,o){o=o??D.RADIANS_PER_DEGREE;let r=l(i),a=n.slice(0),s,c=t.length,u=new Array(c*3),f=new Array(c*2),h=0,p=0;for(s=0;s<c;s++){let b=t[s];if(u[h++]=b.x,u[h++]=b.y,u[h++]=b.z,r){let x=i[s];f[p++]=x.x,f[p++]=x.y}}let A=[],m={},_=e.maximumRadius,y=D.chordLength(o,_),C=y*y;for(;a.length>0;){let b=a.pop(),x=a.pop(),S=a.pop(),B=d.fromArray(u,S*3,xfe),v=d.fromArray(u,x*3,Tfe),P=d.fromArray(u,b*3,Sfe),N,L,g;r&&(N=k.fromArray(f,S*2,wfe),L=k.fromArray(f,x*2,Bfe),g=k.fromArray(f,b*2,Dfe));let I=d.multiplyByScalar(d.normalize(B,Efe),_,Efe),T=d.multiplyByScalar(d.normalize(v,bfe),_,bfe),w=d.multiplyByScalar(d.normalize(P,Ife),_,Ife),R=d.magnitudeSquared(d.subtract(I,T,sg)),O=d.magnitudeSquared(d.subtract(T,w,sg)),G=d.magnitudeSquared(d.subtract(w,I,sg)),F=Math.max(R,O,G),U,Q,H;F>C?R===F?(U=`${Math.min(S,x)} ${Math.max(S,x)}`,s=m[U],l(s)||(Q=d.add(B,v,sg),d.multiplyByScalar(Q,.5,Q),u.push(Q.x,Q.y,Q.z),s=u.length/3-1,m[U]=s,r&&(H=k.add(N,L,mT),k.multiplyByScalar(H,.5,H),f.push(H.x,H.y))),a.push(S,s,b),a.push(s,x,b)):O===F?(U=`${Math.min(x,b)} ${Math.max(x,b)}`,s=m[U],l(s)||(Q=d.add(v,P,sg),d.multiplyByScalar(Q,.5,Q),u.push(Q.x,Q.y,Q.z),s=u.length/3-1,m[U]=s,r&&(H=k.add(L,g,mT),k.multiplyByScalar(H,.5,H),f.push(H.x,H.y))),a.push(x,s,S),a.push(s,b,S)):G===F&&(U=`${Math.min(b,S)} ${Math.max(b,S)}`,s=m[U],l(s)||(Q=d.add(P,B,sg),d.multiplyByScalar(Q,.5,Q),u.push(Q.x,Q.y,Q.z),s=u.length/3-1,m[U]=s,r&&(H=k.add(g,N,mT),k.multiplyByScalar(H,.5,H),f.push(H.x,H.y))),a.push(b,s,x),a.push(s,S,x)):(A.push(S),A.push(x),A.push(b))}let E={attributes:{position:new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:u})},indices:A,primitiveType:ve.TRIANGLES};return r&&(E.attributes.st=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:f})),new yt(E)};var d9e=new me,h9e=new me,m9e=new me,Cq=new me;By.computeRhumbLineSubdivision=function(e,t,n,i,o){o=o??D.RADIANS_PER_DEGREE;let r=l(i),a=n.slice(0),s,c=t.length,u=new Array(c*3),f=new Array(c*2),h=0,p=0;for(s=0;s<c;s++){let S=t[s];if(u[h++]=S.x,u[h++]=S.y,u[h++]=S.z,r){let B=i[s];f[p++]=B.x,f[p++]=B.y}}let A=[],m={},_=e.maximumRadius,y=D.chordLength(o,_),C=new Sc(void 0,void 0,e),E=new Sc(void 0,void 0,e),b=new Sc(void 0,void 0,e);for(;a.length>0;){let S=a.pop(),B=a.pop(),v=a.pop(),P=d.fromArray(u,v*3,xfe),N=d.fromArray(u,B*3,Tfe),L=d.fromArray(u,S*3,Sfe),g,I,T;r&&(g=k.fromArray(f,v*2,wfe),I=k.fromArray(f,B*2,Bfe),T=k.fromArray(f,S*2,Dfe));let w=e.cartesianToCartographic(P,d9e),R=e.cartesianToCartographic(N,h9e),O=e.cartesianToCartographic(L,m9e);C.setEndPoints(w,R);let G=C.surfaceDistance;E.setEndPoints(R,O);let F=E.surfaceDistance;b.setEndPoints(O,w);let U=b.surfaceDistance,Q=Math.max(G,F,U),H,Y,$,W,K;Q>y?G===Q?(H=`${Math.min(v,B)} ${Math.max(v,B)}`,s=m[H],l(s)||(Y=C.interpolateUsingFraction(.5,Cq),$=(w.height+R.height)*.5,W=d.fromRadians(Y.longitude,Y.latitude,$,e,sg),u.push(W.x,W.y,W.z),s=u.length/3-1,m[H]=s,r&&(K=k.add(g,I,mT),k.multiplyByScalar(K,.5,K),f.push(K.x,K.y))),a.push(v,s,S),a.push(s,B,S)):F===Q?(H=`${Math.min(B,S)} ${Math.max(B,S)}`,s=m[H],l(s)||(Y=E.interpolateUsingFraction(.5,Cq),$=(R.height+O.height)*.5,W=d.fromRadians(Y.longitude,Y.latitude,$,e,sg),u.push(W.x,W.y,W.z),s=u.length/3-1,m[H]=s,r&&(K=k.add(I,T,mT),k.multiplyByScalar(K,.5,K),f.push(K.x,K.y))),a.push(B,s,v),a.push(s,S,v)):U===Q&&(H=`${Math.min(S,v)} ${Math.max(S,v)}`,s=m[H],l(s)||(Y=b.interpolateUsingFraction(.5,Cq),$=(O.height+w.height)*.5,W=d.fromRadians(Y.longitude,Y.latitude,$,e,sg),u.push(W.x,W.y,W.z),s=u.length/3-1,m[H]=s,r&&(K=k.add(T,g,mT),k.multiplyByScalar(K,.5,K),f.push(K.x,K.y))),a.push(S,s,B),a.push(s,v,B)):(A.push(v),A.push(B),A.push(S))}let x={attributes:{position:new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:u})},indices:A,primitiveType:ve.TRIANGLES};return r&&(x.attributes.st=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:f})),new yt(x)};By.scaleToGeodeticHeight=function(e,t,n,i){n=n??te.default;let o=u9e,r=f9e;if(t=t??0,i=i??!0,l(e)){let a=e.length;for(let s=0;s<a;s+=3)d.fromArray(e,s,r),i&&(r=n.scaleToGeodeticSurface(r,r)),t!==0&&(o=n.geodeticSurfaceNormal(r,o),d.multiplyByScalar(o,t,o),d.add(r,o,r)),e[s]=r.x,e[s+1]=r.y,e[s+2]=r.z}return e};var Ti=By;function Dy(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(Dy.prototype,{length:{get:function(){return this._length}}});Dy.prototype.enqueue=function(e){this._array.push(e),this._length++};Dy.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};Dy.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};Dy.prototype.contains=function(e){return this._array.indexOf(e)!==-1};Dy.prototype.clear=function(){this._array.length=this._offset=this._length=0};Dy.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var vy=Dy;var Dr={};Dr.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,a=o.holes;if(l(r)&&r.length>0&&(n+=r.length*t.packedLength),l(a)){let s=a.length;for(let c=0;c<s;++c)i.push(a[c])}}return n};Dr.packPolygonHierarchy=function(e,t,n,i){let o=[e];for(;o.length>0;){let r=o.pop();if(!l(r))continue;let a=r.positions,s=r.holes;if(t[n++]=l(a)?a.length:0,t[n++]=l(s)?s.length:0,l(a)){let c=a.length;for(let u=0;u<c;++u,n+=i.packedLength)i.pack(a[u],t,n)}if(l(s)){let c=s.length;for(let u=0;u<c;++u)o.push(s[u])}}return n};Dr.unpackPolygonHierarchy=function(e,t,n){let i=e[t++],o=e[t++],r=new Array(i),a=o>0?new Array(o):void 0;for(let s=0;s<i;++s,t+=n.packedLength)r[s]=n.unpack(e,t);for(let s=0;s<o;++s)a[s]=Dr.unpackPolygonHierarchy(e,t,n),t=a[s].startingIndex,delete a[s].startingIndex;return{positions:r,holes:a,startingIndex:t}};var x0=new k;function Rfe(e,t,n,i){return k.subtract(t,e,x0),k.multiplyByScalar(x0,n/i,x0),k.add(e,x0,x0),[x0.x,x0.y]}var Py=new d;function p9e(e,t,n,i){return d.subtract(t,e,Py),d.multiplyByScalar(Py,n/i,Py),d.add(e,Py,Py),[Py.x,Py.y,Py.z]}Dr.subdivideLineCount=function(e,t,n){let o=d.distance(e,t)/n,r=Math.max(0,Math.ceil(D.log2(o)));return Math.pow(2,r)};var e8=new me,t8=new me,A9e=new me,g9e=new d,$V=new Sc;Dr.subdivideRhumbLineCount=function(e,t,n,i){let o=e.cartesianToCartographic(t,e8),r=e.cartesianToCartographic(n,t8),s=new Sc(o,r,e).surfaceDistance/i,c=Math.max(0,Math.ceil(D.log2(s)));return Math.pow(2,c)};Dr.subdivideTexcoordLine=function(e,t,n,i,o,r){let a=Dr.subdivideLineCount(n,i,o),s=k.distance(e,t),c=s/a,u=r;u.length=a*2;let f=0;for(let h=0;h<a;h++){let p=Rfe(e,t,h*c,s);u[f++]=p[0],u[f++]=p[1]}return u};Dr.subdivideLine=function(e,t,n,i){let o=Dr.subdivideLineCount(e,t,n),r=d.distance(e,t),a=r/o;l(i)||(i=[]);let s=i;s.length=o*3;let c=0;for(let u=0;u<o;u++){let f=p9e(e,t,u*a,r);s[c++]=f[0],s[c++]=f[1],s[c++]=f[2]}return s};Dr.subdivideTexcoordRhumbLine=function(e,t,n,i,o,r,a){let s=n.cartesianToCartographic(i,e8),c=n.cartesianToCartographic(o,t8);$V.setEndPoints(s,c);let u=$V.surfaceDistance/r,f=Math.max(0,Math.ceil(D.log2(u))),h=Math.pow(2,f),p=k.distance(e,t),A=p/h,m=a;m.length=h*2;let _=0;for(let y=0;y<h;y++){let C=Rfe(e,t,y*A,p);m[_++]=C[0],m[_++]=C[1]}return m};Dr.subdivideRhumbLine=function(e,t,n,i,o){let r=e.cartesianToCartographic(t,e8),a=e.cartesianToCartographic(n,t8),s=new Sc(r,a,e);if(l(o)||(o=[]),s.surfaceDistance<=i)return o.length=3,o[0]=t.x,o[1]=t.y,o[2]=t.z,o;let c=s.surfaceDistance/i,u=Math.max(0,Math.ceil(D.log2(c))),f=Math.pow(2,u),h=s.surfaceDistance/f,p=o;p.length=f*3;let A=0;for(let m=0;m<f;m++){let _=s.interpolateUsingSurfaceDistance(m*h,A9e),y=e.cartographicToCartesian(_,g9e);p[A++]=y.x,p[A++]=y.y,p[A++]=y.z}return p};var _9e=new d,y9e=new d,C9e=new d,E9e=new d;Dr.scaleToGeodeticHeightExtruded=function(e,t,n,i,o){i=i??te.default;let r=_9e,a=y9e,s=C9e,c=E9e;if(l(e)&&l(e.attributes)&&l(e.attributes.position)){let u=e.attributes.position.values,f=u.length/2;for(let h=0;h<f;h+=3)d.fromArray(u,h,s),i.geodeticSurfaceNormal(s,r),c=i.scaleToGeodeticSurface(s,c),a=d.multiplyByScalar(r,n,a),a=d.add(c,a,a),u[h+f]=a.x,u[h+1+f]=a.y,u[h+2+f]=a.z,o&&(c=d.clone(s,c)),a=d.multiplyByScalar(r,t,a),a=d.add(c,a,a),u[h]=a.x,u[h+1]=a.y,u[h+2]=a.z}return e};Dr.polygonOutlinesFromHierarchy=function(e,t,n){let i=[],o=new vy;o.enqueue(e);let r,a,s;for(;o.length!==0;){let c=o.dequeue(),u=c.positions;if(t)for(s=u.length,r=0;r<s;r++)n.scaleToGeodeticSurface(u[r],u[r]);if(u=Ho(u,d.equalsEpsilon,!0),u.length<3)continue;let f=c.holes?c.holes.length:0;for(r=0;r<f;r++){let h=c.holes[r],p=h.positions;if(t)for(s=p.length,a=0;a<s;++a)n.scaleToGeodeticSurface(p[a],p[a]);if(p=Ho(p,d.equalsEpsilon,!0),p.length<3)continue;i.push(p);let A=0;for(l(h.holes)&&(A=h.holes.length),a=0;a<A;a++)o.enqueue(h.holes[a])}i.push(u)}return i};var b9e=new me;function I9e(e,t,n){let i=n.cartesianToCartographic(e,e8),o=n.cartesianToCartographic(t,t8);if(Math.sign(i.latitude)===Math.sign(o.latitude))return;$V.setEndPoints(i,o);let r=$V.findIntersectionWithLatitude(0,b9e);if(!l(r))return;let a=Math.min(i.longitude,o.longitude),s=Math.max(i.longitude,o.longitude);if(Math.abs(s-a)>D.PI){let c=a;a=s,s=c}if(!(r.longitude<a||r.longitude>s))return n.cartographicToCartesian(r)}function x9e(e,t,n,i){if(i===ln.RHUMB)return I9e(e,t,n);let o=di.lineSegmentPlane(e,t,cn.ORIGIN_XY_PLANE);if(l(o))return n.scaleToGeodeticSurface(o,o)}var T9e=new me;function S9e(e,t,n){let i=[],o,r,a,s,c,u=0;for(;u<e.length;){o=e[u],r=e[(u+1)%e.length],a=D.sign(o.z),s=D.sign(r.z);let f=h=>t.cartesianToCartographic(h,T9e).longitude;if(a===0)i.push({position:u,type:a,visited:!1,next:s,theta:f(o)});else if(s!==0){if(c=x9e(o,r,t,n),++u,!l(c))continue;e.splice(u,0,c),i.push({position:u,type:a,visited:!1,next:s,theta:f(c)})}++u}return i}function Mfe(e,t,n,i,o,r,a){let s=[],c=r,u=h=>p=>p.position===h,f=[];do{let h=n[c];s.push(h);let p=i.findIndex(u(c)),A=i[p];if(!l(A)){++c;continue}let{visited:m,type:_,next:y}=A;if(A.visited=!0,_===0){if(y===0){let x=i[p-(a?1:-1)];if(x?.position===c+1)x.visited=!0;else{++c;continue}}if(!m&&a&&y>0||r===c&&!a&&y<0){++c;continue}}if(!(a?_>=0:_<=0)){++c;continue}m||f.push(c);let E=p+(a?1:-1),b=i[E];if(!l(b)){++c;continue}c=b.position}while(c<n.length&&c>=0&&c!==r&&s.length<n.length);e.splice(t,o,s);for(let h of f)t=Mfe(e,++t,n,i,0,h,!a);return t}Dr.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],a=r.slice();if(r.length<3){i[o]=a,++o;continue}let s=S9e(a,t,n);if(a.length===r.length||s.length<=1){i[o]=a,++o;continue}s.sort((u,f)=>u.theta-f.theta);let c=a[0].z>=0;o=Mfe(i,o,a,s,1,0,c)}return i};Dr.polygonsFromHierarchy=function(e,t,n,i,o,r){let a=[],s=[],c=new vy;c.enqueue(e);let u=l(r);for(;c.length!==0;){let f=c.dequeue(),h=f.positions,p=f.holes,A,m;if(i)for(m=h.length,A=0;A<m;A++)o.scaleToGeodeticSurface(h[A],h[A]);if(t||(h=Ho(h,d.equalsEpsilon,!0)),h.length<3)continue;let _=n(h);if(!l(_))continue;let y=[],C=Ti.computeWindingOrder2D(_);if(C===Ya.CLOCKWISE&&(_.reverse(),h=h.slice().reverse()),u){u=!1;let B=[h];if(B=r(B,B),B.length>1){for(let v of B)c.enqueue(new wc(v,p));continue}}let E=h.slice(),b=l(p)?p.length:0,x=[],S;for(A=0;A<b;A++){let B=p[A],v=B.positions;if(i)for(m=v.length,S=0;S<m;++S)o.scaleToGeodeticSurface(v[S],v[S]);if(t||(v=Ho(v,d.equalsEpsilon,!0)),v.length<3)continue;let P=n(v);if(!l(P))continue;C=Ti.computeWindingOrder2D(P),C===Ya.CLOCKWISE&&(P.reverse(),v=v.slice().reverse()),x.push(v),y.push(E.length),E=E.concat(v),_=_.concat(P);let N=0;for(l(B.holes)&&(N=B.holes.length),S=0;S<N;S++)c.enqueue(B.holes[S])}a.push({outerRing:h,holes:x}),s.push({positions:E,positions2D:_,holes:y})}return{hierarchy:a,polygons:s}};var w9e=new k,B9e=new d,D9e=new Qe,v9e=new J;Dr.computeBoundingRectangle=function(e,t,n,i,o){let r=Qe.fromAxisAngle(e,i,D9e),a=J.fromQuaternion(r,v9e),s=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,h=n.length;for(let p=0;p<h;++p){let A=d.clone(n[p],B9e);J.multiplyByVector(a,A,A);let m=t(A,w9e);l(m)&&(s=Math.min(s,m.x),c=Math.max(c,m.x),u=Math.min(u,m.y),f=Math.max(f,m.y))}return o.x=s,o.y=u,o.width=c-s,o.height=f-u,o};Dr.createGeometryFromPositions=function(e,t,n,i,o,r,a){let s=Ti.triangulate(t.positions2D,t.holes);s.length<3&&(s=[0,1,2]);let c=t.positions,u=l(n),f=u?n.positions:void 0;if(o){let h=c.length,p=new Array(h*3),A=0;for(let y=0;y<h;y++){let C=c[y];p[A++]=C.x,p[A++]=C.y,p[A++]=C.z}let m={attributes:{position:new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:p})},indices:s,primitiveType:ve.TRIANGLES};u&&(m.attributes.st=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:k.packArray(f)}));let _=new yt(m);return r.normal?Wn.computeNormal(_):_}if(a===ln.GEODESIC)return Ti.computeSubdivision(e,c,s,f,i);if(a===ln.RHUMB)return Ti.computeRhumbLineSubdivision(e,c,s,f,i)};var vfe=[],Pfe=[],P9e=new d,R9e=new d;Dr.computeWallGeometry=function(e,t,n,i,o,r){let a,s,c,u,f,h,p,A,m,_=e.length,y=0,C=0,E=l(t),b=E?t.positions:void 0;if(o)for(s=_*3*2,a=new Array(s*2),E&&(m=_*2*2,A=new Array(m*2)),c=0;c<_;c++)u=e[c],f=e[(c+1)%_],a[y]=a[y+s]=u.x,++y,a[y]=a[y+s]=u.y,++y,a[y]=a[y+s]=u.z,++y,a[y]=a[y+s]=f.x,++y,a[y]=a[y+s]=f.y,++y,a[y]=a[y+s]=f.z,++y,E&&(h=b[c],p=b[(c+1)%_],A[C]=A[C+m]=h.x,++C,A[C]=A[C+m]=h.y,++C,A[C]=A[C+m]=p.x,++C,A[C]=A[C+m]=p.y,++C);else{let P=D.chordLength(i,n.maximumRadius),N=0;if(r===ln.GEODESIC)for(c=0;c<_;c++)N+=Dr.subdivideLineCount(e[c],e[(c+1)%_],P);else if(r===ln.RHUMB)for(c=0;c<_;c++)N+=Dr.subdivideRhumbLineCount(n,e[c],e[(c+1)%_],P);for(s=(N+_)*3,a=new Array(s*2),E&&(m=(N+_)*2,A=new Array(m*2)),c=0;c<_;c++){u=e[c],f=e[(c+1)%_];let L,g;E&&(h=b[c],p=b[(c+1)%_]),r===ln.GEODESIC?(L=Dr.subdivideLine(u,f,P,Pfe),E&&(g=Dr.subdivideTexcoordLine(h,p,u,f,P,vfe))):r===ln.RHUMB&&(L=Dr.subdivideRhumbLine(n,u,f,P,Pfe),E&&(g=Dr.subdivideTexcoordRhumbLine(h,p,n,u,f,P,vfe)));let I=L.length;for(let T=0;T<I;++T,++y)a[y]=L[T],a[y+s]=L[T];if(a[y]=f.x,a[y+s]=f.x,++y,a[y]=f.y,a[y+s]=f.y,++y,a[y]=f.z,a[y+s]=f.z,++y,E){let T=g.length;for(let w=0;w<T;++w,++C)A[C]=g[w],A[C+m]=g[w];A[C]=p.x,A[C+m]=p.x,++C,A[C]=p.y,A[C+m]=p.y,++C}}}_=a.length;let x=Ue.createTypedArray(_/3,_-e.length*6),S=0;for(_/=6,c=0;c<_;c++){let P=c,N=P+1,L=P+_,g=L+1;u=d.fromArray(a,P*3,P9e),f=d.fromArray(a,N*3,R9e),!d.equalsEpsilon(u,f,D.EPSILON10,D.EPSILON10)&&(x[S++]=P,x[S++]=L,x[S++]=N,x[S++]=N,x[S++]=L,x[S++]=g)}let B={attributes:new _n({position:new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:a})}),indices:x,primitiveType:ve.TRIANGLES};return E&&(B.attributes.st=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:A})),new yt(B)};var ni=Dr;function ma(e,t){this.position=e,l(this.position)||(this.position=new k),this.tangentPlane=t,l(this.tangentPlane)||(this.tangentPlane=ma.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(ma.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=k.magnitude(this.position),t=2*this.ellipsoid.maximumRadius;return this.tangentPlane.plane.normal.z*(D.PI_OVER_TWO-2*Math.atan2(e,t))}},longitude:{get:function(){let e=D.PI_OVER_TWO+Math.atan2(this.y,this.x);return e>Math.PI&&(e-=D.TWO_PI),e}}});var pT=new me,M9e=new d;ma.prototype.getLatitude=function(e){l(e)||(e=te.default),pT.latitude=this.conformalLatitude,pT.longitude=this.longitude,pT.height=0;let t=this.ellipsoid.cartographicToCartesian(pT,M9e);return e.cartesianToCartographic(t,pT),pT.latitude};var N9e=new yn,L9e=new d,O9e=new d;ma.fromCartesian=function(e,t){let n=D.signNotZero(e.z),i=ma.NORTH_POLE_TANGENT_PLANE,o=ma.SOUTH_POLE;n<0&&(i=ma.SOUTH_POLE_TANGENT_PLANE,o=ma.NORTH_POLE);let r=N9e;r.origin=i.ellipsoid.scaleToGeocentricSurface(e,r.origin),r.direction=d.subtract(r.origin,o,L9e),d.normalize(r.direction,r.direction);let a=di.rayPlane(r,i.plane,O9e),s=d.subtract(a,o,a),c=d.dot(i.xAxis,s),u=n*d.dot(i.yAxis,s);return l(t)?(t.position=new k(c,u),t.tangentPlane=i,t):new ma(new k(c,u),i)};ma.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]=ma.fromCartesian(e[i],t[i]);return t};ma.clone=function(e,t){if(l(e))return l(t)?(t.position=e.position,t.tangentPlane=e.tangentPlane,t):new ma(e.position,e.tangentPlane)};ma.HALF_UNIT_SPHERE=Object.freeze(new te(.5,.5,.5));ma.NORTH_POLE=Object.freeze(new d(0,0,.5));ma.SOUTH_POLE=Object.freeze(new d(0,0,-.5));ma.NORTH_POLE_TANGENT_PLANE=Object.freeze(new Pa(ma.NORTH_POLE,ma.HALF_UNIT_SPHERE));ma.SOUTH_POLE_TANGENT_PLANE=Object.freeze(new Pa(ma.SOUTH_POLE,ma.HALF_UNIT_SPHERE));var $c=ma;var F9e=new me,Nfe=new me;function Q9e(e,t,n,i){let r=i.cartesianToCartographic(e,F9e).height,a=i.cartesianToCartographic(t,Nfe);a.height=r,i.cartographicToCartesian(a,t);let s=i.cartesianToCartographic(n,Nfe);s.height=r-100,i.cartographicToCartesian(s,n)}var Lfe=new et,k9e=new d,U9e=new d,z9e=new d,G9e=new d,V9e=new d,H9e=new d,n8=new d,Cp=new d,AT=new d,W9e=new k,j9e=new k,Y9e=new d,Ofe=new Qe,q9e=new J,K9e=new J;function Eq(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,a=o.length,s=e.wall,c=e.top||s,u=e.bottom||s;if(t.st||t.normal||t.tangent||t.bitangent||i){let f=e.boundingRectangle,h=e.rotationAxis,p=e.projectTo2d,A=e.ellipsoid,m=e.stRotation,_=e.perPositionHeight,y=W9e;y.x=f.x,y.y=f.y;let C=t.st?new Float32Array(2*(a/3)):void 0,E;t.normal&&(_&&c&&!s?E=n.attributes.normal.values:E=new Float32Array(a));let b=t.tangent?new Float32Array(a):void 0,x=t.bitangent?new Float32Array(a):void 0,S=i?new Float32Array(a):void 0,B=0,v=0,P=U9e,N=z9e,L=G9e,g=!0,I=q9e,T=K9e;if(m!==0){let O=Qe.fromAxisAngle(h,m,Ofe);I=J.fromQuaternion(O,I),O=Qe.fromAxisAngle(h,-m,Ofe),T=J.fromQuaternion(O,T)}else I=J.clone(J.IDENTITY,I),T=J.clone(J.IDENTITY,T);let w=0,R=0;c&&u&&(w=a/2,R=a/3,a/=2);for(let O=0;O<a;O+=3){let G=d.fromArray(o,O,Y9e);if(t.st&&!l(r)){let F=J.multiplyByVector(I,G,k9e);F=A.scaleToGeodeticSurface(F,F);let U=p([F],j9e)[0];k.subtract(U,y,U);let Q=D.clamp(U.x/f.width,0,1),H=D.clamp(U.y/f.height,0,1);u&&(C[B+R]=Q,C[B+1+R]=H),c&&(C[B]=Q,C[B+1]=H),B+=2}if(t.normal||t.tangent||t.bitangent||i){let F=v+1,U=v+2;if(s){if(O+3<a){let Q=d.fromArray(o,O+3,V9e);if(g){let H=d.fromArray(o,O+a,H9e);_&&Q9e(G,Q,H,A),d.subtract(Q,G,Q),d.subtract(H,G,H),P=d.normalize(d.cross(H,Q,P),P),g=!1}d.equalsEpsilon(Q,G,D.EPSILON10)&&(g=!0)}(t.tangent||t.bitangent)&&(L=A.geodeticSurfaceNormal(G,L),t.tangent&&(N=d.normalize(d.cross(L,P,N),N)))}else P=A.geodeticSurfaceNormal(G,P),(t.tangent||t.bitangent)&&(_&&(n8=d.fromArray(E,v,n8),Cp=d.cross(d.UNIT_Z,n8,Cp),Cp=d.normalize(J.multiplyByVector(T,Cp,Cp),Cp),t.bitangent&&(AT=d.normalize(d.cross(n8,Cp,AT),AT))),N=d.cross(d.UNIT_Z,P,N),N=d.normalize(J.multiplyByVector(T,N,N),N),t.bitangent&&(L=d.normalize(d.cross(P,N,L),L)));t.normal&&(e.wall?(E[v+w]=P.x,E[F+w]=P.y,E[U+w]=P.z):u&&(E[v+w]=-P.x,E[F+w]=-P.y,E[U+w]=-P.z),(c&&!_||s)&&(E[v]=P.x,E[F]=P.y,E[U]=P.z)),i&&(s&&(P=A.geodeticSurfaceNormal(G,P)),S[v+w]=-P.x,S[F+w]=-P.y,S[U+w]=-P.z),t.tangent&&(e.wall?(b[v+w]=N.x,b[F+w]=N.y,b[U+w]=N.z):u&&(b[v+w]=-N.x,b[F+w]=-N.y,b[U+w]=-N.z),c&&(_?(b[v]=Cp.x,b[F]=Cp.y,b[U]=Cp.z):(b[v]=N.x,b[F]=N.y,b[U]=N.z))),t.bitangent&&(u&&(x[v+w]=L.x,x[F+w]=L.y,x[U+w]=L.z),c&&(_?(x[v]=AT.x,x[F]=AT.y,x[U]=AT.z):(x[v]=L.x,x[F]=L.y,x[U]=L.z))),v+=3}}t.st&&!l(r)&&(n.attributes.st=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:C})),t.normal&&(n.attributes.normal=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:E})),t.tangent&&(n.attributes.tangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:b})),t.bitangent&&(n.attributes.bitangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:x})),i&&(n.attributes.extrudeDirection=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:S}))}if(e.extrude&&l(e.offsetAttribute)){let f=o.length/3,h=new Uint8Array(f);if(e.offsetAttribute===mn.TOP)c&&u||s?h=h.fill(1,0,f/2):c&&(h=h.fill(1));else{let p=e.offsetAttribute===mn.NONE?0:1;h=h.fill(p)}n.attributes.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return n}var Ffe=[];function X9e(e,t,n,i,o,r,a,s,c,u){let f={walls:[]},h;if(a||s){let E=ni.createGeometryFromPositions(e,t,n,i,r,c,u),b=E.attributes.position.values,x=E.indices,S,B;if(a&&s){let v=b.concat(b);S=v.length/3,B=Ue.createTypedArray(S,x.length*2),B.set(x);let P=x.length,N=S/2;for(h=0;h<P;h+=3){let L=B[h]+N,g=B[h+1]+N,I=B[h+2]+N;B[h+P]=I,B[h+1+P]=g,B[h+2+P]=L}if(E.attributes.position.values=v,r&&c.normal){let L=E.attributes.normal.values;E.attributes.normal.values=new Float32Array(v.length),E.attributes.normal.values.set(L)}if(c.st&&l(n)){let L=E.attributes.st.values;E.attributes.st.values=new Float32Array(S*2),E.attributes.st.values=L.concat(L)}E.indices=B}else if(s){for(S=b.length/3,B=Ue.createTypedArray(S,x.length),h=0;h<x.length;h+=3)B[h]=x[h+2],B[h+1]=x[h+1],B[h+2]=x[h];E.indices=B}f.topAndBottom=new Mt({geometry:E})}let p=o.outerRing,A=Pa.fromPoints(p,e),m=A.projectPointsOntoPlane(p,Ffe),_=Ti.computeWindingOrder2D(m);_===Ya.CLOCKWISE&&(p=p.slice().reverse());let y=ni.computeWallGeometry(p,n,e,i,r,u);f.walls.push(new Mt({geometry:y}));let C=o.holes;for(h=0;h<C.length;h++){let E=C[h];m=A.projectPointsOntoPlane(E,Ffe),_=Ti.computeWindingOrder2D(m),_===Ya.COUNTER_CLOCKWISE&&(E=E.slice().reverse()),y=ni.computeWallGeometry(E,n,e,i,r,u),f.walls.push(new Mt({geometry:y}))}return f}function Dd(e){let t=e.polygonHierarchy,n=e.vertexFormat??ke.DEFAULT,i=e.ellipsoid??te.default,o=e.granularity??D.RADIANS_PER_DEGREE,r=e.stRotation??0,a=e.textureCoordinates,s=e.perPositionHeight??!1,c=s&&l(e.extrudedHeight),u=e.height??0,f=e.extrudedHeight??u;if(!c){let h=Math.max(u,f);f=Math.min(u,f),u=h}this._vertexFormat=ke.clone(n),this._ellipsoid=te.clone(i),this._granularity=o,this._stRotation=r,this._height=u,this._extrudedHeight=f,this._closeTop=e.closeTop??!0,this._closeBottom=e.closeBottom??!0,this._polygonHierarchy=t,this._perPositionHeight=s,this._perPositionHeightExtrude=c,this._shadowVolume=e.shadowVolume??!1,this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=e.arcType??ln.GEODESIC,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=a,this.packedLength=ni.computeHierarchyPackedLength(t,d)+te.packedLength+ke.packedLength+(a?ni.computeHierarchyPackedLength(a,k):1)+12}Dd.fromPositions=function(e){e=e??V.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 Dd(t)};Dd.pack=function(e,t,n){return n=n??0,n=ni.packPolygonHierarchy(e._polygonHierarchy,t,n,d),te.pack(e._ellipsoid,t,n),n+=te.packedLength,ke.pack(e._vertexFormat,t,n),n+=ke.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++]=e._offsetAttribute??-1,t[n++]=e._arcType,l(e._textureCoordinates)?n=ni.packPolygonHierarchy(e._textureCoordinates,t,n,k):t[n++]=-1,t[n++]=e.packedLength,t};var J9e=te.clone(te.UNIT_SPHERE),Z9e=new ke,$9e={polygonHierarchy:{}};Dd.unpack=function(e,t,n){t=t??0;let i=ni.unpackPolygonHierarchy(e,t,d);t=i.startingIndex,delete i.startingIndex;let o=te.unpack(e,t,J9e);t+=te.packedLength;let r=ke.unpack(e,t,Z9e);t+=ke.packedLength;let a=e[t++],s=e[t++],c=e[t++],u=e[t++],f=e[t++]===1,h=e[t++]===1,p=e[t++]===1,A=e[t++]===1,m=e[t++]===1,_=e[t++],y=e[t++],C=e[t]===-1?void 0:ni.unpackPolygonHierarchy(e,t,k);l(C)?(t=C.startingIndex,delete C.startingIndex):t++;let E=e[t++];return l(n)||(n=new Dd($9e)),n._polygonHierarchy=i,n._ellipsoid=te.clone(o,n._ellipsoid),n._vertexFormat=ke.clone(r,n._vertexFormat),n._height=a,n._extrudedHeight=s,n._granularity=c,n._stRotation=u,n._perPositionHeightExtrude=f,n._perPositionHeight=h,n._closeTop=p,n._closeBottom=A,n._shadowVolume=m,n._offsetAttribute=_===-1?void 0:_,n._arcType=y,n._textureCoordinates=C,n.packedLength=E,n};var e5e=new k,t5e=new k,n5e=new $c;function Qfe(e,t,n,i,o,r){let a=e.longitude,s=a>=0?a:a+D.TWO_PI;o.westOverIdl=Math.min(o.westOverIdl,s),o.eastOverIdl=Math.max(o.eastOverIdl,s),r.west=Math.min(r.west,a),r.east=Math.max(r.east,a);let c=e.getLatitude(n),u=c;if(r.south=Math.min(r.south,c),r.north=Math.max(r.north,c),i!==ln.RHUMB){let p=k.subtract(t.position,e.position,e5e),A=k.dot(t.position,p)/k.dot(p,p);if(A>0&&A<1){let m=k.add(t.position,k.multiplyByScalar(p,-A,p),t5e),_=$c.clone(t,n5e);_.position=m;let y=_.getLatitude(n);r.south=Math.min(r.south,y),r.north=Math.max(r.north,y),Math.abs(c)>Math.abs(y)&&(u=y)}}let f=t.x*e.y-e.x*t.y,h=Math.sign(f);h!==0&&(h*=k.angleBetween(t.position,e.position)),u>=0&&(o.northAngle+=h),u<=0&&(o.southAngle+=h)}var kfe=new $c,i5e=new $c,Bd={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};Dd.computeRectangleFromPositions=function(e,t,n,i){if(l(i)||(i=new ce),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,Bd.northAngle=0,Bd.southAngle=0,Bd.westOverIdl=Number.POSITIVE_INFINITY,Bd.eastOverIdl=Number.NEGATIVE_INFINITY;let o=e.length,r=$c.fromCartesian(e[0],i5e);for(let a=1;a<o;a++){let s=$c.fromCartesian(e[a],kfe);Qfe(s,r,t,n,Bd,i),r=$c.clone(s,r)}return Qfe($c.fromCartesian(e[0],kfe),r,t,n,Bd,i),i.east-i.west>Bd.eastOverIdl-Bd.westOverIdl&&(i.west=Bd.westOverIdl,i.east=Bd.eastOverIdl,i.east>D.PI&&(i.east=i.east-D.TWO_PI),i.west>D.PI&&(i.west=i.west-D.TWO_PI)),D.equalsEpsilon(Math.abs(Bd.northAngle),D.TWO_PI,D.EPSILON10)&&(i.north=D.PI_OVER_TWO,i.east=D.PI,i.west=-D.PI),D.equalsEpsilon(Math.abs(Bd.southAngle),D.TWO_PI,D.EPSILON10)&&(i.south=-D.PI_OVER_TWO,i.east=D.PI,i.west=-D.PI),i};var o5e=new $c;function r5e(e,t,n){return e.height>=D.PI||e.width>=D.PI?$c.fromCartesian(t[0],o5e).tangentPlane:Pa.fromPoints(t,n)}var Ufe=new me;function a5e(e,t,n){return(i,o)=>{if(e.height>=D.PI||e.width>=D.PI){if(e.south<0&&e.north>0){l(o)||(o=[]);for(let a=0;a<i.length;++a){let s=n.cartesianToCartographic(i[a],Ufe);o[a]=new k(s.longitude/D.PI,s.latitude/D.PI_OVER_TWO)}return o.length=i.length,o}return $c.fromCartesianArray(i,o)}return Pa.fromPoints(t,n).projectPointsOntoPlane(i,o)}}function s5e(e,t,n){if(e.height>=D.PI||e.width>=D.PI)return(o,r)=>{if(e.south<0&&e.north>0){let a=n.cartesianToCartographic(o,Ufe);return l(r)||(r=new k),r.x=a.longitude/D.PI,r.y=a.latitude/D.PI_OVER_TWO,r}return $c.fromCartesian(o,r)};let i=Pa.fromPoints(t,n);return(o,r)=>i.projectPointsOntoPlane(o,r)}function c5e(e,t,n,i){return(o,r)=>!i&&(e.height>=D.PI_OVER_TWO||e.width>=2*D.PI_OVER_THREE)?ni.splitPolygonsOnEquator(o,t,n,r):o}function l5e(e,t,n,i){if(t.height>=D.PI||t.width>=D.PI)return et.fromRectangle(t,void 0,Lfe);let o=e,r=Pa.fromPoints(o,n);return ni.computeBoundingRectangle(r.plane.normal,r.projectPointOntoPlane.bind(r),o,i,Lfe)}Dd.createGeometry=function(e){let t=e._vertexFormat,n=e._ellipsoid,i=e._granularity,o=e._stRotation,r=e._polygonHierarchy,a=e._perPositionHeight,s=e._closeTop,c=e._closeBottom,u=e._arcType,f=e._textureCoordinates,h=l(f),p=r.positions;if(p.length<3)return;let A=e.rectangle,m=ni.polygonsFromHierarchy(r,h,a5e(A,p,n),!a,n,c5e(A,n,u,a)),_=m.hierarchy,y=m.polygons,C=function(w){return w},E=h?ni.polygonsFromHierarchy(f,!0,C,!1,n).polygons:void 0;if(_.length===0)return;let b=_[0].outerRing,x=l5e(b,A,n,o),S=[],B=e._height,v=e._extrudedHeight,P=e._perPositionHeightExtrude||!D.equalsEpsilon(B,v,0,D.EPSILON2),N={perPositionHeight:a,vertexFormat:t,geometry:void 0,rotationAxis:r5e(A,b,n).plane.normal,projectTo2d:s5e(A,b,n),boundingRectangle:x,ellipsoid:n,stRotation:o,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:u},L;if(P)for(N.extrude=!0,N.top=s,N.bottom=c,N.shadowVolume=e._shadowVolume,N.offsetAttribute=e._offsetAttribute,L=0;L<y.length;L++){let w=X9e(n,y[L],h?E[L]:void 0,i,_[L],a,s,c,t,u),R;s&&c?(R=w.topAndBottom,N.geometry=ni.scaleToGeodeticHeightExtruded(R.geometry,B,v,n,a)):s?(R=w.topAndBottom,R.geometry.attributes.position.values=Ti.scaleToGeodeticHeight(R.geometry.attributes.position.values,B,n,!a),N.geometry=R.geometry):c&&(R=w.topAndBottom,R.geometry.attributes.position.values=Ti.scaleToGeodeticHeight(R.geometry.attributes.position.values,v,n,!0),N.geometry=R.geometry),(s||c)&&(N.wall=!1,R.geometry=Eq(N),S.push(R));let O=w.walls;N.wall=!0;for(let G=0;G<O.length;G++){let F=O[G];N.geometry=ni.scaleToGeodeticHeightExtruded(F.geometry,B,v,n,a),F.geometry=Eq(N),S.push(F)}}else for(L=0;L<y.length;L++){let w=new Mt({geometry:ni.createGeometryFromPositions(n,y[L],h?E[L]:void 0,i,a,t,u)});if(w.geometry.attributes.position.values=Ti.scaleToGeodeticHeight(w.geometry.attributes.position.values,B,n,!a),N.geometry=w.geometry,w.geometry=Eq(N),l(e._offsetAttribute)){let R=w.geometry.attributes.position.values.length,O=e._offsetAttribute===mn.NONE?0:1,G=new Uint8Array(R/3).fill(O);w.geometry.attributes.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:G})}S.push(w)}let g=Wn.combineInstances(S)[0];g.attributes.position.values=new Float64Array(g.attributes.position.values),g.indices=Ue.createTypedArray(g.attributes.position.values.length/3,g.indices);let I=g.attributes,T=le.fromVertices(I.position.values);return t.position||delete I.position,new yt({attributes:I,indices:g.indices,primitiveType:g.primitiveType,boundingSphere:T,offsetAttribute:e._offsetAttribute})};Dd.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),a=n(i,o);return new Dd({polygonHierarchy:e._polygonHierarchy,ellipsoid:o,stRotation:e._stRotation,granularity:i,perPositionHeight:!1,extrudedHeight:r,height:a,vertexFormat:ke.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})};function u5e(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 yt._textureCoordinateRotationPoints(i,t,n,o)}Object.defineProperties(Dd.prototype,{rectangle:{get:function(){if(!l(this._rectangle)){let e=this._polygonHierarchy.positions;this._rectangle=Dd.computeRectangleFromPositions(e,this._ellipsoid,this._arcType)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=u5e(this)),this._textureCoordinateRotationPoints}}});var cg=Dd;function T0(e){this._ellipsoid=e.ellipsoid??te.default,this._positions=Gfe(e.positions),this._cachedPositions=void 0,this._cachedRectangle=void 0}function Gfe(e){if(!l(e))return;let t=e.length,n=Array(t);for(let i=0;i<t;i++)n[i]=d.clone(e[i]);return n}function f5e(e,t){if(!l(e)&&!l(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++){let o=e[i],r=t[i];if(!d.equals(o,r))return!1}return!0}Object.defineProperties(T0.prototype,{length:{get:function(){return this._positions.length}},positions:{get:function(){return this._positions}},ellipsoid:{get:function(){return this._ellipsoid}}});T0.clone=function(e,t){return l(t)?(t._ellipsoid=e.ellipsoid,t._positions.length=0,t._positions.push(...e.positions),t):new T0({positions:e.positions,ellipsoid:e.ellipsoid})};T0.equals=function(e,t){return e.ellipsoid.equals(t.ellipsoid)&&e.positions===t.positions};T0.prototype.computeRectangle=function(e){if(f5e(this._positions,this._cachedPositions))return ce.clone(this._cachedRectangle,e);let t=cg.computeRectangleFromPositions(this.positions,this.ellipsoid,void 0,e);return this._cachedPositions=Gfe(this._positions),this._cachedRectangle=ce.clone(t),t};var d5e=new ce,zfe=new d;T0.prototype.computeSphericalExtents=function(e){l(e)||(e=new ce);let t=this.computeRectangle(d5e),n=me.toCartesian(ce.southwest(t),this.ellipsoid,zfe),i=Math.sqrt(n.x*n.x+n.y*n.y),o=D.fastApproximateAtan2(i,n.z),r=D.fastApproximateAtan2(n.x,n.y);return e.south=o,e.west=r,n=me.toCartesian(ce.northeast(t),this.ellipsoid,zfe),i=Math.sqrt(n.x*n.x+n.y*n.y),o=D.fastApproximateAtan2(i,n.z),r=D.fastApproximateAtan2(n.x,n.y),e.north=o,e.east=r,e};var gT=T0;var hN=`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);
if (regionIndex >= u_extentsLength) {
return; // done (no polygons in this region)
}
for (int polygonIndex = 0; polygonIndex < u_polygonsLength; polygonIndex++) {
ivec2 positionsLengthAndExtents = getPositionsLengthAndExtentsIndex(lastPolygonIndex);
int positionsLength = positionsLengthAndExtents.x;
int polygonExtentsIndex = positionsLengthAndExtents.y;
lastPolygonIndex += 1;
// Read the individual polygon extent (2 pixels: south/west, latRange/lonRange)
vec2 extentsSouthWest = getPolygonPosition(lastPolygonIndex);
vec2 extentsRange = getPolygonPosition(lastPolygonIndex + 1);
vec4 polygonExtent = vec4(extentsSouthWest, extentsRange);
lastPolygonIndex += 2;
if (polygonExtentsIndex < regionIndex) {
lastPolygonIndex += positionsLength;
continue; // skip to next (TODO: could optimize further if we knew how many polygons to skip)
} else if (polygonExtentsIndex > regionIndex) {
break; // done (we know polygons are sorted by regionIndex)
}
// Only compute signed distance for the relevant part of the atlas
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); // current pixel position
// Only consider polygons whos boundingbox includes current pixel (with a slight padding)
float padding = 0.05; // 5% of polygon extents
float polygonNorth = polygonExtent.x + polygonExtent.z;
float polygonEast = polygonExtent.y + polygonExtent.w;
float latPadding = padding * polygonExtent.z; // padding as fraction of latitude range
float lonPadding = padding * polygonExtent.w; // padding as fraction of longitude range
if (p.x < polygonExtent.x - latPadding || p.x > polygonNorth + latPadding ||
p.y < polygonExtent.y - lonPadding || p.y > polygonEast + lonPadding) {
lastPolygonIndex += positionsLength;
continue; // skip to next
}
float s = 1.0;
// Check each edge for absolute distance.
// Cache the previous vertex to halve the texture reads per iteration.
vec2 prev = getPolygonPosition(lastPolygonIndex + positionsLength - 1);
for (int i = 0; i < positionsLength; i++) {
vec2 a = getPolygonPosition(lastPolygonIndex + i);
vec2 b = prev;
prev = a;
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 La(e){e=e??V.EMPTY_OBJECT,this._polygons=[],this._totalPositions=0,this.debugShowDistanceTexture=e.debugShowDistanceTexture??!1,this.enabled=e.enabled??!0,this.inverse=e.inverse??!1,this.quality=e.quality??1,this.polygonAdded=new _e,this.polygonRemoved=new _e,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(La.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+3*this.length}},clippingTexture:{get:function(){return this._signedDistanceTexture}},owner:{get:function(){return this._owner}},clippingPolygonsState:{get:function(){return this.inverse?-this.extentsCount:this.extentsCount}}});La.prototype.add=function(e){let t=this._polygons.length;return this._polygons.push(e),this.polygonAdded.raiseEvent(e,t),e};La.prototype.get=function(e){return this._polygons[e]};La.prototype.contains=function(e){return this._polygons.some(t=>gT.equals(t,e))};La.prototype.remove=function(e){let t=this._polygons,n=t.findIndex(i=>gT.equals(i,e));return n===-1?!1:(t.splice(n,1),this.polygonRemoved.raiseEvent(e,n),!0)};function h5e(e,t,n){let i=Math.max(e.height*t,0),o=Math.max(e.width*t,0),r=ce.clone(e,n);return r.south-=i,r.west-=o,r.north+=i,r.east+=o,r.south=Math.max(r.south,-Math.PI),r.west=Math.max(r.west,-Math.PI),r.north=Math.min(r.north,Math.PI),r.east=Math.min(r.east,Math.PI),r}function m5e(e,t){let i=[],o=e.length;for(let s=0;s<o;++s){let c=h5e(t[s],2.5),u=-1;for(let f=0;f<i.length;++f)if(l(ce.simpleIntersection(i[f].extent,c))){u=f;break}if(u===-1)i.push({extent:c,polygonIndices:[s]});else{let f=i[u];f.polygonIndices.push(s),ce.union(f.extent,c,f.extent);for(let h=0;h<i.length;++h)h!==u&&l(ce.simpleIntersection(i[h].extent,f.extent))&&(f.polygonIndices.push(...i[h].polygonIndices),ce.union(f.extent,i[h].extent,f.extent),i.splice(h,1),h<u&&u--,h=-1)}}let r=i.map(s=>s.extent),a=new Map;return i.forEach((s,c)=>s.polygonIndices.forEach(u=>a.set(u,c))),{extentsList:r,extentsIndexByPolygon:a}}La.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 p5e(e){let t=e._float32View,n=e._extentsFloat32View,i=e._polygons,o=i.map(f=>f.computeSphericalExtents()),{extentsList:r,extentsIndexByPolygon:a}=m5e(i,o),s=Array.from(i.keys()).sort((f,h)=>a.get(f)-a.get(h)),c=0;for(let f of s){let h=i[f],p=h.length;t[c++]=p,t[c++]=a.get(f);let A=o[f];t[c++]=A.south,t[c++]=A.west,t[c++]=A.north-A.south,t[c++]=A.east-A.west;for(let m=0;m<p;++m){let _=h.positions[m],y=Math.hypot(_.x,_.y),C=D.fastApproximateAtan2(y,_.z),E=D.fastApproximateAtan2(_.x,_.y);t[c++]=C,t[c++]=E}}let u=0;for(let f of r){let h=1/(f.east-f.west),p=1/(f.north-f.south);n[u++]=f.south,n[u++]=f.west,n[u++]=p,n[u++]=h}e._extentsCount=r.length}var bq=new k;La.prototype.update=function(e){let t=e.context;if(!La.isSupported(e))throw new ue("ClippingPolygonCollections are only supported for WebGL 2.");this.debugShowDistanceTexture&&l(this._signedDistanceTexture)&&(l(this.debugCommand)||(this.debugCommand=A5e(this._signedDistanceTexture,e.context)),e.commandList.push(this.debugCommand));let n=this._polygons.reduce((a,s)=>a+s.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 a=i.width*i.height;(a<this.pixelsNeededForPolygonPositions||this.pixelsNeededForPolygonPositions<.25*a)&&(i.destroy(),i=void 0,this._polygonsTexture=void 0)}if(!l(i)){let a=La.getTextureResolution(i,this.pixelsNeededForPolygonPositions,bq);i=new Dt({context:t,width:a.x,height:a.y,pixelFormat:qe.RG,pixelDatatype:He.FLOAT,sampler:jt.NEAREST,flipY:!1}),this._float32View=new Float32Array(a.x*a.y*2),this._polygonsTexture=i}if(l(o)){let a=o.width*o.height;(a<this.pixelsNeededForExtents||this.pixelsNeededForExtents<.25*a)&&(o.destroy(),o=void 0,this._extentsTexture=void 0)}if(!l(o)){let a=La.getTextureResolution(o,this.pixelsNeededForExtents,bq);o=new Dt({context:t,width:a.x,height:a.y,pixelFormat:qe.RGBA,pixelDatatype:He.FLOAT,sampler:jt.NEAREST,flipY:!1}),this._extentsFloat32View=new Float32Array(a.x*a.y*4),this._extentsTexture=o}if(p5e(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 a=La.getClippingDistanceTextureResolution(this,bq);r=new Dt({context:t,width:a.x,height:a.y,pixelFormat:t.webgl2?qe.RED:qe.LUMINANCE,pixelDatatype:He.FLOAT,sampler:new jt({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:ci.LINEAR}),flipY:!1}),this._signedDistanceTexture=r}this._signedDistanceComputeCommand=g5e(this)};function A5e(e,t){let i=t.createViewportQuadCommand(`uniform highp sampler2D billboard_texture;
in vec2 v_textureCoordinates;
float getSignedDistance(vec2 uv, highp sampler2D clippingDistance) {
float signedDistance = texture(clippingDistance, uv).r;
return (signedDistance - 0.5) * 2.0;
}
void main()
{
float dist = texture(billboard_texture, v_textureCoordinates).r;
if (dist > 0.5) {
out_FragColor = vec4(dist, 0.0, 0.0, 1.0);
} else {
out_FragColor = vec4(0.0, dist, 0.0, 1.0);
}
}
`,{uniformMap:{billboard_texture:function(){return e}}});return i.pass=Be.OVERLAY,i}La.prototype.queueCommands=function(e){l(this._signedDistanceComputeCommand)&&e.commandList.push(this._signedDistanceComputeCommand)};function g5e(e){let t=e._polygonsTexture,n=e._extentsTexture;return new xl({fragmentShaderSource:hN,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 Vfe=new ce,_5e=new ce,y5e=new ce;La.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._polygons,i=n.length,o=Xt.OUTSIDE;this.inverse&&(o=Xt.INSIDE);let r=e.rectangle;if(!l(r)&&l(e.boundingVolume?.computeCorners)){let a=e.boundingVolume.computeCorners();r=ce.fromCartesianArray(a,t,Vfe)}l(r)||(r=ce.fromBoundingSphere(e.boundingSphere,t,Vfe));for(let a=0;a<i;++a){let c=n[a].computeRectangle(y5e),u=ce.simpleIntersection(r,c,_5e);if(l(u))return Xt.INTERSECTING}return o};La.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};La.isSupported=function(e){return e?.context.webgl2};La.getTextureResolution=function(e,t,n){if(l(e))return n.x=e.width,n.y=e.height,n;let i=Rt.maximumTextureSize;return n.x=Math.min(t,i),n.y=Math.ceil(t/n.x),n.y*=2,n};La.getClippingDistanceTextureResolution=function(e,t){let n=e.signedDistanceTexture;if(l(n))return t.x=n.width,t.y=n.height,t;let i=e.quality,o=Math.max(128,Math.ceil(4096*i));return t.x=Math.min(Rt.maximumTextureSize,o),t.y=Math.min(Rt.maximumTextureSize,o),t};La.getClippingExtentsTextureResolution=function(e,t){let n=e.extentsTexture;return l(n)?(t.x=n.width,t.y=n.height,t):La.getTextureResolution(n,e.pixelsNeededForExtents,t)};La.prototype.isDestroyed=function(){return!1};La.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(),fe(this)};var jh=La;var mN={NONE:0,SCENE_LIGHT:1,SUNLIGHT:2};mN.fromGlobeFlags=function(e){return e.enableLighting&&e.dynamicAtmosphereLighting?e.dynamicAtmosphereLightingFromSun?mN.SUNLIGHT:mN.SCENE_LIGHT:mN.NONE};var lg=Object.freeze(mN);function Hfe(){this.lightIntensity=10,this.rayleighCoefficient=new d(55e-7,13e-6,284e-7),this.mieCoefficient=new d(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=lg.NONE}Hfe.requiresColorCorrect=function(e){return!(D.equalsEpsilon(e.hueShift,0,D.EPSILON7)&&D.equalsEpsilon(e.saturationShift,0,D.EPSILON7)&&D.equalsEpsilon(e.brightnessShift,0,D.EPSILON7))};var S0=Hfe;var Yh=`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 pN=`uniform samplerCube u_radianceMap;
in vec2 v_textureCoordinates;
const float twoSqrtPi = 2.0 * sqrt(czm_pi);
// Coutesy of https://www.ppsloan.org/publications/StupidSH36.pdf
float computeShBasis(int index, vec3 s) {
if (index == 0) { // l = 0, m = 0
return 1.0 / twoSqrtPi;
}
if (index == 1) { // l = 1, m = -1
return -sqrt(3.0) * s.y / twoSqrtPi;
}
if (index == 2) { // l = 1, m = 0
return sqrt(3.0) * s.z / twoSqrtPi;
}
if (index == 3) { // l = 1, m = 1
return -sqrt(3.0) * s.x / twoSqrtPi;
}
if (index == 4) { // l = 2, m = -2
return sqrt(15.0) * s.y * s.x / twoSqrtPi;
}
if (index == 5) { // l = 2, m = -1
return -sqrt(15.0) * s.y * s.z / twoSqrtPi;
}
if (index == 6) { // l = 2, m = 0
return sqrt(5.0) * (3.0 * s.z * s.z - 1.0) / 2.0 / twoSqrtPi;
}
if (index == 7) { // l = 2, m = 1
return -sqrt(15.0) * s.x * s.z / twoSqrtPi;
}
if (index == 8) { // l = 2, m = 2
return sqrt(15.0) * (s.x * s.x - s.y * s.y) / 2.0 / twoSqrtPi;
}
return 0.0;
}
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));
}
// Sample count is relatively low for the sake of performance, but should still be enough to capture directionality needed for third-order harmonics
const int samples = 256;
const float solidAngle = 1.0 / float(samples);
void main() {
// Get the current coefficient based on the uv
vec2 uv = v_textureCoordinates.xy * 3.0;
int coefficientIndex = int(floor(uv.y) * 3.0 + floor(uv.x));
for (int i = 0; i < samples; ++i) {
vec2 xi = hammersley2D(i, samples);
float phi = czm_twoPi * xi.x;
float cosTheta = 1.0 - 2.0 * sqrt(1.0 - xi.y * xi.y);
float sinTheta = sqrt(1.0 - cosTheta * cosTheta);
vec3 direction = normalize(vec3(sinTheta * cos(phi), cosTheta, sinTheta * sin(phi)));
// Generate the spherical harmonics basis from the direction
float Ylm = computeShBasis(coefficientIndex, direction);
vec3 lookupDirection = -direction.xyz;
lookupDirection.z = -lookupDirection.z;
vec4 color = czm_textureCube(u_radianceMap, lookupDirection, 0.0);
// Use the relevant function for this coefficient
out_FragColor += Ylm * color * solidAngle * sinTheta;
}
}
`;var AN=`precision highp float;
in vec2 v_textureCoordinates;
uniform vec3 u_faceDirection; // Current cubemap face
uniform vec3 u_positionWC;
uniform mat4 u_enuToFixedFrame;
uniform vec4 u_brightnessSaturationGammaIntensity;
uniform vec4 u_groundColor; // alpha component represent albedo
vec4 getCubeMapDirection(vec2 uv, vec3 faceDir) {
vec2 scaledUV = uv * 2.0 - 1.0;
if (faceDir.x != 0.0) {
return vec4(faceDir.x, scaledUV.x * faceDir.x, -scaledUV.y, 0.0);
} else if (faceDir.y != 0.0) {
return vec4(scaledUV.x, -scaledUV.y * faceDir.y, faceDir.y, 0.0);
} else {
return vec4(scaledUV.x * faceDir.z, -faceDir.z, -scaledUV.y, 0.0);
}
}
void main() {
float height = length(u_positionWC);
float atmosphereInnerRadius = u_radiiAndDynamicAtmosphereColor.y;
float ellipsoidHeight = max(height - atmosphereInnerRadius, 0.0);
// Scale the position to ensure the sky color is present, even when underground.
vec3 positionWC = u_positionWC / height * (ellipsoidHeight + atmosphereInnerRadius);
float atmosphereOuterRadius = u_radiiAndDynamicAtmosphereColor.x;
float atmosphereHeight = atmosphereOuterRadius - atmosphereInnerRadius;
vec3 direction = (u_enuToFixedFrame * getCubeMapDirection(v_textureCoordinates, u_faceDirection)).xyz;
vec3 normalizedDirection = normalize(direction);
czm_ray ray = czm_ray(positionWC, normalizedDirection);
czm_raySegment intersection = czm_raySphereIntersectionInterval(ray, vec3(0.0), atmosphereInnerRadius);
if (!czm_isEmpty(intersection)) {
intersection = czm_rayEllipsoidIntersectionInterval(ray, vec3(0.0), czm_ellipsoidInverseRadii);
}
bool onEllipsoid = intersection.start >= 0.0;
float rayLength = czm_branchFreeTernary(onEllipsoid, intersection.start, atmosphereOuterRadius);
// Compute sky color for each position on a sphere at radius centered around the provided position's origin
vec3 skyPositionWC = positionWC + normalizedDirection * rayLength;
float lightEnum = u_radiiAndDynamicAtmosphereColor.z;
vec3 lightDirectionWC = normalize(czm_getDynamicAtmosphereLightDirection(skyPositionWC, lightEnum));
vec3 mieColor;
vec3 rayleighColor;
float opacity;
czm_computeScattering(
ray,
rayLength,
lightDirectionWC,
atmosphereInnerRadius,
rayleighColor,
mieColor,
opacity
);
vec4 atmopshereColor = czm_computeAtmosphereColor(ray, lightDirectionWC, rayleighColor, mieColor, opacity);
#ifdef ATMOSPHERE_COLOR_CORRECT
const bool ignoreBlackPixels = true;
atmopshereColor.rgb = czm_applyHSBShift(atmopshereColor.rgb, czm_atmosphereHsbShift, ignoreBlackPixels);
#endif
vec3 lookupDirection = -normalizedDirection;
// Flipping the X vector is a cheap way to get the inverse of czm_temeToPseudoFixed, since that's a rotation about Z.
lookupDirection.x = -lookupDirection.x;
lookupDirection = -normalize(czm_temeToPseudoFixed * lookupDirection);
lookupDirection.x = -lookupDirection.x;
// Values outside the atmopshere are rendered as black, when they should be treated as transparent
float skyAlpha = clamp((1.0 - ellipsoidHeight / atmosphereHeight) * atmopshereColor.a, 0.0, 1.0);
skyAlpha = czm_branchFreeTernary(length(atmopshereColor.rgb) <= czm_epsilon7, 0.0, skyAlpha); // Treat black as transparent
// Blend starmap with atmopshere scattering
float intensity = u_brightnessSaturationGammaIntensity.w;
vec4 sceneSkyBoxColor = czm_textureCube(czm_environmentMap, lookupDirection);
vec3 skyBackgroundColor = mix(czm_backgroundColor.rgb, sceneSkyBoxColor.rgb, sceneSkyBoxColor.a);
vec4 combinedSkyColor = vec4(mix(skyBackgroundColor, atmopshereColor.rgb * intensity, skyAlpha), 1.0);
// Compute ground color based on amount of reflected light, then blend it with ground atmosphere based on height
vec3 up = normalize(positionWC);
float occlusion = max(dot(lightDirectionWC, up), 0.05);
vec4 groundColor = vec4(u_groundColor.rgb * u_groundColor.a * (vec3(intensity * occlusion) + atmopshereColor.rgb), 1.0);
vec4 blendedGroundColor = mix(groundColor, atmopshereColor, clamp(ellipsoidHeight / atmosphereHeight, 0.0, 1.0));
vec4 color = czm_branchFreeTernary(onEllipsoid, blendedGroundColor, combinedSkyColor);
float brightness = u_brightnessSaturationGammaIntensity.x;
float saturation = u_brightnessSaturationGammaIntensity.y;
float gamma = u_brightnessSaturationGammaIntensity.z;
#ifdef ENVIRONMENT_COLOR_CORRECT
color.rgb = mix(vec3(0.0), color.rgb, brightness);
color.rgb = czm_saturation(color.rgb, saturation);
#endif
color.rgb = pow(color.rgb, vec3(gamma)); // Normally this would be in the ifdef above, but there is a precision issue with the atmopshere scattering transmittance (alpha). Having this line is a workaround for that issue, even when gamma is 1.0.
color.rgb = czm_gammaCorrect(color.rgb);
out_FragColor = color;
}
`;var gN=`precision highp float;
in vec3 v_textureCoordinates;
uniform float u_roughness;
uniform samplerCube u_radianceTexture;
uniform vec3 u_faceDirection;
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 = czm_twoPi * 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;
}
// Sample count is relatively low for the sake of performance, but should still be enough to prevent artifacting in lower roughnesses
const int samples = 128;
void main() {
vec3 normal = u_faceDirection;
vec3 V = normalize(v_textureCoordinates);
float roughness = u_roughness;
vec4 color = vec4(0.0);
float weight = 0.0;
for (int i = 0; i < samples; ++i) {
vec2 xi = hammersley2D(i, samples);
vec3 H = importanceSampleGGX(xi, roughness, V);
vec3 L = 2.0 * dot(V, H) * H - V; // reflected vector
float NdotL = max(dot(V, L), 0.0);
if (NdotL > 0.0) {
color += vec4(czm_textureCube(u_radianceTexture, L).rgb, 1.0) * NdotL;
weight += NdotL;
}
}
out_FragColor = color / weight;
}
`;var _N=`in vec3 position;
out vec3 v_textureCoordinates;
uniform vec3 u_faceDirection;
vec3 getCubeMapDirection(vec2 uv, vec3 faceDir) {
vec2 scaledUV = uv;
if (faceDir.x != 0.0) {
return vec3(faceDir.x, scaledUV.y, scaledUV.x * faceDir.x);
} else if (faceDir.y != 0.0) {
return vec3(scaledUV.x, -faceDir.y, -scaledUV.y * faceDir.y);
} else {
return vec3(scaledUV.x * faceDir.z, scaledUV.y, -faceDir.z);
}
}
void main()
{
v_textureCoordinates = getCubeMapDirection(position.xy, u_faceDirection);
v_textureCoordinates.y = -v_textureCoordinates.y;
v_textureCoordinates.z = -v_textureCoordinates.z;
gl_Position = vec4(position, 1.0);
}
`;function gi(e){this._position=void 0,this._radianceMapDirty=!1,this._radianceCommandsDirty=!1,this._convolutionsCommandsDirty=!1,this._irradianceCommandDirty=!1,this._irradianceTextureDirty=!1,this._sphericalHarmonicCoefficientsDirty=!1,this._shouldRegenerateShaders=!1,this._shouldReset=!1,e=e??V.EMPTY_OBJECT;let t=Math.max(Math.floor(Math.min(e.mipmapLevels??7,Math.log2(Rt.maximumCubeMapSize))),0);this._mipmapLevels=t;let n=Math.max(t-1,0)*6;this._radianceMapComputeCommands=new Array(6),this._convolutionComputeCommands=new Array(n),this._irradianceComputeCommand=void 0,this._radianceMapFS=void 0,this._irradianceMapFS=void 0,this._convolveSP=void 0,this._va=void 0,this._radianceMapTextures=new Array(6),this._specularMapTextures=new Array(n),this._radianceCubeMap=void 0,this._irradianceMapTexture=void 0,this._sphericalHarmonicCoefficients=gi.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS.slice(),this._lastTime=new X;let i=Math.max(Math.pow(2,t-1),1);this._textureDimensions=new k(i,i),this._radiiAndDynamicAtmosphereColor=new d,this._sceneEnvironmentMap=void 0,this._backgroundColor=void 0,this._owner=void 0,this.enabled=e.enabled??!0,this.shouldUpdate=!0,this.maximumSecondsDifference=e.maximumSecondsDifference??3600,this.maximumPositionEpsilon=e.maximumPositionEpsilon??1e3,this.atmosphereScatteringIntensity=e.atmosphereScatteringIntensity??2,this.gamma=e.gamma??1,this.brightness=e.brightness??1,this.saturation=e.saturation??1,this.groundColor=e.groundColor??gi.AVERAGE_EARTH_GROUND_COLOR,this.groundAlbedo=e.groundAlbedo??.31}Object.defineProperties(gi.prototype,{owner:{get:function(){return this._owner}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},position:{get:function(){return this._position},set:function(e){d.equalsEpsilon(e,this._position,0,this.maximumPositionEpsilon)||(this._position=d.clone(e,this._position),this._shouldReset=!0)}},radianceCubeMap:{get:function(){return this._radianceCubeMap}},maximumMipmapLevel:{get:function(){return this._mipmapLevels}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}}});gi._maximumComputeCommandCount=8;gi._activeComputeCommandCount=0;gi._nextFrameCommandQueue=[];gi._queueCommand=(e,t)=>{if(gi._activeComputeCommandCount>=gi._maximumComputeCommandCount){gi._nextFrameCommandQueue.push(e);return}t.commandList.push(e),gi._activeComputeCommandCount++};gi._updateCommandQueue=e=>{if(gi._maximumComputeCommandCount=Math.log2(Rt.maximumCubeMapSize),gi._nextFrameCommandQueue.length>0&&gi._activeComputeCommandCount<gi._maximumComputeCommandCount){let t=gi._nextFrameCommandQueue.shift();for(;l(t)&&gi._activeComputeCommandCount<gi._maximumComputeCommandCount;){if(t.owner.isDestroyed()||t.canceled){t=gi._nextFrameCommandQueue.shift();continue}e.commandList.push(t),gi._activeComputeCommandCount++,t=gi._nextFrameCommandQueue.shift()}l(t)&&gi._nextFrameCommandQueue.push(t)}};gi.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};gi.prototype.reset=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;t<e;++t)l(this._radianceMapComputeCommands[t])&&(this._radianceMapComputeCommands[t].canceled=!0),this._radianceMapComputeCommands[t]=void 0;e=this._convolutionComputeCommands.length;for(let t=0;t<e;++t)l(this._convolutionComputeCommands[t])&&(this._convolutionComputeCommands[t].canceled=!0),this._convolutionComputeCommands[t]=void 0;l(this._irradianceComputeCommand)&&(this._irradianceComputeCommand.canceled=!0,this._irradianceComputeCommand=void 0),this._radianceMapDirty=!0,this._radianceCommandsDirty=!0,this._convolutionsCommandsDirty=!1,this._irradianceCommandDirty=!1};var C5e=new d,E5e=new d;function b5e(e,t){let n=e._position,i=t.atmosphere,o=t.mapProjection.ellipsoid,r=o.scaleToGeodeticSurface(n,E5e),a=1.025,s=C5e,c=l(r)?d.magnitude(r):o.maximumRadius;return s.x=c*a,s.y=c,s.z=i.dynamicLighting,!d.equalsEpsilon(e._radiiAndDynamicAtmosphereColor,s)||t.environmentMap!==e._sceneEnvironmentMap||t.backgroundColor!==e._backgroundColor?(d.clone(s,e._radiiAndDynamicAtmosphereColor),e._sceneEnvironmentMap=t.environmentMap,e._backgroundColor=t.backgroundColor,!0):!1}var Wfe=new d,I5e=new M,x5e=new ie,T5e=new z;function S5e(e,t){let n=t.context,i=e._textureDimensions;if(l(e._radianceCubeMap)||(e._radianceCubeMap=new Kr({context:n,width:i.x,height:i.y,pixelDatatype:He.UNSIGNED_BYTE,pixelFormat:qe.RGBA})),e._radianceCommandsDirty){let o=e._radianceMapFS;l(o)||(o=new We({sources:[Yh,AN]}),e._radianceMapFS=o),S0.requiresColorCorrect(t.atmosphere)&&o.defines.push("ATMOSPHERE_COLOR_CORRECT");let r=e._position,a=e._radiiAndDynamicAtmosphereColor,s=t.mapProjection.ellipsoid,c=At.eastNorthUpToFixedFrame(r,s,I5e),u=x5e;u.x=e.brightness,u.y=e.saturation,u.z=e.gamma,u.w=e.atmosphereScatteringIntensity,(e.brightness!==1||e.saturation!==1||e.gamma!==1)&&o.defines.push("ENVIRONMENT_COLOR_CORRECT");let f=0;for(let h of Kr.faceNames()){let p=e._radianceMapTextures[f];l(p)&&!p.isDestroyed()&&p.destroy(),p=new Dt({context:n,width:i.x,height:i.y,pixelDatatype:He.UNSIGNED_BYTE,pixelFormat:qe.RGBA}),e._radianceMapTextures[f]=p;let A=f,m=new xl({fragmentShaderSource:o,outputTexture:p,uniformMap:{u_radiiAndDynamicAtmosphereColor:()=>a,u_enuToFixedFrame:()=>c,u_faceDirection:()=>Kr.getDirection(h,Wfe),u_positionWC:()=>r,u_brightnessSaturationGammaIntensity:()=>u,u_groundColor:()=>e.groundColor.withAlpha(e.groundAlbedo,T5e)},owner:e});m.postExecute=()=>{if(e.isDestroyed()||m.canceled){gi._activeComputeCommandCount--;return}let _=e._radianceMapComputeCommands;_[A]=void 0;let y=new la({context:n,colorTextures:[e._radianceMapTextures[A]]});y._bind(),e._radianceCubeMap[h].copyFromFramebuffer(),y._unBind(),y.destroy(),gi._activeComputeCommandCount--,_.some(l)||(e._convolutionsCommandsDirty=!0,e._shouldRegenerateShaders=!0)},e._radianceMapComputeCommands[f]=m,gi._queueCommand(m,t),f++}e._radianceCommandsDirty=!1}}function w5e(e,t){let n=e._radianceCubeMap;n.generateMipmap();let i=e._mipmapLevels,o=e._textureDimensions,r=o.x/2,a=o.y/2,s=t.context,c=0,u=()=>{let p=e._specularMapTextures.length;c>=p&&(e._irradianceCommandDirty=!0,i>1&&(n.sampler=new jt({minificationFilter:Wt.LINEAR_MIPMAP_LINEAR}),e._shouldRegenerateShaders=!0,e._va.destroy(),e._va=void 0,e._convolveSP.destroy(),e._convolveSP=void 0))},f=(p,A,m,_,y)=>()=>{if(e.isDestroyed()||p.canceled){gi._activeComputeCommandCount--;return}let C=e._convolutionComputeCommands;C[A]=void 0,n.copyFace(t,m,_,y),c++,gi._activeComputeCommandCount--,m.destroy(),e._specularMapTextures[A]=void 0,u()},h=0;for(let p=1;p<i;++p){for(let A of Kr.faceNames()){l(e._specularMapTextures[h])&&e._specularMapTextures[h].destroy();let m=e._specularMapTextures[h]=new Dt({context:s,width:r,height:a,pixelDatatype:He.UNSIGNED_BYTE,pixelFormat:qe.RGBA}),_=e._va;l(_)||(_=Kr.createVertexArray(s,A),e._va=_);let y=e._convolveSP;l(y)||(y=$t.fromCache({context:s,vertexShaderSource:_N,fragmentShaderSource:gN,attributeLocations:{positions:0}}),e._convolveSP=y);let C=new xl({shaderProgram:y,vertexArray:_,outputTexture:m,persists:!0,owner:e,uniformMap:{u_roughness:()=>p/(i-1),u_radianceTexture:()=>n??s.defaultTexture,u_faceDirection:()=>Kr.getDirection(A,Wfe)}});C.postExecute=f(C,h,m,A,p),e._convolutionComputeCommands[h]=C,gi._queueCommand(C,t),++h}r/=2,a/=2}u()}var jfe=new k(3,3);function B5e(e,t){let n=t.context,i=jfe,o=e._irradianceMapTexture;l(o)&&!o.isDestroyed()&&o.destroy(),o=new Dt({context:n,width:i.x,height:i.y,pixelDatatype:He.FLOAT,pixelFormat:qe.RGBA}),e._irradianceMapTexture=o;let r=e._irradianceMapFS;l(r)||(r=new We({sources:[pN]}),e._irradianceMapFS=r);let a=new xl({fragmentShaderSource:r,outputTexture:o,owner:e,uniformMap:{u_radianceMap:()=>e._radianceCubeMap??n.defaultTexture}});a.postExecute=()=>{if(e.isDestroyed()||a.canceled){gi._activeComputeCommandCount--;return}e._irradianceTextureDirty=!1,e._irradianceComputeCommand=void 0,e._sphericalHarmonicCoefficientsDirty=!0,e._irradianceMapFS=void 0,gi._activeComputeCommandCount--},e._irradianceComputeCommand=a,gi._queueCommand(a,t),e._irradianceTextureDirty=!0}function D5e(e,t){let n=t.context;if(!l(e._irradianceMapTexture))return;let i=new la({context:n,colorTextures:[e._irradianceMapTexture],destroyAttachments:!1}),o=jfe,r=n.readPixels({x:0,y:0,width:o.x,height:o.y,framebuffer:i});for(let a=0;a<9;++a)e._sphericalHarmonicCoefficients[a]=d.unpack(r,a*4),d.multiplyByScalar(e._sphericalHarmonicCoefficients[a],e.atmosphereScatteringIntensity,e._sphericalHarmonicCoefficients[a]);i.destroy(),e._irradianceMapTexture.destroy(),e._irradianceMapTexture=void 0,e._shouldRegenerateShaders=!0}gi.prototype.update=function(e){let t=e.mode;if(!(gi.isDynamicUpdateSupported(e)&&this._mipmapLevels>=1)||!this.enabled||!this.shouldUpdate||!l(this._position)||t===oe.MORPHING){this._shouldRegenerateShaders=!1;return}gi._updateCommandQueue(e);let i=e.atmosphere.dynamicLighting,o=b5e(this,e)||i===lg.SUNLIGHT&&!X.equalsEpsilon(e.time,this._lastTime,this.maximumSecondsDifference);if(this._shouldReset||o){this.reset(),this._shouldReset=!1,this._lastTime=X.clone(e.time,this._lastTime);return}if(this._radianceMapDirty&&(S5e(this,e),this._radianceMapDirty=!1),this._convolutionsCommandsDirty&&(w5e(this,e),this._convolutionsCommandsDirty=!1),this._irradianceCommandDirty&&(B5e(this,e),this._irradianceCommandDirty=!1),this._irradianceTextureDirty){this._shouldRegenerateShaders=!1;return}if(this._sphericalHarmonicCoefficientsDirty){D5e(this,e),this._sphericalHarmonicCoefficientsDirty=!1;return}this._shouldRegenerateShaders=!1};gi.prototype.isDestroyed=function(){return!1};gi.prototype.destroy=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;t<e;++t)this._radianceMapComputeCommands[t]=void 0;e=this._convolutionComputeCommands.length;for(let t=0;t<e;++t)this._convolutionComputeCommands[t]=void 0;this._irradianceMapComputeCommand=void 0,e=this._radianceMapTextures.length;for(let t=0;t<e;++t)this._radianceMapTextures[t]=this._radianceMapTextures[t]&&!this._radianceMapTextures[t].isDestroyed()&&this._radianceMapTextures[t].destroy();e=this._specularMapTextures.length;for(let t=0;t<e;++t)this._specularMapTextures[t]=this._specularMapTextures[t]&&!this._specularMapTextures[t].isDestroyed()&&this._specularMapTextures[t].destroy();return this._radianceCubeMap=this._radianceCubeMap&&this._radianceCubeMap.destroy(),this._irradianceMapTexture=this._irradianceMapTexture&&!this._irradianceMapTexture.isDestroyed()&&this._irradianceMapTexture.destroy(),l(this._va)&&this._va.destroy(),l(this._convolveSP)&&this._convolveSP.destroy(),fe(this)};gi.isDynamicUpdateSupported=function(e){let t=e.context;return t.halfFloatingPointTexture||t.colorBufferFloat};gi.AVERAGE_EARTH_GROUND_COLOR=Object.freeze(z.fromCssColorString("#717145"));gi.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS=Object.freeze([Object.freeze(new d(.35449,.35449,.35449)),d.ZERO,d.ZERO,d.ZERO,d.ZERO,d.ZERO,d.ZERO,d.ZERO,d.ZERO]);var ug=gi;var yN={HIGHLIGHT:0,REPLACE:1,MIX:2};yN.getColorBlend=function(e,t){if(e===yN.HIGHLIGHT)return 0;if(e===yN.REPLACE)return 1;if(e===yN.MIX)return D.clamp(t,D.EPSILON4,1)};var el=Object.freeze(yN);var v5e={XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"},tl=Object.freeze(v5e);var P5e={STEP:0,LINEAR:1,CUBICSPLINE:2},qh=Object.freeze(P5e);var Yfe={};function CN(e){this._count=e.count,this._properties=je(e.properties,!0)}CN.prototype.hasProperty=function(e){return qn.hasProperty(e,this._properties,Yfe)};CN.prototype.getPropertyIds=function(e){return qn.getPropertyIds(this._properties,Yfe,e)};CN.prototype.getProperty=function(e,t){let n=this._properties[t];if(l(n))return je(n[e],!0)};CN.prototype.setProperty=function(e,t,n){let i=this._properties[t];l(i)||(i=new Array(this._count),this._properties[t]=i),i[e]=je(n,!0)};var fg=CN;function Dc(e){e=e??V.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,this._texture=e.texture}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}},properties:{get:function(){if(l(this._metadataTable))return this._metadataTable.properties}},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}},texture:{get:function(){return this._texture}}});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 Iq=[];Dc.prototype.getPropertyIds=function(e,t){if(t=l(t)?t:[],t.length=0,l(this._metadataTable)){let n=this._metadataTable.getPropertyIds(Iq);oi(t,n)}if(l(this._batchTableHierarchy)){let n=this._batchTableHierarchy.getPropertyIds(e,Iq);oi(t,n)}if(l(this._jsonMetadataTable)){let n=this._jsonMetadataTable.getPropertyIds(Iq);oi(t,n)}return 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 fg({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)};Dc.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),fe(this)};var jl=Dc;function qfe(e){e=e??V.EMPTY_OBJECT;let t=e.property,n=e.classProperty,i=e.textures,o=l(t.channels)?t.channels:[0],r=t,a=Bu.createModelTextureReader({textureInfo:r,channels:R5e(o),texture:i[r.index]});this._min=t.min,this._max=t.max;let s=t.offset,c=t.scale,u=n.hasValueTransform||l(s)||l(c);s=s??n.offset,c=c??n.scale,s=n.unpackVectorAndMatrixTypes(s),c=n.unpackVectorAndMatrixTypes(c),this._offset=s,this._scale=c,this._hasValueTransform=u,this._textureReader=a,this._classProperty=n,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(qfe.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}}});function R5e(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var EN=qfe;function xq(e){e=e??V.EMPTY_OBJECT;let t=e.propertyTexture,n=e.class,i=e.textures,o=t.extensions,r=t.extras,a={};if(l(t.properties))for(let s in t.properties)t.properties.hasOwnProperty(s)&&(a[s]=new EN({property:t.properties[s],classProperty:n.properties[s],textures:i}));this._name=e.name,this._id=e.id,this._class=n,this._properties=a,this._extras=r,this._extensions=o}Object.defineProperties(xq.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}}});xq.prototype.getProperty=function(e){return this._properties[e]};var dg=xq;function Kfe(e){e=e??V.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=i??n.offset,o=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(Kfe.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 bN=Kfe;function Tq(e){e=e??V.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 bN({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(Tq.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}}});Tq.prototype.getProperty=function(e){return this._properties[e]};var w0=Tq;function _T(e){e=e??V.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(_T.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}}});_T.prototype.getPropertyTable=function(e){return this._propertyTables[e]};_T.prototype.getPropertyTexture=function(e){return this._propertyTextures[e]};_T.prototype.getPropertyAttribute=function(e){return this._propertyAttributes[e]};_T.prototype.destroy=function(){let e=this._propertyTables;for(let t=0;t<e.length;t++)e[t]=e[t]&&e[t].destroy();return fe(this)};var Os=_T;function M5e(e){e=e??V.EMPTY_OBJECT;let t=e.extension,n=e.schema,i=[];if(l(t.propertyTables))for(let a=0;a<t.propertyTables.length;a++){let s=t.propertyTables[a],c=n.classes[s.class],u=N5e(s,e.bufferViews,c,e.context),f=new xd({count:s.count,properties:s.properties,class:c,bufferViews:e.bufferViews});i.push(new jl({id:a,name:s.name,count:s.count,metadataTable:f,extras:s.extras,extensions:s.extensions,texture:u}))}let o=[];if(l(t.propertyTextures))for(let a=0;a<t.propertyTextures.length;a++){let s=t.propertyTextures[a];o.push(new dg({id:a,name:s.name,propertyTexture:s,class:n.classes[s.class],textures:e.textures}))}let r=[];if(l(t.propertyAttributes))for(let a=0;a<t.propertyAttributes.length;a++){let s=t.propertyAttributes[a];r.push(new w0({id:a,name:s.name,class:n.classes[s.class],propertyAttribute:s}))}return new Os({schema:n,propertyTables:i,propertyTextures:o,propertyAttributes:r,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}var IN=4;function N5e(e,t,n,i){let o=e.properties;if(!l(o))return;let r=e.count,a;try{a=L5e(o,t,n,r)}catch(f){console.warn(`Failed to create texture for property table "${e.name}": ${f.message}`);return}let s=a.length;if(s===0)return;if(r>Rt.maximumTextureSize||s>Rt.maximumTextureSize){It("PropertyTableTextureExceedsMaximumSize",`Cannot create a texture for the property table "${e.name}" because it exceeds the maximum texture size of ${Rt.maximumTextureSize}.`);return}let c=F5e(a,r),u=new jt({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Wt.NEAREST,magnificationFilter:ci.NEAREST});return Dt.create({context:i,pixelFormat:qe.RGBA,pixelDatatype:He.UNSIGNED_BYTE,sampler:u,flipY:!1,source:{width:r,height:s,arrayBufferView:c}})}function L5e(e,t,n,i){let o=[],r=n.properties;for(let[a,s]of Object.entries(r)){if(!s.isGpuCompatible(IN))continue;let c=e[a],u=l(c)?t[c.values]:O5e(s,i),f=u.length,h=s.cpuBytesPerElement(),p=f/h;if(p!==i)throw new ue(`Property with ID: "${a}" has (${p}), which does not match number of features in the property table: (${i}).`);o.push({view:u,classProperty:s})}return o}function O5e(e,t){let n=e.noData,i=bt.getComponentCount(e.type),o=e.isArray?e.arrayLength:1;e.type===bt.ENUM&&(n=e.enumType.valuesByName[n]),i===1&&(n=[n]),o===1&&(n=[n]);let r=e.cpuBytesPerElement(),a=Ft.getSizeInBytes(e.valueType),s=new ArrayBuffer(r*t),c=new DataView(s),u=Ft.getDataViewAccessors(c,e.valueType);for(let f=0;f<t;f++)for(let h=0;h<o;h++)for(let p=0;p<i;p++){let A=h*i+p;u.set(r*f+A*a,n[h][p])}return new Uint8Array(s)}function F5e(e,t){let n=e.length,i=new Uint8Array(n*t*IN),o=new DataView(i.buffer,i.byteOffset,i.byteLength);for(let r=0;r<n;r++){let a=e[r],s=a.classProperty,c=r*t*IN,u=s.valueType,f=Ft.gpuComponentType(u);if(u!==f){k5e(a,o,c);continue}Q5e(a,i,c)}return i}function Q5e(e,t,n){let i=e.view,o=e.classProperty.cpuBytesPerElement(),r=i.length/o;for(let a=0;a<r;a++){let s=a*o,c=n+a*IN;t.set(i.subarray(s,s+o),c)}}function k5e(e,t,n){let i=e.classProperty,o=e.view,r=i.valueType,a=Ft.gpuComponentType(r),s=i.cpuBytesPerElement(),c=o.length/s,u=new DataView(o.buffer,o.byteOffset,o.byteLength),f=Ft.getDataViewAccessors(u,r),h=Ft.getDataViewAccessors(t,a),p=Ft.downcastFunction(r);for(let A=0;A<c;A++){let m=A*s,_=n+A*IN,y=f.get(m);h.set(_,p(y))}}var xN=M5e;function U5e(e){e=e??V.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 s=r[i],c=t.featureTables[s],u=n.classes[c.class],f=new xd({count:c.count,properties:c.properties,class:u,bufferViews:e.bufferViews});o.push(new jl({id:s,count:c.count,metadataTable:f,extras:c.extras,extensions:c.extensions}))}let a=[];if(l(t.featureTextures))for(r=Object.keys(t.featureTextures).sort(),i=0;i<r.length;i++){let s=r[i],c=t.featureTextures[s];a.push(new dg({id:s,propertyTexture:z5e(c),class:n.classes[c.class],textures:e.textures}))}return new Os({schema:n,propertyTables:o,propertyTextures:a,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function z5e(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:G5e(o.channels),extras:o.extras,extensions:o.extensions};t.properties[i]=Pt(o.texture,r,!0)}return t}function G5e(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 TN=U5e;var Sq=class extends Ki{constructor(t){super(),t=t??V.EMPTY_OBJECT;let{gltf:n,extension:i,extensionLegacy:o,gltfResource:r,baseResource:a,supportedImageFormats:s,frameState:c,cacheKey:u,asynchronous:f=!0}=t;this._gltfResource=r,this._baseResource=a,this._gltf=n,this._extension=i,this._extensionLegacy=o,this._supportedImageFormats=s,this._frameState=c,this._cacheKey=u,this._asynchronous=f,this._bufferViewLoaders=[],this._bufferViewIds=[],this._textureLoaders=[],this._textureIds=[],this._schemaLoader=void 0,this._structuralMetadata=void 0,this._state=gt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get structuralMetadata(){return this._structuralMetadata}load(){return l(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=V5e(this),this._promise)}process(t){if(this._state===gt.READY)return!0;if(this._state!==gt.LOADED)return!1;let n=this._textureLoaders,i=n.length,o=!0;for(let c=0;c<i;++c){let f=n[c].process(t);o=o&&f}if(!o)return!1;let r=this._schemaLoader.schema,a={};for(let c=0;c<this._bufferViewIds.length;++c){let u=this._bufferViewIds[c],f=this._bufferViewLoaders[c];if(!f.isDestroyed()){let h=new Uint8Array(f.typedArray);a[u]=h}}let s={};for(let c=0;c<this._textureIds.length;++c){let u=this._textureIds[c],f=n[c];f.isDestroyed()||(s[u]=f.texture)}return l(this._extension)?this._structuralMetadata=xN({extension:this._extension,schema:r,bufferViews:a,textures:s,context:t.context}):this._structuralMetadata=TN({extension:this._extensionLegacy,schema:r,bufferViews:a,textures:s}),Xfe(this),this._state=gt.READY,!0}unload(){Xfe(this),tWe(this),l(this._schemaLoader)&&Ri.unload(this._schemaLoader),this._schemaLoader=void 0,l(this._structuralMetadata)&&this._structuralMetadata.destroy(),this._structuralMetadata=void 0}};async function V5e(e){try{let t=q5e(e),n=$5e(e),i=eWe(e);return await Promise.all([t,n,i]),e.isDestroyed()?void 0:(e._gltf=void 0,e._state=gt.LOADED,e)}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load structural metadata",t)}}function H5e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.values,r=i.arrayOffsets,a=i.stringOffsets;l(o)&&(t[o]=!0),l(r)&&(t[r]=!0),l(a)&&(t[a]=!0)}}function W5e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.bufferView,r=i.arrayOffsetBufferView,a=i.stringOffsetBufferView;l(o)&&(t[o]=!0),l(r)&&(t[r]=!0),l(a)&&(t[a]=!0)}}function j5e(e){let t=e.propertyTables,n={};if(l(t))for(let i=0;i<t.length;i++){let o=t[i];H5e(o.properties,n)}return n}function Y5e(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)&&W5e(r,n)}}return n}async function q5e(e){let t;l(e._extension)?t=j5e(e._extension):t=Y5e(e._extensionLegacy);let n=[];for(let i in t)if(t.hasOwnProperty(i)){let o=Ri.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 K5e(e){let t={},n=e.propertyTextures;if(l(n))for(let i=0;i<n.length;i++){let r=n[i].properties;l(r)&&X5e(r,t)}return t}function X5e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t[i.index]=i}}function J5e(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)&&Z5e(r,t)}}return t}function Z5e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let o=e[n].texture;t[o.index]=o}}function $5e(e){let t;l(e._extension)?t=K5e(e._extension):t=J5e(e._extensionLegacy);let n=e._gltf,i=e._gltfResource,o=e._baseResource,r=e._supportedImageFormats,a=e._frameState,s=e._asynchronous,c=[];for(let u in t)if(t.hasOwnProperty(u)){let f=Ri.getTextureLoader({gltf:n,textureInfo:t[u],gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:a,asynchronous:s});e._textureLoaders.push(f),e._textureIds.push(u),c.push(f.load())}return Promise.all(c)}async function eWe(e){let t=e._extension??e._extensionLegacy,n;if(l(t.schemaUri)){let i=e._baseResource.getDerivedResource({url:t.schemaUri});n=Ri.getSchemaLoader({resource:i})}else n=Ri.getSchemaLoader({schema:t.schema});if(e._schemaLoader=n,await n.load(),!n.isDestroyed())return n.schema}function Xfe(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)Ri.unload(t[i]);e._bufferViewLoaders.length=0,e._bufferViewIds.length=0}function tWe(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)Ri.unload(t[i]);e._textureLoaders.length=0,e._textureIds.length=0}var SN=Sq;var yT={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};yT.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"TRANSLATION":return yT.TRANSLATION;case"ROTATION":return yT.ROTATION;case"SCALE":return yT.SCALE;case"_FEATURE_ID":return yT.FEATURE_ID}};var Oa=Object.freeze(yT);var nWe=65534,iWe=255;function i8(e){e=e??V.EMPTY_OBJECT;let t=e.triangleIndices,n=e.outlineIndices,i=e.originalVertexCount;this._triangleIndices=t,this._originalVertexCount=i,this._edges=new $fe(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],oWe(this)}Object.defineProperties(i8.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}});function oWe(e){let t=e._triangleIndices,n=e._edges,i=[],o=e._extraVertices,r=e._originalVertexCount,a={};for(let s=0;s<t.length;s+=3){let c=t[s],u=t[s+1],f=t[s+2],h=!1,p=h||n.hasEdge(c,u),A=h||n.hasEdge(u,f),m=h||n.hasEdge(f,c),_=Jfe(i,c,u,f,p,A,m);for(;l(_);){let y=a[_];if(!l(y)){y=r+o.length;let C=_;for(;C>=r;)C=o[C-r];o.push(C),a[_]=y}y>nWe&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):y>iWe&&t instanceof Uint8Array&&(t=new Uint16Array(t)),_===c?(c=y,t[s]=y):_===u?(u=y,t[s+1]=y):(f=y,t[s+2]=y),_=Jfe(i,c,u,f,p,A,m)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function Jfe(e,t,n,i,o,r,a){let s=a?1:0,c=o?1:0,u=0,f=wq(e,t,s,c,u);if(f===0)return t;let h=0,p=o?1:0,A=r?1:0,m=wq(e,n,h,p,A);if(m===0)return n;let _=a?1:0,y=0,C=r?1:0,E=wq(e,i,_,y,C);if(E===0)return i;let b=f&m&E,x,S,B;if(b&1)x=0,S=1,B=2;else if(b&2)x=0,B=1,S=2;else if(b&4)S=0,x=1,B=2;else if(b&8)S=0,B=1,x=2;else if(b&16)B=0,x=1,S=2;else if(b&32)B=0,S=1,x=2;else{let L=Bq(f),g=Bq(m),I=Bq(E);return L<g&&L<I?t:g<I?n:i}let v=t*3;e[v+x]=s,e[v+S]=c,e[v+B]=u;let P=n*3;e[P+x]=h,e[P+S]=p,e[P+B]=A;let N=i*3;e[N+x]=_,e[N+S]=y,e[N+B]=C}function wq(e,t,n,i,o){let r=t*3,a=e[r],s=e[r+1],c=e[r+2];return l(a)?(a===n&&s===i&&c===o)<<0|(a===n&&s===o&&c===i)<<1|(a===i&&s===n&&c===o)<<2|(a===i&&s===o&&c===n)<<3|(a===o&&s===n&&c===i)<<4|(a===o&&s===i&&c===n)<<5:63}function Bq(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}i8.prototype.updateAttribute=function(e){let t=this._extraVertices,n=e.length,i=n/this._originalVertexCount,o=t.length,r=e.constructor,a=new r(e.length+o*i);a.set(e);for(let s=0;s<o;s++){let c=t[s]*i,u=n+s*i;for(let f=0;f<i;f++)a[u+f]=a[c+f]}return a};i8.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,Rt.maximumTextureSize),i=n,o=Zfe(i),r=[];for(;i>1;)i>>=1,r.push(Zfe(i));let a=new Dt({context:e,source:{arrayBufferView:o,mipLevels:r},width:n,height:1,pixelFormat:qe.LUMINANCE,sampler:new jt({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR_MIPMAP_LINEAR,magnificationFilter:ci.LINEAR})});return t.outlineTexture=a,a};function Zfe(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 $fe(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),a=Math.max(i,o),s=r*this._originalVertexCount+a;this._edges.add(s)}}$fe.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 B0=i8;function ede(e){this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function rWe(e){this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1}function o8(e){this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0,this.needsGaussianSplats=!1}o8.prototype.postProcess=function(e){this.needsOutlines&&(aWe(this),lWe(this,e)),this.needsGaussianSplats&&cWe(this,e)};function aWe(e){let t=e.primitive,n=t.indices,i=t.attributes[0].count,o=new B0({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=o.updatedTriangleIndices,n.indexDatatype=Ue.fromTypedArray(n.typedArray);let r=sWe(o.outlineCoordinates),a=new ede(r);a.loadBuffer=!0,a.loadTypedArray=!1,e.attributePlans.push(a),t.outlineCoordinates=a.attribute;let s=e.attributePlans,c=e.attributePlans.length;for(let u=0;u<c;u++){let f=s[u].attribute;f.typedArray=o.updateAttribute(f.typedArray)}}function sWe(e){let t=new Cn.Attribute;return t.name="_OUTLINE_COORDINATES",t.typedArray=e,t.componentDatatype=j.FLOAT,t.type=Ut.VEC3,t.normalized=!1,t.count=e.length/3,t}function cWe(e,t){let n=e.attributePlans,i=n.length;for(let o=0;o<i;o++){let r=n[o];r.loadBuffer=!1,r.loadTypedArray=!0}}function lWe(e,t){uWe(e.attributePlans,t),l(e.indicesPlan)&&fWe(e.indicesPlan,t)}function uWe(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i],r=o.attribute,a=r.typedArray;if(o.loadBuffer){let s=tt.createVertexBuffer({typedArray:a,context:t,usage:Re.STATIC_DRAW});s.vertexArrayDestroyable=!1,r.buffer=s}o.loadTypedArray||(r.typedArray=void 0)}}function fWe(e,t){let n=e.indices;if(e.loadBuffer){let i=tt.createIndexBuffer({typedArray:n.typedArray,context:t,usage:Re.STATIC_DRAW,indexDatatype:n.indexDatatype});n.buffer=i,i.vertexArrayDestroyable=!1}e.loadTypedArray||(n.typedArray=void 0)}o8.AttributeLoadPlan=ede;o8.IndicesLoadPlan=rWe;var D0=o8;function dWe(e){e=e??V.EMPTY_OBJECT,this.webp=e.webp??!1,this.basis=e.basis??!1}var wN=dWe;function tde(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams}Object.defineProperties(tde.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}}});var BN=tde;function nde(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams,this._covarianceMatrix=e.covarianceMatrix}Object.defineProperties(nde.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}},covarianceMatrix:{get:function(){return this._covarianceMatrix}}});var DN=nde;function ide(e){this._groupFlags=e.groupFlags,this._rotationThetas=e.rotationThetas,this._params=e.params}Object.defineProperties(ide.prototype,{groupFlags:{get:function(){return this._groupFlags}},rotationThetas:{get:function(){return this._rotationThetas}},params:{get:function(){return this._params}}});var vN=ide;var hWe={Direct:"Direct",Indirect:"Indirect"},Ry=Object.freeze(hWe);function ode(e){this._storageType=e.storageType,this._anchorPointsIndirect=e.anchorPointsIndirect,this._anchorPointsDirect=e.anchorPointsDirect,this._intraTileCorrelationGroups=e.intraTileCorrelationGroups,this._covarianceDirect=e.covarianceDirect}Object.defineProperties(ode.prototype,{storageType:{get:function(){return this._storageType}},anchorPointsIndirect:{get:function(){return this._anchorPointsIndirect}},anchorPointsDirect:{get:function(){return this._anchorPointsDirect}},intraTileCorrelationGroups:{get:function(){return this._intraTileCorrelationGroups}},covarianceDirect:{get:function(){return this._covarianceDirect}}});var CT=ode;function rde(e){this._A=e.A,this._alpha=e.alpha,this._beta=e.beta,this._T=e.T}Object.defineProperties(rde.prototype,{A:{get:function(){return this._A}},alpha:{get:function(){return this._alpha}},beta:{get:function(){return this._beta}},T:{get:function(){return this._T}}});var PN=rde;function ET(){}function ade(e){return new J(e[0],e[1],e[3],e[1],e[2],e[4],e[3],e[4],e[5])}function mWe(e){let t=d.fromArray(e.position,0,new d),n=d.fromArray(e.adjustmentParams,0,new d);return new BN({position:t,adjustmentParams:n})}function pWe(e){let t=d.fromArray(e.position,0,new d),n=d.fromArray(e.adjustmentParams,0,new d),i=ade(e.covarianceMatrix);return new DN({position:t,adjustmentParams:n,covarianceMatrix:i})}function AWe(e){let t=e.groupFlags,n=d.fromArray(e.rotationThetas,0,new d),i=[];for(let r of e.params){let a=new PN({A:r.A,alpha:r.alpha,beta:r.beta,T:r.T});i.push(a)}return new vN({groupFlags:t,rotationThetas:n,params:i})}ET.load=function(e){let t=e.storageType;if(t===Ry.Direct)return ET.loadDirect(e);if(t===Ry.Indirect)return ET.loadIndirect(e);throw new ue(`Invalid storage type in NGA_gpm_local - expected 'Direct' or 'Indirect', but found ${t}`)};ET.loadDirect=function(e){let t=[],n=e.anchorPointsDirect;for(let r of n){let a=mWe(r);t.push(a)}let i=ade(e.covarianceDirectUpperTriangle);return new CT({storageType:Ry.Direct,anchorPointsDirect:t,covarianceDirect:i})};ET.loadIndirect=function(e){let t=[],n=e.anchorPointsIndirect;for(let a of n){let s=pWe(a);t.push(s)}let i=e.intraTileCorrelationGroups,o=[];for(let a of i){let s=AWe(a);o.push(s)}return new CT({storageType:Ry.Indirect,anchorPointsIndirect:t,intraTileCorrelationGroups:o})};var RN=ET;function sde(e){this._traits=e.traits,this._noData=e.noData,this._offset=e.offset,this._scale=e.scale,this._index=e.index,this._texCoord=e.texCoord}Object.defineProperties(sde.prototype,{traits:{get:function(){return this._traits}},noData:{get:function(){return this._noData}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},index:{get:function(){return this._index}},texCoord:{get:function(){return this._texCoord}}});var MN=sde;function cde(e){this._min=e.min,this._max=e.max,this._source=e.source}Object.defineProperties(cde.prototype,{min:{get:function(){return this._min}},max:{get:function(){return this._max}},source:{get:function(){return this._source}}});var NN=cde;function lde(e){this._ppeTextures=e}Object.defineProperties(lde.prototype,{ppeTextures:{get:function(){return this._ppeTextures}}});var LN=lde;function ea(e){e=e??V.EMPTY_OBJECT;let t=e.gltf,n=e.extension,i=e.gltfResource,o=e.baseResource,r=e.supportedImageFormats,a=e.frameState,s=e.cacheKey,c=e.asynchronous??!0;this._gltfResource=i,this._baseResource=o,this._gltf=t,this._extension=n,this._supportedImageFormats=r,this._frameState=a,this._cacheKey=s,this._asynchronous=c,this._textureLoaders=[],this._textureIds=[],this._meshPrimitiveGpmLocal=void 0,this._structuralMetadata=void 0,this._state=gt.UNLOADED,this._promise=void 0}l(Object.create)&&(ea.prototype=Object.create(Ki.prototype),ea.prototype.constructor=ea);Object.defineProperties(ea.prototype,{cacheKey:{get:function(){return this._cacheKey}},meshPrimitiveGpmLocal:{get:function(){return this._meshPrimitiveGpmLocal}},structuralMetadata:{get:function(){return this._structuralMetadata}}});ea.prototype._loadResources=async function(){try{return await this._loadTextures(),this.isDestroyed()?void 0:(this._gltf=void 0,this._state=gt.LOADED,this)}catch(e){if(this.isDestroyed())return;throw this.unload(),this._state=gt.FAILED,this.getError("Failed to load GPM data",e)}};ea.prototype.load=function(){return l(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=this._loadResources(this),this._promise)};function gWe(e){let t={},n=e.ppeTextures;if(l(n))for(let i=0;i<n.length;i++){let o=n[i];t[o.index]=o}return t}ea.prototype._loadTextures=function(){let e;l(this._extension)&&(e=gWe(this._extension));let t=this._gltf,n=this._gltfResource,i=this._baseResource,o=this._supportedImageFormats,r=this._frameState,a=this._asynchronous,s=[];for(let c in e)if(e.hasOwnProperty(c)){let u=Ri.getTextureLoader({gltf:t,textureInfo:e[c],gltfResource:n,baseResource:i,supportedImageFormats:o,frameState:r,asynchronous:a});this._textureLoaders.push(u),this._textureIds.push(c),s.push(u.load())}return Promise.all(s)};ea.ppeTexturesMetadataSchemaCache=new Map;ea._createPpeTextureClassJson=function(e,t){let n=e.traits,i=n.source,o=e.offset??0,r=(e.scale??1)*255;return{name:`PPE texture class ${t}`,properties:{[i]:{name:"PPE",type:"SCALAR",componentType:"UINT8",normalized:!0,offset:o,scale:r,min:n.min,max:n.max}}}};ea._obtainPpeTexturesMetadataSchema=function(e){let n=ea._collectPpeTexturePropertyIdentifiers(e).toString(),i=ea.ppeTexturesMetadataSchemaCache.get(n);if(l(i))return i;let r={id:`PPE_TEXTURE_SCHEMA_${ea.ppeTexturesMetadataSchemaCache.size}`,classes:{}},a=e.ppeTextures;for(let s=0;s<a.length;s++){let c=a[s],u=`ppeTexture_${s}`,f=ea._createPpeTextureClassJson(c,s);r.classes[u]=f}return i=Vl.fromJson(r),ea.ppeTexturesMetadataSchemaCache.set(n,i),i};ea._collectPpeTexturePropertyIdentifiers=function(e){let t=[],n=e.ppeTextures;for(let i=0;i<n.length;i++){let o=n[i],r=ea._createPpeTextureClassJson(o,i),a=JSON.stringify(r);t.push(a)}return t};ea._convertToStructuralMetadata=function(e,t){let n=[],i=ea._obtainPpeTexturesMetadataSchema(e),o=e.ppeTextures;for(let a=0;a<o.length;a++){let s=o[a],c=`ppeTexture_${a}`,f=s.traits.source,h=i.classes[c],p={class:c,properties:{[f]:{index:s.index,texCoord:s.texCoord}}};n.push(new dg({id:a,name:s.name,propertyTexture:p,class:h,textures:t}))}return new Os({schema:i,propertyTables:[],propertyTextures:n,propertyAttributes:[]})};ea.prototype.process=function(e){if(this._state===gt.READY)return!0;if(this._state!==gt.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let u=0;u<n;++u){let h=t[u].process(e);i=i&&h}if(!i)return!1;let o={};for(let u=0;u<this._textureIds.length;++u){let f=this._textureIds[u],h=t[u];h.isDestroyed()||(o[f]=h.texture)}let r=[],a=this._extension;if(l(a.ppeTextures)){let u=a.ppeTextures;for(let f of u){let h=f.traits,p=new NN({min:h.min,max:h.max,source:h.source}),A=new MN({traits:p,noData:f.noData,offset:f.offset,scale:f.scale,index:f.index,texCoord:f.texCoord});r.push(A)}}let s=new LN(r);this._meshPrimitiveGpmLocal=s;let c=ea._convertToStructuralMetadata(s,o);return this._structuralMetadata=c,this._state=gt.READY,!0};ea.prototype._unloadTextures=function(){let e=this._textureLoaders,t=e.length;for(let n=0;n<t;++n)Ri.unload(e[n]);this._textureLoaders.length=0,this._textureIds.length=0};ea.prototype.unload=function(){this._unloadTextures(),this._gltf=void 0,this._extension=void 0,this._structuralMetadata=void 0};var ON=ea;function _We(e){let n=(e.extensions??V.EMPTY_OBJECT).EXT_mesh_primitive_restart,i=e.primitives;if(!l(n))return i;let o=[];oi(o,i);for(let r of n.primitiveGroups){let a=r.primitives[0];if(!l(a)||!i[a])return i;let s={...i[a],indices:r.indices};switch(s.mode){case ee.TRIANGLE_FAN:case ee.TRIANGLE_STRIP:case ee.LINE_STRIP:case ee.LINE_LOOP:break;default:return i}for(let c of r.primitives){let u=o[c];if(!l(u?.indices)||u.mode!==s.mode)return i;o[c]=void 0}o[a]=s}return o.filter(l)}var FN=_We;var{Attribute:yWe,Indices:CWe,FeatureIdAttribute:fde,FeatureIdTexture:dde,FeatureIdImplicitRange:hde,MorphTarget:EWe,Primitive:bWe,Instances:IWe,Skin:xWe,Node:TWe,AnimatedPropertyType:SWe,AnimationSampler:wWe,AnimationTarget:BWe,AnimationChannel:DWe,Animation:vWe,ArticulationStage:PWe,Articulation:RWe,Asset:MWe,Scene:NWe,Components:LWe,MetallicRoughness:OWe,SpecularGlossiness:FWe,Specular:QWe,Anisotropy:Dq,Clearcoat:vq,LineStyle:kWe,Material:UWe,Vector:zWe}=Cn,sr={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8},Pq=class extends Ki{constructor(t){super(),t=t??V.EMPTY_OBJECT;let{gltfResource:n,typedArray:i,releaseGltfJson:o=!1,asynchronous:r=!0,incrementallyLoadTextures:a=!0,upAxis:s=ao.Y,forwardAxis:c=ao.Z,loadAttributesAsTypedArray:u=!1,loadAttributesFor2D:f=!1,enablePick:h=!1,loadIndicesForWireframe:p=!1,loadPrimitiveOutline:A=!0,loadForClassification:m=!1,renameBatchIdSemantic:_=!1}=t,{baseResource:y=n.clone()}=t;this._gltfJson=t.gltfJson,this._gltfResource=n,this._baseResource=y,this._typedArray=i,this._releaseGltfJson=o,this._asynchronous=r,this._incrementallyLoadTextures=a,this._upAxis=s,this._forwardAxis=c,this._loadAttributesAsTypedArray=u,this._loadAttributesFor2D=f,this._enablePick=h,this._loadIndicesForWireframe=p,this._loadPrimitiveOutline=A,this._loadForClassification=m,this._renameBatchIdSemantic=_,this._sortedPropertyTableIds=void 0,this._sortedFeatureTextureIds=void 0,this._gltfJsonLoader=void 0,this._state=sr.NOT_LOADED,this._textureState=sr.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._meshPrimitiveGpmLoader=void 0,this._loadResourcesPromise=void 0,this._resourcesLoaded=!1,this._texturesLoaded=!1,this._supportedImageFormats=void 0,this._postProcessBuffers=[],this._components=void 0}get cacheKey(){}get components(){return this._components}get gltfJson(){return l(this._gltfJsonLoader)?this._gltfJsonLoader.gltf:this._gltfJson}get incrementallyLoadTextures(){return this._incrementallyLoadTextures}get texturesLoaded(){return this._texturesLoaded}async load(){return l(this._promise)?this._promise:(this._promise=GWe(this),this._promise)}_process(t){return this._state===sr.READY?!0:(this._state===sr.PROCESSING&&HWe(this,t),this._resourcesLoaded&&this._state===sr.POST_PROCESSING&&(WWe(this,t.context),this._state=sr.PROCESSED),this._resourcesLoaded&&this._state===sr.PROCESSED?(ude(this),this._typedArray=void 0,this._state=sr.READY,!0):!1)}_processTextures(t){if(this._textureState===sr.READY)return!0;if(this._textureState!==sr.PROCESSING)return!1;let n=!0,i=this._textureLoaders;for(let o=0;o<i.length;++o){let r=i[o].process(t);r&&l(this._textureCallbacks[o])&&(this._textureCallbacks[o](),this._textureCallbacks[o]=void 0),n=n&&r}return n?(this._textureState=sr.READY,this._texturesLoaded=!0,!0):!1}process(t){if(this._state===sr.LOADED&&!l(this._loadResourcesPromise)&&(this._loadResourcesPromise=VWe(this,t).then(()=>{this._resourcesLoaded=!0}).catch(r=>{this._processError=r})),l(this._processError)){this._state=sr.FAILED;let r=this._processError;this._processError=void 0,r8(this,r)}let n=this._textureErrors.pop();if(l(n)){let r=this.getError("Failed to load glTF texture",n);throw r.name="TextureError",r}if(this._state===sr.FAILED)return!1;let i=!1;try{i=this._process(t)}catch(r){this._state=sr.FAILED,r8(this,r)}let o=!1;try{o=this._processTextures(t)}catch(r){this._textureState=sr.FAILED,r8(this,r)}return this._incrementallyLoadTextures?i:i&&o}isUnloaded(){return this._state===sr.UNLOADED}unload(){l(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&Ri.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,t6e(this),ude(this),n6e(this),i6e(this),o6e(this),r6e(this),this._components=void 0,this._typedArray=void 0,this._state=sr.UNLOADED}};async function GWe(e){e._state=sr.LOADING,e._textureState=sr.LOADING;try{let t=Ri.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=sr.LOADED,e._textureState=sr.LOADED,e)}catch(t){if(e.isDestroyed())return;e._state=sr.FAILED,e._textureState=sr.FAILED,r8(e,t)}}async function VWe(e,t){fn.supportsWebP.initialized||await fn.supportsWebP.initialize(),e._supportedImageFormats=new wN({webp:fn.supportsWebP(),basis:t.context.supportsBasis});let n=e6e(e,t);return e._state=sr.PROCESSING,e._textureState=sr.PROCESSING,l(e._gltfJsonLoader)&&e._releaseGltfJson&&(Ri.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),n}function r8(e,t){throw e.unload(),e.getError("Failed to load glTF",t)}function HWe(e,t){let n=!0,i=e._geometryLoaders;for(let a=0;a<i.length;++a){let s=i[a].process(t);s&&l(e._geometryCallbacks[a])&&(e._geometryCallbacks[a](),e._geometryCallbacks[a]=void 0),n=n&&s}let o=e._structuralMetadataLoader;if(l(o)){let a=o.process(t);a&&(e._components.structuralMetadata=o.structuralMetadata),n=n&&a}let r=e._meshPrimitiveGpmLoader;if(l(r)){let a=r.process(t);a&&(l(e._components.structuralMetadata)&&It("structural-metadata-gpm","The model defines both the 'EXT_structural_metadata' extension and the 'NGA_gpm_local' extension. The data from the 'EXT_structural_metadata' extension will be replaced with the data from the 'NGA_gpm_local' extension, and will no longer be available for styling and picking."),e._components.structuralMetadata=r.structuralMetadata),n=n&&a}n&&(e._state=sr.POST_PROCESSING)}function WWe(e,t){let n=e._primitiveLoadPlans;for(let i=0;i<n.length;i++){let o=n[i];o.postProcess(t),(o.needsOutlines||o.needsGaussianSplats)&&jWe(e,o)}}function jWe(e,t){let n=e._postProcessBuffers,i=t.primitive,o=i.outlineCoordinates;l(o)&&n.push(o.buffer);let r=i.attributes;for(let s=0;s<r.length;s++){let c=r[s];l(c.buffer)&&n.push(c.buffer)}let a=i.indices;l(a)&&l(a.buffer)&&n.push(a.buffer)}function YWe(e,t,n,i,o,r,a,s,c){let u=e.gltfJson,h=u.accessors[t].bufferView;return Ri.getVertexBufferLoader({gltf:u,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:c,bufferViewId:h,primitive:i,draco:o,spz:r,attributeSemantic:n,accessorId:t,asynchronous:e._asynchronous,loadBuffer:a,loadTypedArray:s})}function qWe(e,t,n,i,o,r,a){return Ri.getIndexBufferLoader({gltf:e.gltfJson,accessorId:t,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:a,primitive:n,draco:i,asynchronous:e._asynchronous,loadBuffer:o,loadTypedArray:r})}function KWe(e,t){let n=Ri.getBufferViewLoader({gltf:e.gltfJson,bufferViewId:t,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(n),n}function mde(e,t,n){let i=t.byteOffset,o=wu(e,t),r=t.count,a=gf(t.type),s=t.componentType,c=j.getSizeInBytes(s),u=c*a,f=r*a;if(o===u)return n=new Uint8Array(n),j.createArrayBufferView(s,n.buffer,n.byteOffset+i,f);let h=j.createTypedArray(s,f),p=new DataView(n.buffer),A=new Array(a),m=rg(t.componentType);i=n.byteOffset+i;for(let _=0;_<r;++_){m(p,i,a,c,A);for(let y=0;y<a;++y)h[_*a+y]=A[y];i+=o}return h}function XWe(e,t){let n=e.type;if(n===Ut.SCALAR)return t.fill(0);let i=Ut.getMathType(n);return t.fill(i.clone(i.ZERO))}function JWe(e,t,n,i){let o=e.type,r=e.count;if(o===Ut.SCALAR)for(let a=0;a<r;a++)n[a]=t[a];else if(o===Ut.VEC4&&i)for(let a=0;a<r;a++)n[a]=Qe.unpack(t,a*4);else{let a=Ut.getMathType(o),s=Ut.getNumberOfComponents(o);for(let c=0;c<r;c++)n[c]=a.unpack(t,c*s)}return n}async function ZWe(e,t,n,i,o){let{gltfJson:r}=e;if(await t.load(),e.isDestroyed())return;let a=mde(r,n,t.typedArray);i=i??!1,JWe(n,a,o,i)}function My(e,t,n){let i=new Array(t.count),o=t.bufferView;if(l(o)){let r=KWe(e,o),a=ZWe(e,r,t,n,i);return e._loaderPromises.push(a),i}return XWe(t,i)}function vu(e,t){if(l(t))return e===Number?t[0]:e.unpack(t)}function $We(e){return e===Number?0:new e}function eje(e){switch(e){case j.BYTE:return 127;case j.UNSIGNED_BYTE:return 255;case j.SHORT:return 32767;case j.UNSIGNED_SHORT:return 65535;default:return 1}}var tje={VEC2:new k(-1,-1),VEC3:new d(-1,-1,-1),VEC4:new ie(-1,-1,-1,-1)};function nje(e,t){let n=eje(e.componentDatatype),i=tje[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 ije(e,t,n){let i=e.decodeMatrix,o=vu(n,e.decodedMin),r=vu(n,e.decodedMax);l(o)&&l(r)&&(t.min=o,t.max=r);let a=new Cn.Quantization;a.componentDatatype=t.componentDatatype,a.type=t.type,i.length===4?(a.quantizedVolumeOffset=i[2],a.quantizedVolumeStepSize=i[0]):i.length===9?(a.quantizedVolumeOffset=new k(i[6],i[7]),a.quantizedVolumeStepSize=new k(i[0],i[4])):i.length===16?(a.quantizedVolumeOffset=new d(i[12],i[13],i[14]),a.quantizedVolumeStepSize=new d(i[0],i[5],i[10])):i.length===25&&(a.quantizedVolumeOffset=new ie(i[20],i[21],i[22],i[23]),a.quantizedVolumeStepSize=new ie(i[0],i[6],i[12],i[18])),t.quantization=a}function oje(e,t,n,i,o){let r=e.accessors[t],a=Ut.getMathType(r.type),s=r.normalized??!1,c=new yWe;c.name=n,c.semantic=i,c.setIndex=o,c.constant=$We(a),c.componentDatatype=r.componentType,c.normalized=s,c.count=r.count,c.type=r.type,c.min=vu(a,r.min),c.max=vu(a,r.max),c.byteOffset=r.byteOffset,c.byteStride=wu(e,r),xi(r,"WEB3D_quantized_attributes")&&ije(r.extensions.WEB3D_quantized_attributes,c,a);let u=c.semantic===at.POSITION||c.semantic===at.NORMAL||c.semantic===at.TANGENT||c.semantic===at.TEXCOORD||c.semantic===at.FEATURE_ID||c.semantic===at.SCALE||c.semantic===at.ROTATION;return e.extensionsRequired?.includes("KHR_mesh_quantization")&&s&&u&&nje(c,a),c}function pde(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var rje={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function Rq(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let o=t.fromGltfSemantic(i),r=rje;return r.gltfSemantic=n,r.renamedSemantic=i,r.modelSemantic=o,r}function aje(e){let t=e===at.POSITION,n=e===at.FEATURE_ID,i=e===at.TEXCOORD;return t||n||i}function sje(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=j.createArrayBufferView(o,t.typedArray.buffer)}}function cje(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,n&&(e.buffer=t.buffer),i&&l(t.typedArray)&&(e.typedArray=j.createArrayBufferView(e.componentDatatype,t.typedArray.buffer)),e.semantic===at.POSITION){let o=a=>{let s=1/0,c=-1/0,u=1/0,f=-1/0,h=1/0,p=-1/0;for(let A=0;A<a.length;A+=3){let m=a[A],_=a[A+1],y=a[A+2];s=Math.min(s,m),c=Math.max(c,m),u=Math.min(u,_),f=Math.max(f,_),h=Math.min(h,y),p=Math.max(p,y)}return[new d(s,u,h),new d(c,f,p)]},r=e.typedArray;[e.min,e.max]=o(r)}}function lje(e,t,n,i,o,r){if(o&&(n.buffer=i.buffer),r){let a=i.typedArray;n.typedArray=mde(e,t,a),o||(n.byteOffset=0,n.byteStride=void 0)}}function Ade(e,t,n,i,o,r,a,s,c){let u=e.gltfJson,f=u.accessors[t],h=f.bufferView,p=n.gltfSemantic,A=n.renamedSemantic,m=n.modelSemantic,_=l(m)?pde(A):void 0,C=oje(u,t,p,m,_);if(!l(o)&&!l(h)&&!l(r))return C;let E=YWe(e,t,p,i,o,r,a,s,c),b=e._geometryLoaders.length;e._geometryLoaders.push(E);let x=E.load();return e._loaderPromises.push(x),e._geometryCallbacks[b]=()=>{l(o)&&l(o.attributes)&&l(o.attributes[p])?sje(C,E,a,s):l(r)?cje(C,E,a,s):lje(u,f,C,E,a,s)},C}function gde(e,t,n,i,o,r,a,s,c){let u=n.modelSemantic,f=u===at.POSITION,h=u===at.FEATURE_ID,p=f&&!a&&e._loadAttributesFor2D&&!c.scene3DOnly,A=f&&e._enablePick&&!c.context.webgl2,m=e._loadForClassification&&h,_=e._loadAttributesAsTypedArray,y=!_,C=_||p||A||m,x=Ade(e,t,n,i,o,r,s?!1:y,s?!0:C,c),S=new D0.AttributeLoadPlan(x);return S.loadBuffer=y,S.loadTypedArray=C,S}function uje(e,t,n,i,o){let r=e.gltfJson.accessors,a=l(n.ROTATION),s=l(n.TRANSLATION)&&l(r[n.TRANSLATION].min)&&l(r[n.TRANSLATION].max),c=Rq(e,Oa,i),u=c.modelSemantic,f=u===Oa.TRANSLATION||u===Oa.ROTATION||u===Oa.SCALE,h=u===Oa.TRANSLATION,p=e._loadAttributesAsTypedArray||a&&f||!o.context.instancedArrays,A=e._enablePick&&!o.context.webgl2,m=!p,_=e._loadAttributesFor2D&&!o.scene3DOnly;return Ade(e,t,c,void 0,void 0,void 0,m,p||h&&(!s||_||A),o)}function fje(e,t,n,i,o,r){let a=e.gltfJson.accessors[t],s=a.bufferView,c=n.extensions??V.EMPTY_OBJECT,u=c.KHR_draco_mesh_compression,f=l(c.EXT_mesh_primitive_edge_visibility);if(!l(u)&&!l(s))return;let h=new CWe;h.count=a.count;let p=e._loadAttributesAsTypedArray,A=(e._loadIndicesForWireframe||e._enablePick)&&!r.context.webgl2,m=e._loadForClassification&&i,y=!p,C=p||A||m||f,x=qWe(e,t,n,u,o?!1:y,o?!0:C,r),S=e._geometryLoaders.length;e._geometryLoaders.push(x);let B=x.load();e._loaderPromises.push(B),e._geometryCallbacks[S]=()=>{h.indexDatatype=x.indexDatatype,h.buffer=x.buffer,h.typedArray=x.typedArray};let v=new D0.IndicesLoadPlan(h);return v.loadBuffer=y,v.loadTypedArray=C,v}function Yl(e,t,n,i){let o=e.gltfJson,r=Bu.getImageIdFromTexture({gltf:o,textureId:t.index,supportedImageFormats:e._supportedImageFormats});if(!l(r))return;let a=Ri.getTextureLoader({gltf:o,textureInfo:t,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:n,asynchronous:e._asynchronous}),s=Bu.createModelTextureReader({textureInfo:t}),c=e._textureLoaders.length;e._textureLoaders.push(a);let u=a.load().catch(f=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw f;e._textureState=sr.FAILED,e._textureErrors.push(f)}});return e._texturesPromises.push(u),e._textureCallbacks[c]=()=>{s.texture=a.texture,l(i)&&(s.texture.sampler=i)},s}function dje(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:o,diffuseFactor:r,specularFactor:a,glossinessFactor:s}=t,c=new FWe;return l(i)&&(c.diffuseTexture=Yl(e,i,n)),l(o)&&(c.specularGlossinessTexture=Yl(e,o,n)),c.diffuseFactor=vu(ie,r),c.specularFactor=vu(d,a),c.glossinessFactor=s,c}function hje(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:o,baseColorFactor:r,metallicFactor:a,roughnessFactor:s}=t,c=new OWe;return l(i)&&(c.baseColorTexture=Yl(e,i,n)),l(o)&&(c.metallicRoughnessTexture=Yl(e,o,n)),c.baseColorFactor=vu(ie,r),c.metallicFactor=a,c.roughnessFactor=s,c}function mje(e,t,n){let{specularFactor:i,specularTexture:o,specularColorFactor:r,specularColorTexture:a}=t,s=new QWe;return l(o)&&(s.specularTexture=Yl(e,o,n)),l(a)&&(s.specularColorTexture=Yl(e,a,n)),s.specularFactor=i,s.specularColorFactor=vu(d,r),s}function pje(e,t,n){let{anisotropyStrength:i=Dq.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=Dq.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:r}=t,a=new Dq;return l(r)&&(a.anisotropyTexture=Yl(e,r,n)),a.anisotropyStrength=i,a.anisotropyRotation=o,a}function Aje(e,t,n){let{clearcoatFactor:i=vq.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:r=vq.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:a,clearcoatNormalTexture:s}=t,c=new vq;return l(o)&&(c.clearcoatTexture=Yl(e,o,n)),l(a)&&(c.clearcoatRoughnessTexture=Yl(e,a,n)),l(s)&&(c.clearcoatNormalTexture=Yl(e,s,n)),c.clearcoatFactor=i,c.clearcoatRoughnessFactor=r,c}function gje(e){if(!l(e))return;let t=new kWe;if(l(e.width)){let n=e.width;n>0&&Math.floor(n)===n&&(t.width=n)}if(l(e.pattern)){let n=e.pattern;n>=0&&n<=65535&&Math.floor(n)===n&&(t.pattern=n)}if(!(!l(t.width)&&!l(t.pattern)))return t}function _je(e,t,n){let i=new UWe,o=t.extensions??V.EMPTY_OBJECT,r=o.KHR_materials_pbrSpecularGlossiness,a=o.KHR_materials_specular,s=o.KHR_materials_anisotropy,c=o.KHR_materials_clearcoat,u=t.pbrMetallicRoughness;i.unlit=l(o.KHR_materials_unlit),l(r)?i.specularGlossiness=dje(e,r,n):(l(u)&&(i.metallicRoughness=hje(e,u,n)),l(a)&&!i.unlit&&(i.specular=mje(e,a,n)),l(s)&&!i.unlit&&(i.anisotropy=pje(e,s,n)),l(c)&&!i.unlit&&(i.clearcoat=Aje(e,c,n))),l(t.emissiveTexture)&&(i.emissiveTexture=Yl(e,t.emissiveTexture,n)),l(t.normalTexture)&&!e._loadForClassification&&(i.normalTexture=Yl(e,t.normalTexture,n)),l(t.occlusionTexture)&&(i.occlusionTexture=Yl(e,t.occlusionTexture,n)),i.emissiveFactor=vu(d,t.emissiveFactor),i.alphaMode=t.alphaMode,i.alphaCutoff=t.alphaCutoff,i.doubleSided=t.doubleSided;let f=o.BENTLEY_materials_point_style;if(l(f)&&l(f.diameter)){let h=f.diameter;h>=1&&(i.pointDiameter=Math.floor(h))}return i.lineStyle=gje(o.BENTLEY_materials_line_style),i}function _de(e,t){let n=new fde;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 yde(e,t,n,i){let o=new fde,r=e.featureIds;return o.featureCount=n,o.propertyTableId=t,o.setIndex=pde(r.attribute),o.positionalLabel=i,o}function Cde(e,t){let n=new hde;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 Ede(e,t,n,i){let o=new hde,r=e.featureIds;o.propertyTableId=t,o.featureCount=n,o.offset=r.constant??0;let a=r.divisor??0;return o.repeat=a===0?void 0:a,o.positionalLabel=i,o}function yje(e,t,n,i){let o=new dde;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=Yl(e,r,n,jt.NEAREST);let s=(l(r.channels)?r.channels:[0]).map(function(c){return"rgba".charAt(c)}).join("");return o.textureReader.channels=s,o}function Cje(e,t,n,i,o,r){let a=new dde,s=t.featureIds,c=s.texture;return a.featureCount=o,a.propertyTableId=n,a.textureReader=Yl(e,c,i,jt.NEAREST),a.textureReader.channels=s.channels,a.positionalLabel=r,a}function Eje(e,t,n,i,o){let r=new EWe,a=void 0,s=void 0,c=void 0,u=!1;for(let f in t){if(!t.hasOwnProperty(f))continue;let h=t[f],p=Rq(e,at,f),A=gde(e,h,p,a,s,c,u,n,o);r.attributes.push(A.attribute),i.attributePlans.push(A)}return r}function bje(e){let i=e?.KHR_gaussian_splatting?.extensions?.KHR_gaussian_splatting_compression_spz_2;if(l(i))return i}function bde(e,t){if(!l(t))return;let n=e.gltfJson.materials;if(!l(n)||t<0||t>=n.length)return;let i=n[t];if(!l(i))return;let o=i.pbrMetallicRoughness??V.EMPTY_OBJECT,r=vu(ie,o.baseColorFactor);return l(r)?r:new ie(1,1,1,1)}function Ije(e){switch(e){case j.UNSIGNED_BYTE:return 255;case j.UNSIGNED_SHORT:return 65535;case j.UNSIGNED_INT:return 4294967295;default:throw new ue("EXT_mesh_primitive_edge_visibility line strings indices must use unsigned scalar component types.")}}function xje(e,t,n){if(!l(t)||t.length===0)return;let i=new Array(t.length);for(let o=0;o<t.length;o++){let r=t[o]??V.EMPTY_OBJECT,a=r.indices,s=e.gltfJson.accessors[a];if(!l(s))throw new ue("Edge visibility line string accessor not found!");let c=My(e,s),u=Ije(s.componentType),f=l(r.material)?r.material:n;i[o]={indices:c,restartIndex:u,componentType:s.componentType,materialColor:bde(e,f)}}return i}function Tje(e,t){if(!l(t))return;let n={},i=t.visibility;if(l(i)){let o=e.gltfJson.accessors[i];if(!l(o))throw new ue("Edge visibility accessor not found!");n.visibility=My(e,o)}if(n.materialColor=bde(e,t.material),l(t.silhouetteNormals)){let o=e.gltfJson.accessors[t.silhouetteNormals];l(o)&&(n.silhouetteNormals=My(e,o))}return l(t.lineStrings)&&(n.lineStrings=xje(e,t.lineStrings,t.material)),n}function Sje(e,t,n,i){let o=new bWe,r=new D0(o);e._primitiveLoadPlans.push(r);let a=t.material;l(a)&&(o.material=_je(e,e.gltfJson.materials[a],i));let s=t.extensions??V.EMPTY_OBJECT,c=s.CESIUM_mesh_vector;l(c)&&(o.vector=Bje(e,c));let u=!1,f=s.CESIUM_primitive_outline;e._loadPrimitiveOutline&&l(f)&&(u=!0,r.needsOutlines=!0,r.outlineIndices=wje(e,f,r)),o.edgeVisibility=Tje(e,s.EXT_mesh_primitive_edge_visibility);let h=bje(s);l(h)&&(u=!0,r.needsGaussianSplats=!0);let p=e._loadForClassification,A=s.KHR_draco_mesh_compression,m=!1,_=t.attributes;if(l(_))for(let P in _){if(!_.hasOwnProperty(P))continue;let N=_[P],L=Rq(e,at,P),g=L.modelSemantic;if(p&&!aje(g))continue;g===at.FEATURE_ID&&(m=!0);let I=gde(e,N,L,t,A,h,n,u,i);r.attributePlans.push(I),o.attributes.push(I.attribute)}let y=t.targets;if(l(y)&&!p)for(let P=0;P<y.length;++P)o.morphTargets.push(Eje(e,y[P],u,r,i));let C=t.indices;if(l(C)){let P=fje(e,C,t,m,u,i);l(P)&&(r.indicesPlan=P,o.indices=P.indices)}let E=s.EXT_structural_metadata,b=s.EXT_mesh_features,x=s.EXT_feature_metadata,S=l(x),B=s.NGA_gpm_local;l(b)?Dje(e,o,b,i):S&&vje(e,o,x,i),l(E)?Pje(o,E):S&&Rje(e,o,x),l(B)&&Mje(o,B);let v=t.mode;if(p&&v!==ve.TRIANGLES)throw new ue("Only triangle meshes can be used for classification.");return o.primitiveType=v,o}function wje(e,t){let n=t.indices,i=e.gltfJson.accessors[n];return My(e,i,!1)}function Bje(e,t){if(!l(t))return;let n=new zWe;n.vector=t.vector,n.count=t.count;let i=e.gltfJson.accessors;function o(r,a){if(l(r))return My(e,i[r])}return n.polygonAttributeOffsets=o(t.polygonAttributeOffsets,"polygonAttributeOffsets"),n.polygonHoleCounts=o(t.polygonHoleCounts,"polygonHoleCounts"),n.polygonHoleOffsets=o(t.polygonHoleOffsets,"polygonHoleOffsets"),n.polygonIndicesOffsets=o(t.polygonIndicesOffsets,"polygonIndicesOffsets"),n}function Dje(e,t,n,i){let o;l(n)&&l(n.featureIds)?o=n.featureIds:o=[];for(let r=0;r<o.length;r++){let a=o[r],s=`featureId_${r}`,c;l(a.texture)?c=yje(e,a,i,s):l(a.attribute)?c=_de(a,s):c=Cde(a,s),t.featureIds.push(c)}}function vje(e,t,n,i){let{featureTables:o}=e.gltfJson.extensions.EXT_feature_metadata,r=0,a=n.featureIdAttributes;if(l(a))for(let c=0;c<a.length;++c){let u=a[c],f=u.featureTable,h=e._sortedPropertyTableIds.indexOf(f),p=o[f].count,A=`featureId_${r}`;r++;let m;l(u.featureIds.attribute)?m=yde(u,h,p,A):m=Ede(u,h,p,A),t.featureIds.push(m)}let s=n.featureIdTextures;if(l(s))for(let c=0;c<s.length;++c){let u=s[c],f=u.featureTable,h=e._sortedPropertyTableIds.indexOf(f),p=o[f].count,A=`featureId_${r}`;r++;let m=Cje(e,u,h,i,p,A);t.featureIds.push(m)}}function Pje(e,t){if(!l(t))return;let{propertyTextures:n,propertyAttributes:i}=t;l(n)&&(e.propertyTextureIds=n),l(i)&&(e.propertyAttributeIds=i)}function Rje(e,t,n){l(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map(function(i){return e._sortedFeatureTextureIds.indexOf(i)}))}function Mje(e,t){let n=t.ppeTextures??[];for(let i=0;i<n.length;i++)e.propertyTextureIds.push(i)}function Nje(e,t,n){let i=t.EXT_mesh_gpu_instancing,o=new IWe,r=i.attributes;if(l(r))for(let u in r){if(!r.hasOwnProperty(u))continue;let f=r[u];o.attributes.push(uje(e,f,r,u,n))}let a=i.extensions??V.EMPTY_OBJECT,s=t.EXT_instance_features,c=a.EXT_feature_metadata;return l(s)?Lje(o,s):l(c)&&Oje(e.gltfJson,o,c,e._sortedPropertyTableIds),o}function Lje(e,t){let n=t.featureIds;for(let i=0;i<n.length;i++){let o=n[i],r=`instanceFeatureId_${i}`,a;l(o.attribute)?a=_de(o,r):a=Cde(o,r),e.featureIds.push(a)}}function Oje(e,t,n,i){let o=e.extensions.EXT_feature_metadata.featureTables,r=n.featureIdAttributes;if(l(r))for(let a=0;a<r.length;++a){let s=r[a],c=s.featureTable,u=i.indexOf(c),f=o[c].count,h=`instanceFeatureId_${a}`,p;l(s.featureIds.attribute)?p=yde(s,u,f,h):p=Ede(s,u,f,h),t.featureIds.push(p)}}function Fje(e,t,n){let i=new TWe;i.name=t.name,i.matrix=vu(M,t.matrix),i.translation=vu(d,t.translation),i.rotation=vu(Qe,t.rotation),i.scale=vu(d,t.scale);let o=t.extensions??V.EMPTY_OBJECT,r=o.EXT_mesh_gpu_instancing,a=o.AGI_articulations,s=o.CESIUM_mesh_vector;if(l(r)){if(e._loadForClassification)throw new ue("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");i.instances=Nje(e,o,n)}l(a)&&(i.articulationName=a.articulationName),l(s)&&(i.meshVector=s);let c=t.mesh;if(l(c)){let u=e.gltfJson.meshes[c],f=FN(u);for(let A=0;A<f.length;++A)i.primitives.push(Sje(e,f[A],l(i.instances),n));let h=t.weights??u.weights,p=i.primitives[0].morphTargets;i.morphWeights=l(h)?h.slice():new Array(p.length).fill(0)}return i}function Qje(e,t){let n=e.gltfJson.nodes;if(!l(n))return[];let i=n.map(function(o,r){let a=Fje(e,o,t);return a.index=r,a});for(let o=0;o<i.length;++o){let r=n[o].children;if(l(r))for(let a=0;a<r.length;++a)i[o].children.push(i[r[a]])}return i}function kje(e,t,n){let i=new xWe,o=t.joints;i.joints=o.map(a=>n[a]);let r=t.inverseBindMatrices;if(l(r)){let a=e.gltfJson.accessors[r];i.inverseBindMatrices=My(e,a)}else i.inverseBindMatrices=new Array(o.length).fill(M.IDENTITY);return i}function Uje(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!l(n))return[];let i=n.map(function(r,a){let s=kje(e,r,t);return s.index=a,s}),o=e.gltfJson.nodes;for(let r=0;r<t.length;++r){let a=o[r].skin;l(a)&&(t[r].skin=i[a])}return i}async function zje(e,t,n,i){let o=new SN({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()}async function Gje(e,t,n,i){let o=new ON({gltf:t,extension:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:i,asynchronous:e._asynchronous});return e._meshPrimitiveGpmLoader=o,o.load()}function Vje(e,t){let n=new wWe,i=e.gltfJson.accessors,o=i[t.input];n.input=My(e,o);let r=t.interpolation;n.interpolation=qh[r]??qh.LINEAR;let a=i[t.output];return n.output=My(e,a,!0),n}function Hje(e,t){let n=new BWe,i=e.node;if(!l(i))return;n.node=t[i];let o=e.path.toUpperCase();return n.path=SWe[o],n}function Wje(e,t,n){let i=new DWe,o=e.sampler;return i.sampler=t[o],i.target=Hje(e.target,n),i}function jje(e,t,n){let i=new vWe;i.name=t.name;let o=t.samplers.map(function(a,s){let c=Vje(e,a);return c.index=s,c}),r=t.channels.map(function(a){return Wje(a,o,n)});return i.samplers=o,i.channels=r,i}function Yje(e,t){let n=e.gltfJson.animations;return e._loadForClassification||!l(n)?[]:n.map(function(o,r){let a=jje(e,o,t);return a.index=r,a})}function qje(e){let t=new PWe;t.name=e.name;let n=e.type.toUpperCase();return t.type=tl[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function Kje(e){let t=new RWe;return t.name=e.name,t.stages=e.stages.map(qje),t}function Xje(e){let n=(e.extensions??V.EMPTY_OBJECT).AGI_articulations?.articulations;return l(n)?n.map(Kje):[]}function Jje(e){let t;return l(e.scenes)&&l(e.scene)&&(t=e.scenes[e.scene].nodes),t=t??e.nodes,t=l(t)?t:[],t}function Zje(e,t){let n=new NWe,i=Jje(e);return n.nodes=i.map(function(o){return t[o]}),n}var $je=new d;function e6e(e,t){let n=e.gltfJson,i=n.extensions??V.EMPTY_OBJECT,o=i.EXT_structural_metadata,r=i.EXT_feature_metadata,a=i.CESIUM_RTC;if(l(r)){let E=r.featureTables,b=r.featureTextures,x=l(E)?E:[],S=l(b)?b:[];e._sortedPropertyTableIds=Object.keys(x).sort(),e._sortedFeatureTextureIds=Object.keys(S).sort()}let s=Qje(e,t),c=Uje(e,s),u=Yje(e,s),f=Xje(n),h=Zje(n,s),p=new LWe,A=new MWe,m=n.asset.copyright;if(l(m)){let E=m.split(";").map(function(b){return new Et(b.trim())});A.credits=E}if(p.asset=A,p.scene=h,p.nodes=s,p.skins=c,p.animations=u,p.articulations=f,p.upAxis=e._upAxis,p.forwardAxis=e._forwardAxis,l(a)){let E=d.fromArray(a.center,0,$je);p.transform=M.fromTranslation(E,p.transform)}if(e._components=p,l(o)||l(r)){let E=zje(e,o,r,t);e._loaderPromises.push(E)}let _=i.NGA_gpm_local;if(l(_)){let E=RN.load(_);e._components.extensions.NGA_gpm_local=E}let y=n.meshes;if(l(y))for(let E of y){let b=E.primitives;if(l(b))for(let x of b){let S=x.extensions;if(l(S)){let B=S.NGA_gpm_local;if(l(B)){let v=Gje(e,n,B,t);e._loaderPromises.push(v)}}}}let C=[];return oi(C,e._loaderPromises),e._incrementallyLoadTextures||oi(C,e._texturesPromises),Promise.all(C)}function t6e(e){let t=e._textureLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Ri.unload(t[n]);e._textureLoaders.length=0}function ude(e){let t=e._bufferViewLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Ri.unload(t[n]);e._bufferViewLoaders.length=0}function n6e(e){let t=e._geometryLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Ri.unload(t[n]);e._geometryLoaders.length=0}function i6e(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 o6e(e){l(e._structuralMetadataLoader)&&!e._structuralMetadataLoader.isDestroyed()&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0)}function r6e(e){l(e._meshPrimitiveGpmLoader)&&!e._meshPrimitiveGpmLoader.isDestroyed()&&(e._meshPrimitiveGpmLoader.destroy(),e._meshPrimitiveGpmLoader=void 0)}var _f=Pq;var QN=`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 bT(){this._framebuffer=new Ei({colorAttachmentsLength:2,depth:!0,supportsDepthTexture:!0}),this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}Object.defineProperties(bT.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 a6e(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var Mq=new k;function s6e(e,t){let n=new We({defines:["LOG_DEPTH_WRITE"],sources:[QN]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return Mq.x=e._radius,Mq.y=e._strength,Mq}},o=Ve.fromCache({blending:sn.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:Yt.setCesium3DTileBit(),stencilMask:Yt.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(n,{uniformMap:i,renderState:o,pass:Be.CESIUM_3D_TILE,owner:e}),e._clearCommand=new fi({framebuffer:e.framebuffer,color:new z(0,0,0,0),depth:1,renderState:Ve.fromCache(),pass:Be.CESIUM_3D_TILE,owner:e})}function c6e(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),s6e(e,t)}function Ide(e){return e.drawBuffers&&e.fragmentDepth}bT.isSupported=Ide;function l6e(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=We.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}bT.prototype.update=function(e,t,n,i){if(!Ide(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,c6e(this,e.context);let o,r=e.commandList,a=r.length;for(o=t;o<a;++o){let u=r[o];if(u.primitiveType!==ve.POINTS||u.pass===Be.TRANSLUCENT)continue;let f,h,p=u.derivedCommands.pointCloudProcessor;l(p)&&(f=p.command,h=p.originalShaderProgram),(!l(f)||u.dirty||h!==u.shaderProgram||f.framebuffer!==this.framebuffer)&&(f=nt.shallowClone(u,f),f.framebuffer=this.framebuffer,f.shaderProgram=l6e(e.context,u.shaderProgram),f.castShadows=!1,f.receiveShadows=!1,l(p)||(p={command:f,originalShaderProgram:u.shaderProgram},u.derivedCommands.pointCloudProcessor=p),p.originalShaderProgram=u.shaderProgram),r[o]=f}let s=this._clearCommand,c=this._drawCommand;c.boundingVolume=i,r.push(c),r.push(s)};bT.prototype.isDestroyed=function(){return!1};bT.prototype.destroy=function(){return a6e(this),fe(this)};var hg=bT;function xde(e){let t=e??{};this.attenuation=t.attenuation??!1,this.geometricErrorScale=t.geometricErrorScale??1,this.maximumAttenuation=t.maximumAttenuation,this.baseResolution=t.baseResolution,this.eyeDomeLighting=t.eyeDomeLighting??!0,this.eyeDomeLightingStrength=t.eyeDomeLightingStrength??1,this.eyeDomeLightingRadius=t.eyeDomeLightingRadius??1,this.backFaceCulling=t.backFaceCulling??!1,this.normalShading=t.normalShading??!0}xde.isSupported=function(e){return hg.isSupported(e.context)};var Ep=xde;var vc={},u6e=new ie(0,0,0,1),nl=new ie,f6e=new et,Nq=new k,Lq=new k;vc.worldToWindowCoordinates=function(e,t,n){return vc.worldWithEyeOffsetToWindowCoordinates(e,t,d.ZERO,n)};var Tde=new ie,Sde=new d;function kN(e,t,n,i){let o=n.viewMatrix,r=M.multiplyByVector(o,ie.fromElements(e.x,e.y,e.z,1,Tde),Tde),a=d.multiplyComponents(t,d.normalize(r,Sde),Sde);return r.x+=t.x+a.x,r.y+=t.y+a.y,r.z+=a.z,M.multiplyByVector(n.frustum.projectionMatrix,r,i)}var d6e=new me(Math.PI,D.PI_OVER_TWO),h6e=new d,m6e=new d;vc.worldWithEyeOffsetToWindowCoordinates=function(e,t,n,i){let o=e.frameState,r=vc.computeActualEllipsoidPosition(o,t,u6e);if(!l(r))return;let a=e.canvas,s=f6e;s.x=0,s.y=0,s.width=a.clientWidth,s.height=a.clientHeight;let c=e.camera,u=!1;if(o.mode===oe.SCENE2D){let f=e.mapProjection,h=d6e,p=f.project(h,h6e),A=d.clone(c.position,m6e),m=c.frustum.clone(),_=M.computeViewportTransformation(s,0,1,new M),y=c.frustum.projectionMatrix,C=c.positionWC.y,E=d.fromElements(D.sign(C)*p.x-C,0,-c.positionWC.x),b=At.pointToGLWindowCoordinates(y,_,E);if(C===0||b.x<=0||b.x>=a.clientWidth)u=!0;else{if(b.x>a.clientWidth*.5){s.width=b.x,c.frustum.right=p.x-C,nl=kN(r,n,c,nl),vc.clipToGLWindowCoordinates(s,nl,Nq),s.x+=b.x,c.position.x=-c.position.x;let x=c.frustum.right;c.frustum.right=-c.frustum.left,c.frustum.left=-x,nl=kN(r,n,c,nl),vc.clipToGLWindowCoordinates(s,nl,Lq)}else{s.x+=b.x,s.width-=b.x,c.frustum.left=-p.x-C,nl=kN(r,n,c,nl),vc.clipToGLWindowCoordinates(s,nl,Nq),s.x=s.x-s.width,c.position.x=-c.position.x;let x=c.frustum.left;c.frustum.left=-c.frustum.right,c.frustum.right=-x,nl=kN(r,n,c,nl),vc.clipToGLWindowCoordinates(s,nl,Lq)}d.clone(A,c.position),c.frustum=m.clone(),i=k.clone(Nq,i),(i.x<0||i.x>a.clientWidth)&&(i.x=Lq.x)}}if(o.mode!==oe.SCENE2D||u){if(nl=kN(r,n,c,nl),nl.z<0&&!(c.frustum instanceof An)&&!(c.frustum instanceof ua))return;i=vc.clipToGLWindowCoordinates(s,nl,i)}return i.y=a.clientHeight-i.y,i};vc.worldToDrawingBufferCoordinates=function(e,t,n){if(n=vc.worldToWindowCoordinates(e,t,n),!!l(n))return vc.transformWindowToDrawingBuffer(e,n,n)};var mg=new d,p6e=new me;vc.computeActualEllipsoidPosition=function(e,t,n){let i=e.mode;if(i===oe.SCENE3D)return d.clone(t,n);let o=e.mapProjection,r=o.ellipsoid.cartesianToCartographic(t,p6e);if(!l(r))return;if(o.project(r,mg),i===oe.COLUMBUS_VIEW)return d.fromElements(mg.z,mg.x,mg.y,n);if(i===oe.SCENE2D)return d.fromElements(0,mg.x,mg.y,n);let a=e.morphTime;return d.fromElements(D.lerp(mg.z,t.x,a),D.lerp(mg.x,t.y,a),D.lerp(mg.y,t.z,a),n)};var wde=new d,Bde=new d,Dde=new M;vc.clipToGLWindowCoordinates=function(e,t,n){return d.divideByScalar(t,t.w,wde),M.computeViewportTransformation(e,0,1,Dde),M.multiplyByPoint(Dde,wde,Bde),k.fromCartesian3(Bde,n)};vc.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,o=e.drawingBufferWidth/i.clientWidth,r=e.drawingBufferHeight/i.clientHeight;return k.fromElements(t.x*o,t.y*r,n)};var A6e=new ie,vde=new ie;vc.drawingBufferToWorldCoordinates=function(e,t,n,i){let r=e.context.uniformState,a=r.currentFrustum,s=a.x,c=a.y;if(e.frameState.useLogDepth){let A=n*r.log2FarDepthFromNearPlusOne,m=Math.pow(2,A)-1;n=c*(1-s/(m+s))/(c-s)}let u=e.view.passState.viewport,f=ie.clone(ie.UNIT_W,A6e);f.x=(t.x-u.x)/u.width*2-1,f.y=(t.y-u.y)/u.height*2-1,f.z=n*2-1,f.w=1;let h,p=e.camera.frustum;if(l(p.fovy)){h=M.multiplyByVector(r.inverseViewProjection,f,vde);let A=1/h.w;d.multiplyByScalar(h,A,h)}else{let A=p.offCenterFrustum;l(A)&&(p=A),h=vde,h.x=(f.x*(p.right-p.left)+p.left+p.right)*.5,h.y=(f.y*(p.top-p.bottom)+p.bottom+p.top)*.5,h.z=(f.z*(s-c)-s-c)*.5,h.w=1,h=M.multiplyByVector(r.inverseView,h,h)}return d.fromCartesian4(h,i)};var so=vc;var IT={};IT._deprecationWarning=Ms;var pg=Uint32Array.BYTES_PER_ELEMENT;IT.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),o=new DataView(e);t+=pg;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+=pg;let a=o.getUint32(t,!0);t+=pg;let s=o.getUint32(t,!0);t+=pg;let c=o.getUint32(t,!0);t+=pg;let u=o.getUint32(t,!0);t+=pg;let f=o.getUint32(t,!0);t+=pg;let h;u>=570425344?(t-=pg*2,h=s,u=c,f=0,s=0,c=0,IT._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.")):f>=570425344&&(t-=pg,h=u,u=s,f=c,s=0,c=0,IT._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;s===0?p={BATCH_LENGTH:h??0}:(p=Br(i,t,s),t+=s);let A=new Uint8Array(e,t,c);t+=c;let m,_;u>0&&(m=Br(i,t,u),t+=u,f>0&&(_=new Uint8Array(e,t,f),_=new Uint8Array(_),t+=f));let y=n+a-t;if(y===0)throw new ue("glTF byte length must be greater than 0.");let C;return t%4===0?C=new Uint8Array(e,t,y):(IT._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),C=new Uint8Array(i.subarray(t,t+y))),{batchLength:h,featureTableJson:p,featureTableBinary:A,batchTableJson:m,batchTableBinary:_,gltf:C}};var UN=IT;function zN(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function Pde(e,t,n,i,o,r){let a=e._cachedTypedArrays,s=a[t];return l(s)||(s=j.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+r,o*i),a[t]=s),s}function g6e(e,t,n,i){let o=e._cachedTypedArrays,r=o[t];return l(r)||(r=j.createTypedArray(n,i),o[t]=r),r}zN.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(t=t??j.UNSIGNED_INT,n=n??1,Pde(this,e,t,n,1,i.byteOffset)):i};zN.prototype.hasProperty=function(e){return l(this.json[e])};zN.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(l(i.componentType)&&(t=j.fromName(i.componentType)),Pde(this,e,t,n,this.featuresLength,i.byteOffset)):g6e(this,e,t,i)};zN.prototype.getProperty=function(e,t,n,i,o){let r=this.json[e];if(!l(r))return;let a=this.getPropertyArray(e,t,n);if(n===1)return a[i];for(let s=0;s<n;++s)o[s]=a[n*i+s];return o};var Kh=zN;function GN(e){let t=e.count,n=e.batchTable,i=e.binaryBody,o=e.parseAsPropertyAttributes??!1,r=e.customAttributeOutput,a=_6e(n),s;l(a.jsonProperties)&&(s=new fg({count:t,properties:a.jsonProperties}));let c;l(a.hierarchy)&&(c=new l0({extension:a.hierarchy,binaryBody:i}));let u=Wh.BATCH_TABLE_CLASS_NAME,f=a.binaryProperties,h,p,A;if(o){let y=C6e(t,u,f,i,r);A=y.transcodedSchema,p=[new w0({propertyAttribute:y.propertyAttributeJson,class:y.transcodedClass})]}else{let y=y6e(t,u,f,i);A=y.transcodedSchema;let C=y.featureTableJson;h=new xd({count:C.count,properties:C.properties,class:y.transcodedClass,bufferViews:y.bufferViewsTypedArrays}),p=[]}let m=[];if(l(h)||l(s)||l(c)){let y=new jl({id:0,name:"Batch Table",count:t,metadataTable:h,jsonMetadataTable:s,batchTableHierarchy:c});m.push(y)}let _={schema:A,propertyTables:m,propertyAttributes:p,extensions:a.extensions,extras:a.extras};return new Os(_)}function _6e(e){let t=e.HIERARCHY,n=e.extras,i=e.extensions,o;l(t)?(GN._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,a={};for(let s in e){if(!e.hasOwnProperty(s)||s==="HIERARCHY"||s==="extensions"||s==="extras")continue;let c=e[s];Array.isArray(c)?(r=l(r)?r:{},r[s]=c):a[s]=c}return{binaryProperties:a,jsonProperties:r,hierarchy:o,extras:n,extensions:i}}function y6e(e,t,n,i){let o={},r={},a={},s=0;for(let h in n){if(!n.hasOwnProperty(h))continue;if(!l(i))throw new ue(`Property ${h} requires a batch table binary.`);let p=n[h],A=bd(p);r[h]={bufferView:s},o[h]=Rde(p),a[s]=A.createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e),s++}let c={classes:{}};c.classes[t]={properties:o};let u=Vl.fromJson(c);return{featureTableJson:{class:t,count:e,properties:r},bufferViewsTypedArrays:a,transcodedSchema:u,transcodedClass:u.classes[t]}}function C6e(e,t,n,i,o){let r={},a={},s=0;for(let h in n){if(!n.hasOwnProperty(h))continue;let p=n[h];if(!l(i)&&!l(p.typedArray))throw new ue(`Property ${h} requires a batch table binary.`);let A=xt.sanitizeGlslIdentifier(h);(A===""||r.hasOwnProperty(A))&&(A=`property_${s}`,s++);let m=Rde(p);m.name=h,r[A]=m;let _=A.toUpperCase();_.startsWith("_")||(_=`_${_}`);let y=p.typedArray;l(y)||(y=bd(p).createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e));let C=new Cn.Attribute;C.name=_,C.count=e,C.type=p.type;let E=j.fromTypedArray(y);(E===j.INT||E===j.UNSIGNED_INT||E===j.DOUBLE)&&(GN._oneTimeWarning("Cast pnts property to floats",`Point cloud property "${_}" 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.`),y=new Float32Array(y)),C.componentDatatype=j.fromTypedArray(y),C.typedArray=y,o.push(C),a[A]={attribute:_}}let c={classes:{}};c.classes[t]={properties:r};let u=Vl.fromJson(c);return{class:t,propertyAttributeJson:{properties:a},transcodedSchema:u,transcodedClass:u.classes[t]}}function Rde(e){let t=E6e(e.componentType);return{type:e.type,componentType:t}}function E6e(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"}}GN._deprecationWarning=Ms;GN._oneTimeWarning=It;var Ag=GN;var v0={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},b6e=Cn.FeatureIdAttribute,Oq=class extends Ki{constructor(t){super(),t=t??V.EMPTY_OBJECT;let n=t.b3dmResource,i=t.baseResource,o=t.arrayBuffer,r=t.byteOffset??0,a=t.releaseGltfJson??!1,s=t.asynchronous??!0,c=t.incrementallyLoadTextures??!0,u=t.upAxis??ao.Y,f=t.forwardAxis??ao.X,h=t.loadAttributesAsTypedArray??!1,p=t.loadAttributesFor2D??!1,A=t.enablePick??!1,m=t.loadIndicesForWireframe??!1,_=t.loadPrimitiveOutline??!0,y=t.loadForClassification??!1;i=l(i)?i:n.clone(),this._b3dmResource=n,this._baseResource=i,this._arrayBuffer=o,this._byteOffset=r,this._releaseGltfJson=a,this._asynchronous=s,this._incrementallyLoadTextures=c,this._upAxis=u,this._forwardAxis=f,this._loadAttributesAsTypedArray=h,this._loadAttributesFor2D=p,this._enablePick=A,this._loadIndicesForWireframe=m,this._loadPrimitiveOutline=_,this._loadForClassification=y,this._state=v0.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=M.IDENTITY}get texturesLoaded(){return this._gltfLoader?.texturesLoaded}get cacheKey(){}get components(){return this._components}load(){if(l(this._promise))return this._promise;let t=UN.parse(this._arrayBuffer,this._byteOffset),n=t.batchLength,i=t.featureTableJson,o=t.featureTableBinary,r=t.batchTableJson,a=t.batchTableBinary,s=new Kh(i,o);n=s.getGlobalProperty("BATCH_LENGTH"),this._batchLength=n;let c=s.getGlobalProperty("RTC_CENTER",j.FLOAT,3);l(c)&&(this._transform=M.fromTranslation(d.fromArray(c))),this._batchTable={json:r,binary:a};let u=new _f({typedArray:t.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=u,this._state=v0.LOADING;let f=this;return this._promise=u.load().then(function(){if(!f.isDestroyed())return f._state=v0.PROCESSING,f}).catch(function(h){if(!f.isDestroyed())return I6e(f,h)}),this._promise}process(t){if(this._state===v0.READY)return!0;if(this._state!==v0.PROCESSING||!this._gltfLoader.process(t))return!1;let i=this._gltfLoader.components;return i.transform=M.multiplyTransformation(this._transform,i.transform,i.transform),x6e(this,i),this._components=i,this._arrayBuffer=void 0,this._state=v0.READY,!0}unload(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),this._components=void 0,this._arrayBuffer=void 0}};function I6e(e,t){return e.unload(),e._state=v0.FAILED,t=e.getError("Failed to load b3dm",t),Promise.reject(t)}function x6e(e,t){let n=e._batchTable,i=e._batchLength;if(i===0)return;let o;if(l(n.json))o=Ag({count:i,batchTable:n.json,binaryBody:n.binary});else{let s=new jl({name:Wh.BATCH_TABLE_CLASS_NAME,count:i});o=new Os({schema:{},propertyTables:[s]})}let r=t.scene.nodes,a=r.length;for(let s=0;s<a;s++)Mde(r[s]);t.structuralMetadata=o}function Mde(e){let t=e.children.length;for(let i=0;i<t;i++)Mde(e.children[i]);let n=e.primitives.length;for(let i=0;i<n;i++){let o=e.primitives[i],r=xt.getAttributeBySemantic(o,at.FEATURE_ID);if(l(r)){r.setIndex=0;let a=new b6e;a.propertyTableId=0,a.setIndex=0,a.positionalLabel="featureId_0",o.featureIds.push(a)}}}var VN=Oq;var Fq=class extends Ki{constructor(t){super(),t=t??V.EMPTY_OBJECT,this._geoJson=t.geoJson,this._components=void 0}get cacheKey(){}get components(){return this._components}load(){return Promise.resolve(this)}process(t){return l(this._components)||(this._components=F6e(this._geoJson,t),this._geoJson=void 0),!0}unload(){this._components=void 0}};function T6e(){this.lines=void 0,this.points=void 0,this.properties=void 0}function S6e(){this.features=[]}function Qq(e){let t=e[0],n=e[1],i=e[2]??0;return new d(t,n,i)}function kq(e){let t=e.length,n=new Array(t);for(let o=0;o<t;o++)n[o]=Qq(e[o]);return[n]}function w6e(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=kq(e[i])[0];return n}function Nde(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=kq(e[i])[0];return n}function B6e(e){let t=e.length,n=[];for(let i=0;i<t;i++){let o=Nde(e[i]);oi(n,o)}return n}function D6e(e){return[Qq(e)]}function v6e(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=Qq(e[i]);return n}var P6e={LineString:kq,MultiLineString:w6e,MultiPolygon:B6e,Polygon:Nde,MultiPoint:v6e,Point:D6e},R6e={LineString:ve.LINES,MultiLineString:ve.LINES,MultiPolygon:ve.LINES,Polygon:ve.LINES,MultiPoint:ve.POINTS,Point:ve.POINTS};function Lde(e,t){if(!l(e.geometry))return;let n=e.geometry.type,i=P6e[n],o=R6e[n],r=e.geometry.coordinates;if(!l(i)||!l(r))return;let a=new T6e;o===ve.LINES?a.lines=i(r):o===ve.POINTS&&(a.points=i(r)),a.properties=e.properties,t.features.push(a)}function M6e(e,t){let n=e.features,i=n.length;for(let o=0;o<i;o++)Lde(n[o],t)}var N6e={FeatureCollection:M6e,Feature:Lde},a8=new d;function L6e(e,t,n){let i=0,o=0,r=e.length;for(let N=0;N<r;N++){let L=e[N];if(l(L.lines)){let g=L.lines.length;for(let I=0;I<g;I++){let T=L.lines[I];i+=T.length,o+=(T.length-1)*2}}}let a=new Float32Array(i*3),s=new Float32Array(i),c=Ue.createTypedArray(i,o),u=Ue.fromTypedArray(c),f=new d(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),h=new d(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),p=0,A=0;for(let N=0;N<r;N++){let L=e[N];if(!l(L.lines))continue;let g=L.lines.length;for(let I=0;I<g;I++){let T=L.lines[I],w=T.length;for(let R=0;R<w;R++){let O=T[R],G=d.fromDegrees(O.x,O.y,O.z,te.WGS84,a8),F=M.multiplyByPoint(t,G,a8);d.minimumByComponent(f,F,f),d.maximumByComponent(h,F,h),d.pack(F,a,p*3),s[p]=N,R<w-1&&(c[A*2]=p,c[A*2+1]=p+1,A++),p++}}}let m=tt.createVertexBuffer({typedArray:a,context:n.context,usage:Re.STATIC_DRAW});m.vertexArrayDestroyable=!1;let _=tt.createVertexBuffer({typedArray:s,context:n.context,usage:Re.STATIC_DRAW});_.vertexArrayDestroyable=!1;let y=tt.createIndexBuffer({typedArray:c,context:n.context,usage:Re.STATIC_DRAW,indexDatatype:u});y.vertexArrayDestroyable=!1;let C=new Cn.Attribute;C.semantic=at.POSITION,C.componentDatatype=j.FLOAT,C.type=Ut.VEC3,C.count=i,C.min=f,C.max=h,C.buffer=m;let E=new Cn.Attribute;E.semantic=at.FEATURE_ID,E.setIndex=0,E.componentDatatype=j.FLOAT,E.type=Ut.SCALAR,E.count=i,E.buffer=_;let b=[C,E],x=new Cn.Material;x.unlit=!0;let S=new Cn.Indices;S.indexDatatype=u,S.count=c.length,S.buffer=y;let B=new Cn.FeatureIdAttribute;B.featureCount=r,B.propertyTableId=0,B.setIndex=0,B.positionalLabel="featureId_0";let v=[B],P=new Cn.Primitive;return P.attributes=b,P.indices=S,P.featureIds=v,P.primitiveType=ve.LINES,P.material=x,P}function O6e(e,t,n){let i=0,o=e.length;for(let b=0;b<o;b++){let x=e[b];l(x.points)&&(i+=x.points.length)}let r=new Float32Array(i*3),a=new Float32Array(i),s=new d(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),c=new d(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),u=0;for(let b=0;b<o;b++){let x=e[b];if(!l(x.points))continue;let S=x.points.length;for(let B=0;B<S;B++){let v=x.points[B],P=d.fromDegrees(v.x,v.y,v.z,te.WGS84,a8),N=M.multiplyByPoint(t,P,a8);d.minimumByComponent(s,N,s),d.maximumByComponent(c,N,c),d.pack(N,r,u*3),a[u]=b,u++}}let f=tt.createVertexBuffer({typedArray:r,context:n.context,usage:Re.STATIC_DRAW});f.vertexArrayDestroyable=!1;let h=tt.createVertexBuffer({typedArray:a,context:n.context,usage:Re.STATIC_DRAW});h.vertexArrayDestroyable=!1;let p=new Cn.Attribute;p.semantic=at.POSITION,p.componentDatatype=j.FLOAT,p.type=Ut.VEC3,p.count=i,p.min=s,p.max=c,p.buffer=f;let A=new Cn.Attribute;A.semantic=at.FEATURE_ID,A.setIndex=0,A.componentDatatype=j.FLOAT,A.type=Ut.SCALAR,A.count=i,A.buffer=h;let m=[p,A],_=new Cn.Material;_.unlit=!0;let y=new Cn.FeatureIdAttribute;y.featureCount=o,y.propertyTableId=0,y.setIndex=0,y.positionalLabel="featureId_0";let C=[y],E=new Cn.Primitive;return E.attributes=m,E.featureIds=C,E.primitiveType=ve.POINTS,E.material=_,E}function F6e(e,t){let n=new S6e,i=N6e[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 a={};for(let N=0;N<r;N++){let g=o[N].properties??V.EMPTY_OBJECT;for(let I in g)g.hasOwnProperty(I)&&(l(a[I])||(a[I]=new Array(r)))}for(let N=0;N<r;N++){let L=o[N];for(let g in a)if(a.hasOwnProperty(g)){let I=L.properties[g]??"";a[g][N]=I}}let s=new fg({count:r,properties:a}),u=[new jl({id:0,count:r,jsonMetadataTable:s})],f=Vl.fromJson({}),h=new Os({schema:f,propertyTables:u}),p=new d(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),A=new d(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),m=!1,_=!1;for(let N=0;N<r;N++){let L=o[N];if(l(L.lines)){m=!0;let g=L.lines.length;for(let I=0;I<g;I++){let T=L.lines[I],w=T.length;for(let R=0;R<w;R++)d.minimumByComponent(p,T[R],p),d.maximumByComponent(A,T[R],A)}}if(l(L.points)){_=!0;let g=L.points.length;for(let I=0;I<g;I++){let T=L.points[I];d.minimumByComponent(p,T,p),d.maximumByComponent(A,T,A)}}}let y=d.midpoint(p,A,new d),C=d.fromDegrees(y.x,y.y,y.z,te.WGS84,new d),E=At.eastNorthUpToFixedFrame(C,te.WGS84,new M),b=M.inverseTransformation(E,new M),x=[];m&&x.push(L6e(o,b,t)),_&&x.push(O6e(o,b,t));let S=new Cn.Node;S.index=0,S.primitives=x;let B=[S],v=new Cn.Scene;v.nodes=B;let P=new Cn.Components;return P.scene=v,P.nodes=B,P.transform=E,P.structuralMetadata=h,P}var HN=Fq;var s8={};s8._deprecationWarning=Ms;var Ny=Uint32Array.BYTES_PER_ELEMENT;s8.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),o=new DataView(e);t+=Ny;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+=Ny;let a=o.getUint32(t,!0);t+=Ny;let s=o.getUint32(t,!0);if(s===0)throw new ue("featureTableJsonByteLength is zero, the feature table must be defined.");t+=Ny;let c=o.getUint32(t,!0);t+=Ny;let u=o.getUint32(t,!0);t+=Ny;let f=o.getUint32(t,!0);t+=Ny;let h=o.getUint32(t,!0);if(h!==1&&h!==0)throw new ue(`Only glTF format 0 (uri) or 1 (embedded) are supported. Format ${h} is not.`);t+=Ny;let p=Br(i,t,s);t+=s;let A=new Uint8Array(e,t,c);t+=c;let m,_;u>0&&(m=Br(i,t,u),t+=u,f>0&&(_=new Uint8Array(e,t,f),_=new Uint8Array(_),t+=f));let y=n+a-t;if(y===0)throw new ue("glTF byte length must be greater than 0.");let C;return t%4===0?C=new Uint8Array(e,t,y):(s8._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),C=new Uint8Array(i.subarray(t,t+y))),{gltfFormat:h,featureTableJson:p,featureTableBinary:A,batchTableJson:m,batchTableBinary:_,gltf:C}};var WN=s8;var gg={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},c8=Cn.Attribute,Q6e=Cn.FeatureIdAttribute,Fde=Cn.Instances,Uq=class extends Ki{constructor(t){super(),t=t??V.EMPTY_OBJECT;let n=t.i3dmResource,i=t.arrayBuffer,o=t.baseResource,r=t.byteOffset??0,a=t.releaseGltfJson??!1,s=t.asynchronous??!0,c=t.incrementallyLoadTextures??!0,u=t.upAxis??ao.Y,f=t.forwardAxis??ao.X,h=t.loadAttributesAsTypedArray??!1,p=t.loadIndicesForWireframe??!1,A=t.loadPrimitiveOutline??!0,m=t.enablePick??!1;o=l(o)?o:n.clone(),this._i3dmResource=n,this._baseResource=o,this._arrayBuffer=i,this._byteOffset=r,this._releaseGltfJson=a,this._asynchronous=s,this._incrementallyLoadTextures=c,this._upAxis=u,this._forwardAxis=f,this._loadAttributesAsTypedArray=h,this._loadIndicesForWireframe=p,this._loadPrimitiveOutline=A,this._enablePick=m,this._state=gg.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=M.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}get texturesLoaded(){return this._gltfLoader?.texturesLoaded}get cacheKey(){}get components(){return this._components}load(){if(l(this._promise))return this._promise;let t=WN.parse(this._arrayBuffer,this._byteOffset),n=t.featureTableJson,i=t.featureTableBinary,o=t.batchTableJson,r=t.batchTableBinary,a=t.gltfFormat,s=new Kh(n,i);this._featureTable=s;let c=s.getGlobalProperty("INSTANCES_LENGTH");if(s.featuresLength=c,!l(c))throw new ue("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=c;let u=s.getGlobalProperty("RTC_CENTER",j.FLOAT,3);l(u)&&(this._transform=M.fromTranslation(d.fromArray(u))),this._batchTable={json:o,binary:r};let f={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(a===0){let p=xu(t.gltf);p=p.replace(/[\s\0]+$/,"");let A=this._baseResource.getDerivedResource({url:p});f.gltfResource=A,f.baseResource=A}else f.gltfResource=this._i3dmResource,f.typedArray=t.gltf;let h=new _f(f);return this._gltfLoader=h,this._state=gg.LOADING,this._promise=h.load().then(()=>{if(!this.isDestroyed())return this._state=gg.PROCESSING,this}).catch(p=>{if(!this.isDestroyed())throw k6e(this,p)}),this._promise}process(t){if(this._state===gg.READY)return!0;let n=this._gltfLoader,i=!1;if(this._state===gg.PROCESSING&&(i=n.process(t)),!i)return!1;let o=n.components;return o.transform=M.multiplyTransformation(this._transform,o.transform,o.transform),G6e(this,o,t),U6e(this,o),this._components=o,this._arrayBuffer=void 0,this._state=gg.READY,!0}isUnloaded(){return this._state===gg.UNLOADED}unload(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),Y6e(this),this._components=void 0,this._arrayBuffer=void 0,this._state=gg.UNLOADED}};function k6e(e,t){return e.unload(),e._state=gg.FAILED,e.getError("Failed to load i3dm",t)}function U6e(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let o;if(l(n.json))o=Ag({count:i,batchTable:n.json,binaryBody:n.binary});else{let r=new jl({name:Wh.BATCH_TABLE_CLASS_NAME,count:i});o=new Os({schema:{},propertyTables:[r]})}t.structuralMetadata=o}var l8=new d,zq=new Array(4),z6e=new M;function G6e(e,t,n){let i,o=e._featureTable,r=e._instancesLength;if(r===0)return;let a=o.getGlobalProperty("RTC_CENTER",j.FLOAT,3),s=o.getGlobalProperty("EAST_NORTH_UP"),c=o.hasProperty("NORMAL_UP")||o.hasProperty("NORMAL_UP_OCT32P")||s,u=o.hasProperty("SCALE")||o.hasProperty("SCALE_NON_UNIFORM"),f=H6e(o,r),h;c&&(h=new Float32Array(4*r));let p;u&&(p=new Float32Array(3*r));let A=new Float32Array(r),m=d.unpackArray(f),_=new d,y=new d,C=new d,E=new d,b=new J,x=new Qe,S=new Array(4),B=new d,v=new Array(3),P=new M;if(!l(a)||d.equals(d.unpack(a),d.ZERO)){let F=le.fromPoints(m);for(i=0;i<m.length;i++)d.subtract(m[i],F.center,l8),f[3*i+0]=l8.x,f[3*i+1]=l8.y,f[3*i+2]=l8.z;let U=M.fromTranslation(F.center,z6e);t.transform=M.multiplyTransformation(U,t.transform,t.transform)}for(i=0;i<r;i++){_=d.clone(m[i]),l(a)&&d.add(_,d.unpack(a),_),c&&(W6e(o,s,i,x,_,C,y,E,b,P),Qe.pack(x,S,0),h[4*i+0]=S[0],h[4*i+1]=S[1],h[4*i+2]=S[2],h[4*i+3]=S[3]),u&&(j6e(o,i,B),d.pack(B,v,0),p[3*i+0]=v[0],p[3*i+1]=v[1],p[3*i+2]=v[2]);let F=o.getProperty("BATCH_ID",j.UNSIGNED_SHORT,1,i);l(F)||(F=i),A[i]=F}let N=new Fde;N.transformInWorldSpace=!0;let L=e._buffers,g=new c8;if(g.name="Instance Translation",g.semantic=Oa.TRANSLATION,g.componentDatatype=j.FLOAT,g.type=Ut.VEC3,g.count=r,g.typedArray=f,!c){let F=tt.createVertexBuffer({context:n.context,typedArray:f,usage:Re.STATIC_DRAW});F.vertexArrayDestroyable=!1,L.push(F),g.buffer=F}if(N.attributes.push(g),c){let F=new c8;F.name="Instance Rotation",F.semantic=Oa.ROTATION,F.componentDatatype=j.FLOAT,F.type=Ut.VEC4,F.count=r,F.typedArray=h,N.attributes.push(F)}if(u){let F=new c8;if(F.name="Instance Scale",F.semantic=Oa.SCALE,F.componentDatatype=j.FLOAT,F.type=Ut.VEC3,F.count=r,c)F.typedArray=p;else{let U=tt.createVertexBuffer({context:n.context,typedArray:p,usage:Re.STATIC_DRAW});U.vertexArrayDestroyable=!1,L.push(U),F.buffer=U}N.attributes.push(F)}let I=new c8;I.name="Instance Feature ID",I.setIndex=0,I.semantic=Oa.FEATURE_ID,I.componentDatatype=j.FLOAT,I.type=Ut.SCALAR,I.count=r;let T=tt.createVertexBuffer({context:n.context,typedArray:A,usage:Re.STATIC_DRAW});T.vertexArrayDestroyable=!1,L.push(T),I.buffer=T,N.attributes.push(I);let w=new Q6e;w.propertyTableId=0,w.setIndex=0,w.positionalLabel="instanceFeatureId_0",N.featureIds.push(w);let R=t.nodes,O=R.length,G=!1;for(i=0;i<O;i++){let F=R[i];F.primitives.length>0&&(F.instances=G?V6e(N):N,G=!0)}}function V6e(e){let t=new Fde;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=je(n[o],!1);t.attributes.push(r)}return t.featureIds=e.featureIds,t}function H6e(e,t){if(e.hasProperty("POSITION"))return e.getPropertyArray("POSITION",j.FLOAT,3);if(e.hasProperty("POSITION_QUANTIZED")){let n=e.getPropertyArray("POSITION_QUANTIZED",j.UNSIGNED_SHORT,3),i=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",j.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",j.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 a=0;a<n.length/3;a++)for(let s=0;s<3;s++){let c=3*a+s;r[c]=n[c]/65535*o[s]+i[s]}return r}else throw new ue("Either POSITION or POSITION_QUANTIZED must be defined for each instance.")}var Ode=new Array(4);function W6e(e,t,n,i,o,r,a,s,c,u){let f=e.getProperty("NORMAL_UP",j.FLOAT,3,n,zq),h=e.getProperty("NORMAL_RIGHT",j.FLOAT,3,n,Ode),p=!1;if(l(f)){if(!l(h))throw new ue("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");d.unpack(f,0,r),d.unpack(h,0,a),p=!0}else{let A=e.getProperty("NORMAL_UP_OCT32P",j.UNSIGNED_SHORT,2,n,zq),m=e.getProperty("NORMAL_RIGHT_OCT32P",j.UNSIGNED_SHORT,2,n,Ode);if(l(A)){if(!l(m))throw new ue("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");tn.octDecodeInRange(A[0],A[1],65535,r),tn.octDecodeInRange(m[0],m[1],65535,a),p=!0}else t?(At.eastNorthUpToFixedFrame(o,te.WGS84,u),M.getMatrix3(u,c)):J.clone(J.IDENTITY,c)}p&&(d.cross(a,r,s),d.normalize(s,s),J.setColumn(c,0,a,c),J.setColumn(c,1,r,c),J.setColumn(c,2,s,c)),Qe.fromRotationMatrix(c,i)}function j6e(e,t,n){n=d.fromElements(1,1,1,n);let i=e.getProperty("SCALE",j.FLOAT,1,t);l(i)&&d.multiplyByScalar(n,i,n);let o=e.getProperty("SCALE_NON_UNIFORM",j.FLOAT,3,t,zq);l(o)&&(n.x*=o[0],n.y*=o[1],n.z*=o[2])}function Y6e(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}var jN=Uq;var q6e={STOPPED:0,ANIMATING:1},Xh=Object.freeze(q6e);function xT(){this.times=void 0,this.points=void 0,de.throwInstantiationError()}xT.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof d)return d;if(e instanceof Qe)return Qe};xT.prototype.evaluate=de.throwInstantiationError;xT.prototype.findTimeInterval=function(e,t){let n=this.times,i=n.length;if(t=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};xT.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};xT.prototype.clampTime=function(e){let t=this.times;return D.clamp(e,t[0],t[t.length-1])};var To=xT;function TT(e){this._value=e,this._valueType=To.getPointType(e)}Object.defineProperties(TT.prototype,{value:{get:function(){return this._value}}});TT.prototype.findTimeInterval=function(e){};TT.prototype.wrapTime=function(e){return 0};TT.prototype.clampTime=function(e){return 0};TT.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var YN=TT;function ST(e){e=e??V.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(ST.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});ST.prototype.findTimeInterval=To.prototype.findTimeInterval;ST.prototype.wrapTime=To.prototype.wrapTime;ST.prototype.clampTime=To.prototype.clampTime;ST.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 d),d.lerp(n[o],n[o+1],r,t))};var Ly=ST;var Qde={};Qde.solve=function(e,t,n,i){let o=new Array(n.length),r=new Array(i.length),a=new Array(i.length),s;for(s=0;s<r.length;s++)r[s]=new d,a[s]=new d;o[0]=n[0]/t[0],r[0]=d.multiplyByScalar(i[0],1/t[0],r[0]);let c;for(s=1;s<o.length;++s)c=1/(t[s]-o[s-1]*e[s-1]),o[s]=n[s]*c,r[s]=d.subtract(i[s],d.multiplyByScalar(r[s-1],e[s-1],r[s]),r[s]),r[s]=d.multiplyByScalar(r[s],c,r[s]);for(c=1/(t[s]-o[s-1]*e[s-1]),r[s]=d.subtract(i[s],d.multiplyByScalar(r[s-1],e[s-1],r[s]),r[s]),r[s]=d.multiplyByScalar(r[s],c,r[s]),a[a.length-1]=r[r.length-1],s=a.length-2;s>=0;--s)a[s]=d.subtract(r[s],d.multiplyByScalar(a[s+1],o[s],a[s]),a[s]);return a};var wT=Qde;var kde=[],Ude=[],zde=[],Gde=[];function K6e(e,t,n){let i=kde,o=zde,r=Ude,a=Gde;i.length=o.length=e.length-1,r.length=a.length=e.length;let s;i[0]=r[0]=1,o[0]=0;let c=a[0];for(l(c)||(c=a[0]=new d),d.clone(t,c),s=1;s<i.length-1;++s)i[s]=o[s]=1,r[s]=4,c=a[s],l(c)||(c=a[s]=new d),d.subtract(e[s+1],e[s-1],c),d.multiplyByScalar(c,3,c);return i[s]=0,o[s]=1,r[s]=4,c=a[s],l(c)||(c=a[s]=new d),d.subtract(e[s+1],e[s-1],c),d.multiplyByScalar(c,3,c),r[s+1]=1,c=a[s+1],l(c)||(c=a[s+1]=new d),d.clone(n,c),wT.solve(i,r,o,a)}function X6e(e){let t=kde,n=zde,i=Ude,o=Gde;t.length=n.length=e.length-1,i.length=o.length=e.length;let r;t[0]=n[0]=1,i[0]=2;let a=o[0];for(l(a)||(a=o[0]=new d),d.subtract(e[1],e[0],a),d.multiplyByScalar(a,3,a),r=1;r<t.length;++r)t[r]=n[r]=1,i[r]=4,a=o[r],l(a)||(a=o[r]=new d),d.subtract(e[r+1],e[r-1],a),d.multiplyByScalar(a,3,a);return i[r]=2,a=o[r],l(a)||(a=o[r]=new d),d.subtract(e[r],e[r-1],a),d.multiplyByScalar(a,3,a),wT.solve(t,i,n,o)}function Pu(e){e=e??V.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(Pu.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}}});Pu.createC1=function(e){e=e??V.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 Pu({times:t,points:n,inTangents:r,outTangents:o})};Pu.createNaturalCubic=function(e){e=e??V.EMPTY_OBJECT;let t=e.times,n=e.points;if(n.length<3)return new Ly({points:n,times:t});let i=X6e(n),o=i.slice(0,i.length-1),r=i.slice(1,i.length);return new Pu({times:t,points:n,inTangents:r,outTangents:o})};Pu.createClampedCubic=function(e){e=e??V.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 Ly({points:n,times:t});let a=K6e(n,i,o),s=a.slice(0,a.length-1),c=a.slice(1,a.length);return new Pu({times:t,points:n,inTangents:c,outTangents:s})};Pu.hermiteCoefficientMatrix=new M(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);Pu.prototype.findTimeInterval=To.prototype.findTimeInterval;var J6e=new ie,BT=new d;Pu.prototype.wrapTime=To.prototype.wrapTime;Pu.prototype.clampTime=To.prototype.clampTime;Pu.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 a=this._lastTimeIndex,s=i[a+1]-i[a],c=(e-i[a])/s,u=J6e;u.z=c,u.y=c*c,u.x=u.y*c,u.w=1;let f=M.multiplyByVector(Pu.hermiteCoefficientMatrix,u,u);f.z*=s,f.w*=s;let h=this._pointType;return h===Number?n[a]*f.x+n[a+1]*f.y+r[a]*f.z+o[a]*f.w:(l(t)||(t=new h),t=h.multiplyByScalar(n[a],f.x,t),h.multiplyByScalar(n[a+1],f.y,BT),h.add(t,BT,t),h.multiplyByScalar(r[a],f.z,BT),h.add(t,BT,t),h.multiplyByScalar(o[a],f.w,BT),h.add(t,BT,t))};var Oy=Pu;function DT(e){e=e??V.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(DT.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});DT.prototype.findTimeInterval=To.prototype.findTimeInterval;DT.prototype.wrapTime=To.prototype.wrapTime;DT.prototype.clampTime=To.prototype.clampTime;DT.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 qN=DT;function Z6e(e){let t=e.points,n=e.times;return function(i,o){l(o)||(o=new Qe);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),a=(i-n[r])/(n[r+1]-n[r]),s=t[r],c=t[r+1];return Qe.fastSlerp(s,c,a,o)}}function vT(e){e=e??V.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._evaluateFunction=Z6e(this),this._lastTimeIndex=0}Object.defineProperties(vT.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});vT.prototype.findTimeInterval=To.prototype.findTimeInterval;vT.prototype.wrapTime=To.prototype.wrapTime;vT.prototype.clampTime=To.prototype.clampTime;vT.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var KN=vT;var PT=Cn.AnimatedPropertyType;function Gq(e){e=e??V.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,iYe(this)}Object.defineProperties(Gq.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 $6e(e,t){let n=[],i=[],o=[],r=t.length;for(let a=0;a<r;a+=3)i.push(t[a]),n.push(t[a+1]),o.push(t[a+2]);return i.splice(0,1),o.length=o.length-1,new Oy({times:e,points:n,inTangents:i,outTangents:o})}function Vde(e,t,n,i){if(e.length===1&&t.length===1)return new YN(t[0]);switch(n){case qh.STEP:return new qN({times:e,points:t});case qh.CUBICSPLINE:return $6e(e,t);case qh.LINEAR:return i===PT.ROTATION?new KN({times:e,points:t}):new Ly({times:e,points:t})}}function eYe(e,t,n,i,o){let r=[];if(i===PT.WEIGHTS){let s=t.length/o,c,u;for(c=0;c<o;c++){let f=new Array(s),h=c;if(n===qh.CUBICSPLINE)for(u=0;u<s;u+=3)f[u]=t[h],f[u+1]=t[h+o],f[u+2]=t[h+2*o],h+=o*3;else for(u=0;u<s;u++)f[u]=t[h],h+=o;r.push(Vde(e,f,n,i))}}else r.push(Vde(e,t,n,i));return r}var tYe=new d,nYe=new Qe;function iYe(e){let t=e._channel,n=t.sampler,i=n.input,o=n.output,r=n.interpolation,s=t.target.path,c=e._runtimeNode,u=l(c.morphWeights)?c.morphWeights.length:1,f=eYe(i,o,r,s,u);e._splines=f,e._path=s}Gq.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,o=this._runtimeNode;if(n===PT.WEIGHTS){let r=o.morphWeights,a=r.length;for(let s=0;s<a;s++){let c=t[s],u=i.clampAnimations?c.clampTime(e):c.wrapTime(e);r[s]=c.evaluate(u)}}else{if(o.userAnimated)return;{let r=t[0],a=i.clampAnimations?r.clampTime(e):r.wrapTime(e);n===PT.TRANSLATION||n===PT.SCALE?o[n]=r.evaluate(a,tYe):n===PT.ROTATION&&(o[n]=r.evaluate(a,nYe))}}};var XN=Gq;function Vq(e,t,n){this._animation=t,this._name=t.name,this._runtimeChannels=void 0,this._startTime=X.clone(n.startTime),this._delay=n.delay??0,this._stopTime=X.clone(n.stopTime),this.removeOnStop=n.removeOnStop??!1,this._multiplier=n.multiplier??1,this._reverse=n.reverse??!1,this._loop=n.loop??Du.NONE,this._animationTime=n.animationTime,this._prevAnimationDelta=void 0,this.start=new _e,this.update=new _e,this.stop=new _e,this._state=Xh.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,oYe(this)}Object.defineProperties(Vq.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 oYe(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE,i=e._model.sceneGraph,r=e._animation.channels,a=r.length,s=[];for(let c=0;c<a;c++){let u=r[c],f=u.target;if(!l(f))continue;let h=f.node.index,p=i._runtimeNodes[h],A=new XN({channel:u,runtimeAnimation:e,runtimeNode:p}),m=u.sampler.input;t=Math.min(t,m[0]),n=Math.max(n,m[m.length-1]),s.push(A)}e._runtimeChannels=s,e._localStartTime=t,e._localStopTime=n}Vq.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var JN=Vq;function _g(e){this.animationAdded=new _e,this.animationRemoved=new _e,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(_g.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function Hq(e,t,n){let i=e._model,o=new JN(i,t,n);return e._runtimeAnimations.push(o),e.animationAdded.raiseEvent(i,o),o}_g.prototype.add=function(e){e=e??V.EMPTY_OBJECT;let n=this._model.sceneGraph.components.animations,i=e.index;if(l(i))return Hq(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 Hq(this,n[i],e)};_g.prototype.addAll=function(e){e=e??V.EMPTY_OBJECT;let n=this._model.sceneGraph.components.animations,i=[],o=n.length;for(let r=0;r<o;++r){let a=Hq(this,n[r],e);i.push(a)}return i};_g.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};_g.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])};_g.prototype.contains=function(e){return l(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};_g.prototype.get=function(e){return this._runtimeAnimations[e]};var u8=[];function rYe(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}_g.prototype.update=function(e){let t=this._runtimeAnimations,n=t.length;if(n===0)return this._previousTime=void 0,!1;if(!this.animateWhilePaused&&X.equals(e.time,this._previousTime))return!1;this._previousTime=X.clone(e.time,this._previousTime);let i=!1,o=e.time,r=this._model;for(let a=0;a<n;++a){let s=t[a];l(s._computedStartTime)||(s._computedStartTime=X.addSeconds(s.startTime??o,s.delay,new X)),l(s._duration)||(s._duration=s.localStopTime*(1/s.multiplier));let c=s._computedStartTime,u=s._duration,f=s.stopTime,h=X.lessThanOrEquals(c,o),p=l(f)&&X.greaterThan(o,f),A=0;if(u!==0){let y=X.secondsDifference(p?f:o,c);A=l(s._animationTime)?s._animationTime(u,y):y/u}let m=s.loop===Du.REPEAT||s.loop===Du.MIRRORED_REPEAT,_=(h||m&&!l(s.startTime))&&(A<=1||m)&&!p;if(A===s._prevAnimationDelta){let y=s._state===Xh.STOPPED;if(_!==y)continue}if(s._prevAnimationDelta=A,_||s._state===Xh.ANIMATING){if(_&&s._state===Xh.STOPPED&&(s._state=Xh.ANIMATING,s.start.numberOfListeners>0&&e.afterRender.push(s._raiseStartEvent)),s.loop===Du.REPEAT)A=A-Math.floor(A);else if(s.loop===Du.MIRRORED_REPEAT){let C=Math.floor(A),E=A-C;A=C%2===1?1-E:E}s.reverse&&(A=1-A);let y=A*u*s.multiplier;y=D.clamp(y,s.localStartTime,s.localStopTime),s.animate(y),s.update.numberOfListeners>0&&(s._updateEventTime=y,e.afterRender.push(s._raiseUpdateEvent)),i=!0,_||(s._state=Xh.STOPPED,s.stop.numberOfListeners>0&&e.afterRender.push(s._raiseStopEvent),s.removeOnStop&&u8.push(s))}}n=u8.length;for(let a=0;a<n;++a){let s=u8[a];t.splice(t.indexOf(s),1),e.afterRender.push(rYe(this,r,s))}return u8.length=0,i};var ZN=_g;function P0(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties(P0.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 z),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}}});P0.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)};P0.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)};P0.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)};P0.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)};P0.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};var $N=P0;var eL={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};eL.getStyleCommandsNeeded=function(e,t){return t===0?eL.ALL_OPAQUE:t===e?eL.ALL_TRANSLUCENT:eL.OPAQUE_AND_TRANSLUCENT};var Jh=Object.freeze(eL);var Fy={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};Fy.is3DTiles=function(e){switch(e){case Fy.TILE_GLTF:case Fy.TILE_B3DM:case Fy.TILE_I3DM:case Fy.TILE_PNTS:case Fy.TILE_GEOJSON:return!0;case Fy.GLTF:return!1}};var Fr=Object.freeze(Fy);function pa(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=Jh.ALL_OPAQUE,aYe(this)}Object.defineProperties(pa.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 aYe(e){let t=e._model,n=Fr.is3DTiles(t.type),i=e._propertyTable.count;if(i===0)return;let o,r=new Array(i);if(n){let a=t.content;for(o=0;o<i;o++)r[o]=new Ns(a,o)}else for(o=0;o<i;o++)r[o]=new $N({model:t,featureId:o,featureTable:e});e._features=r,e._featuresLength=i,e._batchTexture=new Gl({featuresLength:i,owner:e,statistics:n?t.content.tileset.statistics:void 0})}pa.prototype.update=function(e){this._styleCommandsNeededDirty=!1,this._batchTexture.update(void 0,e);let t=Jh.getStyleCommandsNeeded(this._featuresLength,this._batchTexture.translucentFeaturesLength);this._styleCommandsNeeded!==t&&(this._styleCommandsNeededDirty=!0,this._styleCommandsNeeded=t)};pa.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};pa.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};pa.prototype.getShow=function(e){return this._batchTexture.getShow(e)};pa.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};pa.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};pa.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};pa.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};pa.prototype.getFeature=function(e){return this._features[e]};pa.prototype.hasProperty=function(e,t){return this._propertyTable.hasProperty(e,t)};pa.prototype.hasPropertyBySemantic=function(e,t){return this._propertyTable.hasPropertyBySemantic(e,t)};pa.prototype.getProperty=function(e,t){return this._propertyTable.getProperty(e,t)};pa.prototype.getPropertyBySemantic=function(e,t){return this._propertyTable.getPropertyBySemantic(e,t)};pa.prototype.getPropertyIds=function(e){return this._propertyTable.getPropertyIds(e)};pa.prototype.setProperty=function(e,t,n){return this._propertyTable.setProperty(e,t,n)};pa.prototype.isClass=function(e,t){return this._propertyTable.isClass(e,t)};pa.prototype.isExactClass=function(e,t){return this._propertyTable.isExactClass(e,t)};pa.prototype.getExactClassName=function(e){return this._propertyTable.getExactClassName(e)};var sYe=new z;pa.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(Gl.DEFAULT_COLOR_VALUE),this.setAllShow(Gl.DEFAULT_SHOW_VALUE);return}for(let t=0;t<this._featuresLength;t++){let n=this.getFeature(t),i=l(e.color)?e.color.evaluateColor(n,sYe)??Gl.DEFAULT_COLOR_VALUE:Gl.DEFAULT_COLOR_VALUE,o=l(e.show)?e.show.evaluate(n)??Gl.DEFAULT_SHOW_VALUE:Gl.DEFAULT_SHOW_VALUE;this.setColor(t,i),this.setShow(t,o)}};pa.prototype.isDestroyed=function(){return!1};pa.prototype.destroy=function(e){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),fe(this)};var tL=pa;var Hde={name:"TilesetPipelineStage"};Hde.process=function(e,t,n){if(t.hasSkipLevelOfDetail(n)){e.shaderBuilder.addDefine("POLYGON_OFFSET",void 0,he.FRAGMENT);let r={u_polygonOffset:function(){return k.ZERO}};e.uniformMap=Pt(r,e.uniformMap),e.hasSkipLevelOfDetail=!0}let i=e.renderStateOptions;i.stencilTest=Yt.setCesium3DTileBit(),i.stencilMask=Yt.CESIUM_3D_TILE_MASK};var nL=Hde;var iL=`// 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
vec3 withFog = czm_fog(distanceToCamera, color.rgb, fogColor, czm_fogVisualDensityScalar);
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 oL=`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 Wde={name:"AtmospherePipelineStage"};Wde.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_ATMOSPHERE",void 0,he.BOTH),i.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,he.BOTH),i.addVarying("vec3","v_atmosphereRayleighColor"),i.addVarying("vec3","v_atmosphereMieColor"),i.addVarying("float","v_atmosphereOpacity"),i.addVertexLines([oL]),i.addFragmentLines([iL]),i.addUniform("bool","u_isInFog",he.FRAGMENT),e.uniformMap.u_isInFog=function(){let o=d.distance(n.camera.positionWC,t.boundingSphere.center);return D.fog(o,n.fog.density)>D.EPSILON3}};var rL=Wde;var aL=`#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) * model_iblFactor.x;
#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 * model_iblFactor.y;
#else
vec3 specularContribution = vec3(0.0);
#endif
return diffuseContribution + specularContribution;
}
#endif
`;var jde={name:"ImageBasedLightingPipelineStage"},cYe=new k;jde.process=function(e,t,n){let i=t.imageBasedLighting,o=t.environmentMapManager,r=e.shaderBuilder,a;l(i.specularEnvironmentMaps)||(a=o.radianceCubeMap);let s=i.sphericalHarmonicCoefficients??o.sphericalHarmonicCoefficients;r.addDefine("USE_IBL_LIGHTING",void 0,he.FRAGMENT),r.addUniform("vec2","model_iblFactor",he.FRAGMENT),kh.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&r.addUniform("mat3","model_iblReferenceFrameMatrix",he.FRAGMENT),l(a)&&r.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,he.BOTH),l(s)&&l(s[0])?(r.addDefine("DIFFUSE_IBL",void 0,he.FRAGMENT),r.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,he.FRAGMENT),r.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",he.FRAGMENT)):i.useDefaultSphericalHarmonics&&r.addDefine("DIFFUSE_IBL",void 0,he.FRAGMENT),l(i.specularEnvironmentCubeMap)&&i.specularEnvironmentCubeMap.ready||l(a)?(r.addDefine("SPECULAR_IBL",void 0,he.FRAGMENT),r.addDefine("CUSTOM_SPECULAR_IBL",void 0,he.FRAGMENT),r.addUniform("samplerCube","model_specularEnvironmentMaps",he.FRAGMENT),r.addUniform("float","model_specularEnvironmentMapsMaximumLOD",he.FRAGMENT)):t.useDefaultSpecularMaps&&r.addDefine("SPECULAR_IBL",void 0,he.FRAGMENT)),r.addFragmentLines(aL);let c={model_iblFactor:function(){return k.multiplyByScalar(i.imageBasedLightingFactor,o?.intensity||1,cYe)},model_iblReferenceFrameMatrix:function(){return t._iblReferenceFrameMatrix},model_sphericalHarmonicCoefficients:function(){return s},model_specularEnvironmentMaps:function(){return i.specularEnvironmentCubeMap.texture},model_specularEnvironmentMapsMaximumLOD:function(){return i.specularEnvironmentCubeMap.maximumMipmapLevel}};l(a)&&(c.model_specularEnvironmentMaps=function(){return a},c.model_specularEnvironmentMapsMaximumLOD=function(){return o.maximumMipmapLevel}),e.uniformMap=Pt(c,e.uniformMap)};var sL=jde;var lYe=D.EPSILON16;function jq(e){e=e??V.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(jq.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=D.clamp(e,this.minimumValue,this.maximumValue),D.equalsEpsilon(this._currentValue,e,lYe)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var uYe=new d,Wq=new J;jq.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=uYe,o;switch(t){case tl.XROTATE:o=J.fromRotationX(D.toRadians(n),Wq),e=M.multiplyByMatrix3(e,o,e);break;case tl.YROTATE:o=J.fromRotationY(D.toRadians(n),Wq),e=M.multiplyByMatrix3(e,o,e);break;case tl.ZROTATE:o=J.fromRotationZ(D.toRadians(n),Wq),e=M.multiplyByMatrix3(e,o,e);break;case tl.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=M.multiplyByTranslation(e,i,e);break;case tl.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=M.multiplyByTranslation(e,i,e);break;case tl.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=M.multiplyByTranslation(e,i,e);break;case tl.XSCALE:i.x=n,i.y=1,i.z=1,e=M.multiplyByScale(e,i,e);break;case tl.YSCALE:i.x=1,i.y=n,i.z=1,e=M.multiplyByScale(e,i,e);break;case tl.ZSCALE:i.x=1,i.y=1,i.z=n,e=M.multiplyByScale(e,i,e);break;case tl.UNIFORMSCALE:e=M.multiplyByUniformScale(e,n,e);break;default:break}return e};var cL=jq;function f8(e){e=e??V.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,fYe(this)}Object.defineProperties(f8.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 fYe(e){let n=e.articulation.stages,i=n.length,o=e._runtimeStages,r=e._runtimeStagesByName;for(let a=0;a<i;a++){let s=n[a],c=new cL({stage:s,runtimeArticulation:e});o.push(c);let u=s.name;r[u]=c}}f8.prototype.setArticulationStage=function(e,t){let n=this._runtimeStagesByName[e];l(n)&&(n.currentValue=t)};var dYe=new M,hYe=new M;f8.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e=M.clone(M.IDENTITY,dYe),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 a=o[t],s=M.multiplyTransformation(a.originalTransform,e,hYe);a.transform=s}};var lL=f8;var uL=`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 RT={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend"};RT.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,he.FRAGMENT),i.addFragmentLines(uL);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=Be.TRANSLUCENT),i.addUniform("vec4",RT.COLOR_UNIFORM_NAME,he.FRAGMENT),o[RT.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",RT.COLOR_BLEND_UNIFORM_NAME,he.FRAGMENT),o[RT.COLOR_BLEND_UNIFORM_NAME]=function(){return el.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=Pt(o,e.uniformMap)};var Qy=RT;var fL=`#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 Yde={name:"ModelClippingPlanesPipelineStage"},mYe=new k;Yde.process=function(e,t,n){let i=t.clippingPlanes,o=n.context,r=e.shaderBuilder;r.addDefine("HAS_CLIPPING_PLANES",void 0,he.FRAGMENT),r.addDefine("CLIPPING_PLANES_LENGTH",i.length,he.FRAGMENT),i.unionClippingRegions&&r.addDefine("UNION_CLIPPING_REGIONS",void 0,he.FRAGMENT),da.useFloatTexture(o)&&r.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,he.FRAGMENT);let a=da.getTextureResolution(i,o,mYe);r.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",a.x,he.FRAGMENT),r.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",a.y,he.FRAGMENT),r.addUniform("sampler2D","model_clippingPlanes",he.FRAGMENT),r.addUniform("vec4","model_clippingPlanesEdgeStyle",he.FRAGMENT),r.addUniform("mat4","model_clippingPlanesMatrix",he.FRAGMENT),r.addFragmentLines(fL);let s={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let c=z.clone(i.edgeColor);return c.alpha=i.edgeWidth,c},model_clippingPlanesMatrix:function(){return t._clippingPlanesMatrix}};e.uniformMap=Pt(s,e.uniformMap)};var dL=Yde;var hL=`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 mL=`void modelClippingPolygonsStage()
{
vec2 clippingPosition = v_clippingPosition;
int regionIndex = v_regionIndex;
czm_clipPolygons(model_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex);
}
`;var qde={name:"ModelClippingPolygonsPipelineStage"};qde.process=function(e,t,n){let i=t.clippingPolygons,o=e.shaderBuilder;o.addDefine("ENABLE_CLIPPING_POLYGONS",void 0,he.BOTH),i.inverse&&o.addDefine("CLIPPING_INVERSE",void 0,he.FRAGMENT),o.addDefine("CLIPPING_POLYGON_REGIONS_LENGTH",i.extentsCount,he.BOTH),o.addUniform("sampler2D","model_clippingDistance",he.FRAGMENT),o.addUniform("sampler2D","model_clippingExtents",he.VERTEX),o.addVarying("vec2","v_clippingPosition"),o.addVarying("int","v_regionIndex","flat"),o.addVertexLines(hL),o.addFragmentLines(mL);let r={model_clippingDistance:function(){return i.clippingTexture??n.context.defaultTexture},model_clippingExtents:function(){return i.extentsTexture??n.context.defaultTexture}};e.uniformMap=Pt(r,e.uniformMap)};var pL=qde;function Kde(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(Kde.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 AL=Kde;var gL=`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 _L=`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 yL=`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 d8=new M,pYe=new M,AYe=new M,Jde={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:nhe,_transformsToTypedArray:qq};Jde.process=function(e,t,n){let i=t.instances,o=i.attributes[0].count,r=e.shaderBuilder;r.addDefine("HAS_INSTANCING"),r.addVertexLines(gL);let a=e.model,s=a.sceneGraph,c=e.runtimeNode,u=n.mode!==oe.SCENE3D&&!n.scene3DOnly&&a._projectTo2D,f=a._enablePick&&!n.context.webgl2,h=[];PYe(e,n,i,h,u,f),NYe(e,n,i,h);let p={};if(i.transformInWorldSpace?(r.addDefine("USE_LEGACY_INSTANCING",void 0,he.VERTEX),r.addUniform("mat4","u_instance_modifiedModelView",he.VERTEX),r.addUniform("mat4","u_instance_nodeTransform",he.VERTEX),p.u_instance_modifiedModelView=function(){let A=M.multiplyTransformation(a.modelMatrix,s.components.transform,d8);return u?M.multiplyTransformation(n.context.uniformState.view3D,A,d8):(n.mode!==oe.SCENE3D&&(A=At.basisTo2D(n.mapProjection,A,d8)),M.multiplyTransformation(n.context.uniformState.view,A,d8))},p.u_instance_nodeTransform=function(){return M.multiplyTransformation(s.axisCorrectionMatrix,c.computedTransform,pYe)},r.addVertexLines(yL)):r.addVertexLines(_L),u){r.addDefine("USE_2D_INSTANCING",void 0,he.VERTEX),r.addUniform("mat4","u_modelView2D",he.VERTEX);let A=n.context,m=M.fromTranslation(c.instancingReferencePoint2D,new M);p.u_modelView2D=function(){return M.multiplyTransformation(A.uniformState.view,m,AYe)}}e.uniformMap=Pt(p,e.uniformMap),e.instanceCount=o,oi(e.attributes,h)};var CL=new M,gYe=new d;function _Ye(e,t,n,i,o){let r=M.multiplyTransformation(t,e,CL);return r=M.multiplyTransformation(r,n,CL),o=At.basisTo2D(i.mapProjection,r,o),o}function yYe(e,t,n,i,o){let r=M.fromTranslation(e,CL),a=M.multiplyTransformation(t,r,CL);a=M.multiplyTransformation(a,n,CL);let s=M.getTranslation(a,gYe);return o=so.computeActualEllipsoidPosition(i,s,o),o}function Zde(e,t,n){let i=e.model,o=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(t=M.multiplyTransformation(i.modelMatrix,o.components.transform,t),n=M.multiplyTransformation(o.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=M.clone(o.computedModelMatrix,t),t=M.multiplyTransformation(t,e.runtimeNode.computedTransform,t),n=M.clone(M.IDENTITY,n))}var $de=new M,ehe=new M,CYe=new M,EYe=new d;function bYe(e,t,n,i){let o=$de,r=ehe;Zde(t,o,r);let s=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],h=_Ye(f,o,r,n,CYe),p=M.getTranslation(h,EYe),A=d.subtract(p,s,p);i[u]=M.setTranslation(h,A,i[u])}return i}function IYe(e,t,n,i){let o=$de,r=ehe;Zde(t,o,r);let s=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],h=yYe(f,o,r,n,f);i[u]=d.subtract(h,s,i[u])}return i}var xYe=new d,TYe=new d;function the(e,t){let n=e.runtimeNode,i=e.model.sceneGraph.computedModelMatrix,o=M.multiplyByPoint(i,n.instancingTranslationMin,xYe),r=so.computeActualEllipsoidPosition(t,o,o),a=M.multiplyByPoint(i,n.instancingTranslationMax,TYe),s=so.computeActualEllipsoidPosition(t,a,a);n.instancingReferencePoint2D=d.lerp(r,s,.5,new d)}function qq(e){let n=e.length,i=new Float32Array(n*12);for(let o=0;o<n;o++){let r=e[o],a=12*o;i[a+0]=r[0],i[a+1]=r[4],i[a+2]=r[8],i[a+3]=r[12],i[a+4]=r[1],i[a+5]=r[5],i[a+6]=r[9],i[a+7]=r[13],i[a+8]=r[2],i[a+9]=r[6],i[a+10]=r[10],i[a+11]=r[14]}return i}function SYe(e){let n=e.length,i=new Float32Array(n*3);for(let o=0;o<n;o++){let r=e[o],a=3*o;i[a+0]=r[0],i[a+1]=r[4],i[a+2]=r[8]}return i}var wYe=new d,BYe=new Qe,DYe=new d;function nhe(e,t,n){let i=new Array(t),o=xt.getAttributeBySemantic(e,Oa.TRANSLATION),r=xt.getAttributeBySemantic(e,Oa.ROTATION),a=xt.getAttributeBySemantic(e,Oa.SCALE),s=new d(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),c=new d(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),u=l(o),f=l(r),h=l(a),p=u?o.typedArray:new Float32Array(t*3),A=f?r.typedArray:new Float32Array(t*4);f&&r.normalized&&(A=tn.dequantize(A,r.componentDatatype,r.type,t));let m;h?m=a.typedArray:(m=new Float32Array(t*3),m.fill(1));for(let y=0;y<t;y++){let C=new d(p[y*3],p[y*3+1],p[y*3+2],wYe);d.maximumByComponent(s,C,s),d.minimumByComponent(c,C,c);let E=new Qe(A[y*4],A[y*4+1],A[y*4+2],f?A[y*4+3]:1,BYe),b=new d(m[y*3],m[y*3+1],m[y*3+2],DYe),x=M.fromTranslationQuaternionRotationScale(C,E,b,new M);i[y]=x}let _=n.runtimeNode;return _.instancingTranslationMin=c,_.instancingTranslationMax=s,u&&(o.typedArray=void 0),f&&(r.typedArray=void 0),h&&(a.typedArray=void 0),i}function vYe(e,t,n){let i=new Array(t),o=e.typedArray,r=new d(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),a=new d(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let c=0;c<t;c++){let u=new d(o[c*3],o[c*3+1],o[c*3+2]);i[c]=u,d.minimumByComponent(r,u,r),d.maximumByComponent(a,u,a)}let s=n.runtimeNode;return s.instancingTranslationMin=r,s.instancingTranslationMax=a,e.typedArray=void 0,i}function Kq(e,t){let n=tt.createVertexBuffer({context:t.context,typedArray:e,usage:Re.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function PYe(e,t,n,i,o,r){let a=xt.getAttributeBySemantic(n,Oa.ROTATION);l(a)?RYe(e,n,i,t,o,r):MYe(e,n,i,t,o)}function RYe(e,t,n,i,o,r){let a=e.shaderBuilder,s=t.attributes[0].count,c=e.model,u=e.runtimeNode;a.addDefine("HAS_INSTANCE_MATRICES");let f="Transform",h,p=u.instancingTransformsBuffer;if(!l(p)){h=nhe(t,s,e);let y=qq(h);p=Kq(y,i),c._modelResources.push(p),r&&(u.transformsTypedArray=y),u.instancingTransformsBuffer=p}if(Xde(e,p,n,f),!o)return;let A=je(i);A.mode=oe.COLUMBUS_VIEW,the(e,A);let m=u.instancingTransformsBuffer2D;if(!l(m)){let y=bYe(h,e,A,h),C=qq(y);m=Kq(C,i),c._modelResources.push(m),u.instancingTransformsBuffer2D=m}Xde(e,m,n,"Transform2D")}function MYe(e,t,n,i,o,r){let a=e.shaderBuilder,s=e.runtimeNode,c=xt.getAttributeBySemantic(t,Oa.TRANSLATION),u=xt.getAttributeBySemantic(t,Oa.SCALE);if(l(u)&&(a.addDefine("HAS_INSTANCE_SCALE"),Yq(e,u.buffer,u.byteOffset,u.byteStride,n,"Scale")),!l(c))return;let f,h=c.typedArray;if(l(h)?f=vYe(c,c.count,e):l(s.instancingTranslationMin)||(s.instancingTranslationMin=c.min,s.instancingTranslationMax=c.max),a.addDefine("HAS_INSTANCE_TRANSLATION"),Yq(e,c.buffer,c.byteOffset,c.byteStride,n,"Translation"),!o&&!r)return;let A=je(i);A.mode=oe.COLUMBUS_VIEW,the(e,A);let m=s.instancingTranslationBuffer2D;if(!l(m)){let E=IYe(f,e,A,f),b=SYe(E);r&&(s.transformsTypedArray=b),m=Kq(b,i),e.model._modelResources.push(m),s.instancingTranslationBuffer2D=m}if(!o)return;Yq(e,m,0,void 0,n,"Translation2D")}function Xde(e,t,n,i){let r=j.getSizeInBytes(j.FLOAT),a=r*12,s=[{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:j.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:a,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:j.FLOAT,normalize:!1,offsetInBytes:r*4,strideInBytes:a,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:j.FLOAT,normalize:!1,offsetInBytes:r*8,strideInBytes:a,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`),oi(n,s)}function Yq(e,t,n,i,o,r){o.push({index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:3,componentDatatype:j.FLOAT,normalize:!1,offsetInBytes:n,strideInBytes:i,instanceDivisor:1}),e.shaderBuilder.addAttribute("vec3",`a_instance${r}`)}function NYe(e,t,n,i){let o=n.attributes,r=e.shaderBuilder;for(let a=0;a<o.length;a++){let s=o[a];s.semantic===Oa.FEATURE_ID&&(s.setIndex>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=s.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:s.buffer,componentsPerAttribute:Ut.getNumberOfComponents(s.type),componentDatatype:s.componentDatatype,normalize:!1,offsetInBytes:s.byteOffset,strideInBytes:s.byteStride,instanceDivisor:1}),r.addAttribute("float",`a_instanceFeatureId_${s.setIndex}`))}}var EL=Jde;var Xq={};Xq.name="ModelMatrixUpdateStage";Xq.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;ihe(e,t,o,e.transformToRoot),e._transformDirty=!1}};function LYe(e,t,n){e.modelMatrix=M.multiplyTransformation(t,n,e.modelMatrix),e.cullFace=xt.getCullFace(e.modelMatrix,e.primitiveType)}function ihe(e,t,n,i){let o;i=M.multiplyTransformation(i,e.transform,new M),e.updateComputedTransform();let r=e.runtimePrimitives.length;for(o=0;o<r;o++){let s=e.runtimePrimitives[o];LYe(s.drawCommand,n,i)}let a=e.children.length;for(o=0;o<a;o++){let s=t._runtimeNodes[e.children[o]];s._transformToRoot=M.clone(i,s._transformToRoot),ihe(s,t,n,i),s._transformDirty=!1}}var bL=Xq;var ohe={name:"NodeStatisticsPipelineStage",_countInstancingAttributes:rhe,_countGeneratedBuffers:ahe};ohe.process=function(e,t,n){let i=e.model.statistics,o=t.instances,r=e.runtimeNode;rhe(i,o),ahe(i,r)};function rhe(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 ahe(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 IL=ohe;function MT(e){e=e??V.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=M.clone(n,this._originalTransform),this._transform=M.clone(n,this._transform),this._transformToRoot=M.clone(i,this._transformToRoot),this._computedTransform=new M,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,OYe(this)}Object.defineProperties(MT.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=M.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;d.equals(n,e)||(t.translation=d.clone(e,t.translation),Jq(this,t))}},rotation:{get:function(){return l(this._transformParameters)?this._transformParameters.rotation:void 0},set:function(e){let t=this._transformParameters,n=t.rotation;Qe.equals(n,e)||(t.rotation=Qe.clone(e,t.rotation),Jq(this,t))}},scale:{get:function(){return l(this._transformParameters)?this._transformParameters.scale:void 0},set:function(e){let t=this._transformParameters,n=t.scale;d.equals(n,e)||(t.scale=d.clone(e,t.scale),Jq(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 OYe(e){let t=e.transform,n=e.transformToRoot,i=e._computedTransform;e._computedTransform=M.multiply(n,t,i);let o=e.node;l(o.matrix)||(e._transformParameters=new dy(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 Jq(e,t){e._transformDirty=!0,e._transform=M.fromTranslationRotationScale(t,e._transform)}MT.prototype.getChild=function(e){return this.sceneGraph._runtimeNodes[this.children[e]]};MT.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(EL),t.push(IL),n.push(bL)};MT.prototype.updateComputedTransform=function(){this._computedTransform=M.multiply(this._transformToRoot,this._transform,this._computedTransform)};MT.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 M);let r=M.multiplyTransformation(this.transformToRoot,this.transform,t[o]),a=M.inverseTransformation(r,t[o]);t[o]=M.multiplyTransformation(a,n[o],t[o])}};var xL=MT;var she={name:"AlphaPipelineStage"};she.process=function(e,t,n){let i=e.alphaOptions,o=e.model;i.pass=i.pass??o.opaquePass;let r=e.renderStateOptions;i.pass===Be.TRANSLUCENT&&(r.cull.enabled=!1,r.depthMask=!1,r.blending=sn.ALPHA_BLEND);let a=e.shaderBuilder,s=e.uniformMap;l(i.alphaCutoff)&&(a.addDefine("ALPHA_MODE_MASK",void 0,he.FRAGMENT),a.addUniform("float","u_alphaCutoff",he.FRAGMENT),s.u_alphaCutoff=function(){return i.alphaCutoff})};var TL=she;var che={name:"BatchTexturePipelineStage"};che.process=function(e,t,n){let i=e.shaderBuilder,o={},r=e.model,a=r.featureTables[r.featureTableId],s=a.featuresLength;i.addUniform("int","model_featuresLength"),o.model_featuresLength=function(){return s};let c=a.batchTexture;i.addUniform("sampler2D","model_batchTexture"),o.model_batchTexture=function(){return 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=Pt(o,e.uniformMap)};var SL=che;var lhe={name:"ClassificationPipelineStage"};lhe.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,he.BOTH);let o=e.runtimePrimitive;l(o.batchLengths)||FYe(t,o)};function FYe(e,t){let n=xt.getAttributeBySemantic(e,at.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 a=r?o.count:n.count,s=xt.getAttributeBySemantic(e,at.FEATURE_ID,0);if(!l(s)){t.batchLengths=[a],t.batchOffsets=[0];return}let c=s.typedArray;s.typedArray=void 0;let u=[],f=[0],h=r?i[0]:0,p=c[h],A=0;for(let _=1;_<a;_++){let y=r?i[_]:_,C=c[y];if(C!==p){let E=_-A,b=_;u.push(E),f.push(b),A=b,p=C}}let m=a-A;u.push(m),t.batchLengths=u,t.batchOffsets=f}var wL=lhe;var BL=`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 DL=`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 uhe={name:"CPUStylingPipelineStage"};uhe.process=function(e,t,n){let i=e.model,o=e.shaderBuilder;o.addVertexLines(BL),o.addFragmentLines(DL),o.addDefine("USE_CPU_STYLING",void 0,he.BOTH),l(i.color)||(o.addUniform("float",Qy.COLOR_BLEND_UNIFORM_NAME,he.FRAGMENT),e.uniformMap[Qy.COLOR_BLEND_UNIFORM_NAME]=function(){return el.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),o.addUniform("bool","model_commandTranslucent",he.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===Be.TRANSLUCENT}};var vL=uhe;var fhe={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};fhe.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};var yg=Object.freeze(fhe);var PL=`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 RL=`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 ML=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) {
initializeFeatureIds(featureIds, attributes);
initializeFeatureIdAliases(featureIds);
}
`;var NL=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes)
{
initializeFeatureIds(featureIds, attributes);
initializeFeatureIdAliases(featureIds);
setFeatureIdVaryings();
}
`;var co={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()"};co.process=function(e,t,n){let i=e.shaderBuilder;QYe(i);let o=e.runtimeNode.node.instances;l(o)&&kYe(e,o,n),UYe(e,t,n),i.addVertexLines(NL),i.addFragmentLines(ML)};function QYe(e){e.addStruct(co.STRUCT_ID_FEATURE_IDS_VS,co.STRUCT_NAME_FEATURE_IDS,he.VERTEX),e.addStruct(co.STRUCT_ID_FEATURE_IDS_FS,co.STRUCT_NAME_FEATURE_IDS,he.FRAGMENT),e.addFunction(co.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,co.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,he.VERTEX),e.addFunction(co.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,co.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,he.FRAGMENT),e.addFunction(co.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,co.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,he.VERTEX),e.addFunction(co.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,co.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,he.FRAGMENT),e.addFunction(co.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,co.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,he.VERTEX)}function kYe(e,t,n){let i=t.featureIds,o=t.attributes[0].count;for(let r=0;r<i.length;r++){let a=i[r],s=a.positionalLabel;a instanceof Cn.FeatureIdAttribute?zYe(e,a,s):dhe(e,a,s,o,1,n);let c=a.label;l(c)&&hhe(e,s,c,he.BOTH)}}function UYe(e,t,n){let i=t.featureIds,r=xt.getAttributeBySemantic(t,at.POSITION).count;for(let a=0;a<i.length;a++){let s=i[a],c=s.positionalLabel,u=he.BOTH;s instanceof Cn.FeatureIdAttribute?GYe(e,s,c):s instanceof Cn.FeatureIdImplicitRange?dhe(e,s,c,r,void 0,n):(VYe(e,s,c,a,n),u=he.FRAGMENT);let f=s.label;l(f)&&hhe(e,c,f,u)}}function zYe(e,t,n){let i=e.shaderBuilder;i.addStructField(co.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(co.STRUCT_ID_FEATURE_IDS_FS,"int",n);let o=t.setIndex,r=n.replace(/_\d+$/,"_"),a=`a_${r}${o}`,s=`v_${r}${o}`,c=`featureIds.${n} = int(czm_round(${a}));`,u=`featureIds.${n} = int(czm_round(${s}));`;i.addFunctionLines(co.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[c]),i.addFunctionLines(co.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[u]),i.addVarying("float",s),i.addFunctionLines(co.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${s} = ${a};`])}function GYe(e,t,n){let i=e.shaderBuilder;i.addStructField(co.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(co.STRUCT_ID_FEATURE_IDS_FS,"int",n);let o=t.setIndex,r=n.replace(/_\d+$/,"_"),a=[`featureIds.${n} = int(czm_round(attributes.${r}${o}));`];i.addFunctionLines(co.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,a),i.addFunctionLines(co.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,a)}function dhe(e,t,n,i,o,r){HYe(e,t,i,o,r);let a=e.shaderBuilder,s=`a_implicit_${n}`;a.addAttribute("float",s);let c=`v_implicit_${n}`;a.addVarying("float",c),a.addStructField(co.STRUCT_ID_FEATURE_IDS_VS,"int",n),a.addStructField(co.STRUCT_ID_FEATURE_IDS_FS,"int",n),a.addFunctionLines(co.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${c} = ${s};`]),a.addFunctionLines(co.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${s}));`]),a.addFunctionLines(co.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${c}));`])}function VYe(e,t,n,i,o){let r=`u_featureIdTexture_${i}`,a=e.uniformMap,s=t.textureReader;a[r]=function(){return s.texture??o.context.defaultTexture};let c=s.channels,u=e.shaderBuilder;u.addStructField(co.STRUCT_ID_FEATURE_IDS_FS,"int",n),u.addUniform("sampler2D",r,he.FRAGMENT);let h=`v_texCoord_${s.texCoord}`,p=h,A=s.transform;if(l(A)&&!J.equals(A,J.IDENTITY)){let y=`${r}Transform`;u.addUniform("mat3",y,he.FRAGMENT),a[y]=function(){return A},p=`vec2(${y} * vec3(${h}, 1.0))`}let m=`texture(${r}, ${p}).${c}`,_=`featureIds.${n} = czm_unpackUint(${m});`;u.addFunctionLines(co.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[_])}function hhe(e,t,n,i){let o=e.shaderBuilder,r=he.includesVertexShader(i);r&&o.addStructField(co.STRUCT_ID_FEATURE_IDS_VS,"int",n),o.addStructField(co.STRUCT_ID_FEATURE_IDS_FS,"int",n);let a=[`featureIds.${n} = featureIds.${t};`];r&&o.addFunctionLines(co.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,a),o.addFunctionLines(co.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,a)}function HYe(e,t,n,i,o){let r=e.model,a,s;if(l(t.repeat)){let u=WYe(t,n);a=tt.createVertexBuffer({context:o.context,typedArray:u,usage:Re.STATIC_DRAW}),a.vertexArrayDestroyable=!1,r._pipelineResources.push(a),r.statistics.addBuffer(a,!1)}else s=[t.offset];let c={index:e.attributeIndex++,instanceDivisor:i,value:s,vertexBuffer:a,normalize:!1,componentsPerAttribute:1,componentDatatype:j.FLOAT,strideInBytes:j.getSizeInBytes(j.FLOAT),offsetInBytes:0};e.attributes.push(c)}function WYe(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 ky=co;var LL=`void metadataStage(
FeatureIds featureIds,
out Metadata metadata,
out MetadataClass metadataClass,
out MetadataStatistics metadataStatistics,
ProcessedAttributes attributes
)
{
initializeMetadata(featureIds, metadata, metadataClass, metadataStatistics, attributes);
}
`;var OL=`void metadataStage(
FeatureIds featureIds,
out Metadata metadata,
out MetadataClass metadataClass,
out MetadataStatistics metadataStatistics,
ProcessedAttributes attributes
)
{
initializeMetadata(featureIds, metadata, metadataClass, metadataStatistics, attributes);
setMetadataVaryings();
}
`;var Si={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(FeatureIds featureIds, 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"}]};Si.process=function(e,t,n){let{shaderBuilder:i,model:o}=e,{structuralMetadata:r={},content:a}=o,s=a?.tileset.metadataExtension?.statistics,c=n.context.webgl2,u=uqe(o,t),f=jYe(r.propertyAttributes,t,s),h=qYe(r.propertyTextures,s),p=JYe(r.propertyTables,t,e,s,u),A=f.concat(h).concat(p);eqe(i,A),iqe(i),i.addVertexLines(OL),i.addFragmentLines(LL);for(let m=0;m<f.length;m++){let _=f[m];oqe(e,_)}for(let m=0;m<h.length;m++){let _=h[m];aqe(e,_,c)}for(let m=0;m<p.length;m++){let _=p[m];cqe(e,_,c)}};function jYe(e,t,n){return l(e)?e.flatMap(i=>YYe(i,t,n)):[]}function YYe(e,t,n){let{getAttributeByName:i,getAttributeInfo:o,sanitizeGlslIdentifier:r}=xt,a=e.class.id,s=n?.classes[a],c=Object.entries(e.properties),u=new Array(c.length);for(let f=0;f<c.length;f++){let[h,p]=c[f],A=i(t,p.attribute),{glslType:m,variableName:_}=o(A);u[f]={metadataVariable:r(h),property:p,classProperty:p.classProperty,type:p.classProperty.type,glslType:m,variableName:_,propertyStatistics:s?.properties[h],shaderDestination:he.BOTH}}return u}function qYe(e,t){return l(e)?e.flatMap(n=>KYe(n,t)):[]}function KYe(e,t){let{sanitizeGlslIdentifier:n}=xt,i=e.class.id,o=t?.classes[i],r=Object.entries(e.properties).filter(([s,c])=>{let u=c.textureReader.channels.length;return c.classProperty.isGpuCompatible(u)}),a=new Array(r.length);for(let s=0;s<r.length;s++){let[c,u]=r[s];a[s]={metadataVariable:n(c),property:u,classProperty:u.classProperty,type:u.classProperty.type,glslType:u.classProperty.getGlslType(),propertyStatistics:o?.properties[c],shaderDestination:he.FRAGMENT}}return a}var XYe=4;function JYe(e,t,n,i,o){if(!l(e))return[];let r=$Ye(n,t);return e.filter(a=>l(a.class)&&r.has(String(a.id))).flatMap(a=>ZYe(a,r,i,o))}function ZYe(e,t,n,i){let{sanitizeGlslIdentifier:o}=xt,r=e.class,a=n?.classes[r.id],s=t.get(String(e.id))??{},c=s.shaderDestination??he.BOTH,u=e.properties,f=r.properties,h=[],p=0;for(let[A,m]of Object.entries(f)){if(!m.isGpuCompatible(XYe))continue;let _=u[A],y=he.intersection(hqe(A,i),c);if(y===he.NONE){p++;continue}h.push({metadataVariable:o(A),property:_,classProperty:m,type:m.type,glslType:m.getGlslType(),propertyStatistics:a?.properties[A],shaderDestination:y,propertyTable:e,featureIdVariableName:s.variableName,propertyInfoIndex:p}),p++}return h}function $Ye(e,t){let n=new Map;function i(s,c){let u=s?.propertyTableId;if(!l(u))return;let f=String(u),h={variableName:s.positionalLabel,shaderDestination:c},p=n.get(f);l(p)&&console.warn(`Multiple feature ID sets reference the same property table ${u} in primitive. Only one will be used.`),n.set(f,h)}let o=t?.featureIds??[];for(let s=0;s<o.length;s++){let c=o[s],u=l(c?.textureReader);i(c,u?he.FRAGMENT:he.BOTH)}let a=e.runtimeNode?.node?.instances?.featureIds??[];for(let s=0;s<a.length;s++){let c=a[s];i(c,he.BOTH)}return n}function eqe(e,t){let n=new Set,i=new Set;for(let s=0;s<t.length;s++){let{type:c,glslType:u,propertyStatistics:f}=t[s];n.add(u),l(f)&&c!==bt.ENUM&&i.add(u)}let o=Si.METADATA_CLASS_FIELDS;for(let s of n){let c=`${s}MetadataClass`;a(c,s,o)}let r=Si.METADATA_STATISTICS_FIELDS;for(let s of i){let c=`${s}MetadataStatistics`;a(c,s,r)}function a(s,c,u){e.addStruct(s,s,he.BOTH);for(let f=0;f<u.length;f++){let{shaderName:h}=u[f],p=u[f].type==="float"?nqe(c):c;e.addStructField(s,p,h)}}}var tqe={int:"float",ivec2:"vec2",ivec3:"vec3",ivec4:"vec4"};function nqe(e){let t=tqe[e];return l(t)?t:e}function iqe(e){e.addStruct(Si.STRUCT_ID_METADATA_VS,Si.STRUCT_NAME_METADATA,he.VERTEX),e.addStruct(Si.STRUCT_ID_METADATA_FS,Si.STRUCT_NAME_METADATA,he.FRAGMENT),e.addStruct(Si.STRUCT_ID_METADATA_CLASS_VS,Si.STRUCT_NAME_METADATA_CLASS,he.VERTEX),e.addStruct(Si.STRUCT_ID_METADATA_CLASS_FS,Si.STRUCT_NAME_METADATA_CLASS,he.FRAGMENT),e.addStruct(Si.STRUCT_ID_METADATA_STATISTICS_VS,Si.STRUCT_NAME_METADATA_STATISTICS,he.VERTEX),e.addStruct(Si.STRUCT_ID_METADATA_STATISTICS_FS,Si.STRUCT_NAME_METADATA_STATISTICS,he.FRAGMENT),e.addFunction(Si.FUNCTION_ID_INITIALIZE_METADATA_VS,Si.FUNCTION_SIGNATURE_INITIALIZE_METADATA,he.VERTEX),e.addFunction(Si.FUNCTION_ID_INITIALIZE_METADATA_FS,Si.FUNCTION_SIGNATURE_INITIALIZE_METADATA,he.FRAGMENT),e.addFunction(Si.FUNCTION_ID_SET_METADATA_VARYINGS,Si.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,he.VERTEX)}function oqe(e,t){rqe(e,t),Zq(e.shaderBuilder,t),$q(e.shaderBuilder,t)}function rqe(e,t){let{shaderBuilder:n}=e,{metadataVariable:i,property:o,glslType:r}=t,a=eK({valueExpression:`attributes.${t.variableName}`,renderResources:e,glslType:r,metadataVariable:i,shaderDestination:he.BOTH,property:o});n.addStructField(Si.STRUCT_ID_METADATA_VS,r,i),n.addStructField(Si.STRUCT_ID_METADATA_FS,r,i);let s=`metadata.${i} = ${a};`;n.addFunctionLines(Si.FUNCTION_ID_INITIALIZE_METADATA_VS,[s]),n.addFunctionLines(Si.FUNCTION_ID_INITIALIZE_METADATA_FS,[s])}function aqe(e,t,n){sqe(e,t,n),Zq(e.shaderBuilder,t),$q(e.shaderBuilder,t)}function sqe(e,t,n){let{shaderBuilder:i,uniformMap:o}=e,{metadataVariable:r,glslType:a,property:s}=t,{texCoord:c,channels:u,index:f,texture:h,transform:p}=s.textureReader,A=`u_propertyTexture_${f}`,m=[];o.hasOwnProperty(A)||(i.addUniform("sampler2D",A,he.FRAGMENT),o[A]=()=>h),i.addStructField(Si.STRUCT_ID_METADATA_FS,a,r);let _=`attributes.texCoord_${c}`,y=_;if(l(p)&&!J.equals(p,J.IDENTITY)){let B=`${A}Transform`;i.addUniform("mat3",B,he.FRAGMENT),o[B]=function(){return p},y=`vec2(${B} * vec3(${_}, 1.0))`}let C=`texture(${A}, ${y}).${u}`,E=s.classProperty,b;n?b=E.unpackTextureInShader(C,u,r,m):b=E.unpackTextureInShaderWebGL1(C);let x=eK({valueExpression:b,renderResources:e,glslType:a,metadataVariable:r,shaderDestination:he.FRAGMENT,property:s}),S=`metadata.${r} = ${x};`;m.push(S),i.addFunctionLines(Si.FUNCTION_ID_INITIALIZE_METADATA_FS,m)}function Zq(e,t){let n=t.classProperty,{metadataVariable:i,glslType:o,shaderDestination:r}=t,a=mhe(Si.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,o),s=`${o}MetadataClass`;e.addStructField(Si.STRUCT_ID_METADATA_CLASS_FS,s,i),e.addFunctionLines(Si.FUNCTION_ID_INITIALIZE_METADATA_FS,a),he.includesVertexShader(r)&&(e.addStructField(Si.STRUCT_ID_METADATA_CLASS_VS,s,i),e.addFunctionLines(Si.FUNCTION_ID_INITIALIZE_METADATA_VS,a))}function $q(e,t){let{propertyStatistics:n}=t;if(!l(n))return;let{metadataVariable:i,type:o,glslType:r}=t;if(o===bt.ENUM)return;let a=Si.METADATA_STATISTICS_FIELDS,s=`metadataStatistics.${i}`,c=mhe(a,n,s,r),u=`${r}MetadataStatistics`;e.addStructField(Si.STRUCT_ID_METADATA_STATISTICS_FS,u,i),e.addFunctionLines(Si.FUNCTION_ID_INITIALIZE_METADATA_FS,c),he.includesVertexShader(t.shaderDestination)&&(e.addStructField(Si.STRUCT_ID_METADATA_STATISTICS_VS,u,i),e.addFunctionLines(Si.FUNCTION_ID_INITIALIZE_METADATA_VS,c))}function cqe(e,t,n){lqe(e,t,n),Zq(e.shaderBuilder,t),$q(e.shaderBuilder,t)}function lqe(e,t,n){let{shaderBuilder:i,uniformMap:o}=e,{metadataVariable:r,glslType:a,property:s,featureIdVariableName:c,propertyTable:u,propertyInfoIndex:f}=t;if(!n){It("PropertyTableCustomShader","Property table support for custom shaders requires WebGL2.");return}if(!l(c)||!l(u.texture))return;let h=`u_propertyTableTexture_${u.id}`,p=[];o.hasOwnProperty(h)||(i.addUniform("sampler2D",h,he.BOTH),o[h]=()=>u.texture);let A=t.shaderDestination;he.includesVertexShader(A)&&i.addStructField(Si.STRUCT_ID_METADATA_VS,a,r),he.includesFragmentShader(A)&&i.addStructField(Si.STRUCT_ID_METADATA_FS,a,r);let _=`ivec2(${`featureIds.${c}`}, ${f})`,y=`texelFetch(${h}, ${_}, 0)`,C=t.classProperty,E=C.unpackTextureInShader(y,"rgba",r,p),b=eK({valueExpression:E,renderResources:e,glslType:a,metadataVariable:r,shaderDestination:A,property:s??C}),x=`metadata.${r} = ${b};`;p.push(x),he.includesVertexShader(A)&&i.addFunctionLines(Si.FUNCTION_ID_INITIALIZE_METADATA_VS,p),he.includesFragmentShader(A)&&i.addFunctionLines(Si.FUNCTION_ID_INITIALIZE_METADATA_FS,p)}function mhe(e,t,n,i){function o(r){let a=t[r.specName];if(l(a))return`${n}.${r.shaderName} = ${i}(${a});`}return l(t)?e.map(o).filter(l):[]}function eK(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:a,uniformMap:s}=e.renderResources,{glslType:c,shaderDestination:u}=e;a.addUniform(c,o,u),a.addUniform(c,r,u);let{offset:f,scale:h}=n;return s[o]=()=>f,s[r]=()=>h,`czm_valueTransform(${o}, ${r}, ${t})`}function uqe(e,t){let n=new Set,i=new Set;return fqe(e,n,i),dqe(e,t,n,i),{usedInVertex:n,usedInFragment:i}}function fqe(e,t,n){let i=e.customShader;if(!l(i))return;let o=i.usedVariablesFragment?.metadataSet??{};for(let a in o)o.hasOwnProperty(a)&&n.add(a);let r=i.usedVariablesVertex?.metadataSet??{};for(let a in r)r.hasOwnProperty(a)&&t.add(a)}function dqe(e,t,n,i){let o=e.style;if(!(l(o)&&t.primitiveType===ve.POINTS))return;let a=o.color?.getVariables?.()??[];for(let u of a)n.add(u),i.add(u);let s=o.show?.getVariables?.()??[];for(let u of s)n.add(u),i.add(u);let c=o.pointSize?.getVariables?.()??[];for(let u of c)n.add(u)}function hqe(e,t){let n=t.usedInFragment.has(e)?he.FRAGMENT:he.NONE,i=t.usedInVertex.has(e)?he.VERTEX:he.NONE;return he.union(n,i)}var vd=Si;var mqe={INHERIT:0,OPAQUE:1,TRANSLUCENT:2},Uy=Object.freeze(mqe);var Fa={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:It};Fa.process=function(e,t,n){let i=e.model.customShader;if(i&&Fa.process_original(e,t,n,i),l(e.model._marsOptions)&&l(e.model._marsOptions.customShaders)){let o=bA.getCache(e.model._marsOptions.customShaders);for(let r in o)Object.prototype.hasOwnProperty.call(o,r)&&Fa.process_original(e,t,n,o[r])}};Fa.process_original=function(e,t,n,i){let{shaderBuilder:o,alphaOptions:r}=e,{lightingModel:a,translucencyMode:s}=i;l(a)&&(e.lightingOptions.lightingModel=a),s===Uy.TRANSLUCENT?r.pass=Be.TRANSLUCENT:s===Uy.OPAQUE&&(r.pass=void 0);let c=bqe(i,t,e);if(!c.customShaderEnabled)return;if(Sqe(o,i,c),c.shouldComputePositionWC&&o.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,he.BOTH),l(i.vertexShaderText)&&o.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,he.VERTEX),l(i.fragmentShaderText)){o.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,he.FRAGMENT);let h=yg.getDefineName(i.mode);o.addDefine(h,void 0,he.FRAGMENT)}let u=i.uniforms;for(let h in u)if(u.hasOwnProperty(h)){let p=u[h];o.addUniform(p.type,h)}let f=i.varyings;for(let h in f)if(f.hasOwnProperty(h)){let p=f[h];o.addVarying(p,h)}e.uniformMap=Pt(e.uniformMap,i.uniformMap)};function pqe(e){let t={};for(let n=0;n<e.length;n++){let i=xt.getAttributeInfo(e[n]);t[i.variableName]=i}return t}var Aqe={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},gqe={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 phe(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");let n=Aqe[t],i=gqe[t];if(l(n))return{attributeField:[n,e],value:i}}function _qe(e,t,n){if(!l(e.vertexShaderText))return{enabled:!1};let i=e.usedVariablesVertex;if(!_he(i.metadataSet,n))return{enabled:!1};let o=i.attributeSet,r=Ahe(t,o,!1),a=ghe(t,o,!1),s,c=[],u=[];for(let f in r){if(!r.hasOwnProperty(f))continue;let p=[r[f].glslType,f];c.push(p),s=`vsInput.attributes.${f} = attributes.${f};`,u.push(s)}for(let f=0;f<a.length;f++){let h=a[f],p=phe(h);if(!l(p))return Fa._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveVS",`Primitive is missing attribute ${h}, disabling custom vertex shader`),{enabled:!1};c.push(p.attributeField),s=`vsInput.attributes.${h} = ${p.value};`,u.push(s)}return{enabled:!0,attributeFields:c,initializationLines:u}}function yqe(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 Cqe(e,t,n){if(!l(e.fragmentShaderText))return{enabled:!1};let i=e.usedVariablesFragment;if(!_he(i.metadataSet,n))return{enabled:!1};let o=i.attributeSet,r=Ahe(t,o,!0),a=ghe(t,o,!0),s,c=[],u=[];for(let h in r){if(!r.hasOwnProperty(h))continue;let A=[r[h].glslType,h];c.push(A),s=`fsInput.attributes.${h} = attributes.${h};`,u.push(s)}for(let h=0;h<a.length;h++){let p=a[h],A=phe(p);if(!l(A))return Fa._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveFS",`Primitive is missing attribute ${p}, disabling custom fragment shader.`),{enabled:!1};c.push(A.attributeField),s=`fsInput.attributes.${p} = ${A.value};`,u.push(s)}let f=yqe(e);return{enabled:!0,attributeFields:c.concat(f.attributeFields),initializationLines:f.initializationLines.concat(u)}}var Eqe={positionWC:!0,positionEC:!0};function Ahe(e,t,n){let i={};for(let o in e){if(!e.hasOwnProperty(o))continue;let r=e[o],a=o;n&&o==="normalMC"?a="normalEC":n&&o==="tangentMC"&&(a="tangentEC",r.glslType="vec3"),t.hasOwnProperty(a)&&(i[a]=r)}return i}function ghe(e,t,n){let i=[];for(let o in t){if(!t.hasOwnProperty(o)||Eqe.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 bqe(e,t,n){let i=pqe(t.attributes),o=wqe(t,n.model.structuralMetadata),r=_qe(e,i,o),a=Cqe(e,i,o),c=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&a.enabled;return{vertexLines:r,fragmentLines:a,customShaderEnabled:r.enabled||a.enabled,shouldComputePositionWC:c}}function Iqe(e,t){let n=Fa.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(n,Fa.STRUCT_NAME_ATTRIBUTES,he.VERTEX);let{attributeFields:i,initializationLines:o}=t;for(let a=0;a<i.length;a++){let[s,c]=i[a];e.addStructField(n,s,c)}n=Fa.STRUCT_ID_VERTEX_INPUT,e.addStruct(n,Fa.STRUCT_NAME_VERTEX_INPUT,he.VERTEX),e.addStructField(n,Fa.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,ky.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,vd.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,vd.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,vd.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=Fa.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(r,Fa.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,he.VERTEX),e.addFunctionLines(r,o)}function xqe(e,t){let n=Fa.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(n,Fa.STRUCT_NAME_ATTRIBUTES,he.FRAGMENT);let{attributeFields:i,initializationLines:o}=t;for(let a=0;a<i.length;a++){let[s,c]=i[a];e.addStructField(n,s,c)}n=Fa.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(n,Fa.STRUCT_NAME_FRAGMENT_INPUT,he.FRAGMENT),e.addStructField(n,Fa.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,ky.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,vd.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,vd.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,vd.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=Fa.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(r,Fa.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,he.FRAGMENT),e.addFunctionLines(r,o)}var Tqe=[];function Sqe(e,t,n){let{vertexLines:i,fragmentLines:o}=n,r=Tqe;i.enabled&&(Iqe(e,i),r.length=0,r.push("#line 0",t.vertexShaderText,PL),e.addVertexLines(r)),o.enabled&&(xqe(e,o),r.length=0,r.push("#line 0",t.fragmentShaderText,RL),e.addFragmentLines(r))}function wqe(e,t){if(!l(t))return new Set;let n=e.propertyTextureIds,i=e.propertyAttributeIds,o=l(e.featureIds)?e.featureIds.map(s=>s.propertyTableId):[],r=new Set;function a(s,c){for(let u of s){let h=c[u].class.properties;Object.keys(h).forEach(p=>r.add(p))}}return a(n,t.propertyTextures),a(i,t.propertyAttributes),a(o,t.propertyTables),r}function _he(e,t){for(let n in e)if(e.hasOwnProperty(n)&&!t.has(n))return Fa._oneTimeWarning("CustomShaderPipelineStage.checkMetadataCompatibility",`A custom shader uses metadata property "${n}" which is not present for all primitives in the tileset. Disabling the custom shader for these primitives.`),!1;return!0}var FL=Fa;var QL={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};QL.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=l(o.classificationType);i.addDefine("USE_DEQUANTIZATION",void 0,he.VERTEX),i.addFunction(QL.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,QL.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,he.VERTEX);let a=t.attributes;for(let s=0;s<a.length;s++){let c=a[s],u=c.quantization;if(!l(u))continue;let f=c.semantic===at.POSITION,h=c.semantic===at.TEXCOORD;if(r&&!f&&!h)continue;let p=xt.getAttributeInfo(c);Dqe(i,p),Bqe(e,p)}};function Bqe(e,t){let n=e.shaderBuilder,i=e.uniformMap,o=t.variableName,r=t.attribute.quantization;if(r.octEncoded){let a=`model_normalizationRange_${o}`;n.addUniform("float",a,he.VERTEX),i[a]=function(){return r.normalizationRange}}else{let a=`model_quantizedVolumeOffset_${o}`,s=`model_quantizedVolumeStepSize_${o}`,c=t.glslType;n.addUniform(c,a,he.VERTEX),n.addUniform(c,s,he.VERTEX);let u=r.quantizedVolumeOffset,f=r.quantizedVolumeStepSize;/^color_\d+$/.test(o)&&(u=yhe(u,0),f=yhe(f,1)),i[a]=function(){return u},i[s]=function(){return f}}}function yhe(e,t){return e instanceof ie?e:new ie(e.x,e.y,e.z,t)}function Dqe(e,t){let n=t.variableName,i=t.attribute.quantization,o;i.octEncoded?o=vqe(n,i):o=Pqe(n),e.addFunctionLines(QL.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[o])}function vqe(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 Pqe(e){let t=`attributes.${e}`,n=`a_quantized_${e}`,i=`model_quantizedVolumeOffset_${e}`,o=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${i} + ${n} * ${o};`}var kL=QL;var UL=`void edgeDetectionStage(inout vec4 color, inout FeatureIds featureIds) {
if (u_isEdgePass) {
return;
}
vec2 screenCoord = gl_FragCoord.xy / czm_viewport.zw;
vec4 edgeColor = texture(czm_edgeColorTexture, screenCoord);
vec4 edgeId = texture(czm_edgeIdTexture, screenCoord);
// Packed window-space depth from edge pass (0..1)
float edgeDepthWin = czm_unpackDepth(texture(czm_edgeDepthTexture, screenCoord));
// Near / far for current frustum
float n = czm_currentFrustum.x;
float f = czm_currentFrustum.y;
// geometry depth in eye coordinate
vec4 geomEC = czm_windowToEyeCoordinates(gl_FragCoord);
float geomDepthLinear = -geomEC.z;
// Convert edge depth to linear depth
float z_ndc_edge = edgeDepthWin * 2.0 - 1.0;
float edgeDepthLinear = (2.0 * n * f) / (f + n - z_ndc_edge * (f - n));
float d = abs(edgeDepthLinear - geomDepthLinear);
// Adaptive epsilon using linear depth fwidth for robustness
float pixelStepLinear = fwidth(geomDepthLinear);
float rel = geomDepthLinear * 0.0005;
float eps = max(n * 1e-4, max(pixelStepLinear * 1.5, rel));
// If Edge isn't behind any geometry and the pixel has edge data
if (d < eps && edgeId.r > 0.0) {
#ifdef HAS_EDGE_FEATURE_ID
float edgeFeatureId = edgeId.g;
float currentFeatureId = float(featureIds.featureId_0);
#endif
float globeDepth = czm_unpackDepth(texture(czm_globeDepthTexture, screenCoord));
// Background / sky / globe: always show edge
bool isBackground = geomDepthLinear > globeDepth;
bool drawEdge = isBackground;
#ifdef HAS_EDGE_FEATURE_ID
bool hasEdgeFeature = edgeFeatureId > 0.0;
bool hasCurrentFeature = currentFeatureId > 0.0;
bool featuresMatch = edgeFeatureId == currentFeatureId;
drawEdge = drawEdge || !hasEdgeFeature || !hasCurrentFeature || featuresMatch;
#else
drawEdge = true;
#endif
if (drawEdge) {
color = edgeColor;
}
}
}
`;var Che={name:"EdgeDetectionPipelineStage"};Che.process=function(e){e.shaderBuilder.addFragmentLines([UL])};var zL=Che;var GL=`// CESIUM_REDIRECTED_COLOR_OUTPUT flag is used to avoid color attachment conflicts
// when shaders are processed by different rendering pipelines (e.g., OIT).
// Only declare MRT outputs when not in a derived shader context.
#if defined(HAS_EDGE_VISIBILITY_MRT) && !defined(CESIUM_REDIRECTED_COLOR_OUTPUT)
layout(location = 1) out vec4 out_id; // edge id / metadata
layout(location = 2) out vec4 out_edgeDepth; // packed depth
#endif
void edgeVisibilityStage(inout vec4 color, inout FeatureIds featureIds)
{
#ifdef HAS_EDGE_VISIBILITY
if (!u_isEdgePass) {
return;
}
float edgeTypeInt = v_edgeType * 255.0;
if (edgeTypeInt < 0.5) {
discard;
}
if (edgeTypeInt > 0.5 && edgeTypeInt < 1.5) { // silhouette candidate
// Silhouette check done in vertex shader
// v_shouldDiscard will be > 0.5 if this edge should be discarded
if (v_shouldDiscard > 0.5) {
discard;
}
}
vec4 finalColor = color;
#ifdef HAS_EDGE_COLOR_ATTRIBUTE
if (v_edgeColor.a >= 0.0) {
finalColor = v_edgeColor;
}
#endif
#ifdef HAS_LINE_PATTERN
// Pattern is 16-bit, each bit represents visibility at that position
const float maskLength = 16.0;
// Get the relative position within the dash from 0 to 1
float dashPosition = fract(v_lineCoord / maskLength);
// Figure out the mask index
float maskIndex = floor(dashPosition * maskLength);
// Test the bit mask
float maskTest = floor(u_linePattern / pow(2.0, maskIndex));
// If bit is 0 (gap), discard the fragment (use < 1.0 for better numerical stability)
if (mod(maskTest, 2.0) < 1.0) {
discard;
}
#endif
color = finalColor;
#if defined(HAS_EDGE_VISIBILITY_MRT) && !defined(CESIUM_REDIRECTED_COLOR_OUTPUT)
// Write edge metadata
out_id = vec4(0.0);
out_id.r = edgeTypeInt; // Edge type (0-3)
#ifdef HAS_EDGE_FEATURE_ID
out_id.g = float(featureIds.featureId_0); // Feature ID if available
#else
out_id.g = 0.0;
#endif
// Pack depth into separate MRT attachment
out_edgeDepth = czm_packDepth(gl_FragCoord.z);
#endif
#endif
}`;var VL=`#ifdef HAS_EDGE_VISIBILITY
void edgeVisibilityStageVS() {
if (!u_isEdgePass) {
return;
}
v_edgeType = a_edgeType;
v_silhouetteNormalView = czm_normal * a_silhouetteNormal;
v_faceNormalAView = czm_normal * a_faceNormalA;
v_faceNormalBView = czm_normal * a_faceNormalB;
v_edgeOffset = a_edgeOffset;
// Silhouette detection: check both endpoints of the edge
v_shouldDiscard = 0.0;
float edgeTypeInt = a_edgeType * 255.0;
if (edgeTypeInt > 0.5 && edgeTypeInt < 1.5) {
vec3 normalA = normalize(v_faceNormalAView);
vec3 normalB = normalize(v_faceNormalBView);
const float perpTol = 2.5e-4;
// Check at current vertex (first endpoint)
vec4 currentPosEC = czm_modelView * vec4(v_positionMC, 1.0);
vec3 toEye1 = normalize(-currentPosEC.xyz);
float dotA1 = dot(normalA, toEye1);
float dotB1 = dot(normalB, toEye1);
// Check at other vertex (second endpoint)
vec4 otherPosEC = czm_modelView * vec4(a_edgeOtherPos, 1.0);
vec3 toEye2 = normalize(-otherPosEC.xyz);
float dotA2 = dot(normalA, toEye2);
float dotB2 = dot(normalB, toEye2);
// Discard if EITHER endpoint is non-silhouette
if (dotA1 * dotB1 > perpTol || dotA2 * dotB2 > perpTol) {
v_shouldDiscard = 1.0;
}
}
#ifdef HAS_EDGE_FEATURE_ID
v_featureId_0 = a_edgeFeatureId;
#endif
#ifdef HAS_EDGE_COLOR_ATTRIBUTE
v_edgeColor = a_edgeColor;
#endif
#ifdef HAS_LINE_PATTERN
#ifdef HAS_EDGE_CUMULATIVE_DISTANCE
v_lineCoord = a_edgeCumulativeDistance * u_pixelsPerWorld;
#else
vec4 currentClip = czm_modelViewProjection * vec4(v_positionMC, 1.0);
vec2 currentScreen = ((currentClip.xy / currentClip.w) * 0.5 + 0.5) * czm_viewport.zw;
vec4 otherClip = czm_modelViewProjection * vec4(a_edgeOtherPos, 1.0);
vec2 otherScreen = ((otherClip.xy / otherClip.w) * 0.5 + 0.5) * czm_viewport.zw;
vec2 windowDir = otherScreen - currentScreen;
const float textureCoordinateBase = 8192.0;
if (abs(windowDir.x) > abs(windowDir.y)) {
v_lineCoord = textureCoordinateBase + currentScreen.x;
} else {
v_lineCoord = textureCoordinateBase + currentScreen.y;
}
#endif
#endif
// Expand vertex to form quad
vec4 posClip = gl_Position;
if (length(a_edgeOtherPos) > 0.0 && abs(a_edgeOffset) > 0.0) {
vec4 currentClip = posClip;
vec4 otherClip = czm_modelViewProjection * vec4(a_edgeOtherPos, 1.0);
vec2 currentNDC = currentClip.xy / currentClip.w;
vec2 otherNDC = otherClip.xy / otherClip.w;
vec2 edgeDirNDC = otherNDC - currentNDC;
// Ensure consistent edge direction
if (edgeDirNDC.x < 0.0 || (abs(edgeDirNDC.x) < 0.001 && edgeDirNDC.y < 0.0)) {
edgeDirNDC = -edgeDirNDC;
}
edgeDirNDC = normalize(edgeDirNDC);
vec2 perpNDC = vec2(-edgeDirNDC.y, edgeDirNDC.x);
// Convert line width from pixels to clip space
float lineWidthPixels = u_lineWidth;
vec2 viewportSize = czm_viewport.zw;
vec2 clipPerPixel = (2.0 / viewportSize) * currentClip.w;
vec2 offsetClip = perpNDC * lineWidthPixels * clipPerPixel * 0.5 * a_edgeOffset;
posClip.xy += offsetClip;
}
gl_Position = posClip;
}
#endif
`;var tK=class e{static readAttributeAsTypedArray(t){let n=e.readAttributeAsRawCompactTypedArray(t),i=t.normalized,o=t.quantization;if(!l(o)&&!i)return n;let r=t.type,a=t.count,s=n;return i&&(s=tn.dequantize(n,t.componentDatatype,r,a)),l(o)?e.dequantize(s,a,r,o):s}static readAttributeAsRawCompactTypedArray(t){let n=t.type,i=t.count,o=Ut.getNumberOfComponents(n),r=i*o,a=t.componentDatatype,s=t.quantization;l(s)&&(a=s.componentDatatype);let c=t.buffer,u=t.byteOffset,f=t.byteStride,h=j.getSizeInBytes(a),p=o*h;if(!l(f)||f===p){let b=j.createTypedArray(a,r);return c.getBufferData(b,u),b}let A=new Uint8Array(c.sizeInBytes);c.getBufferData(A);let m=j.createTypedArray(a,r),_=f??p,y=new DataView(A.buffer,A.byteOffset,A.byteLength),C=new Array(o),E=e.createComponentsReader(a);for(let b=0;b<i;++b){let x=u+b*_;E(y,x,o,C);for(let S=0;S<o;++S)m[b*o+S]=C[S]}return m}static dequantize(t,n,i,o){if(o.octEncoded){let s=e.octDecode(t,n,o.normalizationRange,void 0);return o.octEncodedZXY&&e.convertZxyToXyz(s,s),s}let r=o.quantizedVolumeStepSize,a=o.quantizedVolumeOffset;if(i===Ut.SCALAR)return e.dequantize1D(t,n,r,a,void 0);if(i===Ut.VEC2)return e.dequantize2D(t,n,r,a,void 0);if(i===Ut.VEC3)return e.dequantize3D(t,n,r,a,void 0);if(i===Ut.VEC4)return e.dequantize4D(t,n,r,a,void 0);throw new de(`Element type for dequantization must be SCALAR, VEC2, VEC3, or VEC4, but is ${i}`)}static octDecode(t,n,i,o){l(o)||(o=new Float32Array(t.length));let r=new d;for(let a=0;a<n;a++)d.unpack(t,a*3,r),tn.octDecodeInRange(r,i,r),d.pack(o,r,a*3);return o}static convertZxyToXyz(t,n,i){l(i)||(i=new Float32Array(t.length));let o=0;for(let r=0;r<n;r++,o+=3){let a=t[o+0],s=t[o+1],c=t[o+2];i[o+0]=s,i[o+1]=c,i[o+2]=a}return i}static dequantize1D(t,n,i,o,r){l(r)||(r=new Float32Array(t.length));for(let a=0;a<n;a++){let c=t[a]*i+o;r[a]=c}return r}static dequantize2D(t,n,i,o,r){l(r)||(r=new Float32Array(t.length));let a=new k;for(let s=0;s<n;s++)k.unpack(t,s*2,a),k.multiplyComponents(a,i,a),k.add(a,o,a),k.pack(a,r,s*2);return r}static dequantize3D(t,n,i,o,r){l(r)||(r=new Float32Array(t.length));let a=new d;for(let s=0;s<n;s++)d.unpack(t,s*3,a),d.multiplyComponents(a,i,a),d.add(a,o,a),d.pack(a,r,s*3);return r}static dequantize4D(t,n,i,o,r){l(r)||(r=new Float32Array(t.length));let a=new ie;for(let s=0;s<n;s++)ie.unpack(t,s*4,a),ie.multiplyComponents(a,i,a),ie.add(a,o,a),ie.pack(a,r,s*4);return r}static createComponentsReader(t){let n=e.createComponentReader(t),i=j.getSizeInBytes(t);return function(o,r,a,s){let c=r;for(let u=0;u<a;++u)s[u]=n(o,c),c+=i}}static createComponentReader(t){switch(t){case j.BYTE:return function(n,i){return n.getInt8(i)};case j.UNSIGNED_BYTE:return function(n,i){return n.getUint8(i)};case j.SHORT:return function(n,i){return n.getInt16(i,!0)};case j.UNSIGNED_SHORT:return function(n,i){return n.getUint16(i,!0)};case j.INT:return function(n,i){return n.getInt32(i,!0)};case j.UNSIGNED_INT:return function(n,i){return n.getUint32(i,!0)};case j.FLOAT:return function(n,i){return n.getFloat32(i,!0)};case j.DOUBLE:return function(n,i){return n.getFloat64(i,!0)}}throw new de(`The componentType must be a valid ComponentDatatype, but is ${t}`)}static transform3D(t,n,i){l(i)||(i=new Float32Array(t.length));let o=new d,r=t.length/3;for(let a=0;a<r;a++)d.unpack(t,a*3,o),M.multiplyByPoint(n,o,o),d.pack(o,i,a*3);return i}static readIndicesAsTypedArray(t){let n=t.typedArray;if(l(n))return n;let i=t.buffer,o=t.count,r=t.indexDatatype,a=e.createIndexTypedArray(r,o);return i.getBufferData(a),a}static readIndicesAsTriangleIndicesTypedArray(t,n){let i=e.readIndicesAsTypedArray(t);if(n===ve.TRIANGLES)return i;if(n===ve.TRIANGLE_STRIP)return e.convertTriangleStripToTriangleIndices(i);if(n===ve.TRIANGLE_FAN)return e.convertTriangleFanToTriangleIndices(i);throw new de(`The primitiveType must be TRIANGLES (${ve.TRIANGLES}, TRIANGLE_STRIP (${ve.TRIANGLE_STRIP}, or TRIANGLE_FAN (${ve.TRIANGLE_FAN}, but is ${n}`)}static convertTriangleStripToTriangleIndices(t){let n=t.constructor((t.length-2)*3);for(let i=0;i<t.length-2;i++)i%2===1?(n[i*3+0]=t[i+0],n[i*3+1]=t[i+2],n[i*3+2]=t[i+1]):(n[i*3+0]=t[i+0],n[i*3+1]=t[i+1],n[i*3+2]=t[i+2]);return n}static convertTriangleFanToTriangleIndices(t){let n=t.constructor((t.length-2)*3);for(let i=0;i<t.length-2;i++)n[i*3+0]=t[i+0],n[i*3+1]=t[i+1],n[i*3+2]=t[i+2];return n}static createIndexTypedArray(t,n){switch(t){case Ue.UNSIGNED_BYTE:return new Uint8Array(n);case Ue.UNSIGNED_SHORT:return new Uint16Array(n);case Ue.UNSIGNED_INT:return new Uint32Array(n)}throw new de(`The indexDatatype must be UNSIGNED_BYTE (${Ue.UNSIGNED_BYTE}, UNSIGNED_SHORT (${Ue.UNSIGNED_SHORT}, or UNSIGNED_INT (${Ue.UNSIGNED_INT}, but is ${t}`)}},il=tK;var Ehe={name:"EdgeVisibilityPipelineStage"};Ehe.process=function(e,t,n){if(!l(t.edgeVisibility))return;n.edgeVisibilityRequested=!0;let i=e.shaderBuilder;i.addDefine("HAS_EDGE_VISIBILITY",void 0,he.BOTH),i.addDefine("HAS_EDGE_VISIBILITY_MRT",void 0,he.FRAGMENT),i.addFragmentLines(GL),i.addVertexLines(VL),i.addUniform("bool","u_isEdgePass",he.BOTH);let o=t.material,r=l(o)?o.lineStyle:void 0;(!l(r)||!l(r.width))&&i.addUniform("float","u_lineWidth",he.VERTEX);let a=i.addAttribute("float","a_edgeType");i.addVarying("float","v_edgeType","flat");let s=i.addAttribute("float","a_edgeFeatureId"),c=i.addAttribute("vec3","a_silhouetteNormal");i.addVarying("vec3","v_silhouetteNormalView","flat");let u=i.addAttribute("vec3","a_faceNormalA"),f=i.addAttribute("vec3","a_faceNormalB");i.addVarying("vec3","v_faceNormalAView","flat"),i.addVarying("vec3","v_faceNormalBView","flat"),i.addVarying("float","v_shouldDiscard","flat");let h=i.addAttribute("vec3","a_edgeOtherPos"),p=i.addAttribute("float","a_edgeOffset");i.addVarying("float","v_edgeOffset");let A=Rqe(t),m=Nqe(t);if(!l(m)||!l(m.edgeIndices)||m.edgeIndices.length===0)return;let _=e.runtimePrimitive.primitive,y=Lqe(_),E=m.edgeData.some(function(L){return l(L.color)})||l(y),b;E&&(b=i.addAttribute("vec4","a_edgeColor"),i.addVarying("vec4","v_edgeColor","flat"),i.addDefine("HAS_EDGE_COLOR_ATTRIBUTE",void 0,he.BOTH));let x,S,B=xt.getAttributeBySemantic(t,"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE");l(B)&&(x=B,S=i.addAttribute("float","a_edgeCumulativeDistance"),i.addDefine("HAS_EDGE_CUMULATIVE_DISTANCE",void 0,he.VERTEX));let v=Mqe(A,m.edgeIndices,m.edgeData,t.edgeVisibility),P=Oqe(m.edgeIndices,m.edgeData,e,n.context,a,c,u,f,s,b,h,p,y,t.edgeVisibility,v,x,S);if(!l(P))return;P.hasEdgeFeatureIds&&i.addDefine("HAS_EDGE_FEATURE_ID",void 0,he.BOTH),e.uniformMap.u_isEdgePass=function(){return!1},l(e.uniformMap.u_lineWidth)||(e.uniformMap.u_lineWidth=function(){return 1}),l(x)&&(l(e.uniformMap.u_pixelsPerWorld)||(e.uniformMap.u_pixelsPerWorld=function(){return 1}));let N=l(r)&&l(r.width)?r.width*n.pixelRatio:void 0;e.edgeGeometry={vertexArray:P.vertexArray,indexCount:P.indexCount,primitiveType:ve.TRIANGLES,pass:Be.CESIUM_3D_TILE_EDGES,lineWidth:N}};function Rqe(e){let t=e.indices;if(!l(t))return{edgeMap:new Map,faceNormals:new Float32Array(0),triangleCount:0};let n=t.typedArray,i=Math.floor(n.length/3),o=xt.getAttributeBySemantic(e,at.POSITION),r=l(o.typedArray)?o.typedArray:il.readAttributeAsTypedArray(o),a=o.quantization;if(l(a)&&!a.octEncoded){let y=r.length,C=new Float32Array(y),E=a.quantizedVolumeOffset,b=a.quantizedVolumeStepSize;for(let x=0;x<y;x+=3)C[x]=E.x+r[x]*b.x,C[x+1]=E.y+r[x+1]*b.y,C[x+2]=E.z+r[x+2]*b.z;r=C}let s=new Map,c=new Float32Array(i*3),u=new d,f=new d,h=new d,p=new d,A=new d,m=new d;function _(y,C,E){let b=`${y<C?y:C},${y<C?C:y}`,x=s.get(b);l(x)||(x=[],s.set(b,x)),x.length<2&&x.push(E)}for(let y=0;y<i;y++){let C=y*3,E=n[C],b=n[C+1],x=n[C+2],S=E*3,B=b*3,v=x*3;u.x=r[S],u.y=r[S+1],u.z=r[S+2],f.x=r[B],f.y=r[B+1],f.z=r[B+2],h.x=r[v],h.y=r[v+1],h.z=r[v+2],d.subtract(f,u,p),d.subtract(h,u,A),d.cross(p,A,m),d.normalize(m,m),c[C]=m.x,c[C+1]=m.y,c[C+2]=m.z,_(E,b,y),_(b,x,y),_(x,E,y)}return{edgeMap:s,faceNormals:c,triangleCount:i}}function Mqe(e,t,n,i){let{edgeMap:o,faceNormals:r}=e,a=t.length/2,s=new Float32Array(a*6),c=l(i)&&l(i.silhouetteNormals),u=null,f=new d,h=new d;if(c){let p=C=>2*((C+128)/255)-1,A=new Uint16Array(i.silhouetteNormals.length),m=new d,_=new k;for(let C=0;C<i.silhouetteNormals.length;C++){let E=i.silhouetteNormals[C];m.x=p(E.x),m.y=p(E.y),m.z=p(E.z),d.magnitude(m)>0?d.normalize(m,m):(m.x=0,m.y=0,m.z=1),tn.octEncodeInRange(m,255,_);let x=_.x&255,S=_.y&255;A[C]=S<<8|x}let y=Math.floor(A.length/2);u=new Uint32Array(y);for(let C=0;C<y;C++){let E=A[C*2],b=A[C*2+1];u[C]=E|b<<16}}for(let p=0;p<a;p++){let A=t[p*2],m=t[p*2+1],_=`${A<m?A:m},${A<m?m:A}`,y=o.get(_),{edgeType:C,mateVertexIndex:E}=n[p],b,x,S,B,v,P,N=!1;if(c&&u&&C===1&&E>=0&&E<u.length){let g=u[E];tn.octDecode(g&255,g>>8&255,f),tn.octDecode(g>>16&255,g>>24&255,h),b=f.x,x=f.y,S=f.z,B=h.x,v=h.y,P=h.z,N=!0}if(!N){if(!l(y)||y.length===0)continue;let I=y[0]*3;if(b=r[I],x=r[I+1],S=r[I+2],y.length>1){let R=y[1]*3;B=r[R],v=r[R+1],P=r[R+2]}else B=-b,v=-x,P=-S}let L=p*6;s[L]=b,s[L+1]=x,s[L+2]=S,s[L+3]=B,s[L+4]=v,s[L+5]=P}return s}function Nqe(e){let t=e.edgeVisibility;if(!l(t))return[];let n=t.visibility,i=e.indices,o=t.lineStrings,r=e.attributes,a=l(r)&&r.length>0?r[0].count:0,s=l(n)&&l(i)&&l(i.typedArray)&&i.typedArray.length>0,c=l(o)&&o.length>0;if(!s&&!c)return[];let u=s?i.typedArray:void 0,f=[],h=[],p=new Set,A=0,m=t.materialColor;if(s){let _=0,y=u.length,C=n;for(let E=0;E+2<y;E+=3){let b=u[E],x=u[E+1],S=u[E+2];for(let B=0;B<3;B++){let v,P;B===0?(v=b,P=x):B===1?(v=x,P=S):(v=S,P=b);let N=Math.floor(_/4),L=_%4*2;if(_++,N>=C.length)break;let I=C[N]>>L&3;if(I===0)continue;let T=Math.min(v,P),w=Math.max(v,P),R=`${T},${w}`;if(p.has(R))continue;p.add(R),f.push(v,P);let O=-1;I===1&&(O=A,A++),h.push({edgeType:I,triangleIndex:Math.floor(E/3),edgeIndex:B,mateVertexIndex:O,currentTriangleVertices:[b,x,S],color:m})}}}if(c)for(let _=0;_<o.length;_++){let y=o[_];if(!l(y)||!l(y.indices))continue;let C=y.indices;if(!l(C)||C.length<2)continue;let E=y.restartIndex,b=l(y.materialColor)?y.materialColor:m,x;for(let S=0;S<C.length;S++){let B=C[S];if(l(E)&&B===E){x=void 0;continue}if(!l(x)){x=B;continue}let v=x,P=B;if(x=B,v===P||a>0&&(v<0||v>=a||P<0||P>=a))continue;let N=Math.min(v,P),L=Math.max(v,P),g=`${N},${L}`;p.has(g)||(p.add(g),f.push(v,P),h.push({edgeType:2,triangleIndex:-1,edgeIndex:-1,mateVertexIndex:-1,currentTriangleVertices:void 0,color:l(b)?b:void 0}))}}return{edgeIndices:f,edgeData:h,silhouetteEdgeCount:A}}function Lqe(e){if(!l(e))return;let t=xt.getAttributeBySemantic(e,at.COLOR);if(!l(t))return;let n=Ut.getNumberOfComponents(t.type);if(n!==3&&n!==4)return;let i=t.typedArray;if(l(i)||(i=il.readAttributeAsTypedArray(t)),!l(i))return;let o=t.count;if(!l(o)||o===0||i.length<o*n)return;let r=i instanceof Float32Array||i instanceof Float64Array,a=i instanceof Uint8Array,s=i instanceof Uint16Array;if(!r&&!a&&!s)return;let c=new Float32Array(o*4),u=function(f){let h;return r?h=f:a?h=f/255:s&&(h=f/65535),Math.min(Math.max(h,0),1)};for(let f=0;f<o;f++){let h=f*n,p=f*4;c[p]=u(i[h]),c[p+1]=u(i[h+1]),c[p+2]=u(i[h+2]),n===4?c[p+3]=u(i[h+3]):c[p+3]=1}return{colors:c,count:o}}function Oqe(e,t,n,i,o,r,a,s,c,u,f,h,p,A,m,_,y){if(!l(e)||e.length===0)return;let C=t.length,b=C*4,x=0,S=xt.getAttributeBySemantic(n.runtimePrimitive.primitive,at.POSITION),B=l(S.typedArray)?S.typedArray:il.readAttributeAsTypedArray(S),v=new Float32Array(b*3),P=new Float32Array(b),N=new Float32Array(b*3),L=new Float32Array(b*3),g=new Float32Array(b*3),I=new Float32Array(b*3),T=new Float32Array(b),w=l(_),R=w?new Float32Array(b):void 0,O;w&&(O=l(_.typedArray)?_.typedArray:il.readAttributeAsTypedArray(_));let G=l(u),F=G?new Float32Array(b*4):void 0,U=l(p)?p.colors:void 0,Q=l(p)?p.count:0;function H(st){if(!G)return;let ft=st*4;F[ft]=0,F[ft+1]=0,F[ft+2]=0,F[ft+3]=-1}function Y(st,ft){if(!G)return;let St=st*4,Ie=l(ft.x)?ft.x:ft[0],Se=l(ft.y)?ft.y:ft[1],Kt=l(ft.z)?ft.z:ft[2],mt=l(ft.w)?ft.w:l(ft[3])?ft[3]:1;F[St]=Ie,F[St+1]=Se,F[St+2]=Kt,F[St+3]=mt}function $(st,ft){if(!G)return;if(ft>=Q){H(st);return}let St=ft*4,Ie=st*4;F[Ie]=U[St],F[Ie+1]=U[St+1],F[Ie+2]=U[St+2],F[Ie+3]=U[St+3]}for(let st=0;st<C;st++){let ft=e[st*2],St=e[st*2+1],Ie=t[st].edgeType,Se=Ie/255,Kt=B[ft*3],mt=B[ft*3+1],Gt=B[ft*3+2],Hn=B[St*3],Je=B[St*3+1],fo=B[St*3+2],Vt=st*4;v[Vt*3]=Kt,v[Vt*3+1]=mt,v[Vt*3+2]=Gt,I[Vt*3]=Hn,I[Vt*3+1]=Je,I[Vt*3+2]=fo,T[Vt]=-1,P[Vt]=Se,v[(Vt+1)*3]=Kt,v[(Vt+1)*3+1]=mt,v[(Vt+1)*3+2]=Gt,I[(Vt+1)*3]=Hn,I[(Vt+1)*3+1]=Je,I[(Vt+1)*3+2]=fo,T[Vt+1]=1,P[Vt+1]=Se,v[(Vt+2)*3]=Hn,v[(Vt+2)*3+1]=Je,v[(Vt+2)*3+2]=fo,I[(Vt+2)*3]=Kt,I[(Vt+2)*3+1]=mt,I[(Vt+2)*3+2]=Gt,T[Vt+2]=1,P[Vt+2]=Se,v[(Vt+3)*3]=Hn,v[(Vt+3)*3+1]=Je,v[(Vt+3)*3+2]=fo,I[(Vt+3)*3]=Kt,I[(Vt+3)*3+1]=mt,I[(Vt+3)*3+2]=Gt,T[Vt+3]=-1,P[Vt+3]=Se;let Lo=t[st].color;if(l(Lo))for(let bn=0;bn<4;bn++)Y(Vt+bn,Lo);else if(l(U))for(let bn=0;bn<4;bn++)$(Vt+bn,ft);else for(let bn=0;bn<4;bn++)H(Vt+bn);if(w){let bn=O[ft],wi=O[St];R[Vt]=bn,R[Vt+1]=bn,R[Vt+2]=wi,R[Vt+3]=wi}let io=0,Qi=0,Yo=1;if(Ie===1&&l(A.silhouetteNormals)){let bn=t[st].mateVertexIndex;if(bn>=0&&bn<A.silhouetteNormals.length){let wi=A.silhouetteNormals[bn];l(wi)&&(io=wi.x,Qi=wi.y,Yo=wi.z)}}for(let bn=0;bn<4;bn++)N[(Vt+bn)*3]=io,N[(Vt+bn)*3+1]=Qi,N[(Vt+bn)*3+2]=Yo;let ai=st*6,Xn=m[ai],oo=m[ai+1],Oo=m[ai+2],yo=m[ai+3],or=m[ai+4],qo=m[ai+5];for(let bn=0;bn<4;bn++)L[(Vt+bn)*3]=Xn,L[(Vt+bn)*3+1]=oo,L[(Vt+bn)*3+2]=Oo,g[(Vt+bn)*3]=yo,g[(Vt+bn)*3+1]=or,g[(Vt+bn)*3+2]=qo}let W=tt.createVertexBuffer({context:i,typedArray:v,usage:Re.STATIC_DRAW}),K=tt.createVertexBuffer({context:i,typedArray:P,usage:Re.STATIC_DRAW}),Z=tt.createVertexBuffer({context:i,typedArray:N,usage:Re.STATIC_DRAW}),pe=tt.createVertexBuffer({context:i,typedArray:L,usage:Re.STATIC_DRAW}),ge=tt.createVertexBuffer({context:i,typedArray:g,usage:Re.STATIC_DRAW}),re=tt.createVertexBuffer({context:i,typedArray:I,usage:Re.STATIC_DRAW}),ye=tt.createVertexBuffer({context:i,typedArray:T,usage:Re.STATIC_DRAW}),Ce=G?tt.createVertexBuffer({context:i,typedArray:F,usage:Re.STATIC_DRAW}):void 0,Pe=w?tt.createVertexBuffer({context:i,typedArray:R,usage:Re.STATIC_DRAW}):void 0,Le=C*2*3,Oe=b>65534,ot=Oe?new Uint32Array(Le):new Uint16Array(Le);for(let st=0;st<C;st++){let ft=st*4,St=st*6;ot[St]=ft,ot[St+1]=ft+1,ot[St+2]=ft+2,ot[St+3]=ft,ot[St+4]=ft+2,ot[St+5]=ft+3}let Fe=tt.createIndexBuffer({context:i,typedArray:ot,usage:Re.STATIC_DRAW,indexDatatype:Oe?Ue.UNSIGNED_INT:Ue.UNSIGNED_SHORT}),_t=[{index:x,vertexBuffer:W,componentsPerAttribute:3,componentDatatype:j.FLOAT,normalize:!1},{index:o,vertexBuffer:K,componentsPerAttribute:1,componentDatatype:j.FLOAT,normalize:!1},{index:r,vertexBuffer:Z,componentsPerAttribute:3,componentDatatype:j.FLOAT,normalize:!1},{index:a,vertexBuffer:pe,componentsPerAttribute:3,componentDatatype:j.FLOAT,normalize:!1},{index:s,vertexBuffer:ge,componentsPerAttribute:3,componentDatatype:j.FLOAT,normalize:!1},{index:f,vertexBuffer:re,componentsPerAttribute:3,componentDatatype:j.FLOAT,normalize:!1},{index:h,vertexBuffer:ye,componentsPerAttribute:1,componentDatatype:j.FLOAT,normalize:!1}];G&&_t.push({index:u,vertexBuffer:Ce,componentsPerAttribute:4,componentDatatype:j.FLOAT,normalize:!1}),w&&_t.push({index:y,vertexBuffer:Pe,componentsPerAttribute:1,componentDatatype:j.FLOAT,normalize:!1});let rt=n.runtimePrimitive.primitive;if(l(rt.featureIds)&&rt.featureIds.length>0){let st=rt.featureIds[0];if(l(st.setIndex)){let ft=rt.attributes.find(St=>St.semantic===at.FEATURE_ID&&St.setIndex===st.setIndex);if(l(ft)){let St=l(ft.typedArray)?ft.typedArray:il.readAttributeAsTypedArray(ft),Ie=new Float32Array(b);for(let Kt=0;Kt<C;Kt++){let mt=e[Kt*2],Gt=mt<St.length?St[mt]:0;for(let Hn=0;Hn<4;Hn++)Ie[Kt*4+Hn]=Gt}let Se=tt.createVertexBuffer({context:i,typedArray:Ie,usage:Re.STATIC_DRAW});_t.push({index:c,vertexBuffer:Se,componentsPerAttribute:1,componentDatatype:j.FLOAT,normalize:!1})}}}return{vertexArray:new Gn({context:i,attributes:_t,indexBuffer:Fe}),indexCount:Le,hasEdgeFeatureIds:l(rt.featureIds)&&rt.featureIds.length>0}}var HL=Ehe;var WL=`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 jL=`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 NT=`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 YL={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature"};YL.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let o=e.model,r=e.runtimeNode.node,a=Fqe(o,r,t),s=a.shaderDestination;i.addDefine("HAS_SELECTED_FEATURE_ID",void 0,s),i.addDefine("SELECTED_FEATURE_ID",a.variableName,s),i.addDefine(a.featureIdDefine,void 0,s),Qqe(i);let c=a.featureIds.nullFeatureId,u=e.uniformMap;l(c)&&(i.addDefine("HAS_NULL_FEATURE_ID",void 0,s),i.addUniform("int","model_nullFeatureId",s),u.model_nullFeatureId=function(){return c}),a.shaderDestination===he.BOTH&&i.addVertexLines(NT),i.addFragmentLines(NT)};function bhe(e){return e instanceof Cn.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function Ihe(e){return e instanceof Cn.FeatureIdTexture?he.FRAGMENT:he.BOTH}function Fqe(e,t,n){let i,o;return l(t.instances)&&(o=xt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(o))?(i=o.label??o.positionalLabel,{featureIds:o,variableName:i,shaderDestination:Ihe(o),featureIdDefine:bhe(o)}):(o=xt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=o.label??o.positionalLabel,{featureIds:o,variableName:i,shaderDestination:Ihe(o),featureIdDefine:bhe(o)})}function Qqe(e){e.addStructField(YL.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(YL.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(YL.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var zy=YL;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",he.VERTEX),i.addStruct(Fs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",he.FRAGMENT),i.addStruct(zy.STRUCT_ID_SELECTED_FEATURE,zy.STRUCT_NAME_SELECTED_FEATURE,he.BOTH),i.addFunction(Fs.FUNCTION_ID_INITIALIZE_ATTRIBUTES,Fs.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,he.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,he.VERTEX),i.addFunction(Fs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,Fs.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,he.FRAGMENT),o.type===Fr.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,he.FRAGMENT);let r=n.mode!==oe.SCENE3D&&!n.scene3DOnly&&o._projectTo2D,a=l(e.runtimeNode.node.instances),s=r&&!a,c=t.attributes.length;for(let u=0;u<c;u++){let f=t.attributes[u],h=Ut.getAttributeLocationCount(f.type),p=f.semantic===at.POSITION,A;h>1?(A=e.attributeIndex,e.attributeIndex+=h):p&&!s?A=0:A=e.attributeIndex++;let m=!p&&t.primitiveType===ve.POINTS&&n.context.webgl2?"flat":void 0;kqe(e,f,A,h,r,a,m)}qqe(i,t.attributes),t.primitiveType===ve.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(jL),i.addFragmentLines(WL)};function kqe(e,t,n,i,o,r,a){let s=e.shaderBuilder,c=xt.getAttributeInfo(t),u=o&&!r;i>1?Gqe(e,t,n,i):zqe(e,t,n,u),Hqe(s,c,u),Vqe(s,c,a),l(t.semantic)&&Uqe(s,t),Wqe(s,c,o),jqe(s,c,u),Yqe(s,c)}function Uqe(e,t){let{semantic:n,setIndex:i}=t;switch(n){case at.NORMAL:e.addDefine("HAS_NORMALS");break;case at.TANGENT:e.addDefine("HAS_TANGENTS");break;case at.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case at.TEXCOORD:case at.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function zqe(e,t,n,i){let{quantization:o,semantic:r,setIndex:a}=t,{type:s,componentDatatype:c}=l(o)?o:t;r===at.FEATURE_ID&&a>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a+1);let u=r===at.POSITION,f=u?0:n,h=Ut.getNumberOfComponents(s),p={index:f,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:h,componentDatatype:c,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!u||!i)return;let A=e.runtimePrimitive.positionBuffer2D,m={index:n,vertexBuffer:A,count:t.count,componentsPerAttribute:h,componentDatatype:j.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(m)}function Gqe(e,t,n,i){let{quantization:o,normalized:r}=t,{type:a,componentDatatype:s}=l(o)?o:t,u=Ut.getNumberOfComponents(a)/i,f=j.getSizeInBytes(s),h=u*f,p=t.byteStride;for(let A=0;A<i;A++){let m=t.byteOffset+A*h,_={index:n+A,vertexBuffer:t.buffer,componentsPerAttribute:u,componentDatatype:s,offsetInBytes:m,strideInBytes:p,normalize:r};e.attributes.push(_)}}function Vqe(e,t,n){let i=t.variableName,o=`v_${i}`,r;i==="normalMC"?(o="v_normalEC",r=t.glslType):i==="tangentMC"?(r="vec3",o="v_tangentEC"):r=t.glslType,e.addVarying(r,o,n)}function Hqe(e,t,n){let i=t.attribute.semantic,o=t.variableName,r,a;t.isQuantized?(r=`a_quantized_${o}`,a=t.quantizedGlslType):(r=`a_${o}`,a=t.glslType);let s=i===at.POSITION;s?e.setPositionAttribute(a,r):e.addAttribute(a,r),s&&n&&e.addAttribute("vec3","a_position2D")}function Wqe(e,t,n){let i=Fs.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,o=Fs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,{variableName:r,glslType:a}=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,a,r),e.addStructField(o,a,r)),r==="positionMC"&&n&&e.addStructField(i,"vec3","position2D")}function jqe(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 a=[];o==="tangentMC"?(a.push("attributes.tangentMC = a_tangentMC.xyz;"),a.push("attributes.tangentSignMC = a_tangentMC.w;")):a.push(`attributes.${o} = a_${o};`),e.addFunctionLines(i,a)}function Yqe(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,a=`v_${r} = attributes.${r};`;e.addFunctionLines(o,[a]),o=Fs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,a=`attributes.${r} = v_${r};`,e.addFunctionLines(o,[a])}function qqe(e,t){let n=!1,i=!1;for(let o=0;o<t.length;o++){let r=t[o];r.semantic===at.NORMAL?n=!0:r.semantic===at.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 qL=Fs;function Gy(e){if(e=e??V.EMPTY_OBJECT,this._ellipsoid=e.ellipsoid??te.default,this._numberOfLevelZeroTilesX=e.numberOfLevelZeroTilesX??1,this._numberOfLevelZeroTilesY=e.numberOfLevelZeroTilesY??1,this._projection=new mi(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 k(-i,-i),this._rectangleNortheastInMeters=new k(i,i)}let t=this._projection.unproject(this._rectangleSouthwestInMeters),n=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new ce(t.longitude,t.latitude,n.longitude,n.latitude)}Object.defineProperties(Gy.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});Gy.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};Gy.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};Gy.prototype.rectangleToNativeRectangle=function(e,t){let n=this._projection,i=n.project(ce.southwest(e)),o=n.project(ce.northeast(e));return l(t)?(t.west=i.x,t.south=i.y,t.east=o.x,t.north=o.y,t):new ce(i.x,i.y,o.x,o.y)};Gy.prototype.tileXYToNativeRectangle=function(e,t,n,i){let o=this.getNumberOfXTilesAtLevel(n),r=this.getNumberOfYTilesAtLevel(n),a=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,s=this._rectangleSouthwestInMeters.x+e*a,c=this._rectangleSouthwestInMeters.x+(e+1)*a,u=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,f=this._rectangleNortheastInMeters.y-t*u,h=this._rectangleNortheastInMeters.y-(t+1)*u;return l(i)?(i.west=s,i.south=h,i.east=c,i.north=f,i):new ce(s,h,c,f)};Gy.prototype.tileXYToRectangle=function(e,t,n,i){let o=this.tileXYToNativeRectangle(e,t,n,i),r=this._projection,a=r.unproject(new k(o.west,o.south)),s=r.unproject(new k(o.east,o.north));return o.west=a.longitude,o.south=a.latitude,o.east=s.longitude,o.north=s.latitude,o};Gy.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!ce.contains(i,e))return;let o=this.getNumberOfXTilesAtLevel(t),r=this.getNumberOfYTilesAtLevel(t),s=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,u=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,h=this._projection.project(e),p=h.x-this._rectangleSouthwestInMeters.x,A=this._rectangleNortheastInMeters.y-h.y,m=p/s|0;m>=o&&(m=o-1);let _=A/u|0;return _>=r&&(_=r-1),l(n)?(n.x=m,n.y=_,n):new k(m,_)};var Qa=Gy;var nK,xhe="AAPTahokHpH_PEeQIduLwb1A8ZA..rA8bGH-48FscqzwJpCALUEqt2P_mHiflgl0WkBvCxPJzsFMRqAukz-mcG8oZ3eKnfk4MHGvCFMNsNrxXb2fGxfKH-3TQxCZVkCycztIPWRM5OIQ7pzTZIBOO9D7N8VXXpyPtp2bSsxWp5dUpv8qsgrfMHU4IXWGiiKWELBnANXn1QgzyLKngOHAgYWUq2OQ2XuULOpwJwOEWpyX5KvoLavJP0LFJdjB08Mmz-wCvnFqwr8CZjFpKaVSbAT1_aZs2dlMP",LT={};LT.defaultAccessToken=xhe;LT.defaultWorldImageryServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});LT.defaultWorldHillshadeServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});LT.defaultWorldOceanServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});LT.getDefaultTokenCredit=function(e){if(e===xhe){if(!l(nK)){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>';nK=new Et(t,!0)}return nK}};var yf=LT;function iK(e){e=e??V.EMPTY_OBJECT,this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=De.createIfNeeded(e.missingImageUrl),n=this;function i(r){l(r.blob)&&(n._missingImageByteLength=r.blob.size);let a=Eh(r);if(e.disableCheckIfAllPixelsAreTransparent){let s=!0,c=r.width,u=e.pixelsToCheck;for(let f=0,h=u.length;s&&f<h;++f){let p=u[f],A=p.x*4+p.y*c;a[A+3]>0&&(s=!1)}s&&(a=void 0)}n._missingImagePixels=a,n._isReady=!0}function o(){n._missingImagePixels=void 0,n._isReady=!0}t.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then(i).catch(o)}iK.prototype.isReady=function(){return this._isReady};iK.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=Eh(e),o=e.width;for(let r=0,a=t.length;r<a;++r){let s=t[r],c=s.x*4+s.y*o;for(let u=0;u<4;++u){let f=c+u;if(i[f]!==n[f])return!1}}return!0};var KL=iK;function oK(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}oK.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])};oK.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 Zh=oK;function OT(){de.throwInstantiationError()}Object.defineProperties(OT.prototype,{rectangle:{get:de.throwInstantiationError},tileWidth:{get:de.throwInstantiationError},tileHeight:{get:de.throwInstantiationError},maximumLevel:{get:de.throwInstantiationError},minimumLevel:{get:de.throwInstantiationError},tilingScheme:{get:de.throwInstantiationError},tileDiscardPolicy:{get:de.throwInstantiationError},errorEvent:{get:de.throwInstantiationError},credit:{get:de.throwInstantiationError},proxy:{get:de.throwInstantiationError},hasAlphaChannel:{get:de.throwInstantiationError}});OT.prototype.getTileCredits=function(e,t,n){de.throwInstantiationError()};OT.prototype.requestImage=function(e,t,n,i){de.throwInstantiationError()};OT.prototype.pickFeatures=function(e,t,n,i,o){de.throwInstantiationError()};var Kqe=/\.ktx2$/i;OT.loadImage=function(e,t){let n=De.createIfNeeded(t);return Kqe.test(n.url)?_u(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var Cf=OT;var Xqe={SATELLITE:1,OCEANS:2,HILLSHADE:3},$h=Object.freeze(Xqe);function The(e){this.useTiles=e.usePreCachedTilesIfAvailable??!0;let t=e.ellipsoid;this.tilingScheme=e.tilingScheme??new qi({ellipsoid:t}),this.rectangle=e.rectangle??this.tilingScheme.rectangle,this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new Et(n)),this.credit=n,this.tileCredits=void 0,this.tileDiscardPolicy=e.tileDiscardPolicy,this.tileWidth=e.tileWidth??256,this.tileHeight=e.tileHeight??256,this.maximumLevel=e.maximumLevel}The.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 KL({missingImageUrl:She(e,0,0,this.maximumLevel).url,pixelsToCheck:[new k(0,0),new k(200,20),new k(20,200),new k(80,110),new k(160,130)],disableCheckIfAllPixelsAreTransparent:!0}))};function Jqe(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 Qa({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new qi({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 mi,o=e.fullExtent,r=i.unproject(new d(Math.max(o.xmin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(o.ymin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),a=i.unproject(new d(Math.min(o.xmax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(o.ymax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0));t.rectangle=new ce(r.longitude,r.latitude,a.longitude,a.latitude)}else if(e.fullExtent.spatialReference.wkid===4326)t.rectangle=ce.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 Et(e.copyrightText)]:t.credit=new Et(e.copyrightText))}function Zqe(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 $qe(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();Jqe(i,t)}catch(i){Zqe(e,i)}}function bp(e){e=e??V.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=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._maximumLevel=e.maximumLevel,this._tilingScheme=e.tilingScheme??new qi({ellipsoid:e.ellipsoid}),this._useTiles=e.usePreCachedTilesIfAvailable??!0,this._rectangle=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 Et(t)),this.enablePickFeatures=e.enablePickFeatures??!0,this._errorEvent=new _e}bp.fromBasemapType=async function(e,t){t=t??V.EMPTY_OBJECT;let n,i,o;switch(e){case $h.SATELLITE:{n=t.token??yf.defaultAccessToken,i=De.createIfNeeded(yf.defaultWorldImageryServer),i.appendForwardSlash();let r=yf.getDefaultTokenCredit(n);l(r)&&(o=Et.clone(r))}break;case $h.OCEANS:{n=t.token??yf.defaultAccessToken,i=De.createIfNeeded(yf.defaultWorldOceanServer),i.appendForwardSlash();let r=yf.getDefaultTokenCredit(n);l(r)&&(o=Et.clone(r))}break;case $h.HILLSHADE:{n=t.token??yf.defaultAccessToken,i=De.createIfNeeded(yf.defaultWorldHillshadeServer),i.appendForwardSlash();let r=yf.getDefaultTokenCredit(n);l(r)&&(o=Et.clone(r))}break;default:}return bp.fromUrl(i,{...t,token:n,credit:o,usePreCachedTilesIfAvailable:!0})};function She(e,t,n,i,o){let r;if(e._useTiles)r=e._resource.getDerivedResource({url:`tile/${i}/${n}/${t}`,request:o});else{let a=e._tilingScheme.tileXYToNativeRectangle(t,n,i),c={bbox:`${a.west},${a.south},${a.east},${a.north}`,size:`${e._tileWidth},${e._tileHeight}`,format:"png32",transparent:!0,f:"image"};e._tilingScheme.projection instanceof Wi?(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(bp.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}}});bp.fromUrl=async function(e,t){t=t??V.EMPTY_OBJECT;let n=De.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&n.setQueryParameters({token:t.token});let i=new bp(t);i._resource=n;let o=new The(t);return(t.usePreCachedTilesIfAvailable??!0)&&await $qe(n,o),o.build(i),i};bp.prototype.getTileCredits=function(e,t,n){return this._tileCredits};bp.prototype.requestImage=function(e,t,n,i){return Cf.loadImage(this,She(this,e,t,n,i))};bp.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures)return;let r=this._tilingScheme.tileXYToNativeRectangle(e,t,n),a,s,c;if(this._tilingScheme.projection instanceof Wi)a=D.toDegrees(i),s=D.toDegrees(o),c="4326";else{let p=this._tilingScheme.projection.project(new me(i,o,0));a=p.x,s=p.y,c="3857"}let u="visible";l(this._layers)&&(u+=`:${this._layers}`);let f={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${a},${s}`,mapExtent:`${r.west},${r.south},${r.east},${r.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:c,layers:u};return this._resource.getDerivedResource({url:"identify",queryParameters:f}).fetchJson().then(function(p){let A=[],m=p.results;if(!l(m))return A;for(let _=0;_<m.length;++_){let y=m[_],C=new Zh;if(C.data=y,C.name=y.value,C.properties=y.attributes,C.configureDescriptionFromProperties(y.attributes),y.geometryType==="esriGeometryPoint"&&y.geometry){let E=y.geometry.spatialReference&&y.geometry.spatialReference.wkid?y.geometry.spatialReference.wkid:4326;if(E===4326||E===4283)C.position=me.fromDegrees(y.geometry.x,y.geometry.y,y.geometry.z);else if(E===102100||E===900913||E===3857){let b=new mi;C.position=b.unproject(new d(y.geometry.x,y.geometry.y,y.geometry.z))}}A.push(C)}return A})};bp._metadataCache={};var Cg=bp;function eKe(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 Ip=eKe;function h8(e,t,n,i,o,r,a){this.provider=e,this.message=t,this.x=n,this.y=i,this.level=o,this.timesRetried=r??0,this.retry=!1,this.error=a}h8.reportError=function(e,t,n,i,o,r,a,s){let c=e;return l(e)?(c.provider=t,c.message=i,c.x=o,c.y=r,c.level=a,c.retry=!1,c.error=s,++c.timesRetried):c=new h8(t,i,o,r,a,0,s),l(n)&&n.numberOfListeners>0?n.raiseEvent(c):l(t)&&console.log(`An error occurred in "${t.constructor.name}": ${Ip(i)}`),c};h8.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var $o=h8;var tKe={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"},FT=Object.freeze(tKe);function XL(e){}XL.prototype.isReady=function(){return!0};XL.prototype.shouldDiscardImage=function(e){return XL.EMPTY_IMAGE===e};var m8;Object.defineProperties(XL,{EMPTY_IMAGE:{get:function(){return l(m8)||(m8=new Image,m8.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),m8}}});var QT=XL;function whe(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}whe.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 Et)break;o.credit=new Et(o.attribution);let r=o.coverageAreas;for(let a=0,s=o.coverageAreas.length;a<s;++a){let c=r[a],u=c.bbox;c.bbox=new ce(D.toRadians(u[1]),D.toRadians(u[0]),D.toRadians(u[3]),D.toRadians(u[2]))}}};function nKe(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 iKe(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),$o.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new ue(i)}async function oKe(e,t,n){let i=e.url,o=hs._metadataCache[i];l(o)||(o=e.fetchJson(),hs._metadataCache[i]=o);try{let r=await o;return nKe(r,t)}catch(r){iKe(e,r,n)}}function hs(e){e=e??V.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=e.mapStyle??FT.AERIAL,this._mapLayer=e.mapLayer,this._culture=e.culture??"",this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new QT),this._proxy=e.proxy,this._credit=new Et(`<a href="https://www.microsoft.com/en-us/maps/bing-maps/product"><img src="${hs.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new Qa({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 _e}Object.defineProperties(hs.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)}}});hs.fromUrl=async function(e,t){t=t??V.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=t.mapStyle??FT.AERIAL,o=De.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 a=o.getDerivedResource({url:`REST/v1/Imagery/Metadata/${i}`,queryParameters:r}),s=new hs(t);s._resource=o;let c=new whe(t);return await oKe(a,c),c.build(s),s};var rKe=new ce;hs.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,rKe);return cKe(this._attributionList,n,i)};hs.prototype.requestImage=function(e,t,n,i){let o=Cf.loadImage(this,aKe(this,e,t,n,i));if(l(o))return o.catch(function(r){return l(r.blob)&&r.blob.size===0?QT.EMPTY_IMAGE:Promise.reject(r)})};hs.prototype.pickFeatures=function(e,t,n,i,o){};hs.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,a=0;(e&r)!==0&&(a|=1),(t&r)!==0&&(a|=2),i+=a}return i};hs.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let o=i;o>=0;--o){let r=1<<o,a=+e[i-o];(a&1)!==0&&(t|=r),(a&2)!==0&&(n|=r)}return{x:t,y:n,level:i}};hs._logoUrl=void 0;Object.defineProperties(hs,{logoUrl:{get:function(){return l(hs._logoUrl)||(hs._logoUrl=Zt("Assets/Images/bing_maps_credit.png")),hs._logoUrl},set:function(e){hs._logoUrl=e}}});function aKe(e,t,n,i,o){let r=e._imageUrlTemplate,a=e._imageUrlSubdomains,s=(t+n+i)%a.length;return e._resource.getDerivedResource({url:r,request:o,templateValues:{quadkey:hs.tileXYToQuadKey(t,n,i),subdomain:a[s],culture:e._culture},queryParameters:{n:"z"}})}var sKe=new ce;function cKe(e,t,n){++t;let i=[];for(let o=0,r=e.length;o<r;++o){let a=e[o],s=a.coverageAreas,c=!1;for(let u=0,f=a.coverageAreas.length;!c&&u<f;++u){let h=s[u];if(t>=h.zoomMin&&t<=h.zoomMax){let p=ce.intersection(n,h.bbox,sKe);l(p)&&(c=!0)}}c&&i.push(a.credit)}return i}hs._metadataCache={};var JL=hs;var Bhe=/{[^}]+}/g,Dhe={x:dKe,y:mKe,z:gKe,s:_Ke,reverseX:hKe,reverseY:pKe,reverseZ:AKe,westDegrees:yKe,southDegrees:CKe,eastDegrees:EKe,northDegrees:bKe,westProjected:IKe,southProjected:xKe,eastProjected:TKe,northProjected:SKe,width:wKe,height:BKe},lKe=Pt(Dhe,{i:DKe,j:vKe,reverseI:PKe,reverseJ:RKe,longitudeDegrees:NKe,latitudeDegrees:LKe,longitudeProjected:OKe,latitudeProjected:FKe,format:kKe});function ZL(e){e=e??V.EMPTY_OBJECT,this._errorEvent=new _e;let t=De.createIfNeeded(e.url),n=De.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=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._minimumLevel=e.minimumLevel??0,this._maximumLevel=e.maximumLevel,this._tilingScheme=e.tilingScheme??new Qa({ellipsoid:e.ellipsoid}),this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._rectangle=ce.intersection(this._rectangle,this._tilingScheme.rectangle),this._tileDiscardPolicy=e.tileDiscardPolicy;let o=e.credit;typeof o=="string"&&(o=new Et(o)),this._credit=o,this._hasAlphaChannel=e.hasAlphaChannel??!0;let r=e.customTags,a=Pt(Dhe,r),s=Pt(lKe,r);this._tags=a,this._pickFeaturesTags=s,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=e.enablePickFeatures??!0}Object.defineProperties(ZL.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}}});ZL.prototype.getTileCredits=function(e,t,n){};ZL.prototype.requestImage=function(e,t,n,i){return Cf.loadImage(this,uKe(this,e,t,n,i))};ZL.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures||!l(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let r=0,a=this;function s(u,f){return u.callback(f)}function c(){if(r>=a._getFeatureInfoFormats.length)return Promise.resolve([]);let u=a._getFeatureInfoFormats[r],f=fKe(a,e,t,n,i,o,u.format);return++r,u.type==="json"?f.fetchJson().then(u.callback).catch(c):u.type==="xml"?f.fetchXML().then(u.callback).catch(c):u.type==="text"||u.type==="html"?f.fetchText().then(u.callback).catch(c):f.fetch({responseType:u.format}).then(s.bind(void 0,u)).catch(c)}return c()};var p8=!1,Ef=new ce,A8=!1,$L=new ce;function uKe(e,t,n,i,o){p8=!1,A8=!1;let r=e._resource,a=r.getUrlComponent(!0),s=e._tags,c={},u=a.match(Bhe);return l(u)&&u.forEach(function(f){let h=f.substring(1,f.length-1);l(s[h])&&(c[h]=s[h](e,t,n,i))}),r.getDerivedResource({request:o,templateValues:c})}var rK=!1,UT=new k,aK=!1;function fKe(e,t,n,i,o,r,a){p8=!1,A8=!1,rK=!1,aK=!1;let s=e._pickFeaturesResource,c=s.getUrlComponent(!0),u=e._pickFeaturesTags,f={},h=c.match(Bhe);return l(h)&&h.forEach(function(p){let A=p.substring(1,p.length-1);l(u[A])&&(f[A]=u[A](e,t,n,i,o,r,a))}),s.getDerivedResource({templateValues:f})}function zT(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 dKe(e,t,n,i){return zT(e,"{x}",t)}function hKe(e,t,n,i){let o=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return zT(e,"{reverseX}",o)}function mKe(e,t,n,i){return zT(e,"{y}",n)}function pKe(e,t,n,i){let o=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return zT(e,"{reverseY}",o)}function AKe(e,t,n,i){let o=e.maximumLevel,r=l(o)&&i<o?o-i-1:i;return zT(e,"{reverseZ}",r)}function gKe(e,t,n,i){return zT(e,"{z}",i)}function _Ke(e,t,n,i){let o=(t+n+i)%e._subdomains.length;return e._subdomains[o]}function g8(e,t,n,i){p8||(e.tilingScheme.tileXYToRectangle(t,n,i,Ef),Ef.west=D.toDegrees(Ef.west),Ef.south=D.toDegrees(Ef.south),Ef.east=D.toDegrees(Ef.east),Ef.north=D.toDegrees(Ef.north),p8=!0)}function yKe(e,t,n,i){return g8(e,t,n,i),Ef.west}function CKe(e,t,n,i){return g8(e,t,n,i),Ef.south}function EKe(e,t,n,i){return g8(e,t,n,i),Ef.east}function bKe(e,t,n,i){return g8(e,t,n,i),Ef.north}function _8(e,t,n,i){A8||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,$L),A8=!0)}function IKe(e,t,n,i){return _8(e,t,n,i),$L.west}function xKe(e,t,n,i){return _8(e,t,n,i),$L.south}function TKe(e,t,n,i){return _8(e,t,n,i),$L.east}function SKe(e,t,n,i){return _8(e,t,n,i),$L.north}function wKe(e,t,n,i){return e.tileWidth}function BKe(e,t,n,i){return e.tileHeight}function DKe(e,t,n,i,o,r,a){return y8(e,t,n,i,o,r),UT.x}function vKe(e,t,n,i,o,r,a){return y8(e,t,n,i,o,r),UT.y}function PKe(e,t,n,i,o,r,a){return y8(e,t,n,i,o,r),e.tileWidth-UT.x-1}function RKe(e,t,n,i,o,r,a){return y8(e,t,n,i,o,r),e.tileHeight-UT.y-1}var MKe=new ce,kT=new d;function y8(e,t,n,i,o,r,a){if(rK)return;sK(e,t,n,i,o,r);let s=kT,c=e.tilingScheme.tileXYToNativeRectangle(t,n,i,MKe);UT.x=e.tileWidth*(s.x-c.west)/c.width|0,UT.y=e.tileHeight*(c.north-s.y)/c.height|0,rK=!0}function NKe(e,t,n,i,o,r,a){return D.toDegrees(o)}function LKe(e,t,n,i,o,r,a){return D.toDegrees(r)}function OKe(e,t,n,i,o,r,a){return sK(e,t,n,i,o,r),kT.x}function FKe(e,t,n,i,o,r,a){return sK(e,t,n,i,o,r),kT.y}var QKe=new me;function sK(e,t,n,i,o,r,a){if(!aK){if(e.tilingScheme.projection instanceof Wi)kT.x=D.toDegrees(o),kT.y=D.toDegrees(r);else{let s=QKe;s.longitude=o,s.latitude=r,e.tilingScheme.projection.project(s,kT)}aK=!0}}function kKe(e,t,n,i,o,r,a){return a}var Aa=ZL;function Pd(e){Aa.call(this,e)}Pd._requestMetadata=async function(e,t,n,i){try{let o=await n.fetchXML();return Pd._metadataSuccess(o,e,t,n,i)}catch(o){if(o instanceof ep)return Pd._metadataFailure(e,t);throw o}};Pd.fromUrl=async function(e,t){let n=De.createIfNeeded(e);n.appendForwardSlash();let i=n,o=n.getDerivedResource({url:"tilemapresource.xml"});t=t??V.EMPTY_OBJECT;let r=await Pd._requestMetadata(t,i,o);return new Pd(r)};l(Object.create)&&(Pd.prototype=Object.create(Aa.prototype),Pd.prototype.constructor=Pd);function vhe(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 Phe(e,t,n){let i=e.positionToTileXY(ce.southwest(t),n),o=e.positionToTileXY(ce.northeast(t),n);return(Math.abs(o.x-i.x)+1)*(Math.abs(o.y-i.y)+1)>4?0:n}Pd._metadataSuccess=function(e,t,n,i,o){let r=/tileformat/i,a=/tileset/i,s=/tilesets/i,c=/boundingbox/i,u,f,h,p=[],A=e.childNodes[0].childNodes;for(let P=0;P<A.length;P++)if(r.test(A.item(P).nodeName))u=A.item(P);else if(s.test(A.item(P).nodeName)){h=A.item(P);let N=A.item(P).childNodes;for(let L=0;L<N.length;L++)a.test(N.item(L).nodeName)&&p.push(N.item(L))}else c.test(A.item(P).nodeName)&&(f=A.item(P));let m;if(!l(h)||!l(f))throw m=`Unable to find expected tilesets or bbox attributes in ${i.url}.`,l(o)&&$o.reportError(void 0,o,o.errorEvent,m),new ue(m);let _=t.fileExtension??u.getAttribute("extension"),y=t.tileWidth??parseInt(u.getAttribute("width"),10),C=t.tileHeight??parseInt(u.getAttribute("height"),10),E=t.minimumLevel??parseInt(p[0].getAttribute("order"),10),b=t.maximumLevel??parseInt(p[p.length-1].getAttribute("order"),10),x=h.getAttribute("profile"),S=t.tilingScheme;if(!l(S))if(x==="geodetic"||x==="global-geodetic")S=new qi({ellipsoid:t.ellipsoid});else if(x==="mercator"||x==="global-mercator")S=new Qa({ellipsoid:t.ellipsoid});else throw m=`${i.url} specifies an unsupported profile attribute, ${x}.`,l(o)&&$o.reportError(void 0,o,o.errorEvent,m),new ue(m);let B=ce.clone(t.rectangle);if(!l(B)){let P,N,L,g;t.flipXY??!1?(L=new k(parseFloat(f.getAttribute("miny")),parseFloat(f.getAttribute("minx"))),g=new k(parseFloat(f.getAttribute("maxy")),parseFloat(f.getAttribute("maxx")))):(L=new k(parseFloat(f.getAttribute("minx")),parseFloat(f.getAttribute("miny"))),g=new k(parseFloat(f.getAttribute("maxx")),parseFloat(f.getAttribute("maxy"))));let T=x==="geodetic"||x==="mercator";if(S.projection instanceof Wi||T)P=me.fromDegrees(L.x,L.y),N=me.fromDegrees(g.x,g.y);else{let w=S.projection;P=w.unproject(L),N=w.unproject(g)}B=new ce(P.longitude,P.latitude,N.longitude,N.latitude)}return B=vhe(B,S),E=Phe(S,B,E),{url:n.getDerivedResource({url:`{z}/{x}/{reverseY}.${_}`}),tilingScheme:S,rectangle:B,tileWidth:y,tileHeight:C,minimumLevel:E,maximumLevel:b,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit}};Pd._metadataFailure=function(e,t){let n=e.fileExtension??"png",i=e.tileWidth??256,o=e.tileHeight??256,r=e.maximumLevel,a=l(e.tilingScheme)?e.tilingScheme:new Qa({ellipsoid:e.ellipsoid}),s=e.rectangle??a.rectangle;s=vhe(s,a);let c=Phe(a,s,e.minimumLevel);return{url:t.getDerivedResource({url:`{z}/{x}/{reverseY}.${n}`}),tilingScheme:a,rectangle:s,tileWidth:i,tileHeight:o,minimumLevel:c,maximumLevel:r,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit}};var Vy=Pd;function Rhe(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}Rhe.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function UKe(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 qi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:t.ellipsoid});else if(!l(n.projection)||n.projection==="mercator")t.tilingScheme=new Qa({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let o=`Unsupported projection ${n.projection}.`;throw new ue(o)}return!0}function zKe(e,t,n){let i=`An error occurred while accessing ${t.url}.`;throw l(e)&&l(e.message)&&(i+=`: ${e.message}`),$o.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new ue(i)}async function GKe(e,t,n){try{let i=await e.fetchText();UKe(i,t)}catch(i){zKe(i,e,n)}}function Ru(e){e=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 Et(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${Ru.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 _e}Object.defineProperties(Ru.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}}});Ru.fromUrl=async function(e,t,n){n=n??{};let i=n.path??"/default_map",o=De.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"}}),a=new Rhe(n);a.channel=t,await GKe(r,a);let s=new Ru(n);return a.build(s),s._resource=o,s._url=e,s._path=i,s};Ru.prototype.getTileCredits=function(e,t,n){};Ru.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 Cf.loadImage(this,o)};Ru.prototype.pickFeatures=function(e,t,n,i,o){};Ru._logoUrl=void 0;Object.defineProperties(Ru,{logoUrl:{get:function(){return l(Ru._logoUrl)||(Ru._logoUrl=Zt("Assets/Images/google_earth_credit.png")),Ru._logoUrl},set:function(e){Ru._logoUrl=e}}});var eO=Ru;var VKe=/\/$/,Mhe=new Et('&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 GT(e){e=e??V.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=De.createIfNeeded(e.url??"https://{s}.tiles.mapbox.com/v4/");this._mapId=t,this._accessToken=n;let o=e.format??"png";/\./.test(o)||(o=`.${o}`),this._format=o;let r=i.getUrlComponent();VKe.test(r)||(r+="/"),r+=`${t}/{z}/{x}/{y}${this._format}`,i.url=r,i.setQueryParameters({access_token:n});let a;l(e.credit)?(a=e.credit,typeof a=="string"&&(a=new Et(a))):a=Mhe,this._resource=i,this._imageryProvider=new Aa({url:i,credit:a,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(GT.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}}});GT.prototype.getTileCredits=function(e,t,n){};GT.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};GT.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};GT._defaultCredit=Mhe;var tO=GT;function R0(e){e=e??V.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=e.rectangle??ce.MAX_VALUE,n=new qi({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 _e;let i=e.credit;typeof i=="string"&&(i=new Et(i)),this._credit=i;let o=De.createIfNeeded(e.url);this._resource=o,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight}Object.defineProperties(R0.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 HKe(e,t,n,i){let o=`Failed to load image ${e.url}`;l(t)&&l(t.message)&&(o+=`: ${t.message}`);let r=$o.reportError(i,n,l(n)?n._errorEvent:void 0,o,0,0,0,t);if(r.retry)return cK(e,n,r);throw l(n)&&(n._hasError=!0),new ue(o)}async function cK(e,t,n){try{return await Cf.loadImage(null,e)}catch(i){return HKe(e,i,t,n)}}R0.fromUrl=async function(e,t){let n=De.createIfNeeded(e),i=await cK(n);t=t??V.EMPTY_OBJECT;let o=new R0({...t,url:e,tileWidth:i.width,tileHeight:i.height});return o._image=i,o};R0.prototype.getTileCredits=function(e,t,n){};R0.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let o=await cK(this._resource,this);return this._image=o,$o.reportSuccess(this._errorEvent),o}return this._image};R0.prototype.pickFeatures=function(e,t,n,i,o){};var nO=R0;function WKe(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=jKe:e==="xml"?n=XKe:(e==="html"||e==="text")&&(n=Nhe)),this.callback=n}function jKe(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let o=n[i],r=new Zh;if(r.data=o,r.properties=o.properties,r.configureNameFromProperties(o.properties),r.configureDescriptionFromProperties(o.properties),l(o.geometry)&&o.geometry.type==="Point"){let a=o.geometry.coordinates[0],s=o.geometry.coordinates[1];r.position=me.fromDegrees(a,s)}t.push(r)}return t}var lK="http://www.mapinfo.com/mxp",YKe="http://www.esri.com/wms",qKe="http://www.opengis.net/wfs",KKe="http://www.opengis.net/gml";function XKe(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===lK)return JKe(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===YKe)return ZKe(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===qKe)return $Ke(e);if(t.localName==="ServiceExceptionReport")throw new ue(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?eXe(e):tXe(e)}function JKe(e){let t=[],i=e.documentElement.getElementsByTagNameNS(lK,"Feature");for(let o=0;o<i.length;++o){let r=i[o],a={},s=r.getElementsByTagNameNS(lK,"Val");for(let u=0;u<s.length;++u){let f=s[u];if(f.hasAttribute("ref")){let h=f.getAttribute("ref"),p=f.textContent.trim();a[h]=p}}let c=new Zh;c.data=r,c.properties=a,c.configureNameFromProperties(a),c.configureDescriptionFromProperties(a),t.push(c)}return t}function ZKe(e){let t=e.documentElement,n=[],i,o=t.getElementsByTagNameNS("*","FIELDS");if(o.length>0)for(let r=0;r<o.length;++r){let a=o[r];i={};let s=a.attributes;for(let c=0;c<s.length;++c){let u=s[c];i[u.name]=u.value}n.push(C8(a,i))}else{let r=t.getElementsByTagNameNS("*","FeatureInfo");for(let a=0;a<r.length;++a){let s=r[a];i={};let c=s.childNodes;for(let u=0;u<c.length;++u){let f=c[u];f.nodeType===Node.ELEMENT_NODE&&(i[f.localName]=f.textContent)}n.push(C8(s,i))}}return n}function $Ke(e){let t=[],i=e.documentElement.getElementsByTagNameNS(KKe,"featureMember");for(let o=0;o<i.length;++o){let r=i[o],a={};uK(r,a),t.push(C8(r,a))}return t}function eXe(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 a=o[r];if(a.nodeType===Node.ELEMENT_NODE){let s={};uK(a,s),t.push(C8(a,s))}}return t}function uK(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()&&uK(o,t)&&(t[o.localName]=o.textContent)}return n}function C8(e,t){let n=new Zh;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function tXe(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let o=new Zh;return o.data=e,o.description=n.innerHTML,[o]}var nXe=/<body>\s*<\/body>/im,iXe=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,oXe=/<title>([\s\S]*)<\/title>/im;function Nhe(e){if(nXe.test(e)||iXe.test(e))return;let t,n=oXe.exec(e);n&&n.length>1&&(t=n[1]);let i=new Zh;return i.name=t,i.description=e,i.data=e,[i]}var em=WKe;function iO(e){e=e??V.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(iO.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)}}});iO.prototype.getFromCache=function(e,t,n,i){let o=Lhe(e,t,n),r,a=this._tileCache[this._currentIntervalIndex];if(l(a)&&l(a[o])){let s=a[o];r=s.promise.catch(function(c){throw i.state=s.request.state,c}),delete a[o]}return r};iO.prototype.checkApproachingInterval=function(e,t,n,i){let o=Lhe(e,t,n),r=this._tilesRequestedForInterval,a=Ohe(this),s={key:o,priorityFunction:i.priorityFunction};(!l(a)||!Fhe(this,s,a))&&r.push(s),r.length>=512&&r.splice(0,256)};iO.prototype._clockOnTick=function(e){let t=e.currentTime,i=this._times.indexOf(t),o=this._currentIntervalIndex;if(i!==o){let a=this._tileCache[o];for(let s in a)a.hasOwnProperty(s)&&a[s].request.cancel();delete this._tileCache[o],this._tilesRequestedForInterval=[],this._currentIntervalIndex=i,this._reloadFunction();return}let r=Ohe(this);if(l(r)){let a=this._tilesRequestedForInterval,s=!0;for(;s&&a.length!==0;){let c=a.pop();s=Fhe(this,c,r),s||a.push(c)}}};function Lhe(e,t,n){return`${e}-${t}-${n}`}function rXe(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function Ohe(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 a,s=t.indexOf(i);if(s<0)return;let c=t.get(s);return r>0?(a=X.secondsDifference(c.stop,i),++s):(a=X.secondsDifference(c.start,i),--s),a/=r,s>=0&&a<=5?t.get(s):void 0}function Fhe(e,t,n){let i=e._times.indexOf(n.start),o=e._tileCache,r=o[i];l(r)||(r=o[i]={});let a=t.key;if(l(r[a]))return!0;let s=rXe(a),c=new Ir({throttle:!1,throttleByServer:!0,type:ja.IMAGERY,priorityFunction:t.priorityFunction}),u=e._requestImageFunction(s.x,s.y,s.level,c,n);return l(u)?(r[a]={promise:u,request:c},!0):!1}var M0=iO;var aXe=[3034,3035,3042,3043,3044],sXe=[4471,4559];function tm(e){if(e=e??V.EMPTY_OBJECT,l(e.times)&&!l(e.clock))throw new de("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=e.getFeatureInfoUrl??e.url;let t=De.createIfNeeded(e.url),n=De.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(tm.DefaultParameters,!0),n.setQueryParameters(tm.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(Qhe(e.parameters,e.toLowerCase)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(Qhe(e.getFeatureInfoParameters,e.toLowerCase));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new M0({clock:e.clock,times:e.times,requestImageFunction:function(a,s,c,u,f){return khe(i,a,s,c,u,f)},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=e.crs??(e.tilingScheme&&e.tilingScheme.projection instanceof mi?"EPSG:3857":"CRS:84");let a=o.crs.split(":");if(a[0]==="EPSG"&&a.length===2){let s=Number(a[1]);(s>=4e3&&s<5e3&&!sXe.includes(s)||aXe.includes(s))&&(o.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else o.srs=e.srs??(e.tilingScheme&&e.tilingScheme.projection instanceof mi?"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 Aa({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new qi({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:e.getFeatureInfoFormats??tm.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures})}function khe(e,t,n,i,o,r){let a=l(r)?r.data:void 0,s=e._tileProvider;return l(a)&&s._resource.setQueryParameters(a),s.requestImage(t,n,i,o)}function cXe(e,t,n,i,o,r,a){let s=l(a)?a.data:void 0,c=e._tileProvider;return l(s)&&c._pickFeaturesResource.setQueryParameters(s),c.pickFeatures(t,n,i,o,r)}Object.defineProperties(tm.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}}});tm.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};tm.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,a;return l(r)&&(a=r.currentInterval,o=r.getFromCache(e,t,n,i)),l(o)||(o=khe(this,e,t,n,i,a)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};tm.prototype.pickFeatures=function(e,t,n,i,o){let r=this._timeDynamicImagery,a=l(r)?r.currentInterval:void 0;return cXe(this,e,t,n,i,o,a)};tm.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});tm.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});tm.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new em("json","application/json")),Object.freeze(new em("xml","text/xml")),Object.freeze(new em("text","text/html"))]);function Qhe(e,t=!0){if(t){let n={};for(let i in e)e.hasOwnProperty(i)&&(n[i.toLowerCase()]=e[i]);return n}return e}var oO=tm;function bf(e){e=e??V.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._getFeatureInfoUrl=e.getFeatureInfoUrl??e.url;let t=De.createIfNeeded(e.url),n=De.createIfNeeded(this._getFeatureInfoUrl),i=e.style,o=e.tileMatrixSetID,r=t.url,a=e.format??"image/jpeg",s=r.match(/{/g);if(!l(s)||s.length===1&&/{s}/.test(r)?(t.setQueryParameters(bf.DefaultParameters,!0),this._useKvp=!0):(t.setTemplateValues(bf.DefaultParameters,!0),this._useKvp=!1),this._useKvp){n.setQueryParameters(bf.GetFeatureInfoDefaultParameters,!0),l(e.getFeatureInfoParameters)&&n.setQueryParameters(Uhe(e.getFeatureInfoParameters));let f={infoformat:"{format}",i:"{i}",j:"{j}"};n.setQueryParameters(f,!0)}else n.setTemplateValues(bf.GetFeatureInfoDefaultParameters,!0),l(e.getFeatureInfoParameters)&&n.setTemplateValues(Uhe(e.getFeatureInfoParameters));this._resource=t,this._tileMatrixLabels=e.tileMatrixLabels,this._format=a,this._dimensions=e.dimensions,this._tilematrixset=o;let c={};c.tilematrix="{TileMatrix}",c.layer=e.layer,c.style=i,c.tilerow="{TileRow}",c.tilecol="{TileCol}",c.tilematrixset=o,this._useKvp?(t.setQueryParameters(c,!0),t.setQueryParameters({format:a},!0),n.setQueryParameters({format:a},!0),n.setQueryParameters(c,!0)):(c.Style=i,t.setTemplateValues(c),t.setTemplateValues({format:a}),n.setTemplateValues(c));let u=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new M0({clock:e.clock,times:e.times,requestImageFunction:function(f,h,p,A,m){return zhe(u,f,h,p,A,m)},reloadFunction:function(){l(u._reload)&&u._reload()}})),this._errorEvent=new _e,this._tileProvider=new Aa({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new Qa({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:e.getFeatureInfoFormats??bf.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures??(this._useKvp||l(e.getFeatureInfoUrl)),customTags:uXe(this)})}function zhe(e,t,n,i,o,r){let a=e._tileProvider;return Ghe(e,a._resource,r),a.requestImage(t,n,i,o)}function lXe(e,t,n,i,o,r,a){let s=e._tileProvider;return Ghe(e,s._pickFeaturesResource,a),s.pickFeatures(t,n,i,o,r)}Object.defineProperties(bf.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},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}},format:{get:function(){return this._format}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return!0}},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}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,l(this._reload)&&this._reload())}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}}});bf.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};bf.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,a;return l(r)&&(a=r.currentInterval,o=r.getFromCache(e,t,n,i)),l(o)||(o=zhe(this,e,t,n,i,a)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};bf.prototype.pickFeatures=function(e,t,n,i,o){let r=this._timeDynamicImagery,a=l(r)?r.currentInterval:void 0;return lXe(this,e,t,n,i,o,a)};bf.DefaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});bf.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetFeatureInfo"});bf.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new em("json","application/json")),Object.freeze(new em("xml","text/xml")),Object.freeze(new em("text","text/html"))]);function Ghe(e,t,n){let i=e._dimensions,o=l(n)?n.data:void 0;if(!e._useKvp)l(i)&&t.setTemplateValues(i),l(o)&&t.setTemplateValues(o);else{let r={};l(i)&&(r=Pt(r,i)),l(o)&&(r=Pt(r,o)),t.setQueryParameters(r)}}function uXe(e){function t(n){let i=e._tileMatrixLabels;return l(i)?i[n]:n.toString()}return{TileMatrix:function(n,i,o,r){return t(r)},tilematrix:function(n,i,o,r){return t(r)},TileRow:function(n,i,o){return o.toString()},tilerow:function(n,i,o){return o.toString()},TileCol:function(n,i,o){return i.toString()},tilecol:function(n,i,o){return i.toString()},TileMatrixSet:function(n){return e._tilematrixset},tilematrixset:function(n){return e._tilematrixset}}}function Uhe(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var rO=bf;var VT={};VT.defaultApiKey=void 0;VT.mapTilesApiEndpoint=new De({url:"https://tile.googleapis.com/"});VT.defaultStreetViewStaticApiKey=void 0;VT.streetViewStaticApiEndpoint=new De({url:"https://maps.googleapis.com/maps/api/streetview"});VT.getDefaultCredit=function(){return new Et('<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-6px">',!0)};var ms=VT;var Vhe=/\/$/;function Eg(e){e=e??V.EMPTY_OBJECT,this._maximumLevel=e.maximumLevel??22,this._minimumLevel=e.minimumLevel??0,this._session=e.session,this._key=e.key,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight;let t=e.url instanceof fa?e.url:De.createIfNeeded(e.url??ms.mapTilesApiEndpoint),n=t.getUrlComponent();Vhe.test(n)||(n+="/");let i=`${n}v1/2dtiles/{z}/{x}/{y}`;this._viewportUrl=`${n}tile/v1/viewport`,t.url=i,t.setQueryParameters({session:encodeURIComponent(e.session),key:encodeURIComponent(e.key)}),this._resource=t.clone();let o;l(e.credit)&&(o=e.credit,typeof o=="string"&&(o=new Et(o)));let r=new Aa({url:t,credit:o,tileWidth:e.tileWidth,tileHeight:e.tileHeight,ellipsoid:e.ellipsoid,rectangle:e.rectangle,maximumLevel:this._maximumLevel,minimumLevel:this._minimumLevel});r._resource=t,this._imageryProvider=r,this._tileCredits=t.credits,this._attributionsByLevel=void 0}Object.defineProperties(Eg.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}}});Eg.fromIonAssetId=async function(e){e=e??{},e.mapType=e.mapType??"satellite",e.language=e.language??"en_US",e.region=e.region??"US";let t=e.overlayLayerType,n=Hhe(e),i=fa._createEndpointResource(e.assetId,{queryParameters:{options:JSON.stringify(n)}}),o={language:e.language,region:e.region,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle,credit:e.credit},r=await i.fetchJson(),a=r.options.url;return delete r.options.url,r.options={...r.options,...o},fK(a,r,i)};Eg.fromUrl=async function(e){e=e??{},e.mapType=e.mapType??"satellite",e.language=e.language??"en_US",e.region=e.region??"US",e.url=e.url??ms.mapTilesApiEndpoint,e.key=e.key??ms.defaultApiKey;let t=e.overlayLayerType,n=await dXe(e);return new Eg({...n,...e,credit:e.credit??ms.getDefaultCredit()})};Eg.prototype.getTileCredits=function(e,t,n){if(!l(this._attributionsByLevel)||!l(this._tileCredits))return;let o=this._attributionsByLevel.get(n);return l(this._tileCredits)?this._tileCredits.concat(o):o};Eg.prototype.requestImage=function(e,t,n,i){let o=this._imageryProvider.requestImage(e,t,n,i);if(l(o))return l(this._attributionsByLevel)?o:Promise.all([o,this.getViewportCredits()]).then(r=>r[0])};Eg.prototype.pickFeatures=function(e,t,n,i,o){};Eg.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let o=0;o<e+1;o++)t.push(fXe(this._resource,this._viewportUrl,o));let n=await Promise.all(t),i=new Map;for(let o=0;o<e+1;o++){let r=[],a=n[o];if(a){let s=new Et(a);r.push(s)}i.set(o,r)}return this._attributionsByLevel=i,i};async function fXe(e,t,n){return(await e.getDerivedResource({url:t,queryParameters:{zoom:n,north:90,south:-90,east:180,west:-180},data:JSON.stringify(V.EMPTY_OBJECT)}).fetchJson()).copyright}function Hhe(e){let{mapType:t,overlayLayerType:n,styles:i}=e,o={mapType:t,overlay:!1};return t==="terrain"&&!l(n)&&(o.layerTypes=["layerRoadmap"]),l(n)&&(o.mapType="satellite",o.overlay=!0,o.layerTypes=[n]),l(i)&&(o.styles=i),o}async function dXe(e){let{language:t,region:n,key:i,url:o}=e,r=Hhe(e),a=o.url??o;Vhe.test(a)||(a+="/");let s=await De.post({url:`${a}v1/createSession`,queryParameters:{key:i},data:JSON.stringify({...r,language:t,region:n})});return JSON.parse(s)}var aO=Eg;var hXe=/\/$/;function HT(e){e=e??{};let t=e.tilesetId??"microsoft.imagery";this._maximumLevel=e.maximumLevel??22,this._minimumLevel=e.minimumLevel??0,this._subscriptionKey=e.subscriptionKey??e["subscription-key"],this._tilesetId=e.tilesetId;let n=e.url instanceof fa?e.url:De.createIfNeeded(e.url??"https://atlas.microsoft.com/"),i=n.getUrlComponent();hXe.test(i)||(i+="/");let o=`${i}map/tile`;this._viewportUrl=`${i}map/attribution`,n.url=o,n.setQueryParameters({"api-version":"2024-04-01",tilesetId:t,"subscription-key":this._subscriptionKey,zoom:"{z}",x:"{x}",y:"{y}"}),this._resource=n;let r;l(e.credit)&&(r=e.credit,typeof r=="string"&&(r=new Et(r)));let a=new Aa({...e,maximumLevel:this._maximumLevel,minimumLevel:this._minimumLevel,url:n,credit:r});a._resource=n,this._imageryProvider=a,this._tileCredits=n.credits,this._attributionsByLevel=void 0}Object.defineProperties(HT.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}}});HT.prototype.getTileCredits=function(e,t,n){if(!l(this._attributionsByLevel)||!l(this._tileCredits))return;let o=this._attributionsByLevel.get(n);return l(this._tileCredits)?this._tileCredits.concat(o):o};HT.prototype.requestImage=function(e,t,n,i){let o=this._imageryProvider.requestImage(e,t,n,i);if(l(o))return l(this._attributionsByLevel)?o:Promise.all([o,this.getViewportCredits()]).then(r=>r[0])};HT.prototype.pickFeatures=function(e,t,n,i,o){};HT.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let o=0;o<e+1;o++)t.push(mXe(this._resource,this._viewportUrl,this._subscriptionKey,this._tilesetId,o));let n=await Promise.all(t),i=new Map;for(let o=0;o<e+1;o++){let r=[],a=n[o].join(",");if(a){let s=new Et(a);r.push(s)}i.set(o,r)}return this._attributionsByLevel=i,i};async function mXe(e,t,n,i,o){return(await e.getDerivedResource({url:t,queryParameters:{zoom:o,bounds:"-180,-90,180,90"},data:JSON.stringify(V.EMPTY_OBJECT)}).fetchJson()).copyrights}var sO=HT;var pXe=async(e,t,n)=>Vy.fromUrl(new fa(t,n)),AXe=async(e,{options:t})=>Cg.fromUrl(e,t),gXe=async(e,{options:t})=>JL.fromUrl(e,t),_Xe=async(e,{options:t})=>{let n=t.channel;return delete t.channel,eO.fromUrl(e,n,t)},yXe=async(e,{options:t})=>new tO({url:e,...t}),CXe=async(e,{options:t})=>nO.fromUrl(e,t),EXe=async(e,{options:t})=>Vy.fromUrl(e,t),bXe=async(e,{options:t})=>new Aa({url:e,...t}),IXe=async(e,{options:t})=>new oO({url:e,...t}),xXe=async(e,{options:t})=>new rO({url:e,...t}),fK=async(e,t,n)=>{delete t.externalType,t.url=e;let i=new fa(t,n),o=(r,a)=>{delete a.externalType,a.url=e;let{options:s}=a;r.setQueryParameters({session:s.session,key:s.key})};return i.refreshCallback=o,new aO({...t.options,url:i})},TXe=async(e,t,n)=>{delete t.externalType,t.url=e;let i=new fa(t,n),o=(r,a)=>{delete a.externalType,a.url=e;let{options:s}=a;r.setQueryParameters({"subscription-key":s["subscription-key"]})};return i.refreshCallback=o,new sO({...t.options,url:i})},SXe={ARCGIS_MAPSERVER:AXe,BING:gXe,GOOGLE_EARTH:_Xe,MAPBOX:yXe,SINGLE_TILE:CXe,TMS:EXe,URL_TEMPLATE:bXe,WMS:IXe,WMTS:xXe,GOOGLE_2D_MAPS:fK,AZURE_MAPS:TXe,defaultFactoryCallback:pXe},WT=Object.freeze(SXe);function xp(e){e=e??V.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 _e}Object.defineProperties(xp.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(){}}});xp.fromAssetId=async function(e,t){t=t??V.EMPTY_OBJECT;let n=fa._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,o=xp._endpointCache[i];l(o)||(o=n.fetchJson(),xp._endpointCache[i]=o);let r=await o;if(r.type!=="IMAGERY")throw new ue(`Cesium ion asset ${e} is not an imagery asset.`);let a=r.externalType,s=WT.defaultFactoryCallback;r=je(r,!0),r.options=r.options??{};let c=r.options?.url;if(delete t.url,l(a)&&(s=WT[a],!l(s)))throw new ue(`Unrecognized Cesium ion imagery type: ${a}`);let u=await s(c,r,n),f=new xp(t);return u.errorEvent.addEventListener(function(h){h.provider=f,f._errorEvent.raiseEvent(h)}),f._tileCredits=fa.getCreditsFromEndpoint(r,n),f._imageryProvider=u,f};xp.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};xp.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};xp.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};xp._endpointCache={};var ql=xp;var wXe={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4},bg=Object.freeze(wXe);function BXe(e){e=e??V.EMPTY_OBJECT;let t=e.style??bg.AERIAL;return ql.fromAssetId(t)}var Ig=BXe;function ka(){de.throwInstantiationError()}Object.defineProperties(ka.prototype,{errorEvent:{get:de.throwInstantiationError},credit:{get:de.throwInstantiationError},tilingScheme:{get:de.throwInstantiationError},hasWaterMask:{get:de.throwInstantiationError},hasVertexNormals:{get:de.throwInstantiationError},availability:{get:de.throwInstantiationError}});var Whe=[];ka.getRegularGridIndices=function(e,t){let n=Whe[e];l(n)||(Whe[e]=n=[]);let i=n[t];return l(i)||(e*t<D.SIXTY_FOUR_KILOBYTES?i=n[t]=new Uint16Array((e-1)*(t-1)*6):i=n[t]=new Uint32Array((e-1)*(t-1)*6),Khe(e,t,i,0)),i};var jhe=[];ka.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=jhe[e];l(n)||(jhe[e]=n=[]);let i=n[t];if(!l(i)){let o=ka.getRegularGridIndices(e,t),r=qhe(e,t),a=r.westIndicesSouthToNorth,s=r.southIndicesEastToWest,c=r.eastIndicesNorthToSouth,u=r.northIndicesWestToEast;i=n[t]={indices:o,westIndicesSouthToNorth:a,southIndicesEastToWest:s,eastIndicesNorthToSouth:c,northIndicesWestToEast:u}}return i};var Yhe=[];ka.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=Yhe[e];l(n)||(Yhe[e]=n=[]);let i=n[t];if(!l(i)){let o=e*t,r=(e-1)*(t-1)*6,a=e*2+t*2,s=Math.max(0,a-4)*6,c=o+a,u=r+s,f=qhe(e,t),h=f.westIndicesSouthToNorth,p=f.southIndicesEastToWest,A=f.eastIndicesNorthToSouth,m=f.northIndicesWestToEast,_=Ue.createTypedArray(c,u);Khe(e,t,_,0),ka.addSkirtIndices(h,p,A,m,o,_,r),i=n[t]={indices:_,westIndicesSouthToNorth:h,southIndicesEastToWest:p,eastIndicesNorthToSouth:A,northIndicesWestToEast:m,indexCountWithoutSkirts:r}}return i};ka.getSkirtVertexCount=function(e,t,n,i){return e.length+t.length+n.length+i.length};ka.getSkirtIndexCount=function(e){return(e-4)*2*3};ka.getSkirtIndexCountWithFilledCorners=function(e){return((e-4)*2+4)*3};ka.addSkirtIndices=function(e,t,n,i,o,r,a){let s=o;a=E8(e,s,r,a),s+=e.length,a=E8(t,s,r,a),s+=t.length,a=E8(n,s,r,a),s+=n.length,E8(i,s,r,a)};ka.addSkirtIndicesWithFilledCorners=function(e,t,n,i,o,r,a){ka.addSkirtIndices(e,t,n,i,o,r,a);let s=ka.getSkirtVertexCount(e,t,n,i),c=ka.getSkirtIndexCount(s),u=a+c,f=e[0],h=i[0],p=n[0],A=t[0],m=o,_=m+e.length-1,y=_+1,C=y+t.length-1,E=C+1,b=E+n.length-1,x=b+1,S=x+i.length-1;r[u+0]=f,r[u+1]=m,r[u+2]=C,r[u+3]=A,r[u+4]=y,r[u+5]=b,r[u+6]=p,r[u+7]=E,r[u+8]=S,r[u+9]=h,r[u+10]=x,r[u+11]=_};function qhe(e,t){let n=new Array(t),i=new Array(e),o=new Array(t),r=new Array(e),a;for(a=0;a<e;++a)r[a]=a,i[a]=e*t-1-a;for(a=0;a<t;++a)o[a]=(a+1)*e-1,n[a]=(t-a-1)*e;return{westIndicesSouthToNorth:n,southIndicesEastToWest:i,eastIndicesNorthToSouth:o,northIndicesWestToEast:r}}function Khe(e,t,n,i){let o=0;for(let r=0;r<t-1;++r){for(let a=0;a<e-1;++a){let s=o,c=s+e,u=c+1,f=s+1;n[i++]=s,n[i++]=c,n[i++]=f,n[i++]=f,n[i++]=c,n[i++]=u,++o}++o}}function E8(e,t,n,i){let o=e[0],r=e.length;for(let a=1;a<r;++a){let s=e[a];n[i++]=o,n[i++]=s,n[i++]=t,n[i++]=t,n[i++]=s,n[i++]=t+1,o=s,++t}return i}ka.heightmapTerrainQuality=.25;ka.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*ka.heightmapTerrainQuality/(t*n)};ka.prototype.requestTileGeometry=de.throwInstantiationError;ka.prototype.getLevelMaximumGeometricError=de.throwInstantiationError;ka.prototype.getTileDataAvailable=de.throwInstantiationError;ka.prototype.loadTileDataAvailability=de.throwInstantiationError;var jo=ka;var cO=`uniform sampler2D u_texture;
in vec2 v_textureCoordinates;
void main()
{
out_FragColor = texture(u_texture, v_textureCoordinates);
}
`;var lO=`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 DXe={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7},Vn=Object.freeze(DXe);function jT(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,a=n/2|0,s=i-1;this.parent=e.getImageryFromCache(r,a,s)}this.state=Vn.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}jT.createPlaceholder=function(e){let t=new jT(e,0,0,0);return t.addReference(),t.state=Vn.PLACEHOLDER,t};jT.prototype.addReference=function(){++this.referenceCount};jT.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(),fe(this),0):this.referenceCount};jT.prototype.processStateMachine=function(e,t,n){this.state===Vn.UNLOADED&&!n&&(this.state=Vn.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===Vn.RECEIVED&&(this.state=Vn.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===Vn.READY&&t&&!this.texture;(this.state===Vn.TEXTURE_LOADED||i)&&(this.state=Vn.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var YT=jT;function dK(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}dK.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};dK.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,o=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===Vn.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,a;for(;l(r)&&(r.state!==Vn.READY||!this.useWebMercatorT&&!l(r.texture));)r.state!==Vn.FAILED&&r.state!==Vn.INVALID&&(a=a||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===Vn.FAILED||i.state===Vn.INVALID?l(a)?(a.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var qT=dK;function Oi(e,t){this._imageryProvider=e,this._readyEvent=new _e,this._errorEvent=new _e,t=t??V.EMPTY_OBJECT,e=e??V.EMPTY_OBJECT,this.alpha=t.alpha??e._defaultAlpha??1,this.nightAlpha=t.nightAlpha??e._defaultNightAlpha??1,this.dayAlpha=t.dayAlpha??e._defaultDayAlpha??1,this.brightness=t.brightness??e._defaultBrightness??Oi.DEFAULT_BRIGHTNESS,this.contrast=t.contrast??e._defaultContrast??Oi.DEFAULT_CONTRAST,this.hue=t.hue??e._defaultHue??Oi.DEFAULT_HUE,this.saturation=t.saturation??e._defaultSaturation??Oi.DEFAULT_SATURATION,this.gamma=t.gamma??e._defaultGamma??Oi.DEFAULT_GAMMA,this.splitDirection=t.splitDirection??Oi.DEFAULT_SPLIT,this.minificationFilter=t.minificationFilter??e._defaultMinificationFilter??Oi.DEFAULT_MINIFICATION_FILTER,this.magnificationFilter=t.magnificationFilter??e._defaultMagnificationFilter??Oi.DEFAULT_MAGNIFICATION_FILTER,this.show=t.show??!0,this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=t.rectangle??ce.MAX_VALUE,this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new qT(YT.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=t.colorToAlphaThreshold??Oi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD,this._marsOptions=t.marsOptions??{},this._initByMars3D&&this._initByMars3D(e,t)}Object.defineProperties(Oi.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}}});Oi.DEFAULT_BRIGHTNESS=1;Oi.DEFAULT_CONTRAST=1;Oi.DEFAULT_HUE=0;Oi.DEFAULT_SATURATION=1;Oi.DEFAULT_GAMMA=1;Oi.DEFAULT_SPLIT=Lr.NONE;Oi.DEFAULT_MINIFICATION_FILTER=Wt.LINEAR;Oi.DEFAULT_MAGNIFICATION_FILTER=ci.LINEAR;Oi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;Oi.fromProviderAsync=function(e,t){let n=new Oi(void 0,t);return NXe(n,Promise.resolve(e)),n};Oi.fromWorldImagery=function(e){return e=e??V.EMPTY_OBJECT,Oi.fromProviderAsync(Ig({style:e.style}),e)};Oi.prototype.isBaseLayer=function(){return this._isBaseLayer};Oi.prototype.isDestroyed=function(){return!1};Oi.prototype.destroy=function(){return fe(this)};var Zhe=new ce,Xhe=new ce,hK=new ce,$he=new ce;Oi.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return ce.intersection(e.rectangle,t)};Oi.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 mi&&e.rectangle.north<mi.MaximumLatitude&&e.rectangle.south>-mi.MaximumLatitude,a=ce.intersection(o.rectangle,this._rectangle,Zhe),s=ce.intersection(e.rectangle,a,Xhe);if(!l(s)){if(!this.isBaseLayer())return!1;let T=a,w=e.rectangle;s=Xhe,w.south>=T.north?s.north=s.south=T.north:w.north<=T.south?s.north=s.south=T.south:(s.south=Math.max(w.south,T.south),s.north=Math.min(w.north,T.north)),w.west>=T.east?s.west=s.east=T.east:w.east<=T.west?s.west=s.east=T.west:(s.west=Math.max(w.west,T.west),s.east=Math.min(w.east,T.east))}let c=0;s.south>0?c=s.south:s.north<0&&(c=s.north);let f=1*t.getLevelMaximumGeometricError(e.level),h=RXe(this,f,c);h=Math.max(0,h);let p=o.maximumLevel;if(h>p&&(h=p),l(o.minimumLevel)){let T=o.minimumLevel;h<T&&(h=T)}let A=o.tilingScheme,m=A.positionToTileXY(ce.northwest(s),h),_=A.positionToTileXY(ce.southeast(s),h),y=e.rectangle.width/512,C=e.rectangle.height/512,E=A.tileXYToRectangle(m.x,m.y,h);Math.abs(E.south-e.rectangle.north)<C&&m.y<_.y&&++m.y,Math.abs(E.east-e.rectangle.west)<y&&m.x<_.x&&++m.x;let b=A.tileXYToRectangle(_.x,_.y,h);Math.abs(b.north-e.rectangle.south)<C&&_.y>m.y&&--_.y,Math.abs(b.west-e.rectangle.east)<y&&_.x>m.x&&--_.x;let x=ce.clone(e.rectangle,$he),S=A.tileXYToRectangle(m.x,m.y,h),B=ce.intersection(S,a,hK),v;r?(A.rectangleToNativeRectangle(x,x),A.rectangleToNativeRectangle(S,S),A.rectangleToNativeRectangle(B,B),A.rectangleToNativeRectangle(a,a),v=A.tileXYToNativeRectangle.bind(A),y=x.width/512,C=x.height/512):v=A.tileXYToRectangle.bind(A);let P,N=0,L=1,g;!this.isBaseLayer()&&Math.abs(B.west-x.west)>=y&&(N=Math.min(1,(B.west-x.west)/x.width)),!this.isBaseLayer()&&Math.abs(B.north-x.north)>=C&&(L=Math.max(0,(B.north-x.south)/x.height));let I=L;for(let T=m.x;T<=_.x;T++)if(P=N,S=v(T,m.y,h),B=ce.simpleIntersection(S,a,hK),!!l(B)){N=Math.min(1,(B.east-x.west)/x.width),T===_.x&&(this.isBaseLayer()||Math.abs(B.east-x.east)<y)&&(N=1),L=I;for(let w=m.y;w<=_.y;w++){if(g=L,S=v(T,w,h),B=ce.simpleIntersection(S,a,hK),!l(B))continue;L=Math.max(0,(B.south-x.south)/x.height),w===_.y&&(this.isBaseLayer()||Math.abs(B.south-x.south)<C)&&(L=0);let R=new ie(P,L,N,g),O=this.getImageryFromCache(T,w,h);i.imagery.splice(n,0,new qT(O,R,r)),++n}}return!0};Oi.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,Zhe),i=c.rectangleToNativeRectangle(i,$he)}let o=i.width,r=i.height,a=o/n.width,s=r/n.height;return new ie(a*(i.west-n.west)/o,s*(i.south-n.south)/r,a,s)};Oi.prototype._requestImagery=function(e){if(l(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel)return e.state=Vn.FAILED,e.request=void 0,!1;if(l(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return e.state=Vn.FAILED,e.request=void 0,!1;let t=this._imageryProvider,n=this;function i(a){if(!l(a))return o();e.image=a,e.state=Vn.RECEIVED,e.request=void 0,$o.reportSuccess(n._requestImageError),n._marsOptions.onAddTileSuccess&&n._marsOptions.onAddTileSuccess(e)}function o(a){if(e.request.state===pi.CANCELLED){e.state=Vn.UNLOADED,e.request=void 0;return}e.state=Vn.FAILED,e.request=void 0;let s=`\u65E0\u6CD5\u83B7\u5F97\u56FE\u5757 x:${e.x},y: ${e.y},z:${e.level}. `;t._resource&&t._resource._last_url&&(s+=t._resource._last_url),n._requestImageError=$o.reportError(n._requestImageError,t,t.errorEvent,s,e.x,e.y,e.level,a),n._requestImageError.retry&&r(),n._marsOptions.onAddTileError&&n._marsOptions.onAddTileError(e)}function r(){let a=new Ir({throttle:!1,throttleByServer:!0,type:ja.IMAGERY});e.request=a,e.state=Vn.TRANSITIONING;let s=t.requestImage(e.x,e.y,e.level,a);if(!l(s)){e.state=Vn.UNLOADED,e.request=void 0;return}l(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),n._marsOptions.onAddTile&&n._marsOptions.onAddTile(e),s.then?s.then(function(c){i(c)}).catch(function(c){o(c)}):i(s)}r()};Oi.prototype._createTextureWebGL=function(e,t){let n=new jt({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return l(i.internalFormat)?new Dt({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new Dt({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?qe.RGBA:qe.RGB,sampler:n})};Oi.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=Vn.RECEIVED;return}if(r.shouldDiscardImage(i)){t.state=Vn.INVALID;return}}}let o=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof mi?t.textureWebMercator=o:t.texture=o,t.image=void 0,t.state=Vn.TEXTURE_LOADED};function Jhe(e,t,n){return`${e}:${t}:${n}`}Oi.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===Wt.LINEAR&&i===ci.LINEAR&&!qe.isCompressedFormat(t.pixelFormat)&&D.isPowerOfTwo(t.width)&&D.isPowerOfTwo(t.height)){n=Wt.LINEAR_MIPMAP_LINEAR;let r=Rt.maximumTextureFilterAnisotropy,a=Math.min(r,this._maximumAnisotropy??r),s=Jhe(n,i,a),c=e.cache.imageryLayerMipmapSamplers;l(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let u=c[s];l(u)||(u=c[s]=new jt({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:a})),t.generateMipmap(hd.NICEST),t.sampler=u}else{let r=Jhe(n,i,0),a=e.cache.imageryLayerNonMipmapSamplers;l(a)||(a={},e.cache.imageryLayerNonMipmapSamplers=a);let s=a[r];l(s)||(s=a[r]=new jt({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=s}};Oi.prototype._reprojectTexture=function(e,t,n){let i=t.textureWebMercator||t.texture,o=t.rectangle,r=e.context;if(n=n??!0,n&&!(this._imageryProvider.tilingScheme.projection instanceof Wi)&&o.width/i.width>1e-5){let a=this;t.addReference();let s=new xl({persists:!0,owner:this,preExecute:function(c){PXe(c,r,i,t.rectangle)},postExecute:function(c){t.texture=c,a._finalizeReprojectTexture(r,c),t.state=Vn.READY,t.releaseReference()},canceled:function(){t.state=Vn.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(s)}else n&&(t.texture=i),this._finalizeReprojectTexture(r,i),t.state=Vn.READY};Oi.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};Oi.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){l(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};Oi.prototype.getImageryFromCache=function(e,t,n,i){let o=eme(e,t,n),r=this._imageryCache[o];return l(r)||(r=new YT(this,e,t,n,i),this._imageryCache[o]=r),r.addReference(),r};Oi.prototype.removeImageryFromCache=function(e){this._marsOptions.onRemoveTile&&this._marsOptions.onRemoveTile(e);let t=eme(e.x,e.y,e.level);delete this._imageryCache[t]};function eme(e,t,n){return JSON.stringify([e,t,n])}var b8={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new k,texture:void 0},vXe=fn.supportsTypedArrays()?new Float32Array(128):void 0;function PXe(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 y=new Float32Array(256),C=0;for(let B=0;B<64;++B){let v=B/63;y[C++]=0,y[C++]=v,y[C++]=1,y[C++]=v}let E={position:0,webMercatorT:1},b=jo.getRegularGridIndices(2,64),x=tt.createIndexBuffer({context:t,typedArray:b,usage:Re.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT});o.vertexArray=new Gn({context:t,attributes:[{index:E.position,vertexBuffer:tt.createVertexBuffer({context:t,typedArray:y,usage:Re.STATIC_DRAW}),componentsPerAttribute:2},{index:E.webMercatorT,vertexBuffer:tt.createVertexBuffer({context:t,sizeInBytes:512,usage:Re.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:x});let S=new We({sources:[lO]});o.shaderProgram=$t.fromCache({context:t,vertexShaderSource:S,fragmentShaderSource:cO,attributeLocations:E}),o.sampler=new jt({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:ci.LINEAR})}n.sampler=o.sampler;let r=n.width,a=n.height;b8.textureDimensions.x=r,b8.textureDimensions.y=a,b8.texture=n;let s=Math.sin(i.south),c=.5*Math.log((1+s)/(1-s));s=Math.sin(i.north);let f=1/(.5*Math.log((1+s)/(1-s))-c),h=new Dt({context:t,width:r,height:a,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});D.isPowerOfTwo(r)&&D.isPowerOfTwo(a)&&h.generateMipmap(hd.NICEST);let p=i.south,A=i.north,m=vXe,_=0;for(let y=0;y<64;++y){let C=y/63,E=D.lerp(p,A,C);s=Math.sin(E);let x=(.5*Math.log((1+s)/(1-s))-c)*f;m[_++]=x,m[_++]=x}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(m),e.shaderProgram=o.shaderProgram,e.outputTexture=h,e.uniformMap=b8,e.vertexArray=o.vertexArray}function RXe(e,t,n){let i=e._imageryProvider,o=i.tilingScheme,r=o.ellipsoid,a=e._imageryProvider.tilingScheme.projection instanceof Wi?1:Math.cos(n),s=o.rectangle,u=r.maximumRadius*s.width*a/(i.tileWidth*o.getNumberOfXTilesAtLevel(0))/t,f=Math.log(u)/Math.log(2);return Math.round(f)|0}function MXe(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function NXe(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){MXe(e._errorEvent,i)}}var ga=Oi;var mK=class{constructor(){this.alpha=!1,this.brightness=!1,this.contrast=!1,this.hue=!1,this.saturation=!1,this.gamma=!1,this.colorToAlpha=!1}},uO=mK;var pK=class{constructor(t,n,i,o){this._minX=t??0,this._minY=n??0,this._maxX=i??0,this._maxY=o??0}get minX(){return this._minX}set minX(t){this._minX=t}get minY(){return this._minY}set minY(t){this._minY=t}get maxX(){return this._maxX}set maxX(t){this._maxX=t}get maxY(){return this._maxY}set maxY(t){this._maxY=t}contains(t,n){return t>=this.minX&&t<this.maxX&&n>=this.minY&&n<this.maxY}containsExclusive(t,n){return t>this.minX&&t<this.maxX&&n>this.minY&&n<this.maxY}containsInclusive(t,n){return t>=this.minX&&t<=this.maxX&&n>=this.minY&&n<=this.maxY}},KT=pK;var LXe=new ce,tme=new ce,OXe=new ce,FXe=new ce,QXe=new ce,kXe=new ce,AK=class e{constructor(t,n,i,o,r){this._x=t,this._y=n,this._level=i,this._textureCoordinateRectangle=o,this._imagery=r}get x(){return this._x}get y(){return this._y}get level(){return this._level}get textureCoordinateRectangle(){return this._textureCoordinateRectangle}get imagery(){return this._imagery}static createImageryCoverages(t,n,i){if(!n.show)return[];let o=n.imageryProvider,r=e._clampImageryLevel(o,i),a=ce.intersection(o.rectangle,n.rectangle,LXe),s=o.tilingScheme,c=e._computeImageryRange(t,a,s,r),u=FXe;s.rectangleToNativeRectangle(t,u);let f=QXe;s.rectangleToNativeRectangle(a,f);let h=(A,m,_)=>{let y=s.tileXYToRectangle(A,m,_),C=ce.intersection(y,a,OXe);if(!l(C))return;let E=kXe;return s.rectangleToNativeRectangle(C,E),E};return e._computeImageryCoverages(n,c,r,u,h)}static _clampImageryLevel(t,n){let i=t.minimumLevel??0,o=t.maximumLevel??Number.POSITIVE_INFINITY,r=Math.min(o-1,Math.max(i,n));return Math.floor(r)}static _computeImageryRange(t,n,i,o){let r=e._computeOverlappedRectangle(t,n),a=i.positionToTileXY(ce.northwest(r),o),s=i.positionToTileXY(ce.southeast(r),o),c=new KT;c.minX=a.x,c.minY=a.y,c.maxX=s.x,c.maxY=s.y;let u=t.width/512,f=t.height/512,h=i.tileXYToRectangle(c.minX,c.minY,o);Math.abs(h.south-t.north)<f&&c.minY<c.maxY&&++c.minY,Math.abs(h.east-t.west)<u&&c.minX<c.maxX&&++c.minX;let m=i.tileXYToRectangle(c.maxX,c.maxY,o);return Math.abs(m.north-t.south)<f&&c.maxY>c.minY&&--c.maxY,Math.abs(m.west-t.east)<u&&c.maxX>c.minX&&--c.maxX,c}static _clampRectangle(t,n,i){return l(i)||(i=new ce),t.south>=n.north?i.north=i.south=n.north:t.north<=n.south?i.north=i.south=n.south:(i.south=Math.max(t.south,n.south),i.north=Math.min(t.north,n.north)),t.west>=n.east?i.west=i.east=n.east:t.east<=n.west?i.west=i.east=n.west:(i.west=Math.max(t.west,n.west),i.east=Math.min(t.east,n.east)),i}static _computeOverlappedRectangle(t,n){let i=ce.intersection(t,n,tme);return l(i)?i:e._clampRectangle(t,n,tme)}static _computeImageryCoverages(t,n,i,o,r){let a=[];for(let s=n.minX;s<=n.maxX;s++){let c=r(s,n.maxY,i);if(l(c))for(let u=n.minY;u<=n.maxY;u++){let f=r(s,u,i);if(!l(f))continue;let h=e._localizeToCartesianRectangle(f,o,void 0),p=t.getImageryFromCache(s,u,i),A=new e(s,u,i,h,p);a.push(A)}}return a}static _localizeToCartesianRectangle(t,n,i){l(i)||(i=new KT);let o=1/n.width,r=1/n.height;return i.minX=(t.west-n.west)*o,i.minY=(t.south-n.south)*r,i.maxX=(t.east-n.west)*o,i.maxY=(t.north-n.south)*r,i}},XT=AK;var gK=class e{static createTextureCoordinatesForMappedPositions(t,n){let i=t.cartographicPositions,o=t.cartographicBoundingRectangle,r=t.numPositions;return e._createTextureCoordinates(i,r,o,n)}static _createTextureCoordinates(t,n,i,o){let r=new et;et.fromRectangle(i,o,r);let a=e.createProjectedPositions(t,o),s=e.computeTexCoords(a,r);return e.createTypedArrayFromCartesians2(n,s)}static createTextureCoordinatesAttributeForMappedPositions(t,n){let i=e.createTextureCoordinatesForMappedPositions(t,n);return e.createTexCoordAttribute(i)}static createCartographicPositions(t,n,i){let o=il.readAttributeAsTypedArray(t),r=t.type,a=Ut.getNumberOfComponents(r),s=e.createIterableCartesian3FromTypedArray(o,a),c=e.transformCartesians3(s,n);return e.transformToCartographic(c,i)}static createIterableCartesian3FromTypedArray(t,n){let i=new d,o=t.length/n;return{[Symbol.iterator]:function*(){for(let a=0;a<o;a++)i.x=t[a*n+0],i.y=t[a*n+1],i.z=t[a*n+2],yield i}}}static map(t,n){return{[Symbol.iterator]:function*(){for(let o of t)yield n(o)}}}static computeCartographicBoundingRectangle(t,n){l(n)||(n=new ce);let i=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;for(let s of t)i=Math.max(i,s.latitude),o=Math.min(o,s.latitude),r=Math.max(r,s.longitude),a=Math.min(a,s.longitude);return n.north=i,n.south=o,n.east=r,n.west=a,n}static transformCartesians3(t,n){let i=new d;return e.map(t,r=>(M.multiplyByPoint(n,r,i),i))}static transformToCartographic(t,n){let i=new me;return e.map(t,r=>(n.cartesianToCartographic(r,i),i))}static createProjectedPositions(t,n){let i=new d;return e.map(t,r=>(n.project(r,i),i))}static computeTexCoords(t,n){let i=new k,o=1/n.width,r=1/n.height;return e.map(t,s=>{let c=(s.x-n.x)*o,u=(s.y-n.y)*r,f=Math.min(Math.max(c,0),1),h=Math.min(Math.max(u,0),1);return i.x=f,i.y=h,i})}static createTypedArrayFromCartesians2(t,n){let i=new Float32Array(t*2),o=0;for(let r of n)i[o*2+0]=r.x,i[o*2+1]=r.y,o++;return i}static createTexCoordAttribute(t){return{name:"Imagery Texture Coordinates",semantic:at.TEXCOORD,setIndex:0,componentDatatype:j.FLOAT,type:Ut.VEC2,normalized:!1,count:t.length/2,min:void 0,max:void 0,constant:new k(0,0),quantization:void 0,typedArray:t,byteOffset:0,byteStride:void 0}}},N0=gK;var _K=class{constructor(t,n,i,o){this._cartographicPositions=t,this._numPositions=n,this._cartographicBoundingRectangle=i,this._ellipsoid=o}get cartographicPositions(){return this._cartographicPositions}get numPositions(){return this._numPositions}get cartographicBoundingRectangle(){return this._cartographicBoundingRectangle}get ellipsoid(){return this._ellipsoid}},fO=_K;var yK=class e{constructor(t,n,i){this._model=t,this._runtimeNode=n,this._runtimePrimitive=i,this._mappedPositionsPerEllipsoid=void 0,this._mappedPositionsModelMatrix=new M,this._lastImageryLayersModificationCounter=0,this._imageryTexCoordAttributesPerProjection=void 0,this._currentImageryLayers=void 0,this._coveragesPerLayer=void 0,this._allImageriesReady=!1}coveragesForImageryLayer(t){let o=this._model.imageryLayers.indexOf(t);if(o===-1)throw new de("Imagery layer is not part of the model");let r=this._coveragesPerLayer;if(!l(r))throw new de("The coveragesPerLayer have not been computed yet");return r[o]}update(t){let n=this._model,r=n.content.tileset.imageryLayersModificationCounter;this._lastImageryLayersModificationCounter!==r&&(delete this._mappedPositionsPerEllipsoid,this._lastImageryLayersModificationCounter=r),this._mappedPositionsNeedUpdate&&(n.resetDrawCommands(),this._mappedPositionsPerEllipsoid=this._computeMappedPositionsPerEllipsoid(),this._deleteCoveragesPerLayer(),this._destroyImageryTexCoordAttributes()),l(this._imageryTexCoordAttributesPerProjection)||(this._imageryTexCoordAttributesPerProjection=this._computeImageryTexCoordsAttributesPerProjection(),this._uploadImageryTexCoordAttributes(t.context)),l(this._coveragesPerLayer)||(this._computeCoveragesPerLayer(),this._allImageriesReady=!1),this._allImageriesReady||this._updateImageries(t)}_deleteCoveragesPerLayer(){let t=this._coveragesPerLayer;if(!l(t))return;let n=this._currentImageryLayers,i=t.length;for(let o=0;o<i;o++){let r=n[o],a=t[o];this._deleteCoverages(r,a)}delete this._currentImageryLayers,delete this._coveragesPerLayer}_deleteCoverages(t,n){if(t.isDestroyed())return;let i=n.length;for(let o=0;o<i;o++)n[o].imagery.releaseReference()}_uploadImageryTexCoordAttributes(t){let n=this._imageryTexCoordAttributesPerProjection;if(!l(n))return;let i=n.length;for(let o=0;o<i;o++){let r=n[o],a=tt.createVertexBuffer({context:t,typedArray:r.typedArray,usage:Re.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.buffer=a}}_destroyImageryTexCoordAttributes(){let t=this._imageryTexCoordAttributesPerProjection;if(!l(t))return;let n=t.length;for(let i=0;i<n;i++){let o=t[i];l(o)&&(l(o.buffer)&&(o.buffer.isDestroyed()||o.buffer.destroy()),t[i]=void 0)}delete this._imageryTexCoordAttributesPerProjection}get _mappedPositionsNeedUpdate(){if(!l(this._mappedPositionsPerEllipsoid))return!0;let t=this._model,n=this._mappedPositionsModelMatrix;return!M.equals(t.modelMatrix,n)}_computeMappedPositionsPerEllipsoid(){let t=this._model,n=this._runtimeNode,i=this._runtimePrimitive,o=e._obtainPrimitivePositionAttribute(i.primitive),r=o.count,a=e._computePrimitivePositionTransform(t,n,void 0),s=[],c=e._computeUniqueEllipsoids(t.imageryLayers),u=c.length;for(let f=0;f<u;f++){let h=c[f],p=N0.createCartographicPositions(o,a,h),A=N0.computeCartographicBoundingRectangle(p),m=new fO(p,r,A,h);s.push(m)}return M.clone(t.modelMatrix,this._mappedPositionsModelMatrix),s}static _computeUniqueEllipsoids(t){let n=new Set,i=t.length;for(let o=0;o<i;o++){let r=t.get(o),a=e._getEllipsoid(r);n.add(a)}return[...n]}_computeImageryTexCoordsAttributesPerProjection(){let n=this._model.imageryLayers,i=e._extractProjections(n),o=[...new Set(i)];return this._createImageryTexCoordAttributes(o)}static _extractProjections(t){let n=[],i=t.length;for(let o=0;o<i;o++){let r=t.get(o),a=e._getProjection(r);n.push(a)}return n}static _getProjection(t){return t.imageryProvider.tilingScheme.projection}_createImageryTexCoordAttributes(t){let n=[],i=t.length;for(let o=0;o<i;o++){let r=t[o],a=r.ellipsoid,s=this.mappedPositionsForEllipsoid(a),c=N0.createTextureCoordinatesAttributeForMappedPositions(s,r);n.push(c)}return n}_computeCoveragesPerLayer(){let t=[],n=[],o=this._model.imageryLayers,r=o.length;for(let a=0;a<r;a++){let s=o.get(a),c=this._computeCoverage(s);t.push(c),n.push(s)}this._coveragesPerLayer=t,this._currentImageryLayers=n}_computeCoverage(t){let i=this.mappedPositionsForImageryLayer(t).cartographicBoundingRectangle,o=this._computeImageryLevel(t,i);return XT.createImageryCoverages(i,t,o)}_computeImageryLevel(t,n){let i=t.imageryProvider,r=i.tilingScheme.rectangle,a=1,s=n.width,c=r.width;n.height>n.width&&(s=n.height,c=r.height);let u=Math.log2(a*c/s);return XT._clampImageryLevel(i,u)}_updateImageries(t){let n=this._model,i=this._coveragesPerLayer,o=i.length,r=!0;for(let a=0;a<o;a++){let s=i[a],c=s.length;for(let u=0;u<c;u++){let h=s[u].imagery;h.state===Vn.READY||h.state===Vn.FAILED||h.state===Vn.INVALID||(r=!1,h.processStateMachine(t,!1,!1))}}r&&n.resetDrawCommands(),this._allImageriesReady=r}mappedPositionsForImageryLayer(t){let n=e._getEllipsoid(t);return this.mappedPositionsForEllipsoid(n)}mappedPositionsForEllipsoid(t){let n=this._mappedPositionsPerEllipsoid;if(!l(n))throw new de("The mappedPositions have not been computed yet");let i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.ellipsoid===t)return r}throw new de(`Could not find mapped positions for ellipsoid ${t}`)}imageryTexCoordAttributesPerProjection(){let t=this._imageryTexCoordAttributesPerProjection;if(!l(t))throw new de("The imagery texture coordinate attributes have not been computed yet");return this._imageryTexCoordAttributesPerProjection}get ready(){let t=this._coveragesPerLayer;return l(t)?this._allImageriesReady:!1}isDestroyed(){return!1}destroy(){if(!this.isDestroyed())return this._deleteCoveragesPerLayer(),this._destroyImageryTexCoordAttributes(),fe(this)}static _computePrimitivePositionTransform(t,n,i){l(i)||(i=new M);let o=t.sceneGraph;return M.clone(M.IDENTITY,i),M.multiply(i,t.modelMatrix,i),M.multiply(i,o.components.transform,i),M.multiply(i,o.axisCorrectionMatrix,i),M.multiply(i,n.computedTransform,i),i}static _obtainPrimitivePositionAttribute(t){let n=xt.getAttributeBySemantic(t,"POSITION");if(!l(n))throw new de("The primitive does not have a POSITION attribute");return n}static _getEllipsoid(t){return t.imageryProvider.tilingScheme.projection.ellipsoid}},L0=yK;var CK=class{constructor(t,n,i,o,r){this.imageryLayer=t,this.texture=n,this.textureTranslationAndScale=i,this.textureCoordinateRectangle=o,this.imageryTexCoordAttributeSetIndex=r}},dO=CK;var UXe=!1,zXe=new ce,GXe=new ce,EK=class e{static process(t,n,i){let o=t.model,r=n.modelPrimitiveImagery;if(!l(r)||!r.ready)return;let a=o.imageryLayers,s=L0._extractProjections(a),c=[...new Set(s)],u=e._computeIndexMapping(s,c),f=e._createImageryInputs(a,r,u);if(f.length===0)return;f.length>10&&(It("imagery-texture-units",`Warning: Draped imagery requires ${f.length} texture units, truncating`),f.length=10),e._addImageryTexCoordAttributesToRenderResources(r,t);let h=[];for(let p=0;p<a.length;p++)h.push(a.get(p));e._processImageryInputs(h,t,f,c.length)}static _addImageryTexCoordAttributesToRenderResources(t,n){let i=t.imageryTexCoordAttributesPerProjection();for(let o of i)e._addImageryTexCoordAttributeToRenderResources(o,n)}static _addImageryTexCoordAttributeToRenderResources(t,n){let i=Ut.getNumberOfComponents(t.type),o={index:n.attributeIndex++,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:i,componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};n.attributes.push(o)}static _processImageryInputs(t,n,i,o){let r=n.shaderBuilder,a=e._computeImageryFlags(t),s=i.length;r.addDefine("HAS_IMAGERY"),r.addDefine(`IMAGERY_TEXTURE_UNITS ${s}`),e._addAttributes(r,o),e._defineUniforms(r,a),e._buildSampleAndBlendFunction(r,a),e._createMainImageryShader(r,i,a);let c=n.uniformMap,u=e._createImageryUniforms(i);e._setImageryUniforms(c,u)}static _addAttributes(t,n){for(let r=0;r<n;r++)t.addAttribute("vec2",`a_imagery_texCoord_${r}`),t.addVarying("vec2",`v_imagery_texCoord_${r}`);let i="initializeImageryAttributes",o=`void ${i}()`;t.addFunction(i,o,he.VERTEX);for(let r=0;r<n;r++)t.addFunctionLines(i,[`v_imagery_texCoord_${r} = a_imagery_texCoord_${r};`])}static _computeImageryFlags(t){let n=new uO;for(let i=0;i<t.length;i++){let o=t[i];n.alpha|=o.alpha!==1,n.brightness|=o.brightness!==ga.DEFAULT_BRIGHTNESS,n.contrast|=o.contrast!==ga.DEFAULT_CONTRAST,n.hue|=o.hue!==ga.DEFAULT_HUE,n.saturation|=o.saturation!==ga.DEFAULT_SATURATION,n.gamma|=o.gamma!==ga.DEFAULT_GAMMA;let r=l(o.colorToAlpha)&&o.colorToAlphaThreshold>0;n.colorToAlpha|=r}return n}static _defineUniforms(t,n){t.addUniform("sampler2D","u_imageryTextures[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT),t.addUniform("vec4","u_imageryTextureCoordinateRectangle[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT),t.addUniform("vec4","u_imageryTextureTranslationAndScale[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT),n.alpha&&t.addUniform("float","u_imageryTextureAlpha[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT),n.brightness&&t.addUniform("float","u_imageryTextureBrightness[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT),n.contrast&&t.addUniform("float","u_imageryTextureContrast[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT),n.hue&&t.addUniform("float","u_imageryTextureHue[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT),n.saturation&&t.addUniform("float","u_imageryTextureSaturation[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT),n.gamma&&t.addUniform("float","u_imageryTextureOneOverGamma[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT),n.colorToAlpha&&t.addUniform("vec4","u_imageryTextureColorToAlpha[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT)}static _createSampleAndBlendFunctionSignature(t){let n="sampleAndBlend",i=[];i.push("vec4 previousColor"),i.push("sampler2D textureToSample"),i.push("vec2 textureCoordinates"),i.push("vec4 textureCoordinateRectangle"),i.push("vec4 textureCoordinateTranslationAndScale"),t.alpha&&i.push("float textureAlpha"),t.brightness&&i.push("float textureBrightness"),t.contrast&&i.push("float textureContrast"),t.hue&&i.push("float textureHue"),t.saturation&&i.push("float textureSaturation"),t.gamma&&i.push("float textureOneOverGamma"),t.colorToAlpha&&i.push("vec4 colorToAlpha");let o=i.join(", ");return`vec4 ${n}(${o})`}static _buildSampleAndBlendFunction(t,n){let i="sampleAndBlend",o=e._createSampleAndBlendFunctionSignature(n);t.addFunction(i,o,he.FRAGMENT),t.addFunctionLines(i,["float effectiveAlpha = 1.0;"]),n.alpha&&t.addFunctionLines(i,["effectiveAlpha = textureAlpha;"]),t.addFunctionLines(i,["if (textureCoordinates.x < textureCoordinateRectangle.x) effectiveAlpha = 0.0;","if (textureCoordinates.x > textureCoordinateRectangle.z) effectiveAlpha = 0.0;","if (textureCoordinates.y < textureCoordinateRectangle.y) effectiveAlpha = 0.0;","if (textureCoordinates.y > textureCoordinateRectangle.w) effectiveAlpha = 0.0;","vec2 translation = textureCoordinateTranslationAndScale.xy;","vec2 scale = textureCoordinateTranslationAndScale.zw;","vec2 effectiveTextureCoordinates = textureCoordinates * scale + translation;","vec4 value = texture(textureToSample, effectiveTextureCoordinates);","value = czm_srgbToLinear(value);","vec3 color = value.rgb;","float alpha = value.a;"]),n.colorToAlpha&&t.addFunctionLines(i,["vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb);","colorDiff.r = czm_maximumComponent(colorDiff);","alpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha);"]),n.gamma?t.addFunctionLines(i,["color = pow(color, vec3(textureOneOverGamma));"]):t.addFunctionLines(i,["vec4 tempColor = czm_gammaCorrect(vec4(color, alpha));","color = tempColor.rgb;","alpha = tempColor.a;"]),n.brightness&&t.addFunctionLines(i,["color = mix(vec3(0.0), color, textureBrightness);"]),n.contrast&&t.addFunctionLines(i,["color = mix(vec3(0.5), color, textureContrast);"]),n.hue&&t.addFunctionLines(i,["color = czm_hue(color, textureHue);"]),n.saturation&&t.addFunctionLines(i,["color = czm_saturation(color, textureSaturation);"]),t.addFunctionLines(i,["float sourceAlpha = alpha * effectiveAlpha;","float outAlpha = mix(previousColor.a, 1.0, sourceAlpha);","outAlpha += sign(outAlpha) - 1.0;","vec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;","vec4 result = vec4(outColor, max(outAlpha, 0.0));"]),UXe&&t.addFunctionLines(i,["if (abs(textureCoordinates.x - textureCoordinateRectangle.x) < (1.0/256.0) || "," abs(textureCoordinates.x - textureCoordinateRectangle.z) < (1.0/256.0) || "," abs(textureCoordinates.y - textureCoordinateRectangle.y) < (1.0/256.0) || "," abs(textureCoordinates.y - textureCoordinateRectangle.w) < (1.0/256.0))","{"," result = vec4(1.0, 0.0, 0.0, effectiveAlpha);","}"]),t.addFunctionLines(i,["return result;"])}static _createSampleAndBlendCallArguments(t,n,i){let o=`v_imagery_texCoord_${n}`,r=[];return r.push("blendedBaseColor"),r.push(`u_imageryTextures[${i}]`),r.push(`${o}`),r.push(`u_imageryTextureCoordinateRectangle[${i}]`),r.push(`u_imageryTextureTranslationAndScale[${i}]`),t.alpha&&r.push(`u_imageryTextureAlpha[${i}]`),t.brightness&&r.push(`u_imageryTextureBrightness[${i}]`),t.contrast&&r.push(`u_imageryTextureContrast[${i}]`),t.hue&&r.push(`u_imageryTextureHue[${i}]`),t.saturation&&r.push(`u_imageryTextureSaturation[${i}]`),t.gamma&&r.push(`u_imageryTextureOneOverGamma[${i}]`),t.colorToAlpha&&r.push(`u_imageryTextureColorToAlpha[${i}]`),r.join(", ")}static _createMainImageryShader(t,n,i){let o="blendBaseColorWithImagery";t.addFunction(o,"vec4 blendBaseColorWithImagery(vec4 baseColorWithAlpha)",he.FRAGMENT),t.addFunctionLines(o,["vec4 blendedBaseColor = baseColorWithAlpha;"]);for(let r=0;r<n.length;r++){let s=n[r].imageryTexCoordAttributeSetIndex,c=e._createSampleAndBlendCallArguments(i,s,r);t.addFunctionLines(o,[`blendedBaseColor = sampleAndBlend(${c});`])}t.addFunctionLines(o,["return blendedBaseColor;"])}static _createImageryUniforms(t){let n=t.length,i={};i.imageryTextures=Array(n),i.imageryTextureCoordinateRectangle=Array(n),i.imageryTextureTranslationAndScale=Array(n),i.imageryTextureAlpha=Array(n),i.imageryTextureBrightness=Array(n),i.imageryTextureContrast=Array(n),i.imageryTextureHue=Array(n),i.imageryTextureSaturation=Array(n),i.imageryTextureOneOverGamma=Array(n),i.imageryTextureColorToAlpha=Array(n);for(let o=0;o<n;o++){let r=t[o],a=r.imageryLayer,s=r.texture,c=r.textureCoordinateRectangle,u=r.textureTranslationAndScale;i.imageryTextures[o]=s,i.imageryTextureTranslationAndScale[o]=u,i.imageryTextureCoordinateRectangle[o]=c,i.imageryTextureAlpha[o]=a.alpha,i.imageryTextureBrightness[o]=a.brightness,i.imageryTextureContrast[o]=a.contrast,i.imageryTextureHue[o]=a.hue,i.imageryTextureSaturation[o]=a.saturation,i.imageryTextureOneOverGamma[o]=1/a.gamma;let f=i.imageryTextureColorToAlpha[o];if(l(f)||(f=new ie,i.imageryTextureColorToAlpha[o]=f),l(a.colorToAlpha)&&a.colorToAlphaThreshold>0){let p=a.colorToAlpha;f.x=p.red,f.y=p.green,f.z=p.blue,f.w=a.colorToAlphaThreshold}else f.w=-1}return i}static _setImageryUniforms(t,n){for(let i in n)if(n.hasOwnProperty(i)){let o=`u_${i}`;t[o]=function(){return n[i]}}}static _createImageryInputs(t,n,i){let o=[];for(let r=0;r<t.length;r++){let a=t.get(r);if(!a.show)continue;let s=i[r],u=n.mappedPositionsForImageryLayer(a).cartographicBoundingRectangle,f=n.coveragesForImageryLayer(a);for(let h=0;h<f.length;h++){let p=f[h],A=e._createImageryInput(a,p,u,s);l(A)&&o.push(A)}}return o}static _createImageryInput(t,n,i,o){let r=n.imagery;if(r.state===Vn.FAILED||r.state===Vn.INVALID)return;let a=r.textureWebMercator;if(!l(a)&&(a=r.texture,!l(a))){r.state===Vn.READY&&console.log(`Imagery at ${n.x}, ${n.y} (level ${n.level}) does not have any texture - state ${r.state}`);return}let s=e._computeTextureTranslationAndScale(t,i,r.rectangle),c=n.textureCoordinateRectangle,u=new ie(c.minX,c.minY,c.maxX,c.maxY);return new dO(t,a,s,u,o)}static _computeTextureTranslationAndScale(t,n,i){let o=t.imageryProvider.tilingScheme,r=o.rectangleToNativeRectangle(n,zXe),a=o.rectangleToNativeRectangle(i,GXe);return e._computeTextureTranslationAndScaleFromNative(r,a)}static _computeTextureTranslationAndScaleFromNative(t,n){let i=1/n.width,o=1/n.height,r=t.west-n.west,a=t.south-n.south,s=r*i,c=a*o,u=t.width*i,f=t.height*o;return new ie(s,c,u,f)}static _computeIndexMapping(t,n){let i=[],o=t.length;for(let r=0;r<o;r++){let a=t[r],s=n.indexOf(a);i.push(s)}return i}},hO=EK;var mO=`#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);
return iblColor;
#endif
return vec3(0.0);
}
#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;
#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 VXe={UNLIT:0,PBR:1},Tp=Object.freeze(VXe);var nme={name:"LightingPipelineStage"};nme.process=function(e,t){let{model:n,lightingOptions:i,shaderBuilder:o}=e;if(l(n.lightColor)){o.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,he.FRAGMENT),o.addUniform("vec3","model_lightColorHdr",he.FRAGMENT);let a=e.uniformMap;a.model_lightColorHdr=function(){return n.lightColor}}let{lightingModel:r}=i;r===Tp.PBR?o.addDefine("LIGHTING_PBR",void 0,he.FRAGMENT):o.addDefine("LIGHTING_UNLIT",void 0,he.FRAGMENT),o.addFragmentLines(mO)};var pO=nme;var AO=`// 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;
}
#ifdef HAS_NORMAL_TEXTURE
vec2 getNormalTexCoords()
{
vec2 texCoord = TEXCOORD_NORMAL;
#ifdef HAS_NORMAL_TEXTURE_TRANSFORM
texCoord = czm_computeTextureTransform(texCoord, u_normalTextureTransform);
#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;
#if defined(HAS_NORMAL_CONSTANT_LOD) && defined(HAS_CONSTANT_LOD)
#ifdef HAS_NORMAL_TEXTURE_TRANSFORM
normalSample = constantLodTextureLookup(u_normalTexture, u_normalTextureConstantLodParams, u_normalTextureTransform).rgb;
#else
normalSample = constantLodTextureLookup(u_normalTexture, u_normalTextureConstantLodParams).rgb;
#endif
#else
normalSample = texture(u_normalTexture, normalTexCoords).rgb;
#endif
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;
#if defined(HAS_NORMAL_CONSTANT_LOD) && defined(HAS_CONSTANT_LOD)
#ifdef HAS_NORMAL_TEXTURE_TRANSFORM
normalSample = constantLodTextureLookup(u_normalTexture, u_normalTextureConstantLodParams, u_normalTextureTransform).rgb;
#else
normalSample = constantLodTextureLookup(u_normalTexture, u_normalTextureConstantLodParams).rgb;
#endif
#else
normalSample = texture(u_normalTexture, normalTexCoords).rgb;
#endif
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 = czm_computeTextureTransform(baseColorTexCoords, u_baseColorTextureTransform);
#endif
vec4 baseColorWithAlpha;
#if defined(HAS_BASE_COLOR_CONSTANT_LOD) && defined(HAS_CONSTANT_LOD)
#ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM
baseColorWithAlpha = czm_srgbToLinear(constantLodTextureLookup(u_baseColorTexture, u_baseColorTextureConstantLodParams, u_baseColorTextureTransform));
#else
baseColorWithAlpha = czm_srgbToLinear(constantLodTextureLookup(u_baseColorTexture, u_baseColorTextureConstantLodParams));
#endif
#else
baseColorWithAlpha = czm_srgbToLinear(texture(u_baseColorTexture, baseColorTexCoords));
#endif
#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 = czm_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 = czm_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 = czm_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 = czm_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 = czm_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 = czm_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 = czm_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 = czm_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 = czm_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_IMAGERY
baseColorWithAlpha = blendBaseColorWithImagery(baseColorWithAlpha);
#endif // HAS_IMAGERY
#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 = czm_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 gO=`#ifdef HAS_CONSTANT_LOD
// Extract model scale to compensate for minimumPixelSize scaling
float modelScaleX = length(czm_model[0].xyz);
float modelScaleY = length(czm_model[1].xyz);
float modelScaleZ = length(czm_model[2].xyz);
float modelScale = (modelScaleX + modelScaleY + modelScaleZ) / 3.0;
// Transform model position through ENU but as direction only (w=0) to avoid position-dependent rotation
vec3 enuDir = (u_constantLodWorldToEnu * czm_model * vec4(v_positionMC, 0.0)).xyz;
v_constantLodUvCustom.xy = (enuDir.yx + u_constantLodOffset) / modelScale;
v_constantLodUvCustom.z = u_constantLodDistance / modelScale;
#endif`;var _O=`#ifdef HAS_CONSTANT_LOD
vec4 constantLodTextureLookup(sampler2D textureSampler, vec3 constantLodParams) {
bool atMaxClamp = v_constantLodUvCustom.z >= constantLodParams.y;
bool atMinClamp = v_constantLodUvCustom.z <= constantLodParams.x;
bool atClampBoundary = atMaxClamp || atMinClamp;
float effectiveDistance = atMaxClamp ? constantLodParams.y :
(atMinClamp ? constantLodParams.x : v_constantLodUvCustom.z);
float logDepth = log2(effectiveDistance);
logDepth = clamp(logDepth, -10.0, 20.0);
float f = fract(logDepth);
float p = floor(logDepth);
if (atClampBoundary) {
float clampedP = ceil(logDepth);
vec2 tc = v_constantLodUvCustom.xy / pow(2.0, clampedP) * constantLodParams.z;
return texture(textureSampler, tc);
}
vec2 tc1 = v_constantLodUvCustom.xy / pow(2.0, p) * constantLodParams.z;
vec2 tc2 = v_constantLodUvCustom.xy / pow(2.0, p + 1.0) * constantLodParams.z;
return mix(texture(textureSampler, tc1), texture(textureSampler, tc2), f);
}
vec4 constantLodTextureLookup(sampler2D textureSampler, vec3 constantLodParams, mat3 textureTransform) {
bool atMaxClamp = v_constantLodUvCustom.z >= constantLodParams.y;
bool atMinClamp = v_constantLodUvCustom.z <= constantLodParams.x;
bool atClampBoundary = atMaxClamp || atMinClamp;
float effectiveDistance = atMaxClamp ? constantLodParams.y :
(atMinClamp ? constantLodParams.x : v_constantLodUvCustom.z);
float logDepth = log2(effectiveDistance);
logDepth = clamp(logDepth, -10.0, 20.0);
float f = fract(logDepth);
float p = floor(logDepth);
if (atClampBoundary) {
float clampedP = ceil(logDepth);
vec2 tc = v_constantLodUvCustom.xy / pow(2.0, clampedP) * constantLodParams.z;
// Apply texture transform to the final texture coordinates
tc = czm_computeTextureTransform(tc, textureTransform);
return texture(textureSampler, tc);
}
vec2 tc1 = v_constantLodUvCustom.xy / pow(2.0, p) * constantLodParams.z;
vec2 tc2 = v_constantLodUvCustom.xy / pow(2.0, p + 1.0) * constantLodParams.z;
// Apply texture transform to both LOD texture coordinates before mixing
tc1 = czm_computeTextureTransform(tc1, textureTransform);
tc2 = czm_computeTextureTransform(tc2, textureTransform);
return mix(texture(textureSampler, tc1), texture(textureSampler, tc2), f);
}
#endif
`;var{Material:HXe,MetallicRoughness:bK,SpecularGlossiness:IK,Specular:ime,Clearcoat:ome}=Cn,rme={name:"MaterialPipelineStage",_processTexture:Mu,_processTextureTransform:ame};rme.process=function(e,t,n){let i=t.material,{model:o,uniformMap:r,shaderBuilder:a}=e;l(r.u_constantLodDistance)||(r.u_constantLodDistance=function(){let C=o.boundingSphere,E=n.camera;if(l(C)&&l(E)){let b=d.distance(E.positionWC,C.center);return Math.max(b,.1)}return 1});let s=l(o.classificationType),c=s,{defaultTexture:u,defaultNormalTexture:f,defaultEmissiveTexture:h}=n.context;qXe(i,r,a,u,f,h,c,e),l(i.specularGlossiness)?KXe(i.specularGlossiness,r,a,u,c,e):(l(i.specular)&&xt.supportedExtensions.KHR_materials_specular&&XXe(i.specular,r,a,u,c),l(i.anisotropy)&&xt.supportedExtensions.KHR_materials_anisotropy&&ZXe(i.anisotropy,r,a,u,c),l(i.clearcoat)&&xt.supportedExtensions.KHR_materials_clearcoat&&$Xe(i.clearcoat,r,a,u,c),eJe(i.metallicRoughness,r,a,u,c,e));let p=xt.getAttributeBySemantic(t,at.NORMAL),A=l(o.pointCloudShading)&&!o.pointCloudShading.normalShading,m=e.lightingOptions;i.unlit||!p||s||A?m.lightingModel=Tp.UNLIT:m.lightingModel=Tp.PBR;let _=o.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=_;let y=e.alphaOptions;i.alphaMode===yp.BLEND?y.pass=Be.TRANSLUCENT:i.alphaMode===yp.MASK&&(y.alphaCutoff=i.alphaCutoff),l(i.pointDiameter)&&(a.addDefine("HAS_POINT_DIAMETER",void 0,he.BOTH),a.addUniform("float","u_pointDiameter",he.VERTEX),r.u_pointDiameter=function(){return i.pointDiameter*n.pixelRatio}),l(i.lineStyle)&&jXe(i.lineStyle,t,n,r,a),a.addFragmentLines(AO),i.doubleSided&&a.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,he.BOTH)};function WXe(e,t,n,i,o,r){let a=n.constantLod;if(!l(a)||!l(r))return;let s=`HAS_${o}_CONSTANT_LOD`;if(e.addDefine(s,void 0,he.BOTH),!l(t.u_constantLodOffset)){e.addDefine("HAS_CONSTANT_LOD",void 0,he.BOTH),e.addVarying("vec3","v_constantLodUvCustom"),e.addUniform("vec2","u_constantLodOffset",he.VERTEX),e.addUniform("float","u_constantLodDistance",he.VERTEX),e.addUniform("mat4","u_constantLodWorldToEnu",he.VERTEX),e.addFragmentLines(_O);let u=gO.split(`
`).filter(f=>!f.trim().startsWith("//")||f.includes("#"));e.addFunctionLines("setDynamicVaryingsVS",u)}let c=`${i}ConstantLodParams`;if(e.addUniform("vec3",c,he.FRAGMENT),t[c]=function(){return new d(a.minClampDistance,a.maxClampDistance,a.repetitions)},!l(t.u_constantLodOffset)){t.u_constantLodOffset=function(){return a.offset};let u=M.clone(M.IDENTITY),f=!1;t.u_constantLodWorldToEnu=function(){if(!f){let h=r.model.boundingSphere;if(l(h)){let p=h.center,A=At.eastNorthUpToFixedFrame(p);M.inverse(A,u),f=!0}}return f?u:M.IDENTITY}}}function jXe(e,t,n,i,o){let{width:r,pattern:a}=e;l(r)&&(o.addUniform("float","u_lineWidth",he.VERTEX),i.u_lineWidth=function(){return r*n.pixelRatio}),l(a)&&(o.addDefine("HAS_LINE_PATTERN",void 0,he.BOTH),o.addUniform("float","u_linePattern",he.FRAGMENT),o.addVarying("float","v_lineCoord"),i.u_linePattern=function(){return a});let s=xt.getAttributeBySemantic(t,at.CUMULATIVE_DISTANCE);if(l(a)&&l(s)&&(t.primitiveType===ve.LINES||t.primitiveType===ve.TRIANGLE_STRIP)){o.addDefine("HAS_LINE_CUMULATIVE_DISTANCE",void 0,he.VERTEX),s.normalized&&o.addDefine("LINE_CUM_DIST_NORMALIZED",void 0,he.VERTEX),o.addUniform("float","u_cumulativeDistanceMax",he.VERTEX),o.addUniform("float","u_pixelsPerWorld",he.VERTEX);let c=l(s.max)?s.max:1;i.u_cumulativeDistanceMax=function(){return c},i.u_pixelsPerWorld=function(){let f=n.camera.frustum,h=1,p;return l(f.right)&&l(f.left)?p=f.right-f.left:l(f.width)&&(p=f.width),l(p)&&p>0&&(h=n.context.drawingBufferWidth/p),h};let u=xt.getAttributeInfo(s).variableName;o.addVertexLines(`
#ifdef HAS_LINE_CUMULATIVE_DISTANCE
void lineStyleStageVS(in ProcessedAttributes attributes)
{
float cumDist = attributes.${u};
#ifdef LINE_CUM_DIST_NORMALIZED
cumDist *= u_cumulativeDistanceMax;
#endif
const float textureCoordinateBase = 8192.0;
v_lineCoord = textureCoordinateBase + cumDist * u_pixelsPerWorld;
}
#endif
`)}else l(a)&&o.addVertexLines(`
#ifdef HAS_LINE_PATTERN
void lineStyleStageVS(in ProcessedAttributes attributes)
{
vec4 posClip = gl_Position;
vec2 screenPos = ((posClip.xy / posClip.w) * 0.5 + 0.5) * czm_viewport.zw;
const float textureCoordinateBase = 8192.0;
if (czm_viewport.z > czm_viewport.w) {
v_lineCoord = textureCoordinateBase + screenPos.x;
} else {
v_lineCoord = textureCoordinateBase + screenPos.y;
}
}
#endif
`)}function ame(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_TRANSFORM`;e.addDefine(r,void 0,he.FRAGMENT);let a=`${i}Transform`;e.addUniform("mat3",a,he.FRAGMENT),t[a]=function(){return n.transform}}function YXe(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_SCALE`;e.addDefine(r,void 0,he.FRAGMENT);let a=`${i}Scale`;e.addUniform("float",a,he.FRAGMENT),t[a]=function(){return n.scale}}function Mu(e,t,n,i,o,r,a){e.addUniform("sampler2D",i,he.FRAGMENT),t[i]=function(){return n.texture??r};let s=`HAS_${o}_TEXTURE`;e.addDefine(s,void 0,he.FRAGMENT);let u=`v_texCoord_${n.texCoord}`,f=`TEXCOORD_${o}`;e.addDefine(f,u,he.FRAGMENT);let h=n.transform;l(h)&&!J.equals(h,J.IDENTITY)&&ame(e,t,n,i,o);let{scale:p}=n;l(p)&&p!==1&&YXe(e,t,n,i,o),WXe(e,t,n,i,o,a)}function qXe(e,t,n,i,o,r,a,s){let{emissiveFactor:c,emissiveTexture:u,normalTexture:f,occlusionTexture:h}=e;l(c)&&!d.equals(c,HXe.DEFAULT_EMISSIVE_FACTOR)&&(n.addUniform("vec3","u_emissiveFactor",he.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},n.addDefine("HAS_EMISSIVE_FACTOR",void 0,he.FRAGMENT),l(u)&&!a&&Mu(n,t,u,"u_emissiveTexture","EMISSIVE",r));let p;if(l(e.metallicRoughness)&&l(e.metallicRoughness.baseColorTexture)&&l(e.metallicRoughness.baseColorTexture.constantLod)?p=e.metallicRoughness.baseColorTexture.constantLod:l(e.specularGlossiness)&&l(e.specularGlossiness.diffuseTexture)&&l(e.specularGlossiness.diffuseTexture.constantLod)&&(p=e.specularGlossiness.diffuseTexture.constantLod),l(f)&&!a){let A=f;l(f.constantLod)&&l(p)&&(A=Object.create(Object.getPrototypeOf(f)),Object.assign(A,f),A.constantLod=p),Mu(n,t,A,"u_normalTexture","NORMAL",o,s)}l(h)&&!a&&Mu(n,t,h,"u_occlusionTexture","OCCLUSION",i)}function KXe(e,t,n,i,o,r){let{diffuseTexture:a,diffuseFactor:s,specularGlossinessTexture:c,specularFactor:u,glossinessFactor:f}=e;n.addDefine("USE_SPECULAR_GLOSSINESS",void 0,he.FRAGMENT),l(a)&&!o&&Mu(n,t,a,"u_diffuseTexture","DIFFUSE",i,r),l(s)&&!ie.equals(s,IK.DEFAULT_DIFFUSE_FACTOR)&&(n.addUniform("vec4","u_diffuseFactor",he.FRAGMENT),t.u_diffuseFactor=function(){return e.diffuseFactor},n.addDefine("HAS_DIFFUSE_FACTOR",void 0,he.FRAGMENT)),l(c)&&!o&&Mu(n,t,c,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i),l(u)&&!d.equals(u,IK.DEFAULT_SPECULAR_FACTOR)&&(n.addUniform("vec3","u_legacySpecularFactor",he.FRAGMENT),t.u_legacySpecularFactor=function(){return e.specularFactor},n.addDefine("HAS_LEGACY_SPECULAR_FACTOR",void 0,he.FRAGMENT)),l(f)&&f!==IK.DEFAULT_GLOSSINESS_FACTOR&&(n.addUniform("float","u_glossinessFactor",he.FRAGMENT),t.u_glossinessFactor=function(){return e.glossinessFactor},n.addDefine("HAS_GLOSSINESS_FACTOR",void 0,he.FRAGMENT))}function XXe(e,t,n,i,o){let{specularTexture:r,specularFactor:a,specularColorTexture:s,specularColorFactor:c}=e;n.addDefine("USE_SPECULAR",void 0,he.FRAGMENT),l(r)&&!o&&Mu(n,t,r,"u_specularTexture","SPECULAR",i),l(a)&&a!==ime.DEFAULT_SPECULAR_FACTOR&&(n.addUniform("float","u_specularFactor",he.FRAGMENT),t.u_specularFactor=function(){return e.specularFactor},n.addDefine("HAS_SPECULAR_FACTOR",void 0,he.FRAGMENT)),l(s)&&!o&&Mu(n,t,s,"u_specularColorTexture","SPECULAR_COLOR",i),l(c)&&!d.equals(c,ime.DEFAULT_SPECULAR_COLOR_FACTOR)&&(n.addUniform("vec3","u_specularColorFactor",he.FRAGMENT),t.u_specularColorFactor=function(){return e.specularColorFactor},n.addDefine("HAS_SPECULAR_COLOR_FACTOR",void 0,he.FRAGMENT))}var JXe=new d;function ZXe(e,t,n,i,o){let{anisotropyStrength:r,anisotropyRotation:a,anisotropyTexture:s}=e;n.addDefine("USE_ANISOTROPY",void 0,he.FRAGMENT),l(s)&&!o&&Mu(n,t,s,"u_anisotropyTexture","ANISOTROPY",i);let c=Math.cos(a),u=Math.sin(a);n.addUniform("vec3","u_anisotropy",he.FRAGMENT),t.u_anisotropy=function(){return d.fromElements(c,u,r,JXe)}}function $Xe(e,t,n,i,o){let{clearcoatFactor:r,clearcoatTexture:a,clearcoatRoughnessFactor:s,clearcoatRoughnessTexture:c,clearcoatNormalTexture:u}=e;n.addDefine("USE_CLEARCOAT",void 0,he.FRAGMENT),l(r)&&r!==ome.DEFAULT_CLEARCOAT_FACTOR&&(n.addUniform("float","u_clearcoatFactor",he.FRAGMENT),t.u_clearcoatFactor=function(){return e.clearcoatFactor},n.addDefine("HAS_CLEARCOAT_FACTOR",void 0,he.FRAGMENT)),l(a)&&!o&&Mu(n,t,a,"u_clearcoatTexture","CLEARCOAT",i),l(s)&&r!==ome.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_clearcoatRoughnessFactor",he.FRAGMENT),t.u_clearcoatRoughnessFactor=function(){return e.clearcoatRoughnessFactor},n.addDefine("HAS_CLEARCOAT_ROUGHNESS_FACTOR",void 0,he.FRAGMENT)),l(c)&&!o&&Mu(n,t,c,"u_clearcoatRoughnessTexture","CLEARCOAT_ROUGHNESS",i),l(u)&&!o&&Mu(n,t,u,"u_clearcoatNormalTexture","CLEARCOAT_NORMAL",i)}function eJe(e,t,n,i,o,r){n.addDefine("USE_METALLIC_ROUGHNESS",void 0,he.FRAGMENT);let a=e.baseColorTexture;l(a)&&!o&&Mu(n,t,a,"u_baseColorTexture","BASE_COLOR",i,r);let s=e.baseColorFactor;l(s)&&!ie.equals(s,bK.DEFAULT_BASE_COLOR_FACTOR)&&(n.addUniform("vec4","u_baseColorFactor",he.FRAGMENT),t.u_baseColorFactor=function(){return e.baseColorFactor},n.addDefine("HAS_BASE_COLOR_FACTOR",void 0,he.FRAGMENT));let c=e.metallicRoughnessTexture;l(c)&&!o&&Mu(n,t,c,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let u=e.metallicFactor;l(u)&&u!==bK.DEFAULT_METALLIC_FACTOR&&(n.addUniform("float","u_metallicFactor",he.FRAGMENT),t.u_metallicFactor=function(){return e.metallicFactor},n.addDefine("HAS_METALLIC_FACTOR",void 0,he.FRAGMENT));let f=e.roughnessFactor;l(f)&&f!==bK.DEFAULT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_roughnessFactor",he.FRAGMENT),t.u_roughnessFactor=function(){return e.roughnessFactor},n.addDefine("HAS_ROUGHNESS_FACTOR",void 0,he.FRAGMENT))}var yO=rme;var Kl={name:"MetadataPickingPipelineStage",METADATA_PICKING_ENABLED:"METADATA_PICKING_ENABLED",METADATA_PICKING_VALUE_TYPE:"METADATA_PICKING_VALUE_TYPE",METADATA_PICKING_VALUE_STRING:"METADATA_PICKING_VALUE_STRING",METADATA_PICKING_VALUE_COMPONENT_X:"METADATA_PICKING_VALUE_COMPONENT_X",METADATA_PICKING_VALUE_COMPONENT_Y:"METADATA_PICKING_VALUE_COMPONENT_Y",METADATA_PICKING_VALUE_COMPONENT_Z:"METADATA_PICKING_VALUE_COMPONENT_Z",METADATA_PICKING_VALUE_COMPONENT_W:"METADATA_PICKING_VALUE_COMPONENT_W"};Kl.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine(Kl.METADATA_PICKING_VALUE_TYPE,"float",he.FRAGMENT),i.addDefine(Kl.METADATA_PICKING_VALUE_STRING,"0.0",he.FRAGMENT),i.addDefine(Kl.METADATA_PICKING_VALUE_COMPONENT_X,"0.0",he.FRAGMENT),i.addDefine(Kl.METADATA_PICKING_VALUE_COMPONENT_Y,"0.0",he.FRAGMENT),i.addDefine(Kl.METADATA_PICKING_VALUE_COMPONENT_Z,"0.0",he.FRAGMENT),i.addDefine(Kl.METADATA_PICKING_VALUE_COMPONENT_W,"0.0",he.FRAGMENT),i.addFunction("metadataPickingStage","void metadataPickingStage(Metadata metadata, MetadataClass metadataClass, inout vec4 metadataValues)",he.FRAGMENT),i.addFunctionLines("metadataPickingStage",[`${Kl.METADATA_PICKING_VALUE_TYPE} value = ${Kl.METADATA_PICKING_VALUE_TYPE}(${Kl.METADATA_PICKING_VALUE_STRING});`,`metadataValues.x = ${Kl.METADATA_PICKING_VALUE_COMPONENT_X};`,`metadataValues.y = ${Kl.METADATA_PICKING_VALUE_COMPONENT_Y};`,`metadataValues.z = ${Kl.METADATA_PICKING_VALUE_COMPONENT_Z};`,`metadataValues.w = ${Kl.METADATA_PICKING_VALUE_COMPONENT_W};`],he.FRAGMENT)};var If=Kl;var CO=`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 Pc={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)"};Pc.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,he.VERTEX),aJe(n);let i=t.morphTargets.length;for(let s=0;s<i;s++){let c=t.morphTargets[s].attributes,u=c.length;for(let f=0;f<u;f++){let h=c[f],p=h.semantic;p!==at.POSITION&&p!==at.NORMAL&&p!==at.TANGENT||(nJe(e,h,e.attributeIndex,s),e.attributeIndex++)}}sJe(n);let r=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${r}]`,he.VERTEX),n.addVertexLines(CO);let a={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=Pt(a,e.uniformMap)};var tJe={attributeString:void 0,functionId:void 0};function nJe(e,t,n,i){let o=e.shaderBuilder;iJe(e,t,n);let r=oJe(t,tJe);rJe(o,r,i)}function iJe(e,t,n){let i={index:n,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,componentsPerAttribute:Ut.getNumberOfComponents(t.type),componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(i)}function oJe(e,t){switch(e.semantic){case at.POSITION:t.attributeString="Position",t.functionId=Pc.FUNCTION_ID_GET_MORPHED_POSITION;break;case at.NORMAL:t.attributeString="Normal",t.functionId=Pc.FUNCTION_ID_GET_MORPHED_NORMAL;break;case at.TANGENT:t.attributeString="Tangent",t.functionId=Pc.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function rJe(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 aJe(e){e.addFunction(Pc.FUNCTION_ID_GET_MORPHED_POSITION,Pc.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,he.VERTEX),e.addFunctionLines(Pc.FUNCTION_ID_GET_MORPHED_POSITION,["vec3 morphedPosition = position;"]),e.addFunction(Pc.FUNCTION_ID_GET_MORPHED_NORMAL,Pc.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,he.VERTEX),e.addFunctionLines(Pc.FUNCTION_ID_GET_MORPHED_NORMAL,["vec3 morphedNormal = normal;"]),e.addFunction(Pc.FUNCTION_ID_GET_MORPHED_TANGENT,Pc.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,he.VERTEX),e.addFunctionLines(Pc.FUNCTION_ID_GET_MORPHED_TANGENT,["vec3 morphedTangent = tangent;"])}function sJe(e){e.addFunctionLines(Pc.FUNCTION_ID_GET_MORPHED_POSITION,["return morphedPosition;"]),e.addFunctionLines(Pc.FUNCTION_ID_GET_MORPHED_NORMAL,["return morphedNormal;"]),e.addFunctionLines(Pc.FUNCTION_ID_GET_MORPHED_TANGENT,["return morphedTangent;"])}var EO=Pc;var sme={name:"PickingPipelineStage"};sme.process=function(e,t,n){let i=n.context,o=e.runtimeNode,r=e.shaderBuilder,a=e.model,s=o.node.instances;if(e.hasPropertyTable)cJe(e,t,s,i);else if(l(s))lJe(e,i);else{let c=cme(e),u=i.createPickId(c);a._pipelineResources.push(u),a._pickIds.push(u),r.addUniform("vec4","czm_pickColor",he.FRAGMENT);let f=e.uniformMap;f.czm_pickColor=function(){return u.color},e.pickId="czm_pickColor"}};function cme(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(Fr.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 cJe(e,t,n){let i=e.model,o,r,a=i.featureIdLabel,s=i.instanceFeatureIdLabel;l(i.featureTableId)?o=i.featureTableId:l(n)?(r=xt.getFeatureIdsByLabel(n.featureIds,s),o=r.propertyTableId):(r=xt.getFeatureIdsByLabel(t.featureIds,a),o=r.propertyTableId);let c=i.featureTables[o];e.shaderBuilder.addUniform("sampler2D","model_pickTexture",he.FRAGMENT);let f=c.batchTexture;e.uniformMap.model_pickTexture=function(){return f.pickTexture??f.defaultTexture},e.pickId="((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))"}function lJe(e,t){let n=e.instanceCount,i=new Array(n),o=new Uint8Array(n*4),r=e.model,a=r._pipelineResources;for(let h=0;h<n;h++){let p=cme(e,h),A=t.createPickId(p);a.push(A),i[h]=A;let m=A.color;o[h*4+0]=z.floatToByte(m.red),o[h*4+1]=z.floatToByte(m.green),o[h*4+2]=z.floatToByte(m.blue),o[h*4+3]=z.floatToByte(m.alpha)}r._pickIds=i;let s=tt.createVertexBuffer({context:t,typedArray:o,usage:Re.STATIC_DRAW});s.vertexArrayDestroyable=!1,r.statistics.addBuffer(s,!1),a.push(s);let u={index:e.attributeIndex++,vertexBuffer:s,componentsPerAttribute:4,componentDatatype:j.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1};e.attributes.push(u);let f=e.shaderBuilder;f.addDefine("USE_PICKING",void 0,he.BOTH),f.addAttribute("vec4","a_pickColor"),f.addVarying("vec4","v_pickColor"),e.pickId="v_pickColor"}var bO=sme;var uJe={ADD:0,REPLACE:1},mr=Object.freeze(uJe);var IO=`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 fJe=new ie,ume={name:"PointCloudStylingPipelineStage"};ume.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=o.style,a=o.structuralMetadata,s=l(a)?a.propertyAttributes:void 0,c=l(o.featureTableId)&&o.featureTables[o.featureTableId].featuresLength>0,u=!l(s)&&c;if(l(r)&&!u){let _=pJe(s),y=AJe(r,_);gJe(i,y);let E=_Je(y).indexOf("normalMC")>=0,b=xt.getAttributeBySemantic(t,at.NORMAL);if(E&&!b)throw new ue("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,he.VERTEX),y.styleTranslucent&&(e.alphaOptions.pass=Be.TRANSLUCENT)}let f=o.pointCloudShading;f.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,he.VERTEX),f.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,he.VERTEX);let h,p,A;Fr.is3DTiles(o.type)&&(p=!0,h=o.content,A=h.tile.refine===mr.ADD),i.addUniform("vec4","model_pointCloudParameters",he.VERTEX),i.addVertexLines(IO);let m=e.uniformMap;m.model_pointCloudParameters=function(){let _=fJe,y=1;p&&(y=A?5:h.tileset.memoryAdjustedScreenSpaceError),_.x=f.maximumAttenuation??y,_.x*=n.pixelRatio;let C=dJe(e,t,f,h);_.y=C*f.geometricErrorScale;let E=n.context,b=n.camera.frustum,x;return n.mode===oe.SCENE2D||b instanceof An?x=Number.POSITIVE_INFINITY:x=E.drawingBufferHeight/n.camera.frustum.sseDenominator,_.z=x,p&&(_.w=h.tileset.timeSinceLoad),_}};var lme=new d;function dJe(e,t,n,i){if(l(i)){let f=i.tile.geometricError;if(f>0)return f}if(l(n.baseResolution))return n.baseResolution;let o=xt.getAttributeBySemantic(t,at.POSITION),r=o.count,a=e.runtimeNode.transform,s=d.subtract(o.max,o.min,lme);s=M.multiplyByPointAsVector(a,s,lme);let c=s.x*s.y*s.z;return D.cbrt(c/r)}var hJe={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},mJe={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function pJe(e){let t=je(mJe);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 xK="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function AJe(e,t){let n=hJe,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${xK})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${xK})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${xK})`,t,i),n.styleTranslucent=l(n.colorStyleFunction)&&i.translucent,n}function gJe(e,t){let n=t.colorStyleFunction;l(n)&&(e.addDefine("HAS_POINT_CLOUD_COLOR_STYLE",void 0,he.BOTH),e.addVertexLines(n),e.addVarying("vec4","v_pointCloudColor"));let i=t.showStyleFunction;l(i)&&(e.addDefine("HAS_POINT_CLOUD_SHOW_STYLE",void 0,he.BOTH),e.addVertexLines(i),e.addVarying("float","v_pointCloudShow"));let o=t.pointSizeStyleFunction;l(o)&&(e.addDefine("HAS_POINT_CLOUD_POINT_SIZE_STYLE",void 0,he.VERTEX),e.addVertexLines(o))}function TK(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 _Je(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,o=[];return l(t)&&TK(t,o),l(n)&&TK(n,o),l(i)&&TK(i,o),o}var xO=ume;var TO=`void primitiveOutlineStage() {
v_outlineCoordinates = a_outlineCoordinates;
}
`;var SO=`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 fme={name:"PrimitiveOutlinePipelineStage"};fme.process=function(e,t,n){let i=e.shaderBuilder,o=e.uniformMap;i.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,he.BOTH),i.addAttribute("vec3","a_outlineCoordinates"),i.addVarying("vec3","v_outlineCoordinates");let r=t.outlineCoordinates,a={index:e.attributeIndex++,vertexBuffer:r.buffer,componentsPerAttribute:Ut.getNumberOfComponents(r.type),componentDatatype:r.componentDatatype,offsetInBytes:r.byteOffset,strideInBytes:r.byteStride,normalize:r.normalized};e.attributes.push(a),i.addUniform("sampler2D","model_outlineTexture",he.FRAGMENT);let s=B0.createTexture(n.context);o.model_outlineTexture=function(){return s};let c=e.model;i.addUniform("vec4","model_outlineColor",he.FRAGMENT),o.model_outlineColor=function(){return c.outlineColor},i.addUniform("bool","model_showOutline",he.FRAGMENT),o.model_showOutline=function(){return c.showOutline},i.addVertexLines(TO),i.addFragmentLines(SO)};var wO=fme;var dme={name:"PrimitiveStatisticsPipelineStage",_countGeometry:hme,_count2DPositions:mme,_countMorphTargetAttributes:pme,_countMaterialTextures:Ame,_countFeatureIdTextures:gme,_countBinaryMetadata:_me};dme.process=function(e,t,n){let i=e.model,o=i.statistics;hme(o,t),mme(o,e.runtimePrimitive),pme(o,t),Ame(o,t.material),gme(o,t.featureIds),_me(o,i)};function hme(e,t){let n=l(t.indices)?t.indices.count:xt.getAttributeBySemantic(t,"POSITION").count,i=t.primitiveType;i===ve.POINTS?e.pointsLength+=n:ve.isTriangles(i)&&(e.trianglesLength+=yJe(i,n));let o=t.attributes,r=o.length;for(let c=0;c<r;c++){let u=o[c];if(l(u.buffer)){let f=l(u.typedArray);e.addBuffer(u.buffer,f)}}let a=t.outlineCoordinates;l(a)&&l(a.buffer)&&e.addBuffer(a.buffer,!1);let s=t.indices;if(l(s)&&l(s.buffer)){let c=l(s.typedArray);e.addBuffer(s.buffer,c)}}function yJe(e,t){switch(e){case ve.TRIANGLES:return t/3;case ve.TRIANGLE_STRIP:case ve.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function mme(e,t){let n=t.positionBuffer2D;l(n)&&e.addBuffer(n,!0)}function pme(e,t){let n=t.morphTargets;if(!l(n))return;let i=!1,o=n.length;for(let r=0;r<o;r++){let a=n[r].attributes,s=a.length;for(let c=0;c<s;c++){let u=a[c];l(u.buffer)&&e.addBuffer(u.buffer,i)}}}function Ame(e,t){let n=CJe(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 CJe(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 gme(e,t){let n=t.length;for(let i=0;i<n;i++){let o=t[i];if(o instanceof Cn.FeatureIdTexture){let r=o.textureReader;l(r.texture)&&e.addTexture(r.texture)}}}function _me(e,t){let n=t.structuralMetadata;l(n)&&(EJe(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 a=i[r];e.addBatchTexture(a.batchTexture)}}function EJe(e,t){let n=t.propertyTextures;if(!l(n))return;let i=n.length;for(let o=0;o<i;o++){let a=n[o].properties;for(let s in a)if(a.hasOwnProperty(s)){let u=a[s].textureReader;l(u.texture)&&e.addTexture(u.texture)}}}var BO=dme;var bJe=new M,IJe=new M,yme={name:"SceneMode2DPipelineStage"};yme.process=function(e,t,n){let i=xt.getAttributeBySemantic(t,at.POSITION),o=e.shaderBuilder,r=e.model,a=r.sceneGraph.computedModelMatrix,s=e.runtimeNode.computedTransform,c=M.multiplyTransformation(a,s,bJe),u=SJe(e,c,n),f=e.runtimePrimitive;f.boundingSphere2D=u;let h=e.runtimeNode.node.instances;if(l(h))return;if(l(i.typedArray)){let _=DJe(i,c,u,n);f.positionBuffer2D=_,r._modelResources.push(_),i.typedArray=void 0}o.addDefine("USE_2D_POSITIONS",void 0,he.VERTEX),o.addUniform("mat4","u_modelView2D",he.VERTEX);let p=M.fromTranslation(u.center,new M),A=n.context,m={u_modelView2D:function(){return M.multiplyTransformation(A.uniformState.view,p,IJe)}};e.uniformMap=Pt(m,e.uniformMap)};var xJe=new d,TJe=new d;function SJe(e,t,n){let i=M.multiplyByPoint(t,e.positionMin,xJe),o=so.computeActualEllipsoidPosition(n,i,i),r=M.multiplyByPoint(t,e.positionMax,TJe),a=so.computeActualEllipsoidPosition(n,r,r);return le.fromCornerPoints(o,a,new le)}var Cme=new d;function wJe(e,t){let n=e.length,i=new Float32Array(n),o=t.quantizedVolumeOffset,r=t.quantizedVolumeStepSize;for(let a=0;a<n;a+=3){let s=d.fromArray(e,a,Cme),c=d.multiplyComponents(s,r,s),u=d.add(c,o,c);i[a]=u.x,i[a+1]=u.y,i[a+2]=u.z}return i}function BJe(e,t,n,i){let o;l(e.quantization)?o=wJe(e.typedArray,e.quantization):o=e.typedArray.slice();let r=e.byteOffset/Float32Array.BYTES_PER_ELEMENT,a=o.length,s=l(e.byteStride)?e.byteStride/Float32Array.BYTES_PER_ELEMENT:3;for(let c=r;c<a;c+=s){let u=d.fromArray(o,c,Cme);if(isNaN(u.x)||isNaN(u.y)||isNaN(u.z))continue;let f=M.multiplyByPoint(t,u,u),h=so.computeActualEllipsoidPosition(i,f,f),p=d.subtract(h,n,h);o[c]=p.x,o[c+1]=p.y,o[c+2]=p.z}return o}function DJe(e,t,n,i){let o=je(i);o.mode=oe.COLUMBUS_VIEW;let r=n.center,a=BJe(e,t,r,o),s=tt.createVertexBuffer({context:i.context,typedArray:a,usage:Re.STATIC_DRAW});return s.vertexArrayDestroyable=!1,s}var DO=yme;var vO=`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 O0={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};O0.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,he.VERTEX),PJe(n,t);let i=e.runtimeNode,o=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${o.length}]`,he.VERTEX),n.addVertexLines(vO);let r={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=Pt(r,e.uniformMap)};function vJe(e){let t=-1,n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];(r.semantic===at.JOINTS||r.semantic===at.WEIGHTS)&&(t=Math.max(t,r.setIndex))}return t}function PJe(e,t){e.addFunction(O0.FUNCTION_ID_GET_SKINNING_MATRIX,O0.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,he.VERTEX),e.addFunctionLines(O0.FUNCTION_ID_GET_SKINNING_MATRIX,["mat4 skinnedMatrix = mat4(0);"]);let i,o,r=["x","y","z","w"],a=vJe(t);for(i=0;i<=a;i++)for(o=0;o<=3;o++){let c=r[o],u=`skinnedMatrix += a_weights_${i}.${c} * u_jointMatrices[int(a_joints_${i}.${c})];`;e.addFunctionLines(O0.FUNCTION_ID_GET_SKINNING_MATRIX,[u])}e.addFunctionLines(O0.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}var PO=O0;var RO=`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 Eme={name:"VerticalExaggerationPipelineStage"},RJe=new k;Eme.process=function(e,t,n){let{shaderBuilder:i,uniformMap:o}=e;i.addVertexLines(RO),i.addDefine("HAS_VERTICAL_EXAGGERATION",void 0,he.VERTEX),i.addUniform("vec2","u_verticalExaggerationAndRelativeHeight",he.VERTEX),o.u_verticalExaggerationAndRelativeHeight=function(){return k.fromElements(n.verticalExaggeration,n.verticalExaggerationRelativeHeight,RJe)}};var MO=Eme;var SK={};function MJe(e){let t=Ue.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 NJe(e,t){let n=t.length,i=Ue.createTypedArray(e,n*2),o=0;for(let r=0;r<n;r+=3){let a=t[r],s=t[r+1],c=t[r+2];i[o++]=a,i[o++]=s,i[o++]=s,i[o++]=c,i[o++]=c,i[o++]=a}return i}function LJe(e){let t=e-2,n=2+t*4,i=Ue.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 OJe(e,t){let i=t.length-2,o=2+i*4,r=Ue.createTypedArray(e,o),a=0;r[a++]=t[0],r[a++]=t[1];for(let s=0;s<i;s++){let c=t[s],u=t[s+1],f=t[s+2];r[a++]=u,r[a++]=f,r[a++]=f,r[a++]=c}return r}function FJe(e){let t=e-2,n=2+t*4,i=Ue.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 QJe(e,t){let i=t.length-2,o=2+i*4,r=Ue.createTypedArray(e,o),a=0,s=t[0];r[a++]=s,r[a++]=t[1];for(let c=0;c<i;c++){let u=t[c+1],f=t[c+2];r[a++]=u,r[a++]=f,r[a++]=f,r[a++]=s}return r}SK.createWireframeIndices=function(e,t,n){let i=l(n);if(e===ve.TRIANGLES)return i?NJe(t,n):MJe(t);if(e===ve.TRIANGLE_STRIP)return i?OJe(t,n):LJe(t);if(e===ve.TRIANGLE_FAN)return i?QJe(t,n):FJe(t)};SK.getWireframeIndicesCount=function(e,t){return e===ve.TRIANGLES?t*2:e===ve.TRIANGLE_STRIP||e===ve.TRIANGLE_FAN?2+(t-2)*4:t};var JT=SK;var bme={name:"WireframePipelineStage"};bme.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,he.FRAGMENT);let o=e.model,r=kJe(t,e.indices,n);o._pipelineResources.push(r),e.wireframeIndexBuffer=r,o.statistics.addBuffer(r,!1);let s=e.primitiveType,c=e.count;e.primitiveType=ve.LINES,e.count=JT.getWireframeIndicesCount(s,c)};function kJe(e,t,n){let o=xt.getAttributeBySemantic(e,at.POSITION).count,r=n.context.webgl2,a;if(l(t)){let f=t.buffer,h=t.count;l(f)&&r?(a=f.sizeInBytes===h?new Uint8Array(h):Ue.createTypedArray(o,h),f.getBufferData(a)):a=t.typedArray}let s=e.primitiveType,c=JT.createWireframeIndices(s,o,a),u=Ue.fromSizeInBytes(c.BYTES_PER_ELEMENT);return tt.createIndexBuffer({context:n.context,typedArray:c,usage:Re.STATIC_DRAW,indexDatatype:u})}var NO=bme;function Ime(e){e=e??V.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=[]}Ime.prototype.configurePipeline=function(e){let t=this.pipelineStages;t.length=0;let n=this.primitive,i=this.node,o=this.model,r=o.customShader;if(l(o._marsOptions)&&l(o._marsOptions.customShaders)){let g=bA.getCache(o._marsOptions.customShaders);for(let I in g)if(Object.prototype.hasOwnProperty.call(g,I)){r=g[I];break}}let a=o.style,s=e.context.webgl2,u=e.mode!==oe.SCENE3D&&!e.scene3DOnly&&o._projectTo2D,f=e.verticalExaggeration!==1&&o.hasVerticalExaggeration,h=l(n.morphTargets)&&n.morphTargets.length>0,p=l(i.skin),A=l(o.imageryLayers),m=l(r),y=!(m&&l(r.fragmentShaderText))||r.mode!==yg.REPLACE_MATERIAL,C=xt.hasQuantizedAttributes(n.attributes),E=o.debugWireframe&&ve.isTriangles(n.primitiveType)&&(o._enableDebugWireframe||s),b=o.pointCloudShading,x=l(b)&&b.attenuation,S=l(b)&&b.backFaceCulling,B=n.primitiveType===ve.POINTS&&(l(a)||x||S),v=o._enableShowOutline&&l(n.outlineCoordinates),P=l(n.edgeVisibility),N=UJe(o,i,n),L=l(o.classificationType);u&&t.push(DO),t.push(qL),E&&t.push(NO),L&&t.push(wL),h&&t.push(EO),p&&t.push(PO),B&&t.push(xO),C&&t.push(kL),A&&(v?It("outlines-and-draping","Primitive outlines disable imagery draping"):t.push(hO)),y&&t.push(yO),t.push(ky),t.push(vd),t.push(If),N.hasPropertyTable&&(t.push(zy),t.push(SL),t.push(vL)),f&&t.push(MO),m&&t.push(FL),t.push(pO),o.allowPicking&&t.push(bO),v&&t.push(wO),P&&(e.edgeVisibilityRequested=!0,t.push(HL),t.push(zL)),t.push(TL),t.push(BO)};function UJe(e,t,n){let i;return l(t.instances)&&(i=xt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(i))?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:(i=xt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),l(i)?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var LO=Ime;function wK(e){e=e??V.EMPTY_OBJECT,this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],zJe(this)}Object.defineProperties(wK.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 zJe(e){let t=e.skin,n=t.inverseBindMatrices;e._inverseBindMatrices=n;let i=t.joints,o=i.length,r=e.sceneGraph._runtimeNodes,a=e.joints,s=e._jointMatrices;for(let c=0;c<o;c++){let u=i[c].index,f=r[u];a.push(f);let h=n[c],p=xme(f,h,new M);s.push(p)}}function xme(e,t,n){let i=M.multiplyTransformation(e.transformToRoot,e.transform,n);return n=M.multiplyTransformation(i,t,n),n}wK.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]=xme(i,o,e[n])}};var OO=wK;function GJe(){this.pass=void 0,this.alphaCutoff=void 0}var F0=GJe;function VJe(e){this.shaderBuilder=new LA,this.model=e,this.uniformMap={},this.alphaOptions=new F0,this.renderStateOptions=Ve.getState(Ve.fromCache({depthTest:{enabled:!0,func:nc.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1,this.nodeRenderResources=[]}var FO=VJe;var QO=`void silhouetteStage(inout vec4 color) {
if(model_silhouettePass) {
color = czm_gammaCorrect(model_silhouetteColor);
}
}`;var kO=`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 I8={name:"ModelSilhouettePipelineStage"};I8.silhouettesLength=0;I8.process=function(e,t,n){l(t._silhouetteId)||(t._silhouetteId=++I8.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,he.BOTH),i.addVertexLines(kO),i.addFragmentLines(QO),i.addUniform("vec4","model_silhouetteColor",he.FRAGMENT),i.addUniform("float","model_silhouetteSize",he.VERTEX),i.addUniform("bool","model_silhouettePass",he.BOTH);let o={model_silhouetteColor:function(){return t.silhouetteColor},model_silhouetteSize:function(){return t.silhouetteSize},model_silhouettePass:function(){return!1}};e.uniformMap=Pt(o,e.uniformMap),e.hasSilhouette=!0};var UO=I8;var zO=`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 x8={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};x8.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,he.FRAGMENT),i.addFragmentLines(zO);let o={};i.addUniform("float",x8.SPLIT_DIRECTION_UNIFORM_NAME,he.FRAGMENT),o[x8.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=Pt(o,e.uniformMap)};var GO=x8;function HJe(e,t){this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=je(e.uniformMap),this.alphaOptions=je(e.alphaOptions),this.renderStateOptions=je(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,this.primitiveRenderResources=[]}var VO=HJe;function WJe(e){e=e??V.EMPTY_OBJECT,this.lightingModel=e.lightingModel??Tp.UNLIT}var HO=WJe;function jJe(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=je(e.uniformMap),this.alphaOptions=je(e.alphaOptions),this.renderStateOptions=je(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:xt.getAttributeBySemantic(n,"POSITION").count,this.hasPropertyTable=!1,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=xt.getPositionMinMax(n,this.runtimeNode.instancingTranslationMin,this.runtimeNode.instancingTranslationMax);this.positionMin=d.clone(i.min,new d),this.positionMax=d.clone(i.max,new d),this.boundingSphere=le.fromCornerPoints(this.positionMin,this.positionMax,new le),this.lightingOptions=new HO,this.pickId=void 0}var WO=jJe;function DK(e){e=e??V.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!==ei.CESIUM_3D_TILE,this._classifies3DTiles=o!==ei.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],XJe(this)}function YJe(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:wt.KEEP,zFail:wt.DECREMENT_WRAP,zPass:wt.KEEP},backFunction:e,backOperation:{fail:wt.KEEP,zFail:wt.INCREMENT_WRAP,zPass:wt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:nc.LESS_OR_EQUAL},depthMask:!1}}var qJe={stencilTest:{enabled:!0,frontFunction:ti.NOT_EQUAL,frontOperation:{fail:wt.ZERO,zFail:wt.ZERO,zPass:wt.ZERO},backFunction:ti.NOT_EQUAL,backOperation:{fail:wt.ZERO,zFail:wt.ZERO,zPass:wt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:sn.PRE_MULTIPLIED_ALPHA_BLEND},KJe={stencilTest:{enabled:!0,frontFunction:ti.NOT_EQUAL,frontOperation:{fail:wt.ZERO,zFail:wt.ZERO,zPass:wt.ZERO},backFunction:ti.NOT_EQUAL,backOperation:{fail:wt.ZERO,zFail:wt.ZERO,zPass:wt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},wme=[];function XJe(e){let t=e._command,n=wme;if(e._useDebugWireframe){t.pass=Be.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=jO(e,n,e._commandListDebugWireframe);let r=e._commandListDebugWireframe,a=r.length;for(let s=0;s<a;s++){let c=r[s];c.count*=2,c.offset*=2}return}let o=e.model.allowPicking;if(e._classifiesTerrain){let r=Be.TERRAIN_CLASSIFICATION,a=BK(t,r),s=Tme(t,r);n.length=0,n.push(a,s),e._commandListTerrain=jO(e,n,e._commandListTerrain),o&&(e._commandListTerrainPicking=Sme(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let r=Be.CESIUM_3D_TILE_CLASSIFICATION,a=BK(t,r),s=Tme(t,r);n.length=0,n.push(a,s),e._commandList3DTiles=jO(e,n,e._commandList3DTiles),o&&(e._commandList3DTilesPicking=Sme(e,n,e._commandList3DTilesPicking))}}function jO(e,t,n){let i=e._runtimePrimitive,o=i.batchLengths,r=i.batchOffsets,a=o.length,s=t.length;for(let c=0;c<a;c++){let u=o[c],f=r[c];for(let h=0;h<s;h++){let p=t[h],A=nt.shallowClone(p);A.count=u,A.offset=f,n.push(A)}}return n}function BK(e,t){let n=nt.shallowClone(e);n.cull=!1,n.pass=t;let i=t===Be.TERRAIN_CLASSIFICATION?ti.ALWAYS:ti.EQUAL,o=YJe(i);return n.renderState=Ve.fromCache(o),n}function Tme(e,t){let n=nt.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=Ve.fromCache(qJe),n}var JJe=[];function Sme(e,t,n){let i=Ve.fromCache(KJe),o=t[0],r=t[1],a=nt.shallowClone(o);a.cull=!0,a.pickOnly=!0;let s=nt.shallowClone(r);s.cull=!0,s.pickOnly=!0,s.renderState=i,s.pickId=e._pickId;let c=JJe;return c.length=0,c.push(a,s),jO(e,c,n)}Object.defineProperties(DK.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=M.clone(e,this._modelMatrix);let t=this._runtimePrimitive.boundingSphere;this._boundingVolume=le.transform(t,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace=e}}});DK.prototype.pushCommands=function(e,t){let n=e.passes;if(n.render){if(this._useDebugWireframe){oi(t,this._commandListDebugWireframe);return}if(this._classifiesTerrain&&oi(t,this._commandListTerrain),this._classifies3DTiles&&oi(t,this._commandList3DTiles),e.invertClassification&&this._classifies3DTiles){if(this._commandListIgnoreShow.length===0){let o=Be.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,r=BK(this._command,o),a=wme;a.length=0,a.push(r),this._commandListIgnoreShow=jO(this,a,this._commandListIgnoreShow)}oi(t,this._commandListIgnoreShow)}}return n.pick&&(this._classifiesTerrain&&oi(t,this._commandListTerrainPicking),this._classifies3DTiles&&oi(t,this._commandList3DTilesPicking)),t};var YO=DK;function qO(e){e=e??V.EMPTY_OBJECT;let t=e.command,n=e.primitiveRenderResources,i=n.model;this._model=i;let o=n.runtimePrimitive;this._runtimePrimitive=o,this._primitiveRenderResources=n;let r=t.pass===Be.TRANSLUCENT,s=!o.primitive.material.doubleSided&&!r,c=n.hasSilhouette,u=!r&&!c,f=n.hasSkipLevelOfDetail&&!r,h=c,p=l(n.edgeGeometry);this._command=t,this._modelMatrix=M.clone(t.modelMatrix),this._boundingVolume=le.clone(t.boundingVolume),this._modelMatrix2D=new M,this._boundingVolume2D=new le,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=s,this._needsTranslucentCommand=u,this._needsSkipLevelOfDetailCommands=f,this._needsSilhouetteCommands=h,this._needsEdgeCommands=p,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._edgeCommand=void 0,this._derivedCommands=[],this._has2DCommands=!1,ZJe(this)}function Sp(e){this.command=e.command,this.updateShadows=e.updateShadows,this.updateBackFaceCulling=e.updateBackFaceCulling,this.updateCullFace=e.updateCullFace,this.updateDebugShowBoundingVolume=e.updateDebugShowBoundingVolume,this.is2D=e.is2D??!1,this.derivedCommand2D=void 0}Sp.clone=function(e){return new Sp({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function ZJe(e){let t=e._command;t.modelMatrix=e._modelMatrix,t.boundingVolume=e._boundingVolume;let n=e._model,i=e._usesBackFaceCulling,o=e._derivedCommands;if(e._originalCommand=new Sp({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),o.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new Sp({command:r7e(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),o.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new Sp({command:d7e(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new Sp({command:h7e(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),o.push(e._skipLodBackfaceCommand),o.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new Sp({command:a7e(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new Sp({command:s7e(t,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._silhouetteModelCommand),o.push(e._silhouetteColorCommand)),e._needsEdgeCommands){let r=e._primitiveRenderResources;e._edgeCommand=new Sp({command:c7e(t,r,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._edgeCommand)}}Object.defineProperties(qO.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=M.clone(e,this._modelMatrix),this._modelMatrix2DDirty=!0,this._boundingVolume=le.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,e7e(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,t7e(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,n7e(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,i7e(this))}}});function $Je(e,t){let n=e._modelMatrix;e._modelMatrix2D=M.clone(n,e._modelMatrix2D),e._modelMatrix2D[13]-=D.sign(n[13])*2*D.PI*t.mapProjection.ellipsoid.maximumRadius,e._boundingVolume2D=le.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function e7e(e){let t=e.shadows,n=wn.castShadows(t),i=wn.receiveShadows(t),o=e._derivedCommands;for(let r=0;r<o.length;++r){let a=o[r];if(a.updateShadows){let s=a.command;s.castShadows=n,s.receiveShadows=i}}}function t7e(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,a=je(r.renderState,!0);a.cull.enabled=t,r.renderState=Ve.fromCache(a)}}}function n7e(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,a=je(r.renderState,!0);a.cull.face=t,r.renderState=Ve.fromCache(a)}}}function i7e(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}}}qO.prototype.pushCommands=function(e,t){let n=vK(this,e);n&&!this._has2DCommands&&(o7e(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&($Je(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&l(i)&&(i!==Jh.ALL_OPAQUE&&Hy(t,this._translucentCommand,n),i===Jh.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:o,tile:r}=this._model.content;if(o.hasMixedContent){r._finalResolution||Hy(o._backfaceCommands,this._skipLodBackfaceCommand,n),l7e(this,r,n),Hy(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){Hy(t,this._silhouetteModelCommand,n);return}return Hy(t,this._originalCommand,n),this._needsEdgeCommands&&Hy(t,this._edgeCommand,n),t}};qO.prototype.pushSilhouetteCommands=function(e,t){let n=vK(this,e);return Hy(t,this._silhouetteColorCommand,n),t};qO.prototype.pushEdgeCommands=function(e,t){if(!l(this._edgeCommand))return t;let n=vK(this,e);return Hy(t,this._edgeCommand,n),t};function Hy(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function vK(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,a=t.mapProjection.ellipsoid.maximumRadius*D.PI;return o<a&&r>a||o<-a&&r>-a}function Q0(e,t){if(!l(t))return;let n=Sp.clone(t),i=nt.shallowClone(t.command);return i.modelMatrix=e._modelMatrix2D,i.boundingVolume=e._boundingVolume2D,n.command=i,n.updateShadows=!1,n.is2D=!0,t.derivedCommand2D=n,e._derivedCommands.push(n),n}function o7e(e){Q0(e,e._originalCommand),Q0(e,e._translucentCommand),Q0(e,e._skipLodBackfaceCommand),Q0(e,e._skipLodStencilCommand),Q0(e,e._silhouetteModelCommand),Q0(e,e._silhouetteColorCommand),Q0(e,e._edgeCommand)}function r7e(e){let t=nt.shallowClone(e);t.pass=Be.TRANSLUCENT;let n=je(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=sn.ALPHA_BLEND,t.renderState=Ve.fromCache(n),t}function a7e(e,t){let n=t._silhouetteId%255,i=nt.shallowClone(e),o=je(e.renderState,!0);return o.stencilTest={enabled:!0,frontFunction:ee.ALWAYS,backFunction:ee.ALWAYS,reference:n,mask:-1,frontOperation:{fail:ee.KEEP,zFail:ee.KEEP,zPass:ee.REPLACE},backOperation:{fail:ee.KEEP,zFail:ee.KEEP,zPass:ee.REPLACE}},t.isInvisible()&&(o.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=Ve.fromCache(o),i}function s7e(e,t){let n=t._silhouetteId%255,i=nt.shallowClone(e),o=je(e.renderState,!0);o.cull.enabled=!1,(e.pass===Be.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=Be.TRANSLUCENT,o.depthMask=!1,o.blending=sn.ALPHA_BLEND),o.stencilTest={enabled:!0,frontFunction:ee.NOTEQUAL,backFunction:ee.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:ee.KEEP,zFail:ee.KEEP,zPass:ee.KEEP},backOperation:{fail:ee.KEEP,zFail:ee.KEEP,zPass:ee.KEEP}};let a=je(e.uniformMap);return a.model_silhouettePass=function(){return!0},i.renderState=Ve.fromCache(o),i.uniformMap=a,i.castShadows=!1,i.receiveShadows=!1,i}function c7e(e,t){let n=t.edgeGeometry,i=nt.shallowClone(e);i.vertexArray=n.vertexArray,i.primitiveType=n.primitiveType,i.count=n.indexCount,l(n.shaderProgram)&&(i.shaderProgram=n.shaderProgram),i.pass=n.pass;let o=je(e.uniformMap);return o.u_isEdgePass=function(){return!0},i.uniformMap=o,i.uniformMap=o,i.castShadows=!1,i.receiveShadows=!1,i}function l7e(e,t,n){let i=e._skipLodStencilCommand,o=i.command,r=t._selectionDepth,a=u7e(o);if(r!==a){let s=f7e(r),c=je(o.renderState,!0);c.stencilTest.reference=s,o.renderState=Ve.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function u7e(e){return(e.renderState.stencilTest.reference&Yt.SKIP_LOD_MASK)>>>Yt.SKIP_LOD_BIT_SHIFT}function f7e(e){return Yt.CESIUM_3D_TILE_MASK|e<<Yt.SKIP_LOD_BIT_SHIFT}function d7e(e){let t=nt.shallowClone(e),n=je(e.renderState,!0);n.cull.enabled=!0,n.cull.face=Ni.FRONT,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n.polygonOffset={enabled:!0,factor:5,units:5};let i=je(t.uniformMap),o=new k(5,5);return i.u_polygonOffset=function(){return o},t.renderState=Ve.fromCache(n),t.uniformMap=i,t.castShadows=!1,t.receiveShadows=!1,t}function h7e(e){let t=nt.shallowClone(e),n=je(e.renderState,!0),{stencilTest:i}=n;return i.enabled=!0,i.mask=Yt.SKIP_LOD_MASK,i.reference=Yt.CESIUM_3D_TILE_MASK,i.frontFunction=ti.GREATER_OR_EQUAL,i.frontOperation.zPass=wt.REPLACE,i.backFunction=ti.GREATER_OR_EQUAL,i.backOperation.zPass=wt.REPLACE,n.stencilMask=Yt.CESIUM_3D_TILE_MASK|Yt.SKIP_LOD_MASK,t.renderState=Ve.fromCache(n),t}var KO=qO;var XO=`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);
#ifdef HAS_IMAGERY
initializeImageryAttributes();
#endif
// 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(featureIds, 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);
#if defined(HAS_LINE_CUMULATIVE_DISTANCE) || defined(HAS_LINE_PATTERN)
lineStyleStageVS(attributes);
#endif
// 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);
#elif defined(HAS_POINT_DIAMETER)
gl_PointSize = u_pointDiameter;
#else
gl_PointSize = 1.0;
#endif
gl_PointSize *= show;
#endif
// Important NOT to compute gl_Position = show * positionClip or we hit:
// https://github.com/CesiumGS/cesium/issues/11270
//
// We will discard points with v_pointCloudShow == 0 in the fragment shader.
gl_Position = positionClip;
#ifdef HAS_EDGE_VISIBILITY
edgeVisibilityStageVS();
#endif
#ifdef HAS_POINT_CLOUD_SHOW_STYLE
v_pointCloudShow = show;
#endif
}
`;var JO=`
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);
}
void lineStyleStage()
{
#if defined(HAS_LINE_PATTERN) && !defined(HAS_EDGE_VISIBILITY)
const float maskLength = 16.0;
float dashPosition = fract(v_lineCoord / maskLength);
float maskIndex = floor(dashPosition * maskLength);
float maskTest = floor(u_linePattern / pow(2.0, maskIndex));
if (mod(maskTest, 2.0) < 1.0) {
discard;
}
#endif
}
SelectedFeature selectedFeature;
void main()
{
#if defined(PRIMITIVE_TYPE_POINTS) && defined(HAS_POINT_DIAMETER)
// Render points as circles
float distanceToCenter = length(gl_PointCoord - vec2(0.5));
if (distanceToCenter > 0.5) {
discard;
}
#endif
#ifdef HAS_POINT_CLOUD_SHOW_STYLE
if (v_pointCloudShow == 0.0)
{
discard;
}
#endif
#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(featureIds, metadata, metadataClass, metadataStatistics, attributes);
//========================================================================
// When not picking metadata START
#ifndef METADATA_PICKING_ENABLED
#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);
// When not picking metadata END
//========================================================================
#else
//========================================================================
// When picking metadata START
vec4 metadataValues = vec4(0.0, 0.0, 0.0, 0.0);
metadataPickingStage(metadata, metadataClass, metadataValues);
vec4 color = metadataValues;
#endif
// When picking metadata END
//========================================================================
lineStyleStage();
#ifdef HAS_CLIPPING_PLANES
modelClippingPlanesStage(color);
#endif
#ifdef ENABLE_CLIPPING_POLYGONS
modelClippingPolygonsStage();
#endif
//========================================================================
// When not picking metadata START
#ifndef METADATA_PICKING_ENABLED
#if defined(HAS_SILHOUETTE) && defined(HAS_NORMALS)
silhouetteStage(color);
#endif
#ifdef HAS_ATMOSPHERE
atmosphereStage(color, attributes);
#endif
#ifdef HAS_EDGE_VISIBILITY
edgeVisibilityStage(color, featureIds);
edgeDetectionStage(color, featureIds);
#endif
#endif
// When not picking metadata END
//========================================================================
out_FragColor = color;
}
`;function Bme(){}Bme.buildModelDrawCommand=function(e,t){let n=e.shaderBuilder,i=m7e(e,n,t),o=p7e(e,i,t),r=e.model;return l(r.classificationType)?new YO({primitiveRenderResources:e,command:o}):new KO({primitiveRenderResources:e,command:o})};function m7e(e,t,n){t.addVertexLines(XO),t.addFragmentLines(JO);let i=e.model,o=t.buildShaderProgram(n.context);return i._pipelineResources.push(o),o}function p7e(e,t,n){let i=A7e(e),o=new Gn({context:n.context,indexBuffer:i,attributes:e.attributes}),r=e.model;r._pipelineResources.push(o);let a=e.alphaOptions.pass,s=r.sceneGraph,c=n.mode===oe.SCENE3D,u,f;if(!c&&!n.scene3DOnly&&r._projectTo2D)u=M.multiplyTransformation(s._computedModelMatrix,e.runtimeNode.computedTransform,new M),f=e.runtimePrimitive.boundingSphere2D;else{let C=c?s._computedModelMatrix:s._computedModelMatrix2D;u=M.multiplyTransformation(C,e.runtimeNode.computedTransform,new M),f=le.transform(e.boundingSphere,u)}let h=je(Ve.fromCache(e.renderStateOptions),!0);h.cull.face=xt.getCullFace(u,e.primitiveType),h=Ve.fromCache(h);let p=l(r.classificationType),A=p?!1:wn.castShadows(r.shadows),m=p?!1:wn.receiveShadows(r.shadows),_=p?void 0:e.pickId,y=new nt({boundingVolume:f,modelMatrix:u,uniformMap:e.uniformMap,renderState:h,vertexArray:o,shaderProgram:t,cull:r.cull,pass:a,count:e.count,owner:r,pickId:_,pickMetadataAllowed:!0,instanceCount:e.instanceCount,primitiveType:e.primitiveType,debugShowBoundingVolume:r.debugShowBoundingVolume,castShadows:A,receiveShadows:m});return r._marsOptions?.updateDrawCommand&&r._marsOptions.updateDrawCommand(y),y}function A7e(e){let t=e.wireframeIndexBuffer;if(l(t))return t;let n=e.indices;if(l(n))return n.buffer}var ZO=Bme;function ol(e){e=e??V.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=M.clone(M.IDENTITY),this._computedModelMatrix2D=M.clone(M.IDENTITY),this._axisCorrectionMatrix=xt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new M),this._runtimeArticulations={},g7e(this)}Object.defineProperties(ol.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 g7e(e){let t=e._components,n=t.scene,o=e._model.modelMatrix;Dme(e,o);let r=t.articulations,a=r.length,s=e._runtimeArticulations;for(let E=0;E<a;E++){let b=r[E],x=new lL({articulation:b,sceneGraph:e}),S=x.name;s[S]=x}let c=t.nodes,u=c.length;e._runtimeNodes=new Array(u);let h=n.nodes.length,p=M.IDENTITY;for(let E=0;E<h;E++){let b=n.nodes[E],x=vme(e,b,p);e._rootNodes.push(x)}let A=t.skins,m=e._runtimeSkins,_=A.length;for(let E=0;E<_;E++){let b=A[E];m.push(new OO({skin:b,sceneGraph:e}))}let y=e._skinnedNodes,C=y.length;for(let E=0;E<C;E++){let b=y[E],x=e._runtimeNodes[b],B=c[b].skin.index;x._runtimeSkin=m[B],x.updateJointMatrices()}e.applyArticulations()}function Dme(e,t){let n=e._components,i=e._model;e._computedModelMatrix=M.multiplyTransformation(t,n.transform,e._computedModelMatrix),e._computedModelMatrix=M.multiplyTransformation(e._computedModelMatrix,e._axisCorrectionMatrix,e._computedModelMatrix),e._computedModelMatrix=M.multiplyByUniformScale(e._computedModelMatrix,i.computedScale,e._computedModelMatrix)}var _7e=new d;function y7e(e,t){let n=e._computedModelMatrix,i=M.getTranslation(n,_7e);if(!d.equals(i,d.ZERO))e._computedModelMatrix2D=At.basisTo2D(t.mapProjection,n,e._computedModelMatrix2D);else{let o=e.boundingSphere.center,r=At.ellipsoidTo2DModelMatrix(t.mapProjection,o,e._computedModelMatrix2D);e._computedModelMatrix2D=M.multiply(r,n,e._computedModelMatrix2D)}e._boundingSphere2D=le.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function vme(e,t,n){let i=[],o=xt.getNodeTransform(t),r=t.children.length;for(let f=0;f<r;f++){let h=t.children[f],p=M.multiplyTransformation(n,o,new M),A=vme(e,h,p);i.push(A)}let a=new xL({node:t,transform:o,transformToRoot:n,children:i,sceneGraph:e}),s=t.primitives.length;for(let f=0;f<s;f++)a.runtimePrimitives.push(new LO({primitive:t.primitives[f],node:t,model:e._model}));let c=t.index;e._runtimeNodes[c]=a,l(t.skin)&&e._skinnedNodes.push(c);let u=t.name;if(l(u)){let f=e._model,h=new AL(f,a);f._nodesByName[u]=h}return c}var C7e=new d,E7e=new d,b7e=new d,I7e=new d;ol.prototype.buildDrawCommands=function(e){let t=this.buildRenderResources(e);this.computeBoundingVolumes(t),this.createDrawCommands(t,e)};ol.prototype.buildRenderResources=function(e){let t=this._model,n=new FO(t);t.statistics.clear(),this.configurePipeline(e);let i=this.modelPipelineStages;for(let o=0;o<i.length;o++)i[o].process(n,t,e);for(let o=0;o<this._runtimeNodes.length;o++){let r=this._runtimeNodes[o];if(!l(r))continue;r.configurePipeline();let a=r.pipelineStages,s=new VO(n,r);n.nodeRenderResources[o]=s;for(let c=0;c<a.length;c++)a[c].process(s,r.node,e);for(let c=0;c<r.runtimePrimitives.length;c++){let u=r.runtimePrimitives[c];u.configurePipeline(e);let f=u.pipelineStages,h=new WO(s,u);s.primitiveRenderResources[c]=h;for(let p=0;p<f.length;p++)f[p].process(h,u.primitive,e)}}return n};ol.prototype.computeBoundingVolumes=function(e){let t=this._model,n=d.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,C7e),i=d.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,E7e);for(let o=0;o<this._runtimeNodes.length;o++){let r=this._runtimeNodes[o];if(!l(r))continue;let a=e.nodeRenderResources[o],s=r.computedTransform;for(let c=0;c<r.runtimePrimitives.length;c++){let u=r.runtimePrimitives[c],f=a.primitiveRenderResources[c];u.boundingSphere=le.clone(f.boundingSphere,new le);let h=M.multiplyByPoint(s,f.positionMin,b7e),p=M.multiplyByPoint(s,f.positionMax,I7e);d.minimumByComponent(n,h,n),d.maximumByComponent(i,p,i)}}this._boundingSphere=le.fromCornerPoints(n,i,new le),this._boundingSphere=le.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=le.transform(this._boundingSphere,this._components.transform,this._boundingSphere),t._boundingSphere=le.transform(this._boundingSphere,t.modelMatrix,t._boundingSphere),t._initialRadius=t._boundingSphere.radius,t._boundingSphere.radius*=t._clampedScale};ol.prototype.createDrawCommands=function(e,t){for(let n=0;n<this._runtimeNodes.length;n++){let i=this._runtimeNodes[n];if(!l(i))continue;let o=e.nodeRenderResources[n];for(let r=0;r<i.runtimePrimitives.length;r++){let a=i.runtimePrimitives[r],s=o.primitiveRenderResources[r],c=ZO.buildModelDrawCommand(s,t);a.drawCommand=c}}};ol.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(Qy),!l(n.classificationType)&&(n.imageBasedLighting.enabled&&t.push(sL),n.isClippingEnabled()&&t.push(dL),n.isClippingPolygonsEnabled()&&t.push(pL),n.hasSilhouette(e)&&t.push(UO),l(n.splitDirection)&&n.splitDirection!==Lr.NONE&&t.push(GO),Fr.is3DTiles(n.type)&&t.push(nL),i&&t.push(rL))};ol.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 a=e.mode!==oe.SCENE3D&&this._model._projectTo2D;for(t&&!a&&this.updateJointMatrices(),i=0;i<r.runtimePrimitives.length;i++){let s=r.runtimePrimitives[i];for(o=0;o<s.updateStages.length;o++)s.updateStages[o].update(s,this)}}};ol.prototype.updateModelMatrix=function(e,t){Dme(this,e),t.mode!==oe.SCENE3D&&y7e(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let o=this._runtimeNodes[n[i]];o._transformDirty=!0}};ol.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 Pme(e,t,n,i,o){if(n&&!t.show)return;let r=t.children.length;for(let c=0;c<r;c++){let u=t.getChild(c);Pme(e,u,n,i,o)}let a=t.runtimePrimitives,s=a.length;for(let c=0;c<s;c++){let u=a[c];i(u,o)}}function T8(e,t,n,i){let o=e._rootNodes,r=o.length;for(let a=0;a<r;a++){let s=o[a],c=e._runtimeNodes[s];Pme(e,c,t,n,i)}}var x7e={backFaceCulling:void 0};ol.prototype.updateBackFaceCulling=function(e){let t=x7e;t.backFaceCulling=e,T8(this,!1,T7e,t)};function T7e(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var S7e={shadowMode:void 0};ol.prototype.updateShadows=function(e){let t=S7e;t.shadowMode=e,T8(this,!1,w7e,t)};function w7e(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var B7e={debugShowBoundingVolume:void 0};ol.prototype.updateShowBoundingVolume=function(e){let t=B7e;t.debugShowBoundingVolume=e,T8(this,!1,D7e,t)};function D7e(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var Rme=[],Mme=[],v7e={frameState:void 0,hasSilhouette:void 0};ol.prototype.pushDrawCommands=function(e){let t=Rme;t.length=0;let n=Mme;n.length=0;let i=v7e;i.hasSilhouette=this._model.hasSilhouette(e),i.frameState=e,T8(this,!0,P7e,i),oi(e.commandList,t),oi(e.commandList,n)};function P7e(e,t){let n=t.frameState,i=t.hasSilhouette,o=n.passes,r=Rme,a=Mme,s=e.drawCommand;s.pushCommands(n,n.commandList),i&&!o.pick&&s.pushSilhouetteCommands(n,r),l(s.pushEdgeCommands)&&s.pushEdgeCommands(n,a)}ol.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)};ol.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var $O=ol;function Wy(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap=new Ot}Object.defineProperties(Wy.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}}});Wy.prototype.clear=function(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap.removeAll()};Wy.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};Wy.prototype.addTexture=function(e){this._textureIdByteLengths.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes,this._textureIdByteLengths[e._id]=e.sizeInBytes)};Wy.prototype.getTextureIds=function(){return Object.keys(this._textureIdByteLengths)};Wy.prototype.getTextureByteLengthById=function(e){return this._textureIdByteLengths[e]};Wy.prototype.addBatchTexture=function(e){this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var e1=Wy;var Fme=Wr(rG(),1);var Nme={},k0=Uint32Array.BYTES_PER_ELEMENT;Nme.parse=function(e,t){t=t??0;let n=new Uint8Array(e),i=new DataView(e);t+=k0;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+=k0,t+=k0;let r=i.getUint32(t,!0);if(r===0)throw new ue("Feature table must have a byte length greater than zero");t+=k0;let a=i.getUint32(t,!0);t+=k0;let s=i.getUint32(t,!0);t+=k0;let c=i.getUint32(t,!0);t+=k0;let u=Br(n,t,r);t+=r;let f=new Uint8Array(e,t,a);t+=a;let h,p;s>0&&(h=Br(n,t,s),Object.keys(h).length===0&&(h=void 0),t+=s,c>0&&(p=new Uint8Array(e,t,c),p=new Uint8Array(p),t+=c));let A=new Kh(u,f),m=A.getGlobalProperty("POINTS_LENGTH");if(A.featuresLength=m,!l(m))throw new ue("Feature table global property: POINTS_LENGTH must be defined");let _=A.getGlobalProperty("RTC_CENTER",j.FLOAT,3);l(_)&&(_=d.unpack(_));let y=M7e(A,h);if(y.rtcCenter=_,y.pointsLength=m,!y.hasPositions){let C=N7e(A);y.positions=C,y.hasPositions=y.hasPositions||l(C)}if(!y.hasPositions)throw new ue("Either POSITION or POSITION_QUANTIZED must be defined.");if(!y.hasNormals){let C=O7e(A);y.normals=C,y.hasNormals=y.hasNormals||l(C)}if(!y.hasColors){let C=L7e(A);y.colors=C,y.hasColors=y.hasColors||l(C),y.hasConstantColor=l(y.constantColor),y.isTranslucent=l(C)&&C.isTranslucent}if(!y.hasBatchIds){let C=F7e(A);y.batchIds=C,y.hasBatchIds=y.hasBatchIds||l(C)}if(y.hasBatchIds){let C=A.getGlobalProperty("BATCH_LENGTH");if(!l(C))throw new ue("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");y.batchLength=C}return(l(h)||l(p))&&(y.batchTableJson=h,y.batchTableBinary=p),R7e(y),y};function R7e(e){let t=e.batchTableJson;if(!l(t))return;let n=e.batchTableBinary;if(l(n))return;let i=Object.keys(e.draco?.batchTableProperties??{}),o=[];for(let r of Object.keys(t)){let s=t[r].byteOffset;l(s)&&(i.includes(r)||o.push(r))}for(let r of o)It("PntsParser-invalidBinaryBodyReference",`The point cloud data contained a binary property ${r} that could not be resolved - skipping`),delete t[r]}function M7e(e,t){let n=e.json,i,o,r,a=l(n.extensions)?n.extensions["3DTILES_draco_point_compression"]:void 0,s=l(t)&&l(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;l(s)&&(r=s.properties);let c,u,f,h,p;if(l(a)){o=a.properties;let m=a.byteOffset,_=a.byteLength;if(!l(o)||!l(m)||!l(_))throw new ue("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(m,m+_),c=l(o.POSITION),u=l(o.RGB)||l(o.RGBA),f=l(o.NORMAL),h=l(o.BATCH_ID),p=l(o.RGBA)}let A;return l(i)&&(A={buffer:i,featureTableProperties:o,batchTableProperties:r,properties:Pt(o,r),dequantizeInShader:!0}),{draco:A,hasPositions:c,hasColors:u,isTranslucent:p,hasNormals:f,hasBatchIds:h}}function N7e(e){let t=e.json,n;if(l(t.POSITION))return n=e.getPropertyArray("POSITION",j.FLOAT,3),{name:at.POSITION,semantic:at.POSITION,typedArray:n,isQuantized:!1,componentDatatype:j.FLOAT,type:Ut.VEC3};if(l(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",j.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",j.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",j.FLOAT,3);if(!l(r))throw new ue("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:at.POSITION,semantic:at.POSITION,typedArray:n,isQuantized:!0,componentDatatype:j.FLOAT,type:Ut.VEC3,quantizedRange:o,quantizedVolumeOffset:d.unpack(r),quantizedVolumeScale:d.unpack(i),quantizedComponentDatatype:j.UNSIGNED_SHORT,quantizedType:Ut.VEC3}}}function L7e(e){let t=e.json,n;if(l(t.RGBA))return n=e.getPropertyArray("RGBA",j.UNSIGNED_BYTE,4),{name:at.COLOR,semantic:at.COLOR,setIndex:0,typedArray:n,componentDatatype:j.UNSIGNED_BYTE,type:Ut.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(l(t.RGB))return n=e.getPropertyArray("RGB",j.UNSIGNED_BYTE,3),{name:"COLOR",semantic:at.COLOR,setIndex:0,typedArray:n,componentDatatype:j.UNSIGNED_BYTE,type:Ut.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(l(t.RGB565))return n=e.getPropertyArray("RGB565",j.UNSIGNED_SHORT,1),{name:"COLOR",semantic:at.COLOR,setIndex:0,typedArray:n,componentDatatype:j.FLOAT,type:Ut.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(l(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",j.UNSIGNED_BYTE,4),o=i[3],r=z.fromBytes(i[0],i[1],i[2],o),a=o<255;return{name:at.COLOR,semantic:at.COLOR,setIndex:0,constantColor:r,componentDatatype:j.FLOAT,type:Ut.VEC4,isQuantized:!1,isTranslucent:a}}}function O7e(e){let t=e.json,n;if(l(t.NORMAL))return n=e.getPropertyArray("NORMAL",j.FLOAT,3),{name:at.NORMAL,semantic:at.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:j.FLOAT,type:Ut.VEC3};if(l(t.NORMAL_OCT16P))return n=e.getPropertyArray("NORMAL_OCT16P",j.UNSIGNED_BYTE,2),{name:at.NORMAL,semantic:at.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<8)-1,quantizedType:Ut.VEC2,quantizedComponentDatatype:j.UNSIGNED_BYTE,componentDatatype:j.FLOAT,type:Ut.VEC3}}function F7e(e){let t=e.json;if(l(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",j.UNSIGNED_SHORT,1);return{name:at.FEATURE_ID,semantic:at.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:j.fromTypedArray(n),type:Ut.SCALAR}}}var U0=Nme;var Q7e=Cn.Components,k7e=Cn.Scene,U7e=Cn.Node,z7e=Cn.Primitive,G7e=Cn.Attribute,Lme=Cn.Quantization,V7e=Cn.FeatureIdAttribute,H7e=Cn.Material,W7e=Cn.MetallicRoughness,PK=class extends Ki{constructor(t){super(),t=t??V.EMPTY_OBJECT;let n=t.arrayBuffer,i=t.byteOffset??0;this._arrayBuffer=n,this._byteOffset=i,this._loadAttributesFor2D=t.loadAttributesFor2D??!1,this._parsedContent=void 0,this._decodePromise=void 0,this._decodedAttributes=void 0,this._promise=void 0,this._error=void 0,this._state=gt.UNLOADED,this._buffers=[],this._components=void 0,this._transform=M.IDENTITY}get cacheKey(){}get components(){return this._components}get transform(){return this._transform}load(){if(l(this._promise))return this._promise;this._parsedContent=U0.parse(this._arrayBuffer,this._byteOffset),this._state=gt.PROCESSING,this._promise=Promise.resolve(this)}process(t){if(l(this._error)){let n=this._error;throw this._error=void 0,n}if(this._state===gt.READY)return!0;if(this._state===gt.PROCESSING){if(l(this._decodePromise))return!1;this._decodePromise=j7e(this,t.context)}return!1}unload(){let t=this._buffers;for(let n=0;n<t.length;n++)t[n].destroy();t.length=0,this._components=void 0,this._parsedContent=void 0,this._arrayBuffer=void 0}};function j7e(e,t){let i=e._parsedContent.draco,o;if(l(i)?o=ig.decodePointCloud(i,t):o=Promise.resolve(),!!l(o))return e._decodePromise=o,o.then(function(r){if(!e.isDestroyed())return l(r)&&Y7e(e,i,r),oZe(e,t),e._state=gt.READY,e}).catch(function(r){e.unload(),e._state=gt.FAILED;let a="Failed to load Draco pnts";e._error=e.getError(a,r)})}function Y7e(e,t,n){e._state=gt.READY;let i=e._parsedContent,o;if(l(n.POSITION)){if(o={name:"POSITION",semantic:at.POSITION,typedArray:n.POSITION.array,componentDatatype:j.FLOAT,type:Ut.VEC3,isQuantized:!1},l(n.POSITION.data.quantization)){let s=n.POSITION.data.quantization,c=s.range,u=d.fromElements(c,c,c),f=d.unpack(s.minValues),h=(1<<s.quantizationBits)-1;o.isQuantized=!0,o.quantizedRange=h,o.quantizedVolumeOffset=f,o.quantizedVolumeScale=u,o.quantizedComponentDatatype=h<=255?j.UNSIGNED_BYTE:j.UNSIGNED_SHORT,o.quantizedType=Ut.VEC3}i.positions=o}if(l(n.NORMAL)){if(o={name:"NORMAL",semantic:at.NORMAL,typedArray:n.NORMAL.array,componentDatatype:j.FLOAT,type:Ut.VEC3,isQuantized:!1,octEncoded:!1,octEncodedZXY:!1},l(n.NORMAL.data.quantization)){let s=(1<<n.NORMAL.data.quantization.quantizationBits)-1;o.quantizedRange=s,o.octEncoded=!0,o.octEncodedZXY=!0,o.quantizedComponentDatatype=j.UNSIGNED_BYTE,o.quantizedType=Ut.VEC2}i.normals=o}if(l(n.RGBA)?i.colors={name:"COLOR",semantic:at.COLOR,setIndex:0,typedArray:n.RGBA.array,componentDatatype:j.UNSIGNED_BYTE,type:Ut.VEC4,normalized:!0,isTranslucent:!0}:l(n.RGB)&&(i.colors={name:"COLOR",semantic:at.COLOR,setIndex:0,typedArray:n.RGB.array,componentDatatype:j.UNSIGNED_BYTE,type:Ut.VEC3,normalized:!0,isTranslucent:!1}),l(n.BATCH_ID)){let s=n.BATCH_ID.array;i.batchIds={name:"_FEATURE_ID",semantic:at.FEATURE_ID,setIndex:0,typedArray:s,componentDatatype:j.fromTypedArray(s),type:Ut.SCALAR}}let r=i.batchTableJson,a=t.batchTableProperties;for(let s in a)if(a.hasOwnProperty(s)){let c=n[s];l(r)||(r={}),i.hasDracoBatchTable=!0;let u=c.data;r[s]={byteOffset:u.byteOffset,type:q7e(u.componentsPerAttribute),componentType:K7e(u.componentDatatype),typedArray:c.array}}i.batchTableJson=r}function q7e(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4"}}function K7e(e){switch(e){case ee.BYTE:return"BYTE";case ee.UNSIGNED_BYTE:return"UNSIGNED_BYTE";case ee.SHORT:return"SHORT";case ee.UNSIGNED_SHORT:return"UNSIGNED_SHORT";case ee.INT:return"INT";case ee.UNSIGNED_INT:return"UNSIGNED_INT";case ee.DOUBLE:return"DOUBLE";case ee.FLOAT:return"FLOAT"}}function t1(e,t,n){let i=t.typedArray,o;if(t.octEncoded&&(o=new Lme,o.octEncoded=t.octEncoded,o.octEncodedZXY=t.octEncodedZXY,o.normalizationRange=t.quantizedRange,o.type=t.quantizedType,o.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){o=new Lme;let s=t.quantizedRange;o.normalizationRange=s,o.quantizedVolumeOffset=d.ZERO;let c=t.quantizedVolumeScale;o.quantizedVolumeDimensions=c,o.quantizedVolumeStepSize=d.divideByScalar(c,s,new d),o.componentDatatype=t.quantizedComponentDatatype,o.type=t.quantizedType}let r=new G7e;if(r.name=t.name,r.semantic=t.semantic,r.setIndex=t.setIndex,r.componentDatatype=t.componentDatatype,r.type=t.type,r.normalized=t.normalized??!1,r.min=t.min,r.max=t.max,r.quantization=o,t.isRGB565&&(i=tn.decodeRGB565(i)),l(t.constantColor)){let s=new Array(4);r.constant=z.pack(t.constantColor,s)}else{let s=tt.createVertexBuffer({typedArray:i,context:n,usage:Re.STATIC_DRAW});s.vertexArrayDestroyable=!1,e._buffers.push(s),r.buffer=s}let a=e._loadAttributesFor2D;return r.semantic===at.POSITION&&a&&(r.typedArray=i),r}var Ome,S8;function X7e(e){if(!l(S8)){Ome=new Fme.default(0),S8=new Array(e);for(let t=0;t<e;++t)S8[t]=Ome.random()}return S8}var J7e=new d,Z7e=new d,$7e=new d;function eZe(e){let t=e.typedArray,n=20,i=t.length/3,o=Math.min(i,n),r=X7e(n),a=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=d.fromElements(a,a,a,J7e),u=d.fromElements(s,s,s,Z7e),f,h,p;if(e.isQuantized)c=d.ZERO,u=e.quantizedVolumeScale;else for(f=0;f<o;++f)h=Math.floor(r[f]*i),p=d.unpack(t,h*3,$7e),d.minimumByComponent(c,p,c),d.maximumByComponent(u,p,u);e.min=d.clone(c),e.max=d.clone(u)}var tZe={name:at.COLOR,semantic:at.COLOR,setIndex:0,constantColor:z.DARKGRAY,componentDatatype:j.FLOAT,type:Ut.VEC4,isQuantized:!1,isTranslucent:!1};function nZe(e,t,n){let i=[],o,r=t.positions;return l(r)&&(eZe(r),o=t1(e,r,n),o.count=t.pointsLength,i.push(o)),l(t.normals)&&(o=t1(e,t.normals,n),i.push(o)),l(t.colors)?(o=t1(e,t.colors,n),i.push(o)):(o=t1(e,tZe,n),i.push(o)),l(t.batchIds)&&(o=t1(e,t.batchIds,n),i.push(o)),i}function iZe(e,t){let n=e.batchLength,i=e.pointsLength,o=e.batchTableJson,r=e.batchTableBinary,a=!l(e.batchIds);return l(r)||l(o)||e.hasDracoBatchTable?Ag({count:n??i,batchTable:o,binaryBody:r,parseAsPropertyAttributes:a,customAttributeOutput:t}):new Os({schema:{},propertyTables:[]})}function oZe(e,t){let n=e._parsedContent,i=new W7e;i.metallicFactor=0,i.roughnessFactor=.9;let o=new H7e;o.metallicRoughness=i;let r=n.colors;l(r)&&r.isTranslucent&&(o.alphaMode=yp.BLEND);let a=!l(n.normals);o.unlit=a;let s=new z7e;if(s.attributes=nZe(e,n,t),s.primitiveType=ve.POINTS,s.material=o,l(n.batchIds)){let A=new V7e;A.propertyTableId=0,A.setIndex=0,A.positionalLabel="featureId_0",s.featureIds.push(A)}let c=new U7e;c.index=0,c.primitives=[s];let u=new k7e;u.nodes=[c],u.upAxis=ao.Z,u.forwardAxis=ao.X;let f=new Q7e;f.scene=u,f.nodes=[c];let h=[];f.structuralMetadata=iZe(n,h),h.length>0&&rZe(e,s,h,t),l(n.rtcCenter)&&(f.transform=M.multiplyByTranslation(f.transform,n.rtcCenter,f.transform));let p=n.positions;l(p)&&p.isQuantized&&(f.transform=M.multiplyByTranslation(f.transform,p.quantizedVolumeOffset,f.transform)),e._components=f,e._parsedContent=void 0,e._arrayBuffer=void 0}function rZe(e,t,n,i){let o=t.attributes,r=n.length;for(let a=0;a<r;a++){let s=n[a],c=tt.createVertexBuffer({typedArray:s.typedArray,context:i,usage:Re.STATIC_DRAW});c.vertexArrayDestroyable=!1,e._buffers.push(c),s.buffer=c,s.typedArray=void 0,o.push(s)}t.propertyAttributeIds=[0]}var n1=PK;var aZe=new d,sZe=new d,cZe=new d,lZe=new M,uZe=new M,fZe=new M,dZe=new me,hZe=new le;function ZT(e,t,n,i,o,r,a){if(!e._ready||n.mode===oe.MORPHING)return;let s=Number.MAX_VALUE,c=e.sceneGraph,u=c._runtimeNodes;for(let f=0;f<u.length;f++){let h=u[f],p=h.node,A=M.clone(h.computedTransform,lZe),m=M.clone(c.computedModelMatrix,uZe),_=p.instances;l(_)&&_.transformInWorldSpace&&(m=M.multiplyTransformation(e.modelMatrix,c.components.transform,m),A=M.multiplyTransformation(c.axisCorrectionMatrix,h.computedTransform,A));let y=M.multiplyTransformation(m,A,fZe);n.mode!==oe.SCENE3D&&(y=At.basisTo2D(n.mapProjection,y,y));let C=[];if(l(_)){let b=_.attributes[0].count,x=_.attributes[0].componentDatatype,S=12,B=h.transformsTypedArray;if(!l(B)){let v=h.instancingTransformsBuffer;l(v)&&n.context.webgl2&&(B=j.createTypedArray(x,b*S),v.getBufferData(B))}if(l(B))for(let v=0;v<b;v++){let P=v*S,N=new M(B[P],B[P+1],B[P+2],B[P+3],B[P+4],B[P+5],B[P+6],B[P+7],B[P+8],B[P+9],B[P+10],B[P+11],0,0,0,1);_.transformInWorldSpace?(M.multiplyTransformation(N,A,N),M.multiplyTransformation(m,N,N)):M.multiplyTransformation(N,y,N),C.push(N)}}C.length===0&&C.push(y);let E=h.runtimePrimitives.length;for(let b=0;b<E;b++){let x=h.runtimePrimitives[b],S=x.primitive;if(l(x.boundingSphere)&&!l(_)){let Y=le.transform(x.boundingSphere,y,hZe),$=di.raySphere(t,Y);if(!l($))continue}let B=xt.getAttributeBySemantic(S,at.POSITION),v=B.byteOffset,P=B.byteStride,N=B.count;if(!l(S.indices))continue;let L=S.indices.typedArray;if(!l(L)){let Y=S.indices.buffer,$=S.indices.count,W=S.indices.indexDatatype;l(Y)&&n.context.webgl2&&(W===Ue.UNSIGNED_BYTE?L=new Uint8Array($):W===Ue.UNSIGNED_SHORT?L=new Uint16Array($):W===Ue.UNSIGNED_INT&&(L=new Uint32Array($)),Y.getBufferData(L))}let g=B.typedArray,I=B.componentDatatype,T=B.type,w=B.quantization;l(w)&&(I=B.quantization.componentDatatype,T=B.quantization.type);let R=Ut.getNumberOfComponents(T),O=j.getSizeInBytes(I),G=!l(g)&&l(P)&&P!==R*O,F=R,U=0;G&&(F=P/O,U=v/O);let Q=N*F;if(!l(g)){let Y=B.buffer;l(Y)&&n.context.webgl2&&(g=j.createTypedArray(I,Q),Y.getBufferData(g,G?0:v,0,Q)),w&&B.normalized&&(g=tn.dequantize(g,I,T,N))}if(!l(L)||!l(g))return;r=r??te.default,i=i??1,o=o??0;let H=L.length;for(let Y=0;Y<H;Y+=3){let $=L[Y],W=L[Y+1],K=L[Y+2];for(let Z of C){let pe=RK(g,$,U,F,w,Z,i,o,r,aZe),ge=RK(g,W,U,F,w,Z,i,o,r,sZe),re=RK(g,K,U,F,w,Z,i,o,r,cZe),ye=di.rayTriangleParametric(t,pe,ge,re,e.backFaceCulling??!0);l(ye)&&ye<s&&ye>=0&&(s=ye)}}}}if(s!==Number.MAX_VALUE){if(a=yn.getPoint(t,s,a),n.mode!==oe.SCENE3D){d.fromElements(a.y,a.z,a.x,a);let f=n.mapProjection,h=f.ellipsoid,p=f.unproject(a,dZe);h.cartographicToCartesian(p,a)}return a}}function RK(e,t,n,i,o,r,a,s,c,u){let f=n+t*i;if(u.x=e[f],u.y=e[f+1],u.z=e[f+2],l(o))if(o.octEncoded){if(u=tn.octDecodeInRange(u,o.normalizationRange,u),o.octEncodedZXY){let h=u.x;u.x=u.z,u.z=u.y,u.y=h}}else u=d.multiplyComponents(u,o.quantizedVolumeStepSize,u),u=d.add(u,o.quantizedVolumeOffset,u);return u=M.multiplyByPoint(r,u,u),a!==1&&xo.getPosition(u,c,a,s,u),u}var MK=class{constructor(t){this.show=t.show,this.alpha=t.alpha,this.brightness=t.brightness,this.contrast=t.contrast,this.hue=t.hue,this.saturation=t.saturation,this.gamma=t.gamma,this.colorToAlpha=t.colorToAlpha}},i1=MK;var NK=class{constructor(t){this._model=t,this._modelPrimitiveImageries=void 0,this._imageryConfigurations=[]}update(t){if(!this._hasImagery){this._deleteModelPrimitiveImageries();return}this._allImageryLayersReady&&(l(this._modelPrimitiveImageries)||(this._modelPrimitiveImageries=this._createModelPrimitiveImageries()),this._updateModelPrimitiveImageries(t),this._checkForModifiedImageryConfigurations())}_createModelPrimitiveImageries(){let t=this._model,n=this._collectRuntimeNodesAndPrimitives(),i=[],o=n.length;for(let r=0;r<o;r++){let a=n[r],s=a.runtimeNode,c=a.runtimePrimitive,u=new L0(t,s,c);c.primitive.modelPrimitiveImagery=u,i.push(u)}return i}_collectRuntimeNodesAndPrimitives(){let i=this._model.sceneGraph._runtimeNodes,o=[];for(let r=0;r<i.length;r++){let a=i[r];if(l(a))for(let s=0;s<a.runtimePrimitives.length;s++){let c=a.runtimePrimitives[s];o.push({runtimeNode:a,runtimePrimitive:c})}}return o}_updateModelPrimitiveImageries(t){if(!l(this._modelPrimitiveImageries))throw new de("The modelPrimitiveImageries have not been created");let n=this._modelPrimitiveImageries,i=n.length;for(let o=0;o<i;o++)n[o].update(t)}_deleteModelPrimitiveImageries(){let t=this._modelPrimitiveImageries;if(!l(t))return;let n=t.length;for(let i=0;i<n;i++)t[i].destroy();delete this._modelPrimitiveImageries,this._model.resetDrawCommands()}get ready(){return this._hasImagery?!(!this._allImageryLayersReady||!this._allModelPrimitiveImageriesReady):!0}get _hasImagery(){let n=this._model.imageryLayers;return l(n)&&n.length>0}get _allImageryLayersReady(){if(!this._hasImagery)return!0;let t=this._model.imageryLayers,n=t.length;for(let i=0;i<n;i++)if(!t.get(i).ready)return!1;return!0}get _allModelPrimitiveImageriesReady(){let t=this._modelPrimitiveImageries;if(!l(t))return!1;let n=t.length;for(let i=0;i<n;i++)if(!t[i].ready)return!1;return!0}_checkForModifiedImageryConfigurations(){this._imageryConfigurationsModified()&&(this._updateImageryConfigurations(),this._model.resetDrawCommands())}_imageryConfigurationsModified(){let n=this._model.imageryLayers,i=this._imageryConfigurations;if(n.length!==i.length)return!0;for(let o=0;o<n.length;o++){let r=n.get(o),a=i[o];if(r.show!==a.show||r.alpha!==a.alpha||r.brightness!==a.brightness||r.contrast!==a.contrast||r.hue!==a.hue||r.saturation!==a.saturation||r.gamma!==a.gamma||r.colorToAlpha!==a.colorToAlpha)return!0}return!1}_updateImageryConfigurations(){let n=this._model.imageryLayers,i=this._imageryConfigurations;i.length=n.length;for(let o=0;o<n.length;o++){let r=n.get(o);i[o]=new i1(r)}}isDestroyed(){return!1}destroy(){if(!this.isDestroyed())return this._deleteModelPrimitiveImageries(),fe(this)}},o1=NK;function Po(e){e=e??V.EMPTY_OBJECT,this._loader=e.loader,this._resource=e.resource,this.type=e.type??Fr.GLTF,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=M.clone(this.modelMatrix),this._scale=e.scale??1,this._minimumPixelSize=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=J.clone(J.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 ZN(this),this._clampAnimations=e.clampAnimations??!0,this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=z.clone(e.color),this._colorBlendMode=e.colorBlendMode??el.HIGHLIGHT,this._colorBlendAmount=e.colorBlendAmount??.5;let t=e.silhouetteColor??z.RED;this._silhouetteColor=z.clone(t),this._silhouetteSize=e.silhouetteSize??0,this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=e.cull??!0,this._opaquePass=e.opaquePass??Be.OPAQUE,this._allowPicking=e.allowPicking??!0,this._show=e.show??!0,this._style=void 0,this._styleDirty=!1,this._styleCommandsNeeded=void 0;let n=e.featureIdLabel??"featureId_0";typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=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 le,this._initialRadius=void 0,this._heightReference=e.heightReference??it.NONE,this._heightDirty=this._heightReference!==it.NONE,this._removeUpdateHeightCallback=void 0,this._enableVerticalExaggeration=e.enableVerticalExaggeration??!0,this._hasVerticalExaggeration=!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 Ep(e.pointCloudShading);this._pointCloudShading=r,this._attenuation=r.attenuation,this._pointCloudBackFaceCulling=r.backFaceCulling;let a=e.clippingPlanes;l(a)&&a.owner===void 0?da.setOwner(a,this,"_clippingPlanes"):this._clippingPlanes=a,this._clippingPlanesState=0,this._clippingPlanesMatrix=M.clone(M.IDENTITY);let s=e.clippingPolygons;l(s)&&s.owner===void 0?jh.setOwner(s,this,"_clippingPolygons"):this._clippingPolygons=s,this._clippingPolygonsState=0,this._modelImagery=new o1(this),this._lightColor=d.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new s0,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._environmentMapManager=void 0;let c=new ug(e.environmentMapOptions);ug.setOwner(c,this,"_environmentMapManager"),this._backFaceCulling=e.backFaceCulling??!0,this._backFaceCullingDirty=!1,this._shadows=e.shadows??wn.ENABLED,this._shadowsDirty=!1,this._debugShowBoundingVolumeDirty=!1,this._debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._enableDebugWireframe=e.enableDebugWireframe??!1,this._enableShowOutline=e.enableShowOutline??!0,this._debugWireframe=e.debugWireframe??!1,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===Fr.GLTF&&It("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.");let u=e.credit;typeof u=="string"&&(u=new Et(u)),this._credits=[],this._credit=u,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=e.showCreditsOnScreen??!1,this._showCreditsOnScreenDirty=!0,this._splitDirection=e.splitDirection??Lr.NONE,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??z.BLACK,this._classificationType=e.classificationType,this._statistics=new e1,this._sceneMode=void 0,this._projectTo2D=e.projectTo2D??!1,this._enablePick=e.enablePick??!1,this._fogRenderable=void 0,this._skipLevelOfDetail=!1,this._ignoreCommands=e.ignoreCommands??!1,this._errorEvent=new _e,this._readyEvent=new _e,this._texturesReadyEvent=new _e,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject,this._marsOptions=e.marsOptions??{}}function LK(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function mZe(e,t){let n=e._featureTables,i=t.propertyTables,o=i.length;for(let r=0;r<o;r++){let a=i[r],s=new tL({model:e,propertyTable:a});n.push(s)}return n}function pZe(e,t){let n=t._featureIdLabel,i=t._instanceFeatureIdLabel,o,r,a,s;for(o=0;o<e.nodes.length;o++)if(s=e.nodes[o],l(s.instances)&&(a=xt.getFeatureIdsByLabel(s.instances.featureIds,i),l(a)&&l(a.propertyTableId)))return a.propertyTableId;for(o=0;o<e.nodes.length;o++)for(s=e.nodes[o],r=0;r<s.primitives.length;r++){let c=s.primitives[r],u=xt.getFeatureIdsByLabel(c.featureIds,n);if(l(u))return u.propertyTableId}if(t._featureTables.length===1)return 0}function QK(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(Po.prototype,{ready:{get:function(){return this._ready}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},incrementallyLoadTextures:{get:function(){return 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=zt.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){QK(e,this._color)&&this.resetDrawCommands(),this._color=z.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(!z.equals(e,this._silhouetteColor)){let t=QK(e,this._silhouetteColor);this._silhouetteDirty=this._silhouetteDirty||t}this._silhouetteColor=z.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 Ume(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===Fr.GLTF&&It("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&&(da.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(jh.setOwner(e,this,"_clippingPolygons"),this.resetDrawCommands())}},enableVerticalExaggeration:{get:function(){return this._enableVerticalExaggeration},set:function(e){e!==this._enableVerticalExaggeration&&this.resetDrawCommands(),this._enableVerticalExaggeration=e}},hasVerticalExaggeration:{get:function(){return this._hasVerticalExaggeration}},imageryLayers:{get:function(){if(l(this._content)){let e=this._content.tileset;if(l(e))return e.imageryLayers}}},lightColor:{get:function(){return this._lightColor},set:function(e){l(e)!==l(this._lightColor)&&this.resetDrawCommands(),this._lightColor=d.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())}},environmentMapManager:{get:function(){return this._environmentMapManager},set:function(e){e!==this.environmentMapManager&&(ug.setOwner(e,this,"_environmentMapManager"),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}}});Po.prototype.getNode=function(e){return this._nodesByName[e]};Po.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};Po.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};Po.prototype.getExtension=function(e){return this._loader.components.extensions[e]};Po.prototype.makeStyleDirty=function(){this._styleDirty=!0};Po.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var AZe=new M,gZe=new J,_Ze=new M;Po.prototype.update=function(e){let t=!1;try{t=yZe(this,e)}catch(i){if(!this._loader.incrementallyLoadTextures&&i.name==="TextureError")LK(this,i);else{let o=xt.getError("model",this._resource,i);LK(this,o)}}if(bZe(this,e),CZe(this,e),EZe(this,e),IZe(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let i=this._loader.components;if(!l(i)){if(this._loader.isUnloaded())return;let a=xt.getError("model",this._resource,new ue("Failed to load model."));LK(a),this._rejectLoad=this._rejectLoad&&this._rejectLoad(a)}let o=i.structuralMetadata;l(o)&&o.propertyTableCount>0&&mZe(this,o);let r=new $O({model:this,modelComponents:i});this._sceneGraph=r,this._gltfCredits=r.components.asset.credits}if(!this._resourcesLoaded||e.mode===oe.MORPHING)return;let n=this._modelImagery;if(n.update(e),!(!n.ready&&!(this._content?.tileset?._asynchronouslyLoadImagery??!1))){if(xZe(this),TZe(this),SZe(this,e),wZe(this),BZe(this,e),DZe(this,e),vZe(this,e),PZe(this,e),RZe(this,e),MZe(this,e),NZe(this,e),this._defaultTexture=e.context.defaultTexture,LZe(this,e),OZe(this,e),FZe(this),QZe(this,e),GZe(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)),UZe(this),VZe(this,e),HZe(this),WZe(this,e)}};function yZe(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function CZe(e,t){l(e._customShader)&&e._customShader.update(t)}function EZe(e,t){let n=e._environmentMapManager,i=t.passes.pick||t.passes.pickVoxel;e._ready&&n.owner===e&&!i&&(n.position=e._boundingSphere.center,n.shouldUpdate=!l(e._imageBasedLighting.sphericalHarmonicCoefficients)||!l(e._imageBasedLighting.specularEnvironmentMaps),n.update(t),n.shouldRegenerateShaders&&e.resetDrawCommands())}function bZe(e,t){if(l(e._marsOptions)&&l(e._marsOptions.customShaders)){let n=bA.getCache(e._marsOptions.customShaders);for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&n[i].update(t)}}function IZe(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function xZe(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=pZe(t,e),e._styleDirty=!0,e.resetDrawCommands())}function TZe(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function SZe(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&&kme(e)}function kme(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=Jh.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function wZe(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 BZe(e,t){e._silhouetteDirty&&(zme(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function DZe(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function vZe(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 PZe(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 RZe(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function MZe(e,t){let n=t.fog.enabled&&t.fog.renderable;n!==e._fogRenderable&&(e.resetDrawCommands(),e._fogRenderable=n)}function NZe(e,t){if(e.enableVerticalExaggeration){let n=t.verticalExaggeration!==1;e.hasVerticalExaggeration!==n&&(e.resetDrawCommands(),e._hasVerticalExaggeration=n)}else e.hasVerticalExaggeration&&(e.resetDrawCommands(),e._hasVerticalExaggeration=!1)}function LZe(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function OZe(e,t){M.equals(e.modelMatrix,e._modelMatrix)||(e._updateModelMatrix=!0,e._modelMatrix=M.clone(e.modelMatrix,e._modelMatrix))}var jy=new d,OK=new me;function FZe(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===it.NONE){e._clampedModelMatrix=void 0;return}let n=t.ellipsoid??te.default,i=e.modelMatrix;jy.x=i[12],jy.y=i[13],jy.z=i[14];let o=n.cartesianToCartographic(jy);if(!l(o)){e._clampedModelMatrix=void 0;return}l(e._clampedModelMatrix)||(e._clampedModelMatrix=M.clone(i,new M)),e._removeUpdateHeightCallback=t.updateHeight(o,Qme(e,n,o),e.heightReference);let r=t.getHeight(o,e.heightReference);if(l(r)){let a=Qme(e,n,o);me.clone(o,OK),OK.height=r,a(OK)}e._heightDirty=!1,e._updateModelMatrix=!0}function QZe(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;Ume(e,n),kZe(e,n,t)}function Ume(e,t){e._clampedScale=l(e._maximumScale)?Math.min(e._scale,e._maximumScale):e._scale,e._boundingSphere.center=d.multiplyByScalar(e._sceneGraph.boundingSphere.center,e._clampedScale,e._boundingSphere.center),e._boundingSphere.radius=e._initialRadius*e._clampedScale,e._boundingSphere=le.transform(e._boundingSphere,t,e._boundingSphere)}function kZe(e,t,n){let i=e.scale;if(e.minimumPixelSize!==0&&!e._projectTo2D){let o=n.context,r=Math.max(o.drawingBufferWidth,o.drawingBufferHeight);M.getTranslation(t,jy),e._sceneMode!==oe.SCENE3D&&so.computeActualEllipsoidPosition(n,jy,jy);let a=e._boundingSphere.radius,s=jZe(jy,a,n),c=1/s;Math.min(c*(2*a),r)<e.minimumPixelSize&&(i=e.minimumPixelSize*s/(2*e._initialRadius))}e._computedScale=l(e.maximumScale)?Math.min(e.maximumScale,i):i}function UZe(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 zZe=new J(1,0,0,0,0,1,0,-1,0);function GZe(e,t){let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=e.referenceMatrix??n,o=t.context,r=gZe,a=AZe;if(a=M.multiply(o.uniformState.view3D,i,a),r=M.getRotation(a,r),r=J.transpose(r,r),e._iblReferenceFrameMatrix=J.multiply(zZe,r,e._iblReferenceFrameMatrix),e.isClippingEnabled()){let s=_Ze;s=M.multiply(o.uniformState.view3D,i,s),s=M.multiply(s,e._clippingPlanes.modelMatrix,s),e._clippingPlanesMatrix=M.inverseTranspose(s,e._clippingPlanesMatrix)}}function VZe(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 HZe(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1,e._credits.length=0;let t=e._showCreditsOnScreen;if(l(e._credit)){let a=Et.clone(e._credit);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}let n=e._resourceCredits,i=n.length;for(let a=0;a<i;a++){let s=Et.clone(n[a]);s.showOnScreen=s.showOnScreen||t,e._credits.push(s)}let o=e._gltfCredits,r=o.length;for(let a=0;a<r;a++){let s=Et.clone(o[a]);s.showOnScreen=s.showOnScreen||t,e._credits.push(s)}}function WZe(e,t){let n=qZe(e,t),i=e.isInvisible(),o=e.hasSilhouette(t),r=e._show&&e._computedScale!==0&&n&&(!i||o),a=t.passes,s=a.render||a.pick&&e.allowPicking;r&&!e._ignoreCommands&&s&&(KZe(e,t),e._sceneGraph.pushDrawCommands(t))}var FK=new le;function jZe(e,t,n){return FK.center=e,FK.radius=t,n.camera.getPixelSize(FK,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var w8=new d;function Qme(e,t,n){return function(i){Px(e.heightReference)&&(i.height+=n.height),t.cartographicToCartesian(i,w8);let o=e._clampedModelMatrix;M.clone(e.modelMatrix,o),o[12]=w8.x,o[13]=w8.y,o[14]=w8.z,e._heightDirty=!0}}var YZe=new d;function qZe(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 s=(t.camera.frustum.right-t.camera.frustum.left)*.5;r=s*s}else{let a=M.getTranslation(e.modelMatrix,YZe);so.computeActualEllipsoidPosition(t,a,a),r=d.distanceSquared(a,t.camera.positionWC)}return r>=i&&r<=o}function KZe(e,t){let n=t.creditDisplay,i=e._credits,o=i.length;for(let r=0;r<o;r++)n.addCreditToNextFrame(i[r])}Po.prototype.isTranslucent=function(){let e=this.color;return l(e)&&e.alpha>0&&e.alpha<1};Po.prototype.isInvisible=function(){let e=this.color;return l(e)&&e.alpha===0};function zme(e){return e.context.stencilBuffer}Po.prototype.hasSilhouette=function(e){return zme(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};Po.prototype.hasSkipLevelOfDetail=function(e){if(!Fr.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};Po.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return l(e)&&e.enabled&&e.length!==0};Po.prototype.pick=function(e,t,n,i,o){return ZT(this,e,t,n,i,o)};Po.prototype.isClippingPolygonsEnabled=function(){let e=this._clippingPolygons;return l(e)&&e.enabled&&e.length!==0};Po.prototype.isDestroyed=function(){return!1};Po.prototype.destroy=function(){let e=this._loader;l(e)&&e.destroy();let t=this._featureTables;if(l(t)){let r=t.length;for(let a=0;a<r;a++)t[a].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;let o=this._environmentMapManager;!o.isDestroyed()&&o.owner===this&&o.destroy(),this._environmentMapManager=void 0,fe(this)};Po.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};Po.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0};Po.fromGltfAsync=async function(e){e=e??V.EMPTY_OBJECT;let t=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=e.basePath??"",o=De.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=De.createIfNeeded(t);let r=new _f(n),s=l(e.content)?Fr.TILE_GLTF:Fr.GLTF,c=n.gltfResource,u=r1(r,s,e);u.resource=c,u.environmentMapOptions=e.environmentMapOptions;try{await r.load()}catch(A){throw r.destroy(),xt.getError("model",c,A)}let f=e.gltfCallback;l(f)&&f(r.gltfJson);let h=new Po(u),p=h._resource.credits;if(l(p)){let A=p.length;for(let m=0;m<A;m++)h._resourceCredits.push(Et.clone(p[m]))}return h};Po.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 VN(t);try{await n.load();let i=r1(n,Fr.TILE_B3DM,e);return new Po(i)}catch(i){throw n.destroy(),i}};Po.fromPnts=async function(e){let t={arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D},n=new n1(t);try{await n.load();let i=r1(n,Fr.TILE_PNTS,e);return new Po(i)}catch(i){throw n.destroy(),i}};Po.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 jN(t);try{await n.load();let i=r1(n,Fr.TILE_I3DM,e);return new Po(i)}catch(i){throw n.destroy(),i}};Po.fromGeoJson=async function(e){let t={geoJson:e.geoJson},n=new HN(t),i=r1(n,Fr.TILE_GEOJSON,e);return new Po(i)};var XZe=new z;Po.prototype.applyColorAndShow=function(e){let t=z.clone(this._color,XZe),n=l(e)&&l(e.color),i=l(e)&&l(e.show);this._color=n?e.color.evaluateColor(void 0,this._color):z.clone(z.WHITE,this._color),this._show=i?e.show.evaluate(void 0):!0,QK(t,this._color)&&this.resetDrawCommands()};Po.prototype.applyStyle=function(e){let t=this.type===Fr.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),kme(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function r1(e,t,n){return{loader:e,type:t,resource:n.resource,show:n.show,modelMatrix:n.modelMatrix,scale:n.scale,enableVerticalExaggeration:n.enableVerticalExaggeration,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,...n.marsOptions,marsOptions:n.marsOptions}}var xf=Po;function _a(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(_a.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}}});_a.prototype.getTextureIds=function(){return this._model.statistics.getTextureIds()};_a.prototype.getTextureByteLengthById=function(e){return this._model.statistics.getTextureByteLengthById(e)};_a.prototype.getExtension=function(e){return this._model.getExtension(e)};_a.prototype.getFeature=function(e){let t=this._model,n=t.featureTableId;return t.featureTables[n].getFeature(e)};_a.prototype.hasProperty=function(e,t){let n=this._model,i=n.featureTableId;return l(i)?n.featureTables[i].hasProperty(e,t):!1};_a.prototype.applyDebugSettings=function(e,t){t=e?t:z.WHITE,this.featuresLength===0?this._model.color=t:l(this.batchTable)&&this.batchTable.setAllColor(t)};_a.prototype.applyStyle=function(e){this._model.style=e};_a.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);let r=e.environmentMapManager;n.environmentMapManager!==o&&(n._environmentMapManager=r),l(o)&&l(n._clippingPlanes)&&n._clippingPlanes!==o&&(n._clippingPlanes=o,n._clippingPlanesState=0);let a=e.clippingPolygons;l(a)&&i.clippingPolygonsDirty&&(n._clippingPolygons=a.enabled&&i._isClippedByPolygon?a:void 0),l(a)&&l(n._clippingPolygons)&&n._clippingPolygons!==a&&(n._clippingPolygons=a,n._clippingPolygonsState=0),n.update(t),!this._ready&&n.ready&&(n.activeAnimations.addAll({loop:Du.REPEAT}),this._ready=!0)};_a.prototype.isDestroyed=function(){return!1};_a.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),fe(this)};_a.fromGltf=async function(e,t,n,i){let o=new _a(e,t,n),a=a1(e,t,o,{gltf:i,basePath:n}),s=e.vectorClassificationOnly?void 0:e.classificationType;a.classificationType=s;let c=await xf.fromGltfAsync(a);return o._model=c,o};_a.fromB3dm=async function(e,t,n,i,o){let r=new _a(e,t,n),s=a1(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=e.vectorClassificationOnly?void 0:e.classificationType;s.classificationType=c;let u=await xf.fromB3dm(s);return r._model=u,r};_a.fromI3dm=async function(e,t,n,i,o){let r=new _a(e,t,n),s=a1(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await xf.fromI3dm(s);return r._model=c,r};_a.fromPnts=async function(e,t,n,i,o){let r=new _a(e,t,n),s=a1(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await xf.fromPnts(s);return r._model=c,r};_a.fromGeoJson=async function(e,t,n,i){let o=new _a(e,t,n),a=a1(e,t,o,{geoJson:i,resource:n}),s=await xf.fromGeoJson(a);return o._model=s,o};_a.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,te.WGS84,n)};function a1(e,t,n,i){let o={cull:!1,releaseGltfJson:!0,opaquePass:Be.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,customShader:e.customShader,content:n,colorBlendMode:e.colorBlendMode,colorBlendAmount:e.colorBlendAmount,lightColor:e.lightColor,imageBasedLighting:e.imageBasedLighting,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,pointCloudShading:e.pointCloudShading,clippingPlanes:e.clippingPlanes,backFaceCulling:e.backFaceCulling,shadows:e.shadows,showCreditsOnScreen:e.showCreditsOnScreen,splitDirection:e.splitDirection,enableDebugWireframe:e._enableDebugWireframe,debugWireframe:e.debugWireframe,projectTo2D:e._projectTo2D,enablePick:e._enablePick,enableShowOutline:e._enableShowOutline,showOutline:e.showOutline,outlineColor:e.outlineColor,marsOptions:e._marsOptions};return Pt(i,o)}var Tf=_a;function Rd(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(Rd.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}}});Rd.fromJson=function(e,t,n,i){let o=new Rd(e,t,n);return o._tileset.loadTileset(o._resource,i,o._tile),o._ready=!0,o};Rd.prototype.hasProperty=function(e,t){return!1};Rd.prototype.getFeature=function(e){};Rd.prototype.applyDebugSettings=function(e,t){};Rd.prototype.applyStyle=function(e){};Rd.prototype.update=function(e,t){};Rd.prototype.pick=function(e,t,n){};Rd.prototype.isDestroyed=function(){return!1};Rd.prototype.destroy=function(){return fe(this)};var s1=Rd;var c1=`uniform sampler2D u_atlas;
uniform float u_coarseDepthTestDistance;
uniform float u_threePointDepthTestDistance;
#ifdef VECTOR_TILE
uniform vec4 u_highlightColor;
#endif
in vec2 v_textureCoordinates;
in vec4 v_pickColor;
in vec4 v_color;
flat in vec2 v_splitDirectionAndEllipsoidDepthEC;
#ifdef SDF
in vec4 v_outlineColor;
in float v_outlineWidth;
#endif
in vec4 v_compressed; // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize
const float SHIFT_LEFT1 = 2.0;
const float SHIFT_RIGHT1 = 1.0 / 2.0;
float getGlobeDepthAtCoords(vec2 st)
{
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;
}
#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
bool getDepthTestEnabled() {
float temp = v_compressed.y;
temp = temp * SHIFT_RIGHT1;
float temp2 = (temp - floor(temp)) * SHIFT_LEFT1;
return temp2 != 0.0;
}
float getRelativeEyeDepth(float eyeDepth, float distanceToEllipsoid, float epsilon) {
float depthDifferential = eyeDepth - distanceToEllipsoid;
float depthRatio = abs(depthDifferential / distanceToEllipsoid);
if (depthRatio < epsilon) {
// The approximations are imprecise, so use an epsilon check for small value differences and assume a value of 0.0
return 0.0;
}
return depthDifferential;
}
// Extra manual depth testing is done to allow more control over how a billboard is occluded
// by the globe when near and far from the camera.
void doDepthTest(float eyeDepth, float globeDepth) {
#ifdef VS_THREE_POINT_DEPTH_CHECK
// Since discarding vertices is not possible, the vertex shader sets eyeDepth to 0 to indicate the depth test failed. Apply the discard here.
if (eyeDepth > -u_threePointDepthTestDistance) {
if (eyeDepth == 0.0) {
discard;
}
return;
}
#endif
bool useGlobeDepth = eyeDepth > -u_coarseDepthTestDistance;
if (useGlobeDepth && globeDepth == 0.0) {
// Pixel is not on the globe, so there is no distance to compare against. Pass.
return;
}
// If the camera is close, compare against the globe depth texture that includes depth from the 3D tile pass.
if (useGlobeDepth && getRelativeEyeDepth(eyeDepth, globeDepth, czm_epsilon1) < 0.0) {
discard;
}
}
#ifdef LOG_DEPTH
void writeDepth(float eyeDepth, float globeDepth, float distanceToEllipsoid) {
// If we've made it here, the manual depth test above determined that this fragment should be visible.
// But the automatic depth test must still run in order to write the result to the depth buffer, and its results may
// disagree with our manual depth test's results. To prefer our manual results when in front of the globe, apply an offset towards the camera.
float depthArg = v_depthFromNearPlusOne;
if (globeDepth != 0.0 && getRelativeEyeDepth(eyeDepth, distanceToEllipsoid, czm_epsilon3) > 0.0) {
float globeDepthFromNearPlusOne = (-globeDepth - czm_currentFrustum.x) + 1.0;
float nudge = max(globeDepthFromNearPlusOne * 5e-6, czm_epsilon7);
float globeOnTop = max(1.0, globeDepthFromNearPlusOne - nudge);
depthArg = min(depthArg, globeOnTop);
}
czm_writeLogDepth(depthArg);
}
#endif
void main()
{
if (v_splitDirectionAndEllipsoidDepthEC.x < 0.0 && gl_FragCoord.x > czm_splitPosition) {
discard;
}
if (v_splitDirectionAndEllipsoidDepthEC.x > 0.0 && gl_FragCoord.x < czm_splitPosition) {
discard;
}
if (getDepthTestEnabled()) {
vec2 fragSt = gl_FragCoord.xy / czm_viewport.zw;
float eyeDepth = v_compressed.x;
float globeDepth = getGlobeDepthAtCoords(fragSt);
float distanceToEllipsoid = -v_splitDirectionAndEllipsoidDepthEC.y;
doDepthTest(eyeDepth, globeDepth);
#ifdef LOG_DEPTH
writeDepth(eyeDepth, globeDepth, distanceToEllipsoid);
#endif
}
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;
}
`;var l1=`uniform float u_threePointDepthTestDistance;
in vec2 direction;
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, disableDepthTestDistanceSq, dimensions
in vec2 sdf; // sdf outline color (rgb) and width (w)
in float splitDirection; // splitDirection
#ifdef VS_THREE_POINT_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;
out vec4 v_compressed; // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize
out vec4 v_pickColor;
out vec4 v_color;
flat out vec2 v_splitDirectionAndEllipsoidDepthEC; // x: splitDirection, y: ellipsoid depth in eye coordinates
#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 VS_THREE_POINT_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;
origin -= vec2(1.0);
float show = floor(compressed * SHIFT_RIGHT2);
compressed -= show * SHIFT_LEFT2;
vec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w);
vec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w);
vec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange;
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.x *= SHIFT_RIGHT2; // undo translateX scaling (helps preserve subpixel precision, see BillboardCollection.js attribute writer for more info)
translate.y += (temp - floor(temp)) * SHIFT_LEFT8;
translate.y -= UPPER_BOUND;
translate.y *= SHIFT_RIGHT2;
temp = compressedAttribute1.x * SHIFT_RIGHT8;
float temp2 = floor(compressedAttribute2.w * SHIFT_RIGHT2);
vec2 imageSize = vec2(floor(temp), temp2);
#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
#ifdef VS_THREE_POINT_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 color = czm_decodeRGB8(compressedAttribute2.x);
vec4 pickColor = czm_decodeRGB8(compressedAttribute2.y);
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.a /= 255.0;
color.a = floor(temp);
color.a /= 255.0;
///////////////////////////////////////////////////////////////////////////
vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
vec4 positionEC = czm_modelViewRelativeToEye * p;
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;
float enableDepthCheck = 1.0;
#ifdef DISABLE_DEPTH_DISTANCE
float disableDepthTestDistanceSq = compressedAttribute3.z;
if (disableDepthTestDistanceSq == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)
{
disableDepthTestDistanceSq = czm_minimumDisableDepthTestDistance;
}
if (lengthSq < disableDepthTestDistanceSq || disableDepthTestDistanceSq < 0.0)
{
enableDepthCheck = 0.0;
}
#endif
v_splitDirectionAndEllipsoidDepthEC.y = czm_infinity;
vec3 ellipsoidCenter = czm_view[3].xyz;
vec3 rayDirection = normalize(positionEC.xyz);
czm_ray ray = czm_ray(vec3(0.0), rayDirection);
vec3 ellipsoid_inverseRadii = czm_ellipsoidInverseRadii;
czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoidCenter, ellipsoid_inverseRadii);
if (!czm_isEmpty(intersection))
{
v_splitDirectionAndEllipsoidDepthEC.y = intersection.start;
}
v_compressed.y = enableDepthCheck;
#ifdef VS_THREE_POINT_DEPTH_CHECK
if (lengthSq < (u_threePointDepthTestDistance * u_threePointDepthTestDistance) && (enableDepthCheck == 1.0)) {
float depthsilon = 10.0;
vec2 depthOrigin;
// Horizontal origin for labels comes from a special attribute. If that value is 0, this is a billboard - use the regular origin.
// Otherwise, transform the label origin to -1, 0, 1 (right, center, left).
depthOrigin.x = floor(compressedAttribute2.w - (temp2 * SHIFT_LEFT2));
depthOrigin.x = czm_branchFreeTernary(depthOrigin.x == 0.0, origin.x, depthOrigin.x - 2.0);
depthOrigin.y = origin.y;
vec4 pEC1 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0), depthOrigin, vec2(0.0), 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), depthOrigin, vec2(0.0), 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), depthOrigin, vec2(0.0), pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
float globeDepth3 = getGlobeDepth(pEC3);
if (globeDepth3 != 0.0 && pEC3.z + depthsilon < globeDepth3)
{
// "Discard" this vertex, as three key points fail depth test.
positionEC.xyz = vec3(0.0);
}
}
}
}
#endif
// Write out the eyespace depth before applying the screen space offset, but after potentially "discarding" the vertex
// by setting its eyespace position to zero, via the three-point depth test above.
v_compressed.x = positionEC.z;
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 (disableDepthTestDistanceSq != 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);
// disableDepthTestDistanceSq can be less than zero if it's explicitly set to -1 in JS (as a sentinel value equivalent to infinity)
if (!clipped && (disableDepthTestDistanceSq < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistanceSq)))
{
// Position z on the near plane.
gl_Position.z = -gl_Position.w;
#ifdef LOG_DEPTH
v_depthFromNearPlusOne = 1.0;
#endif
}
}
#endif
#ifdef SDF
vec4 outlineColor = czm_decodeRGB8(sdf.x);
float outlineWidth;
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.a /= 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_splitDirectionAndEllipsoidDepthEC.x = splitDirection;
}
`;var JZe=Object.freeze({NONE:0,LOADING:2,LOADED:3,ERROR:4,FAILED:5}),Ua=JZe;function nm(e){this._billboardCollection=e,this._id=void 0,this._loadState=Ua.NONE,this._loadError=void 0,this._index=-1,this._width=void 0,this._height=void 0,this._hasSubregion=!1,this.dirty=!1}Object.defineProperties(nm.prototype,{loadError:{get:function(){return this._loadError}},loadState:{get:function(){return this._loadState}},ready:{get:function(){return this._loadState===Ua.LOADED}},hasImage:{get:function(){return this._loadState!==Ua.NONE}},id:{get:function(){return this._id}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});nm.prototype.unload=async function(){this._loadState!==Ua.NONE&&(this._id=void 0,this._loadError=void 0,this._loadState=Ua.NONE,this._index=-1,this._width=void 0,this._height=void 0,this.dirty=!0)};nm.prototype.loadImage=async function(e,t,n,i){if(this._id===e)return;let o=this._billboardCollection,r=o.billboardTextureCache,a=r.get(e);if(l(a)&&t.loadState===Ua.LOADING||t.loadState===Ua.LOADED){nm.clone(a,this);return}l(a)||(a=new nm(o),r.set(e,a)),a._id=this._id=e,a._loadState=this._loadState=Ua.LOADING,a._loadError=this._loadError=void 0;let s,c=this._billboardCollection.textureAtlas;try{s=c.addImage(e,t,n,i),s instanceof Promise&&(s=await s)}catch(f){if(a._loadState=Ua.ERROR,a._loadError=f,this._id!==e)return;this._loadState=Ua.ERROR,this._loadError=f;return}if(!l(s)||s===-1){if(a._loadState=Ua.FAILED,a._index=-1,this._id!==e)return;this._loadState=Ua.FAILED,this._index=-1;return}a._index=s,a._loadState=Ua.LOADED;let u=c.rectangles[s];a._width=u.width,a._height=u.height,this._id===e&&(this._index=s,this._loadState=Ua.LOADED,this._width=u.width,this._height=u.height,this.dirty=!0)};nm.prototype.addImageSubRegion=function(e,t){this._id=e,this._loadError=void 0,this._hasSubregion=!0;let i=this._billboardCollection.textureAtlas.addImageSubRegion(e,t);if(typeof i=="number"){this.setImageSubRegion(i,t);return}this.loadImageSubRegion(e,t,i)};nm.prototype.loadImageSubRegion=async function(e,t,n){let i;try{this._loadState=Ua.LOADING,i=await n}catch(o){this._loadState=Ua.ERROR,this._loadError=o;return}this._id===e&&(this._loadState=Ua.LOADED,this.setImageSubRegion(i,t))};nm.prototype.setImageSubRegion=function(e,t){if(this._index!==e){if(!l(e)||e===-1){this._loadState=Ua.FAILED,this._index=-1,this._width=void 0,this._height=void 0;return}this._width=t.width,this._height=t.height,this._index=e,this.dirty=!0}};nm.prototype.computeTextureCoordinates=function(e){return this._billboardCollection.textureAtlas.computeTextureCoordinates(this._index,e)};nm.clone=function(e,t){if(t._id=e._id,t._loadState=e._loadState,t._loadError=void 0,t._index=e._index,t._width=e._width,t._height=e._height,t._hasSubregion=e._hasSubregion,e.ready){t.dirty=!0;return}return(async()=>{let i=e._id;await e._billboardCollection.textureAtlas._indexPromiseById.get(i),t._id===i&&(e._hasSubregion&&await Promise.resolve(),t._id=i,t._loadState=e._loadState,t._loadError=e._loadError,t._index=e._index,t._width=e._width,t._height=e._height,t.dirty=!0)})(),t};var xg=nm;function vi(e,t){e=e??V.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=Ht.clone(n)),l(i)&&(i=Ht.clone(i)),l(o)&&(o=Ht.clone(o)),l(r)&&(r=zt.clone(r)),this._show=e.show??!0,this._position=d.clone(e.position??d.ZERO),this._actualPosition=d.clone(this._position),this._pixelOffset=k.clone(e.pixelOffset??k.ZERO),this._translate=new k(0,0),this._eyeOffset=d.clone(e.eyeOffset??d.ZERO),this._heightReference=e.heightReference??it.NONE,this._verticalOrigin=e.verticalOrigin??jn.CENTER,this._horizontalOrigin=e.horizontalOrigin??Mi.CENTER,this._scale=e.scale??1,this._color=z.clone(e.color??z.WHITE),this._rotation=e.rotation??0,this._alignedAxis=d.clone(e.alignedAxis??d.ZERO),this._width=e.width,this._height=e.height,this._scaleByDistance=o,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=e.sizeInMeters??!1,this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=e.collection??t,this._pickId=void 0,this._pickPrimitive=e._pickPrimitive??this,this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageTexture=new xg(t),this._imageId=e.imageId,this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;let a=e.image;l(a)&&(this._computeImageTextureProperties(e.imageId,a),this._imageTexture.loadImage(this._imageId,a,this._imageWidth,this._imageHeight)),l(e.imageSubRegion)&&this._imageTexture.addImageSubRegion(this._imageId,e.imageSubRegion),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=oe.SCENE3D,this._clusterShow=!0,this._outlineColor=z.clone(e.outlineColor??z.BLACK),this._outlineWidth=e.outlineWidth??0,this._updateClamping(),this._splitDirection=e.splitDirection??Lr.NONE,this._positionFromParent=!1}var Gme=vi.SHOW_INDEX=0,D8=vi.POSITION_INDEX=1,qme=vi.PIXEL_OFFSET_INDEX=2,ZZe=vi.EYE_OFFSET_INDEX=3,$Ze=vi.HORIZONTAL_ORIGIN_INDEX=4,e$e=vi.VERTICAL_ORIGIN_INDEX=5,t$e=vi.SCALE_INDEX=6,Vme=vi.IMAGE_INDEX_INDEX=7,Hme=vi.COLOR_INDEX=8,n$e=vi.ROTATION_INDEX=9,i$e=vi.ALIGNED_AXIS_INDEX=10,o$e=vi.SCALE_BY_DISTANCE_INDEX=11,r$e=vi.TRANSLUCENCY_BY_DISTANCE_INDEX=12,a$e=vi.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,s$e=vi.DISTANCE_DISPLAY_CONDITION=14,c$e=vi.DISABLE_DEPTH_DISTANCE=15;vi.TEXTURE_COORDINATE_BOUNDS=16;var Wme=vi.SDF_INDEX=17,l$e=vi.SPLIT_DIRECTION_INDEX=18;vi.NUMBER_OF_PROPERTIES=19;function vr(e,t){let n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(vi.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,vr(this,Gme))}},position:{get:function(){return this._position},set:function(e){let t=this._position;d.equals(t,e)||(d.clone(e,t),d.clone(e,this._actualPosition),this._updateClamping(),vr(this,D8))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),vr(this,D8))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;k.equals(t,e)||(k.clone(e,t),vr(this,qme))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Ht.equals(t,e)||(this._scaleByDistance=Ht.clone(e,t),vr(this,o$e))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Ht.equals(t,e)||(this._translucencyByDistance=Ht.clone(e,t),vr(this,r$e))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;Ht.equals(t,e)||(this._pixelOffsetScaleByDistance=Ht.clone(e,t),vr(this,a$e))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;d.equals(t,e)||(d.clone(e,t),vr(this,ZZe))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,vr(this,$Ze))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,vr(this,e$e))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,vr(this,t$e))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),vr(this,Hme))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,vr(this,n$e))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;d.equals(t,e)||(d.clone(e,t),vr(this,i$e))}},width:{get:function(){return this._width??this._imageTexture.width},set:function(e){this._width!==e&&(this._width=e,vr(this,Vme))}},height:{get:function(){return this._height??this._imageTexture.height},set:function(e){this._height!==e&&(this._height=e,vr(this,Vme))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,vr(this,Hme))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){zt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=zt.clone(e,this._distanceDisplayCondition),vr(this,s$e))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,vr(this,c$e))}},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._imageTexture.id},set:function(e){if(!l(e)){this._imageTexture.unload();return}this._computeImageTextureProperties(void 0,e),this._imageTexture.loadImage(this._imageId,e,this._imageWidth,this._imageHeight)}},ready:{get:function(){return this._imageTexture.ready}},loadError:{get:function(){return this._imageTexture.loadError}},textureDirty:{get:function(){return this._imageTexture.dirty},set:function(e){this._imageTexture.dirty=e}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=d.clone(e,this._actualClampedPosition),vr(this,D8)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,vr(this,Gme))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),vr(this,Wme))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,vr(this,Wme))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,vr(this,l$e))}}});vi.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};vi.prototype._updateClamping=function(){vi._updateClamping(this._billboardCollection,this)};var v8=new me;vi._updateClamping=function(e,t){if(!l(e)||!l(e._scene))return;let n=e._scene,i=n.ellipsoid??te.default,o=n.frameState.mode,r=o!==t._mode;if(t._mode=o,(t._heightReference===it.NONE||r)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference===it.NONE||t._positionFromParent||!l(t._position))return;l(t._removeCallbackFunc)&&t._removeCallbackFunc();let a=i.cartesianToCartographic(t._position);if(!l(a)){t._actualClampedPosition=void 0;return}function s(u){let f=i.cartographicToCartesian(u,t._clampedPosition);Px(t._heightReference)&&(t._mode===oe.SCENE3D?(u.height+=a.height,i.cartographicToCartesian(u,f)):f.x+=a.height),t._clampedPosition=f}t._removeCallbackFunc=n.updateHeight(a,s,t._heightReference),me.clone(a,v8);let c=n.getHeight(a,t._heightReference);l(c)&&(v8.height=c),s(v8)};vi.prototype.computeTextureCoordinates=function(e){return this._imageTexture.computeTextureCoordinates(e)};vi.prototype.setImage=function(e,t){this._computeImageTextureProperties(e,t),this._imageTexture.loadImage(this._imageId,t,this._imageWidth,this._imageHeight)};vi.prototype.setImageTexture=function(e){xg.clone(e,this._imageTexture)};var jme=512;vi.prototype._computeImageTextureProperties=function(e,t){if(this._imageWidth=void 0,this._imageHeight=void 0,!l(t)){this._imageId=Jn();return}let n;typeof t=="string"?n=t:t instanceof De?n=t._url:l(t.src)&&(n=t.src),this._imageId=e??n??Jn(),l(this._width)&&l(this._height)&&!this._sizeInMeters&&u$e(n)&&(this._imageWidth=Math.min(this._width,jme),this._imageHeight=Math.min(this._height,jme))};function u$e(e){return l(e)?bh(e)?e.startsWith("data:image/svg+xml"):wA(e)==="svg":!1}vi.prototype.setImageSubRegion=function(e,t){this._imageTexture.addImageSubRegion(e,t)};vi.prototype._setTranslate=function(e){let t=this._translate;k.equals(t,e)||(k.clone(e,t),vr(this,qme))};vi.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition};vi.prototype._setActualPosition=function(e){l(this._clampedPosition)||d.clone(e,this._actualPosition),vr(this,D8)};var Yme=new ie;vi._computeActualPosition=function(e,t,n,i){return l(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===oe.SCENE3D?t:(M.multiplyByPoint(i,t,Yme),so.computeActualEllipsoidPosition(n,Yme))};var Kme=new d;vi._computeScreenSpacePosition=function(e,t,n,i,o,r){let a=M.multiplyByPoint(e,t,Kme),s=so.worldWithEyeOffsetToWindowCoordinates(o,a,n,r);if(l(s))return k.add(s,i,s),s};var B8=new k(0,0);vi.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new k),k.clone(this._pixelOffset,B8),k.add(B8,this._translate,B8);let i=n.modelMatrix,o=this._position;if(l(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==oe.SCENE3D)){let a=e.mapProjection,s=a.ellipsoid,c=a.unproject(o,v8);o=s.cartographicToCartesian(c,Kme),i=M.IDENTITY}return vi._computeScreenSpacePosition(i,o,this._eyeOffset,B8,e,t)};vi.getScreenSpaceBoundingBox=function(e,t,n){let i=e.width,o=e.height,r=e.scale;i*=r,o*=r;let a=t.x;e.horizontalOrigin===Mi.RIGHT?a-=i:e.horizontalOrigin===Mi.CENTER&&(a-=i*.5);let s=t.y;return e.verticalOrigin===jn.BOTTOM||e.verticalOrigin===jn.BASELINE?s-=o:e.verticalOrigin===jn.CENTER&&(s-=o*.5),l(n)||(n=new et),n.x=a,n.y=s,n.width=i,n.height=o,n};vi.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&d.equals(this._position,e._position)&&this.image===e.image&&this._show===e._show&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&z.equals(this._color,e._color)&&k.equals(this._pixelOffset,e._pixelOffset)&&k.equals(this._translate,e._translate)&&d.equals(this._eyeOffset,e._eyeOffset)&&Ht.equals(this._scaleByDistance,e._scaleByDistance)&&Ht.equals(this._translucencyByDistance,e._translucencyByDistance)&&Ht.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&zt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};vi.prototype._destroy=function(){l(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};var Ro=vi;var f$e={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2},er=Object.freeze(f$e);var d$e={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},Qs=Object.freeze(d$e);var h$e=Ro.SHOW_INDEX,u1=Ro.POSITION_INDEX,Jme=Ro.PIXEL_OFFSET_INDEX,Zme=Ro.EYE_OFFSET_INDEX,m$e=Ro.HORIZONTAL_ORIGIN_INDEX,p$e=Ro.VERTICAL_ORIGIN_INDEX,A$e=Ro.SCALE_INDEX,z0=Ro.IMAGE_INDEX_INDEX,$me=Ro.COLOR_INDEX,g$e=Ro.ROTATION_INDEX,_$e=Ro.ALIGNED_AXIS_INDEX,epe=Ro.SCALE_BY_DISTANCE_INDEX,tpe=Ro.TRANSLUCENCY_BY_DISTANCE_INDEX,npe=Ro.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,ipe=Ro.DISTANCE_DISPLAY_CONDITION,y$e=Ro.DISABLE_DEPTH_DISTANCE,C$e=Ro.TEXTURE_COORDINATE_BOUNDS,ope=Ro.SDF_INDEX,rpe=Ro.SPLIT_DIRECTION_INDEX,HK=Ro.NUMBER_OF_PROPERTIES,Qo={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 Nd(e){e=e??V.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=e.textureAtlas;l(t)||(t=new LE),this._textureAtlas=t,this._textureAtlasGUID=t.guid,this._destroyTextureAtlas=!0,this._billboardTextureCache=new Map,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(HK),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new le,this._baseVolumeWC=new le,this._baseVolume2D=new le,this._boundingVolume=new le,this._boundingVolumeDirty=!1,this._colorCommands=[],this._allBillboardsReady=!1,this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=M.clone(M.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowTextureAtlas=e.debugShowTextureAtlas??!1,this.blendOption=e.blendOption??er.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=oe.SCENE3D,this._buffersUsage=[Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW],this._highlightColor=z.clone(z.WHITE),this._coarseDepthTestDistance=e.coarseDepthTestDistance??te.default.minimumRadius/10,this._threePointDepthTestDistance=e.threePointDepthTestDistance??te.default.minimumRadius/1e3,this._uniforms={u_atlas:()=>this.textureAtlas.texture,u_highlightColor:()=>this._highlightColor,u_coarseDepthTestDistance:()=>this._coarseDepthTestDistance,u_threePointDepthTestDistance:()=>this._threePointDepthTestDistance};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(Nd.prototype,{length:{get:function(){return WK(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)}},destroyTextureAtlas:{get:function(){return this._destroyTextureAtlas},set:function(e){this._destroyTextureAtlas=e}},sizeInBytes:{get:function(){return this._textureAtlas.sizeInBytes}},ready:{get:function(){return this._allBillboardsReady}},billboardTextureCache:{get:function(){return this._billboardTextureCache}},coarseDepthTestDistance:{get:function(){return this._coarseDepthTestDistance},set:function(e){this._coarseDepthTestDistance=e}},threePointDepthTestDistance:{get:function(){return this._threePointDepthTestDistance},set:function(e){this._threePointDepthTestDistance=e}}});function ape(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Nd.prototype.add=function(e){let t=new Ro(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};Nd.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Nd.prototype.removeAll=function(){ape(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function WK(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 a=n[o];l(a)&&(a._index=r++,t.push(a))}e._billboards=t}}Nd.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};Nd.prototype.contains=function(e){return l(e)&&e._billboardCollection===this};Nd.prototype.get=function(e){return WK(this),this._billboards[e]};function Xme(e){let t=e.cache.billboardCollection_indexBufferInstanced;return l(t)||(t=tt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Re.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function E$e(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return l(t)||(t=tt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Re.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}Nd.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<HK;++i){let o=n[i]===0?Re.STATIC_DRAW:Re.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function b$e(e,t,n,i,o){let r=[{index:Qo.positionHighAndScale,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:n[u1]},{index:Qo.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:n[u1]},{index:Qo.compressedAttribute0,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:n[Jme]},{index:Qo.compressedAttribute1,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:n[tpe]},{index:Qo.compressedAttribute2,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:n[$me]},{index:Qo.eyeOffset,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:n[Zme]},{index:Qo.scaleByDistance,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:n[epe]},{index:Qo.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:n[npe]},{index:Qo.compressedAttribute3,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:n[ipe]},{index:Qo.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:n[C$e]},{index:Qo.splitDirection,componentsPerAttribute:1,componentDatatype:j.FLOAT,usage:n[rpe]},{index:Qo.direction,componentsPerAttribute:2,componentDatatype:j.FLOAT,vertexBuffer:E$e(e)}];return l(i)&&r.push({index:Qo.a_batchId,componentsPerAttribute:1,componentDatatype:j.FLOAT,bufferUsage:Re.STATIC_DRAW}),o&&r.push({index:Qo.sdf,componentsPerAttribute:2,componentDatatype:j.FLOAT,usage:n[ope]}),new OA(e,r,t,!0)}var kK=new xn;function spe(e,t,n,i){let o=n[Qo.positionHighAndScale],r=n[Qo.positionLowAndRotation],a=i._getActualPosition();e._mode===oe.SCENE3D&&(le.expand(e._baseVolume,a,e._baseVolume),e._boundingVolumeDirty=!0),xn.fromCartesian(a,kK);let s=i.scale,c=i.rotation;c!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,s);let u=kK.high,f=kK.low;o(i._index,u.x,u.y,u.z,s),r(i._index,f.x,f.y,f.z,c)}var Yy=new k,Md=32768,jK=65536,UK=4096,G0=256,I$e=128,x$e=32,T$e=8,P8=4,S$e=1/256,cpe=new et;function lpe(e,t,n,i){let o=n[Qo.compressedAttribute0],r=i.pixelOffset,a=r.x,s=r.y,c=i._translate,u=c.x,f=c.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(a+u),Math.abs(-s+f));let h=i.horizontalOrigin,p=i._verticalOrigin,A=i.show&&i.clusterShow;i.color.alpha===0&&(A=!1),p===jn.BASELINE&&(p=jn.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&h===Mi.CENTER,e._allVerticalCenter=e._allVerticalCenter&&p===jn.CENTER;let m=0,_=0;if(i.ready){let v=i.computeTextureCoordinates(cpe);m=v.x,_=v.y}let y=Math.floor(D.clamp(a,-Md,Md)+Md)*I$e;y+=(h+1)*x$e,y+=(p+1)*T$e,y+=(A?1:0)*P8;let C=Math.floor(D.clamp(s,-Md,Md)+Md)*G0,E=Math.floor(D.clamp(u*P8,-Md,Md)+Md)*G0,b=(D.clamp(f*P8,-Md,Md)+Md)*S$e,x=Math.floor(b),S=Math.floor((b-x)*G0);C+=x,E+=S,Yy.x=m,Yy.y=_;let B=tn.compressTextureCoordinates(Yy);o(i._index,y,C,E,B)}function upe(e,t,n,i){let o=n[Qo.compressedAttribute1],r=i.alignedAxis;d.equals(r,d.ZERO)||(e._shaderAlignedAxis=!0);let a=0,s=1,c=1,u=1,f=i.translucencyByDistance;l(f)&&(a=f.near,s=f.nearValue,c=f.far,u=f.farValue,(s!==1||u!==1)&&(e._shaderTranslucencyByDistance=!0));let h=Math.round(i.width??0);e._maxSize=Math.max(e._maxSize,h);let p=D.clamp(h,0,jK),A=0;Math.abs(d.magnitudeSquared(r)-1)<D.EPSILON6&&(A=tn.octEncodeFloat(r)),s=D.clamp(s,0,1),s=s===1?255:s*255|0,p=p*G0+s,u=D.clamp(u,0,1),u=u===1?255:u*255|0,A=A*G0+u,o(i._index,p,A,a,c)}function GK(e,t,n,i){let o=n[Qo.compressedAttribute2],r=i.color,a=l(e._batchTable)?z.WHITE:i.getPickId(t.context).color,s=i.sizeInMeters?1:0,c=Math.abs(d.magnitudeSquared(i.alignedAxis)-1)<D.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&s===1;let u=i.height??0;e._maxSize=Math.max(e._maxSize,u);let f=i._labelHorizontalOrigin??-2;f+=2;let h=tn.encodeRGB8(r),p=tn.encodeRGB8(a),A=z.floatToByte(r.alpha)*jK+z.floatToByte(a.alpha)*G0+(s*2+c),m=u*P8+f;o(i._index,h,p,A,m)}function VK(e,t,n,i){let o=n[Qo.eyeOffset],r=i.eyeOffset,a=r.z;if(i._heightReference!==it.NONE&&(a*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(r.x),Math.abs(r.y),Math.abs(a)),Yy.x=0,Yy.y=0,i.ready){let c=i.computeTextureCoordinates(cpe);Yy.x=c.width,Yy.y=c.height}let s=tn.compressTextureCoordinates(Yy);o(i._index,r.x,r.y,a,s)}function fpe(e,t,n,i){let o=n[Qo.scaleByDistance],r=0,a=1,s=1,c=1,u=i.scaleByDistance;l(u)&&(r=u.near,a=u.nearValue,s=u.far,c=u.farValue,(a!==1||c!==1)&&(e._shaderScaleByDistance=!0)),o(i._index,r,a,s,c)}function dpe(e,t,n,i){let o=n[Qo.pixelOffsetScaleByDistance],r=0,a=1,s=1,c=1,u=i.pixelOffsetScaleByDistance;l(u)&&(r=u.near,a=u.nearValue,s=u.far,c=u.farValue,(a!==1||c!==1)&&(e._shaderPixelOffsetScaleByDistance=!0)),o(i._index,r,a,s,c)}function hpe(e,t,n,i){let o=n[Qo.compressedAttribute3],r=0,a=Number.MAX_VALUE,s=i.distanceDisplayCondition;l(s)&&(r=s.near,a=s.far,r*=r,a*=a,e._shaderDistanceDisplayCondition=!0);let c=i.disableDepthTestDistance,u=gd(i.heightReference)&&t.context.depthTexture;c*=c,(u||c>0)&&(e._shaderDisableDepthDistance=!0,c===Number.POSITIVE_INFINITY&&(c=-1));let f,h;l(i._labelDimensions)?(h=i._labelDimensions.x,f=i._labelDimensions.y):(h=i.width??0,f=i.height??0);let p=Math.floor(D.clamp(h,0,UK)),A=Math.floor(D.clamp(f,0,UK)),m=p*UK+A;o(i._index,r,a,c,m)}function mpe(e,t,n,i){if(gd(i.heightReference)){let s=e._scene,c=t.context,u=t.globeTranslucencyState.translucent,f=l(s.globe)&&s.globe.depthTestAgainstTerrain;e._shaderClampToGround=c.depthTexture&&!u&&f}let o=n[Qo.textureCoordinateBoundsOrLabelTranslate],r=0,a=0;l(i._labelTranslate)&&(r=i._labelTranslate.x,a=i._labelTranslate.y),o(i._index,r,a,0,0)}function w$e(e,t,n,i){if(!l(e._batchTable))return;let o=n[Qo.a_batchId],r=i._batchIndex;o(i._index,r)}function ppe(e,t,n,i){if(!e._sdf)return;let o=n[Qo.sdf],r=i.outlineColor,a=i.outlineWidth,s=tn.encodeRGB8(r),c=a/Qs.RADIUS,u=z.floatToByte(r.alpha)*jK+z.floatToByte(c)*G0;o(i._index,s,u)}function Ape(e,t,n,i){let o=n[Qo.splitDirection],r=0,a=i.splitDirection;l(a)&&(r=a),o(i._index,r)}function B$e(e,t,n,i){spe(e,t,n,i),lpe(e,t,n,i),upe(e,t,n,i),GK(e,t,n,i),VK(e,t,n,i),fpe(e,t,n,i),dpe(e,t,n,i),hpe(e,t,n,i),mpe(e,t,n,i),w$e(e,t,n,i),ppe(e,t,n,i),Ape(e,t,n,i)}function zK(e,t,n,i,o,r){let a;i.mode===oe.SCENE3D?(a=e._baseVolume,e._boundingVolumeDirty=!0):a=e._baseVolume2D;let s=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,h=Ro._computeActualPosition(u,f,i,o);l(h)&&(u._setActualPosition(h),r?s.push(h):le.expand(a,h,a))}r&&le.fromPoints(s,a)}function D$e(e,t){let n=t.mode,i=e._billboards,o=e._billboardsToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==oe.SCENE3D&&!M.equals(r,e.modelMatrix)?(e._mode=n,M.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===oe.SCENE3D||n===oe.SCENE2D||n===oe.COLUMBUS_VIEW)&&zK(e,i,i.length,t,r,!0)):n===oe.MORPHING?zK(e,i,i.length,t,r,!0):(n===oe.SCENE2D||n===oe.COLUMBUS_VIEW)&&zK(e,o,e._billboardsToUpdateIndex,t,r,!1)}function v$e(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 P$e(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=Be.OVERLAY,i}var R$e=[];Nd.prototype.update=function(e){if(WK(this),!this.show)return;let t=e.context;if(!t.instancedArrays||!(Rt.maximumVertexTextureImageUnits>0))throw new de("Beginning in CesiumJS 1.140, billboards and labels require device support for WebGL 2, or WebGL 1 with ANGLE_instanced_arrays and MAX_VERTEX_TEXTURE_IMAGE_UNITS > 0. For more information or to share feedback, see: https://github.com/CesiumGS/cesium/issues/13053");let n=this._billboards,i=n.length,o=!0;for(let v=0;v<i;++v){let P=n[v];l(P.loadError)&&(console.error(`Error loading image for billboard: ${P.loadError}`),P.image=void 0),P.textureDirty&&this._updateBillboard(P,z0),P.show&&(o=o&&P.ready)}let r=this._textureAtlas;if(e.afterRender.push(()=>{if(!this.isDestroyed())return r.update(e.context)}),!l(r.texture))return;D$e(this,e),n=this._billboards,i=n.length;let a=this._billboardsToUpdate,s=this._billboardsToUpdateIndex,c=this._propertiesChanged,u=r.guid,f=this._createVertexArray||this._textureAtlasGUID!==u;this._textureAtlasGUID=u;let h,p=e.passes,A=p.pick;if(f||!A&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let v=0;v<HK;++v)c[v]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),i>0){this._vaf=b$e(t,i,this._buffersUsage,this._batchTable,this._sdf),h=this._vaf.writers;for(let v=0;v<i;++v){let P=this._billboards[v];P._dirty=!1,P.textureDirty=!1,B$e(this,e,h,P)}this._vaf.commit(Xme(t))}this._billboardsToUpdateIndex=0}else if(s>0){let v=R$e;v.length=0,(c[u1]||c[g$e]||c[A$e])&&v.push(spe),(c[z0]||c[Jme]||c[m$e]||c[p$e]||c[h$e])&&(v.push(lpe),v.push(VK)),(c[z0]||c[_$e]||c[tpe])&&(v.push(upe),v.push(GK)),(c[z0]||c[$me])&&v.push(GK),(c[z0]||c[Zme])&&v.push(VK),c[epe]&&v.push(fpe),c[npe]&&v.push(dpe),(c[ipe]||c[y$e]||c[z0]||c[u1])&&v.push(hpe),(c[z0]||c[u1])&&v.push(mpe),c[ope]&&v.push(ppe),c[rpe]&&v.push(Ape);let P=v.length;if(h=this._vaf.writers,s/i>.1){for(let N=0;N<s;++N){let L=a[N];L._dirty=!1,L.textureDirty=!1;for(let g=0;g<P;++g)v[g](this,e,h,L)}this._vaf.commit(Xme(t))}else{for(let N=0;N<s;++N){let L=a[N];L._dirty=!1,L.textureDirty=!1;for(let g=0;g<P;++g)v[g](this,e,h,L);this._vaf.subCommit(L._index,1)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(s>i*1.5&&(a.length=i),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,le.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let m,_=M.IDENTITY;e.mode===oe.SCENE3D?(_=this.modelMatrix,m=le.clone(this._baseVolumeWC,this._boundingVolume)):m=le.clone(this._baseVolume2D,this._boundingVolume),v$e(this,e,m);let y=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,y){this._blendOption===er.OPAQUE||this._blendOption===er.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ve.fromCache({depthTest:{enabled:!0,func:ee.LESS},depthMask:!0}):this._rsOpaque=void 0;let v=this._blendOption===er.TRANSLUCENT;this._blendOption===er.TRANSLUCENT||this._blendOption===er.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ve.fromCache({depthTest:{enabled:!0,func:v?ee.LEQUAL:ee.LESS},depthMask:v,blending:sn.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let C,E,b,x,S;if(y||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=l1,E=c1,S=["INSTANCED"],l(this._batchTable)&&(S.push("VECTOR_TILE"),C=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(C),E=this._batchTable.getFragmentShaderCallback(!1,void 0)(E)),b=new We({defines:S,sources:[C]}),this._shaderRotation&&b.defines.push("ROTATION"),this._shaderAlignedAxis&&b.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&b.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&b.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&b.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&b.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&b.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&b.defines.push("VS_THREE_POINT_DEPTH_CHECK");let v=1-Qs.CUTOFF;this._sdf&&b.defines.push("SDF");let P=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===er.OPAQUE_AND_TRANSLUCENT&&(x=new We({defines:["OPAQUE",P],sources:[E]}),this._shaderClampToGround&&x.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(x.defines.push("SDF"),x.defines.push(`SDF_EDGE ${v}`)),this._sp=$t.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:b,fragmentShaderSource:x,attributeLocations:Qo}),x=new We({defines:["TRANSLUCENT",P],sources:[E]}),this._shaderClampToGround&&x.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(x.defines.push("SDF"),x.defines.push(`SDF_EDGE ${v}`)),this._spTranslucent=$t.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:b,fragmentShaderSource:x,attributeLocations:Qo})),this._blendOption===er.OPAQUE&&(x=new We({defines:[P],sources:[E]}),this._shaderClampToGround&&x.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(x.defines.push("SDF"),x.defines.push(`SDF_EDGE ${v}`)),this._sp=$t.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:b,fragmentShaderSource:x,attributeLocations:Qo})),this._blendOption===er.TRANSLUCENT&&(x=new We({defines:[P],sources:[E]}),this._shaderClampToGround&&x.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(x.defines.push("SDF"),x.defines.push(`SDF_EDGE ${v}`)),this._spTranslucent=$t.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:b,fragmentShaderSource:x,attributeLocations:Qo})),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 B=e.commandList;if(p.render||p.pick){let v=this._colorCommands,P=this._blendOption===er.OPAQUE,N=this._blendOption===er.OPAQUE_AND_TRANSLUCENT,L=this._vaf.va,g=L.length,I=this._uniforms,T;l(this._batchTable)?(I=this._batchTable.getUniformMapCallback()(I),T=this._batchTable.getPickId()):T="v_pickColor",v.length=g;let w=N?g*2:g;for(let R=0;R<w;++R){let O=v[R];l(O)||(O=v[R]=new nt);let G=P||N&&R%2===0;O.pass=G||!N?Be.OPAQUE:Be.TRANSLUCENT,O.owner=this;let F=N?Math.floor(R/2):R;O.boundingVolume=m,O.modelMatrix=_,O.count=L[F].indicesCount,O.shaderProgram=G?this._sp:this._spTranslucent,O.uniformMap=I,O.vertexArray=L[F].va,O.renderState=G?this._rsOpaque:this._rsTranslucent,O.debugShowBoundingVolume=this.debugShowBoundingVolume,O.pickId=T,O.count=6,O.instanceCount=i,B.push(O)}this.debugShowTextureAtlas&&(l(this.debugCommand)||(this.debugCommand=P$e(this,e.context)),B.push(this.debugCommand))}this._allBillboardsReady=o};Nd.prototype.isDestroyed=function(){return!1};Nd.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(),ape(this._billboards),fe(this)};var Sf=Nd;function M$e(e,t,n,i,o){return function(){let r=document.createElement("canvas"),a=o+2*i;r.height=r.width=a;let s=r.getContext("2d");return s.clearRect(0,0,a,a),i!==0&&(s.beginPath(),s.arc(a/2,a/2,a/2,0,2*Math.PI,!0),s.closePath(),s.fillStyle=n,s.fill(),e<1&&(s.save(),s.globalCompositeOperation="destination-out",s.beginPath(),s.arc(a/2,a/2,o/2,0,2*Math.PI,!0),s.closePath(),s.fillStyle="black",s.fill(),s.restore())),s.beginPath(),s.arc(a/2,a/2,o/2,0,2*Math.PI,!0),s.closePath(),s.fillStyle=t,s.fill(),r}}var V0=M$e;var N$e=new me,im=class{constructor(t,n,i,o,r){this._content=t,this._billboard=i,this._label=o,this._polyline=r,this._batchId=n,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),$T(this)}get show(){return this._label.show}set show(t){this._label.show=t,this._billboard.show=t,this._polyline.show=t}get color(){return this._color}set color(t){this._color=z.clone(t,this._color),$T(this)}get pointSize(){return this._pointSize}set pointSize(t){this._pointSize=t,$T(this)}get pointOutlineColor(){return this._pointOutlineColor}set pointOutlineColor(t){this._pointOutlineColor=z.clone(t,this._pointOutlineColor),$T(this)}get pointOutlineWidth(){return this._pointOutlineWidth}set pointOutlineWidth(t){this._pointOutlineWidth=t,$T(this)}get labelColor(){return this._label.fillColor}set labelColor(t){this._label.fillColor=t,this._polyline.show=this._label.show&&t.alpha>0}get labelOutlineColor(){return this._label.outlineColor}set labelOutlineColor(t){this._label.outlineColor=t}get labelOutlineWidth(){return this._label.outlineWidth}set labelOutlineWidth(t){this._label.outlineWidth=t}get font(){return this._label.font}set font(t){this._label.font=t}get labelStyle(){return this._label.style}set labelStyle(t){this._label.style=t}get labelText(){return this._label.text}set labelText(t){l(t)||(t=""),this._label.text=t}get backgroundColor(){return this._label.backgroundColor}set backgroundColor(t){this._label.backgroundColor=t}get backgroundPadding(){return this._label.backgroundPadding}set backgroundPadding(t){this._label.backgroundPadding=t}get backgroundEnabled(){return this._label.showBackground}set backgroundEnabled(t){this._label.showBackground=t}get scaleByDistance(){return this._label.scaleByDistance}set scaleByDistance(t){this._label.scaleByDistance=t,this._billboard.scaleByDistance=t}get translucencyByDistance(){return this._label.translucencyByDistance}set translucencyByDistance(t){this._label.translucencyByDistance=t,this._billboard.translucencyByDistance=t}get distanceDisplayCondition(){return this._label.distanceDisplayCondition}set distanceDisplayCondition(t){this._label.distanceDisplayCondition=t,this._polyline.distanceDisplayCondition=t,this._billboard.distanceDisplayCondition=t}get heightOffset(){return this._heightOffset}set heightOffset(t){let n=this._heightOffset??0,i=this._content.tileset.ellipsoid,o=i.cartesianToCartographic(this._billboard.position,N$e);o.height=o.height-n+t;let r=i.cartographicToCartesian(o);this._billboard.position=r,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],r],this._heightOffset=t}get anchorLineEnabled(){return this._polyline.show}set anchorLineEnabled(t){this._polyline.show=t}get anchorLineColor(){return this._polyline.material.uniforms.color}set anchorLineColor(t){this._polyline.material.uniforms.color=z.clone(t,this._polyline.material.uniforms.color)}get image(){return this._billboardImage}set image(t){let n=this._billboardImage!==t;this._billboardImage=t,n&&$T(this)}get disableDepthTestDistance(){return this._label.disableDepthTestDistance}set disableDepthTestDistance(t){this._label.disableDepthTestDistance=t,this._billboard.disableDepthTestDistance=t}get horizontalOrigin(){return this._billboard.horizontalOrigin}set horizontalOrigin(t){this._billboard.horizontalOrigin=t}get verticalOrigin(){return this._billboard.verticalOrigin}set verticalOrigin(t){this._billboard.verticalOrigin=t}get labelHorizontalOrigin(){return this._label.horizontalOrigin}set labelHorizontalOrigin(t){this._label.horizontalOrigin=t}get labelVerticalOrigin(){return this._label.verticalOrigin}set labelVerticalOrigin(t){this._label.verticalOrigin=t}get content(){return this._content}get tileset(){return this._content.tileset}get primitive(){return this._content.tileset}get pickIds(){let t=this._pickIds;return t[0]=this._billboard.pickId,t[1]=this._label.pickId,t[2]=this._polyline.pickId,t}hasProperty(t){return this._content.batchTable.hasProperty(this._batchId,t)}getPropertyIds(t){return this._content.batchTable.getPropertyIds(this._batchId,t)}getProperty(t){return this._content.batchTable.getProperty(this._batchId,t)}getPropertyInherited(t){return Ns.getPropertyInherited(this._content,this._batchId,t)}setProperty(t,n){this._content.batchTable.setProperty(this._batchId,t,n),this._content.featurePropertiesDirty=!0}isExactClass(t){return this._content.batchTable.isExactClass(this._batchId,t)}isClass(t){return this._content.batchTable.isClass(this._batchId,t)}getExactClassName(){return this._content.batchTable.getExactClassName(this._batchId)}};Rn(im,"defaultColor",z.WHITE),Rn(im,"defaultPointOutlineColor",z.BLACK),Rn(im,"defaultPointOutlineWidth",0),Rn(im,"defaultPointSize",8);function $T(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=e._color??im.defaultColor,i=e._pointOutlineColor??im.defaultPointOutlineColor,o=e._pointOutlineWidth??im.defaultPointOutlineWidth,r=e._pointSize??im.defaultPointSize,a=e._billboardColor,s=e._billboardOutlineColor,c=e._billboardOutlineWidth,u=e._billboardSize;if(z.equals(n,a)&&z.equals(i,s)&&o===c&&r===u)return;e._billboardColor=z.clone(n,e._billboardColor),e._billboardOutlineColor=z.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=o,e._billboardSize=r;let f=n.alpha,h=n.toCssColorString(),p=i.toCssColorString(),A=JSON.stringify([h,r,p,o]);t.setImage(A,V0(f,h,p,o,r))}var Tg=im;function L$e(e,t){let n=e.measureText(t);if(!/\S/.test(t))return{width:n.width,height:0,ascent:0,descent:0,minx:0};let o=Math.round(n.actualBoundingBoxAscent),r=Math.round(n.actualBoundingBoxDescent),a=Math.max(o+r,1);return{width:n.width,height:a,ascent:o,descent:r,minx:-Math.round(n.actualBoundingBoxLeft)}}var H0;function O$e(e,t){if(e==="")return;t=t??V.EMPTY_OBJECT;let n=t.font??"10px sans-serif",i=t.stroke??!1,o=t.fill??!0,r=t.strokeWidth??1,a=t.backgroundColor??z.TRANSPARENT,s=t.padding??0,c=s*2,u=document.createElement("canvas");u.width=1,u.height=1,u.style.font=n;let f=u.getContext("2d",{willReadFrequently:!0});l(H0)||(l(f.imageSmoothingEnabled)?H0="imageSmoothingEnabled":l(f.mozImageSmoothingEnabled)?H0="mozImageSmoothingEnabled":l(f.webkitImageSmoothingEnabled)?H0="webkitImageSmoothingEnabled":l(f.msImageSmoothingEnabled)&&(H0="msImageSmoothingEnabled")),f.font=n,f.lineJoin="round",f.lineWidth=r,f[H0]=!1,u.style.visibility="hidden",document.body.appendChild(u);let h=L$e(f,e);u.dimensions=h,document.body.removeChild(u),u.style.visibility="";let p=!/\S/.test(e),A=i&&!p?Math.ceil(r/2):0,m=A*2,_=-h.minx+A,y=Math.ceil(h.width)+_+c+A,C=h.height+c+m,E=h.ascent+s+A;if(u.width=y,u.height=C,f.font=n,f.lineJoin="round",f.lineWidth=r,f[H0]=!1,a!==z.TRANSPARENT&&(f.fillStyle=a.toCssColorString(),f.fillRect(0,0,u.width,u.height)),i){let b=t.strokeColor??z.BLACK;f.strokeStyle=b.toCssColorString(),f.strokeText(e,_+s,E)}if(o){let b=t.fillColor??z.WHITE;f.fillStyle=b.toCssColorString(),f.fillText(e,_+s,E)}return u}var W0=O$e;var Bpe=Wr(Cpe(),1);var Q$e={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2},pr=Object.freeze(Q$e);var Epe={},bpe=0,k$e=256,U$e=new z(.165,.165,.165,.8),z$e=new k(7,5),Ja=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function j0(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function d1(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function h1(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function xpe(e){let t=Epe[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(h1(n,"line-height"));isNaN(i)&&(i=void 0),t={family:h1(n,"font-family"),size:h1(n,"font-size").replace("px",""),style:h1(n,"font-style"),weight:h1(n,"font-weight"),lineHeight:i},document.body.removeChild(n),bpe<k$e&&(Epe[e._font]=t,bpe++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function om(e,t){e=e??V.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=Ht.clone(n)),l(i)&&(i=Ht.clone(i)),l(o)&&(o=Ht.clone(o)),l(r)&&(r=zt.clone(r)),this._renderedText=void 0,this._text=void 0,this._show=e.show??!0,this._font=e.font??"30px sans-serif",this._fillColor=z.clone(e.fillColor??z.WHITE),this._outlineColor=z.clone(e.outlineColor??z.BLACK),this._outlineWidth=e.outlineWidth??1,this._showBackground=e.showBackground??!1,this._backgroundColor=z.clone(e.backgroundColor??U$e),this._backgroundPadding=k.clone(e.backgroundPadding??z$e),this._style=e.style??pr.FILL,this._verticalOrigin=e.verticalOrigin??jn.BASELINE,this._horizontalOrigin=e.horizontalOrigin??Mi.LEFT,this._pixelOffset=k.clone(e.pixelOffset??k.ZERO),this._eyeOffset=d.clone(e.eyeOffset??d.ZERO),this._position=d.clone(e.position??d.ZERO),this._scale=e.scale??1,this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=o,this._heightReference=e.heightReference??it.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=e.text??"",this._relativeSize=1,xpe(this),this._updateClamping()}Object.defineProperties(om.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(!d.equals(t,e)){d.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let a=n[o].billboard;l(a)&&(a.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),d1(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(this._text!==e){this._text=e;let t=om.filterUnsupportedCharacters(e);this._renderedText=om.enableRightToLeftDetection?Y$e(t):t,j0(this)}}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,j0(this),xpe(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){let t=this._fillColor;z.equals(t,e)||(z.clone(e,t),j0(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),j0(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,j0(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,j0(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){let t=this._backgroundColor;if(!z.equals(t,e)){z.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;k.equals(t,e)||(k.clone(e,t),d1(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,j0(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;if(!k.equals(t,e)){k.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let a=n[o];l(a.billboard)&&(a.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(!Ht.equals(t,e)){this._translucencyByDistance=Ht.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let a=n[o];l(a.billboard)&&(a.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(!Ht.equals(t,e)){this._pixelOffsetScaleByDistance=Ht.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let a=n[o];l(a.billboard)&&(a.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(!Ht.equals(t,e)){this._scaleByDistance=Ht.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let a=n[o];l(a.billboard)&&(a.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(!d.equals(t,e)){d.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let a=n[o];l(a.billboard)&&(a.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,d1(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),d1(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),d1(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!zt.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=zt.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=d.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)}}},ready:{get:function(){if(this._rebindAllGlyphs||this._repositionAllGlyphs||l(this._backgroundBillboard)&&!this._backgroundBillboard.ready)return!1;let e=this._glyphs;for(let t=0,n=e.length;t<n;t++){let i=e[t];if(l(i.billboard)&&!i.billboard.ready)return!1}return!0}}});om.prototype._updateClamping=function(){Ro._updateClamping(this._labelCollection,this)};om.prototype.computeScreenSpacePosition=function(e,t){l(t)||(t=new k);let i=this._labelCollection.modelMatrix,o=l(this._actualClampedPosition)?this._actualClampedPosition:this._position;return Ro._computeScreenSpacePosition(i,o,this._eyeOffset,this._pixelOffset,e,t)};om.getScreenSpaceBoundingBox=function(e,t,n){let i=0,o=0,r=0,a=0,s=e.totalScale,c=e._backgroundBillboard;if(l(c))i=t.x+c._translate.x,o=t.y-c._translate.y,r=c.width*s,a=c.height*s,e.verticalOrigin===jn.BOTTOM||e.verticalOrigin===jn.BASELINE?o-=a:e.verticalOrigin===jn.CENTER&&(o-=a*.5);else{i=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;let u=0,f=0,h=e._glyphs,p=h.length;for(let A=0;A<p;++A){let m=h[A],_=m.billboard;if(!l(_))continue;let y=t.x+_._translate.x,C=t.y-_._translate.y,E=m.dimensions.width*s,b=m.dimensions.height*s;e.verticalOrigin===jn.BOTTOM||e.verticalOrigin===jn.BASELINE?C-=b:e.verticalOrigin===jn.CENTER&&(C-=b*.5),e._verticalOrigin===jn.TOP?C+=Qs.PADDING*s:(e._verticalOrigin===jn.BOTTOM||e._verticalOrigin===jn.BASELINE)&&(C-=Qs.PADDING*s),i=Math.min(i,y),o=Math.min(o,C),u=Math.max(u,y+E),f=Math.max(f,C+b)}r=u-i,a=f-o}return l(n)||(n=new et),n.x=i,n.y=o,n.width=r,n.height=a,n};om.filterUnsupportedCharacters=function(e){let t=new RegExp(/[\u0000-\u0008\u000E-\u001F\u00ad\u202a-\u206f\u200b-\u200f]/,"g");return e.replace(t,"")};om.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&&d.equals(this._position,e._position)&&z.equals(this._fillColor,e._fillColor)&&z.equals(this._outlineColor,e._outlineColor)&&z.equals(this._backgroundColor,e._backgroundColor)&&k.equals(this._backgroundPadding,e._backgroundPadding)&&k.equals(this._pixelOffset,e._pixelOffset)&&d.equals(this._eyeOffset,e._eyeOffset)&&Ht.equals(this._translucencyByDistance,e._translucencyByDistance)&&Ht.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Ht.equals(this._scaleByDistance,e._scaleByDistance)&&zt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id};om.prototype.isDestroyed=function(){return!1};om.enableRightToLeftDetection=!1;function G$e(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,o=[],r="",a=Ja.LTR,s="",c=e.length;for(let u=0;u<c;++u){let f=e.charAt(u);t.test(f)?s=Ja.RTL:n.test(f)?s=Ja.LTR:i.test(f)?s=Ja.BRACKETS:s=Ja.WEAK,u===0&&(a=s),a===s&&s!==Ja.BRACKETS?r+=f:(r!==""&&o.push({Type:a,Word:r}),a=s,r=f)}return o.push({Type:s,Word:r}),o}function V$e(e){return e.split("").reverse().join("")}function m1(e,t,n){return e.slice(0,t)+n+e.slice(t)}function H$e(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var W$e="\u05D0-\u05EA",j$e="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",Ipe=new RegExp(`[${W$e}${j$e}]`);function Y$e(e){let t=e.split(`
`),n="";for(let i=0;i<t.length;i++){let o=t[i],r=Ipe.test(o.charAt(0)),a=G$e(o,Ipe),s=0,c="";for(let u=0;u<a.length;++u){let f=a[u],h=f.Type===Ja.BRACKETS?H$e(f.Word):V$e(f.Word);r?f.Type===Ja.RTL?(c=h+c,s=0):f.Type===Ja.LTR?(c=m1(c,s,f.Word),s+=f.Word.length):(f.Type===Ja.WEAK||f.Type===Ja.BRACKETS)&&(f.Type===Ja.WEAK&&a[u-1].Type===Ja.BRACKETS?c=h+c:a[u-1].Type===Ja.RTL?(c=h+c,s=0):a.length>u+1?a[u+1].Type===Ja.RTL?(c=h+c,s=0):(c=m1(c,s,f.Word),s+=f.Word.length):c=m1(c,0,h)):f.Type===Ja.RTL?c=m1(c,s,h):f.Type===Ja.LTR?(c+=f.Word,s=c.length):(f.Type===Ja.WEAK||f.Type===Ja.BRACKETS)&&(u>0&&a[u-1].Type===Ja.RTL?a.length>u+1?a[u+1].Type===Ja.RTL?c=m1(c,s,h):(c+=f.Word,s=c.length):c+=f.Word:(c+=f.Word,s=c.length))}n+=c,i<t.length-1&&(n+=`
`)}return n}var qy=om;var Dpe=Wr(Tpe(),1);function K$e(){this.dimensions=void 0,this.billboardTexture=void 0,this.billboard=void 0}var X$e=1.2,Spe="ID_WHITE_PIXEL",YK=new k(4,4),J$e=new et(1,1,1,1);function Z$e(e,t){let n=t._backgroundBillboardTexture;if(!n.hasImage){let o=document.createElement("canvas");o.width=YK.x,o.height=YK.y;let r=o.getContext("2d");r.fillStyle="#fff",r.fillRect(0,0,o.width,o.height),n.loadImage(Spe,o),n.addImageSubRegion(Spe,J$e)}let i=e.add({collection:t});return i.setImageTexture(n),i._positionFromParent=!0,i._labelTranslate=new k,i}var Sg={};function $$e(e,t,n,i,o,r){return Sg.font=t,Sg.fillColor=n,Sg.strokeColor=i,Sg.strokeWidth=o,Sg.padding=Qs.PADDING,Sg.fill=r===pr.FILL||r===pr.FILL_AND_OUTLINE,Sg.stroke=r===pr.OUTLINE||r===pr.FILL_AND_OUTLINE,Sg.backgroundColor=z.BLACK,W0(e,Sg)}function qK(e,t){let n=t.billboard;l(n)&&(n.show=!1,n._clampedPosition=void 0,l(n._removeCallbackFunc)&&(n._removeCallbackFunc(),n._removeCallbackFunc=void 0),e._spareBillboards.push(n),t.billboard=void 0)}var eet=new Dpe.default,tet=/\s/;function net(e,t){let n=t._renderedText,i=eet.splitGraphemes(n),o=i.length,r=t._glyphs,a=r.length;if(t._relativeSize=t._fontSize/Qs.FONT_SIZE,o<a)for(let p=o;p<a;++p)qK(e,r[p]);r.length=o;let s=t._backgroundBillboard,c=e._backgroundBillboardCollection;t._showBackground&&!l(s)&&(s=Z$e(c,e),t._backgroundBillboard=s),iet(c,t,s);let u=e._glyphBillboardCollection,f=u.billboardTextureCache,h=e._textDimensionsCache;for(let p=0;p<o;++p){let A=i[p],m=t._verticalOrigin,_=JSON.stringify([A,t._fontFamily,t._fontStyle,t._fontWeight,+m]),y=h[_],C=f.get(_);if(!l(C)||!l(y)){C=new xg(u),f.set(_,C);let S=`${t._fontStyle} ${t._fontWeight} ${Qs.FONT_SIZE}px ${t._fontFamily}`,B=$$e(A,S,z.WHITE,z.WHITE,0,pr.FILL);if(y=B.dimensions,h[_]=y,B.width>0&&B.height>0&&!tet.test(A)){let v=(0,Bpe.default)(B,{cutoff:Qs.CUTOFF,radius:Qs.RADIUS}),P=B.getContext("2d"),N=B.width,L=B.height,g=P.getImageData(0,0,N,L);for(let I=0;I<N;I++)for(let T=0;T<L;T++){let w=T*N+I,R=v[w]*255,O=w*4;g.data[O+0]=R,g.data[O+1]=R,g.data[O+2]=R,g.data[O+3]=R}P.putImageData(g,0,0),C.loadImage(_,B)}}let E=r[p];if(l(E)||(E=new K$e,E.dimensions=y,E.billboardTexture=C,r[p]=E),E.billboardTexture.id!==_&&(E.billboardTexture=C,E.dimensions=y),!C.hasImage){qK(e,E);continue}let b=E.billboard,x=e._spareBillboards;l(b)||(x.length>0?b=x.pop():(b=u.add({collection:e}),b._labelDimensions=new k,b._labelTranslate=new k,b._positionFromParent=!0),E.billboard=b),b.setImageTexture(C),b.show=t._show,b.position=t._position,b.eyeOffset=t._eyeOffset,b.pixelOffset=t._pixelOffset,b.horizontalOrigin=Mi.LEFT,b.verticalOrigin=t._verticalOrigin,b.heightReference=t._heightReference,l(t._clampedPosition)&&(b._clampedPosition=t._clampedPosition),b.scale=t.totalScale,b.pickPrimitive=t,b.id=t._id,b.translucencyByDistance=t._translucencyByDistance,b.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,b.scaleByDistance=t._scaleByDistance,b.distanceDisplayCondition=t._distanceDisplayCondition,b.disableDepthTestDistance=t._disableDepthTestDistance,b._batchIndex=t._batchIndex,b.outlineColor=t.outlineColor,t.style===pr.FILL_AND_OUTLINE?(b.color=t._fillColor,b.outlineWidth=t.outlineWidth):t.style===pr.FILL?(b.color=t._fillColor,b.outlineWidth=0):t.style===pr.OUTLINE&&(b.color=z.TRANSPARENT,b.outlineWidth=t.outlineWidth)}t._repositionAllGlyphs=!0}function iet(e,t,n){if(!l(n))return;let i=t.show&&t._showBackground&&t._renderedText.split(`
`).join("").length>0;if(t.show&&!i){e.remove(n),t._backgroundBillboard=n=void 0;return}n.color=t._backgroundColor,n.show=t._show,n.position=t._position,n.eyeOffset=t._eyeOffset,n.pixelOffset=t._pixelOffset,n.horizontalOrigin=Mi.LEFT,n.verticalOrigin=t._verticalOrigin,n.heightReference=t._heightReference,l(t._clampedPosition)&&(n._clampedPosition=t._clampedPosition),n.scale=t.totalScale,n.pickPrimitive=t,n.id=t._id,n.translucencyByDistance=t._translucencyByDistance,n.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,n.scaleByDistance=t._scaleByDistance,n.distanceDisplayCondition=t._distanceDisplayCondition,n.disableDepthTestDistance=t._disableDepthTestDistance,n.clusterShow=t.clusterShow}function wpe(e,t,n){return t===Mi.CENTER?-e/2:t===Mi.RIGHT?-(e+n.x):n.x}var Qr=new k,oet=new k;function ret(e){let t=e._glyphs,n=e._renderedText,i=0,o=0,r=[],a=Number.NEGATIVE_INFINITY,s=0,c=1,u=t.length,f=e._backgroundBillboard,h=k.clone(l(f)?e._backgroundPadding:k.ZERO,oet);h.x/=e._relativeSize,h.y/=e._relativeSize;for(let N=0;N<u;++N){if(n.charAt(N)===`
`){r.push(i),++c,i=0;continue}let g=t[N].dimensions;l(g)&&(s=Math.max(s,g.height-g.descent),a=Math.max(a,g.descent),i+=g.width-g.minx,N<u-1&&(i+=t[N+1].dimensions.minx),o=Math.max(o,i))}r.push(i);let p=s+a,A=e.totalScale,m=e._horizontalOrigin,_=e._verticalOrigin,y=0,C=r[y],E=wpe(C,m,h),b=(l(e._lineHeight)?e._lineHeight:X$e*e._fontSize)/e._relativeSize,x=b*(c-1),S=o,B=p+x;l(f)&&(S+=h.x*2,B+=h.y*2,f._labelHorizontalOrigin=m),Qr.x=E*A,Qr.y=0;let v=!0,P=0;for(let N=0;N<u;++N){if(n.charAt(N)===`
`){++y,P+=b,C=r[y],E=wpe(C,m,h),Qr.x=E*A,v=!0;continue}let L=t[N],g=L.dimensions;if(l(g)&&(_===jn.TOP?(Qr.y=g.height-s-h.y,Qr.y+=Qs.PADDING):_===jn.CENTER?Qr.y=(x+g.height-s)/2:_===jn.BASELINE?(Qr.y=x,Qr.y-=Qs.PADDING):(Qr.y=x+a+h.y,Qr.y-=Qs.PADDING),Qr.y=(Qr.y-g.descent-P)*A,v&&(Qr.x-=Qs.PADDING*A,v=!1),l(L.billboard)&&(L.billboard._setTranslate(Qr),L.billboard._labelDimensions.x=S,L.billboard._labelDimensions.y=B,L.billboard._labelHorizontalOrigin=m,gd(e.heightReference)&&(L.billboard._labelTranslate=k.clone(Qr,L.billboard._labelTranslate))),N<u-1)){let I=t[N+1];Qr.x+=(g.width-g.minx+I.dimensions.minx)*A}}l(f)&&n.split(`
`).join("").length>0&&(m===Mi.CENTER?E=-o/2-h.x:m===Mi.RIGHT?E=-(o+h.x*2):E=0,Qr.x=E*A,_===jn.TOP?Qr.y=p-s-a:_===jn.CENTER?Qr.y=(p-s)/2-a:_===jn.BASELINE?Qr.y=-h.y-a:Qr.y=0,Qr.y=Qr.y*A,f.width=S,f.height=B,f._setTranslate(Qr),f._labelTranslate=k.clone(Qr,f._labelTranslate))}function vpe(e,t){let n=t._glyphs;for(let i=0,o=n.length;i<o;++i)qK(e,n[i]);l(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,l(t._removeCallbackFunc)&&t._removeCallbackFunc(),fe(t)}function wp(e){e=e??V.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=new Sf({scene:this._scene,textureAtlas:new LE({initialSize:YK}),coarseDepthTestDistance:e.coarseDepthTestDistance,threePointDepthTestDistance:e.threePointDepthTestDistance});this._backgroundBillboardCollection=t,this._backgroundBillboardTexture=new xg(t),this._glyphBillboardCollection=new Sf({scene:this._scene,batchTable:this._batchTable,coarseDepthTestDistance:e.coarseDepthTestDistance,threePointDepthTestDistance:e.threePointDepthTestDistance}),this._glyphBillboardCollection._sdf=!0,this._spareBillboards=[],this._textDimensionsCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._highlightColor=z.clone(z.WHITE),this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??er.OPAQUE_AND_TRANSLUCENT}Object.defineProperties(wp.prototype,{length:{get:function(){return this._labels.length}},sizeInBytes:{get:function(){return this._glyphBillboardCollection.sizeInBytes+this._backgroundBillboardCollection.sizeInBytes}},ready:{get:function(){let e=this._backgroundBillboardCollection.get(0);return l(e)&&!e.ready?!1:this._glyphBillboardCollection.ready}},coarseDepthTestDistance:{get:function(){return this._backgroundBillboardCollection.coarseDepthTestDistance},set:function(e){this._backgroundBillboardCollection.coarseDepthTestDistance=e,this._glyphBillboardCollection.coarseDepthTestDistance=e}},threePointDepthTestDistance:{get:function(){return this._backgroundBillboardCollection.threePointDepthTestDistance},set:function(e){this._backgroundBillboardCollection.threePointDepthTestDistance=e,this._glyphBillboardCollection.threePointDepthTestDistance=e}}});wp.prototype.add=function(e){let t=new qy(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};wp.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),vpe(this,e),!0}return!1};wp.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)vpe(this,e[t]);e.length=0};wp.prototype.contains=function(e){return l(e)&&e._labelCollection===this};wp.prototype.get=function(e){return this._labels[e]};wp.prototype.update=function(e){if(!this.show)return;let t=this._glyphBillboardCollection,n=this._backgroundBillboardCollection;t.modelMatrix=this.modelMatrix,t.debugShowBoundingVolume=this.debugShowBoundingVolume,n.modelMatrix=this.modelMatrix,n.debugShowBoundingVolume=this.debugShowBoundingVolume;let i=this._labelsToUpdate.length;for(let r=0;r<i;++r){let a=this._labelsToUpdate[r];if(a.isDestroyed())continue;let s=a._glyphs.length;a._rebindAllGlyphs&&(net(this,a),a._rebindAllGlyphs=!1),a._repositionAllGlyphs&&(ret(a),a._repositionAllGlyphs=!1);let c=a._glyphs.length-s;this._totalGlyphCount+=c}let o=n.length>0?er.TRANSLUCENT:this.blendOption;t.blendOption=o,n.blendOption=o,t._highlightColor=this._highlightColor,n._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,n.update(e),t.update(e)};wp.prototype.isDestroyed=function(){return!1};wp.prototype.destroy=function(){return this.removeAll(),this._glyphBillboardCollection=this._glyphBillboardCollection.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),fe(this)};var Bp=wp;var p1=`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 Xl={};Xl.numberOfPoints=function(e,t,n){let i=d.distance(e,t);return Math.ceil(i/n)};Xl.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 aet=new me;Xl.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,aet).height}return i};var set=new M,cet=new d,Ppe=new d,uet=new cn(d.UNIT_X,0),Rpe=new d,fet=new cn(d.UNIT_X,0),det=new d,het=new d,XK=[];function Npe(e,t,n){let i=XK;i.length=e;let o;if(t===n){for(o=0;o<e;o++)i[o]=t;return i}let a=(n-t)/e;for(o=0;o<e;o++){let s=t+o*a;i[o]=s}return i}var N8=new me,M8=new me,Ky=new d,JK=new d,met=new d,KK=new zA,A1=new Sc;function pet(e,t,n,i,o,r,a,s){let c=i.scaleToGeodeticSurface(e,JK),u=i.scaleToGeodeticSurface(t,met),f=Xl.numberOfPoints(e,t,n),h=i.cartesianToCartographic(c,N8),p=i.cartesianToCartographic(u,M8),A=Npe(f,o,r);KK.setEndPoints(h,p);let m=KK.surfaceDistance/f,_=s;h.height=o;let y=i.cartographicToCartesian(h,Ky);d.pack(y,a,_),_+=3;for(let C=1;C<f;C++){let E=KK.interpolateUsingSurfaceDistance(C*m,M8);E.height=A[C],y=i.cartographicToCartesian(E,Ky),d.pack(y,a,_),_+=3}return _}function Aet(e,t,n,i,o,r,a,s){let c=i.cartesianToCartographic(e,N8),u=i.cartesianToCartographic(t,M8),f=Xl.numberOfPointsRhumbLine(c,u,n);c.height=0,u.height=0;let h=Npe(f,o,r);A1.ellipsoid.equals(i)||(A1=new Sc(void 0,void 0,i)),A1.setEndPoints(c,u);let p=A1.surfaceDistance/f,A=s;c.height=o;let m=i.cartographicToCartesian(c,Ky);d.pack(m,a,A),A+=3;for(let _=1;_<f;_++){let y=A1.interpolateUsingSurfaceDistance(_*p,M8);y.height=h[_],m=i.cartographicToCartesian(y,Ky),d.pack(m,a,A),A+=3}return A}Xl.wrapLongitude=function(e,t){let n=[],i=[];if(l(e)&&e.length>0){t=t??M.IDENTITY;let o=M.inverseTransformation(t,set),r=M.multiplyByPoint(o,d.ZERO,cet),a=d.normalize(M.multiplyByPointAsVector(o,d.UNIT_Y,Ppe),Ppe),s=cn.fromPointNormal(r,a,uet),c=d.normalize(M.multiplyByPointAsVector(o,d.UNIT_X,Rpe),Rpe),u=cn.fromPointNormal(r,c,fet),f=1;n.push(d.clone(e[0]));let h=n[0],p=e.length;for(let A=1;A<p;++A){let m=e[A];if(cn.getPointDistance(u,h)<0||cn.getPointDistance(u,m)<0){let _=di.lineSegmentPlane(h,m,s,det);if(l(_)){let y=d.multiplyByScalar(a,5e-9,het);cn.getPointDistance(s,h)<0&&d.negate(y,y),n.push(d.add(_,y,new d)),i.push(f+1),d.negate(y,y),n.push(d.add(_,y,new d)),f=1}}n.push(d.clone(e[A])),f++,h=m}i.push(f)}return{positions:n,lengths:i}};Xl.generateArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=e.ellipsoid??te.default,o=e.height??0,r=Array.isArray(o);if(n<1)return[];if(n===1){let _=i.scaleToGeodeticSurface(t[0],JK);if(o=r?o[0]:o,o!==0){let y=i.geodeticSurfaceNormal(_,Ky);d.multiplyByScalar(y,o,y),d.add(_,y,_)}return[_.x,_.y,_.z]}let a=e.minDistance;if(!l(a)){let _=e.granularity??D.RADIANS_PER_DEGREE;a=D.chordLength(_,i.maximumRadius)}let s=0,c;for(c=0;c<n-1;c++)s+=Xl.numberOfPoints(t[c],t[c+1],a);let u=(s+1)*3,f=new Array(u),h=0;for(c=0;c<n-1;c++){let _=t[c],y=t[c+1],C=r?o[c]:o,E=r?o[c+1]:o;h=pet(_,y,a,i,C,E,f,h)}XK.length=0;let p=t[n-1],A=i.cartesianToCartographic(p,N8);A.height=r?o[n-1]:o;let m=i.cartographicToCartesian(A,Ky);return d.pack(m,f,u-3),f};var Mpe=new me,get=new me;Xl.generateRhumbArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=e.ellipsoid??te.default,o=e.height??0,r=Array.isArray(o);if(n<1)return[];if(n===1){let C=i.scaleToGeodeticSurface(t[0],JK);if(o=r?o[0]:o,o!==0){let E=i.geodeticSurfaceNormal(C,Ky);d.multiplyByScalar(E,o,E),d.add(C,E,C)}return[C.x,C.y,C.z]}let a=e.granularity??D.RADIANS_PER_DEGREE,s=0,c,u=i.cartesianToCartographic(t[0],Mpe),f;for(c=0;c<n-1;c++)f=i.cartesianToCartographic(t[c+1],get),s+=Xl.numberOfPointsRhumbLine(u,f,a),u=me.clone(f,Mpe);let h=(s+1)*3,p=new Array(h),A=0;for(c=0;c<n-1;c++){let C=t[c],E=t[c+1],b=r?o[c]:o,x=r?o[c+1]:o;A=Aet(C,E,a,i,b,x,p,A)}XK.length=0;let m=t[n-1],_=i.cartesianToCartographic(m,N8);_.height=r?o[n-1]:o;let y=i.cartographicToCartesian(_,Ky);return d.pack(y,p,h-3),p};Xl.generateCartesianArc=function(e){let t=Xl.generateArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=d.unpack(t,o*3);return i};Xl.generateCartesianRhumbArc=function(e){let t=Xl.generateRhumbArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=d.unpack(t,o*3);return i};var Xi=Xl;function wf(e,t){e=e??V.EMPTY_OBJECT,this._show=e.show??!0,this._width=e.width??1,this._loop=e.loop??!1,this._distanceDisplayCondition=e.distanceDisplayCondition,this._material=e.material,l(this._material)||(this._material=Yi.fromType(Yi.ColorType,{color:new z(1,1,1,1)}));let n=e.positions;l(n)||(n=[]),this._positions=n,this._actualPositions=Ho(n,d.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(d.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id;let i;l(t)&&(i=M.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=Xi.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(Ope),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=le.fromPoints(this._actualPositions),this._boundingVolumeWC=le.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new le}var Lpe=wf.POSITION_INDEX=0,_et=wf.SHOW_INDEX=1,yet=wf.WIDTH_INDEX=2,Cet=wf.MATERIAL_INDEX=3,g1=wf.POSITION_SIZE_INDEX=4,Eet=wf.DISTANCE_DISPLAY_CONDITION=5,Ope=wf.NUMBER_OF_PROPERTIES=6;function wg(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(wf.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,wg(this,_et))}},positions:{get:function(){return this._positions},set:function(e){let t=Ho(e,d.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(d.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&wg(this,g1),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=le.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=le.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),wg(this,Lpe),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,wg(this,Cet))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,wg(this,yet))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!d.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(d.clone(t[0]))):t.length>2&&d.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,wg(this,g1)}}},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){zt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=zt.clone(e,this._distanceDisplayCondition),wg(this,Eet))}}});wf.prototype.update=function(){let e=M.IDENTITY;l(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[Lpe]>0||this._propertiesChanged[g1]>0;if((!M.equals(e,this._modelMatrix)||i)&&(this._segments=Xi.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=le.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=M.clone(e,this._modelMatrix),this._segments.positions.length!==t)wg(this,g1);else{let o=n.length;for(let r=0;r<o;++r)if(n[r]!==this._segments.lengths[r]){wg(this,g1);break}}};wf.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};wf.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<Ope-1;++t)e[t]=0};wf.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var Ld=wf;var bet=Ld.SHOW_INDEX,Iet=Ld.WIDTH_INDEX,$K=Ld.POSITION_INDEX,xet=Ld.MATERIAL_INDEX,Fpe=Ld.POSITION_SIZE_INDEX,Tet=Ld.DISTANCE_DISPLAY_CONDITION,Hpe=Ld.NUMBER_OF_PROPERTIES,Nu={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 rm(e){e=e??V.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=M.clone(M.IDENTITY),this.debugShowBoundingVolume=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(Hpe),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:Re.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=z.clone(z.WHITE);let t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}Object.defineProperties(rm.prototype,{length:{get:function(){return eX(this),this._polylines.length}}});rm.prototype.add=function(e){let t=new Ld(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};rm.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};rm.prototype.removeAll=function(){tX(this),Kpe(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};rm.prototype.contains=function(e){return l(e)&&e._polylineCollection===this};rm.prototype.get=function(e){return eX(this),this._polylines[e]};function wet(e,t){l(e._batchTable)&&e._batchTable.destroy();let n=[{functionName:"batchTable_getWidthAndShow",componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:j.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:j.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:j.FLOAT,componentsPerAttribute:2}];e._batchTable=new UE(t,n,e._polylines.length)}var Wpe=new xn,jpe=new ie,Ype=new k;rm.prototype.update=function(e){if(eX(this),this._polylines.length===0||!this.show)return;Met(this,e);let t=e.context,n=e.mapProjection,i,o=this._propertiesChanged;if(this._createBatchTable){if(Rt.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.");wet(this,t),this._createBatchTable=!1}if(this._createVertexArray||Det(this))Upe(this,t,n);else if(this._polylinesUpdated){let c=this._polylinesToUpdate;if(this._mode!==oe.SCENE3D){let u=c.length;for(let f=0;f<u;++f)i=c[f],i.update()}if(o[Fpe]||o[xet])Upe(this,t,n);else{let u=c.length,f=this._polylineBuckets;for(let h=0;h<u;++h){i=c[h],o=i._propertiesChanged;let p=i._bucket,A=0;for(let m in f)if(f.hasOwnProperty(m)){if(f[m]===p){o[$K]&&p.writeUpdate(A,i,this._positionBuffer,n);break}A+=f[m].lengthOfPositions}if((o[bet]||o[Iet])&&this._batchTable.setBatchedAttribute(i._index,0,new k(i._width,i._show)),this._batchTable.attributes.length>2){if(o[$K]||o[Fpe]){let m=e.mode===oe.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,_=xn.fromCartesian(m.center,Wpe),y=ie.fromElements(_.low.x,_.low.y,_.low.z,m.radius,jpe);this._batchTable.setBatchedAttribute(i._index,2,_.high),this._batchTable.setBatchedAttribute(i._index,3,y)}if(o[Tet]){let m=Ype;m.x=0,m.y=Number.MAX_VALUE;let _=i.distanceDisplayCondition;l(_)&&(m.x=_.near,m.y=_.far),this._batchTable.setBatchedAttribute(i._index,4,m)}}i._clean()}}c.length=0,this._polylinesUpdated=!1}o=this._propertiesChanged;for(let c=0;c<Hpe;++c)o[c]=0;let r=M.IDENTITY;e.mode===oe.SCENE3D&&(r=this.modelMatrix);let a=e.passes,s=e.morphTime!==0;if((!l(this._opaqueRS)||this._opaqueRS.depthTest.enabled!==s)&&(this._opaqueRS=Ve.fromCache({depthMask:s,depthTest:{enabled:s}})),(!l(this._translucentRS)||this._translucentRS.depthTest.enabled!==s)&&(this._translucentRS=Ve.fromCache({blending:sn.ALPHA_BLEND,depthMask:!s,depthTest:{enabled:s}})),this._batchTable.update(e),a.render||a.pick){let c=this._colorCommands;Bet(this,e,c,r)}};var _1=new le,Qpe=new le;function Bet(e,t,n,i){let o=t.context,r=t.commandList,a=n.length,s=0,c=!0,u=e._vertexArrays,f=e.debugShowBoundingVolume,p=e._batchTable.getUniformMapCallback(),A=u.length;for(let m=0;m<A;++m){let _=u[m],y=_.buckets,C=y.length;for(let E=0;E<C;++E){let b=y[E],x=b.offset,S=b.bucket.shaderProgram,B=b.bucket.polylines,v=B.length,P,N,L=0,g,I;for(let T=0;T<v;++T){let w=B[T],R=Pet(w._material);if(R!==P){if(l(P)&&L>0){let U=N.isTranslucent();s>=a?(g=new nt({owner:e}),n.push(g)):g=n[s],++s,I=Pt(p(N._uniforms),e._uniformMap),g.boundingVolume=le.clone(_1,g.boundingVolume),g.modelMatrix=i,g.shaderProgram=S,g.vertexArray=_.va,g.renderState=U?e._translucentRS:e._opaqueRS,g.pass=U?Be.TRANSLUCENT:Be.OPAQUE,g.debugShowBoundingVolume=f,g.pickId="v_pickColor",g.uniformMap=I,g.count=L,g.offset=x,x+=L,L=0,c=!0,r.push(g)}N=w._material,N.update(o),P=R}let O=w._locatorBuckets,G=O.length;for(let U=0;U<G;++U){let Q=O[U];Q.locator===b&&(L+=Q.count)}let F;t.mode===oe.SCENE3D?F=w._boundingVolumeWC:t.mode===oe.COLUMBUS_VIEW?F=w._boundingVolume2D:t.mode===oe.SCENE2D?l(w._boundingVolume2D)&&(F=le.clone(w._boundingVolume2D,Qpe),F.center.x=0):l(w._boundingVolumeWC)&&l(w._boundingVolume2D)&&(F=le.union(w._boundingVolumeWC,w._boundingVolume2D,Qpe)),c?(c=!1,le.clone(F,_1)):le.union(F,_1,_1)}l(P)&&L>0&&(s>=a?(g=new nt({owner:e}),n.push(g)):g=n[s],++s,I=Pt(p(N._uniforms),e._uniformMap),g.boundingVolume=le.clone(_1,g.boundingVolume),g.modelMatrix=i,g.shaderProgram=S,g.vertexArray=_.va,g.renderState=N.isTranslucent()?e._translucentRS:e._opaqueRS,g.pass=N.isTranslucent()?Be.TRANSLUCENT:Be.OPAQUE,g.debugShowBoundingVolume=f,g.pickId="v_pickColor",g.uniformMap=I,g.count=L,g.offset=x,c=!0,r.push(g)),P=void 0}}n.length=s}rm.prototype.isDestroyed=function(){return!1};rm.prototype.destroy=function(){return qpe(this),tX(this),Kpe(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),fe(this)};function Det(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[$K]?(i.bufferUsage!==Re.STREAM_DRAW&&(t=!0,i.bufferUsage=Re.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==Re.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=Re.STATIC_DRAW):i.frameCount--),t}var kpe=[0,0,0];function Upe(e,t,n){e._createVertexArray=!1,tX(e),qpe(e),Ret(e);let i=[[]],o=i[0],r=e._batchTable,a=e._useHighlightColor,s=[0],c=0,u=[[]],f=0,h=e._polylineBuckets,p,A;for(p in h)h.hasOwnProperty(p)&&(A=h[p],A.updateShader(t,r,a),f+=A.lengthOfPositions);if(f>0){let m=e._mode,_=new Float32Array(6*f*3),y=new Float32Array(f*4),C,E=0,b=0,x=0;for(p in h)if(h.hasOwnProperty(p)){A=h[p],A.write(_,y,E,b,x,r,t,n),m===oe.MORPHING&&(l(C)||(C=new Float32Array(6*f*3)),A.writeForMorph(C,E));let I=A.lengthOfPositions;E+=6*I*3,b+=I*4,x+=I*4,c=A.updateIndices(i,s,u,c)}let S=e._positionBufferUsage.bufferUsage,B=Re.STATIC_DRAW;e._positionBuffer=tt.createVertexBuffer({context:t,typedArray:_,usage:S});let v;l(C)&&(v=tt.createVertexBuffer({context:t,typedArray:C,usage:S})),e._texCoordExpandAndBatchIndexBuffer=tt.createVertexBuffer({context:t,typedArray:y,usage:B});let P=3*Float32Array.BYTES_PER_ELEMENT,N=4*Float32Array.BYTES_PER_ELEMENT,L=0,g=i.length;for(let I=0;I<g;++I)if(o=i[I],o.length>0){let T=new Uint16Array(o),w=tt.createIndexBuffer({context:t,typedArray:T,usage:Re.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT});L+=s[I];let R=6*(I*(P*D.SIXTY_FOUR_KILOBYTES)-L*P),O=P+R,G=P+O,F=P+G,U=P+F,Q=P+U,H=I*(N*D.SIXTY_FOUR_KILOBYTES)-L*N,Y=[{index:Nu.position3DHigh,componentsPerAttribute:3,componentDatatype:j.FLOAT,offsetInBytes:R,strideInBytes:6*P},{index:Nu.position3DLow,componentsPerAttribute:3,componentDatatype:j.FLOAT,offsetInBytes:O,strideInBytes:6*P},{index:Nu.position2DHigh,componentsPerAttribute:3,componentDatatype:j.FLOAT,offsetInBytes:R,strideInBytes:6*P},{index:Nu.position2DLow,componentsPerAttribute:3,componentDatatype:j.FLOAT,offsetInBytes:O,strideInBytes:6*P},{index:Nu.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:j.FLOAT,offsetInBytes:G,strideInBytes:6*P},{index:Nu.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:j.FLOAT,offsetInBytes:F,strideInBytes:6*P},{index:Nu.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:j.FLOAT,offsetInBytes:G,strideInBytes:6*P},{index:Nu.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:j.FLOAT,offsetInBytes:F,strideInBytes:6*P},{index:Nu.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:j.FLOAT,offsetInBytes:U,strideInBytes:6*P},{index:Nu.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:j.FLOAT,offsetInBytes:Q,strideInBytes:6*P},{index:Nu.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:j.FLOAT,offsetInBytes:U,strideInBytes:6*P},{index:Nu.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:j.FLOAT,offsetInBytes:Q,strideInBytes:6*P},{index:Nu.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:j.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:H}],$,W,K,Z;m===oe.SCENE3D?(W=e._positionBuffer,$="vertexBuffer",K=kpe,Z="value"):m===oe.SCENE2D||m===oe.COLUMBUS_VIEW?(W=kpe,$="value",K=e._positionBuffer,Z="vertexBuffer"):(W=v,$="vertexBuffer",K=e._positionBuffer,Z="vertexBuffer"),Y[0][$]=W,Y[1][$]=W,Y[2][Z]=K,Y[3][Z]=K,Y[4][$]=W,Y[5][$]=W,Y[6][Z]=K,Y[7][Z]=K,Y[8][$]=W,Y[9][$]=W,Y[10][Z]=K,Y[11][Z]=K;let pe=new Gn({context:t,attributes:Y,indexBuffer:w});e._vertexArrays.push({va:pe,buckets:u[I]})}}}function vet(e,t){return t instanceof Dt?t.id:t}var L8=[];function Pet(e){let t=Yi._uniformList[e.type],n=t.length;L8.length=2*n;let i=0;for(let o=0;o<n;++o){let r=t[o];L8[i]=r,L8[i+1]=e._uniforms[r](),i+=2}return`${e.type}:${JSON.stringify(L8,vet)}`}function Ret(e){let t=e._mode,n=e._modelMatrix,i=e._polylineBuckets={},o=e._polylines,r=o.length;for(let a=0;a<r;++a){let s=o[a];if(s._actualPositions.length>1){s.update();let c=s.material,u=i[c.type];l(u)||(u=i[c.type]=new Dp(c,t,n)),u.addPolyline(s)}}}function Met(e,t){let n=t.mode;(e._mode!==n||!M.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=M.clone(e.modelMatrix),e._createVertexArray=!0)}function eX(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;let t=[],n=[],i=0,o,r=e._polylines.length;for(let a=0;a<r;++a)o=e._polylines[a],o.isDestroyed||(o._index=i++,n.push(o),t.push(o));e._polylines=t,e._polylinesToUpdate=n}}function tX(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 qpe(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}rm.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function Kpe(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function ZK(e,t,n){this.count=e,this.offset=t,this.bucket=n}function Dp(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}Dp.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};Dp.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"),i.push("CLIP_POLYLINE");let o=new We({defines:i,sources:[`in vec4 v_pickColor;
`,this.material.shaderSource,jE]}),r=t.getVertexShaderCallback()(p1),a=new We({defines:i,sources:[Rl,r]});this.shaderProgram=$t.fromCache({context:e,vertexShaderSource:a,fragmentShaderSource:o,attributeLocations:Nu})};function Xpe(e){return d.dot(d.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(cn.ORIGIN_ZX_PLANE)===Xt.INTERSECTING}Dp.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===oe.SCENE3D||!Xpe(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 ps=new d,Od=new d,Fd=new d,O8=new d,Net=new ie,Let=new k;Dp.prototype.write=function(e,t,n,i,o,r,a,s){let c=this.mode,u=s.ellipsoid.maximumRadius*D.PI,f=this.polylines,h=f.length;for(let p=0;p<h;++p){let A=f[p],m=A.width,_=A.show&&m>0,y=A._index,C=this.getSegments(A,s),E=C.positions,b=C.lengths,x=E.length,S=A.getPickId(a).color,B=0,v=0,P;for(let G=0;G<x;++G){G===0?A._loop?P=E[x-2]:(P=O8,d.subtract(E[0],E[1],P),d.add(E[0],P,P)):P=E[G-1],d.clone(P,Od),d.clone(E[G],ps),G===x-1?A._loop?P=E[1]:(P=O8,d.subtract(E[x-1],E[x-2],P),d.add(E[x-1],P,P)):P=E[G+1],d.clone(P,Fd);let F=b[B];G===v+F&&(v+=F,++B);let U=G-v===0,Q=G===v+b[B]-1;c===oe.SCENE2D&&(Od.z=0,ps.z=0,Fd.z=0),(c===oe.SCENE2D||c===oe.MORPHING)&&(U||Q)&&u-Math.abs(ps.x)<1&&((ps.x<0&&Od.x>0||ps.x>0&&Od.x<0)&&d.clone(ps,Od),(ps.x<0&&Fd.x>0||ps.x>0&&Fd.x<0)&&d.clone(ps,Fd));let H=U?2:0,Y=Q?2:4;for(let $=H;$<Y;++$){xn.writeElements(ps,e,n),xn.writeElements(Od,e,n+6),xn.writeElements(Fd,e,n+12);let W=$-2<0?-1:1;t[o]=G/(x-1),t[o+1]=2*($%2)-1,t[o+2]=W,t[o+3]=y,n+=18,o+=4}}let N=Net;N.x=z.floatToByte(S.red),N.y=z.floatToByte(S.green),N.z=z.floatToByte(S.blue),N.w=z.floatToByte(S.alpha);let L=Let;L.x=m,L.y=_?1:0;let g=c===oe.SCENE2D?A._boundingVolume2D:A._boundingVolumeWC,I=xn.fromCartesian(g.center,Wpe),T=I.high,w=ie.fromElements(I.low.x,I.low.y,I.low.z,g.radius,jpe),R=Ype;R.x=0,R.y=Number.MAX_VALUE;let O=A.distanceDisplayCondition;l(O)&&(R.x=O.near,R.y=O.far),r.setBatchedAttribute(y,0,L),r.setBatchedAttribute(y,1,N),r.attributes.length>2&&(r.setBatchedAttribute(y,2,T),r.setBatchedAttribute(y,3,w),r.setBatchedAttribute(y,4,R))}};var Oet=new d,Fet=new d,Qet=new d,zpe=new d;Dp.prototype.writeForMorph=function(e,t){let n=this.modelMatrix,i=this.polylines,o=i.length;for(let r=0;r<o;++r){let a=i[r],s=a._segments.positions,c=a._segments.lengths,u=s.length,f=0,h=0;for(let p=0;p<u;++p){let A;p===0?a._loop?A=s[u-2]:(A=zpe,d.subtract(s[0],s[1],A),d.add(s[0],A,A)):A=s[p-1],A=M.multiplyByPoint(n,A,Fet);let m=M.multiplyByPoint(n,s[p],Oet),_;p===u-1?a._loop?_=s[1]:(_=zpe,d.subtract(s[u-1],s[u-2],_),d.add(s[u-1],_,_)):_=s[p+1],_=M.multiplyByPoint(n,_,Qet);let y=c[f];p===h+y&&(h+=y,++f);let C=p-h===0,E=p===h+c[f]-1,b=C?2:0,x=E?2:4;for(let S=b;S<x;++S)xn.writeElements(m,e,t),xn.writeElements(A,e,t+6),xn.writeElements(_,e,t+12),t+=18}}};var ket=new Array(1);Dp.prototype.updateIndices=function(e,t,n,i){let o=n.length-1,r=new ZK(0,i,this);n[o].push(r);let a=0,s=e[e.length-1],c=0;s.length>0&&(c=s[s.length-1]+1);let u=this.polylines,f=u.length;for(let h=0;h<f;++h){let p=u[h];p._locatorBuckets=[];let A;if(this.mode===oe.SCENE3D){A=ket;let _=p._actualPositions.length;if(_>0)A[0]=_;else continue}else A=p._segments.lengths;let m=A.length;if(m>0){let _=0;for(let y=0;y<m;++y){let C=A[y]-1;for(let E=0;E<C;++E)c+4>D.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:r,count:_}),_=0,t.push(4),s=[],e.push(s),c=0,r.count=a,a=0,i=0,r=new ZK(0,0,this),n[++o]=[r]),s.push(c,c+2,c+1),s.push(c+1,c+2,c+3),_+=6,a+=6,i+=6,c+=4}p._locatorBuckets.push({locator:r,count:_}),c+4>D.SIXTY_FOUR_KILOBYTES&&(t.push(0),s=[],e.push(s),c=0,r.count=a,i=0,a=0,r=new ZK(0,0,this),n[++o]=[r])}p._clean()}return r.count=a,i};Dp.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 eS={positions:void 0,lengths:void 0},Gpe=new Array(1),Uet=new d,zet=new me;Dp.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===oe.SCENE3D)return Gpe[0]=n.length,eS.positions=n,eS.lengths=Gpe,eS;Xpe(e)&&(n=e._segments.positions);let i=t.ellipsoid,o=[],r=this.modelMatrix,a=n.length,s,c=Uet;for(let u=0;u<a;++u)s=n[u],c=M.multiplyByPoint(r,s,c),o.push(t.project(i.cartesianToCartographic(c,zet)));if(o.length>0){e._boundingVolume2D=le.fromPoints(o,e._boundingVolume2D);let u=e._boundingVolume2D.center;e._boundingVolume2D.center=new d(u.z,u.x,u.y)}return eS.positions=o,eS.lengths=e._segments.lengths,eS};var Vpe;Dp.prototype.writeUpdate=function(e,t,n,i){let o=this.mode,r=i.ellipsoid.maximumRadius*D.PI,a=t._actualLength;if(a){e+=this.getPolylineStartIndex(t);let s=Vpe,c=6*a*3;!l(s)||s.length<c?s=Vpe=new Float32Array(c):s.length>c&&(s=new Float32Array(s.buffer,0,c));let u=this.getSegments(t,i),f=u.positions,h=u.lengths,p=0,A=0,m=0,_;a=f.length;for(let y=0;y<a;++y){y===0?t._loop?_=f[a-2]:(_=O8,d.subtract(f[0],f[1],_),d.add(f[0],_,_)):_=f[y-1],d.clone(_,Od),d.clone(f[y],ps),y===a-1?t._loop?_=f[1]:(_=O8,d.subtract(f[a-1],f[a-2],_),d.add(f[a-1],_,_)):_=f[y+1],d.clone(_,Fd);let C=h[A];y===m+C&&(m+=C,++A);let E=y-m===0,b=y===m+h[A]-1;o===oe.SCENE2D&&(Od.z=0,ps.z=0,Fd.z=0),(o===oe.SCENE2D||o===oe.MORPHING)&&(E||b)&&r-Math.abs(ps.x)<1&&((ps.x<0&&Od.x>0||ps.x>0&&Od.x<0)&&d.clone(ps,Od),(ps.x<0&&Fd.x>0||ps.x>0&&Fd.x<0)&&d.clone(ps,Fd));let x=E?2:0,S=b?2:4;for(let B=x;B<S;++B)xn.writeElements(ps,s,p),xn.writeElements(Od,s,p+6),xn.writeElements(Fd,s,p+12),p+=18}n.copyFromArrayView(s,18*Float32Array.BYTES_PER_ELEMENT*e)}};var am=rm;function Xy(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._heightReference=e.heightReference,this._billboardCollection=new Sf({batchTable:e.batchTable,scene:e.scene}),this._labelCollection=new Bp({batchTable:e.batchTable,scene:e.scene}),this._polylineCollection=new am,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Xy.prototype,{ready:{get:function(){return this._ready}},pointsLength:{get:function(){return this._billboardCollection.length}},texturesByteLength:{get:function(){let e=this._billboardCollection.sizeInBytes,t=this._labelCollection.sizeInBytes;return e+t}}});function Get(e,t){let n=e._rectangle,i=e._minHeight,o=e._maxHeight,r=2+ce.packedLength+te.packedLength,a=new Float64Array(r),s=0;return a[s++]=i,a[s++]=o,ce.pack(n,a,s),s+=ce.packedLength,te.pack(t,a,s),a}var Vet=new Zn("createVectorTilePoints",5),Het=new d;function Wet(e,t){let n=e._positions,i=e._packedBuffer;l(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=Get(e,t));let o=[n.buffer,i.buffer],r={positions:n.buffer,packedBuffer:i.buffer},a=Vet.scheduleTask(r,o);if(l(a))return a.then(s=>{if(e.isDestroyed())return;e._positions=new Float64Array(s.positions);let c=e._billboardCollection,u=e._labelCollection,f=e._polylineCollection;n=e._positions;let h=e._batchIds,p=n.length/3,A=e._heightReference??it.NONE;for(let m=0;m<p;++m){let _=h[m],y=d.unpack(n,m*3,Het),C=c.add();C.position=y,C._batchIndex=_,C.heightReference=A;let E=u.add();E.text=" ",E.position=y,E._batchIndex=_,E.heightReference=A;let b=f.add();b.positions=[d.clone(y),d.clone(y)]}e._positions=void 0,e._packedBuffer=void 0,e._ready=!0}).catch(s=>{e.isDestroyed()||(e._error=s)})}Xy.prototype.createFeatures=function(e,t){let n=this._billboardCollection,i=this._labelCollection,o=this._polylineCollection,r=this._batchIds,a=r.length;for(let s=0;s<a;++s){let c=r[s],u=n.get(s),f=i.get(s),h=o.get(s);t[c]=new Tg(e,c,u,f,h)}};Xy.prototype.applyDebugSettings=function(e,t){e?(z.clone(t,this._billboardCollection._highlightColor),z.clone(t,this._labelCollection._highlightColor),z.clone(t,this._polylineCollection._highlightColor)):(z.clone(z.WHITE,this._billboardCollection._highlightColor),z.clone(z.WHITE,this._labelCollection._highlightColor),z.clone(z.WHITE,this._polylineCollection._highlightColor))};function jet(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],a=t[r];a.show=!0,a.pointSize=Tg.defaultPointSize,a.color=Tg.defaultColor,a.pointOutlineColor=Tg.defaultPointOutlineColor,a.pointOutlineWidth=Tg.defaultPointOutlineWidth,a.labelColor=z.WHITE,a.labelOutlineColor=z.WHITE,a.labelOutlineWidth=1,a.font="30px sans-serif",a.labelStyle=pr.FILL,a.labelText=void 0,a.backgroundColor=new z(.165,.165,.165,.8),a.backgroundPadding=new k(7,5),a.backgroundEnabled=!1,a.scaleByDistance=void 0,a.translucencyByDistance=void 0,a.distanceDisplayCondition=void 0,a.heightOffset=0,a.anchorLineEnabled=!1,a.anchorLineColor=z.WHITE,a.image=void 0,a.disableDepthTestDistance=0,a.horizontalOrigin=Mi.CENTER,a.verticalOrigin=jn.CENTER,a.labelHorizontalOrigin=Mi.RIGHT,a.labelVerticalOrigin=jn.BASELINE}}var Yet=new z,qet=new z,Ket=new z,Xet=new z,Jet=new z,Zet=new z,y1=new Ht,C1=new Ht,nX=new zt;Xy.prototype.applyStyle=function(e,t){if(!l(e)){jet(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],a=t[r];if(l(e.show)&&(a.show=e.show.evaluate(a)),l(e.pointSize)&&(a.pointSize=e.pointSize.evaluate(a)),l(e.color)&&(a.color=e.color.evaluateColor(a,Yet)),l(e.pointOutlineColor)&&(a.pointOutlineColor=e.pointOutlineColor.evaluateColor(a,qet)),l(e.pointOutlineWidth)&&(a.pointOutlineWidth=e.pointOutlineWidth.evaluate(a)),l(e.labelColor)&&(a.labelColor=e.labelColor.evaluateColor(a,Ket)),l(e.labelOutlineColor)&&(a.labelOutlineColor=e.labelOutlineColor.evaluateColor(a,Xet)),l(e.labelOutlineWidth)&&(a.labelOutlineWidth=e.labelOutlineWidth.evaluate(a)),l(e.font)&&(a.font=e.font.evaluate(a)),l(e.labelStyle)&&(a.labelStyle=e.labelStyle.evaluate(a)),l(e.labelText)?a.labelText=e.labelText.evaluate(a):a.labelText=void 0,l(e.backgroundColor)&&(a.backgroundColor=e.backgroundColor.evaluateColor(a,Jet)),l(e.backgroundPadding)&&(a.backgroundPadding=e.backgroundPadding.evaluate(a)),l(e.backgroundEnabled)&&(a.backgroundEnabled=e.backgroundEnabled.evaluate(a)),l(e.scaleByDistance)){let s=e.scaleByDistance.evaluate(a);l(s)?(y1.near=s.x,y1.nearValue=s.y,y1.far=s.z,y1.farValue=s.w,a.scaleByDistance=y1):a.scaleByDistance=void 0}else a.scaleByDistance=void 0;if(l(e.translucencyByDistance)){let s=e.translucencyByDistance.evaluate(a);l(s)?(C1.near=s.x,C1.nearValue=s.y,C1.far=s.z,C1.farValue=s.w,a.translucencyByDistance=C1):a.translucencyByDistance=void 0}else a.translucencyByDistance=void 0;if(l(e.distanceDisplayCondition)){let s=e.distanceDisplayCondition.evaluate(a);l(s)?(nX.near=s.x,nX.far=s.y,a.distanceDisplayCondition=nX):a.distanceDisplayCondition=void 0}else a.distanceDisplayCondition=void 0;l(e.heightOffset)&&(a.heightOffset=e.heightOffset.evaluate(a)),l(e.anchorLineEnabled)&&(a.anchorLineEnabled=e.anchorLineEnabled.evaluate(a)),l(e.anchorLineColor)&&(a.anchorLineColor=e.anchorLineColor.evaluateColor(a,Zet)),l(e.image)?a.image=e.image.evaluate(a):a.image=void 0,l(e.disableDepthTestDistance)&&(a.disableDepthTestDistance=e.disableDepthTestDistance.evaluate(a)),l(e.horizontalOrigin)&&(a.horizontalOrigin=e.horizontalOrigin.evaluate(a)),l(e.verticalOrigin)&&(a.verticalOrigin=e.verticalOrigin.evaluate(a)),l(e.labelHorizontalOrigin)&&(a.labelHorizontalOrigin=e.labelHorizontalOrigin.evaluate(a)),l(e.labelVerticalOrigin)&&(a.labelVerticalOrigin=e.labelVerticalOrigin.evaluate(a))}};Xy.prototype.update=function(e){if(!this._ready&&(l(this._promise)||(this._promise=Wet(this,e.mapProjection.ellipsoid)),l(this._error))){let t=this._error;throw this._error=void 0,t}this._polylineCollection.update(e),this._billboardCollection.update(e),this._labelCollection.update(e)};Xy.prototype.isDestroyed=function(){return!1};Xy.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(),fe(this)};var E1=Xy;function Bg(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=e.ellipsoid??te.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=e.center??d.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=ei.BOTH}Object.defineProperties(Bg.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 $et(e){let t=new Float64Array(3+d.packedLength+te.packedLength+ce.packedLength),n=0;return t[n++]=e._indices.BYTES_PER_ELEMENT,t[n++]=e._minimumHeight,t[n++]=e._maximumHeight,d.pack(e._center,t,n),n+=d.packedLength,te.pack(e._ellipsoid,t,n),n+=te.packedLength,ce.pack(e._rectangle,t,n),t}function ett(e,t){let n=1,i=t[n++],o=e._boundingVolumes=new Array(i);for(let s=0;s<i;++s)o[s]=en.unpack(t,n),n+=en.packedLength;let r=t[n++],a=e._batchedIndices=new Array(r);for(let s=0;s<r;++s){let c=z.unpack(t,n);n+=z.packedLength;let u=t[n++],f=t[n++],h=t[n++],p=new Array(h);for(let A=0;A<h;++A)p[A]=t[n++];a[s]=new mp({color:c,offset:u,count:f,batchIds:p})}}var ttt=new Zn("createVectorTilePolygons",5),ntt=new z;function itt(e){if(l(e._primitive))return;let t=e._positions,n=e._counts,i=e._indexCounts,o=e._indices,r=e._transferrableBatchIds,a=e._batchTableColors,s=e._packedBuffer;if(!l(a)){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(ce.center(e._rectangle)),r=e._transferrableBatchIds=new Uint32Array(e._batchIds),a=e._batchTableColors=new Uint32Array(r.length);let A=e._batchTable,m=a.length;for(let _=0;_<m;++_){let y=A.getColor(_,ntt);a[_]=y.toRgba()}s=e._packedBuffer=$et(e)}let c=[t.buffer,n.buffer,i.buffer,o.buffer,r.buffer,a.buffer,s.buffer],u={packedBuffer:s.buffer,positions:t.buffer,counts:n.buffer,indexCounts:i.buffer,indices:o.buffer,batchIds:r.buffer,batchTableColors:a.buffer},f=e._polygonMinimumHeights,h=e._polygonMaximumHeights;l(f)&&l(h)&&(f=f.slice(),h=h.slice(),c.push(f.buffer,h.buffer),u.minimumHeights=f,u.maximumHeights=h);let p=ttt.scheduleTask(u,c);if(l(p))return p.then(A=>{if(e.isDestroyed())return;e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;let m=new Float64Array(A.packedBuffer),_=m[0];ett(e,m),e._indices=Ue.getSizeInBytes(_)===2?new Uint16Array(A.indices):new Uint32Array(A.indices),e._indexOffsets=new Uint32Array(A.indexOffsets),e._indexCounts=new Uint32Array(A.indexCounts),e._batchedPositions=new Float32Array(A.positions),e._vertexBatchIds=new Uint16Array(A.batchIds),ott(e),e._ready=!0}).catch(A=>{e.isDestroyed()||(e._error=A)})}function ott(e){l(e._primitive)||(e._primitive=new d0({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)}Bg.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Bg.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Bg.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Bg.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Bg.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=itt(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)};Bg.prototype.isDestroyed=function(){return!1};Bg.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),fe(this)};var b1=Bg;var I1=`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 sm(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??te.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=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(sm.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function rtt(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,a=2+ce.packedLength+te.packedLength+d.packedLength,s=new Float64Array(a),c=0;return s[c++]=n,s[c++]=i,ce.pack(t,s,c),c+=ce.packedLength,te.pack(o,s,c),c+=te.packedLength,d.pack(r,s,c),s}var att=new Zn("createVectorTilePolylines",5),tS={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function stt(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,a=e._packedBuffer;l(a)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),a=e._packedBuffer=rtt(e));let s=[n.buffer,i.buffer,o.buffer,r.buffer,a.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:a.buffer,keepDecodedPositions:e._keepDecodedPositions},u=att.scheduleTask(c,s);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._currentPositions=new Float32Array(f.currentPositions),e._previousPositions=new Float32Array(f.previousPositions),e._nextPositions=new Float32Array(f.nextPositions),e._expandAndWidth=new Float32Array(f.expandAndWidth),e._vertexBatchIds=new Uint16Array(f.batchIds);let h=f.indexDatatype;e._indices=h===Ue.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),ctt(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function ctt(e,t){if(!l(e._va)){let n=e._currentPositions,i=e._previousPositions,o=e._nextPositions,r=e._expandAndWidth,a=e._vertexBatchIds,s=e._indices,c=i.byteLength+n.byteLength+o.byteLength;c+=r.byteLength+a.byteLength+s.byteLength,e._trianglesLength=s.length/3,e._geometryByteLength=c;let u=tt.createVertexBuffer({context:t,typedArray:i,usage:Re.STATIC_DRAW}),f=tt.createVertexBuffer({context:t,typedArray:n,usage:Re.STATIC_DRAW}),h=tt.createVertexBuffer({context:t,typedArray:o,usage:Re.STATIC_DRAW}),p=tt.createVertexBuffer({context:t,typedArray:r,usage:Re.STATIC_DRAW}),A=tt.createVertexBuffer({context:t,typedArray:a,usage:Re.STATIC_DRAW}),m=tt.createIndexBuffer({context:t,typedArray:s,usage:Re.STATIC_DRAW,indexDatatype:s.BYTES_PER_ELEMENT===2?Ue.UNSIGNED_SHORT:Ue.UNSIGNED_INT}),_=[{index:tS.previousPosition,vertexBuffer:u,componentDatatype:j.FLOAT,componentsPerAttribute:3},{index:tS.currentPosition,vertexBuffer:f,componentDatatype:j.FLOAT,componentsPerAttribute:3},{index:tS.nextPosition,vertexBuffer:h,componentDatatype:j.FLOAT,componentsPerAttribute:3},{index:tS.expandAndWidth,vertexBuffer:p,componentDatatype:j.FLOAT,componentsPerAttribute:2},{index:tS.a_batchId,vertexBuffer:A,componentDatatype:j.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new Gn({context:t,attributes:_,indexBuffer:m}),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 x1=new M,Jpe=new d;function ltt(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return M.clone(n,x1),M.multiplyByPoint(x1,e._center,Jpe),M.setTranslation(x1,Jpe,x1),x1},u_highlightColor:function(){return e._highlightColor}})}function utt(e){if(l(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=Ve.fromCache({blending:sn.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var ftt=`uniform vec4 u_highlightColor;
void main()
{
out_FragColor = u_highlightColor;
}
`;function dtt(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(I1),o=n.getFragmentShaderCallback(!1,void 0,!1)(ftt),r=new We({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[Rl,i]}),a=new We({defines:["VECTOR_TILE"],sources:[o]});e._sp=$t.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:tS})}function htt(e,t){if(!l(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new nt({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:Be.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}sm.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,o=e._decodedPositionOffsets;if(!l(n)||!l(i))return;let r,a,s=n.length,c=0,u=0;for(r=0;r<s;++r)n[r]===t&&(c+=o[r+1]-o[r]);if(c===0)return;let f=new Float64Array(c*3);for(r=0;r<s;++r)if(n[r]===t){let h=o[r],p=o[r+1]-h;for(a=0;a<p;++a){let A=(h+a)*3;f[u++]=i[A],f[u++]=i[A+1],f[u++]=i[A+2]}}return f};sm.prototype.getPositions=function(e){return sm.getPolylinePositions(this,e)};sm.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 Ns(e,r)}};sm.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function mtt(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],a=t[r];a.show=!0,a.color=z.WHITE}}var ptt=new z,Att=z.WHITE,gtt=!0;sm.prototype.applyStyle=function(e,t){if(!l(e)){mtt(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],a=t[r];a.color=l(e.color)?e.color.evaluateColor(a,ptt):Att,a.show=l(e.show)?e.show.evaluate(a):gtt}};sm.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=stt(this,t)),l(this._error)){let i=this._error;throw this._error=void 0,i}return}ltt(this,t),dtt(this,t),utt(this);let n=e.passes;(n.render||n.pick)&&htt(this,e)};sm.prototype.isDestroyed=function(){return!1};sm.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),fe(this)};var Y0=sm;var T1=`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 S1=`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 Dg(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??te.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 k(Di._defaultMinTerrainHeight,Di._defaultMaxTerrainHeight),this._boundingVolume=en.fromRectangle(e.rectangle,Di._defaultMinTerrainHeight,Di._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=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Dg.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function _tt(e,t,n){let i=Di.getMinimumMaximumHeights(t,n),o=i.minimumTerrainHeight,r=i.maximumTerrainHeight,a=e._minimumMaximumVectorHeights;a.x=o,a.y=r;let s=e._boundingVolume,c=e._rectangle;en.fromRectangle(c,o,r,n,s)}function ytt(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,a=2+ce.packedLength+te.packedLength+d.packedLength,s=new Float64Array(a),c=0;return s[c++]=n,s[c++]=i,ce.pack(t,s,c),c+=ce.packedLength,te.pack(o,s,c),c+=te.packedLength,d.pack(r,s,c),s}var Ctt=new Zn("createVectorTileClampedPolylines"),Jy={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function Ett(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,a=e._packedBuffer;l(a)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),a=e._packedBuffer=ytt(e));let s=[n.buffer,i.buffer,o.buffer,r.buffer,a.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:a.buffer,keepDecodedPositions:e._keepDecodedPositions},u=Ctt.scheduleTask(c,s);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._startEllipsoidNormals=new Float32Array(f.startEllipsoidNormals),e._endEllipsoidNormals=new Float32Array(f.endEllipsoidNormals),e._startPositionAndHeights=new Float32Array(f.startPositionAndHeights),e._startFaceNormalAndVertexCornerIds=new Float32Array(f.startFaceNormalAndVertexCornerIds),e._endPositionAndHeights=new Float32Array(f.endPositionAndHeights),e._endFaceNormalAndHalfWidths=new Float32Array(f.endFaceNormalAndHalfWidths),e._vertexBatchIds=new Uint16Array(f.vertexBatchIds);let h=f.indexDatatype;e._indices=h===Ue.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),btt(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function btt(e,t){if(!l(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,o=e._startPositionAndHeights,r=e._endPositionAndHeights,a=e._startFaceNormalAndVertexCornerIds,s=e._endFaceNormalAndHalfWidths,c=e._vertexBatchIds,u=e._indices,f=n.byteLength+i.byteLength;f+=o.byteLength+r.byteLength,f+=a.byteLength+s.byteLength,f+=c.byteLength+u.byteLength,e._trianglesLength=u.length/3,e._geometryByteLength=f;let h=tt.createVertexBuffer({context:t,typedArray:n,usage:Re.STATIC_DRAW}),p=tt.createVertexBuffer({context:t,typedArray:i,usage:Re.STATIC_DRAW}),A=tt.createVertexBuffer({context:t,typedArray:o,usage:Re.STATIC_DRAW}),m=tt.createVertexBuffer({context:t,typedArray:r,usage:Re.STATIC_DRAW}),_=tt.createVertexBuffer({context:t,typedArray:a,usage:Re.STATIC_DRAW}),y=tt.createVertexBuffer({context:t,typedArray:s,usage:Re.STATIC_DRAW}),C=tt.createVertexBuffer({context:t,typedArray:c,usage:Re.STATIC_DRAW}),E=tt.createIndexBuffer({context:t,typedArray:u,usage:Re.STATIC_DRAW,indexDatatype:u.BYTES_PER_ELEMENT===2?Ue.UNSIGNED_SHORT:Ue.UNSIGNED_INT}),b=[{index:Jy.startEllipsoidNormal,vertexBuffer:h,componentDatatype:j.FLOAT,componentsPerAttribute:3},{index:Jy.endEllipsoidNormal,vertexBuffer:p,componentDatatype:j.FLOAT,componentsPerAttribute:3},{index:Jy.startPositionAndHeight,vertexBuffer:A,componentDatatype:j.FLOAT,componentsPerAttribute:4},{index:Jy.endPositionAndHeight,vertexBuffer:m,componentDatatype:j.FLOAT,componentsPerAttribute:4},{index:Jy.startFaceNormalAndVertexCorner,vertexBuffer:_,componentDatatype:j.FLOAT,componentsPerAttribute:4},{index:Jy.endFaceNormalAndHalfWidth,vertexBuffer:y,componentDatatype:j.FLOAT,componentsPerAttribute:4},{index:Jy.a_batchId,vertexBuffer:C,componentDatatype:j.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new Gn({context:t,attributes:b,indexBuffer:E}),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 w1=new M,Zpe=new d;function Itt(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return M.clone(n,w1),M.multiplyByPoint(w1,e._center,Zpe),M.setTranslation(w1,Zpe,w1),w1},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function $pe(e){return Ve.fromCache({cull:{enabled:!0,face:Ni.FRONT},blending:sn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:ti.EQUAL,frontOperation:{fail:wt.KEEP,zFail:wt.KEEP,zPass:wt.KEEP},backFunction:ti.EQUAL,backOperation:{fail:wt.KEEP,zFail:wt.KEEP,zPass:wt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK}})}function xtt(e){l(e._rs)||(e._rs=$pe(!1),e._rs3DTiles=$pe(!0))}function Ttt(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(T1),o=n.getFragmentShaderCallback(!1,void 0,!0)(S1),r=new We({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[Rl,i]}),a=new We({defines:["VECTOR_TILE"],sources:[o]});e._sp=$t.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:Jy})}function Stt(e,t){let n=e._command;if(!l(e._command)){let o=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new nt({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:o,boundingVolume:e._boundingVolume,pass:Be.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let r=nt.shallowClone(n,n.derivedCommands.tileset);r.renderState=e._rs3DTiles,r.pass=Be.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=r}let i=e._classificationType;(i===ei.TERRAIN||i===ei.BOTH)&&t.commandList.push(n),(i===ei.CESIUM_3D_TILE||i===ei.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}Dg.prototype.getPositions=function(e){return Y0.getPolylinePositions(this,e)};Dg.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 Ns(e,r)}};Dg.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function wtt(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],a=t[r];a.show=!0,a.color=z.WHITE}}var Btt=new z,Dtt=z.WHITE,vtt=!0;Dg.prototype.applyStyle=function(e,t){if(!l(e)){wtt(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],a=t[r];a.color=l(e.color)?e.color.evaluateColor(a,Btt):Dtt,a.show=l(e.show)?e.show.evaluate(a):vtt}};function Ptt(e){return Di.initialize().then(function(){_tt(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}Dg.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=Ptt(this).then(Ett(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}Itt(this,t),Ttt(this,t),xtt(this);let n=e.passes;(n.render||n.pick)&&Stt(this,e)};Dg.prototype.isDestroyed=function(){return!1};Dg.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),fe(this)};var B1=Dg;var iX=32767,Rtt=new me,Mtt=new d;function Ntt(e,t,n,i,o){let r=e.length/3,a=e.subarray(0,r),s=e.subarray(r,2*r),c=e.subarray(2*r,3*r);tn.zigZagDeltaDecode(a,s,c);let u=new Float64Array(e.length);for(let f=0;f<r;++f){let h=a[f],p=s[f],A=c[f],m=D.lerp(t.west,t.east,h/iX),_=D.lerp(t.south,t.north,p/iX),y=D.lerp(n,i,A/iX),C=me.fromRadians(m,_,y,Rtt),E=o.cartographicToCartesian(C,Mtt);d.pack(E,u,f*3)}return u}var D1=Ntt;function lm(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,ktt(this,i,o)}Object.defineProperties(lm.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 Ltt(e){return function(t,n){l(e._polygons)&&e._polygons.updateCommands(t,n)}}function Ott(e,t){let n,i,o,r,a=e.POLYGONS_LENGTH??0,s=e.POLYLINES_LENGTH??0,c=e.POINTS_LENGTH??0;if(a>0&&l(e.POLYGON_BATCH_IDS)){let p=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,p,a)}if(s>0&&l(e.POLYLINE_BATCH_IDS)){let p=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,p,s)}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 u=l(n)||l(i)||l(o),f=a>0&&!l(n)||s>0&&!l(i)||c>0&&!l(o);if(u&&f)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)&&a>0)for(n=new Uint16Array(a),r=0;r<a;++r)n[r]=p++;if(!l(i)&&s>0)for(i=new Uint16Array(s),r=0;r<s;++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 cm=Uint32Array.BYTES_PER_ELEMENT;function Ftt(e){return new Y0(e)}function Qtt(e){return new B1(e)}function ktt(e,t,n){n=n??0;let i=new Uint8Array(t),o=new DataView(t);n+=cm;let r=o.getUint32(n,!0);if(r!==1)throw new ue(`Only Vector tile version 1 is supported. Version ${r} is not.`);n+=cm;let a=o.getUint32(n,!0);if(n+=cm,a===0){e._ready=!0;return}let s=o.getUint32(n,!0);if(n+=cm,s===0)throw new ue("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=cm;let u=o.getUint32(n,!0);n+=cm;let f=o.getUint32(n,!0);n+=cm;let h=o.getUint32(n,!0);n+=cm;let p=o.getUint32(n,!0);n+=cm;let A=o.getUint32(n,!0);n+=cm;let m=o.getUint32(n,!0);n+=cm;let _=Br(i,n,s);n+=s;let y=new Uint8Array(t,n,c);n+=c;let C,E;u>0&&(C=Br(i,n,u),n+=u,f>0&&(E=new Uint8Array(t,n,f),E=new Uint8Array(E),n+=f));let b=_.POLYGONS_LENGTH??0,x=_.POLYLINES_LENGTH??0,S=_.POINTS_LENGTH??0,B=b+x+S,v=new Gh(e,B,C,E,Ltt(e));if(e._batchTable=v,B===0)return;let P=new Kh(_,y),N=P.getGlobalProperty("REGION");if(!l(N))throw new ue("Feature table global property: REGION must be defined");let L=ce.unpack(N),g=N[4],I=N[5],T=e._tile.computedTransform,w=P.getGlobalProperty("RTC_CENTER",j.FLOAT,3);l(w)?(w=d.unpack(w),M.multiplyByPoint(T,w,w)):(w=ce.center(L),w.height=D.lerp(g,I,.5),w=te.WGS84.cartographicToCartesian(w));let R=Ott(_,y);if(n+=(4-n%4)%4,b>0){P.featuresLength=b;let G=P.getPropertyArray("POLYGON_COUNTS",j.UNSIGNED_INT,1)??P.getPropertyArray("POLYGON_COUNT",j.UNSIGNED_INT,1);if(!l(G))throw new ue("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let F=P.getPropertyArray("POLYGON_INDEX_COUNTS",j.UNSIGNED_INT,1)??P.getPropertyArray("POLYGON_INDEX_COUNT",j.UNSIGNED_INT,1);if(!l(F))throw new ue("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let U=G.reduce(function(K,Z){return K+Z*2},0),Q=F.reduce(function(K,Z){return K+Z},0),H=new Uint32Array(t,n,Q);n+=h;let Y=new Uint16Array(t,n,U);n+=p;let $,W;l(_.POLYGON_MINIMUM_HEIGHTS)&&l(_.POLYGON_MAXIMUM_HEIGHTS)&&($=P.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",j.FLOAT,1),W=P.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",j.FLOAT,1)),e._polygons=new b1({positions:Y,counts:G,indexCounts:F,indices:H,minimumHeight:g,maximumHeight:I,polygonMinimumHeights:$,polygonMaximumHeights:W,center:w,rectangle:L,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:v,batchIds:R.polygons,modelMatrix:T})}let O=e._tileset;if(x>0){P.featuresLength=x;let G=P.getPropertyArray("POLYLINE_COUNTS",j.UNSIGNED_INT,1)??P.getPropertyArray("POLYLINE_COUNT",j.UNSIGNED_INT,1);if(!l(G))throw new ue("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let F=P.getPropertyArray("POLYLINE_WIDTHS",j.UNSIGNED_SHORT,1);if(!l(F)){F=new Uint16Array(x);for(let $=0;$<x;++$)F[$]=2}let U=G.reduce(function($,W){return $+W*3},0),Q=new Uint16Array(t,n,U);n+=A;let H=O.examineVectorLinesFunction;if(l(H)){let $=D1(new Uint16Array(Q),L,g,I,te.WGS84);Utt($,G,R.polylines,v,e.url,H)}let Y=Ftt;l(O.classificationType)&&(Y=Qtt),e._polylines=Y({positions:Q,widths:F,counts:G,batchIds:R.polylines,minimumHeight:g,maximumHeight:I,center:w,rectangle:L,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:v,classificationType:O.classificationType,keepDecodedPositions:O.vectorKeepDecodedPositions})}if(S>0){let G=new Uint16Array(t,n,S*3);n+=m,e._points=new E1({positions:G,batchIds:R.points,minimumHeight:g,maximumHeight:I,rectangle:L,batchTable:v,heightReference:O.heightReference,scene:O.scene})}}function oX(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}}lm.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};lm.prototype.getFeature=function(e){return l(this._features)||oX(this),this._features[e]};lm.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)};lm.prototype.applyStyle=function(e){l(this._features)||oX(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)};lm.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)||oX(this),this._batchTable.update(e,t),this._ready=!0)};lm.prototype.pick=function(e,t,n){};lm.prototype.getPolylinePositions=function(e){let t=this._polylines;if(l(t))return t.getPositions(e)};lm.prototype.isDestroyed=function(){return!1};lm.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(),fe(this)};function Utt(e,t,n,i,o,r){let a=t.length,s=0;for(let c=0;c<a;c++){let u=t[c]*3,f=e.slice(s,s+u);s+=u,r(f,n[c],o,i)}}var v1=lm;var um=class um{constructor(){Rn(this,"_collection",null);Rn(this,"_index",-1);Rn(this,"_byteOffset",-1)}static clone(t,n){let i=t._collection._getMaterialClass();return n.featureId=t.featureId,n.show=t.show,n.setMaterial(t.getMaterial(new i)),n}_isResizable(){return this._index===this._collection.primitiveCount-1}get featureId(){return this._getUint32(um.Layout.FEATURE_ID_U32)}set featureId(t){this._setUint32(um.Layout.FEATURE_ID_U32,t)}get show(){return this._getUint8(um.Layout.SHOW_U8)===1}set show(t){this._setUint8(um.Layout.SHOW_U8,t?1:0)}getMaterial(t){let n=this._collection,i=n._getMaterialClass();return i.unpack(n._materialView,this._index*i.packedLength,t)}setMaterial(t){let n=this._collection,i=n._getMaterialClass();return i.pack(t,n._materialView,this._index*i.packedLength),this._dirty=!0,t}get _dirty(){return this._getUint8(um.Layout.DIRTY_U8)===1}set _dirty(t){this._collection._primitiveView.setUint8(this._byteOffset+um.Layout.DIRTY_U8,t?1:0),t&&this._collection._makeDirty(this._index)}get _pickId(){return this._getUint32(um.Layout.PICK_ID_U32)}set _pickId(t){this._setUint32(um.Layout.PICK_ID_U32,t)}_getUint8(t){return this._collection._primitiveView.getUint8(this._byteOffset+t)}_setUint8(t,n){this._collection._primitiveView.setUint8(this._byteOffset+t,n),this._dirty=!0}_getUint32(t){return this._collection._primitiveView.getUint32(this._byteOffset+t,!0)}_setUint32(t,n){this._collection._primitiveView.setUint32(this._byteOffset+t,n,!0),this._dirty=!0}_getFloat32(t){return this._collection._primitiveView.getFloat32(this._byteOffset+t,!0)}_setFloat32(t,n){this._collection._primitiveView.setFloat32(this._byteOffset+t,n,!0),this._dirty=!0}toJSON(){let n=this._collection._getMaterialClass();return{featureId:this.featureId,show:this.show,dirty:this._dirty,material:this.getMaterial(new n).toJSON()}}};Rn(um,"Layout",{FEATURE_ID_U32:0,SHOW_U8:4,DIRTY_U8:5,PICK_ID_U32:8,__BYTE_LENGTH:12});var rX=um,ta=rX;var nS=class nS{constructor(t=V.EMPTY_OBJECT){Rn(this,"_renderContext",null);this.show=t.show??!0,this.modelMatrix=M.clone(t.modelMatrix??M.IDENTITY),this.boundingVolume=new le,this.boundingVolumeWC=new le,this._allowPicking=t.allowPicking??!1,this.debugShowBoundingVolume=t.debugShowBoundingVolume??!1,this._primitiveCount=0,this._primitiveCountMax=t.primitiveCountMax??nS.DEFAULT_CAPACITY,this._primitiveView=null,this._positionCount=0,this._positionCountMax=t.vertexCountMax??nS.DEFAULT_CAPACITY,this._positionView=null,this._materialView=null,this._dirtyOffset=0,this._dirtyCount=0,this._dirtyBoundingVolume=!1,this._allocatePrimitiveBuffer(),this._allocatePositionBuffer(t.positionDatatype??j.DOUBLE),this._allocateMaterialBuffer()}_getCollectionClass(){de.throwInstantiationError()}_getPrimitiveClass(){de.throwInstantiationError()}_getMaterialClass(){de.throwInstantiationError()}_allocatePrimitiveBuffer(){let t=this._getPrimitiveClass().Layout;this._primitiveView=new DataView(new ArrayBuffer(this._primitiveCountMax*t.__BYTE_LENGTH))}_allocatePositionBuffer(t){this._positionView=j.createTypedArray(t,this._positionCountMax*3)}_allocateMaterialBuffer(){let t=this._getMaterialClass();this._materialView=new DataView(new ArrayBuffer(this._primitiveCountMax*t.packedLength))}isDestroyed(){return!1}destroy(){l(this._renderContext)&&(this._renderContext.destroy(),this._renderContext=void 0,this._dirtyOffset=0,this._dirtyCount=this.primitiveCount)}sort(t,n=new Uint32Array(this.primitiveCount)){let i=this._getPrimitiveClass(),o=this._getCollectionClass(),{primitiveCount:r}=this,a=new i,s=new i,c=new Uint32Array(r);for(let f=0;f<r;f++)c[f]=f;c.sort((f,h)=>t(this.get(f,a),this.get(h,s)));for(let f=0;f<r;f++)n[c[f]]=f;let u=o._cloneEmpty(this);for(let f=0;f<r;f++){let h=this.get(c[f],a),p=u.add({},s);i.clone(h,p)}return o._replaceBuffers(u,this),this._dirtyOffset=0,this._dirtyCount=r,n}static clone(t,n){let i=t._getPrimitiveClass().Layout,o=t._getMaterialClass(),r=t._getPrimitiveClass();this._copySubDataView(t._primitiveView,n._primitiveView,t.primitiveCount*i.__BYTE_LENGTH),this._copySubArray(t._positionView,n._positionView,t.vertexCount*3),this._copySubDataView(t._materialView,n._materialView,t.primitiveCount*o.packedLength),n.show=t.show,n.debugShowBoundingVolume=t.debugShowBoundingVolume,n._primitiveCount=t._primitiveCount,n._positionCount=t._positionCount;let a=new r;for(let s=0,c=n.primitiveCount;s<c;s++)n.get(s,a)._pickId=0;return n._dirtyOffset=0,n._dirtyCount=n.primitiveCount,t.boundingVolume.clone(n.boundingVolume),n}static _cloneEmpty(t){de.throwInstantiationError()}static _replaceBuffers(t,n){n._primitiveView=t._primitiveView,n._positionView=t._positionView,n._materialView=t._materialView}_updateBoundingVolume(){let t=this._positionView.constructor,n=new t(this._positionView.buffer,this._positionView.byteOffset,this._positionCount*3);le.fromVertices(n,d.ZERO,3,this.boundingVolume),le.transform(this.boundingVolume,this.modelMatrix,this.boundingVolumeWC),this._dirtyBoundingVolume=!1}get(t,n){return n._collection=this,n._index=t,n._byteOffset=t*this._getPrimitiveClass().Layout.__BYTE_LENGTH,n}add(t=V.EMPTY_OBJECT,n){let i=this._getMaterialClass();return n=this.get(this._primitiveCount++,n),n.featureId=this._primitiveCount-1,n.show=t.show??!0,n.setMaterial(t.material??i.DEFAULT_MATERIAL),n._pickId=0,n._dirty=!0,n}_makeDirty(t){this._dirtyCount===0?(this._dirtyCount=1,this._dirtyOffset=t):t<this._dirtyOffset?(this._dirtyCount+=this._dirtyOffset-t,this._dirtyOffset=t):t+1>this._dirtyOffset+this._dirtyCount&&(this._dirtyCount=t+1-this._dirtyOffset)}_makeDirtyBoundingVolume(){this._dirtyBoundingVolume=!0}update(t){t.mode!==oe.SCENE3D&&It("bufferprim-scenemode","BufferPrimitiveCollection requires SceneMode.SCENE3D."),this._dirtyBoundingVolume&&this._updateBoundingVolume()}get primitiveCount(){return this._primitiveCount}get primitiveCountMax(){return this._primitiveCountMax}get byteLength(){return this._primitiveView.byteLength+this._positionView.byteLength+this._materialView.byteLength}get vertexCount(){return this._positionCount}get vertexCountMax(){return this._positionCountMax}static _copySubArray(t,n,i){for(let o=0;o<i;o++)n[o]=t[o]}static _copySubDataView(t,n,i){this._copySubArray(new Uint32Array(t.buffer,t.byteOffset,t.byteLength/4),new Uint32Array(n.buffer,n.byteOffset,n.byteLength/4),i/4)}toJSON(){let t=this._getPrimitiveClass(),n=new t,i=[];for(let o=0,r=this.primitiveCount;o<r;o++)i.push(this.get(o,n).toJSON());return i}};Rn(nS,"DEFAULT_CAPACITY",1024),Rn(nS,"Error",{ERR_RESIZE:"BufferPrimitive range cannot be resized after initialization.",ERR_CAPACITY:"BufferPrimitiveCollection capacity exceeded.",ERR_MULTIPLE_OF_FOUR:"BufferPrimitive byte length must be a multiple of 4.",ERR_OUT_OF_RANGE:"BufferPrimitive buffer access out of range."});var aX=nS,Za=aX;var{ERR_CAPACITY:f4n}=Za.Error,ztt=new d,F8=class F8 extends ta{constructor(){super(...arguments);Rn(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPosition(n.getPosition(ztt)),i}get vertexOffset(){return this._getUint32(F8.Layout.POSITION_OFFSET_U32)}get vertexCount(){return 1}getPosition(n){let i=this._collection._positionView;return d.fromArray(i,this.vertexOffset*3,n)}setPosition(n){let i=this._collection,o=this.vertexOffset;i._positionView[o*3]=n.x,i._positionView[o*3+1]=n.y,i._positionView[o*3+2]=n.z,i._makeDirtyBoundingVolume()}toJSON(){return{...super.toJSON(),position:d.pack(this.getPosition(),[])}}};Rn(F8,"Layout",{...ta.Layout,POSITION_OFFSET_U32:ta.Layout.__BYTE_LENGTH,__BYTE_LENGTH:ta.Layout.__BYTE_LENGTH+4});var sX=F8,Lu=sX;var P1=`in vec3 positionHigh;
in vec3 positionLow;
in vec4 pickColor;
in vec3 showPixelSizeAndColor;
in vec2 outlineWidthAndOutlineColor;
out vec4 v_pickColor;
out vec4 v_color;
out vec4 v_outlineColor;
out float v_innerRadiusFrac;
void main()
{
// Unpack attributes.
float show = showPixelSizeAndColor.x;
float pixelSize = showPixelSizeAndColor.y;
vec4 color = czm_decodeRGB8(showPixelSizeAndColor.z);
float outlineWidth = outlineWidthAndOutlineColor.x;
vec4 outlineColor = czm_decodeRGB8(outlineWidthAndOutlineColor.y);
///////////////////////////////////////////////////////////////////////////
float innerRadius = 0.5 * pixelSize * czm_pixelRatio;
float outerRadius = (0.5 * pixelSize + outlineWidth) * czm_pixelRatio;
///////////////////////////////////////////////////////////////////////////
vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
vec4 positionEC = czm_modelViewRelativeToEye * p;
///////////////////////////////////////////////////////////////////////////
gl_Position = czm_projection * positionEC;
czm_vertexLogDepth();
v_pickColor = pickColor / 255.0;
v_color = color;
v_color.a *= show;
v_outlineColor = outlineColor;
v_outlineColor.a *= show;
v_innerRadiusFrac = innerRadius / outerRadius;
gl_PointSize = 2.0 * outerRadius * show;
gl_Position *= show;
}
`;var R1=`in vec4 v_pickColor;
in vec4 v_color;
in vec4 v_outlineColor;
in float v_innerRadiusFrac;
void main()
{
// Distance between fragment and point center, 0 to 0.5.
float distanceToCenter = length(gl_PointCoord - vec2(0.5));
float delta = fwidth(distanceToCenter);
float outerLimit = 0.5;
float innerLimit = 0.5 * v_innerRadiusFrac;
float outerAlpha = 1.0 - smoothstep(max(0.0, outerLimit - delta), outerLimit, distanceToCenter);
float innerAlpha = 1.0 - smoothstep(innerLimit - delta, innerLimit, distanceToCenter);
vec4 color = vec4(mix(v_outlineColor.rgb, v_color.rgb, innerAlpha), outerAlpha);
if (color.a < 0.005) // matches 0/255 and 1/255
{
discard;
}
out_FragColor = czm_gammaCorrect(color);
czm_writeLogDepth();
}
`;var M1=class{constructor(t=V.EMPTY_OBJECT){this.color=z.clone(t.color??z.WHITE),this.outlineColor=z.clone(t.outlineColor??z.WHITE),this.outlineWidth=t.outlineWidth??0}static get packedLength(){return this.Layout.__BYTE_LENGTH}static pack(t,n,i){n.setUint32(this.Layout.COLOR_U32+i,t.color.toRgba(),!0),n.setUint32(this.Layout.OUTLINE_COLOR_U32+i,t.outlineColor.toRgba(),!0),n.setUint8(this.Layout.OUTLINE_WIDTH_U8+i,t.outlineWidth)}static unpack(t,n,i){return z.fromRgba(t.getUint32(this.Layout.COLOR_U32+n,!0),i.color),z.fromRgba(t.getUint32(this.Layout.OUTLINE_COLOR_U32+n,!0),i.outlineColor),i.outlineWidth=t.getUint8(this.Layout.OUTLINE_WIDTH_U8+n),i}toJSON(){return{color:this.color.toCssHexString(),outlineColor:this.outlineColor.toCssHexString(),outlineWidth:this.outlineWidth}}};Rn(M1,"Layout",{COLOR_U32:0,OUTLINE_COLOR_U32:4,OUTLINE_WIDTH_U8:8,__BYTE_LENGTH:12}),Rn(M1,"DEFAULT_MATERIAL");var Jl=M1;var N1=class N1 extends Jl{constructor(t=V.EMPTY_OBJECT){super(t),this.size=t.size??1}static pack(t,n,i){super.pack(t,n,i),n.setUint8(this.Layout.SIZE_U8+i,t.size)}static unpack(t,n,i){return super.unpack(t,n,i),i.size=t.getUint8(this.Layout.SIZE_U8+n),i}toJSON(){return{...super.toJSON(),size:this.size}}};Rn(N1,"Layout",{...Jl.Layout,SIZE_U8:Jl.Layout.__BYTE_LENGTH,__BYTE_LENGTH:Jl.Layout.__BYTE_LENGTH+4}),Rn(N1,"DEFAULT_MATERIAL",Object.freeze(new N1));var cX=N1,vg=cX;var Pg={positionHigh:0,positionLow:1,pickColor:2,showSizeAndColor:3,outlineWidthAndOutlineColor:4},Rg=new Lu,L1=new vg,O1=new z,eAe=new d,q0=new xn;function Gtt(e,t,n){let i=t.context;if(n=n||{destroy:Htt},!l(n.attributeArrays)){let o=e.primitiveCountMax;n.attributeArrays={positionHigh:new Float32Array(o*3),positionLow:new Float32Array(o*3),pickColor:new Uint8Array(o*4),showSizeAndColor:new Float32Array(o*3),outlineWidthAndOutlineColor:new Float32Array(o*2)}}if(l(n.pickIds)||(n.pickIds=[]),e._dirtyCount>0){let{attributeArrays:o,pickIds:r}=n,a=o.positionHigh,s=o.positionLow,c=o.pickColor,u=o.showSizeAndColor,f=o.outlineWidthAndOutlineColor,{_dirtyOffset:h,_dirtyCount:p}=e;for(let A=h,m=h+p;A<m;A++)if(e.get(A,Rg),!!Rg._dirty){if(e._allowPicking&&Rg._pickId===0){let _=i.createPickId({collection:e,index:A,get primitive(){return e.get(this.index,new Lu)}});Rg._pickId=_.key,r.push(_)}Rg.getPosition(eAe),xn.fromCartesian(eAe,q0),Rg.getMaterial(L1),z.fromRgba(Rg._pickId,O1),a[A*3]=q0.high.x,a[A*3+1]=q0.high.y,a[A*3+2]=q0.high.z,s[A*3]=q0.low.x,s[A*3+1]=q0.low.y,s[A*3+2]=q0.low.z,c[A*4]=z.floatToByte(O1.red),c[A*4+1]=z.floatToByte(O1.green),c[A*4+2]=z.floatToByte(O1.blue),c[A*4+3]=z.floatToByte(O1.alpha),u[A*3]=Rg.show?1:0,u[A*3+1]=L1.size,u[A*3+2]=tn.encodeRGB8(L1.color),f[A*2]=L1.outlineWidth,f[A*2+1]=tn.encodeRGB8(L1.outlineColor),Rg._dirty=!1}}if(l(n.vertexArray)){if(e._dirtyCount>0){for(let o in Pg)if(Object.hasOwn(Pg,o)){let r=o;n.vertexArray.copyAttributeFromRange(Pg[r],n.attributeArrays[r],e._dirtyOffset,e._dirtyCount)}}}else{let{attributeArrays:o}=n;n.vertexArray=new Gn({context:i,attributes:[{index:Pg.positionHigh,componentDatatype:j.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:o.positionHigh,context:i,usage:Re.STATIC_DRAW})},{index:Pg.positionLow,componentDatatype:j.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:o.positionLow,context:i,usage:Re.STATIC_DRAW})},{index:Pg.pickColor,componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:tt.createVertexBuffer({typedArray:o.pickColor,context:i,usage:Re.STATIC_DRAW})},{index:Pg.showSizeAndColor,componentDatatype:j.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:o.showSizeAndColor,context:i,usage:Re.STATIC_DRAW})},{index:Pg.outlineWidthAndOutlineColor,componentDatatype:j.FLOAT,componentsPerAttribute:2,vertexBuffer:tt.createVertexBuffer({typedArray:o.outlineWidthAndOutlineColor,context:i,usage:Re.STATIC_DRAW})}]})}return l(n.renderState)||(n.renderState=Ve.fromCache({blending:sn.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=$t.fromCache({context:i,vertexShaderSource:new We({sources:[P1]}),fragmentShaderSource:new We({sources:[R1]}),attributeLocations:Pg})),(!l(n.command)||Vtt(e,n.command))&&(n.command=new nt({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:ve.POINTS,pass:Be.OPAQUE,pickId:"v_pickColor",owner:e,count:e.primitiveCount,modelMatrix:e.modelMatrix,boundingVolume:e.boundingVolumeWC,debugShowBoundingVolume:e.debugShowBoundingVolume})),t.commandList.push(n.command),e._dirtyCount=0,e._dirtyOffset=0,n}function Vtt(e,t){let n=M.equals(e.modelMatrix,t._modelMatrix),i=le.equals(e.boundingVolumeWC,t._boundingVolume);return e.primitiveCount!==t._count||e.debugShowBoundingVolume!==t.debugShowBoundingVolume||!n||!i}function Htt(){let e=this;if(l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&Ve.removeFromCache(e.renderState),l(e.pickIds))for(let t of e.pickIds)t.destroy()}var F1=Gtt;var lX=class e extends Za{constructor(t=V.EMPTY_OBJECT){super({...t,vertexCountMax:t.primitiveCountMax})}_getCollectionClass(){return e}_getPrimitiveClass(){return Lu}_getMaterialClass(){return vg}static _cloneEmpty(t){return new e({primitiveCountMax:t.primitiveCountMax})}add(t,n=new Lu){return super.add(t,n),n._setUint32(Lu.Layout.POSITION_OFFSET_U32,this._positionCount++),n.setPosition(t.position??d.ZERO),n}update(t){super.update(t);let n=t.passes;this.show&&(n.render||n.pick)&&(this._renderContext=F1(this,t,this._renderContext))}},Mg=lX;var{ERR_CAPACITY:i9n,ERR_RESIZE:o9n,ERR_OUT_OF_RANGE:r9n}=Za.Error,Qd=class Qd extends ta{constructor(){super(...arguments);Rn(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPositions(n.getPositions()),i.setHoles(n.getHoles()),i.setTriangles(n.getTriangles()),i}get vertexOffset(){return this._getUint32(Qd.Layout.POSITION_OFFSET_U32)}get vertexCount(){return this._getUint32(Qd.Layout.POSITION_COUNT_U32)}getPositions(n){return this._getPositionsRange(0,this.vertexCount,n)}setPositions(n){let i=this._collection,o=this.vertexOffset,r=this.vertexCount,a=n.length/3,s=i.vertexCount+a-r;i._positionCount=s,this._setUint32(Qd.Layout.POSITION_COUNT_U32,a);let c=i._positionView;for(let u=0;u<a;u++)c[(o+u)*3]=n[u*3],c[(o+u)*3+1]=n[u*3+1],c[(o+u)*3+2]=n[u*3+2];i._makeDirtyBoundingVolume()}get outerVertexOffset(){return this.vertexOffset}get outerVertexCount(){return this.holeCount>0?this.getHoles()[0]:this.vertexCount}getOuterPositions(n){return this._getPositionsRange(0,this.outerVertexCount,n)}get holeOffset(){return this._getUint32(Qd.Layout.HOLE_OFFSET_U32)}get holeCount(){return this._getUint32(Qd.Layout.HOLE_COUNT_U32)}getHoles(n){let{holeOffset:i,holeCount:o}=this,r=this._collection._holeIndexView;if(!l(n)){let a=r.byteOffset+i*r.BYTES_PER_ELEMENT,s=r.constructor;return new s(r.buffer,a,o)}for(let a=0;a<o;a++)n[a]=r[i+a];return n}setHoles(n){let i=this._collection,o=this.holeOffset,r=this.holeCount,a=n.length,s=i.holeCount+a-r;i._holeCount=s,this._setUint32(Qd.Layout.HOLE_COUNT_U32,a);let c=i._holeIndexView;for(let u=0;u<a;u++)c[o+u]=n[u];i._makeDirtyBoundingVolume()}getHoleVertexCount(n){let i=this.getHoles(),o=i[n];return n===i.length-1?this.vertexCount-o:i[n+1]-o}getHolePositions(n,i){let r=this.getHoles()[n],a=this.getHoleVertexCount(n);return this._getPositionsRange(r,a,i)}_getPositionsRange(n,i,o){let r=this._collection,a=this._collection._positionView,s=this.vertexOffset+n;if(!l(o)){let c=a.byteOffset+s*3*a.BYTES_PER_ELEMENT,u=a.constructor;return new u(a.buffer,c,i*3)}for(let c=0;c<i;c++)o[c*3]=a[(s+c)*3],o[c*3+1]=a[(s+c)*3+1],o[c*3+2]=a[(s+c)*3+2];return o}get triangleOffset(){return this._getUint32(Qd.Layout.TRIANGLE_OFFSET_U32)}get triangleCount(){return this._getUint32(Qd.Layout.TRIANGLE_COUNT_U32)}getTriangles(n){let{triangleOffset:i,triangleCount:o}=this,r=this._collection._triangleIndexView;if(!l(n)){let a=r.byteOffset+i*3*r.BYTES_PER_ELEMENT,s=r.constructor;return new s(r.buffer,a,o*3)}for(let a=0;a<o;a++)n[a*3]=r[(i+a)*3],n[a*3+1]=r[(i+a)*3+1],n[a*3+2]=r[(i+a)*3+2];return n}setTriangles(n){let i=this._collection,o=this.triangleOffset,r=this.triangleCount,a=n.length/3,s=i.triangleCount+a-r;i._triangleCount+=a-r,this._setUint32(Qd.Layout.TRIANGLE_COUNT_U32,a);let c=i._triangleIndexView;for(let u=0;u<a;u++)c[(o+u)*3]=n[u*3],c[(o+u)*3+1]=n[u*3+1],c[(o+u)*3+2]=n[u*3+2];i._makeDirtyBoundingVolume()}toJSON(){return{...super.toJSON(),positions:Array.from(this.getPositions()),holes:Array.from(this.getHoles()),triangles:Array.from(this.getTriangles())}}};Rn(Qd,"Layout",{...ta.Layout,POSITION_OFFSET_U32:ta.Layout.__BYTE_LENGTH,POSITION_COUNT_U32:ta.Layout.__BYTE_LENGTH+4,HOLE_OFFSET_U32:ta.Layout.__BYTE_LENGTH+8,HOLE_COUNT_U32:ta.Layout.__BYTE_LENGTH+12,TRIANGLE_OFFSET_U32:ta.Layout.__BYTE_LENGTH+16,TRIANGLE_COUNT_U32:ta.Layout.__BYTE_LENGTH+20,__BYTE_LENGTH:ta.Layout.__BYTE_LENGTH+24});var uX=Qd,ks=uX;var Q1=`in vec3 positionHigh;
in vec3 positionLow;
in vec4 pickColor;
in vec2 showAndColor;
out vec4 v_pickColor;
out vec4 v_color;
void main()
{
float show = showAndColor.x;
vec4 color = czm_decodeRGB8(showAndColor.y);
///////////////////////////////////////////////////////////////////////////
vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
vec4 positionEC = czm_modelViewRelativeToEye * p;
///////////////////////////////////////////////////////////////////////////
gl_Position = czm_projection * positionEC;
czm_vertexLogDepth();
v_pickColor = pickColor / 255.0;
v_color = color;
v_color.a *= show;
gl_Position *= show;
}
`;var k1=`in vec4 v_pickColor;
in vec4 v_color;
void main()
{
if (v_color.a < 0.005) // matches 0/255 and 1/255
{
discard;
}
out_FragColor = czm_gammaCorrect(v_color);
czm_writeLogDepth();
}
`;var Q8=class Q8 extends Jl{constructor(t=V.EMPTY_OBJECT){super(t)}};Rn(Q8,"DEFAULT_MATERIAL",Object.freeze(new Q8));var fX=Q8,Ng=fX;var Zy={positionHigh:0,positionLow:1,pickColor:2,showAndColor:3},za=new ks,tAe=new Ng,U1=new z,nAe=new d,K0=new xn;function Wtt(e,t,n){let i=t.context;if(n=n||{destroy:qtt},!l(n.attributeArrays)||!l(n.indexArray)){let{vertexCountMax:o,triangleCountMax:r}=e;n.indexArray=Ue.createTypedArray(o,r*3),n.attributeArrays={positionHigh:new Float32Array(o*3),positionLow:new Float32Array(o*3),pickColor:new Uint8Array(o*4),showAndColor:new Float32Array(o*2)}}if(l(n.pickIds)||(n.pickIds=[]),e._dirtyCount>0){let{attributeArrays:o,pickIds:r}=n,{_dirtyOffset:a,_dirtyCount:s}=e,c=n.indexArray,u=o.positionHigh,f=o.positionLow,h=o.pickColor,p=o.showAndColor;for(let A=a,m=a+s;A<m;A++){if(e.get(A,za),!za._dirty)continue;if(e._allowPicking&&za._pickId===0){let S=i.createPickId({collection:e,index:A,get primitive(){return e.get(A,new ks)}});za._pickId=S.key,r.push(S)}let _=za.triangleOffset,y=za.vertexOffset,C=za.getTriangles();for(let S=0,B=za.triangleCount;S<B;S++)c[_*3]=y+C[S*3],c[_*3+1]=y+C[S*3+1],c[_*3+2]=y+C[S*3+2],_++;let E=za.show,b=za.getPositions();za.getMaterial(tAe);let x=tn.encodeRGB8(tAe.color);z.fromRgba(za._pickId,U1);for(let S=0,B=za.vertexCount;S<B;S++)d.fromArray(b,S*3,nAe),xn.fromCartesian(nAe,K0),u[y*3]=K0.high.x,u[y*3+1]=K0.high.y,u[y*3+2]=K0.high.z,f[y*3]=K0.low.x,f[y*3+1]=K0.low.y,f[y*3+2]=K0.low.z,h[y*4]=z.floatToByte(U1.red),h[y*4+1]=z.floatToByte(U1.green),h[y*4+2]=z.floatToByte(U1.blue),h[y*4+3]=z.floatToByte(U1.alpha),p[y*2]=E?1:0,p[y*2+1]=x,y++;za._dirty=!1}}if(l(n.vertexArray)){if(e._dirtyCount>0){let{indexOffset:o,indexCount:r,vertexOffset:a,vertexCount:s}=Ytt(e);n.vertexArray.copyIndexFromRange(n.indexArray,o,r);for(let c in Zy)if(Object.hasOwn(Zy,c)){let u=c;n.vertexArray.copyAttributeFromRange(Zy[u],n.attributeArrays[u],a,s)}}}else{let{attributeArrays:o}=n;n.vertexArray=new Gn({context:i,indexBuffer:tt.createIndexBuffer({context:i,typedArray:n.indexArray,usage:Re.STATIC_DRAW,indexDatatype:Ue.fromTypedArray(n.indexArray)}),attributes:[{index:Zy.positionHigh,componentDatatype:j.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:o.positionHigh,context:i,usage:Re.STATIC_DRAW})},{index:Zy.positionLow,componentDatatype:j.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:o.positionLow,context:i,usage:Re.STATIC_DRAW})},{index:Zy.pickColor,componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:tt.createVertexBuffer({typedArray:o.pickColor,context:i,usage:Re.STATIC_DRAW})},{index:Zy.showAndColor,componentDatatype:j.FLOAT,componentsPerAttribute:2,vertexBuffer:tt.createVertexBuffer({typedArray:o.showAndColor,context:i,usage:Re.STATIC_DRAW})}]})}return l(n.renderState)||(n.renderState=Ve.fromCache({blending:sn.DISABLED,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=$t.fromCache({context:i,vertexShaderSource:new We({sources:[Q1]}),fragmentShaderSource:new We({sources:[k1]}),attributeLocations:Zy})),(!l(n.command)||jtt(e,n.command))&&(n.command=new nt({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:ve.TRIANGLES,pass:Be.OPAQUE,pickId:"v_pickColor",owner:e,count:e.triangleCount*3,modelMatrix:e.modelMatrix,boundingVolume:e.boundingVolumeWC,debugShowBoundingVolume:e.debugShowBoundingVolume})),t.commandList.push(n.command),e._dirtyCount=0,e._dirtyOffset=0,n}function jtt(e,t){let n=M.equals(e.modelMatrix,t._modelMatrix),i=le.equals(e.boundingVolumeWC,t._boundingVolume);return e.triangleCount*3!==t._count||e.debugShowBoundingVolume!==t.debugShowBoundingVolume||!n||!i}function Ytt(e){let{_dirtyOffset:t,_dirtyCount:n}=e;e.get(t,za);let i=za.vertexOffset,o=za.triangleOffset*3;e.get(t+n-1,za);let r=za.vertexOffset+za.vertexCount-i,a=(za.triangleOffset+za.triangleCount)*3-o;return{indexOffset:o,indexCount:a,vertexOffset:i,vertexCount:r}}function qtt(){let e=this;if(l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&Ve.removeFromCache(e.renderState),l(e.pickIds))for(let t of e.pickIds)t.destroy()}var z1=Wtt;var{ERR_CAPACITY:W9n}=Za.Error,dX=class e extends Za{constructor(t=V.EMPTY_OBJECT){super(t),this._holeCount=0,this._holeCountMax=t.holeCountMax??Za.DEFAULT_CAPACITY,this._holeIndexView=null,this._triangleCount=0,this._triangleCountMax=t.triangleCountMax??Za.DEFAULT_CAPACITY,this._triangleIndexView=null,this._allocateHoleIndexBuffer(),this._allocateTriangleIndexBuffer()}_getCollectionClass(){return e}_getPrimitiveClass(){return ks}_getMaterialClass(){return Ng}_allocateHoleIndexBuffer(){this._holeIndexView=Ue.createTypedArray(this._positionCountMax,this._holeCountMax)}_allocateTriangleIndexBuffer(){this._triangleIndexView=Ue.createTypedArray(this._positionCountMax,this._triangleCountMax*3)}static clone(t,n){return super.clone(t,n),this._copySubArray(t._holeIndexView,n._holeIndexView,t.holeCount),this._copySubArray(t._triangleIndexView,n._triangleIndexView,t._triangleCount*3),n._holeCount=t._holeCount,n._triangleCount=t._triangleCount,n}static _cloneEmpty(t){return new e({primitiveCountMax:t.primitiveCountMax,vertexCountMax:t.vertexCountMax,holeCountMax:t.holeCountMax,triangleCountMax:t.triangleCountMax})}static _replaceBuffers(t,n){super._replaceBuffers(t,n),n._holeIndexView=t._holeIndexView,n._triangleIndexView=t._triangleIndexView}add(t,n=new ks){super.add(t,n);let i=this._positionCount;n._setUint32(ks.Layout.POSITION_OFFSET_U32,i),n._setUint32(ks.Layout.POSITION_COUNT_U32,0);let o=this._holeCount;n._setUint32(ks.Layout.HOLE_OFFSET_U32,o),n._setUint32(ks.Layout.HOLE_COUNT_U32,0);let r=this._triangleCount;return n._setUint32(ks.Layout.TRIANGLE_OFFSET_U32,r),n._setUint32(ks.Layout.TRIANGLE_COUNT_U32,0),l(t.positions)&&n.setPositions(t.positions),l(t.holes)&&n.setHoles(t.holes),l(t.triangles)&&n.setTriangles(t.triangles),n}update(t){super.update(t);let n=t.passes;this.show&&(n.render||n.pick)&&(this._renderContext=z1(this,t,this._renderContext))}get byteLength(){return super.byteLength+this._holeIndexView.byteLength+this._triangleIndexView.byteLength}get holeCount(){return this._holeCount}get holeCountMax(){return this._holeCountMax}get triangleCount(){return this._triangleCount}get triangleCountMax(){return this._triangleCountMax}},Lg=dX;var{ERR_RESIZE:X9n,ERR_CAPACITY:J9n}=Za.Error,iS=class iS extends ta{constructor(){super(...arguments);Rn(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPositions(n.getPositions()),i}get vertexOffset(){return this._getUint32(iS.Layout.POSITION_OFFSET_U32)}get vertexCount(){return this._getUint32(iS.Layout.POSITION_COUNT_U32)}getPositions(n){let{vertexOffset:i,vertexCount:o}=this,r=this._collection._positionView;if(!l(n)){let a=r.byteOffset+i*3*r.BYTES_PER_ELEMENT,s=r.constructor;return new s(r.buffer,a,o*3)}for(let a=0;a<o;a++)n[a*3]=r[(i+a)*3],n[a*3+1]=r[(i+a)*3+1],n[a*3+2]=r[(i+a)*3+2];return n}setPositions(n){let i=this._collection,o=this.vertexOffset,r=this.vertexCount,a=n.length/3,s=i._positionCount+a-r;i._positionCount=s,this._setUint32(iS.Layout.POSITION_COUNT_U32,a);let c=i._positionView;for(let u=0;u<a;u++)c[(o+u)*3]=n[u*3],c[(o+u)*3+1]=n[u*3+1],c[(o+u)*3+2]=n[u*3+2];i._makeDirtyBoundingVolume()}toJSON(){return{...super.toJSON(),positions:Array.from(this.getPositions())}}};Rn(iS,"Layout",{...ta.Layout,POSITION_OFFSET_U32:ta.Layout.__BYTE_LENGTH,POSITION_COUNT_U32:ta.Layout.__BYTE_LENGTH+4,__BYTE_LENGTH:ta.Layout.__BYTE_LENGTH+8});var hX=iS,Zl=hX;var G1=`in vec3 positionHigh;
in vec3 positionLow;
in vec3 prevPositionHigh;
in vec3 prevPositionLow;
in vec3 nextPositionHigh;
in vec3 nextPositionLow;
in vec4 pickColor;
in vec4 showColorWidthAndTexCoord;
out vec4 v_pickColor;
out vec4 v_color;
out vec2 v_st;
out float v_width;
out float v_polylineAngle;
void main()
{
float show = showColorWidthAndTexCoord.x;
vec4 color = czm_decodeRGB8(showColorWidthAndTexCoord.y);
float width = showColorWidthAndTexCoord.z;
float texCoord = showColorWidthAndTexCoord.w;
///////////////////////////////////////////////////////////////////////////
bool usePrevious = texCoord == 1.0;
float expandDir = gl_VertexID % 2 == 1 ? 1.0 : -1.0;
float polylineAngle;
vec4 positionEC = czm_translateRelativeToEye(positionHigh, positionLow);
vec4 prevPositionEC = czm_translateRelativeToEye(prevPositionHigh, prevPositionLow);
vec4 nextPositionEC = czm_translateRelativeToEye(nextPositionHigh, nextPositionLow);
vec4 positionWC = getPolylineWindowCoordinates(positionEC, prevPositionEC, nextPositionEC, expandDir, width, usePrevious, polylineAngle);
///////////////////////////////////////////////////////////////////////////
gl_Position = czm_viewportOrthographic * positionWC * show;
v_pickColor = pickColor / 255.0;
v_color = color;
v_color.a *= show;
v_st.s = texCoord;
v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w);
v_width = width;
v_polylineAngle = polylineAngle;
}
`;var V1=`in vec4 v_pickColor;
in vec4 v_color;
void main()
{
if (v_color.a < 0.005) // matches 0/255 and 1/255
{
discard;
}
out_FragColor = czm_gammaCorrect(v_color);
czm_writeLogDepth();
}
`;var H1=class H1 extends Jl{constructor(t=V.EMPTY_OBJECT){super(t),this.width=t.width??1}static pack(t,n,i){super.pack(t,n,i),n.setUint8(this.Layout.WIDTH_U8+i,t.width)}static unpack(t,n,i){return super.unpack(t,n,i),i.width=t.getUint8(this.Layout.WIDTH_U8+n),i}toJSON(){return{...super.toJSON(),width:this.width}}};Rn(H1,"Layout",{...Jl.Layout,WIDTH_U8:Jl.Layout.__BYTE_LENGTH,__BYTE_LENGTH:Jl.Layout.__BYTE_LENGTH+4}),Rn(H1,"DEFAULT_MATERIAL",Object.freeze(new H1));var mX=H1,Og=mX;var kd={positionHigh:0,positionLow:1,prevPositionHigh:2,prevPositionLow:3,nextPositionHigh:4,nextPositionLow:5,pickColor:6,showColorWidthAndTexCoord:7},ac=new Zl,pX=new Og,W1=new z,oS=new d,X0=new d,J0=new d,Z0=new xn,$0=new xn,eb=new xn;function Ktt(e,t,n){let i=t.context;if(n=n||{destroy:Ztt},!l(n.attributeArrays)||!l(n.indexArray)){let o=e.vertexCountMax-e.primitiveCount,r=e.vertexCountMax*2;n.indexArray=Ue.createTypedArray(r,o*6),n.attributeArrays={positionHigh:new Float32Array(r*3),positionLow:new Float32Array(r*3),prevPositionHigh:new Float32Array(r*3),prevPositionLow:new Float32Array(r*3),nextPositionHigh:new Float32Array(r*3),nextPositionLow:new Float32Array(r*3),pickColor:new Uint8Array(r*4),showColorWidthAndTexCoord:new Float32Array(r*4)}}if(l(n.pickIds)||(n.pickIds=[]),e._dirtyCount>0){let{_dirtyOffset:o,_dirtyCount:r}=e,{attributeArrays:a,pickIds:s}=n,c=n.indexArray,u=a.positionHigh,f=a.positionLow,h=a.prevPositionHigh,p=a.prevPositionLow,A=a.nextPositionHigh,m=a.nextPositionLow,_=a.pickColor,y=a.showColorWidthAndTexCoord;for(let C=o,E=o+r;C<E;C++){if(e.get(C,ac),!ac._dirty)continue;if(e._allowPicking&&ac._pickId===0){let P=i.createPickId({collection:e,index:C,get primitive(){return e.get(C,new Zl)}});ac._pickId=P.key,s.push(P)}let b=ac.getPositions();ac.getMaterial(pX);let x=tn.encodeRGB8(pX.color);z.fromRgba(ac._pickId,W1);let S=ac.show,B=ac.vertexOffset*2,v=(ac.vertexOffset-C)*6;for(let P=0,N=ac.vertexCount;P<N;P++){let L=P===0,g=P===N-1;d.fromArray(b,P*3,oS),L?(d.fromArray(b,(P+1)*3,J0),d.subtract(oS,J0,X0),d.add(oS,X0,X0)):g?(d.fromArray(b,(P-1)*3,X0),d.subtract(oS,X0,J0),d.add(oS,J0,J0)):(d.fromArray(b,(P-1)*3,X0),d.fromArray(b,(P+1)*3,J0)),g||(c[v]=B,c[v+1]=B+1,c[v+2]=B+2,c[v+3]=B+2,c[v+4]=B+1,c[v+5]=B+3,v+=6),xn.fromCartesian(oS,Z0),xn.fromCartesian(X0,$0),xn.fromCartesian(J0,eb);for(let I=0;I<2;I++)u[B*3]=Z0.high.x,u[B*3+1]=Z0.high.y,u[B*3+2]=Z0.high.z,f[B*3]=Z0.low.x,f[B*3+1]=Z0.low.y,f[B*3+2]=Z0.low.z,h[B*3]=$0.high.x,h[B*3+1]=$0.high.y,h[B*3+2]=$0.high.z,p[B*3]=$0.low.x,p[B*3+1]=$0.low.y,p[B*3+2]=$0.low.z,A[B*3]=eb.high.x,A[B*3+1]=eb.high.y,A[B*3+2]=eb.high.z,m[B*3]=eb.low.x,m[B*3+1]=eb.low.y,m[B*3+2]=eb.low.z,_[B*4]=z.floatToByte(W1.red),_[B*4+1]=z.floatToByte(W1.green),_[B*4+2]=z.floatToByte(W1.blue),_[B*4+3]=z.floatToByte(W1.alpha),y[B*4]=S?1:0,y[B*4+1]=x,y[B*4+2]=pX.width,y[B*4+3]=P/(N-1),B++}ac._dirty=!1}}if(l(n.vertexArray)){if(e._dirtyCount>0){let{indexOffset:o,indexCount:r,vertexOffset:a,vertexCount:s}=Jtt(e);n.vertexArray.copyIndexFromRange(n.indexArray,o,r);for(let c in kd)if(Object.hasOwn(kd,c)){let u=c;n.vertexArray.copyAttributeFromRange(kd[u],n.attributeArrays[u],a,s)}}}else{let o=n.attributeArrays;n.vertexArray=new Gn({context:i,indexBuffer:tt.createIndexBuffer({context:i,typedArray:n.indexArray,usage:Re.STATIC_DRAW,indexDatatype:Ue.fromTypedArray(n.indexArray)}),attributes:[{index:kd.positionHigh,componentDatatype:j.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:o.positionHigh,context:i,usage:Re.STATIC_DRAW})},{index:kd.positionLow,componentDatatype:j.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:o.positionLow,context:i,usage:Re.STATIC_DRAW})},{index:kd.prevPositionHigh,componentDatatype:j.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:o.prevPositionHigh,context:i,usage:Re.STATIC_DRAW})},{index:kd.prevPositionLow,componentDatatype:j.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:o.prevPositionLow,context:i,usage:Re.STATIC_DRAW})},{index:kd.nextPositionHigh,componentDatatype:j.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:o.nextPositionHigh,context:i,usage:Re.STATIC_DRAW})},{index:kd.nextPositionLow,componentDatatype:j.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:o.nextPositionLow,context:i,usage:Re.STATIC_DRAW})},{index:kd.pickColor,componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:tt.createVertexBuffer({typedArray:o.pickColor,context:i,usage:Re.STATIC_DRAW})},{index:kd.showColorWidthAndTexCoord,componentDatatype:j.FLOAT,componentsPerAttribute:4,vertexBuffer:tt.createVertexBuffer({typedArray:o.showColorWidthAndTexCoord,context:i,usage:Re.STATIC_DRAW})}]})}return l(n.renderState)||(n.renderState=Ve.fromCache({blending:sn.DISABLED,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=$t.fromCache({context:i,vertexShaderSource:new We({sources:[Rl,G1]}),fragmentShaderSource:new We({sources:[V1]}),attributeLocations:kd})),(!l(n.command)||Xtt(e,n.command))&&(n.command=new nt({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:ve.TRIANGLES,pass:Be.OPAQUE,pickId:"v_pickColor",owner:e,count:iAe(e),modelMatrix:e.modelMatrix,boundingVolume:e.boundingVolumeWC,debugShowBoundingVolume:e.debugShowBoundingVolume})),t.commandList.push(n.command),e._dirtyCount=0,e._dirtyOffset=0,n}function Xtt(e,t){let n=M.equals(e.modelMatrix,t._modelMatrix),i=le.equals(e.boundingVolumeWC,t._boundingVolume);return iAe(e)!==t._count||e.debugShowBoundingVolume!==t.debugShowBoundingVolume||!n||!i}function iAe(e){return(e.vertexCount-e.primitiveCount)*6}function Jtt(e){let{_dirtyOffset:t,_dirtyCount:n}=e;e.get(t,ac);let i=ac.vertexOffset*2,r=(ac.vertexOffset-t)*6;e.get(t+n-1,ac);let a=(ac.vertexOffset+ac.vertexCount)*2-i,c=(a/2-n)*6;return{indexOffset:r,indexCount:c,vertexOffset:i,vertexCount:a}}function Ztt(){let e=this;if(l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&Ve.removeFromCache(e.renderState),l(e.pickIds))for(let t of e.pickIds)t.destroy()}var j1=Ktt;var AX=class e extends Za{_getCollectionClass(){return e}_getPrimitiveClass(){return Zl}_getMaterialClass(){return Og}static _cloneEmpty(t){return new e({primitiveCountMax:t.primitiveCountMax,vertexCountMax:t.vertexCountMax})}add(t,n=new Zl){super.add(t,n);let i=this._positionCount;return n._setUint32(Zl.Layout.POSITION_OFFSET_U32,i),n._setUint32(Zl.Layout.POSITION_COUNT_U32,0),l(t.positions)&&n.setPositions(t.positions),n}update(t){super.update(t);let n=t.passes;this.show&&(n.render||n.pick)&&(this._renderContext=j1(this,t,this._renderContext))}},$y=AX;function rS(e,t){this._conditionsExpression=je(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,ent(this,t)}Object.defineProperties(rS.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function $tt(e,t){this.condition=e,this.expression=t}function ent(e,t){let n=[],i=e._conditions;if(!l(i))return;let o=i.length;for(let r=0;r<o;++r){let a=i[r],s=String(a[0]),c=String(a[1]);n.push(new $tt(new Id(s,t),new Id(c,t)))}e._runtimeConditions=n}rS.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)}};rS.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)}};rS.prototype.getShaderFunction=function(e,t,n,i){let o=this._runtimeConditions;if(!l(o)||o.length===0)return;let r="",a=o.length;for(let s=0;s<a;++s){let c=o[s],u=c.condition.getShaderExpression(t,n),f=c.expression.getShaderExpression(t,n);r+=` ${s===0?"if":"else if"} (${u})
{
return ${f};
}
`}return r=`${i} ${e}
{
${r} return ${i}(1.0);
}
`,r};rS.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];oi(e,o.condition.getVariables()),oi(e,o.expression.getVariables())}return e=e.filter(function(i,o,r){return r.indexOf(i)===o}),e};var Y1=rS;function eC(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._lineWidth=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,tnt(this,e)}function tnt(e,t){t=je(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,e.lineWidth=t.lineWidth;let n={};if(l(t.meta)){let i=t.defines,o=t.meta??V.EMPTY_OBJECT;for(let r in o)o.hasOwnProperty(r)&&(n[r]=new Id(o[r],i))}e._meta=n,e._ready=!0}function Ar(e,t){let n=(e._style??V.EMPTY_OBJECT).defines;if(l(t)){if(typeof t=="boolean"||typeof t=="number")return new Id(String(t));if(typeof t=="string")return new Id(t,n);if(l(t.conditions))return new Y1(t,n)}else return;return t}function gr(e){if(l(e)){if(l(e.expression))return e.expression;if(l(e.conditionsExpression))return je(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(eC.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=Ar(this,e),this._style.show=gr(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=Ar(this,e),this._style.color=gr(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=Ar(this,e),this._style.pointSize=gr(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=Ar(this,e),this._style.pointOutlineColor=gr(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=Ar(this,e),this._style.pointOutlineWidth=gr(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=Ar(this,e),this._style.labelColor=gr(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=Ar(this,e),this._style.labelOutlineColor=gr(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=Ar(this,e),this._style.labelOutlineWidth=gr(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=Ar(this,e),this._style.font=gr(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=Ar(this,e),this._style.labelStyle=gr(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=Ar(this,e),this._style.labelText=gr(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=Ar(this,e),this._style.backgroundColor=gr(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=Ar(this,e),this._style.backgroundPadding=gr(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=Ar(this,e),this._style.backgroundEnabled=gr(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=Ar(this,e),this._style.scaleByDistance=gr(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=Ar(this,e),this._style.translucencyByDistance=gr(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=Ar(this,e),this._style.distanceDisplayCondition=gr(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=Ar(this,e),this._style.heightOffset=gr(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=Ar(this,e),this._style.anchorLineEnabled=gr(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=Ar(this,e),this._style.anchorLineColor=gr(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=Ar(this,e),this._style.image=gr(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=Ar(this,e),this._style.disableDepthTestDistance=gr(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=Ar(this,e),this._style.horizontalOrigin=gr(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=Ar(this,e),this._style.verticalOrigin=gr(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=Ar(this,e),this._style.labelHorizontalOrigin=gr(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=Ar(this,e),this._style.labelVerticalOrigin=gr(this._labelVerticalOrigin)}},lineWidth:{get:function(){return this._lineWidth},set:function(e){this._lineWidth=Ar(this,e),this._style.lineWidth=gr(this._lineWidth)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});eC.fromUrl=function(e){return De.createIfNeeded(e).fetchJson(e).then(function(n){return new eC(n)})};eC.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)};eC.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)};eC.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)};eC.prototype.getVariables=function(){let e=[];return l(this.color)&&l(this.color.getVariables)&&oi(e,this.color.getVariables()),l(this.show)&&l(this.show.getVariables)&&oi(e,this.show.getVariables()),l(this.pointSize)&&l(this.pointSize.getVariables)&&oi(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var Fg=eC;var oAe=new d,rAe=new Lu,aAe=new Zl,sAe=new ks;function nnt(e,t){let n=t.scene.nodes,i={collections:[],collectionLocalMatrices:[]};for(let o=0;o<n.length;o++)cAe(e,n[o],M.IDENTITY,i);return i}function int(e){let t=e.BYTES_PER_ELEMENT*8;return Math.pow(2,t)-1}function ont(e,t){let n=int(e),i=0;for(let o=0;o<=e.length;o++)if(o===e.length||e[o]===n){let r=o-i;r>0&&t(i,r),i=o+1}}function rnt(e){let t={pointPrimitiveCount:0,pointVertexCount:0,polylinePrimitiveCount:0,polylineVertexCount:0,polygonPrimitiveCount:0,polygonVertexCount:0,polygonHoleCount:0,polygonTriangleCount:0},n=e.vector,i=e.primitiveType,r=xt.getAttributeBySemantic(e,at.POSITION).count,a=e.indices?il.readIndicesAsTypedArray(e.indices):void 0;if(i===ve.POINTS)t.pointPrimitiveCount+=n.count,t.pointVertexCount+=n.count;else if(i===ve.LINE_STRIP)t.polylinePrimitiveCount+=n.count,t.polylineVertexCount+=a.length-(n.count-1);else if(i===ve.TRIANGLES){t.polygonPrimitiveCount+=n.count,t.polygonVertexCount+=r,t.polygonTriangleCount+=a.length/3;let s=n.polygonHoleCounts;if(s)for(let c=0;c<s.length;c++)t.polygonHoleCount+=s[c]}else throw new ue(`Unexpected primitive type: ${i}`);return t}function ant(e,t,n){let i=t.vector,o=xt.getAttributeBySemantic(t,at.POSITION),r=o.typedArray??il.readAttributeAsTypedArray(o),a=r.length/3,s=t.indices?il.readIndicesAsTypedArray(t.indices):void 0,c=t.featureIds?.[0],u,f;if(c instanceof Cn.FeatureIdAttribute&&(u=xt.getAttributeBySemantic(t,at.FEATURE_ID,c.setIndex),f=u.typedArray??il.readAttributeAsTypedArray(u)),n instanceof Mg)for(let h=0,p=s?s.length:a;h<p;h++){let A=s?s[h]:h;d.fromArray(r,A*3,oAe),n.add({position:oAe},rAe);let m=Math.trunc(f[A]);m!==c.nullFeatureId&&(rAe.featureId=m)}else if(n instanceof $y)ont(s,(h,p)=>{let A=s[h],m=r.subarray(A*3,(A+p)*3);n.add({positions:m},aAe);let _=Math.trunc(f[A]);_!==c.nullFeatureId&&(aAe.featureId=_)});else if(n instanceof Lg){let h=i.polygonAttributeOffsets,p=i.polygonIndicesOffsets,A=i.polygonHoleCounts,m=i.polygonHoleOffsets,_=h.length;for(let y=0;y<_;y++){let C=h[y],E=y+1<_?h[y+1]:a,b=r.subarray(C*3,E*3),x;if(l(A)&&A[y]>0){let N=A[y];x=m.slice(y,y+N);for(let L=0;L<N;L++)x[y]-=C}let S=p[y],B=y+1<_?p[y+1]:s.length,v=s.slice(S,B);for(let N=0;N<B;N++)v[N]-=C;n.add({positions:b,triangles:v,holes:x},sAe);let P=Math.trunc(f[C]);P!==c.nullFeatureId&&(sAe.featureId=P)}}}function cAe(e,t,n,i){let o=xt.getNodeTransform(t),r=M.multiplyTransformation(n,o,new M),a=t.primitives;for(let c=0;c<a.length;c++){let u=a[c],f=u.primitiveType;if(!u.vector)continue;let h,p=rnt(u);f===ve.POINTS?h=new Mg({primitiveCountMax:p.pointPrimitiveCount}):f===ve.LINE_STRIP?h=new $y({primitiveCountMax:p.polylinePrimitiveCount,vertexCountMax:p.polylineVertexCount}):f===ve.TRIANGLES&&(h=new Lg({primitiveCountMax:p.polygonPrimitiveCount,vertexCountMax:p.polygonVertexCount,holeCountMax:p.polygonHoleCount,triangleCountMax:p.polygonTriangleCount})),i.collections.push(h),i.collectionLocalMatrices.push(M.clone(r)),ant(e,u,h)}let s=t.children;for(let c=0;c<s.length;c++)cAe(e,s[c],r,i)}var q1=nnt;var gX=new Lu,_X=new Zl,yX=new ks,K1=new vg,CX=new Og,lAe=new Ng,uAe=new M,EX=class e{constructor(t,n,i){this._tileset=t,this._tile=n,this._resource=i,this._decodeModel=void 0,this._collections=[],this._collectionLocalMatrices=[],this._metadata=void 0,this._group=void 0,this.featurePropertiesDirty=!1,this._ready=!1,this._modelMatrix=M.clone(M.IDENTITY)}get featuresLength(){return this._collections.reduce((t,n)=>t+n.primitiveCount,0)}get pointsLength(){return this._collections.filter(t=>t instanceof Mg).reduce((t,n)=>t+n.primitiveCount,0)}get trianglesLength(){return this._collections.filter(t=>t instanceof Lg).reduce((t,n)=>t+n.triangleCount,0)}get geometryByteLength(){return this._collections.reduce((t,n)=>t+n.byteLength,0)}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTable(){}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}getFeature(t){}hasProperty(t,n){return!1}applyDebugSettings(t,n){n=t?n:z.WHITE,this.applyStyle(new Fg({color:n}))}applyStyle(t){let n=t.show?.evaluate(null)??!0,i=t.color?.evaluate(null,new z),o=s=>s instanceof Mg,r=s=>s instanceof $y,a=s=>s instanceof Lg;z.clone(i,K1.color),K1.size=t.pointSize?.evaluate(null),K1.outlineWidth=t.pointOutlineWidth?.evaluate(null),t.pointOutlineColor?.evaluate(null,K1.outlineColor);for(let s of this._collections.filter(o))for(let c=0,u=s.primitiveCount;c<u;c++)s.get(c,gX),gX.show=n,gX.setMaterial(K1);z.clone(i,CX.color),CX.width=t.lineWidth?.evaluate(null)??1;for(let s of this._collections.filter(r))for(let c=0,u=s.primitiveCount;c<u;c++)s.get(c,_X),_X.show=n,_X.setMaterial(CX);z.clone(i,lAe.color);for(let s of this._collections.filter(a))for(let c=0,u=s.primitiveCount;c<u;c++)s.get(c,yX),yX.show=n,yX.setMaterial(lAe)}update(t,n){if(l(this._decodeModel)&&!this._ready){let i=this._decodeModel;i.modelMatrix=this._tile.computedTransform,i.update(n),i.ready&&(cnt(this),this._decodeModel&&(this._decodeModel.destroy(),this._decodeModel=void 0),this._ready=!0)}M.multiplyTransformation(this._tile.computedTransform,this._modelMatrix,uAe);for(let i=0;i<this._collections.length;i++)M.multiplyTransformation(uAe,this._collectionLocalMatrices[i],this._collections[i].modelMatrix),this._collections[i].update(n)}pick(t,n,i){}isDestroyed(){return!1}destroy(){return this._decodeModel?.destroy(),this._decodeModel=void 0,this._collections.forEach(t=>t.destroy()),this._collections.length=0,fe(this)}static async fromGltf(t,n,i,o){let r=new e(t,n,i),a=snt(t,n,r,o),s=await xf.fromGltfAsync(a);return s.show=!1,r._decodeModel=s,r}};function snt(e,t,n,i){return{gltf:i,basePath:n._resource,cull:!1,releaseGltfJson:!0,opaquePass:Be.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,content:n,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,projectTo2D:e._projectTo2D,enablePick:e._enablePick,enableDebugWireframe:e._enableDebugWireframe,enableShowOutline:!1}}function cnt(e){let t=e._decodeModel.sceneGraph.components,n=xt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new M);M.multiplyTransformation(t.transform,n,e._modelMatrix);let i=q1(this,t);e._collections=i.collections,e._collectionLocalMatrices=i.collectionLocalMatrices}var aS=EX;function sc(){}sc._maxSortingConcurrency=Math.max(fn.hardwareConcurrency-1,1);sc._sorterTaskProcessor=void 0;sc._taskProcessorReady=!1;sc._error=void 0;sc._getSorterTaskProcessor=function(){if(!l(sc._sorterTaskProcessor)){let e=new Zn("gaussianSplatSorter",sc._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?sc._taskProcessorReady=!0:sc._error=new ue("Gaussian splat sorter could not be initialized.")}).catch(t=>{sc._error=t}),sc._sorterTaskProcessor=e}return sc._sorterTaskProcessor};sc.radixSortIndexes=function(e){let t=sc._getSorterTaskProcessor();if(l(sc._error))throw sc._error;if(sc._taskProcessorReady)return t.scheduleTask(e,[e.primitive.positions.buffer])};var tb=sc;function cc(){}cc._maxSortingConcurrency=Math.max(fn.hardwareConcurrency-1,1);cc._textureTaskProcessor=void 0;cc._taskProcessorReady=!1;cc._error=void 0;cc._getTextureTaskProcessor=function(){if(!l(cc._textureTaskProcessor)){let e=new Zn("gaussianSplatTextureGenerator",cc._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?cc._taskProcessorReady=!0:cc._error=new ue("Gaussian splat sorter could not be initialized.")}).catch(t=>{cc._error=t}),cc._textureTaskProcessor=e}return cc._textureTaskProcessor};cc.generateFromAttributes=function(e){let t=cc._getTextureTaskProcessor();if(l(cc._error))throw cc._error;if(!cc._taskProcessorReady)return;let{attributes:n}=e;return t.scheduleTask(e,[n.positions.buffer,n.scales.buffer,n.rotations.buffer,n.colors.buffer])};var X1=cc;function lnt(e){let t=new LA;this.shaderBuilder=t,this.uniformMap={},this.renderStateOptions=Ve.getState(Ve.fromCache({depthTest:{enabled:!0,func:nc.LESS_OR_EQUAL}})),this.alphaOptions=new F0,this.hasSkipLevelOfDetail=!1,e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,he.FRAGMENT)}var J1=lnt;var Z1=`//
// Vertex shader for Gaussian splats.
// The splats are rendered as quads in view space. Splat attributes are loaded from a texture with precomputed 3D covariance.
// Passes local quad coordinates and color to the fragment shader for Gaussian evaluation.
//
// Discards splats outside the view frustum or with negligible screen size.
//
#if defined(HAS_SPHERICAL_HARMONICS)
const uint coefficientCount[3] = uint[3](3u,8u,15u);
const float SH_C1 = 0.48860251;
const float SH_C2[5] = float[5](
1.092548430,
-1.09254843,
0.315391565,
-1.09254843,
0.546274215
);
const float SH_C3[7] = float[7](
-0.59004358,
2.890611442,
-0.45704579,
0.373176332,
-0.45704579,
1.445305721,
-0.59004358
);
//Retrieve SH coefficient. Currently RG32UI format
uvec2 loadSHCoeff(uint splatID, int index) {
ivec2 shTexSize = textureSize(u_sphericalHarmonicsTexture, 0);
uint dims = coefficientCount[uint(u_sphericalHarmonicsDegree)-1u];
uint splatsPerRow = uint(shTexSize.x) / dims;
uint shIndex = (splatID%splatsPerRow) * dims + uint(index);
ivec2 shPosCoord = ivec2(shIndex, splatID / splatsPerRow);
return texelFetch(u_sphericalHarmonicsTexture, shPosCoord, 0).rg;
}
//Unpack RG32UI half float coefficients to vec3
vec3 halfToVec3(uvec2 packed) {
return vec3(unpackHalf2x16(packed.x), unpackHalf2x16(packed.y).x);
}
vec3 loadAndExpandSHCoeff(uint splatID, int index) {
uvec2 coeff = loadSHCoeff(splatID, index);
return halfToVec3(coeff);
}
vec3 evaluateSH(uint splatID, vec3 viewDir) {
vec3 result = vec3(0.0);
int coeffIndex = 0;
float x = viewDir.x, y = viewDir.y, z = viewDir.z;
if (u_sphericalHarmonicsDegree >= 1.) {
vec3 sh1 = loadAndExpandSHCoeff(splatID, coeffIndex++);
vec3 sh2 = loadAndExpandSHCoeff(splatID, coeffIndex++);
vec3 sh3 = loadAndExpandSHCoeff(splatID, coeffIndex++);
result += -SH_C1 * y * sh1 + SH_C1 * z * sh2 - SH_C1 * x * sh3;
if (u_sphericalHarmonicsDegree >= 2.) {
float xx = x * x;
float yy = y * y;
float zz = z * z;
float xy = x * y;
float yz = y * z;
float xz = x * z;
vec3 sh4 = loadAndExpandSHCoeff(splatID, coeffIndex++);
vec3 sh5 = loadAndExpandSHCoeff(splatID, coeffIndex++);
vec3 sh6 = loadAndExpandSHCoeff(splatID, coeffIndex++);
vec3 sh7 = loadAndExpandSHCoeff(splatID, coeffIndex++);
vec3 sh8 = loadAndExpandSHCoeff(splatID, coeffIndex++);
result += SH_C2[0] * xy * sh4 +
SH_C2[1] * yz * sh5 +
SH_C2[2] * (2.0f * zz - xx - yy) * sh6 +
SH_C2[3] * xz * sh7 +
SH_C2[4] * (xx - yy) * sh8;
if (u_sphericalHarmonicsDegree >= 3.) {
vec3 sh9 = loadAndExpandSHCoeff(splatID, coeffIndex++);
vec3 sh10 = loadAndExpandSHCoeff(splatID, coeffIndex++);
vec3 sh11 = loadAndExpandSHCoeff(splatID, coeffIndex++);
vec3 sh12 = loadAndExpandSHCoeff(splatID, coeffIndex++);
vec3 sh13 = loadAndExpandSHCoeff(splatID, coeffIndex++);
vec3 sh14 = loadAndExpandSHCoeff(splatID, coeffIndex++);
vec3 sh15 = loadAndExpandSHCoeff(splatID, coeffIndex++);
result += SH_C3[0] * y * (3.0f * xx - yy) * sh9 +
SH_C3[1] * xy * z * sh10 +
SH_C3[2] * y * (4.0f * zz - xx - yy) * sh11 +
SH_C3[3] * z * (2.0f * zz - 3.0f * xx - 3.0f * yy) * sh12 +
SH_C3[4] * x * (4.0f * zz - xx - yy) * sh13 +
SH_C3[5] * z * (xx - yy) * sh14 +
SH_C3[6] * x * (xx - 3.0f * yy) * sh15;
}
}
}
return result;
}
#endif
// Transforms and projects splat covariance into screen space and extracts the major and minor axes of the Gaussian ellipsoid
// which is used to calculate the vertex position in clip space.
vec4 calcCovVectors(vec3 viewPos, mat3 Vrk) {
vec4 t = vec4(viewPos, 1.0);
vec2 focal = vec2(czm_projection[0][0] * czm_viewport.z, czm_projection[1][1] * czm_viewport.w);
vec2 J1 = focal / t.z;
vec2 J2 = -focal * vec2(t.x, t.y) / (t.z * t.z);
mat3 J = mat3(
J1.x, 0.0, J2.x,
0.0, J1.y, J2.y,
0.0, 0.0, 0.0
);
mat3 R = mat3(czm_modelView);
//transform our covariance into view space
//ensures orientation is correct
mat3 Vrk_view = R * Vrk * transpose(R);
mat3 cov = transpose(J) * Vrk_view * J;
float diagonal1 = cov[0][0] + .3;
float offDiagonal = cov[0][1];
float diagonal2 = cov[1][1] + .3;
float mid = 0.5 * (diagonal1 + diagonal2);
float radius = length(vec2((diagonal1 - diagonal2) * 0.5, offDiagonal));
float lambda1 = mid + radius;
float lambda2 = max(mid - radius, 0.1);
vec2 diagonalVector = normalize(vec2(offDiagonal, lambda1 - diagonal1));
return vec4(
min(sqrt(2.0 * lambda1), 1024.0) * diagonalVector,
min(sqrt(2.0 * lambda2), 1024.0) * vec2(diagonalVector.y, -diagonalVector.x)
);
}
highp vec4 discardVec = vec4(0.0, 0.0, 2.0, 1.0);
void main() {
uint texIdx = uint(a_splatIndex);
// u_splatRowMask and u_splatRowShift encode the row width of the splat
// attribute texture. The texture width is always maximumTextureSize, which
// varies by GPU, so these are passed as uniforms rather than constants.
// rowMask = maximumTextureSize/2 - 1
// rowShift = log2(maximumTextureSize/2)
uint rowMask = uint(u_splatRowMask);
uint rowShift = uint(u_splatRowShift);
ivec2 posCoord = ivec2(int((texIdx & rowMask) << 1), int(texIdx >> rowShift));
vec4 splatPosition = vec4( uintBitsToFloat(uvec4(texelFetch(u_splatAttributeTexture, posCoord, 0))) );
vec4 splatViewPos = czm_modelView * vec4(splatPosition.xyz, 1.0);
vec4 clipPosition = czm_projection * splatViewPos;
float clip = 1.2 * clipPosition.w;
if (clipPosition.z < -clip || clipPosition.x < -clip || clipPosition.x > clip ||
clipPosition.y < -clip || clipPosition.y > clip) {
gl_Position = vec4(0.0, 0.0, 2.0, 1.0);
return;
}
ivec2 covCoord = ivec2(int(((texIdx & rowMask) << 1) | 1u), int(texIdx >> rowShift));
uvec4 covariance = uvec4(texelFetch(u_splatAttributeTexture, covCoord, 0));
gl_Position = clipPosition;
vec2 u1 = unpackHalf2x16(covariance.x) ;
vec2 u2 = unpackHalf2x16(covariance.y);
vec2 u3 = unpackHalf2x16(covariance.z);
mat3 Vrk = mat3(u1.x, u1.y, u2.x, u1.y, u2.y, u3.x, u2.x, u3.x, u3.y);
vec4 covVectors = calcCovVectors(splatViewPos.xyz, Vrk);
if (dot(covVectors.xy, covVectors.xy) < 4.0 && dot(covVectors.zw, covVectors.zw) < 4.0) {
gl_Position = discardVec;
return;
}
vec2 corner = vec2((gl_VertexID << 1) & 2, gl_VertexID & 2) - 1.;
gl_Position += vec4((corner.x * covVectors.xy + corner.y * covVectors.zw) / czm_viewport.zw * gl_Position.w, 0, 0);
gl_Position.z = clamp(gl_Position.z, -abs(gl_Position.w), abs(gl_Position.w));
v_vertPos = corner ;
v_splatColor = vec4(covariance.w & 0xffu, (covariance.w >> 8) & 0xffu, (covariance.w >> 16) & 0xffu, (covariance.w >> 24) & 0xffu) / 255.0;
#if defined(HAS_SPHERICAL_HARMONICS)
vec4 splatWC = czm_inverseView * splatViewPos;
vec3 viewDirModel = normalize(u_inverseModelRotation * (splatWC.xyz - u_cameraPositionWC.xyz));
v_splatColor.rgb += evaluateSH(texIdx, viewDirModel).rgb;
#endif
v_splitDirection = u_splitDirection;
}`;var $1=`//
// Fragment shader for Gaussian splats.
// Renders a Gaussian splat within a quad, discarding fragments outside the unit circle.
// Applies an approximate Gaussian falloff based on distance from the center and outputs
// a color modulated by the alpha and Gaussian weight.
//
void main() {
if (v_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;
if (v_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;
float A = -dot(v_vertPos, v_vertPos);
if (A < -4.) {
discard;
}
float B = exp(A * 4.) * v_splatColor.a ;
out_FragColor = vec4(v_splatColor.rgb * B , B);
}
`;var nb=new M,AAe=new M,eF=new M,_i=new J,tF=new Qe,unt=new d,fnt=new Qe,dnt=new d,hnt=1e-12,k8=1e-5,bX=1e-7,Us={IDLE:0,WAITING:1,SORTING:2,SORTED:3,ERROR:4},Ga={BUILDING:"BUILDING",TEXTURE_PENDING:"TEXTURE_PENDING",TEXTURE_READY:"TEXTURE_READY",SORTING:"SORTING",READY:"READY"},mnt=2,pnt=30,Ant=3,gnt=.008726646259971648,_nt=1;function ynt(e,t){let n=e._lastSteadySortFrameNumber>=0?t.frameNumber-e._lastSteadySortFrameNumber:Number.POSITIVE_INFINITY;if(e._lastSteadySortFrameNumber>=0&&n<Ant)return!1;let i=t.camera;return l(i)?!e._hasLastSteadySortCameraPosition||!e._hasLastSteadySortCameraDirection||d.distance(i.positionWC,e._lastSteadySortCameraPosition)>=_nt?!0:d.angleBetween(i.directionWC,e._lastSteadySortCameraDirection)>=gnt:!1}function fAe(e,t){e._lastSteadySortFrameNumber=t.frameNumber;let n=t.camera;l(n)&&(d.clone(n.positionWC,e._lastSteadySortCameraPosition),e._hasLastSteadySortCameraPosition=!0,d.clone(n.directionWC,e._lastSteadySortCameraDirection),e._hasLastSteadySortCameraDirection=!0)}function Cnt(e,t){let n=e._selectedTileSet;if(!l(n)||n.size!==t.length)return!0;for(let i=0;i<t.length;i++)if(!n.has(t[i]))return!0;return!1}function dAe(e,t){return l(t)&&t.requestId===e._sortRequestId&&t.dataGeneration===e._splatDataGeneration}function IX(e){l(e)&&(l(e.gaussianSplatTexture)&&(e.gaussianSplatTexture.destroy(),e.gaussianSplatTexture=void 0),l(e.sphericalHarmonicsTexture)&&(e.sphericalHarmonicsTexture.destroy(),e.sphericalHarmonicsTexture=void 0))}function hAe(e,t,n){if(!l(t))return;e._retiredTextures.push({texture:t,frameNumber:n})}function Ent(e,t){let n=e._retiredTextures;if(!l(n)||n.length===0)return;let i=[];for(let o=0;o<n.length;o++){let r=n[o];t-r.frameNumber>0?r.texture.destroy():i.push(r)}e._retiredTextures=i}function bnt(e,t){let n=e?.[t];return l(n)?n.buffer:void 0}function Int(e,t,n,i){let o=e._aggregateScratchBuffers[t];l(o)||(o=[],e._aggregateScratchBuffers[t]=o);let r=bnt(e._snapshot,t);for(let s=0;s<o.length;s++){let c=o[s];if(c.length>=i&&c.buffer!==r)return c}let a=j.createTypedArray(n,i);return o.push(a),a}function xnt(e,t){return e.length===t?e:e.subarray(0,t)}function Tnt(e,t,n){if(!l(t.indexes)||t.state!==Ga.READY)throw new de("Committing snapshot before it is READY.");let i=n.frameNumber,o=e._snapshot,r=l(o)?o.gaussianSplatTexture:e.gaussianSplatTexture;l(r)&&r!==t.gaussianSplatTexture&&hAe(e,r,i);let a=l(o)?o.sphericalHarmonicsTexture:e.sphericalHarmonicsTexture;l(a)&&a!==t.sphericalHarmonicsTexture&&hAe(e,a,i),e._snapshot=t,e._positions=t.positions,e._rotations=t.rotations,e._scales=t.scales,e._colors=t.colors,e._shData=t.shData,e._sphericalHarmonicsDegree=t.sphericalHarmonicsDegree,e._numSplats=t.numSplats,e._indexes=t.indexes,e.gaussianSplatTexture=t.gaussianSplatTexture,e.sphericalHarmonicsTexture=t.sphericalHarmonicsTexture,e._lastTextureWidth=t.lastTextureWidth,e._lastTextureHeight=t.lastTextureHeight,e._splatRowMask=t.splatRowMask,e._splatRowShift=t.splatRowShift,e._splatBudgetSSEScale=t.splatBudgetSSEScale??1,e._hasGaussianSplatTexture=l(t.gaussianSplatTexture),e._needsGaussianSplatTexture=!1,e._gaussianSplatTexturePending=!1,e._vertexArray=void 0,e._vertexArrayLen=-1,e._drawCommand=void 0,e._sorterPromise=void 0,e._activeSort=void 0,e._sorterState=Us.IDLE,e._dirty=!1}async function Snt(e,t,n,i){try{let o=await i,r=Rt.maximumTextureSize,a=r,s=Math.ceil(n.numSplats/(r/2)),c=Math.log2(r/2),u=r/2-1;if(s>r){let A=n.numSplats;s=r;let m=a/2;if(n.numSplats=r*m,n.positions=n.positions.subarray(0,n.numSplats*3),n.rotations=n.rotations.subarray(0,n.numSplats*4),n.scales=n.scales.subarray(0,n.numSplats*3),n.colors=n.colors.subarray(0,n.numSplats*4),l(n.shData)){let _=n.shData.length/A;n.shData=n.shData.subarray(0,Math.floor(n.numSplats*_))}n.splatBudgetSSEScale=A/n.numSplats,console.warn(`[GaussianSplat][HARD CAP] ${A} splats exceed the maximum texture capacity (${r}\xD7${m} = ${n.numSplats} splats at width=${a}). Rendering only the first ${n.numSplats} splats to avoid a WebGL crash. Increasing maximumScreenSpaceError by ${n.splatBudgetSSEScale.toFixed(2)}x next frame.`)}else n.splatBudgetSSEScale=1;let f=a*s*4,h;f<=o.data.length?h=o.data.subarray(0,f):(h=new Uint32Array(f),h.set(o.data));let p={width:a,height:s,data:h};if(n.splatRowMask=u,n.splatRowShift=c,e._pendingSnapshot!==n){n.state=Ga.BUILDING;return}if(!l(n.gaussianSplatTexture))n.gaussianSplatTexture=pAe(t.context,p);else if(n.lastTextureHeight!==p.height||n.lastTextureWidth!==p.width){let A=n.gaussianSplatTexture;n.gaussianSplatTexture=pAe(t.context,p),A.destroy()}else n.gaussianSplatTexture.copyFrom({source:{width:p.width,height:p.height,arrayBufferView:p.data}});if(n.lastTextureHeight=p.height,n.lastTextureWidth=p.width,l(n.shData)&&n.sphericalHarmonicsDegree>0){let A=n.sphericalHarmonicsTexture,m=Rt.maximumTextureSize,_=n.shCoefficientCount/3,y=Math.floor(m/_),C=y*(_*2),E=Math.ceil(n.numSplats/y);if(E>m)console.warn(`[GaussianSplat][SHTexture] ${n.numSplats} splats require SH height ${E} > maxTex ${m}. Disabling spherical harmonics for this snapshot (color-only fallback).`),n.sphericalHarmonicsDegree=0,l(A)&&A.destroy(),n.sphericalHarmonicsTexture=void 0;else{let b=new Uint32Array(m*E*2),x=0;for(let S=0;x<n.shData.length;S+=m*2)b.set(n.shData.subarray(x,x+C),S),x+=C;n.sphericalHarmonicsTexture=Bnt(t.context,{data:b,width:m,height:E}),l(A)&&A.destroy()}}n.state=Ga.TEXTURE_READY}catch(o){console.error("Error generating Gaussian splat texture:",o),n.state=Ga.BUILDING}}async function wnt(e,t,n,i){try{let o=await i;if(!l(n)||n.snapshot!==e._pendingSnapshot)return;let r=n.expectedCount,a=r,s=o?.length;if(r!==a||s!==r){e._pendingSortPromise=void 0,e._pendingSort=void 0,n.snapshot.state===Ga.SORTING&&(n.snapshot.state=Ga.TEXTURE_READY);return}let c=n.snapshot;c.indexes=o,c.state=Ga.READY,e._pendingSortPromise=void 0,e._pendingSort=void 0,Tnt(e,c,t),e._pendingSnapshot=void 0,$l.buildGSplatDrawCommand(e,t)}catch(o){if(!l(n)||n.snapshot!==e._pendingSnapshot)return;e._pendingSortPromise=void 0,e._pendingSort=void 0,n.snapshot.state===Ga.SORTING&&(n.snapshot.state=Ga.TEXTURE_READY),e._sorterState=Us.ERROR,e._sorterError=o}}async function mAe(e,t,n){try{let i=await n,o=dAe(e,t),r=t?.expectedCount,a=r,s=i?.length;if(!o||(r!==a||s!==r)){o&&(e._sorterPromise=void 0,e._sorterState=Us.IDLE);return}e._indexes=i,e._sorterState=Us.SORTED}catch(i){if(!dAe(e,t))return;e._sorterState=Us.ERROR,e._sorterError=i}}function Bnt(e,t){return new Dt({context:e,source:{width:t.width,height:t.height,arrayBufferView:t.data},preMultiplyAlpha:!1,skipColorSpaceConversion:!0,pixelFormat:qe.RG_INTEGER,pixelDatatype:He.UNSIGNED_INT,flipY:!1,sampler:jt.NEAREST})}function pAe(e,t){return new Dt({context:e,source:{width:t.width,height:t.height,arrayBufferView:t.data},preMultiplyAlpha:!1,skipColorSpaceConversion:!0,pixelFormat:qe.RGBA_INTEGER,pixelDatatype:He.UNSIGNED_INT,flipY:!1,sampler:jt.NEAREST})}function $l(e){e=e??V.EMPTY_OBJECT,this._positions=void 0,this._rotations=void 0,this._scales=void 0,this._colors=void 0,this._indexes=void 0,this._numSplats=0,this._needsGaussianSplatTexture=!0,this._snapshot=void 0,this._pendingSnapshot=void 0,this._retiredTextures=[],this._aggregateScratchBuffers={positions:[],scales:[],rotations:[],colors:[]},this._scratchAggregateShBuffer=void 0,this._selectedTilesStableFrames=0,this._needsSnapshotRebuild=!1,this._snapshotRebuildStallFrames=0,this._prevViewMatrix=new M,this._debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.gaussianSplatTexture=void 0,this.sphericalHarmonicsTexture=void 0,this._lastTextureWidth=0,this._lastTextureHeight=0,this._vertexArray=void 0,this._vertexArrayLen=-1,this._splitDirection=Lr.NONE,this._dirty=!1,this._tileset=e.tileset,this._baseTilesetUpdate=this._tileset.update,this._tileset.update=this._wrappedUpdate.bind(this),this._tileset.tileLoad.addEventListener(this.onTileLoad,this),this._tileset.tileVisible.addEventListener(this.onTileVisible,this),this.selectedTileLength=0,this._selectedTileSet=new Set,this._ready=!1,this._hasGaussianSplatTexture=!1,this._gaussianSplatTexturePending=!1,this._drawCommand=void 0,this._drawCommandModelMatrix=new M,this._rootTransform=void 0,this._axisCorrectionMatrix=xt.getAxisCorrectionMatrix(ao.Y,ao.X,new M),this._shInverseRotation=new J,this._isDestroyed=!1,this._sorterState=Us.IDLE,this._sorterPromise=void 0,this._splatDataGeneration=0,this._sortRequestId=0,this._activeSort=void 0,this._pendingSortPromise=void 0,this._pendingSort=void 0,this._lastSteadySortFrameNumber=-1,this._lastSteadySortCameraPosition=new d,this._hasLastSteadySortCameraPosition=!1,this._lastSteadySortCameraDirection=new d,this._hasLastSteadySortCameraDirection=!1,this._sorterError=void 0,this._splatRowMask=0,this._splatRowShift=0,this._splatBudgetSSEScale=1}Object.defineProperties($l.prototype,{ready:{get:function(){return this._ready}},isStable:{get:function(){return!this._dirty&&(!l(this._pendingSnapshot)||this._pendingSnapshot.state===Ga.READY)}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,this._dirty=!0)}}});$l.prototype._wrappedUpdate=function(e){let t=this._tileset;if(this._splatBudgetSSEScale!==1){let n=t.maximumScreenSpaceError;t.maximumScreenSpaceError*=this._splatBudgetSSEScale,this._baseTilesetUpdate.call(t,e),t.maximumScreenSpaceError=n}else this._baseTilesetUpdate.call(t,e);this.update(e)};$l.prototype.destroy=function(){if(this._positions=void 0,this._rotations=void 0,this._scales=void 0,this._colors=void 0,this._indexes=void 0,IX(this._pendingSnapshot),IX(this._snapshot),l(this._retiredTextures))for(let t=0;t<this._retiredTextures.length;t++)this._retiredTextures[t].texture.destroy();this._retiredTextures=[],this._pendingSnapshot=void 0,this._snapshot=void 0,this._aggregateScratchBuffers=void 0,this.gaussianSplatTexture=void 0,this.sphericalHarmonicsTexture=void 0;let e=this._drawCommand;return l(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),l(this._vertexArray)&&(this._vertexArray.destroy(),this._vertexArray=void 0),this._tileset.update=this._baseTilesetUpdate.bind(this._tileset),fe(this)};$l.prototype.isDestroyed=function(){return this._isDestroyed};$l.prototype.onTileLoad=function(e){this._dirty=!0};$l.prototype.onTileVisible=function(e){};$l.transformTile=function(e){let t=e.computedTransform,n=e.content.gltfPrimitive,i=e.tileset.gaussianSplatPrimitive;i._rootTransform===void 0&&(i._rootTransform=At.eastNorthUpToFixedFrame(e.tileset.boundingSphere.center));let o=i._rootTransform,r=M.multiplyTransformation(t,i._axisCorrectionMatrix,nb);M.multiplyTransformation(r,e.content.worldTransform,r);let a=M.inverse(o,AAe),s=M.multiplyTransformation(a,r,nb),c=e.content._lastSplatTransform;if(e.content._transformed&&l(c)&&M.equalsEpsilon(s,c,hnt))return;let u=e.content.positions,f=e.content.rotations,h=e.content.scales,p=Math.sqrt(s[0]*s[0]+s[1]*s[1]+s[2]*s[2]),A=Math.sqrt(s[4]*s[4]+s[5]*s[5]+s[6]*s[6]),m=Math.sqrt(s[8]*s[8]+s[9]*s[9]+s[10]*s[10]);_i[0]=s[0]/p,_i[1]=s[1]/p,_i[2]=s[2]/p,_i[3]=s[4]/A,_i[4]=s[5]/A,_i[5]=s[6]/A,_i[6]=s[8]/m,_i[7]=s[9]/m,_i[8]=s[10]/m;let _=_i[0]*_i[3]+_i[1]*_i[4]+_i[2]*_i[5],y=_i[0]*_i[6]+_i[1]*_i[7]+_i[2]*_i[8],C=_i[3]*_i[6]+_i[4]*_i[7]+_i[5]*_i[8],E=Math.abs(p-1)<=bX&&Math.abs(A-1)<=bX&&Math.abs(m-1)<=bX,b=Math.abs(_)<=k8&&Math.abs(y)<=k8&&Math.abs(C)<=k8,x=_i[0]*(_i[4]*_i[8]-_i[5]*_i[7])-_i[3]*(_i[1]*_i[8]-_i[2]*_i[7])+_i[6]*(_i[1]*_i[5]-_i[2]*_i[4]),S=E&&b&&Math.abs(x-1)<=k8;Qe.fromRotationMatrix(_i,tF),Qe.normalize(tF,tF);let B=xt.getAttributeBySemantic(n,at.POSITION).typedArray,v=xt.getAttributeBySemantic(n,at.ROTATION).typedArray,P=xt.getAttributeBySemantic(n,at.SCALE).typedArray,N=unt,L=fnt,g=dnt;for(let I=0;I<B.length/3;++I)N.x=B[I*3],N.y=B[I*3+1],N.z=B[I*3+2],L.x=v[I*4],L.y=v[I*4+1],L.z=v[I*4+2],L.w=v[I*4+3],g.x=P[I*3],g.y=P[I*3+1],g.z=P[I*3+2],S?(M.multiplyByPoint(s,N,N),Qe.multiply(tF,L,L),Qe.normalize(L,L)):(M.fromTranslationQuaternionRotationScale(N,L,g,eF),M.multiplyTransformation(s,eF,eF),M.getTranslation(eF,N),M.getScale(eF,g),Qe.multiply(tF,L,L),Qe.normalize(L,L)),u[I*3]=N.x,u[I*3+1]=N.y,u[I*3+2]=N.z,f[I*4]=L.x,f[I*4+1]=L.y,f[I*4+2]=L.z,f[I*4+3]=L.w,h[I*3]=g.x,h[I*3+1]=g.y,h[I*3+2]=g.z;e.content._lastSplatTransform=M.clone(s,e.content._lastSplatTransform),e.content._transformed=!0};$l.generateSplatTexture=function(e,t,n){if(!l(n)||n.state!==Ga.BUILDING)return;n.state=Ga.TEXTURE_PENDING;let i=X1.generateFromAttributes({attributes:{positions:new Float32Array(n.positions),scales:new Float32Array(n.scales),rotations:new Float32Array(n.rotations),colors:new Uint8Array(n.colors)},count:n.numSplats});if(!l(i)){n.state=Ga.BUILDING;return}Snt(e,t,n,i)};$l.buildGSplatDrawCommand=function(e,t){let n=e._tileset,i=new J1(e),{shaderBuilder:o}=i,r=i.renderStateOptions;r.cull.enabled=!1,r.depthMask=!1,r.depthTest.enabled=!0,r.blending=sn.PRE_MULTIPLIED_ALPHA_BLEND,i.alphaOptions.pass=Be.GAUSSIAN_SPLATS,o.addAttribute("vec2","a_screenQuadPosition"),o.addAttribute("float","a_splatIndex"),o.addVarying("vec4","v_splatColor"),o.addVarying("vec2","v_vertPos"),o.addUniform("float","u_splitDirection",he.VERTEX),o.addVarying("float","v_splitDirection"),o.addUniform("highp usampler2D","u_splatAttributeTexture",he.VERTEX),o.addUniform("float","u_sphericalHarmonicsDegree",he.VERTEX),o.addUniform("float","u_splatScale",he.VERTEX),o.addUniform("vec3","u_cameraPositionWC",he.VERTEX),o.addUniform("mat3","u_inverseModelRotation",he.VERTEX);let a=i.uniformMap;o.addUniform("int","u_splatRowMask",he.VERTEX),o.addUniform("int","u_splatRowShift",he.VERTEX);let s=e.gaussianSplatTexture;a.u_splatAttributeTexture=function(){return s},a.u_splatRowMask=function(){return e._splatRowMask},a.u_splatRowShift=function(){return e._splatRowShift},e._sphericalHarmonicsDegree>0&&(o.addDefine("HAS_SPHERICAL_HARMONICS","1",he.VERTEX),o.addUniform("highp usampler2D","u_sphericalHarmonicsTexture",he.VERTEX),a.u_sphericalHarmonicsTexture=function(){return e.sphericalHarmonicsTexture}),a.u_sphericalHarmonicsDegree=function(){return e._sphericalHarmonicsDegree},a.u_cameraPositionWC=function(){return d.clone(t.camera.positionWC)},a.u_inverseModelRotation=function(){return e._shInverseRotation},a.u_splitDirection=function(){return e.splitDirection};let c=l(e._indexes)?e._indexes.length:e._numSplats;i.instanceCount=c,i.count=4,i.primitiveType=ve.TRIANGLE_STRIP,o.addVertexLines(Z1),o.addFragmentLines($1);let u=o.buildShaderProgram(t.context),f=je(Ve.fromCache(i.renderStateOptions),!0);f.cull.face=xt.getCullFace(n.modelMatrix,ve.TRIANGLE_STRIP),f=Ve.fromCache(f);let h={screenQuadPosition:0,splatIndex:2},p=new Cn.Attribute;if(p.name="_SPLAT_INDEXES",p.typedArray=e._indexes,p.componentDatatype=j.UNSIGNED_INT,p.type=Ut.SCALAR,p.normalized=!1,p.count=i.instanceCount,p.constant=0,p.instanceDivisor=1,!l(e._vertexArray)||e._indexes.length>e._vertexArrayLen){let C=new yt({attributes:{screenQuadPosition:new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1],name:"_SCREEN_QUAD_POS",variableName:"screenQuadPosition"}),splatIndex:{...p,variableName:"splatIndex"}},primitiveType:ve.TRIANGLE_STRIP});e._vertexArray=Gn.fromGeometry({context:t.context,geometry:C,attributeLocations:h,bufferUsage:Re.DYNAMIC_DRAW,interleave:!1})}else e._vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(e._indexes);e._vertexArrayLen=e._indexes.length;let m=M.clone(e._rootTransform,e._drawCommandModelMatrix),_=e._vertexArray,y=new nt({boundingVolume:n.boundingSphere,modelMatrix:m,uniformMap:a,renderState:f,vertexArray:_,shaderProgram:u,cull:r.cull.enabled,pass:Be.GAUSSIAN_SPLATS,count:i.count,owner:e,instanceCount:i.instanceCount,primitiveType:ve.TRIANGLE_STRIP,debugShowBoundingVolume:n.debugShowBoundingVolume,castShadows:!1,receiveShadows:!1});e._drawCommand=y};$l.prototype.update=function(e){let t=this._tileset;if(Ent(this,e.frameNumber),!t.show)return;if(this._drawCommand&&e.commandList.push(this._drawCommand),t._modelMatrixChanged){this._dirty=!0;return}let n=l(this._rootTransform);if(e.passes.pick===!0)return;this.splitDirection!==t.splitDirection&&(this.splitDirection=t.splitDirection);let i=e.camera;if(l(i)){if(this._sorterState===Us.IDLE){let o=t._selectedTiles.length!==0&&Cnt(this,t._selectedTiles);t._selectedTiles.length===0?(this._selectedTilesStableFrames=0,this._needsSnapshotRebuild=!1,this._snapshotRebuildStallFrames=0):o?this._selectedTilesStableFrames=0:this._selectedTilesStableFrames++,(o||this._dirty)&&(this._needsSnapshotRebuild=!0);let r=this._selectedTilesStableFrames>=mnt,a=!l(this._snapshot)&&!l(this._pendingSnapshot)&&!l(this._drawCommand);this._needsSnapshotRebuild&&t._selectedTiles.length!==0?this._snapshotRebuildStallFrames++:this._snapshotRebuildStallFrames=0;let s=r||a||this._snapshotRebuildStallFrames>=pnt;if(!(this._dirty||this._needsSnapshotRebuild||o||l(this._pendingSnapshot)||l(this._pendingSortPromise)||!l(this._drawCommand))&&M.equals(i.viewMatrix,this._prevViewMatrix))return;if(t._selectedTiles.length!==0&&this._needsSnapshotRebuild&&s){this._splatDataGeneration++,this._activeSort=void 0,this._sorterPromise=void 0,this._sorterState=Us.IDLE,this._pendingSortPromise=void 0,this._pendingSort=void 0,l(this._pendingSnapshot)&&IX(this._pendingSnapshot);let u=t._selectedTiles;this._rootTransform=At.eastNorthUpToFixedFrame(t.boundingSphere.center);{let x=u[0],S=M.multiplyTransformation(x.computedTransform,this._axisCorrectionMatrix,AAe);M.multiplyTransformation(S,x.content.worldTransform??M.IDENTITY,S),M.getRotation(M.inverse(S,S),this._shInverseRotation)}for(let x of u)$l.transformTile(x);let f=u.reduce((x,S)=>x+S.content.pointsLength,0),h=(x,S,B,v)=>{let P,N=0,L=0;for(let g of u){let I=B(g.content),T=l(v)?v:Ut.getNumberOfComponents(I.type),w=l(I.typedArray)?I.typedArray:I;L+=w.length,l(P)||(P=Int(this,x,S,f*T))}if(!l(P))return j.createTypedArray(S,0);for(let g of u){let I=g.content,T=B(I),w=l(T.typedArray)?T.typedArray:T;P.set(w,N),N+=w.length}return xnt(P,L)},p=()=>{let x=0;for(let P of u)if(P.content.sphericalHarmonicsDegree>0){switch(P.content.sphericalHarmonicsDegree){case 1:x=9;break;case 2:x=24;break;case 3:x=45;break}break}if(x===0)return;let S=f*(x*(2/3));(!l(this._scratchAggregateShBuffer)||this._scratchAggregateShBuffer.length<S)&&(this._scratchAggregateShBuffer=new Uint32Array(S));let B=this._scratchAggregateShBuffer,v=0;for(let P of u){let N=P.content.packedSphericalHarmonicsData;P.content.sphericalHarmonicsDegree>0&&(B.set(N,v),v+=N.length)}return v<B.length?B.subarray(0,v):B},A=h("positions",j.FLOAT,x=>x.positions,3),m=h("scales",j.FLOAT,x=>x.scales,3),_=h("rotations",j.FLOAT,x=>x.rotations,4),y=h("colors",j.UNSIGNED_BYTE,x=>xt.getAttributeBySemantic(x.gltfPrimitive,at.COLOR)),C=u[0].content.sphericalHarmonicsDegree,E=C>0?u[0].content.sphericalHarmonicsCoefficientCount:0,b=p();this._pendingSnapshot={generation:this._splatDataGeneration,positions:A,rotations:_,scales:m,colors:y,shData:b,sphericalHarmonicsDegree:C,shCoefficientCount:E,numSplats:f,indexes:void 0,gaussianSplatTexture:void 0,sphericalHarmonicsTexture:void 0,lastTextureWidth:0,lastTextureHeight:0,splatRowMask:0,splatRowShift:0,state:Ga.BUILDING},this.selectedTileLength=t._selectedTiles.length,this._selectedTileSet=new Set(t._selectedTiles),this._dirty=!1,this._needsSnapshotRebuild=!1,this._snapshotRebuildStallFrames=0}if(l(this._pendingSnapshot)){let u=this._pendingSnapshot;if(u.state===Ga.BUILDING){$l.generateSplatTexture(this,e,u);return}if(u.state===Ga.TEXTURE_PENDING||u.state===Ga.TEXTURE_READY&&!l(u.gaussianSplatTexture)||!n)return;if(M.clone(i.viewMatrix,this._prevViewMatrix),M.multiply(i.viewMatrix,this._rootTransform,nb),u.state===Ga.TEXTURE_READY&&!l(this._pendingSortPromise)){let f=++this._sortRequestId,h=this._splatDataGeneration;this._pendingSort={requestId:f,dataGeneration:h,expectedCount:u.numSplats,snapshot:u};let p=tb.radixSortIndexes({primitive:{positions:new Float32Array(u.positions),modelView:Float32Array.from(nb),count:u.numSplats},sortType:"Index"});if(!l(p)){this._pendingSortPromise=void 0,this._pendingSort=void 0,u.state=Ga.TEXTURE_READY;return}this._pendingSortPromise=p,u.state=Ga.SORTING;let A=this._pendingSort;wnt(this,e,A,p);return}if(!l(this._pendingSortPromise)){u.state===Ga.SORTING&&(u.state=Ga.TEXTURE_READY);return}return}if(this._numSplats===0||!n)return;if(M.clone(i.viewMatrix,this._prevViewMatrix),M.multiply(i.viewMatrix,this._rootTransform,nb),!l(this._sorterPromise)){if(!ynt(this,e))return;let u=++this._sortRequestId,f=this._splatDataGeneration,h=this._numSplats;this._activeSort={requestId:u,dataGeneration:f,expectedCount:h};let p=tb.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(nb),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=p,l(p)){fAe(this,e);let A=this._activeSort;this._sorterState=Us.SORTING,mAe(this,A,p);return}}if(!l(this._sorterPromise)){this._sorterState=Us.WAITING;return}this._sorterState=Us.SORTING;return}else if(this._sorterState===Us.WAITING){if(!l(this._sorterPromise)){let o=++this._sortRequestId,r=this._splatDataGeneration,a=this._numSplats;this._activeSort={requestId:o,dataGeneration:r,expectedCount:a};let s=tb.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(nb),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=s,l(s)){fAe(this,e);let c=this._activeSort;this._sorterState=Us.SORTING,mAe(this,c,s);return}}if(!l(this._sorterPromise)){this._sorterState=Us.WAITING;return}this._sorterState=Us.SORTING;return}else{if(this._sorterState===Us.SORTING)return;if(this._sorterState===Us.SORTED)$l.buildGSplatDrawCommand(this,e),this._sorterState=Us.IDLE,this._dirty=!1,this._sorterPromise=void 0,this._activeSort=void 0;else if(this._sorterState===Us.ERROR)throw this._sorterError}this._dirty=!1}};var nF=$l;function Bf(e,t,n,i){this._tileset=t,this._tile=n,this._resource=i,this._loader=e,l(this._tileset.gaussianSplatPrimitive)||(this._tileset.gaussianSplatPrimitive=new nF({tileset:this._tileset})),this._positions=void 0,this._rotations=void 0,this._scales=void 0,this.gltfPrimitive=void 0,this.worldTransform=void 0,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1,this._transformed=!1,this._sphericalHarmonicsDegree=0,this._sphericalHarmonicsCoefficientCount=0,this._packedSphericalHarmonicsData=void 0,this._lastSplatTransform=void 0}Bf.tilesetRequiresGaussianSplattingExt=function(e){let t=!1;return e.isGltfExtensionRequired instanceof Function&&(t=e.isGltfExtensionRequired("KHR_gaussian_splatting")&&e.isGltfExtensionRequired("KHR_gaussian_splatting_compression_spz_2"),e.isGltfExtensionRequired("KHR_spz_gaussian_splats_compression")&&Ms("KHR_spz_gaussian_splats_compression",`Support for the original KHR_spz_gaussian_splats_compression extension has been removed in favor of the up to date KHR_gaussian_splatting and KHR_gaussian_splatting_compression_spz_2 extensions
Please retile your tileset with the KHR_gaussian_splatting and KHR_gaussian_splatting_compression_spz_2 extensions.`)),t};Object.defineProperties(Bf.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return this.gltfPrimitive.attributes[0].count}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){let e=this._tileset?.gaussianSplatPrimitive;if(!l(e))return 0;let t=e.gaussianSplatTexture,n=e.selectedTileLength;return!l(t)||n===0?0:t.sizeInBytes/n}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},transformed:{get:function(){return this._transformed}},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}},positions:{get:function(){return this._positions}},rotations:{get:function(){return this._rotations}},scales:{get:function(){return this._scales}},sphericalHarmonicsCoefficientCount:{get:function(){return this._sphericalHarmonicsCoefficientCount}},sphericalHarmonicsDegree:{get:function(){return this._sphericalHarmonicsDegree}},packedSphericalHarmonicsData:{get:function(){return this._packedSphericalHarmonicsData}}});function Dnt(e){return`${e.startsWith("KHR_gaussian_splatting:")?"KHR_gaussian_splatting:":"_"}SH_DEGREE_`}function vnt(e){switch(e.filter(n=>n.name.includes("SH_DEGREE_")).length){default:case 0:return{l:0,n:0};case 3:return{l:1,n:9};case 8:return{l:2,n:24};case 15:return{l:3,n:45}}}var gAe=new ArrayBuffer(4),Pnt=new Float32Array(gAe),Rnt=new Uint32Array(gAe);function xX(e){Pnt[0]=e;let t=Rnt[0],n=t>>31&1,i=t>>23&255,o=t&8388607,r;if(i===255)r=n<<15|31744|(o?512:0);else if(i===0)r=n<<15;else{let a=i-127+15;a>=31?r=n<<15|31744:a<=0?r=n<<15:r=n<<15|a<<10|o>>>13}return r}function Mnt(e){let t=Dnt(e),n="_COEF_",i=t.length,o=e.indexOf(n,i),r=parseInt(e.slice(i,o),10),a=parseInt(e.slice(o+n.length),10);return{l:r,n:a}}function Nnt(e){let t=e.sphericalHarmonicsDegree,n=e.sphericalHarmonicsCoefficientCount,i=e.pointsLength*(n*(2/3)),o=new Uint32Array(i),r=e.gltfPrimitive.attributes.filter(u=>u.name.includes("SH_DEGREE_")),a=0,s=[0,9,24];switch(t){case 1:a=9;break;case 2:a=24;break;case 3:a=45;break}r.sort((u,f)=>u.name<f.name?-1:u.name>f.name?1:0);let c=a*(2/3);for(let u=0;u<r.length;u++){let{l:f,n:h}=Mnt(r[u].name);for(let p=0;p<e.pointsLength;p++){let A=s[f-1]*2/3,m=p*c+A+h*2,_=p*3;o[m]=xX(r[u].typedArray[_])|xX(r[u].typedArray[_+1])<<16,o[m+1]=xX(r[u].typedArray[_+2])}}return o}Bf.fromGltf=async function(e,t,n,i){let o=n,r=De.createIfNeeded(o),a={releaseGltfJson:!1,upAxis:ao.Y,forwardAxis:ao.Z};l(i.asset)?(a.gltfJson=i,a.baseResource=r,a.gltfResource=r):i instanceof Uint8Array?(a.typedArray=i,a.baseResource=r,a.gltfResource=r):a.gltfResource=De.createIfNeeded(i);let s=new _f(a);try{await s.load()}catch(c){throw s.destroy(),new ue(`Failed to load glTF: ${c.message}`)}return new Bf(s,e,t,n)};Bf.prototype.update=function(e,t){let n=this._loader;if(!this._ready){if(t.afterRender.push(()=>!0),!l(n)){this._ready=!0;return}if(this._resourcesLoaded){this.gltfPrimitive=n.components.scene.nodes[0].primitives[0],this.worldTransform=n.components.scene.nodes[0].matrix,this._ready=!0,this._positions=xt.getAttributeBySemantic(this.gltfPrimitive,at.POSITION).typedArray.slice(),this._rotations=xt.getAttributeBySemantic(this.gltfPrimitive,at.ROTATION).typedArray.slice(),this._scales=xt.getAttributeBySemantic(this.gltfPrimitive,at.SCALE).typedArray.slice();let{l:i,n:o}=vnt(this.gltfPrimitive.attributes);this._sphericalHarmonicsDegree=i,this._sphericalHarmonicsCoefficientCount=o,this._packedSphericalHarmonicsData=Nnt(this);return}this._resourcesLoaded=n.process(t)}};Bf.prototype.hasProperty=function(e,t){return!1};Bf.prototype.getFeature=function(e){};Bf.prototype.applyDebugSettings=function(e,t){};Bf.prototype.applyStyle=function(e){};Bf.prototype.pick=function(e,t,n){};Bf.prototype.isDestroyed=function(){return this.isDestroyed};Bf.prototype.destroy=function(){return this.splatPrimitive=void 0,this._tile=void 0,this._tileset=void 0,this._resource=void 0,this._ready=!1,this._group=void 0,this._metadata=void 0,this._resourcesLoaded=!1,this._lastSplatTransform=void 0,l(this._loader)&&(this._loader.destroy(),this._loader=void 0),fe(this)};var tC=Bf;var _Ae={b3dm:function(e,t,n,i,o){return Tf.fromB3dm(e,t,n,i,o)},pnts:function(e,t,n,i,o){return Tf.fromPnts(e,t,n,i,o)},i3dm:function(e,t,n,i,o){return Tf.fromI3dm(e,t,n,i,o)},cmpt:function(e,t,n,i,o){return QM.fromTileType(e,t,n,i,o,_Ae)},externalTileset:function(e,t,n,i){return s1.fromJson(e,t,n,i)},geom:function(e,t,n,i,o){return new zM(e,t,n,i,o)},vctr:function(e,t,n,i,o){return new v1(e,t,n,i,o)},subt:function(e,t,n,i,o){return fT.fromSubtreeJson(e,t,n,void 0,i,o)},subtreeJson:function(e,t,n,i){return fT.fromSubtreeJson(e,t,n,i)},glb:function(e,t,n,i,o){if(i.byteLength<12)throw new ue("Invalid glb content");let s=new DataView(i,o).getUint32(8,!0),c=new Uint8Array(i,o,s);return tC.tilesetRequiresGaussianSplattingExt(e)?tC.fromGltf(e,t,n,c):e.isGltfExtensionUsed("CESIUM_mesh_vector")?aS.fromGltf(e,t,n,c):Tf.fromGltf(e,t,n,c)},gltf:function(e,t,n,i){return tC.tilesetRequiresGaussianSplattingExt(e)?tC.fromGltf(e,t,n,i):e.isGltfExtensionUsed("CESIUM_mesh_vector")?aS.fromGltf(e,t,n,i):Tf.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return Tf.fromGeoJson(e,t,n,i)}},ib=_Ae;var Lnt={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},_r=Object.freeze(Lnt);var fm={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"};fm.isBinaryFormat=function(e){switch(e){case fm.BATCHED_3D_MODEL:case fm.INSTANCED_3D_MODEL:case fm.COMPOSITE:case fm.POINT_CLOUD:case fm.VECTOR:case fm.GEOMETRY:case fm.IMPLICIT_SUBTREE:case fm.VOXEL_BINARY:case fm.GLTF_BINARY:return!0;default:return!1}};var As=Object.freeze(fm);var Ont={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0},Ud=Object.freeze(Ont);var zs={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},Qg=new Array(zs.NUMBER_OF_PASSES);Qg[zs.RENDER]=Object.freeze({pass:zs.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});Qg[zs.PICK]=Object.freeze({pass:zs.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Qg[zs.SHADOW]=Object.freeze({pass:zs.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});Qg[zs.PRELOAD]=Object.freeze({pass:zs.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});Qg[zs.PRELOAD_FLIGHT]=Object.freeze({pass:zs.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});Qg[zs.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:zs.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});Qg[zs.MOST_DETAILED_PRELOAD]=Object.freeze({pass:zs.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});Qg[zs.MOST_DETAILED_PICK]=Object.freeze({pass:zs.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});zs.getPassOptions=function(e){return Qg[e]};var cr=Object.freeze(zs);function vp(e,t){this._tileset=e,this._tile=t,this.featurePropertiesDirty=!1}Object.defineProperties(vp.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){}}});vp.prototype.hasProperty=function(e,t){return!1};vp.prototype.getFeature=function(e){};vp.prototype.applyDebugSettings=function(e,t){};vp.prototype.applyStyle=function(e){};vp.prototype.update=function(e,t){};vp.prototype.pick=function(e,t,n){};vp.prototype.isDestroyed=function(){return!1};vp.prototype.destroy=function(){return fe(this)};var sS=vp;function kg(e){e=e??V.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(kg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});kg.prototype.hasProperty=function(e){return qn.hasProperty(e,this._properties,this._class)};kg.prototype.hasPropertyBySemantic=function(e){return qn.hasPropertyBySemantic(e,this._properties,this._class)};kg.prototype.getPropertyIds=function(e){return qn.getPropertyIds(this._properties,this._class,e)};kg.prototype.getProperty=function(e){return qn.getProperty(e,this._properties,this._class)};kg.prototype.setProperty=function(e,t){return qn.setProperty(e,t,this._properties,this._class)};kg.prototype.getPropertyBySemantic=function(e){return qn.getPropertyBySemantic(e,this._properties,this._class)};kg.prototype.setPropertyBySemantic=function(e,t){return qn.setPropertyBySemantic(e,t,this._properties,this._class)};var iF=kg;function TX(e,t){let n=xi(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){TX._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=e.schema.classes??V.EMPTY_OBJECT;if(l(n.class)){let o=i[n.class];return new iF({content:n,class:o})}}TX._oneTimeWarning=It;var ob=TX;function Fnt(e,t){let n=e.metadataExtension;if(!l(n))return;let i=n.groups,o=xi(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"].group:t.group;if(typeof o=="number")return i[o];let r=n.groupIds.findIndex(function(a){return a===o});return r>=0?i[r]:void 0}var rb=Fnt;function Ug(e){e=e??V.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(Ug.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Ug.prototype.hasProperty=function(e){return qn.hasProperty(e,this._properties,this._class)};Ug.prototype.hasPropertyBySemantic=function(e){return qn.hasPropertyBySemantic(e,this._properties,this._class)};Ug.prototype.getPropertyIds=function(e){return qn.getPropertyIds(this._properties,this._class,e)};Ug.prototype.getProperty=function(e){return qn.getProperty(e,this._properties,this._class)};Ug.prototype.setProperty=function(e,t){return qn.setProperty(e,t,this._properties,this._class)};Ug.prototype.getPropertyBySemantic=function(e){return qn.getPropertyBySemantic(e,this._properties,this._class)};Ug.prototype.setPropertyBySemantic=function(e,t){return qn.setPropertyBySemantic(e,t,this._properties,this._class)};var oF=Ug;function SX(e,t){let n=xi(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){SX._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=e.schema.classes??V.EMPTY_OBJECT;if(l(n.class)){let o=i[n.class];return new oF({tile:n,class:o})}}SX._oneTimeWarning=It;var rF=SX;function Qnt(e){let t=new Uint8Array(e),n=zh(t);if(n==="glTF"&&(n="glb"),As.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=knt(t);if(l(i.root))return{contentType:As.EXTERNAL_TILESET,jsonPayload:i};if(l(i.asset))return{contentType:As.GLTF,jsonPayload:i};if(l(i.tileAvailability))return{contentType:As.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(l(i.type))return{contentType:As.GEOJSON,jsonPayload:i};if(l(i.voxelTable))return{contentType:As.VOXEL_JSON,jsonPayload:i};throw new ue("Invalid tile content.")}function knt(e){let t;try{t=Br(e)}catch{throw new ue("Invalid tile content.")}return t}var zg=Qnt;function zd(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,this._externalTilesetCount=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 a=0;a<r;a++){let s=n.getDerivedResource({url:o[a].uri}),c=Gc.getServerKey(s.getUrlComponent());this._innerContentResources[a]=s,this._serverKeys[a]=c}}Object.defineProperties(zd.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 wX(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function yAe(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)}zd.prototype.requestInnerContents=function(){if(!Unt(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let e=this._innerContentHeaders;wX(this,e.length);let t=this._cancelCount;for(let n=0;n<e.length;n++)this._arrayFetchPromises[n]=znt(this,n,t,this._tile._contentState);return Gnt(this)};function Unt(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)&&!Gc.serverHasOpenSlots(n,t[n]))return!1;return Gc.heapHasOpenSlots(e.length)}function znt(e,t,n,i){let o=e._innerContentResources[t].clone(),r=e.tile,a=function(){return r._priority},s=e._serverKeys[t],c=new Ir({throttle:!0,throttleByServer:!0,type:ja.TILES3D,priorityFunction:a,serverKey:s});o.request=c,e._requests[t]=c;let u=o.fetchArrayBuffer();if(l(u))return u.then(function(f){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===pi.CANCELLED){yAe(e,i);return}return wX(e,-1),f}}).catch(function(f){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===pi.CANCELLED){yAe(e,i);return}wX(e,-1),CAe(e,t,f)}})}async function Gnt(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((r,a)=>Vnt(e,r,a)),o=await Promise.all(i);if(e._contentsCreated=!0,e._contents=o.filter(l),e._externalTilesetCount===e._contents.length){let r=e._tile;r.hasRenderableContent=!1}return o}async function Vnt(e,t,n){if(l(t))try{let i=zg(t),o=e._tileset,r=e._innerContentResources[n],a=e._tile;i.contentType===As.EXTERNAL_TILESET&&(e._externalTilesetCount++,a.hasTilesetContent=!0),e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===As.GEOMETRY||i.contentType===As.VECTOR;let s,c=ib[i.contentType];l(i.binaryPayload)?s=await Promise.resolve(c(o,a,r,i.binaryPayload.buffer,0)):s=await Promise.resolve(c(o,a,r,i.jsonPayload));let u=e._innerContentHeaders[n];if(a.hasImplicitContentMetadata){let h=a.implicitSubtree,p=a.implicitCoordinates;s.metadata=h.getContentMetadataView(p,n)}else a.hasImplicitContent||(s.metadata=ob(o,u));let f=rb(o,u);return l(f)&&(s.group=new c0({metadata:f})),s}catch(i){CAe(e,n,i)}}function CAe(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}`))}zd.prototype.cancelRequests=function(){for(let e=0;e<this._requests.length;e++){let t=this._requests[e];l(t)&&t.cancel()}};zd.prototype.hasProperty=function(e,t){return!1};zd.prototype.getFeature=function(e){};zd.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};zd.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};zd.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)};zd.prototype.pick=function(e,t,n){if(!this._ready)return;let i,o=Number.POSITIVE_INFINITY,r=this._contents,a=r.length;for(let s=0;s<a;++s){let c=r[s].pick(e,t,n);if(!l(c))continue;let u=d.distance(e.origin,c);u<o&&(i=c,o=u)}if(l(i))return n};zd.prototype.isDestroyed=function(){return!1};zd.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return fe(this)};var aF=zd;var EAe=Math.cos,bAe=Math.sin,Hnt=Math.sqrt,BX={};BX.computePosition=function(e,t,n,i,o,r,a){let s=t.radiiSquared,c=e.nwCorner,u=e.boundingRectangle,f=c.latitude-e.granYCos*i+o*e.granXSin,h=EAe(f),p=bAe(f),A=s.z*p,m=c.longitude+i*e.granYSin+o*e.granXCos,_=h*EAe(m),y=h*bAe(m),C=s.x*_,E=s.y*y,b=Hnt(C*_+E*y+A*p);if(r.x=C/b,r.y=E/b,r.z=A/b,n){let x=e.stNwCorner;l(x)?(f=x.latitude-e.stGranYCos*i+o*e.stGranXSin,m=x.longitude+i*e.stGranYSin+o*e.stGranXCos,a.x=(m-e.stWest)*e.lonScalar,a.y=(f-e.stSouth)*e.latScalar):(a.x=(m-u.west)*e.lonScalar,a.y=(f-u.south)*e.latScalar)}};var Wnt=new ji,Gd=new d,jnt=new me,U8=new d,sF=new Wi;function IAe(e,t,n,i,o,r,a){let s=Math.cos(t),c=i*s,u=n*s,f=Math.sin(t),h=i*f,p=n*f;sF._ellipsoid=te.default,Gd=sF.project(e,Gd),Gd=d.subtract(Gd,U8,Gd);let A=ji.fromRotation(t,Wnt);Gd=ji.multiplyByVector(A,Gd,Gd),Gd=d.add(Gd,U8,Gd),e=sF.unproject(Gd,e),r-=1,a-=1;let m=e.latitude,_=m+r*p,y=m-c*a,C=m-c*a+r*p,E=Math.max(m,_,y,C),b=Math.min(m,_,y,C),x=e.longitude,S=x+r*u,B=x+a*h,v=x+a*h+r*u,P=Math.max(x,S,B,v),N=Math.min(x,S,B,v);return{north:E,south:b,east:P,west:N,granYCos:c,granYSin:h,granXCos:u,granXSin:p,nwCorner:e}}BX.computeOptions=function(e,t,n,i,o,r,a){let s=e.east,c=e.west,u=e.north,f=e.south,h=!1,p=!1;u===D.PI_OVER_TWO&&(h=!0),f===-D.PI_OVER_TWO&&(p=!0);let A,m=u-f;c>s?A=D.TWO_PI-c+s:A=s-c;let _=Math.ceil(A/t)+1,y=Math.ceil(m/t)+1,C=A/(_-1),E=m/(y-1),b=ce.northwest(e,r),x=ce.center(e,jnt);(n!==0||i!==0)&&(x.longitude<b.longitude&&(x.longitude+=D.TWO_PI),sF._ellipsoid=te.default,U8=sF.project(x,U8));let S=E,B=C,v=0,P=0,N=ce.clone(e,o),L={granYCos:S,granYSin:v,granXCos:B,granXSin:P,nwCorner:b,boundingRectangle:N,width:_,height:y,northCap:h,southCap:p};if(n!==0){let g=IAe(b,n,C,E,x,_,y);u=g.north,f=g.south,s=g.east,c=g.west,L.granYCos=g.granYCos,L.granYSin=g.granYSin,L.granXCos=g.granXCos,L.granXSin=g.granXSin,N.north=u,N.south=f,N.east=s,N.west=c}if(i!==0){n=n-i;let g=ce.northwest(N,a),I=IAe(g,n,C,E,x,_,y);L.stGranYCos=I.granYCos,L.stGranXCos=I.granXCos,L.stGranYSin=I.granYSin,L.stGranXSin=I.granXSin,L.stNwCorner=g,L.stWest=I.west,L.stSouth=I.south}return L};var gs=BX;var Ynt=new le,qnt=new le,Knt=new d,Xnt=new ce;function xAe(e,t){let n=e._ellipsoid,i=t.height,o=t.width,r=t.northCap,a=t.southCap,s=i,c=2,u=0,f=4;r&&(c-=1,s-=1,u+=1,f-=2),a&&(c-=1,s-=1,u+=1,f-=2),u+=c*o+2*s-f;let h=new Float64Array(u*3),p=0,A=0,m,_=Knt;if(r)gs.computePosition(t,n,!1,A,0,_),h[p++]=_.x,h[p++]=_.y,h[p++]=_.z;else for(m=0;m<o;m++)gs.computePosition(t,n,!1,A,m,_),h[p++]=_.x,h[p++]=_.y,h[p++]=_.z;for(m=o-1,A=1;A<i;A++)gs.computePosition(t,n,!1,A,m,_),h[p++]=_.x,h[p++]=_.y,h[p++]=_.z;if(A=i-1,!a)for(m=o-2;m>=0;m--)gs.computePosition(t,n,!1,A,m,_),h[p++]=_.x,h[p++]=_.y,h[p++]=_.z;for(m=0,A=i-2;A>0;A--)gs.computePosition(t,n,!1,A,m,_),h[p++]=_.x,h[p++]=_.y,h[p++]=_.z;let y=h.length/3*2,C=Ue.createTypedArray(h.length/3,y),E=0;for(let x=0;x<h.length/3-1;x++)C[E++]=x,C[E++]=x+1;C[E++]=h.length/3-1,C[E++]=0;let b=new yt({attributes:new _n,primitiveType:ve.LINES});return b.attributes.position=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:h}),b.indices=C,b}function Jnt(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,o=e._ellipsoid,r=xAe(e,t),a=t.height,s=t.width,c=Ti.scaleToGeodeticHeight(r.attributes.position.values,n,o,!1),u=c.length,f=new Float64Array(u*2);f.set(c);let h=Ti.scaleToGeodeticHeight(r.attributes.position.values,i,o);f.set(h,u),r.attributes.position.values=f;let p=t.northCap,A=t.southCap,m=4;p&&(m-=1),A&&(m-=1);let _=(f.length/3+m)*2,y=Ue.createTypedArray(f.length/3,_);u=f.length/6;let C=0;for(let b=0;b<u-1;b++)y[C++]=b,y[C++]=b+1,y[C++]=b+u,y[C++]=b+u+1;y[C++]=u-1,y[C++]=0,y[C++]=u+u-1,y[C++]=u,y[C++]=0,y[C++]=u;let E;if(p)E=a-1;else{let b=s-1;y[C++]=b,y[C++]=b+u,E=s+a-2}if(y[C++]=E,y[C++]=E+u,!A){let b=s+E-1;y[C++]=b,y[C]=b+u}return r.indices=y,r}function lS(e){e=e??V.EMPTY_OBJECT;let t=e.rectangle,n=e.granularity??D.RADIANS_PER_DEGREE,i=e.ellipsoid??te.default,o=e.rotation??0,r=e.height??0,a=e.extrudedHeight??r;this._rectangle=ce.clone(t),this._granularity=n,this._ellipsoid=i,this._surfaceHeight=Math.max(r,a),this._rotation=o,this._extrudedHeight=Math.min(r,a),this._offsetAttribute=e.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}lS.packedLength=ce.packedLength+te.packedLength+5;lS.pack=function(e,t,n){return n=n??0,ce.pack(e._rectangle,t,n),n+=ce.packedLength,te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._extrudedHeight,t[n]=e._offsetAttribute??-1,t};var TAe=new ce,SAe=te.clone(te.UNIT_SPHERE),cS={rectangle:TAe,ellipsoid:SAe,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};lS.unpack=function(e,t,n){t=t??0;let i=ce.unpack(e,t,TAe);t+=ce.packedLength;let o=te.unpack(e,t,SAe);t+=te.packedLength;let r=e[t++],a=e[t++],s=e[t++],c=e[t++],u=e[t];return l(n)?(n._rectangle=ce.clone(i,n._rectangle),n._ellipsoid=te.clone(o,n._ellipsoid),n._surfaceHeight=a,n._rotation=s,n._extrudedHeight=c,n._offsetAttribute=u===-1?void 0:u,n):(cS.granularity=r,cS.height=a,cS.rotation=s,cS.extrudedHeight=c,cS.offsetAttribute=u===-1?void 0:u,new lS(cS))};var Znt=new me;lS.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=gs.computeOptions(t,e._granularity,e._rotation,0,Xnt,Znt),o,r;if(D.equalsEpsilon(t.north,t.south,D.EPSILON10)||D.equalsEpsilon(t.east,t.west,D.EPSILON10))return;let a=e._surfaceHeight,s=e._extrudedHeight,c=!D.equalsEpsilon(a,s,0,D.EPSILON2),u;if(c){if(o=Jnt(e,i),l(e._offsetAttribute)){let p=o.attributes.position.values.length/3,A=new Uint8Array(p);e._offsetAttribute===mn.TOP?A=A.fill(1,0,p/2):(u=e._offsetAttribute===mn.NONE?0:1,A=A.fill(u)),o.attributes.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}let f=le.fromRectangle3D(t,n,a,qnt),h=le.fromRectangle3D(t,n,s,Ynt);r=le.union(f,h)}else{if(o=xAe(e,i),o.attributes.position.values=Ti.scaleToGeodeticHeight(o.attributes.position.values,a,n,!1),l(e._offsetAttribute)){let f=o.attributes.position.values.length;u=e._offsetAttribute===mn.NONE?0:1;let h=new Uint8Array(f/3).fill(u);o.attributes.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}r=le.fromRectangle3D(t,n,a)}return new yt({attributes:o.attributes,indices:o.indices,primitiveType:ve.LINES,boundingSphere:r,offsetAttribute:e._offsetAttribute})};var ab=lS;function fS(e){this.rectangle=ce.clone(e.rectangle),this.minimumHeight=e.minimumHeight??0,this.maximumHeight=e.maximumHeight??0,this.southwestCornerCartesian=new d,this.northeastCornerCartesian=new d,this.westNormal=new d,this.southNormal=new d,this.eastNormal=new d,this.northNormal=new d;let t=e.ellipsoid??te.WGS84;iit(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,(e.computeBoundingVolumes??!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(fS.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});fS.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=en.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=le.fromOrientedBoundingBox(this._orientedBoundingBox)};var wAe=new d,z8=new d,BAe=new d,$nt=new d,eit=new d,tit=new d,nit=new d,Vd=new me,DAe=new cn(d.UNIT_X,0),uS=new yn;function iit(e,t,n){n.cartographicToCartesian(ce.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(ce.northeast(t),e.northeastCornerCartesian),Vd.longitude=t.west,Vd.latitude=(t.south+t.north)*.5,Vd.height=0;let i=n.cartographicToCartesian(Vd,tit),o=d.cross(i,d.UNIT_Z,$nt);d.normalize(o,e.westNormal),Vd.longitude=t.east;let r=n.cartographicToCartesian(Vd,nit),a=d.cross(d.UNIT_Z,r,wAe);d.normalize(a,e.eastNormal);let s=d.subtract(i,r,wAe);d.magnitude(s)===0&&(s=d.clone(o,s));let c=d.normalize(s,eit),u=t.south,f;if(u>0){Vd.longitude=(t.west+t.east)*.5,Vd.latitude=u;let _=n.cartographicToCartesian(Vd,uS.origin);d.clone(c,uS.direction);let y=cn.fromPointNormal(e.southwestCornerCartesian,e.westNormal,DAe);di.rayPlane(uS,y,e.southwestCornerCartesian),f=n.geodeticSurfaceNormal(_,z8)}else f=n.geodeticSurfaceNormalCartographic(ce.southeast(t),z8);let h=d.cross(f,s,BAe);d.normalize(h,e.southNormal);let p=t.north,A;if(p<0){Vd.longitude=(t.west+t.east)*.5,Vd.latitude=p;let _=n.cartographicToCartesian(Vd,uS.origin);d.negate(c,uS.direction);let y=cn.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,DAe);di.rayPlane(uS,y,e.northeastCornerCartesian),A=n.geodeticSurfaceNormal(_,z8)}else A=n.geodeticSurfaceNormalCartographic(ce.northwest(t),z8);let m=d.cross(s,A,BAe);d.normalize(m,e.northNormal)}var oit=new d,rit=new d,ait=new d(0,-1,0),sit=new d(0,0,-1),vAe=new d;function cit(e,t){let n=t.camera,i=n.positionWC,o=n.positionCartographic,r=0;if(!ce.contains(e.rectangle,o)){let u=e.southwestCornerCartesian,f=e.northeastCornerCartesian,h=e.westNormal,p=e.southNormal,A=e.eastNormal,m=e.northNormal;t.mode!==oe.SCENE3D&&(u=t.mapProjection.project(ce.southwest(e.rectangle),oit),u.z=u.y,u.y=u.x,u.x=0,f=t.mapProjection.project(ce.northeast(e.rectangle),rit),f.z=f.y,f.y=f.x,f.x=0,h=ait,A=d.UNIT_Y,p=sit,m=d.UNIT_Z);let _=d.subtract(i,u,vAe),y=d.dot(_,h),C=d.dot(_,p),E=d.subtract(i,f,vAe),b=d.dot(E,A),x=d.dot(E,m);y>0?r+=y*y:b>0&&(r+=b*b),C>0?r+=C*C:x>0&&(r+=x*x)}let a,s,c;if(t.mode===oe.SCENE3D?(a=o.height,s=e.minimumHeight,c=e.maximumHeight):(a=i.x,s=0,c=0),a>c){let u=a-c;r+=u*u}else if(a<s){let u=s-a;r+=u*u}return Math.sqrt(r)}fS.prototype.distanceToCamera=function(e){let t=cit(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};fS.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};fS.prototype.createDebugVolume=function(e){let t=M.clone(M.IDENTITY),n=new ab({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new Mt({geometry:n,id:"outline",modelMatrix:t,attributes:{color:Jt.fromColor(e)}});return new Nn({geometryInstances:i,appearance:new gn({translucent:!1,flat:!0}),asynchronous:!1})};var Df=fS;var cF={},lit=new d,PAe=new d,RAe=new d,MAe=new d,NAe=new en;cF.validOutline=function(e){let n=en.fromPoints(e,NAe).halfAxes,i=J.getColumn(n,0,PAe),o=J.getColumn(n,1,RAe),r=J.getColumn(n,2,MAe),a=d.magnitude(i),s=d.magnitude(o),c=d.magnitude(r);return!(a===0&&(s===0||c===0)||s===0&&c===0)};cF.computeProjectTo2DArguments=function(e,t,n,i){let o=en.fromPoints(e,NAe),r=o.halfAxes,a=J.getColumn(r,0,PAe),s=J.getColumn(r,1,RAe),c=J.getColumn(r,2,MAe),u=d.magnitude(a),f=d.magnitude(s),h=d.magnitude(c),p=Math.min(u,f,h);if(u===0&&(f===0||h===0)||f===0&&h===0)return!1;let A,m;return(p===f||p===h)&&(A=a),p===u?A=s:p===h&&(m=s),(p===u||p===f)&&(m=c),d.normalize(A,n),d.normalize(m,i),d.clone(o.center,t),!0};function LAe(e,t,n,i,o){let r=d.subtract(e,t,lit),a=d.dot(n,r),s=d.dot(i,r);return k.fromElements(a,s,o)}cF.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let o=new Array(i.length);for(let r=0;r<i.length;r++)o[r]=LAe(i[r],e,t,n);return o}};cF.createProjectPointTo2DFunction=function(e,t,n){return function(i,o){return LAe(i,e,t,n,o)}};var Gg=cF;function uit(e){let t=e.length,n=new Float64Array(t*3),i=Ue.createTypedArray(t,t*2),o=0,r=0;for(let s=0;s<t;s++){let c=e[s];n[o++]=c.x,n[o++]=c.y,n[o++]=c.z,i[r++]=s,i[r++]=(s+1)%t}let a=new _n({position:new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:n})});return new yt({attributes:a,indices:i,primitiveType:ve.LINES})}function sb(e){e=e??V.EMPTY_OBJECT;let t=e.polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=ni.computeHierarchyPackedLength(t,d)+1}sb.fromPositions=function(e){e=e??V.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions}};return new sb(t)};sb.pack=function(e,t,n){return n=n??0,n=ni.packPolygonHierarchy(e._polygonHierarchy,t,n,d),t[n]=e.packedLength,t};var fit={polygonHierarchy:{}};sb.unpack=function(e,t,n){t=t??0;let i=ni.unpackPolygonHierarchy(e,t,d);t=i.startingIndex,delete i.startingIndex;let o=e[t];return l(n)||(n=new sb(fit)),n._polygonHierarchy=i,n.packedLength=o,n};sb.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=Ho(n,d.equalsEpsilon,!0),n.length<3||!Gg.validOutline(n))return;let o=ni.polygonOutlinesFromHierarchy(t,!1);if(o.length===0)return;let r=[];for(let c=0;c<o.length;c++){let u=new Mt({geometry:uit(o[c])});r.push(u)}let a=Wn.combineInstances(r)[0],s=le.fromPoints(t.positions);return new yt({attributes:a.attributes,indices:a.indices,primitiveType:a.primitiveType,boundingSphere:s})};var Hd=sb;var G8=new me;function lF(e){let t=eg.fromToken(e.token),n=e.minimumHeight??0,i=e.maximumHeight??0,o=e.ellipsoid??te.WGS84;this.s2Cell=t,this.minimumHeight=n,this.maximumHeight=i,this.ellipsoid=o;let r=Cit(t,n,i,o);this._boundingPlanes=r;let a=xit(r);this._vertices=a,this._edgeNormals=new Array(6),this._edgeNormals[0]=OX(r[0],a.slice(0,4));let s;for(s=0;s<4;s++)this._edgeNormals[0][s]=d.negate(this._edgeNormals[0][s],this._edgeNormals[0][s]);for(this._edgeNormals[1]=OX(r[1],a.slice(4,8)),s=0;s<4;s++)this._edgeNormals[2+s]=OX(r[2+s],[a[s%4],a[(s+1)%4],a[4+(s+1)%4],a[4+s]]);for(this._planeVertices=[this._vertices.slice(0,4),this._vertices.slice(4,8)],s=0;s<4;s++)this._planeVertices.push([this._vertices[s%4],this._vertices[(s+1)%4],this._vertices[4+(s+1)%4],this._vertices[4+s]]);let c=t.getCenter();G8=o.cartesianToCartographic(c,G8),G8.height=(i+n)/2,this.center=o.cartographicToCartesian(G8,c),this._boundingSphere=le.fromPoints(a)}var dit=new d,hit=new me,mit=new d,pit=new me,Ait=new d,git=new d,_it=new d,yit=new d;function Cit(e,t,n,i){let o=new Array(6),r=e.getCenter(),a=i.geodeticSurfaceNormal(r,dit),s=i.cartesianToCartographic(r,hit);s.height=n;let c=i.cartographicToCartesian(s,mit),u=cn.fromPointNormal(c,a);o[0]=u;let f=0,h,p=[],A,m;for(h=0;h<4;h++){A=e.getVertex(h),p[h]=A,m=i.cartesianToCartographic(A,pit),m.height=t;let y=cn.getPointDistance(u,i.cartographicToCartesian(m,Ait));y<f&&(f=y)}let _=cn.clone(u);for(_.normal=d.negate(_.normal,_.normal),_.distance=_.distance*-1+f,o[1]=_,h=0;h<4;h++){A=p[h];let y=p[(h+1)%4],C=i.geodeticSurfaceNormal(A,git),E=d.subtract(y,A,yit),b=d.cross(E,C,_it);b=d.normalize(b,b),o[2+h]=cn.fromPointNormal(A,b)}return o}var cb=new d,lb=new d,ub=new d,DX=new d,vX=new d,PX=new d,Eit=new d,bit=new d,Iit=new d,RX=new d,MX=new d,NX=new d,nC=new d,Pp=new J;function OAe(e,t,n){cb=e.normal,lb=t.normal,ub=n.normal,DX=d.multiplyByScalar(e.normal,-e.distance,DX),vX=d.multiplyByScalar(t.normal,-t.distance,vX),PX=d.multiplyByScalar(n.normal,-n.distance,PX),RX=d.multiplyByScalar(d.cross(lb,ub,Eit),d.dot(DX,cb),RX),MX=d.multiplyByScalar(d.cross(ub,cb,bit),d.dot(vX,lb),MX),NX=d.multiplyByScalar(d.cross(cb,lb,Iit),d.dot(PX,ub),NX),Pp[0]=cb.x,Pp[1]=lb.x,Pp[2]=ub.x,Pp[3]=cb.y,Pp[4]=lb.y,Pp[5]=ub.y,Pp[6]=cb.z,Pp[7]=lb.z,Pp[8]=ub.z;let i=J.determinant(Pp);return nC=d.add(RX,MX,nC),nC=d.add(nC,NX,nC),new d(nC.x/i,nC.y/i,nC.z/i)}function xit(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=OAe(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=OAe(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var LX=new d,dS=new d;function OX(e,t){let n=[];for(let i=0;i<4;i++)LX=d.subtract(t[(i+1)%4],t[i],LX),dS=d.cross(e.normal,LX,dS),dS=d.normalize(dS,dS),n[i]=d.clone(dS);return n}Object.defineProperties(lF.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var FX=new d;lF.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,a;for(r=0;r<4;r++)a=2+r,cn.getPointDistance(this._boundingPlanes[a],t)>0&&(n.push(a),i.push(this._planeVertices[a]),o=this._edgeNormals[a]);if(n.length===0)return 0;let s,c;if(n.length===1)return c=this._boundingPlanes[n[0]],s=QX(cn.projectPointOntoPlane(c,t,FX),i[0],c,o),d.distance(s,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 s=FAe(t,p[0],p[1]),d.distance(s,t)}let f=Number.MAX_VALUE,h;for(r=0;r<2;r++)c=this._boundingPlanes[n[r]],s=QX(cn.projectPointOntoPlane(c,t,FX),i[r],c,this._edgeNormals[n[r]]),h=d.distanceSquared(s,t),h<f&&(f=h);return Math.sqrt(f)}else if(n.length>3)return s=QX(cn.projectPointOntoPlane(this._boundingPlanes[1],t,FX),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),d.distance(s,t);let u=n[1]===2&&n[2]===5?0:1;return n[0]===0?d.distance(t,this._vertices[(n[1]-2+u)%4]):d.distance(t,this._vertices[4+(n[1]-2+u)%4])};var Tit=new d,Sit=new d;function FAe(e,t,n){let i=d.subtract(n,t,Tit),o=d.subtract(e,t,Sit),r=d.dot(i,o);if(r<=0)return t;let a=d.dot(i,i);return r>=a?n:(r=r/a,new d((1-r)*t.x+r*n.x,(1-r)*t.y+r*n.y,(1-r)*t.z+r*n.z))}var wit=new cn(d.UNIT_X,0);function QX(e,t,n,i){let o=Number.MAX_VALUE,r,a,s;for(let c=0;c<t.length;c++){let u=cn.fromPointNormal(t[c],i[c],wit);cn.getPointDistance(u,e)<0||(s=FAe(e,t[c],t[(c+1)%4]),r=d.distance(e,s),r<o&&(o=r,a=s))}return l(a)?a:e}lF.prototype.intersectPlane=function(e){let t=0,n=0;for(let i=0;i<this._vertices.length;i++)d.dot(e.normal,this._vertices[i])+e.distance<0?n++:t++;return t===this._vertices.length?Xt.INSIDE:n===this._vertices.length?Xt.OUTSIDE:Xt.INTERSECTING};lF.prototype.createDebugVolume=function(e){let t=M.clone(M.IDENTITY),n=new Hd({polygonHierarchy:{positions:this._planeVertices[0]}}),i=Hd.createGeometry(n),o=new Mt({geometry:i,id:"outline",modelMatrix:t,attributes:{color:Jt.fromColor(e)}}),r=new Hd({polygonHierarchy:{positions:this._planeVertices[1]}}),a=Hd.createGeometry(r),s=new Mt({geometry:a,id:"outline",modelMatrix:t,attributes:{color:Jt.fromColor(e)}}),c=[];for(let u=0;u<4;u++){let f=new Hd({polygonHierarchy:{positions:this._planeVertices[2+u]}}),h=Hd.createGeometry(f);c[u]=new Mt({geometry:h,id:"outline",modelMatrix:t,attributes:{color:Jt.fromColor(e)}})}return new Nn({geometryInstances:[c[0],c[1],c[2],c[3],s,o],appearance:new gn({translucent:!1,flat:!0}),asynchronous:!1})};var uF=lF;var Bit=new d(1,1,1),V8=Math.cos,H8=Math.sin;function hS(e){e=e??V.EMPTY_OBJECT;let t=e.radii??Bit,n=e.innerRadii??t,i=e.minimumClock??0,o=e.maximumClock??D.TWO_PI,r=e.minimumCone??0,a=e.maximumCone??D.PI,s=Math.round(e.stackPartitions??10),c=Math.round(e.slicePartitions??8),u=Math.round(e.subdivisions??128);this._radii=d.clone(t),this._innerRadii=d.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=a,this._stackPartitions=s,this._slicePartitions=c,this._subdivisions=u,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}hS.packedLength=2*d.packedLength+8;hS.pack=function(e,t,n){return n=n??0,d.pack(e._radii,t,n),n+=d.packedLength,d.pack(e._innerRadii,t,n),n+=d.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]=e._offsetAttribute??-1,t};var QAe=new d,kAe=new d,Vg={radii:QAe,innerRadii:kAe,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};hS.unpack=function(e,t,n){t=t??0;let i=d.unpack(e,t,QAe);t+=d.packedLength;let o=d.unpack(e,t,kAe);t+=d.packedLength;let r=e[t++],a=e[t++],s=e[t++],c=e[t++],u=e[t++],f=e[t++],h=e[t++],p=e[t];return l(n)?(n._radii=d.clone(i,n._radii),n._innerRadii=d.clone(o,n._innerRadii),n._minimumClock=r,n._maximumClock=a,n._minimumCone=s,n._maximumCone=c,n._stackPartitions=u,n._slicePartitions=f,n._subdivisions=h,n._offsetAttribute=p===-1?void 0:p,n):(Vg.minimumClock=r,Vg.maximumClock=a,Vg.minimumCone=s,Vg.maximumCone=c,Vg.stackPartitions=u,Vg.slicePartitions=f,Vg.subdivisions=h,Vg.offsetAttribute=p===-1?void 0:p,new hS(Vg))};hS.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,a=e._maximumCone,s=e._subdivisions,c=te.fromCartesian3(t),u=e._slicePartitions+1,f=e._stackPartitions+1;u=Math.round(u*Math.abs(o-i)/D.TWO_PI),f=Math.round(f*Math.abs(a-r)/D.PI),u<2&&(u=2),f<2&&(f=2);let h=0,p=1,A=n.x!==t.x||n.y!==t.y||n.z!==t.z,m=!1,_=!1;A&&(p=2,r>0&&(m=!0,h+=u),a<Math.PI&&(_=!0,h+=u));let y=s*p*(f+u),C=new Float64Array(y*3),E=2*(y+h-(u+f)*p),b=Ue.createTypedArray(y,E),x,S,B,v,P=0,N=new Array(f),L=new Array(f);for(x=0;x<f;x++)v=r+x*(a-r)/(f-1),N[x]=H8(v),L[x]=V8(v);let g=new Array(s),I=new Array(s);for(x=0;x<s;x++)B=i+x*(o-i)/(s-1),g[x]=H8(B),I[x]=V8(B);for(x=0;x<f;x++)for(S=0;S<s;S++)C[P++]=t.x*N[x]*I[S],C[P++]=t.y*N[x]*g[S],C[P++]=t.z*L[x];if(A)for(x=0;x<f;x++)for(S=0;S<s;S++)C[P++]=n.x*N[x]*I[S],C[P++]=n.y*N[x]*g[S],C[P++]=n.z*L[x];for(N.length=s,L.length=s,x=0;x<s;x++)v=r+x*(a-r)/(s-1),N[x]=H8(v),L[x]=V8(v);for(g.length=u,I.length=u,x=0;x<u;x++)B=i+x*(o-i)/(u-1),g[x]=H8(B),I[x]=V8(B);for(x=0;x<s;x++)for(S=0;S<u;S++)C[P++]=t.x*N[x]*I[S],C[P++]=t.y*N[x]*g[S],C[P++]=t.z*L[x];if(A)for(x=0;x<s;x++)for(S=0;S<u;S++)C[P++]=n.x*N[x]*I[S],C[P++]=n.y*N[x]*g[S],C[P++]=n.z*L[x];for(P=0,x=0;x<f*p;x++){let R=x*s;for(S=0;S<s-1;S++)b[P++]=R+S,b[P++]=R+S+1}let T=f*s*p;for(x=0;x<u;x++)for(S=0;S<s-1;S++)b[P++]=T+x+S*u,b[P++]=T+x+(S+1)*u;if(A)for(T=f*s*p+u*s,x=0;x<u;x++)for(S=0;S<s-1;S++)b[P++]=T+x+S*u,b[P++]=T+x+(S+1)*u;if(A){let R=f*s*p,O=R+s*u;if(m)for(x=0;x<u;x++)b[P++]=R+x,b[P++]=O+x;if(_)for(R+=s*u-u,O+=s*u-u,x=0;x<u;x++)b[P++]=R+x,b[P++]=O+x}let w=new _n({position:new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:C})});if(l(e._offsetAttribute)){let R=C.length,O=e._offsetAttribute===mn.NONE?0:1,G=new Uint8Array(R/3).fill(O);w.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:G})}return new yt({attributes:w,indices:b,primitiveType:ve.LINES,boundingSphere:le.fromEllipsoid(c),offsetAttribute:e._offsetAttribute})};var vf=hS;function mS(e){let t=e.radius??1,i={radii:new d(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new vf(i),this._workerName="createSphereOutlineGeometry"}mS.packedLength=vf.packedLength;mS.pack=function(e,t,n){return vf.pack(e._ellipsoidGeometry,t,n)};var Dit=new vf,fb={radius:void 0,radii:new d,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};mS.unpack=function(e,t,n){let i=vf.unpack(e,t,Dit);return fb.stackPartitions=i._stackPartitions,fb.slicePartitions=i._slicePartitions,fb.subdivisions=i._subdivisions,l(n)?(d.clone(i._radii,fb.radii),n._ellipsoidGeometry=new vf(fb),n):(fb.radius=i._radii.x,new mS(fb))};mS.createGeometry=function(e){return vf.createGeometry(e._ellipsoidGeometry)};var Hg=mS;function pS(e,t){t===0&&(t=D.EPSILON7),this._boundingSphere=new le(e,t)}Object.defineProperties(pS.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}}});pS.prototype.distanceToCamera=function(e){let t=this._boundingSphere;return Math.max(0,d.distance(t.center,e.camera.positionWC)-t.radius)};pS.prototype.intersectPlane=function(e){return le.intersectPlane(this._boundingSphere,e)};pS.prototype.update=function(e,t){d.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};pS.prototype.createDebugVolume=function(e){let t=new Hg({radius:this.radius}),n=M.fromTranslation(this.center,M.clone(M.IDENTITY)),i=new Mt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Jt.fromColor(e)}});return new Nn({geometryInstances:i,appearance:new gn({translucent:!1,flat:!0}),asynchronous:!1})};var Wg=pS;var vit=new d,Pit=new d,Rit=new d,Mit=new d;function db(e,t,n){n=d.cross(e,t,n);let i=d.magnitude(n);return d.multiplyByScalar(n,D.EPSILON7/i,n)}function kX(e,t){let n=d.normalize(e,Mit),i=d.equalsEpsilon(n,d.UNIT_X,D.EPSILON6)?d.UNIT_Y:d.UNIT_X;return db(e,i,t)}function UAe(e){let t=J.getColumn(e,0,vit),n=J.getColumn(e,1,Pit),i=J.getColumn(e,2,Rit),o=d.equals(t,d.ZERO),r=d.equals(n,d.ZERO),a=d.equals(i,d.ZERO);return!o&&!r&&!a?e:o&&r&&a?(e[0]=D.EPSILON7,e[4]=D.EPSILON7,e[8]=D.EPSILON7,e):(o&&!r&&!a?t=db(n,i,t):!o&&r&&!a?n=db(t,i,n):!o&&!r&&a?i=db(n,t,i):o?r?a||(t=kX(i,t),n=db(i,t,n)):(t=kX(n,t),i=db(n,t,i)):(n=kX(t,n),i=db(n,t,i)),J.setColumn(e,0,t,e),J.setColumn(e,1,n,e),J.setColumn(e,2,i,e),e)}function AS(e,t){t=UAe(t),this._orientedBoundingBox=new en(e,t),this._boundingSphere=le.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(AS.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});AS.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};AS.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};AS.prototype.update=function(e,t){d.clone(e,this._orientedBoundingBox.center),t=UAe(t),J.clone(t,this._orientedBoundingBox.halfAxes),le.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};AS.prototype.createDebugVolume=function(e){let t=new Rh({minimum:new d(-1,-1,-1),maximum:new d(1,1,1)}),n=M.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new Mt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Jt.fromColor(e)}});return new Nn({geometryInstances:i,appearance:new gn({translucent:!1,flat:!0}),asynchronous:!1})};var Ou=AS;function Pr(e,t,n,i){this._tileset=e,this._header=n;let o=l(n.contents),r=o&&n.contents.length>1||xi(n,"3DTILES_multiple_contents"),a=o&&!r?n.contents[0]:n.content;this._contentHeader=a,this.transform=l(n.transform)?M.unpack(n.transform):M.clone(M.IDENTITY);let s=l(i)?i.computedTransform:e.modelMatrix,c=M.multiply(s,this.transform,new M),u=l(i)?i._initialTransform:M.IDENTITY;this._initialTransform=M.multiply(u,this.transform,new M),this.computedTransform=c,this.metadata=rF(e,n),this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,c),this._boundingVolume2D=void 0;let f;l(a)&&l(a.boundingVolume)&&(f=this.createBoundingVolume(a.boundingVolume,c)),this._contentBoundingVolume=f,this._contentBoundingVolume2D=void 0;let h;l(n.viewerRequestVolume)&&(h=this.createBoundingVolume(n.viewerRequestVolume,c)),this._viewerRequestVolume=h,this.geometricError=n.geometricError,this._geometricError=n.geometricError,l(this._geometricError)||(this._geometricError=l(i)?i._geometricError:e._geometricError,Pr._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")&&Pr._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?mr.REPLACE:mr.ADD):l(i)?p=i.refine:p=mr.REPLACE,this.refine=p,this.children=[],this.parent=i;let A,m=!1,_,y,C;if(t=De.createIfNeeded(t),r)_=_r.UNLOADED,y=t.clone();else if(l(a)){let S=a.uri;l(a.url)&&(Pr._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),S=a.url),S===""?(Pr._deprecationWarning("contentUriEmpty","content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"),A=new sS(e,this),m=!0,_=_r.READY):(_=_r.UNLOADED,y=t.getDerivedResource({url:S}),C=Gc.getServerKey(y.getUrlComponent()))}else A=new sS(e,this),m=!0,_=_r.READY;this._content=A,this._contentResource=y,this._contentState=_,this._expiredContent=void 0,this._serverKey=C,this.hasEmptyContent=m,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasRenderableContent=!m,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=r,this.cacheNode=void 0;let E=n.expire,b,x;l(E)&&(b=E.duration,l(E.date)&&(x=X.fromIso8601(E.date))),this.expireDuration=b,this.expireDate=x,this.lastStyleTime=0,this._optimChildrenWithinParent=Ud.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=z.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 X,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}Pr._deprecationWarning=Ms;Object.defineProperties(Pr.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return 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 z),z.clone(this._color)},set:function(e){this._color=z.clone(e,this._color),this._colorDirty=!0}},contentAvailable:{get:function(){return this.contentReady&&this.hasRenderableContent||l(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===_r.READY}},contentUnloaded:{get:function(){return this._contentState===_r.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===_r.EXPIRED}},contentFailed:{get:function(){return this._contentState===_r.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var iC=new d;function Nit(e,t){let{tileset:n,boundingSphere:i}=e,{radius:o,center:r}=i,{camera:a}=t,s=d.multiplyByScalar(a.directionWC,e._centerZDepth,iC),c=d.add(a.positionWC,s,iC),u=d.subtract(c,r,iC);if(d.magnitude(u)>o){let x=d.normalize(u,iC),S=d.multiplyByScalar(x,o,iC),B=d.add(r,S,iC),v=d.subtract(B,a.positionWC,iC),P=d.normalize(v,iC);e._foveatedFactor=1-Math.abs(d.dot(a.directionWC,P))}else e._foveatedFactor=0;let p=e.refine===mr.REPLACE,A=n.isSkippingLevelOfDetail;if(p&&!A||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&A||n._pass===cr.PRELOAD_FLIGHT||n._pass===cr.PRELOAD)return!1;let m=1-Math.cos(a.frustum.fov*.5),_=n.foveatedConeSize*m;if(e._foveatedFactor<=_)return!1;let y=m-_,C=D.clamp((e._foveatedFactor-_)/y,0,1),E=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.memoryAdjustedScreenSpaceError,C),b=e._screenSpaceError===0&&l(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.memoryAdjustedScreenSpaceError-E<=b}var WAe=new X;Pr.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,o=n??1,r=l(this.parent)?this.parent.geometricError:i._scaledGeometricError,a=t?r:this.geometricError;if(a===0)return 0;let{camera:s,context:c}=e,u=s.frustum,f=c.drawingBufferWidth,h=c.drawingBufferHeight*o,p;if(e.mode===oe.SCENE2D||u instanceof An){let A=u.offCenterFrustum;l(A)&&(u=A);let m=Math.max(u.top-u.bottom,u.right-u.left)/Math.max(f,h);p=a/m}else{let A=Math.max(this._distanceToCamera,D.EPSILON7),m=u.sseDenominator;if(p=a*h/(A*m),i.dynamicScreenSpaceError){let _=i._dynamicScreenSpaceErrorComputedDensity,y=i.dynamicScreenSpaceErrorFactor,C=D.fog(A,_)*y;p-=C}}return p/=e.pixelRatio,p};function Lit(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,a=l(o)&&o._screenSpaceErrorProgressiveResolution>n;return r&&a&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,i=!0),i}function Oit(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}Pr.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:Ka.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!==Ka.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=Oit(n,this),this._priorityProgressiveResolution=Lit(n,this),this.priorityDeferred=Nit(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};Pr.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=X.now(WAe);X.lessThan(this.expireDate,e)&&(this._contentState=_r.EXPIRED,this._expiredContent=this._content)}};function Fit(e){if(!l(e.expireDuration))return;let t=X.now(WAe);X.addSeconds(t,e.expireDuration,t),l(e.expireDate)?X.lessThan(e.expireDate,t)&&X.clone(t,e.expireDate):e.expireDate=X.clone(t)}function Qit(e){return function(){return e._priority}}Pr.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?kit(this):zit(this)};function kit(e){let t=e._content,n=e._tileset;if(!l(t)){let o=xi(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new aF(n,e,e._contentResource.clone(),o),e._content=t}let i=t.requestInnerContents();if(l(i))return e._contentState=_r.LOADING,i.then(o=>{if(!e.isDestroyed()&&l(o))return e._contentState=_r.PROCESSING,t}).catch(o=>{if(!e.isDestroyed())throw e._contentState=_r.FAILED,o})}async function Uit(e,t,n,i,o){let r=e._contentState;e._contentState=_r.LOADING,++t.statistics.numberOfPendingRequests;let a;try{a=await o}catch(s){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(n.cancelled||n.state===pi.CANCELLED){e._contentState=r,++t.statistics.numberOfAttemptedRequests;return}throw e._contentState=_r.FAILED,s}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(n.cancelled||n.state===pi.CANCELLED){e._contentState=r,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let s=await Git(e,a);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=s,e._contentState=_r.PROCESSING,s)}catch(s){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=_r.FAILED,s}}function zit(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new Ir({throttle:!0,throttleByServer:!0,type:ja.TILES3D,priorityFunction:Qit(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 Uit(e,o,i,n,r)}async function Git(e,t){let n=zg(t),i=e._tileset;i._disableSkipLevelOfDetail=i._disableSkipLevelOfDetail||n.contentType===As.GEOMETRY||n.contentType===As.VECTOR,(n.contentType===As.IMPLICIT_SUBTREE||n.contentType===As.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0,e.hasRenderableContent=!1),n.contentType===As.EXTERNAL_TILESET&&(e.hasTilesetContent=!0,e.hasRenderableContent=!1);let o,r=ib[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 a=e._contentHeader;if(e.hasImplicitContentMetadata){let c=e.implicitSubtree,u=e.implicitCoordinates;o.metadata=c.getContentMetadataView(u,0)}else e.hasImplicitContent||(o.metadata=ob(i,a));let s=rb(i,a);return l(s)&&(o.group=new c0({metadata:s})),o}Pr.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};Pr.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=_r.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 jAe=new le;function zX(e,t){if(t.mode!==oe.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=le.projectTo2D(n,t.mapProjection,jAe);e._boundingVolume2D=new Wg(i.center,i.radius)}return t.mode!==oe.SCENE3D?e._boundingVolume2D:e._boundingVolume}function Vit(e,t){if(t.mode!==oe.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=le.projectTo2D(n,t.mapProjection,jAe);e._contentBoundingVolume2D=new Wg(i.center,i.radius)}return t.mode!==oe.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}Pr.prototype.visibility=function(e,t){let n=e.cullingVolume,i=zX(this,e),o=this._tileset,r=o.clippingPlanes;if(l(r)&&r.enabled){let s=r.computeIntersectionWithBoundingVolume(i,o.clippingPlanesOriginMatrix);if(this._isClipped=s!==Xt.INSIDE,s===Xt.OUTSIDE)return Ka.MASK_OUTSIDE}let a=o.clippingPolygons;if(l(a)&&a.enabled){let s=a.computeIntersectionWithBoundingVolume(i);this._isClippedByPolygon=s!==Xt.OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};Pr.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return Xt.INSIDE;if(this._visibilityPlaneMask===Ka.MASK_INSIDE)return Xt.INSIDE;let t=e.cullingVolume,n=Vit(this,e),i=this._tileset,o=i.clippingPlanes;if(l(o)&&o.enabled){let a=o.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=a!==Xt.INSIDE,a===Xt.OUTSIDE)return Xt.OUTSIDE}let r=i.clippingPolygons;if(l(r)&&r.enabled){let a=r.computeIntersectionWithBoundingVolume(n);if(this._isClippedByPolygon=a!==Xt.OUTSIDE,a===Xt.INSIDE)return Xt.OUTSIDE}return t.computeVisibility(n)};Pr.prototype.distanceToTile=function(e){return zX(this,e).distanceToCamera(e)};var Hit=new d;Pr.prototype.distanceToTileCenter=function(e){let n=zX(this,e).boundingVolume,i=d.subtract(n.center,e.camera.positionWC,Hit);return d.dot(e.camera.directionWC,i)};Pr.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var YAe=new J,qAe=new d,Wit=new J,GX=new d,KAe=new ce,XAe=new en,UX=new M;function jit(e,t,n){let i=d.fromElements(e[0],e[1],e[2],GX),o=J.fromArray(e,3,Wit);i=M.multiplyByPoint(t,i,i);let r=M.getMatrix3(t,YAe);return o=J.multiply(r,o,o),l(n)?(n.update(i,o),n):new Ou(i,o)}function zAe(e,t,n,i){let o=ce.unpack(e,0,KAe),r=e[4],a=e[5],s=en.fromRectangle(o,r,a,te.WGS84,XAe),c=s.center,u=s.halfAxes;t=M.multiplyTransformation(t,M.inverseTransformation(n,UX),UX),c=M.multiplyByPoint(t,c,c);let f=M.getMatrix3(t,YAe);return u=J.multiply(f,u,u),l(i)&&i instanceof Ou?(i.update(c,u),i):new Ou(c,u)}function Yit(e,t,n,i){if(!M.equalsEpsilon(t,n,D.EPSILON8))return i instanceof Ou?zAe(e,t,n,i):zAe(e,t,n,void 0);let o=ce.unpack(e,0,KAe);return i instanceof Df?(i.rectangle=ce.clone(o,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(te.WGS84),i):new Df({rectangle:o,minimumHeight:e[4],maximumHeight:e[5]})}function qit(e,t,n){let i=d.fromElements(e[0],e[1],e[2],GX),o=e[3];i=M.multiplyByPoint(t,i,i);let r=M.getScale(t,qAe),a=d.maximumComponent(r);return o*=a,l(n)?(n.update(i,o),n):new Wg(i,o)}Pr.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,o;if(l(i)&&(o=wy.parseBoundingVolumeSemantic("TILE",i)),l(o)&&(e=o),!l(e))throw new ue("boundingVolume must be defined");if(xi(e,"3DTILES_bounding_volume_S2"))return new uF(e.extensions["3DTILES_bounding_volume_S2"]);let{box:r,region:a,sphere:s}=e;if(l(r)){let c=jit(r,t,n);return this._verticalExaggeration!==1&&GAe(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c}if(l(a)){let c=Yit(a,t,this._initialTransform,n);return this._verticalExaggeration===1||(c instanceof Ou?GAe(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight):(c.minimumHeight=xo.getHeight(c.minimumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.maximumHeight=xo.getHeight(c.maximumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.computeBoundingVolumes(te.WGS84))),c}if(l(s)){let c=qit(s,t,n);if(this._verticalExaggeration!==1){let u=xo.getPosition(c.center,te.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,GX),f=c.radius*this._verticalExaggeration;c.update(u,f)}return c}throw new ue("boundingVolume must contain a sphere, region, or box")};var Kit=d.unpackArray(new Array(24).fill(0));function GAe(e,t,n){let i=e.boundingVolume.computeCorners(Kit).map(r=>xo.getPosition(r,te.WGS84,t,n,r)),o=en.fromPoints(i,XAe);e.update(o.center,o.halfAxes)}Pr.prototype.updateTransform=function(e,t){e=e??M.IDENTITY;let n=M.multiplyTransformation(e,this.transform,UX),i=!M.equals(n,this.computedTransform),o=l(t)&&(this._verticalExaggeration!==t.verticalExaggeration||this._verticalExaggerationRelativeHeight!==t.verticalExaggerationRelativeHeight);if(!i&&!o)return;i&&M.clone(n,this.computedTransform),o&&(this._verticalExaggeration=t.verticalExaggeration,this._verticalExaggerationRelativeHeight=t.verticalExaggerationRelativeHeight);let r=this._header,a=this._contentHeader;this._boundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform,this._boundingVolume),l(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(a.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()};Pr.prototype.updateGeometricErrorScale=function(){let e=M.getScale(this.computedTransform,qAe),t=d.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function Xit(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=z.WHITE:c=z.DARKGRAY:c=z.YELLOW,l(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(c)),e._debugBoundingVolume.update(n);let u=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");u.color=Jt.toValue(c,u.color)}else!r&&l(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&o?(l(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(z.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(z.YELLOW)),e._debugViewerRequestVolume.update(n)):!t.debugShowViewerRequestVolume&&l(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());let a=t.debugColorizeTiles&&!e._debugColorizeTiles||l(t._heatmap.tilePropertyName),s=!t.debugColorizeTiles&&e._debugColorizeTiles;a?(t._heatmap.colorize(e,n),e._debugColorizeTiles=!0,e.color=e._debugColor):s&&(e._debugColorizeTiles=!1,e.color=z.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),s&&t.makeStyleDirty()}function Jit(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=_r.FAILED,o}}function Zit(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 $it(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)}Pr.prototype.update=function(e,t,n){let{commandList:i}=t,o=i.length;Zit(this,e),$it(this,e),Xit(this,e,t,n),Jit(this,e,t);let r=i.length;this._commandsLength=r-o;for(let a=o;a<r;++a){let s=i[a],c=s.pass===Be.TRANSLUCENT;s.depthForTranslucentClassification=c}this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1};var VAe=[];Pr.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(Fit(this),this._selectedFrame=0,this.lastStyleTime=0,X.now(this._loadTimestamp),this._contentState=_r.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=VAe;try{this._content.update(e,t)}catch(i){throw this._contentState=_r.FAILED,i}VAe.length=0,t.commandList=n};function HAe(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function W8(e,t,n){return Math.max(D.normalize(e,t,n)-D.EPSILON7,0)}Pr.prototype.updatePriority=function(){let e=this.tileset,t=e.preferLeaves,n=e._minimumPriority,i=e._maximumPriority,o=4,r=1,a=0,s=o,c=a+s,u=o,f=c+u,h=r,p=Math.pow(10,f),A=f+h,m=r,_=Math.pow(10,A),y=A+m,C=Math.pow(10,y),E=W8(this._depth,n.depth,i.depth);E=t?1-E:E;let x=!e.isSkippingLevelOfDetail&&this.refine===mr.REPLACE?W8(this._priorityHolder._distanceToCamera,n.distance,i.distance):W8(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),S=HAe(x,s,a),B=this._priorityProgressiveResolution?0:p,v=W8(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),P=HAe(v,u,c),N=this.priorityDeferred?_:0,L=e._pass===cr.PRELOAD_FLIGHT?0:C;this._priority=E+S+B+P+N+L};Pr.prototype.isDestroyed=function(){return!1};Pr.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(),fe(this)};var Wd=Pr;function jg(e){e=e??V.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(jg.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}}});jg.prototype.hasProperty=function(e){return qn.hasProperty(e,this._properties,this._class)};jg.prototype.hasPropertyBySemantic=function(e){return qn.hasPropertyBySemantic(e,this._properties,this._class)};jg.prototype.getPropertyIds=function(e){return qn.getPropertyIds(this._properties,this._class,e)};jg.prototype.getProperty=function(e){return qn.getProperty(e,this._properties,this._class)};jg.prototype.setProperty=function(e,t){return qn.setProperty(e,t,this._properties,this._class)};jg.prototype.getPropertyBySemantic=function(e){return qn.getPropertyBySemantic(e,this._properties,this._class)};jg.prototype.setPropertyBySemantic=function(e,t){return qn.setPropertyBySemantic(e,t,this._properties,this._class)};var gS=jg;function Yg(e){e=e??V.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(Yg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Yg.prototype.hasProperty=function(e){return qn.hasProperty(e,this._properties,this._class)};Yg.prototype.hasPropertyBySemantic=function(e){return qn.hasPropertyBySemantic(e,this._properties,this._class)};Yg.prototype.getPropertyIds=function(e){return qn.getPropertyIds(this._properties,this._class,e)};Yg.prototype.getProperty=function(e){return qn.getProperty(e,this._properties,this._class)};Yg.prototype.setProperty=function(e,t){return qn.setProperty(e,t,this._properties,this._class)};Yg.prototype.getPropertyBySemantic=function(e){return qn.getPropertyBySemantic(e,this._properties,this._class)};Yg.prototype.setPropertyBySemantic=function(e,t){return qn.setPropertyBySemantic(e,t,this._properties,this._class)};var fF=Yg;function JAe(e){e=e??V.EMPTY_OBJECT;let t=e.metadataJson,n=e.schema,i=t.metadata??t.tileset,o;l(i)&&(o=new fF({tileset:i,class:n.classes[i.class]}));let r=[],a=[],s=t.groups;if(Array.isArray(s)){let c=s.length;for(let u=0;u<c;u++){let f=s[u];a.push(new gS({group:f,class:n.classes[f.class]}))}}else if(l(s)){r=Object.keys(s).sort();let c=r.length;for(let u=0;u<c;u++){let f=r[u];if(s.hasOwnProperty(f)){let h=s[f];a.push(new gS({id:f,group:s[f],class:n.classes[h.class]}))}}}this._schema=n,this._groups=a,this._groupIds=r,this._tileset=o,this._statistics=t.statistics,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(JAe.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 hb=JAe;var ZAe={},eot=new d;ZAe.checkChildrenWithinParent=function(e){let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof Ou||i instanceof Df){let o=i._orientedBoundingBox;e._optimChildrenWithinParent=Ud.USE_OPTIMIZATION;for(let r=0;r<n;++r){let s=t[r].boundingVolume;if(!(s instanceof Ou||s instanceof Df)){e._optimChildrenWithinParent=Ud.SKIP_OPTIMIZATION;break}let c=s._orientedBoundingBox,u=d.subtract(c.center,o.center,eot),f=d.magnitude(u);d.divideByScalar(u,f,u);let h=Math.abs(o.halfAxes[0]*u.x)+Math.abs(o.halfAxes[1]*u.y)+Math.abs(o.halfAxes[2]*u.z)+Math.abs(o.halfAxes[3]*u.x)+Math.abs(o.halfAxes[4]*u.y)+Math.abs(o.halfAxes[5]*u.z)+Math.abs(o.halfAxes[6]*u.x)+Math.abs(o.halfAxes[7]*u.y)+Math.abs(o.halfAxes[8]*u.z),p=Math.abs(c.halfAxes[0]*u.x)+Math.abs(c.halfAxes[1]*u.y)+Math.abs(c.halfAxes[2]*u.z)+Math.abs(c.halfAxes[3]*u.x)+Math.abs(c.halfAxes[4]*u.y)+Math.abs(c.halfAxes[5]*u.z)+Math.abs(c.halfAxes[6]*u.x)+Math.abs(c.halfAxes[7]*u.y)+Math.abs(c.halfAxes[8]*u.z);if(h<=p+f){e._optimChildrenWithinParent=Ud.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===Ud.USE_OPTIMIZATION};var dF=ZAe;function hF(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(hF.prototype,{length:{get:function(){return this._length}}});function tot(e,t,n){this.item=e,this.previous=t,this.next=n}hF.prototype.add=function(e){let t=new tot(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 $Ae(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}hF.prototype.remove=function(e){l(e)&&($Ae(this,e),--this._length)};hF.prototype.splice=function(e,t){if(e===t)return;$Ae(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 mF=hF;function mb(){this._list=new mF,this._sentinel=this._list.add(),this._trimTiles=!1}mb.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};mb.prototype.touch=function(e){let t=e.cacheNode;l(t)&&this._list.splice(this._sentinel,t)};mb.prototype.add=function(e){l(e.cacheNode)||(e.cacheNode=this._list.add(e))};mb.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;l(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};mb.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 a=r.item;r=r.next,this.unloadTile(e,a,t)}};mb.prototype.trim=function(){this._trimTiles=!0};var pF=mb;function j8(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 HX(e,t){let n;return t==="_loadTimestamp"?n=X.toDate(e).getTime():n=e,n}j8.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=HX(e,n),this._referenceMaximum[n]=HX(t,n)};function not(e,t){let n=e.tilePropertyName;if(l(n)){let i=HX(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 VX=[new z(.1,.1,.1,1),new z(.153,.278,.878,1),new z(.827,.231,.49,1),new z(.827,.188,.22,1),new z(1,.592,.259,1),new z(1,.843,0,1)];j8.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=not(this,e),o=this._previousMinimum,r=this._previousMaximum;if(o===Number.MAX_VALUE||r===-Number.MAX_VALUE)return;let a=r-o+D.EPSILON7,c=D.clamp(i-o,0,a)/a,u=VX.length-1,f=c*u,h=Math.floor(f),p=Math.ceil(f),A=f-h,m=VX[h],_=VX[p],y=z.clone(z.WHITE);y.red=D.lerp(m.red,_.red,A),y.green=D.lerp(m.green,_.green,A),y.blue=D.lerp(m.blue,_.blue,A),e._debugColor=y};j8.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 AF=j8;function _S(){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.texturesReferenceCounterById={},this.batchTableByteLength=0}_S.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};_S.prototype.incrementSelectionCounts=function(e){this.numberOfFeaturesSelected+=e.featuresLength,this.numberOfPointsSelected+=e.pointsLength,this.numberOfTrianglesSelected+=e.trianglesLength;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementSelectionCounts(t[i])}};_S.prototype.incrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded+=e.featuresLength,this.numberOfPointsLoaded+=e.pointsLength,this.geometryByteLength+=e.geometryByteLength,this.batchTableByteLength+=e.batchTableByteLength,!(e instanceof Tf))this.texturesByteLength+=e.texturesByteLength;else{let n=e.getTextureIds();for(let i of n){let o=this.texturesReferenceCounterById[i]??0;if(o===0){let r=e.getTextureByteLengthById(i);this.texturesByteLength+=r}this.texturesReferenceCounterById[i]=o+1}}let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementLoadCounts(t[i])}};_S.prototype.decrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded-=e.featuresLength,this.numberOfPointsLoaded-=e.pointsLength,this.geometryByteLength-=e.geometryByteLength,this.batchTableByteLength-=e.batchTableByteLength,!(e instanceof Tf))this.texturesByteLength-=e.texturesByteLength;else{let n=e.getTextureIds();for(let i of n){let o=this.texturesReferenceCounterById[i];if(o===1){delete this.texturesReferenceCounterById[i];let r=e.getTextureByteLengthById(i);this.texturesByteLength-=r}else this.texturesReferenceCounterById[i]=o-1}}let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.decrementLoadCounts(t[i])}};_S.clone=function(e,t){t.selected=e.selected,t.visited=e.visited,t.numberOfCommands=e.numberOfCommands,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.texturesReferenceCounterById={...e.texturesReferenceCounterById},t.batchTableByteLength=e.batchTableByteLength};var dm=_S;function gF(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(gF.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});gF.prototype.makeDirty=function(){this._styleDirty=!0};gF.prototype.resetDirty=function(){this._styleDirty=!1};gF.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 a=0;a<r;++a){let s=o[a];if(s.lastStyleTime!==n){let c=s.content;s.lastStyleTime=n,c.applyStyle(this._style),i.numberOfFeaturesStyled+=c.featuresLength,++i.numberOfTilesStyled}}};var _F=gF;function iot(e,t,n){let i=xi(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)&&!xi(o,"3DTILES_bounding_volume_S2")&&!xi(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 De({url:i.subtrees.uri}),this.contentUriTemplates=[],this.contentHeaders=[];let r=oot(t);for(let a=0;a<r.length;a++){let s=r[a];this.contentHeaders.push(je(s,!0));let c=new De({url:s.uri});this.contentUriTemplates.push(c)}this.contentCount=this.contentHeaders.length,this.tileHeader=rot(t),this.subdivisionScheme=Na[i.subdivisionScheme],this.branchingFactor=Na.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,l(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function oot(e){if(xi(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 rot(e){let t=je(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 Rp=iot;var yF={};function ege(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function WX(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function tge(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 jX(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}yF.encode2D=function(e,t){return(ege(e)|ege(t)<<1)>>>0};yF.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=tge(e),t[1]=tge(e>>1),t};yF.encode3D=function(e,t,n){return WX(e)|WX(t)<<1|WX(n)<<2};yF.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=jX(e),t[1]=jX(e>>1),t[2]=jX(e>>2),t};var oC=yF;function yr(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===Na.OCTREE&&(this.z=e.z)}Object.defineProperties(yr.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===Na.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===Na.OCTREE?oC.encode3D(this.x,this.y,this.z):oC.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===Na.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});yr.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===Na.OCTREE){let o=(this.z<<e.level)+e.z;return new yr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new yr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};yr.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===Na.OCTREE){let r=Math.floor(this.z/t);return new yr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o,z:r})}return new yr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o})};yr.prototype.getOffsetCoordinates=function(e){let t=e.level-this.level,n=1<<t,i=e.x%n,o=e.y%n;if(this.subdivisionScheme===Na.OCTREE){let r=e.z%n;return new yr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o,z:r})}return new yr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o})};yr.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===Na.OCTREE){let o=2*this.z+Math.floor(e/4)%2;return new yr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new yr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};yr.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};yr.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};yr.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===Na.OCTREE){let a=e.z>>t,s=this.z===a;return o&&r&&s}return o&&r};yr.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===Na.OCTREE?this.z===e.z:!0)};yr.prototype.isImplicitTilesetRoot=function(){return this.level===0};yr.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};yr.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};yr.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===Na.OCTREE&&(e.z=this.z),e};var nge=[0,0,0];yr.fromMortonIndex=function(e,t,n,i){let o;return e===Na.OCTREE?(o=oC.decode3D(i,nge),new yr({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1],z:o[2]})):(o=oC.decode2D(i,nge),new yr({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1]}))};yr.fromTileIndex=function(e,t,n){let i,o,r;return e===Na.OCTREE?(i=Math.floor(D.log2(7*n+1)/3),o=((1<<3*i)-1)/7,r=n-o):(i=Math.floor(D.log2(3*n+1)/2),o=((1<<2*i)-1)/3,r=n-o),yr.fromMortonIndex(e,t,i,r)};var Mp=yr;function qg(){}qg.selectTiles=function(e,t){de.throwInstantiationError()};qg.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};qg.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};qg.selectTile=function(e,t){if(e.contentVisibility(t)===Xt.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)};qg.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};qg.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};qg.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!aot(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function aot(e,t){let{tileset:n}=e;if(!n._cullRequestsWhileMoving)return!0;let{positionWCDeltaMagnitude:i,positionWCDeltaMagnitudeLastFrame:o}=t.camera,r=i!==0?i:o,a=Math.max(e.boundingSphere.radius*2,1);return n.cullRequestsWhileMovingMultiplier*r/a<1}qg.updateTile=function(e,t){ige(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,lot(e),e._shouldSelect=!1,e._finalResolution=!0};function ige(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];ige(r,t),e._visible=r._visible;return}if(sot(e,t)){e._visible=!1;return}let i=e.refine===mr.REPLACE,o=e._optimChildrenWithinParent===Ud.USE_OPTIMIZATION;if(i&&o&&n&&!cot(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function sot(e,t){let{parent:n,tileset:i}=e;return!l(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==mr.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function cot(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 lot(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 Gs=qg;function oge(){}var CF={stack:new zl,stackMaximumLength:0};oge.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}=Gs,a=CF.stack;for(a.push(i);a.length>0;){CF.stackMaximumLength=Math.max(CF.stackMaximumLength,a.length);let s=a.pop(),c=s.refine===mr.ADD,u=s.refine===mr.REPLACE,f=uot(s);f&&fot(s,a,t),(c||u&&!f)&&(dot(e,s),o(s,t),hot(s,t),s.hasRenderableContent&&!s.contentAvailable&&(n=!1)),r(s,t)}return CF.stack.trim(CF.stackMaximumLength),n};function uot(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function fot(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 dot(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function hot(e,t){e.contentAvailable&&e.contentVisibility(t)!==Xt.OUTSIDE&&e.tileset._selectedTiles.push(e)}var EF=oge;function rge(){}var bF={stack:new zl,stackMaximumLength:0},IF={stack:new zl,stackMaximumLength:0};rge.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(Gs.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;pot(n,t),bF.stack.trim(bF.stackMaximumLength),IF.stack.trim(IF.stackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function YX(e,t){e.contentAvailable&&Gs.selectTile(e,t)}function mot(e,t,n){let i=e.refine===mr.REPLACE,{tileset:o,children:r}=e,{updateTile:a,loadTile:s,touchTile:c}=Gs;for(let m=0;m<r.length;++m)a(r[m],n);r.sort(Gs.sortChildrenByDistanceToCamera);let u=i&&e.hasRenderableContent,f=!0,h=!1,p=-1,A=Number.MAX_VALUE;for(let m=0;m<r.length;++m){let _=r[m];if(_.isVisible?(t.push(_),_._foveatedFactor<A&&(p=m,A=_._foveatedFactor),h=!0):(u||o.loadSiblings)&&(_._foveatedFactor<A&&(p=m,A=_._foveatedFactor),s(_,n),c(_,n)),u){let y;_._inRequestVolume?_.hasRenderableContent?y=_.contentAvailable:y=Aot(_,n):y=!1,f=f&&y}}if(h||(f=!1),p!==-1&&i){let m=r[p];m._wasMinPriorityChild=!0;let _=(e._wasMinPriorityChild||e===o.root)&&A<=e._priorityHolder._foveatedFactor?e._priorityHolder:e;_._foveatedFactor=Math.min(m._foveatedFactor,_._foveatedFactor),_._distanceToCamera=Math.min(m._distanceToCamera,_._distanceToCamera);for(let y=0;y<r.length;++y)r[y]._priorityHolder=_}return f}function pot(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:o,visitTile:r,touchTile:a}=Gs,s=bF.stack;for(s.push(e);s.length>0;){bF.stackMaximumLength=Math.max(bF.stackMaximumLength,s.length);let c=s.pop(),u=c.parent,f=!l(u)||u._refines;c._refines=i(c)?mot(c,s,t)&&f:!1;let h=!c._refines&&f;c.hasRenderableContent?c.refine===mr.ADD?(YX(c,t),o(c,t)):c.refine===mr.REPLACE&&(o(c,t),h&&YX(c,t)):(n._emptyTiles.push(c),o(c,t),h&&YX(c,t)),r(c,t),a(c,t)}}function Aot(e,t){let{canTraverse:n,updateTile:i,loadTile:o,touchTile:r}=Gs,a=!0,s=IF.stack;for(s.push(e);s.length>0;){IF.stackMaximumLength=Math.max(IF.stackMaximumLength,s.length);let c=s.pop(),u=c.children,f=u.length,h=!c.hasRenderableContent&&n(c);if(!h&&!c.contentAvailable&&(a=!1),i(c,t),c.isVisible||(o(c,t),r(c,t)),h)for(let p=0;p<f;++p){let A=u[p];s.push(A)}}return e.hasEmptyContent||a}var xF=rge;function age(){}var TF={stack:new zl,stackMaximumLength:0},SF={stack:new zl,stackMaximumLength:0},Kg={stack:new zl,stackMaximumLength:0,ancestorStack:new zl,ancestorStackMaximumLength:0},got=2;age.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(Gs.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;Iot(n,t),xot(n,t),TF.stack.trim(TF.stackMaximumLength),SF.stack.trim(SF.stackMaximumLength),Kg.stack.trim(Kg.stackMaximumLength),Kg.ancestorStack.trim(Kg.ancestorStackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function _ot(e,t){let{updateTile:n,touchTile:i,selectTile:o}=Gs,r=SF.stack;for(r.push(e);r.length>0;){SF.stackMaximumLength=Math.max(SF.stackMaximumLength,r.length);let s=r.pop().children;for(let c=0;c<s.length;++c){let u=s[c];u.isVisible&&(u.contentAvailable?(n(u,t),i(u,t),o(u,t)):u._depth-e._depth<got&&r.push(u))}}}function Y8(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;l(n)?n._shouldSelect=!0:_ot(e,t)}function yot(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 Cot(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 Eot(e,t,n){let{tileset:i,children:o}=e,{updateTile:r,loadTile:a,touchTile:s}=Gs;for(let u=0;u<o.length;++u)r(o[u],n);o.sort(Gs.sortChildrenByDistanceToCamera);let c=!1;for(let u=0;u<o.length;++u){let f=o[u];f.isVisible?(t.push(f),c=!0):i.loadSiblings&&(a(f,n),s(f,n))}return c}function bot(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 Iot(e,t){let{tileset:n}=e,i=n.immediatelyLoadDesiredLevelOfDetail?Number.MAX_VALUE:Math.max(n.baseScreenSpaceError,n.memoryAdjustedScreenSpaceError),{canTraverse:o,loadTile:r,visitTile:a,touchTile:s}=Gs,c=TF.stack;for(c.push(e);c.length>0;){TF.stackMaximumLength=Math.max(TF.stackMaximumLength,c.length);let u=c.pop();yot(u,t);let f=u.parent,h=!l(f)||f._refines;u._refines=o(u)?Eot(u,c,t)&&h:!1;let p=!u._refines&&h;u.hasRenderableContent?u.refine===mr.ADD?(Y8(u,t),r(u,t)):u.refine===mr.REPLACE&&(bot(u,i)?(r(u,t),p&&Y8(u,t)):p?(Y8(u,t),r(u,t)):Cot(n,u)&&r(u,t)):(n._emptyTiles.push(u),r(u,t),p&&Y8(u,t)),a(u,t),s(u,t)}}function xot(e,t){let{selectTile:n,canTraverse:i}=Gs,{stack:o,ancestorStack:r}=Kg,a;for(o.push(e);o.length>0||r.length>0;){if(Kg.stackMaximumLength=Math.max(Kg.stackMaximumLength,o.length),Kg.ancestorStackMaximumLength=Math.max(Kg.ancestorStackMaximumLength,r.length),r.length>0){let u=r.peek();if(u._stackLength===o.length){r.pop(),u!==a&&(u._finalResolution=!1),n(u,t);continue}}let s=o.pop();if(!l(s))continue;let c=i(s);if(s._shouldSelect)if(s.refine===mr.ADD)n(s,t);else{if(s._selectionDepth=r.length,s._selectionDepth>0&&(s.tileset.hasMixedContent=!0),a=s,!c){n(s,t);continue}r.push(s),s._stackLength=o.length}if(c){let u=s.children;for(let f=0;f<u.length;++f){let h=u[f];h.isVisible&&o.push(h)}}}}var wF=age;function $a(){this._layers=[],this.layerAdded=new _e,this.layerRemoved=new _e,this.layerMoved=new _e,this.layerShownOrHidden=new _e}Object.defineProperties($a.prototype,{length:{get:function(){return this._layers.length}}});$a.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()})};$a.prototype.addImageryProvider=function(e,t){let n=new ga(e);return this.add(n,t),n};$a.prototype.remove=function(e,t){t=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};$a.prototype.removeAll=function(e){e=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=[]};$a.prototype.contains=function(e){return this.indexOf(e)!==-1};$a.prototype.indexOf=function(e){return this._layers.indexOf(e)};$a.prototype.get=function(e){return this._layers[e]};function q8(e,t){return e.indexOf(t)}function sge(e,t,n){let i=e._layers;if(t=D.clamp(t,0,i.length-1),n=D.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)}$a.prototype.raise=function(e){let t=q8(this._layers,e);sge(this,t,t+1)};$a.prototype.lower=function(e){let t=q8(this._layers,e);sge(this,t,t-1)};$a.prototype.raiseToTop=function(e){let t=q8(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))};$a.prototype.lowerToBottom=function(e){let t=q8(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 Tot=new ce;function qX(e,t,n,i){let o=e.globe._surface._tilesToRender,r;for(let s=0;!l(r)&&s<o.length;++s){let c=o[s];ce.contains(c.rectangle,t)&&(r=c)}if(!l(r))return;let a=r.data.imagery;for(let s=a.length-1;s>=0;--s){let c=a[s],u=c.readyImagery;if(!l(u)||!u.imageryLayer.ready)continue;let f=u.imageryLayer.imageryProvider;if(n&&!l(f.pickFeatures)||!ce.contains(u.rectangle,t))continue;let h=Tot,p=1/1024;h.west=D.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.x-p),h.east=D.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.z+p),h.south=D.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.y-p),h.north=D.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.w+p),ce.contains(h,t)&&i(u)}}$a.pickImageryHelper=qX;$a.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[];if(qX(t,i,!1,function(r){o.push(r.imageryLayer)}),o.length!==0)return o};$a.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(qX(t,i,!0,function(a){if(!a.imageryLayer.ready)return;let s=a.imageryLayer.imageryProvider;for(let u=0;u<r.length;u++)if(r[u]===a.imageryLayer)return;let c=s.pickFeatures(a.x,a.y,a.level,i.longitude,i.latitude);l(c)&&(o.push(c),r.push(a.imageryLayer))}),o.length!==0)return Promise.all(o).then(function(a){let s=[];for(let c=0;c<a.length;++c){let u=a[c],f=r[c];if(l(u)&&u.length>0)for(let h=0;h<u.length;++h){let p=u[h];p.imageryLayer=f,l(p.position)||(p.position=i),s.push(p)}}return s})};$a.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};$a.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};$a.prototype.isDestroyed=function(){return!1};$a.prototype.destroy=function(){return this.removeAll(!0),fe(this)};$a.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 pb=$a;function lr(e){e=e??V.EMPTY_OBJECT,this._marsOptions=e.marsOptions??{},this._url=void 0,this._basePath=void 0,this._root=void 0,this._resource=void 0,this._asset=void 0,this._properties=void 0,this._geometricError=void 0,this._scaledGeometricError=void 0,this._extensionsUsed=void 0,this._extensions=void 0,this._modelUpAxis=void 0,this._modelForwardAxis=void 0,this._cache=new pF,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=e.showCreditsOnScreen??!1,this._cullWithChildrenBounds=e.cullWithChildrenBounds??!0,this._allTilesAdditive=!0,this._hasMixedContent=!1,this._stencilClearCommand=void 0,this._backfaceCommands=new zl,this._maximumScreenSpaceError=e.maximumScreenSpaceError??16,this._memoryAdjustedScreenSpaceError=this._maximumScreenSpaceError,this._cacheBytes=e.cacheBytes??512*1024*1024;let t=e.maximumCacheOverflowBytes??512*1024*1024;this._maximumCacheOverflowBytes=t,this._styleEngine=new _F,this._styleApplied=!1,this._modelMatrix=l(e.modelMatrix)?M.clone(e.modelMatrix):M.clone(M.IDENTITY),this._addHeightCallbacks=[],this._statistics=new dm,this._statisticsLast=new dm,this._statisticsPerPass=new Array(cr.NUMBER_OF_PASSES);for(let o=0;o<cr.NUMBER_OF_PASSES;++o)this._statisticsPerPass[o]=new dm;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 AF(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=e.cullRequestsWhileMoving??!0,this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=e.cullRequestsWhileMovingMultiplier??60,this.progressiveResolutionHeightFraction=D.clamp(e.progressiveResolutionHeightFraction??.3,0,.5),this.preferLeaves=e.preferLeaves??!1,this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._classificationType=e.classificationType,this._heightReference=e.heightReference,this._scene=e.scene,this._ellipsoid=e.ellipsoid??te.WGS84,this._initialClippingPlanesOriginMatrix=M.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=e.vectorClassificationOnly??!1,this._vectorKeepDecodedPositions=e.vectorKeepDecodedPositions??!1,this._imageryLayers=new pb(this),this._imageryLayersModificationCounter=0,this._imageryLayersListener=()=>{this._imageryLayersModificationCounter++},this.imageryLayers.layerAdded.addEventListener(this._imageryLayersListener),this.imageryLayers.layerRemoved.addEventListener(this._imageryLayersListener),this.imageryLayers.layerMoved.addEventListener(this._imageryLayersListener),this.imageryLayers.layerShownOrHidden.addEventListener(this._imageryLayersListener),this._asynchronouslyLoadImagery=e.asynchronouslyLoadImagery??!1,this.preloadWhenHidden=e.preloadWhenHidden??!1,this.preloadFlightDestinations=e.preloadFlightDestinations??!0,this._pass=void 0,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError??!0,this.foveatedScreenSpaceError=e.foveatedScreenSpaceError??!0,this._foveatedConeSize=e.foveatedConeSize??.1,this._foveatedMinimumScreenSpaceErrorRelaxation=e.foveatedMinimumScreenSpaceErrorRelaxation??0,this.foveatedInterpolationCallback=e.foveatedInterpolationCallback??D.lerp,this.foveatedTimeDelay=e.foveatedTimeDelay??.2,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity??2e-4,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor??24,this.dynamicScreenSpaceErrorHeightFalloff=e.dynamicScreenSpaceErrorHeightFalloff??.25,this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=e.shadows??wn.ENABLED,this.show=e.show??!0,this.colorBlendMode=Tu.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new Ep(e.pointCloudShading),this._pointCloudEyeDomeLighting=new hg,this.loadProgress=new _e,this.allTilesLoaded=new _e,this.initialTilesLoaded=new _e,this.tileLoad=new _e,this.tileUnload=new _e,this.tileFailed=new _e,this.tileVisible=new _e,this.skipLevelOfDetail=e.skipLevelOfDetail??!1,this._disableSkipLevelOfDetail=!1,this.baseScreenSpaceError=e.baseScreenSpaceError??1024,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor??16,this.skipLevels=e.skipLevels??1,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail??!1,this.loadSiblings=e.loadSiblings??!1,this._clippingPlanes=void 0,l(e.clippingPlanes)&&da.setOwner(e.clippingPlanes,this,"_clippingPlanes"),this._clippingPolygons=void 0,l(e.clippingPolygons)&&jh.setOwner(e.clippingPolygons,this,"_clippingPolygons"),l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new s0,this._shouldDestroyImageBasedLighting=!0),this._environmentMapManager=new ug(e.environmentMapOptions),this.lightColor=e.lightColor,this.backFaceCulling=e.backFaceCulling??!0,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??z.BLACK,this.splitDirection=e.splitDirection??Lr.NONE,this.enableCollision=e.enableCollision??!1,this._projectTo2D=e.projectTo2D??!1,this._enablePick=e.enablePick??!1,this.debugFreezeFrame=e.debugFreezeFrame??!1,this.debugColorizeTiles=e.debugColorizeTiles??!1,this._enableDebugWireframe=e.enableDebugWireframe??!1,this.debugWireframe=e.debugWireframe??!1,this.debugWireframe===!0&&this._enableDebugWireframe===!1&&It("tileset-debug-wireframe-ignored","enableDebugWireframe must be set to true in the Cesium3DTileset constructor, otherwise debugWireframe will be ignored."),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowContentBoundingVolume=e.debugShowContentBoundingVolume??!1,this.debugShowViewerRequestVolume=e.debugShowViewerRequestVolume??!1,this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=e.debugShowGeometricError??!1,this.debugShowRenderingStatistics=e.debugShowRenderingStatistics??!1,this.debugShowMemoryUsage=e.debugShowMemoryUsage??!1,this.debugShowUrl=e.debugShowUrl??!1,this.examineVectorLinesFunction=void 0,this._metadataExtension=void 0,this._customShader=e.customShader;let n=e.featureIdLabel??"featureId_0";typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=e.instanceFeatureIdLabel??"instanceFeatureId_0";typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i,this._initForMars3D&&this._initForMars3D(e)}Object.defineProperties(lr.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){da.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){jh.setOwner(e,this,"_clippingPolygons")}},imageryLayers:{get:function(){return this._imageryLayers}},imageryLayersModificationCounter:{get:function(){return this._imageryLayersModificationCounter}},asynchronouslyLoadImagery:{get:function(){return this._asynchronouslyLoadImagery}},properties:{get:function(){return this._properties}},tilesLoaded:{get:function(){return this._tilesLoaded}},resource:{get:function(){return this._resource}},basePath:{get:function(){return Ms("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=M.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&&(M.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):M.IDENTITY}},styleEngine:{get:function(){return this._styleEngine}},statistics:{get:function(){return this._statistics}},classificationType:{get:function(){return this._classificationType}},heightReference:{get:function(){return this._heightReference}},scene:{get:function(){return this._scene}},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)}},environmentMapManager:{get:function(){return this._environmentMapManager}},vectorClassificationOnly:{get:function(){return this._vectorClassificationOnly}},vectorKeepDecodedPositions:{get:function(){return this._vectorKeepDecodedPositions}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen=e,pge(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}}});lr.fromIonAssetId=async function(e,t){let n=await fa.fromAssetId(e);return lr.fromUrl(n,t)};lr.fromUrl=async function(e,t){t=t??V.EMPTY_OBJECT;let n=De.createIfNeeded(e),i;n.extension==="json"?i=n.getBaseUri(!0):n.isDataUri&&(i="");let o=await lr.loadJson(n),r=await Sot(n,o),a=new lr(t);a._resource=n,a._url=n.url,a._basePath=i,a._metadataExtension=r,a._geometricError=o.geometricError,a._scaledGeometricError=o.geometricError;let s=o.asset;a._asset=s,a._extras=o.extras,pge(a);let c=l(o.asset.gltfUpAxis)?ao.fromName(o.asset.gltfUpAxis):ao.Y,u=t.modelUpAxis??c,f=t.modelForwardAxis??ao.X;a._properties=o.properties,a._extensionsUsed=o.extensionsUsed,a._extensions=o.extensions,a._modelUpAxis=u,a._modelForwardAxis=f,a._root=a.loadTileset(n,o);let p=a._root.createBoundingVolume(o.root.boundingVolume,M.IDENTITY).boundingSphere.center,A=a._ellipsoid.cartesianToCartographic(p);return l(A)&&A.height>Di._defaultMinTerrainHeight&&(a._initialClippingPlanesOriginMatrix=At.eastNorthUpToFixedFrame(p)),a._clippingPlanesOriginMatrix=M.clone(a._initialClippingPlanesOriginMatrix),a};lr.loadJson=function(e){return De.createIfNeeded(e).fetchJson()};lr.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};lr.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)&&lr.checkSupportedExtensions(t.extensionsRequired);let o=this._statistics,r=i.tilesetVersion;l(r)&&(this._basePath+=`?v=${r}`,e=e.clone(),e.setQueryParameters({v:r}));let a=cge(this,e,t.root,n);l(n)&&(n.children.push(a),a._depth=n._depth+1);let s=[];for(s.push(a);s.length>0;){let c=s.pop();++o.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&c.refine===mr.ADD;let u=c._header.children;if(l(u))for(let f=0;f<u.length;++f){let h=u[f],p=cge(this,e,h,c);c.children.push(p),p._depth=c._depth+1,s.push(p)}this._cullWithChildrenBounds&&dF.checkChildrenWithinParent(c)}return a};function cge(e,t,n,i){if(!(l(n.implicitTiling)||xi(n,"3DTILES_implicit_tiling")))return new Wd(e,t,n,i);let r=e.schema,a=new Rp(t,n,r),s=new Mp({subdivisionScheme:a.subdivisionScheme,subtreeLevels:a.subtreeLevels,level:0,x:0,y:0,z:0}),c=a.subtreeUriTemplate.getDerivedResource({templateValues:s.getTemplateValues()}).url,f=je(n,!0);f.contents=[{uri:c}],delete f.content,delete f.extensions;let h=new Wd(e,t,f,i);return h.implicitTileset=a,h.implicitCoordinates=s,h}async function Sot(e,t){let n=xi(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(l(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=Ri.getSchemaLoader({resource:e});else if(l(n.schema))i=Ri.getSchemaLoader({schema:n.schema});else return;await i.load();let o=new hb({schema:i.schema,metadataJson:n});return Ri.unload(i),o}var lge=new d,wot=new me,Bot=new M,Dot=new d,vot=new d,Pot=new d,Rot=new d;function Mot(e,t){let n,i,o,r,a,s=t.camera,c=e._root,u=c.contentBoundingVolume;if(u instanceof Df)n=d.normalize(s.positionWC,lge),i=s.directionWC,o=s.positionCartographic.height,r=u.minimumHeight,a=u.maximumHeight;else{let _=M.inverseTransformation(c.computedTransform,Bot),y=t.mapProjection.ellipsoid,C=u.boundingVolume,E=M.multiplyByPoint(_,C.center,Dot);if(d.magnitude(E)>y.minimumRadius){let b=me.fromCartesian(E,y,wot);n=d.normalize(s.positionWC,lge),i=s.directionWC,o=s.positionCartographic.height,r=0,a=b.height*2}else{let b=M.multiplyByPoint(_,s.positionWC,vot);if(n=d.UNIT_Z,i=M.multiplyByPointAsVector(_,s.directionWC,Pot),i=d.normalize(i,i),o=b.z,u instanceof Ou){let x=J.getColumn(C.halfAxes,2,Rot),S=d.magnitude(x);r=E.z-S,a=E.z+S}else if(u instanceof Wg){let x=C.radius;r=E.z-x,a=E.z+x}}}let f=e.dynamicScreenSpaceErrorHeightFalloff,h=r+(a-r)*f,p=a,A=D.clamp((o-h)/(p-h),0,1),m=1-Math.abs(d.dot(i,n));m=m*(1-A),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*m}function Not(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=>{dge(r,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?qot(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function fge(e,t){return e._priority-t._priority}lr.prototype.postPassesUpdate=function(e){l(this._root)&&(Lot(this,e),Xot(this,e),this._cache.unloadTiles(this,mge),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};lr.prototype.prePassesUpdate=function(e){if(!l(this._root))return;Got(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=X.clone(e.time)),this._timeSinceLoad=Math.max(X.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&Mot(this,e),e.newFrame&&this._cache.reset()};function Lot(e,t){let n=e._requestedTilesInFlight,i=0;for(let o=0;o<n.length;++o){let r=n[o],a=t.frameNumber-r._touchedFrame>=1;if(r._contentState!==_r.LOADING){++i;continue}else if(a){r.cancelRequests(),++i;continue}i>0&&(n[o-i]=r)}n.length-=i}function Oot(e){let t=e._requestedTiles;t.sort(fge);for(let n=0;n<t.length;++n)Not(e,t[n])}function dge(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}`),console.log(e.stack))}function Fot(e){let t=e._processingQueue,n=0;for(let i=0;i<t.length;++i){let o=t[i];if(o.isDestroyed()||o._contentState!==_r.PROCESSING){++n;continue}n>0&&(t[i-n]=o)}t.length-=n}var Qot=new me,kot=new me,Uot=new d;function zot(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 a=r.ellipsoid,s=me.clone(r.positionCartographic,Qot),c=me.fromCartesian(o.center,a,kot);l(c)&&(s.height=c.height);let u=me.toCartesian(s,a,Uot);d.distance(u,o.center)<=o.radius&&(r.invoked=!0,n.afterRender.push(()=>{l(r.callback)&&r.callback(),r.invoked=!1}))}}function Got(e,t){Fot(e);let n=e._processingQueue,{cacheBytes:i,maximumCacheOverflowBytes:o,statistics:r}=e,a=i+o,s=!1;for(let c=0;c<n.length;++c){if(e.totalMemoryUsageInBytes>a){s=!0;break}let u=n[c];try{u.process(e,t),u.contentReady&&(--r.numberOfTilesProcessing,e.tileLoad.raiseEvent(u))}catch(f){--r.numberOfTilesProcessing,dge(f,e,u)}}e.totalMemoryUsageInBytes<i?Hot(e):s&&n.length>0&&Vot(e)}function Vot(e){e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n<t.length;++n)t[n].updatePriority();t.sort(fge)}function Hot(e){e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError)}var K8=new d,Wot={maximumFractionDigits:3};function uge(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,Wot):Math.round(t).toLocaleString()}function KX(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,o=d.clone(i,K8);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=d.normalize(i,K8);r=d.multiplyByScalar(r,.75*n,K8),o=d.add(r,i,K8)}return o}function XX(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: ${uge(e.content.texturesByteLength)}`,i+=`
Geometry Memory: ${uge(e.content.geometryByteLength)}`,o+=2),t.debugShowUrl)if(e.hasMultipleContents){i+=`
Urls:`;let a=e.content.innerContentUrls;for(let s=0;s<a.length;s++)i+=`
- ${a[s]}`;o+=a.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 jot(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 a=l(e.debugPickPosition)?e.debugPickPosition:KX(e.debugPickedTile),s=XX(e.debugPickedTile,e,a);s.pixelOffset=new k(15,-15)}}else{for(let a=0;a<i;++a){let s=n[a];XX(s,e,KX(s))}for(let a=0;a<r;++a){let s=o[a];(s.hasTilesetContent||s.hasImplicitContent)&&XX(s,e,KX(s))}}e._tileDebugLabels.update(t)}function Yot(e,t,n){e._styleEngine.applyStyle(e),e._styleApplied=!0;let{commandList:i,context:o}=t,r=i.length,a=e._selectedTiles,s=e.isSkippingLevelOfDetail&&e._hasMixedContent&&o.stencilBuffer&&a.length>0;e._backfaceCommands.length=0,s&&(l(e._stencilClearCommand)||(e._stencilClearCommand=new fi({stencil:0,pass:Be.CESIUM_3D_TILE,renderState:Ve.fromCache({stencilMask:Yt.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:c,tileVisible:u}=e,f=n.isRender,h=i.length;for(let m=0;m<a.length;++m){let _=a[m];f&&u.raiseEvent(_),zot(e,_,t),_.update(e,t,n),c.incrementSelectionCounts(_.content),++c.selected}let p=e._emptyTiles;for(let m=0;m<p.length;++m)p[m].update(e,t,n);let A=i.length-h;if(e._backfaceCommands.trim(),s){let m=e._backfaceCommands.values,_=m.length;i.length+=_;for(let y=A-1;y>=0;--y)i[h+_+y]=i[h+y];for(let y=0;y<_;++y)i[h+y]=m[y]}A=i.length-r,c.numberOfCommands=A,f&&(e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&A>0&&e._pointCloudEyeDomeLighting.update(t,r,e.pointCloudShading,e.boundingSphere),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(l(e._tileDebugLabels)||(e._tileDebugLabels=new Bp),jot(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var hge=[];function qot(e,t){let n=t,i=hge;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&&(Kot(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function mge(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function Kot(e,t){e._cache.unloadTile(e,t,mge),t.destroy()}lr.prototype.trimLoadedTiles=function(){this._cache.trim()};function Xot(e,t){let n=e._statistics,i=e._statisticsLast,o=n.numberOfPendingRequests,r=n.numberOfTilesProcessing,a=i.numberOfPendingRequests,s=i.numberOfTilesProcessing;dm.clone(n,i);let c=o!==a||r!==s;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 Jot(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 Zot(e,t){t.frameNumber===e._updatedModelMatrixFrame&&l(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!M.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=M.clone(e.modelMatrix,e._previousModelMatrix)))}function $ot(e,t,n,i){if(t.mode===oe.MORPHING||!l(e._root))return!1;let o=e._statistics;o.clear(),++e._updatedVisibilityFrame,Jot(e),Zot(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let r=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&Oot(e),Yot(e,t,i),dm.clone(o,n),i.isRender){let a=e._credits;if(l(a)&&o.selected!==0)for(let s=0;s<a.length;++s){let c=a[s];t.creditDisplay.addCreditToNextFrame(c)}}return r}function pge(e){let t=e._credits;l(t)||(t=[]),t.length=0,l(e.resource.credits)&&e.resource.credits.forEach(i=>{t.push(Et.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 Et(r.html))}}t.forEach(i=>i.showOnScreen=i.showOnScreen||e._showCreditsOnScreen),e._credits=t}lr.prototype.getTraversal=function(e){let{pass:t}=e;return t===cr.MOST_DETAILED_PRELOAD||t===cr.MOST_DETAILED_PICK?EF:this.isSkippingLevelOfDetail?wF:xF};lr.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};lr.prototype.updateForPass=function(e,t){this.imageryLayers._update();let n=t.pass;if(n===cr.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===cr.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===cr.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 a=cr.getPassOptions(n),s=a.ignoreCommands,c=t.commandList??i,u=c.length;if(e.commandList=c,e.camera=t.camera??o,e.cullingVolume=t.cullingVolume??r,a.isRender){let p=this._environmentMapManager;l(this._root)&&(p.position=this.boundingSphere.center),p.update(e)}let f=this._clippingPolygons;l(f)&&f.enabled&&f.queueCommands(e);let h=this._statisticsPerPass[n];(this.show||s)&&(this._pass=n,t.ready=$ot(this,e,h,a)),s&&(c.length=u),e.commandList=i,e.camera=o,e.cullingVolume=r};lr.prototype.hasExtension=function(e){return l(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};lr.prototype.isDestroyed=function(){return!1};lr.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=hge;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,this._environmentMapManager.isDestroyed()||this._environmentMapManager.destroy(),this._environmentMapManager=void 0,this._imageryLayers.isDestroyed()||(this.imageryLayers.layerAdded.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerRemoved.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerMoved.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerShownOrHidden.removeEventListener(this._imageryLayersListener),this._imageryLayers.destroy()),this._imageryLayers=void 0,fe(this)};lr.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,CESIUM_mesh_vector:!0,MAXAR_content_geojson:!0};lr.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!lr.supportedExtensions[e[t]])throw new ue(`Unsupported 3D Tiles Extension: ${e[t]}`)};var ert=new yn,trt=new d,nrt=new me;lr.prototype.getHeight=function(e,t){let n=t.ellipsoid;l(n)||(n=te.WGS84);let i=ert,o=n.cartographicToCartesian(e,i.direction);d.normalize(i.direction,i.direction),i.direction=d.normalize(o,i.direction),i.direction=d.negate(o,i.direction),i.origin=d.multiplyByScalar(i.direction,-2*n.maximumRadius,i.origin);let r=this.pick(i,t.frameState,trt);if(l(r))return n.cartesianToCartographic(r,nrt)?.height};lr.prototype.updateHeight=function(e,t,n){n=n??te.WGS84;let i={positionCartographic:e,ellipsoid:n,callback:t,invoked:!1},o=()=>{let r=this._addHeightCallbacks,a=r.length;for(let s=0;s<a;++s)if(r[s]===i){r.splice(s,1);break}i.callback&&(i.callback=void 0)};return this._addHeightCallbacks.push(i),o};var irt=new qr,ort=new d;lr.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 u=i[c],f=di.raySphere(e,u.contentBoundingVolume.boundingSphere,irt);!l(f)||!l(u.content)||r.push(u)}let a=r.length;r.sort((c,u)=>{let f=le.distanceSquaredTo(c.contentBoundingVolume.boundingSphere,e.origin),h=le.distanceSquaredTo(u.contentBoundingVolume.boundingSphere,e.origin);return f-h});let s;for(let c=0;c<a;++c){let f=r[c].content.pick(e,t,ort);if(l(f))return s=d.clone(f,n),s}};lr.prototype.isGltfExtensionUsed=function(e){if(this.hasExtension("3DTILES_content_gltf")){if(!l(this.extensions))return!1;let t=this.extensions["3DTILES_content_gltf"]?.extensionsUsed;return l(t)?t.indexOf(e)>-1:!1}return!1};lr.prototype.isGltfExtensionRequired=function(e){if(this.isGltfExtensionUsed(e)){let t=this.extensions["3DTILES_content_gltf"].extensionsRequired;return l(t)?t.indexOf(e)>-1:!1}return!1};var es=lr;var rrt=new M;function rC(e,t){t.collectionChanged.addEventListener(rC.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new Ot,this._onCollectionChanged(t,t.values,[],[])}rC.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 a=t[o],s=a._tileset,c,u=n[a.id],f=a.isShowing&&a.isAvailable(e)&&q.getValueOrDefault(s._show,e,!0),h;f&&(h=a.computeModelMatrix(e,rrt),c=De.createIfNeeded(q.getValueOrUndefined(s._uri,e)));let p=l(u)?u.tilesetPrimitive:void 0;if(!f){l(p)&&(p.show=!1);continue}(!l(u)||c.url!==u.url)&&(l(p)&&i.removeAndDestroy(p),delete n[a.id],art(c,n,a,i)),l(p)&&(p.show=!0,l(h)&&(p.modelMatrix=h),p.maximumScreenSpaceError=q.getValueOrDefault(s.maximumScreenSpaceError,e,p.maximumScreenSpaceError))}return!0};rC.prototype.isDestroyed=function(){return!1};rC.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(rC.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)JX(this,e[i],t,n);return fe(this)};rC.prototype.getBoundingSphere=function(e,t){let n=this._tilesetHash[e.id];if(!l(n)||n.loadFail)return Ct.FAILED;let i=n.tilesetPrimitive;return l(i)?i.show?(le.clone(i.boundingSphere,t),Ct.DONE):Ct.FAILED:Ct.PENDING};rC.prototype._onCollectionChanged=function(e,t,n,i){let o,r,a=this._entitiesToVisualize,s=this._tilesetHash,c=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],l(r._tileset)&&a.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],l(r._tileset)?a.set(r.id,r):(JX(this,r,s,c),a.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],JX(this,r,s,c),a.remove(r.id)};function JX(e,t,n,i){let o=n[t.id];l(o)&&(l(o.tilesetPrimitive)&&i.removeAndDestroy(o.tilesetPrimitive),delete n[t.id])}async function art(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let o=await es.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 BF=rC;var srt=z.WHITE,crt=z.BLACK,lrt=new k(2,2);function yS(e){e=e??V.EMPTY_OBJECT,this._definitionChanged=new _e,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(yS.prototype,{isConstant:{get:function(){return q.isConstant(this._evenColor)&&q.isConstant(this._oddColor)&&q.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:Ae("evenColor"),oddColor:Ae("oddColor"),repeat:Ae("repeat")});yS.prototype.getType=function(e){return"Checkerboard"};var urt=new X;yS.prototype.getValue=function(e,t){return l(e)||(e=X.now(urt)),l(t)||(t={}),t.lightColor=q.getValueOrClonedDefault(this._evenColor,e,srt,t.lightColor),t.darkColor=q.getValueOrClonedDefault(this._oddColor,e,crt,t.darkColor),t.repeat=q.getValueOrDefault(this._repeat,e,lrt),t};yS.prototype.equals=function(e){return this===e||e instanceof yS&&q.equals(this._evenColor,e._evenColor)&&q.equals(this._oddColor,e._oddColor)&&q.equals(this._repeat,e._repeat)};var CS=yS;var Age={id:void 0};function DF(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),a=i.values.slice(0);t.removeAll(),n.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,o,r,a)}while(e._refire);e._firing=!1}}}function rl(e){this._owner=e,this._entities=new Ot,this._addedEntities=new Ot,this._removedEntities=new Ot,this._changedEntities=new Ot,this._suspendCount=0,this._collectionChanged=new _e,this._id=Jn(),this._show=!0,this._firing=!1,this._refire=!1}rl.prototype.suspendEvents=function(){this._suspendCount++};rl.prototype.resumeEvents=function(){this._suspendCount--,DF(this)};Object.defineProperties(rl.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],a=i[t];r!==a.isShowing&&a.definitionChanged.raiseEvent(a,"isShowing",a.isShowing,r)}this.resumeEvents()}},owner:{get:function(){return this._owner}}});rl.prototype.computeAvailability=function(){let e=Xe.MAXIMUM_VALUE,t=Xe.MINIMUM_VALUE,n=this._entities.values;for(let i=0,o=n.length;i<o;i++){let a=n[i].availability;if(l(a)){let s=a.start,c=a.stop;X.lessThan(s,e)&&!s.equals(Xe.MINIMUM_VALUE)&&(e=s),X.greaterThan(c,t)&&!c.equals(Xe.MAXIMUM_VALUE)&&(t=c)}}return Xe.MAXIMUM_VALUE.equals(e)&&(e=Xe.MINIMUM_VALUE),Xe.MINIMUM_VALUE.equals(t)&&(t=Xe.MAXIMUM_VALUE),new vn({start:e,stop:t})};rl.prototype.add=function(e){e instanceof Zo||(e=new Zo(e));let t=e.id,n=this._entities;if(n.contains(t))throw new de(`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(rl.prototype._onEntityDefinitionChanged,this),DF(this),e};rl.prototype.remove=function(e){return l(e)?this.removeById(e.id):!1};rl.prototype.contains=function(e){return this._entities.get(e.id)===e};rl.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(rl.prototype._onEntityDefinitionChanged,this),DF(this),!0):!1};rl.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 a=n[r],s=a.id,c=i.get(s);l(c)||(a.definitionChanged.removeEventListener(rl.prototype._onEntityDefinitionChanged,this),o.set(s,a))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),DF(this)};rl.prototype.getById=function(e){return this._entities.get(e)};rl.prototype.getOrCreateEntity=function(e){let t=this._entities.get(e);return l(t)||(Age.id=e,t=new Zo(Age),this.add(t)),t};rl.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),DF(this)};var Vs=rl;var X8={id:void 0},ES=new Array(2);function ZX(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 gge(e,t,n,i){ES[0]=n,ES[1]=i.id,t[JSON.stringify(ES)]=i.definitionChanged.addEventListener(ya.prototype._onDefinitionChanged,e)}function _ge(e,t,n,i){ES[0]=n,ES[1]=i.id;let o=JSON.stringify(ES);t[o](),t[o]=void 0}function aC(e){if(e._shouldRecomposite=!0,e._suspendCount!==0)return;let t=e._collections,n=t.length,i=e._collectionsCopy,o=i.length,r,a,s,c,u,f=e._composite,h=new Vs(e),p=e._eventHash,A;for(r=0;r<o;r++)for(u=i[r],u.collectionChanged.removeEventListener(ya.prototype._onCollectionChanged,e),s=u.values,A=u.id,c=s.length-1;c>-1;c--)a=s[c],_ge(e,p,A,a);for(r=n-1;r>=0;r--)for(u=t[r],u.collectionChanged.addEventListener(ya.prototype._onCollectionChanged,e),s=u.values,A=u.id,c=s.length-1;c>-1;c--){a=s[c],gge(e,p,A,a);let _=h.getById(a.id);l(_)||(_=f.getById(a.id),l(_)?ZX(_):(X8.id=a.id,_=new Zo(X8)),h.add(_)),_.merge(a)}e._collectionsCopy=t.slice(0),f.suspendEvents(),f.removeAll();let m=h.values;for(r=0;r<m.length;r++)f.add(m[r]);f.resumeEvents()}function ya(e,t){this._owner=t,this._composite=new Vs(this),this._suspendCount=0,this._collections=l(e)?e.slice():[],this._collectionsCopy=[],this._id=Jn(),this._eventHash={},aC(this),this._shouldRecomposite=!1}Object.defineProperties(ya.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}}});ya.prototype.addCollection=function(e,t){l(t)?this._collections.splice(t,0,e):(t=this._collections.length,this._collections.push(e)),aC(this)};ya.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),aC(this),!0):!1};ya.prototype.removeAllCollections=function(){this._collections.length=0,aC(this)};ya.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};ya.prototype.contains=function(e){return this._composite.contains(e)};ya.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};ya.prototype.getCollection=function(e){return this._collections[e]};ya.prototype.getCollectionsLength=function(){return this._collections.length};function J8(e,t){return e.indexOf(t)}function yge(e,t,n){let i=e._collections;if(t=D.clamp(t,0,i.length-1),n=D.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,aC(e)}ya.prototype.raiseCollection=function(e){let t=J8(this._collections,e);yge(this,t,t+1)};ya.prototype.lowerCollection=function(e){let t=J8(this._collections,e);yge(this,t,t-1)};ya.prototype.raiseCollectionToTop=function(e){let t=J8(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),aC(this))};ya.prototype.lowerCollectionToBottom=function(e){let t=J8(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),aC(this))};ya.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};ya.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(aC(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};ya.prototype.computeAvailability=function(){return this._composite.computeAvailability()};ya.prototype.getById=function(e){return this._composite.getById(e)};ya.prototype._onCollectionChanged=function(e,t,n){let i=this._collectionsCopy,o=i.length,r=this._composite;r.suspendEvents();let a,s,c,u,f=n.length,h=this._eventHash,p=e.id;for(a=0;a<f;a++){let m=n[a];_ge(this,h,p,m);let _=m.id;for(s=o-1;s>=0;s--)c=i[s].getById(_),l(c)&&(l(u)||(u=r.getById(_),ZX(u)),u.merge(c));l(u)||r.removeById(_),u=void 0}let A=t.length;for(a=0;a<A;a++){let m=t[a];gge(this,h,p,m);let _=m.id;for(s=o-1;s>=0;s--)c=i[s].getById(_),l(c)&&(l(u)||(u=r.getById(_),l(u)?ZX(u):(X8.id=_,u=new Zo(X8),r.add(u))),u.merge(c));u=void 0}r.resumeEvents()};ya.prototype._onDefinitionChanged=function(e,t,n,i){let o=this._collections,r=this._composite,a=o.length,s=e.id,c=r.getById(s),u=c[t],f=!l(u),h=!0;for(let p=a-1;p>=0;p--){let A=o[p].getById(e.id);if(l(A)){let m=A[t];if(l(m)){if(h)if(h=!1,l(m.merge)&&l(m.clone))u=m.clone(u);else{u=m;break}u.merge(m)}}}f&&c.propertyNames.indexOf(t)===-1&&c.addProperty(t),c[t]=u};var $X=ya;function eJ(){this._removalFunctions=[]}eJ.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)}};eJ.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var kr=eJ;function iJ(e,t){return X.compare(e.start,t.start)}function Ca(e){if(this._intervals=[],this._changedEvent=new _e,l(e)){let t=e.length;for(let n=0;n<t;n++)this.addInterval(e[n])}}Object.defineProperties(Ca.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}}});Ca.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof Ca))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};Ca.prototype.get=function(e){return this._intervals[e]};Ca.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};Ca.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};Ca.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};Ca.prototype.contains=function(e){return this.indexOf(e)>=0};var tJ=new vn;Ca.prototype.indexOf=function(e){let t=this._intervals;tJ.start=e,tJ.stop=e;let n=Co(t,tJ,iJ);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)};Ca.prototype.findInterval=function(e){e=e??V.EMPTY_OBJECT;let t=e.start,n=e.stop,i=e.isStartIncluded,o=e.isStopIncluded,r=this._intervals;for(let a=0,s=r.length;a<s;a++){let c=r[a];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[a]}};Ca.prototype.addInterval=function(e,t){if(e.isEmpty)return;let n=this._intervals;if(n.length===0||X.greaterThan(e.start,n[n.length-1].stop)){n.push(e),this._changedEvent.raiseEvent(this);return}let i=Co(n,e,iJ);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=X.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)?(X.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=X.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=X.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:X.greaterThan(n[i].stop,e.stop)?n[i].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:X.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)};Ca.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=Co(t,e,iJ);n<0&&(n=~n);let i=!1;for(n>0&&(X.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,(X.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&&X.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&&(X.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};Ca.prototype.intersect=function(e,t,n){let i=new Ca,o=0,r=0,a=this._intervals,s=e._intervals;for(;o<a.length&&r<s.length;){let c=a[o],u=s[r];if(X.lessThan(c.stop,u.start))++o;else if(X.lessThan(u.stop,c.start))++r;else{if(l(n)||l(t)&&t(c.data,u.data)||!l(t)&&u.data===c.data){let f=vn.intersect(c,u,new vn,n);f.isEmpty||i.addInterval(f,t)}X.lessThan(c.stop,u.stop)||c.stop.equals(u.stop)&&!c.isStopIncluded&&u.isStopIncluded?++o:++r}}return i};Ca.fromJulianDateArray=function(e,t){l(t)||(t=new Ca);let n=e.julianDates,i=n.length,o=e.dataCallback,r=e.isStartIncluded??!0,a=e.isStopIncluded??!0,s=e.leadingInterval??!1,c=e.trailingInterval??!1,u,f=0;s&&(++f,u=new vn({start:Xe.MINIMUM_VALUE,stop:n[0],isStartIncluded:!0,isStopIncluded:!r}),u.data=l(o)?o(u,t.length):t.length,t.addInterval(u));for(let h=0;h<i-1;++h){let p=n[h],A=n[h+1];u=new vn({start:p,stop:A,isStartIncluded:t.length===f?r:!0,isStopIncluded:h===i-2?a:!1}),u.data=l(o)?o(u,t.length):t.length,t.addInterval(u),p=A}return c&&(u=new vn({start:n[i-1],stop:Xe.MAXIMUM_VALUE,isStartIncluded:!a,isStopIncluded:!0}),u.data=l(o)?o(u,t.length):t.length,t.addInterval(u)),t};var al=new SA,vF=[0,31,28,31,30,31,30,31,31,30,31,30,31];function nJ(e,t,n){l(n)||(n=new X),X.toGregorianDate(e,al);let i=al.millisecond+t.millisecond,o=al.second+t.second,r=al.minute+t.minute,a=al.hour+t.hour,s=al.day+t.day,c=al.month+t.month,u=al.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&&(a+=Math.floor(r/60),r=r%60),a>=24&&(s+=Math.floor(a/24),a=a%24),vF[2]=Ch(u)?29:28;s>vF[c]||c>=13;)s>vF[c]&&(s-=vF[c],++c),c>=13&&(--c,u+=Math.floor(c/12),c=c%12,++c),vF[2]=Ch(u)?29:28;return al.millisecond=i,al.second=o,al.minute=r,al.hour=a,al.day=s,al.month=c,al.year=u,X.fromGregorianDate(al,n)}var frt=new X,drt=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function Cge(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(drt);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"),X.toGregorianDate(X.fromIso8601(e,frt),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var PF=new SA;Ca.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=X.fromIso8601(n[0]),o=X.fromIso8601(n[1]),r=[];if(!Cge(n[2],PF))r.push(i,o);else{let a=X.clone(i);for(r.push(a);X.compare(a,o)<0;)a=nJ(a,PF),X.compare(o,a)<=0&&X.clone(o,a),r.push(a)}return Ca.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Ca.fromIso8601DateArray=function(e,t){return Ca.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(n){return X.fromIso8601(n)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Ca.fromIso8601DurationArray=function(e,t){let n=e.epoch,i=e.iso8601Durations,o=e.relativeToPrevious??!1,r=[],a,s,c=i.length;for(let u=0;u<c;++u)(Cge(i[u],PF)||u===0)&&(o&&l(s)?a=nJ(s,PF):a=nJ(n,PF),r.push(a),s=a);return Ca.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var Ea=Ca;function hrt(e,t,n,i){function o(){n.raiseEvent(e)}let r=[];t.removeAll();let a=i.length;for(let s=0;s<a;s++){let c=i.get(s);l(c.data)&&r.indexOf(c.data)===-1&&t.add(c.data.definitionChanged,o)}}function Ab(){this._eventHelper=new kr,this._definitionChanged=new _e,this._intervals=new Ea,this._intervals.changedEvent.addEventListener(Ab.prototype._intervalsChanged,this)}Object.defineProperties(Ab.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var mrt=new X;Ab.prototype.getValue=function(e,t){l(e)||(e=X.now(mrt));let n=this._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};Ab.prototype.equals=function(e){return this===e||e instanceof Ab&&this._intervals.equals(e._intervals,q.equals)};Ab.prototype._intervalsChanged=function(){hrt(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var sl=Ab;function sC(){this._definitionChanged=new _e,this._composite=new sl,this._composite.definitionChanged.addEventListener(sC.prototype._raiseDefinitionChanged,this)}Object.defineProperties(sC.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});sC.prototype.getType=function(e){let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(t))return t.getType(e)};var prt=new X;sC.prototype.getValue=function(e,t){l(e)||(e=X.now(prt));let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};sC.prototype.equals=function(e){return this===e||e instanceof sC&&this._composite.equals(e._composite,q.equals)};sC.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var bS=sC;function cC(e){this._referenceFrame=e??Li.FIXED,this._definitionChanged=new _e,this._composite=new sl,this._composite.definitionChanged.addEventListener(cC.prototype._raiseDefinitionChanged,this)}Object.defineProperties(cC.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 Art=new X;cC.prototype.getValue=function(e,t){return l(e)||(e=X.now(Art)),this.getValueInReferenceFrame(e,Li.FIXED,t)};cC.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(i))return i.getValueInReferenceFrame(e,t,n)};cC.prototype.equals=function(e){return this===e||e instanceof cC&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,q.equals)};cC.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var lc=cC;var grt={ROUNDED:0,MITERED:1,BEVELED:2},Ji=Object.freeze(grt);var uc=[new d,new d],_rt=new d,yrt=new d,Crt=new d,Ert=new d,brt=new d,Irt=new d,xrt=new d,Trt=new d,Srt=new d,IS=new d,Z8=new d,RF={},oJ=new me;function wrt(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let o=e[i];oJ=t.cartesianToCartographic(o,oJ),n[i]=oJ.height,e[i]=t.scaleToGeodeticSurface(o,o)}return n}function rJ(e,t,n,i){let o=e[0],r=e[1],a=d.angleBetween(o,r),s=Math.ceil(a/i),c=new Array(s),u;if(t===n){for(u=0;u<s;u++)c[u]=t;return c.push(n),c}let h=(n-t)/s;for(u=1;u<s;u++){let p=t+u*h;c[u]=p}return c[0]=t,c.push(n),c}var $8=new d,eH=new d;function Brt(e,t,n,i){let o=new Pa(n,i),r=o.projectPointOntoPlane(d.add(n,e,$8),$8),a=o.projectPointOntoPlane(d.add(n,t,eH),eH),s=k.angleBetween(r,a);return a.x*r.y-a.y*r.x>=0?-s:s}var Drt=new d(-1,0,0),gb=new M,vrt=new M,aJ=new J,Prt=J.IDENTITY.clone(),Rrt=new d,Mrt=new ie,Ege=new d;function Xg(e,t,n,i,o,r,a,s){let c=Rrt,u=Mrt;gb=At.eastNorthUpToFixedFrame(e,o,gb),c=M.multiplyByPointAsVector(gb,Drt,c),c=d.normalize(c,c);let f=Brt(c,t,e,o);aJ=J.fromRotationZ(f,aJ),Ege.z=r,gb=M.multiplyTransformation(gb,M.fromRotationTranslation(aJ,Ege,vrt),gb);let h=Prt;h[0]=a;for(let p=0;p<s;p++)for(let A=0;A<n.length;A+=3)u=d.fromArray(n,A,u),u=J.multiplyByVector(h,u,u),u=M.multiplyByPoint(gb,u,u),i.push(u.x,u.y,u.z);return i}var Nrt=new d;function sJ(e,t,n,i,o,r,a){for(let s=0;s<e.length;s+=3){let c=d.fromArray(e,s,Nrt);i=Xg(c,t,n,i,o,r[s/3],a,1)}return i}function Lrt(e,t){let n=e.length,i=new Array(n*6),o=0,r=t.x+t.width/2,a=t.y+t.height/2,s=e[0];i[o++]=s.x-r,i[o++]=0,i[o++]=s.y-a;for(let c=1;c<n;c++){s=e[c];let u=s.x-r,f=s.y-a;i[o++]=u,i[o++]=0,i[o++]=f,i[o++]=u,i[o++]=0,i[o++]=f}return s=e[0],i[o++]=s.x-r,i[o++]=0,i[o++]=s.y-a,i}function bge(e,t){let n=e.length,i=new Array(n*3),o=0,r=t.x+t.width/2,a=t.y+t.height/2;for(let s=0;s<n;s++)i[o++]=e[s].x-r,i[o++]=0,i[o++]=e[s].y-a;return i}var Ige=new Qe,xge=new d,Tge=new J;function Sge(e,t,n,i,o,r,a,s,c,u){let f=d.angleBetween(d.subtract(t,e,IS),d.subtract(n,e,Z8)),h=i===Ji.BEVELED?0:Math.ceil(f/D.toRadians(5)),p;o?p=J.fromQuaternion(Qe.fromAxisAngle(d.negate(e,IS),f/(h+1),Ige),Tge):p=J.fromQuaternion(Qe.fromAxisAngle(e,f/(h+1),Ige),Tge);let A,m;if(t=d.clone(t,xge),h>0){let _=u?2:1;for(let y=0;y<h;y++)t=J.multiplyByVector(p,t,t),A=d.subtract(t,e,IS),A=d.normalize(A,A),o||(A=d.negate(A,A)),m=r.scaleToGeodeticSurface(t,Z8),a=Xg(m,A,s,a,r,c,1,_)}else A=d.subtract(t,e,IS),A=d.normalize(A,A),o||(A=d.negate(A,A)),m=r.scaleToGeodeticSurface(t,Z8),a=Xg(m,A,s,a,r,c,1,1),n=d.clone(n,xge),A=d.subtract(n,e,IS),A=d.normalize(A,A),o||(A=d.negate(A,A)),m=r.scaleToGeodeticSurface(n,Z8),a=Xg(m,A,s,a,r,c,1,1);return a}RF.removeDuplicatesFromShape=function(e){let t=e.length,n=[];for(let i=t-1,o=0;o<t;i=o++){let r=e[i],a=e[o];k.equals(r,a)||n.push(a)}return n};RF.angleIsGreaterThanPi=function(e,t,n,i){let o=new Pa(n,i),r=o.projectPointOntoPlane(d.add(n,e,$8),$8),a=o.projectPointOntoPlane(d.add(n,t,eH),eH);return a.x*r.y-a.y*r.x>=0};var Ort=new d,Frt=new d;RF.computePositions=function(e,t,n,i,o){let r=i._ellipsoid,a=wrt(e,r),s=i._granularity,c=i._cornerType,u=o?Lrt(t,n):bge(t,n),f=o?bge(t,n):void 0,h=n.height/2,p=n.width/2,A=e.length,m=[],_=o?[]:void 0,y=_rt,C=yrt,E=Crt,b=Ert,x=brt,S=Irt,B=xrt,v=Trt,P=Srt,N=e[0],L=e[1];b=r.geodeticSurfaceNormal(N,b),y=d.subtract(L,N,y),y=d.normalize(y,y),v=d.cross(b,y,v),v=d.normalize(v,v);let g=a[0],I=a[1];o&&(_=Xg(N,v,f,_,r,g+h,1,1)),P=d.clone(N,P),N=L,C=d.negate(y,C);let T,w;for(let G=1;G<A-1;G++){let F=o?2:1;if(L=e[G+1],N.equals(L)){It("Positions are too close and are considered equivalent with rounding error.");continue}y=d.subtract(L,N,y),y=d.normalize(y,y),b=r.geodeticSurfaceNormal(N,b);let U=d.multiplyByScalar(b,d.dot(y,b),Ort);d.subtract(y,U,U),d.normalize(U,U);let Q=d.multiplyByScalar(b,d.dot(C,b),Frt);if(d.subtract(C,Q,Q),d.normalize(Q,Q),!D.equalsEpsilon(Math.abs(d.dot(U,Q)),1,D.EPSILON7)){E=d.add(y,C,E),E=d.normalize(E,E),E=d.cross(E,b,E),E=d.cross(b,E,E),E=d.normalize(E,E);let Y=1/Math.max(.25,d.magnitude(d.cross(E,C,IS))),$=RF.angleIsGreaterThanPi(y,C,N,r);$?(x=d.add(N,d.multiplyByScalar(E,Y*p,E),x),S=d.add(x,d.multiplyByScalar(v,p,S),S),uc[0]=d.clone(P,uc[0]),uc[1]=d.clone(S,uc[1]),T=rJ(uc,g+h,I+h,s),w=Xi.generateArc({positions:uc,granularity:s,ellipsoid:r}),m=sJ(w,v,u,m,r,T,1),v=d.cross(b,y,v),v=d.normalize(v,v),B=d.add(x,d.multiplyByScalar(v,p,B),B),c===Ji.ROUNDED||c===Ji.BEVELED?Sge(x,S,B,c,$,r,m,u,I+h,o):(E=d.negate(E,E),m=Xg(N,E,u,m,r,I+h,Y,F)),P=d.clone(B,P)):(x=d.add(N,d.multiplyByScalar(E,Y*p,E),x),S=d.add(x,d.multiplyByScalar(v,-p,S),S),uc[0]=d.clone(P,uc[0]),uc[1]=d.clone(S,uc[1]),T=rJ(uc,g+h,I+h,s),w=Xi.generateArc({positions:uc,granularity:s,ellipsoid:r}),m=sJ(w,v,u,m,r,T,1),v=d.cross(b,y,v),v=d.normalize(v,v),B=d.add(x,d.multiplyByScalar(v,-p,B),B),c===Ji.ROUNDED||c===Ji.BEVELED?Sge(x,S,B,c,$,r,m,u,I+h,o):m=Xg(N,E,u,m,r,I+h,Y,F),P=d.clone(B,P)),C=d.negate(y,C)}else m=Xg(P,v,u,m,r,g+h,1,1),P=N;g=I,I=a[G+1],N=L}uc[0]=d.clone(P,uc[0]),uc[1]=d.clone(N,uc[1]),T=rJ(uc,g+h,I+h,s),w=Xi.generateArc({positions:uc,granularity:s,ellipsoid:r}),m=sJ(w,v,u,m,r,T,1),o&&(_=Xg(N,v,f,_,r,I+h,1,1)),A=m.length;let R=o?A+_.length:A,O=new Float64Array(R);return O.set(m),o&&O.set(_,A),O};var hm=RF;var lJ={},xS=new d,Pge=new d,Qrt=new d,wge=new d,eu=[new d,new d],Rge=new d,Mge=new d,Nge=new d,krt=new d,Urt=new d,zrt=new d,Grt=new d,Vrt=new d,Hrt=new d,Wrt=new d,Bge=new Qe,Dge=new J;function tH(e,t,n,i,o){let r=d.angleBetween(d.subtract(t,e,xS),d.subtract(n,e,Pge)),a=i===Ji.BEVELED?1:Math.ceil(r/D.toRadians(5))+1,s=a*3,c=new Array(s);c[s-3]=n.x,c[s-2]=n.y,c[s-1]=n.z;let u;o?u=J.fromQuaternion(Qe.fromAxisAngle(d.negate(e,xS),r/a,Bge),Dge):u=J.fromQuaternion(Qe.fromAxisAngle(e,r/a,Bge),Dge);let f=0;t=d.clone(t,xS);for(let h=0;h<a;h++)t=J.multiplyByVector(u,t,t),c[f++]=t.x,c[f++]=t.y,c[f++]=t.z;return c}function jrt(e){let t=Rge,n=Mge,i=Nge,o=e[1];n=d.fromArray(e[1],o.length-3,n),i=d.fromArray(e[0],0,i),t=d.midpoint(n,i,t);let r=tH(t,n,i,Ji.ROUNDED,!1),a=e.length-1,s=e[a-1];o=e[a],n=d.fromArray(s,s.length-3,n),i=d.fromArray(o,0,i),t=d.midpoint(n,i,t);let c=tH(t,n,i,Ji.ROUNDED,!1);return[r,c]}function vge(e,t,n,i){let o=xS;return i?o=d.add(e,t,o):(t=d.negate(t,t),o=d.add(e,t,o)),[o.x,o.y,o.z,n.x,n.y,n.z]}function cJ(e,t,n,i){let o=new Array(e.length),r=new Array(e.length),a=d.multiplyByScalar(t,n,xS),s=d.negate(a,Pge),c=0,u=e.length-1;for(let f=0;f<e.length;f+=3){let h=d.fromArray(e,f,Qrt),p=d.add(h,s,wge);o[c++]=p.x,o[c++]=p.y,o[c++]=p.z;let A=d.add(h,a,wge);r[u--]=A.z,r[u--]=A.y,r[u--]=A.x}return i.push(o,r),i}lJ.addAttribute=function(e,t,n,i){let o=t.x,r=t.y,a=t.z;l(n)&&(e[n]=o,e[n+1]=r,e[n+2]=a),l(i)&&(e[i]=a,e[i-1]=r,e[i-2]=o)};var Yrt=new d,qrt=new d;lJ.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,o=e.width/2,r=e.cornerType,a=e.saveAttributes,s=Rge,c=Mge,u=Nge,f=krt,h=Urt,p=zrt,A=Grt,m=Vrt,_=Hrt,y=Wrt,C=[],E=a?[]:void 0,b=a?[]:void 0,x=n[0],S=n[1];c=d.normalize(d.subtract(S,x,c),c),s=i.geodeticSurfaceNormal(x,s),f=d.normalize(d.cross(s,c,f),f),a&&(E.push(f.x,f.y,f.z),b.push(s.x,s.y,s.z)),A=d.clone(x,A),x=S,u=d.negate(c,u);let B,v=[],P,N=n.length;for(P=1;P<N-1;P++){s=i.geodeticSurfaceNormal(x,s),S=n[P+1],c=d.normalize(d.subtract(S,x,c),c);let g=d.multiplyByScalar(s,d.dot(c,s),Yrt);d.subtract(c,g,g),d.normalize(g,g);let I=d.multiplyByScalar(s,d.dot(u,s),qrt);if(d.subtract(u,I,I),d.normalize(I,I),!D.equalsEpsilon(Math.abs(d.dot(g,I)),1,D.EPSILON7)){h=d.normalize(d.add(c,u,h),h),h=d.cross(h,s,h),h=d.cross(s,h,h),h=d.normalize(h,h);let w=o/Math.max(.25,d.magnitude(d.cross(h,u,xS))),R=hm.angleIsGreaterThanPi(c,u,x,i);h=d.multiplyByScalar(h,w,h),R?(m=d.add(x,h,m),y=d.add(m,d.multiplyByScalar(f,o,y),y),_=d.add(m,d.multiplyByScalar(f,o*2,_),_),eu[0]=d.clone(A,eu[0]),eu[1]=d.clone(y,eu[1]),B=Xi.generateArc({positions:eu,granularity:t,ellipsoid:i}),C=cJ(B,f,o,C),a&&(E.push(f.x,f.y,f.z),b.push(s.x,s.y,s.z)),p=d.clone(_,p),f=d.normalize(d.cross(s,c,f),f),_=d.add(m,d.multiplyByScalar(f,o*2,_),_),A=d.add(m,d.multiplyByScalar(f,o,A),A),r===Ji.ROUNDED||r===Ji.BEVELED?v.push({leftPositions:tH(m,p,_,r,R)}):v.push({leftPositions:vge(x,d.negate(h,h),_,R)})):(_=d.add(x,h,_),y=d.add(_,d.negate(d.multiplyByScalar(f,o,y),y),y),m=d.add(_,d.negate(d.multiplyByScalar(f,o*2,m),m),m),eu[0]=d.clone(A,eu[0]),eu[1]=d.clone(y,eu[1]),B=Xi.generateArc({positions:eu,granularity:t,ellipsoid:i}),C=cJ(B,f,o,C),a&&(E.push(f.x,f.y,f.z),b.push(s.x,s.y,s.z)),p=d.clone(m,p),f=d.normalize(d.cross(s,c,f),f),m=d.add(_,d.negate(d.multiplyByScalar(f,o*2,m),m),m),A=d.add(_,d.negate(d.multiplyByScalar(f,o,A),A),A),r===Ji.ROUNDED||r===Ji.BEVELED?v.push({rightPositions:tH(_,p,m,r,R)}):v.push({rightPositions:vge(x,h,m,R)})),u=d.negate(c,u)}x=S}s=i.geodeticSurfaceNormal(x,s),eu[0]=d.clone(A,eu[0]),eu[1]=d.clone(x,eu[1]),B=Xi.generateArc({positions:eu,granularity:t,ellipsoid:i}),C=cJ(B,f,o,C),a&&(E.push(f.x,f.y,f.z),b.push(s.x,s.y,s.z));let L;return r===Ji.ROUNDED&&(L=jrt(C)),{positions:C,corners:v,lefts:E,normals:b,endPositions:L}};var lo=lJ;var Fge=new d,Qge=new d,nH=new d,iH=new d,Krt=new d,kge=new d,lC=new d,TS=new d;function Uge(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function mm(e,t,n,i,o,r){let a=e.normals,s=e.tangents,c=e.bitangents,u=d.normalize(d.cross(n,t,lC),lC);r.normal&&lo.addAttribute(a,t,i,o),r.tangent&&lo.addAttribute(s,u,i,o),r.bitangent&&lo.addAttribute(c,n,i,o)}function zge(e,t,n){let i=e.positions,o=e.corners,r=e.endPositions,a=e.lefts,s=e.normals,c=new _n,u,f=0,h=0,p,A=0,m;for(p=0;p<i.length;p+=2)m=i[p].length-3,f+=m,A+=m*2,h+=i[p+1].length-3;for(f+=3,h+=3,p=0;p<o.length;p++){u=o[p];let Z=o[p].leftPositions;l(Z)?(m=Z.length,f+=m,A+=m):(m=o[p].rightPositions.length,h+=m,A+=m)}let _=l(r),y;_&&(y=r[0].length-3,f+=y,h+=y,y/=3,A+=y*6);let C=f+h,E=new Float64Array(C),b=t.normal?new Float32Array(C):void 0,x=t.tangent?new Float32Array(C):void 0,S=t.bitangent?new Float32Array(C):void 0,B={normals:b,tangents:x,bitangents:S},v=0,P=C-1,N,L,g,I,T=Fge,w=Qge,R,O,G=y/2,F=Ue.createTypedArray(C/3,A),U=0;if(_){O=nH,R=iH;let Z=r[0];for(T=d.fromArray(s,0,T),w=d.fromArray(a,0,w),p=0;p<G;p++)O=d.fromArray(Z,(G-1-p)*3,O),R=d.fromArray(Z,(G+p)*3,R),lo.addAttribute(E,R,v),lo.addAttribute(E,O,void 0,P),mm(B,T,w,v,P,t),L=v/3,I=L+1,N=(P-2)/3,g=N-1,F[U++]=N,F[U++]=L,F[U++]=g,F[U++]=g,F[U++]=L,F[U++]=I,v+=3,P-=3}let Q=0,H=0,Y=i[Q++],$=i[Q++];E.set(Y,v),E.set($,P-$.length+1),w=d.fromArray(a,H,w);let W,K;for(m=$.length-3,p=0;p<m;p+=3)W=n.geodeticSurfaceNormal(d.fromArray(Y,p,lC),lC),K=n.geodeticSurfaceNormal(d.fromArray($,m-p,TS),TS),T=d.normalize(d.add(W,K,T),T),mm(B,T,w,v,P,t),L=v/3,I=L+1,N=(P-2)/3,g=N-1,F[U++]=N,F[U++]=L,F[U++]=g,F[U++]=g,F[U++]=L,F[U++]=I,v+=3,P-=3;for(W=n.geodeticSurfaceNormal(d.fromArray(Y,m,lC),lC),K=n.geodeticSurfaceNormal(d.fromArray($,m,TS),TS),T=d.normalize(d.add(W,K,T),T),H+=3,p=0;p<o.length;p++){let Z;u=o[p];let pe=u.leftPositions,ge=u.rightPositions,re,ye,Ce=kge,Pe=nH,Ne=iH;if(T=d.fromArray(s,H,T),l(pe)){for(mm(B,T,w,void 0,P,t),P-=3,re=I,ye=g,Z=0;Z<pe.length/3;Z++)Ce=d.fromArray(pe,Z*3,Ce),F[U++]=re,F[U++]=ye-Z-1,F[U++]=ye-Z,lo.addAttribute(E,Ce,void 0,P),Pe=d.fromArray(E,(ye-Z-1)*3,Pe),Ne=d.fromArray(E,re*3,Ne),w=d.normalize(d.subtract(Pe,Ne,w),w),mm(B,T,w,void 0,P,t),P-=3;Ce=d.fromArray(E,re*3,Ce),Pe=d.subtract(d.fromArray(E,ye*3,Pe),Ce,Pe),Ne=d.subtract(d.fromArray(E,(ye-Z)*3,Ne),Ce,Ne),w=d.normalize(d.add(Pe,Ne,w),w),mm(B,T,w,v,void 0,t),v+=3}else{for(mm(B,T,w,v,void 0,t),v+=3,re=g,ye=I,Z=0;Z<ge.length/3;Z++)Ce=d.fromArray(ge,Z*3,Ce),F[U++]=re,F[U++]=ye+Z,F[U++]=ye+Z+1,lo.addAttribute(E,Ce,v),Pe=d.fromArray(E,re*3,Pe),Ne=d.fromArray(E,(ye+Z)*3,Ne),w=d.normalize(d.subtract(Pe,Ne,w),w),mm(B,T,w,v,void 0,t),v+=3;Ce=d.fromArray(E,re*3,Ce),Pe=d.subtract(d.fromArray(E,(ye+Z)*3,Pe),Ce,Pe),Ne=d.subtract(d.fromArray(E,ye*3,Ne),Ce,Ne),w=d.normalize(d.negate(d.add(Ne,Pe,w),w),w),mm(B,T,w,void 0,P,t),P-=3}for(Y=i[Q++],$=i[Q++],Y.splice(0,3),$.splice($.length-3,3),E.set(Y,v),E.set($,P-$.length+1),m=$.length-3,H+=3,w=d.fromArray(a,H,w),Z=0;Z<$.length;Z+=3)W=n.geodeticSurfaceNormal(d.fromArray(Y,Z,lC),lC),K=n.geodeticSurfaceNormal(d.fromArray($,m-Z,TS),TS),T=d.normalize(d.add(W,K,T),T),mm(B,T,w,v,P,t),I=v/3,L=I-1,g=(P-2)/3,N=g+1,F[U++]=N,F[U++]=L,F[U++]=g,F[U++]=g,F[U++]=L,F[U++]=I,v+=3,P-=3;v-=3,P+=3}if(T=d.fromArray(s,s.length-3,T),mm(B,T,w,v,P,t),_){v+=3,P-=3,O=nH,R=iH;let Z=r[1];for(p=0;p<G;p++)O=d.fromArray(Z,(y-p-1)*3,O),R=d.fromArray(Z,p*3,R),lo.addAttribute(E,O,void 0,P),lo.addAttribute(E,R,v),mm(B,T,w,v,P,t),I=v/3,L=I-1,g=(P-2)/3,N=g+1,F[U++]=N,F[U++]=L,F[U++]=g,F[U++]=g,F[U++]=L,F[U++]=I,v+=3,P-=3}if(c.position=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:E}),t.st){let Z=new Float32Array(C/3*2),pe,ge,re=0;if(_){f/=3,h/=3;let ye=Math.PI/(y+1);ge=1/(f-y+1),pe=1/(h-y+1);let Ce,Pe=y/2;for(p=Pe+1;p<y+1;p++)Ce=D.PI_OVER_TWO+ye*p,Z[re++]=pe*(1+Math.cos(Ce)),Z[re++]=.5*(1+Math.sin(Ce));for(p=1;p<h-y+1;p++)Z[re++]=p*pe,Z[re++]=0;for(p=y;p>Pe;p--)Ce=D.PI_OVER_TWO-p*ye,Z[re++]=1-pe*(1+Math.cos(Ce)),Z[re++]=.5*(1+Math.sin(Ce));for(p=Pe;p>0;p--)Ce=D.PI_OVER_TWO-ye*p,Z[re++]=1-ge*(1+Math.cos(Ce)),Z[re++]=.5*(1+Math.sin(Ce));for(p=f-y;p>0;p--)Z[re++]=p*ge,Z[re++]=1;for(p=1;p<Pe+1;p++)Ce=D.PI_OVER_TWO+ye*p,Z[re++]=ge*(1+Math.cos(Ce)),Z[re++]=.5*(1+Math.sin(Ce))}else{for(f/=3,h/=3,ge=1/(f-1),pe=1/(h-1),p=0;p<h;p++)Z[re++]=p*pe,Z[re++]=0;for(p=f;p>0;p--)Z[re++]=(p-1)*ge,Z[re++]=1}c.st=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:Z})}return t.normal&&(c.normal=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:B.normals})),t.tangent&&(c.tangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:B.tangents})),t.bitangent&&(c.bitangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:B.bitangents})),{attributes:c,indices:F}}function Xrt(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,a=r*3,s=r*2,c=a*2,u;if(t.normal||t.bitangent||t.tangent){let f=t.normal?new Float32Array(a*6):void 0,h=t.tangent?new Float32Array(a*6):void 0,p=t.bitangent?new Float32Array(a*6):void 0,A=Fge,m=Qge,_=nH,y=iH,C=Krt,E=kge,b=c;for(u=0;u<a;u+=3){let x=b+c;A=d.fromArray(n,u,A),m=d.fromArray(n,u+a,m),_=d.fromArray(n,(u+3)%a,_),m=d.subtract(m,A,m),_=d.subtract(_,A,_),y=d.normalize(d.cross(m,_,y),y),t.normal&&(lo.addAttribute(f,y,x),lo.addAttribute(f,y,x+3),lo.addAttribute(f,y,b),lo.addAttribute(f,y,b+3)),(t.tangent||t.bitangent)&&(E=d.fromArray(i,u,E),t.bitangent&&(lo.addAttribute(p,E,x),lo.addAttribute(p,E,x+3),lo.addAttribute(p,E,b),lo.addAttribute(p,E,b+3)),t.tangent&&(C=d.normalize(d.cross(E,y,C),C),lo.addAttribute(h,C,x),lo.addAttribute(h,C,x+3),lo.addAttribute(h,C,b),lo.addAttribute(h,C,b+3))),b+=6}if(t.normal){for(f.set(i),u=0;u<a;u+=3)f[u+a]=-i[u],f[u+a+1]=-i[u+1],f[u+a+2]=-i[u+2];e.normal.values=f}else e.normal=void 0;if(t.bitangent?(p.set(o),p.set(o,a),e.bitangent.values=p):e.bitangent=void 0,t.tangent){let x=e.tangent.values;h.set(x),h.set(x,a),e.tangent.values=h}}if(t.st){let f=e.st.values,h=new Float32Array(s*6);h.set(f),h.set(f,s);let p=s*2;for(let A=0;A<2;A++){for(h[p++]=f[0],h[p++]=f[1],u=2;u<s;u+=2){let m=f[u],_=f[u+1];h[p++]=m,h[p++]=_,h[p++]=m,h[p++]=_}h[p++]=f[0],h[p++]=f[1]}e.st.values=h}return e}function uJ(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],a=e[i+2];n[t++]=o,n[t++]=r,n[t++]=a,n[t++]=o,n[t++]=r,n[t++]=a}return n[t++]=e[0],n[t++]=e[1],n[t++]=e[2],n}function Jrt(e,t){let n=new ke({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=lo.computePositions(e),r=zge(o,n,i),a=e.height,s=e.extrudedHeight,c=r.attributes,u=r.indices,f=c.position.values,h=f.length,p=new Float64Array(h*6),A=new Float64Array(h);A.set(f);let m=new Float64Array(h*4);f=Ti.scaleToGeodeticHeight(f,a,i),m=uJ(f,0,m),A=Ti.scaleToGeodeticHeight(A,s,i),m=uJ(A,h*2,m),p.set(f),p.set(A,h),p.set(m,h*2),c.position.values=p,c=Xrt(c,t);let _,y=h/3;if(e.shadowVolume){let N=c.normal.values;h=N.length;let L=new Float32Array(h*6);for(_=0;_<h;_++)N[_]=-N[_];L.set(N,h),L=uJ(N,h*4,L),c.extrudeDirection=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:L}),t.normal||(c.normal=void 0)}if(l(e.offsetAttribute)){let N=new Uint8Array(y*6);if(e.offsetAttribute===mn.TOP)N=N.fill(1,0,y).fill(1,y*2,y*4);else{let L=e.offsetAttribute===mn.NONE?0:1;N=N.fill(L)}c.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:N})}let C=u.length,E=y+y,b=Ue.createTypedArray(p.length/3,C*2+E*3);b.set(u);let x=C;for(_=0;_<C;_+=3){let N=u[_],L=u[_+1],g=u[_+2];b[x++]=g+y,b[x++]=L+y,b[x++]=N+y}let S,B,v,P;for(_=0;_<E;_+=2)S=_+E,B=S+E,v=S+1,P=B+1,b[x++]=S,b[x++]=B,b[x++]=v,b[x++]=v,b[x++]=B,b[x++]=P;return{attributes:c,indices:b}}var Lge=new d,MF=new d,Yd=new me;function Oge(e,t,n,i,o,r){let a=d.subtract(t,e,Lge);d.normalize(a,a);let s=n.geodeticSurfaceNormal(e,MF),c=d.cross(a,s,Lge);d.multiplyByScalar(c,i,c);let u=o.latitude,f=o.longitude,h=r.latitude,p=r.longitude;d.add(e,c,MF),n.cartesianToCartographic(MF,Yd);let A=Yd.latitude,m=Yd.longitude;u=Math.min(u,A),f=Math.min(f,m),h=Math.max(h,A),p=Math.max(p,m),d.subtract(e,c,MF),n.cartesianToCartographic(MF,Yd),A=Yd.latitude,m=Yd.longitude,u=Math.min(u,A),f=Math.min(f,m),h=Math.max(h,A),p=Math.max(p,m),o.latitude=u,o.longitude=f,r.latitude=h,r.longitude=p}var jd=new d,NF=new d,Fu=new me,Qu=new me;function Gge(e,t,n,i,o){e=Uge(e,t);let r=Ho(e,d.equalsEpsilon),a=r.length;if(a<2||n<=0)return new ce;let s=n*.5;Fu.latitude=Number.POSITIVE_INFINITY,Fu.longitude=Number.POSITIVE_INFINITY,Qu.latitude=Number.NEGATIVE_INFINITY,Qu.longitude=Number.NEGATIVE_INFINITY;let c,u;if(i===Ji.ROUNDED){let p=r[0];d.subtract(p,r[1],jd),d.normalize(jd,jd),d.multiplyByScalar(jd,s,jd),d.add(p,jd,NF),t.cartesianToCartographic(NF,Yd),c=Yd.latitude,u=Yd.longitude,Fu.latitude=Math.min(Fu.latitude,c),Fu.longitude=Math.min(Fu.longitude,u),Qu.latitude=Math.max(Qu.latitude,c),Qu.longitude=Math.max(Qu.longitude,u)}for(let p=0;p<a-1;++p)Oge(r[p],r[p+1],t,s,Fu,Qu);let f=r[a-1];d.subtract(f,r[a-2],jd),d.normalize(jd,jd),d.multiplyByScalar(jd,s,jd),d.add(f,jd,NF),Oge(f,NF,t,s,Fu,Qu),i===Ji.ROUNDED&&(t.cartesianToCartographic(NF,Yd),c=Yd.latitude,u=Yd.longitude,Fu.latitude=Math.min(Fu.latitude,c),Fu.longitude=Math.min(Fu.longitude,u),Qu.latitude=Math.max(Qu.latitude,c),Qu.longitude=Math.max(Qu.longitude,u));let h=l(o)?o:new ce;return h.north=Qu.latitude,h.south=Fu.latitude,h.east=Qu.longitude,h.west=Fu.longitude,h}function Zg(e){e=e??V.EMPTY_OBJECT;let t=e.positions,n=e.width,i=e.height??0,o=e.extrudedHeight??i;this._positions=t,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._vertexFormat=ke.clone(e.vertexFormat??ke.DEFAULT),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=e.cornerType??Ji.ROUNDED,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._shadowVolume=e.shadowVolume??!1,this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*d.packedLength+te.packedLength+ke.packedLength+7}Zg.pack=function(e,t,n){n=n??0;let i=e._positions,o=i.length;t[n++]=o;for(let r=0;r<o;++r,n+=d.packedLength)d.pack(i[r],t,n);return te.pack(e._ellipsoid,t,n),n+=te.packedLength,ke.pack(e._vertexFormat,t,n),n+=ke.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]=e._offsetAttribute??-1,t};var Vge=te.clone(te.UNIT_SPHERE),Hge=new ke,Jg={positions:void 0,ellipsoid:Vge,vertexFormat:Hge,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};Zg.unpack=function(e,t,n){t=t??0;let i=e[t++],o=new Array(i);for(let m=0;m<i;++m,t+=d.packedLength)o[m]=d.unpack(e,t);let r=te.unpack(e,t,Vge);t+=te.packedLength;let a=ke.unpack(e,t,Hge);t+=ke.packedLength;let s=e[t++],c=e[t++],u=e[t++],f=e[t++],h=e[t++],p=e[t++]===1,A=e[t];return l(n)?(n._positions=o,n._ellipsoid=te.clone(r,n._ellipsoid),n._vertexFormat=ke.clone(a,n._vertexFormat),n._width=s,n._height=c,n._extrudedHeight=u,n._cornerType=f,n._granularity=h,n._shadowVolume=p,n._offsetAttribute=A===-1?void 0:A,n):(Jg.positions=o,Jg.width=s,Jg.height=c,Jg.extrudedHeight=u,Jg.cornerType=f,Jg.granularity=h,Jg.shadowVolume=p,Jg.offsetAttribute=A===-1?void 0:A,new Zg(Jg))};Zg.computeRectangle=function(e,t){e=e??V.EMPTY_OBJECT;let n=e.positions,i=e.width,o=e.ellipsoid??te.default,r=e.cornerType??Ji.ROUNDED;return Gge(n,o,i,r,t)};Zg.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=Uge(t,i);let o=Ho(t,d.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,a=e._extrudedHeight,s=!D.equalsEpsilon(r,a,0,D.EPSILON2),c=e._vertexFormat,u={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0},f;if(s)u.height=r,u.extrudedHeight=a,u.shadowVolume=e._shadowVolume,u.offsetAttribute=e._offsetAttribute,f=Jrt(u,c);else{let A=lo.computePositions(u);if(f=zge(A,c,i),f.attributes.position.values=Ti.scaleToGeodeticHeight(f.attributes.position.values,r,i),l(e._offsetAttribute)){let m=e._offsetAttribute===mn.NONE?0:1,_=f.attributes.position.values.length,y=new Uint8Array(_/3).fill(m);f.attributes.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}}let h=f.attributes,p=le.fromVertices(h.position.values,void 0,3);return c.position||(f.attributes.position.values=void 0),new yt({attributes:h,indices:f.indices,primitiveType:ve.TRIANGLES,boundingSphere:p,offsetAttribute:e._offsetAttribute})};Zg.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),a=n(i,o);return new Zg({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:o,granularity:i,extrudedHeight:r,height:a,vertexFormat:ke.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(Zg.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=Gge(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var _b=Zg;var Wge=new d,jge=new d,Zrt=new d;function $rt(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function Yge(e,t){let n=[],i=e.positions,o=e.corners,r=e.endPositions,a=new _n,s,c=0,u=0,f,h=0,p;for(f=0;f<i.length;f+=2)p=i[f].length-3,c+=p,h+=p/3*4,u+=i[f+1].length-3;for(c+=3,u+=3,f=0;f<o.length;f++){s=o[f];let R=o[f].leftPositions;l(R)?(p=R.length,c+=p,h+=p/3*2):(p=o[f].rightPositions.length,u+=p,h+=p/3*2)}let A=l(r),m;A&&(m=r[0].length-3,c+=m,u+=m,m/=3,h+=m*4);let _=c+u,y=new Float64Array(_),C=0,E=_-1,b,x,S,B,v,P,N=m/2,L=Ue.createTypedArray(_/3,h+4),g=0;if(L[g++]=C/3,L[g++]=(E-2)/3,A){n.push(C/3),P=Wge,v=jge;let R=r[0];for(f=0;f<N;f++)P=d.fromArray(R,(N-1-f)*3,P),v=d.fromArray(R,(N+f)*3,v),lo.addAttribute(y,v,C),lo.addAttribute(y,P,void 0,E),x=C/3,B=x+1,b=(E-2)/3,S=b-1,L[g++]=b,L[g++]=S,L[g++]=x,L[g++]=B,C+=3,E-=3}let I=0,T=i[I++],w=i[I++];for(y.set(T,C),y.set(w,E-w.length+1),p=w.length-3,n.push(C/3,(E-2)/3),f=0;f<p;f+=3)x=C/3,B=x+1,b=(E-2)/3,S=b-1,L[g++]=b,L[g++]=S,L[g++]=x,L[g++]=B,C+=3,E-=3;for(f=0;f<o.length;f++){let R;s=o[f];let O=s.leftPositions,G=s.rightPositions,F,U=Zrt;if(l(O)){for(E-=3,F=S,n.push(B),R=0;R<O.length/3;R++)U=d.fromArray(O,R*3,U),L[g++]=F-R-1,L[g++]=F-R,lo.addAttribute(y,U,void 0,E),E-=3;n.push(F-Math.floor(O.length/6)),t===Ji.BEVELED&&n.push((E-2)/3+1),C+=3}else{for(C+=3,F=B,n.push(S),R=0;R<G.length/3;R++)U=d.fromArray(G,R*3,U),L[g++]=F+R,L[g++]=F+R+1,lo.addAttribute(y,U,C),C+=3;n.push(F+Math.floor(G.length/6)),t===Ji.BEVELED&&n.push(C/3-1),E-=3}for(T=i[I++],w=i[I++],T.splice(0,3),w.splice(w.length-3,3),y.set(T,C),y.set(w,E-w.length+1),p=w.length-3,R=0;R<w.length;R+=3)B=C/3,x=B-1,S=(E-2)/3,b=S+1,L[g++]=b,L[g++]=S,L[g++]=x,L[g++]=B,C+=3,E-=3;C-=3,E+=3,n.push(C/3,(E-2)/3)}if(A){C+=3,E-=3,P=Wge,v=jge;let R=r[1];for(f=0;f<N;f++)P=d.fromArray(R,(m-f-1)*3,P),v=d.fromArray(R,f*3,v),lo.addAttribute(y,P,void 0,E),lo.addAttribute(y,v,C),B=C/3,x=B-1,S=(E-2)/3,b=S+1,L[g++]=b,L[g++]=S,L[g++]=x,L[g++]=B,C+=3,E-=3;n.push(C/3)}else n.push(C/3,(E-2)/3);return L[g++]=C/3,L[g++]=(E-2)/3,a.position=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:y}),{attributes:a,indices:L,wallIndices:n}}function eat(e){let t=e.ellipsoid,n=lo.computePositions(e),i=Yge(n,e.cornerType),o=i.wallIndices,r=e.height,a=e.extrudedHeight,s=i.attributes,c=i.indices,u=s.position.values,f=u.length,h=new Float64Array(f);h.set(u);let p=new Float64Array(f*2);if(u=Ti.scaleToGeodeticHeight(u,r,t),h=Ti.scaleToGeodeticHeight(h,a,t),p.set(u),p.set(h,f),s.position.values=p,f/=3,l(e.offsetAttribute)){let b=new Uint8Array(f*2);if(e.offsetAttribute===mn.TOP)b=b.fill(1,0,f);else{let x=e.offsetAttribute===mn.NONE?0:1;b=b.fill(x)}s.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}let A,m=c.length,_=Ue.createTypedArray(p.length/3,(m+o.length)*2);_.set(c);let y=m;for(A=0;A<m;A+=2){let b=c[A],x=c[A+1];_[y++]=b+f,_[y++]=x+f}let C,E;for(A=0;A<o.length;A++)C=o[A],E=C+f,_[y++]=C,_[y++]=E;return{attributes:s,indices:_}}function LF(e){e=e??V.EMPTY_OBJECT;let t=e.positions,n=e.width,i=e.height??0,o=e.extrudedHeight??i;this._positions=t,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=e.cornerType??Ji.ROUNDED,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*d.packedLength+te.packedLength+6}LF.pack=function(e,t,n){n=n??0;let i=e._positions,o=i.length;t[n++]=o;for(let r=0;r<o;++r,n+=d.packedLength)d.pack(i[r],t,n);return te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n]=e._offsetAttribute??-1,t};var qge=te.clone(te.UNIT_SPHERE),uC={positions:void 0,ellipsoid:qge,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};LF.unpack=function(e,t,n){t=t??0;let i=e[t++],o=new Array(i);for(let p=0;p<i;++p,t+=d.packedLength)o[p]=d.unpack(e,t);let r=te.unpack(e,t,qge);t+=te.packedLength;let a=e[t++],s=e[t++],c=e[t++],u=e[t++],f=e[t++],h=e[t];return l(n)?(n._positions=o,n._ellipsoid=te.clone(r,n._ellipsoid),n._width=a,n._height=s,n._extrudedHeight=c,n._cornerType=u,n._granularity=f,n._offsetAttribute=h===-1?void 0:h,n):(uC.positions=o,uC.width=a,uC.height=s,uC.extrudedHeight=c,uC.cornerType=u,uC.granularity=f,uC.offsetAttribute=h===-1?void 0:h,new LF(uC))};LF.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=$rt(t,i);let o=Ho(t,d.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,a=e._extrudedHeight,s=!D.equalsEpsilon(r,a,0,D.EPSILON2),c={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1},u;if(s)c.height=r,c.extrudedHeight=a,c.offsetAttribute=e._offsetAttribute,u=eat(c);else{let p=lo.computePositions(c);if(u=Yge(p,c.cornerType),u.attributes.position.values=Ti.scaleToGeodeticHeight(u.attributes.position.values,r,i),l(e._offsetAttribute)){let A=u.attributes.position.values.length,m=e._offsetAttribute===mn.NONE?0:1,_=new Uint8Array(A/3).fill(m);u.attributes.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:_})}}let f=u.attributes,h=le.fromVertices(f.position.values,void 0,3);return new yt({attributes:f,indices:u.indices,primitiveType:ve.LINES,boundingSphere:h,offsetAttribute:e._offsetAttribute})};var OF=LF;var tat=new hi(0);function tu(e){Ii.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}l(Object.create)&&(tu.prototype=Object.create(Ii.prototype),tu.prototype.constructor=tu);Object.defineProperties(tu.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});tu.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!l(t.height)&&!l(t.extrudedHeight)&&vl.isSupported(this._scene)};tu.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||l(n)&&n!==t};tu.prototype._computeCenter=de.throwInstantiationError;tu.prototype._onEntityPropertyChanged=function(e,t,n,i){if(Ii.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))&&It(It.geometryZIndex),this._zIndex=o.zIndex??tat,l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference,a=o.extrudedHeightReference;if(l(r)||l(a)){let s=new Qh(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new o0(this._scene,s,r,a)}};tu.prototype.destroy=function(){l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),Ii.prototype.destroy.call(this)};tu.getGeometryHeight=function(e,t){if(!l(e)){t!==it.NONE&&It(It.geometryHeightReference);return}return gd(t)?0:e};tu.getGeometryExtrudedHeight=function(e,t){if(!l(e)){t!==it.NONE&&It(It.geometryExtrudedHeightReference);return}return gd(t)?tu.CLAMP_TO_GROUND:e};tu.CLAMP_TO_GROUND="clamp";tu.computeGeometryOffsetAttribute=function(e,t,n,i){(!l(e)||!l(t))&&(t=it.NONE),(!l(n)||!l(i))&&(i=it.NONE);let o=0;if(t!==it.NONE&&o++,i===it.RELATIVE_TO_GROUND&&o++,o===2)return mn.ALL;if(o===1)return mn.TOP};var ri=tu;var Kge=new z,Xge=d.ZERO,Jge=new d,Zge=new ce;function nat(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 pm(e,t){ri.call(this,{entity:e,scene:t,geometryOptions:new nat(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}l(Object.create)&&(pm.prototype=Object.create(ri.prototype),pm.prototype.constructor=pm);pm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:$n.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof qt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,Kge)),l(o)||(o=z.WHITE),i.color=Jt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=go.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Xge,Jge))),new Mt({id:t,geometry:new _b(this._options),attributes:i})};pm.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Kge),o={show:new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:$n.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=go.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Xge,Jge))),new Mt({id:t,geometry:new OF(this._options),attributes:o})};pm.prototype._computeCenter=function(e,t){let n=q.getValueOrUndefined(this._entity.corridor.positions,e);if(!(!l(n)||n.length===0))return d.clone(n[Math.floor(n.length/2)],t)};pm.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.width)||Ii.prototype._isHidden.call(this,e,t)};pm.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!q.isConstant(t.height)||!q.isConstant(t.extrudedHeight)||!q.isConstant(t.granularity)||!q.isConstant(t.width)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.cornerType)||!q.isConstant(t.zIndex)||this._onTerrain&&!q.isConstant(this._materialProperty)&&!(this._materialProperty instanceof qt)};pm.prototype._setStaticOptions=function(e,t){let n=q.getValueOrUndefined(t.height,Xe.MINIMUM_VALUE),i=q.getValueOrDefault(t.heightReference,Xe.MINIMUM_VALUE,it.NONE),o=q.getValueOrUndefined(t.extrudedHeight,Xe.MINIMUM_VALUE),r=q.getValueOrDefault(t.extrudedHeightReference,Xe.MINIMUM_VALUE,it.NONE);l(o)&&!l(n)&&(n=0);let a=this._options;a.vertexFormat=this._materialProperty instanceof qt?gn.VERTEX_FORMAT:_o.MaterialSupport.TEXTURED.vertexFormat,a.positions=t.positions.getValue(Xe.MINIMUM_VALUE,a.positions),a.width=t.width.getValue(Xe.MINIMUM_VALUE),a.granularity=q.getValueOrUndefined(t.granularity,Xe.MINIMUM_VALUE),a.cornerType=q.getValueOrUndefined(t.cornerType,Xe.MINIMUM_VALUE),a.offsetAttribute=ri.computeGeometryOffsetAttribute(n,i,o,r),a.height=ri.getGeometryHeight(n,i),o=ri.getGeometryExtrudedHeight(o,r),o===ri.CLAMP_TO_GROUND&&(o=Di.getMinimumMaximumHeights(_b.computeRectangle(a,Zge)).minimumTerrainHeight),a.extrudedHeight=o};pm.DynamicGeometryUpdater=SS;function SS(e,t,n){bi.call(this,e,t,n)}l(Object.create)&&(SS.prototype=Object.create(bi.prototype),SS.prototype.constructor=SS);SS.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.positions)||!l(i.width)||bi.prototype._isHidden.call(this,e,t,n)};SS.prototype._setOptions=function(e,t,n){let i=this._options,o=q.getValueOrUndefined(t.height,n),r=q.getValueOrDefault(t.heightReference,n,it.NONE),a=q.getValueOrUndefined(t.extrudedHeight,n),s=q.getValueOrDefault(t.extrudedHeightReference,n,it.NONE);l(a)&&!l(o)&&(o=0),i.positions=q.getValueOrUndefined(t.positions,n),i.width=q.getValueOrUndefined(t.width,n),i.granularity=q.getValueOrUndefined(t.granularity,n),i.cornerType=q.getValueOrUndefined(t.cornerType,n),i.offsetAttribute=ri.computeGeometryOffsetAttribute(o,r,a,s),i.height=ri.getGeometryHeight(o,r),a=ri.getGeometryExtrudedHeight(a,s),a===ri.CLAMP_TO_GROUND&&(a=Di.getMinimumMaximumHeights(_b.computeRectangle(i,Zge)).minimumTerrainHeight),i.extrudedHeight=a};var FF=pm;function oH(){de.throwInstantiationError()}Object.defineProperties(oH.prototype,{name:{get:de.throwInstantiationError},clock:{get:de.throwInstantiationError},entities:{get:de.throwInstantiationError},isLoading:{get:de.throwInstantiationError},changedEvent:{get:de.throwInstantiationError},errorEvent:{get:de.throwInstantiationError},loadingEvent:{get:de.throwInstantiationError},show:{get:de.throwInstantiationError},clustering:{get:de.throwInstantiationError}});oH.prototype.update=function(e){de.throwInstantiationError()};oH.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var ba=oH;function Np(e,t){this._ellipsoid=e,this._cameraPosition=new d,this._cameraPositionInScaledSpace=new d,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(Np.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=d.magnitudeSquared(n)-1;d.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=n,this._distanceToLimbInScaledSpaceSquared=i}}});var $ge=new d;Np.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,$ge);return dJ(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};Np.prototype.isScaledSpacePointVisible=function(e){return dJ(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var iat=new d;Np.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,o;return l(t)&&t<0&&n.minimumRadius>-t?(o=iat,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),dJ(e,o,i)};Np.prototype.computeHorizonCullingPoint=function(e,t,n){return n_e(this._ellipsoid,e,t,n)};var e_e=te.clone(te.UNIT_SPHERE);Np.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let o=t_e(this._ellipsoid,n,e_e);return n_e(o,e,t,i)};Np.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,o){return i_e(this._ellipsoid,e,t,n,i,o)};Np.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,o,r){let a=t_e(this._ellipsoid,o,e_e);return i_e(a,e,t,n,i,r)};var oat=[];Np.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=ce.subsample(e,t,0,oat),o=le.fromPoints(i);if(!(d.magnitude(o.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(o.center,i,n)};var rat=new d;function t_e(e,t,n){if(l(t)&&t<0&&e.minimumRadius>-t){let i=d.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,rat);e=te.fromCartesian3(i,n)}return e}function n_e(e,t,n,i){l(i)||(i=new d);let o=a_e(e,t),r=0;for(let a=0,s=n.length;a<s;++a){let c=n[a],u=o_e(e,c,o);if(u<0)return;r=Math.max(r,u)}return r_e(o,r,i)}var rH=new d;function i_e(e,t,n,i,o,r){l(r)||(r=new d),i=i??3,o=o??d.ZERO;let a=a_e(e,t),s=0;for(let c=0,u=n.length;c<u;c+=i){rH.x=n[c]+o.x,rH.y=n[c+1]+o.y,rH.z=n[c+2]+o.z;let f=o_e(e,rH,a);if(f<0)return;s=Math.max(s,f)}return r_e(a,s,r)}function dJ(e,t,n){let i=t,o=n,r=d.subtract(e,i,$ge),a=-d.dot(r,i);return!(o<0?a>0:a>o&&a*a/d.magnitudeSquared(r)>o)}var aat=new d,sat=new d;function o_e(e,t,n){let i=e.transformPositionToScaledSpace(t,aat),o=d.magnitudeSquared(i),r=Math.sqrt(o),a=d.divideByScalar(i,r,sat);o=Math.max(1,o),r=Math.max(1,r);let s=d.dot(a,n),c=d.magnitude(d.cross(a,n,a)),u=1/r,f=Math.sqrt(o-1)*u;return 1/(s*u-c*f)}function r_e(e,t,n){if(!(t<=0||t===1/0||t!==t))return d.multiplyByScalar(e,t,n)}var fJ=new d;function a_e(e,t){return d.equals(t,d.ZERO)?t:(e.transformPositionToScaledSpace(t,fJ),d.normalize(fJ,fJ))}var Am=Np;function na(e,t){e=e??V.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=Ht.clone(n)),l(i)&&(i=Ht.clone(i)),l(o)&&(o=zt.clone(o)),this._show=e.show??!0,this._position=d.clone(e.position??d.ZERO),this._actualPosition=d.clone(this._position),this._color=z.clone(e.color??z.WHITE),this._outlineColor=z.clone(e.outlineColor??z.TRANSPARENT),this._outlineWidth=e.outlineWidth??0,this._pixelSize=e.pixelSize??10,this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=o,this._disableDepthTestDistance=e.disableDepthTestDistance??0,this._id=e.id,this._collection=e.collection??t,this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1,this._splitDirection=e.splitDirection??Lr.NONE}var s_e=na.SHOW_INDEX=0,u_e=na.POSITION_INDEX=1,cat=na.COLOR_INDEX=2,lat=na.OUTLINE_COLOR_INDEX=3,uat=na.OUTLINE_WIDTH_INDEX=4,fat=na.PIXEL_SIZE_INDEX=5,dat=na.SCALE_BY_DISTANCE_INDEX=6,hat=na.TRANSLUCENCY_BY_DISTANCE_INDEX=7,mat=na.DISTANCE_DISPLAY_CONDITION_INDEX=8,pat=na.DISABLE_DEPTH_DISTANCE_INDEX=9,Aat=na.SPLIT_DIRECTION_INDEX=10;na.NUMBER_OF_PROPERTIES=11;function Pf(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(na.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Pf(this,s_e))}},position:{get:function(){return this._position},set:function(e){let t=this._position;d.equals(t,e)||(d.clone(e,t),d.clone(e,this._actualPosition),Pf(this,u_e))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Ht.equals(t,e)||(this._scaleByDistance=Ht.clone(e,t),Pf(this,dat))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Ht.equals(t,e)||(this._translucencyByDistance=Ht.clone(e,t),Pf(this,hat))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,Pf(this,fat))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),Pf(this,cat))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),Pf(this,lat))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Pf(this,uat))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){zt.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=zt.clone(e,this._distanceDisplayCondition),Pf(this,mat))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Pf(this,pat))}},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,Pf(this,s_e))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Pf(this,Aat))}}});na.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};na.prototype._getActualPosition=function(){return this._actualPosition};na.prototype._setActualPosition=function(e){d.clone(e,this._actualPosition),Pf(this,u_e)};var c_e=new ie;na._computeActualPosition=function(e,t,n){return t.mode===oe.SCENE3D?e:(M.multiplyByPoint(n,e,c_e),so.computeActualEllipsoidPosition(t,c_e))};var l_e=new ie;na._computeScreenSpacePosition=function(e,t,n,i){let o=M.multiplyByVector(e,ie.fromElements(t.x,t.y,t.z,1,l_e),l_e);return so.worldToWindowCoordinates(n,o,i)};na.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new k);let i=n.modelMatrix,o=na._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(o))return o.y=e.canvas.clientHeight-o.y,o};na.getScreenSpaceBoundingBox=function(e,t,n){let i=e.pixelSize,o=i*.5,r=t.x-o,a=t.y-o,s=i,c=i;return l(n)||(n=new et),n.x=r,n.y=a,n.width=s,n.height=c,n};na.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&d.equals(this._position,e._position)&&z.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&z.equals(this._outlineColor,e._outlineColor)&&Ht.equals(this._scaleByDistance,e._scaleByDistance)&&Ht.equals(this._translucencyByDistance,e._translucencyByDistance)&&zt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};na.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var _s=na;var fC=`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 QF=`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 = czm_decodeRGB8(compressedAttribute0.x);
vec4 outlineColor = czm_decodeRGB8(compressedAttribute0.y);
vec4 pickColor = czm_decodeRGB8(compressedAttribute0.z);
vec4 alphaPacked = czm_decodeRGB8(compressedAttribute0.w);
color.a = alphaPacked.x;
outlineColor.a = alphaPacked.y;
pickColor.a = alphaPacked.z;
///////////////////////////////////////////////////////////////////////////
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 gat=_s.SHOW_INDEX,pJ=_s.POSITION_INDEX,f_e=_s.COLOR_INDEX,_at=_s.OUTLINE_COLOR_INDEX,yat=_s.OUTLINE_WIDTH_INDEX,Cat=_s.PIXEL_SIZE_INDEX,d_e=_s.SCALE_BY_DISTANCE_INDEX,h_e=_s.TRANSLUCENCY_BY_DISTANCE_INDEX,m_e=_s.DISTANCE_DISPLAY_CONDITION_INDEX,Eat=_s.DISABLE_DEPTH_DISTANCE_INDEX,bat=_s.SPLIT_DIRECTION_INDEX,AJ=_s.NUMBER_OF_PROPERTIES,cl={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function qd(e){e=e??V.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(AJ),this._maxPixelSize=1,this._baseVolume=new le,this._baseVolumeWC=new le,this._baseVolume2D=new le,this._boundingVolume=new le,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=M.clone(M.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??er.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=oe.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(qd.prototype,{length:{get:function(){return gJ(this),this._pointPrimitives.length}}});function p_e(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}qd.prototype.add=function(e){let t=new _s(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};qd.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};qd.prototype.removeAll=function(){p_e(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function gJ(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 a=n[o];a&&(a._index=r++,t.push(a))}e._pointPrimitives=t}}qd.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};qd.prototype.contains=function(e){return l(e)&&e._pointPrimitiveCollection===this};qd.prototype.get=function(e){return gJ(this),this._pointPrimitives[e]};qd.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<AJ;++i){let o=n[i]===0?Re.STATIC_DRAW:Re.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function Iat(e,t,n){return new OA(e,[{index:cl.positionHighAndSize,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:n[pJ]},{index:cl.positionLowAndShow,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:n[pJ]},{index:cl.compressedAttribute0,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:n[f_e]},{index:cl.compressedAttribute1,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:n[h_e]},{index:cl.scaleByDistance,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:n[d_e]},{index:cl.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:n[m_e]}],t)}var hJ=new xn,aH=new z;function A_e(e,t,n,i){let o=i._index,r=i._getActualPosition();e._mode===oe.SCENE3D&&(le.expand(e._baseVolume,r,e._baseVolume),e._boundingVolumeDirty=!0),xn.fromCartesian(r,hJ);let a=i.pixelSize,s=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,a+s);let c=n[cl.positionHighAndSize],u=hJ.high;c(o,u.x,u.y,u.z,a);let f=n[cl.positionLowAndOutline],h=hJ.low;f(o,h.x,h.y,h.z,s)}var xat=256;function g_e(e,t,n,i){let o=i._index,r=i.color,a=i.outlineColor,s=i.getPickId(t).color;aH.red=r.alpha,aH.green=a.alpha,aH.blue=s.alpha;let c=n[cl.compressedAttribute0];c(o,tn.encodeRGB8(r),tn.encodeRGB8(a),tn.encodeRGB8(s),tn.encodeRGB8(aH))}function __e(e,t,n,i){let o=i._index,r=0,a=1,s=1,c=1,u=i.translucencyByDistance;l(u)&&(r=u.near,a=u.nearValue,s=u.far,c=u.farValue,(a!==1||c!==1)&&(e._shaderTranslucencyByDistance=!0));let f=i.show&&i.clusterShow;i.color.alpha===0&&i.outlineColor.alpha===0&&(f=!1),a=D.clamp(a,0,1),a=a===1?255:a*255|0;let h=(f?1:0)*xat+a;c=D.clamp(c,0,1),c=c===1?255:c*255|0;let p=c,A=n[cl.compressedAttribute1];A(o,h,p,r,s)}function y_e(e,t,n,i){let o=i._index,r=n[cl.scaleByDistance],a=0,s=1,c=1,u=1,f=i.scaleByDistance;l(f)&&(a=f.near,s=f.nearValue,c=f.far,u=f.farValue,(s!==1||u!==1)&&(e._shaderScaleByDistance=!0)),r(o,a,s,c,u)}function C_e(e,t,n,i){let o=i._index,r=n[cl.distanceDisplayConditionAndDisableDepthAndSplitDirection],a=0,s=Number.MAX_VALUE,c=i.distanceDisplayCondition;l(c)&&(a=c.near,s=c.far,a*=a,s*=s,e._shaderDistanceDisplayCondition=!0);let u=i.disableDepthTestDistance;u*=u,u>0&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1));let f=0,h=i.splitDirection;l(h)&&(f=h),r(o,a,s,u,f)}function Tat(e,t,n,i){A_e(e,t,n,i),g_e(e,t,n,i),__e(e,t,n,i),y_e(e,t,n,i),C_e(e,t,n,i)}function mJ(e,t,n,i,o,r){let a;i.mode===oe.SCENE3D?(a=e._baseVolume,e._boundingVolumeDirty=!0):a=e._baseVolume2D;let s=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,h=_s._computeActualPosition(f,i,o);l(h)&&(u._setActualPosition(h),r?s.push(h):le.expand(a,h,a))}r&&le.fromPoints(s,a)}function Sat(e,t){let n=t.mode,i=e._pointPrimitives,o=e._pointPrimitivesToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==oe.SCENE3D&&!M.equals(r,e.modelMatrix)?(e._mode=n,M.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===oe.SCENE3D||n===oe.SCENE2D||n===oe.COLUMBUS_VIEW)&&mJ(e,i,i.length,t,r,!0)):n===oe.MORPHING?mJ(e,i,i.length,t,r,!0):(n===oe.SCENE2D||n===oe.COLUMBUS_VIEW)&&mJ(e,o,e._pointPrimitivesToUpdateIndex,t,r,!1)}function wat(e,t,n){let o=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=o}var Bat=[];qd.prototype.update=function(e){if(gJ(this),!this.show)return;this._maxTotalPointSize=Rt.maximumAliasedPointSize,Sat(this,e);let n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,o=this._pointPrimitivesToUpdateIndex,r=this._propertiesChanged,a=this._createVertexArray,s,c=e.context,u=e.passes,f=u.pick;if(a||!f&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let S=0;S<AJ;++S)r[S]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=Iat(c,n,this._buffersUsage),s=this._vaf.writers;for(let S=0;S<n;++S){let B=this._pointPrimitives[S];B._dirty=!1,Tat(this,c,s,B)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(o>0){let S=Bat;S.length=0,(r[pJ]||r[yat]||r[Cat])&&S.push(A_e),(r[f_e]||r[_at])&&S.push(g_e),(r[gat]||r[h_e])&&S.push(__e),r[d_e]&&S.push(y_e),(r[m_e]||r[Eat]||r[bat])&&S.push(C_e);let B=S.length;if(s=this._vaf.writers,o/n>.1){for(let v=0;v<o;++v){let P=i[v];P._dirty=!1;for(let N=0;N<B;++N)S[N](this,c,s,P)}this._vaf.commit()}else{for(let v=0;v<o;++v){let P=i[v];P._dirty=!1;for(let N=0;N<B;++N)S[N](this,c,s,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,le.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let h,p=M.IDENTITY;e.mode===oe.SCENE3D?(p=this.modelMatrix,h=le.clone(this._baseVolumeWC,this._boundingVolume)):h=le.clone(this._baseVolume2D,this._boundingVolume),wat(this,e,h);let A=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,A&&(this._blendOption===er.OPAQUE||this._blendOption===er.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ve.fromCache({depthTest:{enabled:!0,func:ee.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===er.TRANSLUCENT||this._blendOption===er.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ve.fromCache({depthTest:{enabled:!0,func:ee.LEQUAL},depthMask:!1,blending:sn.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let m,_;(A||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(m=new We({sources:[QF]}),this._shaderScaleByDistance&&m.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&m.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&m.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&m.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===er.OPAQUE_AND_TRANSLUCENT&&(_=new We({defines:["OPAQUE"],sources:[fC]}),this._sp=$t.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:_,attributeLocations:cl}),_=new We({defines:["TRANSLUCENT"],sources:[fC]}),this._spTranslucent=$t.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:_,attributeLocations:cl})),this._blendOption===er.OPAQUE&&(_=new We({sources:[fC]}),this._sp=$t.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:_,attributeLocations:cl})),this._blendOption===er.TRANSLUCENT&&(_=new We({sources:[fC]}),this._spTranslucent=$t.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:_,attributeLocations:cl})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let y,C,E,b,x=e.commandList;if(u.render||f){let S=this._colorCommands,B=this._blendOption===er.OPAQUE,v=this._blendOption===er.OPAQUE_AND_TRANSLUCENT;y=this._vaf.va,C=y.length,S.length=C;let P=v?C*2:C;for(b=0;b<P;++b){let N=B||v&&b%2===0;E=S[b],l(E)||(E=S[b]=new nt),E.primitiveType=ve.POINTS,E.pass=N||!v?Be.OPAQUE:Be.TRANSLUCENT,E.owner=this;let L=v?Math.floor(b/2):b;E.boundingVolume=h,E.modelMatrix=p,E.shaderProgram=N?this._sp:this._spTranslucent,E.uniformMap=this._uniforms,E.vertexArray=y[L].va,E.renderState=N?this._rsOpaque:this._rsTranslucent,E.debugShowBoundingVolume=this.debugShowBoundingVolume,E.pickId="v_pickColor",x.push(E)}}};qd.prototype.isDestroyed=function(){return!1};qd.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),p_e(this._pointPrimitives),fe(this)};var wS=qd;function gm(e){e=e??V.EMPTY_OBJECT,this._enabled=e.enabled??!1,this._pixelRange=e.pixelRange??80,this._minimumClusterSize=e.minimumClusterSize??2,this._clusterBillboards=e.clusterBillboards??!0,this._clusterLabels=e.clusterLabels??!0,this._clusterPoints=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 _e,this.show=e.show??!0}function E_e(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var Dat=new et;function b_e(e,t,n,i,o){if(l(e._labelCollection)&&i._clusterLabels?o=qy.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)),E_e(o,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&x_e(i,e.id.id)&&l(e.id._label)){let r=i._collectionIndicesByEntity[e.id.id].labelIndex,a=i._labelCollection.get(r),s=qy.getScreenSpaceBoundingBox(a,t,Dat);E_e(s,n),o=et.union(o,s,o)}return o}function vat(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&x_e(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 I_e(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 x_e(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function _J(e,t,n,i,o){if(!l(e))return;let r=e.length;for(let a=0;a<r;++a){let s=e.get(a);if(s.clusterShow=!1,!s.show||o._scene.mode===oe.SCENE3D&&!i.isPointVisible(s.position))continue;let c=o._clusterLabels&&l(s._labelCollection),u=o._clusterBillboards&&l(s.id._billboard),f=o._clusterPoints&&l(s.id._point);if(c&&(f||u))continue;let h=s.computeScreenSpacePosition(n);l(h)&&t.push({index:a,collection:e,clustered:!1,coord:h})}}var Pat=new et,Rat=new et,Mat=new et;function Nat(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 a=e._clusterLabelCollection,s=e._clusterBillboardCollection,c=e._clusterPointCollection;l(a)?a.removeAll():a=e._clusterLabelCollection=new Bp({scene:n}),l(s)?s.removeAll():s=e._clusterBillboardCollection=new Sf({scene:n}),l(c)?c.removeAll():c=e._clusterPointCollection=new wS;let u=e._pixelRange,f=e._minimumClusterSize,h=e._previousClusters,p=[],A=e._previousHeight,m=n.camera.positionCartographic.height,_=n.ellipsoid,y=n.camera.positionWC,C=new Am(_,y),E=[];e._clusterLabels&&_J(i,E,n,C,e),e._clusterBillboards&&_J(o,E,n,C,e),e._clusterPoints&&_J(r,E,n,C,e);let b,x,S,B,v,P,N,L,g,I,T,w;if(E.length>0){let R=new uE(E.length,64,Float64Array);for(let O=0;O<E.length;++O)R.add(E[O].coord.x,E[O].coord.y);if(R.finish(),m<A)for(S=h.length,b=0;b<S;++b){let O=h[b];if(!C.isPointVisible(O.position))continue;let G=Ro._computeScreenSpacePosition(M.IDENTITY,O.position,d.ZERO,k.ZERO,n);if(!l(G))continue;let F=1-m/A,U=O.width=O.width*F,Q=O.height=O.height*F;U=Math.max(U,O.minimumWidth),Q=Math.max(Q,O.minimumHeight);let H=G.x-U*.5,Y=G.y-Q*.5,$=G.x+U,W=G.y+Q;for(v=R.range(H,Y,$,W),P=v.length,I=0,g=[],x=0;x<P;++x)N=v[x],L=E[N],L.clustered||(++I,T=L.collection,w=L.index,g.push(T.get(w).id));if(I>=f)for(I_e(O.position,I,g,e),p.push(O),x=0;x<P;++x)E[v[x]].clustered=!0}for(S=E.length,b=0;b<S;++b){let O=E[b];if(O.clustered)continue;O.clustered=!0,T=O.collection,w=O.index;let G=T.get(w);B=b_e(G,O.coord,u,e,Pat);let F=et.clone(B,Rat);v=R.range(B.x,B.y,B.x+B.width,B.y+B.height),P=v.length;let U=d.clone(G.position);for(I=1,g=[G.id],x=0;x<P;++x)if(N=v[x],L=E[N],!L.clustered){let Q=L.collection.get(L.index),H=b_e(Q,L.coord,u,e,Mat);d.add(Q.position,U,U),et.union(F,H,F),++I,g.push(Q.id)}if(I>=f){let Q=d.multiplyByScalar(U,1/I,U);for(I_e(Q,I,g,e),p.push({position:Q,width:F.width,height:F.height,minimumWidth:B.width,minimumHeight:B.height}),x=0;x<P;++x)E[v[x]].clustered=!0}else vat(G,e)}}a.length===0&&(a.destroy(),e._clusterLabelCollection=void 0),s.length===0&&(s.destroy(),e._clusterBillboardCollection=void 0),c.length===0&&(c.destroy(),e._clusterPointCollection=void 0),e._previousClusters=p,e._previousHeight=m}}gm.prototype._initialize=function(e){this._scene=e;let t=Nat(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(gm.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}},ready:{get:function(){return!this._enabledDirty&&!this._clusterDirty&&(!l(this._billboardCollection)||this._billboardCollection.ready)&&(!l(this._labelCollection)||this._labelCollection.ready)}}});function CJ(e,t,n,i){return function(o){let r=this[e];l(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let a=this._collectionIndicesByEntity[o.id];if(l(a)||(a=this._collectionIndicesByEntity[o.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),l(r)&&l(a[i]))return r.get(a[i]);l(r)||(r=this[e]=new t({scene:this._scene}));let s,c,u=this[n];u.length>0?(s=u.shift(),c=r.get(s)):(c=r.add(),s=r.length-1),a[i]=s;let f=this;return Promise.resolve().then(function(){f._clusterDirty=!0}),c}}function EJ(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}gm.prototype.getLabel=CJ("_labelCollection",Bp,"_unusedLabelIndices","labelIndex");gm.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,EJ(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};gm.prototype.getBillboard=CJ("_billboardCollection",Sf,"_unusedBillboardIndices","billboardIndex");gm.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,EJ(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};gm.prototype.getPoint=CJ("_pointCollection",wS,"_unusedPointIndices","pointIndex");gm.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,EJ(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function yJ(e){if(!l(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function Lat(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,yJ(e._labelCollection),yJ(e._billboardCollection),yJ(e._pointCollection))}gm.prototype.update=function(e){if(!this.show)return;let t,n=this._labelCollection;l(n)&&n.length>0&&!n.ready&&(t=e.commandList,e.commandList=[],n.update(e),e.commandList=t);let i=this._billboardCollection;l(i)&&i.length>0&&!i.ready&&(t=e.commandList,e.commandList=[],i.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,Lat(this),this._clusterDirty=!0),this._clusterDirty&&(this._cluster(),this._clusterDirty=l(n)&&!n.ready||l(i)&&!i.ready),l(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),l(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),l(this._clusterPointCollection)&&this._clusterPointCollection.update(e),l(n)&&n.update(e),l(i)&&i.update(e),l(this._pointCollection)&&this._pointCollection.update(e)};gm.prototype.destroy=function(){l(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),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(),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 Rf=gm;function bJ(e){this._name=e,this._clock=void 0,this._changed=new _e,this._error=new _e,this._isLoading=!1,this._loading=new _e,this._entityCollection=new Vs(this),this._entityCluster=new Rf}Object.defineProperties(bJ.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){ba.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}}});bJ.prototype.update=function(e){return!0};var kF=bJ;var T_e={};T_e.computePositions=function(e,t,n,i,o){let r=e*.5,a=-r,s=i+i,c=o?2*s:s,u=new Float64Array(c*3),f,h=0,p=0,A=o?s*3:0,m=o?(s+i)*3:i*3;for(f=0;f<i;f++){let _=f/i*D.TWO_PI,y=Math.cos(_),C=Math.sin(_),E=y*n,b=C*n,x=y*t,S=C*t;u[p+A]=E,u[p+A+1]=b,u[p+A+2]=a,u[p+m]=x,u[p+m+1]=S,u[p+m+2]=r,p+=3,o&&(u[h++]=E,u[h++]=b,u[h++]=a,u[h++]=x,u[h++]=S,u[h++]=r)}return u};var yb=T_e;var IJ=new k,Oat=new d,Fat=new d,Qat=new d,kat=new d;function $g(e){e=e??V.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,o=e.vertexFormat??ke.DEFAULT,r=e.slices??128;this._length=t,this._topRadius=n,this._bottomRadius=i,this._vertexFormat=ke.clone(o),this._slices=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}$g.packedLength=ke.packedLength+5;$g.pack=function(e,t,n){return n=n??0,ke.pack(e._vertexFormat,t,n),n+=ke.packedLength,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n]=e._offsetAttribute??-1,t};var S_e=new ke,BS={vertexFormat:S_e,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};$g.unpack=function(e,t,n){t=t??0;let i=ke.unpack(e,t,S_e);t+=ke.packedLength;let o=e[t++],r=e[t++],a=e[t++],s=e[t++],c=e[t];return l(n)?(n._vertexFormat=ke.clone(i,n._vertexFormat),n._length=o,n._topRadius=r,n._bottomRadius=a,n._slices=s,n._offsetAttribute=c===-1?void 0:c,n):(BS.length=o,BS.topRadius=r,BS.bottomRadius=a,BS.slices=s,BS.offsetAttribute=c===-1?void 0:c,new $g(BS))};$g.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 a=r+r,s=r+a,c=a+a,u=yb.computePositions(t,n,i,r,!0),f=o.st?new Float32Array(c*2):void 0,h=o.normal?new Float32Array(c*3):void 0,p=o.tangent?new Float32Array(c*3):void 0,A=o.bitangent?new Float32Array(c*3):void 0,m,_=o.normal||o.tangent||o.bitangent;if(_){let v=o.tangent||o.bitangent,P=0,N=0,L=0,g=Math.atan2(i-n,t),I=Oat;I.z=Math.sin(g);let T=Math.cos(g),w=Qat,R=Fat;for(m=0;m<r;m++){let O=m/r*D.TWO_PI,G=T*Math.cos(O),F=T*Math.sin(O);_&&(I.x=G,I.y=F,v&&(w=d.normalize(d.cross(d.UNIT_Z,I,w),w)),o.normal&&(h[P++]=I.x,h[P++]=I.y,h[P++]=I.z,h[P++]=I.x,h[P++]=I.y,h[P++]=I.z),o.tangent&&(p[N++]=w.x,p[N++]=w.y,p[N++]=w.z,p[N++]=w.x,p[N++]=w.y,p[N++]=w.z),o.bitangent&&(R=d.normalize(d.cross(I,w,R),R),A[L++]=R.x,A[L++]=R.y,A[L++]=R.z,A[L++]=R.x,A[L++]=R.y,A[L++]=R.z))}for(m=0;m<r;m++)o.normal&&(h[P++]=0,h[P++]=0,h[P++]=-1),o.tangent&&(p[N++]=1,p[N++]=0,p[N++]=0),o.bitangent&&(A[L++]=0,A[L++]=-1,A[L++]=0);for(m=0;m<r;m++)o.normal&&(h[P++]=0,h[P++]=0,h[P++]=1),o.tangent&&(p[N++]=1,p[N++]=0,p[N++]=0),o.bitangent&&(A[L++]=0,A[L++]=1,A[L++]=0)}let y=12*r-12,C=Ue.createTypedArray(c,y),E=0,b=0;for(m=0;m<r-1;m++)C[E++]=b,C[E++]=b+2,C[E++]=b+3,C[E++]=b,C[E++]=b+3,C[E++]=b+1,b+=2;for(C[E++]=a-2,C[E++]=0,C[E++]=1,C[E++]=a-2,C[E++]=1,C[E++]=a-1,m=1;m<r-1;m++)C[E++]=a+m+1,C[E++]=a+m,C[E++]=a;for(m=1;m<r-1;m++)C[E++]=s,C[E++]=s+m,C[E++]=s+m+1;let x=0;if(o.st){let v=Math.max(n,i);for(m=0;m<c;m++){let P=d.fromArray(u,m*3,kat);f[x++]=(P.x+v)/(2*v),f[x++]=(P.y+v)/(2*v)}}let S=new _n;o.position&&(S.position=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:u})),o.normal&&(S.normal=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:h})),o.tangent&&(S.tangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:p})),o.bitangent&&(S.bitangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:A})),o.st&&(S.st=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:f})),IJ.x=t*.5,IJ.y=Math.max(i,n);let B=new le(d.ZERO,k.magnitude(IJ));if(l(e._offsetAttribute)){t=u.length;let v=e._offsetAttribute===mn.NONE?0:1,P=new Uint8Array(t/3).fill(v);S.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:P})}return new yt({attributes:S,indices:C,primitiveType:ve.TRIANGLES,boundingSphere:B,offsetAttribute:e._offsetAttribute})};var xJ;$g.getUnitCylinder=function(){return l(xJ)||(xJ=$g.createGeometry(new $g({topRadius:1,bottomRadius:1,length:1,vertexFormat:ke.POSITION_ONLY}))),xJ};var UF=$g;var TJ=new k;function DS(e){e=e??V.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,o=e.slices??128,r=Math.max(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"}DS.packedLength=6;DS.pack=function(e,t,n){return n=n??0,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n++]=e._numberOfVerticalLines,t[n]=e._offsetAttribute??-1,t};var Cb={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};DS.unpack=function(e,t,n){t=t??0;let i=e[t++],o=e[t++],r=e[t++],a=e[t++],s=e[t++],c=e[t];return l(n)?(n._length=i,n._topRadius=o,n._bottomRadius=r,n._slices=a,n._numberOfVerticalLines=s,n._offsetAttribute=c===-1?void 0:c,n):(Cb.length=i,Cb.topRadius=o,Cb.bottomRadius=r,Cb.slices=a,Cb.numberOfVerticalLines=s,Cb.offsetAttribute=c===-1?void 0:c,new DS(Cb))};DS.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 a=o*2,s=yb.computePositions(t,n,i,o,!1),c=o*2,u;if(r>0){let _=Math.min(r,o);u=Math.round(o/_),c+=_}let f=Ue.createTypedArray(a,c*2),h=0,p;for(p=0;p<o-1;p++)f[h++]=p,f[h++]=p+1,f[h++]=p+o,f[h++]=p+1+o;if(f[h++]=o-1,f[h++]=0,f[h++]=o+o-1,f[h++]=o,r>0)for(p=0;p<o;p+=u)f[h++]=p,f[h++]=p+o;let A=new _n;A.position=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:s}),TJ.x=t*.5,TJ.y=Math.max(i,n);let m=new le(d.ZERO,k.magnitude(TJ));if(l(e._offsetAttribute)){t=s.length;let _=e._offsetAttribute===mn.NONE?0:1,y=new Uint8Array(t/3).fill(_);A.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}return new yt({attributes:A,indices:f,primitiveType:ve.LINES,boundingSphere:m,offsetAttribute:e._offsetAttribute})};var zF=DS;var w_e=d.ZERO,B_e=new d,Uat=new d,D_e=new z;function zat(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 Mf(e,t){Ii.call(this,{entity:e,scene:t,geometryOptions:new zat(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}l(Object.create)&&(Mf.prototype=Object.create(Ii.prototype),Mf.prototype.constructor=Mf);Object.defineProperties(Mf.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Mf.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=$n.fromDistanceDisplayCondition(o),a={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof qt){let s;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,D_e)),l(s)||(s=z.WHITE),a.color=Jt.fromColor(s)}return l(this._options.offsetAttribute)&&(a.offset=go.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,w_e,B_e))),new Mt({id:t,geometry:new UF(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:a})};Mf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,D_e),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:$n.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=go.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,w_e,B_e))),new Mt({id:t,geometry:new zF(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:r})};Mf.prototype._computeCenter=function(e,t){return q.getValueOrUndefined(this._entity.position,e,t)};Mf.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.length)||!l(t.topRadius)||!l(t.bottomRadius)||Ii.prototype._isHidden.call(this,e,t)};Mf.prototype._isDynamic=function(e,t){return!e.position.isConstant||!q.isConstant(e.orientation)||!t.length.isConstant||!t.topRadius.isConstant||!t.bottomRadius.isConstant||!q.isConstant(t.slices)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.numberOfVerticalLines)};Mf.prototype._setStaticOptions=function(e,t){let n=q.getValueOrDefault(t.heightReference,Xe.MINIMUM_VALUE,it.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof qt?gn.VERTEX_FORMAT:_o.MaterialSupport.TEXTURED.vertexFormat,i.length=t.length.getValue(Xe.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(Xe.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(Xe.MINIMUM_VALUE),i.slices=q.getValueOrUndefined(t.slices,Xe.MINIMUM_VALUE),i.numberOfVerticalLines=q.getValueOrUndefined(t.numberOfVerticalLines,Xe.MINIMUM_VALUE),i.offsetAttribute=n!==it.NONE?mn.ALL:void 0};Mf.prototype._onEntityPropertyChanged=KA;Mf.DynamicGeometryUpdater=vS;function vS(e,t,n){bi.call(this,e,t,n)}l(Object.create)&&(vS.prototype=Object.create(bi.prototype),vS.prototype.constructor=vS);vS.prototype._isHidden=function(e,t,n){let i=this._options,o=q.getValueOrUndefined(e.position,n,Uat);return!l(o)||!l(i.length)||!l(i.topRadius)||!l(i.bottomRadius)||bi.prototype._isHidden.call(this,e,t,n)};vS.prototype._setOptions=function(e,t,n){let i=q.getValueOrDefault(t.heightReference,n,it.NONE),o=this._options;o.length=q.getValueOrUndefined(t.length,n),o.topRadius=q.getValueOrUndefined(t.topRadius,n),o.bottomRadius=q.getValueOrUndefined(t.bottomRadius,n),o.slices=q.getValueOrUndefined(t.slices,n),o.numberOfVerticalLines=q.getValueOrUndefined(t.numberOfVerticalLines,n),o.offsetAttribute=i!==it.NONE?mn.ALL:void 0};var GF=Mf;var Gat={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2},Ia=Object.freeze(Gat);var Vat={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2},Uo=Object.freeze(Vat);var Hat={NONE:0,HOLD:1,EXTRAPOLATE:2},Nf=Object.freeze(Hat);var v_e=Wr(rf(),1);function Wat(e){let t=new v_e.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var e_=Wat;var jat=D.factorial;function SJ(e,t,n,i,o,r){let a=0,s,c,u;if(i>0){for(c=0;c<o;c++){for(s=!1,u=0;u<r.length&&!s;u++)c===r[u]&&(s=!0);s||(r.push(c),a+=SJ(e,t,n,i-1,o,r),r.splice(r.length-1,1))}return a}for(a=1,c=0;c<o;c++){for(s=!1,u=0;u<r.length&&!s;u++)c===r[u]&&(s=!0);s||(a*=e-n[t[c]])}return a}var sH={type:"Hermite"};sH.getRequiredDataPoints=function(e,t){return t=t??0,Math.max(Math.floor((e+1)/(t+1)),2)};sH.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,a,s,c,u,f,h=t.length,p=new Array(i);for(r=0;r<i;r++){o[r]=0;let y=new Array(h);for(p[r]=y,a=0;a<h;a++)y[a]=[]}let A=h,m=new Array(A);for(r=0;r<A;r++)m[r]=r;let _=h-1;for(c=0;c<i;c++){for(a=0;a<A;a++)f=m[a]*i+c,p[c][0].push(n[f]);for(r=1;r<A;r++){let y=!1;for(a=0;a<A-r;a++){let C=t[m[a]],E=t[m[a+r]],b;E-C<=0?(f=m[a]*i+i*r+c,b=n[f],p[c][r].push(b/jat(r))):(b=p[c][r-1][a+1]-p[c][r-1][a],p[c][r].push(b/(E-C))),y=y||b!==0}y||(_=r-1)}}for(s=0,u=0;s<=u;s++)for(r=s;r<=_;r++){let y=SJ(e,m,t,s,r,[]);for(c=0;c<i;c++){let C=p[c][r][0];o[c+s*i]+=C*y}}return o};var Yat=[];sH.interpolate=function(e,t,n,i,o,r,a){let s=i*(r+1);l(a)||(a=new Array(s));for(let C=0;C<s;C++)a[C]=0;let c=t.length,u=new Array(c*(o+1)),f;for(f=0;f<c;f++)for(let C=0;C<o+1;C++)u[f*(o+1)+C]=f;let h=u.length,p=Yat,A=qat(p,u,t,n,i,o),m=[],_=h*(h+1)/2,y=Math.min(A,r);for(let C=0;C<=y;C++)for(f=C;f<=A;f++){m.length=0;let E=SJ(e,u,t,C,f,m),b=Math.floor(f*(1-f)/2)+h*f;for(let x=0;x<i;x++){let S=Math.floor(x*_),B=p[S+b];a[x+C*i]+=B*E}}return a};function qat(e,t,n,i,o,r){let a,s,c=-1,u=t.length,f=u*(u+1)/2;for(let h=0;h<o;h++){let p=Math.floor(h*f);for(a=0;a<u;a++)s=t[a]*o*(r+1)+h,e[p+a]=i[s];for(let A=1;A<u;A++){let m=0,_=Math.floor(A*(1-A)/2)+u*A,y=!1;for(a=0;a<u-A;a++){let C=n[t[a]],E=n[t[a+A]],b,x;if(E-C<=0)s=t[a]*o*(r+1)+o*A+h,b=i[s],x=b/D.factorial(A),e[p+_+m]=x,m++;else{let S=Math.floor((A-1)*(2-A)/2)+u*(A-1);b=e[p+S+a+1]-e[p+S+a],x=b/(E-C),e[p+_+m]=x,m++}y=y||b!==0}y&&(c=Math.max(c,A))}}return c}var VF=sH;var wJ={type:"Lagrange"};wJ.getRequiredDataPoints=function(e){return Math.max(e+1,2)};wJ.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,a,s=t.length;for(r=0;r<i;r++)o[r]=0;for(r=0;r<s;r++){let c=1;for(a=0;a<s;a++)if(a!==r){let u=t[r]-t[a];c*=(e-t[a])/u}for(a=0;a<i;a++)o[a]+=c*n[r*i+a]}return o};var HF=wJ;var BJ={type:"Linear"};BJ.getRequiredDataPoints=function(e){return 2};BJ.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,a,s,c=t[0],u=t[1];for(r=0;r<i;r++)a=n[r],s=n[r+i],o[r]=((s-a)*e+u*a-c*s)/(u-c);return o};var Eb=BJ;function ll(e,t,n){this.clock=e??0,this.cone=t??0,this.magnitude=n??1}ll.fromCartesian3=function(e,t){let n=e.x,i=e.y,o=e.z,r=n*n+i*i;return l(t)||(t=new ll),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(r),o),t.magnitude=Math.sqrt(r+o*o),t};ll.clone=function(e,t){if(l(e))return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new ll(e.clock,e.cone,e.magnitude)};ll.normalize=function(e,t){return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new ll(e.clock,e.cone,1)};ll.equals=function(e,t){return e===t||l(e)&&l(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};ll.equalsEpsilon=function(e,t,n){return n=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};ll.prototype.equals=function(e){return ll.equals(this,e)};ll.prototype.clone=function(e){return ll.clone(this,e)};ll.prototype.equalsEpsilon=function(e,t){return ll.equalsEpsilon(this,e,t)};ll.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var WF=ll;var XF=Wr(rf(),1);var DJ;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?DJ=function(){return performance.now()}:DJ=function(){return Date.now()};var Fi=DJ;function vJ(e){e=e??V.EMPTY_OBJECT;let t=e.currentTime,n=e.startTime,i=e.stopTime;l(t)?t=X.clone(t):l(n)?t=X.clone(n):l(i)?t=X.addDays(i,-1,new X):t=X.now(),l(n)?n=X.clone(n):n=X.clone(t),l(i)?i=X.clone(i):i=X.addDays(n,1,new X),this.startTime=n,this.stopTime=i,this.clockRange=e.clockRange??Ia.UNBOUNDED,this.canAnimate=e.canAnimate??!0,this.onTick=new _e,this.onStop=new _e,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=Fi(),this.currentTime=t,this.multiplier=e.multiplier??1,this.shouldAnimate=e.shouldAnimate??!1,this.clockStep=e.clockStep??Uo.SYSTEM_CLOCK_MULTIPLIER}Object.defineProperties(vJ.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){X.equals(this._currentTime,e)||(this._clockStep===Uo.SYSTEM_CLOCK&&(this._clockStep=Uo.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===Uo.SYSTEM_CLOCK&&(this._clockStep=Uo.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===Uo.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=X.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===Uo.SYSTEM_CLOCK&&(this._clockStep=Uo.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});vJ.prototype.tick=function(){let e=Fi(),t=X.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===Uo.SYSTEM_CLOCK)t=X.now(t);else{let i=this._multiplier;if(n===Uo.TICK_DEPENDENT)t=X.addSeconds(t,i,t);else{let s=e-this._lastSystemTime;t=X.addSeconds(t,i*(s/1e3),t)}let o=this.clockRange,r=this.startTime,a=this.stopTime;if(o===Ia.CLAMPED)X.lessThan(t,r)?t=X.clone(r,t):X.greaterThan(t,a)&&(t=X.clone(a,t),this.onStop.raiseEvent(this));else if(o===Ia.LOOP_STOP)for(X.lessThan(t,r)&&(t=X.clone(r,t));X.greaterThan(t,a);)t=X.addSeconds(r,X.secondsDifference(t,a),t),this.onStop.raiseEvent(this)}}return this._currentTime=t,this._lastSystemTime=e,this.onTick.raiseEvent(this),t};var _m=vJ;function bb(){this._definitionChanged=new _e,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(bb.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:Nl("startTime"),stopTime:Nl("stopTime"),currentTime:Nl("currentTime"),clockRange:Nl("clockRange"),clockStep:Nl("clockStep"),multiplier:Nl("multiplier")});bb.prototype.clone=function(e){return l(e)||(e=new bb),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};bb.prototype.equals=function(e){return this===e||l(e)&&X.equals(this.startTime,e.startTime)&&X.equals(this.stopTime,e.stopTime)&&X.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier};bb.prototype.merge=function(e){this.startTime=this.startTime??e.startTime,this.stopTime=this.stopTime??e.stopTime,this.currentTime=this.currentTime??e.currentTime,this.clockRange=this.clockRange??e.clockRange,this.clockStep=this.clockStep??e.clockStep,this.multiplier=this.multiplier??e.multiplier};bb.prototype.getValue=function(e){return l(e)||(e=new _m),e.startTime=this.startTime??e.startTime,e.stopTime=this.stopTime??e.stopTime,e.currentTime=this.currentTime??e.currentTime,e.clockRange=this.clockRange??e.clockRange,e.multiplier=this.multiplier??e.multiplier,e.clockStep=this.clockStep??e.clockStep,e};var ym=bb;var Kat=z.WHITE,Xat=.1,Jat=new k(8,8),Zat=new k(0,0),$at=new k(1,1);function PS(e){e=e??V.EMPTY_OBJECT,this._definitionChanged=new _e,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(PS.prototype,{isConstant:{get:function(){return q.isConstant(this._color)&&q.isConstant(this._cellAlpha)&&q.isConstant(this._lineCount)&&q.isConstant(this._lineThickness)&&q.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:Ae("color"),cellAlpha:Ae("cellAlpha"),lineCount:Ae("lineCount"),lineThickness:Ae("lineThickness"),lineOffset:Ae("lineOffset")});PS.prototype.getType=function(e){return"Grid"};var est=new X;PS.prototype.getValue=function(e,t){return l(e)||(e=X.now(est)),l(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,Kat,t.color),t.cellAlpha=q.getValueOrDefault(this._cellAlpha,e,Xat),t.lineCount=q.getValueOrClonedDefault(this._lineCount,e,Jat,t.lineCount),t.lineThickness=q.getValueOrClonedDefault(this._lineThickness,e,$at,t.lineThickness),t.lineOffset=q.getValueOrClonedDefault(this._lineOffset,e,Zat,t.lineOffset),t};PS.prototype.equals=function(e){return this===e||e instanceof PS&&q.equals(this._color,e._color)&&q.equals(this._cellAlpha,e._cellAlpha)&&q.equals(this._lineCount,e._lineCount)&&q.equals(this._lineThickness,e._lineThickness)&&q.equals(this._lineOffset,e._lineOffset)};var RS=PS;function MS(e){this._definitionChanged=new _e,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(MS.prototype,{isConstant:{get:function(){return q.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:Ae("color")});MS.prototype.getType=function(e){return"PolylineArrow"};var tst=new X;MS.prototype.getValue=function(e,t){return l(e)||(e=X.now(tst)),l(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,z.WHITE,t.color),t};MS.prototype.equals=function(e){return this===e||e instanceof MS&&q.equals(this._color,e._color)};var NS=MS;var nst=z.WHITE,ist=z.TRANSPARENT,ost=16,rst=255;function LS(e){e=e??V.EMPTY_OBJECT,this._definitionChanged=new _e,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(LS.prototype,{isConstant:{get:function(){return q.isConstant(this._color)&&q.isConstant(this._gapColor)&&q.isConstant(this._dashLength)&&q.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:Ae("color"),gapColor:Ae("gapColor"),dashLength:Ae("dashLength"),dashPattern:Ae("dashPattern")});LS.prototype.getType=function(e){return"PolylineDash"};var ast=new X;LS.prototype.getValue=function(e,t){return l(e)||(e=X.now(ast)),l(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,nst,t.color),t.gapColor=q.getValueOrClonedDefault(this._gapColor,e,ist,t.gapColor),t.dashLength=q.getValueOrDefault(this._dashLength,e,ost,t.dashLength),t.dashPattern=q.getValueOrDefault(this._dashPattern,e,rst,t.dashPattern),t};LS.prototype.equals=function(e){return this===e||e instanceof LS&&q.equals(this._color,e._color)&&q.equals(this._gapColor,e._gapColor)&&q.equals(this._dashLength,e._dashLength)&&q.equals(this._dashPattern,e._dashPattern)};var OS=LS;var sst=z.WHITE,cst=.25,lst=1;function FS(e){e=e??V.EMPTY_OBJECT,this._definitionChanged=new _e,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(FS.prototype,{isConstant:{get:function(){return q.isConstant(this._color)&&q.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:Ae("color"),glowPower:Ae("glowPower"),taperPower:Ae("taperPower")});FS.prototype.getType=function(e){return"PolylineGlow"};var ust=new X;FS.prototype.getValue=function(e,t){return l(e)||(e=X.now(ust)),l(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,sst,t.color),t.glowPower=q.getValueOrDefault(this._glowPower,e,cst,t.glowPower),t.taperPower=q.getValueOrDefault(this._taperPower,e,lst,t.taperPower),t};FS.prototype.equals=function(e){return this===e||e instanceof FS&&q.equals(this._color,e._color)&&q.equals(this._glowPower,e._glowPower)&&q.equals(this._taperPower,e._taperPower)};var QS=FS;var fst=z.WHITE,dst=z.BLACK,hst=1;function kS(e){e=e??V.EMPTY_OBJECT,this._definitionChanged=new _e,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(kS.prototype,{isConstant:{get:function(){return q.isConstant(this._color)&&q.isConstant(this._outlineColor)&&q.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:Ae("color"),outlineColor:Ae("outlineColor"),outlineWidth:Ae("outlineWidth")});kS.prototype.getType=function(e){return"PolylineOutline"};var mst=new X;kS.prototype.getValue=function(e,t){return l(e)||(e=X.now(mst)),l(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,fst,t.color),t.outlineColor=q.getValueOrClonedDefault(this._outlineColor,e,dst,t.outlineColor),t.outlineWidth=q.getValueOrDefault(this._outlineWidth,e,hst),t};kS.prototype.equals=function(e){return this===e||e instanceof kS&&q.equals(this._color,e._color)&&q.equals(this._outlineColor,e._outlineColor)&&q.equals(this._outlineWidth,e._outlineWidth)};var dC=kS;function t_(e,t){this._value=void 0,this._definitionChanged=new _e,this._eventHelper=new kr,this._referenceFrame=t??Li.FIXED,this.setValue(e)}Object.defineProperties(t_.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(!q.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var pst=new X;t_.prototype.getValue=function(e,t){return l(e)||(e=X.now(pst)),this.getValueInReferenceFrame(e,Li.FIXED,t)};t_.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,a=0;for(;r<o;){let c=i[r].getValueInReferenceFrame(e,t,n[r]);l(c)&&(n[a]=c,a++),r++}return n.length=a,n};t_.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,t_.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};t_.prototype.equals=function(e){return this===e||e instanceof t_&&this._referenceFrame===e._referenceFrame&&q.arrayEquals(this._value,e._value)};t_.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var n_=t_;function hC(e){this._value=void 0,this._definitionChanged=new _e,this._eventHelper=new kr,this.setValue(e)}Object.defineProperties(hC.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(!q.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});var Ast=new X;hC.prototype.getValue=function(e,t){l(e)||(e=X.now(Ast));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 s=this._value[o].getValue(e,t[o]);l(s)&&(t[r]=s,r++),o++}return t.length=r,t};hC.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,hC.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};hC.prototype.equals=function(e){return this===e||e instanceof hC&&q.arrayEquals(this._value,e._value)};hC.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var US=hC;function Ib(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(Lf.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 Lf(e,t,n){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new _e,e.collectionChanged.addEventListener(Lf.prototype._onCollectionChanged,this)}Object.defineProperties(Lf.prototype,{isConstant:{get:function(){return q.isConstant(Ib(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=Ib(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 Ib(this)}}});Lf.fromString=function(e,t){let n,i=[],o=!0,r=!1,a="";for(let s=0;s<t.length;++s){let c=t.charAt(s);r?(a+=c,r=!1):c==="\\"?r=!0:o&&c==="#"?(n=a,o=!1,a=""):!o&&c==="."?(i.push(a),a=""):a+=c}return i.push(a),new Lf(e,n,i)};var gst=new X;Lf.prototype.getValue=function(e,t){let n=Ib(this);return l(e)||(e=X.now(gst)),l(n)?n.getValue(e,t):void 0};Lf.prototype.getValueInReferenceFrame=function(e,t,n){let i=Ib(this);return l(i)?i.getValueInReferenceFrame(e,t,n):void 0};Lf.prototype.getType=function(e){let t=Ib(this);return l(t)?t.getType(e):void 0};Lf.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};Lf.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){l(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};Lf.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;l(i)&&n.indexOf(i)!==-1?(i.definitionChanged.removeEventListener(Lf.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):l(i)||(i=Ib(this),l(i)&&this._definitionChanged.raiseEvent(this))};var i_=Lf;var _st={packedLength:1,pack:function(e,t,n){return n=n??0,t[n]=e,t},unpack:function(e,t,n){return t=t??0,e[t]},convertPackedArrayForInterpolation:function(e,t,n,i){l(i)||(i=[]),t=t??0,n=n??e.length;let o;for(let r=0,a=n-t+1;r<a;r++){let s=e[t+r];r===0||Math.abs(o-s)<Math.PI?i[r]=s:i[r]=s-D.TWO_PI,o=s}},unpackInterpolationResult:function(e,t,n,i,o){return o=e[0],o<0?o+D.TWO_PI:o}},Kd=_st;var P_e={packedLength:1,pack:function(e,t,n){n=n??0,t[n]=e},unpack:function(e,t,n){return t=t??0,e[t]}};function R_e(e,t,n){let i,o=e.length,r=n.length,a=o+r;if(e.length=a,o!==t){let s=o-1;for(i=a-1;i>=t;i--)e[i]=e[s--]}for(i=0;i<r;i++)e[t++]=n[i]}function M_e(e,t){return e instanceof X?e:typeof e=="string"?X.fromIso8601(e):X.addSeconds(t,e,new X)}var PJ=[],RJ=[];function cH(e,t,n,i,o){let r=0,a,s,c,u,f,h;for(;r<i.length;){f=M_e(i[r],e),c=Co(t,f,X.compare);let p=0,A=0;if(c<0){for(c=~c,u=c*o,s=void 0,h=t[c];r<i.length&&(f=M_e(i[r],e),!(l(s)&&X.compare(s,f)>=0||l(h)&&X.compare(f,h)>=0));){for(PJ[p++]=f,r=r+1,a=0;a<o;a++)RJ[A++]=i[r],r=r+1;s=f}p>0&&(RJ.length=A,R_e(n,u,RJ),PJ.length=p,R_e(t,c,PJ))}else{for(a=0;a<o;a++)r++,n[c*o+a]=i[r];r++}}}function Xd(e,t){let n=e;n===Number&&(n=P_e);let i=n.packedLength,o=n.packedInterpolationLength??i,r=0,a;if(l(t)){let s=t.length;a=new Array(s);for(let c=0;c<s;c++){let u=t[c];u===Number&&(u=P_e);let f=u.packedLength;i+=f,o+=u.packedInterpolationLength??f,a[c]=u}r=s}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=Eb,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 _e,this._derivativeTypes=t,this._innerDerivativeTypes=a,this._inputOrder=r,this._forwardExtrapolationType=Nf.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=Nf.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(Xd.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 yst=new X;Xd.prototype.getValue=function(e,t){l(e)||(e=X.now(yst));let n=this._times,i=n.length;if(i===0)return;let o,r=this._innerType,a=this._values,s=Co(n,e,X.compare);if(s<0){if(s=~s,s===0){let x=n[s];if(o=this._backwardExtrapolationDuration,this._backwardExtrapolationType===Nf.NONE||o!==0&&X.secondsDifference(x,e)>o)return;if(this._backwardExtrapolationType===Nf.HOLD)return r.unpack(a,0,t)}if(s>=i){s=i-1;let x=n[s];if(o=this._forwardExtrapolationDuration,this._forwardExtrapolationType===Nf.NONE||o!==0&&X.secondsDifference(e,x)>o)return;if(this._forwardExtrapolationType===Nf.HOLD)return s=i-1,r.unpack(a,s*r.packedLength,t)}let c=this._xTable,u=this._yTable,f=this._interpolationAlgorithm,h=this._packedInterpolationLength,p=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let x=Math.min(f.getRequiredDataPoints(this._interpolationDegree,p),i);x!==this._numberOfPoints&&(this._numberOfPoints=x,c.length=x,u.length=x*h)}let A=this._numberOfPoints-1;if(A<1)return;let m=0,_=i-1;if(_-m+1>=A+1){let x=s-(A/2|0)-1;x<m&&(x=m);let S=x+A;S>_&&(S=_,x=S-A,x<m&&(x=m)),m=x,_=S}let C=_-m+1;for(let x=0;x<C;++x)c[x]=X.secondsDifference(n[m+x],n[_]);if(l(r.convertPackedArrayForInterpolation))r.convertPackedArrayForInterpolation(a,m,_,u);else{let x=0,S=this._packedLength,B=m*S,v=(_+1)*S;for(;B<v;)u[x]=a[B],B++,x++}let E=X.secondsDifference(e,n[_]),b;if(p===0||!l(f.interpolate))b=f.interpolateOrderZero(E,c,u,h,this._interpolationResult);else{let x=Math.floor(h/(p+1));b=f.interpolate(E,c,u,x,p,p,this._interpolationResult)}return l(r.unpackInterpolationResult)?r.unpackInterpolationResult(b,a,m,_,t):r.unpack(b,0,t)}return r.unpack(a,s*this._packedLength,t)};Xd.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))};Xd.prototype.addSample=function(e,t,n){let i=this._innerDerivativeTypes,o=l(i),r=this._innerType,a=[];if(a.push(e),r.pack(t,a,a.length),o){let s=i.length;for(let c=0;c<s;c++)i[c].pack(n[c],a,a.length)}cH(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Xd.prototype.addSamples=function(e,t,n){let i=this._innerDerivativeTypes,o=l(i),r=this._innerType,a=e.length,s=[];for(let c=0;c<a;c++)if(s.push(e[c]),r.pack(t[c],s,s.length),o){let u=n[c],f=i.length;for(let h=0;h<f;h++)i[h].pack(u[h],s,s.length)}cH(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Xd.prototype.getSample=function(e){let t=this._times,n=t.length;if(l(n))return e<0&&(e+=n),t[e]};Xd.prototype.addSamplesPackedArray=function(e,t){cH(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Xd.prototype.removeSample=function(e){let t=Co(this._times,e,X.compare);return t<0?!1:(N_e(this,t,1),!0)};function N_e(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)}Xd.prototype.removeSamples=function(e){let t=this._times,n=Co(t,e.start,X.compare);n<0?n=~n:e.isStartIncluded||++n;let i=Co(t,e.stop,X.compare);i<0?i=~i:e.isStopIncluded&&++i,N_e(this,n,i-n)};Xd.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,a;if(n){if(a=t.length,a!==i.length)return!1;for(r=0;r<a;r++)if(t[r]!==i[r])return!1}let s=this._times,c=e._times;if(a=s.length,a!==c.length)return!1;for(r=0;r<a;r++)if(!X.equals(s[r],c[r]))return!1;let u=this._values,f=e._values;for(a=u.length,r=0;r<a;r++)if(u[r]!==f[r])return!1;return!0};Xd._mergeNewSamples=cH;var Of=Xd;function Jd(e,t){t=t??0;let n;if(t>0){n=new Array(t);for(let i=0;i<t;i++)n[i]=d}this._numberOfDerivatives=t,this._property=new Of(d,n),this._definitionChanged=new _e,this._referenceFrame=e??Li.FIXED,this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(Jd.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 Cst=new X;Jd.prototype.getValue=function(e,t){return l(e)||(e=X.now(Cst)),this.getValueInReferenceFrame(e,Li.FIXED,t)};Jd.prototype.getValueInReferenceFrame=function(e,t,n){if(n=this._property.getValue(e,n),l(n))return Nh.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};Jd.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};Jd.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;this._property.addSample(e,t,n)};Jd.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};Jd.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};Jd.prototype.removeSample=function(e){return this._property.removeSample(e)};Jd.prototype.removeSamples=function(e){this._property.removeSamples(e)};Jd.prototype.equals=function(e){return this===e||e instanceof Jd&&q.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var fc=Jd;var Est={HORIZONTAL:0,VERTICAL:1},Cm=Object.freeze(Est);var bst=Cm.HORIZONTAL,Ist=z.WHITE,xst=z.BLACK,Tst=0,Sst=1;function zS(e){e=e??V.EMPTY_OBJECT,this._definitionChanged=new _e,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(zS.prototype,{isConstant:{get:function(){return q.isConstant(this._orientation)&&q.isConstant(this._evenColor)&&q.isConstant(this._oddColor)&&q.isConstant(this._offset)&&q.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:Ae("orientation"),evenColor:Ae("evenColor"),oddColor:Ae("oddColor"),offset:Ae("offset"),repeat:Ae("repeat")});zS.prototype.getType=function(e){return"Stripe"};var wst=new X;zS.prototype.getValue=function(e,t){return l(e)||(e=X.now(wst)),l(t)||(t={}),t.horizontal=q.getValueOrDefault(this._orientation,e,bst)===Cm.HORIZONTAL,t.evenColor=q.getValueOrClonedDefault(this._evenColor,e,Ist,t.evenColor),t.oddColor=q.getValueOrClonedDefault(this._oddColor,e,xst,t.oddColor),t.offset=q.getValueOrDefault(this._offset,e,Tst),t.repeat=q.getValueOrDefault(this._repeat,e,Sst),t};zS.prototype.equals=function(e){return this===e||e instanceof zS&&q.equals(this._orientation,e._orientation)&&q.equals(this._evenColor,e._evenColor)&&q.equals(this._oddColor,e._oddColor)&&q.equals(this._offset,e._offset)&&q.equals(this._repeat,e._repeat)};var GS=zS;function mC(e){this._definitionChanged=new _e,this._intervals=new Ea,this._intervals.changedEvent.addEventListener(mC.prototype._intervalsChanged,this),this._referenceFrame=e??Li.FIXED}Object.defineProperties(mC.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 Bst=new X;mC.prototype.getValue=function(e,t){return l(e)||(e=X.now(Bst)),this.getValueInReferenceFrame(e,Li.FIXED,t)};mC.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._intervals.findDataForIntervalContainingDate(e);if(l(i))return Nh.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};mC.prototype.equals=function(e){return this===e||e instanceof mC&&this._intervals.equals(e._intervals,q.equals)&&this._referenceFrame===e._referenceFrame};mC.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var o_=mC;function xb(){this._definitionChanged=new _e,this._intervals=new Ea,this._intervals.changedEvent.addEventListener(xb.prototype._intervalsChanged,this)}Object.defineProperties(xb.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var Dst=new X;xb.prototype.getValue=function(e,t){l(e)||(e=X.now(Dst));let n=this._intervals.findDataForIntervalContainingDate(e);return l(n)&&typeof n.clone=="function"?n.clone(t):n};xb.prototype.equals=function(e){return this===e||e instanceof xb&&this._intervals.equals(e._intervals,q.equals)};xb.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var r_=xb;function VS(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new _e,this._normalize=t??!0,this.position=e}Object.defineProperties(VS.prototype,{isConstant:{get:function(){return q.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 vst=new d,L_e=new d,O_e=new X,Pst=new X,MJ=1/60;VS.prototype.getValue=function(e,t){return this._getValue(e,t)};VS.prototype._getValue=function(e,t,n){l(e)||(e=X.now(Pst)),l(t)||(t=new d);let i=this._position;if(q.isConstant(i))return this._normalize?void 0:d.clone(d.ZERO,t);let o=i.getValue(e,vst),r=i.getValue(X.addSeconds(e,MJ,O_e),L_e);if(!l(o)||!l(r)&&(r=o,o=i.getValue(X.addSeconds(e,-MJ,O_e),L_e),!l(o)))return;if(d.equals(o,r))return this._normalize?void 0:d.clone(d.ZERO,t);l(n)&&o.clone(n);let a=d.subtract(r,o,t);return this._normalize?d.normalize(a,t):d.divideByScalar(a,MJ,t)};VS.prototype.equals=function(e){return this===e||e instanceof VS&&q.equals(this._position,e._position)};var a_=VS;function jF(e,t){this._velocityVectorProperty=new a_(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new _e,this.ellipsoid=t??te.default;let n=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){n._definitionChanged.raiseEvent(n)})}Object.defineProperties(jF.prototype,{isConstant:{get:function(){return q.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 F_e=new d,Rst=new d,Q_e=new J,Mst=new X;jF.prototype.getValue=function(e,t){l(e)||(e=X.now(Mst));let n=this._velocityVectorProperty._getValue(e,Rst,F_e);if(l(n))return At.rotationMatrixFromPositionVelocity(F_e,n,this._ellipsoid,Q_e),Qe.fromRotationMatrix(Q_e,t)};jF.prototype.equals=function(e){return this===e||e instanceof jF&&q.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var YF=jF;var s_={COMPLETE:0,BELOW_ELLIPSOID_HORIZON:1,ABOVE_ELLIPSOID_HORIZON:2};s_.validate=function(e){return e===s_.COMPLETE||e===s_.BELOW_ELLIPSOID_HORIZON||e===s_.ABOVE_ELLIPSOID_HORIZON};s_.toString=function(e){switch(e){case s_.COMPLETE:return"COMPLETE";case s_.BELOW_ELLIPSOID_HORIZON:return"BELOW_ELLIPSOID_HORIZON";case s_.ABOVE_ELLIPSOID_HORIZON:return"ABOVE_ELLIPSOID_HORIZON";default:throw new de("SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.")}};var HS=s_;function pC(){}pC.packedLength=d.packedLength;pC.unpack=d.unpack;pC.pack=d.pack;var NJ;function qF(e,t){return t[0]==="#"&&(t=NJ+t),i_.fromString(e,t)}function k_e(e,t,n){if(l(n.reference))return qF(t,n.reference);if(l(n.velocityReference)){let i=qF(t,n.velocityReference);switch(e){case d:case pC:return new a_(i,e===pC);case Qe:return new YF(i)}}throw new ue(`${JSON.stringify(n)} is not valid CZML.`)}function Nst(e,t){return new Qh(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var uo=new d,nu=new WF,ul=new me,Tb=new vn,lH=new Qe;function Lst(e){let t=e.rgbaf;if(l(t))return t;let n=e.rgba;if(!l(n))return;let i=n.length;if(i===z.packedLength)return[z.byteToFloat(n[0]),z.byteToFloat(n[1]),z.byteToFloat(n[2]),z.byteToFloat(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=z.byteToFloat(n[o+1]),t[o+2]=z.byteToFloat(n[o+2]),t[o+3]=z.byteToFloat(n[o+3]),t[o+4]=z.byteToFloat(n[o+4]);return t}function U_e(e,t){let n=e.uri??e;return l(t)?t.getDerivedResource({url:n}):De.createIfNeeded(n)}function Ost(e){let t=e.wsen;if(l(t))return t;let n=e.wsenDegrees;if(!l(n))return;let i=n.length;if(i===ce.packedLength)return[D.toRadians(n[0]),D.toRadians(n[1]),D.toRadians(n[2]),D.toRadians(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=D.toRadians(n[o+1]),t[o+2]=D.toRadians(n[o+2]),t[o+3]=D.toRadians(n[o+3]),t[o+4]=D.toRadians(n[o+4]);return t}function Fst(e){let t=e.length;if(nu.magnitude=1,t===2)return nu.clock=e[0],nu.cone=e[1],d.fromSpherical(nu,uo),[uo.x,uo.y,uo.z];let n=new Array(t/3*4);for(let i=0,o=0;i<t;i+=3,o+=4)n[o]=e[i],nu.clock=e[i+1],nu.cone=e[i+2],d.fromSpherical(nu,uo),n[o+1]=uo.x,n[o+2]=uo.y,n[o+3]=uo.z;return n}function Qst(e){let t=e.length;if(t===3)return nu.clock=e[0],nu.cone=e[1],nu.magnitude=e[2],d.fromSpherical(nu,uo),[uo.x,uo.y,uo.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],nu.clock=e[i+1],nu.cone=e[i+2],nu.magnitude=e[i+3],d.fromSpherical(nu,uo),n[i+1]=uo.x,n[i+2]=uo.y,n[i+3]=uo.z;return n}function kst(e){let t=e.length;if(t===3)return ul.longitude=e[0],ul.latitude=e[1],ul.height=e[2],te.default.cartographicToCartesian(ul,uo),[uo.x,uo.y,uo.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],ul.longitude=e[i+1],ul.latitude=e[i+2],ul.height=e[i+3],te.default.cartographicToCartesian(ul,uo),n[i+1]=uo.x,n[i+2]=uo.y,n[i+3]=uo.z;return n}function Ust(e){let t=e.length;if(t===3)return ul.longitude=D.toRadians(e[0]),ul.latitude=D.toRadians(e[1]),ul.height=e[2],te.default.cartographicToCartesian(ul,uo),[uo.x,uo.y,uo.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],ul.longitude=D.toRadians(e[i+1]),ul.latitude=D.toRadians(e[i+2]),ul.height=e[i+3],te.default.cartographicToCartesian(ul,uo),n[i+1]=uo.x,n[i+2]=uo.y,n[i+3]=uo.z;return n}function LJ(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 Fst(o);let r=e.spherical;if(l(r))return Qst(r);let a=e.cartographicRadians;if(l(a))return kst(a);let s=e.cartographicDegrees;if(l(s))return Ust(s);throw new ue(`${JSON.stringify(e)} is not a valid CZML interval.`)}function z_e(e,t){d.unpack(e,t,uo),d.normalize(uo,uo),d.pack(uo,e,t)}function zst(e){let t=LJ(e);if(t.length===3)return z_e(t,0),t;for(let n=1;n<t.length;n+=4)z_e(t,n);return t}function G_e(e,t){Qe.unpack(e,t,lH),Qe.normalize(lH,lH),Qe.pack(lH,e,t)}function Gst(e){let t=e.unitQuaternion;if(l(t)){if(t.length===4)return G_e(t,0),t;for(let n=1;n<t.length;n+=5)G_e(t,n)}return t}function V_e(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")?et:e.hasOwnProperty("cartesian2")?k:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?d:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?pC:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?z:e.hasOwnProperty("arcType")?ln:e.hasOwnProperty("classificationType")?ei:e.hasOwnProperty("colorBlendMode")?el:e.hasOwnProperty("cornerType")?Ji:e.hasOwnProperty("heightReference")?it:e.hasOwnProperty("horizontalOrigin")?Mi:e.hasOwnProperty("date")?X:e.hasOwnProperty("labelStyle")?pr:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?Ht:e.hasOwnProperty("distanceDisplayCondition")?zt:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?Qe:e.hasOwnProperty("shadowMode")?wn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?Cm:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?ce:e.hasOwnProperty("uri")?XF.default:e.hasOwnProperty("verticalOrigin")?jn:Object}function Vst(e,t,n){switch(e){case ln:return ln[t.arcType??t];case Array:return t.array;case Boolean:return t.boolean??t;case et:return t.boundingRectangle;case k:return t.cartesian2;case d:return LJ(t);case pC:return zst(t);case z:return Lst(t);case ei:return ei[t.classificationType??t];case el:return el[t.colorBlendMode??t];case Ji:return Ji[t.cornerType??t];case it:return it[t.heightReference??t];case Mi:return Mi[t.horizontalOrigin??t];case Image:return U_e(t,n);case X:return X.fromIso8601(t.date??t);case pr:return pr[t.labelStyle??t];case Number:return t.number??t;case Ht:return t.nearFarScalar;case zt:return t.distanceDisplayCondition;case Object:return t.object??t.value??t;case Qe:return Gst(t);case Kd:return t.number??t;case HS:return HS[t.portionToDisplay??t];case wn:return wn[t.shadowMode??t.shadows??t];case String:return t.string??t;case Cm:return Cm[t.stripeOrientation??t];case ce:return Ost(t);case XF.default:return U_e(t,n);case jn:return jn[t.verticalOrigin??t];default:throw new ue(`Unknown CzmlDataSource interval type: ${e}`)}}var Hst={HERMITE:VF,LAGRANGE:HF,LINEAR:Eb};function uH(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(l(n)||l(i))&&t.setInterpolationOptions({interpolationAlgorithm:Hst[n],interpolationDegree:i});let o=e.forwardExtrapolationType;l(o)&&(t.forwardExtrapolationType=Nf[o]);let r=e.forwardExtrapolationDuration;l(r)&&(t.forwardExtrapolationDuration=r);let a=e.backwardExtrapolationType;l(a)&&(t.backwardExtrapolationType=Nf[a]);let s=e.backwardExtrapolationDuration;l(s)&&(t.backwardExtrapolationDuration=s)}var H_e={iso8601:void 0};function Ur(e){if(l(e))return H_e.iso8601=e,vn.fromIso8601(H_e)}function OJ(e){let t=Xe.MAXIMUM_INTERVAL.clone();return t.data=e,t}function W_e(e){let t=new sl;return t.intervals.addInterval(OJ(e)),t}function j_e(e){let t=new lc(e.referenceFrame);return t.intervals.addInterval(OJ(e)),t}function fH(e,t,n,i,o,r,a){let s=Ur(i.interval);l(o)&&(l(s)?s=vn.intersect(s,o,Tb):s=o);let c,u,f,h=!l(i.reference)&&!l(i.velocityReference),p=l(s)&&!s.equals(Xe.MAXIMUM_INTERVAL);if(i.delete===!0){if(!p){t[n]=void 0;return}return iye(t[n],s)}let A=!1;if(h){if(u=Vst(e,i,r),!l(u))return;c=e.packedLength??1,f=u.length??1,A=!l(i.array)&&typeof u!="string"&&f>c&&e!==Object}let m=typeof e.unpack=="function"&&e!==Kd;if(!A&&!p){h?t[n]=new hi(m?e.unpack(u,0):u):t[n]=k_e(e,a,i);return}let _=t[n],y,C=i.epoch;if(l(C)&&(y=X.fromIso8601(C)),A&&!p){_ instanceof Of||(t[n]=_=new Of(e)),_.addSamplesPackedArray(u,y),uH(i,_);return}let E;if(!A&&p){s=s.clone(),h?s.data=m?e.unpack(u,0):u:s.data=k_e(e,a,i),l(_)||(t[n]=_=h?new r_:new sl),h&&_ instanceof r_?_.intervals.addInterval(s):_ instanceof sl?(h&&(s.data=new hi(s.data)),_.intervals.addInterval(s)):(t[n]=_=W_e(_),h&&(s.data=new hi(s.data)),_.intervals.addInterval(s));return}l(_)||(t[n]=_=new sl),_ instanceof sl||(t[n]=_=W_e(_));let b=_.intervals;E=b.findInterval(s),(!l(E)||!(E.data instanceof Of))&&(E=s.clone(),E.data=new Of(e),b.addInterval(E)),E.data.addSamplesPackedArray(u,y),uH(i,E.data)}function iye(e,t){if(e instanceof Of){e.removeSamples(t);return}else if(e instanceof r_){e.intervals.removeInterval(t);return}else if(e instanceof sl){let n=e.intervals;for(let i=0;i<n.length;++i){let o=vn.intersect(n.get(i),t,Tb);o.isEmpty||iye(o.data,t)}n.removeInterval(t);return}}function Ee(e,t,n,i,o,r,a){if(l(i))if(Array.isArray(i))for(let s=0,c=i.length;s<c;++s)fH(e,t,n,i[s],o,r,a);else fH(e,t,n,i,o,r,a)}function Y_e(e,t,n,i,o,r){let a=Ur(n.interval);l(i)&&(l(a)?a=vn.intersect(a,i,Tb):a=i);let s=l(n.cartesianVelocity)?1:0,c=d.packedLength*(s+1),u,f,h=!l(n.reference),p=l(a)&&!a.equals(Xe.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return oye(e[t],a)}let A,m=!1;if(h&&(l(n.referenceFrame)&&(A=Li[n.referenceFrame]),A=A??Li.FIXED,u=LJ(n),f=u.length??1,m=f>c),!m&&!p){h?e[t]=new Ml(d.unpack(u),A):e[t]=qF(r,n.reference);return}let _=e[t],y,C=n.epoch;if(l(C)&&(y=X.fromIso8601(C)),m&&!p){(!(_ instanceof fc)||l(A)&&_.referenceFrame!==A)&&(e[t]=_=new fc(A,s)),_.addSamplesPackedArray(u,y),uH(n,_);return}let E;if(!m&&p){a=a.clone(),h?a.data=d.unpack(u):a.data=qF(r,n.reference),l(_)||(h?_=new o_(A):_=new lc(A),e[t]=_),h&&_ instanceof o_&&l(A)&&_.referenceFrame===A?_.intervals.addInterval(a):_ instanceof lc?(h&&(a.data=new Ml(a.data,A)),_.intervals.addInterval(a)):(e[t]=_=j_e(_),h&&(a.data=new Ml(a.data,A)),_.intervals.addInterval(a));return}l(_)?_ instanceof lc||(e[t]=_=j_e(_)):e[t]=_=new lc(A);let b=_.intervals;E=b.findInterval(a),(!l(E)||!(E.data instanceof fc)||l(A)&&E.data.referenceFrame!==A)&&(E=a.clone(),E.data=new fc(A,s),b.addInterval(E)),E.data.addSamplesPackedArray(u,y),uH(n,E.data)}function oye(e,t){if(e instanceof fc){e.removeSamples(t);return}else if(e instanceof o_){e.intervals.removeInterval(t);return}else if(e instanceof lc){let n=e.intervals;for(let i=0;i<n.length;++i){let o=vn.intersect(n.get(i),t,Tb);o.isEmpty||oye(o.data,t)}n.removeInterval(t);return}}function rye(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let a=0,s=n.length;a<s;++a)Y_e(e,t,n[a],i,o,r);else Y_e(e,t,n,i,o,r)}function q_e(e,t,n,i){l(n.references)?dH(e,t,n.references,n.interval,i,US,sl):(l(n.cartesian2)?n.array=k.unpackArray(n.cartesian2):l(n.cartesian)&&(n.array=k.unpackArray(n.cartesian)),l(n.array)&&Ee(Array,e,t,n,void 0,void 0,i))}function K_e(e,t,n,i,o,r){let a=Ur(n.interval);l(i)&&(l(a)?a=vn.intersect(a,i,Tb):a=i);let s=e[t],c,u;if(l(a)){s instanceof bS||(s=new bS,e[t]=s);let h=s.intervals;u=h.findInterval({start:a.start,stop:a.stop}),l(u)?c=u.data:(u=a.clone(),h.addInterval(u))}else c=s;let f;l(n.solidColor)?(c instanceof qt||(c=new qt),f=n.solidColor,Ee(z,c,"color",f.color,void 0,void 0,r)):l(n.grid)?(c instanceof RS||(c=new RS),f=n.grid,Ee(z,c,"color",f.color,void 0,o,r),Ee(Number,c,"cellAlpha",f.cellAlpha,void 0,o,r),Ee(k,c,"lineCount",f.lineCount,void 0,o,r),Ee(k,c,"lineThickness",f.lineThickness,void 0,o,r),Ee(k,c,"lineOffset",f.lineOffset,void 0,o,r)):l(n.image)?(c instanceof fy||(c=new fy),f=n.image,Ee(Image,c,"image",f.image,void 0,o,r),Ee(k,c,"repeat",f.repeat,void 0,o,r),Ee(z,c,"color",f.color,void 0,o,r),Ee(Boolean,c,"transparent",f.transparent,void 0,o,r)):l(n.stripe)?(c instanceof GS||(c=new GS),f=n.stripe,Ee(Cm,c,"orientation",f.orientation,void 0,o,r),Ee(z,c,"evenColor",f.evenColor,void 0,o,r),Ee(z,c,"oddColor",f.oddColor,void 0,o,r),Ee(Number,c,"offset",f.offset,void 0,o,r),Ee(Number,c,"repeat",f.repeat,void 0,o,r)):l(n.polylineOutline)?(c instanceof dC||(c=new dC),f=n.polylineOutline,Ee(z,c,"color",f.color,void 0,o,r),Ee(z,c,"outlineColor",f.outlineColor,void 0,o,r),Ee(Number,c,"outlineWidth",f.outlineWidth,void 0,o,r)):l(n.polylineGlow)?(c instanceof QS||(c=new QS),f=n.polylineGlow,Ee(z,c,"color",f.color,void 0,o,r),Ee(Number,c,"glowPower",f.glowPower,void 0,o,r),Ee(Number,c,"taperPower",f.taperPower,void 0,o,r)):l(n.polylineArrow)?(c instanceof NS||(c=new NS),f=n.polylineArrow,Ee(z,c,"color",f.color,void 0,void 0,r)):l(n.polylineDash)?(c instanceof OS||(c=new OS),f=n.polylineDash,Ee(z,c,"color",f.color,void 0,void 0,r),Ee(z,c,"gapColor",f.gapColor,void 0,void 0,r),Ee(Number,c,"dashLength",f.dashLength,void 0,o,r),Ee(Number,c,"dashPattern",f.dashPattern,void 0,o,r)):l(n.checkerboard)&&(c instanceof CS||(c=new CS),f=n.checkerboard,Ee(z,c,"evenColor",f.evenColor,void 0,o,r),Ee(z,c,"oddColor",f.oddColor,void 0,o,r),Ee(k,c,"repeat",f.repeat,void 0,o,r)),l(u)?u.data=c:e[t]=c}function Ff(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let a=0,s=n.length;a<s;++a)K_e(e,t,n[a],i,o,r);else K_e(e,t,n,i,o,r)}function Wst(e,t,n,i){let o=t.name;l(o)&&(e.name=t.name)}function jst(e,t,n,i){let o=t.description;l(o)&&Ee(String,e,"description",o,void 0,i,n)}function Yst(e,t,n,i){let o=t.position;l(o)&&rye(e,"position",o,void 0,i,n)}function qst(e,t,n,i){let o=t.viewFrom;l(o)&&Ee(d,e,"viewFrom",o,void 0,i,n)}function Kst(e,t,n,i){let o=t.orientation;l(o)&&Ee(Qe,e,"orientation",o,void 0,i,n)}function Xst(e,t,n,i){let o=t.properties;if(l(o)){l(e.properties)||(e.properties=new Ll);for(let r in o)if(o.hasOwnProperty(r)){e.properties.hasProperty(r)||e.properties.addProperty(r);let a=o[r];if(Array.isArray(a))for(let s=0,c=a.length;s<c;++s)fH(V_e(a[s]),e.properties,r,a[s],void 0,i,n);else fH(V_e(a),e.properties,r,a,void 0,i,n)}}}function dH(e,t,n,i,o,r,a){let s=n.map(function(c){return qF(o,c)});if(l(i)){i=Ur(i);let c=e[t];if(!(c instanceof a)){let u=new a;u.intervals.addInterval(OJ(c)),e[t]=c=u}i.data=new r(s),c.intervals.addInterval(i)}else e[t]=new r(s)}function X_e(e,t,n,i){let o=n.references;l(o)?dH(e,t,o,n.interval,i,US,sl):Ee(Array,e,t,n,void 0,void 0,i)}function J_e(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)X_e(e,t,n[o],i);else X_e(e,t,n,i)}function Z_e(e,t,n,i){let o=n.references;l(o)?dH(e,t,o,n.interval,i,n_,lc):(l(n.cartesian)?n.array=d.unpackArray(n.cartesian):l(n.cartographicRadians)?n.array=d.fromRadiansArrayHeights(n.cartographicRadians,te.default):l(n.cartographicDegrees)&&(n.array=d.fromDegreesArrayHeights(n.cartographicDegrees,te.default)),l(n.array)&&Ee(Array,e,t,n,void 0,void 0,i))}function JF(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)Z_e(e,t,n[o],i);else Z_e(e,t,n,i)}function Jst(e){return d.unpackArray(e)}function Zst(e){return d.fromRadiansArrayHeights(e,te.default)}function $st(e){return d.fromDegreesArrayHeights(e,te.default)}function $_e(e,t,n,i){let o=n.references;if(l(o)){let r=o.map(function(a){let s={};return dH(s,"positions",a,n.interval,i,n_,lc),s.positions});e[t]=new n_(r)}else l(n.cartesian)?n.array=n.cartesian.map(Jst):l(n.cartographicRadians)?n.array=n.cartographicRadians.map(Zst):l(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map($st)),l(n.array)&&Ee(Array,e,t,n,void 0,void 0,i)}function ect(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)$_e(e,t,n[o],i);else $_e(e,t,n,i)}function tct(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;o++)q_e(e,t,n[o],i);else q_e(e,t,n,i)}function nct(e,t,n,i){let o=t.availability;if(!l(o))return;let r;if(Array.isArray(o))for(let a=0,s=o.length;a<s;++a)l(r)||(r=new Ea),r.addInterval(Ur(o[a]));else r=new Ea,r.addInterval(Ur(o));e.availability=r}function ict(e,t,n,i,o){l(t)&&Ee(pC,e,"alignedAxis",t,n,i,o)}function oct(e,t,n,i){let o=t.billboard;if(!l(o))return;let r=Ur(o.interval),a=e.billboard;l(a)||(e.billboard=a=new jc),Ee(Boolean,a,"show",o.show,r,i,n),Ee(Image,a,"image",o.image,r,i,n),Ee(Number,a,"scale",o.scale,r,i,n),Ee(k,a,"pixelOffset",o.pixelOffset,r,i,n),Ee(d,a,"eyeOffset",o.eyeOffset,r,i,n),Ee(Mi,a,"horizontalOrigin",o.horizontalOrigin,r,i,n),Ee(jn,a,"verticalOrigin",o.verticalOrigin,r,i,n),Ee(it,a,"heightReference",o.heightReference,r,i,n),Ee(z,a,"color",o.color,r,i,n),Ee(Kd,a,"rotation",o.rotation,r,i,n),ict(a,o.alignedAxis,r,i,n),Ee(Boolean,a,"sizeInMeters",o.sizeInMeters,r,i,n),Ee(Number,a,"width",o.width,r,i,n),Ee(Number,a,"height",o.height,r,i,n),Ee(Ht,a,"scaleByDistance",o.scaleByDistance,r,i,n),Ee(Ht,a,"translucencyByDistance",o.translucencyByDistance,r,i,n),Ee(Ht,a,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),Ee(et,a,"imageSubRegion",o.imageSubRegion,r,i,n),Ee(zt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ee(Number,a,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function rct(e,t,n,i){let o=t.box;if(!l(o))return;let r=Ur(o.interval),a=e.box;l(a)||(e.box=a=new qE),Ee(Boolean,a,"show",o.show,r,i,n),Ee(d,a,"dimensions",o.dimensions,r,i,n),Ee(it,a,"heightReference",o.heightReference,r,i,n),Ee(Boolean,a,"fill",o.fill,r,i,n),Ff(a,"material",o.material,r,i,n),Ee(Boolean,a,"outline",o.outline,r,i,n),Ee(z,a,"outlineColor",o.outlineColor,r,i,n),Ee(Number,a,"outlineWidth",o.outlineWidth,r,i,n),Ee(wn,a,"shadows",o.shadows,r,i,n),Ee(zt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function act(e,t,n,i){let o=t.corridor;if(!l(o))return;let r=Ur(o.interval),a=e.corridor;l(a)||(e.corridor=a=new XE),Ee(Boolean,a,"show",o.show,r,i,n),JF(a,"positions",o.positions,n),Ee(Number,a,"width",o.width,r,i,n),Ee(Number,a,"height",o.height,r,i,n),Ee(it,a,"heightReference",o.heightReference,r,i,n),Ee(Number,a,"extrudedHeight",o.extrudedHeight,r,i,n),Ee(it,a,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Ee(Ji,a,"cornerType",o.cornerType,r,i,n),Ee(Number,a,"granularity",o.granularity,r,i,n),Ee(Boolean,a,"fill",o.fill,r,i,n),Ff(a,"material",o.material,r,i,n),Ee(Boolean,a,"outline",o.outline,r,i,n),Ee(z,a,"outlineColor",o.outlineColor,r,i,n),Ee(Number,a,"outlineWidth",o.outlineWidth,r,i,n),Ee(wn,a,"shadows",o.shadows,r,i,n),Ee(zt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ee(ei,a,"classificationType",o.classificationType,r,i,n),Ee(Number,a,"zIndex",o.zIndex,r,i,n)}function sct(e,t,n,i){let o=t.cylinder;if(!l(o))return;let r=Ur(o.interval),a=e.cylinder;l(a)||(e.cylinder=a=new JE),Ee(Boolean,a,"show",o.show,r,i,n),Ee(Number,a,"length",o.length,r,i,n),Ee(Number,a,"topRadius",o.topRadius,r,i,n),Ee(Number,a,"bottomRadius",o.bottomRadius,r,i,n),Ee(it,a,"heightReference",o.heightReference,r,i,n),Ee(Boolean,a,"fill",o.fill,r,i,n),Ff(a,"material",o.material,r,i,n),Ee(Boolean,a,"outline",o.outline,r,i,n),Ee(z,a,"outlineColor",o.outlineColor,r,i,n),Ee(Number,a,"outlineWidth",o.outlineWidth,r,i,n),Ee(Number,a,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),Ee(Number,a,"slices",o.slices,r,i,n),Ee(wn,a,"shadows",o.shadows,r,i,n),Ee(zt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function cct(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=o.interval??r.interval,r.currentTime=o.currentTime??r.currentTime,r.range=o.range??r.range,r.step=o.step??r.step,r.multiplier=o.multiplier??r.multiplier):i.clock={interval:o.interval,currentTime:o.currentTime,range:o.range,step:o.step,multiplier:o.multiplier}}}function lct(e,t,n,i){let o=t.ellipse;if(!l(o))return;let r=Ur(o.interval),a=e.ellipse;l(a)||(e.ellipse=a=new ZE),Ee(Boolean,a,"show",o.show,r,i,n),Ee(Number,a,"semiMajorAxis",o.semiMajorAxis,r,i,n),Ee(Number,a,"semiMinorAxis",o.semiMinorAxis,r,i,n),Ee(Number,a,"height",o.height,r,i,n),Ee(it,a,"heightReference",o.heightReference,r,i,n),Ee(Number,a,"extrudedHeight",o.extrudedHeight,r,i,n),Ee(it,a,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Ee(Kd,a,"rotation",o.rotation,r,i,n),Ee(Kd,a,"stRotation",o.stRotation,r,i,n),Ee(Number,a,"granularity",o.granularity,r,i,n),Ee(Boolean,a,"fill",o.fill,r,i,n),Ff(a,"material",o.material,r,i,n),Ee(Boolean,a,"outline",o.outline,r,i,n),Ee(z,a,"outlineColor",o.outlineColor,r,i,n),Ee(Number,a,"outlineWidth",o.outlineWidth,r,i,n),Ee(Number,a,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),Ee(wn,a,"shadows",o.shadows,r,i,n),Ee(zt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ee(ei,a,"classificationType",o.classificationType,r,i,n),Ee(Number,a,"zIndex",o.zIndex,r,i,n)}function uct(e,t,n,i){let o=t.ellipsoid;if(!l(o))return;let r=Ur(o.interval),a=e.ellipsoid;l(a)||(e.ellipsoid=a=new $E),Ee(Boolean,a,"show",o.show,r,i,n),Ee(d,a,"radii",o.radii,r,i,n),Ee(d,a,"innerRadii",o.innerRadii,r,i,n),Ee(Number,a,"minimumClock",o.minimumClock,r,i,n),Ee(Number,a,"maximumClock",o.maximumClock,r,i,n),Ee(Number,a,"minimumCone",o.minimumCone,r,i,n),Ee(Number,a,"maximumCone",o.maximumCone,r,i,n),Ee(it,a,"heightReference",o.heightReference,r,i,n),Ee(Boolean,a,"fill",o.fill,r,i,n),Ff(a,"material",o.material,r,i,n),Ee(Boolean,a,"outline",o.outline,r,i,n),Ee(z,a,"outlineColor",o.outlineColor,r,i,n),Ee(Number,a,"outlineWidth",o.outlineWidth,r,i,n),Ee(Number,a,"stackPartitions",o.stackPartitions,r,i,n),Ee(Number,a,"slicePartitions",o.slicePartitions,r,i,n),Ee(Number,a,"subdivisions",o.subdivisions,r,i,n),Ee(wn,a,"shadows",o.shadows,r,i,n),Ee(zt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function fct(e,t,n,i){let o=t.label;if(!l(o))return;let r=Ur(o.interval),a=e.label;l(a)||(e.label=a=new Lh),Ee(Boolean,a,"show",o.show,r,i,n),Ee(String,a,"text",o.text,r,i,n),Ee(String,a,"font",o.font,r,i,n),Ee(pr,a,"style",o.style,r,i,n),Ee(Number,a,"scale",o.scale,r,i,n),Ee(Boolean,a,"showBackground",o.showBackground,r,i,n),Ee(z,a,"backgroundColor",o.backgroundColor,r,i,n),Ee(k,a,"backgroundPadding",o.backgroundPadding,r,i,n),Ee(k,a,"pixelOffset",o.pixelOffset,r,i,n),Ee(d,a,"eyeOffset",o.eyeOffset,r,i,n),Ee(Mi,a,"horizontalOrigin",o.horizontalOrigin,r,i,n),Ee(jn,a,"verticalOrigin",o.verticalOrigin,r,i,n),Ee(it,a,"heightReference",o.heightReference,r,i,n),Ee(z,a,"fillColor",o.fillColor,r,i,n),Ee(z,a,"outlineColor",o.outlineColor,r,i,n),Ee(Number,a,"outlineWidth",o.outlineWidth,r,i,n),Ee(Ht,a,"translucencyByDistance",o.translucencyByDistance,r,i,n),Ee(Ht,a,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),Ee(Ht,a,"scaleByDistance",o.scaleByDistance,r,i,n),Ee(zt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ee(Number,a,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function dct(e,t,n,i){let o=t.model;if(!l(o))return;let r=Ur(o.interval),a=e.model;l(a)||(e.model=a=new jA),Ee(Boolean,a,"show",o.show,r,i,n),Ee(XF.default,a,"uri",o.gltf,r,i,n),Ee(Number,a,"scale",o.scale,r,i,n),Ee(Number,a,"minimumPixelSize",o.minimumPixelSize,r,i,n),Ee(Number,a,"maximumScale",o.maximumScale,r,i,n),Ee(Boolean,a,"incrementallyLoadTextures",o.incrementallyLoadTextures,r,i,n),Ee(Boolean,a,"runAnimations",o.runAnimations,r,i,n),Ee(Boolean,a,"clampAnimations",o.clampAnimations,r,i,n),Ee(wn,a,"shadows",o.shadows,r,i,n),Ee(it,a,"heightReference",o.heightReference,r,i,n),Ee(z,a,"silhouetteColor",o.silhouetteColor,r,i,n),Ee(Number,a,"silhouetteSize",o.silhouetteSize,r,i,n),Ee(z,a,"color",o.color,r,i,n),Ee(el,a,"colorBlendMode",o.colorBlendMode,r,i,n),Ee(Number,a,"colorBlendAmount",o.colorBlendAmount,r,i,n),Ee(zt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n);let s,c,u=o.nodeTransformations;if(l(u))if(Array.isArray(u))for(s=0,c=u.length;s<c;++s)eye(a,u[s],r,i,n);else eye(a,u,r,i,n);let f=o.articulations;if(l(f))if(Array.isArray(f))for(s=0,c=f.length;s<c;++s)tye(a,f[s],r,i,n);else tye(a,f,r,i,n)}function eye(e,t,n,i,o){let r=Ur(t.interval);l(n)&&(l(r)?r=vn.intersect(r,n,Tb):r=n);let a=e.nodeTransformations,s=Object.keys(t);for(let c=0,u=s.length;c<u;++c){let f=s[c];if(f==="interval")continue;let h=t[f];if(!l(h))continue;l(a)||(e.nodeTransformations=a=new Ll),a.hasProperty(f)||a.addProperty(f);let p=a[f];l(p)||(a[f]=p=new e0),Ee(d,p,"translation",h.translation,r,i,o),Ee(Qe,p,"rotation",h.rotation,r,i,o),Ee(d,p,"scale",h.scale,r,i,o)}}function tye(e,t,n,i,o){let r=Ur(t.interval);l(n)&&(l(r)?r=vn.intersect(r,n,Tb):r=n);let a=e.articulations,s=Object.keys(t);for(let c=0,u=s.length;c<u;++c){let f=s[c];if(f==="interval")continue;let h=t[f];l(h)&&(l(a)||(e.articulations=a=new Ll),a.hasProperty(f)||a.addProperty(f),Ee(Number,a,f,h,r,i,o))}}function hct(e,t,n,i){let o=t.path;if(!l(o))return;let r=Ur(o.interval),a=e.path;l(a)||(e.path=a=new YA),Ee(Boolean,a,"show",o.show,r,i,n),Ee(Number,a,"leadTime",o.leadTime,r,i,n),Ee(Number,a,"trailTime",o.trailTime,r,i,n),Ee(Number,a,"width",o.width,r,i,n),Ee(Number,a,"resolution",o.resolution,r,i,n),Ff(a,"material",o.material,r,i,n),Ee(zt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ee(String,a,"relativeTo",o.relativeTo,r,i,n)}function mct(e,t,n,i){let o=t.point;if(!l(o))return;let r=Ur(o.interval),a=e.point;l(a)||(e.point=a=new n0),Ee(Boolean,a,"show",o.show,r,i,n),Ee(Number,a,"pixelSize",o.pixelSize,r,i,n),Ee(it,a,"heightReference",o.heightReference,r,i,n),Ee(z,a,"color",o.color,r,i,n),Ee(z,a,"outlineColor",o.outlineColor,r,i,n),Ee(Number,a,"outlineWidth",o.outlineWidth,r,i,n),Ee(Ht,a,"scaleByDistance",o.scaleByDistance,r,i,n),Ee(Ht,a,"translucencyByDistance",o.translucencyByDistance,r,i,n),Ee(zt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ee(Number,a,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function KF(e){this.polygon=e,this._definitionChanged=new _e}Object.defineProperties(KF.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}}});KF.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 wc(o)}))),l(t)?(t.positions=n,t.holes=i,t):new wc(n,i)};KF.prototype.equals=function(e){return this===e||e instanceof KF&&q.equals(this.polygon._positions,e.polygon._positions)&&q.equals(this.polygon._holes,e.polygon._holes)};function pct(e,t,n,i){let o=t.polygon;if(!l(o))return;let r=Ur(o.interval),a=e.polygon;l(a)||(e.polygon=a=new Oh),Ee(Boolean,a,"show",o.show,r,i,n),JF(a,"_positions",o.positions,n),ect(a,"_holes",o.holes,n),(l(a._positions)||l(a._holes))&&(a.hierarchy=new KF(a)),Ee(Number,a,"height",o.height,r,i,n),Ee(it,a,"heightReference",o.heightReference,r,i,n),Ee(Number,a,"extrudedHeight",o.extrudedHeight,r,i,n),Ee(it,a,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Ee(Kd,a,"stRotation",o.stRotation,r,i,n),Ee(Number,a,"granularity",o.granularity,r,i,n),Ee(Boolean,a,"fill",o.fill,r,i,n),Ff(a,"material",o.material,r,i,n),Ee(Boolean,a,"outline",o.outline,r,i,n),Ee(z,a,"outlineColor",o.outlineColor,r,i,n),Ee(Number,a,"outlineWidth",o.outlineWidth,r,i,n),Ee(Boolean,a,"perPositionHeight",o.perPositionHeight,r,i,n),Ee(Boolean,a,"closeTop",o.closeTop,r,i,n),Ee(Boolean,a,"closeBottom",o.closeBottom,r,i,n),Ee(ln,a,"arcType",o.arcType,r,i,n),Ee(wn,a,"shadows",o.shadows,r,i,n),Ee(zt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ee(ei,a,"classificationType",o.classificationType,r,i,n),Ee(Number,a,"zIndex",o.zIndex,r,i,n)}function Act(e){return e?ln.GEODESIC:ln.NONE}function gct(e,t,n,i){let o=t.polyline;if(!l(o))return;let r=Ur(o.interval),a=e.polyline;if(l(a)||(e.polyline=a=new qc),Ee(Boolean,a,"show",o.show,r,i,n),JF(a,"positions",o.positions,n),Ee(Number,a,"width",o.width,r,i,n),Ee(Number,a,"granularity",o.granularity,r,i,n),Ff(a,"material",o.material,r,i,n),Ff(a,"depthFailMaterial",o.depthFailMaterial,r,i,n),Ee(ln,a,"arcType",o.arcType,r,i,n),Ee(Boolean,a,"clampToGround",o.clampToGround,r,i,n),Ee(wn,a,"shadows",o.shadows,r,i,n),Ee(zt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ee(ei,a,"classificationType",o.classificationType,r,i,n),Ee(Number,a,"zIndex",o.zIndex,r,i,n),l(o.followSurface)&&!l(o.arcType)){let s={};Ee(Boolean,s,"followSurface",o.followSurface,r,i,n),a.arcType=Nst(s.followSurface,Act)}}function _ct(e,t,n,i){let o=t.polylineVolume;if(!l(o))return;let r=Ur(o.interval),a=e.polylineVolume;l(a)||(e.polylineVolume=a=new i0),JF(a,"positions",o.positions,n),tct(a,"shape",o.shape,n),Ee(Boolean,a,"show",o.show,r,i,n),Ee(Ji,a,"cornerType",o.cornerType,r,i,n),Ee(Boolean,a,"fill",o.fill,r,i,n),Ff(a,"material",o.material,r,i,n),Ee(Boolean,a,"outline",o.outline,r,i,n),Ee(z,a,"outlineColor",o.outlineColor,r,i,n),Ee(Number,a,"outlineWidth",o.outlineWidth,r,i,n),Ee(Number,a,"granularity",o.granularity,r,i,n),Ee(wn,a,"shadows",o.shadows,r,i,n),Ee(zt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function yct(e,t,n,i){let o=t.rectangle;if(!l(o))return;let r=Ur(o.interval),a=e.rectangle;l(a)||(e.rectangle=a=new Fh),Ee(Boolean,a,"show",o.show,r,i,n),Ee(ce,a,"coordinates",o.coordinates,r,i,n),Ee(Number,a,"height",o.height,r,i,n),Ee(it,a,"heightReference",o.heightReference,r,i,n),Ee(Number,a,"extrudedHeight",o.extrudedHeight,r,i,n),Ee(it,a,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Ee(Kd,a,"rotation",o.rotation,r,i,n),Ee(Kd,a,"stRotation",o.stRotation,r,i,n),Ee(Number,a,"granularity",o.granularity,r,i,n),Ee(Boolean,a,"fill",o.fill,r,i,n),Ff(a,"material",o.material,r,i,n),Ee(Boolean,a,"outline",o.outline,r,i,n),Ee(z,a,"outlineColor",o.outlineColor,r,i,n),Ee(Number,a,"outlineWidth",o.outlineWidth,r,i,n),Ee(wn,a,"shadows",o.shadows,r,i,n),Ee(zt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ee(ei,a,"classificationType",o.classificationType,r,i,n),Ee(Number,a,"zIndex",o.zIndex,r,i,n)}function Cct(e,t,n,i){let o=t.tileset;if(!l(o))return;let r=Ur(o.interval),a=e.tileset;l(a)||(e.tileset=a=new t0),Ee(Boolean,a,"show",o.show,r,i,n),Ee(XF.default,a,"uri",o.uri,r,i,n),Ee(Number,a,"maximumScreenSpaceError",o.maximumScreenSpaceError,r,i,n)}function Ect(e,t,n,i){let o=t.wall;if(!l(o))return;let r=Ur(o.interval),a=e.wall;l(a)||(e.wall=a=new qA),Ee(Boolean,a,"show",o.show,r,i,n),JF(a,"positions",o.positions,n),J_e(a,"minimumHeights",o.minimumHeights,n),J_e(a,"maximumHeights",o.maximumHeights,n),Ee(Number,a,"granularity",o.granularity,r,i,n),Ee(Boolean,a,"fill",o.fill,r,i,n),Ff(a,"material",o.material,r,i,n),Ee(Boolean,a,"outline",o.outline,r,i,n),Ee(z,a,"outlineColor",o.outlineColor,r,i,n),Ee(Number,a,"outlineWidth",o.outlineWidth,r,i,n),Ee(wn,a,"shadows",o.shadows,r,i,n),Ee(zt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function nye(e,t,n,i,o){let r=e.id;if(l(r)||(r=Jn()),NJ=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")cct(e,o);else{let a=t.getOrCreateEntity(r),s=e.parent;l(s)&&(a.parent=t.getOrCreateEntity(s));for(let c=n.length-1;c>-1;c--)n[c](a,e,t,i)}NJ=void 0}function bct(e){let t,n=e._documentPacket.clock;if(!l(n)){if(!l(e._clock)){let o=e._entityCollection.computeAvailability();if(!o.start.equals(Xe.MINIMUM_VALUE)){let r=o.start,a=o.stop,s=X.secondsDifference(a,r),c=Math.round(s/120);return t=new ym,t.startTime=X.clone(r),t.stopTime=X.clone(a),t.clockRange=Ia.LOOP_STOP,t.multiplier=c,t.currentTime=X.clone(r),t.clockStep=Uo.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}l(e._clock)?t=e._clock.clone():(t=new ym,t.startTime=Xe.MINIMUM_VALUE.clone(),t.stopTime=Xe.MAXIMUM_VALUE.clone(),t.currentTime=Xe.MINIMUM_VALUE.clone(),t.clockRange=Ia.LOOP_STOP,t.clockStep=Uo.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=Ur(n.interval);return l(i)&&(t.startTime=i.start,t.stopTime=i.stop),l(n.currentTime)&&(t.currentTime=X.fromIso8601(n.currentTime)),l(n.range)&&(t.clockRange=Ia[n.range]??Ia.LOOP_STOP),l(n.step)&&(t.clockStep=Uo[n.step]??Uo.SYSTEM_CLOCK_MULTIPLIER),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function aye(e,t,n,i){n=n??V.EMPTY_OBJECT;let o=t,r=n.sourceUri,a=n.credit;if(typeof a=="string"&&(a=new Et(a)),e._credit=a,typeof t=="string"||t instanceof De){t=De.createIfNeeded(t),o=t.fetchJson(),r=r??t.clone();let s=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)s.push(c[f])}}return r=De.createIfNeeded(r),ba.setLoading(e,!0),Promise.resolve(o).then(function(s){return Ict(e,s,r,i)}).catch(function(s){return ba.setLoading(e,!1),e._error.raiseEvent(e,s),console.log(s),Promise.reject(s)})}function Ict(e,t,n,i){ba.setLoading(e,!0);let o=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new sye,o.removeAll()),ts._processCzml(t,o,n,void 0,e);let r=bct(e),a=e._documentPacket;return l(a.name)&&e._name!==a.name?(e._name=a.name,r=!0):!l(e._name)&&l(n)&&(e._name=e_(n.getUrlComponent()),r=!0),ba.setLoading(e,!1),r&&e._changed.raiseEvent(e),e}function sye(){this.name=void 0,this.clock=void 0}function ts(e){this._name=e,this._changed=new _e,this._error=new _e,this._isLoading=!1,this._loading=new _e,this._clock=void 0,this._documentPacket=new sye,this._version=void 0,this._entityCollection=new Vs(this),this._entityCluster=new Rf,this._credit=void 0,this._resourceCredits=[]}ts.load=function(e,t){return new ts().load(e,t)};Object.defineProperties(ts.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}}});ts.updaters=[oct,rct,act,sct,lct,uct,fct,dct,Wst,jst,hct,mct,pct,gct,_ct,Xst,yct,Yst,Cct,qst,Ect,Kst,nct];ts.registerUpdater=function(e){ts.updaters.includes(e)||ts.updaters.push(e)};ts.unregisterUpdater=function(e){if(ts.updaters.includes(e)){let t=ts.updaters.indexOf(e);ts.updaters.splice(t,1)}};ts.prototype.process=function(e,t){return aye(this,e,t,!1)};ts.prototype.load=function(e,t){return aye(this,e,t,!0)};ts.prototype.update=function(e){return!0};ts.processPacketData=Ee;ts.processPositionPacketData=rye;ts.processMaterialPacketData=Ff;ts._processCzml=function(e,t,n,i,o){if(i=i??ts.updaters,Array.isArray(e))for(let r=0,a=e.length;r<a;++r)nye(e[r],t,i,n,o);else nye(e,t,i,n,o)};var ZF=ts;function iu(){this._dataSources=[],this._dataSourceAdded=new _e,this._dataSourceRemoved=new _e,this._dataSourceMoved=new _e}Object.defineProperties(iu.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}}});iu.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})};iu.prototype.remove=function(e,t){t=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};iu.prototype.removeAll=function(e){e=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=[]};iu.prototype.contains=function(e){return this.indexOf(e)!==-1};iu.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};iu.prototype.get=function(e){return this._dataSources[e]};iu.prototype.getByName=function(e){return this._dataSources.filter(function(t){return t.name===e})};function hH(e,t){return e.indexOf(t)}function cye(e,t,n){let i=e._dataSources,o=i.length-1;if(t=D.clamp(t,0,o),n=D.clamp(n,0,o),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,e.dataSourceMoved.raiseEvent(r,n,t)}iu.prototype.raise=function(e){let t=hH(this._dataSources,e);cye(this,t,t+1)};iu.prototype.lower=function(e){let t=hH(this._dataSources,e);cye(this,t,t-1)};iu.prototype.raiseToTop=function(e){let t=hH(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))};iu.prototype.lowerToBottom=function(e){let t=hH(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};iu.prototype.isDestroyed=function(){return!1};iu.prototype.destroy=function(){return this.removeAll(!0),fe(this)};var $F=iu;function dc(e){e=e??V.EMPTY_OBJECT,this._primitives=[],this._guid=Jn(),this._primitiveAdded=new _e,this._primitiveRemoved=new _e,this._zIndex=void 0,this.show=e.show??!0,this.destroyPrimitives=e.destroyPrimitives??!0,this._countReferences=e.countReferences??!1}Object.defineProperties(dc.prototype,{length:{get:function(){return this._primitives.length}},primitiveAdded:{get:function(){return this._primitiveAdded}},primitiveRemoved:{get:function(){return this._primitiveRemoved}}});dc.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._countReferences&&(l(i._referenceCount)?++i._referenceCount:i._referenceCount=1),this._primitiveAdded.raiseEvent(e),e};dc.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._countReferences&&e._external._referenceCount--,this.destroyPrimitives&&(!this._countReferences||e._external._referenceCount<=0)&&e.destroy(),this._primitiveRemoved.raiseEvent(e),!0}return!1};dc.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};dc.prototype.removeAll=function(){let e=this._primitives,t=e.length;for(let n=0;n<t;++n){let i=e[n];delete i._external._composites[this._guid],this._countReferences&&i._external._referenceCount--,this.destroyPrimitives&&(!this._countReferences||i._external._referenceCount<=0)&&i.destroy(),this._primitiveRemoved.raiseEvent(i)}this._primitives=[]};dc.prototype.contains=function(e){return!!(l(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function mH(e,t){return e._primitives.indexOf(t)}dc.prototype.raise=function(e){if(l(e)){let t=mH(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};dc.prototype.raiseToTop=function(e){if(l(e)){let t=mH(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};dc.prototype.lower=function(e){if(l(e)){let t=mH(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};dc.prototype.lowerToBottom=function(e){if(l(e)){let t=mH(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};dc.prototype.get=function(e){return this._primitives[e]};dc.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};dc.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)}};dc.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)}};dc.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)}};dc.prototype.isDestroyed=function(){return!1};dc.prototype.destroy=function(){return this.removeAll(),fe(this)};var ou=dc;function Lp(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(Lp.prototype,{length:{get:function(){return this._length}}});Lp.prototype.add=function(e,t){t=t??0;let n=this._collections[t];if(!l(n)){n=new ou({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};Lp.prototype.set=function(e,t){return t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};Lp.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};Lp.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};Lp.prototype.contains=function(e){if(!l(e))return!1;let t=this._collections[e._zIndex];return l(t)&&t.contains(e)};Lp.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};Lp.prototype.isDestroyed=function(){return!1};Lp.prototype.destroy=function(){return this.removeAll(),fe(this)};var eQ=Lp;function WS(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new Ot}WS.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};WS.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);l(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};WS.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};WS.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};WS.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),l(e)&&l(e.getBoundingSphere)?e.getBoundingSphere(t):Ct.FAILED};var Sb=WS;var QJ={},pH=new d,lye=new d,uye=new Qe,fye=new J;function jS(e,t,n,i,o,r,a,s,c,u){let f=e+t;d.multiplyByScalar(i,Math.cos(f),pH),d.multiplyByScalar(n,Math.sin(f),lye),d.add(pH,lye,pH);let h=Math.cos(e);h=h*h;let p=Math.sin(e);p=p*p;let m=r/Math.sqrt(a*h+o*p)/s;return Qe.fromAxisAngle(pH,m,uye),J.fromQuaternion(uye,fye),J.multiplyByVector(fye,c,u),d.normalize(u,u),d.multiplyByScalar(u,s,u),u}var dye=new d,hye=new d,FJ=new d,xct=new d;QJ.raisePositionsToHeight=function(e,t,n){let i=t.ellipsoid,o=t.height,r=t.extrudedHeight,a=n?e.length/3*2:e.length/3,s=new Float64Array(a*3),c=e.length,u=n?c:0;for(let f=0;f<c;f+=3){let h=f+1,p=f+2,A=d.fromArray(e,f,dye);i.scaleToGeodeticSurface(A,A);let m=d.clone(A,hye),_=i.geodeticSurfaceNormal(A,xct),y=d.multiplyByScalar(_,o,FJ);d.add(A,y,A),n&&(d.multiplyByScalar(_,r,y),d.add(m,y,m),s[f+u]=m.x,s[h+u]=m.y,s[p+u]=m.z),s[f]=A.x,s[h]=A.y,s[p]=A.z}return s};var Tct=new d,Sct=new d,wct=new d;QJ.computeEllipsePositions=function(e,t,n){let i=e.semiMinorAxis,o=e.semiMajorAxis,r=e.rotation,a=e.center,s=e.granularity*8,c=i*i,u=o*o,f=o*i,h=d.magnitude(a),p=d.normalize(a,Tct),A=d.cross(d.UNIT_Z,a,Sct);A=d.normalize(A,A);let m=d.cross(p,A,wct),_=1+Math.ceil(D.PI_OVER_TWO/s),y=D.PI_OVER_TWO/(_-1),C=D.PI_OVER_TWO-_*y;C<0&&(_-=Math.ceil(Math.abs(C)/y));let E=2*(_*(_+2)),b=t?new Array(E*3):void 0,x=0,S=dye,B=hye,v=_*4*3,P=v-1,N=0,L=n?new Array(v):void 0,g,I,T,w,R;for(C=D.PI_OVER_TWO,S=jS(C,r,m,A,c,f,u,h,p,S),t&&(b[x++]=S.x,b[x++]=S.y,b[x++]=S.z),n&&(L[P--]=S.z,L[P--]=S.y,L[P--]=S.x),C=D.PI_OVER_TWO-y,g=1;g<_+1;++g){if(S=jS(C,r,m,A,c,f,u,h,p,S),B=jS(Math.PI-C,r,m,A,c,f,u,h,p,B),t){for(b[x++]=S.x,b[x++]=S.y,b[x++]=S.z,T=2*g+2,I=1;I<T-1;++I)w=I/(T-1),R=d.lerp(S,B,w,FJ),b[x++]=R.x,b[x++]=R.y,b[x++]=R.z;b[x++]=B.x,b[x++]=B.y,b[x++]=B.z}n&&(L[P--]=S.z,L[P--]=S.y,L[P--]=S.x,L[N++]=B.x,L[N++]=B.y,L[N++]=B.z),C=D.PI_OVER_TWO-(g+1)*y}for(g=_;g>1;--g){if(C=D.PI_OVER_TWO-(g-1)*y,S=jS(-C,r,m,A,c,f,u,h,p,S),B=jS(C+Math.PI,r,m,A,c,f,u,h,p,B),t){for(b[x++]=S.x,b[x++]=S.y,b[x++]=S.z,T=2*(g-1)+2,I=1;I<T-1;++I)w=I/(T-1),R=d.lerp(S,B,w,FJ),b[x++]=R.x,b[x++]=R.y,b[x++]=R.z;b[x++]=B.x,b[x++]=B.y,b[x++]=B.z}n&&(L[P--]=S.z,L[P--]=S.y,L[P--]=S.x,L[N++]=B.x,L[N++]=B.y,L[N++]=B.z)}C=D.PI_OVER_TWO,S=jS(-C,r,m,A,c,f,u,h,p,S);let O={};return t&&(b[x++]=S.x,b[x++]=S.y,b[x++]=S.z,O.positions=b,O.numPts=_),n&&(L[P--]=S.z,L[P--]=S.y,L[P--]=S.x,O.outerPositions=L),O};var ku=QJ;var YS=new d,kJ=new d,UJ=new d,mye=new d,ys=new k,pye=new J,Bct=new J,zJ=new Qe,Aye=new d,gye=new d,_ye=new d,_H=new me,yye=new d,Cye=new k,Eye=new k;function bye(e,t,n){let i=t.vertexFormat,o=t.center,r=t.semiMajorAxis,a=t.semiMinorAxis,s=t.ellipsoid,c=t.stRotation,u=n?e.length/3*2:e.length/3,f=t.shadowVolume,h=i.st?new Float32Array(u*2):void 0,p=i.normal?new Float32Array(u*3):void 0,A=i.tangent?new Float32Array(u*3):void 0,m=i.bitangent?new Float32Array(u*3):void 0,_=f?new Float32Array(u*3):void 0,y=0,C=Aye,E=gye,b=_ye,x=new Wi(s),S=x.project(s.cartesianToCartographic(o,_H),yye),B=s.scaleToGeodeticSurface(o,YS);s.geodeticSurfaceNormal(B,B);let v=pye,P=Bct;if(c!==0){let R=Qe.fromAxisAngle(B,c,zJ);v=J.fromQuaternion(R,v),R=Qe.fromAxisAngle(B,-c,zJ),P=J.fromQuaternion(R,P)}else v=J.clone(J.IDENTITY,v),P=J.clone(J.IDENTITY,P);let N=k.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Cye),L=k.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Eye),g=e.length,I=n?g:0,T=I/3*2;for(let R=0;R<g;R+=3){let O=R+1,G=R+2,F=d.fromArray(e,R,YS);if(i.st){let U=J.multiplyByVector(v,F,kJ),Q=x.project(s.cartesianToCartographic(U,_H),UJ);d.subtract(Q,S,Q),ys.x=(Q.x+r)/(2*r),ys.y=(Q.y+a)/(2*a),N.x=Math.min(ys.x,N.x),N.y=Math.min(ys.y,N.y),L.x=Math.max(ys.x,L.x),L.y=Math.max(ys.y,L.y),n&&(h[y+T]=ys.x,h[y+1+T]=ys.y),h[y++]=ys.x,h[y++]=ys.y}(i.normal||i.tangent||i.bitangent||f)&&(C=s.geodeticSurfaceNormal(F,C),f&&(_[R+I]=-C.x,_[O+I]=-C.y,_[G+I]=-C.z),(i.normal||i.tangent||i.bitangent)&&((i.tangent||i.bitangent)&&(E=d.normalize(d.cross(d.UNIT_Z,C,E),E),J.multiplyByVector(P,E,E)),i.normal&&(p[R]=C.x,p[O]=C.y,p[G]=C.z,n&&(p[R+I]=-C.x,p[O+I]=-C.y,p[G+I]=-C.z)),i.tangent&&(A[R]=E.x,A[O]=E.y,A[G]=E.z,n&&(A[R+I]=-E.x,A[O+I]=-E.y,A[G+I]=-E.z)),i.bitangent&&(b=d.normalize(d.cross(C,E,b),b),m[R]=b.x,m[O]=b.y,m[G]=b.z,n&&(m[R+I]=b.x,m[O+I]=b.y,m[G+I]=b.z))))}if(i.st){g=h.length;for(let R=0;R<g;R+=2)h[R]=(h[R]-N.x)/(L.x-N.x),h[R+1]=(h[R+1]-N.y)/(L.y-N.y)}let w=new _n;if(i.position){let R=ku.raisePositionsToHeight(e,t,n);w.position=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:R})}if(i.st&&(w.st=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:h})),i.normal&&(w.normal=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(w.tangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:A})),i.bitangent&&(w.bitangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:m})),f&&(w.extrudeDirection=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:_})),n&&l(t.offsetAttribute)){let R=new Uint8Array(u);if(t.offsetAttribute===mn.TOP)R=R.fill(1,0,u/2);else{let O=t.offsetAttribute===mn.NONE?0:1;R=R.fill(O)}w.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:R})}return w}function Iye(e){let t=new Array(12*(e*(e+1))-6),n=0,i,o,r,a,s;for(i=0,r=1,a=0;a<3;a++)t[n++]=r++,t[n++]=i,t[n++]=r;for(a=2;a<e+1;++a){for(r=a*(a+1)-1,i=(a-1)*a-1,t[n++]=r++,t[n++]=i,t[n++]=r,o=2*a,s=0;s<o-1;++s)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,a=0;a<o-1;++a)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,a=e-1;a>1;--a){for(t[n++]=i++,t[n++]=i,t[n++]=r,o=2*a,s=0;s<o-1;++s)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(a=0;a<3;a++)t[n++]=i++,t[n++]=i,t[n++]=r;return t}var wb=new d;function Dct(e){let t=e.center;wb=d.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,wb),e.height,wb),wb=d.add(t,wb,wb);let n=new le(wb,e.semiMajorAxis),i=ku.computeEllipsePositions(e,!0,!1),o=i.positions,r=i.numPts,a=bye(o,e,!1),s=Iye(r);return s=Ue.createTypedArray(o.length/3,s),{boundingSphere:n,attributes:a,indices:s}}function vct(e,t){let n=t.vertexFormat,i=t.center,o=t.semiMajorAxis,r=t.semiMinorAxis,a=t.ellipsoid,s=t.height,c=t.extrudedHeight,u=t.stRotation,f=e.length/3*2,h=new Float64Array(f*3),p=n.st?new Float32Array(f*2):void 0,A=n.normal?new Float32Array(f*3):void 0,m=n.tangent?new Float32Array(f*3):void 0,_=n.bitangent?new Float32Array(f*3):void 0,y=t.shadowVolume,C=y?new Float32Array(f*3):void 0,E=0,b=Aye,x=gye,S=_ye,B=new Wi(a),v=B.project(a.cartesianToCartographic(i,_H),yye),P=a.scaleToGeodeticSurface(i,YS);a.geodeticSurfaceNormal(P,P);let N=Qe.fromAxisAngle(P,u,zJ),L=J.fromQuaternion(N,pye),g=k.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Cye),I=k.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Eye),T=e.length,w=T/3*2;for(let O=0;O<T;O+=3){let G=O+1,F=O+2,U=d.fromArray(e,O,YS),Q;if(n.st){let Y=J.multiplyByVector(L,U,kJ),$=B.project(a.cartesianToCartographic(Y,_H),UJ);d.subtract($,v,$),ys.x=($.x+o)/(2*o),ys.y=($.y+r)/(2*r),g.x=Math.min(ys.x,g.x),g.y=Math.min(ys.y,g.y),I.x=Math.max(ys.x,I.x),I.y=Math.max(ys.y,I.y),p[E+w]=ys.x,p[E+1+w]=ys.y,p[E++]=ys.x,p[E++]=ys.y}U=a.scaleToGeodeticSurface(U,U),Q=d.clone(U,kJ),b=a.geodeticSurfaceNormal(U,b),y&&(C[O+T]=-b.x,C[G+T]=-b.y,C[F+T]=-b.z);let H=d.multiplyByScalar(b,s,mye);if(U=d.add(U,H,U),H=d.multiplyByScalar(b,c,H),Q=d.add(Q,H,Q),n.position&&(h[O+T]=Q.x,h[G+T]=Q.y,h[F+T]=Q.z,h[O]=U.x,h[G]=U.y,h[F]=U.z),n.normal||n.tangent||n.bitangent){S=d.clone(b,S);let Y=d.fromArray(e,(O+3)%T,mye);d.subtract(Y,U,Y);let $=d.subtract(Q,U,UJ);b=d.normalize(d.cross($,Y,b),b),n.normal&&(A[O]=b.x,A[G]=b.y,A[F]=b.z,A[O+T]=b.x,A[G+T]=b.y,A[F+T]=b.z),n.tangent&&(x=d.normalize(d.cross(S,b,x),x),m[O]=x.x,m[G]=x.y,m[F]=x.z,m[O+T]=x.x,m[O+1+T]=x.y,m[O+2+T]=x.z),n.bitangent&&(_[O]=S.x,_[G]=S.y,_[F]=S.z,_[O+T]=S.x,_[G+T]=S.y,_[F+T]=S.z)}}if(n.st){T=p.length;for(let O=0;O<T;O+=2)p[O]=(p[O]-g.x)/(I.x-g.x),p[O+1]=(p[O+1]-g.y)/(I.y-g.y)}let R=new _n;if(n.position&&(R.position=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:h})),n.st&&(R.st=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:p})),n.normal&&(R.normal=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:A})),n.tangent&&(R.tangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:m})),n.bitangent&&(R.bitangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:_})),y&&(R.extrudeDirection=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:C})),l(t.offsetAttribute)){let O=new Uint8Array(f);if(t.offsetAttribute===mn.TOP)O=O.fill(1,0,f/2);else{let G=t.offsetAttribute===mn.NONE?0:1;O=O.fill(G)}R.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:O})}return R}function Pct(e){let t=e.length/3,n=Ue.createTypedArray(t,t*6),i=0;for(let o=0;o<t;o++){let r=o,a=o+t,s=(r+1)%t,c=s+t;n[i++]=r,n[i++]=a,n[i++]=s,n[i++]=s,n[i++]=a,n[i++]=c}return n}var AH=new le,gH=new le;function Rct(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=d.multiplyByScalar(n.geodeticSurfaceNormal(t,YS),e.height,YS);AH.center=d.add(t,o,AH.center),AH.radius=i,o=d.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),gH.center=d.add(t,o,gH.center),gH.radius=i;let r=ku.computeEllipsePositions(e,!0,!0),a=r.positions,s=r.numPts,c=r.outerPositions,u=le.union(AH,gH),f=bye(a,e,!0),h=Iye(s),p=h.length;h.length=p*2;let A=a.length/3;for(let x=0;x<p;x+=3)h[x+p]=h[x+2]+A,h[x+1+p]=h[x+1]+A,h[x+2+p]=h[x]+A;let m=Ue.createTypedArray(A*2/3,h),_=new yt({attributes:f,indices:m,primitiveType:ve.TRIANGLES}),y=vct(c,e);h=Pct(c);let C=Ue.createTypedArray(c.length*2/3,h),E=new yt({attributes:y,indices:C,primitiveType:ve.TRIANGLES}),b=Wn.combineInstances([new Mt({geometry:_}),new Mt({geometry:E})]);return{boundingSphere:u,attributes:b[0].attributes,indices:b[0].indices}}function xye(e,t,n,i,o,r,a){let c=ku.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:n,rotation:i,granularity:o},!1,!0).outerPositions,u=c.length/3,f=new Array(u);for(let p=0;p<u;++p)f[p]=d.fromArray(c,p*3);let h=ce.fromCartesianArray(f,r,a);return h.width>D.PI&&(h.north=h.north>0?D.PI_OVER_TWO-D.EPSILON7:h.north,h.south=h.south<0?D.EPSILON7-D.PI_OVER_TWO:h.south,h.east=D.PI,h.west=-D.PI),h}function Fp(e){e=e??V.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??te.default,i=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??D.RADIANS_PER_DEGREE,a=e.vertexFormat??ke.DEFAULT,s=e.height??0,c=e.extrudedHeight??s;this._center=d.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=te.clone(n),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._height=Math.max(c,s),this._granularity=r,this._vertexFormat=ke.clone(a),this._extrudedHeight=Math.min(c,s),this._shadowVolume=e.shadowVolume??!1,this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}Fp.packedLength=d.packedLength+te.packedLength+ke.packedLength+9;Fp.pack=function(e,t,n){return n=n??0,d.pack(e._center,t,n),n+=d.packedLength,te.pack(e._ellipsoid,t,n),n+=te.packedLength,ke.pack(e._vertexFormat,t,n),n+=ke.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]=e._offsetAttribute??-1,t};var Tye=new d,Sye=new te,wye=new ke,Op={center:Tye,ellipsoid:Sye,vertexFormat:wye,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};Fp.unpack=function(e,t,n){t=t??0;let i=d.unpack(e,t,Tye);t+=d.packedLength;let o=te.unpack(e,t,Sye);t+=te.packedLength;let r=ke.unpack(e,t,wye);t+=ke.packedLength;let a=e[t++],s=e[t++],c=e[t++],u=e[t++],f=e[t++],h=e[t++],p=e[t++],A=e[t++]===1,m=e[t];return l(n)?(n._center=d.clone(i,n._center),n._ellipsoid=te.clone(o,n._ellipsoid),n._vertexFormat=ke.clone(r,n._vertexFormat),n._semiMajorAxis=a,n._semiMinorAxis=s,n._rotation=c,n._stRotation=u,n._height=f,n._granularity=h,n._extrudedHeight=p,n._shadowVolume=A,n._offsetAttribute=m===-1?void 0:m,n):(Op.height=f,Op.extrudedHeight=p,Op.granularity=h,Op.stRotation=u,Op.rotation=c,Op.semiMajorAxis=a,Op.semiMinorAxis=s,Op.shadowVolume=A,Op.offsetAttribute=m===-1?void 0:m,new Fp(Op))};Fp.computeRectangle=function(e,t){e=e??V.EMPTY_OBJECT;let n=e.center,i=e.ellipsoid??te.default,o=e.semiMajorAxis,r=e.semiMinorAxis,a=e.granularity??D.RADIANS_PER_DEGREE,s=e.rotation??0;return xye(n,o,r,s,a,i,t)};Fp.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!D.equalsEpsilon(t,n,0,D.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=Rct(o);else if(r=Dct(o),l(e._offsetAttribute)){let a=r.attributes.position.values.length,s=e._offsetAttribute===mn.NONE?0:1,c=new Uint8Array(a/3).fill(s);r.attributes.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new yt({attributes:r.attributes,indices:r.indices,primitiveType:ve.TRIANGLES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};Fp.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),a=n(i,o);return new Fp({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:o,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:r,height:a,vertexFormat:ke.POSITION_ONLY,shadowVolume:!0})};function Mct(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=ku.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]=d.fromArray(i,c*3);let a=e._ellipsoid,s=e.rectangle;return yt._textureCoordinateRotationPoints(r,t,a,s)}Object.defineProperties(Fp.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=xye(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=Mct(this)),this._textureCoordinateRotationPoints}}});var ru=Fp;var Bye=new d,Bb=new d;function Nct(e){let t=e.center;Bb=d.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,Bb),e.height,Bb),Bb=d.add(t,Bb,Bb);let n=new le(Bb,e.semiMajorAxis),i=ku.computeEllipsePositions(e,!1,!0).outerPositions,o=new _n({position:new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:ku.raisePositionsToHeight(i,e,!1)})}),r=i.length/3,a=Ue.createTypedArray(r,r*2),s=0;for(let c=0;c<r;++c)a[s++]=c,a[s++]=(c+1)%r;return{boundingSphere:n,attributes:o,indices:a}}var yH=new le,CH=new le;function Lct(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=d.multiplyByScalar(n.geodeticSurfaceNormal(t,Bye),e.height,Bye);yH.center=d.add(t,o,yH.center),yH.radius=i,o=d.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),CH.center=d.add(t,o,CH.center),CH.radius=i;let r=ku.computeEllipsePositions(e,!1,!0).outerPositions,a=new _n({position:new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:ku.raisePositionsToHeight(r,e,!0)})});r=a.position.values;let s=le.union(yH,CH),c=r.length/3;if(l(e.offsetAttribute)){let m=new Uint8Array(c);if(e.offsetAttribute===mn.TOP)m=m.fill(1,0,c/2);else{let _=e.offsetAttribute===mn.NONE?0:1;m=m.fill(_)}a.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}let u=e.numberOfVerticalLines??16;u=D.clamp(u,0,c/2);let f=Ue.createTypedArray(c,c*2+u*2);c/=2;let h=0,p;for(p=0;p<c;++p)f[h++]=p,f[h++]=(p+1)%c,f[h++]=p+c,f[h++]=(p+1)%c+c;let A;if(u>0){let m=Math.min(u,c);A=Math.round(c/m);let _=Math.min(A*u,c);for(p=0;p<_;p+=A)f[h++]=p,f[h++]=p+c}return{boundingSphere:s,attributes:a,indices:f}}function qS(e){e=e??V.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??te.default,i=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??D.RADIANS_PER_DEGREE,a=e.height??0,s=e.extrudedHeight??a;this._center=d.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=te.clone(n),this._rotation=e.rotation??0,this._height=Math.max(s,a),this._granularity=r,this._extrudedHeight=Math.min(s,a),this._numberOfVerticalLines=Math.max(e.numberOfVerticalLines??16,0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}qS.packedLength=d.packedLength+te.packedLength+8;qS.pack=function(e,t,n){return n=n??0,d.pack(e._center,t,n),n+=d.packedLength,te.pack(e._ellipsoid,t,n),n+=te.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]=e._offsetAttribute??-1,t};var Dye=new d,vye=new te,c_={center:Dye,ellipsoid:vye,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};qS.unpack=function(e,t,n){t=t??0;let i=d.unpack(e,t,Dye);t+=d.packedLength;let o=te.unpack(e,t,vye);t+=te.packedLength;let r=e[t++],a=e[t++],s=e[t++],c=e[t++],u=e[t++],f=e[t++],h=e[t++],p=e[t];return l(n)?(n._center=d.clone(i,n._center),n._ellipsoid=te.clone(o,n._ellipsoid),n._semiMajorAxis=r,n._semiMinorAxis=a,n._rotation=s,n._height=c,n._granularity=u,n._extrudedHeight=f,n._numberOfVerticalLines=h,n._offsetAttribute=p===-1?void 0:p,n):(c_.height=c,c_.extrudedHeight=f,c_.granularity=u,c_.rotation=s,c_.semiMajorAxis=r,c_.semiMinorAxis=a,c_.numberOfVerticalLines=h,c_.offsetAttribute=p===-1?void 0:p,new qS(c_))};qS.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!D.equalsEpsilon(t,n,0,D.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=Lct(o);else if(r=Nct(o),l(e._offsetAttribute)){let a=r.attributes.position.values.length,s=e._offsetAttribute===mn.NONE?0:1,c=new Uint8Array(a/3).fill(s);r.attributes.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new yt({attributes:r.attributes,indices:r.indices,primitiveType:ve.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var Qf=qS;var Pye=new z,Rye=d.ZERO,Mye=new d,Nye=new ce;function Oct(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 Em(e,t){ri.call(this,{entity:e,scene:t,geometryOptions:new Oct(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}l(Object.create)&&(Em.prototype=Object.create(ri.prototype),Em.prototype.constructor=Em);Em.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:$n.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof qt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,Pye)),l(o)||(o=z.WHITE),i.color=Jt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=go.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Rye,Mye))),new Mt({id:t,geometry:new ru(this._options),attributes:i})};Em.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Pye),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:$n.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=go.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Rye,Mye))),new Mt({id:t,geometry:new Qf(this._options),attributes:r})};Em.prototype._computeCenter=function(e,t){return q.getValueOrUndefined(this._entity.position,e,t)};Em.prototype._isHidden=function(e,t){let n=e.position;return!l(n)||!l(t.semiMajorAxis)||!l(t.semiMinorAxis)||Ii.prototype._isHidden.call(this,e,t)};Em.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!q.isConstant(t.rotation)||!q.isConstant(t.height)||!q.isConstant(t.extrudedHeight)||!q.isConstant(t.granularity)||!q.isConstant(t.stRotation)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.numberOfVerticalLines)||!q.isConstant(t.zIndex)||this._onTerrain&&!q.isConstant(this._materialProperty)&&!(this._materialProperty instanceof qt)};Em.prototype._setStaticOptions=function(e,t){let n=q.getValueOrUndefined(t.height,Xe.MINIMUM_VALUE),i=q.getValueOrDefault(t.heightReference,Xe.MINIMUM_VALUE,it.NONE),o=q.getValueOrUndefined(t.extrudedHeight,Xe.MINIMUM_VALUE),r=q.getValueOrDefault(t.extrudedHeightReference,Xe.MINIMUM_VALUE,it.NONE);l(o)&&!l(n)&&(n=0);let a=this._options;a.vertexFormat=this._materialProperty instanceof qt?gn.VERTEX_FORMAT:_o.MaterialSupport.TEXTURED.vertexFormat,a.center=e.position.getValue(Xe.MINIMUM_VALUE,a.center),a.semiMajorAxis=t.semiMajorAxis.getValue(Xe.MINIMUM_VALUE,a.semiMajorAxis),a.semiMinorAxis=t.semiMinorAxis.getValue(Xe.MINIMUM_VALUE,a.semiMinorAxis),a.rotation=q.getValueOrUndefined(t.rotation,Xe.MINIMUM_VALUE),a.granularity=q.getValueOrUndefined(t.granularity,Xe.MINIMUM_VALUE),a.stRotation=q.getValueOrUndefined(t.stRotation,Xe.MINIMUM_VALUE),a.numberOfVerticalLines=q.getValueOrUndefined(t.numberOfVerticalLines,Xe.MINIMUM_VALUE),a.offsetAttribute=ri.computeGeometryOffsetAttribute(n,i,o,r),a.height=ri.getGeometryHeight(n,i),o=ri.getGeometryExtrudedHeight(o,r),o===ri.CLAMP_TO_GROUND&&(o=Di.getMinimumMaximumHeights(ru.computeRectangle(a,Nye)).minimumTerrainHeight),a.extrudedHeight=o};Em.DynamicGeometryUpdater=KS;function KS(e,t,n){bi.call(this,e,t,n)}l(Object.create)&&(KS.prototype=Object.create(bi.prototype),KS.prototype.constructor=KS);KS.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.center)||!l(i.semiMajorAxis)||!l(i.semiMinorAxis)||bi.prototype._isHidden.call(this,e,t,n)};KS.prototype._setOptions=function(e,t,n){let i=this._options,o=q.getValueOrUndefined(t.height,n),r=q.getValueOrDefault(t.heightReference,n,it.NONE),a=q.getValueOrUndefined(t.extrudedHeight,n),s=q.getValueOrDefault(t.extrudedHeightReference,n,it.NONE);l(a)&&!l(o)&&(o=0),i.center=q.getValueOrUndefined(e.position,n,i.center),i.semiMajorAxis=q.getValueOrUndefined(t.semiMajorAxis,n),i.semiMinorAxis=q.getValueOrUndefined(t.semiMinorAxis,n),i.rotation=q.getValueOrUndefined(t.rotation,n),i.granularity=q.getValueOrUndefined(t.granularity,n),i.stRotation=q.getValueOrUndefined(t.stRotation,n),i.numberOfVerticalLines=q.getValueOrUndefined(t.numberOfVerticalLines,n),i.offsetAttribute=ri.computeGeometryOffsetAttribute(o,r,a,s),i.height=ri.getGeometryHeight(o,r),a=ri.getGeometryExtrudedHeight(a,s),a===ri.CLAMP_TO_GROUND&&(a=Di.getMinimumMaximumHeights(ru.computeRectangle(i,Nye)).minimumTerrainHeight),i.extrudedHeight=a};var tQ=Em;var Fct=new d,Qct=new d,kct=new d,Uct=new d,zct=new d,Gct=new d(1,1,1),Lye=Math.cos,Oye=Math.sin;function l_(e){e=e??V.EMPTY_OBJECT;let t=e.radii??Gct,n=e.innerRadii??t,i=e.minimumClock??0,o=e.maximumClock??D.TWO_PI,r=e.minimumCone??0,a=e.maximumCone??D.PI,s=Math.round(e.stackPartitions??64),c=Math.round(e.slicePartitions??64),u=e.vertexFormat??ke.DEFAULT;this._radii=d.clone(t),this._innerRadii=d.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=a,this._stackPartitions=s,this._slicePartitions=c,this._vertexFormat=ke.clone(u),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}l_.packedLength=2*d.packedLength+ke.packedLength+7;l_.pack=function(e,t,n){return n=n??0,d.pack(e._radii,t,n),n+=d.packedLength,d.pack(e._innerRadii,t,n),n+=d.packedLength,ke.pack(e._vertexFormat,t,n),n+=ke.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._offsetAttribute??-1,t};var Fye=new d,Qye=new d,kye=new ke,AC={radii:Fye,innerRadii:Qye,vertexFormat:kye,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};l_.unpack=function(e,t,n){t=t??0;let i=d.unpack(e,t,Fye);t+=d.packedLength;let o=d.unpack(e,t,Qye);t+=d.packedLength;let r=ke.unpack(e,t,kye);t+=ke.packedLength;let a=e[t++],s=e[t++],c=e[t++],u=e[t++],f=e[t++],h=e[t++],p=e[t];return l(n)?(n._radii=d.clone(i,n._radii),n._innerRadii=d.clone(o,n._innerRadii),n._vertexFormat=ke.clone(r,n._vertexFormat),n._minimumClock=a,n._maximumClock=s,n._minimumCone=c,n._maximumCone=u,n._stackPartitions=f,n._slicePartitions=h,n._offsetAttribute=p===-1?void 0:p,n):(AC.minimumClock=a,AC.maximumClock=s,AC.minimumCone=c,AC.maximumCone=u,AC.stackPartitions=f,AC.slicePartitions=h,AC.offsetAttribute=p===-1?void 0:p,new l_(AC))};l_.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,a=e._maximumCone,s=e._vertexFormat,c=e._slicePartitions+1,u=e._stackPartitions+1;c=Math.round(c*Math.abs(o-i)/D.TWO_PI),u=Math.round(u*Math.abs(a-r)/D.PI),c<2&&(c=2),u<2&&(u=2);let f,h,p=0,A=[r],m=[i];for(f=0;f<u;f++)A.push(r+f*(a-r)/(u-1));for(A.push(a),h=0;h<c;h++)m.push(i+h*(o-i)/(c-1));m.push(o);let _=A.length,y=m.length,C=0,E=1,b=n.x!==t.x||n.y!==t.y||n.z!==t.z,x=!1,S=!1,B=!1;b&&(E=2,r>0&&(x=!0,C+=c-1),a<Math.PI&&(S=!0,C+=c-1),(o-i)%D.TWO_PI?(B=!0,C+=(u-1)*2+1):C+=1);let v=y*_*E,P=new Float64Array(v*3),N=new Array(v).fill(!1),L=new Array(v).fill(!1),g=c*u*E,I=6*(g+C+1-(c+u)*E),T=Ue.createTypedArray(g,I),w=s.normal?new Float32Array(v*3):void 0,R=s.tangent?new Float32Array(v*3):void 0,O=s.bitangent?new Float32Array(v*3):void 0,G=s.st?new Float32Array(v*2):void 0,F=new Array(_),U=new Array(_);for(f=0;f<_;f++)F[f]=Oye(A[f]),U[f]=Lye(A[f]);let Q=new Array(y),H=new Array(y);for(h=0;h<y;h++)H[h]=Lye(m[h]),Q[h]=Oye(m[h]);for(f=0;f<_;f++)for(h=0;h<y;h++)P[p++]=t.x*F[f]*H[h],P[p++]=t.y*F[f]*Q[h],P[p++]=t.z*U[f];let Y=v/2;if(b)for(f=0;f<_;f++)for(h=0;h<y;h++)P[p++]=n.x*F[f]*H[h],P[p++]=n.y*F[f]*Q[h],P[p++]=n.z*U[f],N[Y]=!0,f>0&&f!==_-1&&h!==0&&h!==y-1&&(L[Y]=!0),Y++;p=0;let $,W;for(f=1;f<_-2;f++)for($=f*y,W=(f+1)*y,h=1;h<y-2;h++)T[p++]=W+h,T[p++]=W+h+1,T[p++]=$+h+1,T[p++]=W+h,T[p++]=$+h+1,T[p++]=$+h;if(b){let ot=_*y;for(f=1;f<_-2;f++)for($=ot+f*y,W=ot+(f+1)*y,h=1;h<y-2;h++)T[p++]=W+h,T[p++]=$+h,T[p++]=$+h+1,T[p++]=W+h,T[p++]=$+h+1,T[p++]=W+h+1}let K,Z;if(b){if(x)for(Z=_*y,f=1;f<y-2;f++)T[p++]=f,T[p++]=f+1,T[p++]=Z+f+1,T[p++]=f,T[p++]=Z+f+1,T[p++]=Z+f;if(S)for(K=_*y-y,Z=_*y*E-y,f=1;f<y-2;f++)T[p++]=K+f+1,T[p++]=K+f,T[p++]=Z+f,T[p++]=K+f+1,T[p++]=Z+f,T[p++]=Z+f+1}if(B){for(f=1;f<_-2;f++)Z=y*_+y*f,K=y*f,T[p++]=Z,T[p++]=K+y,T[p++]=K,T[p++]=Z,T[p++]=Z+y,T[p++]=K+y;for(f=1;f<_-2;f++)Z=y*_+y*(f+1)-1,K=y*(f+1)-1,T[p++]=K+y,T[p++]=Z,T[p++]=K,T[p++]=K+y,T[p++]=Z+y,T[p++]=Z}let pe=new _n;s.position&&(pe.position=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:P}));let ge=0,re=0,ye=0,Ce=0,Pe=v/2,Ne,Le=te.fromCartesian3(t),Oe=te.fromCartesian3(n);if(s.st||s.normal||s.tangent||s.bitangent){for(f=0;f<v;f++){Ne=N[f]?Oe:Le;let ot=d.fromArray(P,f*3,Fct),Fe=Ne.geodeticSurfaceNormal(ot,Qct);if(L[f]&&d.negate(Fe,Fe),s.st){let _t=k.negate(Fe,zct);G[ge++]=Math.atan2(_t.y,_t.x)/D.TWO_PI+.5,G[ge++]=Math.asin(Fe.z)/Math.PI+.5}if(s.normal&&(w[re++]=Fe.x,w[re++]=Fe.y,w[re++]=Fe.z),s.tangent||s.bitangent){let _t=kct,rt=0,Ye;if(N[f]&&(rt=Pe),!x&&f>=rt&&f<rt+y*2?Ye=d.UNIT_X:Ye=d.UNIT_Z,d.cross(Ye,Fe,_t),d.normalize(_t,_t),s.tangent&&(R[ye++]=_t.x,R[ye++]=_t.y,R[ye++]=_t.z),s.bitangent){let st=d.cross(Fe,_t,Uct);d.normalize(st,st),O[Ce++]=st.x,O[Ce++]=st.y,O[Ce++]=st.z}}}s.st&&(pe.st=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:G})),s.normal&&(pe.normal=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:w})),s.tangent&&(pe.tangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:R})),s.bitangent&&(pe.bitangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:O}))}if(l(e._offsetAttribute)){let ot=P.length,Fe=e._offsetAttribute===mn.NONE?0:1,_t=new Uint8Array(ot/3).fill(Fe);pe.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:_t})}return new yt({attributes:pe,indices:T,primitiveType:ve.TRIANGLES,boundingSphere:le.fromEllipsoid(Le),offsetAttribute:e._offsetAttribute})};var GJ;l_.getUnitEllipsoid=function(){return l(GJ)||(GJ=l_.createGeometry(new l_({radii:new d(1,1,1),vertexFormat:ke.POSITION_ONLY}))),GJ};var Hs=l_;var Vct=new qt(z.WHITE),VJ=d.ZERO,HJ=new d,Hct=new d,Wct=new d,WJ=new z,jct=new d(1,1,1);function Yct(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 kf(e,t){Ii.call(this,{entity:e,scene:t,geometryOptions:new Yct(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}l(Object.create)&&(kf.prototype=Object.create(Ii.prototype),kf.prototype.constructor=kf);Object.defineProperties(kf.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});kf.prototype.createFillGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r,a=new Sn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),c=$n.fromDistanceDisplayCondition(s),u={show:a,distanceDisplayCondition:c,color:void 0,offset:void 0};if(this._materialProperty instanceof qt){let f;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||o)&&(f=this._materialProperty.color.getValue(e,WJ)),l(f)||(f=z.WHITE),r=Jt.fromColor(f),u.color=r}return l(this._options.offsetAttribute)&&(u.offset=go.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,VJ,HJ))),new Mt({id:i,geometry:new Hs(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:u})};kf.prototype.createOutlineGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,WJ),a=this._distanceDisplayConditionProperty.getValue(e),s={show:new Sn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(r),distanceDisplayCondition:$n.fromDistanceDisplayCondition(a),offset:void 0};return l(this._options.offsetAttribute)&&(s.offset=go.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,VJ,HJ))),new Mt({id:i,geometry:new vf(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:s})};kf.prototype._computeCenter=function(e,t){return q.getValueOrUndefined(this._entity.position,e,t)};kf.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.radii)||Ii.prototype._isHidden.call(this,e,t)};kf.prototype._isDynamic=function(e,t){return!e.position.isConstant||!q.isConstant(e.orientation)||!t.radii.isConstant||!q.isConstant(t.innerRadii)||!q.isConstant(t.stackPartitions)||!q.isConstant(t.slicePartitions)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.minimumClock)||!q.isConstant(t.maximumClock)||!q.isConstant(t.minimumCone)||!q.isConstant(t.maximumCone)||!q.isConstant(t.subdivisions)};kf.prototype._setStaticOptions=function(e,t){let n=q.getValueOrDefault(t.heightReference,Xe.MINIMUM_VALUE,it.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof qt?gn.VERTEX_FORMAT:_o.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(Xe.MINIMUM_VALUE,i.radii),i.innerRadii=q.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=q.getValueOrUndefined(t.minimumClock,Xe.MINIMUM_VALUE),i.maximumClock=q.getValueOrUndefined(t.maximumClock,Xe.MINIMUM_VALUE),i.minimumCone=q.getValueOrUndefined(t.minimumCone,Xe.MINIMUM_VALUE),i.maximumCone=q.getValueOrUndefined(t.maximumCone,Xe.MINIMUM_VALUE),i.stackPartitions=q.getValueOrUndefined(t.stackPartitions,Xe.MINIMUM_VALUE),i.slicePartitions=q.getValueOrUndefined(t.slicePartitions,Xe.MINIMUM_VALUE),i.subdivisions=q.getValueOrUndefined(t.subdivisions,Xe.MINIMUM_VALUE),i.offsetAttribute=n!==it.NONE?mn.ALL:void 0};kf.prototype._onEntityPropertyChanged=KA;kf.DynamicGeometryUpdater=nQ;function nQ(e,t,n){bi.call(this,e,t,n),this._scene=e._scene,this._modelMatrix=new M,this._attributes=void 0,this._outlineAttributes=void 0,this._lastSceneMode=void 0,this._lastShow=void 0,this._lastOutlineShow=void 0,this._lastOutlineWidth=void 0,this._lastOutlineColor=void 0,this._lastOffset=new d,this._material={}}l(Object.create)&&(nQ.prototype=Object.create(bi.prototype),nQ.prototype.constructor=nQ);nQ.prototype.update=function(e){let t=this._entity,n=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!q.getValueOrDefault(n.show,e,!0)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let i=q.getValueOrUndefined(n.radii,e,Hct),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=q.getValueOrDefault(n.fill,e,!0),a=q.getValueOrDefault(n.outline,e,!1),s=q.getValueOrClonedDefault(n.outlineColor,e,z.BLACK,WJ),c=wr.getValue(e,n.material??Vct,this._material),u=q.getValueOrUndefined(n.innerRadii,e,Wct),f=q.getValueOrUndefined(n.minimumClock,e),h=q.getValueOrUndefined(n.maximumClock,e),p=q.getValueOrUndefined(n.minimumCone,e),A=q.getValueOrUndefined(n.maximumCone,e),m=q.getValueOrUndefined(n.stackPartitions,e),_=q.getValueOrUndefined(n.slicePartitions,e),y=q.getValueOrUndefined(n.subdivisions,e),C=q.getValueOrDefault(n.outlineWidth,e,1),E=q.getValueOrDefault(n.heightReference,e,it.NONE),b=E!==it.NONE?mn.ALL:void 0,x=this._scene.mode,S=x===oe.SCENE3D&&E===it.NONE,B=this._options,v=this._geometryUpdater.shadowsProperty.getValue(e),N=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),L=q.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,VJ,HJ);if(!S||this._lastSceneMode!==x||!l(this._primitive)||B.stackPartitions!==m||B.slicePartitions!==_||l(u)&&!d.equals(B.innerRadii!==u)||B.minimumClock!==f||B.maximumClock!==h||B.minimumCone!==p||B.maximumCone!==A||B.subdivisions!==y||this._lastOutlineWidth!==C||B.offsetAttribute!==b){let I=this._primitives;I.removeAndDestroy(this._primitive),I.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=x,this._lastOutlineWidth=C,B.stackPartitions=m,B.slicePartitions=_,B.subdivisions=y,B.offsetAttribute=b,B.radii=d.clone(S?jct:i,B.radii),l(u)?S?B.innerRadii=d.fromElements(u.x/i.x,u.y/i.y,u.z/i.z,B.innerRadii):B.innerRadii=d.clone(u,B.innerRadii):B.innerRadii=void 0,B.minimumClock=f,B.maximumClock=h,B.minimumCone=p,B.maximumCone=A;let T=new _o({material:c,translucent:c.isTranslucent(),closed:!0});B.vertexFormat=T.vertexFormat;let w=this._geometryUpdater.createFillGeometryInstance(e,S,this._modelMatrix);this._primitive=I.add(new Nn({geometryInstances:w,appearance:T,asynchronous:!1,shadows:v}));let R=this._geometryUpdater.createOutlineGeometryInstance(e,S,this._modelMatrix);this._outlinePrimitive=I.add(new Nn({geometryInstances:R,appearance:new gn({flat:!0,translucent:R.attributes.color.value[3]!==255,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(C)}}),asynchronous:!1,shadows:v})),this._lastShow=r,this._lastOutlineShow=a,this._lastOutlineColor=z.clone(s,this._lastOutlineColor),this._lastDistanceDisplayCondition=N,this._lastOffset=d.clone(L,this._lastOffset)}else if(this._primitive.ready){let I=this._primitive,T=this._outlinePrimitive;I.show=!0,T.show=!0,I.appearance.material=c;let w=this._attributes;l(w)||(w=I.getGeometryInstanceAttributes(t),this._attributes=w),r!==this._lastShow&&(w.show=Sn.toValue(r,w.show),this._lastShow=r);let R=this._outlineAttributes;l(R)||(R=T.getGeometryInstanceAttributes(t),this._outlineAttributes=R),a!==this._lastOutlineShow&&(R.show=Sn.toValue(a,R.show),this._lastOutlineShow=a),z.equals(s,this._lastOutlineColor)||(R.color=Jt.toValue(s,R.color),z.clone(s,this._lastOutlineColor)),zt.equals(N,this._lastDistanceDisplayCondition)||(w.distanceDisplayCondition=$n.toValue(N,w.distanceDisplayCondition),R.distanceDisplayCondition=$n.toValue(N,R.distanceDisplayCondition),zt.clone(N,this._lastDistanceDisplayCondition)),d.equals(L,this._lastOffset)||(w.offset=go.toValue(L,w.offset),R.offset=go.toValue(L,w.offset),d.clone(L,this._lastOffset))}S&&(i.x=Math.max(i.x,.001),i.y=Math.max(i.y,.001),i.z=Math.max(i.z,.001),o=M.multiplyByScale(o,i,o),this._primitive.modelMatrix=o,this._outlinePrimitive.modelMatrix=o)};var iQ=kf;function XS(e){e=e??V.EMPTY_OBJECT;let t=e.vertexFormat??ke.DEFAULT;this._vertexFormat=t,this._workerName="createPlaneGeometry"}XS.packedLength=ke.packedLength;XS.pack=function(e,t,n){return n=n??0,ke.pack(e._vertexFormat,t,n),t};var Uye=new ke,qct={vertexFormat:Uye};XS.unpack=function(e,t,n){t=t??0;let i=ke.unpack(e,t,Uye);return l(n)?(n._vertexFormat=ke.clone(i,n._vertexFormat),n):new XS(qct)};var EH=new d(-.5,-.5,0),bH=new d(.5,.5,0);XS.createGeometry=function(e){let t=e._vertexFormat,n=new _n,i,o;if(t.position){if(o=new Float64Array(12),o[0]=EH.x,o[1]=EH.y,o[2]=0,o[3]=bH.x,o[4]=EH.y,o[5]=0,o[6]=bH.x,o[7]=bH.y,o[8]=0,o[9]=EH.x,o[10]=bH.y,o[11]=0,n.position=new Me({componentDatatype:j.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 Me({componentDatatype:j.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 Me({componentDatatype:j.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 Me({componentDatatype:j.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 Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:r})}i=new Uint16Array(6),i[0]=0,i[1]=1,i[2]=2,i[3]=0,i[4]=2,i[5]=3}return new yt({attributes:n,indices:i,primitiveType:ve.TRIANGLES,boundingSphere:new le(d.ZERO,Math.sqrt(2))})};var oQ=XS;function JS(){this._workerName="createPlaneOutlineGeometry"}JS.packedLength=0;JS.pack=function(e,t){return t};JS.unpack=function(e,t,n){return l(n)?n:new JS};var gC=new d(-.5,-.5,0),IH=new d(.5,.5,0);JS.createGeometry=function(){let e=new _n,t=new Uint16Array(8),n=new Float64Array(12);return n[0]=gC.x,n[1]=gC.y,n[2]=gC.z,n[3]=IH.x,n[4]=gC.y,n[5]=gC.z,n[6]=IH.x,n[7]=IH.y,n[8]=gC.z,n[9]=gC.x,n[10]=IH.y,n[11]=gC.z,e.position=new Me({componentDatatype:j.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 yt({attributes:e,indices:t,primitiveType:ve.LINES,boundingSphere:new le(d.ZERO,Math.sqrt(2))})};var rQ=JS;var Kct=new d,zye=new z;function Xct(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function Zd(e,t){Ii.call(this,{entity:e,scene:t,geometryOptions:new Xct(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}l(Object.create)&&(Zd.prototype=Object.create(Ii.prototype),Zd.prototype.constructor=Zd);Zd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),s=$n.fromDistanceDisplayCondition(a);if(this._materialProperty instanceof qt){let A;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(A=this._materialProperty.color.getValue(e,zye)),l(A)||(A=z.WHITE),o=Jt.fromColor(A),i={show:r,distanceDisplayCondition:s,color:o}}else i={show:r,distanceDisplayCondition:s};let c=t.plane,u=this._options,f=t.computeModelMatrix(e),h=q.getValueOrDefault(c.plane,e,u.plane),p=q.getValueOrUndefined(c.dimensions,e,u.dimensions);return u.plane=h,u.dimensions=p,f=jJ(h,p,f,f),new Mt({id:t,geometry:new oQ(this._options),modelMatrix:f,attributes:i})};Zd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,zye),o=this._distanceDisplayConditionProperty.getValue(e),r=t.plane,a=this._options,s=t.computeModelMatrix(e),c=q.getValueOrDefault(r.plane,e,a.plane),u=q.getValueOrUndefined(r.dimensions,e,a.dimensions);return a.plane=c,a.dimensions=u,s=jJ(c,u,s,s),new Mt({id:t,geometry:new rQ,modelMatrix:s,attributes:{show:new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:$n.fromDistanceDisplayCondition(o)}})};Zd.prototype._isHidden=function(e,t){return!l(t.plane)||!l(t.dimensions)||!l(e.position)||Ii.prototype._isHidden.call(this,e,t)};Zd.prototype._getIsClosed=function(e){return!1};Zd.prototype._isDynamic=function(e,t){return!e.position.isConstant||!q.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!q.isConstant(t.outlineWidth)};Zd.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof qt,i=this._options;i.vertexFormat=n?gn.VERTEX_FORMAT:_o.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(Xe.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(Xe.MINIMUM_VALUE,i.dimensions)};Zd.DynamicGeometryUpdater=ZS;function ZS(e,t,n){bi.call(this,e,t,n)}l(Object.create)&&(ZS.prototype=Object.create(bi.prototype),ZS.prototype.constructor=ZS);ZS.prototype._isHidden=function(e,t,n){let i=this._options,o=q.getValueOrUndefined(e.position,n,Kct);return!l(o)||!l(i.plane)||!l(i.dimensions)||bi.prototype._isHidden.call(this,e,t,n)};ZS.prototype._setOptions=function(e,t,n){let i=this._options;i.plane=q.getValueOrDefault(t.plane,n,i.plane),i.dimensions=q.getValueOrUndefined(t.dimensions,n,i.dimensions)};var Jct=new d,Zct=new d,$ct=new d,elt=new d,tlt=new J,nlt=new J,ilt=new M;function jJ(e,t,n,i){let o=e.normal,r=e.distance,a=d.multiplyByScalar(o,-r,$ct),s=d.clone(d.UNIT_Z,Zct);D.equalsEpsilon(Math.abs(d.dot(s,o)),1,D.EPSILON8)&&(s=d.clone(d.UNIT_Y,s));let c=d.cross(s,o,Jct);s=d.cross(o,c,s),d.normalize(c,c),d.normalize(s,s);let u=tlt;J.setColumn(u,0,c,u),J.setColumn(u,1,s,u),J.setColumn(u,2,o,u);let f=d.fromElements(t.x,t.y,1,elt),h=J.multiplyByScale(u,f,nlt),p=M.fromRotationTranslation(h,a,ilt);return M.multiplyTransformation(n,p,i)}Zd.createPrimitiveMatrix=jJ;var aQ=Zd;var olt=new d,rlt=new et,alt=new k,slt=new k,clt=new d,llt=new d,ult=new d,sQ=new d,flt=new d,dlt=new d,Gye=new Qe,hlt=new J,mlt=new J,plt=new d;function Alt(e,t,n,i,o,r,a,s,c){let u=e.positions,f=Ti.triangulate(e.positions2D,e.holes);f.length<3&&(f=[0,1,2]);let h=Ue.createTypedArray(u.length,f.length);h.set(f);let p=hlt;if(i!==0){let g=Qe.fromAxisAngle(a,i,Gye);if(p=J.fromQuaternion(g,p),t.tangent||t.bitangent){g=Qe.fromAxisAngle(a,-i,Gye);let I=J.fromQuaternion(g,mlt);s=d.normalize(J.multiplyByVector(I,s,s),s),t.bitangent&&(c=d.normalize(d.cross(a,s,c),c))}}else p=J.clone(J.IDENTITY,p);let A=slt;t.st&&(A.x=n.x,A.y=n.y);let m=u.length,_=m*3,y=new Float64Array(_),C=t.normal?new Float32Array(_):void 0,E=t.tangent?new Float32Array(_):void 0,b=t.bitangent?new Float32Array(_):void 0,x=t.st?new Float32Array(m*2):void 0,S=0,B=0,v=0,P=0,N=0;for(let g=0;g<m;g++){let I=u[g];if(y[S++]=I.x,y[S++]=I.y,y[S++]=I.z,t.st)if(l(o)&&o.positions.length===m)x[N++]=o.positions[g].x,x[N++]=o.positions[g].y;else{let T=J.multiplyByVector(p,I,olt),w=r(T,alt);k.subtract(w,A,w);let R=D.clamp(w.x/n.width,0,1),O=D.clamp(w.y/n.height,0,1);x[N++]=R,x[N++]=O}t.normal&&(C[B++]=a.x,C[B++]=a.y,C[B++]=a.z),t.tangent&&(E[P++]=s.x,E[P++]=s.y,E[P++]=s.z),t.bitangent&&(b[v++]=c.x,b[v++]=c.y,b[v++]=c.z)}let L=new _n;return t.position&&(L.position=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:y})),t.normal&&(L.normal=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:C})),t.tangent&&(L.tangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:E})),t.bitangent&&(L.bitangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:b})),t.st&&(L.st=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:x})),new yt({attributes:L,indices:h,primitiveType:ve.TRIANGLES})}function Db(e){e=e??V.EMPTY_OBJECT;let t=e.polygonHierarchy,n=e.textureCoordinates,i=e.vertexFormat??ke.DEFAULT;this._vertexFormat=ke.clone(i),this._polygonHierarchy=t,this._stRotation=e.stRotation??0,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=ni.computeHierarchyPackedLength(t,d)+ke.packedLength+te.packedLength+(l(n)?ni.computeHierarchyPackedLength(n,k):1)+2}Db.fromPositions=function(e){e=e??V.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new Db(t)};Db.pack=function(e,t,n){return n=n??0,n=ni.packPolygonHierarchy(e._polygonHierarchy,t,n,d),te.pack(e._ellipsoid,t,n),n+=te.packedLength,ke.pack(e._vertexFormat,t,n),n+=ke.packedLength,t[n++]=e._stRotation,l(e._textureCoordinates)?n=ni.packPolygonHierarchy(e._textureCoordinates,t,n,k):t[n++]=-1,t[n++]=e.packedLength,t};var glt=te.clone(te.UNIT_SPHERE),_lt=new ke,ylt={polygonHierarchy:{}};Db.unpack=function(e,t,n){t=t??0;let i=ni.unpackPolygonHierarchy(e,t,d);t=i.startingIndex,delete i.startingIndex;let o=te.unpack(e,t,glt);t+=te.packedLength;let r=ke.unpack(e,t,_lt);t+=ke.packedLength;let a=e[t++],s=e[t]===-1?void 0:ni.unpackPolygonHierarchy(e,t,k);l(s)?(t=s.startingIndex,delete s.startingIndex):t++;let c=e[t++];return l(n)||(n=new Db(ylt)),n._polygonHierarchy=i,n._ellipsoid=te.clone(o,n._ellipsoid),n._vertexFormat=ke.clone(r,n._vertexFormat),n._stRotation=a,n._textureCoordinates=s,n.packedLength=c,n};Db.createGeometry=function(e){let t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,o=e._textureCoordinates,r=l(o),a=n.positions;if(a=Ho(a,d.equalsEpsilon,!0),a.length<3)return;let s=clt,c=llt,u=ult,f=flt,h=dlt;if(!Gg.computeProjectTo2DArguments(a,sQ,f,h))return;if(s=d.cross(f,h,s),s=d.normalize(s,s),!d.equalsEpsilon(sQ,d.ZERO,D.EPSILON6)){let N=e._ellipsoid.geodeticSurfaceNormal(sQ,plt);d.dot(s,N)<0&&(s=d.negate(s,s),f=d.negate(f,f))}let A=Gg.createProjectPointsTo2DFunction(sQ,f,h),m=Gg.createProjectPointTo2DFunction(sQ,f,h);t.tangent&&(c=d.clone(f,c)),t.bitangent&&(u=d.clone(h,u));let _=ni.polygonsFromHierarchy(n,r,A,!1),y=_.hierarchy,C=_.polygons,E=function(N){return N},b=r?ni.polygonsFromHierarchy(o,!0,E,!1).polygons:void 0;if(y.length===0)return;a=y[0].outerRing;let x=le.fromPoints(a),S=ni.computeBoundingRectangle(s,m,a,i,rlt),B=[];for(let N=0;N<C.length;N++){let L=new Mt({geometry:Alt(C[N],t,S,i,r?b[N]:void 0,m,s,c,u)});B.push(L)}let v=Wn.combineInstances(B)[0];v.attributes.position.values=new Float64Array(v.attributes.position.values),v.indices=Ue.createTypedArray(v.attributes.position.values.length/3,v.indices);let P=v.attributes;return t.position||delete P.position,new yt({attributes:P,indices:v.indices,primitiveType:v.primitiveType,boundingSphere:x})};var cQ=Db;var Vye=[],xH=[];function Clt(e,t,n,i,o){let a=Pa.fromPoints(t,e).projectPointsOntoPlane(t,Vye);Ti.computeWindingOrder2D(a)===Ya.CLOCKWISE&&(a.reverse(),t=t.slice().reverse());let c,u,f=t.length,h=0;if(i)for(c=new Float64Array(f*2*3),u=0;u<f;u++){let m=t[u],_=t[(u+1)%f];c[h++]=m.x,c[h++]=m.y,c[h++]=m.z,c[h++]=_.x,c[h++]=_.y,c[h++]=_.z}else{let m=0;if(o===ln.GEODESIC)for(u=0;u<f;u++)m+=ni.subdivideLineCount(t[u],t[(u+1)%f],n);else if(o===ln.RHUMB)for(u=0;u<f;u++)m+=ni.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(m*3),u=0;u<f;u++){let _;o===ln.GEODESIC?_=ni.subdivideLine(t[u],t[(u+1)%f],n,xH):o===ln.RHUMB&&(_=ni.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,xH));let y=_.length;for(let C=0;C<y;++C)c[h++]=_[C]}}f=c.length/3;let p=f*2,A=Ue.createTypedArray(f,p);for(h=0,u=0;u<f-1;u++)A[h++]=u,A[h++]=u+1;return A[h++]=f-1,A[h++]=0,new Mt({geometry:new yt({attributes:new _n({position:new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:c})}),indices:A,primitiveType:ve.LINES})})}function Elt(e,t,n,i,o){let a=Pa.fromPoints(t,e).projectPointsOntoPlane(t,Vye);Ti.computeWindingOrder2D(a)===Ya.CLOCKWISE&&(a.reverse(),t=t.slice().reverse());let c,u,f=t.length,h=new Array(f),p=0;if(i)for(c=new Float64Array(f*2*3*2),u=0;u<f;++u){h[u]=p/3;let y=t[u],C=t[(u+1)%f];c[p++]=y.x,c[p++]=y.y,c[p++]=y.z,c[p++]=C.x,c[p++]=C.y,c[p++]=C.z}else{let y=0;if(o===ln.GEODESIC)for(u=0;u<f;u++)y+=ni.subdivideLineCount(t[u],t[(u+1)%f],n);else if(o===ln.RHUMB)for(u=0;u<f;u++)y+=ni.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(y*3*2),u=0;u<f;++u){h[u]=p/3;let C;o===ln.GEODESIC?C=ni.subdivideLine(t[u],t[(u+1)%f],n,xH):o===ln.RHUMB&&(C=ni.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,xH));let E=C.length;for(let b=0;b<E;++b)c[p++]=C[b]}}f=c.length/6;let A=h.length,m=(f*2+A)*2,_=Ue.createTypedArray(f+A,m);for(p=0,u=0;u<f;++u)_[p++]=u,_[p++]=(u+1)%f,_[p++]=u+f,_[p++]=(u+1)%f+f;for(u=0;u<A;u++){let y=h[u];_[p++]=y,_[p++]=y+f}return new Mt({geometry:new yt({attributes:new _n({position:new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:c})}),indices:_,primitiveType:ve.LINES})})}function vb(e){let t=e.polygonHierarchy,n=e.ellipsoid??te.default,i=e.granularity??D.RADIANS_PER_DEGREE,o=e.perPositionHeight??!1,r=o&&l(e.extrudedHeight),a=e.arcType??ln.GEODESIC,s=e.height??0,c=e.extrudedHeight??s;if(!r){let u=Math.max(s,c);c=Math.min(s,c),s=u}this._ellipsoid=te.clone(n),this._granularity=i,this._height=s,this._extrudedHeight=c,this._arcType=a,this._polygonHierarchy=t,this._perPositionHeight=o,this._perPositionHeightExtrude=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=ni.computeHierarchyPackedLength(t,d)+te.packedLength+8}vb.pack=function(e,t,n){return n=n??0,n=ni.packPolygonHierarchy(e._polygonHierarchy,t,n,d),te.pack(e._ellipsoid,t,n),n+=te.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++]=e._offsetAttribute??-1,t[n]=e.packedLength,t};var blt=te.clone(te.UNIT_SPHERE),Ilt={polygonHierarchy:{}};vb.unpack=function(e,t,n){t=t??0;let i=ni.unpackPolygonHierarchy(e,t,d);t=i.startingIndex,delete i.startingIndex;let o=te.unpack(e,t,blt);t+=te.packedLength;let r=e[t++],a=e[t++],s=e[t++],c=e[t++]===1,u=e[t++]===1,f=e[t++],h=e[t++],p=e[t];return l(n)||(n=new vb(Ilt)),n._polygonHierarchy=i,n._ellipsoid=te.clone(o,n._ellipsoid),n._height=r,n._extrudedHeight=a,n._granularity=s,n._perPositionHeight=u,n._perPositionHeightExtrude=c,n._arcType=f,n._offsetAttribute=h===-1?void 0:h,n.packedLength=p,n};vb.fromPositions=function(e){e=e??V.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 vb(t)};vb.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,o=e._perPositionHeight,r=e._arcType,a=ni.polygonOutlinesFromHierarchy(i,!o,t);if(a.length===0)return;let s,c=[],u=D.chordLength(n,t.maximumRadius),f=e._height,h=e._extrudedHeight,p=e._perPositionHeightExtrude||!D.equalsEpsilon(f,h,0,D.EPSILON2),A,m;if(p)for(m=0;m<a.length;m++){if(s=Elt(t,a[m],u,o,r),s.geometry=ni.scaleToGeodeticHeightExtruded(s.geometry,f,h,t,o),l(e._offsetAttribute)){let C=s.geometry.attributes.position.values.length/3,E=new Uint8Array(C);e._offsetAttribute===mn.TOP?E=E.fill(1,0,C/2):(A=e._offsetAttribute===mn.NONE?0:1,E=E.fill(A)),s.geometry.attributes.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:E})}c.push(s)}else for(m=0;m<a.length;m++){if(s=Clt(t,a[m],u,o,r),s.geometry.attributes.position.values=Ti.scaleToGeodeticHeight(s.geometry.attributes.position.values,f,t,!o),l(e._offsetAttribute)){let C=s.geometry.attributes.position.values.length;A=e._offsetAttribute===mn.NONE?0:1;let E=new Uint8Array(C/3).fill(A);s.geometry.attributes.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:E})}c.push(s)}let _=Wn.combineInstances(c)[0],y=le.fromVertices(_.attributes.position.values);return new yt({attributes:_.attributes,indices:_.indices,primitiveType:_.primitiveType,boundingSphere:y,offsetAttribute:e._offsetAttribute})};var lQ=vb;var Hye="Entity polygons cannot have both height and perPositionHeight. height will be ignored",Wye="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",jye=new z,Yye=d.ZERO,qye=new d,Kye=new ce,xlt=[],Tlt=new k;function Slt(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 Uf(e,t){ri.call(this,{entity:e,scene:t,geometryOptions:new Slt(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}l(Object.create)&&(Uf.prototype=Object.create(ri.prototype),Uf.prototype.constructor=Uf);Uf.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o={show:new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:$n.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof qt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,jye)),l(a)||(a=z.WHITE),o.color=Jt.fromColor(a)}l(i.offsetAttribute)&&(o.offset=go.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Yye,qye)));let r;return i.perPositionHeight&&!l(i.extrudedHeight)?r=new cQ(i):r=new cg(i),new Mt({id:t,geometry:r,attributes:o})};Uf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,jye),r=this._distanceDisplayConditionProperty.getValue(e),a={show:new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(o),distanceDisplayCondition:$n.fromDistanceDisplayCondition(r),offset:void 0};l(i.offsetAttribute)&&(a.offset=go.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Yye,qye)));let s;return i.perPositionHeight&&!l(i.extrudedHeight)?s=new Hd(i):s=new lQ(i),new Mt({id:t,geometry:s,attributes:a})};Uf.prototype._computeCenter=function(e,t){let n=q.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=Pa.fromPoints(i,o),a=r.projectPointsOntoPlane(i,xlt),s=a.length,c=0,u=s-1,f=new k;for(let p=0;p<s;u=p++){let A=a[p],m=a[u],_=A.x*m.y-m.x*A.y,y=k.add(A,m,Tlt);y=k.multiplyByScalar(y,_,y),f=k.add(f,y,f),c+=_}let h=1/(c*3);return f=k.multiplyByScalar(f,h,f),r.projectPointOntoEllipsoid(f,t)};Uf.prototype._isHidden=function(e,t){return!l(t.hierarchy)||Ii.prototype._isHidden.call(this,e,t)};Uf.prototype._isOnTerrain=function(e,t){let n=ri.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,o=l(i)&&(i.isConstant?i.getValue(Xe.MINIMUM_VALUE):!0);return n&&!o};Uf.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!q.isConstant(t.height)||!q.isConstant(t.extrudedHeight)||!q.isConstant(t.granularity)||!q.isConstant(t.stRotation)||!q.isConstant(t.textureCoordinates)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.perPositionHeight)||!q.isConstant(t.closeTop)||!q.isConstant(t.closeBottom)||!q.isConstant(t.zIndex)||!q.isConstant(t.arcType)||this._onTerrain&&!q.isConstant(this._materialProperty)&&!(this._materialProperty instanceof qt)};Uf.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof qt,i=this._options;i.vertexFormat=n?gn.VERTEX_FORMAT:_o.MaterialSupport.TEXTURED.vertexFormat;let o=t.hierarchy.getValue(Xe.MINIMUM_VALUE),r=q.getValueOrUndefined(t.height,Xe.MINIMUM_VALUE),a=q.getValueOrDefault(t.heightReference,Xe.MINIMUM_VALUE,it.NONE),s=q.getValueOrUndefined(t.extrudedHeight,Xe.MINIMUM_VALUE),c=q.getValueOrDefault(t.extrudedHeightReference,Xe.MINIMUM_VALUE,it.NONE),u=q.getValueOrDefault(t.perPositionHeight,Xe.MINIMUM_VALUE,!1);r=ri.getGeometryHeight(r,a);let f;if(u?(l(r)&&(r=void 0,It(Hye)),a!==it.NONE&&u&&(r=void 0,It(Wye))):(l(s)&&!l(r)&&(r=0),f=ri.computeGeometryOffsetAttribute(r,a,s,c)),i.polygonHierarchy=o,i.granularity=q.getValueOrUndefined(t.granularity,Xe.MINIMUM_VALUE),i.stRotation=q.getValueOrUndefined(t.stRotation,Xe.MINIMUM_VALUE),i.perPositionHeight=u,i.closeTop=q.getValueOrDefault(t.closeTop,Xe.MINIMUM_VALUE,!0),i.closeBottom=q.getValueOrDefault(t.closeBottom,Xe.MINIMUM_VALUE,!0),i.offsetAttribute=f,i.height=r,i.arcType=q.getValueOrDefault(t.arcType,Xe.MINIMUM_VALUE,ln.GEODESIC),i.textureCoordinates=q.getValueOrUndefined(t.textureCoordinates,Xe.MINIMUM_VALUE),s=ri.getGeometryExtrudedHeight(s,c),s===ri.CLAMP_TO_GROUND){let h=cg.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,Kye);s=Di.getMinimumMaximumHeights(h).minimumTerrainHeight}i.extrudedHeight=s};Uf.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)};Uf.DynamicGeometryUpdater=$S;function $S(e,t,n){bi.call(this,e,t,n)}l(Object.create)&&($S.prototype=Object.create(bi.prototype),$S.prototype.constructor=$S);$S.prototype._isHidden=function(e,t,n){return!l(this._options.polygonHierarchy)||bi.prototype._isHidden.call(this,e,t,n)};$S.prototype._setOptions=function(e,t,n){let i=this._options;i.polygonHierarchy=q.getValueOrUndefined(t.hierarchy,n);let o=q.getValueOrUndefined(t.height,n),r=q.getValueOrDefault(t.heightReference,n,it.NONE),a=q.getValueOrDefault(t.extrudedHeightReference,n,it.NONE),s=q.getValueOrUndefined(t.extrudedHeight,n),c=q.getValueOrUndefined(t.perPositionHeight,n);o=ri.getGeometryHeight(o,a);let u;if(c?(l(o)&&(o=void 0,It(Hye)),r!==it.NONE&&c&&(o=void 0,It(Wye))):(l(s)&&!l(o)&&(o=0),u=ri.computeGeometryOffsetAttribute(o,r,s,a)),i.granularity=q.getValueOrUndefined(t.granularity,n),i.stRotation=q.getValueOrUndefined(t.stRotation,n),i.textureCoordinates=q.getValueOrUndefined(t.textureCoordinates,n),i.perPositionHeight=q.getValueOrUndefined(t.perPositionHeight,n),i.closeTop=q.getValueOrDefault(t.closeTop,n,!0),i.closeBottom=q.getValueOrDefault(t.closeBottom,n,!0),i.offsetAttribute=u,i.height=o,i.arcType=q.getValueOrDefault(t.arcType,n,ln.GEODESIC),s=ri.getGeometryExtrudedHeight(s,a),s===ri.CLAMP_TO_GROUND){let f=cg.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,Kye);s=Di.getMinimumMaximumHeights(f).minimumTerrainHeight}i.extrudedHeight=s};var uQ=Uf;function wlt(e,t,n,i){let o=new _n;i.position&&(o.position=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:e}));let r=t.length,a=e.length/3,s=(a-r*2)/(r*2),c=Ti.triangulate(t),u=(s-1)*r*6+c.length*2,f=Ue.createTypedArray(a,u),h,p,A,m,_,y,C=r*2,E=0;for(h=0;h<s-1;h++){for(p=0;p<r-1;p++)A=p*2+h*r*2,y=A+C,m=A+1,_=m+C,f[E++]=m,f[E++]=A,f[E++]=_,f[E++]=_,f[E++]=A,f[E++]=y;A=r*2-2+h*r*2,m=A+1,_=m+C,y=A+C,f[E++]=m,f[E++]=A,f[E++]=_,f[E++]=_,f[E++]=A,f[E++]=y}if(i.st||i.tangent||i.bitangent){let S=new Float32Array(a*2),B=1/(s-1),v=1/n.height,P=n.height/2,N,L,g=0;for(h=0;h<s;h++){for(N=h*B,L=v*(t[0].y+P),S[g++]=N,S[g++]=L,p=1;p<r;p++)L=v*(t[p].y+P),S[g++]=N,S[g++]=L,S[g++]=N,S[g++]=L;L=v*(t[0].y+P),S[g++]=N,S[g++]=L}for(p=0;p<r;p++)N=0,L=v*(t[p].y+P),S[g++]=N,S[g++]=L;for(p=0;p<r;p++)N=(s-1)*B,L=v*(t[p].y+P),S[g++]=N,S[g++]=L;o.st=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:new Float32Array(S)})}let b=a-r*2;for(h=0;h<c.length;h+=3){let S=c[h]+b,B=c[h+1]+b,v=c[h+2]+b;f[E++]=S,f[E++]=B,f[E++]=v,f[E++]=v+r,f[E++]=B+r,f[E++]=S+r}let x=new yt({attributes:o,indices:f,boundingSphere:le.fromVertices(e),primitiveType:ve.TRIANGLES});if(i.normal&&(x=Wn.computeNormal(x)),i.tangent||i.bitangent){try{x=Wn.computeTangentAndBitangent(x)}catch{It("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}i.tangent||(x.attributes.tangent=void 0),i.bitangent||(x.attributes.bitangent=void 0),i.st||(x.attributes.st=void 0)}return x}function dQ(e){e=e??V.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._cornerType=e.cornerType??Ji.ROUNDED,this._vertexFormat=ke.clone(e.vertexFormat??ke.DEFAULT),this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeGeometry";let i=1+t.length*d.packedLength;i+=1+n.length*k.packedLength,this.packedLength=i+te.packedLength+ke.packedLength+2}dQ.pack=function(e,t,n){n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let a=e._shape;for(r=a.length,t[n++]=r,i=0;i<r;++i,n+=k.packedLength)k.pack(a[i],t,n);return te.pack(e._ellipsoid,t,n),n+=te.packedLength,ke.pack(e._vertexFormat,t,n),n+=ke.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Xye=te.clone(te.UNIT_SPHERE),Jye=new ke,fQ={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Xye,vertexFormat:Jye,cornerType:void 0,granularity:void 0};dQ.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let a=new Array(o);for(i=0;i<o;++i,t+=k.packedLength)a[i]=k.unpack(e,t);let s=te.unpack(e,t,Xye);t+=te.packedLength;let c=ke.unpack(e,t,Jye);t+=ke.packedLength;let u=e[t++],f=e[t];return l(n)?(n._positions=r,n._shape=a,n._ellipsoid=te.clone(s,n._ellipsoid),n._vertexFormat=ke.clone(c,n._vertexFormat),n._cornerType=u,n._granularity=f,n):(fQ.polylinePositions=r,fQ.shapePositions=a,fQ.cornerType=u,fQ.granularity=f,new dQ(fQ))};var Blt=new et;dQ.createGeometry=function(e){let t=e._positions,n=Ho(t,d.equalsEpsilon),i=e._shape;if(i=hm.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;Ti.computeWindingOrder2D(i)===Ya.CLOCKWISE&&i.reverse();let o=et.fromPoints(i,Blt),r=hm.computePositions(n,i,o,e,!0);return wlt(r,i,o,e._vertexFormat)};var hQ=dQ;function Dlt(e,t){let n=new _n;n.position=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:e});let i=t.length,o=n.position.values.length/3,a=e.length/3/i,s=Ue.createTypedArray(o,2*i*(a+1)),c,u,f=0;c=0;let h=c*i;for(u=0;u<i-1;u++)s[f++]=u+h,s[f++]=u+h+1;for(s[f++]=i-1+h,s[f++]=h,c=a-1,h=c*i,u=0;u<i-1;u++)s[f++]=u+h,s[f++]=u+h+1;for(s[f++]=i-1+h,s[f++]=h,c=0;c<a-1;c++){let A=i*c,m=A+i;for(u=0;u<i;u++)s[f++]=u+A,s[f++]=u+m}return new yt({attributes:n,indices:Ue.createTypedArray(o,s),boundingSphere:le.fromVertices(e),primitiveType:ve.LINES})}function pQ(e){e=e??V.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._cornerType=e.cornerType??Ji.ROUNDED,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeOutlineGeometry";let i=1+t.length*d.packedLength;i+=1+n.length*k.packedLength,this.packedLength=i+te.packedLength+2}pQ.pack=function(e,t,n){n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let a=e._shape;for(r=a.length,t[n++]=r,i=0;i<r;++i,n+=k.packedLength)k.pack(a[i],t,n);return te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Zye=te.clone(te.UNIT_SPHERE),mQ={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Zye,height:void 0,cornerType:void 0,granularity:void 0};pQ.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let a=new Array(o);for(i=0;i<o;++i,t+=k.packedLength)a[i]=k.unpack(e,t);let s=te.unpack(e,t,Zye);t+=te.packedLength;let c=e[t++],u=e[t];return l(n)?(n._positions=r,n._shape=a,n._ellipsoid=te.clone(s,n._ellipsoid),n._cornerType=c,n._granularity=u,n):(mQ.polylinePositions=r,mQ.shapePositions=a,mQ.cornerType=c,mQ.granularity=u,new pQ(mQ))};var vlt=new et;pQ.createGeometry=function(e){let t=e._positions,n=Ho(t,d.equalsEpsilon),i=e._shape;if(i=hm.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;Ti.computeWindingOrder2D(i)===Ya.CLOCKWISE&&i.reverse();let o=et.fromPoints(i,vlt),r=hm.computePositions(n,i,o,e,!1);return Dlt(r,i)};var AQ=pQ;var $ye=new z;function Plt(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 Qp(e,t){Ii.call(this,{entity:e,scene:t,geometryOptions:new Plt(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}l(Object.create)&&(Qp.prototype=Object.create(Ii.prototype),Qp.prototype.constructor=Qp);Qp.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),s=$n.fromDistanceDisplayCondition(a);if(this._materialProperty instanceof qt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,$ye)),l(c)||(c=z.WHITE),o=Jt.fromColor(c),i={show:r,distanceDisplayCondition:s,color:o}}else i={show:r,distanceDisplayCondition:s};return new Mt({id:t,geometry:new hQ(this._options),attributes:i})};Qp.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,$ye),o=this._distanceDisplayConditionProperty.getValue(e);return new Mt({id:t,geometry:new AQ(this._options),attributes:{show:new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:$n.fromDistanceDisplayCondition(o)}})};Qp.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.shape)||Ii.prototype._isHidden.call(this,e,t)};Qp.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!q.isConstant(t.granularity)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.cornerType)};Qp.prototype._setStaticOptions=function(e,t){let n=t.granularity,i=t.cornerType,o=this._options,r=this._materialProperty instanceof qt;o.vertexFormat=r?gn.VERTEX_FORMAT:_o.MaterialSupport.TEXTURED.vertexFormat,o.polylinePositions=t.positions.getValue(Xe.MINIMUM_VALUE,o.polylinePositions),o.shapePositions=t.shape.getValue(Xe.MINIMUM_VALUE,o.shape),o.granularity=l(n)?n.getValue(Xe.MINIMUM_VALUE):void 0,o.cornerType=l(i)?i.getValue(Xe.MINIMUM_VALUE):void 0};Qp.DynamicGeometryUpdater=ew;function ew(e,t,n){bi.call(this,e,t,n)}l(Object.create)&&(ew.prototype=Object.create(bi.prototype),ew.prototype.constructor=ew);ew.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.polylinePositions)||!l(i.shapePositions)||bi.prototype._isHidden.call(this,e,t,n)};ew.prototype._setOptions=function(e,t,n){let i=this._options;i.polylinePositions=q.getValueOrUndefined(t.positions,n,i.polylinePositions),i.shapePositions=q.getValueOrUndefined(t.shape,n),i.granularity=q.getValueOrUndefined(t.granularity,n),i.cornerType=q.getValueOrUndefined(t.cornerType,n)};var gQ=Qp;var YJ=new d,nCe=new d,iCe=new d,oCe=new d,rCe=new ce,Rlt=new k,Mlt=new le,Nlt=new le;function aCe(e,t){let n=new yt({attributes:new _n,primitiveType:ve.TRIANGLES});return n.attributes.position=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(n.attributes.bitangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:t.bitangents})),n}function Llt(e,t,n,i){let o=e.length,r=t.normal?new Float32Array(o):void 0,a=t.tangent?new Float32Array(o):void 0,s=t.bitangent?new Float32Array(o):void 0,c=0,u=oCe,f=iCe,h=nCe;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<o;p+=3){let A=d.fromArray(e,p,YJ),m=c+1,_=c+2;h=n.geodeticSurfaceNormal(A,h),(t.tangent||t.bitangent)&&(d.cross(d.UNIT_Z,h,f),J.multiplyByVector(i,f,f),d.normalize(f,f),t.bitangent&&d.normalize(d.cross(h,f,u),u)),t.normal&&(r[c]=h.x,r[m]=h.y,r[_]=h.z),t.tangent&&(a[c]=f.x,a[m]=f.y,a[_]=f.z),t.bitangent&&(s[c]=u.x,s[m]=u.y,s[_]=u.z),c+=3}return aCe(t,{positions:e,normals:r,tangents:a,bitangents:s})}var qJ=new d,sCe=new d;function Olt(e,t,n){let i=e.length,o=t.normal?new Float32Array(i):void 0,r=t.tangent?new Float32Array(i):void 0,a=t.bitangent?new Float32Array(i):void 0,s=0,c=0,u=0,f=!0,h=oCe,p=iCe,A=nCe;if(t.normal||t.tangent||t.bitangent)for(let m=0;m<i;m+=6){let _=d.fromArray(e,m,YJ),y=d.fromArray(e,(m+6)%i,qJ);if(f){let C=d.fromArray(e,(m+3)%i,sCe);d.subtract(y,_,y),d.subtract(C,_,C),A=d.normalize(d.cross(C,y,A),A),f=!1}d.equalsEpsilon(y,_,D.EPSILON10)&&(f=!0),(t.tangent||t.bitangent)&&(h=n.geodeticSurfaceNormal(_,h),t.tangent&&(p=d.normalize(d.cross(h,A,p),p))),t.normal&&(o[s++]=A.x,o[s++]=A.y,o[s++]=A.z,o[s++]=A.x,o[s++]=A.y,o[s++]=A.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&&(a[u++]=h.x,a[u++]=h.y,a[u++]=h.z,a[u++]=h.x,a[u++]=h.y,a[u++]=h.z)}return aCe(t,{positions:e,normals:o,tangents:r,bitangents:a})}function cCe(e,t){let n=e._vertexFormat,i=e._ellipsoid,o=t.height,r=t.width,a=t.northCap,s=t.southCap,c=0,u=o,f=o,h=0;a&&(c=1,f-=1,h+=1),s&&(u-=1,f-=1,h+=1),h+=r*f;let p=n.position?new Float64Array(h*3):void 0,A=n.st?new Float32Array(h*2):void 0,m=0,_=0,y=YJ,C=Rlt,E=Number.MAX_VALUE,b=Number.MAX_VALUE,x=-Number.MAX_VALUE,S=-Number.MAX_VALUE;for(let I=c;I<u;++I)for(let T=0;T<r;++T)gs.computePosition(t,i,n.st,I,T,y,C),p[m++]=y.x,p[m++]=y.y,p[m++]=y.z,n.st&&(A[_++]=C.x,A[_++]=C.y,E=Math.min(E,C.x),b=Math.min(b,C.y),x=Math.max(x,C.x),S=Math.max(S,C.y));if(a&&(gs.computePosition(t,i,n.st,0,0,y,C),p[m++]=y.x,p[m++]=y.y,p[m++]=y.z,n.st&&(A[_++]=C.x,A[_++]=C.y,E=C.x,b=C.y,x=C.x,S=C.y)),s&&(gs.computePosition(t,i,n.st,o-1,0,y,C),p[m++]=y.x,p[m++]=y.y,p[m]=y.z,n.st&&(A[_++]=C.x,A[_]=C.y,E=Math.min(E,C.x),b=Math.min(b,C.y),x=Math.max(x,C.x),S=Math.max(S,C.y))),n.st&&(E<0||b<0||x>1||S>1))for(let I=0;I<A.length;I+=2)A[I]=(A[I]-E)/(x-E),A[I+1]=(A[I+1]-b)/(S-b);let B=Llt(p,n,i,t.tangentRotationMatrix),v=6*(r-1)*(f-1);a&&(v+=3*(r-1)),s&&(v+=3*(r-1));let P=Ue.createTypedArray(h,v),N=0,L=0,g;for(g=0;g<f-1;++g){for(let I=0;I<r-1;++I){let T=N,w=T+r,R=w+1,O=T+1;P[L++]=T,P[L++]=w,P[L++]=O,P[L++]=O,P[L++]=w,P[L++]=R,++N}++N}if(a||s){let I=h-1,T=h-1;a&&s&&(I=h-2);let w,R;if(N=0,a)for(g=0;g<r-1;g++)w=N,R=w+1,P[L++]=I,P[L++]=w,P[L++]=R,++N;if(s)for(N=(f-1)*r,g=0;g<r-1;g++)w=N,R=w+1,P[L++]=w,P[L++]=T,P[L++]=R,++N}return B.indices=P,n.st&&(B.attributes.st=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:A})),B}function tw(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 nw(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 KJ=new ke;function Flt(e,t){let n=e._shadowVolume,i=e._offsetAttribute,o=e._vertexFormat,r=e._extrudedHeight,a=e._surfaceHeight,s=e._ellipsoid,c=t.height,u=t.width,f;if(n){let rt=ke.clone(o,KJ);rt.normal=!0,e._vertexFormat=rt}let h=cCe(e,t);n&&(e._vertexFormat=o);let p=Ti.scaleToGeodeticHeight(h.attributes.position.values,a,s,!1);p=new Float64Array(p);let A=p.length,m=A*2,_=new Float64Array(m);_.set(p);let y=Ti.scaleToGeodeticHeight(h.attributes.position.values,r,s);_.set(y,A),h.attributes.position.values=_;let C=o.normal?new Float32Array(m):void 0,E=o.tangent?new Float32Array(m):void 0,b=o.bitangent?new Float32Array(m):void 0,x=o.st?new Float32Array(m/3*2):void 0,S,B;if(o.normal){for(B=h.attributes.normal.values,C.set(B),f=0;f<A;f++)B[f]=-B[f];C.set(B,A),h.attributes.normal.values=C}if(n){B=h.attributes.normal.values,o.normal||(h.attributes.normal=void 0);let rt=new Float32Array(m);for(f=0;f<A;f++)B[f]=-B[f];rt.set(B,A),h.attributes.extrudeDirection=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:rt})}let v,P=l(i);if(P){let rt=A/3*2,Ye=new Uint8Array(rt);i===mn.TOP?Ye=Ye.fill(1,0,rt/2):(v=i===mn.NONE?0:1,Ye=Ye.fill(v)),h.attributes.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:Ye})}if(o.tangent){let rt=h.attributes.tangent.values;for(E.set(rt),f=0;f<A;f++)rt[f]=-rt[f];E.set(rt,A),h.attributes.tangent.values=E}if(o.bitangent){let rt=h.attributes.bitangent.values;b.set(rt),b.set(rt,A),h.attributes.bitangent.values=b}o.st&&(S=h.attributes.st.values,x.set(S),x.set(S,A/3*2),h.attributes.st.values=x);let N=h.indices,L=N.length,g=A/3,I=Ue.createTypedArray(m/3,L*2);for(I.set(N),f=0;f<L;f+=3)I[f+L]=N[f+2]+g,I[f+1+L]=N[f+1]+g,I[f+2+L]=N[f]+g;h.indices=I;let T=t.northCap,w=t.southCap,R=c,O=2,G=0,F=4,U=4;T&&(O-=1,R-=1,G+=1,F-=2,U-=1),w&&(O-=1,R-=1,G+=1,F-=2,U-=1),G+=O*u+2*R-F;let Q=(G+U)*2,H=new Float64Array(Q*3),Y=n?new Float32Array(Q*3):void 0,$=P?new Uint8Array(Q):void 0,W=o.st?new Float32Array(Q*2):void 0,K=i===mn.TOP;P&&!K&&(v=i===mn.ALL?1:0,$=$.fill(v));let Z=0,pe=0,ge=0,re=0,ye=u*R,Ce;for(f=0;f<ye;f+=u)Ce=f*3,H=tw(H,Z,Ce,p,y),Z+=6,o.st&&(W=nw(W,pe,f*2,S),pe+=4),n&&(ge+=3,Y[ge++]=B[Ce],Y[ge++]=B[Ce+1],Y[ge++]=B[Ce+2]),K&&($[re++]=1,re+=1);if(w){let rt=T?ye+1:ye;for(Ce=rt*3,f=0;f<2;f++)H=tw(H,Z,Ce,p,y),Z+=6,o.st&&(W=nw(W,pe,rt*2,S),pe+=4),n&&(ge+=3,Y[ge++]=B[Ce],Y[ge++]=B[Ce+1],Y[ge++]=B[Ce+2]),K&&($[re++]=1,re+=1)}else for(f=ye-u;f<ye;f++)Ce=f*3,H=tw(H,Z,Ce,p,y),Z+=6,o.st&&(W=nw(W,pe,f*2,S),pe+=4),n&&(ge+=3,Y[ge++]=B[Ce],Y[ge++]=B[Ce+1],Y[ge++]=B[Ce+2]),K&&($[re++]=1,re+=1);for(f=ye-1;f>0;f-=u)Ce=f*3,H=tw(H,Z,Ce,p,y),Z+=6,o.st&&(W=nw(W,pe,f*2,S),pe+=4),n&&(ge+=3,Y[ge++]=B[Ce],Y[ge++]=B[Ce+1],Y[ge++]=B[Ce+2]),K&&($[re++]=1,re+=1);if(T){let rt=ye;for(Ce=rt*3,f=0;f<2;f++)H=tw(H,Z,Ce,p,y),Z+=6,o.st&&(W=nw(W,pe,rt*2,S),pe+=4),n&&(ge+=3,Y[ge++]=B[Ce],Y[ge++]=B[Ce+1],Y[ge++]=B[Ce+2]),K&&($[re++]=1,re+=1)}else for(f=u-1;f>=0;f--)Ce=f*3,H=tw(H,Z,Ce,p,y),Z+=6,o.st&&(W=nw(W,pe,f*2,S),pe+=4),n&&(ge+=3,Y[ge++]=B[Ce],Y[ge++]=B[Ce+1],Y[ge++]=B[Ce+2]),K&&($[re++]=1,re+=1);let Pe=Olt(H,o,s);o.st&&(Pe.attributes.st=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:W})),n&&(Pe.attributes.extrudeDirection=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:Y})),P&&(Pe.attributes.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:$}));let Ne=Ue.createTypedArray(Q,G*6),Le,Oe,ot,Fe;A=H.length/3;let _t=0;for(f=0;f<A-1;f+=2){Le=f,Fe=(Le+2)%A;let rt=d.fromArray(H,Le*3,qJ),Ye=d.fromArray(H,Fe*3,sCe);d.equalsEpsilon(rt,Ye,D.EPSILON10)||(Oe=(Le+1)%A,ot=(Oe+2)%A,Ne[_t++]=Le,Ne[_t++]=Oe,Ne[_t++]=Fe,Ne[_t++]=Fe,Ne[_t++]=Oe,Ne[_t++]=ot)}return Pe.indices=Ne,Pe=Wn.combineInstances([new Mt({geometry:h}),new Mt({geometry:Pe})]),Pe[0]}var Qlt=[new d,new d,new d,new d],lCe=new me,klt=new me;function XJ(e,t,n,i,o){if(n===0)return ce.clone(e,o);let r=gs.computeOptions(e,t,n,0,rCe,lCe),a=r.height,s=r.width,c=Qlt;return gs.computePosition(r,i,!1,0,0,c[0]),gs.computePosition(r,i,!1,0,s-1,c[1]),gs.computePosition(r,i,!1,a-1,0,c[2]),gs.computePosition(r,i,!1,a-1,s-1,c[3]),ce.fromCartesianArray(c,i,o)}function kp(e){e=e??V.EMPTY_OBJECT;let t=e.rectangle,n=e.height??0,i=e.extrudedHeight??n;this._rectangle=ce.clone(t),this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._surfaceHeight=Math.max(n,i),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._vertexFormat=ke.clone(e.vertexFormat??ke.DEFAULT),this._extrudedHeight=Math.min(n,i),this._shadowVolume=e.shadowVolume??!1,this._workerName="createRectangleGeometry",this._offsetAttribute=e.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}kp.packedLength=ce.packedLength+te.packedLength+ke.packedLength+7;kp.pack=function(e,t,n){return n=n??0,ce.pack(e._rectangle,t,n),n+=ce.packedLength,te.pack(e._ellipsoid,t,n),n+=te.packedLength,ke.pack(e._vertexFormat,t,n),n+=ke.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]=e._offsetAttribute??-1,t};var uCe=new ce,fCe=te.clone(te.UNIT_SPHERE),_C={rectangle:uCe,ellipsoid:fCe,vertexFormat:KJ,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};kp.unpack=function(e,t,n){t=t??0;let i=ce.unpack(e,t,uCe);t+=ce.packedLength;let o=te.unpack(e,t,fCe);t+=te.packedLength;let r=ke.unpack(e,t,KJ);t+=ke.packedLength;let a=e[t++],s=e[t++],c=e[t++],u=e[t++],f=e[t++],h=e[t++]===1,p=e[t];return l(n)?(n._rectangle=ce.clone(i,n._rectangle),n._ellipsoid=te.clone(o,n._ellipsoid),n._vertexFormat=ke.clone(r,n._vertexFormat),n._granularity=a,n._surfaceHeight=s,n._rotation=c,n._stRotation=u,n._extrudedHeight=f,n._shadowVolume=h,n._offsetAttribute=p===-1?void 0:p,n):(_C.granularity=a,_C.height=s,_C.rotation=c,_C.stRotation=u,_C.extrudedHeight=f,_C.shadowVolume=h,_C.offsetAttribute=p===-1?void 0:p,new kp(_C))};kp.computeRectangle=function(e,t){e=e??V.EMPTY_OBJECT;let n=e.rectangle,i=e.granularity??D.RADIANS_PER_DEGREE,o=e.ellipsoid??te.default,r=e.rotation??0;return XJ(n,i,r,o,t)};var Ult=new J,eCe=new Qe,zlt=new me;kp.createGeometry=function(e){if(D.equalsEpsilon(e._rectangle.north,e._rectangle.south,D.EPSILON10)||D.equalsEpsilon(e._rectangle.east,e._rectangle.west,D.EPSILON10))return;let t=e._rectangle,n=e._ellipsoid,i=e._rotation,o=e._stRotation,r=e._vertexFormat,a=gs.computeOptions(t,e._granularity,i,o,rCe,lCe,klt),s=Ult;if(o!==0||i!==0){let A=ce.center(t,zlt),m=n.geodeticSurfaceNormalCartographic(A,qJ);Qe.fromAxisAngle(m,-o,eCe),J.fromQuaternion(eCe,s)}else J.clone(J.IDENTITY,s);let c=e._surfaceHeight,u=e._extrudedHeight,f=!D.equalsEpsilon(c,u,0,D.EPSILON2);a.lonScalar=1/e._rectangle.width,a.latScalar=1/e._rectangle.height,a.tangentRotationMatrix=s;let h,p;if(t=e._rectangle,f){h=Flt(e,a);let A=le.fromRectangle3D(t,n,c,Nlt),m=le.fromRectangle3D(t,n,u,Mlt);p=le.union(A,m)}else{if(h=cCe(e,a),h.attributes.position.values=Ti.scaleToGeodeticHeight(h.attributes.position.values,c,n,!1),l(e._offsetAttribute)){let A=h.attributes.position.values.length,m=e._offsetAttribute===mn.NONE?0:1,_=new Uint8Array(A/3).fill(m);h.attributes.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:_})}p=le.fromRectangle3D(t,n,c)}return r.position||delete h.attributes.position,new yt({attributes:h.attributes,indices:h.indices,primitiveType:h.primitiveType,boundingSphere:p,offsetAttribute:e._offsetAttribute})};kp.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),a=n(i,o);return new kp({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:o,stRotation:e._stRotation,granularity:i,extrudedHeight:a,height:r,vertexFormat:ke.POSITION_ONLY,shadowVolume:!0})};var tCe=new ce,Glt=[new k,new k,new k],Vlt=new ji,Hlt=new me;function Wlt(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=ce.clone(e._rectangle,tCe),n=e._granularity,i=e._ellipsoid,o=e._rotation-e._stRotation,r=XJ(t,n,o,i,tCe),a=Glt;a[0].x=r.west,a[0].y=r.south,a[1].x=r.west,a[1].y=r.north,a[2].x=r.east,a[2].y=r.south;let s=e.rectangle,c=ji.fromRotation(e._stRotation,Vlt),u=ce.center(s,Hlt);for(let m=0;m<3;++m){let _=a[m];_.x-=u.longitude,_.y-=u.latitude,ji.multiplyByVector(c,_,_),_.x+=u.longitude,_.y+=u.latitude,_.x=(_.x-s.west)/s.width,_.y=(_.y-s.south)/s.height}let f=a[0],h=a[1],p=a[2],A=new Array(6);return k.pack(f,A),k.pack(h,A,2),k.pack(p,A,4),A}Object.defineProperties(kp.prototype,{rectangle:{get:function(){return l(this._rotatedRectangle)||(this._rotatedRectangle=XJ(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=Wlt(this)),this._textureCoordinateRotationPoints}}});var Pb=kp;var dCe=new z,hCe=d.ZERO,mCe=new d,pCe=new ce,jlt=new ce,Ylt=new me;function qlt(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 bm(e,t){ri.call(this,{entity:e,scene:t,geometryOptions:new qlt(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}l(Object.create)&&(bm.prototype=Object.create(ri.prototype),bm.prototype.constructor=bm);bm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:$n.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof qt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,dCe)),l(o)||(o=z.WHITE),i.color=Jt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=go.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,hCe,mCe))),new Mt({id:t,geometry:new Pb(this._options),attributes:i})};bm.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,dCe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:$n.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=go.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,hCe,mCe))),new Mt({id:t,geometry:new ab(this._options),attributes:r})};bm.prototype._computeCenter=function(e,t){let n=q.getValueOrUndefined(this._entity.rectangle.coordinates,e,jlt);if(!l(n))return;let i=ce.center(n,Ylt);return me.toCartesian(i,te.default,t)};bm.prototype._isHidden=function(e,t){return!l(t.coordinates)||Ii.prototype._isHidden.call(this,e,t)};bm.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!q.isConstant(t.height)||!q.isConstant(t.extrudedHeight)||!q.isConstant(t.granularity)||!q.isConstant(t.stRotation)||!q.isConstant(t.rotation)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.zIndex)||this._onTerrain&&!q.isConstant(this._materialProperty)&&!(this._materialProperty instanceof qt)};bm.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof qt,i=q.getValueOrUndefined(t.height,Xe.MINIMUM_VALUE),o=q.getValueOrDefault(t.heightReference,Xe.MINIMUM_VALUE,it.NONE),r=q.getValueOrUndefined(t.extrudedHeight,Xe.MINIMUM_VALUE),a=q.getValueOrDefault(t.extrudedHeightReference,Xe.MINIMUM_VALUE,it.NONE);l(r)&&!l(i)&&(i=0);let s=this._options;s.vertexFormat=n?gn.VERTEX_FORMAT:_o.MaterialSupport.TEXTURED.vertexFormat,s.rectangle=t.coordinates.getValue(Xe.MINIMUM_VALUE,s.rectangle),s.granularity=q.getValueOrUndefined(t.granularity,Xe.MINIMUM_VALUE),s.stRotation=q.getValueOrUndefined(t.stRotation,Xe.MINIMUM_VALUE),s.rotation=q.getValueOrUndefined(t.rotation,Xe.MINIMUM_VALUE),s.offsetAttribute=ri.computeGeometryOffsetAttribute(i,o,r,a),s.height=ri.getGeometryHeight(i,o),r=ri.getGeometryExtrudedHeight(r,a),r===ri.CLAMP_TO_GROUND&&(r=Di.getMinimumMaximumHeights(Pb.computeRectangle(s,pCe)).minimumTerrainHeight),s.extrudedHeight=r};bm.DynamicGeometryUpdater=iw;function iw(e,t,n){bi.call(this,e,t,n)}l(Object.create)&&(iw.prototype=Object.create(bi.prototype),iw.prototype.constructor=iw);iw.prototype._isHidden=function(e,t,n){return!l(this._options.rectangle)||bi.prototype._isHidden.call(this,e,t,n)};iw.prototype._setOptions=function(e,t,n){let i=this._options,o=q.getValueOrUndefined(t.height,n),r=q.getValueOrDefault(t.heightReference,n,it.NONE),a=q.getValueOrUndefined(t.extrudedHeight,n),s=q.getValueOrDefault(t.extrudedHeightReference,n,it.NONE);l(a)&&!l(o)&&(o=0),i.rectangle=q.getValueOrUndefined(t.coordinates,n,i.rectangle),i.granularity=q.getValueOrUndefined(t.granularity,n),i.stRotation=q.getValueOrUndefined(t.stRotation,n),i.rotation=q.getValueOrUndefined(t.rotation,n),i.offsetAttribute=ri.computeGeometryOffsetAttribute(o,r,a,s),i.height=ri.getGeometryHeight(o,r),a=ri.getGeometryExtrudedHeight(a,s),a===ri.CLAMP_TO_GROUND&&(a=Di.getMinimumMaximumHeights(Pb.computeRectangle(i,pCe)).minimumTerrainHeight),i.extrudedHeight=a};var _Q=bm;var ACe={};function Klt(e,t){return D.equalsEpsilon(e.latitude,t.latitude,D.EPSILON10)&&D.equalsEpsilon(e.longitude,t.longitude,D.EPSILON10)}var Xlt=new me,Jlt=new me;function Zlt(e,t,n,i){t=Ho(t,d.equalsEpsilon);let o=t.length;if(o<2)return;let r=l(i),a=l(n),s=new Array(o),c=new Array(o),u=new Array(o),f=t[0];s[0]=f;let h=e.cartesianToCartographic(f,Xlt);a&&(h.height=n[0]),c[0]=h.height,r?u[0]=i[0]:u[0]=0;let p=c[0],A=u[0],m=p===A,_=1;for(let y=1;y<o;++y){let C=t[y],E=e.cartesianToCartographic(C,Jlt);a&&(E.height=n[y]),m=m&&E.height===0,Klt(h,E)?h.height<E.height&&(c[_-1]=E.height):(s[_]=C,c[_]=E.height,r?u[_]=i[y]:u[_]=0,m=m&&c[_]===u[_],me.clone(E,h),++_)}if(!(m||_<2))return s.length=_,c.length=_,u.length=_,{positions:s,topHeights:c,bottomHeights:u}}var $lt=new Array(2),eut=new Array(2),tut={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};ACe.computePositions=function(e,t,n,i,o,r){let a=Zlt(e,t,n,i);if(!l(a))return;t=a.positions,n=a.topHeights,i=a.bottomHeights;let s=t.length,c=s-2,u,f,h=D.chordLength(o,e.maximumRadius),p=tut;if(p.minDistance=h,p.ellipsoid=e,r){let A=0,m;for(m=0;m<s-1;m++)A+=Xi.numberOfPoints(t[m],t[m+1],h)+1;u=new Float64Array(A*3),f=new Float64Array(A*3);let _=$lt,y=eut;p.positions=_,p.height=y;let C=0;for(m=0;m<s-1;m++){_[0]=t[m],_[1]=t[m+1],y[0]=n[m],y[1]=n[m+1];let E=Xi.generateArc(p);u.set(E,C),y[0]=i[m],y[1]=i[m+1],f.set(Xi.generateArc(p),C),C+=E.length}}else p.positions=t,p.height=n,u=new Float64Array(Xi.generateArc(p)),p.height=i,f=new Float64Array(Xi.generateArc(p));return{bottomPositions:f,topPositions:u,numCorners:c}};var Rb=ACe;var JJ=new d,TH=new d,nut=new d,gCe=new d,iut=new d,out=new d,rut=new d;function Mb(e){e=e??V.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=e.vertexFormat??ke.DEFAULT,r=e.granularity??D.RADIANS_PER_DEGREE,a=e.ellipsoid??te.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=ke.clone(o),this._granularity=r,this._ellipsoid=te.clone(a),this._workerName="createWallGeometry";let s=1+t.length*d.packedLength+2;l(i)&&(s+=i.length),l(n)&&(s+=n.length),this.packedLength=s+te.packedLength+ke.packedLength+1}Mb.pack=function(e,t,n){n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let a=e._minimumHeights;if(r=l(a)?a.length:0,t[n++]=r,l(a))for(i=0;i<r;++i)t[n++]=a[i];let s=e._maximumHeights;if(r=l(s)?s.length:0,t[n++]=r,l(s))for(i=0;i<r;++i)t[n++]=s[i];return te.pack(e._ellipsoid,t,n),n+=te.packedLength,ke.pack(e._vertexFormat,t,n),n+=ke.packedLength,t[n]=e._granularity,t};var _Ce=te.clone(te.UNIT_SPHERE),yCe=new ke,yQ={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:_Ce,vertexFormat:yCe,granularity:void 0};Mb.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let a;if(o>0)for(a=new Array(o),i=0;i<o;++i)a[i]=e[t++];o=e[t++];let s;if(o>0)for(s=new Array(o),i=0;i<o;++i)s[i]=e[t++];let c=te.unpack(e,t,_Ce);t+=te.packedLength;let u=ke.unpack(e,t,yCe);t+=ke.packedLength;let f=e[t];return l(n)?(n._positions=r,n._minimumHeights=a,n._maximumHeights=s,n._ellipsoid=te.clone(c,n._ellipsoid),n._vertexFormat=ke.clone(u,n._vertexFormat),n._granularity=f,n):(yQ.positions=r,yQ.minimumHeights=a,yQ.maximumHeights=s,yQ.granularity=f,new Mb(yQ))};Mb.fromConstantHeights=function(e){e=e??V.EMPTY_OBJECT;let t=e.positions,n,i,o=e.minimumHeight,r=e.maximumHeight,a=l(o),s=l(r);if(a||s){let u=t.length;n=a?new Array(u):void 0,i=s?new Array(u):void 0;for(let f=0;f<u;++f)a&&(n[f]=o),s&&(i[f]=r)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new Mb(c)};Mb.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._vertexFormat,r=e._granularity,a=e._ellipsoid,s=Rb.computePositions(a,t,i,n,r,!0);if(!l(s))return;let c=s.bottomPositions,u=s.topPositions,f=s.numCorners,h=u.length,p=h*2,A=o.position?new Float64Array(p):void 0,m=o.normal?new Float32Array(p):void 0,_=o.tangent?new Float32Array(p):void 0,y=o.bitangent?new Float32Array(p):void 0,C=o.st?new Float32Array(p/3*2):void 0,E=0,b=0,x=0,S=0,B=0,v=rut,P=out,N=iut,L=!0;h/=3;let g,I=0,T=1/(h-f-1);for(g=0;g<h;++g){let F=g*3,U=d.fromArray(u,F,JJ),Q=d.fromArray(c,F,TH);if(o.position&&(A[E++]=Q.x,A[E++]=Q.y,A[E++]=Q.z,A[E++]=U.x,A[E++]=U.y,A[E++]=U.z),o.st&&(C[B++]=I,C[B++]=0,C[B++]=I,C[B++]=1),o.normal||o.tangent||o.bitangent){let H=d.clone(d.ZERO,gCe),Y=d.subtract(U,a.geodeticSurfaceNormal(U,TH),TH);if(g+1<h&&(H=d.fromArray(u,F+3,gCe)),L){let $=d.subtract(H,U,nut),W=d.subtract(Y,U,JJ);v=d.normalize(d.cross(W,$,v),v),L=!1}d.equalsEpsilon(U,H,D.EPSILON10)?L=!0:(I+=T,o.tangent&&(P=d.normalize(d.subtract(H,U,P),P)),o.bitangent&&(N=d.normalize(d.cross(v,P,N),N))),o.normal&&(m[b++]=v.x,m[b++]=v.y,m[b++]=v.z,m[b++]=v.x,m[b++]=v.y,m[b++]=v.z),o.tangent&&(_[S++]=P.x,_[S++]=P.y,_[S++]=P.z,_[S++]=P.x,_[S++]=P.y,_[S++]=P.z),o.bitangent&&(y[x++]=N.x,y[x++]=N.y,y[x++]=N.z,y[x++]=N.x,y[x++]=N.y,y[x++]=N.z)}}let w=new _n;o.position&&(w.position=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:A})),o.normal&&(w.normal=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:m})),o.tangent&&(w.tangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:_})),o.bitangent&&(w.bitangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:y})),o.st&&(w.st=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:C}));let R=p/3;p-=6*(f+1);let O=Ue.createTypedArray(R,p),G=0;for(g=0;g<R-2;g+=2){let F=g,U=g+2,Q=d.fromArray(A,F*3,JJ),H=d.fromArray(A,U*3,TH);if(d.equalsEpsilon(Q,H,D.EPSILON10))continue;let Y=g+1,$=g+3;O[G++]=Y,O[G++]=F,O[G++]=$,O[G++]=$,O[G++]=F,O[G++]=U}return new yt({attributes:w,indices:O,primitiveType:ve.TRIANGLES,boundingSphere:le.fromVertices(A)})};var CQ=Mb;var CCe=new d,ECe=new d;function Nb(e){e=e??V.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=e.granularity??D.RADIANS_PER_DEGREE,r=e.ellipsoid??te.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._granularity=o,this._ellipsoid=te.clone(r),this._workerName="createWallOutlineGeometry";let a=1+t.length*d.packedLength+2;l(i)&&(a+=i.length),l(n)&&(a+=n.length),this.packedLength=a+te.packedLength+1}Nb.pack=function(e,t,n){n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let a=e._minimumHeights;if(r=l(a)?a.length:0,t[n++]=r,l(a))for(i=0;i<r;++i)t[n++]=a[i];let s=e._maximumHeights;if(r=l(s)?s.length:0,t[n++]=r,l(s))for(i=0;i<r;++i)t[n++]=s[i];return te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n]=e._granularity,t};var bCe=te.clone(te.UNIT_SPHERE),EQ={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:bCe,granularity:void 0};Nb.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let a;if(o>0)for(a=new Array(o),i=0;i<o;++i)a[i]=e[t++];o=e[t++];let s;if(o>0)for(s=new Array(o),i=0;i<o;++i)s[i]=e[t++];let c=te.unpack(e,t,bCe);t+=te.packedLength;let u=e[t];return l(n)?(n._positions=r,n._minimumHeights=a,n._maximumHeights=s,n._ellipsoid=te.clone(c,n._ellipsoid),n._granularity=u,n):(EQ.positions=r,EQ.minimumHeights=a,EQ.maximumHeights=s,EQ.granularity=u,new Nb(EQ))};Nb.fromConstantHeights=function(e){e=e??V.EMPTY_OBJECT;let t=e.positions,n,i,o=e.minimumHeight,r=e.maximumHeight,a=l(o),s=l(r);if(a||s){let u=t.length;n=a?new Array(u):void 0,i=s?new Array(u):void 0;for(let f=0;f<u;++f)a&&(n[f]=o),s&&(i[f]=r)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid};return new Nb(c)};Nb.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._granularity,r=e._ellipsoid,a=Rb.computePositions(r,t,i,n,o,!1);if(!l(a))return;let s=a.bottomPositions,c=a.topPositions,u=c.length,f=u*2,h=new Float64Array(f),p=0;u/=3;let A;for(A=0;A<u;++A){let E=A*3,b=d.fromArray(c,E,CCe),x=d.fromArray(s,E,ECe);h[p++]=x.x,h[p++]=x.y,h[p++]=x.z,h[p++]=b.x,h[p++]=b.y,h[p++]=b.z}let m=new _n({position:new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:h})}),_=f/3;f=2*_-4+_;let y=Ue.createTypedArray(_,f),C=0;for(A=0;A<_-2;A+=2){let E=A,b=A+2,x=d.fromArray(h,E*3,CCe),S=d.fromArray(h,b*3,ECe);if(d.equalsEpsilon(x,S,D.EPSILON10))continue;let B=A+1,v=A+3;y[C++]=B,y[C++]=E,y[C++]=B,y[C++]=v,y[C++]=E,y[C++]=b}return y[C++]=_-2,y[C++]=_-1,new yt({attributes:m,indices:y,primitiveType:ve.LINES,boundingSphere:le.fromVertices(h)})};var bQ=Nb;var ICe=new z;function aut(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 Im(e,t){Ii.call(this,{entity:e,scene:t,geometryOptions:new aut(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}l(Object.create)&&(Im.prototype=Object.create(Ii.prototype),Im.prototype.constructor=Im);Im.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),s=$n.fromDistanceDisplayCondition(a);if(this._materialProperty instanceof qt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,ICe)),l(c)||(c=z.WHITE),o=Jt.fromColor(c),i={show:r,distanceDisplayCondition:s,color:o}}else i={show:r,distanceDisplayCondition:s};return new Mt({id:t,geometry:new CQ(this._options),attributes:i})};Im.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,ICe),o=this._distanceDisplayConditionProperty.getValue(e);return new Mt({id:t,geometry:new bQ(this._options),attributes:{show:new Sn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:$n.fromDistanceDisplayCondition(o)}})};Im.prototype._isHidden=function(e,t){return!l(t.positions)||Ii.prototype._isHidden.call(this,e,t)};Im.prototype._getIsClosed=function(e){return!1};Im.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!q.isConstant(t.minimumHeights)||!q.isConstant(t.maximumHeights)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.granularity)};Im.prototype._setStaticOptions=function(e,t){let n=t.minimumHeights,i=t.maximumHeights,o=t.granularity,r=this._materialProperty instanceof qt,a=this._options;a.vertexFormat=r?gn.VERTEX_FORMAT:_o.MaterialSupport.TEXTURED.vertexFormat,a.positions=t.positions.getValue(Xe.MINIMUM_VALUE,a.positions),a.minimumHeights=l(n)?n.getValue(Xe.MINIMUM_VALUE,a.minimumHeights):void 0,a.maximumHeights=l(i)?i.getValue(Xe.MINIMUM_VALUE,a.maximumHeights):void 0,a.granularity=l(o)?o.getValue(Xe.MINIMUM_VALUE):void 0};Im.DynamicGeometryUpdater=ow;function ow(e,t,n){bi.call(this,e,t,n)}l(Object.create)&&(ow.prototype=Object.create(bi.prototype),ow.prototype.constructor=ow);ow.prototype._isHidden=function(e,t,n){return!l(this._options.positions)||bi.prototype._isHidden.call(this,e,t,n)};ow.prototype._setOptions=function(e,t,n){let i=this._options;i.positions=q.getValueOrUndefined(t.positions,n,i.positions),i.minimumHeights=q.getValueOrUndefined(t.minimumHeights,n,i.minimumHeights),i.maximumHeights=q.getValueOrUndefined(t.maximumHeights,n,i.maximumHeights),i.granularity=q.getValueOrUndefined(t.granularity,n)};var IQ=Im;var Lb=[BM,GF,FF,tQ,iQ,aQ,uQ,gQ,_Q,IQ];function Ob(e,t){this.entity=e,this.scene=t;let n=new Array(Lb.length),i=new _e,o=new kr;for(let r=0;r<n.length;r++){let a=new Lb[r](e,t);o.add(a.geometryChanged,s=>{i.raiseEvent(s)}),n[r]=a}this.updaters=n,this.geometryChanged=i,this.eventHelper=o,this._removeEntitySubscription=e.definitionChanged.addEventListener(Ob.prototype._onEntityPropertyChanged,this)}Ob.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)};Ob.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};Ob.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),fe(this)};Ob.registerUpdater=function(e){Lb.includes(e)||Lb.push(e)};Ob.unregisterUpdater=function(e){if(Lb.includes(e)){let t=Lb.indexOf(e);Lb.splice(t,1)}};var Fb=Ob;var xCe=new z,sut=new zt,cut=new zt,lut=d.ZERO,uut=new d;function xm(e,t,n,i,o,r,a){this.translucent=t,this.appearanceType=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=o,this.depthFailMaterial=void 0,this.closed=r,this.shadows=a,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Ot,this.updaters=new Ot,this.updatersWithAttributes=new Ot,this.attributes=new Ot,this.subscriptions=new Ot,this.showsUpdated=new Ot,this.itemsToRemove=[],this.invalidated=!1;let s;l(o)&&(s=o.definitionChanged.addEventListener(xm.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=s}xm.prototype.onMaterialChanged=function(){this.invalidated=!0};xm.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:l(t)?t.equals(n):!1};xm.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||!q.isConstant(e.distanceDisplayConditionProperty)||!q.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,a,s){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};xm.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};xm.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let a=this.geometry.values;if(a.length>0){l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i);let c;if(l(this.depthFailAppearanceType)){l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=wr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial));let f=this.depthFailAppearanceType;c=new f({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})}let u=this.appearanceType;i=new Nn({show:!1,asynchronous:!0,geometryInstances:a.slice(),appearance:new u({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 qt)&&(this.depthFailMaterial=wr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let a=this.updatersWithAttributes.values,s=a.length,c=this.waitingOnCreate;for(r=0;r<s;r++){let u=a[r],f=this.geometry.get(u.id),h=this.attributes.get(f.id.id);if(l(h)||(h=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),!u.fillMaterialProperty.isConstant||c){let y=u.fillMaterialProperty.color,C=q.getValueOrDefault(y,e,z.WHITE,xCe);z.equals(h._lastColor,C)||(h._lastColor=z.clone(C,h._lastColor),h.color=Jt.toValue(C,h.color),(this.translucent&&h.color[3]===255||!this.translucent&&h.color[3]!==255)&&(this.itemsToRemove[n++]=u))}if(l(this.depthFailAppearanceType)&&u.depthFailMaterialProperty instanceof qt&&(!u.depthFailMaterialProperty.isConstant||c)){let y=u.depthFailMaterialProperty.color,C=q.getValueOrDefault(y,e,z.WHITE,xCe);z.equals(h._lastDepthFailColor,C)||(h._lastDepthFailColor=z.clone(C,h._lastDepthFailColor),h.depthFailColor=Jt.toValue(C,h.depthFailColor))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),A=h.show[0]===1;p!==A&&(h.show=Sn.toValue(p,h.show));let m=u.distanceDisplayConditionProperty;if(!q.isConstant(m)){let y=q.getValueOrDefault(m,e,cut,sut);zt.equals(y,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=zt.clone(y,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=$n.toValue(y,h.distanceDisplayCondition))}let _=u.terrainOffsetProperty;if(!q.isConstant(_)){let y=q.getValueOrDefault(_,e,lut,uut);d.equals(y,h._lastOffset)||(h._lastOffset=d.clone(y,h._lastOffset),h.offset=go.toValue(y,h.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};xm.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),a=this.attributes.get(r.id.id);l(a)||(a=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,a));let s=o.entity.isShowing,c=a.show[0]===1;s!==c&&(a.show=Sn.toValue(s,a.show),r.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};xm.prototype.contains=function(e){return this.updaters.contains(e.id)};xm.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Ct.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Ct.FAILED:(i.boundingSphere.clone(t),Ct.DONE)};xm.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 rw(e,t,n,i,o){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}rw.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 s=0;s<r;s++){let c=n[s];if(c.isMaterial(t)){c.add(t,o);return}}let a=new xm(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);a.add(t,o),n.push(a)};function TCe(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}rw.prototype.remove=function(e){TCe(this._solidItems,e)||TCe(this._translucentItems,e)};function SCe(e,t,n){let i=!1,o=t.length;for(let r=0;r<o;++r){let a=t[r],s=a.itemsToRemove,c=s.length;if(c>0)for(r=0;r<c;r++){let u=s[r];a.remove(u),e.add(n,u),i=!0}}return i}function SH(e,t,n,i){let o=t.length,r;for(r=o-1;r>=0;r--){let a=t[r];if(a.invalidated){t.splice(r,1);let s=a.updaters.values,c=s.length;for(let u=0;u<c;u++)e.add(n,s[u]);a.destroy()}}for(o=t.length,r=0;r<o;++r)i=t[r].update(n)&&i;return i}rw.prototype.update=function(e){let t=SH(this,this._solidItems,e,!0);t=SH(this,this._translucentItems,e,t)&&t;let n=SCe(this,this._solidItems,e),i=SCe(this,this._translucentItems,e);return(n||i)&&(t=SH(this,this._solidItems,e,t)&&t,t=SH(this,this._translucentItems,e,t)&&t),t};function wCe(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 Ct.FAILED}rw.prototype.getBoundingSphere=function(e,t){let n=wCe(this._solidItems,e,t);return n===Ct.FAILED?wCe(this._translucentItems,e,t):n};function BCe(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}rw.prototype.removeAllPrimitives=function(){BCe(this._solidItems),BCe(this._translucentItems)};var $d=rw;var fut=new zt,dut=new zt,hut=d.ZERO,mut=new d;function Tm(e,t,n,i,o,r,a){this.primitives=e,this.appearanceType=t,this.materialProperty=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=o,this.closed=r,this.shadows=a,this.updaters=new Ot,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Ot,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new Ot,this.attributes=new Ot,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Tm.prototype.onMaterialChanged,this),this.subscriptions=new Ot,this.showsUpdated=new Ot}Tm.prototype.onMaterialChanged=function(){this.invalidated=!0};Tm.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};Tm.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||!q.isConstant(t.distanceDisplayConditionProperty)||!q.isConstant(t.terrainOffsetProperty))this.updatersWithAttributes.set(n,t);else{let i=this;this.subscriptions.set(n,t.entity.definitionChanged.addEventListener(function(o,r,a,s){r==="isShowing"&&i.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Tm.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 put=new z;Tm.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=wr.getValue(e,this.materialProperty,this.material);let s;if(l(this.depthFailMaterialProperty)){this.depthFailMaterial=wr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial);let u=this.depthFailAppearanceType;s=new u({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})}let c=this.appearanceType;n=new Nn({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new c({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:s,shadows:this.shadows}),i.add(n),t=!1}else{l(n)&&(i.remove(n),n=void 0);let s=this.oldPrimitive;l(s)&&(i.remove(s),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=wr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof qt)&&(this.depthFailMaterial=wr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let a=this.updatersWithAttributes.values,s=a.length;for(r=0;r<s;r++){let c=a[r],u=c.entity,f=this.geometry.get(c.id),h=this.attributes.get(f.id.id);if(l(h)||(h=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),l(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof qt&&!c.depthFailMaterialProperty.isConstant){let y=c.depthFailMaterialProperty.color,C=q.getValueOrDefault(y,e,z.WHITE,put);z.equals(h._lastDepthFailColor,C)||(h._lastDepthFailColor=z.clone(C,h._lastDepthFailColor),h.depthFailColor=Jt.toValue(C,h.depthFailColor))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),A=h.show[0]===1;p!==A&&(h.show=Sn.toValue(p,h.show));let m=c.distanceDisplayConditionProperty;if(!q.isConstant(m)){let y=q.getValueOrDefault(m,e,dut,fut);zt.equals(y,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=zt.clone(y,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=$n.toValue(y,h.distanceDisplayCondition))}let _=c.terrainOffsetProperty;if(!q.isConstant(_)){let y=q.getValueOrDefault(_,e,hut,mut);d.equals(y,h._lastOffset)||(h._lastOffset=d.clone(y,h._lastOffset),h.offset=go.toValue(y,h.offset))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Tm.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,a=this.geometry.get(o.id),s=this.attributes.get(a.id.id);l(s)||(s=e.getGeometryInstanceAttributes(a.id),this.attributes.set(a.id.id,s));let c=r.isShowing,u=s.show[0]===1;c!==u&&(s.show=Sn.toValue(c,s.show),a.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Tm.prototype.contains=function(e){return this.updaters.contains(e.id)};Tm.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Ct.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Ct.FAILED:(i.boundingSphere.clone(t),Ct.DONE)};Tm.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 aw(e,t,n,i,o){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}aw.prototype.add=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let a=n[r];if(a.isMaterial(t)){a.add(e,t);return}}let o=new Tm(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);o.add(e,t),n.push(o)};aw.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}}};aw.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 a=r.updaters.values,s=a.length;for(let c=0;c<s;c++)this.add(e,a[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};aw.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 Ct.FAILED};aw.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 eh=aw;function wH(e,t,n=0,i=e.length-1,o=Aut){for(;i>n;){if(i-n>600){let c=i-n+1,u=t-n+1,f=Math.log(c),h=.5*Math.exp(2*f/3),p=.5*Math.sqrt(f*h*(c-h)/c)*(u-c/2<0?-1:1),A=Math.max(n,Math.floor(t-u*h/c+p)),m=Math.min(i,Math.floor(t+(c-u)*h/c+p));wH(e,t,A,m,o)}let r=e[t],a=n,s=i;for(xQ(e,n,t),o(e[i],r)>0&&xQ(e,n,i);a<s;){for(xQ(e,a,s),a++,s--;o(e[a],r)<0;)a++;for(;o(e[s],r)>0;)s--}o(e[n],r)===0?xQ(e,n,s):(s++,xQ(e,s,i)),s<=t&&(n=s+1),t<=s&&(i=s-1)}}function xQ(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function Aut(e,t){return e<t?-1:e>t?1:0}var wQ=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(!DH(t,n))return i;let o=this.toBBox,r=[];for(;n;){for(let a=0;a<n.children.length;a++){let s=n.children[a],c=n.leaf?o(s):s;DH(t,c)&&(n.leaf?i.push(s):$J(t,c)?this._all(s,i):r.push(s))}n=r.pop()}return i}collides(t){let n=this.data;if(!DH(t,n))return!1;let i=[];for(;n;){for(let o=0;o<n.children.length;o++){let r=n.children[o],a=n.leaf?this.toBBox(r):r;if(DH(t,a)){if(n.leaf||$J(t,a))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=cw([]),this}remove(t,n){if(!t)return this;let i=this.data,o=this.toBBox(t),r=[],a=[],s,c,u;for(;i||r.length;){if(i||(i=r.pop(),c=r[r.length-1],s=a.pop(),u=!0),i.leaf){let f=gut(t,i.children,n);if(f!==-1)return i.children.splice(f,1),r.push(i),this._condense(r),this}!u&&!i.leaf&&$J(i,o)?(r.push(i),a.push(s),s=0,c=i,i=i.children[0]):c?(s++,i=c.children[s],u=!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,a=this._maxEntries,s;if(r<=a)return s=cw(t.slice(n,i+1)),sw(s,this.toBBox),s;o||(o=Math.ceil(Math.log(r)/Math.log(a)),a=Math.ceil(r/Math.pow(a,o-1))),s=cw([]),s.leaf=!1,s.height=o;let c=Math.ceil(r/a),u=c*Math.ceil(Math.sqrt(a));DCe(t,n,i,u,this.compareMinX);for(let f=n;f<=i;f+=u){let h=Math.min(f+u-1,i);DCe(t,f,h,c,this.compareMinY);for(let p=f;p<=h;p+=c){let A=Math.min(p+c-1,h);s.children.push(this._build(t,p,A,o-1))}}return sw(s,this.toBBox),s}_chooseSubtree(t,n,i,o){for(;o.push(n),!(n.leaf||o.length-1===i);){let r=1/0,a=1/0,s;for(let c=0;c<n.children.length;c++){let u=n.children[c],f=ZJ(u),h=Cut(t,u)-f;h<a?(a=h,r=f<r?f:r,s=u):h===a&&f<r&&(r=f,s=u)}n=s||n.children[0]}return n}_insert(t,n,i){let o=i?t:this.toBBox(t),r=[],a=this._chooseSubtree(o,this.data,n,r);for(a.children.push(t),SQ(a,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 a=this._chooseSplitIndex(i,r,o),s=cw(i.children.splice(a,i.children.length-a));s.height=i.height,s.leaf=i.leaf,sw(i,this.toBBox),sw(s,this.toBBox),n?t[n-1].children.push(s):this._splitRoot(i,s)}_splitRoot(t,n){this.data=cw([t,n]),this.data.height=t.height+1,this.data.leaf=!1,sw(this.data,this.toBBox)}_chooseSplitIndex(t,n,i){let o,r=1/0,a=1/0;for(let s=n;s<=i-n;s++){let c=TQ(t,0,s,this.toBBox),u=TQ(t,s,i,this.toBBox),f=Eut(c,u),h=ZJ(c)+ZJ(u);f<r?(r=f,o=s,a=h<a?h:a):f===r&&h<a&&(a=h,o=s)}return o||i-n}_chooseSplitAxis(t,n,i){let o=t.leaf?this.compareMinX:_ut,r=t.leaf?this.compareMinY:yut,a=this._allDistMargin(t,n,i,o),s=this._allDistMargin(t,n,i,r);a<s&&t.children.sort(o)}_allDistMargin(t,n,i,o){t.children.sort(o);let r=this.toBBox,a=TQ(t,0,n,r),s=TQ(t,i-n,i,r),c=BH(a)+BH(s);for(let u=n;u<i-n;u++){let f=t.children[u];SQ(a,t.leaf?r(f):f),c+=BH(a)}for(let u=i-n-1;u>=n;u--){let f=t.children[u];SQ(s,t.leaf?r(f):f),c+=BH(s)}return c}_adjustParentBBoxes(t,n,i){for(let o=i;o>=0;o--)SQ(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():sw(t[n],this.toBBox)}};function gut(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 sw(e,t){TQ(e,0,e.children.length,t,e)}function TQ(e,t,n,i,o){o||(o=cw(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 a=e.children[r];SQ(o,e.leaf?i(a):a)}return o}function SQ(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 _ut(e,t){return e.minX-t.minX}function yut(e,t){return e.minY-t.minY}function ZJ(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function BH(e){return e.maxX-e.minX+(e.maxY-e.minY)}function Cut(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 Eut(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 $J(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function DH(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function cw(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function DCe(e,t,n,i,o){let r=[t,n];for(;r.length;){if(n=r.pop(),t=r.pop(),n-t<=i)continue;let a=t+Math.ceil((n-t)/i/2)*i;wH(e,a,t,n,o),r.push(t,a,a,n)}}function vH(){this._tree=new wQ}function Qb(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}Qb.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};vH.prototype.insert=function(e,t){let n=Qb.fromRectangleAndId(e,t,new Qb);this._tree.insert(n)};function but(e,t){return e.id===t.id}var Iut=new Qb;vH.prototype.remove=function(e,t){let n=Qb.fromRectangleAndId(e,t,Iut);this._tree.remove(n,but)};var xut=new Qb;vH.prototype.collides=function(e){let t=Qb.fromRectangleAndId("",e,xut);return this._tree.collides(t)};var kb=vH;var Tut=new z,Sut=new zt,wut=new zt;function u_(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 Ot,this.updaters=new Ot,this.updatersWithAttributes=new Ot,this.attributes=new Ot,this.subscriptions=new Ot,this.showsUpdated=new Ot,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new kb}u_.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};u_.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||!q.isConstant(e.distanceDisplayConditionProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,a,s){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};u_.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};u_.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let a=this.geometry.values;if(a.length>0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new vl({show:!1,asynchronous:!0,geometryInstances:a.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 a=this.updatersWithAttributes.values,s=a.length,c=this.waitingOnCreate;for(r=0;r<s;r++){let u=a[r],f=this.geometry.get(u.id),h=this.attributes.get(f.id.id);if(l(h)||(h=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),!u.fillMaterialProperty.isConstant||c){let _=u.fillMaterialProperty.color,y=q.getValueOrDefault(_,e,z.WHITE,Tut);z.equals(h._lastColor,y)||(h._lastColor=z.clone(y,h._lastColor),h.color=Jt.toValue(y,h.color))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),A=h.show[0]===1;p!==A&&(h.show=Sn.toValue(p,h.show));let m=u.distanceDisplayConditionProperty;if(!q.isConstant(m)){let _=q.getValueOrDefault(m,e,wut,Sut);zt.equals(_,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=zt.clone(_,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=$n.toValue(_,h.distanceDisplayCondition))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};u_.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),a=this.attributes.get(r.id.id);l(a)||(a=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,a));let s=o.entity.isShowing,c=a.show[0]===1;s!==c&&(a.show=Sn.toValue(s,a.show),r.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};u_.prototype.contains=function(e){return this.updaters.contains(e.id)};u_.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Ct.PENDING;let i=n.getBoundingSphere(e.entity);return l(i)?(i.clone(t),Ct.DONE):Ct.FAILED};u_.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 lw(e,t){this._batches=[],this._primitives=e,this._classificationType=t}lw.prototype.add=function(e,t){let n=t.createFillGeometryInstance(e),i=this._batches,o=q.getValueOrDefault(t.zIndex,0),r,a=i.length;for(let s=0;s<a;++s){let c=i[s];if(c.zIndex===o&&!c.overlapping(n.geometry.rectangle)){r=c;break}}return l(r)||(r=new u_(this._primitives,this._classificationType,n.attributes.color.value,o),i.push(r)),r.add(t,n),r};lw.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};lw.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 a=o[t],s=a.itemsToRemove,c=s.length;for(let u=0;u<c;u++){n=s[u],a.remove(n);let f=this.add(e,n);a.isDirty=!0,f.isDirty=!0}}for(t=r-1;t>=0;--t){let a=o[t];a.isDirty&&(i=o[t].update(e)&&i,a.isDirty=!1),a.geometry.length===0&&o.splice(t,1)}return i};lw.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 Ct.FAILED};lw.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var uw=lw;var But=new zt,Dut=new zt;function Up(e,t,n,i,o,r){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new Ot,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Ot,this.material=void 0,this.updatersWithAttributes=new Ot,this.attributes=new Ot,this.subscriptions=new Ot,this.showsUpdated=new Ot,this.usingSphericalTextureCoordinates=o,this.zIndex=r,this.rectangleCollisionCheck=new kb}Up.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};Up.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof qt&&t instanceof qt?!0:l(t)&&t.equals(n)};Up.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||!q.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,a,s,c){a==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Up.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};Up.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=wr.getValue(e,this.materialProperty,this.material);let s=this.appearanceType;n=new vl({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new s({material:this.material}),classificationType:this.classificationType}),i.add(n,this.zIndex),t=!1}else{l(n)&&(i.remove(n),n=void 0);let s=this.oldPrimitive;l(s)&&(i.remove(s),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=wr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;let a=this.updatersWithAttributes.values,s=a.length;for(r=0;r<s;r++){let c=a[r],u=c.entity,f=this.geometry.get(c.id),h=this.attributes.get(f.id.id);l(h)||(h=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h));let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),A=h.show[0]===1;p!==A&&(h.show=Sn.toValue(p,h.show));let m=c.distanceDisplayConditionProperty;if(!q.isConstant(m)){let _=q.getValueOrDefault(m,e,Dut,But);zt.equals(_,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=zt.clone(_,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=$n.toValue(_,h.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Up.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,a=this.geometry.get(o.id),s=this.attributes.get(a.id.id);l(s)||(s=e.getGeometryInstanceAttributes(a.id),this.attributes.set(a.id.id,s));let c=r.isShowing,u=s.show[0]===1;c!==u&&(s.show=Sn.toValue(c,s.show),a.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Up.prototype.contains=function(e){return this.updaters.contains(e.id)};Up.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Ct.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Ct.FAILED:(i.boundingSphere.clone(t),Ct.DONE)};Up.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n)};function fw(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}fw.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=hf.shouldUseSphericalCoordinates(o.geometry.rectangle),a=q.getValueOrDefault(t.zIndex,0);for(let c=0;c<i;++c){let u=n[c];if(u.isMaterial(t)&&u.usingSphericalTextureCoordinates===r&&u.zIndex===a&&!u.overlapping(o.geometry.rectangle)){u.add(e,t,o);return}}let s=new Up(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,r,a);s.add(e,t,o),n.push(s)};fw.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0&&!t[i].remove(e);i--);};fw.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];r.updaters.length===0&&(n.splice(t,1),r.destroy())}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};fw.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 Ct.FAILED};fw.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 BQ=fw;var vut=new z,Put=new zt,Rut=new zt,Mut=d.ZERO,Nut=new d;function f_(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 Ot,this.updaters=new Ot,this.updatersWithAttributes=new Ot,this.attributes=new Ot,this.itemsToRemove=[],this.subscriptions=new Ot,this.showsUpdated=new Ot}f_.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||!q.isConstant(e.distanceDisplayConditionProperty)||!q.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,a,s){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};f_.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};f_.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let a=this.geometry.values;if(a.length>0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new Nn({show:!1,asynchronous:!0,geometryInstances:a.slice(),appearance:new gn({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 a=this.updatersWithAttributes.values,s=a.length,c=this.waitingOnCreate;for(r=0;r<s;r++){let u=a[r],f=this.geometry.get(u.id),h=this.attributes.get(f.id.id);if(l(h)||(h=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),!u.outlineColorProperty.isConstant||c){let y=u.outlineColorProperty,C=q.getValueOrDefault(y,e,z.WHITE,vut);z.equals(h._lastColor,C)||(h._lastColor=z.clone(C,h._lastColor),h.color=Jt.toValue(C,h.color),(this.translucent&&h.color[3]===255||!this.translucent&&h.color[3]!==255)&&(this.itemsToRemove[n++]=u))}let p=u.entity.isShowing&&(u.hasConstantOutline||u.isOutlineVisible(e)),A=h.show[0]===1;p!==A&&(h.show=Sn.toValue(p,h.show));let m=u.distanceDisplayConditionProperty;if(!q.isConstant(m)){let y=q.getValueOrDefault(m,e,Rut,Put);zt.equals(y,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=zt.clone(y,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=$n.toValue(y,h.distanceDisplayCondition))}let _=u.terrainOffsetProperty;if(!q.isConstant(_)){let y=q.getValueOrDefault(_,e,Mut,Nut);d.equals(y,h._lastOffset)||(h._lastOffset=d.clone(y,h._lastOffset),h.offset=go.toValue(y,h.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};f_.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),a=this.attributes.get(r.id.id);l(a)||(a=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,a));let s=o.entity.isShowing,c=a.show[0]===1;s!==c&&(a.show=Sn.toValue(s,a.show),r.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};f_.prototype.contains=function(e){return this.updaters.contains(e.id)};f_.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Ct.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Ct.FAILED:(i.boundingSphere.clone(t),Ct.DONE)};f_.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 dw(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new Ot,this._translucentBatches=new Ot}dw.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 f_(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 f_(this._primitives,!0,i,this._shadows),o.set(i,r)),r.add(t,n))};dw.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};dw.prototype.update=function(e){let t,n,i,o,r=this._solidBatches.values,a=r.length,s=this._translucentBatches.values,c=s.length,u,f=!0,h=!1;do{for(h=!1,n=0;n<a;n++){o=r[n],f=o.update(e),u=o.itemsToRemove;let p=u.length;if(p>0)for(h=!0,t=0;t<p;t++)i=u[t],o.remove(i),this.add(e,i)}for(n=0;n<c;n++){o=s[n],f=o.update(e),u=o.itemsToRemove;let p=u.length;if(p>0)for(h=!0,t=0;t<p;t++)i=u[t],o.remove(i),this.add(e,i)}}while(h);return f};dw.prototype.getBoundingSphere=function(e,t){let n,i=this._solidBatches.values,o=i.length;for(n=0;n<o;n++){let s=i[n];if(s.contains(e))return s.getBoundingSphere(e,t)}let r=this._translucentBatches.values,a=r.length;for(n=0;n<a;n++){let s=r[n];if(s.contains(e))return s.getBoundingSphere(e,t)}return Ct.FAILED};dw.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 hw=dw;var Lut=[];function Uu(e,t,n,i){n=n??e.primitives,i=i??e.groundPrimitives,this._scene=e,this._primitives=n,this._groundPrimitives=i,this._entityCollection=void 0,this._addedObjects=new Ot,this._removedObjects=new Ot,this._changedObjects=new Ot;let o=wn.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=Zo.supportsMaterialsforEntitiesOnTerrain(e);this._supportsMaterialsforEntitiesOnTerrain=r;let a;for(a=0;a<o;++a)this._outlineBatches[a]=new hw(n,e,a,!1),this._outlineBatches[o+a]=new hw(n,e,a,!0),this._closedColorBatches[a]=new $d(n,gn,void 0,!0,a,!0),this._closedColorBatches[o+a]=new $d(n,gn,void 0,!0,a,!1),this._closedMaterialBatches[a]=new eh(n,_o,void 0,!0,a,!0),this._closedMaterialBatches[o+a]=new eh(n,_o,void 0,!0,a,!1),this._openColorBatches[a]=new $d(n,gn,void 0,!1,a,!0),this._openColorBatches[o+a]=new $d(n,gn,void 0,!1,a,!1),this._openMaterialBatches[a]=new eh(n,_o,void 0,!1,a,!0),this._openMaterialBatches[o+a]=new eh(n,_o,void 0,!1,a,!1);let s=ei.NUMBER_OF_CLASSIFICATION_TYPES,c=new Array(s),u=[];if(r)for(a=0;a<s;++a)u.push(new BQ(i,a,_o)),c[a]=new uw(i,a);else for(a=0;a<s;++a)c[a]=new uw(i,a);this._groundColorBatches=c,this._groundMaterialBatches=u,this._dynamicBatch=new Sb(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new Ot,this._updaterSets=new Ot,this._entityCollection=t,t.collectionChanged.addEventListener(Uu.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,Lut)}Uu.registerUpdater=function(e){Fb.registerUpdater(e)};Uu.unregisterUpdater=function(e){Fb.unregisterUpdater(e)};Uu.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,a=r.values,s,c,u,f,h=this;for(s=a.length-1;s>-1;s--)c=a[s],u=c.id,f=this._updaterSets.get(u),f.entity===c?f.forEach(function(_){h._removeUpdater(_),h._insertUpdaterIntoBatch(e,_)}):(o.push(c),n.push(c));for(s=o.length-1;s>-1;s--)c=o[s],u=c.id,f=this._updaterSets.get(u),f.forEach(this._removeUpdater.bind(this)),f.destroy(),this._updaterSets.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(s=n.length-1;s>-1;s--)c=n[s],u=c.id,f=new Fb(c,this._scene),this._updaterSets.set(u,f),f.forEach(function(_){h._insertUpdaterIntoBatch(e,_)}),this._subscriptions.set(u,f.geometryChanged.addEventListener(Uu._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let p=!0,A=this._batches,m=A.length;for(s=0;s<m;s++)p=A[s].update(e)&&p;return p};var Out=[],Fut=new le;Uu.prototype.getBoundingSphere=function(e,t){let n=Out,i=Fut,o=0,r=Ct.DONE,a=this._batches,s=a.length,c=e.id;if(!this._updaterSets.get(c))return Ct.FAILED;let u=this._updaterSets.get(c).updaters;for(let f=0;f<u.length;f++){let h=u[f];for(let p=0;p<s;p++){if(r=a[p].getBoundingSphere(h,i),r===Ct.PENDING)return Ct.PENDING;r===Ct.DONE&&(n[o]=le.clone(i,n[o]),o++)}}return o===0?Ct.FAILED:(n.length=o,le.fromBoundingSpheres(n,t),Ct.DONE)};Uu.prototype.isDestroyed=function(){return!1};Uu.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Uu.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(),fe(this)};Uu.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};Uu.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=wn.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 qt?this._groundColorBatches[o].add(e,t):this._groundMaterialBatches[o].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof qt?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 qt?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)};Uu._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)};Uu.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,a,s,c;for(a=n.length-1;a>-1;a--)c=n[a],s=c.id,i.remove(s)||(o.set(s,c),r.remove(s));for(a=t.length-1;a>-1;a--)c=t[a],s=c.id,o.remove(s)?r.set(s,c):i.set(s,c)};var DQ=Uu;var Qut=1,kut="30px sans-serif",Uut=pr.FILL,zut=z.WHITE,Gut=z.BLACK,Vut=1,Hut=!1,Wut=new z(.165,.165,.165,.8),jut=new k(7,5),Yut=k.ZERO,qut=d.ZERO,Kut=it.NONE,Xut=Mi.CENTER,Jut=jn.CENTER,Zut=new d,$ut=new z,eft=new z,tft=new z,nft=new k,ift=new d,oft=new k,rft=new Ht,aft=new Ht,sft=new Ht,cft=new zt;function vCe(e){this.entity=e,this.label=void 0,this.index=void 0}function yC(e,t){t.collectionChanged.addEventListener(yC.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Ot,this._onCollectionChanged(t,t.values,[],[])}yC.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],a=r.entity,s=a._label,c,u=r.label,f=a.isShowing&&a.isAvailable(e)&&q.getValueOrDefault(s._show,e,!0),h;if(f&&(h=q.getValueOrUndefined(a._position,e,Zut),c=q.getValueOrUndefined(s._text,e),f=l(h)&&l(c)),!f){e7(r,a,n);continue}q.isConstant(a._position)||(n._clusterDirty=!0);let p=!1,A=q.getValueOrDefault(s._heightReference,e,Kut);l(u)||(u=n.getLabel(a),u.id=a,r.label=u,p=d.equals(u.position,h)&&u.heightReference===A),u.show=!0,u.position=h,u.text=c,u.scale=q.getValueOrDefault(s._scale,e,Qut),u.font=q.getValueOrDefault(s._font,e,kut),u.style=q.getValueOrDefault(s._style,e,Uut),u.fillColor=q.getValueOrDefault(s._fillColor,e,zut,$ut),u.outlineColor=q.getValueOrDefault(s._outlineColor,e,Gut,eft),u.outlineWidth=q.getValueOrDefault(s._outlineWidth,e,Vut),u.showBackground=q.getValueOrDefault(s._showBackground,e,Hut),u.backgroundColor=q.getValueOrDefault(s._backgroundColor,e,Wut,tft),u.backgroundPadding=q.getValueOrDefault(s._backgroundPadding,e,jut,nft),u.pixelOffset=q.getValueOrDefault(s._pixelOffset,e,Yut,oft),u.eyeOffset=q.getValueOrDefault(s._eyeOffset,e,qut,ift),u.heightReference=A,u.horizontalOrigin=q.getValueOrDefault(s._horizontalOrigin,e,Xut),u.verticalOrigin=q.getValueOrDefault(s._verticalOrigin,e,Jut),u.translucencyByDistance=q.getValueOrUndefined(s._translucencyByDistance,e,rft),u.pixelOffsetScaleByDistance=q.getValueOrUndefined(s._pixelOffsetScaleByDistance,e,aft),u.scaleByDistance=q.getValueOrUndefined(s._scaleByDistance,e,sft),u.distanceDisplayCondition=q.getValueOrUndefined(s._distanceDisplayCondition,e,cft),u.disableDepthTestDistance=q.getValueOrUndefined(s._disableDepthTestDistance,e),p&&u._updateClamping()}return!0};yC.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.label))return Ct.FAILED;let i=n.label;return t.center=d.clone(i._clampedPosition??i.position,t.center),t.radius=0,Ct.DONE};yC.prototype.isDestroyed=function(){return!1};yC.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(yC.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return fe(this)};yC.prototype._onCollectionChanged=function(e,t,n,i){let o,r,a=this._items,s=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._label)&&l(r._position)&&a.set(r.id,new vCe(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._label)&&l(r._position)?a.contains(r.id)||a.set(r.id,new vCe(r)):(e7(a.get(r.id),r,s),a.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],e7(a.get(r.id),r,s),a.remove(r.id)};function e7(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var vQ=yC;var lft=1,uft=!0,fft=0,dft=!0,hft=!0,mft=wn.ENABLED,pft=it.NONE,Aft=z.RED,gft=0,_ft=z.WHITE,yft=el.HIGHLIGHT,Cft=.5,Eft=new k(1,1),PCe={maximumPositionEpsilon:Number.POSITIVE_INFINITY},bft=new M,Ift=new M,RCe=new z,MCe=new Array(4),xft=new d;function CC(e,t){t.collectionChanged.addEventListener(CC.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new Ot,this._onCollectionChanged(t,t.values,[],[])}async function Tft(e,t,n,i,o){let r=e._primitives,a=e._modelHash;try{let s=await xf.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene,environmentMapOptions:o});if(e.isDestroyed()||!l(a[t.id]))return;s._marsOptions=t._model?._marsOptions,s.id=t,r.add(s),a[t.id].modelPrimitive=s,s.errorEvent.addEventListener(c=>{l(a[t.id])&&(console.log(c),c.name!=="TextureError"&&s.incrementallyLoadTextures&&(a[t.id].loadFailed=!0))})}catch(s){if(e.isDestroyed()||!l(a[t.id]))return;console.log(s),a[t.id].loadFailed=!0}}CC.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 a=t[o],s=a._model,c,u=n[a.id],f=a.isShowing&&a.isAvailable(e)&&q.getValueOrDefault(s._show,e,!0),h;if(f&&(h=a.computeModelMatrix(e,bft),c=De.createIfNeeded(q.getValueOrUndefined(s._uri,e)),f=l(h)&&l(c)),!f){l(u)&&u.modelPrimitive&&(u.modelPrimitive.show=!1);continue}if(!l(u)||c.url!==u.url){l(u?.modelPrimitive)&&(i.removeAndDestroy(u.modelPrimitive),delete n[a.id]),u={modelPrimitive:void 0,url:c.url,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1,environmentMapOptionsScratch:{...PCe}},n[a.id]=u;let m=q.getValueOrDefault(s._incrementallyLoadTextures,e,dft),_=q.getValueOrDefault(s._environmentMapOptions,e,PCe,u.environmentMapOptionsScratch);Tft(this,a,c,m,_)}let p=u.modelPrimitive;if(!l(p))continue;p.show=!0,p.scale=q.getValueOrDefault(s._scale,e,lft),p.enableVerticalExaggeration=q.getValueOrDefault(s._enableVerticalExaggeration,e,uft),p.minimumPixelSize=q.getValueOrDefault(s._minimumPixelSize,e,fft),p.maximumScale=q.getValueOrUndefined(s._maximumScale,e),p.modelMatrix=M.clone(h,p.modelMatrix),p.shadows=q.getValueOrDefault(s._shadows,e,mft),p.heightReference=q.getValueOrDefault(s._heightReference,e,pft),p.distanceDisplayCondition=q.getValueOrUndefined(s._distanceDisplayCondition,e),p.silhouetteColor=q.getValueOrDefault(s._silhouetteColor,e,Aft,RCe),p.silhouetteSize=q.getValueOrDefault(s._silhouetteSize,e,gft),p.color=q.getValueOrDefault(s._color,e,_ft,RCe),p.colorBlendMode=q.getValueOrDefault(s._colorBlendMode,e,yft),p.colorBlendAmount=q.getValueOrDefault(s._colorBlendAmount,e,Cft),p.clippingPlanes=q.getValueOrUndefined(s._clippingPlanes,e),p.clampAnimations=q.getValueOrDefault(s._clampAnimations,e,hft),p.imageBasedLighting.imageBasedLightingFactor=q.getValueOrDefault(s._imageBasedLightingFactor,e,Eft);let A=q.getValueOrUndefined(s._lightColor,e);if(l(A)&&(z.pack(A,MCe,0),A=d.unpack(MCe,0,xft)),p.lightColor=A,p.customShader=q.getValueOrUndefined(s._customShader,e),n[a.id].modelUpdated=!0,p.ready){!s._readyOk&&s._marsOptions&&s._marsOptions.callback&&(s._marsOptions.callback(a,p),s._readyOk=!0);let m=q.getValueOrDefault(s._runAnimations,e,!0);u.animationsRunning!==m&&(m?p.activeAnimations.addAll({loop:Du.REPEAT}):p.activeAnimations.removeAll(),u.animationsRunning=m);let _=q.getValueOrUndefined(s._nodeTransformations,e,u.nodeTransformationsScratch);if(l(_)){let E=Object.keys(_);for(let b=0,x=E.length;b<x;++b){let S=E[b],B=_[S];if(!l(B))continue;let v=p.getNode(S);if(!l(v))continue;let P=M.fromTranslationRotationScale(B,Ift);v.matrix=M.multiply(v.originalMatrix,P,P)}}let y=!1,C=q.getValueOrUndefined(s._articulations,e,u.articulationsScratch);if(l(C)){let E=Object.keys(C);for(let b=0,x=E.length;b<x;++b){let S=E[b],B=C[S];l(B)&&(y=!0,p.setArticulationStage(S,B))}}y&&p.applyArticulations()}}return!0};CC.prototype.isDestroyed=function(){return!1};CC.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(CC.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)t7(this,e[i],t,n);return fe(this)};var PH=new d,Sft=new me;CC.prototype.getBoundingSphere=function(e,t){let n=this._modelHash[e.id];if(!l(n))return Ct.FAILED;if(n.loadFailed)return Ct.FAILED;let i=n.modelPrimitive;if(!l(i)||!i.show)return Ct.PENDING;if(!i.ready||!n.modelUpdated)return Ct.PENDING;let o=this._scene,r=o.ellipsoid??te.default;if(i.heightReference!==it.NONE){let s=i.modelMatrix;PH.x=s[12],PH.y=s[13],PH.z=s[14];let c=r.cartesianToCartographic(PH,Sft),u=o.getHeight(c,i.heightReference);return l(u)&&(gd(i.heightReference)?c.height=u:c.height+=u),le.clone(i.boundingSphere,t),t.center=r.cartographicToCartesian(c),Ct.DONE}return le.clone(i.boundingSphere,t),Ct.DONE};CC.prototype._onCollectionChanged=function(e,t,n,i){let o,r,a=this._entitiesToVisualize,s=this._modelHash,c=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],l(r._model)&&l(r._position)&&a.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],l(r._model)&&l(r._position)?(wft(r,s),a.set(r.id,r)):(t7(this,r,s,c),a.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],t7(this,r,s,c),a.remove(r.id)};function t7(e,t,n,i){let o=n[t.id];l(o)&&(i.removeAndDestroy(o.modelPrimitive),delete n[t.id])}function wft(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var PQ=CC;function EC(e){this._definitionChanged=new _e,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(EC.prototype,{isConstant:{get:function(){return q.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return l(this._value)?this._value.referenceFrame:Li.FIXED}}});var Bft=new X;EC.prototype.getValue=function(e,t){return l(e)||(e=X.now(Bft)),this.getValueInReferenceFrame(e,Li.FIXED,t)};EC.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))};EC.prototype.getValueInReferenceFrame=function(e,t,n){if(l(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),l(n)?te.default.scaleToGeodeticSurface(n,n):void 0};EC.prototype.equals=function(e){return this===e||e instanceof EC&&this._value===e._value};EC.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var zp=EC;var NCe=new J,LCe=new J,OCe=new J,Dft=new d,FCe=new d,vft=new d,Pft=new d,RH=new Qe,MH=new M,NH=new J;function RQ(e,t,n,i,o){if(!(!l(t)||!l(n))){if(d.subtract(t,n,o),l(i.orientation))i.orientation.getValue(e,RH)&&(Qe.conjugate(RH,RH),J.fromQuaternion(RH,NH),J.multiplyByVector(NH,o,o));else if(l(o7(e,i.position,MH)))M.inverse(MH,MH),M.getRotation(MH,NH),J.multiplyByVector(NH,o,o);else return;return o}}function o7(e,t,n){let i=t.getValue(e,Dft);if(l(i)){let o=X.addSeconds(e,.01,new X),r=t.getValue(o,FCe);if(l(r)&&!d.equalsEpsilon(i,r,D.EPSILON16)){let a=At.computeFixedToIcrfMatrix(e,NCe),s=At.computeFixedToIcrfMatrix(o,LCe),c;!l(a)||!l(s)?(c=At.computeTemeToPseudoFixedMatrix(e,OCe),a=J.transpose(c,NCe),s=At.computeTemeToPseudoFixedMatrix(o,LCe),J.transpose(s,s)):c=J.transpose(a,OCe);let u=vft;d.normalize(i,u),d.normalize(r,r),J.multiplyByVector(a,u,u),J.multiplyByVector(s,r,r);let f=d.cross(u,r,Pft);if(!d.equalsEpsilon(f,d.ZERO,D.EPSILON16)){let h=d.cross(f,u,FCe);return J.multiplyByVector(c,h,h),J.multiplyByVector(c,f,f),J.multiplyByVector(c,u,u),d.normalize(h,h),d.normalize(f,f),d.normalize(u,u),l(n)||(n=new M),n[0]=h.x,n[1]=h.y,n[2]=h.z,n[3]=0,n[4]=f.x,n[5]=f.y,n[6]=f.z,n[7]=0,n[8]=u.x,n[9]=u.y,n[10]=u.z,n[11]=0,n[12]=i.x,n[13]=i.y,n[14]=i.z,n[15]=1,n}}}}var Rft=60,Mft=1,GCe=new vn,n7=new vn,i7=new vn;function QCe(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}var LH=new d;function Nft(e,t,n,i,o,r,a,s,c){let u,f,h=!1;r instanceof Zo&&(u=r,f=u.position,r=Li.FIXED,h=!0);let p=s,A,m;A=e.getValueInReferenceFrame(t,r,c[p]),h?(m=f.getValueInReferenceFrame(t,r,LH),A=RQ(t,A,m,u,A),l(A)&&(c[p++]=A)):l(A)&&(c[p++]=A);let _=!l(o)||X.lessThanOrEquals(o,t)||X.greaterThanOrEquals(o,n),y=0,C=i.length,E=i[y],b=n,x=!1,S,B,v;for(;y<C;){if(!_&&X.greaterThanOrEquals(E,o)&&(A=e.getValueInReferenceFrame(o,r,c[p]),h?(m=f.getValueInReferenceFrame(o,r,LH),l(A)&&l(m)&&(A=RQ(o,A,m,u,A),l(A)&&(c[p++]=A))):l(A)&&(c[p++]=A),_=!0),X.greaterThan(E,t)&&X.lessThan(E,b)&&!E.equals(o)&&(A=e.getValueInReferenceFrame(E,r,c[p]),h?(m=f.getValueInReferenceFrame(E,r,LH),l(A)&&l(m)&&(A=RQ(E,A,m,u,A),l(A)&&(c[p++]=A))):l(A)&&(c[p++]=A)),y<C-1){if(a>0&&!x){let P=i[y+1],N=X.secondsDifference(P,E);x=N>a,x&&(S=Math.ceil(N/a),B=0,v=N/Math.max(S,2),S=Math.max(S-1,1))}if(x&&B<S){E=X.addSeconds(E,v,new X),B++;continue}}x=!1,y++,E=i[y]}return A=e.getValueInReferenceFrame(n,r,c[p]),h?(m=f.getValueInReferenceFrame(n,r,LH),l(A)&&l(m)&&(A=RQ(n,A,m,u,A),l(A)&&(c[p++]=A))):l(A)&&(c[p++]=A),p}function Lft(e,t,n,i,o,r,a,s){let c,u=0,f=a,h=t,p=!l(i)||X.lessThanOrEquals(i,t)||X.greaterThanOrEquals(i,n);for(;X.lessThan(h,n);)!p&&X.greaterThanOrEquals(h,i)&&(p=!0,c=e.getValueInReferenceFrame(i,o,s[f]),l(c)&&(s[f]=c,f++)),c=e.getValueInReferenceFrame(h,o,s[f]),l(c)&&(s[f]=c,f++),u++,h=X.addSeconds(t,r*u,new X);return c=e.getValueInReferenceFrame(n,o,s[f]),l(c)&&(s[f]=c,f++),f}function Oft(e,t,n,i,o,r,a,s){let c,u=0,f=a,h=t,p=Math.max(r,60),A=!l(i)||X.lessThanOrEquals(i,t)||X.greaterThanOrEquals(i,n);for(;X.lessThan(h,n);)!A&&X.greaterThanOrEquals(h,i)&&(A=!0,c=e.getValueInReferenceFrame(i,o,s[f]),l(c)&&(s[f]=c,f++)),c=e.getValueInReferenceFrame(h,o,s[f]),l(c)&&(s[f]=c,f++),u++,h=X.addSeconds(t,p*u,new X);return c=e.getValueInReferenceFrame(n,o,s[f]),l(c)&&(s[f]=c,f++),f}function Fft(e,t,n,i,o,r,a,s){i7.start=t,i7.stop=n;let c=a,u=e.intervals;for(let f=0;f<u.length;f++){let h=u.get(f);if(!vn.intersect(h,i7,GCe).isEmpty){let p=h.start;h.isStartIncluded||(h.isStopIncluded?p=h.stop:p=X.addSeconds(h.start,X.secondsDifference(h.stop,h.start)/2,new X));let A=e.getValueInReferenceFrame(p,o,s[c]);l(A)&&(s[c]=A,c++)}}return c}function Qft(e,t,n,i,o,r,a,s){let c=e.getValueInReferenceFrame(t,o,s[a]);return l(c)&&(s[a++]=c),a}function kft(e,t,n,i,o,r,a,s){n7.start=t,n7.stop=n;let c=a,u=e.intervals;for(let f=0;f<u.length;f++){let h=u.get(f);if(!vn.intersect(h,n7,GCe).isEmpty){let p=h.start,A=h.stop,m=t;X.greaterThan(p,m)&&(m=p);let _=n;X.lessThan(A,_)&&(_=A),c=VCe(h.data,m,_,i,o,r,c,s)}}return c}function VCe(e,t,n,i,o,r,a,s){for(;e instanceof i_;)e=e.resolvedProperty;if(e instanceof fc){let c=e._property._times;a=Nft(e,t,n,c,i,o,r,a,s)}else e instanceof DM?a=Lft(e,t,n,i,o,r,a,s):e instanceof lc?a=kft(e,t,n,i,o,r,a,s):e instanceof o_?a=Fft(e,t,n,i,o,r,a,s):e instanceof Ml||e instanceof zp&&q.isConstant(e)?a=Qft(e,t,n,i,o,r,a,s):a=Oft(e,t,n,i,o,r,a,s);return a}function HCe(e,t,n,i,o,r,a){l(a)||(a=[]);let s=VCe(e,t,n,i,o,r,0,a);return a.length=s,a}var kCe=new J,UCe=new Qe,zCe=new J;function MQ(e,t){this._unusedIndexes=[],this._polylineCollection=new am,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}MQ.prototype.update=function(e){let t=this._referenceFrame;if(t===Li.INERTIAL){let n=At.computeIcrfToFixedMatrix(e,kCe);l(n)||(n=At.computeTemeToPseudoFixedMatrix(e,kCe)),M.fromRotationTranslation(n,d.ZERO,this._polylineCollection.modelMatrix)}else if(t instanceof Zo){let n=t.position.getValue(e);l(t.orientation)?l(t.orientation.getValue(e,UCe))&&(J.fromQuaternion(UCe,zCe),M.fromRotationTranslation(zCe,n,this._polylineCollection.modelMatrix)):o7(e,t.position,this._polylineCollection.modelMatrix)}};MQ.prototype.updateObject=function(e,t){let n=t.entity,i=n._path,o=n._position,r,a,s=i._show,c=t.polyline,u=n.isShowing&&n.isAvailable(e)&&(!l(s)||s.getValue(e));if(u){let p=q.getValueOrUndefined(i._leadTime,e),A=q.getValueOrUndefined(i._trailTime,e),m=n._availability,_=l(m),y=l(p),C=l(A);if(u=_||y&&C,u){if(C&&(r=X.addSeconds(e,-A,new X)),y&&(a=X.addSeconds(e,p,new X)),_){let E=m.start,b=m.stop;(!C||X.greaterThan(E,r))&&(r=E),(!y||X.lessThan(b,a))&&(a=b)}u=X.lessThan(r,a)}}if(!u){l(c)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,c.show=!1,t.index=void 0);return}if(!l(c)){let p=this._unusedIndexes;if(p.length>0){let m=p.pop();c=this._polylineCollection.get(m),t.index=m}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=n,t.polyline=c}let f=q.getValueOrDefault(i._resolution,e,Rft),h=HCe(o,r,a,e,this._referenceFrame,f,c.positions.slice());if(h.length<2){c.show=!1;return}c.show=!0,c.positions=h,c.material=wr.getValue(e,i._material,c.material),c.width=q.getValueOrDefault(i._width,e,Mft),c.distanceDisplayCondition=q.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};MQ.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)};MQ.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),fe(this)};function Gp(e,t){t.collectionChanged.addEventListener(Gp.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new Ot,this._onCollectionChanged(t,t.values,[],[])}Gp.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,s=a._position,c=a._path,u=r.updater,f=!1,h=Li.FIXED,p=h.toString();if(this._scene.mode===oe.SCENE3D){let m=q.getValueOrUndefined(c.relativeTo,e);l(m)?m==="FIXED"?(h=Li.FIXED,p=h.toString()):m==="INERTIAL"?(h=Li.INERTIAL,p=h.toString()):(f=!0,h=this._entityCollection.getById(m),p=m):(h=s.referenceFrame,p=h.toString())}let A=this._updaters[p];if(u===A&&l(A)){A.updateObject(e,r);continue}l(u)&&u.removeObject(r),!(f&&!l(h))&&(l(A)||(A=new MQ(this._scene,h),A.update(e),this._updaters[p]=A),r.updater=A,l(A)&&A.updateObject(e,r))}return!0};Gp.prototype.isDestroyed=function(){return!1};Gp.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Gp.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return fe(this)};Gp.prototype._onCollectionChanged=function(e,t,n,i){let o,r,a,s=this._items;for(o=t.length-1;o>-1;o--)r=t[o],l(r._path)&&l(r._position)&&s.set(r.id,new QCe(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._path)&&l(r._position)?s.contains(r.id)||s.set(r.id,new QCe(r)):(a=s.get(r.id),l(a)&&(l(a.updater)&&a.updater.removeObject(a),s.remove(r.id)));for(o=n.length-1;o>-1;o--)r=n[o],a=s.get(r.id),l(a)&&(l(a.updater)&&a.updater.removeObject(a),s.remove(r.id))};Gp._subSample=HCe;Gp._computeVvlhTransform=o7;Gp._transformToEntityFrame=RQ;var NQ=Gp;var WCe=z.WHITE,jCe=z.BLACK,YCe=0,qCe=1,KCe=0,XCe=Lr.NONE,JCe=new z,Uft=new d,ZCe=new z,$Ce=new Ht,eEe=new Ht,tEe=new zt;function nEe(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 bC(e,t){t.collectionChanged.addEventListener(bC.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Ot,this._onCollectionChanged(t,t.values,[],[])}bC.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],a=r.entity,s=a._point,c=r.pointPrimitive,u=r.billboard,f=q.getValueOrDefault(s._heightReference,e,it.NONE),h=a.isShowing&&a.isAvailable(e)&&q.getValueOrDefault(s._show,e,!0),p;if(h&&(p=q.getValueOrUndefined(a._position,e,Uft),h=l(p)),!h){LQ(r,a,n);continue}q.isConstant(a._position)||(n._clusterDirty=!0);let A=!1,m=!1;if(f!==it.NONE&&!l(u)?(l(c)&&(LQ(r,a,n),c=void 0),u=n.getBillboard(a),u.id=a,u.image=void 0,r.billboard=u,A=!0,m=d.equals(u.position,p)&&u.heightReference===f):f===it.NONE&&!l(c)&&(l(u)&&(LQ(r,a,n),u=void 0),c=n.getPoint(a),c.id=a,r.pointPrimitive=c),l(c))c.show=!0,c.position=p,c.scaleByDistance=q.getValueOrUndefined(s._scaleByDistance,e,$Ce),c.translucencyByDistance=q.getValueOrUndefined(s._translucencyByDistance,e,eEe),c.color=q.getValueOrDefault(s._color,e,WCe,JCe),c.outlineColor=q.getValueOrDefault(s._outlineColor,e,jCe,ZCe),c.outlineWidth=q.getValueOrDefault(s._outlineWidth,e,YCe),c.pixelSize=q.getValueOrDefault(s._pixelSize,e,qCe),c.distanceDisplayCondition=q.getValueOrUndefined(s._distanceDisplayCondition,e,tEe),c.disableDepthTestDistance=q.getValueOrDefault(s._disableDepthTestDistance,e,KCe),c.splitDirection=q.getValueOrDefault(s._splitDirection,e,XCe);else if(l(u)){u.show=!0,u.position=p,u.scaleByDistance=q.getValueOrUndefined(s._scaleByDistance,e,$Ce),u.translucencyByDistance=q.getValueOrUndefined(s._translucencyByDistance,e,eEe),u.distanceDisplayCondition=q.getValueOrUndefined(s._distanceDisplayCondition,e,tEe),u.disableDepthTestDistance=q.getValueOrDefault(s._disableDepthTestDistance,e,KCe),u.splitDirection=q.getValueOrDefault(s._splitDirection,e,XCe),u.heightReference=f;let _=q.getValueOrDefault(s._color,e,WCe,JCe),y=q.getValueOrDefault(s._outlineColor,e,jCe,ZCe),C=Math.round(q.getValueOrDefault(s._outlineWidth,e,YCe)),E=Math.max(1,Math.round(q.getValueOrDefault(s._pixelSize,e,qCe)));if(C>0?(u.scale=1,A=A||C!==r.outlineWidth||E!==r.pixelSize||!z.equals(_,r.color)||!z.equals(y,r.outlineColor)):(u.scale=E/50,E=50,A=A||C!==r.outlineWidth||!z.equals(_,r.color)||!z.equals(y,r.outlineColor)),A){r.color=z.clone(_,r.color),r.outlineColor=z.clone(y,r.outlineColor),r.pixelSize=E,r.outlineWidth=C;let b=_.alpha,x=_.toCssColorString(),S=y.toCssColorString(),B=JSON.stringify([x,E,S,C]);u.setImage(B,V0(b,x,S,C,E))}m&&u._updateClamping()}}return!0};bC.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!(l(n.pointPrimitive)||l(n.billboard)))return Ct.FAILED;if(l(n.pointPrimitive))t.center=d.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(!l(i._clampedPosition))return Ct.PENDING;t.center=d.clone(i._clampedPosition,t.center)}return t.radius=0,Ct.DONE};bC.prototype.isDestroyed=function(){return!1};bC.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(bC.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return fe(this)};bC.prototype._onCollectionChanged=function(e,t,n,i){let o,r,a=this._items,s=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._point)&&l(r._position)&&a.set(r.id,new nEe(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._point)&&l(r._position)?a.contains(r.id)||a.set(r.id,new nEe(r)):(LQ(a.get(r.id),r,s),a.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],LQ(a.get(r.id),r,s),a.remove(r.id)};function LQ(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 OQ=bC;var sEe=[];function zft(e,t,n,i,o){let r=sEe;r.length=o;let a,s=n.red,c=n.green,u=n.blue,f=n.alpha,h=i.red,p=i.green,A=i.blue,m=i.alpha;if(z.equals(n,i)){for(a=0;a<o;a++)r[a]=z.clone(n);return r}let _=(h-s)/o,y=(p-c)/o,C=(A-u)/o,E=(m-f)/o;for(a=0;a<o;a++)r[a]=new z(s+a*_,c+a*y,u+a*C,f+a*E);return r}function FQ(e){e=e??V.EMPTY_OBJECT;let t=e.positions,n=e.colors,i=e.width??1,o=e.colorsPerVertex??!1;this._positions=t,this._colors=n,this._width=i,this._colorsPerVertex=o,this._vertexFormat=ke.clone(e.vertexFormat??ke.DEFAULT),this._arcType=e.arcType??ln.GEODESIC,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._workerName="createPolylineGeometry";let r=1+t.length*d.packedLength;r+=l(n)?1+n.length*z.packedLength:1,this.packedLength=r+te.packedLength+ke.packedLength+4}FQ.pack=function(e,t,n){n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let a=e._colors;for(r=l(a)?a.length:0,t[n++]=r,i=0;i<r;++i,n+=z.packedLength)z.pack(a[i],t,n);return te.pack(e._ellipsoid,t,n),n+=te.packedLength,ke.pack(e._vertexFormat,t,n),n+=ke.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};var cEe=te.clone(te.UNIT_SPHERE),lEe=new ke,Ub={positions:void 0,colors:void 0,ellipsoid:cEe,vertexFormat:lEe,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};FQ.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let a=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=z.packedLength)a[i]=z.unpack(e,t);let s=te.unpack(e,t,cEe);t+=te.packedLength;let c=ke.unpack(e,t,lEe);t+=ke.packedLength;let u=e[t++],f=e[t++]===1,h=e[t++],p=e[t];return l(n)?(n._positions=r,n._colors=a,n._ellipsoid=te.clone(s,n._ellipsoid),n._vertexFormat=ke.clone(c,n._vertexFormat),n._width=u,n._colorsPerVertex=f,n._arcType=h,n._granularity=p,n):(Ub.positions=r,Ub.colors=a,Ub.width=u,Ub.colorsPerVertex=f,Ub.arcType=h,Ub.granularity=p,new FQ(Ub))};var iEe=new d,oEe=new d,rEe=new d,aEe=new d;FQ.createGeometry=function(e){let t=e._width,n=e._vertexFormat,i=e._colors,o=e._colorsPerVertex,r=e._arcType,a=e._granularity,s=e._ellipsoid,c,u,f,h=[],p=Ho(e._positions,d.equalsEpsilon,!1,h);if(l(i)&&h.length>0){let R=0,O=h[0];i=i.filter(function(G,F){let U=!1;return o?U=F===O||F===0&&O===1:U=F+1===O,U?(R++,O=h[R],!1):!0})}let A=p.length;if(A<2||t<=0)return;if(r===ln.GEODESIC||r===ln.RHUMB){let R,O;r===ln.GEODESIC?(R=D.chordLength(a,s.maximumRadius),O=Xi.numberOfPoints):(R=a,O=Xi.numberOfPointsRhumbLine);let G=Xi.extractHeights(p,s);if(l(i)){let F=1;for(c=0;c<A-1;++c)F+=O(p[c],p[c+1],R);let U=new Array(F),Q=0;for(c=0;c<A-1;++c){let H=p[c],Y=p[c+1],$=i[c],W=O(H,Y,R);if(o&&c<F){let K=i[c+1],Z=zft(H,Y,$,K,W),pe=Z.length;for(u=0;u<pe;++u)U[Q++]=Z[u]}else for(u=0;u<W;++u)U[Q++]=z.clone($)}U[Q]=z.clone(i[i.length-1]),i=U,sEe.length=0}r===ln.GEODESIC?p=Xi.generateCartesianArc({positions:p,minDistance:R,ellipsoid:s,height:G}):p=Xi.generateCartesianRhumbArc({positions:p,granularity:R,ellipsoid:s,height:G})}A=p.length;let m=A*4-4,_=new Float64Array(m*3),y=new Float64Array(m*3),C=new Float64Array(m*3),E=new Float32Array(m*2),b=n.st?new Float32Array(m*2):void 0,x=l(i)?new Uint8Array(m*4):void 0,S=0,B=0,v=0,P=0,N;for(u=0;u<A;++u){u===0?(N=iEe,d.subtract(p[0],p[1],N),d.add(p[0],N,N)):N=p[u-1],d.clone(N,rEe),d.clone(p[u],oEe),u===A-1?(N=iEe,d.subtract(p[A-1],p[A-2],N),d.add(p[A-1],N,N)):N=p[u+1],d.clone(N,aEe);let R,O;l(x)&&(u!==0&&!o?R=i[u-1]:R=i[u],u!==A-1&&(O=i[u]));let G=u===0?2:0,F=u===A-1?2:4;for(f=G;f<F;++f){d.pack(oEe,_,S),d.pack(rEe,y,S),d.pack(aEe,C,S),S+=3;let U=f-2<0?-1:1;if(E[B++]=2*(f%2)-1,E[B++]=U*t,n.st&&(b[v++]=u/(A-1),b[v++]=Math.max(E[B-2],0)),l(x)){let Q=f<2?R:O;x[P++]=z.floatToByte(Q.red),x[P++]=z.floatToByte(Q.green),x[P++]=z.floatToByte(Q.blue),x[P++]=z.floatToByte(Q.alpha)}}}let L=new _n;L.position=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:_}),L.prevPosition=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:y}),L.nextPosition=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:C}),L.expandAndWidth=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:E}),n.st&&(L.st=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:b})),l(x)&&(L.color=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:4,values:x,normalize:!0}));let g=Ue.createTypedArray(m,A*6-6),I=0,T=0,w=A-1;for(u=0;u<w;++u)g[T++]=I,g[T++]=I+2,g[T++]=I+1,g[T++]=I+1,g[T++]=I+2,g[T++]=I+3,I+=4;return new yt({attributes:L,indices:g,primitiveType:ve.TRIANGLES,boundingSphere:le.fromPoints(p),geometryType:ud.POLYLINES})};var d_=FQ;var Gft=new hi(0),OH={},uEe=new z,Vft=new qt(z.WHITE),Hft=new hi(!0),Wft=new hi(wn.DISABLED),jft=new hi(new zt),Yft=new hi(ei.BOTH);function qft(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function Kft(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function Sm(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(Sm.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new _e,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 qft,this._groundGeometryOptions=new Kft,this._id=`polyline-${e.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=Zo.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(Sm.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)&&q.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}}});Sm.prototype.isOutlineVisible=function(e){return!1};Sm.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e))??!1};Sm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Sn(n&&t.isShowing&&this._showProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=$n.fromDistanceDisplayCondition(o),a={show:i,distanceDisplayCondition:r},s;return this._materialProperty instanceof qt&&(l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,uEe)),l(s)||(s=z.WHITE),a.color=Jt.fromColor(s)),this.clampToGround?new Mt({id:t,geometry:new HE(this._groundGeometryOptions),attributes:a}):(l(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof qt&&(l(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||n)&&(s=this._depthFailMaterialProperty.color.getValue(e,uEe)),l(s)||(s=z.WHITE),a.depthFailColor=Jt.fromColor(s)),new Mt({id:t,geometry:new d_(this._geometryOptions),attributes:a}))};Sm.prototype.createOutlineGeometryInstance=function(e){};Sm.prototype.isDestroyed=function(){return!1};Sm.prototype.destroy=function(){this._entitySubscription(),fe(this)};Sm.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,a=o.show;if(l(a)&&a.isConstant&&!a.getValue(Xe.MINIMUM_VALUE)||!l(r)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let s=o.zIndex,c=o.material??Vft,u=c instanceof qt;this._materialProperty=c,this._depthFailMaterialProperty=o.depthFailMaterial,this._showProperty=a??Hft,this._shadowsProperty=o.shadows??Wft,this._distanceDisplayConditionProperty=o.distanceDisplayCondition??jft,this._classificationTypeProperty=o.classificationType??Yft,this._fillEnabled=!0,this._zIndex=s??Gft;let f=o.width,h=o.arcType,p=o.clampToGround,A=o.granularity;if(!r.isConstant||!q.isConstant(f)||!q.isConstant(h)||!q.isConstant(A)||!q.isConstant(p)||!q.isConstant(s))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{let m=this._geometryOptions,_=r.getValue(Xe.MINIMUM_VALUE,m.positions);if(!l(_)||_.length<2){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let y;u&&(!l(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof qt)?y=Ra.VERTEX_FORMAT:y=ic.VERTEX_FORMAT,m.vertexFormat=y,m.positions=_,m.width=l(f)?f.getValue(Xe.MINIMUM_VALUE):void 0,m.arcType=l(h)?h.getValue(Xe.MINIMUM_VALUE):void 0,m.granularity=l(A)?A.getValue(Xe.MINIMUM_VALUE):void 0;let C=this._groundGeometryOptions;C.positions=_,C.width=m.width,C.arcType=m.arcType,C.granularity=m.granularity,this._clampToGround=l(p)?p.getValue(Xe.MINIMUM_VALUE):!1,!this._clampToGround&&l(s)&&It("Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Sm.prototype.createDynamicUpdater=function(e,t){return new QQ(e,t,this)};var mw={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function QQ(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 fEe(e){if(l(e._line))return e._line;let t=e._primitives,n=e._geometryUpdater._scene.id+t._guid,i=OH[n];!l(i)||i.isDestroyed()?(i=new am,OH[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}QQ.prototype.update=function(e){let t=this._geometryUpdater,n=t._entity,i=n.polyline,o=i.positions,r=q.getValueOrUndefined(o,e,this._positions);t._clampToGround=q.getValueOrDefault(i._clampToGround,e,!1),t._groundGeometryOptions.positions=r,t._groundGeometryOptions.width=q.getValueOrDefault(i._width,e,1),t._groundGeometryOptions.arcType=q.getValueOrDefault(i._arcType,e,ln.GEODESIC),t._groundGeometryOptions.granularity=q.getValueOrDefault(i._granularity,e,9999);let a=this._groundPrimitives;if(l(this._groundPolylinePrimitive)&&(a.remove(this._groundPolylinePrimitive),this._groundPolylinePrimitive=void 0),t.clampToGround){if(!n.isShowing||!n.isAvailable(e)||!q.getValueOrDefault(i._show,e,!0)||!l(r)||r.length<2)return;let h=t.fillMaterialProperty,p;if(h instanceof qt)p=new Ra;else{let A=wr.getValue(e,h,this._material);p=new ic({material:A,translucent:A.isTranslucent()}),this._material=A}this._groundPolylinePrimitive=a.add(new Mh({geometryInstances:t.createFillGeometryInstance(e),appearance:p,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),q.getValueOrUndefined(t.zIndex,e)),l(this._line)&&(this._line.show=!1);return}let s=fEe(this);if(!n.isShowing||!n.isAvailable(e)||!q.getValueOrDefault(i._show,e,!0)){s.show=!1;return}if(!l(r)||r.length<2){s.show=!1;return}let c=ln.GEODESIC;c=q.getValueOrDefault(i._arcType,e,c);let u=t._scene.globe,f=t._scene.ellipsoid;c!==ln.NONE&&l(u)&&(mw.ellipsoid=f,mw.positions=r,mw.granularity=q.getValueOrUndefined(i._granularity,e),mw.height=Xi.extractHeights(r,f),c===ln.GEODESIC?r=Xi.generateCartesianArc(mw):r=Xi.generateCartesianRhumbArc(mw)),s.show=!0,s.positions=r.slice(),s.material=wr.getValue(e,t.fillMaterialProperty,s.material),s.width=q.getValueOrDefault(i._width,e,1),s.distanceDisplayCondition=q.getValueOrUndefined(i._distanceDisplayCondition,e,s.distanceDisplayCondition)};QQ.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 le.clone(n.boundingSphere,e),Ct.DONE}return l(t)&&!t.ready?Ct.PENDING:Ct.DONE}else{let t=fEe(this);if(t.show&&t.positions.length>0)return le.fromPoints(t.positions,e),Ct.DONE}return Ct.FAILED};QQ.prototype.isDestroyed=function(){return!1};QQ.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=OH[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete OH[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),fe(this)};var kQ=Sm;var Xft=new z,Jft=new zt,Zft=new zt;function wm(e,t,n,i,o){let r;n instanceof qt?r=Ra:r=ic,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=r,this.materialProperty=n,this.updaters=new Ot,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Ot,this.material=void 0,this.updatersWithAttributes=new Ot,this.attributes=new Ot,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(wm.prototype.onMaterialChanged,this),this.subscriptions=new Ot,this.showsUpdated=new Ot,this.zIndex=i,this._asynchronous=o}wm.prototype.onMaterialChanged=function(){this.invalidated=!0};wm.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof qt&&t instanceof qt?!0:l(t)&&t.equals(n)};wm.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||!q.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,a,s,c){a==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};wm.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};wm.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);let s=this.appearanceType;n=new Mh({show:!1,asynchronous:this._asynchronous,geometryInstances:o.slice(),appearance:new s,classificationType:this.classificationType}),this.appearanceType===ic&&(this.material=wr.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 s=this.oldPrimitive;l(s)&&(i.remove(s),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===ic&&(this.material=wr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);let a=this.updatersWithAttributes.values,s=a.length;for(r=0;r<s;r++){let c=a[r],u=c.entity,f=this.geometry.get(c.id),h=this.attributes.get(f.id.id);if(l(h)||(h=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),!c.fillMaterialProperty.isConstant){let _=c.fillMaterialProperty.color,y=q.getValueOrDefault(_,e,z.WHITE,Xft);z.equals(h._lastColor,y)||(h._lastColor=z.clone(y,h._lastColor),h.color=Jt.toValue(y,h.color))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),A=h.show[0]===1;p!==A&&(h.show=Sn.toValue(p,h.show));let m=c.distanceDisplayConditionProperty;if(!q.isConstant(m)){let _=q.getValueOrDefault(m,e,Zft,Jft);zt.equals(_,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=zt.clone(_,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=$n.toValue(_,h.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};wm.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,a=this.geometry.get(o.id);if(!a)continue;let s=this.attributes.get(a.id.id);l(s)||(s=e.getGeometryInstanceAttributes(a.id),this.attributes.set(a.id.id,s));let c=r.isShowing,u=s.show[0]===1;c!==u&&(s.show=Sn.toValue(c,s.show),a.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};wm.prototype.contains=function(e){return this.updaters.contains(e.id)};wm.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Ct.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Ct.FAILED:(i.boundingSphere.clone(t),Ct.DONE)};wm.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 pw(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=n??!0}pw.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=q.getValueOrDefault(t.zIndex,0);for(let s=0;s<i;++s){let c=n[s];if(c.isMaterial(t)&&c.zIndex===r){c.add(e,t,o);return}}let a=new wm(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,r,this._asynchronous);a.add(e,t,o),n.push(a)};pw.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}}};pw.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 a=r.updaters.values,s=a.length;for(let c=0;c<s;c++)this.add(e,a[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};pw.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 Ct.FAILED};pw.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 UQ=pw;var $ft=[];function dEe(e,t){let n=e._batches,i=n.length;for(let o=0;o<i;o++)n[o].remove(t)}function hEe(e,t,n){if(n.isDynamic){e._dynamicBatch.add(t,n);return}if(n.clampToGround&&n.fillEnabled){let a=n.classificationTypeProperty.getValue(t);e._groundBatches[a].add(t,n);return}let i;n.fillEnabled&&(i=n.shadowsProperty.getValue(t));let o=0;l(n.depthFailMaterialProperty)&&(o=n.depthFailMaterialProperty instanceof qt?1:2);let r;l(i)&&(r=i+o*wn.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof qt?e._colorBatches[r].add(t,n):e._materialBatches[r].add(t,n))}function Vp(e,t,n,i){i=i??e.groundPrimitives,n=n??e.primitives,this._scene=e,this._primitives=n,this._entityCollection=void 0,this._addedObjects=new Ot,this._removedObjects=new Ot,this._changedObjects=new Ot;let o,r=wn.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 $d(n,Ra,void 0,!1,o),this._materialBatches[o]=new eh(n,ic,void 0,!1,o),this._colorBatches[o+r]=new $d(n,Ra,Ra,!1,o),this._materialBatches[o+r]=new eh(n,ic,Ra,!1,o),this._colorBatches[o+r*2]=new $d(n,Ra,ic,!1,o),this._materialBatches[o+r*2]=new eh(n,ic,ic,!1,o);this._dynamicBatch=new Sb(n,i);let a=ei.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(a),o=0;o<a;++o)this._groundBatches[o]=new UQ(i,o);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new Ot,this._updaters=new Ot,this._entityCollection=t,t.collectionChanged.addEventListener(Vp.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,$ft)}Vp.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,a=r.values,s,c,u,f;for(s=a.length-1;s>-1;s--)c=a[s],u=c.id,f=this._updaters.get(u),f.entity===c?(dEe(this,f),hEe(this,e,f)):(o.push(c),n.push(c));for(s=o.length-1;s>-1;s--)c=o[s],u=c.id,f=this._updaters.get(u),dEe(this,f),f.destroy(),this._updaters.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(s=n.length-1;s>-1;s--)c=n[s],u=c.id,f=new kQ(c,this._scene),this._updaters.set(u,f),hEe(this,e,f),this._subscriptions.set(u,f.geometryChanged.addEventListener(Vp._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let h=!0,p=this._batches,A=p.length;for(s=0;s<A;s++)h=p[s].update(e)&&h;return h};var edt=[],tdt=new le;Vp.prototype.getBoundingSphere=function(e,t){let n=edt,i=tdt,o=0,r=Ct.DONE,a=this._batches,s=a.length,c=this._updaters.get(e.id);if(!c)return Ct.FAILED;for(let u=0;u<s;u++){if(r=a[u].getBoundingSphere(c,i),r===Ct.PENDING)return Ct.PENDING;r===Ct.DONE&&(n[o]=le.clone(i,n[o]),o++)}return o===0?Ct.FAILED:(n.length=o,le.fromBoundingSpheres(n,t),Ct.DONE)};Vp.prototype.isDestroyed=function(){return!1};Vp.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Vp.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(),fe(this)};Vp._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)};Vp.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,a,s,c;for(a=n.length-1;a>-1;a--)c=n[a],s=c.id,i.remove(s)||(o.set(s,c),r.remove(s));for(a=t.length-1;a>-1;a--)c=t[a],s=c.id,o.remove(s)?r.set(s,c):i.set(s,c)};var zQ=Vp;function zu(e){vl.initializeTerrainHeights(),Mh.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new kr,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=e.visualizersCallback??zu.defaultVisualizersCallback;let i=!1,o=new ou,r=new ou;n.length>0&&(t.primitives.add(o),t.groundPrimitives.add(r),i=!0),this._primitives=o,this._groundPrimitives=r;for(let u=0,f=n.length;u<f;u++)this._onDataSourceAdded(n,n.get(u));let a=new kF;this._onDataSourceAdded(void 0,a),this._defaultDataSource=a;let s,c;if(!i){let u=this,f=function(){t.primitives.add(o),t.groundPrimitives.add(r),s(),c(),u._removeDefaultDataSourceListener=void 0,u._removeDataSourceCollectionListener=void 0};s=a.entities.collectionChanged.addEventListener(f),c=n.dataSourceAdded.addEventListener(f)}this._removeDefaultDataSourceListener=s,this._removeDataSourceCollectionListener=c,this._ready=!1}var Aw=[];zu.registerVisualizer=function(e){Aw.includes(e)||Aw.push(e)};zu.unregisterVisualizer=function(e){if(Aw.includes(e)){let t=Aw.indexOf(e);Aw.splice(t,1)}};zu.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new AR(t,i),new DQ(e,i,n._primitives,n._groundPrimitives),new vQ(t,i),new PQ(e,i),new BF(e,i),new OQ(t,i),new NQ(e,i),new zQ(e,i,n._primitives,n._groundPrimitives),...Aw.map(o=>new o(e,i))]};Object.defineProperties(zu.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}}});zu.prototype.isDestroyed=function(){return!1};zu.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)),fe(this)};zu.prototype.update=function(e){if(!Di.initialized)return this._ready=!1,!1;let t=!0,n,i,o,r,a=this._dataSourceCollection,s=a.length;for(n=0;n<s;n++){let c=a.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=this._ready||t,t};zu.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 a=o._resourceCredits;if(l(a)){let s=a.length;for(let c=0;c<s;c++)e.creditDisplay.addCreditToNextFrame(a[c])}}};var ndt=[],idt=new le;zu.prototype.getBoundingSphere=function(e,t,n){if(!this._ready)return Ct.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 A=p.get(i);if(A.entities.contains(e)){r=A;break}}}if(!l(r))return Ct.FAILED;let a=ndt,s=idt,c=0,u=Ct.DONE,f=r._visualizers,h=f.length;for(i=0;i<h;i++){let p=f[i];if(l(p.getBoundingSphere)){if(u=f[i].getBoundingSphere(e,s),!t&&u===Ct.PENDING)return Ct.PENDING;u===Ct.DONE&&(a[c]=le.clone(s,a[c]),c++)}}return c===0?Ct.FAILED:(a.length=c,le.fromBoundingSpheres(a,n),Ct.DONE)};zu.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,o=this._groundPrimitives,r=i.add(new ou),a=o.add(new eQ);t._primitives=r,t._groundPrimitives=a;let s=t.clustering;s._initialize(n),r.add(s),t._visualizers=this._visualizersCallback(n,s,t)};zu.prototype._onDataSourceRemoved=function(e,t){let n=this._primitives,i=this._groundPrimitives,o=t._primitives,r=t._groundPrimitives,a=t.clustering;o.remove(a);let s=t._visualizers,c=s.length;for(let u=0;u<c;u++)s[u].destroy();n.remove(o),i.remove(r),t._visualizers=void 0};zu.prototype._onDataSourceMoved=function(e,t,n){let i=this._primitives,o=this._groundPrimitives,r=e._primitives,a=e._groundPrimitives;t===n+1?(i.raise(r),o.raise(a)):t===n-1?(i.lower(r),o.lower(a)):t===0?(i.lowerToBottom(r),o.lowerToBottom(a),i.raise(r),o.raise(a)):(i.raiseToTop(r),o.raiseToTop(a))};var GQ=zu;function r7(e,t,n){this.heading=e??0,this.pitch=t??0,this.range=n??0}r7.clone=function(e,t){if(l(e))return l(t)||(t=new r7),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var th=r7;var mEe=new J,pEe=new J,AEe=new J,odt=new M,FH=new d,gEe=new d,a7=new d,s7=new d,_Ee=new d,yEe=new d,rdt=new Qe,adt=new d,sdt=new J,gw=new X,cdt=1.25;function ldt(e,t,n,i,o,r,a,s,c,u){let f=e.scene.mode,h=o.getValue(c,e._lastCartesian);if(l(h)){let p=!1,A=!1,m,_,y;if(f===oe.SCENE3D){X.addSeconds(c,.001,gw);let v=o.getValue(gw,FH);if(l(v)||(X.addSeconds(c,-.001,gw),v=o.getValue(gw,FH),A=!0),l(v)){let P=At.computeFixedToIcrfMatrix(c,mEe),N=At.computeFixedToIcrfMatrix(gw,pEe),L;!l(P)||!l(N)?(L=At.computeTemeToPseudoFixedMatrix(c,AEe),P=J.transpose(L,mEe),N=At.computeTemeToPseudoFixedMatrix(gw,pEe),J.transpose(N,N)):L=J.transpose(P,AEe);let g=J.multiplyByVector(P,h,_Ee),I=J.multiplyByVector(N,v,yEe);d.subtract(g,I,s7);let T=d.magnitude(s7)*1e3,w=D.GRAVITATIONALPARAMETER,R=-w/(T*T-2*w/d.magnitude(g));R<0||R>cdt*u.maximumRadius?(m=gEe,d.normalize(h,m),d.negate(m,m),y=d.clone(d.UNIT_Z,a7),_=d.cross(y,m,FH),d.magnitude(_)>D.EPSILON7&&(d.normalize(m,m),d.normalize(_,_),y=d.cross(m,_,a7),d.normalize(y,y),p=!0)):d.equalsEpsilon(h,v,D.EPSILON7)||(y=gEe,d.normalize(g,y),d.normalize(I,I),_=d.cross(y,I,a7),A&&(_=d.multiplyByScalar(_,-1,_)),d.equalsEpsilon(_,d.ZERO,D.EPSILON7)||(m=d.cross(_,y,FH),J.multiplyByVector(L,m,m),J.multiplyByVector(L,_,_),J.multiplyByVector(L,y,y),d.normalize(m,m),d.normalize(_,_),d.normalize(y,y),p=!0))}}l(e.boundingSphere)&&(h=e.boundingSphere.center);let C,E,b;i&&(C=d.clone(t.position,s7),E=d.clone(t.direction,_Ee),b=d.clone(t.up,yEe));let x=odt,S;l(a)&&(S=a.getValue(c,rdt));let B=r.getValue(c,adt);if(s===UA.INERTIAL&&l(S))M.fromTranslationQuaternionRotationScale(h,S,d.ONE,x);else if(s===UA.VELOCITY&&l(B)){let v=At.rotationMatrixFromPositionVelocity(h,B,u,sdt);M.fromRotationTranslation(v,h,x)}else s===UA.ENU||!p?At.eastNorthUpToFixedFrame(h,u,x):(x[0]=m.x,x[1]=m.y,x[2]=m.z,x[3]=0,x[4]=_.x,x[5]=_.y,x[6]=_.z,x[7]=0,x[8]=y.x,x[9]=y.y,x[10]=y.z,x[11]=0,x[12]=h.x,x[13]=h.y,x[14]=h.z,x[15]=0);t._setTransform(x),i&&(d.clone(C,t.position),d.clone(E,t.direction),d.clone(b,t.up),d.cross(E,b,t.right))}if(n){let p=f===oe.SCENE2D||d.equals(e._offset3D,d.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,p)}}function VQ(e,t,n){this.entity=e,this.scene=t,this.ellipsoid=n??te.default,this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new d,this._defaultOffset3D=void 0,this._velocityProperty=new a_(e.position,!0),this._offset3D=new d}Object.defineProperties(VQ,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=d.clone(e,new d)}}});VQ.defaultOffset3D=new d(-14e3,3500,3500);var zb=new th,udt=new d;VQ.prototype.update=function(e,t){let n=this.scene,i=this.ellipsoid,o=n.mode;if(o===oe.MORPHING)return;let r=this.entity,a=r.trackingReferenceFrame,s=r.position;if(!l(s))return;let c=this._velocityProperty,u=r.orientation,f=r!==this._lastEntity,h=o!==this._mode,p=n.camera,A=f||h,m=!0;if(f){let _=r.viewFrom,y=l(_);if(!y&&l(t)){zb.pitch=-D.PI_OVER_FOUR,zb.range=0;let C=s.getValue(e,udt);if(l(C))if(p.getCameraDistance)zb.range=p.getCameraDistance(),zb.heading=p.heading,zb.pitch=p.pitch;else{let E=2-1/Math.max(1,d.magnitude(C)/i.maximumRadius);zb.pitch*=E}p.viewBoundingSphere(t,zb),this.boundingSphere=t,A=!1,m=!1}else(!y||!l(_.getValue(e,this._offset3D)))&&d.clone(VQ._defaultOffset3D,this._offset3D)}else!h&&this._mode!==oe.SCENE2D&&d.clone(p.position,this._offset3D);this._lastEntity=r,this._mode=o,ldt(this,p,A,m,s,c,u,a,e,i)};var HQ=VQ;var c7=new Date(2107,11,31),l7=new Date(1980,0,1),ii=void 0,zf="undefined",Bm="function";var fdt=64,CEe=2;try{typeof navigator!=zf&&navigator.hardwareConcurrency&&(CEe=navigator.hardwareConcurrency)}catch{}var ddt={workerURI:"./core/web-worker.js",wasmURI:"./core/streams/zlib/zlib-streams.wasm",chunkSize:64*1024,maxWorkers:CEe,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,CompressionStream:typeof CompressionStream!=zf&&CompressionStream,DecompressionStream:typeof DecompressionStream!=zf&&DecompressionStream},EEe=Object.assign({},ddt);function WQ(){return EEe}function QH(e){return Math.max(e.chunkSize,fdt)}function _w(e){let{baseURI:t,chunkSize:n,maxWorkers:i,terminateWorkerTimeout:o,useCompressionStream:r,useWebWorkers:a,CompressionStream:s,DecompressionStream:c,CompressionStreamZlib:u,DecompressionStreamZlib:f,workerURI:h,wasmURI:p}=e;nh("baseURI",t),nh("wasmURI",p),nh("workerURI",h),nh("chunkSize",n),nh("maxWorkers",i),nh("terminateWorkerTimeout",o),nh("useCompressionStream",r),nh("useWebWorkers",a),nh("CompressionStream",s),nh("DecompressionStream",c),nh("CompressionStreamZlib",u),nh("DecompressionStreamZlib",f)}function nh(e,t){t!==ii&&(EEe[e]=t)}var ns,kH,Dm,u7;function f7(e){ns=e,{malloc:kH,free:Dm,memory:u7}=ns}function bEe(e,t,n={}){let i=typeof n.level=="number"?n.level:-1,o=typeof n.outBuffer=="number"?n.outBuffer:64*1024,r=typeof n.inBufferSize=="number"?n.inBufferSize:64*1024;return new null({start(){let a;if(this.out=kH(o),this.in=kH(r),this.inBufferSize=r,this._scratch=new Uint8Array(o),e?(this._process=ns.deflate_process,this._last_consumed=ns.deflate_last_consumed,this._end=ns.deflate_end,this.streamHandle=ns.deflate_new(),t==="gzip"?a=ns.deflate_init_gzip(this.streamHandle,i):t==="deflate-raw"?a=ns.deflate_init_raw(this.streamHandle,i):a=ns.deflate_init(this.streamHandle,i)):t==="deflate64-raw"?(this._process=ns.inflate9_process,this._last_consumed=ns.inflate9_last_consumed,this._end=ns.inflate9_end,this.streamHandle=ns.inflate9_new(),a=ns.inflate9_init_raw(this.streamHandle)):(this._process=ns.inflate_process,this._last_consumed=ns.inflate_last_consumed,this._end=ns.inflate_end,this.streamHandle=ns.inflate_new(),t==="deflate-raw"?a=ns.inflate_init_raw(this.streamHandle):t==="gzip"?a=ns.inflate_init_gzip(this.streamHandle):a=ns.inflate_init(this.streamHandle)),a!==0)throw new Error("init failed:"+a)},transform(a,s){try{let c=a,u=new Uint8Array(u7.buffer),f=this._process,h=this._last_consumed,p=this.out,A=this._scratch,m=0;for(;m<c.length;){let _=Math.min(c.length-m,32768);(!this.in||this.inBufferSize<_)&&(this.in&&Dm&&Dm(this.in),this.in=kH(_),this.inBufferSize=_),u.set(c.subarray(m,m+_),this.in);let y=f(this.streamHandle,this.in,_,p,o,0);if(!e&&y<0)throw new Error("process error:"+y);let C=y&16777215;C&&(A.set(u.subarray(p,p+C),0),s.enqueue(A.slice(0,C)));let E=h(this.streamHandle);if(E===0)break;m+=E}}catch(c){this._end&&this.streamHandle&&this._end(this.streamHandle),this.in&&Dm&&Dm(this.in),this.out&&Dm&&Dm(this.out),s.error(c)}},flush(a){try{let s=new Uint8Array(u7.buffer),c=this._process,u=this.out,f=this._scratch;for(;;){let h=c(this.streamHandle,0,0,u,o,4);if(!e&&h<0)throw new Error("process error:"+h);let p=h&16777215,A=h>>24&255;if(p&&(f.set(s.subarray(u,u+p),0),a.enqueue(f.slice(0,p))),A===1||p===0)break}}catch(s){a.error(s)}finally{if(this._end&&this.streamHandle){let s=this._end(this.streamHandle);s!==0&&a.error(new Error("end error:"+s))}this.in&&Dm&&Dm(this.in),this.out&&Dm&&Dm(this.out)}}})}var jQ=class{constructor(t="deflate",n){return bEe(!0,t,n)}},YQ=class{constructor(t="deflate",n){return bEe(!1,t,n)}};var UH=!1;async function IEe(e,{baseURI:t}){if(!UH){let n,i;try{try{i=new URL(e,t)}catch{}n=await(await fetch(i)).arrayBuffer()}catch(r){if(e.startsWith("data:application/wasm;base64,"))n=hdt(e);else throw r}let o=await WebAssembly.instantiate(n);f7(o.instance.exports),UH=!0}}function hdt(e){let t=e.split(",")[1],n=atob(t),i=n.length,o=new Uint8Array(i);for(let r=0;r<i;++r)o[r]=n.charCodeAt(r);return o.buffer}var mdt="Writer iterator completed too soon",pdt="Writer not initialized",Adt="text/plain";var gdt="Content-Type";var _dt=64*1024,d7="writable",yw=class{constructor(){this.size=0}init(){this.initialized=!0}},qQ=class extends yw{get readable(){let t=this,{chunkSize:n=_dt}=t,i=new ReadableStream({start(){this.chunkOffset=0},async pull(o){let{offset:r=0,size:a,diskNumberStart:s}=i,{chunkOffset:c}=this,u=a===ii?n:Math.min(n,a-c),f=await hc(t,r+c,u,s);o.enqueue(f),c+n>a||a===ii&&!f.length&&u?o.close():this.chunkOffset+=n}});return i}},zH=class extends yw{constructor(){super();let t=this,n=new WritableStream({write(i){if(!t.initialized)throw new Error(pdt);return t.writeUint8Array(i)}});Object.defineProperty(t,d7,{get(){return n}})}writeUint8Array(){}};var KQ=class extends zH{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&&(o.length>2?n.data+=btoa(o):n.pending+=o)}getData(){return this.data+btoa(this.pending)}},Hp=class extends qQ{constructor(t){super(),Object.assign(this,{blob:t,size:t.size})}async readUint8Array(t,n){let i=this,o=t+n,a=await(t||o<i.size?i.blob.slice(t,o):i.blob).arrayBuffer();return a.byteLength>n&&(a=a.slice(t,o)),new Uint8Array(a)}},Cw=class extends yw{constructor(t){super();let n=this,i=new null,o=[];t&&o.push([gdt,t]),Object.defineProperty(n,d7,{get(){return i.writable}}),n.blob=new Response(i.readable,{headers:o}).blob()}getData(){return this.blob}},XQ=class extends Hp{constructor(t){super(new Blob([t],{type:Adt}))}},JQ=class extends Cw{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,a)=>{Object.assign(o,{onload:({target:s})=>r(s.result),onerror:()=>a(o.error)}),o.readAsText(i,t)})}}};var GH=class extends qQ{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,a,s=i;s==-1&&(s=r.length-1);let c=t;for(;r[s]&&c>=r[s].size;)c-=r[s].size,s++;let u=r[s];if(u){let f=u.size;if(c+n<=f)a=await hc(u,c,n);else{let h=f-c;a=new Uint8Array(n);let p=await hc(u,c,h);a.set(p,0);let A=await o.readUint8Array(t+h,n-h,i);a.set(A,h),p.length+A.length<n&&(a=a.subarray(0,p.length+A.length))}}else a=new Uint8Array;return o.lastDiskNumber=Math.max(s,o.lastDiskNumber),a}},ZQ=class extends yw{constructor(t,n=4294967295){super();let i=this;Object.assign(i,{diskNumber:0,diskOffset:0,size:0,maxSize:n,availableSize:n});let o,r,a,s=new WritableStream({async write(f){let{availableSize:h}=i;if(a)f.length>=h?(await c(f.subarray(0,h)),await u(),i.diskOffset+=o.size,i.diskNumber++,a=null,await this.write(f.subarray(h))):await c(f);else{let{value:p,done:A}=await t.next();if(A&&!p)throw new Error(mdt);o=p,o.size=0,o.maxSize&&(i.maxSize=o.maxSize),i.availableSize=i.maxSize,await jp(o),r=p.writable,a=r.getWriter(),await this.write(f)}},async close(){await a.ready,await u()}});Object.defineProperty(i,d7,{get(){return s}});async function c(f){let h=f.length;h&&(await a.ready,await a.write(f),o.size+=h,i.size+=h,i.availableSize-=h)}async function u(){await a.close()}}},Gb=class{constructor(t){return Array.isArray(t)&&(t=new GH(t)),t instanceof ReadableStream&&(t={readable:t}),t}},Ew=class{constructor(t){return t.writable===ii&&typeof t.next==Bm&&(t=new ZQ(t)),t instanceof WritableStream&&(t={writable:t}),t.size===ii&&(t.size=0),t instanceof ZQ||Object.assign(t,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),t}};async function jp(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}function hc(e,t,n,i){return e.readUint8Array(t,n,i)}var xEe=[];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;xEe[e]=t}var h_=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^xEe[(n^t[i])&255];this.crc=n}get(){return~this.crc}};var $Q=class extends null{constructor(){let t,n=new h_;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}};function bw(e){if(typeof TextEncoder==zf){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 au={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=au.getPartial(n);return i===32?e.concat(t):au._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+au.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]=au.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 a=0;a<e.length;a++)i.push(n|e[a]>>>t),n=e[a]<<32-t;let o=e.length?e[e.length-1]:0,r=au.getPartial(o);return i.push(au.partial(t+r&31,t+r>32?n:i.pop(),1)),i}},e2={bytes:{fromBits(e){let n=au.bitLength(e)/8,i=new Uint8Array(n),o;for(let r=0;r<n;r++)(r&3)===0&&(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(au.partial(8*(n&3),i)),t}}},TEe={};TEe.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=e2.utf8String.toBits(e));let n=t._buffer=au.concat(t._buffer,e),i=t._length,o=t._length=i+au.bitLength(e);if(o>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");let r=new Uint32Array(n),a=0;for(let s=t.blockSize+i-(t.blockSize+i&t.blockSize-1);s<=o;s+=t.blockSize)t._block(r.subarray(16*a,16*(a+1))),a+=1;return n.splice(0,16*a),t}finalize(){let e=this,t=e._buffer,n=e._h;t=au.concat(t,[au.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 u=0;u<16;u++)i[u]=e[u];let o=n[0],r=n[1],a=n[2],s=n[3],c=n[4];for(let u=0;u<=79;u++){u>=16&&(i[u]=t._S(1,i[u-3]^i[u-8]^i[u-14]^i[u-16]));let f=t._S(5,o)+t._f(u,r,a,s)+c+i[u]+t._key[Math.floor(u/20)]|0;c=s,s=a,a=t._S(30,r),r=o,o=f}n[0]=n[0]+o|0,n[1]=n[1]+r|0,n[2]=n[2]+a|0,n[3]=n[3]+s|0,n[4]=n[4]+c|0}};var h7={};h7.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,a,s,c=1;if(o!==4&&o!==6&&o!==8)throw new Error("invalid aes key size");for(t._key=[a=e.slice(0),s=[]],r=o;r<4*o+28;r++){let u=a[r-1];(r%o===0||o===8&&r%o===4)&&(u=n[u>>>24]<<24^n[u>>16&255]<<16^n[u>>8&255]<<8^n[u&255],r%o===0&&(u=u<<8^u>>>24^c<<24,c=c<<1^(c>>7)*283)),a[r]=a[r-o]^u}for(let u=0;r;u++,r--){let f=a[u&3?r:r-4];r<=4||u<4?s[u]=f:s[u]=i[0][n[f>>>24]]^i[1][n[f>>16&255]]^i[2][n[f>>8&255]]^i[3][n[f&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=[],a,s,c,u;for(let f=0;f<256;f++)r[(o[f]=f<<1^(f>>7)*283)^f]=f;for(let f=a=0;!n[f];f^=s||1,a=r[a]||1){let h=a^a<<1^a<<2^a<<3^a<<4;h=h>>8^h&255^99,n[f]=h,i[h]=f,u=o[c=o[s=o[f]]];let p=u*16843009^c*65537^s*257^f*16843008,A=o[h]*257^h*16843008;for(let m=0;m<4;m++)e[m][f]=A=A<<24^A>>>8,t[m][h]=p=p<<24^p>>>8}for(let f=0;f<5;f++)e[f]=e[f].slice(0),t[f]=t[f].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],a=r[0],s=r[1],c=r[2],u=r[3],f=r[4],h=e[0]^n[0],p=e[t?3:1]^n[1],A=e[2]^n[2],m=e[t?1:3]^n[3],_=4,y,C,E;for(let b=0;b<i;b++)y=a[h>>>24]^s[p>>16&255]^c[A>>8&255]^u[m&255]^n[_],C=a[p>>>24]^s[A>>16&255]^c[m>>8&255]^u[h&255]^n[_+1],E=a[A>>>24]^s[m>>16&255]^c[h>>8&255]^u[p&255]^n[_+2],m=a[m>>>24]^s[h>>16&255]^c[p>>8&255]^u[A&255]^n[_+3],_+=4,h=y,p=C,A=E;for(let b=0;b<4;b++)o[t?3&-b:b]=f[h>>>24]<<24^f[p>>16&255]<<16^f[A>>8&255]<<8^f[m&255]^n[_++],y=h,h=p,p=A,A=m,m=y;return o}};var SEe={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}},m7={};m7.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=au.bitLength(t);for(let r=0;r<i;r+=4){this.incCounter(n);let a=e.encrypt(n);t[r]^=a[0],t[r+1]^=a[1],t[r+2]^=a[2],t[r+3]^=a[3]}return au.clamp(t,o)}};var IC={importKey(e){return new IC.hmacSha1(e2.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,a,s,c,u,f=new ArrayBuffer(o),h=new DataView(f),p=0,A=au;for(t=e2.bytes.toBits(t),u=1;p<(o||1);u++){for(r=a=e.encrypt(A.concat(t,[u])),s=1;s<n;s++)for(a=e.encrypt(a),c=0;c<a.length;c++)r[c]^=a[c];for(s=0;p<(o||1)&&s<r.length;s++)h.setInt32(p,r[s]),p+=4}return f.slice(0,i/8)}};IC.hmacSha1=class{constructor(e){let t=this,n=t._hash=TEe.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 ydt=typeof crypto!=zf&&typeof crypto.getRandomValues==Bm,m_="Invalid password",xC="Invalid signature",p_="zipjs-abort-check-password";function VH(e){return ydt?crypto.getRandomValues(e):SEe.getRandomValues(e)}var Iw=16,Cdt="raw",DEe={name:"PBKDF2"},Edt={name:"HMAC"},bdt="SHA-1",Idt=Object.assign({hash:Edt},DEe),p7=Object.assign({iterations:1e3,hash:{name:bdt}},DEe),xdt=["deriveBits"],n2=[8,12,16],t2=[16,24,32],TC=10,Tdt=[0,0,0,0],jH=typeof crypto!=zf,r2=jH&&crypto.subtle,vEe=jH&&typeof r2!=zf,Yp=e2.bytes,Sdt=h7.aes,wdt=m7.ctrGladman,Bdt=IC.hmacSha1,wEe=jH&&vEe&&typeof r2.importKey==Bm,BEe=jH&&vEe&&typeof r2.deriveBits==Bm,HH=class extends null{constructor({password:t,rawPassword:n,signed:i,encryptionStrength:o,checkPasswordOnly:r}){super({start(){Object.assign(this,{ready:new Promise(a=>this.resolveReady=a),password:MEe(t,n),signed:i,strength:o-1,pending:new Uint8Array})},async transform(a,s){let c=this,{password:u,strength:f,resolveReady:h,ready:p}=c;u?(await Ddt(c,f,u,ih(a,0,n2[f]+2)),a=ih(a,n2[f]+2),r?s.error(new Error(p_)):h()):await p;let A=new Uint8Array(a.length-TC-(a.length-TC)%Iw);s.enqueue(PEe(c,a,A,0,TC,!0))},async flush(a){let{signed:s,ctr:c,hmac:u,pending:f,ready:h}=this;if(u&&c){await h;let p=ih(f,0,f.length-TC),A=ih(f,f.length-TC),m=new Uint8Array;if(p.length){let _=o2(Yp,p);u.update(_);let y=c.update(_);m=i2(Yp,y)}if(s){let _=ih(i2(Yp,u.digest()),0,TC);for(let y=0;y<TC;y++)if(_[y]!=A[y])throw new Error(xC)}a.enqueue(m)}}})}},WH=class extends null{constructor({password:t,rawPassword:n,encryptionStrength:i}){let o;super({start(){Object.assign(this,{ready:new Promise(r=>this.resolveReady=r),password:MEe(t,n),strength:i-1,pending:new Uint8Array})},async transform(r,a){let s=this,{password:c,strength:u,resolveReady:f,ready:h}=s,p=new Uint8Array;c?(p=await vdt(s,u,c),f()):await h;let A=new Uint8Array(p.length+r.length-r.length%Iw);A.set(p,0),a.enqueue(PEe(s,r,A,p.length,0))},async flush(r){let{ctr:a,hmac:s,pending:c,ready:u}=this;if(s&&a){await u;let f=new Uint8Array;if(c.length){let h=a.update(o2(Yp,c));s.update(h),f=i2(Yp,h)}o.signature=i2(Yp,s.digest()).slice(0,TC),r.enqueue(A7(f,o.signature))}}}),o=this}};function PEe(e,t,n,i,o,r){let{ctr:a,hmac:s,pending:c}=e,u=t.length-o;c.length&&(t=A7(c,t),n=Mdt(n,u-u%Iw));let f;for(f=0;f<=u-Iw;f+=Iw){let h=o2(Yp,ih(t,f,f+Iw));r&&s.update(h);let p=a.update(h);r||s.update(p),n.set(i2(Yp,p),f+i)}return e.pending=ih(t,f),n}async function Ddt(e,t,n,i){let o=await REe(e,t,n,ih(i,0,n2[t])),r=ih(i,n2[t]);if(o[0]!=r[0]||o[1]!=r[1])throw new Error(m_)}async function vdt(e,t,n){let i=VH(new Uint8Array(n2[t])),o=await REe(e,t,n,i);return A7(i,o)}async function REe(e,t,n,i){e.password=null;let o=await Pdt(Cdt,n,Idt,!1,xdt),r=await Rdt(Object.assign({salt:i},p7),o,8*(t2[t]*2+2)),a=new Uint8Array(r),s=o2(Yp,ih(a,0,t2[t])),c=o2(Yp,ih(a,t2[t],t2[t]*2)),u=ih(a,t2[t]*2);return Object.assign(e,{keys:{key:s,authentication:c,passwordVerification:u},ctr:new wdt(new Sdt(s),Array.from(Tdt)),hmac:new Bdt(c)}),u}async function Pdt(e,t,n,i,o){if(wEe)try{return await r2.importKey(e,t,n,i,o)}catch{return wEe=!1,IC.importKey(t)}else return IC.importKey(t)}async function Rdt(e,t,n){if(BEe)try{return await r2.deriveBits(e,t,n)}catch{return BEe=!1,IC.pbkdf2(t,e.salt,p7.iterations,n)}else return IC.pbkdf2(t,e.salt,p7.iterations,n)}function MEe(e,t){return t===ii?bw(e):t}function A7(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 Mdt(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function ih(e,t,n){return e.subarray(t,n)}function i2(e,t){return e.fromBits(t)}function o2(e,t){return e.toBits(t)}var a2=12,YH=class extends null{constructor({password:t,passwordVerification:n,checkPasswordOnly:i}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),FEe(this,t)},transform(o,r){let a=this;if(a.password){let s=NEe(a,o.subarray(0,a2));if(a.password=null,s.at(-1)!=a.passwordVerification)throw new Error(m_);o=o.subarray(a2)}i?r.error(new Error(p_)):r.enqueue(NEe(a,o))}})}},qH=class extends null{constructor({password:t,passwordVerification:n}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),FEe(this,t)},transform(i,o){let r=this,a,s;if(r.password){r.password=null;let c=VH(new Uint8Array(a2));c[a2-1]=r.passwordVerification,a=new Uint8Array(i.length+c.length),a.set(LEe(r,c),0),s=a2}else a=new Uint8Array(i.length),s=0;a.set(LEe(r,i),s),o.enqueue(a)}})}};function NEe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=QEe(e)^t[i],g7(e,n[i]);return n}function LEe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=QEe(e)^t[i],g7(e,t[i]);return n}function FEe(e,t){let n=[305419896,591751049,878082192];Object.assign(e,{keys:n,crcKey0:new h_(n[0]),crcKey2:new h_(n[2])});for(let i=0;i<t.length;i++)g7(e,t.charCodeAt(i))}function g7(e,t){let[n,i,o]=e.keys;e.crcKey0.append([t]),n=~e.crcKey0.get(),i=OEe(Math.imul(OEe(i+kEe(n)),134775813)+1),e.crcKey2.append([i>>>24]),o=~e.crcKey2.get(),e.keys=[n,i,o]}function QEe(e){let t=e.keys[2]|2;return kEe(Math.imul(t,t^1)>>>8)}function kEe(e){return e&255}function OEe(e){return e&4294967295}var xw="Invalid uncompressed size",Ndt="deflate-raw",Ldt="deflate64-raw",KH=class extends null{constructor(t,{chunkSize:n,CompressionStreamZlib:i,CompressionStream:o}){super({});let{compressed:r,encrypted:a,useCompressionStream:s,zipCrypto:c,signed:u,level:f}=t,h=this,p,A,m=super.readable;(!a||c)&&u&&(p=new $Q,m=qp(m,p)),r&&(m=zEe(m,s,{level:f,chunkSize:n},o,i,o)),a&&(c?m=qp(m,new qH(t)):(A=new WH(t),m=qp(m,A))),UEe(h,m,()=>{let _;a&&!c&&(_=A.signature),(!a||c)&&u&&(_=new DataView(p.value.buffer).getUint32(0)),h.signature=_})}},XH=class extends null{constructor(t,{chunkSize:n,DecompressionStreamZlib:i,DecompressionStream:o}){super({});let{zipCrypto:r,encrypted:a,signed:s,signature:c,compressed:u,useCompressionStream:f,deflate64:h}=t,p,A,m=super.readable;a&&(r?m=qp(m,new YH(t)):(A=new HH(t),m=qp(m,A))),u&&(m=zEe(m,f,{chunkSize:n,deflate64:h},o,i,o)),(!a||r)&&s&&(p=new $Q,m=qp(m,p)),UEe(this,m,()=>{if((!a||r)&&s){let _=new DataView(p.value.buffer);if(c!=_.getUint32(0,!1))throw new Error(xC)}})}};function UEe(e,t,n){t=qp(t,new null({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function zEe(e,t,n,i,o,r){let a=t&&i?i:o||r,s=n.deflate64?Ldt:Ndt;try{e=qp(e,new a(s,n))}catch(c){if(t)if(o)e=qp(e,new o(s,n));else if(r)e=qp(e,new r(s,n));else throw c;else throw c}return e}function qp(e,t){return e.pipeThrough(t)}var GEe="message",VEe="start",HEe="pull",_7="data",WEe="ack",y7="close",$H="deflate",e4="inflate";var JH=class extends null{constructor(t,n){super({});let i=this,{codecType:o}=t,r;o.startsWith($H)?r=KH:o.startsWith(e4)&&(r=XH),i.outputSize=0;let a=0,s=new r(t,n),c=super.readable,u=new null({transform(h,p){h&&h.length&&(a+=h.length,p.enqueue(h))},flush(){Object.assign(i,{inputSize:a})}}),f=new null({transform(h,p){if(h&&h.length&&(p.enqueue(h),i.outputSize+=h.length,t.outputSize!==ii&&i.outputSize>t.outputSize))throw new Error(xw)},flush(){let{signature:h}=s;Object.assign(i,{signature:h,inputSize:a})}});Object.defineProperty(i,"readable",{get(){return c.pipeThrough(u).pipeThrough(s).pipeThrough(f)}})}},ZH=class extends null{constructor(t){let n;super({transform:i,flush(o){n&&n.length&&o.enqueue(n)}});function i(o,r){if(n){let a=new Uint8Array(n.length+o.length);a.set(n),a.set(o,n.length),o=a,n=null}o.length>t?(r.enqueue(o.slice(0,t)),i(o.slice(t),r)):n=o}}};var YEe=typeof Worker!=zf;var Tw=class{constructor(t,{readable:n,writable:i},{options:o,config:r,streamOptions:a,useWebWorkers:s,transferStreams:c,workerURI:u},f){let{signal:h}=a;return Object.assign(t,{busy:!0,readable:n.pipeThrough(new ZH(r.chunkSize)).pipeThrough(new E7(a),{signal:h}),writable:i,options:Object.assign({},o),workerURI:u,transferStreams:c,terminate(){return new Promise(p=>{let{worker:A,busy:m}=t;A?(m?t.resolveTerminated=p:(A.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,f(t)}}),(s&&YEe?Odt:qEe)(t,r)}},E7=class extends null{constructor({onstart:t,onprogress:n,size:i,onend:o}){let r=0;super({async start(){t&&await C7(t,i)},async transform(a,s){r+=a.length,n&&await C7(n,r,i),s.enqueue(a)},async flush(){o&&await C7(o,r)}})}};async function C7(e,...t){try{await e(...t)}catch{}}function qEe(e,t){return{run:()=>Fdt(e,t)}}function Odt(e,t){let{baseURI:n,chunkSize:i}=t,{wasmURI:o}=t;if(!e.interface){typeof o==Bm&&(o=o());let r;try{r=Udt(e.workerURI,n,e)}catch{return YEe=!1,qEe(e,t)}Object.assign(e,{worker:r,interface:{run:()=>Qdt(e,{chunkSize:i,wasmURI:o,baseURI:n})}})}return e.interface}async function Fdt({options:e,readable:t,writable:n,onTaskFinished:i},o){let r;try{if(!e.useCompressionStream&&!UH){let{wasmURI:u}=o;typeof u==Bm&&(u=u()),await IEe(u,o)}r=new JH(e,o),await t.pipeThrough(r).pipeTo(n,{preventClose:!0,preventAbort:!0});let{signature:a,inputSize:s,outputSize:c}=r;return{signature:a,inputSize:s,outputSize:c}}catch(a){throw r&&(a.outputSize=r.outputSize),a}finally{i()}}async function Qdt(e,t){let n,i,o=new Promise((h,p)=>{n=h,i=p});Object.assign(e,{reader:null,writer:null,resolveResult:n,rejectResult:i,result:o});let{readable:r,options:a}=e,{writable:s,closed:c}=kdt(e.writable),u=t4({type:VEe,options:a,config:t,readable:r,writable:s},e);u||Object.assign(e,{reader:r.getReader(),writer:s.getWriter()});let f=await o;return u||await s.getWriter().close(),await c,f}function kdt(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 jEe=!0;function Udt(e,t,n){let i={type:"module"},o,r;if(typeof e==Bm&&(e=e()),e.startsWith("data:")||e.startsWith("blob:"))try{r=new Worker(e)}catch{r=new Worker(e,i)}else{try{o=new URL(e,t)}catch{o=e}r=new Worker(o,i)}return r.addEventListener(GEe,a=>zdt(a,n)),r}function t4(e,{worker:t,writer:n,onTaskFinished:i,transferStreams:o}){try{let{value:r,readable:a,writable:s}=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&&jEe?(a&&c.push(a),s&&c.push(s)):e.readable=e.writable=null,c.length)try{return t.postMessage(e,c),!0}catch{jEe=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(r){throw n&&n.releaseLock(),i(),r}}async function zdt({data:e},t){let{type:n,value:i,messageId:o,result:r,error:a}=e,{reader:s,writer:c,resolveResult:u,rejectResult:f,onTaskFinished:h}=t;try{if(a){let{message:A,stack:m,code:_,name:y,outputSize:C}=a,E=new Error(A);Object.assign(E,{stack:m,code:_,name:y,outputSize:C}),p(E)}else{if(n==HEe){let{value:A,done:m}=await s.read();t4({type:_7,value:A,done:m,messageId:o},t)}n==_7&&(await c.ready,await c.write(new Uint8Array(i)),t4({type:WEe,messageId:o},t)),n==y7&&p(null,r)}}catch(A){t4({type:y7,messageId:o},t),p(A)}function p(A,m){A?f(A):u(m),c&&c.releaseLock(),h()}}var Vb=[],b7=[];var KEe=0;async function n4(e,t){let{options:n,config:i}=t,{transferStreams:o,useWebWorkers:r,useCompressionStream:a,compressed:s,signed:c,encrypted:u}=n,{workerURI:f,maxWorkers:h}=i;t.transferStreams=o||o===ii;let p=!s&&!c&&!u&&!t.transferStreams;return t.useWebWorkers=!p&&(r||r===ii&&i.useWebWorkers),t.workerURI=t.useWebWorkers&&f?f:ii,n.useCompressionStream=a||a===ii&&i.useCompressionStream,(await A()).run();async function A(){let _=Vb.find(y=>!y.busy);if(_)return XEe(_),new Tw(_,e,t,m);if(Vb.length<h){let y={indexWorker:KEe};return KEe++,Vb.push(y),new Tw(y,e,t,m)}else return new Promise(y=>b7.push({resolve:y,stream:e,workerOptions:t}))}function m(_){if(b7.length){let[{resolve:y,stream:C,workerOptions:E}]=b7.splice(0,1);y(new Tw(_,C,E,m))}else _.worker?(XEe(_),Vdt(_,t)):Vb=Vb.filter(y=>y!=_)}}function Vdt(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{Vb=Vb.filter(o=>o!=e);try{await e.terminate()}catch{}},i))}function XEe(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var JEe="\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(""),Hdt=JEe.length==256;function ZEe(e){if(Hdt){let t="";for(let n=0;n<e.length;n++)t+=JEe[e[n]];return t}else return new TextDecoder().decode(e)}function s2(e,t){return t&&t.trim().toLowerCase()=="cp437"?ZEe(e):new TextDecoder(t).decode(e)}var I7="filename",x7="rawFilename",c2="comment",T7="rawComment",l2="uncompressedSize",S7="compressedSize",w7="offset",i4="diskNumberStart",Sw="lastModDate",o4="rawLastModDate",u2="lastAccessDate",$Ee="rawLastAccessDate",f2="creationDate",e0e="rawCreationDate",B7="internalFileAttributes",D7="externalFileAttributes",v7="msDosCompatible",r4="zip64",P7="encrypted",R7="version",M7="versionMadeBy",N7="zipCrypto",d2="directory",L7="executable",O7="compressionMethod",F7="signature",Q7="extraField",Wdt=[I7,x7,S7,l2,Sw,o4,c2,T7,u2,f2,w7,i4,i4,B7,D7,v7,r4,P7,R7,M7,N7,d2,L7,O7,F7,Q7,"bitFlag","filenameUTF8","commentUTF8","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"],SC=class{constructor(t){Wdt.forEach(n=>this[n]=t[n])}};var t0e="filenameEncoding",n0e="commentEncoding",i0e="decodeText",o0e="extractPrependedData",r0e="extractAppendedData",a4="password",s4="rawPassword",c4="passThrough",l4="signal",a0e="checkPasswordOnly",s0e="checkOverlappingEntryOnly",c0e="checkOverlappingEntry",l0e="checkSignature",u4="useWebWorkers",f4="useCompressionStream",u0e="transferStreams",d4="preventClose",f0e="encryptionStrength",d0e="extendedTimestamp",h0e="keepOrder",m0e="level",p0e="bufferedWrite",A0e="dataDescriptorSignature",g0e="useUnicodeFileNames",_0e="dataDescriptor",k7="supportZip64SplitFile",y0e="encodeText",U7="offset",z7="usdz";var h4="File format is not recognized",I0e="End of central directory not found",x0e="End of Zip64 central directory locator not found",T0e="Central directory header not found",S0e="Local file header not found",w0e="Zip64 extra field not found",B0e="File contains encrypted entry",D0e="Encryption method not supported",V7="Compression method not supported",H7="Split zip file",v0e="Overlapping entry found",C0e="utf-8",E0e="cp437",Xdt=[[l2,4294967295],[S7,4294967295],[w7,4294967295],[i4,65535]],Jdt={65535:{getValue:zr,bytes:4},4294967295:{getValue:Bw,bytes:8}},Hb=class{constructor(t,n={}){Object.assign(this,{reader:new Gb(t),options:n,config:WQ(),readRanges:[]})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n,{config:o}=n;if(await jp(i),(i.size===ii||!i.readUint8Array)&&(i=new Hp(await new Response(i.readable).blob()),await jp(i)),i.size<22)throw new Error(h4);i.chunkSize=QH(o);let r=await iht(i,101010256,i.size,22,65535*16);if(!r){let L=await hc(i,0,4),g=ia(L);throw zr(g)==134695760?new Error(H7):new Error(I0e)}let a=ia(r),s=zr(a,12),c=zr(a,16),u=r.offset,f=mc(a,20),h=u+22+f,p=mc(a,4),A=i.lastDiskNumber||0,m=mc(a,6),_=mc(a,8),y=0,C=0;if(c==4294967295||s==4294967295||_==65535||m==65535){let L=await hc(i,r.offset-20,20),g=ia(L);if(zr(g,0)==117853008){c=Bw(g,8);let I=await hc(i,c,56,-1),T=ia(I),w=r.offset-20-56;if(zr(T,0)!=101075792&&c!=w){let R=c;c=w,c>R&&(y=c-R),I=await hc(i,c,56,-1),T=ia(I)}if(zr(T,0)!=101075792)throw new Error(x0e);p==65535&&(p=zr(T,16)),m==65535&&(m=zr(T,20)),_==65535&&(_=Bw(T,32)),s==4294967295&&(s=Bw(T,40)),c-=s}}if(c>=i.size&&(y=i.size-c-s-22,c=i.size-s-22),A!=p)throw new Error(H7);if(c<0)throw new Error(h4);let E=0,b=await hc(i,c,s,m),x=ia(b);if(s){let L=r.offset-s;if(zr(x,E)!=33639248&&c!=L){let g=c;c=L,c>g&&(y+=c-g),b=await hc(i,c,s,m),x=ia(b)}}let S=r.offset-c-(i.lastDiskOffset||0);if(s!=S&&S>=0&&(s=S,b=await hc(i,c,s,m),x=ia(b)),c<0||c>=i.size)throw new Error(h4);let B=Rc(n,t,t0e),v=Rc(n,t,n0e);for(let L=0;L<_;L++){let g=new W7(i,o,n.options);if(zr(x,E)!=33639248)throw new Error(T0e);P0e(g,x,E+6);let I=!!g.bitFlag.languageEncodingFlag,T=E+46,w=T+g.filenameLength,R=w+g.extraFieldLength,O=mc(x,E+4),G=O>>8==0,F=O>>8==3,U=b.subarray(T,w),Q=mc(x,E+32),H=R+Q,Y=b.subarray(R,H),$=I,W=I,K=zr(x,E+38),Z=G&&(ww(x,E+38)&16)==16||F&&(K>>16&61440)==16384||U.length&&U.at(-1)=="/".charCodeAt(0),pe=F&&(K>>16&73)!=0,ge=zr(x,E+42)+y;Object.assign(g,{versionMadeBy:O,msDosCompatible:G,compressedSize:0,uncompressedSize:0,commentLength:Q,directory:Z,offset:ge,diskNumberStart:mc(x,E+34),internalFileAttributes:mc(x,E+36),externalFileAttributes:K,rawFilename:U,filenameUTF8:$,commentUTF8:W,rawExtraField:b.subarray(w,R),executable:pe}),g.internalFileAttribute=g.internalFileAttributes,g.externalFileAttribute=g.externalFileAttributes;let re=Rc(n,t,i0e)||s2,ye=$?C0e:B||E0e,Ce=W?C0e:v||E0e,Pe=re(U,ye);Pe===ii&&(Pe=s2(U,ye));let Ne=re(Y,Ce);Ne===ii&&(Ne=s2(Y,Ce)),Object.assign(g,{rawComment:Y,filename:Pe,comment:Ne,directory:Z||Pe.endsWith("/")}),C=Math.max(ge,C),R0e(g,g,x,E+6),g.zipCrypto=g.encrypted&&!g.extraFieldAES;let Le=new SC(g);Le.getData=(ot,Fe)=>g.getData(ot,Le,n.readRanges,Fe),Le.arrayBuffer=async ot=>{let Fe=new null,[_t]=await Promise.all([new Response(Fe.readable).arrayBuffer(),g.getData(Fe,Le,n.readRanges,ot)]);return _t},E=H;let{onprogress:Oe}=t;if(Oe)try{await Oe(L+1,_,new SC(g))}catch{}yield Le}let P=Rc(n,t,o0e),N=Rc(n,t,r0e);return P&&(n.prependedData=C>0?await hc(i,0,C):new Uint8Array),n.comment=f?await hc(i,u+22,f):new Uint8Array,N&&(n.appendedData=h<i.size?await hc(i,h,i.size-h):new Uint8Array),!0}async getEntries(t={}){let n=[];for await(let i of this.getEntriesGenerator(t))n.push(i);return n}async close(){}};var W7=class{constructor(t,n,i){Object.assign(this,{reader:t,config:n,options:i})}async getData(t,n,i,o={}){let r=this,{reader:a,offset:s,diskNumberStart:c,extraFieldAES:u,extraFieldZip64:f,compressionMethod:h,config:p,bitFlag:A,signature:m,rawLastModDate:_,uncompressedSize:y,compressedSize:C}=r,{dataDescriptor:E}=A,b=n.localDirectory={},x=await hc(a,s,30,c),S=ia(x),B=Rc(r,o,a4),v=Rc(r,o,s4),P=Rc(r,o,c4);if(B=B&&B.length&&B,v=v&&v.length&&v,u&&u.originalCompressionMethod!=99)throw new Error(V7);if(h!=0&&h!=8&&h!=9&&!P)throw new Error(V7);if(zr(S,0)!=67324752)throw new Error(S0e);P0e(b,S,4);let{extraFieldLength:N,filenameLength:L,lastAccessDate:g,creationDate:I}=b;b.rawExtraField=N?await hc(a,s+30+L,N,c):new Uint8Array,R0e(r,b,S,4,!0),Object.assign(n,{lastAccessDate:g,creationDate:I});let T=r.encrypted&&b.encrypted&&!P,w=T&&!u;if(P||(n.zipCrypto=w),T){if(!w&&u.strength===ii)throw new Error(D0e);if(!B&&!v)throw new Error(B0e)}let R=s+30+L+N,O=C,G=a.readable;Object.assign(G,{diskNumberStart:c,offset:R,size:O});let F=Rc(r,o,l4),U=Rc(r,o,a0e),Q=Rc(r,o,c0e),H=Rc(r,o,s0e);H&&(Q=!0);let{onstart:Y,onprogress:$,onend:W}=o,K=h==9,Z=Rc(r,o,f4);K&&(Z=!1);let pe={options:{codecType:e4,password:B,rawPassword:v,zipCrypto:w,encryptionStrength:u&&u.strength,signed:Rc(r,o,l0e)&&!P,passwordVerification:w&&(E?_>>>8&255:m>>>24&255),outputSize:P?C:y,signature:m,compressed:h!=0&&!P,encrypted:r.encrypted&&!P,useWebWorkers:Rc(r,o,u4),useCompressionStream:Z,transferStreams:Rc(r,o,u0e),deflate64:K,checkPasswordOnly:U},config:p,streamOptions:{signal:F,size:O,onstart:Y,onprogress:$,onend:W}};Q&&await nht({reader:a,fileEntry:n,offset:s,diskNumberStart:c,signature:m,compressedSize:C,uncompressedSize:y,dataOffset:R,dataDescriptor:E||b.bitFlag.dataDescriptor,extraFieldZip64:f||b.extraFieldZip64,readRanges:i});let ge;try{if(!H){U&&(t=new WritableStream),t=new Ew(t),await jp(t,P?C:y),{writable:ge}=t;let{outputSize:re}=await n4({readable:G,writable:ge},pe);if(t.size+=re,re!=(P?C:y))throw new Error(xw)}}catch(re){if(re.outputSize!==ii&&(t.size+=re.outputSize),!U||re.message!=p_)throw re}finally{!Rc(r,o,d4)&&ge&&!ge.locked&&await ge.getWriter().close()}return U||H?ii:t.getData?t.getData():ge}};function P0e(e,t,n){let i=e.rawBitFlag=mc(t,n+2),o=(i&1)==1,r=zr(t,n+6);Object.assign(e,{encrypted:o,version:mc(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:r,lastModDate:oht(r),filenameLength:mc(t,n+22),extraFieldLength:mc(t,n+24)})}function R0e(e,t,n,i,o){let{rawExtraField:r}=t,a=t.extraField=new Map,s=ia(new Uint8Array(r)),c=0;try{for(;c<r.length;){let C=mc(s,c),E=mc(s,c+2);a.set(C,{type:C,data:r.slice(c+4,c+4+E)}),c+=4+E}}catch{}let u=mc(n,i+4);Object.assign(t,{signature:zr(n,i+10),compressedSize:zr(n,i+14),uncompressedSize:zr(n,i+18)});let f=a.get(1);f&&(Zdt(f,t),t.extraFieldZip64=f);let h=a.get(28789);h&&(b0e(h,I7,x7,t,e),t.extraFieldUnicodePath=h);let p=a.get(25461);p&&(b0e(p,c2,T7,t,e),t.extraFieldUnicodeComment=p);let A=a.get(39169);A?($dt(A,t,u),t.extraFieldAES=A):t.compressionMethod=u;let m=a.get(10);m&&(eht(m,t),t.extraFieldNTFS=m);let _=a.get(21589);_&&(tht(_,t,o),t.extraFieldExtendedTimestamp=_);let y=a.get(6534);y&&(t.extraFieldUSDZ=y)}function Zdt(e,t){t.zip64=!0;let n=ia(e.data),i=Xdt.filter(([o,r])=>t[o]==r);for(let o=0,r=0;o<i.length;o++){let[a,s]=i[o];if(t[a]==s){let c=Jdt[s];t[a]=e[a]=c.getValue(n,r),r+=c.bytes}else if(e[a])throw new Error(w0e)}}function b0e(e,t,n,i,o){let r=ia(e.data),a=new h_;a.append(o[n]);let s=ia(new Uint8Array(4));s.setUint32(0,a.get(),!0);let c=zr(r,1);Object.assign(e,{version:ww(r,0),[t]:s2(e.data.subarray(5)),valid:!o.bitFlag.languageEncodingFlag&&c==zr(s,0)}),e.valid&&(i[t]=e[t],i[t+"UTF8"]=!0)}function $dt(e,t,n){let i=ia(e.data),o=ww(i,4);Object.assign(e,{vendorVersion:ww(i,0),vendorId:ww(i,2),strength:o,originalCompressionMethod:n,compressionMethod:mc(i,5)}),t.compressionMethod=e.compressionMethod}function eht(e,t){let n=ia(e.data),i=4,o;try{for(;i<e.data.length&&!o;){let r=mc(n,i),a=mc(n,i+2);r==1&&(o=e.data.slice(i+4,i+4+a)),i+=4+a}}catch{}try{if(o&&o.length==24){let r=ia(o),a=r.getBigUint64(0,!0),s=r.getBigUint64(8,!0),c=r.getBigUint64(16,!0);Object.assign(e,{rawLastModDate:a,rawLastAccessDate:s,rawCreationDate:c});let u=G7(a),f=G7(s),h=G7(c),p={lastModDate:u,lastAccessDate:f,creationDate:h};Object.assign(e,p),Object.assign(t,p)}}catch{}}function tht(e,t,n){let i=ia(e.data),o=ww(i,0),r=[],a=[];n?((o&1)==1&&(r.push(Sw),a.push(o4)),(o&2)==2&&(r.push(u2),a.push($Ee)),(o&4)==4&&(r.push(f2),a.push(e0e))):e.data.length>=5&&(r.push(Sw),a.push(o4));let s=1;r.forEach((c,u)=>{if(e.data.length>=s+4){let f=zr(i,s);t[c]=e[c]=new Date(f*1e3);let h=a[u];e[h]=f}s+=4})}async function nht({reader:e,fileEntry:t,offset:n,diskNumberStart:i,signature:o,compressedSize:r,uncompressedSize:a,dataOffset:s,dataDescriptor:c,extraFieldZip64:u,readRanges:f}){let h=0;if(i)for(let m=0;m<i;m++){let _=e.readers[m];h+=_.size}let p=0;if(c&&(u?p=20:p=12),p){let m=await hc(e,s+r,p+4,i);if(zr(ia(m),0)==134695760){let y=zr(ia(m),4),C,E;u?(C=Bw(ia(m),8),E=Bw(ia(m),16)):(C=zr(ia(m),8),E=zr(ia(m),12)),(t.encrypted&&!t.zipCrypto||y==o)&&C==r&&E==a&&(p+=4)}}let A={start:h+n,end:h+s+r+p,fileEntry:t};for(let m of f)if(m.fileEntry!=t&&A.start>=m.start&&A.start<m.end){let _=new Error(v0e);throw _.overlappingEntry=m.fileEntry,_}f.push(A)}async function iht(e,t,n,i,o){let r=new Uint8Array(4),a=ia(r);rht(a,0,t);let s=i+o;return await c(i)||await c(Math.min(s,n));async function c(u){let f=n-u,h=await hc(e,f,u);for(let p=h.length-i;p>=0;p--)if(h[p]==r[0]&&h[p+1]==r[1]&&h[p+2]==r[2]&&h[p+3]==r[3])return{offset:f+p,buffer:h.slice(p,p+i).buffer}}}function Rc(e,t,n){return t[n]===ii?e.options[n]:t[n]}function oht(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 G7(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function ww(e,t){return e.getUint8(t)}function mc(e,t){return e.getUint16(t,!0)}function zr(e,t){return e.getUint32(t,!0)}function Bw(e,t){return Number(e.getBigUint64(t,!0))}function rht(e,t,n){e.setUint32(t,n,!0)}function ia(e){return new DataView(e.buffer)}var k0e="File already exists",U0e="Zip file comment exceeds 64KB",z0e="File entry comment exceeds 64KB",G0e="File entry name exceeds 64KB",uZ="Version exceeds 65535",V0e="The strength must equal 1, 2, or 3",H0e="Extra field type exceeds 65535",W0e="Extra field data exceeds 64KB",T4="Zip64 is not supported (make sure 'keepOrder' is set to 'true')",j0e="Undefined uncompressed size",Y0e="Zip file not empty",L0e=new Uint8Array([7,0,2,0,65,69,3,0,0]),cZ=0,O0e=[],A2=class{constructor(t,n={}){t=new Ew(t);let i=t.availableSize!==ii&&t.availableSize>0&&t.availableSize!==1/0&&t.maxSize!==ii&&t.maxSize>0&&t.maxSize!==1/0;Object.assign(this,{writer:t,addSplitZipSignature:i,options:n,config:WQ(),files:new Map,filenames:new Set,offset:n[U7]===ii?t.size||t.writable.size||0:n[U7],pendingEntriesSize:0,pendingAddFileCalls:new Set,bufferedWrites:0})}async prependZip(t){if(this.filenames.size)throw new Error(Y0e);t=new Gb(t);let n=new Hb(t.readable),i=await n.getEntries();await n.close(),await t.readable.pipeTo(this.writer.writable,{preventClose:!0,preventAbort:!0}),this.writer.size=this.offset=t.size,this.filenames=new Set(i.map(o=>o.filename)),this.files=new Map(i.map(o=>{let{version:r,compressionMethod:a,lastModDate:s,lastAccessDate:c,creationDate:u,rawFilename:f,bitFlag:h,encrypted:p,uncompressedSize:A,compressedSize:m,diskOffset:_,diskNumber:y,zip64:C}=o,{rawExtraFieldZip64:E,rawExtraFieldAES:b,rawExtraFieldExtendedTimestamp:x,rawExtraFieldNTFS:S,rawExtraField:B}=o,{level:v,languageEncodingFlag:P,dataDescriptor:N}=h;E=E||new Uint8Array,b=b||new Uint8Array,x=x||new Uint8Array,S=S||new Uint8Array,B=B||new Uint8Array;let L=$i(E,b,x,S,B),g=C&&A>4294967295,I=C&&m>4294967295,{headerArray:T,headerView:w}=q0e({version:r,bitFlag:K0e(v,P,N,p,a),compressionMethod:a,uncompressedSize:A,compressedSize:m,lastModDate:s,rawFilename:f,zip64CompressedSize:I,zip64UncompressedSize:g,extraFieldLength:L});return Object.assign(o,{zip64UncompressedSize:g,zip64CompressedSize:I,zip64Offset:C&&this.offset-_>4294967295,zip64DiskNumberStart:C&&y>65535,rawExtraFieldZip64:E,rawExtraFieldAES:b,rawExtraFieldExtendedTimestamp:x,rawExtraFieldNTFS:S,rawExtraField:B,extendedTimestamp:x.length>0||S.length>0,extraFieldExtendedTimestampFlag:1+(c?2:0)+(u?4:0),headerArray:T,headerView:w}),[o.filename,o]}))}async add(t="",n,i={}){let o=this,{pendingAddFileCalls:r,config:a}=o;cZ<a.maxWorkers?cZ++:await new Promise(c=>O0e.push(c));let s;try{if(t=t.trim(),o.filenames.has(t))throw new Error(k0e);return o.filenames.add(t),s=fht(o,t,n,i),r.add(s),await s}catch(c){throw o.filenames.delete(t),c}finally{r.delete(s);let c=O0e.shift();c?c():cZ--}}remove(t){let{filenames:n,files:i}=this;if(typeof t=="string"&&(t=i.get(t)),t&&t.filename!==ii){let{filename:o}=t;if(n.has(o)&&i.has(o))return n.delete(o),i.delete(o),!0}return!1}async close(t=new Uint8Array,n={}){let i=this,{pendingAddFileCalls:o,writer:r}=this,{writable:a}=r;for(;o.size;)await Promise.allSettled(Array.from(o));return await yht(this,t,n),So(i,n,d4)||await a.getWriter().close(),r.getData?r.getData():a}};async function fht(e,t,n,i){t=t.trim();let o=So(e,i,v7),r=So(e,i,M7,o?20:768),a=So(e,i,L7);if(r>65535)throw new Error(uZ);let s=So(e,i,D7,0);!i[d2]&&t.endsWith("/")&&(i[d2]=!0),So(e,i,d2)?(t.endsWith("/")||(t+="/"),s===0&&(s=16,o||(s|=16877<<16))):!o&&s===0&&(a?s=493<<16:s=420<<16);let u=So(e,i,y0e,bw),f=u(t);if(f===ii&&(f=bw(t)),$i(f)>65535)throw new Error(G0e);let h=i[c2]||"",p=u(h);if(p===ii&&(p=bw(h)),$i(p)>65535)throw new Error(z0e);let A=So(e,i,R7,20);if(A>65535)throw new Error(uZ);let m=So(e,i,Sw,new Date),_=So(e,i,u2),y=So(e,i,f2),C=So(e,i,B7,0),E=So(e,i,c4),b,x;E||(b=So(e,i,a4),x=So(e,i,s4));let S=So(e,i,f0e,3),B=So(e,i,N7),v=So(e,i,d0e,!0),P=So(e,i,h0e,!0),N=So(e,i,u4),L=So(e,i,p0e),g=So(e,i,A0e,!1),I=So(e,i,l4),T=So(e,i,g0e,!0),w=So(e,i,O7),R=So(e,i,m0e),O=So(e,i,f4),G=So(e,i,_0e);L&&G===ii&&(G=!1),(G===ii||B)&&(G=!0),R!==ii&&R!=6&&(O=!1),!O&&e.config.CompressionStream===ii&&e.config.CompressionStreamZlib===ii&&(R=0);let F=So(e,i,r4);if(!B&&(b!==ii||x!==ii)&&!(S>=1&&S<=3))throw new Error(V0e);let U=new Uint8Array,Q=i[Q7];if(Q){let _t=0,rt=0;Q.forEach(Ye=>_t+=4+$i(Ye)),U=new Uint8Array(_t),Q.forEach((Ye,st)=>{if(st>65535)throw new Error(H0e);if($i(Ye)>65535)throw new Error(W0e);is(U,new Uint16Array([st]),rt),is(U,new Uint16Array([$i(Ye)]),rt+2),is(U,Ye,rt+4),rt+=4+$i(Ye)})}let H=0,Y=0,$=0;if(E&&($=i[l2],$===ii))throw new Error(j0e);let W=F===!0;n&&(n=new Gb(n),await jp(n),E?(i.uncompressedSize=$,H=Q0e($)):n.size===ii?(G=!0,(F||F===ii)&&(F=!0,$=H=4294967296)):(i.uncompressedSize=$=n.size,H=Q0e($)));let{diskOffset:K,diskNumber:Z,maxSize:pe}=e.writer,ge=W||$>4294967295,re=W||H>4294967295,ye=W||e.offset+e.pendingEntriesSize-K>4294967295,Pe=So(e,i,k7,!0)&&W||Z+Math.ceil(e.pendingEntriesSize/pe)>65535;if(ye||ge||re||Pe){if(F===!1||!P)throw new Error(T4);F=!0}F=F||!1;let Ne=So(e,i,P7);i=Object.assign({},i,{rawFilename:f,rawComment:p,version:A,versionMadeBy:r,lastModDate:m,lastAccessDate:_,creationDate:y,rawExtraField:U,zip64:F,zip64UncompressedSize:ge,zip64CompressedSize:re,zip64Offset:ye,zip64DiskNumberStart:Pe,password:b,rawPassword:x,level:R,useWebWorkers:N,encryptionStrength:S,extendedTimestamp:v,zipCrypto:B,bufferedWrite:L,keepOrder:P,useUnicodeFileNames:T,dataDescriptor:G,dataDescriptorSignature:g,signal:I,msDosCompatible:o,internalFileAttribute:C,internalFileAttributes:C,externalFileAttribute:s,externalFileAttributes:s,useCompressionStream:O,passThrough:E,encrypted:!!(b&&$i(b)||x&&$i(x))||E&&Ne,signature:i[F7],compressionMethod:w,uncompressedSize:$,offset:e.offset-K,diskNumberStart:Z});let Le=mht(i),Oe=Aht(i),ot=$i(Le.localHeaderArray,Oe.dataDescriptorArray);Y=ot+H,e.options[z7]&&(Y+=Y+64),e.pendingEntriesSize+=Y;let Fe;try{Fe=await dht(e,t,n,{headerInfo:Le,dataDescriptorInfo:Oe,metadataSize:ot},i)}finally{e.pendingEntriesSize-=Y}return Object.assign(Fe,{name:t,comment:h,extraField:Q}),new SC(Fe)}async function dht(e,t,n,i,o){let{files:r,writer:a}=e,{keepOrder:s,dataDescriptor:c,signal:u}=o,{headerInfo:f}=i,h=e.options[z7],p=Array.from(r.values()).pop(),A={},m,_,y,C,E,b,x;r.set(t,A);try{let P;s&&(P=p&&p.lock,S()),(o.bufferedWrite||e.writerLocked||e.bufferedWrites&&s||!c)&&!h?(b=new null,b.size=0,m=!0,e.bufferedWrites++,await jp(a)):(b=a,await B()),await jp(b);let{writable:N,diskOffset:L}=a;if(e.addSplitZipSignature){delete e.addSplitZipSignature;let R=new Uint8Array(4),O=Mc(R);Zi(O,0,134695760),await A_(a,R),e.offset+=4}h&&pht(i,e.offset-L);let{localHeaderView:g,localHeaderArray:I}=f;m||(await P,await v(N));let{diskNumber:T}=a;E=!0,A.diskNumberStart=T,m?x=new Response(b.readable).blob():await A_(b,I),A=await hht(n,b,A,i,e.config,o);let{zip64:w}=A;if(E=!1,r.set(t,A),A.filename=t,m){let[R]=await Promise.all([x,b.writable.getWriter().close(),P]);await B(),C=!0,A.diskNumberStart=a.diskNumber,A.offset=e.offset-a.diskOffset,w&&F0e(A),_ht(A,g,o),await v(N),await A_(a,I),await R.stream().pipeTo(N,{preventClose:!0,preventAbort:!0,signal:u}),a.size+=b.size,C=!1}else A.offset=e.offset-L,w&&F0e(A);if(A.offset>4294967295&&!w)throw new Error(T4);return e.offset+=A.size,A}catch(P){if(m&&C||!m&&E){if(e.hasCorruptedEntries=!0,P)try{P.corruptedEntry=!0}catch{}m?e.offset+=b.size:e.offset=b.size}throw r.delete(t),P}finally{m&&e.bufferedWrites--,y&&y(),_&&_()}function S(){A.lock=new Promise(P=>y=P)}async function B(){e.writerLocked=!0;let{lockWriter:P}=e;e.lockWriter=new Promise(N=>_=()=>{e.writerLocked=!1,N()}),await P}async function v(P){$i(f.localHeaderArray)>a.availableSize&&(a.availableSize=0,await A_(P,new Uint8Array))}}async function hht(e,t,{diskNumberStart:n,lock:i},o,r,a){let{headerInfo:s,dataDescriptorInfo:c,metadataSize:u}=o,{headerArray:f,headerView:h,lastModDate:p,rawLastModDate:A,encrypted:m,compressed:_,version:y,compressionMethod:C,rawExtraFieldZip64:E,localExtraFieldZip64Length:b,rawExtraFieldExtendedTimestamp:x,extraFieldExtendedTimestampFlag:S,rawExtraFieldNTFS:B,rawExtraFieldAES:v}=s,{dataDescriptorArray:P}=c,{rawFilename:N,lastAccessDate:L,creationDate:g,password:I,rawPassword:T,level:w,zip64:R,zip64UncompressedSize:O,zip64CompressedSize:G,zip64Offset:F,zip64DiskNumberStart:U,zipCrypto:Q,dataDescriptor:H,directory:Y,executable:$,versionMadeBy:W,rawComment:K,rawExtraField:Z,useWebWorkers:pe,onstart:ge,onprogress:re,onend:ye,signal:Ce,encryptionStrength:Pe,extendedTimestamp:Ne,msDosCompatible:Le,internalFileAttributes:Oe,externalFileAttributes:ot,useCompressionStream:Fe,passThrough:_t}=a,rt={lock:i,versionMadeBy:W,zip64:R,directory:!!Y,executable:!!$,filenameUTF8:!0,rawFilename:N,commentUTF8:!0,rawComment:K,rawExtraFieldZip64:E,localExtraFieldZip64Length:b,rawExtraFieldExtendedTimestamp:x,rawExtraFieldNTFS:B,rawExtraFieldAES:v,rawExtraField:Z,extendedTimestamp:Ne,msDosCompatible:Le,internalFileAttributes:Oe,externalFileAttributes:ot,diskNumberStart:n},{signature:Ye,uncompressedSize:st}=a,ft=0;_t||(st=0);let{writable:St}=t;if(e){e.chunkSize=QH(r);let Ie=e.readable,Se=e.size,Kt={options:{codecType:$H,level:w,rawPassword:T,password:I,encryptionStrength:Pe,zipCrypto:m&&Q,passwordVerification:m&&Q&&A>>8&255,signed:!_t,compressed:_&&!_t,encrypted:m&&!_t,useWebWorkers:pe,useCompressionStream:Fe,transferStreams:!1},config:r,streamOptions:{signal:Ce,size:Se,onstart:ge,onprogress:re,onend:ye}};try{let mt=await n4({readable:Ie,writable:St},Kt);ft=mt.outputSize,t.size+=ft,_t||(st=mt.inputSize,Ye=mt.signature)}catch(mt){throw mt.outputSize!==ii&&(t.size+=mt.outputSize),mt}}return ght({signature:Ye,compressedSize:ft,uncompressedSize:st,headerInfo:s,dataDescriptorInfo:c},a),H&&await A_(t,P),Object.assign(rt,{uncompressedSize:st,compressedSize:ft,lastModDate:p,rawLastModDate:A,creationDate:g,lastAccessDate:L,encrypted:m,zipCrypto:Q,size:u+ft,compressionMethod:C,version:y,headerArray:f,headerView:h,signature:Ye,extraFieldExtendedTimestampFlag:S,zip64UncompressedSize:O,zip64CompressedSize:G,zip64Offset:F,zip64DiskNumberStart:U}),rt}function mht(e){let{rawFilename:t,lastModDate:n,lastAccessDate:i,creationDate:o,level:r,zip64:a,zipCrypto:s,useUnicodeFileNames:c,dataDescriptor:u,directory:f,rawExtraField:h,encryptionStrength:p,extendedTimestamp:A,passThrough:m,encrypted:_,zip64UncompressedSize:y,zip64CompressedSize:C,zip64Offset:E,zip64DiskNumberStart:b,uncompressedSize:x,offset:S,diskNumberStart:B}=e,{version:v,compressionMethod:P}=e,N=!f&&(r>0||r===ii&&P!==0),L,g=m||!N,I=a&&(e.bufferedWrite||!y&&!C||g);if(a){let K=4;y&&(K+=8),C&&(K+=8),E&&(K+=8),b&&(K+=4),L=new Uint8Array(K);let Z=Mc(L);if(wo(Z,0,1),wo(Z,2,$i(L)-4),I){let pe=Mc(L),ge=4;y&&(Cs(pe,ge,BigInt(x)),ge+=8),C&&g&&(Cs(pe,ge,BigInt(x)),ge+=8),E&&(Cs(pe,ge,BigInt(S)),ge+=8),b&&(Zi(pe,ge,B),ge+=4)}}else L=new Uint8Array;let T;if(_&&!s){T=new Uint8Array($i(L0e)+2);let K=Mc(T);wo(K,0,39169),is(T,L0e,2),fZ(K,8,p)}else T=new Uint8Array;let w,R,O;if(A){R=new Uint8Array(9+(i?4:0)+(o?4:0));let K=Mc(R);wo(K,0,21589),wo(K,2,$i(R)-4),O=1+(i?2:0)+(o?4:0),fZ(K,4,O);let Z=5;Zi(K,Z,Math.floor(n.getTime()/1e3)),Z+=4,i&&(Zi(K,Z,Math.floor(i.getTime()/1e3)),Z+=4),o&&Zi(K,Z,Math.floor(o.getTime()/1e3));try{w=new Uint8Array(36);let pe=Mc(w),ge=lZ(n);wo(pe,0,10),wo(pe,2,32),wo(pe,8,1),wo(pe,10,24),Cs(pe,12,ge),Cs(pe,20,lZ(i)||ge),Cs(pe,28,lZ(o)||ge)}catch{w=new Uint8Array}}else w=R=new Uint8Array;P===ii&&(P=N?8:0),a&&(v=v>45?v:45),_&&!s&&(v=v>51?v:51,T[9]=P,P=99);let G=I?$i(L):0,F=G+$i(T,R,w,h),{headerArray:U,headerView:Q,rawLastModDate:H}=q0e({version:v,bitFlag:K0e(r,c,u,_,P),compressionMethod:P,uncompressedSize:x,lastModDate:n<l7?l7:n>c7?c7:n,rawFilename:t,zip64CompressedSize:C,zip64UncompressedSize:y,extraFieldLength:F}),Y=30,$=new Uint8Array(Y+$i(t)+F),W=Mc($);return Zi(W,0,67324752),is($,U,4),is($,t,Y),Y+=$i(t),I&&is($,L,Y),Y+=G,is($,T,Y),Y+=$i(T),is($,R,Y),Y+=$i(R),is($,w,Y),Y+=$i(w),is($,h,Y),u&&(Zi(W,18,0),Zi(W,22,0)),{localHeaderArray:$,localHeaderView:W,headerArray:U,headerView:Q,lastModDate:n,rawLastModDate:H,encrypted:_,compressed:N,version:v,compressionMethod:P,extraFieldExtendedTimestampFlag:O,rawExtraFieldZip64:L,localExtraFieldZip64Length:G,rawExtraFieldExtendedTimestamp:R,rawExtraFieldNTFS:w,rawExtraFieldAES:T,extraFieldLength:F}}function pht(e,t){let{headerInfo:n}=e,{localHeaderArray:i,extraFieldLength:o}=n,r=Mc(i),a=64-(t+$i(i))%64;a<4&&(a+=64);let s=new Uint8Array(a),c=Mc(s);wo(c,0,6534),wo(c,2,a-2);let u=i;n.localHeaderArray=i=new Uint8Array($i(u)+a),is(i,u),is(i,s,$i(u)),r=Mc(i),wo(r,28,o+a),e.metadataSize+=a}function Aht({zip64:e,dataDescriptor:t,dataDescriptorSignature:n}){let i=new Uint8Array,o,r=0,a=e?20:12;return n&&(a+=4),t&&(i=new Uint8Array(a),o=Mc(i),n&&(r=4,Zi(o,0,134695760))),{dataDescriptorArray:i,dataDescriptorView:o,dataDescriptorOffset:r}}function ght({signature:e,compressedSize:t,uncompressedSize:n,headerInfo:i,dataDescriptorInfo:o},{zip64:r,zipCrypto:a,dataDescriptor:s}){let{headerView:c,encrypted:u}=i,{dataDescriptorView:f,dataDescriptorOffset:h}=o;(!u||a)&&e!==ii&&(Zi(c,10,e),s&&Zi(f,h,e)),r?s&&(Cs(f,h+4,BigInt(t)),Cs(f,h+12,BigInt(n))):(Zi(c,14,t),Zi(c,18,n),s&&(Zi(f,h+4,t),Zi(f,h+8,n)))}function _ht({rawFilename:e,encrypted:t,zip64:n,localExtraFieldZip64Length:i,signature:o,compressedSize:r,uncompressedSize:a,offset:s,diskNumberStart:c,zip64UncompressedSize:u,zip64CompressedSize:f,zip64Offset:h,zip64DiskNumberStart:p},A,{dataDescriptor:m}){if(m||(t||Zi(A,14,o),n||(Zi(A,18,r),Zi(A,22,a))),n&&i){let _=30+$i(e)+4;u&&(Cs(A,_,BigInt(a)),_+=8),f&&(Cs(A,_,BigInt(r)),_+=8),h&&(Cs(A,_,BigInt(s)),_+=8),p&&Zi(A,_,c)}}function F0e({compressedSize:e,uncompressedSize:t,offset:n,diskNumberStart:i,zip64UncompressedSize:o,zip64CompressedSize:r,zip64Offset:a,zip64DiskNumberStart:s,rawExtraFieldZip64:c}){let u=Mc(c),f=4;o&&(Cs(u,f,BigInt(t)),f+=8),r&&(Cs(u,f,BigInt(e)),f+=8),a&&(Cs(u,f,BigInt(n)),f+=8),s&&Zi(u,f,i)}async function yht(e,t,n){let{files:i,writer:o}=e,{diskOffset:r}=o,{diskNumber:a}=o,s=0,c=0,u=e.offset-r,f=i.size;for(let[,x]of i){let{rawFilename:S,rawExtraFieldZip64:B,rawExtraFieldAES:v,rawComment:P,rawExtraFieldNTFS:N,rawExtraField:L,extendedTimestamp:g,extraFieldExtendedTimestampFlag:I,lastModDate:T}=x,w;if(g){w=new Uint8Array(9);let R=Mc(w);wo(R,0,21589),wo(R,2,5),fZ(R,4,I),Zi(R,5,Math.floor(T.getTime()/1e3))}else w=new Uint8Array;x.rawExtraFieldExtendedTimestamp=w,c+=46+$i(S,P,B,v,N,w,L)}let h=new Uint8Array(c),p=Mc(h);await jp(o);let A=0;for(let[x,S]of Array.from(i.values()).entries()){let{offset:B,rawFilename:v,rawExtraFieldZip64:P,rawExtraFieldAES:N,rawExtraFieldExtendedTimestamp:L,rawExtraFieldNTFS:g,rawExtraField:I,rawComment:T,versionMadeBy:w,headerArray:R,headerView:O,zip64:G,zip64UncompressedSize:F,zip64CompressedSize:U,zip64DiskNumberStart:Q,zip64Offset:H,internalFileAttributes:Y,externalFileAttributes:$,diskNumberStart:W,uncompressedSize:K,compressedSize:Z}=S,pe=$i(P,N,L,g,I);Zi(p,s,33639248),wo(p,s+4,w),F||Zi(O,18,K),U||Zi(O,14,Z),is(h,R,s+6);let ge=s+30;if(wo(p,ge,pe),ge+=2,wo(p,ge,$i(T)),ge+=2,wo(p,ge,G&&Q?65535:W),ge+=2,wo(p,ge,Y),ge+=2,$&&Zi(p,ge,$),ge+=4,Zi(p,ge,G&&H?4294967295:B),ge+=4,is(h,v,ge),ge+=$i(v),is(h,P,ge),ge+=$i(P),is(h,N,ge),ge+=$i(N),is(h,L,ge),ge+=$i(L),is(h,g,ge),ge+=$i(g),is(h,I,ge),ge+=$i(I),is(h,T,ge),s-A>o.availableSize&&(o.availableSize=0,await A_(o,h.slice(A,s)),A=s),s=ge,n.onprogress)try{await n.onprogress(x+1,i.size,new SC(S))}catch{}}await A_(o,A?h.slice(A):h);let m=o.diskNumber,{availableSize:_}=o;_<22&&m++;let y=So(e,n,r4);if(u>4294967295||c>4294967295||f>65535||m>65535){if(y===!1)throw new Error(T4);y=!0}let C=new Uint8Array(y?98:22),E=Mc(C);s=0,y&&(Zi(E,0,101075792),Cs(E,4,BigInt(44)),wo(E,12,45),wo(E,14,45),Zi(E,16,m),Zi(E,20,a),Cs(E,24,BigInt(f)),Cs(E,32,BigInt(f)),Cs(E,40,BigInt(c)),Cs(E,48,BigInt(u)),Zi(E,56,117853008),Cs(E,64,BigInt(u)+BigInt(c)),Zi(E,72,m+1),So(e,n,k7,!0)&&(m=65535,a=65535),f=65535,u=4294967295,c=4294967295,s+=76),Zi(E,s,101010256),wo(E,s+4,m),wo(E,s+6,a),wo(E,s+8,f),wo(E,s+10,f),Zi(E,s+12,c),Zi(E,s+16,u);let b=$i(t);if(b)if(b<=65535)wo(E,s+20,b);else throw new Error(U0e);await A_(o,C),b&&await A_(o,t)}async function A_(e,t){let{writable:n}=e,i=n.getWriter();try{await i.ready,e.size+=$i(t),await i.write(t)}finally{i.releaseLock()}}function lZ(e){if(e)return(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4)}function So(e,t,n,i){let o=t[n]===ii?e.options[n]:t[n];return o===ii?i:o}function Q0e(e){return e+5*(Math.floor(e/16383)+1)}function fZ(e,t,n){e.setUint8(t,n)}function wo(e,t,n){e.setUint16(t,n,!0)}function Zi(e,t,n){e.setUint32(t,n,!0)}function Cs(e,t,n){e.setBigUint64(t,n,!0)}function is(e,t,n){e.set(t,n)}function Mc(e){return new DataView(e.buffer)}function $i(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}function q0e({version:e,bitFlag:t,compressionMethod:n,uncompressedSize:i,compressedSize:o,lastModDate:r,rawFilename:a,zip64CompressedSize:s,zip64UncompressedSize:c,extraFieldLength:u}){let f=new Uint8Array(26),h=Mc(f);wo(h,0,e),wo(h,2,t),wo(h,4,n);let p=new Uint32Array(1),A=Mc(p);wo(A,0,(r.getHours()<<6|r.getMinutes())<<5|r.getSeconds()/2),wo(A,2,(r.getFullYear()-1980<<4|r.getMonth()+1)<<5|r.getDate());let m=p[0];return Zi(h,6,m),(s||o!==ii)&&Zi(h,14,s?4294967295:o),(c||i!==ii)&&Zi(h,18,c?4294967295:i),wo(h,22,$i(a)),wo(h,24,u),{headerArray:f,headerView:h,rawLastModDate:m}}function K0e(e,t,n,i,o){let r=0;return t&&(r=r|2048),n&&(r=r|8),(o==8||o==9)&&(e>=0&&e<=3&&(r=r|6),e>3&&e<=5&&(r=r|4),e==9&&(r=r|2)),i&&(r=r|1),r}var Cht={},X0e;try{X0e=Cht.url}catch{}_w({baseURI:X0e,CompressionStreamZlib:jQ,DecompressionStreamZlib:YQ});var dZ=32,Eht="http://www.opengis.net/kml/2.2",Pm="http://www.google.com/kml/ext/2.2",bht="http://www.w3.org/2000/xmlns/";function S4(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var Iht=/^data:image\/([^,;]+)/;S4.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof De){if(e=De.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(Iht);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 xht(e,t){return function(n){e._files[t]=n}}S4.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 a=Promise.resolve(i[r]);this._promises.push(a),a.then(xht(this,r))}return o};Object.defineProperties(S4.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function w4(e){this._time=e}w4.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),i??t};w4.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return qb(n)};w4.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function hZ(){this._ids={},this._styles={},this._count=0}hZ.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};hZ.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 $0e(){this._ids={}}$0e.prototype.get=function(e){if(!l(e))return this.get(Jn());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function mZ(e){e=e??V.EMPTY_OBJECT;let t=e.entities,n=e.kmz??!1,i=mZ._createState(e),o=t.values.filter(function(u){return!l(u.parent)}),r=i.kmlDoc,a=r.documentElement;a.setAttributeNS(bht,"xmlns:gx",Pm);let s=r.createElement("Document");a.appendChild(s),tbe(i,s,o),i.styleCache.save(s);let c=i.externalFileHandler;return c.promise.then(function(){let f=new XMLSerializer().serializeToString(i.kmlDoc);return n?Tht(f,c.files):{kml:f,externalFiles:c.files}})}async function Tht(e,t){let n=Zt("ThirdParty/Workers/zip-web-worker.js"),i=Zt("ThirdParty/zip-module.wasm");_w({workerURI:n,wasmURI:i});let o=new Cw("application/vnd.google-earth.kmz"),r=new A2(o);await r.add("doc.kml",new XQ(e));let a=Object.keys(t);return await ebe(r,a,t,0),await r.close(),{kmz:await o.getData()}}async function ebe(e,t,n,i){if(t.length===i)return;let o=t[i];return await e.add(o,new Hp(n[o])),ebe(e,t,n,i+1)}mZ._createState=function(e){let t=e.entities,n=new hZ,i=t.computeAvailability(),o=l(e.time)?e.time:i.start,r=e.defaultAvailability??i,a=e.sampleDuration??60;r.start===Xe.MINIMUM_VALUE?r.stop===Xe.MAXIMUM_VALUE?r=new vn:X.addSeconds(r.stop,-10*a,r.start):r.stop===Xe.MAXIMUM_VALUE&&X.addSeconds(r.start,10*a,r.stop);let s=new S4(e.modelCallback);return{kmlDoc:document.implementation.createDocument(Eht,"kml"),ellipsoid:e.ellipsoid??te.default,idManager:new $0e,styleCache:n,externalFileHandler:s,time:o,valueGetter:new w4(o),sampleDuration:a,defaultAvailability:new Ea([r])}};function tbe(e,t,n){let i=e.kmlDoc,o=e.styleCache,r=e.valueGetter,a=e.idManager,s=n.length,c,u,f;for(let h=0;h<s;++h){let p=n[h];c=[],u=[],f=[],Sht(e,p,u,f),wht(e,p.polyline,u,f),Z0e(e,p.rectangle,u,f,c),Z0e(e,p.polygon,u,f,c),Pht(e,p,p.model,u,f);let A,m=p.availability;l(m)&&(A=i.createElement("TimeSpan"),X.equals(m.start,Xe.MINIMUM_VALUE)||A.appendChild(En(i,"begin",X.toIso8601(m.start))),X.equals(m.stop,Xe.MAXIMUM_VALUE)||A.appendChild(En(i,"end",X.toIso8601(m.stop))));for(let C=0;C<c.length;++C){let E=c[C];E.setAttribute("id",a.get(p.id)),E.appendChild(En(i,"name",p.name)),E.appendChild(En(i,"visibility",p.show)),E.appendChild(En(i,"description",p.description)),l(A)&&E.appendChild(A),t.appendChild(E)}let _=u.length;if(_>0){let C=i.createElement("Placemark");C.setAttribute("id",a.get(p.id));let E=p.name,b=p.label;if(l(b)){let S=i.createElement("LabelStyle"),B=r.get(b.text);E=l(B)&&B.length>0?B:E;let v=r.getColor(b.fillColor);l(v)&&(S.appendChild(En(i,"color",v)),S.appendChild(En(i,"colorMode","normal")));let P=r.get(b.scale);l(P)&&S.appendChild(En(i,"scale",P)),f.push(S)}C.appendChild(En(i,"name",E)),C.appendChild(En(i,"visibility",p.show)),C.appendChild(En(i,"description",p.description)),l(A)&&C.appendChild(A),t.appendChild(C);let x=f.length;if(x>0){let S=i.createElement("Style");for(let B=0;B<x;++B)S.appendChild(f[B]);C.appendChild(En(i,"styleUrl",o.get(S)))}if(u.length===1)C.appendChild(u[0]);else if(u.length>1){let S=i.createElement("MultiGeometry");for(let B=0;B<_;++B)S.appendChild(u[B]);C.appendChild(S)}}let y=p._children;if(y.length>0){let C=i.createElement("Folder");C.setAttribute("id",a.get(p.id)),C.appendChild(En(i,"name",p.name)),C.appendChild(En(i,"visibility",p.show)),C.appendChild(En(i,"description",p.description)),t.appendChild(C),tbe(e,C,y)}}}var Gu=new d,su=new me,vm=new X;function Sht(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,a=e.valueGetter,s=t.billboard??t.point;if(!l(s)&&!l(t.path))return;let c=t.position;if(!c.isConstant){nbe(e,t,s,n,i);return}a.get(c,void 0,Gu);let u=En(o,"coordinates",Yb(Gu,r)),f=o.createElement("Point"),h=o.createElement("altitudeMode");h.appendChild(Kb(e,s.heightReference)),f.appendChild(h),f.appendChild(u),n.push(f);let p=s instanceof jc?obe(e,s):ibe(e,s);i.push(p)}function nbe(e,t,n,i,o){let r=e.kmlDoc,a=e.ellipsoid,s=e.valueGetter,c,u=t.position,f=!0;u instanceof lc?(c=u.intervals,f=!1):c=t.availability??e.defaultAvailability;let h=n instanceof jA,p,A,m,_=[];for(p=0;p<c.length;++p){let C=c.get(p),E=f?u:C.data,b=r.createElement("altitudeMode");E instanceof zp?(E=E._value,b.appendChild(Kb(e,it.CLAMP_TO_GROUND))):l(n)?b.appendChild(Kb(e,n.heightReference)):b.appendChild(Kb(e,it.NONE));let x=[],S=[];if(E.isConstant){s.get(E,void 0,Gu);let v=En(r,"coordinates",Yb(Gu,a));x.push(X.toIso8601(C.start)),S.push(v),x.push(X.toIso8601(C.stop)),S.push(v)}else if(E instanceof fc)for(m=E._property._times,A=0;A<m.length;++A)x.push(X.toIso8601(m[A])),E.getValueInReferenceFrame(m[A],Li.FIXED,Gu),S.push(Yb(Gu,a));else if(E instanceof Of){m=E._times;let v=E._values;for(A=0;A<m.length;++A)x.push(X.toIso8601(m[A])),d.fromArray(v,A*3,Gu),S.push(Yb(Gu,a))}else{let v=e.sampleDuration;C.start.clone(vm),C.isStartIncluded||X.addSeconds(vm,v,vm);let P=C.stop;for(;X.lessThan(vm,P);)E.getValue(vm,Gu),x.push(X.toIso8601(vm)),S.push(Yb(Gu,a)),X.addSeconds(vm,v,vm);C.isStopIncluded&&X.equals(vm,P)&&(E.getValue(vm,Gu),x.push(X.toIso8601(vm)),S.push(Yb(Gu,a)))}let B=r.createElementNS(Pm,"Track");B.appendChild(b);for(let v=0;v<x.length;++v){let P=En(r,"when",x[v]),N=En(r,"coord",S[v],Pm);B.appendChild(P),B.appendChild(N)}h&&B.appendChild(rbe(e,n)),_.push(B)}if(_.length===1)i.push(_[0]);else if(_.length>1){let C=r.createElementNS(Pm,"MultiTrack");for(p=0;p<_.length;++p)C.appendChild(_[p]);i.push(C)}if(l(n)&&!h){let C=n instanceof jc?obe(e,n):ibe(e,n);o.push(C)}let y=t.path;if(l(y)){let C=s.get(y.width),E=y.material;if(l(E)||l(C)){let b=r.createElement("LineStyle");l(C)&&b.appendChild(En(r,"width",C)),pZ(e,E,b),o.push(b)}}}function ibe(e,t){let n=e.kmlDoc,i=e.valueGetter,o=n.createElement("IconStyle"),r=i.getColor(t.color);l(r)&&(o.appendChild(En(n,"color",r)),o.appendChild(En(n,"colorMode","normal")));let a=i.get(t.pixelSize);return l(a)&&o.appendChild(En(n,"scale",a/dZ)),o}function obe(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("IconStyle"),a=i.get(t.image);if(l(a)){a=o.texture(a);let p=n.createElement("Icon");p.appendChild(En(n,"href",a));let A=i.get(t.imageSubRegion);l(A)&&(p.appendChild(En(n,"x",A.x,Pm)),p.appendChild(En(n,"y",A.y,Pm)),p.appendChild(En(n,"w",A.width,Pm)),p.appendChild(En(n,"h",A.height,Pm))),r.appendChild(p)}let s=i.getColor(t.color);l(s)&&(r.appendChild(En(n,"color",s)),r.appendChild(En(n,"colorMode","normal")));let c=i.get(t.scale);l(c)&&r.appendChild(En(n,"scale",c));let u=i.get(t.pixelOffset);if(l(u)){c=c??1,k.divideByScalar(u,c,u);let p=i.get(t.width,dZ),A=i.get(t.height,dZ),m=i.get(t.horizontalOrigin,Mi.CENTER);m===Mi.CENTER?u.x-=p*.5:m===Mi.RIGHT&&(u.x-=p);let _=i.get(t.verticalOrigin,jn.CENTER);_===jn.TOP?u.y+=A:_===jn.CENTER&&(u.y+=A*.5);let y=n.createElement("hotSpot");y.setAttribute("x",-u.x),y.setAttribute("y",u.y),y.setAttribute("xunits","pixels"),y.setAttribute("yunits","pixels"),r.appendChild(y)}let f=i.get(t.rotation),h=i.get(t.alignedAxis);return l(f)&&d.equals(d.UNIT_Z,h)&&(f=D.toDegrees(-f),f===0&&(f=360),r.appendChild(En(n,"heading",f))),r}function wht(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,a=e.valueGetter;if(!l(t))return;let s=o.createElement("LineString"),c=o.createElement("altitudeMode"),u=a.get(t.clampToGround,!1),f;u?(s.appendChild(En(o,"tessellate",!0)),f=o.createTextNode("clampToGround")):f=o.createTextNode("absolute"),c.appendChild(f),s.appendChild(c);let h=t.positions,p=a.get(h),A=En(o,"coordinates",Yb(p,r));s.appendChild(A);let m=a.get(t.zIndex);u&&l(m)&&s.appendChild(En(o,"drawOrder",m,Pm)),n.push(s);let _=o.createElement("LineStyle"),y=a.get(t.width);l(y)&&_.appendChild(En(o,"width",y)),pZ(e,t.material,_),i.push(_)}function Bht(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=o.get(t.height,0);n>0&&(r=n);let a=t.coordinates,s=o.get(a),c=[],u=[ce.northeast,ce.southeast,ce.southwest,ce.northwest];for(let A=0;A<4;++A)u[A](s,su),c.push(`${D.toDegrees(su.longitude)},${D.toDegrees(su.latitude)},${r}`);let f=En(i,"coordinates",c.join(" ")),h=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(f),h.appendChild(p),[h]}function J0e(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,a=[],s=t.length;for(let f=0;f<s;++f)me.fromCartesian(t[f],r,su),a.push(`${D.toDegrees(su.longitude)},${D.toDegrees(su.latitude)},${i?su.height:n}`);let c=En(o,"coordinates",a.join(" ")),u=o.createElement("LinearRing");return u.appendChild(c),u}function Dht(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=o.get(t.height,0),a=o.get(t.perPositionHeight,!1);!a&&n>0&&(r=n);let s=[],c=t.hierarchy,u=o.get(c),f=Array.isArray(u)?u:u.positions,h=i.createElement("outerBoundaryIs");h.appendChild(J0e(e,f,r,a)),s.push(h);let p=u.holes;if(l(p)){let A=p.length;for(let m=0;m<A;++m){let _=i.createElement("innerBoundaryIs");_.appendChild(J0e(e,p[m].positions,r,a)),s.push(_)}}return s}function Z0e(e,t,n,i,o){let r=e.kmlDoc,a=e.valueGetter;if(!l(t))return;let s=t instanceof Fh;if(s&&a.getMaterialType(t.material)==="Image"){vht(e,t,o);return}let c=r.createElement("Polygon"),u=a.get(t.extrudedHeight,0);u>0&&c.appendChild(En(r,"extrude",!0));let f=s?Bht(e,t,u):Dht(e,t,u),h=f.length;for(let y=0;y<h;++y)c.appendChild(f[y]);let p=r.createElement("altitudeMode");p.appendChild(Kb(e,t.heightReference)),c.appendChild(p),n.push(c);let A=r.createElement("PolyStyle"),m=a.get(t.fill,!1);m&&A.appendChild(En(r,"fill",m)),pZ(e,t.material,A);let _=a.get(t.outline,!1);if(_){A.appendChild(En(r,"outline",_));let y=r.createElement("LineStyle"),C=a.get(t.outlineWidth,1);y.appendChild(En(r,"width",C));let E=a.getColor(t.outlineColor,z.BLACK);y.appendChild(En(r,"color",E)),y.appendChild(En(r,"colorMode","normal")),i.push(y)}i.push(A)}function vht(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=e.externalFileHandler,a=i.createElement("GroundOverlay"),s=i.createElement("altitudeMode");s.appendChild(Kb(e,t.heightReference)),a.appendChild(s);let c=o.get(t.height);l(c)&&a.appendChild(En(i,"altitude",c));let u=o.get(t.coordinates),f=i.createElement("LatLonBox");f.appendChild(En(i,"north",D.toDegrees(u.north))),f.appendChild(En(i,"south",D.toDegrees(u.south))),f.appendChild(En(i,"east",D.toDegrees(u.east))),f.appendChild(En(i,"west",D.toDegrees(u.west))),a.appendChild(f);let h=o.get(t.material),p=r.texture(h.image),A=i.createElement("Icon");A.appendChild(En(i,"href",p)),a.appendChild(A);let m=h.color;l(m)&&a.appendChild(En(i,"color",qb(h.color))),n.push(a)}function rbe(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("Model"),a=i.get(t.scale);if(l(a)){let u=n.createElement("scale");u.appendChild(En(n,"x",a)),u.appendChild(En(n,"y",a)),u.appendChild(En(n,"z",a)),r.appendChild(u)}let s=n.createElement("Link"),c=o.model(t,e.time);return s.appendChild(En(n,"href",c)),r.appendChild(s),r}function Pht(e,t,n,i,o){let r=e.kmlDoc,a=e.ellipsoid,s=e.valueGetter;if(!l(n))return;let c=t.position;if(!c.isConstant){nbe(e,t,n,i,o);return}let u=rbe(e,n),f=r.createElement("altitudeMode");f.appendChild(Kb(e,n.heightReference)),u.appendChild(f),s.get(c,void 0,Gu),me.fromCartesian(Gu,a,su);let h=r.createElement("Location");h.appendChild(En(r,"longitude",D.toDegrees(su.longitude))),h.appendChild(En(r,"latitude",D.toDegrees(su.latitude))),h.appendChild(En(r,"altitude",su.height)),u.appendChild(h),i.push(u)}function pZ(e,t,n){let i=e.kmlDoc,o=e.valueGetter;if(!l(t))return;let r=o.get(t);if(!l(r))return;let a,s=o.getMaterialType(t),c,u;switch(s){case"Image":a=qb(z.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":a=qb(r.color);break;case"PolylineOutline":a=qb(r.color),c=qb(r.outlineColor),u=r.outlineWidth,n.appendChild(En(i,"outerColor",c,Pm)),n.appendChild(En(i,"outerWidth",u,Pm));break;case"Stripe":a=qb(r.oddColor);break}l(a)&&(n.appendChild(En(i,"color",a)),n.appendChild(En(i,"colorMode","normal")))}function Kb(e,t){let n=e.kmlDoc,o=e.valueGetter.get(t,it.NONE),r;switch(o){case it.NONE:r=n.createTextNode("absolute");break;case it.CLAMP_TO_GROUND:r=n.createTextNode("clampToGround");break;case it.RELATIVE_TO_GROUND:r=n.createTextNode("relativeToGround");break}return r}function Yb(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let o=0;o<n;++o)me.fromCartesian(e[o],t,su),i.push(`${D.toDegrees(su.longitude)},${D.toDegrees(su.latitude)},${su.height}`);return i.join(" ")}function En(e,t,n,i){n=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 qb(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 AZ=mZ;function _2(){this._cache={}}_2.prototype.fromColor=function(e,t){return B4(void 0,void 0,e,t,this._cache)};_2.prototype.fromUrl=function(e,t,n){return B4(e,void 0,t,n,this._cache)};_2.prototype.fromMakiIconId=function(e,t,n){return B4(Zt(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};_2.prototype.fromText=function(e,t,n){return B4(void 0,e,t,n,this._cache)};var Rht=new z;function Mht(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,Rht).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 abe(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 a=Math.round((n-o)/2),s=Math.round(7/24*n-r/2);e.globalCompositeOperation="destination-out",e.drawImage(t,a-1,s,o,r),e.drawImage(t,a,s-1,o,r),e.drawImage(t,a+1,s,o,r),e.drawImage(t,a,s+1,o,r),e.globalCompositeOperation="destination-over",e.fillStyle=z.BLACK.toCssColorString(),e.fillRect(a-1,s-1,o+2,r+2),e.globalCompositeOperation="destination-out",e.drawImage(t,a,s,o,r),e.globalCompositeOperation="destination-over",e.fillStyle=z.WHITE.toCssColorString(),e.fillRect(a-1,s-2,o+2,r+2)}var g2=new Array(4);function B4(e,t,n,i,o){g2[0]=e,g2[1]=t,g2[2]=n,g2[3]=i;let r=JSON.stringify(g2),a=o[r];if(l(a))return a;let s=document.createElement("canvas");s.width=i,s.height=i;let c=s.getContext("2d");if(Mht(c,n,i),l(e)){let f=De.createIfNeeded(e).fetchImage().then(function(h){return abe(c,h,i),o[r]=s,s});return o[r]=f,f}else if(l(t)){let u=W0(t,{font:`bold ${i}px sans-serif`});abe(c,u,i)}return o[r]=s,s}var g_=_2;var lbe=Wr(cbe(),1);function v4(e){return d.fromDegrees(e[0],e[1],e[2])}var gZ={"urn:ogc:def:crs:OGC:1.3:CRS84":v4,"EPSG:4326":v4,"urn:ogc:def:crs:EPSG::4326":v4},ube={},fbe={},_Z=48,yZ,CZ=z.ROYALBLUE,EZ=z.YELLOW,bZ=2,IZ=z.fromBytes(255,255,0,100),xZ=!1,Nht={small:24,medium:48,large:64},Lht=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function dbe(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||Lht.indexOf(i)!==-1)continue;let o=e[i];l(o)&&(typeof o=="object"?n+=`<tr><th>${i}</th><td>${dbe(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 Oht(e,t,n){let i;return function(o,r){return l(i)||(i=e(t,n)),i}}function Fht(e,t){return new Qh(Oht(dbe,e,t),!0)}function P4(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=Jn();else{let a=2,s=i;for(;l(t.getById(s));)s=`${i}_${a}`,a++;i=s}let o=t.getOrCreateEntity(i),r=e.properties;if(l(r)){o.properties=r;let a,s=r.title;if(l(s))o.name=s,a="title";else{let u=Number.MAX_VALUE;for(let f in r)if(r.hasOwnProperty(f)&&r[f]){let h=f.toLowerCase();if(u>1&&h==="title"){u=1,a=f;break}else u>2&&h==="name"?(u=2,a=f):u>3&&/title/i.test(f)?(u=3,a=f):u>4&&/name/i.test(f)&&(u=4,a=f)}l(a)&&(o.name=r[a])}let c=r.description;c!==null&&(o.description=l(c)?new hi(c):n(r,a))}return o}function TZ(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var hbe={Feature:pbe,FeatureCollection:Qht,GeometryCollection:Abe,LineString:Ebe,MultiLineString:bbe,MultiPoint:ybe,MultiPolygon:Tbe,Point:_be,Polygon:xbe,Topology:Sbe},mbe={GeometryCollection:Abe,LineString:Ebe,MultiLineString:bbe,MultiPoint:ybe,MultiPolygon:Tbe,Point:_be,Polygon:xbe,Topology:Sbe};function pbe(e,t,n,i,o){if(t.geometry===null){P4(t,e._entityCollection,o.describe);return}if(!l(t.geometry))throw new ue("feature.geometry is required.");let r=t.geometry.type,a=mbe[r];if(!l(a))throw new ue(`Unknown geometry type: ${r}`);a(e,t,t.geometry,i,o)}function Qht(e,t,n,i,o){let r=t.features;for(let a=0,s=r.length;a<s;a++)pbe(e,r[a],void 0,i,o)}function Abe(e,t,n,i,o){let r=n.geometries;for(let a=0,s=r.length;a<s;a++){let c=r[a],u=c.type,f=mbe[u];if(!l(f))throw new ue(`Unknown geometry type: ${u}`);f(e,t,c,i,o)}}function gbe(e,t,n,i,o){let r=o.markerSymbol,a=o.markerColor,s=o.markerSize,c=t.properties;if(l(c)){let A=c["marker-color"];l(A)&&(a=z.fromCssColorString(A)),s=Nht[c["marker-size"]]??s;let m=c["marker-symbol"];l(m)&&(r=m)}let u;l(r)?r.length===1?u=e._pinBuilder.fromText(r.toUpperCase(),a,s):u=e._pinBuilder.fromMakiIconId(r,a,s):u=e._pinBuilder.fromColor(a,s);let f=new jc;f.verticalOrigin=new hi(jn.BOTTOM),i.length===2&&o.clampToGround&&(f.heightReference=it.CLAMP_TO_GROUND);let h=P4(t,e._entityCollection,o.describe);h.billboard=f,h.position=new Ml(n(i));let p=Promise.resolve(u).then(function(A){f.image=new hi(A)}).catch(function(){f.image=new hi(e._pinBuilder.fromColor(a,s))});e._promises.push(p)}function _be(e,t,n,i,o){gbe(e,t,i,n.coordinates,o)}function ybe(e,t,n,i,o){let r=n.coordinates;for(let a=0;a<r.length;a++)gbe(e,t,i,r[a],o)}function Cbe(e,t,n,i,o){let r=o.strokeMaterialProperty,a=o.strokeWidthProperty,s=t.properties;if(l(s)){let f=s["stroke-width"];l(f)&&(a=new hi(f));let h,p=s.stroke;l(p)&&(h=z.fromCssColorString(p));let A=s["stroke-opacity"];l(A)&&A!==1&&(l(h)||(h=r.color.getValue().clone()),h.alpha=A),l(h)&&(r=new qt(h))}let c=P4(t,e._entityCollection,o.describe),u=new qc;c.polyline=u,u.clampToGround=o.clampToGround,u.material=r,u.width=a,u.positions=new hi(TZ(i,n)),u.arcType=ln.RHUMB}function Ebe(e,t,n,i,o){Cbe(e,t,i,n.coordinates,o)}function bbe(e,t,n,i,o){let r=n.coordinates;for(let a=0;a<r.length;a++)Cbe(e,t,i,r[a],o)}function Ibe(e,t,n,i,o){if(i.length===0||i[0].length===0)return;let r=o.strokeMaterialProperty.color,a=o.fillMaterialProperty,s=o.strokeWidthProperty,c=t.properties;if(l(c)){let A=c["stroke-width"];l(A)&&(s=new hi(A));let m,_=c.stroke;l(_)&&(m=z.fromCssColorString(_));let y=c["stroke-opacity"];l(y)&&y!==1&&(l(m)||(m=r.getValue().clone()),m.alpha=y),l(m)&&(r=new hi(m));let C,E=c.fill,b=a.color.getValue();l(E)&&(C=z.fromCssColorString(E),C.alpha=b.alpha),y=c["fill-opacity"],l(y)&&y!==b.alpha&&(l(C)||(C=b.clone()),C.alpha=y),l(C)&&(a=new qt(C))}let u=new Oh;u.outline=new hi(!0),u.outlineColor=r,u.outlineWidth=s,u.material=a,u.arcType=ln.RHUMB;let f=[];for(let A=1,m=i.length;A<m;A++)f.push(new wc(TZ(i[A],n)));let h=i[0];u.hierarchy=new hi(new wc(TZ(h,n),f)),h[0].length>2?u.perPositionHeight=new hi(!0):o.clampToGround||(u.height=0);let p=P4(t,e._entityCollection,o.describe);p.polygon=u}function xbe(e,t,n,i,o){Ibe(e,t,i,n.coordinates,o)}function Tbe(e,t,n,i,o){let r=n.coordinates;for(let a=0;a<r.length;a++)Ibe(e,t,i,r[a],o)}function Sbe(e,t,n,i,o){for(let r in n.objects)if(n.objects.hasOwnProperty(r)){let a=lbe.feature(n,n.objects[r]),s=hbe[a.type];s(e,a,a,i,o)}}function BC(e){this._name=e,this._changed=new _e,this._error=new _e,this._isLoading=!1,this._loading=new _e,this._entityCollection=new Vs(this),this._promises=[],this._pinBuilder=new g_,this._entityCluster=new Rf,this._credit=void 0,this._resourceCredits=[]}BC.load=function(e,t){return new BC().load(e,t)};Object.defineProperties(BC,{markerSize:{get:function(){return _Z},set:function(e){_Z=e}},markerSymbol:{get:function(){return yZ},set:function(e){yZ=e}},markerColor:{get:function(){return CZ},set:function(e){CZ=e}},stroke:{get:function(){return EZ},set:function(e){EZ=e}},strokeWidth:{get:function(){return bZ},set:function(e){bZ=e}},fill:{get:function(){return IZ},set:function(e){IZ=e}},clampToGround:{get:function(){return xZ},set:function(e){xZ=e}},crsNames:{get:function(){return gZ}},crsLinkHrefs:{get:function(){return ube}},crsLinkTypes:{get:function(){return fbe}}});Object.defineProperties(BC.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}}});BC.prototype.load=function(e,t){return wbe(this,e,t,!0)};BC.prototype.process=function(e,t){return wbe(this,e,t,!1)};function wbe(e,t,n,i){ba.setLoading(e,!0),n=n??V.EMPTY_OBJECT;let o=n.credit;typeof o=="string"&&(o=new Et(o)),e._credit=o;let r=t,a=n.sourceUri;if(typeof t=="string"||t instanceof De){t=De.createIfNeeded(t),r=t.fetchJson(),a=a??t.getUrlComponent();let s=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)s.push(c[f])}}return n={describe:n.describe??Fht,markerSize:n.markerSize??_Z,markerSymbol:n.markerSymbol??yZ,markerColor:n.markerColor??CZ,strokeWidthProperty:new hi(n.strokeWidth??bZ),strokeMaterialProperty:new qt(n.stroke??EZ),fillMaterialProperty:new qt(n.fill??IZ),clampToGround:n.clampToGround??xZ},Promise.resolve(r).then(function(s){return kht(e,s,n,a,i)}).catch(function(s){throw ba.setLoading(e,!1),e._error.raiseEvent(e,s),s})}BC.prototype.update=function(e){return!0};function kht(e,t,n,i,o){let r;l(i)&&(r=e_(i)),l(r)&&e._name!==r&&(e._name=r,e._changed.raiseEvent(e));let a=hbe[t.type];if(!l(a))throw new ue(`Unsupported GeoJSON object type: ${t.type}`);let s=t.crs,c=s!==null?v4:null;if(l(s)){if(!l(s.properties))throw new ue("crs.properties is undefined.");let u=s.properties;if(s.type==="name"){if(c=gZ[u.name],!l(c))throw new ue(`Unknown crs name: ${u.name}`)}else if(s.type==="link"){let f=ube[u.href];if(l(f)||(f=fbe[u.type]),!l(f))throw new ue(`Unable to resolve crs link: ${JSON.stringify(u)}`);c=f(u)}else if(s.type==="EPSG"){if(c=gZ[`EPSG:${u.code}`],!l(c))throw new ue(`Unknown crs EPSG code: ${u.code}`)}else throw new ue(`Unknown crs type: ${s.type}`)}return Promise.resolve(c).then(function(u){return o&&e._entityCollection.removeAll(),u!==null&&a(e,t,t,u,n),Promise.all(e._promises).then(function(){return e._promises.length=0,ba.setLoading(e,!1),e})})}var DC=BC;function Uht(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var kn=Uht;var TIe=Wr(HZ(),1);var SIe;typeof DOMParser<"u"&&(SIe=new DOMParser);var Qpt=new TIe.default({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),Z4=32,gIe=2414016,_Ie=1,yIe=16093e3,CIe=.1,kpt=[null,void 0,"http://www.topografix.com/GPX/1/1"],nr={gpx:kpt};function Upt(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 WZ(e,t){let n=E2(e,"id");return n=l(n)?n:Jn(),t.getOrCreateEntity(n)}function jZ(e){let t=EIe(e,"lon"),n=EIe(e,"lat"),i=y2(e,"ele",nr.gpx);return d.fromDegrees(t,n,i)}function EIe(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 E2(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function MC(e,t,n){if(!l(e))return;let i=e.childNodes,o=i.length;for(let r=0;r<o;r++){let a=i[r];if(a.localName===t&&n.indexOf(a.namespaceURI)!==-1)return a}}function YZ(e,t,n){if(!l(e))return;let i=[],o=e.getElementsByTagName(t),r=o.length;for(let a=0;a<r;a++){let s=o[a];s.localName===t&&n.indexOf(s.namespaceURI)!==-1&&i.push(s)}return i}function y2(e,t,n){let i=MC(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function Vu(e,t,n){let i=MC(e,t,n);if(l(i))return i.textContent.trim()}function wIe(e){let t=new jc;return t.width=Z4,t.height=Z4,t.scaleByDistance=new Ht(gIe,_Ie,yIe,CIe),t.pixelOffsetScaleByDistance=new Ht(gIe,_Ie,yIe,CIe),t.verticalOrigin=new hi(jn.BOTTOM),t.image=e,t}function zpt(){let e=new Lh;return e.translucencyByDistance=new Ht(3e6,1,5e6,0),e.pixelOffset=new k(17,0),e.horizontalOrigin=Mi.LEFT,e.font="16px sans-serif",e.style=pr.FILL_AND_OUTLINE,e}function BIe(e){let t=new qc;return t.width=4,t.material=new dC,t.material.color=l(e)?e:z.RED,t.material.outlineWidth=2,t.material.outlineColor=z.BLACK,t}var bIe={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"}},C2;typeof document<"u"&&(C2=document.createElement("div"));function qZ(e,t){let n,i="",o=Object.keys(bIe),r=o.length;for(n=0;n<r;n++){let f=o[n],h=bIe[f];h.value=Vu(e,h.tag,nr.gpx)??"",l(h.value)&&h.value!==""&&(i=`${i}<p>${h.text}: ${h.value}</p>`)}if(!l(i)||i==="")return;i=Qpt.link(i),C2.innerHTML=i;let a=C2.querySelectorAll("a");for(n=0;n<a.length;n++)a[n].setAttribute("target","_blank");let s=z.WHITE,c=z.BLACK,u='<div class="cesium-infoBox-description-lighter" style="';return u+="overflow:auto;",u+="word-wrap:break-word;",u+=`background-color:${s.toCssColorString()};`,u+=`color:${c.toCssColorString()};`,u+='">',u+=`${C2.innerHTML}</div>`,C2.innerHTML="",u}function DIe(e,t,n,i){let o=jZ(t),r=WZ(t,n);r.position=o;let a=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",z.RED,Z4);r.billboard=wIe(a);let s=Vu(t,"name",nr.gpx);r.name=s,r.label=zpt(),r.label.text=s,r.description=qZ(t,r),i.clampToGround&&(r.billboard.heightReference=it.CLAMP_TO_GROUND,r.label.heightReference=it.CLAMP_TO_GROUND)}function Gpt(e,t,n,i){let o=WZ(t,n);o.description=qZ(t,o);let r=YZ(t,"rtept",nr.gpx),a=new Array(r.length);for(let s=0;s<r.length;s++)DIe(e,r[s],n,i),a[s]=jZ(r[s]);o.polyline=BIe(i.routeColor),i.clampToGround&&(o.polyline.clampToGround=!0),o.polyline.positions=a}function Vpt(e,t,n,i){let o=WZ(t,n);o.description=qZ(t,o);let r=YZ(t,"trkseg",nr.gpx),a=[],s=[],c,u=!0,f=new fc;for(let h=0;h<r.length;h++)c=Hpt(r[h]),a=a.concat(c.positions),c.times.length>0?(s=s.concat(c.times),f.addSamples(s,a),u=u&&!0):u=!1;if(u){let h=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",z.RED,Z4);o.billboard=wIe(h),o.position=f,i.clampToGround&&(o.billboard.heightReference=it.CLAMP_TO_GROUND),o.availability=new Ea,o.availability.addInterval(new vn({start:s[0],stop:s[s.length-1]}))}o.polyline=BIe(i.trackColor),o.polyline.positions=a,i.clampToGround&&(o.polyline.clampToGround=!0)}function Hpt(e){let t={positions:[],times:[]},n=YZ(e,"trkpt",nr.gpx),i;for(let o=0;o<n.length;o++){let r=jZ(n[o]);t.positions.push(r),i=Vu(n[o],"time",nr.gpx),l(i)&&t.times.push(X.fromIso8601(i))}return t}function Wpt(e){let t=MC(e,"metadata",nr.gpx);if(l(t)){let n={name:Vu(t,"name",nr.gpx),desc:Vu(t,"desc",nr.gpx),author:jpt(t),copyright:qpt(t),link:vIe(t),time:Vu(t,"time",nr.gpx),keywords:Vu(t,"keywords",nr.gpx),bounds:Kpt(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 jpt(e){let t=MC(e,"author",nr.gpx);if(l(t)){let n={name:Vu(t,"name",nr.gpx),email:Ypt(t),link:vIe(t)};if(l(n.name)||l(n.email)||l(n.link))return n}}function Ypt(e){let t=MC(e,"email",nr.gpx);if(l(t)){let n=Vu(t,"id",nr.gpx),i=Vu(t,"domain",nr.gpx);return`${n}@${i}`}}function vIe(e){let t=MC(e,"link",nr.gpx);if(l(t)){let n={href:E2(t,"href"),text:Vu(t,"text",nr.gpx),mimeType:Vu(t,"type",nr.gpx)};if(l(n.href)||l(n.text)||l(n.mimeType))return n}}function qpt(e){let t=MC(e,"copyright",nr.gpx);if(l(t)){let n={author:E2(t,"author"),year:Vu(t,"year",nr.gpx),license:Vu(t,"license",nr.gpx)};if(l(n.author)||l(n.year)||l(n.license))return n}}function Kpt(e){let t=MC(e,"bounds",nr.gpx);if(l(t)){let n={minLat:y2(t,"minlat",nr.gpx),maxLat:y2(t,"maxlat",nr.gpx),minLon:y2(t,"minlon",nr.gpx),maxLon:y2(t,"maxlon",nr.gpx)};if(l(n.minLat)||l(n.maxLat)||l(n.minLon)||l(n.maxLon))return n}}var IIe={wpt:DIe,rte:Gpt,trk:Vpt};function Xpt(e,t,n,i){let o=Object.keys(IIe),r=o.length;for(let a=0;a<r;a++){let s=o[a],c=IIe[s],u=t.childNodes,f=u.length;for(let h=0;h<f;h++){let p=u[h];p.localName===s&&nr.gpx.indexOf(p.namespaceURI)!==-1&&c(e,p,n,i)}}}function xIe(e,t,n){let i=e._entityCollection;i.removeAll();let o=t.documentElement,r=E2(o,"version"),a=E2(o,"creator"),s,c=Wpt(o);l(c)&&(s=c.name),o.localName==="gpx"?Xpt(e,o,i,n):console.log(`GPX - Unsupported node: ${o.localName}`);let u,f=i.computeAvailability(),h=f.start,p=f.stop,A=X.equals(h,Xe.MINIMUM_VALUE),m=X.equals(p,Xe.MAXIMUM_VALUE);if(!A||!m){let y;A&&(y=new Date,y.setHours(0,0,0,0),h=X.fromDate(y)),m&&(y=new Date,y.setHours(24,0,0,0),p=X.fromDate(y)),u=new ym,u.startTime=h,u.stopTime=p,u.currentTime=X.clone(h),u.clockRange=Ia.LOOP_STOP,u.clockStep=Uo.SYSTEM_CLOCK_MULTIPLIER,u.multiplier=Math.round(Math.min(Math.max(X.secondsDifference(p,h)/60,1),31556900))}let _=!1;return e._name!==s&&(e._name=s,_=!0),e._creator!==a&&(e._creator=a,_=!0),Jpt(e._metadata,c)&&(e._metadata=c,_=!0),e._version!==r&&(e._version=r,_=!0),u!==e._clock&&(_=!0,e._clock=u),_&&e._changed.raiseEvent(e),ba.setLoading(e,!1),e}function Jpt(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 Zpt(e,t,n,i){i=i??V.EMPTY_OBJECT;let o=n;if(typeof n=="string"||n instanceof De){n=De.createIfNeeded(n),o=n.fetchBlob();let r=e._resourceCredits,a=n.credits;if(l(a)){let s=a.length;for(let c=0;c<s;c++)r.push(a[c])}}return Promise.resolve(o).then(function(r){return r instanceof Blob?Upt(r).then(function(a){let s,c;try{s=SIe.parseFromString(a,"application/xml")}catch(u){c=u.toString()}if(l(c)||s.body||s.documentElement.tagName==="parsererror"){let u=l(c)?c:s.documentElement.firstChild.nodeValue;throw u||(u=s.body.innerText),new ue(u)}return xIe(e,s,i)}):xIe(e,r,i)}).catch(function(r){return e._error.raiseEvent(e,r),console.log(r),Promise.reject(r)})}function Ow(){this._changed=new _e,this._error=new _e,this._loading=new _e,this._clock=void 0,this._entityCollection=new Vs(this),this._entityCluster=new Rf,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new g_}Ow.load=function(e,t){return new Ow().load(e,t)};Object.defineProperties(Ow.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}}});Ow.prototype.update=function(e){return!0};Ow.prototype.load=function(e,t){if(!l(e))throw new de("data is required.");t=t??V.EMPTY_OBJECT,ba.setLoading(this,!0);let n=this._name,i=this;return Zpt(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),a=r.start,s=r.stop,c=X.equals(a,Xe.MINIMUM_VALUE),u=X.equals(s,Xe.MAXIMUM_VALUE);if(!c||!u){let h;c&&(h=new Date,h.setHours(0,0,0,0),a=X.fromDate(h)),u&&(h=new Date,h.setHours(24,0,0,0),s=X.fromDate(h)),o=new ym,o.startTime=a,o.stopTime=s,o.currentTime=X.clone(a),o.clockRange=Ia.LOOP_STOP,o.clockStep=Uo.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(X.secondsDifference(s,a)/60,1),31556900))}let f=!1;return o!==i._clock&&(i._clock=o,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),ba.setLoading(i,!1),i}).catch(function(o){return ba.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};var b2=Ow;function $pt(e,t){this.position=e,this.headingPitchRoll=t}var I2=$pt;var HIe=Wr(HZ(),1),D2=Wr(rf(),1);function eAt(e,t){this.position=e,this.headingPitchRange=t}var x2=eAt;function $4(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new _e,this.tourEnd=new _e,this.entryStart=new _e,this.entryEnd=new _e,this._activeEntries=[]}$4.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};$4.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;RIe.call(this,e,t,function(i){n.playlistIndex=0,i||PIe(n._activeEntries),n.tourEnd.raiseEvent(i)})};$4.prototype.stop=function(){PIe(this._activeEntries)};function PIe(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function RIe(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let o=tAt.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 a=r._activeEntries.indexOf(i);a>=0&&r._activeEntries.splice(a,1)}),o(e,t,n)}}else l(n)&&n(!1)}function tAt(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++,RIe.call(this,e,t,n)}}var T2=$4;var eo=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-eo.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?eo.Bounce.In(e*2)*.5:eo.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}}}}),S2=function(){return performance.now()},nAt=(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 a=r[o];(t=a._group)===null||t===void 0||t.remove(a),a._group=this,this._tweens[a.getId()]=a,this._tweensAddedDuringUpdate[a.getId()]=a}},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=S2()),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]],a=!n;r&&r.update(t,a)===!1&&!n&&this.remove(r)}i=Object.keys(this._tweensAddedDuringUpdate)}},e})(),Fw={Linear:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=Fw.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=Fw.Utils.Bernstein,a=0;a<=i;a++)n+=o(1-t,i-a)*o(t,a)*e[a]*r(i,a);return n},CatmullRom:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=Fw.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=Fw.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,a=(i-t)*.5,s=o*o,c=o*s;return(2*t-2*n+r+a)*c+(-3*t+3*n-2*r-a)*s+r*o+t}}},MIe=(function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e})(),KZ=new nAt,NIe=(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=eo.Linear.None,this._interpolationFunction=Fw.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=MIe.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=KZ,KZ.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=S2()),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 a in i){var s=t[a],c=Array.isArray(s),u=c?"array":typeof s,f=!c&&Array.isArray(i[a]);if(!(u==="undefined"||u==="function")){if(f){var h=i[a];if(h.length===0)continue;for(var p=[s],A=0,m=h.length;A<m;A+=1){var _=this._handleRelativeValue(s,h[A]);if(isNaN(_)){f=!1,console.warn("Found invalid interpolation list. Skipping.");break}p.push(_)}f&&(i[a]=p)}if((u==="object"||c)&&s&&!f){n[a]=c?[]:{};var y=s;for(var C in y)n[a][C]=y[C];o[a]=c?[]:{};var h=i[a];if(!this._isDynamic){var E={};for(var C in h)E[C]=h[C];i[a]=h=E}this._setupProperties(y,n[a],h,o[a],r)}else(typeof n[a]>"u"||r)&&(n[a]=s),c||(n[a]*=1),f?o[a]=i[a].slice().reverse():o[a]=n[a]||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=S2()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=S2()),!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=eo.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=Fw.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=S2()),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 a=t-this._startTime,s=this._duration+((o=this._repeatDelayTime)!==null&&o!==void 0?o:this._delayTime),c=this._duration+this._repeat*s,u=function(){if(i._duration===0||a>c)return 1;var _=Math.trunc(a/s),y=a-_*s,C=Math.min(y/i._duration,1);return C===0&&a===i._duration?1:C},f=u(),h=this._easingFunction(f);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,h),this._onUpdateCallback&&this._onUpdateCallback(this._object,f),this._duration===0||a>=this._duration)if(this._repeat>0){var p=Math.min(Math.trunc((a-this._duration)/s)+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+=s*p,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var A=0,m=this._chainedTweens.length;A<m;A++)this._chainedTweens[A].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 a=n[r]||0,s=i[r],c=Array.isArray(t[r]),u=Array.isArray(s),f=!c&&u;f?t[r]=this._interpolationFunction(s,o):typeof s=="object"&&s?this._updateProperties(t[r],a,s,o):(s=this._handleRelativeValue(a,s),typeof s=="number"&&(t[r]=a+(s-a)*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 _Ii=MIe.nextId,$p=KZ,yIi=$p.getAll.bind($p),CIi=$p.removeAll.bind($p),EIi=$p.add.bind($p),bIi=$p.remove.bind($p),IIi=$p.update.bind($p);var iAt={LINEAR_NONE:eo.Linear.None,QUADRATIC_IN:eo.Quadratic.In,QUADRATIC_OUT:eo.Quadratic.Out,QUADRATIC_IN_OUT:eo.Quadratic.InOut,CUBIC_IN:eo.Cubic.In,CUBIC_OUT:eo.Cubic.Out,CUBIC_IN_OUT:eo.Cubic.InOut,QUARTIC_IN:eo.Quartic.In,QUARTIC_OUT:eo.Quartic.Out,QUARTIC_IN_OUT:eo.Quartic.InOut,QUINTIC_IN:eo.Quintic.In,QUINTIC_OUT:eo.Quintic.Out,QUINTIC_IN_OUT:eo.Quintic.InOut,SINUSOIDAL_IN:eo.Sinusoidal.In,SINUSOIDAL_OUT:eo.Sinusoidal.Out,SINUSOIDAL_IN_OUT:eo.Sinusoidal.InOut,EXPONENTIAL_IN:eo.Exponential.In,EXPONENTIAL_OUT:eo.Exponential.Out,EXPONENTIAL_IN_OUT:eo.Exponential.InOut,CIRCULAR_IN:eo.Circular.In,CIRCULAR_OUT:eo.Circular.Out,CIRCULAR_IN_OUT:eo.Circular.InOut,ELASTIC_IN:eo.Elastic.In,ELASTIC_OUT:eo.Elastic.Out,ELASTIC_IN_OUT:eo.Elastic.InOut,BACK_IN:eo.Back.In,BACK_OUT:eo.Back.Out,BACK_IN_OUT:eo.Back.InOut,BOUNCE_IN:eo.Bounce.In,BOUNCE_OUT:eo.Bounce.Out,BOUNCE_IN_OUT:eo.Bounce.InOut},Ta=Object.freeze(iAt);function e9(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}e9.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 le(this.view.position);t.flyToBoundingSphere(o,i)}};e9.prototype.stop=function(){l(this.activeCamera)&&this.activeCamera.cancelFlight(),l(this.activeCallback)&&this.activeCallback(!0)};e9.prototype.getCameraOptions=function(e){let t={duration:this.duration};return l(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=Ta.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=Pt(t,e)),t};var w2=e9;function XZ(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}XZ.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};XZ.prototype.stop=function(){clearTimeout(this.timeout),l(this.activeCallback)&&this.activeCallback(!0)};var B2=XZ;var WIe={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=wA(t),WIe[t]}},i$;typeof DOMParser<"u"&&(i$=new DOMParser);var oAt=new HIe.default({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),NC=32,LIe=2414016,OIe=1,FIe=16093e3,QIe=.1,kIe=[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"],UIe=["http://www.google.com/kml/ext/2.2"],rAt=["http://www.w3.org/2005/Atom"],Ge={kml:kIe,gx:UIe,atom:rAt,kmlgx:kIe.concat(UIe)},o$={Document:txe,Folder:xAt,Placemark:TAt,NetworkLink:NAt,GroundOverlay:PAt,PhotoOverlay:oxe,ScreenOverlay:vAt,Tour:wAt};function eA(e){this._dataSource=e,this._deferred=Au(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}Object.defineProperties(eA.prototype,{dataSource:{get:function(){return this._dataSource}}});eA.prototype.addNodes=function(e,t){this._stack.push({nodes:e,index:0,processingData:t}),this._used=!0};eA.prototype.addPromise=function(e){this._promises.push(e)};eA.prototype.wait=function(){let e=this._deferred;return this._used||e.resolve(),Promise.all([e.promise,Promise.all(this._promises)])};eA.prototype.process=function(){let e=this._stack.length===1;return e&&(this._started=Hf._getTimestamp()),this._process(e)};eA.prototype._giveUpTime=function(){if(this._timeoutSet)return;this._timeoutSet=!0,this._timeThreshold=50;let e=this;setTimeout(function(){e._timeoutSet=!1,e._started=Hf._getTimestamp(),e._process(!0)},0)};eA.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]};eA.prototype._pop=function(){let e=this._stack;return e.pop(),e.length===0?(this._deferred.resolve(),!1):!0};eA.prototype._process=function(e){let t=this.dataSource,n=this._stack[this._stack.length-1].processingData,i=this._nextNode();for(;l(i);){let o=o$[i.localName];if(l(o)&&(Ge.kml.indexOf(i.namespaceURI)!==-1||Ge.gx.indexOf(i.namespaceURI)!==-1)&&(o(t,i,n,this),this._timeoutSet||Hf._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}i=this._nextNode()}this._pop()&&e&&this._process(!0)};function aAt(e){let t=e.slice(0,Math.min(4,e.size)),n=Au(),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 sAt(e){let t=Au(),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 jIe(e){let t={xsi:"http://www.w3.org/2001/XMLSchema-instance"},n,i,o,r;for(let a in t)t.hasOwnProperty(a)&&(o=RegExp(`[< ]${a}:`),r=`xmlns:${a}=`,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[a]}"`));return l(n)&&(e=n+i),e}function YIe(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}async function cAt(e,t){let n=await e.getData(new JQ);n=jIe(n),n=YIe(n),t.kml=i$.parseFromString(n,"application/xml")}async function JZ(e,t){let n=WIe.detectFromFilename(e.filename)??"application/octet-stream",i=await e.getData(new KQ(n));t[e.filename]=i}function Gf(e,t,n,i){let o=i.keys,r=new D2.default("."),a=e.querySelectorAll(t);for(let s=0;s<a.length;s++){let c=a[s],u=c.getAttribute(n);if(l(u)){let h=new D2.default(u).absoluteTo(r).toString(),p=o.indexOf(h);if(p!==-1){let A=o[p];c.setAttribute(n,i[A]),t==="a"&&c.getAttribute("download")===null&&c.setAttribute("download",A)}}}}function Vf(e,t,n,i){let o=e.querySelectorAll(t);for(let r=0;r<o.length;r++){let a=o[r],s=a.getAttribute(n),c=r$(s,i);l(c)&&a.setAttribute(n,c.url)}}function qIe(e,t,n){let i=bs(e,"id");i=l(i)&&i.length!==0?i:Jn(),l(n)&&(i=n+i);let o=t.getById(i);return l(o)&&(i=Jn(),l(n)&&(i=n+i)),o=t.add(new Zo({id:i})),l(o.kml)||(o.addProperty("kml"),o.kml=new QAt),o}function v2(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function o9(e,t){if(!l(e))return d.fromDegrees(0,0,0,t);let n=e.match(/[^\s,\n]+/g);if(!l(n))return d.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,d.fromDegrees(i,o,r,t)}function t9(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 a=0;a<i;a++)o[r++]=o9(n[a],t);return o}function LC(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 bs(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function to(e,t,n){if(!l(e))return;let i=e.childNodes,o=i.length;for(let r=0;r<o;r++){let a=i[r];if(a.localName===t&&n.indexOf(a.namespaceURI)!==-1)return a}}function zIe(e,t,n){if(!l(e))return;let i=[],o=e.getElementsByTagNameNS("*",t),r=o.length;for(let a=0;a<r;a++){let s=o[a];s.localName===t&&n.indexOf(s.namespaceURI)!==-1&&i.push(s)}return i}function Mm(e,t,n){if(!l(e))return[];let i=[],o=e.childNodes,r=o.length;for(let a=0;a<r;a++){let s=o[a];s.localName===t&&n.indexOf(s.namespaceURI)!==-1&&i.push(s)}return i}function yi(e,t,n){let i=to(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function Un(e,t,n){let i=to(e,t,n);if(l(i))return i.textContent.trim()}function Nm(e,t,n){let i=to(e,t,n);if(l(i)){let o=i.textContent.trim();return o==="1"||/^true$/i.test(o)}}function r$(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 De({url:o});else{let r=new D2.default(t.getUrlComponent()),a=new D2.default(e);o=n[a.absoluteTo(r)],l(o)&&(i=new De({url:o}))}}return l(i)||(i=t.getDerivedResource({url:e})),i}var Hu={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function t$(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?(Hu.maximumRed=r,Hu.red=void 0):(Hu.maximumRed=void 0,Hu.red=0),o>0?(Hu.maximumGreen=o,Hu.green=void 0):(Hu.maximumGreen=void 0,Hu.green=0),i>0?(Hu.maximumBlue=i,Hu.blue=void 0):(Hu.maximumBlue=void 0,Hu.blue=0),Hu.alpha=n,z.fromRandom(Hu)):new z(r,o,i,n)}function tI(e,t,n){let i=Un(e,t,n);if(l(i))return t$(i,Un(e,"colorMode",n)==="random")}function lAt(e){let t=to(e,"TimeStamp",Ge.kmlgx),n=Un(t,"when",Ge.kmlgx);if(!l(t)||!l(n)||n.length===0)return;let i=X.fromIso8601(n),o=new Ea;return o.addInterval(new vn({start:i,stop:Xe.MAXIMUM_VALUE})),o}function uAt(e){let t=to(e,"TimeSpan",Ge.kmlgx);if(!l(t))return;let n,i=to(t,"begin",Ge.kmlgx),o=l(i)?X.fromIso8601(i.textContent):void 0,r=to(t,"end",Ge.kmlgx),a=l(r)?X.fromIso8601(r.textContent):void 0;if(l(o)&&l(a)){if(X.lessThan(a,o)){let s=o;o=a,a=s}n=new Ea,n.addInterval(new vn({start:o,stop:a}))}else l(o)?(n=new Ea,n.addInterval(new vn({start:o,stop:Xe.MAXIMUM_VALUE}))):l(a)&&(n=new Ea,n.addInterval(new vn({start:Xe.MINIMUM_VALUE,stop:a})));return n}function KIe(){let e=new jc;return e.width=NC,e.height=NC,e.scaleByDistance=new Ht(LIe,OIe,FIe,QIe),e.pixelOffsetScaleByDistance=new Ht(LIe,OIe,FIe,QIe),e}function a$(){let e=new Oh;return e.outline=!0,e.outlineColor=z.WHITE,e}function XIe(){let e=new Lh;return e.translucencyByDistance=new Ht(3e6,1,5e6,0),e.pixelOffset=new k(17,0),e.horizontalOrigin=Mi.LEFT,e.font="16px sans-serif",e.style=pr.FILL_AND_OUTLINE,e}function s$(e,t,n,i,o){let r=Un(e,"href",Ge.kml);if(!l(r)||r.length===0)return;if(r.indexOf("root://icons/palette-")===0){let s=r.charAt(21),c=yi(e,"x",Ge.gx)??0,u=yi(e,"y",Ge.gx)??0;c=Math.min(c/32,7),u=7-Math.min(u/32,7);let f=8*u+c;r=`https://maps.google.com/mapfiles/kml/pal${s}/icon${f}.png`}let a=r$(r,n,i);if(o){let s=Un(e,"refreshMode",Ge.kml),c=Un(e,"viewRefreshMode",Ge.kml);s==="onInterval"||s==="onExpire"?It(`kml-refreshMode-${s}`,`KML - Unsupported Icon refreshMode: ${s}`):(c==="onStop"||c==="onRegion")&&It(`kml-refreshMode-${c}`,`KML - Unsupported Icon viewRefreshMode: ${c}`);let u=Un(e,"viewBoundScale",Ge.kml)??1,f=c==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",h=Un(e,"viewFormat",Ge.kml)??f,p=Un(e,"httpQuery",Ge.kml);l(h)&&a.setQueryParameters(af(i9(h))),l(p)&&a.setQueryParameters(af(i9(p)));let A=t._ellipsoid;return l$(a,t.camera,t.canvas,u,t._lastCameraView.bbox,A),a}return a}function fAt(e,t,n,i,o){let r=yi(t,"scale",Ge.kml),a=yi(t,"heading",Ge.kml),s=tI(t,"color",Ge.kml),c=to(t,"Icon",Ge.kml),u=s$(c,e,i,o,!1);l(c)&&!l(u)&&(u=!1);let f=yi(c,"x",Ge.gx),h=yi(c,"y",Ge.gx),p=yi(c,"w",Ge.gx),A=yi(c,"h",Ge.gx),m=to(t,"hotSpot",Ge.kml),_=LC(m,"x"),y=LC(m,"y"),C=bs(m,"xunits"),E=bs(m,"yunits"),b=n.billboard;l(b)||(b=KIe(),n.billboard=b),b.image=u,b.scale=r,b.color=s,(l(f)||l(h)||l(p)||l(A))&&(b.imageSubRegion=new et(f,h,p,A)),l(a)&&a!==0&&(b.rotation=D.toRadians(-a),b.alignedAxis=d.UNIT_Z),r=r??1;let x,S;l(_)&&(C==="pixels"?x=-_*r:C==="insetPixels"?x=(_-NC)*r:C==="fraction"&&(x=-_*NC*r),x+=NC*.5*r),l(y)&&(E==="pixels"?S=y*r:E==="insetPixels"?S=(-y+NC)*r:E==="fraction"&&(S=y*NC*r),S-=NC*.5*r),(l(x)||l(S))&&(b.pixelOffset=new k(x,S))}function n9(e,t,n,i,o){for(let r=0,a=t.childNodes.length;r<a;r++){let s=t.childNodes.item(r);if(s.localName==="IconStyle")fAt(e,s,n,i,o);else if(s.localName==="LabelStyle"){let c=n.label;l(c)||(c=XIe(),n.label=c),c.scale=yi(s,"scale",Ge.kml)??c.scale,c.fillColor=tI(s,"color",Ge.kml)??c.fillColor,c.text=n.name}else if(s.localName==="LineStyle"){let c=n.polyline;l(c)||(c=new qc,n.polyline=c),c.width=yi(s,"width",Ge.kml),c.material=tI(s,"color",Ge.kml),l(tI(s,"outerColor",Ge.gx))&&It("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),l(yi(s,"outerWidth",Ge.gx))&&It("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),l(yi(s,"physicalWidth",Ge.gx))&&It("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),l(Nm(s,"labelVisibility",Ge.gx))&&It("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if(s.localName==="PolyStyle"){let c=n.polygon;l(c)||(c=a$(),n.polygon=c),c.material=tI(s,"color",Ge.kml)??c.material,c.fill=Nm(s,"fill",Ge.kml)??c.fill,c.outline=Nm(s,"outline",Ge.kml)??c.outline}else if(s.localName==="BalloonStyle"){let c=t$(Un(s,"bgColor",Ge.kml))??z.WHITE,u=t$(Un(s,"textColor",Ge.kml))??z.BLACK,f=Un(s,"text",Ge.kml);n.addProperty("balloonStyle"),n.balloonStyle={bgColor:c,textColor:u,text:f}}else if(s.localName==="ListStyle"){let c=Un(s,"listItemType",Ge.kml);(c==="radioFolder"||c==="checkOffOnly")&&It(`kml-listStyle-${c}`,`KML - Unsupported ListStyle with listItemType: ${c}`)}}}function dAt(e,t,n,i,o){let r=new Zo,a,s=-1,c=t.childNodes,u=c.length;for(let h=0;h<u;h++){let p=c[h];(p.localName==="Style"||p.localName==="StyleMap")&&(s=h)}if(s!==-1){let h=c[s];if(h.localName==="Style")n9(e,h,r,i,o);else{let p=Mm(h,"Pair",Ge.kml);for(let A=0;A<p.length;A++){let m=p[A],_=Un(m,"key",Ge.kml);if(_==="normal"){let y=Un(m,"styleUrl",Ge.kml);if(l(y))a=n.getById(y),l(a)||(a=n.getById(`#${y}`)),l(a)&&r.merge(a);else{let C=to(m,"Style",Ge.kml);n9(e,C,r,i,o)}}else It(`kml-styleMap-${_}`,`KML - Unsupported StyleMap key: ${_}`)}}}let f=Un(t,"styleUrl",Ge.kml);if(l(f)){let h=f;if(f[0]!=="#"&&f.indexOf("#")!==-1){let p=f.split("#"),A=p[0];h=`${i.getDerivedResource({url:A}).getUrlComponent()}#${p[1]}`}a=n.getById(h),l(a)||(a=n.getById(`#${h}`)),l(a)&&r.merge(a)}return r}function hAt(e,t,n){return t.fetchXML().then(function(i){return JIe(e,i,n,t,!0)})}function JIe(e,t,n,i,o,r){let a,s,c,u,f=zIe(t,"Style",Ge.kml);if(l(f)){let _=f.length;for(a=0;a<_;a++)u=f[a],s=bs(u,"id"),l(s)&&(s=`#${s}`,o&&l(i)&&(s=i.getUrlComponent()+s),l(n.getById(s))||(c=new Zo({id:s}),n.add(c),n9(e,u,c,i,r)))}let h=zIe(t,"StyleMap",Ge.kml);if(l(h)){let _=h.length;for(a=0;a<_;a++){let y=h[a];if(s=bs(y,"id"),l(s)){let C=Mm(y,"Pair",Ge.kml);for(let E=0;E<C.length;E++){let b=C[E],x=Un(b,"key",Ge.kml);if(x==="normal"){if(s=`#${s}`,o&&l(i)&&(s=i.getUrlComponent()+s),!l(n.getById(s))){c=n.getOrCreateEntity(s);let S=Un(b,"styleUrl",Ge.kml);if(l(S)){S[0]!=="#"&&(S=`#${S}`),o&&l(i)&&(S=i.getUrlComponent()+S);let B=n.getById(S);l(B)&&c.merge(B)}else u=to(b,"Style",Ge.kml),n9(e,u,c,i,r)}}else It(`kml-styleMap-${x}`,`KML - Unsupported StyleMap key: ${x}`)}}}}let p=[],A=t.getElementsByTagName("styleUrl"),m=A.length;for(a=0;a<m;a++){let _=A[a].textContent;if(_[0]!=="#"){let y=_.split("#");if(y.length===2){let C=y[0],E=i.getDerivedResource({url:C});p.push(hAt(e,E,n))}}}return p}function c$(e,t,n){let i=new i_(e,t.id,["position"]),o=new zp(t.position);t.polyline=l(n.polyline)?n.polyline.clone():new qc,t.polyline.positions=new n_([i,o])}function ZIe(e,t){return!l(e)&&!l(t)||e==="clampToGround"?it.CLAMP_TO_GROUND:e==="relativeToGround"?it.RELATIVE_TO_GROUND:e==="absolute"?it.NONE:t==="clampToSeaFloor"?(It("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),it.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(It("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),it.RELATIVE_TO_GROUND):(l(e)?It("kml-altitudeMode-unknown",`KML - Unknown <kml:altitudeMode>:${e}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`):It("kml-gx:altitudeMode-unknown",`KML - Unknown <gx:altitudeMode>:${t}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`),it.CLAMP_TO_GROUND)}function mAt(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&It("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`),new zp(e))}function pAt(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")&&It("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`);let o=e.length;for(let r=0;r<o;r++){let a=e[r];i.scaleToGeodeticSurface(a,a)}return e}function r9(e,t,n,i){let o=t.label;l(o)||(o=l(n.label)?n.label.clone():XIe(),t.label=o),o.text=t.name;let r=t.billboard;l(r)||(r=l(n.billboard)?n.billboard.clone():KIe(),t.billboard=r),l(r.image)?r.image.getValue()||(r.image=void 0):r.image=e._pinBuilder.fromColor(z.YELLOW,64);let a=1;l(r.scale)&&(a=r.scale.getValue(),a!==0?o.pixelOffset=new k(a*16+1,0):(o.pixelOffset=void 0,o.horizontalOrigin=void 0)),l(i)&&e._clampToGround&&(r.heightReference=i,o.heightReference=i)}function $Ie(e,t){let n=e.path;l(n)||(n=new YA,n.leadTime=0,e.path=n);let i=t.polyline;l(i)&&(n.material=i.material,n.width=i.width)}function AAt(e,t,n,i,o){let r=Un(n,"coordinates",Ge.kml),a=Un(n,"altitudeMode",Ge.kml),s=Un(n,"altitudeMode",Ge.gx),c=Nm(n,"extrude",Ge.kml),u=e._ellipsoid,f=o9(r,u);return i.position=f,r9(e,i,o,ZIe(a,s)),c&&v2(a,s)&&c$(t,i,o),!0}function GIe(e,t,n,i,o){let r=to(n,"coordinates",Ge.kml),a=Un(n,"altitudeMode",Ge.kml),s=Un(n,"altitudeMode",Ge.gx),c=Nm(n,"extrude",Ge.kml),u=Nm(n,"tessellate",Ge.kml),f=v2(a,s),h=yi(n,"drawOrder",Ge.gx),p=e._ellipsoid,A=t9(r,p),m=o.polyline;if(f&&c){let _=new qA;i.wall=_,_.positions=A;let y=o.polygon;l(y)&&(_.fill=y.fill,_.material=y.material),_.outline=!0,l(m)?(_.outlineColor=l(m.material)?m.material.color:z.WHITE,_.outlineWidth=m.width):l(y)&&(_.outlineColor=l(y.material)?y.material.color:z.WHITE)}else if(e._clampToGround&&!f&&u){let _=new qc;_.clampToGround=!0,i.polyline=_,_.positions=A,l(m)?(_.material=l(m.material)?m.material.color.getValue(Xe.MINIMUM_VALUE):z.WHITE,_.width=m.width??1):(_.material=z.WHITE,_.width=1),_.zIndex=h}else l(h)&&It("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!u&&It("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),m=l(m)?m.clone():new qc,i.polyline=m,m.positions=pAt(A,a,s,p),(!u||f)&&(m.arcType=ln.NONE);return!0}function gAt(e,t,n,i,o){let r=to(n,"outerBoundaryIs",Ge.kml),a=to(r,"LinearRing",Ge.kml),s=to(a,"coordinates",Ge.kml),c=e._ellipsoid,u=t9(s,c),f=Nm(n,"extrude",Ge.kml),h=Un(n,"altitudeMode",Ge.kml),p=Un(n,"altitudeMode",Ge.gx),A=v2(h,p),m=l(o.polygon)?o.polygon.clone():a$(),_=o.polyline;if(l(_)&&(m.outlineColor=l(_.material)?_.material.color:z.WHITE,m.outlineWidth=_.width),i.polygon=m,A?(m.perPositionHeight=!0,m.extrudedHeight=f?0:void 0):e._clampToGround||(m.height=0),l(u)){let y=new wc(u),C=Mm(n,"innerBoundaryIs",Ge.kml);for(let E=0;E<C.length;E++){a=Mm(C[E],"LinearRing",Ge.kml);for(let b=0;b<a.length;b++)s=to(a[b],"coordinates",Ge.kml),u=t9(s,c),l(u)&&y.holes.push(new wc(u))}m.hierarchy=y}return!0}function _At(e,t,n,i,o){let r=Un(n,"altitudeMode",Ge.kml),a=Un(n,"altitudeMode",Ge.gx),s=Mm(n,"coord",Ge.gx),c=Mm(n,"angles",Ge.gx),u=Mm(n,"when",Ge.kml),f=Nm(n,"extrude",Ge.kml),h=v2(r,a),p=e._ellipsoid;c.length>0&&It("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let A=Math.min(s.length,u.length),m=[],_=[];for(let C=0;C<A;C++){let E=o9(s[C].textContent,p);m.push(E),_.push(X.fromIso8601(u[C].textContent))}let y=new fc;return y.addSamples(_,m),i.position=y,r9(e,i,o,ZIe(r,a)),$Ie(i,o),i.availability=new Ea,u.length>0&&i.availability.addInterval(new vn({start:_[0],stop:_[_.length-1]})),h&&f&&c$(t,i,o),!0}function VIe(e,t,n,i,o,r,a,s,c){let u=e[0],f=e[e.length-1],h=new fc;h.addSamples(e,t),n.intervals.addInterval(new vn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:mAt(h,a,s)})),i.addInterval(new vn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c})),o.intervals.addInterval(new vn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:r}))}function yAt(e,t,n,i,o){let r=Nm(n,"interpolate",Ge.gx),a=Mm(n,"Track",Ge.gx),s,c,u,f=!1,h=new r_,p=new Ea,A=new lc,m=e._ellipsoid;for(let _=0,y=a.length;_<y;_++){let C=a[_],E=Mm(C,"when",Ge.kml),b=Mm(C,"coord",Ge.gx),x=Un(C,"altitudeMode",Ge.kml),S=Un(C,"altitudeMode",Ge.gx),B=v2(x,S),v=Nm(C,"extrude",Ge.kml),P=Math.min(b.length,E.length),N=[];s=[];for(let L=0;L<P;L++){let g=o9(b[L].textContent,m);N.push(g),s.push(X.fromIso8601(E[L].textContent))}r&&(l(c)&&VIe([c,s[0]],[u,N[0]],A,p,h,!1,"absolute",void 0,!1),c=s[P-1],u=N[N.length-1]),VIe(s,N,A,p,h,B&&v,x,S,!0),f=f||B&&v}return i.availability=p,i.position=A,r9(e,i,o),$Ie(i,o),f&&(c$(t,i,o),i.polyline.show=h),!0}var exe={Point:AAt,LineString:GIe,LinearRing:GIe,Polygon:gAt,Track:_At,MultiTrack:yAt,MultiGeometry:CAt,Model:EAt};function CAt(e,t,n,i,o,r){let a=n.childNodes,s=!1;for(let c=0,u=a.length;c<u;c++){let f=a.item(c),h=exe[f.localName];if(l(h)){let p=qIe(f,t,r);p.parent=i,p.name=i.name,p.availability=i.availability,p.description=i.description,p.kml=i.kml,h(e,t,f,p,o)&&(s=!0)}}return s}function EAt(e,t,n,i,o){return It("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function bAt(e,t){let n=to(e,"ExtendedData",Ge.kml);if(!l(n))return;l(to(n,"SchemaData",Ge.kml))&&It("kml-schemaData","KML - SchemaData is unsupported"),l(bs(n,"xmlns:prefix"))&&It("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");let i={},o=Mm(n,"Data",Ge.kml);if(l(o)){let r=o.length;for(let a=0;a<r;a++){let s=o[a],c=bs(s,"name");l(c)&&(i[c]={displayName:Un(s,"displayName",Ge.kml),value:Un(s,"value",Ge.kml)})}}t.kml.extendedData=i}var zo;typeof document<"u"&&(zo=document.createElement("div"));function IAt(e,t,n,i,o){let r,a,s,c=t.kml,u=c.extendedData,f=Un(e,"description",Ge.kml),h=t.balloonStyle??n.balloonStyle,p=z.WHITE,A=z.BLACK,m=f;l(h)&&(p=h.bgColor??z.WHITE,A=h.textColor??z.BLACK,m=h.text??f);let _;if(l(m)){if(m=m.replace("$[name]",t.name??""),m=m.replace("$[description]",f??""),m=m.replace("$[address]",c.address??""),m=m.replace("$[Snippet]",c.snippet??""),m=m.replace("$[id]",t.id),m=m.replace("$[geDirections]",""),l(u)){let E=m.match(/\$\[.+?\]/g);if(E!==null)for(r=0;r<E.length;r++){let b=E[r],x=b.substr(2,b.length-3),S=/\/displayName$/.test(x);x=x.replace(/\/displayName$/,""),_=u[x],l(_)&&(_=S?_.displayName:_.value),l(_)&&(m=m.replace(b,_??""))}}}else if(l(u)&&(s=Object.keys(u),s.length>0)){for(m='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',r=0;r<s.length;r++)a=s[r],_=u[a],m+=`<tr><th>${_.displayName??a}</th><td>${_.value??""}</td></tr>`;m+="</tbody></table>"}if(!l(m))return;m=oAt.link(m),zo.innerHTML=m;let y=zo.querySelectorAll("a");for(r=0;r<y.length;r++)y[r].setAttribute("target","_blank");l(i)&&i.keys.length>1&&(Gf(zo,"a","href",i),Gf(zo,"link","href",i),Gf(zo,"area","href",i),Gf(zo,"img","src",i),Gf(zo,"iframe","src",i),Gf(zo,"video","src",i),Gf(zo,"audio","src",i),Gf(zo,"source","src",i),Gf(zo,"track","src",i),Gf(zo,"input","src",i),Gf(zo,"embed","src",i),Gf(zo,"script","src",i),Gf(zo,"video","poster",i)),Vf(zo,"a","href",o),Vf(zo,"link","href",o),Vf(zo,"area","href",o),Vf(zo,"img","src",o),Vf(zo,"iframe","src",o),Vf(zo,"video","src",o),Vf(zo,"audio","src",o),Vf(zo,"source","src",o),Vf(zo,"track","src",o),Vf(zo,"input","src",o),Vf(zo,"embed","src",o),Vf(zo,"script","src",o),Vf(zo,"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:${A.toCssColorString()};`,C+='">',C+=`${zo.innerHTML}</div>`,zo.innerHTML="",t.description=C}function a9(e,t,n){let i=n.entityCollection,o=n.parentEntity,r=n.sourceResource,a=n.uriResolver,s=qIe(t,i,n.context),c=s.kml,u=dAt(e,t,n.styleCollection,r,a),f=Un(t,"name",Ge.kml);s.name=f,s.parent=o;let h=uAt(t);l(h)||(h=lAt(t)),s.availability=h,f$(s);function p(b){return b?b.show&&p(b.parent):!0}let A=Nm(t,"visibility",Ge.kml);s.show=p(o)&&(A??!0);let m=to(t,"author",Ge.atom),_=c.author;_.name=Un(m,"name",Ge.atom),_.uri=Un(m,"uri",Ge.atom),_.email=Un(m,"email",Ge.atom);let y=to(t,"link",Ge.atom),C=c.link;C.href=bs(y,"href"),C.hreflang=bs(y,"hreflang"),C.rel=bs(y,"rel"),C.type=bs(y,"type"),C.title=bs(y,"title"),C.length=bs(y,"length"),c.address=Un(t,"address",Ge.kml),c.phoneNumber=Un(t,"phoneNumber",Ge.kml),c.snippet=Un(t,"Snippet",Ge.kml),bAt(t,s),IAt(t,s,u,a,r);let E=e._ellipsoid;return ixe(t,s,E),nxe(t,s,E),l(to(t,"Region",Ge.kml))&&It("kml-region","KML - Placemark Regions are unsupported"),{entity:s,styleEntity:u}}function txe(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function xAt(e,t,n,i){let o=a9(e,t,n),r=je(n);r.parentEntity=o.entity,txe(e,t,r,i)}function TAt(e,t,n,i){let o=a9(e,t,n),r=o.entity,a=o.styleEntity,s=!1,c=t.childNodes;for(let u=0,f=c.length;u<f&&!s;u++){let h=c.item(u),p=exe[h.localName];l(p)&&(p(e,n.entityCollection,h,r,a,r.id),s=!0)}s||(r.merge(a),r9(e,r,a))}var SAt={FlyTo:DAt,Wait:BAt,SoundCue:ZZ,AnimatedUpdate:ZZ,TourControl:ZZ};function wAt(e,t,n,i){let o=Un(t,"name",Ge.kml),r=bs(t,"id"),a=new T2(o,r),s=to(t,"Playlist",Ge.gx);if(s){let c=e._ellipsoid,u=s.childNodes;for(let f=0;f<u.length;f++){let h=u[f];if(h.localName){let p=SAt[h.localName];p?p(a,h,c):console.log(`Unknown KML Tour playlist entry type ${h.localName}`)}}}e._kmlTours.push(a)}function ZZ(e,t){It(`KML Tour unsupported node ${t.localName}`)}function BAt(e,t){let n=yi(t,"duration",Ge.gx);e.addPlaylistEntry(new B2(n))}function DAt(e,t,n){let i=yi(t,"duration",Ge.gx),o=Un(t,"flyToMode",Ge.gx),r={kml:{}};ixe(t,r,n),nxe(t,r,n);let a=r.kml.lookAt||r.kml.camera,s=new w2(i,o,a);e.addPlaylistEntry(s)}function nxe(e,t,n){let i=to(e,"Camera",Ge.kml);if(l(i)){let o=yi(i,"longitude",Ge.kml)??0,r=yi(i,"latitude",Ge.kml)??0,a=yi(i,"altitude",Ge.kml)??0,s=yi(i,"heading",Ge.kml)??0,c=yi(i,"tilt",Ge.kml)??0,u=yi(i,"roll",Ge.kml)??0,f=d.fromDegrees(o,r,a,n),h=Ec.fromDegrees(s,c-90,u);t.kml.camera=new I2(f,h)}}function ixe(e,t,n){let i=to(e,"LookAt",Ge.kml);if(l(i)){let o=yi(i,"longitude",Ge.kml)??0,r=yi(i,"latitude",Ge.kml)??0,a=yi(i,"altitude",Ge.kml)??0,s=yi(i,"heading",Ge.kml),c=yi(i,"tilt",Ge.kml),u=yi(i,"range",Ge.kml)??0;c=D.toRadians(c??0),s=D.toRadians(s??0);let f=new th(s,c-D.PI_OVER_TWO,u),h=d.fromDegrees(o,r,a,n);t.kml.lookAt=new x2(h,f)}}function vAt(e,t,n,i){let o=n.screenOverlayContainer;if(!l(o))return;let r=n.sourceResource,a=n.uriResolver,s=to(t,"Icon",Ge.kml),c=s$(s,e,r,a,!1);if(!l(c))return;let u=document.createElement("img");e._screenOverlays.push(u),u.src=c.url,u.onload=function(){let f=["position: absolute"],h=to(t,"screenXY",Ge.kml),p=to(t,"overlayXY",Ge.kml),A=to(t,"size",Ge.kml),m,_,y,C,E,b;l(A)&&(m=LC(A,"x"),_=LC(A,"y"),y=bs(A,"xunits"),C=bs(A,"yunits"),l(m)&&m!==-1&&m!==0&&(y==="fraction"?E=`width: ${Math.floor(m*100)}%`:y==="pixels"&&(E=`width: ${m}px`),f.push(E)),l(_)&&_!==-1&&_!==0&&(C==="fraction"?b=`height: ${Math.floor(_*100)}%`:C==="pixels"&&(b=`height: ${_}px`),f.push(b))),u.style=f.join(";");let x=0,S=u.height;l(p)&&(m=LC(p,"x"),_=LC(p,"y"),y=bs(p,"xunits"),C=bs(p,"yunits"),l(m)&&(y==="fraction"?x=m*u.width:(y==="pixels"||y==="insetPixels")&&(x=m)),l(_)&&(C==="fraction"?S=_*u.height:(C==="pixels"||C==="insetPixels")&&(S=_))),l(h)&&(m=LC(h,"x"),_=LC(h,"y"),y=bs(h,"xunits"),C=bs(h,"yunits"),l(m)&&(y==="fraction"?E=`left: calc(${Math.floor(m*100)}% - ${x}px)`:y==="pixels"?E=`left: ${m-x}px`:y==="insetPixels"&&(E=`right: ${m-x}px`),f.push(E)),l(_)&&(C==="fraction"?b=`bottom: calc(${Math.floor(_*100)}% - ${S}px)`:C==="pixels"?b=`bottom: ${_-S}px`:C==="insetPixels"&&(b=`top: ${_-S}px`),f.push(b))),u.style=f.join(";")},o.appendChild(u)}function PAt(e,t,n,i){let r=a9(e,t,n).entity,a,s=!1,c=e._ellipsoid,u=t9(to(t,"LatLonQuad",Ge.gx),c),f=yi(t,"drawOrder",Ge.kml);if(l(u))a=a$(),a.hierarchy=new wc(u),a.zIndex=f,r.polygon=a,s=!0;else{a=new Fh,a.zIndex=f,r.rectangle=a;let m=to(t,"LatLonBox",Ge.kml);if(l(m)){let _=yi(m,"west",Ge.kml),y=yi(m,"south",Ge.kml),C=yi(m,"east",Ge.kml),E=yi(m,"north",Ge.kml);l(_)&&(_=D.negativePiToPi(D.toRadians(_))),l(y)&&(y=D.clampToLatitudeRange(D.toRadians(y))),l(C)&&(C=D.negativePiToPi(D.toRadians(C))),l(E)&&(E=D.clampToLatitudeRange(D.toRadians(E))),a.coordinates=new ce(_,y,C,E);let b=yi(m,"rotation",Ge.kml);if(l(b)){let x=D.toRadians(b);a.rotation=x,a.stRotation=x}}}let h=to(t,"Icon",Ge.kml),p=s$(h,e,n.sourceResource,n.uriResolver,!0);if(l(p)){s&&It("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");let m=yi(h,"x",Ge.gx),_=yi(h,"y",Ge.gx),y=yi(h,"w",Ge.gx),C=yi(h,"h",Ge.gx);(l(m)||l(_)||l(y)||l(C))&&It("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),a.material=p,a.material.color=tI(t,"color",Ge.kml),a.material.transparent=!0}else a.material=tI(t,"color",Ge.kml);let A=Un(t,"altitudeMode",Ge.kml);l(A)?A==="absolute"?(a.height=yi(t,"altitude",Ge.kml),a.zIndex=void 0):A!=="clampToGround"&&It("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${A}`):(A=Un(t,"altitudeMode",Ge.gx),A==="relativeToSeaFloor"?(It("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),a.height=yi(t,"altitude",Ge.kml),a.zIndex=void 0):A==="clampToSeaFloor"?It("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):l(A)&&It("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${A}`))}function oxe(e,t,n,i){e._unsupportedNode.raiseEvent(e,n.parentEntity,t,n.entityCollection,n.styleCollection,n.sourceResource,n.uriResolver),It(`kml-unsupportedFeature-${t.nodeName}`,`KML - Unsupported feature: ${t.nodeName}`)}var OC={INTERVAL:0,EXPIRE:1,STOP:2};function i9(e){if(!l(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var RAt=new ce,Qw=new me,$Z=new k,MAt=new d;function l$(e,t,n,i,o,r){function a(u){return u<-D.PI_OVER_TWO?-D.PI_OVER_TWO:u>D.PI_OVER_TWO?D.PI_OVER_TWO:u}function s(u){return u>D.PI?u-D.TWO_PI:u<-D.PI?u+D.TWO_PI:u}let c=pE(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==oe.MORPHING){let u,f;if(o=o??RAt,l(n)&&($Z.x=n.clientWidth*.5,$Z.y=n.clientHeight*.5,u=t.pickEllipsoid($Z,r,MAt)),l(u)?f=r.cartesianToCartographic(u,Qw):(f=ce.center(o,Qw),u=r.cartographicToCartesian(f)),l(i)&&!D.equalsEpsilon(i,1,D.EPSILON9)){let C=o.width*i*.5,E=o.height*i*.5;o=new ce(s(f.longitude-C),a(f.latitude-E),s(f.longitude+C),a(f.latitude+E))}c=c.replace("[bboxWest]",D.toDegrees(o.west).toString()),c=c.replace("[bboxSouth]",D.toDegrees(o.south).toString()),c=c.replace("[bboxEast]",D.toDegrees(o.east).toString()),c=c.replace("[bboxNorth]",D.toDegrees(o.north).toString());let h=D.toDegrees(f.longitude).toString(),p=D.toDegrees(f.latitude).toString();c=c.replace("[lookatLon]",h),c=c.replace("[lookatLat]",p),c=c.replace("[lookatTilt]",D.toDegrees(t.pitch).toString()),c=c.replace("[lookatHeading]",D.toDegrees(t.heading).toString()),c=c.replace("[lookatRange]",d.distance(t.positionWC,u)),c=c.replace("[lookatTerrainLon]",h),c=c.replace("[lookatTerrainLat]",p),c=c.replace("[lookatTerrainAlt]",f.height.toString()),r.cartesianToCartographic(t.positionWC,Qw),c=c.replace("[cameraLon]",D.toDegrees(Qw.longitude).toString()),c=c.replace("[cameraLat]",D.toDegrees(Qw.latitude).toString()),c=c.replace("[cameraAlt]",D.toDegrees(Qw.height).toString());let A=t.frustum,m=A.aspectRatio,_="",y="";if(l(m)){let C=D.toDegrees(A.fov);m>1?(_=C,y=C/m):(y=C,_=C*m)}c=c.replace("[horizFov]",_.toString()),c=c.replace("[vertFov]",y.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(af(c))}function NAt(e,t,n,i){let r=a9(e,t,n).entity,a=n.sourceResource,s=n.uriResolver,c=to(t,"Link",Ge.kml);if(l(c)||(c=to(t,"Url",Ge.kml)),l(c)){let u=Un(c,"href",Ge.kml),f,h;if(l(u)){let p=u;if(u=r$(u,a,n.uriResolver),/^data:/.test(u.getUrlComponent()))/\.kmz/i.test(a.getUrlComponent())||(p=a.getDerivedResource({url:p}));else{if(p=u.clone(),f=Un(c,"viewRefreshMode",Ge.kml),f==="onRegion"){It("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}h=Un(c,"viewBoundScale",Ge.kml)??1;let y=f==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",C=Un(c,"viewFormat",Ge.kml)??y,E=Un(c,"httpQuery",Ge.kml);l(C)&&u.setQueryParameters(af(i9(C))),l(E)&&u.setQueryParameters(af(i9(E)));let b=e._ellipsoid;l$(u,e.camera,e.canvas,h,e._lastCameraView.bbox,b)}let A={sourceUri:p,uriResolver:s,context:r.id,screenOverlayContainer:n.screenOverlayContainer},m=new Vs,_=u$(e,m,u,A).then(function(y){let C=e._entityCollection,E=m.values;C.suspendEvents();for(let S=0;S<E.length;S++){let B=E[S];l(B.parent)||(B.parent=r,f$(B)),C.add(B)}C.resumeEvents();let b=Un(c,"refreshMode",Ge.kml),x=yi(c,"refreshInterval",Ge.kml)??0;if(b==="onInterval"&&x>0||b==="onExpire"||f==="onStop"){let S=to(y,"NetworkLinkControl",Ge.kml),B=l(S),v=X.now(),P={id:Jn(),href:u,cookie:{},lastUpdated:v,updating:!1,entity:r,viewBoundScale:h,needsUpdate:!1,cameraUpdateTime:v},N=0;if(B&&(P.cookie=af(Un(S,"cookie",Ge.kml)??""),N=yi(S,"minRefreshPeriod",Ge.kml)??0),b==="onInterval")B&&(x=Math.max(N,x)),P.refreshMode=OC.INTERVAL,P.time=x;else if(b==="onExpire"){let L;if(B&&(L=Un(S,"expires",Ge.kml)),l(L))try{let g=X.fromIso8601(L),I=X.secondsDifference(g,v);I>0&&I<N&&X.addSeconds(v,N,g),P.refreshMode=OC.EXPIRE,P.time=g}catch{It("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else It("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else l(e.camera)?(P.refreshMode=OC.STOP,P.time=yi(c,"viewRefreshTime",Ge.kml)??0):It("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(y){It(`An error occured during loading ${u.url}`),e._error.raiseEvent(e,y)});i.addPromise(_)}}}function LAt(e,t,n,i){let o=o$[t.localName];return l(o)?o(e,t,n,i):oxe(e,t,n,i)}function n$(e,t,n,i,o,r,a){t.removeAll();let s=n.documentElement,c=s.localName==="Document"?s:to(s,"Document",Ge.kml),u=Un(c,"name",Ge.kml);l(u)||(u=e_(i.getUrlComponent())),l(e._name)||(e._name=u);let f=new Hf._DeferredLoading(e),h=new Vs(e);return Promise.all(JIe(e,n,h,i,!1,o)).then(function(){let p=n.documentElement;if(p.localName==="kml"){let m=p.childNodes;for(let _=0;_<m.length;_++){let y=m[_];if(l(o$[y.localName])){p=y;break}}}let A={parentEntity:void 0,entityCollection:t,styleCollection:h,sourceResource:i,uriResolver:o,context:a,screenOverlayContainer:r};return t.suspendEvents(),LAt(e,p,A,f),t.resumeEvents(),f.wait().then(function(){return n.documentElement})})}async function OAt(e,t,n,i,o){let r=Zt("ThirdParty/Workers/zip-web-worker.js"),a=Zt("ThirdParty/zip-module.wasm");_w({workerURI:r,wasmURI:a});let s=new Hb(new Hp(n)),c=await s.getEntries(),u=[],f={},h;for(let p=0;p<c.length;p++){let A=c[p];A.directory||(/\.kml$/i.test(A.filename)&&(!l(h)||!/\//i.test(A.filename))?(l(h)&&u.push(JZ(h,f)),h=A):u.push(JZ(A,f)))}if(l(h)&&u.push(cAt(h,f)),await Promise.all(u),s.close(),!l(f.kml))throw new ue("KMZ file does not contain a KML document.");return f.keys=Object.keys(f),n$(e,t,f.kml,i,f,o)}function u$(e,t,n,i){i=i??V.EMPTY_OBJECT;let o=i.sourceUri,r=i.uriResolver,a=i.context,s=i.screenOverlayContainer,c=n;if(typeof n=="string"||n instanceof De){n=De.createIfNeeded(n),c=n.fetchBlob(),o=o??n.clone();let u=e._resourceCredits,f=n.credits;if(l(f)){let h=f.length;for(let p=0;p<h;p++)u.push(f[p])}}else o=o??De.DEFAULT.clone();return o=De.createIfNeeded(o),l(s)&&(s=kn(s)),Promise.resolve(c).then(function(u){return u instanceof Blob?aAt(u).then(function(f){return f?OAt(e,t,u,o,s):sAt(u).then(function(h){h=jIe(h),h=YIe(h);let p,A;try{p=i$.parseFromString(h,"application/xml")}catch(m){A=m.toString()}if(l(A)||p.body||p.documentElement.tagName==="parsererror"){let m=l(A)?A:p.documentElement.firstChild.nodeValue;throw m||(m=p.body.innerText),new ue(m)}return n$(e,t,p,o,r,s,a)})}):n$(e,t,u,o,r,s,a)}).catch(function(u){return e._error.raiseEvent(e,u),console.log(u),Promise.reject(u)})}function Hf(e){e=e??V.EMPTY_OBJECT;let t=e.camera,n=e.canvas;this._changed=new _e,this._error=new _e,this._loading=new _e,this._refresh=new _e,this._unsupportedNode=new _e,this._clock=void 0,this._entityCollection=new Vs(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new g_,this._networkLinks=new Ot,this._entityCluster=new Rf,this.canvas=n,this.camera=t,this._lastCameraView={position:l(t)?d.clone(t.positionWC):void 0,direction:l(t)?d.clone(t.directionWC):void 0,up:l(t)?d.clone(t.upWC):void 0,bbox:l(t)?t.computeViewRectangle():ce.clone(ce.MAX_VALUE)},this._ellipsoid=e.ellipsoid??te.default;let i=e.credit;typeof i=="string"&&(i=new Et(i)),this._credit=i,this._resourceCredits=[],this._kmlTours=[],this._screenOverlays=[]}Hf.load=function(e,t){return t=t??V.EMPTY_OBJECT,new Hf(t).load(e,t)};Object.defineProperties(Hf.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}}});Hf.prototype.load=function(e,t){t=t??V.EMPTY_OBJECT,ba.setLoading(this,!0);let n=this._name;this._name=void 0,this._clampToGround=t.clampToGround??!1;let i=this;return u$(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),a=r.start,s=r.stop,c=X.equals(a,Xe.MINIMUM_VALUE),u=X.equals(s,Xe.MAXIMUM_VALUE);if(!c||!u){let h;c&&(h=new Date,h.setHours(0,0,0,0),a=X.fromDate(h)),u&&(h=new Date,h.setHours(24,0,0,0),s=X.fromDate(h)),o=new ym,o.startTime=a,o.stopTime=s,o.currentTime=X.clone(a),o.clockRange=Ia.LOOP_STOP,o.clockStep=Uo.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(X.secondsDifference(s,a)/60,1),31556900))}let f=!1;return o!==i._clock&&(i._clock=o,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),ba.setLoading(i,!1),i}).catch(function(o){return ba.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};Hf.prototype.destroy=function(){for(;this._screenOverlays.length>0;)this._screenOverlays.pop().remove()};function f$(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 FAt(e,t,n,i,o){return function(r){if(!i.contains(t.id))return;let a=!1,s=to(r,"NetworkLinkControl",Ge.kml),c=l(s),u=0;if(c){if(l(to(s,"Update",Ge.kml))){It("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=af(Un(s,"cookie",Ge.kml)??""),u=yi(s,"minRefreshPeriod",Ge.kml)??0}let f=X.now(),h=t.refreshMode;if(h===OC.INTERVAL)l(s)&&(t.time=Math.max(u,t.time));else if(h===OC.EXPIRE){let v;if(l(s)&&(v=Un(s,"expires",Ge.kml)),l(v))try{let P=X.fromIso8601(v),N=X.secondsDifference(P,f);N>0&&N<u&&X.addSeconds(f,u,P),t.time=P}catch{It("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),a=!0}else It("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),a=!0}let p=t.entity,A=e._entityCollection,m=n.values;function _(v){A.remove(v);let P=v._children,N=P.length;for(let L=0;L<N;++L)_(P[L])}A.suspendEvents();let y=A.values.slice(),C;for(C=0;C<y.length;++C){let v=y[C];v.parent===p&&(v.parent=void 0,_(v))}for(A.resumeEvents(),A.suspendEvents(),C=0;C<m.length;C++){let v=m[C];l(v.parent)||(v.parent=p,f$(v)),A.add(v)}A.resumeEvents(),a?i.remove(t.id):t.lastUpdated=f;let E=A.computeAvailability(),b=E.start,x=E.stop,S=X.equals(b,Xe.MINIMUM_VALUE),B=X.equals(x,Xe.MAXIMUM_VALUE);if(!S||!B){let v=e._clock;(v.startTime!==b||v.stopTime!==x)&&(v.startTime=b,v.stopTime=x,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,o.getUrlComponent(!0))}}var e$=new Ot;Hf.prototype.update=function(e){let t=this._networkLinks;if(t.length===0)return!0;let n=X.now(),i=this;e$.removeAll();function o(f){let h=f._children,p=h.length;for(let A=0;A<p;++A){let m=h[A];e$.set(m.id,m),o(m)}}let r=!1,a=this._lastCameraView,s=this.camera;l(s)&&!(s.positionWC.equalsEpsilon(a.position,D.EPSILON7)&&s.directionWC.equalsEpsilon(a.direction,D.EPSILON7)&&s.upWC.equalsEpsilon(a.up,D.EPSILON7))&&(a.position=d.clone(s.positionWC),a.direction=d.clone(s.directionWC),a.up=d.clone(s.upWC),a.bbox=s.computeViewRectangle(),r=!0);let c=new Ot,u=!1;return t.values.forEach(function(f){let h=f.entity;if(!e$.contains(h.id)){if(!f.updating){let p=!1;if(f.refreshMode===OC.INTERVAL?X.secondsDifference(n,f.lastUpdated)>f.time&&(p=!0):f.refreshMode===OC.EXPIRE?X.greaterThan(n,f.time)&&(p=!0):f.refreshMode===OC.STOP&&(r&&(f.needsUpdate=!0,f.cameraUpdateTime=n),f.needsUpdate&&X.secondsDifference(n,f.cameraUpdateTime)>=f.time&&(p=!0)),p){o(h),f.updating=!0;let A=new Vs,m=f.href.clone();m.setQueryParameters(f.cookie);let _=i._ellipsoid??te.default;l$(m,i.camera,i.canvas,f.viewBoundScale,a.bbox,_),u$(i,A,m,{context:h.id}).then(FAt(i,f,A,c,m)).catch(function(y){let C=`NetworkLink ${f.href} refresh failed: ${y}`;console.log(C),i._error.raiseEvent(i,C)}),u=!0}}c.set(f.id,f)}}),u&&(this._networkLinks=c,this._changed.raiseEvent(this)),!0};function QAt(){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}Hf._DeferredLoading=eA;Hf._getTimestamp=Fi;var nI=Hf;function P2(){de.throwInstantiationError()}P2.prototype.update=de.throwInstantiationError;P2.prototype.getBoundingSphere=de.throwInstantiationError;P2.prototype.isDestroyed=de.throwInstantiationError;P2.prototype.destroy=de.throwInstantiationError;var d$=P2;var kAt={NONE:0,LERC:1},oh=Object.freeze(kAt);var UAt={NONE:0,BITS12:1},Ws=Object.freeze(UAt);var R2=new d,zAt=new d,rh=new k,GAt=new M,VAt=new M,HAt=Math.pow(2,12);function Lc(e,t,n,i,o,r,a,s,c,u){let f=Ws.NONE,h,p;if(l(t)&&l(n)&&l(i)&&l(o)){let A=t.minimum,m=t.maximum,_=d.subtract(m,A,zAt),y=i-n;Math.max(d.maximumComponent(_),y)<HAt-1?f=Ws.BITS12:f=Ws.NONE;let E=M.fromScale(_,GAt);E=M.setTranslation(E,A,E);let b=M.fromScale(d.fromElements(1/_.x,1/_.y,1/_.z,R2),VAt);b=M.multiplyByTranslation(b,d.negate(A,R2),b),p=M.clone(o,new M);let x=M.getTranslation(o,R2);x=d.subtract(x,e,R2),p=M.setTranslation(p,x,p),p=M.multiply(p,E,p),h=M.inverseTransformation(o,new M),h=M.multiply(b,h,h),o=M.multiply(o,E,new M)}this.quantization=f,this.minimumHeight=n,this.maximumHeight=i,this.center=d.clone(e),this.toScaledENU=h,this.fromScaledENU=o,this.matrix=p,this.hasVertexNormals=r??!1,this.hasWebMercatorT=a??!1,this.hasGeodeticSurfaceNormals=s??!1,this.exaggeration=c??1,this.exaggerationRelativeHeight=u??0,this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}Lc.prototype.encode=function(e,t,n,i,o,r,a,s){let c=i.x,u=i.y;if(this.quantization===Ws.BITS12){n=M.multiplyByPoint(this.toScaledENU,n,R2),n.x=D.clamp(n.x,0,1),n.y=D.clamp(n.y,0,1),n.z=D.clamp(n.z,0,1);let f=this.maximumHeight-this.minimumHeight,h=D.clamp((o-this.minimumHeight)/f,0,1);k.fromElements(n.x,n.y,rh);let p=tn.compressTextureCoordinates(rh);k.fromElements(n.z,h,rh);let A=tn.compressTextureCoordinates(rh);k.fromElements(c,u,rh);let m=tn.compressTextureCoordinates(rh);if(e[t++]=p,e[t++]=A,e[t++]=m,this.hasWebMercatorT){k.fromElements(a,0,rh);let _=tn.compressTextureCoordinates(rh);e[t++]=_}}else e[t++]=n.x-this.center.x,e[t++]=n.y-this.center.y,e[t++]=n.z-this.center.z,e[t++]=o,e[t++]=c,e[t++]=u,this.hasWebMercatorT&&(e[t++]=a);return this.hasVertexNormals&&(e[t++]=tn.octPackFloat(r)),this.hasGeodeticSurfaceNormals&&(e[t++]=s.x,e[t++]=s.y,e[t++]=s.z),t};var WAt=new d,rxe=new d;Lc.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 a=0;a<o;a++){for(let f=0;f<i;f++){let h=a*i+f,p=a*r+f;t[p]=e[h]}let s=this.decodePosition(t,a,WAt),c=n.geodeticSurfaceNormal(s,rxe),u=a*r+this._offsetGeodeticSurfaceNormal;t[u]=c.x,t[u+1]=c.y,t[u+2]=c.z}};Lc.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 a=0;a<o;a++){let s=r*n+a,c=r*o+a;t[c]=e[s]}};Lc.prototype.decodePosition=function(e,t,n){if(l(n)||(n=new d),t*=this.stride,this.quantization===Ws.BITS12){let i=tn.decompressTextureCoordinates(e[t],rh);n.x=i.x,n.y=i.y;let o=tn.decompressTextureCoordinates(e[t+1],rh);return n.z=o.x,M.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=e[t],n.y=e[t+1],n.z=e[t+2],d.add(n,this.center,n)};Lc.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 a=this.decodeGeodeticSurfaceNormal(e,t,rxe),s=this.decodeHeight(e,t),c=xo.getHeight(s,i,o)-s;n.x+=a.x*c,n.y+=a.y*c,n.z+=a.z*c}return n};Lc.prototype.decodeTextureCoordinates=function(e,t,n){return l(n)||(n=new k),t*=this.stride,this.quantization===Ws.BITS12?tn.decompressTextureCoordinates(e[t+2],n):k.fromElements(e[t+4],e[t+5],n)};Lc.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===Ws.BITS12?tn.decompressTextureCoordinates(e[t+1],rh).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};Lc.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===Ws.BITS12?tn.decompressTextureCoordinates(e[t+3],rh).x:e[t+6]};Lc.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 k.fromElements(o,r,n)};Lc.prototype.decodeNormal=function(e,t,n){let i=t=t*this.stride+this._offsetVertexNormal;return tn.octDecodeFloat(e[i],n)};Lc.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};Lc.prototype._calculateStrideAndOffsets=function(){let e=0;this.quantization===Ws.BITS12?e+=3:e+=6,this.hasWebMercatorT&&(e+=1),this.hasVertexNormals&&(this._offsetVertexNormal=e,e+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=e,e+=3),this.stride=e};var s9={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},c9={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};Lc.prototype.getAttributes=function(e){let t=j.FLOAT,n=j.getSizeInBytes(t),i=this.stride*n,o=0,r=[];function a(s,c){r.push({index:s,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:c,offsetInBytes:o,strideInBytes:i}),o+=c*n}if(this.quantization===Ws.NONE){a(s9.position3DAndHeight,4);let s=2;s+=this.hasWebMercatorT?1:0,s+=this.hasVertexNormals?1:0,a(s9.textureCoordAndEncodedNormals,s),this.hasGeodeticSurfaceNormals&&a(s9.geodeticSurfaceNormal,3)}else{let s=this.hasWebMercatorT||this.hasVertexNormals,c=this.hasWebMercatorT&&this.hasVertexNormals;a(c9.compressed0,s?4:3),c&&a(c9.compressed1,1),this.hasGeodeticSurfaceNormals&&a(c9.geodeticSurfaceNormal,3)}return r};Lc.prototype.getAttributeLocations=function(){return this.quantization===Ws.NONE?s9:c9};Lc.clone=function(e,t){if(l(e))return l(t)||(t=new Lc),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=d.clone(e.center),t.toScaledENU=M.clone(e.toScaledENU),t.fromScaledENU=M.clone(e.fromScaledENU),t.matrix=M.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 Cr=Lc;var tA={};tA.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var h$=new d,jAt=new M,YAt=new d,qAt=new d;tA.computeVertices=function(e){let t=Math.cos,n=Math.sin,i=Math.sqrt,o=Math.atan,r=Math.exp,a=D.PI_OVER_TWO,s=D.toRadians,c=e.heightmap,u=e.width,f=e.height,h=e.skirtHeight,p=h>0,A=e.isGeographic??!0,m=e.ellipsoid??te.default,_=1/m.maximumRadius,y=ce.clone(e.nativeRectangle),C=ce.clone(e.rectangle),E,b,x,S;l(C)?(E=C.west,b=C.south,x=C.east,S=C.north):A?(E=s(y.west),b=s(y.south),x=s(y.east),S=s(y.north)):(E=y.west*_,b=a-2*o(r(-y.south*_)),x=y.east*_,S=a-2*o(r(-y.north*_)));let B=e.relativeToCenter,v=l(B);B=v?B:d.ZERO;let P=e.includeWebMercatorT??!1,N=e.exaggeration??1,L=e.exaggerationRelativeHeight??0,I=N!==1,T=e.structure??tA.DEFAULT_STRUCTURE,w=T.heightScale??tA.DEFAULT_STRUCTURE.heightScale,R=T.heightOffset??tA.DEFAULT_STRUCTURE.heightOffset,O=T.elementsPerHeight??tA.DEFAULT_STRUCTURE.elementsPerHeight,G=T.stride??tA.DEFAULT_STRUCTURE.stride,F=T.elementMultiplier??tA.DEFAULT_STRUCTURE.elementMultiplier,U=T.isBigEndian??tA.DEFAULT_STRUCTURE.isBigEndian,Q=ce.computeWidth(y),H=ce.computeHeight(y),Y=Q/(u-1),$=H/(f-1);A||(Q*=_,H*=_);let W=m.radiiSquared,K=W.x,Z=W.y,pe=W.z,ge=65536,re=-65536,ye=At.eastNorthUpToFixedFrame(B,m),Ce=M.inverseTransformation(ye,jAt),Pe,Ne;P&&(Pe=mi.geodeticLatitudeToMercatorAngle(b),Ne=1/(mi.geodeticLatitudeToMercatorAngle(S)-Pe));let Le=YAt;Le.x=Number.POSITIVE_INFINITY,Le.y=Number.POSITIVE_INFINITY,Le.z=Number.POSITIVE_INFINITY;let Oe=qAt;Oe.x=Number.NEGATIVE_INFINITY,Oe.y=Number.NEGATIVE_INFINITY,Oe.z=Number.NEGATIVE_INFINITY;let ot=Number.POSITIVE_INFINITY,Fe=u*f,_t=h>0?u*2+f*2:0,rt=Fe+_t,Ye=new Array(rt),st=new Array(rt),ft=new Array(rt),St=P?new Array(rt):[],Ie=I?new Array(rt):[],Se=0,Kt=f,mt=0,Gt=u;p&&(--Se,++Kt,--mt,++Gt);let Hn=1e-5;for(let ai=Se;ai<Kt;++ai){let Xn=ai;Xn<0&&(Xn=0),Xn>=f&&(Xn=f-1);let oo=y.north-$*Xn;A?oo=s(oo):oo=a-2*o(r(-oo*_));let Oo=(oo-b)/(S-b);Oo=D.clamp(Oo,0,1);let yo=ai===Se,or=ai===Kt-1;h>0&&(yo?oo+=Hn*H:or&&(oo-=Hn*H));let qo=t(oo),bn=n(oo),wi=pe*bn,Ln;P&&(Ln=(mi.geodeticLatitudeToMercatorAngle(oo)-Pe)*Ne);for(let Ko=mt;Ko<Gt;++Ko){let Xo=Ko;Xo<0&&(Xo=0),Xo>=u&&(Xo=u-1);let ss=Xn*(u*G)+Xo*G,Hi;if(O===1)Hi=c[ss];else{Hi=0;let cs;if(U)for(cs=0;cs<O;++cs)Hi=Hi*F+c[ss+cs];else for(cs=O-1;cs>=0;--cs)Hi=Hi*F+c[ss+cs]}Hi=Hi*w+R,re=Math.max(re,Hi),ge=Math.min(ge,Hi);let Do=y.west+Y*Xo;A?Do=s(Do):Do=Do*_;let Ts=(Do-E)/(x-E);Ts=D.clamp(Ts,0,1);let wa=Xn*u+Xo;if(h>0){let cs=Ko===mt,ls=Ko===Gt-1,on=yo||or||cs||ls;if((yo||or)&&(cs||ls))continue;on&&(Hi-=h,cs?(wa=Fe+(f-Xn-1),Do-=Hn*Q):or?wa=Fe+f+(u-Xo-1):ls?(wa=Fe+f+u+Xn,Do+=Hn*Q):yo&&(wa=Fe+f+u+f+Xo))}let Mr=qo*t(Do),Ss=qo*n(Do),$u=K*Mr,ef=Z*Ss,yh=1/i($u*Mr+ef*Ss+wi*bn),Js=$u*yh,z_=ef*yh,Xm=wi*yh,br=new d;br.x=Js+Mr*Hi,br.y=z_+Ss*Hi,br.z=Xm+bn*Hi,M.multiplyByPoint(Ce,br,h$),d.minimumByComponent(h$,Le,Le),d.maximumByComponent(h$,Oe,Oe),ot=Math.min(ot,Hi),Ye[wa]=br,ft[wa]=new k(Ts,Oo),st[wa]=Hi,P&&(St[wa]=Ln),I&&(Ie[wa]=m.geodeticSurfaceNormal(br))}}let Je=le.fromPoints(Ye),fo;l(C)&&(fo=en.fromRectangle(C,ge,re,m));let Vt;v&&(Vt=new Am(m).computeHorizonCullingPointPossiblyUnderEllipsoid(B,Ye,ge));let Lo=new ff(Le,Oe,B),io=new Cr(B,Lo,ot,re,ye,!1,P,I,N,L),Qi=new Float32Array(rt*io.stride),Yo=0;for(let ai=0;ai<rt;++ai)Yo=io.encode(Qi,Yo,Ye[ai],ft[ai],st[ai],void 0,St[ai],Ie[ai]);return{vertices:Qi,maximumHeight:re,minimumHeight:ge,encoding:io,boundingSphere3D:Je,orientedBoundingBox:fo,occludeePointInScaledSpace:Vt}};var kw=tA;function FC(){de.throwInstantiationError()}Object.defineProperties(FC.prototype,{credits:{get:de.throwInstantiationError},waterMask:{get:de.throwInstantiationError}});FC.prototype.interpolateHeight=de.throwInstantiationError;FC.prototype.isChildAvailable=de.throwInstantiationError;FC.prototype.createMesh=de.throwInstantiationError;FC.prototype.upsample=de.throwInstantiationError;FC.prototype.wasCreatedByUpsampling=de.throwInstantiationError;FC.maximumAsynchronousTasks=5;var Wu=FC;var KAt=3;function A$(e,t,n){this._vertices=e,this._indices=t,this._encoding=n,this._inverseTransform=new M,this._needsRebuild=!0,this._rootNode=new p$}var XAt=new Zn("incrementallyBuildTerrainPicker");Object.defineProperties(A$.prototype,{needsRebuild:{get:function(){return this._needsRebuild},set:function(e){this._needsRebuild=e}}});function p$(){this.x=0,this.y=0,this.level=0,this.aabb=axe(this.x,this.y,this.level),this.intersectingTriangles=new Uint32Array(0),this.children=[],this.buildingChildren=!1}p$.prototype.addChild=function(e){let t=new p$;t.x=this.x*2+(e&1),t.y=this.y*2+(e>>1&1),t.level=this.level+1,t.aabb=axe(t.x,t.y,t.level),this.children[e]=t};var JAt=new yn,l9=[new d,new d,new d];A$.prototype.rayIntersect=function(e,t,n,i,o){this._needsRebuild&&ZAt(this,t);let r=this._inverseTransform,a=JAt;a.origin=M.multiplyByPoint(r,e.origin,a.origin),a.direction=M.multiplyByPointAsVector(r,e.direction,a.direction);let s=[];return sxe(this._rootNode,a,s),igt(this,s,e,n,i,o)};function ZAt(e,t){M.inverse(t,e._inverseTransform),e._needsRebuild=!1;let n=e._indices.length/3,i=new Uint32Array(n);for(let o=0;o<n;++o)i[o]=o;e._rootNode.intersectingTriangles=i,e._rootNode.children.length=0}var $At=new d,egt=new d;function axe(e,t,n){let i=1/Math.pow(2,n),o=d.fromElements(e*i-.5,t*i-.5,-.5,$At),r=d.fromElements((e+1)*i-.5,(t+1)*i-.5,.5,egt);return ff.fromCorners(o,r)}function tgt(e,t,n,i,o){d.pack(n[0],e,9*o),d.pack(n[1],e,9*o+3),d.pack(n[2],e,9*o+6),t[o]=i}var ngt=new qr;function sxe(e,t,n){let i=di.rayAxisAlignedBoundingBox(t,e.aabb,ngt);if(!l(i))return;if(!e.children.length||e.buildingChildren){n.push({node:e,interval:new qr(i.start,i.stop)});return}for(let r=0;r<e.children.length;r++)sxe(e.children[r],t,n)}function igt(e,t,n,i,o,r){let a=t.sort(function(c,u){return c.interval.start-u.interval.start}),s=Number.MAX_VALUE;for(let c=0;c<a.length;c++){let u=a[c],f=ogt(e,n,u.node,i,o,r);if(s=Math.min(f,s),s!==Number.MAX_VALUE)break}if(s!==Number.MAX_VALUE)return yn.getPoint(n,s)}function ogt(e,t,n,i,o,r){let a=Number.MAX_VALUE,s=e._encoding,c=e._indices,u=e._vertices,f=n.intersectingTriangles.length,p=!(n.level>=KAt)&&!n.buildingChildren,A,m;p&&(A=new Float64Array(f*9),m=new Uint32Array(f));for(let _=0;_<f;_++){let y=n.intersectingTriangles[_],C=m$(s,o,r,t,u,c[3*y],l9[0]),E=m$(s,o,r,t,u,c[3*y+1],l9[1]),b=m$(s,o,r,t,u,c[3*y+2],l9[2]),x=di.rayTriangleParametric(t,C,E,b,i);l(x)&&x<a&&x>=0&&(a=x),p&&tgt(A,m,l9,y,_)}if(p){for(let _=0;_<4;_++)n.addChild(_);agt(e._inverseTransform,n,m,A)}return a}var rgt=new me;function m$(e,t,n,i,o,r,a){let s=e.getExaggeratedPosition(o,r,a);if(t===oe.SCENE3D)return s;let u=n.ellipsoid.cartesianToCartographic(s,rgt);s=n.project(u,a),s=d.fromElements(s.z,s.x,s.y,a);let f=D.TWO_PI*n.ellipsoid.maximumRadius,h=Math.round((i.origin.y-s.y)/f);return s.y+=h*f,s}async function agt(e,t,n,i){t.buildingChildren=!0;let o=new Float64Array(16);M.pack(e,o,0);let r=new Float64Array(24);for(let f=0;f<4;f++)d.pack(t.children[f].aabb.minimum,r,f*6),d.pack(t.children[f].aabb.maximum,r,f*6+3);let a={aabbs:r,inverseTransform:o,triangleIndices:n,trianglePositions:i},s=[r.buffer,o.buffer,n.buffer,i.buffer],c=XAt.scheduleTask(a,s);if(!l(c)){t.buildingChildren=!1;return}(await c).intersectingTrianglesArrays.forEach((f,h)=>{l(t.children[h])&&(t.children[h].intersectingTriangles=new Uint32Array(f))}),t.intersectingTriangles=new Uint32Array(0),t.buildingChildren=!1}var M2=A$;function N2(e,t,n,i,o,r,a,s,c,u,f,h,p,A,m,_,y){this.center=e,this.vertices=t,this.stride=f??6,this.indices=n,this.indexCountWithoutSkirts=i,this.vertexCountWithoutSkirts=o,this.minimumHeight=r,this.maximumHeight=a,this.rectangle=s,this.boundingSphere3D=c,this.occludeePointInScaledSpace=u,this.orientedBoundingBox=h,this.encoding=p,this.westIndicesSouthToNorth=A,this.southIndicesEastToWest=m,this.eastIndicesNorthToSouth=_,this.northIndicesWestToEast=y,this._transform=new M,this._lastPickSceneMode=void 0,this._terrainPicker=new M2(t,n,p)}N2.prototype.getTransform=function(e,t){return this._lastPickSceneMode===e?this._transform:(this._terrainPicker.needsRebuild=!0,!l(e)||e===oe.SCENE3D?sgt(this,this._transform):mgt(this,t,this._transform))};function sgt(e,t){let n=e.encoding.exaggeration,i=e.encoding.exaggerationRelativeHeight,o=xo.getHeight(e.minimumHeight,n,i),r=xo.getHeight(e.maximumHeight,n,i),a=en.fromRectangle(e.rectangle,o,r,te.default,e.orientedBoundingBox);return en.computeTransformation(a,t),M.getScale(t,g$).z<=D.EPSILON16&&(g$.z=1,M.setScale(t,g$,t)),t}var cgt=new d,lgt=new d,ugt=new me,fgt=new me,dgt=new d,hgt=new d,g$=new d;function mgt(e,t,n){let i=e.encoding.exaggeration,o=e.encoding.exaggerationRelativeHeight,r=xo.getHeight(e.minimumHeight,i,o),a=xo.getHeight(e.maximumHeight,i,o),s=t.project(me.fromRadians(e.rectangle.west,e.rectangle.south,0,ugt),cgt),c=t.project(me.fromRadians(e.rectangle.east,e.rectangle.north,0,fgt),lgt),u=a-r,f=d.fromElements(c.x-s.x,c.y-s.y,u>0?u:1,dgt),h=d.fromElements(s.x+f.x*.5,s.y+f.y*.5,r+f.z*.5,hgt);return M.fromTranslation(h,n),M.setScale(n,f,n),M.multiply(At.SWIZZLE_3D_TO_2D_MATRIX,n,n),n}N2.prototype.pick=function(e,t,n,i){let o=this._terrainPicker.rayIntersect(e,this.getTransform(n,i),t,n,i);return this._lastPickSceneMode=n,o};N2.prototype.updateExaggeration=function(e,t){this._terrainPicker._vertices=this.vertices,this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};N2.prototype.updateSceneMode=function(e){this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};var pc=N2;function y_(e){e=e??V.EMPTY_OBJECT,this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=e.childTileMask??15,this._encoding=e.encoding??oh.NONE;let t=kw.DEFAULT_STRUCTURE,n=e.structure;l(n)?n!==t&&(n.heightScale=n.heightScale??t.heightScale,n.heightOffset=n.heightOffset??t.heightOffset,n.elementsPerHeight=n.elementsPerHeight??t.elementsPerHeight,n.stride=n.stride??t.stride,n.elementMultiplier=n.elementMultiplier??t.elementMultiplier,n.isBigEndian=n.isBigEndian??t.isBigEndian):n=t,this._structure=n,this._createdByUpsampling=e.createdByUpsampling??!1,this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._encoding===oh.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(y_.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var cxe="createVerticesFromHeightmap",pgt=new Zn(cxe),Agt=new Zn(cxe,Wu.maximumAsynchronousTasks);y_.prototype.createMesh=function(e){e=e??V.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,a=e.exaggerationRelativeHeight??0,s=e.throttle??!0,c=t.ellipsoid,u=t.tileXYToNativeRectangle(n,i,o),f=t.tileXYToRectangle(n,i,o),h=c.cartographicToCartesian(ce.center(f)),p=this._structure,m=jo.getEstimatedLevelZeroGeometricErrorForAHeightmap(c,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(m*4,1e3);let y=(s?Agt:pgt).scheduleTask({heightmap:this._buffer,structure:p,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:u,rectangle:f,relativeToCenter:h,ellipsoid:c,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Wi,exaggeration:r,exaggerationRelativeHeight:a,encoding:this._encoding});if(!l(y))return;let C=this;return Promise.resolve(y).then(function(E){let b;C._skirtHeight>0?b=jo.getRegularGridAndSkirtIndicesAndEdgeIndices(E.gridWidth,E.gridHeight):b=jo.getRegularGridIndicesAndEdgeIndices(E.gridWidth,E.gridHeight);let x=E.gridWidth*E.gridHeight;return C._mesh=new pc(h,new Float32Array(E.vertices),b.indices,b.indexCountWithoutSkirts,x,E.minimumHeight,E.maximumHeight,f,le.clone(E.boundingSphere3D),d.clone(E.occludeePointInScaledSpace),E.numberOfAttributes,en.clone(E.orientedBoundingBox),Cr.clone(E.encoding),b.westIndicesSouthToNorth,b.southIndicesEastToWest,b.eastIndicesNorthToSouth,b.northIndicesWestToEast),C._buffer=void 0,C._mesh})};y_.prototype._createMeshSync=function(e){let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,a=e.exaggerationRelativeHeight??0,s=t.ellipsoid,c=t.tileXYToNativeRectangle(n,i,o),u=t.tileXYToRectangle(n,i,o),f=s.cartographicToCartesian(ce.center(u)),h=this._structure,A=jo.getEstimatedLevelZeroGeometricErrorForAHeightmap(s,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(A*4,1e3);let m=kw.computeVertices({heightmap:this._buffer,structure:h,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:c,rectangle:u,relativeToCenter:f,ellipsoid:s,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Wi,exaggeration:r,exaggerationRelativeHeight:a});this._buffer=void 0;let _;this._skirtHeight>0?_=jo.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):_=jo.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let y=m.gridWidth*m.gridHeight;return this._mesh=new pc(f,m.vertices,_.indices,_.indexCountWithoutSkirts,y,m.minimumHeight,m.maximumHeight,u,m.boundingSphere3D,m.occludeePointInScaledSpace,m.encoding.stride,m.orientedBoundingBox,m.encoding,_.westIndicesSouthToNorth,_.southIndicesEastToWest,_.eastIndicesNorthToSouth,_.northIndicesWestToEast),this._mesh};y_.prototype.interpolateHeight=function(e,t,n){let i=this._width,o=this._height,r=this._structure,a=r.stride,s=r.elementsPerHeight,c=r.elementMultiplier,u=r.isBigEndian,f=r.heightOffset,h=r.heightScale,p=l(this._mesh),A=this._encoding===oh.LERC;if(!p&&A)return;let _;if(p){let y=this._mesh.vertices,C=this._mesh.encoding;_=lxe(y,C,f,h,e,i,o,t,n)}else _=ggt(this._buffer,s,c,a,u,e,i,o,t,n),_=_*h+f;return _};y_.prototype.upsample=function(e,t,n,i,o,r,a){let s=this._mesh;if(!l(s))return;let c=this._width,u=this._height,f=this._structure,h=f.stride,p=new this._bufferType(c*u*h),A=s.vertices,m=s.encoding,_=e.tileXYToRectangle(t,n,i),y=e.tileXYToRectangle(o,r,a),C=f.heightOffset,E=f.heightScale,b=f.elementsPerHeight,x=f.elementMultiplier,S=f.isBigEndian,B=Math.pow(x,b-1);for(let v=0;v<u;++v){let P=D.lerp(y.north,y.south,v/(u-1));for(let N=0;N<c;++N){let L=D.lerp(y.west,y.east,N/(c-1)),g=lxe(A,m,C,E,_,c,u,L,P);g=g<f.lowestEncodedHeight?f.lowestEncodedHeight:g,g=g>f.highestEncodedHeight?f.highestEncodedHeight:g,_gt(p,b,x,B,h,S,v*c+N,g)}}return Promise.resolve(new y_({buffer:p,width:c,height:u,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};y_.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};y_.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function ggt(e,t,n,i,o,r,a,s,c,u){let f=(c-r.west)*(a-1)/(r.east-r.west),h=(u-r.south)*(s-1)/(r.north-r.south),p=f|0,A=p+1;A>=a&&(A=a-1,p=a-2);let m=h|0,_=m+1;_>=s&&(_=s-1,m=s-2);let y=f-p,C=h-m;m=s-1-m,_=s-1-_;let E=u9(e,t,n,i,o,m*a+p),b=u9(e,t,n,i,o,m*a+A),x=u9(e,t,n,i,o,_*a+p),S=u9(e,t,n,i,o,_*a+A);return uxe(y,C,E,b,x,S)}function lxe(e,t,n,i,o,r,a,s,c){let u=(s-o.west)*(r-1)/(o.east-o.west),f=(c-o.south)*(a-1)/(o.north-o.south),h=u|0,p=h+1;p>=r&&(p=r-1,h=r-2);let A=f|0,m=A+1;m>=a&&(m=a-1,A=a-2);let _=u-h,y=f-A;A=a-1-A,m=a-1-m;let C=(t.decodeHeight(e,A*r+h)-n)/i,E=(t.decodeHeight(e,A*r+p)-n)/i,b=(t.decodeHeight(e,m*r+h)-n)/i,x=(t.decodeHeight(e,m*r+p)-n)/i;return uxe(_,y,C,E,b,x)}function uxe(e,t,n,i,o,r){return t<e?n+e*(i-n)+t*(r-i):n+e*(r-o)+t*(o-n)}function u9(e,t,n,i,o,r){r*=i;let a=0,s;if(o)for(s=0;s<t;++s)a=a*n+e[r+s];else for(s=t-1;s>=0;--s)a=a*n+e[r+s];return a}function _gt(e,t,n,i,o,r,a,s){a*=o;let c;if(r)for(c=0;c<t-1;++c)e[a+c]=s/i|0,s-=e[a+c]*i,i/=n;else for(c=t-1;c>0;--c)e[a+c]=s/i|0,s-=e[a+c]*i,i/=n;e[a+c]=s}var Oc=y_;function Gw(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var iI=new ce;function ygt(e,t,n,i){let o=i.length;for(let r=0;r<o;++r){let a=i[r];if(a.x===t&&a.y===n&&a.level===e)return!0}return!1}Gw.prototype.addAvailableTileRange=function(e,t,n,i,o){let r=this._tilingScheme,a=this._rootNodes;if(e===0)for(let p=n;p<=o;++p)for(let A=t;A<=i;++A)ygt(e,A,p,a)||a.push(new Uw(r,void 0,0,A,p));r.tileXYToRectangle(t,n,e,iI);let s=iI.west,c=iI.north;r.tileXYToRectangle(i,o,e,iI);let u=iI.east,f=iI.south,h=new xgt(e,s,f,u,c);for(let p=0;p<a.length;++p){let A=a[p];_$(A.extent,h)&&Tgt(this._maximumLevel,A,h)}};Gw.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(zw(i.extent,e)){t=i;break}}return l(t)?L2(void 0,t,e):-1};var Cgt=[],Egt=[],bgt=new ce,Igt=new ce;Gw.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=Cgt;t.length=0,e.east<e.west?(t.push(ce.fromRadians(-Math.PI,e.south,e.east,e.north,bgt)),t.push(ce.fromRadians(e.west,e.south,Math.PI,e.north,Igt))):t.push(e);let n=Egt;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)O2(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 fxe=new me;Gw.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,iI);return ce.center(i,fxe),this.computeMaximumLevelAtPosition(fxe)>=e};Gw.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 Uw(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(Uw.prototype,{nw:{get:function(){return this._nw||(this._nw=new Uw(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new Uw(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new Uw(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new Uw(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function xgt(e,t,n,i,o){this.level=e,this.west=t,this.south=n,this.east=i,this.north=o}function _$(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 Tgt(e,t,n){for(;t.level<e;)if(f9(t.nw.extent,n))t=t.nw;else if(f9(t.ne.extent,n))t=t.ne;else if(f9(t.sw.extent,n))t=t.sw;else if(f9(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=Co(t.rectangles,n.level,Sgt);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function Sgt(e,t){return e.level-t}function f9(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function zw(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function L2(e,t,n){let i=0,o=!1;for(;!o;){let r=t._nw&&zw(t._nw.extent,n),a=t._ne&&zw(t._ne.extent,n),s=t._sw&&zw(t._sw.extent,n),c=t._se&&zw(t._se.extent,n);if(r+a+s+c>1){r&&(i=Math.max(i,L2(t,t._nw,n))),a&&(i=Math.max(i,L2(t,t._ne,n))),s&&(i=Math.max(i,L2(t,t._sw,n))),c&&(i=Math.max(i,L2(t,t._se,n)));break}else r?t=t._nw:a?t=t._ne:s?t=t._sw:c?t=t._se:o=!0}for(;t!==e;){let r=t.rectangles;for(let a=r.length-1;a>=0&&r[a].level>i;--a){let s=r[a];zw(s,n)&&(i=s.level)}t=t.parent}return i}function O2(e,t,n){if(!t)return;let i,o=!1;for(i=0;i<n.length;++i)o=o||_$(t.extent,n[i]);if(!o)return;let r=t.rectangles;for(i=0;i<r.length;++i){let a=r[i];e[a.level]||(e[a.level]=n),e[a.level]=wgt(e[a.level],a)}O2(e,t._nw,n),O2(e,t._ne,n),O2(e,t._sw,n),O2(e,t._se,n)}function wgt(e,t){let n=[];for(let i=0;i<e.length;++i){let o=e[i];_$(o,t)?(o.west<t.west&&n.push(new ce(o.west,o.south,t.west,o.north)),o.east>t.east&&n.push(new ce(t.east,o.south,o.east,o.north)),o.south<t.south&&n.push(new ce(Math.max(t.west,o.west),o.south,Math.min(t.east,o.east),t.south)),o.north>t.north&&n.push(new ce(Math.max(t.west,o.west),t.north,Math.min(t.east,o.east),o.north))):n.push(o)}return n}var Lm=Gw;var Bgt=15;function dxe(e){this.ellipsoid=e.ellipsoid??te.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}dxe.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 Dgt(e,t){let n=t.copyrightText;l(n)&&(e.credit=new Et(n));let i=t.spatialReference,o=i.latestWkid??i.wkid,r=t.extent,a={ellipsoid:e.ellipsoid};if(o===4326)a.rectangle=ce.fromDegrees(r.xmin,r.ymin,r.xmax,r.ymax),e.tilingScheme=new qi(a);else if(o===3857){let u=Math.PI*e.ellipsoid.maximumRadius;t.extent.xmax>u&&(t.extent.xmax=u),t.extent.ymax>u&&(t.extent.ymax=u),t.extent.xmin<-u&&(t.extent.xmin=-u),t.extent.ymin<-u&&(t.extent.ymin=-u),a.rectangleSouthwestInMeters=new k(r.xmin,r.ymin),a.rectangleNortheastInMeters=new k(r.xmax,r.ymax),e.tilingScheme=new Qa(a)}else throw new ue("Invalid spatial reference");let s=t.tileInfo;if(!l(s))throw new ue("tileInfo is required");e.width=s.rows+1,e.height=s.cols+1,e.encoding=s.format==="LERC"?oh.LERC:oh.NONE,e.lodCount=s.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new Lm(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new Lm(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=jo.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 vgt(e,t,n){try{let i=await t.fetchJson();Dgt(e,i)}catch(i){let o=`An error occurred while accessing ${t}.`;throw $o.reportError(void 0,n,l(n)?n._errorEvent:void 0,o),i}}function QC(e){e=e??V.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 _e}Object.defineProperties(QC.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}}});QC.fromUrl=async function(e,t){t=t??V.EMPTY_OBJECT,e=await Promise.resolve(e);let n=De.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),o=new dxe(t);await vgt(o,i);let r=new QC(t);return o.build(r),r._resource=n,r};QC.prototype.requestTileGeometry=function(e,t,n,i){let o=this._resource.getDerivedResource({url:`tile/${n}/${t}/${e}`,request:i}),r=this._hasAvailability,a=Promise.resolve(!0),s;if(r&&!l(y$(this,n+1,e*2,t*2))){let h=hxe(this,n+1,e*2,t*2);a=h.promise,s=h.request}let c=o.fetchArrayBuffer();if(!l(c)||!l(a))return;let u=this,f=this._tilesAvailable;return Promise.all([c,a]).then(function(h){return new Oc({buffer:h[0],width:u._width,height:u._height,childTileMask:r?f.computeChildMaskForTile(n,e,t):Bgt,structure:u._terrainDataStructure,encoding:u._encoding})}).catch(async function(h){if(l(s)&&s.state===pi.CANCELLED){i.cancel();try{await i.deferred?.promise}catch{}return i.state=pi.CANCELLED,Promise.reject(h)}return Promise.reject(h)})};function y$(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}QC.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};QC.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=y$(this,n,e,t);if(l(i))return i;hxe(this,n,e,t)};QC.prototype.loadTileDataAvailability=function(e,t,n){};function Pgt(e,t,n,i){let o=t-1,r=n-1,a=i[e.y*t+e.x],s=[],c={startX:e.x,startY:e.y,endX:0,endY:0},u=new k(e.x+1,e.y+1),f=!1,h=!1;for(;!(f&&h);){let p=u.x,A=h?u.y+1:u.y;if(!f){for(let m=e.y;m<A;++m)if(i[m*t+u.x]!==a){f=!0;break}f?(s.push(new k(u.x,e.y)),--u.x,--p,c.endX=u.x):u.x===o?(c.endX=u.x,f=!0):++u.x}if(!h){let m=u.y*t;for(let _=e.x;_<=p;++_)if(i[m+_]!==a){h=!0;break}h?(s.push(new k(e.x,u.y)),--u.y,c.endY=u.y):u.y===r?(c.endY=u.y,h=!0):++u.y}}return{endingIndices:s,range:c,value:a}}function Rgt(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 s=[new k(0,0)];for(;s.length>0;){let c=s.pop(),u=Pgt(c,n,i,o);if(u.value===1){let h=u.range;h.startX+=e,h.endX+=e,h.startY+=t,h.endY+=t,r.push(h)}let f=u.endingIndices;f.length>0&&(s=s.concat(f))}return r}function hxe(e,t,n,i){if(!e._hasAvailability)return{};let o=Math.floor(n/128)*128,r=Math.floor(i/128)*128,a=Math.min(1<<t,128),s=`tilemap/${t}/${r}/${o}/${a}/${a}`,c=e._availableCache;if(l(c[s]))return c[s];let u=new Ir({throttle:!1,throttleByServer:!0,type:ja.TERRAIN}),h=e._resource.getDerivedResource({url:s,request:u}).fetchJson();return l(h)?(h=h.then(function(p){let A=Rgt(o,r,a,a,p.data);e._tilesAvailabilityLoaded.addAvailableTileRange(t,o,r,o+a,r+a);let m=e._tilesAvailable;for(let _=0;_<A.length;++_){let y=A[_];m.addAvailableTileRange(t,y.startX,y.startY,y.endX,y.endY)}return y$(e,t,n,i)}),c[s]={promise:h,request:u},h=h.finally(function(p){return delete c[s],p}),{promise:h,request:u}):{}}var C$=QC;var mxe="https://dev.virtualearth.net/REST/v1/Locations";function E$(e){e=e??V.EMPTY_OBJECT;let t=e.key;this._key=t;let n={key:t};l(e.culture)&&(n.culture=e.culture),this._resource=new De({url:mxe,queryParameters:n}),this._credit=new Et('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(E$.prototype,{url:{get:function(){return mxe}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});E$.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,a=r[0],s=r[1],c=r[2],u=r[3];return{displayName:o.name,destination:ce.fromDegrees(s,a,u,c)}})})};var b$=E$;function I$(){}Object.defineProperties(I$.prototype,{credit:{get:function(){}}});I$.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 a=0;a<t.length;++a){let s=t[a].match(r);r.test(t[a])&&s.length===3&&(/^[ns]/i.test(s[2])?i=/^[n]/i.test(s[2])?+s[1]:-s[1]:/^[ew]/i.test(s[2])&&(n=/^[e]/i.test(s[2])?+s[1]:-s[1]))}}if(!isNaN(n)&&!isNaN(i)&&!isNaN(o)){let r={displayName:e,destination:d.fromDegrees(n,i,o)};return Promise.resolve([r])}}return Promise.resolve([])};var x$=I$;var Mgt=new ie,pxe=new d,Vw=new d;function Ngt(e){let t=e.points,n=e.times;if(t.length<3){let i=n[0],o=1/(n[1]-i),r=t[0],a=t[1];return function(s,c){l(c)||(c=new d);let u=(s-i)*o;return d.lerp(r,a,u,c)}}return function(i,o){l(o)||(o=new d);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),a=(i-n[r])/(n[r+1]-n[r]),s=Mgt;s.z=a,s.y=a*a,s.x=s.y*a,s.w=1;let c,u,f,h,p;return r===0?(c=t[0],u=t[1],f=e.firstTangent,h=d.subtract(t[2],c,pxe),d.multiplyByScalar(h,.5,h),p=M.multiplyByVector(Oy.hermiteCoefficientMatrix,s,s)):r===t.length-2?(c=t[r],u=t[r+1],h=e.lastTangent,f=d.subtract(u,t[r-1],pxe),d.multiplyByScalar(f,.5,f),p=M.multiplyByVector(Oy.hermiteCoefficientMatrix,s,s)):(c=t[r-1],u=t[r],f=t[r+1],h=t[r+2],p=M.multiplyByVector(kC.catmullRomCoefficientMatrix,s,s)),o=d.multiplyByScalar(c,p.x,o),d.multiplyByScalar(u,p.y,Vw),d.add(o,Vw,o),d.multiplyByScalar(f,p.z,Vw),d.add(o,Vw,o),d.multiplyByScalar(h,p.w,Vw),d.add(o,Vw,o)}}var Lgt=new d,Ogt=new d;function kC(e){e=e??V.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.firstTangent,o=e.lastTangent;if(t.length>2&&(l(i)||(i=Lgt,d.multiplyByScalar(t[1],2,i),d.subtract(i,t[2],i),d.subtract(i,t[0],i),d.multiplyByScalar(i,.5,i)),!l(o))){let r=t.length-1;o=Ogt,d.multiplyByScalar(t[r-1],2,o),d.subtract(t[r],o,o),d.add(o,t[r-2],o),d.multiplyByScalar(o,.5,o)}this._times=n,this._points=t,this._firstTangent=d.clone(i),this._lastTangent=d.clone(o),this._evaluateFunction=Ngt(this),this._lastTimeIndex=0}Object.defineProperties(kC.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}}});kC.catmullRomCoefficientMatrix=new M(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);kC.prototype.findTimeInterval=To.prototype.findTimeInterval;kC.prototype.wrapTime=To.prototype.wrapTime;kC.prototype.clampTime=To.prototype.clampTime;kC.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var T$=kC;var S$={},Fgt={positions:void 0,normals:void 0,indices:void 0,edgeIndicesWest:void 0,edgeIndicesSouth:void 0,edgeIndicesEast:void 0,edgeIndicesNorth:void 0},Qgt=new me,kgt=new d,Ugt=new M,zgt=new M,Ggt=new M,Vgt=new d,Hgt=new d,Wgt=new d,jgt=new d,Ygt=new me,qgt=new k,F2=new d,Kgt=new k,Xgt=new d,Jgt=new d,d9=function(e,t){return e-t};S$.createMesh=async function(e){e=e??V.EMPTY_OBJECT;let{exaggeration:t=1,exaggerationRelativeHeight:n=0,hasVertexNormals:i,hasWebMercatorT:o,gltf:r,minimumHeight:a,maximumHeight:s,skirtHeight:c}=e,f=t!==1,h=le.clone(e.boundingSphere,new le),p=en.clone(e.orientedBoundingBox,new en),A=d.clone(e.horizonOcclusionPoint,new d),m=te.clone(e.ellipsoid,new te),_=ce.clone(e.rectangle,new ce);await(r.extensionsRequired!==void 0&&r.extensionsRequired.indexOf("EXT_meshopt_compression")!==-1?Cy.ready:Promise.resolve(void 0));let E=_.west,b=_.south,x=_.north,S=_.width,B=_.height,v=ce.center(_,Qgt);v.height=.5*(a+s);let P=me.toCartesian(v,m,kgt),N=At.eastNorthUpToFixedFrame(P,m,Ugt),L=M.inverseTransformation(N,zgt),g=M.unpack(r.nodes[0].matrix,0,Ggt);g=M.multiply(ao.Y_UP_TO_Z_UP,g,g);let I=v_t(r,i,Fgt),T=jo.getSkirtVertexCount(I.edgeIndicesWest,I.edgeIndicesSouth,I.edgeIndicesEast,I.edgeIndicesNorth),w=I.positions,R=I.normals,O=I.indices,G=w.length/3,F=G+T,U=O.length,Q=jo.getSkirtIndexCountWithFilledCorners(T),H=F<=65535?Uint16Array:Uint32Array,Y=new H(U+Q);Y.set(O);let $=new H(I.edgeIndicesWest),W=new H(I.edgeIndicesSouth),K=new H(I.edgeIndicesEast),Z=new H(I.edgeIndicesNorth),pe=new H($).sort(),ge=new H(W).sort(),re=new H(K).sort(),ye=new H(Z).sort(),Ce=mi.geodeticLatitudeToMercatorAngle(b),Ne=1/(mi.geodeticLatitudeToMercatorAngle(x)-Ce),Le=d.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Vgt),Oe=d.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Hgt),ot=new Cr(h.center,void 0,void 0,void 0,void 0,i,o,f,t,n),Fe=ot.stride,_t=new Float32Array(F*Fe),rt=0;for(let st=0;st<G;st++){let ft=d.unpack(w,st*3,Wgt),St=M.multiplyByPoint(g,ft,jgt),Ie=me.fromCartesian(St,m,Ygt),{longitude:Se,latitude:Kt,height:mt}=Ie,Gt=(Se-E)/S,Hn=(Kt-b)/B;Gt=D.clamp(Gt,0,1),Hn=D.clamp(Hn,0,1),Co(pe,st,d9)>=0?Gt=0:Co(re,st,d9)>=0&&(Gt=1),Co(ge,st,d9)>=0?Hn=0:Co(ye,st,d9)>=0&&(Hn=1);let Je=k.fromElements(Gt,Hn,qgt),fo;if(i){let Qi=d.unpack(R,st*3,F2);Qi=M.multiplyByPointAsVector(g,Qi,F2),Qi=d.normalize(Qi,F2),fo=tn.octEncode(Qi,Kgt)}let Vt;o&&(Vt=(mi.geodeticLatitudeToMercatorAngle(Kt)-Ce)*Ne);let Lo;f&&(Lo=m.geodeticSurfaceNormal(St,Xgt)),rt=ot.encode(_t,rt,St,Je,mt,fo,Vt,Lo);let io=M.multiplyByPoint(L,St,Jgt);Le=d.minimumByComponent(io,Le,Le),Oe=d.maximumByComponent(io,Oe,Oe)}let Ye=new pc(d.clone(ot.center,new d),_t,Y,U,G,a,s,_,le.clone(h,new le),d.clone(A,new d),Fe,en.clone(p,new en),ot,$,W,K,Z);return bxe(Ye,_,m,Le,Oe,N,L,c),Promise.resolve(Ye)};var Zgt=new k,$gt=new k,e_t=new Array(6),t_t=new k,n_t=new k,i_t=new k,o_t=new d,r_t=new d,a_t=new d,s_t=new me,c_t=new d,l_t=new me,u_t=new me,Axe=new d,f_t=new d,d_t=new d,h_t=new d,m_t=new d,p_t=new d,A_t=new d,g_t=new d,__t=new M,y_t=new M,gxe=new k,C_t=new k,E_t=new d,b_t=new le,I_t=new en,x_t=new ff,_xe=new d,yxe=new k,T_t=new k,Cxe=new d,S_t=new d;function w_t(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.attributes.POSITION],i=e.bufferViews[n.bufferView],o=n.count,r=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(r===void 0){let A=e.buffers[i.buffer].extras._pipeline.source;return new Float32Array(A.buffer,A.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),o*3)}let a=e.buffers[r.buffer].extras._pipeline.source,s=new Uint8Array(a.buffer,a.byteOffset+(r.byteOffset??0)+(n.byteOffset??0),r.byteLength),c=r.byteStride,u=c===4?Uint8Array:Uint16Array,f=new u(o*4);Cy.decodeVertexBuffer(new Uint8Array(f.buffer),o,c,s);let h=(1<<f.BYTES_PER_ELEMENT*8)-1,p=new Float32Array(o*3);for(let A=0;A<o;A++)p[A*3+0]=f[A*4+0]/h,p[A*3+1]=f[A*4+1]/h,p[A*3+2]=f[A*4+2]/h;return p}function B_t(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.attributes.NORMAL],i=e.bufferViews[n.bufferView],o=n.count,r=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(r===void 0){let h=e.buffers[i.buffer].extras._pipeline.source;return new Float32Array(h.buffer,h.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),o*3)}let a=e.buffers[r.buffer].extras._pipeline.source,s=new Uint8Array(a.buffer,a.byteOffset+(r.byteOffset??0)+(n.byteOffset??0),r.byteLength),c=r.byteStride,u=new Int8Array(o*c);Cy.decodeVertexBuffer(new Uint8Array(u.buffer),o,c,s);let f=new Float32Array(o*3);for(let h=0;h<o;h++){let p=Math.max(u[h*4+0]/127,-1),A=Math.max(u[h*4+1]/127,-1),m=1-(Math.abs(p)+Math.abs(A));if(m<0){let y=p,C=A;p=(1-Math.abs(C))*D.signNotZero(y),A=(1-Math.abs(y))*D.signNotZero(C)}let _=F2;_.x=p,_.y=A,_.z=m,_=d.normalize(_,F2),f[h*3+0]=_.x,f[h*3+1]=_.y,f[h*3+2]=_.z}return f}function D_t(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.indices],i=e.bufferViews[n.bufferView],o=n.count,r=n.componentType===j.UNSIGNED_SHORT?Uint16Array:Uint32Array,a=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(a===void 0){let f=e.buffers[i.buffer].extras._pipeline.source;return new r(f.buffer,f.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),o)}let s=e.buffers[a.buffer].extras._pipeline.source,c=new Uint8Array(s.buffer,s.byteOffset+(a.byteOffset??0)+(n.byteOffset??0),a.byteLength),u=new r(o);return Cy.decodeIndexBuffer(new Uint8Array(u.buffer),o,a.byteStride,c),u}function h9(e,t){let n=e.meshes[0].primitives[0],i=e.accessors[n.extensions.CESIUM_tile_edges[t]],o=e.bufferViews[i.bufferView],r=i.count,a=i.componentType===j.UNSIGNED_SHORT?Uint16Array:Uint32Array,s=o.extensions?o.extensions.EXT_meshopt_compression:void 0;if(s===void 0){let p=e.buffers[o.buffer].extras._pipeline.source;return new a(p.buffer,p.byteOffset+(o.byteOffset??0)+(i.byteOffset??0),r)}let c=e.buffers[s.buffer].extras._pipeline.source,u=new Uint8Array(c.buffer,c.byteOffset+(s.byteOffset??0)+(i.byteOffset??0),s.byteLength),f=new a(r),h=s.byteStride;return Cy.decodeIndexSequence(new Uint8Array(f.buffer),r,h,u),f}function v_t(e,t,n){return n.positions=w_t(e),n.normals=t?B_t(e):void 0,n.indices=D_t(e),n.edgeIndicesWest=h9(e,"left"),n.edgeIndicesSouth=h9(e,"bottom"),n.edgeIndicesEast=h9(e,"right"),n.edgeIndicesNorth=h9(e,"top"),n}S$.upsampleMesh=function(e){e=e??V.EMPTY_OBJECT;let{isEastChild:t,isNorthChild:n,parentMinimumHeight:i,parentMaximumHeight:o,skirtHeight:r}=e,a=e.parentIndexCountWithoutSkirts,s=e.parentIndices,c=e.parentVertexCountWithoutSkirts,u=e.parentVertices,f=Cr.clone(e.parentEncoding,new Cr),h=f.hasVertexNormals,p=f.hasWebMercatorT,A=f.exaggeration,m=f.exaggerationRelativeHeight,y=A!==1,C=ce.clone(e.rectangle,new ce),E=te.clone(e.ellipsoid),b=[],x=[],S=[],B=[],v=[],P=[],N=[],L=[];V_t(t,n,a,s,c,u,f,B,v,P,N,L,b,S,x);let g=ce.center(C,s_t);g.height=.5*(i+o);let I=me.toCartesian(g,E,c_t),T=b.length,w=new Cr(I,void 0,void 0,void 0,void 0,h,p,y,A,m),R=w.stride,O=jo.getSkirtVertexCount(v,P,N,L),G=T+O,F=B.length,U=jo.getSkirtIndexCountWithFilledCorners(O),Q=F+U,H=G<=65535?Uint16Array:Uint32Array,Y=new H(Q);Y.set(B);let $=new H(v),W=new H(P),K=new H(N),Z=new H(L),pe=new Float32Array(G*R),ge=0,re=At.eastNorthUpToFixedFrame(I,E,__t),ye=M.inverseTransformation(re,y_t),Ce=C.west,Pe=C.east,Ne=C.south,Le=C.north,Oe=mi.geodeticLatitudeToMercatorAngle(Ne),Fe=1/(mi.geodeticLatitudeToMercatorAngle(Le)-Oe),_t=Number.POSITIVE_INFINITY,rt=Number.NEGATIVE_INFINITY,Ye=d.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,A_t),st=d.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,g_t);for(let mt=0;mt<T;mt++){let Gt=b[mt],Hn=s[Gt*3+0],Je=s[Gt*3+1],fo=s[Gt*3+2],Vt=C_t;Vt.x=x[mt*2+0],Vt.y=x[mt*2+1];let Lo=Vt.x,io=Vt.y,Qi=S[mt*2+0],Yo=S[mt*2+1],ai=1-Qi-Yo,Xn=f.decodeHeight(u,Hn),oo=f.decodeHeight(u,Je),Oo=f.decodeHeight(u,fo),yo=Xn*Qi+oo*Yo+Oo*ai;_t=Math.min(yo,_t),rt=Math.max(yo,rt);let or=D.lerp(Ce,Pe,Lo),qo=D.lerp(Ne,Le,io),bn=me.fromRadians(or,qo,yo,u_t),wi=me.toCartesian(bn,E,f_t),Ln=M.multiplyByPoint(ye,wi,h_t);Ye=d.minimumByComponent(Ln,Ye,Ye),st=d.maximumByComponent(Ln,st,st);let Ko;if(h){let Hi=f.decodeNormal(u,Hn,o_t),Do=f.decodeNormal(u,Je,r_t),Ts=f.decodeNormal(u,fo,a_t),wa=d.fromElements(Hi.x*Qi+Do.x*Yo+Ts.x*ai,Hi.y*Qi+Do.y*Yo+Ts.y*ai,Hi.z*Qi+Do.z*Yo+Ts.z*ai,_xe);wa=d.normalize(wa,_xe),Ko=tn.octEncode(wa,T_t)}let Xo;p&&(Xo=(mi.geodeticLatitudeToMercatorAngle(qo)-Oe)*Fe);let ss;y&&(ss=E.geodeticSurfaceNormal(wi,S_t)),ge=w.encode(pe,ge,wi,Vt,yo,Ko,Xo,ss)}let ft=en.fromRectangle(C,_t,rt,E,I_t),St=le.fromVertices(pe,w.center,R,b_t),Se=new Am(E).computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid(w.center,pe,R,w.center,_t,E_t),Kt=new pc(d.clone(w.center,new d),pe,Y,F,T,_t,rt,C,le.clone(St),d.clone(Se),R,en.clone(ft),w,$,W,K,Z);return bxe(Kt,C,E,Ye,st,re,ye,r),Kt};function bxe(e,t,n,i,o,r,a,s){let{encoding:c}=e,u=c.stride,f=e.vertices,{hasVertexNormals:h,hasWebMercatorT:p,exaggeration:A,exaggerationRelativeHeight:m}=c,y=A!==1,C=e.vertexCountWithoutSkirts,E=C*u,b=f.length/u,x=b-C,S=e.indices,B=e.indexCountWithoutSkirts,v=e.westIndicesSouthToNorth,P=e.southIndicesEastToWest,N=e.eastIndicesNorthToSouth,L=e.northIndicesWestToEast;jo.addSkirtIndicesWithFilledCorners(v,P,N,L,C,S,B);let g=0,I=g+v.length,T=I+P.length,w=T+N.length,R=[v,P,N,L],O=[g,I,T,w],G=[-1,0,1,0],F=[0,-1,0,1],U=d.clone(i,m_t),Q=d.clone(o,p_t),H=e.maximumHeight,Y=e.minimumHeight-s;for(let K=0;K<x;K++){let Z=0;for(Z=0;Z<3&&!(K<O[Z+1]);Z++);let pe=R[Z][K-O[Z]],ge=c.decodeTextureCoordinates(f,pe,gxe),re=1e-4,ye=ge.x+G[Z]*re,Ce=ge.y+F[Z]*re,Pe=D.lerp(t.west,t.east,ye),Ne=D.clamp(D.lerp(t.south,t.north,Ce),-D.PI_OVER_TWO,+D.PI_OVER_TWO),Oe=c.decodeHeight(f,pe)-s,ot=me.fromRadians(Pe,Ne,Oe,l_t),Fe=me.toCartesian(ot,n,Axe),_t;h&&(_t=c.getOctEncodedNormal(f,pe,yxe));let rt;p&&(rt=c.decodeWebMercatorT(f,pe));let Ye;y&&(Ye=n.geodeticSurfaceNormal(Fe,Cxe)),E=c.encode(f,E,Fe,ge,Oe,_t,rt,Ye);let st=M.multiplyByPoint(a,Fe,d_t);d.minimumByComponent(st,U,U),d.maximumByComponent(st,Q,Q)}let $=ff.fromCorners(U,Q,x_t),W=new Cr(c.center,$,Y,H,r,c.hasVertexNormals,c.hasWebMercatorT,y,A,m);if(c.quantization!==W.quantization){let K=W,Z=K.stride,pe=new Float32Array(b*Z),ge=0;for(let re=0;re<b;re++)ge=K.encode(pe,ge,c.decodePosition(f,re,Axe),c.decodeTextureCoordinates(f,re,gxe),c.decodeHeight(f,re),c.hasVertexNormals?c.getOctEncodedNormal(f,re,yxe):void 0,c.hasWebMercatorT?c.decodeWebMercatorT(f,re):void 0,c.hasGeodeticSurfaceNormals?c.decodeGeodeticSurfaceNormal(f,re,Cxe):void 0);e.vertices=pe,e.stride=Z,e.encoding=K}return e}var w$=0,P_t=1,B$=2,D$=3,R_t=4,M_t=new d,N_t=[new d,new d,new d,new d,new d,new d],L_t=[new k,new k,new k,new k,new k,new k],O_t=[new d,new d,new d,new d,new d,new d],F_t=[new k,new k,new k,new k,new k,new k];function Exe(e,t,n,i){switch(n){case w$:return D.sign(i.x-e.x);case B$:return D.sign(t.x-i.x);case D$:return D.sign(i.y-e.y);default:return D.sign(t.y-i.y)}}function Q_t(e,t,n,i,o,r){let a,s,c;switch(n){case w$:a=(e.x-i.x)/(o.x-i.x),s=e.x,c=i.y+(o.y-i.y)*a;break;case B$:a=(t.x-i.x)/(o.x-i.x),s=t.x,c=i.y+(o.y-i.y)*a;break;case D$:a=(e.y-i.y)/(o.y-i.y),s=i.x+(o.x-i.x)*a,c=e.y;break;default:a=(t.y-i.y)/(o.y-i.y),s=i.x+(o.x-i.x)*a,c=t.y;break}return d.fromElements(s,c,a,r)}var k_t={length:0,coordinates:[new k,new k,new k,new k,new k,new k],barycentricCoordinates:[new d,new d,new d,new d,new d,new d]};function U_t(e,t,n,i,o,r,a,s){let c=0,u=L_t,f=N_t,h=3,p=F_t;k.clone(o,p[0]),k.clone(r,p[1]),k.clone(a,p[2]);let A=O_t;d.fromElements(1,0,0,A[0]),d.fromElements(0,1,0,A[1]),d.fromElements(0,0,1,A[2]);for(let m=0;m<t;m++){let _=(e+m)%R_t,y=u,C=f;u=p,f=A,c=h,p=y,A=C,h=0;let E=c-1,b=u[E],x=f[E],S=Exe(n,i,_,b);for(let B=0;B<c;B++){let v=u[B],P=f[B],N=Exe(n,i,_,v);if(S*N===-1){let L=Q_t(n,i,_,b,v,M_t),{x:g,y:I,z:T}=L,w=1-T,R=x.x*w+P.x*T,O=x.y*w+P.y*T,G=x.z*w+P.z*T;k.fromElements(g,I,p[h]),d.fromElements(R,O,G,A[h]),h++}N>=0&&(k.clone(v,p[h]),d.clone(P,A[h]),h++),E=B,b=v,x=P,S=N}if(h===0)break}s.length=h;for(let m=0;m<h;m++)k.clone(p[m],s.coordinates[m]),d.clone(A[m],s.barycentricCoordinates[m]);return s}function z_t(e,t,n,i,o,r,a,s){return U_t(e?t?D$:w$:t?B$:P_t,2,n,i,o,r,a,s)}var G_t=[[],[0],[1],[0,1],[2],[0,2],[1,2],[0,1,2]];function V_t(e,t,n,i,o,r,a,s,c,u,f,h,p,A,m){let _={},y=e?.5:0,C=e?1:.5,E=t?.5:0,b=t?1:.5,x=Zgt;x.x=y,x.y=E;let S=$gt;S.x=C,S.y=b;let B=0;for(let v=0;v<n;v+=3){let P=i[v+0],N=i[v+1],L=i[v+2],g=a.decodeTextureCoordinates(r,P,t_t),I=a.decodeTextureCoordinates(r,N,n_t),T=a.decodeTextureCoordinates(r,L,i_t),w=z_t(e,t,x,S,g,I,T,k_t),R=w.length;if(R<3)continue;let O=e_t;for(let Q=0;Q<R;Q++){let H=w.barycentricCoordinates[Q],Y=H.x,$=H.y,W=H.z,K=Math.ceil(Y)|Math.ceil($)<<1|Math.ceil(W)<<2,Z=G_t[K],pe,ge=!1;if(Z.length===1){let re=Z[0],Ce=i[v+re];pe=_[Ce],pe===void 0&&(ge=!0,pe=B++,_[Ce]=pe)}else if(Z.length===2){let re=Z[0],ye=Z[1],Ce=i[v+re],Pe=i[v+ye],Ne=w.barycentricCoordinates[(Q+R-1)%R],Le=Math.ceil(Ne.x)|Math.ceil(Ne.y)<<1|Math.ceil(Ne.z)<<2,Oe=K===Le,ot=Math.min(Ce,Pe),Fe=Math.max(Ce,Pe),_t=o+2*(ot*o+Fe),rt=_t+0,Ye=_t+1,st=_[rt],ft=_[Ye],St=!Oe==(st===void 0||ft===void 0);if(pe=St?st:ft,pe===void 0){ge=!0,pe=B++;let Ie=St?rt:Ye;_[Ie]=pe}}else ge=!0,pe=B++;if(O[Q]=pe,ge){let re=v/3;p.push(re);let ye=w.coordinates[Q],Ce=(ye.x-y)/(C-y),Pe=(ye.y-E)/(b-E);m.push(Ce,Pe),A.push(Y,$),Ce===0?c.push(pe):Ce===1&&f.push(pe),Pe===0?u.push(pe):Pe===1&&h.push(pe)}}let G=O[0],F=O[1],U=O[2];s.push(G,F,U);for(let Q=3;Q<R;Q++)F=U,U=O[Q],s.push(G,F,U)}c.sort(function(v,P){return m[v*2+1]-m[P*2+1]}),u.sort(function(v,P){return m[P*2+0]-m[v*2+0]}),f.sort(function(v,P){return m[P*2+1]-m[v*2+1]}),h.sort(function(v,P){return m[v*2+0]-m[P*2+0]})}var Hw=S$;var m9={};m9.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,o,r){l(r)?r.length=0:r=[];let a,s,c;t?(a=n<e,s=i<e,c=o<e):(a=n>e,s=i>e,c=o>e);let u=a+s+c,f,h,p,A,m,_;return u===1?a?(f=(e-n)/(i-n),h=(e-n)/(o-n),r.push(1),r.push(2),h!==1&&(r.push(-1),r.push(0),r.push(2),r.push(h)),f!==1&&(r.push(-1),r.push(0),r.push(1),r.push(f))):s?(p=(e-i)/(o-i),A=(e-i)/(n-i),r.push(2),r.push(0),A!==1&&(r.push(-1),r.push(1),r.push(0),r.push(A)),p!==1&&(r.push(-1),r.push(1),r.push(2),r.push(p))):c&&(m=(e-o)/(n-o),_=(e-o)/(i-o),r.push(0),r.push(1),_!==1&&(r.push(-1),r.push(2),r.push(1),r.push(_)),m!==1&&(r.push(-1),r.push(2),r.push(0),r.push(m))):u===2?!a&&n!==e?(A=(e-i)/(n-i),m=(e-o)/(n-o),r.push(0),r.push(-1),r.push(1),r.push(0),r.push(A),r.push(-1),r.push(2),r.push(0),r.push(m)):!s&&i!==e?(_=(e-o)/(i-o),f=(e-n)/(i-n),r.push(1),r.push(-1),r.push(2),r.push(1),r.push(_),r.push(-1),r.push(0),r.push(1),r.push(f)):!c&&o!==e&&(h=(e-n)/(o-n),p=(e-i)/(o-i),r.push(2),r.push(-1),r.push(0),r.push(2),r.push(h),r.push(-1),r.push(1),r.push(2),r.push(p)):u!==3&&(r.push(0),r.push(1),r.push(2)),r};m9.computeBarycentricCoordinates=function(e,t,n,i,o,r,a,s,c){let u=n-a,f=a-o,h=r-s,p=i-s,A=1/(h*u+f*p),m=t-s,_=e-a,y=(h*_+f*m)*A,C=(-p*_+u*m)*A,E=1-y-C;return l(c)?(c.x=y,c.y=C,c.z=E,c):new d(y,C,E)};m9.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,o,r,a,s,c){let u=(a-o)*(t-r)-(s-r)*(e-o),f=(n-e)*(t-r)-(i-t)*(e-o),h=(s-r)*(n-e)-(a-o)*(i-t);if(h===0)return;let p=u/h,A=f/h;if(p>=0&&p<=1&&A>=0&&A<=1)return l(c)||(c=new k),c.x=e+p*(n-e),c.y=t+p*(i-t),c};var Om=m9;function E_(e){e=e??V.EMPTY_OBJECT,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._skirtHeight=e.skirtHeight,this._boundingSphere=le.clone(e.boundingSphere,new le),this._orientedBoundingBox=en.clone(e.orientedBoundingBox,new en),this._horizonOcclusionPoint=d.clone(e.horizonOcclusionPoint,new d),this._hasVertexNormals=e.requestVertexNormals??!1,this._hasWaterMask=e.requestWaterMask??!1,this._hasWebMercatorT=!0,this._credits=e.credits,this._childTileMask=e.childTileMask??15,this._gltf=e.gltf,this._mesh=void 0,this._waterMask=e.waterMask}Object.defineProperties(E_.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}}});E_.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return i===void 0?void 0:xxe(i,e,t,n)};E_.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};var Ixe="createVerticesFromCesium3DTilesTerrain",H_t=new Zn(Ixe),W_t=new Zn(Ixe,Wu.maximumAsynchronousTasks);E_.prototype.createMesh=function(e){e=e??V.EMPTY_OBJECT;let n=e.throttle??!0?W_t:H_t,i=e.tilingScheme,o=i.ellipsoid,r=e.x,a=e.y,s=e.level,c=i.tileXYToRectangle(r,a,s,new ce),u=this._gltf,f=n.scheduleTask({ellipsoid:o,rectangle:c,hasVertexNormals:this._hasVertexNormals,hasWaterMask:this._hasWaterMask,hasWebMercatorT:this._hasWebMercatorT,gltf:u,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,boundingSphere:this._boundingSphere,orientedBoundingBox:this._orientedBoundingBox,horizonOcclusionPoint:this._horizonOcclusionPoint,skirtHeight:this._skirtHeight,exaggeration:e.exaggeration,exaggerationRelativeHeight:e.exaggerationRelativeHeight});if(!l(f))return;let h=this;return Promise.resolve(f).then(function(p){let A=p,m=Cr.clone(A.encoding,new Cr),_=new Float32Array(A.verticesBuffer),y=_.length/m.stride,C=A.vertexCountWithoutSkirts,E=y<=65535?Uint16Array:Uint32Array,b=new E(A.indicesBuffer),x=new E(A.westIndicesBuffer),S=new E(A.eastIndicesBuffer),B=new E(A.southIndicesBuffer),v=new E(A.northIndicesBuffer),P=A.indexCountWithoutSkirts,N=h._minimumHeight,L=h._maximumHeight,g=d.clone(m.center,new d),I=le.clone(h._boundingSphere,new le),T=d.clone(h._horizonOcclusionPoint,new d),w=en.clone(h._orientedBoundingBox,new en),R=new pc(g,_,b,P,C,N,L,c,I,T,m.stride,w,m,x,B,S,v);return h._mesh=R,Promise.resolve(R)})};E_.prototype._createMeshSync=function(e){e=e??V.EMPTY_OBJECT;let t=e.tilingScheme,n=t.ellipsoid,i=e.x,o=e.y,r=e.level,a=t.tileXYToRectangle(i,o,r,new ce),s=Hw.createMesh({ellipsoid:n,rectangle:a,hasVertexNormals:this._hasVertexNormals,hasWebMercatorT:this._hasWebMercatorT,gltf:this._gltf,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,boundingSphere:this._boundingSphere,orientedBoundingBox:this._orientedBoundingBox,horizonOcclusionPoint:this._horizonOcclusionPoint,skirtHeight:this._skirtHeight,exaggeration:e.exaggeration,exaggerationRelativeHeight:e.exaggerationRelativeHeight}),c=this;return Promise.resolve(s).then(function(u){return c._mesh=u,Promise.resolve(u)})};E_.prototype.upsample=function(e,t,n,i,o,r,a){let s=this._mesh;return s===void 0?void 0:p9(!1,s,this._skirtHeight,this._credits,e,t,n,i,o,r,a)};E_.prototype._upsampleSync=function(e,t,n,i,o,r,a){let s=this._mesh;return s===void 0?void 0:p9(!0,s,this._skirtHeight,this._credits,e,t,n,i,o,r,a)};E_.prototype.wasCreatedByUpsampling=function(){return!1};function C_(e){e=e??V.EMPTY_OBJECT,this._mesh=e.terrainMesh,this._skirtHeight=e.skirtHeight,this._credits=e.credits}C_.prototype.createMesh=function(e){return e=e??V.EMPTY_OBJECT,Promise.resolve(this._mesh)};C_.prototype.upsample=function(e,t,n,i,o,r,a){return p9(!1,this._mesh,this._skirtHeight,this._credits,e,t,n,i,o,r,a)};C_.prototype._upsampleSync=function(e,t,n,i,o,r,a){return p9(!0,this._mesh,this._skirtHeight,this._credits,e,t,n,i,o,r,a)};C_.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return xxe(i,e,t,n)};C_.prototype.wasCreatedByUpsampling=function(){return!0};C_.prototype.isChildAvailable=function(e,t,n,i){return!1};Object.defineProperties(C_.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var j_t=new Zn("upsampleVerticesFromCesium3DTilesTerrain",Wu.maximumAsynchronousTasks);function p9(e,t,n,i,o,r,a,s,c,u,f){if(f-s>1)throw new de("Upsampling through more than one level at a time is not currently supported.");let p=n*.5,A=r*2!==c,m=a*2===u,_=o.tileXYToRectangle(c,u,f,new ce),y=o.ellipsoid,C={isEastChild:A,isNorthChild:m,rectangle:_,ellipsoid:y,skirtHeight:p,parentVertices:t.vertices,parentIndices:t.indices,parentVertexCountWithoutSkirts:t.vertexCountWithoutSkirts,parentIndexCountWithoutSkirts:t.indexCountWithoutSkirts,parentMinimumHeight:t.minimumHeight,parentMaximumHeight:t.maximumHeight,parentEncoding:t.encoding};if(e){let b=Hw.upsampleMesh(C),x=new C_({terrainMesh:b,skirtHeight:p,credits:i});return Promise.resolve(x)}let E=j_t.scheduleTask(C);if(E!==void 0)return E.then(function(b){let x=Cr.clone(b.encoding,new Cr),S=x.stride,B=new Float32Array(b.verticesBuffer),v=B.length/S,P=b.vertexCountWithoutSkirts,N=v<=65535?Uint16Array:Uint32Array,L=new N(b.indicesBuffer),g=new N(b.westIndicesBuffer),I=new N(b.eastIndicesBuffer),T=new N(b.southIndicesBuffer),w=new N(b.northIndicesBuffer),R=b.indexCountWithoutSkirts,O=b.minimumHeight,G=b.maximumHeight,F=d.clone(x.center,new d),U=le.clone(b.boundingSphere,new le),Q=d.clone(b.horizonOcclusionPoint,new d),H=en.clone(b.orientedBoundingBox,new en),Y=new pc(F,B,L,R,P,O,G,_,U,Q,S,H,x,g,T,I,w),$=new C_({terrainMesh:Y,skirtHeight:p,credits:i});return Promise.resolve($)})}var Y_t=new k,q_t=new k,K_t=new k,X_t=new d;function xxe(e,t,n,i){let o=D.clamp((n-t.west)/t.width,0,1),r=D.clamp((i-t.south)/t.height,0,1),{vertices:a,encoding:s,indices:c}=e;for(let u=0;u<e.indexCountWithoutSkirts;u+=3){let f=c[u],h=c[u+1],p=c[u+2],A=s.decodeTextureCoordinates(a,f,Y_t),m=s.decodeTextureCoordinates(a,h,q_t),_=s.decodeTextureCoordinates(a,p,K_t),y=Math.min(A.x,m.x,_.x),C=Math.max(A.x,m.x,_.x),E=Math.min(A.y,m.y,_.y),b=Math.max(A.y,m.y,_.y);if(o>=y&&o<=C&&r>=E&&r<=b){let x=Om.computeBarycentricCoordinates(o,r,A.x,A.y,m.x,m.y,_.x,_.y,X_t);if(x.x>=0&&x.y>=0&&x.z>=0){let S=s.decodeHeight(a,f),B=s.decodeHeight(a,h),v=s.decodeHeight(a,p);return x.x*S+x.y*B+x.z*v}}}return 0}var Q2=E_;function Fm(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=l(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(Fm.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}}});Fm.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,o=new Fm({comparator:t,maximumLength:e});o._length=i;for(let r=0;r<i;r++)o._array[r]=n[r];return o};Fm.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};Fm.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)Txe(this,t)};Fm.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++,Txe(this,i),t};Fm.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],Sxe(this,0)),this._array[e-1]=void 0,t};Fm.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=v$(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&Sxe(this,n)}return this._array[e-1]=void 0,t};Fm.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};Fm.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[v$(this,1,2)?1:2]};function A9(e,t,n){let i=e._array,o=i[t];i[t]=i[n],i[n]=o}function k2(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function v$(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function Txe(e,t){if(t===0)return;let n=Math.floor(D.log2(t+1))%2===0,i=Math.floor((t-1)/2),o=k2(e,t,i);for(o!==n&&(A9(e,t,i),t=i);t>=3;){let r=Math.floor((t-3)/4);if(k2(e,t,r)!==o)break;A9(e,t,r),t=r}}function Sxe(e,t){let n=e._length,i=Math.floor(D.log2(t+1))%2===0,o;for(;(o=2*t+1)<n;){let r=o,a=o+1;if(a<n){k2(e,a,r)===i&&(r=a);let s=2*o+1,c=Math.max(Math.min(n-s,4),0);for(let u=0;u<c;u++){let f=s+u;k2(e,f,r)===i&&(r=f)}}if(k2(e,r,t)===i&&(A9(e,r,t),r!==o&&r!==a)){let s=Math.floor((r-1)/2);v$(e,r,s)===i&&A9(e,r,s)}t=r}}var b_=Fm;function nA(e){e=e??V.EMPTY_OBJECT;let t=e.credit;typeof t=="string"&&(t=new Et(t)),this._credit=t,this._tileCredits=void 0,this._errorEvent=new _e,this._ellipsoid=e.ellipsoid??te.WGS84,this._tilingScheme=new qi({ellipsoid:this._ellipsoid}),this._subtreeCache=new oI({provider:this}),this._tileset0=void 0,this._tileset1=void 0,this._resource=void 0,this._requestVertexNormals=e.requestVertexNormals??!1,this._requestWaterMask=e.requestWaterMask??!1}nA.fromUrl=async function(e,t){t=t??V.EMPTY_OBJECT,e=await Promise.resolve(e);let n=De.createIfNeeded(e),i;try{i=await n.fetchJson()}catch(f){throw new ue("Could not load tileset JSON",f)}let o=new nA(t);o._tileCredits=n.credits,o._resource=n;let r=i.root.children,a=r[0],s=r[1],c=i.schema,u=Vl.fromJson(c);return o._tileset0=new Rp(n,a,u),o._tileset1=new Rp(n,s,u),o};nA.fromIonAssetId=async function(e,t){let n=await fa.fromAssetId(e);return nA.fromUrl(n,t)};var J_t=new Array(3);nA.prototype.requestTileGeometry=async function(e,t,n,i){let o=Bxe(n,e),r=o===0?this._tileset0:this._tileset1,a=Dxe(r,n,e,t),s=a.getSubtreeCoordinates(),c=this._subtreeCache,u=c.find(o,s),f=this._requestWaterMask,h=this,p;if(u===void 0){let E=r.subtreeUriTemplate.getDerivedResource({templateValues:s.getTemplateValues()});p=r.baseResource.getDerivedResource({url:E.url}).fetchArrayBuffer().then(async function(x){if(u=c.find(o,s),u===void 0){let S=new Uint8Array(x);u=await ag.fromSubtreeJson(h._resource,void 0,S,r,s),c.addSubtree(o,u)}return u})}else p=Promise.resolve(u);let A=r.contentUriTemplates[0].getDerivedResource({templateValues:a.getTemplateValues()}),m=r.baseResource.getDerivedResource({url:A.url}),_=m.fetchArrayBuffer();if(_===void 0)return;let y=_.then(E=>C0(new Uint8Array(E))),C=J_t;C[0]=p,C[1]=y,C[2]=f?y.then(E=>Z_t(E,m)):void 0;try{let E=await Promise.all(C),b=E[0],x=E[1],S=E[2],B=b.getTileMetadataView(a),v=B.getPropertyBySemantic(wd.TILE_MINIMUM_HEIGHT),P=B.getPropertyBySemantic(wd.TILE_MAXIMUM_HEIGHT),N=B.getPropertyBySemantic(wd.TILE_BOUNDING_SPHERE),L=le.unpack(N,0,new le),g=B.getPropertyBySemantic(wd.TILE_HORIZON_OCCLUSION_POINT),T=h._tilingScheme.tileXYToRectangle(e,t,n,new ce),w=h._ellipsoid,R=en.fromRectangle(T,v,P,w,new en),O=h.getLevelMaximumGeometricError(n)*5,G=g9(r,b,a,0,0),F=g9(r,b,a,1,0),U=g9(r,b,a,0,1),Q=g9(r,b,a,1,1),H=(G?1:0)|(F?2:0)|(U?4:0)|(Q?8:0),Y=new Q2({gltf:x,minimumHeight:v,maximumHeight:P,boundingSphere:L,orientedBoundingBox:R,horizonOcclusionPoint:g,skirtHeight:O,requestVertexNormals:h._requestVertexNormals,childTileMask:H,credits:h._tileCredits,waterMask:S});return Promise.resolve(Y)}catch(E){console.log(`Could not load subtree: ${o} ${s.level} ${s.x} ${s.y}: ${E}`),console.log(`Could not load tile: ${o} ${a.level} ${a.x} ${a.y}: ${E}`);return}};nA.prototype.getTileDataAvailable=function(e,t,n){let i=this._subtreeCache,o=Bxe(n,e),r=o===0?this._tileset0:this._tileset1,a=Dxe(r,n,e,t),s=a.getSubtreeCoordinates(),c=i.find(o,s);if(c!==void 0)return c.tileIsAvailableAtCoordinates(a);if(s.isImplicitTilesetRoot())return a.isSubtreeRoot()?!0:void 0;let u=s.getParentSubtreeCoordinates(),f=i.find(o,u);if(f!==void 0)return f.childSubtreeIsAvailableAtCoordinates(s)?a.isSubtreeRoot()?!0:void 0:!1};function Bxe(e,t){let n=1<<e;return t/n|0}function Dxe(e,t,n,i){let o=1<<t,r=t,a=n%o,s=o-i-1,{subdivisionScheme:c,subtreeLevels:u}=e;return new Mp({subdivisionScheme:c,subtreeLevels:u,level:r,x:a,y:s})}async function Z_t(e,t){let n=e.extensions?.EXT_structural_metadata;if(!l(n)||!l(n.propertyTextures))return;let i=new Ty({schema:n.schema});await i.load();let o=i.schema,r,a;if(l(o.classes)){for(let A in o.classes)if(o.classes.hasOwnProperty(A)&&(r=o.classes[A],a=r.propertiesBySemantic.WATERMASK,l(a)))break}if(!l(a))return;let s=n.propertyTextures.find(A=>A.class===r.id);if(!l(s))throw new de(`Expected a propertyTexture with a class ${r.id}`);let c=s.properties[a.id],u=e.textures[c.index],f=e.images[u.source]?.bufferView,h=Ri.getBufferViewLoader({gltf:e,bufferViewId:f,gltfResource:t,baseResource:t});return await h.load(),await og({uint8Array:new Uint8Array(h.typedArray),format:"image/png",flipY:!1,skipColorSpaceConversion:!0})}function g9(e,t,n,i,o){let r=n.isBottomOfSubtree(),s=P$(e,1,i,o),c=n.getDescendantCoordinates(s);return r?t.childSubtreeIsAvailableAtCoordinates(c):t.tileIsAvailableAtCoordinates(c)}function P$(e,t,n,i){let{subdivisionScheme:o,subtreeLevels:r}=e;return new Mp({subdivisionScheme:o,subtreeLevels:r,level:t,x:n,y:i})}nA.prototype.loadTileDataAvailability=function(e,t,n){};nA.prototype.getLevelMaximumGeometricError=function(e){let t=this._ellipsoid;return jo.getEstimatedLevelZeroGeometricErrorForAHeightmap(t,64,2)/(1<<e)};Object.defineProperties(nA.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return this._requestWaterMask}},hasVertexNormals:{get:function(){return this._requestVertexNormals}},availability:{get:function(){return this._subtreeCache}}});function $_t(e,t,n){this.rootId=e,this.subtree=t,this.stamp=n}function oI(e){this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new b_({comparator:oI.comparator}),this._provider=e.provider}oI.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};oI.prototype.addSubtree=function(e,t){let n=new $_t(e,t,this._subtreeRequestCounter);this._queue.insert(n),this._subtreeRequestCounter++;let i=t.implicitCoordinates;if(i.level>0){let o=i.getParentSubtreeCoordinates(),r=this.find(e,o)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==n;)this._queue.removeMinimum()};oI.prototype.find=function(e,t){let n=this._queue,i=n.internalArray,{level:o,x:r,y:a}=t;for(let s=0;s<n.length;s++){let c=i[s],u=c.rootId,f=c.subtree.implicitCoordinates;if(u===e&&f.level===o&&f.x===r&&f.y===a)return c.subtree}};oI.prototype._computeMaximumImplicitTileCoordinatesAtPosition=function(e){let{longitude:t,latitude:n}=e,i=this._provider,o=t<0?0:1,r=o===0?i._tileset0:i._tileset1,a=r.subtreeLevels,s=P$(r,0,0,0),c=this.find(o,s);if(c===void 0)return;let u=c.implicitCoordinates,f=u.x,h=u.y,p=u.level,A=-D.PI,m=+D.PI,_=D.lerp(A,m,o/2),y=D.lerp(A,m,(o+1)/2),C=-D.PI*.5,E=+D.PI*.5,b=0,x=0,S=!0;for(;S;){let v=1/(1<<p),P=(y-_)*v,N=_+f*P,L=(E-C)*v,g=C+h*L;b=(t-N)/P,x=(n-g)/L;let I=wxe(r,u,b,x,a);if(c.childSubtreeIsAvailableAtCoordinates(I)){let T=this.find(o,I);if(T!==void 0)c=T,u=c.implicitCoordinates,f=u.x,h=u.y,p=u.level;else return I}else S=!1}let B;for(let v=0;v<a;v++){let P=wxe(r,u,b,x,v);if(c.tileIsAvailableAtCoordinates(P))B=P;else break}return B};function wxe(e,t,n,i,o){let r=1<<o,a=D.clamp(n*r|0,0,r-1),s=D.clamp(i*r|0,0,r-1),c=P$(e,o,a,s);return t.getDescendantCoordinates(c)}oI.prototype.computeMaximumLevelAtPosition=function(e){let t=this._computeMaximumImplicitTileCoordinatesAtPosition(e);return t===void 0?0:t.level};var R$=nA;function UC(e){e=e??V.EMPTY_OBJECT,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(a,s){return i[a]-i[s]}function r(a,s){return n[a]-n[s]}this._westIndices=y9(e.westIndices,o,t),this._southIndices=y9(e.southIndices,r,t),this._eastIndices=y9(e.eastIndices,o,t),this._northIndices=y9(e.northIndices,r,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=e.childTileMask??15,this._createdByUpsampling=e.createdByUpsampling??!1,this._waterMask=e.waterMask,this._mesh=void 0}Object.defineProperties(UC.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 _9=[];function y9(e,t,n){_9.length=e.length;let i=!1;for(let o=0,r=e.length;o<r;++o)_9[o]=e[o],i=i||o>0&&t(e[o-1],e[o])>0;return i?(_9.sort(t),Ue.createTypedArray(n,_9)):e}var vxe="createVerticesFromQuantizedTerrainMesh",eyt=new Zn(vxe),tyt=new Zn(vxe,Wu.maximumAsynchronousTasks);UC.prototype.createMesh=function(e){e=e??V.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,a=e.exaggerationRelativeHeight??0,s=e.throttle??!0,c=t.ellipsoid,u=t.tileXYToRectangle(n,i,o),h=(s?tyt:eyt).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:u,relativeToCenter:this._boundingSphere.center,ellipsoid:c,exaggeration:r,exaggerationRelativeHeight:a});if(!l(h))return;let p=this;return Promise.resolve(h).then(function(A){let m=p._quantizedVertices.length/3,_=m+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,y=Ue.createTypedArray(_,A.indices),C=new Float32Array(A.vertices),E=A.center,b=A.minimumHeight,x=A.maximumHeight,S=p._boundingSphere,B=p._orientedBoundingBox,v=d.clone(A.occludeePointInScaledSpace)??p._horizonOcclusionPoint,P=A.vertexStride,N=Cr.clone(A.encoding);return p._mesh=new pc(E,C,y,A.indexCountWithoutSkirts,m,b,x,u,S,v,P,B,N,A.westIndicesSouthToNorth,A.southIndicesEastToWest,A.eastIndicesNorthToSouth,A.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 nyt=new Zn("upsampleQuantizedTerrainMesh",Wu.maximumAsynchronousTasks);UC.prototype.upsample=function(e,t,n,i,o,r,a){let s=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,u=n*2===r,f=e.ellipsoid,h=e.tileXYToRectangle(o,r,a),p=nyt.scheduleTask({vertices:s.vertices,vertexCountWithoutSkirts:s.vertexCountWithoutSkirts,indices:s.indices,indexCountWithoutSkirts:s.indexCountWithoutSkirts,encoding:s.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:u,childRectangle:h,ellipsoid:f});if(!l(p))return;let A=Math.min(this._westSkirtHeight,this._eastSkirtHeight);A=Math.min(A,this._southSkirtHeight),A=Math.min(A,this._northSkirtHeight);let m=c?A*.5:this._westSkirtHeight,_=u?A*.5:this._southSkirtHeight,y=c?this._eastSkirtHeight:A*.5,C=u?this._northSkirtHeight:A*.5,E=this._credits;return Promise.resolve(p).then(function(b){let x=new Uint16Array(b.vertices),S=Ue.createTypedArray(x.length/3,b.indices),B;return l(b.encodedNormals)&&(B=new Uint8Array(b.encodedNormals)),new UC({quantizedVertices:x,indices:S,encodedNormals:B,minimumHeight:b.minimumHeight,maximumHeight:b.maximumHeight,boundingSphere:le.clone(b.boundingSphere),orientedBoundingBox:en.clone(b.orientedBoundingBox),horizonOcclusionPoint:d.clone(b.horizonOcclusionPoint),westIndices:b.westIndices,southIndices:b.southIndices,eastIndices:b.eastIndices,northIndices:b.northIndices,westSkirtHeight:m,southSkirtHeight:_,eastSkirtHeight:y,northSkirtHeight:C,childTileMask:0,credits:E,createdByUpsampling:!0})})};var M$=32767,Pxe=new d;UC.prototype.interpolateHeight=function(e,t,n){let i=D.clamp((t-e.west)/e.width,0,1);i*=M$;let o=D.clamp((n-e.south)/e.height,0,1);return o*=M$,l(this._mesh)?ayt(this,i,o):syt(this,i,o)};function Rxe(e,t,n,i,o,r,a,s){let c=Math.min(n,o,a),u=Math.max(n,o,a),f=Math.min(i,r,s),h=Math.max(i,r,s);return e>=c&&e<=u&&t>=f&&t<=h}var iyt=new k,oyt=new k,ryt=new k;function ayt(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,a=i.indices;for(let s=0,c=a.length;s<c;s+=3){let u=a[s],f=a[s+1],h=a[s+2],p=r.decodeTextureCoordinates(o,u,iyt),A=r.decodeTextureCoordinates(o,f,oyt),m=r.decodeTextureCoordinates(o,h,ryt);if(Rxe(t,n,p.x,p.y,A.x,A.y,m.x,m.y)){let _=Om.computeBarycentricCoordinates(t,n,p.x,p.y,A.x,A.y,m.x,m.y,Pxe);if(_.x>=-1e-15&&_.y>=-1e-15&&_.z>=-1e-15){let y=r.decodeHeight(o,u),C=r.decodeHeight(o,f),E=r.decodeHeight(o,h);return _.x*y+_.y*C+_.z*E}}}}function syt(e,t,n){let i=e._uValues,o=e._vValues,r=e._heightValues,a=e._indices;for(let s=0,c=a.length;s<c;s+=3){let u=a[s],f=a[s+1],h=a[s+2],p=i[u],A=i[f],m=i[h],_=o[u],y=o[f],C=o[h];if(Rxe(t,n,p,_,A,y,m,C)){let E=Om.computeBarycentricCoordinates(t,n,p,_,A,y,m,C,Pxe);if(E.x>=-1e-15&&E.y>=-1e-15&&E.z>=-1e-15){let b=E.x*r[u]+E.y*r[f]+E.z*r[h];return D.lerp(e._minimumHeight,e._maximumHeight,b/M$)}}}}UC.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};UC.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var rI=UC;function cyt(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 Nxe(e){this.requestVertexNormals=e.requestVertexNormals??!1,this.requestWaterMask=e.requestWaterMask??!1,this.requestMetadata=e.requestMetadata??!0,this.ellipsoid=e.ellipsoid??te.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=[]}Nxe.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 Lxe(e,t,n){if(!t.format){let _="The tile format is not specified in the layer.json file.";throw e.previousError=$o.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,_),new ue(_)}if(!t.tiles||t.tiles.length===0){let _="The layer.json file does not specify any tile URL templates.";throw e.previousError=$o.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,_),new ue(_)}let i=!1,o=!1,r=!1,a=!0,s=!1;if(t.format==="heightmap-1.0")s=!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 _=`The tile format "${t.format}" is invalid or not supported.`;throw e.previousError=$o.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,_),new ue(_)}let c=t.tiles,u=t.maxzoom;if(e.overallMaxZoom=Math.max(e.overallMaxZoom,u),!t.projection||t.projection==="EPSG:4326")e.tilingScheme=new qi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new Qa({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let _=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=$o.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,_),new ue(_)}if(e.levelZeroMaximumGeometricError=jo.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.heightmapWidth,e.tilingScheme.getNumberOfXTilesAtLevel(0)),!t.scheme||t.scheme==="tms"||t.scheme==="slippyMap")e.scheme=t.scheme;else{let _=`The scheme "${t.scheme}" is invalid or not supported.`;throw e.previousError=$o.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,_),new ue(_)}let f;l(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?i=!0:l(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(i=!0,a=!1),l(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(o=!0),l(t.extensions)&&t.extensions.indexOf("metadata")!==-1&&(r=!0);let h=t.metadataAvailability,p=t.available,A;if(l(p)&&!l(h)){A=new Lm(e.tilingScheme,p.length);for(let _=0;_<p.length;++_){let y=p[_],C=e.tilingScheme.getNumberOfYTilesAtLevel(_);l(e.overallAvailability[_])||(e.overallAvailability[_]=[]);for(let E=0;E<y.length;++E){let b=y[E],x=C-b.endY-1,S=C-b.startY-1;e.overallAvailability[_].push([b.startX,x,b.endX,S]),A.addAvailableTileRange(_,b.startX,x,b.endX,S)}}}else l(h)&&(f=new Lm(e.tilingScheme,u),A=new Lm(e.tilingScheme,u),e.overallAvailability[0]=[[0,0,1,0]],A.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 cyt({resource:e.lastResource,version:t.version,isHeightmap:s,tileUrlTemplates:c,availability:A,hasVertexNormals:i,hasWaterMask:o,hasMetadata:r,availabilityLevels:h,availabilityTilesLoaded:f,littleEndianExtensionSize:a}));let m=t.parentUrl;return l(m)?l(A)?(e.lastResource=e.lastResource.getDerivedResource({url:m}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await O$(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function lyt(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(l(t)&&(i+=`
${t.message}`),e.previousError=$o.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,i),e.previousError.retry)return O$(e,n);throw new ue(i)}async function uyt(e,t,n){await Lxe(e,t,n);let i=e.overallAvailability.length;if(i>0){let o=e.availability=new Lm(e.tilingScheme,e.overallMaxZoom);for(let r=0;r<i;++r){let a=e.overallAvailability[r];for(let s=0;s<a.length;++s){let c=a[s];o.addAvailableTileRange(r,c[0],c[1],c[2],c[3])}}}if(e.attribution.length>0){let o=new Et(e.attribution);e.tileCredits.push(o)}return!0}async function O$(e,t){try{let n=await e.layerJsonResource.fetchJson();return uyt(e,n,t)}catch(n){return l(n)&&n.statusCode===404?(await Lxe(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):lyt(e,n,t)}}function Qm(e){e=e??V.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=e.requestVertexNormals??!1,this._requestWaterMask=e.requestWaterMask??!1,this._requestMetadata=e.requestMetadata??!0,this._errorEvent=new _e;let t=e.credit;typeof t=="string"&&(t=new Et(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 N$={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function Mxe(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 fyt(e,t,n,i,o){let r=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new Oc({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 dyt(e,t,n,i,o,r){let a=r.littleEndianExtensionSize,s=0,c=3,u=c+1,f=Float64Array.BYTES_PER_ELEMENT*c,h=Float64Array.BYTES_PER_ELEMENT*u,A=Uint16Array.BYTES_PER_ELEMENT*3,m=3,_=Uint16Array.BYTES_PER_ELEMENT,y=_*m,C=new DataView(t),E=new d(C.getFloat64(s,!0),C.getFloat64(s+8,!0),C.getFloat64(s+16,!0));s+=f;let b=C.getFloat32(s,!0);s+=Float32Array.BYTES_PER_ELEMENT;let x=C.getFloat32(s,!0);s+=Float32Array.BYTES_PER_ELEMENT;let S=new le(new d(C.getFloat64(s,!0),C.getFloat64(s+8,!0),C.getFloat64(s+16,!0)),C.getFloat64(s+f,!0));s+=h;let B=new d(C.getFloat64(s,!0),C.getFloat64(s+8,!0),C.getFloat64(s+16,!0));s+=f;let v=C.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;let P=new Uint16Array(t,s,v*3);s+=v*A,v>64*1024&&(_=Uint32Array.BYTES_PER_ELEMENT,y=_*m);let N=P.subarray(0,v),L=P.subarray(v,2*v),g=P.subarray(v*2,3*v);tn.zigZagDeltaDecode(N,L,g),s%_!==0&&(s+=_-s%_);let I=C.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;let T=Ue.createTypedArrayFromArrayBuffer(v,t,s,I*m);s+=I*y;let w=0,R=T.length;for(let re=0;re<R;++re){let ye=T[re];T[re]=w-ye,ye===0&&++w}let O=C.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;let G=Ue.createTypedArrayFromArrayBuffer(v,t,s,O);s+=O*_;let F=C.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;let U=Ue.createTypedArrayFromArrayBuffer(v,t,s,F);s+=F*_;let Q=C.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;let H=Ue.createTypedArrayFromArrayBuffer(v,t,s,Q);s+=Q*_;let Y=C.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;let $=Ue.createTypedArrayFromArrayBuffer(v,t,s,Y);s+=Y*_;let W,K;for(;s<C.byteLength;){let re=C.getUint8(s,!0);s+=Uint8Array.BYTES_PER_ELEMENT;let ye=C.getUint32(s,a);if(s+=Uint32Array.BYTES_PER_ELEMENT,re===N$.OCT_VERTEX_NORMALS&&e._requestVertexNormals)W=new Uint8Array(t,s,v*2);else if(re===N$.WATER_MASK&&e._requestWaterMask)K=new Uint8Array(t,s,ye);else if(re===N$.METADATA&&e._requestMetadata){let Ce=C.getUint32(s,!0);if(Ce>0){let Ne=Br(new Uint8Array(t),s+Uint32Array.BYTES_PER_ELEMENT,Ce).available;if(l(Ne))for(let Le=0;Le<Ne.length;++Le){let Oe=n+Le+1,ot=Ne[Le],Fe=e._tilingScheme.getNumberOfYTilesAtLevel(Oe);for(let _t=0;_t<ot.length;++_t){let rt=ot[_t],Ye=Fe-rt.endY-1,st=Fe-rt.startY-1;e.availability.addAvailableTileRange(Oe,rt.startX,Ye,rt.endX,st),r.availability.addAvailableTileRange(Oe,rt.startX,Ye,rt.endX,st)}}}r.availabilityTilesLoaded.addAvailableTileRange(n,i,o,i,o)}s+=ye}let Z=e.getLevelMaximumGeometricError(n)*5,pe=e._tilingScheme.tileXYToRectangle(i,o,n),ge=en.fromRectangle(pe,b,x,e._tilingScheme.ellipsoid);return new rI({center:E,minimumHeight:b,maximumHeight:x,boundingSphere:S,orientedBoundingBox:ge,horizonOcclusionPoint:B,quantizedVertices:P,encodedNormals:W,indices:T,westIndices:G,southIndices:U,eastIndices:H,northIndices:$,westSkirtHeight:Z,southSkirtHeight:Z,eastSkirtHeight:Z,northSkirtHeight:Z,childTileMask:e.availability.computeChildMaskForTile(n,i,o),waterMask:K,credits:e._tileCredits})}Qm.prototype.requestTileGeometry=function(e,t,n,i){let o=this._layers,r,a=o.length,s=!1,c=Promise.resolve();if(a===1)r=o[0];else for(let u=0;u<a;++u){let f=o[u];if(!l(f.availability)||f.availability.isTileAvailable(n,e,t)){r=f;break}let h=F$(this,e,t,n,f,u===0);h.result&&(s=!0,c=c.then(()=>h.promise))}return!l(r)&&s?c.then(()=>new Promise(u=>{setTimeout(()=>{let f=this.requestTileGeometry(e,t,n,i);u(f)},0)})):Oxe(this,e,t,n,r,i)};function Oxe(e,t,n,i,o,r){if(!l(o))return Promise.reject(new ue("Terrain tile doesn't exist"));let a=o.tileUrlTemplates;if(a.length===0)return;let s;!e._scheme||e._scheme==="tms"?s=e._tilingScheme.getNumberOfYTilesAtLevel(i)-n-1:s=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 u,f,h=a[(t+s+i)%a.length],p=o.resource;l(p._ionEndpoint)&&!l(p._ionEndpoint.externalType)?(c.length!==0&&(f={extensions:c.join("-")}),u=Mxe(void 0)):u=Mxe(c);let A=p.getDerivedResource({url:h,templateValues:{version:o.version,z:i,x:t,y:s},queryParameters:f,headers:u,request:r}).fetchArrayBuffer();if(l(A))return A.then(function(m){return l(m)?l(e._heightmapStructure)?fyt(e,m,i,t,n):dyt(e,m,i,t,n,o):Promise.reject(new ue("Mesh buffer doesn't exist."))})}Object.defineProperties(Qm.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}}});Qm.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Qm.fromIonAssetId=async function(e,t){let n=await fa.fromAssetId(e);return Qm.fromUrl(n,t)};Qm.fromUrl=async function(e,t){t=t??V.EMPTY_OBJECT,e=await Promise.resolve(e);let n=De.createIfNeeded(e);n.appendForwardSlash();let i=new Nxe(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await O$(i);let o=new Qm(t);return i.build(o),o};Qm.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(F$(this,e,t,n,i[r],r===0).result)return;return!1};Qm.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 a=F$(this,e,t,n,i[r],r===0);if(l(a.promise))return a.promise}};function L$(e,t,n,i){if(i===0)return;let o=e.availabilityLevels,r=i%o===0?i-o:(i/o|0)*o,a=1<<i-r,s=t/a|0,c=n/a|0;return{level:r,x:s,y:c}}function F$(e,t,n,i,o,r){if(!l(o.availabilityLevels))return{result:!1};let a,s=function(){delete o.availabilityPromiseCache[a]},c=o.availabilityTilesLoaded,u=o.availability,f=L$(o,t,n,i);for(;l(f);){if(u.isTileAvailable(f.level,f.x,f.y)&&!c.isTileAvailable(f.level,f.x,f.y)){let h;if(!r&&(a=`${f.level}-${f.x}-${f.y}`,h=o.availabilityPromiseCache[a],!l(h))){let p=new Ir({throttle:!1,throttleByServer:!1,type:ja.TERRAIN});h=Oxe(e,f.x,f.y,f.level,o,p),l(h)&&(o.availabilityPromiseCache[a]=h,h.then(s))}return{result:!0,promise:h}}f=L$(o,f.x,f.y,f.level)}return{result:!1}}Qm._getAvailabilityTile=L$;var aI=Qm;function I_(e){e=e??V.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 ru(n),this._workerName="createCircleGeometry"}I_.packedLength=ru.packedLength;I_.pack=function(e,t,n){return ru.pack(e._ellipseGeometry,t,n)};var Fxe=new ru({center:new d,semiMajorAxis:1,semiMinorAxis:1}),Fc={center:new d,radius:void 0,ellipsoid:te.clone(te.default),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new ke,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};I_.unpack=function(e,t,n){let i=ru.unpack(e,t,Fxe);return Fc.center=d.clone(i._center,Fc.center),Fc.ellipsoid=te.clone(i._ellipsoid,Fc.ellipsoid),Fc.ellipsoid=te.clone(i._ellipsoid,Fxe._ellipsoid),Fc.height=i._height,Fc.extrudedHeight=i._extrudedHeight,Fc.granularity=i._granularity,Fc.vertexFormat=ke.clone(i._vertexFormat,Fc.vertexFormat),Fc.stRotation=i._stRotation,Fc.shadowVolume=i._shadowVolume,l(n)?(Fc.semiMajorAxis=i._semiMajorAxis,Fc.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new ru(Fc),n):(Fc.radius=i._semiMajorAxis,new I_(Fc))};I_.createGeometry=function(e){return ru.createGeometry(e._ellipseGeometry)};I_.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,o=e._ellipseGeometry._ellipsoid,r=t(i,o),a=n(i,o);return new I_({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:o,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:r,height:a,vertexFormat:ke.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(I_.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var Q$=I_;function Ww(e){e=e??V.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 Qf(n),this._workerName="createCircleOutlineGeometry"}Ww.packedLength=Qf.packedLength;Ww.pack=function(e,t,n){return Qf.pack(e._ellipseGeometry,t,n)};var hyt=new Qf({center:new d,semiMajorAxis:1,semiMinorAxis:1}),Wf={center:new d,radius:void 0,ellipsoid:te.clone(te.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};Ww.unpack=function(e,t,n){let i=Qf.unpack(e,t,hyt);return Wf.center=d.clone(i._center,Wf.center),Wf.ellipsoid=te.clone(i._ellipsoid,Wf.ellipsoid),Wf.height=i._height,Wf.extrudedHeight=i._extrudedHeight,Wf.granularity=i._granularity,Wf.numberOfVerticalLines=i._numberOfVerticalLines,l(n)?(Wf.semiMajorAxis=i._semiMajorAxis,Wf.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new Qf(Wf),n):(Wf.radius=i._semiMajorAxis,new Ww(Wf))};Ww.createGeometry=function(e){return Qf.createGeometry(e._ellipseGeometry)};var k$=Ww;function myt(e){return e=e??V.EMPTY_OBJECT,aI.fromIonAssetId(2426648,{requestVertexNormals:e.requestVertexNormals??!1})}var U2=myt;function pyt(e){return e=e??V.EMPTY_OBJECT,aI.fromIonAssetId(1,{requestVertexNormals:e.requestVertexNormals??!1,requestWaterMask:e.requestWaterMask??!1,ellipsoid:te.WGS84})}var sI=pyt;function jw(e){e=e??V.EMPTY_OBJECT,this._callback=e.callback,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new qi({ellipsoid:e.ellipsoid??te.default})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=jo.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new _e;let n=e.credit;typeof n=="string"&&(n=new Et(n)),this._credit=n}Object.defineProperties(jw.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}}});jw.prototype.requestTileGeometry=function(e,t,n,i){let o=this._callback(e,t,n);if(!l(o))return;let r=this._width,a=this._height;return Promise.resolve(o).then(function(s){let c=s;return Array.isArray(c)&&(c=new Float64Array(c)),new Oc({buffer:c,width:r,height:a})})};jw.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};jw.prototype.getTileDataAvailable=function(e,t,n){};jw.prototype.loadTileDataAvailability=function(e,t,n){};var U$=jw;var Ayt=1953029805,gyt=2917034100;function z$(e,t){if(z$.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===Ayt||o===gyt)return t;let r=new DataView(e),a=0,s=t.byteLength,c=s-s%8,u=n,f,h=8;for(;a<c;)for(h=(h+8)%24,f=h;a<c&&f<u;)i.setUint32(a,i.getUint32(a,!0)^r.getUint32(f,!0),!0),i.setUint32(a+4,i.getUint32(a+4,!0)^r.getUint32(f+4,!0),!0),a+=8,f+=24;if(a<s)for(f>=u&&(h=(h+8)%24,f=h);a<s;)i.setUint8(a,i.getUint8(a)^r.getUint8(f)),a++,f++}z$.passThroughDataForTesting=!1;var z2=z$;function Qxe(e){this.proxy=e}Qxe.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var G$=Qxe;function Yw(e){e=e??V.EMPTY_OBJECT,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new qi({ellipsoid:e.ellipsoid??te.default})),this._levelZeroMaximumGeometricError=jo.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new _e}Object.defineProperties(Yw.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(){}}});Yw.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new Oc({buffer:new Uint8Array(256),width:16,height:16}))};Yw.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Yw.prototype.getTileDataAvailable=function(e,t,n){};Yw.prototype.loadTileDataAvailability=function(e,t,n){};var cI=Yw;function iA(e){e=e??V.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=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this._cullingVolume=new Ka,this._perspectiveMatrix=new M,this._infinitePerspective=new M}function V$(e){let{top:t,bottom:n,right:i,left:o,near:r,far:a}=e;(t!==e._top||n!==e._bottom||o!==e._left||i!==e._right||r!==e._near||a!==e._far)&&(e._left=o,e._right=i,e._top=t,e._bottom=n,e._near=r,e._far=a,e._perspectiveMatrix=M.computePerspectiveOffCenter(o,i,n,t,r,a,e._perspectiveMatrix),e._infinitePerspective=M.computeInfinitePerspectiveOffCenter(o,i,n,t,r,e._infinitePerspective))}Object.defineProperties(iA.prototype,{projectionMatrix:{get:function(){return V$(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return V$(this),this._infinitePerspective}}});var _yt=new d,yyt=new d,Cyt=new d,Eyt=new d;iA.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,o=this.top,r=this.bottom,a=this.right,s=this.left,c=this.near,u=this.far,f=d.cross(t,n,_yt),h=yyt;d.multiplyByScalar(t,c,h),d.add(e,h,h);let p=Cyt;d.multiplyByScalar(t,u,p),d.add(e,p,p);let A=Eyt;d.multiplyByScalar(f,s,A),d.add(h,A,A),d.subtract(A,e,A),d.normalize(A,A),d.cross(A,n,A),d.normalize(A,A);let m=i[0];return l(m)||(m=i[0]=new ie),m.x=A.x,m.y=A.y,m.z=A.z,m.w=-d.dot(A,e),d.multiplyByScalar(f,a,A),d.add(h,A,A),d.subtract(A,e,A),d.cross(n,A,A),d.normalize(A,A),m=i[1],l(m)||(m=i[1]=new ie),m.x=A.x,m.y=A.y,m.z=A.z,m.w=-d.dot(A,e),d.multiplyByScalar(n,r,A),d.add(h,A,A),d.subtract(A,e,A),d.cross(f,A,A),d.normalize(A,A),m=i[2],l(m)||(m=i[2]=new ie),m.x=A.x,m.y=A.y,m.z=A.z,m.w=-d.dot(A,e),d.multiplyByScalar(n,o,A),d.add(h,A,A),d.subtract(A,e,A),d.cross(A,f,A),d.normalize(A,A),m=i[3],l(m)||(m=i[3]=new ie),m.x=A.x,m.y=A.y,m.z=A.z,m.w=-d.dot(A,e),m=i[4],l(m)||(m=i[4]=new ie),m.x=t.x,m.y=t.y,m.z=t.z,m.w=-d.dot(t,h),d.negate(t,A),m=i[5],l(m)||(m=i[5]=new ie),m.x=A.x,m.y=A.y,m.z=A.z,m.w=-d.dot(A,p),this._cullingVolume};iA.prototype.getPixelDimensions=function(e,t,n,i,o){V$(this);let r=1/this.near,a=this.top*r,s=2*i*n*a/t;a=this.right*r;let c=2*i*n*a/e;return o.x=c,o.y=s,o};iA.prototype.clone=function(e){return l(e)||(e=new iA),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};iA.prototype.equals=function(e){return l(e)&&e instanceof iA&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};iA.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof iA&&D.equalsEpsilon(this.right,e.right,t,n)&&D.equalsEpsilon(this.left,e.left,t,n)&&D.equalsEpsilon(this.top,e.top,t,n)&&D.equalsEpsilon(this.bottom,e.bottom,t,n)&&D.equalsEpsilon(this.near,e.near,t,n)&&D.equalsEpsilon(this.far,e.far,t,n)};var lu=iA;function ju(e){e=e??V.EMPTY_OBJECT,this._offCenterFrustum=new lu,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=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this.xOffset=e.xOffset??0,this._xOffset=this.xOffset,this.yOffset=e.yOffset??0,this._yOffset=this.yOffset}ju.packedLength=6;ju.pack=function(e,t,n){return n=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};ju.unpack=function(e,t,n){return t=t??0,l(n)||(n=new ju),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 km(e){if(!(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset))return;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;let n=e._offCenterFrustum;n.top=e.near*Math.tan(.5*e._fovy),n.bottom=-n.top,n.right=e.aspectRatio*n.top,n.left=-n.right,n.near=e.near,n.far=e.far,n.right+=e.xOffset,n.left+=e.xOffset,n.top+=e.yOffset,n.bottom+=e.yOffset}Object.defineProperties(ju.prototype,{projectionMatrix:{get:function(){return km(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return km(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return km(this),this._fovy}},sseDenominator:{get:function(){return km(this),this._sseDenominator}},offCenterFrustum:{get:function(){return km(this),this._offCenterFrustum}}});ju.prototype.computeCullingVolume=function(e,t,n){return km(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};ju.prototype.getPixelDimensions=function(e,t,n,i,o){return km(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};ju.prototype.clone=function(e){return l(e)||(e=new ju),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};ju.prototype.equals=function(e){return!l(e)||!(e instanceof ju)?!1:(km(this),km(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};ju.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof ju)?!1:(km(this),km(e),D.equalsEpsilon(this.fov,e.fov,t,n)&&D.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var Vi=ju;var C9=0,byt=1;function lI(e){let t=e.frustum,n=e.orientation,i=e.origin,o=e.vertexFormat??ke.DEFAULT,r=e._drawNearPlane??!0,a,s;t instanceof Vi?(a=C9,s=Vi.packedLength):t instanceof An&&(a=byt,s=An.packedLength),this._frustumType=a,this._frustum=t.clone(),this._origin=d.clone(i),this._orientation=Qe.clone(n),this._drawNearPlane=r,this._vertexFormat=o,this._workerName="createFrustumGeometry",this.packedLength=2+s+d.packedLength+Qe.packedLength+ke.packedLength}lI.pack=function(e,t,n){n=n??0;let i=e._frustumType,o=e._frustum;return t[n++]=i,i===C9?(Vi.pack(o,t,n),n+=Vi.packedLength):(An.pack(o,t,n),n+=An.packedLength),d.pack(e._origin,t,n),n+=d.packedLength,Qe.pack(e._orientation,t,n),n+=Qe.packedLength,ke.pack(e._vertexFormat,t,n),n+=ke.packedLength,t[n]=e._drawNearPlane?1:0,t};var Iyt=new Vi,xyt=new An,Tyt=new Qe,Syt=new d,wyt=new ke;lI.unpack=function(e,t,n){t=t??0;let i=e[t++],o;i===C9?(o=Vi.unpack(e,t,Iyt),t+=Vi.packedLength):(o=An.unpack(e,t,xyt),t+=An.packedLength);let r=d.unpack(e,t,Syt);t+=d.packedLength;let a=Qe.unpack(e,t,Tyt);t+=Qe.packedLength;let s=ke.unpack(e,t,wyt);t+=ke.packedLength;let c=e[t]===1;if(!l(n))return new lI({frustum:o,origin:r,orientation:a,vertexFormat:s,_drawNearPlane:c});let u=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(u),n._frustumType=i,n._origin=d.clone(r,n._origin),n._orientation=Qe.clone(a,n._orientation),n._vertexFormat=ke.clone(s,n._vertexFormat),n._drawNearPlane=c,n};function qw(e,t,n,i,o,r,a,s){let c=e/3*2;for(let u=0;u<4;++u)l(t)&&(t[e]=r.x,t[e+1]=r.y,t[e+2]=r.z),l(n)&&(n[e]=a.x,n[e+1]=a.y,n[e+2]=a.z),l(i)&&(i[e]=s.x,i[e+1]=s.y,i[e+2]=s.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 Byt=new J,Dyt=new M,H$=new M,kxe=new d,Uxe=new d,zxe=new d,vyt=new d,Pyt=new d,Ryt=new d,zC=new Array(3),G2=new Array(4);G2[0]=new ie(-1,-1,1,1);G2[1]=new ie(1,-1,1,1);G2[2]=new ie(1,1,1,1);G2[3]=new ie(-1,1,1,1);var Gxe=new Array(4);for(let e=0;e<4;++e)Gxe[e]=new ie;lI._computeNearFarPlanes=function(e,t,n,i,o,r,a,s){let c=J.fromQuaternion(t,Byt),u=r??kxe,f=a??Uxe,h=s??zxe;u=J.getColumn(c,0,u),f=J.getColumn(c,1,f),h=J.getColumn(c,2,h),d.normalize(u,u),d.normalize(f,f),d.normalize(h,h),d.negate(u,u);let p=M.computeView(e,h,f,u,Dyt),A,m,_=i.projectionMatrix;if(n===C9){let y=M.multiply(_,p,H$);m=M.inverse(y,H$)}else A=M.inverseTransformation(p,H$);l(m)?(zC[0]=i.near,zC[1]=i.far):(zC[0]=0,zC[1]=i.near,zC[2]=i.far);for(let y=0;y<2;++y)for(let C=0;C<4;++C){let E=ie.clone(G2[C],Gxe[C]);if(l(m)){E=M.multiplyByVector(m,E,E);let b=1/E.w;d.multiplyByScalar(E,b,E),d.subtract(E,e,E),d.normalize(E,E);let x=d.dot(h,E);d.multiplyByScalar(E,zC[y]/x,E),d.add(E,e,E)}else{let b=i.offCenterFrustum;l(b)&&(i=b);let x=zC[y],S=zC[y+1];E.x=(E.x*(i.right-i.left)+i.left+i.right)*.5,E.y=(E.y*(i.top-i.bottom)+i.bottom+i.top)*.5,E.z=(E.z*(x-S)-x-S)*.5,E.w=1,M.multiplyByVector(A,E,E)}o[12*y+C*3]=E.x,o[12*y+C*3+1]=E.y,o[12*y+C*3+2]=E.z}};lI.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,a=e._vertexFormat,s=r?6:5,c=new Float64Array(72);lI._computeNearFarPlanes(i,o,t,n,c);let u=24;c[u]=c[12],c[u+1]=c[13],c[u+2]=c[14],c[u+3]=c[0],c[u+4]=c[1],c[u+5]=c[2],c[u+6]=c[9],c[u+7]=c[10],c[u+8]=c[11],c[u+9]=c[21],c[u+10]=c[22],c[u+11]=c[23],u+=12,c[u]=c[15],c[u+1]=c[16],c[u+2]=c[17],c[u+3]=c[3],c[u+4]=c[4],c[u+5]=c[5],c[u+6]=c[0],c[u+7]=c[1],c[u+8]=c[2],c[u+9]=c[12],c[u+10]=c[13],c[u+11]=c[14],u+=12,c[u]=c[3],c[u+1]=c[4],c[u+2]=c[5],c[u+3]=c[15],c[u+4]=c[16],c[u+5]=c[17],c[u+6]=c[18],c[u+7]=c[19],c[u+8]=c[20],c[u+9]=c[6],c[u+10]=c[7],c[u+11]=c[8],u+=12,c[u]=c[6],c[u+1]=c[7],c[u+2]=c[8],c[u+3]=c[18],c[u+4]=c[19],c[u+5]=c[20],c[u+6]=c[21],c[u+7]=c[22],c[u+8]=c[23],c[u+9]=c[9],c[u+10]=c[10],c[u+11]=c[11],r||(c=c.subarray(12));let f=new _n({position:new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:c})});if(l(a.normal)||l(a.tangent)||l(a.bitangent)||l(a.st)){let p=l(a.normal)?new Float32Array(12*s):void 0,A=l(a.tangent)?new Float32Array(12*s):void 0,m=l(a.bitangent)?new Float32Array(12*s):void 0,_=l(a.st)?new Float32Array(8*s):void 0,y=kxe,C=Uxe,E=zxe,b=d.negate(y,vyt),x=d.negate(C,Pyt),S=d.negate(E,Ryt);u=0,r&&(qw(u,p,A,m,_,S,y,C),u+=12),qw(u,p,A,m,_,E,b,C),u+=12,qw(u,p,A,m,_,b,S,C),u+=12,qw(u,p,A,m,_,x,S,b),u+=12,qw(u,p,A,m,_,y,E,C),u+=12,qw(u,p,A,m,_,C,E,b),l(p)&&(f.normal=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:p})),l(A)&&(f.tangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:A})),l(m)&&(f.bitangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:m})),l(_)&&(f.st=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:_}))}let h=new Uint16Array(6*s);for(let p=0;p<s;++p){let A=p*6,m=p*4;h[A]=m,h[A+1]=m+1,h[A+2]=m+2,h[A+3]=m,h[A+4]=m+2,h[A+5]=m+3}return new yt({attributes:f,indices:h,primitiveType:ve.TRIANGLES,boundingSphere:le.fromVertices(c)})};var uI=lI;var W$=0,Myt=1;function V2(e){let t=e.frustum,n=e.orientation,i=e.origin,o=e._drawNearPlane??!0,r,a;t instanceof Vi?(r=W$,a=Vi.packedLength):t instanceof An&&(r=Myt,a=An.packedLength),this._frustumType=r,this._frustum=t.clone(),this._origin=d.clone(i),this._orientation=Qe.clone(n),this._drawNearPlane=o,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+a+d.packedLength+Qe.packedLength}V2.pack=function(e,t,n){n=n??0;let i=e._frustumType,o=e._frustum;return t[n++]=i,i===W$?(Vi.pack(o,t,n),n+=Vi.packedLength):(An.pack(o,t,n),n+=An.packedLength),d.pack(e._origin,t,n),n+=d.packedLength,Qe.pack(e._orientation,t,n),n+=Qe.packedLength,t[n]=e._drawNearPlane?1:0,t};var Nyt=new Vi,Lyt=new An,Oyt=new Qe,Fyt=new d;V2.unpack=function(e,t,n){t=t??0;let i=e[t++],o;i===W$?(o=Vi.unpack(e,t,Nyt),t+=Vi.packedLength):(o=An.unpack(e,t,Lyt),t+=An.packedLength);let r=d.unpack(e,t,Fyt);t+=d.packedLength;let a=Qe.unpack(e,t,Oyt);t+=Qe.packedLength;let s=e[t]===1;if(!l(n))return new V2({frustum:o,origin:r,orientation:a,_drawNearPlane:s});let c=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(c),n._frustumType=i,n._origin=d.clone(r,n._origin),n._orientation=Qe.clone(a,n._orientation),n._drawNearPlane=s,n};V2.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,a=new Float64Array(24);uI._computeNearFarPlanes(i,o,t,n,a);let s=new _n({position:new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:a})}),c,u,f=r?2:1,h=new Uint16Array(8*(f+1)),p=r?0:1;for(;p<2;++p)c=r?p*8:0,u=p*4,h[c]=u,h[c+1]=u+1,h[c+2]=u+1,h[c+3]=u+2,h[c+4]=u+2,h[c+5]=u+3,h[c+6]=u+3,h[c+7]=u;for(p=0;p<2;++p)c=(f+p)*8,u=p*4,h[c]=u,h[c+1]=u+4,h[c+2]=u+1,h[c+3]=u+5,h[c+4]=u+2,h[c+5]=u+6,h[c+6]=u+3,h[c+7]=u+7;return new yt({attributes:s,indices:h,primitiveType:ve.LINES,boundingSphere:le.fromVertices(a)})};var H2=V2;function E9(){de.throwInstantiationError()}Object.defineProperties(E9.prototype,{credit:{get:de.throwInstantiationError}});E9.getCreditsFromResult=function(e){if(l(e.attributions))return e.attributions.map(Et.getIonCredit)};E9.prototype.geocode=de.throwInstantiationError;var Kw=E9;var Qyt={SEARCH:0,AUTOCOMPLETE:1},GC=Object.freeze(Qyt);function Vxe(){de.throwInstantiationError()}Vxe.createGeometry=function(e){de.throwInstantiationError()};var j$=Vxe;function kyt(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 W2=kyt;var Wyt=Wr(Y$(),1);function Uyt(e,t){return(e&t)!==0}var hl=Uyt;var zyt=[1,2,4,8],Hxe=15,Gyt=16,Vyt=64,Hyt=128;function oA(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}oA.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 oA(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};oA.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};oA.prototype.hasSubtree=function(){return hl(this._bits,Gyt)};oA.prototype.hasImagery=function(){return hl(this._bits,Vyt)};oA.prototype.hasTerrain=function(){return hl(this._bits,Hyt)};oA.prototype.hasChildren=function(){return hl(this._bits,Hxe)};oA.prototype.hasChild=function(e){return hl(this._bits,zyt[e])};oA.prototype.getChildBitmask=function(){return this._bits&Hxe};var j2=oA;function jyt(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 Yyt=jyt(`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 jf(e){this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=D.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={}}Object.defineProperties(jf.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});jf.fromUrl=async function(e){let t=e;typeof t!="string"&&!(t instanceof De)&&(t=e.url);let n=De.createIfNeeded(t);n.appendForwardSlash();let i=new jf;i._resource=n;try{await qyt(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(o){let r=`An error occurred while accessing ${jxe(i,"",1).url}: ${o}`;throw new ue(r)}return i};jf.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,a=0;hl(t,r)?hl(e,r)&&(a|=1):(a|=2,hl(e,r)||(a|=1)),i+=a}return i};jf.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let o=i;o>=0;--o){let r=1<<o,a=+e[i-o];hl(a,2)?hl(a,1)||(t|=r):(n|=r,hl(a,1)&&(t|=r))}return{x:t,y:n,level:i}};jf.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 Wxe=new Zn("decodeGoogleEarthEnterprisePacket");jf.prototype.getQuadTreePacket=function(e,t,n){t=t??1,e=e??"";let o=jxe(this,e,t,n).fetchArrayBuffer();if(!l(o))return;let r=this._tileInfo,a=this.key;return o.then(function(s){return Wxe.scheduleTask({buffer:s,quadKey:e,type:"Metadata",key:a},[s]).then(function(u){let f,h=-1;if(e!==""){h=e.length+1;let m=u[e];f=r[e],f._bits|=m._bits,delete u[e]}let p=Object.keys(u);p.sort(function(m,_){return m.length-_.length});let A=p.length;for(let m=0;m<A;++m){let _=p[m];if(u[_]!==null){let C=j2.clone(u[_]),E=_.length;if(E===h)C.setParent(f);else if(E>1){let b=r[_.substring(0,_.length-1)];C.setParent(b)}r[_]=C}else r[_]=null}})})};jf.prototype.populateSubtree=function(e,t,n,i){let o=jf.tileXYToQuadKey(e,t,n);return X$(this,o,i)};function X$(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 a,s=e._subtreePromises,c=s[o];if(l(c))return c.then(function(){return a=new Ir({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),X$(e,t,a)});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 s[o]=c,c.then(function(){return a=new Ir({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),X$(e,t,a)}).finally(function(){delete s[o]})}jf.prototype.getTileInformation=function(e,t,n){let i=jf.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};jf.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function jxe(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var q$,K$;function qyt(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(K$)){let n=Zt("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;K$=mE(n).then(function(){q$=window.cesiumGoogleEarthDbRootParser(Wyt),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return K$.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=q$.EncryptedDbRootProto.decode(new Uint8Array(n)),o=i.encryptionData,r=o.byteOffset,a=r+o.byteLength,s=e.key=o.buffer.slice(r,a);o=i.dbrootData,r=o.byteOffset,a=r+o.byteLength;let c=o.buffer.slice(r,a);return Wxe.scheduleTask({buffer:c,type:"DbRoot",key:s},[c])}).then(function(n){let i=q$.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=i.imageryPresent??e.imageryPresent,e.protoImagery=i.protoImagery,e.terrainPresent=i.terrainPresent??e.terrainPresent,l(i.endSnippet)&&l(i.endSnippet.model)){let s=i.endSnippet.model;e.negativeAltitudeExponentBias=s.negativeAltitudeExponentBias??e.negativeAltitudeExponentBias,e.negativeAltitudeThreshold=s.compressedNegativeAltitudeThreshold??e.negativeAltitudeThreshold}l(i.databaseVersion)&&(e._quadPacketVersion=i.databaseVersion.quadtreeVersion??e._quadPacketVersion);let o=e.providers,r=i.providerInfo??[],a=r.length;for(let s=0;s<a;++s){let c=r[s],u=c.copyrightString;l(u)&&(o[c.providerId]=new Et(u.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=Yyt})}var x_=jf;function fI(e){e=e??V.EMPTY_OBJECT,this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;let t=e.childTileMask??15,n=t&3;n|=t&4?8:0,n|=t&8?4:0,this._childTileMask=n,this._createdByUpsampling=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(fI.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var Kxe="createVerticesFromGoogleEarthEnterpriseBuffer",Kyt=new Zn(Kxe),Xyt=new Zn(Kxe,Wu.maximumAsynchronousTasks),Yxe=new ce,b9=new ce;fI.prototype.createMesh=function(e){e=e??V.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,a=e.exaggerationRelativeHeight??0,s=e.throttle??!0,c=t.ellipsoid;t.tileXYToNativeRectangle(n,i,o,Yxe),t.tileXYToRectangle(n,i,o,b9);let u=c.cartographicToCartesian(ce.center(b9)),h=40075.16/(1<<o);this._skirtHeight=Math.min(h*8,1e3);let A=(s?Xyt:Kyt).scheduleTask({buffer:this._buffer,nativeRectangle:Yxe,rectangle:b9,relativeToCenter:u,ellipsoid:c,skirtHeight:this._skirtHeight,exaggeration:r,exaggerationRelativeHeight:a,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!l(A))return;let m=this;return A.then(function(_){return m._mesh=new pc(u,new Float32Array(_.vertices),new Uint16Array(_.indices),_.indexCountWithoutSkirts,_.vertexCountWithoutSkirts,_.minimumHeight,_.maximumHeight,b9,le.clone(_.boundingSphere3D),d.clone(_.occludeePointInScaledSpace),_.numberOfAttributes,en.clone(_.orientedBoundingBox),Cr.clone(_.encoding),_.westIndicesSouthToNorth,_.southIndicesEastToWest,_.eastIndicesNorthToSouth,_.northIndicesWestToEast),m._minimumHeight=_.minimumHeight,m._maximumHeight=_.maximumHeight,m._buffer=void 0,m._mesh})};fI.prototype.interpolateHeight=function(e,t,n){let i=D.clamp((t-e.west)/e.width,0,1),o=D.clamp((n-e.south)/e.height,0,1);return l(this._mesh)?tCt(this,i,o):oCt(this,i,o,e)};var Jyt=new Zn("upsampleQuantizedTerrainMesh",Wu.maximumAsynchronousTasks);fI.prototype.upsample=function(e,t,n,i,o,r,a){let s=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,u=n*2===r,f=e.ellipsoid,h=e.tileXYToRectangle(o,r,a),p=Jyt.scheduleTask({vertices:s.vertices,indices:s.indices,indexCountWithoutSkirts:s.indexCountWithoutSkirts,vertexCountWithoutSkirts:s.vertexCountWithoutSkirts,encoding:s.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:u,childRectangle:h,ellipsoid:f});if(!l(p))return;let A=this;return p.then(function(m){let _=new Uint16Array(m.vertices),y=Ue.createTypedArray(_.length/3,m.indices),C=A._skirtHeight;return new rI({quantizedVertices:_,indices:y,minimumHeight:m.minimumHeight,maximumHeight:m.maximumHeight,boundingSphere:le.clone(m.boundingSphere),orientedBoundingBox:en.clone(m.orientedBoundingBox),horizonOcclusionPoint:d.clone(m.horizonOcclusionPoint),westIndices:m.westIndices,southIndices:m.southIndices,eastIndices:m.eastIndices,northIndices:m.northIndices,westSkirtHeight:C,southSkirtHeight:C,eastSkirtHeight:C,northSkirtHeight:C,childTileMask:0,createdByUpsampling:!0,credits:A._credits})})};fI.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};fI.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var Zyt=new k,$yt=new k,eCt=new k,Xxe=new d;function tCt(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,a=i.indices;for(let s=0,c=a.length;s<c;s+=3){let u=a[s],f=a[s+1],h=a[s+2],p=r.decodeTextureCoordinates(o,u,Zyt),A=r.decodeTextureCoordinates(o,f,$yt),m=r.decodeTextureCoordinates(o,h,eCt),_=Om.computeBarycentricCoordinates(t,n,p.x,p.y,A.x,A.y,m.x,m.y,Xxe);if(_.x>=-1e-15&&_.y>=-1e-15&&_.z>=-1e-15){let y=r.decodeHeight(o,u),C=r.decodeHeight(o,f),E=r.decodeHeight(o,h);return _.x*y+_.y*C+_.z*E}}}var nCt=Uint16Array.BYTES_PER_ELEMENT,qxe=Uint32Array.BYTES_PER_ELEMENT,J$=Int32Array.BYTES_PER_ELEMENT,iCt=Float32Array.BYTES_PER_ELEMENT,Z$=Float64Array.BYTES_PER_ELEMENT;function oCt(e,t,n,i){let o=e._buffer,r=0,a=0,s=0;n>.5?(t>.5?(r=2,a=.5):r=3,s=.5):t>.5&&(r=1,a=.5);let c=new DataView(o),u=0;for(let S=0;S<r;++S)u+=c.getUint32(u,!0),u+=qxe;u+=qxe,u+=2*Z$;let f=D.toRadians(c.getFloat64(u,!0)*180);u+=Z$;let h=D.toRadians(c.getFloat64(u,!0)*180);u+=Z$;let p=i.width/f/2,A=i.height/h/2,m=c.getInt32(u,!0);u+=J$;let _=c.getInt32(u,!0)*3;u+=J$,u+=J$;let y=new Array(m),C=new Array(m),E=new Array(m),b;for(b=0;b<m;++b)y[b]=a+c.getUint8(u++)*p,C[b]=s+c.getUint8(u++)*A,E[b]=c.getFloat32(u,!0)*6371010,u+=iCt;let x=new Array(_);for(b=0;b<_;++b)x[b]=c.getUint16(u,!0),u+=nCt;for(b=0;b<_;b+=3){let S=x[b],B=x[b+1],v=x[b+2],P=y[S],N=y[B],L=y[v],g=C[S],I=C[B],T=C[v],w=Om.computeBarycentricCoordinates(t,n,P,g,N,I,L,T,Xxe);if(w.x>=-1e-15&&w.y>=-1e-15&&w.z>=-1e-15)return w.x*E[S]+w.y*E[B]+w.z*E[v]}}var Xw=fI;var ah={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},I9=new X;function x9(){this._terrainCache={},this._lastTidy=X.now()}x9.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:X.now()}};x9.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};x9.prototype.tidy=function(){if(X.now(I9),X.secondsDifference(I9,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];X.secondsDifference(I9,r.timestamp)>10&&delete e[o]}X.clone(I9,this._lastTidy)}};function VC(e){e=e??V.EMPTY_OBJECT,this._tilingScheme=new qi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-D.PI,-D.PI,D.PI,D.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new Et(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new x9,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new _e}Object.defineProperties(VC.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(){}}});VC.fromMetadata=function(e,t){if(!e.terrainPresent)throw new ue(`The server ${e.url} doesn't have terrain`);let n=new VC(t);return n._metadata=e,n};var rCt=new Zn("decodeGoogleEarthEnterprisePacket");function Jxe(e,t,n){let i=t.getChildBitmask();if(t.terrainState===ah.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}VC.prototype.requestTileGeometry=function(e,t,n,i){let o=x_.tileXYToQuadKey(e,t,n),r=this._terrainCache,a=this._metadata,s=a.getTileInformationFromQuadKey(o);if(!l(s))return Promise.reject(new ue("Terrain tile doesn't exist"));let c=s.terrainState;l(c)||(c=s.terrainState=ah.UNKNOWN);let u=r.get(o);if(l(u)){let C=a.providers[s.terrainProvider];return Promise.resolve(new Xw({buffer:u,childTileMask:Jxe(o,s,a),credits:l(C)?[C]:void 0,negativeAltitudeExponentBias:a.negativeAltitudeExponentBias,negativeElevationThreshold:a.negativeAltitudeThreshold}))}if(r.tidy(),s.ancestorHasTerrain){if(c===ah.NONE)return Promise.reject(new ue("Terrain tile doesn't exist"))}else return Promise.resolve(new Oc({buffer:new Uint8Array(256),width:16,height:16}));let f,h=o,p=-1;switch(c){case ah.SELF:p=s.terrainVersion;break;case ah.PARENT:h=h.substring(0,h.length-1),f=a.getTileInformationFromQuadKey(h),p=f.terrainVersion;break;case ah.UNKNOWN:s.hasTerrain()?p=s.terrainVersion:(h=h.substring(0,h.length-1),f=a.getTileInformationFromQuadKey(h),l(f)&&f.hasTerrain()&&(p=f.terrainVersion));break}if(p<0)return Promise.reject(new ue("Terrain tile doesn't exist"));let A=this._terrainPromises,m=this._terrainRequests,_,y;if(l(A[h]))_=A[h],y=m[h];else{y=i;let C=aCt(this,h,p,y).fetchArrayBuffer();if(!l(C))return;_=C.then(function(E){return l(E)?rCt.scheduleTask({buffer:E,type:"Terrain",key:a.key},[E]).then(function(b){let x=a.getTileInformationFromQuadKey(h);x.terrainState=ah.SELF,r.add(h,b[0]);let S=x.terrainProvider,B=b.length-1;for(let v=0;v<B;++v){let P=h+v.toString(),N=a.getTileInformationFromQuadKey(P);l(N)&&(r.add(P,b[v+1]),N.terrainState=ah.PARENT,N.terrainProvider===0&&(N.terrainProvider=S))}}):Promise.reject(new ue("Failed to load terrain."))}),A[h]=_,m[h]=y,_=_.finally(function(){delete A[h],delete m[h]})}return _.then(function(){let C=r.get(o);if(l(C)){let E=a.providers[s.terrainProvider];return new Xw({buffer:C,childTileMask:Jxe(o,s,a),credits:l(E)?[E]:void 0,negativeAltitudeExponentBias:a.negativeAltitudeExponentBias,negativeElevationThreshold:a.negativeAltitudeThreshold})}return Promise.reject(new ue("Failed to load terrain."))}).catch(function(C){return y.state===pi.CANCELLED?(i.state=y.state,Promise.reject(C)):(s.terrainState=ah.NONE,Promise.reject(C))})};VC.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};VC.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,o=x_.tileXYToQuadKey(e,t,n),r=i.getTileInformation(e,t,n);if(r===null)return!1;if(l(r)){if(!r.ancestorHasTerrain)return!0;let a=r.terrainState;if(a===ah.NONE)return!1;if((!l(a)||a===ah.UNKNOWN)&&(r.terrainState=ah.UNKNOWN,!r.hasTerrain())){o=o.substring(0,o.length-1);let s=i.getTileInformationFromQuadKey(o);if(!l(s)||!s.hasTerrain())return!1}return!0}if(i.isValid(o)){let a=new Ir({throttle:!1,throttleByServer:!0,type:ja.TERRAIN});i.populateSubtree(e,t,n,a)}return!1};VC.prototype.loadTileDataAvailability=function(e,t,n){};function aCt(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 $$=VC;var sCt="https://maps.googleapis.com/maps/api/geocode/json",Zxe='<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-5px">';function eee(e){e=e??V.EMPTY_OBJECT;let t=e.key;this._resource=new De({url:sCt,queryParameters:{key:t}}),this._credit=new Et(Zxe,!0)}Object.defineProperties(eee.prototype,{credit:{get:function(){return this._credit}}});eee.prototype.geocode=async function(e){let n=await this._resource.getDerivedResource({queryParameters:{address:e}}).fetchJson();if(n.status==="ZERO_RESULTS")return[];if(n.status!=="OK")throw new ue(`GoogleGeocoderService got a bad response ${n.status}: ${n.error_message}`);return n.results.map(o=>{let r=o.geometry.viewport.southwest,a=o.geometry.viewport.northeast;return{displayName:o.formatted_address,destination:ce.fromDegrees(r.lng,r.lat,a.lng,a.lat),attribution:{html:Zxe,collapsible:!1}}})};var tee=eee;function cCt(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var Y2=cCt;var dTe={},lCt=32.184,uCt=2451545,$xe=-.0529921,eTe=-.1059842,tTe=13.0120009,nTe=13.3407154,iTe=.9856003,oTe=26.4057084,rTe=13.064993,aTe=.3287146,sTe=1.7484877,cTe=-.1589763,lTe=.0036096,uTe=.1643573,fTe=12.9590088,nee=new X;dTe.ComputeMoon=function(e,t){l(e)||(e=X.now()),nee=X.addSeconds(e,lCt,nee);let n=X.totalDays(nee)-uCt,i=n/li.DAYS_PER_JULIAN_CENTURY,o=(125.045+$xe*n)*D.RADIANS_PER_DEGREE,r=(250.089+eTe*n)*D.RADIANS_PER_DEGREE,a=(260.008+tTe*n)*D.RADIANS_PER_DEGREE,s=(176.625+nTe*n)*D.RADIANS_PER_DEGREE,c=(357.529+iTe*n)*D.RADIANS_PER_DEGREE,u=(311.589+oTe*n)*D.RADIANS_PER_DEGREE,f=(134.963+rTe*n)*D.RADIANS_PER_DEGREE,h=(276.617+aTe*n)*D.RADIANS_PER_DEGREE,p=(34.226+sTe*n)*D.RADIANS_PER_DEGREE,A=(15.134+cTe*n)*D.RADIANS_PER_DEGREE,m=(119.743+lTe*n)*D.RADIANS_PER_DEGREE,_=(239.961+uTe*n)*D.RADIANS_PER_DEGREE,y=(25.053+fTe*n)*D.RADIANS_PER_DEGREE,C=Math.sin(o),E=Math.sin(r),b=Math.sin(a),x=Math.sin(s),S=Math.sin(c),B=Math.sin(u),v=Math.sin(f),P=Math.sin(h),N=Math.sin(p),L=Math.sin(A),g=Math.sin(m),I=Math.sin(_),T=Math.sin(y),w=Math.cos(o),R=Math.cos(r),O=Math.cos(a),G=Math.cos(s),F=Math.cos(c),U=Math.cos(u),Q=Math.cos(f),H=Math.cos(h),Y=Math.cos(p),$=Math.cos(A),W=Math.cos(m),K=Math.cos(_),Z=Math.cos(y),pe=(269.9949+.0031*i-3.8787*C-.1204*E+.07*b-.0172*x+.0072*B-.0052*L+.0043*T)*D.RADIANS_PER_DEGREE,ge=(66.5392+.013*i+1.5419*w+.0239*R-.0278*O+.0068*G-.0029*U+9e-4*Q+8e-4*$-9e-4*Z)*D.RADIANS_PER_DEGREE,re=(38.3213+13.17635815*n-14e-13*n*n+3.561*C+.1208*E-.0642*b+.0158*x+.0252*S-.0066*B-.0047*v-.0046*P+.0028*N+.0052*L+.004*g+.0019*I-.0044*T)*D.RADIANS_PER_DEGREE,ye=(13.17635815-14e-13*(2*n)+3.561*w*$xe+.1208*R*eTe-.0642*O*tTe+.0158*G*nTe+.0252*F*iTe-.0066*U*oTe-.0047*Q*rTe-.0046*H*aTe+.0028*Y*sTe+.0052*$*cTe+.004*W*lTe+.0019*K*uTe-.0044*Z*fTe)/86400*D.RADIANS_PER_DEGREE;return l(t)||(t=new Y2),t.rightAscension=pe,t.declination=ge,t.rotation=re,t.rotationRate=ye,t};var q2=dTe;function hTe(e){(!l(e)||typeof e!="function")&&(e=q2.ComputeMoon),this._computeFunction=e}var fCt=new d,dCt=new d,hCt=new d;function mCt(e,t,n){let i=fCt;i.x=Math.cos(e+D.PI_OVER_TWO),i.y=Math.sin(e+D.PI_OVER_TWO),i.z=0;let o=Math.cos(t),r=hCt;r.x=o*Math.cos(e),r.y=o*Math.sin(e),r.z=Math.sin(t);let a=d.cross(r,i,dCt);return l(n)||(n=new J),n[0]=i.x,n[1]=a.x,n[2]=r.x,n[3]=i.y,n[4]=a.y,n[5]=r.y,n[6]=i.z,n[7]=a.z,n[8]=r.z,n}var pCt=new J,ACt=new Qe;hTe.prototype.evaluate=function(e,t){l(e)||(e=X.now());let n=this._computeFunction(e),i=mCt(n.rightAscension,n.declination,t),o=D.zeroToTwoPi(n.rotation),r=Qe.fromAxisAngle(d.UNIT_Z,o,ACt),a=J.fromQuaternion(Qe.conjugate(r,r),pCt);return J.multiply(a,i,i)};var K2=hTe;var X2={};X2.type=void 0;X2.getRequiredDataPoints=de.throwInstantiationError;X2.interpolateOrderZero=de.throwInstantiationError;X2.interpolate=de.throwInstantiationError;var iee=X2;var gCt={GOOGLE:"GOOGLE",BING:"BING",DEFAULT:"DEFAULT"},T_=Object.freeze(gCt);function oee(e){this._url=De.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(oee.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});oee.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===GC.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(i){return i.features.map(function(o){let r,a=o.bbox;if(l(a))r=ce.fromDegrees(a[0],a[1],a[2],a[3]);else{let s=o.geometry.coordinates[0],c=o.geometry.coordinates[1];r=d.fromDegrees(s,c)}return{displayName:o.properties.label,destination:r,attributions:i.attributions}})})};var J2=oee;function _Ct(e){if(!Object.values(T_).some(t=>t===e))throw new de(`Invalid geocodeProviderType: "${e}"`)}var mTe=Object.freeze({[T_.GOOGLE]:"google",[T_.BING]:"bing",[T_.DEFAULT]:void 0});function yCt(e){return mTe[e]}function CCt(e){return Object.entries(mTe).find(t=>t[1]===e)[0]}function ree(e){e=e??V.EMPTY_OBJECT;let t=e.geocodeProviderType??T_.DEFAULT,n=e.accessToken??Uh.defaultAccessToken,i=De.createIfNeeded(e.server??Uh.defaultServer);i.appendForwardSlash();let o=Uh.getDefaultTokenCredit(n);l(o)&&e.scene.frameState.creditDisplay.addStaticCredit(Et.clone(o));let r=i.getDerivedResource({url:"v1/geocode"});l(n)&&r.appendQueryParameters({access_token:n}),this._accessToken=n,this._server=i,this._pelias=new J2(r),this.geocodeProviderType=t}Object.defineProperties(ree.prototype,{credit:{get:function(){}},geocodeProviderType:{get:function(){return CCt(this._pelias.url.queryParameters.geocoder)},set:function(e){_Ct(e);let t={...this._pelias.url.queryParameters,geocoder:yCt(e)};l(t.geocoder)||delete t.geocoder,this._pelias.url.setQueryParameters(t)}}});ree.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var dI=ree;var os={};os.ExportStatus=Object.freeze({NotStarted:"NotStarted",InProgress:"InProgress",Complete:"Complete",Invalid:"Invalid"});os.ExportType=Object.freeze({IMODEL:"IMODEL",CESIUM:"CESIUM","3DTILES":"3DTILES"});os.RealityDataType=Object.freeze({Cesium3DTiles:"Cesium3DTiles",PNTS:"PNTS",RealityMesh3DTiles:"RealityMesh3DTiles",Terrain3DTiles:"Terrain3DTiles",GaussianSplat3DTiles:"GS_3DT",KML:"KML",GeoJSON:"GeoJSON",Unstructured:"Unstructured"});os.defaultAccessToken=void 0;os.defaultShareKey=void 0;os._getAuthorizationHeader=function(){return l(os.defaultShareKey)?`Basic ${os.defaultShareKey}`:`Bearer ${os.defaultAccessToken}`};os.apiEndpoint=new De({url:"https://api.bentley.com"});os.getExports=async function(e,t){let n=new De({url:`${os.apiEndpoint}mesh-export`,headers:{Authorization:os._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json",Prefer:"return=representation"},queryParameters:{iModelId:e,exportType:os.ExportType["3DTILES"],$top:"5",client:"CesiumJS"}});typeof CESIUM_VERSION<"u"&&n.appendQueryParameters({clientVersion:CESIUM_VERSION}),l(t)&&t!==""&&n.appendQueryParameters({changesetId:t});try{return await n.fetchJson()}catch(i){let o=JSON.parse(i.response);if(i.statusCode===401){let r=o.error.details?.[0].code??"";throw new ue(`Unauthorized, bad token, wrong scopes or headers bad. ${r}`)}else{if(i.statusCode===403)throw console.error(o.error.code,o.error.message),new ue("Not allowed, forbidden");if(i.statusCode===422)throw new ue(`Unprocessable Entity:${o.error.code} ${o.error.message}`);if(i.statusCode===429)throw new ue("Too many requests")}throw new ue(`Unknown request failure ${i.statusCode}`)}};os.getRealityDataMetadata=async function(e,t){let n=new De({url:`${os.apiEndpoint}reality-management/reality-data/${t}`,headers:{Authorization:os._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{return(await n.fetchJson()).realityData}catch(i){let o=JSON.parse(i.response);if(i.statusCode===401){let r=o.error.details?.[0].code??"";throw new ue(`Unauthorized, bad token, wrong scopes or headers bad. ${r}`)}else{if(i.statusCode===403)throw console.error(o.error.code,o.error.message),new ue("Not allowed, forbidden");if(i.statusCode===404)throw new ue(`Reality data not found: ${e}, ${t}`);if(i.statusCode===422)throw new ue(`Unprocessable Entity:${o.error.code} ${o.error.message}`);if(i.statusCode===429)throw new ue("Too many requests")}throw new ue(`Unknown request failure ${i.statusCode}`)}};os.getRealityDataURL=async function(e,t,n){let i=new De({url:`${os.apiEndpoint}reality-management/reality-data/${t}/readaccess`,headers:{Authorization:os._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{let r=(await i.fetchJson())._links.containerUrl.href,a=new URL(r);return a.pathname=`${a.pathname}/${n}`,a.toString()}catch(o){let r=JSON.parse(o.response);if(o.statusCode===401){let a=r.error.details?.[0].code??"";throw new ue(`Unauthorized, bad token, wrong scopes or headers bad. ${a}`)}else{if(o.statusCode===403)throw console.error(r.error.code,r.error.message),new ue("Not allowed, forbidden");if(o.statusCode===404)throw new ue(`Reality data not found: ${e}, ${t}`);if(o.statusCode===422)throw new ue(`Unprocessable Entity:${r.error.code} ${r.error.message}`);if(o.statusCode===429)throw new ue("Too many requests")}throw new ue(`Unknown request failure ${o.statusCode}`)}};var rs=os;var ECt={SHIFT:0,CTRL:1,ALT:2},js=Object.freeze(ECt);function T9(){de.throwInstantiationError()}Object.defineProperties(T9.prototype,{ellipsoid:{get:de.throwInstantiationError}});T9.prototype.project=de.throwInstantiationError;T9.prototype.unproject=de.throwInstantiationError;var aee=T9;var see=[],cee=[];function bCt(e,t,n,i,o,r){let a=o-i+1,s=r-o,c=see,u=cee,f,h;for(f=0;f<a;++f)c[f]=e[i+f];for(h=0;h<s;++h)u[h]=e[o+h+1];f=0,h=0;for(let p=i;p<=r;++p){let A=c[f],m=u[h];f<a&&(h>=s||t(A,m,n)<=0)?(e[p]=A,++f):h<s&&(e[p]=m,++h)}}function lee(e,t,n,i,o){if(i>=o)return;let r=Math.floor((i+o)*.5);lee(e,t,n,i,r),lee(e,t,n,r+1,o),bCt(e,t,n,i,r,o)}function ICt(e,t,n){let i=e.length,o=Math.ceil(i*.5);see.length=o,cee.length=o,lee(e,t,n,0,i-1),see.length=0,cee.length=0}var rA=ICt;function Jw(e){e=e??V.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(Jw.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});Jw.prototype.findTimeInterval=To.prototype.findTimeInterval;Jw.prototype.wrapTime=To.prototype.wrapTime;Jw.prototype.clampTime=To.prototype.clampTime;Jw.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 a=0;a<this._count;a++){let s=o*this._count+a;t[a]=n[s]*(1-r)+n[s+this._count]*r}return t};var uee=Jw;var xCt={NONE:-1,PARTIAL:0,FULL:1},Vr=Object.freeze(xCt);function ml(e,t){this._occluderPosition=d.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 S9=new d;Object.defineProperties(ml.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=d.clone(e,this._cameraPosition);let t=d.subtract(this._occluderPosition,e,S9),n=d.magnitudeSquared(t),i=this._occluderRadius*this._occluderRadius,o,r,a;if(n>i){o=Math.sqrt(n-i),n=1/Math.sqrt(n),r=d.multiplyByScalar(t,n,S9);let s=o*o*n;a=d.add(e,d.multiplyByScalar(r,s,S9),S9)}else o=Number.MAX_VALUE;this._horizonDistance=o,this._horizonPlaneNormal=r,this._horizonPlanePosition=a,this._cameraPosition=e}}});ml.fromBoundingSphere=function(e,t,n){return l(n)?(d.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new ml(e,t)};var ATe=new d;ml.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=d.subtract(e,this._occluderPosition,ATe),n=this._occluderRadius;if(n=d.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=d.subtract(e,this._cameraPosition,t),n*n>d.magnitudeSquared(t)}return!1};var TCt=new d;ml.prototype.isBoundingSphereVisible=function(e){let t=d.clone(e.center,TCt),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=d.subtract(t,this._occluderPosition,ATe),o=this._occluderRadius-n;if(o=d.magnitudeSquared(i)-o*o,n<this._occluderRadius)return o>0?(o=Math.sqrt(o)+this._horizonDistance,i=d.subtract(t,this._cameraPosition,i),o*o+n*n>d.magnitudeSquared(i)):!1;if(o>0){i=d.subtract(t,this._cameraPosition,i);let r=d.magnitudeSquared(i),a=this._occluderRadius*this._occluderRadius,s=n*n;return(this._horizonDistance*this._horizonDistance+a)*s>r*a?!0:(o=Math.sqrt(o)+this._horizonDistance,o*o+s>r)}return!0}return!1};var SCt=new d;ml.prototype.computeVisibility=function(e){let t=d.clone(e.center),n=e.radius;if(n>this._occluderRadius)return Vr.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=d.subtract(t,this._occluderPosition,SCt),o=this._occluderRadius-n,r=d.magnitudeSquared(i);if(o=r-o*o,o>0){o=Math.sqrt(o)+this._horizonDistance,i=d.subtract(t,this._cameraPosition,i);let a=d.magnitudeSquared(i);return o*o+n*n<a?Vr.NONE:(o=this._occluderRadius+n,o=r-o*o,o>0?(o=Math.sqrt(o)+this._horizonDistance,a<o*o+n*n?Vr.FULL:Vr.PARTIAL):(i=d.subtract(t,this._horizonPlanePosition,i),d.dot(i,this._horizonPlaneNormal)>-n?Vr.PARTIAL:Vr.FULL))}}return Vr.NONE};var w9=new d;ml.computeOccludeePoint=function(e,t,n){let i=d.clone(t),o=d.clone(e.center),r=e.radius,a=n.length,s=d.normalize(d.subtract(i,o,w9),w9),c=-d.dot(s,o),u=ml._anyRotationVector(o,s,c),f=ml._horizonToPlaneNormalDotProduct(e,s,c,u,n[0]);if(!f)return;let h;for(let A=1;A<a;++A){if(h=ml._horizonToPlaneNormalDotProduct(e,s,c,u,n[A]),!h)return;h<f&&(f=h)}if(f<.0017453283658983088)return;let p=r/f;return d.add(o,d.multiplyByScalar(s,p,w9),w9)};var wCt=[];ml.computeOccludeePointFromRectangle=function(e,t){t=t??te.default;let n=ce.subsample(e,t,0,wCt),i=le.fromPoints(n),o=d.ZERO;if(!d.equals(o,i.center))return ml.computeOccludeePoint(new le(o,t.minimumRadius),i.center,n)};var BCt=new d;ml._anyRotationVector=function(e,t,n){let i=d.abs(t,BCt),o=i.x>i.y?0:1;(o===0&&i.z>i.x||o===1&&i.z>i.y)&&(o=2);let r=new d,a;o===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,a=d.UNIT_X):o===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,a=d.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,a=d.UNIT_Z);let s=(d.dot(t,i)+n)/-d.dot(t,a);return d.normalize(d.subtract(d.add(i,d.multiplyByScalar(a,s,r),i),e,i),i)};var DCt=new d;ml._rotationVector=function(e,t,n,i,o){let r=d.subtract(i,e,DCt);if(r=d.normalize(r,r),d.dot(t,r)<.9999999847691291){let a=d.cross(t,r,r);if(d.magnitude(a)>D.EPSILON13)return d.normalize(a,new d)}return o};var fee=new d,vCt=new d,B9=new d,pTe=new d;ml._horizonToPlaneNormalDotProduct=function(e,t,n,i,o){let r=d.clone(o,fee),a=d.clone(e.center,vCt),s=e.radius,c=d.subtract(a,r,B9),u=d.magnitudeSquared(c),f=s*s;if(u<f)return!1;let h=u-f,p=Math.sqrt(h),m=1/Math.sqrt(u),y=p*m*p;c=d.normalize(c,c);let C=d.add(r,d.multiplyByScalar(c,y,pTe),pTe),E=Math.sqrt(h-y*y),b=this._rotationVector(a,t,n,r,i),x=d.fromElements(b.x*b.x*c.x+(b.x*b.y-b.z)*c.y+(b.x*b.z+b.y)*c.z,(b.x*b.y+b.z)*c.x+b.y*b.y*c.y+(b.y*b.z-b.x)*c.z,(b.x*b.z-b.y)*c.x+(b.y*b.z+b.x)*c.y+b.z*b.z*c.z,fee);x=d.normalize(x,x);let S=d.multiplyByScalar(x,E,fee);b=d.normalize(d.subtract(d.add(C,S,B9),a,B9),B9);let B=d.dot(t,b);b=d.normalize(d.subtract(d.subtract(C,S,b),a,b),b);let v=d.dot(t,b);return B<v?B:v};var Z2=ml;function dee(e,t,n){e=De.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=n??{},this._credit=new Et('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(dee.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});dee.prototype.geocode=async function(e){return this._url.getDerivedResource({url:"json",queryParameters:Pt(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let o,r=i.bounds;if(l(r))o=ce.fromDegrees(r.southwest.lng,r.southwest.lat,r.northeast.lng,r.northeast.lat);else{let{lng:a,lat:s}=i.geometry;o=d.fromDegrees(a,s)}return{displayName:i.formatted,destination:o}})})};var hee=dee;var PCt={packedLength:void 0,pack:de.throwInstantiationError,unpack:de.throwInstantiationError},mee=PCt;var RCt={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:de.throwInstantiationError,unpackInterpolationResult:de.throwInstantiationError},pee=RCt;var MCt=new d;function NCt(e,t,n,i){let o=IE(e,t,n,i,MCt);return l(o)?o.x>0&&o.y>0&&o.z>0:!1}var Aee=NCt;function gTe(){de.throwInstantiationError()}gTe.prototype.getURL=de.throwInstantiationError;var gee=gTe;async function LCt(e,t,n,i){return l(i)||(i=!1),QCt(e,t,n,i)}function OCt(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(yTe(i)):r=o.then(yTe(i)).catch(kCt(i)),e.shift(),t.push(r),!0}function FCt(e){return new Promise(function(t){setTimeout(t,e)})}function _ee(e,t,n){return e.length?OCt(e,t,n)?_ee(e,t,n):FCt(100).then(()=>_ee(e,t,n)):Promise.resolve()}function QCt(e,t,n,i){let o=e.tilingScheme,r,a=[],s={};for(r=0;r<n.length;++r){let u=o.positionToTileXY(n[r],t);if(!l(u))continue;let f=u.toString();if(!s.hasOwnProperty(f)){let h={x:u.x,y:u.y,level:t,tilingScheme:o,terrainProvider:e,positions:[]};s[f]=h,a.push(h)}s[f].positions.push(n[r])}let c=[];return _ee(a,c,i).then(function(){return Promise.all(c).then(function(){return n})})}function _Te(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function yTe(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 a=t[r];if(!_Te(a,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 a=t[r];_Te(a,i,n)}}):Promise.resolve()}}function kCt(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var $2=LCt;var yee=new k;async function CTe(e,t,n){l(n)||(n=!1);let i=[],o=[],r=e.availability,a=[];for(let c=0;c<t.length;++c){let u=t[c],f=r.computeMaximumLevelAtPosition(u);if(o[c]=f,f===0){e.tilingScheme.positionToTileXY(u,1,yee);let p=e.loadTileDataAvailability(yee.x,yee.y,1);l(p)&&a.push(p)}let h=i[f];l(h)||(i[f]=h=[]),h.push(u)}await Promise.all(a),await Promise.all(i.map(function(c,u){if(l(c))return $2(e,u,c,n)}));let s=[];for(let c=0;c<t.length;++c){let u=t[c];r.computeMaximumLevelAtPosition(u)!==o[c]&&s.push(u)}return s.length>0&&await CTe(e,s,n),t}var hI=CTe;var UCt={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},Bn=Object.freeze(UCt);function HC(e,t,n){let i=e._element;if(i===document)return n.x=t.clientX,n.y=t.clientY,n;let o=i.getBoundingClientRect();return n.x=(t.clientX-o.left)*(i.offsetWidth/o.width),n.y=(t.clientY-o.top)*(i.offsetHeight/o.height),n}function Tee(e,t){let n=e;return l(t)&&(n+=`+${t}`),n}function mI(e){if(e.shiftKey)return js.SHIFT;if(e.ctrlKey)return js.CTRL;if(e.altKey)return js.ALT}var Sa={LEFT:0,MIDDLE:1,RIGHT:2};function Yf(e,t,n,i){function o(r){i(e,r)}n.addEventListener(t,o,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,o,!1)})}function zCt(e){let t=e._element,n=l(t.disableRootEvents)?t:document;fn.supportsPointerEvents()?(Yf(e,"pointerdown",t,YCt),Yf(e,"pointerup",t,vTe),Yf(e,"pointermove",t,qCt),Yf(e,"pointercancel",t,vTe)):(Yf(e,"mousedown",t,PTe),Yf(e,"mouseup",n,RTe),Yf(e,"mousemove",n,MTe),Yf(e,"touchstart",t,WCt),Yf(e,"touchend",n,TTe),Yf(e,"touchmove",n,jCt),Yf(e,"touchcancel",n,TTe)),Yf(e,"dblclick",t,VCt);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",Yf(e,i,t,HCt)}function GCt(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var ETe={position:new k};function See(e){e._lastSeenTouchEvent=Fi()}function wee(e){return Fi()-e._lastSeenTouchEvent>Um.mouseEmulationIgnoreMilliseconds}function xee(e,t,n){let i=e.x-t.x,o=e.y-t.y;return Math.sqrt(i*i+o*o)<n}function PTe(e,t){if(!wee(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===Sa.LEFT)i=Bn.LEFT_DOWN;else if(n===Sa.MIDDLE)i=Bn.MIDDLE_DOWN;else if(n===Sa.RIGHT)i=Bn.RIGHT_DOWN;else return;let o=HC(e,t,e._primaryPosition);k.clone(o,e._primaryStartPosition),k.clone(o,e._primaryPreviousPosition);let r=mI(t),a=e.getInputAction(i,r);l(a)&&(k.clone(o,ETe.position),a(ETe),t.preventDefault())}var bTe={position:new k},ITe={position:new k};function Cee(e,t,n,i){let o=mI(i),r=e.getInputAction(t,o),a=e.getInputAction(n,o);if(l(r)||l(a)){let s=HC(e,i,e._primaryPosition);if(l(r)&&(k.clone(s,bTe.position),r(bTe)),l(a)){let c=e._primaryStartPosition;xee(c,s,e._clickPixelTolerance)&&(k.clone(s,ITe.position),a(ITe))}}}function RTe(e,t){if(!wee(e))return;let n=t.button;n!==Sa.LEFT&&n!==Sa.MIDDLE&&n!==Sa.RIGHT||(e._buttonDown[Sa.LEFT]&&(Cee(e,Bn.LEFT_UP,Bn.LEFT_CLICK,t),e._buttonDown[Sa.LEFT]=!1),e._buttonDown[Sa.MIDDLE]&&(Cee(e,Bn.MIDDLE_UP,Bn.MIDDLE_CLICK,t),e._buttonDown[Sa.MIDDLE]=!1),e._buttonDown[Sa.RIGHT]&&(Cee(e,Bn.RIGHT_UP,Bn.RIGHT_CLICK,t),e._buttonDown[Sa.RIGHT]=!1))}var Eee={startPosition:new k,endPosition:new k};function MTe(e,t){if(!wee(e))return;let n=mI(t),i=HC(e,t,e._primaryPosition),o=e._primaryPreviousPosition,r=e.getInputAction(Bn.MOUSE_MOVE,n);l(r)&&(k.clone(o,Eee.startPosition),k.clone(i,Eee.endPosition),r(Eee)),k.clone(i,o),(e._buttonDown[Sa.LEFT]||e._buttonDown[Sa.MIDDLE]||e._buttonDown[Sa.RIGHT])&&t.preventDefault()}var xTe={position:new k};function VCt(e,t){let n=t.button,i;if(n===Sa.LEFT)i=Bn.LEFT_DOUBLE_CLICK;else return;let o=mI(t),r=e.getInputAction(i,o);l(r)&&(HC(e,t,xTe.position),r(xTe))}function HCt(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=mI(t),o=e.getInputAction(Bn.WHEEL,i);l(o)&&(o(n),t.preventDefault())}function WCt(e,t){See(e);let n=t.changedTouches,i,o=n.length,r,a,s=e._positions;for(i=0;i<o;++i)r=n[i],a=r.identifier,s.set(a,HC(e,r,new k));D9(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],a=r.identifier,c.set(a,k.clone(s.get(a)))}function TTe(e,t){See(e);let n=t.changedTouches,i,o=n.length,r,a,s=e._positions;for(i=0;i<o;++i)r=n[i],a=r.identifier,s.remove(a);D9(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],a=r.identifier,c.remove(a)}var STe={position:new k},bee={position1:new k,position2:new k},wTe={position:new k},BTe={position:new k},DTe={position:new k};function D9(e,t){let n=mI(t),i=e._positions,o=i.length,r,a,s=e._isPinching;if(o!==1&&e._buttonDown[Sa.LEFT]){if(e._buttonDown[Sa.LEFT]=!1,l(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),r=e.getInputAction(Bn.LEFT_UP,n),l(r)&&(k.clone(e._primaryPosition,wTe.position),r(wTe)),o===0&&!e._isTouchHolding&&(a=e.getInputAction(Bn.LEFT_CLICK,n),l(a))){let c=e._primaryStartPosition,u=e._previousPositions.values[0];xee(c,u,e._clickPixelTolerance)&&(k.clone(e._primaryPosition,BTe.position),a(BTe))}e._isTouchHolding=!1}if(o===0&&s&&(e._isPinching=!1,r=e.getInputAction(Bn.PINCH_END,n),l(r)&&r()),o===1&&!s){let c=i.values[0];k.clone(c,e._primaryPosition),k.clone(c,e._primaryStartPosition),k.clone(c,e._primaryPreviousPosition),e._buttonDown[Sa.LEFT]=!0,r=e.getInputAction(Bn.LEFT_DOWN,n),l(r)&&(k.clone(c,STe.position),r(STe)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,a=e.getInputAction(Bn.RIGHT_CLICK,n),l(a))){let u=e._primaryStartPosition,f=e._previousPositions.values[0];xee(u,f,e._holdPixelTolerance)&&(k.clone(e._primaryPosition,DTe.position),a(DTe))}},Um.touchHoldDelayMilliseconds),t.preventDefault()}o===2&&!s&&(e._isPinching=!0,r=e.getInputAction(Bn.PINCH_START,n),l(r)&&(k.clone(i.values[0],bee.position1),k.clone(i.values[1],bee.position2),r(bee),t.preventDefault()))}function jCt(e,t){See(e);let n=t.changedTouches,i,o=n.length,r,a,s=e._positions;for(i=0;i<o;++i){r=n[i],a=r.identifier;let u=s.get(a);l(u)&&HC(e,r,u)}NTe(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],a=r.identifier,k.clone(s.get(a),c.get(a))}var Iee={startPosition:new k,endPosition:new k},ek={distance:{startPosition:new k,endPosition:new k},angleAndHeight:{startPosition:new k,endPosition:new k}};function NTe(e,t){let n=mI(t),i=e._positions,o=e._previousPositions,r=i.length,a;if(r===1&&e._buttonDown[Sa.LEFT]){let s=i.values[0];k.clone(s,e._primaryPosition);let c=e._primaryPreviousPosition;a=e.getInputAction(Bn.MOUSE_MOVE,n),l(a)&&(k.clone(c,Iee.startPosition),k.clone(s,Iee.endPosition),a(Iee)),k.clone(s,c),t.preventDefault()}else if(r===2&&e._isPinching&&(a=e.getInputAction(Bn.PINCH_MOVE,n),l(a))){let s=i.values[0],c=i.values[1],u=o.values[0],f=o.values[1],h=c.x-s.x,p=c.y-s.y,A=Math.sqrt(h*h+p*p)*.25,m=f.x-u.x,_=f.y-u.y,y=Math.sqrt(m*m+_*_)*.25,C=(c.y+s.y)*.125,E=(f.y+u.y)*.125,b=Math.atan2(p,h),x=Math.atan2(_,m);k.fromElements(0,y,ek.distance.startPosition),k.fromElements(0,A,ek.distance.endPosition),k.fromElements(x,E,ek.angleAndHeight.startPosition),k.fromElements(b,C,ek.angleAndHeight.endPosition),a(ek)}}function YCt(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,HC(e,t,new k)),D9(e,t),e._previousPositions.set(i,k.clone(n.get(i)))}else PTe(e,t)}function vTe(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),D9(e,t),e._previousPositions.remove(i)}else RTe(e,t)}function qCt(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,o=n.get(i);if(!l(o))return;HC(e,t,o),NTe(e,t);let r=e._previousPositions;k.clone(n.get(i),r.get(i))}else MTe(e,t)}function Um(e){this._inputEvents={},this._buttonDown={[Sa.LEFT]:!1,[Sa.MIDDLE]:!1,[Sa.RIGHT]:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-Um.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new k,this._primaryPosition=new k,this._primaryPreviousPosition=new k,this._positions=new Ot,this._previousPositions=new Ot,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=e??document,zCt(this)}Um.prototype.setInputAction=function(e,t,n){let i=Tee(t,n);this._inputEvents[i]=e};Um.prototype.getInputAction=function(e,t){let n=Tee(e,t);return this._inputEvents[n]};Um.prototype.removeInputAction=function(e,t){let n=Tee(e,t);delete this._inputEvents[n]};Um.prototype.isDestroyed=function(){return!1};Um.prototype.destroy=function(){return GCt(this),fe(this)};Um.mouseEmulationIgnoreMilliseconds=800;Um.touchHoldDelayMilliseconds=1500;var qf=Um;function KCt(e,t,n,i,o,r,a){let s=Xi.numberOfPoints(e,t,o),c,u=n.red,f=n.green,h=n.blue,p=n.alpha,A=i.red,m=i.green,_=i.blue,y=i.alpha;if(z.equals(n,i)){for(c=0;c<s;c++)r[a++]=z.floatToByte(u),r[a++]=z.floatToByte(f),r[a++]=z.floatToByte(h),r[a++]=z.floatToByte(p);return a}let C=(A-u)/s,E=(m-f)/s,b=(_-h)/s,x=(y-p)/s,S=a;for(c=0;c<s;c++)r[S++]=z.floatToByte(u+c*C),r[S++]=z.floatToByte(f+c*E),r[S++]=z.floatToByte(h+c*b),r[S++]=z.floatToByte(p+c*x);return S}function tk(e){e=e??V.EMPTY_OBJECT;let t=e.positions,n=e.colors,i=e.colorsPerVertex??!1;this._positions=t,this._colors=n,this._colorsPerVertex=i,this._arcType=e.arcType??ln.GEODESIC,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._ellipsoid=e.ellipsoid??te.default,this._workerName="createSimplePolylineGeometry";let o=1+t.length*d.packedLength;o+=l(n)?1+n.length*z.packedLength:1,this.packedLength=o+te.packedLength+3}tk.pack=function(e,t,n){n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let a=e._colors;for(r=l(a)?a.length:0,t[n++]=r,i=0;i<r;++i,n+=z.packedLength)z.pack(a[i],t,n);return te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};tk.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let a=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=z.packedLength)a[i]=z.unpack(e,t);let s=te.unpack(e,t);t+=te.packedLength;let c=e[t++]===1,u=e[t++],f=e[t];return l(n)?(n._positions=r,n._colors=a,n._ellipsoid=s,n._colorsPerVertex=c,n._arcType=u,n._granularity=f,n):new tk({positions:r,colors:a,ellipsoid:s,colorsPerVertex:c,arcType:u,granularity:f})};var v9=new Array(2),P9=new Array(2),XCt={positions:v9,height:P9,ellipsoid:void 0,minDistance:void 0,granularity:void 0};tk.createGeometry=function(e){let t=e._positions,n=e._colors,i=e._colorsPerVertex,o=e._arcType,r=e._granularity,a=e._ellipsoid,s=D.chordLength(r,a.maximumRadius),c=l(n)&&!i,u,f=t.length,h,p,A,m,_=0;if(o===ln.GEODESIC||o===ln.RHUMB){let x,S,B;o===ln.GEODESIC?(x=D.chordLength(r,a.maximumRadius),S=Xi.numberOfPoints,B=Xi.generateArc):(x=r,S=Xi.numberOfPointsRhumbLine,B=Xi.generateRhumbArc);let v=Xi.extractHeights(t,a),P=XCt;if(o===ln.GEODESIC?P.minDistance=s:P.granularity=r,P.ellipsoid=a,c){let N=0;for(u=0;u<f-1;u++)N+=S(t[u],t[u+1],x)+1;h=new Float64Array(N*3),A=new Uint8Array(N*4),P.positions=v9,P.height=P9;let L=0;for(u=0;u<f-1;++u){v9[0]=t[u],v9[1]=t[u+1],P9[0]=v[u],P9[1]=v[u+1];let g=B(P);if(l(n)){let I=g.length/3;m=n[u];for(let T=0;T<I;++T)A[L++]=z.floatToByte(m.red),A[L++]=z.floatToByte(m.green),A[L++]=z.floatToByte(m.blue),A[L++]=z.floatToByte(m.alpha)}h.set(g,_),_+=g.length}}else if(P.positions=t,P.height=v,h=new Float64Array(B(P)),l(n)){for(A=new Uint8Array(h.length/3*4),u=0;u<f-1;++u){let L=t[u],g=t[u+1],I=n[u],T=n[u+1];_=KCt(L,g,I,T,s,A,_)}let N=n[f-1];A[_++]=z.floatToByte(N.red),A[_++]=z.floatToByte(N.green),A[_++]=z.floatToByte(N.blue),A[_++]=z.floatToByte(N.alpha)}}else{p=c?f*2-2:f,h=new Float64Array(p*3),A=l(n)?new Uint8Array(p*4):void 0;let x=0,S=0;for(u=0;u<f;++u){let B=t[u];if(c&&u>0&&(d.pack(B,h,x),x+=3,m=n[u-1],A[S++]=z.floatToByte(m.red),A[S++]=z.floatToByte(m.green),A[S++]=z.floatToByte(m.blue),A[S++]=z.floatToByte(m.alpha)),c&&u===f-1)break;d.pack(B,h,x),x+=3,l(n)&&(m=n[u],A[S++]=z.floatToByte(m.red),A[S++]=z.floatToByte(m.green),A[S++]=z.floatToByte(m.blue),A[S++]=z.floatToByte(m.alpha))}}let y=new _n;y.position=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:h}),l(n)&&(y.color=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:4,values:A,normalize:!0})),p=h.length/3;let C=(p-1)*2,E=Ue.createTypedArray(p,C),b=0;for(u=0;u<p-1;++u)E[b++]=u,E[b++]=u+1;return new yt({attributes:y,indices:E,primitiveType:ve.LINES,boundingSphere:le.fromPoints(t)})};var Bee=tk;function Zw(e){let t=e.radius??1,i={radii:new d(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new Hs(i),this._workerName="createSphereGeometry"}Zw.packedLength=Hs.packedLength;Zw.pack=function(e,t,n){return Hs.pack(e._ellipsoidGeometry,t,n)};var JCt=new Hs,WC={radius:void 0,radii:new d,vertexFormat:new ke,stackPartitions:void 0,slicePartitions:void 0};Zw.unpack=function(e,t,n){let i=Hs.unpack(e,t,JCt);return WC.vertexFormat=ke.clone(i._vertexFormat,WC.vertexFormat),WC.stackPartitions=i._stackPartitions,WC.slicePartitions=i._slicePartitions,l(n)?(d.clone(i._radii,WC.radii),n._ellipsoidGeometry=new Hs(WC),n):(WC.radius=i._radii.x,new Zw(WC))};Zw.createGeometry=function(e){return Hs.createGeometry(e._ellipsoidGeometry)};var nk=Zw;function ZCt(e){return e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var pI=ZCt;var $Ct={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},Tn=$Ct;function jC(e){}Object.defineProperties(jC.prototype,{ellipsoid:{get:de.throwInstantiationError},rectangle:{get:de.throwInstantiationError},projection:{get:de.throwInstantiationError}});jC.prototype.getNumberOfXTilesAtLevel=de.throwInstantiationError;jC.prototype.getNumberOfYTilesAtLevel=de.throwInstantiationError;jC.prototype.rectangleToNativeRectangle=de.throwInstantiationError;jC.prototype.tileXYToNativeRectangle=de.throwInstantiationError;jC.prototype.tileXYToRectangle=de.throwInstantiationError;jC.prototype.positionToTileXY=de.throwInstantiationError;var Dee=jC;function AI(e){e=e??V.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=e.epoch??Xe.MINIMUM_VALUE,this.tolerance=e.tolerance??1,this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(AI.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(AI.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=eEt(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});AI.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,fe(this)};AI.prototype.isDestroyed=function(){return!1};AI.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};AI.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=this.epoch??Xe.MINIMUM_VALUE,a=X.secondsDifference(o,r),s=t.duration,c,u=t.currentTime;t.loop?(a=a%s,a<0&&(a=s-a),c=a):a>s?c=s:a<0?c=0:c=a;let f=i?this.tolerance??1:.001;Math.abs(c-u)>f&&(this._seeking=!0,t.currentTime=c)};function eEt(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var vee=AI;function tEt(e,t){this.rectangle=e,this.maxLevel=t}function LTe(e){this.ellipsoid=e.ellipsoid??te.default,this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}LTe.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 nEt(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new qi({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=jo.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 a=o[r],s=D.toRadians(parseFloat(a.getAttribute("minx"))),c=D.toRadians(parseFloat(a.getAttribute("miny"))),u=D.toRadians(parseFloat(a.getAttribute("maxx"))),f=D.toRadians(parseFloat(a.getAttribute("maxy"))),h=parseInt(a.getAttribute("maxlevel"),10);e.rectangles.push(new tEt(new ce(s,c,u,f),h))}}function iEt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i=`${i}: ${t.message}`),$o.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new ue(i)}async function oEt(e,t,n){try{let i=await t.fetchXML();nEt(e,i)}catch(i){iEt(t,i,n)}}function YC(e){e=e??V.EMPTY_OBJECT,this._errorEvent=new _e,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 Et(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[]}Object.defineProperties(YC.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(){}}});YC.fromUrl=async function(e,t){t=t??V.EMPTY_OBJECT;let n=new LTe(t),i=De.createIfNeeded(e);await oEt(n,i);let o=new YC(t);return n.build(o),o._resource=i,o};YC.prototype.requestTileGeometry=function(e,t,n,i){let o=this._tilingScheme.getNumberOfYTilesAtLevel(n),a=this._resource.getDerivedResource({url:`${n}/${e}/${o-t-1}.tif`,queryParameters:{cesium:!0},request:i}).fetchImage({preferImageBitmap:!0});if(!l(a))return;let s=this;return Promise.resolve(a).then(function(c){return new Oc({buffer:Eh(c),width:s._heightmapWidth,height:s._heightmapHeight,childTileMask:rEt(s,e,t,n),structure:s._terrainDataStructure})})};YC.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var OTe=new ce;function rEt(e,t,n,i){let o=e._tilingScheme,r=e._rectangles,a=o.tileXYToRectangle(t,n,i),s=0;for(let c=0;c<r.length&&s!==15;++c){let u=r[c];if(u.maxLevel<=i)continue;let f=u.rectangle,h=ce.intersection(f,a,OTe);l(h)&&(R9(o,f,t*2,n*2,i+1)&&(s|=4),R9(o,f,t*2+1,n*2,i+1)&&(s|=8),R9(o,f,t*2,n*2+1,i+1)&&(s|=1),R9(o,f,t*2+1,n*2+1,i+1)&&(s|=2))}return s}function R9(e,t,n,i,o){let r=e.tileXYToRectangle(n,i,o);return l(ce.intersection(r,t,OTe))}YC.prototype.getTileDataAvailable=function(e,t,n){};YC.prototype.loadTileDataAvailability=function(e,t,n){};var Pee=YC;var aEt={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},Ree=Object.freeze(aEt);function sEt(e){switch(e){case ee.FLOAT:return"float";case ee.FLOAT_VEC2:return"vec2";case ee.FLOAT_VEC3:return"vec3";case ee.FLOAT_VEC4:return"vec4";case ee.FLOAT_MAT2:return"mat2";case ee.FLOAT_MAT3:return"mat3";case ee.FLOAT_MAT4:return"mat4";case ee.SAMPLER_2D:return"sampler2D";case ee.BOOL:return"bool"}}var Mee=sEt;function cEt(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var ik=cEt;var $w=`#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 ok=`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 rk=`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 ak=`#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 sk=`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 ck=`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 lk=`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 uk=`/**
* 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 fk=`uniform mat3 u_cubeMapPanoramaTransform;
in vec3 position;
out vec3 v_texCoord;
void main()
{
vec3 p = czm_viewRotation * (u_cubeMapPanoramaTransform * (czm_entireFrustum.y * position));
gl_Position = czm_projection * vec4(p, 1.0);
v_texCoord = position.xyz;
}
`;var dk=`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 hk=`in vec4 position;
out vec4 positionEC;
void main()
{
positionEC = czm_modelView * position;
gl_Position = czm_projection * positionEC;
czm_vertexLogDepth();
}
`;var eB=`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 tB=`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);
vec4 pEC = czm_modelView * p;
v_positionEC = pEC.xyz; // position in eye coordinates
gl_Position = czm_projection * pEC;
// 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();
}
`;/**
* @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 mk=`/**
* @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 source (archived): https://archive.org/details/nvidiagame-works-graphics-samples-master
// Original FXAA 3.11 shader link: https://github.com/NVIDIAGameWorks/GraphicsSamples/blob/master/samples/es3-kepler/FXAA/FXAA3_11.h
// Shader link in fork: https://github.com/lyntel/GraphicsSamples/blob/3d30817ebeeade64fe6a4fc3aa1fe4265c29b6fd/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 pk=`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
//\u3010mars3d.cn\u4FEE\u6539\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C
#ifdef APPLY_INVERT_COLOR_MARS3D
uniform bool u_mars3dTextureInvertColor[TEXTURE_UNITS];
#endif
#ifdef APPLY_FILTER_COLOR_MARS3D
uniform vec3 u_mars3dTextureFilterColor[TEXTURE_UNITS];
#endif
//\u3010mars3d.cn\u4FEE\u6539\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C
#ifdef APPLY_IMAGERY_CUTOUT
uniform vec4 u_dayTextureCutoutRectangles[TEXTURE_UNITS];
#endif
#ifdef APPLY_COLOR_TO_ALPHA
uniform vec4 u_colorsToAlpha[TEXTURE_UNITS];
#endif
uniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS];
#endif
#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
// Based on colorCorrect
// The colorCorrect flag can only be true when tileProvider.hue/saturation/brightnessShift
// are nonzero AND when (applyFog || showGroundAtmosphere) in the tile provider
// - The tileProvider.hue/saturation/brightnessShift are just passed through
// from the Globe hue/saturation/brightness, like atmosphereBrightnessShift
// - The applyFog depends on enableFog, and some tile distance from the viewer
// - The showGroundAtmosphere is a flag that is passed through from the Globe,
// and is true by default when the ellipsoid is WGS84
#ifdef COLOR_CORRECT
uniform vec3 u_hsbShift; // Hue, saturation, brightness
#endif
// Based on highlightFillTile
// This is set for terrain tiles when they are "fill" tiles, and
// the terrainProvider.fillHighlightColor was set to a value with
// nonzero alpha
#ifdef HIGHLIGHT_FILL_TILE
uniform vec4 u_fillHighlightColor;
#endif
// Based on translucent
// This is set depending on the GlobeTranslucencyState
#ifdef TRANSLUCENT
uniform vec4 u_frontFaceAlphaByDistance;
uniform vec4 u_backFaceAlphaByDistance;
uniform vec4 u_translucencyRectangle;
#endif
// Based on showUndergroundColor
// This is set when GlobeSurfaceTileProvider.isUndergroundVisible
// returns true, AND the tileProvider.undergroundColor had a value with
// nonzero alpha, and the tileProvider.undergroundColorAlphaByDistance
// was in the right range
#ifdef UNDERGROUND_COLOR
uniform vec4 u_undergroundColor;
uniform vec4 u_undergroundColorAlphaByDistance;
#endif
// Based on enableLighting && hasVertexNormals
// The enableLighting flag is passed in directly from the Globe.
// The hasVertexNormals flag is from the tileProvider
#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
//\u3010mars3d.cn\u4FEE\u6539\u3011 Muyao 2023-07-19 \u5730\u5F62\u533A\u57DF\u6750\u8D28(\u6DF9\u6CA1\uFF0C\u7B49\u9AD8\u7EBF)
#ifdef APPLY_MARS3D_FLOOD
uniform bool u_mars_flood_enabled;
uniform bool u_mars_flood_only;
uniform vec4 u_mars_flood_rectangle;
uniform highp sampler2D u_mars_flood_texture;
#endif
//\u3010mars3d.cn\u4FEE\u6539\u3011 Muyao 2023-07-19 \u5730\u5F62\u533A\u57DF\u6750\u8D28(\u6DF9\u6CA1\uFF0C\u7B49\u9AD8\u7EBF)
//\u3010mars3d.cn\u4FEE\u6539\u3011 Muyao 2023-07-19 \u5730\u5F62\u5F00\u6316
#ifdef APPLY_MARS3D_CLIP
uniform bool u_mars_clip_enabled;
uniform bool u_mars_clip_only;
uniform vec4 u_mars_clip_rectangle;
uniform highp sampler2D u_mars_clip_texture;
#endif
//\u3010mars3d.cn\u4FEE\u6539\u3011 Muyao 2023-07-19 \u5730\u5F62\u5F00\u6316
//\u3010mars3d.cn\u4FEE\u6539\u3011 Muyao 2023-07-19 \u5730\u5F62\u7F16\u8F91\u901A\u7528\u7684\u8303\u56F4\u5224\u65AD\u65B9\u6CD5\uFF08\u542B \u5730\u5F62\u62AC\u5347/\u5730\u5F62\u538B\u5E73/\u5730\u5F62\u5F00\u6316/\u5730\u5F62\u533A\u57DF\u6750\u8D28\uFF09
uniform highp float u_mars_inverseTileWidth;
uniform highp vec2 u_mars_cartographicTileRectangle;
bool inAreaMars3DRange(vec4 rectangle, sampler2D rangeTexture) {
float lo = v_textureCoordinates.x / u_mars_inverseTileWidth + u_mars_cartographicTileRectangle.x;
float la = v_textureCoordinates.y / u_mars_inverseTileWidth + u_mars_cartographicTileRectangle.y;
float newX = (lo - rectangle.x) / rectangle.z;
float newY = (la - rectangle.y) / rectangle.w;
if(newX >= 0.0 && newX <= 1.0 && newY >= 0.0 && newY <= 1.0){
vec4 point = texture(rangeTexture, vec2(newX, newY));
return point.r > 0.0;
}
return false;
}
//\u3010mars3d.cn\u4FEE\u6539\u3011 Muyao 2023-07-19 \u5730\u5F62\u7F16\u8F91\u901A\u7528\u7684\u8303\u56F4\u5224\u65AD\u65B9\u6CD5\uFF08\u542B \u5730\u5F62\u62AC\u5347/\u5730\u5F62\u538B\u5E73/\u5730\u5F62\u5F00\u6316/\u5730\u5F62\u533A\u57DF\u6750\u8D28\uFF09
#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)
in float v_distance;
#endif
#if defined(GROUND_ATMOSPHERE) || defined(FOG)
in vec3 v_atmosphereRayleighColor;
in vec3 v_atmosphereMieColor;
in float v_atmosphereOpacity;
#endif
// \u3010mars3d.cn\u4FEE\u6539\u3011 Muyao 2023-02-20 \u5730\u5F62\u62AC\u5347
#ifdef APPLY_MARS3D_UPLIFT
uniform vec4 u_mars_uplift_rectangle;
uniform highp sampler2D u_mars_uplift_texture;
uniform bool u_mars_uplift_enabled;
uniform bool u_mars_uplift_hideInsideOrOutside;
#endif
// \u3010mars3d.cn\u4FEE\u6539\u3011 Muyao 2023-02-20 \u5730\u5F62\u62AC\u5347
#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)
float interpolateByDistance(vec4 nearFarScalar, float distance)
{
float startDistance = nearFarScalar.x;
float startValue = nearFarScalar.y;
float endDistance = nearFarScalar.z;
float endValue = nearFarScalar.w;
float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0);
return mix(startValue, endValue, t);
}
#endif
#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) || defined(APPLY_MATERIAL)
vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor)
{
return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a);
}
#endif
#ifdef TRANSLUCENT
bool inTranslucencyRectangle()
{
return
v_textureCoordinates.x > u_translucencyRectangle.x &&
v_textureCoordinates.x < u_translucencyRectangle.z &&
v_textureCoordinates.y > u_translucencyRectangle.y &&
v_textureCoordinates.y < u_translucencyRectangle.w;
}
#endif
vec4 sampleAndBlend(
vec4 previousColor,
sampler2D textureToSample,
vec2 tileTextureCoordinates,
vec4 textureCoordinateRectangle,
vec4 textureCoordinateTranslationAndScale,
float textureAlpha,
float textureNightAlpha,
float textureDayAlpha,
float textureBrightness,
float textureContrast,
float textureHue,
float textureSaturation,
float textureOneOverGamma,
//\u3010mars3d.cn\u4FEE\u6539\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C
bool textureInvertColor,
vec3 texturefilterColor,
//\u3010mars3d.cn\u4FEE\u6539\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C
float split,
vec4 colorToAlpha,
float nightBlend)
{
// This crazy step stuff sets the alpha to 0.0 if this following condition is true:
// tileTextureCoordinates.s < textureCoordinateRectangle.s ||
// tileTextureCoordinates.s > textureCoordinateRectangle.p ||
// tileTextureCoordinates.t < textureCoordinateRectangle.t ||
// tileTextureCoordinates.t > textureCoordinateRectangle.q
// In other words, the alpha is zero if the fragment is outside the rectangle
// covered by this texture. Would an actual 'if' yield better performance?
vec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates);
textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;
alphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates);
textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;
#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING)
textureAlpha *= mix(textureDayAlpha, textureNightAlpha, nightBlend);
#endif
vec2 translation = textureCoordinateTranslationAndScale.xy;
vec2 scale = textureCoordinateTranslationAndScale.zw;
vec2 textureCoordinates = tileTextureCoordinates * scale + translation;
vec4 value = texture(textureToSample, textureCoordinates);
vec3 color = value.rgb;
float alpha = value.a;
#ifdef APPLY_COLOR_TO_ALPHA
vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb);
colorDiff.r = 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
//\u3010mars3d.cn\u4FEE\u6539\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C
#ifdef APPLY_INVERT_COLOR_MARS3D
if(textureInvertColor) {
color = vec3(1.0 - color.r, 1.0 - color.g, 1.0 - color.b);
}
#endif
#ifdef APPLY_FILTER_COLOR_MARS3D
if(texturefilterColor.x != 1.0 || texturefilterColor.y != 1.0 || texturefilterColor.z != 1.0) {
color = vec3(color.r * texturefilterColor.x, color.g * texturefilterColor.y, color.b * texturefilterColor.z);
}
#endif
//\u3010mars3d.cn\u4FEE\u6539\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C
float sourceAlpha = alpha * textureAlpha;
float outAlpha = mix(previousColor.a, 1.0, sourceAlpha);
outAlpha += sign(outAlpha) - 1.0;
vec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;
// When rendering imagery for a tile in multiple passes,
// some GPU/WebGL implementation combinations will not blend fragments in
// additional passes correctly if their computation includes an unmasked
// divide-by-zero operation,
// even if it's not in the output or if the output has alpha zero.
//
// For example, without sanitization for outAlpha,
// this renders without artifacts:
// if (outAlpha == 0.0) { outColor = vec3(0.0); }
//
// but using czm_branchFreeTernary will cause portions of the tile that are
// alpha-zero in the additional pass to render as black instead of blending
// with the previous pass:
// outColor = czm_branchFreeTernary(outAlpha == 0.0, vec3(0.0), outColor);
//
// So instead, sanitize against divide-by-zero,
// store this state on the sign of outAlpha, and correct on return.
return vec4(outColor, max(outAlpha, 0.0));
}
vec3 colorCorrect(vec3 rgb) {
#ifdef COLOR_CORRECT
// Convert rgb color to hsb
vec3 hsb = czm_RGBToHSB(rgb);
// Perform hsb shift
hsb.x += u_hsbShift.x; // hue
hsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0); // saturation
hsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0; // brightness
// Convert shifted hsb back to rgb
rgb = czm_HSBToRGB(hsb);
#endif
return rgb;
}
vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend);
vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue, float fade);
const float fExposure = 2.0;
vec3 computeEllipsoidPosition()
{
float mpp = czm_metersPerPixel(vec4(0.0, 0.0, -czm_currentFrustum.x, 1.0), 1.0);
vec2 xy = gl_FragCoord.xy / czm_viewport.zw * 2.0 - vec2(1.0);
xy *= czm_viewport.zw * mpp * 0.5;
vec3 direction;
if (czm_orthographicIn3D == 1.0)
{
direction = vec3(0.0, 0.0, -1.0);
}
else
{
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()
{
//\u3010mars3d.cn\u4FEE\u6539\u3011 Muyao 2023-07-19 \u5730\u5F62\u5F00\u6316
#ifdef APPLY_MARS3D_CLIP
if(u_mars_clip_enabled) {
if(u_mars_clip_only) {
if(!inAreaMars3DRange(u_mars_clip_rectangle, u_mars_clip_texture)) {
discard;
}
} else {
if(inAreaMars3DRange(u_mars_clip_rectangle, u_mars_clip_texture)) {
discard;
}
}
}
#endif
//\u3010mars3d.cn\u4FEE\u6539\u3011 Muyao 2023-07-19 \u5730\u5F62\u5F00\u6316
#ifdef TILE_LIMIT_RECTANGLE
if (v_textureCoordinates.x < u_cartographicLimitRectangle.x || u_cartographicLimitRectangle.z < v_textureCoordinates.x ||
v_textureCoordinates.y < u_cartographicLimitRectangle.y || u_cartographicLimitRectangle.w < v_textureCoordinates.y)
{
discard;
}
#endif
#ifdef ENABLE_CLIPPING_PLANES
float clipDistance = clip(gl_FragCoord, u_clippingPlanes, u_clippingPlanesMatrix);
#endif
#if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(HDR)
vec3 normalMC = czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)); // normalized surface normal in model coordinates
vec3 normalEC = czm_normal3D * normalMC; // normalized surface normal in eye coordinates
#endif
#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING)
float nightBlend = 1.0 - clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0, 0.0, 1.0);
#else
float nightBlend = 0.0;
#endif
// The clamp below works around an apparent bug in Chrome Canary v23.0.1241.0
// where the fragment shader sees textures coordinates < 0.0 and > 1.0 for the
// fragments on the edges of tiles even though the vertex shader is outputting
// coordinates strictly in the 0-1 range.
vec4 color = computeDayColor(u_initialColor, clamp(v_textureCoordinates, 0.0, 1.0), nightBlend);
#ifdef SHOW_TILE_BOUNDARIES
if (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) ||
v_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0))
{
color = vec4(1.0, 0.0, 0.0, 1.0);
}
#endif
#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE)
float cameraDist;
if (czm_sceneMode == czm_sceneMode2D)
{
cameraDist = max(czm_frustumPlanes.x - czm_frustumPlanes.y, czm_frustumPlanes.w - czm_frustumPlanes.z) * 0.5;
}
else if (czm_sceneMode == czm_sceneModeColumbusView)
{
cameraDist = -czm_view[3].z;
}
else
{
cameraDist = length(czm_view[3]);
}
float fadeOutDist = u_lightingFadeDistance.x;
float fadeInDist = u_lightingFadeDistance.y;
if (czm_sceneMode != czm_sceneMode3D) {
vec3 radii = czm_ellipsoidRadii;
float maxRadii = max(radii.x, max(radii.y, radii.z));
fadeOutDist -= maxRadii;
fadeInDist -= maxRadii;
}
float fade = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0);
#else
float fade = 0.0;
#endif
#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);
//\u3010mars3d.cn\u4FEE\u6539\u3011 Muyao 2023-07-19 \u5730\u5F62\u533A\u57DF\u6750\u8D28(\u6DF9\u6CA1\uFF0C\u7B49\u9AD8\u7EBF)
bool hasAlphaBlend = true;
#ifdef APPLY_MARS3D_FLOOD
hasAlphaBlend = !u_mars_flood_enabled || (u_mars_flood_enabled && inAreaMars3DRange(u_mars_flood_rectangle, u_mars_flood_texture));
if(u_mars_flood_enabled) {
if(u_mars_flood_only) {
if(! inAreaMars3DRange(u_mars_flood_rectangle, u_mars_flood_texture)) {
discard;
}
}
}
#endif
//\u3010mars3d.cn\u4FEE\u6539\u3011 Muyao 2023-07-19 \u5730\u5F62\u533A\u57DF\u6750\u8D28(\u6DF9\u6CA1\uFF0C\u7B49\u9AD8\u7EBF)
if(hasAlphaBlend) {
vec4 materialColor = vec4(material.diffuse, material.alpha);
color = alphaBlend(materialColor, color);
}
#endif
#ifdef ENABLE_VERTEX_LIGHTING
float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalize(v_normalEC)) * u_lambertDiffuseMultiplier + u_vertexShadowDarkness, 0.0, 1.0);
vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a);
#elif defined(ENABLE_DAYNIGHT_SHADING)
float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0);
diffuseIntensity = mix(1.0, diffuseIntensity, fade);
vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a);
#else
vec4 finalColor = color;
#endif
#ifdef ENABLE_CLIPPING_PLANES
vec4 clippingPlanesEdgeColor = vec4(1.0);
clippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb;
float clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a;
if (clipDistance < clippingPlanesEdgeWidth)
{
finalColor = clippingPlanesEdgeColor;
}
#endif
#ifdef 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
finalColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor.rgb, czm_fogVisualDensityScalar), 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
// \u3010mars3d.cn\u4FEE\u6539\u3011 Muyao 2023-02-20 \u5730\u5F62\u62AC\u5347
#ifdef APPLY_MARS3D_UPLIFT
if(u_mars_uplift_enabled) {
bool isInSlopeRampRectangle = inAreaMars3DRange(u_mars_uplift_rectangle, u_mars_uplift_texture);
if(isInSlopeRampRectangle == u_mars_uplift_hideInsideOrOutside) {
discard;
}
}
#endif
out_FragColor = finalColor;
}
#ifdef SHOW_REFLECTIVE_OCEAN
float waveFade(float edge0, float edge1, float x)
{
float y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);
return pow(1.0 - y, 5.0);
}
float linearFade(float edge0, float edge1, float x)
{
return clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);
}
// Based on water rendering by Jonas Wagner:
// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog
// low altitude wave settings
const float oceanFrequencyLowAltitude = 825000.0;
const float oceanAnimationSpeedLowAltitude = 0.004;
const float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0;
const float oceanSpecularIntensity = 0.5;
// high altitude wave settings
const float oceanFrequencyHighAltitude = 125000.0;
const float oceanAnimationSpeedHighAltitude = 0.008;
const float oceanOneOverAmplitudeHighAltitude = 1.0 / 2.0;
vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float maskValue, float fade)
{
vec3 positionToEyeEC = -positionEyeCoordinates;
float positionToEyeECLength = length(positionToEyeEC);
// The double normalize below works around a bug in Firefox on Android devices.
vec3 normalizedPositionToEyeEC = normalize(normalize(positionToEyeEC));
// Fade out the waves as the camera moves far from the surface.
float waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength);
#ifdef SHOW_OCEAN_WAVES
// high altitude waves
float time = czm_frameNumber * oceanAnimationSpeedHighAltitude;
vec4 noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyHighAltitude, time, 0.0);
vec3 normalTangentSpaceHighAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeHighAltitude);
// low altitude waves
time = czm_frameNumber * oceanAnimationSpeedLowAltitude;
noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0);
vec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude);
// blend the 2 wave layers based on distance to surface
float highAltitudeFade = linearFade(0.0, 60000.0, positionToEyeECLength);
float lowAltitudeFade = 1.0 - linearFade(20000.0, 60000.0, positionToEyeECLength);
vec3 normalTangentSpace =
(highAltitudeFade * normalTangentSpaceHighAltitude) +
(lowAltitudeFade * normalTangentSpaceLowAltitude);
normalTangentSpace = normalize(normalTangentSpace);
// fade out the normal perturbation as we move farther from the water surface
normalTangentSpace.xy *= waveIntensity;
normalTangentSpace = normalize(normalTangentSpace);
#else
vec3 normalTangentSpace = vec3(0.0, 0.0, 1.0);
#endif
vec3 normalEC = enuToEye * normalTangentSpace;
const vec3 waveHighlightColor = vec3(0.3, 0.45, 0.6);
// Use diffuse light to highlight the waves
float diffuseIntensity = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * maskValue;
vec3 diffuseHighlight = waveHighlightColor * diffuseIntensity * (1.0 - fade);
#ifdef SHOW_OCEAN_WAVES
// Where diffuse light is low or non-existent, use wave highlights based solely on
// the wave bumpiness and no particular light direction.
float tsPerturbationRatio = normalTangentSpace.z;
vec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity);
#else
vec3 nonDiffuseHighlight = vec3(0.0);
#endif
// Add specular highlights in 3D, and in all modes when zoomed in.
float specularIntensity = czm_getSpecular(czm_lightDirectionEC, normalizedPositionToEyeEC, normalEC, 10.0);
float surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), maskValue);
float specular = specularIntensity * surfaceReflectance;
#ifdef HDR
specular *= 1.4;
float e = 0.2;
float d = 3.3;
float c = 1.7;
vec3 color = imageryColor.rgb + (c * (vec3(e) + imageryColor.rgb * d) * (diffuseHighlight + nonDiffuseHighlight + specular));
#else
vec3 color = imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular;
#endif
return vec4(color, imageryColor.a);
}
#endif // #ifdef SHOW_REFLECTIVE_OCEAN
`;var Ak=`#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);
vec4 morphPositionEC = czm_modelView * morphPosition;
return czm_projection * morphPositionEC;
}
#ifdef QUANTIZATION_BITS12
uniform vec2 u_minMaxHeight;
uniform mat4 u_scaleAndBias;
#endif
// \u3010mars3d.cn\u4FEE\u6539\u3011 Muyao 2023-02-20 \u5730\u5F62\u538B\u5E73
#ifdef APPLY_MARS3D_FLAT
uniform bool u_mars_flat_enabled;
uniform vec4 u_mars_flat_rectangle;
uniform highp sampler2D u_mars_flat_texture;
uniform highp float u_mars_inverseTileWidth;
uniform highp vec2 u_mars_cartographicTileRectangle;
vec4 getAreaMars3DRange(vec4 rectangle, sampler2D rangeTexture, vec2 textureCoordinates) {
float lo = textureCoordinates.x / u_mars_inverseTileWidth + u_mars_cartographicTileRectangle.x;
float la = textureCoordinates.y / u_mars_inverseTileWidth + u_mars_cartographicTileRectangle.y;
float newX = (lo - rectangle.x) / rectangle.z;
float newY = (la - rectangle.y) / rectangle.w;
vec4 point;
if(newX >= 0.0 && newX <= 1.0 && newY >= 0.0 && newY <= 1.0){
vec4 point = texture(rangeTexture, vec2(newX, newY));
return point;
}else{
return vec4(0.0);
}
}
#endif
// \u3010mars3d.cn\u4FEE\u6539\u3011 Muyao 2023-02-20 \u5730\u5F62\u538B\u5E73
void main()
{
#ifdef QUANTIZATION_BITS12
vec2 xy = czm_decompressTextureCoordinates(compressed0.x);
vec2 zh = czm_decompressTextureCoordinates(compressed0.y);
vec3 position = vec3(xy, zh.x);
float height = zh.y;
vec2 textureCoordinates = czm_decompressTextureCoordinates(compressed0.z);
height = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x;
position = (u_scaleAndBias * vec4(position, 1.0)).xyz;
#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y) || defined(APPLY_MATERIAL)
float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;
float encodedNormal = compressed1;
#elif defined(INCLUDE_WEB_MERCATOR_Y)
float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;
float encodedNormal = 0.0;
#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)
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
// \u3010mars3d.cn\u4FEE\u6539\u3011 Muyao 2023-02-20 \u5730\u5F62\u538B\u5E73
#ifdef APPLY_MARS3D_FLAT
if(u_mars_flat_enabled) {
vec4 isInside = getAreaMars3DRange(u_mars_flat_rectangle,u_mars_flat_texture,textureCoordinates);
if(isInside.r>0.0 || isInside.g>0.0 || isInside.b>0.0 || isInside.a>0.0){
float newHeight = czm_unpackFloat(isInside);
if(newHeight>-9999.0 && newHeight<9999.0){
vec3 offset = (newHeight - height) * ellipsoidNormal;
position += offset;
position3DWC += offset;
height = newHeight;
// vec3 newPosition = (position3DWC + offset) - u_center3D;
}
}
}
#endif
// \u3010mars3d.cn\u4FEE\u6539\u3011 Muyao 2023-02-20 \u5730\u5F62\u538B\u5E73
gl_Position = getPosition(position, height, textureCoordinates);
v_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;
v_positionMC = position3DWC; // position in model coordinates
v_textureCoordinates = vec3(textureCoordinates, webMercatorT);
#if defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)
vec3 normalMC = czm_octDecode(encodedNormal);
#if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS)
vec3 projection = dot(normalMC, ellipsoidNormal) * ellipsoidNormal;
vec3 rejection = normalMC - projection;
normalMC = normalize(projection + rejection * exaggeration);
#endif
v_normalMC = normalMC;
v_normalEC = czm_normal3D * v_normalMC;
#endif
#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 nB=`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 iB=`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 gk=`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 _k=`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;
vec4 positionEC = czm_modelView * position;
gl_Position = czm_projection * positionEC;
}
`;var yk=`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 Ck=`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 Ek=`uniform sampler2D u_texture;
in vec2 v_textureCoordinates;
void main()
{
vec4 color = texture(u_texture, v_textureCoordinates);
out_FragColor = czm_gammaCorrect(color);
}
`;var bk=`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 Ik=`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 xk=`
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);
}
`;async function Nee(e,t){let n=t.terrainProvider,i=t.mapProjection,o=i.ellipsoid,r,a=t.camera.getRectangleCameraCoordinates(e);if(t.mode===oe.SCENE3D?r=o.cartesianToCartographic(a):r=i.unproject(a),!l(n))return r;let s=n.availability;if(!l(s)||t.mode===oe.SCENE2D)return r;let c=[ce.center(e),ce.southeast(e),ce.southwest(e),ce.northeast(e),ce.northwest(e)],u=await Nee._sampleTerrainMostDetailed(n,c),f=!1,h=u.reduce(function(A,m){return l(m.height)?(f=!0,Math.max(m.height,A)):A},-Number.MAX_VALUE),p=r;return f&&(p.height+=h),p}Nee._sampleTerrainMostDetailed=hI;var gI=Nee;var lEt=new k;function uEt(e,t){let n=e.unionClippingRegions,i=e.length,o=da.useFloatTexture(t),r=da.getTextureResolution(e,t,lEt),a=r.x,s=r.y,c=o?hEt(a,s):mEt(a,s);return c+=`
`,c+=n?fEt(i):dEt(i),c}function fEt(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;
// HLSL compiler bug if we discard here: https://bugs.chromium.org/p/angleproject/issues/detail?id=1945#c6
break;
}
}
if (breakAndDiscard) {
discard;
}
return clipAmount;
}
`}function dEt(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 hEt(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});
// Sample from center of pixel
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 mEt(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});
// Sample from center of pixel
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 _I=uEt;function pEt(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 Lee(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}function AEt(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 gEt(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 _Et(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 yEt(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}Lee.prototype.getShaderProgram=function(e){let t=e.frameState,n=e.surfaceTile,i=e.numberOfDayTextures,o=e.applyBrightness,r=e.applyContrast,a=e.applyHue,s=e.applySaturation,c=e.applyGamma,u=e.applyAlpha,f=e.applyDayNightAlpha,h=e.applySplit,p=e.hasWaterMask,A=e.showReflectiveOcean,m=e.showOceanWaves,_=e.enableLighting,y=e.dynamicAtmosphereLighting,C=e.dynamicAtmosphereLightingFromSun,E=e.showGroundAtmosphere,b=e.perFragmentGroundAtmosphere,x=e.hasVertexNormals,S=e.useWebMercatorProjection,B=e.enableFog,v=e.enableClippingPlanes,P=e.clippingPlanes,N=e.enableClippingPolygons,L=e.clippingPolygons,g=e.clippedByBoundaries,I=e.hasImageryLayerCutout,T=e.colorCorrect,w=e.highlightFillTile,R=e.colorToAlpha,O=e.hasGeodeticSurfaceNormals,G=e.hasExaggeration,F=e.showUndergroundColor,U=e.translucent,Q=e.marsOptions||{},H=0,Y="",W=n.renderedMesh.encoding;W.quantization===Ws.BITS12&&(H=1,Y="QUANTIZATION_BITS12");let Z=0,pe="";g&&(Z=1,pe="TILE_LIMIT_RECTANGLE");let ge=0,re="";I&&(ge=1,re="APPLY_IMAGERY_CUTOUT");let ye=t.mode,Ce=((ye|o<<2|r<<3|a<<4|s<<5|c<<6|u<<7|p<<8|A<<9|m<<10|_<<11|y<<12|C<<13|E<<14|b<<15|x<<16|S<<17|B<<18|H<<19|h<<20|v<<21|N<<22|Z<<23|ge<<24|T<<25|w<<26|R<<27|O<<28|G<<29|F<<30|U<<31)>>>0)+(f?4294967296:0),Pe=0;l(P)&&P.length>0&&(Pe=v?P.clippingPlanesState:0);let Ne=0;l(L)&&L.length>0&&(Ne=N?L.clippingPolygonsState:0);let Le=n.surfaceShader;if(l(Le)&&Le.numberOfDayTextures===i&&Le.flags===Ce&&Le.material===this.material&&Le.clippingShaderState===Pe&&Le.clippingPolygonShaderState===Ne)return Le.shaderProgram;let Oe=this._shadersByTexturesFlags[i];if(l(Oe)||(Oe=this._shadersByTexturesFlags[i]=[]),Le=Oe[Ce],!l(Le)||Le.material!==this.material||Le.clippingShaderState!==Pe||Le.clippingPolygonShaderState!==Ne){let ot=this.baseVertexShaderSource.clone(),Fe=this.baseFragmentShaderSource.clone();Pe!==0&&Fe.sources.unshift(_I(P,t.context)),Ne!==0&&(Fe.sources.unshift(gEt(t.context)),ot.sources.unshift(_Et(t.context))),Q.enableUplift&&Fe.defines.push("APPLY_MARS3D_UPLIFT"),Q.enableFlat&&ot.defines.push("APPLY_MARS3D_FLAT"),Q.enableClip&&Fe.defines.push("APPLY_MARS3D_CLIP"),Q.enableFlood&&Fe.defines.push("APPLY_MARS3D_FLOOD"),ot.defines.push(Y),Fe.defines.push(`TEXTURE_UNITS ${i}`,pe,re),o&&Fe.defines.push("APPLY_BRIGHTNESS"),r&&Fe.defines.push("APPLY_CONTRAST"),a&&Fe.defines.push("APPLY_HUE"),s&&Fe.defines.push("APPLY_SATURATION"),c&&Fe.defines.push("APPLY_GAMMA"),Q.invertColor&&Fe.defines.push("APPLY_INVERT_COLOR_MARS3D"),Q.filterColor&&Fe.defines.push("APPLY_FILTER_COLOR_MARS3D"),u&&Fe.defines.push("APPLY_ALPHA"),f&&Fe.defines.push("APPLY_DAY_NIGHT_ALPHA"),p&&Fe.defines.push("HAS_WATER_MASK"),A&&(Fe.defines.push("SHOW_REFLECTIVE_OCEAN"),ot.defines.push("SHOW_REFLECTIVE_OCEAN")),m&&Fe.defines.push("SHOW_OCEAN_WAVES"),R&&Fe.defines.push("APPLY_COLOR_TO_ALPHA"),F&&(ot.defines.push("UNDERGROUND_COLOR"),Fe.defines.push("UNDERGROUND_COLOR")),U&&(ot.defines.push("TRANSLUCENT"),Fe.defines.push("TRANSLUCENT")),_&&(x?(ot.defines.push("ENABLE_VERTEX_LIGHTING"),Fe.defines.push("ENABLE_VERTEX_LIGHTING")):(ot.defines.push("ENABLE_DAYNIGHT_SHADING"),Fe.defines.push("ENABLE_DAYNIGHT_SHADING"))),y&&(ot.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),Fe.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),C&&(ot.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),Fe.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),E&&(ot.defines.push("GROUND_ATMOSPHERE"),Fe.defines.push("GROUND_ATMOSPHERE"),b&&(ot.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),Fe.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),ot.defines.push("INCLUDE_WEB_MERCATOR_Y"),Fe.defines.push("INCLUDE_WEB_MERCATOR_Y"),B&&(ot.defines.push("FOG"),Fe.defines.push("FOG")),h&&Fe.defines.push("APPLY_SPLIT"),v&&Fe.defines.push("ENABLE_CLIPPING_PLANES"),N&&(Fe.defines.push("ENABLE_CLIPPING_POLYGONS"),ot.defines.push("ENABLE_CLIPPING_POLYGONS"),L.inverse&&Fe.defines.push("CLIPPING_INVERSE"),Fe.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${L.extentsCount}`),ot.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${L.extentsCount}`)),T&&Fe.defines.push("COLOR_CORRECT"),w&&Fe.defines.push("HIGHLIGHT_FILL_TILE"),O&&ot.defines.push("GEODETIC_SURFACE_NORMALS"),G&&ot.defines.push("EXAGGERATION");let _t=` vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend)
{
vec4 color = initialColor;
`;I&&(_t+=` vec4 cutoutAndColorResult;
bool texelUnclipped;
`);for(let Ye=0;Ye<i;++Ye)I?_t+=` cutoutAndColorResult = u_dayTextureCutoutRectangles[${Ye}];
texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y;
cutoutAndColorResult = sampleAndBlend(
`:_t+=` color = sampleAndBlend(
`,_t+=` color,
u_dayTextures[${Ye}],
u_dayTextureUseWebMercatorT[${Ye}] ? textureCoordinates.xz : textureCoordinates.xy,
u_dayTextureTexCoordsRectangle[${Ye}],
u_dayTextureTranslationAndScale[${Ye}],
${u?`u_dayTextureAlpha[${Ye}]`:"1.0"},
${f?`u_dayTextureNightAlpha[${Ye}]`:"1.0"},
${f?`u_dayTextureDayAlpha[${Ye}]`:"1.0"},
${o?`u_dayTextureBrightness[${Ye}]`:"0.0"},
${r?`u_dayTextureContrast[${Ye}]`:"0.0"},
${a?`u_dayTextureHue[${Ye}]`:"0.0"},
${s?`u_dayTextureSaturation[${Ye}]`:"0.0"},
${c?`u_dayTextureOneOverGamma[${Ye}]`:"0.0"},
//\u3010mars3d.cn\u4FEE\u6539\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C
${Q.invertColor?`u_mars3dTextureInvertColor[${Ye}]`:"false"},
${Q.filterColor?`u_mars3dTextureFilterColor[${Ye}]`:"vec3(1.0)"},
//\u3010mars3d.cn\u4FEE\u6539\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C
${h?`u_dayTextureSplit[${Ye}]`:"0.0"},
${R?`u_colorsToAlpha[${Ye}]`:"vec4(0.0)"},
nightBlend);
`,I&&(_t+=` color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color);
`);_t+=` return color;
}`,Fe.sources.push(_t),ot.sources.push(AEt(ye)),ot.sources.push(yEt(S));let rt=$t.fromCache({context:t.context,vertexShaderSource:ot,fragmentShaderSource:Fe,attributeLocations:W.getAttributeLocations()});Le=Oe[Ce]=new pEt(i,Ce,this.material,rt,Pe,Ne)}return n.surfaceShader=Le,Le.shaderProgram};Lee.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 fe(this)};var Tk=Lee;var CEt={START:0,LOADING:1,DONE:2,FAILED:3},Ys=Object.freeze(CEt);var EEt={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6},Mo=Object.freeze(EEt);function Er(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new ie(0,0,1,1),this.terrainData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new d,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=Mo.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new le,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}Object.defineProperties(Er.prototype,{eligibleForUnloading:{get:function(){let e=this.terrainState,n=!(e===Mo.RECEIVING||e===Mo.TRANSFORMING),i=this.imagery;for(let o=0,r=i.length;n&&o<r;++o){let a=i[o];n=!l(a.loadingImagery)||a.loadingImagery.state!==Vn.TRANSITIONING}return n}},renderedMesh:{get:function(){if(l(this.vertexArray))return this.mesh;if(l(this.fill))return this.fill.mesh}}});Er.prototype.pick=function(e,t,n,i,o){if(!l(this.renderedMesh))return;let r=this.renderedMesh.pick(e,i,t,n);return d.clone(r,o)};Er.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=Mo.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()};Er.prototype.freeVertexArray=function(){Er._freeVertexArray(this.vertexArray),this.vertexArray=void 0,Er._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0};Er.initialize=function(e,t,n){let i=e.data;l(i)||(i=e.data=new Er),e.state===Ys.START&&(bEt(e,t,n),e.state=Ys.LOADING)};Er.processStateMachine=function(e,t,n,i,o,r,a){Er.initialize(e,n,i);let s=e.data;if(e.state===Ys.LOADING&&IEt(e,t,n,i,o,r),a)return;let c=e.renderable;e.renderable=l(s.vertexArray);let u=s.terrainState===Mo.READY;e.upsampledFromParent=l(s.terrainData)&&s.terrainData.wasCreatedByUpsampling();let f=s.processImagery(e,n,t);if(u&&f){let h=e._loadedCallbacks,p={};for(let A in h)h.hasOwnProperty(A)&&(h[A](e)||(p[A]=h[A]));e._loadedCallbacks=p,e.state=Ys.DONE}c&&(e.renderable=!0)};Er.prototype.processImagery=function(e,t,n,i){let o=e.data,r=e.upsampledFromParent,a=!1,s=!0,c=o.imagery,u,f;for(u=0,f=c.length;u<f;++u){let h=c[u];if(!l(h.loadingImagery)){r=!1;continue}if(h.loadingImagery.state===Vn.PLACEHOLDER){let A=h.loadingImagery.imageryLayer;if(A.ready){h.freeResources(),c.splice(u,1),A._createTileImagerySkeletons(e,t,u),--u,f=c.length;continue}else r=!1}let p=h.processStateMachine(e,n,i);s=s&&p,a=a||p||l(h.readyImagery),r=r&&l(h.loadingImagery)&&(h.loadingImagery.state===Vn.FAILED||h.loadingImagery.state===Vn.INVALID)}return e.upsampledFromParent=r,e.renderable=e.renderable&&(a||s),s};function FTe(e,t,n,i){let o=e.renderedMesh,r=o.vertices,a=o.encoding,s=r.length/a.stride,c=Cr.clone(a);c.hasGeodeticSurfaceNormals=t,c=Cr.clone(c);let u=c.stride,f=new Float32Array(s*u);t?a.addGeodeticSurfaceNormals(r,f,n):a.removeGeodeticSurfaceNormals(r,f),o.vertices=f,o.stride=u,o!==e.mesh?(Er._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=Er._createVertexArrayForMesh(i.context,o)):(Er._freeVertexArray(e.vertexArray),e.vertexArray=Er._createVertexArrayForMesh(i.context,o)),Er._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}Er.prototype.addGeodeticSurfaceNormals=function(e,t){FTe(this,!0,e,t)};Er.prototype.removeGeodeticSurfaceNormals=function(e){FTe(this,!1,void 0,e)};Er.prototype.updateExaggeration=function(e,t,n){let i=this,o=i.renderedMesh;if(o===void 0)return;let r=t.verticalExaggeration,a=t.verticalExaggerationRelativeHeight,s=r!==1,c=o.encoding,u=c.exaggeration!==r,f=c.exaggerationRelativeHeight!==a;if(u||f){if(u)if(s&&!c.hasGeodeticSurfaceNormals){let p=e.tilingScheme.ellipsoid;i.addGeodeticSurfaceNormals(p,t)}else!s&&c.hasGeodeticSurfaceNormals&&i.removeGeodeticSurfaceNormals(t);if(c.exaggeration=r,c.exaggerationRelativeHeight=a,n!==void 0){n._tileToUpdateHeights.push(e);let p=e.customData;for(let A of p)A.level=-1}o.updateExaggeration(r,a)}};Er.prototype.updateSceneMode=function(e){let n=this.renderedMesh;n!==void 0&&n.updateSceneMode(e)};function bEt(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=Mo.FAILED);for(let o=0,r=n.length;o<r;++o){let a=n.get(o);a.show&&a._createTileImagerySkeletons(e,t)}}function IEt(e,t,n,i,o,r){let a=e.data,s=e.parent;if(a.terrainState===Mo.FAILED&&s!==void 0&&(s.data!==void 0&&s.data.terrainData!==void 0&&s.data.terrainData.canUpsample!==!1||Er.processStateMachine(s,t,n,i,o,r,!0)),a.terrainState===Mo.FAILED&&xEt(a,e,t,n,e.x,e.y,e.level),a.terrainState===Mo.UNLOADED&&TEt(a,n,e.x,e.y,e.level),a.terrainState===Mo.RECEIVED&&wEt(a,t,n,e.x,e.y,e.level),a.terrainState===Mo.TRANSFORMED&&(BEt(a,t.context,n,e.x,e.y,e.level,r),a.updateExaggeration(e,t,o)),a.terrainState>=Mo.RECEIVED&&a.waterMaskTexture===void 0&&n.hasWaterMask)if(a.terrainData.waterMask!==void 0)vEt(t.context,a);else{let u=a._findAncestorTileWithTerrainData(e);l(u)&&l(u.data.waterMaskTexture)&&(a.waterMaskTexture=u.data.waterMaskTexture,++a.waterMaskTexture.referenceCount,a._computeWaterMaskTranslationAndScale(e,u,a.waterMaskTranslationAndScale))}}function xEt(e,t,n,i,o,r,a){let s=t.parent;if(!s){t.state=Ys.FAILED;return}let c=s.data.terrainData,u=s.x,f=s.y,h=s.level;if(!l(c))return;let p=c.upsample(i.tilingScheme,u,f,h,o,r,a);l(p)&&(e.terrainState=Mo.RECEIVING,Promise.resolve(p).then(function(A){l(A)&&(e.terrainData=A,e.terrainState=Mo.RECEIVED)}).catch(function(){e.terrainState=Mo.FAILED}))}function TEt(e,t,n,i,o){function r(c){if(!l(c)){e.terrainState=Mo.UNLOADED,e.request=void 0;return}e.terrainData=c,e.terrainState=Mo.RECEIVED,e.request=void 0}function a(c){if(e.request.state===pi.CANCELLED){e.terrainData=void 0,e.terrainState=Mo.UNLOADED,e.request=void 0;return}e.terrainState=Mo.FAILED,e.request=void 0;let u=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${o}. Error message: "${c}"`;t._requestError=$o.reportError(t._requestError,t,t.errorEvent,u,n,i,o),t._requestError.retry&&s()}function s(){let c=new Ir({throttle:!1,throttleByServer:!0,type:ja.TERRAIN});e.request=c;let u=t.requestTileGeometry(n,i,o,c);l(u)?(e.terrainState=Mo.RECEIVING,Promise.resolve(u).then(function(f){r(f)}).catch(function(f){a(f)})):(e.terrainState=Mo.UNLOADED,e.request=void 0)}s()}var SEt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function wEt(e,t,n,i,o,r){let a=n.tilingScheme,s=SEt;s.tilingScheme=a,s.x=i,s.y=o,s.level=r,s.exaggeration=t.verticalExaggeration,s.exaggerationRelativeHeight=t.verticalExaggerationRelativeHeight,s.throttle=!0;let u=e.terrainData.createMesh(s);l(u)&&(e.terrainState=Mo.TRANSFORMING,Promise.resolve(u).then(function(f){e.mesh=f,e.terrainState=Mo.TRANSFORMED}).catch(function(){e.terrainState=Mo.FAILED}))}Er._createVertexArrayForMesh=function(e,t){let n=t.vertices,i=tt.createVertexBuffer({context:e,typedArray:n,usage:Re.STATIC_DRAW}),o=t.encoding.getAttributes(i),r=t.indices.indexBuffers||{},a=r[e.id];if(!l(a)||a.isDestroyed()){let s=t.indices;a=tt.createIndexBuffer({context:e,typedArray:s,usage:Re.STATIC_DRAW,indexDatatype:Ue.fromSizeInBytes(s.BYTES_PER_ELEMENT)}),a.vertexArrayDestroyable=!1,a.referenceCount=1,r[e.id]=a,t.indices.indexBuffers=r}else++a.referenceCount;return new Gn({context:e,attributes:o,indexBuffer:a})};Er._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 BEt(e,t,n,i,o,r,a){e.vertexArray=Er._createVertexArrayForMesh(t,e.mesh),e.terrainState=Mo.READY,e.fill=e.fill&&e.fill.destroy(a)}function DEt(e){let t=e.cache.tile_waterMaskData;if(!l(t)){let n=Dt.create({context:e,pixelFormat:qe.LUMINANCE,pixelDatatype:He.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new jt({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:ci.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function vEt(e,t){let n=t.terrainData.waterMask,i=DEt(e),o,r=n.length;if(n instanceof ImageBitmap)o=Dt.create({context:e,source:n,sampler:i.sampler,flipY:!1,skipColorSpaceConversion:!0});else if(r===1)if(n[0]!==0)o=i.allWaterTexture;else return;else{let a=Math.sqrt(r);o=Dt.create({context:e,pixelFormat:qe.LUMINANCE,pixelDatatype:He.UNSIGNED_BYTE,source:{width:a,height:a,arrayBufferView:n},sampler:i.sampler,flipY:!1}),o.referenceCount=0}++o.referenceCount,t.waterMaskTexture=o,ie.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}Er.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};Er.prototype._computeWaterMaskTranslationAndScale=function(e,t,n){let i=t.rectangle,o=e.rectangle,r=o.width,a=o.height,s=r/i.width,c=a/i.height;return n.x=s*(o.west-i.west)/r,n.y=c*(o.south-i.south)/a,n.z=s,n.w=c,n};var sh=Er;var QTe={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>=QTe.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},ui=QTe;function rB(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 ie}rB.prototype.update=function(e,t,n){this.changedThisFrame&&(WTe(e,t,this.tile,n),this.changedThisFrame=!1)};rB.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};rB.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):sh._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var PEt=new vy;rB.updateFillTiles=function(e,t,n,i){let o=e._quadtree,r=o._levelZeroTiles,a=o._lastSelectionFrameNumber,s=PEt;s.clear();for(let u=0;u<t.length;++u){let f=t[u];l(f.data.vertexArray)&&s.enqueue(t[u])}let c=s.dequeue();for(;c!==void 0;){let u=c.findTileToWest(r),f=c.findTileToSouth(r),h=c.findTileToEast(r),p=c.findTileToNorth(r);Is(e,n,c,u,a,Tn.EAST,!1,s,i),Is(e,n,c,f,a,Tn.NORTH,!1,s,i),Is(e,n,c,h,a,Tn.WEST,!1,s,i),Is(e,n,c,p,a,Tn.SOUTH,!1,s,i);let A=u.findTileToNorth(r),m=u.findTileToSouth(r),_=h.findTileToNorth(r),y=h.findTileToSouth(r);Is(e,n,c,A,a,Tn.SOUTHEAST,!1,s,i),Is(e,n,c,_,a,Tn.SOUTHWEST,!1,s,i),Is(e,n,c,m,a,Tn.NORTHEAST,!1,s,i),Is(e,n,c,y,a,Tn.NORTHWEST,!1,s,i),c=s.dequeue()}};function Is(e,t,n,i,o,r,a,s,c){if(i===void 0)return;let u=i;for(;u&&(u._lastSelectionResultFrame!==o||ui.wasKicked(u._lastSelectionResult)||ui.originalResult(u._lastSelectionResult)===ui.CULLED);){if(a)return;let f=u.parent;if(r>=Tn.NORTHWEST&&f!==void 0)switch(r){case Tn.NORTHWEST:u=u===f.northwestChild?f:void 0;break;case Tn.NORTHEAST:u=u===f.northeastChild?f:void 0;break;case Tn.SOUTHWEST:u=u===f.southwestChild?f:void 0;break;case Tn.SOUTHEAST:u=u===f.southeastChild?f:void 0;break}else u=f}if(u!==void 0){if(u._lastSelectionResult===ui.RENDERED){if(l(u.data.vertexArray))return;REt(e,t,n,u,r,o,s,c);return}if(ui.originalResult(i._lastSelectionResult)!==ui.CULLED)switch(r){case Tn.WEST:Is(e,t,n,i.northwestChild,o,r,!0,s,c),Is(e,t,n,i.southwestChild,o,r,!0,s,c);break;case Tn.EAST:Is(e,t,n,i.southeastChild,o,r,!0,s,c),Is(e,t,n,i.northeastChild,o,r,!0,s,c);break;case Tn.SOUTH:Is(e,t,n,i.southwestChild,o,r,!0,s,c),Is(e,t,n,i.southeastChild,o,r,!0,s,c);break;case Tn.NORTH:Is(e,t,n,i.northeastChild,o,r,!0,s,c),Is(e,t,n,i.northwestChild,o,r,!0,s,c);break;case Tn.NORTHWEST:Is(e,t,n,i.northwestChild,o,r,!0,s,c);break;case Tn.NORTHEAST:Is(e,t,n,i.northeastChild,o,r,!0,s,c);break;case Tn.SOUTHWEST:Is(e,t,n,i.southwestChild,o,r,!0,s,c);break;case Tn.SOUTHEAST:Is(e,t,n,i.southeastChild,o,r,!0,s,c);break;default:throw new de("Invalid edge")}}}function REt(e,t,n,i,o,r,a,s){let c=i.data;if(c.fill===void 0)c.fill=new rB(i);else if(c.fill.visitedFrame===r)return;c.fill.enqueuedFrame!==r&&(c.fill.enqueuedFrame=r,c.fill.changedThisFrame=!1,a.enqueue(i)),MEt(e,t,n,i,o,s)}function MEt(e,t,n,i,o,r){let a=i.data.fill,s,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(WTe(e,t,n,r),c.changedThisFrame=!1),s=n.data.fill.mesh):s=n.data.mesh;let u,f;switch(o){case Tn.WEST:u=a.westMeshes,f=a.westTiles;break;case Tn.SOUTH:u=a.southMeshes,f=a.southTiles;break;case Tn.EAST:u=a.eastMeshes,f=a.eastTiles;break;case Tn.NORTH:u=a.northMeshes,f=a.northTiles;break;case Tn.NORTHWEST:a.changedThisFrame=a.changedThisFrame||a.northwestMesh!==s,a.northwestMesh=s,a.northwestTile=n;return;case Tn.NORTHEAST:a.changedThisFrame=a.changedThisFrame||a.northeastMesh!==s,a.northeastMesh=s,a.northeastTile=n;return;case Tn.SOUTHWEST:a.changedThisFrame=a.changedThisFrame||a.southwestMesh!==s,a.southwestMesh=s,a.southwestTile=n;return;case Tn.SOUTHEAST:a.changedThisFrame=a.changedThisFrame||a.southeastMesh!==s,a.southeastMesh=s,a.southeastTile=n;return}if(n.level<=i.level){a.changedThisFrame=a.changedThisFrame||u[0]!==s||u.length!==1,u[0]=s,f[0]=n,u.length=1,f.length=1;return}let h,p,A,m,_=n.rectangle,y,C=i.rectangle;switch(o){case Tn.WEST:for(y=(C.north-C.south)*D.EPSILON5,h=0;h<f.length&&(A=f[h],m=A.rectangle,!D.greaterThan(_.north,m.south,y));++h);for(p=h;p<f.length&&(A=f[p],m=A.rectangle,!D.greaterThanOrEquals(_.south,m.north,y));++p);break;case Tn.SOUTH:for(y=(C.east-C.west)*D.EPSILON5,h=0;h<f.length&&(A=f[h],m=A.rectangle,!D.lessThan(_.west,m.east,y));++h);for(p=h;p<f.length&&(A=f[p],m=A.rectangle,!D.lessThanOrEquals(_.east,m.west,y));++p);break;case Tn.EAST:for(y=(C.north-C.south)*D.EPSILON5,h=0;h<f.length&&(A=f[h],m=A.rectangle,!D.lessThan(_.south,m.north,y));++h);for(p=h;p<f.length&&(A=f[p],m=A.rectangle,!D.lessThanOrEquals(_.north,m.south,y));++p);break;case Tn.NORTH:for(y=(C.east-C.west)*D.EPSILON5,h=0;h<f.length&&(A=f[h],m=A.rectangle,!D.greaterThan(_.east,m.west,y));++h);for(p=h;p<f.length&&(A=f[p],m=A.rectangle,!D.greaterThanOrEquals(_.west,m.east,y));++p);break}p-h===1?(a.changedThisFrame=a.changedThisFrame||u[h]!==s,u[h]=s,f[h]=n):(a.changedThisFrame=!0,u.splice(h,p-h,s),f.splice(h,p-h,n))}var yI=new me,NEt=new me,oB=new d,kee=new d,Oee=new k,Fee=new k,Kf=new k;function k9(){this.height=0,this.encodedNormal=new k}function M9(e,t,n,i,o,r,a,s,c){if(l(o))return o;let u;if(l(r)&&l(a))u=(r.height+a.height)*.5;else if(l(r))u=r.height;else if(l(a))u=a.height;else if(l(s))u=s.height;else{let h=e.tile.data.tileBoundingRegion,p=0,A=0;l(h)&&(p=h.minimumHeight,A=h.maximumHeight),u=(p+A)*.5}return jTe(e,t,n,i,u,c),c}var LEt={minimumHeight:0,maximumHeight:0},OEt=new d,kTe=new k9,UTe=new k9,zTe=new k9,GTe=new k9,FEt=typeof Uint8Array<"u"?new Uint8Array(81):void 0,QEt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function WTe(e,t,n,i){sh.initialize(n,e.terrainProvider,e._imageryLayers);let o=n.data,r=o.fill,a=n.rectangle,s=t.verticalExaggeration,c=t.verticalExaggerationRelativeHeight,u=s!==1,f=n.tilingScheme.ellipsoid,h=L9(r,f,0,1,r.northwestTile,r.northwestMesh,r.northTiles,r.northMeshes,r.westTiles,r.westMeshes,zTe),p=L9(r,f,0,0,r.southwestTile,r.southwestMesh,r.westTiles,r.westMeshes,r.southTiles,r.southMeshes,kTe),A=L9(r,f,1,0,r.southeastTile,r.southeastMesh,r.southTiles,r.southMeshes,r.eastTiles,r.eastMeshes,UTe),m=L9(r,f,1,1,r.northeastTile,r.northeastMesh,r.eastTiles,r.eastMeshes,r.northTiles,r.northMeshes,GTe);h=M9(r,f,0,1,h,p,m,A,zTe),p=M9(r,f,0,0,p,h,A,m,kTe),A=M9(r,f,1,1,A,p,m,h,UTe),m=M9(r,f,1,1,m,A,h,p,GTe);let _=p.height,y=A.height,C=h.height,E=m.height,b=Math.min(_,y,C,E),x=Math.max(_,y,C,E),S=(b+x)*.5,B,v,P=e.getLevelMaximumGeometricError(n.level),N=f.maximumRadius-P,L=Math.acos(N/f.maximumRadius)*4;if(L*=1.5,a.width>L&&x-b<=P){let T=new Oc({width:9,height:9,buffer:FEt,structure:{heightOffset:x}}),w=QEt;w.tilingScheme=n.tilingScheme,w.x=n.x,w.y=n.y,w.level=n.level,w.exaggeration=s,w.exaggerationRelativeHeight=c,r.mesh=T._createMeshSync(w)}else{let T=u,w=ce.center(a,NEt);w.height=S;let R=f.cartographicToCartesian(w,OEt),O=new Cr(R,void 0,void 0,void 0,void 0,!0,!0,T,s,c),G=5,F;for(F=r.westMeshes,B=0,v=F.length;B<v;++B)G+=F[B].eastIndicesNorthToSouth.length;for(F=r.southMeshes,B=0,v=F.length;B<v;++B)G+=F[B].northIndicesWestToEast.length;for(F=r.eastMeshes,B=0,v=F.length;B<v;++B)G+=F[B].westIndicesSouthToNorth.length;for(F=r.northMeshes,B=0,v=F.length;B<v;++B)G+=F[B].southIndicesEastToWest.length;let U=LEt;U.minimumHeight=b,U.maximumHeight=x;let Q=O.stride,H=new Float32Array(G*Q),Y=0,$=Y;Y=N9(f,a,O,H,Y,0,1,h.height,h.encodedNormal,1,U),Y=F9(r,f,O,H,Y,r.westTiles,r.westMeshes,Tn.EAST,U);let W=Y;Y=N9(f,a,O,H,Y,0,0,p.height,p.encodedNormal,0,U),Y=F9(r,f,O,H,Y,r.southTiles,r.southMeshes,Tn.NORTH,U);let K=Y;Y=N9(f,a,O,H,Y,1,0,A.height,A.encodedNormal,0,U),Y=F9(r,f,O,H,Y,r.eastTiles,r.eastMeshes,Tn.WEST,U);let Z=Y;Y=N9(f,a,O,H,Y,1,1,m.height,m.encodedNormal,1,U),Y=F9(r,f,O,H,Y,r.northTiles,r.northMeshes,Tn.SOUTH,U),b=U.minimumHeight,x=U.maximumHeight;let pe=en.fromRectangle(a,b,x,n.tilingScheme.ellipsoid),ge=mi.geodeticLatitudeToMercatorAngle(a.south),re=1/(mi.geodeticLatitudeToMercatorAngle(a.north)-ge),ye=(mi.geodeticLatitudeToMercatorAngle(w.latitude)-ge)*re,Ce=f.geodeticSurfaceNormalCartographic(yI,kee),Pe=tn.octEncode(Ce,Oee),Ne=Y;O.encode(H,Y*Q,pe.center,k.fromElements(.5,.5,Kf),S,Pe,ye,Ce),++Y;let Le=Y,Oe=Le<256?1:2,ot=(Le-1)*3,Fe=ot*Oe,_t=(H.length-Le*Q)*Float32Array.BYTES_PER_ELEMENT,rt;if(_t>=Fe){let Se=Le*Q*Float32Array.BYTES_PER_ELEMENT;rt=Le<256?new Uint8Array(H.buffer,Se,ot):new Uint16Array(H.buffer,Se,ot)}else rt=Le<256?new Uint8Array(ot):new Uint16Array(ot);H=new Float32Array(H.buffer,0,Le*Q);let Ye=0;for(B=0;B<Le-2;++B)rt[Ye++]=Ne,rt[Ye++]=B,rt[Ye++]=B+1;rt[Ye++]=Ne,rt[Ye++]=B,rt[Ye++]=0;let st=[];for(B=W;B>=$;--B)st.push(B);let ft=[];for(B=K;B>=W;--B)ft.push(B);let St=[];for(B=Z;B>=K;--B)St.push(B);let Ie=[];for(Ie.push(0),B=Ne-1;B>=Z;--B)Ie.push(B);r.mesh=new pc(O.center,H,rt,ot,Le,b,x,a,le.fromOrientedBoundingBox(pe),WEt(e,pe.center,a,b,x),O.stride,pe,O,st,ft,St,Ie)}let g=t.context;r._destroyVertexArray(i),r.vertexArray=sh._createVertexArrayForMesh(g,r.mesh),o.processImagery(n,e.terrainProvider,t,!0);let I=r.waterMaskTexture;if(r.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let T=o._findAncestorTileWithTerrainData(n);l(T)&&l(T.data.waterMaskTexture)&&(r.waterMaskTexture=T.data.waterMaskTexture,++r.waterMaskTexture.referenceCount,o._computeWaterMaskTranslationAndScale(n,T,r.waterMaskTranslationAndScale))}l(I)&&(--I.referenceCount,I.referenceCount===0&&I.destroy())}function N9(e,t,n,i,o,r,a,s,c,u,f){let h=yI;h.longitude=D.lerp(t.west,t.east,r),h.latitude=D.lerp(t.south,t.north,a),h.height=s;let p=e.cartographicToCartesian(h,oB),A;n.hasGeodeticSurfaceNormals&&(A=e.geodeticSurfaceNormal(p,kee));let m=Fee;return m.x=r,m.y=a,n.encode(i,o*n.stride,p,m,s,c,u,A),f.minimumHeight=Math.min(f.minimumHeight,s),f.maximumHeight=Math.max(f.maximumHeight,s),o+1}var Q9=new ce;function Sk(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=ce.clone(e.rectangle,Q9),o.west-=D.TWO_PI,o.east-=D.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(o=ce.clone(e.rectangle,Q9),o.west+=D.TWO_PI,o.east+=D.TWO_PI);let a=o.east-o.west,s=(r.west-o.west)/a,c=(r.east-o.west)/a,u=o.north-o.south,f=(r.south-o.south)/u,h=(r.north-o.south)/u,p=(n.x-s)/(c-s),A=(n.y-f)/(h-f);return Math.abs(p)<Math.EPSILON5?p=0:Math.abs(p-1)<Math.EPSILON5&&(p=1),Math.abs(A)<Math.EPSILON5?A=0:Math.abs(A-1)<Math.EPSILON5&&(A=1),i.x=p,i.y=A,i}var kEt=new k;function Qee(e,t,n,i,o){let r=e.encoding,a=e.vertices;if(o.height=r.decodeHeight(a,t),r.hasVertexNormals)r.getOctEncodedNormal(a,t,o.encodedNormal);else{let s=o.encodedNormal;s.x=0,s.y=0}}var UEt=new k,zEt=new d;function GEt(e,t,n,i,o,r,a,s,c,u){let f=i.encoding,h=i.vertices,p=Sk(t,n,f.decodeTextureCoordinates(h,o,Kf),Kf),A=Sk(t,n,f.decodeTextureCoordinates(h,r,Fee),Fee),m;c?m=(a-p.x)/(A.x-p.x):m=(s-p.y)/(A.y-p.y);let _=f.decodeHeight(h,o),y=f.decodeHeight(h,r),C=n.rectangle;yI.longitude=D.lerp(C.west,C.east,a),yI.latitude=D.lerp(C.south,C.north,s),u.height=yI.height=D.lerp(_,y,m);let E;if(f.hasVertexNormals){let b=f.getOctEncodedNormal(h,o,kEt),x=f.getOctEncodedNormal(h,r,UEt),S=tn.octDecode(b.x,b.y,oB),B=tn.octDecode(x.x,x.y,zEt);E=d.lerp(S,B,m,oB),d.normalize(E,E),tn.octEncode(E,u.encodedNormal)}else E=e.geodeticSurfaceNormalCartographic(yI,oB),tn.octEncode(E,u.encodedNormal)}function jTe(e,t,n,i,o,r){r.height=o;let a=t.geodeticSurfaceNormalCartographic(yI,oB);tn.octEncode(a,r.encodedNormal)}function L9(e,t,n,i,o,r,a,s,c,u,f){if(HTe(e,t,s,a,!1,n,i,f)||HTe(e,t,u,c,!0,n,i,f))return f;let p;if(Uee(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],Qee(r,p,n,i,f),f;let A;if(n===0?i===0?A=O9(e.westMeshes,e.westTiles,Tn.EAST,e.southMeshes,e.southTiles,Tn.NORTH,n,i):A=O9(e.northMeshes,e.northTiles,Tn.SOUTH,e.westMeshes,e.westTiles,Tn.EAST,n,i):i===0?A=O9(e.southMeshes,e.southTiles,Tn.NORTH,e.eastMeshes,e.eastTiles,Tn.WEST,n,i):A=O9(e.eastMeshes,e.eastTiles,Tn.WEST,e.northMeshes,e.northTiles,Tn.SOUTH,n,i),l(A))return jTe(e,t,n,i,A,f),f}function O9(e,t,n,i,o,r,a,s){let c=VTe(e,t,!1,n,a,s),u=VTe(i,o,!0,r,a,s);return l(c)&&l(u)?(c+u)*.5:l(c)?c:u}function F9(e,t,n,i,o,r,a,s,c){for(let u=0;u<r.length;++u)o=VEt(e,t,n,i,o,r[u],a[u],s,c);return o}function VEt(e,t,n,i,o,r,a,s,c){let u=r.rectangle;s===Tn.EAST&&e.tile.x===0?(u=ce.clone(r.rectangle,Q9),u.west-=D.TWO_PI,u.east-=D.TWO_PI):s===Tn.WEST&&r.x===0&&(u=ce.clone(r.rectangle,Q9),u.west+=D.TWO_PI,u.east+=D.TWO_PI);let f=e.tile.rectangle,h,p;o>0&&(n.decodeTextureCoordinates(i,o-1,Kf),h=Kf.x,p=Kf.y);let A,m;switch(s){case Tn.WEST:A=a.westIndicesSouthToNorth,m=!1;break;case Tn.NORTH:A=a.northIndicesWestToEast,m=!0;break;case Tn.EAST:A=a.eastIndicesNorthToSouth,m=!1;break;case Tn.SOUTH:A=a.southIndicesEastToWest,m=!0;break}let _=r,y=e.tile,C=a.encoding,E=a.vertices,b=n.stride,x,S;C.hasWebMercatorT&&(x=mi.geodeticLatitudeToMercatorAngle(f.south),S=1/(mi.geodeticLatitudeToMercatorAngle(f.north)-x));for(let B=0;B<A.length;++B){let v=A[B],P=C.decodeTextureCoordinates(E,v,Kf);Sk(_,y,P,P);let N=P.x,L=P.y,g=m?N:L;if(g<0||g>1||Math.abs(N-h)<D.EPSILON5&&Math.abs(L-p)<D.EPSILON5)continue;let I=Math.abs(N)<D.EPSILON5||Math.abs(N-1)<D.EPSILON5,T=Math.abs(L)<D.EPSILON5||Math.abs(L-1)<D.EPSILON5;if(I&&T)continue;let w=C.decodePosition(E,v,oB),R=C.decodeHeight(E,v),O;C.hasVertexNormals?O=C.getOctEncodedNormal(E,v,Oee):(O=Oee,O.x=0,O.y=0);let G=L;if(C.hasWebMercatorT){let U=D.lerp(f.south,f.north,L);G=(mi.geodeticLatitudeToMercatorAngle(U)-x)*S}let F;n.hasGeodeticSurfaceNormals&&(F=t.geodeticSurfaceNormal(w,kee)),n.encode(i,o*b,w,P,R,O,G,F),c.minimumHeight=Math.min(c.minimumHeight,R),c.maximumHeight=Math.max(c.maximumHeight,R),++o}return o}function VTe(e,t,n,i,o,r){let a,s,c;n?(a=0,s=e.length,c=1):(a=e.length-1,s=-1,c=-1);for(let u=a;u!==s;u+=c){let f=e[u],h=t[u];if(!Uee(h,f))continue;let p;switch(i){case Tn.WEST:p=f.westIndicesSouthToNorth;break;case Tn.SOUTH:p=f.southIndicesEastToWest;break;case Tn.EAST:p=f.eastIndicesNorthToSouth;break;case Tn.NORTH:p=f.northIndicesWestToEast;break}let A=p[n?0:p.length-1];if(l(A))return f.encoding.decodeHeight(f.vertices,A)}}function Uee(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function HTe(e,t,n,i,o,r,a,s){let c,u,f,h,p,A=i[o?0:n.length-1],m=n[o?0:n.length-1];if(Uee(A,m)&&(r===0?a===0?(c=o?m.northIndicesWestToEast:m.eastIndicesNorthToSouth,u=o,f=o):(c=o?m.eastIndicesNorthToSouth:m.southIndicesEastToWest,u=!o,f=!1):a===0?(c=o?m.westIndicesSouthToNorth:m.northIndicesWestToEast,u=!o,f=!0):(c=o?m.southIndicesEastToWest:m.westIndicesSouthToNorth,u=o,f=!o),c.length>0)){h=o?0:c.length-1,p=c[h],m.encoding.decodeTextureCoordinates(m.vertices,p,Kf);let _=Sk(A,e.tile,Kf,Kf);if(_.x===r&&_.y===a)return Qee(m,p,r,a,s),!0;if(h=Co(c,u?r:a,function(y,C){m.encoding.decodeTextureCoordinates(m.vertices,y,Kf);let E=Sk(A,e.tile,Kf,Kf);return f?u?E.x-r:E.y-a:u?r-E.x:a-E.y}),h<0){if(h=~h,h>0&&h<c.length)return GEt(t,A,e.tile,m,c[h-1],c[h],r,a,u,s),!0}else return Qee(m,c[h],r,a,s),!0}return!1}var HEt=[new d,new d,new d,new d];function WEt(e,t,n,i,o,r){let a=e.quadtree._occluders.ellipsoid,s=a.ellipsoid,c=HEt;return d.fromRadians(n.west,n.south,o,s,c[0]),d.fromRadians(n.east,n.south,o,s,c[1]),d.fromRadians(n.west,n.north,o,s,c[2]),d.fromRadians(n.east,n.north,o,s,c[3]),a.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}var aB=rB;function Rr(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=wn.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 _e,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(Rr.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(Rr.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(Rr.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(Rr.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new _e,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 z(0,0,.5,1),this._clippingPlanes=void 0,this._clippingPolygons=void 0,this.cartographicLimitRectangle=ce.clone(ce.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldVerticalExaggeration=void 0,this._oldVerticalExaggerationRelativeHeight=void 0,this._oldSceneMode=oe.SCENE3D,this._initByMars3D&&this._initByMars3D(e)}Object.defineProperties(Rr.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){this._baseColor=e,this._firstPassInitialColor=ie.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){da.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){jh.setOwner(e,this,"_clippingPolygons")}}});function jEt(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}Rr.prototype.update=function(e){this._imageryLayers._update()};function YEt(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,a=o.length;r<a;++r){let s=o.get(r);s.ready&&s.show&&l(s.imageryProvider.credit)&&n.addCreditToNextFrame(s.imageryProvider.credit)}}Rr.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(i){i.data.imagery.sort(jEt)})),YEt(this,e);let t=this._vertexArraysToDestroy,n=t.length;for(let i=0;i<n;++i)sh._freeVertexArray(t[i]);t.length=0};Rr.prototype.beginUpdate=function(e){let t=this._tilesToRenderByTextureCount;for(let o=0,r=t.length;o<r;++o){let a=t[o];l(a)&&(a.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};Rr.prototype.endUpdate=function(e){if(!l(this._renderState)){this._renderState=Ve.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:nc.LESS}}),this._blendRenderState=Ve.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:nc.LESS_OR_EQUAL},blending:sn.ALPHA_BLEND});let s=je(this._renderState,!0);s.cull.enabled=!1,this._disableCullingRenderState=Ve.fromCache(s),s=je(this._blendRenderState,!0),s.cull.enabled=!1,this._disableCullingBlendRenderState=Ve.fromCache(s)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&aB.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._oldSceneMode!==e.mode;this._oldSceneMode=e.mode,r&&t.forEachLoadedTile(function(s){s.data.updateSceneMode(e.mode)});let a=this._tilesToRenderByTextureCount;for(let s=0,c=a.length;s<c;++s){let u=a[s];if(l(u))for(let f=0,h=u.length;f<h;++f){let p=u[f],A=p.data.tileBoundingRegion;JTe(this,p,e,!1);let m=this.marsOptions?.uplift;if(m&&m.enabled&&m.height!==0&&m.rectangles){for(let _=0;_<m.rectangles.length;_++)if(ce.intersection(A.rectangle,m.rectangles[_])){JTe(this,p,e,!0);break}}e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,A.minimumHeight)}}};function ZTe(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)}Rr.prototype.updateForPick=function(e){let t=this._drawCommands;for(let n=0,i=this._usedDrawCommands;n<i;++n)ZTe(t[n],e)};Rr.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()};Rr.prototype.getLevelMaximumGeometricError=function(e){return l(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(e):0};Rr.prototype.loadTile=function(e,t){let n=t.data,i=!0,o;l(n)&&(i=n.boundingVolumeSourceTile!==t||t._lastSelectionResult===ui.CULLED_BUT_NEEDED,o=n.terrainState),sh.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)!==Vr.NONE&&n.boundingVolumeSourceTile===t&&(i=!1,sh.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i))};var qEt=new le,$Te=new ce,KEt=new ce,XEt=new me;function z9(e,t){if(t.west<t.east)return t;let n=ce.clone(t,KEt);return ce.center(e,XEt).longitude>0?n.east=D.PI:n.west=-D.PI,n}function eSe(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||!ce.equals(e.cartographicLimitRectangle,ce.MAX_VALUE))}Rr.prototype.computeTileVisibility=function(e,t,n){let i=this.computeDistanceToTile(e,t);e._distance=i;let o=eSe(this,t);if(t.fog.enabled&&!o&&D.fog(i,t.fog.density)>=1)return Vr.NONE;let r=e.data,a=r.tileBoundingRegion;if(r.boundingVolumeSourceTile===void 0)return Vr.PARTIAL;let s=t.cullingVolume,c=a.boundingVolume;l(c)||(c=a.boundingSphere),r.clippedByBoundaries=!1;let u=z9(e.rectangle,this.cartographicLimitRectangle),f=ce.simpleIntersection(u,e.rectangle,$Te);if(!l(f))return Vr.NONE;if(ce.equals(f,e.rectangle)||(r.clippedByBoundaries=!0),t.mode!==oe.SCENE3D&&(c=qEt,le.fromRectangleWithHeights2D(e.rectangle,t.mapProjection,a.minimumHeight,a.maximumHeight,c),d.fromElements(c.center.z,c.center.x,c.center.y,c.center),t.mode===oe.MORPHING&&l(r.renderedMesh)&&(c=le.union(a.boundingSphere,c,c))),!l(c))return Vr.PARTIAL;let h=this._clippingPlanes;if(l(h)&&h.enabled){let y=h.computeIntersectionWithBoundingVolume(c);if(e.isClipped=y!==Xt.INSIDE,y===Xt.OUTSIDE)return Vr.NONE}let p=this._clippingPolygons;if(l(p)&&p.enabled){let y=p.computeIntersectionWithBoundingVolume(a);e.isClipped=y!==Xt.OUTSIDE}let A,m=s.computeVisibility(c);if(m===Xt.OUTSIDE?A=Vr.NONE:m===Xt.INTERSECTING?A=Vr.PARTIAL:m===Xt.INSIDE&&(A=Vr.FULL),A===Vr.NONE)return A;let _=t.mode===oe.SCENE3D&&t.camera.frustum instanceof An;if(t.mode===oe.SCENE3D&&!_&&l(n)&&!o){let y=r.occludeePointInScaledSpace;return!l(y)||n.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(y,a.minimumHeight)?A:Vr.NONE}return A};Rr.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 JEt=[],ZEt=[];Rr.prototype.canRenderWithoutLosingDetail=function(e,t){let n=e.data,i=JEt;i.length=this._imageryLayers.length;let o=!1,r=!1,a;l(n)&&(o=n.terrainState===Mo.READY,r=!0,a=n.imagery);let s,c;for(s=0,c=i.length;s<c;++s)i[s]=r;if(l(a))for(s=0,c=a.length;s<c;++s){let h=a[s],p=h.loadingImagery,A=!l(p)||p.state===Vn.FAILED||p.state===Vn.INVALID,m=(h.loadingImagery||h.readyImagery).imageryLayer._layerIndex;i[m]=A&&i[m]}let u=this.quadtree._lastSelectionFrameNumber,f=ZEt;for(f.length=0,f.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild);f.length>0;){let h=f.pop(),p=h._lastSelectionResultFrame===u?h._lastSelectionResult:ui.NONE;if(p===ui.RENDERED){let A=h.data;if(!l(A))continue;if(!o&&h.data.terrainState===Mo.READY)return!1;let m=h.data.imagery;for(s=0,c=m.length;s<c;++s){let _=m[s],y=_.loadingImagery,C=!l(y)||y.state===Vn.FAILED||y.state===Vn.INVALID,E=(_.loadingImagery||_.readyImagery).imageryLayer._layerIndex;if(C&&!i[E])return!1}}else p===ui.REFINED&&f.push(h.southwestChild,h.southeastChild,h.northwestChild,h.northeastChild)}return!0};var $Et=new d;Rr.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,a=d.subtract(i.center,o,$Et),s=d.magnitude(a);return s<D.EPSILON5?0:(d.divideByScalar(a,s,a),(1-d.dot(a,r))*e._distance)};var YTe=new M,U9=new M,e0t=new ie,t0t=new ie,n0t=new ie,i0t=new d,qTe=new d,o0t=new d,r0t=new d;Rr.prototype.showTileThisFrame=function(e,t){let n=0,i=e.data.imagery;for(let s=0,c=i.length;s<c;++s){let u=i[s];l(u.readyImagery)&&u.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 a=this._debug;++a.tilesRendered,a.texturesRendered+=n};var a0t=[new d,new d,new d,new d];function KTe(e,t,n,i,o,r){let a=e.quadtree._occluders.ellipsoid,s=a.ellipsoid,c=a0t;return d.fromRadians(n.west,n.south,o,s,c[0]),d.fromRadians(n.east,n.south,o,s,c[1]),d.fromRadians(n.west,n.north,o,s,c[2]),d.fromRadians(n.east,n.north,o,s,c[3]),a.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}Rr.prototype.computeDistanceToTile=function(e,t){s0t(e,this,t);let n=e.data;if(n.boundingVolumeSourceTile===void 0)return 9999999999;let o=n.tileBoundingRegion,r=o.minimumHeight,a=o.maximumHeight;if(n.boundingVolumeSourceTile!==e){let c=t.camera.positionCartographic.height,u=Math.abs(c-r),f=Math.abs(c-a);u>f?(o.minimumHeight=r,o.maximumHeight=r):(o.minimumHeight=a,o.maximumHeight=a)}let s=o.distanceToCamera(t);return o.minimumHeight=r,o.maximumHeight=a,s};function s0t(e,t,n){let i=e.data;i===void 0&&(i=e.data=new sh);let o=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new Df({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:o,minimumHeight:0,maximumHeight:0}));let r=i.tileBoundingRegion,a=r.minimumHeight,s=r.maximumHeight,c=!1,u=e,f=0,h=t.marsOptions?.flat;if(h&&h.enabled&&h.rectangles){for(let y=0;y<h.rectangles.length;y++)if(ce.intersection(e.rectangle,h.rectangles[y])){f=h.rectangles[y]._flatHeight??h.heights[y];break}}let p=t.marsOptions?.uplift,A=0;if(p&&p.enabled&&p.height!==0&&p.rectangles){for(let y=0;y<p.rectangles.length;y++)if(ce.intersection(r.rectangle,p.rectangles[y])){A=p.height;break}}let m=i.mesh,_=i.terrainData;if(m!==void 0&&m.minimumHeight!==void 0&&m.maximumHeight!==void 0)r.minimumHeight=m.minimumHeight,r.maximumHeight=m.maximumHeight,c=!0;else if(_!==void 0&&_._minimumHeight!==void 0&&_._maximumHeight!==void 0)r.minimumHeight=_._minimumHeight,r.maximumHeight=_._maximumHeight;else{r.minimumHeight=Number.NaN,r.maximumHeight=Number.NaN;let y=e.parent;for(;y!==void 0;){let C=y.data;if(C!==void 0){let E=C.mesh,b=C.terrainData;if(E!==void 0&&E.minimumHeight!==void 0&&E.maximumHeight!==void 0){r.minimumHeight=E.minimumHeight,r.maximumHeight=E.maximumHeight;break}else if(b!==void 0&&b._minimumHeight!==void 0&&b._maximumHeight!==void 0){r.minimumHeight=b._minimumHeight,r.maximumHeight=b._maximumHeight;break}}y=y.parent}u=y}if(r.maximumHeight+=A,r.minimumHeight-=f,u!==void 0){let y=n.verticalExaggeration,C=n.verticalExaggerationRelativeHeight;if((y!==1||f!==0)&&(c=!1,r.minimumHeight=xo.getHeight(r.minimumHeight,y,C),r.maximumHeight=xo.getHeight(r.maximumHeight,y,C)),c)i.boundingVolumeIsFromMesh||(r._orientedBoundingBox=en.clone(m.orientedBoundingBox,r._orientedBoundingBox),r._boundingSphere=le.clone(m.boundingSphere3D,r._boundingSphere),i.occludeePointInScaledSpace=d.clone(m.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=KTe(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace)));else{let b=r._orientedBoundingBox===void 0||r._boundingSphere===void 0;(r.minimumHeight!==a||r.maximumHeight!==s||b)&&(r.computeBoundingVolumes(o),i.occludeePointInScaledSpace=KTe(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=u,i.boundingVolumeIsFromMesh=c}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}Rr.prototype.isDestroyed=function(){return!1};Rr.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(),fe(this)};function c0t(e,t,n){return function(i){let o,r,a=-1,s=i.data.imagery,c=s.length,u;for(u=0;u<c;++u)if(o=s[u],r=o.readyImagery??o.loadingImagery,r.imageryLayer===t){a=u;break}if(a!==-1){let f=a+e;if(o=s[f],r=l(o)?o.readyImagery??o.loadingImagery:void 0,!l(r)||r.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,f);for(u=a;u<f;++u)s[u].freeResources();s.splice(a,e)}return!0}}Rr.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(a){if(l(a._loadedCallbacks[e._layerIndex]))return;let s,c=a.data.imagery,u=c.length,f=-1,h=0;for(s=0;s<u;++s){let A=c[s];if((A.readyImagery??A.loadingImagery).imageryLayer===e)f===-1&&(f=s),++h;else if(f!==-1)break}if(f===-1)return;let p=f+h;e._createTileImagerySkeletons(a,n,p)&&(a._loadedCallbacks[e._layerIndex]=c0t(h,e,n),a.state=Ys.LOADING)})};if(e.ready){let a=e.imageryProvider;a._reload=r}this._quadtree.forEachLoadedTile(function(a){e._createTileImagerySkeletons(a,n)&&(a.state=Ys.LOADING,a.level!==0&&(a._lastSelectionResultFrame!==i.quadtree._lastSelectionFrameNumber||a._lastSelectionResult!==ui.RENDERED)&&(a.renderable=!1))}),this._layerOrderChanged=!0,o.raiseEvent()}};Rr.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile(function(n){let i=n.data.imagery,o=-1,r=0;for(let a=0,s=i.length;a<s;++a){let c=i[a],u=c.loadingImagery;if(l(u)||(u=c.readyImagery),u.imageryLayer===e)o===-1&&(o=a),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()};Rr.prototype._onLayerMoved=function(e,t,n){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()};Rr.prototype._onLayerShownOrHidden=function(e,t,n){n?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var l0t=new M,u0t=new M;function XTe(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=M.multiplyByPoint(i,this.properties.rtc,qTe);return M.setTranslation(i,o,YTe),YTe},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,o=e.context.uniformState.projection,r=M.multiplyByPoint(i,this.properties.rtc,qTe);return M.setTranslation(i,r,U9),M.multiply(o,U9,U9),U9},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)?M.multiply(e.context.uniformState.view,i.modelMatrix,l0t):M.IDENTITY;return M.inverseTranspose(o,u0t)},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},u_mars3dTextureInvertColor:function(){return this.properties.mars3dTextureInvertColor},u_mars3dTextureFilterColor:function(){return this.properties.mars3dTextureFilterColor},u_mars_inverseTileWidth:function(){return this.properties.mars_inverseTileWidth},u_mars_cartographicTileRectangle:function(){return this.properties.mars_cartographicTileRectangle},u_mars_flat_enabled:function(){return this.properties.mars_flat_enabled},u_mars_flat_rectangle:function(){return this.properties.mars_flat_rectangle},u_mars_flat_texture:function(){return l(this.properties.mars_flat_texture)?this.properties.mars_flat_texture:e.context.defaultTexture},u_mars_uplift_enabled:function(){return this.properties.mars_uplift_enabled},u_mars_uplift_hideInsideOrOutside:function(){return this.properties.mars_uplift_hideInsideOrOutside},u_mars_uplift_rectangle:function(){return this.properties.mars_uplift_rectangle},u_mars_uplift_texture:function(){return l(this.properties.mars_uplift_texture)?this.properties.mars_uplift_texture:e.context.defaultTexture},u_mars_clip_enabled:function(){return this.properties.mars_clip_enabled},u_mars_clip_rectangle:function(){return this.properties.mars_clip_rectangle},u_mars_clip_texture:function(){return l(this.properties.mars_clip_texture)?this.properties.mars_clip_texture:e.context.defaultTexture},u_mars_clip_only:function(){return this.properties.mars_clip_only},u_mars_flood_enabled:function(){return this.properties.mars_flood_enabled},u_mars_flood_rectangle:function(){return this.properties.mars_flood_rectangle},u_mars_flood_texture:function(){return l(this.properties.mars_flood_texture)?this.properties.mars_flood_texture:e.context.defaultTexture},u_mars_flood_only:function(){return this.properties.mars_flood_only},properties:{initialColor:new ie(0,0,.5,1),fillHighlightColor:new z(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new k(65e5,9e6),nightFadeDistance:new k(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new d(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new d(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new d,center3D:void 0,rtc:new d,modifiedModelView:new M,tileRectangle:new ie,verticalExaggerationAndRelativeHeight:new k(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new k,southMercatorYAndOneOverHeight:new k,waterMask:void 0,waterMaskTranslationAndScale:new ie,minMaxHeight:new k,scaleAndBias:new M,clippingPlanesEdgeColor:z.clone(z.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new ie,frontFaceAlphaByDistance:new ie,backFaceAlphaByDistance:new ie,localizedTranslucencyRectangle:new ie,undergroundColor:z.clone(z.TRANSPARENT),undergroundColorAlphaByDistance:new ie,lambertDiffuseMultiplier:0,vertexShadowDarkness:0,mars3dTextureInvertColor:[],mars3dTextureFilterColor:[],mars_inverseTileWidth:0,mars_cartographicTileRectangle:void 0,mars_flat_enabled:!1,mars_flat_rectangle:new ie,mars_flat_texture:void 0,mars_uplift_enabled:!1,mars_uplift_hideInsideOrOutside:!1,mars_uplift_rectangle:new ie,mars_uplift_texture:void 0,mars_clip_enabled:!1,mars_clip_rectangle:new ie,mars_clip_texture:void 0,mars_clip_only:!1,mars_flood_enabled:!1,mars_flood_rectangle:new ie,mars_flood_texture:void 0,mars_flood_only:!1}};return l(t.materialUniformMap)?Pt(n,t.materialUniformMap):n}function f0t(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=d0t(e,r,o),i.wireframeVertexArray.mesh=o}}function d0t(e,t,n){let o={indices:n.indices,primitiveType:ve.TRIANGLES};Wn.toWireframe(o);let r=o.indices,a=tt.createIndexBuffer({context:e,typedArray:r,usage:Re.STATIC_DRAW,indexDatatype:Ue.fromSizeInBytes(r.BYTES_PER_ELEMENT)});return new Gn({context:e,attributes:t._attributes,indexBuffer:a})}var tSe,nSe,G9;(function(){let e=new Mt({geometry:Rh.fromDimensions({dimensions:new d(2,2,2)})}),t=new Mt({geometry:new Hg({radius:1})}),n=new M,i,o;function r(a){return new Nn({geometryInstances:a,appearance:new gn({translucent:!1,flat:!0}),asynchronous:!1})}tSe=function(a,s){return a===i||(G9(),i=a,n=M.fromRotationTranslation(a.halfAxes,a.center,n),e.modelMatrix=n,e.attributes.color=Jt.fromColor(s),o=r(e)),o},nSe=function(a,s){return a===i||(G9(),i=a,n=M.fromTranslation(a.center,n),n=M.multiplyByUniformScale(n,a.radius,n),t.modelMatrix=n,t.attributes.color=Jt.fromColor(s),o=r(t)),o},G9=function(){l(o)&&(o.destroy(),o=void 0,i=void 0)}})();var h0t=new ie(0,0,0,0),m0t={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},p0t=z.TRANSPARENT,A0t=new Ht;function JTe(e,t,n,i){let o=t.data;l(o.vertexArray)||(o.fill===void 0&&(o.fill=new aB(t)),o.fill.update(e,n));let r=n.creditDisplay,a=o.terrainData;if(l(a)&&l(a.credits)){let mt=a.credits;for(let Gt=0,Hn=mt.length;Gt<Hn;++Gt)r.addCreditToNextFrame(mt[Gt])}let s=Rt.maximumTextureImageUnits,c=o.waterMaskTexture,u=o.waterMaskTranslationAndScale;!l(c)&&l(o.fill)&&(c=o.fill.waterMaskTexture,u=o.fill.waterMaskTranslationAndScale);let f=n.cameraUnderground,h=n.globeTranslucencyState,p=h.translucent,A=h.frontFaceAlphaByDistance,m=h.backFaceAlphaByDistance,_=h.rectangle,y=e.undergroundColor??p0t,C=e.undergroundColorAlphaByDistance??A0t,E=eSe(e,n)&&n.mode===oe.SCENE3D&&y.alpha>0&&(C.nearValue>0||C.farValue>0),b=e.lambertDiffuseMultiplier,x=e.vertexShadowDarkness,S=e.hasWaterMask&&l(c),B=S&&e.showWaterEffect,v=e.oceanNormalMap,P=B&&l(v),N=e.terrainProvider,L=l(N)&&e.terrainProvider.hasVertexNormals,g=n.fog.enabled&&n.fog.renderable&&!f,I=e.showGroundAtmosphere&&n.mode===oe.SCENE3D,T=wn.castShadows(e.shadows)&&!p,w=wn.receiveShadows(e.shadows)&&!p,R=e.hueShift,O=e.saturationShift,G=e.brightnessShift,F=!(D.equalsEpsilon(R,0,D.EPSILON7)&&D.equalsEpsilon(O,0,D.EPSILON7)&&D.equalsEpsilon(G,0,D.EPSILON7)),U=!1;if(I){let mt=d.magnitude(n.camera.positionWC),Gt=e.nightFadeOutDistance;U=mt>Gt}S&&--s,P&&--s,l(n.shadowState)&&n.shadowState.shadowsEnabled&&--s,l(e.clippingPlanes)&&e.clippingPlanes.enabled&&--s,l(e.clippingPolygons)&&e.clippingPolygons.enabled&&(--s,--s),s-=h.numberOfTextureUniforms;let Q=o.renderedMesh,H=Q.center,Y=Q.encoding,$=o.tileBoundingRegion,W=n.verticalExaggeration,K=n.verticalExaggerationRelativeHeight,Z=e.marsOptions?.uplift;i&&Z&&(K=n.verticalExaggerationRelativeHeight-Z.height/(W-1)),e.marsOptions?.uplift?.enabled&&--s,e.marsOptions?.clip?.enabled&&--s,e.marsOptions?.flat?.enabled&&--s,e.marsOptions?.flood?.enabled&&--s;let pe=W!==1,ge=Y.hasGeodeticSurfaceNormals,re=e0t,ye=0,Ce=0,Pe=0,Ne=0,Le=!1;if(n.mode!==oe.SCENE3D){let mt=n.mapProjection,Gt=mt.project(ce.southwest(t.rectangle),o0t),Hn=mt.project(ce.northeast(t.rectangle),r0t);if(re.x=Gt.x,re.y=Gt.y,re.z=Hn.x,re.w=Hn.y,n.mode!==oe.MORPHING&&(H=i0t,H.x=0,H.y=(re.z+re.x)*.5,H.z=(re.w+re.y)*.5,re.x-=H.y,re.y-=H.z,re.z-=H.y,re.w-=H.z),n.mode===oe.SCENE2D&&Y.quantization===Ws.BITS12){let Je=1/(Math.pow(2,12)-1)*.5,fo=(re.z-re.x)*Je,Vt=(re.w-re.y)*Je;re.x-=fo,re.y-=Vt,re.z+=fo,re.w+=Vt}mt instanceof mi&&(ye=t.rectangle.south,Ce=t.rectangle.north,Pe=mi.geodeticLatitudeToMercatorAngle(ye),Ne=1/(mi.geodeticLatitudeToMercatorAngle(Ce)-Pe),Le=!0)}let Oe=m0t;Oe.frameState=n,Oe.surfaceTile=o,Oe.hasWaterMask=S,Oe.showReflectiveOcean=B,Oe.showOceanWaves=P,Oe.enableLighting=e.enableLighting,Oe.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,Oe.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,Oe.showGroundAtmosphere=I,Oe.atmosphereLightIntensity=e.atmosphereLightIntensity,Oe.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Oe.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Oe.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Oe.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Oe.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Oe.perFragmentGroundAtmosphere=U,Oe.hasVertexNormals=L,Oe.useWebMercatorProjection=Le,Oe.clippedByBoundaries=o.clippedByBoundaries,Oe.hasGeodeticSurfaceNormals=ge,Oe.hasExaggeration=pe;let ot=o.imagery,Fe=0,_t=ot.length,rt=e.showSkirts&&!f&&!p,Ye=e.backFaceCulling&&!f&&!p,st=Ye?e._renderState:e._disableCullingRenderState,ft=Ye?e._blendRenderState:e._disableCullingBlendRenderState,St=st,Ie=e._firstPassInitialColor,Se=n.context;if(l(e._debug.boundingSphereTile)||G9(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let mt=e._drawCommands.length;for(let Gt=0;Gt<mt;++Gt)e._uniformMaps[Gt]=XTe(n,e)}do{let mt=0,Gt,Hn;if(e._drawCommands.length<=e._usedDrawCommands?(Gt=new nt,Gt.owner=t,Gt.cull=!1,Gt.boundingVolume=new le,Gt.orientedBoundingBox=void 0,Hn=XTe(n,e),e._drawCommands.push(Gt),e._uniformMaps.push(Hn)):(Gt=e._drawCommands[e._usedDrawCommands],Hn=e._uniformMaps[e._usedDrawCommands]),Gt.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let ls=$.boundingVolume,on=$.boundingSphere;l(ls)?tSe(ls,z.RED).update(n):l(on)&&nSe(on,z.RED).update(n)}let Je=Hn.properties;ie.clone(Ie,Je.initialColor),Je.oceanNormalMap=v,Je.lightingFadeDistance.x=e.lightingFadeOutDistance,Je.lightingFadeDistance.y=e.lightingFadeInDistance,Je.nightFadeDistance.x=e.nightFadeOutDistance,Je.nightFadeDistance.y=e.nightFadeInDistance,Je.atmosphereLightIntensity=e.atmosphereLightIntensity,Je.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Je.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Je.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Je.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Je.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Je.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let fo=f?m:A,Vt=f?A:m;l(fo)&&(ie.fromElements(fo.near,fo.nearValue,fo.far,fo.farValue,Je.frontFaceAlphaByDistance),ie.fromElements(Vt.near,Vt.nearValue,Vt.far,Vt.farValue,Je.backFaceAlphaByDistance)),ie.fromElements(C.near,C.nearValue,C.far,C.farValue,Je.undergroundColorAlphaByDistance),z.clone(y,Je.undergroundColor),Je.lambertDiffuseMultiplier=b,Je.vertexShadowDarkness=x;let Lo=!l(o.vertexArray)&&l(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;Lo&&z.clone(e.fillHighlightColor,Je.fillHighlightColor),Je.verticalExaggerationAndRelativeHeight.x=W,Je.verticalExaggerationAndRelativeHeight.y=K,Je.center3D=Q.center,d.clone(H,Je.rtc),ie.clone(re,Je.tileRectangle),Je.southAndNorthLatitude.x=ye,Je.southAndNorthLatitude.y=Ce,Je.southMercatorYAndOneOverHeight.x=Pe,Je.southMercatorYAndOneOverHeight.y=Ne;let io=t0t,Qi=z9(t.rectangle,e.cartographicLimitRectangle),Yo=n0t,ai=z9(t.rectangle,_);d.fromElements(R,O,G,Je.hsbShift);let Xn=t.rectangle,oo=1/Xn.width,Oo=1/Xn.height;io.x=(Qi.west-Xn.west)*oo,io.y=(Qi.south-Xn.south)*Oo,io.z=(Qi.east-Xn.west)*oo,io.w=(Qi.north-Xn.south)*Oo,ie.clone(io,Je.localizedCartographicLimitRectangle),Yo.x=(ai.west-Xn.west)*oo,Yo.y=(ai.south-Xn.south)*Oo,Yo.z=(ai.east-Xn.west)*oo,Yo.w=(ai.north-Xn.south)*Oo,Je.mars_inverseTileWidth=oo,Je.mars_cartographicTileRectangle=new k(Xn.west,Xn.south);let yo=e.marsOptions?.clip;yo?(yo.rectangle?Je.mars_clip_rectangle=new ie(yo.rectangle.west,yo.rectangle.south,yo.rectangle.width,yo.rectangle.height):Je.mars_clip_rectangle=new ie,Je.mars_clip_texture=yo.texture,Je.mars_clip_only=yo.onlySelf,Je.mars_clip_enabled=yo.enabled):(Je.mars_clip_enabled=!1,Je.mars_clip_rectangle=new ie,Je.mars_clip_texture=void 0,Je.mars_clip_only=!1);let or=e.marsOptions?.flood;or?(or.rectangle?Je.mars_flood_rectangle=new ie(or.rectangle.west,or.rectangle.south,or.rectangle.width,or.rectangle.height):Je.mars_flood_rectangle=new ie,Je.mars_flood_texture=or.texture,Je.mars_flood_only=or.onlySelf,Je.mars_flood_enabled=or.enabled):(Je.mars_flood_enabled=!1,Je.mars_flood_rectangle=new ie,Je.mars_flood_texture=void 0);let qo=e.marsOptions?.flat;qo?(qo.rectangle?Je.mars_flat_rectangle=new ie(qo.rectangle.west,qo.rectangle.south,qo.rectangle.width,qo.rectangle.height):Je.mars_flat_rectangle=new ie,Je.mars_flat_texture=qo.texture,Je.mars_flat_enabled=qo.enabled):(Je.mars_flat_enabled=!1,Je.mars_flat_rectangle=new ie,Je.mars_flat_texture=void 0);let bn=e.marsOptions?.uplift;bn?(bn.rectangle?Je.mars_uplift_rectangle=new ie(bn.rectangle.west,bn.rectangle.south,bn.rectangle.width,bn.rectangle.height):Je.mars_uplift_rectangle=new ie,Je.mars_uplift_texture=bn.texture,Je.mars_uplift_enabled=(!bn.showUp||bn.enabled&&bn.height!==0)&&l(bn.rectangles)&&bn.rectangles.length>0,Je.mars_uplift_hideInsideOrOutside=!i):(Je.mars_uplift_enabled=!1,Je.mars_uplift_rectangle=new ie,Je.mars_uplift_texture=void 0,Je.mars_uplift_hideInsideOrOutside=!1),ie.clone(Yo,Je.localizedTranslucencyRectangle);let wi=g&&D.fog(t._distance,n.fog.density)>D.EPSILON3;F=F&&(wi||I);let Ln=!1,Ko=!1,Xo=!1,ss=!1,Hi=!1,Do=!1,Ts=!1,wa=!1,Mr=!1,Ss=!1,$u=!1,ef=!1;for(;mt<s&&Fe<_t;){let ls=ot[Fe],on=ls.readyImagery;if(++Fe,!l(on)||on.imageryLayer.alpha===0)continue;let we=ls.useWebMercatorT?on.textureWebMercator:on.texture,lt=on.imageryLayer;l(ls.textureTranslationAndScale)||(ls.textureTranslationAndScale=lt._calculateTextureTranslationAndScale(t,ls)),Je.dayTextures[mt]=we,Je.dayTextureTranslationAndScale[mt]=ls.textureTranslationAndScale,Je.dayTextureTexCoordsRectangle[mt]=ls.textureCoordinateRectangle,Je.dayTextureUseWebMercatorT[mt]=ls.useWebMercatorT,Je.dayTextureAlpha[mt]=lt.alpha,Do=Do||Je.dayTextureAlpha[mt]!==1,Je.dayTextureNightAlpha[mt]=lt.nightAlpha,Ts=Ts||Je.dayTextureNightAlpha[mt]!==1,Je.dayTextureDayAlpha[mt]=lt.dayAlpha,Ts=Ts||Je.dayTextureDayAlpha[mt]!==1,Je.dayTextureBrightness[mt]=lt.brightness,Ln=Ln||Je.dayTextureBrightness[mt]!==ga.DEFAULT_BRIGHTNESS,Je.dayTextureContrast[mt]=lt.contrast,Ko=Ko||Je.dayTextureContrast[mt]!==ga.DEFAULT_CONTRAST,Je.dayTextureHue[mt]=lt.hue,Xo=Xo||Je.dayTextureHue[mt]!==ga.DEFAULT_HUE,Je.dayTextureSaturation[mt]=lt.saturation,ss=ss||Je.dayTextureSaturation[mt]!==ga.DEFAULT_SATURATION,Je.dayTextureOneOverGamma[mt]=1/lt.gamma,Hi=Hi||Je.dayTextureOneOverGamma[mt]!==1/ga.DEFAULT_GAMMA,Je.dayTextureSplit[mt]=lt.splitDirection,wa=wa||Je.dayTextureSplit[mt]!==0,$u=$u||!!lt.invertColor,Je.mars3dTextureInvertColor[mt]=!!lt.invertColor,ef=ef||!!lt.filterColor,lt.filterColor?Je.mars3dTextureFilterColor[mt]=new d(lt.filterColor.red,lt.filterColor.green,lt.filterColor.blue):Je.mars3dTextureFilterColor[mt]=new d(1,1,1);let an=Je.dayTextureCutoutRectangles[mt];if(l(an)||(an=Je.dayTextureCutoutRectangles[mt]=new ie),ie.clone(ie.ZERO,an),l(lt.cutoutRectangle)){let ho=z9(Xn,lt.cutoutRectangle),Ba=ce.simpleIntersection(ho,Xn,$Te);Mr=l(Ba)||Mr,an.x=(ho.west-Xn.west)*oo,an.y=(ho.south-Xn.south)*Oo,an.z=(ho.east-Xn.west)*oo,an.w=(ho.north-Xn.south)*Oo}let Ao=Je.colorsToAlpha[mt];l(Ao)||(Ao=Je.colorsToAlpha[mt]=new ie);let Ha=l(lt.colorToAlpha)&&lt.colorToAlphaThreshold>0;if(Ss=Ss||Ha,Ha){let ho=lt.colorToAlpha;Ao.x=ho.red,Ao.y=ho.green,Ao.z=ho.blue,Ao.w=lt.colorToAlphaThreshold}else Ao.w=-1;if(l(on.credits)){let ho=on.credits;for(let Ba=0,Cl=ho.length;Ba<Cl;++Ba)r.addCreditToNextFrame(ho[Ba])}++mt}Je.dayTextures.length=mt,Je.waterMask=c,ie.clone(u,Je.waterMaskTranslationAndScale),Je.minMaxHeight.x=Y.minimumHeight,Je.minMaxHeight.y=Y.maximumHeight,M.clone(Y.matrix,Je.scaleAndBias);let tf=e._clippingPlanes,yh=l(tf)&&tf.enabled&&t.isClipped;yh&&(Je.clippingPlanesEdgeColor=z.clone(tf.edgeColor,Je.clippingPlanesEdgeColor),Je.clippingPlanesEdgeWidth=tf.edgeWidth);let Js=e._clippingPolygons,z_=l(Js)&&Js.enabled&&t.isClipped;Oe.numberOfDayTextures=mt,Oe.applyBrightness=Ln,Oe.applyContrast=Ko,Oe.applyHue=Xo,Oe.applySaturation=ss,Oe.applyGamma=Hi,Oe.applyAlpha=Do,Oe.applyDayNightAlpha=Ts,Oe.applySplit=wa,Oe.enableFog=wi,Oe.enableClippingPlanes=yh,Oe.clippingPlanes=tf,Oe.enableClippingPolygons=z_,Oe.clippingPolygons=Js,Oe.hasImageryLayerCutout=Mr,Oe.colorCorrect=F,Oe.highlightFillTile=Lo,Oe.colorToAlpha=Ss,Oe.showUndergroundColor=E,Oe.translucent=p,Oe.marsOptions={invertColor:$u,filterColor:ef,enableUplift:e?._marsOptions?.uplift?.enabled,enableFlat:e?._marsOptions?.flat?.enabled,enableClip:e?._marsOptions?.clip?.enabled,enableFlood:e?._marsOptions?.flood?.enabled};let Xm=o.renderedMesh.indices.length;rt||(Xm=o.renderedMesh.indexCountWithoutSkirts),Gt.shaderProgram=e._surfaceShaderSet.getShaderProgram(Oe),Gt.castShadows=T,Gt.receiveShadows=w,Gt.renderState=St,Gt.primitiveType=ve.TRIANGLES,Gt.vertexArray=o.vertexArray||o.fill.vertexArray,Gt.count=Xm,Gt.uniformMap=Hn,Gt.pass=Be.GLOBE,e._debug.wireframe&&(f0t(Se,e,t),l(o.wireframeVertexArray)&&(Gt.vertexArray=o.wireframeVertexArray,Gt.primitiveType=ve.LINES,Gt.count=Xm*2));let br=Gt.boundingVolume,cs=Gt.orientedBoundingBox;n.mode!==oe.SCENE3D?(le.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,$.minimumHeight,$.maximumHeight,br),d.fromElements(br.center.z,br.center.x,br.center.y,br.center),n.mode===oe.MORPHING&&(br=le.union($.boundingSphere,br,br))):(Gt.boundingVolume=le.clone($.boundingSphere,br),Gt.orientedBoundingBox=en.clone($.boundingVolume,cs)),Gt.dirty=!0,p&&h.updateDerivedCommands(Gt,n),ZTe(Gt,n),St=ft,Ie=h0t}while(Fe<_t)}var wk=Rr;function iSe(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=ce.clone(ce.MAX_VALUE)}Object.defineProperties(iSe.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=Ht.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=Ht.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){l(e)||(e=ce.clone(ce.MAX_VALUE)),ce.clone(e,this._rectangle)}}});var Bk=iSe;function oSe(e){this._ellipsoid=new Am(e.ellipsoid,d.ZERO)}Object.defineProperties(oSe.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var Dk=oSe;var zee=class{constructor(t){this.maxSize=t,this.cache=new Map}get(t){if(!this.cache.has(t))return;let n=this.cache.get(t);return this.cache.delete(t),this.cache.set(t,n),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){let i=this.cache.keys().next().value;this.cache.delete(i)}this.cache.set(t,n)}clear(){this.cache.clear()}},g0t=1e3;function qs(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=new Set,this._customDataIterator=void 0,this._addedCustomData=[],this._removedCustomData=[],this._lastSelectionResult=ui.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this._positionCache=new zee(g0t),this.state=Ys.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}qs.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 a=0;a<t;++a)i[o++]=new qs({tilingScheme:e,x:a,y:r,level:0});return i};var _0t=256;function y0t(e,t,n,i){let o=n.width/_0t*i,r=Math.floor(e/o)*o,a=Math.floor(t/o)*o;return`${r.toFixed(10)},${a.toFixed(10)}`}qs.prototype._getCacheKey=function(e,t){return y0t(e.longitude,e.latitude,this._rectangle,t)};qs.prototype.getPositionCacheEntry=function(e,t){return this._positionCache.get(this._getCacheKey(e,t))};qs.prototype.setPositionCacheEntry=function(e,t,n){this._positionCache.set(this._getCacheKey(e,t),n)};qs.prototype.clearPositionCache=function(){this._positionCache.size>0&&this._positionCache.clear()};qs.prototype.updateCustomData=function(){let e=this._addedCustomData,t=this._removedCustomData;if(e.length===0&&t.length===0)return;let n=this.customData;for(let i=0;i<e.length;++i){let o=e[i];n.add(o),rSe(this,o.positionCartographic)._addedCustomData.push(o)}this._addedCustomData.length=0;for(let i=0;i<t.length;++i){let o=t[i];n.has(o)&&n.delete(o),rSe(this,o.positionCartographic)._removedCustomData.push(o)}this._removedCustomData.length=0};var C0t=new me;function rSe(e,t){let n=e.northwestChild.rectangle,i=ce.southeast(n,C0t),o=t.longitude>=i.longitude?1:0;switch((t.latitude<i.latitude?1:0)*2+o){case 0:return e.northwestChild;case 1:return e.northeastChild;case 2:return e.southwestChild;default:return e.southeastChild}}Object.defineProperties(qs.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 qs({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 qs({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 qs({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 qs({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<Ys.DONE}},eligibleForUnloading:{get:function(){let e=!0;return l(this.data)&&(e=this.data.eligibleForUnloading,l(e)||(e=!0)),e}}});qs.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]};qs.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};qs.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};qs.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};qs.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};qs.prototype.freeResources=function(){this.clearPositionCache(),this.state=Ys.START,this.renderable=!1,this.upsampledFromParent=!1,l(this.data)&&l(this.data.freeResources)&&this.data.freeResources(),V9(this._southwestChild),this._southwestChild=void 0,V9(this._southeastChild),this._southeastChild=void 0,V9(this._northwestChild),this._northwestChild=void 0,V9(this._northeastChild),this._northeastChild=void 0};function V9(e){l(e)&&e.freeResources()}var vk=qs;function H9(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}H9.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};H9.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(),aSe(this,t)),t=i}};function aSe(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}H9.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))&&aSe(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var Pk=H9;function ch(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._tilesRenderedThisFrame=new Set,this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new Pk,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=e.maximumScreenSpaceError??2,this.tileCacheSize=e.tileCacheSize??100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new Dk({ellipsoid:n}),this._tileLoadProgressEvent=new _e,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(ch.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});ch.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function E0t(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,cSe(e);let n=e._levelZeroTiles;if(l(n))for(let i=0;i<n.length;++i){let r=n[i].customData;for(let a of r)a.level=0,e._addHeightCallbacks.push(a);n[i].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}ch.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==Ys.START&&e(t),t=t.replacementNext};ch.prototype.forEachRenderedTile=function(e){let t=this._tilesRenderedThisFrame;for(let n of t)e(n)};ch.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 a=0;a<r;++a)if(o[a]===i){o.splice(a,1);break}n._removeHeightCallbacks.push(i),i.callback&&(i.callback=void 0)},n._addHeightCallbacks.push(i),i.removeFunc};ch.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function cSe(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}ch.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(E0t(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),cSe(this),!this._debug.suspendLodUpdate&&(this._tileReplacementQueue.markStartOfRenderFrame(),this._tilesRenderedThisFrame.clear()))};ch.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),T0t(this,e),L0t(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function b0t(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let o=_e.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))}ch.prototype.endFrame=function(e){!e.passes.render||e.mode===oe.MORPHING||(P0t(this,e),N0t(this,e),b0t(this,e))};ch.prototype.isDestroyed=function(){return!1};ch.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var Mk,sSe=new me;function I0t(e,t){let n=ce.center(e.rectangle,sSe),i=n.longitude-Mk.longitude,o=n.latitude-Mk.latitude;n=ce.center(t.rectangle,sSe);let r=n.longitude-Mk.longitude,a=n.latitude-Mk.latitude;return i*i+o*o-(r*r+a*a)}var x0t=new d,Rk=[];function T0t(e,t){let n=e._debug;if(n.suspendLodUpdate)return;let i=e._tilesToRender;i.length=0;let o=e._tileProvider;if(!l(e._levelZeroTiles)){let h=o.tilingScheme;if(l(h)){let p=o.tilingScheme;e._levelZeroTiles=vk.createLevelZeroTiles(p);let A=e._levelZeroTiles.length;if(Rk.length<A){Rk=new Array(A);for(let m=0;m<A;++m)Rk[m]===void 0&&(Rk[m]=new Nk)}}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let r=e._levelZeroTiles,a=r.length>1?e._occluders:void 0;Mk=t.camera.positionCartographic,r.sort(I0t);let s=e._addHeightCallbacks,c=e._removeHeightCallbacks;s.forEach(h=>{let p=r.find(A=>ce.contains(A.rectangle,h.positionCartographic));p&&p._addedCustomData.push(h)}),c.forEach(h=>{let p=r.find(A=>ce.contains(A.rectangle,h.positionCartographic));p&&p._removedCustomData.push(h)}),r.forEach(h=>h.updateCustomData()),s.length=0,c.length=0;let u=t.camera;e._cameraPositionCartographic=u.positionCartographic;let f=M.getTranslation(u.transform,x0t);e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(f,e._cameraReferenceFrameOriginCartographic);for(let h=0;h<r.length;++h){let p=r[h];e._tileReplacementQueue.markTileRendered(p),p.renderable?Qc(e,p,o,t,a,!1,Rk[h]):(S_(e,e._tileLoadQueueHigh,p,t),++n.tilesWaitingForChildren)}e._lastSelectionFrameNumber=t.frameNumber}function S_(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function Nk(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function lSe(){this.southwest=new Nk,this.southeast=new Nk,this.northwest=new Nk,this.northeast=new Nk}lSe.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 Vee=new Array(31);for(let e=0;e<Vee.length;++e)Vee[e]=new lSe;function S0t(e,t,n,i,o){let r=e._debug;++r.tilesVisited,e._tileReplacementQueue.markTileRendered(n),n.updateCustomData(),n.level>r.maxDepthVisited&&(r.maxDepthVisited=n.level);let a=D0t(e,t,n)<e.maximumScreenSpaceError,s=n.southwestChild,c=n.southeastChild,u=n.northwestChild,f=n.northeastChild,h=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===h?n._lastSelectionResult:ui.NONE,A=e.tileProvider;if(a||i){let m=ui.originalResult(p)===ui.RENDERED,_=ui.originalResult(p)===ui.CULLED||p===ui.NONE,y=n.state===Ys.DONE,C=m||_||y;if(C||l(A.canRenderWithoutLosingDetail)&&(C=A.canRenderWithoutLosingDetail(n)),C){a&&S_(e,e._tileLoadQueueMedium,n,t),W9(e,n),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===ui.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=ui.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,a&&S_(e,e._tileLoadQueueHigh,n,t)}if(A.canRefine(n)){if(s.upsampledFromParent&&c.upsampledFromParent&&u.upsampledFromParent&&f.upsampledFromParent){W9(e,n),S_(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(s),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(u),e._tileReplacementQueue.markTileRendered(f),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===ui.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=ui.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=ui.REFINED;let _=e._tilesToRender.length,y=e._tileLoadQueueLow.length,C=e._tileLoadQueueMedium.length,E=e._tileLoadQueueHigh.length,b=e._tileToUpdateHeights.length;if(w0t(e,s,c,u,f,t,i,o),_!==e._tilesToRender.length){let x=o.allAreRenderable,S=o.anyWereRenderedLastFrame,B=o.notYetRenderableCount,v=!1;if(!x&&!S){let P=e._tilesToRender;for(let L=_;L<P.length;++L){let g=P[L];for(;g!==void 0&&g._lastSelectionResult!==ui.KICKED&&g!==n;)g._lastSelectionResult=ui.kick(g._lastSelectionResult),g=g.parent}e._tilesToRender.length=_,e._tileToUpdateHeights.length=b,W9(e,n),n._lastSelectionResult=ui.RENDERED;let N=p===ui.RENDERED;!N&&B>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=y,e._tileLoadQueueMedium.length=C,e._tileLoadQueueHigh.length=E,S_(e,e._tileLoadQueueMedium,n,t),o.notYetRenderableCount=n.renderable?0:1,v=!0),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=N,N||e._tileToUpdateHeights.push(n),++r.tilesWaitingForChildren}e.preloadAncestors&&!v&&S_(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=ui.RENDERED,W9(e,n),S_(e,e._tileLoadQueueHigh,n,t),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===ui.RENDERED,o.notYetRenderableCount=n.renderable?0:1}function w0t(e,t,n,i,o,r,a,s){let c=r.camera.positionCartographic,u=e._tileProvider,f=e._occluders,h=Vee[t.level],p=h.southwest,A=h.southeast,m=h.northwest,_=h.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(Qc(e,t,u,r,f,a,p),Qc(e,n,u,r,f,a,A),Qc(e,i,u,r,f,a,m),Qc(e,o,u,r,f,a,_)):(Qc(e,i,u,r,f,a,m),Qc(e,t,u,r,f,a,p),Qc(e,o,u,r,f,a,_),Qc(e,n,u,r,f,a,A)):c.latitude<t.rectangle.north?(Qc(e,n,u,r,f,a,A),Qc(e,t,u,r,f,a,p),Qc(e,o,u,r,f,a,_),Qc(e,i,u,r,f,a,m)):(Qc(e,o,u,r,f,a,_),Qc(e,i,u,r,f,a,m),Qc(e,n,u,r,f,a,A),Qc(e,t,u,r,f,a,p)),h.combine(s)}function B0t(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&ce.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&ce.contains(n,e._cameraReferenceFrameOriginCartographic)}function Qc(e,t,n,i,o,r,a){if(n.computeTileVisibility(t,i,o)!==Vr.NONE)return S0t(e,i,t,r,a);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),a.allAreRenderable=!0,a.anyWereRenderedLastFrame=!1,a.notYetRenderableCount=0,B0t(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&S_(e,e._tileLoadQueueMedium,t,i);let s=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===s?t._lastSelectionResult:ui.NONE;c!==ui.CULLED_BUT_NEEDED&&c!==ui.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=ui.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(S_(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=ui.CULLED):t._lastSelectionResult=ui.CULLED;t._lastSelectionResultFrame=i.frameNumber}function D0t(e,t,n){if(t.mode===oe.SCENE2D||t.camera.frustum instanceof An||t.camera.frustum instanceof ua)return v0t(e,t,n);let i=e._tileProvider.getLevelMaximumGeometricError(n.level),o=n._distance,r=t.context.drawingBufferHeight,a=t.camera.frustum.sseDenominator,s=i*r/(o*a);return t.fog.enabled&&(s-=D.fog(o,t.fog.density)*t.fog.sse),s/=t.pixelRatio,s}function v0t(e,t,n){let o=t.camera.frustum,r=o.offCenterFrustum;l(r)&&(o=r);let a=t.context,s=a.drawingBufferWidth,c=a.drawingBufferHeight,u=e._tileProvider.getLevelMaximumGeometricError(n.level),f=Math.max(o.top-o.bottom,o.right-o.left)/Math.max(s,c),h=u/f;return t.fog.enabled&&t.mode!==oe.SCENE2D&&(h-=D.fog(n._distance,t.fog.density)*t.fog.sse),h/=t.pixelRatio,h}function W9(e,t){e._tilesToRender.push(t),e._tilesRenderedThisFrame.add(t)}function P0t(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=Fi()+e._loadQueueTimeSlice,a=e._tileProvider,s=Gee(e,t,a,r,n,!1);s=Gee(e,t,a,r,i,s),Gee(e,t,a,r,o,s)}function R0t(e,t){return e._loadPriority-t._loadPriority}function Gee(e,t,n,i,o,r){n.computeTileLoadPriority!==void 0&&o.sort(R0t);for(let a=0,s=o.length;a<s&&(Fi()<i||!r);++a){let c=o[a];e._tileReplacementQueue.markTileRendered(c),n.loadTile(t,c),r=!0}return r}var sB=new yn,j9=new me,qC=new d,M0t=[];function N0t(e,t){if(!l(e.tileProvider.tilingScheme))return;let n=M0t;n.length=0;let i=e._tileToUpdateHeights,o=Fi(),r=e._updateHeightsTimeSlice,a=o+r,s=t.mode,c=t.mapProjection,u=e.tileProvider.tilingScheme.ellipsoid,f;for(;i.length>0;){let h=i[0];if(!l(h.data)||!l(h.data.mesh)){let y=h._lastSelectionResultFrame===e._lastSelectionFrameNumber?h._lastSelectionResult:ui.NONE;(y===ui.RENDERED||y===ui.CULLED_BUT_NEEDED)&&n.push(h),h.clearPositionCache(),i.shift();continue}let p=h.customData;l(h._customDataIterator)||(h._customDataIterator=p.values());let A=h._customDataIterator,m=!1,_;for(;!(_=A.next()).done;){let y=_.value,C=h.data.terrainData,E=l(C)&&C.wasCreatedByUpsampling();if(h.level>y.level&&!E){let b,x=h.getPositionCacheEntry(y.positionCartographic,e.maximumScreenSpaceError);if(l(x))b=x;else{if(l(y.positionOnEllipsoidSurface)||(y.positionOnEllipsoidSurface=d.fromRadians(y.positionCartographic.longitude,y.positionCartographic.latitude,0,u)),s===oe.SCENE3D){let S=u.geodeticSurfaceNormal(y.positionOnEllipsoidSurface,sB.direction),B=u.getSurfaceNormalIntersectionWithZAxis(y.positionOnEllipsoidSurface,11500,sB.origin);if(!l(B)){let v=0;l(h.data.tileBoundingRegion)&&(v=h.data.tileBoundingRegion.minimumHeight);let P=Math.min(v,-11500),N=d.multiplyByScalar(S,Math.abs(P)+1,qC);d.subtract(y.positionOnEllipsoidSurface,N,sB.origin)}}else me.clone(y.positionCartographic,j9),j9.height=-11500,c.project(j9,qC),d.fromElements(qC.z,qC.x,qC.y,qC),d.clone(qC,sB.origin),d.clone(d.UNIT_X,sB.direction);b=h.data.pick(sB,s,c,!1,qC),l(b)&&h.setPositionCacheEntry(y.positionCartographic,e.maximumScreenSpaceError,b)}if(l(b)){if(l(y.callback)){let S=u.cartesianToCartographic(b,j9);y.callback(S)}y.level=h.level}}if(Fi()>=a){m=!0;break}}if(m){h._customDataIterator=A;break}else h._customDataIterator=void 0,i.shift()}for(f=0;f<n.length;f++)i.push(n[f])}function L0t(e,t){let n=e._tileProvider,i=e._tilesToRender;for(let o=0,r=i.length;o<r;++o){let a=i[o];n.showTileThisFrame(a,t)}}var Lk=ch;function zm(e){e=e??te.default;let t=new cI({ellipsoid:e}),n=new pb;this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new Tk,this._material=void 0,this._surface=new Lk({tileProvider:new wk({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=t,this._terrainProviderChanged=new _e,this._undergroundColor=z.clone(z.BLACK),this._undergroundColorAlphaByDistance=new Ht(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new Bk,Wee(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new De({url:Zt("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=te.WGS84.equals(e),this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new d(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new d(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=D.PI_OVER_TWO*e.minimumRadius,this.lightingFadeInDistance=D.PI*e.minimumRadius,this.nightFadeOutDistance=D.PI_OVER_TWO*e.minimumRadius,this.nightFadeInDistance=5*D.PI_OVER_TWO*e.minimumRadius,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=wn.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(zm.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=ce.clone(ce.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)&&Wee(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,Wee(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=z.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){this._undergroundColorAlphaByDistance=Ht.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function Wee(e){let t=[],n=l(e._material)&&(l(e._material.shaderSource.match(/slope/))||l(e._material.shaderSource.match("normalEC"))),i=[Yh,nB];l(e._material)&&(!n||e._terrainProvider.hasVertexNormals)?(i.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms):e._surface._tileProvider.materialUniformMap=void 0,i.push(pk),e._surfaceShaderSet.baseVertexShaderSource=new We({sources:[Yh,nB,Ak],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new We({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function O0t(e){return function(t,n){let i=le.distanceSquaredTo(t.pickBoundingSphere,e),o=le.distanceSquaredTo(n.pickBoundingSphere,e);return i-o}}var F0t=[],Q0t={start:0,stop:0};zm.prototype.pickWorldCoordinates=function(e,t,n,i){n=n??!0;let o=t.mode,r=t.mapProjection,a=F0t;a.length=0;for(let u of this._surface._tilesRenderedThisFrame){let f=u.data;if(!l(f))continue;let h=f.pickBoundingSphere;if(o!==oe.SCENE3D)f.pickBoundingSphere=h=le.fromRectangleWithHeights2D(u.rectangle,r,f.tileBoundingRegion.minimumHeight,f.tileBoundingRegion.maximumHeight,h),d.fromElements(h.center.z,h.center.x,h.center.y,h.center);else if(l(f.renderedMesh))le.clone(f.tileBoundingRegion.boundingSphere,h);else continue;let p=di.raySphere(e,h,Q0t);l(p)&&a.push(f)}a.sort(O0t(e.origin));let s,c=a.length;for(let u=0;u<c&&(s=a[u].pick(e,t.mode,t.mapProjection,n,i),!l(s));++u);return s};var k0t=new me;zm.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),l(n)&&t.mode!==oe.SCENE3D){n=d.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,k0t);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var U0t=new d,uSe=new d,z0t=new me,G0t=new yn;function Hee(e,t){return l(e)&&ce.contains(e.rectangle,t)?e:void 0}zm.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],!ce.contains(n.rectangle,e));++i);if(i>=o)return;let r=n;for(;l(n);)n=Hee(n._southwestChild,e)||Hee(n._southeastChild,e)||Hee(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 a=this._surface._tileProvider.tilingScheme.projection,s=this._surface._tileProvider.tilingScheme.ellipsoid,c=d.fromRadians(e.longitude,e.latitude,0,s,U0t),u=G0t,f=s.geodeticSurfaceNormal(c,u.direction),h=s.getSurfaceNormalIntersectionWithZAxis(c,11500,u.origin);if(!l(h)){let A;l(n.data.tileBoundingRegion)&&(A=n.data.tileBoundingRegion.minimumHeight);let m=Math.min(A??0,-11500),_=d.multiplyByScalar(f,Math.abs(m)+1,uSe);d.subtract(c,_,u.origin)}let p=n.data.pick(u,oe.SCENE3D,a,!1,uSe);if(l(p))return s.cartesianToCartographic(p,z0t).height};zm.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};zm.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 s=this._oceanNormalMapResource,c=s.url;if(l(c)){let u=this;s.fetchImage().then(function(f){c===u._oceanNormalMapResource.url&&(u._oceanNormalMap=u._oceanNormalMap&&u._oceanNormalMap.destroy(),u._oceanNormalMap=new Dt({context:e.context,source:f}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}let r=e.passes,a=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=a===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))};zm.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};zm.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};zm.prototype.isDestroyed=function(){return!1};zm.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(),fe(this)};var Ok=zm;var jee={position:0};function Y9(e){e=e??V.EMPTY_OBJECT,this.center=d.clone(e.center??d.ZERO),this._center=new d,this.radii=d.clone(e.radii),this._radii=new d,this._oneOverEllipsoidRadiiSquared=new d,this._boundingSphere=new le,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=new M,this._computedModelMatrix=new M,this.show=e.show??!0,this.material=e.material??Yi.fromType(Yi.ColorType),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.onlySunLighting=e.onlySunLighting??!1,this._onlySunLighting=!1,this._depthTestEnabled=e.depthTestEnabled??!0,this._useLogDepth=!1,this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new nt({owner:e._owner??this}),this._pickCommand=new nt({owner: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 V0t(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=Ic.createGeometry(Ic.fromDimensions({dimensions:new d(2,2,2),vertexFormat:ke.POSITION_ONLY}));return t=Gn.fromGeometry({context:e,geometry:n,attributeLocations:jee,bufferUsage:Re.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}Y9.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=Ve.fromCache({cull:{enabled:!0,face:Ni.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?sn.ALPHA_BLEND:void 0})),l(this._va)||(this._va=V0t(t));let o=!1,r=this.radii;if(!d.equals(this._radii,r)){d.clone(r,this._radii);let _=this._oneOverEllipsoidRadiiSquared;_.x=1/(r.x*r.x),_.y=1/(r.y*r.y),_.z=1/(r.z*r.z),o=!0}(!M.equals(this.modelMatrix,this._modelMatrix)||!d.equals(this.center,this._center))&&(M.clone(this.modelMatrix,this._modelMatrix),d.clone(this.center,this._center),M.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),o=!0),o&&(d.clone(d.ZERO,this._boundingSphere.center),this._boundingSphere.radius=d.maximumComponent(r),le.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));let a=this._material!==this.material;this._material=this.material,this._material.update(t);let s=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;let c=e.useLogDepth,u=this._useLogDepth!==c;this._useLogDepth=c;let f=this._colorCommand,h,p;(a||s||i||u)&&(h=new We({sources:[tB]}),p=new We({sources:[this.material.shaderSource,eB]}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(h.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._sp=$t.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:h,fragmentShaderSource:p,attributeLocations:jee}),f.vertexArray=this._va,f.renderState=this._rs,f.shaderProgram=this._sp,f.uniformMap=Pt(this._uniforms,this.material._uniforms),f.executeInClosestFrustum=n);let A=e.commandList,m=e.passes;if(m.render&&(f.boundingVolume=this._boundingSphere,f.debugShowBoundingVolume=this.debugShowBoundingVolume,f.modelMatrix=this._computedModelMatrix,f.pass=n?Be.TRANSLUCENT:Be.OPAQUE,A.push(f)),m.pick){let _=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})),(a||s||!l(this._pickSP)||u)&&(h=new We({sources:[tB]}),p=new We({sources:[this.material.shaderSource,eB],pickColorQualifier:"uniform"}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(h.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._pickSP=$t.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:h,fragmentShaderSource:p,attributeLocations:jee}),_.vertexArray=this._va,_.renderState=this._rs,_.shaderProgram=this._pickSP,_.uniformMap=Pt(Pt(this._uniforms,this._pickUniforms),this.material._uniforms),_.executeInClosestFrustum=n),_.boundingVolume=this._boundingSphere,_.modelMatrix=this._computedModelMatrix,_.pass=n?Be.TRANSLUCENT:Be.OPAQUE,A.push(_)}};Y9.prototype.isDestroyed=function(){return!1};Y9.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(),fe(this)};var Fk=Y9;function Qk(e){e=e??V.EMPTY_OBJECT;let t=e.textureUrl;l(t)||(t=Zt("Assets/Textures/moonSmall.jpg")),this.show=e.show??!0,this.textureUrl=t,this._ellipsoid=e.ellipsoid??te.MOON,this.onlySunLighting=e.onlySunLighting??!0,this._ellipsoidPrimitive=new Fk({radii:this.ellipsoid.radii,material:Yi.fromType(Yi.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new K2}Object.defineProperties(Qk.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var q9=new J,H0t=new J,W0t=new d,K9=[];Qk.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(At.computeIcrfToFixedMatrix(n,q9))||At.computeTemeToPseudoFixedMatrix(n,q9);let i=this._axes.evaluate(n,H0t);J.transpose(i,i),J.multiply(q9,i,i);let o=iy.computeMoonPositionInEarthInertialFrame(n,W0t);J.multiplyByVector(q9,o,o),M.fromRotationTranslation(i,o,t.modelMatrix);let r=e.commandList;return e.commandList=K9,K9.length=0,t.update(e),e.commandList=r,K9.length===1?K9[0]:void 0};Qk.prototype.isDestroyed=function(){return!1};Qk.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),fe(this)};var kk=Qk;function Uk(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(Uk.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function j0t(e,t,n){let i=t.createViewportQuadCommand(ok,{framebuffer:n,renderState:Ve.fromCache({viewport:new et(0,0,256,256)})});e._drawCommand=i}Uk.prototype.update=function(e){if(!l(this._colorTexture)){let t=e.context,n=new Dt({context:t,width:256,height:256,pixelFormat:qe.RGBA,pixelDatatype:He.UNSIGNED_BYTE,sampler:jt.NEAREST});this._colorTexture=n;let i=new la({context:t,colorTextures:[n],destroyAttachments:!1});j0t(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};Uk.prototype.isDestroyed=function(){return!1};Uk.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),fe(this)};var zk=Uk;var mSe={};function Y0t(e,t,n){let i,o,r;if(e instanceof Vi){let a=Math.tan(.5*e.fovy);return i=e.near,o=e.near*a,r=e.aspectRatio*o,Math.max(t*i/r,n*i/o)}else if(e instanceof lu)return i=e.near,o=e.top,r=e.right,Math.max(t*i/r,n*i/o);return Math.max(t,n)}var q0t=new d,fSe=new d;function pSe(e,t,n,i){if(l(i)&&n(.5)>i){let o=n(0),r=n(1),a=n(.5),s=a-o,c=a-r;return function(u){let f=n(u);if(u<=.5){let p=(f-o)/s;return D.lerp(e,-D.PI_OVER_TWO,p)}let h=(f-r)/c;return D.lerp(-D.PI_OVER_TWO,t,1-h)}}return function(o){return D.lerp(e,t,o)}}function qee(e,t,n,i,o){let r=o,a=Math.max(n,i);if(!l(r)){let s=e.position,c=t,u=e.up,f=e.right,h=e.frustum,p=d.subtract(s,c,q0t),A=d.magnitude(d.multiplyByScalar(u,d.dot(p,u),fSe)),m=d.magnitude(d.multiplyByScalar(f,d.dot(p,f),fSe));r=Math.min(Y0t(h,A,m)*.2,1e9)}if(a<r){let u=-Math.pow((r-n)*1e6,.125),f=Math.pow((r-i)*1e6,1/8);return function(h){let p=h*(f-u)+u;return-Math.pow(p,8)/1e6+r}}return function(s){return D.lerp(n,i,s)}}function Gk(e,t){return D.equalsEpsilon(e,D.TWO_PI,D.EPSILON11)&&(e=0),t>e+Math.PI?e+=D.TWO_PI:t<e-Math.PI&&(e-=D.TWO_PI),e}var ASe=new d;function K0t(e,t,n,i,o,r,a,s){let c=e.camera,u=d.clone(c.position,ASe),f=c.pitch,h=Gk(c.heading,i),p=Gk(c.roll,r),A=qee(c,n,u.z,n.z,a),m=pSe(f,o,A,s);function _(y){let C=y.time/t;c.setView({orientation:{heading:D.lerp(h,i,C),pitch:m(C),roll:D.lerp(p,r,C)}}),k.lerp(u,n,C,c.position),c.position.z=A(C)}return _}function X0t(e,t){e.longitude<t.longitude?e.longitude+=D.TWO_PI:t.longitude+=D.TWO_PI}function J0t(e,t){let n=e.longitude-t.longitude;n<-D.PI?e.longitude+=D.TWO_PI:n>D.PI&&(t.longitude+=D.TWO_PI)}var Z0t=new me,$0t=new me;function ebt(e,t,n,i,o,r,a,s,c,u){let f=e.camera,p=e.mapProjection.ellipsoid,A=me.clone(f.positionCartographic,Z0t),m=f.pitch,_=Gk(f.heading,i),y=Gk(f.roll,r),C=p.cartesianToCartographic(n,$0t);A.longitude=D.zeroToTwoPi(A.longitude),C.longitude=D.zeroToTwoPi(C.longitude);let E=!1;if(l(s)){let B=D.zeroToTwoPi(s),v=Math.min(A.longitude,C.longitude),P=Math.max(A.longitude,C.longitude),N=B>=v&&B<=P;if(l(c)){let L=Math.abs(A.longitude-C.longitude),g=D.TWO_PI-L;(N?L:g)<(N?g:L)*c&&!N&&(E=!0)}else N||(E=!0)}E?X0t(A,C):J0t(A,C);let b=qee(f,n,A.height,C.height,a),x=pSe(m,o,b,u);function S(){let B=A.longitude,v=C.longitude,P=A.latitude,N=C.latitude;return function(g){let I=g.time/t,T=d.fromRadians(D.lerp(B,v,I),D.lerp(P,N,I),b(I),p);f.setView({destination:T,orientation:{heading:D.lerp(_,i,I),pitch:x(I),roll:D.lerp(y,r,I)}})}}return S()}function tbt(e,t,n,i,o,r,a){let s=e.camera,c=d.clone(s.position,ASe),u=Gk(s.heading,i),f=s.frustum.right-s.frustum.left,h=qee(s,n,f,n.z,a);function p(A){let m=A.time/t;s.setView({orientation:{heading:D.lerp(u,i,m)}}),k.lerp(c,n,m,s.position);let _=h(m),y=s.frustum,C=y.top/y.right,E=(_-(y.right-y.left))*.5;y.right+=E,y.left-=E,y.top=C*y.right,y.bottom=-y.top}return p}var dSe=new me,nbt=new d;function Yee(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function hSe(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}mSe.createTween=function(e,t){t=t??V.EMPTY_OBJECT;let n=t.destination,i=e.mode;if(i===oe.MORPHING)return Yee();let o=t.convert??!0,r=e.mapProjection,a=r.ellipsoid,s=t.maximumHeight,c=t.flyOverLongitude,u=t.flyOverLongitudeWeight,f=t.pitchAdjustHeight,h=t.easingFunction;o&&i!==oe.SCENE3D&&(a.cartesianToCartographic(n,dSe),n=r.project(dSe,nbt));let p=e.camera,A=t.endTransform;l(A)&&p._setTransform(A);let m=t.duration;l(m)||(m=Math.ceil(d.distance(p.position,n)/1e6)+2,m=Math.min(m,3));let _=t.heading??0,y=t.pitch??-D.PI_OVER_TWO,C=t.roll??0,E=e.screenSpaceCameraController;E.enableInputs=!1;let b=hSe(E,t.complete),x=hSe(E,t.cancel),S=p.frustum,B=e.mode===oe.SCENE2D;if(B=B&&k.equalsEpsilon(p.position,n,D.EPSILON6),B=B&&D.equalsEpsilon(Math.max(S.right-S.left,S.top-S.bottom),n.z,D.EPSILON6),B=B||e.mode!==oe.SCENE2D&&d.equalsEpsilon(n,p.position,D.EPSILON10),B=B&&D.equalsEpsilon(D.negativePiToPi(_),D.negativePiToPi(p.heading),D.EPSILON10)&&D.equalsEpsilon(D.negativePiToPi(y),D.negativePiToPi(p.pitch),D.EPSILON10)&&D.equalsEpsilon(D.negativePiToPi(C),D.negativePiToPi(p.roll),D.EPSILON10),B)return Yee(b,x);let v=new Array(4);if(v[oe.SCENE2D]=tbt,v[oe.SCENE3D]=ebt,v[oe.COLUMBUS_VIEW]=K0t,m<=0)return Yee(function(){v[i](e,1,n,_,y,C,s,c,u,f)({time:1}),typeof b=="function"&&b()},x);let P=v[i](e,m,n,_,y,C,s,c,u,f);if(!l(h)){let N=p.positionCartographic.height,L=i===oe.SCENE3D?a.cartesianToCartographic(n).height:n.z;N>L&&N>11500?h=Ta.CUBIC_OUT:h=Ta.QUINTIC_IN_OUT}return{duration:m,easingFunction:h,startObject:{time:0},stopObject:{time:m},update:P,complete:b,cancel:x}};var Vk=mSe;var ibt={ROTATE:0,INFINITE_SCROLL:1},uu=Object.freeze(ibt);function un(e){this._scene=e,this._transform=M.clone(M.IDENTITY),this._invTransform=M.clone(M.IDENTITY),this._actualTransform=M.clone(M.IDENTITY),this._actualInvTransform=M.clone(M.IDENTITY),this._transformChanged=!1,this.position=new d,this._position=new d,this._positionWC=new d,this._positionCartographic=new me,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new d,this._direction=new d,this._directionWC=new d,this.up=new d,this._up=new d,this._upWC=new d,this.right=new d,this._right=new d,this._rightWC=new d,this.frustum=new Vi,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=D.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 _e,this._moveEnd=new _e,this._changed=new _e,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 M,this._invViewMatrix=new M,xSe(this),this._mode=oe.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new me(Math.PI,D.PI_OVER_TWO)),this._max2Dfrustum=void 0,OSe(this,un.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=d.magnitude(this.position);n+=n*un.DEFAULT_VIEW_FACTOR,d.normalize(this.position,this.position),d.multiplyByScalar(this.position,n,this.position)}un.TRANSFORM_2D=new M(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);un.TRANSFORM_2D_INVERSE=M.inverseTransformation(un.TRANSFORM_2D,new M);un.DEFAULT_VIEW_RECTANGLE=ce.fromDegrees(-95,-20,-70,90);un.DEFAULT_VIEW_FACTOR=.5;un.DEFAULT_OFFSET=new th(0,-D.PI_OVER_FOUR,0);function xSe(e){M.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),M.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),M.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function obt(e){if(!l(e._oldPositionWC))e._oldPositionWC=d.clone(e.positionWC,e._oldPositionWC);else{e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=d.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=d.magnitude(t),e._oldPositionWC=d.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=Fi()):e.timeSinceMoved=Math.max(Fi()-e._lastMovedTimestamp,0)/1e3}}un.prototype.canPreloadFlight=function(){return l(this._currentFlight)&&this._mode!==oe.SCENE2D};un.prototype._updateCameraChanged=function(){let e=this;if(obt(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)%D.TWO_PI;i=i>D.PI?D.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 a=Math.abs(e._changedRoll-r)%D.TWO_PI;a=a>D.PI?D.TWO_PI-a:a;let s=a/Math.PI;if(s>t&&(e._changedRoll=r),(s>t||o>t)&&e._changed.raiseEvent(Math.max(s,o)),e._mode===oe.SCENE2D){if(!l(e._changedFrustum)){e._changedPosition=d.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let p=e.position,A=e._changedPosition,m=e.frustum,_=e._changedFrustum,y=p.x+m.left,C=p.x+m.right,E=A.x+_.left,b=A.x+_.right,x=p.y+m.bottom,S=p.y+m.top,B=A.y+_.bottom,v=A.y+_.top,P=Math.max(y,E),N=Math.min(C,b),L=Math.max(x,B),g=Math.min(S,v),I;if(P>=N||L>=S)I=1;else{let T=_;y<E&&C>b&&x<B&&S>v&&(T=m),I=1-(N-P)*(g-L)/((T.right-T.left)*(T.top-T.bottom))}I>t&&(e._changed.raiseEvent(I),e._changedPosition=d.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!l(e._changedDirection)){e._changedPosition=d.clone(e.positionWC,e._changedPosition),e._changedDirection=d.clone(e.directionWC,e._changedDirection);return}let c=D.acosClamped(d.dot(e.directionWC,e._changedDirection)),u;l(e.frustum.fovy)?u=c/(e.frustum.fovy*.5):u=c;let h=d.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(u>t||h>t)&&(e._changed.raiseEvent(Math.max(u,h)),e._changedPosition=d.clone(e.positionWC,e._changedPosition),e._changedDirection=d.clone(e.directionWC,e._changedDirection))};function rbt(e){At.basisTo2D(e._projection,e._transform,e._actualTransform)}var abt=new me,sbt=new d,X9=new d,cbt=new ie,lbt=new ie,ubt=new ie,fbt=new ie,dbt=new ie;function hbt(e){let t=e._projection,n=t.ellipsoid,i=M.getColumn(e._transform,3,cbt),o=n.cartesianToCartographic(i,abt),r=t.project(o,sbt),a=lbt;a.x=r.z,a.y=r.x,a.z=r.y,a.w=1;let s=ie.clone(ie.UNIT_X,dbt),c=ie.add(M.getColumn(e._transform,0,X9),i,X9);n.cartesianToCartographic(c,o),t.project(o,r);let u=ubt;u.x=r.z,u.y=r.x,u.z=r.y,u.w=0,d.subtract(u,a,u),u.x=0;let f=fbt;if(d.magnitudeSquared(u)>D.EPSILON10)d.cross(s,u,f);else{let h=ie.add(M.getColumn(e._transform,1,X9),i,X9);n.cartesianToCartographic(h,o),t.project(o,r),f.x=r.z,f.y=r.x,f.z=r.y,f.w=0,d.subtract(f,a,f),f.x=0,d.magnitudeSquared(f)<D.EPSILON10&&(ie.clone(ie.UNIT_Y,u),ie.clone(ie.UNIT_Z,f))}d.cross(f,s,u),d.normalize(u,u),d.cross(s,u,f),d.normalize(f,f),M.setColumn(e._actualTransform,0,u,e._actualTransform),M.setColumn(e._actualTransform,1,f,e._actualTransform),M.setColumn(e._actualTransform,2,s,e._actualTransform),M.setColumn(e._actualTransform,3,a,e._actualTransform)}var Kee=new d;function Al(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=!d.equals(o,e.position)||n;r&&(o=d.clone(e.position,e._position));let a=e._direction,s=!d.equals(a,e.direction);s&&(d.normalize(e.direction,e.direction),a=d.clone(e.direction,e._direction));let c=e._up,u=!d.equals(c,e.up);u&&(d.normalize(e.up,e.up),c=d.clone(e.up,e._up));let f=e._right,h=!d.equals(f,e.right);h&&(d.normalize(e.right,e.right),f=d.clone(e.right,e._right));let p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(M.inverseTransformation(e._transform,e._invTransform),e._mode===oe.COLUMBUS_VIEW||e._mode===oe.SCENE2D?M.equals(M.IDENTITY,e._transform)?M.clone(un.TRANSFORM_2D,e._actualTransform):e._mode===oe.COLUMBUS_VIEW?rbt(e):hbt(e):M.clone(e._transform,e._actualTransform),M.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let A=e._actualTransform;if(r||p)if(e._positionWC=M.multiplyByPoint(A,o,e._positionWC),t===oe.SCENE3D||t===oe.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let m=Kee;m.x=e._positionWC.y,m.y=e._positionWC.z,m.z=e._positionWC.x,t===oe.SCENE2D&&(m.z=i),e._projection.unproject(m,e._positionCartographic)}if(s||u||h){let m=d.dot(a,d.cross(c,f,Kee));if(Math.abs(1-m)>D.EPSILON2){let _=1/d.magnitudeSquared(c),y=d.dot(c,a)*_,C=d.multiplyByScalar(a,y,Kee);c=d.normalize(d.subtract(c,C,e._up),e._up),d.clone(c,e.up),f=d.cross(a,c,e._right),d.clone(f,e.right)}}(s||p)&&(e._directionWC=M.multiplyByPointAsVector(A,a,e._directionWC),d.normalize(e._directionWC,e._directionWC)),(u||p)&&(e._upWC=M.multiplyByPointAsVector(A,c,e._upWC),d.normalize(e._upWC,e._upWC)),(h||p)&&(e._rightWC=M.multiplyByPointAsVector(A,f,e._rightWC),d.normalize(e._rightWC,e._rightWC)),(r||s||u||h||p)&&xSe(e)}function TSe(e,t){let n;return D.equalsEpsilon(Math.abs(e.z),1,D.EPSILON3)?n=Math.atan2(t.y,t.x)-D.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-D.PI_OVER_TWO,D.TWO_PI-D.zeroToTwoPi(n)}function SSe(e){return D.PI_OVER_TWO-D.acosClamped(e.z)}function wSe(e,t,n){let i=0;return D.equalsEpsilon(Math.abs(e.z),1,D.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=D.zeroToTwoPi(i+D.TWO_PI)),i}var $9=new M,e5=new M;Object.defineProperties(un.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return Al(this),this._invTransform}},viewMatrix:{get:function(){return Al(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return Al(this),this._invViewMatrix}},positionCartographic:{get:function(){return Al(this),this._positionCartographic}},positionWC:{get:function(){return Al(this),this._positionWC}},directionWC:{get:function(){return Al(this),this._directionWC}},upWC:{get:function(){return Al(this),this._upWC}},rightWC:{get:function(){return Al(this),this._rightWC}},heading:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=M.clone(this._transform,$9),n=At.eastNorthUpToFixedFrame(this.positionWC,e,e5);this._setTransform(n);let i=TSe(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=M.clone(this._transform,$9),n=At.eastNorthUpToFixedFrame(this.positionWC,e,e5);this._setTransform(n);let i=SSe(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=M.clone(this._transform,$9),n=At.eastNorthUpToFixedFrame(this.positionWC,e,e5);this._setTransform(n);let i=wSe(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}}});un.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&&PSe(this,this.position)};var mbt=new d,pbt=new d,Abt=new d;un.prototype._setTransform=function(e){let t=d.clone(this.positionWC,mbt),n=d.clone(this.upWC,pbt),i=d.clone(this.directionWC,Abt);M.clone(e,this._transform),this._transformChanged=!0,Al(this);let o=this._actualInvTransform;M.multiplyByPoint(o,t,this.position),M.multiplyByPointAsVector(o,i,this.direction),M.multiplyByPointAsVector(o,n,this.up),d.cross(this.direction,this.up,this.right),Al(this)};var gbt=new k,_bt=new yn,ybt=new d,Cbt=new d;function BSe(e){if(!M.equals(M.IDENTITY,e.transform))return d.magnitude(e.position);let t=e._scene,n=t.globe,i=gbt;i.x=t.drawingBufferWidth/t.pixelRatio/2,i.y=t.drawingBufferHeight/t.pixelRatio/2;let o;if(l(n)){let s=e.getPickRay(i,_bt);o=n.pickWorldCoordinates(s,t,!0,ybt)}let r;t.pickPositionSupported&&(r=t.pickPositionWorldCoordinates(i,Cbt));let a;if(l(o)||l(r)){let s=l(r)?d.distance(r,e.positionWC):Number.POSITIVE_INFINITY,c=l(o)?d.distance(o,e.positionWC):Number.POSITIVE_INFINITY;a=Math.min(s,c)}else a=Math.max(e.positionCartographic.height,0);return a}un.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof An&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=BSe(this)))};var t5=new d,ete=new M,Ebt=new M,tte=new Qe,nte=new J,DSe=new me;function bbt(e,t,n){let i=M.clone(e.transform,ete),o=At.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,Ebt);e._setTransform(o),d.clone(d.ZERO,e.position),n.heading=n.heading-D.PI_OVER_TWO;let r=Qe.fromHeadingPitchRoll(n,tte),a=J.fromQuaternion(r,nte);J.getColumn(a,0,e.direction),J.getColumn(a,2,e.up),d.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function Ibt(e,t,n,i){let o=M.clone(e.transform,ete);if(e._setTransform(M.IDENTITY),!d.equals(t,e.positionWC)){if(i){let s=e._projection,c=s.ellipsoid.cartesianToCartographic(t,DSe);t=s.project(c,t5)}d.clone(t,e.position)}n.heading=n.heading-D.PI_OVER_TWO;let r=Qe.fromHeadingPitchRoll(n,tte),a=J.fromQuaternion(r,nte);J.getColumn(a,0,e.direction),J.getColumn(a,2,e.up),d.cross(e.direction,e.up,e.right),e._setTransform(o),e._adjustOrthographicFrustum(!0)}function xbt(e,t,n,i){let o=M.clone(e.transform,ete);if(e._setTransform(M.IDENTITY),!d.equals(t,e.positionWC)){if(i){let c=e._projection,u=c.ellipsoid.cartesianToCartographic(t,DSe);t=c.project(u,t5)}k.clone(t,e.position);let r=-t.z*.5,a=-r,s=e.frustum;if(a>r){let c=s.top/s.right;s.right=a,s.left=r,s.top=s.right*c,s.bottom=-s.top}}if(e._scene.mapMode2D===uu.ROTATE){n.heading=n.heading-D.PI_OVER_TWO,n.pitch=-D.PI_OVER_TWO,n.roll=0;let r=Qe.fromHeadingPitchRoll(n,tte),a=J.fromQuaternion(r,nte);J.getColumn(a,2,e.up),d.cross(e.direction,e.up,e.right)}e._setTransform(o)}var Tbt=new d,Sbt=new d,wbt=new d;function vSe(e,t,n,i){let o=d.clone(n.direction,Tbt),r=d.clone(n.up,Sbt);if(e._scene.mode===oe.SCENE3D){let s=e._projection.ellipsoid,c=At.eastNorthUpToFixedFrame(t,s,$9),u=M.inverseTransformation(c,e5);M.multiplyByPointAsVector(u,o,o),M.multiplyByPointAsVector(u,r,r)}let a=d.cross(o,r,wbt);return i.heading=TSe(o,r),i.pitch=SSe(o),i.roll=wSe(o,r,a),i}var $ee={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},cB=new Ec;un.prototype.setView=function(e){e=e??V.EMPTY_OBJECT;let t=e.orientation??V.EMPTY_OBJECT,n=this._mode;if(n===oe.MORPHING)return;l(e.endTransform)&&this._setTransform(e.endTransform);let i=e.convert??!0,o=e.destination??d.clone(this.positionWC,t5);l(o)&&l(o.west)&&(o=this.getRectangleCameraCoordinates(o,t5),i=!1),l(t.direction)&&(t=vSe(this,o,t,$ee.orientation)),cB.heading=t.heading??0,cB.pitch=t.pitch??-D.PI_OVER_TWO,cB.roll=t.roll??0,n===oe.SCENE3D?bbt(this,o,cB):n===oe.SCENE2D?xbt(this,o,cB,i):Ibt(this,o,cB,i)};var Bbt=new d;un.prototype.flyHome=function(e){let t=this._mode;if(t===oe.MORPHING&&this._scene.completeMorph(),t===oe.SCENE2D)this.flyTo({destination:un.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:M.IDENTITY});else if(t===oe.SCENE3D){let n=this.getRectangleCameraCoordinates(un.DEFAULT_VIEW_RECTANGLE),i=d.magnitude(n);i+=i*un.DEFAULT_VIEW_FACTOR,d.normalize(n,n),d.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:M.IDENTITY})}else if(t===oe.COLUMBUS_VIEW){let n=this._projection.ellipsoid.maximumRadius,i=new d(0,-1,1);i=d.multiplyByScalar(d.normalize(i,i),5*n,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(d.normalize(i,Bbt).z),roll:0},endTransform:M.IDENTITY,convert:!1})}};un.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new ie),Al(this),M.multiplyByVector(this._actualInvTransform,e,t)};un.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new d),Al(this),M.multiplyByPoint(this._actualInvTransform,e,t)};un.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new d),Al(this),M.multiplyByPointAsVector(this._actualInvTransform,e,t)};un.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new ie),Al(this),M.multiplyByVector(this._actualTransform,e,t)};un.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new d),Al(this),M.multiplyByPoint(this._actualTransform,e,t)};un.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new d),Al(this),M.multiplyByPointAsVector(this._actualTransform,e,t)};function PSe(e,t){let n=e._scene.mapMode2D===uu.ROTATE,i=e._maxCoord.x,o=e._maxCoord.y,r,a;n?(a=i,r=-a):(a=t.x-i*2,r=t.x+i*2),t.x>i&&(t.x=a),t.x<-i&&(t.x=r),t.y>o&&(t.y=o),t.y<-o&&(t.y=-o)}var gSe=new d;un.prototype.move=function(e,t){let n=this.position;d.multiplyByScalar(e,t,gSe),d.add(n,gSe,n),this._mode===oe.SCENE2D&&PSe(this,n),this._adjustOrthographicFrustum(!0)};un.prototype.moveForward=function(e){e=e??this.defaultMoveAmount,this._mode===oe.SCENE2D?n5(this,e):this.move(this.direction,e)};un.prototype.moveBackward=function(e){e=e??this.defaultMoveAmount,this._mode===oe.SCENE2D?n5(this,-e):this.move(this.direction,-e)};un.prototype.moveUp=function(e){e=e??this.defaultMoveAmount,this.move(this.up,e)};un.prototype.moveDown=function(e){e=e??this.defaultMoveAmount,this.move(this.up,-e)};un.prototype.moveRight=function(e){e=e??this.defaultMoveAmount,this.move(this.right,e)};un.prototype.moveLeft=function(e){e=e??this.defaultMoveAmount,this.move(this.right,-e)};un.prototype.lookLeft=function(e){e=e??this.defaultLookAmount,this._mode!==oe.SCENE2D&&this.look(this.up,-e)};un.prototype.lookRight=function(e){e=e??this.defaultLookAmount,this._mode!==oe.SCENE2D&&this.look(this.up,e)};un.prototype.lookUp=function(e){e=e??this.defaultLookAmount,this._mode!==oe.SCENE2D&&this.look(this.right,-e)};un.prototype.lookDown=function(e){e=e??this.defaultLookAmount,this._mode!==oe.SCENE2D&&this.look(this.right,e)};var Dbt=new Qe,vbt=new J;un.prototype.look=function(e,t){let n=t??this.defaultLookAmount,i=Qe.fromAxisAngle(e,-n,Dbt),o=J.fromQuaternion(i,vbt),r=this.direction,a=this.up,s=this.right;J.multiplyByVector(o,r,r),J.multiplyByVector(o,a,a),J.multiplyByVector(o,s,s)};un.prototype.twistLeft=function(e){e=e??this.defaultLookAmount,this.look(this.direction,e)};un.prototype.twistRight=function(e){e=e??this.defaultLookAmount,this.look(this.direction,-e)};var Pbt=new Qe,Rbt=new J;un.prototype.rotate=function(e,t){let n=t??this.defaultRotateAmount,i=Qe.fromAxisAngle(e,-n,Pbt),o=J.fromQuaternion(i,Rbt);J.multiplyByVector(o,this.position,this.position),J.multiplyByVector(o,this.direction,this.direction),J.multiplyByVector(o,this.up,this.up),d.cross(this.direction,this.up,this.right),d.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};un.prototype.rotateDown=function(e){e=e??this.defaultRotateAmount,RSe(this,e)};un.prototype.rotateUp=function(e){e=e??this.defaultRotateAmount,RSe(this,-e)};var Mbt=new d,Nbt=new d,Lbt=new d,_Se=new d;function RSe(e,t){let n=e.position;if(l(e.constrainedAxis)&&!d.equalsEpsilon(e.position,d.ZERO,D.EPSILON2)){let i=d.normalize(n,Mbt),o=d.equalsEpsilon(i,e.constrainedAxis,D.EPSILON2),r=d.equalsEpsilon(i,d.negate(e.constrainedAxis,_Se),D.EPSILON2);if(!o&&!r){let a=d.normalize(e.constrainedAxis,Nbt),s=d.dot(i,a),c=D.acosClamped(s);t>0&&t>c&&(t=c-D.EPSILON4),s=d.dot(i,d.negate(a,_Se)),c=D.acosClamped(s),t<0&&-t>c&&(t=-c+D.EPSILON4);let u=d.cross(a,i,Lbt);e.rotate(u,t)}else(o&&t<0||r&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}un.prototype.rotateRight=function(e){e=e??this.defaultRotateAmount,MSe(this,-e)};un.prototype.rotateLeft=function(e){e=e??this.defaultRotateAmount,MSe(this,e)};function MSe(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function n5(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,a=e._maxCoord.y;e._scene.mapMode2D===uu.ROTATE&&(a*=e.maximumZoomFactor),r>a&&(r=a,o=-a),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,a=e._maxCoord.x;e._scene.mapMode2D===uu.ROTATE&&(a*=e.maximumZoomFactor),o>a&&(o=a,r=-a),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 NSe(e,t){e.move(e.direction,t)}un.prototype.zoomIn=function(e){e=e??this.defaultZoomAmount,this._mode===oe.SCENE2D?n5(this,e):NSe(this,e)};un.prototype.zoomOut=function(e){e=e??this.defaultZoomAmount,this._mode===oe.SCENE2D?n5(this,-e):NSe(this,-e)};un.prototype.getMagnitude=function(){if(this._mode===oe.SCENE3D)return d.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 Obt=new M;un.prototype.lookAt=function(e,t){let i=this._scene.ellipsoid??te.default,o=At.eastNorthUpToFixedFrame(e,i,Obt);this.lookAtTransform(o,t)};var Fbt=new d,Qbt=new Qe,kbt=new Qe,Ubt=new J;function LSe(e,t,n){t=D.clamp(t,-D.PI_OVER_TWO,D.PI_OVER_TWO),e=D.zeroToTwoPi(e)-D.PI_OVER_TWO;let i=Qe.fromAxisAngle(d.UNIT_Y,-t,Qbt),o=Qe.fromAxisAngle(d.UNIT_Z,-e,kbt),r=Qe.multiply(o,i,o),a=J.fromQuaternion(r,Ubt),s=d.clone(d.UNIT_X,Fbt);return J.multiplyByVector(a,s,s),d.negate(s,s),d.multiplyByScalar(s,n,s),s}un.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),!l(t))return;let n;if(l(t.heading)?n=LSe(t.heading,t.pitch,t.range):n=t,this._mode===oe.SCENE2D){k.clone(k.ZERO,this.position),d.negate(n,this.up),this.up.z=0,d.magnitudeSquared(this.up)<D.EPSILON10&&d.clone(d.UNIT_Y,this.up),d.normalize(this.up,this.up),this._setTransform(M.IDENTITY),d.negate(d.UNIT_Z,this.direction),d.cross(this.direction,this.up,this.right),d.normalize(this.right,this.right);let i=this.frustum,o=i.top/i.right;i.right=d.magnitude(n)*.5,i.left=-i.right,i.top=o*i.right,i.bottom=-i.top,this._setTransform(e);return}d.clone(n,this.position),d.negate(this.position,this.direction),d.normalize(this.direction,this.direction),d.cross(this.direction,d.UNIT_Z,this.right),d.magnitudeSquared(this.right)<D.EPSILON10&&d.clone(d.UNIT_X,this.right),d.normalize(this.right,this.right),d.cross(this.right,this.direction,this.up),d.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)};var Hk=new me,zbt=new me,Gbt=new d,Vbt=new d,Hbt=new d,Wbt=new d,jbt=new d,Ybt=new d,qbt=new d,Xee=new d,Kbt={direction:new d,right:new d,up:new d},ySe;function pl(e,t,n,i){return Math.abs(d.dot(t,n))/i-d.dot(e,n)}function OSe(e,t,n,i){let o=e._projection.ellipsoid,r=i?e:Kbt,{north:a,south:s,west:c}=t,{east:u}=t;c>u&&(u+=D.TWO_PI);let f=(c+u)*.5,h;if(s<-D.PI_OVER_TWO+D.RADIANS_PER_DEGREE&&a>D.PI_OVER_TWO-D.RADIANS_PER_DEGREE)h=0;else{let N=Hk;N.longitude=f,N.latitude=a,N.height=0;let L=zbt;L.longitude=f,L.latitude=s,L.height=0;let g=ySe;(!l(g)||g.ellipsoid!==o)&&(ySe=g=new zA(void 0,void 0,o)),g.setEndPoints(N,L),h=g.interpolateUsingFraction(.5,Hk).latitude}let p=Hk;p.longitude=f,p.latitude=h,p.height=0;let A=o.cartographicToCartesian(p,qbt),m=Hk;m.longitude=u,m.latitude=a;let _=o.cartographicToCartesian(m,Gbt);m.longitude=c;let y=o.cartographicToCartesian(m,Hbt);m.longitude=f;let C=o.cartographicToCartesian(m,jbt);m.latitude=s;let E=o.cartographicToCartesian(m,Ybt);m.longitude=u;let b=o.cartographicToCartesian(m,Wbt);m.longitude=c;let x=o.cartographicToCartesian(m,Vbt);d.subtract(y,A,y),d.subtract(b,A,b),d.subtract(_,A,_),d.subtract(x,A,x),d.subtract(C,A,C),d.subtract(E,A,E);let S=o.geodeticSurfaceNormal(A,r.direction);d.negate(S,S);let B=d.cross(S,d.UNIT_Z,r.right);d.normalize(B,B);let v=d.cross(B,S,r.up),P;if(e.frustum instanceof An){let N=Math.max(d.distance(_,y),d.distance(b,x)),L=Math.max(d.distance(_,b),d.distance(y,x)),g,I,T=e.frustum._offCenterFrustum,w=T.right/T.top,R=L*w;N>R?(g=N,I=g/w):(I=L,g=R),P=Math.max(g,I)}else{let N=Math.tan(e.frustum.fovy*.5),L=e.frustum.aspectRatio*N;if(P=Math.max(pl(S,v,y,N),pl(S,v,b,N),pl(S,v,_,N),pl(S,v,x,N),pl(S,v,C,N),pl(S,v,E,N),pl(S,B,y,L),pl(S,B,b,L),pl(S,B,_,L),pl(S,B,x,L),pl(S,B,C,L),pl(S,B,E,L)),s<0&&a>0){let g=Hk;g.longitude=c,g.latitude=0,g.height=0;let I=o.cartographicToCartesian(g,Xee);d.subtract(I,A,I),P=Math.max(P,pl(S,v,I,N),pl(S,B,I,L)),g.longitude=u,I=o.cartographicToCartesian(g,Xee),d.subtract(I,A,I),P=Math.max(P,pl(S,v,I,N),pl(S,B,I,L))}}return d.add(A,d.multiplyByScalar(S,-P,Xee),n)}var Xbt=new me,Jbt=new d,Zbt=new d;function $bt(e,t,n){let i=e._projection;t.west>t.east&&(t=ce.MAX_VALUE);let o=e._actualTransform,r=e._actualInvTransform,a=Xbt;a.longitude=t.east,a.latitude=t.north;let s=i.project(a,Jbt);M.multiplyByPoint(o,s,s),M.multiplyByPoint(r,s,s),a.longitude=t.west,a.latitude=t.south;let c=i.project(a,Zbt);if(M.multiplyByPoint(o,c,c),M.multiplyByPoint(r,c,c),n.x=(s.x-c.x)*.5+c.x,n.y=(s.y-c.y)*.5+c.y,l(e.frustum.fovy)){let u=Math.tan(e.frustum.fovy*.5),f=e.frustum.aspectRatio*u;n.z=Math.max((s.x-c.x)/f,(s.y-c.y)/u)*.5}else{let u=s.x-c.x,f=s.y-c.y;n.z=Math.max(u,f)}return n}var eIt=new me,tIt=new d,nIt=new d;function iIt(e,t,n){let i=e._projection,o=t.east;t.west>t.east&&(e._scene.mapMode2D===uu.INFINITE_SCROLL?o+=D.TWO_PI:(t=ce.MAX_VALUE,o=t.east));let r=eIt;r.longitude=o,r.latitude=t.north;let a=i.project(r,tIt);r.longitude=t.west,r.latitude=t.south;let s=i.project(r,nIt),c=Math.abs(a.x-s.x)*.5,u=Math.abs(a.y-s.y)*.5,f,h,p=e.frustum.right/e.frustum.top,A=u*p;return c>A?(f=c,h=f/p):(h=u,f=A),u=Math.max(2*f,2*h),n.x=(a.x-s.x)*.5+s.x,n.y=(a.y-s.y)*.5+s.y,r=i.unproject(n,r),r.height=u,n=i.project(r,n),n}un.prototype.getRectangleCameraCoordinates=function(e,t){let n=this._mode;if(l(t)||(t=new d),n===oe.SCENE3D)return OSe(this,e,t);if(n===oe.COLUMBUS_VIEW)return $bt(this,e,t);if(n===oe.SCENE2D)return iIt(this,e,t)};var oIt=new yn;function rIt(e,t,n,i){n=n??te.default;let o=e.getPickRay(t,oIt),r=di.rayEllipsoid(o,n);if(!r)return;let a=r.start>0?r.start:r.stop;return yn.getPoint(o,a,i)}var aIt=new yn;function sIt(e,t,n,i){let r=e.getPickRay(t,aIt).origin;r=d.fromElements(r.y,r.z,0,r);let a=n.unproject(r);if(!(a.latitude<-D.PI_OVER_TWO||a.latitude>D.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(a,i)}var cIt=new yn;function lIt(e,t,n,i){let o=e.getPickRay(t,cIt),r=-o.origin.x/o.direction.x;yn.getPoint(o,r,i);let a=n.unproject(new d(i.y,i.z,0));if(!(a.latitude<-D.PI_OVER_TWO||a.latitude>D.PI_OVER_TWO||a.longitude<-Math.PI||a.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(a,i)}un.prototype.pickEllipsoid=function(e,t,n){let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(l(n)||(n=new d),t=t??te.default,this._mode===oe.SCENE3D)n=rIt(this,e,t,n);else if(this._mode===oe.SCENE2D)n=sIt(this,e,this._projection,n);else if(this._mode===oe.COLUMBUS_VIEW)n=lIt(this,e,this._projection,n);else return;return n}};var uIt=new d,fIt=new d,dIt=new d;function hIt(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,a=Math.tan(e.frustum.fovy*.5),s=e.frustum.aspectRatio*a,c=e.frustum.near,u=2/o*t.x-1,f=2/r*(r-t.y)-1,h=e.positionWC;d.clone(h,n.origin);let p=d.multiplyByScalar(e.directionWC,c,uIt);d.add(h,p,p);let A=d.multiplyByScalar(e.rightWC,u*c*s,fIt),m=d.multiplyByScalar(e.upWC,f*c*a,dIt),_=d.add(p,A,n.direction);return d.add(_,m,_),d.subtract(_,h,_),d.normalize(_,_),n}var J9=new d;function mIt(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,a=e.frustum,s=a.offCenterFrustum;l(s)&&(a=s);let c=2/o*t.x-1;c*=(a.right-a.left)*.5;let u=2/r*(r-t.y)-1;u*=(a.top-a.bottom)*.5;let f=n.origin;if(d.clone(e.positionWC,f),d.multiplyByScalar(e.rightWC,c,J9),d.add(J9,f,f),d.multiplyByScalar(e.upWC,u,J9),d.add(J9,f,f),d.clone(e.directionWC,n.direction),e._mode===oe.SCENE2D&&e._scene.mapMode2D===uu.INFINITE_SCROLL){let h=e._maxCoord.x;f.y=D.mod(f.y+h,2*h)-h}return n}un.prototype.getPickRay=function(e,t){l(t)||(t=new yn);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)?hIt(this,e,t):mIt(this,e,t)};var pIt=new d,AIt=new d;un.prototype.distanceToBoundingSphere=function(e){let t=d.subtract(this.positionWC,e.center,pIt),n=d.multiplyByScalar(this.directionWC,d.dot(t,this.directionWC),AIt);return Math.max(0,d.magnitude(n)-e.radius)};var gIt=new k;un.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),o=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,gIt);return Math.max(o.x,o.y)};function _It(e,t,n,i,o,r){let a=d.clone(t);n.y>i?a.y-=n.y-i:n.y<-i&&(a.y+=-i-n.y),n.z>o?a.z-=n.z-o:n.z<-o&&(a.z+=-o-n.z);function s(c){let u=d.lerp(t,a,c.time,new d);e.worldToCameraCoordinatesPoint(u,e.position)}return{easingFunction:Ta.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:r,update:s}}var yIt=new d,CSe=new d,CIt=new d,EIt=new d;function bIt(e,t){let n=e.position,i=e.direction,o=e.worldToCameraCoordinatesVector(d.UNIT_X,yIt),r=-d.dot(o,n)/d.dot(o,i),a=d.add(n,d.multiplyByScalar(i,r,CSe),CSe);e.cameraToWorldCoordinatesPoint(a,a),n=e.cameraToWorldCoordinatesPoint(e.position,CIt);let s=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*s,u=d.magnitude(d.subtract(n,a,EIt)),f=c*u,h=s*u,p=e._maxCoord.x,A=e._maxCoord.y,m=Math.max(f-p,p),_=Math.max(h-A,A);if(n.z<-m||n.z>m||n.y<-_||n.y>_){let y=a.y<-m||a.y>m,C=a.z<-_||a.z>_;if(y||C)return _It(e,n,a,m,_,t)}}un.prototype.createCorrectPositionTween=function(e){if(this._mode===oe.COLUMBUS_VIEW)return bIt(this,e)};var IIt=new d,Ks={destination:void 0,heading:void 0,pitch:void 0,roll:void 0,duration:void 0,complete:void 0,cancel:void 0,endTransform:void 0,maximumHeight:void 0,easingFunction:void 0};un.prototype.cancelFlight=function(){l(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};un.prototype.completeFlight=function(){if(l(this._currentFlight)){this._currentFlight.cancelTween();let e={destination:void 0,orientation:{heading:void 0,pitch:void 0,roll:void 0}};e.destination=Ks.destination,e.orientation.heading=Ks.heading,e.orientation.pitch=Ks.pitch,e.orientation.roll=Ks.roll,this.setView(e),l(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};un.prototype.flyTo=function(e){e=e??V.EMPTY_OBJECT;let t=e.destination;if(this._mode===oe.MORPHING)return;this.cancelFlight();let i=t instanceof ce;i&&(t=this.getRectangleCameraCoordinates(t,IIt));let o=e.orientation??V.EMPTY_OBJECT;if(l(o.direction)&&(o=vSe(this,t,o,$ee.orientation)),l(e.duration)&&e.duration<=0){let f=$ee;f.destination=e.destination,f.orientation.heading=o.heading,f.orientation.pitch=o.pitch,f.orientation.roll=o.roll,f.convert=e.convert,f.endTransform=e.endTransform,this.setView(f),typeof e.complete=="function"&&e.complete();return}let r=this,a;Ks.destination=t,Ks.heading=o.heading,Ks.pitch=o.pitch,Ks.roll=o.roll,Ks.duration=e.duration,Ks.complete=function(){a===r._currentFlight&&(r._currentFlight=void 0),l(e.complete)&&e.complete()},Ks.cancel=e.cancel,Ks.endTransform=e.endTransform,Ks.convert=i?!1:e.convert,Ks.maximumHeight=e.maximumHeight,Ks.pitchAdjustHeight=e.pitchAdjustHeight,Ks.flyOverLongitude=e.flyOverLongitude,Ks.flyOverLongitudeWeight=e.flyOverLongitudeWeight,Ks.easingFunction=e.easingFunction;let s=this._scene,c=Vk.createTween(s,Ks);if(c.duration===0){typeof c.complete=="function"&&c.complete();return}a=s.tweens.add(c),this._currentFlight=a;let u=this._scene.preloadFlightCamera;this._mode!==oe.SCENE2D&&(l(u)||(u=un.clone(this)),u.setView({destination:t,orientation:o}),this._scene.preloadFlightCullingVolume=u.frustum.computeCullingVolume(u.positionWC,u.directionWC,u.upWC))};function xIt(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),o=n.aspectRatio*i;return Math.max(t/o,t/i)}function TIt(e,t){let n=e.frustum,i=n.offCenterFrustum;l(i)&&(n=i);let o,r,a=n.right/n.top,s=t*a;return t>s?(o=t,r=o/a):(r=t,o=s),Math.max(o,r)*1.5}var SIt=100;function FSe(e,t,n){n=th.clone(l(n)?n:un.DEFAULT_OFFSET);let i=e._scene.screenSpaceCameraController.minimumZoomDistance,o=e._scene.screenSpaceCameraController.maximumZoomDistance,r=n.range;if(!l(r)||r===0){let a=t.radius;a===0?n.range=SIt:e.frustum instanceof An||e._mode===oe.SCENE2D?n.range=TIt(e,a):n.range=xIt(e,a),n.range=D.clamp(n.range,i,o)}return n}un.prototype.viewBoundingSphere=function(e,t){t=FSe(this,e,t),this.lookAt(e.center,t)};var wIt=new M,BIt=new d,DIt=new d,vIt=new d,PIt=new d,RIt=new ie,MIt=new Qe,NIt=new J;un.prototype.flyToBoundingSphere=function(e,t){t=t??V.EMPTY_OBJECT;let n=this._mode===oe.SCENE2D||this._mode===oe.COLUMBUS_VIEW;this._setTransform(M.IDENTITY);let i=FSe(this,e,t.offset),o;n?o=d.multiplyByScalar(d.UNIT_Z,i.range,BIt):o=LSe(i.heading,i.pitch,i.range);let a=this._scene.ellipsoid??te.default,s=At.eastNorthUpToFixedFrame(e.center,a,wIt);M.multiplyByPoint(s,o,o);let c,u;if(!n){if(c=d.subtract(e.center,o,DIt),d.normalize(c,c),u=M.multiplyByPointAsVector(s,d.UNIT_Z,vIt),1-Math.abs(d.dot(c,u))<D.EPSILON6){let h=Qe.fromAxisAngle(c,i.heading,MIt),p=J.fromQuaternion(h,NIt);d.fromCartesian4(M.getColumn(s,1,RIt),u),J.multiplyByVector(p,u,u)}let f=d.cross(c,u,PIt);d.cross(f,c,u),d.normalize(u,u)}this.flyTo({destination:o,orientation:{direction:c,up:u},duration:t.duration,complete:t.complete,cancel:t.cancel,endTransform:t.endTransform,maximumHeight:t.maximumHeight,easingFunction:t.easingFunction,flyOverLongitude:t.flyOverLongitude,flyOverLongitudeWeight:t.flyOverLongitudeWeight,pitchAdjustHeight:t.pitchAdjustHeight})};var ESe=new d,bSe=new d,Jee=new d,ISe=new d,Wk=[new d,new d,new d,new d];function LIt(e,t){let n=t.radii,i=e.positionWC,o=d.multiplyComponents(t.oneOverRadii,i,ESe),r=d.magnitude(o),a=d.normalize(o,bSe),s,c;d.equalsEpsilon(a,d.UNIT_Z,D.EPSILON10)?(s=new d(0,1,0),c=new d(0,0,1)):(s=d.normalize(d.cross(d.UNIT_Z,a,Jee),Jee),c=d.normalize(d.cross(a,s,ISe),ISe));let u=Math.sqrt(d.magnitudeSquared(o)-1),f=d.multiplyByScalar(a,1/r,ESe),h=u/r,p=d.multiplyByScalar(s,h,bSe),A=d.multiplyByScalar(c,h,Jee),m=d.add(f,A,Wk[0]);d.subtract(m,p,m),d.multiplyComponents(n,m,m);let _=d.subtract(f,A,Wk[1]);d.subtract(_,p,_),d.multiplyComponents(n,_,_);let y=d.subtract(f,A,Wk[2]);d.add(y,p,y),d.multiplyComponents(n,y,y);let C=d.add(f,A,Wk[3]);return d.add(C,p,C),d.multiplyComponents(n,C,C),Wk}var Zee=new k,OIt=new d,KC=[new me,new me,new me,new me];function Z9(e,t,n,i,o,r){Zee.x=e,Zee.y=t;let a=i.pickEllipsoid(Zee,o,OIt);return l(a)?(KC[n]=o.cartesianToCartographic(a,KC[n]),1):(KC[n]=o.cartesianToCartographic(r[n],KC[n]),0)}un.prototype.computeViewRectangle=function(e,t){e=e??te.default;let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new le(d.ZERO,e.maximumRadius);if(n.computeVisibility(i)===Xt.OUTSIDE)return;let r=this._scene.canvas,a=r.clientWidth,s=r.clientHeight,c=0,u=LIt(this,e);if(c+=Z9(0,0,0,this,e,u),c+=Z9(0,s,1,this,e,u),c+=Z9(a,s,2,this,e,u),c+=Z9(a,0,3,this,e,u),c<2)return ce.MAX_VALUE;t=ce.fromCartographicArray(KC,t);let f=0,h=KC[3].longitude;for(let p=0;p<4;++p){let A=KC[p].longitude,m=Math.abs(A-h);m>D.PI?f+=D.TWO_PI-m:f+=m,h=A}return D.equalsEpsilon(Math.abs(f),D.TWO_PI,D.EPSILON9)&&(t.west=-D.PI,t.east=D.PI,KC[0].latitude>=0?t.north=D.PI_OVER_TWO:t.south=-D.PI_OVER_TWO),t};un.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=D.toRadians(60)};un.prototype.switchToOrthographicFrustum=function(){if(this._mode===oe.SCENE2D||this.frustum instanceof An)return;let e=BSe(this),t=this._scene;this.frustum=new An,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};un.clone=function(e,t){return l(t)||(t=new un(e._scene)),d.clone(e.position,t.position),d.clone(e.direction,t.direction),d.clone(e.up,t.up),d.clone(e.right,t.right),M.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var Bo=un;function FIt(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var lh=FIt;var GSe=Wr(rf(),1),QSe=576,QIt=100,jk="#ffffff",i5="#48b";function VSe(e,t){this.credit=e,this.count=t??1}function kIt(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i];if(Et.equals(o,t))return!0}return!1}function UIt(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;Et.equals(n,t)||(l(t)&&e._cesiumCreditContainer.removeChild(t.element),l(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var HSe="cesium-credit-delimiter";function kSe(e){let t=document.createElement("span");return t.textContent=e,t.className=HSe,t}function USe(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function zSe(e,t,n,i){let o=e.childNodes,r=-1;t.sort(function(a,s){return s.count-a.count});for(let a=0;a<t.length;++a){let s=t[a].credit;if(l(s)){if(r=a,l(n)&&(r*=2,a>0)){let u=r-1;if(o.length<=u)e.appendChild(kSe(n));else{let f=o[u];f.className!==HSe&&e.replaceChild(kSe(n),f)}}let c=s.element;if(o.length<=r)e.appendChild(USe(c,i));else{let u=o[r];u._creditId!==s._id&&e.replaceChild(USe(c,i),u)}}}for(++r;r<o.length;)e.removeChild(o[r])}function zIt(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<QSe?(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>=QSe&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function GIt(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: ${jk};
position: relative;
min-height: ${QIt}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: ${jk};
}
.cesium-credit-lightbox > ul > li a:hover {
color: ${i5};
}
.cesium-credit-lightbox.cesium-credit-lightbox-expanded {
border: 1px solid #444;
border-radius: 5px;
max-width: 470px;
}
.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: ${jk};
}
.cesium-credit-lightbox-close:hover {
color: ${i5};
}
.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: ${jk};
}
.cesium-credit-expand-link:hover {
color: ${i5};
}
.cesium-credit-text {
color: ${jk};
}
.cesium-credit-delimiter {
padding: 0 5px;
}
.cesium-credit-textContainer *,
.cesium-credit-logoContainer * {
display: inline;
}
.cesium-credit-textContainer a:hover {
color: ${i5}
}
.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 a=r.getRootNode();if(a instanceof ShadowRoot)return a}}let i=n(e)??document.head,o=document.createElement("style");o.innerHTML=t,i.appendChild(o)}function Hr(e,t,n){let i=this;n=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 a(m){r.contains(m.target)||i.hideLightbox()}o.addEventListener("click",a,!1);let s=document.createElement("div");s.className="cesium-credit-lightbox-title",s.textContent="Data provided by:",r.appendChild(s);let c=document.createElement("a");c.onclick=this.hideLightbox.bind(this),c.innerHTML="&times;",c.className="cesium-credit-lightbox-close",r.appendChild(c);let u=document.createElement("ul");r.appendChild(u);let f=document.createElement("div");f.className="cesium-credit-logoContainer",f.style.display="inline",e.appendChild(f);let h=document.createElement("div");h.className="cesium-credit-textContainer",h.style.display="inline",e.appendChild(h);let p=document.createElement("a");p.className="cesium-credit-expand-link",p.onclick=this.showLightbox.bind(this),p.textContent="Data attribution",e.appendChild(p),GIt(e);let A=Et.clone(Hr.cesiumCredit);this._delimiter=t??"\u2022",this._screenContainer=h,this._cesiumCreditContainer=f,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=r,this._creditList=u,this._lightbox=o,this._hideLightbox=a,this._expandLink=p,this._expanded=!1,this._staticCredits=[],this._cesiumCredit=A,this._previousCesiumCredit=void 0,this._currentCesiumCredit=A,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new Ot,lightboxCredits:new Ot},this._defaultCredit=void 0,this.viewport=n,this.container=e}function WSe(e,t,n,i){i=i??1;let o=t.get(n.id);if(l(o))o.count<Number.MAX_VALUE&&(o.count+=i);else{let r=e._creditDisplayElementPool,a=e._creditDisplayElementPoolIndex;a<r.length?(o=r[a],o.credit=n,o.count=i):(o=new VSe(n,i),r.push(o)),++e._creditDisplayElementPoolIndex,t.set(n.id,o)}}Hr.prototype.addCreditToNextFrame=function(e){if(e.isIon()){l(this._defaultCredit)||(this._defaultCredit=Et.clone(jSe())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,WSe(this,t,e)};Hr.prototype.addStaticCredit=function(e){let t=this._staticCredits;kIt(t,e)||t.push(e)};Hr.prototype.removeStaticCredit=function(e){let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};Hr.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0};Hr.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1};Hr.prototype.update=function(){this._expanded&&zIt(this)};Hr.prototype.beginFrame=function(){let e=this._currentFrameCredits;this._creditDisplayElementPoolIndex=0;let t=e.screenCredits,n=e.lightboxCredits;t.removeAll(),n.removeAll();let i=this._staticCredits;for(let o=0;o<i.length;++o){let r=i[o],a=r.showOnScreen?t:n;r.isIon()&&Et.equals(Hr.cesiumCredit,this._cesiumCredit)||WSe(this,a,r,Number.MAX_VALUE)}Et.equals(Hr.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=Et.clone(Hr.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};Hr.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;zSe(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",zSe(this._creditList,t,void 0,"li"),UIt(this)};Hr.prototype.destroy=function(){return this._lightbox.removeEventListener("click",this._hideLightbox,!1),this.container.removeChild(this._cesiumCreditContainer),this.container.removeChild(this._screenContainer),this.container.removeChild(this._expandLink),this.viewport.removeChild(this._lightbox),fe(this)};Hr.prototype.isDestroyed=function(){return!1};Hr._cesiumCredit=void 0;Hr._cesiumCreditInitialized=!1;var o5;function jSe(){if(!l(o5)){let e=Zt("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new GSe.default(e).path()),o5=new Et(`<a href="https://cesium.com/" target="_blank"><img src="${e}" style="vertical-align: -7px" title="Cesium ion"/></a>`,!0)}return Hr._cesiumCreditInitialized||(Hr._cesiumCredit=o5,Hr._cesiumCreditInitialized=!0),o5}Object.defineProperties(Hr,{cesiumCredit:{get:function(){return jSe(),Hr._cesiumCredit},set:function(e){Hr._cesiumCredit=e,Hr._cesiumCreditInitialized=!0}}});Hr.CreditDisplayElement=VSe;var Yk=Hr;function r5(e){e=e??V.EMPTY_OBJECT,this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=e.color??z.CYAN,this._updateOnChange=e.updateOnChange??!0,this.show=e.show??!0,this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var VIt=new d,HIt=new J,WIt=new Qe,jIt=new Vi,YIt=new lu,qIt=new An,KIt=new ua,XIt=new z,JIt=[1,1e5];r5.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,a=r.frustum,s;a instanceof Vi?s=jIt:a instanceof lu?s=YIt:a instanceof An?s=qIt:s=KIt,s=a.clone(s);let c,u=this._frustumSplits;!l(u)||u.length<=1?(u=JIt,u[0]=this._camera.frustum.near,u[1]=this._camera.frustum.far,c=1):c=u.length-1;let f=r.positionWC,h=r.directionWC,p=r.upWC,A=r.rightWC;A=d.negate(A,VIt);let m=HIt;J.setColumn(m,0,A,m),J.setColumn(m,1,p,m),J.setColumn(m,2,h,m);let _=Qe.fromRotationMatrix(m,WIt);for(t.length=n.length=c,i=0;i<c;++i)s.near=u[i],s.far=u[i+1],t[i]=new Nn({geometryInstances:new Mt({geometry:new uI({origin:f,orientation:_,frustum:s,_drawNearPlane:i===0}),attributes:{color:Jt.fromColor(z.fromAlpha(this._color,.1,XIt))},id:this.id,pickPrimitive:this}),appearance:new gn({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new Nn({geometryInstances:new Mt({geometry:new H2({origin:f,orientation:_,frustum:s,_drawNearPlane:i===0}),attributes:{color:Jt.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new gn({translucent:!1,flat:!0}),asynchronous:!1})}for(o=t.length,i=0;i<o;++i)n[i].update(e),t[i].update(e)};r5.prototype.isDestroyed=function(){return!1};r5.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 fe(this)};var aA=r5;function Kk(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=e??0}var qk=fn.supportsTypedArrays()?new Float32Array(12):[],YSe=new d,qSe=new d,ite=new d,KSe=new d,a5=new d;function ZIt(e,t){let n=e.radii,i=t.camera,o,r,a;if(i.frustum instanceof An)o=d.ZERO,r=i.rightWC,a=i.upWC;else{let h=i.positionWC,p=d.multiplyComponents(e.oneOverRadii,h,YSe),A=d.normalize(p,qSe),m=d.normalize(d.cross(d.UNIT_Z,p,ite),ite),_=d.normalize(d.cross(A,m,KSe),KSe),y=d.magnitude(p),C=Math.sqrt(y*y-1);o=d.multiplyByScalar(A,1/y,YSe);let E=C/y;r=d.multiplyByScalar(m,E,qSe),a=d.multiplyByScalar(_,E,ite)}let s=d.add(o,a,a5);d.subtract(s,r,s),d.multiplyComponents(n,s,s),d.pack(s,qk,0);let c=d.subtract(o,a,a5);d.subtract(c,r,c),d.multiplyComponents(n,c,c),d.pack(c,qk,3);let u=d.add(o,a,a5);d.add(u,r,u),d.multiplyComponents(n,u,u),d.pack(u,qk,6);let f=d.subtract(o,a,a5);return d.add(f,r,f),d.multiplyComponents(n,f,f),d.pack(f,qk,9),qk}Kk.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 te(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),o=e.useLogDepth;if(l(this._command)||(this._rs=Ve.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new nt({renderState:this._rs,boundingVolume:new le(d.ZERO,i.maximumRadius),pass:Be.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==o){this._useLogDepth=o;let a=new We({sources:[hk]}),s=new We({sources:[dk]});o&&(s.defines.push("LOG_DEPTH"),a.defines.push("LOG_DEPTH")),this._sp=$t.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:a,fragmentShaderSource:s,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let r=ZIt(i,e);if(l(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(r);else{let a=new yt({attributes:{position:new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:r})},indices:[0,1,2,2,1,3],primitiveType:ve.TRIANGLES});this._va=Gn.fromGeometry({context:t,geometry:a,attributeLocations:{position:0},bufferUsage:Re.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};Kk.prototype.execute=function(e,t){this._mode===oe.SCENE3D&&this._command.execute(e,t)};Kk.prototype.isDestroyed=function(){return!1};Kk.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var Xk=Kk;function uB(){}var $It=/\bgl_FragDepth\b/,ext=/\bdiscard\b/;function txt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(l(n))return n;let i=t.fragmentShaderSource,o=!1,r=i.sources;for(let s=0;s<r.length;++s)if($It.test(r[s])||ext.test(r[s])){o=!0;break}let a=i.defines.indexOf("LOG_DEPTH")>=0;if(!o&&!a){let s=`void main()
{
out_FragColor = vec4(1.0);
}
`;i=new We({sources:[s]})}else if(!o&&a){let s=`void main()
{
out_FragColor = vec4(1.0);
czm_writeLogDepth();
}
`;i=new We({defines:["LOG_DEPTH"],sources:[s]})}return e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}function nxt(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(l(i))return i;let o=Ve.getState(t);o.depthMask=!0,o.colorMask={red:!1,green:!1,blue:!1,alpha:!1};let r=Ve.fromCache(o);return n[t.id]=r,r}uB.createDepthOnlyDerivedCommand=function(e,t,n,i){l(i)||(i={});let o=i.depthOnlyCommand?.shaderProgram,r=i.depthOnlyCommand?.renderState;return i.depthOnlyCommand=nt.shallowClone(t,i.depthOnlyCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=txt(n,t.shaderProgram),i.depthOnlyCommand.renderState=nxt(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=o,i.depthOnlyCommand.renderState=r),i};var ixt=/\s+czm_writeLogDepth\(/,oxt=/\s+czm_vertexLogDepth\(/;function rxt(e,t){if(t.fragmentShaderSource.defines.indexOf("LOG_DEPTH_READ_ONLY")>=0)return t;let i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(l(i))return i;let o=t._attributeLocations,r=t.vertexShaderSource.clone(),a=t.fragmentShaderSource.clone();r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("LOG_DEPTH"),a.defines=l(a.defines)?a.defines.slice(0):[],a.defines.push("LOG_DEPTH");let s=!1,c=r.sources;for(let f=0;f<c.length;++f)if(oxt.test(c[f])){s=!0;break}if(!s){for(let h=0;h<c.length;++h)c[h]=We.replaceMain(c[h],"czm_log_depth_main");c.push(`
void main()
{
czm_log_depth_main();
czm_vertexLogDepth();
}
`)}c=a.sources,s=!1;for(let f=0;f<c.length;++f)ixt.test(c[f])&&(s=!0);a.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(s=!0);let u="";if(!s){for(let f=0;f<c.length;f++)c[f]=We.replaceMain(c[f],"czm_log_depth_main");u=`
void main()
{
czm_log_depth_main();
czm_writeLogDepth();
}
`}return c.push(u),e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:o})}uB.createLogDepthCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=nt.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=rxt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function axt(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(l(i))return i;Object.prototype.toString.call(n)==="[object Object]"&&(n.color?n=`vec4(${z.floatToByte(n.color.red)}, ${z.floatToByte(n.color.green)}, ${z.floatToByte(n.color.blue)}, ${z.floatToByte(n.color.alpha)})`:n="vec4(1.0)");let o=t._attributeLocations,{sources:r,defines:a}=t.fragmentShaderSource,c=r.some(A=>A.includes("out_FragData"))?"out_FragData_0":"out_FragColor",u=`void main ()
{
czm_non_pick_main();
if (${c}.a == 0.0) {
discard;
}
${c} = ${n};
} `,f=r.length,h=new Array(f+1);for(let A=0;A<f;++A)h[A]=We.replaceMain(r[A],"czm_non_pick_main");h[f]=u;let p=new We({sources:h,defines:a});return e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:o})}function XSe(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(l(i))return i;let o=Ve.getState(t);o.blending.enabled=!1,o.depthMask=!0;let r=Ve.fromCache(o);return n[t.id]=r,r}uB.createPickDerivedCommand=function(e,t,n,i){l(i)||(i={});let o=i.pickCommand?.shaderProgram,r=i.pickCommand?.renderState;return i.pickCommand=nt.shallowClone(t,i.pickCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=axt(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=XSe(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=o,i.pickCommand.renderState=r),i};function lB(e,t,n){let i=e.length;for(let o=0;o<i;o++)e[o].trimStart().split(/\s+/)[0]===t&&(e[o]=`${t} ${n}`)}function sxt(e){return e.isArray?e.arrayLength:bt.getComponentCount(e.type)}function JSe(e,t,n){return`((${e} - float(${t})) / float(${n}))`}function ZSe(e,t){let n=Ft.getMaximum(t);return`(${e}) / float(${n})`}function cxt(e,t){let n="float(value)";if(t.hasValueTransform){let i=t.offset,o=t.scale;n=JSe(n,i,o)}return e.normalized||(n=ZSe(n,e.componentType)),n}function lxt(e,t,n){let o=`float(${`value.${n}`})`;if(t.hasValueTransform){let r=t.offset[n],a=t.scale[n];o=JSe(o,r,a)}return e.normalized||(o=ZSe(o,e.componentType)),o}function uxt(e,t,n){let i=n.schemaId,o=n.className,r=n.propertyName,a=`pickMetadata-${i}-${o}-${r}`,s=e.shaderCache.getDerivedShaderProgram(t,a);if(l(s))return s;let c=n.metadataProperty,u=n.classProperty,f=u.getGlslType(),h=["0.0","0.0","0.0","0.0"],p=sxt(u);if(p===1)h[0]=cxt(u,c);else{let y=["x","y","z","w"];for(let C=0;C<p;C++)h[C]=lxt(u,c,y[C])}let A=t.fragmentShaderSource.defines.slice();A.push(If.METADATA_PICKING_ENABLED),lB(A,If.METADATA_PICKING_VALUE_TYPE,f),lB(A,If.METADATA_PICKING_VALUE_STRING,`metadata.${r}`),lB(A,If.METADATA_PICKING_VALUE_COMPONENT_X,h[0]),lB(A,If.METADATA_PICKING_VALUE_COMPONENT_Y,h[1]),lB(A,If.METADATA_PICKING_VALUE_COMPONENT_Z,h[2]),lB(A,If.METADATA_PICKING_VALUE_COMPONENT_W,h[3]);let m=new We({sources:t.fragmentShaderSource.sources,defines:A});return e.shaderCache.createDerivedShaderProgram(t,a,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:m,attributeLocations:t._attributeLocations})}uB.createPickMetadataDerivedCommand=function(e,t,n,i){return l(i)||(i={}),i.pickMetadataCommand=nt.shallowClone(t,i.pickMetadataCommand),i.pickMetadataCommand.shaderProgram=uxt(n,t.shaderProgram,t.pickedMetadataInfo),i.pickMetadataCommand.renderState=XSe(e,t.renderState),i.shaderProgramId=t.shaderProgram.id,i};function fxt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(l(n))return n;let i=t._attributeLocations,o=t.vertexShaderSource.clone(),r=t.fragmentShaderSource.clone();return 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"),e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:o,fragmentShaderSource:r,attributeLocations:i})}uB.createHdrCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=nt.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=fxt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var sA=uB;function s5(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=D.toRadians(o),t._beta=D.toRadians(i.beta),t._gamma=D.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var dxt=new Qe,$Se=new Qe,hxt=new J;function mxt(e,t,n,i){let o=e.direction,r=e.right,a=e.up,s=Qe.fromAxisAngle(o,n,$Se),c=Qe.fromAxisAngle(r,i,dxt),u=Qe.multiply(c,s,c),f=Qe.fromAxisAngle(a,t,$Se);Qe.multiply(f,u,u);let h=J.fromQuaternion(u,hxt);J.multiplyByVector(h,r,r),J.multiplyByVector(h,a,a),J.multiplyByVector(h,o,o)}s5.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;mxt(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};s5.prototype.isDestroyed=function(){return!1};s5.prototype.destroy=function(){return this._removeListener(),fe(this)};var Jk=s5;function ote(){this.enabled=!0,this.renderable=!0,this.density=6e-4,this.heightScalar=.001,this._heightFalloff=.59,this.maxHeight=8e5,this.visualDensityScalar=.15,this.screenSpaceErrorFactor=2,this.minimumBrightness=.03}Object.defineProperties(ote.prototype,{heightFalloff:{get:function(){return this._heightFalloff},set:function(e){this._heightFalloff=e}}});var pxt=new d;ote.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>this.maxHeight||e.mode!==oe.SCENE3D){e.fog.enabled=!1,e.fog.density=0;return}let o=i.height,r=this.density*this.heightScalar*Math.pow(Math.max(o/this.maxHeight,D.EPSILON4),-Math.max(this._heightFalloff,0)),a=d.normalize(n.positionWC,pxt),s=Math.abs(d.dot(n.directionWC,a));r*=1-s,e.fog.density=r,e.fog.visualDensityScalar=this.visualDensityScalar,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness};var Zk=ote;function Axt(e,t,n){this.context=e,this.commandList=[],this.panoramaCommandList=[],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,visualDensityScalar: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,this.pickingMetadata=!1,this.pickedMetadataInfo=void 0,this.edgeVisibilityRequested=!1}var $k=Axt;var Ac={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},CI=Ac.DERIVED_COMMANDS_MAXIMUM_LENGTH,lwe=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function EI(){this._frontFaceAlphaByDistance=new Ht(0,1,0,1),this._backFaceAlphaByDistance=new Ht(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=ce.clone(ce.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(CI),this._derivedBlendCommandTypes=new Array(CI),this._derivedPickCommandTypes=new Array(CI),this._derivedCommandTypesToUpdate=new Array(CI),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(EI.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}}});EI.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=ewe(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=ewe(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=twe(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=twe(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=Cxt(this,e,t),this._sunVisibleThroughGlobe=gxt(this,e),this._environmentVisible=_xt(this,e),this._useDepthPlane=yxt(this,e),this._numberOfTextureUniforms=Ext(this),this._rectangle=ce.clone(t.translucency.rectangle,this._rectangle),bxt(this,e)};function ewe(e,t,n,i){return e?l(n)?(Ht.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 twe(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function gxt(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function _xt(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function yxt(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function Cxt(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==oe.SCENE2D&&t.context.depthTexture}function Ext(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function bxt(e,t){e._derivedCommandsLength=rte(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=rte(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=rte(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<CI;++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=Fxt())}function rte(e,t,n,i,o){let r=0,a=e._frontFaceTranslucent,s=e._backFaceTranslucent;if(!a)return r;let c=t.cameraUnderground,u=e._requiresManualDepthTest,f=i?Ac.PICK_FRONT_FACE:u?Ac.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:Ac.TRANSLUCENT_FRONT_FACE,h=i?Ac.PICK_BACK_FACE:u?Ac.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:Ac.TRANSLUCENT_BACK_FACE;return t.mode===oe.SCENE2D?(o[r++]=Ac.DEPTH_ONLY_FRONT_FACE,o[r++]=f,r):(s?(n||(o[r++]=Ac.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(o[r++]=f,o[r++]=h):(o[r++]=h,o[r++]=f)):c?(n||(o[r++]=Ac.DEPTH_ONLY_BACK_FACE),o[r++]=Ac.OPAQUE_FRONT_FACE,o[r++]=h):(n||(o[r++]=Ac.DEPTH_ONLY_FRONT_FACE),o[r++]=Ac.OPAQUE_BACK_FACE,o[r++]=f),r)}function uh(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function nwe(e,t){return e.indexOf(t)>-1}function Ixt(e,t){uh(e.defines,"TRANSLUCENT"),uh(t.defines,"TRANSLUCENT")}function xxt(e,t){uh(e.defines,"GROUND_ATMOSPHERE"),uh(t.defines,"GROUND_ATMOSPHERE"),uh(e.defines,"FOG"),uh(t.defines,"FOG"),uh(e.defines,"TRANSLUCENT"),uh(t.defines,"TRANSLUCENT")}function ate(e,t){if(nwe(t.defines,"TILE_LIMIT_RECTANGLE")||nwe(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main()
{
out_FragColor = vec4(1.0);
}
`;t.sources=[n]}function ste(e,t){let n=t.sources,i=n.length;for(let r=0;r<i;++r)n[r]=We.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 uwe(e,t){ste(e,t),uh(e.defines,"GROUND_ATMOSPHERE"),uh(t.defines,"GROUND_ATMOSPHERE"),uh(e.defines,"FOG"),uh(t.defines,"FOG")}function Txt(e,t){ste(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function Sxt(e,t){uwe(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function iwe(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 wxt(e,t,n,i,o,r){if(!l(o))return t;if(!i&&l(n))return n;let a=e.shaderCache.getDerivedShaderProgram(t,r);if(!l(a)){let s=t._attributeLocations,c=t.vertexShaderSource.clone(),u=t.fragmentShaderSource.clone();c.defines=l(c.defines)?c.defines.slice(0):[],u.defines=l(u.defines)?u.defines.slice(0):[],o(c,u),a=e.shaderCache.createDerivedShaderProgram(t,r,{vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:s})}return a}function Bxt(e){e.cull.face=Ni.BACK,e.cull.enabled=!0}function Dxt(e){e.cull.face=Ni.FRONT,e.cull.enabled=!0}function vxt(e){e.cull.face=Ni.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Pxt(e){e.cull.face=Ni.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Rxt(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function owe(e){e.cull.face=Ni.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=sn.ALPHA_BLEND}function rwe(e){e.cull.face=Ni.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=sn.ALPHA_BLEND}function Mxt(e){e.cull.face=Ni.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function Nxt(e){e.cull.face=Ni.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function Lxt(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 a=Ve.getState(e);i(a),r=Ve.fromCache(a),o[e.id]=r}return r}function fB(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function Oxt(e,t,n,i,o){return l(o)?!i&&l(n)?n:Pt(t,o(e),!1):t}function Gm(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function Fxt(){return[new Gm({pass:Be.GLOBE,pickOnly:!1,getShaderProgramFunction:Ixt,getRenderStateFunction:Bxt,getUniformMapFunction:void 0}),new Gm({pass:Be.GLOBE,pickOnly:!1,getShaderProgramFunction:xxt,getRenderStateFunction:Dxt,getUniformMapFunction:void 0}),new Gm({pass:Be.GLOBE,pickOnly:!1,getShaderProgramFunction:ate,getRenderStateFunction:vxt,getUniformMapFunction:void 0}),new Gm({pass:Be.GLOBE,pickOnly:!1,getShaderProgramFunction:ate,getRenderStateFunction:Pxt,getUniformMapFunction:void 0}),new Gm({pass:Be.GLOBE,pickOnly:!1,getShaderProgramFunction:ate,getRenderStateFunction:Rxt,getUniformMapFunction:void 0}),new Gm({pass:Be.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:ste,getRenderStateFunction:owe,getUniformMapFunction:fB}),new Gm({pass:Be.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:uwe,getRenderStateFunction:rwe,getUniformMapFunction:fB}),new Gm({pass:Be.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Txt,getRenderStateFunction:owe,getUniformMapFunction:fB}),new Gm({pass:Be.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Sxt,getRenderStateFunction:rwe,getUniformMapFunction:fB}),new Gm({pass:Be.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:iwe,getRenderStateFunction:Mxt,getUniformMapFunction:fB}),new Gm({pass:Be.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:iwe,getRenderStateFunction:Nxt,getUniformMapFunction:fB})]}var awe=new Array(CI),swe=new Array(CI);EI.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let o=0;o<i;++o)swe[o]=this._derivedCommandPacks[n[o]],awe[o]=lwe[n[o]];Qxt(this,e,i,n,awe,swe,t)}};function Qxt(e,t,n,i,o,r,a){let s=t.derivedCommands.globeTranslucency,c=e._derivedCommandsDirty;if(t.dirty||!l(s)||c){t.dirty=!1,l(s)||(s={},t.derivedCommands.globeTranslucency=s);let u=a.frameNumber,f=s.uniformMapDirtyFrame??0,h=s.shaderProgramDirtyFrame??0,p=s.renderStateDirtyFrame??0,A=s.uniformMap!==t.uniformMap,m=s.shaderProgramId!==t.shaderProgram.id,_=s.renderStateId!==t.renderState.id;A&&(s.uniformMapDirtyFrame=u),m&&(s.shaderProgramDirtyFrame=u),_&&(s.renderStateDirtyFrame=u),s.uniformMap=t.uniformMap,s.shaderProgramId=t.shaderProgram.id,s.renderStateId=t.renderState.id;for(let y=0;y<n;++y){let C=r[y],E=i[y],b=o[y],x=s[b],S,B,v;l(x)?(S=x.uniformMap,B=x.shaderProgram,v=x.renderState):(S=void 0,B=void 0,v=void 0),x=nt.shallowClone(t,x),s[b]=x;let P=x.derivedCommands.uniformMapDirtyFrame??0,N=x.derivedCommands.shaderProgramDirtyFrame??0,L=x.derivedCommands.renderStateDirtyFrame??0,g=A||P<f,I=m||N<h,T=_||L<p;g&&(x.derivedCommands.uniformMapDirtyFrame=u),I&&(x.derivedCommands.shaderProgramDirtyFrame=u),T&&(x.derivedCommands.renderStateDirtyFrame=u),x.derivedCommands.type=E,x.pass=C.pass,x.pickOnly=C.pickOnly,x.uniformMap=Oxt(e,t.uniformMap,S,g,C.getUniformMapFunction),x.shaderProgram=wxt(a.context,t.shaderProgram,B,I,C.getShaderProgramFunction,b),x.renderState=Lxt(t.renderState,v,T,C.getRenderStateFunction,C.renderStateCache)}}}EI.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 a=e.derivedCommands.globeTranslucency;for(let s=0;s<r;++s){let c=lwe[o[s]];n.commandList.push(a[c])}};function fwe(e,t,n,i,o,r){for(let a=0;a<t;++a){let s=e[a],c=s.derivedCommands.type;(!l(r)||r.indexOf(c)>-1)&&n(s,i,o)}}function cwe(e,t,n,i,o){for(let r=0;r<t;++r)n(e[r],i,o)}var kxt=[Ac.OPAQUE_FRONT_FACE,Ac.OPAQUE_BACK_FACE],Uxt=[Ac.DEPTH_ONLY_FRONT_FACE,Ac.DEPTH_ONLY_BACK_FACE,Ac.DEPTH_ONLY_FRONT_AND_BACK_FACE];EI.prototype.executeGlobeCommands=function(e,t,n,i,o){let r=i.context,a=e.commands[Be.GLOBE],s=e.indices[Be.GLOBE];s!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(r,o),fwe(a,s,t,i,o,kxt))};EI.prototype.executeGlobeClassificationCommands=function(e,t,n,i,o){let{context:r}=i,{uniformState:a}=r,s=e.commands[Be.GLOBE],c=e.indices[Be.GLOBE],u=e.commands[Be.TERRAIN_CLASSIFICATION],f=e.indices[Be.TERRAIN_CLASSIFICATION];if(c===0||f===0)return;let h=this._frontFaceTranslucent,p=this._backFaceTranslucent;if((!h||!p)&&cwe(u,f,t,i,o),!h&&!p)return;this._globeTranslucencyFramebuffer=n;let A=a.globeDepthTexture,m=o.framebuffer;if(o.framebuffer=n.classificationFramebuffer,fwe(s,c,t,i,o,Uxt),r.depthTexture){let _=n.packDepth(r,o);a.globeDepthTexture=_}cwe(u,f,t,i,o),a.globeDepthTexture=A,o.framebuffer=m};var e3=EI;var Yu=`uniform sampler2D colorTexture;
in vec2 v_textureCoordinates;
void main()
{
out_FragColor = texture(colorTexture, v_textureCoordinates);
}
`;function cA(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new Ei({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new Ei({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 fi({color:new z(0,0,0,0),owner:this}),this._clearCommand=new fi({color:new z(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(cA.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});cA.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var zxt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:ti.EQUAL,frontOperation:{fail:wt.KEEP,zFail:wt.KEEP,zPass:wt.KEEP},backFunction:ti.NEVER,reference:0,mask:Yt.CLASSIFICATION_MASK},blending:sn.ALPHA_BLEND},Gxt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:ti.NOT_EQUAL,frontOperation:{fail:wt.KEEP,zFail:wt.KEEP,zPass:wt.KEEP},backFunction:ti.NEVER,reference:0,mask:Yt.CLASSIFICATION_MASK},blending:sn.ALPHA_BLEND},Vxt={depthMask:!0,depthTest:{enabled:!0},stencilTest:Yt.setCesium3DTileBit(),stencilMask:Yt.CESIUM_3D_TILE_MASK,blending:sn.ALPHA_BLEND},Hxt=`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;
}
`,Wxt=`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
}
`;cA.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,a=e.drawingBufferWidth,s=e.drawingBufferHeight,c=!l(i)||i.width!==a||i.height!==s;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 Dt({context:e,width:a,height:s,pixelFormat:qe.DEPTH_STENCIL,pixelDatatype:He.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new lf({context:e,width:a,height:s,format:wl.DEPTH24_STENCIL8,numSamples:t})))),!l(this._fbo.framebuffer)||c||o||r){this._fbo.destroy(),this._fboClassified.destroy();let u,f;l(this._previousFramebuffer)?(u=n.getDepthStencilTexture(),f=n.getDepthStencilRenderbuffer()):(u=this._depthStencilTexture,f=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(u),l(f)&&this._fbo.setDepthStencilRenderbuffer(f),this._fbo.update(e,a,s,t),l(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(u),this._fboClassified.update(e,a,s))}if(l(this._rsUnclassified)||(this._rsUnclassified=Ve.fromCache(zxt),this._rsClassified=Ve.fromCache(Gxt),this._rsDefault=Ve.fromCache(Vxt)),!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 u=l(this._previousFramebuffer)?Wxt:Hxt,f=new We({defines:["UNCLASSIFIED"],sources:[u]}),h=new We({sources:[u]});this._unclassifiedCommand=e.createViewportQuadCommand(f,{renderState:l(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(h,{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(Yu,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};cA.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};cA.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))};cA.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)};cA.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};cA.prototype.isDestroyed=function(){return!1};cA.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()),fe(this)};var dB=cA;function c5(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(c5.prototype,{total:{get:function(){return this._total}}});function XC(e){let t=new Array(Bc.NUMBER_OF_JOB_TYPES);t[Bc.TEXTURE]=new c5(l(e)?e[Bc.TEXTURE]:10),t[Bc.PROGRAM]=new c5(l(e)?e[Bc.PROGRAM]:10),t[Bc.BUFFER]=new c5(l(e)?e[Bc.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}XC.getTimestamp=Fi;Object.defineProperties(XC.prototype,{totalBudget:{get:function(){return this._totalBudget}}});XC.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};XC.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};XC.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,u;for(u=0;u<c&&(r=n[u],!(r.usedThisFrame+r.stolenFromMeThisFrame<r.total&&!r.starvedLastFrame));++u);if(u===c&&o)return!1;o&&(i.starvedThisFrame=!0)}let a=XC.getTimestamp();e.execute();let s=XC.getTimestamp()-a;return this._totalUsedThisFrame+=s,r?r.stolenFromMeThisFrame+=s:i.usedThisFrame+=s,this._executedThisFrame[t]=!0,!0};var t3=XC;function l5(e){e=e??V.EMPTY_OBJECT;let t=kn(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=Fi(),this._lastMsSampleTime=Fi(),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(l5.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});l5.prototype.update=function(e){let t=Fi(),n=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}};l5.prototype.destroy=function(){return fe(this)};var w_=l5;var gc={};gc.decodeRawMetadataValue=function(e,t,n){switch(e){case Ft.INT8:return t.getInt8(n);case Ft.UINT8:return t.getUint8(n);case Ft.INT16:return t.getInt16(n,!0);case Ft.UINT16:return t.getUint16(n,!0);case Ft.INT32:return t.getInt32(n,!0);case Ft.UINT32:return t.getUint32(n,!0);case Ft.INT64:return t.getBigInt64(n,!0);case Ft.UINT64:return t.getBigUint64(n,!0);case Ft.FLOAT32:return t.getFloat32(n,!0);case Ft.FLOAT64:return t.getFloat64(n,!0)}throw new ue(`Invalid component type: ${e}`)};gc.decodeRawMetadataValueComponent=function(e,t,n){let i=e.componentType,o=gc.decodeRawMetadataValue(i,t,n);return e.normalized?Ft.normalize(o,i):o};gc.decodeRawMetadataValueElement=function(e,t,n){let i=e.componentType,o=Ft.getSizeInBytes(i),r=e.type,a=bt.getComponentCount(r),s=o*a;if(a>1){let f=Array(a);for(let h=0;h<a;h++){let p=n*s+h*o,A=gc.decodeRawMetadataValueComponent(e,t,p);f[h]=A}return f}let c=n*s;return gc.decodeRawMetadataValueComponent(e,t,c)};gc.decodeRawMetadataValues=function(e,t){let n=new DataView(t.buffer,t.byteOffset,t.byteLength);if(e.isArray){let o=e.arrayLength,r=Array(o);for(let a=0;a<o;a++){let s=gc.decodeRawMetadataValueElement(e,n,a);r[a]=s}return r}return gc.decodeRawMetadataValueElement(e,n,0)};gc.convertToObjectType=function(e,t){if(!l(t)||e===bt.SCALAR||e===bt.STRING||e===bt.BOOLEAN||e===bt.ENUM)return t;let n=t.map(i=>Number(i));switch(e){case bt.VEC2:return k.unpack(n,0,new k);case bt.VEC3:return d.unpack(n,0,new d);case bt.VEC4:return ie.unpack(n,0,new ie);case bt.MAT2:return ji.unpack(n,0,new ji);case bt.MAT3:return J.unpack(n,0,new J);case bt.MAT4:return M.unpack(n,0,new M)}throw new ue(`Invalid metadata object type: ${e}`)};gc.convertFromObjectType=function(e,t){if(!l(t)||e===bt.SCALAR||e===bt.STRING||e===bt.BOOLEAN||e===bt.ENUM)return t;switch(e){case bt.VEC2:return k.pack(t,Array(2));case bt.VEC3:return d.pack(t,Array(3));case bt.VEC4:return ie.pack(t,Array(4));case bt.MAT2:return ji.pack(t,Array(4));case bt.MAT3:return J.pack(t,Array(9));case bt.MAT4:return M.pack(t,Array(16))}throw new ue(`Invalid metadata object type: ${e}`)};gc.decodeMetadataValues=function(e,t,n){let i=gc.decodeRawMetadataValues(e,n);if(t.hasValueTransform){let r=gc.convertFromObjectType(e.type,t.offset),a=gc.convertFromObjectType(e.type,t.scale);i=Ap.valueTransformInPlace(i,r,a,Ft.applyValueTransform)}if(e.isArray){let r=e.arrayLength,a=Array(r);for(let s=0;s<r;s++){let c=i[s],u=gc.convertToObjectType(e.type,c);a[s]=u}return a}return gc.convertToObjectType(e.type,i)};var n3=Object.freeze(gc);function bI(){this._framebuffer=new Ei,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(bI.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function jxt(e,t,n){let{width:i,height:o}=n;e._framebuffer.update(t,i,o)}function Yxt(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:Ve.fromCache(),uniformMap:{colorTexture:function(){return e._textureToCopy}},owner:e})),e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}bI.prototype.update=function(e,t){jxt(this,e,t),Yxt(this,e,t)};var qxt=new ie,Kxt=new ie(1,1/255,1/65025,1/16581375);bI.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=ie.unpack(i,0,qxt);return ie.divideByScalar(o,255,o),ie.dot(o,Kxt)};bI.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};bI.prototype.isDestroyed=function(){return!1};bI.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),fe(this)};var i3=bI;function JC(e){e=e||{},this._framebufferManager=new Ei({colorAttachmentsLength:3,createColorAttachments:!0,depthStencil:!0,supportsDepthTexture:!0,color:!0}),this._framebuffer=void 0,this._colorTexture=void 0,this._idTexture=void 0,this._depthTexture=void 0,this._depthStencilTexture=void 0,this._clearCommand=new fi({color:new z(0,0,0,0),depth:1,stencil:0,owner:this})}Object.defineProperties(JC.prototype,{framebuffer:{get:function(){return this._framebuffer}},colorTexture:{get:function(){return this._colorTexture}},idTexture:{get:function(){return this._idTexture}},depthTexture:{get:function(){return this._depthTexture}},depthStencilTexture:{get:function(){return this._depthStencilTexture}}});JC.prototype.update=function(e,t,n,i,o){let r=t.width,a=t.height,s=n?e.halfFloatingPointTexture?He.HALF_FLOAT:He.FLOAT:He.UNSIGNED_BYTE,c=this._framebufferManager.update(e,r,a,1,s,qe.RGBA);return this._framebufferManager.framebuffer&&(this._framebuffer=this._framebufferManager.framebuffer,this._colorTexture=l(i)?i:this._framebufferManager.getColorTexture(0),this._idTexture=this._framebufferManager.getColorTexture(1),this._depthTexture=this._framebufferManager.getColorTexture(2),this._depthStencilTexture=l(o)?o:this._framebufferManager.getDepthStencilTexture()),c};JC.prototype.clear=function(e,t,n){this.getClearCommand(n).execute(e,t)};JC.prototype.getClearCommand=function(e){return this._clearCommand.framebuffer=this._framebuffer,l(e)&&z.clone(e,this._clearCommand.color),this._clearCommand};JC.prototype.getFramebuffer=function(e,t,n,i){return this.update(e,t,!1,n,i),this._framebuffer};JC.prototype.isDestroyed=function(){return!1};JC.prototype.destroy=function(){return this._framebufferManager=this._framebufferManager&&this._framebufferManager.destroy(),this._clearCommand=void 0,fe(this)};var o3=JC;function Xxt(e,t){this.near=e??0,this.far=t??0;let n=Be.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 r3=Xxt;var ZC=`uniform highp sampler2D u_depthTexture;
in vec2 v_textureCoordinates;
void main()
{
out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r);
}
`;function lA(){this._picking=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new Ei({depthStencil:!0,supportsDepthTexture:!0}),this._outputFramebuffer=new Ei({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new Ei,this._tempCopyDepthFramebuffer=new Ei,this._updateDepthFramebuffer=new Ei({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 et,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(lA.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 dwe(e,t,n,i,o){let r=e._viewport;r.width=n,r.height=i;let a=!et.equals(r,o.viewport),s=a!==e._useScissorTest;e._useScissorTest=a,et.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=et.clone(o.viewport,e._scissorRectangle),s=!0),(!l(e._rs)||!et.equals(r,e._rs.viewport)||s)&&(e._rs=Ve.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=Ve.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:sn.ALPHA_BLEND}),e._rsUpdate=Ve.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:ti.EQUAL,frontOperation:{fail:wt.KEEP,zFail:wt.KEEP,zPass:wt.KEEP},backFunction:ti.NEVER,reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(ZC,{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(Yu,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(ZC,{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(Yu,{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 fi({color:new z(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}lA.prototype.update=function(e,t,n,i,o,r){let{width:a,height:s}=n,c=o?e.halfFloatingPointTexture?He.HALF_FLOAT:He.FLOAT:He.UNSIGNED_BYTE;this._numSamples=i,this.picking?this._pickColorFramebuffer.update(e,a,s):this._outputFramebuffer.update(e,a,s,i,c),this._copyDepthFramebuffer.update(e,a,s),dwe(this,e,a,s,t),e.uniformState.globeDepthTexture=void 0,this._clearGlobeDepth=r};lA.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};lA.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};lA.prototype.executeUpdateDepth=function(e,t,n){let i=l(n)?n:t.framebuffer.depthStencilTexture;if(!this._clearGlobeDepth&&i===this.colorFramebufferManager.getDepthStencilTexture()){l(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t);return}if(!l(this._updateDepthCommand))return;let o=this._updateDepthFramebuffer;if(!l(o.framebuffer)||o.getDepthStencilTexture()!==i||o.getColorTexture()!==this._copyDepthFramebuffer.getColorTexture()){let r=this._copyDepthFramebuffer.getColorTexture(),{width:a,height:s}=r;this._tempCopyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.update(e,a,s),o.setColorTexture(r,0),o.setDepthStencilTexture(i),o.update(e,a,s),dwe(this,e,a,s,t)}this._tempCopyDepthTexture=i,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)};lA.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};lA.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(z.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};lA.prototype.isDestroyed=function(){return!1};lA.prototype.destroy=function(){return this._pickColorFramebuffer.destroy(),this._outputFramebuffer.destroy(),this._copyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.destroy(),this._updateDepthFramebuffer.destroy(),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()),fe(this)};var a3=lA;function II(){this._framebuffer=new Ei({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new Ei,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new et,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(II.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 Jxt(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function Zxt(e,t,n,i,o){let r=o?t.halfFloatingPointTexture?He.HALF_FLOAT:He.FLOAT:He.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,r),e._packedDepthFramebuffer.update(t,n,i)}function $xt(e,t,n,i,o){e._viewport.width=n,e._viewport.height=i;let r=!et.equals(e._viewport,o.viewport),a=r!==e._useScissorTest;e._useScissorTest=r,et.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=et.clone(o.viewport,e._scissorRectangle),a=!0),(!l(e._renderState)||!et.equals(e._viewport,e._renderState.viewport)||a)&&(e._renderState=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(ZC,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),l(e._clearCommand)||(e._clearCommand=new fi({color:new z(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}II.prototype.updateAndClear=function(e,t,n,i){let o=t.width,r=t.height;Zxt(this,n,o,r,e),$xt(this,n,o,r,i),this._useHdr=e};II.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};II.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};II.prototype.isDestroyed=function(){return!1};II.prototype.destroy=function(){return Jxt(this),fe(this)};var s3=II;function B_(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 Ei({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new Ei({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new Ei({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new Ei({createColorAttachments:!1}),this._opaqueClearCommand=new fi({color:new z(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new fi({color:new z(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new fi({color:new z(0,0,0,0),owner:this}),this._alphaClearCommand=new fi({color:new z(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 et,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function hwe(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function cte(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function mwe(e){hwe(e),cte(e)}function eTt(e,t,n,i){hwe(e),e._accumulationTexture=new Dt({context:t,width:n,height:i,pixelFormat:qe.RGBA,pixelDatatype:He.FLOAT}),e._revealageTexture=new Dt({context:t,pixelFormat:qe.RGBA,pixelDatatype:He.FLOAT,width:n,height:i,flipY:!1})}function tTt(e,t){cte(e);let n=ee.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)&&(cte(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 a=e._translucentFBO.status===n,s=e._alphaFBO.status===n,c=e._adjustTranslucentFBO.status===n,u=e._adjustAlphaFBO.status===n;(!a||!s||!c||!u)&&(mwe(e),e._translucentMultipassSupport=!1,i=!1)}return i}B_.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:a}=this._opaqueTexture,s=this._accumulationTexture,c=!l(s)||s.width!==r||s.height!==a||i!==this._useHDR,u=this._numSamples!==o;if((c||u)&&(this._numSamples=o,eTt(this,e,r,a)),(!l(this._translucentFBO.framebuffer)||c||u)&&!tTt(this,e))return;this._useHDR=i;let f=this,h,p;l(this._compositeCommand)||(h=new We({sources:[uk]}),this._translucentMRTSupport&&h.defines.push("MRT"),p={u_opaque:function(){return f._opaqueTexture},u_accumulation:function(){return f._accumulationTexture},u_revealage:function(){return f._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this})),l(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(h=new We({defines:["MRT"],sources:[$w]}),p={u_bgColor:function(){return f._translucentMRTClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(h=new We({sources:[$w]}),p={u_bgColor:function(){return f._translucentMultipassClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this}),p={u_bgColor:function(){return f._alphaClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this}))),this._viewport.width=r,this._viewport.height=a;let A=!et.equals(this._viewport,t.viewport),m=A!==this._useScissorTest;this._useScissorTest=A,et.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=et.clone(t.viewport,this._scissorRectangle),m=!0),(!l(this._rs)||!et.equals(this._viewport,this._rs.viewport)||m)&&(this._rs=Ve.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 nTt={enabled:!0,color:new z(0,0,0,0),equationRgb:Tc.ADD,equationAlpha:Tc.ADD,functionSourceRgb:Jo.ONE,functionDestinationRgb:Jo.ONE,functionSourceAlpha:Jo.ZERO,functionDestinationAlpha:Jo.ONE_MINUS_SOURCE_ALPHA},iTt={enabled:!0,color:new z(0,0,0,0),equationRgb:Tc.ADD,equationAlpha:Tc.ADD,functionSourceRgb:Jo.ONE,functionDestinationRgb:Jo.ONE,functionSourceAlpha:Jo.ONE,functionDestinationAlpha:Jo.ONE},oTt={enabled:!0,color:new z(0,0,0,0),equationRgb:Tc.ADD,equationAlpha:Tc.ADD,functionSourceRgb:Jo.ZERO,functionDestinationRgb:Jo.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:Jo.ZERO,functionDestinationAlpha:Jo.ONE_MINUS_SOURCE_ALPHA};function lte(e,t,n,i){let o=n[i.id];if(!l(o)){let r=Ve.getState(i);r.depthMask=!1,r.blending=t,o=Ve.fromCache(r),n[i.id]=o}return o}function rTt(e,t,n){return lte(t,nTt,e._translucentRenderStateCache,n)}function aTt(e,t,n){return lte(t,iTt,e._translucentRenderStateCache,n)}function sTt(e,t,n){return lte(t,oTt,e._alphaRenderStateCache,n)}var cTt=` 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);
`,lTt=` 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;
`,uTt=` float ai = czm_out_FragColor.a;
out_FragColor = vec4(ai);
`;function ute(e,t,n,i){let{shaderCache:o}=e,r=o.getDerivedShaderProgram(t,n);if(l(r))return r;let a=t._attributeLocations,s=t.fragmentShaderSource.clone();s.sources=s.sources.map(function(f){return We.replaceMain(f,"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")}),s.sources.splice(0,0,`#define CESIUM_REDIRECTED_COLOR_OUTPUT
vec4 czm_out_FragColor;
bool czm_discard = false;
`);let c=[...i.matchAll(/out_FragData_(\d+)/g)],u="";for(let f=0;f<c.length;f++){let h=c[f];u=`layout (location = ${h[1]}) out vec4 ${h[0]};
${u}`}return s.sources.push(u),s.sources.push(`void main()
{
czm_translucent_main();
if (czm_discard)
{
discard;
}
${i}}
`),o.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:s,attributeLocations:a})}function fTt(e,t){return ute(e,t,"translucentMRT",cTt)}function dTt(e,t){return ute(e,t,"translucentMultipass",lTt)}function hTt(e,t){return ute(e,t,"alphaMultipass",uTt)}B_.prototype.createDerivedCommands=function(e,t,n){if(l(n)||(n={}),this._translucentMRTSupport){let s,c;return l(n.translucentCommand)&&(s=n.translucentCommand.shaderProgram,c=n.translucentCommand.renderState),n.translucentCommand=nt.shallowClone(e,n.translucentCommand),!l(s)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=fTt(t,e.shaderProgram),n.translucentCommand.renderState=rTt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=s,n.translucentCommand.renderState=c),n}let i,o,r,a;return l(n.translucentCommand)&&(i=n.translucentCommand.shaderProgram,o=n.translucentCommand.renderState,r=n.alphaCommand.shaderProgram,a=n.alphaCommand.renderState),n.translucentCommand=nt.shallowClone(e,n.translucentCommand),n.alphaCommand=nt.shallowClone(e,n.alphaCommand),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=dTt(t,e.shaderProgram),n.translucentCommand.renderState=aTt(this,t,e.renderState),n.alphaCommand.shaderProgram=hTt(t,e.shaderProgram),n.alphaCommand.renderState=sTt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=i,n.translucentCommand.renderState=o,n.alphaCommand.shaderProgram=r,n.alphaCommand.renderState=a),n};function mTt(e,t,n,i,o,r){let{context:a,frameState:s}=t,{useLogDepth:c,shadowState:u}=s,f=t._hdr,h=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(a,i),i.framebuffer=e._adjustAlphaFBO.framebuffer,e._adjustAlphaCommand.execute(a,i);let A=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let m=0;m<o.length;++m){let _=o[m];_=c?_.derivedCommands.logDepth.command:_,_=f?_.derivedCommands.hdr.command:_;let y=p&&_.receiveShadows?_.derivedCommands.oit.shadows.translucentCommand:_.derivedCommands.oit.translucentCommand;n(y,t,i,A)}if(l(r)){let m=r.unclassifiedCommand,_=p&&m.receiveShadows?m.derivedCommands.oit.shadows.translucentCommand:m.derivedCommands.oit.translucentCommand;n(_,t,i,A)}i.framebuffer=e._alphaFBO.framebuffer;for(let m=0;m<o.length;++m){let _=o[m];_=c?_.derivedCommands.logDepth.command:_,_=f?_.derivedCommands.hdr.command:_;let y=p&&_.receiveShadows?_.derivedCommands.oit.shadows.alphaCommand:_.derivedCommands.oit.alphaCommand;n(y,t,i,A)}if(l(r)){let m=r.unclassifiedCommand,_=p&&m.receiveShadows?m.derivedCommands.oit.shadows.alphaCommand:m.derivedCommands.oit.alphaCommand;n(_,t,i,A)}i.framebuffer=h}function pTt(e,t,n,i,o,r){let{context:a,frameState:s}=t,{useLogDepth:c,shadowState:u}=s,f=t._hdr,h=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(a,i);let A=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let m=0;m<o.length;++m){let _=o[m];_=c?_.derivedCommands.logDepth.command:_,_=f?_.derivedCommands.hdr.command:_;let y=p&&_.receiveShadows?_.derivedCommands.oit.shadows.translucentCommand:_.derivedCommands.oit.translucentCommand;n(y,t,i,A)}if(l(r)){let m=r.unclassifiedCommand,_=p&&m.receiveShadows?m.derivedCommands.oit.shadows.translucentCommand:m.derivedCommands.oit.translucentCommand;n(_,t,i,A)}i.framebuffer=h}B_.prototype.executeCommands=function(e,t,n,i,o){if(this._translucentMRTSupport){pTt(this,e,t,n,i,o);return}mTt(this,e,t,n,i,o)};B_.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};B_.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,z.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};B_.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};B_.prototype.isDestroyed=function(){return!1};B_.prototype.destroy=function(){return mwe(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()),fe(this)};var c3=B_;function l3(){this._framebuffer=new Ei({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(l3.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function ATt(e){e._framebuffer.destroy()}function gTt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let o=new Wc(t);o.blendingEnabled=!1,o.scissorTest={enabled:!0,rectangle:new et},o.viewport=new et,e._passState=o}l3.prototype.update=function(e,t,n){let i=n.width,o=n.height;this._framebuffer.isDirty(i,o)&&gTt(this,e);let r=this.framebuffer,a=this._passState;return a.framebuffer=r,a.viewport.width=i,a.viewport.height=o,a.scissorTest.rectangle.x=t.x,a.scissorTest.rectangle.y=o-t.y,a.scissorTest.rectangle.width=1,a.scissorTest.rectangle.height=1,a};l3.prototype.isDestroyed=function(){return!1};l3.prototype.destroy=function(){return ATt(this),fe(this)};var u3=l3;function xI(e){let t=new Wc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new et},t.viewport=new et,this._context=e,this._fb=new Ei({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}function pwe(e,t,n,i,o=1){let r=Math.max(n,i),a=r*r,s=Math.floor(n*.5),c=Math.floor(i*.5),u=0,f=0,h=0,p=-1,A=new Set;for(let m=0;m<a;++m){if(-s<=u&&u<=s&&-c<=f&&f<=c){let _=4*((c-f)*n+u+s),y=z.bytesToRgba(t[_],t[_+1],t[_+2],t[_+3]),C=e.getObjectByPickColor(y);if(l(C)&&(A.add(C),A.size>=o))break}if(u===f||u<0&&-u===f||u>0&&u===1-f){let _=h;h=-p,p=_}u+=h,f+=p}return[...A]}xI.prototype.begin=function(e,t){let n=this._context,{width:i,height:o}=t;return et.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};xI.prototype.endAsync=async function(e,t,n=1){let i=e.width??1,o=e.height??1,r=this._context,a=this._fb.framebuffer,s=He.UNSIGNED_BYTE,c=qe.RGBA;l(a)&&a.numberOfColorAttachments>0&&(s=a.getColorTexture(0).pixelDatatype,c=a.getColorTexture(0).pixelFormat);let u=r.readPixelsToPBO({x:e.x,y:e.y,width:i,height:o,framebuffer:a}),f=dR.create({context:r});try{await f.waitForSignal(A=>t.afterRender.push(A));let h=qe.createTypedArray(c,s,i,o);return u.getBufferData(h),pwe(r,h,i,o,n)}catch{throw new ue("Async Picking Request Timeout")}finally{f.destroy(),u.destroy()}};xI.prototype.end=function(e,t=1){let n=e.width??1,i=e.height??1,o=this._context,r=o.readPixels({x:e.x,y:e.y,width:n,height:i,framebuffer:this._fb.framebuffer});return pwe(o,r,n,i,t)};xI.prototype.readCenterPixel=function(e){let t=e.width??1,n=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),s=4*(Math.floor(n*.5)*t+r);return o.slice(s,s+4)};xI.prototype.isDestroyed=function(){return!1};xI.prototype.destroy=function(){return this._fb.destroy(),fe(this)};var f3=xI;function D_(){this._numSamples=1,this._colorFramebuffer=new Ei({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new Ei({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new z(0,0,0,0),this._clearCommand=new fi({color:new z(0,0,0,0),depth:1,owner:this})}function _Tt(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(D_.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});D_.prototype.update=function(e,t,n,i){let o=t.width,r=t.height,a=n?e.halfFloatingPointTexture?He.HALF_FLOAT:He.FLOAT:He.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,o,r,i,a),this._idFramebuffer.update(e,o,r)};D_.prototype.clear=function(e,t,n){z.clone(n,this._clearCommand.color),z.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};D_.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};D_.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};D_.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};D_.prototype.isDestroyed=function(){return!1};D_.prototype.destroy=function(){return _Tt(this),fe(this)};var TI=D_;function SI(){}SI.getShadowCastShaderKeyword=function(e,t,n,i){return`castShadow ${e} ${t} ${n} ${i}`};SI.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=We.findPositionVarying(e),a=l(r);if(t&&!a){let s=o.length;for(let u=0;u<s;++u)o[u]=We.replaceMain(o[u],"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 We({defines:i,sources:o})};SI.createShadowCastFragmentShader=function(e,t,n,i){let o=e.defines.slice(0),r=e.sources.slice(0);o.push("SHADOW_MAP");let a=We.findPositionVarying(e),s=l(a);s||(a="v_positionEC");let c=r.length;for(let f=0;f<c;++f)r[f]=We.replaceMain(r[f],"czm_shadow_cast_main");let u="";return t&&(s||(u+=`in vec3 v_positionEC;
`),u+=`uniform vec4 shadowMap_lightPositionEC;
`),i?u+=`void main()
{
`:u+=`void main()
{
czm_shadow_cast_main();
if (out_FragColor.a == 0.0)
{
discard;
}
`,t?u+=` float distance = length(${a});
if (distance >= shadowMap_lightPositionEC.w)
{
discard;
}
distance /= shadowMap_lightPositionEC.w; // radius
out_FragColor = czm_packDepth(distance);
`:n?u+=` out_FragColor = vec4(1.0);
`:u+=` out_FragColor = czm_packDepth(gl_FragCoord.z);
`,u+=`}
`,r.push(u),new We({defines:o,sources:r})};SI.getShadowReceiveShaderKeyword=function(e,t,n,i){let o=e._usesDepthTexture,r=e._polygonOffsetSupported,a=e._isPointLight,s=e._isSpotLight,c=e._numberOfCascades>1,u=e.debugCascadeColors,f=e.softShadows;return`receiveShadow ${o}${r}${a}${s}${c}${u}${f}${t}${n}${i}`};SI.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 We({defines:i,sources:o})};SI.createShadowReceiveFragmentShader=function(e,t,n,i,o){let r=We.findNormalVarying(e),a=!i&&l(r)||i&&o,s=We.findPositionVarying(e),c=l(s),u=t._usesDepthTexture,f=t._polygonOffsetSupported,h=t._isPointLight,p=t._isSpotLight,A=t._numberOfCascades>1,m=t.debugCascadeColors,_=t.softShadows,y=h?t._pointBias:i?t._terrainBias:t._primitiveBias,C=e.defines.slice(0),E=e.sources.slice(0),b=E.length;for(let B=0;B<b;++B)E[B]=We.replaceMain(E[B],"czm_shadow_receive_main");h?C.push("USE_CUBE_MAP_SHADOW"):u&&C.push("USE_SHADOW_DEPTH_TEXTURE"),_&&!h&&C.push("USE_SOFT_SHADOWS"),A&&n&&i&&(a?C.push("ENABLE_VERTEX_LIGHTING"):C.push("ENABLE_DAYNIGHT_SHADING")),n&&y.normalShading&&a&&(C.push("USE_NORMAL_SHADING"),y.normalShadingSmooth>0&&C.push("USE_NORMAL_SHADING_SMOOTH"));let x="";h?x+=`uniform samplerCube shadowMap_textureCube;
`:x+=`uniform sampler2D shadowMap_texture;
`;let S;return c?S=` return vec4(${s}, 1.0);
`:S=`#ifndef LOG_DEPTH
return czm_windowToEyeCoordinates(gl_FragCoord);
#else
return vec4(v_logPositionEC, 1.0);
#endif
`,x+=`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()
{
${S}}
vec3 getNormalEC()
{
${a?` return normalize(${r});
`:` return vec3(1.0);
`}}
void applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL)
{
${y.normalOffset&&a?` float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x;
float normalOffsetScale = 1.0 - nDotL;
vec3 offset = normalOffset * normalOffsetScale * normalEC;
positionEC.xyz += offset;
`:""}}
`,x+=`void main()
{
czm_shadow_receive_main();
vec4 positionEC = getPositionEC();
vec3 normalEC = getNormalEC();
float depth = -positionEC.z;
`,x+=` czm_shadowParameters shadowParameters;
shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy;
shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z;
shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w;
shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w;
`,i?x+=` shadowParameters.depthBias *= max(depth * 0.01, 1.0);
`:f||(x+=` shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015);
`),h?x+=` 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?x+=` 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);
`:A?x+=` 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);
${m?` // Draw cascade colors for debugging
out_FragColor *= czm_cascadeColor(weights);
`:""}`:x+=` 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);
`,x+=` out_FragColor.rgb *= visibility;
}
`,E.push(x),new We({defines:C,sources:E})};var uA=SI;function fA(e){e=e??V.EMPTY_OBJECT;let t=e.context;this._enabled=e.enabled??!0,this._softShadows=e.softShadows??!1,this._normalOffset=e.normalOffset??!0,this.dirty=!0,this.fromLightSource=e.fromLightSource??!0,this.darkness=e.darkness??.3,this._darkness=this.darkness,this.fadingEnabled=e.fadingEnabled??!0,this.maximumDistance=e.maximumDistance??5e3,this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let n=!0;(fn.isEdge()||(fn.isChrome()||fn.isFirefox())&&fn.isWindows()&&!t.depthTexture)&&(n=!1),this._polygonOffsetSupported=n;let i=e.depthBiasStep??1;this._terrainBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4*i},this._primitiveBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5*i},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4*i},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new M,this._shadowMapTexture=void 0,this._lightDirectionEC=new d,this._lightPositionEC=new ie,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new u5,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new le,this._isPointLight=e.isPointLight??!1,this._pointLightRadius=e.pointLightRadius??100,this._cascadesEnabled=this._isPointLight?!1:e.cascadesEnabled??!0,this._numberOfCascades=this._cascadesEnabled?e.numberOfCascades??4:0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new k,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new ua:l(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new ie,new ie],this._cascadeMatrices=[new M,new M,new M,new M],this._cascadeDistances=new ie;let o;this._isPointLight?o=6:this._cascadesEnabled?o=this._numberOfCascades:o=1,this._passes=new Array(o);for(let r=0;r<o;++r)this._passes[r]=new yTt(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,dte(this),this._clearCommand=new fi({depth:1,color:new z}),this._clearPassState=new Wc(t),this._size=e.size??2048,this.size=this._size}fA.MAXIMUM_DISTANCE=2e4;function yTt(e){this.camera=new u5,this.passState=new Wc(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function fte(e,t){return Ve.fromCache({cull:{enabled:!0,face:Ni.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 dte(e){let t=!e._usesDepthTexture;e._primitiveRenderState=fte(t,e._primitiveBias),e._terrainRenderState=fte(t,e._terrainBias),e._pointRenderState=fte(t,e._pointBias)}fA.prototype.debugCreateRenderStates=function(){dte(this)};Object.defineProperties(fA.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){TTt(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 hte(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 CTt(e,t){let n=new lf({context:t,width:e._textureSize.x,height:e._textureSize.y,format:wl.DEPTH_COMPONENT16}),i=new Dt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:qe.RGBA,pixelDatatype:He.UNSIGNED_BYTE,sampler:jt.NEAREST}),o=new la({context:t,depthRenderbuffer:n,colorTextures:[i],destroyAttachments:!1}),r=e._passes.length;for(let a=0;a<r;++a){let s=e._passes[a];s.framebuffer=o,s.passState.framebuffer=o}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function ETt(e,t){let n=new Dt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:qe.DEPTH_STENCIL,pixelDatatype:He.UNSIGNED_INT_24_8,sampler:jt.NEAREST}),i=new la({context:t,depthStencilTexture:n,destroyAttachments:!1}),o=e._passes.length;for(let r=0;r<o;++r){let a=e._passes[r];a.framebuffer=i,a.passState.framebuffer=i}e._shadowMapTexture=n,e._depthAttachment=n}function bTt(e,t){let n=new lf({context:t,width:e._textureSize.x,height:e._textureSize.y,format:wl.DEPTH_COMPONENT16}),i=new Kr({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:qe.RGBA,pixelDatatype:He.UNSIGNED_BYTE,sampler:jt.NEAREST}),o=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let r=0;r<6;++r){let a=new la({context:t,depthRenderbuffer:n,colorTextures:[o[r]],destroyAttachments:!1}),s=e._passes[r];s.framebuffer=a,s.passState.framebuffer=a}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function _we(e,t){e._isPointLight?bTt(e,t):e._usesDepthTexture?ETt(e,t):CTt(e,t)}function ITt(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==ee.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,dte(e),hte(e),_we(e,t))}function xTt(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(hte(e),_we(e,t),ITt(e,t),ywe(e,t))}function ywe(e,t,n){n=n??0,(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function TTt(e,t){e._size=t;let n=e._passes,i=n.length,o=e._textureSize;if(e._isPointLight){t=Rt.maximumCubeMapSize>=t?t:Rt.maximumCubeMapSize,o.x=t,o.y=t;let r=new et(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=Rt.maximumTextureSize>=t?t:Rt.maximumTextureSize,o.x=t,o.y=t,n[0].passState.viewport=new et(0,0,t,t)):i===4&&(t=Rt.maximumTextureSize>=t*2?t:Rt.maximumTextureSize/2,o.x=t*2,o.y=t*2,n[0].passState.viewport=new et(0,0,t,t),n[1].passState.viewport=new et(t,0,t,t),n[2].passState.viewport=new et(0,t,t,t),n[3].passState.viewport=new et(t,t,t,t));e._clearPassState.viewport=new et(0,0,o.x,o.y);for(let r=0;r<i;++r){let a=n[r],s=a.passState.viewport,c=s.x/o.x,u=s.y/o.y,f=s.width/o.x,h=s.height/o.y;a.textureOffsets=new M(f,0,0,c,0,h,0,u,0,0,1,0,0,0,0,1)}}var STt=new et;function wTt(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=Be.OVERLAY,i}function BTt(e,t){let n=t.context,i=t.context.drawingBufferWidth,o=t.context.drawingBufferHeight,r=Math.min(i,o)*.3,a=STt;a.x=i-r,a.y=0,a.width=r,a.height=r;let s=e._debugShadowViewCommand;l(s)||(s=wTt(e,n),e._debugShadowViewCommand=s),(!l(s.renderState)||!et.equals(s.renderState.viewport,a))&&(s.renderState=Ve.fromCache({viewport:et.clone(a)})),t.commandList.push(e._debugShadowViewCommand)}var dA=new Array(8);dA[0]=new ie(-1,-1,-1,1);dA[1]=new ie(1,-1,-1,1);dA[2]=new ie(1,1,-1,1);dA[3]=new ie(-1,1,-1,1);dA[4]=new ie(-1,-1,1,1);dA[5]=new ie(1,-1,1,1);dA[6]=new ie(1,1,1,1);dA[7]=new ie(-1,1,1,1);var $C=new M,mte=new Array(8);for(let e=0;e<8;++e)mte[e]=new ie;function DTt(e,t){let n=new Mt({geometry:new Rh({minimum:new d(-.5,-.5,-.5),maximum:new d(.5,.5,.5)}),attributes:{color:Jt.fromColor(t)}}),i=new Mt({geometry:new Hg({radius:.5}),attributes:{color:Jt.fromColor(t)}});return new Nn({geometryInstances:[n,i],appearance:new gn({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var vTt=[z.RED,z.GREEN,z.BLUE,z.MAGENTA],PTt=new d;function RTt(e,t){BTt(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 aA({camera:e._sceneCamera,color:z.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new aA({camera:e._shadowMapCamera,color:z.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 aA({camera:e._passes[i].camera,color:vTt[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!l(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,o=Qe.IDENTITY,r=e._pointLightRadius*2,a=d.fromElements(r,r,r,PTt),s=M.fromTranslationQuaternionRotationScale(i,o,a,$C);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=DTt(s,z.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new aA({camera:e._shadowMapCamera,color:z.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function u5(){this.viewMatrix=new M,this.inverseViewMatrix=new M,this.frustum=void 0,this.positionCartographic=new me,this.positionWC=new d,this.directionWC=d.clone(d.UNIT_Z),this.upWC=d.clone(d.UNIT_Y),this.rightWC=d.clone(d.UNIT_X),this.viewProjectionMatrix=new M}u5.prototype.clone=function(e){M.clone(e.viewMatrix,this.viewMatrix),M.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),me.clone(e.positionCartographic,this.positionCartographic),d.clone(e.positionWC,this.positionWC),d.clone(e.directionWC,this.directionWC),d.clone(e.upWC,this.upWC),d.clone(e.rightWC,this.rightWC)};var MTt=new M(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);u5.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return M.multiply(t,e,this.viewProjectionMatrix),M.multiply(MTt,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var NTt=new Array(5),LTt=new Vi,OTt=new Array(4),Cwe=new d,Ewe=new d;function FTt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=i.frustum.near,r=i.frustum.far,a=e._numberOfCascades,s,c=r-o,u=r/o,f=.9,h=!1;t.shadowState.closestObjectSize<200&&(h=!0,f=.9);let p=OTt,A=NTt;for(A[0]=o,A[a]=r,s=0;s<a;++s){let L=(s+1)/a,g=o*Math.pow(u,L),I=o+c*L,T=D.lerp(I,g,f);A[s+1]=T,p[s]=T-A[s]}if(h){for(s=0;s<a;++s)p[s]=Math.min(p[s],e._maximumCascadeDistances[s]);let L=A[0];for(s=0;s<a-1;++s)L+=p[s],A[s+1]=L}ie.unpack(A,0,e._cascadeSplits[0]),ie.unpack(A,1,e._cascadeSplits[1]),ie.unpack(p,0,e._cascadeDistances);let m=n.frustum,_=m.left,y=m.right,C=m.bottom,E=m.top,b=m.near,x=m.far,S=n.positionWC,B=n.directionWC,v=n.upWC,P=i.frustum.clone(LTt),N=n.getViewProjection();for(s=0;s<a;++s){P.near=A[s],P.far=A[s+1];let L=M.multiply(P.projectionMatrix,i.viewMatrix,$C),g=M.inverse(L,$C),I=M.multiply(N,g,$C),T=d.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Cwe),w=d.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Ewe);for(let U=0;U<8;++U){let Q=ie.clone(dA[U],mte[U]);M.multiplyByVector(I,Q,Q),d.divideByScalar(Q,Q.w,Q),d.minimumByComponent(Q,T,T),d.maximumByComponent(Q,w,w)}T.x=Math.max(T.x,0),T.y=Math.max(T.y,0),T.z=0,w.x=Math.min(w.x,1),w.y=Math.min(w.y,1),w.z=Math.min(w.z,1);let R=e._passes[s],O=R.camera;O.clone(n);let G=O.frustum;G.left=_+T.x*(y-_),G.right=_+w.x*(y-_),G.bottom=C+T.y*(E-C),G.top=C+w.y*(E-C),G.near=b+T.z*(x-b),G.far=b+w.z*(x-b),R.cullingVolume=O.frustum.computeCullingVolume(S,B,v);let F=e._cascadeMatrices[s];M.multiply(O.getViewProjection(),i.inverseViewMatrix,F),M.multiply(R.textureOffsets,F,F)}}var QTt=new M,kTt=new d,UTt=new d,Awe=new d;function zTt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=M.multiply(i.frustum.projectionMatrix,i.viewMatrix,$C),r=M.inverse(o,$C),a=n.directionWC,s=i.directionWC;d.equalsEpsilon(a,s,D.EPSILON10)&&(s=i.upWC);let c=d.cross(a,s,kTt);s=d.cross(c,a,UTt),d.normalize(s,s),d.normalize(c,c);let u=d.fromElements(0,0,0,Awe),f=M.computeView(u,a,s,c,QTt),h=M.multiply(f,r,$C),p=d.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Cwe),A=d.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Ewe);for(let x=0;x<8;++x){let S=ie.clone(dA[x],mte[x]);M.multiplyByVector(h,S,S),d.divideByScalar(S,S.w,S),d.minimumByComponent(S,p,p),d.maximumByComponent(S,A,A)}A.z+=1e3,p.z-=10;let m=Awe;m.x=-(.5*(p.x+A.x)),m.y=-(.5*(p.y+A.y)),m.z=-A.z;let _=M.fromTranslation(m,$C);f=M.multiply(_,f,f);let y=.5*(A.x-p.x),C=.5*(A.y-p.y),E=A.z-p.z,b=n.frustum;b.left=-y,b.right=y,b.bottom=-C,b.top=C,b.near=.01,b.far=E,M.clone(f,n.viewMatrix),M.inverse(f,n.inverseViewMatrix),M.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),d.clone(a,n.directionWC),d.clone(s,n.upWC),d.clone(c,n.rightWC)}var GTt=[new d(-1,0,0),new d(0,-1,0),new d(0,0,-1),new d(1,0,0),new d(0,1,0),new d(0,0,1)],VTt=[new d(0,-1,0),new d(0,0,-1),new d(0,-1,0),new d(0,-1,0),new d(0,0,1),new d(0,-1,0)],HTt=[new d(0,0,1),new d(1,0,0),new d(-1,0,0),new d(0,0,-1),new d(1,0,0),new d(1,0,0)];function WTt(e,t){let n=new Vi;n.fov=D.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=GTt[i],o.upWC=VTt[i],o.rightWC=HTt[i],M.computeView(o.positionWC,o.directionWC,o.upWC,o.rightWC,o.viewMatrix),M.inverse(o.viewMatrix,o.inverseViewMatrix),o.frustum=n}}var jTt=new d,YTt=new d,bwe=new le,gwe=bwe.center;function qTt(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,o=bwe;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let r=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,jTt),a=d.negate(i.directionWC,YTt),s=d.dot(r,a);if(e.fadingEnabled){let c=D.clamp(s/.1,0,1);e._darkness=D.lerp(1,e.darkness,c)}else e._darkness=e.darkness;if(s<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)===Xt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),le.clone(o,e._boundingSphere);else{let r=i.frustum.far/2,a=d.add(i.positionWC,d.multiplyByScalar(i.directionWC,r,gwe),gwe);o.center=a,o.radius=r,e._outOfView=t.cullingVolume.computeVisibility(o)===Xt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),le.clone(o,e._boundingSphere)}}function KTt(e,t){let n=t.camera,i=e._lightCamera,o=e._sceneCamera,r=e._shadowMapCamera;e._cascadesEnabled?d.clone(i.directionWC,r.directionWC):e._isPointLight?d.clone(i.positionWC,r.positionWC):r.clone(i);let a=e._lightDirectionEC;M.multiplyByPointAsVector(n.viewMatrix,r.directionWC,a),d.normalize(a,a),d.negate(a,a),M.multiplyByPoint(n.viewMatrix,r.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;let s,c;e._fitNearFar?(s=Math.min(t.shadowState.nearPlane,e.maximumDistance),c=Math.min(t.shadowState.farPlane,e.maximumDistance),c=Math.max(c,s+1)):(s=n.frustum.near,c=e.maximumDistance),e._sceneCamera=Bo.clone(n,o),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=s,e._sceneCamera.frustum.far=c,e._distance=c-s,qTt(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}fA.prototype.update=function(e){if(KTt(this,e),this._needsUpdate)if(xTt(this,e.context),this._isPointLight&&WTt(this,e),this._cascadesEnabled&&(zTt(this,e),this._numberOfCascades>1&&FTt(this,e)),this._isPointLight)this._shadowMapCullingVolume=Ka.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;M.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&RTt(this,e)};fA.prototype.updatePass=function(e,t){ywe(this,e,t)};var XTt=new k;function Iwe(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=XTt;return r.x=1/e._textureSize.x,r.y=1/e._textureSize.y,ie.fromElements(r.x,r.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return ie.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new ie,combinedUniforms2:new ie};return Pt(t,o,!1)}function JTt(e,t,n,i,o,r){let a,s,c;if(l(r)&&(a=r.shaderProgram,s=r.renderState,c=r.uniformMap),r=nt.shallowClone(n,r),r.castShadows=!0,r.receiveShadows=!1,!l(a)||o!==n.shaderProgram.id||t){let u=n.shaderProgram,f=n.pass===Be.GLOBE,h=n.pass!==Be.TRANSLUCENT,p=e._isPointLight,A=e._usesDepthTexture,m=uA.getShadowCastShaderKeyword(p,f,A,h);if(a=i.shaderCache.getDerivedShaderProgram(u,m),!l(a)){let y=u.vertexShaderSource,C=u.fragmentShaderSource,E=uA.createShadowCastVertexShader(y,p,f),b=uA.createShadowCastFragmentShader(C,p,A,h);a=i.shaderCache.createDerivedShaderProgram(u,m,{vertexShaderSource:E,fragmentShaderSource:b,attributeLocations:u._attributeLocations})}s=e._primitiveRenderState,p?s=e._pointRenderState:f&&(s=e._terrainRenderState),n.renderState.cull.enabled||(s=je(s,!1),s.cull=je(s.cull,!1),s.cull.enabled=!1,s=Ve.fromCache(s)),c=Iwe(e,n.uniformMap,f)}return r.shaderProgram=a,r.renderState=s,r.uniformMap=c,r}fA.createReceiveDerivedCommand=function(e,t,n,i,o){l(o)||(o={});let r=e.length>0,a=t.shaderProgram,s=a.vertexShaderSource,c=a.fragmentShaderSource,u=t.pass===Be.GLOBE,f=!1;if(u&&(f=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&r){let h,p;l(o.receiveCommand)&&(h=o.receiveCommand.shaderProgram,p=o.receiveCommand.uniformMap),o.receiveCommand=nt.shallowClone(t,o.receiveCommand),o.castShadows=!1,o.receiveShadows=!0;let A=o.receiveShaderCastShadows!==t.castShadows,m=o.receiveShaderProgramId!==t.shaderProgram.id;if(!l(h)||m||n||A){let _=uA.getShadowReceiveShaderKeyword(e[0],t.castShadows,u,f);if(h=i.shaderCache.getDerivedShaderProgram(a,_),!l(h)){let y=uA.createShadowReceiveVertexShader(s,u,f),C=uA.createShadowReceiveFragmentShader(c,e[0],t.castShadows,u,f);h=i.shaderCache.createDerivedShaderProgram(a,_,{vertexShaderSource:y,fragmentShaderSource:C,attributeLocations:a._attributeLocations})}p=Iwe(e[0],t.uniformMap,u)}o.receiveCommand.shaderProgram=h,o.receiveCommand.uniformMap=p,o.receiveShaderProgramId=t.shaderProgram.id,o.receiveShaderCastShadows=t.castShadows}return o};fA.createCastDerivedCommand=function(e,t,n,i,o){if(l(o)||(o={}),t.castShadows){let r=o.castCommands;l(r)||(r=o.castCommands=[]);let a=o.castShaderProgramId,s=e.length;r.length=s;for(let c=0;c<s;++c)r[c]=JTt(e[c],n,t,i,a,r[c]);o.castShaderProgramId=t.shaderProgram.id}return o};fA.prototype.isDestroyed=function(){return!1};fA.prototype.destroy=function(){hte(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 fe(this)};var v_=fA;var wI=`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 ZTt=!1;function eE(e){this._drawClassificationFBO=new Ei({createDepthAttachments:!1}),this._accumulationFBO=new Ei({createDepthAttachments:!1}),this._packFBO=new Ei,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 fi({color:new z(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new fi({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new et,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(eE.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function xwe(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function Twe(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function $Tt(e,t,n,i){xwe(e),e._translucentDepthStencilTexture=new Dt({context:t,width:n,height:i,pixelFormat:qe.DEPTH_STENCIL,pixelDatatype:He.UNSIGNED_INT_24_8,sampler:jt.NEAREST})}function eSt(e,t,n,i){Twe(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 tSt(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)&&($Tt(e,t,o,r),eSt(e,t,o,r));let a,s;if(l(e._packDepthCommand)||(a=new We({sources:[lk]}),s={u_opaqueDepthTexture:function(){return e._opaqueDepthStencilTexture},u_translucentDepthTexture:function(){return e._translucentDepthStencilTexture}},e._packDepthCommand=t.createViewportQuadCommand(a,{uniformMap:s,owner:e})),!l(e._compositeCommand)){a=new We({sources:[wI]}),s={colorTexture:function(){return e._textureToComposite}},ZTt&&(a.defines=["DEBUG_SHOW_DEPTH"],s.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(a,{uniformMap:s,owner:e});let f=e._compositeCommand,h=f.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(h,"pick",{vertexShaderSource:h.vertexShaderSource,fragmentShaderSource:new We({sources:a.sources,defines:["PICK"]}),attributeLocations:h._attributeLocations}),A=nt.shallowClone(f);A.shaderProgram=p,f.derivedCommands.pick=A}l(e._copyCommand)||(a=new We({sources:[wI]}),s={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(a,{uniformMap:s,owner:e})),l(e._accumulateCommand)||(a=new We({sources:[wI]}),s={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._accumulateCommand=t.createViewportQuadCommand(a,{uniformMap:s,owner:e})),e._viewport.width=o,e._viewport.height=r;let c=!et.equals(e._viewport,n.viewport),u=c!==e._useScissorTest;e._useScissorTest=c,et.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=et.clone(n.viewport,e._scissorRectangle),u=!0),(!l(e._rsDepth)||!et.equals(e._viewport,e._rsDepth.viewport)||u)&&(e._rsDepth=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!l(e._rsAccumulate)||!et.equals(e._viewport,e._rsAccumulate.viewport)||u)&&(e._rsAccumulate=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:ti.EQUAL,reference:Yt.CESIUM_3D_TILE_MASK}})),l(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!l(e._rsComp)||!et.equals(e._viewport,e._rsComp.viewport)||u)&&(e._rsComp=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:sn.ALPHA_BLEND})),l(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}eE.prototype.executeTranslucentCommands=function(e,t,n,i,o){let r=e.frameState.useLogDepth,a=e.context,s=n.framebuffer;for(let c=0;c<i.length;++c){let u=i[c];if(u=r?u.derivedCommands.logDepth.command:u,u.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}}if(this._hasTranslucentDepth){tSt(this,a,n,o),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(a,n);for(let c=0;c<i.length;++c){let u=i[c];if(u=r?u.derivedCommands.logDepth.command:u,!u.depthForTranslucentClassification)continue;let f=u.derivedCommands.depth.depthOnlyCommand;t(f,e,n)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(n.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(a,n)),n.framebuffer=s}};eE.prototype.executeClassificationCommands=function(e,t,n,i){if(!this._hasTranslucentDepth)return;let o=e.context,r=o.uniformState,a=n.framebuffer;n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=this._drawClassificationFBO.framebuffer,this._frustumsDrawn>1&&this._clearColorCommand.execute(o,n),r.updatePass(Be.CESIUM_3D_TILE_CLASSIFICATION);let s=r.globeDepthTexture;r.globeDepthTexture=this._packFBO.getColorTexture();let c=i.commands[Be.CESIUM_3D_TILE_CLASSIFICATION],u=i.indices[Be.CESIUM_3D_TILE_CLASSIFICATION];for(let f=0;f<u;++f)t(c[f],e,n);r.globeDepthTexture=s,n.framebuffer=a,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=a)};eE.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),nSt(this,e,t)};function nSt(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}eE.prototype.isSupported=function(){return this._supported};eE.prototype.isDestroyed=function(){return!1};eE.prototype.destroy=function(){return xwe(this),Twe(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()),fe(this)};var d3=eE;function iSt(){this.command=void 0,this.near=void 0,this.far=void 0}function f5(e,t,n){let i=e.context,o;i.depthTexture&&(o=new a3);let r;e._useOIT&&i.depthTexture&&(r=new c3(i));let a=new Wc(i);a.viewport=et.clone(n),this.camera=t,this._cameraClone=Bo.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=a,this.pickFramebuffer=new f3(i),this.pickDepthFramebuffer=new u3,this.sceneFramebuffer=new TI,this.edgeFramebuffer=new o3,this.globeDepth=o,this.globeTranslucencyFramebuffer=new s3,this.oit=r,this.translucentTileClassification=new d3(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var pte=new d,Ate=new d;function oSt(e,t,n){let i=Math.max(d.maximumComponent(d.abs(e.position,pte)),d.maximumComponent(d.abs(t.position,Ate))),o=1/Math.max(1,i);return d.multiplyByScalar(e.position,o,pte),d.multiplyByScalar(t.position,o,Ate),d.equalsEpsilon(pte,Ate,n)&&d.equalsEpsilon(e.direction,t.direction,n)&&d.equalsEpsilon(e.up,t.up,n)&&d.equalsEpsilon(e.right,t.right,n)&&M.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}f5.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return oSt(t,n,D.EPSILON15)?(this._cameraStartFired&&Fi()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=Fi(),Bo.clone(t,n),!0)};function rSt(e,t,n,i){let{frameState:o}=t,{camera:r,useLogDepth:a}=o,s=a?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,c=t.mode===oe.SCENE2D,u=t.nearToFarDistance2D;i*=1+D.EPSILON2,n=Math.min(Math.max(n,r.frustum.near),r.frustum.far),i=Math.max(Math.min(i,r.frustum.far),n),isNaN(n)&&(n=r.frustum.near),isNaN(i)&&(i=r.frustum.far);let f;c?(i=Math.min(i,r.position.z+t.nearToFarDistance2D),n=Math.min(n,i),f=Math.ceil(Math.max(1,i-n)/t.nearToFarDistance2D)):f=Math.ceil(Math.log(i/n)/Math.log(s));let{frustumCommandsList:h}=e;h.length=f;for(let p=0;p<f;++p){let A,m;c?(A=Math.min(i-u,n+p*u),m=Math.min(i,A+u)):(A=Math.max(n,Math.pow(s,p)*n),m=Math.min(i,s*A));let _=h[p];l(_)?(_.near=A,_.far=m):_=h[p]=new r3(A,m)}}function aSt(e,t,n){let{command:i,near:o,far:r}=n;t.debugShowFrustums&&(i.debugOverlappingFrustums=0);let{frustumCommandsList:a}=e;for(let s=0;s<a.length;++s){let c=a[s];if(o>c.far)continue;if(r<c.near)break;let u=i.pass,f=c.indices[u]++;if(c.commands[u][f]=i,t.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<s),i.executeInClosestFrustum)break}if(t.debugShowFrustums){let{debugFrustumStatistics:s}=e,{debugOverlappingFrustums:c}=i,u=s.commandsInFrustums;u[c]=l(u[c])?u[c]+1:1,++s.totalCommands}t.updateDerivedCommands(i)}var Swe=new Ka,sSt=new qr;f5.prototype.createPotentiallyVisibleSet=function(e){let{frameState:t}=e,{camera:n,commandList:i,shadowState:o}=t,{positionWC:r,directionWC:a,frustum:s}=n,c=e._computeCommandList,u=e._overlayCommandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let f=this.frustumCommandsList;for(let N=0;N<f.length;++N)for(let L=0;L<Be.NUMBER_OF_PASSES;++L)f[N].indices[L]=0;c.length=0,u.length=0;let h=this._commandExtents,p=h.length,A=0,m=+Number.MAX_VALUE,_=-Number.MAX_VALUE,{shadowsEnabled:y}=o,C=+Number.MAX_VALUE,E=-Number.MAX_VALUE,b=Number.MAX_VALUE,x=t.mode===oe.SCENE3D?t.occluder:void 0,{cullingVolume:S}=t,B=Swe.planes;for(let N=0;N<5;++N)B[N]=S.planes[N];S=Swe;for(let N=0;N<i.length;++N){let L=i[N],{pass:g,boundingVolume:I}=L;if(g===Be.COMPUTE)c.push(L);else if(g===Be.OVERLAY)u.push(L);else{let T,w;if(l(I)){if(!e.isVisible(S,L,x))continue;let O=I.computePlaneDistances(r,a,sSt);if(T=O.start,w=O.stop,m=Math.min(m,T),_=Math.max(_,w),y&&L.receiveShadows&&T<v_.MAXIMUM_DISTANCE&&!(g===Be.GLOBE&&T<-100&&w>100)){let G=w-T;g!==Be.GLOBE&&T<100&&(b=Math.min(b,G)),C=Math.min(C,T),E=Math.max(E,w)}}else L instanceof fi?(T=s.near,w=s.far):(T=s.near,w=s.far,m=Math.min(m,T),_=Math.max(_,w));let R=h[A];l(R)||(R=h[A]=new iSt),R.command=L,R.near=T,R.far=w,A++}}y&&(C=Math.min(Math.max(C,s.near),s.far),E=Math.max(Math.min(E,s.far),C),o.nearPlane=C,o.farPlane=E,o.closestObjectSize=b),rSt(this,e,m,_);for(let N=0;N<A;N++)aSt(this,e,h[N]);if(A<p)for(let N=A;N<p;N++){let L=h[N];if(!l(L.command))break;L.command=void 0}let v=f.length,{frustumSplits:P}=t;P.length=v+1;for(let N=0;N<v;++N)P[N]=f[N].near,N===v-1&&(P[N+1]=f[N].far)};f5.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.edgeFramebuffer=this.edgeFramebuffer&&this.edgeFramebuffer.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=this.pickDepths;for(let t=0;t<e.length;++t)e[t].destroy()};var BI=f5;var Bwe=.1,cSt=new lh({pass:cr.MOST_DETAILED_PRELOAD}),lSt=new lh({pass:cr.MOST_DETAILED_PICK}),h3=new lh({pass:cr.PICK});function xs(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new et(0,0,1,1),n=new Bo(e);n.frustum=new An({width:Bwe,aspectRatio:1,near:.1}),this._pickOffscreenView=new BI(e,n,t)}xs.prototype.update=function(){this._pickPositionCacheDirty=!0};xs.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return l(i)||(i=new i3,n[t]=i),i};var uSt=new ua,fSt=new d,d5=new d,dSt=new k,hSt=new M;function mSt(e,t,n,i,o){let r=e.camera,a=r.frustum,s=a.offCenterFrustum;l(s)&&(a=s);let c=2*(t.x-o.x)/o.width-1;c*=(a.right-a.left)*.5;let u=2*(o.height-t.y-o.y)/o.height-1;u*=(a.top-a.bottom)*.5;let f=M.clone(r.transform,hSt);r._setTransform(M.IDENTITY);let h=d.clone(r.position,fSt);d.multiplyByScalar(r.right,c,d5),d.add(d5,h,h),d.multiplyByScalar(r.up,u,d5),d.add(d5,h,h),r._setTransform(f),e.mode===oe.SCENE2D&&d.fromElements(h.z,h.x,h.y,h);let p=a.getPixelDimensions(o.width,o.height,1,1,dSt),A=uSt;return A.right=p.x*.5,A.left=-A.right,A.top=p.y*.5,A.bottom=-A.top,A.near=a.near,A.far=a.far,A.computeCullingVolume(h,r.directionWC,r.upWC)}var pSt=new lu,ASt=new k;function gSt(e,t,n,i,o){let r=e.camera,a=r.frustum,s=a.near,c=Math.tan(a.fovy*.5),u=a.aspectRatio*c,f=2*(t.x-o.x)/o.width-1,h=2*(o.height-t.y-o.y)/o.height-1,p=f*s*u,A=h*s*c,m=a.getPixelDimensions(o.width,o.height,1,1,ASt),_=m.x*n*.5,y=m.y*i*.5,C=pSt;return C.top=A+y,C.bottom=A-y,C.right=p+_,C.left=p-_,C.near=s,C.far=a.far,C.computeCullingVolume(r.positionWC,r.directionWC,r.upWC)}function h5(e,t,n,i,o){let r=e.camera.frustum;return r instanceof An||r instanceof ua?mSt(e,t,n,i,o):gSt(e,t,n,i,o)}var m3=new et(0,0,3,3),m5=new k,p3=new z(0,0,0,0);function gte(e,t,n,i,o){return o.width=n??3,o.height=i??o.width,o.x=t.x-(o.width-1)*.5,o.y=e-t.y-(o.height-1)*.5,o}function Dwe(e,t,n,i,o){let{context:r,frameState:a,defaultView:s}=e,{viewport:c,pickFramebuffer:u}=s;e.view=s,c.x=0,c.y=0,c.width=r.drawingBufferWidth,c.height=r.drawingBufferHeight;let f=s.passState;f.viewport=et.clone(c,f.viewport);let h=so.transformWindowToDrawingBuffer(e,t,m5);gte(r.drawingBufferHeight,h,i,o,n),e.jobScheduler.disableThisFrame(),e.updateFrameState(),a.cullingVolume=h5(e,h,n.width,n.height,c),a.invertClassification=!1,a.passes.pick=!0,a.tilesetPassState=h3,r.uniformState.update(a),e.updateEnvironment(),f=u.begin(n,c),e.updateAndExecuteCommands(f,p3),e.resolveFramebuffers(f)}function vwe(e){let{context:t}=e;t.endFrame()}xs.prototype.pickAsync=async function(e,t,n,i,o=1){let{context:r,frameState:a,defaultView:s}=e,{pickFramebuffer:c}=s,u=m3;Dwe(e,t,u,n,i);let f;return r.webgl2?f=c.endAsync(u,a,o):(f=c.end(u,o),f=Promise.resolve(f),It("picking-async-fallback","Fallback to synchronous picking because async operation requires WebGL2 context.")),vwe(e),f};xs.prototype.pick=function(e,t,n,i,o=1){let{defaultView:r}=e,{pickFramebuffer:a}=r,s=m3;Dwe(e,t,s,n,i);let c=a.end(s,o);return vwe(e),c};xs.prototype.pickVoxelCoordinate=function(e,t,n,i){let{context:o,frameState:r,defaultView:a}=e,{viewport:s,pickFramebuffer:c}=a;e.view=a,s.x=0,s.y=0,s.width=o.drawingBufferWidth,s.height=o.drawingBufferHeight;let u=a.passState;u.viewport=et.clone(s,u.viewport);let f=so.transformWindowToDrawingBuffer(e,t,m5),h=gte(o.drawingBufferHeight,f,n,i,m3);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=h5(e,f,h.width,h.height,s),r.invertClassification=!1,r.passes.pickVoxel=!0,r.tilesetPassState=h3,o.uniformState.update(r),e.updateEnvironment(),u=c.begin(h,s),e.updateAndExecuteCommands(u,p3),e.resolveFramebuffers(u);let p=c.readCenterPixel(h);return o.endFrame(),p};xs.prototype.pickMetadata=function(e,t,n){let{context:i,frameState:o,defaultView:r}=e,{viewport:a,pickFramebuffer:s}=r;e.view=r,a.x=0,a.y=0,a.width=i.drawingBufferWidth,a.height=i.drawingBufferHeight;let c=r.passState;c.viewport=et.clone(a,c.viewport);let u=so.transformWindowToDrawingBuffer(e,t,m5),f=gte(i.drawingBufferHeight,u,1,1,m3);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=h5(e,u,f.width,f.height,a),o.invertClassification=!1,o.passes.pick=!0,o.tilesetPassState=h3,o.pickingMetadata=!0,o.pickedMetadataInfo=n,i.uniformState.update(o),e.updateEnvironment(),c=s.begin(f,a),e.updateAndExecuteCommands(c,p3);let h=e._environmentState.useOIT;e._environmentState.useOIT=!1,e.resolveFramebuffers(c),e._environmentState.useOIT=h;let p=s.readCenterPixel(f);return i.endFrame(),o.pickingMetadata=!1,n3.decodeMetadataValues(n.classProperty,n.metadataProperty,p)};function _St(e,t){let{defaultView:n,context:i,frameState:o,environmentState:r}=e,{viewport:a,pickDepthFramebuffer:s}=n;e.view=n,a.x=0,a.y=0,a.width=i.drawingBufferWidth,a.height=i.drawingBufferHeight;let c=n.passState;c.viewport=et.clone(a,c.viewport),e.clearPasses(o.passes),o.passes.pick=!0,o.passes.depth=!0,o.cullingVolume=h5(e,t,1,1,a),o.tilesetPassState=h3,e.updateEnvironment(),r.renderTranslucentDepthForPick=!0,c=s.update(i,t,a),e.updateAndExecuteCommands(c,p3),e.resolveFramebuffers(c),i.endFrame()}var ySt=new Vi,CSt=new lu,ESt=new An,bSt=new ua;xs.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 d.clone(this._pickPositionCache[i],n);let{context:o,frameState:r,camera:a,defaultView:s}=e,{uniformState:c}=o;e.view=s;let u=so.transformWindowToDrawingBuffer(e,t,m5);e.pickTranslucentDepth?_St(e,u):(e.updateFrameState(),c.update(r),e.updateEnvironment()),u.y=e.drawingBufferHeight-u.y;let f;l(a.frustum.fov)?f=a.frustum.clone(ySt):l(a.frustum.infiniteProjectionMatrix)?f=a.frustum.clone(CSt):l(a.frustum.width)?f=a.frustum.clone(ESt):f=a.frustum.clone(bSt);let{frustumCommandsList:h}=s,p=h.length;for(let A=0;A<p;++A){let _=this.getPickDepth(e,A).getDepth(o,u.x,u.y);if(l(_)&&_>0&&_<1){let y=h[A],C;return e.mode===oe.SCENE2D?(C=a.position.z,a.position.z=C-y.near+1,f.far=Math.max(1,y.far-y.near),f.near=1,c.update(r),c.updateFrustum(f)):(f.near=y.near*(A!==0?e.opaqueFrustumNearOffset:1),f.far=y.far,c.updateFrustum(f)),n=so.drawingBufferToWorldCoordinates(e,u,_,n),e.mode===oe.SCENE2D&&(a.position.z=C,c.update(r)),this._pickPositionCache[i]=d.clone(n),n}}this._pickPositionCache[i]=void 0};var ISt=new me;xs.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),l(n)&&e.mode!==oe.SCENE3D){d.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,o=i.ellipsoid,r=i.unproject(n,ISt);o.cartographicToCartesian(r,n)}return n};function xSt(e,t,n,i,o,r){for(let a of e){let s=a.object,c=a.position,u=a.exclude;if(l(c)&&!l(s))return n.push(a),!0;if(!l(s)||!l(s.primitive)||!u&&(n.push(a),n.length>=t))return!0;let f=s.primitive,h=!1;if(typeof f.getGeometryInstanceAttributes=="function"&&l(s.id)){let p=f.getGeometryInstanceAttributes(s.id);l(p)&&l(p.show)&&(h=!0,p.show=Sn.toValue(!1,p.show),o.push(p))}s instanceof Ns&&(h=!0,s.show=!1,r.push(s)),h||(f.show=!1,i.push(f))}}function Pwe(e,t){let n=[],i=[],o=[],r=[];l(t)||(t=Number.MAX_VALUE);let a=e(t);for(;l(a)&&a.length>0&&!xSt(a,t,n,i,o,r);)a=e(t-n.length);for(let s=0;s<i.length;++s)i[s].show=!0;for(let s=0;s<o.length;++s){let c=o[s];c.show=Sn.toValue(!0,c.show)}for(let s=0;s<r.length;++s)r[s].show=!0;return n}xs.prototype.drillPick=function(e,t,n,i,o){return Pwe(s=>this.pick(e,t,i,o,s).map(u=>({object:u,position:void 0,exclude:!1})),n).map(s=>s.object)};var wwe=new d,TSt=new d;function SSt(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 Rwe(e,t,n,i){let o=t.direction,r=d.mostOrthogonalAxis(o,wwe),a=d.cross(o,r,wwe),s=d.cross(o,a,TSt);return i.position=t.origin,i.direction=o,i.up=s,i.right=a,i.frustum.width=n??Bwe,i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function wSt(e,t,n){let i=t.frameState,{ray:o,width:r,tilesets:a}=n,s=e._pickOffscreenView.camera,c=Rwe(e,o,r,s),u=cSt;u.camera=s,u.cullingVolume=c;let f=!0,h=a.length;for(let p=0;p<h;++p){let A=a[p];A.show&&t.primitives.contains(A)&&(A.updateForPass(i,u),f=f&&u.ready)}return f&&n._completePick(),f}xs.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)wSt(this,e,t[n])&&t.splice(n--,1)};function Mwe(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 ou&&Mwe(o,t,n))}}function p5(e,t,n,i,o,r){let a=[];if(Mwe(t.primitives,i,a),a.length===0)return Promise.resolve(r());let s=new SSt(n,o,a);return e._mostDetailedRayPicks.push(s),s.promise.then(function(){return r()})}function BSt(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 DSt(e,t,n,i,o,r,a){let{context:s,frameState:c}=t,u=s.uniformState,f=e._pickOffscreenView;t.view=f,Rwe(e,n,o,f.camera);let h=et.clone(f.viewport,m3),p=f.pickFramebuffer.begin(h,f.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),c.invertClassification=!1,c.passes.pick=!0,c.passes.offscreen=!0,a?c.tilesetPassState=lSt:c.tilesetPassState=h3,u.update(c),t.updateEnvironment(),t.updateAndExecuteCommands(p,p3),t.resolveFramebuffers(p);let A,m=f.pickFramebuffer.end(h,1)[0];if(t.context.depthTexture){let{frustumCommandsList:_}=f,y=_.length;for(let C=0;C<y;++C){let b=e.getPickDepth(t,C).getDepth(s,0,0);if(l(b)&&b>0&&b<1){let x=_[C],S=x.near*(C!==0?t.opaqueFrustumNearOffset:1),B=x.far,v=S+b*(B-S);A=yn.getPoint(n,v);break}}}if(t.view=t.defaultView,s.endFrame(),l(m)||l(A))return{object:m,position:A,exclude:!l(A)&&r||BSt(m,i)}}function _te(e,t,n,i,o,r,a,s){return Pwe(function(){let u=DSt(e,t,n,o,r,a,s);return u?[u]:void 0},i)}function hB(e,t,n,i,o,r,a){let s=_te(e,t,n,1,i,o,r,a);if(s.length>0)return s[0]}function A5(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)})})}xs.prototype.pickFromRay=function(e,t,n,i){return hB(this,e,t,n,i,!1,!1)};xs.prototype.drillPickFromRay=function(e,t,n,i,o){return _te(this,e,t,n,i,o,!1,!1)};xs.prototype.pickFromRayMostDetailed=function(e,t,n,i){let o=this;return t=yn.clone(t),n=l(n)?n.slice():n,A5(e,p5(o,e,t,n,i,function(){return hB(o,e,t,n,i,!1,!0)}))};xs.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,o){let r=this;return t=yn.clone(t),i=l(i)?i.slice():i,A5(e,p5(r,e,t,i,o,function(){return _te(r,e,t,n,i,o,!1,!0)}))};var vSt=new d,PSt=new d,RSt=new yn,Nwe=new me;function yte(e,t){let n=e.ellipsoid,i=Di._defaultMaxTerrainHeight,o=n.geodeticSurfaceNormalCartographic(t,PSt),r=me.toCartesian(t,n,vSt),a=RSt;a.origin=r,a.direction=o;let s=new yn;return yn.getPoint(a,i,s.origin),d.negate(o,s.direction),s}function Lwe(e,t){let n=e.ellipsoid,i=me.fromCartesian(t,n,Nwe);return yte(e,i)}function Owe(e,t){let n=e.ellipsoid;return me.fromCartesian(t,n,Nwe).height}function MSt(e,t,n,i,o){let r=yte(t,n);return p5(e,t,r,i,o,function(){let a=hB(e,t,r,i,o,!0,!0);if(l(a))return Owe(t,a.position)})}function NSt(e,t,n,i,o,r){let a=Lwe(t,n);return p5(e,t,a,i,o,function(){let s=hB(e,t,a,i,o,!0,!0);if(l(s))return d.clone(s.position,r)})}xs.prototype.sampleHeight=function(e,t,n,i){let o=yte(e,t),r=hB(this,e,o,n,i,!0,!1);if(l(r))return Owe(e,r.position)};xs.prototype.clampToHeight=function(e,t,n,i,o){let r=Lwe(e,t),a=hB(this,e,r,n,i,!0,!1);if(l(a))return d.clone(a.position,o)};xs.prototype.sampleHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let o=t.length,r=new Array(o);for(let a=0;a<o;++a)r[a]=MSt(this,e,t[a],n,i);return A5(e,Promise.all(r).then(function(a){let s=a.length;for(let c=0;c<s;++c)t[c].height=a[c];return t}))};xs.prototype.clampToHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let o=t.length,r=new Array(o);for(let a=0;a<o;++a)r[a]=NSt(this,e,t[a],n,i,t[a]);return A5(e,Promise.all(r).then(function(a){let s=a.length;for(let c=0;c<s;++c)t[c]=a[c];return t}))};xs.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var A3=xs;var g3=`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 _3=`precision highp float;
uniform sampler2D randomTexture;
uniform sampler2D depthTexture;
uniform float intensity;
uniform float bias;
uniform float lengthCap;
uniform int stepCount;
uniform int directionCount;
vec4 pixelToEye(vec2 screenCoordinate)
{
vec2 uv = screenCoordinate / czm_viewport.zw;
float depth = czm_readDepth(depthTexture, uv);
vec2 xy = 2.0 * uv - vec2(1.0);
vec4 posEC = czm_inverseProjection * vec4(xy, depth, 1.0);
posEC = posEC / posEC.w;
// Avoid numerical error at far plane
if (depth >= 1.0) {
posEC.z = czm_currentFrustum.y;
}
return posEC;
}
// Reconstruct surface normal in eye coordinates, avoiding edges
vec3 getNormalXEdge(vec3 positionEC)
{
// Find the 3D surface positions at adjacent screen pixels
vec2 centerCoord = gl_FragCoord.xy;
vec3 positionLeft = pixelToEye(centerCoord + vec2(-1.0, 0.0)).xyz;
vec3 positionRight = pixelToEye(centerCoord + vec2(1.0, 0.0)).xyz;
vec3 positionUp = pixelToEye(centerCoord + vec2(0.0, 1.0)).xyz;
vec3 positionDown = pixelToEye(centerCoord + vec2(0.0, -1.0)).xyz;
// Compute potential tangent vectors
vec3 dx0 = positionEC - positionLeft;
vec3 dx1 = positionRight - positionEC;
vec3 dy0 = positionEC - positionDown;
vec3 dy1 = positionUp - positionEC;
// The shorter tangent is more likely to be on the same surface
vec3 dx = length(dx0) < length(dx1) ? dx0 : dx1;
vec3 dy = length(dy0) < length(dy1) ? dy0 : dy1;
return normalize(cross(dx, dy));
}
const float sqrtTwoPi = sqrt(czm_twoPi);
float gaussian(float x, float standardDeviation) {
float argument = x / standardDeviation;
return exp(-0.5 * argument * argument) / (sqrtTwoPi * standardDeviation);
}
void main(void)
{
vec4 positionEC = pixelToEye(gl_FragCoord.xy);
// Exit if we are too close to the back of the frustum, where the depth value is invalid.
float maxValidDepth = czm_currentFrustum.y - lengthCap;
if (-positionEC.z > maxValidDepth)
{
out_FragColor = vec4(1.0);
return;
}
vec3 normalEC = getNormalXEdge(positionEC.xyz);
float gaussianVariance = lengthCap * sqrt(-positionEC.z);
// Choose a step length such that the marching stops just before 3 * variance.
float stepLength = 3.0 * gaussianVariance / (float(stepCount) + 1.0);
float metersPerPixel = czm_metersPerPixel(positionEC, 1.0);
// Minimum step is 1 pixel to avoid double sampling
float pixelsPerStep = max(stepLength / metersPerPixel, 1.0);
stepLength = pixelsPerStep * metersPerPixel;
float angleStepScale = 1.0 / float(directionCount);
float angleStep = angleStepScale * czm_twoPi;
float cosStep = cos(angleStep);
float sinStep = sin(angleStep);
mat2 rotateStep = mat2(cosStep, sinStep, -sinStep, cosStep);
// Initial sampling direction (different for each pixel)
const float randomTextureSize = 255.0;
vec2 randomTexCoord = fract(gl_FragCoord.xy / randomTextureSize);
float randomVal = texture(randomTexture, randomTexCoord).x;
vec2 sampleDirection = vec2(cos(angleStep * randomVal), sin(angleStep * randomVal));
float ao = 0.0;
// Loop over sampling directions
#if __VERSION__ == 300
for (int i = 0; i < directionCount; i++)
{
#else
for (int i = 0; i < 16; i++)
{
if (i >= directionCount) {
break;
}
#endif
sampleDirection = rotateStep * sampleDirection;
float localAO = 0.0;
vec2 radialStep = pixelsPerStep * sampleDirection;
#if __VERSION__ == 300
for (int j = 0; j < stepCount; j++)
{
#else
for (int j = 0; j < 64; j++)
{
if (j >= stepCount) {
break;
}
#endif
// Step along sampling direction, away from output pixel
vec2 samplePixel = floor(gl_FragCoord.xy + float(j + 1) * radialStep) + vec2(0.5);
// Exit if we stepped off the screen
if (clamp(samplePixel, vec2(0.0), czm_viewport.zw) != samplePixel) {
break;
}
// Compute step vector from output point to sampled point
vec4 samplePositionEC = pixelToEye(samplePixel);
vec3 stepVector = samplePositionEC.xyz - positionEC.xyz;
// Estimate the angle from the surface normal.
float dotVal = clamp(dot(normalEC, normalize(stepVector)), 0.0, 1.0);
dotVal = czm_branchFreeTernary(dotVal > bias, dotVal, 0.0);
dotVal = czm_branchFreeTernary(-samplePositionEC.z <= maxValidDepth, dotVal, 0.0);
// Weight contribution based on the distance from the output point
float sampleDistance = length(stepVector);
float weight = gaussian(sampleDistance, gaussianVariance);
localAO += weight * dotVal;
}
ao += localAO;
}
ao *= angleStepScale * stepLength;
ao = 1.0 - clamp(ao, 0.0, 1.0);
ao = pow(ao, intensity);
out_FragColor = vec4(vec3(ao), 1.0);
}
`;var y3=`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 C3=`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 E3=`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 b3=`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 I3=`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 x3=`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 T3=`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 S3=`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 w3=`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 B3=`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 D3=`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 tE=`#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 v3=`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 P3=`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 R3=`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 M3=`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 N3=`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);
}
`;function DI(){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 Ei,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new k,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(DI.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 Fwe(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 LSt(e,t){Fwe(e);let n=e._width,i=e._height,o=t.halfFloatingPointTexture?He.HALF_FLOAT:He.FLOAT,r=Math.ceil(Math.log(Math.max(n,i))/Math.log(3)),a=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),a[c]=new Ei,a[c].update(t,n,i,1,o);let s=a[r-1].getColorTexture(0);e._previousLuminance.update(t,s.width,s.height,1,o),e._framebuffers=a}function Qwe(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 OSt(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 FSt(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 QSt(e,t){Qwe(e);let n=e._framebuffers,i=n.length,o=new Array(i);for(let r=0;r<i;++r)o[r]=t.createViewportQuadCommand(FSt(r,i),{framebuffer:n[r].framebuffer,uniformMap:OSt(e,r)});e._commands=o}DI.prototype.clear=function(e){let t=this._framebuffers;if(!l(t))return;let n=this._clearCommand;l(n)||(n=this._clearCommand=new fi({color:new z(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let o=0;o<i;++o)t[o].clear(e,n)};DI.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,LSt(this,e),QSt(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};DI.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)};DI.prototype.isDestroyed=function(){return!1};DI.prototype.destroy=function(){return Fwe(this),Qwe(this),fe(this)};var L3=DI;var kSt={NEAREST:0,LINEAR:1},Xf=kSt;function vI(e){e=e??V.EMPTY_OBJECT;let{name:t=Jn(),fragmentShader:n,uniforms:i,textureScale:o=1,forcePowerOfTwo:r=!1,sampleMode:a=Xf.NEAREST,pixelFormat:s=qe.RGBA,pixelDatatype:c=He.UNSIGNED_BYTE,clearColor:u=z.BLACK,scissorRectangle:f}=e;this._fragmentShader=n,this._uniforms=i,this._textureScale=o,this._forcePowerOfTwo=r,this._sampleMode=a,this._pixelFormat=s,this._pixelDatatype=c,this._clearColor=u,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 h=new Wc;h.scissorTest={enabled:!0,rectangle:l(f)?et.clone(f):new et},this._passState=h,this._ready=!1,this._name=t,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(vI.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 USt=/uniform\s+sampler2D\s+depthTexture/g;vI.prototype._isSupported=function(e){return!USt.test(this._fragmentShader)||e.depthTexture};function zSt(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 a=e._actualUniforms,s=a[n];l(s)&&s!==r&&s instanceof Dt&&!l(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(s),delete a[n],delete a[`${n}Dimensions`]),r instanceof Dt&&e._texturesToRelease.push(r),typeof o=="string"||o instanceof HTMLCanvasElement||o instanceof HTMLImageElement||o instanceof HTMLVideoElement||o instanceof ImageData?e._dirtyUniforms.push(n):a[n]=o}}}function GSt(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function VSt(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function HSt(e){if(l(e._uniformMap))return;let t={},n={},i=e._uniforms,o=e._actualUniforms;for(let r in i){if(!i.hasOwnProperty(r))continue;typeof i[r]!="function"?(t[r]=GSt(e,r),n[r]=zSt(e,i,r)):(t[r]=i[r],n[r]=i[r]),o[r]=i[r];let a=t[r]();(typeof a=="string"||a instanceof Dt||a instanceof HTMLImageElement||a instanceof HTMLCanvasElement||a instanceof HTMLVideoElement)&&(t[`${r}Dimensions`]=VSt(t,r))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=Pt(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 WSt(e,t){return e=e.replace(/in\s+vec2\s+v_textureCoordinates;/g,""),`#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 < ${t}; ++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));
}
${e}`}function jSt(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=WSt(n,o)}let i=new We({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function YSt(e){let t=e._sampleMode,n,i;t===Xf.LINEAR?(n=Wt.LINEAR,i=ci.LINEAR):(n=Wt.NEAREST,i=ci.NEAREST);let o=e._sampler;(!l(o)||o.minificationFilter!==n||o.magnificationFilter!==i)&&(e._sampler=new jt({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function qSt(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function KSt(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function XSt(e,t){let n=e._texturesToRelease;for(let s=0;s<n.length;++s){let c=n[s];c=c&&c.destroy()}n.length=0;let i=e._texturesToCreate;for(let s=0;s<i.length;++s){let{name:c,source:u}=i[s];e._actualUniforms[c]=new Dt({context:t,source:u})}i.length=0;let o=e._dirtyUniforms;if(o.length===0&&!l(e._texturePromise)){e._ready=!0;return}if(o.length===0||l(e._texturePromise))return;let r=e._uniforms,a=[];for(let s=0;s<o.length;++s){let c=o[s],u=r[c],f=e._textureCache.getStageByName(u);if(l(f))e._actualUniforms[c]=KSt(e,u);else if(typeof u=="string"){let h=new De({url:u});a.push(h.fetchImage().then(qSt(e,c)))}else e._texturesToCreate.push({name:c,source:u})}o.length=0,a.length>0?(e._ready=!1,e._texturePromise=Promise.all(a).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}function kwe(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){if(!i.hasOwnProperty(o))continue;let r=i[o];r instanceof Dt&&(l(t.getStageByName(n[o]))||r.destroy(),e._dirtyUniforms.push(o))}}function JSt(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||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength;if(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;for(let o=0;o<e._combinedSelected.length;++o)if(e._combinedSelected[o]!==e._combinedSelectedShadow[o])return!0}return i}function ZSt(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=0;for(let a=0;a<n.length;++a){let s=n[a];l(s.pickIds)?i+=s.pickIds.length:l(s.pickId)&&++i}if(n.length===0||i===0){let a=new Uint8Array([255,255,255,255]);e._selectedIdTexture=new Dt({context:t,pixelFormat:qe.RGBA,pixelDatatype:He.UNSIGNED_BYTE,source:{arrayBufferView:a,width:1,height:1},sampler:jt.NEAREST});return}let o=0,r=new Uint8Array(i*4);for(let a=0;a<n.length;++a){let s=n[a];if(l(s.pickIds)){let c=s.pickIds,u=c.length;for(let f=0;f<u;++f){let h=c[f].color;r[o]=z.floatToByte(h.red),r[o+1]=z.floatToByte(h.green),r[o+2]=z.floatToByte(h.blue),r[o+3]=z.floatToByte(h.alpha),o+=4}}else if(l(s.pickId)){let c=s.pickId.color;r[o]=z.floatToByte(c.red),r[o+1]=z.floatToByte(c.green),r[o+2]=z.floatToByte(c.blue),r[o+3]=z.floatToByte(c.alpha),o+=4}}e._selectedIdTexture=new Dt({context:t,pixelFormat:qe.RGBA,pixelDatatype:He.UNSIGNED_BYTE,source:{arrayBufferView:r,width:i,height:1},sampler:jt.NEAREST})}vI.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&kwe(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=JSt(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,ZSt(this,e),HSt(this),XSt(this,e),jSt(this,e),YSt(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=Ve.fromCache({viewport:new et(0,0,i.width,i.height)}))),this._command.renderState=o};vI.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,jt.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)};vI.prototype.isDestroyed=function(){return!1};vI.prototype.destroy=function(){return kwe(this),fe(this)};var No=vI;function PI(e){e=e??V.EMPTY_OBJECT,this._stages=e.stages,this._inputPreviousStageTexture=e.inputPreviousStageTexture??!0;let t=e.name;l(t)||(t=Jn()),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(PI.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}}});PI.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};PI.prototype.get=function(e){return this._stages[e]};function $St(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}PI.prototype.update=function(e,t){this._selectedDirty=$St(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)}};PI.prototype.isDestroyed=function(){return!1};PI.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return fe(this)};var qu=PI;var ra={};function Cte(e){let o=`#define USE_STEP_SIZE
${tE}`,r=new No({name:`${e}_x_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:Xf.LINEAR}),a=new No({name:`${e}_y_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:Xf.LINEAR}),s={};return Object.defineProperties(s,{delta:{get:function(){return r.uniforms.delta},set:function(c){let u=r.uniforms,f=a.uniforms;u.delta=f.delta=c}},sigma:{get:function(){return r.uniforms.sigma},set:function(c){let u=r.uniforms,f=a.uniforms;u.sigma=f.sigma=c}},stepSize:{get:function(){return r.uniforms.stepSize},set:function(c){let u=r.uniforms,f=a.uniforms;u.stepSize=f.stepSize=c}}}),new qu({name:e,stages:[r,a],uniforms:s})}ra.createBlurStage=function(){return Cte("czm_blur")};ra.createDepthOfFieldStage=function(){let e=Cte("czm_depth_of_field_blur"),t=new No({name:"czm_depth_of_field_composite",fragmentShader:x3,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 qu({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};ra.isDepthOfFieldSupported=function(e){return e.context.depthTexture};ra.createEdgeDetectionStage=function(){let e=Jn();return new No({name:`czm_edge_detection_${e}`,fragmentShader:S3,uniforms:{length:.25,color:z.clone(z.BLACK)}})};ra.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function ewt(e){if(!l(e))return ra.createEdgeDetectionStage();let t=new qu({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),n={},i="",o="";for(let s=0;s<e.length;++s)i+=`uniform sampler2D edgeTexture${s};
`,o+=` vec4 edge${s} = texture(edgeTexture${s}, v_textureCoordinates);
if (edge${s}.a > 0.0)
{
color = edge${s};
break;
}
`,n[`edgeTexture${s}`]=e[s].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;
}
`,a=new No({name:"czm_edge_detection_combine",fragmentShader:r,uniforms:n});return new qu({name:"czm_edge_detection_composite",stages:[t,a]})}ra.createSilhouetteStage=function(e){let t=ewt(e),n=new No({name:"czm_silhouette_color_edges",fragmentShader:N3,uniforms:{silhouetteTexture:t.name}});return new qu({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};ra.isSilhouetteSupported=function(e){return e.context.depthTexture};ra.createBloomStage=function(){let e=new No({name:"czm_bloom_contrast_bias",fragmentShader:I3,uniforms:{contrast:128,brightness:-.3}}),t=Cte("czm_bloom_blur"),n=new qu({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new No({name:"czm_bloom_generate_composite",fragmentShader:E3,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 qu({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};ra.createAmbientOcclusionStage=function(){let e=new No({name:"czm_ambient_occlusion_generate",fragmentShader:_3,uniforms:{intensity:3,bias:.1,lengthCap:.26,directionCount:8,stepCount:32,randomTexture:void 0}}),t=new No({name:"czm_ambient_occlusion_composite",fragmentShader:y3,uniforms:{ambientOcclusionOnly:!1,ambientOcclusionTexture:e.name}}),n={};return Object.defineProperties(n,{intensity:{get:function(){return e.uniforms.intensity},set:function(i){e.uniforms.intensity=i}},bias:{get:function(){return e.uniforms.bias},set:function(i){e.uniforms.bias=i}},lengthCap:{get:function(){return e.uniforms.lengthCap},set:function(i){e.uniforms.lengthCap=i}},directionCount:{get:function(){return e.uniforms.directionCount},set:function(i){e.uniforms.directionCount=i}},stepCount:{get:function(){return e.uniforms.stepCount},set:function(i){e.uniforms.stepCount=i}},randomTexture:{get:function(){return e.uniforms.randomTexture},set:function(i){e.uniforms.randomTexture=i}},ambientOcclusionOnly:{get:function(){return t.uniforms.ambientOcclusionOnly},set:function(i){t.uniforms.ambientOcclusionOnly=i}}}),new qu({name:"czm_ambient_occlusion",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};ra.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var twt=`#define FXAA_QUALITY_PRESET 39
${mk}
${D3}`;ra.createFXAAStage=function(){return new No({name:"czm_FXAA",fragmentShader:twt,sampleMode:Xf.LINEAR})};ra.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=g3,new No({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};ra.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=w3,new No({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};ra.createPbrNeutralTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=B3,new No({name:"czm_pbr_neutral",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};ra.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=M3,new No({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};ra.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=P3,new No({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:z.WHITE,autoExposure:void 0,exposure:1}})};ra.createAutoExposureStage=function(){return new L3};ra.createBlackAndWhiteStage=function(){return new No({name:"czm_black_and_white",fragmentShader:C3,uniforms:{gradations:5}})};ra.createBrightnessStage=function(){return new No({name:"czm_brightness",fragmentShader:b3,uniforms:{brightness:.5}})};ra.createNightVisionStage=function(){return new No({name:"czm_night_vision",fragmentShader:R3})};ra.createDepthViewStage=function(){return new No({name:"czm_depth_view",fragmentShader:T3})};ra.createLensFlareStage=function(){return new No({name:"czm_lens_flare",fragmentShader:v3,uniforms:{dirtTexture:Zt("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:Zt("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:te.WGS84.maximumRadius}})};var Jf=ra;function P_(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function F3(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function Ete(e,t,n,i,o){if(!i.enabled||!i._isSupported(t))return o;let r=n[i.name]={};if(l(o)){let s=e.getStageByName(o);r[F3(s)]=!0}let a=i.uniforms;if(l(a)){let s=Object.getOwnPropertyNames(a),c=s.length;for(let u=0;u<c;++u){let f=a[s[u]];if(typeof f=="string"){let h=e.getStageByName(f);l(h)&&(r[F3(h)]=!0)}}}return i.name}function O3(e,t,n,i,o){if(l(i.enabled)&&!i.enabled||l(i._isSupported)&&!i._isSupported(t))return o;let r=o,a=!l(i.inputPreviousStageTexture)||i.inputPreviousStageTexture,s=o,c=i.length;for(let h=0;h<c;++h){let p=i.get(h);l(p.length)?s=O3(e,t,n,p,o):s=Ete(e,t,n,p,o),a&&(o=s)}let u,f;if(a)for(u=1;u<c;++u)f=F3(i.get(u)),l(n[f])||(n[f]={}),n[f][r]=!0;else for(u=1;u<c;++u){f=F3(i.get(u));let h=n[f];for(let p=0;p<u;++p)h[F3(i.get(p))]=!0}return s}function nwt(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,o=e.bloom,r=e._tonemapping,a=e.fxaa,s=O3(e,t,n,i,void 0);s=O3(e,t,n,o,s),s=Ete(e,t,n,r,s),s=O3(e,t,n,e,s),Ete(e,t,n,a,s)}else O3(e,t,n,e,void 0);return n}function iwt(e,t,n){let o=e._collection.getStageByName(t),r=o._textureScale,a=o._forcePowerOfTwo,s=o._pixelFormat,c=o._pixelDatatype,u=o._clearColor,f,h,p=e._framebuffers,A=p.length;for(f=0;f<A;++f){if(h=p[f],r!==h.textureScale||a!==h.forcePowerOfTwo||s!==h.pixelFormat||c!==h.pixelDatatype||!z.equals(u,h.clearColor))continue;let m=h.stages,_=m.length,y=!1;for(let C=0;C<_;++C)if(n[m[C]]){y=!0;break}if(!y)break}return l(h)&&f<A?(h.stages.push(t),h):(h={textureScale:r,forcePowerOfTwo:a,pixelFormat:s,pixelDatatype:c,clearColor:u,stages:[t],buffer:new Ei({pixelFormat:s,pixelDatatype:c}),clear:void 0},p.push(h),h)}function owt(e,t){let n=nwt(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=iwt(e,i,n[i]))}function bte(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function rwt(e,t){let n=e._width,i=e._height,o=e._framebuffers,r=o.length;for(let a=0;a<r;++a){let s=o[a],c=s.textureScale,u=Math.ceil(n*c),f=Math.ceil(i*c),h=Math.min(u,f);s.forcePowerOfTwo&&(D.isPowerOfTwo(h)||(h=D.nextPowerOfTwo(h)),u=h,f=h),s.buffer.update(t,u,f),s.clear=new fi({color:s.clearColor,framebuffer:s.buffer.framebuffer})}}P_.prototype.updateDependencies=function(){this._updateDependencies=!0};P_.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),a=l(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),s=!l(t._activeStages)||t._activeStages.length>0||i||o||r||a;if((n||!s&&this._framebuffers.length>0)&&(bte(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!s)return;this._framebuffers.length===0&&owt(this,e);let c=e.drawingBufferWidth,u=e.drawingBufferHeight,f=this._width!==c||this._height!==u;!n&&!f||(this._width=c,this._height=u,this._updateDependencies=!1,bte(this),rwt(this,e))};P_.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};P_.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};P_.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};P_.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};P_.prototype.isDestroyed=function(){return!1};P_.prototype.destroy=function(){return bte(this),fe(this)};var RI=P_;var awt={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};var R_=Object.freeze(awt);var Ite=[];function fu(){let e=Jf.createFXAAStage(),t=Jf.createAmbientOcclusionStage(),n=Jf.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=Jf.createAutoExposureStage(),this._exposure=1,this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=R_.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let o=new RI(this),r={},a=Ite;for(a.push(e,t,n,i);a.length>0;){let c=a.pop();r[c.name]=c,c._textureCache=o;let u=c.length;if(l(u))for(let f=0;f<u;++f)a.push(c.get(f))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;let s=this;t.uniforms.randomTexture=function(){return s._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(fu.prototype,{ready:{get:function(){let e=!1,t=this._stages,n=t.length;for(let s=n-1;s>=0;--s){let c=t[s];e=e||c.ready&&c.enabled}let i=this._fxaa,o=this._ao,r=this._bloom,a=this._tonemapping;return e=e||i.ready&&i.enabled,e=e||o.ready&&o.enabled,e=e||r.ready&&r.enabled,e=e||a.ready&&a.enabled,e}},fxaa:{get:function(){return this._fxaa}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},length:{get:function(){return xte(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 a=n-1;a>=0;--a){let s=t[a];if(l(s)&&s.ready&&s.enabled)return this.getOutputTexture(s.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 R_.REINHARD:n=Jf.createReinhardTonemappingStage(t);break;case R_.MODIFIED_REINHARD:n=Jf.createModifiedReinhardTonemappingStage(t);break;case R_.FILMIC:n=Jf.createFilmicTonemappingStage(t);break;case R_.PBR_NEUTRAL:n=Jf.createPbrNeutralTonemappingStage(t);break;default:n=Jf.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 xte(e){if(!e._stagesRemoved)return;e._stagesRemoved=!1;let t=[],n=e._stages;for(let i=0,o=0;i<n.length;++i){let r=n[i];r&&(r._index=o++,t.push(r))}e._stages=t}fu.prototype.add=function(e){let t=this._stageNames,n=Ite;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 a=0;a<r;++a)n.push(o.get(a))}let i=this._stages;return e._index=i.length,i.push(e),this._textureCacheDirty=!0,e};fu.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=Ite;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};fu.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};fu.prototype.get=function(e){return xte(this),this._stages[e]};fu.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};fu.prototype.getStageByName=function(e){return this._stageNames[e]};fu.prototype.update=function(e,t,n){xte(this);let i=this._activeStages,o=this._activeStages=this._previousActiveStages;this._previousActiveStages=i;let r=this._stages;o.length=r.length;let a=0;for(let C=0;C<r.length;++C){let E=r[C];E.ready&&E.enabled&&E._isSupported(e)&&(o[a++]=E)}o.length=a;let s=a!==i.length;if(!s){for(let C=0;C<a;++C)if(o[C]!==i[C]){s=!0;break}}let c=this._ao,u=this._bloom,f=this._autoExposure,h=this._tonemapping,p=this._fxaa;h.enabled=n;let A=c.enabled&&c._isSupported(e),m=u.enabled&&u._isSupported(e),_=h.enabled&&h._isSupported(e),y=p.enabled&&p._isSupported(e);if((s||this._textureCacheDirty||A!==this._aoEnabled||m!==this._bloomEnabled||_!==this._tonemappingEnabled||y!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=A,this._bloomEnabled=m,this._tonemappingEnabled=_,this._fxaaEnabled=y,this._textureCacheDirty=!1),l(this._randomTexture)&&!A&&(this._randomTexture.destroy(),this._randomTexture=void 0),!l(this._randomTexture)&&A){let E=new Uint8Array(196608);for(let b=0;b<196608;b+=3)E[b]=Math.floor(Math.random()*255);this._randomTexture=new Dt({context:e,pixelFormat:qe.RGB,pixelDatatype:He.UNSIGNED_BYTE,source:{arrayBufferView:E,width:256,height:256},sampler:new jt({wrapS:pn.REPEAT,wrapT:pn.REPEAT,minificationFilter:Wt.NEAREST,magnificationFilter:ci.NEAREST})})}this._textureCache.update(e),p.update(e,t),c.update(e,t),u.update(e,t),h.update(e,t),this._autoExposureEnabled&&f.update(e,t);for(let C=0;C<r.length;++C)r[C].update(e,t);a=0;for(let C=0;C<r.length;++C){let E=r[C];E.ready&&E.enabled&&E._isSupported(e)&&a++}s=a!==o.length,s&&this.update(e,t,n)};fu.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function MI(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}fu.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return MI(t)};function hA(e,t,n,i,o){if(l(e.execute)){e.execute(t,n,i,o);return}if(e.inputPreviousStageTexture){hA(e.get(0),t,n,i,o);for(let r=1;r<e.length;++r)hA(e.get(r),t,MI(e.get(r-1)),i,o)}else for(let r=0;r<e.length;++r)hA(e.get(r),t,n,i,o)}fu.prototype.execute=function(e,t,n,i){let o=this._activeStages,r=o.length,a=this._fxaa,s=this._ao,c=this._bloom,u=this._autoExposure,f=this._tonemapping,h=s.enabled&&s._isSupported(e),p=c.enabled&&c._isSupported(e),A=this._autoExposureEnabled,m=f.enabled&&f._isSupported(e),_=a.enabled&&a._isSupported(e);if(!_&&!h&&!p&&!m&&r===0)return;let y=t;h&&s.ready&&(hA(s,e,y,n,i),y=MI(s)),p&&c.ready&&(hA(c,e,y,n,i),y=MI(c)),A&&u.ready&&hA(u,e,y,n,i),m&&f.ready&&(hA(f,e,y,n,i),y=MI(f));let C=y;if(r>0){hA(o[0],e,y,n,i);for(let E=1;E<r;++E)hA(o[E],e,MI(o[E-1]),n,i);C=MI(o[r-1])}_&&a.ready&&hA(a,e,C,n,i)};fu.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Yu,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};fu.prototype.isDestroyed=function(){return!1};fu.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(),fe(this)};var Q3=fu;function NI(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}NI.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};NI.prototype.morphTo2D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof An,!(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(M.IDENTITY),this._previousMode===oe.COLUMBUS_VIEW?kwt(this,e):jwt(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var swt=new d,cwt=new d,lwt=new d,uwt=new d,fwt=new d,dwt=new d,hwt=new d,mwt=new me,pwt=new M,Awt=new Vi,gwt=new An,_wt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};NI.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(M.IDENTITY);let i=swt,o=cwt,r=lwt;if(e>0)i.x=0,i.y=-1,i.z=1,i=d.multiplyByScalar(d.normalize(i,i),5*t.maximumRadius,i),d.negate(d.normalize(i,o),o),d.cross(d.UNIT_X,o,r);else{let u=n.camera;if(this._previousMode===oe.SCENE2D)d.clone(u.position,i),i.z=u.frustum.right-u.frustum.left,d.negate(d.UNIT_Z,o),d.clone(d.UNIT_Y,r);else{d.clone(u.positionWC,i),d.clone(u.directionWC,o),d.clone(u.upWC,r);let f=t.scaleToGeodeticSurface(i,hwt),h=At.eastNorthUpToFixedFrame(f,t,pwt);M.inverseTransformation(h,h),n.mapProjection.project(t.cartesianToCartographic(i,mwt),i),M.multiplyByPointAsVector(h,o,o),M.multiplyByPointAsVector(h,r,r)}}let a;this._morphToOrthographic?(a=gwt,a.width=n.camera.frustum.right-n.camera.frustum.left,a.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(a=Awt,a.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,a.fov=D.toRadians(60));let s=_wt;s.position=i,s.direction=o,s.up=r,s.frustum=a;let c=qwt(s);k3(this,c),this._previousMode===oe.SCENE2D?Ywt(this,e,s,c):(s.position2D=M.multiplyByPoint(Bo.TRANSFORM_2D,i,uwt),s.direction2D=M.multiplyByPointAsVector(Bo.TRANSFORM_2D,o,fwt),s.up2D=M.multiplyByPointAsVector(Bo.TRANSFORM_2D,r,dwt),n._mode=oe.MORPHING,Xwe(this,e,s,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var wte={position:new d,direction:new d,up:new d,frustum:void 0},zwe=new Vi;NI.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(M.IDENTITY),this._previousMode===oe.SCENE2D)Dwt(this,e,t);else{let i;e>0?(i=wte,d.fromDegrees(0,0,5*t.maximumRadius,t,i.position),d.negate(i.position,i.direction),d.normalize(i.direction,i.direction),d.clone(d.UNIT_Z,i.up)):i=Gwe(this,t);let o,r=n.camera;r.frustum instanceof An?o=r.frustum.clone():(o=zwe,o.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,o.fov=D.toRadians(60)),i.frustum=o;let a=Zwe(i);k3(this,a),Ste(this,e,i,a)}e===0&&l(this._completeMorph)&&this._completeMorph()}};NI.prototype.isDestroyed=function(){return!1};NI.prototype.destroy=function(){return g5(this),fe(this)};function k3(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new qf(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,Bn.LEFT_DOWN),e._morphHandler.setInputAction(n,Bn.MIDDLE_DOWN),e._morphHandler.setInputAction(n,Bn.RIGHT_DOWN),e._morphHandler.setInputAction(n,Bn.WHEEL)}}function g5(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 ywt=new me,Cwt=new d,Ewt=new M;function Gwe(e,t){let n=e._scene,i=n.camera,o=wte,r=o.position,a=o.direction,s=o.up,c=n.mapProjection.unproject(i.position,ywt);t.cartographicToCartesian(c,r);let u=t.scaleToGeodeticSurface(r,Cwt),f=At.eastNorthUpToFixedFrame(u,t,Ewt);return M.multiplyByPointAsVector(f,i.direction,a),M.multiplyByPointAsVector(f,i.up,s),o}var bwt=new d,Iwt=new d,xwt=new d,Twt=new d,Swt=new d,wwt=new d;function Ste(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,a=d.clone(r.position,bwt),s=d.clone(r.direction,Iwt),c=d.clone(r.up,xwt),u=M.multiplyByPoint(Bo.TRANSFORM_2D_INVERSE,n.position,Twt),f=M.multiplyByPointAsVector(Bo.TRANSFORM_2D_INVERSE,n.direction,Swt),h=M.multiplyByPointAsVector(Bo.TRANSFORM_2D_INVERSE,n.up,wwt);function p(m){fh(a,u,m.time,r.position),fh(s,f,m.time,r.direction),fh(c,h,m.time,r.up),d.cross(r.direction,r.up,r.right),d.normalize(r.right,r.right)}let A=o.tweens.add({duration:t,easingFunction:Ta.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){Jwe(e,o,0,1,t,i)}});e._currentTweens.push(A)}var Bwt=new An,Vwe=new d,Hwe=new d,Wwe=new d,Bte=new d,jwe=new d,Ywe=new d;function Dwt(e,t,n){t/=3;let i=e._scene,o=i.camera,r;t>0?(r=wte,d.fromDegrees(0,0,5*n.maximumRadius,n,r.position),d.negate(r.position,r.direction),d.normalize(r.direction,r.direction),d.clone(d.UNIT_Z,r.up)):(o.position.z=o.frustum.right-o.frustum.left,r=Gwe(e,n));let a;e._morphToOrthographic?(a=Bwt,a.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,a.width=o.frustum.right-o.frustum.left):(a=zwe,a.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,a.fov=D.toRadians(60)),r.frustum=a;let s=Zwe(r);k3(e,s);let c;e._morphToOrthographic?c=function(){Ste(e,t,r,s)}:c=function(){Kwe(e,t,r,function(){Ste(e,t,r,s)})},t>0?(i._mode=oe.SCENE2D,o.flyTo({duration:t,destination:d.fromDegrees(0,0,5*n.maximumRadius,n,Bte),complete:function(){i._mode=oe.MORPHING,c()}})):c()}function fh(e,t,n,i){return d.lerp(e,t,n,i)}function qwe(e,t,n,i,o){let r=e._scene,a=r.camera;if(a.frustum instanceof An)return;let s=a.frustum.fov,c=D.RADIANS_PER_DEGREE*.5,u=n.position.z*Math.tan(s*.5);a.frustum.far=u/Math.tan(c*.5)+1e7;function f(p){a.frustum.fov=D.lerp(s,c,p.time);let A=u/Math.tan(a.frustum.fov*.5);i(a,A)}let h=r.tweens.add({duration:t,easingFunction:Ta.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){a.frustum=n.frustum.clone(),o(e)}});e._currentTweens.push(h)}var vwt=new d,Pwt=new d,Rwt=new d,Tte=new d,Mwt=new d,Nwt=new d,Lwt=new ua,Owt=new yn,Fwt=new d,Qwt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function kwt(e,t){t*=.5;let n=e._scene,i=n.camera,o=d.clone(i.position,vwt),r=d.clone(i.direction,Pwt),a=d.clone(i.up,Rwt),s=d.negate(d.UNIT_Z,Mwt),c=d.clone(d.UNIT_Y,Nwt),u=Tte;if(t>0)d.clone(d.ZERO,Tte),u.z=5*n.ellipsoid.maximumRadius;else{d.clone(o,Tte);let y=Owt;M.multiplyByPoint(Bo.TRANSFORM_2D,o,y.origin),M.multiplyByPointAsVector(Bo.TRANSFORM_2D,r,y.direction);let C=n.globe;if(l(C)){let E=C.pickWorldCoordinates(y,n,!0,Fwt);l(E)&&(M.multiplyByPoint(Bo.TRANSFORM_2D_INVERSE,E,u),u.z+=d.distance(o,u))}}let f=Lwt;f.right=u.z*.5,f.left=-f.right,f.top=f.right*(n.drawingBufferHeight/n.drawingBufferWidth),f.bottom=-f.top;let h=Qwt;h.position=u,h.direction=s,h.up=c,h.frustum=f;let p=$we(h);k3(e,p);function A(y){fh(o,u,y.time,i.position),fh(r,s,y.time,i.direction),fh(a,c,y.time,i.up),d.cross(i.direction,i.up,i.right),d.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function m(y,C){y.position.z=C}let _=n.tweens.add({duration:t,easingFunction:Ta.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:A,complete:function(){qwe(e,t,h,m,p)}});e._currentTweens.push(_)}var Uwe=new me,Uwt={position:new d,direction:new d,up:new d,position2D:new d,direction2D:new d,up2D:new d,frustum:new ua},zwt={position:new d,direction:new d,up:new d,frustum:void 0},Gwt=new d,Vwt=new yn,Hwt=new M,Wwt=new d;function jwt(e,t,n){t*=.5;let i=e._scene,o=i.camera,r=Uwt;if(t>0)d.clone(d.ZERO,r.position),r.position.z=5*n.maximumRadius,d.negate(d.UNIT_Z,r.direction),d.clone(d.UNIT_Y,r.up);else{n.cartesianToCartographic(o.positionWC,Uwe),i.mapProjection.project(Uwe,r.position),d.negate(d.UNIT_Z,r.direction),d.clone(d.UNIT_Y,r.up);let h=Vwt;d.clone(r.position2D,h.origin);let p=d.clone(o.directionWC,h.direction),A=n.scaleToGeodeticSurface(o.positionWC,Wwt),m=At.eastNorthUpToFixedFrame(A,n,Hwt);M.inverseTransformation(m,m),M.multiplyByPointAsVector(m,p,p),M.multiplyByPointAsVector(Bo.TRANSFORM_2D,p,p);let _=i.globe;if(l(_)){let y=_.pickWorldCoordinates(h,i,!0,Gwt);if(l(y)){let C=d.distance(r.position2D,y);y.x+=C,d.clone(y,r.position2D)}}}function a(h,p){h.position.x=p}M.multiplyByPoint(Bo.TRANSFORM_2D,r.position,r.position2D),M.multiplyByPointAsVector(Bo.TRANSFORM_2D,r.direction,r.direction2D),M.multiplyByPointAsVector(Bo.TRANSFORM_2D,r.up,r.up2D);let s=r.frustum;s.right=r.position.z*.5,s.left=-s.right,s.top=s.right*(i.drawingBufferHeight/i.drawingBufferWidth),s.bottom=-s.top;let c=zwt;M.multiplyByPoint(Bo.TRANSFORM_2D_INVERSE,r.position2D,c.position),d.clone(r.direction,c.direction),d.clone(r.up,c.up),c.frustum=s;let u=$we(c);k3(e,u);function f(){qwe(e,t,r,a,u)}Xwe(e,t,r,f)}function Kwe(e,t,n,i){let o=e._scene,r=o.camera,a=r.frustum.right-r.frustum.left;r.frustum=n.frustum.clone();let s=r.frustum.fov,c=D.RADIANS_PER_DEGREE*.5,u=a*Math.tan(s*.5);r.frustum.far=u/Math.tan(c*.5)+1e7,r.frustum.fov=c;function f(p){r.frustum.fov=D.lerp(c,s,p.time),r.position.z=u/Math.tan(r.frustum.fov*.5)}let h=o.tweens.add({duration:t,easingFunction:Ta.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){i(e)}});e._currentTweens.push(h)}function Ywt(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,a=d.clone(n.position,Bte),s=d.clone(n.direction,jwe),c=d.clone(n.up,Ywe);o._mode=oe.MORPHING;function u(){r.frustum=n.frustum.clone();let f=d.clone(r.position,Vwe),h=d.clone(r.direction,Hwe),p=d.clone(r.up,Wwe);f.z=a.z;function A(_){fh(f,a,_.time,r.position),fh(h,s,_.time,r.direction),fh(p,c,_.time,r.up),d.cross(r.direction,r.up,r.right),d.normalize(r.right,r.right)}let m=o.tweens.add({duration:t,easingFunction:Ta.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:A,complete:function(){i(e)}});e._currentTweens.push(m)}e._morphToOrthographic?u():Kwe(e,0,n,u)}function Xwe(e,t,n,i){let o=e._scene,r=o.camera,a=d.clone(r.position,Vwe),s=d.clone(r.direction,Hwe),c=d.clone(r.up,Wwe),u=d.clone(n.position2D,Bte),f=d.clone(n.direction2D,jwe),h=d.clone(n.up2D,Ywe);function p(m){fh(a,u,m.time,r.position),fh(s,f,m.time,r.direction),fh(c,h,m.time,r.up),d.cross(r.direction,r.up,r.right),d.normalize(r.right,r.right),r._adjustOrthographicFrustum(!0)}let A=o.tweens.add({duration:t,easingFunction:Ta.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){Jwe(e,o,1,0,t,i)}});e._currentTweens.push(A)}function Jwe(e,t,n,i,o,r){let a={object:t,property:"morphTime",startValue:n,stopValue:i,duration:o,easingFunction:Ta.QUARTIC_OUT};l(r)&&(a.complete=function(){r(e)});let s=t.tweens.addProperty(a);e._currentTweens.push(s)}function Zwe(e){return function(t){let n=t._scene;n._mode=oe.SCENE3D,n.morphTime=oe.getMorphTime(oe.SCENE3D),g5(t);let i=n.camera;(t._previousMode!==oe.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,d.clone(e.position,i.position),d.clone(e.direction,i.direction),d.clone(e.up,i.up),d.cross(i.direction,i.up,i.right),d.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 $we(e){return function(t){let n=t._scene;n._mode=oe.SCENE2D,n.morphTime=oe.getMorphTime(oe.SCENE2D),g5(t);let i=n.camera;d.clone(e.position,i.position),i.position.z=n.ellipsoid.maximumRadius*2,d.clone(e.direction,i.direction),d.clone(e.up,i.up),d.cross(i.direction,i.up,i.right),d.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 qwt(e){return function(t){let n=t._scene;n._mode=oe.COLUMBUS_VIEW,n.morphTime=oe.getMorphTime(oe.COLUMBUS_VIEW),g5(t);let i=n.camera;(t._previousModeMode!==oe.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,d.clone(e.position,i.position),d.clone(e.direction,i.direction),d.clone(e.up,i.up),d.cross(i.direction,i.up,i.right),d.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 U3=NI;var Kwt={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4},no=Object.freeze(Kwt);function Xs(e,t){let n=`${e}`;return l(t)&&(n+=`+${t}`),n}function Xwt(e,t){k.clone(e.distance.startPosition,t.distance.startPosition),k.clone(e.distance.endPosition,t.distance.endPosition),k.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),k.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function eBe(e,t,n){let i=Xs(no.PINCH,t),o=e._update,r=e._isDown,a=e._eventStartPosition,s=e._pressTime,c=e._releaseTime;o[i]=!0,r[i]=!1,a[i]=new k;let u=e._movement[i];l(u)||(u=e._movement[i]={}),u.distance={startPosition:new k,endPosition:new k},u.angleAndHeight={startPosition:new k,endPosition:new k},u.prevAngle=0,e._eventHandler.setInputAction(function(f){e._buttonsDown++,r[i]=!0,s[i]=new Date,k.lerp(f.position1,f.position2,.5,a[i])},Bn.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),r[i]=!1,c[i]=new Date},Bn.PINCH_END,t),e._eventHandler.setInputAction(function(f){if(r[i]){o[i]?(Xwt(f,u),o[i]=!1,u.prevAngle=u.angleAndHeight.startPosition.x):(k.clone(f.distance.endPosition,u.distance.endPosition),k.clone(f.angleAndHeight.endPosition,u.angleAndHeight.endPosition));let h=u.angleAndHeight.endPosition.x,p=u.prevAngle,A=Math.PI*2;for(;h>=p+Math.PI;)h-=A;for(;h<p-Math.PI;)h+=A;u.angleAndHeight.endPosition.x=-h*n.clientWidth/12,u.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},Bn.PINCH_MOVE,t)}function tBe(e,t){let n=Xs(no.WHEEL,t),i=e._pressTime,o=e._releaseTime,r=e._update;r[n]=!0;let a=e._movement[n];l(a)||(a=e._movement[n]={});let s=e._lastMovement[n];l(s)||(s=e._lastMovement[n]={startPosition:new k,endPosition:new k,valid:!1}),a.startPosition=new k,k.clone(k.ZERO,a.startPosition),a.endPosition=new k,e._eventHandler.setInputAction(function(c){let u=7.5*D.toRadians(c);i[n]=o[n]=new Date,a.endPosition.x=0,a.endPosition.y=u,k.clone(a.endPosition,s.endPosition),s.valid=!0,r[n]=!1},Bn.WHEEL,t)}function mB(e,t,n){let i=Xs(n,t),o=e._isDown,r=e._eventStartPosition,a=e._pressTime;o[i]=!1,r[i]=new k;let s=e._lastMovement[i];l(s)||(s=e._lastMovement[i]={startPosition:new k,endPosition:new k,valid:!1});let c,u;n===no.LEFT_DRAG?(c=Bn.LEFT_DOWN,u=Bn.LEFT_UP):n===no.RIGHT_DRAG?(c=Bn.RIGHT_DOWN,u=Bn.RIGHT_UP):n===no.MIDDLE_DRAG&&(c=Bn.MIDDLE_DOWN,u=Bn.MIDDLE_UP),e._eventHandler.setInputAction(function(f){e._buttonsDown++,s.valid=!1,o[i]=!0,a[i]=new Date,k.clone(f.position,r[i])},c,t),e._eventHandler.setInputAction(function(){Dte(Xs(n,void 0),e);for(let f of Object.values(js)){let h=Xs(n,f);Dte(h,e)}},u,t)}function Dte(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 nBe(e,t){k.clone(e.startPosition,t.startPosition),k.clone(e.endPosition,t.endPosition)}function Jwt(e,t,n){let i=n._isDown,o=!1,r=Xs(e,t);for(let[c,u]of Object.entries(i))c.startsWith(e)&&u&&c!==r&&(o=!0,Dte(c,n));if(!o)return;let a=n._pressTime,s=n._lastMovement[r];l(s)||(s=n._lastMovement[r]={startPosition:new k,endPosition:new k,valid:!1}),n._buttonsDown++,s.valid=!1,i[r]=!0,a[r]=new Date}function iBe(e,t){let n=e._update,i=e._movement,o=e._lastMovement,r=e._isDown;for(let a in no)if(no.hasOwnProperty(a)){let s=no[a];if(l(s)){let c=Xs(s,t);n[c]=!0,l(e._lastMovement[c])||(e._lastMovement[c]={startPosition:new k,endPosition:new k,valid:!1}),l(e._movement[c])||(e._movement[c]={startPosition:new k,endPosition:new k})}}e._eventHandler.setInputAction(function(a){for(let s in no)if(no.hasOwnProperty(s)){let c=no[s];if(l(c)){let u=Xs(c,t);Jwt(c,t,e),r[u]&&(n[u]?(nBe(i[u],o[u]),o[u].valid=!0,nBe(a,i[u]),n[u]=!1):k.clone(a.endPosition,i[u].endPosition))}}k.clone(a.endPosition,e._currentMousePosition)},Bn.MOUSE_MOVE,t)}function dh(e){this._eventHandler=new qf(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new k,tBe(this,void 0),eBe(this,void 0,e),mB(this,void 0,no.LEFT_DRAG),mB(this,void 0,no.RIGHT_DRAG),mB(this,void 0,no.MIDDLE_DRAG),iBe(this,void 0);for(let t in js)if(js.hasOwnProperty(t)){let n=js[t];l(n)&&(tBe(this,n),eBe(this,n,e),mB(this,n,no.LEFT_DRAG),mB(this,n,no.RIGHT_DRAG),mB(this,n,no.MIDDLE_DRAG),iBe(this,n))}}Object.defineProperties(dh.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[Xs(no.WHEEL)]||!this._update[Xs(no.WHEEL,js.SHIFT)]||!this._update[Xs(no.WHEEL,js.CTRL)]||!this._update[Xs(no.WHEEL,js.ALT)];return this._buttonsDown>0||e}}});dh.prototype.isMoving=function(e,t){let n=Xs(e,t);return!this._update[n]};dh.prototype.getMovement=function(e,t){let n=Xs(e,t);return this._movement[n]};dh.prototype.getLastMovement=function(e,t){let n=Xs(e,t),i=this._lastMovement[n];if(i.valid)return i};dh.prototype.isButtonDown=function(e,t){let n=Xs(e,t);return this._isDown[n]};dh.prototype.getStartMousePosition=function(e,t){if(e===no.WHEEL)return this._currentMousePosition;let n=Xs(e,t);return this._eventStartPosition[n]};dh.prototype.getButtonPressTime=function(e,t){let n=Xs(e,t);return this._pressTime[n]};dh.prototype.getButtonReleaseTime=function(e,t){let n=Xs(e,t);return this._releaseTime[n]};dh.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};dh.prototype.isDestroyed=function(){return!1};dh.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),fe(this)};var z3=dh;function _5(e,t,n,i,o,r,a,s,c,u){this._tweens=e,this._tweenjs=t,this._startObject=je(n),this._stopObject=je(i),this._duration=o,this._delay=r,this._easingFunction=a,this._update=s,this._complete=c,this.cancel=u,this.needsStart=!0}Object.defineProperties(_5.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}}});_5.prototype.cancelTween=function(){this._tweens.remove(this)};function Vm(){this._tweens=[]}Object.defineProperties(Vm.prototype,{length:{get:function(){return this._tweens.length}}});Vm.prototype.add=function(e){if(e=e??V.EMPTY_OBJECT,e.duration===0)return l(e.complete)&&e.complete(),new _5(this);let t=e.duration/li.SECONDS_PER_MILLISECOND,n=e.delay??0,i=n/li.SECONDS_PER_MILLISECOND,o=e.easingFunction??Ta.LINEAR_NONE,r=e.startObject,a=new NIe(r);a.to(je(e.stopObject),t),a.delay(i),a.easing(o),l(e.update)&&a.onUpdate(function(){e.update(r)}),a.onComplete(e.complete??null),a.repeat(e._repeat??0);let s=new _5(this,a,e.startObject,e.stopObject,e.duration,n,o,e.update,e.complete,e.cancel);return this._tweens.push(s),s};Vm.prototype.addProperty=function(e){e=e??V.EMPTY_OBJECT;let t=e.object,n=e.property,i=e.startValue,o=e.stopValue;function r(a){t[n]=a.value}return this.add({startObject:{value:i},stopObject:{value:o},duration:e.duration??3,delay:e.delay,easingFunction:e.easingFunction,update:r,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})};Vm.prototype.addAlpha=function(e){e=e??V.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 a=0;a<r;++a)t.uniforms[n[a]].alpha=o.alpha}return this.add({startObject:{alpha:e.startValue??0},stopObject:{alpha:e.stopValue??1},duration:e.duration??3,delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel})};Vm.prototype.addOffsetIncrement=function(e){e=e??V.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})};Vm.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};Vm.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};Vm.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};Vm.prototype.get=function(e){return this._tweens[e]};Vm.prototype.update=function(e){let t=this._tweens,n=0;for(e=l(e)?e/li.SECONDS_PER_MILLISECOND:Fi();n<t.length;){let i=t[n],o=i.tweenjs;if(i.needsStart)i.needsStart=!1,o.start(e);else if(o.update(e))n++;else{if(t[n]?.needsStart)continue;o.stop(),t.splice(n,1)}}};var LI=Vm;function nE(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=no.LEFT_DRAG,this.zoomEventTypes=[no.RIGHT_DRAG,no.WHEEL,no.PINCH],this.rotateEventTypes=no.LEFT_DRAG,this.tiltEventTypes=[no.MIDDLE_DRAG,no.PINCH,{eventType:no.LEFT_DRAG,modifier:js.CTRL},{eventType:no.RIGHT_DRAG,modifier:js.CTRL}],this.lookEventTypes={eventType:no.LEFT_DRAG,modifier:js.SHIFT};let t=e.ellipsoid??te.default;this.minimumPickingTerrainHeight=te.WGS84.equals(t)?15e4:t.minimumRadius*.025,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=te.WGS84.equals(t)?4e3:t.minimumRadius*63e-5,this.minimumCollisionTerrainHeight=te.WGS84.equals(t)?15e3:t.minimumRadius*.0025,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=te.WGS84.equals(t)?75e5:t.minimumRadius*1.175,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this.maximumTiltAngle=void 0,this._scene=e,this._globe=void 0,this._ellipsoid=t,this._lastGlobeHeight=0,this._aggregator=new z3(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 LI,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new k(-1,-1),this._tiltCenter=new d,this._rotateMousePosition=new k(-1,-1),this._rotateStartPosition=new d,this._strafeStartPosition=new d,this._strafeMousePosition=new k,this._strafeEndMousePosition=new k,this._zoomMouseStart=new k(-1,-1),this._zoomWorldPosition=new d,this._useZoomWorldPosition=!1,this._panLastMousePosition=new k,this._panLastWorldPosition=new d,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 me(Math.PI,D.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 Zwt(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function $wt(e){return k.equalsEpsilon(e.startPosition,e.endPosition,D.EPSILON14)}var eBt=.4;function tBt(e,t,n,i,o,r,a){let s=r[a];l(s)||(s=r[a]={startPosition:new k,endPosition:new k,motion:new k,inertiaEnabled:!0});let c=e.getButtonPressTime(t,n),u=e.getButtonReleaseTime(t,n),f=c&&u&&(u.getTime()-c.getTime())/1e3,p=u&&(new Date().getTime()-u.getTime())/1e3;if(c&&u&&f<eBt){let A=Zwt(p,i),m=e.getLastMovement(t,n);if(!l(m)||$wt(m)||!s.inertiaEnabled||(s.motion.x=(m.endPosition.x-m.startPosition.x)*.5,s.motion.y=(m.endPosition.y-m.startPosition.y)*.5,s.startPosition=k.clone(m.startPosition,s.startPosition),s.endPosition=k.multiplyByScalar(s.motion,A,s.endPosition),s.endPosition=k.add(s.startPosition,s.endPosition,s.endPosition),isNaN(s.endPosition.x)||isNaN(s.endPosition.y)||k.distance(s.startPosition,s.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let _=e.getStartMousePosition(t,n);o(r,_,s)}}}function nBt(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 oBe=[];function du(e,t,n,i,o,r){if(!l(n))return;let a=e._aggregator;Array.isArray(n)||(oBe[0]=n,n=oBe);let s=n.length;for(let c=0;c<s;++c){let u=n[c],f=l(u.eventType)?u.eventType:u,h=u.modifier,p=a.isMoving(f,h)&&a.getMovement(f,h),A=a.getStartMousePosition(f,h);e.enableInputs&&t&&(p?(i(e,A,p),nBt(e,r)):o<1&&tBt(a,f,h,o,i,e,r))}}var y5=new yn,iBt=new d,oBt=new k,rBt=new d,aBt=new k,sBt=new d,cBt=new d,lBt=new d,uBt=new d,pBe=new d,fBt=new d,dBt=new d,hBt=new d,mBt=new d,pBt=new d,ABt=new d,gBt=new d,_Bt=new d,yBt=new d,CBt=new d,OI=new d,rBe=new d,aBe=new d,vte={orientation:new Ec};function kte(e,t,n,i,o,r){let a=1;l(r)&&(a=D.clamp(Math.abs(r),.25,1));let s=n.endPosition.y-n.startPosition.y,u=s>0?e.minimumZoomDistance*a:0,f=e.maximumZoomDistance,h=o-u,p=i*h;p=D.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let A=s/e._scene.canvas.clientHeight;A=Math.min(A,e.maximumMovementRatio);let m=p*A;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!l(e._globe)){if(m>0&&Math.abs(o-u)<1||m<0&&Math.abs(o-f)<1)return;o-m<u?m=o-u-1:o-m>f&&(m=o-f)}let _=e._scene,y=_.camera,C=_.mode,E=vte.orientation;E.heading=y.heading,E.pitch=y.pitch,E.roll=y.roll;let b=n.inertiaEnabled??k.equals(t,e._zoomMouseStart),x=e._zoomingOnVector,S=e._rotatingZoom,B;if(b||(e._zoomMouseStart=k.clone(t,e._zoomMouseStart),l(e._globe)&&C===oe.SCENE2D?(B=y.getPickRay(t,y5).origin,B=d.fromElements(B.y,B.z,B.x)):l(e._globe)&&(B=M_(e,t,iBt)),l(B)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=d.clone(B,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,x=e._zoomingOnVector=!1,S=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){y.zoomIn(m);return}let v=C===oe.COLUMBUS_VIEW;if(y.positionCartographic.height<2e6&&(S=!0),!b||S){if(C===oe.SCENE2D){let P=e._zoomWorldPosition,N=y.position;if(!d.equals(P,N)&&y.positionCartographic.height<e._maxCoord.x*2){let L=y.position.x,g=d.subtract(P,N,rBt);d.normalize(g,g);let I=d.distance(P,N)*m/(y.getMagnitude()*.5);y.move(g,I*.5),(y.position.x<0&&L>0||y.position.x>0&&L<0)&&(B=y.getPickRay(t,y5).origin,B=d.fromElements(B.y,B.z,B.x),e._zoomWorldPosition=d.clone(B,e._zoomWorldPosition))}}else if(C===oe.SCENE3D){let P=d.normalize(y.position,pBe);if(e._cameraUnderground||e._zoomingUnderground||y.positionCartographic.height<3e3&&Math.abs(d.dot(y.direction,P))<.6)v=!0;else{let N=_.canvas,L=aBt;L.x=N.clientWidth/2,L.y=N.clientHeight/2;let g=M_(e,L,sBt);if(!l(g))v=!0;else if(y.positionCartographic.height<1e6)if(d.dot(y.direction,P)>=-.5)v=!0;else{let I=dBt;d.clone(y.position,I);let T=e._zoomWorldPosition,w=fBt;if(w=d.normalize(T,w),d.dot(w,P)<0)return;let R=CBt,O=pBt;d.clone(y.direction,O),d.add(I,d.multiplyByScalar(O,1e3,OI),R);let G=ABt,F=gBt;d.subtract(T,I,G),d.normalize(G,F);let U=d.dot(P,F);if(U>=0){e._zoomMouseStart.x=-1;return}let Q=Math.acos(-U),H=d.magnitude(I),Y=d.magnitude(T),$=H-m,W=d.magnitude(G),K=Math.asin(D.clamp(W/Y*Math.sin(Q),-1,1)),Z=Math.asin(D.clamp($/Y*Math.sin(Q),-1,1)),pe=K-Z+Q,ge=hBt;d.normalize(I,ge);let re=mBt;re=d.cross(F,ge,re),re=d.normalize(re,re),d.normalize(d.cross(ge,re,OI),O),d.multiplyByScalar(d.normalize(R,OI),d.magnitude(R)-m,R),d.normalize(I,I),d.multiplyByScalar(I,$,I);let ye=_Bt;d.multiplyByScalar(d.add(d.multiplyByScalar(ge,Math.cos(pe)-1,rBe),d.multiplyByScalar(O,Math.sin(pe),aBe),OI),$,ye),d.add(I,ye,I),d.normalize(R,ge),d.normalize(d.cross(ge,re,OI),O);let Ce=yBt;d.multiplyByScalar(d.add(d.multiplyByScalar(ge,Math.cos(pe)-1,rBe),d.multiplyByScalar(O,Math.sin(pe),aBe),OI),d.magnitude(R),Ce),d.add(R,Ce,R),d.clone(I,y.position),d.normalize(d.subtract(R,I,OI),y.direction),d.clone(y.direction,y.direction),d.cross(y.direction,y.up,y.right),d.cross(y.right,y.direction,y.up),y.setView(vte);return}else{let I=d.normalize(g,cBt),T=d.normalize(e._zoomWorldPosition,lBt),w=d.dot(T,I);if(w>0&&w<1){let R=D.acosClamped(w),O=d.cross(T,I,uBt),G=Math.abs(R)>D.toRadians(20)?y.positionCartographic.height*.75:y.positionCartographic.height-m,F=m/G;y.rotate(O,R*F)}}}}e._rotatingZoom=!v}if(!b&&v||x){let P,N=so.worldToWindowCoordinates(_,e._zoomWorldPosition,oBt);C!==oe.COLUMBUS_VIEW&&k.equals(t,e._zoomMouseStart)&&l(N)?P=y.getPickRay(N,y5):P=y.getPickRay(t,y5);let L=P.direction;(C===oe.COLUMBUS_VIEW||C===oe.SCENE2D)&&d.fromElements(L.y,L.z,L.x,L),y.move(L,m),e._zoomingOnVector=!0}else y.zoomIn(m);e._cameraUnderground||y.setView(vte)}var EBt=new yn,bBt=new yn,IBt=new d;function xBt(e,t,n){let o=e._scene.camera,r=o.getPickRay(n.startPosition,EBt).origin,a=o.getPickRay(n.endPosition,bBt).origin;r=d.fromElements(r.y,r.z,r.x,r),a=d.fromElements(a.y,a.z,a.x,a);let s=d.subtract(r,a,IBt),c=d.magnitude(s);c>0&&(d.normalize(s,s),o.move(s,c))}function Lte(e,t,n){l(n.distance)&&(n=n.distance);let o=e._scene.camera;kte(e,t,n,e.zoomFactor,o.getMagnitude())}var TBt=new k,SBt=new k;function sBe(e,t,n){if(l(n.angleAndHeight)){wBt(e,t,n.angleAndHeight);return}let i=e._scene,o=i.camera,r=i.canvas,a=r.clientWidth,s=r.clientHeight,c=TBt;c.x=2/a*n.startPosition.x-1,c.y=2/s*(s-n.startPosition.y)-1,c=k.normalize(c,c);let u=SBt;u.x=2/a*n.endPosition.x-1,u.y=2/s*(s-n.endPosition.y)-1,u=k.normalize(u,u);let f=D.acosClamped(c.x);c.y<0&&(f=D.TWO_PI-f);let h=D.acosClamped(u.x);u.y<0&&(h=D.TWO_PI-h);let p=h-f;o.twistRight(p)}function wBt(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,a=o.canvas,s=(n.endPosition.x-n.startPosition.x)/a.clientWidth;s=Math.min(s,e.maximumMovementRatio);let c=i*s*Math.PI*4;r.twistRight(c)}function BBt(e){let t=e._scene.mapMode2D===uu.ROTATE;M.equals(M.IDENTITY,e._scene.camera.transform)?(du(e,e.enableTranslate,e.translateEventTypes,xBt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),du(e,e.enableZoom,e.zoomEventTypes,Lte,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&du(e,e.enableRotate,e.tiltEventTypes,sBe,e.inertiaSpin,"_lastInertiaTiltMovement")):(du(e,e.enableZoom,e.zoomEventTypes,Lte,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&du(e,e.enableRotate,e.translateEventTypes,sBe,e.inertiaSpin,"_lastInertiaSpinMovement"))}var ABe=new yn,DBt=new d,vBt=new d;function M_(e,t,n){let i=e._scene,o=e._globe,r=i.camera,a;if(i.pickPositionSupported&&(a=i.pickPositionWorldCoordinates(t,DBt)),!l(o))return d.clone(a,n);let s=!e._cameraUnderground,c=r.getPickRay(t,ABe),u=o.pickWorldCoordinates(c,i,s,vBt),f=l(a)?d.distance(a,r.positionWC):Number.POSITIVE_INFINITY,h=l(u)?d.distance(u,r.positionWC):Number.POSITIVE_INFINITY;return f<h?d.clone(a,n):d.clone(u,n)}var PBt=new me;function S5(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,PBt);l(c)&&(r=c.height)}else r=i.position.z;let a=e._scene.globeHeight??0;return Math.abs(a-r)}var RBt=new d;function gBe(e,t){let n=t.origin,i=t.direction,o=S5(e),r=d.normalize(n,RBt),a=Math.abs(d.dot(r,i));return a=Math.max(a,.5)*2,o*a}function _Be(e,t,n,i){let o=d.distance(t.origin,n),r=S5(e),a=D.clamp(r*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return o>a&&(o=Math.min(o,r/5),o=Math.max(o,100)),yn.getPoint(t,o,i)}function yBe(e,t,n,i){let o;return l(n)?(o=d.distance(t.origin,n),o>e._maximumUndergroundPickDistance&&(o=S5(e))):o=S5(e),yn.getPoint(t,o,i)}var MBt=new k;function CBe(e,t){let n=t.endPosition,i=k.subtract(t.endPosition,t.startPosition,MBt),o=e._strafeEndMousePosition;k.add(o,i,o),t.endPosition=o,Ute(e,t,e._strafeStartPosition),t.endPosition=n}var cBe=new yn,NBt=new yn,Pte=new d,LBt=new d,OBt=new d,FBt=new d,QBt=new cn(d.UNIT_X,0),kBt=new k,UBt=new k;function zBt(e,t,n){if(d.equals(t,e._translateMousePosition)||(e._looking=!1),d.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){$f(e,t,n);return}if(e._strafing){CBe(e,n);return}let o=e._scene.camera,r=e._cameraUnderground,a=k.clone(n.startPosition,kBt),s=k.clone(n.endPosition,UBt),c=o.getPickRay(a,cBe),u=d.clone(d.ZERO,FBt),f=d.UNIT_X,h;if(o.position.z<e._minimumPickingTerrainHeight&&(h=M_(e,a,Pte),l(h)&&(u.x=h.x)),r||u.x>o.position.z&&l(h)){let b=h;r&&(b=yBe(e,c,h,Pte)),k.clone(t,e._strafeMousePosition),k.clone(t,e._strafeEndMousePosition),d.clone(b,e._strafeStartPosition),e._strafing=!0,Ute(e,n,e._strafeStartPosition);return}let p=cn.fromPointNormal(u,f,QBt);c=o.getPickRay(a,cBe);let A=di.rayPlane(c,p,Pte),m=o.getPickRay(s,NBt),_=di.rayPlane(m,p,LBt);if(!l(A)||!l(_)){e._looking=!0,$f(e,t,n),k.clone(t,e._translateMousePosition);return}let y=d.subtract(A,_,OBt),C=y.x;y.x=y.y,y.y=y.z,y.z=C;let E=d.magnitude(y);E>D.EPSILON6&&(d.normalize(y,y),o.move(y,E))}var EBe=new k,b5=new yn,I5=new d,GBt=new d,bBe=new M,VBt=new M,HBt=new d,WBt=new cn(d.UNIT_X,0),Rte=new d,Ote=new me,IBe=new M,jBt=new Qe,YBt=new J,x5=new d;function qBt(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),k.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){$f(e,t,n);return}let o=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(o.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,KBt(e,t,n)):XBt(e,t,n)}function KBt(e,t,n){let i=e._scene,o=i.camera,r=i.canvas,a=EBe;a.x=r.clientWidth/2,a.y=r.clientHeight/2;let s=o.getPickRay(a,b5),c=d.UNIT_X,u=s.origin,f=s.direction,h,p=d.dot(c,f);if(Math.abs(p)>D.EPSILON6&&(h=-d.dot(c,u)/p),!l(h)||h<=0){e._looking=!0,$f(e,t,n),k.clone(t,e._tiltCenterMousePosition);return}let A=d.multiplyByScalar(f,h,I5);d.add(u,A,A);let m=i.mapProjection,_=m.ellipsoid;d.fromElements(A.y,A.z,A.x,A);let y=m.unproject(A,Ote);_.cartographicToCartesian(y,A);let C=At.eastNorthUpToFixedFrame(A,_,bBe),E=e._globe,b=e._ellipsoid;e._globe=void 0,e._ellipsoid=te.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let x=M.clone(o.transform,IBe);o._setTransform(C),Zf(e,t,n,d.UNIT_Z),o._setTransform(x),e._globe=E,e._ellipsoid=b;let S=b.maximumRadius;e._rotateFactor=1/S,e._rotateRateRangeAdjustment=S}function XBt(e,t,n){let i=e._scene,o=i.camera,r=e._cameraUnderground,a,s,c=d.UNIT_X;if(k.equals(t,e._tiltCenterMousePosition))a=d.clone(e._tiltCenter,I5);else{if(o.position.z<e._minimumPickingTerrainHeight&&(a=M_(e,t,I5)),!l(a)){s=o.getPickRay(t,b5);let g=s.origin,I=s.direction,T,w=d.dot(c,I);if(Math.abs(w)>D.EPSILON6&&(T=-d.dot(c,g)/w),!l(T)||T<=0){e._looking=!0,$f(e,t,n),k.clone(t,e._tiltCenterMousePosition);return}a=d.multiplyByScalar(I,T,I5),d.add(g,a,a)}r&&(l(s)||(s=o.getPickRay(t,b5)),_Be(e,s,a,a)),k.clone(t,e._tiltCenterMousePosition),d.clone(a,e._tiltCenter)}let u=i.canvas,f=EBe;f.x=u.clientWidth/2,f.y=e._tiltCenterMousePosition.y,s=o.getPickRay(f,b5);let h=d.clone(d.ZERO,HBt);h.x=a.x;let p=cn.fromPointNormal(h,c,WBt),A=di.rayPlane(s,p,GBt),m=o._projection,_=m.ellipsoid;d.fromElements(a.y,a.z,a.x,a);let y=m.unproject(a,Ote);_.cartographicToCartesian(y,a);let C=At.eastNorthUpToFixedFrame(a,_,bBe),E;l(A)?(d.fromElements(A.y,A.z,A.x,A),y=m.unproject(A,Ote),_.cartographicToCartesian(y,A),E=At.eastNorthUpToFixedFrame(A,_,VBt)):E=C;let b=e._globe,x=e._ellipsoid;e._globe=void 0,e._ellipsoid=te.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let S=d.UNIT_Z,B=M.clone(o.transform,IBe);o._setTransform(C);let v=d.cross(d.UNIT_Z,d.normalize(o.position,Rte),Rte),P=d.dot(o.right,v);if(Zf(e,t,n,S,!1,!0),o._setTransform(E),P<0){let g=n.startPosition.y-n.endPosition.y;(r&&g<0||!r&&g>0)&&(S=void 0);let I=o.constrainedAxis;o.constrainedAxis=void 0,Zf(e,t,n,S,!0,!1),o.constrainedAxis=I}else Zf(e,t,n,S,!0,!1);if(l(o.constrainedAxis)){let g=d.cross(o.direction,o.constrainedAxis,x5);d.equalsEpsilon(g,d.ZERO,D.EPSILON6)||(d.dot(g,o.right)<0&&d.negate(g,g),d.cross(g,o.direction,o.up),d.cross(o.direction,o.up,o.right),d.normalize(o.up,o.up),d.normalize(o.right,o.right))}o._setTransform(B),e._globe=b,e._ellipsoid=x;let N=x.maximumRadius;e._rotateFactor=1/N,e._rotateRateRangeAdjustment=N;let L=d.clone(o.positionWC,Rte);if(e.enableCollisionDetection&&Hte(e,!0),!d.equals(o.positionWC,L)){o._setTransform(E),o.worldToCameraCoordinatesPoint(L,L);let g=d.magnitudeSquared(L);d.magnitudeSquared(o.position)>g&&(d.normalize(o.position,o.position),d.multiplyByScalar(o.position,Math.sqrt(g),o.position));let I=d.angleBetween(L,o.position),T=d.cross(L,o.position,L);d.normalize(T,T);let w=Qe.fromAxisAngle(T,I,jBt),R=J.fromQuaternion(w,YBt);J.multiplyByVector(R,o.direction,o.direction),J.multiplyByVector(R,o.up,o.up),d.cross(o.direction,o.up,o.right),d.cross(o.right,o.direction,o.up),o._setTransform(B)}}var xBe=new k,TBe=new yn,SBe=new d;function wBe(e,t,n){l(n.distance)&&(n=n.distance);let i=e._scene,o=i.camera,r=i.canvas,a=e._cameraUnderground,s;a?s=t:(s=xBe,s.x=r.clientWidth/2,s.y=r.clientHeight/2);let c=o.getPickRay(s,TBe),u=c.origin,f=c.direction,h=o.position.z,p;h<e._minimumPickingTerrainHeight&&(p=M_(e,s,SBe));let A;if(l(p)&&(A=d.distance(u,p)),a){let m=gBe(e,c,h);l(A)?A=Math.min(A,m):A=m}if(!l(A)){let m=d.UNIT_X;A=-d.dot(m,u)/d.dot(m,f)}kte(e,t,n,e.zoomFactor,A)}function JBt(e){let n=e._scene.camera;if(!M.equals(M.IDENTITY,n.transform))du(e,e.enableRotate,e.rotateEventTypes,Zf,e.inertiaSpin,"_lastInertiaSpinMovement"),du(e,e.enableZoom,e.zoomEventTypes,zte,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),du(e,e.enableTilt,e.tiltEventTypes,qBt,e.inertiaSpin,"_lastInertiaTiltMovement"),du(e,e.enableTranslate,e.translateEventTypes,zBt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),du(e,e.enableZoom,e.zoomEventTypes,wBe,e.inertiaZoom,"_lastInertiaZoomMovement"),du(e,e.enableLook,e.lookEventTypes,$f),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let o=n.createCorrectPositionTween(e.bounceAnimationTime);l(o)&&(e._tween=i.add(o))}i.update()}}var ZBt=new yn,$Bt=new cn(d.UNIT_X,0),eDt=new d,tDt=new d;function Ute(e,t,n){let i=e._scene,o=i.camera,r=o.getPickRay(t.endPosition,ZBt),a=d.clone(o.direction,tDt);i.mode===oe.COLUMBUS_VIEW&&d.fromElements(a.z,a.x,a.y,a);let s=cn.fromPointNormal(n,a,$Bt),c=di.rayPlane(r,s,eDt);l(c)&&(a=d.subtract(n,c,a),i.mode===oe.COLUMBUS_VIEW&&d.fromElements(a.y,a.z,a.x,a),d.add(o.position,a,o.position))}var lBe=new d,BBe=new me,Fte=new d,Qte=new te,nDt=new d,iDt=new d,oDt=new d;function rDt(e,t,n){let o=e._scene.camera,r=e._cameraUnderground,a=e._ellipsoid;if(!M.equals(o.transform,M.IDENTITY)){Zf(e,t,n);return}let s,c,u=a.geodeticSurfaceNormal(o.position,nDt);if(k.equals(t,e._rotateMousePosition)){if(e._looking)$f(e,t,n,u);else if(e._rotating)Zf(e,t,n);else if(e._strafing)CBe(e,n);else{if(d.magnitude(o.position)<d.magnitude(e._rotateStartPosition))return;s=d.magnitude(e._rotateStartPosition),c=Fte,c.x=c.y=c.z=s,a=te.fromCartesian3(c,Qte),Nte(e,t,n,a)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let f=a.cartesianToCartographic(o.positionWC,BBe).height,h=e._globe;if(l(h)&&f<e._minimumPickingTerrainHeight){let p=M_(e,n.startPosition,oDt);if(l(p)){let A=!1,m=o.getPickRay(n.startPosition,ABe);if(r)A=!0,yBe(e,m,p,p);else{let _=a.geodeticSurfaceNormal(p,iDt);Math.abs(d.dot(m.direction,_))<.05?A=!0:A=d.magnitude(o.position)<d.magnitude(p)}A?(k.clone(t,e._strafeEndMousePosition),d.clone(p,e._strafeStartPosition),e._strafing=!0,Ute(e,n,e._strafeStartPosition)):(s=d.magnitude(p),c=Fte,c.x=c.y=c.z=s,a=te.fromCartesian3(c,Qte),Nte(e,t,n,a),d.clone(p,e._rotateStartPosition))}else e._looking=!0,$f(e,t,n,u)}else l(o.pickEllipsoid(n.startPosition,e._ellipsoid,lBe))?(Nte(e,t,n,e._ellipsoid),d.clone(lBe,e._rotateStartPosition)):f>e._minimumTrackBallHeight?(e._rotating=!0,Zf(e,t,n)):(e._looking=!0,$f(e,t,n,u));k.clone(t,e._rotateMousePosition)}function Zf(e,t,n,i,o,r){o=o??!1,r=r??!1;let a=e._scene,s=a.camera,c=a.canvas,u=s.constrainedAxis;l(i)&&(s.constrainedAxis=i);let f=d.magnitude(s.position),h=e._rotateFactor*(f-e._rotateRateRangeAdjustment);h>e._maximumRotateRate&&(h=e._maximumRotateRate),h<e._minimumRotateRate&&(h=e._minimumRotateRate);let p=(n.startPosition.x-n.endPosition.x)/c.clientWidth,A=(n.startPosition.y-n.endPosition.y)/c.clientHeight;p=Math.min(p,e.maximumMovementRatio),A=Math.min(A,e.maximumMovementRatio);let m=h*p*Math.PI*2,_=h*A*Math.PI;if(l(i)&&l(e.maximumTiltAngle)){let y=e.maximumTiltAngle,C=d.dot(s.direction,i),E=Math.PI-Math.acos(C)+_;E>y&&(_-=E-y)}o||s.rotateRight(m),r||s.rotateUp(_),s.constrainedAxis=u}var Mte=ie.clone(ie.UNIT_W),uBe=ie.clone(ie.UNIT_W),C5=new d,pB=new d,E5=new d,fBe=new d,aDt=new k,sDt=new k,cDt=new k,lDt=new k,uDt=new yn;function Nte(e,t,n,i){let o=e._scene,r=o.camera,a=k.clone(n.startPosition,aDt),s=k.clone(n.endPosition,sDt),c=i.cartesianToCartographic(r.positionWC,BBe).height,u,f;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(u=d.clone(e._panLastWorldPosition,Mte),!l(e._globe)&&!k.equalsEpsilon(a,e._panLastMousePosition)&&(u=M_(e,a,Mte)),!l(e._globe)&&l(u))){let h=d.subtract(u,r.positionWC,pB),p=d.multiplyByScalar(r.directionWC,d.dot(r.directionWC,h),pB),A=d.magnitude(p),m=r.frustum.getPixelDimensions(o.drawingBufferWidth,o.drawingBufferHeight,A,o.pixelRatio,lDt),_=k.subtract(s,a,cDt),y=d.multiplyByScalar(r.rightWC,_.x*m.x,pB),C=d.normalize(r.positionWC,pBe),E=r.getPickRay(s,uDt).direction,b=d.subtract(E,d.projectVector(E,r.rightWC,E5),E5),x=d.angleBetween(b,r.directionWC),S=1;l(r.frustum.fov)&&(S=Math.max(Math.tan(x),.1));let B=Math.abs(d.dot(r.directionWC,C)),v=-_.y*m.y*2/Math.sqrt(S)*(1-B),P=d.multiplyByScalar(E,v,E5);B=Math.abs(d.dot(r.upWC,C));let N=d.multiplyByScalar(r.upWC,-_.y*(1-B)*m.y,fBe);f=d.add(u,y,uBe),f=d.add(f,P,f),f=d.add(f,N,f),d.clone(f,e._panLastWorldPosition),k.clone(s,e._panLastMousePosition)}if((!l(u)||!l(f))&&(u=r.pickEllipsoid(a,i,Mte),f=r.pickEllipsoid(s,i,uBe)),!l(u)||!l(f)){e._rotating=!0,Zf(e,t,n);return}if(u=r.worldToCameraCoordinates(u,u),f=r.worldToCameraCoordinates(f,f),l(r.constrainedAxis)){let h=r.constrainedAxis,p=d.mostOrthogonalAxis(h,C5);d.cross(p,h,p),d.normalize(p,p);let A=d.cross(h,p,pB),m=d.magnitude(u),_=d.dot(h,u),y=Math.acos(_/m),C=d.multiplyByScalar(h,_,E5);d.subtract(u,C,C),d.normalize(C,C);let E=d.magnitude(f),b=d.dot(h,f),x=Math.acos(b/E),S=d.multiplyByScalar(h,b,fBe);d.subtract(f,S,S),d.normalize(S,S);let B=Math.acos(d.dot(C,p));d.dot(C,A)<0&&(B=D.TWO_PI-B);let v=Math.acos(d.dot(S,p));d.dot(S,A)<0&&(v=D.TWO_PI-v);let P=B-v,N;d.equalsEpsilon(h,r.position,D.EPSILON2)?N=r.right:N=d.cross(h,r.position,C5);let L=d.cross(h,N,C5),g=d.dot(L,d.subtract(u,h,pB)),I=d.dot(L,d.subtract(f,h,pB)),T;g>0&&I>0?T=x-y:g>0&&I<=0?d.dot(r.position,h)>0?T=-y-x:T=y+x:T=y-x,r.rotateRight(P),r.rotateUp(T)}else{d.normalize(u,u),d.normalize(f,f);let h=d.dot(u,f),p=d.cross(u,f,C5);if(h<1&&!d.equalsEpsilon(p,d.ZERO,D.EPSILON14)){let A=Math.acos(h);r.rotate(p,A)}}}var fDt=new d,dDt=new me,dBe=0;function zte(e,t,n){l(n.distance)&&(n=n.distance);let i=n.inertiaEnabled,o=e._ellipsoid,r=e._scene,a=r.camera,s=r.canvas,c=e._cameraUnderground,u;c?u=t:(u=xBe,u.x=s.clientWidth/2,u.y=s.clientHeight/2);let f=a.getPickRay(u,TBe),h,p=o.cartesianToCartographic(a.position,dDt).height,A=Math.abs(dBe)<e.minimumPickingTerrainDistanceWithInertia;(i?A:p<e._minimumPickingTerrainHeight)&&(h=M_(e,u,SBe));let _;if(l(h)&&(_=d.distance(f.origin,h)),!l(e._globe)&&l(_)&&a.getMagnitude()<_&&(h=void 0,_=void 0),l(_)&&(dBe=_),c){let C=gBe(e,f,p);l(_)?_=Math.min(_,C):_=C}l(_)||(_=p);let y=d.normalize(a.position,fDt);kte(e,t,n,e.zoomFactor,_,d.dot(y,a.direction))}var DBe=new k,T5=new yn,G3=new d,hDt=new d,vBe=new M,mDt=new M,PBe=new M,pDt=new Qe,ADt=new J,Gte=new me,Vte=new d;function gDt(e,t,n){let o=e._scene.camera;if(!M.equals(o.transform,M.IDENTITY))return;if(l(n.angleAndHeight)&&(n=n.angleAndHeight),k.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let s=e._ellipsoid.geodeticSurfaceNormal(o.position,Vte);$f(e,t,n,s);return}let a=e._ellipsoid.cartesianToCartographic(o.position,Gte);e._tiltOnEllipsoid||a.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,yDt(e,t,n)):CDt(e,t,n)}var _Dt=new me;function yDt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,a=e.minimumZoomDistance*.25,s=i.cartesianToCartographic(r.positionWC,_Dt).height;if(s-a-1<D.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=o.canvas,u=DBe;u.x=c.clientWidth/2,u.y=c.clientHeight/2;let f=r.getPickRay(u,T5),h,p=di.rayEllipsoid(f,i);if(l(p))h=yn.getPoint(f,p.start,G3);else if(s>e._minimumTrackBallHeight){let E=di.grazingAltitudeLocation(f,i);if(!l(E))return;let b=i.cartesianToCartographic(E,Gte);b.height=0,h=i.cartographicToCartesian(b,G3)}else{e._looking=!0;let E=e._ellipsoid.geodeticSurfaceNormal(r.position,Vte);$f(e,t,n,E),k.clone(t,e._tiltCenterMousePosition);return}let A=At.eastNorthUpToFixedFrame(h,i,vBe),m=e._globe,_=e._ellipsoid;e._globe=void 0,e._ellipsoid=te.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let y=M.clone(r.transform,PBe);r._setTransform(A),Zf(e,t,n,d.UNIT_Z),r._setTransform(y),e._globe=m,e._ellipsoid=_;let C=_.maximumRadius;e._rotateFactor=1/C,e._rotateRateRangeAdjustment=C}function CDt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,a=e._cameraUnderground,s,c,u;if(k.equals(t,e._tiltCenterMousePosition))s=d.clone(e._tiltCenter,G3);else{if(s=M_(e,t,G3),!l(s)){if(c=r.getPickRay(t,T5),u=di.rayEllipsoid(c,i),!l(u)){if(i.cartesianToCartographic(r.position,Gte).height<=e._minimumTrackBallHeight){e._looking=!0;let I=e._ellipsoid.geodeticSurfaceNormal(r.position,Vte);$f(e,t,n,I),k.clone(t,e._tiltCenterMousePosition)}return}s=yn.getPoint(c,u.start,G3)}a&&(l(c)||(c=r.getPickRay(t,T5)),_Be(e,c,s,s)),k.clone(t,e._tiltCenterMousePosition),d.clone(s,e._tiltCenter)}let f=o.canvas,h=DBe;h.x=f.clientWidth/2,h.y=e._tiltCenterMousePosition.y,c=r.getPickRay(h,T5);let p=d.magnitude(s),A=d.fromElements(p,p,p,Fte),m=te.fromCartesian3(A,Qte);if(u=di.rayEllipsoid(c,m),!l(u))return;let _=d.magnitude(c.origin)>p?u.start:u.stop,y=yn.getPoint(c,_,hDt),C=At.eastNorthUpToFixedFrame(s,i,vBe),E=At.eastNorthUpToFixedFrame(y,m,mDt),b=e._globe,x=e._ellipsoid;e._globe=void 0,e._ellipsoid=te.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let S=d.UNIT_Z,B=M.clone(r.transform,PBe);r._setTransform(E);let v=d.cross(y,r.positionWC,x5);if(d.dot(r.rightWC,v)<0){let g=n.startPosition.y-n.endPosition.y;(a&&g<0||!a&&g>0)&&(S=void 0);let I=r.constrainedAxis;r.constrainedAxis=void 0,Zf(e,t,n,S,!0,!1),r.constrainedAxis=I}else Zf(e,t,n,S,!0,!1);if(r._setTransform(C),Zf(e,t,n,S,!1,!0),l(r.constrainedAxis)){let g=d.cross(r.direction,r.constrainedAxis,x5);d.equalsEpsilon(g,d.ZERO,D.EPSILON6)||(d.dot(g,r.right)<0&&d.negate(g,g),d.cross(g,r.direction,r.up),d.cross(r.direction,r.up,r.right),d.normalize(r.up,r.up),d.normalize(r.right,r.right))}r._setTransform(B),e._globe=b,e._ellipsoid=x;let N=x.maximumRadius;e._rotateFactor=1/N,e._rotateRateRangeAdjustment=N;let L=d.clone(r.positionWC,x5);if(e.enableCollisionDetection&&Hte(e,!0),!d.equals(r.positionWC,L)){r._setTransform(E),r.worldToCameraCoordinatesPoint(L,L);let g=d.magnitudeSquared(L);d.magnitudeSquared(r.position)>g&&(d.normalize(r.position,r.position),d.multiplyByScalar(r.position,Math.sqrt(g),r.position));let I=d.angleBetween(L,r.position),T=d.cross(L,r.position,L);d.normalize(T,T);let w=Qe.fromAxisAngle(T,I,pDt),R=J.fromQuaternion(w,ADt);J.multiplyByVector(R,r.direction,r.direction),J.multiplyByVector(R,r.up,r.up),d.cross(r.direction,r.up,r.right),d.cross(r.right,r.direction,r.up),r._setTransform(B)}}var EDt=new k,bDt=new k,hBe=new yn,mBe=new yn,IDt=new d,xDt=new d;function $f(e,t,n,i){let r=e._scene.camera,a=EDt;a.x=n.startPosition.x,a.y=0;let s=bDt;s.x=n.endPosition.x,s.y=0;let c=r.getPickRay(a,hBe),u=r.getPickRay(s,mBe),f=0,h,p;r.frustum instanceof An?(h=c.origin,p=u.origin,d.add(r.direction,h,h),d.add(r.direction,p,p),d.subtract(h,r.position,h),d.subtract(p,r.position,p),d.normalize(h,h),d.normalize(p,p)):(h=c.direction,p=u.direction);let A=d.dot(h,p);A<1&&(f=Math.acos(A)),f=n.startPosition.x>n.endPosition.x?-f:f;let m=e._horizontalRotationAxis;if(l(i)?r.look(i,-f):l(m)?r.look(m,-f):r.lookLeft(f),a.x=0,a.y=n.startPosition.y,s.x=0,s.y=n.endPosition.y,c=r.getPickRay(a,hBe),u=r.getPickRay(s,mBe),f=0,r.frustum instanceof An?(h=c.origin,p=u.origin,d.add(r.direction,h,h),d.add(r.direction,p,p),d.subtract(h,r.position,h),d.subtract(p,r.position,p),d.normalize(h,h),d.normalize(p,p)):(h=c.direction,p=u.direction),A=d.dot(h,p),A<1&&(f=Math.acos(A)),f=n.startPosition.y>n.endPosition.y?-f:f,i=i??m,l(i)){let _=r.direction,y=d.negate(i,IDt),C=d.equalsEpsilon(_,i,D.EPSILON2),E=d.equalsEpsilon(_,y,D.EPSILON2);if(!C&&!E){A=d.dot(_,i);let b=D.acosClamped(A);f>0&&f>b&&(f=b-D.EPSILON4),A=d.dot(_,y),b=D.acosClamped(A),f<0&&-f>b&&(f=-b+D.EPSILON4);let x=d.cross(i,_,xDt);r.look(x,f)}else(C&&f<0||E&&f>0)&&r.look(r.right,-f)}else r.lookUp(f)}function TDt(e){du(e,e.enableRotate,e.rotateEventTypes,rDt,e.inertiaSpin,"_lastInertiaSpinMovement"),du(e,e.enableZoom,e.zoomEventTypes,zte,e.inertiaZoom,"_lastInertiaZoomMovement"),du(e,e.enableTilt,e.tiltEventTypes,gDt,e.inertiaSpin,"_lastInertiaTiltMovement"),du(e,e.enableLook,e.lookEventTypes,$f)}var SDt=new M,wDt=new me;function Hte(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=n.ellipsoid??te.WGS84,a=n.mapProjection,s,c;M.equals(o.transform,M.IDENTITY)||(s=M.clone(o.transform,SDt),c=d.magnitude(o.position),o._setTransform(M.IDENTITY));let u=wDt;i===oe.SCENE3D?r.cartesianToCartographic(o.position,u):a.unproject(o.position,u);let f=!1;if(u.height<e._minimumCollisionTerrainHeight){let h=e._scene.globeHeight;if(l(h)){let p=h+e.minimumZoomDistance,A=h-e._lastGlobeHeight,m=A/e._lastGlobeHeight;u.height<p&&(t||Math.abs(m)<=.1)&&(u.height=p,i===oe.SCENE3D?r.cartographicToCartesian(u,o.position):a.project(u,o.position),f=!0),t||Math.abs(m)<=.1?e._lastGlobeHeight=h:e._lastGlobeHeight+=A*.1}}l(s)&&(o._setTransform(s),f&&(d.normalize(o.position,o.position),d.negate(o.position,o.direction),d.multiplyByScalar(o.position,Math.max(c,e.minimumZoomDistance),o.position),d.normalize(o.direction,o.direction),d.cross(o.direction,o.up,o.right),d.cross(o.right,o.direction,o.up)))}nE.zoom2D=Lte;nE.zoomCV=wBe;nE.zoom3D=zte;nE.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 BDt=new d,DDt=new d;nE.prototype.update=function(){let e=this._scene,{camera:t,globe:n,mode:i}=e;M.equals(t.transform,M.IDENTITY)?(this._globe=n,this._ellipsoid=e.ellipsoid??te.default):(this._globe=void 0,this._ellipsoid=te.UNIT_SPHERE);let{verticalExaggeration:o,verticalExaggerationRelativeHeight:r}=e;this._minimumCollisionTerrainHeight=xo.getHeight(this.minimumCollisionTerrainHeight,o,r),this._minimumPickingTerrainHeight=xo.getHeight(this.minimumPickingTerrainHeight,o,r),this._minimumTrackBallHeight=xo.getHeight(this.minimumTrackBallHeight,o,r),this._cameraUnderground=e.cameraUnderground&&l(this._globe);let a=this._ellipsoid.maximumRadius;this._rotateFactor=1/a,this._rotateRateRangeAdjustment=a,this._adjustedHeightForTerrain=!1;let s=d.clone(t.positionWC,BDt),c=d.clone(t.directionWC,DDt);if(i===oe.SCENE2D?BBt(this):i===oe.COLUMBUS_VIEW?(this._horizontalRotationAxis=d.UNIT_Z,JBt(this)):i===oe.SCENE3D&&(this._horizontalRotationAxis=void 0,TDt(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let u=!d.equals(s,t.positionWC)||!d.equals(c,t.directionWC);Hte(this,u)}this._aggregator.reset()};nE.prototype.isDestroyed=function(){return!1};nE.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),fe(this)};var V3=nE;var H3=`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 W3=`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 N_(){this._sceneFramebuffer=new TI;let e=.125,t=new Array(6);t[0]=new No({fragmentShader:Yu,textureScale:e,forcePowerOfTwo:!0,sampleMode:Xf.LINEAR});let n=t[1]=new No({fragmentShader:W3,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new k,t[2]=new No({fragmentShader:tE,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 No({fragmentShader:tE,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 No({fragmentShader:Yu,sampleMode:Xf.LINEAR}),this._uCenter=new k,this._uRadius=void 0,t[5]=new No({fragmentShader:H3,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new qu({stages:t});let o=new RI(this),r=t.length;for(let a=0;a<r;++a)t[a]._textureCache=o;this._textureCache=o,this.length=t.length}N_.prototype.get=function(e){return this._stages.get(e)};N_.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 vDt=new ie,RBe=new k,PDt=new k,MBe=new M;function RDt(e,t,n){let i=t.uniformState,o=i.sunPositionWC,r=i.view,a=i.viewProjection,s=i.projection,c=M.computeViewportTransformation(n,0,1,MBe),u=M.multiplyByPoint(r,o,vDt),f=At.pointToGLWindowCoordinates(a,c,o,RBe);u.x+=D.SOLAR_RADIUS;let h=At.pointToGLWindowCoordinates(s,c,u,u),p=k.magnitude(k.subtract(h,f,h))*30*2,A=PDt;A.x=p,A.y=p,e._uCenter=k.clone(f,e._uCenter),e._uRadius=Math.max(A.x,A.y)*.15;let m=t.drawingBufferWidth,_=t.drawingBufferHeight,y=e._stages,C=y.get(0),E=C.outputTexture.width,b=C.outputTexture.height,x=new et;x.width=E,x.height=b,c=M.computeViewportTransformation(x,0,1,MBe),f=At.pointToGLWindowCoordinates(a,c,o,RBe),A.x*=E/m,A.y*=b/_;let S=C.scissorRectangle;S.x=Math.max(f.x-A.x*.5,0),S.y=Math.max(f.y-A.y*.5,0),S.width=Math.min(A.x,m),S.height=Math.min(A.y,_);for(let B=1;B<4;++B)et.clone(S,y.get(B).scissorRectangle)}N_.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};N_.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),RDt(this,t,n),o};N_.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)};N_.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Yu,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};N_.prototype.isDestroyed=function(){return!1};N_.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),fe(this)};var j3=N_;function NBe(){this._cachedShowFrustumsShaders={}}function MDt(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function NDt(e,t){let n=e.context,i=t,o=i.fragmentShaderSource.clone(),r=[];o.sources=o.sources.map(function(f){f=We.replaceMain(f,"czm_Debug_main");let h=/out_FragData_(\d+)/g,p;for(;(p=h.exec(f))!==null;)r.indexOf(p[1])===-1&&r.push(p[1]);return f});let a=r.length,s="";s+=`uniform vec3 debugShowCommandsColor;
`,s+=`uniform vec3 debugShowFrustumsColor;
`,s+=`void main()
{
czm_Debug_main();
`;let c;if(a>0)for(c=0;c<a;++c)s+=` out_FragData_${r[c]}.rgb *= debugShowCommandsColor;
`,s+=` out_FragData_${r[c]}.rgb *= debugShowFrustumsColor;
`;else s+=` out_FragColor.rgb *= debugShowCommandsColor;
`,s+=` out_FragColor.rgb *= debugShowFrustumsColor;
`;s+="}",o.sources.push(s);let u=MDt(i);return $t.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:o,attributeLocations:u})}var Y3=new z;function LDt(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=z.fromRandom()),t._debugColor):z.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(Y3.red=t.debugOverlappingFrustums&1?1:0,Y3.green=t.debugOverlappingFrustums&2?1:0,Y3.blue=t.debugOverlappingFrustums&4?1:0,Y3.alpha=1,Y3):z.WHITE}),n}var ODt=new nt;NBe.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,o=this._cachedShowFrustumsShaders[i];l(o)||(o=NDt(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=o);let r=nt.shallowClone(t,ODt);r.shaderProgram=o,r.uniformMap=LDt(e,t),r.execute(e.context,n)};var q3=NBe;function FI(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new en}FI.fromKeyframeNode=function(e,t,n,i){let o=new FI(e,t,n),{spatialNode:r,content:a}=i;return o._metadata=FDt(e,a,n),o._orientedBoundingBox=kDt(e,r,n,o._orientedBoundingBox),o};function FDt(e,t,n){if(!l(t)||!l(t.metadata))return;let{names:i,types:o}=e.provider,{metadata:r}=t,a={};for(let s=0;s<i.length;s++){let c=i[s],u=bt.getComponentCount(o[s]),f=r[s].slice(n*u,(n+1)*u);a[c]=f}return a}var LBe=new d,QDt=new d;function kDt(e,t,n,i){let o=t.dimensions,r=o.x*o.y,a=Math.floor(n/r),s=n-a*r,c=Math.floor(s/o.x),u=s-c*o.x,f=d.fromElements(u,c,a,LBe),h=d.divideComponents(d.subtract(f,e._paddingBefore,LBe),e.dimensions,QDt);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,h,i)}Object.defineProperties(FI.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()}}});FI.prototype.hasProperty=function(e){return l(this._metadata[e])};FI.prototype.getNames=function(){return Object.keys(this._metadata)};FI.prototype.getProperty=function(e){return this._metadata[e]};var K3=FI;function UDt(e,t){let{shaderBuilder:n}=e,{names:i,types:o,componentTypes:r,minimumValues:a,maximumValues:s}=t._provider,c=o.length,u=l(a)&&l(s);n.addDefine("METADATA_COUNT",c,he.FRAGMENT),u&&n.addDefine("STATISTICS",void 0,he.FRAGMENT);for(let g=0;g<c;g++){let I=i[g],T=w5(o[g]),w=`PropertyStatistics_${I}`,R=`PropertyStatistics_${I}`;n.addStruct(w,R,he.FRAGMENT),n.addStructField(w,T,"min"),n.addStructField(w,T,"max")}let f="MetadataStatistics",h="MetadataStatistics",p="metadataStatistics";n.addStruct(f,h,he.FRAGMENT);for(let g=0;g<c;g++){let I=i[g],T=`PropertyStatistics_${I}`,w=I;n.addStructField(f,T,w)}let A="Metadata",m="Metadata",_="metadata";n.addStruct(A,m,he.FRAGMENT);for(let g=0;g<c;g++){let I=w5(o[g]);n.addStructField(A,I,i[g])}let y="Attributes",C="Attributes",E="attributes";n.addStruct(y,C,he.FRAGMENT),n.addStructField(y,"vec3","positionEC"),n.addStructField(y,"vec3","normalEC");let b="Voxel",x="Voxel",S="voxel";n.addStruct(b,x,he.FRAGMENT),n.addStructField(b,"vec3","viewDirUv"),n.addStructField(b,"float","travelDistance"),n.addStructField(b,"int","stepCount"),n.addStructField(b,"int","tileIndex"),n.addStructField(b,"int","sampleIndex"),n.addStructField(b,"float","distanceToDepthBuffer");let B="FragmentInput";n.addStruct(B,"FragmentInput",he.FRAGMENT),n.addStructField(B,h,p),n.addStructField(B,m,_),n.addStructField(B,C,E),n.addStructField(B,x,S);let P="Properties",N="Properties",L="properties";n.addStruct(P,N,he.FRAGMENT);for(let g=0;g<c;g++){let I=w5(o[g]);n.addStructField(P,I,i[g])}{let g="clearProperties";n.addFunction(g,`${N} clearProperties()`,he.FRAGMENT),n.addFunctionLines(g,[`${N} ${L};`]);for(let I=0;I<c;I++){let T=w5(o[I],r[I]);n.addFunctionLines(g,[`${L}.${i[I]} = ${T}(0.0);`])}n.addFunctionLines(g,[`return ${L};`])}{let g="sumProperties";n.addFunction(g,`${N} sumProperties(${N} propertiesA, ${N} propertiesB)`,he.FRAGMENT),n.addFunctionLines(g,[`${N} ${L};`]);for(let I=0;I<c;I++){let T=i[I];n.addFunctionLines(g,[`${L}.${T} = propertiesA.${T} + propertiesB.${T};`])}n.addFunctionLines(g,[`return ${L};`])}{let g="scaleProperties";n.addFunction(g,`${N} scaleProperties(${N} ${L}, float scale)`,he.FRAGMENT),n.addFunctionLines(g,[`${N} scaledProperties = ${L};`]);for(let I=0;I<c;I++)n.addFunctionLines(g,[`scaledProperties.${i[I]} *= scale;`]);n.addFunctionLines(g,["return scaledProperties;"])}{let g="mixProperties";n.addFunction(g,`${N} mixProperties(${N} propertiesA, ${N} propertiesB, float mixFactor)`,he.FRAGMENT),n.addFunctionLines(g,[`${N} ${L};`]);for(let I=0;I<c;I++){let T=i[I];n.addFunctionLines(g,[`${L}.${T} = mix(propertiesA.${T}, propertiesB.${T}, mixFactor);`])}n.addFunctionLines(g,[`return ${L};`])}{let g="copyPropertiesToMetadata";n.addFunction(g,`void copyPropertiesToMetadata(in ${N} ${L}, inout ${m} ${_})`,he.FRAGMENT);for(let I=0;I<c;I++){let T=i[I];n.addFunctionLines(g,[`${_}.${T} = ${L}.${T};`])}}if(u){let g="setStatistics";n.addFunction(g,`void setStatistics(inout ${h} ${p})`,he.FRAGMENT);for(let I=0;I<c;I++){let T=i[I],w=o[I],R=bt.getComponentCount(w);for(let O=0;O<R;O++){let G=GDt(w,O),F=a[I][O],U=s[I][O];!l(F)||!l(U)||n.addFunctionLines(g,[`${p}.${T}.min${G} = ${OBe(F)};`,`${p}.${T}.max${G} = ${OBe(U)};`])}}}{let g="getPropertiesFromMegatextureAtUv";n.addFunction(g,`${N} getPropertiesFromMegatextureAtUv(vec3 texcoord)`,he.FRAGMENT),n.addFunctionLines(g,[`${N} ${L};`]);for(let I=0;I<c;I++){let T=o[I],w=r[I],R=zDt(T,w);n.addFunctionLines(g,[`properties.${i[I]} = texture(u_megatextureTextures[${I}], texcoord)${R};`])}n.addFunctionLines(g,[`return ${L};`])}}function w5(e){if(e===bt.SCALAR)return"float";if(e===bt.VEC2)return"vec2";if(e===bt.VEC3)return"vec3";if(e===bt.VEC4)return"vec4"}function zDt(e){if(e===bt.SCALAR)return".r";if(e===bt.VEC2)return".ra";if(e===bt.VEC3)return".rgb";if(e===bt.VEC4)return""}function OBe(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function GDt(e,t){return e===bt.SCALAR?"":`[${t}]`}var X3=UDt;function Hm(e){let{planes:t,modelMatrix:n=M.IDENTITY,unionClippingRegions:i=!1}=e??V.EMPTY_OBJECT;if(this._planes=[],this.modelMatrix=M.clone(n),this.planeAdded=new _e,this.planeRemoved=new _e,this._unionClippingRegions=i,this._testIntersection=i?FBe:QBe,this._float32View=void 0,this._clippingPlanesTexture=void 0,l(t))for(let o=0;o<t.length;++o)this.add(t[o])}function FBe(e){return e===Xt.OUTSIDE}function QBe(e){return e===Xt.INSIDE}Object.defineProperties(Hm.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?FBe:QBe)}},texture:{get:function(){return this._clippingPlanesTexture}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}});Hm.prototype.add=function(e){let t=this._planes.length;e.index=t,this._planes.push(e),this.planeAdded.raiseEvent(e,t)};Hm.prototype.get=function(e){return this._planes[e]};function kBe(e,t){for(let n=0;n<e.length;++n)if(cn.equals(e[n],t))return n;return-1}Hm.prototype.contains=function(e){return kBe(this._planes,e)!==-1};Hm.prototype.remove=function(e){let t=this._planes,n=kBe(t,e);if(n===-1)return!1;e instanceof Xa&&(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 Xa&&(r.index=o)}return t.length=i,this.planeRemoved.raiseEvent(e,n),!0};Hm.prototype.removeAll=function(){let e=this._planes;for(let t=0;t<e.length;++t){let n=e[t];n instanceof Xa&&(n.onChangeCallback=void 0,n.index=-1),this.planeRemoved.raiseEvent(n,t)}this._planes=[]};var VDt=new cn(d.fromElements(1,0,0),0);function HDt(e,t){let n=e._float32View,i=e._planes,o=0;for(let r=0;r<i.length;++r){let{normal:a,distance:s}=jDt(i[r],t,VDt);n[o]=a.x,n[o+1]=a.y,n[o+2]=a.z,n[o+3]=s,o+=4}}var Wte=new ie,WDt=new d;function jDt(e,t,n){let{normal:i,distance:o}=e,r=ie.fromElements(i.x,i.y,i.z,o,Wte),a=M.multiplyByVector(t,r,Wte),s=d.fromCartesian4(a,WDt);return a=ie.divideByScalar(a,d.magnitude(s),Wte),cn.fromCartesian4(a,n)}function UBe(e,t){return t.x=Math.min(e,Rt.maximumTextureSize),t.y=Math.ceil(e/t.x),t}var YDt=new k;Hm.prototype.update=function(e,t){let n=this._clippingPlanesTexture,i=this.length;if(l(n)){let a=n.width*n.height;(a<i||i<.25*a)&&(n.destroy(),n=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!l(n)){let a=UBe(i,YDt);a.y*=2,n=new Dt({context:e.context,width:a.x,height:a.y,pixelFormat:qe.RGBA,pixelDatatype:He.FLOAT,sampler:jt.NEAREST,flipY:!1}),this._float32View=new Float32Array(a.x*a.y*4),this._clippingPlanesTexture=n}let{width:o,height:r}=n;HDt(this,t),n.copyFrom({source:{width:o,height:r,arrayBufferView:this._float32View}})};Hm.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let o=e.length,r=UBe(o,n);return r.y*=2,r};Hm.prototype.isDestroyed=function(){return!1};Hm.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),fe(this)};var L_=Hm;var J3=`struct Ray {
vec3 pos;
vec3 dir;
};
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);
}
`;var Z3=`// See Intersection.glsl for the definition of intersectScene
// See IntersectionUtils.glsl for the definition of nextIntersection
// See convertLocalToBoxUv.glsl, convertLocalToCylinderUv.glsl, or convertLocalToEllipsoidUv.glsl
// for the definitions of convertLocalToShapeSpaceDerivative and getTileAndUvCoordinate.
// The appropriate functions are 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 mat4 u_transformPositionViewToLocal;
uniform mat3 u_transformDirectionViewToLocal;
uniform vec3 u_cameraPositionLocal;
uniform vec3 u_cameraDirectionLocal;
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) {
vec3 gradient = viewRay.dir * jacobianT;
vec3 sampleSizeAlongRay = getSampleSize(sampleData.tileCoords.w) / gradient;
RayShapeIntersection voxelIntersection = getVoxelIntersection(sampleData.tileUv, sampleSizeAlongRay);
// Transform normal from shape space to Cartesian space to eye space
vec3 voxelNormal = jacobianT * voxelIntersection.entry.xyz;
voxelNormal = normalize(czm_normal * voxelNormal);
// 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 SampleData sampleData) {
// tileUv = 1.0 is a valid coordinate but sampleIndex = u_inputDimensions is not.
// (tileUv = 1.0 corresponds to the far edge of the last sample, at index = u_inputDimensions - 1).
// Clamp to [0, voxelDimensions - 0.5) to avoid numerical error before flooring
vec3 maxCoordinate = vec3(u_inputDimensions) - vec3(0.5);
vec3 inputCoordinate = clamp(sampleData.inputCoordinate, vec3(0.0), maxCoordinate);
ivec3 sampleIndex = ivec3(floor(inputCoordinate));
// Convert to a 1D index for lookup in a 1D data array
return sampleIndex.x + u_inputDimensions.x * (sampleIndex.y + u_inputDimensions.y * sampleIndex.z);
}
/**
* Compute the view ray at the current fragment, in the local coordinates of the shape.
*/
Ray getViewRayLocal() {
vec4 eyeCoordinates = czm_windowToEyeCoordinates(gl_FragCoord);
vec3 origin;
vec3 direction;
if (czm_orthographicIn3D == 1.0) {
eyeCoordinates.z = 0.0;
origin = (u_transformPositionViewToLocal * eyeCoordinates).xyz;
direction = u_cameraDirectionLocal;
} else {
origin = u_cameraPositionLocal;
direction = u_transformDirectionViewToLocal * normalize(eyeCoordinates.xyz);
}
return Ray(origin, direction);
}
Ray getViewRayEC() {
vec4 eyeCoordinates = czm_windowToEyeCoordinates(gl_FragCoord);
vec3 viewPosEC = (czm_orthographicIn3D == 1.0)
? vec3(eyeCoordinates.xy, 0.0)
: vec3(0.0);
vec3 viewDirEC = normalize(eyeCoordinates.xyz);
return Ray(viewPosEC, viewDirEC);
}
void main()
{
Ray viewRayLocal = getViewRayLocal();
Ray viewRayEC = getViewRayEC();
Intersections ix;
vec2 screenCoord = (gl_FragCoord.xy - czm_viewport.xy) / czm_viewport.zw; // [0,1]
RayShapeIntersection shapeIntersection = intersectScene(screenCoord, viewRayLocal, viewRayEC, 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 positionEC = viewRayEC.pos + currentT * viewRayEC.dir;
TileAndUvCoordinate tileAndUv = getTileAndUvCoordinate(positionEC);
vec3 positionLocal = viewRayLocal.pos + currentT * viewRayLocal.dir;
mat3 jacobianT = convertLocalToShapeSpaceDerivative(positionLocal);
// Traverse the tree from the start position
TraversalData traversalData;
SampleData sampleDatas[SAMPLE_COUNT];
traverseOctreeFromBeginning(tileAndUv, traversalData, sampleDatas);
vec4 step = getStepSize(sampleDatas[0], viewRayLocal, shapeIntersection, jacobianT, currentT);
FragmentInput fragmentInput;
#if defined(STATISTICS)
setStatistics(fragmentInput.metadataStatistics);
#endif
czm_modelMaterial materialOutput;
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.attributes.positionEC = positionEC;
// Re-normalize normals: some shape intersections may have been scaled to encode positive/negative shapes
fragmentInput.attributes.normalEC = normalize(step.xyz);
fragmentInput.voxel.viewDirUv = viewRayLocal.dir;
fragmentInput.voxel.travelDistance = step.w;
fragmentInput.voxel.stepCount = stepCount;
fragmentInput.voxel.tileIndex = sampleDatas[0].megatextureIndex;
fragmentInput.voxel.sampleIndex = getSampleIndex(sampleDatas[0]);
fragmentInput.voxel.distanceToDepthBuffer = ix.distanceToDepthBuffer - currentT;
// Run the custom shader
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.001;
}
// Keep raymarching
currentT += step.w;
// 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;
}
#endif
}
positionEC = viewRayEC.pos + currentT * viewRayEC.dir;
tileAndUv = getTileAndUvCoordinate(positionEC);
positionLocal = viewRayLocal.pos + currentT * viewRayLocal.dir;
jacobianT = convertLocalToShapeSpaceDerivative(positionLocal);
// 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.
traverseOctreeFromExisting(tileAndUv, traversalData, sampleDatas);
step = getStepSize(sampleDatas[0], viewRayLocal, shapeIntersection, 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]));
out_FragColor = vec4(megatextureId, sampleIndex);
#else
out_FragColor = colorAccum;
#endif
}
`;var $3=`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 eU=`/* 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];
float distanceToDepthBuffer;
#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 = 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 tU=`// 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 ###
*/
void intersectDepth(in vec2 screenCoord, in Ray ray, inout Intersections ix) {
float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, screenCoord));
float entry;
float exit;
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;
entry = dot(eyeCoordinateDepth.xyz - ray.pos, ray.dir);
exit = +INF_HIT;
} else {
// There's no depth at this location.
entry = NO_HIT;
exit = NO_HIT;
}
ix.distanceToDepthBuffer = entry;
#if defined(DEPTH_TEST)
setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(entry, exit));
#endif
}
`;var nU=`// 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);
}
#ifdef CLIPPING_PLANES
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);
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);
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);
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
}
#endif
`;var AB=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, INF_HIT,
// RayShapeIntersection
vec4 transformNormalToEC(in vec4 intersection) {
return vec4(normalize(czm_normal * intersection.xyz), intersection.w);
}
RayShapeIntersection transformNormalsToEC(in RayShapeIntersection ix) {
return RayShapeIntersection(transformNormalToEC(ix.entry), transformNormalToEC(ix.exit));
}
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] = transformNormalsToEC(intersectHalfSpace(ray, minMaxAngle.x, false));
intersections[1] = transformNormalsToEC(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);
bool hitPositiveSide = hitPositiveHalfPlane(ray, intersection, true);
farSide = transformNormalToEC(farSide);
if (hitPositiveSide) {
intersection = transformNormalToEC(intersection);
intersections[0].entry = -1.0 * farSide;
intersections[0].exit = vec4(-1.0 * intersection.xyz, intersection.w);
intersections[1].entry = intersection;
intersections[1].exit = farSide;
} else {
vec4 miss = vec4(normalize(czm_normal * 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 transformNormalsToEC(RayShapeIntersection(first, last));
} else if (!exitFromInside && enterFromOutside) {
// Ray starts inside wedge. last is in shadow wedge, and first is actually the entry
return transformNormalsToEC(RayShapeIntersection(-1.0 * farSide, first));
} else if (exitFromInside && !enterFromOutside) {
// First intersection was in the shadow wedge, so last is actually the exit
return transformNormalsToEC(RayShapeIntersection(last, farSide));
} else { // !exitFromInside && !enterFromOutside
// Both intersections were in the shadow wedge
return transformNormalsToEC(RayShapeIntersection(miss, miss));
}
}
`;var iU=`// 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 sampler2D u_renderBoundPlanesTexture;
RayShapeIntersection intersectBoundPlanes(in Ray ray) {
vec4 lastEntry = vec4(ray.dir, -INF_HIT);
vec4 firstExit = vec4(-ray.dir, +INF_HIT);
for (int i = 0; i < 6; i++) {
vec4 boundPlane = getBoundPlane(u_renderBoundPlanesTexture, i);
vec4 intersection = intersectPlane(ray, boundPlane);
if (dot(ray.dir, boundPlane.xyz) < 0.0) {
lastEntry = intersection.w > lastEntry.w ? intersection : lastEntry;
} else {
firstExit = intersection.w < firstExit.w ? intersection: firstExit;
}
}
if (lastEntry.w < firstExit.w) {
return RayShapeIntersection(lastEntry, firstExit);
} else {
return RayShapeIntersection(vec4(-ray.dir, NO_HIT), vec4(ray.dir, NO_HIT));
}
}
void intersectShape(in Ray rayUV, in Ray rayEC, inout Intersections ix)
{
RayShapeIntersection intersection = intersectBoundPlanes(rayEC);
setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection);
}
`;var oU=`// 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;
#if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE)
uniform vec2 u_cylinderRenderAngleMinMax;
#endif
uniform sampler2D u_renderBoundPlanesTexture;
RayShapeIntersection intersectBoundPlanes(in Ray ray) {
vec4 lastEntry = vec4(ray.dir, -INF_HIT);
vec4 firstExit = vec4(-ray.dir, +INF_HIT);
for (int i = 0; i < 2; i++) {
vec4 boundPlane = getBoundPlane(u_renderBoundPlanesTexture, i);
vec4 intersection = intersectPlane(ray, boundPlane);
if (dot(ray.dir, boundPlane.xyz) < 0.0) {
lastEntry = intersection.w > lastEntry.w ? intersection : lastEntry;
} else {
firstExit = intersection.w < firstExit.w ? intersection: firstExit;
}
}
if (lastEntry.w < firstExit.w) {
return RayShapeIntersection(lastEntry, firstExit);
} else {
return RayShapeIntersection(vec4(-ray.dir, NO_HIT), vec4(ray.dir, NO_HIT));
}
}
/**
* 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;
vec3 normal1 = vec3((position + t1 * direction) * signFlip, 0.0);
vec3 normal2 = vec3((position + t2 * direction) * signFlip, 0.0);
// Return normals in eye coordinates
vec4 intersect1 = vec4(normalize(czm_normal * normal1), t1);
vec4 intersect2 = vec4(normalize(czm_normal * normal2), 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 Ray rayEC, in float radius)
{
RayShapeIntersection cylinderIntersection = intersectCylinder(ray, radius, true);
RayShapeIntersection heightBoundsIntersection = intersectBoundPlanes(rayEC);
return intersectIntersections(ray, cylinderIntersection, heightBoundsIntersection);
}
void intersectShape(in Ray ray, in Ray rayEC, inout Intersections ix)
{
RayShapeIntersection outerIntersect = intersectBoundedCylinder(ray, rayEC, u_cylinderRenderRadiusMinMax.y);
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 rU=`// 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; // Values are negative: clipHeight - maxShapeHeight
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 height, 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 = vec3(1.0) / (u_ellipsoidRadii + height);
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 * (position + tmin * direction);
vec3 d2 = directionScale * (position + tmax * direction);
// Return normals in eye coordinates. Use spherical approximation for the normal.
vec3 normal1 = normalize(czm_normal * d1);
vec3 normal2 = normalize(czm_normal * d2);
return RayShapeIntersection(vec4(normal1, tmin), vec4(normal2, 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 = u_ellipsoidRadii.x * 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]) {
// 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) {
// 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, in Ray rayEC, inout Intersections ix) { // 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 QI=`// 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, in Ray rayEC, out Intersections ix) {
// Do a ray-shape intersection to find the exact starting and ending points.
intersectShape(ray, rayEC, 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
intersectDepth(screenCoord, rayEC, ix);
// 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 aU=`uniform vec3 u_boxLocalToShapeUvScale;
uniform vec3 u_boxLocalToShapeUvTranslate;
uniform ivec4 u_cameraTileCoordinates;
uniform vec3 u_cameraTileUv;
uniform mat3 u_boxEcToXyz;
mat3 convertLocalToShapeSpaceDerivative(in vec3 positionLocal) {
// For BOX, local space = shape space, so the Jacobian is the identity matrix.
return mat3(1.0);
}
vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) {
return shapeUv / u_boxLocalToShapeUvScale;
}
vec3 convertEcToDeltaTile(in vec3 positionEC) {
vec3 dPosition = u_boxEcToXyz * positionEC;
return u_boxLocalToShapeUvScale * dPosition * float(1 << u_cameraTileCoordinates.w);
}
TileAndUvCoordinate getTileAndUvCoordinate(in vec3 positionEC) {
vec3 deltaTileCoordinate = convertEcToDeltaTile(positionEC);
vec3 tileUvSum = u_cameraTileUv + deltaTileCoordinate;
ivec3 tileCoordinate = u_cameraTileCoordinates.xyz + ivec3(floor(tileUvSum));
tileCoordinate = min(max(ivec3(0), tileCoordinate), ivec3((1 << u_cameraTileCoordinates.w) - 1));
ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz;
vec3 tileUv = clamp(tileUvSum - vec3(tileCoordinateChange), 0.0, 1.0);
return TileAndUvCoordinate(ivec4(tileCoordinate, u_cameraTileCoordinates.w), tileUv);
}
`;var sU=`uniform vec2 u_cylinderLocalToShapeUvRadius; // x = scale, y = offset
uniform vec2 u_cylinderLocalToShapeUvHeight; // x = scale, y = offset
uniform vec2 u_cylinderLocalToShapeUvAngle; // x = scale, y = offset
uniform float u_cylinderShapeUvAngleRangeOrigin;
uniform mat3 u_cylinderEcToRadialTangentUp;
uniform ivec4 u_cameraTileCoordinates;
uniform vec3 u_cameraTileUv;
uniform vec3 u_cameraShapePosition; // (radial distance, angle, height) of camera in shape space
mat3 convertLocalToShapeSpaceDerivative(in vec3 position) {
vec3 radial = normalize(vec3(position.xy, 0.0));
vec3 z = vec3(0.0, 0.0, 1.0);
vec3 east = normalize(vec3(-position.y, position.x, 0.0));
return mat3(radial, east / length(position.xy), z);
}
vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) {
float radius = shapeUv.x / u_cylinderLocalToShapeUvRadius.x;
float angle = shapeUv.y * czm_twoPi / u_cylinderLocalToShapeUvAngle.x;
float height = shapeUv.z / u_cylinderLocalToShapeUvHeight.x;
return vec3(radius, angle, height);
}
/**
* Computes the change in polar coordinates given a change in position.
* @param {vec2} dPosition The change in position in Cartesian coordinates.
* @param {float} cameraRadialDistance The radial distance of the camera from the origin.
* @return {vec2} The change in polar coordinates (radial distance, angle).
*/
vec2 computePolarChange(in vec2 dPosition, in float cameraRadialDistance) {
float dAngle = atan(dPosition.y, cameraRadialDistance + dPosition.x);
// Find the direction of the radial axis at the output angle, in Cartesian coordinates
vec2 outputRadialAxis = vec2(cos(dAngle), sin(dAngle));
float sinHalfAngle = sin(dAngle / 2.0);
float versine = 2.0 * sinHalfAngle * sinHalfAngle;
float dRadial = dot(dPosition, outputRadialAxis) - cameraRadialDistance * versine;
return vec2(dRadial, dAngle);
}
vec3 convertEcToDeltaShape(in vec3 positionEC) {
// 1. Rotate to radial, tangent, and up coordinates
vec3 rtu = u_cylinderEcToRadialTangentUp * positionEC;
// 2. Compute change in angular and radial coordinates.
vec2 dPolar = computePolarChange(rtu.xy, u_cameraShapePosition.x);
return vec3(dPolar.xy, rtu.z);
}
vec3 convertEcToDeltaTile(in vec3 positionEC) {
vec3 deltaShape = convertEcToDeltaShape(positionEC);
// Convert to tileset coordinates in [0, 1]
float dx = u_cylinderLocalToShapeUvRadius.x * deltaShape.x;
float dy = deltaShape.y / czm_twoPi;
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)
// Wrap to ensure dy is not crossing through the unoccupied angle range, where
// angle to tile coordinate conversions would be more complicated
float cameraUvAngle = (u_cameraShapePosition.y + czm_pi) / czm_twoPi;
float cameraUvAngleShift = fract(cameraUvAngle - u_cylinderShapeUvAngleRangeOrigin);
float rawOutputUvAngle = cameraUvAngleShift + dy;
float rotation = floor(rawOutputUvAngle);
dy -= rotation;
#endif
dy *= u_cylinderLocalToShapeUvAngle.x;
float dz = u_cylinderLocalToShapeUvHeight.x * deltaShape.z;
// Convert to tile coordinate changes
return vec3(dx, dy, dz) * float(1 << u_cameraTileCoordinates.w);
}
TileAndUvCoordinate getTileAndUvCoordinate(in vec3 positionEC) {
vec3 deltaTileCoordinate = convertEcToDeltaTile(positionEC);
vec3 tileUvSum = u_cameraTileUv + deltaTileCoordinate;
ivec3 tileCoordinate = u_cameraTileCoordinates.xyz + ivec3(floor(tileUvSum));
int maxTileCoordinate = (1 << u_cameraTileCoordinates.w) - 1;
tileCoordinate.x = min(max(0, tileCoordinate.x), maxTileCoordinate);
tileCoordinate.z = min(max(0, tileCoordinate.z), maxTileCoordinate);
#if (!defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE))
ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz;
if (tileCoordinate.y < 0) {
tileCoordinate.y += (maxTileCoordinate + 1);
} else if (tileCoordinate.y > maxTileCoordinate) {
tileCoordinate.y -= (maxTileCoordinate + 1);
}
#else
tileCoordinate.y = min(max(0, tileCoordinate.y), maxTileCoordinate);
ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz;
#endif
vec3 tileUv = tileUvSum - vec3(tileCoordinateChange);
tileUv.x = clamp(tileUv.x, 0.0, 1.0);
#if (!defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE))
// If there is only one tile spanning 2*PI angle, the coordinate wraps around
tileUv.y = (u_cameraTileCoordinates.w == 0) ? fract(tileUv.y) : clamp(tileUv.y, 0.0, 1.0);
#else
tileUv.y = clamp(tileUv.y, 0.0, 1.0);
#endif
tileUv.z = clamp(tileUv.z, 0.0, 1.0);
return TileAndUvCoordinate(ivec4(tileCoordinate, u_cameraTileCoordinates.w), tileUv);
}
`;var cU=`/* 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_cameraPositionCartographic; // (longitude, latitude, height) in radians and meters
uniform vec2 u_ellipsoidCurvatureAtLatitude;
uniform mat3 u_ellipsoidEcToEastNorthUp;
uniform vec3 u_ellipsoidRadii;
uniform vec2 u_evoluteScale; // (radii.x ^ 2 - radii.z ^ 2) * vec2(1.0, -1.0) / radii;
uniform vec3 u_ellipsoidInverseRadiiSquared;
#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_ellipsoidLocalToShapeUvLongitude; // x = scale, y = offset
uniform float u_ellipsoidShapeUvLongitudeRangeOrigin;
#endif
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)
uniform vec2 u_ellipsoidLocalToShapeUvLatitude; // x = scale, y = offset
#endif
uniform float u_ellipsoidInverseHeightDifference;
uniform ivec4 u_cameraTileCoordinates;
uniform vec3 u_cameraTileUv;
// 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));
}
mat3 convertLocalToShapeSpaceDerivative(in vec3 position) {
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_ellipsoidRadii.xz);
vec2 surfacePoint = surfacePointAndRadius.xy;
vec2 normal2d = normalize(surfacePoint * u_ellipsoidInverseRadiiSquared.xz);
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));
return mat3(east / distanceFromZAxis, north / (surfacePointAndRadius.z + height), up);
}
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_ellipsoidLocalToShapeUvLongitude.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_ellipsoidLocalToShapeUvLatitude.x;
#endif
float height = shapeUv.z / u_ellipsoidInverseHeightDifference;
return vec3(longitude, latitude, height);
}
vec3 convertEcToDeltaShape(in vec3 positionEC) {
vec3 enu = u_ellipsoidEcToEastNorthUp * positionEC;
// 1. Compute the change in longitude from the camera to the ENU point
// First project the camera and ENU positions to the equatorial XY plane,
// positioning the camera on the +x axis, so that enu.x projects along the +y axis
float cosLatitude = cos(u_cameraPositionCartographic.y);
float sinLatitude = sin(u_cameraPositionCartographic.y);
float primeVerticalRadius = 1.0 / u_ellipsoidCurvatureAtLatitude.x;
vec2 cameraXY = vec2((primeVerticalRadius + u_cameraPositionCartographic.z) * cosLatitude, 0.0);
// Note precision loss in positionXY.x if length(enu) << length(cameraXY)
vec2 positionXY = cameraXY + vec2(-enu.y * sinLatitude + enu.z * cosLatitude, enu.x);
float dLongitude = atan(positionXY.y, positionXY.x);
// 2. Find the longitude component of positionXY, by rotating about Z until the y component is zero.
// Use the versine to compute the change in x directly from the change in angle:
// versine(angle) = 2 * sin^2(angle/2)
float sinHalfLongitude = sin(dLongitude / 2.0);
float dx = length(positionXY) * 2.0 * sinHalfLongitude * sinHalfLongitude;
// Rotate longitude component back to ENU North and Up, and remove from enu
enu += vec3(-enu.x, -dx * sinLatitude, dx * cosLatitude);
// 3. Compute the change in latitude from the camera to the ENU point.
// First project the camera and ENU positions to the meridional ZX plane,
// positioning the camera on the +Z axis, so that enu.y maps to the +X axis.
float meridionalRadius = 1.0 / u_ellipsoidCurvatureAtLatitude.y;
vec2 cameraZX = vec2(meridionalRadius + u_cameraPositionCartographic.z, 0.0);
vec2 positionZX = cameraZX + vec2(enu.z, enu.y);
float dLatitude = atan(positionZX.y, positionZX.x);
// 4. Compute the change in height above the ellipsoid
// Find the change in enu.z associated with rotating the point to the latitude of the camera
float sinHalfLatitude = sin(dLatitude / 2.0);
float dz = length(positionZX) * 2.0 * sinHalfLatitude * sinHalfLatitude;
// The remaining change in enu.z is the change in height above the ellipsoid
float dHeight = enu.z + dz;
return vec3(dLongitude, dLatitude, dHeight);
}
vec3 convertEcToDeltaTile(in vec3 positionEC) {
vec3 deltaShape = convertEcToDeltaShape(positionEC);
// Convert to tileset coordinates in [0, 1]
float dx = deltaShape.x / czm_twoPi;
#if (defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE))
// Wrap to ensure dx is not crossing through the unoccupied angle range, where
// angle to tile coordinate conversions would be more complicated
float cameraUvLongitude = (u_cameraPositionCartographic.x + czm_pi) / czm_twoPi;
float cameraUvLongitudeShift = fract(cameraUvLongitude - u_ellipsoidShapeUvLongitudeRangeOrigin);
float rawOutputUvLongitude = cameraUvLongitudeShift + dx;
float rotation = floor(rawOutputUvLongitude);
dx -= rotation;
dx *= u_ellipsoidLocalToShapeUvLongitude.x;
#endif
float dy = deltaShape.y / czm_pi;
#if (defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE))
dy *= u_ellipsoidLocalToShapeUvLatitude.x;
#endif
float dz = u_ellipsoidInverseHeightDifference * deltaShape.z;
// Convert to tile coordinate changes
return vec3(dx, dy, dz) * float(1 << u_cameraTileCoordinates.w);
}
TileAndUvCoordinate getTileAndUvCoordinate(in vec3 positionEC) {
vec3 deltaTileCoordinate = convertEcToDeltaTile(positionEC);
vec3 tileUvSum = u_cameraTileUv + deltaTileCoordinate;
ivec3 tileCoordinate = u_cameraTileCoordinates.xyz + ivec3(floor(tileUvSum));
int maxTileCoordinate = (1 << u_cameraTileCoordinates.w) - 1;
tileCoordinate.y = min(max(0, tileCoordinate.y), maxTileCoordinate);
tileCoordinate.z = min(max(0, tileCoordinate.z), maxTileCoordinate);
#if (!defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE))
ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz;
if (tileCoordinate.x < 0) {
tileCoordinate.x += (maxTileCoordinate + 1);
} else if (tileCoordinate.x > maxTileCoordinate) {
tileCoordinate.x -= (maxTileCoordinate + 1);
}
#else
tileCoordinate.x = min(max(0, tileCoordinate.x), maxTileCoordinate);
ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz;
#endif
vec3 tileUv = tileUvSum - vec3(tileCoordinateChange);
#if (!defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE))
// If there is only one tile spanning 2*PI angle, the coordinate wraps around
tileUv.x = (u_cameraTileCoordinates.w == 0) ? fract(tileUv.x) : clamp(tileUv.x, 0.0, 1.0);
#else
tileUv.x = clamp(tileUv.x, 0.0, 1.0);
#endif
tileUv.y = clamp(tileUv.y, 0.0, 1.0);
tileUv.z = clamp(tileUv.z, 0.0, 1.0);
return TileAndUvCoordinate(ivec4(tileCoordinate, u_cameraTileCoordinates.w), tileUv);
}
`;var lU=`// 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
uniform ivec3 u_dimensions; // does not include padding, and is in the z-up orientation
uniform ivec3 u_inputDimensions; // includes padding, and is in the orientation of the input data
#if defined(PADDING)
uniform ivec3 u_paddingBefore;
#endif
struct OctreeNodeData {
int data;
int flag;
};
struct TraversalData {
ivec4 octreeCoords;
int parentOctreeIndex;
};
struct TileAndUvCoordinate {
ivec4 tileCoords;
vec3 tileUv;
};
struct SampleData {
int megatextureIndex;
ivec4 tileCoords;
vec3 tileUv;
vec3 inputCoordinate;
#if (SAMPLE_COUNT > 1)
float weight;
#endif
};
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 = (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 = (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;
}
vec3 getTileUv(in TileAndUvCoordinate tileAndUv, in ivec4 octreeCoords) {
int levelDifference = tileAndUv.tileCoords.w - octreeCoords.w;
float scalar = exp2(-1.0 * float(levelDifference));
vec3 originShift = vec3(tileAndUv.tileCoords.xyz - (octreeCoords.xyz << levelDifference)) * scalar;
return tileAndUv.tileUv * scalar + originShift;
}
vec3 getClampedTileUv(in TileAndUvCoordinate tileAndUv, in ivec4 octreeCoords) {
vec3 tileUv = getTileUv(tileAndUv, octreeCoords);
return clamp(tileUv, vec3(0.0), vec3(1.0));
}
void addSampleCoordinates(in TileAndUvCoordinate tileAndUv, inout SampleData sampleData) {
vec3 tileUv = getClampedTileUv(tileAndUv, sampleData.tileCoords);
vec3 inputCoordinate = tileUv * vec3(u_dimensions);
#if defined(PADDING)
inputCoordinate += vec3(u_paddingBefore);
#endif
#if defined(Y_UP_METADATA_ORDER)
#if defined(SHAPE_BOX)
float inputY = inputCoordinate.y;
inputCoordinate.y = inputCoordinate.z;
// u_inputDimensions.z is the y-up dimension along the 3D Tiles y-axis.
inputCoordinate.z = float(u_inputDimensions.z) - inputY;
#elif defined(SHAPE_CYLINDER)
float angle = inputCoordinate.y;
float height = inputCoordinate.z;
#if (!defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE))
// Account for the different 0-angle convention in glTF vs 3DTiles
if (sampleData.tileCoords.w == 0) {
float angleCount = float(u_inputDimensions.z);
angle = mod(angle + angleCount / 2.0, angleCount);
}
#endif
inputCoordinate.y = height;
inputCoordinate.z = angle;
#endif
#endif
sampleData.tileUv = tileUv;
sampleData.inputCoordinate = inputCoordinate;
}
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((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 ivec4 tileCoordinate, inout TraversalData traversalData) {
OctreeNodeData childData;
for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) {
// tileCoordinate.xyz is defined at the level of detail tileCoordinate.w.
// Find the corresponding coordinate at the level traversalData.octreeCoords.w
int level = traversalData.octreeCoords.w + 1;
int levelDifference = tileCoordinate.w - level;
ivec3 coordinateAtLevel = tileCoordinate.xyz >> levelDifference;
traversalData.octreeCoords = ivec4(coordinateAtLevel, level);
ivec3 childCoordinate = coordinateAtLevel & 1;
childData = getOctreeChildData(traversalData.parentOctreeIndex, childCoordinate);
if (childData.flag != OCTREE_FLAG_INTERNAL) {
// leaf tile - stop traversing
break;
}
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 TileAndUvCoordinate tileAndUv, 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(tileAndUv.tileCoords, traversalData);
}
#if (SAMPLE_COUNT == 1)
getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]);
addSampleCoordinates(tileAndUv, sampleDatas[0]);
#else
getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas);
addSampleCoordinates(tileAndUv, sampleDatas[0]);
addSampleCoordinates(tileAndUv, sampleDatas[1]);
#endif
}
bool insideTile(in ivec4 tileCoordinate, in ivec4 octreeCoords) {
int levelDifference = tileCoordinate.w - octreeCoords.w;
if (levelDifference < 0) {
return false;
}
ivec3 coordinateAtLevel = tileCoordinate.xyz >> levelDifference;
return coordinateAtLevel == octreeCoords.xyz;
}
void traverseOctreeFromExisting(in TileAndUvCoordinate tileAndUv, inout TraversalData traversalData, inout SampleData sampleDatas[SAMPLE_COUNT]) {
ivec4 tileCoords = tileAndUv.tileCoords;
if (insideTile(tileCoords, traversalData.octreeCoords)) {
for (int i = 0; i < SAMPLE_COUNT; i++) {
addSampleCoordinates(tileAndUv, sampleDatas[i]);
}
return;
}
// Go up tree until we find a parent tile containing tileCoords.
// Assumes all parents are available all they way up to the root.
for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) {
traversalData.octreeCoords.xyz /= 2;
traversalData.octreeCoords.w -= 1;
if (insideTile(tileCoords, traversalData.octreeCoords)) {
break;
}
traversalData.parentOctreeIndex = getOctreeParentIndex(traversalData.parentOctreeIndex);
}
// Go down tree
OctreeNodeData nodeData = traverseOctreeDownwards(tileCoords, traversalData);
#if (SAMPLE_COUNT == 1)
getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]);
addSampleCoordinates(tileAndUv, sampleDatas[0]);
#else
getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas);
addSampleCoordinates(tileAndUv, sampleDatas[0]);
addSampleCoordinates(tileAndUv, sampleDatas[1]);
#endif
}
`;var uU=`// See Octree.glsl for the definitions of SampleData
/* Megatexture defines (set in Scene/VoxelRenderResources.js)
#define SAMPLE_COUNT ###
#define PADDING
*/
uniform ivec3 u_megatextureTileCounts; // number of tiles in the megatexture, along each axis
vec3 index1DTo3DTexCoord(int index)
{
int tilesPerZ = u_megatextureTileCounts.x * u_megatextureTileCounts.y;
int iz = index / tilesPerZ;
int remainder = index - iz * tilesPerZ;
int iy = remainder / u_megatextureTileCounts.x;
int ix = remainder - iy * u_megatextureTileCounts.x;
return vec3(ix, iy, iz) / vec3(u_megatextureTileCounts);
}
Properties getPropertiesFromMegatexture(in SampleData sampleData) {
int tileIndex = sampleData.megatextureIndex;
vec3 voxelCoord = sampleData.inputCoordinate;
// UV coordinate of the lower corner of the tile in the megatexture
vec3 tileUvOffset = index1DTo3DTexCoord(tileIndex);
// Voxel location
vec3 tileDimensions = vec3(u_inputDimensions);
vec3 clampedVoxelCoord = clamp(voxelCoord, vec3(0.5), tileDimensions - vec3(0.5));
vec3 voxelUv = clampedVoxelCoord / tileDimensions / vec3(u_megatextureTileCounts);
return getPropertiesFromMegatextureAtUv(tileUvOffset + voxelUv);
}
// 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
}
`;var qDt={Z_UP:0,Y_UP:1},mA=Object.freeze(qDt);function KDt(e){let t=new LA;this.shaderBuilder=t;let n=e._customShader,i=Pt(e._uniformMap,n.uniformMap);e._uniformMap=i;let o=n.uniforms;for(let m in o)if(o.hasOwnProperty(m)){let _=o[m];t.addUniform(_.type,m,he.FRAGMENT)}t.addUniform("sampler3D","u_megatextureTextures[METADATA_COUNT]",he.FRAGMENT),this.uniformMap=i;let r=e._clippingPlanes,a=l(r)&&r.enabled?r.length:0;this.clippingPlanes=r,this.clippingPlanesLength=a;let s=e._shape.renderBoundPlanes,c=s?.length??0;this.renderBoundPlanes=s,this.renderBoundPlanesLength=c,t.addVertexLines([$3]),e.provider.metadataOrder===mA.Y_UP&&t.addDefine("Y_UP_METADATA_ORDER",void 0,he.FRAGMENT);let u=e._provider.shape;u==="BOX"?t.addDefine("SHAPE_BOX",void 0,he.FRAGMENT):u==="CYLINDER"?t.addDefine("SHAPE_CYLINDER",void 0,he.FRAGMENT):u==="ELLIPSOID"&&t.addDefine("SHAPE_ELLIPSOID",void 0,he.FRAGMENT),t.addFragmentLines([n.fragmentShaderText,"#line 0",lU,J3,uU,eU,nU,tU]),a>0&&(t.addDefine("CLIPPING_PLANES",void 0,he.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",a,he.FRAGMENT),r.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,he.FRAGMENT)),e._depthTest&&t.addDefine("DEPTH_TEST",void 0,he.FRAGMENT),u==="BOX"?t.addFragmentLines([aU,iU,QI]):u==="CYLINDER"?t.addFragmentLines([sU,AB,oU,QI]):u==="ELLIPSOID"&&t.addFragmentLines([cU,AB,rU,QI]),t.addFragmentLines([Z3]);let f=e._shape,h=f.shaderDefines;for(let m in h)if(h.hasOwnProperty(m)){let _=h[m];l(_)&&(_=_===!0?void 0:_,t.addDefine(m,_,he.FRAGMENT))}let p=f.shaderMaximumIntersectionsLength;a>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",p,he.FRAGMENT),a===1?p+=1:r.unionClippingRegions?p+=2:p+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",p,he.FRAGMENT),p+=1),t.addDefine("INTERSECTION_COUNT",p,he.FRAGMENT),(!d.equals(e.paddingBefore,d.ZERO)||!d.equals(e.paddingAfter,d.ZERO))&&t.addDefine("PADDING",void 0,he.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,he.FRAGMENT);let A=e._traversal;t.addDefine("SAMPLE_COUNT",`${A._sampleCount}`,he.FRAGMENT)}var fU=KDt;var zBe=new k;function XDt(e,t){let n=new fU(e);X3(n,e);let{shaderBuilder:i,clippingPlanes:o,clippingPlanesLength:r,renderBoundPlanes:a,renderBoundPlanesLength:s}=n;if(r>0){let b="getClippingPlane",x=`vec4 ${b}(highp sampler2D packedPlanes, int planeNumber)`,S=da.getTextureResolution(o,t,zBe),B=GBe(S);i.addFunction(b,x,he.FRAGMENT),i.addFunctionLines(b,[B])}if(s>0){let b="getBoundPlane",x=`vec4 ${b}(highp sampler2D packedPlanes, int planeNumber)`,S=L_.getTextureResolution(a,t,zBe),B=GBe(S);i.addFunction(b,x,he.FRAGMENT),i.addFunctionLines(b,[B])}let c=i.clone();c.addDefine("PICKING",void 0,he.FRAGMENT);let u=i.clone();u.addDefine("PICKING_VOXEL",void 0,he.FRAGMENT);let f=i.buildShaderProgram(t),h=c.buildShaderProgram(t),p=u.buildShaderProgram(t),A=Ve.fromCache({cull:{enabled:!0,face:Ni.BACK},depthTest:{enabled:!1},depthMask:!1,blending:sn.PRE_MULTIPLIED_ALPHA_BLEND}),m=t.getViewportQuadVertexArray(),_=e._depthTest,y=new nt({vertexArray:m,primitiveType:ve.TRIANGLES,renderState:A,shaderProgram:f,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:Be.VOXELS,executeInClosestFrustum:!0,owner:this,cull:_,occlude:_}),C=nt.shallowClone(y,new nt);C.shaderProgram=h,C.pickOnly=!0;let E=nt.shallowClone(y,new nt);if(E.shaderProgram=p,E.pickOnly=!0,l(e._drawCommand)){let b=e._drawCommand;b.shaderProgram=b.shaderProgram&&b.shaderProgram.destroy()}if(l(e._drawCommandPick)){let b=e._drawCommandPick;b.shaderProgram=b.shaderProgram&&b.shaderProgram.destroy()}if(l(e._drawCommandPickVoxel)){let b=e._drawCommandPickVoxel;b.shaderProgram=b.shaderProgram&&b.shaderProgram.destroy()}e._drawCommand=y,e._drawCommandPick=C,e._drawCommandPickVoxel=E}function GBe(e){let t=e.x,n=e.y,i=1/t,o=1/n,r=`${i}`;r.indexOf(".")===-1&&(r+=".0");let a=`${o}`;return a.indexOf(".")===-1&&(a+=".0"),`int pixY = planeNumber / ${t};
int pixX = planeNumber - (pixY * ${t});
// Sample from center of pixel
float u = (float(pixX) + 0.5) * ${r};
float v = (float(pixY) + 0.5) * ${a};
return texture(packedPlanes, vec2(u, v));`}var dU=XDt;var JDt={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"},gB=Object.freeze(JDt);function _B(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}_B.prototype.getTexture=function(e){return this._textures[e]};function ZDt(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})}_B.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):ZDt(this,e,t)};function $Dt(e,t,n){let{id:i,textureUniform:o,image:r}=t,a=n.webgl2?B5(o,r,n):evt(o,r,n),s=e._textures[i];l(s)&&s!==n.defaultTexture&&s.destroy(),e._textures[i]=a}function B5(e,t,n){let{typedArray:i,sampler:o}=e,r=l(i)?HBe(e,n):new Dt({context:n,source:t,sampler:o});return VBe(o)&&r.generateMipmap(),r}function evt(e,t,n){let{typedArray:i,sampler:o}=e,r=VBe(o),a=o.wrapS===pn.REPEAT||o.wrapS===pn.MIRRORED_REPEAT||o.wrapT===pn.REPEAT||o.wrapT===pn.MIRRORED_REPEAT,{width:s,height:c}=l(i)?e:t,u=[s,c].every(D.isPowerOfTwo);if((r||a)&&!u)if(l(i)){if(e.pixelDatatype===He.UNSIGNED_BYTE){let h=W2(i,s,c),p=xy(h);return B5({sampler:o},p,n)}}else{let h=xy(t);return B5(e,h,n)}else return B5(e,t,n);return r?console.warn("Texture requires resizing for mipmaps but pixelDataType cannot be resized. The texture may be rendered incorrectly."):a&&console.warn("Texture requires resizing for wrapping but pixelDataType cannot be resized. The texture may be rendered incorrectly."),HBe(e,n)}function VBe(e){return[Wt.NEAREST_MIPMAP_NEAREST,Wt.NEAREST_MIPMAP_LINEAR,Wt.LINEAR_MIPMAP_NEAREST,Wt.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function HBe(e,t){let{pixelFormat:n,pixelDatatype:i,width:o,height:r,typedArray:a,sampler:s}=e;return new Dt({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:a,width:o,height:r},sampler:s,flipY:!1})}_B.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];$Dt(this,o,t)}n.length=0};_B.prototype.isDestroyed=function(){return!1};_B.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 fe(this)};var hU=_B;function mU(e){e=e??V.EMPTY_OBJECT,this.mode=e.mode??yg.MODIFY_MATERIAL,this.lightingModel=e.lightingModel,this.uniforms=e.uniforms??V.EMPTY_OBJECT,this.varyings=e.varyings??V.EMPTY_OBJECT,this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=e.translucencyMode??Uy.INHERIT,this._textureManager=new hU,this._defaultTexture=void 0,this.uniformMap=tvt(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},ovt(this),rvt(this)}function tvt(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let o=t[i];o.type===gB.SAMPLER_2D?(e._textureManager.loadTexture2D(i,o.value),n[i]=nvt(e,i)):n[i]=ivt(e,i)}return n}function nvt(e,t){return function(){return e._textureManager.getTexture(t)??e._defaultTexture}}function ivt(e,t){return function(){return e.uniforms[t].value}}function kI(e,t,n){let i;for(;(i=t.exec(e))!==null;){let o=i[1];n[o]=!0}}function ovt(e){let t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.(?:metadata|metadataClass|metadataStatistics)\.(\w+)/g,o,r=e.vertexShaderText;l(r)&&(o=e.usedVariablesVertex.attributeSet,kI(r,t,o),o=e.usedVariablesVertex.featureIdSet,kI(r,n,o),o=e.usedVariablesVertex.metadataSet,kI(r,i,o));let a=e.fragmentShaderText;if(l(a)){o=e.usedVariablesFragment.attributeSet,kI(a,t,o),o=e.usedVariablesFragment.featureIdSet,kI(a,n,o),o=e.usedVariablesFragment.metadataSet,kI(a,i,o);let s=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;kI(a,s,c)}}function WBe(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 gl(e,t,n,i){if(e.hasOwnProperty(t)){let o=`${WBe(t)} is not available in the ${i} shader. Did you mean ${WBe(n)} instead?`;throw new de(o)}}function rvt(e){let t=e.usedVariablesVertex.attributeSet;gl(t,"position","positionMC","vertex"),gl(t,"normal","normalMC","vertex"),gl(t,"tangent","tangentMC","vertex"),gl(t,"bitangent","bitangentMC","vertex"),gl(t,"positionWC","positionMC","vertex"),gl(t,"positionEC","positionMC","vertex"),gl(t,"normalEC","normalMC","vertex"),gl(t,"tangentEC","tangentMC","vertex"),gl(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;gl(n,"position","positionEC","fragment"),gl(n,"normal","normalEC","fragment"),gl(n,"tangent","tangentEC","fragment"),gl(n,"bitangent","bitangentEC","fragment"),gl(n,"normalMC","normalEC","fragment"),gl(n,"tangentMC","tangentEC","fragment"),gl(n,"bitangentMC","bitangentEC","fragment")}mU.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===gB.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};mU.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};mU.prototype.isDestroyed=function(){return!1};mU.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),fe(this)};var UI=mU;function O_(e){let{loader:t,metadata:n}=e;this._loader=t,this._metadata=n,this._resourcesLoaded=!1,this._ready=!1}Object.defineProperties(O_.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}}});O_.fromMetadataArray=function(e){return new O_({metadata:e})};O_.fromGltf=async function(e){let t=new _f({gltfResource:e,releaseGltfJson:!1,loadAttributesAsTypedArray:!0});try{await t.load()}catch(n){throw t.destroy(),n}return new O_({loader:t})};O_.prototype.update=function(e,t){let n=this._loader;if(!this._ready){if(t.afterRender.push(()=>!0),!l(n)){this._ready=!0;return}if(this._resourcesLoaded){let{structuralMetadata:i,scene:o}=n.components,{attributes:r}=o.nodes[0].primitives[0];this._metadata=avt(r,i,e),this._ready=!0;return}this._resourcesLoaded=n.process(t)}};function avt(e,t,n){let{className:i,names:o,types:r,componentTypes:a}=n.provider,s=t.propertyAttributes.find(f=>f.class.id===i),{properties:c}=s,u=new Array(o.length);for(let f=0;f<e.length;f++){let h=c[o[f]].attribute,p=e.find(y=>y.name===h);if(!l(p))continue;let A=Ft.toComponentDatatype(a[f]),m=bt.getComponentCount(r[f]),_=p.count*m;u[f]=j.createArrayBufferView(A,p.typedArray.buffer,p.typedArray.byteOffset+p.byteOffset,_)}return u}O_.prototype.isDestroyed=function(){return!1};O_.prototype.destroy=function(){return this._loader=this._loader&&this._loader.destroy(),fe(this)};var zI=O_;function _l(){this._orientedBoundingBox=new en,this._boundingSphere=new le,this._boundTransform=new M,this._shapeTransform=new M,this._minBounds=_l.DefaultMinBounds.clone(),this._maxBounds=_l.DefaultMaxBounds.clone(),this._renderMinBounds=_l.DefaultMinBounds.clone(),this._renderMaxBounds=_l.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=_l,n=[new Xa(d.negate(d.UNIT_X,new d),e.x),new Xa(d.negate(d.UNIT_Y,new d),e.y),new Xa(d.negate(d.UNIT_Z,new d),e.z),new Xa(d.UNIT_X,-t.x),new Xa(d.UNIT_Y,-t.y),new Xa(d.UNIT_Z,-t.z)];this._renderBoundPlanes=new L_({planes:n}),this._shaderUniforms={boxEcToXyz:new J,boxLocalToShapeUvScale:new d,boxLocalToShapeUvTranslate:new d},this._shaderDefines={BOX_INTERSECTION_INDEX:void 0},this._shaderMaximumIntersectionsLength=0}Object.defineProperties(_l.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},renderBoundPlanes:{get:function(){return this._renderBoundPlanes}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var svt=new d,cvt=new d,lvt=new J,uvt=new d,fvt=new d;_l.prototype.update=function(e,t,n,i,o){i=i??t.clone(uvt),o=o??n.clone(fvt),t=d.clone(t,this._minBounds),n=d.clone(n,this._maxBounds);let r=d.clamp(t,i,o,this._renderMinBounds),a=d.clamp(n,i,o,this._renderMaxBounds),s=M.getScale(e,cvt);if(r.x>a.x||r.y>a.y||r.z>a.z||(r.x===a.x)+(r.y===a.y)+(r.z===a.z)>=2||s.x===0||s.y===0||s.z===0)return!1;let c=this._renderBoundPlanes;c.get(0).distance=r.x,c.get(1).distance=r.y,c.get(2).distance=r.z,c.get(3).distance=-a.x,c.get(4).distance=-a.y,c.get(5).distance=-a.z,this._shapeTransform=M.clone(e,this._shapeTransform),this._orientedBoundingBox=qte(r,a,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=M.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=le.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let u=this._shaderUniforms,f=this._shaderDefines;for(let _ in f)f.hasOwnProperty(_)&&(f[_]=void 0);let h=0;f.BOX_INTERSECTION_INDEX=h,h+=1;let p=t,A=n,m=d.fromElements(jte(p.x,A.x),jte(p.y,A.y),jte(p.z,A.z),u.boxLocalToShapeUvScale);return u.boxLocalToShapeUvTranslate=d.negate(d.multiplyComponents(m,p,u.boxLocalToShapeUvTranslate),u.boxLocalToShapeUvTranslate),this._shaderMaximumIntersectionsLength=h,!0};function jte(e,t){return D.equalsEpsilon(e,t,D.EPSILON7)?1:1/(t-e)}var dvt=new M;_l.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=M.inverse(this._shapeTransform,dvt),i=M.getMatrix3(n,t.boxEcToXyz),o=e.context.uniformState.inverseViewRotation;J.multiply(i,o,t.boxEcToXyz)};_l.prototype.convertLocalToShapeUvSpace=function(e,t){let{boxLocalToShapeUvScale:n,boxLocalToShapeUvTranslate:i}=this._shaderUniforms;return d.add(d.multiplyComponents(e,n,t),i,t)};var D5=new d,Yte=new d;_l.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minBounds,a=this._maxBounds,s=1/Math.pow(2,e),c=d.fromElements(D.lerp(r.x,a.x,s*t),D.lerp(r.y,a.y,s*n),D.lerp(r.z,a.z,s*i),D5),u=d.fromElements(D.lerp(r.x,a.x,s*(t+1)),D.lerp(r.y,a.y,s*(n+1)),D.lerp(r.z,a.z,s*(i+1)),Yte);return qte(c,u,this._shapeTransform,o)};var jBe=new d;_l.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=d.divideComponents(d.ONE,t,jBe),a=d.multiplyByScalar(r,o,jBe),s=d.multiplyByScalar(d.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,D5),o,D5),c=d.add(s,a,Yte),u=this._minBounds,f=this._maxBounds,h=d.fromElements(D.lerp(u.x,f.x,s.x),D.lerp(u.y,f.y,s.y),D.lerp(u.z,f.z,s.z),D5),p=d.fromElements(D.lerp(u.x,f.x,c.x),D.lerp(u.y,f.y,c.y),D.lerp(u.z,f.z,c.z),Yte);return qte(h,p,this._shapeTransform,i)};_l.DefaultMinBounds=Object.freeze(new d(-1,-1,-1));_l.DefaultMaxBounds=Object.freeze(new d(1,1,1));var YBe=new d;function qte(e,t,n,i){let o=_l.DefaultMinBounds,r=_l.DefaultMaxBounds;if(d.equals(e,o)&&d.equals(t,r))i.center=M.getTranslation(n,i.center),i.halfAxes=M.getMatrix3(n,i.halfAxes);else{let s=M.getScale(n,YBe),c=d.midpoint(e,t,svt);i.center=M.multiplyByPoint(n,c,i.center),s=d.fromElements(s.x*.5*(t.x-e.x),s.y*.5*(t.y-e.y),s.z*.5*(t.z-e.z),YBe);let u=M.getRotation(n,lvt);i.halfAxes=J.setScale(u,s,i.halfAxes)}return i}var GI=_l;function ed(){this._orientedBoundingBox=new en,this._boundingSphere=new le,this._boundTransform=new M,this._shapeTransform=new M,this._minBounds=ed.DefaultMinBounds.clone(),this._maxBounds=ed.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=ed,n=[new Xa(d.negate(d.UNIT_Z,new d),e.z),new Xa(d.UNIT_Z,-t.z)];this._renderBoundPlanes=new L_({planes:n}),this._shaderUniforms={cameraShapePosition:new d,cylinderEcToRadialTangentUp:new J,cylinderRenderRadiusMinMax:new k,cylinderRenderAngleMinMax:new k,cylinderLocalToShapeUvRadius:new k,cylinderLocalToShapeUvAngle:new k,cylinderLocalToShapeUvHeight:new k,cylinderShapeUvAngleRangeOrigin:0},this._shaderDefines={CYLINDER_HAS_SHAPE_BOUNDS_ANGLE:void 0,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_INTERSECTION_INDEX_RADIUS_MAX:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MIN:void 0,CYLINDER_INTERSECTION_INDEX_ANGLE:void 0},this._shaderMaximumIntersectionsLength=0}Object.defineProperties(ed.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},renderBoundPlanes:{get:function(){return this._renderBoundPlanes}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var hvt=new d,mvt=new d,pvt=new d,Avt=new d,gvt=new d,_vt=new M,yvt=new d,qBe=new k;ed.prototype.update=function(e,t,n,i,o){i=i??t.clone(mvt),o=o??n.clone(pvt),t=d.clone(t,this._minBounds),n=d.clone(n,this._maxBounds);let{DefaultMinBounds:r,DefaultMaxBounds:a}=ed,s=a.y-r.y,c=.5*s,u=D.EPSILON10,f=D.EPSILON10;t.x=Math.max(0,t.x),n.x=Math.max(0,n.x),t.y=D.negativePiToPi(t.y),n.y=D.negativePiToPi(n.y),i.y=D.negativePiToPi(i.y),o.y=D.negativePiToPi(o.y);let h=d.maximumByComponent(t,i,Avt),p=d.minimumByComponent(n,o,gvt),A=M.getScale(e,hvt);if(p.x===0||h.x>p.x||h.z>p.z||D.equalsEpsilon(A.x,0,void 0,u)||D.equalsEpsilon(A.y,0,void 0,u)||D.equalsEpsilon(A.z,0,void 0,u))return!1;let m=this._renderBoundPlanes;m.get(0).distance=h.z,m.get(1).distance=-p.z,this._shapeTransform=M.clone(e,this._shapeTransform),this._orientedBoundingBox=Jte(h,p,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=M.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=le.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let _=n.y<t.y,y=n.y-t.y+_*s,C=p.y<h.y,E=p.y-h.y+C*s,b=E>=c-f&&E<s-f,x=E>f&&E<c-f,S=E<=f,B=b||x||S,v=this._shaderUniforms,P=this._shaderDefines;for(let Q in P)P.hasOwnProperty(Q)&&(P[Q]=void 0);let N=0;P.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=N,N+=1,y<s-f&&(P.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0),h.x!==r.x&&(P.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,P.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=N,N+=1),v.cylinderRenderRadiusMinMax=k.fromElements(h.x,p.x,v.cylinderRenderRadiusMinMax),h.x===p.x&&(P.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0);let L=n.x-t.x,g=0,I=1;L!==0&&(g=1/L,I=-t.x*g),v.cylinderLocalToShapeUvRadius=k.fromElements(g,I,v.cylinderLocalToShapeUvRadius);let T=n.z-t.z,w=0,R=1;T!==0&&(w=1/T,R=-t.z*w),v.cylinderLocalToShapeUvHeight=k.fromElements(w,R,v.cylinderLocalToShapeUvHeight),B&&(P.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,P.CYLINDER_INTERSECTION_INDEX_ANGLE=N,b?(P.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,N+=1):x?(P.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,N+=2):S&&(P.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,N+=2),v.cylinderRenderAngleMinMax=k.fromElements(h.y,p.y,v.cylinderRenderAngleMinMax));let O=(t.y-r.y)/s,G=(n.y-r.y)/s,F=1-y/s,U=(G+.5*F)%1;if(v.cylinderShapeUvAngleRangeOrigin=U,y<=f)v.cylinderLocalToShapeUvAngle=k.fromElements(0,1,v.cylinderLocalToShapeUvAngle);else{let Q=s/y,H=O-U,Y=-Q*(H-Math.floor(H));v.cylinderLocalToShapeUvAngle=k.fromElements(Q,Y,v.cylinderLocalToShapeUvAngle)}return this._shaderMaximumIntersectionsLength=N,!0};var Cvt=new J,Evt=new J,bvt=new M;ed.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=M.inverse(this._shapeTransform,_vt),i=M.multiplyByPoint(n,e.camera.positionWC,yvt);t.cameraShapePosition=d.fromElements(k.magnitude(i),Math.atan2(i.y,i.x),i.z,t.cameraShapePosition);let o=k.normalize(k.fromCartesian3(i,qBe),qBe),r=J.fromRowMajorArray([o.x,o.y,0,-o.y,o.x,0,0,0,1],Cvt),a=e.context.uniformState.inverseView,s=M.multiplyTransformation(n,a,bvt),c=M.getMatrix3(s,Evt);t.cylinderEcToRadialTangentUp=J.multiply(r,c,t.cylinderEcToRadialTangentUp)};ed.prototype.convertLocalToShapeUvSpace=function(e,t){let n=Math.hypot(e.x,e.y),i=Math.atan2(e.y,e.x),o=e.z,{cylinderLocalToShapeUvRadius:r,cylinderLocalToShapeUvAngle:a,cylinderShapeUvAngleRangeOrigin:s,cylinderLocalToShapeUvHeight:c}=this._shaderUniforms;return n=n*r.x+r.y,i=(i+Math.PI)/(2*Math.PI),i-=s,i=i-Math.floor(i),i=i*a.x+a.y,o=o*c.x+c.y,d.fromElements(n,i,o,t)};var v5=new d,Xte=new d;ed.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minBounds,a=this._maxBounds,s=1/Math.pow(2,e),c=d.fromElements(D.lerp(r.x,a.x,t*s),D.lerp(r.y,a.y,n*s),D.lerp(r.z,a.z,i*s),v5),u=d.fromElements(D.lerp(r.x,a.x,(t+1)*s),D.lerp(r.y,a.y,(n+1)*s),D.lerp(r.z,a.z,(i+1)*s),Xte);return Jte(c,u,this._shapeTransform,o)};var KBe=new d;ed.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=d.divideComponents(d.ONE,t,KBe),a=d.multiplyByScalar(r,o,KBe),s=d.multiplyByScalar(d.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,v5),o,v5),c=d.add(s,a,Xte),u=this._minBounds,f=this._maxBounds,h=d.fromElements(D.lerp(u.x,f.x,s.x),D.lerp(u.y,f.y,s.y),D.lerp(u.z,f.z,s.z),v5),p=d.fromElements(D.lerp(u.x,f.x,c.x),D.lerp(u.y,f.y,c.y),D.lerp(u.z,f.z,c.z),Xte);return Jte(h,p,this._shapeTransform,i)};ed.DefaultMinBounds=Object.freeze(new d(0,-D.PI,-1));ed.DefaultMaxBounds=Object.freeze(new d(1,+D.PI,1));var Ivt=5,xvt=new Array(Ivt),Tvt=new d,Svt=new J,wvt=new M,Bvt=new M,Dvt=new M,Kte=new M,vvt=new d,Pvt=new d,Rvt=new d,JBe=new Array(8);for(let e=0;e<8;e++)JBe[e]=new d;function XBe(e,t,n){return Math.abs(ie.dot(e,t))<n}function Mvt(e){let t=M.getColumn(e,0,vvt),n=M.getColumn(e,1,Pvt),i=M.getColumn(e,2,Rvt),o=D.EPSILON4;return XBe(t,n,o)&&XBe(n,i,o)}function Nvt(e,t){let n=JBe;d.fromElements(-.5,-.5,-.5,n[0]),d.fromElements(-.5,-.5,.5,n[1]),d.fromElements(-.5,.5,-.5,n[2]),d.fromElements(-.5,.5,.5,n[3]),d.fromElements(.5,-.5,-.5,n[4]),d.fromElements(.5,-.5,.5,n[5]),d.fromElements(.5,.5,-.5,n[6]),d.fromElements(.5,.5,.5,n[7]);for(let i=0;i<8;++i)M.multiplyByPoint(e,n[i],n[i]);return en.fromPoints(n,t)}var Lvt=new d;function Jte(e,t,n,i){let o=e.x,r=t.x,a=e.y,s=t.y<a?t.y+D.TWO_PI:t.y,c=e.z,u=t.z,f=s-a,h=a+f*.5,p=xvt,A=0;p[A++]=a,p[A++]=s,p[A++]=h,f>D.PI&&(p[A++]=h-D.PI_OVER_TWO,p[A++]=h+D.PI_OVER_TWO);let m=Number.POSITIVE_INFINITY,_=Number.POSITIVE_INFINITY,y=Number.NEGATIVE_INFINITY,C=Number.NEGATIVE_INFINITY;for(let O=0;O<A;++O){let G=p[O]-h,F=Math.cos(G),U=Math.sin(G),Q=F*o,H=U*o,Y=F*r,$=U*r;m=Math.min(m,Q,Y),_=Math.min(_,H,$),y=Math.max(y,Q,Y),C=Math.max(C,H,$)}let E=y-m,b=C-_,x=u-c,S=(m+y)*.5,B=(_+C)*.5,v=(c+u)*.5,P=d.fromElements(S,B,v,Tvt),N=J.fromRotationZ(h,Svt),L=d.fromElements(E,b,x,Lvt),g=M.fromScale(L,Dvt),I=M.fromRotation(N,Bvt),T=M.fromTranslation(P,wvt),w=M.multiplyTransformation(I,M.multiplyTransformation(T,g,Kte),Kte),R=M.multiplyTransformation(n,w,Kte);return Mvt(R)?en.fromTransformation(R,i):Nvt(R,i)}var VI=ed;function hh(){this._orientedBoundingBox=new en,this._boundingSphere=new le,this._boundTransform=new M,this._shapeTransform=new M,this._rectangle=new ce,this._minimumHeight=hh.DefaultMinBounds.z,this._maximumHeight=hh.DefaultMaxBounds.z,this._ellipsoid=new te,this._translation=new d,this._rotation=new J,this._shaderUniforms={cameraPositionCartographic:new d,ellipsoidEcToEastNorthUp:new J,ellipsoidRadii:new d,eccentricitySquared:0,evoluteScale:new k,ellipsoidCurvatureAtLatitude:new k,ellipsoidInverseRadiiSquared:new d,ellipsoidRenderLongitudeMinMax:new k,ellipsoidShapeUvLongitudeRangeOrigin:0,ellipsoidShapeUvLongitudeMinMaxMid:new d,ellipsoidLocalToShapeUvLongitude:new k,ellipsoidLocalToShapeUvLatitude:new k,ellipsoidRenderLatitudeSinMinMax:new k,ellipsoidInverseHeightDifference:0,clipMinMaxHeight:new k},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}Object.defineProperties(hh.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var Ovt=new d,Fvt=new d,Qvt=new d,kvt=new d,Uvt=new d,zvt=new d,Gvt=new d,Vvt=new d,ZBe=new d,$Be=new d,Hvt=new ce;hh.prototype.update=function(e,t,n,i,o){let{DefaultMinBounds:r,DefaultMaxBounds:a}=hh;i=i??r,o=o??a;let s=D.EPSILON10,c=D.EPSILON3,u=D.EPSILON10,f=D.EPSILON10,h=D.EPSILON3,p=M.getScale(e,Vvt),A=d.clone(r,Ovt);A.z=-d.minimumComponent(p);let m=d.clamp(t,A,a,Fvt),_=d.clamp(n,A,a,Qvt),y=d.clamp(i,A,a,kvt),C=d.clamp(o,A,a,Uvt),E=d.maximumByComponent(m,y,zvt),b=d.minimumByComponent(_,C,Gvt),x=d.add(p,d.fromElements(_.z,_.z,_.z,ZBe),ZBe),S=d.add(p,d.fromElements(b.z,b.z,b.z,$Be),$Be);if(E.y>b.y||E.y===a.y||b.y===r.y||E.z>b.z||D.equalsEpsilon(S,d.ZERO,void 0,s))return!1;this._rectangle=ce.fromRadians(m.x,m.y,_.x,_.y),this._translation=M.getTranslation(e,this._translation),this._rotation=M.getRotation(e,this._rotation),this._ellipsoid=te.fromCartesian3(p,this._ellipsoid),this._minimumHeight=m.z,this._maximumHeight=_.z;let B=ce.fromRadians(E.x,E.y,b.x,b.y,Hvt);this._orientedBoundingBox=Zte(B,E.z,b.z,this._ellipsoid,this._translation,this._rotation,this._orientedBoundingBox),this._shapeTransform=M.fromRotationTranslation(this._rotation,this._translation,this._shapeTransform),this._boundTransform=M.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=le.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let v=a.x-r.x,P=.5*v,N=b.x<E.x,L=b.x-E.x+N*v,g=L<=u,I=L>=P-u&&L<v-u,T=L>u&&L<P-u,w=g||I||T,R=_.x<m.x,O=_.x-m.x+R*v,G=O>P+u&&O<v-u,F=O>=P-u&&O<=P+u,U=O<P-u,Q=G||F||U,H=b.y<-h,Y=b.y>=-h&&b.y<=+h,$=b.y>+h&&b.y<a.y-f,W=H||Y||$,K=E.y>r.y+f&&E.y<-h,Z=E.y>=-h&&E.y<=+h,pe=E.y>+h,ge=K||Z||pe,re=W||ge,ye=_.y-m.y,Ce=_.y<-h,Pe=_.y>=-h&&_.y<=+h,Ne=_.y>+h&&_.y<a.y-f,Le=Ce||Pe||Ne,Oe=m.y>r.y+f&&m.y<-h,ot=m.y>=-h&&m.y<=+h,Fe=m.y>+h,rt=Le||(Oe||ot||Fe),Ye=this._shaderUniforms,st=this._shaderDefines;for(let mt in st)st.hasOwnProperty(mt)&&(st[mt]=void 0);Ye.ellipsoidRadii=d.clone(x,Ye.ellipsoidRadii);let{x:ft,z:St}=Ye.ellipsoidRadii,Ie=St/ft;Ye.eccentricitySquared=1-Ie*Ie,Ye.evoluteScale=k.fromElements((ft*ft-St*St)/ft,(St*St-ft*ft)/St,Ye.evoluteScale),Ye.ellipsoidInverseRadiiSquared=d.divideComponents(d.ONE,d.multiplyComponents(Ye.ellipsoidRadii,Ye.ellipsoidRadii,Ye.ellipsoidInverseRadiiSquared),Ye.ellipsoidInverseRadiiSquared);let Se=0;st.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=Se,Se+=1,st.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=Se,Se+=1,Ye.clipMinMaxHeight=k.fromElements(E.z-_.z,b.z-_.z,Ye.clipMinMaxHeight);let Kt=_.z-m.z;if(Ye.ellipsoidInverseHeightDifference=1/Kt,m.z===_.z&&(Ye.ellipsoidInverseHeightDifference=0),w&&(st.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,st.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=Se,I?(st.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,Se+=1):T?(st.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,Se+=2):g&&(st.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,Se+=2),Ye.ellipsoidRenderLongitudeMinMax=k.fromElements(E.x,b.x,Ye.ellipsoidRenderLongitudeMinMax)),Q){st.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0;let mt=(m.x-r.x)/v,Gt=(_.x-r.x)/v,Hn=1-O/v,Je=(Gt+.5*Hn)%1;if(Ye.ellipsoidShapeUvLongitudeRangeOrigin=Je,_.x<m.x&&(st.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED=!0),O<=u)Ye.ellipsoidLocalToShapeUvLongitude=k.fromElements(0,1,Ye.ellipsoidLocalToShapeUvLongitude);else{let Vt=v/O,Lo=mt-Je,io=-Vt*(Lo-Math.floor(Lo));Ye.ellipsoidLocalToShapeUvLongitude=k.fromElements(Vt,io,Ye.ellipsoidLocalToShapeUvLongitude)}}if(w){let mt=D.equalsEpsilon(E.x,r.x,void 0,c),Gt=D.equalsEpsilon(b.x,a.x,void 0,c);mt&&(st.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY=!0),Gt&&(st.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY=!0);let Hn=(m.x-r.x)/v,Je=(_.x-r.x)/v,fo=(b.x-r.x)/v,Vt=1-L/v,Lo=(fo+.5*Vt)%1;Ye.ellipsoidShapeUvLongitudeMinMaxMid=d.fromElements(Hn,Je,Lo,Ye.ellipsoidShapeUvLongitudeMinMaxMid)}if(re&&(ge&&(st.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,st.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=Se,K?(st.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,Se+=1):Z?(st.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,Se+=1):pe&&(st.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,Se+=2)),W&&(st.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,st.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=Se,H?(st.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,Se+=2):Y?(st.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,Se+=1):$&&(st.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,Se+=1)),Ye.ellipsoidRenderLatitudeSinMinMax=k.fromElements(Math.sin(E.y),Math.sin(b.y),Ye.ellipsoidRenderLatitudeSinMinMax)),rt)if(st.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,ye<f)Ye.ellipsoidLocalToShapeUvLatitude=k.fromElements(0,1,Ye.ellipsoidLocalToShapeUvLatitude);else{let Gt=(a.y-r.y)/ye,Hn=(r.y-m.y)/ye;Ye.ellipsoidLocalToShapeUvLatitude=k.fromElements(Gt,Hn,Ye.ellipsoidLocalToShapeUvLatitude)}return this._shaderMaximumIntersectionsLength=Se,!0};var Wvt=new me,jvt=new d,Yvt=new M,eDe=new J;hh.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=this._ellipsoid,i=e.camera.positionWC,o=n.cartesianToCartographic(i,Wvt);d.fromElements(o.longitude,o.latitude,o.height,t.cameraPositionCartographic);let r=d.fromRadians(o.longitude,o.latitude,0,n,jvt);t.ellipsoidCurvatureAtLatitude=n.getLocalCurvature(r,t.ellipsoidCurvatureAtLatitude);let a=At.eastNorthUpToFixedFrame(r,n,Yvt),s=M.getRotation(a,eDe),c=e.context.uniformState.viewRotation,u=J.multiply(c,s,eDe);t.ellipsoidEcToEastNorthUp=J.transpose(u,t.ellipsoidEcToEastNorthUp)};var sDe=new ce;hh.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=1/Math.pow(2,e),a=t*r,s=(t+1)*r,c=n*r,u=(n+1)*r,f=i*r,h=(i+1)*r,p=ce.subsection(this._rectangle,a,c,s,u,sDe),A=D.lerp(this._minimumHeight,this._maximumHeight,f),m=D.lerp(this._minimumHeight,this._maximumHeight,h);return Zte(p,A,m,this._ellipsoid,this._translation,this._rotation,o)};var qvt=new k,Kvt=new k,pU=new k,tDe=new k,nDe=new k,AU=new k;function Xvt(e,t,n,i){let o=k.abs(e,qvt),r=k.fromElements(1/t.x,1/t.y,Kvt),a=k.fromElements(Math.SQRT1_2,Math.SQRT1_2,pU),s=k.multiplyComponents(t,a,tDe),c=k.fromElements(n.x*a.x*a.x*a.x,n.y*a.y*a.y*a.y,nDe);for(let u=0;u<3;++u){let f=k.magnitude(k.subtract(s,c,AU)),h=k.normalize(k.subtract(o,c,AU),AU),p=k.multiplyByScalar(h,f,AU);a=k.multiplyComponents(k.add(p,c,pU),r,pU),a=k.normalize(k.clamp(a,k.ZERO,k.ONE,pU),pU),s=k.multiplyComponents(t,a,tDe),c=k.fromElements(n.x*a.x*a.x*a.x,n.y*a.y*a.y*a.y,nDe)}return d.fromElements(Math.sign(e.x)*s.x,Math.sign(e.y)*s.y,k.magnitude(k.subtract(s,c,AU)),i)}var Jvt=new k,iDe=new k,Zvt=new d,oDe=new k;hh.prototype.convertLocalToShapeUvSpace=function(e,t){let n=Math.atan2(e.y,e.x),{ellipsoidRadii:i,evoluteScale:o,ellipsoidInverseRadiiSquared:r,ellipsoidInverseHeightDifference:a,ellipsoidShapeUvLongitudeRangeOrigin:s,ellipsoidLocalToShapeUvLongitude:c,ellipsoidLocalToShapeUvLatitude:u}=this._shaderUniforms,f=Math.hypot(e.x,e.y),h=k.fromElements(f,e.z,iDe),p=Xvt(h,k.fromElements(i.x,i.z,Jvt),o,Zvt),A=k.normalize(k.fromElements(p.x*r.x,p.y*r.z,oDe),oDe),m=Math.atan2(A.y,A.x),_=k.magnitude(h)<k.magnitude(p)?-1:1,y=k.subtract(h,p,iDe),C=_*k.magnitude(y),{ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:E,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:b}=this._shaderDefines;return n=(n+Math.PI)/(2*Math.PI),l(E)&&(n-=s,n=n-Math.floor(n),n=n*c.x+c.y),m=(m+Math.PI/2)/Math.PI,l(b)&&(m=m*u.x+u.y),C=1+C*a,d.fromElements(n,m,C,t)};var rDe=new d,aDe=new d,$vt=new d;hh.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=d.divideComponents(d.ONE,t,rDe),a=d.multiplyByScalar(r,o,rDe),s=d.multiplyByScalar(d.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,aDe),o,aDe),c=d.add(s,a,$vt),u=ce.subsection(this._rectangle,s.x,s.y,c.x,c.y,sDe),f=D.lerp(this._minimumHeight,this._maximumHeight,s.z),h=D.lerp(this._minimumHeight,this._maximumHeight,c.z);return Zte(u,f,h,this._ellipsoid,this._translation,this._rotation,i)};function Zte(e,t,n,i,o,r,a){return a=en.fromRectangle(e,t,n,i,a),a.center=d.add(a.center,o,a.center),a.halfAxes=J.multiply(a.halfAxes,r,a.halfAxes),a}hh.DefaultMinBounds=Object.freeze(new d(-D.PI,-D.PI_OVER_TWO,-te.WGS84.minimumRadius));hh.DefaultMaxBounds=Object.freeze(new d(D.PI,D.PI_OVER_TWO,10*te.WGS84.maximumRadius));var HI=hh;var td={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};td.getMinBounds=function(e){switch(e){case td.BOX:return GI.DefaultMinBounds;case td.ELLIPSOID:return HI.DefaultMinBounds;case td.CYLINDER:return VI.DefaultMinBounds}};td.getMaxBounds=function(e){switch(e){case td.BOX:return GI.DefaultMaxBounds;case td.ELLIPSOID:return HI.DefaultMaxBounds;case td.CYLINDER:return VI.DefaultMaxBounds}};td.getShapeConstructor=function(e){switch(e){case td.BOX:return GI;case td.ELLIPSOID:return HI;case td.CYLINDER:return VI}};var _c=Object.freeze(td);var $te=Object.freeze({UNLOADED:0,RECEIVING:1,PROCESSING:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function gU(e,t){this.spatialNode=e,this.keyframe=t,this.state=$te.UNLOADED,this.content=void 0,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}gU.prototype.unload=function(){this.content=this.content&&this.content.destroy(),this.spatialNode=void 0,this.state=$te.UNLOADED,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1};gU.priorityComparator=function(e,t){return e.priority-t.priority};gU.searchComparator=function(e,t){return e.keyframe-t.keyframe};gU.LoadState=$te;var Go=gU;function pA(e,t,n,i,o=134217728,r){let a=ePt(i),s=tPt(n),c=n*Ft.getSizeInBytes(i),u=pA.get3DTextureDimension(t,c,o,r),f=d.divideComponents(u,t,new d);this.channelCount=n,this.componentType=i,this.textureMemoryByteLength=c*u.x*u.y*u.z,this.tileCounts=d.clone(f,new d),this.voxelCountPerTile=d.clone(t,new d),this.maximumTileCount=f.x*f.y*f.z,this.texture=new hR({context:e,pixelFormat:s,pixelDatatype:a,flipY:!1,width:u.x,height:u.y,depth:u.z,sampler:new jt({wrapR:pn.CLAMP_TO_EDGE,wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:ci.LINEAR})}),this.nodes=new Array(this.maximumTileCount);for(let h=0;h<this.maximumTileCount;h++)this.nodes[h]=new nPt(h);for(let h=0;h<this.maximumTileCount;h++){let p=this.nodes[h];p.previousNode=h>0?this.nodes[h-1]:void 0,p.nextNode=h<this.maximumTileCount-1?this.nodes[h+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0,this._nearestSampling=!1}Object.defineProperties(pA.prototype,{nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling!==e&&(e?this.texture.sampler=jt.NEAREST:this.texture.sampler=new jt({wrapR:pn.CLAMP_TO_EDGE,wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:ci.LINEAR}),this._nearestSampling=e)}}});function ePt(e){if(e===Ft.FLOAT32||e===Ft.FLOAT64)return He.FLOAT;if(e===Ft.UINT8)return He.UNSIGNED_BYTE}function tPt(e){switch(e){case 1:return qe.RED;case 2:return qe.RG;case 3:return qe.RGB;case 4:return qe.RGBA}}function nPt(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}pA.prototype.add=function(e){if(this.isFull())throw new de("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};pA.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new de("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--};pA.prototype.isFull=function(){return this.emptyList===void 0};pA.get3DTextureDimension=function(e,t,n,i){let{maximum3DTextureSize:o}=Rt;if(d.maximumComponent(e)>o)throw new ue("The GL context does not support a 3D texture large enough to contain a tile with the given dimensions.");let r=t*e.x*e.y*e.z,a=Math.floor(n/r);if(a<1)throw new ue("Not enough texture memory available to create a megatexture with the given tile dimensions.");l(i)?i=Math.min(i,a):i=a;let s=Object.entries(e).sort((f,h)=>h[1]-f[1]),c=s.map(([f,h])=>Math.floor(o/h));for(let f=0;f<3;f++){let h=cDe(c);if(h<i)break;let p=c.slice();p.splice(f,1);let A=p[0]*p[1],m=h-i,_=Math.floor(m/A);c[f]-=_}cDe(c)>a&&(c[2]=Math.floor(a/(c[0]*c[1])));let u=new d;for(let f=0;f<3;f++){let[h,p]=s[f];u[h]=c[f]*p}return u};function cDe(e){return e.reduce((t,n)=>t*n)}pA.prototype.writeDataToTexture=function(e,t){let{tileCounts:n,voxelCountPerTile:i}=this,o={arrayBufferView:t,width:i.x,height:i.y,depth:i.z},r=n.x*n.y,a=Math.floor(e/r),s=e-a*r,c=Math.floor(s/n.x),u=s-c*n.x,f={source:o,xOffset:u*i.x,yOffset:c*i.y,zOffset:a*i.z};this.texture.copyFrom(f)};pA.prototype.isDestroyed=function(){return!1};pA.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),fe(this)};var _U=pA;function mh(e,t,n,i,o,r,a){this.children=void 0,this.parent=o,this.level=e,this.x=t,this.y=n,this.z=i,this.dimensions=d.clone(a),this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new en,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(r)}var iPt=new d;mh.prototype.computeBoundingVolumes=function(e){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let t=J.getScale(this.orientedBoundingBox.halfAxes,iPt),n=2*d.maximumComponent(t);this.approximateVoxelSize=n/d.minimumComponent(this.dimensions)};mh.prototype.constructChildNodes=function(e){let{level:t,x:n,y:i,z:o}=this,r=n*2,a=i*2,s=o*2,c=a+1,u=r+1,f=s+1,h=t+1,p=[[h,r,a,s],[h,u,a,s],[h,r,c,s],[h,u,c,s],[h,r,a,f],[h,u,a,f],[h,r,c,f],[h,u,c,f]];this.children=p.map(([A,m,_,y])=>new mh(A,m,_,y,this,e,this.dimensions))};mh.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};mh.prototype.computeScreenSpaceError=function(e,t){let n=this.orientedBoundingBox,i=Math.sqrt(n.distanceSquaredTo(e));i=Math.max(i,D.EPSILON7);let o=this.approximateVoxelSize,r=t*(o/i);this.screenSpaceError=r};var lDe={keyframe:0};function yU(e,t){return lDe.keyframe=e,Co(t,lDe,Go.searchComparator)}mh.prototype.computeSurroundingRenderableKeyframeNodes=function(e){let t=this,n=t.level,i=Math.floor(e),o=Math.ceil(e),r,a,s=+Number.MAX_VALUE,c=+Number.MAX_VALUE;for(;l(t);){let{renderableKeyframeNodes:h}=t;if(h.length>=1){let p=oPt(i,h),A=h[p],m=o===i||i<A.keyframe?p:Math.min(p+1,h.length-1),_=h[m],y=i-A.keyframe,C=uDe(n-t.level,y);C<s&&(s=C,r=A);let E=_.keyframe-o,b=uDe(n-t.level,E);if(b<c&&(c=b,a=_),y===0&&E===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=r,this.renderableKeyframeNodeNext=a,!l(r)||!l(a))return;let u=r.keyframe,f=a.keyframe;this.renderableKeyframeNodeLerp=u===f?0:D.clamp((e-u)/(f-u),0,1)};function oPt(e,t){let n=yU(e,t);return n<0?D.clamp(~n-1,0,t.length-1):n}function uDe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}mh.prototype.isVisited=function(e){return this.visitedFrameNumber===e};mh.prototype.createKeyframeNode=function(e){let t=yU(e,this.keyframeNodes);if(t<0){t=~t;let n=new Go(this,e);this.keyframeNodes.splice(t,0,n)}};mh.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=yU(n,this.keyframeNodes);if(i<0)throw new de("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=yU(n,this.renderableKeyframeNodes);if(o<0)throw new de("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(o,1)}e.unload()};mh.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.megatextureIndex!==-1||e.content.metadata.length!==t.length)throw new de("Keyframe node cannot be added to megatexture");let{metadata:n}=e.content;for(let r=0;r<t.length;r++){let a=t[r];e.megatextureIndex=a.add(n[r])}let i=this.renderableKeyframeNodes,o=yU(e.keyframe,i);if(o>=0)throw new de("Keyframe already renderable");o=~o,i.splice(o,0,e)};mh.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 CU=mh;function iE(e,t,n,i){let{provider:o,dimensions:r,inputDimensions:a}=e,{types:s,componentTypes:c}=o;l(i)?i=Math.min(Math.max(0,i),512*1024*1024):i=128*1024*1024,this._primitive=e,this.textureMemoryByteLength=0,this.megatextures=new Array(s.length);let u=l(o.maximumTileCount)?o.maximumTileCount:l(o.availableLevels)?(8**o.availableLevels-1)/7:void 0;for(let C=0;C<s.length;C++){let E=s[C],b=bt.getComponentCount(E),x=c[C];this.megatextures[C]=new _U(t,a,b,x,i,u),this.textureMemoryByteLength+=this.megatextures[C].textureMemoryByteLength}let f=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._calculateStatistics=this._primitive._calculateStatistics??!1,this._frameNumber=0;let h=e._shape;this.rootNode=new CU(0,0,0,0,void 0,h,r),this._priorityQueue=new b_({maximumLength:f,comparator:Go.priorityComparator}),this._highPriorityKeyframeNodes=new Array(f),this._highPriorityKeyframeNodeCount=0,this._keyframeNodesInMegatexture=new Array(f),this._keyframeCount=n,this._sampleCount=void 0,this._keyframeLocation=0,this._binaryTreeKeyframeWeighting=new Array(n),this._initialTilesLoaded=!1;let p=this._binaryTreeKeyframeWeighting;p[0]=0,p[n-1]=0,ene(p,1,n-2,0);let A=9,m=2048,_=Math.floor(m/A),y=Math.ceil(f/_);this.internalNodeTexture=new Dt({context:t,pixelFormat:qe.RGBA,pixelDatatype:He.UNSIGNED_BYTE,flipY:!1,width:m,height:y,sampler:new jt({minificationFilter:Wt.NEAREST,magnificationFilter:ci.NEAREST})}),this.internalNodeTilesPerRow=_,this.internalNodeTexelSizeUv=new k(1/m,1/y),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new k}iE.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function ene(e,t,n,i){if(t>n)return;let o=Math.floor((t+n)/2);e[o]=i,ene(e,t,o-1,i+1),ene(e,o+1,n,i+1)}iE.simultaneousRequestCountMaximum=50;iE.prototype.update=function(e,t,n,i){let o=this._primitive,r=e.context,a=this.megatextures[0].maximumTileCount,s=this._keyframeCount,c=o._levelBlendFactor,u=c>0,f=s>1,h=(u?2:1)*(f?2:1);this._sampleCount=h;let p=h>=2;if(p&&!l(this.leafNodeTexture)){let b=Math.floor(512),x=Math.ceil(a/b);this.leafNodeTexture=new Dt({context:r,pixelFormat:qe.RGBA,pixelDatatype:He.UNSIGNED_BYTE,flipY:!1,width:1024,height:x,sampler:new jt({minificationFilter:Wt.NEAREST,magnificationFilter:ci.NEAREST})}),this.leafNodeTexelSizeUv=k.fromElements(1/1024,1/x,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=b}else!p&&l(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=D.clamp(t,0,s-1),n&&fDe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let A=Fi();sPt(this,e),cPt(this,e);let m=Fi();hPt(this,h,c);let _=Fi(),y=o.loadProgress.numberOfListeners>0||o.allTilesLoaded.numberOfListeners>0||o.initialTilesLoaded.numberOfListeners>0;if(this._debugPrint||this._calculateStatistics||y){let C=m-A,E=_-m,b=_-A;dPt(this,e,C,E,b)}};iE.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};iE.prototype.isDestroyed=function(){return!1};iE.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.textureMemoryByteLength=0,this.internalNodeTexture=this.internalNodeTexture&&this.internalNodeTexture.destroy(),this.leafNodeTexture=this.leafNodeTexture&&this.leafNodeTexture.destroy(),fe(this)};function fDe(e,t){if(t.computeBoundingVolumes(e._primitive._shape),l(t.children))for(let n=0;n<8;n++){let i=t.children[n];fDe(e,i)}}function rPt(e,t){if(e._simultaneousRequestCount>=iE.simultaneousRequestCountMaximum)return;let i=e._primitive.provider,{keyframe:o,spatialNode:r}=t;if(l(i.availableLevels)&&r.level>=i.availableLevels)return;function a(f){e._simultaneousRequestCount--,t.content=f,t.state=l(f)?Go.LoadState.PROCESSING:Go.LoadState.UNAVAILABLE}function s(f){e._simultaneousRequestCount--,t.state=Go.LoadState.FAILED,e._primitive.tileFailed.raiseEvent()}let c={tileLevel:r.level,tileX:r.x,tileY:r.y,tileZ:r.z,keyframe:o},u=i.requestData(c);l(u)&&(e._simultaneousRequestCount++,t.state=Go.LoadState.RECEIVING,u.then(a).catch(s))}function aPt(e){return e/(1+e)}function sPt(e,t){let n=e._frameNumber,i=e._priorityQueue;i.reset(),dDe(e.rootNode,Ka.MASK_INDETERMINATE,e,t);let o=e._highPriorityKeyframeNodes,r=0,a;for(;i.length>0;)a=i.removeMaximum(),a.highPriorityFrameNumber=n,o[r]=a,r++;e._highPriorityKeyframeNodeCount=r}function cPt(e,t){let n=e.megatextures[0],i=n.occupiedCount,o=e._keyframeNodesInMegatexture;o.length=i,o.sort(lPt);let r=e._highPriorityKeyframeNodes,a=e._highPriorityKeyframeNodeCount,s=0,c=0;for(let u=0;u<a;u++){let f=r[u];if(!(f.state===Go.LoadState.LOADED||f.spatialNode===void 0)&&(f.state===Go.LoadState.UNLOADED&&rPt(e,f),f.state===Go.LoadState.PROCESSING)){let{content:h}=f;if(h.update(e._primitive,t),!h.ready)continue;if(!uPt(h.metadata,e)){f.content=void 0,f.state=Go.LoadState.FAILED,e._primitive.tileFailed.raiseEvent();continue}let p=0;if(n.isFull()){p=i-1-s,s++;let A=o[p];e._primitive.tileUnload.raiseEvent(),A.spatialNode.destroyKeyframeNode(A,e.megatextures)}else p=i+c,c++;f.spatialNode.addKeyframeNodeToMegatextures(f,e.megatextures),f.state=Go.LoadState.LOADED,o[p]=f,e._primitive.tileLoad.raiseEvent()}}}function lPt(e,t){return e.highPriorityFrameNumber===t.highPriorityFrameNumber?t.priority-e.priority:t.highPriorityFrameNumber-e.highPriorityFrameNumber}function uPt(e,t){let n=t._primitive.provider.types.length;if(!Array.isArray(e)||e.length!==n)return!1;let{megatextures:i}=t;for(let o=0;o<n;o++){let{voxelCountPerTile:r,channelCount:a}=i[o],{x:s,y:c,z:u}=r,f=s*c*u,h=e[o],p=f*a;if(h.length!==p)return!1}return!0}function dDe(e,t,n,i){let{camera:o,context:r,pixelRatio:a,frameNumber:s}=i,{positionWC:c,frustum:u}=o,h=r.drawingBufferHeight/a/u.sseDenominator;if(e.computeScreenSpaceError(c,h),t=e.visibility(i,t),t===Ka.MASK_OUTSIDE)return;e.visitedFrameNumber=s;let p=n._primitive,A=p._shape,m=p.screenSpaceError,_=n._priorityQueue,y=n._keyframeCount,C=D.clamp(Math.floor(n._keyframeLocation),0,y-2),E=C+1;if(y===1)e.createKeyframeNode(0);else if(e.keyframeNodes.length!==y)for(let v=0;v<y;v++)e.createKeyframeNode(v);let{screenSpaceError:b,keyframeNodes:x}=e,S=aPt(b),B=!1;for(let v=0;v<x.length;v++){let P=x[v];P.priority=10*S+fPt(C,P.keyframe,E,n),P.state!==Go.LoadState.UNAVAILABLE&&P.state!==Go.LoadState.FAILED&&P.priority!==-Number.MAX_VALUE&&_.insert(P),P.state===Go.LoadState.LOADED&&(B=!0)}if(b<m||!B){e.children=void 0;return}l(e.children)||e.constructChildNodes(A);for(let v=0;v<8;v++){let P=e.children[v];dDe(P,t,n,i)}}function fPt(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),a=Math.pow(1-o/r,4),s=Math.exp(-i._binaryTreeKeyframeWeighting[t]);return D.lerp(s,a,.15+.85*a)}function dPt(e,t,n,i,o){let r=e._keyframeCount,a=e.rootNode,s=Object.keys(Go.LoadState).length,c=new Array(s),u=new Array(s),f=0;for(let B=0;B<s;B++){let v=new Array(r).fill(0);c[B]=v,u[B]=0}function h(B){let v=B.keyframeNodes;for(let P=0;P<v.length;P++){let N=v[P],L=N.keyframe,g=N.state;c[g][L]+=1,u[g]+=1,f++}if(l(B.children))for(let P=0;P<8;P++){let N=B.children[P];h(N)}}h(a),e._primitive.statistics.numberOfTilesWithContentReady=u[Go.LoadState.LOADED],e._primitive.statistics.visited=f;let p=u[Go.LoadState.RECEIVING],A=u[Go.LoadState.PROCESSING],m=p!==e._primitive.statistics.numberOfPendingRequests||A!==e._primitive.statistics.numberOfTilesProcessing;if(m&&t.afterRender.push(function(){return e._primitive.loadProgress.raiseEvent(p,A),!0}),e._primitive.statistics.numberOfPendingRequests=p,e._primitive.statistics.numberOfTilesProcessing=A,m&&(p===0&&A===0)&&(t.afterRender.push(function(){return e._primitive.allTilesLoaded.raiseEvent(),!0}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){return e._primitive.initialTilesLoaded.raiseEvent(),!0}))),!e._debugPrint)return;let y=`KEYFRAMES: ${c[Go.LoadState.LOADED]}`,C=`UNLOADED: ${u[Go.LoadState.UNLOADED]} | RECEIVING: ${u[Go.LoadState.RECEIVING]} | PROCESSING: ${u[Go.LoadState.PROCESSING]} | LOADED: ${u[Go.LoadState.LOADED]} | FAILED: ${u[Go.LoadState.FAILED]} | UNAVAILABLE: ${u[Go.LoadState.UNAVAILABLE]} | TOTAL: ${f}`,E=Math.round(n*100)/100,b=Math.round(i*100)/100,x=Math.round(o*100)/100,S=`LOAD: ${E} | OCT: ${b} | ALL: ${x}`;console.log(`${y} || ${C} || ${S}`)}var P5={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function hPt(e,t,n){let i=e._primitive._screenSpaceError,o=e._keyframeLocation,r=e._frameNumber,a=t>=2,s=0,c=0,u=[],f=[];function h(A,m,_,y,C){let E=!1;if(l(A.children))for(let b=0;b<8;b++){let x=A.children[b];x.computeSurroundingRenderableKeyframeNodes(o),x.isRenderable(r)&&(E=!0)}if(E){u[C]=P5.INTERNAL<<16|m,u[_]=y,s++,y=m,C=y*9+1;for(let b=0;b<8;b++){let x=A.children[b];m=s,_=m*9+0,h(x,m,_,y,C+b)}}else{if(e._primitive.tileVisible.raiseEvent(),a){let b=c*5,x=A.renderableKeyframeNodePrevious,S=A.level-x.spatialNode.level,B=x.spatialNode.parent,v=l(B)?B.renderableKeyframeNodePrevious:x,P=mPt(A,i,n),N=S,L=1,g=x.megatextureIndex,I=v.megatextureIndex;f[b+0]=P,f[b+1]=N,f[b+2]=L,f[b+3]=g,f[b+4]=I,u[C]=P5.LEAF<<16|c}else{let b=A.renderableKeyframeNodePrevious,S=A.level-b.spatialNode.level===0?P5.LEAF:P5.PACKED_LEAF_FROM_PARENT;u[C]=S<<16|b.megatextureIndex}c++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(o),p.isRenderable(r)&&h(p,0,0,0,0),pPt(u,9,e.internalNodeTilesPerRow,e.internalNodeTexture),a&&APt(f,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function mPt(e,t,n){if(e.parent===void 0)return 0;let i=e.screenSpaceError,o=e.parent.screenSpaceError,a=((t-i)/(o-i)+n-1)/n;return D.clamp(a,0,1)}function pPt(e,t,n,i){let o=qe.componentsLength(i.pixelFormat),r=Math.ceil(e.length/t),a=Math.max(1,t*Math.min(r,n)),s=Math.max(1,Math.ceil(r/n)),c=new Uint8Array(a*s*o);for(let h=0;h<e.length;h++){let p=e[h],A=h*o;for(let m=0;m<o;m++)c[A+m]=p>>>m*8&255}let f={source:{arrayBufferView:c,width:a,height:s},xOffset:0,yOffset:0};i.copyFrom(f)}function APt(e,t,n,i){let o=qe.componentsLength(i.pixelFormat),r=5,a=Math.ceil(e.length/r),s=Math.max(1,t*Math.min(a,n)),c=Math.max(1,Math.ceil(a/n)),u=new Uint8Array(s*c*o);for(let p=0;p<a;p++){let A=e[p*r+0],m=e[p*r+1],_=e[p*r+2],y=e[p*r+3],C=e[p*r+4],E=D.clamp(Math.floor(65536*A),0,65535);u[p*8+0]=E>>>0&255,u[p*8+1]=E>>>8&255,u[p*8+2]=m&255,u[p*8+3]=_&255,u[p*8+4]=y>>>0&255,u[p*8+5]=y>>>8&255,u[p*8+6]=C>>>0&255,u[p*8+7]=C>>>8&255}let h={source:{arrayBufferView:u,width:s,height:c},xOffset:0,yOffset:0};i.copyFrom(h)}var EU=iE;function AA(e){e=e??V.EMPTY_OBJECT,this._ready=!1,this._provider=e.provider??AA.DefaultProvider,this._traversal=void 0,this._statistics=new dm,this._calculateStatistics=e.calculateStatistics??!1,this._shape=void 0,this._shapeVisible=!1,this._dimensions=new d,this._inputDimensions=new d,this._paddingBefore=new d,this._paddingAfter=new d,this._availableLevels=1,this._minBounds=new d,this._minBoundsOld=new d,this._maxBounds=new d,this._maxBoundsOld=new d,this._minClippingBounds=new d,this._minClippingBoundsOld=new d,this._maxClippingBounds=new d,this._maxClippingBoundsOld=new d,this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrixOld=M.clone(this._modelMatrix),this._customShader=e.customShader??AA.DefaultCustomShader,this._customShaderCompilationEvent=new _e,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=e.clock,this._transformPositionLocalToWorld=new M,this._transformPositionWorldToLocal=new M,this._transformPlaneLocalToView=new M,this._transformDirectionWorldToLocal=new J,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new am,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1,this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new k,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new k,megatextureTextures:[],megatextureTileCounts:new d,dimensions:new d,inputDimensions:new d,paddingBefore:new d,paddingAfter:new d,transformPositionViewToLocal:new M,transformDirectionViewToLocal:new J,cameraPositionLocal:new d,cameraDirectionLocal:new d,cameraTileCoordinates:new ie,cameraTileUv:new d,ndcSpaceAxisAlignedBoundingBox:new ie,clippingPlanesTexture:void 0,clippingPlanesMatrix:new M,renderBoundPlanesTexture:void 0,stepSize:0,pickColor:new z},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]}}this.tileLoad=new _e,this.tileVisible=new _e,this.tileFailed=new _e,this.tileUnload=new _e,this.loadProgress=new _e,this.allTilesLoaded=new _e,this.initialTilesLoaded=new _e;let i=this._provider;gPt(this,i)}function gPt(e,t){let{shape:n,minBounds:i=_c.getMinBounds(n),maxBounds:o=_c.getMaxBounds(n)}=t;e.minBounds=i,e.maxBounds=o,e.minClippingBounds=i.clone(),e.maxClippingBounds=o.clone(),mDe(e);let r=_c.getShapeConstructor(n);e._shape=new r,e._shapeVisible=pDe(e)}Object.defineProperties(AA.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=M.clone(e,this._modelMatrix)}},shape:{get:function(){return this._provider.shape}},dimensions:{get:function(){return this._dimensions}},inputDimensions:{get:function(){return this._inputDimensions}},paddingBefore:{get:function(){return this._paddingBefore}},paddingAfter:{get:function(){return this._paddingAfter}},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}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(e){this._levelBlendFactor=D.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=d.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){this._maxBounds=d.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){this._minClippingBounds=d.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){this._maxClippingBounds=d.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){da.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=AA.DefaultCustomShader,this._shaderDirty=!0}}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}},statistics:{get:function(){return this._statistics}}});var _Pt=new ie,yPt=new ie,CPt=new M,EPt=new M,bPt=new d,IPt=new ie;AA.prototype.update=function(e){let t=this._provider,n=this._uniforms;this._customShader.update(e);let i=e.context;if(!this._ready){vPt(this,t,i),e.afterRender.push(()=>(this._ready=!0,!0));return}let o=mDe(this),r=DPt(this,e);if((o||r)&&(this._shapeVisible=pDe(this),UPt(this)&&(this._shaderDirty=!0)),!this._shapeVisible)return;this._shape.updateViewTransforms(e);let a=zPt(t.timeIntervalCollection,this._clock),s=this._traversal,c=s._sampleCount;if(s.update(e,a,o,this._disableUpdate),c!==s._sampleCount&&(this._shaderDirty=!0),!s.isRenderable(s.rootNode)||(this._debugDraw&&KPt(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),GPt(this,e)&&(this._shaderDirty=!0);let f=s.leafNodeTexture;l(f)&&(n.octreeLeafNodeTexture=s.leafNodeTexture,n.octreeLeafNodeTexelSizeUv=k.clone(s.leafNodeTexelSizeUv,n.octreeLeafNodeTexelSizeUv),n.octreeLeafNodeTilesPerRow=s.leafNodeTilesPerRow),this._shaderDirty&&(dU(this,i),this._shaderDirty=!1);let h=i.uniformState.viewProjection,{orientedBoundingBox:p}=this._shape,A=WPt(p,h,yPt);if(A.x===1||A.y===1||A.z===-1||A.w===-1)return;n.ndcSpaceAxisAlignedBoundingBox=ie.clone(A,n.ndcSpaceAxisAlignedBoundingBox);let _=i.uniformState.inverseView,y=M.multiplyTransformation(this._transformPositionWorldToLocal,_,n.transformPositionViewToLocal);this._transformPlaneLocalToView=M.transpose(y,this._transformPlaneLocalToView);let C=i.uniformState.inverseViewRotation;n.transformDirectionViewToLocal=J.multiply(this._transformDirectionWorldToLocal,C,n.transformDirectionViewToLocal),n.cameraPositionLocal=M.multiplyByPoint(this._transformPositionWorldToLocal,e.camera.positionWC,n.cameraPositionLocal),n.cameraDirectionLocal=J.multiplyByVector(this._transformDirectionWorldToLocal,e.camera.directionWC,n.cameraDirectionLocal);let E=SPt(this,n.cameraPositionLocal,IPt);n.cameraTileCoordinates=ie.fromElements(Math.floor(E.x),Math.floor(E.y),Math.floor(E.z),E.w,n.cameraTileCoordinates),n.cameraTileUv=d.fromElements(E.x-Math.floor(E.x),E.y-Math.floor(E.y),E.z-Math.floor(E.z),n.cameraTileUv),n.stepSize=this._stepSizeMultiplier,xPt(this),TPt(this,e);let b=e.passes.pick?this._drawCommandPick:e.passes.pickVoxel?this._drawCommandPickVoxel:this._drawCommand;b.boundingVolume=this._shape.boundingSphere,e.commandList.push(b)};function xPt(e){let{megatextures:t}=e._traversal;for(let n=0;n<t.length;++n)t[n].nearestSampling=e._nearestSampling}function TPt(e,t){let n=e._uniforms,{renderBoundPlanes:i}=e._shape;l(i)&&(i.update(t,e._transformPlaneLocalToView),n.renderBoundPlanesTexture=i.texture)}function SPt(e,t,n){let i=e._shape.convertLocalToShapeUvSpace(t,bPt),o=e._availableLevels,r=2**(o-1);return ie.fromElements(i.x*r,i.y*r,i.z*r,o-1,n)}var wPt=new d,tne=new d,BPt=new me;function DPt(e,t){let{verticalExaggeration:n,verticalExaggerationRelativeHeight:i}=t;return e._verticalExaggeration===n&&e._verticalExaggerationRelativeHeight===i?!1:(e._verticalExaggeration=n,e._verticalExaggerationRelativeHeight=i,!0)}function vPt(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=z.clone(e._pickId.color,i.pickColor);let{shaderDefines:o,shaderUniforms:r}=e._shape;e._shapeDefinesOld=je(o,!0);let a=e._uniformMap;for(let c in r)if(r.hasOwnProperty(c)){let u=`u_${c}`;a[u]=function(){return r[c]}}if(e._dimensions=d.clone(t.dimensions,e._dimensions),i.dimensions=d.clone(e._dimensions,i.dimensions),e._paddingBefore=d.clone(t.paddingBefore??d.ZERO,e._paddingBefore),i.paddingBefore=d.clone(e._paddingBefore,i.paddingBefore),e._paddingAfter=d.clone(t.paddingAfter??d.ZERO,e._paddingAfter),i.paddingAfter=d.clone(e._paddingAfter,i.paddingAfter),e._inputDimensions=d.add(e._dimensions,e._paddingBefore,e._inputDimensions),e._inputDimensions=d.add(e._inputDimensions,e._paddingAfter,e._inputDimensions),t.metadataOrder===mA.Y_UP){let c=e._inputDimensions.y;e._inputDimensions.y=e._inputDimensions.z,e._inputDimensions.z=c}i.inputDimensions=d.clone(e._inputDimensions,i.inputDimensions),e._availableLevels=t.availableLevels??1;let s=t.keyframeCount??1;e._traversal=new EU(e,n,s),e.statistics.texturesByteLength=e._traversal.textureMemoryByteLength,kPt(e._traversal,i)}function mDe(e){return bU(e,"_modelMatrix","_modelMatrixOld")+bU(e,"_minBounds","_minBoundsOld")+bU(e,"_maxBounds","_maxBoundsOld")+bU(e,"_minClippingBounds","_minClippingBoundsOld")+bU(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function bU(e,t,n){let i=e[t],o=e[n],r=!i.equals(o);return r&&i.clone(o),r?1:0}var PPt=new d,RPt=new d,MPt=new d,NPt=new d,LPt=new M,OPt=new M;function pDe(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,i=d.clone(e._minBounds,PPt),o=d.clone(e._maxBounds,RPt),r=d.clone(e._minClippingBounds,MPt),a=d.clone(e._maxClippingBounds,NPt),s=M.clone(e._modelMatrix,LPt);if(e.shape===_c.ELLIPSOID)i.z=xo.getHeight(e._minBounds.z,t,n),o.z=xo.getHeight(e._maxBounds.z,t,n),r.z=xo.getHeight(e._minClippingBounds.z,t,n),a.z=xo.getHeight(e._maxClippingBounds.z,t,n);else{let m=d.fromElements(1,1,t,wPt);M.multiplyByScale(s,m,s),M.multiplyByTranslation(s,QPt(e),s)}let c=e._provider,u=c.shapeTransform??M.IDENTITY,f=c.globalTransform??M.IDENTITY,h=M.multiplyTransformation(f,s,OPt);M.multiplyTransformation(h,u,h);let p=e._shape;return p.update(h,i,o,r,a)?(e._transformPositionLocalToWorld=M.clone(p.shapeTransform,e._transformPositionLocalToWorld),e._transformPositionWorldToLocal=M.inverse(e._transformPositionLocalToWorld,e._transformPositionWorldToLocal),e._transformDirectionWorldToLocal=M.getMatrix3(e._transformPositionWorldToLocal,e._transformDirectionWorldToLocal),!0):!1}var FPt=new d;function QPt(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,{shapeTransform:i=M.IDENTITY,globalTransform:o=M.IDENTITY}=e._provider,r=M.getTranslation(i,tne),a=M.multiplyByPoint(e._modelMatrix,r,tne),s=M.multiplyByPoint(o,a,tne),u=te.WGS84.cartesianToCartographic(s,BPt),f=0;l(u)&&(f=u.height);let h=xo.getHeight(f,t,n);return d.fromElements(0,0,(h-f)/t,FPt)}function kPt(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=k.clone(e.internalNodeTexelSizeUv,t.octreeInternalNodeTexelSizeUv),t.octreeInternalNodeTilesPerRow=e.internalNodeTilesPerRow;let{megatextures:n}=e,i=n[0];t.megatextureTextures=new Array(n.length);for(let o=0;o<n.length;o++)t.megatextureTextures[o]=n[o].texture;t.megatextureTileCounts=d.clone(i.tileCounts,t.megatextureTileCounts)}function UPt(e){let{shaderDefines:t}=e._shape,n=Object.keys(t).some(i=>t[i]!==e._shapeDefinesOld[i]);return n&&(e._shapeDefinesOld=je(t,!0)),n}function zPt(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=X.secondsDifference(i.stop,i.start),s=X.secondsDifference(n,i.start)/r;return o+s}function GPt(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=M.transpose(M.multiplyTransformation(M.inverse(n.modelMatrix,r.clippingPlanesMatrix),e._transformPositionLocalToWorld,r.clippingPlanesMatrix),r.clippingPlanesMatrix)}return e._clippingPlanesState===i&&e._clippingPlanesEnabled===o?!1:(e._clippingPlanesState=i,e._clippingPlanesEnabled=o,!0)}AA.prototype.isDestroyed=function(){return!1};AA.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.statistics.texturesByteLength=0,this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),fe(this)};var hDe=new Array(new ie(-1,-1,-1,1),new ie(1,-1,-1,1),new ie(-1,1,-1,1),new ie(1,1,-1,1),new ie(-1,-1,1,1),new ie(1,-1,1,1),new ie(-1,1,1,1),new ie(1,1,1,1)),VPt=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),HPt=new Array(new ie,new ie,new ie,new ie,new ie,new ie,new ie,new ie);function WPt(e,t,n){let i=M.fromRotationTranslation(e.halfAxes,e.center,CPt),o=M.multiply(t,i,EPt),r=+Number.MAX_VALUE,a=-Number.MAX_VALUE,s=+Number.MAX_VALUE,c=-Number.MAX_VALUE,u,f=HPt,h=hDe.length;for(u=0;u<h;u++)M.multiplyByVector(o,hDe[u],f[u]);for(u=0;u<h;u++){let p=f[u];if(p.z>=-p.w){let A=p.x/p.w,m=p.y/p.w;r=Math.min(r,A),a=Math.max(a,A),s=Math.min(s,m),c=Math.max(c,m)}else for(let A=0;A<3;A++){let m=VPt[u*3+A],_=f[m];if(_.z>=-_.w){let y=p.z+p.w,C=_.z+_.w,E=y/(y-C),b=ie.lerp(p,_,E,_Pt),x=b.x/b.w,S=b.y/b.w;r=Math.min(r,x),a=Math.max(a,x),s=Math.min(s,S),c=Math.max(c,S)}}}return r=D.clamp(r,-1,1),s=D.clamp(s,-1,1),a=D.clamp(a,-1,1),c=D.clamp(c,-1,1),n=ie.fromElements(r,s,a,c,n),n}var nne=3e7,jPt=new d(nne,0,0),YPt=new d(0,nne,0),qPt=new d(0,0,nne);function KPt(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function o(c,u,f,h){i.add({positions:[c,u],width:h,material:Yi.fromType("Color",{color:f})})}function r(c,u,f){let h=c.computeCorners();o(h[0],h[1],u,f),o(h[2],h[3],u,f),o(h[4],h[5],u,f),o(h[6],h[7],u,f),o(h[0],h[2],u,f),o(h[4],h[6],u,f),o(h[1],h[3],u,f),o(h[5],h[7],u,f),o(h[0],h[4],u,f),o(h[2],h[6],u,f),o(h[1],h[5],u,f),o(h[3],h[7],u,f)}function a(c){if(!n.isRenderable(c))return;let u=c.level,h=Math.max(1,5/Math.pow(2,u)),A=[z.RED,z.LIME,z.BLUE][u%3];if(r(c.orientedBoundingBox,A,h),l(c.children))for(let m=0;m<8;m++)a(c.children[m])}r(e._shape.orientedBoundingBox,z.WHITE,5),a(n.rootNode);let s=10;o(d.ZERO,jPt,z.RED,s),o(d.ZERO,YPt,z.LIME,s),o(d.ZERO,qPt,z.BLUE,s),i.update(t)}AA.DefaultCustomShader=new UI({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material)
{
material.diffuse = vec3(1.0);
material.alpha = 1.0;
}`});function ADe(){this.ready=!0,this.shape=_c.BOX,this.dimensions=new d(1,1,1),this.names=["data"],this.types=[bt.SCALAR],this.componentTypes=[Ft.FLOAT32],this.maximumTileCount=1}ADe.prototype.requestData=function(e){if((l(e)?e.tileLevel??0:0)>=1)return;let n=new zI({metadata:[new Float32Array(1)]});return Promise.resolve(n)};AA.DefaultProvider=new ADe;var oE=AA;function XPt(e,t,n,i){if(!l(e)||l(t)&&e.id!==t)return;let r=(e.classes||{})[n];if(!l(r))return;let s=(r.properties||{})[i];if(l(s))return s}var IU=XPt;function JPt(e,t,n,i,o){this.schemaId=e,this.className=t,this.propertyName=n,this.classProperty=i,this.metadataProperty=o}var xU=JPt;function ZPt(e,t,n){if(!l(e))return;let i=e.propertyTextures;for(let o of i)if(o.class.id===t){let s=o.properties[n];if(l(s))return s}}var TU=ZPt;var M5=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function Ci(e){e=e??V.EMPTY_OBJECT;let t=e.canvas,n=e.creditContainer,i=e.creditViewport,o=e.contextOptions instanceof fR;if(o)this._context=e.contextOptions.createSceneContext(t);else{let u=je(e.contextOptions);this._context=new RE(t,u)}let r=this._context,a=l(n);a||(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=Jn(),this._jobScheduler=new t3,this._frameState=new $k(r,new Yk(n,"\u2022",i),this._jobScheduler),this._frameState.scene3DOnly=e.scene3DOnly??!1,this._removeCreditContainer=!a,this._creditContainer=n,this._canvas=t,this._computeEngine=new sD(r),this._ellipsoid=e.ellipsoid??te.default,this._globe=void 0,this._globeTranslucencyState=new e3,this._primitives=new ou({countReferences:o}),this._groundPrimitives=new ou({countReferences:o}),this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=Ci.defaultLogDepthBuffer&&r.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new LI,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=e.orderIndependentTranslucency??!0,this._executeOITFunction=void 0,this._depthPlane=new Xk(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new fi({color:new z,stencil:0,owner:this}),this._depthClearCommand=new fi({depth:1,owner:this}),this._stencilClearCommand=new fi({stencil:0}),this._classificationStencilClearCommand=new fi({stencil:0,renderState:Ve.fromCache({stencilMask:Yt.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new U3(this),this._preUpdate=new _e,this._postUpdate=new _e,this._renderError=new _e,this._preRender=new _e,this._postRender=new _e,this._minimumDisableDepthTestDistance=0,this._debugInspector=new q3,this._msaaSamples=e.msaaSamples??4,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new _e,this.morphComplete=new _e,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=z.clone(z.BLACK),this._mode=oe.SCENE3D,this._mapProjection=l(e.mapProjection)?e.mapProjection:new Wi(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 S0,this.fog=new Zk,this.fog.enabled=te.WGS84.equals(this._ellipsoid),te.WGS84.equals(this._ellipsoid)||(Bo.DEFAULT_VIEW_RECTANGLE=ce.fromDegrees(-45,-45,45,45)),this._shadowMapCamera=new Bo(this),this.shadowMap=new v_({context:r,lightCamera:this._shadowMapCamera,enabled:e.shadows??!1}),this.invertClassification=!1,this.invertClassificationColor=z.clone(z.WHITE),this._actualInvertClassificationColor=z.clone(this._invertClassificationColor),this._invertClassification=new dB,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new Q3,this._brdfLutGenerator=new zk,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new V3(this),this._cameraUnderground=!1,this._mapMode2D=e.mapMode2D??uu.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=e.requestRenderMode??!1,this._renderRequested=!0,this.maximumRenderTimeChange=e.maximumRenderTimeChange??0,this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=Gc.requestCompletedEvent.addEventListener(M5(this)),this._removeTaskProcessorListenerCallback=Zn.taskCompletedEvent.addEventListener(M5(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let s=new et(0,0,r.drawingBufferWidth,r.drawingBufferHeight),c=new Bo(this);this._logDepthBuffer&&(c.frustum.near=.1,c.frustum.far=1e10),this.preloadFlightCamera=new Bo(this),this.preloadFlightCullingVolume=void 0,this._picking=new A3(this),this._defaultView=new BI(this,c,s),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 NA,this._enableEdgeVisibility=!1,bDe(this,0,X.now()),this.updateFrameState(),this.initializeFrame()}Ci.defaultLogDepthBuffer=!0;function $Pt(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(M5(e))),n.push(t.terrainProviderChanged.addEventListener(M5(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(Ci.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 Rt.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return Rt.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 kh.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,$Pt(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 Bo(this),l(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new Jk(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,Rt.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}}});Ci.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 eRt(e,t){let n=e.pickedMetadataInfo,i=t.pickedMetadataInfo;return n?.schemaId!==i?.schemaId||n?.className!==i?.className||n?.propertyName!==i?.propertyName}function gDe(e,t,n){let i=e._frameState,o=e._context,r=e._view.oit,{lightShadowMaps:a,lightShadowsEnabled:s}=i.shadowState,c=t.derivedCommands;l(t.pickId)&&(c.picking=sA.createPickDerivedCommand(e,t,o,c.picking)),i.pickingMetadata&&t.pickMetadataAllowed&&(t.pickedMetadataInfo=i.pickedMetadataInfo,l(t.pickedMetadataInfo)&&(c.pickingMetadata=sA.createPickMetadataDerivedCommand(e,t,o,c.pickingMetadata))),t.pickOnly||(c.depth=sA.createDepthOnlyDerivedCommand(e,t,o,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=sA.createHdrCommand(t,o,c.hdr),t=c.hdr.command,c=t.derivedCommands),s&&t.receiveShadows&&(c.shadows=v_.createReceiveDerivedCommand(a,t,n,o,c.shadows)),t.pass===Be.TRANSLUCENT&&l(r)&&r.isSupported()&&(s&&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))}Ci.prototype.updateDerivedCommands=function(e){let{derivedCommands:t}=e;if(!l(t))return;let n=this._frameState,{shadowState:i,useLogDepth:o}=this._frameState,r=this._context,a=!1,s=i.lastDirtyTime;e.lastDirtyTime!==s&&(e.lastDirtyTime=s,e.dirty=!0,a=!0);let c=this._hdr,u=l(t.logDepth),f=l(t.hdr),h=l(t.originalCommand),p=o&&!u,A=c&&!f,m=(!o||!c)&&!h,_=n.pickingMetadata&&eRt(e,n);if(e.dirty=e.dirty||p||A||m||_,!e.dirty)return;e.dirty=!1;let{shadowsEnabled:y,shadowMaps:C}=i;y&&e.castShadows&&(t.shadows=v_.createCastDerivedCommand(C,e,a,r,t.shadows)),(u||p)&&(t.logDepth=sA.createLogDepthCommand(e,r,t.logDepth),gDe(this,t.logDepth.command,a)),(h||m)&&gDe(this,e,a)};var tRt=new lh({pass:cr.RENDER}),ine=new lh({pass:cr.PRELOAD}),one=new lh({pass:cr.PRELOAD_FLIGHT}),nRt=new lh({pass:cr.REQUEST_RENDER_MODE_DEFER_CHECK}),_De=new le,rne;function iRt(e){if(!(e._mode!==oe.SCENE3D||!e.globe?.show||e._cameraUnderground||e._globeTranslucencyState.translucent))return _De.radius=e.ellipsoid.minimumRadius+e.frameState.minimumTerrainHeight,rne=Z2.fromBoundingSphere(_De,e.camera.positionWC,rne),rne}Ci.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.pickVoxel=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function bDe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=X.clone(n,i.time)}Ci.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=iRt(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof An||this.camera.frustum instanceof ua),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=z.clone(this.invertClassificationColor,this._actualInvertClassificationColor),dB.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};Ci.prototype.isVisible=function(e,t,n){if(!l(t))return!1;let{boundingVolume:i}=t;return!l(i)||!t.cull?!0:e.computeVisibility(i)===Xt.OUTSIDE?!1:!l(n)||!t.occlude||!i.isOccluded(n)};var R5=new M(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);R5=M.inverseTransformation(R5,R5);function oRt(e,t,n,i){let o=t._frameState,r=o.context,a=e.boundingVolume;l(t._debugVolume)&&t._debugVolume.destroy();let s=d.clone(a.center);if(o.mode!==oe.SCENE3D){s=M.multiplyByPoint(R5,s,s);let m=o.mapProjection,_=m.unproject(s);s=m.ellipsoid.cartographicToCartesian(_)}let c,u,{radius:f}=a;l(f)?(c=Hs.createGeometry(new Hs({radii:new d(f,f,f),vertexFormat:gn.FLAT_VERTEX_FORMAT})),u=M.fromTranslation(s)):(c=Ic.createGeometry(Ic.fromDimensions({dimensions:new d(2,2,2),vertexFormat:gn.FLAT_VERTEX_FORMAT})),u=M.fromRotationTranslation(a.halfAxes,s,new M)),t._debugVolume=new Nn({geometryInstances:new Mt({geometry:Wn.toWireframe(c),modelMatrix:u,attributes:{color:new Jt(1,0,0,1)}}),appearance:new gn({flat:!0,translucent:!1}),asynchronous:!1});let h=o.commandList,p=o.commandList=[];t._debugVolume.update(o),e=p[0],o.useLogDepth&&(e=sA.createLogDepthCommand(e,r).command);let A;l(i)&&(A=n.framebuffer,n.framebuffer=i),e.execute(r,n),l(A)&&(n.framebuffer=A),o.commandList=h}function nd(e,t,n,i){let o=t._frameState,r=t._context;if(l(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof fi){e.execute(r,n);return}e.debugShowBoundingVolume&&l(e.boundingVolume)&&oRt(e,t,n,i),o.useLogDepth&&l(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let a=o.passes;if(!a.pick&&!a.pickVoxel&&!a.depth&&t._hdr&&l(e.derivedCommands)&&l(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),a.pick||a.depth){if(a.pick&&!a.depth){if(o.pickingMetadata&&l(e.derivedCommands.pickingMetadata)){e=e.derivedCommands.pickingMetadata.pickMetadataCommand,e.execute(r,n);return}if(!o.pickingMetadata&&l(e.derivedCommands.picking)){e=e.derivedCommands.picking.pickCommand,e.execute(r,n);return}}else if(l(e.derivedCommands.depth)){e=e.derivedCommands.depth.depthOnlyCommand,e.execute(r,n);return}}if(t.debugShowCommands||t.debugShowFrustums){t._debugInspector.executeDebugShowFrustumsCommand(t,e,n);return}o.shadowState.lightShadowsEnabled&&e.receiveShadows&&l(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(r,n):e.execute(r,n)}function yDe(e,t,n){let{derivedCommands:i}=e;if(!l(i))return;let o=t._frameState,r=t._context;o.useLogDepth&&l(i.logDepth)&&(e=i.logDepth.command);let{picking:a,pickingMetadata:s,depth:c}=e.derivedCommands;l(s)&&(e=i.pickingMetadata.pickMetadataCommand,e.execute(r,n)),l(a)?(e=a.pickCommand,e.execute(r,n)):l(c)&&(e=c.depthOnlyCommand,e.execute(r,n))}function IDe(e,t,n){return t.boundingVolume?.distanceSquaredTo(n)-e.boundingVolume?.distanceSquaredTo(n)}var rRt=new d;function CDe(e,t){let n=d.subtract(e,t,rRt),i=Math.max(0,d.magnitude(n));return i*i}function aRt(e,t,n){let i=e.boundingVolume,o=t.boundingVolume;return CDe(o.center,n)-CDe(i.center,n)}function sRt(e,t,n){return e.boundingVolume?.distanceSquaredTo(n)-t.boundingVolume?.distanceSquaredTo(n)+D.EPSILON12}function cRt(e,t,n,i,o){rA(i,IDe,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function lRt(e,t,n,i,o){rA(i,sRt,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function uRt(e,t,n){e.context.uniformState.updatePass(Be.VOXELS);let i=n.commands[Be.VOXELS];i.length=n.indices[Be.VOXELS],rA(i,IDe,e.camera.positionWC);for(let o=0;o<i.length;++o)nd(i[o],e,t)}function fRt(e,t,n){e.context.uniformState.updatePass(Be.GAUSSIAN_SPLATS);let i=n.commands[Be.GAUSSIAN_SPLATS];i.length=n.indices[Be.GAUSSIAN_SPLATS],rA(i,aRt,e.camera.positionWC);for(let o=0;o<i.length;++o)nd(i[o],e,t)}var dRt=new Vi,hRt=new lu,mRt=new An,pRt=new ua;function ARt(e){let{frustum:t}=e;return l(t.fov)?t.clone(dRt):l(t.infiniteProjectionMatrix)?t.clone(hRt):l(t.width)?t.clone(mRt):t.clone(pRt)}function gRt(e){if(e._environmentState.useOIT){if(!l(e._executeOITFunction)){let{view:t,context:n}=e;e._executeOITFunction=function(i,o,r,a,s){t.globeDepth.prepareColorTextures(n),t.oit.executeCommands(i,o,r,a,s)}}return e._executeOITFunction}return e.frameState.passes.render?cRt:lRt}function _Rt(e,t,n){let{frameState:i,context:o}=e,{pick:r,pickVoxel:a}=i.passes,s=r||a,c;!s&&e._environmentState.useInvertClassification&&i.invertClassificationColor.alpha<1&&(c=e._invertClassification);let u=gRt(e);o.uniformState.updatePass(Be.TRANSLUCENT);let f=n.commands[Be.TRANSLUCENT];f.length=n.indices[Be.TRANSLUCENT],u(e,nd,t,f,c)}function yRt(e,t,n){let{translucentTileClassification:i,globeDepth:o}=e._view;if(!(n.indices[Be.CESIUM_3D_TILE_CLASSIFICATION]>0)||!i.isSupported())return;let a=n.commands[Be.TRANSLUCENT];i.executeTranslucentCommands(e,nd,t,a,o.depthStencilTexture),i.executeClassificationCommands(e,nd,t,n)}function CRt(e,t,n){e.context.uniformState.updatePass(Be.CESIUM_3D_TILE_EDGES);let i=t.framebuffer;e.context.uniformState.edgeColorTexture=e.context.defaultTexture,e.context.uniformState.edgeIdTexture=e.context.defaultTexture,e.context.uniformState.edgeDepthTexture=e.context.defaultTexture,e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)&&(t.framebuffer=e._view.edgeFramebuffer.framebuffer);let o=n.commands[Be.CESIUM_3D_TILE_EDGES],r=n.indices[Be.CESIUM_3D_TILE_EDGES];e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)&&e._view.edgeFramebuffer.getClearCommand(new z(0,0,0,0)).execute(e.context,t);for(let a=0;a<r;++a)nd(o[a],e,t);t.framebuffer=i}function sne(e,t){let{camera:n,context:i,frameState:o}=e,{uniformState:r}=i;r.updateCamera(n);let a=ARt(n);a.near=n.frustum.near,a.far=n.frustum.far;let s=o.passes,c=s.pick||s.pickVoxel;c||ERt(e,t);let{clearGlobeDepth:u,renderTranslucentDepthForPick:f,useDepthPlane:h,useGlobeDepthFramebuffer:p,useInvertClassification:A,usePostProcessSelected:m}=e._environmentState,{globeDepth:_,globeTranslucencyFramebuffer:y,sceneFramebuffer:C,frustumCommandsList:E}=e._view,b=E.length,x=e._globeTranslucencyState,S=e._depthClearCommand,B=e._stencilClearCommand,v=e._classificationStencilClearCommand,P=e._depthPlane,N=n.position.z;function L(I,T){r.updatePass(T);let w=I.commands[T],R=I.indices[T];for(let O=0;O<R;++O)nd(w[O],e,t);return R}function g(I,T){r.updatePass(T);let w=I.commands[T],R=I.indices[T];for(let O=0;O<R;++O)yDe(w[O],e,t)}for(let I=0;I<b;++I){let T=b-I-1,w=E[T];e.mode===oe.SCENE2D?(n.position.z=N-w.near+1,a.far=Math.max(1,w.far-w.near),a.near=1,r.update(o),r.updateFrustum(a)):(a.near=T!==0?w.near*e.opaqueFrustumNearOffset:w.near,a.far=w.far,r.updateFrustum(a)),S.execute(i,t),i.stencilBuffer&&B.execute(i,t),x.translucent?(r.updatePass(Be.GLOBE),x.executeGlobeCommands(w,nd,y,e,t)):L(w,Be.GLOBE),p&&_.executeCopyDepth(i,t),f||(x.translucent?(r.updatePass(Be.TERRAIN_CLASSIFICATION),x.executeGlobeClassificationCommands(w,nd,y,e,t)):L(w,Be.TERRAIN_CLASSIFICATION)),u&&(S.execute(i,t),h&&P.execute(i,t));let R;if(CRt(e,t,w),e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)){let G=e._view.edgeFramebuffer.colorTexture;l(G)?e.context.uniformState.edgeColorTexture=G:e.context.uniformState.edgeColorTexture=e.context.defaultTexture;let F=e._view.edgeFramebuffer.idTexture;l(F)?e.context.uniformState.edgeIdTexture=F:e.context.uniformState.edgeIdTexture=e.context.defaultTexture;let U=e._view.edgeFramebuffer.depthTexture;l(U)?e.context.uniformState.edgeDepthTexture=U:e.context.uniformState.edgeDepthTexture=e.context.defaultTexture}else e.context.uniformState.edgeColorTexture=e.context.defaultTexture,e.context.uniformState.edgeIdTexture=e.context.defaultTexture,e.context.uniformState.edgeDepthTexture=e.context.defaultTexture;if(!A||c||f)R=L(w,Be.CESIUM_3D_TILE),R>0&&(p&&(_.prepareColorTextures(i,u),_.executeUpdateDepth(i,t,_.depthStencilTexture)),f||(R=L(w,Be.CESIUM_3D_TILE_CLASSIFICATION)));else{e._invertClassification.clear(i,t);let G=t.framebuffer;t.framebuffer=e._invertClassification._fbo.framebuffer,R=L(w,Be.CESIUM_3D_TILE),p&&(e._invertClassification.prepareTextures(i),_.executeUpdateDepth(i,t,e._invertClassification._fbo.getDepthStencilTexture())),R=L(w,Be.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),t.framebuffer=G,e._invertClassification.executeClassified(i,t),o.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),R>0&&i.stencilBuffer&&v.execute(i,t),R=L(w,Be.CESIUM_3D_TILE_CLASSIFICATION)}if(R>0&&i.stencilBuffer&&B.execute(i,t),uRt(e,t,w),L(w,Be.OPAQUE),fRt(e,t,w),T!==0&&e.mode!==oe.SCENE2D&&(a.near=w.near,r.updateFrustum(a)),_Rt(e,t,w),yRt(e,t,w),i.depthTexture&&e.useDepthPicking&&(p||f)){let G=e._picking.getPickDepth(e,T);G.update(i,_.depthStencilTexture),G.executeCopyDepth(i,t)}if(c||!m)continue;let O=t.framebuffer;t.framebuffer=C.getIdFramebuffer(),a.near=T!==0?w.near*e.opaqueFrustumNearOffset:w.near,a.far=w.far,r.updateFrustum(a),x.translucent?(r.updatePass(Be.GLOBE),x.executeGlobeCommands(w,yDe,y,e,t)):g(w,Be.GLOBE),u&&(S.framebuffer=t.framebuffer,S.execute(i,t),S.framebuffer=void 0),u&&h&&P.execute(i,t),g(w,Be.CESIUM_3D_TILE),g(w,Be.OPAQUE),g(w,Be.TRANSLUCENT),t.framebuffer=O}}function ERt(e,t){let{context:n,environmentState:i,view:o}=e;if(n.uniformState.updatePass(Be.ENVIRONMENT),l(i.skyBoxCommand)&&nd(i.skyBoxCommand,e,t),i.isSkyAtmosphereVisible&&nd(i.skyAtmosphereCommand,e,t),i.isSunVisible&&(i.sunDrawCommand.execute(n,t),e.sunBloom&&!i.useWebVR)){let a;i.useGlobeDepthFramebuffer?a=o.globeDepth.framebuffer:i.usePostProcess?a=o.sceneFramebuffer.framebuffer:a=i.originalFramebuffer,e._sunPostProcess.execute(n),e._sunPostProcess.copy(n,a),t.framebuffer=a}i.isMoonVisible&&i.moonCommand.execute(n,t);let r=e.frameState.panoramaCommandList;for(let a=r.length-1;a>=0;a--){let s=r[a];l(s.shaderProgram)?nd(r[a],e,t):r.splice(a,1)}}function xDe(e){e.context.uniformState.updatePass(Be.COMPUTE);let t=e._environmentState.sunComputeCommand;l(t)&&t.execute(e._computeEngine);let n=e._computeCommandList;for(let i=0;i<n.length;++i)n[i].execute(e._computeEngine)}function bRt(e,t){e.context.uniformState.updatePass(Be.OVERLAY);let n=e.context,i=e._overlayCommandList;for(let o=0;o<i.length;++o)i[o].execute(n,t)}function IRt(e,t,n){let{shadowMapCullingVolume:i,isPointLight:o,passes:r}=n,a=r.length,s=[Be.GLOBE,Be.CESIUM_3D_TILE,Be.OPAQUE,Be.TRANSLUCENT];for(let c=0;c<t.length;++c){let u=t[c];if(e.updateDerivedCommands(u),!(!u.castShadows||s.indexOf(u.pass)<0||!e.isVisible(i,u)))if(o)for(let f=0;f<a;++f)r[f].commandList.push(u);else if(a===1)r[0].commandList.push(u);else{let f=!1;for(let h=a-1;h>=0;--h){let p=r[h].cullingVolume;if(e.isVisible(p,u))r[h].commandList.push(u),f=!0;else if(f)break}}}}function TDe(e){let{shadowState:t,commandList:n}=e.frameState,{shadowsEnabled:i,shadowMaps:o}=t;if(!i)return;let{context:r}=e,{uniformState:a}=r;for(let s=0;s<o.length;++s){let c=o[s];if(c.outOfView)continue;let{passes:u}=c;for(let f=0;f<u.length;++f)u[f].commandList.length=0;IRt(e,n,c);for(let f=0;f<u.length;++f){let h=c.passes[f],{camera:p,commandList:A}=h;a.updateCamera(p),c.updatePass(r,f);for(let m=0;m<A.length;++m){let _=A[m];a.updatePass(_.pass);let y=_.derivedCommands.shadows.castCommands[s];nd(y,e,h.passState)}}}}var xRt=new d;Ci.prototype.updateAndExecuteCommands=function(e,t){FRt(this,e,t),this._environmentState.useWebVR?TRt(this,e,t):this._frameState.mode!==oe.SCENE2D||this._mapMode2D===uu.ROTATE?rE(!0,this,e):NRt(this,e)};function TRt(e,t){let n=e._view,i=n.camera,r=e._environmentState.renderTranslucentDepthForPick;SDe(e),n.createPotentiallyVisibleSet(e),xDe(e),r||TDe(e);let a=t.viewport;a.x=0,a.y=0,a.width=a.width*.5;let s=Bo.clone(i,e._cameraVR);s.frustum=i.frustum;let c=i.frustum.near,u=c*(e.focalLength??5),f=e.eyeSeparation??u/30,h=d.multiplyByScalar(s.right,f*.5,xRt);i.frustum.aspectRatio=a.width/a.height;let p=.5*f*c/u;d.add(s.position,h,i.position),i.frustum.xOffset=p,sne(e,t),a.x=a.width,d.subtract(s.position,h,i.position),i.frustum.xOffset=-p,sne(e,t),Bo.clone(s,i)}var SRt=new me(Math.PI,D.PI_OVER_TWO),wRt=new d,BRt=new d,DRt=new M,vRt=new M,PRt=new d,RRt=new d,MRt=new et;function NRt(e,t){let{frameState:n,camera:i}=e,{uniformState:o}=e.context,r=t.viewport,a=et.clone(r,MRt);t.viewport=a;let s=SRt,c=wRt;e.mapProjection.project(s,c);let f=d.clone(i.position,BRt),h=M.clone(i.transform,vRt),p=i.frustum.clone();i._setTransform(M.IDENTITY);let A=M.computeViewportTransformation(a,0,1,DRt),m=i.frustum.projectionMatrix,_=i.positionWC.y,y=d.fromElements(D.sign(_)*c.x-_,0,-i.positionWC.x,PRt),C=At.pointToGLWindowCoordinates(m,A,y,RRt);C.x=Math.floor(C.x);let E=a.x,b=a.width;if(_===0||C.x<=E||C.x>=E+b)rE(!0,e,t);else if(Math.abs(E+b*.5-C.x)<1)a.width=C.x-a.x,i.position.x*=D.sign(i.position.x),i.frustum.right=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),rE(!0,e,t),a.x=C.x,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),rE(!1,e,t);else if(C.x>E+b*.5){a.width=C.x-E;let x=i.frustum.right;i.frustum.right=c.x-_,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),rE(!0,e,t),a.x=C.x,a.width=E+b-C.x,i.position.x=-i.position.x,i.frustum.left=-i.frustum.right,i.frustum.right=x-i.frustum.right*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),rE(!1,e,t)}else{a.x=C.x,a.width=E+b-C.x;let x=i.frustum.left;i.frustum.left=-c.x-_,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),rE(!0,e,t),a.x=E,a.width=C.x-E,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=x-i.frustum.left*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),rE(!1,e,t)}i._setTransform(h),d.clone(f,i.position),i.frustum=p.clone(),t.viewport=r}function rE(e,t,n){let i=t._view,{renderTranslucentDepthForPick:o}=t._environmentState;e||(t.frameState.commandList.length=0),SDe(t),i.createPotentiallyVisibleSet(t),e&&(xDe(t),o||TDe(t)),sne(t,n)}var EDe=new Ka;Ci.prototype.updateEnvironment=function(){let e=this._frameState,t=this._view,n=this._environmentState,i=e.passes.render,o=e.passes.offscreen,r=this.atmosphere,a=this.skyAtmosphere,s=this.globe,c=this._globeTranslucencyState;if(!i||this._mode!==oe.SCENE2D&&t.camera.frustum instanceof An||!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(a)){if(l(s))a.setDynamicLighting(lg.fromGlobeFlags(s)),n.isReadyForAtmosphere=n.isReadyForAtmosphere||!s.show||s._surface._tilesToRender.length>0;else{let C=r.dynamicLighting;a.setDynamicLighting(C),n.isReadyForAtmosphere=!0}n.skyAtmosphereCommand=a.update(e,s),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 y=l(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=l(y)?y.drawCommand:void 0,n.sunComputeCommand=l(y)?y.computeCommand:void 0,n.moonCommand=l(this.moon)?this.moon.update(e):void 0}let u=n.clearGlobeDepth=l(s)&&s.show&&(!s.depthTestAgainstTerrain||this.mode===oe.SCENE2D);(n.useDepthPlane=u&&this.mode===oe.SCENE3D&&c.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==oe.SCENE2D&&!o;let h=e.mode===oe.SCENE3D&&!c.sunVisibleThroughGlobe?e.occluder:void 0,p=e.cullingVolume,A=EDe.planes;for(let y=0;y<5;++y)A[y]=p.planes[y];p=EDe,n.isSkyAtmosphereVisible=l(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(p,n.sunDrawCommand,h),n.isMoonVisible=this.isVisible(p,n.moonCommand,h);let m=this.specularEnvironmentMaps,_=this._specularEnvironmentCubeMap;l(m)&&_?.url!==m?(_=_&&_.destroy(),this._specularEnvironmentCubeMap=new kh(m)):!l(m)&&l(_)&&(_.destroy(),this._specularEnvironmentCubeMap=void 0),l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.update(e)};function LRt(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new aA({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 ORt(e){let t=e._frameState,{passes:n,shadowState:i,shadowMaps:o}=t,r=o.length,a=r>0&&!n.pick&&!n.pickVoxel&&e.mode===oe.SCENE3D;if(a!==i.shadowsEnabled&&(++i.lastDirtyTime,i.shadowsEnabled=a),i.lightShadowsEnabled=!1,!!a){for(let s=0;s<r;++s)if(o[s]!==i.shadowMaps[s]){++i.lastDirtyTime;break}i.shadowMaps.length=0,i.lightShadowMaps.length=0;for(let s=0;s<r;++s){let c=o[s];c.update(t),i.shadowMaps.push(c),c.fromLightSource&&(i.lightShadowMaps.push(c),i.lightShadowsEnabled=!0),c.dirty&&(++i.lastDirtyTime,c.dirty=!1)}}}function SDe(e){let t=e._frameState;t.edgeVisibilityRequested=!1,e._groundPrimitives.update(t),e._primitives.update(t),t.edgeVisibilityRequested&&e._enableEdgeVisibility===!1&&(e._enableEdgeVisibility=!0),LRt(e),ORt(e),e._globe&&e._globe.render(t)}function FRt(e,t,n){let i=e._context,o=e._frameState,r=e._environmentState,a=e._view,s=o.passes,c=s.pick||s.pickVoxel;l(a.globeDepth)&&(a.globeDepth.picking=c);let u=r.useWebVR;r.originalFramebuffer=t.framebuffer,l(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!u?e._sunPostProcess=new j3: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 f=e._clearColorCommand;z.clone(n,f.color),f.execute(i,t);let h=r.useGlobeDepthFramebuffer=l(a.globeDepth);h&&(a.globeDepth.update(i,t,a.viewport,e.msaaSamples,e._hdr,r.clearGlobeDepth),a.globeDepth.clear(i,t,n));let p=a.oit,A=r.useOIT=!c&&l(p)&&p.isSupported();A&&(p.update(i,t,a.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),p.clear(i,t,n),r.useOIT=p.isSupported());let m=e.postProcessStages,_=r.usePostProcess=!c&&(e._hdr||m.length>0||m.ambientOcclusion.enabled||m.fxaa.enabled||m.bloom.enabled);r.usePostProcessSelected=!1,_&&(a.sceneFramebuffer.update(i,a.viewport,e._hdr,e.msaaSamples),a.sceneFramebuffer.clear(i,t,n),m.update(i,o.useLogDepth,e._hdr),m.clear(i),_=r.usePostProcess=m.ready,r.usePostProcessSelected=_&&m.hasSelected),r.isSunVisible&&e.sunBloom&&!u?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):h?t.framebuffer=a.globeDepth.framebuffer:_&&(t.framebuffer=a.sceneFramebuffer.framebuffer),l(t.framebuffer)&&f.execute(i,t);let y=r.useInvertClassification=!c&&l(t.framebuffer)&&e.invertClassification;if(!c&&e._enableEdgeVisibility&&a.edgeFramebuffer.update(i,a.viewport,e._hdr),y){let E;if(o.invertClassificationColor.alpha===1&&h&&(E=a.globeDepth.framebuffer),l(E)||i.depthTexture){if(e._invertClassification.previousFramebuffer=E,e._invertClassification.update(i,e.msaaSamples,a.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),o.invertClassificationColor.alpha<1&&A){let b=e._invertClassification.unclassifiedCommand,x=b.derivedCommands;x.oit=p.createDerivedCommands(b,i,x.oit)}}else r.useInvertClassification=!1}e._globeTranslucencyState.translucent&&a.globeTranslucencyFramebuffer.updateAndClear(e._hdr,a.viewport,i,t)}Ci.prototype.resolveFramebuffers=function(e){let t=this._context,n=this._environmentState,i=this._view,{globeDepth:o,translucentTileClassification:r}=i;l(o)&&o.prepareColorTextures(t);let{useOIT:a,useGlobeDepthFramebuffer:s,usePostProcess:c,originalFramebuffer:u}=n,f=s?o.colorFramebufferManager:void 0,h=i.sceneFramebuffer._colorFramebuffer,p=i.sceneFramebuffer.idFramebuffer;if(a&&(e.framebuffer=c?h.framebuffer:u,i.oit.execute(t,e)),r.hasTranslucentDepth&&r.isSupported()&&r.execute(this,e),c){i.sceneFramebuffer.prepareColorTextures(t);let A=h;s&&!a&&(A=f);let m=this.postProcessStages,_=A.getColorTexture(0),y=p.getColorTexture(0),C=(f??h).getDepthStencilTexture();m.execute(t,_,C,y),m.copy(t,u)}!a&&!c&&s&&(e.framebuffer=u,o.executeCopyColor(t,e))};function QRt(e){let t=e._frameState.afterRender,n=t.slice();t.length=0;for(let i=0;i<n.length;++i)n[i]()&&e.requestRender()}function kRt(e){if(e.mode===oe.MORPHING)return;let t=e.camera.positionCartographic;return e.getHeight(t)}function wDe(e,t,n){let i=Number.NEGATIVE_INFINITY;if(e instanceof ou){let o=e.length;for(let r=0;r<o;++r){let a=e.get(r),s=wDe(a,t,n);l(s)&&s>i&&(i=s)}}else if(e.isCesium3DTileset&&e.show&&e.enableCollision){let o=e.getHeight(t,n);if(l(o)&&o>i)return o}return i}Ci.prototype.getHeight=function(e,t){if(!l(e))return;let n=t===it.CLAMP_TO_TERRAIN||t===it.RELATIVE_TO_TERRAIN,i=t===it.CLAMP_TO_3D_TILE||t===it.RELATIVE_TO_3D_TILE;if(!l(e))return;let o=Number.NEGATIVE_INFINITY;if(!n){let a=wDe(this.primitives,e,this);l(a)&&a>o&&(o=a)}let r=this._globe;if(!i&&l(r)&&r.show){let a=r.getHeight(e);a>o&&(o=a)}if(o>Number.NEGATIVE_INFINITY)return o};var ane=new me;Ci.prototype.updateHeight=function(e,t,n){let i=this._ellipsoid,o=A=>{me.clone(e,ane);let m;l(A)&&(m=A.height),l(m)||(m=this.getHeight(e,n)),l(m)&&(ane.height=m,t(ane))},r=n===it.CLAMP_TO_TERRAIN||n===it.RELATIVE_TO_TERRAIN,a=n===it.CLAMP_TO_3D_TILE||n===it.RELATIVE_TO_3D_TILE,s;!a&&l(this.globe)&&(s=this.globe._surface.updateHeight(e,o));let c={},u=A=>{if(r||A.isDestroyed()||!A.isCesium3DTileset)return;let m=A.updateHeight(e,o,i);c[A.id]=m};if(!r){let A=this.primitives.length;for(let m=0;m<A;++m){let _=this.primitives.get(m);u(_)}}let f=this.primitives.primitiveAdded.addEventListener(u),h=this.primitives.primitiveRemoved.addEventListener(A=>{A.isDestroyed()||!A.isCesium3DTileset||(l(c[A.id])&&c[A.id](),delete c[A.id])});return()=>{s=s&&s(),Object.values(c).forEach(A=>A()),c={},f(),h()}};function URt(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}Ci.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=kRt(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=URt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function zRt(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 w_({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 GRt(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 VRt(e){e.primitives.postPassesUpdate(e._frameState),Gc.update()}var HRt=new z;function WRt(e){let t=e._frameState,n=e.context,{uniformState:i}=n,o=e._defaultView;e._view=o,e.updateFrameState(),t.passes.render=!0,t.passes.postProcess=e.postProcessStages.hasSelected,t.tilesetPassState=tRt;let r=e.backgroundColor??z.BLACK;e._hdr&&(r=z.clone(r,HRt),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 a=e.shadowMap;l(a)&&a.enabled&&(!l(e.light)||e.light instanceof NA?d.negate(i.sunDirectionWC,e._shadowMapCamera.direction):d.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(a)),e._computeCommandList.length=0,e._overlayCommandList.length=0;let s=o.viewport;s.x=0,s.y=0,s.width=n.drawingBufferWidth,s.height=n.drawingBufferHeight;let c=o.passState;c.framebuffer=void 0,c.blendingEnabled=void 0,c.scissorTest=void 0,c.viewport=et.clone(s,c.viewport),n.beginFrame(),l(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(c,r),e.resolveFramebuffers(c),c.framebuffer=void 0,bRt(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function WI(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function jRt(e){return e._picking.updateMostDetailedRayPicks(e)}Ci.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,l(e)||(e=X.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(X.secondsDifference(this._lastRenderTime,e));i=i||o>this.maximumRenderTimeChange}if(i){this._lastRenderTime=X.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let o=D.incrementWrap(t.frameNumber,15e6,1);bDe(this,o,e),t.newFrame=!0}WI(this,GRt),this.primitives.show&&(WI(this,jRt),WI(this,YRt),WI(this,qRt),i||WI(this,KRt)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),WI(this,WRt)),zRt(this,i),WI(this,VRt),QRt(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};Ci.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};Ci.prototype.requestRender=function(){this._renderRequested=!0};Ci.prototype.clampLineWidth=function(e){return Math.max(Rt.minimumAliasedLineWidth,Math.min(e,Rt.maximumAliasedLineWidth))};Ci.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n,1)[0]};Ci.prototype.pickAsync=async function(e,t,n){return(await this._picking.pickAsync(this,e,t,n,1))[0]};Ci.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!l(i))return;let o=i.primitive;if(!(o instanceof oE))return;let r=this._picking.pickVoxelCoordinate(this,e,t,n),a=255*r[0]+r[1],s=o._traversal.findKeyframeNode(a);if(!l(s))return;let c=255*r[2]+r[3];return K3.fromKeyframeNode(o,a,c,s)};Ci.prototype.pickMetadata=function(e,t,n,i){let o=this.pick(e);if(!l(o))return;let r=o.detail?.model?.structuralMetadata;if(!l(r))return;let a=r.schema,s=IU(a,t,n,i);if(!l(s))return;let c=TU(r,n,i);if(!l(c))return;let u=new xU(t,n,i,s,c);return this._picking.pickMetadata(this,e,u)};Ci.prototype.pickMetadataSchema=function(e){let t=this.pick(e);return l(t)?t.detail?.model?.structuralMetadata?.schema:void 0};Ci.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};Ci.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};Ci.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function YRt(e){let t=e._frameState;ine.camera=t.camera,ine.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,ine)}function qRt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;one.camera=e.preloadFlightCamera,one.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,one)}function KRt(e){e.primitives.updateForPass(e._frameState,nRt)}Ci.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};Ci.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};Ci.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};Ci.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};Ci.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};Ci.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};Ci.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};Ci.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};Ci.prototype.cartesianToCanvasCoordinates=function(e,t){return so.worldToWindowCoordinates(this,e,t)};Ci.prototype.completeMorph=function(){this._transitioner.completeMorph()};Ci.prototype.morphTo2D=function(e){e=e??2,this._transitioner.morphTo2D(e,this._ellipsoid)};Ci.prototype.morphToColumbusView=function(e){e=e??2,this._transitioner.morphToColumbusView(e,this._ellipsoid)};Ci.prototype.morphTo3D=function(e){e=e??2,this._transitioner.morphTo3D(e,this._ellipsoid)};function XRt(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()})}Ci.prototype.setTerrain=function(e){return XRt(this,e),e};Ci.prototype.isDestroyed=function(){return!1};Ci.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),fe(this)};var SU=Ci;function yB(e){e=e??te.WGS84,this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=d.multiplyByScalar(e.radii,t,new d);this._scaleMatrix=M.fromScale(n),this._modelMatrix=new M,this._command=new nt({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new d(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new d(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 d;let i=new d;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(yB.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});yB.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var cne=new M;yB.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=M.fromRotationTranslation(e.context.uniformState.inverseViewRotation,d.ZERO,cne),o=M.multiplyTransformation(i,ao.Y_UP_TO_Z_UP,cne),r=M.multiply(this._scaleMatrix,o,cne);M.clone(r,this._modelMatrix);let a=e.context,s=JRt(this),c=e.globeTranslucencyState.translucent,u=this.perFragmentAtmosphere||c||!l(t)||!t.show,f=this._command;if(!l(f.vertexArray)){let p=Hs.createGeometry(new Hs({radii:new d(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:ke.POSITION_ONLY}));f.vertexArray=Gn.fromGeometry({context:a,geometry:p,attributeLocations:Wn.createAttributeLocations(p),bufferUsage:Re.STATIC_DRAW}),f.renderState=Ve.fromCache({cull:{enabled:!0,face:Ni.FRONT},blending:sn.ALPHA_BLEND,depthMask:!1})}let h=s|u<<2|c<<3;if(h!==this._flags){this._flags=h;let p=[];s&&p.push("COLOR_CORRECT"),u&&p.push("PER_FRAGMENT_ATMOSPHERE"),c&&p.push("GLOBE_TRANSLUCENT");let A=new We({defines:p,sources:[Yh,iB,_k]}),m=new We({defines:p,sources:[Yh,iB,gk]});this._spSkyAtmosphere=$t.fromCache({context:a,vertexShaderSource:A,fragmentShaderSource:m}),f.shaderProgram=this._spSkyAtmosphere}return f};function JRt(e){return!(D.equalsEpsilon(e.hueShift,0,D.EPSILON7)&&D.equalsEpsilon(e.saturationShift,0,D.EPSILON7)&&D.equalsEpsilon(e.brightnessShift,0,D.EPSILON7))}yB.prototype.isDestroyed=function(){return!1};yB.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),fe(this)};var wU=yB;function BU(e){this.sources=e.sources,this._sources=void 0,this._transform=e.transform,this.show=e.show??!0,this._returnCommand=e.returnCommand??!1,this._addToPanoramaCommandList=!this._returnCommand,this._command=new nt({modelMatrix:M.clone(M.IDENTITY),owner:this,pass:Be.ENVIRONMENT}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0,this._hasError=!1,this._error=void 0;let t=e.credit;typeof t=="string"&&(t=new Et(t)),this._credit=t}Object.defineProperties(BU.prototype,{transform:{get:function(){return this._transform}},credit:{get:function(){return l(this._credit)?this._credit:void 0}}});BU.prototype.update=function(e,t){let n=this,{mode:i,passes:o,context:r,panoramaCommandList:a}=e;if(!this.show||i!==oe.SCENE3D&&i!==oe.MORPHING||!o.render)return;if(this._hasError){let c=this._error;throw this._hasError=!1,this._error=void 0,c}if(this._sources!==this.sources){this._sources=this.sources;let c=this.sources;typeof c.positiveX=="string"?cR(r,this._sources).then(function(u){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=u}).catch(u=>{this._hasError=!0,this._error=u}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new Kr({context:r,source:c})),this._addToPanoramaCommandList=!0}let s=this._command;if(!l(s.vertexArray)){s.uniformMap={u_cubeMap:function(){return n._cubeMap},u_cubeMapPanoramaTransform:function(){return n._transform}};let c=Ic.createGeometry(Ic.fromDimensions({dimensions:new d(2,2,2),vertexFormat:ke.POSITION_ONLY})),u=this._attributeLocations=Wn.createAttributeLocations(c);s.vertexArray=Gn.fromGeometry({context:r,geometry:c,attributeLocations:u,bufferUsage:Re.STATIC_DRAW}),s.renderState=Ve.fromCache({depthTest:{enabled:!1},depthMask:!1,blending:sn.ALPHA_BLEND}),this._addToPanoramaCommandList=!0}if(!l(s.shaderProgram)||this._useHdr!==t){let c=new We({defines:[t?"HDR":""],sources:[yk]});s.shaderProgram=$t.fromCache({context:r,vertexShaderSource:l(this._transform)?fk:Ck,fragmentShaderSource:c,attributeLocations:this._attributeLocations}),this._useHdr=t,this._addToPanoramaCommandList=!0}if(l(this._cubeMap)){if(this.show&&l(this._credit)&&!this._returnCommand&&e.creditDisplay.addCreditToNextFrame(this._credit),this._returnCommand)return s;this._addToPanoramaCommandList&&(a.push(s),this._addToPanoramaCommandList=!1)}};BU.prototype.isDestroyed=function(){return!1};BU.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(),fe(this)};var jI=BU;function YI(e){this._sources=e.sources,this._show=e.show??!0,this._panorama=new jI({sources:this._sources,show:this._show,returnCommand:!0})}Object.defineProperties(YI.prototype,{sources:{get:function(){return this._panorama.sources},set:function(e){this._panorama.sources=e}},show:{get:function(){return this._panorama.show},set:function(e){this._panorama.show=e}}});YI.prototype.update=function(e,t){let{mode:n,passes:i}=e;if(!(n!==oe.SCENE3D&&n!==oe.MORPHING)&&i.render)return this._panorama.update(e,t)};YI.prototype.isDestroyed=function(){return!1};YI.prototype.destroy=function(){return this._panorama=this._panorama&&this._panorama.destroy(),fe(this)};function CB(e){return Zt(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}YI.createEarthSkyBox=function(){return new YI({sources:{positiveX:CB("px"),negativeX:CB("mx"),positiveY:CB("py"),negativeY:CB("my"),positiveZ:CB("pz"),negativeZ:CB("mz")}})};var DU=YI;function PU(){this.show=!0,this._drawCommand=new nt({primitiveType:ve.TRIANGLES,boundingVolume:new le,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new le,this._boundingVolume2D=new le,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(PU.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var ZRt=new k,$Rt=new k,eMt=new ie,vU=new ie;PU.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,a=t.viewport.height;if(!l(this._texture)||r!==this._drawingBufferWidth||a!==this._drawingBufferHeight||this._glowFactorDirty||n!==this._useHdr){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=r,this._drawingBufferHeight=a,this._glowFactorDirty=!1,this._useHdr=n;let x=Math.max(r,a);x=Math.pow(2,Math.ceil(Math.log(x)/Math.log(2))-2),x=Math.max(1,x);let S=n?o.halfFloatingPointTexture?He.HALF_FLOAT:He.FLOAT:He.UNSIGNED_BYTE;this._texture=new Dt({context:o,width:x,height:x,pixelFormat:qe.RGBA,pixelDatatype:S}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let B=this,v={u_radiusTS:function(){return B._radiusTS}};this._commands.computeCommand=new xl({fragmentShaderSource:bk,outputTexture:this._texture,uniformMap:v,persists:!1,owner:this,postExecute:function(){B._commands.computeCommand=void 0}})}let s=this._drawCommand;if(!l(s.vertexArray)){let x={direction:0},S=new Uint8Array(8);S[0]=0,S[1]=0,S[2]=255,S[3]=0,S[4]=255,S[5]=255,S[6]=0,S[7]=255;let B=tt.createVertexBuffer({context:o,typedArray:S,usage:Re.STATIC_DRAW}),v=[{index:x.direction,vertexBuffer:B,componentsPerAttribute:2,normalize:!0,componentDatatype:j.UNSIGNED_BYTE}],P=tt.createIndexBuffer({context:o,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Re.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT});s.vertexArray=new Gn({context:o,attributes:v,indexBuffer:P}),s.shaderProgram=$t.fromCache({context:o,vertexShaderSource:Ik,fragmentShaderSource:Ek,attributeLocations:x}),s.renderState=Ve.fromCache({blending:sn.ALPHA_BLEND}),s.uniformMap=this._uniformMap}let c=o.uniformState.sunPositionWC,u=o.uniformState.sunPositionColumbusView,f=this._boundingVolume,h=this._boundingVolume2D;d.clone(c,f.center),h.center.x=u.z,h.center.y=u.x,h.center.z=u.y,f.radius=D.SOLAR_RADIUS+D.SOLAR_RADIUS*this._glowLengthTS,h.radius=f.radius,i===oe.SCENE3D?le.clone(f,s.boundingVolume):i===oe.COLUMBUS_VIEW&&le.clone(h,s.boundingVolume);let p=so.computeActualEllipsoidPosition(e,c,vU),A=d.magnitude(d.subtract(p,e.camera.position,vU)),m=o.uniformState.projection,_=eMt;_.x=0,_.y=0,_.z=-A,_.w=1;let y=M.multiplyByVector(m,_,vU),C=so.clipToGLWindowCoordinates(t.viewport,y,ZRt);_.x=D.SOLAR_RADIUS;let E=M.multiplyByVector(m,_,vU),b=so.clipToGLWindowCoordinates(t.viewport,E,$Rt);return this._size=k.magnitude(k.subtract(b,C,vU)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};PU.prototype.isDestroyed=function(){return!1};PU.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(),fe(this)};var RU=PU;var vDe=Wr(rG(),1);function tMt(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 MU=tMt;var nMt={modifyFragmentShader:function(t){return t=We.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}}},EB=nMt;var qI={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function NU(e){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=z.clone(z.DARKGRAY),this._highlightColor=z.clone(z.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=qI.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=e.opaquePass??Be.OPAQUE,this._cull=e.cull??!0,this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=M.clone(M.IDENTITY),this._modelMatrix=M.clone(M.IDENTITY),this.time=0,this.shadows=wn.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=e.splitDirection??Lr.NONE,this._splittingEnabled=!1,this._error=void 0,iMt(this,e)}Object.defineProperties(NU.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return z.clone(this._highlightColor)},set:function(e){this._highlightColor=z.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(l(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=le.clone(e,this._boundingSphere)}}});function iMt(e,t){let n=U0.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=Gh.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let s=n.draco;e._decodingState=qI.NEEDS_DECODE,s.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=z.clone(r.constantColor,e._constantColor),e._hasColors=!1),e._isRGB565=r.isRGB565);let a=n.batchIds;l(n.batchIds)&&(a.name="BATCH_ID",a.semantic="BATCH_ID",a.setIndex=void 0),n.hasBatchIds&&e._batchTableLoaded(n.batchLength,n.batchTableJson,n.batchTableBinary),e._pointsLength=n.pointsLength}var oMt=new d,rMt=new d,aMt=new d,BDe,N5;function sMt(e){if(!l(N5)){BDe=new vDe.default(0),N5=new Array(e);for(let t=0;t<e;++t)N5[t]=BDe.random()}return N5}function cMt(e){let n=e.length/3,i=Math.min(n,20),o=sMt(20),r=Number.MAX_VALUE,a=-Number.MAX_VALUE,s=d.fromElements(r,r,r,oMt),c=d.fromElements(a,a,a,rMt);for(let f=0;f<i;++f){let h=Math.floor(o[f]*n),p=d.unpack(e,h*3,aMt);d.minimumByComponent(s,p,s),d.maximumByComponent(c,p,c)}let u=le.fromCornerPoints(s,c);return u.radius+=D.EPSILON2,u}function DDe(e,t){let n=j.fromTypedArray(e);return n===j.INT||n===j.UNSIGNED_INT||n===j.DOUBLE?(It("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 lMt=new ie,uMt=new ie,fMt=new z,PDe=0,L5=1,hne=2,RDe=3,dMt=4,lne=new M,hMt=new M;function mMt(e,t){let n=t.context,i=e._parsedContent,o=e._pointsLength,r=i.positions,a=i.colors,s=i.normals,c=i.batchIds,u=i.styleableProperties,f=l(u),h=e._isQuantized,p=e._isQuantizedDraco,A=e._isOctEncoded16P,m=e._isOctEncodedDraco,_=e._quantizedRange,y=e._octEncodedRange,C=e._isRGB565,E=e._isTranslucent,b=e._hasColors,x=e._hasNormals,S=e._hasBatchIds,B,v,P=[],N={};if(e._styleableShaderAttributes=N,f){let F=dMt;for(let U in u)if(u.hasOwnProperty(U)){let Q=u[U],H=DDe(Q.typedArray,U);B=Q.componentCount,v=j.fromTypedArray(H);let Y=tt.createVertexBuffer({context:n,typedArray:H,usage:Re.STATIC_DRAW});e._geometryByteLength+=Y.sizeInBytes;let $={index:F,vertexBuffer:Y,componentsPerAttribute:B,componentDatatype:v,normalize:!1,offsetInBytes:0,strideInBytes:0};P.push($),N[U]={location:F,componentCount:B},++F}}let L=tt.createVertexBuffer({context:n,typedArray:r.typedArray,usage:Re.STATIC_DRAW});e._geometryByteLength+=L.sizeInBytes;let g;b&&(g=tt.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Re.STATIC_DRAW}),e._geometryByteLength+=g.sizeInBytes);let I;x&&(I=tt.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Re.STATIC_DRAW}),e._geometryByteLength+=I.sizeInBytes);let T;S&&(c.typedArray=DDe(c.typedArray,"batchIds"),T=tt.createVertexBuffer({context:n,typedArray:c.typedArray,usage:Re.STATIC_DRAW}),e._geometryByteLength+=T.sizeInBytes);let w=[];if(h?v=j.UNSIGNED_SHORT:p?v=_<=255?j.UNSIGNED_BYTE:j.UNSIGNED_SHORT:v=j.FLOAT,w.push({index:PDe,vertexBuffer:L,componentsPerAttribute:3,componentDatatype:v,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(h||p?e._boundingSphere=le.fromCornerPoints(d.ZERO,e._quantizedVolumeScale):e._boundingSphere=cMt(r.typedArray)),b)if(C)w.push({index:L5,vertexBuffer:g,componentsPerAttribute:1,componentDatatype:j.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let F=E?4:3;w.push({index:L5,vertexBuffer:g,componentsPerAttribute:F,componentDatatype:j.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}x&&(A?(B=2,v=j.UNSIGNED_BYTE):m?(B=2,v=y<=255?j.UNSIGNED_BYTE:j.UNSIGNED_SHORT):(B=3,v=j.FLOAT),w.push({index:hne,vertexBuffer:I,componentsPerAttribute:B,componentDatatype:v,normalize:!1,offsetInBytes:0,strideInBytes:0})),S&&w.push({index:RDe,vertexBuffer:T,componentsPerAttribute:1,componentDatatype:j.fromTypedArray(c.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),f&&(w=w.concat(P));let R=new Gn({context:n,attributes:w}),O={depthTest:{enabled:!0}},G={depthTest:{enabled:!0},depthMask:!1,blending:sn.ALPHA_BLEND};e._opaquePass===Be.CESIUM_3D_TILE&&(O.stencilTest=Yt.setCesium3DTileBit(),O.stencilMask=Yt.CESIUM_3D_TILE_MASK,G.stencilTest=Yt.setCesium3DTileBit(),G.stencilMask=Yt.CESIUM_3D_TILE_MASK),e._opaqueRenderState=Ve.fromCache(O),e._translucentRenderState=Ve.fromCache(G),e._drawCommand=new nt({boundingVolume:new le,cull:e._cull,modelMatrix:new M,primitiveType:ve.POINTS,vertexArray:R,count:o,shaderProgram:void 0,uniformMap:void 0,renderState:E?e._translucentRenderState:e._opaqueRenderState,pass:E?Be.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function pMt(e,t){let n=t.context,i=e._isQuantized,o=e._isQuantizedDraco,r=e._isOctEncodedDraco,a={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let s=lMt;if(s.x=e._attenuation?e.maximumAttenuation:e._pointSize,s.x*=t.pixelRatio,s.y=e.time,e._attenuation){let c=t.camera.frustum,u;t.mode===oe.SCENE2D||c instanceof An?u=Number.POSITIVE_INFINITY:u=n.drawingBufferHeight/t.camera.frustum.sseDenominator,s.z=e.geometricError*e.geometricErrorScale,s.w=u}return s},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor},u_clippingPlanes:function(){let s=e.clippingPlanes;return e.isClipped?s.texture:n.defaultTexture},u_clippingPlanesEdgeStyle:function(){let s=e.clippingPlanes;if(!l(s))return z.TRANSPARENT;let c=z.clone(s.edgeColor,fMt);return c.alpha=s.edgeWidth,c},u_clippingPlanesMatrix:function(){let s=e.clippingPlanes;if(!l(s))return M.IDENTITY;let c=e.clippingPlanesOriginMatrix??e._modelMatrix;M.multiply(n.uniformState.view3D,c,lne);let u=M.multiply(lne,s.modelMatrix,lne);return M.inverseTranspose(u,hMt)}};EB.addUniforms(e,a),(i||o||r)&&(a=Pt(a,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let s=uMt;if(l(e._quantizedVolumeScale)){let c=d.clone(e._quantizedVolumeScale,s);d.divideByScalar(c,e._quantizedRange,s)}return s.w=e._octEncodedRange,s}})),l(e._uniformMapLoaded)&&(a=e._uniformMapLoaded(a)),e._drawCommand.uniformMap=a}function une(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 fne(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 dne(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 AMt={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 gMt(e,t,n){let i,o,r,a=t.context,s=l(n),c=e._isQuantized,u=e._isQuantizedDraco,f=e._isOctEncoded16P,h=e._isOctEncodedDraco,p=e._isRGB565,A=e._isTranslucent,m=e._hasColors,_=e._hasNormals,y=e._hasBatchIds,C=e._backFaceCulling,E=e._normalShading,b=e._drawCommand.vertexArray,x=e.clippingPlanes,S=e._attenuation,B,v,P,N=A,L=je(AMt),g={},I=e._styleableShaderAttributes;for(o in I)I.hasOwnProperty(o)&&(r=I[o],L[o]=`czm_3dtiles_property_${r.location}`,g[r.location]=r);if(s){let re={translucent:!1},ye="(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)";B=n.getColorShaderFunction(`getColorFromStyle${ye}`,L,re),v=n.getShowShaderFunction(`getShowFromStyle${ye}`,L,re),P=n.getPointSizeShaderFunction(`getPointSizeFromStyle${ye}`,L,re),l(B)&&re.translucent&&(N=!0)}e._styleTranslucent=N;let T=l(B),w=l(v),R=l(P),O=e.isClipped,G=[],F=[];T&&(une(B,G),fne(B,F)),w&&(une(v,G),fne(v,F)),R&&(une(P,G),fne(P,F));let U=F.indexOf("COLOR")>=0,Q=F.indexOf("NORMAL")>=0;if(Q&&!_)throw new ue("Style references the NORMAL semantic but the point cloud does not have normals");for(o in I)if(I.hasOwnProperty(o)){r=I[o];let re=G.indexOf(r.location)>=0,ye=dne(b,r.location);ye.enabled=re}let H=m&&(!T||U);if(m){let re=dne(b,L5);re.enabled=H}let Y=_&&(E||C||Q);if(_){let re=dne(b,hne);re.enabled=Y}let $={a_position:PDe};H&&($.a_color=L5),Y&&($.a_normal=hne),y&&($.a_batchId=RDe);let W="",K=G.length;for(i=0;i<K;++i){let re=G[i];r=g[re];let ye=r.componentCount,Ce=`czm_3dtiles_property_${re}`,Pe;ye===1?Pe="float":Pe=`vec${ye}`,W+=`in ${Pe} ${Ce};
`,$[Ce]=r.location}pMt(e,t);let Z=`in vec3 a_position;
out vec4 v_color;
uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier;
uniform vec4 u_constantColor;
uniform vec4 u_highlightColor;
`;Z+=`float u_pointSize;
float tiles3d_tileset_time;
`,S&&(Z+=`float u_geometricError;
float u_depthMultiplier;
`),Z+=W,H&&(A?Z+=`in vec4 a_color;
`:p?Z+=`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;
`:Z+=`in vec3 a_color;
`),Y&&(f||h?Z+=`in vec2 a_normal;
`:Z+=`in vec3 a_normal;
`),y&&(Z+=`in float a_batchId;
`),(c||u||h)&&(Z+=`uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange;
`),T&&(Z+=B),w&&(Z+=v),R&&(Z+=P),Z+=`void main()
{
u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x;
tiles3d_tileset_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y;
`,S&&(Z+=` u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z;
u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w;
`),H?A?Z+=` vec4 color = a_color;
`:p?Z+=` 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);
`:Z+=` vec4 color = vec4(a_color, 1.0);
`:Z+=` vec4 color = u_constantColor;
`,c||u?Z+=` vec3 position = a_position * u_quantizedVolumeScaleAndOctEncodedRange.xyz;
`:Z+=` vec3 position = a_position;
`,Z+=` vec3 position_absolute = vec3(czm_model * vec4(position, 1.0));
`,Y?(f?Z+=` vec3 normal = czm_octDecode(a_normal);
`:h?Z+=` vec3 normal = czm_octDecode(a_normal, u_quantizedVolumeScaleAndOctEncodedRange.w).zxy;
`:Z+=` vec3 normal = a_normal;
`,Z+=` vec3 normalEC = czm_normal * normal;
`):Z+=` vec3 normal = vec3(1.0);
`,T&&(Z+=` color = getColorFromStyle(position, position_absolute, color, normal);
`),w&&(Z+=` float show = float(getShowFromStyle(position, position_absolute, color, normal));
`),R?Z+=` gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal) * czm_pixelRatio;
`:S?Z+=` vec4 positionEC = czm_modelView * vec4(position, 1.0);
float depth = -positionEC.z;
gl_PointSize = min((u_geometricError / depth) * u_depthMultiplier, u_pointSize);
`:Z+=` gl_PointSize = u_pointSize;
`,Z+=` color = color * u_highlightColor;
`,Y&&E&&(Z+=` float diffuseStrength = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC);
diffuseStrength = max(diffuseStrength, 0.4);
color.xyz *= diffuseStrength * czm_lightColor;
`),Z+=` v_color = color;
gl_Position = czm_modelViewProjection * vec4(position, 1.0);
`,Y&&C&&(Z+=` float visible = step(-normalEC.z, 0.0);
gl_Position *= visible;
gl_PointSize *= visible;
`),w&&(Z+=` gl_Position.w *= float(show);
gl_PointSize *= float(show);
`),Z+=`}
`;let pe=`in vec4 v_color;
`;O&&(pe+=`uniform highp sampler2D u_clippingPlanes;
uniform mat4 u_clippingPlanesMatrix;
uniform vec4 u_clippingPlanesEdgeStyle;
`,pe+=`
`,pe+=_I(x,a),pe+=`
`),pe+=`void main()
{
out_FragColor = czm_gammaCorrect(v_color);
`,O&&(pe+=MU("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),pe+=`}
`,e.splitDirection!==Lr.NONE&&(pe=EB.modifyFragmentShader(pe)),l(e._vertexShaderLoaded)&&(Z=e._vertexShaderLoaded(Z)),l(e._fragmentShaderLoaded)&&(pe=e._fragmentShaderLoaded(pe));let ge=e._drawCommand;l(ge.shaderProgram)&&ge.shaderProgram.destroy(),ge.shaderProgram=$t.fromCache({context:a,vertexShaderSource:Z,fragmentShaderSource:pe,attributeLocations:$});try{ge.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 _Mt(e,t){if(e._decodingState===qI.READY)return!1;if(e._decodingState===qI.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,o=ig.decodePointCloud(i,t);l(o)&&(e._decodingState=qI.DECODING,o.then(function(r){e._decodingState=qI.READY;let a=l(r.POSITION)?r.POSITION.array:void 0,s=l(r.RGB)?r.RGB.array:void 0,c=l(r.RGBA)?r.RGBA.array:void 0,u=l(r.NORMAL)?r.NORMAL.array:void 0,f=l(r.BATCH_ID)?r.BATCH_ID.array:void 0,h=l(a)&&l(r.POSITION.data.quantization),p=l(u)&&l(r.NORMAL.data.quantization);if(h){let y=r.POSITION.data.quantization,C=y.range;e._quantizedVolumeScale=d.fromElements(C,C,C),e._quantizedVolumeOffset=d.unpack(y.minValues),e._quantizedRange=(1<<y.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<r.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let A=n.styleableProperties,m=i.batchTableProperties;for(let y in m)if(m.hasOwnProperty(y)){let C=r[y];l(A)||(A={}),A[y]={typedArray:C.array,componentCount:C.data.componentsPerAttribute}}l(a)&&(n.positions={typedArray:a});let _=c??s;l(_)&&(n.colors={typedArray:_}),l(u)&&(n.normals={typedArray:u}),l(f)&&(n.batchIds={typedArray:f}),n.styleableProperties=A}).catch(function(r){e._decodingState=qI.FAILED,e._error=r}))}return!0}var yMt=new ie,CMt=new d;NU.prototype.update=function(e){let t=e.context;if(l(this._error)){let u=this._error;throw this._error=void 0,u}if(_Mt(this,t))return;let i=!1,o=!M.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,o=!0),l(this._drawCommand)||(mMt(this,e),o=!0,i=!0,this._ready=!0,this._parsedContent=void 0),o){M.clone(this.modelMatrix,this._modelMatrix);let u=this._drawCommand.modelMatrix;if(M.clone(this._modelMatrix,u),l(this._rtcCenter)&&M.multiplyByTranslation(u,this._rtcCenter,u),l(this._quantizedVolumeOffset)&&M.multiplyByTranslation(u,this._quantizedVolumeOffset,u),e.mode!==oe.SCENE3D){let h=e.mapProjection,p=M.getColumn(u,3,yMt);ie.equals(p,ie.UNIT_W)||At.basisTo2D(h,u,u)}let f=this._drawCommand.boundingVolume;if(le.clone(this._boundingSphere,f),this._cull){let h=f.center;M.multiplyByPoint(u,h,h);let p=M.getScale(u,CMt);f.radius*=d.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!==Lr.NONE;this._splittingEnabled!==r&&(this._splittingEnabled=r,i=!0),i&&gMt(this,e,this._style),this._drawCommand.castShadows=wn.castShadows(this.shadows),this._drawCommand.receiveShadows=wn.receiveShadows(this.shadows);let a=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent;this._drawCommand.renderState=a?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=a?Be.TRANSLUCENT:this._opaquePass;let s=e.commandList,c=e.passes;(c.render||c.pick)&&s.push(this._drawCommand)};NU.prototype.isDestroyed=function(){return!1};NU.prototype.destroy=function(){let e=this._drawCommand;return l(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),fe(this)};var LU=NU;function XI(e){e=e??V.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this.shadows=e.shadows??wn.ENABLED,this.maximumMemoryUsage=e.maximumMemoryUsage??256,this.shading=new Ep(e.shading),this.style=e.style,this.frameFailed=new _e,this.frameChanged=new _e,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new hg,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(XI.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){da.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function EMt(e){return`uniform vec4 czm_pickColor;
${e}`}function bMt(e){return function(t){return Pt(t,{czm_pickColor:function(){return e._pickId.color}})}}function IMt(){return"czm_pickColor"}XI.prototype.makeStyleDirty=function(){this._styleDirty=!0};XI.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var xMt=new X;function pne(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function KI(e,t){return e._intervals.indexOf(t.start)}function TMt(e,t){let n=e._intervals,i=e._clock,o=pne(e);if(o===0)return;let r=e._getAverageLoadTime(),a=X.addSeconds(i.currentTime,r*o,xMt),s=n.indexOf(a),c=KI(e,t);return s===c&&(o>=0?++s:--s),n.get(s)}function SMt(e){let t=e._intervals,i=e._clock.currentTime,o=t.indexOf(i);return t.get(o)}function wMt(e,t,n){let i=pne(e),o=KI(e,t),r=KI(e,n);return i>=0?o>=r:o<=r}function NDe(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 BMt(e,t,n){let i=KI(e,t),o=e._frames,r=o[i];if(!l(r)){let a=t.data.transform,s=l(a)?M.fromArray(a):void 0,c=t.data.uri;r={pointCloud:void 0,transform:s,timestamp:Fi(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:c},o[i]=r,De.fetchArrayBuffer({url:c}).then(function(u){r.pointCloud=new LU({arrayBuffer:u,cull:!0,fragmentShaderLoaded:EMt,uniformMapLoaded:bMt(e),pickIdLoaded:IMt})}).catch(NDe(e,c))}return r}function DMt(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 vMt(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,a=r.length;if(LDe(e,t,n,i),o.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=o.geometryByteLength,r.length=a,t.sequential)){let s=(Fi()-t.timestamp)/1e3;DMt(e,s)}}t.touchedFrameNumber=i.frameNumber}var PMt=new M;function RMt(e,t){let n=e.shading;return l(n)&&l(n.baseResolution)?n.baseResolution:l(t.boundingSphere)?D.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function MMt(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var NMt=new Ep;function LDe(e,t,n,i){let o=e.shading??NMt,r=t.pointCloud,a=t.transform??M.IDENTITY;r.modelMatrix=M.multiplyTransformation(e.modelMatrix,a,PMt),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=RMt(e,r),r.geometricErrorScale=o.geometricErrorScale,r.maximumAttenuation=MMt(e);try{r.update(i)}catch(s){NDe(e,t.uri)(s)}t.touchedFrameNumber=i.frameNumber}function mne(e,t,n,i){let o=BMt(e,t,i);vMt(e,o,n,i)}function LMt(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function ODe(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 a=r.pointCloud;r.ready&&(e._totalMemoryUsageInBytes-=a.geometryByteLength),l(a)&&a.destroy(),r===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),n[o]=void 0}}}function OMt(e,t){let n=KI(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function MDe(e,t,n,i,o){return l(n)?n.ready?!0:(mne(e,t,i,o),n.ready):!1}function FMt(e,t,n,i,o){let r,a,s,c=e._intervals,u=e._frames,f=KI(e,n),h=KI(e,t);if(f>=h){for(r=f;r>=h;--r)if(a=c.get(r),s=u[r],MDe(e,a,s,i,o))return a}else for(r=f;r<=h;++r)if(a=c.get(r),s=u[r],MDe(e,a,s,i,o))return a;return t}function QMt(e,t,n){let i=e._frames,o=i.length;for(let r=0;r<o;++r){let a=i[r];l(a)&&l(a.pointCloud)&&(a.pointCloud.clippingPlanesDirty=t,a.pointCloud.styleDirty=n)}}var bB={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};XI.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=X.clone(e.time));let t=Math.max(X.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 a=this._styleDirty;this._styleDirty=!1,(o||a)&&QMt(this,o,a),bB.timeSinceLoad=t,bB.isClipped=r;let s=this.shading,c=this._pointCloudEyeDomeLighting,u=e.commandList,f=u.length,h=this._previousInterval,p=this._nextInterval,A=SMt(this);if(!l(A))return;let m=!1,_=pne(this),y=_===0;_!==this._clockMultiplier&&(m=!0,this._clockMultiplier=_),(!l(h)||y)&&(h=A),(!l(p)||m||wMt(this,A,p))&&(p=TMt(this,A)),h=FMt(this,h,A,bB,e);let C=OMt(this,h);l(C)||(mne(this,h,bB,e),C=this._lastRenderedFrame),l(C)&&LDe(this,C,bB,e),l(p)&&mne(this,p,bB,e);let E=this;l(C)&&!l(this._lastRenderedFrame)&&e.afterRender.push(function(){return!0}),l(C)&&C!==this._lastRenderedFrame&&E.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return E.frameChanged.raiseEvent(E),!0}),this._previousInterval=h,this._nextInterval=p,this._lastRenderedFrame=C;let b=this._totalMemoryUsageInBytes,x=this.maximumMemoryUsage*1024*1024;b>x&&ODe(this,LMt(e));let B=u.length-f;l(s)&&s.attenuation&&s.eyeDomeLighting&&B>0&&c.update(e,f,s,this.boundingSphere)};XI.prototype.isDestroyed=function(){return!1};XI.prototype.destroy=function(){return ODe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),fe(this)};var IB=XI;function kDe(e,t){if(l(t)){let n=t.clock;l(n)&&n.getValue(e)}}function kMt(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,a=i-t;a>r&&(e.resize(),e.render(),t=i-a%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 UDe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function zDe(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,o=UDe(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 GDe(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 ir(e,t){e=kn(e),t=t??V.EMPTY_OBJECT;let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),o=fn.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=o,o&&(i.style.imageRendering=fn.imageRenderingValue()),i.oncontextmenu=function(){return!1},i.onselectstart=function(){return!1};function r(){i!==i.ownerDocument.activeElement&&i.ownerDocument.activeElement.blur()}(t.blurActiveElementOnCanvasFocus??!0)&&(i.addEventListener("mousedown",r),i.addEventListener("pointerdown",r)),n.appendChild(i);let s=document.createElement("div");s.className="cesium-widget-credits";let c=l(t.creditContainer)?kn(t.creditContainer):n;c.appendChild(s);let u=l(t.creditViewport)?kn(t.creditViewport):n,f=t.showRenderLoopErrors??!0,h=t.useBrowserRecommendedResolution??!0;this._element=n,this._container=e,this._canvas=i,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=u,this._creditContainer=c,this._innerCreditContainer=s,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=f,this._resolutionScale=1,this._useBrowserRecommendedResolution=h,this._forceResize=!1,this._entityView=void 0,this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._trackedEntityChanged=new _e,this._allowDataSourcesToSuspendAnimation=!0,this._clock=l(t.clock)?t.clock:new _m,l(t.shouldAnimate)&&(this._clock.shouldAnimate=t.shouldAnimate),zDe(this);try{let p=t.ellipsoid??te.default,A=new SU({canvas:i,contextOptions:t.contextOptions,creditContainer:s,creditViewport:u,ellipsoid:p,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:t.scene3DOnly??!1,shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples});this._scene=A,A.camera.constrainedAxis=d.UNIT_Z,UDe(this),GDe(this);let m=t.globe;l(m)||(m=new Ok(p)),m!==!1&&(A.globe=m,A.globe.shadows=t.terrainShadows??wn.RECEIVE_ONLY);let _=t.skyBox;!l(_)&&te.WGS84.equals(p)&&(_=DU.createEarthSkyBox()),_!==!1&&(A.skyBox=_,A.sun=new RU,te.WGS84.equals(p)&&(A.moon=new kk));let y=t.skyAtmosphere;!l(y)&&te.WGS84.equals(p)&&(y=new wU(p),y.show=t.globe!==!1&&m.show),y!==!1&&(A.skyAtmosphere=y);let C=t.baseLayer;t.globe!==!1&&C!==!1&&(l(C)||(C=ga.fromWorldImagery()),A.imageryLayers.add(C)),l(t.terrainProvider)&&t.globe!==!1&&(A.terrainProvider=t.terrainProvider),l(t.terrain)&&t.globe!==!1&&A.setTerrain(t.terrain),this._screenSpaceEventHandler=new qf(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=t.useDefaultRenderLoop??!0,this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let E=this;this._onRenderError=function(P,N){E._useDefaultRenderLoop=!1,E._renderLoopRunning=!1,E._showRenderLoopErrors&&E.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,N)},A.renderError.addEventListener(this._onRenderError);let b=t.dataSources,x=!1;l(b)||(b=new $F,x=!0);let S=new GQ({scene:A,dataSourceCollection:b}),B=new kr;this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=t.automaticallyTrackDataSourceClocks??!0,this._dataSourceCollection=b,this._destroyDataSourceCollection=x,this._dataSourceDisplay=S,this._eventHelper=B,this._canAnimateUpdateCallback=this._updateCanAnimate,B.add(this._clock.onTick,ir.prototype._onTick,this),B.add(A.morphStart,ir.prototype._clearTrackedObject,this),B.add(b.dataSourceAdded,ir.prototype._onDataSourceAdded,this),B.add(b.dataSourceRemoved,ir.prototype._onDataSourceRemoved,this),B.add(A.postRender,ir.prototype._postRender,this);let v=b.length;for(let P=0;P<v;P++)this._dataSourceAdded(b,b.get(P));this._dataSourceAdded(void 0,S.defaultDataSource),B.add(b.dataSourceAdded,ir.prototype._dataSourceAdded,this),B.add(b.dataSourceRemoved,ir.prototype._dataSourceRemoved,this)}catch(p){throw f&&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(ir.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}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},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&&kMt(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)}},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,Ane(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(M.IDENTITY)):this._needTrackedEntityUpdate=!0,this._trackedEntityChanged.raiseEvent(e),this.scene.requestRender()}}},trackedEntityChanged:{get:function(){return this._trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,kDe(this.clock,e))}}});ir.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 a=document.createElement("div");a.className="cesium-widget-errorPanel-header",a.appendChild(document.createTextNode(e)),r.appendChild(a);let s=document.createElement("div");s.className="cesium-widget-errorPanel-scroll",r.appendChild(s);function c(){s.style.maxHeight=`${Math.max(Math.round(i.clientHeight*.9-100),30)}px`}c(),l(window.addEventListener)&&window.addEventListener("resize",c,!1);let u=l(t),f=l(n);if(u||f){let A=document.createElement("div");if(A.className="cesium-widget-errorPanel-message",s.appendChild(A),f){let m=Ip(n);u||(typeof n=="string"&&(n=new Error(n)),t=Ip({name:n.name,message:n.message}),m=n.stack),typeof console<"u"&&console.error(`${e}
${t}
${m}`);let _=document.createElement("div");_.className="cesium-widget-errorPanel-message-details collapsed";let y=document.createElement("span");y.className="cesium-widget-errorPanel-more-details",y.appendChild(document.createTextNode("See more...")),_.appendChild(y),_.onclick=function(C){_.removeChild(y),_.appendChild(document.createTextNode(m)),_.className="cesium-widget-errorPanel-message-details",r.className="cesium-widget-errorPanel-content expanded",_.onclick=void 0},s.appendChild(_)}A.innerHTML=`<p>${t}</p>`}let h=document.createElement("div");h.className="cesium-widget-errorPanel-buttonPanel",r.appendChild(h);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)},h.appendChild(p),i.appendChild(o)};ir.prototype.isDestroyed=function(){return!1};ir.prototype.destroy=function(){let e=this.dataSources,t=e.length;for(let n=0;n<t;n++)this._dataSourceRemoved(e,e.get(n));this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),l(this._scene)&&(this._scene.renderError.removeEventListener(this._onRenderError),this._scene=this._scene.destroy()),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),this._eventHelper.removeAll(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),fe(this)};ir.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,zDe(this),GDe(this),this._scene.requestRender())};ir.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};ir.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(ir.prototype._onEntityCollectionChanged,this)};ir.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(ir.prototype._onEntityCollectionChanged,this),l(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0)};ir.prototype._updateCanAnimate=function(e){this._clock.canAnimate=e};var UMt=new le;ir.prototype._onTick=function(e){let t=e.currentTime,n=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&this._canAnimateUpdateCallback(n);let i=this._entityView;if(l(i)){let o=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(o,!1,i.boundingSphere??UMt)===Ct.DONE&&i.update(t)}};ir.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)}};ir.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};ir.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&kDe(this.clock,e)};ir.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,ir.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};ir.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}};ir.prototype.zoomTo=function(e,t){return VDe(this,e,{offset:t},!1)};ir.prototype.flyTo=function(e,t){return VDe(this,e,t,!0)};function VDe(e,t,n,i){Ane(e);let o=new Promise(r=>{e._completeZoom=function(a){r(a)}});return e._zoomPromise=o,e._zoomIsFlight=i,e._zoomOptions=n,Promise.resolve(t).then(function(r){if(e._zoomPromise===o){if(r instanceof ga){let a;l(r.imageryProvider)?a=Promise.resolve(r.getImageryRectangle()):a=new Promise(s=>{let c=r.readyEvent.addEventListener(()=>{c(),s(r.getImageryRectangle())})}),a.then(function(s){return gI(s,e.scene)}).then(function(s){e._zoomPromise===o&&(e._zoomTarget=s)});return}if(r instanceof es||r instanceof IB||r instanceof oE||r instanceof Za){e._zoomTarget=r;return}if(r.isLoading&&l(r.loadingEvent)){let a=r.loadingEvent.addEventListener(function(){a(),e._zoomPromise===o&&(e._zoomTarget=r.entities.values.slice(0))});return}if(Array.isArray(r)){e._zoomTarget=r.slice(0);return}r=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 OU(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function Ane(e){let t=e._zoomPromise;l(t)&&(OU(e),e._completeZoom(!1))}ir.prototype._postRender=function(){zMt(this),GMt(this)};var FDe=new le;function zMt(e){let t=e._zoomTarget;if(!l(t)||e.scene.mode===oe.MORPHING)return;let n=e.scene,i=n.camera,o=e._zoomOptions??{},r;function a(f){l(o.offset)||(o.offset=new th(0,-.5,f.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(f,r):(i.viewBoundingSphere(f,o.offset),i.lookAtTransform(M.IDENTITY),e._completeZoom(!0)),OU(e)}if(t instanceof IB){if(l(t.boundingSphere)){a(t.boundingSphere);return}let f=t.frameChanged.addEventListener(function(h){a(h.boundingSphere),f()});return}if(t instanceof es||t instanceof oE){a(t.boundingSphere);return}if(t instanceof Za){a(t.boundingVolume);return}if(t instanceof me){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)),OU(e);return}let s=t,c=[];for(let f=0,h=s.length;f<h;f++){let p=e._dataSourceDisplay.getBoundingSphere(s[f],!1,FDe);if(p===Ct.PENDING)return;p!==Ct.FAILED&&c.push(le.clone(FDe))}if(c.length===0){Ane(e);return}e.trackedEntity=void 0;let u=le.fromBoundingSpheres(c);e._zoomIsFlight?(OU(e),i.flyToBoundingSphere(u,{duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:o.offset})):(i.viewBoundingSphere(u,o.offset),i.lookAtTransform(M.IDENTITY),OU(e),e._completeZoom(!0))}var QDe=new le;function GMt(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=q.getValueOrUndefined(t.position,n);if(!l(i))return;let o=e.scene,r=e._dataSourceDisplay.getBoundingSphere(t,!1,QDe);if(r===Ct.PENDING)return;let a=o.mode;(a===oe.COLUMBUS_VIEW||a===oe.SCENE2D)&&(o.screenSpaceCameraController.enableTranslate=!1),(a===oe.COLUMBUS_VIEW||a===oe.SCENE3D)&&(o.screenSpaceCameraController.enableTilt=!1);let s=r!==Ct.FAILED?QDe:void 0;e._entityView=new HQ(t,o,o.ellipsoid),e._entityView.update(n,s),e._needTrackedEntityUpdate=!1}var FU=ir;var VMt=new d(1,1,1);function gne(e){e=e??VMt,this._dimensions=d.clone(e)}Object.defineProperties(gne.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){d.clone(e,this._dimensions)}}});var HMt=new d;gne.prototype.emit=function(e){let t=this._dimensions,n=d.multiplyByScalar(t,.5,HMt),i=D.randomBetween(-n.x,n.x),o=D.randomBetween(-n.y,n.y),r=D.randomBetween(-n.z,n.z);e.position=d.fromElements(i,o,r,e.position),e.velocity=d.normalize(e.position,e.velocity)};var _ne=gne;function gA(){this.featurePropertiesDirty=!1}Object.defineProperties(gA.prototype,{featuresLength:{get:function(){de.throwInstantiationError()}},pointsLength:{get:function(){de.throwInstantiationError()}},trianglesLength:{get:function(){de.throwInstantiationError()}},geometryByteLength:{get:function(){de.throwInstantiationError()}},texturesByteLength:{get:function(){de.throwInstantiationError()}},batchTableByteLength:{get:function(){de.throwInstantiationError()}},innerContents:{get:function(){de.throwInstantiationError()}},ready:{get:function(){de.throwInstantiationError()}},tileset:{get:function(){de.throwInstantiationError()}},tile:{get:function(){de.throwInstantiationError()}},url:{get:function(){de.throwInstantiationError()}},batchTable:{get:function(){de.throwInstantiationError()}},metadata:{get:function(){de.throwInstantiationError()},set:function(e){de.throwInstantiationError()}},group:{get:function(){de.throwInstantiationError()},set:function(e){de.throwInstantiationError()}}});gA.prototype.hasProperty=function(e,t){de.throwInstantiationError()};gA.prototype.getFeature=function(e){de.throwInstantiationError()};gA.prototype.applyDebugSettings=function(e,t){de.throwInstantiationError()};gA.prototype.applyStyle=function(e){de.throwInstantiationError()};gA.prototype.update=function(e,t){de.throwInstantiationError()};gA.prototype.pick=function(e,t,n){de.throwInstantiationError()};gA.prototype.isDestroyed=function(){de.throwInstantiationError()};gA.prototype.destroy=function(){de.throwInstantiationError()};var yne=gA;function QU(e){e=e??V.EMPTY_OBJECT,this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new b_({comparator:QU.comparator})}QU.prototype.addSubtree=function(e){let t=new WMt(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()};QU.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],s=r.subtree.implicitCoordinates;if(e.isEqual(s))return r.subtree}};QU.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 WMt(e,t){this.subtree=e,this.stamp=t}var kU=QU;function UU(e){e=e??V.EMPTY_OBJECT;let{className:t,names:n,types:i,componentTypes:o,shape:r,dimensions:a,paddingBefore:s=d.ZERO.clone(),paddingAfter:c=d.ZERO.clone(),globalTransform:u=M.IDENTITY.clone(),shapeTransform:f=M.IDENTITY.clone(),minBounds:h,maxBounds:p,minimumValues:A,maximumValues:m,maximumTileCount:_}=e;this._shapeTransform=f,this._globalTransform=u,this._shape=r,this._minBounds=h,this._maxBounds=p,this._dimensions=a,this._paddingBefore=s,this._paddingAfter=c,this._className=t,this._names=n,this._types=i,this._componentTypes=o,this._metadataOrder=r===_c.ELLIPSOID?mA.Z_UP:mA.Y_UP,this._minimumValues=A,this._maximumValues=m,this._maximumTileCount=_,this._availableLevels=void 0,this._implicitTileset=void 0,this._subtreeCache=new kU}Object.defineProperties(UU.prototype,{globalTransform:{get:function(){return this._globalTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shape:{get:function(){return this._shape}},minBounds:{get:function(){return this._minBounds}},maxBounds:{get:function(){return this._maxBounds}},dimensions:{get:function(){return this._dimensions}},paddingBefore:{get:function(){return this._paddingBefore}},paddingAfter:{get:function(){return this._paddingAfter}},className:{get:function(){return this._className}},names:{get:function(){return this._names}},types:{get:function(){return this._types}},componentTypes:{get:function(){return this._componentTypes}},metadataOrder:{get:function(){return this._metadataOrder}},minimumValues:{get:function(){return this._minimumValues}},maximumValues:{get:function(){return this._maximumValues}},maximumTileCount:{get:function(){return this._maximumTileCount}},availableLevels:{get:function(){return this._availableLevels}}});UU.fromUrl=async function(e){let t=De.createIfNeeded(e),n=await t.fetchJson();YMt(n);let i=eNt(n,t);await i.load();let{root:o}=n,r=xi(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,a=new hb({metadataJson:r,schema:i.schema}),s=o.content.extensions["3DTILES_content_voxels"],c=s.class,u=tNt(a,c);Object.assign(u,qMt(o)),l(o.transform)?u.globalTransform=M.unpack(o.transform):u.globalTransform=M.clone(M.IDENTITY),u.dimensions=d.unpack(s.dimensions),u.maximumTileCount=jMt(a),l(s.padding)&&(u.paddingBefore=d.unpack(s.padding.before),u.paddingAfter=d.unpack(s.padding.after));let f=new UU(u),h=new Rp(t,o,i.schema);return f._implicitTileset=h,f._availableLevels=h.availableLevels,Ri.unload(i),f};function jMt(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(wd.TILESET_TILE_COUNT)}function YMt(e){let t=e.root;if(!l(t.content))throw new ue("Root must have content");if(!xi(t.content,"3DTILES_content_voxels"))throw new ue("Root tile content must have 3DTILES_content_voxels extension");if(!xi(t,"3DTILES_implicit_tiling")&&!l(t.implicitTiling))throw new ue("Root tile must have implicit tiling");if(!l(e.schema)&&!l(e.schemaUri)&&!xi(e,"3DTILES_metadata"))throw new ue("Tileset must have a metadata schema")}function qMt(e){let t=e.boundingVolume;if(l(t.box))return ZMt(t.box);if(l(t.region))return KMt(t.region);if(xi(t,"3DTILES_bounding_volume_cylinder"))return $Mt(t.extensions["3DTILES_bounding_volume_cylinder"]);throw new ue("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function KMt(e){let t=e[0],n=e[1],i=e[2],o=e[3],r=e[4],a=e[5],s=M.fromScale(te.WGS84.radii),c=new d(t,n,r),u=new d(i,o,a);return{shape:_c.ELLIPSOID,minBounds:c,maxBounds:u,shapeTransform:s}}var XMt=new d,JMt=new J;function ZMt(e){let t=en.unpack(e),n=J.getScale(t.halfAxes,XMt),i=J.getRotation(t.halfAxes,JMt);return{shape:_c.BOX,minBounds:d.negate(n,new d),maxBounds:d.clone(n),shapeTransform:M.fromRotationTranslation(i,t.center)}}function $Mt(e){let{minRadius:t,maxRadius:n,height:i,minAngle:o=-D.PI,maxAngle:r=D.PI,translation:a=[0,0,0],rotation:s=[0,0,0,1]}=e,c=-.5*i+a[2],u=.5*i+a[2],f=M.fromTranslationQuaternionRotationScale(d.unpack(a),Qe.unpack(s),d.ONE);return{shape:_c.CYLINDER,minBounds:d.fromElements(t,o,c),maxBounds:d.fromElements(n,r,u),shapeTransform:f}}function eNt(e,t){let{schemaUri:n,schema:i}=e;return l(n)?Ri.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Ri.getSchemaLoader({schema:i})}function tNt(e,t){let{schema:n,statistics:i}=e,o=i?.classes[t],r=n.classes[t].properties,a=Object.entries(r).map(([A,m])=>{let{type:_,componentType:y}=m,C=o?.properties[A].min,E=o?.properties[A].max,b=bt.getComponentCount(_),x=HDe(C,b),S=HDe(E,b);return{id:A,type:_,componentType:y,minValue:x,maxValue:S}}),s=a.map(A=>A.id),c=a.map(A=>A.type),u=a.map(A=>A.componentType),f=a.map(A=>A.minValue),h=a.map(A=>A.maxValue),p=f.some(l);return{className:t,names:s,types:c,componentTypes:u,minimumValues:p?f:void 0,maximumValues:p?h:void 0}}function HDe(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,o)=>n[o])}async function nNt(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()}),a=n.baseResource.getDerivedResource({url:r.url}),s=await a.fetchArrayBuffer();if(o=i.find(t),l(o))return o;let c=zg(s);return o=await ag.fromSubtreeJson(a,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(o),o}UU.prototype.requestData=async function(e){e=e??V.EMPTY_OBJECT;let{tileLevel:t=0,tileX:n=0,tileY:i=0,tileZ:o=0,keyframe:r=0}=e;if(r!==0)return Promise.reject("3D Tiles currently doesn't support time-dynamic data.");let a=this._implicitTileset,s=new Mp({subdivisionScheme:a.subdivisionScheme,subtreeLevels:a.subtreeLevels,level:t,x:n,y:i,z:o}),c=s.isSubtreeRoot()&&s.level>0,u=c?s.getParentSubtreeCoordinates():s.getSubtreeCoordinates(),h=await nNt(this,u);if(!(c?h.childSubtreeIsAvailableAtCoordinates:h.tileIsAvailableAtCoordinates).call(h,s))return Promise.reject(`Tile is not available at level ${t}, x ${n}, y ${i}, z ${o}.`);let{contentUriTemplates:m,baseResource:_}=a,y=m[0].getDerivedResource({templateValues:s.getTemplateValues()}),C=_.getDerivedResource({url:y.url});return zI.fromGltf(C)};var Cne=UU;function Ene(e){e=e??1,this._radius=e??1}Object.defineProperties(Ene.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});Ene.prototype.emit=function(e){let t=D.randomBetween(0,D.TWO_PI),n=D.randomBetween(0,this._radius),i=n*Math.cos(t),o=n*Math.sin(t),r=0;e.position=d.fromElements(i,o,r,e.position),e.velocity=d.clone(d.UNIT_Z,e.velocity)};var zU=Ene;var bne={CUMULUS:0};bne.validate=function(e){return e===bne.CUMULUS};var xB=Object.freeze(bne);function Wm(e,t){if(e=e??V.EMPTY_OBJECT,this._show=e.show??!0,this._position=d.clone(e.position??d.ZERO),!l(e.scale)&&l(e.maximumSize))this._maximumSize=d.clone(e.maximumSize),this._scale=new k(this._maximumSize.x,this._maximumSize.y);else{this._scale=k.clone(e.scale??new k(20,12));let n=new d(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=d.clone(e.maximumSize??n)}this._slice=e.slice??-1,this._color=z.clone(e.color??z.WHITE),this._brightness=e.brightness??1,this._cloudCollection=t,this._index=-1}var iNt=Wm.SHOW_INDEX=0,oNt=Wm.POSITION_INDEX=1,rNt=Wm.SCALE_INDEX=2,aNt=Wm.MAXIMUM_SIZE_INDEX=3,sNt=Wm.SLICE_INDEX=4,cNt=Wm.BRIGHTNESS_INDEX=5,lNt=Wm.COLOR_INDEX=6;Wm.NUMBER_OF_PROPERTIES=7;function JI(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(Wm.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,JI(this,iNt))}},position:{get:function(){return this._position},set:function(e){let t=this._position;d.equals(t,e)||(d.clone(e,t),JI(this,oNt))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;k.equals(t,e)||(k.clone(e,t),JI(this,rNt))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;d.equals(t,e)||(d.clone(e,t),JI(this,aNt))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),JI(this,lNt))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,JI(this,sNt))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,JI(this,cNt))}}});Wm.prototype._destroy=function(){this._cloudCollection=void 0};var id=Wm;var od,O5=new d,uNt={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},fNt={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},dNt=id.SHOW_INDEX,hNt=id.POSITION_INDEX,mNt=id.SCALE_INDEX,pNt=id.MAXIMUM_SIZE_INDEX,ANt=id.SLICE_INDEX,gNt=id.BRIGHTNESS_INDEX,_Nt=id.NUMBER_OF_PROPERTIES,yNt=id.COLOR_INDEX;function jm(e){e=e??V.EMPTY_OBJECT,this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(_Nt),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=e.noiseDetail??16,this.noiseOffset=d.clone(e.noiseOffset??d.ZERO),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:WDe(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=e.show??!0,this._colorCommands=[],this.debugBillboards=e.debugBillboards??!1,this._compiledDebugBillboards=!1,this.debugEllipsoids=e.debugEllipsoids??!1,this._compiledDebugEllipsoids=!1}function WDe(e){return function(){return O5.x=e._textureSliceWidth,O5.y=e._noiseTextureRows,O5.z=1/e._noiseTextureRows,O5}}Object.defineProperties(jm.prototype,{length:{get:function(){return xne(this),this._clouds.length}}});function jDe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}jm.prototype.add=function(e){e=e??V.EMPTY_OBJECT;let t=e.cloudType??xB.CUMULUS,n;return t===xB.CUMULUS&&(n=new id(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};jm.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};jm.prototype.removeAll=function(){jDe(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function xne(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 a=n[o];l(a)&&(n._index=r++,t.push(a))}e._clouds=t}}jm.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};jm.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};jm.prototype.get=function(e){return xne(this),this._clouds[e]};var CNt=new Float32Array([-1,-1,1,-1,1,1,-1,1]),ENt=new Uint16Array([0,1,2,0,2,3]);function bNt(e){let t=tt.createVertexBuffer({context:e,typedArray:CNt,usage:Re.STATIC_DRAW}),n=tt.createIndexBuffer({context:e,typedArray:ENt,usage:Re.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:j.FLOAT}];return new Gn({context:e,attributes:i,indexBuffer:n})}var Tne;function INt(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,a=0;r<i;r+=6,a+=4)o[r]=a,o[r+1]=a+1,o[r+2]=a+2,o[r+3]=a,o[r+4]=a+2,o[r+5]=a+3;return n=tt.createIndexBuffer({context:e,typedArray:o,usage:Re.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function xNt(e){let t=e.cache.cloudCollection_indexBufferInstanced;return l(t)||(t=tt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Re.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function TNt(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return l(t)||(t=tt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Re.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function SNt(e,t,n){let i=[{index:od.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:Re.STATIC_DRAW},{index:od.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:Re.STATIC_DRAW},{index:od.packedAttribute0,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:Re.STATIC_DRAW},{index:od.packedAttribute1,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:Re.STATIC_DRAW},{index:od.color,componentsPerAttribute:4,componentDatatype:j.UNSIGNED_BYTE,normalize:!0,usage:Re.STATIC_DRAW}];n&&i.push({index:od.direction,componentsPerAttribute:2,componentDatatype:j.FLOAT,vertexBuffer:TNt(e)});let o=n?t:4*t;return new OA(e,i,o,n)}var Ine=new xn;function YDe(e,t,n,i){let o,r=n[od.positionHighAndScaleX],a=n[od.positionLowAndScaleY],s=i.position;xn.fromCartesian(s,Ine);let c=i.scale,u=Ine.high,f=Ine.low;e._instanced?(o=i._index,r(o,u.x,u.y,u.z,c.x),a(o,f.x,f.y,f.z,c.y)):(o=i._index*4,r(o+0,u.x,u.y,u.z,c.x),r(o+1,u.x,u.y,u.z,c.x),r(o+2,u.x,u.y,u.z,c.x),r(o+3,u.x,u.y,u.z,c.x),a(o+0,f.x,f.y,f.z,c.y),a(o+1,f.x,f.y,f.z,c.y),a(o+2,f.x,f.y,f.z,c.y),a(o+3,f.x,f.y,f.z,c.y))}function qDe(e,t,n,i){let o,r=n[od.packedAttribute0],a=i.show,s=i.brightness;e._instanced?(o=i._index,r(o,a,s,0,0)):(o=i._index*4,r(o+0,a,s,0,0),r(o+1,a,s,1,0),r(o+2,a,s,1,1),r(o+3,a,s,0,1))}function KDe(e,t,n,i){let o,r=n[od.packedAttribute1],a=i.maximumSize,s=i.slice;e._instanced?(o=i._index,r(o,a.x,a.y,a.z,s)):(o=i._index*4,r(o+0,a.x,a.y,a.z,s),r(o+1,a.x,a.y,a.z,s),r(o+2,a.x,a.y,a.z,s),r(o+3,a.x,a.y,a.z,s))}function XDe(e,t,n,i){let o,r=n[od.color],a=i.color,s=z.floatToByte(a.red),c=z.floatToByte(a.green),u=z.floatToByte(a.blue),f=z.floatToByte(a.alpha);e._instanced?(o=i._index,r(o,s,c,u,f)):(o=i._index*4,r(o+0,s,c,u,f),r(o+1,s,c,u,f),r(o+2,s,c,u,f),r(o+3,s,c,u,f))}function wNt(e,t,n,i){YDe(e,t,n,i),qDe(e,t,n,i),KDe(e,t,n,i),XDe(e,t,n,i)}function BNt(e,t,n,i){let o=e,r=o._textureSliceWidth,a=o._noiseTextureRows,s=t.context;o._vaNoise=bNt(s),o._spNoise=$t.fromCache({context:s,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let c=o.noiseDetail,u=o.noiseOffset;o._noiseTexture=new Dt({context:s,width:r*r/a,height:r*a,pixelDatatype:He.UNSIGNED_BYTE,pixelFormat:qe.RGBA,sampler:new jt({wrapS:pn.REPEAT,wrapT:pn.REPEAT,minificationFilter:Wt.NEAREST,magnificationFilter:ci.NEAREST})});let f=new xl({vertexArray:o._vaNoise,shaderProgram:o._spNoise,outputTexture:o._noiseTexture,uniformMap:{u_noiseTextureDimensions:WDe(o),u_noiseDetail:function(){return c},u_noiseOffset:function(){return u}},persists:!1,owner:e,postExecute:function(h){o._ready=!0,o._loading=!1}});t.commandList.push(f),o._loading=!0}function DNt(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=SNt(i,r,n._instanced);let a=n._vaf.writers,s;for(s=0;s<r;++s){let c=o[s];wNt(e,t,a,c)}n._vaf.commit(Tne(i))}}var vNt=[];function PNt(e,t){let n=t.context,i=e,r=i._clouds.length,a=i._cloudsToUpdate,s=i._cloudsToUpdateIndex,c=i._propertiesChanged,u=vNt;u.length=0,(c[hNt]||c[mNt])&&u.push(YDe),(c[dNt]||c[gNt])&&u.push(qDe),(c[pNt]||c[ANt])&&u.push(KDe),c[yNt]&&u.push(XDe);let f=u.length,h=i._vaf.writers,p,A,m;if(s/r>.1){for(p=0;p<s;++p)for(A=a[p],A._dirty=!1,m=0;m<f;++m)u[m](e,t,h,A);i._vaf.commit(Tne(n))}else{for(p=0;p<s;++p){for(A=a[p],A._dirty=!1,m=0;m<f;++m)u[m](e,t,h,A);i._instanced?i._vaf.subCommit(A._index,1):i._vaf.subCommit(A._index*4,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}function RNt(e,t,n,i){let o=t.context,r=e,a=new We({defines:[],sources:[n]});r._instanced&&a.defines.push("INSTANCED");let s=new We({defines:[],sources:[i]});r.debugBillboards&&s.defines.push("DEBUG_BILLBOARDS"),r.debugEllipsoids&&s.defines.push("DEBUG_ELLIPSOIDS"),r._sp=$t.replaceCache({context:o,shaderProgram:r._sp,vertexShaderSource:a,fragmentShaderSource:s,attributeLocations:od}),r._rs=Ve.fromCache({depthTest:{enabled:!0,func:ee.LESS},depthMask:!1,blending:sn.ALPHA_BLEND}),r._spCreated=!0,r._compiledDebugBillboards=r.debugBillboards,r._compiledDebugEllipsoids=r.debugEllipsoids}function MNt(e,t){let n=e,i=t.passes,o=n._uniforms,r=t.commandList;if(i.render){let a=n._colorCommands,s=n._vaf.va,c=s.length;a.length=c;for(let u=0;u<c;u++){let f=a[u];l(f)||(f=a[u]=new nt),f.pass=Be.TRANSLUCENT,f.owner=e,f.uniformMap=o,f.count=s[u].indicesCount,f.vertexArray=s[u].va,f.shaderProgram=n._sp,f.renderState=n._rs,n._instanced&&(f.count=6,f.instanceCount=n._clouds.length),r.push(f)}}}jm.prototype.update=function(e){if(xne(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&BNt(this,e,ck,sk),this._instanced=e.context.instancedArrays,od=this._instanced?fNt:uNt,Tne=this._instanced?xNt:INt;let i=this._clouds.length,o=this._cloudsToUpdate,r=this._cloudsToUpdateIndex;this._createVertexArray?DNt(this,e):r>0&&PNt(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)&&RNt(this,e,ak,rk),MNt(this,e))};jm.prototype.isDestroyed=function(){return!1};jm.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(),jDe(this._clouds),fe(this)};var Sne=jm;var NNt=D.toRadians(30);function wne(e){this._angle=e??NNt}Object.defineProperties(wne.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});wne.prototype.emit=function(e){let t=Math.tan(this._angle),n=D.randomBetween(0,D.TWO_PI),i=D.randomBetween(0,t),o=i*Math.cos(n),r=i*Math.sin(n),a=1;e.velocity=d.fromElements(o,r,a,e.velocity),d.normalize(e.velocity,e.velocity),e.position=d.clone(d.ZERO,e.position)};var Bne=wne;var LNt=new z,ONt=new z,FNt=new z,QNt=new z,JDe=new ie,GU=new Uint8Array(4);function ZDe(e,t,n,i){let o=t.height===n.height?0:(e-t.height)/(n.height-t.height);return z.lerp(t.color,n.color,o,i)}function F5(e,t){return{height:e,color:z.clone(t)}}function $De(e){return e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,a=o?t.height===i[n-1].height:!0,s=r?t.height===i[n+1].height:!0;return!a||!s}),e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,a=o?z.equals(t.color,i[n-1].color):!1,s=r?z.equals(t.color,i[n+1].color):!1;return!a||!s}),e=e.filter(function(t,n,i){let o=n>0,r=o?z.equals(t.color,i[n-1].color):!1,a=o?t.height===i[n-1].height:!0;return!r||!a}),e}function kNt(e){let t,n,i=[],o=e.length;for(t=0;t<o;t++){let r=e[t],a=r.entries,s=a.length,c=[];for(n=0;n<s;n++){let A=a[n],m=D.clamp(A.height,Ku._minimumHeight,Ku._maximumHeight),_=z.clone(A.color,LNt);_.red*=_.alpha,_.green*=_.alpha,_.blue*=_.alpha,c.push(F5(m,_))}let u=!0,f=!0;for(n=0;n<s-1;n++){let A=c[n+0],m=c[n+1];u=u&&A.height<=m.height,f=f&&A.height>=m.height}f?c=c.reverse():u||rA(c,function(A,m){return D.sign(A.height-m.height)});let h=r.extendDownwards??!1,p=r.extendUpwards??!1;c.length===1&&!h&&!p&&(h=!0,p=!0),h&&c.splice(0,0,F5(Ku._minimumHeight,c[0].color)),p&&c.splice(c.length,0,F5(Ku._maximumHeight,c[c.length-1].color)),c=$De(c),i.push(c)}return i}function UNt(e){let t=kNt(e),n=[],i=[],o;function r(u,f){n.push(F5(u,f))}function a(u,f,h){let p=z.multiplyByScalar(h,1-f.alpha,QNt);p=z.add(p,f,p),r(u,p)}let s=t.length;for(o=0;o<s;o++){let u=t[o],f=0,h=0;i=n,n=[];let p=u.length,A=i.length;for(;f<p||h<A;){let m=f<p?u[f]:void 0,_=f>0?u[f-1]:void 0,y=f<p-1?u[f+1]:void 0,C=h<A?i[h]:void 0,E=h>0?i[h-1]:void 0,b=h<A-1?i[h+1]:void 0;if(l(m)&&l(C)&&m.height===C.height){let x=l(b)&&C.height===b.height,S=!l(E),B=!l(b),v=l(y)&&m.height===y.height,P=!l(_),N=!l(y);x?v?(a(m.height,m.color,C.color),a(m.height,y.color,b.color)):P?(r(m.height,C.color),a(m.height,m.color,b.color)):N?(a(m.height,m.color,C.color),r(m.height,b.color)):(a(m.height,m.color,C.color),a(m.height,m.color,b.color)):S?v?(r(m.height,m.color),a(m.height,y.color,C.color)):N?(r(m.height,m.color),r(m.height,C.color)):(P||r(m.height,m.color),a(m.height,m.color,C.color)):B?v?(a(m.height,m.color,C.color),r(m.height,y.color)):P?(r(m.height,C.color),r(m.height,m.color)):N?a(m.height,m.color,C.color):(a(m.height,m.color,C.color),r(m.height,m.color)):v?(a(m.height,m.color,C.color),a(m.height,y.color,C.color)):P?(r(m.height,C.color),a(m.height,m.color,C.color)):N?(a(m.height,m.color,C.color),r(m.height,C.color)):a(m.height,m.color,C.color),f+=v?2:1,h+=x?2:1}else if(l(m)&&l(C)&&l(E)&&m.height<C.height){let x=ZDe(m.height,E,C,FNt);l(_)?l(y)?a(m.height,m.color,x):(a(m.height,m.color,x),r(m.height,x)):(r(m.height,x),a(m.height,m.color,x)),f++}else if(l(C)&&l(m)&&l(_)&&C.height<m.height){let x=ZDe(C.height,_,m,ONt);l(E)?l(b)?a(C.height,x,C.color):(a(C.height,x,C.color),r(C.height,x)):(r(C.height,x),a(C.height,x,C.color)),h++}else l(m)&&(!l(C)||m.height<C.height)?(l(C)&&!l(E)&&!l(y)?(r(m.height,m.color),r(m.height,Ku._emptyColor),r(C.height,Ku._emptyColor)):(!l(C)&&l(E)&&!l(_)&&(r(E.height,Ku._emptyColor),r(m.height,Ku._emptyColor)),r(m.height,m.color)),f++):l(C)&&(!l(m)||C.height<m.height)&&(r(C.height,C.color),h++)}}return $De(n)}function Ku(e){let{scene:t,layers:n}=e??V.EMPTY_OBJECT,{context:i}=t,o=UNt(n),r=o.length,a,s,c;if(!Ku._useFloatTexture(i)){s=He.UNSIGNED_BYTE,c=qe.RGBA,a=new Uint8Array(r*4);for(let A=0;A<r;A++)ie.packFloat(o[A].height,JDe),ie.pack(JDe,a,A*4)}else{s=He.FLOAT,c=i.webgl2?qe.RED:qe.LUMINANCE,a=new Float32Array(r);for(let A=0;A<r;A++)a[A]=o[A].height}let f=Dt.create({context:i,pixelFormat:c,pixelDatatype:s,source:{arrayBufferView:a,width:r,height:1},sampler:new jt({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Wt.NEAREST,magnificationFilter:ci.NEAREST})}),h=new Uint8Array(r*4);for(let A=0;A<r;A++)o[A].color.toBytes(GU),h[A*4+0]=GU[0],h[A*4+1]=GU[1],h[A*4+2]=GU[2],h[A*4+3]=GU[3];let p=Dt.create({context:i,pixelFormat:qe.RGBA,pixelDatatype:He.UNSIGNED_BYTE,source:{arrayBufferView:h,width:r,height:1},sampler:new jt({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:ci.LINEAR})});return Yi.fromType("ElevationBand",{heights:f,colors:p})}Ku._useFloatTexture=function(e){return e.floatingPointTexture};Ku._maximumHeight=5906376425472;Ku._minimumHeight=-5906376425472;Ku._emptyColor=new z(0,0,0,0);var Dne=Ku;async function zNt(e,t){t=t??{},t.cacheBytes=t.cacheBytes??1536*1024*1024,t.maximumCacheOverflowBytes=t.maximumCacheOverflowBytes??1024*1024*1024,t.enableCollision=t.enableCollision??!0,e=e??V.EMPTY_OBJECT,e.onlyUsingWithGoogleGeocoder||It("google-tiles-with-google-geocoder","Only the Google geocoder can be used with Google Photorealistic 3D Tiles. Set the `geocode` property of Viewer constructor options. You can set additionalOptions.onlyUsingWithGoogleGeocoder to hide this warning once you have configured the geocoder.");let n=e.key??ms.defaultApiKey;if(!l(n))return GNt(t);let i,o=ms.getDefaultCredit();l(o)&&(i=[o]);let r=new De({url:`${ms.mapTilesApiEndpoint}v1/3dtiles/root.json`,queryParameters:{key:n},credits:i});return es.fromUrl(r,t)}var eve={};async function GNt(e){let i=eve[2275207];l(i)||(i=fa.fromAssetId(2275207),eve[2275207]=i);let o=await i;return es.fromUrl(o,e)}var vne=zNt;async function VNt(e){let t=await es.fromIonAssetId(96188,e);e=e??V.EMPTY_OBJECT;let n=e.style;if(!l(n)){let i=(e.defaultColor??z.WHITE).toCssColorString();n=new Fg({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var Pne=VNt;function HNt(e){e=e??V.EMPTY_OBJECT;let t=[],n=e.geometry;(!l(n.attributes)||!l(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,o=M.clone(e.modelMatrix??M.IDENTITY),r=e.length??1e4;if(l(i.normal)&&t.push(new Mt({geometry:Wn.createLineSegmentsForVectors(n,"normal",r),attributes:{color:new Jt(1,0,0,1)},modelMatrix:o})),l(i.tangent)&&t.push(new Mt({geometry:Wn.createLineSegmentsForVectors(n,"tangent",r),attributes:{color:new Jt(0,1,0,1)},modelMatrix:o})),l(i.bitangent)&&t.push(new Mt({geometry:Wn.createLineSegmentsForVectors(n,"bitangent",r),attributes:{color:new Jt(0,0,1,1)},modelMatrix:o})),t.length>0)return new Nn({asynchronous:!1,geometryInstances:t,appearance:new gn({flat:!0,translucent:!1})})}var Rne=HNt;function VU(e){e=e??V.EMPTY_OBJECT;let t=e.attributeName,n=e.perInstanceAttribute;l(n)||(n=!1);let i=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 a=`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;
}`,s=`in ${i} ${o};
${r}
void main()
{
out_FragColor = getColor();
}`;this.material=void 0,this.translucent=e.translucent??!1,this._vertexShaderSource=e.vertexShaderSource??a,this._fragmentShaderSource=e.fragmentShaderSource??s,this._renderState=Io.getDefaultRenderState(!1,!1,e.renderState),this._closed=e.closed??!1,this._attributeName=t,this._glslDatatype=i}Object.defineProperties(VU.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}}});VU.prototype.getFragmentShaderSource=Io.prototype.getFragmentShaderSource;VU.prototype.isTranslucent=Io.prototype.isTranslucent;VU.prototype.getRenderState=Io.prototype.getRenderState;var Mne=VU;function Q5(e){e=e??V.EMPTY_OBJECT,this.length=e.length??1e7,this._length=void 0,this.width=e.width??2,this._width=void 0,this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=new M,this.id=e.id,this._id=void 0,this._primitive=void 0}Q5.prototype.update=function(e){if(this.show){if(!l(this._primitive)||!M.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=M.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 Mt({geometry:new d_({positions:[d.ZERO,d.UNIT_X],width:this.width,vertexFormat:Ra.VERTEX_FORMAT,colors:[z.RED,z.RED],arcType:ln.NONE}),modelMatrix:M.multiplyByUniformScale(this.modelMatrix,this.length,new M),id:this.id,pickPrimitive:this}),n=new Mt({geometry:new d_({positions:[d.ZERO,d.UNIT_Y],width:this.width,vertexFormat:Ra.VERTEX_FORMAT,colors:[z.GREEN,z.GREEN],arcType:ln.NONE}),modelMatrix:M.multiplyByUniformScale(this.modelMatrix,this.length,new M),id:this.id,pickPrimitive:this}),i=new Mt({geometry:new d_({positions:[d.ZERO,d.UNIT_Z],width:this.width,vertexFormat:Ra.VERTEX_FORMAT,colors:[z.BLUE,z.BLUE],arcType:ln.NONE}),modelMatrix:M.multiplyByUniformScale(this.modelMatrix,this.length,new M),id:this.id,pickPrimitive:this});this._primitive=new Nn({geometryInstances:[t,n,i],appearance:new Ra,asynchronous:!1})}this._primitive.update(e)}};Q5.prototype.isDestroyed=function(){return!1};Q5.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),fe(this)};var HU=Q5;function WNt(e){this.direction=d.clone(e.direction),this.color=z.clone(e.color??z.WHITE),this.intensity=e.intensity??1}var Nne=WNt;var WU=`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 jU=`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 ZI(e){e=e??V.EMPTY_OBJECT;let t=e.translucent??!0,n=e.aboveGround??!1;this.material=l(e.material)?e.material:Yi.fromType(Yi.ColorType),this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource??jU,this._fragmentShaderSource=e.fragmentShaderSource??WU,this._renderState=Io.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=e.flat??!1,this._faceForward=e.faceForward??n,this._aboveGround=n}Object.defineProperties(ZI.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 ZI.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});ZI.VERTEX_FORMAT=ke.POSITION_AND_ST;ZI.prototype.getFragmentShaderSource=Io.prototype.getFragmentShaderSource;ZI.prototype.isTranslucent=Io.prototype.isTranslucent;ZI.prototype.getRenderState=Io.prototype.getRenderState;var Lne=ZI;var jNt=1e5;function YU(e){e=e??V.EMPTY_OBJECT;let t=e.credit;typeof t=="string"&&(t=new Et(t)),this._credit=t,this._radius=l(e.radius)?e.radius:jNt,this._image=e.image,this._transform=l(e.transform)?e.transform:M.IDENTITY,this._repeatHorizontal=l(e.repeatHorizontal)?e.repeatHorizontal:1,this._repeatVertical=l(e.repeatVertical)?e.repeatVertical:1;let n=new nk({radius:this._radius,vertexFormat:ke.ALL}),i=new Mt({geometry:n,modelMatrix:this._transform}),o=new Yi({fabric:{type:"Image",uniforms:{image:this._image,repeat:new k(-this._repeatHorizontal,this._repeatVertical)}}});return this._primitive=new Nn({geometryInstances:i,appearance:new _o({material:o,closed:!0,faceForward:!1,translucent:!1,renderState:{cull:{enabled:!1}}}),credit:this._credit}),this}Object.defineProperties(YU.prototype,{radius:{get:function(){return this._radius}},image:{get:function(){return this._image}},transform:{get:function(){return this._transform}},credit:{get:function(){return l(this._credit)?this._credit:void 0}},show:{get:function(){return l(this._primitive)?this._primitive.show:void 0},set:function(e){l(this._primitive)&&(this._primitive.show=e)}}});YU.prototype.update=function(e){return l(this._credit)&&e.creditDisplay.addCreditToNextFrame(this._credit),this._primitive.update(e)};YU.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),fe(this)};YU.prototype.isDestroyed=function(){return this._primitive.isDestroyed()};var One=YU;function Xu(e){this._scene=e.scene,this.samplingWindow=e.samplingWindow??Xu.defaultSettings.samplingWindow,this.quietPeriod=e.quietPeriod??Xu.defaultSettings.quietPeriod,this.warmupPeriod=e.warmupPeriod??Xu.defaultSettings.warmupPeriod,this.minimumFrameRateDuringWarmup=e.minimumFrameRateDuringWarmup??Xu.defaultSettings.minimumFrameRateDuringWarmup,this.minimumFrameRateAfterWarmup=e.minimumFrameRateAfterWarmup??Xu.defaultSettings.minimumFrameRateAfterWarmup,this._lowFrameRate=new _e,this._nominalFrameRate=new _e,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){YNt(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(){qNt(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}Xu.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};Xu.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new Xu({scene:e})),e._frameRateMonitor};Object.defineProperties(Xu.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}}});Xu.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};Xu.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};Xu.prototype.isDestroyed=function(){return!1};Xu.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),fe(this)};function YNt(e,t){if(e._pauseCount>0)return;let n=Fi();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/li.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/li.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/li.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 qNt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var qU=Xu;var tve=Wr(Y$(),1);function Fne(){this._image=new Image}Fne.prototype.isReady=function(){return!0};Fne.prototype.shouldDiscardImage=function(e){return e===this._image};function $I(e){e=e??V.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 qi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-D.PI,-D.PI,D.PI,D.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new Et(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new Fne),this._errorEvent=new _e}Object.defineProperties($I.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}}});$I.fromMetadata=function(e,t){if(!e.imageryPresent)throw new ue(`The server ${e.url} doesn't have imagery`);let n=new $I(t);return n._metadata=e,n};$I.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]}};$I.prototype.requestImage=function(e,t,n,i){let o=this._tileDiscardPolicy._image,r=this._metadata,a=x_.tileXYToQuadKey(e,t,n),s=r.getTileInformation(e,t,n);if(!l(s)){if(r.isValid(a)){let u=new Ir({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});r.populateSubtree(e,t,n,u);return}return Promise.resolve(o)}if(!s.hasImagery())return Promise.resolve(o);let c=KNt(this,s,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(u){z2(r.key,u);let f=new Uint8Array(u),h,p=r.protoImagery;if((!l(p)||!p)&&(h=XNt(f)),!l(h)&&(!l(p)||p)){let A=JNt(f);h=A.imageType,f=A.imageData}return!l(h)||!l(f)?o:og({uint8Array:f,format:h,flipY:!0})})};$I.prototype.pickFeatures=function(e,t,n,i,o){};function KNt(e,t,n,i,o,r){let a=x_.tileXYToQuadKey(n,i,o),s=t.imageryVersion;return s=l(s)&&s>0?s:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1-0${a}-i.${s.toString()}`,request:r})}function XNt(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 JNt(e){let t=tve.Reader.create(e),n=t.len,i={};for(;t.pos<n;){let a=t.uint32(),s;switch(a>>>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(s=i.copyrightIds,l(s)||(s=i.copyrightIds=[]),(a&7)===2){let c=t.uint32()+t.pos;for(;t.pos<c;)s.push(t.uint32())}else s.push(t.uint32());break;default:t.skipType(a&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 Qne=$I;var ZNt=600;function _A(e){e=e??V.EMPTY_OBJECT,this._key=l(e.key)?e.key:ms.defaultApiKey,this._baseResource=De.createIfNeeded(e.url??ms.streetViewStaticApiEndpoint),this._metadataResource=this._baseResource.getDerivedResource({url:"streetview/metadata"}),this._tileSize=e.tileSize??ZNt}Object.defineProperties(_A.prototype,{});_A.prototype.loadPanorama=async function(e){let t=e.cartographic,n=e.tileSize??this._tileSize,i=`${n}x${n}`,o=e.signature,{panoId:r}=e;l(r)||(r=(await this.getNearestPanoId(t)).panoId);let a=ms.getDefaultCredit(),s=d.fromDegrees(D.toDegrees(t.longitude),D.toDegrees(t.latitude),0),c=[this._loadFaceImage({heading:0,pitch:0,tileSizeString:i,panoId:r,signature:o}),this._loadFaceImage({heading:180,pitch:0,tileSizeString:i,panoId:r,signature:o}),this._loadFaceImage({heading:-90,pitch:-90,tileSizeString:i,panoId:r,signature:o}),this._loadFaceImage({heading:-90,pitch:90,tileSizeString:i,panoId:r,signature:o}),this._loadFaceImage({heading:270,pitch:0,tileSizeString:i,panoId:r,signature:o}),this._loadFaceImage({heading:90,pitch:0,tileSizeString:i,panoId:r,signature:o})],[u,f,h,p,A,m]=await Promise.all(c),_=At.localFrameToFixedFrameGenerator("north","down"),y=M.getMatrix3(_(s,te.default),new J);return new jI({sources:{positiveX:u,negativeX:f,positiveY:h,negativeY:p,positiveZ:A,negativeZ:m},transform:y,credit:a})};_A.prototype.getNearestPanoId=async function(e,t){let i=[D.toDegrees(e.latitude),D.toDegrees(e.longitude)].join(","),r=await this._metadataResource.getDerivedResource({queryParameters:{key:this._key,location:i,radius:t??50}}).fetchJson();if(r.status!=="OK")throw new de(`GoogleStreetViewCubeMapPanoramaProvider metadata error: ${r.status}`);return{panoId:r.pano_id,latitude:r.location.lat,longitude:r.location.lng}};_A.prototype.getPanoIdMetadata=async function(e){let n=await this._metadataResource.getDerivedResource({queryParameters:{key:this._key,pano:e}}).fetchJson();if(n.status!=="OK")throw new de(`GoogleStreetViewCubeMapPanoramaProvider metadata error: ${n.status}`);return n};_A.prototype._loadFaceImage=async function(e){let t=this._buildFaceUrl(e);try{return await De.fetchImage({url:t,preferImageBitmap:!0,flipY:!0})}catch{throw new de(`Failed to load Street View face image: ${t}`)}};_A.prototype._buildFaceUrl=function(e){let{heading:t,pitch:n,tileSizeString:i,panoId:o,signature:r}=e;return this._baseResource.getDerivedResource({queryParameters:{size:i,pano:o,heading:t,pitch:n,key:this._key,...l(r)&&{signature:r}}}).url};_A.fromUrl=async function(e){if(e=e??{},e.key=e.key??ms.defaultStreetViewStaticApiKey??ms.defaultApiKey,!l(e.key)&&!l(ms.defaultStreetViewStaticApiKey)&&!l(ms.defaultApiKey))throw new de("options.key, GoogleMaps.defaultStreetViewStaticApiKey or GoogleMaps.defaultApiKey is required.");return new _A({...e})};_A._parseMetadata=function(e){return{cartographic:me.fromDegrees(e.location.lng,e.location.lat,0)}};var kne=_A;var $Nt=new z(1,1,1,.4),eLt=new z(0,1,0,.05),tLt=new z(0,.5,0,.2);function ex(e){e=e??V.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 qi({ellipsoid:e.ellipsoid}),this._cells=e.cells??8,this._color=e.color??$Nt,this._glowColor=e.glowColor??eLt,this._glowWidth=e.glowWidth??6,this._backgroundColor=e.backgroundColor??tLt,this._errorEvent=new _e,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._canvasSize=e.canvasSize??256,this._canvas=this._createGridCanvas()}Object.defineProperties(ex.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}}});ex.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()};ex.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 a=this._color.toCssColorString();return i.strokeStyle=a,i.lineWidth=2,i.strokeRect(t,t,n,n),i.lineWidth=1,this._drawGrid(i),e};ex.prototype.getTileCredits=function(e,t,n){};ex.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};ex.prototype.pickFeatures=function(e,t,n,i,o){};var Une=ex;function Ym(){}Ym._maxDecodingConcurrency=Math.max(fn.hardwareConcurrency-1,1);Ym._decodeTaskProcessor=new Zn("decodeI3S",Ym._maxDecodingConcurrency);Ym._promise=void 0;async function nLt(){if(await Ym._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return Ym._decodeTaskProcessor;throw new ue("I3S decoder could not be initialized.")}Ym.decode=async function(e,t,n,i,o){return l(Ym._promise)||(Ym._promise=nLt()),Ym._promise.then(function(r){let a=n._parent._data,s=n._parent._inverseRotationMatrix,c=0,u=0,f=0;l(a.obb)?(c=a.obb.center[0],u=a.obb.center[1],f=a.obb.center[2]):l(a.mbs)&&(c=a.mbs[0],u=a.mbs[1],f=a.mbs[2]);let h=J.fromRotationX(-D.PI_OVER_TWO),p=new J;J.multiply(h,s,p);let A=me.fromDegrees(c,u,f),m=te.WGS84.cartographicToCartesian(A),_={binaryData:n._data,featureData:l(i)&&l(i[0])?i[0].data:void 0,schema:t,bufferInfo:n._geometryBufferInfo,ellipsoidRadiiSquare:te.WGS84.radiiSquared,url:e,geoidDataList:n._dataProvider._geoidDataList,cartographicCenter:A,cartesianCenter:m,parentRotation:p,enableFeatures:n._dataProvider.showFeatures,splitGeometryByColorTransparency:n._dataProvider.adjustMaterialAlphaMode,symbologyData:o,calculateNormals:n._dataProvider.calculateNormals};return r.scheduleTask(_)})};var KU=Ym;function zne(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(zne.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});zne.prototype.load=async function(){return this._data=await qm.loadJson(this._resource),this._data};var XU=zne;function F_(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(F_.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 k5(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 iLt(e){return e==="String"?1:k5(e)}async function oLt(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)}F_.prototype.load=function(){return l(this._loadPromise)?this._loadPromise:(this._loadPromise=oLt(this).catch(function(e){console.error(e)}),this._loadPromise)};F_.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}};F_.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};F_.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 a=0;a<this._header.count;++a)if(r.valueType!=="String"){let s=this._parseValue(e,r.valueType,t);this._values[o].push(s.value),t=s.offset}else{let s=this._values.attributeByteCounts[a],c="";for(let u=0;u<s;++u){let f=this._parseValue(e,r.valueType,t);f.value.charCodeAt(0)!==0&&(c+=f.value),t=f.offset}this._values[o].push(c)}}}};F_.prototype._getBodyOffset=function(e){let t=0;return l(this._storageInfo.attributeValues)?t=k5(this._storageInfo.attributeValues.valueType):l(this._storageInfo.objectIds)&&(t=k5(this._storageInfo.objectIds.valueType)),t>0?Math.ceil(e/t)*t:e};F_.prototype._validateHeader=function(e){let t=0;for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n];t+=iLt(i.valueType)}if(e.byteLength<t)throw new ue(`Invalid attribute buffer size (field: ${this.name}, header: ${t}, actual: ${e.byteLength})`)};F_.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,a=this._storageInfo[r];if(l(a))if(a.valueType!=="String"){r==="attributeByteCounts"&&(n=t);let s=k5(a.valueType);t+=s*this._header.count}else{if(!l(n))throw new ue(`Invalid attribute buffer (field: ${this.name}, attributeByteCounts is missing)`);for(let s=0;s<this._header.count&&t<e.byteLength;++s){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 JU=F_;function ZU(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(ZU.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});ZU.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var rLt=new d,aLt=new d,sLt=new d,cLt=new d,lLt=new d;function Gne(e,t,n,i){let o=d.subtract(i,n,rLt),r=d.cross(o,d.subtract(e,n,aLt),cLt),a=d.cross(o,d.subtract(t,n,sLt),lLt);return d.dot(r,a)>=0}var uLt=new d,fLt=new d,dLt=new d,hLt=new d,mLt=new d,pLt=new d,ALt=new d,gLt=new d,_Lt=new d,yLt=new d;ZU.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(l(this._customAttributes)&&l(this._customAttributes.positions)){let i=new d(e,t,n);i.x-=this._customAttributes.cartesianCenter.x,i.y-=this._customAttributes.cartesianCenter.y,i.z-=this._customAttributes.cartesianCenter.z,J.multiplyByVector(this._customAttributes.parentRotation,i,i);let o=Number.MAX_VALUE,r,a,s,c,u=this._customAttributes.positions,f=this._customAttributes.indices,h;l(f)?h=f.length:h=u.length/3;for(let p=0;p<h;p++){let A,m,_;l(f)?(A=f[p],m=f[p+1],_=f[p+2]):(A=p*3,m=p*3+1,_=p*3+2);let y=d.fromElements(u[A*3],u[A*3+1],u[A*3+2],uLt),C=d.fromElements(u[m*3],u[m*3+1],u[m*3+2],fLt),E=new d(u[_*3],u[_*3+1],u[_*3+2],dLt);if(!Gne(i,y,C,E)||!Gne(i,C,y,E)||!Gne(i,E,y,C))continue;let b=d.subtract(C,y,hLt),x=d.subtract(E,y,mLt),S=d.cross(b,x,pLt);if(d.magnitude(S)===0)continue;let B=d.normalize(S,ALt),v=d.subtract(i,y,gLt),P=Math.abs(d.dot(v,B));if(P<o){o=P,r=p;let N=d.magnitudeSquared(d.subtract(i,y,v)),L=d.magnitudeSquared(d.subtract(i,C,_Lt)),g=d.magnitudeSquared(d.subtract(i,E,yLt));N<L&&N<g?(s=A,c=y,a=N):L<g?(s=m,c=C,a=L):(s=_,c=E,a=g)}}if(l(r))return{index:s,distanceSquared:a,distance:Math.sqrt(a),queriedPosition:i,closestPosition:d.clone(c)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};function nve(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push(pI(e[i])):t.push(e[i]);return t}ZU.prototype._generateGltf=function(e,t,n,i,o,r,a,s){let c={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},u=!1,f,h="";if(l(this._parent._data.mesh)&&l(this._layer._data.materialDefinitions)){let b=this._parent._data.mesh.material.definition;if(b>=0&&b<this._layer._data.materialDefinitions.length){if(f=this._layer._data.materialDefinitions[b],c=f,l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorTexture)){u=!0,c.pbrMetallicRoughness.baseColorTexture.index=0;let x="0";if(l(this._layer._data.textureSetDefinitions))for(let S=0;S<this._layer._data.textureSetDefinitions.length;S++){let B=this._layer._data.textureSetDefinitions[S];for(let v=0;v<B.formats.length;v++){let P=B.formats[v];if(P.format==="jpg"){x=P.name;break}}}l(this._parent._data.mesh)&&this._parent._data.mesh.material.resource>=0&&(h=this._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.material.resource}/textures/${x}`}).url)}l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorFactor)&&(c.pbrMetallicRoughness.baseColorFactor=nve(c.pbrMetallicRoughness.baseColorFactor)),l(c.emissiveFactor)&&(c.emissiveFactor=nve(c.emissiveFactor))}}else l(this._parent._data.textureData)&&(u=!0,h=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=[],A=[],m=[];u&&(p=[{sampler:0,source:0}],A=[{uri:h}],m=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]);let _=[],y=n.length;for(let E=0;E<y;E++){let b=n[E].primitives,x=b.length;for(let S=0;S<x;S++){let B=b[S];if(l(B.material)){for(;B.material>=_.length;){let P=je(c,!0);_.push(P)}let v=_[B.material];l(B.extra)&&B.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:_,textures:p,images:A,samplers:m,asset:{version:"2.0"},extensions:a,extensionsUsed:s}};var TB=ZU;function yl(e,t,n){let i,o,r,a;n?(i=0,o=e):(i=e._level+1,o=e._layer),typeof t=="number"?r=t:a=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=a,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(yl.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}}});yl.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let o=e._create3DTileDefinition();e._tile=new Wd(e._layer._tileset,e._dataProvider.resource,o,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let o=await qm.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)&&l(e._parent.resource)&&(e._resource=e._parent.resource.getDerivedResource({url:i})),t()};function ive(e,t){let n=new JU(e,t);return e._fields[t.name]=n,n.load()}yl.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(ive(this,i))}return Promise.all(t)};yl.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 ive(this,o)}return Promise.resolve()};yl.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)};yl.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};yl.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 yl(e,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};yl.prototype._loadGeometryData=function(){let e=[];if(l(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new TB(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 TB(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};yl.prototype._loadFeatureData=function(){let e=[];if(l(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new XU(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};yl.prototype._clearGeometryData=function(){this._geometryData=[]};yl.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=me.fromDegrees(e.center[0],e.center[1],e.center[2]):n=me.fromDegrees(t[0],t[1],t[2]),l(this._dataProvider._geoidDataList)&&l(n))for(let C=0;C<this._dataProvider._geoidDataList.length;C++){let E=this._dataProvider._geoidDataList[C],b=E.projection.project(n);if(b.x>E.nativeExtent.west&&b.x<E.nativeExtent.east&&b.y>E.nativeExtent.south&&b.y<E.nativeExtent.north){n.height+=ILt(b.x,b.y,E);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=te.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},o=te.WGS84.cartographicToCartesian(n),r=this._data.mbs[3]),r*=2;let a=1/0;if(l(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let C=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));a=r/C}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let C=this._data.lodThreshold;a=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"&&(a=r/this._data.lodSelection[C].maxError);a===1/0&&(a=1e5);let s=a*16,c=new Ec(0,0,0),u=At.headingPitchRollQuaternion(o,c);l(this._data.obb)&&(u=new Qe(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let f=J.fromQuaternion(u),h=J.inverse(f,new J),p=new M(f[0],f[1],f[2],0,f[3],f[4],f[5],0,f[6],f[7],f[8],0,o.x,o.y,o.z,1),A=M.inverse(p,new M),m=M.clone(p);l(this._parent._globalTransform)&&M.multiply(p,this._parent._inverseGlobalTransform,m),this._globalTransform=p,this._inverseGlobalTransform=A,this._inverseRotationMatrix=h;let _=[];for(let C=0;C<this._children.length;C++)_.push(this._children[C]._create3DTileDefinition());return{children:_,refine:"REPLACE",boundingVolume:i,transform:[m[0],m[4],m[8],m[12],m[1],m[5],m[9],m[13],m[2],m[6],m[10],m[14],m[3],m[7],m[11],m[15]],content:{uri:l(this._resource)?this._resource.url:void 0},geometricError:s}};yl.prototype._loadSymbology=async function(){!l(this._symbologyData)&&l(this._layer._symbology)&&(this._symbologyData=await this._layer._symbology._getSymbology(this))};yl.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,a=this._geometryData[0],s=await KU.decode(o,r,a,this._featureData[0],this._symbologyData);if(!l(s))return;e=a._generateGltf(s.meshData.nodesInScene,s.meshData.nodes,s.meshData.meshes,s.meshData.buffers,s.meshData.bufferViews,s.meshData.accessors,s.meshData.rootExtensions,s.meshData.extensionsUsed),this._geometryData[0]._customAttributes=s.meshData._customAttributes}let n=this._dataProvider._binarizeGltf(e),i=new Blob([n],{type:"application/binary"});return URL.createObjectURL(i)};async function CLt(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 ELt(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 a=0;a<n.values.length;a++)if(n.values[a]===o){r=!0;break}return r}async function ove(e,t){let n=e._tile.content.batchTable;if(l(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await CLt(e);if(i.length>0)for(let o=0;o<n.featuresLength;o++)for(let r=0;r<i.length;r++){let a=i[r];if(!ELt(o,e._fields[a.name],a)){n.setShow(o,!1);break}}}t.show=!0}yl.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=ove(this,t);e.push(n)}return Promise.all(e)};Wd.prototype._hookedRequestContent=Wd.prototype.requestContent;Wd.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 De({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(()=>{ove(e._i3sNode,n)})),e._isLoading=!1,t})}};function bLt(e,t,n,i,o,r){let a=n*(1-e)+i*e,s=o*(1-e)+r*e;return a*(1-t)+s*t}function U5(e,t,n,i){let o=e+t*n;return i[o]}function ILt(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),a=Math.floor(o),s=Math.floor(r);o-=a,r-=s;let c=a<n.width?a+1:a,u=s<n.height?s+1:s;s=n.height-1-s,u=n.height-1-u;let f=U5(a,s,n.width,n.buffer),h=U5(c,s,n.width,n.buffer),p=U5(a,u,n.width,n.buffer),A=U5(c,u,n.width,n.buffer),m=bLt(o,r,f,h,p,A);return m=m*n.scale+n.offset,m}Object.defineProperties(Wd.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var SB=yl;function z5(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties(z5.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function Vne(e,t){let n=[];for(let i=0;i<e.length;i++){let o=z.byteToFloat(e[i]);i<3?n.push(pI(o)):n.push(o)}return n.length===3&&(l(t)?n.push(1-t/100):n.push(1)),n}function wB(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,a=o.outline;if(l(r)?(n.edges={},l(r.color)&&(n.edges.color=Vne(r.color,r.transparency))):l(a)&&(n.edges={},l(a.color)&&(n.edges.color=Vne(a.color,a.transparency))),!t){let s=o.material;l(s)&&(n.material={colorMixMode:s.colorMixMode},l(s.color)&&(n.material.color=Vne(s.color,s.transparency)))}break}}return n}function xLt(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 a=wB(o[r].symbol,t),s=o[r].values;for(let c=0;c<s.length;c++){let u=s[c],f=n;for(let h=0;h<u.length;h++){let p=u[h];h===u.length-1?f[p]=a:(l(f[p])||(f[p]={}),f=f[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]=wB(o.symbol,t)}return n}}function TLt(e,t){if(l(e.classBreakInfos)){let n=[...e.classBreakInfos];n.sort(function(o,r){let a=o.classMaxValue??o.classMinValue,s=r.classMaxValue??r.classMinValue;return a-s});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(wB(r.symbol,t)))}return i.symbols.push(void 0),i}}z5.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=wB(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=wB(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=xLt(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=wB(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=TLt(i,n))}};function rve(e,t,n,i){let o=t[n];if(i<o.length){let r=o[i],a=e[r];return l(a)&&++n<t.length?rve(a,t,n,i):a}}function SLt(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 wLt(e,t,n){let i=t[n],o=SLt(e.ranges,i);return e.symbols[o]}z5.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=>rve(this._uniqueValueHash,i,0,r):l(this._classBreaksHash)&&(o=r=>wLt(this._classBreaksHash,i[0],r)),l(o)){let r=i[0];for(let a=0;a<r.length;a++){let s=o(a);l(s)&&(t[a]=s)}}}return t};var $U=z5;function Ju(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 De({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(Ju.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}}});Ju.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 $U(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()};Ju.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],a=[],s=!1;if(l(r.compressedAttributes)&&e){s=!0;let c=r.compressedAttributes.attributes;for(let u=0;u<c.length;u++)a.push(c[u])}else for(let c in r)c!=="offset"&&a.push(c);n.push({compressed:s,attributes:a,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)}};Ju.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,a=o.attributes;for(let s=0;s<t.length;s++)if(!a.includes(t[s])){r=!0;break}if(!r)return{bufferIndex:o.index,definition:n,geometryBufferInfo:o}}if(l(n[0]))return{bufferIndex:0,definition:n,geometryBufferInfo:n[0]}}};Ju.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 SB(this,t,!0)}else this._rootNode=new SB(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};Ju.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]})};Ju._fetchJson=function(e){return e.fetchJson()};Ju.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=Ju._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]};Ju.prototype._computeExtent=function(){l(this._data.fullExtent)?this._extent=ce.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):l(this._data.store.extent)&&(this._extent=ce.fromDegrees(this._data.store.extent[0],this._data.store.extent[1],this._data.store.extent[2],this._data.store.extent[3]))};Ju.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)?je(e):{},e.outlineColor=z.fromCartesian4(ie.fromArray(o))),this._tileset=await es.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()})};Ju.prototype._updateVisibility=function(){l(this._tileset)&&(this._tileset.show=this._parent.show)};Ju.prototype.filterByAttributes=function(e){this._filters=l(e)?je(e,!0):[];let t=this._rootNode;return l(t)?t._filterFeatures():Promise.resolve()};var tx=Ju;function G5(e,t){this._dataProvider=e,this._resource=new De({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(G5.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}}});G5.prototype.load=async function(){return this._data=await qm.loadJson(this._resource),this._data};G5.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 ez=G5;function tz(e,t,n){this._dataProvider=e,this._parent=t,this._data=n,this._name=n.name,this._modelName=n.modelName,this._visibility=n.visibility??!0,this._resource=void 0,this._sublayers=[],this._i3sLayers=[]}Object.defineProperties(tz.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}}});tz._fromData=async function(e,t,n,i){let o=new tz(e,i,n);if(o._data.layerType==="group"){let r=o._data.sublayers;if(l(r)){let a=[];for(let c=0;c<r.length;c++){let u=tz._fromData(e,t,r[c],o);a.push(u)}let s=await Promise.all(a);for(let c=0;c<s.length;c++){let u=s[c];o._sublayers.push(u),o._i3sLayers.push(...u._i3sLayers)}}}else if(o._data.layerType==="3DObject"){let r=t.concat(`/sublayers/${o._data.id}`),a=new De({url:r});a.setQueryParameters(e.resource.queryParameters),a.appendForwardSlash(),o._resource=a;let s=await qm.loadJson(o._resource),c=new tx(e,s,o);o._i3sLayers.push(c)}else console.log(`${o._data.layerType} layer ${o._data.name} is skipped as not supported.`);return o};var nz=tz;var cve=Wr(ave(),1);function as(e){e=e??V.EMPTY_OBJECT,this._name=e.name,this._show=e.show??!0,this._geoidTiledTerrainProvider=e.geoidTiledTerrainProvider,this._showFeatures=e.showFeatures??!1,this._adjustMaterialAlphaMode=e.adjustMaterialAlphaMode??!1,this._applySymbology=e.applySymbology??!1,this._calculateNormals=e.calculateNormals??!1,this._cesium3dTilesetOptions=e.cesium3dTilesetOptions??V.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(as.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}}});as.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)l(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return fe(this)};as.prototype.isDestroyed=function(){return!1};as.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};as.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};as.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};as.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 BLt(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 sve(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=BLt(e,t.id);if(l(t.sublayers)){let o=[];for(let a=0;a<t.sublayers.length;a++){let s=nz._fromData(e,i,t.sublayers[a],e);o.push(s)}let r=await Promise.all(o);for(let a=0;a<r.length;a++){let s=r[a];e._sublayers.push(s),e._layers.push(...s._i3sLayers)}}if(l(t.statisticsHRef)){let o=i.concat(`/${t.statisticsHRef}`),r=new ez(e,o);await r.load(),e._attributeStatistics.push(r)}if(l(t.fullExtent)){let o=ce.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 tx(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.`)}as.fromUrl=async function(e,t){t=t??V.EMPTY_OBJECT;let n=De.createIfNeeded(e);n.setQueryParameters({f:"pjson"},!0);let i=await as.loadJson(n),o=new as(t);if(o._resource=n,o._data=i,l(i.layers)){let a=[];for(let s=0;s<i.layers.length;s++){let c=sve(o,i.layers[s],t);a.push(c)}await Promise.all(a)}else await sve(o,i,t);o._computeExtent();let r=[];for(let a=0;a<o._layers.length;a++)r.push(o._layers[a].load(t.cesium3dTilesetOptions));return await Promise.all(r),o};as._fetchJson=function(e){return e.fetchJson()};as.loadJson=async function(e){let t=await as._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};as.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};as.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 DLt=new k;function vLt(e,t){let n=e.tilingScheme,i=[],o={},r=e._lodCount,a=me.fromRadians(t.west,t.north),s=me.fromRadians(t.east,t.south),c=n.positionToTileXY(a,r),u=n.positionToTileXY(s,r);for(let h=c.x;h<=u.x;h++)for(let p=c.y;p<=u.y;p++){let A=k.fromElements(h,p,DLt),m=A.toString();if(!o.hasOwnProperty(m)){let _={x:A.x,y:A.y,level:r,tilingScheme:n,terrainProvider:e,positions:[]};o[m]=_,i.push(_)}}let f=[];for(let h=0;h<i.length;++h){let p=i[h],A=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);f.push(A)}return Promise.all(f).then(function(h){let p=[];for(let A=0;A<h.length;A++){let m={tilingScheme:n,x:i[A].x,y:i[A].y,level:i[A].level},_=h[A],y="Geographic";n._projection instanceof mi&&(y="WebMercator");let C={projectionType:y,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(m.x,m.y,m.level),height:_._height,width:_._width,scale:_._structure.heightScale,offset:_._structure.heightOffset};if(_._encoding===oh.LERC){let E=cve.default.decode(_._buffer);C.buffer=E.pixels[0]}else C.buffer=_._buffer;p.push(C)}return p})}async function PLt(e){let t=e._geoidTiledTerrainProvider;if(l(t))try{let n=await vLt(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}as.prototype.loadGeoidData=async function(){return l(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=PLt(this),this._geoidDataPromise)};as.prototype._computeExtent=function(){let e;for(let t=0;t<this._layersExtent.length;t++){let n=this._layersExtent[t];l(e)?ce.union(e,n,e):e=ce.clone(n)}this._extent=e};as.prototype.getAttributeNames=function(){let e=[];for(let t=0;t<this._attributeStatistics.length;++t)e.push(...this._attributeStatistics[t].names);return e};as.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[]};as.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 qm=as;var iz={};iz.createTilesetFromIModelId=async function({iModelId:e,changesetId:t,tilesetOptions:n}){let{exports:i}=await rs.getExports(e,t);if(i.length>0&&i.every(c=>c.status===rs.ExportStatus.Invalid))throw new ue(`All exports for this iModel are Invalid: ${e}`);let o=i.find(c=>c.status===rs.ExportStatus.Complete);if(!l(o))return;let r=new URL(o._links.mesh.href);r.pathname=`${r.pathname}/tileset.json`;let a=r.toString(),s=new De({url:a});return es.fromUrl(s,n)};iz.createTilesetForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i,tilesetOptions:o}){if(!l(n)||!l(i)){let c=await rs.getRealityDataMetadata(e,t);i=c.rootDocument,n=c.type}if(![rs.RealityDataType.Cesium3DTiles,rs.RealityDataType.PNTS,rs.RealityDataType.RealityMesh3DTiles,rs.RealityDataType.Terrain3DTiles,rs.RealityDataType.GaussianSplat3DTiles].includes(n))throw new ue(`Reality data type is not a mesh type: ${n}`);let a=await rs.getRealityDataURL(e,t,i),s={maximumScreenSpaceError:4,...o};return es.fromUrl(a,s)};iz.createDataSourceForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i}){if(!l(n)||!l(i)){let a=await rs.getRealityDataMetadata(e,t);i=a.rootDocument,n=a.type}if(![rs.RealityDataType.KML,rs.RealityDataType.GeoJSON].includes(n))throw new ue(`Reality data type is not a data source type: ${n}`);let r=await rs.getRealityDataURL(e,t,i);return n===rs.RealityDataType.GeoJSON?DC.load(r):nI.load(r)};iz.loadGeospatialFeatures=async function({iTwinId:e,collectionId:t,limit:n}){let i=n??1e4,o=`${rs.apiEndpoint}geospatial-features/itwins/${e}/ogc/collections/${t}/items`,r=new De({url:o,headers:{Authorization:rs._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{limit:i,client:"CesiumJS"}});return DC.load(r)};var Hne=iz;function lve(){}Object.defineProperties(lve.prototype,{color:{get:de.throwInstantiationError},intensity:{get:de.throwInstantiationError}});var Wne=lve;var RLt=/\/$/,uve=new Et('&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 BB(e){e=e??V.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=De.createIfNeeded(e.url??"https://api.mapbox.com/styles/v1/");this._styleId=t,this._accessToken=n;let o=e.tilesize??512;this._tilesize=o;let r=e.username??"mapbox";this._username=r;let a=l(e.scaleFactor)?"@2x":"",s=i.getUrlComponent();RLt.test(s)||(s+="/"),s+=`${this._username}/${t}/tiles/${this._tilesize}/{z}/{x}/{y}${a}`,i.url=s,i.setQueryParameters({access_token:n});let c;l(e.credit)?(c=e.credit,typeof c=="string"&&(c=new Et(c))):c=uve,this._resource=i,this._imageryProvider=new Aa({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(BB.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}}});BB.prototype.getTileCredits=function(e,t,n){};BB.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};BB.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};BB._defaultCredit=uve;var jne=BB;function Yne(e){}Yne.prototype.isReady=function(){return!0};Yne.prototype.shouldDiscardImage=function(e){return!1};var qne=Yne;var MLt=new Et("MapQuest, Open Street Map and contributors, CC-BY-SA");function H5(e){e=e??V.EMPTY_OBJECT;let t=De.createIfNeeded(e.url??"https://tile.openstreetmap.org/");t.appendForwardSlash(),t.url+=`{z}/{x}/{y}${e.retinaTiles?"@2x":""}.${e.fileExtension??"png"}`;let n=new Qa({ellipsoid:e.ellipsoid}),i=256,o=256,r=e.minimumLevel??0,a=e.maximumLevel,s=e.rectangle??n.rectangle,c=n.positionToTileXY(ce.southwest(s),r),u=n.positionToTileXY(ce.northeast(s),r),f=(Math.abs(u.x-c.x)+1)*(Math.abs(u.y-c.y)+1),h=e.credit??MLt;typeof h=="string"&&(h=new Et(h)),Aa.call(this,{url:t,credit:h,tilingScheme:n,tileWidth:i,tileHeight:o,minimumLevel:r,maximumLevel:a,rectangle:s})}l(Object.create)&&(H5.prototype=Object.create(Aa.prototype),H5.prototype.constructor=H5);var Q_=H5;function fve(){de.throwInstantiationError()}Object.defineProperties(fve.prototype,{show:{get:de.throwInstantiationError,set:de.throwInstantiationError},transform:{get:de.throwInstantiationError},credit:{get:de.throwInstantiationError}});var Kne=fve;function W5(){de.throwInstantiationError()}Object.defineProperties(W5.prototype,{});W5.fromUrl=function(e){de.throwInstantiationError()};W5.prototype.loadPanorama=function(e){de.throwInstantiationError()};var Xne=W5;var NLt=new k(1,1);function Jne(e){e=e??V.EMPTY_OBJECT,this.mass=e.mass??1,this.position=d.clone(e.position??d.ZERO),this.velocity=d.clone(e.velocity??d.ZERO),this.life=e.life??Number.MAX_VALUE,this.image=e.image,this.startColor=z.clone(e.startColor??z.WHITE),this.endColor=z.clone(e.endColor??z.WHITE),this.startScale=e.startScale??1,this.endScale=e.endScale??1,this.imageSize=k.clone(e.imageSize??NLt),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(Jne.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var dve=new d;Jne.prototype.update=function(e,t){return d.multiplyByScalar(this.velocity,e,dve),d.add(this.position,dve,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 DB=Jne;function hve(e){e=e??V.EMPTY_OBJECT,this.time=e.time??0,this.minimum=e.minimum??0,this.maximum=e.maximum??50,this._complete=!1}Object.defineProperties(hve.prototype,{complete:{get:function(){return this._complete}}});var Zne=hve;function mve(e){}mve.prototype.emit=function(e){de.throwInstantiationError()};var $ne=mve;var pve=new k(1,1);function oz(e){e=e??V.EMPTY_OBJECT,this.show=e.show??!0,this.updateCallback=e.updateCallback,this.loop=e.loop??!0,this.image=e.image??void 0;let t=e.emitter;l(t)||(t=new zU(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._emitterModelMatrix=M.clone(e.emitterModelMatrix??M.IDENTITY),this._matrixDirty=!0,this._combinedMatrix=new M,this._startColor=z.clone(e.color??e.startColor??z.WHITE),this._endColor=z.clone(e.color??e.endColor??z.WHITE),this._startScale=e.scale??e.startScale??1,this._endScale=e.scale??e.endScale??1,this._emissionRate=e.emissionRate??5,this._minimumSpeed=e.speed??e.minimumSpeed??1,this._maximumSpeed=e.speed??e.maximumSpeed??1,this._minimumParticleLife=e.particleLife??e.minimumParticleLife??5,this._maximumParticleLife=e.particleLife??e.maximumParticleLife??5,this._minimumMass=e.mass??e.minimumMass??1,this._maximumMass=e.mass??e.maximumMass??1,this._minimumImageSize=k.clone(e.imageSize??e.minimumImageSize??pve),this._maximumImageSize=k.clone(e.imageSize??e.maximumImageSize??pve),this._sizeInMeters=e.sizeInMeters??!1,this._lifetime=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 _e,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties(oz.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||!M.equals(this._modelMatrix,e),M.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!M.equals(this._emitterModelMatrix,e),M.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){z.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){z.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 LLt(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,o=e._bursts;if(l(o)){let h=o.length;for(let p=0;p<h;++p)i+=o[p].maximum}let r=e._billboardCollection,a=e.image,s=Math.ceil(t*n+i),c=e._particles,u=e._particlePool,f=Math.max(s-c.length-u.length,0);for(let h=0;h<f;++h){let p=new DB;p._billboard=r.add({image:a,show:!1}),u.push(p)}e._particleEstimate=s}function OLt(e){let t=e._particlePool.pop();return l(t)||(t=new DB),t}function FLt(e,t){e._particlePool.push(t)}function QLt(e){let t=e._particles,n=e._particlePool,i=e._billboardCollection,o=t.length,r=n.length,a=e._particleEstimate,s=r-Math.max(a-o-r,0);for(let c=s;c<r;++c){let u=n[c];i.remove(u._billboard)}n.length=s}function kLt(e){l(e._billboard)&&(e._billboard.show=!1)}function Ave(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=D.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),o=D.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),r=D.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),a=D.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new z(i,o,r,a),n.scale=D.lerp(t.startScale,t.endScale,t.normalizedAge)}function ULt(e,t){t.startColor=z.clone(e._startColor,t.startColor),t.endColor=z.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=D.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=D.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=D.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=D.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=D.randomBetween(e._minimumSpeed,e._maximumSpeed);d.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function zLt(e,t){if(e._isComplete)return 0;t=D.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 a=e.bursts[r],s=e._currentTime;l(a)&&!a._complete&&s>a.time&&(i+=D.randomBetween(a.minimum,a.maximum),a._complete=!0)}}return i}var j5=new d;oz.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new Sf),this._updateParticlePool&&(LLt(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=X.secondsDifference(e.time,this._previousTime)),t<0&&(t=0);let n=this._particles,i=this._emitter,o=this.updateCallback,r,a,s=n.length;for(r=0;r<s;++r)a=n[r],a.update(t,o)?Ave(this,a):(kLt(a),FLt(this,a),n[r]=n[s-1],--r,--s);n.length=s;let c=zLt(this,t);if(c>0&&l(i)){this._matrixDirty&&(this._combinedMatrix=M.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let u=this._combinedMatrix;for(r=0;r<c;r++)a=OLt(this),this._emitter.emit(a),d.add(a.position,a.velocity,j5),M.multiplyByPoint(u,j5,j5),a.position=M.multiplyByPoint(u,a.position,a.position),d.subtract(j5,a.position,a.velocity),d.normalize(a.velocity,a.velocity),ULt(this,a),Ave(this,a)}if(this._billboardCollection.update(e),this._previousTime=X.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=D.mod(this._currentTime,this._lifetime),this.bursts){let u=this.bursts.length;for(r=0;r<u;r++)this.bursts[r]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120===0&&QLt(this)};oz.prototype.isDestroyed=function(){return!1};oz.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),fe(this)};var eie=oz;function rd(){de.throwInstantiationError()}rd.computeDefaultLevelZeroMaximumGeometricError=function(e){return e.ellipsoid.maximumRadius*2*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))};Object.defineProperties(rd.prototype,{quadtree:{get:de.throwInstantiationError,set:de.throwInstantiationError},tilingScheme:{get:de.throwInstantiationError},errorEvent:{get:de.throwInstantiationError}});rd.prototype.update=de.throwInstantiationError;rd.prototype.beginUpdate=de.throwInstantiationError;rd.prototype.endUpdate=de.throwInstantiationError;rd.prototype.getLevelMaximumGeometricError=de.throwInstantiationError;rd.prototype.loadTile=de.throwInstantiationError;rd.prototype.computeTileVisibility=de.throwInstantiationError;rd.prototype.showTileThisFrame=de.throwInstantiationError;rd.prototype.computeDistanceToTile=de.throwInstantiationError;rd.prototype.isDestroyed=de.throwInstantiationError;rd.prototype.destroy=de.throwInstantiationError;var tie=rd;function nie(e){e=e??1,this._radius=e??1}Object.defineProperties(nie.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});nie.prototype.emit=function(e){let t=D.randomBetween(0,D.TWO_PI),n=D.randomBetween(0,D.PI),i=D.randomBetween(0,this._radius),o=i*Math.cos(t)*Math.sin(n),r=i*Math.sin(t)*Math.sin(n),a=i*Math.cos(n);e.position=d.fromElements(o,r,a,e.position),e.velocity=d.normalize(e.position,e.velocity)};var iie=nie;function rz(){}rz.prototype.evaluate=function(e,t){de.throwInstantiationError()};rz.prototype.evaluateColor=function(e,t){de.throwInstantiationError()};rz.prototype.getShaderFunction=function(e,t,n,i){de.throwInstantiationError()};rz.prototype.getVariables=function(){de.throwInstantiationError()};var oie=rz;function vB(e){this._ready=!1,this._provider=void 0,this._errorEvent=new _e,this._readyEvent=new _e,VLt(this,e)}Object.defineProperties(vB.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}}});vB.fromWorldTerrain=function(e){return new vB(sI(e))};vB.fromWorldBathymetry=function(e){return new vB(U2(e))};function GLt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function VLt(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){GLt(e._errorEvent,i)}}var az=vB;function PB(){}PB.prototype.boundingVolume=void 0;PB.prototype.boundingSphere=void 0;PB.prototype.distanceToCamera=function(e){de.throwInstantiationError()};PB.prototype.intersectPlane=function(e){de.throwInstantiationError()};PB.prototype.createDebugVolume=function(e){de.throwInstantiationError()};var rie=PB;function sz(e){e=e??V.EMPTY_OBJECT,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new qi({ellipsoid:e.ellipsoid}),this._color=e.color??z.YELLOW,this._errorEvent=new _e,this._tileWidth=e.tileWidth??256,this._tileHeight=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(sz.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}}});sz.prototype.getTileCredits=function(e,t,n){};sz.prototype.requestImage=function(e,t,n,i){let o=document.createElement("canvas");o.width=256,o.height=256;let r=o.getContext("2d"),a=this._color.toCssColorString();return r.strokeStyle=a,r.lineWidth=2,r.strokeRect(1,1,255,255),r.font="bold 25px Arial",r.textAlign="center",r.fillStyle=a,r.fillText(`L: ${n}`,124,86),r.fillText(`X: ${e}`,124,136),r.fillText(`Y: ${t}`,124,186),Promise.resolve(o)};sz.prototype.pickFeatures=function(e,t,n,i,o){};var cz=sz;function aie(e){de.throwInstantiationError()}aie.prototype.isReady=de.throwInstantiationError;aie.prototype.shouldDiscardImage=de.throwInstantiationError;var sie=aie;var HLt={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3},cie=Object.freeze(HLt);function Y5(e,t){this.show=!0,l(e)||(e=new et),this.rectangle=et.clone(e),l(t)||(t=Yi.fromType(Yi.ColorType,{color:new z(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}Y5.prototype.update=function(e){if(!this.show)return;let t=this._rs;if((!l(t)||!et.equals(t.viewport,this.rectangle))&&(this._rs=Ve.fromCache({blending:sn.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 We({sources:[this._material.shaderSource,xk]});this._overlayCommand=i.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=Be.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};Y5.prototype.isDestroyed=function(){return!1};Y5.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),fe(this)};var lie=Y5;function uie(){de.throwInstantiationError()}Object.defineProperties(uie.prototype,{globalTransform:{get:de.throwInstantiationError},shapeTransform:{get:de.throwInstantiationError},shape:{get:de.throwInstantiationError},minBounds:{get:de.throwInstantiationError},maxBounds:{get:de.throwInstantiationError},dimensions:{get:de.throwInstantiationError},paddingBefore:{get:de.throwInstantiationError},paddingAfter:{get:de.throwInstantiationError},names:{get:de.throwInstantiationError},types:{get:de.throwInstantiationError},componentTypes:{get:de.throwInstantiationError},minimumValues:{get:de.throwInstantiationError},maximumValues:{get:de.throwInstantiationError},maximumTileCount:{get:de.throwInstantiationError},availableLevels:{get:de.throwInstantiationError},keyframeCount:{get:de.throwInstantiationError},timeIntervalCollection:{get:de.throwInstantiationError}});uie.prototype.requestData=function(e){de.throwInstantiationError()};var fie=uie;function k_(){de.throwInstantiationError()}Object.defineProperties(k_.prototype,{orientedBoundingBox:{get:de.throwInstantiationError},boundingSphere:{get:de.throwInstantiationError},boundTransform:{get:de.throwInstantiationError},shapeTransform:{get:de.throwInstantiationError},shaderUniforms:{get:de.throwInstantiationError},shaderDefines:{get:de.throwInstantiationError},shaderMaximumIntersectionsLength:{get:de.throwInstantiationError}});k_.prototype.update=de.throwInstantiationError;k_.prototype.updateViewTransforms=de.throwInstantiationError;k_.prototype.convertLocalToShapeUvSpace=de.throwInstantiationError;k_.prototype.computeOrientedBoundingBoxForTile=de.throwInstantiationError;k_.prototype.computeOrientedBoundingBoxForSample=de.throwInstantiationError;k_.DefaultMinBounds=de.throwInstantiationError;k_.DefaultMaxBounds=de.throwInstantiationError;var die=k_;var hie=`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);
}
`;function WLt(e){e=e??V.EMPTY_OBJECT,this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=e.pixelFormat??qe.RGBA,this.pixelDatatype=e.pixelDatatype??He.UNSIGNED_BYTE;let t=e.url;typeof t=="string"&&(t=De.createIfNeeded(t)),this.resource=t;let i=e.repeat??!0?pn.REPEAT:pn.CLAMP_TO_EDGE;this.sampler=new jt({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var mie=WLt;var jLt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4"},pie=Object.freeze(jLt);var YLt={SIGX:"SIGX",SIGY:"SIGY",SIGZ:"SIGZ",VARX:"VARX",VARY:"VARY",VARZ:"VARZ",SIGR:"VARZ"},Aie=Object.freeze(YLt);function qLt(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 a=await e(i.parameters,o);r.result=a}catch(a){a instanceof Error?r.error={name:a.name,message:a.message,stack:a.stack}:r.error=a}i.canTransferArrayBuffer||(o.length=0);try{postMessage(r,o)}catch(a){r.result=void 0,r.error=`postMessage failed with error: ${Ip(a)}
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 gie=qLt;globalThis.CESIUM_VERSION="1.140.0";var lz;typeof ko<"u"&&(lz=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(a){a(t.ko={})})(function(a,s){function c(g,I){return g===null||typeof g in _?g===I:!1}function u(g,I){var T;return function(){T||(T=m.a.setTimeout(function(){T=e,g()},I))}}function f(g,I){var T;return function(){clearTimeout(T),T=m.a.setTimeout(g,I)}}function h(g,I){I&&I!=="change"?I==="beforeChange"?this.pc(g):this.gb(g,I):this.qc(g)}function p(g,I){I!==null&&I.s&&I.s()}function A(g,I){var T=this.qd,w=T[x];w.ra||(this.Qb&&this.mb[I]?(T.uc(I,g,this.mb[I]),this.mb[I]=null,--this.Qb):w.I[I]||T.uc(I,g,w.J?{da:g}:T.$c(g)),g.Ja&&g.gd())}var m=typeof a<"u"?a:{};m.b=function(g,I){for(var T=g.split("."),w=m,R=0;R<T.length-1;R++)w=w[T[R]];w[T[T.length-1]]=I},m.L=function(g,I,T){g[I]=T},m.version="3.5.1",m.b("version",m.version),m.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},m.a=(function(){function g(W,K){for(var Z in W)R.call(W,Z)&&K(Z,W[Z])}function I(W,K){if(K)for(var Z in K)R.call(K,Z)&&(W[Z]=K[Z]);return W}function T(W,K){return W.__proto__=K,W}function w(W,K,Z,pe){var ge=W[K].match(Y)||[];m.a.D(Z.match(Y),function(re){m.a.Na(ge,re,pe)}),W[K]=ge.join(" ")}var R=Object.prototype.hasOwnProperty,O={__proto__:[]}instanceof Array,G=typeof Symbol=="function",F={},U={};F[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],F.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),g(F,function(W,K){if(K.length)for(var Z=0,pe=K.length;Z<pe;Z++)U[K[Z]]=W});var Q={propertychange:!0},H=n&&(function(){for(var W=3,K=n.createElement("div"),Z=K.getElementsByTagName("i");K.innerHTML="<!--[if gt IE "+ ++W+"]><i></i><![endif]-->",Z[0];);return 4<W?W:e})(),Y=/\S+/g,$;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(W,K,Z){for(var pe=0,ge=W.length;pe<ge;pe++)K.call(Z,W[pe],pe,W)},A:typeof Array.prototype.indexOf=="function"?function(W,K){return Array.prototype.indexOf.call(W,K)}:function(W,K){for(var Z=0,pe=W.length;Z<pe;Z++)if(W[Z]===K)return Z;return-1},Lb:function(W,K,Z){for(var pe=0,ge=W.length;pe<ge;pe++)if(K.call(Z,W[pe],pe,W))return W[pe];return e},Pa:function(W,K){var Z=m.a.A(W,K);0<Z?W.splice(Z,1):Z===0&&W.shift()},wc:function(W){var K=[];return W&&m.a.D(W,function(Z){0>m.a.A(K,Z)&&K.push(Z)}),K},Mb:function(W,K,Z){var pe=[];if(W)for(var ge=0,re=W.length;ge<re;ge++)pe.push(K.call(Z,W[ge],ge));return pe},jb:function(W,K,Z){var pe=[];if(W)for(var ge=0,re=W.length;ge<re;ge++)K.call(Z,W[ge],ge)&&pe.push(W[ge]);return pe},Nb:function(W,K){if(K instanceof Array)W.push.apply(W,K);else for(var Z=0,pe=K.length;Z<pe;Z++)W.push(K[Z]);return W},Na:function(W,K,Z){var pe=m.a.A(m.a.bc(W),K);0>pe?Z&&W.push(K):Z||W.splice(pe,1)},Ba:O,extend:I,setPrototypeOf:T,Ab:O?T:I,P:g,Ga:function(W,K,Z){if(!W)return W;var pe={},ge;for(ge in W)R.call(W,ge)&&(pe[ge]=K.call(Z,W[ge],ge,W));return pe},Tb:function(W){for(;W.firstChild;)m.removeNode(W.firstChild)},Yb:function(W){W=m.a.la(W);for(var K=(W[0]&&W[0].ownerDocument||n).createElement("div"),Z=0,pe=W.length;Z<pe;Z++)K.appendChild(m.oa(W[Z]));return K},Ca:function(W,K){for(var Z=0,pe=W.length,ge=[];Z<pe;Z++){var re=W[Z].cloneNode(!0);ge.push(K?m.oa(re):re)}return ge},va:function(W,K){if(m.a.Tb(W),K)for(var Z=0,pe=K.length;Z<pe;Z++)W.appendChild(K[Z])},Xc:function(W,K){var Z=W.nodeType?[W]:W;if(0<Z.length){for(var pe=Z[0],ge=pe.parentNode,re=0,ye=K.length;re<ye;re++)ge.insertBefore(K[re],pe);for(re=0,ye=Z.length;re<ye;re++)m.removeNode(Z[re])}},Ua:function(W,K){if(W.length){for(K=K.nodeType===8&&K.parentNode||K;W.length&&W[0].parentNode!==K;)W.splice(0,1);for(;1<W.length&&W[W.length-1].parentNode!==K;)W.length--;if(1<W.length){var Z=W[0],pe=W[W.length-1];for(W.length=0;Z!==pe;)W.push(Z),Z=Z.nextSibling;W.push(pe)}}return W},Zc:function(W,K){7>H?W.setAttribute("selected",K):W.selected=K},Db:function(W){return W===null||W===e?"":W.trim?W.trim():W.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(W,K){return W=W||"",K.length>W.length?!1:W.substring(0,K.length)===K},vd:function(W,K){if(W===K)return!0;if(W.nodeType===11)return!1;if(K.contains)return K.contains(W.nodeType!==1?W.parentNode:W);if(K.compareDocumentPosition)return(K.compareDocumentPosition(W)&16)==16;for(;W&&W!=K;)W=W.parentNode;return!!W},Sb:function(W){return m.a.vd(W,W.ownerDocument.documentElement)},kd:function(W){return!!m.a.Lb(W,m.a.Sb)},R:function(W){return W&&W.tagName&&W.tagName.toLowerCase()},Ac:function(W){return m.onError?function(){try{return W.apply(this,arguments)}catch(K){throw m.onError&&m.onError(K),K}}:W},setTimeout:function(W,K){return setTimeout(m.a.Ac(W),K)},Gc:function(W){setTimeout(function(){throw m.onError&&m.onError(W),W},0)},B:function(W,K,Z){var pe=m.a.Ac(Z);if(Z=Q[K],m.options.useOnlyNativeEvents||Z||!o)if(Z||typeof W.addEventListener!="function")if(typeof W.attachEvent<"u"){var ge=function(ye){pe.call(W,ye)},re="on"+K;W.attachEvent(re,ge),m.a.K.za(W,function(){W.detachEvent(re,ge)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else W.addEventListener(K,pe,!1);else $||($=typeof o(W).on=="function"?"on":"bind"),o(W)[$](K,pe)},Fb:function(W,K){if(!W||!W.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var Z;if(m.a.R(W)==="input"&&W.type&&K.toLowerCase()=="click"?(Z=W.type,Z=Z=="checkbox"||Z=="radio"):Z=!1,m.options.useOnlyNativeEvents||!o||Z)if(typeof n.createEvent=="function")if(typeof W.dispatchEvent=="function")Z=n.createEvent(U[K]||"HTMLEvents"),Z.initEvent(K,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,W),W.dispatchEvent(Z);else throw Error("The supplied element doesn't support dispatchEvent");else if(Z&&W.click)W.click();else if(typeof W.fireEvent<"u")W.fireEvent("on"+K);else throw Error("Browser doesn't support triggering events");else o(W).trigger(K)},f:function(W){return m.O(W)?W():W},bc:function(W){return m.O(W)?W.v():W},Eb:function(W,K,Z){var pe;K&&(typeof W.classList=="object"?(pe=W.classList[Z?"add":"remove"],m.a.D(K.match(Y),function(ge){pe.call(W.classList,ge)})):typeof W.className.baseVal=="string"?w(W.className,"baseVal",K,Z):w(W,"className",K,Z))},Bb:function(W,K){var Z=m.a.f(K);(Z===null||Z===e)&&(Z="");var pe=m.h.firstChild(W);!pe||pe.nodeType!=3||m.h.nextSibling(pe)?m.h.va(W,[W.ownerDocument.createTextNode(Z)]):pe.data=Z,m.a.Ad(W)},Yc:function(W,K){if(W.name=K,7>=H)try{var Z=W.name.replace(/[&<>'"]/g,function(pe){return"&#"+pe.charCodeAt(0)+";"});W.mergeAttributes(n.createElement("<input name='"+Z+"'/>"),!1)}catch{}},Ad:function(W){9<=H&&(W=W.nodeType==1?W:W.parentNode,W.style&&(W.style.zoom=W.style.zoom))},wd:function(W){if(H){var K=W.style.width;W.style.width=0,W.style.width=K}},Pd:function(W,K){W=m.a.f(W),K=m.a.f(K);for(var Z=[],pe=W;pe<=K;pe++)Z.push(pe);return Z},la:function(W){for(var K=[],Z=0,pe=W.length;Z<pe;Z++)K.push(W[Z]);return K},Da:function(W){return G?Symbol(W):W},Zd:H===6,$d:H===7,W:H,Lc:function(W,K){for(var Z=m.a.la(W.getElementsByTagName("input")).concat(m.a.la(W.getElementsByTagName("textarea"))),pe=typeof K=="string"?function(ye){return ye.name===K}:function(ye){return K.test(ye.name)},ge=[],re=Z.length-1;0<=re;re--)pe(Z[re])&&ge.push(Z[re]);return ge},Nd:function(W){return typeof W=="string"&&(W=m.a.Db(W))?r&&r.parse?r.parse(W):new Function("return "+W)():null},hc:function(W,K,Z){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(m.a.f(W),K,Z)},Od:function(W,K,Z){Z=Z||{};var pe=Z.params||{},ge=Z.includeFields||this.Jc,re=W;if(typeof W=="object"&&m.a.R(W)==="form")for(var re=W.action,ye=ge.length-1;0<=ye;ye--)for(var Ce=m.a.Lc(W,ge[ye]),Pe=Ce.length-1;0<=Pe;Pe--)pe[Ce[Pe].name]=Ce[Pe].value;K=m.a.f(K);var Ne=n.createElement("form");Ne.style.display="none",Ne.action=re,Ne.method="post";for(var Le in K)W=n.createElement("input"),W.type="hidden",W.name=Le,W.value=m.a.hc(m.a.f(K[Le])),Ne.appendChild(W);g(pe,function(Oe,ot){var Fe=n.createElement("input");Fe.type="hidden",Fe.name=Oe,Fe.value=ot,Ne.appendChild(Fe)}),n.body.appendChild(Ne),Z.submitter?Z.submitter(Ne):Ne.submit(),setTimeout(function(){Ne.parentNode.removeChild(Ne)},0)}}})(),m.b("utils",m.a),m.b("utils.arrayForEach",m.a.D),m.b("utils.arrayFirst",m.a.Lb),m.b("utils.arrayFilter",m.a.jb),m.b("utils.arrayGetDistinctValues",m.a.wc),m.b("utils.arrayIndexOf",m.a.A),m.b("utils.arrayMap",m.a.Mb),m.b("utils.arrayPushAll",m.a.Nb),m.b("utils.arrayRemoveItem",m.a.Pa),m.b("utils.cloneNodes",m.a.Ca),m.b("utils.createSymbolOrString",m.a.Da),m.b("utils.extend",m.a.extend),m.b("utils.fieldsIncludedWithJsonPost",m.a.Jc),m.b("utils.getFormFields",m.a.Lc),m.b("utils.objectMap",m.a.Ga),m.b("utils.peekObservable",m.a.bc),m.b("utils.postJson",m.a.Od),m.b("utils.parseJson",m.a.Nd),m.b("utils.registerEventHandler",m.a.B),m.b("utils.stringifyJson",m.a.hc),m.b("utils.range",m.a.Pd),m.b("utils.toggleDomNodeCssClass",m.a.Eb),m.b("utils.triggerEvent",m.a.Fb),m.b("utils.unwrapObservable",m.a.f),m.b("utils.objectForEach",m.a.P),m.b("utils.addOrRemoveItem",m.a.Na),m.b("utils.setTextContent",m.a.Bb),m.b("unwrap",m.a.f),Function.prototype.bind||(Function.prototype.bind=function(g){var I=this;if(arguments.length===1)return function(){return I.apply(g,arguments)};var T=Array.prototype.slice.call(arguments,1);return function(){var w=T.slice(0);return w.push.apply(w,arguments),I.apply(g,w)}}),m.a.g=new function(){var g=0,I="__ko__"+new Date().getTime(),T={},w,R;return m.a.W?(w=function(O,G){var F=O[I];if(!F||F==="null"||!T[F]){if(!G)return e;F=O[I]="ko"+g++,T[F]={}}return T[F]},R=function(O){var G=O[I];return G?(delete T[G],O[I]=null,!0):!1}):(w=function(O,G){var F=O[I];return!F&&G&&(F=O[I]={}),F},R=function(O){return O[I]?(delete O[I],!0):!1}),{get:function(O,G){var F=w(O,!1);return F&&F[G]},set:function(O,G,F){(O=w(O,F!==e))&&(O[G]=F)},Ub:function(O,G,F){return O=w(O,!0),O[G]||(O[G]=F)},clear:R,Z:function(){return g+++I}}},m.b("utils.domData",m.a.g),m.b("utils.domData.clear",m.a.g.clear),m.a.K=new function(){function g(G,F){var U=m.a.g.get(G,w);return U===e&&F&&(U=[],m.a.g.set(G,w,U)),U}function I(G){var F=g(G,!1);if(F)for(var F=F.slice(0),U=0;U<F.length;U++)F[U](G);m.a.g.clear(G),m.a.K.cleanExternalData(G),O[G.nodeType]&&T(G.childNodes,!0)}function T(G,F){for(var U=[],Q,H=0;H<G.length;H++)if((!F||G[H].nodeType===8)&&(I(U[U.length]=Q=G[H]),G[H]!==Q))for(;H--&&m.a.A(U,G[H])==-1;);}var w=m.a.g.Z(),R={1:!0,8:!0,9:!0},O={1:!0,9:!0};return{za:function(G,F){if(typeof F!="function")throw Error("Callback must be a function");g(G,!0).push(F)},yb:function(G,F){var U=g(G,!1);U&&(m.a.Pa(U,F),U.length==0&&m.a.g.set(G,w,e))},oa:function(G){return m.u.G(function(){R[G.nodeType]&&(I(G),O[G.nodeType]&&T(G.getElementsByTagName("*")))}),G},removeNode:function(G){m.oa(G),G.parentNode&&G.parentNode.removeChild(G)},cleanExternalData:function(G){o&&typeof o.cleanData=="function"&&o.cleanData([G])}}},m.oa=m.a.K.oa,m.removeNode=m.a.K.removeNode,m.b("cleanNode",m.oa),m.b("removeNode",m.removeNode),m.b("utils.domNodeDisposal",m.a.K),m.b("utils.domNodeDisposal.addDisposeCallback",m.a.K.za),m.b("utils.domNodeDisposal.removeDisposeCallback",m.a.K.yb),(function(){var g=[0,"",""],I=[1,"<table>","</table>"],T=[3,"<table><tbody><tr>","</tr></tbody></table>"],w=[1,"<select multiple='multiple'>","</select>"],R={thead:I,tbody:I,tfoot:I,tr:[2,"<table><tbody>","</tbody></table>"],td:T,th:T,option:w,optgroup:w},O=8>=m.a.W;m.a.ua=function(G,F){var U;if(o){if(o.parseHTML)U=o.parseHTML(G,F)||[];else if((U=o.clean([G],F))&&U[0]){for(var Q=U[0];Q.parentNode&&Q.parentNode.nodeType!==11;)Q=Q.parentNode;Q.parentNode&&Q.parentNode.removeChild(Q)}}else{(U=F)||(U=n);var Q=U.parentWindow||U.defaultView||t,H=m.a.Db(G).toLowerCase(),Y=U.createElement("div"),$;for($=(H=H.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&R[H[1]]||g,H=$[0],$="ignored<div>"+$[1]+G+$[2]+"</div>",typeof Q.innerShiv=="function"?Y.appendChild(Q.innerShiv($)):(O&&U.body.appendChild(Y),Y.innerHTML=$,O&&Y.parentNode.removeChild(Y));H--;)Y=Y.lastChild;U=m.a.la(Y.lastChild.childNodes)}return U},m.a.Md=function(G,F){var U=m.a.ua(G,F);return U.length&&U[0].parentElement||m.a.Yb(U)},m.a.fc=function(G,F){if(m.a.Tb(G),F=m.a.f(F),F!==null&&F!==e)if(typeof F!="string"&&(F=F.toString()),o)o(G).html(F);else for(var U=m.a.ua(F,G.ownerDocument),Q=0;Q<U.length;Q++)G.appendChild(U[Q])}})(),m.b("utils.parseHtmlFragment",m.a.ua),m.b("utils.setHtml",m.a.fc),m.aa=(function(){function g(T,w){if(T){if(T.nodeType==8){var R=m.aa.Uc(T.nodeValue);R!=null&&w.push({ud:T,Kd:R})}else if(T.nodeType==1)for(var R=0,O=T.childNodes,G=O.length;R<G;R++)g(O[R],w)}}var I={};return{Xb:function(T){if(typeof T!="function")throw Error("You can only pass a function to ko.memoization.memoize()");var w=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return I[w]=T,"<!--[ko_memo:"+w+"]-->"},bd:function(T,w){var R=I[T];if(R===e)throw Error("Couldn't find any memo with ID "+T+". Perhaps it's already been unmemoized.");try{return R.apply(null,w||[]),!0}finally{delete I[T]}},cd:function(T,w){var R=[];g(T,R);for(var O=0,G=R.length;O<G;O++){var F=R[O].ud,U=[F];w&&m.a.Nb(U,w),m.aa.bd(R[O].Kd,U),F.nodeValue="",F.parentNode&&F.parentNode.removeChild(F)}},Uc:function(T){return(T=T.match(/^\[ko_memo\:(.*?)\]$/))?T[1]:null}}})(),m.b("memoization",m.aa),m.b("memoization.memoize",m.aa.Xb),m.b("memoization.unmemoize",m.aa.bd),m.b("memoization.parseMemoText",m.aa.Uc),m.b("memoization.unmemoizeDomNodeAndDescendants",m.aa.cd),m.na=(function(){function g(){if(R){for(var F=R,U=0,Q;G<R;)if(Q=w[G++]){if(G>F){if(5e3<=++U){G=R,m.a.Gc(Error("'Too much recursion' after processing "+U+" task groups."));break}F=R}try{Q()}catch(H){m.a.Gc(H)}}}}function I(){g(),G=R=w.length=0}var T,w=[],R=0,O=1,G=0;return t.MutationObserver?T=(function(F){var U=n.createElement("div");return new MutationObserver(F).observe(U,{attributes:!0}),function(){U.classList.toggle("foo")}})(I):T=n&&"onreadystatechange"in n.createElement("script")?function(F){var U=n.createElement("script");U.onreadystatechange=function(){U.onreadystatechange=null,n.documentElement.removeChild(U),U=null,F()},n.documentElement.appendChild(U)}:function(F){setTimeout(F,0)},{scheduler:T,zb:function(F){return R||m.na.scheduler(I),w[R++]=F,O++},cancel:function(F){F=F-(O-R),F>=G&&F<R&&(w[F]=null)},resetForTesting:function(){var F=R-G;return G=R=w.length=0,F},Sd:g}})(),m.b("tasks",m.na),m.b("tasks.schedule",m.na.zb),m.b("tasks.runEarly",m.na.Sd),m.Ta={throttle:function(g,I){g.throttleEvaluation=I;var T=null;return m.$({read:g,write:function(w){clearTimeout(T),T=m.a.setTimeout(function(){g(w)},I)}})},rateLimit:function(g,I){var T,w,R;typeof I=="number"?T=I:(T=I.timeout,w=I.method),g.Hb=!1,R=typeof w=="function"?w:w=="notifyWhenChangesStop"?f:u,g.ub(function(O){return R(O,T,I)})},deferred:function(g,I){if(I!==!0)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");g.Hb||(g.Hb=!0,g.ub(function(T){var w,R=!1;return function(){if(!R){m.na.cancel(w),w=m.na.zb(T);try{R=!0,g.notifySubscribers(e,"dirty")}finally{R=!1}}}}))},notify:function(g,I){g.equalityComparer=I=="always"?null:c}};var _={undefined:1,boolean:1,number:1,string:1};m.b("extenders",m.Ta),m.ic=function(g,I,T){this.da=g,this.lc=I,this.mc=T,this.Ib=!1,this.fb=this.Jb=null,m.L(this,"dispose",this.s),m.L(this,"disposeWhenNodeIsRemoved",this.l)},m.ic.prototype.s=function(){this.Ib||(this.fb&&m.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},m.ic.prototype.l=function(g){this.Jb=g,m.a.K.za(g,this.fb=this.s.bind(this))},m.T=function(){m.a.Ab(this,y),y.qb(this)};var y={qb:function(g){g.U={change:[]},g.sc=1},subscribe:function(g,I,T){var w=this;T=T||"change";var R=new m.ic(w,I?g.bind(I):g,function(){m.a.Pa(w.U[T],R),w.hb&&w.hb(T)});return w.Qa&&w.Qa(T),w.U[T]||(w.U[T]=[]),w.U[T].push(R),R},notifySubscribers:function(g,I){if(I=I||"change",I==="change"&&this.Gb(),this.Wa(I)){var T=I==="change"&&this.ed||this.U[I].slice(0);try{m.u.xc();for(var w=0,R;R=T[w];++w)R.Ib||R.lc(g)}finally{m.u.end()}}},ob:function(){return this.sc},Dd:function(g){return this.ob()!==g},Gb:function(){++this.sc},ub:function(g){var I=this,T=m.O(I),w,R,O,G,F;I.gb||(I.gb=I.notifySubscribers,I.notifySubscribers=h);var U=g(function(){I.Ja=!1,T&&G===I&&(G=I.nc?I.nc():I());var Q=R||F&&I.sb(O,G);F=R=w=!1,Q&&I.gb(O=G)});I.qc=function(Q,H){H&&I.Ja||(F=!H),I.ed=I.U.change.slice(0),I.Ja=w=!0,G=Q,U()},I.pc=function(Q){w||(O=Q,I.gb(Q,"beforeChange"))},I.rc=function(){F=!0},I.gd=function(){I.sb(O,I.v(!0))&&(R=!0)}},Wa:function(g){return this.U[g]&&this.U[g].length},Bd:function(g){if(g)return this.U[g]&&this.U[g].length||0;var I=0;return m.a.P(this.U,function(T,w){T!=="dirty"&&(I+=w.length)}),I},sb:function(g,I){return!this.equalityComparer||!this.equalityComparer(g,I)},toString:function(){return"[object Object]"},extend:function(g){var I=this;return g&&m.a.P(g,function(T,w){var R=m.Ta[T];typeof R=="function"&&(I=R(I,w)||I)}),I}};m.L(y,"init",y.qb),m.L(y,"subscribe",y.subscribe),m.L(y,"extend",y.extend),m.L(y,"getSubscriptionsCount",y.Bd),m.a.Ba&&m.a.setPrototypeOf(y,Function.prototype),m.T.fn=y,m.Qc=function(g){return g!=null&&typeof g.subscribe=="function"&&typeof g.notifySubscribers=="function"},m.b("subscribable",m.T),m.b("isSubscribable",m.Qc),m.S=m.u=(function(){function g(O){T.push(w),w=O}function I(){w=T.pop()}var T=[],w,R=0;return{xc:g,end:I,cc:function(O){if(w){if(!m.Qc(O))throw Error("Only subscribable things can act as dependencies");w.od.call(w.pd,O,O.fd||(O.fd=++R))}},G:function(O,G,F){try{return g(),O.apply(G,F||[])}finally{I()}},qa:function(){if(w)return w.o.qa()},Va:function(){if(w)return w.o.Va()},Ya:function(){if(w)return w.Ya},o:function(){if(w)return w.o}}})(),m.b("computedContext",m.S),m.b("computedContext.getDependenciesCount",m.S.qa),m.b("computedContext.getDependencies",m.S.Va),m.b("computedContext.isInitial",m.S.Ya),m.b("computedContext.registerDependency",m.S.cc),m.b("ignoreDependencies",m.Yd=m.u.G);var C=m.a.Da("_latestValue");m.ta=function(g){function I(){return 0<arguments.length?(I.sb(I[C],arguments[0])&&(I.ya(),I[C]=arguments[0],I.xa()),this):(m.u.cc(I),I[C])}return I[C]=g,m.a.Ba||m.a.extend(I,m.T.fn),m.T.fn.qb(I),m.a.Ab(I,E),m.options.deferUpdates&&m.Ta.deferred(I,!0),I};var E={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")}};m.a.Ba&&m.a.setPrototypeOf(E,m.T.fn);var b=m.ta.Ma="__ko_proto__";E[b]=m.ta,m.O=function(g){if((g=typeof g=="function"&&g[b])&&g!==E[b]&&g!==m.o.fn[b])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!g},m.Za=function(g){return typeof g=="function"&&(g[b]===E[b]||g[b]===m.o.fn[b]&&g.Nc)},m.b("observable",m.ta),m.b("isObservable",m.O),m.b("isWriteableObservable",m.Za),m.b("isWritableObservable",m.Za),m.b("observable.fn",E),m.L(E,"peek",E.v),m.L(E,"valueHasMutated",E.xa),m.L(E,"valueWillMutate",E.ya),m.Ha=function(g){if(g=g||[],typeof g!="object"||!("length"in g))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return g=m.ta(g),m.a.Ab(g,m.Ha.fn),g.extend({trackArrayChanges:!0})},m.Ha.fn={remove:function(g){for(var I=this.v(),T=[],w=typeof g!="function"||m.O(g)?function(G){return G===g}:g,R=0;R<I.length;R++){var O=I[R];if(w(O)){if(T.length===0&&this.ya(),I[R]!==O)throw Error("Array modified during remove; cannot remove item");T.push(O),I.splice(R,1),R--}}return T.length&&this.xa(),T},removeAll:function(g){if(g===e){var I=this.v(),T=I.slice(0);return this.ya(),I.splice(0,I.length),this.xa(),T}return g?this.remove(function(w){return 0<=m.a.A(g,w)}):[]},destroy:function(g){var I=this.v(),T=typeof g!="function"||m.O(g)?function(O){return O===g}:g;this.ya();for(var w=I.length-1;0<=w;w--){var R=I[w];T(R)&&(R._destroy=!0)}this.xa()},destroyAll:function(g){return g===e?this.destroy(function(){return!0}):g?this.destroy(function(I){return 0<=m.a.A(g,I)}):[]},indexOf:function(g){var I=this();return m.a.A(I,g)},replace:function(g,I){var T=this.indexOf(g);0<=T&&(this.ya(),this.v()[T]=I,this.xa())},sorted:function(g){var I=this().slice(0);return g?I.sort(g):I.sort()},reversed:function(){return this().slice(0).reverse()}},m.a.Ba&&m.a.setPrototypeOf(m.Ha.fn,m.ta.fn),m.a.D("pop push reverse shift sort splice unshift".split(" "),function(g){m.Ha.fn[g]=function(){var I=this.v();this.ya(),this.zc(I,g,arguments);var T=I[g].apply(I,arguments);return this.xa(),T===I?this:T}}),m.a.D(["slice"],function(g){m.Ha.fn[g]=function(){var I=this();return I[g].apply(I,arguments)}}),m.Pc=function(g){return m.O(g)&&typeof g.remove=="function"&&typeof g.push=="function"},m.b("observableArray",m.Ha),m.b("isObservableArray",m.Pc),m.Ta.trackArrayChanges=function(g,I){function T(){function Y(){if(F){var $=[].concat(g.v()||[]),W;g.Wa("arrayChange")&&((!R||1<F)&&(R=m.a.Pb(U,$,g.Ob)),W=R),U=$,R=null,F=0,W&&W.length&&g.notifySubscribers(W,"arrayChange")}}w?Y():(w=!0,G=g.subscribe(function(){++F},null,"spectate"),U=[].concat(g.v()||[]),R=null,O=g.subscribe(Y))}if(g.Ob={},I&&typeof I=="object"&&m.a.extend(g.Ob,I),g.Ob.sparse=!0,!g.zc){var w=!1,R=null,O,G,F=0,U,Q=g.Qa,H=g.hb;g.Qa=function(Y){Q&&Q.call(g,Y),Y==="arrayChange"&&T()},g.hb=function(Y){H&&H.call(g,Y),Y!=="arrayChange"||g.Wa("arrayChange")||(O&&O.s(),G&&G.s(),G=O=null,w=!1,U=e)},g.zc=function(Y,$,W){function K(Ne,Le,Oe){return Z[Z.length]={status:Ne,value:Le,index:Oe}}if(w&&!F){var Z=[],pe=Y.length,ge=W.length,re=0;switch($){case"push":re=pe;case"unshift":for($=0;$<ge;$++)K("added",W[$],re+$);break;case"pop":re=pe-1;case"shift":pe&&K("deleted",Y[re],re);break;case"splice":$=Math.min(Math.max(0,0>W[0]?pe+W[0]:W[0]),pe);for(var pe=ge===1?pe:Math.min($+(W[1]||0),pe),ge=$+ge-2,re=Math.max(pe,ge),ye=[],Ce=[],Pe=2;$<re;++$,++Pe)$<pe&&Ce.push(K("deleted",Y[$],$)),$<ge&&ye.push(K("added",W[Pe],$));m.a.Kc(Ce,ye);break;default:return}R=Z}}}};var x=m.a.Da("_state");m.o=m.$=function(g,I,T){function w(){if(0<arguments.length){if(typeof R=="function")R.apply(O.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 O.ra||m.u.cc(w),(O.ka||O.J&&w.Xa())&&w.ha(),O.X}if(typeof g=="object"?T=g:(T=T||{},g&&(T.read=g)),typeof T.read!="function")throw Error("Pass a function that returns the value of the ko.computed");var R=T.write,O={X:e,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:T.read,nb:I||T.owner,l:T.disposeWhenNodeIsRemoved||T.l||null,Sa:T.disposeWhen||T.Sa,Rb:null,I:{},V:0,Ic:null};return w[x]=O,w.Nc=typeof R=="function",m.a.Ba||m.a.extend(w,m.T.fn),m.T.fn.qb(w),m.a.Ab(w,S),T.pure?(O.wb=!0,O.J=!0,m.a.extend(w,B)):T.deferEvaluation&&m.a.extend(w,v),m.options.deferUpdates&&m.Ta.deferred(w,!0),O.l&&(O.jc=!0,O.l.nodeType||(O.l=null)),O.J||T.deferEvaluation||w.ha(),O.l&&w.ja()&&m.a.K.za(O.l,O.Rb=function(){w.s()}),w};var S={equalityComparer:c,qa:function(){return this[x].V},Va:function(){var g=[];return m.a.P(this[x].I,function(I,T){g[T.Ka]=T.da}),g},Vb:function(g){if(!this[x].V)return!1;var I=this.Va();return m.a.A(I,g)!==-1?!0:!!m.a.Lb(I,function(T){return T.Vb&&T.Vb(g)})},uc:function(g,I,T){if(this[x].wb&&I===this)throw Error("A 'pure' computed must not be called recursively");this[x].I[g]=T,T.Ka=this[x].V++,T.La=I.ob()},Xa:function(){var g,I,T=this[x].I;for(g in T)if(Object.prototype.hasOwnProperty.call(T,g)&&(I=T[g],this.Ia&&I.da.Ja||I.da.Dd(I.La)))return!0},Jd:function(){this.Ia&&!this[x].rb&&this.Ia(!1)},ja:function(){var g=this[x];return g.ka||0<g.V},Rd:function(){this.Ja?this[x].ka&&(this[x].sa=!0):this.Hc()},$c:function(g){if(g.Hb){var I=g.subscribe(this.Jd,this,"dirty"),T=g.subscribe(this.Rd,this);return{da:g,s:function(){I.s(),T.s()}}}return g.subscribe(this.Hc,this)},Hc:function(){var g=this,I=g.throttleEvaluation;I&&0<=I?(clearTimeout(this[x].Ic),this[x].Ic=m.a.setTimeout(function(){g.ha(!0)},I)):g.Ia?g.Ia(!0):g.ha(!0)},ha:function(g){var I=this[x],T=I.Sa,w=!1;if(!I.rb&&!I.ra){if(I.l&&!m.a.Sb(I.l)||T&&T()){if(!I.jc){this.s();return}}else I.jc=!1;I.rb=!0;try{w=this.zd(g)}finally{I.rb=!1}return w}},zd:function(g){var I=this[x],w=!1,T=I.wb?e:!I.V,w={qd:this,mb:I.I,Qb:I.V};m.u.xc({pd:w,od:A,o:this,Ya:T}),I.I={},I.V=0;var R=this.yd(I,w);return I.V?w=this.sb(I.X,R):(this.s(),w=!0),w&&(I.J?this.Gb():this.notifySubscribers(I.X,"beforeChange"),I.X=R,this.notifySubscribers(I.X,"spectate"),!I.J&&g&&this.notifySubscribers(I.X),this.rc&&this.rc()),T&&this.notifySubscribers(I.X,"awake"),w},yd:function(g,I){try{var T=g.Wc;return g.nb?T.call(g.nb):T()}finally{m.u.end(),I.Qb&&!g.J&&m.a.P(I.mb,p),g.sa=g.ka=!1}},v:function(g){var I=this[x];return(I.ka&&(g||!I.V)||I.J&&this.Xa())&&this.ha(),I.X},ub:function(g){m.T.fn.ub.call(this,g),this.nc=function(){return this[x].J||(this[x].sa?this.ha():this[x].ka=!1),this[x].X},this.Ia=function(I){this.pc(this[x].X),this[x].ka=!0,I&&(this[x].sa=!0),this.qc(this,!I)}},s:function(){var g=this[x];!g.J&&g.I&&m.a.P(g.I,function(I,T){T.s&&T.s()}),g.l&&g.Rb&&m.a.K.yb(g.l,g.Rb),g.I=e,g.V=0,g.ra=!0,g.sa=!1,g.ka=!1,g.J=!1,g.l=e,g.Sa=e,g.Wc=e,this.Nc||(g.nb=e)}},B={Qa:function(g){var I=this,T=I[x];if(!T.ra&&T.J&&g=="change"){if(T.J=!1,T.sa||I.Xa())T.I=null,T.V=0,I.ha()&&I.Gb();else{var w=[];m.a.P(T.I,function(R,O){w[O.Ka]=R}),m.a.D(w,function(R,O){var G=T.I[R],F=I.$c(G.da);F.Ka=O,F.La=G.La,T.I[R]=F}),I.Xa()&&I.ha()&&I.Gb()}T.ra||I.notifySubscribers(T.X,"awake")}},hb:function(g){var I=this[x];I.ra||g!="change"||this.Wa("change")||(m.a.P(I.I,function(T,w){w.s&&(I.I[T]={da:w.da,Ka:w.Ka,La:w.La},w.s())}),I.J=!0,this.notifySubscribers(e,"asleep"))},ob:function(){var g=this[x];return g.J&&(g.sa||this.Xa())&&this.ha(),m.T.fn.ob.call(this)}},v={Qa:function(g){g!="change"&&g!="beforeChange"||this.v()}};m.a.Ba&&m.a.setPrototypeOf(S,m.T.fn);var P=m.ta.Ma;S[P]=m.o,m.Oc=function(g){return typeof g=="function"&&g[P]===S[P]},m.Fd=function(g){return m.Oc(g)&&g[x]&&g[x].wb},m.b("computed",m.o),m.b("dependentObservable",m.o),m.b("isComputed",m.Oc),m.b("isPureComputed",m.Fd),m.b("computed.fn",S),m.L(S,"peek",S.v),m.L(S,"dispose",S.s),m.L(S,"isActive",S.ja),m.L(S,"getDependenciesCount",S.qa),m.L(S,"getDependencies",S.Va),m.xb=function(g,I){return typeof g=="function"?m.o(g,I,{pure:!0}):(g=m.a.extend({},g),g.pure=!0,m.o(g,I))},m.b("pureComputed",m.xb),(function(){function g(w,R,O){if(O=O||new T,w=R(w),typeof w!="object"||w===null||w===e||w instanceof RegExp||w instanceof Date||w instanceof String||w instanceof Number||w instanceof Boolean)return w;var G=w instanceof Array?[]:{};return O.save(w,G),I(w,function(F){var U=R(w[F]);switch(typeof U){case"boolean":case"number":case"string":case"function":G[F]=U;break;case"object":case"undefined":var Q=O.get(U);G[F]=Q!==e?Q:g(U,R,O)}}),G}function I(w,R){if(w instanceof Array){for(var O=0;O<w.length;O++)R(O);typeof w.toJSON=="function"&&R("toJSON")}else for(O in w)R(O)}function T(){this.keys=[],this.values=[]}m.ad=function(w){if(arguments.length==0)throw Error("When calling ko.toJS, pass the object you want to convert.");return g(w,function(R){for(var O=0;m.O(R)&&10>O;O++)R=R();return R})},m.toJSON=function(w,R,O){return w=m.ad(w),m.a.hc(w,R,O)},T.prototype={constructor:T,save:function(w,R){var O=m.a.A(this.keys,w);0<=O?this.values[O]=R:(this.keys.push(w),this.values.push(R))},get:function(w){return w=m.a.A(this.keys,w),0<=w?this.values[w]:e}}})(),m.b("toJS",m.ad),m.b("toJSON",m.toJSON),m.Wd=function(g,I,T){function w(R){var O=m.xb(g,T).extend({ma:"always"}),G=O.subscribe(function(F){F&&(G.s(),R(F))});return O.notifySubscribers(O.v()),G}return typeof Promise!="function"||I?w(I.bind(T)):new Promise(w)},m.b("when",m.Wd),(function(){m.w={M:function(g){switch(m.a.R(g)){case"option":return g.__ko__hasDomDataOptionValue__===!0?m.a.g.get(g,m.c.options.$b):7>=m.a.W?g.getAttributeNode("value")&&g.getAttributeNode("value").specified?g.value:g.text:g.value;case"select":return 0<=g.selectedIndex?m.w.M(g.options[g.selectedIndex]):e;default:return g.value}},cb:function(g,I,T){switch(m.a.R(g)){case"option":typeof I=="string"?(m.a.g.set(g,m.c.options.$b,e),"__ko__hasDomDataOptionValue__"in g&&delete g.__ko__hasDomDataOptionValue__,g.value=I):(m.a.g.set(g,m.c.options.$b,I),g.__ko__hasDomDataOptionValue__=!0,g.value=typeof I=="number"?I:"");break;case"select":(I===""||I===null)&&(I=e);for(var w=-1,R=0,O=g.options.length,G;R<O;++R)if(G=m.w.M(g.options[R]),G==I||G===""&&I===e){w=R;break}(T||0<=w||I===e&&1<g.size)&&(g.selectedIndex=w,m.a.W===6&&m.a.setTimeout(function(){g.selectedIndex=w},0));break;default:(I===null||I===e)&&(I=""),g.value=I}}}})(),m.b("selectExtensions",m.w),m.b("selectExtensions.readValue",m.w.M),m.b("selectExtensions.writeValue",m.w.cb),m.m=(function(){function g(F){F=m.a.Db(F),F.charCodeAt(0)===123&&(F=F.slice(1,-1)),F+=`
,`;var U=[],Q=F.match(w),H,Y=[],$=0;if(1<Q.length){for(var W=0,K;K=Q[W];++W){var Z=K.charCodeAt(0);if(Z===44){if(0>=$){U.push(H&&Y.length?{key:H,value:Y.join("")}:{unknown:H||Y.join("")}),H=$=0,Y=[];continue}}else if(Z===58){if(!$&&!H&&Y.length===1){H=Y.pop();continue}}else{if(Z===47&&1<K.length&&(K.charCodeAt(1)===47||K.charCodeAt(1)===42))continue;Z===47&&W&&1<K.length?(Z=Q[W-1].match(R))&&!O[Z[0]]&&(F=F.substr(F.indexOf(K)+1),Q=F.match(w),W=-1,K="/"):Z===40||Z===123||Z===91?++$:Z===41||Z===125||Z===93?--$:H||Y.length||Z!==34&&Z!==39||(K=K.slice(1,-1))}Y.push(K)}if(0<$)throw Error("Unbalanced parentheses, braces, or brackets")}return U}var I=["true","false","null","undefined"],T=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,w=RegExp(`"(?:\\\\.|[^"])*"|'(?:\\\\.|[^'])*'|\`(?:\\\\.|[^\`])*\`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.*
|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),R=/[\])"'A-Za-z0-9_$]+$/,O={in:1,return:1,typeof:1},G={};return{Ra:[],wa:G,ac:g,vb:function(F,U){function Q(Z,pe){var ge;if(!W){var re=m.getBindingHandler(Z);if(re&&re.preprocess&&!(pe=re.preprocess(pe,Z,Q)))return;(re=G[Z])&&(ge=pe,0<=m.a.A(I,ge)?ge=!1:(re=ge.match(T),ge=re===null?!1:re[1]?"Object("+re[1]+")"+re[2]:ge),re=ge),re&&Y.push("'"+(typeof G[Z]=="string"?G[Z]:Z)+"':function(_z){"+ge+"=_z}")}$&&(pe="function(){return "+pe+" }"),H.push("'"+Z+"':"+pe)}U=U||{};var H=[],Y=[],$=U.valueAccessors,W=U.bindingParams,K=typeof F=="string"?g(F):F;return m.a.D(K,function(Z){Q(Z.key||Z.unknown,Z.value)}),Y.length&&Q("_ko_property_writers","{"+Y.join(",")+" }"),H.join(",")},Id:function(F,U){for(var Q=0;Q<F.length;Q++)if(F[Q].key==U)return!0;return!1},eb:function(F,U,Q,H,Y){F&&m.O(F)?!m.Za(F)||Y&&F.v()===H||F(H):(F=U.get("_ko_property_writers"))&&F[Q]&&F[Q](H)}}})(),m.b("expressionRewriting",m.m),m.b("expressionRewriting.bindingRewriteValidators",m.m.Ra),m.b("expressionRewriting.parseObjectLiteral",m.m.ac),m.b("expressionRewriting.preProcessBindings",m.m.vb),m.b("expressionRewriting._twoWayBindings",m.m.wa),m.b("jsonExpressionRewriting",m.m),m.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",m.m.vb),(function(){function g(Q){return Q.nodeType==8&&O.test(R?Q.text:Q.nodeValue)}function I(Q){return Q.nodeType==8&&G.test(R?Q.text:Q.nodeValue)}function T(Q,H){for(var Y=Q,$=1,W=[];Y=Y.nextSibling;){if(I(Y)&&(m.a.g.set(Y,U,!0),$--,$===0))return W;W.push(Y),g(Y)&&$++}if(!H)throw Error("Cannot find closing comment tag to match: "+Q.nodeValue);return null}function w(Q,H){var Y=T(Q,H);return Y?0<Y.length?Y[Y.length-1].nextSibling:Q.nextSibling:null}var R=n&&n.createComment("test").text==="<!--test-->",O=R?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,G=R?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,F={ul:!0,ol:!0},U="__ko_matchedEndComment__";m.h={ea:{},childNodes:function(Q){return g(Q)?T(Q):Q.childNodes},Ea:function(Q){if(g(Q)){Q=m.h.childNodes(Q);for(var H=0,Y=Q.length;H<Y;H++)m.removeNode(Q[H])}else m.a.Tb(Q)},va:function(Q,H){if(g(Q)){m.h.Ea(Q);for(var Y=Q.nextSibling,$=0,W=H.length;$<W;$++)Y.parentNode.insertBefore(H[$],Y)}else m.a.va(Q,H)},Vc:function(Q,H){var Y;g(Q)?(Y=Q.nextSibling,Q=Q.parentNode):Y=Q.firstChild,Y?H!==Y&&Q.insertBefore(H,Y):Q.appendChild(H)},Wb:function(Q,H,Y){Y?(Y=Y.nextSibling,g(Q)&&(Q=Q.parentNode),Y?H!==Y&&Q.insertBefore(H,Y):Q.appendChild(H)):m.h.Vc(Q,H)},firstChild:function(Q){if(g(Q))return!Q.nextSibling||I(Q.nextSibling)?null:Q.nextSibling;if(Q.firstChild&&I(Q.firstChild))throw Error("Found invalid end comment, as the first child of "+Q);return Q.firstChild},nextSibling:function(Q){if(g(Q)&&(Q=w(Q)),Q.nextSibling&&I(Q.nextSibling)){var H=Q.nextSibling;if(I(H)&&!m.a.g.get(H,U))throw Error("Found end comment without a matching opening comment, as child of "+Q);return null}return Q.nextSibling},Cd:g,Vd:function(Q){return(Q=(R?Q.text:Q.nodeValue).match(O))?Q[1]:null},Sc:function(Q){if(F[m.a.R(Q)]){var H=Q.firstChild;if(H)do if(H.nodeType===1){var Y;Y=H.firstChild;var $=null;if(Y)do if($)$.push(Y);else if(g(Y)){var W=w(Y,!0);W?Y=W:$=[Y]}else I(Y)&&($=[Y]);while(Y=Y.nextSibling);if(Y=$)for($=H.nextSibling,W=0;W<Y.length;W++)$?Q.insertBefore(Y[W],$):Q.appendChild(Y[W])}while(H=H.nextSibling)}}}})(),m.b("virtualElements",m.h),m.b("virtualElements.allowedBindings",m.h.ea),m.b("virtualElements.emptyNode",m.h.Ea),m.b("virtualElements.insertAfter",m.h.Wb),m.b("virtualElements.prepend",m.h.Vc),m.b("virtualElements.setDomNodeChildren",m.h.va),(function(){m.ga=function(){this.nd={}},m.a.extend(m.ga.prototype,{nodeHasBindings:function(g){switch(g.nodeType){case 1:return g.getAttribute("data-bind")!=null||m.j.getComponentNameForNode(g);case 8:return m.h.Cd(g);default:return!1}},getBindings:function(g,I){var T=this.getBindingsString(g,I),T=T?this.parseBindingsString(T,I,g):null;return m.j.tc(T,g,I,!1)},getBindingAccessors:function(g,I){var T=this.getBindingsString(g,I),T=T?this.parseBindingsString(T,I,g,{valueAccessors:!0}):null;return m.j.tc(T,g,I,!0)},getBindingsString:function(g){switch(g.nodeType){case 1:return g.getAttribute("data-bind");case 8:return m.h.Vd(g);default:return null}},parseBindingsString:function(g,I,T,w){try{var R=this.nd,O=g+(w&&w.valueAccessors||""),G;if(!(G=R[O])){var F,U="with($context){with($data||{}){return{"+m.m.vb(g,w)+"}}}";F=new Function("$context","$element",U),G=R[O]=F}return G(I,T)}catch(Q){throw Q.message=`Unable to parse bindings.
Bindings value: `+g+`
Message: `+Q.message,Q}}}),m.ga.instance=new m.ga})(),m.b("bindingProvider",m.ga),(function(){function g(re){var ye=(re=m.a.g.get(re,ge))&&re.N;ye&&(re.N=null,ye.Tc())}function I(re,ye,Ce){this.node=re,this.yc=ye,this.kb=[],this.H=!1,ye.N||m.a.K.za(re,g),Ce&&Ce.N&&(Ce.N.kb.push(re),this.Kb=Ce)}function T(re){return function(){return re}}function w(re){return re()}function R(re){return m.a.Ga(m.u.G(re),function(ye,Ce){return function(){return re()[Ce]}})}function O(re,ye,Ce){return typeof re=="function"?R(re.bind(null,ye,Ce)):m.a.Ga(re,T)}function G(re,ye){return R(this.getBindings.bind(this,re,ye))}function F(re,ye){var Ce=m.h.firstChild(ye);if(Ce){var Pe,Ne=m.ga.instance,Le=Ne.preprocessNode;if(Le){for(;Pe=Ce;)Ce=m.h.nextSibling(Pe),Le.call(Ne,Pe);Ce=m.h.firstChild(ye)}for(;Pe=Ce;)Ce=m.h.nextSibling(Pe),U(re,Pe)}m.i.ma(ye,m.i.H)}function U(re,ye){var Ce=re,Pe=ye.nodeType===1;Pe&&m.h.Sc(ye),(Pe||m.ga.instance.nodeHasBindings(ye))&&(Ce=H(ye,null,re).bindingContextForDescendants),Ce&&!Z[m.a.R(ye)]&&F(Ce,ye)}function Q(re){var ye=[],Ce={},Pe=[];return m.a.P(re,function Ne(Le){if(!Ce[Le]){var Oe=m.getBindingHandler(Le);Oe&&(Oe.after&&(Pe.push(Le),m.a.D(Oe.after,function(ot){if(re[ot]){if(m.a.A(Pe,ot)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+Pe.join(", "));Ne(ot)}}),Pe.length--),ye.push({key:Le,Mc:Oe})),Ce[Le]=!0}}),ye}function H(re,ye,Ce){var Pe=m.a.g.Ub(re,ge,{}),Ne=Pe.hd;if(!ye){if(Ne)throw Error("You cannot apply bindings multiple times to the same element.");Pe.hd=!0}Ne||(Pe.context=Ce),Pe.Zb||(Pe.Zb={});var Le;if(ye&&typeof ye!="function")Le=ye;else{var Oe=m.ga.instance,ot=Oe.getBindingAccessors||G,Fe=m.$(function(){return(Le=ye?ye(Ce,re):ot.call(Oe,re,Ce))&&(Ce[$]&&Ce[$](),Ce[K]&&Ce[K]()),Le},null,{l:re});Le&&Fe.ja()||(Fe=null)}var _t=Ce,rt;if(Le){var Ye=function(){return m.a.Ga(Fe?Fe():Le,w)},st=Fe?function(ft){return function(){return w(Fe()[ft])}}:function(ft){return Le[ft]};Ye.get=function(ft){return Le[ft]&&w(st(ft))},Ye.has=function(ft){return ft in Le},m.i.H in Le&&m.i.subscribe(re,m.i.H,function(){var ft=(0,Le[m.i.H])();if(ft){var St=m.h.childNodes(re);St.length&&ft(St,m.Ec(St[0]))}}),m.i.pa in Le&&(_t=m.i.Cb(re,Ce),m.i.subscribe(re,m.i.pa,function(){var ft=(0,Le[m.i.pa])();ft&&m.h.firstChild(re)&&ft(re)})),Pe=Q(Le),m.a.D(Pe,function(ft){var St=ft.Mc.init,Ie=ft.Mc.update,Se=ft.key;if(re.nodeType===8&&!m.h.ea[Se])throw Error("The binding '"+Se+"' cannot be used with virtual elements");try{typeof St=="function"&&m.u.G(function(){var Kt=St(re,st(Se),Ye,_t.$data,_t);if(Kt&&Kt.controlsDescendantBindings){if(rt!==e)throw Error("Multiple bindings ("+rt+" and "+Se+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");rt=Se}}),typeof Ie=="function"&&m.$(function(){Ie(re,st(Se),Ye,_t.$data,_t)},null,{l:re})}catch(Kt){throw Kt.message='Unable to process binding "'+Se+": "+Le[Se]+`"
Message: `+Kt.message,Kt}})}return Pe=rt===e,{shouldBindDescendants:Pe,bindingContextForDescendants:Pe&&_t}}function Y(re,ye){return re&&re instanceof m.fa?re:new m.fa(re,e,e,ye)}var $=m.a.Da("_subscribable"),W=m.a.Da("_ancestorBindingInfo"),K=m.a.Da("_dataDependency");m.c={};var Z={script:!0,textarea:!0,template:!0};m.getBindingHandler=function(re){return m.c[re]};var pe={};m.fa=function(re,ye,Ce,Pe,Ne){function Le(){var st=_t?Fe():Fe,ft=m.a.f(st);return ye?(m.a.extend(Oe,ye),W in ye&&(Oe[W]=ye[W])):(Oe.$parents=[],Oe.$root=ft,Oe.ko=m),Oe[$]=rt,ot?ft=Oe.$data:(Oe.$rawData=st,Oe.$data=ft),Ce&&(Oe[Ce]=ft),Pe&&Pe(Oe,ye,ft),ye&&ye[$]&&!m.S.o().Vb(ye[$])&&ye[$](),Ye&&(Oe[K]=Ye),Oe.$data}var Oe=this,ot=re===pe,Fe=ot?e:re,_t=typeof Fe=="function"&&!m.O(Fe),rt,Ye=Ne&&Ne.dataDependency;Ne&&Ne.exportDependencies?Le():(rt=m.xb(Le),rt.v(),rt.ja()?rt.equalityComparer=null:Oe[$]=e)},m.fa.prototype.createChildContext=function(re,ye,Ce,Pe){if(!Pe&&ye&&typeof ye=="object"&&(Pe=ye,ye=Pe.as,Ce=Pe.extend),ye&&Pe&&Pe.noChildContext){var Ne=typeof re=="function"&&!m.O(re);return new m.fa(pe,this,null,function(Le){Ce&&Ce(Le),Le[ye]=Ne?re():re},Pe)}return new m.fa(re,this,ye,function(Le,Oe){Le.$parentContext=Oe,Le.$parent=Oe.$data,Le.$parents=(Oe.$parents||[]).slice(0),Le.$parents.unshift(Le.$parent),Ce&&Ce(Le)},Pe)},m.fa.prototype.extend=function(re,ye){return new m.fa(pe,this,null,function(Ce){m.a.extend(Ce,typeof re=="function"?re(Ce):re)},ye)};var ge=m.a.g.Z();I.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},I.prototype.sd=function(re){m.a.Pa(this.kb,re),!this.kb.length&&this.H&&this.Cc()},I.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,m.a.K.yb(this.node,g),m.i.ma(this.node,m.i.pa),this.Tc())},m.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(re,ye,Ce,Pe,Ne){var Le=m.a.g.Ub(re,ge,{});return Le.Fa||(Le.Fa=new m.T),Ne&&Ne.notifyImmediately&&Le.Zb[ye]&&m.u.G(Ce,Pe,[re]),Le.Fa.subscribe(Ce,Pe,ye)},ma:function(re,ye){var Ce=m.a.g.get(re,ge);if(Ce&&(Ce.Zb[ye]=!0,Ce.Fa&&Ce.Fa.notifySubscribers(re,ye),ye==m.i.H)){if(Ce.N)Ce.N.Cc();else if(Ce.N===e&&Ce.Fa&&Ce.Fa.Wa(m.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(re,ye){var Ce=m.a.g.Ub(re,ge,{});return Ce.N||(Ce.N=new I(re,Ce,ye[W])),ye[W]==Ce?ye:ye.extend(function(Pe){Pe[W]=Ce})}},m.Td=function(re){return(re=m.a.g.get(re,ge))&&re.context},m.ib=function(re,ye,Ce){return re.nodeType===1&&m.h.Sc(re),H(re,ye,Y(Ce))},m.ld=function(re,ye,Ce){return Ce=Y(Ce),m.ib(re,O(ye,Ce,re),Ce)},m.Oa=function(re,ye){ye.nodeType!==1&&ye.nodeType!==8||F(Y(re),ye)},m.vc=function(re,ye,Ce){if(!o&&t.jQuery&&(o=t.jQuery),2>arguments.length){if(ye=n.body,!ye)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!ye||ye.nodeType!==1&&ye.nodeType!==8)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");U(Y(re,Ce),ye)},m.Dc=function(re){return!re||re.nodeType!==1&&re.nodeType!==8?e:m.Td(re)},m.Ec=function(re){return(re=m.Dc(re))?re.$data:e},m.b("bindingHandlers",m.c),m.b("bindingEvent",m.i),m.b("bindingEvent.subscribe",m.i.subscribe),m.b("bindingEvent.startPossiblyAsyncContentBinding",m.i.Cb),m.b("applyBindings",m.vc),m.b("applyBindingsToDescendants",m.Oa),m.b("applyBindingAccessorsToNode",m.ib),m.b("applyBindingsToNode",m.ld),m.b("contextFor",m.Dc),m.b("dataFor",m.Ec)})(),(function(g){function I(G,F){var U=Object.prototype.hasOwnProperty.call(R,G)?R[G]:g,Q;U?U.subscribe(F):(U=R[G]=new m.T,U.subscribe(F),T(G,function(H,Y){var $=!(!Y||!Y.synchronous);O[G]={definition:H,Gd:$},delete R[G],Q||$?U.notifySubscribers(H):m.na.zb(function(){U.notifySubscribers(H)})}),Q=!0)}function T(G,F){w("getConfig",[G],function(U){U?w("loadComponent",[G,U],function(Q){F(Q,U)}):F(null,null)})}function w(G,F,U,Q){Q||(Q=m.j.loaders.slice(0));var H=Q.shift();if(H){var Y=H[G];if(Y){var $=!1;if(Y.apply(H,F.concat(function(W){$?U(null):W!==null?U(W):w(G,F,U,Q)}))!==g&&($=!0,!H.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else w(G,F,U,Q)}else U(null)}var R={},O={};m.j={get:function(G,F){var U=Object.prototype.hasOwnProperty.call(O,G)?O[G]:g;U?U.Gd?m.u.G(function(){F(U.definition)}):m.na.zb(function(){F(U.definition)}):I(G,F)},Bc:function(G){delete O[G]},oc:w},m.j.loaders=[],m.b("components",m.j),m.b("components.get",m.j.get),m.b("components.clearCachedDefinition",m.j.Bc)})(),(function(){function g(U,Q,H,Y){function $(){--K===0&&Y(W)}var W={},K=2,Z=H.template;H=H.viewModel,Z?R(Q,Z,function(pe){m.j.oc("loadTemplate",[U,pe],function(ge){W.template=ge,$()})}):$(),H?R(Q,H,function(pe){m.j.oc("loadViewModel",[U,pe],function(ge){W[F]=ge,$()})}):$()}function I(U,Q,H){if(typeof Q=="function")H(function($){return new Q($)});else if(typeof Q[F]=="function")H(Q[F]);else if("instance"in Q){var Y=Q.instance;H(function(){return Y})}else"viewModel"in Q?I(U,Q.viewModel,H):U("Unknown viewModel value: "+Q)}function T(U){switch(m.a.R(U)){case"script":return m.a.ua(U.text);case"textarea":return m.a.ua(U.value);case"template":if(w(U.content))return m.a.Ca(U.content.childNodes)}return m.a.Ca(U.childNodes)}function w(U){return t.DocumentFragment?U instanceof DocumentFragment:U&&U.nodeType===11}function R(U,Q,H){typeof Q.require=="string"?s||t.require?(s||t.require)([Q.require],function(Y){Y&&typeof Y=="object"&&Y.Xd&&Y.default&&(Y=Y.default),H(Y)}):U("Uses require, but no AMD loader is present"):H(Q)}function O(U){return function(Q){throw Error("Component '"+U+"': "+Q)}}var G={};m.j.register=function(U,Q){if(!Q)throw Error("Invalid configuration for "+U);if(m.j.tb(U))throw Error("Component "+U+" is already registered");G[U]=Q},m.j.tb=function(U){return Object.prototype.hasOwnProperty.call(G,U)},m.j.unregister=function(U){delete G[U],m.j.Bc(U)},m.j.Fc={getConfig:function(U,Q){Q(m.j.tb(U)?G[U]:null)},loadComponent:function(U,Q,H){var Y=O(U);R(Y,Q,function($){g(U,Y,$,H)})},loadTemplate:function(U,Q,H){if(U=O(U),typeof Q=="string")H(m.a.ua(Q));else if(Q instanceof Array)H(Q);else if(w(Q))H(m.a.la(Q.childNodes));else if(Q.element)if(Q=Q.element,t.HTMLElement?Q instanceof HTMLElement:Q&&Q.tagName&&Q.nodeType===1)H(T(Q));else if(typeof Q=="string"){var Y=n.getElementById(Q);Y?H(T(Y)):U("Cannot find element with ID "+Q)}else U("Unknown element type: "+Q);else U("Unknown template value: "+Q)},loadViewModel:function(U,Q,H){I(O(U),Q,H)}};var F="createViewModel";m.b("components.register",m.j.register),m.b("components.isRegistered",m.j.tb),m.b("components.unregister",m.j.unregister),m.b("components.defaultLoader",m.j.Fc),m.j.loaders.push(m.j.Fc),m.j.dd=G})(),(function(){function g(T,w){var R=T.getAttribute("params");if(R){var R=I.parseBindingsString(R,w,T,{valueAccessors:!0,bindingParams:!0}),R=m.a.Ga(R,function(F){return m.o(F,null,{l:T})}),O=m.a.Ga(R,function(F){var U=F.v();return F.ja()?m.o({read:function(){return m.a.f(F())},write:m.Za(U)&&function(Q){F()(Q)},l:T}):U});return Object.prototype.hasOwnProperty.call(O,"$raw")||(O.$raw=R),O}return{$raw:{}}}m.j.getComponentNameForNode=function(T){var w=m.a.R(T);if(m.j.tb(w)&&(w.indexOf("-")!=-1||""+T=="[object HTMLUnknownElement]"||8>=m.a.W&&T.tagName===w))return w},m.j.tc=function(T,w,R,O){if(w.nodeType===1){var G=m.j.getComponentNameForNode(w);if(G){if(T=T||{},T.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var F={name:G,params:g(w,R)};T.component=O?function(){return F}:F}}return T};var I=new m.ga;9>m.a.W&&(m.j.register=(function(T){return function(w){return T.apply(this,arguments)}})(m.j.register),n.createDocumentFragment=(function(T){return function(){var w=T(),R=m.j.dd,O;for(O in R);return w}})(n.createDocumentFragment))})(),(function(){function g(w,R,O){if(R=R.template,!R)throw Error("Component '"+w+"' has no template");w=m.a.Ca(R),m.h.va(O,w)}function I(w,R,O){var G=w.createViewModel;return G?G.call(w,R,O):R}var T=0;m.c.component={init:function(w,R,O,G,F){function U(){var W=Q&&Q.dispose;typeof W=="function"&&W.call(Q),Y&&Y.s(),H=Q=Y=null}var Q,H,Y,$=m.a.la(m.h.childNodes(w));return m.h.Ea(w),m.a.K.za(w,U),m.o(function(){var W=m.a.f(R()),K,Z;if(typeof W=="string"?K=W:(K=m.a.f(W.name),Z=m.a.f(W.params)),!K)throw Error("No component name specified");var pe=m.i.Cb(w,F),ge=H=++T;m.j.get(K,function(re){if(H===ge){if(U(),!re)throw Error("Unknown component '"+K+"'");g(K,re,w);var ye=I(re,Z,{element:w,templateNodes:$});re=pe.createChildContext(ye,{extend:function(Ce){Ce.$component=ye,Ce.$componentTemplateNodes=$}}),ye&&ye.koDescendantsComplete&&(Y=m.i.subscribe(w,m.i.pa,ye.koDescendantsComplete,ye)),Q=ye,m.Oa(re,w)}})},null,{l:w}),{controlsDescendantBindings:!0}}},m.h.ea.component=!0})();var N={class:"className",for:"htmlFor"};m.c.attr={update:function(g,I){var T=m.a.f(I())||{};m.a.P(T,function(w,R){R=m.a.f(R);var O=w.indexOf(":"),O="lookupNamespaceURI"in g&&0<O&&g.lookupNamespaceURI(w.substr(0,O)),G=R===!1||R===null||R===e;G?O?g.removeAttributeNS(O,w):g.removeAttribute(w):R=R.toString(),8>=m.a.W&&w in N?(w=N[w],G?g.removeAttribute(w):g[w]=R):G||(O?g.setAttributeNS(O,w,R):g.setAttribute(w,R)),w==="name"&&m.a.Yc(g,G?"":R)})}},(function(){m.c.checked={after:["value","attr"],init:function(g,I,T){function w(){var W=g.checked,K=O();if(!m.S.Ya()&&(W||!F&&!m.S.qa())){var Z=m.u.G(I);if(Q){var pe=H?Z.v():Z,ge=$;$=K,ge!==K?W&&(m.a.Na(pe,K,!0),m.a.Na(pe,ge,!1)):m.a.Na(pe,K,W),H&&m.Za(Z)&&Z(pe)}else G&&(K===e?K=W:W||(K=e)),m.m.eb(Z,T,"checked",K,!0)}}function R(){var W=m.a.f(I()),K=O();Q?(g.checked=0<=m.a.A(W,K),$=K):g.checked=G&&K===e?!!W:O()===W}var O=m.xb(function(){if(T.has("checkedValue"))return m.a.f(T.get("checkedValue"));if(Y)return T.has("value")?m.a.f(T.get("value")):g.value}),G=g.type=="checkbox",F=g.type=="radio";if(G||F){var U=I(),Q=G&&m.a.f(U)instanceof Array,H=!(Q&&U.push&&U.splice),Y=F||Q,$=Q?O():e;F&&!g.name&&m.c.uniqueName.init(g,function(){return!0}),m.o(w,null,{l:g}),m.a.B(g,"click",w),m.o(R,null,{l:g}),U=e}}},m.m.wa.checked=!0,m.c.checkedValue={update:function(g,I){g.value=m.a.f(I())}}})(),m.c.class={update:function(g,I){var T=m.a.Db(m.a.f(I()));m.a.Eb(g,g.__ko__cssValue,!1),g.__ko__cssValue=T,m.a.Eb(g,T,!0)}},m.c.css={update:function(g,I){var T=m.a.f(I());T!==null&&typeof T=="object"?m.a.P(T,function(w,R){R=m.a.f(R),m.a.Eb(g,w,R)}):m.c.class.update(g,I)}},m.c.enable={update:function(g,I){var T=m.a.f(I());T&&g.disabled?g.removeAttribute("disabled"):T||g.disabled||(g.disabled=!0)}},m.c.disable={update:function(g,I){m.c.enable.update(g,function(){return!m.a.f(I())})}},m.c.event={init:function(g,I,T,w,R){var O=I()||{};m.a.P(O,function(G){typeof G=="string"&&m.a.B(g,G,function(F){var U,Q=I()[G];if(Q){try{var H=m.a.la(arguments);w=R.$data,H.unshift(w),U=Q.apply(w,H)}finally{U!==!0&&(F.preventDefault?F.preventDefault():F.returnValue=!1)}T.get(G+"Bubble")===!1&&(F.cancelBubble=!0,F.stopPropagation&&F.stopPropagation())}})})}},m.c.foreach={Rc:function(g){return function(){var I=g(),T=m.a.bc(I);return!T||typeof T.length=="number"?{foreach:I,templateEngine:m.ba.Ma}:(m.a.f(I),{foreach:T.data,as:T.as,noChildContext:T.noChildContext,includeDestroyed:T.includeDestroyed,afterAdd:T.afterAdd,beforeRemove:T.beforeRemove,afterRender:T.afterRender,beforeMove:T.beforeMove,afterMove:T.afterMove,templateEngine:m.ba.Ma})}},init:function(g,I){return m.c.template.init(g,m.c.foreach.Rc(I))},update:function(g,I,T,w,R){return m.c.template.update(g,m.c.foreach.Rc(I),T,w,R)}},m.m.Ra.foreach=!1,m.h.ea.foreach=!0,m.c.hasfocus={init:function(g,I,T){function w(G){g.__ko_hasfocusUpdating=!0;var F=g.ownerDocument;if("activeElement"in F){var U;try{U=F.activeElement}catch{U=F.body}G=U===g}F=I(),m.m.eb(F,T,"hasfocus",G,!0),g.__ko_hasfocusLastValue=G,g.__ko_hasfocusUpdating=!1}var R=w.bind(null,!0),O=w.bind(null,!1);m.a.B(g,"focus",R),m.a.B(g,"focusin",R),m.a.B(g,"blur",O),m.a.B(g,"focusout",O),g.__ko_hasfocusLastValue=!1},update:function(g,I){var T=!!m.a.f(I());g.__ko_hasfocusUpdating||g.__ko_hasfocusLastValue===T||(T?g.focus():g.blur(),!T&&g.__ko_hasfocusLastValue&&g.ownerDocument.body.focus(),m.u.G(m.a.Fb,null,[g,T?"focusin":"focusout"]))}},m.m.wa.hasfocus=!0,m.c.hasFocus=m.c.hasfocus,m.m.wa.hasFocus="hasfocus",m.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(g,I){m.a.fc(g,I())}},(function(){function g(I,T,w){m.c[I]={init:function(R,O,G,F,U){var Q,H,Y={},$,W,K;if(T){F=G.get("as");var Z=G.get("noChildContext");K=!(F&&Z),Y={as:F,noChildContext:Z,exportDependencies:K}}return W=($=G.get("completeOn")=="render")||G.has(m.i.pa),m.o(function(){var pe=m.a.f(O()),ge=!w!=!pe,re=!H,ye;(K||ge!==Q)&&(W&&(U=m.i.Cb(R,U)),ge&&((!T||K)&&(Y.dataDependency=m.S.o()),ye=T?U.createChildContext(typeof pe=="function"?pe:O,Y):m.S.qa()?U.extend(null,Y):U),re&&m.S.qa()&&(H=m.a.Ca(m.h.childNodes(R),!0)),ge?(re||m.h.va(R,m.a.Ca(H)),m.Oa(ye,R)):(m.h.Ea(R),$||m.i.ma(R,m.i.H)),Q=ge)},null,{l:R}),{controlsDescendantBindings:!0}}},m.m.Ra[I]=!1,m.h.ea[I]=!0}g("if"),g("ifnot",!1,!0),g("with",!0)})(),m.c.let={init:function(g,I,T,w,R){return I=R.extend(I),m.Oa(I,g),{controlsDescendantBindings:!0}}},m.h.ea.let=!0;var L={};m.c.options={init:function(g){if(m.a.R(g)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<g.length;)g.remove(0);return{controlsDescendantBindings:!0}},update:function(g,I,T){function w(){return m.a.jb(g.options,function(Z){return Z.selected})}function R(Z,pe,ge){var re=typeof pe;return re=="function"?pe(Z):re=="string"?Z[pe]:ge}function O(Z,pe){if(W&&Q)m.i.ma(g,m.i.H);else if($.length){var ge=0<=m.a.A($,m.w.M(pe[0]));m.a.Zc(pe[0],ge),W&&!ge&&m.u.G(m.a.Fb,null,[g,"change"])}}var G=g.multiple,F=g.length!=0&&G?g.scrollTop:null,U=m.a.f(I()),Q=T.get("valueAllowUnset")&&T.has("value"),H=T.get("optionsIncludeDestroyed");I={};var Y,$=[];Q||(G?$=m.a.Mb(w(),m.w.M):0<=g.selectedIndex&&$.push(m.w.M(g.options[g.selectedIndex]))),U&&(typeof U.length>"u"&&(U=[U]),Y=m.a.jb(U,function(Z){return H||Z===e||Z===null||!m.a.f(Z._destroy)}),T.has("optionsCaption")&&(U=m.a.f(T.get("optionsCaption")),U!==null&&U!==e&&Y.unshift(L)));var W=!1;if(I.beforeRemove=function(Z){g.removeChild(Z)},U=O,T.has("optionsAfterRender")&&typeof T.get("optionsAfterRender")=="function"&&(U=function(Z,pe){O(0,pe),m.u.G(T.get("optionsAfterRender"),null,[pe[0],Z!==L?Z:e])}),m.a.ec(g,Y,function(Z,pe,ge){return ge.length&&($=!Q&&ge[0].selected?[m.w.M(ge[0])]:[],W=!0),pe=g.ownerDocument.createElement("option"),Z===L?(m.a.Bb(pe,T.get("optionsCaption")),m.w.cb(pe,e)):(ge=R(Z,T.get("optionsValue"),Z),m.w.cb(pe,m.a.f(ge)),Z=R(Z,T.get("optionsText"),ge),m.a.Bb(pe,Z)),[pe]},I,U),!Q){var K;G?K=$.length&&w().length<$.length:K=$.length&&0<=g.selectedIndex?m.w.M(g.options[g.selectedIndex])!==$[0]:$.length||0<=g.selectedIndex,K&&m.u.G(m.a.Fb,null,[g,"change"])}(Q||m.S.Ya())&&m.i.ma(g,m.i.H),m.a.wd(g),F&&20<Math.abs(F-g.scrollTop)&&(g.scrollTop=F)}},m.c.options.$b=m.a.g.Z(),m.c.selectedOptions={init:function(g,I,T){function w(){var G=I(),F=[];m.a.D(g.getElementsByTagName("option"),function(U){U.selected&&F.push(m.w.M(U))}),m.m.eb(G,T,"selectedOptions",F)}function R(){var G=m.a.f(I()),F=g.scrollTop;G&&typeof G.length=="number"&&m.a.D(g.getElementsByTagName("option"),function(U){var Q=0<=m.a.A(G,m.w.M(U));U.selected!=Q&&m.a.Zc(U,Q)}),g.scrollTop=F}if(m.a.R(g)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var O;m.i.subscribe(g,m.i.H,function(){O?w():(m.a.B(g,"change",w),O=m.o(R,null,{l:g}))},null,{notifyImmediately:!0})},update:function(){}},m.m.wa.selectedOptions=!0,m.c.style={update:function(g,I){var T=m.a.f(I()||{});m.a.P(T,function(w,R){if(R=m.a.f(R),(R===null||R===e||R===!1)&&(R=""),o)o(g).css(w,R);else if(/^--/.test(w))g.style.setProperty(w,R);else{w=w.replace(/-(\w)/g,function(G,F){return F.toUpperCase()});var O=g.style[w];g.style[w]=R,R===O||g.style[w]!=O||isNaN(R)||(g.style[w]=R+"px")}})}},m.c.submit={init:function(g,I,T,w,R){if(typeof I()!="function")throw Error("The value for a submit binding must be a function");m.a.B(g,"submit",function(O){var G,F=I();try{G=F.call(R.$data,g)}finally{G!==!0&&(O.preventDefault?O.preventDefault():O.returnValue=!1)}})}},m.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(g,I){m.a.Bb(g,I())}},m.h.ea.text=!0,(function(){if(t&&t.navigator){var g=function(Y){if(Y)return parseFloat(Y[1])},I=t.navigator.userAgent,T,w,R,O,G;(T=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(G=g(I.match(/Edge\/([^ ]+)$/)))||g(I.match(/Chrome\/([^ ]+)/))||(w=g(I.match(/Version\/([^ ]+) Safari/)))||(R=g(I.match(/Firefox\/([^ ]+)/)))||(O=m.a.W||g(I.match(/MSIE ([^ ]+)/)))||(O=g(I.match(/rv:([^ )]+)/)))}if(8<=O&&10>O)var F=m.a.g.Z(),U=m.a.g.Z(),Q=function(Y){var $=this.activeElement;($=$&&m.a.g.get($,U))&&$(Y)},H=function(Y,$){var W=Y.ownerDocument;m.a.g.get(W,F)||(m.a.g.set(W,F,!0),m.a.B(W,"selectionchange",Q)),m.a.g.set(Y,U,$)};m.c.textInput={init:function(Y,$,W){function K(Le,Oe){m.a.B(Y,Le,Oe)}function Z(){var Le=m.a.f($());(Le===null||Le===e)&&(Le=""),Ce!==e&&Le===Ce?m.a.setTimeout(Z,4):Y.value!==Le&&(Ne=!0,Y.value=Le,Ne=!1,re=Y.value)}function pe(){ye||(Ce=Y.value,ye=m.a.setTimeout(ge,4))}function ge(){clearTimeout(ye),Ce=ye=e;var Le=Y.value;re!==Le&&(re=Le,m.m.eb($(),W,"textInput",Le))}var re=Y.value,ye,Ce,Pe=m.a.W==9?pe:ge,Ne=!1;O&&K("keypress",ge),11>O&&K("propertychange",function(Le){Ne||Le.propertyName!=="value"||Pe(Le)}),O==8&&(K("keyup",ge),K("keydown",ge)),H&&(H(Y,Pe),K("dragend",pe)),(!O||9<=O)&&K("input",Pe),5>w&&m.a.R(Y)==="textarea"?(K("keydown",pe),K("paste",pe),K("cut",pe)):11>T?K("keydown",pe):4>R?(K("DOMAutoComplete",ge),K("dragdrop",ge),K("drop",ge)):G&&Y.type==="number"&&K("keydown",pe),K("change",ge),K("blur",ge),m.o(Z,null,{l:Y})}},m.m.wa.textInput=!0,m.c.textinput={preprocess:function(Y,$,W){W("textInput",Y)}}})(),m.c.uniqueName={init:function(g,I){if(I()){var T="ko_unique_"+ ++m.c.uniqueName.rd;m.a.Yc(g,T)}}},m.c.uniqueName.rd=0,m.c.using={init:function(g,I,T,w,R){var O;return T.has("as")&&(O={as:T.get("as"),noChildContext:T.get("noChildContext")}),I=R.createChildContext(I,O),m.Oa(I,g),{controlsDescendantBindings:!0}}},m.h.ea.using=!0,m.c.value={init:function(g,I,T){var w=m.a.R(g),R=w=="input";if(!R||g.type!="checkbox"&&g.type!="radio"){var O=[],G=T.get("valueUpdate"),F=!1,U=null;G&&(typeof G=="string"?O=[G]:O=m.a.wc(G),m.a.Pa(O,"change"));var Q=function(){U=null,F=!1;var $=I(),W=m.w.M(g);m.m.eb($,T,"value",W)};!m.a.W||!R||g.type!="text"||g.autocomplete=="off"||g.form&&g.form.autocomplete=="off"||m.a.A(O,"propertychange")!=-1||(m.a.B(g,"propertychange",function(){F=!0}),m.a.B(g,"focus",function(){F=!1}),m.a.B(g,"blur",function(){F&&Q()})),m.a.D(O,function($){var W=Q;m.a.Ud($,"after")&&(W=function(){U=m.w.M(g),m.a.setTimeout(Q,0)},$=$.substring(5)),m.a.B(g,$,W)});var H;if(H=R&&g.type=="file"?function(){var $=m.a.f(I());$===null||$===e||$===""?g.value="":m.u.G(Q)}:function(){var $=m.a.f(I()),W=m.w.M(g);U!==null&&$===U?m.a.setTimeout(H,0):($!==W||W===e)&&(w==="select"?(W=T.get("valueAllowUnset"),m.w.cb(g,$,W),W||$===m.w.M(g)||m.u.G(Q)):m.w.cb(g,$))},w==="select"){var Y;m.i.subscribe(g,m.i.H,function(){Y?T.get("valueAllowUnset")?H():Q():(m.a.B(g,"change",Q),Y=m.o(H,null,{l:g}))},null,{notifyImmediately:!0})}else m.a.B(g,"change",Q),m.o(H,null,{l:g})}else m.ib(g,{checkedValue:I})},update:function(){}},m.m.wa.value=!0,m.c.visible={update:function(g,I){var T=m.a.f(I()),w=g.style.display!="none";T&&!w?g.style.display="":!T&&w&&(g.style.display="none")}},m.c.hidden={update:function(g,I){m.c.visible.update(g,function(){return!m.a.f(I())})}},(function(g){m.c[g]={init:function(I,T,w,R,O){return m.c.event.init.call(this,I,function(){var G={};return G[g]=T(),G},w,R,O)}}})("click"),m.ca=function(){},m.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},m.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},m.ca.prototype.makeTemplateSource=function(g,I){if(typeof g=="string"){I=I||n;var T=I.getElementById(g);if(!T)throw Error("Cannot find template with ID "+g);return new m.C.F(T)}if(g.nodeType==1||g.nodeType==8)return new m.C.ia(g);throw Error("Unknown template type: "+g)},m.ca.prototype.renderTemplate=function(g,I,T,w){return g=this.makeTemplateSource(g,w),this.renderTemplateSource(g,I,T,w)},m.ca.prototype.isTemplateRewritten=function(g,I){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(g,I).data("isRewritten")},m.ca.prototype.rewriteTemplate=function(g,I,T){g=this.makeTemplateSource(g,T),I=I(g.text()),g.text(I),g.data("isRewritten",!0)},m.b("templateEngine",m.ca),m.kc=(function(){function g(w,R,O,G){w=m.m.ac(w);for(var F=m.m.Ra,U=0;U<w.length;U++){var Q=w[U].key;if(Object.prototype.hasOwnProperty.call(F,Q)){var H=F[Q];if(typeof H=="function"){if(Q=H(w[U].value))throw Error(Q)}else if(!H)throw Error("This template engine does not support the '"+Q+"' binding within its templates")}}return O="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+m.m.vb(w,{valueAccessors:!0})+" } })()},'"+O.toLowerCase()+"')",G.createJavaScriptEvaluatorBlock(O)+R}var I=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,T=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(w,R,O){R.isTemplateRewritten(w,O)||R.rewriteTemplate(w,function(G){return m.kc.Ld(G,R)},O)},Ld:function(w,R){return w.replace(I,function(O,G,F,U,Q){return g(Q,G,F,R)}).replace(T,function(O,G){return g(G,"<!-- ko -->","#comment",R)})},md:function(w,R){return m.aa.Xb(function(O,G){var F=O.nextSibling;F&&F.nodeName.toLowerCase()===R&&m.ib(F,w,G)})}}})(),m.b("__tr_ambtns",m.kc.md),(function(){m.C={},m.C.F=function(T){if(this.F=T){var w=m.a.R(T);this.ab=w==="script"?1:w==="textarea"?2:w=="template"&&T.content&&T.content.nodeType===11?3:4}},m.C.F.prototype.text=function(){var T=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[T];var w=arguments[0];T==="innerHTML"?m.a.fc(this.F,w):this.F[T]=w};var g=m.a.g.Z()+"_";m.C.F.prototype.data=function(T){if(arguments.length===1)return m.a.g.get(this.F,g+T);m.a.g.set(this.F,g+T,arguments[1])};var I=m.a.g.Z();m.C.F.prototype.nodes=function(){var T=this.F;if(arguments.length==0){var w=m.a.g.get(T,I)||{},R=w.lb||(this.ab===3?T.content:this.ab===4?T:e);if(!R||w.jd){var O=this.text();O&&O!==w.bb&&(R=m.a.Md(O,T.ownerDocument),m.a.g.set(T,I,{lb:R,bb:O,jd:!0}))}return R}w=arguments[0],this.ab!==e&&this.text(""),m.a.g.set(T,I,{lb:w})},m.C.ia=function(T){this.F=T},m.C.ia.prototype=new m.C.F,m.C.ia.prototype.constructor=m.C.ia,m.C.ia.prototype.text=function(){if(arguments.length==0){var T=m.a.g.get(this.F,I)||{};return T.bb===e&&T.lb&&(T.bb=T.lb.innerHTML),T.bb}m.a.g.set(this.F,I,{bb:arguments[0]})},m.b("templateSources",m.C),m.b("templateSources.domElement",m.C.F),m.b("templateSources.anonymousTemplate",m.C.ia)})(),(function(){function g(U,Q,H){var Y;for(Q=m.h.nextSibling(Q);U&&(Y=U)!==Q;)U=m.h.nextSibling(Y),H(Y,U)}function I(U,Q){if(U.length){var H=U[0],Y=U[U.length-1],$=H.parentNode,W=m.ga.instance,K=W.preprocessNode;if(K){if(g(H,Y,function(Z,pe){var ge=Z.previousSibling,re=K.call(W,Z);re&&(Z===H&&(H=re[0]||pe),Z===Y&&(Y=re[re.length-1]||ge))}),U.length=0,!H)return;H===Y?U.push(H):(U.push(H,Y),m.a.Ua(U,$))}g(H,Y,function(Z){Z.nodeType!==1&&Z.nodeType!==8||m.vc(Q,Z)}),g(H,Y,function(Z){Z.nodeType!==1&&Z.nodeType!==8||m.aa.cd(Z,[Q])}),m.a.Ua(U,$)}}function T(U){return U.nodeType?U:0<U.length?U[0]:null}function w(U,Q,H,Y,$){$=$||{};var W=(U&&T(U)||H||{}).ownerDocument,K=$.templateEngine||O;if(m.kc.xd(H,K,W),H=K.renderTemplate(H,Y,$,W),typeof H.length!="number"||0<H.length&&typeof H[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(W=!1,Q){case"replaceChildren":m.h.va(U,H),W=!0;break;case"replaceNode":m.a.Xc(U,H),W=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+Q)}return W&&(I(H,Y),$.afterRender&&m.u.G($.afterRender,null,[H,Y[$.as||"$data"]]),Q=="replaceChildren"&&m.i.ma(U,m.i.H)),H}function R(U,Q,H){return m.O(U)?U():typeof U=="function"?U(Q,H):U}var O;m.gc=function(U){if(U!=e&&!(U instanceof m.ca))throw Error("templateEngine must inherit from ko.templateEngine");O=U},m.dc=function(U,Q,H,Y,$){if(H=H||{},(H.templateEngine||O)==e)throw Error("Set a template engine before calling renderTemplate");if($=$||"replaceChildren",Y){var W=T(Y);return m.$(function(){var Z=Q&&Q instanceof m.fa?Q:new m.fa(Q,null,null,null,{exportDependencies:!0}),K=R(U,Z.$data,Z),Z=w(Y,$,K,Z,H);$=="replaceNode"&&(Y=Z,W=T(Y))},null,{Sa:function(){return!W||!m.a.Sb(W)},l:W&&$=="replaceNode"?W.parentNode:W})}return m.aa.Xb(function(K){m.dc(U,Q,H,K,"replaceNode")})},m.Qd=function(U,Q,H,Y,$){function W(Ce,Pe){m.u.G(m.a.ec,null,[Y,Ce,Z,H,K,Pe]),m.i.ma(Y,m.i.H)}function K(Ce,Pe){I(Pe,pe),H.afterRender&&H.afterRender(Pe,Ce),pe=null}function Z(Ce,Pe){pe=$.createChildContext(Ce,{as:ge,noChildContext:H.noChildContext,extend:function(Le){Le.$index=Pe,ge&&(Le[ge+"Index"]=Pe)}});var Ne=R(U,Ce,pe);return w(Y,"ignoreTargetNode",Ne,pe,H)}var pe,ge=H.as,re=H.includeDestroyed===!1||m.options.foreachHidesDestroyed&&!H.includeDestroyed;if(re||H.beforeRemove||!m.Pc(Q))return m.$(function(){var Ce=m.a.f(Q)||[];typeof Ce.length>"u"&&(Ce=[Ce]),re&&(Ce=m.a.jb(Ce,function(Pe){return Pe===e||Pe===null||!m.a.f(Pe._destroy)})),W(Ce)},null,{l:Y});W(Q.v());var ye=Q.subscribe(function(Ce){W(Q(),Ce)},null,"arrayChange");return ye.l(Y),ye};var G=m.a.g.Z(),F=m.a.g.Z();m.c.template={init:function(U,Q){var H=m.a.f(Q());if(typeof H=="string"||"name"in H)m.h.Ea(U);else if("nodes"in H){if(H=H.nodes||[],m.O(H))throw Error('The "nodes" option must be a plain, non-observable array.');var Y=H[0]&&H[0].parentNode;Y&&m.a.g.get(Y,F)||(Y=m.a.Yb(H),m.a.g.set(Y,F,!0)),new m.C.ia(U).nodes(Y)}else if(H=m.h.childNodes(U),0<H.length)Y=m.a.Yb(H),new m.C.ia(U).nodes(Y);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(U,Q,H,Y,$){var W=Q();Q=m.a.f(W),H=!0,Y=null,typeof Q=="string"?Q={}:(W="name"in Q?Q.name:U,"if"in Q&&(H=m.a.f(Q.if)),H&&"ifnot"in Q&&(H=!m.a.f(Q.ifnot)),H&&!W&&(H=!1)),"foreach"in Q?Y=m.Qd(W,H&&Q.foreach||[],Q,U,$):H?(H=$,"data"in Q&&(H=$.createChildContext(Q.data,{as:Q.as,noChildContext:Q.noChildContext,exportDependencies:!0})),Y=m.dc(W,H,Q,U)):m.h.Ea(U),$=Y,(Q=m.a.g.get(U,G))&&typeof Q.s=="function"&&Q.s(),m.a.g.set(U,G,!$||$.ja&&!$.ja()?e:$)}},m.m.Ra.template=function(U){return U=m.m.ac(U),U.length==1&&U[0].unknown||m.m.Id(U,"name")?null:"This template engine does not support anonymous templates nested within its templates"},m.h.ea.template=!0})(),m.b("setTemplateEngine",m.gc),m.b("renderTemplate",m.dc),m.a.Kc=function(g,I,T){if(g.length&&I.length){var w,R,O,G,F;for(w=R=0;(!T||w<T)&&(G=g[R]);++R){for(O=0;F=I[O];++O)if(G.value===F.value){G.moved=F.index,F.moved=G.index,I.splice(O,1),w=O=0;break}w+=O}}},m.a.Pb=(function(){function g(I,T,w,R,O){var G=Math.min,F=Math.max,U=[],Q,H=I.length,Y,$=T.length,W=$-H||1,K=H+$+1,Z,pe,ge;for(Q=0;Q<=H;Q++)for(pe=Z,U.push(Z=[]),ge=G($,Q+W),Y=F(0,Q-1);Y<=ge;Y++)Z[Y]=Y?Q?I[Q-1]===T[Y-1]?pe[Y-1]:G(pe[Y]||K,Z[Y-1]||K)+1:Y+1:Q+1;for(G=[],F=[],W=[],Q=H,Y=$;Q||Y;)$=U[Q][Y]-1,Y&&$===U[Q][Y-1]?F.push(G[G.length]={status:w,value:T[--Y],index:Y}):Q&&$===U[Q-1][Y]?W.push(G[G.length]={status:R,value:I[--Q],index:Q}):(--Y,--Q,O.sparse||G.push({status:"retained",value:T[Y]}));return m.a.Kc(W,F,!O.dontLimitMoves&&10*H),G.reverse()}return function(I,T,w){return w=typeof w=="boolean"?{dontLimitMoves:w}:w||{},I=I||[],T=T||[],I.length<T.length?g(I,T,"added","deleted",w):g(T,I,"deleted","added",w)}})(),m.b("utils.compareArrays",m.a.Pb),(function(){function g(w,R,O,G,F){var U=[],Q=m.$(function(){var H=R(O,F,m.a.Ua(U,w))||[];0<U.length&&(m.a.Xc(U,H),G&&m.u.G(G,null,[O,H,F])),U.length=0,m.a.Nb(U,H)},null,{l:w,Sa:function(){return!m.a.kd(U)}});return{Y:U,$:Q.ja()?Q:e}}var I=m.a.g.Z(),T=m.a.g.Z();m.a.ec=function(w,R,O,G,F,U){function Q(ft){Ne={Aa:ft,pb:m.ta(pe++)},K.push(Ne),W||Pe.push(Ne)}function H(ft){Ne=$[ft],pe!==Ne.pb.v()&&Ce.push(Ne),Ne.pb(pe++),m.a.Ua(Ne.Y,w),K.push(Ne)}function Y(ft,St){if(ft)for(var Ie=0,Se=St.length;Ie<Se;Ie++)m.a.D(St[Ie].Y,function(Kt){ft(Kt,Ie,St[Ie].Aa)})}R=R||[],typeof R.length>"u"&&(R=[R]),G=G||{};var $=m.a.g.get(w,I),W=!$,K=[],Z=0,pe=0,ge=[],re=[],ye=[],Ce=[],Pe=[],Ne,Le=0;if(W)m.a.D(R,Q);else{if(!U||$&&$._countWaitingForRemove){var Oe=m.a.Mb($,function(ft){return ft.Aa});U=m.a.Pb(Oe,R,{dontLimitMoves:G.dontLimitMoves,sparse:!0})}for(var Oe=0,ot,Fe,_t;ot=U[Oe];Oe++)switch(Fe=ot.moved,_t=ot.index,ot.status){case"deleted":for(;Z<_t;)H(Z++);Fe===e&&(Ne=$[Z],Ne.$&&(Ne.$.s(),Ne.$=e),m.a.Ua(Ne.Y,w).length&&(G.beforeRemove&&(K.push(Ne),Le++,Ne.Aa===T?Ne=null:ye.push(Ne)),Ne&&ge.push.apply(ge,Ne.Y))),Z++;break;case"added":for(;pe<_t;)H(Z++);Fe!==e?(re.push(K.length),H(Fe)):Q(ot.value)}for(;pe<R.length;)H(Z++);K._countWaitingForRemove=Le}m.a.g.set(w,I,K),Y(G.beforeMove,Ce),m.a.D(ge,G.beforeRemove?m.oa:m.removeNode);var rt,Ye,st;try{st=w.ownerDocument.activeElement}catch{}if(re.length)for(;(Oe=re.shift())!=e;){for(Ne=K[Oe],rt=e;Oe;)if((Ye=K[--Oe].Y)&&Ye.length){rt=Ye[Ye.length-1];break}for(R=0;Z=Ne.Y[R];rt=Z,R++)m.h.Wb(w,Z,rt)}for(Oe=0;Ne=K[Oe];Oe++){for(Ne.Y||m.a.extend(Ne,g(w,O,Ne.Aa,F,Ne.pb)),R=0;Z=Ne.Y[R];rt=Z,R++)m.h.Wb(w,Z,rt);!Ne.Ed&&F&&(F(Ne.Aa,Ne.Y,Ne.pb),Ne.Ed=!0,rt=Ne.Y[Ne.Y.length-1])}for(st&&w.ownerDocument.activeElement!=st&&st.focus(),Y(G.beforeRemove,ye),Oe=0;Oe<ye.length;++Oe)ye[Oe].Aa=T;Y(G.afterMove,Ce),Y(G.afterAdd,Pe)}})(),m.b("utils.setDomNodeChildrenFromArrayMapping",m.a.ec),m.ba=function(){this.allowTemplateRewriting=!1},m.ba.prototype=new m.ca,m.ba.prototype.constructor=m.ba,m.ba.prototype.renderTemplateSource=function(g,I,T,w){return(I=!(9>m.a.W)&&g.nodes?g.nodes():null)?m.a.la(I.cloneNode(!0).childNodes):(g=g.text(),m.a.ua(g,w))},m.ba.Ma=new m.ba,m.gc(m.ba.Ma),m.b("nativeTemplateEngine",m.ba),(function(){m.$a=function(){var I=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(T,w,R,O){if(O=O||n,R=R||{},2>I)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var G=T.data("precompiled");return G||(G=T.text()||"",G=o.template(null,"{{ko_with $item.koBindingContext}}"+G+"{{/ko_with}}"),T.data("precompiled",G)),T=[w.$data],w=o.extend({koBindingContext:w},R.templateOptions),w=o.tmpl(G,T,w),w.appendTo(O.createElement("div")),o.fragments={},w},this.createJavaScriptEvaluatorBlock=function(T){return"{{ko_code ((function() { return "+T+" })()) }}"},this.addTemplate=function(T,w){n.write("<script type='text/html' id='"+T+"'>"+w+"</script>")},0<I&&(o.tmpl.tag.ko_code={open:"__.push($1 || '');"},o.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},m.$a.prototype=new m.ca,m.$a.prototype.constructor=m.$a;var g=new m.$a;0<g.Hd&&m.gc(g),m.b("jqueryTmplTemplateEngine",m.$a)})()})})()})()})();var KLt=ko;typeof window<"u"?(ko=window.ko,typeof lz<"u"?window.ko=lz:delete window.ko):(ko=global.ko,typeof lz<"u"?global.ko=lz:delete global.ko);var nx=KLt;/**
* @license
* Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5
* Copyright (c) Steve Sanderson
* MIT license
*/var _ie="__knockoutObservables",yie="__knockoutSubscribable";function gve(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=_ve(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(o){if(!(o===_ie||o===yie)&&!(o in i)){var r=e[o],a=r instanceof Array,s=n.isObservable(r)?r:a?n.observableArray(r):n.observable(r);Object.defineProperty(e,o,{configurable:!0,enumerable:!0,get:s,set:n.isWriteableObservable(s)?s:void 0}),i[o]=s,a&&JLt(n,s)}}),e}function _ve(e,t){var n=e[_ie];return!n&&t&&(n={},Object.defineProperty(e,_ie,{value:n})),n}function XLt(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),gve.call(i,e,[t]),e}function JLt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=ZLt(e,t,i))})}function ZLt(e,t,n){var i=$Lt(e,n);return i.subscribe(t)}function $Lt(e,t){var n=t[yie];if(!n){n=new e.subscribable,Object.defineProperty(t,yie,{value:n});var i={};eOt(t,n,i),tOt(e,t,n,i)}return n}function eOt(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 tOt(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 yve(e,t){if(!e)return null;var n=_ve(e,!1);return n&&n[t]||null}function nOt(e,t){var n=yve(e,t);n&&n.valueHasMutated()}function iOt(e){e.track=gve,e.getObservable=yve,e.valueHasMutated=nOt,e.defineProperty=XLt}var uz={attachToKo:iOt};var Cve="http://www.w3.org/2000/svg",Eve="cesium-svgPath-svg",oOt={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(Cve,"svg:svg");i.setAttribute("class",Eve);let o=document.createElementNS(Cve,"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 a=e.unwrap(r.width),s=e.unwrap(r.height);i.setAttribute("width",a),i.setAttribute("height",s),i.setAttribute("viewBox",`0 0 ${a} ${s}`),r.css&&i.setAttribute("class",`${Eve} ${e.unwrap(r.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},fz=oOt;uz.attachToKo(nx);fz.register(nx);var xe=nx;function dz(e){l(e)||(e=new _m),this._clock=e,this._eventHelper=new kr,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=xe.observable(X.now()),this.systemTime.equalityComparer=X.equals,this.startTime=xe.observable(e.startTime),this.startTime.equalityComparer=X.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=xe.observable(e.stopTime),this.stopTime.equalityComparer=X.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=xe.observable(e.currentTime),this.currentTime.equalityComparer=X.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=xe.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=xe.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=xe.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=xe.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=xe.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),xe.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(dz.prototype,{clock:{get:function(){return this._clock}}});dz.prototype.synchronize=function(){let e=this._clock;this.systemTime=X.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};dz.prototype.isDestroyed=function(){return!1};dz.prototype.destroy=function(){this._eventHelper.removeAll(),fe(this)};var hz=dz;function rOt(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,de.throwInstantiationError()}var Cie=rOt;function aOt(e,t){t=t??!0;let n=new _e,i=new _e;function o(){let r={args:arguments,cancel:!1},a;return n.raiseEvent(r),r.cancel||(a=e.apply(null,arguments),i.raiseEvent(a)),a}return o.canExecute=t,xe.track(o,["canExecute"]),Object.defineProperties(o,{beforeExecute:{value:n},afterExecute:{value:i}}),o}var Pn=aOt;var RB={};RB.createCheckbox=function(e,t,n){let i=document.createElement("div"),o=document.createElement("label"),r=document.createElement("input");r.type="checkbox";let a=`checked: ${t}`;return l(n)&&(a+=`, enable: ${n}`),r.setAttribute("data-bind",a),o.appendChild(r),o.appendChild(document.createTextNode(e)),i.appendChild(o),i};RB.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 a=document.createElement("div");return a.className="cesium-cesiumInspector-sectionContent",o.appendChild(a),a};RB.createRangeInput=function(e,t,n,i,o,r){r=r??t;let a=document.createElement("input");a.setAttribute("data-bind",`value: ${r}`),a.type="number";let s=document.createElement("input");s.type="range",s.min=n,s.max=i,s.step=o??"any",s.setAttribute("data-bind",`valueUpdate: "input", value: ${t}`);let c=document.createElement("div");c.appendChild(s);let u=document.createElement("div");return u.className="cesium-cesiumInspector-slider",u.appendChild(document.createTextNode(e)),u.appendChild(a),u.appendChild(c),u};RB.createRangeInputWithDynamicMinMax=function(e,t,n,i){i=i??t;let o=document.createElement("input");o.setAttribute("data-bind",`value: ${i}`),o.type="number";let r=document.createElement("input");r.type="range",r.step=n??"any",r.setAttribute("data-bind",`valueUpdate: "input", value: ${t}, attr: { min: ${t}Min, max: ${t}Max }`);let a=document.createElement("div");a.appendChild(r);let s=document.createElement("div");return s.className="cesium-cesiumInspector-slider",s.appendChild(document.createTextNode(e)),s.appendChild(o),s.appendChild(a),s};RB.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 Zu=RB;function sOt(e,t,n,i,o){return n.call(i,e[t]),xe.getObservable(e,t).subscribe(n,i,o)}var yc=sOt;function bve(e,t){this._command=e,t=t??V.EMPTY_OBJECT,this.toggled=t.toggled??!1,this.tooltip=t.tooltip??"",xe.track(this,["toggled","tooltip"])}Object.defineProperties(bve.prototype,{command:{get:function(){return this._command}}});var aE=bve;var ix="http://www.w3.org/2000/svg",Tve="http://www.w3.org/1999/xlink",q5,mz=z.fromCssColorString("rgba(247,250,255,0.384)"),K5=z.fromCssColorString("rgba(143,191,255,0.216)"),Eie=z.fromCssColorString("rgba(153,197,255,0.098)"),X5=z.fromCssColorString("rgba(255,255,255,0.086)"),cOt=z.fromCssColorString("rgba(255,255,255,0.267)"),lOt=z.fromCssColorString("rgba(255,255,255,0)"),Ive=z.fromCssColorString("rgba(66,67,68,0.3)"),xve=z.fromCssColorString("rgba(0,0,0,0.5)");function sE(e){return z.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var pz={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 Km(e){let t=document.createElementNS(ix,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(Km(e.children[o]))}else n.indexOf("xlink:")===0?t.setAttributeNS(Tve,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function bie(e,t,n){let i=document.createElementNS(ix,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let o=document.createElementNS(ix,"tspan");return o.textContent=n,i.appendChild(o),i}function uOt(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var J5=new z;function Va(e,t){let n=t.alpha,i=1-n;return J5.red=e.red*i+t.red*n,J5.green=e.green*i+t.green*n,J5.blue=e.blue*i+t.blue*n,J5.toCssColorString()}function Iie(e,t,n){let i=pz[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 Km(o)}function fOt(e,t,n){let i=pz[n],o=pz.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 Km(r)}function dOt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&q5!==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,s=e._svgNode.getBoundingClientRect(),c,u;if(t.type==="touchstart"||t.type==="touchmove"?(c=t.touches[0].clientX,u=t.touches[0].clientY):(c=t.clientX,u=t.clientY),!i&&(c>s.right||c<s.left||u<s.top||u>s.bottom))return;let f=e._shuttleRingPointer.getBoundingClientRect(),h=c-o-s.left,p=u-r-s.top,A=Math.atan2(p,h)*180/Math.PI+90;A>180&&(A-=360);let m=n.shuttleRingAngle;i||c<f.right&&c>f.left&&u>f.top&&u<f.bottom?(q5=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=A):A<m?n.slower():A>m&&n.faster(),t.preventDefault()}else e===q5&&(q5=void 0),n.shuttleRingDragging=!1}function U_(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=[yc(t,"toggled",this.setToggled,this),yc(t,"tooltip",this.setTooltip,this),yc(t.command,"canExecute",this.setEnabled,this)]}U_.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();fe(this)};U_.prototype.isDestroyed=function(){return!1};U_.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")}};U_.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")))};U_.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function MB(e,t){e=kn(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(ix,"svg:svg");this._svgNode=r,r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",Tve);let a=document.createElementNS(ix,"g");this._topG=a,this._realtimeSVG=new U_(fOt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new U_(Iie(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new U_(Iie(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new U_(Iie(84,99,"animation_pathPause"),t.pauseViewModel);let s=document.createElementNS(ix,"g");s.appendChild(this._realtimeSVG.svgElement),s.appendChild(this._playReverseSVG.svgElement),s.appendChild(this._playForwardSVG.svgElement),s.appendChild(this._pauseSVG.svgElement);let c=Km({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=c;let u=pz.animation_pathSwooshFX,f=pz.animation_pathPointer,h=Km({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:u.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:u.d},{tagName:u.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:u.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=h,this._shuttleRingPointer=Km({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:f.tagName,d:f.d});let p=Km({tagName:"g",transform:"translate(100,100)"});this._knobOuter=Km({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let A=61,m=Km({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:A});this._knobDate=bie(0,-24,""),this._knobTime=bie(0,-7,""),this._knobStatus=bie(0,-41,"");let _=Km({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:A}),y=document.createElementNS(ix,"g");y.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(o),a.appendChild(y),a.appendChild(p),a.appendChild(s),y.appendChild(c),y.appendChild(h),y.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(m),p.appendChild(this._knobDate),p.appendChild(this._knobTime),p.appendChild(this._knobStatus),p.appendChild(_),r.appendChild(a),e.appendChild(r);let C=this;function E(v){dOt(C,v)}this._mouseCallback=E,c.addEventListener("mousedown",E,!0),c.addEventListener("touchstart",E,!0),h.addEventListener("mousedown",E,!0),h.addEventListener("touchstart",E,!0),n.addEventListener("mousemove",E,!0),n.addEventListener("touchmove",E,!0),n.addEventListener("mouseup",E,!0),n.addEventListener("touchend",E,!0),n.addEventListener("touchcancel",E,!0),this._shuttleRingPointer.addEventListener("mousedown",E,!0),this._shuttleRingPointer.addEventListener("touchstart",E,!0),this._knobOuter.addEventListener("mousedown",E,!0),this._knobOuter.addEventListener("touchstart",E,!0);let b=this._knobTime.childNodes[0],x=this._knobDate.childNodes[0],S=this._knobStatus.childNodes[0],B;this._subscriptions=[yc(t.pauseViewModel,"toggled",function(v){B!==v&&(B=v,B?C._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):C._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),yc(t,"shuttleRingAngle",function(v){uOt(C._shuttleRingPointer,C._knobOuter,v)}),yc(t,"dateLabel",function(v){x.textContent!==v&&(x.textContent=v)}),yc(t,"timeLabel",function(v){b.textContent!==v&&(b.textContent=v)}),yc(t,"multiplierLabel",function(v){S.textContent!==v&&(S.textContent=v)})],this.applyThemeChanges(),this.resize()}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(){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 fe(this)};MB.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,a=t;e===0&&t===0?(r=i,a=o):e===0?(a=t,r=i*(t/o)):t===0&&(r=e,a=o*(e/i));let s=r/i,c=a/o;n.style.cssText=`width: ${r}px; height: ${a}px; position: absolute; bottom: 0; left: 0; overflow: hidden;`,n.setAttribute("width",r),n.setAttribute("height",a),n.setAttribute("viewBox",`0 0 ${r} ${a}`),this._topG.setAttribute("transform",`scale(${s},${c})`),this._centerX=Math.max(1,100*s),this._centerY=Math.max(1,100*c),this._lastHeight=e,this._lastWidth=t};MB.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(l(this._observer))return;let f=this;f._observer=new MutationObserver(function(){e.body.contains(f._container)&&(f._observer.disconnect(),f._observer=void 0,f.applyThemeChanges())}),f._observer.observe(e,{childList:!0,subtree:!0});return}let t=sE(this._themeNormal),n=sE(this._themeHover),i=sE(this._themeSelect),o=sE(this._themeDisabled),r=sE(this._themeKnob),a=sE(this._themePointer),s=sE(this._themeSwoosh),c=sE(this._themeSwooshHover),u=Km({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Va(t,mz)},{tagName:"stop",offset:"12%","stop-color":Va(t,K5)},{tagName:"stop",offset:"46%","stop-color":Va(t,Eie)},{tagName:"stop",offset:"81%","stop-color":Va(t,X5)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Va(n,mz)},{tagName:"stop",offset:"12%","stop-color":Va(n,K5)},{tagName:"stop",offset:"46%","stop-color":Va(n,Eie)},{tagName:"stop",offset:"81%","stop-color":Va(n,X5)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Va(i,mz)},{tagName:"stop",offset:"12%","stop-color":Va(i,K5)},{tagName:"stop",offset:"46%","stop-color":Va(i,Eie)},{tagName:"stop",offset:"81%","stop-color":Va(i,X5)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Va(o,cOt)},{tagName:"stop",offset:"75%","stop-color":Va(o,lOt)}]},{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":s.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":s.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":s.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":a.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":a.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":Va(a,xve)},{tagName:"stop",offset:"100%","stop-color":Va(a,xve)}]},{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":Va(r,mz)},{tagName:"stop",offset:"60%","stop-color":Va(r,Ive)},{tagName:"stop",offset:"85%","stop-color":Va(r,K5)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Va(r,Ive)},{tagName:"stop",offset:"60%","stop-color":Va(r,mz)},{tagName:"stop",offset:"85%","stop-color":Va(r,X5)}]}]});l(this._defsElement)?this._svgNode.replaceChild(u,this._defsElement):this._svgNode.appendChild(u),this._defsElement=u};var Az=MB;var hOt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],cE=15,NB=105;function Sve(e,t){return e-t}function xie(e,t){let n=Co(t,e,Sve);return n<0?~n:n}function mOt(e,t){if(Math.abs(e)<=cE)return e/cE;let n=cE,i=NB,o,r=0,a;return e>0?(o=Math.log(t[t.length-1]),a=(o-r)/(i-n),Math.exp(r+a*(e-n))):(o=Math.log(-t[0]),a=(o-r)/(i-n),-Math.exp(r+a*(Math.abs(e)-n)))}function pOt(e,t,n){if(n.clockStep===Uo.SYSTEM_CLOCK)return cE;if(Math.abs(e)<=1)return e*cE;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let o=cE,r=NB,a,s=0,c;return e>0?(a=Math.log(i),c=(a-s)/(r-o),(Math.log(e)-s)/c+o):(a=Math.log(-t[0]),c=(a-s)/(r-o),-((Math.log(Math.abs(e))-s)/c+o))}function ph(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=ph.defaultDateFormatter,this._timeFormatter=ph.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,xe.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(ph.defaultTicks),this.timeLabel=void 0,xe.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,xe.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,xe.defineProperty(this,"multiplierLabel",function(){let a=t._clockViewModel;if(a.clockStep===Uo.SYSTEM_CLOCK)return"Today";let s=a.multiplier;return s%1===0?`${s.toFixed(0)}x`:`${s.toFixed(3).replace(/0{0,3}$/,"")}x`}),this.shuttleRingAngle=void 0,xe.defineProperty(this,"shuttleRingAngle",{get:function(){return pOt(e.multiplier,t._allShuttleRingTicks,e)},set:function(a){a=Math.max(Math.min(a,NB),-NB);let s=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=Uo.SYSTEM_CLOCK_MULTIPLIER,Math.abs(a)===NB){c.multiplier=a>0?s[s.length-1]:s[0];return}let u=mOt(a,s);if(t.snapToTicks)u=s[xie(u,s)];else if(u!==0){let f=Math.abs(u);if(f>100){let h=f.toFixed(0).length-2,p=Math.pow(10,h);u=Math.round(u/p)*p|0}else f>cE?u=Math.round(u):f>1?u=+u.toFixed(1):f>0&&(u=+u.toFixed(2))}c.multiplier=u}}),this._canAnimate=void 0,xe.defineProperty(this,"_canAnimate",function(){let a=t._clockViewModel,s=a.clockRange;if(t.shuttleRingDragging||s===Ia.UNBOUNDED)return!0;let c=a.multiplier,u=a.currentTime,f=a.startTime,h=!1;if(s===Ia.LOOP_STOP)h=X.greaterThan(u,f)||u.equals(f)&&c>0;else{let p=a.stopTime;h=X.greaterThan(u,f)&&X.lessThan(u,p)||u.equals(f)&&c>0||u.equals(p)&&c<0}return h||(a.shouldAnimate=!1),h}),this._isSystemTimeAvailable=void 0,xe.defineProperty(this,"_isSystemTimeAvailable",function(){let a=t._clockViewModel;if(a.clockRange===Ia.UNBOUNDED)return!0;let c=a.systemTime;return X.greaterThanOrEquals(c,a.startTime)&&X.lessThanOrEquals(c,a.stopTime)}),this._isAnimating=void 0,xe.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=Pn(function(){let a=t._clockViewModel;a.shouldAnimate?a.shouldAnimate=!1:t._canAnimate&&(a.shouldAnimate=!0)});this._pauseViewModel=new aE(n,{toggled:xe.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=Pn(function(){let a=t._clockViewModel,s=a.multiplier;s>0&&(a.multiplier=-s),a.shouldAnimate=!0});this._playReverseViewModel=new aE(i,{toggled:xe.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let o=Pn(function(){let a=t._clockViewModel,s=a.multiplier;s<0&&(a.multiplier=-s),a.shouldAnimate=!0});this._playForwardViewModel=new aE(o,{toggled:xe.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==Uo.SYSTEM_CLOCK}),tooltip:"Play Forward"});let r=Pn(function(){t._clockViewModel.clockStep=Uo.SYSTEM_CLOCK},xe.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new aE(r,{toggled:xe.computed(function(){return e.clockStep===Uo.SYSTEM_CLOCK}),tooltip:xe.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=Pn(function(){let a=t._clockViewModel,s=t._allShuttleRingTicks,c=a.multiplier,u=xie(c,s)-1;u>=0&&(a.multiplier=s[u])}),this._faster=Pn(function(){let a=t._clockViewModel,s=t._allShuttleRingTicks,c=a.multiplier,u=xie(c,s)+1;u<s.length&&(a.multiplier=s[u])})}ph.defaultDateFormatter=function(e,t){let n=X.toGregorianDate(e);return`${hOt[n.month-1]} ${n.day} ${n.year}`};ph.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];ph.defaultTimeFormatter=function(e,t){let n=X.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`};ph.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};ph.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(Sve);let a=[];for(n=r.length,t=n-1;t>=0;--t)i=r[t],i!==0&&a.push(-i);oi(a,r),this._allShuttleRingTicks=a};Object.defineProperties(ph.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}}});ph._maxShuttleRingAngle=NB;ph._realtimeShuttleRingAngle=cE;var gz=ph;function AOt(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof es&&(e.tileset=n.primitive),e.pickActive=!1}}function Bve(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof es&&(e.tileset=i.primitive)},Bn.MOUSE_MOVE):(e._eventHandler.removeInputAction(Bn.MOUSE_MOVE),e.picking=e.picking)}var gOt={maximumFractionDigits:3};function _z(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,gOt):Math.round(t).toLocaleString()}function yz(e,t){if(!l(e))return"";let n=t?e._statisticsPerPass[cr.PICK]:e._statisticsPerPass[cr.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>${_z(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${_z(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${_z(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function Dve(){let e=Ri.statistics;return`
<ul class="cesium-cesiumInspector-statistics">
<li><strong>Geometry Memory (MB): </strong>${_z(e.geometryByteLength)}</li>
<li><strong>Texture Memory (MB): </strong>${_z(e.texturesByteLength)}</li>
</ul>
`}var _Ot=[{text:"Highlight",value:Tu.HIGHLIGHT},{text:"Replace",value:Tu.REPLACE},{text:"Mix",value:Tu.MIX}],wve=new z(1,1,0,.4),yOt=new z,Z5=new z;function Cc(e,t){let n=this,i=e.canvas;this._eventHandler=new qf(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new w_({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,xe.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=xe.observable({}),this.properties=[],xe.defineProperty(this,"properties",function(){let Q=[],H=n._properties();for(let Y in H)H.hasOwnProperty(Y)&&Q.push(Y);return Q});let o=xe.observable();xe.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return o()},set:function(Q){o(Q),l(n._tileset)&&(n._tileset.dynamicScreenSpaceError=Q)}}),this.dynamicScreenSpaceError=!1;let r=xe.observable();xe.defineProperty(this,"colorBlendMode",{get:function(){return r()},set:function(Q){r(Q),l(n._tileset)&&(n._tileset.colorBlendMode=Q,n._scene.requestRender())}}),this.colorBlendMode=Tu.HIGHLIGHT;let a=xe.observable(),s=xe.observable();xe.defineProperty(this,"picking",{get:function(){return s()},set:function(Q){s(Q),Q?n._eventHandler.setInputAction(function(H){let Y=e.pick(H.endPosition);if(Y instanceof Ns?(n.feature=Y,n.tile=Y.content.tile):l(Y)&&l(Y.content)?(n.feature=void 0,n.tile=Y.content.tile):(n.feature=void 0,n.tile=void 0),!!l(n._tileset)){if(a&&l(Y)&&l(Y.content)){let $;e.pickPositionSupported&&($=e.pickPosition(H.endPosition),l($)&&(n._tileset.debugPickPosition=$)),n._tileset.debugPickedTile=Y.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},Bn.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(Bn.MOUSE_MOVE))}}),this.picking=!0;let c=xe.observable();xe.defineProperty(this,"colorize",{get:function(){return c()},set:function(Q){c(Q),l(n._tileset)&&(n._tileset.debugColorizeTiles=Q,n._scene.requestRender())}}),this.colorize=!1;let u=xe.observable();xe.defineProperty(this,"wireframe",{get:function(){return u()},set:function(Q){u(Q),l(n._tileset)&&(n._tileset.debugWireframe=Q,n._scene.requestRender())}}),this.wireframe=!1;let f=xe.observable();xe.defineProperty(this,"showBoundingVolumes",{get:function(){return f()},set:function(Q){f(Q),l(n._tileset)&&(n._tileset.debugShowBoundingVolume=Q,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let h=xe.observable();xe.defineProperty(this,"showContentBoundingVolumes",{get:function(){return h()},set:function(Q){h(Q),l(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=Q,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=xe.observable();xe.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(Q){p(Q),l(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=Q,n._scene.requestRender())}}),this.showRequestVolumes=!1;let A=xe.observable();xe.defineProperty(this,"freezeFrame",{get:function(){return A()},set:function(Q){A(Q),l(n._tileset)&&(n._tileset.debugFreezeFrame=Q,n._scene.debugShowFrustumPlanes=Q,n._scene.requestRender())}}),this.freezeFrame=!1,xe.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return a()},set:function(Q){a(Q),l(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=Q,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let m=xe.observable();xe.defineProperty(this,"showGeometricError",{get:function(){return m()},set:function(Q){m(Q),l(n._tileset)&&(n._tileset.debugShowGeometricError=Q,n._scene.requestRender())}}),this.showGeometricError=!1;let _=xe.observable();xe.defineProperty(this,"showRenderingStatistics",{get:function(){return _()},set:function(Q){_(Q),l(n._tileset)&&(n._tileset.debugShowRenderingStatistics=Q,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let y=xe.observable();xe.defineProperty(this,"showMemoryUsage",{get:function(){return y()},set:function(Q){y(Q),l(n._tileset)&&(n._tileset.debugShowMemoryUsage=Q,n._scene.requestRender())}}),this.showMemoryUsage=!1;let C=xe.observable();xe.defineProperty(this,"showUrl",{get:function(){return C()},set:function(Q){C(Q),l(n._tileset)&&(n._tileset.debugShowUrl=Q,n._scene.requestRender())}}),this.showUrl=!1;let E=xe.observable();xe.defineProperty(this,"maximumScreenSpaceError",{get:function(){return E()},set:function(Q){Q=Number(Q),isNaN(Q)||(E(Q),l(n._tileset)&&(n._tileset.maximumScreenSpaceError=Q))}}),this.maximumScreenSpaceError=16;let b=xe.observable();xe.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return b()},set:function(Q){Q=Number(Q),isNaN(Q)||(b(Q),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=Q))}}),this.dynamicScreenSpaceErrorDensity=2e-4,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,xe.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(b(),1/6)},set:function(Q){let H=Math.pow(Q,6);b(H),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=H)}});let x=xe.observable();xe.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return x()},set:function(Q){Q=Number(Q),isNaN(Q)||(x(Q),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=Q))}}),this.dynamicScreenSpaceErrorFactor=24;let S=AOt(this),B=xe.observable();xe.defineProperty(this,"pickActive",{get:function(){return B()},set:function(Q){B(Q),Q?n._eventHandler.setInputAction(S,Bn.LEFT_CLICK):n._eventHandler.removeInputAction(Bn.LEFT_CLICK)}});let v=xe.observable();xe.defineProperty(this,"pointCloudShading",{get:function(){return v()},set:function(Q){v(Q),l(n._tileset)&&(n._tileset.pointCloudShading.attenuation=Q)}}),this.pointCloudShading=!1;let P=xe.observable();xe.defineProperty(this,"geometricErrorScale",{get:function(){return P()},set:function(Q){Q=Number(Q),isNaN(Q)||(P(Q),l(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=Q))}}),this.geometricErrorScale=1;let N=xe.observable();xe.defineProperty(this,"maximumAttenuation",{get:function(){return N()},set:function(Q){Q=Number(Q),isNaN(Q)||(N(Q),l(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=Q===0?void 0:Q))}}),this.maximumAttenuation=0;let L=xe.observable();xe.defineProperty(this,"baseResolution",{get:function(){return L()},set:function(Q){Q=Number(Q),isNaN(Q)||(L(Q),l(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=Q===0?void 0:Q))}}),this.baseResolution=0;let g=xe.observable();xe.defineProperty(this,"eyeDomeLighting",{get:function(){return g()},set:function(Q){g(Q),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=Q)}}),this.eyeDomeLighting=!1;let I=xe.observable();xe.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return I()},set:function(Q){Q=Number(Q),isNaN(Q)||(I(Q),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=Q))}}),this.eyeDomeLightingStrength=1;let T=xe.observable();xe.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return T()},set:function(Q){Q=Number(Q),isNaN(Q)||(T(Q),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=Q))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let w=xe.observable();xe.defineProperty(this,"skipLevelOfDetail",{get:function(){return w()},set:function(Q){w(Q),l(n._tileset)&&(n._tileset.skipLevelOfDetail=Q)}}),this.skipLevelOfDetail=!0;let R=xe.observable();xe.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return R()},set:function(Q){Q=Number(Q),isNaN(Q)||(R(Q),l(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=Q))}}),this.skipScreenSpaceErrorFactor=16;let O=xe.observable();xe.defineProperty(this,"baseScreenSpaceError",{get:function(){return O()},set:function(Q){Q=Number(Q),isNaN(Q)||(O(Q),l(n._tileset)&&(n._tileset.baseScreenSpaceError=Q))}}),this.baseScreenSpaceError=1024;let G=xe.observable();xe.defineProperty(this,"skipLevels",{get:function(){return G()},set:function(Q){Q=Number(Q),isNaN(Q)||(G(Q),l(n._tileset)&&(n._tileset.skipLevels=Q))}}),this.skipLevels=1;let F=xe.observable();xe.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return F()},set:function(Q){F(Q),l(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=Q)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let U=xe.observable();xe.defineProperty(this,"loadSiblings",{get:function(){return U()},set:function(Q){U(Q),l(n._tileset)&&(n._tileset.loadSiblings=Q)}}),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)||Bve(this,!0)}Object.defineProperties(Cc.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 _Ot}},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=yz(e,!1),this._pickStatisticsText=yz(e,!0),this._resourceCacheStatisticsText=Dve(),Bve(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,yOt):z.WHITE:t.color=Z5,this._scene.requestRender()),l(e)&&(z.clone(e.color,Z5),e.color=wve,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()&&!Tie(t.content)&&(t.color=Z5,this._scene.requestRender()),l(e)&&!Tie(e.content)&&(z.clone(e.color,Z5),e.color=wve,this._scene.requestRender()),this._tile=e}}});function Tie(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(!Tie(t[i]))return!1;return!0}return!1}Cc.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};Cc.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};Cc.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};Cc.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};Cc.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};Cc.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};Cc.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};Cc.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};Cc.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};Cc.prototype.trimTilesCache=function(){l(this._tileset)&&this._tileset.trimLoadedTiles()};Cc.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 Fg(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};Cc.prototype.styleEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,s=n.value.slice(i,o).split(`
`),c=s.length,u;if(t.shiftKey)for(u=0;u<c;++u)s[u][0]===" "&&(s[u][1]===" "?(s[u]=s[u].substr(2),r-=2):(s[u]=s[u].substr(1),r-=1));else for(u=0;u<c;++u)s[u]=` ${s[u]}`,r+=2;let f=s.join(`
`);n.value=n.value.slice(0,i)+f+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};Cc.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=yz(e,!1),this._pickStatisticsText=yz(e,!0),this._resourceCacheStatisticsText=Dve())};Cc.prototype.isDestroyed=function(){return!1};Cc.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){xe.getObservable(e,t).dispose()}),fe(this)};Cc.getStatistics=yz;var Cz=Cc;function $5(e,t){e=kn(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let o=new Cz(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 a=document.createElement("div");a.className="cesium-cesiumInspector-dropDown",n.appendChild(a);let s=Zu.createSection,c=Zu.createCheckbox,u=Zu.createRangeInput,f=Zu.createButton,h=s(a,"Tileset","tilesetVisible","toggleTileset"),p=s(a,"Display","displayVisible","toggleDisplay"),A=s(a,"Update","updateVisible","toggleUpdate"),m=s(a,"Logging","loggingVisible","toggleLogging"),_=s(a,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),y=s(a,"Style","styleVisible","toggleStyle"),C=s(a,"Optimization","optimizationVisible","toggleOptimization"),E=document.createElement("div");E.className="field-group";let b=document.createElement("label");b.className="field-label",b.appendChild(document.createTextNode("Properties: "));let x=document.createElement("div");x.setAttribute("data-bind","text: properties"),E.appendChild(b),E.appendChild(x),h.appendChild(E),h.appendChild(f("Pick Tileset","togglePickTileset","pickActive")),h.appendChild(f("Trim Tiles Cache","trimTilesCache")),h.appendChild(c("Enable Picking","picking")),p.appendChild(c("Colorize","colorize"));let S=p.appendChild(c("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),B=document.createElement("p");B.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),B.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),B.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",S.appendChild(B),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(u("Geometric Error Scale","geometricErrorScale",0,2,.01)),v.appendChild(u("Maximum Attenuation","maximumAttenuation",0,32,1)),v.appendChild(u("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(u("EDL Strength","eyeDomeLightingStrength",0,2,.1)),P.appendChild(u("EDL Radius","eyeDomeLightingRadius",0,4,.1)),v.appendChild(P),A.appendChild(c("Freeze Frame","freezeFrame")),A.appendChild(c("Dynamic Screen Space Error","dynamicScreenSpaceError"));let N=document.createElement("div");N.appendChild(u("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),A.appendChild(N);let L=document.createElement("div");L.setAttribute("data-bind","visible: dynamicScreenSpaceError"),L.appendChild(u("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),L.appendChild(u("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,32,.1)),A.appendChild(L),m.appendChild(c("Performance","performance")),m.appendChild(i),m.appendChild(c("Statistics","showStatistics"));let g=document.createElement("div");g.className="cesium-3dTilesInspector-statistics",g.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),m.appendChild(g),m.appendChild(c("Pick Statistics","showPickStatistics"));let I=document.createElement("div");I.className="cesium-3dTilesInspector-statistics",I.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),m.appendChild(I),m.appendChild(c("Resource Cache Statistics","showResourceCacheStatistics"));let T=document.createElement("div");T.className="cesium-3dTilesInspector-statistics",T.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),m.appendChild(T);let w=document.createElement("div");y.appendChild(w),w.appendChild(document.createTextNode("Color Blend Mode: "));let R=document.createElement("select");R.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),w.appendChild(R);let O=document.createElement("textarea");O.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),w.className="cesium-cesiumInspector-styleEditor",w.appendChild(O);let G=f("Compile (Ctrl+Enter)","compileStyle");w.appendChild(G);let F=document.createElement("div");F.className="cesium-cesiumInspector-error",F.setAttribute("data-bind","text: editorError"),w.appendChild(F),_.appendChild(c("Show Picked Only","showOnlyPickedTileDebugLabel")),_.appendChild(c("Geometric Error","showGeometricError")),_.appendChild(c("Rendering Statistics","showRenderingStatistics")),_.appendChild(c("Memory Usage (MB)","showMemoryUsage")),_.appendChild(c("Url","showUrl")),C.appendChild(c("Skip Tile LODs","skipLevelOfDetail"));let U=document.createElement("div");U.appendChild(u("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),C.appendChild(U);let Q=document.createElement("div");Q.appendChild(u("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),C.appendChild(Q);let H=document.createElement("div");H.appendChild(u("Min. levels to skip","skipLevels",0,10,1)),C.appendChild(H),C.appendChild(c("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),C.appendChild(c("Load siblings of visible tiles","loadSiblings")),xe.applyBindings(o,n)}Object.defineProperties($5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});$5.prototype.isDestroyed=function(){return!1};$5.prototype.destroy=function(){return xe.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),fe(this)};var Ez=$5;function vve(e){e=e??V.EMPTY_OBJECT;let t=e.globe,n=e.imageryProviderViewModels??V.EMPTY_ARRAY,i=e.terrainProviderViewModels??V.EMPTY_ARRAY;this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,xe.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let o=xe.getObservable(this,"imageryProviderViewModels"),r=xe.pureComputed(function(){let h=o(),p={},A;for(A=0;A<h.length;A++){let y=h[A],C=y.category;l(p[C])?p[C].push(y):p[C]=[y]}let m=Object.keys(p),_=[];for(A=0;A<m.length;A++){let y=m[A];_.push({name:y,providers:p[y]})}return _});this._imageryProviders=r;let a=xe.getObservable(this,"terrainProviderViewModels"),s=xe.pureComputed(function(){let h=a(),p={},A;for(A=0;A<h.length;A++){let y=h[A],C=y.category;l(p[C])?p[C].push(y):p[C]=[y]}let m=Object.keys(p),_=[];for(A=0;A<m.length;A++){let y=m[A];_.push({name:y,providers:p[y]})}return _});this._terrainProviders=s,this.buttonTooltip=void 0,xe.defineProperty(this,"buttonTooltip",function(){let h=this.selectedImagery,p=this.selectedTerrain,A=l(h)?h.name:void 0,m=l(p)?p.name:void 0;return l(A)&&l(m)?`${A}
${m}`:l(A)?A:m}),this.buttonImageUrl=void 0,xe.defineProperty(this,"buttonImageUrl",function(){let h=this.selectedImagery;if(l(h))return h.iconUrl}),this.selectedImagery=void 0;let c=xe.observable();this.updateSelectedImageryViewModel=h=>{c(h),this.dropDownVisible=!1},this._currentImageryLayers=[],xe.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(h){if(c()===h){this.dropDownVisible=!1;return}let p=e.map,A,m=this._currentImageryLayers,_=m.length,y=this._globe.imageryLayers,C=!1;if(!p)for(A=0;A<_;A++){let E=y.length;for(let b=0;b<E;b++){let x=y.get(b);if(x===m[A]){y.remove(x),C=!0;break}}}if(l(h))if(p&&h.marsOptions)p.basemap=h.marsOptions.layerId;else if(p&&h.options&&h.isTile)p.basemap=h.options.id;else{let E=h.creationCommand();if(Array.isArray(E)){let b=E.length;for(this._currentImageryLayers=[],A=b-1;A>=0;A--){let x=ga.fromProviderAsync(E[A]);y.add(x,0),this._currentImageryLayers.push(x)}}else{this._currentImageryLayers=[];let b=ga.fromProviderAsync(E);if(b.name=h.name,C)y.add(b,0);else{let x=y.get(0);l(x)&&y.remove(x),y.add(b,0)}this._currentImageryLayers.push(b)}}else p&&(p.basemap=void 0);c(h),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let u=xe.observable();this.updateSelectedTerrainViewModel=h=>{u(h),this.dropDownVisible=!1},xe.defineProperty(this,"selectedTerrain",{get:function(){return u()},set:function(h){if(u()===h){this.dropDownVisible=!1;return}let p;if(l(h)&&(p=h.creationCommand()),l(p)&&!l(p.then)){if(e.map&&h.marsOptions){e.map.terrainProvider=p;return}this._globe.terrainProvider=p}else if(l(p)){let A=!1,m=this._globe.terrainProviderChanged.addEventListener(()=>{A=!0,m()}),y=new az(p).readyEvent.addEventListener(C=>{if(!A){if(e.map&&h.marsOptions){e.map.terrainProvider=C;return}this._globe.terrainProvider=C,y()}})}u(h),this.dropDownVisible=!1}});let f=this;this._toggleDropDown=Pn(function(){f.dropDownVisible=!f.dropDownVisible}),this.selectedImagery=e.selectedImageryProviderViewModel,this.selectedTerrain=e.selectedTerrainProviderViewModel}Object.defineProperties(vve.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var bz=vve;function eW(e,t){e=kn(e);let n=new bz(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 a=document.createElement("div");a.className="cesium-baseLayerPicker-sectionTitle",a.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),a.innerHTML="Imagery",r.appendChild(a);let s=document.createElement("div");s.className="cesium-baseLayerPicker-section",s.setAttribute("data-bind","foreach: _imageryProviders"),r.appendChild(s);let c=document.createElement("div");c.className="cesium-baseLayerPicker-category",s.appendChild(c);let u=document.createElement("div");u.className="cesium-baseLayerPicker-categoryTitle",u.setAttribute("data-bind","text: name"),c.appendChild(u);let f=document.createElement("div");f.className="cesium-baseLayerPicker-choices",f.setAttribute("data-bind","foreach: providers"),c.appendChild(f);let h=document.createElement("div");h.className="cesium-baseLayerPicker-item",h.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),f.appendChild(h);let p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),h.appendChild(p);let A=document.createElement("div");A.className="cesium-baseLayerPicker-itemLabel",A.setAttribute("data-bind","text: name"),h.appendChild(A);let m=document.createElement("div");m.className="cesium-baseLayerPicker-sectionTitle",m.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),m.innerHTML="Terrain",r.appendChild(m);let _=document.createElement("div");_.className="cesium-baseLayerPicker-section",_.setAttribute("data-bind","foreach: _terrainProviders"),r.appendChild(_);let y=document.createElement("div");y.className="cesium-baseLayerPicker-category",_.appendChild(y);let C=document.createElement("div");C.className="cesium-baseLayerPicker-categoryTitle",C.setAttribute("data-bind","text: name"),y.appendChild(C);let E=document.createElement("div");E.className="cesium-baseLayerPicker-choices",E.setAttribute("data-bind","foreach: providers"),y.appendChild(E);let b=document.createElement("div");b.className="cesium-baseLayerPicker-item",b.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),E.appendChild(b);let x=document.createElement("img");x.className="cesium-baseLayerPicker-itemIcon",x.setAttribute("data-bind","attr: { src: iconUrl }"),x.setAttribute("draggable","false"),b.appendChild(x);let S=document.createElement("div");S.className="cesium-baseLayerPicker-itemLabel",S.setAttribute("data-bind","text: name"),b.appendChild(S),xe.applyBindings(n,i),xe.applyBindings(n,r),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=r,this._closeDropDown=function(B){i.contains(B.target)||r.contains(B.target)||(n.dropDownVisible=!1)},fn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(eW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});eW.prototype.isDestroyed=function(){return!1};eW.prototype.destroy=function(){return fn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),xe.cleanNode(this._element),xe.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),fe(this)};var Iz=eW;function Pve(e){let t=e.creationFunction;l(t.canExecute)||(t=Pn(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=e.category??"",this.marsOptions=e.marsOptions,xe.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(Pve.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var ur=Pve;function COt(){let e=[],t=devicePixelRatio>=2;return e.push(new ur({name:"Bing Maps Aerial",iconUrl:Zt("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return Ig({style:bg.AERIAL})}})),e.push(new ur({name:"Bing Maps Aerial with Labels",iconUrl:Zt("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return Ig({style:bg.AERIAL_WITH_LABELS})}})),e.push(new ur({name:"Bing Maps Roads",iconUrl:Zt("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return Ig({style:bg.ROAD})}})),e.push(new ur({name:"ArcGIS World Imagery",iconUrl:Zt("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 Cg.fromBasemapType($h.SATELLITE,{enablePickFeatures:!1})}})),e.push(new ur({name:"ArcGIS World Hillshade",iconUrl:Zt("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 Cg.fromBasemapType($h.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new ur({name:"Esri World Ocean",iconUrl:Zt("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 Cg.fromBasemapType($h.OCEANS,{enablePickFeatures:!1})}})),e.push(new ur({name:"Open\xADStreet\xADMap",iconUrl:Zt("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 Q_({url:"https://tile.openstreetmap.org/"})}})),e.push(new ur({name:"Stadia x Stamen Watercolor",iconUrl:Zt("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 Q_({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 ur({name:"Stadia x Stamen Toner",iconUrl:Zt("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 Q_({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 ur({name:"Stadia Alidade Smooth",iconUrl:Zt("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 Q_({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 ur({name:"Stadia Alidade Smooth Dark",iconUrl:Zt("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 Q_({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 ur({name:"Sentinel-2",iconUrl:Zt("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 ql.fromAssetId(3954)}})),e.push(new ur({name:"Blue Marble",iconUrl:Zt("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return ql.fromAssetId(3845)}})),e.push(new ur({name:"Earth at night",iconUrl:Zt("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 ql.fromAssetId(3812)}})),e.push(new ur({name:"Natural Earth\xA0II",iconUrl:Zt("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast.
http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return Vy.fromUrl(Zt("Assets/Textures/NaturalEarthII"))}})),e.push(new ur({name:"Google Maps Satellite",iconUrl:Zt("Widgets/Images/ImageryProviders/googleSatellite.png"),tooltip:"Imagery from Google Maps",category:"Cesium ion",creationFunction:function(){return ql.fromAssetId(3830182)}})),e.push(new ur({name:"Google Maps Satellite with Labels",iconUrl:Zt("Widgets/Images/ImageryProviders/googleSatelliteLabels.png"),tooltip:"Imagery with place labels from Google Maps",category:"Cesium ion",creationFunction:function(){return ql.fromAssetId(3830183)}})),e.push(new ur({name:"Google Maps Roadmap",iconUrl:Zt("Widgets/Images/ImageryProviders/googleRoadmap.png"),tooltip:"Labeled roads and other features on a base landscape from Google Maps",category:"Cesium ion",creationFunction:function(){return ql.fromAssetId(3830184)}})),e.push(new ur({name:"Google Maps Contour",iconUrl:Zt("Widgets/Images/ImageryProviders/googleContour.png"),tooltip:"Hillshade mapping, contour lines, natural features (roadmap features hidden) from Google Maps",category:"Cesium ion",creationFunction:function(){return ql.fromAssetId(3830186)}})),e.push(new ur({name:"Azure Maps Aerial",iconUrl:Zt("Widgets/Images/ImageryProviders/azureAerial.png"),tooltip:"Imagery from Azure Maps",category:"Cesium ion",creationFunction:function(){return ql.fromAssetId(3891168)}})),e.push(new ur({name:"Azure Maps Roads",iconUrl:Zt("Widgets/Images/ImageryProviders/azureRoads.png"),tooltip:"Labeled roads and other features on a base landscape from Azure Maps",category:"Cesium ion",creationFunction:function(){return ql.fromAssetId(3891169)}})),e}var xz=COt;function EOt(){let e=[];return e.push(new ur({name:"WGS84 Ellipsoid",iconUrl:Zt("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new cI({ellipsoid:te.WGS84})}})),e.push(new ur({name:"Cesium World Terrain",iconUrl:Zt("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 sI({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var Tz=EOt;function bOt(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 a=[];for(let s=2;s>=0;s--){let c=Math.pow(2,s);o>=c&&(a.push(s+1),o-=c)}r=a.reverse().join(" and ")}t+=`<br>&nbsp;&nbsp;&nbsp;&nbsp;${n[i]} in frustum ${r}`}t+=`<br>Total: ${e.totalCommands}`}return t}function Sie(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var IOt=new yn,xOt=new d;function Sz(e,t){let n=this,i=e.canvas,o=new qf(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="",xe.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=Pn(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=Pn(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=Pn(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=Pn(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=xe.getObservable(this,"frustums").subscribe(function(u){n._scene.debugShowFrustums=u,n._scene.requestRender()}),this._frustumPlanesSubscription=xe.getObservable(this,"frustumPlanes").subscribe(function(u){n._scene.debugShowFrustumPlanes=u,n._scene.requestRender()}),this._performanceSubscription=xe.getObservable(this,"performance").subscribe(function(u){u?n._performanceDisplay=new w_({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=Pn(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=xe.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=Pn(function(){if(n.primitiveReferenceFrame){let u=n._primitive.modelMatrix;n._modelMatrixPrimitive=new HU({modelMatrix:u}),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=xe.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=Pn(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(u){return l(n._modelMatrixPrimitive)&&u.owner===n._modelMatrixPrimitive._primitive?!0:l(n._primitive)?u.owner===n._primitive||u.owner===n._primitive._billboardCollection||u.owner.primitive===n._primitive:!1}:n._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=xe.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=xe.getObservable(this,"wireframe").subscribe(function(u){r._surface.tileProvider._debug.wireframe=u,n._scene.requestRender()}),this._depthFrustumSubscription=xe.getObservable(this,"depthFrustum").subscribe(function(u){n._scene.debugShowDepthFrustum=u,n._scene.requestRender()}),this._incrementDepthFrustum=Pn(function(){let u=n.depthFrustum+1;return n.depthFrustum=Sie(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._decrementDepthFrustum=Pn(function(){let u=n.depthFrustum-1;return n.depthFrustum=Sie(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=xe.getObservable(this,"suspendUpdates").subscribe(function(u){r._surface._debug.suspendLodUpdate=u,u||(n.filterTile=!1)});let a;this._showTileCoordinates=Pn(function(){return n.tileCoordinates&&!l(a)?a=e.imageryLayers.addImageryProvider(new cz({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&l(a)&&(e.imageryLayers.remove(a),a=void 0),!0}),this._tileCoordinatesSubscription=xe.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=xe.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=Pn(function(){return n.tileBoundingSphere?r._surface.tileProvider._debug.boundingSphereTile=n._tile:r._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=Pn(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=xe.getObservable(this,"filterTile").subscribe(function(){n.doFilterTile(),n._scene.requestRender()});function s(u){let f=n._scene.pick({x:u.position.x,y:u.position.y});l(f)&&(n.primitive=l(f.collection)?f.collection:f.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=Pn(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=xe.getObservable(this,"pickPrimitiveActive").subscribe(function(u){u?o.setInputAction(s,Bn.LEFT_CLICK):o.removeInputAction(Bn.LEFT_CLICK)});function c(u){let f,h=r.ellipsoid,p=n._scene.camera.getPickRay(u.position,IOt),A=r.pick(p,n._scene,xOt);if(l(A)){let m=h.cartesianToCartographic(A),_=r._surface.tileProvider._tilesToRenderByTextureCount;for(let y=0;!f&&y<_.length;++y){let C=_[y];if(l(C))for(let E=0;!f&&E<C.length;++E){let b=C[E];ce.contains(b.rectangle,m)&&(f=b)}}}n.tile=f,n.pickTileActive=!1}this._pickTile=Pn(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=xe.getObservable(this,"pickTileActive").subscribe(function(u){u?o.setInputAction(c,Bn.LEFT_CLICK):o.removeInputAction(Bn.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(Sz.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 Pn(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return Pn(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return Pn(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return Pn(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return Pn(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}}});Sz.prototype._update=function(){this.frustums&&(this.frustumStatisticText=bOt(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=Sie(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}`};Sz.prototype.isDestroyed=function(){return!1};Sz.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(),fe(this)};var wz=Sz;function tW(e,t){e=kn(e);let n=document.createElement("div"),i=new wz(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 a=document.createElement("div");a.className="cesium-cesiumInspector-dropDown",o.appendChild(a);let s=Zu.createSection,c=Zu.createCheckbox,u=s(a,"General","generalVisible","toggleGeneral"),f=c("Show Frustums","frustums"),h=document.createElement("div");h.className="cesium-cesiumInspector-frustumStatistics",h.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),f.appendChild(h),u.appendChild(f),u.appendChild(c("Show Frustum Planes","frustumPlanes")),u.appendChild(c("Performance Display","performance")),n.className="cesium-cesiumInspector-performanceDisplay",u.appendChild(n);let p=document.createElement("div");p.className="cesium-cesiumInspector-shaderCache",p.setAttribute("data-bind","html: shaderCacheText"),u.appendChild(p);let A=document.createElement("div");u.appendChild(A);let m=document.createElement("span");m.setAttribute("data-bind",'html: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Frustum:"'),A.appendChild(m);let _=document.createElement("span");_.setAttribute("data-bind","text: depthFrustumText"),A.appendChild(_);let y=document.createElement("input");y.type="button",y.value="-",y.className="cesium-cesiumInspector-pickButton",y.setAttribute("data-bind","click: decrementDepthFrustum"),A.appendChild(y);let C=document.createElement("input");C.type="button",C.value="+",C.className="cesium-cesiumInspector-pickButton",C.setAttribute("data-bind","click: incrementDepthFrustum"),A.appendChild(C);let E=s(a,"Primitives","primitivesVisible","togglePrimitives"),b=document.createElement("div");b.className="cesium-cesiumInspector-pickSection",E.appendChild(b);let x=document.createElement("input");x.type="button",x.value="Pick a primitive",x.className="cesium-cesiumInspector-pickButton",x.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let S=document.createElement("div");S.className="cesium-cesiumInspector-center",S.appendChild(x),b.appendChild(S),b.appendChild(c("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),b.appendChild(c("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=c("Show only selected","filterPrimitive","hasPickedPrimitive"),b.appendChild(this._primitiveOnly);let B=s(a,"Terrain","terrainVisible","toggleTerrain"),v=document.createElement("div");v.className="cesium-cesiumInspector-pickSection",B.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'),S=document.createElement("div"),S.appendChild(P),S.className="cesium-cesiumInspector-center",v.appendChild(S);let N=document.createElement("div");v.appendChild(N);let L=document.createElement("input");L.type="button",L.value="Parent",L.className="cesium-cesiumInspector-pickButton",L.setAttribute("data-bind","click: selectParent");let g=document.createElement("input");g.type="button",g.value="NW",g.className="cesium-cesiumInspector-pickButton",g.setAttribute("data-bind","click: selectNW");let I=document.createElement("input");I.type="button",I.value="NE",I.className="cesium-cesiumInspector-pickButton",I.setAttribute("data-bind","click: selectNE");let T=document.createElement("input");T.type="button",T.value="SW",T.className="cesium-cesiumInspector-pickButton",T.setAttribute("data-bind","click: selectSW");let w=document.createElement("input");w.type="button",w.value="SE",w.className="cesium-cesiumInspector-pickButton",w.setAttribute("data-bind","click: selectSE");let R=document.createElement("div");R.className="cesium-cesiumInspector-tileText",N.className="cesium-cesiumInspector-frustumStatistics",N.appendChild(R),N.setAttribute("data-bind","visible: hasPickedTile"),R.setAttribute("data-bind","html: tileText");let O=document.createElement("div");O.className="cesium-cesiumInspector-relativeText",O.textContent="Select relative:",N.appendChild(O);let G=document.createElement("table"),F=document.createElement("tr"),U=document.createElement("tr"),Q=document.createElement("td");Q.appendChild(L);let H=document.createElement("td");H.appendChild(g);let Y=document.createElement("td");Y.appendChild(I),F.appendChild(Q),F.appendChild(H),F.appendChild(Y);let $=document.createElement("td"),W=document.createElement("td");W.appendChild(T);let K=document.createElement("td");K.appendChild(w),U.appendChild($),U.appendChild(W),U.appendChild(K),G.appendChild(F),G.appendChild(U),N.appendChild(G),v.appendChild(c("Show bounding volume","tileBoundingSphere","hasPickedTile")),v.appendChild(c("Show only selected","filterTile","hasPickedTile")),B.appendChild(c("Wireframe","wireframe")),B.appendChild(c("Suspend LOD update","suspendUpdates")),B.appendChild(c("Show tile coordinates","tileCoordinates")),xe.applyBindings(i,this._element)}Object.defineProperties(tW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});tW.prototype.isDestroyed=function(){return!1};tW.prototype.destroy=function(){return xe.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),fe(this)};var Bz=tW;function nW(e,t){l(t)||(t=document.body),t=kn(t);let n=this,i=xe.observable(jr.fullscreen),o=xe.observable(jr.enabled),r=t.ownerDocument;this.isFullscreen=void 0,xe.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,xe.defineProperty(this,"isFullscreenEnabled",{get:function(){return o()},set:function(a){o(a&&jr.enabled)}}),this.tooltip=void 0,xe.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=Pn(function(){jr.fullscreen?jr.exitFullscreen():jr.requestFullscreen(n._fullscreenElement)},xe.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=kn(e)??r.body,this._callback=function(){i(jr.fullscreen)},r.addEventListener(jr.changeEventName,this._callback)}Object.defineProperties(nW.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});nW.prototype.isDestroyed=function(){return!1};nW.prototype.destroy=function(){document.removeEventListener(jr.changeEventName,this._callback),fe(this)};var Dz=nW;var TOt="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",SOt="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 iW(e,t){e=kn(e);let n=new Dz(t,e);n._exitFullScreenPath=SOt,n._enterFullScreenPath=TOt;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),xe.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties(iW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});iW.prototype.isDestroyed=function(){return!1};iW.prototype.destroy=function(){return this._viewModel.destroy(),xe.cleanNode(this._element),this._container.removeChild(this._element),fe(this)};var vz=iW;var Rve=1e3;function Ah(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new dI({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 _e,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=Nve,this._handleArrowUp=Mve;let t=this;this._suggestionsVisible=xe.pureComputed(function(){let o=xe.getObservable(t,"_suggestions")().length>0,r=xe.getObservable(t,"_showSuggestions")();return o&&r}),this._searchCommand=Pn(function(i){if(i=i??GC.SEARCH,t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)ROt(t);else return vOt(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,a=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38;return(r||a)&&o.preventDefault(),!0},this.handleKeyUp=function(i,o){let r=o.key==="ArrowDown"||o.key==="Down"||o.keyCode===40,a=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38,s=o.key==="Enter"||o.keyCode===13;return a?Mve(t):r?Nve(t):s&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let o=i.destination;Fve(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=e.autocomplete??!0,this.destinationFound=e.destinationFound??Ah.flyToDestination,this._focusTextbox=!1,xe.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=xe.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){Ah._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,xe.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,xe.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){this._searchText=i}}),this.flightDuration=void 0,xe.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){this._flightDuration=i}})}Object.defineProperties(Ah.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}}});Ah.prototype.destroy=function(){this._suggestionSubscription.dispose()};function Mve(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],Ah._adjustSuggestionsScroll(e,n)}function Nve(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],Ah._adjustSuggestionsScroll(e,i)}function wOt(e,t){let n=l(t)?t.availability:void 0;return l(n)?hI(t,[e]).then(function(i){return e=i[0],e.height+=Rve,e}):(e.height+=Rve,Promise.resolve(e))}function BOt(e,t){let n=e._scene,i=n.ellipsoid,o=n.camera,r=n.terrainProvider,a=t,s;return t instanceof ce?D.equalsEpsilon(t.south,t.north,D.EPSILON7)&&D.equalsEpsilon(t.east,t.west,D.EPSILON7)?t=ce.center(t):s=gI(t,n):t=i.cartesianToCartographic(t),l(s)||(s=wOt(t,r)),s.then(function(c){a=i.cartographicToCartesian(c)}).finally(function(){o.flyTo({destination:a,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:M.IDENTITY})})}async function DOt(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 vOt(e,t,n){let i=e._searchText;if(Ove(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 DOt(t[o],i,n),l(r)&&r.state==="fulfilled"&&r.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,Bie(e);let a=r.value;if(r.state==="fulfilled"&&l(a)&&a.length>0){e._searchText=a[0].displayName,e.destinationFound(e,a[0].destination);let s=Lve(e,Kw.getCreditsFromResult(a[0]));l(s)||wie(e,t[o].credit);return}e._searchText=`${i} (not found)`}function wie(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function Lve(e,t){return l(t)&&t.forEach(n=>wie(e,n)),t}function Bie(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function POt(e,t){let n=kn(e._viewContainer),i=n.getElementsByClassName("search-results")[0],r=n.getElementsByTagName("li")[t];if(t===0){i.scrollTop=0;return}let a=r.offsetTop;a+r.clientHeight>i.clientHeight?i.scrollTop=a+r.clientHeight:a<i.scrollTop&&(i.scrollTop=a)}function ROt(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function Ove(e){return/^\s*$/.test(e)}function Fve(e){xe.getObservable(e,"_suggestions").removeAll()}async function MOt(e){if(!e.autoComplete)return;let t=e._searchText;if(Fve(e),Bie(e),!Ove(t))for(let n of e._geocoderServices){let i=await n.geocode(t,GC.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let o=!0;i.forEach(r=>{let a=Kw.getCreditsFromResult(r);o=o&&!l(a),Lve(e,a)}),o&&wie(e,n.credit)}if(e._suggestions.length>=5)return}}Ah.flyToDestination=BOt;Ah._updateSearchSuggestions=MOt;Ah._adjustSuggestionsScroll=POt;Ah.prototype.isDestroyed=function(){return!1};Ah.prototype.destroy=function(){return Bie(this),fe(this)};var Pz=Ah;var NOt="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",LOt="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 oW(e){let t=kn(e.container),n=new Pz(e);n._startSearchPath=NOt,n._stopSearchPath=LOt;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 a=document.createElement("div");a.className="search-results",a.setAttribute("data-bind","visible: _suggestionsVisible");let s=document.createElement("ul");s.setAttribute("data-bind","foreach: _suggestions");let c=document.createElement("li");s.appendChild(c),c.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),a.appendChild(s),t.appendChild(a),xe.applyBindings(n,i),xe.applyBindings(n,a),this._container=t,this._searchSuggestionsContainer=a,this._viewModel=n,this._form=i,this._onInputBegin=function(u){let f=u.target;typeof u.composedPath=="function"&&(f=u.composedPath()[0]),t.contains(f)||(n._focusTextbox=!1,n.hideSuggestions())},this._onInputEnd=function(u){n._focusTextbox=!0,n.showSuggestions()},fn.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(oW.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});oW.prototype.isDestroyed=function(){return!1};oW.prototype.destroy=function(){let e=this._container;return fn.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(),xe.cleanNode(this._form),xe.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),fe(this)};var Rz=oW;function Qve(e,t){this._scene=e,this._duration=t;let n=this;this._command=Pn(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",xe.track(this,["tooltip"])}Object.defineProperties(Qve.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 Mz=Qve;function rW(e,t,n){e=kn(e);let i=new Mz(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),xe.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(rW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});rW.prototype.isDestroyed=function(){return!1};rW.prototype.destroy=function(){return xe.cleanNode(this._element),this._container.removeChild(this._element),fe(this)};var Nz=rW;function OOt(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function Uve(e,t){xe.track(e);for(let n=0;n<e.sublayers.length;n++)Uve(e.sublayers[n],t)}function aW(e){return e.modelName==="FullModel"}function zve(e){return e.modelName==="Overview"}function Gve(e){return zve(e)||aW(e)}function kve(e,t){if(Gve(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:xe.observable(!1),index:t.sublayers.length};return t.topLayers.push(n),t.sublayers.push(e),n}}function FOt(e,t){if(Gve(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");aW(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function QOt(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 kOt(e){let t=this;this.levels=[],this.viewModel={sublayers:[],levels:this.levels,currentLevel:xe.observable(),selectedLevel:"All",topLayers:[{name:"Select a layer to explore...",disable:xe.observable(!0),index:-1}],currentLayer:xe.observable(),expandClickHandler:OOt,setOptionDisable:function(i,o){xe.applyBindingsToNode(i,{disable:o.disable},o)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){FOt(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){Uve(n[i],this.viewModel);let o=kve(n[i],this.viewModel);l(o)&&(zve(o)||!l(this.viewModel.defaultLayer)&&aW(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=kve(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(o){e.show=aW(o)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return QOt(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var Lz=kOt;function UOt(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 Lz(t);xe.track(o),xe.applyBindings(o,n),l(o.defaultLayer)&&(o.currentLayer=o.defaultLayer)}var Die=UOt;var zOt="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",GOt="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 vie(){this._cameraClicked=new _e,this._closeClicked=new _e,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",xe.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,xe.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?GOt:zOt}}),xe.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}vie.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(vie.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var Oz=vie;function sW(e){e=kn(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 a=new Oz;xe.applyBindings(a,t),this._container=e,this._element=t,this._frame=r,this._viewModel=a,this._descriptionSubscription=void 0;let s=this;r.addEventListener("load",function(){let c=r.contentDocument,u=c.createElement("link");u.href=Zt("Widgets/InfoBox/InfoBoxDescription.css"),u.rel="stylesheet",u.type="text/css";let f=c.createElement("div");f.className="cesium-infoBox-description",c.head.appendChild(u),c.body.appendChild(f),s._descriptionSubscription=yc(a,"description",function(h){r.style.height="5px",f.innerHTML=h;let p=null,A=f.firstElementChild;if(A!==null&&f.childNodes.length===1){let _=window.getComputedStyle(A);if(_!==null){let y=_["background-color"],C=z.fromCssColorString(y);l(C)&&C.alpha!==0&&(p=_["background-color"])}}t.style["background-color"]=p;let m=f.getBoundingClientRect().height;r.style.height=`${m}px`})}),r.setAttribute("src","about:blank")}Object.defineProperties(sW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});sW.prototype.isDestroyed=function(){return!1};sW.prototype.destroy=function(){let e=this._container;return xe.cleanNode(this._element),e.removeChild(this._element),l(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),fe(this)};var Fz=sW;function Vve(){this.showInstructions=!1;let e=this;this._command=Pn(function(){e.showInstructions=!e.showInstructions}),this._showClick=Pn(function(){e._touch=!1}),this._showTouch=Pn(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",xe.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(Vve.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var Qz=Vve;function cW(e){let t=kn(e.container),n=new Qz,i=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 a=document.createElement("div");a.className="cesium-navigation-help",a.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),o.appendChild(a);let s=document.createElement("button");s.type="button",s.className="cesium-navigation-button cesium-navigation-button-left",s.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');let c=document.createElement("img");c.src=Zt("Widgets/Images/NavigationHelp/Mouse.svg"),c.className="cesium-navigation-button-icon",c.style.width="25px",c.style.height="25px",s.appendChild(c),s.appendChild(document.createTextNode("Mouse"));let u=document.createElement("button");u.type="button",u.className="cesium-navigation-button cesium-navigation-button-right",u.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');let f=document.createElement("img");f.src=Zt("Widgets/Images/NavigationHelp/Touch.svg"),f.className="cesium-navigation-button-icon",f.style.width="25px",f.style.height="25px",u.appendChild(f),u.appendChild(document.createTextNode("Touch")),a.appendChild(s),a.appendChild(u);let h=document.createElement("div");h.className="cesium-click-navigation-help cesium-navigation-help-instructions",h.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),h.innerHTML=` <table> <tr> <td><img src="${Zt("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="${Zt("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="${Zt("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>`,a.appendChild(h);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="${Zt("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="${Zt("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="${Zt("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="${Zt("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>`,a.appendChild(p),xe.applyBindings(n,o),this._container=t,this._viewModel=n,this._wrapper=o,this._closeInstructions=function(A){o.contains(A.target)||(n.showInstructions=!1)},fn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(cW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});cW.prototype.isDestroyed=function(){return!1};cW.prototype.destroy=function(){return fn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),xe.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),fe(this)};var kz=cW;function Pie(e){this._scene=e.scene,this.lowFrameRateMessage=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,xe.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=Pn(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=qU.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(Pie.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});Pie.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),fe(this)};var Uz=Pie;function lW(e){let t=kn(e.container),n=new Uz(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),xe.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(lW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});lW.prototype.isDestroyed=function(){return!1};lW.prototype.destroy=function(){return this._viewModel.destroy(),xe.cleanNode(this._element),this._container.removeChild(this._element),fe(this)};var zz=lW;function uW(e){this._scene=e,this._orthographic=e.camera.frustum instanceof An,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,xe.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;xe.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=Pn(function(){t.sceneMode===oe.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new kr,this._eventHelper.add(e.morphComplete,function(n,i,o,r){t.sceneMode=o,t._orthographic=o===oe.SCENE2D||t._scene.camera.frustum instanceof An}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=l(e.camera._currentFlight)}),this._switchToPerspective=Pn(function(){t.sceneMode!==oe.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=Pn(function(){t.sceneMode!==oe.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=oe}Object.defineProperties(uW.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}}});uW.prototype.isDestroyed=function(){return!1};uW.prototype.destroy=function(){this._eventHelper.removeAll(),fe(this)};var Gz=uW;var VOt="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",HOt="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 fW(e,t){e=kn(e);let n=new Gz(t);n._perspectivePath=VOt,n._orthographicPath=HOt;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 a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",a.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(a),xe.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(s){i.contains(s.target)||(n.dropDownVisible=!1)},fn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(fW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});fW.prototype.isDestroyed=function(){return!1};fW.prototype.destroy=function(){return this._viewModel.destroy(),fn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),xe.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),fe(this)};var Vz=fW;function dW(e,t){this._scene=e;let n=this,i=function(o,r,a,s){n.sceneMode=a,n.dropDownVisible=!1};this._eventHelper=new kr,this._eventHelper.add(e.morphStart,i),this._duration=t??2,this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",xe.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,xe.defineProperty(this,"selectedTooltip",function(){let o=n.sceneMode;return o===oe.SCENE2D?n.tooltip2D:o===oe.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=Pn(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=Pn(function(){e.morphTo2D(n._duration)}),this._morphTo3D=Pn(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=Pn(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=oe}Object.defineProperties(dW.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}}});dW.prototype.isDestroyed=function(){return!1};dW.prototype.destroy=function(){this._eventHelper.removeAll(),fe(this)};var Hz=dW;var WOt="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",jOt="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",YOt="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 hW(e,t,n){e=kn(e);let i=new Hz(t,n);i._globePath=WOt,i._flatMapPath=jOt,i._columbusViewPath=YOt;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 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.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(a);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.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(s);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),xe.applyBindings(i,o),this._viewModel=i,this._container=e,this._wrapper=o,this._closeDropDown=function(u){o.contains(u.target)||(i.dropDownVisible=!1)},fn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(hW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});hW.prototype.isDestroyed=function(){return!1};hW.prototype.destroy=function(){return this._viewModel.destroy(),fn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),xe.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),fe(this)};var Wz=hW;var qOt=new k,mW="-1000px";function jz(e,t,n){this._scene=e,this._screenPositionX=mW,this._screenPositionY=mW,this._tweens=e.tweens,this._container=n??document.body,this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,xe.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,xe.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&l(this.position)}}),xe.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,o){return so.worldToWindowCoordinates(e,i,o)}}jz.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,qOt);if(!l(e))this._screenPositionX=mW,this._screenPositionY=mW;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`}}};jz.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:Ta.EXPONENTIAL_OUT})};jz.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:Ta.EXPONENTIAL_OUT})};Object.defineProperties(jz.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var Yz=jz;function pW(e,t){e=kn(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 a=document.createElementNS(i,"g");a.setAttribute("transform","translate(80,80)"),r.appendChild(a);let s=document.createElementNS(i,"path");s.setAttribute("data-bind","attr: { transform: _transform }"),s.setAttribute("d",o),a.appendChild(s),n.appendChild(r);let c=new Yz(t,this._element,this._container);this._viewModel=c,xe.applyBindings(this._viewModel,this._element)}Object.defineProperties(pW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});pW.prototype.isDestroyed=function(){return!1};pW.prototype.destroy=function(){let e=this._container;return xe.cleanNode(this._element),e.removeChild(this._element),fe(this)};var qz=pW;function ox(e,t,n){this._color=e,this._height=t,this._base=n??0}ox.prototype.getHeight=function(){return this._height};ox.prototype.getBase=function(){return this._base};ox.prototype.getStartTime=function(){return this._start};ox.prototype.getStopTime=function(){return this._stop};ox.prototype.setRange=function(e,t){this._start=e,this._stop=t};ox.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){let n=X.secondsDifference(this._start,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(n)),o=X.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 Kz=ox;function Hve(e,t,n,i){this.interval=e,this.height=t,this.color=n||new z(.5,.5,.5,1),this.backgroundColor=i||new z(0,0,0,0)}Hve.prototype.render=function(e,t){let n=this.interval.start,i=this.interval.stop,o=t.startJulian,r=X.addSeconds(t.startJulian,t.duration,new X);if(X.lessThan(n,o)&&X.greaterThan(i,r))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(X.lessThanOrEquals(n,r)&&X.greaterThanOrEquals(i,o)){let a,s,c;for(a=0;a<t.timeBarWidth;++a){let u=X.addSeconds(t.startJulian,a/t.timeBarWidth*t.duration,new X);!l(s)&&X.greaterThanOrEquals(u,n)?s=a:!l(c)&&X.greaterThanOrEquals(u,i)&&(c=a)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),l(s)&&(l(c)||(c=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(s,t.y,Math.max(c-s,1),this.height))}};var Xz=Hve;var Rie=1e12,gh={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},hu={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},lE=[.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],KOt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function mu(e,t){e=kn(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=gh.none,this._touchMode=hu.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=XOt(this),this._onMouseUp=JOt(this),this._onMouseMove=ZOt(this),this._onMouseWheel=$Ot(this),this._onTouchStart=e1t(this),this._onTouchMove=n1t(this),this._onTouchEnd=t1t(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()}mu.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};mu.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};mu.prototype.isDestroyed=function(){return!1};mu.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),fe(this)};mu.prototype.addHighlightRange=function(e,t,n){let i=new Kz(e,t,n);return this._highlightRanges.push(i),this.resize(),i};mu.prototype.addTrack=function(e,t,n,i){let o=new Xz(e,t,n,i);return this._trackList.push(o),this._lastHeight=void 0,this.resize(),o};mu.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=X.secondsDifference(t,e),this._clock&&this._clock.clockRange!==Ia.UNBOUNDED){let i=this._clock.startTime,o=this._clock.stopTime,r=X.secondsDifference(o,i),a=X.secondsDifference(i,this._startJulian),s=X.secondsDifference(o,this._endJulian);this._timeBarSecondsSpan>=r?(this._timeBarSecondsSpan=r,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):a>0?(this._endJulian=X.addSeconds(this._endJulian,a,new X),this._startJulian=i,this._timeBarSecondsSpan=X.secondsDifference(this._endJulian,this._startJulian)):s<0&&(this._startJulian=X.addSeconds(this._startJulian,s,new X),this._endJulian=o,this._timeBarSecondsSpan=X.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)};mu.prototype.zoomFrom=function(e){let t=X.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(X.addSeconds(this._startJulian,t-t*e,new X),X.addSeconds(this._endJulian,n*e-n,new X))};function Mie(e){return e<10?`0${e.toString()}`:e.toString()}mu.prototype.makeLabel=function(e){let t=X.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`${KOt[t.month-1]} ${t.day} ${t.year} ${Mie(t.hour)}:${Mie(t.minute)}:${Mie(t.second)}${i}`};mu.prototype.smallestTicInPixels=7;mu.prototype._makeTics=function(){let e=this._timeBarEle,t=X.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 a="",s=.01,c=31536e6,u=1e-10,f=0,h=this._timeBarSecondsSpan;h<s?(h=s,this._timeBarSecondsSpan=s,this._endJulian=X.addSeconds(this._startJulian,s,new X)):h>c&&(h=c,this._timeBarSecondsSpan=c,this._endJulian=X.addSeconds(this._startJulian,c,new X));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let A=this._startJulian,m=Math.min(h/p*1e-5,.4),_,y=X.toGregorianDate(A);h>31536e4?_=X.fromDate(new Date(Date.UTC(Math.floor(y.year/100)*100,0))):h>31536e3?_=X.fromDate(new Date(Date.UTC(Math.floor(y.year/10)*10,0))):h>86400?_=X.fromDate(new Date(Date.UTC(y.year,0))):_=X.fromDate(new Date(Date.UTC(y.year,y.month,y.day)));let C=X.secondsDifference(this._startJulian,X.addSeconds(_,m,new X)),E=C+h;this._epochJulian=_;function b(Q){return Math.floor(C/Q)*Q}function x(Q,H){return Math.ceil(Q/H+.5)*H}function S(Q){return(Q-C)/h}function B(Q,H){return Q-H*Math.round(Q/H)}this._rulerEle.innerHTML=this.makeLabel(X.addSeconds(this._endJulian,-s,new X));let v=this._rulerEle.offsetWidth+20;v<30&&(v=180);let P=f;f-=u;let N={startTime:C,startJulian:A,epochJulian:_,duration:h,timeBarWidth:p,getAlpha:S};this._highlightRanges.forEach(function(Q){a+=Q.render(N)});let L=0,g=0,I=0,T=v/p;T>1&&(T=1),T*=this._timeBarSecondsSpan;let w=-1,R=-1,O=lE.length,G;for(G=0;G<O;++G){let Q=lE[G];if(++w,L=Q,Q>T&&Q>f)break;R<0&&p*(Q/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(R=w)}if(w>0){for(;w>0;)if(--w,Math.abs(B(L,lE[w]))<1e-5){lE[w]>=f&&(g=lE[w]);break}if(R>=0)for(;R<w;){if(Math.abs(B(g,lE[R]))<1e-5&&lE[R]>=f){I=lE[R];break}++R}}f=P,f>u&&I<1e-5&&Math.abs(f-L)>u&&(I=f,f<=L+u&&(g=0));let F=-999999,U;if(p*(I/this._timeBarSecondsSpan)>=3)for(o=b(I);o<=E;o=x(o,I))a+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*S(o)).toString()}px;"></span>`;if(p*(g/this._timeBarSecondsSpan)>=3)for(o=b(g);o<=E;o=x(o,g))a+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*S(o)).toString()}px;"></span>`;if(p*(L/this._timeBarSecondsSpan)>=2){this._mainTicSpan=L,E+=L,o=b(L);let Q=X.computeTaiMinusUtc(_);for(;o<=E;){let H=X.addSeconds(A,o-C,new X);if(L>2.1){let K=X.computeTaiMinusUtc(H);Math.abs(K-Q)>.1&&(o+=K-Q,H=X.addSeconds(A,o-C,new X))}let Y=Math.round(p*S(o)),$=this.makeLabel(H);this._rulerEle.innerHTML=$,U=this._rulerEle.offsetWidth,U<10&&(U=v);let W=Y-(U/2-1);W>F?(F=W+U+5,a+=`<span class="cesium-timeline-ticMain" style="left: ${Y.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${W.toString()}px;">${$}</span>`):a+=`<span class="cesium-timeline-ticSub" style="left: ${Y.toString()}px;"></span>`,o=x(o,L)}}else this._mainTicSpan=-1;a+=`<span class="cesium-timeline-icon16" style="left:${i}px;bottom:0;background-position: 0 0;"></span>`,e.innerHTML=a,this._scrubElement=e.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),N.y=0,this._trackList.forEach(function(Q){Q.render(r._context,N),N.y+=Q.height})};mu.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(l(this._scrubElement)){let t=X.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(X.addSeconds(this._startJulian,this._timelineDrag,new X),X.addSeconds(this._endJulian,this._timelineDrag,new X)))};mu.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=X.addSeconds(this._startJulian,t,new X),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 XOt(e){return function(t){e._mouseMode!==gh.touchOnly&&(t.button===0?(e._mouseMode=gh.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=gh.zoom:e._mouseMode=gh.slide)),t.preventDefault()}}function JOt(e){return function(t){e._mouseMode=gh.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function ZOt(e){return function(t){let n;if(e._mouseMode===gh.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===gh.slide){if(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0){let i=n*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(X.addSeconds(e._startJulian,i,new X),X.addSeconds(e._endJulian,i,new X))}}else e._mouseMode===gh.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function $Ot(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;Rie=Math.max(Math.min(Math.abs(n),Rie),1),n/=Rie,e.zoomFrom(Math.pow(1.05,-n))}}function e1t(e){return function(t){let n=t.touches.length,i,o,r=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=gh.touchOnly,n===1?(i=X.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=hu.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=hu.singleTap,e._touchState.centerX=t.touches[0].clientX-r)):n===2?(e._touchMode=hu.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=hu.ignore}}function t1t(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===hu.singleTap?(e._touchMode=hu.scrub,e._onTouchMove(t)):e._touchMode===hu.scrub&&e._onTouchMove(t),e._mouseMode=gh.touchOnly,n!==1?e._touchMode=n>0?hu.ignore:hu.none:e._touchMode===hu.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function n1t(e){return function(t){let n,i,o,r,a,s,c=1,u=e._topDiv.getBoundingClientRect().left;e._touchMode===hu.singleTap&&(e._touchMode=hu.slideZoom),e._mouseMode=gh.touchOnly,e._touchMode===hu.scrub?(t.preventDefault(),t.changedTouches.length===1&&(i=t.changedTouches[0].clientX-u,i>=0&&i<=e._topDiv.clientWidth&&e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===hu.slideZoom&&(o=t.touches.length,o===2?(r=(t.touches[0].clientX+t.touches[1].clientX)*.5-u,a=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):o===1&&(r=t.touches[0].clientX-u,a=0),l(r)&&(a>0&&e._touchState.spanX>0?(c=e._touchState.spanX/a,s=X.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-r*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new X)):(n=e._touchState.centerX-r,s=X.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new X)),e.zoomTo(s,X.addSeconds(s,e._timeBarSecondsSpan*c,new X)),e._touchState.centerX=r,e._touchState.spanX=a))}}mu.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 Jz=mu;var jve=Wr(Wve(),1);function i1t(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 Yve(){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 o1t(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(Yve(),e._locked=!1),e._noSleep.disable(),jr.exitFullscreen(),n(!1)):(jr.fullscreen||jr.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=i1t("landscape")),t.useWebVR=!0,n(!0)))}function AW(e,t){let n=this,i=xe.observable(jr.enabled),o=xe.observable(!1);this.isVRMode=void 0,xe.defineProperty(this,"isVRMode",{get:function(){return o()}}),this.isVREnabled=void 0,xe.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(a){i(a&&jr.enabled)}}),this.tooltip=void 0,xe.defineProperty(this,"tooltip",function(){return i()?o()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let r=xe.observable(!1);this._isOrthographic=void 0,xe.defineProperty(this,"_isOrthographic",{get:function(){return r()}}),this._eventHelper=new kr,this._eventHelper.add(e.preRender,function(){r(e.camera.frustum instanceof An)}),this._locked=!1,this._noSleep=new jve.default,this._command=Pn(function(){o1t(n,e,o,r)},xe.getObservable(this,"isVREnabled")),this._vrElement=kn(t)??document.body,this._callback=function(){!jr.fullscreen&&o()&&(e.useWebVR=!1,n._locked&&(Yve(),n._locked=!1),n._noSleep.disable(),o(!1))},document.addEventListener(jr.changeEventName,this._callback)}Object.defineProperties(AW.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});AW.prototype.isDestroyed=function(){return!1};AW.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(jr.changeEventName,this._callback),fe(this)};var $z=AW;var r1t="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",a1t="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 gW(e,t,n){e=kn(e);let i=new $z(t,n);i._exitVRPath=a1t,i._enterVRPath=r1t;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),xe.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(gW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});gW.prototype.isDestroyed=function(){return!1};gW.prototype.destroy=function(){return this._viewModel.destroy(),xe.cleanNode(this._element),this._container.removeChild(this._element),fe(this)};var eG=gW;var qve=new le;function Jve(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function s1t(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 c1t(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 Kve(e,t){let n=e.scene.pick(t.position);if(l(n)){let i=n.id??n.primitive.id;if(i instanceof Zo)return i;if(n instanceof Ns)return new Zo({name:c1t(n),description:s1t(n),feature:n})}if(l(e.scene.globe))return f1t(e,t.position)}var l1t=new X;function Lie(e,t){if(l(t)){let n=t.clock;if(l(n)&&l(e)){let i=n.startTime,o=n.stopTime;X.equals(i,o)&&(o=X.addSeconds(i,D.EPSILON2,l1t)),e.updateFromClock(),e.zoomTo(i,o)}}}var u1t=new d;function f1t(e,t){let n=e.scene,i=n.camera.getPickRay(t),o=n.imageryLayers.pickImageryLayerFeatures(i,n);if(!l(o))return;let r=new Zo({id:"Loading...",description:"Loading feature information..."});return o.then(function(a){if(e.selectedEntity!==r)return;if(!l(a)||a.length===0){e.selectedEntity=Xve();return}let s=a[0],c=new Zo({id:s.name,description:s.description});if(l(s.position)){let u=e.scene.ellipsoid.cartographicToCartesian(s.position,u1t);c.position=new Ml(u)}e.selectedEntity=c},function(){e.selectedEntity===r&&(e.selectedEntity=Xve())}),r}function Xve(){return new Zo({id:"None",description:"No features found."})}function d1t(e,t){let n=e._geocoder,i=e._homeButton,o=e._sceneModePicker,r=e._projectionPicker,a=e._baseLayerPicker,s=e._animation,c=e._timeline,u=e._fullscreenButton,f=e._infoBox,h=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(a)&&(a.container.style.visibility=p),l(s)&&(s.container.style.visibility=p),l(c)&&(c.container.style.visibility=p),l(u)&&u.viewModel.isFullscreenEnabled&&(u.container.style.visibility=p),l(f)&&(f.container.style.visibility=p),l(h)&&(h.container.style.visibility=p),e._container){let A=t||!l(u)?0:u.container.clientWidth;e._vrButton.container.style.right=`${A}px`,e.forceResize()}}function po(e,t){e=kn(e),t=t??V.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 a=document.createElement("div");a.className="cesium-viewer-bottom",o.appendChild(a);let s=t.scene3DOnly??!1,c,u,f=!1;l(t.clockViewModel)?(u=t.clockViewModel,c=u.clock):(c=new _m,u=new hz(c),f=!0);let h=new FU(r,{baseLayer:n&&l(t.selectedImageryProviderViewModel)||l(t.baseLayer)||l(t.imageryProvider)?!1:void 0,clock:c,shouldAnimate:t.shouldAnimate,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,ellipsoid:t.ellipsoid,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,automaticallyTrackDataSourceClocks:t.automaticallyTrackDataSourceClocks,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,useBrowserRecommendedResolution:t.useBrowserRecommendedResolution,creditContainer:l(t.creditContainer)?t.creditContainer:a,creditViewport:t.creditViewport,dataSources:t.dataSources,scene3DOnly:s,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=h.scene,A=new kr;A.add(c.onTick,po.prototype._onTick,this);let m;if(!l(t.selectionIndicator)||t.selectionIndicator!==!1){let H=document.createElement("div");H.className="cesium-viewer-selectionIndicatorContainer",o.appendChild(H),m=new qz(H,p)}let _;if(!l(t.infoBox)||t.infoBox!==!1){let H=document.createElement("div");H.className="cesium-viewer-infoBoxContainer",o.appendChild(H),_=new Fz(H);let Y=_.viewModel;A.add(Y.cameraClicked,po.prototype._onInfoBoxCameraClicked,this),A.add(Y.closeClicked,po.prototype._onInfoBoxClockClicked,this)}let y=document.createElement("div");y.className="cesium-viewer-toolbar",o.appendChild(y);let C;if(!l(t.geocoder)||t.geocoder!==!1){let H=document.createElement("div");H.className="cesium-viewer-geocoderContainer",y.appendChild(H);let Y;typeof t.geocoder=="string"?Y=[new dI({scene:p,geocodeProviderType:t.geocoder})]:l(t.geocoder)&&typeof t.geocoder!="boolean"&&(Y=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),C=new Rz({container:H,geocoderServices:Y,scene:p}),A.add(C.viewModel.search.beforeExecute,po.prototype._clearObjects,this)}let E;(!l(t.homeButton)||t.homeButton!==!1)&&(E=new Nz(y,p),l(C)&&A.add(E.viewModel.command.afterExecute,function(){let H=C.viewModel;H.searchText="",H.isSearchInProgress&&H.search()}),A.add(E.viewModel.command.beforeExecute,po.prototype._clearTrackedObject,this));let b;!s&&(!l(t.sceneModePicker)||t.sceneModePicker!==!1)&&(b=new Wz(y,p));let x;t.projectionPicker&&(x=new Vz(y,p));let S,B;if(n){let H=t.imageryProviderViewModels??xz(),Y=t.terrainProviderViewModels??Tz();S=new Iz(y,{globe:p.globe,imageryProviderViewModels:H,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:Y,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),B=y.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}l(t.baseLayer)&&t.baseLayer!==!1&&(n&&(S.viewModel.selectedImagery=void 0),p.imageryLayers.removeAll(),p.imageryLayers.add(t.baseLayer)),l(t.terrainProvider)&&(n&&(S.viewModel.selectedTerrain=void 0),p.terrainProvider=t.terrainProvider),l(t.terrain)&&(n&&(p.globe.depthTestAgainstTerrain=!0),p.setTerrain(t.terrain));let v;if(!l(t.navigationHelpButton)||t.navigationHelpButton!==!1){let H=!0;try{if(l(window.localStorage)){let Y=window.localStorage.getItem("cesium-hasSeenNavHelp");l(Y)&&Y?H=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}v=new kz({container:y,instructionsInitiallyVisible:t.navigationInstructionsInitiallyVisible??H})}let P;if(!l(t.animation)||t.animation!==!1){let H=document.createElement("div");H.className="cesium-viewer-animationContainer",o.appendChild(H),P=new Az(H,new gz(u))}let N;if(!l(t.timeline)||t.timeline!==!1){let H=document.createElement("div");H.className="cesium-viewer-timelineContainer",o.appendChild(H),N=new Jz(H,c),N.addEventListener("settime",Jve,!1),N.zoomTo(c.startTime,c.stopTime)}let L,g,I;(!l(t.fullscreenButton)||t.fullscreenButton!==!1)&&(I=document.createElement("div"),I.className="cesium-viewer-fullscreenContainer",o.appendChild(I),L=new vz(I,t.fullscreenElement),g=yc(L.viewModel,"isFullscreenEnabled",function(H){I.style.display=H?"block":"none",l(N)&&(N.container.style.right=`${I.clientWidth}px`,N.resize())}));let T,w,R;if(t.vrButton){let H=document.createElement("div");H.className="cesium-viewer-vrContainer",o.appendChild(H),T=new eG(H,p,t.fullScreenElement),w=yc(T.viewModel,"isVREnabled",function(Y){H.style.display=Y?"block":"none",l(L)&&(H.style.right=`${I.clientWidth}px`),l(N)&&(N.container.style.right=`${H.clientWidth}px`,N.resize())}),R=yc(T.viewModel,"isVRMode",function(Y){d1t(i,Y)})}this._baseLayerPickerDropDown=B,this._fullscreenSubscription=g,this._vrSubscription=w,this._vrModeSubscription=R,this._dataSourceChangedListeners={},this._container=e,this._bottomContainer=a,this._element=o,this._cesiumWidget=h,this._selectionIndicator=m,this._infoBox=_,this._clockViewModel=u,this._destroyClockViewModel=f,this._toolbar=y,this._homeButton=E,this._sceneModePicker=b,this._projectionPicker=x,this._baseLayerPicker=S,this._navigationHelpButton=v,this._animation=P,this._timeline=N,this._fullscreenButton=L,this._vrButton=T,this._geocoder=C,this._eventHelper=A,this._lastWidth=0,this._lastHeight=0,this._enableInfoOrSelection=l(_)||l(m),this._selectedEntity=void 0,this._selectedEntityChanged=new _e;let O=this._cesiumWidget.dataSources,G=this._cesiumWidget.dataSourceDisplay;A.add(O.dataSourceAdded,po.prototype._onDataSourceAdded,this),A.add(O.dataSourceRemoved,po.prototype._onDataSourceRemoved,this),A.add(p.postUpdate,po.prototype.resize,this);let F=O.length;for(let H=0;H<F;H++)this._dataSourceAdded(O,O.get(H));this._dataSourceAdded(void 0,G.defaultDataSource),A.add(O.dataSourceAdded,po.prototype._dataSourceAdded,this),A.add(O.dataSourceRemoved,po.prototype._dataSourceRemoved,this);function U(H){let Y=Kve(i,H);l(Y)?q.getValueOrUndefined(Y.position,i.clock.currentTime)?i.trackedEntity=Y:i.zoomTo(Y):l(i.trackedEntity)&&(i.trackedEntity=void 0)}function Q(H){i.selectedEntity=Kve(i,H)}h.screenSpaceEventHandler.setInputAction(Q,Bn.LEFT_CLICK),h.screenSpaceEventHandler.setInputAction(U,Bn.LEFT_DOUBLE_CLICK),h._canAnimateUpdateCallback=this._updateCanAnimate(this)}Object.defineProperties(po.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._cesiumWidget.dataSourceDisplay}},entities:{get:function(){return this._cesiumWidget.entities}},dataSources:{get:function(){return this._cesiumWidget.dataSources}},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._cesiumWidget.allowDataSourcesToSuspendAnimation},set:function(e){this._cesiumWidget.allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._cesiumWidget.trackedEntity},set:function(e){this._cesiumWidget.trackedEntity=e}},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._cesiumWidget.trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._cesiumWidget.clockTrackedDataSource},set:function(e){this._cesiumWidget.clockTrackedDataSource!==e&&(this._cesiumWidget.clockTrackedDataSource=e,Lie(this._timeline,e))}}});po.prototype.extend=function(e,t){e(this,t)};po.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 a=i-125,s=this._baseLayerPickerDropDown;if(l(s)&&(s.style.maxHeight=`${a}px`),l(this._geocoder)){let m=this._geocoder.searchSuggestionsContainer;m.style.maxHeight=`${a}px`}l(this._infoBox)&&(this._infoBox.viewModel.maxHeight=a);let c=this._timeline,u,f=0,h=5,p=3,A=0;if(o&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let m=this._lastWidth;u=this._animation.container,n>900?(f=169,m<=900&&(u.style.width="169px",u.style.height="112px",this._animation.resize())):n>=600?(f=136,(m<600||m>900)&&(u.style.width="136px",u.style.height="90px",this._animation.resize())):(f=106,(m>600||m===0)&&(u.style.width="106px",u.style.height="70px",this._animation.resize())),h=f+5}if(r&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let m=this._fullscreenButton,_=this._vrButton,y=c.container,C=y.style;p=y.clientHeight+3,C.left=`${f}px`;let E=0;l(m)&&(E+=m.container.clientWidth),l(_)&&(E+=_.container.clientWidth),C.right=`${E}px`,c.resize()}!r&&l(this._fullscreenButton)&&(A=this._fullscreenButton.container.clientWidth),this._bottomContainer.style.left=`${h}px`,this._bottomContainer.style.bottom=`${p}px`,this._bottomContainer.style.right=`${A}px`,this._lastWidth=n,this._lastHeight=i};po.prototype.forceResize=function(){this._lastWidth=0,this.resize()};po.prototype.render=function(){this._cesiumWidget.render()};po.prototype.isDestroyed=function(){return!1};po.prototype.destroy=function(){return l(this.screenSpaceEventHandler)&&!this.screenSpaceEventHandler.isDestroyed()&&(this.screenSpaceEventHandler.removeInputAction(Bn.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(Bn.LEFT_DOUBLE_CLICK)),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",Jve,!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._cesiumWidget=this._cesiumWidget.destroy(),fe(this)};po.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(po.prototype._onEntityCollectionChanged,this)};po.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(po.prototype._onEntityCollectionChanged,this),l(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};po.prototype._updateCanAnimate=function(e){return function(t){e._clockViewModel.canAnimate=t}};po.prototype._onTick=function(e){let t=e.currentTime,n,i=!1,o=this.selectedEntity,r=l(o)&&this._enableInfoOrSelection;r&&o.isShowing&&o.isAvailable(t)&&(this._cesiumWidget.dataSourceDisplay.getBoundingSphere(o,!0,qve)!==Ct.FAILED?n=qve.center:l(o.position)&&(n=o.position.getValue(t,n)),i=l(n));let a=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(a)&&(a.position=d.clone(n,a.position),a.showSelection=r&&i,a.update());let s=l(this._infoBox)?this._infoBox.viewModel:void 0;l(s)&&(s.showInfo=r,s.enableCamera=i,s.isCameraTracking=this.trackedEntity===this.selectedEntity,r?(s.titleText=o.name??o.id,s.description=q.getValueOrDefault(o.description,t,"")):(s.titleText="",s.description=""))};po.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let o=0;o<i;o++){let r=n[o];this.selectedEntity===r&&(this.selectedEntity=void 0)}};po.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)}};po.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};po.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};po.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};po.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&Lie(this.timeline,e)};po.prototype._onDataSourceAdded=function(e,t){this._cesiumWidget._automaticallyTrackDataSourceClocks&&t===this.clockTrackedDataSource&&Lie(this._timeline,t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,po.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};po.prototype._onDataSourceRemoved=function(e,t){let n=t.entities.id;this._dataSourceChangedListeners[n](),this._dataSourceChangedListeners[n]=void 0};po.prototype.zoomTo=function(e,t){return this._cesiumWidget.zoomTo(e,t)};po.prototype.flyTo=function(e,t){return this._cesiumWidget.flyTo(e,t)};var Oie=po;function h1t(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new Ez(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var Fie=h1t;function m1t(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new Bz(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var Qie=m1t;function p1t(e,t){t=t??V.EMPTY_OBJECT;let n=!0,i=t.flyToOnDrop??!0,o=new _e,r=t.clearOnDrop??!0,a=t.dropTarget??e.container,s=t.clampToGround??!0,c=t.proxy;a=kn(a),Object.defineProperties(e,{dropTarget:{get:function(){return a},set:function(f){Zve(a,u),a=f,kie(a,u)}},dropEnabled:{get:function(){return n},set:function(f){f!==n&&(f?kie(a,u):Zve(a,u),n=f)}},dropError:{get:function(){return o}},clearOnDrop:{get:function(){return r},set:function(f){r=f}},flyToOnDrop:{get:function(){return i},set:function(f){i=f}},proxy:{get:function(){return c},set:function(f){c=f}},clampToGround:{get:function(){return s},set:function(f){s=f}}});function u(f){rx(f),r&&(e.entities.removeAll(),e.dataSources.removeAll());let h=f.dataTransfer.files,p=h.length;for(let A=0;A<p;A++){let m=h[A],_=new FileReader;_.onload=A1t(e,m,c,s),_.onerror=g1t(e,m),_.readAsText(m)}}kie(a,u),e.destroy=ik(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=u}function rx(e){e.stopPropagation(),e.preventDefault()}function Zve(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",rx,!1),n.removeEventListener("dragover",rx,!1),n.removeEventListener("dragexit",rx,!1))}function kie(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",rx,!1),e.addEventListener("dragover",rx,!1),e.addEventListener("dragexit",rx,!1)}function A1t(e,t,n,i){let o=e.scene;return function(r){let a=t.name;try{let s;if(/\.czml$/i.test(a))s=ZF.load(JSON.parse(r.target.result),{sourceUri:a});else if(/\.geojson$/i.test(a)||/\.json$/i.test(a)||/\.topojson$/i.test(a))s=DC.load(JSON.parse(r.target.result),{sourceUri:a,clampToGround:i});else if(/\.(kml|kmz)$/i.test(a))s=nI.load(t,{sourceUri:a,proxy:n,camera:o.camera,canvas:o.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(a))s=b2.load(t,{sourceUri:a,proxy:n});else{e.dropError.raiseEvent(e,a,`Unrecognized file: ${a}`);return}l(s)&&e.dataSources.add(s).then(function(c){e.flyToOnDrop&&e.flyTo(c)}).catch(function(c){e.dropError.raiseEvent(e,a,c)})}catch(s){e.dropError.raiseEvent(e,a,s)}}}function g1t(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var Uie=p1t;function _1t(e,t){t=t??V.EMPTY_OBJECT;let n=new zz({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var zie=_1t;function $ve(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*/,a=t[n].match(o)[0].length;for(let s=n;s<t.length;s++){let c=t[s];c.match(o)[0].length>=a&&(c=c.slice(a)),i+=`${c}
`}return i}function _h(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:a}=o;t._definedProperties.push(r);let s=o.setPrimitiveFunction;s===!0&&(s=function(f){t._voxelPrimitive[r]=f});let c=o.getPrimitiveFunction;c===!0&&(c=function(){t[r]=t._voxelPrimitive[r]}),l(c)&&t._getPrimitiveFunctions.push(c);let u=xe.observable();return xe.defineProperty(t,r,{get:function(){return u()},set:function(f){typeof a=="number"&&typeof f=="string"&&(f=Number(f),isNaN(f)&&(f=a)),typeof a=="boolean"&&typeof f=="number"&&(f=f===1),u(f),l(s)&&l(t._voxelPrimitive)&&(s(f),e.requestRender())}}),t[r]=a,u}function i(o,r){return function(a){let s=t._voxelPrimitive[o].clone();s[r]=a,t._voxelPrimitive[o]=s}}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=$ve(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===_c.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsEllipsoid=o===_c.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsCylinder=o===_c.CYLINDER}}),n({name:"clippingBoxMaxXMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxXMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingBoxMaxXMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxXMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMaxX=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingBoxMinXMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinXMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingBoxMinXMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinXMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingBoxMinX",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMinX=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingBoxMaxYMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxYMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingBoxMaxYMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxYMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMaxY=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingBoxMinYMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinYMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingBoxMinYMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinYMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingBoxMinY",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMinY=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingBoxMaxZMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxZMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMaxZMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxZMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMaxZ=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingBoxMinZMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinZMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMinZMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinZMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingBoxMinZ",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMinZ=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingEllipsoidMaxLongitudeMin",initialValue:-D.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMaxLongitudeMax",initialValue:D.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitude=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMin",initialValue:-D.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMax",initialValue:D.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitude=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingEllipsoidMaxLatitudeMin",initialValue:-D.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMaxLatitudeMax",initialValue:D.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitude=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMin",initialValue:-D.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMax",initialValue:D.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitude=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingEllipsoidMaxHeightMin",initialValue:0,getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingEllipsoidMaxHeightMax",initialValue:1e5,getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingEllipsoidMinHeightMin",initialValue:-1e5,getPrimitiveFunction:function(){t.clippingEllipsoidMinHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingEllipsoidMinHeightMax",initialValue:0,getPrimitiveFunction:function(){t.clippingEllipsoidMinHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingCylinderMaxRadiusMin",initialValue:0,getPrimitiveFunction:function(){t.clippingCylinderMaxRadiusMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingCylinderMaxRadiusMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMaxRadiusMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMaxRadius=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingCylinderMinRadiusMin",initialValue:0,getPrimitiveFunction:function(){t.clippingCylinderMinRadiusMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingCylinderMinRadiusMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMinRadiusMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMinRadius=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingCylinderMaxAngleMin",initialValue:-D.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingCylinderMaxAngleMax",initialValue:D.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMaxAngle=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingCylinderMinAngleMin",initialValue:-D.PI}),n({name:"clippingCylinderMinAngleMax",initialValue:D.PI}),n({name:"clippingCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMinAngle=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingCylinderMaxHeightMin",initialValue:-1,getPrimitiveFunction:function(){t.clippingCylinderMaxHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingCylinderMaxHeightMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMaxHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingCylinderMinHeightMin",initialValue:-1,getPrimitiveFunction:function(){t.clippingCylinderMinHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingCylinderMinHeightMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMinHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"translationX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&yA(t)},getPrimitiveFunction:function(){t.translationX=M.getTranslation(t._voxelPrimitive.modelMatrix,new d).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&yA(t)},getPrimitiveFunction:function(){t.translationY=M.getTranslation(t._voxelPrimitive.modelMatrix,new d).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&yA(t)},getPrimitiveFunction:function(){t.translationZ=M.getTranslation(t._voxelPrimitive.modelMatrix,new d).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&yA(t)},getPrimitiveFunction:function(){t.scaleX=M.getScale(t._voxelPrimitive.modelMatrix,new d).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&yA(t)},getPrimitiveFunction:function(){t.scaleY=M.getScale(t._voxelPrimitive.modelMatrix,new d).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&yA(t)},getPrimitiveFunction:function(){t.scaleZ=M.getScale(t._voxelPrimitive.modelMatrix,new d).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&yA(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&yA(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&yA(t)}})}var y1t=new d,C1t=new d,E1t=new Ec,b1t=new J;function yA(e){let t=d.fromElements(e.translationX,e.translationY,e.translationZ,y1t),n=d.fromElements(e.scaleX,e.scaleY,e.scaleZ,C1t),i=E1t;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let o=J.fromHeadingPitchRoll(i,b1t),r=J.multiplyByScale(o,n,o);e._voxelPrimitive.modelMatrix=M.fromRotationTranslation(r,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(_h.prototype,{scene:{get:function(){return this._scene}},voxelPrimitive:{get:function(){return this._voxelPrimitive},set:function(e){if(l(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),!l(e))return;this._voxelPrimitive=e;let t=this;t._customShaderCompilationRemoveCallback=t._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(n){let i=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=$ve(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,yA(t)}}});_h.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};_h.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};_h.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};_h.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};_h.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};_h.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};_h.prototype.compileShader=function(){l(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new UI({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};_h.prototype.shaderEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,s=n.value.slice(i,o).split(`
`),c=s.length,u;if(t.shiftKey)for(u=0;u<c;++u)s[u][0]===" "&&(s[u][1]===" "?(s[u]=s[u].substr(2),r-=2):(s[u]=s[u].substr(1),r-=1));else for(u=0;u<c;++u)s[u]=` ${s[u]}`,r+=2;let f=s.join(`
`);n.value=n.value.slice(0,i)+f+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};_h.prototype.isDestroyed=function(){return!1};_h.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){xe.getObservable(e,t).dispose()}),fe(this)};var tG=_h;function _W(e,t){e=kn(e);let n=document.createElement("div"),i=new tG(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{createSection:a,createCheckbox:s,createRangeInput:c,createButton:u}=Zu,f=a(r,"Display","displayVisible","toggleDisplay"),h=a(r,"Transform","transformVisible","toggleTransform"),p=a(r,"Clipping","clippingVisible","toggleClipping"),A=a(r,"Shader","shaderVisible","toggleShader");f.appendChild(s("Depth Test","depthTest")),f.appendChild(s("Show","show")),f.appendChild(s("Disable Update","disableUpdate")),f.appendChild(s("Debug Draw","debugDraw")),f.appendChild(s("Jitter","jitter")),f.appendChild(s("Nearest Sampling","nearestSampling")),f.appendChild(c("Screen Space Error","screenSpaceError",0,128)),f.appendChild(c("Step Size","stepSize",0,2));let m=10,_=10,y=D.PI;h.appendChild(c("Translation X","translationX",-m,+m)),h.appendChild(c("Translation Y","translationY",-m,+m)),h.appendChild(c("Translation Z","translationZ",-m,+m)),h.appendChild(c("Scale X","scaleX",0,+_)),h.appendChild(c("Scale Y","scaleY",0,+_)),h.appendChild(c("Scale Z","scaleZ",0,+_)),h.appendChild(c("Heading","angleX",-y,+y)),h.appendChild(c("Pitch","angleY",-y,+y)),h.appendChild(c("Roll","angleZ",-y,+y)),Gie("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ","shapeIsBox",p),Gie("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight","shapeIsEllipsoid",p),Gie("Max Radius","Min Radius","Max Angle","Min Angle","Max Height","Min Height","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxAngle","clippingCylinderMinAngle","clippingCylinderMaxHeight","clippingCylinderMinHeight","shapeIsCylinder",p);let C=document.createElement("div");A.appendChild(C);let E=document.createElement("textarea");E.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),C.className="cesium-cesiumInspector-styleEditor",C.appendChild(E);let b=u("Compile (Ctrl+Enter)","compileShader");C.appendChild(b);let x=document.createElement("label");x.style.display="block",x.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),C.appendChild(x),xe.applyBindings(i,n)}Object.defineProperties(_W.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});_W.prototype.isDestroyed=function(){return!1};_W.prototype.destroy=function(){return xe.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),fe(this)};function Gie(e,t,n,i,o,r,a,s,c,u,f,h,p,A){let m=Zu.createRangeInputWithDynamicMinMax,_=A.appendChild(document.createElement("div"));_.setAttribute("data-bind",`if: ${p}`),_.appendChild(m(e,a)),_.appendChild(m(t,s)),_.appendChild(m(n,c)),_.appendChild(m(i,u)),_.appendChild(m(o,f)),_.appendChild(m(r,h))}var nG=_W;function I1t(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new nG(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var Vie=I1t;globalThis.CESIUM_VERSION="1.140.0";var x1t="1.140.0";0&&(module.exports={AlphaMode,AlphaPipelineStage,AnchorPointDirect,AnchorPointIndirect,Animation,AnimationViewModel,Appearance,ApproximateTerrainHeights,ArcGISTiledElevationTerrainProvider,ArcGisBaseMapType,ArcGisMapServerImageryProvider,ArcGisMapService,ArcType,ArticulationStageType,AssociativeArray,Atmosphere,AtmospherePipelineStage,AttributeCompression,AttributeType,AutoExposure,AutomaticUniforms,Axis,AxisAlignedBoundingBox,Azure2DImageryProvider,B3dmLoader,B3dmParser,BaseLayerPicker,BaseLayerPickerViewModel,BatchTable,BatchTableHierarchy,BatchTexture,BatchTexturePipelineStage,Billboard,BillboardCollection,BillboardGraphics,BillboardLoadState,BillboardTexture,BillboardVisualizer,BingMapsGeocoderService,BingMapsImageryProvider,BingMapsStyle,BlendEquation,BlendFunction,BlendOption,BlendingState,BoundingRectangle,BoundingSphere,BoundingSphereState,BoundingVolumeSemantics,BoxEmitter,BoxGeometry,BoxGeometryUpdater,BoxGraphics,BoxOutlineGeometry,BrdfLutGenerator,Buffer,BufferLoader,BufferPoint,BufferPointCollection,BufferPointMaterial,BufferPolygon,BufferPolygonCollection,BufferPolygonMaterial,BufferPolyline,BufferPolylineCollection,BufferPolylineMaterial,BufferPrimitive,BufferPrimitiveCollection,BufferPrimitiveMaterial,BufferUsage,CPUStylingPipelineStage,CallbackPositionProperty,CallbackProperty,Camera,CameraEventAggregator,CameraEventType,CameraFlightPath,Cartesian2,Cartesian3,Cartesian4,CartesianRectangle,Cartographic,CartographicGeocoderService,CatmullRomSpline,Cesium3DContentGroup,Cesium3DTile,Cesium3DTileBatchTable,Cesium3DTileColorBlendMode,Cesium3DTileContent,Cesium3DTileContentFactory,Cesium3DTileContentState,Cesium3DTileContentType,Cesium3DTileFeature,Cesium3DTileFeatureTable,Cesium3DTileOptimizationHint,Cesium3DTileOptimizations,Cesium3DTilePass,Cesium3DTilePassState,Cesium3DTilePointFeature,Cesium3DTileRefine,Cesium3DTileStyle,Cesium3DTileStyleEngine,Cesium3DTilesInspector,Cesium3DTilesInspectorViewModel,Cesium3DTilesTerrainData,Cesium3DTilesTerrainGeometryProcessor,Cesium3DTilesTerrainProvider,Cesium3DTilesVoxelProvider,Cesium3DTileset,Cesium3DTilesetBaseTraversal,Cesium3DTilesetCache,Cesium3DTilesetGraphics,Cesium3DTilesetHeatmap,Cesium3DTilesetMetadata,Cesium3DTilesetMostDetailedTraversal,Cesium3DTilesetSkipTraversal,Cesium3DTilesetStatistics,Cesium3DTilesetTraversal,Cesium3DTilesetVisualizer,CesiumInspector,CesiumInspectorViewModel,CesiumTerrainProvider,CesiumWidget,Check,CheckerboardMaterialProperty,CircleEmitter,CircleGeometry,CircleOutlineGeometry,ClassificationModelDrawCommand,ClassificationPipelineStage,ClassificationPrimitive,ClassificationType,ClearCommand,ClippingPlane,ClippingPlaneCollection,ClippingPolygon,ClippingPolygonCollection,Clock,ClockRange,ClockStep,ClockViewModel,CloudCollection,CloudType,Color,ColorBlendMode,ColorGeometryInstanceAttribute,ColorMaterialProperty,Command,ComponentDatatype,Composite3DTileContent,CompositeEntityCollection,CompositeMaterialProperty,CompositePositionProperty,CompositeProperty,CompressedTextureBuffer,ComputeCommand,ComputeEngine,ConditionsExpression,ConeEmitter,ConstantPositionProperty,ConstantProperty,ConstantSpline,ContentMetadata,Context,ContextLimits,CoplanarPolygonGeometry,CoplanarPolygonGeometryLibrary,CoplanarPolygonOutlineGeometry,CornerType,CorrelationGroup,CorridorGeometry,CorridorGeometryLibrary,CorridorGeometryUpdater,CorridorGraphics,CorridorOutlineGeometry,Credit,CreditDisplay,CubeMap,CubeMapFace,CubeMapPanorama,CubicRealPolynomial,CullFace,CullingVolume,CumulusCloud,CustomDataSource,CustomHeightmapTerrainProvider,CustomShader,CustomShaderMode,CustomShaderPipelineStage,CustomShaderTranslucencyMode,CylinderGeometry,CylinderGeometryLibrary,CylinderGeometryUpdater,CylinderGraphics,CylinderOutlineGeometry,CzmlDataSource,DataSource,DataSourceClock,DataSourceCollection,DataSourceDisplay,DebugAppearance,DebugCameraPrimitive,DebugInspector,DebugModelMatrixPrimitive,DefaultProxy,DepthFunction,DepthPlane,DequantizationPipelineStage,DerivedCommand,DeveloperError,DeviceOrientationCameraController,DirectionalLight,DiscardEmptyTileImagePolicy,DiscardMissingTileImagePolicy,DistanceDisplayCondition,DistanceDisplayConditionGeometryInstanceAttribute,DoubleEndedPriorityQueue,DoublyLinkedList,DracoLoader,DrawCommand,DynamicAtmosphereLightingType,DynamicEnvironmentMapManager,DynamicGeometryBatch,DynamicGeometryUpdater,EarthOrientationParameters,EarthOrientationParametersSample,EasingFunction,EdgeDetectionPipelineStage,EdgeFramebuffer,EdgeVisibilityPipelineStage,EllipseGeometry,EllipseGeometryLibrary,EllipseGeometryUpdater,EllipseGraphics,EllipseOutlineGeometry,Ellipsoid,EllipsoidGeodesic,EllipsoidGeometry,EllipsoidGeometryUpdater,EllipsoidGraphics,EllipsoidOutlineGeometry,EllipsoidPrimitive,EllipsoidRhumbLine,EllipsoidSurfaceAppearance,EllipsoidTangentPlane,EllipsoidTerrainProvider,EllipsoidalOccluder,Empty3DTileContent,EncodedCartesian3,Entity,EntityCluster,EntityCollection,EntityView,EquirectangularPanorama,Event,EventHelper,Expression,ExpressionNodeType,ExtrapolationType,FeatureDetection,FeatureIdPipelineStage,Fog,ForEach,FrameRateMonitor,FrameState,Framebuffer,FramebufferManager,Frozen,FrustumCommands,FrustumGeometry,FrustumOutlineGeometry,Fullscreen,FullscreenButton,FullscreenButtonViewModel,GaussianSplat3DTileContent,GaussianSplatPrimitive,GaussianSplatRenderResources,GaussianSplatSorter,GaussianSplatTextureGenerator,GeoJsonDataSource,GeoJsonLoader,GeocodeType,Geocoder,GeocoderService,GeocoderViewModel,GeographicProjection,GeographicTilingScheme,Geometry,Geometry3DTileContent,GeometryAttribute,GeometryAttributes,GeometryFactory,GeometryInstance,GeometryInstanceAttribute,GeometryOffsetAttribute,GeometryPipeline,GeometryPipelineStage,GeometryType,GeometryUpdater,GeometryUpdaterSet,GeometryVisualizer,GetFeatureInfoFormat,Globe,GlobeDepth,GlobeSurfaceShaderSet,GlobeSurfaceTile,GlobeSurfaceTileProvider,GlobeTranslucency,GlobeTranslucencyFramebuffer,GlobeTranslucencyState,GltfBufferViewLoader,GltfDracoLoader,GltfGpmLoader,GltfGpmLocal,GltfImageLoader,GltfIndexBufferLoader,GltfJsonLoader,GltfLoader,GltfLoaderUtil,GltfMeshPrimitiveGpmLoader,GltfSpzLoader,GltfStructuralMetadataLoader,GltfTextureLoader,GltfVertexBufferLoader,Google2DImageryProvider,GoogleEarthEnterpriseImageryProvider,GoogleEarthEnterpriseMapsProvider,GoogleEarthEnterpriseMetadata,GoogleEarthEnterpriseTerrainData,GoogleEarthEnterpriseTerrainProvider,GoogleEarthEnterpriseTileInformation,GoogleGeocoderService,GoogleMaps,GoogleStreetViewCubeMapPanoramaProvider,GpxDataSource,GregorianDate,GridImageryProvider,GridMaterialProperty,GroundGeometryUpdater,GroundPolylineGeometry,GroundPolylinePrimitive,GroundPrimitive,GroupMetadata,HeadingPitchRange,HeadingPitchRoll,Heap,HeightReference,HeightmapEncoding,HeightmapTerrainData,HeightmapTessellator,HermitePolynomialApproximation,HermiteSpline,HilbertOrder,HomeButton,HomeButtonViewModel,HorizontalOrigin,I3SBuildingSceneLayerExplorer,I3SBuildingSceneLayerExplorerViewModel,I3SDataProvider,I3SDecoder,I3SFeature,I3SField,I3SGeometry,I3SLayer,I3SNode,I3SStatistics,I3SSublayer,I3SSymbology,I3dmLoader,I3dmParser,ITwinData,ITwinPlatform,Iau2000Orientation,Iau2006XysData,Iau2006XysSample,IauOrientationAxes,IauOrientationParameters,ImageBasedLighting,ImageBasedLightingPipelineStage,ImageMaterialProperty,Imagery,ImageryConfiguration,ImageryCoverage,ImageryFlags,ImageryInput,ImageryLayer,ImageryLayerCollection,ImageryLayerFeatureInfo,ImageryPipelineStage,ImageryProvider,ImageryState,Implicit3DTileContent,ImplicitAvailabilityBitstream,ImplicitMetadataView,ImplicitSubdivisionScheme,ImplicitSubtree,ImplicitSubtreeCache,ImplicitSubtreeMetadata,ImplicitTileCoordinates,ImplicitTileset,IndexDatatype,InfoBox,InfoBoxViewModel,InspectorShared,InstanceAttributeSemantic,InstancingPipelineStage,InterpolationAlgorithm,InterpolationType,Intersect,IntersectionTests,Intersections2D,Interval,InvertClassification,Ion,IonGeocodeProviderType,IonGeocoderService,IonImageryProvider,IonImageryProviderFactory,IonResource,IonWorldImageryStyle,Iso8601,JobScheduler,JobType,JsonMetadataTable,JulianDate,KTX2Transcoder,KeyboardEventModifier,KeyframeNode,KmlCamera,KmlDataSource,KmlLookAt,KmlTour,KmlTourFlyTo,KmlTourWait,Label,LabelCollection,LabelGraphics,LabelStyle,LabelVisualizer,LagrangePolynomialApproximation,LeapSecond,Light,LightingModel,LightingPipelineStage,LinearApproximation,LinearSpline,ManagedArray,MapMode2D,MapProjection,MapboxImageryProvider,MapboxStyleImageryProvider,MappedPositions,Mars3DEx,Material,MaterialAppearance,MaterialPipelineStage,MaterialProperty,Math,Matrix2,Matrix3,Matrix4,Megatexture,MeshPrimitiveGpmLocal,MetadataClass,MetadataClassProperty,MetadataComponentType,MetadataEntity,MetadataEnum,MetadataEnumValue,MetadataPicking,MetadataPickingPipelineStage,MetadataPipelineStage,MetadataSchema,MetadataSchemaLoader,MetadataSemantic,MetadataTable,MetadataTableProperty,MetadataType,MipmapHint,Model,Model3DTileContent,ModelAlphaOptions,ModelAnimation,ModelAnimationChannel,ModelAnimationCollection,ModelAnimationLoop,ModelAnimationState,ModelArticulation,ModelArticulationStage,ModelClippingPlanesPipelineStage,ModelClippingPolygonsPipelineStage,ModelColorPipelineStage,ModelComponents,ModelDrawCommand,ModelDrawCommands,ModelFeature,ModelFeatureTable,ModelGraphics,ModelImagery,ModelImageryMapping,ModelLightingOptions,ModelMatrixUpdateStage,ModelNode,ModelPrimitiveImagery,ModelReader,ModelRenderResources,ModelRuntimeNode,ModelRuntimePrimitive,ModelSceneGraph,ModelSilhouettePipelineStage,ModelSkin,ModelSplitterPipelineStage,ModelStatistics,ModelType,ModelUtility,ModelVisualizer,Moon,MorphTargetsPipelineStage,MorphWeightSpline,MortonOrder,Multiple3DTileContent,MultisampleFramebuffer,NavigationHelpButton,NavigationHelpButtonViewModel,NearFarScalar,NeverTileDiscardPolicy,NodeRenderResources,NodeStatisticsPipelineStage,NodeTransformationProperty,OIT,Occluder,OffsetGeometryInstanceAttribute,OpenCageGeocoderService,OpenStreetMapImageryProvider,OrderedGroundPrimitiveCollection,OrientedBoundingBox,OrthographicFrustum,OrthographicOffCenterFrustum,Packable,PackableForInterpolation,Panorama,PanoramaProvider,Particle,ParticleBurst,ParticleEmitter,ParticleSystem,Pass,PassState,PathGraphics,PathVisualizer,PeliasGeocoderService,PerInstanceColorAppearance,PerformanceDisplay,PerformanceWatchdog,PerformanceWatchdogViewModel,PerspectiveFrustum,PerspectiveOffCenterFrustum,PickDepth,PickDepthFramebuffer,PickFramebuffer,PickId,PickedMetadataInfo,Picking,PickingPipelineStage,PinBuilder,PixelDatatype,PixelFormat,Plane,PlaneGeometry,PlaneGeometryUpdater,PlaneGraphics,PlaneOutlineGeometry,PntsLoader,PntsParser,PointCloud,PointCloudEyeDomeLighting,PointCloudShading,PointCloudStylingPipelineStage,PointGraphics,PointPrimitive,PointPrimitiveCollection,PointVisualizer,PolygonGeometry,PolygonGeometryLibrary,PolygonGeometryUpdater,PolygonGraphics,PolygonHierarchy,PolygonOutlineGeometry,PolygonPipeline,Polyline,PolylineArrowMaterialProperty,PolylineCollection,PolylineColorAppearance,PolylineDashMaterialProperty,PolylineGeometry,PolylineGeometryUpdater,PolylineGlowMaterialProperty,PolylineGraphics,PolylineMaterialAppearance,PolylineOutlineMaterialProperty,PolylinePipeline,PolylineVisualizer,PolylineVolumeGeometry,PolylineVolumeGeometryLibrary,PolylineVolumeGeometryUpdater,PolylineVolumeGraphics,PolylineVolumeOutlineGeometry,PositionProperty,PositionPropertyArray,PostProcessStage,PostProcessStageCollection,PostProcessStageComposite,PostProcessStageLibrary,PostProcessStageSampleMode,PostProcessStageTextureCache,PpeMetadata,PpeSource,PpeTexture,Primitive,PrimitiveCollection,PrimitiveLoadPlan,PrimitiveOutlineGenerator,PrimitiveOutlinePipelineStage,PrimitivePipeline,PrimitiveRenderResources,PrimitiveState,PrimitiveStatisticsPipelineStage,PrimitiveType,ProjectionPicker,ProjectionPickerViewModel,Property,PropertyArray,PropertyAttribute,PropertyAttributeProperty,PropertyBag,PropertyTable,PropertyTexture,PropertyTextureProperty,ProviderViewModel,Proxy,QuadraticRealPolynomial,QuadtreeOccluders,QuadtreePrimitive,QuadtreeTile,QuadtreeTileLoadState,QuadtreeTileProvider,QuantizedMeshTerrainData,QuarticRealPolynomial,Quaternion,QuaternionSpline,Queue,Ray,Rectangle,RectangleCollisionChecker,RectangleGeometry,RectangleGeometryLibrary,RectangleGeometryUpdater,RectangleGraphics,RectangleOutlineGeometry,ReferenceFrame,ReferenceProperty,RenderState,Renderbuffer,RenderbufferFormat,Request,RequestErrorEvent,RequestScheduler,RequestState,RequestType,Resource,ResourceCache,ResourceCacheKey,ResourceCacheStatistics,ResourceLoader,ResourceLoaderState,Rotation,RuntimeError,S2Cell,SDFSettings,SampledPositionProperty,SampledProperty,Sampler,ScaledPositionProperty,Scene,SceneFramebuffer,SceneMode,SceneMode2DPipelineStage,SceneModePicker,SceneModePickerViewModel,SceneTransforms,SceneTransitioner,ScreenSpaceCameraController,ScreenSpaceEventHandler,ScreenSpaceEventType,SelectedFeatureIdPipelineStage,SelectionIndicator,SelectionIndicatorViewModel,SensorVolumePortionToDisplay,ShaderBuilder,ShaderCache,ShaderDestination,ShaderFunction,ShaderProgram,ShaderSource,ShaderStruct,ShadowMap,ShadowMapShader,ShadowMode,ShadowVolumeAppearance,SharedContext,ShowGeometryInstanceAttribute,Simon1994PlanetaryPositions,SimplePolylineGeometry,SingleTileImageryProvider,SkinningPipelineStage,SkyAtmosphere,SkyBox,SpatialNode,Spdcf,SpecularEnvironmentCubeMap,SphereEmitter,SphereGeometry,SphereOutlineGeometry,Spherical,Spline,SplitDirection,Splitter,StaticGeometryColorBatch,StaticGeometryPerMaterialBatch,StaticGroundGeometryColorBatch,StaticGroundGeometryPerMaterialBatch,StaticGroundPolylinePerMaterialBatch,StaticOutlineGeometryBatch,StencilConstants,StencilFunction,StencilOperation,SteppedSpline,Stereographic,StorageType,StripeMaterialProperty,StripeOrientation,StructuralMetadata,StyleCommandsNeeded,StyleExpression,Sun,SunLight,SunPostProcess,SupportedImageFormats,SvgPathBindingHandler,Sync,TaskProcessor,Terrain,TerrainData,TerrainEncoding,TerrainFillMesh,TerrainMesh,TerrainOffsetProperty,TerrainPicker,TerrainProvider,TerrainQuantization,TerrainState,Texture,Texture3D,TextureAtlas,TextureCache,TextureMagnificationFilter,TextureManager,TextureMinificationFilter,TexturePacker,TextureUniform,TextureWrap,TileAvailability,TileBoundingRegion,TileBoundingS2Cell,TileBoundingSphere,TileBoundingVolume,TileCoordinatesImageryProvider,TileDiscardPolicy,TileEdge,TileImagery,TileMapServiceImageryProvider,TileMetadata,TileOrientedBoundingBox,TileProviderError,TileReplacementQueue,TileSelectionResult,TileState,Tileset3DTileContent,TilesetMetadata,TilesetPipelineStage,TilingScheme,TimeConstants,TimeDynamicImagery,TimeDynamicPointCloud,TimeInterval,TimeIntervalCollection,TimeIntervalCollectionPositionProperty,TimeIntervalCollectionProperty,TimeStandard,Timeline,TimelineHighlightRange,TimelineTrack,Tipsify,ToggleButtonViewModel,Tonemapper,TrackingReferenceFrame,Transforms,TranslationRotationScale,TranslucentTileClassification,TridiagonalSystemSolver,TrustedServers,TweenCollection,UniformState,UniformType,UrlTemplateImageryProvider,VERSION,VRButton,VRButtonViewModel,VRTheWorldTerrainProvider,VaryingType,Vector3DTileBatch,Vector3DTileClampedPolylines,Vector3DTileContent,Vector3DTileGeometry,Vector3DTilePoints,Vector3DTilePolygons,Vector3DTilePolylines,Vector3DTilePrimitive,VectorGltf3DTileContent,VelocityOrientationProperty,VelocityVectorProperty,VertexArray,VertexArrayFacade,VertexAttributeSemantic,VertexFormat,VerticalExaggeration,VerticalExaggerationPipelineStage,VerticalOrigin,VideoSynchronizer,View,Viewer,ViewportQuad,Visibility,Visualizer,VoxelBoundsCollection,VoxelBoxShape,VoxelCell,VoxelContent,VoxelCylinderShape,VoxelEllipsoidShape,VoxelInspector,VoxelInspectorViewModel,VoxelMetadataOrder,VoxelPrimitive,VoxelProvider,VoxelRenderResources,VoxelShape,VoxelShapeType,VoxelTraversal,VulkanConstants,WallGeometry,WallGeometryLibrary,WallGeometryUpdater,WallGraphics,WallOutlineGeometry,WebGLConstants,WebMapServiceImageryProvider,WebMapTileServiceImageryProvider,WebMercatorProjection,WebMercatorTilingScheme,WindingOrder,WireframeIndexGenerator,WireframePipelineStage,_shadersAcesTonemappingStage,_shadersAdditiveBlend,_shadersAdjustTranslucentFS,_shadersAllMaterialAppearanceFS,_shadersAllMaterialAppearanceVS,_shadersAmbientOcclusionGenerate,_shadersAmbientOcclusionModulate,_shadersAspectRampMaterial,_shadersAtmosphereCommon,_shadersAtmosphereStageFS,_shadersAtmosphereStageVS,_shadersBasicMaterialAppearanceFS,_shadersBasicMaterialAppearanceVS,_shadersBillboardCollectionFS,_shadersBillboardCollectionVS,_shadersBlackAndWhite,_shadersBloomComposite,_shadersBrdfLutGeneratorFS,_shadersBrightPass,_shadersBrightness,_shadersBufferPointMaterialFS,_shadersBufferPointMaterialVS,_shadersBufferPolygonMaterialFS,_shadersBufferPolygonMaterialVS,_shadersBufferPolylineMaterialFS,_shadersBufferPolylineMaterialVS,_shadersBumpMapMaterial,_shadersCPUStylingStageFS,_shadersCPUStylingStageVS,_shadersCheckerboardMaterial,_shadersCloudCollectionFS,_shadersCloudCollectionVS,_shadersCloudNoiseFS,_shadersCloudNoiseVS,_shadersCompareAndPackTranslucentDepth,_shadersCompositeOITFS,_shadersCompositeTranslucentClassification,_shadersComputeIrradianceFS,_shadersComputeRadianceMapFS,_shadersConstantLodStageFS,_shadersConstantLodStageVS,_shadersContrastBias,_shadersConvolveSpecularMapFS,_shadersConvolveSpecularMapVS,_shadersCubeMapPanoramaVS,_shadersCustomShaderStageFS,_shadersCustomShaderStageVS,_shadersCzmBuiltins,_shadersDepthOfField,_shadersDepthPlaneFS,_shadersDepthPlaneVS,_shadersDepthView,_shadersDepthViewPacked,_shadersDotMaterial,_shadersEdgeDetection,_shadersEdgeDetectionStageFS,_shadersEdgeVisibilityStageFS,_shadersEdgeVisibilityStageVS,_shadersElevationBandMaterial,_shadersElevationContourMaterial,_shadersElevationRampMaterial,_shadersEllipsoidFS,_shadersEllipsoidSurfaceAppearanceFS,_shadersEllipsoidSurfaceAppearanceVS,_shadersEllipsoidVS,_shadersFXAA,_shadersFXAA3_11,_shadersFadeMaterial,_shadersFeatureIdStageFS,_shadersFeatureIdStageVS,_shadersFilmicTonemapping,_shadersGaussianBlur1D,_shadersGeometryStageFS,_shadersGeometryStageVS,_shadersGlobeFS,_shadersGlobeVS,_shadersGridMaterial,_shadersGroundAtmosphere,_shadersHSBToRGB,_shadersHSLToRGB,_shadersImageBasedLightingStageFS,_shadersInstancingStageCommon,_shadersInstancingStageVS,_shadersIntersectBox,_shadersIntersectCylinder,_shadersIntersectDepth,_shadersIntersectEllipsoid,_shadersIntersectLongitude,_shadersIntersectPlane,_shadersIntersection,_shadersIntersectionUtils,_shadersLegacyInstancingStageVS,_shadersLensFlare,_shadersLightingStageFS,_shadersMaterialStageFS,_shadersMegatexture,_shadersMetadataStageFS,_shadersMetadataStageVS,_shadersModelClippingPlanesStageFS,_shadersModelClippingPolygonsStageFS,_shadersModelClippingPolygonsStageVS,_shadersModelColorStageFS,_shadersModelFS,_shadersModelSilhouetteStageFS,_shadersModelSilhouetteStageVS,_shadersModelSplitterStageFS,_shadersModelVS,_shadersModifiedReinhardTonemapping,_shadersMorphTargetsStageVS,_shadersNightVision,_shadersNormalMapMaterial,_shadersOctree,_shadersPassThrough,_shadersPassThroughDepth,_shadersPbrNeutralTonemapping,_shadersPerInstanceColorAppearanceFS,_shadersPerInstanceColorAppearanceVS,_shadersPerInstanceFlatColorAppearanceFS,_shadersPerInstanceFlatColorAppearanceVS,_shadersPointCloudEyeDomeLighting,_shadersPointCloudStylingStageVS,_shadersPointPrimitiveCollectionFS,_shadersPointPrimitiveCollectionVS,_shadersPolygonSignedDistanceFS,_shadersPolylineArrowMaterial,_shadersPolylineColorAppearanceVS,_shadersPolylineCommon,_shadersPolylineDashMaterial,_shadersPolylineFS,_shadersPolylineGlowMaterial,_shadersPolylineMaterialAppearanceVS,_shadersPolylineOutlineMaterial,_shadersPolylineShadowVolumeFS,_shadersPolylineShadowVolumeMorphFS,_shadersPolylineShadowVolumeMorphVS,_shadersPolylineShadowVolumeVS,_shadersPolylineVS,_shadersPrimitiveGaussianSplatFS,_shadersPrimitiveGaussianSplatVS,_shadersPrimitiveOutlineStageFS,_shadersPrimitiveOutlineStageVS,_shadersRGBToHSB,_shadersRGBToHSL,_shadersRGBToXYZ,_shadersReinhardTonemapping,_shadersReprojectWebMercatorFS,_shadersReprojectWebMercatorVS,_shadersRimLightingMaterial,_shadersSelectedFeatureIdStageCommon,_shadersShadowVolumeAppearanceFS,_shadersShadowVolumeAppearanceVS,_shadersShadowVolumeFS,_shadersSilhouette,_shadersSkinningStageVS,_shadersSkyAtmosphereCommon,_shadersSkyAtmosphereFS,_shadersSkyAtmosphereVS,_shadersSkyBoxFS,_shadersSkyBoxVS,_shadersSlopeRampMaterial,_shadersStripeMaterial,_shadersSunFS,_shadersSunTextureFS,_shadersSunVS,_shadersTexturedMaterialAppearanceFS,_shadersTexturedMaterialAppearanceVS,_shadersVector3DTileClampedPolylinesFS,_shadersVector3DTileClampedPolylinesVS,_shadersVector3DTilePolylinesVS,_shadersVectorTileVS,_shadersVerticalExaggerationStageVS,_shadersViewportQuadFS,_shadersViewportQuadVS,_shadersVoxelFS,_shadersVoxelUtils,_shadersVoxelVS,_shadersWater,_shadersWaterMaskMaterial,_shadersXYZToRGB,_shadersacesTonemapping,_shadersalphaWeight,_shadersantialias,_shadersapplyHSBShift,_shadersapproximateSphericalCoordinates,_shadersapproximateTanh,_shadersbackFacing,_shadersbranchFreeTernary,_shaderscascadeColor,_shaderscascadeDistance,_shaderscascadeMatrix,_shaderscascadeWeights,_shadersclipPolygons,_shaderscolumbusViewMorph,_shaderscomputeAtmosphereColor,_shaderscomputeGroundAtmosphereScattering,_shaderscomputePosition,_shaderscomputeScattering,_shaderscomputeTextureTransform,_shadersconvertLocalToBoxUv,_shadersconvertLocalToCylinderUv,_shadersconvertLocalToEllipsoidUv,_shaderscosineAndSine,_shadersdecodeRGB8,_shadersdecompressTextureCoordinates,_shadersdegreesPerRadian,_shadersdepthClamp,_shadersdepthRange,_shadersdepthRangeStruct,_shaderseastNorthUpToEyeCoordinates,_shadersellipsoidContainsPoint,_shadersellipsoidTextureCoordinates,_shadersepsilon1,_shadersepsilon2,_shadersepsilon3,_shadersepsilon4,_shadersepsilon5,_shadersepsilon6,_shadersepsilon7,_shadersequalsEpsilon,_shaderseyeOffset,_shaderseyeToWindowCoordinates,_shadersfastApproximateAtan,_shadersfog,_shadersgammaCorrect,_shadersgeodeticSurfaceNormal,_shadersgetDefaultMaterial,_shadersgetDynamicAtmosphereLightDirection,_shadersgetLambertDiffuse,_shadersgetSpecular,_shadersgetWaterNoise,_shadershue,_shadersinfinity,_shadersinverseGamma,_shadersisEmpty,_shadersisFull,_shaderslatitudeToWebMercatorFraction,_shaderslineDistance,_shaderslinearToSrgb,_shadersluminance,_shadersmaterial,_shadersmaterialInput,_shadersmaximumComponent,_shadersmetersPerPixel,_shadersmodelMaterial,_shadersmodelToWindowCoordinates,_shadersmodelVertexOutput,_shadersmultiplyWithColorBalance,_shadersnearFarScalar,_shadersoctDecode,_shadersoneOverPi,_shadersoneOverTwoPi,_shaderspackDepth,_shaderspassCesium3DTile,_shaderspassCesium3DTileClassification,_shaderspassCesium3DTileClassificationIgnoreShow,_shaderspassCesium3DTileEdges,_shaderspassClassification,_shaderspassCompute,_shaderspassEnvironment,_shaderspassGaussianSplats,_shaderspassGlobe,_shaderspassOpaque,_shaderspassOverlay,_shaderspassTerrainClassification,_shaderspassTranslucent,_shaderspassVoxels,_shaderspbrLighting,_shaderspbrNeutralTonemapping,_shadersphong,_shaderspi,_shaderspiOverFour,_shaderspiOverSix,_shaderspiOverThree,_shaderspiOverTwo,_shadersplaneDistance,_shaderspointAlongRay,_shadersradiansPerDegree,_shadersray,_shadersrayEllipsoidIntersectionInterval,_shadersraySegment,_shadersraySphereIntersectionInterval,_shadersreadDepth,_shadersreadNonPerspective,_shadersreverseLogDepth,_shadersround,_shaderssaturation,_shaderssceneMode2D,_shaderssceneMode3D,_shaderssceneModeColumbusView,_shaderssceneModeMorphing,_shadersshadowDepthCompare,_shadersshadowParameters,_shadersshadowVisibility,_shaderssignNotZero,_shaderssolarRadius,_shaderssphericalHarmonics,_shaderssrgbToLinear,_shaderstangentToEyeSpaceMatrix,_shaderstextureCube,_shadersthreePiOver2,_shaderstransformPlane,_shaderstranslateRelativeToEye,_shaderstranslucentPhong,_shaderstranspose,_shaderstwoPi,_shadersunpackClippingExtents,_shadersunpackDepth,_shadersunpackFloat,_shadersunpackTexture,_shadersunpackUint,_shadersvalueTransform,_shadersvertexLogDepth,_shaderswebMercatorMaxLatitude,_shaderswindowToEyeCoordinates,_shaderswriteDepthClamp,_shaderswriteLogDepth,_shaderswriteNonPerspective,addAllToArray,addBuffer,addDefaults,addExtensionsRequired,addExtensionsUsed,addPipelineExtras,addToArray,appendForwardSlash,arrayRemoveDuplicates,assert,barycentricCoordinates,binarySearch,buildModuleUrl,buildVoxelDrawCommands,clone,combine,computeFlyToLocationForRectangle,createBillboardPointCallback,createCommand,createDefaultImageryProviderViewModels,createDefaultTerrainProviderViewModels,createElevationBandMaterial,createGooglePhotorealistic3DTileset,createGuid,createMaterialPropertyDescriptor,createOsmBuildingsAsync,createPropertyDescriptor,createRawPropertyDescriptor,createTangentSpaceDebugPrimitive,createTaskProcessorWorker,createUniform,createUniformArray,createVectorTileBuffersFromModelComponents,createWorldBathymetryAsync,createWorldImageryAsync,createWorldTerrainAsync,decodeGoogleEarthEnterpriseData,decodeVectorPolylinePositions,defer,defined,demodernizeShader,deprecationWarning,destroyObject,exportKml,findAccessorMinMax,findContentMetadata,findGroupMetadata,findTileMetadata,forEachTextureInMaterial,formatError,freezeRenderState,getAbsoluteUri,getAccessorByteStride,getBaseUri,getBinaryAccessor,getClipAndStyleCode,getClippingFunction,getComponentReader,getElement,getExtensionFromUri,getFilenameFromUri,getImageFromTypedArray,getImagePixels,getJsonFromTypedArray,getMagic,getMeshPrimitives,getMetadataClassProperty,getMetadataProperty,getStringFromTypedArray,getTimestamp,hasExtension,heightReferenceOnEntityPropertyChanged,isBitSet,isBlobUri,isCrossOriginUrl,isDataUri,isLeapYear,knockout,knockout_3_5_1,knockout_es5,loadAndExecuteScript,loadCubeMap,loadImageFromTypedArray,loadKTX2,mergeSort,moveTechniqueRenderStates,moveTechniquesToExtension,numberOfComponentsForType,objectToQuery,oneTimeWarning,parseBatchTable,parseFeatureMetadataLegacy,parseGlb,parseResponseHeaders,parseStructuralMetadata,pickModel,pointInsideTriangle,preprocess3DTileContent,processVoxelProperties,queryToObject,readAccessorPacked,removeExtension,removeExtensionsRequired,removeExtensionsUsed,removePipelineExtras,removeUnusedElements,renderBufferPointCollection,renderBufferPolygonCollection,renderBufferPolylineCollection,resizeImageToNextPowerOfTwo,sampleTerrain,sampleTerrainMostDetailed,scaleToGeodeticSurface,srgbToLinear,subdivideArray,subscribeAndEvaluate,updateAccessorComponentTypes,updateVersion,usesExtension,viewerCesium3DTilesInspectorMixin,viewerCesiumInspectorMixin,viewerDragDropMixin,viewerPerformanceWatchdogMixin,viewerVoxelInspectorMixin,webGLConstantToGlslType,wrapFunction,writeTextToCanvas});